@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,405 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Derived from sonner-native v0.26.4 — src/toast.tsx:440-689
|
|
3
|
+
* (MIT © Gunnar Torfi Steinarsson — see the top-level NOTICE), restyled with
|
|
4
|
+
* Bloom's design tokens and absorbing the surface/text/action styling from
|
|
5
|
+
* Bloom's previous `Toast.tsx`.
|
|
6
|
+
*
|
|
7
|
+
* This is the DEFAULT renderer. A consumer who passes `jsx` (via `toast.custom`)
|
|
8
|
+
* owns the whole row and this file is not involved.
|
|
9
|
+
*
|
|
10
|
+
* W11 — the surface elevation comes from `bloomShadowStyle('s')`, which is a
|
|
11
|
+
* `boxShadow` on web and RN `shadow*`/`elevation` on native. Upstream hardcodes
|
|
12
|
+
* iOS-only `shadowOpacity`/`shadowRadius` values, so its toast has no shadow on
|
|
13
|
+
* web (no `boxShadow`) and none on iOS either (no `shadowColor`).
|
|
14
|
+
*/
|
|
15
|
+
import * as React from 'react';
|
|
16
|
+
import {
|
|
17
|
+
Pressable,
|
|
18
|
+
StyleSheet,
|
|
19
|
+
Text,
|
|
20
|
+
View,
|
|
21
|
+
type TextStyle,
|
|
22
|
+
type ViewStyle,
|
|
23
|
+
} from 'react-native';
|
|
24
|
+
|
|
25
|
+
import { bloomShadowStyle } from '../design-tokens/shadows';
|
|
26
|
+
import { useInteractionState } from '../hooks/useInteractionState';
|
|
27
|
+
import { TimesLarge_Stroke2_Corner0_Rounded as TimesIcon } from '../icons/Times';
|
|
28
|
+
import { borderRadius, fontSize, space } from '../styles/tokens';
|
|
29
|
+
import { ToastIcon } from './ToastIcon';
|
|
30
|
+
import { useToastColors, type ToastActionColors } from './use-toast-colors';
|
|
31
|
+
import {
|
|
32
|
+
isToastAction,
|
|
33
|
+
type ToastAction,
|
|
34
|
+
type ToasterProps,
|
|
35
|
+
type ToastProps,
|
|
36
|
+
} from './types';
|
|
37
|
+
|
|
38
|
+
export type ToastContentProps = Pick<
|
|
39
|
+
ToastProps,
|
|
40
|
+
| 'id'
|
|
41
|
+
| 'title'
|
|
42
|
+
| 'description'
|
|
43
|
+
| 'variant'
|
|
44
|
+
| 'icon'
|
|
45
|
+
| 'action'
|
|
46
|
+
| 'cancel'
|
|
47
|
+
| 'close'
|
|
48
|
+
| 'closeButton'
|
|
49
|
+
| 'dismissible'
|
|
50
|
+
| 'richColors'
|
|
51
|
+
| 'promiseOptions'
|
|
52
|
+
| 'styles'
|
|
53
|
+
| 'style'
|
|
54
|
+
| 'actionButtonStyle'
|
|
55
|
+
| 'actionButtonTextStyle'
|
|
56
|
+
| 'cancelButtonStyle'
|
|
57
|
+
| 'cancelButtonTextStyle'
|
|
58
|
+
| 'allowFontScaling'
|
|
59
|
+
| 'maxFontSizeMultiplier'
|
|
60
|
+
| 'backgroundComponent'
|
|
61
|
+
> & {
|
|
62
|
+
unstyled: boolean;
|
|
63
|
+
onDismiss: (id: string | number) => void;
|
|
64
|
+
/** Variant icon overrides from the outlet (`icons={{ success: … }}`). */
|
|
65
|
+
icons: ToastIcons;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
type ToastIcons = NonNullable<ToasterProps['icons']>;
|
|
69
|
+
|
|
70
|
+
export function ToastContent({
|
|
71
|
+
id,
|
|
72
|
+
title,
|
|
73
|
+
description,
|
|
74
|
+
variant,
|
|
75
|
+
icon,
|
|
76
|
+
icons,
|
|
77
|
+
action,
|
|
78
|
+
cancel,
|
|
79
|
+
close,
|
|
80
|
+
closeButton,
|
|
81
|
+
dismissible,
|
|
82
|
+
richColors = false,
|
|
83
|
+
promiseOptions,
|
|
84
|
+
styles: styleOverrides,
|
|
85
|
+
style,
|
|
86
|
+
unstyled,
|
|
87
|
+
onDismiss,
|
|
88
|
+
actionButtonStyle,
|
|
89
|
+
actionButtonTextStyle,
|
|
90
|
+
cancelButtonStyle,
|
|
91
|
+
cancelButtonTextStyle,
|
|
92
|
+
allowFontScaling,
|
|
93
|
+
maxFontSizeMultiplier,
|
|
94
|
+
backgroundComponent,
|
|
95
|
+
}: ToastContentProps) {
|
|
96
|
+
const colors = useToastColors({ variant, richColors });
|
|
97
|
+
const isLoading = Boolean(promiseOptions) || variant === 'loading';
|
|
98
|
+
|
|
99
|
+
const surfaceStyle: ViewStyle | undefined = unstyled
|
|
100
|
+
? undefined
|
|
101
|
+
: {
|
|
102
|
+
backgroundColor: colors.surface,
|
|
103
|
+
borderColor: colors.border,
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const textProps = { allowFontScaling, maxFontSizeMultiplier };
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<View
|
|
110
|
+
style={[
|
|
111
|
+
unstyled ? undefined : styles.surface,
|
|
112
|
+
surfaceStyle,
|
|
113
|
+
// A custom background needs the surface transparent and clipped so it can
|
|
114
|
+
// paint edge to edge underneath the content.
|
|
115
|
+
backgroundComponent ? styles.hostedBackground : undefined,
|
|
116
|
+
styleOverrides?.toast,
|
|
117
|
+
style,
|
|
118
|
+
]}
|
|
119
|
+
>
|
|
120
|
+
{backgroundComponent}
|
|
121
|
+
<View
|
|
122
|
+
style={[
|
|
123
|
+
unstyled ? undefined : styles.row,
|
|
124
|
+
// With a description the row is tall, so the icon sits at the top
|
|
125
|
+
// instead of being centred against two lines of text.
|
|
126
|
+
unstyled || !description ? undefined : styles.rowWithDescription,
|
|
127
|
+
backgroundComponent ? styles.aboveBackground : undefined,
|
|
128
|
+
styleOverrides?.toastContent,
|
|
129
|
+
]}
|
|
130
|
+
>
|
|
131
|
+
<ToastLeadingIcon
|
|
132
|
+
variant={variant}
|
|
133
|
+
icon={icon}
|
|
134
|
+
icons={icons}
|
|
135
|
+
isLoading={isLoading}
|
|
136
|
+
color={colors.icon}
|
|
137
|
+
/>
|
|
138
|
+
|
|
139
|
+
<View style={[styles.textContainer, styleOverrides?.textContainer]}>
|
|
140
|
+
<Text
|
|
141
|
+
{...textProps}
|
|
142
|
+
style={[
|
|
143
|
+
unstyled ? undefined : styles.title,
|
|
144
|
+
unstyled ? undefined : { color: colors.title },
|
|
145
|
+
styleOverrides?.title,
|
|
146
|
+
]}
|
|
147
|
+
>
|
|
148
|
+
{title}
|
|
149
|
+
</Text>
|
|
150
|
+
|
|
151
|
+
{description ? (
|
|
152
|
+
<Text
|
|
153
|
+
{...textProps}
|
|
154
|
+
style={[
|
|
155
|
+
unstyled ? undefined : styles.description,
|
|
156
|
+
unstyled ? undefined : { color: colors.description },
|
|
157
|
+
styleOverrides?.description,
|
|
158
|
+
]}
|
|
159
|
+
>
|
|
160
|
+
{description}
|
|
161
|
+
</Text>
|
|
162
|
+
) : null}
|
|
163
|
+
|
|
164
|
+
{action || cancel ? (
|
|
165
|
+
<View
|
|
166
|
+
style={[
|
|
167
|
+
unstyled ? undefined : styles.buttons,
|
|
168
|
+
styleOverrides?.buttons,
|
|
169
|
+
]}
|
|
170
|
+
>
|
|
171
|
+
{isToastAction(action) ? (
|
|
172
|
+
<ToastActionButton
|
|
173
|
+
action={action}
|
|
174
|
+
colors={colors.action}
|
|
175
|
+
buttonStyle={actionButtonStyle}
|
|
176
|
+
textStyle={actionButtonTextStyle}
|
|
177
|
+
{...textProps}
|
|
178
|
+
/>
|
|
179
|
+
) : (
|
|
180
|
+
action
|
|
181
|
+
)}
|
|
182
|
+
{isToastAction(cancel) ? (
|
|
183
|
+
<ToastActionButton
|
|
184
|
+
action={{
|
|
185
|
+
label: cancel.label,
|
|
186
|
+
onClick: () => {
|
|
187
|
+
cancel.onClick();
|
|
188
|
+
onDismiss(id);
|
|
189
|
+
},
|
|
190
|
+
}}
|
|
191
|
+
colors={colors.action}
|
|
192
|
+
transparent
|
|
193
|
+
buttonStyle={cancelButtonStyle}
|
|
194
|
+
textStyle={[{ color: colors.cancelText }, cancelButtonTextStyle]}
|
|
195
|
+
{...textProps}
|
|
196
|
+
/>
|
|
197
|
+
) : (
|
|
198
|
+
cancel
|
|
199
|
+
)}
|
|
200
|
+
</View>
|
|
201
|
+
) : null}
|
|
202
|
+
</View>
|
|
203
|
+
|
|
204
|
+
<ToastCloseButton
|
|
205
|
+
id={id}
|
|
206
|
+
close={close}
|
|
207
|
+
closeButton={closeButton}
|
|
208
|
+
dismissible={dismissible}
|
|
209
|
+
color={colors.closeButton}
|
|
210
|
+
onDismiss={onDismiss}
|
|
211
|
+
buttonStyle={styleOverrides?.closeButton}
|
|
212
|
+
iconStyle={styleOverrides?.closeButtonIcon}
|
|
213
|
+
/>
|
|
214
|
+
</View>
|
|
215
|
+
</View>
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
ToastContent.displayName = 'ToastContent';
|
|
220
|
+
|
|
221
|
+
function ToastLeadingIcon({
|
|
222
|
+
variant,
|
|
223
|
+
icon,
|
|
224
|
+
icons,
|
|
225
|
+
isLoading,
|
|
226
|
+
color,
|
|
227
|
+
}: {
|
|
228
|
+
variant: ToastProps['variant'];
|
|
229
|
+
icon: ToastProps['icon'];
|
|
230
|
+
icons: ToastIcons;
|
|
231
|
+
isLoading: boolean;
|
|
232
|
+
color: string;
|
|
233
|
+
}) {
|
|
234
|
+
if (isLoading) {
|
|
235
|
+
return <>{icons.loading ?? <ToastIcon variant="loading" color={color} />}</>;
|
|
236
|
+
}
|
|
237
|
+
if (icon) {
|
|
238
|
+
return <>{icon}</>;
|
|
239
|
+
}
|
|
240
|
+
if (variant && icons[variant]) {
|
|
241
|
+
return <>{icons[variant]}</>;
|
|
242
|
+
}
|
|
243
|
+
return <ToastIcon variant={variant} color={color} />;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function ToastActionButton({
|
|
247
|
+
action,
|
|
248
|
+
colors,
|
|
249
|
+
transparent,
|
|
250
|
+
buttonStyle,
|
|
251
|
+
textStyle,
|
|
252
|
+
allowFontScaling,
|
|
253
|
+
maxFontSizeMultiplier,
|
|
254
|
+
}: {
|
|
255
|
+
action: ToastAction;
|
|
256
|
+
colors: ToastActionColors;
|
|
257
|
+
transparent?: boolean;
|
|
258
|
+
buttonStyle?: ViewStyle;
|
|
259
|
+
textStyle?: TextStyle | Array<TextStyle | undefined>;
|
|
260
|
+
allowFontScaling?: boolean;
|
|
261
|
+
maxFontSizeMultiplier?: number;
|
|
262
|
+
}) {
|
|
263
|
+
// Driven from state rather than Pressable's function-form `style`, which
|
|
264
|
+
// react-native-css swallows on web (dropping the base padding/radius).
|
|
265
|
+
const { state: pressed, onIn, onOut } = useInteractionState();
|
|
266
|
+
|
|
267
|
+
return (
|
|
268
|
+
<Pressable
|
|
269
|
+
onPress={action.onClick}
|
|
270
|
+
onPressIn={onIn}
|
|
271
|
+
onPressOut={onOut}
|
|
272
|
+
accessibilityRole="button"
|
|
273
|
+
style={[
|
|
274
|
+
styles.actionButton,
|
|
275
|
+
transparent
|
|
276
|
+
? undefined
|
|
277
|
+
: {
|
|
278
|
+
backgroundColor: pressed
|
|
279
|
+
? colors.pressedBackground
|
|
280
|
+
: colors.background,
|
|
281
|
+
},
|
|
282
|
+
buttonStyle,
|
|
283
|
+
]}
|
|
284
|
+
>
|
|
285
|
+
<Text
|
|
286
|
+
numberOfLines={1}
|
|
287
|
+
allowFontScaling={allowFontScaling}
|
|
288
|
+
maxFontSizeMultiplier={maxFontSizeMultiplier}
|
|
289
|
+
style={[
|
|
290
|
+
styles.actionButtonText,
|
|
291
|
+
{ color: pressed ? colors.pressedText : colors.text },
|
|
292
|
+
textStyle,
|
|
293
|
+
]}
|
|
294
|
+
>
|
|
295
|
+
{action.label}
|
|
296
|
+
</Text>
|
|
297
|
+
</Pressable>
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
function ToastCloseButton({
|
|
302
|
+
id,
|
|
303
|
+
close,
|
|
304
|
+
closeButton,
|
|
305
|
+
dismissible,
|
|
306
|
+
color,
|
|
307
|
+
onDismiss,
|
|
308
|
+
buttonStyle,
|
|
309
|
+
iconStyle,
|
|
310
|
+
}: {
|
|
311
|
+
id: string | number;
|
|
312
|
+
close: ToastProps['close'];
|
|
313
|
+
closeButton: ToastProps['closeButton'];
|
|
314
|
+
dismissible: boolean | undefined;
|
|
315
|
+
color: string;
|
|
316
|
+
onDismiss: (id: string | number) => void;
|
|
317
|
+
buttonStyle?: ViewStyle;
|
|
318
|
+
iconStyle?: ViewStyle;
|
|
319
|
+
}) {
|
|
320
|
+
const handlePress = React.useCallback(() => {
|
|
321
|
+
onDismiss(id);
|
|
322
|
+
}, [onDismiss, id]);
|
|
323
|
+
|
|
324
|
+
if (!dismissible) {
|
|
325
|
+
return null;
|
|
326
|
+
}
|
|
327
|
+
if (close) {
|
|
328
|
+
return <>{close}</>;
|
|
329
|
+
}
|
|
330
|
+
if (!closeButton) {
|
|
331
|
+
return null;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
return (
|
|
335
|
+
<Pressable
|
|
336
|
+
onPress={handlePress}
|
|
337
|
+
hitSlop={CLOSE_BUTTON_HIT_SLOP}
|
|
338
|
+
accessibilityRole="button"
|
|
339
|
+
style={buttonStyle}
|
|
340
|
+
>
|
|
341
|
+
<TimesIcon size="md" fill={color} style={iconStyle} />
|
|
342
|
+
</Pressable>
|
|
343
|
+
);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
const CLOSE_BUTTON_HIT_SLOP = 10;
|
|
347
|
+
|
|
348
|
+
const styles = StyleSheet.create({
|
|
349
|
+
surface: {
|
|
350
|
+
justifyContent: 'center',
|
|
351
|
+
paddingHorizontal: space.lg,
|
|
352
|
+
paddingVertical: space.md,
|
|
353
|
+
marginHorizontal: space.lg,
|
|
354
|
+
borderRadius: borderRadius.md,
|
|
355
|
+
borderWidth: StyleSheet.hairlineWidth,
|
|
356
|
+
...bloomShadowStyle('s'),
|
|
357
|
+
},
|
|
358
|
+
hostedBackground: {
|
|
359
|
+
overflow: 'hidden',
|
|
360
|
+
backgroundColor: 'transparent',
|
|
361
|
+
},
|
|
362
|
+
aboveBackground: {
|
|
363
|
+
position: 'relative',
|
|
364
|
+
zIndex: 1,
|
|
365
|
+
},
|
|
366
|
+
row: {
|
|
367
|
+
flexDirection: 'row',
|
|
368
|
+
alignItems: 'center',
|
|
369
|
+
gap: space.md,
|
|
370
|
+
},
|
|
371
|
+
rowWithDescription: {
|
|
372
|
+
alignItems: 'flex-start',
|
|
373
|
+
},
|
|
374
|
+
textContainer: {
|
|
375
|
+
flex: 1,
|
|
376
|
+
},
|
|
377
|
+
title: {
|
|
378
|
+
fontSize: fontSize.md,
|
|
379
|
+
fontWeight: '600',
|
|
380
|
+
lineHeight: 20,
|
|
381
|
+
},
|
|
382
|
+
description: {
|
|
383
|
+
fontSize: fontSize.sm,
|
|
384
|
+
lineHeight: 20,
|
|
385
|
+
marginTop: space._2xs,
|
|
386
|
+
},
|
|
387
|
+
buttons: {
|
|
388
|
+
flexDirection: 'row',
|
|
389
|
+
alignItems: 'center',
|
|
390
|
+
gap: space.sm,
|
|
391
|
+
marginTop: space.md,
|
|
392
|
+
},
|
|
393
|
+
actionButton: {
|
|
394
|
+
flexGrow: 0,
|
|
395
|
+
alignSelf: 'flex-start',
|
|
396
|
+
paddingHorizontal: space.md,
|
|
397
|
+
paddingVertical: space.xs,
|
|
398
|
+
borderRadius: borderRadius.sm,
|
|
399
|
+
},
|
|
400
|
+
actionButtonText: {
|
|
401
|
+
fontSize: fontSize.sm,
|
|
402
|
+
fontWeight: '600',
|
|
403
|
+
lineHeight: 20,
|
|
404
|
+
},
|
|
405
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bloom-original — the NATIVE toast host. Metro selects this file; every other
|
|
3
|
+
* bundler resolves the sibling `ToastHost.tsx` (web/default).
|
|
4
|
+
*
|
|
5
|
+
* On native the rows render inline in the app's own view hierarchy, which is what
|
|
6
|
+
* makes them respect the safe area and the app-root `GestureHandlerRootView` that
|
|
7
|
+
* consumers already mount. So there is nothing to portal — the host only applies
|
|
8
|
+
* the optional overlay wrapper.
|
|
9
|
+
*
|
|
10
|
+
* `react-native-screens` is deliberately NOT imported (D6). Upstream statically
|
|
11
|
+
* imports `FullWindowOverlay` from it, an undeclared dependency that only works
|
|
12
|
+
* because apps happen to install it. A consumer who needs a toast above a native
|
|
13
|
+
* iOS modal injects it themselves:
|
|
14
|
+
*
|
|
15
|
+
* ```tsx
|
|
16
|
+
* import { FullWindowOverlay } from 'react-native-screens';
|
|
17
|
+
* <ToastOutlet ToasterOverlayWrapper={FullWindowOverlay} />
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
import * as React from 'react';
|
|
21
|
+
|
|
22
|
+
import type { ToastHostProps } from './types';
|
|
23
|
+
|
|
24
|
+
export function ToastHost({ children, ToasterOverlayWrapper }: ToastHostProps) {
|
|
25
|
+
if (ToasterOverlayWrapper) {
|
|
26
|
+
return <ToasterOverlayWrapper>{children}</ToasterOverlayWrapper>;
|
|
27
|
+
}
|
|
28
|
+
return <>{children}</>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
ToastHost.displayName = 'ToastHost';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bloom-original — the WEB / default toast host. Metro selects
|
|
3
|
+
* `ToastHost.native.tsx` on iOS and Android; every other bundler (and a
|
|
4
|
+
* consumer's `tsc`) sees this file, matching the `.native` split convention
|
|
5
|
+
* `design-tokens/shadows.ts` already uses.
|
|
6
|
+
*
|
|
7
|
+
* Two jobs, both of which are why the rest of the engine can stay universal:
|
|
8
|
+
*
|
|
9
|
+
* - W7: it portals into `#bloom-portal-root` and provides a `position: fixed`,
|
|
10
|
+
* full-viewport containing block. `Positioner`'s `position: 'absolute'` would
|
|
11
|
+
* otherwise anchor to the nearest positioned ancestor — react-native-web's
|
|
12
|
+
* `View` defaults to `relative`, so a deeply-mounted outlet would anchor to a
|
|
13
|
+
* provider somewhere in the tree instead of the viewport. A `Positioner.web`
|
|
14
|
+
* with `position: fixed` would NOT be enough: `fixed` is still contained by any
|
|
15
|
+
* ancestor `transform`/`filter`/`contain`, which is exactly why `Dialog` and
|
|
16
|
+
* `BottomSheet` portal too. Sharing the one portal root also keeps a single
|
|
17
|
+
* document-level overlay layer rather than a second competing one.
|
|
18
|
+
* - W8: portaled content sits outside the app-root `GestureHandlerRootView`, so
|
|
19
|
+
* swipe-to-dismiss would never receive touches. This provides its own, exactly
|
|
20
|
+
* as `bottom-sheet/index.web.tsx` does. Web consumers need no setup.
|
|
21
|
+
*
|
|
22
|
+
* `pointerEvents: 'box-none'` keeps the empty area click-through while the rows
|
|
23
|
+
* themselves stay interactive.
|
|
24
|
+
*/
|
|
25
|
+
import * as React from 'react';
|
|
26
|
+
import { StyleSheet } from 'react-native';
|
|
27
|
+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
28
|
+
|
|
29
|
+
import { Portal } from '../portal/index.web';
|
|
30
|
+
import { WEB_POSITION_FIXED } from '../styles/web-view-style';
|
|
31
|
+
import { Z_INDEX } from '../styles/z-index';
|
|
32
|
+
import type { ToastHostProps } from './types';
|
|
33
|
+
|
|
34
|
+
export function ToastHost({ children, ToasterOverlayWrapper }: ToastHostProps) {
|
|
35
|
+
const content = (
|
|
36
|
+
<GestureHandlerRootView style={styles.host}>
|
|
37
|
+
{children}
|
|
38
|
+
</GestureHandlerRootView>
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<Portal>
|
|
43
|
+
{ToasterOverlayWrapper ? (
|
|
44
|
+
<ToasterOverlayWrapper>{content}</ToasterOverlayWrapper>
|
|
45
|
+
) : (
|
|
46
|
+
content
|
|
47
|
+
)}
|
|
48
|
+
</Portal>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
ToastHost.displayName = 'ToastHost';
|
|
53
|
+
|
|
54
|
+
const styles = StyleSheet.create({
|
|
55
|
+
host: {
|
|
56
|
+
// Full-viewport containing block for `Positioner`'s `position: 'absolute'`.
|
|
57
|
+
position: WEB_POSITION_FIXED,
|
|
58
|
+
top: 0,
|
|
59
|
+
left: 0,
|
|
60
|
+
right: 0,
|
|
61
|
+
bottom: 0,
|
|
62
|
+
// Inside `#bloom-portal-root` (which owns the document layer at 999999),
|
|
63
|
+
// this keeps toasts above Dialog's surface (60) and tooltips (70).
|
|
64
|
+
zIndex: Z_INDEX.toast,
|
|
65
|
+
pointerEvents: 'box-none',
|
|
66
|
+
},
|
|
67
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Replaces sonner-native v0.26.4's `src/icons.tsx` (MIT © Gunnar Torfi
|
|
3
|
+
* Steinarsson — see the top-level NOTICE), which ships its own inline SVG paths
|
|
4
|
+
* and imports `react-native-svg` directly. Bloom maps variants onto its own icon
|
|
5
|
+
* set instead, so the toast picks up icon changes with the rest of the library.
|
|
6
|
+
*
|
|
7
|
+
* The spinner is RN's `ActivityIndicator` rather than Bloom's `Loading`: the
|
|
8
|
+
* `./loading` subpath is web-forked, so importing it from this universal file
|
|
9
|
+
* would resolve to the native (Reanimated) build under bundlers that do not
|
|
10
|
+
* apply `.web` extension resolution, and to the web build under those that do —
|
|
11
|
+
* platform-dependent behaviour from one import. `ActivityIndicator` is universal
|
|
12
|
+
* (react-native-web renders a CSS-animated SVG, so nothing depends on a
|
|
13
|
+
* Reanimated mapper ticking on web) and a consumer who wants Bloom's spinner can
|
|
14
|
+
* still pass `icons={{ loading: <Loading … /> }}` on the outlet.
|
|
15
|
+
*/
|
|
16
|
+
import { ActivityIndicator } from 'react-native';
|
|
17
|
+
|
|
18
|
+
import { CircleCheck_Stroke2_Corner0_Rounded as CircleCheckIcon } from '../icons/CircleCheck';
|
|
19
|
+
import { CircleInfo_Stroke2_Corner0_Rounded as CircleInfoIcon } from '../icons/CircleInfo';
|
|
20
|
+
import { CircleX_Stroke2_Corner0_Rounded as CircleXIcon } from '../icons/CircleX';
|
|
21
|
+
import { Warning_Stroke2_Corner0_Rounded as WarningIcon } from '../icons/Warning';
|
|
22
|
+
import type { ToastVariant } from './types';
|
|
23
|
+
|
|
24
|
+
const ICON_MAP: Record<
|
|
25
|
+
Exclude<ToastVariant, 'loading'>,
|
|
26
|
+
typeof CircleCheckIcon
|
|
27
|
+
> = {
|
|
28
|
+
success: CircleCheckIcon,
|
|
29
|
+
error: CircleXIcon,
|
|
30
|
+
warning: WarningIcon,
|
|
31
|
+
info: CircleInfoIcon,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export function ToastIcon({
|
|
35
|
+
variant,
|
|
36
|
+
color,
|
|
37
|
+
}: {
|
|
38
|
+
variant: ToastVariant | undefined;
|
|
39
|
+
color: string;
|
|
40
|
+
}) {
|
|
41
|
+
// No variant means a neutral toast, which carries no icon of its own — a
|
|
42
|
+
// caller who wants one passes `icon`.
|
|
43
|
+
if (!variant) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (variant === 'loading') {
|
|
48
|
+
return <ActivityIndicator size="small" color={color} />;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const Icon = ICON_MAP[variant];
|
|
52
|
+
return <Icon fill={color} size="md" />;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
ToastIcon.displayName = 'ToastIcon';
|