Skip to content

Commit

Permalink
Merge branch 'main' into city_select_code_2
Browse files Browse the repository at this point in the history
  • Loading branch information
xiexiejie authored Aug 27, 2024
2 parents dd9f3de + 002aff7 commit 2d1c080
Show file tree
Hide file tree
Showing 40 changed files with 3,214 additions and 79 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 代码质量检查
name: Code Check

on: [push, pull_request]
on: [push]

jobs:
run-lint:
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,14 @@ on:
workflows: ['Unit Tests', 'Code Check']
types:
- completed
push:
branches:
- main
tags:
- 'Publish'
if: startsWith(github.ref, 'refs/tags/v')

jobs:
build-and-publish:
# ['Unit Tests', 'Code Check']工作流成功完成
if: >
github.event.workflow_run.conclusion == 'success'
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- name: Check out code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 运行单测
name: Unit Tests

on: [push, pull_request]
on: [push]

jobs:
run-ci-test:
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.1.1",
"version": "1.0.5",
"npmClient": "npm",
"packages": ["packages/*"],
"command": {
Expand Down
17 changes: 10 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"license": "MIT",
"homepage": "https://alibaba.github.io/bifrostui",
"scripts": {
"pub": "npx lerna publish --no-private",
"v": "npx lerna version --force-publish --message 'Publish'",
"v:beta": "npx lerna version prerelease --preid=beta --force-publish --message 'Publish'",
"pub": "npx lerna publish --yes from-git",
"start:h5": "dumi dev",
"start:weapp": "node scripts/mini-program-site/index.js --type weapp",
"start:alipay": "node scripts/mini-program-site/index.js --type alipay",
Expand All @@ -25,9 +27,6 @@
"prepare": "husky install"
},
"devDependencies": {
"qrcode.react": "^3.0.2",
"lerna": "^7.1.2",
"less-plugin-npm-import": "^2.1.0",
"@babel/preset-env": "^7.16.4",
"@babel/preset-react": "^7.16.0",
"@babel/preset-typescript": "^7.16.0",
Expand Down Expand Up @@ -66,14 +65,17 @@
"jest": "^28.1.0",
"jest-environment-jsdom": "^28.1.0",
"jest-less-loader": "^0.2.0",
"lerna": "^7.1.2",
"less-plugin-npm-import": "^2.1.0",
"lint-staged": "^13.2.2",
"mdast-util-from-markdown": "^0.8.0",
"pinyin": "^2.11.2",
"postcss-less": "^6.0.0",
"prettier": "^3.0.0",
"react-test-renderer": "^18.0.0",
"qrcode.react": "^3.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-test-renderer": "^18.0.0",
"stylelint": "^15.6.1",
"stylelint-config-standard": "^33.0.0",
"stylelint-prettier": "^4.0.0",
Expand All @@ -98,5 +100,6 @@
"workspaces": [
"packages/*",
"websites/**/*"
]
}
],
"version": "0.0.0"
}
10 changes: 5 additions & 5 deletions packages/bui-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bifrostui/react",
"version": "0.1.1",
"version": "1.0.5",
"description": "React components for building mobile application",
"homepage": "http://bui.taopiaopiao.com",
"license": "MIT",
Expand Down Expand Up @@ -31,10 +31,10 @@
"father": "^4.1.8"
},
"dependencies": {
"@bifrostui/icons": "^0.1.1",
"@bifrostui/styles": "^0.1.1",
"@bifrostui/types": "^0.1.1",
"@bifrostui/utils": "^0.1.1",
"@bifrostui/icons": "^1.0.5",
"@bifrostui/styles": "^1.0.5",
"@bifrostui/types": "^1.0.5",
"@bifrostui/utils": "^1.0.5",
"clsx": "^1.2.1",
"dayjs": "^1.11.7",
"swiper": "^8.1.5"
Expand Down
82 changes: 82 additions & 0 deletions packages/bui-core/src/Modal/Modal.miniapp.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import { useForkRef } from '@bifrostui/utils';
import clsx from 'clsx';
import React, { useState } from 'react';
import { View, ViewProps } from '@tarojs/components';
import Backdrop from '../Backdrop';
import Portal from '../Portal';
import './Modal.less';
import { ModalProps } from './Modal.types';

const prefixCls = 'bui-modal';

const Modal = React.forwardRef<HTMLDivElement, ViewProps & ModalProps>(
(props, ref) => {
const {
className,
open,
BackdropProps,
children,
container,
disablePortal,
disableScrollLock,
hideBackdrop,
onClose,
keepMounted,
...others
} = props;
const modalRef = React.useRef(null);
const handleRef = useForkRef(modalRef, ref);
const [backdropExited, setBackDropExited] = useState(hideBackdrop || !open);
const mounted = open || !backdropExited || keepMounted;

const handleBackdropClick = (event) => {
if (event.target.id !== event.currentTarget.id) {
return;
}

if (onClose) {
onClose(event, { from: 'backdrop' });
}
};

if (!mounted) {
return null;
}

return (
<Portal container={container} disablePortal={disablePortal}>
<View
className={clsx(prefixCls, className)}
ref={handleRef}
catchMove={!disableScrollLock}
{...others}
>
{!hideBackdrop ? (
<Backdrop
open={open}
onClick={handleBackdropClick}
onEnter={() => setBackDropExited(false)}
onExited={() => setBackDropExited(true)}
{...BackdropProps}
className={clsx(
`${prefixCls}-backdrop`,
BackdropProps?.className,
)}
/>
) : null}
{(open || keepMounted) && children}
</View>
</Portal>
);
},
);

Modal.displayName = 'BuiModal';
Modal.defaultProps = {
open: false,
disablePortal: false,
disableScrollLock: false,
hideBackdrop: false,
};

export default Modal;
62 changes: 62 additions & 0 deletions packages/bui-core/src/Picker/Picker.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
@import '~@bifrostui/styles/mixins/index.less';

.bui-picker {
--cancel-color: var(--bui-color-fg-default);
--cancel-font-size: var(--bui-title-size-4, 15px);
--confirm-color: var(--bui-color-primary);
--confirm-font-size: var(--bui-title-size-4, 15px);
--title-color: var(--bui-color-fg-default);
--title-font-size: var(--bui-title-size-3, 16px);
--title-font-weight: var(--bui-font-weight-medium, 500);
--panel-container-height: 260px;
--indicator-top: 108px;
--indicator-height: 36px;
--indicator-border-color: var(--bui-color-border-default);
--option-color: var(--bui-color-fg-default);
--option-font-size: var(--bui-title-size-4);
--option-height: 36px;
font-family: var(--bui-font-family);

.bui-drawer-content {
border-radius: var(--bui-shape-radius-drawer) var(--bui-shape-radius-drawer)
0 0;
}

&-header {
height: 50px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 var(--bui-spacing-lg);
}

&-cancel {
width: 40px;
height: 100%;
font-size: var(--cancel-font-size);
text-align: center;
line-height: 50px;
color: var(--cancel-color);
}

&-title {
font-size: var(--title-font-size);
color: var(--title-color);
font-weight: var(--title-font-weight);
}

&-confirm {
width: 40px;
height: 100%;
font-size: var(--confirm-font-size);
text-align: center;
line-height: 50px;
color: var(--confirm-color);
}

&-container {
width: 100%;
height: var(--panel-container-height);
display: flex;
}
}
Loading

0 comments on commit 2d1c080

Please sign in to comment.