@oxyhq/bloom 0.50.1 → 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 +5 -3
- package/lib/commonjs/bottom-sheet/index.web.js.map +1 -1
- package/lib/commonjs/context-menu/index.web.js +6 -9
- package/lib/commonjs/context-menu/index.web.js.map +1 -1
- package/lib/commonjs/dialog/Dialog.js +12 -7
- package/lib/commonjs/dialog/Dialog.js.map +1 -1
- package/lib/commonjs/dialog/Dialog.web.js +18 -22
- package/lib/commonjs/dialog/Dialog.web.js.map +1 -1
- package/lib/commonjs/dialog/DialogHeader.js +61 -12
- package/lib/commonjs/dialog/DialogHeader.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 +5 -8
- package/lib/commonjs/menu/index.web.js.map +1 -1
- package/lib/commonjs/popover/index.web.js +8 -9
- 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 +5 -8
- package/lib/commonjs/select/index.web.js.map +1 -1
- package/lib/commonjs/slider/Slider.js +4 -9
- package/lib/commonjs/slider/Slider.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/switch/Switch.js +4 -8
- package/lib/commonjs/switch/Switch.js.map +1 -1
- 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/tabs/Tabs.js +3 -8
- package/lib/commonjs/tabs/Tabs.js.map +1 -1
- 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 +5 -3
- package/lib/module/bottom-sheet/index.web.js.map +1 -1
- package/lib/module/context-menu/index.web.js +6 -9
- package/lib/module/context-menu/index.web.js.map +1 -1
- package/lib/module/dialog/Dialog.js +12 -7
- package/lib/module/dialog/Dialog.js.map +1 -1
- package/lib/module/dialog/Dialog.web.js +18 -22
- package/lib/module/dialog/Dialog.web.js.map +1 -1
- package/lib/module/dialog/DialogHeader.js +61 -12
- package/lib/module/dialog/DialogHeader.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 +5 -8
- package/lib/module/menu/index.web.js.map +1 -1
- package/lib/module/popover/index.web.js +8 -9
- 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 +5 -8
- package/lib/module/select/index.web.js.map +1 -1
- package/lib/module/slider/Slider.js +4 -9
- package/lib/module/slider/Slider.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/switch/Switch.js +4 -8
- package/lib/module/switch/Switch.js.map +1 -1
- 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/tabs/Tabs.js +3 -8
- package/lib/module/tabs/Tabs.js.map +1 -1
- 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.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/Dialog.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/DialogHeader.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/slider/Slider.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/switch/Switch.d.ts.map +1 -1
- 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/tabs/Tabs.d.ts.map +1 -1
- 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.d.ts.map +1 -1
- package/lib/typescript/module/dialog/Dialog.web.d.ts.map +1 -1
- package/lib/typescript/module/dialog/DialogHeader.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/slider/Slider.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/switch/Switch.d.ts.map +1 -1
- 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/tabs/Tabs.d.ts.map +1 -1
- 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 +4 -3
- package/src/context-menu/index.web.tsx +6 -6
- package/src/dialog/Dialog.tsx +7 -4
- package/src/dialog/Dialog.web.tsx +14 -14
- package/src/dialog/DialogHeader.tsx +72 -17
- package/src/index.ts +4 -1
- package/src/index.web.ts +4 -1
- package/src/menu/index.web.tsx +5 -5
- package/src/popover/index.web.tsx +8 -6
- 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 +5 -5
- package/src/slider/Slider.tsx +3 -5
- package/src/styles/web-view-style.ts +21 -0
- package/src/switch/Switch.tsx +4 -5
- 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/tabs/Tabs.tsx +3 -5
- 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 -272
- 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 -263
- 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 -271
- 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/select/index.web.tsx
CHANGED
|
@@ -5,6 +5,8 @@ import { useTheme } from '../theme/use-theme';
|
|
|
5
5
|
import { Text } from '../typography';
|
|
6
6
|
import { Portal } from '../portal/index.web';
|
|
7
7
|
import { createOverlayZIndex } from '../styles/z-index';
|
|
8
|
+
import { WEB_POSITION_FIXED } from '../styles/web-view-style';
|
|
9
|
+
import { bloomShadowStyle } from '../design-tokens/shadows';
|
|
8
10
|
import { RadioIndicator } from '../radio-indicator';
|
|
9
11
|
import { useInteractionState } from '../hooks/useInteractionState';
|
|
10
12
|
import {
|
|
@@ -201,7 +203,7 @@ export function SelectContent<T>({
|
|
|
201
203
|
? theme.colors.backgroundSecondary
|
|
202
204
|
: theme.colors.background,
|
|
203
205
|
borderColor: theme.colors.borderLight,
|
|
204
|
-
|
|
206
|
+
...bloomShadowStyle('m'),
|
|
205
207
|
},
|
|
206
208
|
]}
|
|
207
209
|
>
|
|
@@ -331,7 +333,7 @@ const styles = StyleSheet.create({
|
|
|
331
333
|
fontSize: 16,
|
|
332
334
|
},
|
|
333
335
|
backdrop: {
|
|
334
|
-
position:
|
|
336
|
+
position: WEB_POSITION_FIXED,
|
|
335
337
|
top: 0,
|
|
336
338
|
left: 0,
|
|
337
339
|
right: 0,
|
|
@@ -348,9 +350,7 @@ const styles = StyleSheet.create({
|
|
|
348
350
|
overflow: 'hidden',
|
|
349
351
|
padding: 4,
|
|
350
352
|
minWidth: 180,
|
|
351
|
-
|
|
352
|
-
shadowRadius: 12,
|
|
353
|
-
shadowOffset: { width: 0, height: 4 },
|
|
353
|
+
// Overlay elevation applied at the usage site via `bloomShadowStyle('m')`.
|
|
354
354
|
// Opt back in from the Portal root's `pointer-events: none`.
|
|
355
355
|
pointerEvents: 'auto',
|
|
356
356
|
},
|
package/src/slider/Slider.tsx
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
|
|
13
13
|
import { useTheme } from '../theme/use-theme';
|
|
14
14
|
import { animation } from '../styles/tokens';
|
|
15
|
+
import { bloomShadowStyle } from '../design-tokens/shadows';
|
|
15
16
|
import type { SliderProps } from './types';
|
|
16
17
|
|
|
17
18
|
function clamp(v: number, min: number, max: number): number {
|
|
@@ -236,7 +237,6 @@ const SliderComponent = function Slider({
|
|
|
236
237
|
backgroundColor: thumbColor,
|
|
237
238
|
left: thumbLeft,
|
|
238
239
|
transform: [{ scale: thumbScale }],
|
|
239
|
-
shadowColor: theme.colors.shadow,
|
|
240
240
|
},
|
|
241
241
|
]}
|
|
242
242
|
/>
|
|
@@ -261,10 +261,8 @@ const styles = StyleSheet.create({
|
|
|
261
261
|
thumb: {
|
|
262
262
|
position: 'absolute',
|
|
263
263
|
top: '50%',
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
shadowRadius: 2,
|
|
267
|
-
elevation: 2,
|
|
264
|
+
// Subtle raise (`shadow-s`) — `boxShadow` on web, RN shadow/elevation on native.
|
|
265
|
+
...bloomShadowStyle('s'),
|
|
268
266
|
},
|
|
269
267
|
disabled: {
|
|
270
268
|
opacity: 0.5,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ViewStyle } from 'react-native';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* `position: fixed`, typed for React Native's `ViewStyle`.
|
|
5
|
+
*
|
|
6
|
+
* RN types `position` as `'absolute' | 'relative' | 'static'` — what Yoga
|
|
7
|
+
* implements — while react-native-web renders real CSS, where `'fixed'` is the
|
|
8
|
+
* only way for a portaled overlay to anchor to the VIEWPORT instead of the
|
|
9
|
+
* nearest positioned ancestor. This is the ONE place Bloom crosses between the
|
|
10
|
+
* two, so web forks import it instead of writing their own cast.
|
|
11
|
+
*
|
|
12
|
+
* Deliberately not a `declare module 'react-native'` augmentation, for two
|
|
13
|
+
* reasons. It does not work: `position` lives on `interface FlexStyle`, which RN
|
|
14
|
+
* re-exports from a submodule, so augmenting `'react-native'` neither merges nor
|
|
15
|
+
* errors — verified with tsc, the identical `TS2322` appears with and without it,
|
|
16
|
+
* which makes it strictly worse than a cast because it looks like a fix. And even
|
|
17
|
+
* if it worked, widening `ViewStyle` would ship through `/// <reference path>` to
|
|
18
|
+
* every consumer, so `position: 'fixed'` would start compiling in NATIVE code
|
|
19
|
+
* where Yoga silently ignores it.
|
|
20
|
+
*/
|
|
21
|
+
export const WEB_POSITION_FIXED = 'fixed' as ViewStyle['position'];
|
package/src/switch/Switch.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import { Pressable, Animated, StyleSheet } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
import { useTheme } from '../theme/use-theme';
|
|
5
5
|
import { animation } from '../styles/tokens';
|
|
6
|
+
import { bloomShadowStyle } from '../design-tokens/shadows';
|
|
6
7
|
import type { SwitchProps } from './types';
|
|
7
8
|
|
|
8
9
|
const TRACK = { default: { w: 44, h: 26 }, sm: { w: 36, h: 22 } } as const;
|
|
@@ -128,10 +129,8 @@ const styles = StyleSheet.create({
|
|
|
128
129
|
},
|
|
129
130
|
thumb: {
|
|
130
131
|
backgroundColor: '#fff',
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
shadowRadius: 3,
|
|
135
|
-
elevation: 3,
|
|
132
|
+
// Subtle raise (`shadow-s`) — `boxShadow` on web (RN-Web deprecated `shadow*`),
|
|
133
|
+
// RN elevation/shadow on native.
|
|
134
|
+
...bloomShadowStyle('s'),
|
|
136
135
|
},
|
|
137
136
|
});
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import React, { useState, type PropsWithChildren } from 'react';
|
|
2
|
+
import { ScrollView, Text, View } from 'react-native';
|
|
3
|
+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
4
|
+
import Animated from 'react-native-reanimated';
|
|
5
|
+
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
6
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
7
|
+
|
|
8
|
+
import * as Icons from '../icons';
|
|
9
|
+
import { useTheme } from '../theme/use-theme';
|
|
10
|
+
import { TabBar, TabBarButton, TabBarMinimizeProvider, useMinimizeOnScroll } from './index';
|
|
11
|
+
import type { TabBarItem, TabBarProps } from './types';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The floating tab bar, on the ROUTER-FREE core (`activeIndex` /
|
|
15
|
+
* `onIndexChange`). No expo-router anywhere — that is the point of the core
|
|
16
|
+
* layer, and it is what lets the family be exercised in a plain web bundle.
|
|
17
|
+
*
|
|
18
|
+
* Storybook resolves `./index` through its `.web.*`-first extension list, so
|
|
19
|
+
* these stories run the WEB fork (`surface.web.tsx`'s `backdrop-filter` glass
|
|
20
|
+
* and `progressive-blur/index.web.tsx`) against the REAL reanimated,
|
|
21
|
+
* gesture-handler and safe-area-context — no worklets babel plugin, exactly
|
|
22
|
+
* what every Oxy RN-Web app ships. That makes every animated path here
|
|
23
|
+
* observable rather than assumed:
|
|
24
|
+
*
|
|
25
|
+
* - **tap / scrub**: the highlight springs to the tapped tab, and follows the
|
|
26
|
+
* finger 1:1 while dragging across the bar
|
|
27
|
+
* - **minimize**: scrolling down shrinks the pill and fades the labels out
|
|
28
|
+
* - **glyph crossfade**: the active tint tracks the highlight, not the tap
|
|
29
|
+
*
|
|
30
|
+
* All of them are driven by shared values read inside `useAnimatedStyle`
|
|
31
|
+
* mappers, so if a dependency array is ever dropped (the web freeze-at-first-
|
|
32
|
+
* frame failure mode documented in `TabBarBase`) these stories visibly stop
|
|
33
|
+
* moving while nothing errors.
|
|
34
|
+
*/
|
|
35
|
+
const meta: Meta<typeof TabBar> = {
|
|
36
|
+
title: 'Components/TabBar',
|
|
37
|
+
component: TabBar,
|
|
38
|
+
// The bar is a screen-level element: its highlight geometry comes from
|
|
39
|
+
// `useWindowDimensions()`, so the demo has to be exactly window-wide or the
|
|
40
|
+
// pill drifts out of step with the tabs and reads as a component bug.
|
|
41
|
+
// `fullscreen` drops Storybook's own canvas padding; the preview decorator's
|
|
42
|
+
// padding is cancelled by `Screen`'s negative margin.
|
|
43
|
+
parameters: { layout: 'fullscreen' },
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export default meta;
|
|
47
|
+
|
|
48
|
+
type Story = StoryObj<typeof TabBar>;
|
|
49
|
+
|
|
50
|
+
const ITEMS: TabBarItem[] = [
|
|
51
|
+
{ name: 'home', label: 'Home', icon: <Icons.Home_Stroke2_Corner0_Rounded /> },
|
|
52
|
+
{ name: 'search', label: 'Search', icon: <Icons.MagnifyingGlass_Stroke2_Corner0_Rounded /> },
|
|
53
|
+
{ name: 'inbox', label: 'Inbox', icon: <Icons.Message_Stroke2_Corner0_Rounded /> },
|
|
54
|
+
{ name: 'profile', label: 'Profile', icon: <Icons.Person_Stroke2_Corner0_Rounded /> },
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
/** Padding the preview decorator puts around every story (`.storybook/preview.tsx`). */
|
|
58
|
+
const PREVIEW_PADDING = 24;
|
|
59
|
+
/** Height of the demo viewport — a phone-ish screen for the bar to float over. */
|
|
60
|
+
const SCREEN_HEIGHT = 560;
|
|
61
|
+
/** Keeps the last rows scrollable clear of the pill. */
|
|
62
|
+
const CONTENT_BOTTOM_PAD = 140;
|
|
63
|
+
|
|
64
|
+
const ROWS = Array.from({ length: 18 }, (_, index) => index + 1);
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* The demo viewport.
|
|
68
|
+
*
|
|
69
|
+
* It bleeds past the preview decorator's padding on purpose: the bar is a
|
|
70
|
+
* screen-level element and derives its highlight geometry from
|
|
71
|
+
* `useWindowDimensions()`, so anything narrower than the window would put the
|
|
72
|
+
* pill out of step with the tabs and look like a component bug.
|
|
73
|
+
*
|
|
74
|
+
* `SafeAreaProvider` is here because `TabBar` reads safe-area insets to sit
|
|
75
|
+
* above the home indicator; a consuming app already has one at its root, the
|
|
76
|
+
* Storybook preview does not.
|
|
77
|
+
*/
|
|
78
|
+
function Screen({ children }: PropsWithChildren) {
|
|
79
|
+
const { colors } = useTheme();
|
|
80
|
+
return (
|
|
81
|
+
<SafeAreaProvider
|
|
82
|
+
style={{ flex: 0, alignSelf: 'stretch', marginHorizontal: -PREVIEW_PADDING }}
|
|
83
|
+
>
|
|
84
|
+
<GestureHandlerRootView
|
|
85
|
+
style={{
|
|
86
|
+
height: SCREEN_HEIGHT,
|
|
87
|
+
backgroundColor: colors.background,
|
|
88
|
+
overflow: 'hidden',
|
|
89
|
+
}}
|
|
90
|
+
>
|
|
91
|
+
{children}
|
|
92
|
+
</GestureHandlerRootView>
|
|
93
|
+
</SafeAreaProvider>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** Tall themed filler so there is something for the bar to float over — and to scroll. */
|
|
98
|
+
function Feed({ heading, caption }: { heading: string; caption: string }) {
|
|
99
|
+
const { colors } = useTheme();
|
|
100
|
+
return (
|
|
101
|
+
<>
|
|
102
|
+
<Text style={{ color: colors.text, fontSize: 24, fontWeight: '700' }}>{heading}</Text>
|
|
103
|
+
<Text style={{ color: colors.textSecondary, fontSize: 14 }}>{caption}</Text>
|
|
104
|
+
{ROWS.map((row) => (
|
|
105
|
+
<View
|
|
106
|
+
key={row}
|
|
107
|
+
style={{
|
|
108
|
+
padding: 16,
|
|
109
|
+
borderRadius: 16,
|
|
110
|
+
borderWidth: 1,
|
|
111
|
+
borderColor: colors.border,
|
|
112
|
+
backgroundColor: colors.backgroundSecondary,
|
|
113
|
+
gap: 4,
|
|
114
|
+
}}
|
|
115
|
+
>
|
|
116
|
+
<Text style={{ color: colors.text, fontSize: 15, fontWeight: '600' }}>Item {row}</Text>
|
|
117
|
+
<Text style={{ color: colors.textSecondary, fontSize: 13 }}>
|
|
118
|
+
Scrolls under the glass so the surface has something to refract.
|
|
119
|
+
</Text>
|
|
120
|
+
</View>
|
|
121
|
+
))}
|
|
122
|
+
</>
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const CONTENT_STYLE = { padding: 16, paddingBottom: CONTENT_BOTTOM_PAD, gap: 12 } as const;
|
|
127
|
+
|
|
128
|
+
/** Controlled core: local state in, `onIndexChange` out. No router involved. */
|
|
129
|
+
function ControlledBar(props: TabBarProps) {
|
|
130
|
+
return (
|
|
131
|
+
<TabBar {...props}>
|
|
132
|
+
{ITEMS.map((item, index) => (
|
|
133
|
+
<TabBarButton key={item.name} item={item} index={index} />
|
|
134
|
+
))}
|
|
135
|
+
</TabBar>
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function DefaultScreen() {
|
|
140
|
+
const [activeIndex, setActiveIndex] = useState(0);
|
|
141
|
+
return (
|
|
142
|
+
<Screen>
|
|
143
|
+
<ScrollView contentContainerStyle={CONTENT_STYLE}>
|
|
144
|
+
<Feed
|
|
145
|
+
heading={ITEMS[activeIndex]?.label ?? 'Feed'}
|
|
146
|
+
caption="Tap a tab, or press and drag across the bar to scrub the highlight."
|
|
147
|
+
/>
|
|
148
|
+
</ScrollView>
|
|
149
|
+
<ControlledBar activeIndex={activeIndex} onIndexChange={setActiveIndex} />
|
|
150
|
+
</Screen>
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Body of {@link MinimizeOnScroll} — a separate component because
|
|
156
|
+
* `useMinimizeOnScroll()` has to run INSIDE `TabBarMinimizeProvider` to share
|
|
157
|
+
* the bar's progress value. Called outside it, the hook silently falls back to
|
|
158
|
+
* its own local shared value and nothing minimizes.
|
|
159
|
+
*/
|
|
160
|
+
function MinimizeScreen() {
|
|
161
|
+
const [activeIndex, setActiveIndex] = useState(0);
|
|
162
|
+
const onScroll = useMinimizeOnScroll();
|
|
163
|
+
return (
|
|
164
|
+
<Screen>
|
|
165
|
+
<Animated.ScrollView
|
|
166
|
+
onScroll={onScroll}
|
|
167
|
+
scrollEventThrottle={16}
|
|
168
|
+
contentContainerStyle={CONTENT_STYLE}
|
|
169
|
+
>
|
|
170
|
+
<Feed
|
|
171
|
+
heading="Minimize on scroll"
|
|
172
|
+
caption="Scroll down: the pill shrinks in both dimensions and the labels fade out. Scroll up, or tap a tab, and it expands again."
|
|
173
|
+
/>
|
|
174
|
+
</Animated.ScrollView>
|
|
175
|
+
<ControlledBar activeIndex={activeIndex} onIndexChange={setActiveIndex} />
|
|
176
|
+
</Screen>
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function ThemeOverrideScreen() {
|
|
181
|
+
const { colors } = useTheme();
|
|
182
|
+
const [activeIndex, setActiveIndex] = useState(1);
|
|
183
|
+
return (
|
|
184
|
+
<Screen>
|
|
185
|
+
<ScrollView contentContainerStyle={CONTENT_STYLE}>
|
|
186
|
+
<Feed
|
|
187
|
+
heading="Theme override"
|
|
188
|
+
caption="Only the highlight and the active tint are overridden — the inactive tint, the glass tint and the solid fallback still come from the active preset."
|
|
189
|
+
/>
|
|
190
|
+
</ScrollView>
|
|
191
|
+
<ControlledBar
|
|
192
|
+
activeIndex={activeIndex}
|
|
193
|
+
onIndexChange={setActiveIndex}
|
|
194
|
+
theme={{ highlight: colors.primary, activeTint: colors.primaryForeground }}
|
|
195
|
+
/>
|
|
196
|
+
</Screen>
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/** Four tabs, controlled highlight, floating over scrollable content. */
|
|
201
|
+
export const Default: Story = {
|
|
202
|
+
render: () => <DefaultScreen />,
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
/** The Revolut-style minimize: the shared progress value driven by a scroll handler. */
|
|
206
|
+
export const MinimizeOnScroll: Story = {
|
|
207
|
+
render: () => (
|
|
208
|
+
<TabBarMinimizeProvider>
|
|
209
|
+
<MinimizeScreen />
|
|
210
|
+
</TabBarMinimizeProvider>
|
|
211
|
+
),
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
/** A partial `theme` override on top of the token-derived defaults. */
|
|
215
|
+
export const ThemeOverride: Story = {
|
|
216
|
+
render: () => <ThemeOverrideScreen />,
|
|
217
|
+
};
|