@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,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ported from expo-glass-tabs v0.1.1 — src/glass-tab-bar.tsx
|
|
3
|
+
* (MIT © 2026 David Mokos). See the top-level NOTICE.
|
|
4
|
+
*
|
|
5
|
+
* Public API types for `@oxyhq/bloom/tab-bar`.
|
|
6
|
+
*
|
|
7
|
+
* This module imports from `react` and `react-native` ONLY. It is resolved by a
|
|
8
|
+
* consumer's `tsc`, by Metro, and by every web bundler alike, so a platform
|
|
9
|
+
* import here (expo-glass-effect / expo-symbols / expo-router) would break all
|
|
10
|
+
* three at once. Platform behaviour lives in `surface.native.tsx` /
|
|
11
|
+
* `glyph.native.tsx` / `surface.web.tsx` and the `expo-router/` adapter.
|
|
12
|
+
*/
|
|
13
|
+
import type { ReactNode } from 'react';
|
|
14
|
+
import type { PressableProps, ViewProps } from 'react-native';
|
|
15
|
+
|
|
16
|
+
export type TabBarItem = {
|
|
17
|
+
/** Stable identity for the tab (a route name in router-driven usage). */
|
|
18
|
+
name: string;
|
|
19
|
+
/** Text under the icon; fades out and is clipped when the bar minimizes. */
|
|
20
|
+
label: string;
|
|
21
|
+
/**
|
|
22
|
+
* The glyph, as a Bloom icon element (`<Icons.Home />`) or any node. This is
|
|
23
|
+
* the primary icon API — same convention as `Tabs`/`TabsTrigger` and
|
|
24
|
+
* `FrostedIconButton`. The bar renders it TWICE (an inactive layer with the
|
|
25
|
+
* active layer crossfading on top), injecting the layer's tint as the icon's
|
|
26
|
+
* `fill` unless the element already sets one.
|
|
27
|
+
*/
|
|
28
|
+
icon: ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Optional SF Symbol name, used INSTEAD of `icon` on iOS only. A pure
|
|
31
|
+
* enhancement handled solely in `glyph.native.tsx`; the neutral and web
|
|
32
|
+
* glyphs ignore it and render `icon`, so every platform stays covered.
|
|
33
|
+
*/
|
|
34
|
+
sfSymbol?: string;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type TabBarTheme = {
|
|
38
|
+
/** Label/glyph color of the tab the highlight is over. */
|
|
39
|
+
activeTint: string;
|
|
40
|
+
/** Label/glyph color of every other tab. */
|
|
41
|
+
inactiveTint: string;
|
|
42
|
+
/** Sliding highlight pill color. */
|
|
43
|
+
highlight: string;
|
|
44
|
+
/** Tint layered over the liquid glass (iOS 26) surface. */
|
|
45
|
+
glassTint: string;
|
|
46
|
+
/** Near-opaque background used when liquid glass is unavailable. */
|
|
47
|
+
solidFallback: string;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export type TabBarProps = ViewProps & {
|
|
51
|
+
/**
|
|
52
|
+
* CONTROLLED path — the index of the focused tab. The bar owns the sliding
|
|
53
|
+
* highlight and springs it here whenever this changes. Use this when there is
|
|
54
|
+
* no router in play; the router adapter uses the per-button `isFocused` path
|
|
55
|
+
* instead (see {@link TabBarButtonProps.isFocused}) and must NOT pass this.
|
|
56
|
+
*/
|
|
57
|
+
activeIndex?: number;
|
|
58
|
+
/**
|
|
59
|
+
* Called with the chosen index when a tab is picked by tap, by scrub release,
|
|
60
|
+
* or by keyboard/assistive-technology activation of a `TabBarButton`.
|
|
61
|
+
*/
|
|
62
|
+
onIndexChange?: (index: number) => void;
|
|
63
|
+
/** Partial override of the theme resolved from Bloom's color tokens. */
|
|
64
|
+
theme?: Partial<TabBarTheme>;
|
|
65
|
+
/**
|
|
66
|
+
* Haptic tick as the scrub crosses tab boundaries. Defaults to `true`. Runs
|
|
67
|
+
* through Bloom's `useHaptics`, so it is already a no-op on web and when the
|
|
68
|
+
* optional `expo-haptics` peer is absent.
|
|
69
|
+
*/
|
|
70
|
+
haptics?: boolean;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export type TabBarButtonProps = PressableProps & {
|
|
74
|
+
item: TabBarItem;
|
|
75
|
+
/** Position in the bar. Drives the highlight target and the glyph crossfade. */
|
|
76
|
+
index: number;
|
|
77
|
+
/**
|
|
78
|
+
* FOCUS-DRIVEN path — supplied by the `expo-router` adapter from the tab
|
|
79
|
+
* trigger's own focus state. When present it wins over the bar's
|
|
80
|
+
* `activeIndex`, and this button (not the bar) drives the highlight, which is
|
|
81
|
+
* what makes programmatic navigation, deep links and back gestures move it.
|
|
82
|
+
*
|
|
83
|
+
* Leave it undefined for the controlled path: the button then resolves its
|
|
84
|
+
* focus from the bar's `activeIndex` and reports presses through the bar's
|
|
85
|
+
* `onIndexChange`.
|
|
86
|
+
*/
|
|
87
|
+
isFocused?: boolean;
|
|
88
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Derived from sonner-native v0.26.4 — src/positioner.tsx
|
|
3
|
+
* (MIT © Gunnar Torfi Steinarsson). See the top-level NOTICE.
|
|
4
|
+
*
|
|
5
|
+
* One container per occupied position, plus the press-to-collapse area outside an
|
|
6
|
+
* expanded stack. The container pins all four edges and `getInsetValues` overrides
|
|
7
|
+
* just the anchored one, so it always has a real height and the rows inside it —
|
|
8
|
+
* which are absolutely positioned — are never laid out out of bounds. See
|
|
9
|
+
* `getContainerStyle` for what a zero-height container did to Android.
|
|
10
|
+
*
|
|
11
|
+
* `position: 'absolute'` is correct on BOTH platforms and this file stays fully
|
|
12
|
+
* universal: `ToastHost` supplies a viewport-sized containing block on web, so
|
|
13
|
+
* there is no `.web` fork and no `position: 'fixed'` here (W7).
|
|
14
|
+
*
|
|
15
|
+
* `pointerEvents` goes in `style`, never as a prop — the prop form is deprecated
|
|
16
|
+
* in react-native-web and logs on every render.
|
|
17
|
+
*/
|
|
18
|
+
import * as React from 'react';
|
|
19
|
+
import { Platform, Pressable, View } from 'react-native';
|
|
20
|
+
import {
|
|
21
|
+
SafeAreaInsetsContext,
|
|
22
|
+
initialWindowMetrics,
|
|
23
|
+
} from 'react-native-safe-area-context';
|
|
24
|
+
|
|
25
|
+
import { useDynamicToastContext, useToastContext } from './context';
|
|
26
|
+
import {
|
|
27
|
+
calculateOutsidePressableArea,
|
|
28
|
+
getContainerStyle,
|
|
29
|
+
getInsetValues,
|
|
30
|
+
} from './positioner-utils';
|
|
31
|
+
import type { ToasterProps } from './types';
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Web `initialWindowMetrics` is `null`, and on native it is null until the
|
|
35
|
+
* provider measures — both fall back to zero insets, which `getInsetValues` then
|
|
36
|
+
* turns into its 16px default.
|
|
37
|
+
*/
|
|
38
|
+
const FALLBACK_INSETS = initialWindowMetrics?.insets ?? {
|
|
39
|
+
top: 0,
|
|
40
|
+
bottom: 0,
|
|
41
|
+
left: 0,
|
|
42
|
+
right: 0,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Without elevation the positioner can render behind sibling react-native-screens
|
|
47
|
+
* surfaces (native-stack, bottom-tabs) on Android, hiding toasts entirely. Kept
|
|
48
|
+
* alongside the `zIndex` the host applies, because Android orders those native
|
|
49
|
+
* siblings by elevation.
|
|
50
|
+
*/
|
|
51
|
+
const ANDROID_ELEVATION = 9999;
|
|
52
|
+
const androidElevationStyle =
|
|
53
|
+
Platform.OS === 'android' ? { elevation: ANDROID_ELEVATION } : null;
|
|
54
|
+
|
|
55
|
+
export const Positioner: React.FC<
|
|
56
|
+
React.PropsWithChildren<Pick<ToasterProps, 'position' | 'style'>>
|
|
57
|
+
> = ({ children, position, style }) => {
|
|
58
|
+
const { offset, gap, visibleToasts } = useToastContext();
|
|
59
|
+
const { isExpanded, collapse, toastHeights } = useDynamicToastContext();
|
|
60
|
+
const insets = React.useContext(SafeAreaInsetsContext) ?? FALLBACK_INSETS;
|
|
61
|
+
|
|
62
|
+
const resolvedPosition = position ?? 'bottom-center';
|
|
63
|
+
const insetValues = getInsetValues({
|
|
64
|
+
position: resolvedPosition,
|
|
65
|
+
offset,
|
|
66
|
+
safeAreaInsets: { top: insets.top, bottom: insets.bottom },
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const handleOutsidePress = React.useCallback(() => {
|
|
70
|
+
if (isExpanded) {
|
|
71
|
+
collapse();
|
|
72
|
+
}
|
|
73
|
+
}, [isExpanded, collapse]);
|
|
74
|
+
|
|
75
|
+
// Collapsing by pressing outside only makes sense for an anchored stack.
|
|
76
|
+
const shouldAllowCollapse = resolvedPosition !== 'center' && isExpanded;
|
|
77
|
+
const hasChildren = React.Children.count(children) > 0;
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<>
|
|
81
|
+
{shouldAllowCollapse ? (
|
|
82
|
+
<Pressable
|
|
83
|
+
style={[
|
|
84
|
+
calculateOutsidePressableArea({
|
|
85
|
+
position: resolvedPosition,
|
|
86
|
+
toastHeights,
|
|
87
|
+
gap,
|
|
88
|
+
visibleToasts,
|
|
89
|
+
insetValues,
|
|
90
|
+
}),
|
|
91
|
+
androidElevationStyle,
|
|
92
|
+
]}
|
|
93
|
+
onPress={handleOutsidePress}
|
|
94
|
+
/>
|
|
95
|
+
) : null}
|
|
96
|
+
<View
|
|
97
|
+
style={[
|
|
98
|
+
getContainerStyle(),
|
|
99
|
+
androidElevationStyle,
|
|
100
|
+
// Overrides ONE edge of the four `getContainerStyle` pins, so the box
|
|
101
|
+
// keeps a real height and the rows inside it stay in bounds.
|
|
102
|
+
insetValues,
|
|
103
|
+
// This container spans the whole host, so it must never swallow a touch.
|
|
104
|
+
// `box-none` passes presses through to the app while still reaching the
|
|
105
|
+
// rows; an EMPTY one on Android drops to `none` outright, because the
|
|
106
|
+
// outlet's configured position always renders a container even with no
|
|
107
|
+
// rows in it (see `Toaster`'s grouping).
|
|
108
|
+
{
|
|
109
|
+
pointerEvents:
|
|
110
|
+
Platform.OS === 'android' && !hasChildren ? 'none' : 'box-none',
|
|
111
|
+
},
|
|
112
|
+
style,
|
|
113
|
+
]}
|
|
114
|
+
>
|
|
115
|
+
{children}
|
|
116
|
+
</View>
|
|
117
|
+
</>
|
|
118
|
+
);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
Positioner.displayName = 'ToastPositioner';
|
|
@@ -1,10 +1,32 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { View } from 'react-native';
|
|
2
|
+
import { Text, View } from 'react-native';
|
|
3
|
+
import { SlideInLeft } from 'react-native-reanimated';
|
|
3
4
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
4
5
|
|
|
5
6
|
import { Button } from '../button';
|
|
6
7
|
import { toast, ToastOutlet } from './index';
|
|
8
|
+
import type { ToasterProps } from './types';
|
|
7
9
|
|
|
10
|
+
/**
|
|
11
|
+
* These stories run against the REAL `react-native-reanimated` /
|
|
12
|
+
* `react-native-gesture-handler` / `react-native-safe-area-context` bundled
|
|
13
|
+
* against react-native-web WITHOUT the worklets babel plugin — exactly what
|
|
14
|
+
* every Oxy consumer ships, which is what makes this a genuine web gate.
|
|
15
|
+
*
|
|
16
|
+
* Two shapes of multi-toast story exist on purpose and BOTH must be kept:
|
|
17
|
+
*
|
|
18
|
+
* - `Stacking` fires four toasts in ONE tick. Every row enters at its final
|
|
19
|
+
* slot, so no row ever changes position after it has settled.
|
|
20
|
+
* - `Sequential*` fires one toast, waits, then fires another while the first
|
|
21
|
+
* is AT REST. Only this shape moves a settled row, and only this shape
|
|
22
|
+
* catches the class of bug where something pins a row at a stale position.
|
|
23
|
+
*
|
|
24
|
+
* A one-tick story passing proves nothing about the sequential case. Verify a
|
|
25
|
+
* `Sequential*` story by comparing the two rows' `getBoundingClientRect().y`:
|
|
26
|
+
* unstacked they must be ~54px apart (46px measured row + 8px gap), collapsed-
|
|
27
|
+
* stack ~8px apart. Equal `y` values mean the rows are drawn on top of each
|
|
28
|
+
* other — the failure this shape exists to catch.
|
|
29
|
+
*/
|
|
8
30
|
const meta: Meta = {
|
|
9
31
|
title: 'Components/Toast',
|
|
10
32
|
};
|
|
@@ -13,97 +35,302 @@ export default meta;
|
|
|
13
35
|
|
|
14
36
|
type Story = StoryObj;
|
|
15
37
|
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
|
|
38
|
+
function Demo({
|
|
39
|
+
children,
|
|
40
|
+
outlet,
|
|
19
41
|
}: {
|
|
20
|
-
|
|
21
|
-
|
|
42
|
+
children: React.ReactNode;
|
|
43
|
+
outlet?: ToasterProps;
|
|
22
44
|
}) {
|
|
23
|
-
const fire = () => {
|
|
24
|
-
switch (variant) {
|
|
25
|
-
case 'success':
|
|
26
|
-
toast.success(message);
|
|
27
|
-
return;
|
|
28
|
-
case 'error':
|
|
29
|
-
toast.error(message);
|
|
30
|
-
return;
|
|
31
|
-
case 'warning':
|
|
32
|
-
toast.warning(message);
|
|
33
|
-
return;
|
|
34
|
-
case 'info':
|
|
35
|
-
toast.info(message);
|
|
36
|
-
return;
|
|
37
|
-
case 'default':
|
|
38
|
-
default:
|
|
39
|
-
toast(message);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
45
|
return (
|
|
44
|
-
<
|
|
46
|
+
<View style={{ gap: 12, alignItems: 'flex-start' }}>
|
|
47
|
+
{children}
|
|
48
|
+
<ToastOutlet {...outlet} />
|
|
49
|
+
</View>
|
|
45
50
|
);
|
|
46
51
|
}
|
|
47
52
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
53
|
+
/**
|
|
54
|
+
* All six rows must share ONE neutral surface — only the leading icon changes
|
|
55
|
+
* colour. Compare against `RichColors`, which keeps that same surface and adds the
|
|
56
|
+
* status colour to the border and title.
|
|
57
|
+
*/
|
|
58
|
+
export const Variants: Story = {
|
|
59
|
+
render: () => (
|
|
60
|
+
<Demo>
|
|
61
|
+
<Button onPress={() => toast('Saved')}>Default</Button>
|
|
62
|
+
<Button onPress={() => toast.success('Profile updated')}>Success</Button>
|
|
63
|
+
<Button onPress={() => toast.error('Network error')}>Error</Button>
|
|
64
|
+
<Button onPress={() => toast.warning('Storage almost full')}>Warning</Button>
|
|
65
|
+
<Button onPress={() => toast.info('New version available')}>Info</Button>
|
|
66
|
+
<Button onPress={() => toast.loading('Uploading…')}>Loading</Button>
|
|
67
|
+
</Demo>
|
|
68
|
+
),
|
|
69
|
+
};
|
|
51
70
|
|
|
52
|
-
|
|
71
|
+
/**
|
|
72
|
+
* The direct comparison against `Variants`. The SURFACE is identical in both
|
|
73
|
+
* stories — `richColors` only widens the status colour from the icon alone to the
|
|
74
|
+
* border and title as well, so a success row here is a neutral card with a green
|
|
75
|
+
* icon, green border and green title. Two failure modes to watch for: a tinted or
|
|
76
|
+
* brand-coloured surface (the status/brand token families got mixed again), or a
|
|
77
|
+
* row indistinguishable from `Variants` (the prop stopped doing anything).
|
|
78
|
+
*/
|
|
79
|
+
export const RichColors: Story = {
|
|
53
80
|
render: () => (
|
|
54
|
-
<
|
|
55
|
-
<
|
|
56
|
-
<
|
|
57
|
-
|
|
81
|
+
<Demo outlet={{ richColors: true }}>
|
|
82
|
+
<Button onPress={() => toast.success('Profile updated')}>Success</Button>
|
|
83
|
+
<Button onPress={() => toast.error('Network error')}>Error</Button>
|
|
84
|
+
<Button onPress={() => toast.warning('Storage almost full')}>Warning</Button>
|
|
85
|
+
<Button onPress={() => toast.info('New version available')}>Info</Button>
|
|
86
|
+
</Demo>
|
|
58
87
|
),
|
|
59
88
|
};
|
|
60
89
|
|
|
61
|
-
export const
|
|
90
|
+
export const WithDescription: Story = {
|
|
62
91
|
render: () => (
|
|
63
|
-
<
|
|
64
|
-
<
|
|
65
|
-
|
|
66
|
-
|
|
92
|
+
<Demo>
|
|
93
|
+
<Button
|
|
94
|
+
onPress={() =>
|
|
95
|
+
toast.success('Profile updated', {
|
|
96
|
+
description: 'Your changes are visible to everyone.',
|
|
97
|
+
})
|
|
98
|
+
}
|
|
99
|
+
>
|
|
100
|
+
Title + description
|
|
101
|
+
</Button>
|
|
102
|
+
</Demo>
|
|
67
103
|
),
|
|
68
104
|
};
|
|
69
105
|
|
|
70
|
-
export const
|
|
71
|
-
name: 'Error',
|
|
106
|
+
export const WithAction: Story = {
|
|
72
107
|
render: () => (
|
|
73
|
-
<
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
|
|
108
|
+
<Demo>
|
|
109
|
+
<Button
|
|
110
|
+
onPress={() =>
|
|
111
|
+
toast('Item moved to trash', {
|
|
112
|
+
action: { label: 'Undo', onClick: () => toast.success('Restored') },
|
|
113
|
+
})
|
|
114
|
+
}
|
|
115
|
+
>
|
|
116
|
+
Action
|
|
117
|
+
</Button>
|
|
118
|
+
<Button
|
|
119
|
+
onPress={() =>
|
|
120
|
+
toast('Discard draft?', {
|
|
121
|
+
action: { label: 'Discard', onClick: () => toast.error('Discarded') },
|
|
122
|
+
cancel: { label: 'Keep', onClick: () => {} },
|
|
123
|
+
})
|
|
124
|
+
}
|
|
125
|
+
>
|
|
126
|
+
Action + cancel
|
|
127
|
+
</Button>
|
|
128
|
+
</Demo>
|
|
77
129
|
),
|
|
78
130
|
};
|
|
79
131
|
|
|
80
|
-
export const
|
|
132
|
+
export const CloseButton: Story = {
|
|
81
133
|
render: () => (
|
|
82
|
-
<
|
|
83
|
-
<
|
|
84
|
-
|
|
85
|
-
|
|
134
|
+
<Demo outlet={{ closeButton: true }}>
|
|
135
|
+
<Button onPress={() => toast('Dismiss me with the close button', { duration: Infinity })}>
|
|
136
|
+
Close button
|
|
137
|
+
</Button>
|
|
138
|
+
</Demo>
|
|
86
139
|
),
|
|
87
140
|
};
|
|
88
141
|
|
|
89
|
-
export const
|
|
142
|
+
export const PromiseToast: Story = {
|
|
143
|
+
name: 'Promise',
|
|
90
144
|
render: () => (
|
|
91
|
-
<
|
|
92
|
-
<
|
|
93
|
-
|
|
94
|
-
|
|
145
|
+
<Demo>
|
|
146
|
+
<Button
|
|
147
|
+
onPress={() =>
|
|
148
|
+
toast.promise(
|
|
149
|
+
new Promise<{ name: string }>((resolve) =>
|
|
150
|
+
setTimeout(() => resolve({ name: 'Nate' }), 1500),
|
|
151
|
+
),
|
|
152
|
+
{
|
|
153
|
+
loading: 'Saving…',
|
|
154
|
+
success: (profile) => `Saved ${profile.name}`,
|
|
155
|
+
error: 'Could not save',
|
|
156
|
+
},
|
|
157
|
+
)
|
|
158
|
+
}
|
|
159
|
+
>
|
|
160
|
+
Resolves
|
|
161
|
+
</Button>
|
|
162
|
+
<Button
|
|
163
|
+
onPress={() =>
|
|
164
|
+
toast.promise(
|
|
165
|
+
new Promise<void>((_resolve, reject) =>
|
|
166
|
+
setTimeout(() => reject(new Error('offline')), 1500),
|
|
167
|
+
),
|
|
168
|
+
{
|
|
169
|
+
loading: 'Saving…',
|
|
170
|
+
success: () => 'Saved',
|
|
171
|
+
error: (err) =>
|
|
172
|
+
`Failed: ${err instanceof Error ? err.message : 'unknown'}`,
|
|
173
|
+
},
|
|
174
|
+
)
|
|
175
|
+
}
|
|
176
|
+
>
|
|
177
|
+
Rejects
|
|
178
|
+
</Button>
|
|
179
|
+
</Demo>
|
|
95
180
|
),
|
|
96
181
|
};
|
|
97
182
|
|
|
98
|
-
export const
|
|
183
|
+
export const UpdateInPlace: Story = {
|
|
99
184
|
render: () => (
|
|
100
|
-
<
|
|
101
|
-
<
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
185
|
+
<Demo>
|
|
186
|
+
<Button
|
|
187
|
+
onPress={() => {
|
|
188
|
+
toast.loading('Uploading…', { id: 'upload' });
|
|
189
|
+
setTimeout(() => toast.success('Uploaded', { id: 'upload' }), 1500);
|
|
190
|
+
}}
|
|
191
|
+
>
|
|
192
|
+
Same id, updated row
|
|
193
|
+
</Button>
|
|
194
|
+
</Demo>
|
|
195
|
+
),
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
export const Custom: Story = {
|
|
199
|
+
render: () => (
|
|
200
|
+
<Demo>
|
|
201
|
+
<Button
|
|
202
|
+
onPress={() =>
|
|
203
|
+
toast.custom(
|
|
204
|
+
<View
|
|
205
|
+
style={{
|
|
206
|
+
marginHorizontal: 16,
|
|
207
|
+
padding: 16,
|
|
208
|
+
borderRadius: 12,
|
|
209
|
+
backgroundColor: '#111',
|
|
210
|
+
}}
|
|
211
|
+
>
|
|
212
|
+
<Text style={{ color: '#fff', fontWeight: '600' }}>
|
|
213
|
+
A completely custom row
|
|
214
|
+
</Text>
|
|
215
|
+
</View>,
|
|
216
|
+
)
|
|
217
|
+
}
|
|
218
|
+
>
|
|
219
|
+
toast.custom
|
|
220
|
+
</Button>
|
|
221
|
+
</Demo>
|
|
222
|
+
),
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
export const Stacking: Story = {
|
|
226
|
+
render: () => (
|
|
227
|
+
<Demo outlet={{ enableStacking: true, visibleToasts: 3 }}>
|
|
228
|
+
<Button
|
|
229
|
+
onPress={() => {
|
|
230
|
+
toast('First');
|
|
231
|
+
toast('Second');
|
|
232
|
+
toast('Third');
|
|
233
|
+
toast('Fourth — the first should be culled');
|
|
234
|
+
}}
|
|
235
|
+
>
|
|
236
|
+
Queue four
|
|
237
|
+
</Button>
|
|
238
|
+
</Demo>
|
|
239
|
+
),
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* The three sequential regression stories. Fire `One`, let it settle, then fire
|
|
244
|
+
* `Two` — the second toast must land BESIDE the first, never on top of it. See
|
|
245
|
+
* the file header for the expected geometry.
|
|
246
|
+
*/
|
|
247
|
+
function SequentialDemo({ outlet }: { outlet?: ToasterProps }) {
|
|
248
|
+
return (
|
|
249
|
+
<Demo outlet={outlet}>
|
|
250
|
+
<Button onPress={() => toast('Row one', { duration: Infinity })}>One</Button>
|
|
251
|
+
<Button onPress={() => toast('Row two', { duration: Infinity })}>Two</Button>
|
|
252
|
+
</Demo>
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export const SequentialStacked: Story = {
|
|
257
|
+
render: () => <SequentialDemo outlet={{ enableStacking: true, visibleToasts: 3 }} />,
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
export const SequentialUnstacked: Story = {
|
|
261
|
+
render: () => <SequentialDemo outlet={{ enableStacking: false, visibleToasts: 5 }} />,
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
export const SequentialTopCenter: Story = {
|
|
265
|
+
render: () => <SequentialDemo outlet={{ position: 'top-center', visibleToasts: 5 }} />,
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Mixed positions on ONE outlet. The outlet is left at its default
|
|
270
|
+
* `bottom-center`, so:
|
|
271
|
+
*
|
|
272
|
+
* "Top" -> an explicit `position: 'top-center'` toast, near the top
|
|
273
|
+
* "Plain" -> a POSITION-LESS toast, which must land at the outlet's configured
|
|
274
|
+
* position (bottom-center) whether or not the top one is alive
|
|
275
|
+
*
|
|
276
|
+
* Fire Top first, then Plain. A position-less toast that relocates to the top
|
|
277
|
+
* means position grouping is keying off whichever position happens to be first in
|
|
278
|
+
* the occupied list rather than the outlet's own.
|
|
279
|
+
*/
|
|
280
|
+
export const MixedPositions: Story = {
|
|
281
|
+
render: () => (
|
|
282
|
+
<Demo outlet={{ visibleToasts: 5 }}>
|
|
283
|
+
<Button
|
|
284
|
+
onPress={() =>
|
|
285
|
+
toast('Top row', { position: 'top-center', duration: Infinity })
|
|
286
|
+
}
|
|
287
|
+
>
|
|
288
|
+
Top
|
|
289
|
+
</Button>
|
|
290
|
+
<Button onPress={() => toast('Plain row', { duration: Infinity })}>
|
|
291
|
+
Plain
|
|
292
|
+
</Button>
|
|
293
|
+
</Demo>
|
|
294
|
+
),
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
export const TopCenter: Story = {
|
|
298
|
+
render: () => (
|
|
299
|
+
<Demo outlet={{ position: 'top-center' }}>
|
|
300
|
+
<Button onPress={() => toast('Anchored to the top')}>Top</Button>
|
|
301
|
+
</Demo>
|
|
302
|
+
),
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
export const Center: Story = {
|
|
306
|
+
render: () => (
|
|
307
|
+
<Demo outlet={{ position: 'center' }}>
|
|
308
|
+
<Button onPress={() => toast('Anchored to the middle')}>Center</Button>
|
|
309
|
+
</Demo>
|
|
310
|
+
),
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
export const SwipeUp: Story = {
|
|
314
|
+
render: () => (
|
|
315
|
+
<Demo outlet={{ swipeToDismissDirection: 'up', position: 'top-center' }}>
|
|
316
|
+
<Button onPress={() => toast('Swipe me up', { duration: Infinity })}>
|
|
317
|
+
Swipe up to dismiss
|
|
318
|
+
</Button>
|
|
319
|
+
</Demo>
|
|
320
|
+
),
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* The consumer-override branch: Bloom's own enter is imperative, so a supplied
|
|
325
|
+
* `animation.enter` is the ONLY thing ever handed to reanimated's `entering`.
|
|
326
|
+
* Sequential on purpose — an override must not reintroduce the stale-position
|
|
327
|
+
* pin the default enter was moved off `entering` to avoid.
|
|
328
|
+
*/
|
|
329
|
+
export const CustomEnterAnimation: Story = {
|
|
330
|
+
render: () => (
|
|
331
|
+
<Demo outlet={{ animation: { enter: SlideInLeft.duration(300) }, visibleToasts: 5 }}>
|
|
332
|
+
<Button onPress={() => toast('Row one', { duration: Infinity })}>One</Button>
|
|
333
|
+
<Button onPress={() => toast('Row two', { duration: Infinity })}>Two</Button>
|
|
334
|
+
</Demo>
|
|
108
335
|
),
|
|
109
336
|
};
|