sard 1.0.0-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion/Item.d.ts +17 -0
- package/dist/accordion/Item.js +25 -0
- package/dist/accordion/index.d.ts +26 -0
- package/dist/accordion/index.js +27 -0
- package/dist/accordion/index.scss +49 -0
- package/dist/action-sheet/ActionSheet.d.ts +24 -0
- package/dist/action-sheet/ActionSheet.js +79 -0
- package/dist/action-sheet/Agent.d.ts +6 -0
- package/dist/action-sheet/Agent.js +7 -0
- package/dist/action-sheet/Item.d.ts +16 -0
- package/dist/action-sheet/Item.js +22 -0
- package/dist/action-sheet/imperative.d.ts +10 -0
- package/dist/action-sheet/imperative.js +22 -0
- package/dist/action-sheet/index.d.ts +12 -0
- package/dist/action-sheet/index.js +10 -0
- package/dist/action-sheet/index.scss +148 -0
- package/dist/animated/index.d.ts +62 -0
- package/dist/animated/index.js +101 -0
- package/dist/animated/index.rn.d.ts +4 -0
- package/dist/animated/index.rn.js +35 -0
- package/dist/avatar/Group.d.ts +9 -0
- package/dist/avatar/Group.js +27 -0
- package/dist/avatar/index.d.ts +17 -0
- package/dist/avatar/index.js +22 -0
- package/dist/avatar/index.scss +82 -0
- package/dist/badge/index.d.ts +13 -0
- package/dist/badge/index.js +16 -0
- package/dist/badge/index.scss +81 -0
- package/dist/base.d.ts +11 -0
- package/dist/base.js +1 -0
- package/dist/button/CustomButton.d.ts +9 -0
- package/dist/button/CustomButton.js +23 -0
- package/dist/button/index.d.ts +21 -0
- package/dist/button/index.js +34 -0
- package/dist/button/index.scss +346 -0
- package/dist/calendar/Day.d.ts +23 -0
- package/dist/calendar/Day.js +70 -0
- package/dist/calendar/MonthPicker.d.ts +13 -0
- package/dist/calendar/MonthPicker.js +22 -0
- package/dist/calendar/Toolbar.d.ts +11 -0
- package/dist/calendar/Toolbar.js +18 -0
- package/dist/calendar/Weeks.d.ts +6 -0
- package/dist/calendar/Weeks.js +18 -0
- package/dist/calendar/index.d.ts +48 -0
- package/dist/calendar/index.js +193 -0
- package/dist/calendar/index.scss +210 -0
- package/dist/card/index.d.ts +15 -0
- package/dist/card/index.js +14 -0
- package/dist/card/index.scss +64 -0
- package/dist/cascader/index.d.ts +43 -0
- package/dist/cascader/index.js +216 -0
- package/dist/cascader/index.scss +130 -0
- package/dist/checkbox/Group.d.ts +5 -0
- package/dist/checkbox/Group.js +5 -0
- package/dist/checkbox/index.d.ts +10 -0
- package/dist/checkbox/index.js +8 -0
- package/dist/checkbox/index.scss +78 -0
- package/dist/collapse/index.d.ts +14 -0
- package/dist/collapse/index.js +61 -0
- package/dist/collapse/index.rn.d.ts +14 -0
- package/dist/collapse/index.rn.js +76 -0
- package/dist/collapse/index.scss +31 -0
- package/dist/components.d.ts +66 -0
- package/dist/components.js +66 -0
- package/dist/components.scss +65 -0
- package/dist/config-provider/index.d.ts +21 -0
- package/dist/config-provider/index.js +20 -0
- package/dist/count-down/index.d.ts +26 -0
- package/dist/count-down/index.js +95 -0
- package/dist/datetime-picker/index.d.ts +36 -0
- package/dist/datetime-picker/index.js +230 -0
- package/dist/dialog/Agent.d.ts +6 -0
- package/dist/dialog/Agent.js +7 -0
- package/dist/dialog/Dialog.d.ts +31 -0
- package/dist/dialog/Dialog.js +103 -0
- package/dist/dialog/imperative.d.ts +17 -0
- package/dist/dialog/imperative.js +35 -0
- package/dist/dialog/index.d.ts +14 -0
- package/dist/dialog/index.js +12 -0
- package/dist/dialog/index.scss +156 -0
- package/dist/dropdown/Item.d.ts +33 -0
- package/dist/dropdown/Item.js +164 -0
- package/dist/dropdown/Option.d.ts +10 -0
- package/dist/dropdown/Option.js +12 -0
- package/dist/dropdown/index.d.ts +20 -0
- package/dist/dropdown/index.js +59 -0
- package/dist/dropdown/index.scss +236 -0
- package/dist/ellipsis/index.d.ts +8 -0
- package/dist/ellipsis/index.js +18 -0
- package/dist/ellipsis/index.scss +23 -0
- package/dist/empty/index.d.ts +10 -0
- package/dist/empty/index.js +14 -0
- package/dist/empty/index.scss +59 -0
- package/dist/footer-bar/index.d.ts +8 -0
- package/dist/footer-bar/index.js +15 -0
- package/dist/footer-bar/index.scss +29 -0
- package/dist/form/CustomForm.d.ts +13 -0
- package/dist/form/CustomForm.js +26 -0
- package/dist/form/ErrorList.d.ts +6 -0
- package/dist/form/ErrorList.js +15 -0
- package/dist/form/Field.d.ts +41 -0
- package/dist/form/Field.js +124 -0
- package/dist/form/FieldContext.d.ts +18 -0
- package/dist/form/FieldContext.js +8 -0
- package/dist/form/List.d.ts +31 -0
- package/dist/form/List.js +87 -0
- package/dist/form/Map.d.ts +17 -0
- package/dist/form/Map.js +24 -0
- package/dist/form/NodeContext.d.ts +12 -0
- package/dist/form/NodeContext.js +14 -0
- package/dist/form/Validator.d.ts +88 -0
- package/dist/form/Validator.js +268 -0
- package/dist/form/createFormStore.d.ts +36 -0
- package/dist/form/createFormStore.js +249 -0
- package/dist/form/index.d.ts +43 -0
- package/dist/form/index.js +109 -0
- package/dist/form/index.scss +200 -0
- package/dist/form/store/Context.d.ts +4 -0
- package/dist/form/store/Context.js +3 -0
- package/dist/form/store/createStore.d.ts +6 -0
- package/dist/form/store/createStore.js +28 -0
- package/dist/form/store/useDispatch.d.ts +2 -0
- package/dist/form/store/useDispatch.js +10 -0
- package/dist/form/store/useSelector.d.ts +7 -0
- package/dist/form/store/useSelector.js +35 -0
- package/dist/form/type.d.ts +20 -0
- package/dist/form/type.js +1 -0
- package/dist/form/useForm.d.ts +27 -0
- package/dist/form/useForm.js +14 -0
- package/dist/form/useInternalWatch.d.ts +3 -0
- package/dist/form/useInternalWatch.js +27 -0
- package/dist/form/useNode.d.ts +49 -0
- package/dist/form/useNode.js +284 -0
- package/dist/form/useValidator.d.ts +23 -0
- package/dist/form/useValidator.js +74 -0
- package/dist/form/useWatch.d.ts +4 -0
- package/dist/form/useWatch.js +24 -0
- package/dist/grid/Col.d.ts +9 -0
- package/dist/grid/Col.js +20 -0
- package/dist/grid/Row.d.ts +11 -0
- package/dist/grid/Row.js +34 -0
- package/dist/grid/index.d.ts +2 -0
- package/dist/grid/index.js +2 -0
- package/dist/grid/index.scss +56 -0
- package/dist/halfline/index.d.ts +10 -0
- package/dist/halfline/index.js +27 -0
- package/dist/halfline/index.scss +80 -0
- package/dist/icon/common.d.ts +15 -0
- package/dist/icon/common.js +1 -0
- package/dist/icon/font/iconfont.json +275 -0
- package/dist/icon/font/iconfont.rn.scss +0 -0
- package/dist/icon/font/iconfont.scss +164 -0
- package/dist/icon/font/iconfont.ttf +0 -0
- package/dist/icon/fontLoader.d.ts +7 -0
- package/dist/icon/fontLoader.js +14 -0
- package/dist/icon/fontLoader.rn.d.ts +6 -0
- package/dist/icon/fontLoader.rn.js +52 -0
- package/dist/icon/index.d.ts +21 -0
- package/dist/icon/index.js +41 -0
- package/dist/icon/index.scss +23 -0
- package/dist/index-bar/Item.d.ts +9 -0
- package/dist/index-bar/Item.js +11 -0
- package/dist/index-bar/Nav.d.ts +13 -0
- package/dist/index-bar/Nav.js +75 -0
- package/dist/index-bar/index.d.ts +19 -0
- package/dist/index-bar/index.js +142 -0
- package/dist/index-bar/index.scss +153 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/index.scss +1 -0
- package/dist/input/index.d.ts +37 -0
- package/dist/input/index.js +116 -0
- package/dist/input/index.scss +249 -0
- package/dist/linear-gradient/index.d.ts +14 -0
- package/dist/linear-gradient/index.js +30 -0
- package/dist/linear-gradient/index.rn.d.ts +3 -0
- package/dist/linear-gradient/index.rn.js +3 -0
- package/dist/list/Item.d.ts +22 -0
- package/dist/list/Item.js +26 -0
- package/dist/list/ListContext.d.ts +9 -0
- package/dist/list/ListContext.js +2 -0
- package/dist/list/OrderContext.d.ts +8 -0
- package/dist/list/OrderContext.js +6 -0
- package/dist/list/index.d.ts +19 -0
- package/dist/list/index.js +29 -0
- package/dist/list/index.scss +257 -0
- package/dist/loading/index.d.ts +10 -0
- package/dist/loading/index.js +47 -0
- package/dist/loading/index.scss +25 -0
- package/dist/locale/index.d.ts +199 -0
- package/dist/locale/index.js +36 -0
- package/dist/locale/lang/en-US.d.ts +92 -0
- package/dist/locale/lang/en-US.js +92 -0
- package/dist/locale/lang/zh-CN.d.ts +92 -0
- package/dist/locale/lang/zh-CN.js +92 -0
- package/dist/locale/useTranslate.d.ts +7 -0
- package/dist/locale/useTranslate.js +41 -0
- package/dist/mask/index.d.ts +13 -0
- package/dist/mask/index.js +26 -0
- package/dist/mask/index.scss +24 -0
- package/dist/menu/Item.d.ts +15 -0
- package/dist/menu/Item.js +17 -0
- package/dist/menu/index.d.ts +17 -0
- package/dist/menu/index.js +15 -0
- package/dist/menu/index.scss +128 -0
- package/dist/mesh/Item.d.ts +16 -0
- package/dist/mesh/Item.js +16 -0
- package/dist/mesh/index.d.ts +14 -0
- package/dist/mesh/index.js +69 -0
- package/dist/mesh/index.scss +131 -0
- package/dist/mesh/type.d.ts +9 -0
- package/dist/mesh/type.js +1 -0
- package/dist/modal/index.d.ts +8 -0
- package/dist/modal/index.js +9 -0
- package/dist/modal/index.rn.d.ts +8 -0
- package/dist/modal/index.rn.js +8 -0
- package/dist/navbar/Item.d.ts +8 -0
- package/dist/navbar/Item.js +11 -0
- package/dist/navbar/index.d.ts +15 -0
- package/dist/navbar/index.js +16 -0
- package/dist/navbar/index.scss +128 -0
- package/dist/notice-bar/index.d.ts +28 -0
- package/dist/notice-bar/index.js +135 -0
- package/dist/notice-bar/index.scss +109 -0
- package/dist/notify/Agent.d.ts +6 -0
- package/dist/notify/Agent.js +7 -0
- package/dist/notify/Notify.d.ts +22 -0
- package/dist/notify/Notify.js +48 -0
- package/dist/notify/imperative.d.ts +18 -0
- package/dist/notify/imperative.js +35 -0
- package/dist/notify/index.d.ts +15 -0
- package/dist/notify/index.js +13 -0
- package/dist/notify/index.scss +65 -0
- package/dist/number-keyboard/index.d.ts +10 -0
- package/dist/number-keyboard/index.js +51 -0
- package/dist/number-keyboard/index.scss +93 -0
- package/dist/pagination/index.d.ts +20 -0
- package/dist/pagination/index.js +65 -0
- package/dist/pagination/index.scss +131 -0
- package/dist/pan-gesture-detector/index.d.ts +8 -0
- package/dist/pan-gesture-detector/index.js +11 -0
- package/dist/pan-gesture-detector/index.rn.d.ts +8 -0
- package/dist/pan-gesture-detector/index.rn.js +23 -0
- package/dist/pan-gesture-detector/usePan.d.ts +47 -0
- package/dist/pan-gesture-detector/usePan.js +146 -0
- package/dist/password-input/index.d.ts +22 -0
- package/dist/password-input/index.js +91 -0
- package/dist/password-input/index.scss +189 -0
- package/dist/picker/InertialMotion.d.ts +20 -0
- package/dist/picker/InertialMotion.js +141 -0
- package/dist/picker/PickerView.d.ts +1 -0
- package/dist/picker/PickerView.h5.d.ts +17 -0
- package/dist/picker/PickerView.h5.js +36 -0
- package/dist/picker/PickerView.js +1 -0
- package/dist/picker/PickerViewColumn copy.d.ts +9 -0
- package/dist/picker/PickerViewColumn copy.js +143 -0
- package/dist/picker/PickerViewColumn.d.ts +12 -0
- package/dist/picker/PickerViewColumn.js +238 -0
- package/dist/picker/index.d.ts +38 -0
- package/dist/picker/index.js +224 -0
- package/dist/picker/index.rn.scss +0 -0
- package/dist/picker/index.scss +138 -0
- package/dist/popout/index.d.ts +25 -0
- package/dist/popout/index.js +87 -0
- package/dist/popout/index.scss +136 -0
- package/dist/popout-input/index.d.ts +29 -0
- package/dist/popout-input/index.js +91 -0
- package/dist/popout-input/index.scss +53 -0
- package/dist/popover/index.d.ts +35 -0
- package/dist/popover/index.js +193 -0
- package/dist/popover/index.scss +94 -0
- package/dist/popover/utils.d.ts +23 -0
- package/dist/popover/utils.js +124 -0
- package/dist/popup/index.d.ts +29 -0
- package/dist/popup/index.js +60 -0
- package/dist/popup/index.scss +60 -0
- package/dist/pressable/index.d.ts +13 -0
- package/dist/pressable/index.js +58 -0
- package/dist/pressable/index.rn.d.ts +13 -0
- package/dist/pressable/index.rn.js +50 -0
- package/dist/progress-bar/index.d.ts +10 -0
- package/dist/progress-bar/index.js +22 -0
- package/dist/progress-bar/index.scss +45 -0
- package/dist/progress-circle/index.d.ts +11 -0
- package/dist/progress-circle/index.js +54 -0
- package/dist/progress-circle/index.scss +141 -0
- package/dist/radio/Group.d.ts +5 -0
- package/dist/radio/Group.js +5 -0
- package/dist/radio/index.d.ts +10 -0
- package/dist/radio/index.js +8 -0
- package/dist/radio/index.scss +77 -0
- package/dist/rate/index.d.ts +23 -0
- package/dist/rate/index.js +116 -0
- package/dist/rate/index.scss +99 -0
- package/dist/result/index.d.ts +12 -0
- package/dist/result/index.js +19 -0
- package/dist/result/index.scss +88 -0
- package/dist/safe-area/index.d.ts +7 -0
- package/dist/safe-area/index.js +35 -0
- package/dist/safe-area/index.scss +24 -0
- package/dist/scroll-view/index.d.ts +24 -0
- package/dist/scroll-view/index.js +72 -0
- package/dist/scroll-view/index.rn.d.ts +21 -0
- package/dist/scroll-view/index.rn.js +51 -0
- package/dist/search/index.d.ts +26 -0
- package/dist/search/index.js +35 -0
- package/dist/search/index.scss +75 -0
- package/dist/share-sheet/Item.d.ts +15 -0
- package/dist/share-sheet/Item.js +26 -0
- package/dist/share-sheet/Row.d.ts +10 -0
- package/dist/share-sheet/Row.js +26 -0
- package/dist/share-sheet/index.d.ts +26 -0
- package/dist/share-sheet/index.js +76 -0
- package/dist/share-sheet/index.scss +230 -0
- package/dist/skeleton/Avatar.d.ts +7 -0
- package/dist/skeleton/Avatar.js +17 -0
- package/dist/skeleton/Block.d.ts +8 -0
- package/dist/skeleton/Block.js +44 -0
- package/dist/skeleton/Paragraph.d.ts +7 -0
- package/dist/skeleton/Paragraph.js +13 -0
- package/dist/skeleton/Title.d.ts +7 -0
- package/dist/skeleton/Title.js +16 -0
- package/dist/skeleton/index.d.ts +28 -0
- package/dist/skeleton/index.js +22 -0
- package/dist/skeleton/index.scss +108 -0
- package/dist/slider/index.d.ts +36 -0
- package/dist/slider/index.js +187 -0
- package/dist/slider/index.scss +138 -0
- package/dist/space/index.d.ts +13 -0
- package/dist/space/index.js +33 -0
- package/dist/space/index.scss +36 -0
- package/dist/stepper/index.d.ts +26 -0
- package/dist/stepper/index.js +138 -0
- package/dist/stepper/index.scss +106 -0
- package/dist/steps/Step.d.ts +23 -0
- package/dist/steps/Step.js +41 -0
- package/dist/steps/index.d.ts +23 -0
- package/dist/steps/index.js +38 -0
- package/dist/steps/index.scss +300 -0
- package/dist/style/base.scss +3 -0
- package/dist/style/functions.scss +54 -0
- package/dist/style/index.d.ts +2 -0
- package/dist/style/index.js +2 -0
- package/dist/style/index.scss +0 -0
- package/dist/style/mixins/bem.scss +63 -0
- package/dist/style/mixins/border.scss +80 -0
- package/dist/style/mixins/disabled.scss +9 -0
- package/dist/style/mixins/env.rn.scss +11 -0
- package/dist/style/mixins/env.scss +11 -0
- package/dist/style/mixins/fixed.rn.scss +3 -0
- package/dist/style/mixins/fixed.scss +3 -0
- package/dist/style/mixins/sticky.rn.scss +3 -0
- package/dist/style/mixins/sticky.scss +3 -0
- package/dist/style/mixins/theme.scss +11 -0
- package/dist/style/mixins/universal.rn.scss +2 -0
- package/dist/style/mixins/universal.scss +6 -0
- package/dist/style/mixins.scss +8 -0
- package/dist/style/utils.scss +130 -0
- package/dist/style/variables.scss +422 -0
- package/dist/swiper/Item.d.ts +8 -0
- package/dist/swiper/Item.js +10 -0
- package/dist/swiper/index.d.ts +12 -0
- package/dist/swiper/index.js +13 -0
- package/dist/swiper/index.scss +10 -0
- package/dist/switch/index.d.ts +19 -0
- package/dist/switch/index.js +78 -0
- package/dist/switch/index.scss +106 -0
- package/dist/tabbar/Item.d.ts +17 -0
- package/dist/tabbar/Item.js +24 -0
- package/dist/tabbar/index.d.ts +17 -0
- package/dist/tabbar/index.js +33 -0
- package/dist/tabbar/index.scss +89 -0
- package/dist/tabs/Tab.d.ts +12 -0
- package/dist/tabs/Tab.js +17 -0
- package/dist/tabs/index.d.ts +23 -0
- package/dist/tabs/index.js +258 -0
- package/dist/tabs/index.scss +113 -0
- package/dist/tag/index.d.ts +17 -0
- package/dist/tag/index.js +21 -0
- package/dist/tag/index.scss +93 -0
- package/dist/template/index.d.ts +6 -0
- package/dist/template/index.js +10 -0
- package/dist/template/index.scss +16 -0
- package/dist/toast/Agent.d.ts +6 -0
- package/dist/toast/Agent.js +7 -0
- package/dist/toast/Toast.d.ts +24 -0
- package/dist/toast/Toast.js +43 -0
- package/dist/toast/imperative.d.ts +18 -0
- package/dist/toast/imperative.js +35 -0
- package/dist/toast/index.d.ts +15 -0
- package/dist/toast/index.js +13 -0
- package/dist/toast/index.scss +96 -0
- package/dist/transition/CSSTransition.d.ts +7 -0
- package/dist/transition/CSSTransition.js +49 -0
- package/dist/transition/CSSTransition.rn.d.ts +7 -0
- package/dist/transition/CSSTransition.rn.js +312 -0
- package/dist/transition/index.d.ts +43 -0
- package/dist/transition/index.js +156 -0
- package/dist/transition/index.rn.scss +0 -0
- package/dist/transition/index.scss +158 -0
- package/dist/upload/Preview.d.ts +35 -0
- package/dist/upload/Preview.js +41 -0
- package/dist/upload/PreviewVideo.d.ts +7 -0
- package/dist/upload/PreviewVideo.js +38 -0
- package/dist/upload/PreviewVideo.rn.d.ts +6 -0
- package/dist/upload/PreviewVideo.rn.js +24 -0
- package/dist/upload/chooseMedia.d.ts +26 -0
- package/dist/upload/chooseMedia.h5.d.ts +25 -0
- package/dist/upload/chooseMedia.h5.js +117 -0
- package/dist/upload/chooseMedia.js +55 -0
- package/dist/upload/index.d.ts +37 -0
- package/dist/upload/index.js +167 -0
- package/dist/upload/index.scss +247 -0
- package/dist/use/index.d.ts +20 -0
- package/dist/use/index.js +20 -0
- package/dist/use/useAutoplay.d.ts +1 -0
- package/dist/use/useAutoplay.js +34 -0
- package/dist/use/useBem.d.ts +9 -0
- package/dist/use/useBem.js +52 -0
- package/dist/use/useBrush.d.ts +23 -0
- package/dist/use/useBrush.js +61 -0
- package/dist/use/useControllableValue.d.ts +12 -0
- package/dist/use/useControllableValue.js +59 -0
- package/dist/use/useEvent.d.ts +4 -0
- package/dist/use/useEvent.js +12 -0
- package/dist/use/useForceRender.d.ts +5 -0
- package/dist/use/useForceRender.js +8 -0
- package/dist/use/useIndexableMap.d.ts +21 -0
- package/dist/use/useIndexableMap.js +65 -0
- package/dist/use/useInertRef.d.ts +7 -0
- package/dist/use/useInertRef.js +15 -0
- package/dist/use/useInternalSelect.d.ts +42 -0
- package/dist/use/useInternalSelect.js +64 -0
- package/dist/use/useLayoutUpdateEffect.d.ts +5 -0
- package/dist/use/useLayoutUpdateEffect.js +18 -0
- package/dist/use/usePropRef.d.ts +5 -0
- package/dist/use/usePropRef.js +9 -0
- package/dist/use/useResize.d.ts +2 -0
- package/dist/use/useResize.js +14 -0
- package/dist/use/useResizeObserver.d.ts +5 -0
- package/dist/use/useResizeObserver.js +38 -0
- package/dist/use/useSelect.d.ts +15 -0
- package/dist/use/useSelect.js +56 -0
- package/dist/use/useSelectorId.d.ts +1 -0
- package/dist/use/useSelectorId.js +5 -0
- package/dist/use/useSetTimeout.d.ts +10 -0
- package/dist/use/useSetTimeout.js +34 -0
- package/dist/use/useStopMovePropagate.d.ts +5 -0
- package/dist/use/useStopMovePropagate.js +28 -0
- package/dist/use/useThrottle.d.ts +8 -0
- package/dist/use/useThrottle.js +11 -0
- package/dist/use/useUpdateEffect.d.ts +5 -0
- package/dist/use/useUpdateEffect.js +18 -0
- package/dist/use/useUpdateWatchSync.d.ts +5 -0
- package/dist/use/useUpdateWatchSync.js +18 -0
- package/dist/use/useWatchStateSync.d.ts +4 -0
- package/dist/use/useWatchStateSync.js +18 -0
- package/dist/utils/animate.d.ts +28 -0
- package/dist/utils/animate.js +81 -0
- package/dist/utils/createPubSub.d.ts +8 -0
- package/dist/utils/createPubSub.js +53 -0
- package/dist/utils/date.d.ts +13 -0
- package/dist/utils/date.js +87 -0
- package/dist/utils/dom.d.ts +149 -0
- package/dist/utils/dom.js +297 -0
- package/dist/utils/file.d.ts +18 -0
- package/dist/utils/file.js +57 -0
- package/dist/utils/imperative.d.ts +20 -0
- package/dist/utils/imperative.js +37 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.js +7 -0
- package/dist/utils/is.d.ts +16 -0
- package/dist/utils/is.js +57 -0
- package/dist/utils/measure.d.ts +8 -0
- package/dist/utils/measure.js +13 -0
- package/dist/utils/measure.rn.d.ts +8 -0
- package/dist/utils/measure.rn.js +15 -0
- package/dist/utils/platform.android.d.ts +2 -0
- package/dist/utils/platform.android.js +2 -0
- package/dist/utils/platform.d.ts +2 -0
- package/dist/utils/platform.ios.d.ts +2 -0
- package/dist/utils/platform.ios.js +2 -0
- package/dist/utils/platform.js +2 -0
- package/dist/utils/style.d.ts +10 -0
- package/dist/utils/style.js +34 -0
- package/dist/utils/utils.d.ts +199 -0
- package/dist/utils/utils.js +639 -0
- package/package.json +30 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
@import '../style/base.scss';
|
|
2
|
+
// #variables
|
|
3
|
+
$sar-search-padding-x: 12px !default;
|
|
4
|
+
$sar-search-padding-y: 10px !default;
|
|
5
|
+
$sar-search-bg-color: $sar-emphasis-bg-color !default;
|
|
6
|
+
|
|
7
|
+
$sar-search-input-bg-color: $sar-body-bg-color !default;
|
|
8
|
+
$sar-search-input-disabled-bg-color: $sar-disabled-shallow-bg-color !default;
|
|
9
|
+
$sar-search-icon-color: $sar-quaternary-color !default;
|
|
10
|
+
|
|
11
|
+
// 暗黑模式
|
|
12
|
+
$sar-search-dark-bg-color: $sar-dark-emphasis-bg-color !default;
|
|
13
|
+
$sar-search-input-dark-bg-color: $sar-dark-body-bg-color !default;
|
|
14
|
+
$sar-search-input-disabled-dark-bg-color: $sar-dark-disabled-shallow-bg-color !default;
|
|
15
|
+
$sar-search-icon-dark-color: $sar-dark-quaternary-color !default;
|
|
16
|
+
// #endvariables
|
|
17
|
+
|
|
18
|
+
@include bem(search) {
|
|
19
|
+
@include b() {
|
|
20
|
+
@include universal;
|
|
21
|
+
flex-direction: row;
|
|
22
|
+
align-items: stretch;
|
|
23
|
+
padding: $sar-search-padding-y $sar-search-padding-x;
|
|
24
|
+
background-color: $sar-search-bg-color;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@include m(show-action) {
|
|
28
|
+
padding-right: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@include e(input-wrapper) {
|
|
32
|
+
flex: 1;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@include e(input) {
|
|
36
|
+
background-color: $sar-search-input-bg-color;
|
|
37
|
+
|
|
38
|
+
@include m(round) {
|
|
39
|
+
border-radius: $sar-rounded-full;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@include m(disabled) {
|
|
43
|
+
background-color: $sar-search-input-disabled-bg-color;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@include e(button) {
|
|
48
|
+
height: auto;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@include e(icon) {
|
|
52
|
+
@include universal;
|
|
53
|
+
color: $sar-search-icon-color;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@include theme(dark) {
|
|
58
|
+
@include bem(search) {
|
|
59
|
+
@include b() {
|
|
60
|
+
background-color: $sar-search-dark-bg-color;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@include e(input) {
|
|
64
|
+
background-color: $sar-search-input-dark-bg-color;
|
|
65
|
+
|
|
66
|
+
@include m(disabled) {
|
|
67
|
+
background-color: $sar-search-input-disabled-dark-bg-color;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@include e(icon) {
|
|
72
|
+
color: $sar-search-icon-dark-color;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { ITouchEvent } from '@tarojs/components';
|
|
3
|
+
import { IconProps } from '../icon';
|
|
4
|
+
import { BaseProps } from '../base';
|
|
5
|
+
export interface ShareSheetItemProps extends BaseProps {
|
|
6
|
+
name?: ReactNode;
|
|
7
|
+
label?: ReactNode;
|
|
8
|
+
color?: string;
|
|
9
|
+
background?: string;
|
|
10
|
+
icon?: IconProps | string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
onClick?: (event: ITouchEvent) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const ShareSheetItem: FC<ShareSheetItemProps>;
|
|
15
|
+
export default ShareSheetItem;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { Image, View } from '@tarojs/components';
|
|
5
|
+
import { Icon } from '../icon';
|
|
6
|
+
import { filterNullish, isFileUrl, isNumber, isString } from '../utils';
|
|
7
|
+
import { useBem, useEvent } from '../use';
|
|
8
|
+
import Pressable from '../pressable';
|
|
9
|
+
export const ShareSheetItem = (props) => {
|
|
10
|
+
const { className, style, children, name, label, color, background, icon, disabled, onClick, ...restProps } = props;
|
|
11
|
+
const [bem] = useBem('share-sheet');
|
|
12
|
+
const isImg = useMemo(() => {
|
|
13
|
+
return isNumber(icon) || (isString(icon) && isFileUrl(icon));
|
|
14
|
+
}, [icon]);
|
|
15
|
+
const handleClick = useEvent((event) => {
|
|
16
|
+
if (!disabled) {
|
|
17
|
+
onClick?.(event);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
return (_jsx(Pressable, { disabled: disabled, children: ({ pressed }) => (_jsx(View, { ...restProps, className: classNames(bem.e('item'), bem.em('item', 'disabled', disabled), bem.em('item', 'pressed', pressed), className), style: style, onClick: handleClick, children: children ?? (_jsxs(_Fragment, { children: [_jsx(View, { className: bem.e('icon-wrapper'), style: filterNullish({
|
|
21
|
+
backgroundColor: background,
|
|
22
|
+
}), children: isImg ? (_jsx(Image, { className: bem.e('img'), mode: "aspectFill", src: icon })) : (_jsx(Icon, { size: 24, ...icon, className: bem.e('icon'), style: filterNullish({
|
|
23
|
+
color,
|
|
24
|
+
}) })) }), name && _jsx(View, { className: bem.e('item-name'), children: name }), label && _jsx(View, { className: bem.e('item-label'), children: label })] })) })) }));
|
|
25
|
+
};
|
|
26
|
+
export default ShareSheetItem;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { BaseProps } from '../base';
|
|
3
|
+
import { ShareSheetItemProps } from './Item';
|
|
4
|
+
export interface ShareSheetRowProps extends BaseProps {
|
|
5
|
+
itemList?: ShareSheetItemProps[];
|
|
6
|
+
_onItemClick?: (itemProps: ShareSheetItemProps) => void;
|
|
7
|
+
_later?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const ShareSheetRow: FC<ShareSheetRowProps>;
|
|
10
|
+
export default ShareSheetRow;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { createElement as _createElement } from "react";
|
|
3
|
+
import { Children, cloneElement } from 'react';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { ScrollView, View } from '@tarojs/components';
|
|
6
|
+
import { ShareSheetItem } from './Item';
|
|
7
|
+
import { useBem } from '../use';
|
|
8
|
+
import Halfline from '../halfline';
|
|
9
|
+
export const ShareSheetRow = (props) => {
|
|
10
|
+
const { className, style, children, itemList, _onItemClick, _later, ...restProps } = props;
|
|
11
|
+
const [bem] = useBem('share-sheet');
|
|
12
|
+
return (_jsxs(View, { ...restProps, className: classNames(bem.e('row'), className), style: style, children: [_jsx(ScrollView, { scrollX: true, showScrollbar: false, children: _jsx(View, { className: bem.e('row-content'), children: itemList
|
|
13
|
+
? itemList.map((itemProps, index) => (_createElement(ShareSheetItem, { ...itemProps, key: index, onClick: (event) => {
|
|
14
|
+
_onItemClick?.(itemProps);
|
|
15
|
+
itemProps.onClick?.(event);
|
|
16
|
+
} })))
|
|
17
|
+
: Children.map(children, (element) => {
|
|
18
|
+
return cloneElement(element, {
|
|
19
|
+
onClick: (event) => {
|
|
20
|
+
_onItemClick?.(element.props);
|
|
21
|
+
element.props.onClick?.(event);
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
}) }) }), _later && _jsx(Halfline, { direction: "top" })] }));
|
|
25
|
+
};
|
|
26
|
+
export default ShareSheetRow;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ReactNode, FC } from 'react';
|
|
2
|
+
import { PopupProps } from '../popup';
|
|
3
|
+
import { ShareSheetItem, ShareSheetItemProps } from './Item';
|
|
4
|
+
import { ShareSheetRow } from './Row';
|
|
5
|
+
import { BaseProps } from '../base';
|
|
6
|
+
export * from './Item';
|
|
7
|
+
export type ShareSheetItemList = ShareSheetItemProps[] | ShareSheetItemProps[][];
|
|
8
|
+
export interface ShareSheetProps extends BaseProps, PopupProps {
|
|
9
|
+
itemList?: ShareSheetItemList;
|
|
10
|
+
title?: ReactNode;
|
|
11
|
+
description?: ReactNode;
|
|
12
|
+
cancel?: ReactNode;
|
|
13
|
+
onSelect?: (itemProps: ShareSheetItemProps) => void | Promise<any>;
|
|
14
|
+
onCancel?: () => void | Promise<any>;
|
|
15
|
+
onClose?: () => void | Promise<any>;
|
|
16
|
+
maskClosable?: boolean;
|
|
17
|
+
visible?: boolean;
|
|
18
|
+
defaultVisible?: boolean;
|
|
19
|
+
onVisible?: (visible: boolean) => void;
|
|
20
|
+
}
|
|
21
|
+
export interface ShareSheetFC extends FC<ShareSheetProps> {
|
|
22
|
+
Row: typeof ShareSheetRow;
|
|
23
|
+
Item: typeof ShareSheetItem;
|
|
24
|
+
}
|
|
25
|
+
export declare const ShareSheet: ShareSheetFC;
|
|
26
|
+
export default ShareSheet;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, cloneElement, Children, } from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { View } from '@tarojs/components';
|
|
5
|
+
import { useBem, useControllableValue, useEvent } from '../use';
|
|
6
|
+
import { Popup } from '../popup';
|
|
7
|
+
import { ShareSheetItem } from './Item';
|
|
8
|
+
import { ShareSheetRow } from './Row';
|
|
9
|
+
import { isFunction, isNullish, noop } from '../utils';
|
|
10
|
+
import Halfline from '../halfline';
|
|
11
|
+
import Pressable from '../pressable';
|
|
12
|
+
import SafeArea from '../safe-area';
|
|
13
|
+
export * from './Item';
|
|
14
|
+
export const ShareSheet = ((props) => {
|
|
15
|
+
const { className, style, children, itemList, title, description, cancel, onSelect, onCancel, onClose, maskClosable = true, onMaskClick, visible, defaultVisible, onVisible, ...restProps } = props;
|
|
16
|
+
const [bem] = useBem('share-sheet');
|
|
17
|
+
const [innerVisible, setInnerVisible] = useControllableValue({
|
|
18
|
+
value: visible,
|
|
19
|
+
defaultValue: defaultVisible,
|
|
20
|
+
trigger: onVisible,
|
|
21
|
+
initialValue: false,
|
|
22
|
+
});
|
|
23
|
+
const perhapsClose = (callback) => {
|
|
24
|
+
if (isFunction(callback)) {
|
|
25
|
+
const result = callback();
|
|
26
|
+
if (result instanceof Promise) {
|
|
27
|
+
return result
|
|
28
|
+
.then(() => {
|
|
29
|
+
setInnerVisible?.(false);
|
|
30
|
+
})
|
|
31
|
+
.catch(noop);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
setInnerVisible?.(false);
|
|
35
|
+
};
|
|
36
|
+
const handleItemClick = useEvent((itemProps) => {
|
|
37
|
+
perhapsClose(() => {
|
|
38
|
+
return onSelect?.(itemProps);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
const handleRequestClose = useEvent(() => {
|
|
42
|
+
setInnerVisible(false);
|
|
43
|
+
});
|
|
44
|
+
const handleMaskClick = useEvent((event) => {
|
|
45
|
+
onMaskClick?.(event);
|
|
46
|
+
if (maskClosable) {
|
|
47
|
+
perhapsClose(onClose);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
const handleCancelClick = useEvent(() => {
|
|
51
|
+
perhapsClose(onCancel);
|
|
52
|
+
});
|
|
53
|
+
const rowList = useMemo(() => {
|
|
54
|
+
if (itemList) {
|
|
55
|
+
if (itemList.length && !Array.isArray(itemList[0])) {
|
|
56
|
+
return [itemList];
|
|
57
|
+
}
|
|
58
|
+
return itemList;
|
|
59
|
+
}
|
|
60
|
+
}, [itemList]);
|
|
61
|
+
return (_jsxs(Popup, { ...restProps, visible: innerVisible, effect: "slide-bottom", className: bem.e('popup'), style: style, contentClass: classNames(bem.b(), className), onMaskClick: handleMaskClick, onRequestClose: handleRequestClose, children: [(!isNullish(title) || !isNullish(description)) && (_jsxs(View, { className: bem.e('header'), children: [!isNullish(title) && _jsx(View, { className: bem.e('title'), children: title }), !isNullish(description) && (_jsx(View, { className: classNames(bem.e('description'), bem.em('description', 'titled', !isNullish(title))), children: description })), _jsx(Halfline, { direction: "bottom" })] })), _jsx(View, { className: bem.e('body'), children: rowList
|
|
62
|
+
? rowList.map((itemList, index) => (_jsx(ShareSheetRow, { itemList: itemList, className: classNames(bem.em('row', 'headless-first', isNullish(title) && isNullish(description) && index === 0)), _onItemClick: (itemProps) => {
|
|
63
|
+
handleItemClick(itemProps);
|
|
64
|
+
}, _later: index > 0 }, index)))
|
|
65
|
+
: Children.map(children, (element, index) => {
|
|
66
|
+
return cloneElement(element, {
|
|
67
|
+
_later: index > 0,
|
|
68
|
+
_onItemClick: (itemProps) => {
|
|
69
|
+
handleItemClick(itemProps);
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
}) }), !isNullish(cancel) && (_jsxs(_Fragment, { children: [_jsx(View, { className: bem.e('gap') }), _jsx(Pressable, { children: ({ pressed }) => (_jsx(View, { className: classNames(bem.e('cancel'), bem.em('cancel', 'pressed', pressed)), onClick: handleCancelClick, children: cancel })) })] })), _jsx(SafeArea, { direction: "bottom" })] }));
|
|
73
|
+
});
|
|
74
|
+
ShareSheet.Row = ShareSheetRow;
|
|
75
|
+
ShareSheet.Item = ShareSheetItem;
|
|
76
|
+
export default ShareSheet;
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
@import '../style/base.scss';
|
|
2
|
+
// #variables
|
|
3
|
+
$sar-share-sheet-z-index: 1100 !default;
|
|
4
|
+
|
|
5
|
+
$sar-share-sheet-border-radius: $sar-rounded-xl !default;
|
|
6
|
+
$sar-share-sheet-bg-color: $sar-emphasis-bg-color !default;
|
|
7
|
+
|
|
8
|
+
$sar-share-sheet-header-padding: 16px !default;
|
|
9
|
+
|
|
10
|
+
$sar-share-sheet-title-font-size: $sar-text-lg !default;
|
|
11
|
+
|
|
12
|
+
$sar-share-sheet-description-margin-top: 8px !default;
|
|
13
|
+
$sar-share-sheet-description-font-size: $sar-text-base !default;
|
|
14
|
+
$sar-share-sheet-description-color: $sar-tertiary-color !default;
|
|
15
|
+
|
|
16
|
+
$sar-share-sheet-row-padding-y: 16px !default;
|
|
17
|
+
$sar-share-sheet-row-padding-x: 8px !default;
|
|
18
|
+
|
|
19
|
+
$sar-share-sheet-item-active-opacity: $sar-active-opacity !default;
|
|
20
|
+
|
|
21
|
+
$sar-share-sheet-icon-wrapper-size: 48px !default;
|
|
22
|
+
$sar-share-sheet-icon-wrapper-margin-x: 16px !default;
|
|
23
|
+
$sar-share-sheet-icon-wrapper-border-radius: $sar-rounded-full !default;
|
|
24
|
+
|
|
25
|
+
$sar-share-sheet-icon-font-size: 24px !default;
|
|
26
|
+
$sar-share-sheet-icon-color: $sar-tertiary-color !default;
|
|
27
|
+
$sar-share-sheet-icon-bg-color: $sar-secondary-bg-color !default;
|
|
28
|
+
|
|
29
|
+
$sar-share-sheet-name-margin-top: 8px !default;
|
|
30
|
+
$sar-share-sheet-name-padding-x: 4px !default;
|
|
31
|
+
$sar-share-sheet-name-font-size: $sar-text-base !default;
|
|
32
|
+
$sar-share-sheet-name-color: $sar-tertiary-color !default;
|
|
33
|
+
|
|
34
|
+
$sar-share-sheet-label-margin-top: 0 !default;
|
|
35
|
+
$sar-share-sheet-label-padding-x: 4px !default;
|
|
36
|
+
$sar-share-sheet-label-font-size: $sar-text-sm !default;
|
|
37
|
+
$sar-share-sheet-label-color: $sar-tertiary-color !default;
|
|
38
|
+
|
|
39
|
+
$sar-share-sheet-gap-bg-color: $sar-gray-100 !default;
|
|
40
|
+
$sar-share-sheet-gap-height: 8px !default;
|
|
41
|
+
|
|
42
|
+
$sar-share-sheet-cancel-min-height: 48px !default;
|
|
43
|
+
$sar-share-sheet-cancel-padding: 8px 16px !default;
|
|
44
|
+
$sar-share-sheet-cancel-font-size: $sar-text-lg !default;
|
|
45
|
+
$sar-share-sheet-cancel-active-bg-color: $sar-active-bg-color !default;
|
|
46
|
+
|
|
47
|
+
// 暗黑模式
|
|
48
|
+
$sar-share-sheet-dark-bg-color: $sar-dark-emphasis-bg-color !default;
|
|
49
|
+
$sar-share-sheet-description-dark-color: $sar-dark-tertiary-color !default;
|
|
50
|
+
$sar-share-sheet-icon-dark-color: $sar-dark-tertiary-color !default;
|
|
51
|
+
$sar-share-sheet-icon-dark-bg-color: $sar-dark-secondary-bg-color !default;
|
|
52
|
+
$sar-share-sheet-name-dark-color: $sar-dark-tertiary-color !default;
|
|
53
|
+
$sar-share-sheet-label-dark-color: $sar-dark-tertiary-color !default;
|
|
54
|
+
$sar-share-sheet-gap-dark-bg-color: $sar-gray-900 !default;
|
|
55
|
+
$sar-share-sheet-cancel-active-dark-bg-color: $sar-dark-active-bg-color !default;
|
|
56
|
+
// #endvariables
|
|
57
|
+
|
|
58
|
+
@include bem(share-sheet) {
|
|
59
|
+
@include b() {
|
|
60
|
+
border-top-left-radius: $sar-share-sheet-border-radius;
|
|
61
|
+
border-top-right-radius: $sar-share-sheet-border-radius;
|
|
62
|
+
background-color: $sar-share-sheet-bg-color;
|
|
63
|
+
@include ifweb {
|
|
64
|
+
touch-action: pan-x;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@include e(popup) {
|
|
69
|
+
z-index: $sar-share-sheet-z-index;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@include e(header) {
|
|
73
|
+
@include universal;
|
|
74
|
+
padding: $sar-share-sheet-header-padding;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@include e(title) {
|
|
78
|
+
@include universal;
|
|
79
|
+
font-size: $sar-share-sheet-title-font-size;
|
|
80
|
+
font-weight: $sar-font-bold;
|
|
81
|
+
text-align: center;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@include e(description) {
|
|
85
|
+
@include universal;
|
|
86
|
+
font-size: $sar-share-sheet-description-font-size;
|
|
87
|
+
text-align: center;
|
|
88
|
+
color: $sar-share-sheet-description-color;
|
|
89
|
+
|
|
90
|
+
@include m(titled) {
|
|
91
|
+
margin-top: $sar-share-sheet-description-margin-top;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@include e(row) {
|
|
96
|
+
@include universal;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@include e(row-content) {
|
|
100
|
+
@include universal;
|
|
101
|
+
flex-direction: row;
|
|
102
|
+
flex-wrap: nowrap;
|
|
103
|
+
padding: $sar-share-sheet-row-padding-y $sar-share-sheet-row-padding-x;
|
|
104
|
+
|
|
105
|
+
@include m(headless-first) {
|
|
106
|
+
border-top-left-radius: $sar-share-sheet-border-radius;
|
|
107
|
+
border-top-right-radius: $sar-share-sheet-border-radius;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@include e(item) {
|
|
112
|
+
@include universal;
|
|
113
|
+
justify-content: center;
|
|
114
|
+
align-items: center;
|
|
115
|
+
flex-grow: 0;
|
|
116
|
+
flex-shrink: 0;
|
|
117
|
+
|
|
118
|
+
@include ifweb {
|
|
119
|
+
cursor: pointer;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@include m(pressed) {
|
|
123
|
+
opacity: $sar-share-sheet-item-active-opacity;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@include m(disabled) {
|
|
127
|
+
@include disabled;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@include e(icon-wrapper) {
|
|
132
|
+
@include universal;
|
|
133
|
+
justify-content: center;
|
|
134
|
+
align-items: center;
|
|
135
|
+
width: $sar-share-sheet-icon-wrapper-size;
|
|
136
|
+
height: $sar-share-sheet-icon-wrapper-size;
|
|
137
|
+
margin: 0 $sar-share-sheet-icon-wrapper-margin-x;
|
|
138
|
+
border-radius: $sar-share-sheet-icon-wrapper-border-radius;
|
|
139
|
+
background-color: $sar-share-sheet-icon-bg-color;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
@include e(icon) {
|
|
143
|
+
font-size: $sar-share-sheet-icon-font-size;
|
|
144
|
+
color: $sar-share-sheet-icon-color;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
@include e(img) {
|
|
148
|
+
@include universal;
|
|
149
|
+
width: 100%;
|
|
150
|
+
height: 100%;
|
|
151
|
+
border-radius: $sar-share-sheet-icon-wrapper-border-radius;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
@include e(item-name) {
|
|
155
|
+
@include universal;
|
|
156
|
+
margin-top: $sar-share-sheet-name-margin-top;
|
|
157
|
+
padding: 0 $sar-share-sheet-name-padding-x;
|
|
158
|
+
font-size: $sar-share-sheet-name-font-size;
|
|
159
|
+
color: $sar-share-sheet-name-color;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
@include e(item-label) {
|
|
163
|
+
@include universal;
|
|
164
|
+
margin-top: $sar-share-sheet-label-margin-top;
|
|
165
|
+
padding: 0 $sar-share-sheet-label-padding-x;
|
|
166
|
+
font-size: $sar-share-sheet-label-font-size;
|
|
167
|
+
color: $sar-share-sheet-label-color;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
@include e(gap) {
|
|
171
|
+
@include universal;
|
|
172
|
+
height: $sar-share-sheet-gap-height;
|
|
173
|
+
background-color: $sar-share-sheet-gap-bg-color;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
@include e(cancel) {
|
|
177
|
+
@include universal;
|
|
178
|
+
justify-content: center;
|
|
179
|
+
align-items: center;
|
|
180
|
+
min-height: $sar-share-sheet-cancel-min-height;
|
|
181
|
+
padding: $sar-share-sheet-cancel-padding;
|
|
182
|
+
font-size: $sar-share-sheet-cancel-font-size;
|
|
183
|
+
|
|
184
|
+
@include ifweb {
|
|
185
|
+
cursor: pointer;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
@include m(pressed) {
|
|
189
|
+
background-color: $sar-share-sheet-cancel-active-bg-color;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
@include theme(dark) {
|
|
195
|
+
@include bem(share-sheet) {
|
|
196
|
+
@include b() {
|
|
197
|
+
background-color: $sar-share-sheet-dark-bg-color;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
@include e(description) {
|
|
201
|
+
color: $sar-share-sheet-description-dark-color;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
@include e(icon-wrapper) {
|
|
205
|
+
background-color: $sar-share-sheet-icon-dark-bg-color;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
@include e(icon) {
|
|
209
|
+
color: $sar-share-sheet-icon-dark-color;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
@include e(item-name) {
|
|
213
|
+
color: $sar-share-sheet-name-dark-color;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
@include e(item-label) {
|
|
217
|
+
color: $sar-share-sheet-label-dark-color;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
@include e(gap) {
|
|
221
|
+
background-color: $sar-share-sheet-gap-dark-bg-color;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
@include e(cancel) {
|
|
225
|
+
@include m(pressed) {
|
|
226
|
+
background-color: $sar-share-sheet-cancel-active-dark-bg-color;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { SkeletonBlockProps } from './Block';
|
|
3
|
+
export interface SkeletonAvatarProps extends SkeletonBlockProps {
|
|
4
|
+
size?: number | string;
|
|
5
|
+
}
|
|
6
|
+
export declare const SkeletonAvatar: FC<SkeletonAvatarProps>;
|
|
7
|
+
export default SkeletonAvatar;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { SkeletonBlock } from './Block';
|
|
4
|
+
import { useBem } from '../use';
|
|
5
|
+
import { filterNullish } from '../utils';
|
|
6
|
+
export const SkeletonAvatar = (props) => {
|
|
7
|
+
const { className, size, style, round, ...restProps } = props;
|
|
8
|
+
const [bem] = useBem('skeleton');
|
|
9
|
+
return (_jsx(SkeletonBlock, { ...restProps, round: round, className: classNames(bem.e('avatar'), className), style: {
|
|
10
|
+
...style,
|
|
11
|
+
...filterNullish({
|
|
12
|
+
width: size,
|
|
13
|
+
height: size,
|
|
14
|
+
}),
|
|
15
|
+
} }));
|
|
16
|
+
};
|
|
17
|
+
export default SkeletonAvatar;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo } from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { useBem } from '../use';
|
|
5
|
+
import { Animated } from '../animated';
|
|
6
|
+
import { isRN } from '../utils';
|
|
7
|
+
export const SkeletonBlock = (props) => {
|
|
8
|
+
const { className, style, animated, round, children, ...restProps } = props;
|
|
9
|
+
const [bem] = useBem('skeleton');
|
|
10
|
+
// Animated >>>
|
|
11
|
+
const anim = useMemo(() => new Animated.Value(1), []);
|
|
12
|
+
const startAnimate = () => {
|
|
13
|
+
const loopAnim = Animated.loop(Animated.sequence([
|
|
14
|
+
Animated.timing(anim, {
|
|
15
|
+
toValue: 0.5,
|
|
16
|
+
duration: 600,
|
|
17
|
+
useNativeDriver: true,
|
|
18
|
+
}),
|
|
19
|
+
Animated.timing(anim, {
|
|
20
|
+
toValue: 1,
|
|
21
|
+
duration: 600,
|
|
22
|
+
useNativeDriver: true,
|
|
23
|
+
}),
|
|
24
|
+
]));
|
|
25
|
+
loopAnim.start();
|
|
26
|
+
return loopAnim;
|
|
27
|
+
};
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
let loopAnim;
|
|
30
|
+
if (animated) {
|
|
31
|
+
loopAnim = startAnimate();
|
|
32
|
+
}
|
|
33
|
+
return () => {
|
|
34
|
+
loopAnim?.stop();
|
|
35
|
+
anim.stopAnimation();
|
|
36
|
+
};
|
|
37
|
+
}, [animated]);
|
|
38
|
+
// <<< Animated
|
|
39
|
+
return (_jsx(Animated.View, { ...restProps, className: classNames(bem.e('block'), bem.m('animated', animated), bem.m('round', round), className), style: {
|
|
40
|
+
...style,
|
|
41
|
+
...(isRN ? { opacity: anim } : null),
|
|
42
|
+
}, children: children }));
|
|
43
|
+
};
|
|
44
|
+
export default SkeletonBlock;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { SkeletonBlockProps } from './Block';
|
|
3
|
+
export interface SkeletonParagraphProps extends SkeletonBlockProps {
|
|
4
|
+
rows?: number;
|
|
5
|
+
}
|
|
6
|
+
export declare const SkeletonParagraph: FC<SkeletonParagraphProps>;
|
|
7
|
+
export default SkeletonParagraph;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { View } from '@tarojs/components';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { SkeletonBlock } from './Block';
|
|
5
|
+
import { useBem } from '../use';
|
|
6
|
+
export const SkeletonParagraph = (props) => {
|
|
7
|
+
const { className, style, rows = 3, animated, round, ...restProps } = props;
|
|
8
|
+
const [bem] = useBem('skeleton');
|
|
9
|
+
return (_jsx(View, { ...restProps, className: classNames(bem.e('paragraph'), className), style: style, children: Array(rows)
|
|
10
|
+
.fill(0)
|
|
11
|
+
.map((_, index) => (_jsx(SkeletonBlock, { className: classNames(bem.e('row'), bem.em('row', 'later', index > 0), bem.em('row', 'last', index === rows - 1)), animated: animated, round: round }, index))) }));
|
|
12
|
+
};
|
|
13
|
+
export default SkeletonParagraph;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { SkeletonBlock } from './Block';
|
|
4
|
+
import { useBem } from '../use';
|
|
5
|
+
import { filterNullish } from '../utils';
|
|
6
|
+
export const SkeletonTitle = (props) => {
|
|
7
|
+
const { className, style, width, ...restProps } = props;
|
|
8
|
+
const [bem] = useBem('skeleton');
|
|
9
|
+
return (_jsx(SkeletonBlock, { ...restProps, className: classNames(bem.e('title'), className), style: {
|
|
10
|
+
...style,
|
|
11
|
+
...filterNullish({
|
|
12
|
+
width,
|
|
13
|
+
}),
|
|
14
|
+
} }));
|
|
15
|
+
};
|
|
16
|
+
export default SkeletonTitle;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { SkeletonBlock } from './Block';
|
|
3
|
+
import { SkeletonAvatar } from './Avatar';
|
|
4
|
+
import { SkeletonTitle } from './Title';
|
|
5
|
+
import { SkeletonParagraph } from './Paragraph';
|
|
6
|
+
import { BaseProps } from '../base';
|
|
7
|
+
export * from './Block';
|
|
8
|
+
export * from './Avatar';
|
|
9
|
+
export * from './Title';
|
|
10
|
+
export * from './Paragraph';
|
|
11
|
+
export interface SkeletonProps extends BaseProps {
|
|
12
|
+
rows?: number;
|
|
13
|
+
title?: boolean;
|
|
14
|
+
avatar?: boolean;
|
|
15
|
+
avatarSize?: number | string;
|
|
16
|
+
avatarRound?: boolean;
|
|
17
|
+
round?: boolean;
|
|
18
|
+
loading?: boolean;
|
|
19
|
+
animated?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface SkeletonFC extends FC<SkeletonProps> {
|
|
22
|
+
Block: typeof SkeletonBlock;
|
|
23
|
+
Avatar: typeof SkeletonAvatar;
|
|
24
|
+
Title: typeof SkeletonTitle;
|
|
25
|
+
Paragraph: typeof SkeletonParagraph;
|
|
26
|
+
}
|
|
27
|
+
export declare const Skeleton: SkeletonFC;
|
|
28
|
+
export default Skeleton;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { View } from '@tarojs/components';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { SkeletonBlock } from './Block';
|
|
5
|
+
import { SkeletonAvatar } from './Avatar';
|
|
6
|
+
import { SkeletonTitle } from './Title';
|
|
7
|
+
import { SkeletonParagraph } from './Paragraph';
|
|
8
|
+
import { useBem } from '../use';
|
|
9
|
+
export * from './Block';
|
|
10
|
+
export * from './Avatar';
|
|
11
|
+
export * from './Title';
|
|
12
|
+
export * from './Paragraph';
|
|
13
|
+
export const Skeleton = (props) => {
|
|
14
|
+
const { className, style, children, rows = 3, title = false, avatar = false, avatarSize = 32, avatarRound = false, round = false, loading = true, animated = false, ...restProps } = props;
|
|
15
|
+
const [bem] = useBem('skeleton');
|
|
16
|
+
return (_jsx(_Fragment, { children: loading ? (_jsxs(View, { ...restProps, className: classNames(bem.b(), className), style: style, children: [avatar && (_jsx(SkeletonAvatar, { size: avatarSize, animated: animated, round: avatarRound, className: bem.em('avatar', 'in-skeleton') })), _jsxs(View, { className: bem.e('content'), children: [title && _jsx(SkeletonTitle, { animated: animated, round: round }), _jsx(SkeletonParagraph, { rows: rows, animated: animated, round: round, className: bem.em('paragraph', 'in-skeleton') })] })] })) : (children) }));
|
|
17
|
+
};
|
|
18
|
+
Skeleton.Block = SkeletonBlock;
|
|
19
|
+
Skeleton.Avatar = SkeletonAvatar;
|
|
20
|
+
Skeleton.Title = SkeletonTitle;
|
|
21
|
+
Skeleton.Paragraph = SkeletonParagraph;
|
|
22
|
+
export default Skeleton;
|