@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,112 @@
|
|
|
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 = ["autoplay", "circular", "current", "displayMultipleItems", "duration", "interval", "spaceBetween", "vertical", "children", "indicatorDots", "indicatorColor", "indicatorActiveColor", "previousMargin", "nextMargin", "style", "className", "onChange", "onAnimationFinish"];
|
|
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 clsx from 'clsx';
|
|
12
|
+
import React, { forwardRef, useEffect, useRef } from 'react';
|
|
13
|
+
import { Autoplay, EffectFade, Pagination } from 'swiper';
|
|
14
|
+
import 'swiper/css';
|
|
15
|
+
import 'swiper/css/autoplay';
|
|
16
|
+
import 'swiper/css/pagination';
|
|
17
|
+
import 'swiper/css/effect-fade';
|
|
18
|
+
import { Swiper as SwiperReact } from 'swiper/react';
|
|
19
|
+
import "./Swiper.css";
|
|
20
|
+
var Swiper = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
21
|
+
var _props$autoplay = props.autoplay,
|
|
22
|
+
autoplay = _props$autoplay === void 0 ? false : _props$autoplay,
|
|
23
|
+
_props$circular = props.circular,
|
|
24
|
+
circular = _props$circular === void 0 ? false : _props$circular,
|
|
25
|
+
_props$current = props.current,
|
|
26
|
+
current = _props$current === void 0 ? 0 : _props$current,
|
|
27
|
+
_props$displayMultipl = props.displayMultipleItems,
|
|
28
|
+
displayMultipleItems = _props$displayMultipl === void 0 ? 1 : _props$displayMultipl,
|
|
29
|
+
_props$duration = props.duration,
|
|
30
|
+
duration = _props$duration === void 0 ? 500 : _props$duration,
|
|
31
|
+
_props$interval = props.interval,
|
|
32
|
+
interval = _props$interval === void 0 ? 5000 : _props$interval,
|
|
33
|
+
spaceBetween = props.spaceBetween,
|
|
34
|
+
vertical = props.vertical,
|
|
35
|
+
children = props.children,
|
|
36
|
+
indicatorDots = props.indicatorDots,
|
|
37
|
+
indicatorColor = props.indicatorColor,
|
|
38
|
+
indicatorActiveColor = props.indicatorActiveColor,
|
|
39
|
+
previousMargin = props.previousMargin,
|
|
40
|
+
nextMargin = props.nextMargin,
|
|
41
|
+
style = props.style,
|
|
42
|
+
className = props.className,
|
|
43
|
+
onChange = props.onChange,
|
|
44
|
+
onAnimationFinish = props.onAnimationFinish,
|
|
45
|
+
others = _objectWithoutProperties(props, _excluded);
|
|
46
|
+
var defaultIndicatorColor = indicatorColor || 'rgba(255, 255, 255, .4)';
|
|
47
|
+
var defaultIndicatorActiveColor = indicatorActiveColor || 'var(--bui-color-bg-view)';
|
|
48
|
+
var cls = clsx("bui-swiper", className);
|
|
49
|
+
var sty = _objectSpread({
|
|
50
|
+
paddingTop: vertical ? previousMargin : 0,
|
|
51
|
+
paddingRight: vertical ? 0 : nextMargin,
|
|
52
|
+
paddingBottom: vertical ? nextMargin : 0,
|
|
53
|
+
paddingLeft: vertical ? 0 : previousMargin,
|
|
54
|
+
overflow: 'hidden'
|
|
55
|
+
}, style);
|
|
56
|
+
var swiperInstance = useRef();
|
|
57
|
+
var isInit = useRef(true);
|
|
58
|
+
useEffect(function () {
|
|
59
|
+
var _swiperInstance$curre, _swiperInstance$curre2;
|
|
60
|
+
if (isInit.current) {
|
|
61
|
+
isInit.current = false;
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
swiperInstance === null || swiperInstance === void 0 || (_swiperInstance$curre = swiperInstance.current) === null || _swiperInstance$curre === void 0 || (_swiperInstance$curre2 = _swiperInstance$curre.slideTo) === null || _swiperInstance$curre2 === void 0 || _swiperInstance$curre2.call(_swiperInstance$curre, current);
|
|
65
|
+
}, [current]);
|
|
66
|
+
return /*#__PURE__*/React.createElement(SwiperReact, _extends({
|
|
67
|
+
modules: [Pagination, Autoplay, EffectFade],
|
|
68
|
+
loop: circular,
|
|
69
|
+
autoplay: autoplay ? {
|
|
70
|
+
delay: interval,
|
|
71
|
+
disableOnInteraction: false
|
|
72
|
+
} : false,
|
|
73
|
+
speed: duration,
|
|
74
|
+
slidesPerView: displayMultipleItems,
|
|
75
|
+
direction: vertical ? 'vertical' : 'horizontal',
|
|
76
|
+
pagination: indicatorDots ? {
|
|
77
|
+
clickable: true
|
|
78
|
+
} : false,
|
|
79
|
+
initialSlide: current,
|
|
80
|
+
onSlideChange: function onSlideChange(swiper) {
|
|
81
|
+
onChange === null || onChange === void 0 || onChange({
|
|
82
|
+
detail: {
|
|
83
|
+
current: swiper.realIndex
|
|
84
|
+
},
|
|
85
|
+
type: 'change',
|
|
86
|
+
target: swiper
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
onSlideChangeTransitionEnd: function onSlideChangeTransitionEnd(swiper) {
|
|
90
|
+
onAnimationFinish === null || onAnimationFinish === void 0 || onAnimationFinish({
|
|
91
|
+
detail: {
|
|
92
|
+
current: swiper.realIndex
|
|
93
|
+
},
|
|
94
|
+
type: 'animationfinish',
|
|
95
|
+
target: swiper
|
|
96
|
+
});
|
|
97
|
+
},
|
|
98
|
+
spaceBetween: spaceBetween
|
|
99
|
+
}, others, {
|
|
100
|
+
onSwiper: function onSwiper(o) {
|
|
101
|
+
swiperInstance.current = o;
|
|
102
|
+
},
|
|
103
|
+
style: _objectSpread(_objectSpread({}, sty), {}, {
|
|
104
|
+
'--indicator-color': defaultIndicatorColor,
|
|
105
|
+
'--indicator-color-active': defaultIndicatorActiveColor
|
|
106
|
+
}),
|
|
107
|
+
className: cls,
|
|
108
|
+
ref: ref
|
|
109
|
+
}), children);
|
|
110
|
+
});
|
|
111
|
+
Swiper.displayName = 'BuiSwiper';
|
|
112
|
+
export default Swiper;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { OverrideProps } from '@bifrostui/types';
|
|
2
|
+
import { SwiperProps as SwiperPropsH5 } from 'swiper/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export type SwiperProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
|
|
5
|
+
props: P & SwiperPropsH5 & {
|
|
6
|
+
/** 是否显示面板指示点
|
|
7
|
+
* @default false
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
indicatorDots?: boolean;
|
|
11
|
+
/** 指示点颜色
|
|
12
|
+
* @default "rgba(0, 0, 0, .3)"
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
indicatorColor?: string;
|
|
16
|
+
/** 当前选中的指示点颜色
|
|
17
|
+
* @default "#000000"
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
indicatorActiveColor?: string;
|
|
21
|
+
/** 是否自动切换
|
|
22
|
+
* @default false
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
autoplay?: boolean;
|
|
26
|
+
/** 当前所在滑块的 index
|
|
27
|
+
* @default 0
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
current?: number;
|
|
31
|
+
/** 当前所在滑块的 item-id ,不能与 current 被同时指定
|
|
32
|
+
* 仅小程序可用
|
|
33
|
+
* @default ""
|
|
34
|
+
*/
|
|
35
|
+
currentItemId?: string;
|
|
36
|
+
/** 自动切换时间间隔
|
|
37
|
+
* @default 5000
|
|
38
|
+
*
|
|
39
|
+
*/
|
|
40
|
+
interval?: number;
|
|
41
|
+
/** 滑动动画时长
|
|
42
|
+
* @default 500
|
|
43
|
+
*
|
|
44
|
+
*/
|
|
45
|
+
duration?: number;
|
|
46
|
+
/** 是否采用衔接滑动
|
|
47
|
+
* @default false
|
|
48
|
+
*
|
|
49
|
+
*/
|
|
50
|
+
circular?: boolean;
|
|
51
|
+
/** 滑动方向是否为纵向
|
|
52
|
+
* @default false
|
|
53
|
+
*
|
|
54
|
+
*/
|
|
55
|
+
vertical?: boolean;
|
|
56
|
+
/** 前边距,可用于露出前一项的一小部分,接受 px 和 rpx 值
|
|
57
|
+
* @default "0px"
|
|
58
|
+
*
|
|
59
|
+
*/
|
|
60
|
+
previousMargin?: string;
|
|
61
|
+
/** 后边距,可用于露出后一项的一小部分,接受 px 和 rpx 值
|
|
62
|
+
* @default "0px"
|
|
63
|
+
*
|
|
64
|
+
*/
|
|
65
|
+
nextMargin?: string;
|
|
66
|
+
/**
|
|
67
|
+
* 当 swiper-item 的个数大于等于 2,关闭 circular 并且开启 previous-margin 或 next-margin 的时候,可以指定这个边距是否应用到第一个、最后一个元素
|
|
68
|
+
* @default false
|
|
69
|
+
* 仅小程序可用
|
|
70
|
+
*/
|
|
71
|
+
snapToEdge?: boolean;
|
|
72
|
+
/** 同时显示的滑块数量
|
|
73
|
+
* @default 1
|
|
74
|
+
*
|
|
75
|
+
*/
|
|
76
|
+
displayMultipleItems?: number;
|
|
77
|
+
/** 是否跳过未显示的滑块布局,设为 true 可优化复杂情况下的滑动性能,但会丢失隐藏状态滑块的布局信息
|
|
78
|
+
* @default false
|
|
79
|
+
* 仅小程序可用
|
|
80
|
+
*/
|
|
81
|
+
skipHiddenItemLayout?: boolean;
|
|
82
|
+
/** 指定 swiper 切换缓动动画类型
|
|
83
|
+
* @default "default"
|
|
84
|
+
* 仅小程序可用
|
|
85
|
+
*/
|
|
86
|
+
easingFunction?: string;
|
|
87
|
+
/** 是否禁止用户 touch 操作
|
|
88
|
+
* @default false
|
|
89
|
+
* 仅小程序可用
|
|
90
|
+
*/
|
|
91
|
+
disableTouch?: boolean;
|
|
92
|
+
/** 是否启用缩放
|
|
93
|
+
* @default false
|
|
94
|
+
* 仅小程序可用
|
|
95
|
+
*/
|
|
96
|
+
zoom?: boolean;
|
|
97
|
+
/** 是否开启全屏
|
|
98
|
+
* @default false
|
|
99
|
+
* 仅小程序可用
|
|
100
|
+
*/
|
|
101
|
+
full?: boolean;
|
|
102
|
+
/** swiper-item 可见时的 class。
|
|
103
|
+
* 仅小程序可用
|
|
104
|
+
*/
|
|
105
|
+
activeClass?: string;
|
|
106
|
+
/** acceleration 设置为 {{true}} 时且处于滑动过程中,中间若干屏处于可见时的 class。
|
|
107
|
+
* 仅小程序可用
|
|
108
|
+
*/
|
|
109
|
+
changingClass?: string;
|
|
110
|
+
/** 当开启时,会根据滑动速度,连续滑动多屏。
|
|
111
|
+
* @default false
|
|
112
|
+
* 仅小程序可用
|
|
113
|
+
*/
|
|
114
|
+
acceleration?: string;
|
|
115
|
+
/** 是否禁用代码变动触发 swiper 切换时使用动画。
|
|
116
|
+
* @default false
|
|
117
|
+
* 仅小程序可用
|
|
118
|
+
*/
|
|
119
|
+
disableProgrammaticAnimation?: string;
|
|
120
|
+
/** 滑动距离阈值,当滑动距离超过阈值时进行 swiper-item 切换。
|
|
121
|
+
* 仅小程序可用
|
|
122
|
+
*/
|
|
123
|
+
swipeRatio?: string;
|
|
124
|
+
/** 滑动综合速度阈值,当超过阈值时进行 swiper-item 切换,数值越小越敏感。
|
|
125
|
+
* 仅小程序可用
|
|
126
|
+
*/
|
|
127
|
+
swipeSpeed?: string;
|
|
128
|
+
/** 计算用户手势时所依赖的滑动角度。角度根据 touchstart 事件和首次 touchmove 事件的坐标计算得出。数值越小越对用户的滑动方向准确度要求越高。
|
|
129
|
+
* 仅小程序可用
|
|
130
|
+
*/
|
|
131
|
+
touchAngle?: string;
|
|
132
|
+
/** 自动以指定滑块的高度为整个容器的高度。当 vertical 为 true 时,默认不调整。可选值为:
|
|
133
|
+
* 仅小程序可用
|
|
134
|
+
*/
|
|
135
|
+
adjustHeight?: 'first' | 'current' | 'highest' | 'none';
|
|
136
|
+
/** vertical 为 true 时强制使 adjust-height 生效。
|
|
137
|
+
* 仅小程序可用
|
|
138
|
+
*/
|
|
139
|
+
adjustVerticalHeight?: string;
|
|
140
|
+
/** 是否停止响应用户 touchmove 操作
|
|
141
|
+
* @default false
|
|
142
|
+
* 仅小程序可用
|
|
143
|
+
*/
|
|
144
|
+
disableTouchmove?: string;
|
|
145
|
+
/** 改变 current 时使用动画过渡
|
|
146
|
+
* 仅小程序可用
|
|
147
|
+
* @default true
|
|
148
|
+
*/
|
|
149
|
+
scrollWithAnimation?: boolean;
|
|
150
|
+
/** 缓存区域大小,值为 1 表示提前渲染上下各一屏区域(swiper 容器大小)
|
|
151
|
+
* 仅小程序可用
|
|
152
|
+
* @default 0
|
|
153
|
+
*/
|
|
154
|
+
cacheExtent?: number;
|
|
155
|
+
/** current 改变时会触发 change 事件
|
|
156
|
+
*
|
|
157
|
+
*/
|
|
158
|
+
onChange?: (e: object) => void;
|
|
159
|
+
/** swiper-item 的位置发生改变时会触发 transition 事件
|
|
160
|
+
* 仅小程序可用
|
|
161
|
+
*/
|
|
162
|
+
onTransition?: (e: object) => void;
|
|
163
|
+
/** 动画结束时会触发 animationfinish 事件
|
|
164
|
+
*
|
|
165
|
+
*/
|
|
166
|
+
onAnimationFinish?: (e: object) => void;
|
|
167
|
+
/** 动画结束时会触发 animationEnd 事件
|
|
168
|
+
* 仅小程序可用
|
|
169
|
+
*/
|
|
170
|
+
onAnimationEnd?: (e: object) => void;
|
|
171
|
+
};
|
|
172
|
+
defaultComponent: D;
|
|
173
|
+
}, D>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var _excluded = ["className", "style", "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 { SwiperSlide } from 'swiper/react';
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
var SwiperItem = function SwiperItem(props) {
|
|
9
|
+
var className = props.className,
|
|
10
|
+
style = props.style,
|
|
11
|
+
children = props.children,
|
|
12
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
13
|
+
var cls = clsx('swiper-slide', className);
|
|
14
|
+
return /*#__PURE__*/React.createElement(SwiperSlide, _extends({
|
|
15
|
+
className: cls,
|
|
16
|
+
style: style
|
|
17
|
+
}, restProps), children);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// make swiper happy
|
|
21
|
+
// child.type.displayName.includes('SwiperSlide');
|
|
22
|
+
// -> swiper/react/get-children.js
|
|
23
|
+
SwiperItem.displayName = 'BuiSwiperItem-SwiperSlide';
|
|
24
|
+
export default SwiperItem;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Swiper, SwiperItem } from '@tarojs/components';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
Swiper: import("react").ComponentType<import("@tarojs/components/types/Swiper").SwiperProps>;
|
|
5
|
+
SwiperItem: import("react").ComponentType<import("@tarojs/components/types/SwiperItem").SwiperItemProps>;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
export { Swiper, SwiperItem };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
.bui-switch {
|
|
2
|
+
--bg-color: #ccc;
|
|
3
|
+
position: relative;
|
|
4
|
+
display: inline-block;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
padding: 0;
|
|
7
|
+
vertical-align: middle;
|
|
8
|
+
border-radius: 15px;
|
|
9
|
+
background-color: var(--bg-color);
|
|
10
|
+
transition: all 0.3s cubic-bezier(0.35, 0, 0.25, 1);
|
|
11
|
+
font-family: var(--bui-font-family);
|
|
12
|
+
}
|
|
13
|
+
.bui-switch::after {
|
|
14
|
+
position: absolute;
|
|
15
|
+
left: 2px;
|
|
16
|
+
top: 2px;
|
|
17
|
+
border-radius: 50%;
|
|
18
|
+
background-color: #fff;
|
|
19
|
+
content: ' ';
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26);
|
|
22
|
+
transition: left 0.3s cubic-bezier(0.35, 0, 0.25, 1);
|
|
23
|
+
animation-timing-function: cubic-bezier(0.35, 0, 0.25, 1);
|
|
24
|
+
animation-duration: 0.3s;
|
|
25
|
+
}
|
|
26
|
+
.bui-switch:focus {
|
|
27
|
+
outline: none;
|
|
28
|
+
}
|
|
29
|
+
.bui-switch-small {
|
|
30
|
+
width: 24px;
|
|
31
|
+
height: 16px;
|
|
32
|
+
}
|
|
33
|
+
.bui-switch-small .bui-switch-inner {
|
|
34
|
+
left: calc(100% - 10px);
|
|
35
|
+
font-size: 9px;
|
|
36
|
+
}
|
|
37
|
+
.bui-switch-small::after {
|
|
38
|
+
width: 12px;
|
|
39
|
+
height: 12px;
|
|
40
|
+
left: 2px;
|
|
41
|
+
top: 2px;
|
|
42
|
+
}
|
|
43
|
+
.bui-switch-small.bui-switch-checked::after {
|
|
44
|
+
left: calc(100% - 14px);
|
|
45
|
+
}
|
|
46
|
+
.bui-switch-small.bui-switch-checked .bui-switch-inner {
|
|
47
|
+
left: 2px;
|
|
48
|
+
}
|
|
49
|
+
.bui-switch-medium {
|
|
50
|
+
width: 44px;
|
|
51
|
+
height: 22px;
|
|
52
|
+
}
|
|
53
|
+
.bui-switch-medium::after {
|
|
54
|
+
width: 18px;
|
|
55
|
+
height: 18px;
|
|
56
|
+
}
|
|
57
|
+
.bui-switch-medium.bui-switch-checked::after {
|
|
58
|
+
left: calc(100% - 20px);
|
|
59
|
+
}
|
|
60
|
+
.bui-switch-medium.bui-switch-checked .bui-switch-inner {
|
|
61
|
+
left: var(--bui-spacing-sm);
|
|
62
|
+
}
|
|
63
|
+
.bui-switch-large {
|
|
64
|
+
width: 51px;
|
|
65
|
+
height: 30px;
|
|
66
|
+
}
|
|
67
|
+
.bui-switch-large .bui-switch-inner {
|
|
68
|
+
left: calc(100% - 22px);
|
|
69
|
+
}
|
|
70
|
+
.bui-switch-large::after {
|
|
71
|
+
width: 24px;
|
|
72
|
+
height: 24px;
|
|
73
|
+
left: 3px;
|
|
74
|
+
top: 3px;
|
|
75
|
+
}
|
|
76
|
+
.bui-switch-large.bui-switch-checked::after {
|
|
77
|
+
left: calc(100% - 27px);
|
|
78
|
+
}
|
|
79
|
+
.bui-switch-large.bui-switch-checked .bui-switch-inner {
|
|
80
|
+
left: var(--bui-spacing-sm);
|
|
81
|
+
}
|
|
82
|
+
.bui-switch-primary.bui-switch-checked {
|
|
83
|
+
background-color: var(--bui-color-primary);
|
|
84
|
+
}
|
|
85
|
+
.bui-switch-info.bui-switch-checked {
|
|
86
|
+
background-color: var(--bui-color-info);
|
|
87
|
+
}
|
|
88
|
+
.bui-switch-success.bui-switch-checked {
|
|
89
|
+
background-color: var(--bui-color-success);
|
|
90
|
+
}
|
|
91
|
+
.bui-switch-warning.bui-switch-checked {
|
|
92
|
+
background-color: var(--bui-color-warning);
|
|
93
|
+
}
|
|
94
|
+
.bui-switch-danger.bui-switch-checked {
|
|
95
|
+
background-color: var(--bui-color-danger);
|
|
96
|
+
}
|
|
97
|
+
.bui-switch-inner {
|
|
98
|
+
position: absolute;
|
|
99
|
+
left: calc(100% - 20px);
|
|
100
|
+
color: var(--bui-color-white);
|
|
101
|
+
font-size: var(--bui-text-size-3);
|
|
102
|
+
height: 100%;
|
|
103
|
+
display: flex;
|
|
104
|
+
align-items: center;
|
|
105
|
+
}
|
|
106
|
+
.bui-switch-inner .bui-svg-icon {
|
|
107
|
+
position: absolute;
|
|
108
|
+
top: 50%;
|
|
109
|
+
transform: translateY(-50%);
|
|
110
|
+
}
|
|
111
|
+
.bui-switch-disabled {
|
|
112
|
+
pointer-events: none;
|
|
113
|
+
opacity: 0.5;
|
|
114
|
+
}
|
|
115
|
+
.bui-switch-disabled::after {
|
|
116
|
+
animation-name: none;
|
|
117
|
+
cursor: not-allowed;
|
|
118
|
+
}
|
|
119
|
+
.bui-switch-input {
|
|
120
|
+
opacity: 0;
|
|
121
|
+
width: 100%;
|
|
122
|
+
height: 100%;
|
|
123
|
+
margin: 0;
|
|
124
|
+
position: absolute;
|
|
125
|
+
z-index: 1;
|
|
126
|
+
cursor: pointer;
|
|
127
|
+
}
|
|
@@ -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", "checked", "defaultChecked", "inputProps", "inputRef", "name", "checkedChildren", "unCheckedChildren", "disabled", "size", "color", "onChange"];
|
|
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 _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; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
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); }
|
|
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 { useValue } from '@bifrostui/utils';
|
|
16
|
+
import clsx from 'clsx';
|
|
17
|
+
import React, { forwardRef } from 'react';
|
|
18
|
+
import "./Switch.css";
|
|
19
|
+
var prefixCls = 'bui-switch';
|
|
20
|
+
var Switch = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
21
|
+
var className = props.className,
|
|
22
|
+
checked = props.checked,
|
|
23
|
+
defaultChecked = props.defaultChecked,
|
|
24
|
+
inputProps = props.inputProps,
|
|
25
|
+
inputRef = props.inputRef,
|
|
26
|
+
name = props.name,
|
|
27
|
+
checkedChildren = props.checkedChildren,
|
|
28
|
+
unCheckedChildren = props.unCheckedChildren,
|
|
29
|
+
disabled = props.disabled,
|
|
30
|
+
size = props.size,
|
|
31
|
+
color = props.color,
|
|
32
|
+
onChange = props.onChange,
|
|
33
|
+
others = _objectWithoutProperties(props, _excluded);
|
|
34
|
+
var _useValue = useValue({
|
|
35
|
+
value: checked,
|
|
36
|
+
defaultValue: !!defaultChecked
|
|
37
|
+
}),
|
|
38
|
+
_useValue2 = _slicedToArray(_useValue, 2),
|
|
39
|
+
switchChecked = _useValue2[0],
|
|
40
|
+
triggerChange = _useValue2[1];
|
|
41
|
+
var changeAction = function changeAction(e, isChecked) {
|
|
42
|
+
// 同时支持defaultChecked和checked
|
|
43
|
+
triggerChange(e, isChecked);
|
|
44
|
+
onChange === null || onChange === void 0 || onChange(e, {
|
|
45
|
+
checked: isChecked
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
var handleChange = function handleChange(e) {
|
|
49
|
+
var _inputProps$onChange;
|
|
50
|
+
var isChecked = !switchChecked;
|
|
51
|
+
changeAction(e, isChecked);
|
|
52
|
+
inputProps === null || inputProps === void 0 || (_inputProps$onChange = inputProps.onChange) === null || _inputProps$onChange === void 0 || _inputProps$onChange.call(inputProps, e);
|
|
53
|
+
};
|
|
54
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
55
|
+
ref: ref,
|
|
56
|
+
className: clsx("".concat(prefixCls), "".concat(prefixCls, "-").concat(size), "".concat(prefixCls, "-").concat(color), _defineProperty(_defineProperty({}, "".concat(prefixCls, "-checked"), switchChecked), "".concat(prefixCls, "-disabled"), disabled), className)
|
|
57
|
+
}, others), /*#__PURE__*/React.createElement("input", _extends({
|
|
58
|
+
ref: inputRef,
|
|
59
|
+
type: "checkbox",
|
|
60
|
+
name: name,
|
|
61
|
+
checked: switchChecked,
|
|
62
|
+
disabled: disabled
|
|
63
|
+
}, inputProps, {
|
|
64
|
+
onChange: handleChange,
|
|
65
|
+
className: clsx("".concat(prefixCls, "-input"), inputProps === null || inputProps === void 0 ? void 0 : inputProps.className)
|
|
66
|
+
})), (checkedChildren || unCheckedChildren) && /*#__PURE__*/React.createElement("span", {
|
|
67
|
+
className: "".concat(prefixCls, "-inner")
|
|
68
|
+
}, switchChecked ? checkedChildren : unCheckedChildren));
|
|
69
|
+
});
|
|
70
|
+
Switch.displayName = 'BuiSwitch';
|
|
71
|
+
Switch.defaultProps = {
|
|
72
|
+
disabled: false,
|
|
73
|
+
size: 'medium',
|
|
74
|
+
color: 'primary'
|
|
75
|
+
};
|
|
76
|
+
export default Switch;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { OverrideProps, ThemeColor } from '@bifrostui/types';
|
|
2
|
+
import React, { ReactNode } from 'react';
|
|
3
|
+
export type SwitchProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
|
|
4
|
+
props: P & {
|
|
5
|
+
/**
|
|
6
|
+
* 是否选中
|
|
7
|
+
*/
|
|
8
|
+
checked?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* 默认是否选中,当组件非受控时使用
|
|
11
|
+
*/
|
|
12
|
+
defaultChecked?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* 内部<input>标签的ref
|
|
15
|
+
*/
|
|
16
|
+
inputRef?: React.Ref<HTMLInputElement>;
|
|
17
|
+
/**
|
|
18
|
+
* <input>名称标识
|
|
19
|
+
*/
|
|
20
|
+
name?: string;
|
|
21
|
+
/**
|
|
22
|
+
* 内部<input>标签的标准属性
|
|
23
|
+
*/
|
|
24
|
+
inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
|
|
25
|
+
/**
|
|
26
|
+
* 选中时的内容
|
|
27
|
+
*/
|
|
28
|
+
checkedChildren?: ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* 未选中时的内容
|
|
31
|
+
*/
|
|
32
|
+
unCheckedChildren?: ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* 是否禁用
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* 大小 'small' | 'medium' | 'large'
|
|
40
|
+
* @default 'medium'
|
|
41
|
+
*/
|
|
42
|
+
size?: 'small' | 'medium' | 'large';
|
|
43
|
+
/**
|
|
44
|
+
* 颜色 'primary' | 'info' | 'success' | 'warning' | 'danger';
|
|
45
|
+
* @default 'primary'
|
|
46
|
+
*/
|
|
47
|
+
color?: ThemeColor;
|
|
48
|
+
/**
|
|
49
|
+
* 变化时的回调函数
|
|
50
|
+
*/
|
|
51
|
+
onChange?: (e: React.SyntheticEvent, data: {
|
|
52
|
+
checked: boolean;
|
|
53
|
+
}) => void;
|
|
54
|
+
};
|
|
55
|
+
defaultComponent: D;
|
|
56
|
+
}, D>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|