react-native-system-ui 1.0.1 → 1.0.3
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/README.md +44 -24
- package/dist/cjs/components/action-sheet/ActionSheet.js +1 -297
- package/dist/cjs/components/action-sheet/index.js +1 -16
- package/dist/cjs/components/action-sheet/tokens.js +1 -133
- package/dist/cjs/components/area/Area.js +1 -127
- package/dist/cjs/components/area/index.js +1 -9
- package/dist/cjs/components/area/tokens.js +1 -14
- package/dist/cjs/components/avatar/Avatar.js +1 -125
- package/dist/cjs/components/avatar/index.js +1 -18
- package/dist/cjs/components/avatar/tokens.js +1 -56
- package/dist/cjs/components/badge/Badge.js +1 -166
- package/dist/cjs/components/badge/index.js +1 -8
- package/dist/cjs/components/badge/tokens.js +1 -81
- package/dist/cjs/components/button/Button.js +1 -203
- package/dist/cjs/components/button/ButtonContext.js +1 -12
- package/dist/cjs/components/button/ButtonGroup.js +1 -65
- package/dist/cjs/components/button/index.js +1 -12
- package/dist/cjs/components/button/tokens.js +1 -176
- package/dist/cjs/components/calendar/Calendar.js +1 -452
- package/dist/cjs/components/calendar/index.js +1 -9
- package/dist/cjs/components/calendar/tokens.js +1 -129
- package/dist/cjs/components/cascader/Cascader.js +1 -481
- package/dist/cjs/components/cascader/index.js +1 -15
- package/dist/cjs/components/cascader/tokens.js +1 -138
- package/dist/cjs/components/cascader/useCascaderExtend.js +1 -39
- package/dist/cjs/components/cell/Cell.js +1 -181
- package/dist/cjs/components/cell/CellContext.js +1 -19
- package/dist/cjs/components/cell/CellGroup.js +1 -100
- package/dist/cjs/components/cell/index.js +1 -19
- package/dist/cjs/components/cell/tokens.js +1 -173
- package/dist/cjs/components/checkbox/Checkbox.js +1 -251
- package/dist/cjs/components/checkbox/CheckboxContext.js +1 -12
- package/dist/cjs/components/checkbox/CheckboxGroup.js +1 -148
- package/dist/cjs/components/checkbox/index.js +1 -16
- package/dist/cjs/components/checkbox/tokens.js +1 -97
- package/dist/cjs/components/circle/Circle.js +1 -212
- package/dist/cjs/components/circle/index.js +1 -9
- package/dist/cjs/components/circle/tokens.js +1 -55
- package/dist/cjs/components/collapse/Collapse.js +1 -311
- package/dist/cjs/components/collapse/index.js +1 -8
- package/dist/cjs/components/collapse/tokens.js +1 -81
- package/dist/cjs/components/config-provider/ConfigProvider.js +1 -44
- package/dist/cjs/components/config-provider/DirectionContext.js +1 -15
- package/dist/cjs/components/config-provider/LocaleContext.js +1 -16
- package/dist/cjs/components/config-provider/index.js +1 -40
- package/dist/cjs/components/config-provider/locale/en-US.js +1 -112
- package/dist/cjs/components/config-provider/locale/zh-CN.js +1 -112
- package/dist/cjs/components/config-provider/tokens.js +1 -11
- package/dist/cjs/components/config-provider/useDirection.js +1 -16
- package/dist/cjs/components/config-provider/useLocale.js +1 -16
- package/dist/cjs/components/count-down/CountDown.js +1 -88
- package/dist/cjs/components/count-down/index.js +1 -15
- package/dist/cjs/components/count-down/tokens.js +1 -34
- package/dist/cjs/components/datetime-picker/DatetimePicker.js +1 -319
- package/dist/cjs/components/datetime-picker/index.js +1 -9
- package/dist/cjs/components/datetime-picker/tokens.js +1 -22
- package/dist/cjs/components/dialog/Dialog.js +1 -433
- package/dist/cjs/components/dialog/imperative.js +1 -199
- package/dist/cjs/components/dialog/index.js +1 -23
- package/dist/cjs/components/dialog/tokens.js +1 -64
- package/dist/cjs/components/divider/Divider.js +1 -126
- package/dist/cjs/components/divider/index.js +1 -8
- package/dist/cjs/components/divider/tokens.js +1 -62
- package/dist/cjs/components/empty/Empty.js +1 -125
- package/dist/cjs/components/empty/index.js +1 -8
- package/dist/cjs/components/empty/tokens.js +1 -55
- package/dist/cjs/components/error-boundary/ErrorBoundary.js +1 -74
- package/dist/cjs/components/error-boundary/index.js +1 -19
- package/dist/cjs/components/field/Field.js +1 -565
- package/dist/cjs/components/field/index.js +1 -29
- package/dist/cjs/components/field/tokens.js +1 -150
- package/dist/cjs/components/flex/Flex.js +1 -85
- package/dist/cjs/components/flex/FlexContext.js +1 -12
- package/dist/cjs/components/flex/FlexItem.js +1 -95
- package/dist/cjs/components/flex/index.js +1 -19
- package/dist/cjs/components/flex/tokens.js +1 -21
- package/dist/cjs/components/form/Form.js +1 -340
- package/dist/cjs/components/form/FormContext.js +1 -12
- package/dist/cjs/components/form/FormItem.js +1 -151
- package/dist/cjs/components/form/FormList.js +1 -95
- package/dist/cjs/components/form/index.js +1 -50
- package/dist/cjs/components/form/tokens.js +1 -14
- package/dist/cjs/components/form/utils.js +1 -56
- package/dist/cjs/components/grid/Grid.js +1 -118
- package/dist/cjs/components/grid/GridContext.js +1 -12
- package/dist/cjs/components/grid/GridItem.js +1 -158
- package/dist/cjs/components/grid/index.js +1 -12
- package/dist/cjs/components/grid/tokens.js +1 -105
- package/dist/cjs/components/image/Image.js +1 -263
- package/dist/cjs/components/image/index.js +1 -16
- package/dist/cjs/components/image/tokens.js +1 -66
- package/dist/cjs/components/image-preview/ImagePreview.js +1 -398
- package/dist/cjs/components/image-preview/imperative.js +1 -72
- package/dist/cjs/components/image-preview/index.js +1 -17
- package/dist/cjs/components/image-preview/tokens.js +1 -43
- package/dist/cjs/components/index.js +1 -769
- package/dist/cjs/components/input/Input.js +1 -122
- package/dist/cjs/components/input/index.js +1 -15
- package/dist/cjs/components/input/tokens.js +1 -22
- package/dist/cjs/components/loading/Loading.js +1 -76
- package/dist/cjs/components/loading/index.js +1 -8
- package/dist/cjs/components/loading/tokens.js +1 -32
- package/dist/cjs/components/nav-bar/NavBar.js +1 -196
- package/dist/cjs/components/nav-bar/index.js +1 -16
- package/dist/cjs/components/nav-bar/tokens.js +1 -90
- package/dist/cjs/components/notice-bar/NoticeBar.js +1 -369
- package/dist/cjs/components/notice-bar/index.js +1 -8
- package/dist/cjs/components/notice-bar/tokens.js +1 -39
- package/dist/cjs/components/notify/Notify.js +1 -262
- package/dist/cjs/components/notify/imperative.js +1 -145
- package/dist/cjs/components/notify/index.js +1 -10
- package/dist/cjs/components/notify/tokens.js +1 -74
- package/dist/cjs/components/number-keyboard/NumberKeyboard.js +1 -487
- package/dist/cjs/components/number-keyboard/index.js +1 -15
- package/dist/cjs/components/number-keyboard/tokens.js +1 -59
- package/dist/cjs/components/overlay/Overlay.js +1 -81
- package/dist/cjs/components/overlay/index.js +1 -28
- package/dist/cjs/components/overlay/tokens.js +1 -13
- package/dist/cjs/components/password-input/PasswordInput.js +1 -346
- package/dist/cjs/components/password-input/index.js +1 -13
- package/dist/cjs/components/password-input/tokens.js +1 -53
- package/dist/cjs/components/picker/Picker.js +1 -1056
- package/dist/cjs/components/picker/index.js +1 -15
- package/dist/cjs/components/picker/tokens.js +1 -53
- package/dist/cjs/components/popup/Popup.js +1 -518
- package/dist/cjs/components/popup/index.js +1 -15
- package/dist/cjs/components/popup/tokens.js +1 -62
- package/dist/cjs/components/portal/Portal.js +1 -50
- package/dist/cjs/components/portal/PortalContext.js +1 -15
- package/dist/cjs/components/portal/PortalHost.js +1 -253
- package/dist/cjs/components/portal/index.js +1 -25
- package/dist/cjs/components/portal/tokens.js +1 -11
- package/dist/cjs/components/progress/Progress.js +1 -216
- package/dist/cjs/components/progress/index.js +1 -14
- package/dist/cjs/components/progress/tokens.js +1 -52
- package/dist/cjs/components/radio/Radio.js +1 -245
- package/dist/cjs/components/radio/RadioContext.js +1 -12
- package/dist/cjs/components/radio/RadioGroup.js +1 -113
- package/dist/cjs/components/radio/index.js +1 -16
- package/dist/cjs/components/radio/tokens.js +1 -92
- package/dist/cjs/components/safe-area-view/SafeAreaView.js +1 -59
- package/dist/cjs/components/safe-area-view/index.js +1 -12
- package/dist/cjs/components/safe-area-view/tokens.js +1 -11
- package/dist/cjs/components/search/Search.js +1 -215
- package/dist/cjs/components/search/index.js +1 -15
- package/dist/cjs/components/search/tokens.js +1 -54
- package/dist/cjs/components/selector/Selector.js +1 -185
- package/dist/cjs/components/selector/index.js +1 -15
- package/dist/cjs/components/selector/tokens.js +1 -100
- package/dist/cjs/components/share-sheet/ShareSheet.js +1 -286
- package/dist/cjs/components/share-sheet/index.js +1 -16
- package/dist/cjs/components/share-sheet/tokens.js +1 -55
- package/dist/cjs/components/sidebar/Sidebar.js +1 -103
- package/dist/cjs/components/sidebar/SidebarContext.js +1 -17
- package/dist/cjs/components/sidebar/SidebarItem.js +1 -103
- package/dist/cjs/components/sidebar/index.js +1 -26
- package/dist/cjs/components/sidebar/tokens.js +1 -93
- package/dist/cjs/components/skeleton/Skeleton.js +1 -162
- package/dist/cjs/components/skeleton/index.js +1 -22
- package/dist/cjs/components/skeleton/tokens.js +1 -39
- package/dist/cjs/components/slider/Slider.js +1 -633
- package/dist/cjs/components/slider/index.js +1 -8
- package/dist/cjs/components/slider/tokens.js +1 -37
- package/dist/cjs/components/space/Space.js +1 -134
- package/dist/cjs/components/space/index.js +1 -18
- package/dist/cjs/components/space/tokens.js +1 -39
- package/dist/cjs/components/stepper/Stepper.js +1 -484
- package/dist/cjs/components/stepper/index.js +1 -15
- package/dist/cjs/components/stepper/tokens.js +1 -60
- package/dist/cjs/components/swiper/Swiper.js +1 -364
- package/dist/cjs/components/swiper/SwiperItem.js +1 -12
- package/dist/cjs/components/swiper/SwiperPagIndicator.js +1 -106
- package/dist/cjs/components/swiper/index.js +1 -40
- package/dist/cjs/components/swiper/tokens.js +1 -18
- package/dist/cjs/components/switch/Switch.js +1 -102
- package/dist/cjs/components/switch/index.js +1 -15
- package/dist/cjs/components/switch/tokens.js +1 -31
- package/dist/cjs/components/tabbar/Tabbar.js +1 -149
- package/dist/cjs/components/tabbar/TabbarContext.js +1 -17
- package/dist/cjs/components/tabbar/TabbarItem.js +1 -153
- package/dist/cjs/components/tabbar/index.js +1 -25
- package/dist/cjs/components/tabbar/tokens.js +1 -41
- package/dist/cjs/components/tabs/Tabs.js +1 -860
- package/dist/cjs/components/tabs/index.js +1 -25
- package/dist/cjs/components/tabs/tokens.js +1 -111
- package/dist/cjs/components/tag/Tag.js +1 -130
- package/dist/cjs/components/tag/index.js +1 -8
- package/dist/cjs/components/tag/tokens.js +1 -104
- package/dist/cjs/components/toast/Toast.js +1 -303
- package/dist/cjs/components/toast/imperative.js +1 -144
- package/dist/cjs/components/toast/index.js +1 -10
- package/dist/cjs/components/toast/tokens.js +1 -43
- package/dist/cjs/components/typography/Typography.js +1 -181
- package/dist/cjs/components/typography/index.js +1 -9
- package/dist/cjs/components/typography/tokens.js +1 -88
- package/dist/cjs/components/water-mark/WaterMark.js +1 -172
- package/dist/cjs/components/water-mark/index.js +1 -22
- package/dist/cjs/components/water-mark/tokens.js +1 -54
- package/dist/cjs/design-system/Text.js +1 -38
- package/dist/cjs/design-system/ThemeContext.js +1 -19
- package/dist/cjs/design-system/ThemeProvider.js +1 -31
- package/dist/cjs/design-system/createComponentTokensHook.js +1 -28
- package/dist/cjs/design-system/index.js +1 -66
- package/dist/cjs/design-system/mergeTokensOverride.js +1 -9
- package/dist/cjs/design-system/presets.js +1 -146
- package/dist/cjs/design-system/tokens.js +1 -135
- package/dist/cjs/design-system/useTheme.js +1 -16
- package/dist/cjs/hooks/animation/index.js +1 -25
- package/dist/cjs/hooks/animation/useAnimatedTransition.js +1 -72
- package/dist/cjs/hooks/animation/useReducedMotion.js +1 -75
- package/dist/cjs/hooks/aria/index.js +1 -49
- package/dist/cjs/hooks/aria/useAriaListBox.js +1 -50
- package/dist/cjs/hooks/aria/useAriaOverlay.js +1 -50
- package/dist/cjs/hooks/aria/useAriaPress.js +1 -94
- package/dist/cjs/hooks/aria/useAriaToggle.js +1 -41
- package/dist/cjs/hooks/gesture/index.js +1 -16
- package/dist/cjs/hooks/gesture/useGestureScroll.js +1 -129
- package/dist/cjs/hooks/index.js +1 -96
- package/dist/cjs/hooks/overlay/OverlayStackStore.js +1 -106
- package/dist/cjs/hooks/overlay/index.js +1 -27
- package/dist/cjs/hooks/overlay/useOverlayStack.js +1 -53
- package/dist/cjs/hooks/useControllableValue.js +1 -41
- package/dist/cjs/hooks/useCountDown.js +1 -99
- package/dist/cjs/hooks/useHairline.js +1 -46
- package/dist/cjs/hooks/useSafeAreaPadding.js +1 -38
- package/dist/cjs/index.js +1 -104
- package/dist/cjs/nativewind.js +1 -0
- package/dist/cjs/platform/animation.js +1 -22
- package/dist/cjs/platform/history.js +1 -14
- package/dist/cjs/platform/index.js +1 -60
- package/dist/cjs/platform/measure.js +1 -39
- package/dist/cjs/platform/runtime.js +1 -19
- package/dist/cjs/platform/scrollLock.js +1 -24
- package/dist/cjs/utils/array.js +1 -12
- package/dist/cjs/utils/color.js +1 -33
- package/dist/cjs/utils/compare.js +1 -21
- package/dist/cjs/utils/createPlatformShadow.js +1 -52
- package/dist/cjs/utils/date.js +1 -45
- package/dist/cjs/utils/deepMerge.js +1 -27
- package/dist/cjs/utils/hairline.js +1 -107
- package/dist/cjs/utils/index.js +1 -148
- package/dist/cjs/utils/number.js +1 -65
- package/dist/cjs/utils/promise.js +1 -9
- package/dist/cjs/utils/render.js +1 -21
- package/dist/cjs/utils/rtl.js +1 -25
- package/dist/cjs/utils/string.js +1 -22
- package/dist/cjs/utils/validate.js +1 -39
- package/dist/es/components/action-sheet/ActionSheet.js +1 -271
- package/dist/es/components/action-sheet/index.js +1 -3
- package/dist/es/components/action-sheet/tokens.js +1 -126
- package/dist/es/components/area/Area.js +1 -113
- package/dist/es/components/area/index.js +1 -2
- package/dist/es/components/area/tokens.js +1 -8
- package/dist/es/components/avatar/Avatar.js +1 -106
- package/dist/es/components/avatar/index.js +1 -1
- package/dist/es/components/avatar/tokens.js +1 -49
- package/dist/es/components/badge/Badge.js +1 -147
- package/dist/es/components/badge/index.js +1 -2
- package/dist/es/components/badge/tokens.js +1 -75
- package/dist/es/components/button/Button.js +1 -184
- package/dist/es/components/button/ButtonContext.js +1 -1
- package/dist/es/components/button/ButtonGroup.js +1 -46
- package/dist/es/components/button/index.js +1 -7
- package/dist/es/components/button/tokens.js +1 -170
- package/dist/es/components/calendar/Calendar.js +1 -432
- package/dist/es/components/calendar/index.js +1 -2
- package/dist/es/components/calendar/tokens.js +1 -122
- package/dist/es/components/cascader/Cascader.js +1 -455
- package/dist/es/components/cascader/index.js +1 -3
- package/dist/es/components/cascader/tokens.js +1 -131
- package/dist/es/components/cascader/useCascaderExtend.js +1 -32
- package/dist/es/components/cell/Cell.js +1 -156
- package/dist/es/components/cell/CellContext.js +1 -6
- package/dist/es/components/cell/CellGroup.js +1 -81
- package/dist/es/components/cell/index.js +1 -8
- package/dist/es/components/cell/tokens.js +1 -160
- package/dist/es/components/checkbox/Checkbox.js +1 -220
- package/dist/es/components/checkbox/CheckboxContext.js +1 -1
- package/dist/es/components/checkbox/CheckboxGroup.js +1 -117
- package/dist/es/components/checkbox/index.js +1 -5
- package/dist/es/components/checkbox/tokens.js +1 -85
- package/dist/es/components/circle/Circle.js +1 -187
- package/dist/es/components/circle/index.js +1 -2
- package/dist/es/components/circle/tokens.js +1 -48
- package/dist/es/components/collapse/Collapse.js +1 -286
- package/dist/es/components/collapse/index.js +1 -2
- package/dist/es/components/collapse/tokens.js +1 -74
- package/dist/es/components/config-provider/ConfigProvider.js +1 -25
- package/dist/es/components/config-provider/DirectionContext.js +1 -2
- package/dist/es/components/config-provider/LocaleContext.js +1 -3
- package/dist/es/components/config-provider/index.js +1 -5
- package/dist/es/components/config-provider/locale/en-US.js +1 -106
- package/dist/es/components/config-provider/locale/zh-CN.js +1 -106
- package/dist/es/components/config-provider/tokens.js +1 -5
- package/dist/es/components/config-provider/useDirection.js +1 -3
- package/dist/es/components/config-provider/useLocale.js +1 -3
- package/dist/es/components/count-down/CountDown.js +1 -69
- package/dist/es/components/count-down/index.js +1 -3
- package/dist/es/components/count-down/tokens.js +1 -27
- package/dist/es/components/datetime-picker/DatetimePicker.js +1 -305
- package/dist/es/components/datetime-picker/index.js +1 -2
- package/dist/es/components/datetime-picker/tokens.js +1 -16
- package/dist/es/components/dialog/Dialog.js +1 -407
- package/dist/es/components/dialog/imperative.js +1 -185
- package/dist/es/components/dialog/index.js +1 -17
- package/dist/es/components/dialog/tokens.js +1 -57
- package/dist/es/components/divider/Divider.js +1 -107
- package/dist/es/components/divider/index.js +1 -2
- package/dist/es/components/divider/tokens.js +1 -55
- package/dist/es/components/empty/Empty.js +1 -100
- package/dist/es/components/empty/index.js +1 -2
- package/dist/es/components/empty/tokens.js +1 -48
- package/dist/es/components/error-boundary/ErrorBoundary.js +1 -62
- package/dist/es/components/error-boundary/index.js +1 -1
- package/dist/es/components/field/Field.js +1 -539
- package/dist/es/components/field/index.js +1 -6
- package/dist/es/components/field/tokens.js +1 -138
- package/dist/es/components/flex/Flex.js +1 -66
- package/dist/es/components/flex/FlexContext.js +1 -1
- package/dist/es/components/flex/FlexItem.js +1 -76
- package/dist/es/components/flex/index.js +1 -8
- package/dist/es/components/flex/tokens.js +1 -15
- package/dist/es/components/form/Form.js +1 -319
- package/dist/es/components/form/FormContext.js +1 -1
- package/dist/es/components/form/FormItem.js +1 -138
- package/dist/es/components/form/FormList.js +1 -81
- package/dist/es/components/form/index.js +1 -13
- package/dist/es/components/form/tokens.js +1 -8
- package/dist/es/components/form/utils.js +1 -45
- package/dist/es/components/grid/Grid.js +1 -99
- package/dist/es/components/grid/GridContext.js +1 -1
- package/dist/es/components/grid/GridItem.js +1 -138
- package/dist/es/components/grid/index.js +1 -6
- package/dist/es/components/grid/tokens.js +1 -98
- package/dist/es/components/image/Image.js +1 -238
- package/dist/es/components/image/index.js +1 -3
- package/dist/es/components/image/tokens.js +1 -60
- package/dist/es/components/image-preview/ImagePreview.js +1 -378
- package/dist/es/components/image-preview/imperative.js +1 -58
- package/dist/es/components/image-preview/index.js +1 -11
- package/dist/es/components/image-preview/tokens.js +1 -37
- package/dist/es/components/index.js +1 -110
- package/dist/es/components/input/Input.js +1 -109
- package/dist/es/components/input/index.js +1 -3
- package/dist/es/components/input/tokens.js +1 -16
- package/dist/es/components/loading/Loading.js +1 -57
- package/dist/es/components/loading/index.js +1 -2
- package/dist/es/components/loading/tokens.js +1 -25
- package/dist/es/components/nav-bar/NavBar.js +1 -171
- package/dist/es/components/nav-bar/index.js +1 -3
- package/dist/es/components/nav-bar/tokens.js +1 -83
- package/dist/es/components/notice-bar/NoticeBar.js +1 -344
- package/dist/es/components/notice-bar/index.js +1 -2
- package/dist/es/components/notice-bar/tokens.js +1 -32
- package/dist/es/components/notify/Notify.js +1 -242
- package/dist/es/components/notify/imperative.js +1 -131
- package/dist/es/components/notify/index.js +1 -5
- package/dist/es/components/notify/tokens.js +1 -67
- package/dist/es/components/number-keyboard/NumberKeyboard.js +1 -467
- package/dist/es/components/number-keyboard/index.js +1 -3
- package/dist/es/components/number-keyboard/tokens.js +1 -53
- package/dist/es/components/overlay/Overlay.js +1 -50
- package/dist/es/components/overlay/index.js +1 -4
- package/dist/es/components/overlay/tokens.js +1 -7
- package/dist/es/components/password-input/PasswordInput.js +1 -327
- package/dist/es/components/password-input/index.js +1 -1
- package/dist/es/components/password-input/tokens.js +1 -41
- package/dist/es/components/picker/Picker.js +1 -1031
- package/dist/es/components/picker/index.js +1 -3
- package/dist/es/components/picker/tokens.js +1 -47
- package/dist/es/components/popup/Popup.js +1 -492
- package/dist/es/components/popup/index.js +1 -3
- package/dist/es/components/popup/tokens.js +1 -55
- package/dist/es/components/portal/Portal.js +1 -37
- package/dist/es/components/portal/PortalContext.js +1 -2
- package/dist/es/components/portal/PortalHost.js +1 -234
- package/dist/es/components/portal/index.js +1 -3
- package/dist/es/components/portal/tokens.js +1 -5
- package/dist/es/components/progress/Progress.js +1 -196
- package/dist/es/components/progress/index.js +1 -3
- package/dist/es/components/progress/tokens.js +1 -45
- package/dist/es/components/radio/Radio.js +1 -214
- package/dist/es/components/radio/RadioContext.js +1 -1
- package/dist/es/components/radio/RadioGroup.js +1 -82
- package/dist/es/components/radio/index.js +1 -5
- package/dist/es/components/radio/tokens.js +1 -80
- package/dist/es/components/safe-area-view/SafeAreaView.js +1 -40
- package/dist/es/components/safe-area-view/index.js +1 -1
- package/dist/es/components/safe-area-view/tokens.js +1 -5
- package/dist/es/components/search/Search.js +1 -189
- package/dist/es/components/search/index.js +1 -3
- package/dist/es/components/search/tokens.js +1 -48
- package/dist/es/components/selector/Selector.js +1 -166
- package/dist/es/components/selector/index.js +1 -3
- package/dist/es/components/selector/tokens.js +1 -88
- package/dist/es/components/share-sheet/ShareSheet.js +1 -266
- package/dist/es/components/share-sheet/index.js +1 -3
- package/dist/es/components/share-sheet/tokens.js +1 -49
- package/dist/es/components/sidebar/Sidebar.js +1 -84
- package/dist/es/components/sidebar/SidebarContext.js +1 -3
- package/dist/es/components/sidebar/SidebarItem.js +1 -84
- package/dist/es/components/sidebar/index.js +1 -8
- package/dist/es/components/sidebar/tokens.js +1 -80
- package/dist/es/components/skeleton/Skeleton.js +1 -143
- package/dist/es/components/skeleton/index.js +1 -4
- package/dist/es/components/skeleton/tokens.js +1 -33
- package/dist/es/components/slider/Slider.js +1 -596
- package/dist/es/components/slider/index.js +1 -2
- package/dist/es/components/slider/tokens.js +1 -31
- package/dist/es/components/space/Space.js +1 -115
- package/dist/es/components/space/index.js +1 -2
- package/dist/es/components/space/tokens.js +1 -32
- package/dist/es/components/stepper/Stepper.js +1 -465
- package/dist/es/components/stepper/index.js +1 -3
- package/dist/es/components/stepper/tokens.js +1 -54
- package/dist/es/components/swiper/Swiper.js +1 -344
- package/dist/es/components/swiper/SwiperItem.js +1 -1
- package/dist/es/components/swiper/SwiperPagIndicator.js +1 -87
- package/dist/es/components/swiper/index.js +1 -10
- package/dist/es/components/swiper/tokens.js +1 -12
- package/dist/es/components/switch/Switch.js +1 -83
- package/dist/es/components/switch/index.js +1 -3
- package/dist/es/components/switch/tokens.js +1 -25
- package/dist/es/components/tabbar/Tabbar.js +1 -130
- package/dist/es/components/tabbar/TabbarContext.js +1 -3
- package/dist/es/components/tabbar/TabbarItem.js +1 -133
- package/dist/es/components/tabbar/index.js +1 -7
- package/dist/es/components/tabbar/tokens.js +1 -35
- package/dist/es/components/tabs/Tabs.js +1 -841
- package/dist/es/components/tabs/index.js +1 -7
- package/dist/es/components/tabs/tokens.js +1 -105
- package/dist/es/components/tag/Tag.js +1 -105
- package/dist/es/components/tag/index.js +1 -2
- package/dist/es/components/tag/tokens.js +1 -97
- package/dist/es/components/toast/Toast.js +1 -277
- package/dist/es/components/toast/imperative.js +1 -130
- package/dist/es/components/toast/index.js +1 -5
- package/dist/es/components/toast/tokens.js +1 -36
- package/dist/es/components/typography/Typography.js +1 -162
- package/dist/es/components/typography/index.js +1 -2
- package/dist/es/components/typography/tokens.js +1 -82
- package/dist/es/components/water-mark/WaterMark.js +1 -153
- package/dist/es/components/water-mark/index.js +1 -4
- package/dist/es/components/water-mark/tokens.js +1 -42
- package/dist/es/design-system/Text.js +1 -19
- package/dist/es/design-system/ThemeContext.js +1 -6
- package/dist/es/design-system/ThemeProvider.js +1 -17
- package/dist/es/design-system/createComponentTokensHook.js +1 -15
- package/dist/es/design-system/index.js +1 -7
- package/dist/es/design-system/mergeTokensOverride.js +1 -2
- package/dist/es/design-system/presets.js +1 -139
- package/dist/es/design-system/tokens.js +1 -128
- package/dist/es/design-system/useTheme.js +1 -3
- package/dist/es/hooks/animation/index.js +1 -2
- package/dist/es/hooks/animation/useAnimatedTransition.js +1 -53
- package/dist/es/hooks/animation/useReducedMotion.js +1 -54
- package/dist/es/hooks/aria/index.js +1 -5
- package/dist/es/hooks/aria/useAriaListBox.js +1 -25
- package/dist/es/hooks/aria/useAriaOverlay.js +1 -25
- package/dist/es/hooks/aria/useAriaPress.js +1 -57
- package/dist/es/hooks/aria/useAriaToggle.js +1 -16
- package/dist/es/hooks/gesture/index.js +1 -2
- package/dist/es/hooks/gesture/useGestureScroll.js +1 -110
- package/dist/es/hooks/index.js +1 -8
- package/dist/es/hooks/overlay/OverlayStackStore.js +1 -93
- package/dist/es/hooks/overlay/index.js +1 -3
- package/dist/es/hooks/overlay/useOverlayStack.js +1 -40
- package/dist/es/hooks/useControllableValue.js +1 -29
- package/dist/es/hooks/useCountDown.js +1 -87
- package/dist/es/hooks/useHairline.js +1 -26
- package/dist/es/hooks/useSafeAreaPadding.js +1 -20
- package/dist/es/index.js +1 -11
- package/dist/es/nativewind.js +1 -0
- package/dist/es/platform/animation.js +1 -10
- package/dist/es/platform/history.js +1 -7
- package/dist/es/platform/index.js +1 -6
- package/dist/es/platform/measure.js +1 -32
- package/dist/es/platform/runtime.js +1 -4
- package/dist/es/platform/scrollLock.js +1 -16
- package/dist/es/types.js +1 -1
- package/dist/es/utils/array.js +1 -5
- package/dist/es/utils/color.js +1 -25
- package/dist/es/utils/compare.js +1 -13
- package/dist/es/utils/createPlatformShadow.js +1 -39
- package/dist/es/utils/date.js +1 -33
- package/dist/es/utils/deepMerge.js +1 -21
- package/dist/es/utils/hairline.js +1 -93
- package/dist/es/utils/index.js +1 -14
- package/dist/es/utils/number.js +1 -48
- package/dist/es/utils/promise.js +1 -2
- package/dist/es/utils/render.js +1 -7
- package/dist/es/utils/rtl.js +1 -17
- package/dist/es/utils/string.js +1 -13
- package/dist/es/utils/validate.js +1 -14
- package/dist/types/nativewind.d.ts +4 -0
- package/package.json +15 -3
|
@@ -1,262 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.NotifyContent = exports.Notify = void 0;
|
|
7
|
-
function _react() {
|
|
8
|
-
const data = _interopRequireWildcard(require("react"));
|
|
9
|
-
_react = function () {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
function _reactNative() {
|
|
15
|
-
const data = require("react-native");
|
|
16
|
-
_reactNative = function () {
|
|
17
|
-
return data;
|
|
18
|
-
};
|
|
19
|
-
return data;
|
|
20
|
-
}
|
|
21
|
-
var _utils = require("../../utils");
|
|
22
|
-
var _validate = require("../../utils/validate");
|
|
23
|
-
var _hooks = require("../../hooks");
|
|
24
|
-
var _Portal = _interopRequireDefault(require("../portal/Portal"));
|
|
25
|
-
var _platform = require("../../platform");
|
|
26
|
-
var _animation = require("../../hooks/animation");
|
|
27
|
-
var _tokens = require("./tokens");
|
|
28
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
29
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
30
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
31
|
-
const NotifyContentImpl = props => {
|
|
32
|
-
const {
|
|
33
|
-
visible,
|
|
34
|
-
message,
|
|
35
|
-
type: typeProp,
|
|
36
|
-
duration: durationProp,
|
|
37
|
-
position: positionProp,
|
|
38
|
-
offset: offsetProp,
|
|
39
|
-
color,
|
|
40
|
-
background,
|
|
41
|
-
zIndex,
|
|
42
|
-
closeOnClick: closeOnClickProp,
|
|
43
|
-
style,
|
|
44
|
-
textStyle,
|
|
45
|
-
tokensOverride,
|
|
46
|
-
onClick,
|
|
47
|
-
onClose,
|
|
48
|
-
onOpen,
|
|
49
|
-
onOpened,
|
|
50
|
-
onClosed
|
|
51
|
-
} = props;
|
|
52
|
-
const tokens = (0, _tokens.useNotifyTokens)(tokensOverride);
|
|
53
|
-
const reducedMotion = (0, _animation.useReducedMotion)();
|
|
54
|
-
const safeAreaPadding = (0, _hooks.useSafeAreaPadding)({
|
|
55
|
-
top: 0,
|
|
56
|
-
bottom: 0
|
|
57
|
-
});
|
|
58
|
-
const type = typeProp ?? tokens.defaults.type;
|
|
59
|
-
const position = positionProp ?? tokens.defaults.position;
|
|
60
|
-
const closeOnClick = closeOnClickProp ?? tokens.defaults.closeOnClick;
|
|
61
|
-
const safeAreaInsetTop = props.safeAreaInsetTop ?? (position === 'top' ? tokens.defaults.safeAreaInsetTop : false);
|
|
62
|
-
const safeAreaInsetBottom = props.safeAreaInsetBottom ?? (position === 'bottom' ? tokens.defaults.safeAreaInsetBottom : false);
|
|
63
|
-
const safeAreaTopValue = safeAreaInsetTop && position === 'top' ? safeAreaPadding.paddingTop : 0;
|
|
64
|
-
const safeAreaBottomValue = safeAreaInsetBottom && position === 'bottom' ? safeAreaPadding.paddingBottom : 0;
|
|
65
|
-
const offset = typeof offsetProp === 'number' && Number.isFinite(offsetProp) ? Math.max(0, offsetProp) : 0;
|
|
66
|
-
const addOffset = (value, delta) => typeof value === 'string' ? `calc(${value} + ${delta}px)` : value + delta;
|
|
67
|
-
const safeAreaBottomInset = safeAreaInsetBottom && position === 'bottom' && typeof safeAreaBottomValue === 'number' ? safeAreaBottomValue + offset : offset;
|
|
68
|
-
const webTopPadding = _reactNative().Platform.OS === 'web' && position === 'top' ? addOffset(safeAreaTopValue, offset) : undefined;
|
|
69
|
-
const webBottomPadding = _reactNative().Platform.OS === 'web' && safeAreaInsetBottom && position === 'bottom' ? addOffset(safeAreaBottomValue, offset) : undefined;
|
|
70
|
-
const variant = tokens.colors.variants[type];
|
|
71
|
-
const resolvedBackground = background ?? variant.background;
|
|
72
|
-
const resolvedTextColor = color ?? variant.text;
|
|
73
|
-
const resolvedDuration = durationProp ?? tokens.defaults.duration;
|
|
74
|
-
const onCloseRef = (0, _react().useRef)(onClose);
|
|
75
|
-
onCloseRef.current = onClose;
|
|
76
|
-
const onOpenRef = (0, _react().useRef)(onOpen);
|
|
77
|
-
onOpenRef.current = onOpen;
|
|
78
|
-
const onOpenedRef = (0, _react().useRef)(onOpened);
|
|
79
|
-
onOpenedRef.current = onOpened;
|
|
80
|
-
const onClosedRef = (0, _react().useRef)(onClosed);
|
|
81
|
-
onClosedRef.current = onClosed;
|
|
82
|
-
const onClickRef = (0, _react().useRef)(onClick);
|
|
83
|
-
onClickRef.current = onClick;
|
|
84
|
-
const [barHeight, setBarHeight] = (0, _react().useState)(0);
|
|
85
|
-
const handleLayout = (0, _react().useCallback)(e => {
|
|
86
|
-
const height = e.nativeEvent.layout.height;
|
|
87
|
-
if (!height) return;
|
|
88
|
-
setBarHeight(prev => prev === height ? prev : height);
|
|
89
|
-
}, []);
|
|
90
|
-
const canAnimate = barHeight > 0;
|
|
91
|
-
const [mounted, setMounted] = (0, _react().useState)(visible);
|
|
92
|
-
const animatedValue = (0, _react().useRef)(new (_reactNative().Animated.Value)(0)).current;
|
|
93
|
-
const animationRef = (0, _react().useRef)(null);
|
|
94
|
-
const animationIdRef = (0, _react().useRef)(0);
|
|
95
|
-
const {
|
|
96
|
-
zIndex: stackZIndex
|
|
97
|
-
} = (0, _hooks.useOverlayStack)({
|
|
98
|
-
visible: mounted,
|
|
99
|
-
type: 'notify',
|
|
100
|
-
zIndex
|
|
101
|
-
});
|
|
102
|
-
const resolvedZIndex = stackZIndex ?? zIndex;
|
|
103
|
-
const previousVisibleRef = (0, _react().useRef)(visible);
|
|
104
|
-
const closingRef = (0, _react().useRef)(false);
|
|
105
|
-
(0, _react().useEffect)(() => {
|
|
106
|
-
animationIdRef.current += 1;
|
|
107
|
-
const animationId = animationIdRef.current;
|
|
108
|
-
animationRef.current?.stop();
|
|
109
|
-
const d = reducedMotion ? 0 : tokens.defaults.animationDuration;
|
|
110
|
-
if (visible) {
|
|
111
|
-
setMounted(true);
|
|
112
|
-
if (!canAnimate) {
|
|
113
|
-
animatedValue.setValue(0);
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
animationRef.current = _reactNative().Animated.timing(animatedValue, {
|
|
117
|
-
toValue: 1,
|
|
118
|
-
duration: d,
|
|
119
|
-
easing: _reactNative().Easing.out(_reactNative().Easing.cubic),
|
|
120
|
-
useNativeDriver: _platform.nativeDriverEnabled,
|
|
121
|
-
isInteraction: false
|
|
122
|
-
});
|
|
123
|
-
animationRef.current.start();
|
|
124
|
-
} else {
|
|
125
|
-
if (!canAnimate) {
|
|
126
|
-
animatedValue.setValue(0);
|
|
127
|
-
setMounted(false);
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
animationRef.current = _reactNative().Animated.timing(animatedValue, {
|
|
131
|
-
toValue: 0,
|
|
132
|
-
duration: d,
|
|
133
|
-
easing: _reactNative().Easing.out(_reactNative().Easing.cubic),
|
|
134
|
-
useNativeDriver: _platform.nativeDriverEnabled,
|
|
135
|
-
isInteraction: false
|
|
136
|
-
});
|
|
137
|
-
animationRef.current.start(({
|
|
138
|
-
finished
|
|
139
|
-
}) => {
|
|
140
|
-
if (!finished || animationId !== animationIdRef.current) return;
|
|
141
|
-
setMounted(false);
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
}, [animatedValue, canAnimate, reducedMotion, tokens.defaults.animationDuration, visible]);
|
|
145
|
-
(0, _react().useEffect)(() => () => {
|
|
146
|
-
animationRef.current?.stop();
|
|
147
|
-
}, []);
|
|
148
|
-
const resolvedAnimDuration = reducedMotion ? 0 : tokens.defaults.animationDuration;
|
|
149
|
-
(0, _react().useEffect)(() => {
|
|
150
|
-
if (visible) {
|
|
151
|
-
closingRef.current = false;
|
|
152
|
-
if (!previousVisibleRef.current) {
|
|
153
|
-
onOpenRef.current?.();
|
|
154
|
-
if (onOpenedRef.current) {
|
|
155
|
-
const cb = onOpenedRef.current;
|
|
156
|
-
const t = setTimeout(cb, resolvedAnimDuration);
|
|
157
|
-
previousVisibleRef.current = visible;
|
|
158
|
-
return () => clearTimeout(t);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
} else if (previousVisibleRef.current) closingRef.current = true;
|
|
162
|
-
previousVisibleRef.current = visible;
|
|
163
|
-
}, [resolvedAnimDuration, visible]);
|
|
164
|
-
(0, _react().useEffect)(() => {
|
|
165
|
-
if (!mounted && closingRef.current) {
|
|
166
|
-
closingRef.current = false;
|
|
167
|
-
onClosedRef.current?.();
|
|
168
|
-
}
|
|
169
|
-
}, [mounted]);
|
|
170
|
-
(0, _react().useEffect)(() => {
|
|
171
|
-
if (!visible || resolvedDuration <= 0) return;
|
|
172
|
-
const timeout = setTimeout(() => {
|
|
173
|
-
onCloseRef.current?.();
|
|
174
|
-
}, resolvedDuration);
|
|
175
|
-
return () => clearTimeout(timeout);
|
|
176
|
-
}, [resolvedDuration, visible]);
|
|
177
|
-
const contentHeight = barHeight > 0 ? barHeight : tokens.sizing.minHeight;
|
|
178
|
-
const interactive = closeOnClick || (0, _utils.isFunction)(onClick);
|
|
179
|
-
const handlePress = (0, _react().useCallback)(() => {
|
|
180
|
-
onClickRef.current?.();
|
|
181
|
-
if (closeOnClick) onCloseRef.current?.();
|
|
182
|
-
}, [closeOnClick]);
|
|
183
|
-
const accessibilityRole = interactive ? 'button' : 'alert';
|
|
184
|
-
const pressProps = (0, _hooks.useAriaPress)({
|
|
185
|
-
disabled: !interactive,
|
|
186
|
-
onPress: handlePress,
|
|
187
|
-
extraProps: {
|
|
188
|
-
accessibilityRole,
|
|
189
|
-
accessibilityLiveRegion: 'assertive'
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
const translateY = (0, _react().useMemo)(() => position === 'bottom' ? animatedValue.interpolate({
|
|
193
|
-
inputRange: [0, 1],
|
|
194
|
-
outputRange: [contentHeight, 0]
|
|
195
|
-
}) : animatedValue.interpolate({
|
|
196
|
-
inputRange: [0, 1],
|
|
197
|
-
outputRange: [-contentHeight, 0]
|
|
198
|
-
}), [animatedValue, contentHeight, position]);
|
|
199
|
-
const hasMessage = (0, _validate.isRenderable)(message) && (typeof message !== 'string' || message !== '');
|
|
200
|
-
const barRender = (0, _react().useMemo)(() => /*#__PURE__*/_react().default.createElement(_reactNative().View, {
|
|
201
|
-
style: [tokens.layout.container, position === 'top' ? {
|
|
202
|
-
paddingTop: webTopPadding ?? addOffset(safeAreaTopValue, offset)
|
|
203
|
-
} : null, webBottomPadding !== undefined ? {
|
|
204
|
-
paddingBottom: webBottomPadding
|
|
205
|
-
} : null]
|
|
206
|
-
}, /*#__PURE__*/_react().default.createElement(_reactNative().View, {
|
|
207
|
-
style: {
|
|
208
|
-
height: contentHeight,
|
|
209
|
-
overflow: 'hidden'
|
|
210
|
-
}
|
|
211
|
-
}, /*#__PURE__*/_react().default.createElement(_reactNative().Animated.View, {
|
|
212
|
-
testID: "rv-notify-bar",
|
|
213
|
-
accessibilityRole: !interactive ? accessibilityRole : undefined,
|
|
214
|
-
accessibilityLiveRegion: !interactive ? 'assertive' : undefined,
|
|
215
|
-
renderToHardwareTextureAndroid: true,
|
|
216
|
-
shouldRasterizeIOS: true,
|
|
217
|
-
onLayout: handleLayout,
|
|
218
|
-
style: [tokens.layout.container, {
|
|
219
|
-
opacity: animatedValue,
|
|
220
|
-
transform: [{
|
|
221
|
-
translateY
|
|
222
|
-
}]
|
|
223
|
-
}, style]
|
|
224
|
-
}, /*#__PURE__*/_react().default.createElement(_reactNative().View, {
|
|
225
|
-
style: {
|
|
226
|
-
backgroundColor: resolvedBackground
|
|
227
|
-
}
|
|
228
|
-
}, /*#__PURE__*/_react().default.createElement(_reactNative().View, {
|
|
229
|
-
style: [tokens.layout.content, {
|
|
230
|
-
paddingHorizontal: tokens.spacing.paddingHorizontal,
|
|
231
|
-
paddingVertical: tokens.spacing.paddingVertical,
|
|
232
|
-
minHeight: tokens.sizing.minHeight
|
|
233
|
-
}]
|
|
234
|
-
}, hasMessage && ((0, _utils.isText)(message) ? (0, _utils.renderTextOrNode)(message, [tokens.layout.text, {
|
|
235
|
-
color: resolvedTextColor,
|
|
236
|
-
fontFamily: tokens.typography.fontFamily,
|
|
237
|
-
fontSize: tokens.typography.fontSize,
|
|
238
|
-
lineHeight: tokens.typography.lineHeight
|
|
239
|
-
}, textStyle]) : message))))), position === 'bottom' && /*#__PURE__*/_react().default.createElement(_reactNative().View, {
|
|
240
|
-
style: {
|
|
241
|
-
height: safeAreaBottomInset
|
|
242
|
-
}
|
|
243
|
-
})), [accessibilityRole, animatedValue, contentHeight, handleLayout, hasMessage, interactive, message, offset, resolvedBackground, resolvedTextColor, safeAreaBottomInset, safeAreaTopValue, style, textStyle, tokens.layout.container, tokens.layout.content, tokens.layout.text, tokens.sizing.minHeight, tokens.spacing.paddingHorizontal, tokens.spacing.paddingVertical, tokens.typography.fontFamily, tokens.typography.fontSize, tokens.typography.lineHeight, translateY, webBottomPadding, webTopPadding, position]);
|
|
244
|
-
if (!mounted) return null;
|
|
245
|
-
return /*#__PURE__*/_react().default.createElement(_reactNative().View, {
|
|
246
|
-
testID: "rv-notify",
|
|
247
|
-
pointerEvents: interactive ? 'box-none' : 'none',
|
|
248
|
-
style: [tokens.layout.portal, position === 'bottom' ? {
|
|
249
|
-
bottom: 0
|
|
250
|
-
} : {
|
|
251
|
-
top: 0
|
|
252
|
-
}, resolvedZIndex != null ? {
|
|
253
|
-
zIndex: resolvedZIndex
|
|
254
|
-
} : null]
|
|
255
|
-
}, interactive ? /*#__PURE__*/_react().default.createElement(_reactNative().Pressable, _extends({}, pressProps.interactionProps, {
|
|
256
|
-
disabled: !interactive
|
|
257
|
-
}), barRender) : barRender);
|
|
258
|
-
};
|
|
259
|
-
const NotifyContent = exports.NotifyContent = /*#__PURE__*/_react().default.memo(NotifyContentImpl);
|
|
260
|
-
const NotifyImpl = props => /*#__PURE__*/_react().default.createElement(_Portal.default, null, /*#__PURE__*/_react().default.createElement(NotifyContent, props));
|
|
261
|
-
const Notify = exports.Notify = /*#__PURE__*/_react().default.memo(NotifyImpl);
|
|
262
|
-
var _default = exports.default = Notify;
|
|
1
|
+
"use strict";function _react(){const e=_interopRequireWildcard(require("react"));return _react=function(){return e},e}function _reactNative(){const e=require("react-native");return _reactNative=function(){return e},e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.NotifyContent=exports.Notify=void 0;var _utils=require("../../utils"),_validate=require("../../utils/validate"),_hooks=require("../../hooks"),_Portal=_interopRequireDefault(require("../portal/Portal")),_platform=require("../../platform"),_animation=require("../../hooks/animation"),_tokens=require("./tokens");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap,a=new WeakMap;return(_interopRequireWildcard=function(e,t){if(!t&&e&&e.__esModule)return e;var n,i,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(n=t?a:r){if(n.has(e))return n.get(e);n.set(e,o)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((i=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(i.get||i.set)?n(o,t,i):o[t]=e[t]);return o})(e,t)}function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},_extends.apply(null,arguments)}const NotifyContentImpl=e=>{const{visible:t,message:r,type:a,duration:n,position:i,offset:o,color:u,background:c,zIndex:s,closeOnClick:l,style:f,textStyle:d,tokensOverride:p,onClick:_,onClose:y,onOpen:m,onOpened:v,onClosed:g}=e,b=(0,_tokens.useNotifyTokens)(p),N=(0,_animation.useReducedMotion)(),h=(0,_hooks.useSafeAreaPadding)({top:0,bottom:0}),x=a??b.defaults.type,R=i??b.defaults.position,k=l??b.defaults.closeOnClick,E=e.safeAreaInsetTop??("top"===R&&b.defaults.safeAreaInsetTop),O=e.safeAreaInsetBottom??("bottom"===R&&b.defaults.safeAreaInsetBottom),w=E&&"top"===R?h.paddingTop:0,I=O&&"bottom"===R?h.paddingBottom:0,P="number"==typeof o&&Number.isFinite(o)?Math.max(0,o):0,V=(e,t)=>"string"==typeof e?`calc(${e} + ${t}px)`:e+t,q=O&&"bottom"===R&&"number"==typeof I?I+P:P,z="web"===_reactNative().Platform.OS&&"top"===R?V(w,P):void 0,C="web"===_reactNative().Platform.OS&&O&&"bottom"===R?V(I,P):void 0,T=b.colors.variants[x],D=c??T.background,A=u??T.text,H=n??b.defaults.duration,S=(0,_react().useRef)(y);S.current=y;const M=(0,_react().useRef)(m);M.current=m;const j=(0,_react().useRef)(v);j.current=v;const W=(0,_react().useRef)(g);W.current=g;const F=(0,_react().useRef)(_);F.current=_;const[B,L]=(0,_react().useState)(0),$=(0,_react().useCallback)(e=>{const t=e.nativeEvent.layout.height;t&&L(e=>e===t?e:t)},[]),Y=B>0,[G,J]=(0,_react().useState)(t),K=(0,_react().useRef)(new(_reactNative().Animated.Value)(0)).current,Q=(0,_react().useRef)(null),U=(0,_react().useRef)(0),{zIndex:X}=(0,_hooks.useOverlayStack)({visible:G,type:"notify",zIndex:s}),Z=X??s,ee=(0,_react().useRef)(t),te=(0,_react().useRef)(!1);(0,_react().useEffect)(()=>{U.current+=1;const e=U.current;Q.current?.stop();const r=N?0:b.defaults.animationDuration;if(t){if(J(!0),!Y)return void K.setValue(0);Q.current=_reactNative().Animated.timing(K,{toValue:1,duration:r,easing:_reactNative().Easing.out(_reactNative().Easing.cubic),useNativeDriver:_platform.nativeDriverEnabled,isInteraction:!1}),Q.current.start()}else{if(!Y)return K.setValue(0),void J(!1);Q.current=_reactNative().Animated.timing(K,{toValue:0,duration:r,easing:_reactNative().Easing.out(_reactNative().Easing.cubic),useNativeDriver:_platform.nativeDriverEnabled,isInteraction:!1}),Q.current.start(({finished:t})=>{t&&e===U.current&&J(!1)})}},[K,Y,N,b.defaults.animationDuration,t]),(0,_react().useEffect)(()=>()=>{Q.current?.stop()},[]);const re=N?0:b.defaults.animationDuration;(0,_react().useEffect)(()=>{if(t){if(te.current=!1,!ee.current&&(M.current?.(),j.current)){const e=j.current,r=setTimeout(e,re);return ee.current=t,()=>clearTimeout(r)}}else ee.current&&(te.current=!0);ee.current=t},[re,t]),(0,_react().useEffect)(()=>{!G&&te.current&&(te.current=!1,W.current?.())},[G]),(0,_react().useEffect)(()=>{if(!t||H<=0)return;const e=setTimeout(()=>{S.current?.()},H);return()=>clearTimeout(e)},[H,t]);const ae=B>0?B:b.sizing.minHeight,ne=k||(0,_utils.isFunction)(_),ie=(0,_react().useCallback)(()=>{F.current?.(),k&&S.current?.()},[k]),oe=ne?"button":"alert",ue=(0,_hooks.useAriaPress)({disabled:!ne,onPress:ie,extraProps:{accessibilityRole:oe,accessibilityLiveRegion:"assertive"}}),ce=(0,_react().useMemo)(()=>"bottom"===R?K.interpolate({inputRange:[0,1],outputRange:[ae,0]}):K.interpolate({inputRange:[0,1],outputRange:[-ae,0]}),[K,ae,R]),se=(0,_validate.isRenderable)(r)&&("string"!=typeof r||""!==r),le=(0,_react().useMemo)(()=>_react().default.createElement(_reactNative().View,{style:[b.layout.container,"top"===R?{paddingTop:z??V(w,P)}:null,void 0!==C?{paddingBottom:C}:null]},_react().default.createElement(_reactNative().View,{style:{height:ae,overflow:"hidden"}},_react().default.createElement(_reactNative().Animated.View,{testID:"rv-notify-bar",accessibilityRole:ne?void 0:oe,accessibilityLiveRegion:ne?void 0:"assertive",renderToHardwareTextureAndroid:!0,shouldRasterizeIOS:!0,onLayout:$,style:[b.layout.container,{opacity:K,transform:[{translateY:ce}]},f]},_react().default.createElement(_reactNative().View,{style:{backgroundColor:D}},_react().default.createElement(_reactNative().View,{style:[b.layout.content,{paddingHorizontal:b.spacing.paddingHorizontal,paddingVertical:b.spacing.paddingVertical,minHeight:b.sizing.minHeight}]},se&&((0,_utils.isText)(r)?(0,_utils.renderTextOrNode)(r,[b.layout.text,{color:A,fontFamily:b.typography.fontFamily,fontSize:b.typography.fontSize,lineHeight:b.typography.lineHeight},d]):r))))),"bottom"===R&&_react().default.createElement(_reactNative().View,{style:{height:q}})),[oe,K,ae,$,se,ne,r,P,D,A,q,w,f,d,b.layout.container,b.layout.content,b.layout.text,b.sizing.minHeight,b.spacing.paddingHorizontal,b.spacing.paddingVertical,b.typography.fontFamily,b.typography.fontSize,b.typography.lineHeight,ce,C,z,R]);return G?_react().default.createElement(_reactNative().View,{testID:"rv-notify",pointerEvents:ne?"box-none":"none",style:[b.layout.portal,"bottom"===R?{bottom:0}:{top:0},null!=Z?{zIndex:Z}:null]},ne?_react().default.createElement(_reactNative().Pressable,_extends({},ue.interactionProps,{disabled:!ne}),le):le):null},NotifyContent=exports.NotifyContent=_react().default.memo(NotifyContentImpl),NotifyImpl=e=>_react().default.createElement(_Portal.default,null,_react().default.createElement(NotifyContent,e)),Notify=exports.Notify=_react().default.memo(NotifyImpl);var _default=exports.default=Notify;
|
|
@@ -1,145 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.NotifyImperative = void 0;
|
|
7
|
-
function _react() {
|
|
8
|
-
const data = _interopRequireWildcard(require("react"));
|
|
9
|
-
_react = function () {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
var _Portal = _interopRequireDefault(require("../portal/Portal"));
|
|
15
|
-
var _utils = require("../../utils");
|
|
16
|
-
var _Notify = require("./Notify");
|
|
17
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
19
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
20
|
-
const activeKeys = new Set();
|
|
21
|
-
const notifyOptions = new Map();
|
|
22
|
-
const notifyControllers = new Map();
|
|
23
|
-
let allowMultiple = false;
|
|
24
|
-
const baseOptions = {
|
|
25
|
-
type: 'primary',
|
|
26
|
-
position: 'top',
|
|
27
|
-
duration: 3000,
|
|
28
|
-
safeAreaInsetTop: true,
|
|
29
|
-
safeAreaInsetBottom: true
|
|
30
|
-
};
|
|
31
|
-
let currentOptions = {
|
|
32
|
-
...baseOptions
|
|
33
|
-
};
|
|
34
|
-
const typeDefaults = new Map();
|
|
35
|
-
const parseOptions = input => /*#__PURE__*/_react().default.isValidElement(input) || (0, _utils.isText)(input) ? {
|
|
36
|
-
message: input
|
|
37
|
-
} : input ?? {};
|
|
38
|
-
const mergeOptions = (input, fallbackT) => {
|
|
39
|
-
const t = input.type ?? fallbackT;
|
|
40
|
-
const m = {
|
|
41
|
-
...currentOptions,
|
|
42
|
-
...typeDefaults.get(t),
|
|
43
|
-
...input,
|
|
44
|
-
type: t
|
|
45
|
-
};
|
|
46
|
-
m.duration = m.duration ?? 3000;
|
|
47
|
-
return m;
|
|
48
|
-
};
|
|
49
|
-
const removeNotify = key => {
|
|
50
|
-
_Portal.default.remove(key);
|
|
51
|
-
activeKeys.delete(key);
|
|
52
|
-
notifyOptions.delete(key);
|
|
53
|
-
notifyControllers.delete(key);
|
|
54
|
-
};
|
|
55
|
-
const closeNotify = key => {
|
|
56
|
-
const c = notifyControllers.get(key);
|
|
57
|
-
c ? c.close() : removeNotify(key);
|
|
58
|
-
};
|
|
59
|
-
const NotifyPortal = ({
|
|
60
|
-
id,
|
|
61
|
-
options
|
|
62
|
-
}) => {
|
|
63
|
-
const [visible, setVisible] = (0, _react().useState)(true);
|
|
64
|
-
(0, _react().useEffect)(() => {
|
|
65
|
-
notifyControllers.set(id, {
|
|
66
|
-
close: () => setVisible(false)
|
|
67
|
-
});
|
|
68
|
-
return () => {
|
|
69
|
-
notifyControllers.delete(id);
|
|
70
|
-
};
|
|
71
|
-
}, [id]);
|
|
72
|
-
const handleClose = (0, _react().useCallback)(() => {
|
|
73
|
-
options.onClose?.();
|
|
74
|
-
setVisible(false);
|
|
75
|
-
}, [options]);
|
|
76
|
-
const handleClosed = (0, _react().useCallback)(() => {
|
|
77
|
-
options.onClosed?.();
|
|
78
|
-
removeNotify(id);
|
|
79
|
-
}, [id, options]);
|
|
80
|
-
return /*#__PURE__*/_react().default.createElement(_Notify.NotifyContent, _extends({}, options, {
|
|
81
|
-
visible: visible,
|
|
82
|
-
onClose: handleClose,
|
|
83
|
-
onClosed: handleClosed
|
|
84
|
-
}));
|
|
85
|
-
};
|
|
86
|
-
const showNotify = (input, fallbackT = 'primary') => {
|
|
87
|
-
const opts = mergeOptions(parseOptions(input), fallbackT);
|
|
88
|
-
if (!allowMultiple) activeKeys.forEach(k => closeNotify(k));
|
|
89
|
-
const key = _Portal.default.add(null);
|
|
90
|
-
notifyOptions.set(key, opts);
|
|
91
|
-
_Portal.default.update(key, /*#__PURE__*/_react().default.createElement(NotifyPortal, {
|
|
92
|
-
id: key,
|
|
93
|
-
options: opts
|
|
94
|
-
}));
|
|
95
|
-
activeKeys.add(key);
|
|
96
|
-
const config = next => {
|
|
97
|
-
const prev = notifyOptions.get(key);
|
|
98
|
-
if (!prev) return;
|
|
99
|
-
const parsed = parseOptions((0, _utils.isFunction)(next) ? next(prev) : next);
|
|
100
|
-
const nextT = parsed.type ?? prev.type ?? fallbackT;
|
|
101
|
-
const m = {
|
|
102
|
-
...prev,
|
|
103
|
-
...parsed,
|
|
104
|
-
type: nextT
|
|
105
|
-
};
|
|
106
|
-
if ('duration' in parsed && parsed.duration == null) m.duration = baseOptions.duration ?? 3000;
|
|
107
|
-
notifyOptions.set(key, m);
|
|
108
|
-
_Portal.default.update(key, /*#__PURE__*/_react().default.createElement(NotifyPortal, {
|
|
109
|
-
id: key,
|
|
110
|
-
options: m
|
|
111
|
-
}));
|
|
112
|
-
};
|
|
113
|
-
return {
|
|
114
|
-
clear: () => closeNotify(key),
|
|
115
|
-
update: n => config(n),
|
|
116
|
-
config
|
|
117
|
-
};
|
|
118
|
-
};
|
|
119
|
-
const NotifyImperative = exports.NotifyImperative = {
|
|
120
|
-
show: options => showNotify(options),
|
|
121
|
-
primary: options => showNotify(options, 'primary'),
|
|
122
|
-
success: options => showNotify(options, 'success'),
|
|
123
|
-
danger: options => showNotify(options, 'danger'),
|
|
124
|
-
warning: options => showNotify(options, 'warning'),
|
|
125
|
-
clear: () => {
|
|
126
|
-
activeKeys.forEach(key => closeNotify(key));
|
|
127
|
-
},
|
|
128
|
-
allowMultiple: (value = true) => {
|
|
129
|
-
allowMultiple = value;
|
|
130
|
-
},
|
|
131
|
-
setDefaultOptions: (typeOrOptions, options) => {
|
|
132
|
-
if ((0, _utils.isString)(typeOrOptions)) typeDefaults.set(typeOrOptions, options ?? {});else currentOptions = {
|
|
133
|
-
...currentOptions,
|
|
134
|
-
...typeOrOptions
|
|
135
|
-
};
|
|
136
|
-
},
|
|
137
|
-
resetDefaultOptions: type => {
|
|
138
|
-
if (type) typeDefaults.delete(type);else {
|
|
139
|
-
currentOptions = {
|
|
140
|
-
...baseOptions
|
|
141
|
-
};
|
|
142
|
-
typeDefaults.clear();
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
};
|
|
1
|
+
"use strict";function _react(){const e=_interopRequireWildcard(require("react"));return _react=function(){return e},e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.NotifyImperative=void 0;var _Portal=_interopRequireDefault(require("../portal/Portal")),_utils=require("../../utils"),_Notify=require("./Notify");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var o=new WeakMap,r=new WeakMap;return(_interopRequireWildcard=function(e,t){if(!t&&e&&e.__esModule)return e;var n,i,s={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return s;if(n=t?r:o){if(n.has(e))return n.get(e);n.set(e,s)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((i=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(i.get||i.set)?n(s,t,i):s[t]=e[t]);return s})(e,t)}function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)({}).hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},_extends.apply(null,arguments)}const activeKeys=new Set,notifyOptions=new Map,notifyControllers=new Map;let allowMultiple=!1;const baseOptions={type:"primary",position:"top",duration:3e3,safeAreaInsetTop:!0,safeAreaInsetBottom:!0};let currentOptions={...baseOptions};const typeDefaults=new Map,parseOptions=e=>_react().default.isValidElement(e)||(0,_utils.isText)(e)?{message:e}:e??{},mergeOptions=(e,t)=>{const o=e.type??t,r={...currentOptions,...typeDefaults.get(o),...e,type:o};return r.duration=r.duration??3e3,r},removeNotify=e=>{_Portal.default.remove(e),activeKeys.delete(e),notifyOptions.delete(e),notifyControllers.delete(e)},closeNotify=e=>{const t=notifyControllers.get(e);t?t.close():removeNotify(e)},NotifyPortal=({id:e,options:t})=>{const[o,r]=(0,_react().useState)(!0);(0,_react().useEffect)(()=>(notifyControllers.set(e,{close:()=>r(!1)}),()=>{notifyControllers.delete(e)}),[e]);const n=(0,_react().useCallback)(()=>{t.onClose?.(),r(!1)},[t]),i=(0,_react().useCallback)(()=>{t.onClosed?.(),removeNotify(e)},[e,t]);return _react().default.createElement(_Notify.NotifyContent,_extends({},t,{visible:o,onClose:n,onClosed:i}))},showNotify=(e,t="primary")=>{const o=mergeOptions(parseOptions(e),t);allowMultiple||activeKeys.forEach(e=>closeNotify(e));const r=_Portal.default.add(null);notifyOptions.set(r,o),_Portal.default.update(r,_react().default.createElement(NotifyPortal,{id:r,options:o})),activeKeys.add(r);const n=e=>{const o=notifyOptions.get(r);if(!o)return;const n=parseOptions((0,_utils.isFunction)(e)?e(o):e),i=n.type??o.type??t,s={...o,...n,type:i};"duration"in n&&null==n.duration&&(s.duration=baseOptions.duration??3e3),notifyOptions.set(r,s),_Portal.default.update(r,_react().default.createElement(NotifyPortal,{id:r,options:s}))};return{clear:()=>closeNotify(r),update:e=>n(e),config:n}},NotifyImperative=exports.NotifyImperative={show:e=>showNotify(e),primary:e=>showNotify(e,"primary"),success:e=>showNotify(e,"success"),danger:e=>showNotify(e,"danger"),warning:e=>showNotify(e,"warning"),clear:()=>{activeKeys.forEach(e=>closeNotify(e))},allowMultiple:(e=!0)=>{allowMultiple=e},setDefaultOptions:(e,t)=>{(0,_utils.isString)(e)?typeDefaults.set(e,t??{}):currentOptions={...currentOptions,...e}},resetDefaultOptions:e=>{e?typeDefaults.delete(e):(currentOptions={...baseOptions},typeDefaults.clear())}};
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.Notify = void 0;
|
|
7
|
-
var _Notify = require("./Notify");
|
|
8
|
-
var _imperative = require("./imperative");
|
|
9
|
-
const Notify = exports.Notify = Object.assign(_Notify.Notify, _imperative.NotifyImperative);
|
|
10
|
-
var _default = exports.default = Notify;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Notify=void 0;var _Notify=require("./Notify"),_imperative=require("./imperative");const Notify=exports.Notify=Object.assign(_Notify.Notify,_imperative.NotifyImperative);var _default=exports.default=Notify;
|
|
@@ -1,74 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useNotifyTokens = exports.createNotifyTokens = void 0;
|
|
7
|
-
var _designSystem = require("../../design-system");
|
|
8
|
-
const createNotifyTokens = foundations => ({
|
|
9
|
-
defaults: {
|
|
10
|
-
type: 'primary',
|
|
11
|
-
position: 'top',
|
|
12
|
-
duration: 3000,
|
|
13
|
-
closeOnClick: false,
|
|
14
|
-
animationDuration: 180,
|
|
15
|
-
safeAreaInsetTop: true,
|
|
16
|
-
safeAreaInsetBottom: true
|
|
17
|
-
},
|
|
18
|
-
layout: {
|
|
19
|
-
portal: {
|
|
20
|
-
position: 'absolute',
|
|
21
|
-
left: 0,
|
|
22
|
-
right: 0
|
|
23
|
-
},
|
|
24
|
-
container: {
|
|
25
|
-
width: '100%'
|
|
26
|
-
},
|
|
27
|
-
safeArea: {
|
|
28
|
-
width: '100%'
|
|
29
|
-
},
|
|
30
|
-
content: {
|
|
31
|
-
width: '100%',
|
|
32
|
-
justifyContent: 'center'
|
|
33
|
-
},
|
|
34
|
-
text: {
|
|
35
|
-
textAlign: 'center',
|
|
36
|
-
includeFontPadding: false
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
colors: {
|
|
40
|
-
variants: {
|
|
41
|
-
primary: {
|
|
42
|
-
background: foundations.palette.primary[500],
|
|
43
|
-
text: foundations.palette.primary.foreground ?? '#ffffff'
|
|
44
|
-
},
|
|
45
|
-
success: {
|
|
46
|
-
background: foundations.palette.success[500],
|
|
47
|
-
text: foundations.palette.success.foreground ?? '#ffffff'
|
|
48
|
-
},
|
|
49
|
-
danger: {
|
|
50
|
-
background: foundations.palette.danger[500],
|
|
51
|
-
text: foundations.palette.danger.foreground ?? '#ffffff'
|
|
52
|
-
},
|
|
53
|
-
warning: {
|
|
54
|
-
background: foundations.palette.warning[500],
|
|
55
|
-
text: foundations.palette.warning.foreground ?? '#261400'
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
typography: {
|
|
60
|
-
fontFamily: foundations.typography.fontFamily,
|
|
61
|
-
fontSize: foundations.fontSize.sm,
|
|
62
|
-
lineHeight: Math.round(foundations.fontSize.sm * foundations.typography.lineHeightMultiplier)
|
|
63
|
-
},
|
|
64
|
-
sizing: {
|
|
65
|
-
minHeight: 35
|
|
66
|
-
},
|
|
67
|
-
spacing: {
|
|
68
|
-
paddingVertical: foundations.spacing.ssm,
|
|
69
|
-
paddingHorizontal: foundations.spacing.md,
|
|
70
|
-
none: foundations.spacing.none
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
exports.createNotifyTokens = createNotifyTokens;
|
|
74
|
-
const useNotifyTokens = exports.useNotifyTokens = (0, _designSystem.createComponentTokensHook)('notify', createNotifyTokens);
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useNotifyTokens=exports.createNotifyTokens=void 0;var _designSystem=require("../../design-system");const createNotifyTokens=e=>({defaults:{type:"primary",position:"top",duration:3e3,closeOnClick:!1,animationDuration:180,safeAreaInsetTop:!0,safeAreaInsetBottom:!0},layout:{portal:{position:"absolute",left:0,right:0},container:{width:"100%"},safeArea:{width:"100%"},content:{width:"100%",justifyContent:"center"},text:{textAlign:"center",includeFontPadding:!1}},colors:{variants:{primary:{background:e.palette.primary[500],text:e.palette.primary.foreground??"#ffffff"},success:{background:e.palette.success[500],text:e.palette.success.foreground??"#ffffff"},danger:{background:e.palette.danger[500],text:e.palette.danger.foreground??"#ffffff"},warning:{background:e.palette.warning[500],text:e.palette.warning.foreground??"#261400"}}},typography:{fontFamily:e.typography.fontFamily,fontSize:e.fontSize.sm,lineHeight:Math.round(e.fontSize.sm*e.typography.lineHeightMultiplier)},sizing:{minHeight:35},spacing:{paddingVertical:e.spacing.ssm,paddingHorizontal:e.spacing.md,none:e.spacing.none}});exports.createNotifyTokens=createNotifyTokens;const useNotifyTokens=exports.useNotifyTokens=(0,_designSystem.createComponentTokensHook)("notify",createNotifyTokens);
|