@thewhileloop/whileui 1.2.3 → 3.0.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/README.md +264 -88
- package/dist/blocks/chat/chat.d.ts +3 -4
- package/dist/blocks/chat/chat.js +29 -17
- package/dist/blocks/chat/index.d.ts +0 -1
- package/dist/blocks/chat/index.js +0 -1
- package/dist/blocks/commerce/checkout-summary.d.ts +1 -2
- package/dist/blocks/commerce/checkout-summary.js +16 -4
- package/dist/blocks/commerce/feature-gate.d.ts +1 -2
- package/dist/blocks/commerce/feature-gate.js +14 -4
- package/dist/blocks/commerce/index.d.ts +0 -1
- package/dist/blocks/commerce/index.js +0 -1
- package/dist/blocks/commerce/metric-card.d.ts +10 -31
- package/dist/blocks/commerce/metric-card.js +7 -3
- package/dist/blocks/commerce/plan-toggle.d.ts +1 -2
- package/dist/blocks/commerce/plan-toggle.js +11 -9
- package/dist/blocks/commerce/pricing-card.d.ts +1 -2
- package/dist/blocks/commerce/pricing-card.js +23 -6
- package/dist/blocks/commerce/product-card.d.ts +1 -2
- package/dist/blocks/commerce/product-card.js +23 -9
- package/dist/blocks/commerce/subscription-card.d.ts +1 -2
- package/dist/blocks/commerce/subscription-card.js +6 -3
- package/dist/blocks/commerce/upgrade-banner.d.ts +1 -2
- package/dist/blocks/commerce/upgrade-banner.js +13 -3
- package/dist/blocks/commerce/usage-bar.d.ts +1 -2
- package/dist/blocks/commerce/usage-bar.js +4 -2
- package/dist/blocks/datepicker/date-range-picker-modal.d.ts +2 -3
- package/dist/blocks/datepicker/date-range-picker-modal.js +25 -7
- package/dist/blocks/datepicker/datepicker-inline.d.ts +1 -2
- package/dist/blocks/datepicker/datepicker-inline.js +9 -3
- package/dist/blocks/datepicker/datepicker-modal.d.ts +2 -3
- package/dist/blocks/datepicker/datepicker-modal.js +44 -18
- package/dist/blocks/datepicker/index.d.ts +0 -1
- package/dist/blocks/datepicker/index.js +0 -1
- package/dist/blocks/datepicker/use-calendar-theme.d.ts +0 -1
- package/dist/blocks/datepicker/use-calendar-theme.js +0 -1
- package/dist/blocks/layout/action-bar.d.ts +1 -2
- package/dist/blocks/layout/action-bar.js +0 -1
- package/dist/blocks/layout/app-shell.d.ts +1 -2
- package/dist/blocks/layout/app-shell.js +11 -5
- package/dist/blocks/layout/confirm-action-sheet.d.ts +1 -2
- package/dist/blocks/layout/confirm-action-sheet.js +18 -6
- package/dist/blocks/layout/content-skeleton.d.ts +1 -2
- package/dist/blocks/layout/content-skeleton.js +22 -9
- package/dist/blocks/layout/docked-input.d.ts +11 -0
- package/dist/blocks/layout/docked-input.js +27 -0
- package/dist/blocks/layout/empty-state.d.ts +1 -2
- package/dist/blocks/layout/empty-state.js +10 -5
- package/dist/blocks/layout/error-boundary.d.ts +1 -2
- package/dist/blocks/layout/error-boundary.js +0 -2
- package/dist/blocks/layout/error-state.d.ts +1 -2
- package/dist/blocks/layout/error-state.js +0 -2
- package/dist/blocks/layout/form-modal-screen.d.ts +1 -2
- package/dist/blocks/layout/form-modal-screen.js +24 -21
- package/dist/blocks/layout/index.d.ts +2 -2
- package/dist/blocks/layout/index.js +2 -2
- package/dist/blocks/layout/keyboard-aware-screen.d.ts +14 -0
- package/dist/blocks/layout/keyboard-aware-screen.js +12 -0
- package/dist/blocks/layout/loading-screen.d.ts +1 -2
- package/dist/blocks/layout/loading-screen.js +6 -8
- package/dist/blocks/layout/page-skeleton.d.ts +1 -2
- package/dist/blocks/layout/page-skeleton.js +38 -20
- package/dist/blocks/layout/pull-to-refresh-scroll-view.d.ts +8 -4
- package/dist/blocks/layout/pull-to-refresh-scroll-view.js +17 -4
- package/dist/blocks/layout/screen-skeleton.d.ts +1 -2
- package/dist/blocks/layout/screen-skeleton.js +0 -1
- package/dist/blocks/layout/sheet.d.ts +9 -9
- package/dist/blocks/layout/sheet.js +51 -21
- package/dist/blocks/layout/smart-input.d.ts +9 -3
- package/dist/blocks/layout/smart-input.js +136 -9
- package/dist/blocks/lists/index.d.ts +0 -2
- package/dist/blocks/lists/index.js +0 -2
- package/dist/blocks/lists/list-item.d.ts +1 -2
- package/dist/blocks/lists/list-item.js +20 -6
- package/dist/blocks/lists/notification-item.d.ts +1 -2
- package/dist/blocks/lists/notification-item.js +19 -6
- package/dist/blocks/lists/timeline-feed.d.ts +1 -2
- package/dist/blocks/lists/timeline-feed.js +4 -2
- package/dist/blocks/media/index.d.ts +0 -1
- package/dist/blocks/media/index.js +0 -1
- package/dist/blocks/media/smart-image.d.ts +39 -99
- package/dist/blocks/media/smart-image.js +24 -8
- package/dist/blocks/navigation/bottom-nav.d.ts +1 -2
- package/dist/blocks/navigation/bottom-nav.js +7 -4
- package/dist/blocks/navigation/drawer-menu.d.ts +1 -2
- package/dist/blocks/navigation/drawer-menu.js +117 -64
- package/dist/blocks/navigation/floating-bottom-nav.d.ts +1 -2
- package/dist/blocks/navigation/floating-bottom-nav.js +14 -5
- package/dist/blocks/navigation/header.d.ts +2 -3
- package/dist/blocks/navigation/header.js +13 -5
- package/dist/blocks/navigation/index.d.ts +0 -2
- package/dist/blocks/navigation/index.js +0 -2
- package/dist/blocks/navigation/tab-bar.d.ts +1 -2
- package/dist/blocks/navigation/tab-bar.js +22 -10
- package/dist/blocks/splash/index.d.ts +0 -1
- package/dist/blocks/splash/index.js +0 -1
- package/dist/blocks/splash/splash-screen.d.ts +3 -4
- package/dist/blocks/splash/splash-screen.js +15 -11
- package/dist/components/accordion/accordion.d.ts +4 -5
- package/dist/components/accordion/accordion.js +6 -7
- package/dist/components/accordion/index.d.ts +0 -1
- package/dist/components/accordion/index.js +0 -1
- package/dist/components/alert/alert.d.ts +23 -56
- package/dist/components/alert/alert.js +20 -9
- package/dist/components/alert/index.d.ts +0 -1
- package/dist/components/alert/index.js +0 -1
- package/dist/components/alert-dialog/alert-dialog.d.ts +9 -10
- package/dist/components/alert-dialog/alert-dialog.js +175 -54
- package/dist/components/alert-dialog/index.d.ts +0 -1
- package/dist/components/alert-dialog/index.js +0 -1
- package/dist/components/aspect-ratio/aspect-ratio.d.ts +1 -2
- package/dist/components/aspect-ratio/aspect-ratio.js +0 -3
- package/dist/components/aspect-ratio/index.d.ts +0 -1
- package/dist/components/aspect-ratio/index.js +0 -1
- package/dist/components/avatar/avatar.d.ts +20 -48
- package/dist/components/avatar/avatar.js +8 -9
- package/dist/components/avatar/index.d.ts +0 -1
- package/dist/components/avatar/index.js +0 -1
- package/dist/components/badge/badge.d.ts +86 -215
- package/dist/components/badge/badge.js +21 -9
- package/dist/components/badge/index.d.ts +0 -1
- package/dist/components/badge/index.js +0 -1
- package/dist/components/button/button.d.ts +75 -193
- package/dist/components/button/button.js +62 -33
- package/dist/components/button/index.d.ts +0 -1
- package/dist/components/button/index.js +0 -1
- package/dist/components/card/card.d.ts +32 -74
- package/dist/components/card/card.js +29 -15
- package/dist/components/card/index.d.ts +0 -1
- package/dist/components/card/index.js +0 -1
- package/dist/components/checkbox/checkbox.d.ts +1 -2
- package/dist/components/checkbox/checkbox.js +15 -2
- package/dist/components/checkbox/index.d.ts +0 -1
- package/dist/components/checkbox/index.js +0 -1
- package/dist/components/collapsible/collapsible.d.ts +4 -4
- package/dist/components/collapsible/collapsible.js +8 -11
- package/dist/components/collapsible/index.d.ts +0 -1
- package/dist/components/collapsible/index.js +0 -1
- package/dist/components/container/container.d.ts +74 -0
- package/dist/components/container/container.js +43 -0
- package/dist/components/container/index.d.ts +1 -0
- package/dist/components/container/index.js +1 -0
- package/dist/components/context-menu/context-menu.d.ts +6 -7
- package/dist/components/context-menu/context-menu.js +42 -12
- package/dist/components/context-menu/index.d.ts +0 -1
- package/dist/components/context-menu/index.js +0 -1
- package/dist/components/data-row/data-row.d.ts +18 -39
- package/dist/components/data-row/data-row.js +36 -18
- package/dist/components/data-row/index.d.ts +0 -1
- package/dist/components/data-row/index.js +0 -1
- package/dist/components/dialog/dialog.d.ts +8 -9
- package/dist/components/dialog/dialog.js +48 -24
- package/dist/components/dialog/index.d.ts +0 -1
- package/dist/components/dialog/index.js +0 -1
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +6 -7
- package/dist/components/dropdown-menu/dropdown-menu.js +45 -11
- package/dist/components/dropdown-menu/index.d.ts +0 -1
- package/dist/components/dropdown-menu/index.js +0 -1
- package/dist/components/form-field/form-field.d.ts +31 -88
- package/dist/components/form-field/form-field.js +27 -14
- package/dist/components/form-field/index.d.ts +0 -1
- package/dist/components/form-field/index.js +0 -1
- package/dist/components/hover-card/hover-card.d.ts +4 -4
- package/dist/components/hover-card/hover-card.js +12 -3
- package/dist/components/hover-card/index.d.ts +0 -1
- package/dist/components/hover-card/index.js +0 -1
- package/dist/components/input/index.d.ts +0 -1
- package/dist/components/input/index.js +0 -1
- package/dist/components/input/input.d.ts +12 -32
- package/dist/components/input/input.js +18 -3
- package/dist/components/label/index.d.ts +0 -1
- package/dist/components/label/index.js +0 -1
- package/dist/components/label/label.d.ts +3 -4
- package/dist/components/label/label.js +0 -1
- package/dist/components/labeled-field/index.d.ts +0 -1
- package/dist/components/labeled-field/index.js +0 -1
- package/dist/components/labeled-field/labeled-field.d.ts +4 -4
- package/dist/components/labeled-field/labeled-field.js +10 -2
- package/dist/components/menubar/index.d.ts +0 -1
- package/dist/components/menubar/index.js +0 -1
- package/dist/components/menubar/menubar.d.ts +7 -8
- package/dist/components/menubar/menubar.js +48 -15
- package/dist/components/numeric-input/index.d.ts +0 -1
- package/dist/components/numeric-input/index.js +0 -1
- package/dist/components/numeric-input/numeric-input.d.ts +29 -83
- package/dist/components/numeric-input/numeric-input.js +93 -73
- package/dist/components/otp-input/index.d.ts +0 -1
- package/dist/components/otp-input/index.js +0 -1
- package/dist/components/otp-input/otp-input.d.ts +22 -67
- package/dist/components/otp-input/otp-input.js +13 -9
- package/dist/components/popover/index.d.ts +0 -1
- package/dist/components/popover/index.js +0 -1
- package/dist/components/popover/popover.d.ts +8 -5
- package/dist/components/popover/popover.js +21 -4
- package/dist/components/pressable/index.d.ts +0 -1
- package/dist/components/pressable/index.js +0 -1
- package/dist/components/pressable/pressable.d.ts +10 -4
- package/dist/components/pressable/pressable.js +47 -4
- package/dist/components/progress/index.d.ts +0 -1
- package/dist/components/progress/index.js +0 -1
- package/dist/components/progress/progress.d.ts +15 -40
- package/dist/components/progress/progress.js +5 -2
- package/dist/components/radio-group/index.d.ts +0 -1
- package/dist/components/radio-group/index.js +0 -1
- package/dist/components/radio-group/radio-group.d.ts +2 -3
- package/dist/components/radio-group/radio-group.js +16 -7
- package/dist/components/row/index.d.ts +0 -1
- package/dist/components/row/index.js +0 -1
- package/dist/components/row/row.d.ts +63 -164
- package/dist/components/row/row.js +0 -1
- package/dist/components/segmented-control/index.d.ts +0 -1
- package/dist/components/segmented-control/index.js +0 -1
- package/dist/components/segmented-control/segmented-control.d.ts +72 -245
- package/dist/components/segmented-control/segmented-control.js +57 -24
- package/dist/components/select/index.d.ts +0 -1
- package/dist/components/select/index.js +0 -1
- package/dist/components/select/select.d.ts +23 -27
- package/dist/components/select/select.js +54 -12
- package/dist/components/separator/index.d.ts +0 -1
- package/dist/components/separator/index.js +0 -1
- package/dist/components/separator/separator.d.ts +3 -4
- package/dist/components/separator/separator.js +0 -1
- package/dist/components/skeleton/index.d.ts +0 -1
- package/dist/components/skeleton/index.js +0 -1
- package/dist/components/skeleton/skeleton.d.ts +10 -31
- package/dist/components/skeleton/skeleton.js +7 -8
- package/dist/components/spinner/index.d.ts +0 -1
- package/dist/components/spinner/index.js +0 -1
- package/dist/components/spinner/spinner.d.ts +13 -38
- package/dist/components/spinner/spinner.js +4 -2
- package/dist/components/stack/index.d.ts +0 -1
- package/dist/components/stack/index.js +0 -1
- package/dist/components/stack/stack.d.ts +63 -164
- package/dist/components/stack/stack.js +0 -1
- package/dist/components/switch/index.d.ts +0 -1
- package/dist/components/switch/index.js +0 -1
- package/dist/components/switch/switch.d.ts +1 -2
- package/dist/components/switch/switch.js +21 -2
- package/dist/components/tabs/index.d.ts +0 -1
- package/dist/components/tabs/index.js +0 -1
- package/dist/components/tabs/tabs.d.ts +13 -34
- package/dist/components/tabs/tabs.js +42 -12
- package/dist/components/text/index.d.ts +0 -1
- package/dist/components/text/index.js +0 -1
- package/dist/components/text/text.d.ts +51 -132
- package/dist/components/text/text.js +0 -1
- package/dist/components/textarea/index.d.ts +0 -1
- package/dist/components/textarea/index.js +0 -1
- package/dist/components/textarea/textarea.d.ts +15 -40
- package/dist/components/textarea/textarea.js +17 -9
- package/dist/components/toast/index.d.ts +0 -1
- package/dist/components/toast/index.js +0 -1
- package/dist/components/toast/toast.d.ts +15 -40
- package/dist/components/toast/toast.js +40 -24
- package/dist/components/toggle/index.d.ts +0 -1
- package/dist/components/toggle/index.js +0 -1
- package/dist/components/toggle/toggle.d.ts +44 -141
- package/dist/components/toggle/toggle.js +32 -16
- package/dist/components/toggle-group/index.d.ts +0 -1
- package/dist/components/toggle-group/index.js +0 -1
- package/dist/components/toggle-group/toggle-group.d.ts +45 -142
- package/dist/components/toggle-group/toggle-group.js +36 -19
- package/dist/components/tooltip/index.d.ts +0 -1
- package/dist/components/tooltip/index.js +0 -1
- package/dist/components/tooltip/tooltip.d.ts +4 -4
- package/dist/components/tooltip/tooltip.js +20 -3
- package/dist/components/view/index.d.ts +0 -1
- package/dist/components/view/index.js +0 -1
- package/dist/components/view/view.d.ts +3 -4
- package/dist/components/view/view.js +0 -1
- package/dist/index.d.ts +9 -3
- package/dist/index.js +9 -7
- package/dist/lib/cn.d.ts +0 -1
- package/dist/lib/cn.js +0 -1
- package/dist/lib/compose-event-handlers.d.ts +15 -0
- package/dist/lib/compose-event-handlers.js +20 -0
- package/dist/lib/focus-ring.d.ts +25 -0
- package/dist/lib/focus-ring.js +25 -0
- package/dist/lib/font-context.d.ts +1 -1
- package/dist/lib/font-context.js +6 -4
- package/dist/lib/frosted-surface.d.ts +0 -1
- package/dist/lib/frosted-surface.js +31 -6
- package/dist/lib/interaction-tokens.d.ts +12 -1
- package/dist/lib/interaction-tokens.js +27 -13
- package/dist/lib/motion-policy.d.ts +25 -0
- package/dist/lib/motion-policy.js +97 -0
- package/dist/lib/overlay-insets.d.ts +17 -0
- package/dist/lib/overlay-insets.js +23 -0
- package/dist/lib/portal.d.ts +0 -1
- package/dist/lib/portal.js +0 -1
- package/dist/lib/react-native-classname.d.ts +0 -1
- package/dist/lib/react-native-classname.js +0 -1
- package/dist/lib/recipes.d.ts +30 -0
- package/dist/lib/recipes.js +138 -0
- package/dist/lib/ref-types.d.ts +3 -0
- package/dist/lib/ref-types.js +1 -0
- package/dist/lib/tap-only.d.ts +11 -0
- package/dist/lib/tap-only.js +24 -0
- package/dist/lib/theme-bridge.d.ts +4 -3
- package/dist/lib/theme-bridge.js +24 -12
- package/dist/lib/theme-colors.d.ts +2 -46
- package/dist/lib/theme-colors.js +25 -226
- package/dist/lib/theme-contract.d.ts +78 -0
- package/dist/lib/theme-contract.js +481 -0
- package/dist/lib/theme-derive.d.ts +4 -0
- package/dist/lib/theme-derive.js +80 -0
- package/dist/lib/theme-presets.d.ts +31 -0
- package/dist/lib/theme-presets.js +221 -0
- package/dist/lib/tv.d.ts +0 -1
- package/dist/lib/tv.js +0 -1
- package/dist/lib/visual-token-contract.d.ts +110 -0
- package/dist/lib/visual-token-contract.js +583 -0
- package/dist/lib/visual-tokens.d.ts +2 -38
- package/dist/lib/visual-tokens.js +22 -75
- package/dist/tokens.d.ts +4 -0
- package/dist/tokens.js +6 -0
- package/dist/vite.d.ts +0 -1
- package/dist/vite.js +0 -1
- package/package.json +40 -29
- package/dist/blocks/auth/forgot-password-form.d.ts +0 -10
- package/dist/blocks/auth/forgot-password-form.d.ts.map +0 -1
- package/dist/blocks/auth/forgot-password-form.js +0 -17
- package/dist/blocks/auth/forgot-password-form.js.map +0 -1
- package/dist/blocks/auth/index.d.ts +0 -8
- package/dist/blocks/auth/index.d.ts.map +0 -1
- package/dist/blocks/auth/index.js +0 -8
- package/dist/blocks/auth/index.js.map +0 -1
- package/dist/blocks/auth/reset-password-form.d.ts +0 -9
- package/dist/blocks/auth/reset-password-form.d.ts.map +0 -1
- package/dist/blocks/auth/reset-password-form.js +0 -16
- package/dist/blocks/auth/reset-password-form.js.map +0 -1
- package/dist/blocks/auth/sign-in-form.d.ts +0 -17
- package/dist/blocks/auth/sign-in-form.d.ts.map +0 -1
- package/dist/blocks/auth/sign-in-form.js +0 -19
- package/dist/blocks/auth/sign-in-form.js.map +0 -1
- package/dist/blocks/auth/sign-up-form.d.ts +0 -17
- package/dist/blocks/auth/sign-up-form.d.ts.map +0 -1
- package/dist/blocks/auth/sign-up-form.js +0 -21
- package/dist/blocks/auth/sign-up-form.js.map +0 -1
- package/dist/blocks/auth/social-connections.d.ts +0 -10
- package/dist/blocks/auth/social-connections.d.ts.map +0 -1
- package/dist/blocks/auth/social-connections.js +0 -8
- package/dist/blocks/auth/social-connections.js.map +0 -1
- package/dist/blocks/auth/user-menu.d.ts +0 -12
- package/dist/blocks/auth/user-menu.d.ts.map +0 -1
- package/dist/blocks/auth/user-menu.js +0 -10
- package/dist/blocks/auth/user-menu.js.map +0 -1
- package/dist/blocks/auth/verify-email-form.d.ts +0 -10
- package/dist/blocks/auth/verify-email-form.d.ts.map +0 -1
- package/dist/blocks/auth/verify-email-form.js +0 -17
- package/dist/blocks/auth/verify-email-form.js.map +0 -1
- package/dist/blocks/chat/chat.d.ts.map +0 -1
- package/dist/blocks/chat/chat.js.map +0 -1
- package/dist/blocks/chat/index.d.ts.map +0 -1
- package/dist/blocks/chat/index.js.map +0 -1
- package/dist/blocks/commerce/checkout-summary.d.ts.map +0 -1
- package/dist/blocks/commerce/checkout-summary.js.map +0 -1
- package/dist/blocks/commerce/feature-gate.d.ts.map +0 -1
- package/dist/blocks/commerce/feature-gate.js.map +0 -1
- package/dist/blocks/commerce/index.d.ts.map +0 -1
- package/dist/blocks/commerce/index.js.map +0 -1
- package/dist/blocks/commerce/metric-card.d.ts.map +0 -1
- package/dist/blocks/commerce/metric-card.js.map +0 -1
- package/dist/blocks/commerce/plan-toggle.d.ts.map +0 -1
- package/dist/blocks/commerce/plan-toggle.js.map +0 -1
- package/dist/blocks/commerce/pricing-card.d.ts.map +0 -1
- package/dist/blocks/commerce/pricing-card.js.map +0 -1
- package/dist/blocks/commerce/product-card.d.ts.map +0 -1
- package/dist/blocks/commerce/product-card.js.map +0 -1
- package/dist/blocks/commerce/subscription-card.d.ts.map +0 -1
- package/dist/blocks/commerce/subscription-card.js.map +0 -1
- package/dist/blocks/commerce/upgrade-banner.d.ts.map +0 -1
- package/dist/blocks/commerce/upgrade-banner.js.map +0 -1
- package/dist/blocks/commerce/usage-bar.d.ts.map +0 -1
- package/dist/blocks/commerce/usage-bar.js.map +0 -1
- package/dist/blocks/datepicker/date-range-picker-modal.d.ts.map +0 -1
- package/dist/blocks/datepicker/date-range-picker-modal.js.map +0 -1
- package/dist/blocks/datepicker/datepicker-inline.d.ts.map +0 -1
- package/dist/blocks/datepicker/datepicker-inline.js.map +0 -1
- package/dist/blocks/datepicker/datepicker-modal.d.ts.map +0 -1
- package/dist/blocks/datepicker/datepicker-modal.js.map +0 -1
- package/dist/blocks/datepicker/index.d.ts.map +0 -1
- package/dist/blocks/datepicker/index.js.map +0 -1
- package/dist/blocks/datepicker/use-calendar-theme.d.ts.map +0 -1
- package/dist/blocks/datepicker/use-calendar-theme.js.map +0 -1
- package/dist/blocks/layout/action-bar.d.ts.map +0 -1
- package/dist/blocks/layout/action-bar.js.map +0 -1
- package/dist/blocks/layout/app-shell.d.ts.map +0 -1
- package/dist/blocks/layout/app-shell.js.map +0 -1
- package/dist/blocks/layout/confirm-action-sheet.d.ts.map +0 -1
- package/dist/blocks/layout/confirm-action-sheet.js.map +0 -1
- package/dist/blocks/layout/content-skeleton.d.ts.map +0 -1
- package/dist/blocks/layout/content-skeleton.js.map +0 -1
- package/dist/blocks/layout/empty-state.d.ts.map +0 -1
- package/dist/blocks/layout/empty-state.js.map +0 -1
- package/dist/blocks/layout/error-boundary.d.ts.map +0 -1
- package/dist/blocks/layout/error-boundary.js.map +0 -1
- package/dist/blocks/layout/error-state.d.ts.map +0 -1
- package/dist/blocks/layout/error-state.js.map +0 -1
- package/dist/blocks/layout/form-modal-screen.d.ts.map +0 -1
- package/dist/blocks/layout/form-modal-screen.js.map +0 -1
- package/dist/blocks/layout/index.d.ts.map +0 -1
- package/dist/blocks/layout/index.js.map +0 -1
- package/dist/blocks/layout/loading-screen.d.ts.map +0 -1
- package/dist/blocks/layout/loading-screen.js.map +0 -1
- package/dist/blocks/layout/onboarding-screen.d.ts +0 -19
- package/dist/blocks/layout/onboarding-screen.d.ts.map +0 -1
- package/dist/blocks/layout/onboarding-screen.js +0 -35
- package/dist/blocks/layout/onboarding-screen.js.map +0 -1
- package/dist/blocks/layout/page-skeleton.d.ts.map +0 -1
- package/dist/blocks/layout/page-skeleton.js.map +0 -1
- package/dist/blocks/layout/pull-to-refresh-scroll-view.d.ts.map +0 -1
- package/dist/blocks/layout/pull-to-refresh-scroll-view.js.map +0 -1
- package/dist/blocks/layout/screen-skeleton.d.ts.map +0 -1
- package/dist/blocks/layout/screen-skeleton.js.map +0 -1
- package/dist/blocks/layout/sheet.d.ts.map +0 -1
- package/dist/blocks/layout/sheet.js.map +0 -1
- package/dist/blocks/layout/smart-image.d.ts +0 -9
- package/dist/blocks/layout/smart-image.d.ts.map +0 -1
- package/dist/blocks/layout/smart-image.js +0 -23
- package/dist/blocks/layout/smart-image.js.map +0 -1
- package/dist/blocks/layout/smart-input.d.ts.map +0 -1
- package/dist/blocks/layout/smart-input.js.map +0 -1
- package/dist/blocks/lists/index.d.ts.map +0 -1
- package/dist/blocks/lists/index.js.map +0 -1
- package/dist/blocks/lists/list-item.d.ts.map +0 -1
- package/dist/blocks/lists/list-item.js.map +0 -1
- package/dist/blocks/lists/notification-item.d.ts.map +0 -1
- package/dist/blocks/lists/notification-item.js.map +0 -1
- package/dist/blocks/lists/swipeable-item.d.ts +0 -17
- package/dist/blocks/lists/swipeable-item.d.ts.map +0 -1
- package/dist/blocks/lists/swipeable-item.js +0 -65
- package/dist/blocks/lists/swipeable-item.js.map +0 -1
- package/dist/blocks/lists/timeline-feed.d.ts.map +0 -1
- package/dist/blocks/lists/timeline-feed.js.map +0 -1
- package/dist/blocks/media/index.d.ts.map +0 -1
- package/dist/blocks/media/index.js.map +0 -1
- package/dist/blocks/media/smart-image.d.ts.map +0 -1
- package/dist/blocks/media/smart-image.js.map +0 -1
- package/dist/blocks/navigation/bottom-nav.d.ts.map +0 -1
- package/dist/blocks/navigation/bottom-nav.js.map +0 -1
- package/dist/blocks/navigation/drawer-menu.d.ts.map +0 -1
- package/dist/blocks/navigation/drawer-menu.js.map +0 -1
- package/dist/blocks/navigation/floating-bottom-nav.d.ts.map +0 -1
- package/dist/blocks/navigation/floating-bottom-nav.js.map +0 -1
- package/dist/blocks/navigation/header.d.ts.map +0 -1
- package/dist/blocks/navigation/header.js.map +0 -1
- package/dist/blocks/navigation/index.d.ts.map +0 -1
- package/dist/blocks/navigation/index.js.map +0 -1
- package/dist/blocks/navigation/navigation-sidebar.d.ts +0 -25
- package/dist/blocks/navigation/navigation-sidebar.d.ts.map +0 -1
- package/dist/blocks/navigation/navigation-sidebar.js +0 -18
- package/dist/blocks/navigation/navigation-sidebar.js.map +0 -1
- package/dist/blocks/navigation/tab-bar.d.ts.map +0 -1
- package/dist/blocks/navigation/tab-bar.js.map +0 -1
- package/dist/blocks/profile/account-card.d.ts +0 -11
- package/dist/blocks/profile/account-card.d.ts.map +0 -1
- package/dist/blocks/profile/account-card.js +0 -10
- package/dist/blocks/profile/account-card.js.map +0 -1
- package/dist/blocks/profile/index.d.ts +0 -5
- package/dist/blocks/profile/index.d.ts.map +0 -1
- package/dist/blocks/profile/index.js +0 -5
- package/dist/blocks/profile/index.js.map +0 -1
- package/dist/blocks/profile/profile-header.d.ts +0 -27
- package/dist/blocks/profile/profile-header.d.ts.map +0 -1
- package/dist/blocks/profile/profile-header.js +0 -11
- package/dist/blocks/profile/profile-header.js.map +0 -1
- package/dist/blocks/profile/settings-item.d.ts +0 -15
- package/dist/blocks/profile/settings-item.d.ts.map +0 -1
- package/dist/blocks/profile/settings-item.js +0 -11
- package/dist/blocks/profile/settings-item.js.map +0 -1
- package/dist/blocks/profile/settings-section.d.ts +0 -7
- package/dist/blocks/profile/settings-section.d.ts.map +0 -1
- package/dist/blocks/profile/settings-section.js +0 -9
- package/dist/blocks/profile/settings-section.js.map +0 -1
- package/dist/blocks/splash/index.d.ts.map +0 -1
- package/dist/blocks/splash/index.js.map +0 -1
- package/dist/blocks/splash/splash-screen.d.ts.map +0 -1
- package/dist/blocks/splash/splash-screen.js.map +0 -1
- package/dist/components/accordion/accordion.d.ts.map +0 -1
- package/dist/components/accordion/accordion.js.map +0 -1
- package/dist/components/accordion/index.d.ts.map +0 -1
- package/dist/components/accordion/index.js.map +0 -1
- package/dist/components/alert/alert.d.ts.map +0 -1
- package/dist/components/alert/alert.js.map +0 -1
- package/dist/components/alert/index.d.ts.map +0 -1
- package/dist/components/alert/index.js.map +0 -1
- package/dist/components/alert-dialog/alert-dialog.d.ts.map +0 -1
- package/dist/components/alert-dialog/alert-dialog.js.map +0 -1
- package/dist/components/alert-dialog/index.d.ts.map +0 -1
- package/dist/components/alert-dialog/index.js.map +0 -1
- package/dist/components/aspect-ratio/aspect-ratio.d.ts.map +0 -1
- package/dist/components/aspect-ratio/aspect-ratio.js.map +0 -1
- package/dist/components/aspect-ratio/index.d.ts.map +0 -1
- package/dist/components/aspect-ratio/index.js.map +0 -1
- package/dist/components/avatar/avatar.d.ts.map +0 -1
- package/dist/components/avatar/avatar.js.map +0 -1
- package/dist/components/avatar/index.d.ts.map +0 -1
- package/dist/components/avatar/index.js.map +0 -1
- package/dist/components/badge/badge.d.ts.map +0 -1
- package/dist/components/badge/badge.js.map +0 -1
- package/dist/components/badge/index.d.ts.map +0 -1
- package/dist/components/badge/index.js.map +0 -1
- package/dist/components/box/box.d.ts +0 -143
- package/dist/components/box/box.d.ts.map +0 -1
- package/dist/components/box/box.js +0 -38
- package/dist/components/box/box.js.map +0 -1
- package/dist/components/box/index.d.ts +0 -2
- package/dist/components/box/index.d.ts.map +0 -1
- package/dist/components/box/index.js +0 -2
- package/dist/components/box/index.js.map +0 -1
- package/dist/components/button/button.d.ts.map +0 -1
- package/dist/components/button/button.js.map +0 -1
- package/dist/components/button/index.d.ts.map +0 -1
- package/dist/components/button/index.js.map +0 -1
- package/dist/components/card/card.d.ts.map +0 -1
- package/dist/components/card/card.js.map +0 -1
- package/dist/components/card/index.d.ts.map +0 -1
- package/dist/components/card/index.js.map +0 -1
- package/dist/components/checkbox/checkbox.d.ts.map +0 -1
- package/dist/components/checkbox/checkbox.js.map +0 -1
- package/dist/components/checkbox/index.d.ts.map +0 -1
- package/dist/components/checkbox/index.js.map +0 -1
- package/dist/components/collapsible/collapsible.d.ts.map +0 -1
- package/dist/components/collapsible/collapsible.js.map +0 -1
- package/dist/components/collapsible/index.d.ts.map +0 -1
- package/dist/components/collapsible/index.js.map +0 -1
- package/dist/components/context-menu/context-menu.d.ts.map +0 -1
- package/dist/components/context-menu/context-menu.js.map +0 -1
- package/dist/components/context-menu/index.d.ts.map +0 -1
- package/dist/components/context-menu/index.js.map +0 -1
- package/dist/components/data-row/data-row.d.ts.map +0 -1
- package/dist/components/data-row/data-row.js.map +0 -1
- package/dist/components/data-row/index.d.ts.map +0 -1
- package/dist/components/data-row/index.js.map +0 -1
- package/dist/components/dialog/dialog.d.ts.map +0 -1
- package/dist/components/dialog/dialog.js.map +0 -1
- package/dist/components/dialog/index.d.ts.map +0 -1
- package/dist/components/dialog/index.js.map +0 -1
- package/dist/components/dropdown-menu/dropdown-menu.d.ts.map +0 -1
- package/dist/components/dropdown-menu/dropdown-menu.js.map +0 -1
- package/dist/components/dropdown-menu/index.d.ts.map +0 -1
- package/dist/components/dropdown-menu/index.js.map +0 -1
- package/dist/components/form-field/form-field.d.ts.map +0 -1
- package/dist/components/form-field/form-field.js.map +0 -1
- package/dist/components/form-field/index.d.ts.map +0 -1
- package/dist/components/form-field/index.js.map +0 -1
- package/dist/components/hover-card/hover-card.d.ts.map +0 -1
- package/dist/components/hover-card/hover-card.js.map +0 -1
- package/dist/components/hover-card/index.d.ts.map +0 -1
- package/dist/components/hover-card/index.js.map +0 -1
- package/dist/components/input/index.d.ts.map +0 -1
- package/dist/components/input/index.js.map +0 -1
- package/dist/components/input/input.d.ts.map +0 -1
- package/dist/components/input/input.js.map +0 -1
- package/dist/components/label/index.d.ts.map +0 -1
- package/dist/components/label/index.js.map +0 -1
- package/dist/components/label/label.d.ts.map +0 -1
- package/dist/components/label/label.js.map +0 -1
- package/dist/components/labeled-field/index.d.ts.map +0 -1
- package/dist/components/labeled-field/index.js.map +0 -1
- package/dist/components/labeled-field/labeled-field.d.ts.map +0 -1
- package/dist/components/labeled-field/labeled-field.js.map +0 -1
- package/dist/components/layout/index.d.ts +0 -2
- package/dist/components/layout/index.d.ts.map +0 -1
- package/dist/components/layout/index.js +0 -2
- package/dist/components/layout/index.js.map +0 -1
- package/dist/components/layout/layout.d.ts +0 -395
- package/dist/components/layout/layout.d.ts.map +0 -1
- package/dist/components/layout/layout.js +0 -93
- package/dist/components/layout/layout.js.map +0 -1
- package/dist/components/menubar/index.d.ts.map +0 -1
- package/dist/components/menubar/index.js.map +0 -1
- package/dist/components/menubar/menubar.d.ts.map +0 -1
- package/dist/components/menubar/menubar.js.map +0 -1
- package/dist/components/numeric-input/index.d.ts.map +0 -1
- package/dist/components/numeric-input/index.js.map +0 -1
- package/dist/components/numeric-input/numeric-input.d.ts.map +0 -1
- package/dist/components/numeric-input/numeric-input.js.map +0 -1
- package/dist/components/otp-input/index.d.ts.map +0 -1
- package/dist/components/otp-input/index.js.map +0 -1
- package/dist/components/otp-input/otp-input.d.ts.map +0 -1
- package/dist/components/otp-input/otp-input.js.map +0 -1
- package/dist/components/popover/index.d.ts.map +0 -1
- package/dist/components/popover/index.js.map +0 -1
- package/dist/components/popover/popover.d.ts.map +0 -1
- package/dist/components/popover/popover.js.map +0 -1
- package/dist/components/pressable/index.d.ts.map +0 -1
- package/dist/components/pressable/index.js.map +0 -1
- package/dist/components/pressable/pressable.d.ts.map +0 -1
- package/dist/components/pressable/pressable.js.map +0 -1
- package/dist/components/progress/index.d.ts.map +0 -1
- package/dist/components/progress/index.js.map +0 -1
- package/dist/components/progress/progress.d.ts.map +0 -1
- package/dist/components/progress/progress.js.map +0 -1
- package/dist/components/radio-group/index.d.ts.map +0 -1
- package/dist/components/radio-group/index.js.map +0 -1
- package/dist/components/radio-group/radio-group.d.ts.map +0 -1
- package/dist/components/radio-group/radio-group.js.map +0 -1
- package/dist/components/row/index.d.ts.map +0 -1
- package/dist/components/row/index.js.map +0 -1
- package/dist/components/row/row.d.ts.map +0 -1
- package/dist/components/row/row.js.map +0 -1
- package/dist/components/segmented-control/index.d.ts.map +0 -1
- package/dist/components/segmented-control/index.js.map +0 -1
- package/dist/components/segmented-control/segmented-control.d.ts.map +0 -1
- package/dist/components/segmented-control/segmented-control.js.map +0 -1
- package/dist/components/select/index.d.ts.map +0 -1
- package/dist/components/select/index.js.map +0 -1
- package/dist/components/select/select.d.ts.map +0 -1
- package/dist/components/select/select.js.map +0 -1
- package/dist/components/separator/index.d.ts.map +0 -1
- package/dist/components/separator/index.js.map +0 -1
- package/dist/components/separator/separator.d.ts.map +0 -1
- package/dist/components/separator/separator.js.map +0 -1
- package/dist/components/skeleton/index.d.ts.map +0 -1
- package/dist/components/skeleton/index.js.map +0 -1
- package/dist/components/skeleton/skeleton.d.ts.map +0 -1
- package/dist/components/skeleton/skeleton.js.map +0 -1
- package/dist/components/spinner/index.d.ts.map +0 -1
- package/dist/components/spinner/index.js.map +0 -1
- package/dist/components/spinner/spinner.d.ts.map +0 -1
- package/dist/components/spinner/spinner.js.map +0 -1
- package/dist/components/stack/index.d.ts.map +0 -1
- package/dist/components/stack/index.js.map +0 -1
- package/dist/components/stack/stack.d.ts.map +0 -1
- package/dist/components/stack/stack.js.map +0 -1
- package/dist/components/switch/index.d.ts.map +0 -1
- package/dist/components/switch/index.js.map +0 -1
- package/dist/components/switch/switch.d.ts.map +0 -1
- package/dist/components/switch/switch.js.map +0 -1
- package/dist/components/tabs/index.d.ts.map +0 -1
- package/dist/components/tabs/index.js.map +0 -1
- package/dist/components/tabs/tabs.d.ts.map +0 -1
- package/dist/components/tabs/tabs.js.map +0 -1
- package/dist/components/text/index.d.ts.map +0 -1
- package/dist/components/text/index.js.map +0 -1
- package/dist/components/text/text.d.ts.map +0 -1
- package/dist/components/text/text.js.map +0 -1
- package/dist/components/textarea/index.d.ts.map +0 -1
- package/dist/components/textarea/index.js.map +0 -1
- package/dist/components/textarea/textarea.d.ts.map +0 -1
- package/dist/components/textarea/textarea.js.map +0 -1
- package/dist/components/toast/index.d.ts.map +0 -1
- package/dist/components/toast/index.js.map +0 -1
- package/dist/components/toast/toast.d.ts.map +0 -1
- package/dist/components/toast/toast.js.map +0 -1
- package/dist/components/toggle/index.d.ts.map +0 -1
- package/dist/components/toggle/index.js.map +0 -1
- package/dist/components/toggle/toggle.d.ts.map +0 -1
- package/dist/components/toggle/toggle.js.map +0 -1
- package/dist/components/toggle-group/index.d.ts.map +0 -1
- package/dist/components/toggle-group/index.js.map +0 -1
- package/dist/components/toggle-group/toggle-group.d.ts.map +0 -1
- package/dist/components/toggle-group/toggle-group.js.map +0 -1
- package/dist/components/tooltip/index.d.ts.map +0 -1
- package/dist/components/tooltip/index.js.map +0 -1
- package/dist/components/tooltip/tooltip.d.ts.map +0 -1
- package/dist/components/tooltip/tooltip.js.map +0 -1
- package/dist/components/view/index.d.ts.map +0 -1
- package/dist/components/view/index.js.map +0 -1
- package/dist/components/view/view.d.ts.map +0 -1
- package/dist/components/view/view.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/cn.d.ts.map +0 -1
- package/dist/lib/cn.js.map +0 -1
- package/dist/lib/font-context.d.ts.map +0 -1
- package/dist/lib/font-context.js.map +0 -1
- package/dist/lib/frosted-surface.d.ts.map +0 -1
- package/dist/lib/frosted-surface.js.map +0 -1
- package/dist/lib/index.d.ts +0 -6
- package/dist/lib/index.d.ts.map +0 -1
- package/dist/lib/index.js +0 -6
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/interaction-tokens.d.ts.map +0 -1
- package/dist/lib/interaction-tokens.js.map +0 -1
- package/dist/lib/portal.d.ts.map +0 -1
- package/dist/lib/portal.js.map +0 -1
- package/dist/lib/react-native-classname.d.ts.map +0 -1
- package/dist/lib/react-native-classname.js.map +0 -1
- package/dist/lib/theme-bridge.d.ts.map +0 -1
- package/dist/lib/theme-bridge.js.map +0 -1
- package/dist/lib/theme-colors.d.ts.map +0 -1
- package/dist/lib/theme-colors.js.map +0 -1
- package/dist/lib/tv.d.ts.map +0 -1
- package/dist/lib/tv.js.map +0 -1
- package/dist/lib/visual-tokens.d.ts.map +0 -1
- package/dist/lib/visual-tokens.js.map +0 -1
- package/dist/vite.d.ts.map +0 -1
- package/dist/vite.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { View, Pressable, Platform, Modal, useWindowDimensions, StyleSheet, } from 'react-native';
|
|
3
|
+
import { View, Pressable, Platform, Modal, I18nManager, SectionList, useWindowDimensions, StyleSheet, } from 'react-native';
|
|
4
4
|
import Animated, { useSharedValue, useAnimatedStyle, withTiming, Easing, interpolate, } from 'react-native-reanimated';
|
|
5
5
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
6
|
import { Text } from '../../components/text';
|
|
@@ -8,41 +8,44 @@ import { cn } from '../../lib/cn';
|
|
|
8
8
|
import { useThemeColors } from '../../lib/theme-colors';
|
|
9
9
|
import { useInteractionTokens, withInteractivePressableStyle } from '../../lib/interaction-tokens';
|
|
10
10
|
import { useVisualTokens } from '../../lib/visual-tokens';
|
|
11
|
+
import { shadowStyle, surfaceRadius } from '../../lib/recipes';
|
|
12
|
+
import { useMotionPolicy } from '../../lib/motion-policy';
|
|
13
|
+
import { useTapOnly } from '../../lib/tap-only';
|
|
11
14
|
import { useFrostedSurface, useFrostedBackdrop, } from '../../lib/frosted-surface';
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
});
|
|
31
|
-
const {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const frostedInset = frosted ? visual.drawerFrostedInset : 0;
|
|
36
|
-
const cornerRadius = frosted ? visual.drawerFrostedRadius : 0;
|
|
37
|
-
const useFloatingFrostedDrawer = frosted && frostedInset > 0;
|
|
38
|
-
const contentTopPadding = insets.top + visual.drawerContentTopPadding;
|
|
15
|
+
function DrawerItemRow({ item, active, onSelect, interaction, visual }) {
|
|
16
|
+
const handlePress = React.useCallback(() => onSelect(item.key), [item.key, onSelect]);
|
|
17
|
+
const pressStyle = React.useMemo(() => withInteractivePressableStyle({
|
|
18
|
+
borderRadius: visual.radiusLg,
|
|
19
|
+
paddingHorizontal: visual.controlPaddingXDefault,
|
|
20
|
+
paddingVertical: visual.controlPaddingYDefault,
|
|
21
|
+
minHeight: visual.touchTargetMinSize,
|
|
22
|
+
}, interaction, { pressedVariant: 'default' }), [interaction, visual]);
|
|
23
|
+
return (_jsxs(Pressable, { accessibilityRole: "button", onPress: handlePress, className: cn('flex-row items-center gap-3 mx-1 transition-colors', active && 'bg-primary-soft-subtle'), style: pressStyle, children: [item.icon, _jsx(Text, { className: cn('flex-1 font-semibold tracking-tight', item.destructive ? 'text-destructive' : active ? 'text-primary' : 'text-foreground'), style: { fontSize: visual.drawerItemFontSize }, children: item.label }), item.badge === undefined ? null : (_jsx(View, { className: "bg-primary px-2 py-0.5 items-center", style: { minWidth: visual.drawerBadgeMinWidth, borderRadius: visual.badgeRadius }, children: _jsx(Text, { className: "font-semibold text-primary-foreground", style: { fontSize: visual.navItemBadgeFontSize }, children: item.badge }) }))] }));
|
|
24
|
+
}
|
|
25
|
+
function DrawerSectionGap() {
|
|
26
|
+
return _jsx(View, { className: "mb-4" });
|
|
27
|
+
}
|
|
28
|
+
function DrawerItemGap() {
|
|
29
|
+
return _jsx(View, { className: "h-0.5" });
|
|
30
|
+
}
|
|
31
|
+
function DrawerSectionList({ sections, activeKey, onSelect, interaction, visual, }) {
|
|
32
|
+
const data = React.useMemo(() => sections.map((section) => ({ title: section.title, data: section.items })), [sections]);
|
|
33
|
+
const renderItem = React.useCallback(({ item }) => (_jsx(DrawerItemRow, { item: item, active: activeKey === item.key, onSelect: onSelect, interaction: interaction, visual: visual })), [activeKey, interaction, onSelect, visual]);
|
|
34
|
+
const renderSectionHeader = React.useCallback(({ section }) => section.title ? (_jsx(Text, { accessibilityRole: "header", className: "font-medium text-muted-foreground uppercase tracking-wide px-3 mb-2", style: { fontSize: visual.navSectionTitleFontSize }, children: section.title })) : null, [visual.navSectionTitleFontSize]);
|
|
35
|
+
return (_jsx(SectionList, { sections: data, keyExtractor: (item) => item.key, className: "flex-1 px-3", keyboardShouldPersistTaps: "handled", showsVerticalScrollIndicator: false, renderSectionHeader: renderSectionHeader, renderSectionFooter: DrawerSectionGap, ItemSeparatorComponent: DrawerItemGap, renderItem: renderItem }));
|
|
36
|
+
}
|
|
37
|
+
function useDrawerAnimation({ visible, drawerWidth, interaction, motion }) {
|
|
39
38
|
const progress = useSharedValue(0);
|
|
40
39
|
const [mounted, setMounted] = React.useState(visible);
|
|
41
40
|
const closeTimerRef = React.useRef(null);
|
|
42
|
-
React.
|
|
41
|
+
const [prevVisible, setPrevVisible] = React.useState(visible);
|
|
42
|
+
// Open in the prop-change render so the first animation frame has a mounted panel;
|
|
43
|
+
// closing stays mounted on the timer until the exit animation finishes.
|
|
44
|
+
if (prevVisible !== visible) {
|
|
45
|
+
setPrevVisible(visible);
|
|
43
46
|
if (visible)
|
|
44
47
|
setMounted(true);
|
|
45
|
-
}
|
|
48
|
+
}
|
|
46
49
|
React.useEffect(() => {
|
|
47
50
|
if (!mounted)
|
|
48
51
|
return;
|
|
@@ -50,16 +53,18 @@ export function DrawerMenu({ visible, onClose, sections, activeKey, onSelect, he
|
|
|
50
53
|
clearTimeout(closeTimerRef.current);
|
|
51
54
|
closeTimerRef.current = null;
|
|
52
55
|
}
|
|
56
|
+
const duration = motion.reduceMotion || !motion.animationsEnabled
|
|
57
|
+
? 0
|
|
58
|
+
: visible
|
|
59
|
+
? interaction.drawerOpenDuration
|
|
60
|
+
: interaction.drawerCloseDuration;
|
|
53
61
|
progress.value = withTiming(visible ? 1 : 0, {
|
|
54
|
-
duration
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
: Easing.bezier(0.4, 0, 1, 1), // Accelerating, sharp exit
|
|
62
|
+
duration,
|
|
63
|
+
reduceMotion: motion.reanimatedReduceMotion,
|
|
64
|
+
easing: visible ? Easing.bezier(0.2, 0.8, 0.2, 1) : Easing.bezier(0.4, 0, 1, 1),
|
|
58
65
|
});
|
|
59
66
|
if (!visible) {
|
|
60
|
-
closeTimerRef.current = setTimeout(() =>
|
|
61
|
-
setMounted(false);
|
|
62
|
-
}, interaction.drawerCloseDuration);
|
|
67
|
+
closeTimerRef.current = setTimeout(() => setMounted(false), duration);
|
|
63
68
|
}
|
|
64
69
|
return () => {
|
|
65
70
|
if (closeTimerRef.current) {
|
|
@@ -67,55 +72,103 @@ export function DrawerMenu({ visible, onClose, sections, activeKey, onSelect, he
|
|
|
67
72
|
closeTimerRef.current = null;
|
|
68
73
|
}
|
|
69
74
|
};
|
|
70
|
-
}, [
|
|
75
|
+
}, [
|
|
76
|
+
mounted,
|
|
77
|
+
visible,
|
|
78
|
+
progress,
|
|
79
|
+
interaction.drawerOpenDuration,
|
|
80
|
+
interaction.drawerCloseDuration,
|
|
81
|
+
motion.animationsEnabled,
|
|
82
|
+
motion.reduceMotion,
|
|
83
|
+
motion.reanimatedReduceMotion,
|
|
84
|
+
]);
|
|
71
85
|
const backdropStyle = useAnimatedStyle(() => ({
|
|
72
86
|
opacity: progress.value,
|
|
73
87
|
pointerEvents: progress.value > 0 ? 'auto' : 'none',
|
|
74
88
|
}));
|
|
89
|
+
// RN mirrors the anchored edge in RTL, so the off-screen translation mirrors too.
|
|
90
|
+
const offscreenX = I18nManager.isRTL ? drawerWidth : -drawerWidth;
|
|
75
91
|
const drawerStyle = useAnimatedStyle(() => ({
|
|
76
|
-
transform: [{ translateX: interpolate(progress.value, [0, 1], [
|
|
92
|
+
transform: [{ translateX: interpolate(progress.value, [0, 1], [offscreenX, 0]) }],
|
|
77
93
|
}));
|
|
78
94
|
const containerStyle = useAnimatedStyle(() => ({
|
|
79
95
|
pointerEvents: progress.value > 0 ? 'auto' : 'none',
|
|
80
96
|
}));
|
|
81
|
-
|
|
97
|
+
return { mounted, backdropStyle, drawerStyle, containerStyle };
|
|
98
|
+
}
|
|
99
|
+
function resolveDrawerLayout(screenWidth, maxWidth, frosted, visual) {
|
|
100
|
+
const rawWidth = screenWidth * visual.drawerWidthRatio;
|
|
101
|
+
const effectiveMaxWidth = maxWidth ?? (Platform.OS === 'web' ? visual.drawerMaxWidthWeb : undefined);
|
|
102
|
+
const width = effectiveMaxWidth == null ? rawWidth : Math.min(rawWidth, effectiveMaxWidth);
|
|
103
|
+
const inset = frosted ? visual.drawerFrostedInset : 0;
|
|
104
|
+
const radius = frosted ? visual.drawerFrostedRadius : surfaceRadius(visual, 'xl');
|
|
105
|
+
return { width, inset, radius, floating: frosted && inset > 0 };
|
|
106
|
+
}
|
|
107
|
+
function resolveBackdropBlur(blurIntensity, scale) {
|
|
108
|
+
return typeof blurIntensity === 'number' && Number.isFinite(blurIntensity)
|
|
109
|
+
? blurIntensity * scale
|
|
110
|
+
: undefined;
|
|
111
|
+
}
|
|
112
|
+
function drawerPanelClassName(frosted, className) {
|
|
113
|
+
return cn(frosted
|
|
114
|
+
? 'border border-border relative overflow-hidden'
|
|
115
|
+
: 'border-r border-border relative overflow-hidden', frosted ? 'bg-transparent' : 'bg-background', className);
|
|
116
|
+
}
|
|
117
|
+
export function DrawerMenu({ visible, onClose, sections, activeKey, onSelect, header, footer, maxWidth, className, style, frosted = false, blurIntensity, blurTintToken, }) {
|
|
118
|
+
const insets = useSafeAreaInsets();
|
|
119
|
+
const colors = useThemeColors();
|
|
120
|
+
const interaction = useInteractionTokens();
|
|
121
|
+
const visual = useVisualTokens();
|
|
122
|
+
const motion = useMotionPolicy();
|
|
123
|
+
const backdropPress = useTapOnly(onClose);
|
|
124
|
+
const frostedSurface = useFrostedSurface({
|
|
125
|
+
frosted,
|
|
126
|
+
blurIntensity,
|
|
127
|
+
blurTintToken,
|
|
128
|
+
defaultTintToken: 'surfaceTranslucent',
|
|
129
|
+
defaultBlurPreset: 'medium',
|
|
130
|
+
});
|
|
131
|
+
const frostedBackdrop = useFrostedBackdrop({
|
|
132
|
+
frosted,
|
|
133
|
+
blurIntensity: resolveBackdropBlur(blurIntensity, visual.frostedBackdropBlurScale),
|
|
134
|
+
tintColor: colors.overlay,
|
|
135
|
+
});
|
|
136
|
+
const { width: screenWidth } = useWindowDimensions();
|
|
137
|
+
const layout = resolveDrawerLayout(screenWidth, maxWidth, frosted, visual);
|
|
138
|
+
const contentTopPadding = insets.top + visual.drawerContentTopPadding;
|
|
139
|
+
const { mounted, backdropStyle, drawerStyle, containerStyle } = useDrawerAnimation({
|
|
140
|
+
visible,
|
|
141
|
+
drawerWidth: layout.width,
|
|
142
|
+
interaction,
|
|
143
|
+
motion,
|
|
144
|
+
});
|
|
145
|
+
const handleItemPress = React.useCallback((key) => {
|
|
82
146
|
onSelect?.(key);
|
|
83
|
-
};
|
|
147
|
+
}, [onSelect]);
|
|
84
148
|
if (!mounted)
|
|
85
149
|
return null;
|
|
86
150
|
const drawerTree = (_jsxs(Animated.View, { style: [StyleSheet.absoluteFill, containerStyle], children: [_jsxs(Animated.View, { style: [
|
|
87
151
|
StyleSheet.absoluteFill,
|
|
88
152
|
{ backgroundColor: frosted ? 'transparent' : colors.overlayStrong },
|
|
89
153
|
backdropStyle,
|
|
90
|
-
], children: [frostedBackdrop, _jsx(Pressable, { style: StyleSheet.absoluteFill,
|
|
154
|
+
], children: [frostedBackdrop, _jsx(Pressable, { accessible: false, importantForAccessibility: "no", style: StyleSheet.absoluteFill, ...backdropPress })] }), _jsxs(Animated.View, { style: [
|
|
91
155
|
{
|
|
92
156
|
position: 'absolute',
|
|
93
|
-
top:
|
|
94
|
-
bottom:
|
|
95
|
-
left:
|
|
96
|
-
width: Math.max(
|
|
97
|
-
borderTopRightRadius:
|
|
98
|
-
borderBottomRightRadius:
|
|
99
|
-
borderTopLeftRadius:
|
|
100
|
-
borderBottomLeftRadius:
|
|
157
|
+
top: layout.inset,
|
|
158
|
+
bottom: layout.inset,
|
|
159
|
+
left: layout.inset,
|
|
160
|
+
width: Math.max(layout.width - layout.inset, 0),
|
|
161
|
+
borderTopRightRadius: layout.radius,
|
|
162
|
+
borderBottomRightRadius: layout.radius,
|
|
163
|
+
borderTopLeftRadius: layout.floating ? layout.radius : 0,
|
|
164
|
+
borderBottomLeftRadius: layout.floating ? layout.radius : 0,
|
|
101
165
|
},
|
|
166
|
+
shadowStyle(visual, colors, frosted ? 'lg' : 'md'),
|
|
102
167
|
drawerStyle,
|
|
103
168
|
frostedSurface.surfaceStyle,
|
|
104
169
|
style,
|
|
105
|
-
], className:
|
|
106
|
-
? 'border border-border shadow-xl relative overflow-hidden'
|
|
107
|
-
: 'border-r border-border rounded-r-2xl shadow-lg relative overflow-hidden', frosted ? 'bg-transparent' : 'bg-background', className), children: [frostedSurface.overlay, _jsxs(View, { className: "flex-1 pb-8", style: { paddingTop: contentTopPadding }, children: [header && _jsx(View, { className: "px-5 pb-4 mb-2 border-b border-border", children: header }), _jsx(View, { className: "flex-1 px-3", children: sections.map((section, sectionIndex) => (_jsxs(View, { className: "mb-4", children: [section.title && (_jsx(Text, { className: "font-medium text-muted-foreground uppercase tracking-wide px-3 mb-2", style: { fontSize: visual.navSectionTitleFontSize }, children: section.title })), _jsx(View, { className: "gap-0.5", children: section.items.map((item) => {
|
|
108
|
-
const isActive = activeKey === item.key;
|
|
109
|
-
return (_jsxs(Pressable, { onPress: () => handleItemPress(item.key), className: cn('flex-row items-center gap-3 px-4 py-3 mx-1 rounded-xl transition-colors', isActive && 'bg-primary-soft-subtle'), style: withInteractivePressableStyle(undefined, interaction, {
|
|
110
|
-
pressedVariant: 'default',
|
|
111
|
-
}), children: [item.icon, _jsx(Text, { className: cn('flex-1 font-semibold tracking-tight', item.destructive
|
|
112
|
-
? 'text-destructive'
|
|
113
|
-
: isActive
|
|
114
|
-
? 'text-primary'
|
|
115
|
-
: 'text-foreground'), style: { fontSize: visual.drawerItemFontSize }, children: item.label }), item.badge !== undefined && (_jsx(View, { className: "bg-primary px-2 py-0.5 rounded-full items-center", style: { minWidth: visual.drawerBadgeMinWidth }, children: _jsx(Text, { className: "font-semibold text-primary-foreground", style: { fontSize: visual.navItemBadgeFontSize }, children: item.badge }) }))] }, item.key));
|
|
116
|
-
}) })] }, sectionIndex))) }), footer && _jsx(View, { className: "px-5 py-4 mt-auto border-t border-border", children: footer })] })] })] }));
|
|
170
|
+
], className: drawerPanelClassName(frosted, className), children: [frostedSurface.overlay, _jsxs(View, { className: "flex-1 pb-8", style: { paddingTop: contentTopPadding }, children: [header && _jsx(View, { className: "px-5 pb-4 mb-2 border-b border-border", children: header }), _jsx(DrawerSectionList, { sections: sections, activeKey: activeKey, onSelect: handleItemPress, interaction: interaction, visual: visual }), footer && _jsx(View, { className: "px-5 py-4 mt-auto border-t border-border", children: footer })] })] })] }));
|
|
117
171
|
if (Platform.OS !== 'android')
|
|
118
172
|
return drawerTree;
|
|
119
|
-
return (_jsx(Modal, { visible: mounted, transparent: true, animationType: "none", onRequestClose: onClose, statusBarTranslucent: true, presentationStyle: "overFullScreen", children: drawerTree }));
|
|
173
|
+
return (_jsx(Modal, { visible: mounted, transparent: true, animationType: "none", onRequestClose: onClose, statusBarTranslucent: true, navigationBarTranslucent: true, presentationStyle: "overFullScreen", children: drawerTree }));
|
|
120
174
|
}
|
|
121
|
-
//# sourceMappingURL=drawer-menu.js.map
|
|
@@ -14,5 +14,4 @@ export interface FloatingBottomNavItemProps extends Omit<PressableProps, 'childr
|
|
|
14
14
|
item: FloatingBottomNavItem;
|
|
15
15
|
isActive: boolean;
|
|
16
16
|
}
|
|
17
|
-
export declare function FloatingBottomNav({ items, activeKey, onSelect, className, ...props }: FloatingBottomNavProps):
|
|
18
|
-
//# sourceMappingURL=floating-bottom-nav.d.ts.map
|
|
17
|
+
export declare function FloatingBottomNav({ items, activeKey, onSelect, className, ...props }: FloatingBottomNavProps): React.JSX.Element;
|
|
@@ -2,12 +2,21 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { View, Pressable } from 'react-native';
|
|
3
3
|
import { Text } from '../../components/text';
|
|
4
4
|
import { cn } from '../../lib/cn';
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { useVisualTokens } from '../../lib/visual-tokens';
|
|
6
|
+
import { useThemeColors } from '../../lib/theme-colors';
|
|
7
|
+
import { shadowStyle, surfaceRadius, typographyStyle } from '../../lib/recipes';
|
|
8
|
+
function FloatingNavItem({ item, isActive, className, style: styleProp, ...props }) {
|
|
7
9
|
const { label, icon } = item;
|
|
8
|
-
|
|
10
|
+
const visual = useVisualTokens();
|
|
11
|
+
const pillStyle = {
|
|
12
|
+
borderRadius: visual.badgeRadius,
|
|
13
|
+
paddingHorizontal: visual.controlPaddingXDefault,
|
|
14
|
+
paddingVertical: visual.controlPaddingYSm,
|
|
15
|
+
};
|
|
16
|
+
return (_jsxs(Pressable, { accessibilityRole: "tab", accessibilityState: { selected: isActive }, "aria-selected": isActive, className: cn('flex-row items-center gap-2 active:scale-95', isActive && 'bg-primary', className), style: (state) => [pillStyle, typeof styleProp === 'function' ? styleProp(state) : styleProp], ...props, children: [_jsx(View, { className: cn(isActive ? 'text-primary-foreground' : 'text-muted-foreground'), children: icon }), isActive && (_jsx(Text, { className: "font-semibold text-primary-foreground", style: typographyStyle(visual, 'label'), children: label }))] }));
|
|
9
17
|
}
|
|
10
18
|
export function FloatingBottomNav({ items, activeKey, onSelect, className, ...props }) {
|
|
11
|
-
|
|
19
|
+
const visual = useVisualTokens();
|
|
20
|
+
const colors = useThemeColors();
|
|
21
|
+
return (_jsx(View, { className: cn('items-center pb-8', className), ...props, children: _jsx(View, { accessibilityRole: "tablist", className: "flex-row items-center gap-1 bg-card p-1.5", style: [{ borderRadius: surfaceRadius(visual, 'xl') }, shadowStyle(visual, colors, 'md')], children: items.map((item) => (_jsx(FloatingNavItem, { item: item, isActive: activeKey === item.key, onPress: () => onSelect(item.key) }, item.key))) }) }));
|
|
12
22
|
}
|
|
13
|
-
//# sourceMappingURL=floating-bottom-nav.js.map
|
|
@@ -14,10 +14,9 @@ export interface HeaderProps extends ViewProps {
|
|
|
14
14
|
transparent?: boolean;
|
|
15
15
|
border?: boolean;
|
|
16
16
|
}
|
|
17
|
-
export declare function Header({ title, subtitle, leftAction, rightActions, centerContent, transparent, border, className, ...props }: HeaderProps):
|
|
17
|
+
export declare function Header({ title, subtitle, leftAction, rightActions, centerContent, transparent, border, className, style, ...props }: HeaderProps): React.JSX.Element;
|
|
18
18
|
export interface HeaderBackButtonProps extends Omit<PressableProps, 'children'> {
|
|
19
19
|
icon?: React.ReactNode;
|
|
20
20
|
label?: string;
|
|
21
21
|
}
|
|
22
|
-
export declare function HeaderBackButton({ icon, label, className, style: styleProp, ...props }: HeaderBackButtonProps):
|
|
23
|
-
//# sourceMappingURL=header.d.ts.map
|
|
22
|
+
export declare function HeaderBackButton({ icon, label, className, style: styleProp, ...props }: HeaderBackButtonProps): React.JSX.Element;
|
|
@@ -3,19 +3,27 @@ import { View, Pressable } from 'react-native';
|
|
|
3
3
|
import { Text } from '../../components/text';
|
|
4
4
|
import { cn } from '../../lib/cn';
|
|
5
5
|
import { useInteractionTokens, withInteractivePressableStyle } from '../../lib/interaction-tokens';
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import { useVisualTokens } from '../../lib/visual-tokens';
|
|
7
|
+
import { typographyStyle } from '../../lib/recipes';
|
|
8
|
+
export function Header({ title, subtitle, leftAction, rightActions, centerContent, transparent = false, border = true, className, style, ...props }) {
|
|
8
9
|
const interaction = useInteractionTokens();
|
|
9
|
-
|
|
10
|
+
const visual = useVisualTokens();
|
|
11
|
+
return (_jsxs(View, { className: cn('flex-row items-center', !transparent && 'bg-background', border && 'border-b border-border', className), style: [
|
|
12
|
+
{
|
|
13
|
+
paddingHorizontal: visual.controlPaddingXDefault,
|
|
14
|
+
paddingVertical: visual.controlPaddingYDefault,
|
|
15
|
+
},
|
|
16
|
+
style,
|
|
17
|
+
], ...props, children: [_jsx(View, { className: "min-w-12", children: leftAction }), _jsx(View, { className: "flex-1 items-center", children: centerContent || (_jsxs(View, { className: "items-center", children: [title && (_jsx(Text, { className: "font-semibold text-foreground", style: typographyStyle(visual, 'body'), numberOfLines: 1, children: title })), subtitle && (_jsx(Text, { className: "text-muted-foreground", style: typographyStyle(visual, 'caption'), numberOfLines: 1, children: subtitle }))] })) }), _jsx(View, { className: "min-w-12 flex-row items-center justify-end gap-2", children: rightActions?.map((action) => (_jsx(Pressable, { accessibilityRole: "button", onPress: action.onPress, className: "rounded-full p-2 active:bg-accent", style: withInteractivePressableStyle(undefined, interaction, {
|
|
10
18
|
pressedVariant: 'default',
|
|
11
19
|
}), children: action.icon }, action.key))) })] }));
|
|
12
20
|
}
|
|
13
21
|
export function HeaderBackButton({ icon, label, className, style: styleProp, ...props }) {
|
|
14
22
|
const interaction = useInteractionTokens();
|
|
23
|
+
const visual = useVisualTokens();
|
|
15
24
|
const interactiveStyle = withInteractivePressableStyle(styleProp, interaction, {
|
|
16
25
|
disabled: Boolean(props.disabled),
|
|
17
26
|
pressedVariant: 'default',
|
|
18
27
|
});
|
|
19
|
-
return (_jsxs(Pressable, { className: cn('flex-row items-center gap-1 rounded-full py-1', className), style: interactiveStyle, ...props, children: [icon || _jsx(Text, { className: "text-
|
|
28
|
+
return (_jsxs(Pressable, { className: cn('flex-row items-center gap-1 rounded-full py-1', className), style: interactiveStyle, ...props, children: [icon || (_jsx(Text, { className: "text-primary", style: typographyStyle(visual, 'title'), children: "\u2039" })), label && (_jsx(Text, { className: "text-primary", style: typographyStyle(visual, 'body'), children: label }))] }));
|
|
20
29
|
}
|
|
21
|
-
//# sourceMappingURL=header.js.map
|
|
@@ -3,5 +3,3 @@ export { FloatingBottomNav, type FloatingBottomNavItem, type FloatingBottomNavPr
|
|
|
3
3
|
export { Header, HeaderBackButton, type HeaderAction, type HeaderBackButtonProps, type HeaderProps, } from './header';
|
|
4
4
|
export { TabBar, type TabBarItem, type TabBarProps } from './tab-bar';
|
|
5
5
|
export { DrawerMenu, type DrawerMenuItem, type DrawerMenuSection, type DrawerMenuProps, } from './drawer-menu';
|
|
6
|
-
export { NavigationSidebar, type NavigationSidebarItem, type NavigationSidebarSection, type NavigationSidebarProps, } from './navigation-sidebar';
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -3,5 +3,3 @@ export { FloatingBottomNav, } from './floating-bottom-nav';
|
|
|
3
3
|
export { Header, HeaderBackButton, } from './header';
|
|
4
4
|
export { TabBar } from './tab-bar';
|
|
5
5
|
export { DrawerMenu, } from './drawer-menu';
|
|
6
|
-
export { NavigationSidebar, } from './navigation-sidebar';
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -17,5 +17,4 @@ export interface TabBarItemProps extends Omit<PressableProps, 'children'> {
|
|
|
17
17
|
isActive: boolean;
|
|
18
18
|
variant: 'default' | 'pills' | 'underline';
|
|
19
19
|
}
|
|
20
|
-
export declare function TabBar({ items, activeKey, onSelect, variant, scrollable, className, ...props }: TabBarProps):
|
|
21
|
-
//# sourceMappingURL=tab-bar.d.ts.map
|
|
20
|
+
export declare function TabBar({ items, activeKey, onSelect, variant, scrollable, className, style, ...props }: TabBarProps): React.JSX.Element;
|
|
@@ -3,32 +3,44 @@ import { View, Pressable, ScrollView } from 'react-native';
|
|
|
3
3
|
import { Text } from '../../components/text';
|
|
4
4
|
import { cn } from '../../lib/cn';
|
|
5
5
|
import { useInteractionTokens, withInteractivePressableStyle } from '../../lib/interaction-tokens';
|
|
6
|
-
|
|
6
|
+
import { useVisualTokens } from '../../lib/visual-tokens';
|
|
7
|
+
import { typographyStyle } from '../../lib/recipes';
|
|
7
8
|
function TabBarItemComponent({ item, isActive, variant, className, style: styleProp, ...props }) {
|
|
8
9
|
const { label, icon } = item;
|
|
9
10
|
const interaction = useInteractionTokens();
|
|
11
|
+
const visual = useVisualTokens();
|
|
12
|
+
const showUnderline = variant === 'default' || (variant === 'underline' && isActive);
|
|
13
|
+
const tokenStyle = {
|
|
14
|
+
paddingHorizontal: visual.controlPaddingXDefault,
|
|
15
|
+
paddingVertical: visual.controlPaddingYSm,
|
|
16
|
+
...(variant === 'pills' ? { borderRadius: visual.badgeRadius } : null),
|
|
17
|
+
...(showUnderline ? { borderBottomWidth: visual.borderWidthEmphasis } : null),
|
|
18
|
+
};
|
|
10
19
|
const interactiveStyle = withInteractivePressableStyle(styleProp, interaction, {
|
|
11
20
|
disabled: Boolean(props.disabled),
|
|
12
21
|
pressedVariant: 'default',
|
|
13
22
|
});
|
|
14
|
-
const baseStyles = 'flex-row items-center justify-center gap-2
|
|
23
|
+
const baseStyles = 'flex-row items-center justify-center gap-2';
|
|
15
24
|
const variantStyles = {
|
|
16
|
-
default: isActive ? 'border-
|
|
17
|
-
pills: isActive ? 'bg-primary
|
|
18
|
-
underline: isActive ? 'border-
|
|
25
|
+
default: isActive ? 'border-primary' : 'border-transparent',
|
|
26
|
+
pills: isActive ? 'bg-primary' : '',
|
|
27
|
+
underline: isActive ? 'border-primary' : '',
|
|
19
28
|
};
|
|
20
29
|
const textStyles = {
|
|
21
30
|
default: isActive ? 'text-primary font-medium' : 'text-muted-foreground font-medium',
|
|
22
31
|
pills: isActive ? 'text-primary-foreground font-medium' : 'text-muted-foreground font-medium',
|
|
23
32
|
underline: isActive ? 'text-foreground font-medium' : 'text-muted-foreground font-medium',
|
|
24
33
|
};
|
|
25
|
-
return (_jsxs(Pressable, {
|
|
34
|
+
return (_jsxs(Pressable, { accessibilityRole: "tab", accessibilityState: { selected: isActive }, "aria-selected": isActive, className: cn(baseStyles, variantStyles[variant], className), style: (state) => [
|
|
35
|
+
tokenStyle,
|
|
36
|
+
typeof interactiveStyle === 'function' ? interactiveStyle(state) : interactiveStyle,
|
|
37
|
+
], ...props, children: [icon && (_jsx(View, { className: isActive && variant === 'pills' ? 'text-primary-foreground' : '', children: icon })), _jsx(Text, { className: cn(textStyles[variant]), style: typographyStyle(visual, 'label'), children: label })] }));
|
|
26
38
|
}
|
|
27
|
-
export function TabBar({ items, activeKey, onSelect, variant = 'default', scrollable = false, className, ...props }) {
|
|
28
|
-
const
|
|
39
|
+
export function TabBar({ items, activeKey, onSelect, variant = 'default', scrollable = false, className, style, ...props }) {
|
|
40
|
+
const visual = useVisualTokens();
|
|
41
|
+
const content = (_jsx(View, { accessibilityRole: "tablist", className: cn('flex-row', variant === 'pills' && 'gap-1 bg-muted p-1', variant === 'default' && 'border-b border-border', !scrollable && 'justify-around', className), style: [variant === 'pills' ? { borderRadius: visual.badgeRadius } : null, style], ...props, children: items.map((item) => (_jsx(TabBarItemComponent, { item: item, isActive: activeKey === item.key, variant: variant, onPress: () => onSelect(item.key) }, item.key))) }));
|
|
29
42
|
if (scrollable) {
|
|
30
|
-
return (_jsx(ScrollView, { horizontal: true, showsHorizontalScrollIndicator: false, contentContainerStyle: { paddingHorizontal:
|
|
43
|
+
return (_jsx(ScrollView, { horizontal: true, showsHorizontalScrollIndicator: false, contentContainerStyle: { paddingHorizontal: visual.surfacePaddingSm }, children: content }));
|
|
31
44
|
}
|
|
32
45
|
return content;
|
|
33
46
|
}
|
|
34
|
-
//# sourceMappingURL=tab-bar.js.map
|
|
@@ -17,13 +17,12 @@ export interface SplashScreenProps extends ViewProps {
|
|
|
17
17
|
/** Loading text */
|
|
18
18
|
loadingText?: string;
|
|
19
19
|
}
|
|
20
|
-
export declare function SplashScreen({ appName, tagline, logo, variant, duration, onAnimationComplete, showLoading, loadingText, className, ...props }: SplashScreenProps): import("react
|
|
20
|
+
export declare function SplashScreen({ appName, tagline, logo, variant, duration, onAnimationComplete, showLoading, loadingText, className, ...props }: SplashScreenProps): import("react").JSX.Element;
|
|
21
21
|
export interface MinimalSplashProps extends Omit<SplashScreenProps, 'variant'> {
|
|
22
22
|
}
|
|
23
23
|
/** Minimal splash with just logo and name */
|
|
24
|
-
export declare function MinimalSplash(props: MinimalSplashProps): import("react
|
|
24
|
+
export declare function MinimalSplash(props: MinimalSplashProps): import("react").JSX.Element;
|
|
25
25
|
export interface BrandedSplashProps extends Omit<SplashScreenProps, 'variant' | 'showLoading'> {
|
|
26
26
|
}
|
|
27
27
|
/** Branded splash with scale animation and loading */
|
|
28
|
-
export declare function BrandedSplash(props: BrandedSplashProps): import("react
|
|
29
|
-
//# sourceMappingURL=splash-screen.d.ts.map
|
|
28
|
+
export declare function BrandedSplash(props: BrandedSplashProps): import("react").JSX.Element;
|
|
@@ -4,31 +4,29 @@ import { View } from 'react-native';
|
|
|
4
4
|
import Animated, { useSharedValue, useAnimatedStyle, withTiming, withDelay, withRepeat, withSequence, Easing, } from 'react-native-reanimated';
|
|
5
5
|
import { Text } from '../../components/text';
|
|
6
6
|
import { cn } from '../../lib/cn';
|
|
7
|
-
|
|
7
|
+
import { useVisualTokens } from '../../lib/visual-tokens';
|
|
8
|
+
import { typographyStyle } from '../../lib/recipes';
|
|
8
9
|
const AnimatedView = Animated.createAnimatedComponent(View);
|
|
9
|
-
// ─── Loading Dot Component ───────────────────────────────────
|
|
10
10
|
function LoadingDot({ delay }) {
|
|
11
11
|
const scale = useSharedValue(0.6);
|
|
12
12
|
const opacity = useSharedValue(0.3);
|
|
13
13
|
useEffect(() => {
|
|
14
14
|
scale.value = withDelay(delay, withRepeat(withSequence(withTiming(1, { duration: 400, easing: Easing.out(Easing.cubic) }), withTiming(0.6, { duration: 400, easing: Easing.in(Easing.cubic) })), -1, false));
|
|
15
15
|
opacity.value = withDelay(delay, withRepeat(withSequence(withTiming(1, { duration: 400, easing: Easing.out(Easing.cubic) }), withTiming(0.3, { duration: 400, easing: Easing.in(Easing.cubic) })), -1, false));
|
|
16
|
-
}, [delay]);
|
|
16
|
+
}, [delay, opacity, scale]);
|
|
17
17
|
const animatedStyle = useAnimatedStyle(() => ({
|
|
18
18
|
transform: [{ scale: scale.value }],
|
|
19
19
|
opacity: opacity.value,
|
|
20
20
|
}));
|
|
21
21
|
return (_jsx(AnimatedView, { style: animatedStyle, className: "h-2 w-2 rounded-full bg-muted-foreground" }));
|
|
22
22
|
}
|
|
23
|
-
// ─── Component ───────────────────────────────────────────────
|
|
24
23
|
export function SplashScreen({ appName, tagline, logo, variant = 'scale', duration = 800, onAnimationComplete, showLoading = false, loadingText, className, ...props }) {
|
|
25
|
-
|
|
24
|
+
const visual = useVisualTokens();
|
|
26
25
|
const opacity = useSharedValue(0);
|
|
27
26
|
const scale = useSharedValue(variant === 'scale' ? 0.8 : 1);
|
|
28
27
|
const translateY = useSharedValue(variant === 'slide' ? 30 : 0);
|
|
29
28
|
const loadingOpacity = useSharedValue(0);
|
|
30
29
|
useEffect(() => {
|
|
31
|
-
// Main content animation
|
|
32
30
|
opacity.value = withTiming(1, {
|
|
33
31
|
duration: duration * 0.6,
|
|
34
32
|
easing: Easing.out(Easing.cubic),
|
|
@@ -45,16 +43,23 @@ export function SplashScreen({ appName, tagline, logo, variant = 'scale', durati
|
|
|
45
43
|
easing: Easing.out(Easing.cubic),
|
|
46
44
|
});
|
|
47
45
|
}
|
|
48
|
-
// Loading indicator fade in
|
|
49
46
|
if (showLoading) {
|
|
50
47
|
loadingOpacity.value = withDelay(duration * 0.5, withTiming(1, { duration: 400 }));
|
|
51
48
|
}
|
|
52
|
-
// Callback after animation
|
|
53
49
|
if (onAnimationComplete) {
|
|
54
50
|
const timer = setTimeout(onAnimationComplete, duration);
|
|
55
51
|
return () => clearTimeout(timer);
|
|
56
52
|
}
|
|
57
|
-
}, [
|
|
53
|
+
}, [
|
|
54
|
+
duration,
|
|
55
|
+
loadingOpacity,
|
|
56
|
+
onAnimationComplete,
|
|
57
|
+
opacity,
|
|
58
|
+
scale,
|
|
59
|
+
showLoading,
|
|
60
|
+
translateY,
|
|
61
|
+
variant,
|
|
62
|
+
]);
|
|
58
63
|
const containerStyle = useAnimatedStyle(() => ({
|
|
59
64
|
opacity: opacity.value,
|
|
60
65
|
transform: [{ scale: scale.value }, { translateY: translateY.value }],
|
|
@@ -62,7 +67,7 @@ export function SplashScreen({ appName, tagline, logo, variant = 'scale', durati
|
|
|
62
67
|
const loadingStyle = useAnimatedStyle(() => ({
|
|
63
68
|
opacity: loadingOpacity.value,
|
|
64
69
|
}));
|
|
65
|
-
return (_jsxs(View, { className: cn('flex-1 items-center justify-center bg-background', className), ...props, children: [_jsxs(AnimatedView, { style: containerStyle, className: "items-center", children: [logo && _jsx(View, { className: "mb-6", children: logo }), appName && (_jsx(Text, { className: "text-4xl font-bold text-foreground tracking-tight", children: appName })), tagline && (_jsx(Text, { className: "mt-2 text-
|
|
70
|
+
return (_jsxs(View, { className: cn('flex-1 items-center justify-center bg-background', className), ...props, children: [_jsxs(AnimatedView, { style: containerStyle, className: "items-center", children: [logo && _jsx(View, { className: "mb-6", children: logo }), appName && (_jsx(Text, { className: "text-4xl font-bold text-foreground tracking-tight", children: appName })), tagline && (_jsx(Text, { className: "mt-2 text-muted-foreground text-center px-8", style: typographyStyle(visual, 'body'), children: tagline }))] }), showLoading && (_jsxs(AnimatedView, { style: loadingStyle, className: "absolute bottom-20 items-center", children: [_jsxs(View, { className: "flex-row items-center gap-2", children: [_jsx(LoadingDot, { delay: 0 }), _jsx(LoadingDot, { delay: 150 }), _jsx(LoadingDot, { delay: 300 })] }), loadingText && (_jsx(Text, { className: "mt-3 text-muted-foreground", style: typographyStyle(visual, 'label'), children: loadingText }))] }))] }));
|
|
66
71
|
}
|
|
67
72
|
/** Minimal splash with just logo and name */
|
|
68
73
|
export function MinimalSplash(props) {
|
|
@@ -72,4 +77,3 @@ export function MinimalSplash(props) {
|
|
|
72
77
|
export function BrandedSplash(props) {
|
|
73
78
|
return _jsx(SplashScreen, { variant: "scale", showLoading: true, ...props });
|
|
74
79
|
}
|
|
75
|
-
//# sourceMappingURL=splash-screen.js.map
|
|
@@ -18,21 +18,20 @@ export interface AccordionTriggerProps extends Omit<PressableProps, 'children'>
|
|
|
18
18
|
export interface AccordionContentProps extends ViewProps {
|
|
19
19
|
className?: string;
|
|
20
20
|
}
|
|
21
|
-
declare function Accordion({ type, defaultValue, collapsible, className, children, ...props }: AccordionProps):
|
|
21
|
+
declare function Accordion({ type, defaultValue, collapsible, className, children, ...props }: AccordionProps): React.JSX.Element;
|
|
22
22
|
declare namespace Accordion {
|
|
23
23
|
var displayName: string;
|
|
24
24
|
}
|
|
25
|
-
declare function AccordionItem({ value, className, children, ...props }: AccordionItemProps):
|
|
25
|
+
declare function AccordionItem({ value, className, children, ...props }: AccordionItemProps): React.JSX.Element;
|
|
26
26
|
declare namespace AccordionItem {
|
|
27
27
|
var displayName: string;
|
|
28
28
|
}
|
|
29
|
-
declare function AccordionTrigger({ className, children, style: styleProp, ...props }: AccordionTriggerProps):
|
|
29
|
+
declare function AccordionTrigger({ className, children, style: styleProp, ...props }: AccordionTriggerProps): React.JSX.Element;
|
|
30
30
|
declare namespace AccordionTrigger {
|
|
31
31
|
var displayName: string;
|
|
32
32
|
}
|
|
33
|
-
declare function AccordionContent({ className, children, ...props }: AccordionContentProps):
|
|
33
|
+
declare function AccordionContent({ className, children, ...props }: AccordionContentProps): React.JSX.Element | null;
|
|
34
34
|
declare namespace AccordionContent {
|
|
35
35
|
var displayName: string;
|
|
36
36
|
}
|
|
37
37
|
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
38
|
-
//# sourceMappingURL=accordion.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React, { createContext, useContext, useState, useCallback } from 'react';
|
|
2
|
+
import React, { createContext, useContext, useState, useCallback, useMemo } from 'react';
|
|
3
3
|
import { View, Pressable } from 'react-native';
|
|
4
4
|
import Animated, { useSharedValue, useAnimatedStyle, withTiming, Easing, } from 'react-native-reanimated';
|
|
5
5
|
import { cn } from '../../lib/cn';
|
|
@@ -14,7 +14,6 @@ const AccordionItemContext = createContext({
|
|
|
14
14
|
value: '',
|
|
15
15
|
isOpen: false,
|
|
16
16
|
});
|
|
17
|
-
// ─── Components ──────────────────────────────────────────────
|
|
18
17
|
function Accordion({ type = 'single', defaultValue, collapsible = true, className, children, ...props }) {
|
|
19
18
|
const [value, setValue] = useState(() => {
|
|
20
19
|
if (!defaultValue)
|
|
@@ -35,12 +34,14 @@ function Accordion({ type = 'single', defaultValue, collapsible = true, classNam
|
|
|
35
34
|
return [...prev, itemValue];
|
|
36
35
|
});
|
|
37
36
|
}, [type, collapsible]);
|
|
38
|
-
|
|
37
|
+
const contextValue = useMemo(() => ({ type, value, onValueChange, collapsible }), [collapsible, onValueChange, type, value]);
|
|
38
|
+
return (_jsx(AccordionContext.Provider, { value: contextValue, children: _jsx(View, { className: cn('w-full', className), ...props, children: children }) }));
|
|
39
39
|
}
|
|
40
40
|
function AccordionItem({ value, className, children, ...props }) {
|
|
41
41
|
const { value: selectedValues } = useContext(AccordionContext);
|
|
42
42
|
const isOpen = selectedValues.includes(value);
|
|
43
|
-
|
|
43
|
+
const contextValue = useMemo(() => ({ value, isOpen }), [isOpen, value]);
|
|
44
|
+
return (_jsx(AccordionItemContext.Provider, { value: contextValue, children: _jsx(View, { className: cn('border-b border-border', className), ...props, children: children }) }));
|
|
44
45
|
}
|
|
45
46
|
function AccordionTrigger({ className, children, style: styleProp, ...props }) {
|
|
46
47
|
const { onValueChange } = useContext(AccordionContext);
|
|
@@ -49,7 +50,7 @@ function AccordionTrigger({ className, children, style: styleProp, ...props }) {
|
|
|
49
50
|
const interactiveStyle = withInteractivePressableStyle(styleProp, interaction, {
|
|
50
51
|
pressedVariant: 'default',
|
|
51
52
|
});
|
|
52
|
-
return (_jsxs(Pressable, { className: cn('flex flex-row items-center justify-between py-4', className), onPress: () => onValueChange(value), style: interactiveStyle, ...props, children: [children, _jsx(View, { className: cn('border-foreground h-2 w-2 rotate-45 border-b-2 border-r-2 transition-transform', isOpen && 'rotate-[225deg]') })] }));
|
|
53
|
+
return (_jsxs(Pressable, { accessibilityRole: "button", className: cn('flex flex-row items-center justify-between py-4', className), onPress: () => onValueChange(value), style: interactiveStyle, ...props, children: [children, _jsx(View, { className: cn('border-foreground h-2 w-2 rotate-45 border-b-2 border-r-2 transition-transform', isOpen && 'rotate-[225deg]') })] }));
|
|
53
54
|
}
|
|
54
55
|
function AccordionContent({ className, children, ...props }) {
|
|
55
56
|
const { isOpen } = useContext(AccordionItemContext);
|
|
@@ -72,6 +73,4 @@ Accordion.displayName = 'Accordion';
|
|
|
72
73
|
AccordionItem.displayName = 'AccordionItem';
|
|
73
74
|
AccordionTrigger.displayName = 'AccordionTrigger';
|
|
74
75
|
AccordionContent.displayName = 'AccordionContent';
|
|
75
|
-
// ─── Exports ─────────────────────────────────────────────────
|
|
76
76
|
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
77
|
-
//# sourceMappingURL=accordion.js.map
|