@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,37 @@
|
|
|
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("./TabPanel.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
|
+
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); }
|
|
14
|
+
const prefixCls = 'bui-tabpanel';
|
|
15
|
+
const TabPanel = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
16
|
+
const {
|
|
17
|
+
className,
|
|
18
|
+
children,
|
|
19
|
+
value,
|
|
20
|
+
index,
|
|
21
|
+
keepMounted,
|
|
22
|
+
...others
|
|
23
|
+
} = props;
|
|
24
|
+
const keepActiveDom = keepMounted ? children : null;
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement("div", _extends({
|
|
26
|
+
ref: ref,
|
|
27
|
+
className: (0, _clsx.default)(prefixCls, className, {
|
|
28
|
+
[`${prefixCls}-active`]: value === index,
|
|
29
|
+
[`${prefixCls}-inactive`]: value !== index
|
|
30
|
+
})
|
|
31
|
+
}, others), value === index ? children : keepActiveDom);
|
|
32
|
+
});
|
|
33
|
+
TabPanel.displayName = 'BuiTabPanel';
|
|
34
|
+
TabPanel.defaultProps = {
|
|
35
|
+
keepMounted: false
|
|
36
|
+
};
|
|
37
|
+
var _default = exports.default = TabPanel;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { OverrideProps } from '@bifrostui/types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export type TabPanelProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
|
|
4
|
+
props: P & {
|
|
5
|
+
/**
|
|
6
|
+
* value 当前选中面板的value
|
|
7
|
+
*/
|
|
8
|
+
value?: string;
|
|
9
|
+
/**
|
|
10
|
+
* 对应tabs切换面板的数据中的index
|
|
11
|
+
*/
|
|
12
|
+
index?: string;
|
|
13
|
+
/**
|
|
14
|
+
* 当TabPanel被隐藏时是否渲染 DOM 结构,默认false
|
|
15
|
+
*/
|
|
16
|
+
keepMounted?: boolean;
|
|
17
|
+
};
|
|
18
|
+
defaultComponent: D;
|
|
19
|
+
}, D>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
.bui-tabs {
|
|
2
|
+
--height: 39px;
|
|
3
|
+
--font-size: var(--bui-text-size-1);
|
|
4
|
+
--color: var(--bui-color-fg-subtle);
|
|
5
|
+
--active-color: var(--bui-color-fg-default);
|
|
6
|
+
--line-color: var(--bui-color-primary);
|
|
7
|
+
position: relative;
|
|
8
|
+
font-family: var(--bui-font-family);
|
|
9
|
+
}
|
|
10
|
+
.bui-tabs-tabs {
|
|
11
|
+
height: var(--height);
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-wrap: nowrap;
|
|
14
|
+
justify-content: flex-start;
|
|
15
|
+
align-items: center;
|
|
16
|
+
position: relative;
|
|
17
|
+
overflow-x: scroll;
|
|
18
|
+
scrollbar-width: none;
|
|
19
|
+
}
|
|
20
|
+
.bui-tabs-tabs::-webkit-scrollbar {
|
|
21
|
+
display: none;
|
|
22
|
+
}
|
|
23
|
+
.bui-tabs-tabline {
|
|
24
|
+
position: absolute;
|
|
25
|
+
width: 18px;
|
|
26
|
+
bottom: 0;
|
|
27
|
+
/* prettier-ignore */
|
|
28
|
+
height: 3PX;
|
|
29
|
+
color: var(--bui-color-primary);
|
|
30
|
+
background: var(--line-color);
|
|
31
|
+
border-radius: var(--bui-shape-radius-label);
|
|
32
|
+
}
|
|
33
|
+
.bui-tabs-content {
|
|
34
|
+
padding: var(--bui-spacing-lg);
|
|
35
|
+
}
|
|
36
|
+
.bui-tabs-mask {
|
|
37
|
+
position: absolute;
|
|
38
|
+
top: 0;
|
|
39
|
+
bottom: 0;
|
|
40
|
+
z-index: 1;
|
|
41
|
+
width: 12px;
|
|
42
|
+
height: 100%;
|
|
43
|
+
pointer-events: none;
|
|
44
|
+
}
|
|
45
|
+
.bui-tabs-mask-left {
|
|
46
|
+
left: 0;
|
|
47
|
+
background: linear-gradient(to right, var(--bui-color-white), rgba(255, 255, 255, 0));
|
|
48
|
+
}
|
|
49
|
+
.bui-tabs-mask-right {
|
|
50
|
+
right: 0;
|
|
51
|
+
background: linear-gradient(to left, var(--bui-color-white), rgba(255, 255, 255, 0));
|
|
52
|
+
}
|
|
53
|
+
.bui-tabline-invisible {
|
|
54
|
+
visibility: hidden;
|
|
55
|
+
background-color: transparent;
|
|
56
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _utils = require("@bifrostui/utils");
|
|
8
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _Tab = _interopRequireDefault(require("./Tab"));
|
|
11
|
+
require("./Tabs.css");
|
|
12
|
+
var _TabsContext = require("./TabsContext");
|
|
13
|
+
var _bound = _interopRequireDefault(require("./utils/bound"));
|
|
14
|
+
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); }
|
|
15
|
+
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; }
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
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); }
|
|
18
|
+
const prefixCls = 'bui-tabs';
|
|
19
|
+
const Tabs = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
20
|
+
const {
|
|
21
|
+
children,
|
|
22
|
+
className,
|
|
23
|
+
value,
|
|
24
|
+
tabs,
|
|
25
|
+
align,
|
|
26
|
+
onChange,
|
|
27
|
+
...others
|
|
28
|
+
} = props;
|
|
29
|
+
const [active, setActive] = (0, _react.useState)('');
|
|
30
|
+
const tabsRef = (0, _react.useRef)(null);
|
|
31
|
+
const activeLineRef = (0, _react.useRef)(null);
|
|
32
|
+
const [lineData, setLineData] = (0, _react.useState)({
|
|
33
|
+
x: 0,
|
|
34
|
+
transitionInUse: false
|
|
35
|
+
});
|
|
36
|
+
const [maskData, setMaskData] = (0, _react.useState)({
|
|
37
|
+
leftMaskOpacity: 0,
|
|
38
|
+
rightMaskOpacity: 0
|
|
39
|
+
});
|
|
40
|
+
const animate = ({
|
|
41
|
+
transitionInUse
|
|
42
|
+
}) => {
|
|
43
|
+
const container = tabsRef.current;
|
|
44
|
+
if (!container) return;
|
|
45
|
+
const activeIndex = !!tabs.length && tabs.findIndex(item => item.index === (active || tabs[0]?.index));
|
|
46
|
+
const activeLine = activeLineRef.current;
|
|
47
|
+
if (!activeLine) return;
|
|
48
|
+
let activeTab;
|
|
49
|
+
if (tabs.length) {
|
|
50
|
+
activeTab = container.childNodes[activeIndex + 1];
|
|
51
|
+
} else {
|
|
52
|
+
activeTab = [...container.childNodes].find(child => {
|
|
53
|
+
if (_utils.isMini) {
|
|
54
|
+
return [...child.classList.tokenList].includes('bui-tab-miniapp-active');
|
|
55
|
+
}
|
|
56
|
+
return [...child.classList].includes('bui-tab-active');
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
if (!activeTab) return;
|
|
60
|
+
const activeTabLeft = activeTab.offsetLeft;
|
|
61
|
+
const activeTabWidth = activeTab.offsetWidth;
|
|
62
|
+
const containerWidth = container.offsetWidth;
|
|
63
|
+
const containerScrollWidth = container.scrollWidth;
|
|
64
|
+
const activeLineWidth = activeLine.offsetWidth;
|
|
65
|
+
const x = activeTabLeft + (activeTabWidth - activeLineWidth) / 2;
|
|
66
|
+
setLineData({
|
|
67
|
+
x,
|
|
68
|
+
transitionInUse
|
|
69
|
+
});
|
|
70
|
+
const maxScrollDistance = containerScrollWidth - containerWidth;
|
|
71
|
+
if (maxScrollDistance <= 0) return;
|
|
72
|
+
const nextScrollLeft = (0, _bound.default)(activeTabLeft - (containerWidth - activeTabWidth) / 2, 0, containerScrollWidth - containerWidth);
|
|
73
|
+
if (tabsRef.current) {
|
|
74
|
+
tabsRef.current.scrollLeft = nextScrollLeft;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
(0, _react.useEffect)(() => {
|
|
78
|
+
const defaultIndex = safeValue();
|
|
79
|
+
setActive(defaultIndex);
|
|
80
|
+
}, [value]);
|
|
81
|
+
(0, _react.useLayoutEffect)(() => {
|
|
82
|
+
animate({
|
|
83
|
+
transitionInUse: false
|
|
84
|
+
});
|
|
85
|
+
}, []);
|
|
86
|
+
(0, _react.useEffect)(() => {
|
|
87
|
+
const handleResize = (0, _utils.debounce)(() => {
|
|
88
|
+
animate({
|
|
89
|
+
transitionInUse: true
|
|
90
|
+
});
|
|
91
|
+
}, 100);
|
|
92
|
+
window.addEventListener('resize', handleResize);
|
|
93
|
+
return () => {
|
|
94
|
+
window.removeEventListener('resize', handleResize);
|
|
95
|
+
};
|
|
96
|
+
}, [active]);
|
|
97
|
+
(0, _utils.useDidMountEffect)(() => {
|
|
98
|
+
animate({
|
|
99
|
+
transitionInUse: true
|
|
100
|
+
});
|
|
101
|
+
}, [active, tabs]);
|
|
102
|
+
const safeValue = () => {
|
|
103
|
+
let defaultIndex = value;
|
|
104
|
+
if (!!tabs.length && !tabs.some(item => item.index === value)) {
|
|
105
|
+
defaultIndex = tabs[0]?.index;
|
|
106
|
+
}
|
|
107
|
+
return defaultIndex;
|
|
108
|
+
};
|
|
109
|
+
const updateMask = (0, _react.useMemo)(() => (0, _utils.throttle)(() => {
|
|
110
|
+
const container = tabsRef.current;
|
|
111
|
+
if (!container) return;
|
|
112
|
+
const scrollLeft = container?.scrollLeft;
|
|
113
|
+
const showLeftMask = scrollLeft > 0;
|
|
114
|
+
const showRightMask = scrollLeft + container.offsetWidth < container.scrollWidth;
|
|
115
|
+
setMaskData({
|
|
116
|
+
leftMaskOpacity: showLeftMask ? 1 : 0,
|
|
117
|
+
rightMaskOpacity: showRightMask ? 1 : 0
|
|
118
|
+
});
|
|
119
|
+
}, 100, {
|
|
120
|
+
trailing: true,
|
|
121
|
+
leading: true
|
|
122
|
+
}), []);
|
|
123
|
+
(0, _react.useLayoutEffect)(() => {
|
|
124
|
+
updateMask();
|
|
125
|
+
}, []);
|
|
126
|
+
const handleClick = (e, item) => {
|
|
127
|
+
const {
|
|
128
|
+
index,
|
|
129
|
+
disabled = false
|
|
130
|
+
} = item;
|
|
131
|
+
if (disabled) return;
|
|
132
|
+
if (index === undefined || index === null) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
if (active !== value) {
|
|
136
|
+
setActive(index);
|
|
137
|
+
}
|
|
138
|
+
if (index !== value) {
|
|
139
|
+
onChange?.(e, {
|
|
140
|
+
index
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
const providerValue = (0, _react.useMemo)(() => {
|
|
145
|
+
const v = safeValue();
|
|
146
|
+
return {
|
|
147
|
+
value: v,
|
|
148
|
+
align,
|
|
149
|
+
triggerChange: handleClick
|
|
150
|
+
};
|
|
151
|
+
}, [value, align, handleClick]);
|
|
152
|
+
return /*#__PURE__*/_react.default.createElement("div", _extends({
|
|
153
|
+
ref: ref,
|
|
154
|
+
className: (0, _clsx.default)(prefixCls, className)
|
|
155
|
+
}, others), /*#__PURE__*/_react.default.createElement("div", {
|
|
156
|
+
className: (0, _clsx.default)(`${prefixCls}-mask`, `${prefixCls}-mask-left`),
|
|
157
|
+
style: {
|
|
158
|
+
opacity: maskData.leftMaskOpacity
|
|
159
|
+
}
|
|
160
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
161
|
+
className: (0, _clsx.default)(`${prefixCls}-mask`, `${prefixCls}-mask-right`),
|
|
162
|
+
style: {
|
|
163
|
+
opacity: maskData.rightMaskOpacity
|
|
164
|
+
}
|
|
165
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
166
|
+
className: `${prefixCls}-tabs`,
|
|
167
|
+
ref: tabsRef,
|
|
168
|
+
onScroll: updateMask
|
|
169
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
170
|
+
ref: activeLineRef,
|
|
171
|
+
className: (0, _clsx.default)(`${prefixCls}-tabline`, {
|
|
172
|
+
'bui-tabline-invisible': _utils.isMini
|
|
173
|
+
}),
|
|
174
|
+
style: {
|
|
175
|
+
transition: lineData.transitionInUse ? 'transform 0.25s ease-in-out' : '',
|
|
176
|
+
transform: `translate3d(${lineData.x}px, 0px, 0px)`
|
|
177
|
+
}
|
|
178
|
+
}), /*#__PURE__*/_react.default.createElement(_TabsContext.TabsContextProvider, {
|
|
179
|
+
value: providerValue
|
|
180
|
+
}, !!tabs.length && tabs.map(item => {
|
|
181
|
+
return /*#__PURE__*/_react.default.createElement(_Tab.default, {
|
|
182
|
+
key: item.index,
|
|
183
|
+
index: item?.index,
|
|
184
|
+
disabled: item?.disabled
|
|
185
|
+
}, item.title);
|
|
186
|
+
}), children)));
|
|
187
|
+
});
|
|
188
|
+
Tabs.displayName = 'BuiTabs';
|
|
189
|
+
Tabs.defaultProps = {
|
|
190
|
+
align: 'center',
|
|
191
|
+
tabs: []
|
|
192
|
+
};
|
|
193
|
+
var _default = exports.default = Tabs;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { OverrideProps } from '@bifrostui/types';
|
|
2
|
+
import React, { SyntheticEvent } from 'react';
|
|
3
|
+
export interface TabHeaderItem {
|
|
4
|
+
title: React.ReactNode;
|
|
5
|
+
index: string;
|
|
6
|
+
/**
|
|
7
|
+
* 是否禁止点击
|
|
8
|
+
*/
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface ITabsChangeData {
|
|
12
|
+
/** 切换后的tab索引 */
|
|
13
|
+
index: string;
|
|
14
|
+
}
|
|
15
|
+
export type TabChangeEvent = (e?: SyntheticEvent, data?: ITabsChangeData) => void;
|
|
16
|
+
export interface ITabItem {
|
|
17
|
+
/** 面板标题 */
|
|
18
|
+
title: React.ReactNode;
|
|
19
|
+
/** 面板的索引值 */
|
|
20
|
+
index: string;
|
|
21
|
+
/** 面板是否禁用 */
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export type ITabAlign = 'start' | 'center';
|
|
25
|
+
export type TabsProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
|
|
26
|
+
props: P & {
|
|
27
|
+
/**
|
|
28
|
+
* 当前选中面板的索引值,与tabs.index对应
|
|
29
|
+
*/
|
|
30
|
+
value?: string;
|
|
31
|
+
/**
|
|
32
|
+
* 切换面板的数据
|
|
33
|
+
*/
|
|
34
|
+
tabs?: ITabItem[];
|
|
35
|
+
/**
|
|
36
|
+
* 对齐方式,默认为center
|
|
37
|
+
*/
|
|
38
|
+
align?: ITabAlign;
|
|
39
|
+
/**
|
|
40
|
+
* 切换面板的回调
|
|
41
|
+
*/
|
|
42
|
+
onChange?: TabChangeEvent;
|
|
43
|
+
};
|
|
44
|
+
defaultComponent: D;
|
|
45
|
+
}, D>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TabChangeEvent, TabsProps } from './Tabs.types';
|
|
3
|
+
declare const TabsContext: React.Context<Omit<TabsProps, "onChange"> & {
|
|
4
|
+
triggerChange: TabChangeEvent;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const TabsContextProvider: React.Provider<Omit<TabsProps, "onChange"> & {
|
|
7
|
+
triggerChange: TabChangeEvent;
|
|
8
|
+
}>;
|
|
9
|
+
export default TabsContext;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.TabsContextProvider = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
const TabsContext = /*#__PURE__*/_react.default.createContext(undefined);
|
|
10
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
11
|
+
TabsContext.displayName = 'BuiTabsContext';
|
|
12
|
+
}
|
|
13
|
+
const TabsContextProvider = exports.TabsContextProvider = TabsContext.Provider;
|
|
14
|
+
var _default = exports.default = TabsContext;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
Tab: true,
|
|
8
|
+
TabPanel: true,
|
|
9
|
+
Tabs: true
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "Tab", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () {
|
|
14
|
+
return _Tab.default;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "TabPanel", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () {
|
|
20
|
+
return _TabPanel.default;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports, "Tabs", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () {
|
|
26
|
+
return _Tabs.default;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
Object.defineProperty(exports, "default", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function () {
|
|
32
|
+
return _Tabs.default;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
var _Tab = _interopRequireDefault(require("./Tab"));
|
|
36
|
+
var _Tab2 = require("./Tab.types");
|
|
37
|
+
Object.keys(_Tab2).forEach(function (key) {
|
|
38
|
+
if (key === "default" || key === "__esModule") return;
|
|
39
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
40
|
+
if (key in exports && exports[key] === _Tab2[key]) return;
|
|
41
|
+
Object.defineProperty(exports, key, {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function () {
|
|
44
|
+
return _Tab2[key];
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
var _TabPanel = _interopRequireDefault(require("./TabPanel"));
|
|
49
|
+
var _TabPanel2 = require("./TabPanel.types");
|
|
50
|
+
Object.keys(_TabPanel2).forEach(function (key) {
|
|
51
|
+
if (key === "default" || key === "__esModule") return;
|
|
52
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
53
|
+
if (key in exports && exports[key] === _TabPanel2[key]) return;
|
|
54
|
+
Object.defineProperty(exports, key, {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _TabPanel2[key];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
var _Tabs = _interopRequireDefault(require("./Tabs"));
|
|
62
|
+
var _Tabs2 = require("./Tabs.types");
|
|
63
|
+
Object.keys(_Tabs2).forEach(function (key) {
|
|
64
|
+
if (key === "default" || key === "__esModule") return;
|
|
65
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
66
|
+
if (key in exports && exports[key] === _Tabs2[key]) return;
|
|
67
|
+
Object.defineProperty(exports, key, {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
get: function () {
|
|
70
|
+
return _Tabs2[key];
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function bound(position: number, min: number | undefined, max: number | undefined): number;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = bound;
|
|
7
|
+
function bound(position, min, max) {
|
|
8
|
+
let ret = position;
|
|
9
|
+
if (min !== undefined) {
|
|
10
|
+
ret = Math.max(position, min);
|
|
11
|
+
}
|
|
12
|
+
if (max !== undefined) {
|
|
13
|
+
ret = Math.min(ret, max);
|
|
14
|
+
}
|
|
15
|
+
return ret;
|
|
16
|
+
}
|
package/dist/Tag/Tag.css
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
.bui-tag {
|
|
2
|
+
--color: var(--bui-tag-color, var(--bui-color-gray));
|
|
3
|
+
--border-color: var(--bui-tag-border-color, var(--bui-color-border-gray));
|
|
4
|
+
--bg-color: var(--bui-tag-bg-color, var(--bui-color-gray));
|
|
5
|
+
position: relative;
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
white-space: nowrap;
|
|
10
|
+
height: 15px;
|
|
11
|
+
line-height: 15px;
|
|
12
|
+
padding: 0 var(--bui-spacing-xs);
|
|
13
|
+
font-size: var(--bui-text-size-5);
|
|
14
|
+
font-weight: var(--bui-font-weight-normal);
|
|
15
|
+
border-radius: var(--bui-shape-radius-label);
|
|
16
|
+
border: 1px solid transparent;
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
color: var(--bui-color-bg-view);
|
|
19
|
+
font-family: var(--bui-font-family);
|
|
20
|
+
}
|
|
21
|
+
.bui-tag-outlined {
|
|
22
|
+
color: var(--color);
|
|
23
|
+
border: 1px solid var(--border-color);
|
|
24
|
+
}
|
|
25
|
+
.bui-tag-outlined.bui-tag-primary {
|
|
26
|
+
color: var(--bui-color-primary);
|
|
27
|
+
border: 1px solid var(--bui-color-border-primary);
|
|
28
|
+
}
|
|
29
|
+
.bui-tag-outlined.bui-tag-info {
|
|
30
|
+
color: var(--bui-color-info);
|
|
31
|
+
border: 1px solid var(--bui-color-border-info);
|
|
32
|
+
}
|
|
33
|
+
.bui-tag-outlined.bui-tag-warning {
|
|
34
|
+
color: var(--bui-color-warning);
|
|
35
|
+
border: 1px solid var(--bui-color-border-warning);
|
|
36
|
+
}
|
|
37
|
+
.bui-tag-outlined.bui-tag-success {
|
|
38
|
+
color: var(--bui-color-success);
|
|
39
|
+
border: 1px solid var(--bui-color-border-success);
|
|
40
|
+
}
|
|
41
|
+
.bui-tag-outlined.bui-tag-danger {
|
|
42
|
+
color: var(--bui-color-danger);
|
|
43
|
+
border: 1px solid var(--bui-color-border-danger);
|
|
44
|
+
}
|
|
45
|
+
.bui-tag-outlined.bui-tag-vip {
|
|
46
|
+
color: var(--bui-color-vip);
|
|
47
|
+
border: 1px solid rgba(255, 134, 110, 0.4);
|
|
48
|
+
}
|
|
49
|
+
.bui-tag-contained {
|
|
50
|
+
background-color: var(--bg-color);
|
|
51
|
+
}
|
|
52
|
+
.bui-tag-contained.bui-tag-primary {
|
|
53
|
+
background-color: var(--bui-color-primary);
|
|
54
|
+
}
|
|
55
|
+
.bui-tag-contained.bui-tag-info {
|
|
56
|
+
background-color: var(--bui-color-info);
|
|
57
|
+
}
|
|
58
|
+
.bui-tag-contained.bui-tag-warning {
|
|
59
|
+
background-color: var(--bui-color-warning);
|
|
60
|
+
}
|
|
61
|
+
.bui-tag-contained.bui-tag-success {
|
|
62
|
+
background-color: var(--bui-color-success);
|
|
63
|
+
}
|
|
64
|
+
.bui-tag-contained.bui-tag-danger {
|
|
65
|
+
background-color: var(--bui-color-danger);
|
|
66
|
+
}
|
|
67
|
+
.bui-tag-contained.bui-tag-vip {
|
|
68
|
+
background-color: var(--bui-color-vip);
|
|
69
|
+
}
|
|
70
|
+
.bui-tag-light {
|
|
71
|
+
background-color: var(--bui-color-gray-light);
|
|
72
|
+
color: var(--bui-color-gray);
|
|
73
|
+
}
|
|
74
|
+
.bui-tag-light.bui-tag-primary {
|
|
75
|
+
background-color: var(--bui-color-primary-light);
|
|
76
|
+
color: var(--bui-color-primary);
|
|
77
|
+
}
|
|
78
|
+
.bui-tag-light.bui-tag-info {
|
|
79
|
+
background-color: var(--bui-color-info-light);
|
|
80
|
+
color: var(--bui-color-info);
|
|
81
|
+
}
|
|
82
|
+
.bui-tag-light.bui-tag-warning {
|
|
83
|
+
background-color: var(--bui-color-warning-light);
|
|
84
|
+
color: var(--bui-color-warning);
|
|
85
|
+
}
|
|
86
|
+
.bui-tag-light.bui-tag-success {
|
|
87
|
+
background-color: var(--bui-color-success-light);
|
|
88
|
+
color: var(--bui-color-success);
|
|
89
|
+
}
|
|
90
|
+
.bui-tag-light.bui-tag-danger {
|
|
91
|
+
background-color: var(--bui-color-danger-light);
|
|
92
|
+
color: var(--bui-color-danger);
|
|
93
|
+
}
|
|
94
|
+
.bui-tag-light.bui-tag-vip {
|
|
95
|
+
background-color: rgba(255, 134, 110, 0.3);
|
|
96
|
+
color: var(--bui-color-vip);
|
|
97
|
+
}
|
package/dist/Tag/Tag.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _utils = require("@bifrostui/utils");
|
|
8
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
require("./Tag.css");
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
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); }
|
|
13
|
+
// 只支持 rgba rgb hex
|
|
14
|
+
// 处理rgb格式的颜色
|
|
15
|
+
const colorHandler = (color, opacity = 1) => {
|
|
16
|
+
// rgba
|
|
17
|
+
if (color.includes('rgba')) {
|
|
18
|
+
const lastCommaIndex = color.lastIndexOf(',');
|
|
19
|
+
return `${color.slice(0, lastCommaIndex)}, ${opacity})`;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// rgb
|
|
23
|
+
if (color.includes('rgb')) {
|
|
24
|
+
color = color.replace('rgb', 'rgba');
|
|
25
|
+
const len = color.length;
|
|
26
|
+
return `${color.slice(0, len - 1)}, ${opacity})`;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// hex
|
|
30
|
+
return (0, _utils.convertHexToRGBA)(color, opacity);
|
|
31
|
+
};
|
|
32
|
+
const prefixCls = 'bui-tag';
|
|
33
|
+
const Tag = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
34
|
+
const {
|
|
35
|
+
className,
|
|
36
|
+
style,
|
|
37
|
+
color,
|
|
38
|
+
htmlColor,
|
|
39
|
+
variant,
|
|
40
|
+
onClick,
|
|
41
|
+
children,
|
|
42
|
+
...others
|
|
43
|
+
} = props;
|
|
44
|
+
let customStyles;
|
|
45
|
+
if (htmlColor) {
|
|
46
|
+
if (variant === 'outlined') {
|
|
47
|
+
customStyles = {
|
|
48
|
+
color: htmlColor,
|
|
49
|
+
borderColor: colorHandler(htmlColor, 0.4)
|
|
50
|
+
};
|
|
51
|
+
} else if (variant === 'light') {
|
|
52
|
+
customStyles = {
|
|
53
|
+
color: htmlColor,
|
|
54
|
+
backgroundColor: colorHandler(htmlColor, 0.3)
|
|
55
|
+
};
|
|
56
|
+
} else {
|
|
57
|
+
customStyles = {
|
|
58
|
+
backgroundColor: htmlColor
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return /*#__PURE__*/_react.default.createElement("div", _extends({
|
|
63
|
+
className: (0, _clsx.default)(prefixCls, {
|
|
64
|
+
[`${prefixCls}-${variant}`]: variant,
|
|
65
|
+
[`${prefixCls}-${color}`]: color
|
|
66
|
+
}, className),
|
|
67
|
+
ref: ref,
|
|
68
|
+
style: {
|
|
69
|
+
...style,
|
|
70
|
+
...customStyles
|
|
71
|
+
},
|
|
72
|
+
onClick: onClick
|
|
73
|
+
}, others), children);
|
|
74
|
+
});
|
|
75
|
+
Tag.displayName = 'BuiTag';
|
|
76
|
+
Tag.defaultProps = {
|
|
77
|
+
variant: 'outlined',
|
|
78
|
+
color: 'default'
|
|
79
|
+
};
|
|
80
|
+
var _default = exports.default = Tag;
|