@oxyhq/bloom 0.50.2 → 0.51.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/NOTICE +89 -0
- package/README.md +12 -7
- package/lib/commonjs/avatar-group/AvatarGroup.web.js +2 -1
- package/lib/commonjs/avatar-group/AvatarGroup.web.js.map +1 -1
- package/lib/commonjs/bottom-sheet/index.web.js +2 -1
- package/lib/commonjs/bottom-sheet/index.web.js.map +1 -1
- package/lib/commonjs/context-menu/index.web.js +3 -2
- package/lib/commonjs/context-menu/index.web.js.map +1 -1
- package/lib/commonjs/dialog/Dialog.web.js +4 -3
- package/lib/commonjs/dialog/Dialog.web.js.map +1 -1
- package/lib/commonjs/index.js +90 -83
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +116 -109
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/menu/index.web.js +2 -1
- package/lib/commonjs/menu/index.web.js.map +1 -1
- package/lib/commonjs/popover/index.web.js +3 -2
- package/lib/commonjs/popover/index.web.js.map +1 -1
- package/lib/commonjs/portal/index.js +4 -1
- package/lib/commonjs/portal/index.js.map +1 -1
- package/lib/commonjs/progressive-blur/index.js +79 -0
- package/lib/commonjs/progressive-blur/index.js.map +1 -0
- package/lib/commonjs/progressive-blur/index.web.js +67 -0
- package/lib/commonjs/progressive-blur/index.web.js.map +1 -0
- package/lib/commonjs/progressive-blur/shared.js +66 -0
- package/lib/commonjs/progressive-blur/shared.js.map +1 -0
- package/lib/commonjs/progressive-blur/types.js +6 -0
- package/lib/commonjs/progressive-blur/types.js.map +1 -0
- package/lib/commonjs/select/index.web.js +2 -1
- package/lib/commonjs/select/index.web.js.map +1 -1
- package/lib/commonjs/styles/web-view-style.js +26 -0
- package/lib/commonjs/styles/web-view-style.js.map +1 -0
- package/lib/commonjs/tab-bar/TabBarBase.js +415 -0
- package/lib/commonjs/tab-bar/TabBarBase.js.map +1 -0
- package/lib/commonjs/tab-bar/expo-router/RouterTabBar.js +83 -0
- package/lib/commonjs/tab-bar/expo-router/RouterTabBar.js.map +1 -0
- package/lib/commonjs/tab-bar/expo-router/fading-tab-screen.js +119 -0
- package/lib/commonjs/tab-bar/expo-router/fading-tab-screen.js.map +1 -0
- package/lib/commonjs/tab-bar/expo-router/index.js +26 -0
- package/lib/commonjs/tab-bar/expo-router/index.js.map +1 -0
- package/lib/commonjs/tab-bar/glyph.js +43 -0
- package/lib/commonjs/tab-bar/glyph.js.map +1 -0
- package/lib/commonjs/tab-bar/glyph.native.js +55 -0
- package/lib/commonjs/tab-bar/glyph.native.js.map +1 -0
- package/lib/commonjs/tab-bar/index.js +65 -0
- package/lib/commonjs/tab-bar/index.js.map +1 -0
- package/lib/commonjs/tab-bar/index.web.js +67 -0
- package/lib/commonjs/tab-bar/index.web.js.map +1 -0
- package/lib/commonjs/tab-bar/minimize-context.js +127 -0
- package/lib/commonjs/tab-bar/minimize-context.js.map +1 -0
- package/lib/commonjs/tab-bar/shared.js +139 -0
- package/lib/commonjs/tab-bar/shared.js.map +1 -0
- package/lib/commonjs/tab-bar/surface.js +50 -0
- package/lib/commonjs/tab-bar/surface.js.map +1 -0
- package/lib/commonjs/tab-bar/surface.native.js +56 -0
- package/lib/commonjs/tab-bar/surface.native.js.map +1 -0
- package/lib/commonjs/tab-bar/surface.web.js +59 -0
- package/lib/commonjs/tab-bar/surface.web.js.map +1 -0
- package/lib/commonjs/tab-bar/types.js +6 -0
- package/lib/commonjs/tab-bar/types.js.map +1 -0
- package/lib/commonjs/toast/Positioner.js +117 -0
- package/lib/commonjs/toast/Positioner.js.map +1 -0
- package/lib/commonjs/toast/ToastContent.js +301 -0
- package/lib/commonjs/toast/ToastContent.js.map +1 -0
- package/lib/commonjs/toast/ToastHost.js +69 -0
- package/lib/commonjs/toast/ToastHost.js.map +1 -0
- package/lib/commonjs/toast/ToastHost.native.js +44 -0
- package/lib/commonjs/toast/ToastHost.native.js.map +1 -0
- package/lib/commonjs/toast/ToastIcon.js +57 -0
- package/lib/commonjs/toast/ToastIcon.js.map +1 -0
- package/lib/commonjs/toast/ToastRow.js +411 -0
- package/lib/commonjs/toast/ToastRow.js.map +1 -0
- package/lib/commonjs/toast/ToastSwipeHandler.js +189 -0
- package/lib/commonjs/toast/ToastSwipeHandler.js.map +1 -0
- package/lib/commonjs/toast/Toaster.js +205 -0
- package/lib/commonjs/toast/Toaster.js.map +1 -0
- package/lib/commonjs/toast/animations.js +274 -0
- package/lib/commonjs/toast/animations.js.map +1 -0
- package/lib/commonjs/toast/constants.js +56 -0
- package/lib/commonjs/toast/constants.js.map +1 -0
- package/lib/commonjs/toast/context.js +42 -0
- package/lib/commonjs/toast/context.js.map +1 -0
- package/lib/commonjs/toast/index.js +32 -126
- package/lib/commonjs/toast/index.js.map +1 -1
- package/lib/commonjs/toast/position-utils.js +115 -0
- package/lib/commonjs/toast/position-utils.js.map +1 -0
- package/lib/commonjs/toast/positioner-utils.js +141 -0
- package/lib/commonjs/toast/positioner-utils.js.map +1 -0
- package/lib/commonjs/toast/toast-comparator.js +28 -0
- package/lib/commonjs/toast/toast-comparator.js.map +1 -0
- package/lib/commonjs/toast/toast-fns.js +90 -0
- package/lib/commonjs/toast/toast-fns.js.map +1 -0
- package/lib/commonjs/toast/toast-store.js +352 -0
- package/lib/commonjs/toast/toast-store.js.map +1 -0
- package/lib/commonjs/toast/toast-timers.js +110 -0
- package/lib/commonjs/toast/toast-timers.js.map +1 -0
- package/lib/commonjs/toast/types.js +42 -0
- package/lib/commonjs/toast/types.js.map +1 -1
- package/lib/commonjs/toast/use-animated-target.js +57 -0
- package/lib/commonjs/toast/use-animated-target.js.map +1 -0
- package/lib/commonjs/toast/use-app-state.js +76 -0
- package/lib/commonjs/toast/use-app-state.js.map +1 -0
- package/lib/commonjs/toast/use-toast-colors.js +114 -0
- package/lib/commonjs/toast/use-toast-colors.js.map +1 -0
- package/lib/commonjs/toast/use-toast-position.js +40 -0
- package/lib/commonjs/toast/use-toast-position.js.map +1 -0
- package/lib/commonjs/tooltip/index.web.js +2 -1
- package/lib/commonjs/tooltip/index.web.js.map +1 -1
- package/lib/commonjs/zoomable-image-gallery/ZoomableImageGallery.js +20 -8
- package/lib/commonjs/zoomable-image-gallery/ZoomableImageGallery.js.map +1 -1
- package/lib/module/avatar-group/AvatarGroup.web.js +2 -1
- package/lib/module/avatar-group/AvatarGroup.web.js.map +1 -1
- package/lib/module/bottom-sheet/index.web.js +2 -1
- package/lib/module/bottom-sheet/index.web.js.map +1 -1
- package/lib/module/context-menu/index.web.js +3 -2
- package/lib/module/context-menu/index.web.js.map +1 -1
- package/lib/module/dialog/Dialog.web.js +4 -3
- package/lib/module/dialog/Dialog.web.js.map +1 -1
- package/lib/module/index.js +3 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +3 -2
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/menu/index.web.js +2 -1
- package/lib/module/menu/index.web.js.map +1 -1
- package/lib/module/popover/index.web.js +3 -2
- package/lib/module/popover/index.web.js.map +1 -1
- package/lib/module/portal/index.js +4 -1
- package/lib/module/portal/index.js.map +1 -1
- package/lib/module/progressive-blur/index.js +74 -0
- package/lib/module/progressive-blur/index.js.map +1 -0
- package/lib/module/progressive-blur/index.web.js +62 -0
- package/lib/module/progressive-blur/index.web.js.map +1 -0
- package/lib/module/progressive-blur/shared.js +60 -0
- package/lib/module/progressive-blur/shared.js.map +1 -0
- package/lib/module/progressive-blur/types.js +4 -0
- package/lib/module/progressive-blur/types.js.map +1 -0
- package/lib/module/select/index.web.js +2 -1
- package/lib/module/select/index.web.js.map +1 -1
- package/lib/module/styles/web-view-style.js +22 -0
- package/lib/module/styles/web-view-style.js.map +1 -0
- package/lib/module/tab-bar/TabBarBase.js +408 -0
- package/lib/module/tab-bar/TabBarBase.js.map +1 -0
- package/lib/module/tab-bar/expo-router/RouterTabBar.js +78 -0
- package/lib/module/tab-bar/expo-router/RouterTabBar.js.map +1 -0
- package/lib/module/tab-bar/expo-router/fading-tab-screen.js +113 -0
- package/lib/module/tab-bar/expo-router/fading-tab-screen.js.map +1 -0
- package/lib/module/tab-bar/expo-router/index.js +15 -0
- package/lib/module/tab-bar/expo-router/index.js.map +1 -0
- package/lib/module/tab-bar/glyph.js +38 -0
- package/lib/module/tab-bar/glyph.js.map +1 -0
- package/lib/module/tab-bar/glyph.native.js +50 -0
- package/lib/module/tab-bar/glyph.native.js.map +1 -0
- package/lib/module/tab-bar/index.js +24 -0
- package/lib/module/tab-bar/index.js.map +1 -0
- package/lib/module/tab-bar/index.web.js +26 -0
- package/lib/module/tab-bar/index.web.js.map +1 -0
- package/lib/module/tab-bar/minimize-context.js +118 -0
- package/lib/module/tab-bar/minimize-context.js.map +1 -0
- package/lib/module/tab-bar/shared.js +132 -0
- package/lib/module/tab-bar/shared.js.map +1 -0
- package/lib/module/tab-bar/surface.js +44 -0
- package/lib/module/tab-bar/surface.js.map +1 -0
- package/lib/module/tab-bar/surface.native.js +50 -0
- package/lib/module/tab-bar/surface.native.js.map +1 -0
- package/lib/module/tab-bar/surface.web.js +53 -0
- package/lib/module/tab-bar/surface.web.js.map +1 -0
- package/lib/module/tab-bar/types.js +4 -0
- package/lib/module/tab-bar/types.js.map +1 -0
- package/lib/module/toast/Positioner.js +110 -0
- package/lib/module/toast/Positioner.js.map +1 -0
- package/lib/module/toast/ToastContent.js +295 -0
- package/lib/module/toast/ToastContent.js.map +1 -0
- package/lib/module/toast/ToastHost.js +63 -0
- package/lib/module/toast/ToastHost.js.map +1 -0
- package/lib/module/toast/ToastHost.native.js +38 -0
- package/lib/module/toast/ToastHost.native.js.map +1 -0
- package/lib/module/toast/ToastIcon.js +52 -0
- package/lib/module/toast/ToastIcon.js.map +1 -0
- package/lib/module/toast/ToastRow.js +407 -0
- package/lib/module/toast/ToastRow.js.map +1 -0
- package/lib/module/toast/ToastSwipeHandler.js +182 -0
- package/lib/module/toast/ToastSwipeHandler.js.map +1 -0
- package/lib/module/toast/Toaster.js +198 -0
- package/lib/module/toast/Toaster.js.map +1 -0
- package/lib/module/toast/animations.js +261 -0
- package/lib/module/toast/animations.js.map +1 -0
- package/lib/module/toast/constants.js +52 -0
- package/lib/module/toast/constants.js.map +1 -0
- package/lib/module/toast/context.js +34 -0
- package/lib/module/toast/context.js.map +1 -0
- package/lib/module/toast/index.js +27 -103
- package/lib/module/toast/index.js.map +1 -1
- package/lib/module/toast/position-utils.js +107 -0
- package/lib/module/toast/position-utils.js.map +1 -0
- package/lib/module/toast/positioner-utils.js +134 -0
- package/lib/module/toast/positioner-utils.js.map +1 -0
- package/lib/module/toast/toast-comparator.js +22 -0
- package/lib/module/toast/toast-comparator.js.map +1 -0
- package/lib/module/toast/toast-fns.js +85 -0
- package/lib/module/toast/toast-fns.js.map +1 -0
- package/lib/module/toast/toast-store.js +346 -0
- package/lib/module/toast/toast-store.js.map +1 -0
- package/lib/module/toast/toast-timers.js +104 -0
- package/lib/module/toast/toast-timers.js.map +1 -0
- package/lib/module/toast/types.js +38 -0
- package/lib/module/toast/types.js.map +1 -1
- package/lib/module/toast/use-animated-target.js +52 -0
- package/lib/module/toast/use-animated-target.js.map +1 -0
- package/lib/module/toast/use-app-state.js +70 -0
- package/lib/module/toast/use-app-state.js.map +1 -0
- package/lib/module/toast/use-toast-colors.js +109 -0
- package/lib/module/toast/use-toast-colors.js.map +1 -0
- package/lib/module/toast/use-toast-position.js +35 -0
- package/lib/module/toast/use-toast-position.js.map +1 -0
- package/lib/module/tooltip/index.web.js +2 -1
- package/lib/module/tooltip/index.web.js.map +1 -1
- package/lib/module/zoomable-image-gallery/ZoomableImageGallery.js +20 -8
- package/lib/module/zoomable-image-gallery/ZoomableImageGallery.js.map +1 -1
- package/lib/typescript/commonjs/avatar-group/AvatarGroup.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/bottom-sheet/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/context-menu/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/Dialog.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +2 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.web.d.ts +2 -1
- package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/menu/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/popover/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/portal/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/progressive-blur/index.d.ts +23 -0
- package/lib/typescript/commonjs/progressive-blur/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/progressive-blur/index.web.d.ts +30 -0
- package/lib/typescript/commonjs/progressive-blur/index.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/progressive-blur/shared.d.ts +35 -0
- package/lib/typescript/commonjs/progressive-blur/shared.d.ts.map +1 -0
- package/lib/typescript/commonjs/progressive-blur/types.d.ts +21 -0
- package/lib/typescript/commonjs/progressive-blur/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/select/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/styles/web-view-style.d.ts +21 -0
- package/lib/typescript/commonjs/styles/web-view-style.d.ts.map +1 -0
- package/lib/typescript/commonjs/tab-bar/TabBarBase.d.ts +36 -0
- package/lib/typescript/commonjs/tab-bar/TabBarBase.d.ts.map +1 -0
- package/lib/typescript/commonjs/tab-bar/expo-router/RouterTabBar.d.ts +59 -0
- package/lib/typescript/commonjs/tab-bar/expo-router/RouterTabBar.d.ts.map +1 -0
- package/lib/typescript/commonjs/tab-bar/expo-router/fading-tab-screen.d.ts +11 -0
- package/lib/typescript/commonjs/tab-bar/expo-router/fading-tab-screen.d.ts.map +1 -0
- package/lib/typescript/commonjs/tab-bar/expo-router/index.d.ts +14 -0
- package/lib/typescript/commonjs/tab-bar/expo-router/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/tab-bar/glyph.d.ts +6 -0
- package/lib/typescript/commonjs/tab-bar/glyph.d.ts.map +1 -0
- package/lib/typescript/commonjs/tab-bar/glyph.native.d.ts +6 -0
- package/lib/typescript/commonjs/tab-bar/glyph.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/tab-bar/index.d.ts +12 -0
- package/lib/typescript/commonjs/tab-bar/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/tab-bar/index.web.d.ts +12 -0
- package/lib/typescript/commonjs/tab-bar/index.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/tab-bar/minimize-context.d.ts +51 -0
- package/lib/typescript/commonjs/tab-bar/minimize-context.d.ts.map +1 -0
- package/lib/typescript/commonjs/tab-bar/shared.d.ts +93 -0
- package/lib/typescript/commonjs/tab-bar/shared.d.ts.map +1 -0
- package/lib/typescript/commonjs/tab-bar/surface.d.ts +6 -0
- package/lib/typescript/commonjs/tab-bar/surface.d.ts.map +1 -0
- package/lib/typescript/commonjs/tab-bar/surface.native.d.ts +6 -0
- package/lib/typescript/commonjs/tab-bar/surface.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/tab-bar/surface.web.d.ts +6 -0
- package/lib/typescript/commonjs/tab-bar/surface.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/tab-bar/types.d.ts +85 -0
- package/lib/typescript/commonjs/tab-bar/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/Positioner.d.ts +21 -0
- package/lib/typescript/commonjs/toast/Positioner.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/ToastContent.d.ts +14 -0
- package/lib/typescript/commonjs/toast/ToastContent.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/ToastHost.d.ts +6 -0
- package/lib/typescript/commonjs/toast/ToastHost.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/ToastHost.native.d.ts +6 -0
- package/lib/typescript/commonjs/toast/ToastHost.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/ToastIcon.d.ts +9 -0
- package/lib/typescript/commonjs/toast/ToastIcon.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/ToastRow.d.ts +80 -0
- package/lib/typescript/commonjs/toast/ToastRow.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/ToastSwipeHandler.d.ts +30 -0
- package/lib/typescript/commonjs/toast/ToastSwipeHandler.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/Toaster.d.ts +19 -0
- package/lib/typescript/commonjs/toast/Toaster.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/animations.d.ts +62 -0
- package/lib/typescript/commonjs/toast/animations.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/constants.d.ts +39 -0
- package/lib/typescript/commonjs/toast/constants.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/context.d.ts +19 -0
- package/lib/typescript/commonjs/toast/context.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/index.d.ts +23 -76
- package/lib/typescript/commonjs/toast/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/toast/position-utils.d.ts +30 -0
- package/lib/typescript/commonjs/toast/position-utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/positioner-utils.d.ts +72 -0
- package/lib/typescript/commonjs/toast/positioner-utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/toast-comparator.d.ts +12 -0
- package/lib/typescript/commonjs/toast/toast-comparator.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/toast-fns.d.ts +3 -0
- package/lib/typescript/commonjs/toast/toast-fns.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/toast-store.d.ts +52 -0
- package/lib/typescript/commonjs/toast/toast-store.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/toast-timers.d.ts +24 -0
- package/lib/typescript/commonjs/toast/toast-timers.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/types.d.ts +222 -5
- package/lib/typescript/commonjs/toast/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/toast/use-animated-target.d.ts +7 -0
- package/lib/typescript/commonjs/toast/use-animated-target.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/use-app-state.d.ts +18 -0
- package/lib/typescript/commonjs/toast/use-app-state.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/use-toast-colors.d.ts +22 -0
- package/lib/typescript/commonjs/toast/use-toast-colors.d.ts.map +1 -0
- package/lib/typescript/commonjs/toast/use-toast-position.d.ts +37 -0
- package/lib/typescript/commonjs/toast/use-toast-position.d.ts.map +1 -0
- package/lib/typescript/commonjs/tooltip/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/zoomable-image-gallery/ZoomableImageGallery.d.ts.map +1 -1
- package/lib/typescript/module/avatar-group/AvatarGroup.web.d.ts.map +1 -1
- package/lib/typescript/module/bottom-sheet/index.web.d.ts.map +1 -1
- package/lib/typescript/module/context-menu/index.web.d.ts.map +1 -1
- package/lib/typescript/module/dialog/Dialog.web.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +2 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/index.web.d.ts +2 -1
- package/lib/typescript/module/index.web.d.ts.map +1 -1
- package/lib/typescript/module/menu/index.web.d.ts.map +1 -1
- package/lib/typescript/module/popover/index.web.d.ts.map +1 -1
- package/lib/typescript/module/portal/index.d.ts.map +1 -1
- package/lib/typescript/module/progressive-blur/index.d.ts +23 -0
- package/lib/typescript/module/progressive-blur/index.d.ts.map +1 -0
- package/lib/typescript/module/progressive-blur/index.web.d.ts +30 -0
- package/lib/typescript/module/progressive-blur/index.web.d.ts.map +1 -0
- package/lib/typescript/module/progressive-blur/shared.d.ts +35 -0
- package/lib/typescript/module/progressive-blur/shared.d.ts.map +1 -0
- package/lib/typescript/module/progressive-blur/types.d.ts +21 -0
- package/lib/typescript/module/progressive-blur/types.d.ts.map +1 -0
- package/lib/typescript/module/select/index.web.d.ts.map +1 -1
- package/lib/typescript/module/styles/web-view-style.d.ts +21 -0
- package/lib/typescript/module/styles/web-view-style.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/TabBarBase.d.ts +36 -0
- package/lib/typescript/module/tab-bar/TabBarBase.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/expo-router/RouterTabBar.d.ts +59 -0
- package/lib/typescript/module/tab-bar/expo-router/RouterTabBar.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/expo-router/fading-tab-screen.d.ts +11 -0
- package/lib/typescript/module/tab-bar/expo-router/fading-tab-screen.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/expo-router/index.d.ts +14 -0
- package/lib/typescript/module/tab-bar/expo-router/index.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/glyph.d.ts +6 -0
- package/lib/typescript/module/tab-bar/glyph.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/glyph.native.d.ts +6 -0
- package/lib/typescript/module/tab-bar/glyph.native.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/index.d.ts +12 -0
- package/lib/typescript/module/tab-bar/index.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/index.web.d.ts +12 -0
- package/lib/typescript/module/tab-bar/index.web.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/minimize-context.d.ts +51 -0
- package/lib/typescript/module/tab-bar/minimize-context.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/shared.d.ts +93 -0
- package/lib/typescript/module/tab-bar/shared.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/surface.d.ts +6 -0
- package/lib/typescript/module/tab-bar/surface.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/surface.native.d.ts +6 -0
- package/lib/typescript/module/tab-bar/surface.native.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/surface.web.d.ts +6 -0
- package/lib/typescript/module/tab-bar/surface.web.d.ts.map +1 -0
- package/lib/typescript/module/tab-bar/types.d.ts +85 -0
- package/lib/typescript/module/tab-bar/types.d.ts.map +1 -0
- package/lib/typescript/module/toast/Positioner.d.ts +21 -0
- package/lib/typescript/module/toast/Positioner.d.ts.map +1 -0
- package/lib/typescript/module/toast/ToastContent.d.ts +14 -0
- package/lib/typescript/module/toast/ToastContent.d.ts.map +1 -0
- package/lib/typescript/module/toast/ToastHost.d.ts +6 -0
- package/lib/typescript/module/toast/ToastHost.d.ts.map +1 -0
- package/lib/typescript/module/toast/ToastHost.native.d.ts +6 -0
- package/lib/typescript/module/toast/ToastHost.native.d.ts.map +1 -0
- package/lib/typescript/module/toast/ToastIcon.d.ts +9 -0
- package/lib/typescript/module/toast/ToastIcon.d.ts.map +1 -0
- package/lib/typescript/module/toast/ToastRow.d.ts +80 -0
- package/lib/typescript/module/toast/ToastRow.d.ts.map +1 -0
- package/lib/typescript/module/toast/ToastSwipeHandler.d.ts +30 -0
- package/lib/typescript/module/toast/ToastSwipeHandler.d.ts.map +1 -0
- package/lib/typescript/module/toast/Toaster.d.ts +19 -0
- package/lib/typescript/module/toast/Toaster.d.ts.map +1 -0
- package/lib/typescript/module/toast/animations.d.ts +62 -0
- package/lib/typescript/module/toast/animations.d.ts.map +1 -0
- package/lib/typescript/module/toast/constants.d.ts +39 -0
- package/lib/typescript/module/toast/constants.d.ts.map +1 -0
- package/lib/typescript/module/toast/context.d.ts +19 -0
- package/lib/typescript/module/toast/context.d.ts.map +1 -0
- package/lib/typescript/module/toast/index.d.ts +23 -76
- package/lib/typescript/module/toast/index.d.ts.map +1 -1
- package/lib/typescript/module/toast/position-utils.d.ts +30 -0
- package/lib/typescript/module/toast/position-utils.d.ts.map +1 -0
- package/lib/typescript/module/toast/positioner-utils.d.ts +72 -0
- package/lib/typescript/module/toast/positioner-utils.d.ts.map +1 -0
- package/lib/typescript/module/toast/toast-comparator.d.ts +12 -0
- package/lib/typescript/module/toast/toast-comparator.d.ts.map +1 -0
- package/lib/typescript/module/toast/toast-fns.d.ts +3 -0
- package/lib/typescript/module/toast/toast-fns.d.ts.map +1 -0
- package/lib/typescript/module/toast/toast-store.d.ts +52 -0
- package/lib/typescript/module/toast/toast-store.d.ts.map +1 -0
- package/lib/typescript/module/toast/toast-timers.d.ts +24 -0
- package/lib/typescript/module/toast/toast-timers.d.ts.map +1 -0
- package/lib/typescript/module/toast/types.d.ts +222 -5
- package/lib/typescript/module/toast/types.d.ts.map +1 -1
- package/lib/typescript/module/toast/use-animated-target.d.ts +7 -0
- package/lib/typescript/module/toast/use-animated-target.d.ts.map +1 -0
- package/lib/typescript/module/toast/use-app-state.d.ts +18 -0
- package/lib/typescript/module/toast/use-app-state.d.ts.map +1 -0
- package/lib/typescript/module/toast/use-toast-colors.d.ts +22 -0
- package/lib/typescript/module/toast/use-toast-colors.d.ts.map +1 -0
- package/lib/typescript/module/toast/use-toast-position.d.ts +37 -0
- package/lib/typescript/module/toast/use-toast-position.d.ts.map +1 -0
- package/lib/typescript/module/tooltip/index.web.d.ts.map +1 -1
- package/lib/typescript/module/zoomable-image-gallery/ZoomableImageGallery.d.ts.map +1 -1
- package/package.json +63 -25
- package/src/__tests__/TabBar.test.tsx +342 -0
- package/src/__tests__/TabBarReanimatedDeps.test.ts +130 -0
- package/src/__tests__/TabBarWebFork.test.ts +197 -0
- package/src/__tests__/ToastContent.test.tsx +192 -0
- package/src/__tests__/ToastHostWebFork.test.ts +155 -0
- package/src/__tests__/Toaster.test.tsx +527 -0
- package/src/__tests__/animated-style-deps.test.ts +156 -0
- package/src/__tests__/toast-animations.test.ts +98 -0
- package/src/__tests__/toast-comparator.test.ts +131 -0
- package/src/__tests__/toast-enter-driver.test.ts +147 -0
- package/src/__tests__/toast-fns.test.ts +240 -0
- package/src/__tests__/toast-position-utils.test.ts +259 -0
- package/src/__tests__/toast-positioner-utils.test.ts +214 -0
- package/src/__tests__/toast-store.test.ts +622 -0
- package/src/__tests__/toast-timers.test.ts +163 -0
- package/src/__tests__/use-animated-target.test.tsx +60 -0
- package/src/__tests__/use-app-state.test.tsx +127 -0
- package/src/__tests__/use-toast-colors.test.tsx +189 -0
- package/src/__tests__/web-position-fixed.test.ts +70 -0
- package/src/avatar-group/AvatarGroup.web.tsx +2 -1
- package/src/bottom-sheet/index.web.tsx +3 -2
- package/src/context-menu/index.web.tsx +3 -2
- package/src/dialog/Dialog.web.tsx +4 -3
- package/src/index.ts +4 -1
- package/src/index.web.ts +4 -1
- package/src/menu/index.web.tsx +2 -1
- package/src/popover/index.web.tsx +3 -2
- package/src/portal/index.tsx +4 -1
- package/src/progressive-blur/index.tsx +78 -0
- package/src/progressive-blur/index.web.tsx +65 -0
- package/src/progressive-blur/shared.ts +81 -0
- package/src/progressive-blur/types.ts +21 -0
- package/src/select/index.web.tsx +2 -1
- package/src/styles/web-view-style.ts +21 -0
- package/src/tab-bar/TabBar.stories.tsx +217 -0
- package/src/tab-bar/TabBarBase.tsx +517 -0
- package/src/tab-bar/expo-router/RouterTabBar.tsx +80 -0
- package/src/tab-bar/expo-router/fading-tab-screen.tsx +109 -0
- package/src/tab-bar/expo-router/index.ts +13 -0
- package/src/tab-bar/glyph.native.tsx +46 -0
- package/src/tab-bar/glyph.tsx +31 -0
- package/src/tab-bar/index.ts +32 -0
- package/src/tab-bar/index.web.tsx +34 -0
- package/src/tab-bar/minimize-context.tsx +117 -0
- package/src/tab-bar/shared.ts +159 -0
- package/src/tab-bar/surface.native.tsx +60 -0
- package/src/tab-bar/surface.tsx +47 -0
- package/src/tab-bar/surface.web.tsx +56 -0
- package/src/tab-bar/types.ts +88 -0
- package/src/toast/Positioner.tsx +121 -0
- package/src/toast/Toast.stories.tsx +292 -65
- package/src/toast/ToastContent.tsx +405 -0
- package/src/toast/ToastHost.native.tsx +31 -0
- package/src/toast/ToastHost.tsx +67 -0
- package/src/toast/ToastIcon.tsx +55 -0
- package/src/toast/ToastRow.tsx +485 -0
- package/src/toast/ToastSwipeHandler.tsx +222 -0
- package/src/toast/Toaster.tsx +259 -0
- package/src/toast/animations.ts +313 -0
- package/src/toast/constants.ts +76 -0
- package/src/toast/context.tsx +44 -0
- package/src/toast/index.tsx +47 -123
- package/src/toast/position-utils.ts +149 -0
- package/src/toast/positioner-utils.ts +142 -0
- package/src/toast/toast-comparator.ts +41 -0
- package/src/toast/toast-fns.ts +104 -0
- package/src/toast/toast-store.ts +432 -0
- package/src/toast/toast-timers.ts +124 -0
- package/src/toast/types.ts +301 -5
- package/src/toast/use-animated-target.ts +61 -0
- package/src/toast/use-app-state.ts +77 -0
- package/src/toast/use-toast-colors.ts +133 -0
- package/src/toast/use-toast-position.ts +46 -0
- package/src/tooltip/index.web.tsx +2 -1
- package/src/zoomable-image-gallery/ZoomableImageGallery.stories.tsx +134 -0
- package/src/zoomable-image-gallery/ZoomableImageGallery.tsx +50 -27
- package/lib/commonjs/toast/Toast.js +0 -267
- package/lib/commonjs/toast/Toast.js.map +0 -1
- package/lib/commonjs/toast/const.js +0 -8
- package/lib/commonjs/toast/const.js.map +0 -1
- package/lib/commonjs/toast/index.web.js +0 -114
- package/lib/commonjs/toast/index.web.js.map +0 -1
- package/lib/commonjs/toast/sonner/index.js +0 -9
- package/lib/commonjs/toast/sonner/index.js.map +0 -1
- package/lib/commonjs/toast/sonner/index.web.js +0 -9
- package/lib/commonjs/toast/sonner/index.web.js.map +0 -1
- package/lib/module/toast/Toast.js +0 -258
- package/lib/module/toast/Toast.js.map +0 -1
- package/lib/module/toast/const.js +0 -4
- package/lib/module/toast/const.js.map +0 -1
- package/lib/module/toast/index.web.js +0 -74
- package/lib/module/toast/index.web.js.map +0 -1
- package/lib/module/toast/sonner/index.js +0 -5
- package/lib/module/toast/sonner/index.js.map +0 -1
- package/lib/module/toast/sonner/index.web.js +0 -5
- package/lib/module/toast/sonner/index.web.js.map +0 -1
- package/lib/typescript/commonjs/toast/Toast.d.ts +0 -23
- package/lib/typescript/commonjs/toast/Toast.d.ts.map +0 -1
- package/lib/typescript/commonjs/toast/const.d.ts +0 -2
- package/lib/typescript/commonjs/toast/const.d.ts.map +0 -1
- package/lib/typescript/commonjs/toast/index.web.d.ts +0 -29
- package/lib/typescript/commonjs/toast/index.web.d.ts.map +0 -1
- package/lib/typescript/commonjs/toast/sonner/index.d.ts +0 -2
- package/lib/typescript/commonjs/toast/sonner/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/toast/sonner/index.web.d.ts +0 -2
- package/lib/typescript/commonjs/toast/sonner/index.web.d.ts.map +0 -1
- package/lib/typescript/module/toast/Toast.d.ts +0 -23
- package/lib/typescript/module/toast/Toast.d.ts.map +0 -1
- package/lib/typescript/module/toast/const.d.ts +0 -2
- package/lib/typescript/module/toast/const.d.ts.map +0 -1
- package/lib/typescript/module/toast/index.web.d.ts +0 -29
- package/lib/typescript/module/toast/index.web.d.ts.map +0 -1
- package/lib/typescript/module/toast/sonner/index.d.ts +0 -2
- package/lib/typescript/module/toast/sonner/index.d.ts.map +0 -1
- package/lib/typescript/module/toast/sonner/index.web.d.ts +0 -2
- package/lib/typescript/module/toast/sonner/index.web.d.ts.map +0 -1
- package/src/toast/Toast.tsx +0 -269
- package/src/toast/const.ts +0 -1
- package/src/toast/index.web.tsx +0 -101
- package/src/toast/sonner/index.ts +0 -3
- package/src/toast/sonner/index.web.ts +0 -3
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Image, Pressable, View } from 'react-native';
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
4
|
+
|
|
5
|
+
import { ZoomableImageGallery } from './ZoomableImageGallery';
|
|
6
|
+
import type {
|
|
7
|
+
GalleryImage,
|
|
8
|
+
MeasuredRect,
|
|
9
|
+
ZoomableImageGalleryHandle,
|
|
10
|
+
ZoomableImageGalleryProps,
|
|
11
|
+
} from './types';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* There was no story for this component, which is exactly why its four frozen
|
|
15
|
+
* web mappers (`useAnimatedStyle` with no dependency array — see the CRITICAL note
|
|
16
|
+
* in `ZoomableImageGallery.tsx`) were found by static analysis instead of by the
|
|
17
|
+
* web gate. These stories make the animated paths observable in a browser:
|
|
18
|
+
*
|
|
19
|
+
* - **open**: the tapped thumbnail flies to the fitted centre and the backdrop fades in
|
|
20
|
+
* - **drag to dismiss**: dragging the open image follows the pointer, fades, and snaps
|
|
21
|
+
* back or closes
|
|
22
|
+
* - **zoom**: pinch, or double-tap, then pan the zoomed image
|
|
23
|
+
*
|
|
24
|
+
* All three are driven by shared values read inside those mappers, so if a
|
|
25
|
+
* dependency array is ever dropped again these stories freeze visibly.
|
|
26
|
+
*/
|
|
27
|
+
const meta: Meta = {
|
|
28
|
+
title: 'Components/ZoomableImageGallery',
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default meta;
|
|
32
|
+
|
|
33
|
+
type Story = StoryObj;
|
|
34
|
+
|
|
35
|
+
const FOREST: GalleryImage = {
|
|
36
|
+
uri: 'https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=1200',
|
|
37
|
+
alt: 'Sunlight through a forest canopy',
|
|
38
|
+
aspectRatio: 1.5,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const RIDGE: GalleryImage = {
|
|
42
|
+
uri: 'https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?w=1200',
|
|
43
|
+
alt: 'A mountain ridge above the clouds',
|
|
44
|
+
aspectRatio: 1.5,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const VALLEY: GalleryImage = {
|
|
48
|
+
uri: 'https://images.unsplash.com/photo-1470071459604-3b5ec3a7fe05?w=1200',
|
|
49
|
+
alt: 'Fog rolling through a valley of pines',
|
|
50
|
+
aspectRatio: 1.5,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const IMAGES: GalleryImage[] = [FOREST, RIDGE, VALLEY];
|
|
54
|
+
|
|
55
|
+
const THUMB = 96;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Mirrors how a consumer wires this up: thumbnails measure themselves so the
|
|
59
|
+
* open/close transition can fly to and from the tapped tile.
|
|
60
|
+
*/
|
|
61
|
+
function GalleryDemo({
|
|
62
|
+
images,
|
|
63
|
+
...props
|
|
64
|
+
}: ZoomableImageGalleryProps & { images: GalleryImage[] }) {
|
|
65
|
+
const galleryRef = React.useRef<ZoomableImageGalleryHandle>(null);
|
|
66
|
+
const thumbRefs = React.useRef<Array<View | null>>([]);
|
|
67
|
+
|
|
68
|
+
const measureRect = React.useCallback(
|
|
69
|
+
(index: number) =>
|
|
70
|
+
new Promise<MeasuredRect | null>((resolve) => {
|
|
71
|
+
const node = thumbRefs.current[index];
|
|
72
|
+
if (!node) {
|
|
73
|
+
resolve(null);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
node.measureInWindow((x, y, width, height) => {
|
|
77
|
+
resolve({ x, y, width, height });
|
|
78
|
+
});
|
|
79
|
+
}),
|
|
80
|
+
[],
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
const openAt = React.useCallback(
|
|
84
|
+
async (index: number) => {
|
|
85
|
+
const rect = await measureRect(index);
|
|
86
|
+
galleryRef.current?.open(images, index, rect ?? undefined);
|
|
87
|
+
},
|
|
88
|
+
[images, measureRect],
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<View style={{ gap: 12 }}>
|
|
93
|
+
<View style={{ flexDirection: 'row', gap: 8, flexWrap: 'wrap' }}>
|
|
94
|
+
{images.map((image, index) => (
|
|
95
|
+
<Pressable
|
|
96
|
+
key={image.uri}
|
|
97
|
+
ref={(node) => {
|
|
98
|
+
thumbRefs.current[index] = node;
|
|
99
|
+
}}
|
|
100
|
+
onPress={() => {
|
|
101
|
+
void openAt(index);
|
|
102
|
+
}}
|
|
103
|
+
>
|
|
104
|
+
<Image
|
|
105
|
+
source={{ uri: image.uri }}
|
|
106
|
+
style={{ width: THUMB, height: THUMB, borderRadius: 8 }}
|
|
107
|
+
/>
|
|
108
|
+
</Pressable>
|
|
109
|
+
))}
|
|
110
|
+
</View>
|
|
111
|
+
<ZoomableImageGallery
|
|
112
|
+
ref={galleryRef}
|
|
113
|
+
measureThumb={measureRect}
|
|
114
|
+
{...props}
|
|
115
|
+
/>
|
|
116
|
+
</View>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export const SingleImage: Story = {
|
|
121
|
+
render: () => <GalleryDemo images={[FOREST]} />,
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export const MultipleImages: Story = {
|
|
125
|
+
render: () => <GalleryDemo images={IMAGES} />,
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export const ThumbnailIndicator: Story = {
|
|
129
|
+
render: () => <GalleryDemo images={IMAGES} indicatorVariant="thumbnails" />,
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export const SquareCorners: Story = {
|
|
133
|
+
render: () => <GalleryDemo images={IMAGES} cornerRadius={0} />,
|
|
134
|
+
};
|
|
@@ -36,6 +36,7 @@ import {
|
|
|
36
36
|
ArrowOutOfBox_Stroke2_Corner0_Rounded,
|
|
37
37
|
} from '../icons';
|
|
38
38
|
import { Z_INDEX } from '../styles/z-index';
|
|
39
|
+
import { WEB_POSITION_FIXED } from '../styles/web-view-style';
|
|
39
40
|
import {
|
|
40
41
|
getAspectRatio,
|
|
41
42
|
fetchAspectRatio,
|
|
@@ -475,36 +476,57 @@ const ZoomableImageGalleryInner = React.forwardRef<ZoomableImageGalleryHandle, Z
|
|
|
475
476
|
[handleDismiss, isOpen, isZoomed, SCREEN_HEIGHT, opacity, scale, startScale, startX, startY, translateX, translateY]
|
|
476
477
|
);
|
|
477
478
|
|
|
478
|
-
|
|
479
|
+
// CRITICAL — every shared value a mapper READS must be listed in its dependency
|
|
480
|
+
// array. On web WITHOUT the react-native-worklets babel plugin (what every Oxy
|
|
481
|
+
// RN-Web app ships), reanimated cannot auto-detect the reads, so it drives the
|
|
482
|
+
// mapper off the deps array instead: with none, each mapper runs ONCE and
|
|
483
|
+
// freezes at the opening frame while the shared values animate underneath it.
|
|
484
|
+
// That froze the open animation, the drag-to-dismiss follow and the pinch/
|
|
485
|
+
// double-tap zoom on web. Native (plugin present) auto-tracks and ignores the
|
|
486
|
+
// extra deps, so listing them is correct on both platforms. Same rule as
|
|
487
|
+
// `bottom-sheet/BottomSheetBase.tsx`. Do NOT strip these.
|
|
488
|
+
const backdropStyle = useAnimatedStyle(
|
|
489
|
+
() => ({ opacity: opacity.value }),
|
|
490
|
+
[opacity],
|
|
491
|
+
);
|
|
479
492
|
|
|
480
493
|
// The single open-image animates from origin → fitted center.
|
|
481
|
-
const openImageStyle = useAnimatedStyle(
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
494
|
+
const openImageStyle = useAnimatedStyle(
|
|
495
|
+
() => ({
|
|
496
|
+
transform: [
|
|
497
|
+
{ translateX: translateX.value },
|
|
498
|
+
{ translateY: translateY.value },
|
|
499
|
+
{ scale: scale.value },
|
|
500
|
+
],
|
|
501
|
+
}),
|
|
502
|
+
[translateX, translateY, scale],
|
|
503
|
+
);
|
|
488
504
|
|
|
489
505
|
// While dragging to dismiss, the whole pager follows the finger + fades.
|
|
490
|
-
const pagerContainerStyle = useAnimatedStyle(
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
506
|
+
const pagerContainerStyle = useAnimatedStyle(
|
|
507
|
+
() => ({
|
|
508
|
+
opacity: opacity.value,
|
|
509
|
+
transform: [
|
|
510
|
+
{ translateX: translateX.value },
|
|
511
|
+
{ translateY: translateY.value },
|
|
512
|
+
{ scale: scale.value },
|
|
513
|
+
],
|
|
514
|
+
}),
|
|
515
|
+
[opacity, translateX, translateY, scale],
|
|
516
|
+
);
|
|
498
517
|
|
|
499
518
|
// Pinch/double-tap zoom transform, layered on TOP of the active page image's
|
|
500
519
|
// `fit`-based sizing (composed, never replacing it).
|
|
501
|
-
const zoomImageStyle = useAnimatedStyle(
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
520
|
+
const zoomImageStyle = useAnimatedStyle(
|
|
521
|
+
() => ({
|
|
522
|
+
transform: [
|
|
523
|
+
{ scale: zoomScale.value },
|
|
524
|
+
{ translateX: zoomTranslateX.value },
|
|
525
|
+
{ translateY: zoomTranslateY.value },
|
|
526
|
+
],
|
|
527
|
+
}),
|
|
528
|
+
[zoomScale, zoomTranslateX, zoomTranslateY],
|
|
529
|
+
);
|
|
508
530
|
|
|
509
531
|
// Derive the current page from the scroll offset, clamp into range, and update
|
|
510
532
|
// `activeIndex` only when it actually changes (drives the live indicator + the
|
|
@@ -963,10 +985,11 @@ const styles = StyleSheet.create({
|
|
|
963
985
|
alignItems: 'center',
|
|
964
986
|
...Platform.select({
|
|
965
987
|
web: {
|
|
966
|
-
// Full-screen fixed overlay (web)
|
|
967
|
-
//
|
|
968
|
-
//
|
|
969
|
-
|
|
988
|
+
// Full-screen fixed overlay (web), like Bloom's Portal and Dialog.web.
|
|
989
|
+
// Only ever applied on web (this is the `web` arm of Platform.select),
|
|
990
|
+
// so `WEB_POSITION_FIXED` is honest here; the fullscreen z-index token
|
|
991
|
+
// keeps the viewer above the app chrome.
|
|
992
|
+
position: WEB_POSITION_FIXED,
|
|
970
993
|
top: 0,
|
|
971
994
|
left: 0,
|
|
972
995
|
right: 0,
|
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Action = Action;
|
|
7
|
-
exports.Icon = Icon;
|
|
8
|
-
exports.Outer = Outer;
|
|
9
|
-
exports.Text = Text;
|
|
10
|
-
exports.ToastConfigProvider = ToastConfigProvider;
|
|
11
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _reactNative = require("react-native");
|
|
13
|
-
var _useTheme = require("../theme/use-theme.js");
|
|
14
|
-
var _useInteractionState = require("../hooks/useInteractionState.js");
|
|
15
|
-
var _shadows = require("../design-tokens/shadows");
|
|
16
|
-
var _sonner = require("./sonner");
|
|
17
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
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
|
-
const ToastConfigContext = /*#__PURE__*/(0, _react.createContext)({
|
|
20
|
-
id: '',
|
|
21
|
-
type: 'default'
|
|
22
|
-
});
|
|
23
|
-
ToastConfigContext.displayName = 'ToastConfigContext';
|
|
24
|
-
function ToastConfigProvider({
|
|
25
|
-
children,
|
|
26
|
-
id,
|
|
27
|
-
type
|
|
28
|
-
}) {
|
|
29
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ToastConfigContext.Provider, {
|
|
30
|
-
value: (0, _react.useMemo)(() => ({
|
|
31
|
-
id,
|
|
32
|
-
type
|
|
33
|
-
}), [id, type]),
|
|
34
|
-
children: children
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
function Outer({
|
|
38
|
-
children
|
|
39
|
-
}) {
|
|
40
|
-
const {
|
|
41
|
-
colors
|
|
42
|
-
} = (0, _useTheme.useTheme)();
|
|
43
|
-
const {
|
|
44
|
-
type
|
|
45
|
-
} = (0, _react.useContext)(ToastConfigContext);
|
|
46
|
-
const toastColors = useToastColors({
|
|
47
|
-
type,
|
|
48
|
-
colors
|
|
49
|
-
});
|
|
50
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
51
|
-
style: [styles.outer, {
|
|
52
|
-
backgroundColor: toastColors.backgroundColor,
|
|
53
|
-
borderColor: toastColors.borderColor
|
|
54
|
-
}],
|
|
55
|
-
children: children
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
function Icon({
|
|
59
|
-
icon
|
|
60
|
-
}) {
|
|
61
|
-
const {
|
|
62
|
-
colors
|
|
63
|
-
} = (0, _useTheme.useTheme)();
|
|
64
|
-
const {
|
|
65
|
-
type
|
|
66
|
-
} = (0, _react.useContext)(ToastConfigContext);
|
|
67
|
-
const toastColors = useToastColors({
|
|
68
|
-
type,
|
|
69
|
-
colors
|
|
70
|
-
});
|
|
71
|
-
if (!icon) {
|
|
72
|
-
return null;
|
|
73
|
-
}
|
|
74
|
-
if (/*#__PURE__*/_react.default.isValidElement(icon)) {
|
|
75
|
-
return /*#__PURE__*/_react.default.cloneElement(icon, {
|
|
76
|
-
color: toastColors.iconColor
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
80
|
-
children: icon
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
function Text({
|
|
84
|
-
children
|
|
85
|
-
}) {
|
|
86
|
-
const {
|
|
87
|
-
colors
|
|
88
|
-
} = (0, _useTheme.useTheme)();
|
|
89
|
-
const {
|
|
90
|
-
type
|
|
91
|
-
} = (0, _react.useContext)(ToastConfigContext);
|
|
92
|
-
const toastColors = useToastColors({
|
|
93
|
-
type,
|
|
94
|
-
colors
|
|
95
|
-
});
|
|
96
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
97
|
-
style: styles.textContainer,
|
|
98
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
99
|
-
selectable: false,
|
|
100
|
-
style: [styles.text, {
|
|
101
|
-
color: toastColors.textColor
|
|
102
|
-
}],
|
|
103
|
-
children: children
|
|
104
|
-
})
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
function Action({
|
|
108
|
-
children,
|
|
109
|
-
onPress,
|
|
110
|
-
...rest
|
|
111
|
-
}) {
|
|
112
|
-
const {
|
|
113
|
-
colors
|
|
114
|
-
} = (0, _useTheme.useTheme)();
|
|
115
|
-
const {
|
|
116
|
-
type,
|
|
117
|
-
id
|
|
118
|
-
} = (0, _react.useContext)(ToastConfigContext);
|
|
119
|
-
const actionColors = useActionColors({
|
|
120
|
-
type,
|
|
121
|
-
colors
|
|
122
|
-
});
|
|
123
|
-
// Drive the pressed visual via state, not Pressable's function-form `style`
|
|
124
|
-
// / function-children, which NativeWind v4's css-interop swallows (dropping
|
|
125
|
-
// the base button style: padding, radius, alignSelf).
|
|
126
|
-
const {
|
|
127
|
-
state: pressed,
|
|
128
|
-
onIn: onPressIn,
|
|
129
|
-
onOut: onPressOut
|
|
130
|
-
} = (0, _useInteractionState.useInteractionState)();
|
|
131
|
-
const handlePress = e => {
|
|
132
|
-
(0, _sonner.dismiss)(id);
|
|
133
|
-
onPress?.(e);
|
|
134
|
-
};
|
|
135
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
136
|
-
...rest,
|
|
137
|
-
onPress: handlePress,
|
|
138
|
-
onPressIn: onPressIn,
|
|
139
|
-
onPressOut: onPressOut,
|
|
140
|
-
style: [styles.actionButton, {
|
|
141
|
-
backgroundColor: pressed ? actionColors.interacted.backgroundColor : actionColors.base.backgroundColor
|
|
142
|
-
}],
|
|
143
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
144
|
-
style: [styles.actionText, {
|
|
145
|
-
color: pressed ? actionColors.interacted.textColor : actionColors.base.textColor
|
|
146
|
-
}],
|
|
147
|
-
children: children
|
|
148
|
-
})
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
function useToastColors({
|
|
152
|
-
type,
|
|
153
|
-
colors
|
|
154
|
-
}) {
|
|
155
|
-
return (0, _react.useMemo)(() => {
|
|
156
|
-
const colorMap = {
|
|
157
|
-
default: {
|
|
158
|
-
backgroundColor: colors.backgroundSecondary,
|
|
159
|
-
borderColor: colors.border,
|
|
160
|
-
iconColor: colors.text,
|
|
161
|
-
textColor: colors.text
|
|
162
|
-
},
|
|
163
|
-
success: {
|
|
164
|
-
backgroundColor: colors.primarySubtle,
|
|
165
|
-
borderColor: colors.primary,
|
|
166
|
-
iconColor: colors.primarySubtleForeground,
|
|
167
|
-
textColor: colors.primarySubtleForeground
|
|
168
|
-
},
|
|
169
|
-
error: {
|
|
170
|
-
backgroundColor: colors.negativeSubtle,
|
|
171
|
-
borderColor: colors.negative,
|
|
172
|
-
iconColor: colors.negativeSubtleForeground,
|
|
173
|
-
textColor: colors.negativeSubtleForeground
|
|
174
|
-
},
|
|
175
|
-
warning: {
|
|
176
|
-
backgroundColor: colors.backgroundSecondary,
|
|
177
|
-
borderColor: colors.border,
|
|
178
|
-
iconColor: colors.warning,
|
|
179
|
-
textColor: colors.text
|
|
180
|
-
},
|
|
181
|
-
info: {
|
|
182
|
-
backgroundColor: colors.backgroundSecondary,
|
|
183
|
-
borderColor: colors.border,
|
|
184
|
-
iconColor: colors.info,
|
|
185
|
-
textColor: colors.text
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
return colorMap[type];
|
|
189
|
-
}, [type, colors]);
|
|
190
|
-
}
|
|
191
|
-
function useActionColors({
|
|
192
|
-
type,
|
|
193
|
-
colors
|
|
194
|
-
}) {
|
|
195
|
-
return (0, _react.useMemo)(() => {
|
|
196
|
-
const base = {
|
|
197
|
-
base: {
|
|
198
|
-
textColor: colors.textSecondary,
|
|
199
|
-
backgroundColor: colors.backgroundTertiary
|
|
200
|
-
},
|
|
201
|
-
interacted: {
|
|
202
|
-
textColor: colors.text,
|
|
203
|
-
backgroundColor: colors.contrast50
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
const colorMap = {
|
|
207
|
-
default: base,
|
|
208
|
-
warning: base,
|
|
209
|
-
info: base,
|
|
210
|
-
success: {
|
|
211
|
-
base: {
|
|
212
|
-
textColor: colors.primarySubtleForeground,
|
|
213
|
-
backgroundColor: colors.primarySubtle
|
|
214
|
-
},
|
|
215
|
-
interacted: {
|
|
216
|
-
textColor: colors.primaryDark,
|
|
217
|
-
backgroundColor: colors.primaryLight
|
|
218
|
-
}
|
|
219
|
-
},
|
|
220
|
-
error: {
|
|
221
|
-
base: {
|
|
222
|
-
textColor: colors.negativeSubtleForeground,
|
|
223
|
-
backgroundColor: colors.negativeSubtle
|
|
224
|
-
},
|
|
225
|
-
interacted: {
|
|
226
|
-
textColor: colors.negativeForeground,
|
|
227
|
-
backgroundColor: colors.negative
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
};
|
|
231
|
-
return colorMap[type];
|
|
232
|
-
}, [type, colors]);
|
|
233
|
-
}
|
|
234
|
-
const styles = _reactNative.StyleSheet.create({
|
|
235
|
-
outer: {
|
|
236
|
-
flex: 1,
|
|
237
|
-
padding: 16,
|
|
238
|
-
borderRadius: 8,
|
|
239
|
-
borderWidth: 1,
|
|
240
|
-
flexDirection: 'row',
|
|
241
|
-
gap: 8,
|
|
242
|
-
paddingVertical: 14,
|
|
243
|
-
// Subtle raise (`shadow-s`) — `boxShadow` on web, RN shadow/elevation on native.
|
|
244
|
-
...(0, _shadows.bloomShadowStyle)('s')
|
|
245
|
-
},
|
|
246
|
-
textContainer: {
|
|
247
|
-
flex: 1,
|
|
248
|
-
paddingRight: 16
|
|
249
|
-
},
|
|
250
|
-
text: {
|
|
251
|
-
fontSize: 15,
|
|
252
|
-
fontWeight: '500',
|
|
253
|
-
lineHeight: 20
|
|
254
|
-
},
|
|
255
|
-
actionButton: {
|
|
256
|
-
paddingVertical: 5,
|
|
257
|
-
paddingHorizontal: 9,
|
|
258
|
-
borderRadius: 6,
|
|
259
|
-
alignSelf: 'center'
|
|
260
|
-
},
|
|
261
|
-
actionText: {
|
|
262
|
-
fontSize: 15,
|
|
263
|
-
fontWeight: '500',
|
|
264
|
-
lineHeight: 20
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
//# sourceMappingURL=Toast.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_useTheme","_useInteractionState","_shadows","_sonner","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ToastConfigContext","createContext","id","type","displayName","ToastConfigProvider","children","jsx","Provider","value","useMemo","Outer","colors","useTheme","useContext","toastColors","useToastColors","View","style","styles","outer","backgroundColor","borderColor","Icon","icon","React","isValidElement","cloneElement","color","iconColor","Fragment","Text","textContainer","selectable","text","textColor","Action","onPress","rest","actionColors","useActionColors","state","pressed","onIn","onPressIn","onOut","onPressOut","useInteractionState","handlePress","dismiss","Pressable","actionButton","interacted","base","actionText","colorMap","backgroundSecondary","border","success","primarySubtle","primary","primarySubtleForeground","error","negativeSubtle","negative","negativeSubtleForeground","warning","info","textSecondary","backgroundTertiary","contrast50","primaryDark","primaryLight","negativeForeground","StyleSheet","create","flex","padding","borderRadius","borderWidth","flexDirection","gap","paddingVertical","bloomShadowStyle","paddingRight","fontSize","fontWeight","lineHeight","paddingHorizontal","alignSelf"],"sourceRoot":"../../../src","sources":["toast/Toast.tsx"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAEA,IAAAK,OAAA,GAAAL,OAAA;AAAmC,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAD,wBAAAQ,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAV,uBAAA,YAAAA,CAAAQ,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MA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5C,eAAe,EAAET,MAAM,CAACmD;QAC1B,CAAC;QACDX,UAAU,EAAE;UACVjB,SAAS,EAAEvB,MAAM,CAAC6D,kBAAkB;UACpCpD,eAAe,EAAET,MAAM,CAACoD;QAC1B;MACF;IACF,CAAC;IAED,OAAOT,QAAQ,CAACpD,IAAI,CAAC;EACvB,CAAC,EAAE,CAACA,IAAI,EAAES,MAAM,CAAC,CAAC;AACpB;AAEA,MAAMO,MAAM,GAAGuD,uBAAU,CAACC,MAAM,CAAC;EAC/BvD,KAAK,EAAE;IACLwD,IAAI,EAAE,CAAC;IACPC,OAAO,EAAE,EAAE;IACXC,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE,CAAC;IACdC,aAAa,EAAE,KAAK;IACpBC,GAAG,EAAE,CAAC;IACNC,eAAe,EAAE,EAAE;IACnB;IACA,GAAG,IAAAC,yBAAgB,EAAC,GAAG;EACzB,CAAC;EACDnD,aAAa,EAAE;IACb4C,IAAI,EAAE,CAAC;IACPQ,YAAY,EAAE;EAChB,CAAC;EACDlD,IAAI,EAAE;IACJmD,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBC,UAAU,EAAE;EACd,CAAC;EACDpC,YAAY,EAAE;IACZ+B,eAAe,EAAE,CAAC;IAClBM,iBAAiB,EAAE,CAAC;IACpBV,YAAY,EAAE,CAAC;IACfW,SAAS,EAAE;EACb,CAAC;EACDnC,UAAU,EAAE;IACV+B,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBC,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["DURATION","exports"],"sourceRoot":"../../../src","sources":["toast/const.ts"],"mappings":";;;;;;AAAO,MAAMA,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAG,GAAG","ignoreList":[]}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "Action", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _Toast.Action;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "DURATION", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _const.DURATION;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "Icon", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _Toast.Icon;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "Outer", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _Toast.Outer;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "Text", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () {
|
|
33
|
-
return _Toast.Text;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(exports, "ToastConfigProvider", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function () {
|
|
39
|
-
return _Toast.ToastConfigProvider;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
exports.ToastOutlet = ToastOutlet;
|
|
43
|
-
exports.toast = exports.show = exports.api = void 0;
|
|
44
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
45
|
-
var _nonSecure = require("nanoid/non-secure");
|
|
46
|
-
var _sonner = require("sonner");
|
|
47
|
-
var _const = require("./const.js");
|
|
48
|
-
var _Toast = require("./Toast.js");
|
|
49
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
50
|
-
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); }
|
|
51
|
-
/**
|
|
52
|
-
* Toasts are rendered in a global outlet, which is placed at the top of the
|
|
53
|
-
* component tree.
|
|
54
|
-
*/
|
|
55
|
-
function ToastOutlet() {
|
|
56
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sonner.Toaster, {
|
|
57
|
-
position: "bottom-left",
|
|
58
|
-
gap: 8,
|
|
59
|
-
offset: 20,
|
|
60
|
-
mobileOffset: 20
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/** Direct access to the underlying Sonner API. Use sparingly. */
|
|
65
|
-
const api = exports.api = _sonner.toast;
|
|
66
|
-
function dispatch(content, type, options = {}) {
|
|
67
|
-
const id = (0, _nonSecure.nanoid)();
|
|
68
|
-
if (typeof content === 'string') {
|
|
69
|
-
(0, _sonner.toast)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Toast.ToastConfigProvider, {
|
|
70
|
-
id: id,
|
|
71
|
-
type: type,
|
|
72
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Toast.Outer, {
|
|
73
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Toast.Icon, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Toast.Text, {
|
|
74
|
-
children: content
|
|
75
|
-
})]
|
|
76
|
-
})
|
|
77
|
-
}), {
|
|
78
|
-
...options,
|
|
79
|
-
unstyled: true,
|
|
80
|
-
id,
|
|
81
|
-
duration: options?.duration ?? _const.DURATION
|
|
82
|
-
});
|
|
83
|
-
} else if (/*#__PURE__*/(0, _react.isValidElement)(content)) {
|
|
84
|
-
(0, _sonner.toast)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Toast.ToastConfigProvider, {
|
|
85
|
-
id: id,
|
|
86
|
-
type: type,
|
|
87
|
-
children: content
|
|
88
|
-
}), {
|
|
89
|
-
...options,
|
|
90
|
-
unstyled: true,
|
|
91
|
-
id,
|
|
92
|
-
duration: options?.duration ?? _const.DURATION
|
|
93
|
-
});
|
|
94
|
-
} else {
|
|
95
|
-
throw new Error(`Toast can be a string or a React element, got ${typeof content}`);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Show a toast notification. Identical API to the native variant — see
|
|
101
|
-
* `./index.tsx` for the full usage docs.
|
|
102
|
-
*/
|
|
103
|
-
|
|
104
|
-
const toastImpl = (content, options = {}) => {
|
|
105
|
-
dispatch(content, options.type ?? 'default', options);
|
|
106
|
-
};
|
|
107
|
-
toastImpl.success = (content, options) => dispatch(content, 'success', options ?? {});
|
|
108
|
-
toastImpl.error = (content, options) => dispatch(content, 'error', options ?? {});
|
|
109
|
-
toastImpl.warning = (content, options) => dispatch(content, 'warning', options ?? {});
|
|
110
|
-
toastImpl.info = (content, options) => dispatch(content, 'info', options ?? {});
|
|
111
|
-
toastImpl.dismiss = id => _sonner.toast.dismiss(id);
|
|
112
|
-
const toast = exports.toast = toastImpl;
|
|
113
|
-
const show = exports.show = toastImpl;
|
|
114
|
-
//# sourceMappingURL=index.web.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_nonSecure","_sonner","_const","_Toast","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ToastOutlet","jsx","Toaster","position","gap","offset","mobileOffset","api","exports","sonner","dispatch","content","type","options","id","nanoid","ToastConfigProvider","children","jsxs","Outer","Icon","Text","unstyled","duration","DURATION","isValidElement","Error","toastImpl","success","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AGP,SAAS","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_sonnerNative","require","dismiss","exports","toast"],"sourceRoot":"../../../../src","sources":["toast/sonner/index.ts"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAEO,MAAMC,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAGE,mBAAK,CAACF,OAAO","ignoreList":[]}
|