@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,295 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Derived from sonner-native v0.26.4 — src/toast.tsx:440-689
|
|
5
|
+
* (MIT © Gunnar Torfi Steinarsson — see the top-level NOTICE), restyled with
|
|
6
|
+
* Bloom's design tokens and absorbing the surface/text/action styling from
|
|
7
|
+
* Bloom's previous `Toast.tsx`.
|
|
8
|
+
*
|
|
9
|
+
* This is the DEFAULT renderer. A consumer who passes `jsx` (via `toast.custom`)
|
|
10
|
+
* owns the whole row and this file is not involved.
|
|
11
|
+
*
|
|
12
|
+
* W11 — the surface elevation comes from `bloomShadowStyle('s')`, which is a
|
|
13
|
+
* `boxShadow` on web and RN `shadow*`/`elevation` on native. Upstream hardcodes
|
|
14
|
+
* iOS-only `shadowOpacity`/`shadowRadius` values, so its toast has no shadow on
|
|
15
|
+
* web (no `boxShadow`) and none on iOS either (no `shadowColor`).
|
|
16
|
+
*/
|
|
17
|
+
import * as React from 'react';
|
|
18
|
+
import { Pressable, StyleSheet, Text, View } from 'react-native';
|
|
19
|
+
import { bloomShadowStyle } from '../design-tokens/shadows';
|
|
20
|
+
import { useInteractionState } from "../hooks/useInteractionState.js";
|
|
21
|
+
import { TimesLarge_Stroke2_Corner0_Rounded as TimesIcon } from "../icons/Times.js";
|
|
22
|
+
import { borderRadius, fontSize, space } from "../styles/tokens.js";
|
|
23
|
+
import { ToastIcon } from "./ToastIcon.js";
|
|
24
|
+
import { useToastColors } from "./use-toast-colors.js";
|
|
25
|
+
import { isToastAction } from "./types.js";
|
|
26
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
27
|
+
export function ToastContent({
|
|
28
|
+
id,
|
|
29
|
+
title,
|
|
30
|
+
description,
|
|
31
|
+
variant,
|
|
32
|
+
icon,
|
|
33
|
+
icons,
|
|
34
|
+
action,
|
|
35
|
+
cancel,
|
|
36
|
+
close,
|
|
37
|
+
closeButton,
|
|
38
|
+
dismissible,
|
|
39
|
+
richColors = false,
|
|
40
|
+
promiseOptions,
|
|
41
|
+
styles: styleOverrides,
|
|
42
|
+
style,
|
|
43
|
+
unstyled,
|
|
44
|
+
onDismiss,
|
|
45
|
+
actionButtonStyle,
|
|
46
|
+
actionButtonTextStyle,
|
|
47
|
+
cancelButtonStyle,
|
|
48
|
+
cancelButtonTextStyle,
|
|
49
|
+
allowFontScaling,
|
|
50
|
+
maxFontSizeMultiplier,
|
|
51
|
+
backgroundComponent
|
|
52
|
+
}) {
|
|
53
|
+
const colors = useToastColors({
|
|
54
|
+
variant,
|
|
55
|
+
richColors
|
|
56
|
+
});
|
|
57
|
+
const isLoading = Boolean(promiseOptions) || variant === 'loading';
|
|
58
|
+
const surfaceStyle = unstyled ? undefined : {
|
|
59
|
+
backgroundColor: colors.surface,
|
|
60
|
+
borderColor: colors.border
|
|
61
|
+
};
|
|
62
|
+
const textProps = {
|
|
63
|
+
allowFontScaling,
|
|
64
|
+
maxFontSizeMultiplier
|
|
65
|
+
};
|
|
66
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
67
|
+
style: [unstyled ? undefined : styles.surface, surfaceStyle,
|
|
68
|
+
// A custom background needs the surface transparent and clipped so it can
|
|
69
|
+
// paint edge to edge underneath the content.
|
|
70
|
+
backgroundComponent ? styles.hostedBackground : undefined, styleOverrides?.toast, style],
|
|
71
|
+
children: [backgroundComponent, /*#__PURE__*/_jsxs(View, {
|
|
72
|
+
style: [unstyled ? undefined : styles.row,
|
|
73
|
+
// With a description the row is tall, so the icon sits at the top
|
|
74
|
+
// instead of being centred against two lines of text.
|
|
75
|
+
unstyled || !description ? undefined : styles.rowWithDescription, backgroundComponent ? styles.aboveBackground : undefined, styleOverrides?.toastContent],
|
|
76
|
+
children: [/*#__PURE__*/_jsx(ToastLeadingIcon, {
|
|
77
|
+
variant: variant,
|
|
78
|
+
icon: icon,
|
|
79
|
+
icons: icons,
|
|
80
|
+
isLoading: isLoading,
|
|
81
|
+
color: colors.icon
|
|
82
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
83
|
+
style: [styles.textContainer, styleOverrides?.textContainer],
|
|
84
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
85
|
+
...textProps,
|
|
86
|
+
style: [unstyled ? undefined : styles.title, unstyled ? undefined : {
|
|
87
|
+
color: colors.title
|
|
88
|
+
}, styleOverrides?.title],
|
|
89
|
+
children: title
|
|
90
|
+
}), description ? /*#__PURE__*/_jsx(Text, {
|
|
91
|
+
...textProps,
|
|
92
|
+
style: [unstyled ? undefined : styles.description, unstyled ? undefined : {
|
|
93
|
+
color: colors.description
|
|
94
|
+
}, styleOverrides?.description],
|
|
95
|
+
children: description
|
|
96
|
+
}) : null, action || cancel ? /*#__PURE__*/_jsxs(View, {
|
|
97
|
+
style: [unstyled ? undefined : styles.buttons, styleOverrides?.buttons],
|
|
98
|
+
children: [isToastAction(action) ? /*#__PURE__*/_jsx(ToastActionButton, {
|
|
99
|
+
action: action,
|
|
100
|
+
colors: colors.action,
|
|
101
|
+
buttonStyle: actionButtonStyle,
|
|
102
|
+
textStyle: actionButtonTextStyle,
|
|
103
|
+
...textProps
|
|
104
|
+
}) : action, isToastAction(cancel) ? /*#__PURE__*/_jsx(ToastActionButton, {
|
|
105
|
+
action: {
|
|
106
|
+
label: cancel.label,
|
|
107
|
+
onClick: () => {
|
|
108
|
+
cancel.onClick();
|
|
109
|
+
onDismiss(id);
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
colors: colors.action,
|
|
113
|
+
transparent: true,
|
|
114
|
+
buttonStyle: cancelButtonStyle,
|
|
115
|
+
textStyle: [{
|
|
116
|
+
color: colors.cancelText
|
|
117
|
+
}, cancelButtonTextStyle],
|
|
118
|
+
...textProps
|
|
119
|
+
}) : cancel]
|
|
120
|
+
}) : null]
|
|
121
|
+
}), /*#__PURE__*/_jsx(ToastCloseButton, {
|
|
122
|
+
id: id,
|
|
123
|
+
close: close,
|
|
124
|
+
closeButton: closeButton,
|
|
125
|
+
dismissible: dismissible,
|
|
126
|
+
color: colors.closeButton,
|
|
127
|
+
onDismiss: onDismiss,
|
|
128
|
+
buttonStyle: styleOverrides?.closeButton,
|
|
129
|
+
iconStyle: styleOverrides?.closeButtonIcon
|
|
130
|
+
})]
|
|
131
|
+
})]
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
ToastContent.displayName = 'ToastContent';
|
|
135
|
+
function ToastLeadingIcon({
|
|
136
|
+
variant,
|
|
137
|
+
icon,
|
|
138
|
+
icons,
|
|
139
|
+
isLoading,
|
|
140
|
+
color
|
|
141
|
+
}) {
|
|
142
|
+
if (isLoading) {
|
|
143
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
144
|
+
children: icons.loading ?? /*#__PURE__*/_jsx(ToastIcon, {
|
|
145
|
+
variant: "loading",
|
|
146
|
+
color: color
|
|
147
|
+
})
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
if (icon) {
|
|
151
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
152
|
+
children: icon
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
if (variant && icons[variant]) {
|
|
156
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
157
|
+
children: icons[variant]
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
return /*#__PURE__*/_jsx(ToastIcon, {
|
|
161
|
+
variant: variant,
|
|
162
|
+
color: color
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
function ToastActionButton({
|
|
166
|
+
action,
|
|
167
|
+
colors,
|
|
168
|
+
transparent,
|
|
169
|
+
buttonStyle,
|
|
170
|
+
textStyle,
|
|
171
|
+
allowFontScaling,
|
|
172
|
+
maxFontSizeMultiplier
|
|
173
|
+
}) {
|
|
174
|
+
// Driven from state rather than Pressable's function-form `style`, which
|
|
175
|
+
// react-native-css swallows on web (dropping the base padding/radius).
|
|
176
|
+
const {
|
|
177
|
+
state: pressed,
|
|
178
|
+
onIn,
|
|
179
|
+
onOut
|
|
180
|
+
} = useInteractionState();
|
|
181
|
+
return /*#__PURE__*/_jsx(Pressable, {
|
|
182
|
+
onPress: action.onClick,
|
|
183
|
+
onPressIn: onIn,
|
|
184
|
+
onPressOut: onOut,
|
|
185
|
+
accessibilityRole: "button",
|
|
186
|
+
style: [styles.actionButton, transparent ? undefined : {
|
|
187
|
+
backgroundColor: pressed ? colors.pressedBackground : colors.background
|
|
188
|
+
}, buttonStyle],
|
|
189
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
190
|
+
numberOfLines: 1,
|
|
191
|
+
allowFontScaling: allowFontScaling,
|
|
192
|
+
maxFontSizeMultiplier: maxFontSizeMultiplier,
|
|
193
|
+
style: [styles.actionButtonText, {
|
|
194
|
+
color: pressed ? colors.pressedText : colors.text
|
|
195
|
+
}, textStyle],
|
|
196
|
+
children: action.label
|
|
197
|
+
})
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
function ToastCloseButton({
|
|
201
|
+
id,
|
|
202
|
+
close,
|
|
203
|
+
closeButton,
|
|
204
|
+
dismissible,
|
|
205
|
+
color,
|
|
206
|
+
onDismiss,
|
|
207
|
+
buttonStyle,
|
|
208
|
+
iconStyle
|
|
209
|
+
}) {
|
|
210
|
+
const handlePress = React.useCallback(() => {
|
|
211
|
+
onDismiss(id);
|
|
212
|
+
}, [onDismiss, id]);
|
|
213
|
+
if (!dismissible) {
|
|
214
|
+
return null;
|
|
215
|
+
}
|
|
216
|
+
if (close) {
|
|
217
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
218
|
+
children: close
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
if (!closeButton) {
|
|
222
|
+
return null;
|
|
223
|
+
}
|
|
224
|
+
return /*#__PURE__*/_jsx(Pressable, {
|
|
225
|
+
onPress: handlePress,
|
|
226
|
+
hitSlop: CLOSE_BUTTON_HIT_SLOP,
|
|
227
|
+
accessibilityRole: "button",
|
|
228
|
+
style: buttonStyle,
|
|
229
|
+
children: /*#__PURE__*/_jsx(TimesIcon, {
|
|
230
|
+
size: "md",
|
|
231
|
+
fill: color,
|
|
232
|
+
style: iconStyle
|
|
233
|
+
})
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
const CLOSE_BUTTON_HIT_SLOP = 10;
|
|
237
|
+
const styles = StyleSheet.create({
|
|
238
|
+
surface: {
|
|
239
|
+
justifyContent: 'center',
|
|
240
|
+
paddingHorizontal: space.lg,
|
|
241
|
+
paddingVertical: space.md,
|
|
242
|
+
marginHorizontal: space.lg,
|
|
243
|
+
borderRadius: borderRadius.md,
|
|
244
|
+
borderWidth: StyleSheet.hairlineWidth,
|
|
245
|
+
...bloomShadowStyle('s')
|
|
246
|
+
},
|
|
247
|
+
hostedBackground: {
|
|
248
|
+
overflow: 'hidden',
|
|
249
|
+
backgroundColor: 'transparent'
|
|
250
|
+
},
|
|
251
|
+
aboveBackground: {
|
|
252
|
+
position: 'relative',
|
|
253
|
+
zIndex: 1
|
|
254
|
+
},
|
|
255
|
+
row: {
|
|
256
|
+
flexDirection: 'row',
|
|
257
|
+
alignItems: 'center',
|
|
258
|
+
gap: space.md
|
|
259
|
+
},
|
|
260
|
+
rowWithDescription: {
|
|
261
|
+
alignItems: 'flex-start'
|
|
262
|
+
},
|
|
263
|
+
textContainer: {
|
|
264
|
+
flex: 1
|
|
265
|
+
},
|
|
266
|
+
title: {
|
|
267
|
+
fontSize: fontSize.md,
|
|
268
|
+
fontWeight: '600',
|
|
269
|
+
lineHeight: 20
|
|
270
|
+
},
|
|
271
|
+
description: {
|
|
272
|
+
fontSize: fontSize.sm,
|
|
273
|
+
lineHeight: 20,
|
|
274
|
+
marginTop: space._2xs
|
|
275
|
+
},
|
|
276
|
+
buttons: {
|
|
277
|
+
flexDirection: 'row',
|
|
278
|
+
alignItems: 'center',
|
|
279
|
+
gap: space.sm,
|
|
280
|
+
marginTop: space.md
|
|
281
|
+
},
|
|
282
|
+
actionButton: {
|
|
283
|
+
flexGrow: 0,
|
|
284
|
+
alignSelf: 'flex-start',
|
|
285
|
+
paddingHorizontal: space.md,
|
|
286
|
+
paddingVertical: space.xs,
|
|
287
|
+
borderRadius: borderRadius.sm
|
|
288
|
+
},
|
|
289
|
+
actionButtonText: {
|
|
290
|
+
fontSize: fontSize.sm,
|
|
291
|
+
fontWeight: '600',
|
|
292
|
+
lineHeight: 20
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
//# sourceMappingURL=ToastContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Pressable","StyleSheet","Text","View","bloomShadowStyle","useInteractionState","TimesLarge_Stroke2_Corner0_Rounded","TimesIcon","borderRadius","fontSize","space","ToastIcon","useToastColors","isToastAction","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","ToastContent","id","title","description","variant","icon","icons","action","cancel","close","closeButton","dismissible","richColors","promiseOptions","styles","styleOverrides","style","unstyled","onDismiss","actionButtonStyle","actionButtonTextStyle","cancelButtonStyle","cancelButtonTextStyle","allowFontScaling","maxFontSizeMultiplier","backgroundComponent","colors","isLoading","Boolean","surfaceStyle","undefined","backgroundColor","surface","borderColor","border","textProps","hostedBackground","toast","children","row","rowWithDescription","aboveBackground","toastContent","ToastLeadingIcon","color","textContainer","buttons","ToastActionButton","buttonStyle","textStyle","label","onClick","transparent","cancelText","ToastCloseButton","iconStyle","closeButtonIcon","displayName","loading","state","pressed","onIn","onOut","onPress","onPressIn","onPressOut","accessibilityRole","actionButton","pressedBackground","background","numberOfLines","actionButtonText","pressedText","text","handlePress","useCallback","hitSlop","CLOSE_BUTTON_HIT_SLOP","size","fill","create","justifyContent","paddingHorizontal","lg","paddingVertical","md","marginHorizontal","borderWidth","hairlineWidth","overflow","position","zIndex","flexDirection","alignItems","gap","flex","fontWeight","lineHeight","sm","marginTop","_2xs","flexGrow","alignSelf","xs"],"sourceRoot":"../../../src","sources":["toast/ToastContent.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SACEC,SAAS,EACTC,UAAU,EACVC,IAAI,EACJC,IAAI,QAGC,cAAc;AAErB,SAASC,gBAAgB,QAAQ,0BAA0B;AAC3D,SAASC,mBAAmB,QAAQ,iCAA8B;AAClE,SAASC,kCAAkC,IAAIC,SAAS,QAAQ,mBAAgB;AAChF,SAASC,YAAY,EAAEC,QAAQ,EAAEC,KAAK,QAAQ,qBAAkB;AAChE,SAASC,SAAS,QAAQ,gBAAa;AACvC,SAASC,cAAc,QAAgC,uBAAoB;AAC3E,SACEC,aAAa,QAIR,YAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAkCjB,OAAO,SAASC,YAAYA,CAAC;EAC3BC,EAAE;EACFC,KAAK;EACLC,WAAW;EACXC,OAAO;EACPC,IAAI;EACJC,KAAK;EACLC,MAAM;EACNC,MAAM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|
+
|
|
3
|
+
/**
|
|
4
|
+
* Bloom-original — the WEB / default toast host. Metro selects
|
|
5
|
+
* `ToastHost.native.tsx` on iOS and Android; every other bundler (and a
|
|
6
|
+
* consumer's `tsc`) sees this file, matching the `.native` split convention
|
|
7
|
+
* `design-tokens/shadows.ts` already uses.
|
|
8
|
+
*
|
|
9
|
+
* Two jobs, both of which are why the rest of the engine can stay universal:
|
|
10
|
+
*
|
|
11
|
+
* - W7: it portals into `#bloom-portal-root` and provides a `position: fixed`,
|
|
12
|
+
* full-viewport containing block. `Positioner`'s `position: 'absolute'` would
|
|
13
|
+
* otherwise anchor to the nearest positioned ancestor — react-native-web's
|
|
14
|
+
* `View` defaults to `relative`, so a deeply-mounted outlet would anchor to a
|
|
15
|
+
* provider somewhere in the tree instead of the viewport. A `Positioner.web`
|
|
16
|
+
* with `position: fixed` would NOT be enough: `fixed` is still contained by any
|
|
17
|
+
* ancestor `transform`/`filter`/`contain`, which is exactly why `Dialog` and
|
|
18
|
+
* `BottomSheet` portal too. Sharing the one portal root also keeps a single
|
|
19
|
+
* document-level overlay layer rather than a second competing one.
|
|
20
|
+
* - W8: portaled content sits outside the app-root `GestureHandlerRootView`, so
|
|
21
|
+
* swipe-to-dismiss would never receive touches. This provides its own, exactly
|
|
22
|
+
* as `bottom-sheet/index.web.tsx` does. Web consumers need no setup.
|
|
23
|
+
*
|
|
24
|
+
* `pointerEvents: 'box-none'` keeps the empty area click-through while the rows
|
|
25
|
+
* themselves stay interactive.
|
|
26
|
+
*/
|
|
27
|
+
import * as React from 'react';
|
|
28
|
+
import { StyleSheet } from 'react-native';
|
|
29
|
+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
30
|
+
import { Portal } from "../portal/index.web.js";
|
|
31
|
+
import { WEB_POSITION_FIXED } from "../styles/web-view-style.js";
|
|
32
|
+
import { Z_INDEX } from "../styles/z-index.js";
|
|
33
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
34
|
+
export function ToastHost({
|
|
35
|
+
children,
|
|
36
|
+
ToasterOverlayWrapper
|
|
37
|
+
}) {
|
|
38
|
+
const content = /*#__PURE__*/_jsx(GestureHandlerRootView, {
|
|
39
|
+
style: styles.host,
|
|
40
|
+
children: children
|
|
41
|
+
});
|
|
42
|
+
return /*#__PURE__*/_jsx(Portal, {
|
|
43
|
+
children: ToasterOverlayWrapper ? /*#__PURE__*/_jsx(ToasterOverlayWrapper, {
|
|
44
|
+
children: content
|
|
45
|
+
}) : content
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
ToastHost.displayName = 'ToastHost';
|
|
49
|
+
const styles = StyleSheet.create({
|
|
50
|
+
host: {
|
|
51
|
+
// Full-viewport containing block for `Positioner`'s `position: 'absolute'`.
|
|
52
|
+
position: WEB_POSITION_FIXED,
|
|
53
|
+
top: 0,
|
|
54
|
+
left: 0,
|
|
55
|
+
right: 0,
|
|
56
|
+
bottom: 0,
|
|
57
|
+
// Inside `#bloom-portal-root` (which owns the document layer at 999999),
|
|
58
|
+
// this keeps toasts above Dialog's surface (60) and tooltips (70).
|
|
59
|
+
zIndex: Z_INDEX.toast,
|
|
60
|
+
pointerEvents: 'box-none'
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
//# sourceMappingURL=ToastHost.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","GestureHandlerRootView","Portal","WEB_POSITION_FIXED","Z_INDEX","jsx","_jsx","ToastHost","children","ToasterOverlayWrapper","content","style","styles","host","displayName","create","position","top","left","right","bottom","zIndex","toast","pointerEvents"],"sourceRoot":"../../../src","sources":["toast/ToastHost.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,sBAAsB,QAAQ,8BAA8B;AAErE,SAASC,MAAM,QAAQ,wBAAqB;AAC5C,SAASC,kBAAkB,QAAQ,6BAA0B;AAC7D,SAASC,OAAO,QAAQ,sBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAG5C,OAAO,SAASC,SAASA,CAAC;EAAEC,QAAQ;EAAEC;AAAsC,CAAC,EAAE;EAC7E,MAAMC,OAAO,gBACXJ,IAAA,CAACL,sBAAsB;IAACU,KAAK,EAAEC,MAAM,CAACC,IAAK;IAAAL,QAAA,EACxCA;EAAQ,CACa,CACzB;EAED,oBACEF,IAAA,CAACJ,MAAM;IAAAM,QAAA,EACJC,qBAAqB,gBACpBH,IAAA,CAACG,qBAAqB;MAAAD,QAAA,EAAEE;IAAO,CAAwB,CAAC,GAExDA;EACD,CACK,CAAC;AAEb;AAEAH,SAAS,CAACO,WAAW,GAAG,WAAW;AAEnC,MAAMF,MAAM,GAAGZ,UAAU,CAACe,MAAM,CAAC;EAC/BF,IAAI,EAAE;IACJ;IACAG,QAAQ,EAAEb,kBAAkB;IAC5Bc,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE,CAAC;IACT;IACA;IACAC,MAAM,EAAEjB,OAAO,CAACkB,KAAK;IACrBC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Bloom-original — the NATIVE toast host. Metro selects this file; every other
|
|
5
|
+
* bundler resolves the sibling `ToastHost.tsx` (web/default).
|
|
6
|
+
*
|
|
7
|
+
* On native the rows render inline in the app's own view hierarchy, which is what
|
|
8
|
+
* makes them respect the safe area and the app-root `GestureHandlerRootView` that
|
|
9
|
+
* consumers already mount. So there is nothing to portal — the host only applies
|
|
10
|
+
* the optional overlay wrapper.
|
|
11
|
+
*
|
|
12
|
+
* `react-native-screens` is deliberately NOT imported (D6). Upstream statically
|
|
13
|
+
* imports `FullWindowOverlay` from it, an undeclared dependency that only works
|
|
14
|
+
* because apps happen to install it. A consumer who needs a toast above a native
|
|
15
|
+
* iOS modal injects it themselves:
|
|
16
|
+
*
|
|
17
|
+
* ```tsx
|
|
18
|
+
* import { FullWindowOverlay } from 'react-native-screens';
|
|
19
|
+
* <ToastOutlet ToasterOverlayWrapper={FullWindowOverlay} />
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
import * as React from 'react';
|
|
23
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
24
|
+
export function ToastHost({
|
|
25
|
+
children,
|
|
26
|
+
ToasterOverlayWrapper
|
|
27
|
+
}) {
|
|
28
|
+
if (ToasterOverlayWrapper) {
|
|
29
|
+
return /*#__PURE__*/_jsx(ToasterOverlayWrapper, {
|
|
30
|
+
children: children
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
34
|
+
children: children
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
ToastHost.displayName = 'ToastHost';
|
|
38
|
+
//# sourceMappingURL=ToastHost.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","jsx","_jsx","Fragment","_Fragment","ToastHost","children","ToasterOverlayWrapper","displayName"],"sourceRoot":"../../../src","sources":["toast/ToastHost.native.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA;AAI/B,OAAO,SAASC,SAASA,CAAC;EAAEC,QAAQ;EAAEC;AAAsC,CAAC,EAAE;EAC7E,IAAIA,qBAAqB,EAAE;IACzB,oBAAOL,IAAA,CAACK,qBAAqB;MAAAD,QAAA,EAAEA;IAAQ,CAAwB,CAAC;EAClE;EACA,oBAAOJ,IAAA,CAAAE,SAAA;IAAAE,QAAA,EAAGA;EAAQ,CAAG,CAAC;AACxB;AAEAD,SAAS,CAACG,WAAW,GAAG,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Replaces sonner-native v0.26.4's `src/icons.tsx` (MIT © Gunnar Torfi
|
|
5
|
+
* Steinarsson — see the top-level NOTICE), which ships its own inline SVG paths
|
|
6
|
+
* and imports `react-native-svg` directly. Bloom maps variants onto its own icon
|
|
7
|
+
* set instead, so the toast picks up icon changes with the rest of the library.
|
|
8
|
+
*
|
|
9
|
+
* The spinner is RN's `ActivityIndicator` rather than Bloom's `Loading`: the
|
|
10
|
+
* `./loading` subpath is web-forked, so importing it from this universal file
|
|
11
|
+
* would resolve to the native (Reanimated) build under bundlers that do not
|
|
12
|
+
* apply `.web` extension resolution, and to the web build under those that do —
|
|
13
|
+
* platform-dependent behaviour from one import. `ActivityIndicator` is universal
|
|
14
|
+
* (react-native-web renders a CSS-animated SVG, so nothing depends on a
|
|
15
|
+
* Reanimated mapper ticking on web) and a consumer who wants Bloom's spinner can
|
|
16
|
+
* still pass `icons={{ loading: <Loading … /> }}` on the outlet.
|
|
17
|
+
*/
|
|
18
|
+
import { ActivityIndicator } from 'react-native';
|
|
19
|
+
import { CircleCheck_Stroke2_Corner0_Rounded as CircleCheckIcon } from "../icons/CircleCheck.js";
|
|
20
|
+
import { CircleInfo_Stroke2_Corner0_Rounded as CircleInfoIcon } from "../icons/CircleInfo.js";
|
|
21
|
+
import { CircleX_Stroke2_Corner0_Rounded as CircleXIcon } from "../icons/CircleX.js";
|
|
22
|
+
import { Warning_Stroke2_Corner0_Rounded as WarningIcon } from "../icons/Warning.js";
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
const ICON_MAP = {
|
|
25
|
+
success: CircleCheckIcon,
|
|
26
|
+
error: CircleXIcon,
|
|
27
|
+
warning: WarningIcon,
|
|
28
|
+
info: CircleInfoIcon
|
|
29
|
+
};
|
|
30
|
+
export function ToastIcon({
|
|
31
|
+
variant,
|
|
32
|
+
color
|
|
33
|
+
}) {
|
|
34
|
+
// No variant means a neutral toast, which carries no icon of its own — a
|
|
35
|
+
// caller who wants one passes `icon`.
|
|
36
|
+
if (!variant) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
if (variant === 'loading') {
|
|
40
|
+
return /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
41
|
+
size: "small",
|
|
42
|
+
color: color
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
const Icon = ICON_MAP[variant];
|
|
46
|
+
return /*#__PURE__*/_jsx(Icon, {
|
|
47
|
+
fill: color,
|
|
48
|
+
size: "md"
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
ToastIcon.displayName = 'ToastIcon';
|
|
52
|
+
//# sourceMappingURL=ToastIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ActivityIndicator","CircleCheck_Stroke2_Corner0_Rounded","CircleCheckIcon","CircleInfo_Stroke2_Corner0_Rounded","CircleInfoIcon","CircleX_Stroke2_Corner0_Rounded","CircleXIcon","Warning_Stroke2_Corner0_Rounded","WarningIcon","jsx","_jsx","ICON_MAP","success","error","warning","info","ToastIcon","variant","color","size","Icon","fill","displayName"],"sourceRoot":"../../../src","sources":["toast/ToastIcon.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,iBAAiB,QAAQ,cAAc;AAEhD,SAASC,mCAAmC,IAAIC,eAAe,QAAQ,yBAAsB;AAC7F,SAASC,kCAAkC,IAAIC,cAAc,QAAQ,wBAAqB;AAC1F,SAASC,+BAA+B,IAAIC,WAAW,QAAQ,qBAAkB;AACjF,SAASC,+BAA+B,IAAIC,WAAW,QAAQ,qBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGlF,MAAMC,QAGL,GAAG;EACFC,OAAO,EAAEV,eAAe;EACxBW,KAAK,EAAEP,WAAW;EAClBQ,OAAO,EAAEN,WAAW;EACpBO,IAAI,EAAEX;AACR,CAAC;AAED,OAAO,SAASY,SAASA,CAAC;EACxBC,OAAO;EACPC;AAIF,CAAC,EAAE;EACD;EACA;EACA,IAAI,CAACD,OAAO,EAAE;IACZ,OAAO,IAAI;EACb;EAEA,IAAIA,OAAO,KAAK,SAAS,EAAE;IACzB,oBAAOP,IAAA,CAACV,iBAAiB;MAACmB,IAAI,EAAC,OAAO;MAACD,KAAK,EAAEA;IAAM,CAAE,CAAC;EACzD;EAEA,MAAME,IAAI,GAAGT,QAAQ,CAACM,OAAO,CAAC;EAC9B,oBAAOP,IAAA,CAACU,IAAI;IAACC,IAAI,EAAEH,KAAM;IAACC,IAAI,EAAC;EAAI,CAAE,CAAC;AACxC;AAEAH,SAAS,CAACM,WAAW,GAAG,WAAW","ignoreList":[]}
|