@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
package/src/toast/types.ts
CHANGED
|
@@ -1,10 +1,306 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Derived from sonner-native v0.26.4 — src/types.ts
|
|
3
|
+
* (MIT © Gunnar Torfi Steinarsson), absorbed into Bloom's own toast API.
|
|
4
|
+
* See the top-level NOTICE for full attribution.
|
|
5
|
+
*/
|
|
6
|
+
import type React from 'react';
|
|
7
|
+
import type { TextStyle, ViewProps, ViewStyle } from 'react-native';
|
|
8
|
+
import type {
|
|
9
|
+
BaseAnimationBuilder,
|
|
10
|
+
EntryExitAnimationFunction,
|
|
11
|
+
ReanimatedKeyframe,
|
|
12
|
+
} from 'react-native-reanimated';
|
|
2
13
|
|
|
3
|
-
export
|
|
14
|
+
export type ToastPosition = 'top-center' | 'bottom-center' | 'center';
|
|
15
|
+
|
|
16
|
+
export type ToastSwipeDirection = 'left' | 'up';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Engine-internal variant. The PUBLIC knob is `ToastOptions['type']`; the single
|
|
20
|
+
* translation between the two lives in `toast-fns.ts`. `undefined` means "no
|
|
21
|
+
* variant" — a plain `toast('Saved')` renders with neutral surface colors.
|
|
22
|
+
*/
|
|
23
|
+
export type ToastVariant = 'success' | 'error' | 'warning' | 'info' | 'loading';
|
|
24
|
+
|
|
25
|
+
/** Public variant knob. `'default'` maps to an ABSENT `ToastVariant`. */
|
|
26
|
+
export type ToastType =
|
|
27
|
+
| 'default'
|
|
28
|
+
| 'success'
|
|
29
|
+
| 'error'
|
|
30
|
+
| 'warning'
|
|
31
|
+
| 'info'
|
|
32
|
+
| 'loading';
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Light/dark is owned by `BloomThemeProvider`/`BloomColorScope`, so this is
|
|
36
|
+
* accepted and documented as a no-op rather than dropped from the surface.
|
|
37
|
+
*/
|
|
38
|
+
export type ToastTheme = 'light' | 'dark' | 'system';
|
|
39
|
+
|
|
40
|
+
export type AutoWiggle = 'never' | 'toast-change' | 'always';
|
|
41
|
+
|
|
42
|
+
export type ToastAction = {
|
|
43
|
+
label: string;
|
|
44
|
+
onClick: () => void;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export type ToastStyles = {
|
|
48
|
+
toastContainer?: ViewStyle;
|
|
49
|
+
toast?: ViewStyle;
|
|
50
|
+
toastContent?: ViewStyle;
|
|
51
|
+
textContainer?: ViewStyle;
|
|
52
|
+
title?: TextStyle;
|
|
53
|
+
description?: TextStyle;
|
|
54
|
+
buttons?: ViewStyle;
|
|
55
|
+
closeButton?: ViewStyle;
|
|
56
|
+
closeButtonIcon?: ViewStyle;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export type ToastEntryExitAnimation =
|
|
60
|
+
| EntryExitAnimationFunction
|
|
61
|
+
| BaseAnimationBuilder
|
|
62
|
+
| typeof BaseAnimationBuilder
|
|
63
|
+
| ReanimatedKeyframe
|
|
64
|
+
| 'default';
|
|
65
|
+
|
|
66
|
+
export type ToastAnimation = {
|
|
67
|
+
enter?: ToastEntryExitAnimation;
|
|
68
|
+
exit?: ToastEntryExitAnimation;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export type PromiseStyles = {
|
|
72
|
+
loading?: ToastStyles;
|
|
73
|
+
success?: ToastStyles;
|
|
74
|
+
error?: ToastStyles;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* The store's view of a pending promise toast. Non-generic on purpose: `promise`
|
|
79
|
+
* already resolves to the SUCCESS TITLE because `toast.promise` maps the caller's
|
|
80
|
+
* promise through their `success` formatter at the boundary. That is what lets
|
|
81
|
+
* the store await it without casting an `unknown` result back to the caller's
|
|
82
|
+
* type (upstream keeps `success` here and casts).
|
|
83
|
+
*/
|
|
84
|
+
export type PromiseOptions = {
|
|
85
|
+
promise: Promise<string>;
|
|
86
|
+
loading: string;
|
|
87
|
+
error: ((error: unknown) => string) | string;
|
|
88
|
+
styles?: PromiseStyles;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
type StyleProps = {
|
|
92
|
+
unstyled?: boolean;
|
|
93
|
+
style?: ViewStyle;
|
|
94
|
+
styles?: ToastStyles;
|
|
95
|
+
backgroundComponent?: React.ReactNode;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export type ToastProps = StyleProps & {
|
|
99
|
+
id: string | number;
|
|
100
|
+
index: number;
|
|
101
|
+
title: string;
|
|
102
|
+
/** Optional so a variant-less toast stays variant-less. See `ToastVariant`. */
|
|
103
|
+
variant?: ToastVariant;
|
|
104
|
+
numberOfToasts: number;
|
|
105
|
+
orderedToastIds: Array<string | number>;
|
|
106
|
+
jsx?: React.ReactNode;
|
|
107
|
+
description?: string;
|
|
108
|
+
invert?: boolean;
|
|
109
|
+
important?: boolean;
|
|
4
110
|
duration?: number;
|
|
111
|
+
position?: ToastPosition;
|
|
112
|
+
animation?: ToastAnimation;
|
|
5
113
|
dismissible?: boolean;
|
|
6
|
-
|
|
7
|
-
|
|
114
|
+
icon?: React.ReactNode;
|
|
115
|
+
action?: ToastAction | React.ReactNode;
|
|
116
|
+
cancel?: ToastAction | React.ReactNode;
|
|
117
|
+
close?: React.ReactNode;
|
|
118
|
+
closeButton?: boolean;
|
|
119
|
+
richColors?: boolean;
|
|
120
|
+
onDismiss?: (id: string | number) => void;
|
|
121
|
+
onAutoClose?: (id: string | number) => void;
|
|
122
|
+
promiseOptions?: PromiseOptions;
|
|
123
|
+
actionButtonStyle?: ViewStyle;
|
|
124
|
+
actionButtonTextStyle?: TextStyle;
|
|
125
|
+
cancelButtonStyle?: ViewStyle;
|
|
126
|
+
cancelButtonTextStyle?: TextStyle;
|
|
8
127
|
onPress?: () => void;
|
|
9
|
-
|
|
128
|
+
allowFontScaling?: boolean;
|
|
129
|
+
maxFontSizeMultiplier?: number;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export type ToastRef = {
|
|
133
|
+
wiggle: () => void;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
/** Everything a caller may pass alongside the toast content. */
|
|
137
|
+
export type ToastOptions = Omit<
|
|
138
|
+
ToastProps,
|
|
139
|
+
| 'id'
|
|
140
|
+
| 'index'
|
|
141
|
+
| 'title'
|
|
142
|
+
| 'jsx'
|
|
143
|
+
| 'variant'
|
|
144
|
+
| 'numberOfToasts'
|
|
145
|
+
| 'orderedToastIds'
|
|
146
|
+
| 'promiseOptions'
|
|
147
|
+
> & {
|
|
148
|
+
id?: string | number;
|
|
149
|
+
type?: ToastType;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
export type PromiseToastOptions<T> = Omit<ToastOptions, 'type'> & {
|
|
153
|
+
loading: string;
|
|
154
|
+
success: (result: T) => string;
|
|
155
|
+
error: ((error: unknown) => string) | string;
|
|
156
|
+
styles?: PromiseStyles;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
export interface ToastFn {
|
|
160
|
+
(content: React.ReactNode, options?: ToastOptions): string | number;
|
|
161
|
+
success: (content: React.ReactNode, options?: Omit<ToastOptions, 'type'>) => string | number;
|
|
162
|
+
error: (content: React.ReactNode, options?: Omit<ToastOptions, 'type'>) => string | number;
|
|
163
|
+
warning: (content: React.ReactNode, options?: Omit<ToastOptions, 'type'>) => string | number;
|
|
164
|
+
info: (content: React.ReactNode, options?: Omit<ToastOptions, 'type'>) => string | number;
|
|
165
|
+
loading: (content: React.ReactNode, options?: Omit<ToastOptions, 'type'>) => string | number;
|
|
166
|
+
custom: (jsx: React.ReactElement, options?: Omit<ToastOptions, 'type'>) => string | number;
|
|
167
|
+
promise: <T>(promise: Promise<T>, options: PromiseToastOptions<T>) => string | number;
|
|
168
|
+
dismiss: (id?: string | number) => string | number | undefined;
|
|
169
|
+
wiggle: (id: string | number) => void;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export type ToasterProps = Omit<StyleProps, 'style'> & {
|
|
173
|
+
duration?: number;
|
|
174
|
+
/** No-op — light/dark comes from `BloomThemeProvider`. */
|
|
175
|
+
theme?: ToastTheme;
|
|
176
|
+
visibleToasts?: number;
|
|
177
|
+
position?: ToastPosition;
|
|
178
|
+
closeButton?: boolean;
|
|
179
|
+
offset?: number;
|
|
180
|
+
autoWiggleOnUpdate?: AutoWiggle;
|
|
181
|
+
style?: ViewStyle;
|
|
182
|
+
positionerStyle?: ViewStyle;
|
|
183
|
+
/** No-op — use `BloomColorScope` to recolour a subtree. */
|
|
184
|
+
invert?: boolean;
|
|
185
|
+
allowFontScaling?: boolean;
|
|
186
|
+
maxFontSizeMultiplier?: number;
|
|
187
|
+
toastOptions?: {
|
|
188
|
+
actionButtonStyle?: ViewStyle;
|
|
189
|
+
actionButtonTextStyle?: TextStyle;
|
|
190
|
+
cancelButtonStyle?: ViewStyle;
|
|
191
|
+
cancelButtonTextStyle?: TextStyle;
|
|
192
|
+
titleStyle?: TextStyle;
|
|
193
|
+
descriptionStyle?: TextStyle;
|
|
194
|
+
style?: ViewStyle;
|
|
195
|
+
unstyled?: boolean;
|
|
196
|
+
toastContainerStyle?: ViewStyle;
|
|
197
|
+
toastContentStyle?: ViewStyle;
|
|
198
|
+
buttonsStyle?: ViewStyle;
|
|
199
|
+
closeButtonStyle?: ViewStyle;
|
|
200
|
+
closeButtonIconStyle?: ViewStyle;
|
|
201
|
+
textContainerStyle?: ViewStyle;
|
|
202
|
+
backgroundComponent?: React.ReactNode;
|
|
203
|
+
success?: ViewStyle;
|
|
204
|
+
error?: ViewStyle;
|
|
205
|
+
warning?: ViewStyle;
|
|
206
|
+
info?: ViewStyle;
|
|
207
|
+
loading?: ViewStyle;
|
|
208
|
+
};
|
|
209
|
+
gap?: number;
|
|
210
|
+
loadingIcon?: React.ReactNode;
|
|
211
|
+
richColors?: boolean;
|
|
212
|
+
icons?: {
|
|
213
|
+
success?: React.ReactNode;
|
|
214
|
+
error?: React.ReactNode;
|
|
215
|
+
warning?: React.ReactNode;
|
|
216
|
+
info?: React.ReactNode;
|
|
217
|
+
loading?: React.ReactNode;
|
|
218
|
+
};
|
|
219
|
+
swipeToDismissDirection?: ToastSwipeDirection;
|
|
220
|
+
pauseWhenPageIsHidden?: boolean;
|
|
221
|
+
enableStacking?: boolean;
|
|
222
|
+
animation?: ToastAnimation;
|
|
223
|
+
ToasterOverlayWrapper?: React.ComponentType<{ children: React.ReactNode }>;
|
|
224
|
+
ToastWrapper?: React.ComponentType<
|
|
225
|
+
ViewProps & {
|
|
226
|
+
children: React.ReactNode;
|
|
227
|
+
toastId: string | number;
|
|
228
|
+
}
|
|
229
|
+
>;
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
export type ToastHostProps = {
|
|
233
|
+
children: React.ReactNode;
|
|
234
|
+
ToasterOverlayWrapper?: React.ComponentType<{ children: React.ReactNode }>;
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
/** The subset of `ToasterProps` the store needs to resolve a new toast. */
|
|
238
|
+
export type ToastStoreConfig = {
|
|
239
|
+
autoWiggleOnUpdate?: AutoWiggle;
|
|
240
|
+
visibleToasts?: number;
|
|
241
|
+
duration?: number;
|
|
242
|
+
pauseWhenPageIsHidden?: boolean;
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
export type ToastStoreState = {
|
|
246
|
+
toasts: ToastProps[];
|
|
247
|
+
toastsById: Map<string | number, ToastProps>;
|
|
248
|
+
toastsCounter: number;
|
|
249
|
+
toastRefs: Record<string | number, React.RefObject<ToastRef | null>>;
|
|
250
|
+
shouldShowOverlay: boolean;
|
|
251
|
+
/**
|
|
252
|
+
* INVARIANT: replaced, never mutated in place. Row offsets are recomputed in
|
|
253
|
+
* React from this object, so an in-place write would not re-render. Pinned by
|
|
254
|
+
* `toast-store.test.ts`.
|
|
255
|
+
*/
|
|
256
|
+
toastHeights: Record<string | number, number>;
|
|
257
|
+
isExpanded: boolean;
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
export type StableToastContextType = Required<
|
|
261
|
+
Pick<
|
|
262
|
+
ToasterProps,
|
|
263
|
+
| 'duration'
|
|
264
|
+
| 'swipeToDismissDirection'
|
|
265
|
+
| 'closeButton'
|
|
266
|
+
| 'position'
|
|
267
|
+
| 'invert'
|
|
268
|
+
| 'icons'
|
|
269
|
+
| 'offset'
|
|
270
|
+
| 'pauseWhenPageIsHidden'
|
|
271
|
+
| 'gap'
|
|
272
|
+
| 'theme'
|
|
273
|
+
| 'toastOptions'
|
|
274
|
+
| 'autoWiggleOnUpdate'
|
|
275
|
+
| 'richColors'
|
|
276
|
+
| 'unstyled'
|
|
277
|
+
| 'enableStacking'
|
|
278
|
+
| 'visibleToasts'
|
|
279
|
+
| 'allowFontScaling'
|
|
280
|
+
>
|
|
281
|
+
> & {
|
|
282
|
+
animation: ToastAnimation;
|
|
283
|
+
maxFontSizeMultiplier?: number;
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
export type DynamicToastContextType = {
|
|
287
|
+
toastHeights: Record<string | number, number>;
|
|
288
|
+
isExpanded: boolean;
|
|
289
|
+
expand: () => void;
|
|
290
|
+
collapse: () => void;
|
|
291
|
+
toggleExpand: () => void;
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
export function isToastAction(
|
|
295
|
+
action: ToastAction | React.ReactNode,
|
|
296
|
+
): action is ToastAction {
|
|
297
|
+
if (typeof action !== 'object' || action === null) {
|
|
298
|
+
return false;
|
|
299
|
+
}
|
|
300
|
+
return (
|
|
301
|
+
'label' in action &&
|
|
302
|
+
'onClick' in action &&
|
|
303
|
+
typeof action.label === 'string' &&
|
|
304
|
+
typeof action.onClick === 'function'
|
|
305
|
+
);
|
|
10
306
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bloom-original — drives a shared value toward a plain-JS target.
|
|
3
|
+
*
|
|
4
|
+
* WHY THIS IS IMPERATIVE, AND MUST STAY THAT WAY.
|
|
5
|
+
*
|
|
6
|
+
* The obvious shape is `useDerivedValue(() => withTiming(target))`, which is what
|
|
7
|
+
* sonner-native does for both the stack offset and the stack scale. Returning an
|
|
8
|
+
* animation from a mapper does not tick on WEB (`~/Oxy/AGENTS.md`, reanimated web
|
|
9
|
+
* failure mode A): the value jumps to or freezes at a static frame, so the stack
|
|
10
|
+
* lands on the right numbers without ever animating. The pattern that works on
|
|
11
|
+
* every platform is to assign the animation from JS — `sv.value = withTiming(…)`
|
|
12
|
+
* — and to let `useAnimatedStyle` only READ shared values.
|
|
13
|
+
*
|
|
14
|
+
* A `useAnimatedReaction` keyed on the target would also fire (without the
|
|
15
|
+
* worklets plugin its inputs come from its own deps array, so keying it on a JS
|
|
16
|
+
* value works where keying it on a shared value would not), but a layout effect
|
|
17
|
+
* needs no reanimated machinery at all to be correct, so it is the smaller bet.
|
|
18
|
+
* It runs before paint, so a target change never shows a stale frame first.
|
|
19
|
+
* Precedent for the imperative drive: `bottom-sheet/BottomSheetBase.tsx`.
|
|
20
|
+
*
|
|
21
|
+
* By default the first render is seeded rather than animated: a row must appear
|
|
22
|
+
* AT its position, not fly in from zero. Pass `from` when the FIRST render is
|
|
23
|
+
* itself the animation — the value is then seeded at `from` and animated to
|
|
24
|
+
* `target` on mount. That is how the enter animation is driven; see the
|
|
25
|
+
* "Bloom owns the enter animation" note in `animations.ts`.
|
|
26
|
+
*/
|
|
27
|
+
import { useLayoutEffect, useRef } from 'react';
|
|
28
|
+
import {
|
|
29
|
+
useSharedValue,
|
|
30
|
+
withTiming,
|
|
31
|
+
type EasingFunctionFactory,
|
|
32
|
+
type SharedValue,
|
|
33
|
+
} from 'react-native-reanimated';
|
|
34
|
+
|
|
35
|
+
export function useAnimatedTarget(
|
|
36
|
+
target: number,
|
|
37
|
+
{
|
|
38
|
+
duration,
|
|
39
|
+
easing,
|
|
40
|
+
from,
|
|
41
|
+
}: {
|
|
42
|
+
duration: number;
|
|
43
|
+
easing: EasingFunctionFactory | ((value: number) => number);
|
|
44
|
+
from?: number;
|
|
45
|
+
},
|
|
46
|
+
): SharedValue<number> {
|
|
47
|
+
const value = useSharedValue(from ?? target);
|
|
48
|
+
const isSeeded = useRef(false);
|
|
49
|
+
|
|
50
|
+
useLayoutEffect(() => {
|
|
51
|
+
if (!isSeeded.current) {
|
|
52
|
+
isSeeded.current = true;
|
|
53
|
+
if (from === undefined) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
value.value = withTiming(target, { duration, easing });
|
|
58
|
+
}, [target, value, duration, easing, from]);
|
|
59
|
+
|
|
60
|
+
return value;
|
|
61
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Derived from sonner-native v0.26.4 — src/use-app-state.ts
|
|
3
|
+
* (MIT © Gunnar Torfi Steinarsson). See the top-level NOTICE.
|
|
4
|
+
*
|
|
5
|
+
* Owns the whole "did the app go away" concern in one place so callers never
|
|
6
|
+
* have to guard the platform themselves (W4). Two upstream problems are fixed
|
|
7
|
+
* here rather than at the call sites:
|
|
8
|
+
*
|
|
9
|
+
* 1. `AppState.addEventListener` is unavailable when react-native-web runs
|
|
10
|
+
* without a document (SSR / prerender / a non-DOM test environment), where
|
|
11
|
+
* RN reports `AppState.isAvailable === false`. Upstream subscribes
|
|
12
|
+
* unconditionally and then calls `subscription.remove()` on unmount, which
|
|
13
|
+
* throws a `TypeError` there. The absence of a subscription is a documented
|
|
14
|
+
* environment fact, not an error to catch and swallow — so this checks the
|
|
15
|
+
* flag the platform provides and returns a no-op unsubscribe.
|
|
16
|
+
* 2. Upstream treats every non-`active` transition as "backgrounded", so
|
|
17
|
+
* `background` → `inactive` fires `onBackground` a second time and re-pauses
|
|
18
|
+
* an already-paused timer. This compares active-ness on both sides of the
|
|
19
|
+
* transition and reports only real edges.
|
|
20
|
+
*/
|
|
21
|
+
import { useEffect, useRef } from 'react';
|
|
22
|
+
import { AppState, type AppStateStatus } from 'react-native';
|
|
23
|
+
|
|
24
|
+
const NOOP = () => {};
|
|
25
|
+
|
|
26
|
+
const isActive = (status: AppStateStatus) => status === 'active';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Subscribe to app-state changes.
|
|
30
|
+
*
|
|
31
|
+
* @returns an unsubscribe function — a no-op when the platform provides no
|
|
32
|
+
* `AppState` subscription.
|
|
33
|
+
*/
|
|
34
|
+
export function subscribeToAppState(
|
|
35
|
+
onChange: (status: AppStateStatus) => void,
|
|
36
|
+
): () => void {
|
|
37
|
+
if (!AppState.isAvailable) {
|
|
38
|
+
return NOOP;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const subscription = AppState.addEventListener('change', onChange);
|
|
42
|
+
return () => {
|
|
43
|
+
subscription.remove();
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Call `onBackground` when the app leaves the foreground and `onForeground` when
|
|
49
|
+
* it comes back — once per edge, never on a transition between two inactive
|
|
50
|
+
* states.
|
|
51
|
+
*/
|
|
52
|
+
export function useAppStateChange({
|
|
53
|
+
onBackground,
|
|
54
|
+
onForeground,
|
|
55
|
+
}: {
|
|
56
|
+
onBackground: () => void;
|
|
57
|
+
onForeground: () => void;
|
|
58
|
+
}) {
|
|
59
|
+
const previousStatus = useRef<AppStateStatus>(AppState.currentState);
|
|
60
|
+
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
return subscribeToAppState((nextStatus) => {
|
|
63
|
+
const wasActive = isActive(previousStatus.current);
|
|
64
|
+
previousStatus.current = nextStatus;
|
|
65
|
+
|
|
66
|
+
if (isActive(nextStatus)) {
|
|
67
|
+
if (!wasActive) {
|
|
68
|
+
onForeground();
|
|
69
|
+
}
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (wasActive) {
|
|
73
|
+
onBackground();
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}, [onBackground, onForeground]);
|
|
77
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Replaces sonner-native v0.26.4's `src/use-colors.ts` + `src/use-default-styles.ts`
|
|
3
|
+
* (MIT © Gunnar Torfi Steinarsson — see the top-level NOTICE) and absorbs the
|
|
4
|
+
* colour logic from Bloom's previous `Toast.tsx`.
|
|
5
|
+
*
|
|
6
|
+
* Upstream ships two hardcoded light/dark palettes and picks between them from
|
|
7
|
+
* `useColorScheme()`. Bloom has exactly one source of colour — `useTheme()` from
|
|
8
|
+
* `BloomThemeProvider` — so the palettes are gone and `ToasterProps.theme` /
|
|
9
|
+
* `invert` are documented no-ops (light/dark and per-subtree recolouring are
|
|
10
|
+
* `BloomThemeProvider` / `BloomColorScope` concerns).
|
|
11
|
+
*
|
|
12
|
+
* THE SURFACE IS ALWAYS NEUTRAL — `backgroundSecondary` with the `border`, `text`
|
|
13
|
+
* and `textSecondary` roles, for every variant, with `richColors` on or off. The
|
|
14
|
+
* variant only ever colours the leading ICON, and `richColors` only ever widens
|
|
15
|
+
* that to the border and title as well. Exactly like sonner.
|
|
16
|
+
*
|
|
17
|
+
* NOTHING HERE MAY REACH FOR A BRAND TOKEN. `success` / `error` / `warning` /
|
|
18
|
+
* `info` are STATUS colours; `primarySubtle` / `negativeSubtle` are BRAND pairs.
|
|
19
|
+
* Mixing the families is what made `toast.success('Saved')` render as a
|
|
20
|
+
* brand-purple card, and what made a success icon flip from green to purple when
|
|
21
|
+
* `richColors` was switched on. `richColors` means "show the status colour more
|
|
22
|
+
* prominently", never "switch to the brand palette".
|
|
23
|
+
*
|
|
24
|
+
* Genuinely tinted status SURFACES would need a `successSubtle` / `errorSubtle` /
|
|
25
|
+
* `warningSubtle` / `infoSubtle` token family — a theme addition, not something to
|
|
26
|
+
* fake here from a brand pair or a derived alpha.
|
|
27
|
+
*
|
|
28
|
+
* An ABSENT variant is a first-class case: a plain `toast('Saved')` renders the
|
|
29
|
+
* neutral surface with no variant icon at all. It must never fall back to `info`.
|
|
30
|
+
*/
|
|
31
|
+
import { useMemo } from 'react';
|
|
32
|
+
|
|
33
|
+
import { useTheme } from '../theme/use-theme';
|
|
34
|
+
import type { ThemeColors } from '../theme/types';
|
|
35
|
+
import type { ToastVariant } from './types';
|
|
36
|
+
|
|
37
|
+
export type ToastActionColors = {
|
|
38
|
+
background: string;
|
|
39
|
+
text: string;
|
|
40
|
+
pressedBackground: string;
|
|
41
|
+
pressedText: string;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type ToastColors = {
|
|
45
|
+
surface: string;
|
|
46
|
+
border: string;
|
|
47
|
+
title: string;
|
|
48
|
+
description: string;
|
|
49
|
+
icon: string;
|
|
50
|
+
closeButton: string;
|
|
51
|
+
action: ToastActionColors;
|
|
52
|
+
cancelText: string;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The variant's STATUS colour, or `undefined` for the variants that have none.
|
|
57
|
+
* `loading` and an absent variant are deliberately in the second group: they carry
|
|
58
|
+
* no status meaning, so `richColors` has nothing to make more prominent and both
|
|
59
|
+
* stay fully neutral.
|
|
60
|
+
*/
|
|
61
|
+
function statusColor(
|
|
62
|
+
variant: ToastVariant | undefined,
|
|
63
|
+
colors: ThemeColors,
|
|
64
|
+
): string | undefined {
|
|
65
|
+
switch (variant) {
|
|
66
|
+
case 'success':
|
|
67
|
+
return colors.success;
|
|
68
|
+
case 'error':
|
|
69
|
+
return colors.error;
|
|
70
|
+
case 'warning':
|
|
71
|
+
return colors.warning;
|
|
72
|
+
case 'info':
|
|
73
|
+
return colors.info;
|
|
74
|
+
case 'loading':
|
|
75
|
+
case undefined:
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* `richColors` widens the status colour from the icon alone to the border and
|
|
82
|
+
* title as well. It does NOT tint the surface, and it does not touch the
|
|
83
|
+
* description, close button or action colours — those stay neutral so the row
|
|
84
|
+
* still reads as a toast rather than a status banner.
|
|
85
|
+
*/
|
|
86
|
+
function resolveColors({
|
|
87
|
+
variant,
|
|
88
|
+
richColors,
|
|
89
|
+
colors,
|
|
90
|
+
}: {
|
|
91
|
+
variant: ToastVariant | undefined;
|
|
92
|
+
richColors: boolean;
|
|
93
|
+
colors: ThemeColors;
|
|
94
|
+
}): ToastColors {
|
|
95
|
+
const status = statusColor(variant, colors);
|
|
96
|
+
|
|
97
|
+
// The whole surface, for EVERY variant and both values of `richColors`. Because
|
|
98
|
+
// the action colours live here, they can never pick up a variant tint either.
|
|
99
|
+
const neutral: ToastColors = {
|
|
100
|
+
surface: colors.backgroundSecondary,
|
|
101
|
+
border: colors.border,
|
|
102
|
+
title: colors.text,
|
|
103
|
+
description: colors.textSecondary,
|
|
104
|
+
icon: status ?? colors.textSecondary,
|
|
105
|
+
closeButton: colors.textSecondary,
|
|
106
|
+
action: {
|
|
107
|
+
background: colors.backgroundTertiary,
|
|
108
|
+
text: colors.textSecondary,
|
|
109
|
+
pressedBackground: colors.contrast50,
|
|
110
|
+
pressedText: colors.text,
|
|
111
|
+
},
|
|
112
|
+
cancelText: colors.textSecondary,
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
if (!richColors || status === undefined) {
|
|
116
|
+
return neutral;
|
|
117
|
+
}
|
|
118
|
+
return { ...neutral, border: status, title: status };
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export function useToastColors({
|
|
122
|
+
variant,
|
|
123
|
+
richColors,
|
|
124
|
+
}: {
|
|
125
|
+
variant: ToastVariant | undefined;
|
|
126
|
+
richColors: boolean;
|
|
127
|
+
}): ToastColors {
|
|
128
|
+
const { colors } = useTheme();
|
|
129
|
+
return useMemo(
|
|
130
|
+
() => resolveColors({ variant, richColors, colors }),
|
|
131
|
+
[variant, richColors, colors],
|
|
132
|
+
);
|
|
133
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Derived from sonner-native v0.26.4 — src/use-toast-position.ts
|
|
3
|
+
* (MIT © Gunnar Torfi Steinarsson). See the top-level NOTICE.
|
|
4
|
+
*
|
|
5
|
+
* Upstream computes the row's offset inside a `useDerivedValue` worklet and
|
|
6
|
+
* returns `withTiming(...)` from it, which does not animate on web. Bloom computes
|
|
7
|
+
* the target in plain JS — `calculateToastPosition` is pure and unit-tested — and
|
|
8
|
+
* hands it to `useAnimatedTarget`, which drives the shared value imperatively. See
|
|
9
|
+
* that file for the full reasoning.
|
|
10
|
+
*
|
|
11
|
+
* Two dependency traps disappear with the worklet:
|
|
12
|
+
*
|
|
13
|
+
* - No memo and no dependency array. The target is a NUMBER, and
|
|
14
|
+
* `useAnimatedTarget` keys its effect on that number, so recomputing a pure
|
|
15
|
+
* O(visibleToasts) sum on every render costs nothing and cannot go stale.
|
|
16
|
+
* Upstream needs a deps array (including a joined `orderedToastIds` key) purely
|
|
17
|
+
* because a mapper has no other way to know when to re-run.
|
|
18
|
+
* - No `toastHeightsVersion`. The store creates a new `toastHeights` OBJECT on
|
|
19
|
+
* every mutation, and React re-renders on that; the manual version counter only
|
|
20
|
+
* existed because a mapper cannot observe a plain object. The invariant that
|
|
21
|
+
* replaces it is ordinary React — the store must never mutate `toastHeights` in
|
|
22
|
+
* place — pinned by `toast-store.test.ts`.
|
|
23
|
+
*/
|
|
24
|
+
import type { SharedValue } from 'react-native-reanimated';
|
|
25
|
+
|
|
26
|
+
import { easeOutQuartFn } from './animations';
|
|
27
|
+
import { STACKING_ANIMATION_DURATION } from './constants';
|
|
28
|
+
import { calculateToastPosition } from './position-utils';
|
|
29
|
+
import type { ToastPosition } from './types';
|
|
30
|
+
import { useAnimatedTarget } from './use-animated-target';
|
|
31
|
+
|
|
32
|
+
export const useToastPosition = (params: {
|
|
33
|
+
index: number;
|
|
34
|
+
numberOfToasts: number;
|
|
35
|
+
enableStacking: boolean;
|
|
36
|
+
position: ToastPosition;
|
|
37
|
+
allToastHeights: Record<string | number, number>;
|
|
38
|
+
gap: number;
|
|
39
|
+
orderedToastIds: Array<string | number>;
|
|
40
|
+
isExpanded: boolean;
|
|
41
|
+
stackGap: number;
|
|
42
|
+
}): SharedValue<number> =>
|
|
43
|
+
useAnimatedTarget(calculateToastPosition(params), {
|
|
44
|
+
duration: STACKING_ANIMATION_DURATION,
|
|
45
|
+
easing: easeOutQuartFn,
|
|
46
|
+
});
|
|
@@ -4,6 +4,7 @@ import { Pressable, StyleSheet, View } from 'react-native';
|
|
|
4
4
|
import { useTheme } from '../theme/use-theme';
|
|
5
5
|
import { atoms as a, flatten } from '../styles';
|
|
6
6
|
import { Z_INDEX } from '../styles/z-index';
|
|
7
|
+
import { WEB_POSITION_FIXED } from '../styles/web-view-style';
|
|
7
8
|
import {
|
|
8
9
|
ARROW_SIZE,
|
|
9
10
|
BUBBLE_MAX_WIDTH,
|
|
@@ -150,7 +151,7 @@ export const TooltipTextBubble = createTextBubble(TooltipContent);
|
|
|
150
151
|
|
|
151
152
|
const webStyles = StyleSheet.create({
|
|
152
153
|
backdrop: {
|
|
153
|
-
position:
|
|
154
|
+
position: WEB_POSITION_FIXED,
|
|
154
155
|
top: 0,
|
|
155
156
|
left: 0,
|
|
156
157
|
right: 0,
|