@burtson-labs/ui 0.13.1 → 0.14.1
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/LICENSES/DEPENDENCIES.txt +2745 -0
- package/LICENSES/Radix-MIT.txt +21 -0
- package/LICENSES/cmdk-MIT.txt +21 -0
- package/LICENSES/overrides/react-remove-scroll-bar.txt +26 -0
- package/LICENSES/shadcn-MIT.txt +21 -0
- package/README.md +20 -12
- package/THIRD_PARTY_NOTICES.md +15 -3
- package/dist/components/accordion.d.ts +4 -4
- package/dist/components/accordion.js +22 -18
- package/dist/components/accordion.js.map +1 -1
- package/dist/components/alert-dialog.d.ts +13 -11
- package/dist/components/alert-dialog.js +41 -31
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/alert.d.ts +5 -3
- package/dist/components/alert.js +12 -7
- package/dist/components/alert.js.map +1 -1
- package/dist/components/app-shell.d.ts +7 -6
- package/dist/components/app-shell.js +22 -14
- package/dist/components/app-shell.js.map +1 -1
- package/dist/components/attachment.d.ts +3 -3
- package/dist/components/attachment.js +11 -7
- package/dist/components/attachment.js.map +1 -1
- package/dist/components/audio-player.d.ts +2 -2
- package/dist/components/audio-player.js +9 -6
- package/dist/components/audio-player.js.map +1 -1
- package/dist/components/avatar.d.ts +4 -4
- package/dist/components/avatar.js +16 -12
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/badge.js +15 -13
- package/dist/components/badge.js.map +1 -1
- package/dist/components/breadcrumb.d.ts +8 -8
- package/dist/components/breadcrumb.js +27 -20
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/button.d.ts +9 -2
- package/dist/components/button.js +15 -6
- package/dist/components/button.js.map +1 -1
- package/dist/components/card.d.ts +9 -9
- package/dist/components/card.js +33 -23
- package/dist/components/card.js.map +1 -1
- package/dist/components/chat-history.d.ts +1 -1
- package/dist/components/chat-history.js +11 -9
- package/dist/components/chat-history.js.map +1 -1
- package/dist/components/chat-layout.d.ts +1 -1
- package/dist/components/chat-layout.js +8 -3
- package/dist/components/chat-layout.js.map +1 -1
- package/dist/components/checkbox-card.d.ts +3 -3
- package/dist/components/checkbox-card.js +12 -10
- package/dist/components/checkbox-card.js.map +1 -1
- package/dist/components/checkbox.d.ts +24 -3
- package/dist/components/checkbox.js +52 -9
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/collapsible.d.ts +3 -3
- package/dist/components/collapsible.js +14 -11
- package/dist/components/collapsible.js.map +1 -1
- package/dist/components/combobox.d.ts +14 -4
- package/dist/components/combobox.js +19 -8
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/command.d.ts +68 -12
- package/dist/components/command.js +48 -34
- package/dist/components/command.js.map +1 -1
- package/dist/components/composer.d.ts +2 -2
- package/dist/components/composer.js +10 -7
- package/dist/components/composer.js.map +1 -1
- package/dist/components/connection-status.d.ts +3 -3
- package/dist/components/connection-status.js +19 -14
- package/dist/components/connection-status.js.map +1 -1
- package/dist/components/context-menu.d.ts +15 -14
- package/dist/components/context-menu.js +52 -41
- package/dist/components/context-menu.js.map +1 -1
- package/dist/components/conversation.d.ts +1 -1
- package/dist/components/conversation.js +7 -5
- package/dist/components/conversation.js.map +1 -1
- package/dist/components/copy-button.d.ts +1 -1
- package/dist/components/copy-button.js +4 -2
- package/dist/components/copy-button.js.map +1 -1
- package/dist/components/data-table.d.ts +7 -2
- package/dist/components/data-table.js +17 -42
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/dialog.d.ts +19 -10
- package/dist/components/dialog.js +50 -33
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/dropdown-menu.d.ts +15 -14
- package/dist/components/dropdown-menu.js +52 -41
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/editor-tabs.d.ts +1 -1
- package/dist/components/editor-tabs.js +7 -5
- package/dist/components/editor-tabs.js.map +1 -1
- package/dist/components/empty-state.d.ts +5 -5
- package/dist/components/empty-state.js +17 -11
- package/dist/components/empty-state.js.map +1 -1
- package/dist/components/error-summary.d.ts +21 -0
- package/dist/components/error-summary.js +62 -0
- package/dist/components/error-summary.js.map +1 -0
- package/dist/components/field.d.ts +66 -7
- package/dist/components/field.js +152 -20
- package/dist/components/field.js.map +1 -1
- package/dist/components/form-actions.d.ts +18 -0
- package/dist/components/form-actions.js +30 -0
- package/dist/components/form-actions.js.map +1 -0
- package/dist/components/icon-button.d.ts +3 -1
- package/dist/components/icon-button.js +6 -3
- package/dist/components/icon-button.js.map +1 -1
- package/dist/components/input.d.ts +42 -7
- package/dist/components/input.js +54 -10
- package/dist/components/input.js.map +1 -1
- package/dist/components/kbd.d.ts +2 -2
- package/dist/components/kbd.js +8 -5
- package/dist/components/kbd.js.map +1 -1
- package/dist/components/label.d.ts +7 -2
- package/dist/components/label.js +14 -7
- package/dist/components/label.js.map +1 -1
- package/dist/components/markdown.d.ts +4 -3
- package/dist/components/markdown.js +8 -6
- package/dist/components/markdown.js.map +1 -1
- package/dist/components/menubar.d.ts +17 -15
- package/dist/components/menubar.js +58 -45
- package/dist/components/menubar.js.map +1 -1
- package/dist/components/message-actions.d.ts +3 -3
- package/dist/components/message-actions.js +16 -12
- package/dist/components/message-actions.js.map +1 -1
- package/dist/components/message.d.ts +1 -1
- package/dist/components/message.js +6 -3
- package/dist/components/message.js.map +1 -1
- package/dist/components/mobile-nav.d.ts +1 -1
- package/dist/components/mobile-nav.js +7 -5
- package/dist/components/mobile-nav.js.map +1 -1
- package/dist/components/native-select.d.ts +16 -0
- package/dist/components/native-select.js +33 -0
- package/dist/components/native-select.js.map +1 -0
- package/dist/components/navigation-menu.d.ts +13 -12
- package/dist/components/navigation-menu.js +43 -33
- package/dist/components/navigation-menu.js.map +1 -1
- package/dist/components/number-input.d.ts +23 -0
- package/dist/components/number-input.js +45 -0
- package/dist/components/number-input.js.map +1 -0
- package/dist/components/onboarding-checklist.d.ts +1 -1
- package/dist/components/onboarding-checklist.js +5 -3
- package/dist/components/onboarding-checklist.js.map +1 -1
- package/dist/components/page-header.d.ts +7 -6
- package/dist/components/page-header.js +23 -15
- package/dist/components/page-header.js.map +1 -1
- package/dist/components/pagination.d.ts +1 -1
- package/dist/components/pagination.js +4 -2
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/popover.d.ts +14 -11
- package/dist/components/popover.js +30 -23
- package/dist/components/popover.js.map +1 -1
- package/dist/components/progress.d.ts +2 -2
- package/dist/components/progress.js +11 -9
- package/dist/components/progress.js.map +1 -1
- package/dist/components/radio-group.d.ts +23 -4
- package/dist/components/radio-group.js +56 -14
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/reasoning.d.ts +3 -3
- package/dist/components/reasoning.js +14 -11
- package/dist/components/reasoning.js.map +1 -1
- package/dist/components/resizable.js +1 -0
- package/dist/components/resizable.js.map +1 -1
- package/dist/components/scroll-area.d.ts +4 -3
- package/dist/components/scroll-area.js +18 -14
- package/dist/components/scroll-area.js.map +1 -1
- package/dist/components/secret-input.d.ts +3 -2
- package/dist/components/secret-input.js +7 -4
- package/dist/components/secret-input.js.map +1 -1
- package/dist/components/select.d.ts +12 -7
- package/dist/components/select.js +42 -35
- package/dist/components/select.js.map +1 -1
- package/dist/components/separator.d.ts +2 -2
- package/dist/components/separator.js +8 -6
- package/dist/components/separator.js.map +1 -1
- package/dist/components/sheet.d.ts +11 -9
- package/dist/components/sheet.js +41 -29
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/skeleton.d.ts +2 -1
- package/dist/components/skeleton.js +7 -4
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/slider.d.ts +10 -6
- package/dist/components/slider.js +16 -7
- package/dist/components/slider.js.map +1 -1
- package/dist/components/source.d.ts +2 -2
- package/dist/components/source.js +10 -7
- package/dist/components/source.js.map +1 -1
- package/dist/components/spinner.d.ts +4 -2
- package/dist/components/spinner.js +5 -3
- package/dist/components/spinner.js.map +1 -1
- package/dist/components/stat-card.d.ts +27 -2
- package/dist/components/stat-card.js +70 -9
- package/dist/components/stat-card.js.map +1 -1
- package/dist/components/status.d.ts +7 -6
- package/dist/components/status.js +12 -5
- package/dist/components/status.js.map +1 -1
- package/dist/components/steps.d.ts +1 -1
- package/dist/components/steps.js +5 -3
- package/dist/components/steps.js.map +1 -1
- package/dist/components/switch.d.ts +47 -3
- package/dist/components/switch.js +89 -11
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table.d.ts +29 -12
- package/dist/components/table.js +80 -34
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.d.ts +10 -5
- package/dist/components/tabs.js +29 -19
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/textarea.d.ts +6 -1
- package/dist/components/textarea.js +4 -3
- package/dist/components/textarea.js.map +1 -1
- package/dist/components/toast.d.ts +11 -7
- package/dist/components/toast.js +37 -27
- package/dist/components/toast.js.map +1 -1
- package/dist/components/toaster.d.ts +4 -2
- package/dist/components/toaster.js +7 -2
- package/dist/components/toaster.js.map +1 -1
- package/dist/components/tool-call.d.ts +2 -2
- package/dist/components/tool-call.js +15 -12
- package/dist/components/tool-call.js.map +1 -1
- package/dist/components/toolbar.d.ts +9 -4
- package/dist/components/toolbar.js +15 -9
- package/dist/components/toolbar.js.map +1 -1
- package/dist/components/tooltip.d.ts +4 -3
- package/dist/components/tooltip.js +17 -13
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/tour.js +10 -8
- package/dist/components/tour.js.map +1 -1
- package/dist/components/tree-view.d.ts +1 -1
- package/dist/components/tree-view.js +10 -5
- package/dist/components/tree-view.js.map +1 -1
- package/dist/components/voice-recorder.d.ts +1 -1
- package/dist/components/voice-recorder.js +5 -2
- package/dist/components/voice-recorder.js.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +17 -12
- package/dist/lib/media.d.ts +18 -0
- package/dist/lib/media.js +34 -0
- package/dist/lib/media.js.map +1 -0
- package/dist/lib/utils.d.ts +32 -0
- package/dist/lib/utils.js +33 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/mui/index.js +20 -8
- package/dist/mui/index.js.map +1 -1
- package/dist/primitives/vendor/cmdk/command-score.d.ts +1 -0
- package/dist/primitives/vendor/cmdk/command-score.js +64 -0
- package/dist/primitives/vendor/cmdk/command-score.js.map +1 -0
- package/dist/primitives/vendor/cmdk/index.d.ts +384 -0
- package/dist/primitives/vendor/cmdk/index.js +687 -0
- package/dist/primitives/vendor/cmdk/index.js.map +1 -0
- package/dist/primitives/vendor/radix/number/index.d.ts +1 -0
- package/dist/primitives/vendor/radix/number/number.d.ts +2 -0
- package/dist/primitives/vendor/radix/number/number.js +9 -0
- package/dist/primitives/vendor/radix/number/number.js.map +1 -0
- package/dist/primitives/vendor/radix/primitive/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/primitive/is-development.d.ts +1 -0
- package/dist/primitives/vendor/radix/primitive/is-development.js +7 -0
- package/dist/primitives/vendor/radix/primitive/is-development.js.map +1 -0
- package/dist/primitives/vendor/radix/primitive/primitive.d.ts +14 -0
- package/dist/primitives/vendor/radix/primitive/primitive.js +12 -0
- package/dist/primitives/vendor/radix/primitive/primitive.js.map +1 -0
- package/dist/primitives/vendor/radix/primitive/types.d.ts +5 -0
- package/dist/primitives/vendor/radix/react-accordion/accordion.d.ts +112 -0
- package/dist/primitives/vendor/radix/react-accordion/accordion.js +266 -0
- package/dist/primitives/vendor/radix/react-accordion/accordion.js.map +1 -0
- package/dist/primitives/vendor/radix/react-accordion/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-alert-dialog/alert-dialog.d.ts +49 -0
- package/dist/primitives/vendor/radix/react-alert-dialog/alert-dialog.js +122 -0
- package/dist/primitives/vendor/radix/react-alert-dialog/alert-dialog.js.map +1 -0
- package/dist/primitives/vendor/radix/react-alert-dialog/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-arrow/arrow.d.ts +9 -0
- package/dist/primitives/vendor/radix/react-arrow/arrow.js +22 -0
- package/dist/primitives/vendor/radix/react-arrow/arrow.js.map +1 -0
- package/dist/primitives/vendor/radix/react-arrow/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-avatar/avatar.d.ts +19 -0
- package/dist/primitives/vendor/radix/react-avatar/avatar.js +132 -0
- package/dist/primitives/vendor/radix/react-avatar/avatar.js.map +1 -0
- package/dist/primitives/vendor/radix/react-avatar/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-checkbox/checkbox.d.ts +47 -0
- package/dist/primitives/vendor/radix/react-checkbox/checkbox.js +197 -0
- package/dist/primitives/vendor/radix/react-checkbox/checkbox.js.map +1 -0
- package/dist/primitives/vendor/radix/react-checkbox/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-collapsible/collapsible.d.ts +31 -0
- package/dist/primitives/vendor/radix/react-collapsible/collapsible.js +133 -0
- package/dist/primitives/vendor/radix/react-collapsible/collapsible.js.map +1 -0
- package/dist/primitives/vendor/radix/react-collapsible/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-collection/collection-legacy.d.ts +21 -0
- package/dist/primitives/vendor/radix/react-collection/collection-legacy.js +84 -0
- package/dist/primitives/vendor/radix/react-collection/collection-legacy.js.map +1 -0
- package/dist/primitives/vendor/radix/react-collection/collection.d.ts +32 -0
- package/dist/primitives/vendor/radix/react-collection/index.d.ts +4 -0
- package/dist/primitives/vendor/radix/react-collection/ordered-dictionary.d.ts +51 -0
- package/dist/primitives/vendor/radix/react-compose-refs/compose-refs.d.ts +13 -0
- package/dist/primitives/vendor/radix/react-compose-refs/compose-refs.js +43 -0
- package/dist/primitives/vendor/radix/react-compose-refs/compose-refs.js.map +1 -0
- package/dist/primitives/vendor/radix/react-compose-refs/index.d.ts +1 -0
- package/dist/primitives/vendor/radix/react-context/create-context.d.ts +45 -0
- package/dist/primitives/vendor/radix/react-context/create-context.js +74 -0
- package/dist/primitives/vendor/radix/react-context/create-context.js.map +1 -0
- package/dist/primitives/vendor/radix/react-context/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-context-menu/context-menu.d.ts +95 -0
- package/dist/primitives/vendor/radix/react-context-menu/context-menu.js +279 -0
- package/dist/primitives/vendor/radix/react-context-menu/context-menu.js.map +1 -0
- package/dist/primitives/vendor/radix/react-context-menu/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-dialog/dialog.d.ts +97 -0
- package/dist/primitives/vendor/radix/react-dialog/dialog.js +262 -0
- package/dist/primitives/vendor/radix/react-dialog/dialog.js.map +1 -0
- package/dist/primitives/vendor/radix/react-dialog/index.d.ts +4 -0
- package/dist/primitives/vendor/radix/react-direction/direction.d.ts +10 -0
- package/dist/primitives/vendor/radix/react-direction/direction.js +13 -0
- package/dist/primitives/vendor/radix/react-direction/direction.js.map +1 -0
- package/dist/primitives/vendor/radix/react-direction/index.d.ts +1 -0
- package/dist/primitives/vendor/radix/react-dismissable-layer/dismissable-layer.d.ts +61 -0
- package/dist/primitives/vendor/radix/react-dismissable-layer/dismissable-layer.js +336 -0
- package/dist/primitives/vendor/radix/react-dismissable-layer/dismissable-layer.js.map +1 -0
- package/dist/primitives/vendor/radix/react-dismissable-layer/index.d.ts +4 -0
- package/dist/primitives/vendor/radix/react-dropdown-menu/dropdown-menu.d.ts +95 -0
- package/dist/primitives/vendor/radix/react-dropdown-menu/dropdown-menu.js +257 -0
- package/dist/primitives/vendor/radix/react-dropdown-menu/dropdown-menu.js.map +1 -0
- package/dist/primitives/vendor/radix/react-dropdown-menu/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-focus-guards/focus-guards.d.ts +11 -0
- package/dist/primitives/vendor/radix/react-focus-guards/focus-guards.js +49 -0
- package/dist/primitives/vendor/radix/react-focus-guards/focus-guards.js.map +1 -0
- package/dist/primitives/vendor/radix/react-focus-guards/index.d.ts +1 -0
- package/dist/primitives/vendor/radix/react-focus-scope/focus-scope.d.ts +31 -0
- package/dist/primitives/vendor/radix/react-focus-scope/focus-scope.js +221 -0
- package/dist/primitives/vendor/radix/react-focus-scope/focus-scope.js.map +1 -0
- package/dist/primitives/vendor/radix/react-focus-scope/index.d.ts +1 -0
- package/dist/primitives/vendor/radix/react-id/id.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-id/id.js +17 -0
- package/dist/primitives/vendor/radix/react-id/id.js.map +1 -0
- package/dist/primitives/vendor/radix/react-id/index.d.ts +1 -0
- package/dist/primitives/vendor/radix/react-label/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-label/label.d.ts +9 -0
- package/dist/primitives/vendor/radix/react-label/label.js +21 -0
- package/dist/primitives/vendor/radix/react-label/label.js.map +1 -0
- package/dist/primitives/vendor/radix/react-menu/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-menu/menu.d.ts +173 -0
- package/dist/primitives/vendor/radix/react-menu/menu.js +806 -0
- package/dist/primitives/vendor/radix/react-menu/menu.js.map +1 -0
- package/dist/primitives/vendor/radix/react-menubar/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-menubar/menubar.d.ts +106 -0
- package/dist/primitives/vendor/radix/react-menubar/menubar.js +377 -0
- package/dist/primitives/vendor/radix/react-menubar/menubar.js.map +1 -0
- package/dist/primitives/vendor/radix/react-navigation-menu/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-navigation-menu/navigation-menu.d.ts +124 -0
- package/dist/primitives/vendor/radix/react-navigation-menu/navigation-menu.js +743 -0
- package/dist/primitives/vendor/radix/react-navigation-menu/navigation-menu.js.map +1 -0
- package/dist/primitives/vendor/radix/react-popover/index.d.ts +1 -0
- package/dist/primitives/vendor/radix/react-popover/popover.d.ts +83 -0
- package/dist/primitives/vendor/radix/react-popover/popover.js +236 -0
- package/dist/primitives/vendor/radix/react-popover/popover.js.map +1 -0
- package/dist/primitives/vendor/radix/react-popper/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-popper/popper.d.ts +44 -0
- package/dist/primitives/vendor/radix/react-popper/popper.js +276 -0
- package/dist/primitives/vendor/radix/react-popper/popper.js.map +1 -0
- package/dist/primitives/vendor/radix/react-portal/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-portal/portal.d.ts +13 -0
- package/dist/primitives/vendor/radix/react-portal/portal.js +21 -0
- package/dist/primitives/vendor/radix/react-portal/portal.js.map +1 -0
- package/dist/primitives/vendor/radix/react-presence/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-presence/presence.d.ts +11 -0
- package/dist/primitives/vendor/radix/react-presence/presence.js +152 -0
- package/dist/primitives/vendor/radix/react-presence/presence.js.map +1 -0
- package/dist/primitives/vendor/radix/react-presence/use-state-machine.d.ts +10 -0
- package/dist/primitives/vendor/radix/react-presence/use-state-machine.js +12 -0
- package/dist/primitives/vendor/radix/react-presence/use-state-machine.js.map +1 -0
- package/dist/primitives/vendor/radix/react-primitive/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-primitive/primitive.d.ts +56 -0
- package/dist/primitives/vendor/radix/react-primitive/primitive.js +84 -0
- package/dist/primitives/vendor/radix/react-primitive/primitive.js.map +1 -0
- package/dist/primitives/vendor/radix/react-progress/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-progress/progress.d.ts +17 -0
- package/dist/primitives/vendor/radix/react-progress/progress.js +79 -0
- package/dist/primitives/vendor/radix/react-progress/progress.js.map +1 -0
- package/dist/primitives/vendor/radix/react-radio-group/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-radio-group/radio-group.d.ts +55 -0
- package/dist/primitives/vendor/radix/react-radio-group/radio-group.js +173 -0
- package/dist/primitives/vendor/radix/react-radio-group/radio-group.js.map +1 -0
- package/dist/primitives/vendor/radix/react-radio-group/radio.d.ts +62 -0
- package/dist/primitives/vendor/radix/react-radio-group/radio.js +150 -0
- package/dist/primitives/vendor/radix/react-radio-group/radio.js.map +1 -0
- package/dist/primitives/vendor/radix/react-roving-focus/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-roving-focus/roving-focus-group.d.ts +47 -0
- package/dist/primitives/vendor/radix/react-roving-focus/roving-focus-group.js +218 -0
- package/dist/primitives/vendor/radix/react-roving-focus/roving-focus-group.js.map +1 -0
- package/dist/primitives/vendor/radix/react-scroll-area/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-scroll-area/scroll-area.d.ts +121 -0
- package/dist/primitives/vendor/radix/react-scroll-area/scroll-area.js +713 -0
- package/dist/primitives/vendor/radix/react-scroll-area/scroll-area.js.map +1 -0
- package/dist/primitives/vendor/radix/react-scroll-area/use-state-machine.d.ts +10 -0
- package/dist/primitives/vendor/radix/react-scroll-area/use-state-machine.js +12 -0
- package/dist/primitives/vendor/radix/react-scroll-area/use-state-machine.js.map +1 -0
- package/dist/primitives/vendor/radix/react-select/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-select/select.d.ts +163 -0
- package/dist/primitives/vendor/radix/react-select/select.js +1040 -0
- package/dist/primitives/vendor/radix/react-select/select.js.map +1 -0
- package/dist/primitives/vendor/radix/react-separator/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-separator/separator.d.ts +20 -0
- package/dist/primitives/vendor/radix/react-separator/separator.js +29 -0
- package/dist/primitives/vendor/radix/react-separator/separator.js.map +1 -0
- package/dist/primitives/vendor/radix/react-slot/index.d.ts +1 -0
- package/dist/primitives/vendor/radix/react-slot/slot.d.ts +29 -0
- package/dist/primitives/vendor/radix/react-slot/slot.js +107 -0
- package/dist/primitives/vendor/radix/react-slot/slot.js.map +1 -0
- package/dist/primitives/vendor/radix/react-switch/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-switch/switch.d.ts +41 -0
- package/dist/primitives/vendor/radix/react-switch/switch.js +185 -0
- package/dist/primitives/vendor/radix/react-switch/switch.js.map +1 -0
- package/dist/primitives/vendor/radix/react-tabs/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-tabs/tabs.d.ts +54 -0
- package/dist/primitives/vendor/radix/react-tabs/tabs.js +145 -0
- package/dist/primitives/vendor/radix/react-tabs/tabs.js.map +1 -0
- package/dist/primitives/vendor/radix/react-toast/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-toast/toast.d.ts +125 -0
- package/dist/primitives/vendor/radix/react-toast/toast.js +557 -0
- package/dist/primitives/vendor/radix/react-toast/toast.js.map +1 -0
- package/dist/primitives/vendor/radix/react-tooltip/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-tooltip/tooltip.d.ts +99 -0
- package/dist/primitives/vendor/radix/react-tooltip/tooltip.js +503 -0
- package/dist/primitives/vendor/radix/react-tooltip/tooltip.js.map +1 -0
- package/dist/primitives/vendor/radix/react-use-callback-ref/index.d.ts +1 -0
- package/dist/primitives/vendor/radix/react-use-callback-ref/use-callback-ref.d.ts +6 -0
- package/dist/primitives/vendor/radix/react-use-callback-ref/use-callback-ref.js +18 -0
- package/dist/primitives/vendor/radix/react-use-callback-ref/use-callback-ref.js.map +1 -0
- package/dist/primitives/vendor/radix/react-use-controllable-state/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-use-controllable-state/use-controllable-state-reducer.d.ts +28 -0
- package/dist/primitives/vendor/radix/react-use-controllable-state/use-controllable-state.d.ts +11 -0
- package/dist/primitives/vendor/radix/react-use-controllable-state/use-controllable-state.js +59 -0
- package/dist/primitives/vendor/radix/react-use-controllable-state/use-controllable-state.js.map +1 -0
- package/dist/primitives/vendor/radix/react-use-effect-event/index.d.ts +1 -0
- package/dist/primitives/vendor/radix/react-use-effect-event/use-effect-event.d.ts +7 -0
- package/dist/primitives/vendor/radix/react-use-is-hydrated/index.d.ts +1 -0
- package/dist/primitives/vendor/radix/react-use-is-hydrated/use-is-hydrated-legacy.d.ts +1 -0
- package/dist/primitives/vendor/radix/react-use-is-hydrated/use-is-hydrated-legacy.js +18 -0
- package/dist/primitives/vendor/radix/react-use-is-hydrated/use-is-hydrated-legacy.js.map +1 -0
- package/dist/primitives/vendor/radix/react-use-is-hydrated/use-is-hydrated.d.ts +6 -0
- package/dist/primitives/vendor/radix/react-use-is-hydrated/use-is-hydrated.js +19 -0
- package/dist/primitives/vendor/radix/react-use-is-hydrated/use-is-hydrated.js.map +1 -0
- package/dist/primitives/vendor/radix/react-use-layout-effect/index.d.ts +1 -0
- package/dist/primitives/vendor/radix/react-use-layout-effect/use-layout-effect.d.ts +10 -0
- package/dist/primitives/vendor/radix/react-use-layout-effect/use-layout-effect.js +15 -0
- package/dist/primitives/vendor/radix/react-use-layout-effect/use-layout-effect.js.map +1 -0
- package/dist/primitives/vendor/radix/react-use-previous/index.d.ts +1 -0
- package/dist/primitives/vendor/radix/react-use-previous/use-previous.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-use-previous/use-previous.js +20 -0
- package/dist/primitives/vendor/radix/react-use-previous/use-previous.js.map +1 -0
- package/dist/primitives/vendor/radix/react-use-size/index.d.ts +1 -0
- package/dist/primitives/vendor/radix/react-use-size/use-size.d.ts +5 -0
- package/dist/primitives/vendor/radix/react-use-size/use-size.js +42 -0
- package/dist/primitives/vendor/radix/react-use-size/use-size.js.map +1 -0
- package/dist/primitives/vendor/radix/react-visually-hidden/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/react-visually-hidden/visually-hidden.d.ts +21 -0
- package/dist/primitives/vendor/radix/react-visually-hidden/visually-hidden.js +32 -0
- package/dist/primitives/vendor/radix/react-visually-hidden/visually-hidden.js.map +1 -0
- package/dist/primitives/vendor/radix/rect/index.d.ts +2 -0
- package/dist/primitives/vendor/radix/rect/observe-element-rect.d.ts +16 -0
- package/dist/styles.css +1 -1
- package/dist/theme.css +36 -17
- package/dist/tokens.d.ts +78 -36
- package/dist/tokens.js +63 -32
- package/dist/tokens.js.map +1 -1
- package/package.json +25 -13
- package/vendor-manifest.json +1101 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn, focusRingClasses, noOutlineClasses } from "../lib/utils.js";
|
|
2
3
|
import { Button } from "./button.js";
|
|
3
4
|
import { formatBytes } from "./attachment.js";
|
|
4
5
|
import { VoiceMessage } from "./audio-player.js";
|
|
@@ -17,9 +18,10 @@ import ThumbsUp from "@burtson-labs/icons/react/thumbs-up";
|
|
|
17
18
|
* small icon buttons. Pass it to Message's `actions`, which shows it on
|
|
18
19
|
* hover and focus (always on touch screens).
|
|
19
20
|
*/
|
|
20
|
-
function MessageActions({ copyText, onRegenerate, onEdit, feedback = null, onFeedback, className, ...props }) {
|
|
21
|
-
const small = "size-7 text-muted-foreground hover:text-foreground pointer-coarse:size-
|
|
21
|
+
var MessageActions = React.forwardRef(function MessageActions({ copyText, onRegenerate, onEdit, feedback = null, onFeedback, className, ...props }, ref) {
|
|
22
|
+
const small = "size-7 text-muted-foreground hover:text-foreground pointer-coarse:size-11";
|
|
22
23
|
return /* @__PURE__ */ jsxs("div", {
|
|
24
|
+
ref,
|
|
23
25
|
"data-slot": "message-actions",
|
|
24
26
|
role: "toolbar",
|
|
25
27
|
"aria-label": "Message actions",
|
|
@@ -66,17 +68,18 @@ function MessageActions({ copyText, onRegenerate, onEdit, feedback = null, onFee
|
|
|
66
68
|
})] })
|
|
67
69
|
]
|
|
68
70
|
});
|
|
69
|
-
}
|
|
71
|
+
});
|
|
70
72
|
/**
|
|
71
73
|
* Edit-and-resend in place of a sent message. Enter sends (never mid-IME
|
|
72
74
|
* composition), Shift+Enter adds a line, Escape cancels.
|
|
73
75
|
*/
|
|
74
|
-
function MessageEditor({ defaultValue, onSubmit, onCancel, submitLabel = "Send", className, ...props }) {
|
|
76
|
+
var MessageEditor = React.forwardRef(function MessageEditor({ defaultValue, onSubmit, onCancel, submitLabel = "Send", className, ...props }, ref) {
|
|
75
77
|
const [value, setValue] = React.useState(defaultValue);
|
|
76
78
|
const send = () => {
|
|
77
79
|
if (value.trim()) onSubmit(value.trim());
|
|
78
80
|
};
|
|
79
81
|
return /* @__PURE__ */ jsxs("form", {
|
|
82
|
+
ref,
|
|
80
83
|
"data-slot": "message-editor",
|
|
81
84
|
onSubmit: (e) => {
|
|
82
85
|
e.preventDefault();
|
|
@@ -99,7 +102,7 @@ function MessageEditor({ defaultValue, onSubmit, onCancel, submitLabel = "Send",
|
|
|
99
102
|
send();
|
|
100
103
|
}
|
|
101
104
|
},
|
|
102
|
-
className: "field-sizing-content max-h-60 min-h-16 w-full resize-none rounded-lg border border-ring bg-surface px-3 py-2 text-base leading-6 inset-ring-1 inset-ring-ring
|
|
105
|
+
className: cn("field-sizing-content max-h-60 min-h-16 w-full resize-none rounded-lg border border-ring bg-surface px-3 py-2 text-base leading-6 inset-ring-1 inset-ring-ring sm:text-sm", noOutlineClasses)
|
|
103
106
|
}), /* @__PURE__ */ jsxs("div", {
|
|
104
107
|
className: "flex justify-end gap-2",
|
|
105
108
|
children: [/* @__PURE__ */ jsx(Button, {
|
|
@@ -116,14 +119,15 @@ function MessageEditor({ defaultValue, onSubmit, onCancel, submitLabel = "Send",
|
|
|
116
119
|
})]
|
|
117
120
|
})]
|
|
118
121
|
});
|
|
119
|
-
}
|
|
122
|
+
});
|
|
120
123
|
/**
|
|
121
124
|
* Files sent with a message: voice notes play inline, images show a
|
|
122
125
|
* thumbnail, anything else is a named chip that opens the file.
|
|
123
126
|
*/
|
|
124
|
-
function MessageAttachments({ files, className, ...props }) {
|
|
127
|
+
var MessageAttachments = React.forwardRef(function MessageAttachments({ files, className, ...props }, ref) {
|
|
125
128
|
if (!files.length) return null;
|
|
126
129
|
return /* @__PURE__ */ jsx("div", {
|
|
130
|
+
ref,
|
|
127
131
|
"data-slot": "message-attachments",
|
|
128
132
|
className: cn("flex flex-wrap gap-2", className),
|
|
129
133
|
...props,
|
|
@@ -140,7 +144,7 @@ function MessageAttachments({ files, className, ...props }) {
|
|
|
140
144
|
href: f.href,
|
|
141
145
|
target: "_blank",
|
|
142
146
|
rel: "noreferrer",
|
|
143
|
-
className: "block overflow-hidden rounded-lg border
|
|
147
|
+
className: cn("block overflow-hidden rounded-lg border", focusRingClasses),
|
|
144
148
|
children: /* @__PURE__ */ jsx("img", {
|
|
145
149
|
src: f.href,
|
|
146
150
|
alt: f.name,
|
|
@@ -161,12 +165,12 @@ function MessageAttachments({ files, className, ...props }) {
|
|
|
161
165
|
children: formatBytes(f.size)
|
|
162
166
|
})
|
|
163
167
|
] });
|
|
164
|
-
const chipClass = "inline-flex max-w-64 items-center gap-2 rounded-md border bg-surface px-2.5 py-1.5 text-sm";
|
|
168
|
+
const chipClass = "inline-flex max-w-64 items-center gap-2 rounded-md border bg-surface px-2.5 py-1.5 text-sm pointer-coarse:min-h-11";
|
|
165
169
|
return f.href ? /* @__PURE__ */ jsx("a", {
|
|
166
170
|
href: f.href,
|
|
167
171
|
target: "_blank",
|
|
168
172
|
rel: "noreferrer",
|
|
169
|
-
className: cn(chipClass, "
|
|
173
|
+
className: cn(chipClass, "hover:bg-muted", focusRingClasses),
|
|
170
174
|
children: chip
|
|
171
175
|
}, `${f.name}-${i}`) : /* @__PURE__ */ jsx("span", {
|
|
172
176
|
className: chipClass,
|
|
@@ -174,7 +178,7 @@ function MessageAttachments({ files, className, ...props }) {
|
|
|
174
178
|
}, `${f.name}-${i}`);
|
|
175
179
|
})
|
|
176
180
|
});
|
|
177
|
-
}
|
|
181
|
+
});
|
|
178
182
|
//#endregion
|
|
179
183
|
export { MessageActions, MessageAttachments, MessageEditor };
|
|
180
184
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-actions.js","names":["_Fragment"],"sources":["../../src/components/message-actions.tsx"],"sourcesContent":["import Edit from '@burtson-labs/icons/react/edit';\nimport FileText from '@burtson-labs/icons/react/file-text';\nimport RotateCcw from '@burtson-labs/icons/react/rotate-ccw';\nimport ThumbsDown from '@burtson-labs/icons/react/thumbs-down';\nimport ThumbsUp from '@burtson-labs/icons/react/thumbs-up';\nimport * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\nimport { formatBytes } from './attachment';\nimport { VoiceMessage } from './audio-player';\nimport { Button } from './button';\nimport { CopyButton } from './copy-button';\nimport { IconButton } from './icon-button';\n\nexport type MessageFeedback = 'up' | 'down' | null;\n\nexport interface MessageActionsProps extends React.ComponentProps<'div'> {\n /** Text for the copy button; leave out to hide it. */\n copyText?: string;\n onRegenerate?: () => void;\n /** Edit a sent message (user turns). Pair with MessageEditor. */\n onEdit?: () => void;\n /** The current rating; controlled. */\n feedback?: MessageFeedback;\n /** Adds thumbs up and down. Clicking the chosen one again clears it (null). */\n onFeedback?: (value: MessageFeedback) => void;\n}\n\n/**\n * The row under a message: copy, regenerate, edit and a thumbs rating, as\n * small icon buttons. Pass it to Message's `actions`, which shows it on\n * hover and focus (always on touch screens).\n */\nfunction MessageActions({\n copyText,\n onRegenerate,\n onEdit,\n feedback = null,\n onFeedback,\n className,\n ...props\n}: MessageActionsProps) {\n const small = 'size-7 text-muted-foreground hover:text-foreground pointer-coarse:size-10';\n return (\n <div\n data-slot=\"message-actions\"\n role=\"toolbar\"\n aria-label=\"Message actions\"\n className={cn('flex items-center gap-0.5', className)}\n {...props}\n >\n {copyText !== undefined && (\n <CopyButton value={copyText} label=\"Copy message\" className={small} />\n )}\n {onEdit && (\n <IconButton\n variant=\"ghost\"\n size=\"icon-sm\"\n label=\"Edit message\"\n onClick={onEdit}\n className={small}\n >\n <Edit />\n </IconButton>\n )}\n {onRegenerate && (\n <IconButton\n variant=\"ghost\"\n size=\"icon-sm\"\n label=\"Regenerate response\"\n onClick={onRegenerate}\n className={small}\n >\n <RotateCcw />\n </IconButton>\n )}\n {onFeedback && (\n <>\n <IconButton\n variant=\"ghost\"\n size=\"icon-sm\"\n label=\"Good response\"\n aria-pressed={feedback === 'up'}\n onClick={() => onFeedback(feedback === 'up' ? null : 'up')}\n className={cn(small, feedback === 'up' && 'text-brand hover:text-brand')}\n >\n <ThumbsUp className={cn(feedback === 'up' && 'fill-current')} />\n </IconButton>\n <IconButton\n variant=\"ghost\"\n size=\"icon-sm\"\n label=\"Bad response\"\n aria-pressed={feedback === 'down'}\n onClick={() => onFeedback(feedback === 'down' ? null : 'down')}\n className={cn(small, feedback === 'down' && 'text-foreground')}\n >\n <ThumbsDown className={cn(feedback === 'down' && 'fill-current')} />\n </IconButton>\n </>\n )}\n </div>\n );\n}\n\nexport interface MessageEditorProps extends Omit<React.ComponentProps<'form'>, 'onSubmit'> {\n /** The text being edited. */\n defaultValue: string;\n /** Save and send the edited message again. */\n onSubmit: (text: string) => void;\n onCancel: () => void;\n submitLabel?: string;\n}\n\n/**\n * Edit-and-resend in place of a sent message. Enter sends (never mid-IME\n * composition), Shift+Enter adds a line, Escape cancels.\n */\nfunction MessageEditor({\n defaultValue,\n onSubmit,\n onCancel,\n submitLabel = 'Send',\n className,\n ...props\n}: MessageEditorProps) {\n const [value, setValue] = React.useState(defaultValue);\n const send = () => {\n if (value.trim()) onSubmit(value.trim());\n };\n return (\n <form\n data-slot=\"message-editor\"\n onSubmit={(e) => {\n e.preventDefault();\n send();\n }}\n className={cn('grid w-full max-w-[85%] gap-2 justify-self-end', className)}\n {...props}\n >\n <textarea\n aria-label=\"Edit message\"\n value={value}\n // eslint-disable-next-line jsx-a11y/no-autofocus -- editing was just asked for\n autoFocus\n onChange={(e) => setValue(e.target.value)}\n onKeyDown={(e) => {\n if (e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229) return;\n if (e.key === 'Escape') {\n e.preventDefault();\n onCancel();\n } else if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault();\n send();\n }\n }}\n className=\"field-sizing-content max-h-60 min-h-16 w-full resize-none rounded-lg border border-ring bg-surface px-3 py-2 text-base leading-6 inset-ring-1 inset-ring-ring outline-hidden! sm:text-sm\"\n />\n <div className=\"flex justify-end gap-2\">\n <Button type=\"button\" variant=\"ghost\" size=\"sm\" onClick={onCancel}>\n Cancel\n </Button>\n <Button type=\"submit\" size=\"sm\" disabled={!value.trim()}>\n {submitLabel}\n </Button>\n </div>\n </form>\n );\n}\n\nexport interface MessageFile {\n name: string;\n /** Bytes. */\n size?: number;\n /** MIME type; audio renders a player, images a thumbnail. */\n type?: string;\n /** Where to open or play it. */\n href?: string;\n /** Waveform peaks for audio (see computePeaks). */\n peaks?: number[];\n /** Seconds, for audio. */\n duration?: number;\n /** Transcript for audio. */\n transcript?: React.ReactNode;\n}\n\nexport interface MessageAttachmentsProps extends React.ComponentProps<'div'> {\n files: MessageFile[];\n}\n\n/**\n * Files sent with a message: voice notes play inline, images show a\n * thumbnail, anything else is a named chip that opens the file.\n */\nfunction MessageAttachments({ files, className, ...props }: MessageAttachmentsProps) {\n if (!files.length) return null;\n return (\n <div\n data-slot=\"message-attachments\"\n className={cn('flex flex-wrap gap-2', className)}\n {...props}\n >\n {files.map((f, i) => {\n const type = f.type ?? '';\n if (type.startsWith('audio/') && f.href) {\n return (\n <VoiceMessage\n key={`${f.name}-${i}`}\n src={f.href}\n peaks={f.peaks}\n duration={f.duration}\n transcript={f.transcript}\n title={f.name}\n />\n );\n }\n if (type.startsWith('image/') && f.href) {\n return (\n <a\n key={`${f.name}-${i}`}\n href={f.href}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"block overflow-hidden rounded-lg border outline-none focus-visible:ring-[3px] focus-visible:ring-ring/20\"\n >\n <img src={f.href} alt={f.name} className=\"h-28 w-auto max-w-56 object-cover\" />\n </a>\n );\n }\n const chip = (\n <>\n <FileText aria-hidden className=\"size-4 shrink-0 text-muted-foreground\" />\n <span className=\"min-w-0 truncate\">{f.name}</span>\n {f.size !== undefined && (\n <span className=\"shrink-0 text-xs text-muted-foreground\">{formatBytes(f.size)}</span>\n )}\n </>\n );\n const chipClass =\n 'inline-flex max-w-64 items-center gap-2 rounded-md border bg-surface px-2.5 py-1.5 text-sm';\n return f.href ? (\n <a\n key={`${f.name}-${i}`}\n href={f.href}\n target=\"_blank\"\n rel=\"noreferrer\"\n className={cn(\n chipClass,\n 'outline-none hover:bg-muted focus-visible:ring-[3px] focus-visible:ring-ring/20',\n )}\n >\n {chip}\n </a>\n ) : (\n <span key={`${f.name}-${i}`} className={chipClass}>\n {chip}\n </span>\n );\n })}\n </div>\n );\n}\n\nexport { MessageActions, MessageAttachments, MessageEditor };\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAkCA,SAAS,eAAe,EACtB,UACA,cACA,QACA,WAAW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,KAAK,EAAE,MACjC,OACE,oBAAC,KAAD;IAEE,MAAM,EAAE;IACR,QAAO;IACP,KAAI;IACJ,WAAU;IAEV,UAAA,oBAAC,OAAD;KAAK,KAAK,EAAE;KAAM,KAAK,EAAE;KAAM,WAAU;IAAqC,CAAA;GAC7E,GAPI,GAAG,EAAE,KAAK,GAAG,GAOjB;GAGP,MAAM,OACJ,qBAAAA,UAAA,EAAA,UAAA;IACE,oBAAC,UAAD;KAAU,eAAA;KAAY,WAAU;IAAyC,CAAA;IACzE,oBAAC,QAAD;KAAM,WAAU;KAAoB,UAAA,EAAE;IAAW,CAAA;IAChD,EAAE,SAAS,KAAA,KACV,oBAAC,QAAD;KAAM,WAAU;KAA0C,UAAA,YAAY,EAAE,IAAI;IAAQ,CAAA;GAEtF,EAAA,CAAA;GAEJ,MAAM,YACJ;GACF,OAAO,EAAE,OACP,oBAAC,KAAD;IAEE,MAAM,EAAE;IACR,QAAO;IACP,KAAI;IACJ,WAAW,GACT,WACA,iFACF;IAEC,UAAA;GACA,GAVI,GAAG,EAAE,KAAK,GAAG,GAUjB,IAEH,oBAAC,QAAD;IAA6B,WAAW;IACrC,UAAA;GACG,GAFK,GAAG,EAAE,KAAK,GAAG,GAElB;EAEV,CAAC;CACE,CAAA;AAET"}
|
|
1
|
+
{"version":3,"file":"message-actions.js","names":["_Fragment"],"sources":["../../src/components/message-actions.tsx"],"sourcesContent":["import Edit from '@burtson-labs/icons/react/edit';\nimport FileText from '@burtson-labs/icons/react/file-text';\nimport RotateCcw from '@burtson-labs/icons/react/rotate-ccw';\nimport ThumbsDown from '@burtson-labs/icons/react/thumbs-down';\nimport ThumbsUp from '@burtson-labs/icons/react/thumbs-up';\nimport * as React from 'react';\n\nimport { cn, focusRingClasses, noOutlineClasses } from '../lib/utils';\n\nimport { formatBytes } from './attachment';\nimport { VoiceMessage } from './audio-player';\nimport { Button } from './button';\nimport { CopyButton } from './copy-button';\nimport { IconButton } from './icon-button';\n\nexport type MessageFeedback = 'up' | 'down' | null;\n\nexport interface MessageActionsProps extends React.ComponentProps<'div'> {\n /** Text for the copy button; leave out to hide it. */\n copyText?: string;\n onRegenerate?: () => void;\n /** Edit a sent message (user turns). Pair with MessageEditor. */\n onEdit?: () => void;\n /** The current rating; controlled. */\n feedback?: MessageFeedback;\n /** Adds thumbs up and down. Clicking the chosen one again clears it (null). */\n onFeedback?: (value: MessageFeedback) => void;\n}\n\n/**\n * The row under a message: copy, regenerate, edit and a thumbs rating, as\n * small icon buttons. Pass it to Message's `actions`, which shows it on\n * hover and focus (always on touch screens).\n */\nconst MessageActions = React.forwardRef<HTMLDivElement, MessageActionsProps>(\n function MessageActions(\n { copyText, onRegenerate, onEdit, feedback = null, onFeedback, className, ...props },\n ref,\n ) {\n const small = 'size-7 text-muted-foreground hover:text-foreground pointer-coarse:size-11';\n return (\n <div\n ref={ref}\n data-slot=\"message-actions\"\n role=\"toolbar\"\n aria-label=\"Message actions\"\n className={cn('flex items-center gap-0.5', className)}\n {...props}\n >\n {copyText !== undefined && (\n <CopyButton value={copyText} label=\"Copy message\" className={small} />\n )}\n {onEdit && (\n <IconButton\n variant=\"ghost\"\n size=\"icon-sm\"\n label=\"Edit message\"\n onClick={onEdit}\n className={small}\n >\n <Edit />\n </IconButton>\n )}\n {onRegenerate && (\n <IconButton\n variant=\"ghost\"\n size=\"icon-sm\"\n label=\"Regenerate response\"\n onClick={onRegenerate}\n className={small}\n >\n <RotateCcw />\n </IconButton>\n )}\n {onFeedback && (\n <>\n <IconButton\n variant=\"ghost\"\n size=\"icon-sm\"\n label=\"Good response\"\n aria-pressed={feedback === 'up'}\n onClick={() => onFeedback(feedback === 'up' ? null : 'up')}\n className={cn(small, feedback === 'up' && 'text-brand hover:text-brand')}\n >\n <ThumbsUp className={cn(feedback === 'up' && 'fill-current')} />\n </IconButton>\n <IconButton\n variant=\"ghost\"\n size=\"icon-sm\"\n label=\"Bad response\"\n aria-pressed={feedback === 'down'}\n onClick={() => onFeedback(feedback === 'down' ? null : 'down')}\n className={cn(small, feedback === 'down' && 'text-foreground')}\n >\n <ThumbsDown className={cn(feedback === 'down' && 'fill-current')} />\n </IconButton>\n </>\n )}\n </div>\n );\n },\n);\n\nexport interface MessageEditorProps extends Omit<React.ComponentProps<'form'>, 'onSubmit'> {\n /** The text being edited. */\n defaultValue: string;\n /** Save and send the edited message again. */\n onSubmit: (text: string) => void;\n onCancel: () => void;\n submitLabel?: string;\n}\n\n/**\n * Edit-and-resend in place of a sent message. Enter sends (never mid-IME\n * composition), Shift+Enter adds a line, Escape cancels.\n */\nconst MessageEditor = React.forwardRef<HTMLFormElement, MessageEditorProps>(function MessageEditor(\n { defaultValue, onSubmit, onCancel, submitLabel = 'Send', className, ...props },\n ref,\n) {\n const [value, setValue] = React.useState(defaultValue);\n const send = () => {\n if (value.trim()) onSubmit(value.trim());\n };\n return (\n <form\n ref={ref}\n data-slot=\"message-editor\"\n onSubmit={(e) => {\n e.preventDefault();\n send();\n }}\n className={cn('grid w-full max-w-[85%] gap-2 justify-self-end', className)}\n {...props}\n >\n <textarea\n aria-label=\"Edit message\"\n value={value}\n // eslint-disable-next-line jsx-a11y/no-autofocus -- editing was just asked for\n autoFocus\n onChange={(e) => setValue(e.target.value)}\n onKeyDown={(e) => {\n if (e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229) return;\n if (e.key === 'Escape') {\n e.preventDefault();\n onCancel();\n } else if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault();\n send();\n }\n }}\n className={cn(\n 'field-sizing-content max-h-60 min-h-16 w-full resize-none rounded-lg border border-ring bg-surface px-3 py-2 text-base leading-6 inset-ring-1 inset-ring-ring sm:text-sm',\n noOutlineClasses,\n )}\n />\n <div className=\"flex justify-end gap-2\">\n <Button type=\"button\" variant=\"ghost\" size=\"sm\" onClick={onCancel}>\n Cancel\n </Button>\n <Button type=\"submit\" size=\"sm\" disabled={!value.trim()}>\n {submitLabel}\n </Button>\n </div>\n </form>\n );\n});\n\nexport interface MessageFile {\n name: string;\n /** Bytes. */\n size?: number;\n /** MIME type; audio renders a player, images a thumbnail. */\n type?: string;\n /** Where to open or play it. */\n href?: string;\n /** Waveform peaks for audio (see computePeaks). */\n peaks?: number[];\n /** Seconds, for audio. */\n duration?: number;\n /** Transcript for audio. */\n transcript?: React.ReactNode;\n}\n\nexport interface MessageAttachmentsProps extends React.ComponentProps<'div'> {\n files: MessageFile[];\n}\n\n/**\n * Files sent with a message: voice notes play inline, images show a\n * thumbnail, anything else is a named chip that opens the file.\n */\nconst MessageAttachments = React.forwardRef<HTMLDivElement, MessageAttachmentsProps>(\n function MessageAttachments({ files, className, ...props }, ref) {\n if (!files.length) return null;\n return (\n <div\n ref={ref}\n data-slot=\"message-attachments\"\n className={cn('flex flex-wrap gap-2', className)}\n {...props}\n >\n {files.map((f, i) => {\n const type = f.type ?? '';\n if (type.startsWith('audio/') && f.href) {\n return (\n <VoiceMessage\n key={`${f.name}-${i}`}\n src={f.href}\n peaks={f.peaks}\n duration={f.duration}\n transcript={f.transcript}\n title={f.name}\n />\n );\n }\n if (type.startsWith('image/') && f.href) {\n return (\n <a\n key={`${f.name}-${i}`}\n href={f.href}\n target=\"_blank\"\n rel=\"noreferrer\"\n className={cn('block overflow-hidden rounded-lg border', focusRingClasses)}\n >\n <img src={f.href} alt={f.name} className=\"h-28 w-auto max-w-56 object-cover\" />\n </a>\n );\n }\n const chip = (\n <>\n <FileText aria-hidden className=\"size-4 shrink-0 text-muted-foreground\" />\n <span className=\"min-w-0 truncate\">{f.name}</span>\n {f.size !== undefined && (\n <span className=\"shrink-0 text-xs text-muted-foreground\">\n {formatBytes(f.size)}\n </span>\n )}\n </>\n );\n const chipClass =\n 'inline-flex max-w-64 items-center gap-2 rounded-md border bg-surface px-2.5 py-1.5 text-sm pointer-coarse:min-h-11';\n return f.href ? (\n <a\n key={`${f.name}-${i}`}\n href={f.href}\n target=\"_blank\"\n rel=\"noreferrer\"\n className={cn(chipClass, 'hover:bg-muted', focusRingClasses)}\n >\n {chip}\n </a>\n ) : (\n <span key={`${f.name}-${i}`} className={chipClass}>\n {chip}\n </span>\n );\n })}\n </div>\n );\n },\n);\n\nexport { MessageActions, MessageAttachments, MessageEditor };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkCA,IAAM,iBAAiB,MAAM,WAC3B,SAAS,eACP,EAAE,UAAU,cAAc,QAAQ,WAAW,MAAM,YAAY,WAAW,GAAG,SAC7E,KACA;CACA,MAAM,QAAQ;CACd,OACE,qBAAC,OAAD;EACO;EACL,aAAU;EACV,MAAK;EACL,cAAW;EACX,WAAW,GAAG,6BAA6B,SAAS;EACpD,GAAI;EANN,UAAA;GAQG,aAAa,KAAA,KACZ,oBAAC,YAAD;IAAY,OAAO;IAAU,OAAM;IAAe,WAAW;GAAQ,CAAA;GAEtE,UACC,oBAAC,YAAD;IACE,SAAQ;IACR,MAAK;IACL,OAAM;IACN,SAAS;IACT,WAAW;IAEX,UAAA,oBAAC,MAAD,CAAO,CAAA;GACG,CAAA;GAEb,gBACC,oBAAC,YAAD;IACE,SAAQ;IACR,MAAK;IACL,OAAM;IACN,SAAS;IACT,WAAW;IAEX,UAAA,oBAAC,WAAD,CAAY,CAAA;GACF,CAAA;GAEb,cACC,qBAAAA,UAAA,EAAA,UAAA,CACE,oBAAC,YAAD;IACE,SAAQ;IACR,MAAK;IACL,OAAM;IACN,gBAAc,aAAa;IAC3B,eAAe,WAAW,aAAa,OAAO,OAAO,IAAI;IACzD,WAAW,GAAG,OAAO,aAAa,QAAQ,6BAA6B;IAEvE,UAAA,oBAAC,UAAD,EAAU,WAAW,GAAG,aAAa,QAAQ,cAAc,EAAI,CAAA;GACrD,CAAA,GACZ,oBAAC,YAAD;IACE,SAAQ;IACR,MAAK;IACL,OAAM;IACN,gBAAc,aAAa;IAC3B,eAAe,WAAW,aAAa,SAAS,OAAO,MAAM;IAC7D,WAAW,GAAG,OAAO,aAAa,UAAU,iBAAiB;IAE7D,UAAA,oBAAC,YAAD,EAAY,WAAW,GAA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div'> {
|
|
|
17
17
|
* assistant turns read full width with an optional avatar, and system notes
|
|
18
18
|
* are centred and small.
|
|
19
19
|
*/
|
|
20
|
-
declare
|
|
20
|
+
declare const Message: React.ForwardRefExoticComponent<Omit<MessageProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
21
21
|
export { Message };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { cn } from "../lib/utils.js";
|
|
2
|
-
import "react";
|
|
3
|
+
import * as React from "react";
|
|
3
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
//#region src/components/message.tsx
|
|
5
6
|
/**
|
|
@@ -7,8 +8,9 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
7
8
|
* assistant turns read full width with an optional avatar, and system notes
|
|
8
9
|
* are centred and small.
|
|
9
10
|
*/
|
|
10
|
-
function Message({ from, avatar, name, meta, actions, children, className, ...props }) {
|
|
11
|
+
var Message = React.forwardRef(function Message({ from, avatar, name, meta, actions, children, className, ...props }, ref) {
|
|
11
12
|
if (from === "system") return /* @__PURE__ */ jsx("div", {
|
|
13
|
+
ref,
|
|
12
14
|
"data-slot": "message",
|
|
13
15
|
"data-role": "system",
|
|
14
16
|
className: cn("mx-auto max-w-prose text-center text-xs text-muted-foreground", className),
|
|
@@ -17,6 +19,7 @@ function Message({ from, avatar, name, meta, actions, children, className, ...pr
|
|
|
17
19
|
});
|
|
18
20
|
const user = from === "user";
|
|
19
21
|
return /* @__PURE__ */ jsxs("div", {
|
|
22
|
+
ref,
|
|
20
23
|
"data-slot": "message",
|
|
21
24
|
"data-role": from,
|
|
22
25
|
className: cn("group/message flex animate-in gap-3", user ? "justify-end" : "justify-start", className),
|
|
@@ -49,7 +52,7 @@ function Message({ from, avatar, name, meta, actions, children, className, ...pr
|
|
|
49
52
|
]
|
|
50
53
|
})]
|
|
51
54
|
});
|
|
52
|
-
}
|
|
55
|
+
});
|
|
53
56
|
//#endregion
|
|
54
57
|
export { Message };
|
|
55
58
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.js","names":[],"sources":["../../src/components/message.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\nexport type MessageRole = 'user' | 'assistant' | 'system';\n\nexport interface MessageProps extends React.ComponentProps<'div'> {\n /** Who wrote it. (Not `role`, which is the ARIA attribute.) */\n from: MessageRole;\n /** Avatar or agent mark beside assistant messages. */\n avatar?: React.ReactNode;\n /** Sender name shown above the message, e.g. the agent's name. */\n name?: React.ReactNode;\n /** Timestamp or status text. */\n meta?: React.ReactNode;\n /** Actions such as copy and retry, shown on hover and focus. */\n actions?: React.ReactNode;\n}\n\n/**\n * One turn in a conversation. User turns sit on the right in a quiet bubble,\n * assistant turns read full width with an optional avatar, and system notes\n * are centred and small.\n */\
|
|
1
|
+
{"version":3,"file":"message.js","names":[],"sources":["../../src/components/message.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\nexport type MessageRole = 'user' | 'assistant' | 'system';\n\nexport interface MessageProps extends React.ComponentProps<'div'> {\n /** Who wrote it. (Not `role`, which is the ARIA attribute.) */\n from: MessageRole;\n /** Avatar or agent mark beside assistant messages. */\n avatar?: React.ReactNode;\n /** Sender name shown above the message, e.g. the agent's name. */\n name?: React.ReactNode;\n /** Timestamp or status text. */\n meta?: React.ReactNode;\n /** Actions such as copy and retry, shown on hover and focus. */\n actions?: React.ReactNode;\n}\n\n/**\n * One turn in a conversation. User turns sit on the right in a quiet bubble,\n * assistant turns read full width with an optional avatar, and system notes\n * are centred and small.\n */\nconst Message = React.forwardRef<HTMLDivElement, MessageProps>(function Message(\n { from, avatar, name, meta, actions, children, className, ...props },\n ref,\n) {\n if (from === 'system') {\n return (\n <div\n ref={ref}\n data-slot=\"message\"\n data-role=\"system\"\n className={cn('mx-auto max-w-prose text-center text-xs text-muted-foreground', className)}\n {...props}\n >\n {children}\n </div>\n );\n }\n const user = from === 'user';\n return (\n <div\n ref={ref}\n data-slot=\"message\"\n data-role={from}\n className={cn(\n 'group/message flex animate-in gap-3',\n user ? 'justify-end' : 'justify-start',\n className,\n )}\n {...props}\n >\n {!user && avatar && (\n <div className=\"mt-0.5 grid size-7 shrink-0 place-items-center overflow-hidden rounded-md border border-brand/15 bg-brand-soft text-brand [&_svg]:size-4\">\n {avatar}\n </div>\n )}\n <div\n className={cn('grid min-w-0 gap-1.5', user ? 'max-w-[85%] justify-items-end' : 'flex-1')}\n >\n {(name || meta) && (\n <div className=\"flex items-baseline gap-2 text-xs\">\n {name && <span className=\"font-semibold text-foreground\">{name}</span>}\n {meta && <span className=\"text-muted-foreground\">{meta}</span>}\n </div>\n )}\n <div\n data-slot=\"message-body\"\n className={cn(\n 'min-w-0 break-words text-sm leading-6',\n user && 'rounded-lg rounded-tr-xs bg-secondary px-3.5 py-2 text-secondary-foreground',\n )}\n >\n {children}\n </div>\n {actions && (\n <div className=\"flex gap-1 opacity-0 transition-opacity group-focus-within/message:opacity-100 group-hover/message:opacity-100 max-md:opacity-100\">\n {actions}\n </div>\n )}\n </div>\n </div>\n );\n});\n\nexport { Message };\n"],"mappings":";;;;;;;;;;AAwBA,IAAM,UAAU,MAAM,WAAyC,SAAS,QACtE,EAAE,MAAM,QAAQ,MAAM,MAAM,SAAS,UAAU,WAAW,GAAG,SAC7D,KACA;CACA,IAAI,SAAS,UACX,OACE,oBAAC,OAAD;EACO;EACL,aAAU;EACV,aAAU;EACV,WAAW,GAAG,iEAAiE,SAAS;EACxF,GAAI;EAEH;CACE,CAAA;CAGT,MAAM,OAAO,SAAS;CACtB,OACE,qBAAC,OAAD;EACO;EACL,aAAU;EACV,aAAW;EACX,WAAW,GACT,uCACA,OAAO,gBAAgB,iBACvB,SACF;EACA,GAAI;EATN,UAAA,CAWG,CAAC,QAAQ,UACR,oBAAC,OAAD;GAAK,WAAU;GACZ,UAAA;EACE,CAAA,GAEP,qBAAC,OAAD;GACE,WAAW,GAAG,wBAAwB,OAAO,kCAAkC,QAAQ;GADzF,UAAA;KAGI,QAAQ,SACR,qBAAC,OAAD;KAAK,WAAU;KAAf,UAAA,CACG,QAAQ,oBAAC,QAAD;MAAM,WAAU;MAAiC,UAAA;KAAW,CAAA,GACpE,QAAQ,oBAAC,QAAD;MAAM,WAAU;MAAyB,UAAA;KAAW,CAAA,CAC1D;;IAEP,oBAAC,OAAD;KACE,aAAU;KACV,WAAW,GACT,yCACA,QAAQ,6EACV;KAEC;IACE,CAAA;IACJ,WACC,oBAAC,OAAD;KAAK,WAAU;KACZ,UAAA;IACE,CAAA;GAEJ;EACF,CAAA,CAAA;;AAET,CAAC"}
|
|
@@ -28,5 +28,5 @@ export interface MobileNavProps extends Omit<React.ComponentProps<'nav'>, 'onCha
|
|
|
28
28
|
* room for the home indicator (safe-area insets). Destinations come from the
|
|
29
29
|
* app; don't pad it with empty sections.
|
|
30
30
|
*/
|
|
31
|
-
declare
|
|
31
|
+
declare const MobileNav: React.ForwardRefExoticComponent<Omit<MobileNavProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
32
32
|
export { MobileNav };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import "
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn, focusRingClasses } from "../lib/utils.js";
|
|
3
|
+
import * as React from "react";
|
|
3
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
//#region src/components/mobile-nav.tsx
|
|
5
6
|
/**
|
|
@@ -7,8 +8,9 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
7
8
|
* room for the home indicator (safe-area insets). Destinations come from the
|
|
8
9
|
* app; don't pad it with empty sections.
|
|
9
10
|
*/
|
|
10
|
-
function MobileNav({ items, value, onValueChange, position = "static", className, "aria-label": ariaLabel = "Primary", ...props }) {
|
|
11
|
+
var MobileNav = React.forwardRef(function MobileNav({ items, value, onValueChange, position = "static", className, "aria-label": ariaLabel = "Primary", ...props }, ref) {
|
|
11
12
|
return /* @__PURE__ */ jsx("nav", {
|
|
13
|
+
ref,
|
|
12
14
|
"data-slot": "mobile-nav",
|
|
13
15
|
"aria-label": ariaLabel,
|
|
14
16
|
className: cn("border-t bg-surface/95 pr-[env(safe-area-inset-right)] pb-[env(safe-area-inset-bottom)] pl-[env(safe-area-inset-left)] backdrop-blur supports-[backdrop-filter]:bg-surface/80", position === "fixed" && "fixed inset-x-0 bottom-0 z-40", className),
|
|
@@ -45,7 +47,7 @@ function MobileNav({ items, value, onValueChange, position = "static", className
|
|
|
45
47
|
children: ", new"
|
|
46
48
|
})
|
|
47
49
|
] });
|
|
48
|
-
const classes = cn("flex min-h-14 w-full min-w-11 flex-col items-center justify-center gap-1 px-1 py-1.5 text-[11px] font-medium text-muted-foreground
|
|
50
|
+
const classes = cn("flex min-h-14 w-full min-w-11 flex-col items-center justify-center gap-1 px-1 py-1.5 text-[11px] font-medium text-muted-foreground transition-colors select-none [-webkit-tap-highlight-color:transparent] hover:text-foreground", focusRingClasses, "focus-visible:outline-offset-[-2px]", active && "text-brand hover:text-brand");
|
|
49
51
|
return /* @__PURE__ */ jsx("li", {
|
|
50
52
|
className: "min-w-0 flex-1",
|
|
51
53
|
children: item.href ? /* @__PURE__ */ jsx("a", {
|
|
@@ -65,7 +67,7 @@ function MobileNav({ items, value, onValueChange, position = "static", className
|
|
|
65
67
|
})
|
|
66
68
|
})
|
|
67
69
|
});
|
|
68
|
-
}
|
|
70
|
+
});
|
|
69
71
|
//#endregion
|
|
70
72
|
export { MobileNav };
|
|
71
73
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobile-nav.js","names":["_Fragment"],"sources":["../../src/components/mobile-nav.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\nexport interface MobileNavItem {\n id: string;\n label: string;\n /** An icon element, e.g. <MessageSquare />; sized to 20px. */\n icon: React.ReactNode;\n /** Renders a link; leave out for a button that only calls onValueChange. */\n href?: string;\n /** A count, or true for a dot. */\n badge?: number | boolean;\n}\n\nexport interface MobileNavProps extends Omit<React.ComponentProps<'nav'>, 'onChange'> {\n /** Three to five destinations the app defines. */\n items: MobileNavItem[];\n /** The current destination's id. */\n value: string;\n /**\n * Called on every press. For a link, call `event.preventDefault()` and\n * route yourself to keep a single-page app from reloading.\n */\n onValueChange?: (id: string, event: React.MouseEvent<HTMLElement>) => void;\n /** `fixed` pins it to the bottom of the viewport. */\n position?: 'fixed' | 'static';\n 'aria-label'?: string;\n}\n\n/**\n * The phone's bottom tab bar: icon over a visible label, 44px+ targets, and\n * room for the home indicator (safe-area insets). Destinations come from the\n * app; don't pad it with empty sections.\n */\
|
|
1
|
+
{"version":3,"file":"mobile-nav.js","names":["_Fragment"],"sources":["../../src/components/mobile-nav.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn, focusRingClasses } from '../lib/utils';\n\nexport interface MobileNavItem {\n id: string;\n label: string;\n /** An icon element, e.g. <MessageSquare />; sized to 20px. */\n icon: React.ReactNode;\n /** Renders a link; leave out for a button that only calls onValueChange. */\n href?: string;\n /** A count, or true for a dot. */\n badge?: number | boolean;\n}\n\nexport interface MobileNavProps extends Omit<React.ComponentProps<'nav'>, 'onChange'> {\n /** Three to five destinations the app defines. */\n items: MobileNavItem[];\n /** The current destination's id. */\n value: string;\n /**\n * Called on every press. For a link, call `event.preventDefault()` and\n * route yourself to keep a single-page app from reloading.\n */\n onValueChange?: (id: string, event: React.MouseEvent<HTMLElement>) => void;\n /** `fixed` pins it to the bottom of the viewport. */\n position?: 'fixed' | 'static';\n 'aria-label'?: string;\n}\n\n/**\n * The phone's bottom tab bar: icon over a visible label, 44px+ targets, and\n * room for the home indicator (safe-area insets). Destinations come from the\n * app; don't pad it with empty sections.\n */\nconst MobileNav = React.forwardRef<HTMLElement, MobileNavProps>(function MobileNav(\n {\n items,\n value,\n onValueChange,\n position = 'static',\n className,\n 'aria-label': ariaLabel = 'Primary',\n ...props\n },\n ref,\n) {\n return (\n <nav\n ref={ref}\n data-slot=\"mobile-nav\"\n aria-label={ariaLabel}\n className={cn(\n 'border-t bg-surface/95 pr-[env(safe-area-inset-right)] pb-[env(safe-area-inset-bottom)] pl-[env(safe-area-inset-left)] backdrop-blur supports-[backdrop-filter]:bg-surface/80',\n position === 'fixed' && 'fixed inset-x-0 bottom-0 z-40',\n className,\n )}\n {...props}\n >\n <ul className=\"mx-auto flex max-w-lg\">\n {items.map((item) => {\n const active = item.id === value;\n const count = typeof item.badge === 'number' && item.badge > 0 ? item.badge : undefined;\n const dot = item.badge === true;\n const content = (\n <>\n <span className=\"relative [&_svg]:size-5\" aria-hidden>\n {item.icon}\n {(count !== undefined || dot) && (\n <span\n className={cn(\n 'absolute -top-1 left-3 grid place-items-center rounded-full bg-destructive text-[10px] leading-none font-semibold text-destructive-foreground ring-2 ring-surface tabular-nums',\n count !== undefined ? 'h-4 min-w-4 px-1' : 'size-2',\n )}\n >\n {count !== undefined ? (count > 99 ? '99+' : count) : null}\n </span>\n )}\n </span>\n <span className=\"max-w-full truncate\">{item.label}</span>\n {count !== undefined && <span className=\"sr-only\">, {count} new</span>}\n {dot && <span className=\"sr-only\">, new</span>}\n </>\n );\n const classes = cn(\n 'flex min-h-14 w-full min-w-11 flex-col items-center justify-center gap-1 px-1 py-1.5 text-[11px] font-medium text-muted-foreground transition-colors select-none [-webkit-tap-highlight-color:transparent] hover:text-foreground',\n focusRingClasses,\n 'focus-visible:outline-offset-[-2px]',\n active && 'text-brand hover:text-brand',\n );\n return (\n <li key={item.id} className=\"min-w-0 flex-1\">\n {item.href ? (\n <a\n href={item.href}\n aria-current={active ? 'page' : undefined}\n onClick={(e) => onValueChange?.(item.id, e)}\n className={classes}\n >\n {content}\n </a>\n ) : (\n <button\n type=\"button\"\n aria-current={active ? 'page' : undefined}\n onClick={(e) => onValueChange?.(item.id, e)}\n className={classes}\n >\n {content}\n </button>\n )}\n </li>\n );\n })}\n </ul>\n </nav>\n );\n});\n\nexport { MobileNav };\n"],"m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oBAAC,UAAD;MACE,MAAK;MACL,gBAAc,SAAS,SAAS,KAAA;MAChC,UAAU,MAAM,gBAAgB,KAAK,IAAI,CAAC;MAC1C,WAAW;MAEV,UAAA;KACK,CAAA;IAER,GApBK,KAAK,EAoBV;GAER,CAAC;EACC,CAAA;CACD,CAAA;AAET,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type FieldWidth } from './input';
|
|
3
|
+
export interface NativeSelectProps extends React.ComponentProps<'select'> {
|
|
4
|
+
/** How wide the field is from 640px up; full width on phones. */
|
|
5
|
+
width?: FieldWidth;
|
|
6
|
+
/** Classes for the wrapper that positions the chevron; `className` goes to the select. */
|
|
7
|
+
containerClassName?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The browser's own `<select>`, drawn like the kit's fields. Use it for short
|
|
11
|
+
* lists in forms on phones, where the platform picker beats a popover, and
|
|
12
|
+
* anywhere a portal is unwelcome. For search, descriptions or long lists use
|
|
13
|
+
* Select or Combobox.
|
|
14
|
+
*/
|
|
15
|
+
declare const NativeSelect: React.ForwardRefExoticComponent<Omit<NativeSelectProps, "ref"> & React.RefAttributes<HTMLSelectElement>>;
|
|
16
|
+
export { NativeSelect };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { fieldClasses, fieldWidthClasses } from "./input.js";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import ChevronDown from "@burtson-labs/icons/react/chevron-down";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/native-select.tsx
|
|
8
|
+
/**
|
|
9
|
+
* The browser's own `<select>`, drawn like the kit's fields. Use it for short
|
|
10
|
+
* lists in forms on phones, where the platform picker beats a popover, and
|
|
11
|
+
* anywhere a portal is unwelcome. For search, descriptions or long lists use
|
|
12
|
+
* Select or Combobox.
|
|
13
|
+
*/
|
|
14
|
+
var NativeSelect = React.forwardRef(function NativeSelect({ className, containerClassName, width, children, ...props }, ref) {
|
|
15
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
16
|
+
"data-slot": "native-select-container",
|
|
17
|
+
className: cn("relative flex min-w-0", width ? fieldWidthClasses[width] : "w-full", containerClassName),
|
|
18
|
+
children: [/* @__PURE__ */ jsx("select", {
|
|
19
|
+
ref,
|
|
20
|
+
"data-slot": "native-select",
|
|
21
|
+
className: cn(fieldClasses, "h-9 w-full cursor-pointer appearance-none py-1.5 pr-9", className),
|
|
22
|
+
...props,
|
|
23
|
+
children
|
|
24
|
+
}), /* @__PURE__ */ jsx(ChevronDown, {
|
|
25
|
+
"aria-hidden": true,
|
|
26
|
+
className: "pointer-events-none absolute top-1/2 right-3 size-4 -translate-y-1/2 text-muted-foreground"
|
|
27
|
+
})]
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
//#endregion
|
|
31
|
+
export { NativeSelect };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=native-select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native-select.js","names":[],"sources":["../../src/components/native-select.tsx"],"sourcesContent":["import ChevronDown from '@burtson-labs/icons/react/chevron-down';\nimport * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\nimport { fieldClasses, type FieldWidth, fieldWidthClasses } from './input';\n\nexport interface NativeSelectProps extends React.ComponentProps<'select'> {\n /** How wide the field is from 640px up; full width on phones. */\n width?: FieldWidth;\n /** Classes for the wrapper that positions the chevron; `className` goes to the select. */\n containerClassName?: string;\n}\n\n/**\n * The browser's own `<select>`, drawn like the kit's fields. Use it for short\n * lists in forms on phones, where the platform picker beats a popover, and\n * anywhere a portal is unwelcome. For search, descriptions or long lists use\n * Select or Combobox.\n */\nconst NativeSelect = React.forwardRef<HTMLSelectElement, NativeSelectProps>(function NativeSelect(\n { className, containerClassName, width, children, ...props }: NativeSelectProps,\n ref,\n) {\n return (\n <span\n data-slot=\"native-select-container\"\n className={cn(\n 'relative flex min-w-0',\n width ? fieldWidthClasses[width] : 'w-full',\n containerClassName,\n )}\n >\n <select\n ref={ref}\n data-slot=\"native-select\"\n className={cn(\n fieldClasses,\n 'h-9 w-full cursor-pointer appearance-none py-1.5 pr-9',\n className,\n )}\n {...props}\n >\n {children}\n </select>\n <ChevronDown\n aria-hidden\n className=\"pointer-events-none absolute top-1/2 right-3 size-4 -translate-y-1/2 text-muted-foreground\"\n />\n </span>\n );\n});\n\nexport { NativeSelect };\n"],"mappings":";;;;;;;;;;;;;AAoBA,IAAM,eAAe,MAAM,WAAiD,SAAS,aACnF,EAAE,WAAW,oBAAoB,OAAO,UAAU,GAAG,SACrD,KACA;CACA,OACE,qBAAC,QAAD;EACE,aAAU;EACV,WAAW,GACT,yBACA,QAAQ,kBAAkB,SAAS,UACnC,kBACF;EANF,UAAA,CAQE,oBAAC,UAAD;GACO;GACL,aAAU;GACV,WAAW,GACT,cACA,yDACA,SACF;GACA,GAAI;GAEH;EACK,CAAA,GACR,oBAAC,aAAD;GACE,eAAA;GACA,WAAU;EACX,CAAA,CACG;;AAEV,CAAC"}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { NavigationMenu as NavigationMenuPrimitive } from 'radix-ui';
|
|
2
1
|
import * as React from 'react';
|
|
2
|
+
import * as NavigationMenuPrimitive from '../primitives/vendor/radix/react-navigation-menu';
|
|
3
3
|
/**
|
|
4
4
|
* Site navigation with dropdown panels (a products menu, docs sections).
|
|
5
5
|
* Keyboard and screen-reader behaviour come from Radix; the panel renders in
|
|
6
6
|
* a shared viewport under the bar, sized to its content.
|
|
7
7
|
*/
|
|
8
|
-
declare
|
|
8
|
+
declare const NavigationMenu: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuProps & React.RefAttributes<HTMLElement> & {
|
|
9
9
|
viewport?: boolean;
|
|
10
|
-
}
|
|
11
|
-
declare
|
|
12
|
-
declare
|
|
13
|
-
/** The look of a top-level entry, for links that sit beside triggers. */
|
|
14
|
-
declare const navigationMenuTriggerStyle
|
|
15
|
-
declare
|
|
16
|
-
declare
|
|
17
|
-
|
|
18
|
-
declare
|
|
19
|
-
declare
|
|
10
|
+
}, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
11
|
+
declare const NavigationMenuList: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuListProps & React.RefAttributes<HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
|
|
12
|
+
declare const NavigationMenuItem: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuItemProps & React.RefAttributes<HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
13
|
+
/** The look of a top-level entry, for links that sit beside triggers; 44px on touch screens. */
|
|
14
|
+
declare const navigationMenuTriggerStyle: string;
|
|
15
|
+
declare const NavigationMenuTrigger: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
16
|
+
declare const NavigationMenuContent: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
/** The shared panel: the floating surface (12px radius, elevation 4). */
|
|
18
|
+
declare const NavigationMenuViewport: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuViewportProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const NavigationMenuLink: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
20
|
+
declare const NavigationMenuIndicator: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuIndicatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
20
21
|
export { NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, navigationMenuTriggerStyle, NavigationMenuViewport, };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn, focusRingClasses } from "../lib/utils.js";
|
|
3
|
+
import { Content, Indicator, Item, Link, List, Root, Trigger, Viewport } from "../primitives/vendor/radix/react-navigation-menu/navigation-menu.js";
|
|
4
|
+
import * as React from "react";
|
|
2
5
|
import ChevronDown from "@burtson-labs/icons/react/chevron-down";
|
|
3
|
-
import { NavigationMenu } from "radix-ui";
|
|
4
|
-
import "react";
|
|
5
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
//#region src/components/navigation-menu.tsx
|
|
7
8
|
/**
|
|
@@ -9,75 +10,84 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
9
10
|
* Keyboard and screen-reader behaviour come from Radix; the panel renders in
|
|
10
11
|
* a shared viewport under the bar, sized to its content.
|
|
11
12
|
*/
|
|
12
|
-
function NavigationMenu
|
|
13
|
-
return /* @__PURE__ */ jsxs(
|
|
13
|
+
var NavigationMenu = React.forwardRef(function NavigationMenu({ className, children, viewport = true, ...props }, ref) {
|
|
14
|
+
return /* @__PURE__ */ jsxs(Root, {
|
|
15
|
+
ref,
|
|
14
16
|
"data-slot": "navigation-menu",
|
|
15
17
|
"data-viewport": viewport,
|
|
16
18
|
className: cn("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center", className),
|
|
17
19
|
...props,
|
|
18
20
|
children: [children, viewport && /* @__PURE__ */ jsx(NavigationMenuViewport, {})]
|
|
19
21
|
});
|
|
20
|
-
}
|
|
21
|
-
function NavigationMenuList({ className, ...props }) {
|
|
22
|
-
return /* @__PURE__ */ jsx(
|
|
22
|
+
});
|
|
23
|
+
var NavigationMenuList = React.forwardRef(function NavigationMenuList({ className, ...props }, ref) {
|
|
24
|
+
return /* @__PURE__ */ jsx(List, {
|
|
25
|
+
ref,
|
|
23
26
|
"data-slot": "navigation-menu-list",
|
|
24
27
|
className: cn("group flex flex-1 list-none items-center justify-center gap-1", className),
|
|
25
28
|
...props
|
|
26
29
|
});
|
|
27
|
-
}
|
|
28
|
-
function NavigationMenuItem({ className, ...props }) {
|
|
29
|
-
return /* @__PURE__ */ jsx(
|
|
30
|
+
});
|
|
31
|
+
var NavigationMenuItem = React.forwardRef(function NavigationMenuItem({ className, ...props }, ref) {
|
|
32
|
+
return /* @__PURE__ */ jsx(Item, {
|
|
33
|
+
ref,
|
|
30
34
|
"data-slot": "navigation-menu-item",
|
|
31
35
|
className: cn("relative", className),
|
|
32
36
|
...props
|
|
33
37
|
});
|
|
34
|
-
}
|
|
35
|
-
/** The look of a top-level entry, for links that sit beside triggers. */
|
|
36
|
-
var navigationMenuTriggerStyle = "group inline-flex h-9 w-max items-center justify-center gap-1 rounded-md px-3 text-sm font-semibold text-foreground/80
|
|
37
|
-
function NavigationMenuTrigger({ className, children, ...props }) {
|
|
38
|
-
return /* @__PURE__ */ jsxs(
|
|
38
|
+
});
|
|
39
|
+
/** The look of a top-level entry, for links that sit beside triggers; 44px on touch screens. */
|
|
40
|
+
var navigationMenuTriggerStyle = cn("group inline-flex h-9 w-max items-center justify-center gap-1 rounded-md px-3 text-sm font-semibold text-foreground/80 transition-colors hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-50 data-[active]:text-foreground data-[state=open]:bg-muted data-[state=open]:text-foreground pointer-coarse:h-11", focusRingClasses);
|
|
41
|
+
var NavigationMenuTrigger = React.forwardRef(function NavigationMenuTrigger({ className, children, ...props }, ref) {
|
|
42
|
+
return /* @__PURE__ */ jsxs(Trigger, {
|
|
43
|
+
ref,
|
|
39
44
|
"data-slot": "navigation-menu-trigger",
|
|
40
45
|
className: cn(navigationMenuTriggerStyle, className),
|
|
41
46
|
...props,
|
|
42
47
|
children: [children, /* @__PURE__ */ jsx(ChevronDown, {
|
|
43
48
|
"aria-hidden": true,
|
|
44
|
-
className: "relative top-px size-
|
|
49
|
+
className: "relative top-px size-4 transition-transform duration-(--duration-standard) group-data-[state=open]:rotate-180"
|
|
45
50
|
})]
|
|
46
51
|
});
|
|
47
|
-
}
|
|
48
|
-
function NavigationMenuContent({ className, ...props }) {
|
|
49
|
-
return /* @__PURE__ */ jsx(
|
|
52
|
+
});
|
|
53
|
+
var NavigationMenuContent = React.forwardRef(function NavigationMenuContent({ className, ...props }, ref) {
|
|
54
|
+
return /* @__PURE__ */ jsx(Content, {
|
|
55
|
+
ref,
|
|
50
56
|
"data-slot": "navigation-menu-content",
|
|
51
57
|
className: cn("top-0 left-0 w-full p-2 md:absolute md:w-auto data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion=from-end]:[--bl-tx:24px] data-[motion=from-start]:[--bl-tx:-24px] data-[motion=to-end]:[--bl-tx:24px] data-[motion=to-start]:[--bl-tx:-24px] [--bl-scale:1]", className),
|
|
52
58
|
...props
|
|
53
59
|
});
|
|
54
|
-
}
|
|
55
|
-
|
|
60
|
+
});
|
|
61
|
+
/** The shared panel: the floating surface (12px radius, elevation 4). */
|
|
62
|
+
var NavigationMenuViewport = React.forwardRef(function NavigationMenuViewport({ className, ...props }, ref) {
|
|
56
63
|
return /* @__PURE__ */ jsx("div", {
|
|
57
64
|
className: "absolute top-full left-0 z-50 flex justify-center",
|
|
58
|
-
children: /* @__PURE__ */ jsx(
|
|
65
|
+
children: /* @__PURE__ */ jsx(Viewport, {
|
|
66
|
+
ref,
|
|
59
67
|
"data-slot": "navigation-menu-viewport",
|
|
60
|
-
className: cn("relative mt-2 h-(--radix-navigation-menu-viewport-height) w-full origin-top overflow-hidden rounded-lg border border-border-strong bg-surface-raised text-popover-foreground shadow-
|
|
68
|
+
className: cn("relative mt-2 h-(--radix-navigation-menu-viewport-height) w-full origin-top overflow-hidden rounded-lg border border-border-strong bg-surface-raised text-popover-foreground shadow-lg transition-[width,height] duration-(--duration-standard) [--bl-ty:-6px] data-[state=closed]:animate-out data-[state=open]:animate-in md:w-(--radix-navigation-menu-viewport-width)", className),
|
|
61
69
|
...props
|
|
62
70
|
})
|
|
63
71
|
});
|
|
64
|
-
}
|
|
65
|
-
function NavigationMenuLink({ className, ...props }) {
|
|
66
|
-
return /* @__PURE__ */ jsx(
|
|
72
|
+
});
|
|
73
|
+
var NavigationMenuLink = React.forwardRef(function NavigationMenuLink({ className, ...props }, ref) {
|
|
74
|
+
return /* @__PURE__ */ jsx(Link, {
|
|
75
|
+
ref,
|
|
67
76
|
"data-slot": "navigation-menu-link",
|
|
68
|
-
className: cn("flex flex-col gap-1 rounded-sm p-2 text-sm
|
|
77
|
+
className: cn("flex flex-col gap-1 rounded-sm p-2 text-sm transition-colors hover:bg-muted data-[active=true]:bg-muted data-[active=true]:shadow-[inset_2px_0_0_var(--color-brand)] [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground", focusRingClasses, "focus-visible:outline-offset-[-2px]", className),
|
|
69
78
|
...props
|
|
70
79
|
});
|
|
71
|
-
}
|
|
72
|
-
function NavigationMenuIndicator({ className, ...props }) {
|
|
73
|
-
return /* @__PURE__ */ jsx(
|
|
80
|
+
});
|
|
81
|
+
var NavigationMenuIndicator = React.forwardRef(function NavigationMenuIndicator({ className, ...props }, ref) {
|
|
82
|
+
return /* @__PURE__ */ jsx(Indicator, {
|
|
83
|
+
ref,
|
|
74
84
|
"data-slot": "navigation-menu-indicator",
|
|
75
85
|
className: cn("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=hidden]:animate-out data-[state=visible]:animate-in", className),
|
|
76
86
|
...props,
|
|
77
87
|
children: /* @__PURE__ */ jsx("div", { className: "relative top-[60%] size-2 rotate-45 rounded-tl-sm bg-border-strong" })
|
|
78
88
|
});
|
|
79
|
-
}
|
|
89
|
+
});
|
|
80
90
|
//#endregion
|
|
81
|
-
export { NavigationMenu
|
|
91
|
+
export { NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, navigationMenuTriggerStyle };
|
|
82
92
|
|
|
83
93
|
//# sourceMappingURL=navigation-menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-menu.js","names":["
|
|
1
|
+
{"version":3,"file":"navigation-menu.js","names":["NavigationMenuPrimitive.Root","NavigationMenuPrimitive.List","NavigationMenuPrimitive.Item","NavigationMenuPrimitive.Trigger","NavigationMenuPrimitive.Content","NavigationMenuPrimitive.Viewport","NavigationMenuPrimitive.Link","NavigationMenuPrimitive.Indicator"],"sources":["../../src/components/navigation-menu.tsx"],"sourcesContent":["import ChevronDown from '@burtson-labs/icons/react/chevron-down';\nimport * as React from 'react';\n\nimport { cn, focusRingClasses } from '../lib/utils';\nimport * as NavigationMenuPrimitive from '../primitives/vendor/radix/react-navigation-menu';\n\n/**\n * Site navigation with dropdown panels (a products menu, docs sections).\n * Keyboard and screen-reader behaviour come from Radix; the panel renders in\n * a shared viewport under the bar, sized to its content.\n */\nconst NavigationMenu = React.forwardRef<\n HTMLElement,\n React.ComponentProps<typeof NavigationMenuPrimitive.Root> & { viewport?: boolean }\n>(function NavigationMenu({ className, children, viewport = true, ...props }, ref) {\n return (\n <NavigationMenuPrimitive.Root\n ref={ref}\n data-slot=\"navigation-menu\"\n data-viewport={viewport}\n className={cn(\n 'group/navigation-menu relative flex max-w-max flex-1 items-center justify-center',\n className,\n )}\n {...props}\n >\n {children}\n {viewport && <NavigationMenuViewport />}\n </NavigationMenuPrimitive.Root>\n );\n});\n\nconst NavigationMenuList = React.forwardRef<\n HTMLUListElement,\n React.ComponentProps<typeof NavigationMenuPrimitive.List>\n>(function NavigationMenuList({ className, ...props }, ref) {\n return (\n <NavigationMenuPrimitive.List\n ref={ref}\n data-slot=\"navigation-menu-list\"\n className={cn('group flex flex-1 list-none items-center justify-center gap-1', className)}\n {...props}\n />\n );\n});\n\nconst NavigationMenuItem = React.forwardRef<\n HTMLLIElement,\n React.ComponentProps<typeof NavigationMenuPrimitive.Item>\n>(function NavigationMenuItem({ className, ...props }, ref) {\n return (\n <NavigationMenuPrimitive.Item\n ref={ref}\n data-slot=\"navigation-menu-item\"\n className={cn('relative', className)}\n {...props}\n />\n );\n});\n\n/** The look of a top-level entry, for links that sit beside triggers; 44px on touch screens. */\nconst navigationMenuTriggerStyle = cn(\n 'group inline-flex h-9 w-max items-center justify-center gap-1 rounded-md px-3 text-sm font-semibold text-foreground/80 transition-colors hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-50 data-[active]:text-foreground data-[state=open]:bg-muted data-[state=open]:text-foreground pointer-coarse:h-11',\n focusRingClasses,\n);\n\nconst NavigationMenuTrigger = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>\n>(function NavigationMenuTrigger({ className, children, ...props }, ref) {\n return (\n <NavigationMenuPrimitive.Trigger\n ref={ref}\n data-slot=\"navigation-menu-trigger\"\n className={cn(navigationMenuTriggerStyle, className)}\n {...props}\n >\n {children}\n <ChevronDown\n aria-hidden\n className=\"relative top-px size-4 transition-transform duration-(--duration-standard) group-data-[state=open]:rotate-180\"\n />\n </NavigationMenuPrimitive.Trigger>\n );\n});\n\nconst NavigationMenuContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<typeof NavigationMenuPrimitive.Content>\n>(function NavigationMenuContent({ className, ...props }, ref) {\n return (\n <NavigationMenuPrimitive.Content\n ref={ref}\n data-slot=\"navigation-menu-content\"\n className={cn(\n 'top-0 left-0 w-full p-2 md:absolute md:w-auto data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion=from-end]:[--bl-tx:24px] data-[motion=from-start]:[--bl-tx:-24px] data-[motion=to-end]:[--bl-tx:24px] data-[motion=to-start]:[--bl-tx:-24px] [--bl-scale:1]',\n className,\n )}\n {...props}\n />\n );\n});\n\n/** The shared panel: the floating surface (12px radius, elevation 4). */\nconst NavigationMenuViewport = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>\n>(function NavigationMenuViewport({ className, ...props }, ref) {\n return (\n <div className=\"absolute top-full left-0 z-50 flex justify-center\">\n <NavigationMenuPrimitive.Viewport\n ref={ref}\n data-slot=\"navigation-menu-viewport\"\n className={cn(\n 'relative mt-2 h-(--radix-navigation-menu-viewport-height) w-full origin-top overflow-hidden rounded-lg border border-border-strong bg-surface-raised text-popover-foreground shadow-lg transition-[width,height] duration-(--duration-standard) [--bl-ty:-6px] data-[state=closed]:animate-out data-[state=open]:animate-in md:w-(--radix-navigation-menu-viewport-width)',\n className,\n )}\n {...props}\n />\n </div>\n );\n});\n\nconst NavigationMenuLink = React.forwardRef<\n HTMLAnchorElement,\n React.ComponentProps<typeof NavigationMenuPrimitive.Link>\n>(function NavigationMenuLink({ className, ...props }, ref) {\n return (\n <NavigationMenuPrimitive.Link\n ref={ref}\n data-slot=\"navigation-menu-link\"\n className={cn(\n \"flex flex-col gap-1 rounded-sm p-2 text-sm transition-colors hover:bg-muted data-[active=true]:bg-muted data-[active=true]:shadow-[inset_2px_0_0_var(--color-brand)] [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground\",\n focusRingClasses,\n 'focus-visible:outline-offset-[-2px]',\n className,\n )}\n {...props}\n />\n );\n});\n\nconst NavigationMenuIndicator = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>\n>(function NavigationMenuIndicator({ className, ...props }, ref) {\n return (\n <NavigationMenuPrimitive.Indicator\n ref={ref}\n data-slot=\"navigation-menu-indicator\"\n className={cn(\n 'top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=hidden]:animate-out data-[state=visible]:animate-in',\n className,\n )}\n {...props}\n >\n <div className=\"relative top-[60%] size-2 rotate-45 rounded-tl-sm bg-border-strong\" />\n </NavigationMenuPrimitive.Indicator>\n );\n});\n\nexport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuIndicator,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n NavigationMenuViewport,\n};\n"],"mappings":";;;;;;;;;;;;AAWA,IAAM,iBAAiB,MAAM,WAG3B,SAAS,eAAe,EAAE,WAAW,UAAU,WAAW,MAAM,GAAG,SAAS,KAAK;CACjF,OACE,qBAACA,MAAD;EACO;EACL,aAAU;EACV,iBAAe;EACf,WAAW,GACT,oFACA,SACF;EACA,GAAI;EARN,UAAA,CAUG,UACA,YAAY,oBAAC,wBAAD,CAAyB,CAAA,CACV;;AAElC,CAAC;AAED,IAAM,qBAAqB,MAAM,WAG/B,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAAS,KAAK;CAC1D,OACE,oBAACC,MAAD;EACO;EACL,aAAU;EACV,WAAW,GAAG,iEAAiE,SAAS;EACxF,GAAI;CACL,CAAA;AAEL,CAAC;AAED,IAAM,qBAAqB,MAAM,WAG/B,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAAS,KAAK;CAC1D,OACE,oBAACC,MAAD;EACO;EACL,aAAU;EACV,WAAW,GAAG,YAAY,SAAS;EACnC,GAAI;CACL,CAAA;AAEL,CAAC;;AAGD,IAAM,6BAA6B,GACjC,iVACA,gBACF;AAEA,IAAM,wBAAwB,MAAM,WAGlC,SAAS,sBAAsB,EAAE,WAAW,UAAU,GAAG,SAAS,KAAK;CACvE,OACE,qBAACC,SAAD;EACO;EACL,aAAU;EACV,WAAW,GAAG,4BAA4B,SAAS;EACnD,GAAI;EAJN,UAAA,CAMG,UACD,oBAAC,aAAD;GACE,eAAA;GACA,WAAU;EACX,CAAA,CAC8B;;AAErC,CAAC;AAED,IAAM,wBAAwB,MAAM,WAGlC,SAAS,sBAAsB,EAAE,WAAW,GAAG,SAAS,KAAK;CAC7D,OACE,oBAACC,SAAD;EACO;EACL,aAAU;EACV,WAAW,GACT,yRACA,SACF;EACA,GAAI;CACL,CAAA;AAEL,CAAC;;AAGD,IAAM,yBAAyB,MAAM,WAGnC,SAAS,uBAAuB,EAAE,WAAW,GAAG,SAAS,KAAK;CAC9D,OACE,oBAAC,OAAD;EAAK,WAAU;EACb,UAAA,oBAACC,UAAD;GACO;GACL,aAAU;GACV,WAAW,GACT,6WACA,SACF;GACA,GAAI;EACL,CAAA;CACE,CAAA;AAET,CAAC;AAED,IAAM,qBAAqB,MAAM,WAG/B,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAAS,KAAK;CAC1D,OACE,oBAACC,MAAD;EACO;EACL,aAAU;EACV,WAAW,GACT,iQACA,kBACA,uCACA,SACF;EACA,GAAI;CACL,CAAA;AAEL,CAAC;AAED,IAAM,0BAA0B,MAAM,WAGpC,SAAS,wBAAwB,EAAE,WAAW,GAAG,SAAS,KAAK;CAC/D,OACE,oBAACC,WAAD;EACO;EACL,aAAU;EACV,WAAW,GACT,sIACA,SACF;EACA,GAAI;EAEJ,UAAA,oBAAC,OAAD,EAAK,WAAU,qEAAsE,CAAA;CACpD,CAAA;AAEvC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type FieldWidth } from './input';
|
|
3
|
+
export interface NumberInputProps extends Omit<React.ComponentProps<'input'>, 'prefix' | 'type'> {
|
|
4
|
+
/** Inside the field, before the number: "$". */
|
|
5
|
+
prefix?: React.ReactNode;
|
|
6
|
+
/** Inside the field, after the number: "gal", "min", "%". */
|
|
7
|
+
suffix?: React.ReactNode;
|
|
8
|
+
/** How wide the field is from 640px up; `sm` (money, a count) by default. */
|
|
9
|
+
width?: FieldWidth;
|
|
10
|
+
/** Allows a decimal point on the phone keyboard (`inputMode="decimal"`). */
|
|
11
|
+
decimal?: boolean;
|
|
12
|
+
/** Classes for the box; `className` goes to the input itself. */
|
|
13
|
+
containerClassName?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A number with its unit inside the field, right-aligned in tabular figures
|
|
17
|
+
* so a column of them lines up, with the numeric keyboard on phones. The box
|
|
18
|
+
* is the field: it carries the border, the focus ring and the invalid and
|
|
19
|
+
* disabled states, and the input inside is borderless. The value stays a
|
|
20
|
+
* string, as with any input: parse it on change.
|
|
21
|
+
*/
|
|
22
|
+
declare const NumberInput: React.ForwardRefExoticComponent<Omit<NumberInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
23
|
+
export { NumberInput };
|