@bifrostui/react 0.0.5
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/LICENSE +21 -0
- package/README.md +13 -0
- package/dist/ActionSheet/ActionSheet.css +27 -0
- package/dist/ActionSheet/ActionSheet.d.ts +5 -0
- package/dist/ActionSheet/ActionSheet.js +66 -0
- package/dist/ActionSheet/ActionSheet.types.d.ts +28 -0
- package/dist/ActionSheet/ActionSheet.types.js +5 -0
- package/dist/ActionSheet/ActionSheetContext.d.ts +4 -0
- package/dist/ActionSheet/ActionSheetContext.js +11 -0
- package/dist/ActionSheet/ActionSheetItem.css +51 -0
- package/dist/ActionSheet/ActionSheetItem.d.ts +5 -0
- package/dist/ActionSheet/ActionSheetItem.js +58 -0
- package/dist/ActionSheet/ActionSheetItem.types.d.ts +38 -0
- package/dist/ActionSheet/ActionSheetItem.types.js +5 -0
- package/dist/ActionSheet/index.d.ts +4 -0
- package/dist/ActionSheet/index.js +54 -0
- package/dist/Alert/Alert.d.ts +5 -0
- package/dist/Alert/Alert.js +115 -0
- package/dist/Alert/Alert.types.d.ts +61 -0
- package/dist/Alert/Alert.types.js +5 -0
- package/dist/Alert/index.css +89 -0
- package/dist/Alert/index.d.ts +4 -0
- package/dist/Alert/index.js +34 -0
- package/dist/Avatar/Avatar.css +43 -0
- package/dist/Avatar/Avatar.d.ts +5 -0
- package/dist/Avatar/Avatar.js +59 -0
- package/dist/Avatar/Avatar.types.d.ts +46 -0
- package/dist/Avatar/Avatar.types.js +5 -0
- package/dist/Avatar/AvatarGroup.css +31 -0
- package/dist/Avatar/AvatarGroup.d.ts +5 -0
- package/dist/Avatar/AvatarGroup.js +69 -0
- package/dist/Avatar/AvatarGroup.types.d.ts +27 -0
- package/dist/Avatar/AvatarGroup.types.js +5 -0
- package/dist/Avatar/index.d.ts +6 -0
- package/dist/Avatar/index.js +54 -0
- package/dist/Backdrop/Backdrop.css +14 -0
- package/dist/Backdrop/Backdrop.d.ts +5 -0
- package/dist/Backdrop/Backdrop.js +34 -0
- package/dist/Backdrop/Backdrop.types.d.ts +17 -0
- package/dist/Backdrop/Backdrop.types.js +5 -0
- package/dist/Backdrop/index.d.ts +2 -0
- package/dist/Backdrop/index.js +34 -0
- package/dist/Badge/Badge.css +95 -0
- package/dist/Badge/Badge.d.ts +5 -0
- package/dist/Badge/Badge.js +42 -0
- package/dist/Badge/Badge.types.d.ts +27 -0
- package/dist/Badge/Badge.types.js +5 -0
- package/dist/Badge/index.d.ts +2 -0
- package/dist/Badge/index.js +34 -0
- package/dist/Button/Button.css +200 -0
- package/dist/Button/Button.d.ts +5 -0
- package/dist/Button/Button.js +53 -0
- package/dist/Button/Button.types.d.ts +52 -0
- package/dist/Button/Button.types.js +5 -0
- package/dist/Button/index.d.ts +2 -0
- package/dist/Button/index.js +34 -0
- package/dist/Calendar/Calendar.css +105 -0
- package/dist/Calendar/Calendar.d.ts +5 -0
- package/dist/Calendar/Calendar.js +275 -0
- package/dist/Calendar/Calendar.types.d.ts +76 -0
- package/dist/Calendar/Calendar.types.js +5 -0
- package/dist/Calendar/index.d.ts +2 -0
- package/dist/Calendar/index.js +34 -0
- package/dist/Calendar/utils.d.ts +25 -0
- package/dist/Calendar/utils.js +77 -0
- package/dist/Card/Card.css +9 -0
- package/dist/Card/Card.d.ts +5 -0
- package/dist/Card/Card.js +27 -0
- package/dist/Card/Card.types.d.ts +6 -0
- package/dist/Card/Card.types.js +5 -0
- package/dist/Card/CardContent.css +6 -0
- package/dist/Card/CardContent.d.ts +5 -0
- package/dist/Card/CardContent.js +25 -0
- package/dist/Card/CardContent.types.d.ts +6 -0
- package/dist/Card/CardContent.types.js +5 -0
- package/dist/Card/CardFooter.css +8 -0
- package/dist/Card/CardFooter.d.ts +5 -0
- package/dist/Card/CardFooter.js +25 -0
- package/dist/Card/CardFooter.types.d.ts +6 -0
- package/dist/Card/CardFooter.types.js +5 -0
- package/dist/Card/CardHeader.css +45 -0
- package/dist/Card/CardHeader.d.ts +5 -0
- package/dist/Card/CardHeader.js +59 -0
- package/dist/Card/CardHeader.types.d.ts +23 -0
- package/dist/Card/CardHeader.types.js +5 -0
- package/dist/Card/index.d.ts +10 -0
- package/dist/Card/index.js +94 -0
- package/dist/Checkbox/Checkbox.css +45 -0
- package/dist/Checkbox/Checkbox.d.ts +5 -0
- package/dist/Checkbox/Checkbox.js +101 -0
- package/dist/Checkbox/Checkbox.types.d.ts +84 -0
- package/dist/Checkbox/Checkbox.types.js +5 -0
- package/dist/Checkbox/CheckboxContext.d.ts +5 -0
- package/dist/Checkbox/CheckboxContext.js +11 -0
- package/dist/Checkbox/CheckboxGroup.d.ts +5 -0
- package/dist/Checkbox/CheckboxGroup.js +57 -0
- package/dist/Checkbox/index.d.ts +3 -0
- package/dist/Checkbox/index.js +42 -0
- package/dist/Countdown/Countdown.css +28 -0
- package/dist/Countdown/Countdown.d.ts +5 -0
- package/dist/Countdown/Countdown.js +103 -0
- package/dist/Countdown/Countdown.types.d.ts +123 -0
- package/dist/Countdown/Countdown.types.js +5 -0
- package/dist/Countdown/index.d.ts +3 -0
- package/dist/Countdown/index.js +46 -0
- package/dist/Countdown/useCountdown.d.ts +10 -0
- package/dist/Countdown/useCountdown.js +47 -0
- package/dist/Countdown/utils.d.ts +9 -0
- package/dist/Countdown/utils.js +124 -0
- package/dist/Divider/Divider.css +41 -0
- package/dist/Divider/Divider.d.ts +5 -0
- package/dist/Divider/Divider.js +64 -0
- package/dist/Divider/Divider.types.d.ts +19 -0
- package/dist/Divider/Divider.types.js +5 -0
- package/dist/Divider/index.d.ts +2 -0
- package/dist/Divider/index.js +34 -0
- package/dist/Drawer/Drawer.css +35 -0
- package/dist/Drawer/Drawer.d.ts +5 -0
- package/dist/Drawer/Drawer.js +66 -0
- package/dist/Drawer/Drawer.types.d.ts +51 -0
- package/dist/Drawer/Drawer.types.js +5 -0
- package/dist/Drawer/index.d.ts +2 -0
- package/dist/Drawer/index.js +34 -0
- package/dist/Fade/Fade.d.ts +4 -0
- package/dist/Fade/Fade.js +72 -0
- package/dist/Fade/Fade.types.d.ts +9 -0
- package/dist/Fade/Fade.types.js +5 -0
- package/dist/Fade/index.d.ts +3 -0
- package/dist/Fade/index.js +34 -0
- package/dist/IconButton/IconButton.css +130 -0
- package/dist/IconButton/IconButton.d.ts +5 -0
- package/dist/IconButton/IconButton.js +50 -0
- package/dist/IconButton/IconButton.types.d.ts +41 -0
- package/dist/IconButton/IconButton.types.js +5 -0
- package/dist/IconButton/index.d.ts +2 -0
- package/dist/IconButton/index.js +34 -0
- package/dist/Image/Image.d.ts +5 -0
- package/dist/Image/Image.js +123 -0
- package/dist/Image/Image.types.d.ts +48 -0
- package/dist/Image/Image.types.js +5 -0
- package/dist/Image/index.css +35 -0
- package/dist/Image/index.d.ts +3 -0
- package/dist/Image/index.js +34 -0
- package/dist/Input/Input.css +59 -0
- package/dist/Input/Input.d.ts +5 -0
- package/dist/Input/Input.js +115 -0
- package/dist/Input/Input.types.d.ts +70 -0
- package/dist/Input/Input.types.js +5 -0
- package/dist/Input/index.d.ts +2 -0
- package/dist/Input/index.js +34 -0
- package/dist/List/List.css +9 -0
- package/dist/List/List.d.ts +5 -0
- package/dist/List/List.js +43 -0
- package/dist/List/List.types.d.ts +22 -0
- package/dist/List/List.types.js +5 -0
- package/dist/List/ListContext.d.ts +7 -0
- package/dist/List/ListContext.js +12 -0
- package/dist/List/ListItem.css +23 -0
- package/dist/List/ListItem.d.ts +5 -0
- package/dist/List/ListItem.js +57 -0
- package/dist/List/ListItem.types.d.ts +20 -0
- package/dist/List/ListItem.types.js +5 -0
- package/dist/List/ListItemContent.css +18 -0
- package/dist/List/ListItemContent.d.ts +5 -0
- package/dist/List/ListItemContent.js +37 -0
- package/dist/List/ListItemContent.types.d.ts +16 -0
- package/dist/List/ListItemContent.types.js +5 -0
- package/dist/List/ListItemExtra.css +7 -0
- package/dist/List/ListItemExtra.d.ts +5 -0
- package/dist/List/ListItemExtra.js +29 -0
- package/dist/List/ListItemExtra.types.d.ts +8 -0
- package/dist/List/ListItemExtra.types.js +5 -0
- package/dist/List/ListItemFooter.css +9 -0
- package/dist/List/ListItemFooter.d.ts +5 -0
- package/dist/List/ListItemFooter.js +29 -0
- package/dist/List/ListItemFooter.types.d.ts +8 -0
- package/dist/List/ListItemFooter.types.js +5 -0
- package/dist/List/ListItemHeader.css +7 -0
- package/dist/List/ListItemHeader.d.ts +5 -0
- package/dist/List/ListItemHeader.js +29 -0
- package/dist/List/ListItemHeader.types.d.ts +8 -0
- package/dist/List/ListItemHeader.types.js +5 -0
- package/dist/List/index.d.ts +13 -0
- package/dist/List/index.js +134 -0
- package/dist/Loading/Loading.css +31 -0
- package/dist/Loading/Loading.d.ts +5 -0
- package/dist/Loading/Loading.js +39 -0
- package/dist/Loading/Loading.types.d.ts +20 -0
- package/dist/Loading/Loading.types.js +5 -0
- package/dist/Loading/index.d.ts +2 -0
- package/dist/Loading/index.js +34 -0
- package/dist/Modal/Modal.css +15 -0
- package/dist/Modal/Modal.d.ts +5 -0
- package/dist/Modal/Modal.js +89 -0
- package/dist/Modal/Modal.types.d.ts +20 -0
- package/dist/Modal/Modal.types.js +5 -0
- package/dist/Modal/index.d.ts +3 -0
- package/dist/Modal/index.js +34 -0
- package/dist/NavBar/NavBar.css +57 -0
- package/dist/NavBar/NavBar.d.ts +5 -0
- package/dist/NavBar/NavBar.js +87 -0
- package/dist/NavBar/NavBar.types.d.ts +44 -0
- package/dist/NavBar/NavBar.types.js +5 -0
- package/dist/NavBar/index.d.ts +2 -0
- package/dist/NavBar/index.js +34 -0
- package/dist/Portal/Portal.d.ts +4 -0
- package/dist/Portal/Portal.js +18 -0
- package/dist/Portal/Portal.miniapp.d.ts +4 -0
- package/dist/Portal/Portal.miniapp.js +44 -0
- package/dist/Portal/Portal.types.d.ts +22 -0
- package/dist/Portal/Portal.types.js +5 -0
- package/dist/Portal/PortalCore.d.ts +8 -0
- package/dist/Portal/PortalCore.js +57 -0
- package/dist/Portal/index.d.ts +3 -0
- package/dist/Portal/index.js +34 -0
- package/dist/Progress/Progress.css +22 -0
- package/dist/Progress/Progress.d.ts +8 -0
- package/dist/Progress/Progress.js +89 -0
- package/dist/Progress/Progress.types.d.ts +28 -0
- package/dist/Progress/Progress.types.js +5 -0
- package/dist/Progress/index.d.ts +3 -0
- package/dist/Progress/index.js +34 -0
- package/dist/Radio/Radio.css +65 -0
- package/dist/Radio/Radio.d.ts +5 -0
- package/dist/Radio/Radio.js +120 -0
- package/dist/Radio/Radio.types.d.ts +83 -0
- package/dist/Radio/Radio.types.js +5 -0
- package/dist/Radio/RadioButtonIcon.d.ts +12 -0
- package/dist/Radio/RadioButtonIcon.js +38 -0
- package/dist/Radio/RadioContext.d.ts +5 -0
- package/dist/Radio/RadioContext.js +11 -0
- package/dist/Radio/RadioGroup.d.ts +5 -0
- package/dist/Radio/RadioGroup.js +51 -0
- package/dist/Radio/index.d.ts +3 -0
- package/dist/Radio/index.js +42 -0
- package/dist/Rating/Rating.css +52 -0
- package/dist/Rating/Rating.d.ts +5 -0
- package/dist/Rating/Rating.js +100 -0
- package/dist/Rating/Rating.types.d.ts +66 -0
- package/dist/Rating/Rating.types.js +5 -0
- package/dist/Rating/index.d.ts +2 -0
- package/dist/Rating/index.js +34 -0
- package/dist/ScrollView/ScrollView.css +19 -0
- package/dist/ScrollView/ScrollView.d.ts +5 -0
- package/dist/ScrollView/ScrollView.js +204 -0
- package/dist/ScrollView/ScrollView.types.d.ts +258 -0
- package/dist/ScrollView/ScrollView.types.js +5 -0
- package/dist/ScrollView/index.d.ts +3 -0
- package/dist/ScrollView/index.js +34 -0
- package/dist/ScrollView/index.miniapp.d.ts +3 -0
- package/dist/ScrollView/index.miniapp.js +14 -0
- package/dist/Select/Select.css +89 -0
- package/dist/Select/Select.d.ts +5 -0
- package/dist/Select/Select.js +159 -0
- package/dist/Select/Select.types.d.ts +98 -0
- package/dist/Select/Select.types.js +5 -0
- package/dist/Select/SelectOption.d.ts +5 -0
- package/dist/Select/SelectOption.js +51 -0
- package/dist/Select/index.d.ts +4 -0
- package/dist/Select/index.js +42 -0
- package/dist/Select/selectContext.d.ts +4 -0
- package/dist/Select/selectContext.js +11 -0
- package/dist/Skeleton/Skeleton.css +54 -0
- package/dist/Skeleton/Skeleton.d.ts +5 -0
- package/dist/Skeleton/Skeleton.js +42 -0
- package/dist/Skeleton/Skeleton.types.d.ts +33 -0
- package/dist/Skeleton/Skeleton.types.js +5 -0
- package/dist/Skeleton/index.d.ts +3 -0
- package/dist/Skeleton/index.js +34 -0
- package/dist/Slide/Slide.d.ts +4 -0
- package/dist/Slide/Slide.js +88 -0
- package/dist/Slide/Slide.types.d.ts +14 -0
- package/dist/Slide/Slide.types.js +5 -0
- package/dist/Slide/index.d.ts +3 -0
- package/dist/Slide/index.js +34 -0
- package/dist/Slider/Slider.css +95 -0
- package/dist/Slider/Slider.d.ts +5 -0
- package/dist/Slider/Slider.js +281 -0
- package/dist/Slider/Slider.types.d.ts +62 -0
- package/dist/Slider/Slider.types.js +5 -0
- package/dist/Slider/index.d.ts +2 -0
- package/dist/Slider/index.js +34 -0
- package/dist/Slider/utils.d.ts +14 -0
- package/dist/Slider/utils.js +30 -0
- package/dist/Stack/Stack.css +11 -0
- package/dist/Stack/Stack.d.ts +5 -0
- package/dist/Stack/Stack.js +53 -0
- package/dist/Stack/Stack.types.d.ts +35 -0
- package/dist/Stack/Stack.types.js +5 -0
- package/dist/Stack/demo/StackDemo.d.ts +4 -0
- package/dist/Stack/demo/StackDemo.js +126 -0
- package/dist/Stack/demo/index.css +23 -0
- package/dist/Stack/index.d.ts +3 -0
- package/dist/Stack/index.js +34 -0
- package/dist/Steps/Step.css +174 -0
- package/dist/Steps/Step.d.ts +5 -0
- package/dist/Steps/Step.js +107 -0
- package/dist/Steps/Step.types.d.ts +35 -0
- package/dist/Steps/Step.types.js +5 -0
- package/dist/Steps/Steps.css +14 -0
- package/dist/Steps/Steps.d.ts +5 -0
- package/dist/Steps/Steps.js +65 -0
- package/dist/Steps/Steps.types.d.ts +35 -0
- package/dist/Steps/Steps.types.js +5 -0
- package/dist/Steps/StepsContext.d.ts +5 -0
- package/dist/Steps/StepsContext.js +11 -0
- package/dist/Steps/index.d.ts +4 -0
- package/dist/Steps/index.js +54 -0
- package/dist/Swiper/Swiper.css +20 -0
- package/dist/Swiper/Swiper.d.ts +10 -0
- package/dist/Swiper/Swiper.js +109 -0
- package/dist/Swiper/Swiper.types.d.ts +173 -0
- package/dist/Swiper/Swiper.types.js +5 -0
- package/dist/Swiper/SwiperItem.d.ts +7 -0
- package/dist/Swiper/SwiperItem.js +30 -0
- package/dist/Swiper/index.d.ts +3 -0
- package/dist/Swiper/index.js +42 -0
- package/dist/Swiper/index.miniapp.d.ts +8 -0
- package/dist/Swiper/index.miniapp.js +23 -0
- package/dist/Switch/Switch.css +127 -0
- package/dist/Switch/Switch.d.ts +5 -0
- package/dist/Switch/Switch.js +73 -0
- package/dist/Switch/Switch.types.d.ts +56 -0
- package/dist/Switch/Switch.types.js +5 -0
- package/dist/Switch/index.d.ts +3 -0
- package/dist/Switch/index.js +34 -0
- package/dist/TabBar/TabBar.css +8 -0
- package/dist/TabBar/TabBar.d.ts +5 -0
- package/dist/TabBar/TabBar.js +47 -0
- package/dist/TabBar/TabBarContext.d.ts +27 -0
- package/dist/TabBar/TabBarContext.js +9 -0
- package/dist/TabBar/TabBarItem.css +38 -0
- package/dist/TabBar/TabBarItem.d.ts +5 -0
- package/dist/TabBar/TabBarItem.js +62 -0
- package/dist/TabBar/index.d.ts +4 -0
- package/dist/TabBar/index.js +36 -0
- package/dist/TabBar/index.types.d.ts +54 -0
- package/dist/TabBar/index.types.js +5 -0
- package/dist/Tabs/Tab.css +52 -0
- package/dist/Tabs/Tab.d.ts +5 -0
- package/dist/Tabs/Tab.js +58 -0
- package/dist/Tabs/Tab.types.d.ts +12 -0
- package/dist/Tabs/Tab.types.js +5 -0
- package/dist/Tabs/TabPanel.css +9 -0
- package/dist/Tabs/TabPanel.d.ts +5 -0
- package/dist/Tabs/TabPanel.js +37 -0
- package/dist/Tabs/TabPanel.types.d.ts +19 -0
- package/dist/Tabs/TabPanel.types.js +5 -0
- package/dist/Tabs/Tabs.css +56 -0
- package/dist/Tabs/Tabs.d.ts +5 -0
- package/dist/Tabs/Tabs.js +193 -0
- package/dist/Tabs/Tabs.types.d.ts +45 -0
- package/dist/Tabs/Tabs.types.js +5 -0
- package/dist/Tabs/TabsContext.d.ts +9 -0
- package/dist/Tabs/TabsContext.js +14 -0
- package/dist/Tabs/index.d.ts +6 -0
- package/dist/Tabs/index.js +74 -0
- package/dist/Tabs/utils/bound.d.ts +1 -0
- package/dist/Tabs/utils/bound.js +16 -0
- package/dist/Tag/Tag.css +97 -0
- package/dist/Tag/Tag.d.ts +5 -0
- package/dist/Tag/Tag.js +80 -0
- package/dist/Tag/Tag.types.d.ts +23 -0
- package/dist/Tag/Tag.types.js +5 -0
- package/dist/Tag/TagGroup.css +16 -0
- package/dist/Tag/TagGroup.d.ts +5 -0
- package/dist/Tag/TagGroup.js +27 -0
- package/dist/Tag/TagGroup.types.d.ts +6 -0
- package/dist/Tag/TagGroup.types.js +5 -0
- package/dist/Tag/index.d.ts +5 -0
- package/dist/Tag/index.js +48 -0
- package/dist/TextArea/TextArea.css +43 -0
- package/dist/TextArea/TextArea.d.ts +5 -0
- package/dist/TextArea/TextArea.js +149 -0
- package/dist/TextArea/TextArea.types.d.ts +70 -0
- package/dist/TextArea/TextArea.types.js +5 -0
- package/dist/TextArea/index.d.ts +2 -0
- package/dist/TextArea/index.js +34 -0
- package/dist/Transition/Transition.d.ts +4 -0
- package/dist/Transition/Transition.js +19 -0
- package/dist/Transition/Transition.miniapp.d.ts +4 -0
- package/dist/Transition/Transition.miniapp.js +19 -0
- package/dist/Transition/Transition.types.d.ts +100 -0
- package/dist/Transition/Transition.types.js +5 -0
- package/dist/Transition/TransitionCore.d.ts +4 -0
- package/dist/Transition/TransitionCore.js +180 -0
- package/dist/Transition/index.d.ts +3 -0
- package/dist/Transition/index.js +34 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.js +423 -0
- package/es/ActionSheet/ActionSheet.css +27 -0
- package/es/ActionSheet/ActionSheet.d.ts +5 -0
- package/es/ActionSheet/ActionSheet.js +59 -0
- package/es/ActionSheet/ActionSheet.types.d.ts +28 -0
- package/es/ActionSheet/ActionSheet.types.js +1 -0
- package/es/ActionSheet/ActionSheetContext.d.ts +4 -0
- package/es/ActionSheet/ActionSheetContext.js +4 -0
- package/es/ActionSheet/ActionSheetItem.css +51 -0
- package/es/ActionSheet/ActionSheetItem.d.ts +5 -0
- package/es/ActionSheet/ActionSheetItem.js +51 -0
- package/es/ActionSheet/ActionSheetItem.types.d.ts +38 -0
- package/es/ActionSheet/ActionSheetItem.types.js +1 -0
- package/es/ActionSheet/index.d.ts +4 -0
- package/es/ActionSheet/index.js +4 -0
- package/es/Alert/Alert.d.ts +5 -0
- package/es/Alert/Alert.js +110 -0
- package/es/Alert/Alert.types.d.ts +61 -0
- package/es/Alert/Alert.types.js +1 -0
- package/es/Alert/index.css +89 -0
- package/es/Alert/index.d.ts +4 -0
- package/es/Alert/index.js +4 -0
- package/es/Avatar/Avatar.css +43 -0
- package/es/Avatar/Avatar.d.ts +5 -0
- package/es/Avatar/Avatar.js +55 -0
- package/es/Avatar/Avatar.types.d.ts +46 -0
- package/es/Avatar/Avatar.types.js +1 -0
- package/es/Avatar/AvatarGroup.css +31 -0
- package/es/Avatar/AvatarGroup.d.ts +5 -0
- package/es/Avatar/AvatarGroup.js +65 -0
- package/es/Avatar/AvatarGroup.types.d.ts +27 -0
- package/es/Avatar/AvatarGroup.types.js +1 -0
- package/es/Avatar/index.d.ts +6 -0
- package/es/Avatar/index.js +6 -0
- package/es/Backdrop/Backdrop.css +14 -0
- package/es/Backdrop/Backdrop.d.ts +5 -0
- package/es/Backdrop/Backdrop.js +30 -0
- package/es/Backdrop/Backdrop.types.d.ts +17 -0
- package/es/Backdrop/Backdrop.types.js +1 -0
- package/es/Backdrop/index.d.ts +2 -0
- package/es/Backdrop/index.js +2 -0
- package/es/Badge/Badge.css +95 -0
- package/es/Badge/Badge.d.ts +5 -0
- package/es/Badge/Badge.js +38 -0
- package/es/Badge/Badge.types.d.ts +27 -0
- package/es/Badge/Badge.types.js +1 -0
- package/es/Badge/index.d.ts +2 -0
- package/es/Badge/index.js +2 -0
- package/es/Button/Button.css +200 -0
- package/es/Button/Button.d.ts +5 -0
- package/es/Button/Button.js +47 -0
- package/es/Button/Button.types.d.ts +52 -0
- package/es/Button/Button.types.js +1 -0
- package/es/Button/index.d.ts +2 -0
- package/es/Button/index.js +2 -0
- package/es/Calendar/Calendar.css +105 -0
- package/es/Calendar/Calendar.d.ts +5 -0
- package/es/Calendar/Calendar.js +286 -0
- package/es/Calendar/Calendar.types.d.ts +76 -0
- package/es/Calendar/Calendar.types.js +1 -0
- package/es/Calendar/index.d.ts +2 -0
- package/es/Calendar/index.js +2 -0
- package/es/Calendar/utils.d.ts +25 -0
- package/es/Calendar/utils.js +66 -0
- package/es/Card/Card.css +9 -0
- package/es/Card/Card.d.ts +5 -0
- package/es/Card/Card.js +21 -0
- package/es/Card/Card.types.d.ts +6 -0
- package/es/Card/Card.types.js +1 -0
- package/es/Card/CardContent.css +6 -0
- package/es/Card/CardContent.d.ts +5 -0
- package/es/Card/CardContent.js +19 -0
- package/es/Card/CardContent.types.d.ts +6 -0
- package/es/Card/CardContent.types.js +1 -0
- package/es/Card/CardFooter.css +8 -0
- package/es/Card/CardFooter.d.ts +5 -0
- package/es/Card/CardFooter.js +19 -0
- package/es/Card/CardFooter.types.d.ts +6 -0
- package/es/Card/CardFooter.types.js +1 -0
- package/es/Card/CardHeader.css +45 -0
- package/es/Card/CardHeader.d.ts +5 -0
- package/es/Card/CardHeader.js +53 -0
- package/es/Card/CardHeader.types.d.ts +23 -0
- package/es/Card/CardHeader.types.js +1 -0
- package/es/Card/index.d.ts +10 -0
- package/es/Card/index.js +10 -0
- package/es/Checkbox/Checkbox.css +45 -0
- package/es/Checkbox/Checkbox.d.ts +5 -0
- package/es/Checkbox/Checkbox.js +108 -0
- package/es/Checkbox/Checkbox.types.d.ts +84 -0
- package/es/Checkbox/Checkbox.types.js +1 -0
- package/es/Checkbox/CheckboxContext.d.ts +5 -0
- package/es/Checkbox/CheckboxContext.js +4 -0
- package/es/Checkbox/CheckboxGroup.d.ts +5 -0
- package/es/Checkbox/CheckboxGroup.js +64 -0
- package/es/Checkbox/index.d.ts +3 -0
- package/es/Checkbox/index.js +3 -0
- package/es/Countdown/Countdown.css +28 -0
- package/es/Countdown/Countdown.d.ts +5 -0
- package/es/Countdown/Countdown.js +109 -0
- package/es/Countdown/Countdown.types.d.ts +123 -0
- package/es/Countdown/Countdown.types.js +1 -0
- package/es/Countdown/index.d.ts +3 -0
- package/es/Countdown/index.js +3 -0
- package/es/Countdown/useCountdown.d.ts +10 -0
- package/es/Countdown/useCountdown.js +55 -0
- package/es/Countdown/utils.d.ts +9 -0
- package/es/Countdown/utils.js +126 -0
- package/es/Divider/Divider.css +41 -0
- package/es/Divider/Divider.d.ts +5 -0
- package/es/Divider/Divider.js +52 -0
- package/es/Divider/Divider.types.d.ts +19 -0
- package/es/Divider/Divider.types.js +1 -0
- package/es/Divider/index.d.ts +2 -0
- package/es/Divider/index.js +2 -0
- package/es/Drawer/Drawer.css +35 -0
- package/es/Drawer/Drawer.d.ts +5 -0
- package/es/Drawer/Drawer.js +71 -0
- package/es/Drawer/Drawer.types.d.ts +51 -0
- package/es/Drawer/Drawer.types.js +1 -0
- package/es/Drawer/index.d.ts +2 -0
- package/es/Drawer/index.js +2 -0
- package/es/Fade/Fade.d.ts +4 -0
- package/es/Fade/Fade.js +70 -0
- package/es/Fade/Fade.types.d.ts +9 -0
- package/es/Fade/Fade.types.js +1 -0
- package/es/Fade/index.d.ts +3 -0
- package/es/Fade/index.js +3 -0
- package/es/IconButton/IconButton.css +130 -0
- package/es/IconButton/IconButton.d.ts +5 -0
- package/es/IconButton/IconButton.js +45 -0
- package/es/IconButton/IconButton.types.d.ts +41 -0
- package/es/IconButton/IconButton.types.js +1 -0
- package/es/IconButton/index.d.ts +2 -0
- package/es/IconButton/index.js +2 -0
- package/es/Image/Image.d.ts +5 -0
- package/es/Image/Image.js +131 -0
- package/es/Image/Image.types.d.ts +48 -0
- package/es/Image/Image.types.js +1 -0
- package/es/Image/index.css +35 -0
- package/es/Image/index.d.ts +3 -0
- package/es/Image/index.js +3 -0
- package/es/Input/Input.css +59 -0
- package/es/Input/Input.d.ts +5 -0
- package/es/Input/Input.js +125 -0
- package/es/Input/Input.types.d.ts +70 -0
- package/es/Input/Input.types.js +1 -0
- package/es/Input/index.d.ts +2 -0
- package/es/Input/index.js +2 -0
- package/es/List/List.css +9 -0
- package/es/List/List.d.ts +5 -0
- package/es/List/List.js +37 -0
- package/es/List/List.types.d.ts +22 -0
- package/es/List/List.types.js +1 -0
- package/es/List/ListContext.d.ts +7 -0
- package/es/List/ListContext.js +5 -0
- package/es/List/ListItem.css +23 -0
- package/es/List/ListItem.d.ts +5 -0
- package/es/List/ListItem.js +52 -0
- package/es/List/ListItem.types.d.ts +20 -0
- package/es/List/ListItem.types.js +1 -0
- package/es/List/ListItemContent.css +18 -0
- package/es/List/ListItemContent.d.ts +5 -0
- package/es/List/ListItemContent.js +31 -0
- package/es/List/ListItemContent.types.d.ts +16 -0
- package/es/List/ListItemContent.types.js +1 -0
- package/es/List/ListItemExtra.css +7 -0
- package/es/List/ListItemExtra.d.ts +5 -0
- package/es/List/ListItemExtra.js +23 -0
- package/es/List/ListItemExtra.types.d.ts +8 -0
- package/es/List/ListItemExtra.types.js +1 -0
- package/es/List/ListItemFooter.css +9 -0
- package/es/List/ListItemFooter.d.ts +5 -0
- package/es/List/ListItemFooter.js +23 -0
- package/es/List/ListItemFooter.types.d.ts +8 -0
- package/es/List/ListItemFooter.types.js +1 -0
- package/es/List/ListItemHeader.css +7 -0
- package/es/List/ListItemHeader.d.ts +5 -0
- package/es/List/ListItemHeader.js +23 -0
- package/es/List/ListItemHeader.types.d.ts +8 -0
- package/es/List/ListItemHeader.types.js +1 -0
- package/es/List/index.d.ts +13 -0
- package/es/List/index.js +13 -0
- package/es/Loading/Loading.css +31 -0
- package/es/Loading/Loading.d.ts +5 -0
- package/es/Loading/Loading.js +33 -0
- package/es/Loading/Loading.types.d.ts +20 -0
- package/es/Loading/Loading.types.js +1 -0
- package/es/Loading/index.d.ts +2 -0
- package/es/Loading/index.js +2 -0
- package/es/Modal/Modal.css +15 -0
- package/es/Modal/Modal.d.ts +5 -0
- package/es/Modal/Modal.js +95 -0
- package/es/Modal/Modal.types.d.ts +20 -0
- package/es/Modal/Modal.types.js +1 -0
- package/es/Modal/index.d.ts +3 -0
- package/es/Modal/index.js +3 -0
- package/es/NavBar/NavBar.css +57 -0
- package/es/NavBar/NavBar.d.ts +5 -0
- package/es/NavBar/NavBar.js +82 -0
- package/es/NavBar/NavBar.types.d.ts +44 -0
- package/es/NavBar/NavBar.types.js +1 -0
- package/es/NavBar/index.d.ts +2 -0
- package/es/NavBar/index.js +2 -0
- package/es/Portal/Portal.d.ts +4 -0
- package/es/Portal/Portal.js +11 -0
- package/es/Portal/Portal.miniapp.d.ts +4 -0
- package/es/Portal/Portal.miniapp.js +33 -0
- package/es/Portal/Portal.types.d.ts +22 -0
- package/es/Portal/Portal.types.js +1 -0
- package/es/Portal/PortalCore.d.ts +8 -0
- package/es/Portal/PortalCore.js +57 -0
- package/es/Portal/index.d.ts +3 -0
- package/es/Portal/index.js +3 -0
- package/es/Progress/Progress.css +22 -0
- package/es/Progress/Progress.d.ts +8 -0
- package/es/Progress/Progress.js +90 -0
- package/es/Progress/Progress.types.d.ts +28 -0
- package/es/Progress/Progress.types.js +1 -0
- package/es/Progress/index.d.ts +3 -0
- package/es/Progress/index.js +3 -0
- package/es/Radio/Radio.css +65 -0
- package/es/Radio/Radio.d.ts +5 -0
- package/es/Radio/Radio.js +126 -0
- package/es/Radio/Radio.types.d.ts +83 -0
- package/es/Radio/Radio.types.js +1 -0
- package/es/Radio/RadioButtonIcon.d.ts +12 -0
- package/es/Radio/RadioButtonIcon.js +33 -0
- package/es/Radio/RadioContext.d.ts +5 -0
- package/es/Radio/RadioContext.js +4 -0
- package/es/Radio/RadioGroup.d.ts +5 -0
- package/es/Radio/RadioGroup.js +52 -0
- package/es/Radio/index.d.ts +3 -0
- package/es/Radio/index.js +3 -0
- package/es/Rating/Rating.css +52 -0
- package/es/Rating/Rating.d.ts +5 -0
- package/es/Rating/Rating.js +107 -0
- package/es/Rating/Rating.types.d.ts +66 -0
- package/es/Rating/Rating.types.js +1 -0
- package/es/Rating/index.d.ts +2 -0
- package/es/Rating/index.js +2 -0
- package/es/ScrollView/ScrollView.css +19 -0
- package/es/ScrollView/ScrollView.d.ts +5 -0
- package/es/ScrollView/ScrollView.js +204 -0
- package/es/ScrollView/ScrollView.types.d.ts +258 -0
- package/es/ScrollView/ScrollView.types.js +1 -0
- package/es/ScrollView/index.d.ts +3 -0
- package/es/ScrollView/index.js +3 -0
- package/es/ScrollView/index.miniapp.d.ts +3 -0
- package/es/ScrollView/index.miniapp.js +3 -0
- package/es/Select/Select.css +89 -0
- package/es/Select/Select.d.ts +5 -0
- package/es/Select/Select.js +165 -0
- package/es/Select/Select.types.d.ts +98 -0
- package/es/Select/Select.types.js +1 -0
- package/es/Select/SelectOption.d.ts +5 -0
- package/es/Select/SelectOption.js +43 -0
- package/es/Select/index.d.ts +4 -0
- package/es/Select/index.js +4 -0
- package/es/Select/selectContext.d.ts +4 -0
- package/es/Select/selectContext.js +5 -0
- package/es/Skeleton/Skeleton.css +54 -0
- package/es/Skeleton/Skeleton.d.ts +5 -0
- package/es/Skeleton/Skeleton.js +38 -0
- package/es/Skeleton/Skeleton.types.d.ts +33 -0
- package/es/Skeleton/Skeleton.types.js +1 -0
- package/es/Skeleton/index.d.ts +3 -0
- package/es/Skeleton/index.js +3 -0
- package/es/Slide/Slide.d.ts +4 -0
- package/es/Slide/Slide.js +85 -0
- package/es/Slide/Slide.types.d.ts +14 -0
- package/es/Slide/Slide.types.js +1 -0
- package/es/Slide/index.d.ts +3 -0
- package/es/Slide/index.js +3 -0
- package/es/Slider/Slider.css +95 -0
- package/es/Slider/Slider.d.ts +5 -0
- package/es/Slider/Slider.js +318 -0
- package/es/Slider/Slider.types.d.ts +62 -0
- package/es/Slider/Slider.types.js +1 -0
- package/es/Slider/index.d.ts +2 -0
- package/es/Slider/index.js +2 -0
- package/es/Slider/utils.d.ts +14 -0
- package/es/Slider/utils.js +25 -0
- package/es/Stack/Stack.css +11 -0
- package/es/Stack/Stack.d.ts +5 -0
- package/es/Stack/Stack.js +50 -0
- package/es/Stack/Stack.types.d.ts +35 -0
- package/es/Stack/Stack.types.js +1 -0
- package/es/Stack/demo/StackDemo.d.ts +4 -0
- package/es/Stack/demo/StackDemo.js +128 -0
- package/es/Stack/demo/index.css +23 -0
- package/es/Stack/index.d.ts +3 -0
- package/es/Stack/index.js +3 -0
- package/es/Steps/Step.css +174 -0
- package/es/Steps/Step.d.ts +5 -0
- package/es/Steps/Step.js +88 -0
- package/es/Steps/Step.types.d.ts +35 -0
- package/es/Steps/Step.types.js +1 -0
- package/es/Steps/Steps.css +14 -0
- package/es/Steps/Steps.d.ts +5 -0
- package/es/Steps/Steps.js +60 -0
- package/es/Steps/Steps.types.d.ts +35 -0
- package/es/Steps/Steps.types.js +1 -0
- package/es/Steps/StepsContext.d.ts +5 -0
- package/es/Steps/StepsContext.js +4 -0
- package/es/Steps/index.d.ts +4 -0
- package/es/Steps/index.js +4 -0
- package/es/Swiper/Swiper.css +20 -0
- package/es/Swiper/Swiper.d.ts +10 -0
- package/es/Swiper/Swiper.js +112 -0
- package/es/Swiper/Swiper.types.d.ts +173 -0
- package/es/Swiper/Swiper.types.js +1 -0
- package/es/Swiper/SwiperItem.d.ts +7 -0
- package/es/Swiper/SwiperItem.js +24 -0
- package/es/Swiper/index.d.ts +3 -0
- package/es/Swiper/index.js +3 -0
- package/es/Swiper/index.miniapp.d.ts +8 -0
- package/es/Swiper/index.miniapp.js +6 -0
- package/es/Switch/Switch.css +127 -0
- package/es/Switch/Switch.d.ts +5 -0
- package/es/Switch/Switch.js +76 -0
- package/es/Switch/Switch.types.d.ts +56 -0
- package/es/Switch/Switch.types.js +1 -0
- package/es/Switch/index.d.ts +3 -0
- package/es/Switch/index.js +3 -0
- package/es/TabBar/TabBar.css +8 -0
- package/es/TabBar/TabBar.d.ts +5 -0
- package/es/TabBar/TabBar.js +42 -0
- package/es/TabBar/TabBarContext.d.ts +27 -0
- package/es/TabBar/TabBarContext.js +3 -0
- package/es/TabBar/TabBarItem.css +38 -0
- package/es/TabBar/TabBarItem.d.ts +5 -0
- package/es/TabBar/TabBarItem.js +54 -0
- package/es/TabBar/index.d.ts +4 -0
- package/es/TabBar/index.js +4 -0
- package/es/TabBar/index.types.d.ts +54 -0
- package/es/TabBar/index.types.js +1 -0
- package/es/Tabs/Tab.css +52 -0
- package/es/Tabs/Tab.d.ts +5 -0
- package/es/Tabs/Tab.js +50 -0
- package/es/Tabs/Tab.types.d.ts +12 -0
- package/es/Tabs/Tab.types.js +1 -0
- package/es/Tabs/TabPanel.css +9 -0
- package/es/Tabs/TabPanel.d.ts +5 -0
- package/es/Tabs/TabPanel.js +30 -0
- package/es/Tabs/TabPanel.types.d.ts +19 -0
- package/es/Tabs/TabPanel.types.js +1 -0
- package/es/Tabs/Tabs.css +56 -0
- package/es/Tabs/Tabs.d.ts +5 -0
- package/es/Tabs/Tabs.js +210 -0
- package/es/Tabs/Tabs.types.d.ts +45 -0
- package/es/Tabs/Tabs.types.js +1 -0
- package/es/Tabs/TabsContext.d.ts +9 -0
- package/es/Tabs/TabsContext.js +7 -0
- package/es/Tabs/index.d.ts +6 -0
- package/es/Tabs/index.js +6 -0
- package/es/Tabs/utils/bound.d.ts +1 -0
- package/es/Tabs/utils/bound.js +10 -0
- package/es/Tag/Tag.css +97 -0
- package/es/Tag/Tag.d.ts +5 -0
- package/es/Tag/Tag.js +76 -0
- package/es/Tag/Tag.types.d.ts +23 -0
- package/es/Tag/Tag.types.js +1 -0
- package/es/Tag/TagGroup.css +16 -0
- package/es/Tag/TagGroup.d.ts +5 -0
- package/es/Tag/TagGroup.js +21 -0
- package/es/Tag/TagGroup.types.d.ts +6 -0
- package/es/Tag/TagGroup.types.js +1 -0
- package/es/Tag/index.d.ts +5 -0
- package/es/Tag/index.js +5 -0
- package/es/TextArea/TextArea.css +43 -0
- package/es/TextArea/TextArea.d.ts +5 -0
- package/es/TextArea/TextArea.js +150 -0
- package/es/TextArea/TextArea.types.d.ts +70 -0
- package/es/TextArea/TextArea.types.js +1 -0
- package/es/TextArea/index.d.ts +2 -0
- package/es/TextArea/index.js +2 -0
- package/es/Transition/Transition.d.ts +4 -0
- package/es/Transition/Transition.js +12 -0
- package/es/Transition/Transition.miniapp.d.ts +4 -0
- package/es/Transition/Transition.miniapp.js +12 -0
- package/es/Transition/Transition.types.d.ts +100 -0
- package/es/Transition/Transition.types.js +1 -0
- package/es/Transition/TransitionCore.d.ts +4 -0
- package/es/Transition/TransitionCore.js +289 -0
- package/es/Transition/index.d.ts +3 -0
- package/es/Transition/index.js +3 -0
- package/es/index.d.ts +38 -0
- package/es/index.js +38 -0
- package/package.json +50 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _utils = require("@bifrostui/utils");
|
|
10
|
+
var _useCountdown = _interopRequireDefault(require("./useCountdown"));
|
|
11
|
+
var _utils2 = require("./utils");
|
|
12
|
+
require("./Countdown.css");
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
|
+
const prefixCls = 'bui-countdown';
|
|
18
|
+
const Countdown = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
19
|
+
const {
|
|
20
|
+
className,
|
|
21
|
+
serverTimestamp,
|
|
22
|
+
endTimestamp,
|
|
23
|
+
remainingTime,
|
|
24
|
+
format,
|
|
25
|
+
unitStyle,
|
|
26
|
+
valueStyle,
|
|
27
|
+
timeSliceStyle,
|
|
28
|
+
renderContent,
|
|
29
|
+
onChange,
|
|
30
|
+
onFinish,
|
|
31
|
+
...others
|
|
32
|
+
} = props;
|
|
33
|
+
|
|
34
|
+
// 开始时间戳
|
|
35
|
+
const [startTime, setStartTime] = (0, _react.useState)(() => serverTimestamp ?? Date.now());
|
|
36
|
+
// 结束时间戳
|
|
37
|
+
const [endTime, setEndTime] = (0, _react.useState)(() => endTimestamp ?? startTime + +remainingTime);
|
|
38
|
+
const {
|
|
39
|
+
time,
|
|
40
|
+
isEnd
|
|
41
|
+
} = (0, _useCountdown.default)({
|
|
42
|
+
startTime,
|
|
43
|
+
endTime,
|
|
44
|
+
onChange
|
|
45
|
+
});
|
|
46
|
+
(0, _react.useEffect)(() => {
|
|
47
|
+
if (isEnd) {
|
|
48
|
+
onFinish?.();
|
|
49
|
+
}
|
|
50
|
+
}, [isEnd]);
|
|
51
|
+
(0, _utils.useDidMountEffect)(() => {
|
|
52
|
+
if (remainingTime !== undefined) {
|
|
53
|
+
const start = Date.now();
|
|
54
|
+
setStartTime(start);
|
|
55
|
+
setEndTime(start + +remainingTime);
|
|
56
|
+
}
|
|
57
|
+
}, [remainingTime]);
|
|
58
|
+
(0, _react.useEffect)(() => {
|
|
59
|
+
if (serverTimestamp && endTimestamp) {
|
|
60
|
+
setStartTime(serverTimestamp);
|
|
61
|
+
setEndTime(endTimestamp);
|
|
62
|
+
}
|
|
63
|
+
}, [serverTimestamp, endTimestamp]);
|
|
64
|
+
const defaultRender = timeIns => {
|
|
65
|
+
const {
|
|
66
|
+
timeList
|
|
67
|
+
} = (0, _utils2.formatCountdown)(timeIns.total, format);
|
|
68
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, timeList.map((item, index) => {
|
|
69
|
+
const {
|
|
70
|
+
unitText,
|
|
71
|
+
valStr
|
|
72
|
+
} = item;
|
|
73
|
+
const valueList = valStr.split('');
|
|
74
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
75
|
+
key: `slice-${index}`,
|
|
76
|
+
className: (0, _clsx.default)(`${prefixCls}-slice`),
|
|
77
|
+
style: timeSliceStyle
|
|
78
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
79
|
+
className: (0, _clsx.default)(`${prefixCls}-slice-item`)
|
|
80
|
+
}, valueList.map((val, i) => /*#__PURE__*/_react.default.createElement("span", {
|
|
81
|
+
key: `slice-value-${i}`,
|
|
82
|
+
className: (0, _clsx.default)(`${prefixCls}-slice-value`),
|
|
83
|
+
style: valueStyle[i]
|
|
84
|
+
}, val))), unitText && /*#__PURE__*/_react.default.createElement("span", {
|
|
85
|
+
className: (0, _clsx.default)(`${prefixCls}-slice-unit`),
|
|
86
|
+
style: unitStyle
|
|
87
|
+
}, unitText));
|
|
88
|
+
}));
|
|
89
|
+
};
|
|
90
|
+
return /*#__PURE__*/_react.default.createElement("div", _extends({
|
|
91
|
+
ref: ref,
|
|
92
|
+
className: (0, _clsx.default)(prefixCls, className)
|
|
93
|
+
}, others), renderContent ? renderContent(time) : defaultRender(time));
|
|
94
|
+
});
|
|
95
|
+
Countdown.displayName = 'BuiCountdown';
|
|
96
|
+
Countdown.defaultProps = {
|
|
97
|
+
format: 'HH:mm:ss',
|
|
98
|
+
remainingTime: 0,
|
|
99
|
+
unitStyle: {},
|
|
100
|
+
valueStyle: [{}, {}],
|
|
101
|
+
timeSliceStyle: {}
|
|
102
|
+
};
|
|
103
|
+
var _default = exports.default = Countdown;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { OverrideProps } from '@bifrostui/types';
|
|
2
|
+
import React, { CSSProperties } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* 当前时间
|
|
5
|
+
*/
|
|
6
|
+
export type CurrentTime = {
|
|
7
|
+
/**
|
|
8
|
+
* 剩余总时间,单位毫秒
|
|
9
|
+
*/
|
|
10
|
+
total: number;
|
|
11
|
+
/**
|
|
12
|
+
* 剩余年数
|
|
13
|
+
*/
|
|
14
|
+
years: string;
|
|
15
|
+
/**
|
|
16
|
+
* 剩余月数
|
|
17
|
+
*/
|
|
18
|
+
months: string;
|
|
19
|
+
/**
|
|
20
|
+
* 剩余天数
|
|
21
|
+
*/
|
|
22
|
+
days: string;
|
|
23
|
+
/**
|
|
24
|
+
* 剩余小时
|
|
25
|
+
*/
|
|
26
|
+
hours: string;
|
|
27
|
+
/**
|
|
28
|
+
* 剩余分钟
|
|
29
|
+
*/
|
|
30
|
+
minutes: string;
|
|
31
|
+
/**
|
|
32
|
+
* 剩余秒数
|
|
33
|
+
*/
|
|
34
|
+
seconds: string;
|
|
35
|
+
/**
|
|
36
|
+
* 剩余整数天余下的小时
|
|
37
|
+
*/
|
|
38
|
+
hoursWithDays: string;
|
|
39
|
+
};
|
|
40
|
+
export type CountdownProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
|
|
41
|
+
props: P & {
|
|
42
|
+
/**
|
|
43
|
+
* 倒计时剩余时间,是一个时间段(单位毫秒),与endTimestamp互斥
|
|
44
|
+
* @default 0
|
|
45
|
+
*/
|
|
46
|
+
remainingTime?: number;
|
|
47
|
+
/**
|
|
48
|
+
* 倒计时结束时间戳,是一个时间点,与remainingTime互斥,优先级比remainingTime高
|
|
49
|
+
*/
|
|
50
|
+
endTimestamp?: number;
|
|
51
|
+
/**
|
|
52
|
+
* 服务器时间戳,是一个时间点,可与endTimestamp配合使用
|
|
53
|
+
*/
|
|
54
|
+
serverTimestamp?: number;
|
|
55
|
+
/**
|
|
56
|
+
* 格式化倒计时展示,参考 dayjs
|
|
57
|
+
* @default HH:mm:ss
|
|
58
|
+
*/
|
|
59
|
+
format?: string;
|
|
60
|
+
/**
|
|
61
|
+
* 时间单位的样式
|
|
62
|
+
*/
|
|
63
|
+
unitStyle?: CSSProperties;
|
|
64
|
+
/**
|
|
65
|
+
* 倒计时位数的样式,用于定制第一、第二位数字的样式
|
|
66
|
+
*/
|
|
67
|
+
valueStyle?: CSSProperties[];
|
|
68
|
+
/**
|
|
69
|
+
* 各时间区块的样式,用于定制各个时间块的样式,若第一、第二位数字的样式相同,则可替代valueStyle
|
|
70
|
+
*/
|
|
71
|
+
timeSliceStyle?: CSSProperties;
|
|
72
|
+
/**
|
|
73
|
+
* 倒计时完成时触发
|
|
74
|
+
*/
|
|
75
|
+
onFinish?: () => void;
|
|
76
|
+
/**
|
|
77
|
+
* 倒计时时间变化时触发
|
|
78
|
+
*/
|
|
79
|
+
onChange?: (data: {
|
|
80
|
+
value: number;
|
|
81
|
+
}) => void;
|
|
82
|
+
/**
|
|
83
|
+
* 自定义render内容
|
|
84
|
+
*/
|
|
85
|
+
renderContent?: (data: CurrentTime) => React.ReactNode;
|
|
86
|
+
};
|
|
87
|
+
defaultComponent: D;
|
|
88
|
+
}, D>;
|
|
89
|
+
/**
|
|
90
|
+
* 倒计时格式化后分割项
|
|
91
|
+
*/
|
|
92
|
+
interface CountdownItem {
|
|
93
|
+
/**
|
|
94
|
+
* 倒计时切片字符串
|
|
95
|
+
*/
|
|
96
|
+
valStr: string;
|
|
97
|
+
/**
|
|
98
|
+
* 倒计时切片数值
|
|
99
|
+
*/
|
|
100
|
+
value: number;
|
|
101
|
+
/**
|
|
102
|
+
* 倒计时切片是否为零
|
|
103
|
+
*/
|
|
104
|
+
isZero: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* 倒计时切片单位
|
|
107
|
+
*/
|
|
108
|
+
unitText: string;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* 格式化倒计时
|
|
112
|
+
*/
|
|
113
|
+
export type FormatedCountdown = {
|
|
114
|
+
/**
|
|
115
|
+
* 剩余总时间
|
|
116
|
+
*/
|
|
117
|
+
timeStr: string;
|
|
118
|
+
/**
|
|
119
|
+
* 倒计时切片数组
|
|
120
|
+
*/
|
|
121
|
+
timeList: CountdownItem[];
|
|
122
|
+
};
|
|
123
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
Countdown: true
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "Countdown", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return _Countdown.default;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(exports, "default", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () {
|
|
18
|
+
return _Countdown.default;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
var _Countdown = _interopRequireDefault(require("./Countdown"));
|
|
22
|
+
var _Countdown2 = require("./Countdown.types");
|
|
23
|
+
Object.keys(_Countdown2).forEach(function (key) {
|
|
24
|
+
if (key === "default" || key === "__esModule") return;
|
|
25
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
26
|
+
if (key in exports && exports[key] === _Countdown2[key]) return;
|
|
27
|
+
Object.defineProperty(exports, key, {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function () {
|
|
30
|
+
return _Countdown2[key];
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
var _utils = require("./utils");
|
|
35
|
+
Object.keys(_utils).forEach(function (key) {
|
|
36
|
+
if (key === "default" || key === "__esModule") return;
|
|
37
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
38
|
+
if (key in exports && exports[key] === _utils[key]) return;
|
|
39
|
+
Object.defineProperty(exports, key, {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function () {
|
|
42
|
+
return _utils[key];
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CurrentTime } from './Countdown.types';
|
|
2
|
+
declare const _default: ({ startTime: startTimestamp, endTime: endTimestamp, onChange, }: {
|
|
3
|
+
startTime: any;
|
|
4
|
+
endTime: any;
|
|
5
|
+
onChange: any;
|
|
6
|
+
}) => {
|
|
7
|
+
time: CurrentTime;
|
|
8
|
+
isEnd: boolean;
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _utils = require("./utils");
|
|
9
|
+
const REFRESH_INTERVAL = 50;
|
|
10
|
+
var _default = ({
|
|
11
|
+
startTime: startTimestamp,
|
|
12
|
+
endTime: endTimestamp,
|
|
13
|
+
onChange
|
|
14
|
+
}) => {
|
|
15
|
+
// 初始化时间差
|
|
16
|
+
const initOffsetTime = (0, _react.useMemo)(() => startTimestamp - new Date().getTime(), [startTimestamp, endTimestamp]);
|
|
17
|
+
const [time, setTime] = (0, _react.useState)((0, _utils.parseTime)(endTimestamp, initOffsetTime));
|
|
18
|
+
const [isEnd, setIsEnd] = (0, _react.useState)(false);
|
|
19
|
+
(0, _react.useEffect)(() => {
|
|
20
|
+
setIsEnd(false);
|
|
21
|
+
if (startTimestamp === 0 || endTimestamp === 0 || endTimestamp <= startTimestamp) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// 重新计算时间差
|
|
26
|
+
const offsetTime = startTimestamp - new Date().getTime();
|
|
27
|
+
const timer = setInterval(() => {
|
|
28
|
+
const currentTime = (0, _utils.parseTime)(endTimestamp, offsetTime);
|
|
29
|
+
setTime(currentTime);
|
|
30
|
+
onChange?.({
|
|
31
|
+
value: currentTime
|
|
32
|
+
});
|
|
33
|
+
if (currentTime.total <= 0 || !endTimestamp) {
|
|
34
|
+
setIsEnd(true);
|
|
35
|
+
clearInterval(timer);
|
|
36
|
+
}
|
|
37
|
+
}, REFRESH_INTERVAL);
|
|
38
|
+
|
|
39
|
+
// eslint-disable-next-line consistent-return
|
|
40
|
+
return () => clearInterval(timer);
|
|
41
|
+
}, [startTimestamp, endTimestamp]);
|
|
42
|
+
return {
|
|
43
|
+
time,
|
|
44
|
+
isEnd
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
exports.default = _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CurrentTime, FormatedCountdown } from './Countdown.types';
|
|
2
|
+
/**
|
|
3
|
+
* 解析时间,将结束时间戳拆分为剩余时间对象
|
|
4
|
+
*/
|
|
5
|
+
export declare const parseTime: (endTime: number, offsetTime: number) => CurrentTime;
|
|
6
|
+
/**
|
|
7
|
+
* 格式化倒计时,将剩余时间格式化为指定格式,并拆分位各个时间模块
|
|
8
|
+
*/
|
|
9
|
+
export declare const formatCountdown: (duration: number, format: string) => FormatedCountdown;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.parseTime = exports.formatCountdown = void 0;
|
|
7
|
+
const SECOND = 1000;
|
|
8
|
+
const MINUTE = 60 * SECOND;
|
|
9
|
+
const HOUR = 60 * MINUTE;
|
|
10
|
+
const DAY = 24 * HOUR;
|
|
11
|
+
const MONTH = 30 * DAY;
|
|
12
|
+
const YEAR = 365 * DAY;
|
|
13
|
+
const timeUnits = [['Y', YEAR],
|
|
14
|
+
// years
|
|
15
|
+
['M', MONTH],
|
|
16
|
+
// months
|
|
17
|
+
['D', DAY],
|
|
18
|
+
// days
|
|
19
|
+
['H', HOUR],
|
|
20
|
+
// hours
|
|
21
|
+
['m', MINUTE],
|
|
22
|
+
// minutes
|
|
23
|
+
['s', SECOND],
|
|
24
|
+
// seconds
|
|
25
|
+
['S', 1] // million seconds
|
|
26
|
+
];
|
|
27
|
+
const preAppend = num => {
|
|
28
|
+
if (num < 0) return '00';
|
|
29
|
+
return num < 10 ? `0${num}` : `${num}`;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 解析时间,将结束时间戳拆分为剩余时间对象
|
|
34
|
+
*/
|
|
35
|
+
const parseTime = (endTime, offsetTime) => {
|
|
36
|
+
const now = new Date().getTime();
|
|
37
|
+
let total = endTime - now - offsetTime || 0;
|
|
38
|
+
total = total < 0 ? 0 : total;
|
|
39
|
+
const years = Math.floor(total / YEAR);
|
|
40
|
+
const months = Math.floor(total / MONTH);
|
|
41
|
+
const days = Math.floor(total / DAY);
|
|
42
|
+
const hours = Math.floor(total % DAY / HOUR);
|
|
43
|
+
const minutes = Math.floor(total % HOUR / MINUTE);
|
|
44
|
+
const seconds = Math.floor(total % MINUTE / SECOND);
|
|
45
|
+
const hoursWithDays = Math.floor(total / HOUR) % 24;
|
|
46
|
+
return {
|
|
47
|
+
total,
|
|
48
|
+
years: preAppend(years),
|
|
49
|
+
months: preAppend(months),
|
|
50
|
+
days: preAppend(days),
|
|
51
|
+
hours: preAppend(hours),
|
|
52
|
+
minutes: preAppend(minutes),
|
|
53
|
+
seconds: preAppend(seconds),
|
|
54
|
+
hoursWithDays: preAppend(hoursWithDays)
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* 格式化倒计时,将剩余时间格式化为指定格式,并拆分位各个时间模块
|
|
60
|
+
*/
|
|
61
|
+
exports.parseTime = parseTime;
|
|
62
|
+
const formatCountdown = (duration, format) => {
|
|
63
|
+
let timeList = [];
|
|
64
|
+
let leftDuration = duration;
|
|
65
|
+
const escapeRegex = /\[[^\]]*]/g;
|
|
66
|
+
const keepList = (format.match(escapeRegex) || []).map(str => str.slice(1, -1));
|
|
67
|
+
const templateText = format.replace(escapeRegex, '[]');
|
|
68
|
+
const replacedText = timeUnits.reduce(({
|
|
69
|
+
currentTemplate,
|
|
70
|
+
valStr,
|
|
71
|
+
value,
|
|
72
|
+
isZero
|
|
73
|
+
}, [name, unit]) => {
|
|
74
|
+
if (currentTemplate.includes(name)) {
|
|
75
|
+
const val = Math.floor(leftDuration / unit);
|
|
76
|
+
isZero = val <= 0;
|
|
77
|
+
leftDuration -= val * unit;
|
|
78
|
+
let vStr = '';
|
|
79
|
+
currentTemplate = currentTemplate.replace(new RegExp(`${name}+`, 'g'), match => {
|
|
80
|
+
const len = match.length;
|
|
81
|
+
vStr = val.toString().padStart(len, '0').slice(0, len);
|
|
82
|
+
return vStr;
|
|
83
|
+
});
|
|
84
|
+
timeList.push({
|
|
85
|
+
valStr: vStr,
|
|
86
|
+
value: val,
|
|
87
|
+
isZero
|
|
88
|
+
});
|
|
89
|
+
return {
|
|
90
|
+
currentTemplate,
|
|
91
|
+
valStr: vStr,
|
|
92
|
+
value: val,
|
|
93
|
+
isZero
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
currentTemplate,
|
|
98
|
+
valStr,
|
|
99
|
+
isZero,
|
|
100
|
+
value
|
|
101
|
+
};
|
|
102
|
+
}, {
|
|
103
|
+
currentTemplate: templateText,
|
|
104
|
+
valStr: '',
|
|
105
|
+
value: 0,
|
|
106
|
+
isZero: false
|
|
107
|
+
});
|
|
108
|
+
let index = 0;
|
|
109
|
+
const timeStr = replacedText.currentTemplate.replace(escapeRegex, () => {
|
|
110
|
+
const match = keepList[index];
|
|
111
|
+
index += 1;
|
|
112
|
+
return match;
|
|
113
|
+
});
|
|
114
|
+
const unitList = timeStr.match(/\D+/g);
|
|
115
|
+
timeList = timeList.map((item, i) => {
|
|
116
|
+
item.unitText = unitList[i];
|
|
117
|
+
return item;
|
|
118
|
+
});
|
|
119
|
+
return {
|
|
120
|
+
timeStr,
|
|
121
|
+
timeList
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
exports.formatCountdown = formatCountdown;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
.bui-divider {
|
|
2
|
+
--height: var(--bui-divider-height, 100%);
|
|
3
|
+
--width: var(--bui-divider-width, 100%);
|
|
4
|
+
border-color: var(--bui-color-border-default);
|
|
5
|
+
font-family: var(--bui-font-family);
|
|
6
|
+
}
|
|
7
|
+
.bui-divider-vertical {
|
|
8
|
+
height: var(--height);
|
|
9
|
+
display: inline-block;
|
|
10
|
+
border-right-width: 1px;
|
|
11
|
+
border-right-style: solid;
|
|
12
|
+
}
|
|
13
|
+
.bui-divider-horizontal {
|
|
14
|
+
width: var(--width);
|
|
15
|
+
border-bottom-width: 1px;
|
|
16
|
+
border-bottom-style: solid;
|
|
17
|
+
}
|
|
18
|
+
.bui-divider-vertical-dashed {
|
|
19
|
+
border-right-style: dashed;
|
|
20
|
+
}
|
|
21
|
+
.bui-divider-horizontal-dashed {
|
|
22
|
+
border-bottom-style: dashed;
|
|
23
|
+
}
|
|
24
|
+
.bui-divider-content {
|
|
25
|
+
width: 100%;
|
|
26
|
+
border-width: 0;
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
}
|
|
31
|
+
.bui-divider-line {
|
|
32
|
+
width: 40px;
|
|
33
|
+
border-bottom-width: 1px;
|
|
34
|
+
border-bottom-style: solid;
|
|
35
|
+
border-color: var(--bui-color-border-default);
|
|
36
|
+
}
|
|
37
|
+
.bui-divider-text {
|
|
38
|
+
flex-shrink: 0;
|
|
39
|
+
color: var(--bui-color-fg-subtle);
|
|
40
|
+
font-size: var(--bui-text-size-2);
|
|
41
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
require("./Divider.css");
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
const prefixCls = 'bui-divider';
|
|
14
|
+
const Divider = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
15
|
+
const {
|
|
16
|
+
className,
|
|
17
|
+
style,
|
|
18
|
+
direction,
|
|
19
|
+
dashed,
|
|
20
|
+
size,
|
|
21
|
+
children
|
|
22
|
+
} = props;
|
|
23
|
+
const isVertical = direction === 'vertical';
|
|
24
|
+
const hasChildren = !!_react.default.Children.toArray(children).length;
|
|
25
|
+
let propsStyle = {};
|
|
26
|
+
let contentStyle = {};
|
|
27
|
+
if (hasChildren) {
|
|
28
|
+
contentStyle = {
|
|
29
|
+
width: size
|
|
30
|
+
};
|
|
31
|
+
} else if (size) {
|
|
32
|
+
propsStyle = isVertical ? {
|
|
33
|
+
height: size
|
|
34
|
+
} : {
|
|
35
|
+
width: size
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
39
|
+
ref: ref,
|
|
40
|
+
className: (0, _clsx.default)(className, prefixCls, {
|
|
41
|
+
[`${prefixCls}-${direction}`]: direction,
|
|
42
|
+
[`${prefixCls}-content`]: !isVertical && hasChildren,
|
|
43
|
+
[`${prefixCls}-${direction}-dashed`]: dashed
|
|
44
|
+
}),
|
|
45
|
+
style: {
|
|
46
|
+
...propsStyle,
|
|
47
|
+
...style
|
|
48
|
+
}
|
|
49
|
+
}, !isVertical && hasChildren && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
50
|
+
style: contentStyle,
|
|
51
|
+
className: `${prefixCls}-line`
|
|
52
|
+
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
53
|
+
className: `${prefixCls}-text`
|
|
54
|
+
}, children), /*#__PURE__*/_react.default.createElement("span", {
|
|
55
|
+
style: contentStyle,
|
|
56
|
+
className: `${prefixCls}-line`
|
|
57
|
+
})));
|
|
58
|
+
});
|
|
59
|
+
Divider.displayName = 'BuiDivider';
|
|
60
|
+
Divider.defaultProps = {
|
|
61
|
+
direction: 'vertical',
|
|
62
|
+
dashed: false
|
|
63
|
+
};
|
|
64
|
+
var _default = exports.default = Divider;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { OverrideProps } from '@bifrostui/types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export type DividerProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
|
|
4
|
+
props: P & {
|
|
5
|
+
/**
|
|
6
|
+
* 分割线方向
|
|
7
|
+
*/
|
|
8
|
+
direction?: 'horizontal' | 'vertical';
|
|
9
|
+
/**
|
|
10
|
+
* horizontal时代表宽度,vertical时代表高度
|
|
11
|
+
*/
|
|
12
|
+
size?: string;
|
|
13
|
+
/**
|
|
14
|
+
* 是否使用虚线
|
|
15
|
+
*/
|
|
16
|
+
dashed?: boolean;
|
|
17
|
+
};
|
|
18
|
+
defaultComponent: D;
|
|
19
|
+
}, D>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
Divider: true
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "Divider", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return _Divider.default;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(exports, "default", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () {
|
|
18
|
+
return _Divider.default;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
var _Divider = _interopRequireDefault(require("./Divider"));
|
|
22
|
+
var _Divider2 = require("./Divider.types");
|
|
23
|
+
Object.keys(_Divider2).forEach(function (key) {
|
|
24
|
+
if (key === "default" || key === "__esModule") return;
|
|
25
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
26
|
+
if (key in exports && exports[key] === _Divider2[key]) return;
|
|
27
|
+
Object.defineProperty(exports, key, {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function () {
|
|
30
|
+
return _Divider2[key];
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.bui-drawer {
|
|
2
|
+
font-family: var(--bui-font-family);
|
|
3
|
+
}
|
|
4
|
+
.bui-drawer-content {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
height: 100%;
|
|
8
|
+
flex: 1 0 auto;
|
|
9
|
+
position: fixed;
|
|
10
|
+
top: 0;
|
|
11
|
+
outline: 0;
|
|
12
|
+
background-color: var(--bui-color-bg-view);
|
|
13
|
+
}
|
|
14
|
+
.bui-drawer-content-left {
|
|
15
|
+
left: 0;
|
|
16
|
+
}
|
|
17
|
+
.bui-drawer-content-top {
|
|
18
|
+
top: 0;
|
|
19
|
+
left: 0;
|
|
20
|
+
right: 0;
|
|
21
|
+
height: auto;
|
|
22
|
+
max-height: 100%;
|
|
23
|
+
}
|
|
24
|
+
.bui-drawer-content-right {
|
|
25
|
+
right: 0;
|
|
26
|
+
}
|
|
27
|
+
.bui-drawer-content-bottom {
|
|
28
|
+
bottom: 0;
|
|
29
|
+
top: auto;
|
|
30
|
+
left: 0;
|
|
31
|
+
/* stylelint-disable-next-line declaration-block-no-redundant-longhand-properties */
|
|
32
|
+
right: 0;
|
|
33
|
+
height: auto;
|
|
34
|
+
max-height: 100%;
|
|
35
|
+
}
|