@codefast/ui 0.5.0-canary.4 → 0.5.0-canary.6
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/CHANGELOG.md +67 -0
- package/README.md +59 -355
- package/dist/components/accordion.d.ts +37 -0
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/accordion.js +33 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/alert-dialog.d.ts +102 -0
- package/dist/components/alert-dialog.d.ts.map +1 -0
- package/dist/components/alert-dialog.js +75 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/alert.d.ts +38 -0
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/alert.js +32 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/aspect-ratio.d.ts +13 -0
- package/dist/components/aspect-ratio.d.ts.map +1 -0
- package/dist/components/aspect-ratio.js +13 -0
- package/dist/components/aspect-ratio.js.map +1 -0
- package/dist/components/{attachment.d.mts → attachment.d.ts} +21 -55
- package/dist/components/attachment.d.ts.map +1 -0
- package/dist/components/attachment.js +65 -0
- package/dist/components/attachment.js.map +1 -0
- package/dist/components/avatar.d.ts +55 -0
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/avatar.js +44 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +15 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +15 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/breadcrumb.d.ts +62 -0
- package/dist/components/breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb.js +52 -0
- package/dist/components/breadcrumb.js.map +1 -0
- package/dist/components/bubble.d.ts +50 -0
- package/dist/components/bubble.d.ts.map +1 -0
- package/dist/components/bubble.js +34 -0
- package/dist/components/bubble.js.map +1 -0
- package/dist/components/button-group.d.ts +32 -0
- package/dist/components/button-group.d.ts.map +1 -0
- package/dist/components/button-group.js +29 -0
- package/dist/components/button-group.js.map +1 -0
- package/dist/components/button.d.ts +16 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +18 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/calendar.d.ts +27 -0
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +96 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/card.d.ts +62 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +49 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/{carousel.d.mts → carousel.d.ts} +25 -52
- package/dist/components/carousel.d.ts.map +1 -0
- package/dist/components/carousel.js +137 -0
- package/dist/components/carousel.js.map +1 -0
- package/dist/components/chart.d.ts +101 -0
- package/dist/components/chart.d.ts.map +1 -0
- package/dist/components/chart.js +217 -0
- package/dist/components/chart.js.map +1 -0
- package/dist/components/checkbox-cards.d.ts +23 -0
- package/dist/components/checkbox-cards.d.ts.map +1 -0
- package/dist/components/checkbox-cards.js +22 -0
- package/dist/components/checkbox-cards.js.map +1 -0
- package/dist/components/checkbox-group.d.ts +21 -0
- package/dist/components/checkbox-group.d.ts.map +1 -0
- package/dist/components/checkbox-group.js +21 -0
- package/dist/components/checkbox-group.js.map +1 -0
- package/dist/components/checkbox.d.ts +13 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +15 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/collapsible.d.ts +29 -0
- package/dist/components/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible.js +25 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/command.d.ts +91 -0
- package/dist/components/command.d.ts.map +1 -0
- package/dist/components/command.js +71 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/context-menu.d.ts +136 -0
- package/dist/components/context-menu.d.ts.map +1 -0
- package/dist/components/context-menu.js +99 -0
- package/dist/components/context-menu.js.map +1 -0
- package/dist/components/dialog.d.ts +86 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +64 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/direction.d.ts +19 -0
- package/dist/components/direction.d.ts.map +1 -0
- package/dist/components/direction.js +17 -0
- package/dist/components/direction.js.map +1 -0
- package/dist/components/drawer.d.ts +74 -0
- package/dist/components/drawer.d.ts.map +1 -0
- package/dist/components/drawer.js +57 -0
- package/dist/components/drawer.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +136 -0
- package/dist/components/dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu.js +99 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/empty.d.ts +53 -0
- package/dist/components/empty.d.ts.map +1 -0
- package/dist/components/empty.js +44 -0
- package/dist/components/empty.js.map +1 -0
- package/dist/components/field.d.ts +95 -0
- package/dist/components/field.d.ts.map +1 -0
- package/dist/components/field.js +86 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/{form.d.mts → form.d.ts} +15 -33
- package/dist/components/form.d.ts.map +1 -0
- package/dist/components/form.js +97 -0
- package/dist/components/form.js.map +1 -0
- package/dist/components/hover-card.d.ts +37 -0
- package/dist/components/hover-card.d.ts.map +1 -0
- package/dist/components/hover-card.js +32 -0
- package/dist/components/hover-card.js.map +1 -0
- package/dist/components/input-group.d.ts +56 -0
- package/dist/components/input-group.d.ts.map +1 -0
- package/dist/components/input-group.js +56 -0
- package/dist/components/input-group.js.map +1 -0
- package/dist/components/input-number.d.ts +60 -0
- package/dist/components/input-number.d.ts.map +1 -0
- package/dist/components/input-number.js +68 -0
- package/dist/components/input-number.js.map +1 -0
- package/dist/components/input-otp.d.ts +40 -0
- package/dist/components/input-otp.d.ts.map +1 -0
- package/dist/components/input-otp.js +41 -0
- package/dist/components/input-otp.js.map +1 -0
- package/dist/components/input-password.d.ts +13 -0
- package/dist/components/input-password.d.ts.map +1 -0
- package/dist/components/input-password.js +19 -0
- package/dist/components/input-password.js.map +1 -0
- package/dist/components/input-search.d.ts +17 -0
- package/dist/components/input-search.d.ts.map +1 -0
- package/dist/components/input-search.js +24 -0
- package/dist/components/input-search.js.map +1 -0
- package/dist/components/input.d.ts +12 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +13 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/item.d.ts +88 -0
- package/dist/components/item.d.ts.map +1 -0
- package/dist/components/item.js +71 -0
- package/dist/components/item.js.map +1 -0
- package/dist/components/kbd.d.ts +20 -0
- package/dist/components/kbd.d.ts.map +1 -0
- package/dist/components/kbd.js +19 -0
- package/dist/components/kbd.js.map +1 -0
- package/dist/components/label.d.ts +13 -0
- package/dist/components/label.d.ts.map +1 -0
- package/dist/components/label.js +14 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/{marker.d.mts → marker.d.ts} +9 -21
- package/dist/components/marker.d.ts.map +1 -0
- package/dist/components/marker.js +28 -0
- package/dist/components/marker.js.map +1 -0
- package/dist/components/menubar.d.ts +144 -0
- package/dist/components/menubar.d.ts.map +1 -0
- package/dist/components/menubar.js +105 -0
- package/dist/components/menubar.js.map +1 -0
- package/dist/components/message-scroller.d.ts +67 -0
- package/dist/components/message-scroller.d.ts.map +1 -0
- package/dist/components/message-scroller.js +46 -0
- package/dist/components/message-scroller.js.map +1 -0
- package/dist/components/{message.d.mts → message.d.ts} +11 -31
- package/dist/components/message.d.ts.map +1 -0
- package/dist/components/message.js +43 -0
- package/dist/components/message.js.map +1 -0
- package/dist/components/native-select.d.ts +30 -0
- package/dist/components/native-select.d.ts.map +1 -0
- package/dist/components/native-select.js +26 -0
- package/dist/components/native-select.js.map +1 -0
- package/dist/components/navigation-menu.d.ts +71 -0
- package/dist/components/navigation-menu.d.ts.map +1 -0
- package/dist/components/navigation-menu.js +58 -0
- package/dist/components/navigation-menu.js.map +1 -0
- package/dist/components/pagination.d.ts +70 -0
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/pagination.js +51 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/popover.d.ts +69 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +56 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/progress-circle.d.ts +72 -0
- package/dist/components/progress-circle.d.ts.map +1 -0
- package/dist/components/progress-circle.js +58 -0
- package/dist/components/progress-circle.js.map +1 -0
- package/dist/components/progress.d.ts +13 -0
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/progress.js +16 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/radio-cards.d.ts +21 -0
- package/dist/components/radio-cards.d.ts.map +1 -0
- package/dist/components/radio-cards.js +21 -0
- package/dist/components/radio-cards.js.map +1 -0
- package/dist/components/radio-group.d.ts +21 -0
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +20 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/radio.d.ts +14 -0
- package/dist/components/radio.d.ts.map +1 -0
- package/dist/components/radio.js +14 -0
- package/dist/components/radio.js.map +1 -0
- package/dist/components/resizable.d.ts +31 -0
- package/dist/components/resizable.d.ts.map +1 -0
- package/dist/components/resizable.js +26 -0
- package/dist/components/resizable.js.map +1 -0
- package/dist/components/scroll-area.d.ts +27 -0
- package/dist/components/scroll-area.d.ts.map +1 -0
- package/dist/components/scroll-area.js +29 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/select.d.ts +87 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +70 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.d.ts +23 -0
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/separator.js +21 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/sheet.d.ts +88 -0
- package/dist/components/sheet.d.ts.map +1 -0
- package/dist/components/sheet.js +69 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/sidebar.d.ts +231 -0
- package/dist/components/sidebar.d.ts.map +1 -0
- package/dist/components/sidebar.js +279 -0
- package/dist/components/sidebar.js.map +1 -0
- package/dist/components/skeleton.d.ts +12 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +13 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/slider.d.ts +13 -0
- package/dist/components/slider.d.ts.map +1 -0
- package/dist/components/slider.js +21 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/sonner.d.ts +14 -0
- package/dist/components/sonner.d.ts.map +1 -0
- package/dist/components/sonner.js +32 -0
- package/dist/components/sonner.js.map +1 -0
- package/dist/components/spinner.d.ts +14 -0
- package/dist/components/spinner.d.ts.map +1 -0
- package/dist/components/spinner.js +30 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/switch.d.ts +15 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +14 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table.d.ts +68 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +55 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +38 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +33 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/textarea.d.ts +12 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +13 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/toggle-group.d.ts +30 -0
- package/dist/components/toggle-group.d.ts.map +1 -0
- package/dist/components/toggle-group.js +42 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.d.ts +15 -0
- package/dist/components/toggle.d.ts.map +1 -0
- package/dist/components/toggle.js +14 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/tooltip.d.ts +45 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +38 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/hooks/{use-animated-value.d.mts → use-animated-value.d.ts} +2 -4
- package/dist/hooks/use-animated-value.d.ts.map +1 -0
- package/dist/hooks/use-animated-value.js +73 -0
- package/dist/hooks/use-animated-value.js.map +1 -0
- package/dist/hooks/{use-copy-to-clipboard.d.mts → use-copy-to-clipboard.d.ts} +6 -11
- package/dist/hooks/use-copy-to-clipboard.d.ts.map +1 -0
- package/dist/hooks/use-copy-to-clipboard.js +48 -0
- package/dist/hooks/use-copy-to-clipboard.js.map +1 -0
- package/dist/hooks/{use-is-mobile.d.mts → use-is-mobile.d.ts} +2 -4
- package/dist/hooks/use-is-mobile.d.ts.map +1 -0
- package/dist/hooks/use-is-mobile.js +25 -0
- package/dist/hooks/use-is-mobile.js.map +1 -0
- package/dist/hooks/{use-media-query.d.mts → use-media-query.d.ts} +2 -4
- package/dist/hooks/use-media-query.d.ts.map +1 -0
- package/dist/hooks/use-media-query.js +55 -0
- package/dist/hooks/use-media-query.js.map +1 -0
- package/dist/hooks/use-message-scroller-commands.d.ts +22 -0
- package/dist/hooks/use-message-scroller-commands.d.ts.map +1 -0
- package/dist/hooks/use-message-scroller-commands.js +190 -0
- package/dist/hooks/use-message-scroller-commands.js.map +1 -0
- package/dist/hooks/use-message-scroller-controller.d.ts +12 -0
- package/dist/hooks/use-message-scroller-controller.d.ts.map +1 -0
- package/dist/hooks/use-message-scroller-controller.js +471 -0
- package/dist/hooks/use-message-scroller-controller.js.map +1 -0
- package/dist/hooks/use-message-scroller-refs.d.ts +54 -0
- package/dist/hooks/use-message-scroller-refs.d.ts.map +1 -0
- package/dist/hooks/use-message-scroller-refs.js +88 -0
- package/dist/hooks/use-message-scroller-refs.js.map +1 -0
- package/dist/hooks/{use-mutation-observer.d.mts → use-mutation-observer.d.ts} +3 -6
- package/dist/hooks/use-mutation-observer.d.ts.map +1 -0
- package/dist/hooks/use-mutation-observer.js +42 -0
- package/dist/hooks/use-mutation-observer.js.map +1 -0
- package/dist/hooks/{use-pagination.d.mts → use-pagination.d.ts} +21 -28
- package/dist/hooks/use-pagination.d.ts.map +1 -0
- package/dist/hooks/use-pagination.js +117 -0
- package/dist/hooks/use-pagination.js.map +1 -0
- package/dist/index.d.ts +181 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +94 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/message-scroller/{geometry.d.mts → geometry.d.ts} +40 -73
- package/dist/lib/message-scroller/geometry.d.ts.map +1 -0
- package/dist/lib/message-scroller/geometry.js +246 -0
- package/dist/lib/message-scroller/geometry.js.map +1 -0
- package/dist/lib/message-scroller/{stores.d.mts → stores.d.ts} +3 -5
- package/dist/lib/message-scroller/stores.d.ts.map +1 -0
- package/dist/lib/message-scroller/stores.js +64 -0
- package/dist/lib/message-scroller/stores.js.map +1 -0
- package/dist/lib/message-scroller/types.d.ts +170 -0
- package/dist/lib/message-scroller/types.d.ts.map +1 -0
- package/dist/lib/message-scroller/types.js +66 -0
- package/dist/lib/message-scroller/types.js.map +1 -0
- package/dist/lib/message-scroller/{utils.d.mts → utils.d.ts} +2 -3
- package/dist/lib/message-scroller/utils.d.ts.map +1 -0
- package/dist/lib/message-scroller/utils.js +11 -0
- package/dist/lib/message-scroller/utils.js.map +1 -0
- package/dist/lib/{use-render.d.mts → use-render.d.ts} +14 -19
- package/dist/lib/use-render.d.ts.map +1 -0
- package/dist/lib/use-render.js +119 -0
- package/dist/lib/use-render.js.map +1 -0
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/{utils.mjs → utils.js} +1 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/primitives/checkbox-group.d.ts +135 -0
- package/dist/primitives/checkbox-group.d.ts.map +1 -0
- package/dist/primitives/checkbox-group.js +120 -0
- package/dist/primitives/checkbox-group.js.map +1 -0
- package/dist/primitives/input-number.d.ts +109 -0
- package/dist/primitives/input-number.d.ts.map +1 -0
- package/dist/primitives/input-number.js +532 -0
- package/dist/primitives/input-number.js.map +1 -0
- package/dist/primitives/input.d.ts +77 -0
- package/dist/primitives/input.d.ts.map +1 -0
- package/dist/primitives/input.js +83 -0
- package/dist/primitives/input.js.map +1 -0
- package/dist/primitives/message-scroller.d.ts +43 -0
- package/dist/primitives/message-scroller.d.ts.map +1 -0
- package/dist/primitives/message-scroller.js +210 -0
- package/dist/primitives/message-scroller.js.map +1 -0
- package/dist/primitives/progress-circle.d.ts +166 -0
- package/dist/primitives/progress-circle.d.ts.map +1 -0
- package/dist/primitives/progress-circle.js +171 -0
- package/dist/primitives/progress-circle.js.map +1 -0
- package/dist/variants/{alert.d.mts → alert.d.ts} +8 -9
- package/dist/variants/alert.d.ts.map +1 -0
- package/dist/variants/alert.js +24 -0
- package/dist/variants/alert.js.map +1 -0
- package/dist/variants/{attachment.d.mts → attachment.d.ts} +17 -18
- package/dist/variants/attachment.d.ts.map +1 -0
- package/dist/variants/attachment.js +54 -0
- package/dist/variants/attachment.js.map +1 -0
- package/dist/variants/badge.d.ts +21 -0
- package/dist/variants/badge.d.ts.map +1 -0
- package/dist/variants/badge.js +28 -0
- package/dist/variants/badge.js.map +1 -0
- package/dist/variants/{bubble.d.mts → bubble.d.ts} +21 -22
- package/dist/variants/bubble.d.ts.map +1 -0
- package/dist/variants/bubble.js +57 -0
- package/dist/variants/bubble.js.map +1 -0
- package/dist/variants/{button-group.d.mts → button-group.d.ts} +8 -9
- package/dist/variants/button-group.d.ts.map +1 -0
- package/dist/variants/button-group.js +24 -0
- package/dist/variants/button-group.js.map +1 -0
- package/dist/variants/button.d.ts +31 -0
- package/dist/variants/button.d.ts.map +1 -0
- package/dist/variants/button.js +39 -0
- package/dist/variants/button.js.map +1 -0
- package/dist/variants/{empty.d.mts → empty.d.ts} +8 -9
- package/dist/variants/empty.d.ts.map +1 -0
- package/dist/variants/empty.js +24 -0
- package/dist/variants/empty.js.map +1 -0
- package/dist/variants/field.d.ts +18 -0
- package/dist/variants/field.d.ts.map +1 -0
- package/dist/variants/field.js +25 -0
- package/dist/variants/field.js.map +1 -0
- package/dist/variants/{input-group.d.mts → input-group.d.ts} +16 -17
- package/dist/variants/input-group.d.ts.map +1 -0
- package/dist/variants/input-group.js +55 -0
- package/dist/variants/input-group.js.map +1 -0
- package/dist/variants/{item.d.mts → item.d.ts} +19 -20
- package/dist/variants/item.d.ts.map +1 -0
- package/dist/variants/item.js +50 -0
- package/dist/variants/item.js.map +1 -0
- package/dist/variants/{marker.d.mts → marker.d.ts} +9 -10
- package/dist/variants/marker.d.ts.map +1 -0
- package/dist/variants/marker.js +27 -0
- package/dist/variants/marker.js.map +1 -0
- package/dist/variants/{navigation-menu.d.mts → navigation-menu.d.ts} +4 -5
- package/dist/variants/navigation-menu.d.ts.map +1 -0
- package/dist/variants/navigation-menu.js +15 -0
- package/dist/variants/navigation-menu.js.map +1 -0
- package/dist/variants/progress-circle.d.ts +51 -0
- package/dist/variants/progress-circle.d.ts.map +1 -0
- package/dist/variants/progress-circle.js +36 -0
- package/dist/variants/progress-circle.js.map +1 -0
- package/dist/variants/scroll-area.d.ts +23 -0
- package/dist/variants/scroll-area.d.ts.map +1 -0
- package/dist/variants/scroll-area.js +63 -0
- package/dist/variants/scroll-area.js.map +1 -0
- package/dist/variants/separator.d.ts +22 -0
- package/dist/variants/separator.d.ts.map +1 -0
- package/dist/variants/separator.js +30 -0
- package/dist/variants/separator.js.map +1 -0
- package/dist/variants/sheet.d.ts +19 -0
- package/dist/variants/sheet.d.ts.map +1 -0
- package/dist/variants/sheet.js +26 -0
- package/dist/variants/sheet.js.map +1 -0
- package/dist/variants/sidebar.d.ts +22 -0
- package/dist/variants/sidebar.d.ts.map +1 -0
- package/dist/variants/sidebar.js +30 -0
- package/dist/variants/sidebar.js.map +1 -0
- package/dist/variants/{tabs.d.mts → tabs.d.ts} +8 -9
- package/dist/variants/tabs.d.ts.map +1 -0
- package/dist/variants/tabs.js +24 -0
- package/dist/variants/tabs.js.map +1 -0
- package/dist/variants/toggle.d.ts +22 -0
- package/dist/variants/toggle.d.ts.map +1 -0
- package/dist/variants/toggle.js +30 -0
- package/dist/variants/toggle.js.map +1 -0
- package/package.json +253 -262
- package/src/components/accordion.tsx +3 -3
- package/src/components/alert-dialog.tsx +7 -7
- package/src/components/alert.tsx +1 -1
- package/src/components/aspect-ratio.tsx +1 -1
- package/src/components/attachment.tsx +1 -1
- package/src/components/avatar.tsx +1 -1
- package/src/components/badge.tsx +1 -1
- package/src/components/breadcrumb.tsx +3 -6
- package/src/components/bubble.tsx +1 -1
- package/src/components/button-group.tsx +2 -2
- package/src/components/button.tsx +1 -1
- package/src/components/calendar.tsx +2 -2
- package/src/components/card.tsx +2 -2
- package/src/components/checkbox-cards.tsx +2 -2
- package/src/components/checkbox.tsx +1 -1
- package/src/components/collapsible.tsx +1 -1
- package/src/components/context-menu.tsx +8 -8
- package/src/components/dialog.tsx +9 -6
- package/src/components/direction.tsx +1 -1
- package/src/components/drawer.tsx +3 -3
- package/src/components/dropdown-menu.tsx +8 -8
- package/src/components/empty.tsx +3 -3
- package/src/components/field.tsx +5 -5
- package/src/components/form.tsx +2 -2
- package/src/components/hover-card.tsx +2 -2
- package/src/components/input-group.tsx +2 -2
- package/src/components/input-number.tsx +166 -112
- package/src/components/input-otp.tsx +2 -2
- package/src/components/input.tsx +1 -1
- package/src/components/item.tsx +1 -1
- package/src/components/label.tsx +1 -1
- package/src/components/marker.tsx +1 -1
- package/src/components/menubar.tsx +12 -12
- package/src/components/native-select.tsx +1 -1
- package/src/components/navigation-menu.tsx +3 -3
- package/src/components/pagination.tsx +4 -4
- package/src/components/popover.tsx +3 -3
- package/src/components/progress.tsx +2 -2
- package/src/components/radio-cards.tsx +3 -3
- package/src/components/radio-group.tsx +2 -2
- package/src/components/scroll-area.tsx +1 -1
- package/src/components/select.tsx +5 -5
- package/src/components/separator.tsx +1 -1
- package/src/components/sheet.tsx +4 -4
- package/src/components/sidebar.tsx +11 -4
- package/src/components/slider.tsx +3 -3
- package/src/components/spinner.tsx +1 -1
- package/src/components/switch.tsx +1 -1
- package/src/components/tabs.tsx +2 -2
- package/src/components/textarea.tsx +1 -1
- package/src/components/toggle-group.tsx +3 -3
- package/src/components/toggle.tsx +1 -1
- package/src/components/tooltip.tsx +1 -1
- package/src/lib/message-scroller/geometry.ts +6 -2
- package/src/lib/message-scroller/stores.ts +2 -2
- package/src/primitives/checkbox-group.tsx +5 -6
- package/src/primitives/input-number.tsx +122 -43
- package/src/variants/alert.ts +1 -1
- package/src/variants/button-group.ts +3 -3
- package/src/variants/button.ts +9 -10
- package/src/variants/empty.ts +1 -1
- package/src/variants/field.ts +3 -3
- package/src/variants/input-group.ts +3 -3
- package/src/variants/item.ts +2 -2
- package/src/variants/navigation-menu.ts +1 -1
- package/src/variants/tabs.ts +1 -1
- package/src/variants/toggle.ts +4 -4
- package/dist/components/accordion.d.mts +0 -52
- package/dist/components/accordion.mjs +0 -65
- package/dist/components/alert-dialog.d.mts +0 -135
- package/dist/components/alert-dialog.mjs +0 -130
- package/dist/components/alert.d.mts +0 -51
- package/dist/components/alert.mjs +0 -50
- package/dist/components/aspect-ratio.d.mts +0 -16
- package/dist/components/aspect-ratio.mjs +0 -14
- package/dist/components/attachment.mjs +0 -112
- package/dist/components/avatar.d.mts +0 -75
- package/dist/components/avatar.mjs +0 -67
- package/dist/components/badge.d.mts +0 -21
- package/dist/components/badge.mjs +0 -20
- package/dist/components/breadcrumb.d.mts +0 -85
- package/dist/components/breadcrumb.mjs +0 -89
- package/dist/components/bubble.d.mts +0 -67
- package/dist/components/bubble.mjs +0 -58
- package/dist/components/button-group.d.mts +0 -45
- package/dist/components/button-group.mjs +0 -43
- package/dist/components/button.d.mts +0 -24
- package/dist/components/button.mjs +0 -35
- package/dist/components/calendar.d.mts +0 -43
- package/dist/components/calendar.mjs +0 -117
- package/dist/components/card.d.mts +0 -85
- package/dist/components/card.mjs +0 -76
- package/dist/components/carousel.mjs +0 -172
- package/dist/components/chart.d.mts +0 -135
- package/dist/components/chart.mjs +0 -214
- package/dist/components/checkbox-cards.d.mts +0 -29
- package/dist/components/checkbox-cards.mjs +0 -36
- package/dist/components/checkbox-group.d.mts +0 -28
- package/dist/components/checkbox-group.mjs +0 -32
- package/dist/components/checkbox.d.mts +0 -17
- package/dist/components/checkbox.mjs +0 -22
- package/dist/components/collapsible.d.mts +0 -36
- package/dist/components/collapsible.mjs +0 -32
- package/dist/components/command.d.mts +0 -127
- package/dist/components/command.mjs +0 -125
- package/dist/components/context-menu.d.mts +0 -188
- package/dist/components/context-menu.mjs +0 -172
- package/dist/components/dialog.d.mts +0 -115
- package/dist/components/dialog.mjs +0 -121
- package/dist/components/direction.d.mts +0 -24
- package/dist/components/direction.mjs +0 -18
- package/dist/components/drawer.d.mts +0 -101
- package/dist/components/drawer.mjs +0 -97
- package/dist/components/dropdown-menu.d.mts +0 -189
- package/dist/components/dropdown-menu.mjs +0 -178
- package/dist/components/empty.d.mts +0 -73
- package/dist/components/empty.mjs +0 -70
- package/dist/components/field.d.mts +0 -131
- package/dist/components/field.mjs +0 -135
- package/dist/components/form.mjs +0 -113
- package/dist/components/hover-card.d.mts +0 -50
- package/dist/components/hover-card.mjs +0 -49
- package/dist/components/input-group.d.mts +0 -79
- package/dist/components/input-group.mjs +0 -87
- package/dist/components/input-number.d.mts +0 -36
- package/dist/components/input-number.mjs +0 -86
- package/dist/components/input-otp.d.mts +0 -53
- package/dist/components/input-otp.mjs +0 -62
- package/dist/components/input-password.d.mts +0 -19
- package/dist/components/input-password.mjs +0 -38
- package/dist/components/input-search.d.mts +0 -26
- package/dist/components/input-search.mjs +0 -51
- package/dist/components/input.d.mts +0 -17
- package/dist/components/input.mjs +0 -16
- package/dist/components/item.d.mts +0 -123
- package/dist/components/item.mjs +0 -120
- package/dist/components/kbd.d.mts +0 -27
- package/dist/components/kbd.mjs +0 -25
- package/dist/components/label.d.mts +0 -17
- package/dist/components/label.mjs +0 -16
- package/dist/components/marker.mjs +0 -42
- package/dist/components/menubar.d.mts +0 -202
- package/dist/components/menubar.mjs +0 -188
- package/dist/components/message-scroller.d.mts +0 -89
- package/dist/components/message-scroller.mjs +0 -77
- package/dist/components/message.mjs +0 -66
- package/dist/components/native-select.d.mts +0 -41
- package/dist/components/native-select.mjs +0 -46
- package/dist/components/navigation-menu.d.mts +0 -100
- package/dist/components/navigation-menu.mjs +0 -103
- package/dist/components/pagination.d.mts +0 -94
- package/dist/components/pagination.mjs +0 -107
- package/dist/components/popover.d.mts +0 -93
- package/dist/components/popover.mjs +0 -88
- package/dist/components/progress-circle.d.mts +0 -89
- package/dist/components/progress-circle.mjs +0 -80
- package/dist/components/progress.d.mts +0 -18
- package/dist/components/progress.mjs +0 -21
- package/dist/components/radio-cards.d.mts +0 -26
- package/dist/components/radio-cards.mjs +0 -35
- package/dist/components/radio-group.d.mts +0 -28
- package/dist/components/radio-group.mjs +0 -31
- package/dist/components/radio.d.mts +0 -20
- package/dist/components/radio.mjs +0 -18
- package/dist/components/resizable.d.mts +0 -41
- package/dist/components/resizable.mjs +0 -36
- package/dist/components/scroll-area.d.mts +0 -39
- package/dist/components/scroll-area.mjs +0 -56
- package/dist/components/select.d.mts +0 -122
- package/dist/components/select.mjs +0 -131
- package/dist/components/separator.d.mts +0 -32
- package/dist/components/separator.mjs +0 -33
- package/dist/components/sheet.d.mts +0 -119
- package/dist/components/sheet.mjs +0 -123
- package/dist/components/sidebar.d.mts +0 -320
- package/dist/components/sidebar.mjs +0 -414
- package/dist/components/skeleton.d.mts +0 -16
- package/dist/components/skeleton.mjs +0 -15
- package/dist/components/slider.d.mts +0 -21
- package/dist/components/slider.mjs +0 -41
- package/dist/components/sonner.d.mts +0 -16
- package/dist/components/sonner.mjs +0 -32
- package/dist/components/spinner.d.mts +0 -20
- package/dist/components/spinner.mjs +0 -42
- package/dist/components/switch.d.mts +0 -20
- package/dist/components/switch.mjs +0 -21
- package/dist/components/table.d.mts +0 -93
- package/dist/components/table.mjs +0 -89
- package/dist/components/tabs.d.mts +0 -53
- package/dist/components/tabs.mjs +0 -53
- package/dist/components/textarea.d.mts +0 -16
- package/dist/components/textarea.mjs +0 -15
- package/dist/components/toggle-group.d.mts +0 -46
- package/dist/components/toggle-group.mjs +0 -58
- package/dist/components/toggle.d.mts +0 -20
- package/dist/components/toggle.mjs +0 -20
- package/dist/components/tooltip.d.mts +0 -61
- package/dist/components/tooltip.mjs +0 -59
- package/dist/hooks/use-animated-value.mjs +0 -65
- package/dist/hooks/use-copy-to-clipboard.mjs +0 -44
- package/dist/hooks/use-is-mobile.mjs +0 -27
- package/dist/hooks/use-media-query.mjs +0 -51
- package/dist/hooks/use-message-scroller-commands.d.mts +0 -39
- package/dist/hooks/use-message-scroller-commands.mjs +0 -165
- package/dist/hooks/use-message-scroller-controller.d.mts +0 -19
- package/dist/hooks/use-message-scroller-controller.mjs +0 -382
- package/dist/hooks/use-message-scroller-refs.d.mts +0 -60
- package/dist/hooks/use-message-scroller-refs.mjs +0 -77
- package/dist/hooks/use-mutation-observer.mjs +0 -42
- package/dist/hooks/use-pagination.mjs +0 -122
- package/dist/index.d.mts +0 -96
- package/dist/index.mjs +0 -95
- package/dist/lib/message-scroller/geometry.mjs +0 -199
- package/dist/lib/message-scroller/stores.mjs +0 -52
- package/dist/lib/message-scroller/types.d.mts +0 -171
- package/dist/lib/message-scroller/types.mjs +0 -53
- package/dist/lib/message-scroller/utils.mjs +0 -12
- package/dist/lib/use-render.mjs +0 -84
- package/dist/lib/utils.d.mts +0 -2
- package/dist/primitives/checkbox-group.d.mts +0 -154
- package/dist/primitives/checkbox-group.mjs +0 -137
- package/dist/primitives/input-number.d.mts +0 -119
- package/dist/primitives/input-number.mjs +0 -532
- package/dist/primitives/input.d.mts +0 -81
- package/dist/primitives/input.mjs +0 -80
- package/dist/primitives/message-scroller.d.mts +0 -88
- package/dist/primitives/message-scroller.mjs +0 -240
- package/dist/primitives/progress-circle.d.mts +0 -195
- package/dist/primitives/progress-circle.mjs +0 -189
- package/dist/variants/alert.mjs +0 -15
- package/dist/variants/attachment.mjs +0 -42
- package/dist/variants/badge.d.mts +0 -22
- package/dist/variants/badge.mjs +0 -19
- package/dist/variants/bubble.mjs +0 -45
- package/dist/variants/button-group.mjs +0 -15
- package/dist/variants/button.d.mts +0 -32
- package/dist/variants/button.mjs +0 -34
- package/dist/variants/empty.mjs +0 -15
- package/dist/variants/field.d.mts +0 -19
- package/dist/variants/field.mjs +0 -16
- package/dist/variants/input-group.mjs +0 -34
- package/dist/variants/input-number.d.mts +0 -45
- package/dist/variants/input-number.mjs +0 -40
- package/dist/variants/item.mjs +0 -38
- package/dist/variants/marker.mjs +0 -18
- package/dist/variants/navigation-menu.mjs +0 -8
- package/dist/variants/progress-circle.d.mts +0 -52
- package/dist/variants/progress-circle.mjs +0 -45
- package/dist/variants/scroll-area.d.mts +0 -24
- package/dist/variants/scroll-area.mjs +0 -58
- package/dist/variants/separator.d.mts +0 -23
- package/dist/variants/separator.mjs +0 -25
- package/dist/variants/sheet.d.mts +0 -20
- package/dist/variants/sheet.mjs +0 -17
- package/dist/variants/sidebar.d.mts +0 -23
- package/dist/variants/sidebar.mjs +0 -25
- package/dist/variants/tabs.mjs +0 -15
- package/dist/variants/toggle.d.mts +0 -23
- package/dist/variants/toggle.mjs +0 -25
- package/src/variants/input-number.ts +0 -65
|
@@ -0,0 +1,532 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { composeEventHandlers } from "radix-ui/internal";
|
|
3
|
+
import { Context } from "radix-ui/internal";
|
|
4
|
+
import { useControllableState } from "radix-ui/internal";
|
|
5
|
+
import { useCallback, useEffect, useMemo, useRef } from "react";
|
|
6
|
+
import * as InputPrimitive from "#/primitives/input";
|
|
7
|
+
import { createInputScope } from "#/primitives/input";
|
|
8
|
+
/* -----------------------------------------------------------------------------
|
|
9
|
+
* Context: InputNumber
|
|
10
|
+
* -------------------------------------------------------------------------- */
|
|
11
|
+
/**
|
|
12
|
+
* The name of the InputNumber component constant.
|
|
13
|
+
*/
|
|
14
|
+
const NUMBER_INPUT_NAME = "InputNumber";
|
|
15
|
+
const [createInputNumberContext, createInputNumberScope] = Context.createContextScope(NUMBER_INPUT_NAME, [
|
|
16
|
+
createInputScope,
|
|
17
|
+
]);
|
|
18
|
+
const useInputScope = createInputScope();
|
|
19
|
+
const [InputNumberContextProvider, useInputNumberContext] = createInputNumberContext(NUMBER_INPUT_NAME);
|
|
20
|
+
/**
|
|
21
|
+
* @since 0.3.16-canary.0
|
|
22
|
+
*/
|
|
23
|
+
function InputNumber(numberInputProps) {
|
|
24
|
+
const { __scopeInputNumber, ariaDecrementLabel, ariaIncrementLabel, defaultValue, formatOptions = { minimumFractionDigits: 0, style: "decimal" }, id, locale, max, min, onChange, step = 1, value: valueProperty, ...props } = numberInputProps;
|
|
25
|
+
/**
|
|
26
|
+
* Context.Scope for the input component
|
|
27
|
+
*/
|
|
28
|
+
const inputScope = useInputScope(__scopeInputNumber);
|
|
29
|
+
/**
|
|
30
|
+
* Reference to the input element
|
|
31
|
+
*/
|
|
32
|
+
const inputRef = useRef(null);
|
|
33
|
+
/**
|
|
34
|
+
* Controlled or uncontrolled value state
|
|
35
|
+
*/
|
|
36
|
+
const [value, setValue] = useControllableState({
|
|
37
|
+
defaultProp: defaultValue,
|
|
38
|
+
onChange,
|
|
39
|
+
prop: valueProperty,
|
|
40
|
+
});
|
|
41
|
+
/**
|
|
42
|
+
* Separators used for number formatting based on locale
|
|
43
|
+
*/
|
|
44
|
+
const { decimalSeparator, thousandSeparator } = useMemo(() => getNumberFormatSeparators(locale), [locale]);
|
|
45
|
+
// Stable reference so an inline `formatOptions` literal doesn't churn the format callbacks every render.
|
|
46
|
+
const formatOptionsKey = JSON.stringify(formatOptions);
|
|
47
|
+
const stableFormatOptions = useMemo(() => JSON.parse(formatOptionsKey), [formatOptionsKey]);
|
|
48
|
+
/**
|
|
49
|
+
* Formats a number value into a string representation
|
|
50
|
+
* @param inputValue - The number to format
|
|
51
|
+
* @returns A formatted string representation of the number
|
|
52
|
+
*/
|
|
53
|
+
const formatValue = useCallback((inputValue) => {
|
|
54
|
+
if (inputValue === undefined || Number.isNaN(inputValue)) {
|
|
55
|
+
return "";
|
|
56
|
+
}
|
|
57
|
+
return new Intl.NumberFormat(locale, stableFormatOptions).format(inputValue);
|
|
58
|
+
}, [stableFormatOptions, locale]);
|
|
59
|
+
/**
|
|
60
|
+
* Parses a string or number input into a normalized number value
|
|
61
|
+
* @param inputValue - The value to parse
|
|
62
|
+
* @returns The parsed number value, clamped between min and max
|
|
63
|
+
*/
|
|
64
|
+
const parseValue = useCallback((inputValue) => {
|
|
65
|
+
if (typeof inputValue === "number") {
|
|
66
|
+
return clamp(inputValue, min, max);
|
|
67
|
+
}
|
|
68
|
+
if (typeof inputValue !== "string") {
|
|
69
|
+
return Number.NaN;
|
|
70
|
+
}
|
|
71
|
+
const cleanedValue = inputValue.trim().replaceAll(/[^\d.,\-()]/g, "");
|
|
72
|
+
if (cleanedValue === "") {
|
|
73
|
+
return Number.NaN;
|
|
74
|
+
}
|
|
75
|
+
const normalizedValue = normalizeInputValue(cleanedValue, thousandSeparator, decimalSeparator);
|
|
76
|
+
let parsedValue = Number.parseFloat(normalizedValue);
|
|
77
|
+
if (stableFormatOptions.style === "percent") {
|
|
78
|
+
parsedValue /= 100;
|
|
79
|
+
}
|
|
80
|
+
return Number.isNaN(parsedValue) ? 0 : clamp(parsedValue, min, max);
|
|
81
|
+
}, [decimalSeparator, stableFormatOptions.style, max, min, thousandSeparator]);
|
|
82
|
+
/**
|
|
83
|
+
* Changes the current value based on a provided operation
|
|
84
|
+
* @param operation - Function that takes the current value and returns a new value
|
|
85
|
+
*/
|
|
86
|
+
const changeNumberValue = useCallback((operation) => {
|
|
87
|
+
const inputElement = inputRef.current;
|
|
88
|
+
if (!inputElement || props.disabled || props.readOnly) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const parsedValue = parseValue(inputElement.value);
|
|
92
|
+
const currentValue = Number.isNaN(parsedValue) ? 0 : parsedValue;
|
|
93
|
+
const newValue = clamp(roundToStep(operation(currentValue), step), min, max);
|
|
94
|
+
inputElement.value = formatValue(newValue);
|
|
95
|
+
setValue(newValue);
|
|
96
|
+
}, [props.disabled, formatValue, max, min, parseValue, props.readOnly, setValue, step]);
|
|
97
|
+
/**
|
|
98
|
+
* Increments the current value by the step amount
|
|
99
|
+
*/
|
|
100
|
+
const handleIncrement = useCallback(() => {
|
|
101
|
+
changeNumberValue((number) => number + step);
|
|
102
|
+
}, [changeNumberValue, step]);
|
|
103
|
+
/**
|
|
104
|
+
* Decrements the current value by the step amount
|
|
105
|
+
*/
|
|
106
|
+
const handleDecrement = useCallback(() => {
|
|
107
|
+
changeNumberValue((number) => number - step);
|
|
108
|
+
}, [changeNumberValue, step]);
|
|
109
|
+
/**
|
|
110
|
+
* Sets the value to the maximum allowed
|
|
111
|
+
*/
|
|
112
|
+
const handleIncrementToMax = useCallback(() => {
|
|
113
|
+
changeNumberValue((number) => max ?? number + step);
|
|
114
|
+
}, [changeNumberValue, max, step]);
|
|
115
|
+
/**
|
|
116
|
+
* Sets the value to the minimum allowed
|
|
117
|
+
*/
|
|
118
|
+
const handleDecrementToMin = useCallback(() => {
|
|
119
|
+
changeNumberValue((number) => min ?? number - step);
|
|
120
|
+
}, [changeNumberValue, min, step]);
|
|
121
|
+
return (_jsx(InputNumberContextProvider, { ariaDecrementLabel: ariaDecrementLabel, ariaIncrementLabel: ariaIncrementLabel, defaultValue: defaultValue, disabled: props.disabled, formatOptions: stableFormatOptions, formatValue: formatValue, id: id, inputRef: inputRef, max: max, min: min, parseValue: parseValue, readOnly: props.readOnly, scope: __scopeInputNumber, value: value, onChange: setValue, onDecrement: handleDecrement, onDecrementToMin: handleDecrementToMin, onIncrement: handleIncrement, onIncrementToMax: handleIncrementToMax, children: _jsx(InputPrimitive.Root, { ...inputScope, ...props }) }));
|
|
122
|
+
}
|
|
123
|
+
/* -----------------------------------------------------------------------------
|
|
124
|
+
* Component: InputNumberField
|
|
125
|
+
* -------------------------------------------------------------------------- */
|
|
126
|
+
/**
|
|
127
|
+
* The name of the InputNumberField component constant.
|
|
128
|
+
*/
|
|
129
|
+
const NUMBER_INPUT_FIELD_NAME = "InputNumberField";
|
|
130
|
+
/**
|
|
131
|
+
* @since 0.3.16-canary.0
|
|
132
|
+
*/
|
|
133
|
+
function InputNumberField({ __scopeInputNumber, onBlur, onKeyDown, ...props }) {
|
|
134
|
+
// Retrieve input number context and input scope
|
|
135
|
+
const inputScope = useInputScope(__scopeInputNumber);
|
|
136
|
+
const { defaultValue, disabled, formatValue, id, inputRef, max, min, onChange, onDecrement, onDecrementToMin, onIncrement, onIncrementToMax, parseValue, readOnly, step, value, } = useInputNumberContext(NUMBER_INPUT_FIELD_NAME, __scopeInputNumber);
|
|
137
|
+
/**
|
|
138
|
+
* Handles the blur event to format the value of the input.
|
|
139
|
+
*
|
|
140
|
+
* @param event - The blur event triggered when the input loses focus.
|
|
141
|
+
*/
|
|
142
|
+
const handleBlur = useCallback((event) => {
|
|
143
|
+
const parsedValue = parseValue(event.target.value);
|
|
144
|
+
const numericValue = Number.isNaN(parsedValue) ? undefined : parsedValue;
|
|
145
|
+
const formattedValue = formatValue(numericValue);
|
|
146
|
+
if (formattedValue !== event.target.value) {
|
|
147
|
+
event.target.value = formattedValue;
|
|
148
|
+
}
|
|
149
|
+
onChange(numericValue);
|
|
150
|
+
}, [formatValue, onChange, parseValue]);
|
|
151
|
+
/**
|
|
152
|
+
* Handles keydown events to increment, decrement, or perform other actions.
|
|
153
|
+
*
|
|
154
|
+
* @param event - The keyboard event triggered by key presses.
|
|
155
|
+
*/
|
|
156
|
+
const handleKeyDown = useCallback((event) => {
|
|
157
|
+
switch (event.key) {
|
|
158
|
+
case "ArrowUp": {
|
|
159
|
+
onIncrement();
|
|
160
|
+
event.preventDefault();
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
case "PageUp": {
|
|
164
|
+
onIncrementToMax();
|
|
165
|
+
event.preventDefault();
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
case "ArrowDown": {
|
|
169
|
+
onDecrement();
|
|
170
|
+
event.preventDefault();
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
case "PageDown": {
|
|
174
|
+
onDecrementToMin();
|
|
175
|
+
event.preventDefault();
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
default: {
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}, [onIncrement, onIncrementToMax, onDecrement, onDecrementToMin]);
|
|
183
|
+
/**
|
|
184
|
+
* Prevents invalid keyboard input for the numeric input field.
|
|
185
|
+
*
|
|
186
|
+
* @param event - The keyboard event to handle.
|
|
187
|
+
*/
|
|
188
|
+
const handleKeyDownPrevent = useCallback((event) => {
|
|
189
|
+
switch (event.key) {
|
|
190
|
+
case "ArrowUp":
|
|
191
|
+
case "ArrowDown":
|
|
192
|
+
case "ArrowLeft":
|
|
193
|
+
case "ArrowRight":
|
|
194
|
+
case "PageUp":
|
|
195
|
+
case "PageDown":
|
|
196
|
+
case "Tab":
|
|
197
|
+
case "Escape":
|
|
198
|
+
case "Enter":
|
|
199
|
+
case "Backspace":
|
|
200
|
+
case "Delete":
|
|
201
|
+
case "Home":
|
|
202
|
+
case "End":
|
|
203
|
+
case "%": {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
case ".":
|
|
207
|
+
case ",": {
|
|
208
|
+
// Allow at most one decimal separator unless the current one is inside the selection being replaced.
|
|
209
|
+
const inputElement = inputRef.current;
|
|
210
|
+
if (inputElement &&
|
|
211
|
+
inputElement.selectionStart === inputElement.selectionEnd &&
|
|
212
|
+
/[.,]/.test(inputElement.value)) {
|
|
213
|
+
event.preventDefault();
|
|
214
|
+
}
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
case "-": {
|
|
218
|
+
// Allow a single leading sign only.
|
|
219
|
+
const inputElement = inputRef.current;
|
|
220
|
+
if (inputElement &&
|
|
221
|
+
(inputElement.selectionStart !== 0 ||
|
|
222
|
+
(inputElement.value.includes("-") && inputElement.selectionStart === inputElement.selectionEnd))) {
|
|
223
|
+
event.preventDefault();
|
|
224
|
+
}
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
default: {
|
|
228
|
+
if (isNumberKey(event.key) || isModifierKey(event) || isFunctionKey(event.key)) {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
event.preventDefault();
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}, [inputRef]);
|
|
235
|
+
/**
|
|
236
|
+
* Handles the Enter key to format the value of the input.
|
|
237
|
+
*
|
|
238
|
+
* @param event - The keyboard event triggered by pressing Enter.
|
|
239
|
+
*/
|
|
240
|
+
const handleKeyDownEnter = useCallback((event) => {
|
|
241
|
+
const inputElement = inputRef.current;
|
|
242
|
+
if (event.key !== "Enter" || !inputElement) {
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
const parsedValue = parseValue(inputElement.value);
|
|
246
|
+
const numericValue = Number.isNaN(parsedValue) ? undefined : parsedValue;
|
|
247
|
+
const formattedValue = formatValue(numericValue);
|
|
248
|
+
if (formattedValue !== inputElement.value) {
|
|
249
|
+
inputElement.value = formattedValue;
|
|
250
|
+
}
|
|
251
|
+
onChange(numericValue);
|
|
252
|
+
}, [formatValue, inputRef, onChange, parseValue]);
|
|
253
|
+
/**
|
|
254
|
+
* Creates a combined keydown event handler that processes keyboard events in sequence.
|
|
255
|
+
*
|
|
256
|
+
* The handler chain executes in the following order:
|
|
257
|
+
* 1. User-provided onKeyDown handler (if any)
|
|
258
|
+
* 2. handleKeyDownPrevent - Prevents non-numeric input
|
|
259
|
+
* 3. handleKeyDown - Handles arrow keys and page up/down for value adjustments
|
|
260
|
+
* 4. handleKeyDownEnter - Handles Enter key press to format and update the value
|
|
261
|
+
*
|
|
262
|
+
* @returns A composed event handler function for the onKeyDown event
|
|
263
|
+
*/
|
|
264
|
+
const combinedKeyDownHandler = useCallback((event) => {
|
|
265
|
+
composeEventHandlers(onKeyDown, chain(handleKeyDownPrevent, handleKeyDown, handleKeyDownEnter))(event);
|
|
266
|
+
}, [onKeyDown, handleKeyDown, handleKeyDownEnter, handleKeyDownPrevent]);
|
|
267
|
+
/**
|
|
268
|
+
* Adds a listener to handle wheel events for incrementing or decrementing the value.
|
|
269
|
+
*/
|
|
270
|
+
useEffect(() => {
|
|
271
|
+
const handleWheel = (event) => {
|
|
272
|
+
const inputElement = inputRef.current;
|
|
273
|
+
if (!inputElement || disabled || readOnly || document.activeElement !== inputElement) {
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
event.preventDefault();
|
|
277
|
+
// Match native number inputs: scroll up increases, scroll down decreases.
|
|
278
|
+
if (event.deltaY < 0) {
|
|
279
|
+
onIncrement();
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
onDecrement();
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
const inputElement = inputRef.current;
|
|
286
|
+
inputElement?.addEventListener("wheel", handleWheel);
|
|
287
|
+
return () => {
|
|
288
|
+
inputElement?.removeEventListener("wheel", handleWheel);
|
|
289
|
+
};
|
|
290
|
+
}, [onIncrement, onDecrement, inputRef, disabled, readOnly]);
|
|
291
|
+
/**
|
|
292
|
+
* Updates the input field's value when it changes in the context.
|
|
293
|
+
*/
|
|
294
|
+
useEffect(() => {
|
|
295
|
+
const inputElement = inputRef.current;
|
|
296
|
+
if (inputElement && inputElement !== document.activeElement) {
|
|
297
|
+
inputElement.value = formatValue(value);
|
|
298
|
+
}
|
|
299
|
+
}, [formatValue, inputRef, value]);
|
|
300
|
+
/**
|
|
301
|
+
* Adds a listener to handle form reset events by clearing the input value.
|
|
302
|
+
*/
|
|
303
|
+
useEffect(() => {
|
|
304
|
+
const inputElement = inputRef.current;
|
|
305
|
+
if (!inputElement) {
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
const handleReset = () => {
|
|
309
|
+
onChange(defaultValue === undefined ? undefined : parseValue(defaultValue));
|
|
310
|
+
};
|
|
311
|
+
const form = inputElement.form;
|
|
312
|
+
form?.addEventListener("reset", handleReset);
|
|
313
|
+
return () => {
|
|
314
|
+
form?.removeEventListener("reset", handleReset);
|
|
315
|
+
};
|
|
316
|
+
}, [defaultValue, inputRef, onChange, parseValue]);
|
|
317
|
+
const hasValue = value !== undefined && !Number.isNaN(value);
|
|
318
|
+
return (_jsx(InputPrimitive.Field, { ref: inputRef, "aria-valuemax": max, "aria-valuemin": min, "aria-valuenow": hasValue ? value : undefined, "aria-valuetext": hasValue ? formatValue(value) : undefined, defaultValue: formatValue(value), disabled: disabled, id: id, inputMode: "decimal", max: max, min: min, readOnly: readOnly, role: "spinbutton", step: step, onBlur: composeEventHandlers(onBlur, handleBlur), onKeyDown: combinedKeyDownHandler, ...inputScope, ...props }));
|
|
319
|
+
}
|
|
320
|
+
/* -----------------------------------------------------------------------------
|
|
321
|
+
* Component: NumberStepperButton
|
|
322
|
+
* -------------------------------------------------------------------------- */
|
|
323
|
+
/**
|
|
324
|
+
* The name of the NumberStepperButton component constant.
|
|
325
|
+
*/
|
|
326
|
+
const NUMBER_STEPPER_BUTTON_NAME = "NumberStepperButton";
|
|
327
|
+
function NumberStepperButton({ __scopeInputNumber, operation, ...props }) {
|
|
328
|
+
// Destructures relevant context values for the button functionality.
|
|
329
|
+
const { ariaDecrementLabel, ariaIncrementLabel, disabled, id, max, min, onDecrement, onIncrement, value } = useInputNumberContext(NUMBER_STEPPER_BUTTON_NAME, __scopeInputNumber);
|
|
330
|
+
const isDisabled = useMemo(() => {
|
|
331
|
+
if (disabled) {
|
|
332
|
+
return true;
|
|
333
|
+
}
|
|
334
|
+
// Only the button that would push past a bound is disabled — the opposite one must stay usable.
|
|
335
|
+
if (operation === "increment") {
|
|
336
|
+
return max !== undefined && value !== undefined && value >= max;
|
|
337
|
+
}
|
|
338
|
+
return min !== undefined && value !== undefined && value <= min;
|
|
339
|
+
}, [operation, min, max, value, disabled]);
|
|
340
|
+
/**
|
|
341
|
+
* Ref to store a timeout ID for managing repeated button actions.
|
|
342
|
+
*/
|
|
343
|
+
const timeoutIdRef = useRef(null);
|
|
344
|
+
/**
|
|
345
|
+
* Starts a repeated action at a regular interval.
|
|
346
|
+
* The action begins immediately and then continues with a delay.
|
|
347
|
+
*
|
|
348
|
+
* @param callback - The callback function to execute repeatedly.
|
|
349
|
+
*/
|
|
350
|
+
const startActionInterval = useCallback((callback) => {
|
|
351
|
+
// Time between repeated actions (in milliseconds).
|
|
352
|
+
const interval = 100;
|
|
353
|
+
// Function to perform the action and set the next interval.
|
|
354
|
+
const repeatAction = () => {
|
|
355
|
+
callback();
|
|
356
|
+
timeoutIdRef.current = setTimeout(repeatAction, interval);
|
|
357
|
+
};
|
|
358
|
+
callback();
|
|
359
|
+
timeoutIdRef.current = setTimeout(repeatAction, interval * 2);
|
|
360
|
+
}, []);
|
|
361
|
+
/**
|
|
362
|
+
* Clears any ongoing action intervals.
|
|
363
|
+
*/
|
|
364
|
+
const clearActionInterval = useCallback(() => {
|
|
365
|
+
if (timeoutIdRef.current) {
|
|
366
|
+
clearTimeout(timeoutIdRef.current);
|
|
367
|
+
timeoutIdRef.current = null;
|
|
368
|
+
}
|
|
369
|
+
}, []);
|
|
370
|
+
// Stop repeating once the button hits its bound mid-hold (a disabled button never receives pointerup) and on unmount.
|
|
371
|
+
useEffect(() => {
|
|
372
|
+
if (isDisabled) {
|
|
373
|
+
clearActionInterval();
|
|
374
|
+
}
|
|
375
|
+
return clearActionInterval;
|
|
376
|
+
}, [isDisabled, clearActionInterval]);
|
|
377
|
+
/**
|
|
378
|
+
* Handles pointer down events and triggers the appropriate action
|
|
379
|
+
* (`increment` or `decrement`).
|
|
380
|
+
*/
|
|
381
|
+
const handlePointerDown = useCallback(() => {
|
|
382
|
+
const action = operation === "increment" ? onIncrement : onDecrement;
|
|
383
|
+
startActionInterval(action);
|
|
384
|
+
}, [onDecrement, onIncrement, operation, startActionInterval]);
|
|
385
|
+
/**
|
|
386
|
+
* Prevents the context menu from displaying when the button is right-clicked.
|
|
387
|
+
*
|
|
388
|
+
* @param event - The mouse event triggered by the right-click.
|
|
389
|
+
*/
|
|
390
|
+
const handleContextMenu = useCallback((event) => {
|
|
391
|
+
event.preventDefault();
|
|
392
|
+
}, []);
|
|
393
|
+
/**
|
|
394
|
+
* Handles keyboard events to support activation of the button using
|
|
395
|
+
* keyboard navigation (Enter or Space).
|
|
396
|
+
*
|
|
397
|
+
* @param event - The keyboard event with the triggered key.
|
|
398
|
+
*/
|
|
399
|
+
const handleKeyDown = useCallback((event) => {
|
|
400
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
401
|
+
event.preventDefault();
|
|
402
|
+
const action = operation === "increment" ? onIncrement : onDecrement;
|
|
403
|
+
action();
|
|
404
|
+
}
|
|
405
|
+
}, [onDecrement, onIncrement, operation]);
|
|
406
|
+
return (_jsx("button", { "aria-controls": id, "aria-label": operation === "increment" ? ariaIncrementLabel : ariaDecrementLabel, disabled: isDisabled, type: "button", onContextMenu: handleContextMenu, onKeyDown: handleKeyDown, onPointerCancel: clearActionInterval, onPointerDown: handlePointerDown, onPointerLeave: clearActionInterval, onPointerUp: clearActionInterval, ...props }));
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* @since 0.3.16-canary.0
|
|
410
|
+
*/
|
|
411
|
+
function InputNumberIncrementButton(props) {
|
|
412
|
+
return _jsx(NumberStepperButton, { operation: "increment", ...props });
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* @since 0.3.16-canary.0
|
|
416
|
+
*/
|
|
417
|
+
function InputNumberDecrementButton(props) {
|
|
418
|
+
return _jsx(NumberStepperButton, { operation: "decrement", ...props });
|
|
419
|
+
}
|
|
420
|
+
/* -----------------------------------------------------------------------------
|
|
421
|
+
* Utility Functions
|
|
422
|
+
* -------------------------------------------------------------------------- */
|
|
423
|
+
/**
|
|
424
|
+
* Chains multiple callbacks into a single function
|
|
425
|
+
*
|
|
426
|
+
* @param callbacks - Array of callback functions that will be executed in order
|
|
427
|
+
* @returns A single function that executes all callbacks
|
|
428
|
+
*/
|
|
429
|
+
function chain(...callbacks) {
|
|
430
|
+
return (...args) => {
|
|
431
|
+
for (const callback of callbacks) {
|
|
432
|
+
callback(...args);
|
|
433
|
+
}
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* Extracts decimal and a thousand separators from a given locale's number format
|
|
438
|
+
*
|
|
439
|
+
* @param locale - The locale string to use for number formatting (e.g., 'en-US', 'de-DE')
|
|
440
|
+
* @returns Object containing decimal and a thousand separators
|
|
441
|
+
*/
|
|
442
|
+
function getNumberFormatSeparators(locale) {
|
|
443
|
+
const numberFormat = new Intl.NumberFormat(locale);
|
|
444
|
+
const parts = numberFormat.formatToParts(12_345.6);
|
|
445
|
+
let thousandSeparator = "";
|
|
446
|
+
let decimalSeparator = "";
|
|
447
|
+
for (const part of parts) {
|
|
448
|
+
if (part.type === "group") {
|
|
449
|
+
thousandSeparator = part.value;
|
|
450
|
+
}
|
|
451
|
+
if (part.type === "decimal") {
|
|
452
|
+
decimalSeparator = part.value;
|
|
453
|
+
}
|
|
454
|
+
// Stop early if you've found enough.
|
|
455
|
+
if (thousandSeparator && decimalSeparator) {
|
|
456
|
+
break;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
return { decimalSeparator, thousandSeparator };
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Normalizes an input value by removing formatting characters
|
|
463
|
+
*
|
|
464
|
+
* @param value - The input string to normalize
|
|
465
|
+
* @param thousandSeparator - The thousand-separator character to remove
|
|
466
|
+
* @param decimalSeparator - The decimal separator to convert to standard dot notation
|
|
467
|
+
* @returns Normalized string value ready for numeric conversion
|
|
468
|
+
*/
|
|
469
|
+
function normalizeInputValue(value, thousandSeparator, decimalSeparator) {
|
|
470
|
+
return value
|
|
471
|
+
.replaceAll(new RegExp(`\\${thousandSeparator}`, "g"), "")
|
|
472
|
+
.replace(new RegExp(`\\${decimalSeparator}`), ".")
|
|
473
|
+
.replaceAll(/[()]/g, "-");
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* Checks if a keyboard event includes modifier keys (Ctrl, Alt, Meta, Shift)
|
|
477
|
+
*
|
|
478
|
+
* @param event - The keyboard event to check
|
|
479
|
+
* @returns True if any modifier key is pressed
|
|
480
|
+
*/
|
|
481
|
+
function isModifierKey(event) {
|
|
482
|
+
return event.ctrlKey || event.altKey || event.metaKey || event.shiftKey;
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Determines if a key is a function key (F1-F12)
|
|
486
|
+
*
|
|
487
|
+
* @param key - The key name to check
|
|
488
|
+
* @returns True if the key is a function key
|
|
489
|
+
*/
|
|
490
|
+
function isFunctionKey(key) {
|
|
491
|
+
return key.startsWith("F") && key.length > 1;
|
|
492
|
+
}
|
|
493
|
+
/**
|
|
494
|
+
* Checks if a key represents a number (0-9)
|
|
495
|
+
*
|
|
496
|
+
* @param key - The key name to check
|
|
497
|
+
* @returns True if the key represents a number
|
|
498
|
+
*/
|
|
499
|
+
function isNumberKey(key) {
|
|
500
|
+
return !Number.isNaN(Number(key));
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Clamps a numeric value between a minimum and maximum
|
|
504
|
+
*
|
|
505
|
+
* @param value - The value to clamp
|
|
506
|
+
* @param min - The minimum allowed value (defaults to \-Infinity)
|
|
507
|
+
* @param max - The maximum allowed value (defaults to Infinity)
|
|
508
|
+
* @returns The clamped value
|
|
509
|
+
*/
|
|
510
|
+
function clamp(value, min = Number.NEGATIVE_INFINITY, max = Number.POSITIVE_INFINITY) {
|
|
511
|
+
return Math.min(Math.max(value, min), max);
|
|
512
|
+
}
|
|
513
|
+
/**
|
|
514
|
+
* Rounds a value to the decimal precision implied by the step, avoiding floating-point drift
|
|
515
|
+
* (e.g. `0.1 + 0.2`) when stepping with fractional increments.
|
|
516
|
+
*
|
|
517
|
+
* @param value - The value to round
|
|
518
|
+
* @param step - The step whose fractional digit count sets the precision
|
|
519
|
+
* @returns The value rounded to the step's precision
|
|
520
|
+
*/
|
|
521
|
+
function roundToStep(value, step) {
|
|
522
|
+
if (!Number.isFinite(step) || step <= 0) {
|
|
523
|
+
return value;
|
|
524
|
+
}
|
|
525
|
+
const fractionDigits = String(step).split(".")[1]?.length ?? 0;
|
|
526
|
+
return Number(value.toFixed(fractionDigits));
|
|
527
|
+
}
|
|
528
|
+
/* -----------------------------------------------------------------------------
|
|
529
|
+
* Exports
|
|
530
|
+
* -------------------------------------------------------------------------- */
|
|
531
|
+
export { createInputNumberScope, InputNumberDecrementButton as DecrementButton, InputNumberField as Field, InputNumberIncrementButton as IncrementButton, InputNumber, InputNumberDecrementButton, InputNumberField, InputNumberIncrementButton, InputNumber as Root, };
|
|
532
|
+
//# sourceMappingURL=input-number.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-number.js","sourceRoot":"","sources":["../../src/primitives/input-number.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAWzD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,KAAK,cAAc,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;gFAEgF;AAEhF;;GAEG;AACH,MAAM,iBAAiB,GAAG,aAAa,CAAC;AAYxC,MAAM,CAAC,wBAAwB,EAAE,sBAAsB,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,iBAAiB,EAAE;IACvG,gBAAgB;CACjB,CAAC,CAAC;AACH,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;AAsGzC,MAAM,CAAC,0BAA0B,EAAE,qBAAqB,CAAC,GACvD,wBAAwB,CAA0B,iBAAiB,CAAC,CAAC;AAoEvE;;GAEG;AAC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Node } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Type for adding scope to component props
|
|
5
|
+
*/
|
|
6
|
+
type ScopedProps<P> = P & {
|
|
7
|
+
/**
|
|
8
|
+
* Context.Scope for the Input component context
|
|
9
|
+
*/
|
|
10
|
+
__scopeInput?: Context.Scope;
|
|
11
|
+
};
|
|
12
|
+
declare const createInputScope: Context.CreateScope;
|
|
13
|
+
/**
|
|
14
|
+
* Props for styling and appearance of the Input component
|
|
15
|
+
*/
|
|
16
|
+
interface InputVisualProps {
|
|
17
|
+
/**
|
|
18
|
+
* CSS class name for the input container
|
|
19
|
+
*/
|
|
20
|
+
className?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Element to display before the input
|
|
23
|
+
*/
|
|
24
|
+
prefix?: ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* Custom spinner element for loading state
|
|
27
|
+
*/
|
|
28
|
+
spinner?: ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Element to display after the input
|
|
31
|
+
*/
|
|
32
|
+
suffix?: ReactNode;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Props for the behavior and state of the Input component
|
|
36
|
+
*/
|
|
37
|
+
interface InputBehaviorProps {
|
|
38
|
+
/**
|
|
39
|
+
* Whether the input is disabled
|
|
40
|
+
*/
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Position of the loading spinner - either before or after the input
|
|
44
|
+
*/
|
|
45
|
+
loaderPosition?: "prefix" | "suffix";
|
|
46
|
+
/**
|
|
47
|
+
* Whether the input is in the loading state
|
|
48
|
+
*/
|
|
49
|
+
loading?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Whether the input is in read-only mode
|
|
52
|
+
*/
|
|
53
|
+
readOnly?: boolean;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Combined props for the Input component
|
|
57
|
+
*
|
|
58
|
+
* @since 0.3.16-canary.0
|
|
59
|
+
*/
|
|
60
|
+
type InputProps = PropsWithChildren<InputBehaviorProps & InputVisualProps>;
|
|
61
|
+
/**
|
|
62
|
+
* @since 0.3.16-canary.0
|
|
63
|
+
*/
|
|
64
|
+
declare function Input(inputProps: ScopedProps<InputProps>): JSX.Element;
|
|
65
|
+
/**
|
|
66
|
+
* Props for the InputField component
|
|
67
|
+
*
|
|
68
|
+
* @since 0.3.16-canary.0
|
|
69
|
+
*/
|
|
70
|
+
type InputFieldProps = ComponentProps<"input">;
|
|
71
|
+
/**
|
|
72
|
+
* @since 0.3.16-canary.0
|
|
73
|
+
*/
|
|
74
|
+
declare function InputField({ __scopeInput, ...props }: ScopedProps<InputFieldProps>): JSX.Element;
|
|
75
|
+
export { createInputScope, InputField as Field, Input, InputField, Input as Root };
|
|
76
|
+
export type { InputFieldProps, InputProps };
|
|
77
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/primitives/input.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAuB,iBAAiB,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAS/G;;GAEG;AACH,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG;IACxB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC;CAC9B,CAAC;AAEF,QAAA,MAA2B,gBAAgB,qBAA0C,CAAC;AAwBtF;;GAEG;AACH,UAAU,gBAAgB;IACxB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED;;GAEG;AACH,UAAU,kBAAkB;IAC1B;;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