@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,106 +1,51 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { type TextInputInstance, type TextInputProps } from 'react-native';
|
|
3
3
|
import { type VariantProps } from '../../lib/tv';
|
|
4
|
+
import type { ForwardRefComponent } from '../../lib/ref-types';
|
|
4
5
|
declare const numericInputVariants: import("tailwind-variants").TVReturnType<{
|
|
5
6
|
variant: {
|
|
6
|
-
default:
|
|
7
|
-
error:
|
|
7
|
+
default: "border-border";
|
|
8
|
+
error: "border-destructive";
|
|
8
9
|
};
|
|
9
10
|
size: {
|
|
10
|
-
default:
|
|
11
|
-
compact:
|
|
11
|
+
default: "";
|
|
12
|
+
compact: "";
|
|
12
13
|
};
|
|
13
|
-
}, undefined, "w-full flex-row items-center
|
|
14
|
+
}, undefined, "w-full flex-row items-center border-border bg-muted", {
|
|
14
15
|
variant: {
|
|
15
|
-
default:
|
|
16
|
-
error:
|
|
16
|
+
default: "border-border";
|
|
17
|
+
error: "border-destructive";
|
|
17
18
|
};
|
|
18
19
|
size: {
|
|
19
|
-
default:
|
|
20
|
-
compact:
|
|
20
|
+
default: "";
|
|
21
|
+
compact: "";
|
|
21
22
|
};
|
|
22
|
-
}, {
|
|
23
|
+
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
23
24
|
variant: {
|
|
24
|
-
default:
|
|
25
|
-
error:
|
|
25
|
+
default: "border-border";
|
|
26
|
+
error: "border-destructive";
|
|
26
27
|
};
|
|
27
28
|
size: {
|
|
28
|
-
default:
|
|
29
|
-
compact:
|
|
29
|
+
default: "";
|
|
30
|
+
compact: "";
|
|
30
31
|
};
|
|
31
|
-
}
|
|
32
|
-
variant: {
|
|
33
|
-
default: string;
|
|
34
|
-
error: string;
|
|
35
|
-
};
|
|
36
|
-
size: {
|
|
37
|
-
default: string;
|
|
38
|
-
compact: string;
|
|
39
|
-
};
|
|
40
|
-
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
41
|
-
variant: {
|
|
42
|
-
default: string;
|
|
43
|
-
error: string;
|
|
44
|
-
};
|
|
45
|
-
size: {
|
|
46
|
-
default: string;
|
|
47
|
-
compact: string;
|
|
48
|
-
};
|
|
49
|
-
}, undefined, "w-full flex-row items-center rounded-md border border-border bg-muted", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
50
|
-
variant: {
|
|
51
|
-
default: string;
|
|
52
|
-
error: string;
|
|
53
|
-
};
|
|
54
|
-
size: {
|
|
55
|
-
default: string;
|
|
56
|
-
compact: string;
|
|
57
|
-
};
|
|
58
|
-
}, {
|
|
59
|
-
variant: {
|
|
60
|
-
default: string;
|
|
61
|
-
error: string;
|
|
62
|
-
};
|
|
63
|
-
size: {
|
|
64
|
-
default: string;
|
|
65
|
-
compact: string;
|
|
66
|
-
};
|
|
67
|
-
}>, unknown, unknown, undefined>>;
|
|
32
|
+
}, undefined>>;
|
|
68
33
|
declare const numericInputTextVariants: import("tailwind-variants").TVReturnType<{
|
|
69
34
|
size: {
|
|
70
|
-
default:
|
|
71
|
-
compact:
|
|
72
|
-
};
|
|
73
|
-
}, undefined, "px-3 py-2 text-foreground", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
74
|
-
size: {
|
|
75
|
-
default: string;
|
|
76
|
-
compact: string;
|
|
77
|
-
};
|
|
78
|
-
}, {
|
|
79
|
-
size: {
|
|
80
|
-
default: string;
|
|
81
|
-
compact: string;
|
|
82
|
-
};
|
|
83
|
-
}>, {
|
|
84
|
-
size: {
|
|
85
|
-
default: string;
|
|
86
|
-
compact: string;
|
|
87
|
-
};
|
|
88
|
-
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
89
|
-
size: {
|
|
90
|
-
default: string;
|
|
91
|
-
compact: string;
|
|
35
|
+
default: "";
|
|
36
|
+
compact: "";
|
|
92
37
|
};
|
|
93
|
-
}, undefined, "
|
|
38
|
+
}, undefined, "text-foreground", {
|
|
94
39
|
size: {
|
|
95
|
-
default:
|
|
96
|
-
compact:
|
|
40
|
+
default: "";
|
|
41
|
+
compact: "";
|
|
97
42
|
};
|
|
98
|
-
}, {
|
|
43
|
+
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
99
44
|
size: {
|
|
100
|
-
default:
|
|
101
|
-
compact:
|
|
45
|
+
default: "";
|
|
46
|
+
compact: "";
|
|
102
47
|
};
|
|
103
|
-
}
|
|
48
|
+
}, undefined>>;
|
|
104
49
|
export interface NumericInputProps extends Omit<TextInputProps, 'value' | 'defaultValue' | 'onChangeText' | 'keyboardType'>, VariantProps<typeof numericInputVariants> {
|
|
105
50
|
className?: string;
|
|
106
51
|
inputClassName?: string;
|
|
@@ -113,7 +58,8 @@ export interface NumericInputProps extends Omit<TextInputProps, 'value' | 'defau
|
|
|
113
58
|
max?: number;
|
|
114
59
|
step?: number;
|
|
115
60
|
showSteppers?: boolean;
|
|
61
|
+
/** Drop the field shell (border, background, radius, padding) for embedding inside another field shell like LabeledField. */
|
|
62
|
+
unstyled?: boolean;
|
|
116
63
|
}
|
|
117
|
-
declare const NumericInput:
|
|
64
|
+
declare const NumericInput: ForwardRefComponent<TextInputInstance, NumericInputProps>;
|
|
118
65
|
export { NumericInput, numericInputVariants, numericInputTextVariants };
|
|
119
|
-
//# sourceMappingURL=numeric-input.d.ts.map
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
3
|
-
import { Platform, Pressable, Text, TextInput, View } from 'react-native';
|
|
3
|
+
import { Platform, Pressable, Text, TextInput, View, } from 'react-native';
|
|
4
4
|
import { cn } from '../../lib/cn';
|
|
5
|
+
import { focusRing } from '../../lib/focus-ring';
|
|
5
6
|
import { tv } from '../../lib/tv';
|
|
6
7
|
import { useThemeColors } from '../../lib/theme-colors';
|
|
7
8
|
import { useInteractionTokens, withInteractivePressableStyle } from '../../lib/interaction-tokens';
|
|
9
|
+
import { useVisualTokens } from '../../lib/visual-tokens';
|
|
10
|
+
import { typographyStyle } from '../../lib/recipes';
|
|
8
11
|
const numericInputVariants = tv({
|
|
9
|
-
base: 'w-full flex-row items-center
|
|
12
|
+
base: 'w-full flex-row items-center border-border bg-muted',
|
|
10
13
|
variants: {
|
|
11
14
|
variant: {
|
|
12
15
|
default: 'border-border',
|
|
13
16
|
error: 'border-destructive',
|
|
14
17
|
},
|
|
15
18
|
size: {
|
|
16
|
-
default: '
|
|
17
|
-
compact: '
|
|
19
|
+
default: '',
|
|
20
|
+
compact: '',
|
|
18
21
|
},
|
|
19
22
|
},
|
|
20
23
|
defaultVariants: {
|
|
@@ -23,34 +26,17 @@ const numericInputVariants = tv({
|
|
|
23
26
|
},
|
|
24
27
|
});
|
|
25
28
|
const numericInputTextVariants = tv({
|
|
26
|
-
base: '
|
|
29
|
+
base: 'text-foreground',
|
|
27
30
|
variants: {
|
|
28
31
|
size: {
|
|
29
|
-
default: '
|
|
30
|
-
compact: '
|
|
32
|
+
default: '',
|
|
33
|
+
compact: '',
|
|
31
34
|
},
|
|
32
35
|
},
|
|
33
36
|
defaultVariants: {
|
|
34
37
|
size: 'default',
|
|
35
38
|
},
|
|
36
39
|
});
|
|
37
|
-
const stepperButtonVariants = tv({
|
|
38
|
-
base: 'h-full w-11 items-center justify-center',
|
|
39
|
-
variants: {
|
|
40
|
-
size: {
|
|
41
|
-
default: 'px-3',
|
|
42
|
-
compact: 'px-2',
|
|
43
|
-
},
|
|
44
|
-
disabled: {
|
|
45
|
-
true: '',
|
|
46
|
-
false: '',
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
defaultVariants: {
|
|
50
|
-
size: 'default',
|
|
51
|
-
disabled: false,
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
40
|
function toInputText(value) {
|
|
55
41
|
if (value === null || value === undefined) {
|
|
56
42
|
return '';
|
|
@@ -80,71 +66,105 @@ function roundToStepPrecision(value, step) {
|
|
|
80
66
|
const decimals = step >= 1 ? 0 : (step.toString().split('.')[1]?.length ?? 2);
|
|
81
67
|
return Number(value.toFixed(decimals));
|
|
82
68
|
}
|
|
83
|
-
|
|
84
|
-
const colors = useThemeColors();
|
|
85
|
-
const interaction = useInteractionTokens();
|
|
69
|
+
function useNumericInputModel({ value, defaultValue, min, max, step, editable, onValueChange, onBlur, }) {
|
|
86
70
|
const [internalText, setInternalText] = useState(() => toInputText(defaultValue));
|
|
87
71
|
const isControlled = value !== undefined;
|
|
88
72
|
const textValue = isControlled ? toInputText(value) : internalText;
|
|
89
73
|
const currentValue = useMemo(() => parseNumericText(textValue), [textValue]);
|
|
90
|
-
const setTextAndValue = useCallback((nextText) => {
|
|
91
|
-
if (!isControlled) {
|
|
92
|
-
setInternalText(nextText);
|
|
93
|
-
}
|
|
94
|
-
onValueChange?.(parseNumericText(nextText));
|
|
95
|
-
}, [isControlled, onValueChange]);
|
|
96
74
|
const applyNumericValue = useCallback((nextValue) => {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
setInternalText('');
|
|
100
|
-
}
|
|
101
|
-
onValueChange?.(null);
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
const clamped = clampValue(nextValue, min, max);
|
|
105
|
-
if (!isControlled) {
|
|
75
|
+
const clamped = nextValue === null ? null : clampValue(nextValue, min, max);
|
|
76
|
+
if (!isControlled)
|
|
106
77
|
setInternalText(toInputText(clamped));
|
|
107
|
-
}
|
|
108
78
|
onValueChange?.(clamped);
|
|
109
79
|
}, [isControlled, max, min, onValueChange]);
|
|
110
|
-
const handleTextChange = (nextText) => {
|
|
111
|
-
|
|
112
|
-
if (!isNumericLike) {
|
|
80
|
+
const handleTextChange = useCallback((nextText) => {
|
|
81
|
+
if (!/^-?\d*(?:[.,]\d*)?$/.test(nextText))
|
|
113
82
|
return;
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
83
|
+
if (!isControlled)
|
|
84
|
+
setInternalText(nextText);
|
|
85
|
+
onValueChange?.(parseNumericText(nextText));
|
|
86
|
+
}, [isControlled, onValueChange]);
|
|
87
|
+
const handleBlur = useCallback((event) => {
|
|
118
88
|
const parsed = parseNumericText(textValue);
|
|
119
|
-
if (parsed !== null)
|
|
120
|
-
|
|
121
|
-
const clamped = clampValue(rounded, min, max);
|
|
122
|
-
if (!isControlled) {
|
|
123
|
-
setInternalText(toInputText(clamped));
|
|
124
|
-
}
|
|
125
|
-
onValueChange?.(clamped);
|
|
126
|
-
}
|
|
89
|
+
if (parsed !== null)
|
|
90
|
+
applyNumericValue(roundToStepPrecision(parsed, step));
|
|
127
91
|
onBlur?.(event);
|
|
92
|
+
}, [applyNumericValue, onBlur, step, textValue]);
|
|
93
|
+
const nudge = useCallback((delta) => {
|
|
94
|
+
const baseline = currentValue ?? min ?? 0;
|
|
95
|
+
applyNumericValue(roundToStepPrecision(baseline + delta * step, step));
|
|
96
|
+
}, [applyNumericValue, currentValue, min, step]);
|
|
97
|
+
return {
|
|
98
|
+
textValue,
|
|
99
|
+
handleTextChange,
|
|
100
|
+
handleBlur,
|
|
101
|
+
nudge,
|
|
102
|
+
canDecrease: editable && (min === undefined || currentValue === null || currentValue > min),
|
|
103
|
+
canIncrease: editable && (max === undefined || currentValue === null || currentValue < max),
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
function numericInputTextStyle(visual, size, unstyled, style) {
|
|
107
|
+
const base = {
|
|
108
|
+
...typographyStyle(visual, size === 'compact' ? 'caption' : 'label'),
|
|
109
|
+
paddingVertical: size === 'compact' ? visual.controlPaddingYSm : visual.controlPaddingYDefault,
|
|
110
|
+
paddingHorizontal: unstyled ? 0 : visual.controlPaddingXDefault,
|
|
128
111
|
};
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
112
|
+
return Platform.OS === 'web'
|
|
113
|
+
? [{ ...base, width: '100%', minWidth: 0 }, style]
|
|
114
|
+
: [base, style];
|
|
115
|
+
}
|
|
116
|
+
function NumericAffix({ side, visual, children, }) {
|
|
117
|
+
if (!children)
|
|
118
|
+
return null;
|
|
119
|
+
const spacing = Math.max(8, Math.round(visual.controlPaddingXDefault * 0.5));
|
|
120
|
+
return (_jsx(View, { style: side === 'prefix' ? { paddingRight: spacing } : { paddingLeft: spacing }, children: children }));
|
|
121
|
+
}
|
|
122
|
+
function NumericStepperButton({ delta, enabled, label, symbol, size, radius, model, interaction, visual, }) {
|
|
123
|
+
const feedbackStyle = withInteractivePressableStyle(undefined, interaction, {
|
|
124
|
+
disabled: !enabled,
|
|
133
125
|
disabledVariant: 'subtle',
|
|
134
126
|
pressedVariant: 'default',
|
|
135
127
|
});
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
128
|
+
return (_jsx(Pressable, { className: "shrink-0 items-center justify-center bg-secondary", style: (state) => {
|
|
129
|
+
const baseStyle = typeof feedbackStyle === 'function' ? feedbackStyle(state) : feedbackStyle;
|
|
130
|
+
return [baseStyle, { width: size, height: size, borderRadius: radius }];
|
|
131
|
+
}, onPress: () => model.nudge(delta), disabled: !enabled, hitSlop: 4, accessibilityRole: "button", accessibilityLabel: label, children: _jsx(Text, { className: "font-medium text-foreground", style: typographyStyle(visual, 'body'), children: symbol }) }));
|
|
132
|
+
}
|
|
133
|
+
function NumericSteppers({ visible, inset, size, radius, model, interaction, visual, }) {
|
|
134
|
+
if (!visible)
|
|
135
|
+
return null;
|
|
136
|
+
return (_jsxs(View, { className: "shrink-0 flex-row items-center", style: { gap: inset, paddingLeft: Math.max(6, inset) }, children: [_jsx(NumericStepperButton, { delta: -1, enabled: model.canDecrease, label: "Decrease value", symbol: "\u2212", size: size, radius: radius, model: model, interaction: interaction, visual: visual }), _jsx(NumericStepperButton, { delta: 1, enabled: model.canIncrease, label: "Increase value", symbol: "+", size: size, radius: radius, model: model, interaction: interaction, visual: visual })] }));
|
|
137
|
+
}
|
|
138
|
+
const NumericInput = React.forwardRef(({ className, inputClassName, prefix, suffix, value, defaultValue, onValueChange, min, max, step = 1, showSteppers = false, unstyled = false, variant = 'default', size = 'default', editable = true, placeholderTextColor, onBlur, style: styleProp, ...props }, ref) => {
|
|
139
|
+
const colors = useThemeColors();
|
|
140
|
+
const interaction = useInteractionTokens();
|
|
141
|
+
const visual = useVisualTokens();
|
|
142
|
+
const model = useNumericInputModel({
|
|
143
|
+
value,
|
|
144
|
+
defaultValue,
|
|
145
|
+
min,
|
|
146
|
+
max,
|
|
147
|
+
step,
|
|
148
|
+
editable,
|
|
149
|
+
onValueChange,
|
|
150
|
+
onBlur,
|
|
140
151
|
});
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
return (_jsxs(View, { className: cn(numericInputVariants({ variant, size }),
|
|
152
|
+
const controlHeight = size === 'compact' ? visual.controlHeightSm : visual.controlHeightDefault;
|
|
153
|
+
// Steppers render as inset soft buttons, centered inside the field shell.
|
|
154
|
+
const stepInset = Math.max(3, Math.round(controlHeight * 0.1));
|
|
155
|
+
const stepSize = controlHeight - stepInset * 2;
|
|
156
|
+
const stepRadius = Math.max(3, Math.min(visual.radiusMd, Math.round(stepSize / 3)));
|
|
157
|
+
return (_jsxs(View, { className: cn(numericInputVariants({ variant, size }), unstyled && 'bg-transparent', className), style: [
|
|
158
|
+
{
|
|
159
|
+
// Definite height (not minHeight) so inner elements can center reliably.
|
|
160
|
+
height: controlHeight,
|
|
161
|
+
borderWidth: unstyled ? 0 : visual.borderWidthControl,
|
|
162
|
+
borderRadius: unstyled ? 0 : visual.radiusLg,
|
|
163
|
+
paddingLeft: !unstyled && prefix ? visual.controlPaddingXDefault : 0,
|
|
164
|
+
paddingRight: unstyled ? 0 : showSteppers ? stepInset : 0,
|
|
165
|
+
},
|
|
166
|
+
!editable ? { opacity: interaction.disabledOpacity } : undefined,
|
|
167
|
+
], children: [_jsx(NumericAffix, { side: "prefix", visual: visual, children: prefix }), _jsx(View, { className: "min-w-0 flex-1", style: Platform.OS === 'web' ? { minWidth: 0, flex: 1 } : undefined, children: _jsx(TextInput, { ref: ref, className: cn(numericInputTextVariants({ size }), 'w-full', focusRing, inputClassName), style: numericInputTextStyle(visual, size, unstyled, styleProp), value: model.textValue, onChangeText: model.handleTextChange, onBlur: model.handleBlur, keyboardType: "decimal-pad", editable: editable, placeholderTextColor: placeholderTextColor ?? colors.placeholder, ...props }) }), _jsx(NumericAffix, { side: "suffix", visual: visual, children: suffix }), _jsx(NumericSteppers, { visible: showSteppers, inset: stepInset, size: stepSize, radius: stepRadius, model: model, interaction: interaction, visual: visual })] }));
|
|
147
168
|
});
|
|
148
169
|
NumericInput.displayName = 'NumericInput';
|
|
149
170
|
export { NumericInput, numericInputVariants, numericInputTextVariants };
|
|
150
|
-
//# sourceMappingURL=numeric-input.js.map
|
|
@@ -1,82 +1,38 @@
|
|
|
1
1
|
import { type ViewProps } from 'react-native';
|
|
2
2
|
declare const otpCellVariants: import("tailwind-variants").TVReturnType<{
|
|
3
3
|
size: {
|
|
4
|
-
default:
|
|
5
|
-
compact:
|
|
4
|
+
default: "w-11";
|
|
5
|
+
compact: "w-9";
|
|
6
6
|
};
|
|
7
7
|
state: {
|
|
8
|
-
idle:
|
|
9
|
-
focused:
|
|
10
|
-
error:
|
|
11
|
-
errorFocused:
|
|
8
|
+
idle: "border-border";
|
|
9
|
+
focused: "border-primary";
|
|
10
|
+
error: "border-destructive";
|
|
11
|
+
errorFocused: "border-destructive";
|
|
12
12
|
};
|
|
13
|
-
}, undefined, "items-center justify-center
|
|
13
|
+
}, undefined, "items-center justify-center border bg-muted", {
|
|
14
14
|
size: {
|
|
15
|
-
default:
|
|
16
|
-
compact:
|
|
15
|
+
default: "w-11";
|
|
16
|
+
compact: "w-9";
|
|
17
17
|
};
|
|
18
18
|
state: {
|
|
19
|
-
idle:
|
|
20
|
-
focused:
|
|
21
|
-
error:
|
|
22
|
-
errorFocused:
|
|
19
|
+
idle: "border-border";
|
|
20
|
+
focused: "border-primary";
|
|
21
|
+
error: "border-destructive";
|
|
22
|
+
errorFocused: "border-destructive";
|
|
23
23
|
};
|
|
24
|
-
}, {
|
|
24
|
+
}, undefined, import("tailwind-variants").TVReturnTypeLike<{
|
|
25
25
|
size: {
|
|
26
|
-
default:
|
|
27
|
-
compact:
|
|
26
|
+
default: "w-11";
|
|
27
|
+
compact: "w-9";
|
|
28
28
|
};
|
|
29
29
|
state: {
|
|
30
|
-
idle:
|
|
31
|
-
focused:
|
|
32
|
-
error:
|
|
33
|
-
errorFocused:
|
|
30
|
+
idle: "border-border";
|
|
31
|
+
focused: "border-primary";
|
|
32
|
+
error: "border-destructive";
|
|
33
|
+
errorFocused: "border-destructive";
|
|
34
34
|
};
|
|
35
|
-
}
|
|
36
|
-
size: {
|
|
37
|
-
default: string;
|
|
38
|
-
compact: string;
|
|
39
|
-
};
|
|
40
|
-
state: {
|
|
41
|
-
idle: string;
|
|
42
|
-
focused: string;
|
|
43
|
-
error: string;
|
|
44
|
-
errorFocused: string;
|
|
45
|
-
};
|
|
46
|
-
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
47
|
-
size: {
|
|
48
|
-
default: string;
|
|
49
|
-
compact: string;
|
|
50
|
-
};
|
|
51
|
-
state: {
|
|
52
|
-
idle: string;
|
|
53
|
-
focused: string;
|
|
54
|
-
error: string;
|
|
55
|
-
errorFocused: string;
|
|
56
|
-
};
|
|
57
|
-
}, undefined, "items-center justify-center rounded-lg border bg-muted", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
58
|
-
size: {
|
|
59
|
-
default: string;
|
|
60
|
-
compact: string;
|
|
61
|
-
};
|
|
62
|
-
state: {
|
|
63
|
-
idle: string;
|
|
64
|
-
focused: string;
|
|
65
|
-
error: string;
|
|
66
|
-
errorFocused: string;
|
|
67
|
-
};
|
|
68
|
-
}, {
|
|
69
|
-
size: {
|
|
70
|
-
default: string;
|
|
71
|
-
compact: string;
|
|
72
|
-
};
|
|
73
|
-
state: {
|
|
74
|
-
idle: string;
|
|
75
|
-
focused: string;
|
|
76
|
-
error: string;
|
|
77
|
-
errorFocused: string;
|
|
78
|
-
};
|
|
79
|
-
}>, unknown, unknown, undefined>>;
|
|
35
|
+
}, undefined>>;
|
|
80
36
|
export interface OTPInputProps extends Omit<ViewProps, 'children'> {
|
|
81
37
|
length?: number;
|
|
82
38
|
value?: string;
|
|
@@ -89,9 +45,8 @@ export interface OTPInputProps extends Omit<ViewProps, 'children'> {
|
|
|
89
45
|
autoFocus?: boolean;
|
|
90
46
|
className?: string;
|
|
91
47
|
}
|
|
92
|
-
declare function OTPInput({ length, value: controlledValue, onValueChange, onComplete, variant, size, secure, disabled, autoFocus, className, ...props }: OTPInputProps): import("react
|
|
48
|
+
declare function OTPInput({ length, value: controlledValue, onValueChange, onComplete, variant, size, secure, disabled, autoFocus, className, ...props }: OTPInputProps): import("react").JSX.Element;
|
|
93
49
|
declare namespace OTPInput {
|
|
94
50
|
var displayName: string;
|
|
95
51
|
}
|
|
96
52
|
export { OTPInput, otpCellVariants };
|
|
97
|
-
//# sourceMappingURL=otp-input.d.ts.map
|
|
@@ -7,21 +7,21 @@ import { cn } from '../../lib/cn';
|
|
|
7
7
|
import { tv } from '../../lib/tv';
|
|
8
8
|
import { useThemeColors } from '../../lib/theme-colors';
|
|
9
9
|
import { useInteractionTokens } from '../../lib/interaction-tokens';
|
|
10
|
-
|
|
10
|
+
import { useVisualTokens } from '../../lib/visual-tokens';
|
|
11
|
+
import { typographyStyle } from '../../lib/recipes';
|
|
11
12
|
const otpCellVariants = tv({
|
|
12
|
-
base: 'items-center justify-center
|
|
13
|
+
base: 'items-center justify-center border bg-muted',
|
|
13
14
|
variants: {
|
|
14
|
-
size: { default: '
|
|
15
|
+
size: { default: 'w-11', compact: 'w-9' },
|
|
15
16
|
state: {
|
|
16
17
|
idle: 'border-border',
|
|
17
|
-
focused: 'border-primary
|
|
18
|
+
focused: 'border-primary',
|
|
18
19
|
error: 'border-destructive',
|
|
19
|
-
errorFocused: 'border-destructive
|
|
20
|
+
errorFocused: 'border-destructive',
|
|
20
21
|
},
|
|
21
22
|
},
|
|
22
23
|
defaultVariants: { size: 'default', state: 'idle' },
|
|
23
24
|
});
|
|
24
|
-
// ─── Component ───────────────────────────────────────────────
|
|
25
25
|
function OTPInput({ length = 6, value: controlledValue, onValueChange, onComplete, variant = 'default', size = 'default', secure = false, disabled = false, autoFocus = false, className, ...props }) {
|
|
26
26
|
const [internalValue, setInternalValue] = useState('');
|
|
27
27
|
const isControlled = controlledValue !== undefined;
|
|
@@ -29,6 +29,7 @@ function OTPInput({ length = 6, value: controlledValue, onValueChange, onComplet
|
|
|
29
29
|
const [focused, setFocused] = useState(false);
|
|
30
30
|
const colors = useThemeColors();
|
|
31
31
|
const interaction = useInteractionTokens();
|
|
32
|
+
const visual = useVisualTokens();
|
|
32
33
|
const shakeX = useSharedValue(0);
|
|
33
34
|
useEffect(() => {
|
|
34
35
|
if (variant !== 'error')
|
|
@@ -59,17 +60,21 @@ function OTPInput({ length = 6, value: controlledValue, onValueChange, onComplet
|
|
|
59
60
|
: isCursor
|
|
60
61
|
? 'focused'
|
|
61
62
|
: 'idle';
|
|
62
|
-
return (_jsx(View, { className: otpCellVariants({ size, state }),
|
|
63
|
+
return (_jsx(View, { className: otpCellVariants({ size, state }), style: {
|
|
64
|
+
height: size === 'compact' ? visual.controlHeightDefault : visual.controlHeightLg,
|
|
65
|
+
borderRadius: visual.radiusMd,
|
|
66
|
+
borderWidth: isCursor ? visual.borderWidthEmphasis : visual.borderWidthControl,
|
|
67
|
+
}, children: digit ? (_jsx(Text, { className: cn('text-foreground font-semibold'), style: typographyStyle(visual, size === 'compact' ? 'body' : 'emphasis'), children: secure ? '●' : digit })) : isCursor ? (_jsx(CursorBlink, { color: isError ? colors.destructive : colors.primary })) : null }, i));
|
|
63
68
|
}) }), _jsx(TextInput, { value: val, onChangeText: update, onFocus: () => setFocused(true), onBlur: () => setFocused(false), keyboardType: "number-pad", textContentType: "oneTimeCode", autoComplete: Platform.OS === 'android' ? 'sms-otp' : 'one-time-code', maxLength: length, autoFocus: autoFocus, editable: !disabled, caretHidden: true, className: "outline-none", style: {
|
|
64
69
|
position: 'absolute',
|
|
65
70
|
top: 0,
|
|
66
71
|
left: 0,
|
|
67
72
|
right: 0,
|
|
68
73
|
bottom: 0,
|
|
74
|
+
opacity: 0,
|
|
69
75
|
color: 'transparent',
|
|
70
76
|
}, accessibilityLabel: `Enter ${length}-digit verification code` })] }));
|
|
71
77
|
}
|
|
72
|
-
// ─── Cursor Blink ─────────────────────────────────────────────
|
|
73
78
|
function CursorBlink({ color }) {
|
|
74
79
|
const opacity = useSharedValue(1);
|
|
75
80
|
useEffect(() => {
|
|
@@ -85,4 +90,3 @@ function CursorBlink({ color }) {
|
|
|
85
90
|
}
|
|
86
91
|
OTPInput.displayName = 'OTPInput';
|
|
87
92
|
export { OTPInput, otpCellVariants };
|
|
88
|
-
//# sourceMappingURL=otp-input.js.map
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as PopoverPrimitive from '@rn-primitives/popover';
|
|
3
3
|
import { type FrostedSurfaceProps } from '../../lib/frosted-surface';
|
|
4
|
+
import { type OverlayInsets } from '../../lib/overlay-insets';
|
|
5
|
+
import type { ForwardRefComponent } from '../../lib/ref-types';
|
|
4
6
|
export interface PopoverProps {
|
|
5
7
|
onOpenChange?: (open: boolean) => void;
|
|
6
8
|
children: React.ReactNode;
|
|
@@ -11,13 +13,14 @@ export interface PopoverTriggerProps extends React.ComponentPropsWithoutRef<type
|
|
|
11
13
|
export interface PopoverContentProps extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>, FrostedSurfaceProps {
|
|
12
14
|
className?: string;
|
|
13
15
|
portalHost?: string;
|
|
16
|
+
/** Collision padding. Defaults to safe area plus a margin so the panel never sits flush against an edge. */
|
|
17
|
+
insets?: Partial<OverlayInsets>;
|
|
14
18
|
}
|
|
15
19
|
export interface PopoverCloseProps extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Close> {
|
|
16
20
|
className?: string;
|
|
17
21
|
}
|
|
18
|
-
declare function Popover({ onOpenChange, children }: PopoverProps):
|
|
19
|
-
declare const PopoverTrigger:
|
|
20
|
-
declare const PopoverContent:
|
|
21
|
-
declare const PopoverClose:
|
|
22
|
+
declare function Popover({ onOpenChange, children }: PopoverProps): React.JSX.Element;
|
|
23
|
+
declare const PopoverTrigger: ForwardRefComponent<PopoverPrimitive.TriggerRef, PopoverTriggerProps>;
|
|
24
|
+
declare const PopoverContent: ForwardRefComponent<PopoverPrimitive.ContentRef, PopoverContentProps>;
|
|
25
|
+
declare const PopoverClose: ForwardRefComponent<PopoverPrimitive.CloseRef, PopoverCloseProps>;
|
|
22
26
|
export { Popover, PopoverTrigger, PopoverContent, PopoverClose };
|
|
23
|
-
//# sourceMappingURL=popover.d.ts.map
|
|
@@ -4,13 +4,16 @@ import { Platform, StyleSheet } from 'react-native';
|
|
|
4
4
|
import * as PopoverPrimitive from '@rn-primitives/popover';
|
|
5
5
|
import { cn } from '../../lib/cn';
|
|
6
6
|
import { useFrostedSurface } from '../../lib/frosted-surface';
|
|
7
|
-
|
|
7
|
+
import { useOverlayInsets } from '../../lib/overlay-insets';
|
|
8
|
+
import { useVisualTokens } from '../../lib/visual-tokens';
|
|
9
|
+
import { useThemeColors } from '../../lib/theme-colors';
|
|
10
|
+
import { shadowStyle, surfacePadding, surfaceRadius } from '../../lib/recipes';
|
|
8
11
|
function Popover({ onOpenChange, children }) {
|
|
9
12
|
return _jsx(PopoverPrimitive.Root, { onOpenChange: onOpenChange, children: children });
|
|
10
13
|
}
|
|
11
14
|
const PopoverTrigger = React.forwardRef(({ className, ...props }, ref) => (_jsx(PopoverPrimitive.Trigger, { ref: ref, className: cn(className), ...props })));
|
|
12
15
|
PopoverTrigger.displayName = 'PopoverTrigger';
|
|
13
|
-
const PopoverContent = React.forwardRef(({ className, align = 'center', sideOffset = 4, portalHost, children, style, frosted = false, blurIntensity, blurTintToken, ...props }, ref) => {
|
|
16
|
+
const PopoverContent = React.forwardRef(({ className, align = 'center', sideOffset = 4, insets, portalHost, children, style, frosted = false, blurIntensity, blurTintToken, ...props }, ref) => {
|
|
14
17
|
const frostedSurface = useFrostedSurface({
|
|
15
18
|
frosted,
|
|
16
19
|
blurIntensity,
|
|
@@ -18,12 +21,27 @@ const PopoverContent = React.forwardRef(({ className, align = 'center', sideOffs
|
|
|
18
21
|
defaultTintToken: 'popover',
|
|
19
22
|
defaultBlurPreset: 'subtle',
|
|
20
23
|
});
|
|
24
|
+
const visual = useVisualTokens();
|
|
25
|
+
const colors = useThemeColors();
|
|
26
|
+
// Keeps the panel off the screen edge and out from under the notch.
|
|
27
|
+
const defaultInsets = useOverlayInsets();
|
|
28
|
+
const resolvedInsets = { ...defaultInsets, ...insets };
|
|
29
|
+
// NOTE: native only. `@rn-primitives/popover`'s web build destructures `insets`
|
|
30
|
+
// away (`insets: _insets`) and hands Radix a fixed allowlist that has no room for
|
|
31
|
+
// `collisionPadding`, so a web popover next to an edge still lands flush against it.
|
|
32
|
+
// Fixing that needs a `.web.tsx` talking to Radix directly.
|
|
21
33
|
const resolvedStyle = StyleSheet.flatten([
|
|
22
34
|
Platform.OS === 'web' ? undefined : contentStyles,
|
|
35
|
+
{
|
|
36
|
+
borderRadius: surfaceRadius(visual, 'lg'),
|
|
37
|
+
borderWidth: visual.borderWidthHairline,
|
|
38
|
+
padding: surfacePadding(visual, 'sm'),
|
|
39
|
+
},
|
|
40
|
+
shadowStyle(visual, colors, 'md'),
|
|
23
41
|
frostedSurface.surfaceStyle,
|
|
24
42
|
style,
|
|
25
43
|
]);
|
|
26
|
-
return (_jsx(PopoverPrimitive.Portal, { hostName: portalHost, children: _jsx(PopoverPrimitive.Overlay, { style: Platform.OS !== 'web' ? StyleSheet.absoluteFill : undefined, children: _jsxs(PopoverPrimitive.Content, { ref: ref, align: align, sideOffset: sideOffset, className: cn('z-50 w-72
|
|
44
|
+
return (_jsx(PopoverPrimitive.Portal, { hostName: portalHost, children: _jsx(PopoverPrimitive.Overlay, { style: Platform.OS !== 'web' ? StyleSheet.absoluteFill : undefined, children: _jsxs(PopoverPrimitive.Content, { ref: ref, align: align, sideOffset: sideOffset, insets: resolvedInsets, className: cn('z-50 w-72 border-border relative overflow-hidden', frosted ? 'bg-transparent' : 'bg-popover', 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1', className), style: resolvedStyle, ...props, children: [frostedSurface.overlay, children] }) }) }));
|
|
27
45
|
});
|
|
28
46
|
PopoverContent.displayName = 'PopoverContent';
|
|
29
47
|
const PopoverClose = React.forwardRef(({ className, ...props }, ref) => (_jsx(PopoverPrimitive.Close, { ref: ref, className: cn(className), ...props })));
|
|
@@ -32,4 +50,3 @@ const contentStyles = {
|
|
|
32
50
|
position: 'absolute',
|
|
33
51
|
};
|
|
34
52
|
export { Popover, PopoverTrigger, PopoverContent, PopoverClose };
|
|
35
|
-
//# sourceMappingURL=popover.js.map
|