@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
|
@@ -62,11 +62,13 @@ module.exports = __toCommonJS(TextArea_exports);
|
|
|
62
62
|
var import_utils = require("@bifrostui/utils");
|
|
63
63
|
var import_clsx = __toESM(require("clsx"));
|
|
64
64
|
var import_react = __toESM(require("react"));
|
|
65
|
+
var import_locales = require("../locales");
|
|
65
66
|
var import_index = require("./index.css");
|
|
66
67
|
const prefixCls = "bui-textarea";
|
|
67
68
|
const DEFAULT_ROWS = 2;
|
|
68
69
|
const TextArea = /* @__PURE__ */ import_react.default.forwardRef(
|
|
69
70
|
(props, ref) => {
|
|
71
|
+
const textareaText = (0, import_locales.useLocaleText)("textarea");
|
|
70
72
|
const _a = props, {
|
|
71
73
|
className,
|
|
72
74
|
value,
|
|
@@ -77,10 +79,19 @@ const TextArea = /* @__PURE__ */ import_react.default.forwardRef(
|
|
|
77
79
|
placeholder,
|
|
78
80
|
disabled,
|
|
79
81
|
rows = DEFAULT_ROWS,
|
|
80
|
-
maxLength,
|
|
82
|
+
maxLength: maxLength,
|
|
81
83
|
autoSize = false,
|
|
82
|
-
autoFocus = false,
|
|
83
|
-
showCount = false,
|
|
84
|
+
autoFocus: autoFocus = false,
|
|
85
|
+
showCount: showCount = false,
|
|
86
|
+
// 是否展示字数统计
|
|
87
|
+
// 无障碍属性
|
|
88
|
+
"aria-label": ariaLabel = textareaText.labelName,
|
|
89
|
+
"aria-hidden": ariaHidden,
|
|
90
|
+
"aria-details": ariaDetails,
|
|
91
|
+
"aria-required": ariaRequired,
|
|
92
|
+
"aria-readonly": ariaReadonly,
|
|
93
|
+
"aria-rowindex": ariaRowindex,
|
|
94
|
+
"aria-colcount": ariaColcount,
|
|
84
95
|
onChange
|
|
85
96
|
} = _a, others = __objRest(_a, [
|
|
86
97
|
"className",
|
|
@@ -92,10 +103,20 @@ const TextArea = /* @__PURE__ */ import_react.default.forwardRef(
|
|
|
92
103
|
"placeholder",
|
|
93
104
|
"disabled",
|
|
94
105
|
"rows",
|
|
106
|
+
// 默认行数
|
|
95
107
|
"maxLength",
|
|
96
108
|
"autoSize",
|
|
109
|
+
// 是否自适应高度
|
|
97
110
|
"autoFocus",
|
|
111
|
+
// 是否自动聚焦
|
|
98
112
|
"showCount",
|
|
113
|
+
"aria-label",
|
|
114
|
+
"aria-hidden",
|
|
115
|
+
"aria-details",
|
|
116
|
+
"aria-required",
|
|
117
|
+
"aria-readonly",
|
|
118
|
+
"aria-rowindex",
|
|
119
|
+
"aria-colcount",
|
|
99
120
|
"onChange"
|
|
100
121
|
]);
|
|
101
122
|
const [textAreaValue, triggerChange] = (0, import_utils.useValue)({
|
|
@@ -110,7 +131,7 @@ const TextArea = /* @__PURE__ */ import_react.default.forwardRef(
|
|
|
110
131
|
if (autoFocus && internalRef.current) {
|
|
111
132
|
internalRef.current.focus();
|
|
112
133
|
}
|
|
113
|
-
}, [
|
|
134
|
+
}, [autoFocus]);
|
|
114
135
|
const handleAutoHeight = (height) => {
|
|
115
136
|
if (typeof autoSize === "object") {
|
|
116
137
|
const { maxHeight, minHeight } = autoSize;
|
|
@@ -140,8 +161,7 @@ const TextArea = /* @__PURE__ */ import_react.default.forwardRef(
|
|
|
140
161
|
const textArea = internalRef.current;
|
|
141
162
|
const { height, lineCount } = (e == null ? void 0 : e.detail) || {};
|
|
142
163
|
const line = lineCount <= 1 ? rows : lineCount;
|
|
143
|
-
|
|
144
|
-
textAreaHeight = handleAutoHeight(textAreaHeight);
|
|
164
|
+
const textAreaHeight = handleAutoHeight(line * (height / lineCount));
|
|
145
165
|
if (!initLock.current && !autoSize && rows === DEFAULT_ROWS) {
|
|
146
166
|
textArea.style.height = `${textAreaHeight}px`;
|
|
147
167
|
initLock.current = true;
|
|
@@ -151,12 +171,29 @@ const TextArea = /* @__PURE__ */ import_react.default.forwardRef(
|
|
|
151
171
|
textArea.style.height = `${textAreaHeight}px`;
|
|
152
172
|
}
|
|
153
173
|
};
|
|
174
|
+
const [ariaDescription, setAriaDescription] = (0, import_react.useState)("");
|
|
154
175
|
let nativeProps = {
|
|
155
|
-
[import_utils.isMini ? "maxlength" : "maxLength"]: maxLength != null ? maxLength : -1
|
|
176
|
+
[import_utils.isMini ? "maxlength" : "maxLength"]: maxLength != null ? maxLength : -1,
|
|
177
|
+
"aria-description": ariaDescription
|
|
156
178
|
};
|
|
179
|
+
const accessibilityProps = {
|
|
180
|
+
"aria-label": ariaLabel,
|
|
181
|
+
"aria-hidden": ariaHidden,
|
|
182
|
+
"aria-details": ariaDetails,
|
|
183
|
+
"aria-required": ariaRequired,
|
|
184
|
+
"aria-readonly": ariaReadonly,
|
|
185
|
+
"aria-rowindex": ariaRowindex,
|
|
186
|
+
"aria-colcount": ariaColcount
|
|
187
|
+
};
|
|
188
|
+
Object.keys(accessibilityProps).forEach((key) => {
|
|
189
|
+
if (accessibilityProps[key] !== void 0) {
|
|
190
|
+
nativeProps[key] = accessibilityProps[key];
|
|
191
|
+
}
|
|
192
|
+
});
|
|
157
193
|
if (import_utils.isMini) {
|
|
158
194
|
nativeProps = __spreadProps(__spreadValues({}, nativeProps), {
|
|
159
195
|
onLineChange: handleLineChange,
|
|
196
|
+
// 小程序行高变化事件
|
|
160
197
|
placeholderClass: "bui-mini-placeholder",
|
|
161
198
|
autoFocus,
|
|
162
199
|
focus: autoFocus
|
|
@@ -192,6 +229,12 @@ const TextArea = /* @__PURE__ */ import_react.default.forwardRef(
|
|
|
192
229
|
},
|
|
193
230
|
onInput: (e) => {
|
|
194
231
|
var _a2;
|
|
232
|
+
if (showCount) {
|
|
233
|
+
const remaining = maxLength - e.target.value.length;
|
|
234
|
+
setAriaDescription(
|
|
235
|
+
`${textareaText.remaining} ${remaining} ${textareaText.characters}`
|
|
236
|
+
);
|
|
237
|
+
}
|
|
195
238
|
if (import_utils.isMini) {
|
|
196
239
|
triggerChange(e, e.target.value);
|
|
197
240
|
}
|
|
@@ -64,6 +64,34 @@ export type TextAreaProps<D extends React.ElementType = 'div', P = {}> = Overrid
|
|
|
64
64
|
onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>, data: {
|
|
65
65
|
value: string;
|
|
66
66
|
}) => void;
|
|
67
|
+
/**
|
|
68
|
+
* 无障碍功能:ARIA标签
|
|
69
|
+
*/
|
|
70
|
+
'aria-label'?: string;
|
|
71
|
+
/**
|
|
72
|
+
* 无障碍功能:是否隐藏元素
|
|
73
|
+
*/
|
|
74
|
+
'aria-hidden'?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* 无障碍功能:元素在无障碍树中的细节程度
|
|
77
|
+
*/
|
|
78
|
+
'aria-details'?: string;
|
|
79
|
+
/**
|
|
80
|
+
* 无障碍功能:当前元素是否为必填
|
|
81
|
+
*/
|
|
82
|
+
'aria-required'?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* 无障碍功能:当前元素是否为只读
|
|
85
|
+
*/
|
|
86
|
+
'aria-readonly'?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* 无障碍功能:多行文本框的第一行索引
|
|
89
|
+
*/
|
|
90
|
+
'aria-rowindex'?: number;
|
|
91
|
+
/**
|
|
92
|
+
* 无障碍功能:多行文本框的列数
|
|
93
|
+
*/
|
|
94
|
+
'aria-colcount'?: number;
|
|
67
95
|
};
|
|
68
96
|
defaultComponent: D;
|
|
69
97
|
}, D>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* 自定义 TextArea 组件 Demo 集合
|
|
4
|
+
* 这个文件包含多个测试 demo,展示如何使用 getCustomDemoCodesFromFile 进行无障碍测试
|
|
5
|
+
* 文件名必须是 customDemoComponent.tsx(固定约定)
|
|
6
|
+
*/
|
|
7
|
+
export declare const basicTextAreaDemo: () => React.JSX.Element;
|
|
8
|
+
export declare const ariaLabelTextAreaDemo: () => React.JSX.Element;
|
|
9
|
+
export declare const requiredAndReadonlyTextAreaDemo: () => React.JSX.Element;
|
|
10
|
+
export declare const showCountTextAreaDemo: () => React.JSX.Element;
|
|
11
|
+
export declare const autoFocusTextAreaDemo: () => React.JSX.Element;
|
|
12
|
+
declare const _default: {
|
|
13
|
+
basicTextAreaDemo: () => React.JSX.Element;
|
|
14
|
+
ariaLabelTextAreaDemo: () => React.JSX.Element;
|
|
15
|
+
requiredAndReadonlyTextAreaDemo: () => React.JSX.Element;
|
|
16
|
+
showCountTextAreaDemo: () => React.JSX.Element;
|
|
17
|
+
autoFocusTextAreaDemo: () => React.JSX.Element;
|
|
18
|
+
};
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var A11yDemos_exports = {};
|
|
29
|
+
__export(A11yDemos_exports, {
|
|
30
|
+
ariaLabelTextAreaDemo: () => ariaLabelTextAreaDemo,
|
|
31
|
+
autoFocusTextAreaDemo: () => autoFocusTextAreaDemo,
|
|
32
|
+
basicTextAreaDemo: () => basicTextAreaDemo,
|
|
33
|
+
default: () => A11yDemos_default,
|
|
34
|
+
requiredAndReadonlyTextAreaDemo: () => requiredAndReadonlyTextAreaDemo,
|
|
35
|
+
showCountTextAreaDemo: () => showCountTextAreaDemo
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(A11yDemos_exports);
|
|
38
|
+
var import_react = __toESM(require("react"));
|
|
39
|
+
var import_TextArea = __toESM(require("../../TextArea"));
|
|
40
|
+
const basicTextAreaDemo = () => {
|
|
41
|
+
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(import_TextArea.default, { placeholder: "\u8BF7\u8F93\u5165\u5185\u5BB9" }));
|
|
42
|
+
};
|
|
43
|
+
const ariaLabelTextAreaDemo = () => {
|
|
44
|
+
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(import_TextArea.default, { placeholder: "\u8BF7\u8F93\u5165\u5185\u5BB9", "aria-label": "\u7528\u6237\u8BC4\u8BBA\u8F93\u5165\u6846" }));
|
|
45
|
+
};
|
|
46
|
+
const requiredAndReadonlyTextAreaDemo = () => {
|
|
47
|
+
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(import_TextArea.default, { placeholder: "\u5FC5\u586B\u9879", "aria-required": true }), /* @__PURE__ */ import_react.default.createElement(
|
|
48
|
+
import_TextArea.default,
|
|
49
|
+
{
|
|
50
|
+
placeholder: "\u53EA\u8BFB\u9879",
|
|
51
|
+
"aria-readonly": true,
|
|
52
|
+
defaultValue: "\u8FD9\u662F\u53EA\u8BFB\u5185\u5BB9"
|
|
53
|
+
}
|
|
54
|
+
));
|
|
55
|
+
};
|
|
56
|
+
const showCountTextAreaDemo = () => {
|
|
57
|
+
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(
|
|
58
|
+
import_TextArea.default,
|
|
59
|
+
{
|
|
60
|
+
placeholder: "\u6700\u591A\u8F93\u516550\u4E2A\u5B57",
|
|
61
|
+
maxLength: 50,
|
|
62
|
+
showCount: true,
|
|
63
|
+
"aria-label": "\u5E26\u5B57\u6570\u7EDF\u8BA1\u7684\u8F93\u5165\u6846"
|
|
64
|
+
}
|
|
65
|
+
));
|
|
66
|
+
};
|
|
67
|
+
const autoFocusTextAreaDemo = () => {
|
|
68
|
+
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(
|
|
69
|
+
import_TextArea.default,
|
|
70
|
+
{
|
|
71
|
+
placeholder: "\u81EA\u52A8\u805A\u7126",
|
|
72
|
+
autoFocus: true,
|
|
73
|
+
"aria-label": "\u81EA\u52A8\u805A\u7126\u7684\u8F93\u5165\u6846"
|
|
74
|
+
}
|
|
75
|
+
));
|
|
76
|
+
};
|
|
77
|
+
var A11yDemos_default = {
|
|
78
|
+
basicTextAreaDemo,
|
|
79
|
+
ariaLabelTextAreaDemo,
|
|
80
|
+
requiredAndReadonlyTextAreaDemo,
|
|
81
|
+
showCountTextAreaDemo,
|
|
82
|
+
autoFocusTextAreaDemo
|
|
83
|
+
};
|
|
84
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
85
|
+
0 && (module.exports = {
|
|
86
|
+
ariaLabelTextAreaDemo,
|
|
87
|
+
autoFocusTextAreaDemo,
|
|
88
|
+
basicTextAreaDemo,
|
|
89
|
+
requiredAndReadonlyTextAreaDemo,
|
|
90
|
+
showCountTextAreaDemo
|
|
91
|
+
});
|
package/dist/TextArea/index.css
CHANGED
|
@@ -3,9 +3,9 @@ page,
|
|
|
3
3
|
xhs-page {
|
|
4
4
|
--bui-textarea-border-radius: var(--bui-shape-radius-label);
|
|
5
5
|
--bui-textarea-width: 100%;
|
|
6
|
-
--bui-textarea-
|
|
6
|
+
--bui-textarea-bg-color: var(--bui-color-bg-default);
|
|
7
7
|
--bui-textarea-text-color: var(--bui-color-fg-subtle);
|
|
8
|
-
--bui-textarea-count-
|
|
8
|
+
--bui-textarea-count-bg-color: var(--bui-textarea-bg-color, var(--bui-color-bg-default));
|
|
9
9
|
--bui-textarea-count-color: var(--bui-color-fg-subtle);
|
|
10
10
|
--bui-textarea-text-font-size: var(--bui-text-size-2);
|
|
11
11
|
--bui-textarea-count-font-size: var(--bui-title-size-3);
|
|
@@ -37,7 +37,7 @@ xhs-page {
|
|
|
37
37
|
.bui-textarea-content {
|
|
38
38
|
width: var(--bui-textarea-width);
|
|
39
39
|
resize: none;
|
|
40
|
-
background-color: var(--bui-textarea-
|
|
40
|
+
background-color: var(--bui-textarea-bg-color);
|
|
41
41
|
padding: var(--bui-textarea-padding);
|
|
42
42
|
border: none;
|
|
43
43
|
outline: none;
|
|
@@ -49,7 +49,7 @@ xhs-page {
|
|
|
49
49
|
line-height: var(--bui-textarea-placeholder-line-height);
|
|
50
50
|
}
|
|
51
51
|
.bui-textarea-count {
|
|
52
|
-
background-color: var(--bui-textarea-count-
|
|
52
|
+
background-color: var(--bui-textarea-count-bg-color);
|
|
53
53
|
color: var(--bui-textarea-count-color);
|
|
54
54
|
text-align: right;
|
|
55
55
|
padding: var(--bui-textarea-count-padding);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { OverrideProps } from '@bifrostui/types';
|
|
3
|
-
import { BaseLang } from '../locales/base';
|
|
3
|
+
import type { BaseLang } from '../locales/base';
|
|
4
4
|
export interface Breakpoints {
|
|
5
5
|
/**
|
|
6
6
|
* 超小屏幕 (小于 576px,实际为了处理临界值,断点值为 575.98px)
|
|
@@ -2,10 +2,6 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
5
|
var __copyProps = (to, from, except, desc) => {
|
|
10
6
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
7
|
for (let key of __getOwnPropNames(from))
|
|
@@ -16,12 +12,4 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
12
|
};
|
|
17
13
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
14
|
var ThemeProvider_types_exports = {};
|
|
19
|
-
__export(ThemeProvider_types_exports, {
|
|
20
|
-
BaseLang: () => import_base.BaseLang
|
|
21
|
-
});
|
|
22
15
|
module.exports = __toCommonJS(ThemeProvider_types_exports);
|
|
23
|
-
var import_base = require("../locales/base");
|
|
24
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
25
|
-
0 && (module.exports = {
|
|
26
|
-
BaseLang
|
|
27
|
-
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ToastInstance } from './Toast.types';
|
|
2
|
-
declare const
|
|
3
|
-
export default
|
|
2
|
+
declare const _default: ToastInstance;
|
|
3
|
+
export default _default;
|
|
@@ -59,127 +59,222 @@ __export(FunctionalToast_exports, {
|
|
|
59
59
|
default: () => FunctionalToast_default
|
|
60
60
|
});
|
|
61
61
|
module.exports = __toCommonJS(FunctionalToast_exports);
|
|
62
|
-
var import_utils = require("@bifrostui/utils");
|
|
63
62
|
var import_react = __toESM(require("react"));
|
|
63
|
+
var import_utils = require("@bifrostui/utils");
|
|
64
|
+
var import_Portal = __toESM(require("../Portal"));
|
|
64
65
|
var import_Toast = __toESM(require("./Toast"));
|
|
65
|
-
|
|
66
|
+
const defaultProps = {
|
|
67
|
+
duration: 2e3,
|
|
68
|
+
position: "center",
|
|
69
|
+
multiple: false,
|
|
70
|
+
disableClick: false
|
|
71
|
+
};
|
|
72
|
+
const toastCloses = [];
|
|
66
73
|
const formatProps = (props) => {
|
|
67
|
-
|
|
68
|
-
return { message: props };
|
|
69
|
-
}
|
|
70
|
-
return props;
|
|
74
|
+
return typeof props === "string" ? { message: props } : props;
|
|
71
75
|
};
|
|
72
|
-
const destroyAll = () => {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
closeToast();
|
|
76
|
-
|
|
77
|
-
}
|
|
76
|
+
const destroyAll = (closes) => {
|
|
77
|
+
do {
|
|
78
|
+
const closeToast = closes.pop();
|
|
79
|
+
closeToast == null ? void 0 : closeToast();
|
|
80
|
+
} while (closes.length > 0);
|
|
78
81
|
};
|
|
79
|
-
const
|
|
80
|
-
const options = __spreadValues({
|
|
81
|
-
duration: 2e3,
|
|
82
|
-
position: "center",
|
|
83
|
-
allowMultiple: false,
|
|
84
|
-
disableClick: false
|
|
85
|
-
}, formatProps(props));
|
|
82
|
+
const Toast = (props) => {
|
|
83
|
+
const options = __spreadValues(__spreadValues({}, defaultProps), formatProps(props));
|
|
86
84
|
const instance = {
|
|
87
85
|
close: () => null
|
|
88
86
|
};
|
|
87
|
+
const _a = options, { container } = _a, restOptions = __objRest(_a, ["container"]);
|
|
89
88
|
const rootWrapper = document.createElement("div");
|
|
90
|
-
|
|
91
|
-
const styles = {
|
|
92
|
-
position: "fixed",
|
|
93
|
-
top: "0",
|
|
94
|
-
bottom: "0",
|
|
95
|
-
left: "0",
|
|
96
|
-
right: "0",
|
|
97
|
-
zIndex: "var(--bui-z-index-toast)"
|
|
98
|
-
};
|
|
99
|
-
Object.keys(styles).forEach((property) => {
|
|
100
|
-
rootWrapper.style[property] = styles[property];
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
const rootElement = (0, import_utils.getRootElement)();
|
|
89
|
+
const rootElement = (0, import_utils.getRootContainer)(container);
|
|
104
90
|
rootElement.appendChild(rootWrapper);
|
|
105
91
|
const ToastComponent = () => {
|
|
106
|
-
const
|
|
107
|
-
const [open, setOpen] = (0, import_react.useState)(
|
|
108
|
-
|
|
109
|
-
const fadeTimeout = {
|
|
110
|
-
enter: 350,
|
|
111
|
-
exit: 150
|
|
112
|
-
};
|
|
92
|
+
const _a2 = restOptions, { duration, multiple, onClose, onExited } = _a2, others = __objRest(_a2, ["duration", "multiple", "onClose", "onExited"]);
|
|
93
|
+
const [open, setOpen] = (0, import_react.useState)(true);
|
|
94
|
+
const timerRef = (0, import_react.useRef)(null);
|
|
113
95
|
const close = (0, import_react.useCallback)(() => {
|
|
114
96
|
setOpen(false);
|
|
115
|
-
setTimeout(() => {
|
|
116
|
-
const unmountRes = (0, import_utils.unmount)(rootWrapper);
|
|
117
|
-
if (unmountRes && rootWrapper.parentNode) {
|
|
118
|
-
rootWrapper.parentNode.removeChild(rootWrapper);
|
|
119
|
-
}
|
|
120
|
-
}, fadeTimeout.exit);
|
|
121
97
|
onClose == null ? void 0 : onClose();
|
|
122
|
-
}, [rootWrapper]);
|
|
98
|
+
}, [rootWrapper, onClose]);
|
|
123
99
|
(0, import_react.useEffect)(() => {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
destroyAll();
|
|
100
|
+
if (!multiple)
|
|
101
|
+
destroyAll(toastCloses);
|
|
127
102
|
toastCloses.push(close);
|
|
128
103
|
if (duration !== 0 && typeof duration === "number") {
|
|
129
|
-
|
|
104
|
+
timerRef.current = window.setTimeout(() => {
|
|
130
105
|
close();
|
|
131
|
-
if (!
|
|
132
|
-
|
|
106
|
+
if (!multiple) {
|
|
107
|
+
const index = toastCloses.indexOf(close);
|
|
108
|
+
if (index > -1) {
|
|
109
|
+
toastCloses.splice(index, 1);
|
|
110
|
+
}
|
|
133
111
|
}
|
|
134
112
|
}, duration);
|
|
135
113
|
}
|
|
136
114
|
return () => {
|
|
137
|
-
|
|
115
|
+
if (timerRef.current) {
|
|
116
|
+
clearTimeout(timerRef.current);
|
|
117
|
+
}
|
|
138
118
|
};
|
|
139
119
|
}, []);
|
|
120
|
+
const onProxyExited = () => {
|
|
121
|
+
onExited == null ? void 0 : onExited();
|
|
122
|
+
const unmountRes = (0, import_utils.unmount)(rootWrapper);
|
|
123
|
+
if (unmountRes && rootWrapper.parentNode) {
|
|
124
|
+
rootWrapper.parentNode.removeChild(rootWrapper);
|
|
125
|
+
}
|
|
126
|
+
};
|
|
140
127
|
instance.close = close;
|
|
141
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
142
|
-
import_Toast.default,
|
|
143
|
-
__spreadProps(__spreadValues({}, others), {
|
|
144
|
-
open,
|
|
145
|
-
timeout: fadeTimeout,
|
|
146
|
-
onClose: close
|
|
147
|
-
})
|
|
148
|
-
);
|
|
128
|
+
return /* @__PURE__ */ import_react.default.createElement(import_Toast.default, __spreadProps(__spreadValues({}, others), { open, onExited: onProxyExited }));
|
|
149
129
|
};
|
|
150
130
|
(0, import_utils.render)(/* @__PURE__ */ import_react.default.createElement(ToastComponent, null), rootWrapper);
|
|
151
131
|
return instance;
|
|
152
132
|
};
|
|
153
|
-
["warning", "loading", "success", "fail"].forEach(
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
});
|
|
158
|
-
|
|
133
|
+
["warning", "loading", "success", "fail"].forEach(
|
|
134
|
+
(methodName) => {
|
|
135
|
+
Toast[methodName] = (options) => Toast(__spreadValues({
|
|
136
|
+
type: methodName
|
|
137
|
+
}, formatProps(options)));
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
Toast.clear = () => {
|
|
159
141
|
setTimeout(() => {
|
|
160
|
-
destroyAll();
|
|
142
|
+
destroyAll(toastCloses);
|
|
161
143
|
});
|
|
162
144
|
};
|
|
145
|
+
const UseToastComponent = (props) => {
|
|
146
|
+
const _a = props, {
|
|
147
|
+
domRef,
|
|
148
|
+
onExited,
|
|
149
|
+
onSetOpenFalse,
|
|
150
|
+
onEnd,
|
|
151
|
+
destroyAllCloses,
|
|
152
|
+
addClose,
|
|
153
|
+
removeClose,
|
|
154
|
+
open
|
|
155
|
+
} = _a, restProps = __objRest(_a, [
|
|
156
|
+
"domRef",
|
|
157
|
+
"onExited",
|
|
158
|
+
"onSetOpenFalse",
|
|
159
|
+
"onEnd",
|
|
160
|
+
"destroyAllCloses",
|
|
161
|
+
"addClose",
|
|
162
|
+
"removeClose",
|
|
163
|
+
"open"
|
|
164
|
+
]);
|
|
165
|
+
const options = __spreadValues(__spreadValues({}, defaultProps), formatProps(restProps));
|
|
166
|
+
const _b = options, { duration, multiple, onClose, container } = _b, others = __objRest(_b, ["duration", "multiple", "onClose", "container"]);
|
|
167
|
+
const rootElement = (0, import_utils.getRootContainer)(container);
|
|
168
|
+
const timerRef = (0, import_react.useRef)(null);
|
|
169
|
+
const close = () => {
|
|
170
|
+
onSetOpenFalse == null ? void 0 : onSetOpenFalse();
|
|
171
|
+
onClose == null ? void 0 : onClose();
|
|
172
|
+
};
|
|
173
|
+
(0, import_react.useEffect)(() => {
|
|
174
|
+
if (!multiple)
|
|
175
|
+
destroyAllCloses();
|
|
176
|
+
addClose(close);
|
|
177
|
+
if (duration !== 0 && typeof duration === "number") {
|
|
178
|
+
timerRef.current = window.setTimeout(() => {
|
|
179
|
+
close();
|
|
180
|
+
if (!multiple) {
|
|
181
|
+
removeClose(close);
|
|
182
|
+
}
|
|
183
|
+
}, duration);
|
|
184
|
+
}
|
|
185
|
+
return () => {
|
|
186
|
+
if (timerRef.current) {
|
|
187
|
+
clearTimeout(timerRef.current);
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
}, []);
|
|
191
|
+
const onProxyExited = () => {
|
|
192
|
+
onEnd == null ? void 0 : onEnd();
|
|
193
|
+
onExited == null ? void 0 : onExited();
|
|
194
|
+
};
|
|
195
|
+
return /* @__PURE__ */ import_react.default.createElement(import_Portal.default, { container: rootElement }, /* @__PURE__ */ import_react.default.createElement(
|
|
196
|
+
import_Toast.default,
|
|
197
|
+
__spreadProps(__spreadValues({}, others), {
|
|
198
|
+
open,
|
|
199
|
+
onExited: onProxyExited,
|
|
200
|
+
ref: domRef
|
|
201
|
+
})
|
|
202
|
+
));
|
|
203
|
+
};
|
|
204
|
+
UseToastComponent.displayName = "UseToastComponent";
|
|
163
205
|
const useToast = () => {
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
206
|
+
const [elements, setElements] = (0, import_react.useState)([]);
|
|
207
|
+
const hookToastClosesRef = (0, import_react.useRef)([]);
|
|
208
|
+
const createToast = (options) => {
|
|
209
|
+
const key = `toast-${Date.now()}-${Math.random()}`;
|
|
210
|
+
const _a = options, { ref } = _a, restOptions = __objRest(_a, ["ref"]);
|
|
211
|
+
const instance = {
|
|
212
|
+
close: () => {
|
|
213
|
+
setElements(
|
|
214
|
+
(prev) => prev.map(
|
|
215
|
+
(element) => element.key === key ? __spreadProps(__spreadValues({}, element), { open: false }) : element
|
|
216
|
+
)
|
|
217
|
+
);
|
|
218
|
+
}
|
|
173
219
|
};
|
|
174
|
-
|
|
175
|
-
|
|
220
|
+
const handleAnimationEnd = () => {
|
|
221
|
+
setElements((prev) => prev.filter((element) => element.key !== key));
|
|
222
|
+
};
|
|
223
|
+
const toastElement = {
|
|
224
|
+
key,
|
|
225
|
+
open: true,
|
|
226
|
+
props: __spreadProps(__spreadValues({}, restOptions), {
|
|
227
|
+
onEnd: handleAnimationEnd
|
|
228
|
+
}),
|
|
229
|
+
ref
|
|
230
|
+
};
|
|
231
|
+
setElements((prev) => [...prev, toastElement]);
|
|
232
|
+
return instance;
|
|
233
|
+
};
|
|
234
|
+
const hookToast = (options) => createToast(__spreadValues({}, formatProps(options)));
|
|
235
|
+
["warning", "loading", "success", "fail"].forEach(
|
|
236
|
+
(methodName) => {
|
|
237
|
+
hookToast[methodName] = (options) => createToast(__spreadValues({
|
|
238
|
+
type: methodName
|
|
239
|
+
}, formatProps(options)));
|
|
240
|
+
}
|
|
241
|
+
);
|
|
242
|
+
hookToast.clear = () => {
|
|
176
243
|
setTimeout(() => {
|
|
177
|
-
destroyAll();
|
|
244
|
+
destroyAll(hookToastClosesRef.current);
|
|
178
245
|
});
|
|
179
246
|
};
|
|
180
|
-
const
|
|
181
|
-
|
|
247
|
+
const destroyAllCloses = () => {
|
|
248
|
+
destroyAll(hookToastClosesRef.current);
|
|
249
|
+
};
|
|
250
|
+
const renderedElements = elements.map((element) => {
|
|
251
|
+
const onSetOpenFalse = () => {
|
|
252
|
+
setElements(
|
|
253
|
+
(prev) => prev.map(
|
|
254
|
+
(el) => el.key === element.key ? __spreadProps(__spreadValues({}, el), { open: false }) : el
|
|
255
|
+
)
|
|
256
|
+
);
|
|
257
|
+
};
|
|
258
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
259
|
+
UseToastComponent,
|
|
260
|
+
__spreadProps(__spreadValues({
|
|
261
|
+
key: element.key
|
|
262
|
+
}, element.props), {
|
|
263
|
+
open: element.open,
|
|
264
|
+
onSetOpenFalse,
|
|
265
|
+
domRef: element.ref,
|
|
266
|
+
destroyAllCloses,
|
|
267
|
+
addClose: (close) => hookToastClosesRef.current.push(close),
|
|
268
|
+
removeClose: (close) => {
|
|
269
|
+
const index = hookToastClosesRef.current.indexOf(close);
|
|
270
|
+
if (index > -1) {
|
|
271
|
+
hookToastClosesRef.current.splice(index, 1);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
})
|
|
275
|
+
);
|
|
276
|
+
});
|
|
277
|
+
return [hookToast, /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, renderedElements)];
|
|
182
278
|
};
|
|
183
|
-
|
|
184
|
-
const Toast = functionalToast;
|
|
279
|
+
Toast.useToast = useToast;
|
|
185
280
|
var FunctionalToast_default = Toast;
|
package/dist/Toast/Toast.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ToastProps
|
|
2
|
+
import { ToastProps } from './Toast.types';
|
|
3
3
|
import './index.less';
|
|
4
|
-
declare const ToastComponent: React.ForwardRefExoticComponent<ToastProps & React.RefAttributes<
|
|
4
|
+
declare const ToastComponent: React.ForwardRefExoticComponent<Omit<Omit<Omit<ToastProps, "onClose">, "container">, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
5
|
export default ToastComponent;
|