@bifrostui/react 2.0.0-alpha.31 → 2.0.0-alpha.33
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/ActionSheet/ActionSheet.js +18 -8
- package/dist/ActionSheet/ActionSheetItem.d.ts +1 -1
- package/dist/ActionSheet/ActionSheetItem.js +12 -5
- package/dist/Alert/Alert.d.ts +1 -1
- package/dist/Alert/Alert.js +36 -34
- package/dist/Alert/__tests__/fixtures/A11yDemos.d.ts +8 -9
- package/dist/Alert/__tests__/fixtures/A11yDemos.js +60 -54
- package/dist/Avatar/Avatar.d.ts +1 -1
- package/dist/Avatar/Avatar.js +11 -9
- package/dist/Avatar/AvatarGroup.d.ts +1 -1
- package/dist/Avatar/AvatarGroup.js +10 -6
- package/dist/Backdrop/Backdrop.d.ts +1 -1
- package/dist/Backdrop/Backdrop.js +9 -5
- package/dist/Backdrop/__tests__/fixtures/A11yDemos.d.ts +4 -5
- package/dist/Backdrop/__tests__/fixtures/A11yDemos.js +3 -3
- package/dist/Badge/Badge.d.ts +1 -1
- package/dist/Badge/Badge.js +23 -15
- package/dist/Badge/__tests__/fixtures/A11yDemos.d.ts +16 -17
- package/dist/Badge/__tests__/fixtures/A11yDemos.js +60 -27
- package/dist/Badge/index.css +3 -3
- package/dist/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/dist/Breadcrumb/Breadcrumb.js +19 -10
- package/dist/Breadcrumb/BreadcrumbItem.d.ts +1 -1
- package/dist/Breadcrumb/BreadcrumbItem.js +18 -10
- package/dist/Button/Button.d.ts +1 -1
- package/dist/Button/Button.js +14 -7
- package/dist/Button/__tests__/fixtures/A11yDemos.d.ts +14 -15
- package/dist/Button/__tests__/fixtures/A11yDemos.js +32 -8
- package/dist/CSSTransition/CSSTransition.js +2 -1
- package/dist/CSSTransition/demo/CSSTransitionDemo.d.ts +1 -2
- package/dist/CSSTransition/demo/CSSTransitionDemo.js +28 -35
- package/dist/Calendar/Calendar.d.ts +1 -1
- package/dist/Calendar/Calendar.js +74 -66
- package/dist/Calendar/__tests__/fixtures/A11yDemos.d.ts +1 -2
- package/dist/Calendar/__tests__/fixtures/A11yDemos.js +2 -2
- package/dist/Card/Card.d.ts +1 -1
- package/dist/Card/Card.js +9 -4
- package/dist/Card/CardContent.d.ts +1 -1
- package/dist/Card/CardContent.js +5 -1
- package/dist/Card/CardFooter.d.ts +1 -1
- package/dist/Card/CardFooter.js +5 -1
- package/dist/Card/CardHeader.d.ts +1 -1
- package/dist/Card/CardHeader.js +16 -9
- package/dist/Checkbox/Checkbox.d.ts +1 -1
- package/dist/Checkbox/Checkbox.js +27 -23
- package/dist/Checkbox/CheckboxGroup.d.ts +1 -1
- package/dist/Checkbox/CheckboxGroup.js +9 -5
- package/dist/Checkbox/__tests__/fixtures/A11yDemos.d.ts +6 -7
- package/dist/Checkbox/__tests__/fixtures/A11yDemos.js +10 -4
- package/dist/Checkbox/index.css +4 -4
- package/dist/CitySelector/CitySelector.d.ts +1 -1
- package/dist/CitySelector/CitySelector.js +2 -1
- package/dist/CitySelector/CitySelector.miniapp.d.ts +1 -1
- package/dist/CitySelector/CitySelector.miniapp.js +2 -1
- package/dist/CitySelector/CitySelectorCore.js +83 -61
- package/dist/CitySelector/Selector/index.d.ts +1 -1
- package/dist/CitySelector/Selector/index.js +5 -15
- package/dist/Collapse/Collapse.js +51 -50
- package/dist/CollapsePanel/CollapsePanel.d.ts +1 -1
- package/dist/CollapsePanel/CollapsePanel.js +10 -8
- package/dist/CollapsePanel/CollapsePanelItem.d.ts +1 -1
- package/dist/CollapsePanel/CollapsePanelItem.js +27 -17
- package/dist/Countdown/Countdown.d.ts +1 -1
- package/dist/Countdown/Countdown.js +39 -29
- package/dist/Countdown/__tests__/fixtures/A11yDemos.d.ts +14 -15
- package/dist/Countdown/__tests__/fixtures/A11yDemos.js +37 -23
- package/dist/DatePicker/DatePicker.d.ts +1 -1
- package/dist/DatePicker/DatePicker.js +3 -2
- package/dist/DesktopDatePicker/DesktopDatePicker.d.ts +1 -1
- package/dist/DesktopDatePicker/DesktopDatePicker.js +45 -40
- package/dist/DesktopDatePicker/useGetDatePickerContent.d.ts +1 -2
- package/dist/DesktopDatePicker/useGetDatePickerContent.js +48 -41
- package/dist/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +1 -1
- package/dist/DesktopDateTimePicker/DesktopDateTimePicker.js +57 -51
- package/dist/DesktopPicker/DesktopPicker.d.ts +1 -1
- package/dist/DesktopPicker/DesktopPicker.js +36 -25
- package/dist/DesktopTimePicker/DesktopTimePicker.d.ts +1 -1
- package/dist/DesktopTimePicker/DesktopTimePicker.js +46 -41
- package/dist/DesktopTimePicker/DesktopTimePickerList.js +21 -20
- package/dist/DesktopTimePicker/useGetTimePickerContent.d.ts +1 -2
- package/dist/DesktopTimePicker/useGetTimePickerContent.js +9 -8
- package/dist/Dialog/Dialog.js +48 -39
- package/dist/Dialog/FunctionalDialog.js +8 -8
- package/dist/Dialog/__tests__/fixtures/A11yDemos.d.ts +3 -4
- package/dist/Dialog/__tests__/fixtures/A11yDemos.js +4 -4
- package/dist/Divider/Divider.d.ts +1 -1
- package/dist/Divider/Divider.js +9 -4
- package/dist/Drawer/Drawer.js +28 -25
- package/dist/Drawer/__tests__/fixtures/A11yDemos.d.ts +12 -13
- package/dist/Drawer/__tests__/fixtures/A11yDemos.js +88 -35
- package/dist/Fade/Fade.js +23 -22
- package/dist/IconButton/IconButton.d.ts +1 -1
- package/dist/IconButton/IconButton.js +14 -9
- package/dist/Image/Image.d.ts +1 -1
- package/dist/Image/Image.js +15 -10
- package/dist/Image/__tests__/fixtures/A11yDemos.d.ts +12 -13
- package/dist/Image/__tests__/fixtures/A11yDemos.js +29 -25
- package/dist/Input/Input.d.ts +1 -1
- package/dist/Input/Input.js +28 -24
- package/dist/Input/__tests__/fixtures/A11yDemos.d.ts +12 -13
- package/dist/Input/__tests__/fixtures/A11yDemos.js +31 -13
- package/dist/ItemSelector/ItemSelector.d.ts +1 -1
- package/dist/ItemSelector/ItemSelector.js +2 -1
- package/dist/ItemSelector/ItemSelector.miniapp.d.ts +1 -1
- package/dist/ItemSelector/ItemSelector.miniapp.js +2 -1
- package/dist/ItemSelector/ItemSelectorCore.js +82 -68
- package/dist/ItemSelector/Selector/index.d.ts +1 -1
- package/dist/ItemSelector/Selector/index.js +5 -15
- package/dist/List/List.d.ts +1 -1
- package/dist/List/List.js +14 -7
- package/dist/List/ListItem.d.ts +1 -1
- package/dist/List/ListItem.js +14 -7
- package/dist/List/ListItemContent.d.ts +1 -1
- package/dist/List/ListItemContent.js +8 -1
- package/dist/List/ListItemExtra.d.ts +1 -1
- package/dist/List/ListItemExtra.js +5 -1
- package/dist/List/ListItemFooter.d.ts +1 -1
- package/dist/List/ListItemFooter.js +5 -1
- package/dist/List/ListItemHeader.d.ts +1 -1
- package/dist/List/ListItemHeader.js +5 -1
- package/dist/Loading/Loading.d.ts +1 -1
- package/dist/Loading/Loading.js +13 -6
- package/dist/Modal/Modal.d.ts +1 -1
- package/dist/Modal/Modal.js +5 -1
- package/dist/Modal/Modal.miniapp.d.ts +2 -4
- package/dist/Modal/Modal.miniapp.js +9 -6
- package/dist/Modal/__tests__/fixtures/A11yDemos.d.ts +2 -3
- package/dist/Modal/__tests__/fixtures/A11yDemos.js +7 -7
- package/dist/NavBar/NavBar.d.ts +1 -1
- package/dist/NavBar/NavBar.js +24 -11
- package/dist/Picker/Picker.d.ts +1 -1
- package/dist/Picker/Picker.js +63 -57
- package/dist/Picker/PickerPanel.d.ts +1 -1
- package/dist/Picker/PickerPanel.js +44 -37
- package/dist/Picker/__tests__/fixtures/A11yDemos.d.ts +1 -2
- package/dist/Picker/__tests__/fixtures/A11yDemos.js +2 -2
- package/dist/Popover/Popover.d.ts +1 -1
- package/dist/Popover/Popover.js +65 -52
- package/dist/Popover/__tests__/fixtures/A11yDemos.d.ts +16 -17
- package/dist/Popover/__tests__/fixtures/A11yDemos.js +62 -50
- package/dist/Popover/hooks/usePopoverPosition.js +1 -1
- package/dist/Portal/Portal.js +2 -1
- package/dist/Portal/Portal.miniapp.js +3 -2
- package/dist/Progress/Progress.d.ts +1 -1
- package/dist/Progress/Progress.js +9 -4
- package/dist/Progress/__tests__/fixtures/A11yDemos.d.ts +12 -13
- package/dist/Progress/__tests__/fixtures/A11yDemos.js +51 -30
- package/dist/Radio/Radio.d.ts +1 -1
- package/dist/Radio/Radio.js +25 -22
- package/dist/Radio/RadioButtonIcon.d.ts +1 -2
- package/dist/Radio/RadioButtonIcon.js +24 -22
- package/dist/Radio/RadioGroup.d.ts +1 -1
- package/dist/Radio/RadioGroup.js +9 -5
- package/dist/Radio/__tests__/fixtures/A11yDemos.d.ts +6 -7
- package/dist/Radio/__tests__/fixtures/A11yDemos.js +10 -4
- package/dist/Rating/Rating.d.ts +1 -1
- package/dist/Rating/Rating.js +42 -33
- package/dist/ScrollView/ScrollView.d.ts +1 -1
- package/dist/ScrollView/ScrollView.js +3 -2
- package/dist/ScrollView/__tests__/fixtures/A11yDemos.js +205 -168
- package/dist/Select/Select.d.ts +1 -1
- package/dist/Select/Select.js +87 -78
- package/dist/Select/SelectOption.d.ts +1 -1
- package/dist/Select/SelectOption.js +5 -4
- package/dist/Select/__tests__/fixtures/A11yDemos.d.ts +12 -13
- package/dist/Select/__tests__/fixtures/A11yDemos.js +76 -46
- package/dist/Skeleton/Skeleton.d.ts +1 -1
- package/dist/Skeleton/Skeleton.js +9 -4
- package/dist/Slide/Slide.js +25 -24
- package/dist/Slider/Slider.d.ts +1 -1
- package/dist/Slider/Slider.js +34 -27
- package/dist/Stack/Stack.d.ts +1 -1
- package/dist/Stack/Stack.js +17 -9
- package/dist/Stack/demo/StackDemo.d.ts +1 -2
- package/dist/Stack/demo/StackDemo.js +114 -101
- package/dist/Steps/Step.d.ts +1 -1
- package/dist/Steps/Step.js +56 -44
- package/dist/Steps/Steps.d.ts +1 -1
- package/dist/Steps/Steps.js +23 -17
- package/dist/SwipeAction/SwipeAction.d.ts +1 -1
- package/dist/SwipeAction/SwipeAction.js +55 -46
- package/dist/SwipeAction/SwipeActionItem.d.ts +1 -1
- package/dist/SwipeAction/SwipeActionItem.js +9 -4
- package/dist/Swiper/Swiper.d.ts +1 -1
- package/dist/Swiper/Swiper.js +7 -6
- package/dist/Swiper/SwiperItem.d.ts +1 -2
- package/dist/Swiper/SwiperItem.js +5 -2
- package/dist/Switch/Switch.d.ts +1 -1
- package/dist/Switch/Switch.js +22 -18
- package/dist/Switch/__tests__/fixtures/A11yDemos.d.ts +6 -7
- package/dist/Switch/__tests__/fixtures/A11yDemos.js +10 -4
- package/dist/Switch/index.css +11 -11
- package/dist/TabBar/TabBar.d.ts +1 -1
- package/dist/TabBar/TabBar.js +14 -10
- package/dist/TabBar/TabBarItem.d.ts +1 -1
- package/dist/TabBar/TabBarItem.js +31 -20
- package/dist/Tabs/Tab.d.ts +1 -1
- package/dist/Tabs/Tab.js +5 -4
- package/dist/Tabs/TabIndicator.js +3 -2
- package/dist/Tabs/TabMask.js +2 -1
- package/dist/Tabs/TabPanel.d.ts +1 -1
- package/dist/Tabs/TabPanel.js +10 -5
- package/dist/Tabs/Tabs.d.ts +1 -1
- package/dist/Tabs/Tabs.js +26 -17
- package/dist/Tabs/miniapp/Tab.d.ts +1 -1
- package/dist/Tabs/miniapp/Tab.js +5 -4
- package/dist/Tabs/miniapp/TabIndicator.js +3 -2
- package/dist/Tabs/miniapp/Tabs.d.ts +1 -1
- package/dist/Tabs/miniapp/Tabs.js +33 -23
- package/dist/Tag/Tag.d.ts +1 -1
- package/dist/Tag/Tag.js +9 -4
- package/dist/Tag/TagGroup.d.ts +1 -1
- package/dist/Tag/TagGroup.js +9 -4
- package/dist/Tag/__tests__/fixtures/A11yDemos.d.ts +12 -13
- package/dist/Tag/__tests__/fixtures/A11yDemos.js +121 -83
- package/dist/TextArea/TextArea.d.ts +1 -1
- package/dist/TextArea/TextArea.js +40 -36
- package/dist/TextArea/__tests__/fixtures/A11yDemos.d.ts +10 -11
- package/dist/TextArea/__tests__/fixtures/A11yDemos.js +18 -15
- package/dist/ThemeProvider/ThemeProvider.d.ts +1 -1
- package/dist/ThemeProvider/ThemeProvider.js +3 -2
- package/dist/Toast/FunctionalToast.js +11 -11
- package/dist/Toast/Toast.js +38 -32
- package/dist/Toast/__tests__/fixtures/A11yDemos.d.ts +1 -2
- package/dist/Toast/__tests__/fixtures/A11yDemos.js +5 -5
- package/dist/Tooltip/Tooltip.d.ts +1 -1
- package/dist/Tooltip/Tooltip.js +13 -6
- package/dist/Tooltip/__tests__/fixtures/A11yDemos.d.ts +16 -17
- package/dist/Tooltip/__tests__/fixtures/A11yDemos.js +51 -18
- package/dist/Tooltip/useTooltip.js +1 -1
- package/dist/Transition/Transition.js +2 -1
- package/dist/Transition/Transition.miniapp.js +2 -1
- package/dist/Transition/TransitionCore.js +8 -2
- package/dist/TransitionGroup/TransitionGroup.d.ts +1 -2
- package/dist/TransitionGroup/TransitionGroup.js +3 -2
- package/dist/TransitionGroup/demo/TransitionGroupDemo.d.ts +1 -2
- package/dist/TransitionGroup/demo/TransitionGroupDemo.js +24 -27
- package/dist/_.._/benchmarks/components/Button.js +2 -12
- package/dist/_.._/benchmarks/components/Input.js +3 -12
- package/dist/_.._/benchmarks/components/Tabs.js +8 -12
- package/es/ActionSheet/ActionSheet.js +18 -8
- package/es/ActionSheet/ActionSheetItem.d.ts +1 -1
- package/es/ActionSheet/ActionSheetItem.js +12 -5
- package/es/Alert/Alert.d.ts +1 -1
- package/es/Alert/Alert.js +36 -34
- package/es/Alert/__tests__/fixtures/A11yDemos.d.ts +8 -9
- package/es/Alert/__tests__/fixtures/A11yDemos.js +60 -54
- package/es/Avatar/Avatar.d.ts +1 -1
- package/es/Avatar/Avatar.js +11 -9
- package/es/Avatar/AvatarGroup.d.ts +1 -1
- package/es/Avatar/AvatarGroup.js +10 -6
- package/es/Backdrop/Backdrop.d.ts +1 -1
- package/es/Backdrop/Backdrop.js +9 -5
- package/es/Backdrop/__tests__/fixtures/A11yDemos.d.ts +4 -5
- package/es/Backdrop/__tests__/fixtures/A11yDemos.js +3 -3
- package/es/Badge/Badge.d.ts +1 -1
- package/es/Badge/Badge.js +23 -15
- package/es/Badge/__tests__/fixtures/A11yDemos.d.ts +16 -17
- package/es/Badge/__tests__/fixtures/A11yDemos.js +60 -27
- package/es/Badge/index.css +3 -3
- package/es/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/es/Breadcrumb/Breadcrumb.js +19 -10
- package/es/Breadcrumb/BreadcrumbItem.d.ts +1 -1
- package/es/Breadcrumb/BreadcrumbItem.js +18 -10
- package/es/Button/Button.d.ts +1 -1
- package/es/Button/Button.js +14 -7
- package/es/Button/__tests__/fixtures/A11yDemos.d.ts +14 -15
- package/es/Button/__tests__/fixtures/A11yDemos.js +32 -8
- package/es/CSSTransition/CSSTransition.js +2 -1
- package/es/CSSTransition/demo/CSSTransitionDemo.d.ts +1 -2
- package/es/CSSTransition/demo/CSSTransitionDemo.js +28 -25
- package/es/Calendar/Calendar.d.ts +1 -1
- package/es/Calendar/Calendar.js +67 -59
- package/es/Calendar/__tests__/fixtures/A11yDemos.d.ts +1 -2
- package/es/Calendar/__tests__/fixtures/A11yDemos.js +2 -2
- package/es/Card/Card.d.ts +1 -1
- package/es/Card/Card.js +9 -4
- package/es/Card/CardContent.d.ts +1 -1
- package/es/Card/CardContent.js +5 -1
- package/es/Card/CardFooter.d.ts +1 -1
- package/es/Card/CardFooter.js +5 -1
- package/es/Card/CardHeader.d.ts +1 -1
- package/es/Card/CardHeader.js +16 -9
- package/es/Checkbox/Checkbox.d.ts +1 -1
- package/es/Checkbox/Checkbox.js +30 -23
- package/es/Checkbox/CheckboxGroup.d.ts +1 -1
- package/es/Checkbox/CheckboxGroup.js +9 -5
- package/es/Checkbox/__tests__/fixtures/A11yDemos.d.ts +6 -7
- package/es/Checkbox/__tests__/fixtures/A11yDemos.js +10 -4
- package/es/Checkbox/index.css +4 -4
- package/es/CitySelector/CitySelector.d.ts +1 -1
- package/es/CitySelector/CitySelector.js +2 -1
- package/es/CitySelector/CitySelector.miniapp.d.ts +1 -1
- package/es/CitySelector/CitySelector.miniapp.js +2 -1
- package/es/CitySelector/CitySelectorCore.js +83 -61
- package/es/CitySelector/Selector/index.d.ts +1 -1
- package/es/CitySelector/Selector/index.js +5 -5
- package/es/Collapse/Collapse.js +51 -50
- package/es/CollapsePanel/CollapsePanel.d.ts +1 -1
- package/es/CollapsePanel/CollapsePanel.js +10 -8
- package/es/CollapsePanel/CollapsePanelItem.d.ts +1 -1
- package/es/CollapsePanel/CollapsePanelItem.js +27 -17
- package/es/Countdown/Countdown.d.ts +1 -1
- package/es/Countdown/Countdown.js +39 -29
- package/es/Countdown/__tests__/fixtures/A11yDemos.d.ts +14 -15
- package/es/Countdown/__tests__/fixtures/A11yDemos.js +37 -23
- package/es/DatePicker/DatePicker.d.ts +1 -1
- package/es/DatePicker/DatePicker.js +3 -2
- package/es/DesktopDatePicker/DesktopDatePicker.d.ts +1 -1
- package/es/DesktopDatePicker/DesktopDatePicker.js +45 -40
- package/es/DesktopDatePicker/useGetDatePickerContent.d.ts +1 -2
- package/es/DesktopDatePicker/useGetDatePickerContent.js +48 -41
- package/es/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +1 -1
- package/es/DesktopDateTimePicker/DesktopDateTimePicker.js +57 -51
- package/es/DesktopPicker/DesktopPicker.d.ts +1 -1
- package/es/DesktopPicker/DesktopPicker.js +36 -25
- package/es/DesktopTimePicker/DesktopTimePicker.d.ts +1 -1
- package/es/DesktopTimePicker/DesktopTimePicker.js +46 -41
- package/es/DesktopTimePicker/DesktopTimePickerList.js +21 -20
- package/es/DesktopTimePicker/useGetTimePickerContent.d.ts +1 -2
- package/es/DesktopTimePicker/useGetTimePickerContent.js +9 -8
- package/es/Dialog/Dialog.js +48 -39
- package/es/Dialog/FunctionalDialog.js +8 -8
- package/es/Dialog/__tests__/fixtures/A11yDemos.d.ts +3 -4
- package/es/Dialog/__tests__/fixtures/A11yDemos.js +4 -4
- package/es/Divider/Divider.d.ts +1 -1
- package/es/Divider/Divider.js +9 -4
- package/es/Drawer/Drawer.js +28 -25
- package/es/Drawer/__tests__/fixtures/A11yDemos.d.ts +12 -13
- package/es/Drawer/__tests__/fixtures/A11yDemos.js +88 -35
- package/es/Fade/Fade.js +23 -22
- package/es/IconButton/IconButton.d.ts +1 -1
- package/es/IconButton/IconButton.js +14 -9
- package/es/Image/Image.d.ts +1 -1
- package/es/Image/Image.js +15 -10
- package/es/Image/__tests__/fixtures/A11yDemos.d.ts +12 -13
- package/es/Image/__tests__/fixtures/A11yDemos.js +29 -25
- package/es/Input/Input.d.ts +1 -1
- package/es/Input/Input.js +28 -24
- package/es/Input/__tests__/fixtures/A11yDemos.d.ts +12 -13
- package/es/Input/__tests__/fixtures/A11yDemos.js +31 -13
- package/es/ItemSelector/ItemSelector.d.ts +1 -1
- package/es/ItemSelector/ItemSelector.js +2 -1
- package/es/ItemSelector/ItemSelector.miniapp.d.ts +1 -1
- package/es/ItemSelector/ItemSelector.miniapp.js +2 -1
- package/es/ItemSelector/ItemSelectorCore.js +82 -68
- package/es/ItemSelector/Selector/index.d.ts +1 -1
- package/es/ItemSelector/Selector/index.js +5 -5
- package/es/List/List.d.ts +1 -1
- package/es/List/List.js +14 -7
- package/es/List/ListItem.d.ts +1 -1
- package/es/List/ListItem.js +14 -7
- package/es/List/ListItemContent.d.ts +1 -1
- package/es/List/ListItemContent.js +8 -1
- package/es/List/ListItemExtra.d.ts +1 -1
- package/es/List/ListItemExtra.js +5 -1
- package/es/List/ListItemFooter.d.ts +1 -1
- package/es/List/ListItemFooter.js +5 -1
- package/es/List/ListItemHeader.d.ts +1 -1
- package/es/List/ListItemHeader.js +5 -1
- package/es/Loading/Loading.d.ts +1 -1
- package/es/Loading/Loading.js +13 -6
- package/es/Modal/Modal.d.ts +1 -1
- package/es/Modal/Modal.js +5 -1
- package/es/Modal/Modal.miniapp.d.ts +2 -4
- package/es/Modal/Modal.miniapp.js +9 -6
- package/es/Modal/__tests__/fixtures/A11yDemos.d.ts +2 -3
- package/es/Modal/__tests__/fixtures/A11yDemos.js +7 -7
- package/es/NavBar/NavBar.d.ts +1 -1
- package/es/NavBar/NavBar.js +24 -11
- package/es/Picker/Picker.d.ts +1 -1
- package/es/Picker/Picker.js +63 -57
- package/es/Picker/PickerPanel.d.ts +1 -1
- package/es/Picker/PickerPanel.js +44 -37
- package/es/Picker/__tests__/fixtures/A11yDemos.d.ts +1 -2
- package/es/Picker/__tests__/fixtures/A11yDemos.js +2 -2
- package/es/Popover/Popover.d.ts +1 -1
- package/es/Popover/Popover.js +65 -52
- package/es/Popover/__tests__/fixtures/A11yDemos.d.ts +16 -17
- package/es/Popover/__tests__/fixtures/A11yDemos.js +62 -50
- package/es/Popover/hooks/usePopoverPosition.js +1 -1
- package/es/Portal/Portal.js +2 -1
- package/es/Portal/Portal.miniapp.js +3 -2
- package/es/Progress/Progress.d.ts +1 -1
- package/es/Progress/Progress.js +9 -4
- package/es/Progress/__tests__/fixtures/A11yDemos.d.ts +12 -13
- package/es/Progress/__tests__/fixtures/A11yDemos.js +51 -30
- package/es/Radio/Radio.d.ts +1 -1
- package/es/Radio/Radio.js +25 -22
- package/es/Radio/RadioButtonIcon.d.ts +1 -2
- package/es/Radio/RadioButtonIcon.js +24 -22
- package/es/Radio/RadioGroup.d.ts +1 -1
- package/es/Radio/RadioGroup.js +9 -5
- package/es/Radio/__tests__/fixtures/A11yDemos.d.ts +6 -7
- package/es/Radio/__tests__/fixtures/A11yDemos.js +10 -4
- package/es/Rating/Rating.d.ts +1 -1
- package/es/Rating/Rating.js +42 -33
- package/es/ScrollView/ScrollView.d.ts +1 -1
- package/es/ScrollView/ScrollView.js +3 -2
- package/es/ScrollView/__tests__/fixtures/A11yDemos.js +205 -168
- package/es/Select/Select.d.ts +1 -1
- package/es/Select/Select.js +87 -78
- package/es/Select/SelectOption.d.ts +1 -1
- package/es/Select/SelectOption.js +5 -4
- package/es/Select/__tests__/fixtures/A11yDemos.d.ts +12 -13
- package/es/Select/__tests__/fixtures/A11yDemos.js +76 -46
- package/es/Skeleton/Skeleton.d.ts +1 -1
- package/es/Skeleton/Skeleton.js +9 -4
- package/es/Slide/Slide.js +25 -24
- package/es/Slider/Slider.d.ts +1 -1
- package/es/Slider/Slider.js +34 -27
- package/es/Stack/Stack.d.ts +1 -1
- package/es/Stack/Stack.js +17 -9
- package/es/Stack/demo/StackDemo.d.ts +1 -2
- package/es/Stack/demo/StackDemo.js +114 -91
- package/es/Steps/Step.d.ts +1 -1
- package/es/Steps/Step.js +56 -44
- package/es/Steps/Steps.d.ts +1 -1
- package/es/Steps/Steps.js +23 -17
- package/es/SwipeAction/SwipeAction.d.ts +1 -1
- package/es/SwipeAction/SwipeAction.js +55 -46
- package/es/SwipeAction/SwipeActionItem.d.ts +1 -1
- package/es/SwipeAction/SwipeActionItem.js +9 -4
- package/es/Swiper/Swiper.d.ts +1 -1
- package/es/Swiper/Swiper.js +7 -6
- package/es/Swiper/SwiperItem.d.ts +1 -2
- package/es/Swiper/SwiperItem.js +5 -2
- package/es/Switch/Switch.d.ts +1 -1
- package/es/Switch/Switch.js +22 -18
- package/es/Switch/__tests__/fixtures/A11yDemos.d.ts +6 -7
- package/es/Switch/__tests__/fixtures/A11yDemos.js +10 -4
- package/es/Switch/index.css +11 -11
- package/es/TabBar/TabBar.d.ts +1 -1
- package/es/TabBar/TabBar.js +14 -10
- package/es/TabBar/TabBarItem.d.ts +1 -1
- package/es/TabBar/TabBarItem.js +31 -20
- package/es/Tabs/Tab.d.ts +1 -1
- package/es/Tabs/Tab.js +5 -4
- package/es/Tabs/TabIndicator.js +3 -2
- package/es/Tabs/TabMask.js +2 -1
- package/es/Tabs/TabPanel.d.ts +1 -1
- package/es/Tabs/TabPanel.js +10 -5
- package/es/Tabs/Tabs.d.ts +1 -1
- package/es/Tabs/Tabs.js +26 -17
- package/es/Tabs/miniapp/Tab.d.ts +1 -1
- package/es/Tabs/miniapp/Tab.js +5 -4
- package/es/Tabs/miniapp/TabIndicator.js +3 -2
- package/es/Tabs/miniapp/Tabs.d.ts +1 -1
- package/es/Tabs/miniapp/Tabs.js +33 -23
- package/es/Tag/Tag.d.ts +1 -1
- package/es/Tag/Tag.js +9 -4
- package/es/Tag/TagGroup.d.ts +1 -1
- package/es/Tag/TagGroup.js +9 -4
- package/es/Tag/__tests__/fixtures/A11yDemos.d.ts +12 -13
- package/es/Tag/__tests__/fixtures/A11yDemos.js +121 -83
- package/es/TextArea/TextArea.d.ts +1 -1
- package/es/TextArea/TextArea.js +40 -36
- package/es/TextArea/__tests__/fixtures/A11yDemos.d.ts +10 -11
- package/es/TextArea/__tests__/fixtures/A11yDemos.js +18 -15
- package/es/ThemeProvider/ThemeProvider.d.ts +1 -1
- package/es/ThemeProvider/ThemeProvider.js +3 -2
- package/es/Toast/FunctionalToast.js +11 -11
- package/es/Toast/Toast.js +38 -32
- package/es/Toast/__tests__/fixtures/A11yDemos.d.ts +1 -2
- package/es/Toast/__tests__/fixtures/A11yDemos.js +5 -5
- package/es/Tooltip/Tooltip.d.ts +1 -1
- package/es/Tooltip/Tooltip.js +13 -6
- package/es/Tooltip/__tests__/fixtures/A11yDemos.d.ts +16 -17
- package/es/Tooltip/__tests__/fixtures/A11yDemos.js +51 -18
- package/es/Tooltip/useTooltip.js +1 -1
- package/es/Transition/Transition.js +2 -1
- package/es/Transition/Transition.miniapp.js +2 -1
- package/es/Transition/TransitionCore.js +8 -2
- package/es/TransitionGroup/TransitionGroup.d.ts +1 -2
- package/es/TransitionGroup/TransitionGroup.js +3 -2
- package/es/TransitionGroup/demo/TransitionGroupDemo.d.ts +1 -2
- package/es/TransitionGroup/demo/TransitionGroupDemo.js +24 -17
- package/es/_.._/benchmarks/components/Button.js +2 -2
- package/es/_.._/benchmarks/components/Input.js +3 -2
- package/es/_.._/benchmarks/components/Tabs.js +8 -2
- package/package.json +17 -11
package/es/TextArea/TextArea.js
CHANGED
|
@@ -29,6 +29,7 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
}
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
32
33
|
import { isMini, useForkRef, useValue } from "@bifrostui/utils";
|
|
33
34
|
import clsx from "clsx";
|
|
34
35
|
import React, { useEffect, useRef, useState } from "react";
|
|
@@ -169,9 +170,9 @@ const TextArea = /* @__PURE__ */ React.forwardRef(
|
|
|
169
170
|
focus: autoFocus
|
|
170
171
|
});
|
|
171
172
|
}
|
|
172
|
-
return /* @__PURE__ */
|
|
173
|
+
return /* @__PURE__ */ jsxs(
|
|
173
174
|
"div",
|
|
174
|
-
__spreadValues({
|
|
175
|
+
__spreadProps(__spreadValues({
|
|
175
176
|
className: clsx(
|
|
176
177
|
prefixCls,
|
|
177
178
|
{
|
|
@@ -180,40 +181,43 @@ const TextArea = /* @__PURE__ */ React.forwardRef(
|
|
|
180
181
|
className
|
|
181
182
|
),
|
|
182
183
|
ref
|
|
183
|
-
}, others),
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
184
|
+
}, others), {
|
|
185
|
+
children: [
|
|
186
|
+
/* @__PURE__ */ jsx(
|
|
187
|
+
"textarea",
|
|
188
|
+
__spreadProps(__spreadValues(__spreadProps(__spreadValues({
|
|
189
|
+
ref: handleInputRef
|
|
190
|
+
}, nativeProps), {
|
|
191
|
+
name,
|
|
192
|
+
value: textAreaValue,
|
|
193
|
+
placeholder,
|
|
194
|
+
disabled,
|
|
195
|
+
rows
|
|
196
|
+
}), textareaProps), {
|
|
197
|
+
onChange: (e) => {
|
|
198
|
+
var _a2;
|
|
199
|
+
triggerChange(e, e.target.value);
|
|
200
|
+
(_a2 = textareaProps == null ? void 0 : textareaProps.onChange) == null ? void 0 : _a2.call(textareaProps, e);
|
|
201
|
+
},
|
|
202
|
+
onInput: (e) => {
|
|
203
|
+
var _a2;
|
|
204
|
+
if (showCount) {
|
|
205
|
+
const remaining = maxLength - e.target.value.length;
|
|
206
|
+
setAriaDescription(
|
|
207
|
+
`${textareaText.remaining} ${remaining} ${textareaText.characters}`
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
if (isMini) {
|
|
211
|
+
triggerChange(e, e.target.value);
|
|
212
|
+
}
|
|
213
|
+
(_a2 = textareaProps == null ? void 0 : textareaProps.onInput) == null ? void 0 : _a2.call(textareaProps, e);
|
|
214
|
+
},
|
|
215
|
+
className: clsx(`${prefixCls}-content`, textareaProps == null ? void 0 : textareaProps.className)
|
|
216
|
+
})
|
|
217
|
+
),
|
|
218
|
+
showCount && /* @__PURE__ */ jsx("div", { className: `${prefixCls}-count`, children: maxLength === void 0 ? textAreaValue.length : `${textAreaValue.length}/${maxLength}` })
|
|
219
|
+
]
|
|
220
|
+
})
|
|
217
221
|
);
|
|
218
222
|
}
|
|
219
223
|
);
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
/**
|
|
3
2
|
* 自定义 TextArea 组件 Demo 集合
|
|
4
3
|
* 这个文件包含多个测试 demo,展示如何使用 getCustomDemoCodesFromFile 进行无障碍测试
|
|
5
4
|
* 文件名必须是 customDemoComponent.tsx(固定约定)
|
|
6
5
|
*/
|
|
7
|
-
export declare const basicTextAreaDemo: () =>
|
|
8
|
-
export declare const ariaLabelTextAreaDemo: () =>
|
|
9
|
-
export declare const requiredAndReadonlyTextAreaDemo: () =>
|
|
10
|
-
export declare const showCountTextAreaDemo: () =>
|
|
11
|
-
export declare const autoFocusTextAreaDemo: () =>
|
|
6
|
+
export declare const basicTextAreaDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const ariaLabelTextAreaDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const requiredAndReadonlyTextAreaDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const showCountTextAreaDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const autoFocusTextAreaDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
12
11
|
declare const _default: {
|
|
13
|
-
basicTextAreaDemo: () =>
|
|
14
|
-
ariaLabelTextAreaDemo: () =>
|
|
15
|
-
requiredAndReadonlyTextAreaDemo: () =>
|
|
16
|
-
showCountTextAreaDemo: () =>
|
|
17
|
-
autoFocusTextAreaDemo: () =>
|
|
12
|
+
basicTextAreaDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
ariaLabelTextAreaDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
requiredAndReadonlyTextAreaDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
showCountTextAreaDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
autoFocusTextAreaDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
18
17
|
};
|
|
19
18
|
export default _default;
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import TextArea from "../../TextArea";
|
|
3
3
|
const basicTextAreaDemo = () => {
|
|
4
|
-
return /* @__PURE__ */
|
|
4
|
+
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(TextArea, { placeholder: "\u8BF7\u8F93\u5165\u5185\u5BB9" }) });
|
|
5
5
|
};
|
|
6
6
|
const ariaLabelTextAreaDemo = () => {
|
|
7
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(TextArea, { placeholder: "\u8BF7\u8F93\u5165\u5185\u5BB9", "aria-label": "\u7528\u6237\u8BC4\u8BBA\u8F93\u5165\u6846" }) });
|
|
8
8
|
};
|
|
9
9
|
const requiredAndReadonlyTextAreaDemo = () => {
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
-
TextArea,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
11
|
+
/* @__PURE__ */ jsx(TextArea, { placeholder: "\u5FC5\u586B\u9879", "aria-required": true }),
|
|
12
|
+
/* @__PURE__ */ jsx(
|
|
13
|
+
TextArea,
|
|
14
|
+
{
|
|
15
|
+
placeholder: "\u53EA\u8BFB\u9879",
|
|
16
|
+
"aria-readonly": true,
|
|
17
|
+
defaultValue: "\u8FD9\u662F\u53EA\u8BFB\u5185\u5BB9"
|
|
18
|
+
}
|
|
19
|
+
)
|
|
20
|
+
] });
|
|
18
21
|
};
|
|
19
22
|
const showCountTextAreaDemo = () => {
|
|
20
|
-
return /* @__PURE__ */
|
|
23
|
+
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
21
24
|
TextArea,
|
|
22
25
|
{
|
|
23
26
|
placeholder: "\u6700\u591A\u8F93\u516550\u4E2A\u5B57",
|
|
@@ -25,17 +28,17 @@ const showCountTextAreaDemo = () => {
|
|
|
25
28
|
showCount: true,
|
|
26
29
|
"aria-label": "\u5E26\u5B57\u6570\u7EDF\u8BA1\u7684\u8F93\u5165\u6846"
|
|
27
30
|
}
|
|
28
|
-
));
|
|
31
|
+
) });
|
|
29
32
|
};
|
|
30
33
|
const autoFocusTextAreaDemo = () => {
|
|
31
|
-
return /* @__PURE__ */
|
|
34
|
+
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
32
35
|
TextArea,
|
|
33
36
|
{
|
|
34
37
|
placeholder: "\u81EA\u52A8\u805A\u7126",
|
|
35
38
|
autoFocus: true,
|
|
36
39
|
"aria-label": "\u81EA\u52A8\u805A\u7126\u7684\u8F93\u5165\u6846"
|
|
37
40
|
}
|
|
38
|
-
));
|
|
41
|
+
) });
|
|
39
42
|
};
|
|
40
43
|
var A11yDemos_default = {
|
|
41
44
|
basicTextAreaDemo,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ThemeProviderProps } from './ThemeProvider.types';
|
|
3
|
-
declare const ThemeProvider: React.ForwardRefExoticComponent<Omit<ThemeProviderProps
|
|
3
|
+
declare const ThemeProvider: React.ForwardRefExoticComponent<Omit<ThemeProviderProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
4
|
export default ThemeProvider;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
1
2
|
import React, { useMemo, useEffect } from "react";
|
|
2
3
|
import { useUniqueId } from "@bifrostui/utils";
|
|
3
4
|
import { ThemeContext } from "./hooks";
|
|
@@ -24,7 +25,7 @@ const ThemeProvider = /* @__PURE__ */ React.forwardRef(
|
|
|
24
25
|
let childrenNode = children;
|
|
25
26
|
if (!isRoot && React.isValidElement(children)) {
|
|
26
27
|
childrenNode = React.cloneElement(children, {
|
|
27
|
-
className: `${containerId} ${((_a = children
|
|
28
|
+
className: `${containerId} ${((_a = children.props) == null ? void 0 : _a.className) || ""}`.trim()
|
|
28
29
|
});
|
|
29
30
|
}
|
|
30
31
|
useEffect(() => {
|
|
@@ -49,7 +50,7 @@ const ThemeProvider = /* @__PURE__ */ React.forwardRef(
|
|
|
49
50
|
dmLightToken,
|
|
50
51
|
token
|
|
51
52
|
]);
|
|
52
|
-
return /* @__PURE__ */
|
|
53
|
+
return /* @__PURE__ */ jsx(ThemeContext.Provider, { value: theme, children: childrenNode });
|
|
53
54
|
}
|
|
54
55
|
);
|
|
55
56
|
ThemeProvider.displayName = "BuiThemeProvider";
|
|
@@ -29,7 +29,8 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
}
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
|
-
import
|
|
32
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
33
|
+
import {
|
|
33
34
|
useCallback,
|
|
34
35
|
useEffect,
|
|
35
36
|
useState,
|
|
@@ -99,9 +100,9 @@ const Toast = (props) => {
|
|
|
99
100
|
}
|
|
100
101
|
};
|
|
101
102
|
instance.close = close;
|
|
102
|
-
return /* @__PURE__ */
|
|
103
|
+
return /* @__PURE__ */ jsx(Portal, { container, children: /* @__PURE__ */ jsx(ToastView, __spreadProps(__spreadValues({}, others), { open, onExited: onProxyExited })) });
|
|
103
104
|
};
|
|
104
|
-
render(/* @__PURE__ */
|
|
105
|
+
render(/* @__PURE__ */ jsx(ToastComponent, {}), rootWrapper);
|
|
105
106
|
return instance;
|
|
106
107
|
};
|
|
107
108
|
["warning", "loading", "success", "fail"].forEach(
|
|
@@ -165,14 +166,14 @@ const UseToastComponent = (props) => {
|
|
|
165
166
|
onEnd == null ? void 0 : onEnd();
|
|
166
167
|
onExited == null ? void 0 : onExited();
|
|
167
168
|
};
|
|
168
|
-
return /* @__PURE__ */
|
|
169
|
+
return /* @__PURE__ */ jsx(Portal, { container, children: /* @__PURE__ */ jsx(
|
|
169
170
|
ToastView,
|
|
170
171
|
__spreadProps(__spreadValues({}, others), {
|
|
171
172
|
open,
|
|
172
173
|
onExited: onProxyExited,
|
|
173
174
|
ref: domRef
|
|
174
175
|
})
|
|
175
|
-
));
|
|
176
|
+
) });
|
|
176
177
|
};
|
|
177
178
|
UseToastComponent.displayName = "UseToastComponent";
|
|
178
179
|
const useToast = () => {
|
|
@@ -228,11 +229,9 @@ const useToast = () => {
|
|
|
228
229
|
)
|
|
229
230
|
);
|
|
230
231
|
};
|
|
231
|
-
return /* @__PURE__ */
|
|
232
|
+
return /* @__PURE__ */ jsx(
|
|
232
233
|
UseToastComponent,
|
|
233
|
-
__spreadProps(__spreadValues({
|
|
234
|
-
key: element.key
|
|
235
|
-
}, element.props), {
|
|
234
|
+
__spreadProps(__spreadValues({}, element.props), {
|
|
236
235
|
open: element.open,
|
|
237
236
|
onSetOpenFalse,
|
|
238
237
|
domRef: element.ref,
|
|
@@ -244,10 +243,11 @@ const useToast = () => {
|
|
|
244
243
|
hookToastClosesRef.current.splice(index, 1);
|
|
245
244
|
}
|
|
246
245
|
}
|
|
247
|
-
})
|
|
246
|
+
}),
|
|
247
|
+
element.key
|
|
248
248
|
);
|
|
249
249
|
});
|
|
250
|
-
return [hookToast, /* @__PURE__ */
|
|
250
|
+
return [hookToast, /* @__PURE__ */ jsx(Fragment, { children: renderedElements })];
|
|
251
251
|
};
|
|
252
252
|
Toast.useToast = useToast;
|
|
253
253
|
var FunctionalToast_default = Toast;
|
package/es/Toast/Toast.js
CHANGED
|
@@ -29,6 +29,7 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
}
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
32
33
|
import * as React from "react";
|
|
33
34
|
import clsx from "clsx";
|
|
34
35
|
import {
|
|
@@ -66,28 +67,28 @@ const ToastComponent = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
66
67
|
"transitionDuration"
|
|
67
68
|
]);
|
|
68
69
|
const iconMap = {
|
|
69
|
-
fail: /* @__PURE__ */
|
|
70
|
+
fail: /* @__PURE__ */ jsx(
|
|
70
71
|
ErrorCircleFilledBoldIcon,
|
|
71
72
|
{
|
|
72
73
|
htmlColor: "var(--bui-color-white)",
|
|
73
74
|
"aria-hidden": "true"
|
|
74
75
|
}
|
|
75
76
|
),
|
|
76
|
-
loading: /* @__PURE__ */
|
|
77
|
+
loading: /* @__PURE__ */ jsx(
|
|
77
78
|
AccessTimeCircleFilledBoldIcon,
|
|
78
79
|
{
|
|
79
80
|
htmlColor: "var(--bui-color-white)",
|
|
80
81
|
"aria-hidden": "true"
|
|
81
82
|
}
|
|
82
83
|
),
|
|
83
|
-
warning: /* @__PURE__ */
|
|
84
|
+
warning: /* @__PURE__ */ jsx(
|
|
84
85
|
AlertCircleFilledBoldIcon,
|
|
85
86
|
{
|
|
86
87
|
htmlColor: "var(--bui-color-white)",
|
|
87
88
|
"aria-hidden": "true"
|
|
88
89
|
}
|
|
89
90
|
),
|
|
90
|
-
success: /* @__PURE__ */
|
|
91
|
+
success: /* @__PURE__ */ jsx(
|
|
91
92
|
SuccessCircleFilledBoldIcon,
|
|
92
93
|
{
|
|
93
94
|
htmlColor: "var(--bui-color-white)",
|
|
@@ -102,36 +103,41 @@ const ToastComponent = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
102
103
|
role = "alert";
|
|
103
104
|
ariaLive = "assertive";
|
|
104
105
|
}
|
|
105
|
-
return /* @__PURE__ */
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
ref,
|
|
117
|
-
className: clsx(
|
|
118
|
-
prefixCls,
|
|
119
|
-
`${prefixCls}-${position}`,
|
|
106
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
107
|
+
disableClick && /* @__PURE__ */ jsx(Backdrop, { invisible: true, open: true }),
|
|
108
|
+
/* @__PURE__ */ jsx(
|
|
109
|
+
Fade,
|
|
110
|
+
__spreadProps(__spreadValues({}, others), {
|
|
111
|
+
in: open,
|
|
112
|
+
appear,
|
|
113
|
+
timeout: transitionDuration,
|
|
114
|
+
unmountOnExit: true,
|
|
115
|
+
children: /* @__PURE__ */ jsxs(
|
|
116
|
+
"div",
|
|
120
117
|
{
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
118
|
+
ref,
|
|
119
|
+
className: clsx(
|
|
120
|
+
prefixCls,
|
|
121
|
+
`${prefixCls}-${position}`,
|
|
122
|
+
{
|
|
123
|
+
[`${prefixCls}-icon`]: !!iconDom,
|
|
124
|
+
[`${prefixCls}-allow-click`]: !disableClick
|
|
125
|
+
},
|
|
126
|
+
className
|
|
127
|
+
),
|
|
128
|
+
style,
|
|
129
|
+
role,
|
|
130
|
+
"aria-live": ariaLive,
|
|
131
|
+
"aria-atomic": "true",
|
|
132
|
+
children: [
|
|
133
|
+
iconDom,
|
|
134
|
+
message
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
)
|
|
138
|
+
})
|
|
133
139
|
)
|
|
134
|
-
)
|
|
140
|
+
] });
|
|
135
141
|
});
|
|
136
142
|
ToastComponent.displayName = "BuiToast";
|
|
137
143
|
var Toast_default = ToastComponent;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const ToastDemo: () => React.JSX.Element;
|
|
1
|
+
export declare const ToastDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Button } from "../../../Button";
|
|
3
3
|
import Toast from "../../FunctionalToast";
|
|
4
4
|
const ToastDemo = () => {
|
|
5
5
|
const [toast] = Toast.useToast();
|
|
6
|
-
return /* @__PURE__ */
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
7
|
Button,
|
|
8
8
|
{
|
|
9
9
|
onClick: () => {
|
|
@@ -11,9 +11,9 @@ const ToastDemo = () => {
|
|
|
11
11
|
message: "Hello World",
|
|
12
12
|
duration: 0
|
|
13
13
|
});
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
},
|
|
15
|
+
children: "\u57FA\u7840 Toast"
|
|
16
|
+
}
|
|
17
17
|
);
|
|
18
18
|
};
|
|
19
19
|
export {
|
package/es/Tooltip/Tooltip.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { TooltipProps } from './Tooltip.types';
|
|
3
3
|
import './index.less';
|
|
4
|
-
declare const Tooltip: React.ForwardRefExoticComponent<Omit<TooltipProps
|
|
4
|
+
declare const Tooltip: React.ForwardRefExoticComponent<Omit<TooltipProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
5
5
|
export default Tooltip;
|
package/es/Tooltip/Tooltip.js
CHANGED
|
@@ -29,6 +29,7 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
}
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
32
33
|
import clsx from "clsx";
|
|
33
34
|
import * as React from "react";
|
|
34
35
|
import Portal from "../Portal";
|
|
@@ -109,12 +110,18 @@ const Tooltip = /* @__PURE__ */ React.forwardRef((props, ref) => {
|
|
|
109
110
|
}));
|
|
110
111
|
const childProps = getChildProps();
|
|
111
112
|
const portalProps = getPortalProps();
|
|
112
|
-
return /* @__PURE__ */
|
|
113
|
-
"div",
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
113
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
114
|
+
isOpen && title ? /* @__PURE__ */ jsx(Portal, __spreadProps(__spreadValues({}, portalProps), { children: /* @__PURE__ */ jsxs("div", __spreadProps(__spreadValues({}, tooltipProps), { children: [
|
|
115
|
+
/* @__PURE__ */ jsx(
|
|
116
|
+
"div",
|
|
117
|
+
{
|
|
118
|
+
className: clsx("bui-tooltip-arrow", `location-${arrowLocation}`)
|
|
119
|
+
}
|
|
120
|
+
),
|
|
121
|
+
/* @__PURE__ */ jsx("div", { className: "bui-tooltip-content", children: title })
|
|
122
|
+
] })) })) : null,
|
|
123
|
+
React.cloneElement(children, childProps)
|
|
124
|
+
] });
|
|
118
125
|
});
|
|
119
126
|
Tooltip.displayName = "BuiTooltip";
|
|
120
127
|
var Tooltip_default = Tooltip;
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
/**
|
|
3
2
|
* 自定义 Tooltip 组件 Demo 集合
|
|
4
3
|
* 这个文件包含多个测试 demo,展示如何使用 getCustomDemoCodesFromFile 进行无障碍测试
|
|
5
4
|
* 文件名必须是 A11yDemos.tsx(固定约定)
|
|
6
5
|
*/
|
|
7
|
-
export declare const basicTooltipDemo: () =>
|
|
8
|
-
export declare const placementTooltipDemo: () =>
|
|
9
|
-
export declare const triggerTooltipDemo: () =>
|
|
10
|
-
export declare const accessibilityTooltipDemo: () =>
|
|
11
|
-
export declare const complexInteractionTooltipDemo: () =>
|
|
12
|
-
export declare const complexContentTooltipDemo: () =>
|
|
13
|
-
export declare const offsetTooltipDemo: () =>
|
|
14
|
-
export declare const edgeCaseTooltipDemo: () =>
|
|
6
|
+
export declare const basicTooltipDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const placementTooltipDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const triggerTooltipDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const accessibilityTooltipDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const complexInteractionTooltipDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const complexContentTooltipDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const offsetTooltipDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const edgeCaseTooltipDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
15
14
|
declare const _default: {
|
|
16
|
-
basicTooltipDemo: () =>
|
|
17
|
-
placementTooltipDemo: () =>
|
|
18
|
-
triggerTooltipDemo: () =>
|
|
19
|
-
accessibilityTooltipDemo: () =>
|
|
20
|
-
complexInteractionTooltipDemo: () =>
|
|
21
|
-
complexContentTooltipDemo: () =>
|
|
22
|
-
offsetTooltipDemo: () =>
|
|
23
|
-
edgeCaseTooltipDemo: () =>
|
|
15
|
+
basicTooltipDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
placementTooltipDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
triggerTooltipDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
accessibilityTooltipDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
complexInteractionTooltipDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
complexContentTooltipDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
offsetTooltipDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
edgeCaseTooltipDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
24
23
|
};
|
|
25
24
|
export default _default;
|
|
@@ -1,41 +1,74 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import Tooltip from "../../Tooltip";
|
|
3
4
|
const basicTooltipDemo = () => {
|
|
4
|
-
return /* @__PURE__ */
|
|
5
|
+
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Tooltip, { title: "\u8FD9\u662F\u4E00\u4E2A\u57FA\u7840\u7684\u63D0\u793A\u6587\u672C", children: /* @__PURE__ */ jsx("button", { type: "button", children: "\u57FA\u7840Tooltip" }) }) });
|
|
5
6
|
};
|
|
6
7
|
const placementTooltipDemo = () => {
|
|
7
|
-
return /* @__PURE__ */
|
|
8
|
+
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "10px", flexWrap: "wrap" }, children: [
|
|
9
|
+
/* @__PURE__ */ jsx(Tooltip, { title: "\u9876\u90E8\u63D0\u793A", placement: "top", children: /* @__PURE__ */ jsx("button", { type: "button", children: "\u9876\u90E8" }) }),
|
|
10
|
+
/* @__PURE__ */ jsx(Tooltip, { title: "\u53F3\u4FA7\u63D0\u793A", placement: "right", children: /* @__PURE__ */ jsx("button", { type: "button", children: "\u53F3\u4FA7" }) }),
|
|
11
|
+
/* @__PURE__ */ jsx(Tooltip, { title: "\u5E95\u90E8\u63D0\u793A", placement: "bottom", children: /* @__PURE__ */ jsx("button", { type: "button", children: "\u5E95\u90E8" }) }),
|
|
12
|
+
/* @__PURE__ */ jsx(Tooltip, { title: "\u5DE6\u4FA7\u63D0\u793A", placement: "left", children: /* @__PURE__ */ jsx("button", { type: "button", children: "\u5DE6\u4FA7" }) })
|
|
13
|
+
] });
|
|
8
14
|
};
|
|
9
15
|
const triggerTooltipDemo = () => {
|
|
10
|
-
return /* @__PURE__ */
|
|
16
|
+
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "10px" }, children: [
|
|
17
|
+
/* @__PURE__ */ jsx(Tooltip, { title: "\u70B9\u51FB\u89E6\u53D1\u7684\u63D0\u793A", trigger: "click", children: /* @__PURE__ */ jsx("button", { type: "button", children: "\u70B9\u51FB\u89E6\u53D1" }) }),
|
|
18
|
+
/* @__PURE__ */ jsx(Tooltip, { title: "\u60AC\u505C\u89E6\u53D1\u7684\u63D0\u793A", trigger: "hover", children: /* @__PURE__ */ jsx("button", { type: "button", children: "\u60AC\u505C\u89E6\u53D1" }) })
|
|
19
|
+
] });
|
|
11
20
|
};
|
|
12
21
|
const accessibilityTooltipDemo = () => {
|
|
13
|
-
return /* @__PURE__ */
|
|
22
|
+
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "10px", flexDirection: "column" }, children: [
|
|
23
|
+
/* @__PURE__ */ jsx(Tooltip, { title: "\u81EA\u5B9A\u4E49\u89D2\u8272\u7684\u63D0\u793A", role: "status", "aria-label": "\u72B6\u6001\u63D0\u793A", children: /* @__PURE__ */ jsx("button", { type: "button", children: "\u72B6\u6001\u63D0\u793A" }) }),
|
|
24
|
+
/* @__PURE__ */ jsx(Tooltip, { title: "\u652F\u6301Escape\u952E\u5173\u95ED", closeOnEscape: true, trigger: "click", children: /* @__PURE__ */ jsx("button", { type: "button", children: "Escape\u952E\u5173\u95ED" }) })
|
|
25
|
+
] });
|
|
14
26
|
};
|
|
15
27
|
const complexInteractionTooltipDemo = () => {
|
|
16
28
|
const ComplexInteractionTooltipDemo = () => {
|
|
17
29
|
const [open, setOpen] = React.useState(false);
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "10px", alignItems: "center" }, children: [
|
|
31
|
+
/* @__PURE__ */ jsx(
|
|
32
|
+
Tooltip,
|
|
33
|
+
{
|
|
34
|
+
title: "\u53D7\u63A7\u6A21\u5F0F\u7684\u63D0\u793A",
|
|
35
|
+
open,
|
|
36
|
+
onOpenChange: (_, data) => setOpen(data.open),
|
|
37
|
+
children: /* @__PURE__ */ jsx("button", { type: "button", children: "\u53D7\u63A7Tooltip" })
|
|
38
|
+
}
|
|
39
|
+
),
|
|
40
|
+
/* @__PURE__ */ jsxs("button", { type: "button", onClick: () => setOpen(!open), children: [
|
|
41
|
+
"\u5916\u90E8\u63A7\u5236: ",
|
|
42
|
+
open ? "\u5173\u95ED" : "\u6253\u5F00"
|
|
43
|
+
] })
|
|
44
|
+
] });
|
|
27
45
|
};
|
|
28
|
-
return /* @__PURE__ */
|
|
46
|
+
return /* @__PURE__ */ jsx(ComplexInteractionTooltipDemo, {});
|
|
29
47
|
};
|
|
30
48
|
const complexContentTooltipDemo = () => {
|
|
31
|
-
const ComplexContent = () => /* @__PURE__ */
|
|
32
|
-
|
|
49
|
+
const ComplexContent = () => /* @__PURE__ */ jsxs("div", { style: { maxWidth: "200px" }, children: [
|
|
50
|
+
/* @__PURE__ */ jsx("h4", { style: { margin: "0 0 8px 0", fontSize: "14px" }, children: "\u590D\u6742\u5185\u5BB9" }),
|
|
51
|
+
/* @__PURE__ */ jsx("p", { style: { margin: "0 0 8px 0", fontSize: "12px" }, children: "\u8FD9\u662F\u4E00\u4E2A\u5305\u542B\u591A\u79CD\u5143\u7D20\u7684\u590D\u6742\u63D0\u793A\u5185\u5BB9\u3002" }),
|
|
52
|
+
/* @__PURE__ */ jsxs("ul", { style: { margin: 0, fontSize: "12px", paddingLeft: "16px" }, children: [
|
|
53
|
+
/* @__PURE__ */ jsx("li", { children: "\u9879\u76EE\u4E00" }),
|
|
54
|
+
/* @__PURE__ */ jsx("li", { children: "\u9879\u76EE\u4E8C" })
|
|
55
|
+
] })
|
|
56
|
+
] });
|
|
57
|
+
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Tooltip, { title: /* @__PURE__ */ jsx(ComplexContent, {}), children: /* @__PURE__ */ jsx("button", { type: "button", children: "\u590D\u6742\u5185\u5BB9Tooltip" }) }) });
|
|
33
58
|
};
|
|
34
59
|
const offsetTooltipDemo = () => {
|
|
35
|
-
return /* @__PURE__ */
|
|
60
|
+
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "10px" }, children: [
|
|
61
|
+
/* @__PURE__ */ jsx(Tooltip, { title: "\u65E0\u504F\u79FB", offset: 0, children: /* @__PURE__ */ jsx("button", { type: "button", children: "\u65E0\u504F\u79FB" }) }),
|
|
62
|
+
/* @__PURE__ */ jsx(Tooltip, { title: "\u504F\u79FB10px", offset: 10, children: /* @__PURE__ */ jsx("button", { type: "button", children: "\u504F\u79FB10px" }) }),
|
|
63
|
+
/* @__PURE__ */ jsx(Tooltip, { title: "\u504F\u79FB20px", offset: 20, children: /* @__PURE__ */ jsx("button", { type: "button", children: "\u504F\u79FB20px" }) })
|
|
64
|
+
] });
|
|
36
65
|
};
|
|
37
66
|
const edgeCaseTooltipDemo = () => {
|
|
38
|
-
return /* @__PURE__ */
|
|
67
|
+
return /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "10px", flexDirection: "column" }, children: [
|
|
68
|
+
/* @__PURE__ */ jsx(Tooltip, { title: "", children: /* @__PURE__ */ jsx("button", { type: "button", children: "\u7A7A\u5185\u5BB9" }) }),
|
|
69
|
+
/* @__PURE__ */ jsx(Tooltip, { title: "\u5F88\u957F\u5F88\u957F\u5F88\u957F\u5F88\u957F\u5F88\u957F\u5F88\u957F\u5F88\u957F\u5F88\u957F\u5F88\u957F\u5F88\u957F\u5F88\u957F\u5F88\u957F\u7684\u63D0\u793A\u6587\u672C\u5185\u5BB9", children: /* @__PURE__ */ jsx("button", { type: "button", children: "\u957F\u6587\u672C" }) }),
|
|
70
|
+
/* @__PURE__ */ jsx(Tooltip, { title: `\u7279\u6B8A\u5B57\u7B26 !@#$%^&*()_+-=[]{}|;':",./`, children: /* @__PURE__ */ jsx("button", { type: "button", children: "\u7279\u6B8A\u5B57\u7B26" }) })
|
|
71
|
+
] });
|
|
39
72
|
};
|
|
40
73
|
var A11yDemos_default = {
|
|
41
74
|
basicTooltipDemo,
|
package/es/Tooltip/useTooltip.js
CHANGED
|
@@ -62,7 +62,7 @@ function useTooltip(parameters) {
|
|
|
62
62
|
} = parameters;
|
|
63
63
|
const controlByUser = typeof open !== "undefined";
|
|
64
64
|
const { direction, location = "center" } = parsePlacement(placement);
|
|
65
|
-
const childrenRef = useRef();
|
|
65
|
+
const childrenRef = useRef(null);
|
|
66
66
|
const [openStatus, setOpenStatus] = useState(defaultOpen);
|
|
67
67
|
const [arrowDirection, setArrowDirection] = useState(direction);
|
|
68
68
|
const [arrowLocation, setArrowLocation] = useState(location);
|