@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
package/es/Tabs/Tabs.js
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
var _excluded = ["children", "className", "value", "tabs", "align", "onChange"];
|
|
2
|
+
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); }
|
|
3
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
14
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
15
|
+
import { debounce, isMini, throttle, useDidMountEffect } from '@bifrostui/utils';
|
|
16
|
+
import clsx from 'clsx';
|
|
17
|
+
import React, { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
18
|
+
import Tab from "./Tab";
|
|
19
|
+
import "./Tabs.css";
|
|
20
|
+
import { TabsContextProvider } from "./TabsContext";
|
|
21
|
+
import bound from "./utils/bound";
|
|
22
|
+
var prefixCls = 'bui-tabs';
|
|
23
|
+
var Tabs = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
24
|
+
var children = props.children,
|
|
25
|
+
className = props.className,
|
|
26
|
+
value = props.value,
|
|
27
|
+
tabs = props.tabs,
|
|
28
|
+
align = props.align,
|
|
29
|
+
onChange = props.onChange,
|
|
30
|
+
others = _objectWithoutProperties(props, _excluded);
|
|
31
|
+
var _useState = useState(''),
|
|
32
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
33
|
+
active = _useState2[0],
|
|
34
|
+
setActive = _useState2[1];
|
|
35
|
+
var tabsRef = useRef(null);
|
|
36
|
+
var activeLineRef = useRef(null);
|
|
37
|
+
var _useState3 = useState({
|
|
38
|
+
x: 0,
|
|
39
|
+
transitionInUse: false
|
|
40
|
+
}),
|
|
41
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
42
|
+
lineData = _useState4[0],
|
|
43
|
+
setLineData = _useState4[1];
|
|
44
|
+
var _useState5 = useState({
|
|
45
|
+
leftMaskOpacity: 0,
|
|
46
|
+
rightMaskOpacity: 0
|
|
47
|
+
}),
|
|
48
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
49
|
+
maskData = _useState6[0],
|
|
50
|
+
setMaskData = _useState6[1];
|
|
51
|
+
var animate = function animate(_ref) {
|
|
52
|
+
var transitionInUse = _ref.transitionInUse;
|
|
53
|
+
var container = tabsRef.current;
|
|
54
|
+
if (!container) return;
|
|
55
|
+
var activeIndex = !!tabs.length && tabs.findIndex(function (item) {
|
|
56
|
+
var _tabs$;
|
|
57
|
+
return item.index === (active || ((_tabs$ = tabs[0]) === null || _tabs$ === void 0 ? void 0 : _tabs$.index));
|
|
58
|
+
});
|
|
59
|
+
var activeLine = activeLineRef.current;
|
|
60
|
+
if (!activeLine) return;
|
|
61
|
+
var activeTab;
|
|
62
|
+
if (tabs.length) {
|
|
63
|
+
activeTab = container.childNodes[activeIndex + 1];
|
|
64
|
+
} else {
|
|
65
|
+
activeTab = _toConsumableArray(container.childNodes).find(function (child) {
|
|
66
|
+
if (isMini) {
|
|
67
|
+
return _toConsumableArray(child.classList.tokenList).includes('bui-tab-miniapp-active');
|
|
68
|
+
}
|
|
69
|
+
return _toConsumableArray(child.classList).includes('bui-tab-active');
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
if (!activeTab) return;
|
|
73
|
+
var activeTabLeft = activeTab.offsetLeft;
|
|
74
|
+
var activeTabWidth = activeTab.offsetWidth;
|
|
75
|
+
var containerWidth = container.offsetWidth;
|
|
76
|
+
var containerScrollWidth = container.scrollWidth;
|
|
77
|
+
var activeLineWidth = activeLine.offsetWidth;
|
|
78
|
+
var x = activeTabLeft + (activeTabWidth - activeLineWidth) / 2;
|
|
79
|
+
setLineData({
|
|
80
|
+
x: x,
|
|
81
|
+
transitionInUse: transitionInUse
|
|
82
|
+
});
|
|
83
|
+
var maxScrollDistance = containerScrollWidth - containerWidth;
|
|
84
|
+
if (maxScrollDistance <= 0) return;
|
|
85
|
+
var nextScrollLeft = bound(activeTabLeft - (containerWidth - activeTabWidth) / 2, 0, containerScrollWidth - containerWidth);
|
|
86
|
+
if (tabsRef.current) {
|
|
87
|
+
tabsRef.current.scrollLeft = nextScrollLeft;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
useEffect(function () {
|
|
91
|
+
var defaultIndex = safeValue();
|
|
92
|
+
setActive(defaultIndex);
|
|
93
|
+
}, [value]);
|
|
94
|
+
useLayoutEffect(function () {
|
|
95
|
+
animate({
|
|
96
|
+
transitionInUse: false
|
|
97
|
+
});
|
|
98
|
+
}, []);
|
|
99
|
+
useEffect(function () {
|
|
100
|
+
var handleResize = debounce(function () {
|
|
101
|
+
animate({
|
|
102
|
+
transitionInUse: true
|
|
103
|
+
});
|
|
104
|
+
}, 100);
|
|
105
|
+
window.addEventListener('resize', handleResize);
|
|
106
|
+
return function () {
|
|
107
|
+
window.removeEventListener('resize', handleResize);
|
|
108
|
+
};
|
|
109
|
+
}, [active]);
|
|
110
|
+
useDidMountEffect(function () {
|
|
111
|
+
animate({
|
|
112
|
+
transitionInUse: true
|
|
113
|
+
});
|
|
114
|
+
}, [active, tabs]);
|
|
115
|
+
var safeValue = function safeValue() {
|
|
116
|
+
var defaultIndex = value;
|
|
117
|
+
if (!!tabs.length && !tabs.some(function (item) {
|
|
118
|
+
return item.index === value;
|
|
119
|
+
})) {
|
|
120
|
+
var _tabs$2;
|
|
121
|
+
defaultIndex = (_tabs$2 = tabs[0]) === null || _tabs$2 === void 0 ? void 0 : _tabs$2.index;
|
|
122
|
+
}
|
|
123
|
+
return defaultIndex;
|
|
124
|
+
};
|
|
125
|
+
var updateMask = useMemo(function () {
|
|
126
|
+
return throttle(function () {
|
|
127
|
+
var container = tabsRef.current;
|
|
128
|
+
if (!container) return;
|
|
129
|
+
var scrollLeft = container === null || container === void 0 ? void 0 : container.scrollLeft;
|
|
130
|
+
var showLeftMask = scrollLeft > 0;
|
|
131
|
+
var showRightMask = scrollLeft + container.offsetWidth < container.scrollWidth;
|
|
132
|
+
setMaskData({
|
|
133
|
+
leftMaskOpacity: showLeftMask ? 1 : 0,
|
|
134
|
+
rightMaskOpacity: showRightMask ? 1 : 0
|
|
135
|
+
});
|
|
136
|
+
}, 100, {
|
|
137
|
+
trailing: true,
|
|
138
|
+
leading: true
|
|
139
|
+
});
|
|
140
|
+
}, []);
|
|
141
|
+
useLayoutEffect(function () {
|
|
142
|
+
updateMask();
|
|
143
|
+
}, []);
|
|
144
|
+
var handleClick = function handleClick(e, item) {
|
|
145
|
+
var index = item.index,
|
|
146
|
+
_item$disabled = item.disabled,
|
|
147
|
+
disabled = _item$disabled === void 0 ? false : _item$disabled;
|
|
148
|
+
if (disabled) return;
|
|
149
|
+
if (index === undefined || index === null) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
if (active !== value) {
|
|
153
|
+
setActive(index);
|
|
154
|
+
}
|
|
155
|
+
if (index !== value) {
|
|
156
|
+
onChange === null || onChange === void 0 || onChange(e, {
|
|
157
|
+
index: index
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
var providerValue = useMemo(function () {
|
|
162
|
+
var v = safeValue();
|
|
163
|
+
return {
|
|
164
|
+
value: v,
|
|
165
|
+
align: align,
|
|
166
|
+
triggerChange: handleClick
|
|
167
|
+
};
|
|
168
|
+
}, [value, align, handleClick]);
|
|
169
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
170
|
+
ref: ref,
|
|
171
|
+
className: clsx(prefixCls, className)
|
|
172
|
+
}, others), /*#__PURE__*/React.createElement("div", {
|
|
173
|
+
className: clsx("".concat(prefixCls, "-mask"), "".concat(prefixCls, "-mask-left")),
|
|
174
|
+
style: {
|
|
175
|
+
opacity: maskData.leftMaskOpacity
|
|
176
|
+
}
|
|
177
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
178
|
+
className: clsx("".concat(prefixCls, "-mask"), "".concat(prefixCls, "-mask-right")),
|
|
179
|
+
style: {
|
|
180
|
+
opacity: maskData.rightMaskOpacity
|
|
181
|
+
}
|
|
182
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
183
|
+
className: "".concat(prefixCls, "-tabs"),
|
|
184
|
+
ref: tabsRef,
|
|
185
|
+
onScroll: updateMask
|
|
186
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
187
|
+
ref: activeLineRef,
|
|
188
|
+
className: clsx("".concat(prefixCls, "-tabline"), {
|
|
189
|
+
'bui-tabline-invisible': isMini
|
|
190
|
+
}),
|
|
191
|
+
style: {
|
|
192
|
+
transition: lineData.transitionInUse ? 'transform 0.25s ease-in-out' : '',
|
|
193
|
+
transform: "translate3d(".concat(lineData.x, "px, 0px, 0px)")
|
|
194
|
+
}
|
|
195
|
+
}), /*#__PURE__*/React.createElement(TabsContextProvider, {
|
|
196
|
+
value: providerValue
|
|
197
|
+
}, !!tabs.length && tabs.map(function (item) {
|
|
198
|
+
return /*#__PURE__*/React.createElement(Tab, {
|
|
199
|
+
key: item.index,
|
|
200
|
+
index: item === null || item === void 0 ? void 0 : item.index,
|
|
201
|
+
disabled: item === null || item === void 0 ? void 0 : item.disabled
|
|
202
|
+
}, item.title);
|
|
203
|
+
}), children)));
|
|
204
|
+
});
|
|
205
|
+
Tabs.displayName = 'BuiTabs';
|
|
206
|
+
Tabs.defaultProps = {
|
|
207
|
+
align: 'center',
|
|
208
|
+
tabs: []
|
|
209
|
+
};
|
|
210
|
+
export 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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
var TabsContext = /*#__PURE__*/React.createContext(undefined);
|
|
3
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4
|
+
TabsContext.displayName = 'BuiTabsContext';
|
|
5
|
+
}
|
|
6
|
+
export var TabsContextProvider = TabsContext.Provider;
|
|
7
|
+
export default TabsContext;
|
package/es/Tabs/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function bound(position: number, min: number | undefined, max: number | undefined): number;
|
package/es/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/es/Tag/Tag.d.ts
ADDED
package/es/Tag/Tag.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["className", "style", "color", "htmlColor", "variant", "onClick", "children"];
|
|
3
|
+
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); }
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
8
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
|
+
import { convertHexToRGBA } from '@bifrostui/utils';
|
|
12
|
+
import clsx from 'clsx';
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import "./Tag.css";
|
|
15
|
+
|
|
16
|
+
// 只支持 rgba rgb hex
|
|
17
|
+
// 处理rgb格式的颜色
|
|
18
|
+
var colorHandler = function colorHandler(color) {
|
|
19
|
+
var opacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
20
|
+
// rgba
|
|
21
|
+
if (color.includes('rgba')) {
|
|
22
|
+
var lastCommaIndex = color.lastIndexOf(',');
|
|
23
|
+
return "".concat(color.slice(0, lastCommaIndex), ", ").concat(opacity, ")");
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// rgb
|
|
27
|
+
if (color.includes('rgb')) {
|
|
28
|
+
color = color.replace('rgb', 'rgba');
|
|
29
|
+
var len = color.length;
|
|
30
|
+
return "".concat(color.slice(0, len - 1), ", ").concat(opacity, ")");
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// hex
|
|
34
|
+
return convertHexToRGBA(color, opacity);
|
|
35
|
+
};
|
|
36
|
+
var prefixCls = 'bui-tag';
|
|
37
|
+
var Tag = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
38
|
+
var className = props.className,
|
|
39
|
+
style = props.style,
|
|
40
|
+
color = props.color,
|
|
41
|
+
htmlColor = props.htmlColor,
|
|
42
|
+
variant = props.variant,
|
|
43
|
+
onClick = props.onClick,
|
|
44
|
+
children = props.children,
|
|
45
|
+
others = _objectWithoutProperties(props, _excluded);
|
|
46
|
+
var customStyles;
|
|
47
|
+
if (htmlColor) {
|
|
48
|
+
if (variant === 'outlined') {
|
|
49
|
+
customStyles = {
|
|
50
|
+
color: htmlColor,
|
|
51
|
+
borderColor: colorHandler(htmlColor, 0.4)
|
|
52
|
+
};
|
|
53
|
+
} else if (variant === 'light') {
|
|
54
|
+
customStyles = {
|
|
55
|
+
color: htmlColor,
|
|
56
|
+
backgroundColor: colorHandler(htmlColor, 0.3)
|
|
57
|
+
};
|
|
58
|
+
} else {
|
|
59
|
+
customStyles = {
|
|
60
|
+
backgroundColor: htmlColor
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
65
|
+
className: clsx(prefixCls, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-").concat(variant), variant), "".concat(prefixCls, "-").concat(color), color), className),
|
|
66
|
+
ref: ref,
|
|
67
|
+
style: _objectSpread(_objectSpread({}, style), customStyles),
|
|
68
|
+
onClick: onClick
|
|
69
|
+
}, others), children);
|
|
70
|
+
});
|
|
71
|
+
Tag.displayName = 'BuiTag';
|
|
72
|
+
Tag.defaultProps = {
|
|
73
|
+
variant: 'outlined',
|
|
74
|
+
color: 'default'
|
|
75
|
+
};
|
|
76
|
+
export default Tag;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { OverrideProps, ThemeColor } from '@bifrostui/types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export type TagProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
|
|
4
|
+
props: P & {
|
|
5
|
+
/**
|
|
6
|
+
* 预定义色彩
|
|
7
|
+
* @default 'default'
|
|
8
|
+
*/
|
|
9
|
+
color?: ThemeColor | 'default' | 'vip';
|
|
10
|
+
/**
|
|
11
|
+
* 自定义色彩
|
|
12
|
+
*/
|
|
13
|
+
htmlColor?: string;
|
|
14
|
+
/**
|
|
15
|
+
* - outlined: 描边
|
|
16
|
+
* - contained: 实心填充
|
|
17
|
+
* - light: 浅亮填充
|
|
18
|
+
* @default 'outlined'
|
|
19
|
+
*/
|
|
20
|
+
variant?: 'outlined' | 'contained' | 'light';
|
|
21
|
+
};
|
|
22
|
+
defaultComponent: D;
|
|
23
|
+
}, D>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.bui-tag-group {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
font-family: var(--bui-font-family);
|
|
4
|
+
}
|
|
5
|
+
.bui-tag-group .bui-tag {
|
|
6
|
+
margin: 0 0 0 -1px;
|
|
7
|
+
}
|
|
8
|
+
.bui-tag-group .bui-tag:not(:last-child) {
|
|
9
|
+
border-top-right-radius: 0;
|
|
10
|
+
border-bottom-right-radius: 0;
|
|
11
|
+
}
|
|
12
|
+
.bui-tag-group .bui-tag:not(:first-child) {
|
|
13
|
+
border-top-left-radius: 0;
|
|
14
|
+
border-bottom-left-radius: 0;
|
|
15
|
+
border-left: 0;
|
|
16
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var _excluded = ["className", "onClick", "children"];
|
|
2
|
+
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); }
|
|
3
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import "./TagGroup.css";
|
|
8
|
+
var prefixCls = 'bui-tag-group';
|
|
9
|
+
var Tag = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
10
|
+
var className = props.className,
|
|
11
|
+
onClick = props.onClick,
|
|
12
|
+
children = props.children,
|
|
13
|
+
others = _objectWithoutProperties(props, _excluded);
|
|
14
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
15
|
+
ref: ref,
|
|
16
|
+
onClick: onClick,
|
|
17
|
+
className: clsx(prefixCls, className)
|
|
18
|
+
}, others), children);
|
|
19
|
+
});
|
|
20
|
+
Tag.displayName = 'BuiTagGroup';
|
|
21
|
+
export default Tag;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/es/Tag/index.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
.bui-textarea {
|
|
2
|
+
--bg-color: var(--bui-color-bg-default);
|
|
3
|
+
--text-color: var(--bui-color-fg-subtle);
|
|
4
|
+
--count-bg-color: var(--bg-color, var(--bui-color-bg-default));
|
|
5
|
+
--count-text-color: var(--bui-color-fg-subtle);
|
|
6
|
+
background: var(--bui-color-bg-default);
|
|
7
|
+
font-family: var(--bui-font-family);
|
|
8
|
+
}
|
|
9
|
+
.bui-textarea textarea {
|
|
10
|
+
font-size: var(--bui-text-size-2);
|
|
11
|
+
color: var(--text-color);
|
|
12
|
+
line-height: var(--bui-line-height);
|
|
13
|
+
}
|
|
14
|
+
.bui-textarea .bui-mini-placeholder {
|
|
15
|
+
color: var(--bui-color-fg-disabled);
|
|
16
|
+
}
|
|
17
|
+
.bui-textarea-disabled {
|
|
18
|
+
pointer-events: none;
|
|
19
|
+
}
|
|
20
|
+
.bui-textarea .a-textarea-count-wrap {
|
|
21
|
+
display: none;
|
|
22
|
+
}
|
|
23
|
+
.bui-textarea-content {
|
|
24
|
+
width: 100%;
|
|
25
|
+
resize: none;
|
|
26
|
+
background: var(--bg-color);
|
|
27
|
+
padding: 8px;
|
|
28
|
+
border: none;
|
|
29
|
+
outline: none;
|
|
30
|
+
word-break: break-all;
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
}
|
|
33
|
+
.bui-textarea-content::placeholder {
|
|
34
|
+
color: var(--bui-color-fg-disabled);
|
|
35
|
+
line-height: 1.3;
|
|
36
|
+
}
|
|
37
|
+
.bui-textarea-count {
|
|
38
|
+
background: var(--count-bg-color);
|
|
39
|
+
color: var(--count-text-color);
|
|
40
|
+
text-align: right;
|
|
41
|
+
padding: 0 4px;
|
|
42
|
+
font-size: var(--bui-title-size-3);
|
|
43
|
+
}
|