@bifrostui/react 2.0.0-alpha.0 → 2.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Alert/Alert.js +2 -1
- package/dist/Alert/__tests__/fixtures/A11yDemos.d.ts +17 -0
- package/dist/Alert/__tests__/fixtures/A11yDemos.js +143 -0
- package/dist/Alert/index.css +4 -4
- package/dist/Avatar/AvatarGroup.css +8 -8
- package/dist/Avatar/index.css +8 -8
- package/dist/Backdrop/Backdrop.js +3 -2
- package/dist/Backdrop/Backdrop.types.d.ts +4 -0
- package/dist/Backdrop/__tests__/fixtures/A11yDemos.d.ts +8 -0
- package/dist/Backdrop/__tests__/fixtures/A11yDemos.js +51 -0
- package/dist/Backdrop/index.css +2 -2
- package/dist/Badge/Badge.js +38 -11
- package/dist/Badge/Badge.types.d.ts +30 -1
- package/dist/Badge/__tests__/fixtures/A11yDemos.d.ts +25 -0
- package/dist/Badge/__tests__/fixtures/A11yDemos.js +110 -0
- package/dist/Badge/hooks/useBadgeA11y.d.ts +23 -0
- package/dist/Badge/hooks/useBadgeA11y.js +76 -0
- package/dist/Badge/hooks/useBadgeDisplay.d.ts +16 -0
- package/dist/Badge/hooks/useBadgeDisplay.js +56 -0
- package/dist/Button/Button.js +2 -1
- package/dist/Button/__tests__/fixtures/A11yDemos.d.ts +23 -0
- package/dist/Button/__tests__/fixtures/A11yDemos.js +81 -0
- package/dist/Button/index.css +4 -5
- package/dist/CSSTransition/CSSTransition.d.ts +4 -0
- package/dist/CSSTransition/CSSTransition.js +177 -0
- package/dist/CSSTransition/CSSTransition.types.d.ts +13 -0
- package/dist/CSSTransition/CSSTransition.types.js +15 -0
- package/dist/CSSTransition/demo/CSSTransitionDemo.d.ts +4 -0
- package/dist/CSSTransition/demo/CSSTransitionDemo.js +76 -0
- package/dist/CSSTransition/demo/index.css +25 -0
- package/dist/CSSTransition/index.d.ts +2 -0
- package/dist/CSSTransition/index.js +41 -0
- package/dist/Calendar/Calendar.js +131 -34
- package/dist/Calendar/Calendar.types.d.ts +16 -1
- package/dist/Calendar/__tests__/fixtures/A11yDemos.d.ts +2 -0
- package/dist/Calendar/__tests__/fixtures/A11yDemos.js +41 -0
- package/dist/Calendar/index.css +52 -9
- package/dist/Calendar/utils.d.ts +7 -3
- package/dist/Calendar/utils.js +33 -23
- package/dist/Checkbox/Checkbox.js +5 -4
- package/dist/Checkbox/__tests__/fixtures/A11yDemos.d.ts +15 -0
- package/dist/Checkbox/__tests__/fixtures/A11yDemos.js +57 -0
- package/dist/CitySelector/CitySelector.types.d.ts +0 -1
- package/dist/Collapse/Collapse.d.ts +1 -1
- package/dist/Collapse/Collapse.js +26 -12
- package/dist/Collapse/Collapse.miniapp.d.ts +10 -0
- package/dist/Collapse/Collapse.miniapp.js +255 -0
- package/dist/Collapse/index.css +40 -1
- package/dist/CollapsePanel/index.css +1 -1
- package/dist/Countdown/Countdown.js +61 -21
- package/dist/Countdown/Countdown.types.d.ts +19 -15
- package/dist/Countdown/__tests__/fixtures/A11yDemos.d.ts +23 -0
- package/dist/Countdown/__tests__/fixtures/A11yDemos.js +107 -0
- package/dist/Countdown/index.css +11 -0
- package/dist/DatePicker/DatePicker.d.ts +4 -0
- package/dist/DatePicker/DatePicker.js +335 -0
- package/dist/DatePicker/DatePicker.types.d.ts +36 -0
- package/dist/DatePicker/DatePicker.types.js +15 -0
- package/dist/DatePicker/constants.d.ts +9 -0
- package/dist/DatePicker/constants.js +37 -0
- package/dist/DatePicker/index.d.ts +3 -0
- package/dist/DatePicker/index.js +44 -0
- package/dist/DesktopDatePicker/DesktopDatePicker.css +61 -0
- package/dist/DesktopDatePicker/DesktopDatePicker.d.ts +5 -0
- package/dist/DesktopDatePicker/DesktopDatePicker.js +280 -0
- package/dist/DesktopDatePicker/DesktopDatePicker.types.d.ts +163 -0
- package/dist/DesktopDatePicker/DesktopDatePicker.types.js +15 -0
- package/dist/DesktopDatePicker/deskTopPickerContainer.css +100 -0
- package/dist/DesktopDatePicker/index.css +161 -0
- package/dist/DesktopDatePicker/index.d.ts +2 -0
- package/dist/DesktopDatePicker/index.js +41 -0
- package/dist/DesktopDatePicker/useGetDatePickerContent.d.ts +6 -0
- package/dist/DesktopDatePicker/useGetDatePickerContent.js +343 -0
- package/dist/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +5 -0
- package/dist/DesktopDateTimePicker/DesktopDateTimePicker.js +322 -0
- package/dist/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +163 -0
- package/dist/DesktopDateTimePicker/DesktopDateTimePicker.types.js +15 -0
- package/dist/DesktopDateTimePicker/index.css +66 -0
- package/dist/DesktopDateTimePicker/index.d.ts +2 -0
- package/dist/DesktopDateTimePicker/index.js +41 -0
- package/dist/DesktopPicker/DesktopPicker.d.ts +5 -0
- package/dist/DesktopPicker/DesktopPicker.js +243 -0
- package/dist/DesktopPicker/DesktopPicker.types.d.ts +61 -0
- package/dist/DesktopPicker/DesktopPicker.types.js +15 -0
- package/dist/DesktopPicker/index.css +39 -0
- package/dist/DesktopPicker/index.d.ts +2 -0
- package/dist/DesktopPicker/index.js +41 -0
- package/dist/DesktopPicker/utils/calcAfterMounted.d.ts +2 -0
- package/dist/{Tabs/utils/bound.js → DesktopPicker/utils/calcAfterMounted.js} +7 -14
- package/dist/DesktopPicker/utils/calcAfterMounted.miniapp.d.ts +2 -0
- package/dist/DesktopPicker/utils/calcAfterMounted.miniapp.js +38 -0
- package/dist/DesktopTimePicker/DesktopTimePicker.d.ts +5 -0
- package/dist/DesktopTimePicker/DesktopTimePicker.js +288 -0
- package/dist/DesktopTimePicker/DesktopTimePicker.types.d.ts +182 -0
- package/dist/DesktopTimePicker/DesktopTimePicker.types.js +15 -0
- package/dist/DesktopTimePicker/DesktopTimePickerList.d.ts +4 -0
- package/dist/DesktopTimePicker/DesktopTimePickerList.js +111 -0
- package/dist/DesktopTimePicker/index.css +170 -0
- package/dist/DesktopTimePicker/index.d.ts +2 -0
- package/dist/DesktopTimePicker/index.js +41 -0
- package/dist/DesktopTimePicker/useGetTimePickerContent.d.ts +6 -0
- package/dist/DesktopTimePicker/useGetTimePickerContent.js +249 -0
- package/dist/DesktopTimePicker/utils/scrollUtil.d.ts +2 -0
- package/dist/DesktopTimePicker/utils/scrollUtil.js +27 -0
- package/dist/DesktopTimePicker/utils/scrollUtil.miniapp.d.ts +2 -0
- package/dist/DesktopTimePicker/utils/scrollUtil.miniapp.js +51 -0
- package/dist/DesktopTimePicker/utils/utils.d.ts +28 -0
- package/dist/DesktopTimePicker/utils/utils.js +408 -0
- package/dist/Dialog/Dialog.d.ts +5 -2
- package/dist/Dialog/Dialog.js +56 -34
- package/dist/Dialog/Dialog.types.d.ts +50 -22
- package/dist/Dialog/FunctionalDialog.d.ts +10 -3
- package/dist/Dialog/FunctionalDialog.js +102 -80
- package/dist/Dialog/__tests__/fixtures/A11yDemos.d.ts +9 -0
- package/dist/Dialog/__tests__/fixtures/A11yDemos.js +78 -0
- package/dist/Dialog/index.css +19 -19
- package/dist/Dialog/index.d.ts +4 -1
- package/dist/Dialog/index.js +9 -2
- package/dist/Drawer/Drawer.js +7 -7
- package/dist/Drawer/__tests__/fixtures/A11yDemos.d.ts +21 -0
- package/dist/Drawer/__tests__/fixtures/A11yDemos.js +148 -0
- package/dist/Fade/Fade.js +2 -2
- package/dist/Fade/Fade.miniapp.d.ts +10 -0
- package/dist/Fade/Fade.miniapp.js +200 -0
- package/dist/Fade/index.css +18 -0
- package/dist/IconButton/IconButton.js +23 -8
- package/dist/IconButton/IconButton.types.d.ts +35 -1
- package/dist/IconButton/index.css +3 -0
- package/dist/Image/Image.js +17 -10
- package/dist/Image/__tests__/fixtures/A11yDemos.d.ts +21 -0
- package/dist/Image/__tests__/fixtures/A11yDemos.js +130 -0
- package/dist/Image/index.css +3 -8
- package/dist/Input/Input.js +5 -3
- package/dist/Input/__tests__/fixtures/A11yDemos.d.ts +21 -0
- package/dist/Input/__tests__/fixtures/A11yDemos.js +81 -0
- package/dist/Input/index.css +8 -8
- package/dist/ItemSelector/ItemSelector.types.d.ts +0 -1
- package/dist/Modal/Modal.js +47 -47
- package/dist/Modal/Modal.miniapp.d.ts +2 -2
- package/dist/Modal/Modal.miniapp.js +48 -32
- package/dist/Modal/Modal.types.d.ts +26 -2
- package/dist/Modal/ModalManager.d.ts +21 -0
- package/dist/Modal/ModalManager.js +238 -0
- package/dist/Modal/__tests__/fixtures/A11yDemos.d.ts +8 -0
- package/dist/Modal/__tests__/fixtures/A11yDemos.js +52 -0
- package/dist/Modal/index.css +1 -1
- package/dist/Modal/index.d.ts +3 -0
- package/dist/Modal/index.js +9 -1
- package/dist/Modal/useModal.d.ts +24 -0
- package/dist/Modal/useModal.js +190 -0
- package/dist/NavBar/index.css +2 -2
- package/dist/Picker/Picker.css +4 -0
- package/dist/Picker/Picker.js +72 -18
- package/dist/Picker/Picker.types.d.ts +15 -2
- package/dist/Picker/PickerPanel.css +4 -0
- package/dist/Picker/PickerPanel.js +52 -41
- package/dist/Picker/__tests__/fixtures/A11yDemos.d.ts +2 -0
- package/dist/Picker/__tests__/fixtures/A11yDemos.js +79 -0
- package/dist/Picker/index.css +8 -0
- package/dist/Picker/utils.d.ts +8 -5
- package/dist/Picker/utils.js +9 -12
- package/dist/Popover/Popover.js +123 -91
- package/dist/Popover/Popover.types.d.ts +44 -7
- package/dist/Popover/__tests__/fixtures/A11yDemos.d.ts +25 -0
- package/dist/Popover/__tests__/fixtures/A11yDemos.js +175 -0
- package/dist/Popover/hooks/index.d.ts +8 -0
- package/dist/Popover/hooks/index.js +36 -0
- package/dist/Popover/hooks/usePopoverA11y.d.ts +14 -0
- package/dist/Popover/hooks/usePopoverA11y.js +66 -0
- package/dist/Popover/hooks/usePopoverEvents.d.ts +21 -0
- package/dist/Popover/hooks/usePopoverEvents.js +150 -0
- package/dist/Popover/hooks/usePopoverPosition.d.ts +17 -0
- package/dist/Popover/hooks/usePopoverPosition.js +124 -0
- package/dist/Popover/hooks/usePopoverState.d.ts +16 -0
- package/dist/Popover/hooks/usePopoverState.js +54 -0
- package/dist/Portal/Portal.miniapp.js +20 -11
- package/dist/Portal/Portal.types.d.ts +1 -1
- package/dist/Portal/PortalCore.js +2 -2
- package/dist/Progress/Progress.js +61 -6
- package/dist/Progress/Progress.types.d.ts +44 -0
- package/dist/Progress/__tests__/fixtures/A11yDemos.d.ts +21 -0
- package/dist/Progress/__tests__/fixtures/A11yDemos.js +100 -0
- package/dist/Radio/Radio.js +5 -4
- package/dist/Radio/RadioGroup.js +1 -1
- package/dist/Radio/__tests__/fixtures/A11yDemos.d.ts +15 -0
- package/dist/Radio/__tests__/fixtures/A11yDemos.js +57 -0
- package/dist/Rating/index.css +8 -12
- package/dist/ScrollView/ScrollView.js +48 -196
- package/dist/ScrollView/ScrollView.types.d.ts +120 -86
- package/dist/ScrollView/__tests__/fixtures/A11yDemos.d.ts +7 -0
- package/dist/ScrollView/__tests__/fixtures/A11yDemos.js +319 -0
- package/dist/ScrollView/useScrollView.d.ts +10 -0
- package/dist/ScrollView/useScrollView.js +300 -0
- package/dist/Select/Select.js +73 -39
- package/dist/Select/Select.types.d.ts +2 -2
- package/dist/Select/SelectOption.js +5 -1
- package/dist/Select/__tests__/fixtures/A11yDemos.d.ts +21 -0
- package/dist/Select/__tests__/fixtures/A11yDemos.js +154 -0
- package/dist/Select/index.css +12 -8
- package/dist/Select/selectContext.d.ts +0 -1
- package/dist/Slide/Slide.js +2 -2
- package/dist/Slide/Slide.miniapp.d.ts +14 -0
- package/dist/Slide/Slide.miniapp.js +213 -0
- package/dist/Slide/index.css +72 -0
- package/dist/Slider/Slider.js +13 -5
- package/dist/Stack/demo/index.css +2 -0
- package/dist/SwipeAction/SwipeAction.css +79 -0
- package/dist/SwipeAction/SwipeAction.d.ts +5 -0
- package/dist/SwipeAction/SwipeAction.js +349 -0
- package/dist/SwipeAction/SwipeAction.types.d.ts +75 -0
- package/dist/SwipeAction/SwipeAction.types.js +15 -0
- package/dist/SwipeAction/SwipeActionContext.d.ts +3 -0
- package/dist/SwipeAction/SwipeActionContext.js +30 -0
- package/dist/SwipeAction/SwipeActionItem.css +31 -0
- package/dist/SwipeAction/SwipeActionItem.d.ts +5 -0
- package/dist/SwipeAction/SwipeActionItem.js +105 -0
- package/dist/SwipeAction/constants.d.ts +9 -0
- package/dist/SwipeAction/constants.js +39 -0
- package/dist/SwipeAction/index.css +110 -0
- package/dist/SwipeAction/index.d.ts +5 -0
- package/dist/SwipeAction/index.js +50 -0
- package/dist/Swiper/Swiper.js +18 -4
- package/dist/Switch/Switch.js +5 -4
- package/dist/Switch/__tests__/fixtures/A11yDemos.d.ts +15 -0
- package/dist/Switch/__tests__/fixtures/A11yDemos.js +57 -0
- package/dist/Tabs/Tab.js +36 -21
- package/dist/Tabs/Tab.types.d.ts +1 -1
- package/dist/Tabs/TabPanel.d.ts +1 -1
- package/dist/Tabs/TabPanel.js +9 -5
- package/dist/Tabs/Tabs.css +2 -2
- package/dist/Tabs/Tabs.js +87 -64
- package/dist/Tabs/Tabs.types.d.ts +1 -1
- package/dist/Tabs/TabsContext.d.ts +4 -5
- package/dist/Tabs/TabsContext.js +3 -1
- package/dist/Tabs/index.css +2 -2
- package/dist/Tabs/utils/scroll.d.ts +2 -0
- package/dist/Tabs/utils/scroll.js +55 -0
- package/dist/Tag/__tests__/fixtures/A11yDemos.d.ts +21 -0
- package/dist/Tag/__tests__/fixtures/A11yDemos.js +196 -0
- package/dist/TextArea/TextArea.js +50 -7
- package/dist/TextArea/TextArea.types.d.ts +28 -0
- package/dist/TextArea/__tests__/fixtures/A11yDemos.d.ts +19 -0
- package/dist/TextArea/__tests__/fixtures/A11yDemos.js +91 -0
- package/dist/TextArea/index.css +4 -4
- package/dist/ThemeProvider/ThemeProvider.types.d.ts +2 -2
- package/dist/ThemeProvider/ThemeProvider.types.js +0 -12
- package/dist/Toast/FunctionalToast.d.ts +2 -2
- package/dist/Toast/FunctionalToast.js +180 -85
- package/dist/Toast/Toast.d.ts +2 -2
- package/dist/Toast/Toast.js +69 -28
- package/dist/Toast/Toast.types.d.ts +13 -10
- package/dist/Toast/__tests__/fixtures/A11yDemos.d.ts +2 -0
- package/dist/Toast/__tests__/fixtures/A11yDemos.js +54 -0
- package/dist/Toast/index.css +0 -1
- package/dist/Tooltip/Tooltip.js +63 -107
- package/dist/Tooltip/Tooltip.types.d.ts +94 -43
- package/dist/Tooltip/__tests__/fixtures/A11yDemos.d.ts +25 -0
- package/dist/Tooltip/__tests__/fixtures/A11yDemos.js +100 -0
- package/dist/Tooltip/useTooltip.d.ts +29 -0
- package/dist/Tooltip/useTooltip.js +313 -0
- package/dist/Transition/TransitionCore.js +30 -25
- package/dist/TransitionGroup/TransitionGroup.d.ts +7 -0
- package/dist/TransitionGroup/TransitionGroup.js +132 -0
- package/dist/TransitionGroup/TransitionGroup.types.d.ts +47 -0
- package/dist/TransitionGroup/TransitionGroup.types.js +15 -0
- package/dist/TransitionGroup/demo/TransitionGroupDemo.d.ts +4 -0
- package/dist/TransitionGroup/demo/TransitionGroupDemo.js +68 -0
- package/dist/TransitionGroup/demo/index.css +33 -0
- package/dist/TransitionGroup/index.d.ts +2 -0
- package/dist/TransitionGroup/index.js +41 -0
- package/dist/TransitionGroup/utils/childMapping.d.ts +27 -0
- package/dist/TransitionGroup/utils/childMapping.js +119 -0
- package/dist/_.._/benchmarks/components/Button.js +41 -0
- package/dist/_.._/benchmarks/components/Input.js +45 -0
- package/dist/_.._/benchmarks/components/Tabs.js +50 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +17 -1
- package/dist/locales/base.d.ts +40 -1
- package/dist/locales/en-US.js +54 -2
- package/dist/locales/zh-CN.js +56 -1
- package/dist/locales/zh-TW.js +56 -1
- package/es/Alert/Alert.js +2 -1
- package/es/Alert/__tests__/fixtures/A11yDemos.d.ts +17 -0
- package/es/Alert/__tests__/fixtures/A11yDemos.js +107 -0
- package/es/Alert/index.css +4 -4
- package/es/Avatar/AvatarGroup.css +8 -8
- package/es/Avatar/index.css +8 -8
- package/es/Backdrop/Backdrop.js +3 -2
- package/es/Backdrop/Backdrop.types.d.ts +4 -0
- package/es/Backdrop/__tests__/fixtures/A11yDemos.d.ts +8 -0
- package/es/Backdrop/__tests__/fixtures/A11yDemos.js +17 -0
- package/es/Backdrop/index.css +2 -2
- package/es/Badge/Badge.js +38 -11
- package/es/Badge/Badge.types.d.ts +30 -1
- package/es/Badge/__tests__/fixtures/A11yDemos.d.ts +25 -0
- package/es/Badge/__tests__/fixtures/A11yDemos.js +70 -0
- package/es/Badge/hooks/useBadgeA11y.d.ts +23 -0
- package/es/Badge/hooks/useBadgeA11y.js +53 -0
- package/es/Badge/hooks/useBadgeDisplay.d.ts +16 -0
- package/es/Badge/hooks/useBadgeDisplay.js +33 -0
- package/es/Button/Button.js +2 -1
- package/es/Button/__tests__/fixtures/A11yDemos.d.ts +23 -0
- package/es/Button/__tests__/fixtures/A11yDemos.js +42 -0
- package/es/Button/index.css +4 -5
- package/es/CSSTransition/CSSTransition.d.ts +4 -0
- package/es/CSSTransition/CSSTransition.js +153 -0
- package/es/CSSTransition/CSSTransition.types.d.ts +13 -0
- package/es/CSSTransition/CSSTransition.types.js +1 -0
- package/es/CSSTransition/demo/CSSTransitionDemo.d.ts +4 -0
- package/es/CSSTransition/demo/CSSTransitionDemo.js +47 -0
- package/es/CSSTransition/demo/index.css +25 -0
- package/es/CSSTransition/index.d.ts +2 -0
- package/es/CSSTransition/index.js +6 -0
- package/es/Calendar/Calendar.js +131 -34
- package/es/Calendar/Calendar.types.d.ts +16 -1
- package/es/Calendar/__tests__/fixtures/A11yDemos.d.ts +2 -0
- package/es/Calendar/__tests__/fixtures/A11yDemos.js +8 -0
- package/es/Calendar/index.css +52 -9
- package/es/Calendar/utils.d.ts +7 -3
- package/es/Calendar/utils.js +29 -20
- package/es/Checkbox/Checkbox.js +5 -4
- package/es/Checkbox/__tests__/fixtures/A11yDemos.d.ts +15 -0
- package/es/Checkbox/__tests__/fixtures/A11yDemos.js +22 -0
- package/es/CitySelector/CitySelector.types.d.ts +0 -1
- package/es/Collapse/Collapse.d.ts +1 -1
- package/es/Collapse/Collapse.js +26 -12
- package/es/Collapse/Collapse.miniapp.d.ts +10 -0
- package/es/Collapse/Collapse.miniapp.js +236 -0
- package/es/Collapse/index.css +40 -1
- package/es/CollapsePanel/index.css +1 -1
- package/es/Countdown/Countdown.js +61 -21
- package/es/Countdown/Countdown.types.d.ts +19 -15
- package/es/Countdown/__tests__/fixtures/A11yDemos.d.ts +23 -0
- package/es/Countdown/__tests__/fixtures/A11yDemos.js +68 -0
- package/es/Countdown/index.css +11 -0
- package/es/DatePicker/DatePicker.d.ts +4 -0
- package/es/DatePicker/DatePicker.js +308 -0
- package/es/DatePicker/DatePicker.types.d.ts +36 -0
- package/es/DatePicker/DatePicker.types.js +1 -0
- package/es/DatePicker/constants.d.ts +9 -0
- package/es/DatePicker/constants.js +14 -0
- package/es/DatePicker/index.d.ts +3 -0
- package/es/DatePicker/index.js +8 -0
- package/es/DesktopDatePicker/DesktopDatePicker.css +61 -0
- package/es/DesktopDatePicker/DesktopDatePicker.d.ts +5 -0
- package/es/DesktopDatePicker/DesktopDatePicker.js +253 -0
- package/es/DesktopDatePicker/DesktopDatePicker.types.d.ts +163 -0
- package/es/DesktopDatePicker/DesktopDatePicker.types.js +1 -0
- package/es/DesktopDatePicker/deskTopPickerContainer.css +100 -0
- package/es/DesktopDatePicker/index.css +161 -0
- package/es/DesktopDatePicker/index.d.ts +2 -0
- package/es/DesktopDatePicker/index.js +6 -0
- package/es/DesktopDatePicker/useGetDatePickerContent.d.ts +6 -0
- package/es/DesktopDatePicker/useGetDatePickerContent.js +316 -0
- package/es/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +5 -0
- package/es/DesktopDateTimePicker/DesktopDateTimePicker.js +295 -0
- package/es/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +163 -0
- package/es/DesktopDateTimePicker/DesktopDateTimePicker.types.js +1 -0
- package/es/DesktopDateTimePicker/index.css +66 -0
- package/es/DesktopDateTimePicker/index.d.ts +2 -0
- package/es/DesktopDateTimePicker/index.js +9 -0
- package/es/DesktopPicker/DesktopPicker.d.ts +5 -0
- package/es/DesktopPicker/DesktopPicker.js +226 -0
- package/es/DesktopPicker/DesktopPicker.types.d.ts +61 -0
- package/es/DesktopPicker/DesktopPicker.types.js +1 -0
- package/es/DesktopPicker/index.css +39 -0
- package/es/DesktopPicker/index.d.ts +2 -0
- package/es/DesktopPicker/index.js +6 -0
- package/es/DesktopPicker/utils/calcAfterMounted.d.ts +2 -0
- package/es/DesktopPicker/utils/calcAfterMounted.js +6 -0
- package/es/DesktopPicker/utils/calcAfterMounted.miniapp.d.ts +2 -0
- package/es/DesktopPicker/utils/calcAfterMounted.miniapp.js +9 -0
- package/es/DesktopTimePicker/DesktopTimePicker.d.ts +5 -0
- package/es/DesktopTimePicker/DesktopTimePicker.js +261 -0
- package/es/DesktopTimePicker/DesktopTimePicker.types.d.ts +182 -0
- package/es/DesktopTimePicker/DesktopTimePicker.types.js +1 -0
- package/es/DesktopTimePicker/DesktopTimePickerList.d.ts +4 -0
- package/es/DesktopTimePicker/DesktopTimePickerList.js +84 -0
- package/es/DesktopTimePicker/index.css +170 -0
- package/es/DesktopTimePicker/index.d.ts +2 -0
- package/es/DesktopTimePicker/index.js +6 -0
- package/es/DesktopTimePicker/useGetTimePickerContent.d.ts +6 -0
- package/es/DesktopTimePicker/useGetTimePickerContent.js +226 -0
- package/es/DesktopTimePicker/utils/scrollUtil.d.ts +2 -0
- package/es/DesktopTimePicker/utils/scrollUtil.js +8 -0
- package/es/DesktopTimePicker/utils/scrollUtil.miniapp.d.ts +2 -0
- package/es/DesktopTimePicker/utils/scrollUtil.miniapp.js +22 -0
- package/es/DesktopTimePicker/utils/utils.d.ts +28 -0
- package/es/DesktopTimePicker/utils/utils.js +365 -0
- package/es/Dialog/Dialog.d.ts +5 -2
- package/es/Dialog/Dialog.js +57 -35
- package/es/Dialog/Dialog.types.d.ts +50 -22
- package/es/Dialog/FunctionalDialog.d.ts +10 -3
- package/es/Dialog/FunctionalDialog.js +106 -84
- package/es/Dialog/__tests__/fixtures/A11yDemos.d.ts +9 -0
- package/es/Dialog/__tests__/fixtures/A11yDemos.js +43 -0
- package/es/Dialog/index.css +19 -19
- package/es/Dialog/index.d.ts +4 -1
- package/es/Dialog/index.js +10 -3
- package/es/Drawer/Drawer.js +8 -8
- package/es/Drawer/__tests__/fixtures/A11yDemos.d.ts +21 -0
- package/es/Drawer/__tests__/fixtures/A11yDemos.js +112 -0
- package/es/Fade/Fade.js +2 -2
- package/es/Fade/Fade.miniapp.d.ts +10 -0
- package/es/Fade/Fade.miniapp.js +179 -0
- package/es/Fade/index.css +18 -0
- package/es/IconButton/IconButton.js +23 -8
- package/es/IconButton/IconButton.types.d.ts +35 -1
- package/es/IconButton/index.css +3 -0
- package/es/Image/Image.js +17 -10
- package/es/Image/__tests__/fixtures/A11yDemos.d.ts +21 -0
- package/es/Image/__tests__/fixtures/A11yDemos.js +92 -0
- package/es/Image/index.css +3 -8
- package/es/Input/Input.js +5 -3
- package/es/Input/__tests__/fixtures/A11yDemos.d.ts +21 -0
- package/es/Input/__tests__/fixtures/A11yDemos.js +43 -0
- package/es/Input/index.css +8 -8
- package/es/ItemSelector/ItemSelector.types.d.ts +0 -1
- package/es/Modal/Modal.js +48 -48
- package/es/Modal/Modal.miniapp.d.ts +2 -2
- package/es/Modal/Modal.miniapp.js +49 -33
- package/es/Modal/Modal.types.d.ts +26 -2
- package/es/Modal/ModalManager.d.ts +21 -0
- package/es/Modal/ModalManager.js +214 -0
- package/es/Modal/__tests__/fixtures/A11yDemos.d.ts +8 -0
- package/es/Modal/__tests__/fixtures/A11yDemos.js +18 -0
- package/es/Modal/index.css +1 -1
- package/es/Modal/index.d.ts +3 -0
- package/es/Modal/index.js +6 -1
- package/es/Modal/useModal.d.ts +24 -0
- package/es/Modal/useModal.js +169 -0
- package/es/NavBar/index.css +2 -2
- package/es/Picker/Picker.css +4 -0
- package/es/Picker/Picker.js +72 -18
- package/es/Picker/Picker.types.d.ts +15 -2
- package/es/Picker/PickerPanel.css +4 -0
- package/es/Picker/PickerPanel.js +52 -41
- package/es/Picker/__tests__/fixtures/A11yDemos.d.ts +2 -0
- package/es/Picker/__tests__/fixtures/A11yDemos.js +46 -0
- package/es/Picker/index.css +8 -0
- package/es/Picker/utils.d.ts +8 -5
- package/es/Picker/utils.js +9 -12
- package/es/Popover/Popover.js +130 -99
- package/es/Popover/Popover.types.d.ts +44 -7
- package/es/Popover/__tests__/fixtures/A11yDemos.d.ts +25 -0
- package/es/Popover/__tests__/fixtures/A11yDemos.js +135 -0
- package/es/Popover/hooks/index.d.ts +8 -0
- package/es/Popover/hooks/index.js +10 -0
- package/es/Popover/hooks/usePopoverA11y.d.ts +14 -0
- package/es/Popover/hooks/usePopoverA11y.js +43 -0
- package/es/Popover/hooks/usePopoverEvents.d.ts +21 -0
- package/es/Popover/hooks/usePopoverEvents.js +127 -0
- package/es/Popover/hooks/usePopoverPosition.d.ts +17 -0
- package/es/Popover/hooks/usePopoverPosition.js +105 -0
- package/es/Popover/hooks/usePopoverState.d.ts +16 -0
- package/es/Popover/hooks/usePopoverState.js +31 -0
- package/es/Portal/Portal.miniapp.js +21 -12
- package/es/Portal/Portal.types.d.ts +1 -1
- package/es/Portal/PortalCore.js +2 -2
- package/es/Progress/Progress.js +61 -6
- package/es/Progress/Progress.types.d.ts +44 -0
- package/es/Progress/__tests__/fixtures/A11yDemos.d.ts +21 -0
- package/es/Progress/__tests__/fixtures/A11yDemos.js +62 -0
- package/es/Radio/Radio.js +5 -4
- package/es/Radio/RadioGroup.js +1 -1
- package/es/Radio/__tests__/fixtures/A11yDemos.d.ts +15 -0
- package/es/Radio/__tests__/fixtures/A11yDemos.js +22 -0
- package/es/Rating/index.css +8 -12
- package/es/ScrollView/ScrollView.js +51 -197
- package/es/ScrollView/ScrollView.types.d.ts +120 -86
- package/es/ScrollView/__tests__/fixtures/A11yDemos.d.ts +7 -0
- package/es/ScrollView/__tests__/fixtures/A11yDemos.js +283 -0
- package/es/ScrollView/useScrollView.d.ts +10 -0
- package/es/ScrollView/useScrollView.js +279 -0
- package/es/Select/Select.js +73 -40
- package/es/Select/Select.types.d.ts +2 -2
- package/es/Select/SelectOption.js +5 -1
- package/es/Select/__tests__/fixtures/A11yDemos.d.ts +21 -0
- package/es/Select/__tests__/fixtures/A11yDemos.js +118 -0
- package/es/Select/index.css +12 -8
- package/es/Select/selectContext.d.ts +0 -1
- package/es/Slide/Slide.js +2 -2
- package/es/Slide/Slide.miniapp.d.ts +14 -0
- package/es/Slide/Slide.miniapp.js +192 -0
- package/es/Slide/index.css +72 -0
- package/es/Slider/Slider.js +16 -6
- package/es/Stack/demo/index.css +2 -0
- package/es/SwipeAction/SwipeAction.css +79 -0
- package/es/SwipeAction/SwipeAction.d.ts +5 -0
- package/es/SwipeAction/SwipeAction.js +334 -0
- package/es/SwipeAction/SwipeAction.types.d.ts +75 -0
- package/es/SwipeAction/SwipeAction.types.js +1 -0
- package/es/SwipeAction/SwipeActionContext.d.ts +3 -0
- package/es/SwipeAction/SwipeActionContext.js +11 -0
- package/es/SwipeAction/SwipeActionItem.css +31 -0
- package/es/SwipeAction/SwipeActionItem.d.ts +5 -0
- package/es/SwipeAction/SwipeActionItem.js +78 -0
- package/es/SwipeAction/constants.d.ts +9 -0
- package/es/SwipeAction/constants.js +15 -0
- package/es/SwipeAction/index.css +110 -0
- package/es/SwipeAction/index.d.ts +5 -0
- package/es/SwipeAction/index.js +12 -0
- package/es/Swiper/Swiper.js +18 -4
- package/es/Switch/Switch.js +5 -4
- package/es/Switch/__tests__/fixtures/A11yDemos.d.ts +15 -0
- package/es/Switch/__tests__/fixtures/A11yDemos.js +22 -0
- package/es/Tabs/Tab.js +36 -21
- package/es/Tabs/Tab.types.d.ts +1 -1
- package/es/Tabs/TabPanel.d.ts +1 -1
- package/es/Tabs/TabPanel.js +8 -4
- package/es/Tabs/Tabs.css +2 -2
- package/es/Tabs/Tabs.js +87 -64
- package/es/Tabs/Tabs.types.d.ts +1 -1
- package/es/Tabs/TabsContext.d.ts +4 -5
- package/es/Tabs/TabsContext.js +3 -1
- package/es/Tabs/index.css +2 -2
- package/es/Tabs/utils/scroll.d.ts +2 -0
- package/es/Tabs/utils/scroll.js +36 -0
- package/es/Tag/__tests__/fixtures/A11yDemos.d.ts +21 -0
- package/es/Tag/__tests__/fixtures/A11yDemos.js +160 -0
- package/es/TextArea/TextArea.js +51 -8
- package/es/TextArea/TextArea.types.d.ts +28 -0
- package/es/TextArea/__tests__/fixtures/A11yDemos.d.ts +19 -0
- package/es/TextArea/__tests__/fixtures/A11yDemos.js +54 -0
- package/es/TextArea/index.css +4 -4
- package/es/ThemeProvider/ThemeProvider.types.d.ts +2 -2
- package/es/Toast/FunctionalToast.d.ts +2 -2
- package/es/Toast/FunctionalToast.js +186 -86
- package/es/Toast/Toast.d.ts +2 -2
- package/es/Toast/Toast.js +69 -28
- package/es/Toast/Toast.types.d.ts +13 -10
- package/es/Toast/__tests__/fixtures/A11yDemos.d.ts +2 -0
- package/es/Toast/__tests__/fixtures/A11yDemos.js +21 -0
- package/es/Toast/index.css +0 -1
- package/es/Tooltip/Tooltip.js +64 -114
- package/es/Tooltip/Tooltip.types.d.ts +94 -43
- package/es/Tooltip/__tests__/fixtures/A11yDemos.d.ts +25 -0
- package/es/Tooltip/__tests__/fixtures/A11yDemos.js +60 -0
- package/es/Tooltip/useTooltip.d.ts +29 -0
- package/es/Tooltip/useTooltip.js +290 -0
- package/es/Transition/TransitionCore.js +31 -26
- package/es/TransitionGroup/TransitionGroup.d.ts +7 -0
- package/es/TransitionGroup/TransitionGroup.js +109 -0
- package/es/TransitionGroup/TransitionGroup.types.d.ts +47 -0
- package/es/TransitionGroup/TransitionGroup.types.js +1 -0
- package/es/TransitionGroup/demo/TransitionGroupDemo.d.ts +4 -0
- package/es/TransitionGroup/demo/TransitionGroupDemo.js +39 -0
- package/es/TransitionGroup/demo/index.css +33 -0
- package/es/TransitionGroup/index.d.ts +2 -0
- package/es/TransitionGroup/index.js +6 -0
- package/es/TransitionGroup/utils/childMapping.d.ts +27 -0
- package/es/TransitionGroup/utils/childMapping.js +93 -0
- package/es/_.._/benchmarks/components/Button.js +8 -0
- package/es/_.._/benchmarks/components/Input.js +12 -0
- package/es/_.._/benchmarks/components/Tabs.js +17 -0
- package/es/index.d.ts +8 -0
- package/es/index.js +8 -0
- package/es/locales/base.d.ts +40 -1
- package/es/locales/en-US.js +54 -2
- package/es/locales/zh-CN.js +56 -1
- package/es/locales/zh-TW.js +56 -1
- package/package.json +9 -6
- package/dist/Tabs/utils/bound.d.ts +0 -1
- package/es/Tabs/utils/bound.d.ts +0 -1
- package/es/Tabs/utils/bound.js +0 -13
|
@@ -18,28 +18,37 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
import Taro from "@tarojs/taro";
|
|
21
|
-
import React, { forwardRef, useMemo } from "react";
|
|
21
|
+
import React, { forwardRef, useLayoutEffect, useState, useMemo } from "react";
|
|
22
22
|
import PortalCore from "./PortalCore";
|
|
23
23
|
const Portal = forwardRef((props, ref) => {
|
|
24
24
|
const { disablePortal } = props;
|
|
25
|
-
const rootWrapperElement =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
const [rootWrapperElement, setRootWrapperElement] = useState();
|
|
26
|
+
const initialPageInfo = useMemo(() => {
|
|
27
|
+
const currentPages = Taro.getCurrentPages() || [];
|
|
28
|
+
const currentPage = currentPages[currentPages.length - 1];
|
|
29
|
+
return {
|
|
30
|
+
path: currentPage == null ? void 0 : currentPage.$taroPath
|
|
31
|
+
};
|
|
32
|
+
}, []);
|
|
33
|
+
useLayoutEffect(() => {
|
|
34
|
+
let root;
|
|
35
|
+
if (!disablePortal && initialPageInfo.path) {
|
|
36
|
+
const { path } = initialPageInfo;
|
|
37
|
+
const rootElement = document.getElementById(path);
|
|
38
|
+
const elementWithSid = rootElement;
|
|
39
|
+
const portalId = (elementWithSid == null ? void 0 : elementWithSid.sid) ? `${elementWithSid.sid}_portalId` : `${path}_portalId`;
|
|
32
40
|
const portalWrapperElement = document.getElementById(portalId);
|
|
33
41
|
if (!portalWrapperElement) {
|
|
34
42
|
const view = document.createElement("view");
|
|
35
43
|
view.id = portalId;
|
|
36
44
|
rootElement == null ? void 0 : rootElement.appendChild(view);
|
|
37
|
-
|
|
45
|
+
root = view;
|
|
46
|
+
} else {
|
|
47
|
+
root = portalWrapperElement;
|
|
38
48
|
}
|
|
39
|
-
return portalWrapperElement;
|
|
40
49
|
}
|
|
41
|
-
|
|
42
|
-
}, []);
|
|
50
|
+
setRootWrapperElement(root);
|
|
51
|
+
}, [disablePortal, initialPageInfo.path]);
|
|
43
52
|
return /* @__PURE__ */ React.createElement(PortalCore, __spreadProps(__spreadValues({}, props), { ref, rootElement: rootWrapperElement }));
|
|
44
53
|
});
|
|
45
54
|
Portal.displayName = "BuiPortal";
|
package/es/Portal/PortalCore.js
CHANGED
|
@@ -11,7 +11,7 @@ const PortalCore = /* @__PURE__ */ React.forwardRef(
|
|
|
11
11
|
container,
|
|
12
12
|
disablePortal = false,
|
|
13
13
|
rootElement,
|
|
14
|
-
|
|
14
|
+
onMounted
|
|
15
15
|
} = props;
|
|
16
16
|
const [mountNode, setMountNode] = React.useState(null);
|
|
17
17
|
const handleRef = useForkRef(
|
|
@@ -27,7 +27,7 @@ const PortalCore = /* @__PURE__ */ React.forwardRef(
|
|
|
27
27
|
useLayoutEffect(() => {
|
|
28
28
|
if (mountNode && !disablePortal) {
|
|
29
29
|
setRef(ref, mountNode);
|
|
30
|
-
|
|
30
|
+
onMounted == null ? void 0 : onMounted(mountNode);
|
|
31
31
|
return () => {
|
|
32
32
|
setRef(ref, null);
|
|
33
33
|
};
|
package/es/Progress/Progress.js
CHANGED
|
@@ -28,6 +28,7 @@ var __objRest = (source, exclude) => {
|
|
|
28
28
|
};
|
|
29
29
|
import clsx from "clsx";
|
|
30
30
|
import React from "react";
|
|
31
|
+
import { useLocaleText } from "../locales";
|
|
31
32
|
import "./index.css";
|
|
32
33
|
const prefixCls = "bui-progress";
|
|
33
34
|
function validProgress(progress) {
|
|
@@ -63,20 +64,55 @@ const handleGradient = (strokeColor) => {
|
|
|
63
64
|
}
|
|
64
65
|
return { backgroundImage: `linear-gradient(${direction}, ${from}, ${to})` };
|
|
65
66
|
};
|
|
67
|
+
function getAriaValueText(progress, t) {
|
|
68
|
+
const validatedProgress = validProgress(progress);
|
|
69
|
+
if (validatedProgress === 0)
|
|
70
|
+
return t.notStarted;
|
|
71
|
+
if (validatedProgress < 10)
|
|
72
|
+
return t.justBegun;
|
|
73
|
+
if (validatedProgress < 25)
|
|
74
|
+
return t.gettingStarted;
|
|
75
|
+
if (validatedProgress < 50)
|
|
76
|
+
return t.inProgress;
|
|
77
|
+
if (validatedProgress < 75)
|
|
78
|
+
return t.moreThanHalfway;
|
|
79
|
+
if (validatedProgress < 90)
|
|
80
|
+
return t.nearingCompletion;
|
|
81
|
+
if (validatedProgress < 100)
|
|
82
|
+
return t.almostComplete;
|
|
83
|
+
return t.complete;
|
|
84
|
+
}
|
|
66
85
|
const Progress = /* @__PURE__ */ React.forwardRef(
|
|
67
86
|
(props, ref) => {
|
|
87
|
+
const progressText = useLocaleText("progress");
|
|
68
88
|
const _a = props, {
|
|
69
89
|
className,
|
|
70
|
-
percent,
|
|
71
|
-
strokeWidth,
|
|
72
|
-
strokeColor,
|
|
73
|
-
trailColor
|
|
90
|
+
percent = 0,
|
|
91
|
+
strokeWidth: strokeWidth,
|
|
92
|
+
strokeColor: strokeColor,
|
|
93
|
+
trailColor: trailColor,
|
|
94
|
+
// 轨道颜色
|
|
95
|
+
"aria-label": ariaLabel = progressText.labelName,
|
|
96
|
+
"aria-labelledby": ariaLabelledby = "",
|
|
97
|
+
"aria-valuenow": ariaValueNow,
|
|
98
|
+
"aria-valuemin": ariaValueMin = 0,
|
|
99
|
+
"aria-valuemax": ariaValueMax = 100,
|
|
100
|
+
"aria-valuetext": ariaValueText
|
|
74
101
|
} = _a, others = __objRest(_a, [
|
|
75
102
|
"className",
|
|
76
103
|
"percent",
|
|
104
|
+
// 当前进度百分比
|
|
77
105
|
"strokeWidth",
|
|
106
|
+
// 进度条高度
|
|
78
107
|
"strokeColor",
|
|
79
|
-
|
|
108
|
+
// 进度条颜色或渐变
|
|
109
|
+
"trailColor",
|
|
110
|
+
"aria-label",
|
|
111
|
+
"aria-labelledby",
|
|
112
|
+
"aria-valuenow",
|
|
113
|
+
"aria-valuemin",
|
|
114
|
+
"aria-valuemax",
|
|
115
|
+
"aria-valuetext"
|
|
80
116
|
]);
|
|
81
117
|
const backgroundProps = strokeColor && typeof strokeColor !== "string" ? handleGradient(strokeColor) : {
|
|
82
118
|
background: strokeColor
|
|
@@ -88,7 +124,26 @@ const Progress = /* @__PURE__ */ React.forwardRef(
|
|
|
88
124
|
const trailStyle = {
|
|
89
125
|
background: trailColor || void 0
|
|
90
126
|
};
|
|
91
|
-
|
|
127
|
+
const accessibilityProps = {
|
|
128
|
+
"aria-valuenow": typeof ariaValueNow === "number" ? ariaValueNow : validProgress(percent),
|
|
129
|
+
"aria-label": ariaLabel,
|
|
130
|
+
"aria-labelledby": ariaLabelledby,
|
|
131
|
+
"aria-valuemin": ariaValueMin,
|
|
132
|
+
"aria-valuemax": ariaValueMax,
|
|
133
|
+
"aria-valuetext": ariaValueText !== void 0 ? ariaValueText : getAriaValueText(percent, progressText),
|
|
134
|
+
role: "progressbar"
|
|
135
|
+
};
|
|
136
|
+
return (
|
|
137
|
+
// 外层容器
|
|
138
|
+
/* @__PURE__ */ React.createElement(
|
|
139
|
+
"div",
|
|
140
|
+
__spreadValues(__spreadValues({
|
|
141
|
+
className: clsx(prefixCls, className),
|
|
142
|
+
ref
|
|
143
|
+
}, accessibilityProps), others),
|
|
144
|
+
/* @__PURE__ */ React.createElement("div", { className: `${prefixCls}-inner`, style: trailStyle }, /* @__PURE__ */ React.createElement("div", { className: `${prefixCls}-bg`, style: percentStyle }))
|
|
145
|
+
)
|
|
146
|
+
);
|
|
92
147
|
}
|
|
93
148
|
);
|
|
94
149
|
Progress.displayName = "BuiProgress";
|
|
@@ -22,6 +22,50 @@ export type ProgressProps<D extends React.ElementType = 'div', P = {}> = Overrid
|
|
|
22
22
|
trailColor?: string;
|
|
23
23
|
/** 进度条线的宽度,单位 */
|
|
24
24
|
strokeWidth?: number | string;
|
|
25
|
+
/**
|
|
26
|
+
* 无障碍功能:ARIA标签
|
|
27
|
+
*/
|
|
28
|
+
'aria-label'?: string;
|
|
29
|
+
/**
|
|
30
|
+
* 无障碍功能:描述元素的详细信息
|
|
31
|
+
*/
|
|
32
|
+
'aria-describedby'?: string;
|
|
33
|
+
/**
|
|
34
|
+
* 无障碍功能:是否隐藏元素
|
|
35
|
+
*/
|
|
36
|
+
'aria-hidden'?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* 无障碍功能:元素在无障碍树中的细节程度
|
|
39
|
+
*/
|
|
40
|
+
'aria-details'?: string;
|
|
41
|
+
/**
|
|
42
|
+
* 无障碍功能:当前元素是否处于忙碌状态
|
|
43
|
+
*/
|
|
44
|
+
'aria-busy'?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* 无障碍功能:当前元素是否为只读
|
|
47
|
+
*/
|
|
48
|
+
'aria-readonly'?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* 无障碍功能:当前元素是否为必填
|
|
51
|
+
*/
|
|
52
|
+
'aria-required'?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* 无障碍功能:进度条的当前值
|
|
55
|
+
*/
|
|
56
|
+
'aria-valuenow'?: number;
|
|
57
|
+
/**
|
|
58
|
+
* 无障碍功能:进度条的最小值
|
|
59
|
+
*/
|
|
60
|
+
'aria-valuemin'?: number;
|
|
61
|
+
/**
|
|
62
|
+
* 无障碍功能:进度条的最大值
|
|
63
|
+
*/
|
|
64
|
+
'aria-valuemax'?: number;
|
|
65
|
+
/**
|
|
66
|
+
* 无障碍功能:进度条的文本描述
|
|
67
|
+
*/
|
|
68
|
+
'aria-valuetext'?: string;
|
|
25
69
|
};
|
|
26
70
|
defaultComponent: D;
|
|
27
71
|
}, D>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* 自定义 Progress 组件 Demo 集合
|
|
4
|
+
* 这个文件包含多个测试 demo,展示如何使用 getCustomDemoCodesFromFile 进行无障碍测试
|
|
5
|
+
* 文件名必须是 customDemoComponent.tsx(固定约定)
|
|
6
|
+
*/
|
|
7
|
+
export declare const basicProgressDemo: () => React.JSX.Element;
|
|
8
|
+
export declare const coloredProgressDemo: () => React.JSX.Element;
|
|
9
|
+
export declare const sizedProgressDemo: () => React.JSX.Element;
|
|
10
|
+
export declare const gradientProgressDemo: () => React.JSX.Element;
|
|
11
|
+
export declare const customTrailColorProgressDemo: () => React.JSX.Element;
|
|
12
|
+
export declare const accessibilityProgressDemo: () => React.JSX.Element;
|
|
13
|
+
declare const _default: {
|
|
14
|
+
basicProgressDemo: () => React.JSX.Element;
|
|
15
|
+
coloredProgressDemo: () => React.JSX.Element;
|
|
16
|
+
sizedProgressDemo: () => React.JSX.Element;
|
|
17
|
+
gradientProgressDemo: () => React.JSX.Element;
|
|
18
|
+
customTrailColorProgressDemo: () => React.JSX.Element;
|
|
19
|
+
accessibilityProgressDemo: () => React.JSX.Element;
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Progress from "../../Progress";
|
|
3
|
+
const basicProgressDemo = () => {
|
|
4
|
+
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Progress, { percent: 40 }));
|
|
5
|
+
};
|
|
6
|
+
const coloredProgressDemo = () => {
|
|
7
|
+
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Progress, { percent: 40, strokeColor: "var(--bui-color-primary)" }), /* @__PURE__ */ React.createElement(Progress, { percent: 50, strokeColor: "var(--bui-color-info)" }), /* @__PURE__ */ React.createElement(Progress, { percent: 30, strokeColor: "var(--bui-color-success)" }), /* @__PURE__ */ React.createElement(Progress, { percent: 80, strokeColor: "var(--bui-color-warning)" }), /* @__PURE__ */ React.createElement(Progress, { percent: 90, strokeColor: "var(--bui-color-vip)" }));
|
|
8
|
+
};
|
|
9
|
+
const sizedProgressDemo = () => {
|
|
10
|
+
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Progress, { percent: 60, strokeWidth: 10 }), /* @__PURE__ */ React.createElement(Progress, { percent: 60, strokeWidth: 15 }), /* @__PURE__ */ React.createElement(Progress, { percent: 60, strokeWidth: 20 }));
|
|
11
|
+
};
|
|
12
|
+
const gradientProgressDemo = () => {
|
|
13
|
+
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(
|
|
14
|
+
Progress,
|
|
15
|
+
{
|
|
16
|
+
percent: 60,
|
|
17
|
+
strokeColor: {
|
|
18
|
+
from: "var(--bui-color-primary)",
|
|
19
|
+
to: "var(--bui-color-primary-light)"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
), /* @__PURE__ */ React.createElement(
|
|
23
|
+
Progress,
|
|
24
|
+
{
|
|
25
|
+
percent: 90,
|
|
26
|
+
strokeColor: {
|
|
27
|
+
"0%": "var(--bui-color-orange)",
|
|
28
|
+
"100%": "var(--bui-color-orange-light)"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
));
|
|
32
|
+
};
|
|
33
|
+
const customTrailColorProgressDemo = () => {
|
|
34
|
+
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Progress, { percent: 60, trailColor: "var(--bui-color-primary-light)" }), /* @__PURE__ */ React.createElement(Progress, { percent: 80, trailColor: "var(--bui-color-gray-light)" }));
|
|
35
|
+
};
|
|
36
|
+
const accessibilityProgressDemo = () => {
|
|
37
|
+
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Progress, { percent: 50, "aria-label": "\u6587\u4EF6\u4E0B\u8F7D\u8FDB\u5EA6" }), /* @__PURE__ */ React.createElement(
|
|
38
|
+
Progress,
|
|
39
|
+
{
|
|
40
|
+
percent: 75,
|
|
41
|
+
"aria-label": "\u6570\u636E\u52A0\u8F7D\u8FDB\u5EA6",
|
|
42
|
+
"aria-valuetext": "\u5DF2\u5B8C\u621075%"
|
|
43
|
+
}
|
|
44
|
+
), /* @__PURE__ */ React.createElement(Progress, { percent: 30, "aria-describedby": "progress-description" }), /* @__PURE__ */ React.createElement("span", { id: "progress-description", style: { display: "none" } }, "\u8FD9\u662F\u8FDB\u5EA6\u6761\u7684\u8BE6\u7EC6\u63CF\u8FF0\u4FE1\u606F"));
|
|
45
|
+
};
|
|
46
|
+
var A11yDemos_default = {
|
|
47
|
+
basicProgressDemo,
|
|
48
|
+
coloredProgressDemo,
|
|
49
|
+
sizedProgressDemo,
|
|
50
|
+
gradientProgressDemo,
|
|
51
|
+
customTrailColorProgressDemo,
|
|
52
|
+
accessibilityProgressDemo
|
|
53
|
+
};
|
|
54
|
+
export {
|
|
55
|
+
accessibilityProgressDemo,
|
|
56
|
+
basicProgressDemo,
|
|
57
|
+
coloredProgressDemo,
|
|
58
|
+
customTrailColorProgressDemo,
|
|
59
|
+
A11yDemos_default as default,
|
|
60
|
+
gradientProgressDemo,
|
|
61
|
+
sizedProgressDemo
|
|
62
|
+
};
|
package/es/Radio/Radio.js
CHANGED
|
@@ -40,7 +40,7 @@ const Radio = forwardRef((props, ref) => {
|
|
|
40
40
|
const _a = props, {
|
|
41
41
|
className,
|
|
42
42
|
defaultChecked = false,
|
|
43
|
-
checked,
|
|
43
|
+
checked = false,
|
|
44
44
|
inputProps,
|
|
45
45
|
inputRef,
|
|
46
46
|
name,
|
|
@@ -66,6 +66,7 @@ const Radio = forwardRef((props, ref) => {
|
|
|
66
66
|
"onChange",
|
|
67
67
|
"children"
|
|
68
68
|
]);
|
|
69
|
+
const ariaProps = __spreadValues({}, disabled && { "aria-disabled": disabled });
|
|
69
70
|
const groupContext = useContext(RadioContext);
|
|
70
71
|
let validDefaultChecked = defaultChecked;
|
|
71
72
|
let validChecked = checked;
|
|
@@ -86,7 +87,7 @@ const Radio = forwardRef((props, ref) => {
|
|
|
86
87
|
}
|
|
87
88
|
const radioCheckIcon = checkedIcon || /* @__PURE__ */ React.createElement(RadioButtonIcon, { checked: true });
|
|
88
89
|
const radioUncheckIcon = icon || /* @__PURE__ */ React.createElement(RadioButtonIcon, { checked: false });
|
|
89
|
-
const radioDisabled = disabled !== void 0 ? disabled : groupContext == null ? void 0 : groupContext.disabled;
|
|
90
|
+
const radioDisabled = disabled !== void 0 ? disabled : (groupContext == null ? void 0 : groupContext.disabled) || false;
|
|
90
91
|
const changeAction = (e, isChecked) => {
|
|
91
92
|
var _a2;
|
|
92
93
|
if (!groupContext) {
|
|
@@ -130,14 +131,14 @@ const Radio = forwardRef((props, ref) => {
|
|
|
130
131
|
}),
|
|
131
132
|
/* @__PURE__ */ React.createElement(
|
|
132
133
|
"input",
|
|
133
|
-
__spreadProps(__spreadValues({
|
|
134
|
+
__spreadProps(__spreadValues(__spreadValues({
|
|
134
135
|
ref: inputRef,
|
|
135
136
|
type: "radio",
|
|
136
137
|
value,
|
|
137
138
|
name,
|
|
138
139
|
checked: radioChecked,
|
|
139
140
|
disabled: radioDisabled
|
|
140
|
-
}, inputProps), {
|
|
141
|
+
}, ariaProps), inputProps), {
|
|
141
142
|
onChange: handleChange,
|
|
142
143
|
className: clsx(`${prefixCls}-input`, inputProps == null ? void 0 : inputProps.className)
|
|
143
144
|
})
|
package/es/Radio/RadioGroup.js
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* 自定义 Radio 组件 Demo 集合
|
|
4
|
+
* 这个文件包含多个测试 demo,展示如何使用 getCustomDemoCodesFromFile 进行无障碍测试
|
|
5
|
+
* 文件名必须是 customDemoComponent.tsx(固定约定)
|
|
6
|
+
*/
|
|
7
|
+
export declare const basicRadioDemo: () => React.JSX.Element;
|
|
8
|
+
export declare const disabledRadioDemo: () => React.JSX.Element;
|
|
9
|
+
export declare const ariaLabelRadioDemo: () => React.JSX.Element;
|
|
10
|
+
declare const _default: {
|
|
11
|
+
basicRadioDemo: () => React.JSX.Element;
|
|
12
|
+
disabledRadioDemo: () => React.JSX.Element;
|
|
13
|
+
ariaLabelRadioDemo: () => React.JSX.Element;
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Radio from "../../Radio";
|
|
3
|
+
const basicRadioDemo = () => {
|
|
4
|
+
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("label", null, /* @__PURE__ */ React.createElement(Radio, { checked: true }), "Radio"));
|
|
5
|
+
};
|
|
6
|
+
const disabledRadioDemo = () => {
|
|
7
|
+
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("label", null, /* @__PURE__ */ React.createElement(Radio, { disabled: true }), "Radio"));
|
|
8
|
+
};
|
|
9
|
+
const ariaLabelRadioDemo = () => {
|
|
10
|
+
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Radio, { inputProps: { "aria-label": "\u5355\u9009\u6846" } }, "Radio"));
|
|
11
|
+
};
|
|
12
|
+
var A11yDemos_default = {
|
|
13
|
+
basicRadioDemo,
|
|
14
|
+
disabledRadioDemo,
|
|
15
|
+
ariaLabelRadioDemo
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
ariaLabelRadioDemo,
|
|
19
|
+
basicRadioDemo,
|
|
20
|
+
A11yDemos_default as default,
|
|
21
|
+
disabledRadioDemo
|
|
22
|
+
};
|
package/es/Rating/index.css
CHANGED
|
@@ -2,19 +2,15 @@
|
|
|
2
2
|
page,
|
|
3
3
|
xhs-page {
|
|
4
4
|
--bui-rating-xsmall-font-size: var(--bui-text-size-5);
|
|
5
|
-
--bui-rating-xsmall-margin
|
|
6
|
-
--bui-rating-small-margin
|
|
5
|
+
--bui-rating-xsmall-margin: 0;
|
|
6
|
+
--bui-rating-small-margin: 0 0.5px 0 0;
|
|
7
7
|
--bui-rating-small-font-size: var(--bui-text-size-1);
|
|
8
|
-
--bui-rating-margin
|
|
8
|
+
--bui-rating-margin: 0 1px 0 0;
|
|
9
9
|
--bui-rating-font-size: var(--bui-title-size-3);
|
|
10
|
-
--bui-rating-large-margin
|
|
10
|
+
--bui-rating-large-margin: 0 2px 0 0;
|
|
11
11
|
--bui-rating-large-font-size: 22px;
|
|
12
12
|
}
|
|
13
13
|
.bui-rating {
|
|
14
|
-
--small-margin-right: var(--bui-rating-small-margin-right, 0.5px);
|
|
15
|
-
--medium-margin-right: var(--bui-rating-medium-margin-right, 1px);
|
|
16
|
-
--large-margin-right: var(--bui-rating-large-margin-right, 2px);
|
|
17
|
-
--large-font-size: var(--bui-rating-large-font-size, 22px);
|
|
18
14
|
display: flex;
|
|
19
15
|
flex-wrap: wrap;
|
|
20
16
|
font-family: var(--bui-font-family);
|
|
@@ -32,19 +28,19 @@ xhs-page {
|
|
|
32
28
|
}
|
|
33
29
|
.bui-rating-container-xsmall {
|
|
34
30
|
font-size: var(--bui-rating-xsmall-font-size);
|
|
35
|
-
margin
|
|
31
|
+
margin: var(--bui-rating-xsmall-margin);
|
|
36
32
|
}
|
|
37
33
|
.bui-rating-container-small {
|
|
38
34
|
font-size: var(--bui-rating-small-font-size);
|
|
39
|
-
margin
|
|
35
|
+
margin: var(--bui-rating-small-margin);
|
|
40
36
|
}
|
|
41
37
|
.bui-rating-container-medium {
|
|
42
38
|
font-size: var(--bui-rating-font-size);
|
|
43
|
-
margin
|
|
39
|
+
margin: var(--bui-rating-margin);
|
|
44
40
|
}
|
|
45
41
|
.bui-rating-container-large {
|
|
46
42
|
font-size: var(--bui-rating-large-font-size);
|
|
47
|
-
margin
|
|
43
|
+
margin: var(--bui-rating-large-margin);
|
|
48
44
|
}
|
|
49
45
|
.bui-rating-item {
|
|
50
46
|
display: flex;
|