@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
package/dist/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { cn } from "./lib/utils.js";
|
|
1
|
+
import { cn, focusRingClasses, noOutlineClasses, touchTargetClasses, touchTargetRowClasses } from "./lib/utils.js";
|
|
2
|
+
import { breakpoints, useMediaQuery, useNarrowerThan } from "./lib/media.js";
|
|
2
3
|
import { isApplePlatform, modKeyLabel, shortcutLabel } from "./lib/platform.js";
|
|
3
|
-
import tokens, { accentTokens, brand, contrast, dark, duration, easing, elevation, fontMono, fontSans, light, mix, motion, radius, shadow } from "./tokens.js";
|
|
4
|
+
import tokens, { accentTokens, brand, contrast, dark, duration, easing, elevation, fontMono, fontSans, layer, light, mix, motion, radius, shadow } from "./tokens.js";
|
|
4
5
|
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "./components/accordion.js";
|
|
5
6
|
import { Alert, AlertDescription, AlertTitle, alertVariants } from "./components/alert.js";
|
|
6
7
|
import { Button, buttonVariants } from "./components/button.js";
|
|
8
|
+
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, overlayClasses, overlayCloseClasses } from "./components/dialog.js";
|
|
7
9
|
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "./components/alert-dialog.js";
|
|
8
10
|
import { AppShell, AppShellBody, AppShellContent, AppShellHeader, AppShellMain, AppShellSidebar } from "./components/app-shell.js";
|
|
9
11
|
import { Progress } from "./components/progress.js";
|
|
@@ -14,18 +16,17 @@ import { Avatar, AvatarFallback, AvatarImage } from "./components/avatar.js";
|
|
|
14
16
|
import { Badge, badgeVariants } from "./components/badge.js";
|
|
15
17
|
import { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "./components/breadcrumb.js";
|
|
16
18
|
import { Card, CardAction, CardContent, CardDescription, CardEyebrow, CardFooter, CardHeader, CardTitle, cardVariants } from "./components/card.js";
|
|
17
|
-
import { Popover, PopoverAnchor, PopoverContent, PopoverTrigger, menuItemClasses, surfaceClasses } from "./components/popover.js";
|
|
19
|
+
import { Popover, PopoverAnchor, PopoverContent, PopoverTrigger, menuItemClasses, menuLabelClasses, surfaceClasses } from "./components/popover.js";
|
|
18
20
|
import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "./components/dropdown-menu.js";
|
|
19
|
-
import { Input, fieldClasses, fieldFocusClasses } from "./components/input.js";
|
|
21
|
+
import { Input, SearchInput, fieldClasses, fieldFocusClasses, fieldWidthClasses } from "./components/input.js";
|
|
20
22
|
import { ChatHistory, groupConversations, matchesConversation } from "./components/chat-history.js";
|
|
21
23
|
import { IconButton } from "./components/icon-button.js";
|
|
22
24
|
import { ResizablePanel, ResizablePanelGroup, ResizeHandle, useGroupRef, usePanelRef } from "./components/resizable.js";
|
|
23
25
|
import { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger } from "./components/sheet.js";
|
|
24
26
|
import { ChatLayout, useFullscreen } from "./components/chat-layout.js";
|
|
25
|
-
import { Checkbox } from "./components/checkbox.js";
|
|
27
|
+
import { Checkbox, CheckboxRow } from "./components/checkbox.js";
|
|
26
28
|
import { CheckboxCard, CheckboxCardGroup } from "./components/checkbox-card.js";
|
|
27
29
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./components/collapsible.js";
|
|
28
|
-
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "./components/dialog.js";
|
|
29
30
|
import { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut } from "./components/command.js";
|
|
30
31
|
import { Combobox } from "./components/combobox.js";
|
|
31
32
|
import { Composer, Suggestions, acceptsFile } from "./components/composer.js";
|
|
@@ -40,11 +41,13 @@ import { CopyButton } from "./components/copy-button.js";
|
|
|
40
41
|
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue } from "./components/select.js";
|
|
41
42
|
import { DEFAULT_PAGE_SIZES, Pagination, clampPage, pageCountFor, pageWindow, paginate, paginationRange, paginationSummary, usePagination } from "./components/pagination.js";
|
|
42
43
|
import { Skeleton } from "./components/skeleton.js";
|
|
43
|
-
import { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from "./components/table.js";
|
|
44
|
+
import { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, overflowState } from "./components/table.js";
|
|
44
45
|
import { DataTable } from "./components/data-table.js";
|
|
45
46
|
import { EditorTabs } from "./components/editor-tabs.js";
|
|
46
47
|
import { EmptyState, EmptyStateActions, EmptyStateDescription, EmptyStateIcon, EmptyStateTitle } from "./components/empty-state.js";
|
|
47
|
-
import {
|
|
48
|
+
import { ErrorSummary } from "./components/error-summary.js";
|
|
49
|
+
import { Field, FieldDescription, FieldError, FieldGrid, FieldHeader, FieldHint, FieldLabel, FieldSet, useField } from "./components/field.js";
|
|
50
|
+
import { FormActions } from "./components/form-actions.js";
|
|
48
51
|
import { Kbd, KbdGroup } from "./components/kbd.js";
|
|
49
52
|
import { Label } from "./components/label.js";
|
|
50
53
|
import { CodeBlock, Markdown, parseMarkdown } from "./components/markdown.js";
|
|
@@ -52,19 +55,21 @@ import { Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem
|
|
|
52
55
|
import { Message } from "./components/message.js";
|
|
53
56
|
import { MessageActions, MessageAttachments, MessageEditor } from "./components/message-actions.js";
|
|
54
57
|
import { MobileNav } from "./components/mobile-nav.js";
|
|
58
|
+
import { NativeSelect } from "./components/native-select.js";
|
|
55
59
|
import { NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, navigationMenuTriggerStyle } from "./components/navigation-menu.js";
|
|
60
|
+
import { NumberInput } from "./components/number-input.js";
|
|
56
61
|
import { OnboardingChecklist } from "./components/onboarding-checklist.js";
|
|
57
62
|
import { PageHeader, PageHeaderActions, PageHeaderDescription, PageHeaderEyebrow, PageHeaderMain, PageHeaderTitle } from "./components/page-header.js";
|
|
58
|
-
import { RadioGroup, RadioGroupItem } from "./components/radio-group.js";
|
|
63
|
+
import { RadioCard, RadioGroup, RadioGroupItem } from "./components/radio-group.js";
|
|
59
64
|
import { Reasoning, StreamingIndicator } from "./components/reasoning.js";
|
|
60
65
|
import { ScrollArea, ScrollBar } from "./components/scroll-area.js";
|
|
61
66
|
import { SecretInput } from "./components/secret-input.js";
|
|
62
67
|
import { Separator } from "./components/separator.js";
|
|
63
68
|
import { Slider } from "./components/slider.js";
|
|
64
69
|
import { SourceCitation, SourceList, safeSourceHref } from "./components/source.js";
|
|
65
|
-
import { StatCard } from "./components/stat-card.js";
|
|
70
|
+
import { StatCard, StatStrip } from "./components/stat-card.js";
|
|
66
71
|
import { Steps } from "./components/steps.js";
|
|
67
|
-
import { Switch } from "./components/switch.js";
|
|
72
|
+
import { InlineSwitch, Switch, SwitchList, SwitchRow } from "./components/switch.js";
|
|
68
73
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "./components/tabs.js";
|
|
69
74
|
import { Textarea } from "./components/textarea.js";
|
|
70
75
|
import { ToolApproval, ToolCall } from "./components/tool-call.js";
|
|
@@ -72,4 +77,4 @@ import { Toolbar, ToolbarGroup, ToolbarSeparator, ToolbarSpacer } from "./compon
|
|
|
72
77
|
import { Spotlight, Tour, TourAnchor, findTourTarget, tourTarget, waitForTourTarget } from "./components/tour.js";
|
|
73
78
|
import { TreeView, flattenTree } from "./components/tree-view.js";
|
|
74
79
|
import { VoiceRecorder } from "./components/voice-recorder.js";
|
|
75
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AppShell, AppShellBody, AppShellContent, AppShellHeader, AppShellMain, AppShellSidebar, AttachmentItem, AttachmentTray, AudioPlayer, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, CardAction, CardContent, CardDescription, CardEyebrow, CardFooter, CardHeader, CardTitle, ChatHistory, ChatLayout, Checkbox, CheckboxCard, CheckboxCardGroup, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Composer, ConnectionBanner, ConnectionStatus, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, Conversation, CopyButton, DEFAULT_PAGE_SIZES, DataTable, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EditorTabs, EmptyState, EmptyStateActions, EmptyStateDescription, EmptyStateIcon, EmptyStateTitle, Field, FieldDescription, FieldError, FieldHeader, FieldHint, FieldLabel, IconButton, Input, Kbd, KbdGroup, Label, Markdown, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Message, MessageActions, MessageAttachments, MessageEditor, MobileNav, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, OnboardingChecklist, PageHeader, PageHeaderActions, PageHeaderDescription, PageHeaderEyebrow, PageHeaderMain, PageHeaderTitle, Pagination, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, Reasoning, ResizablePanel, ResizablePanelGroup, ResizeHandle, ScrollArea, ScrollBar, SecretInput, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Skeleton, Slider, SourceCitation, SourceList, Spinner, Spotlight, StatCard, Status, StatusDot, Steps, StreamingIndicator, Suggestions, Switch, SyncStatus, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, ToolApproval, ToolCall, Toolbar, ToolbarGroup, ToolbarSeparator, ToolbarSpacer, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Tour, TourAnchor, TreeView, UploadQueue, VoiceMessage, VoiceRecorder, accentTokens, acceptsFile, alertVariants, badgeVariants, brand, buttonVariants, cardVariants, clampPage, cn, computePeaks, contrast, dark, duration, easing, elevation, fieldClasses, fieldFocusClasses, findTourTarget, flattenTree, fontMono, fontSans, formatBytes, formatDuration, groupConversations, isApplePlatform, light, matchesConversation, menuItemClasses, mix, modKeyLabel, motion, navigationMenuTriggerStyle, pageCountFor, pageWindow, paginate, paginationRange, paginationSummary, parseMarkdown, peaksFromChannelData, radius, safeSourceHref, shadow, shortcutLabel, statusDotVariants, surfaceClasses, toast, toastVariants, tokens, tourTarget, useFullscreen, useGroupRef, usePagination, usePanelRef, waitForTourTarget };
|
|
80
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AppShell, AppShellBody, AppShellContent, AppShellHeader, AppShellMain, AppShellSidebar, AttachmentItem, AttachmentTray, AudioPlayer, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, CardAction, CardContent, CardDescription, CardEyebrow, CardFooter, CardHeader, CardTitle, ChatHistory, ChatLayout, Checkbox, CheckboxCard, CheckboxCardGroup, CheckboxRow, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Composer, ConnectionBanner, ConnectionStatus, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, Conversation, CopyButton, DEFAULT_PAGE_SIZES, DataTable, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EditorTabs, EmptyState, EmptyStateActions, EmptyStateDescription, EmptyStateIcon, EmptyStateTitle, ErrorSummary, Field, FieldDescription, FieldError, FieldGrid, FieldHeader, FieldHint, FieldLabel, FieldSet, FormActions, IconButton, InlineSwitch, Input, Kbd, KbdGroup, Label, Markdown, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Message, MessageActions, MessageAttachments, MessageEditor, MobileNav, NativeSelect, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, NumberInput, OnboardingChecklist, PageHeader, PageHeaderActions, PageHeaderDescription, PageHeaderEyebrow, PageHeaderMain, PageHeaderTitle, Pagination, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, RadioCard, RadioGroup, RadioGroupItem, Reasoning, ResizablePanel, ResizablePanelGroup, ResizeHandle, ScrollArea, ScrollBar, SearchInput, SecretInput, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Skeleton, Slider, SourceCitation, SourceList, Spinner, Spotlight, StatCard, StatStrip, Status, StatusDot, Steps, StreamingIndicator, Suggestions, Switch, SwitchList, SwitchRow, SyncStatus, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, ToolApproval, ToolCall, Toolbar, ToolbarGroup, ToolbarSeparator, ToolbarSpacer, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Tour, TourAnchor, TreeView, UploadQueue, VoiceMessage, VoiceRecorder, accentTokens, acceptsFile, alertVariants, badgeVariants, brand, breakpoints, buttonVariants, cardVariants, clampPage, cn, computePeaks, contrast, dark, duration, easing, elevation, fieldClasses, fieldFocusClasses, fieldWidthClasses, findTourTarget, flattenTree, focusRingClasses, fontMono, fontSans, formatBytes, formatDuration, groupConversations, isApplePlatform, layer, light, matchesConversation, menuItemClasses, menuLabelClasses, mix, modKeyLabel, motion, navigationMenuTriggerStyle, noOutlineClasses, overflowState, overlayClasses, overlayCloseClasses, pageCountFor, pageWindow, paginate, paginationRange, paginationSummary, parseMarkdown, peaksFromChannelData, radius, safeSourceHref, shadow, shortcutLabel, statusDotVariants, surfaceClasses, toast, toastVariants, tokens, touchTargetClasses, touchTargetRowClasses, tourTarget, useField, useFullscreen, useGroupRef, useMediaQuery, useNarrowerThan, usePagination, usePanelRef, waitForTourTarget };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Tailwind's breakpoints, for layout that has to change in script, not only in CSS. */
|
|
2
|
+
export declare const breakpoints: {
|
|
3
|
+
readonly sm: 640;
|
|
4
|
+
readonly md: 768;
|
|
5
|
+
readonly lg: 1024;
|
|
6
|
+
readonly xl: 1280;
|
|
7
|
+
};
|
|
8
|
+
export type Breakpoint = keyof typeof breakpoints;
|
|
9
|
+
/**
|
|
10
|
+
* True while the media query matches. Server-side and without `matchMedia`
|
|
11
|
+
* (old browsers, jsdom) it is false, so ask the question whose "false" is the
|
|
12
|
+
* desktop layout: `useMediaQuery('(max-width: 767px)')` rather than
|
|
13
|
+
* `(min-width: 768px)`. The value is read with useSyncExternalStore, so it is
|
|
14
|
+
* right on the first client render and never flashes the wrong layout.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useMediaQuery(query: string | null): boolean;
|
|
17
|
+
/** True while the viewport is narrower than the breakpoint; false with no `matchMedia`. */
|
|
18
|
+
export declare function useNarrowerThan(breakpoint: Breakpoint | false): boolean;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
//#region src/lib/media.ts
|
|
3
|
+
/** Tailwind's breakpoints, for layout that has to change in script, not only in CSS. */
|
|
4
|
+
var breakpoints = {
|
|
5
|
+
sm: 640,
|
|
6
|
+
md: 768,
|
|
7
|
+
lg: 1024,
|
|
8
|
+
xl: 1280
|
|
9
|
+
};
|
|
10
|
+
var noop = () => void 0;
|
|
11
|
+
/**
|
|
12
|
+
* True while the media query matches. Server-side and without `matchMedia`
|
|
13
|
+
* (old browsers, jsdom) it is false, so ask the question whose "false" is the
|
|
14
|
+
* desktop layout: `useMediaQuery('(max-width: 767px)')` rather than
|
|
15
|
+
* `(min-width: 768px)`. The value is read with useSyncExternalStore, so it is
|
|
16
|
+
* right on the first client render and never flashes the wrong layout.
|
|
17
|
+
*/
|
|
18
|
+
function useMediaQuery(query) {
|
|
19
|
+
const subscribe = React.useCallback((onChange) => {
|
|
20
|
+
if (!query || typeof matchMedia !== "function") return noop;
|
|
21
|
+
const mq = matchMedia(query);
|
|
22
|
+
mq.addEventListener?.("change", onChange);
|
|
23
|
+
return () => mq.removeEventListener?.("change", onChange);
|
|
24
|
+
}, [query]);
|
|
25
|
+
return React.useSyncExternalStore(subscribe, () => Boolean(query && typeof matchMedia === "function" && matchMedia(query).matches), () => false);
|
|
26
|
+
}
|
|
27
|
+
/** True while the viewport is narrower than the breakpoint; false with no `matchMedia`. */
|
|
28
|
+
function useNarrowerThan(breakpoint) {
|
|
29
|
+
return useMediaQuery(breakpoint ? `(max-width: ${breakpoints[breakpoint] - .02}px)` : null);
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { breakpoints, useMediaQuery, useNarrowerThan };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=media.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media.js","names":[],"sources":["../../src/lib/media.ts"],"sourcesContent":["import * as React from 'react';\n\n/** Tailwind's breakpoints, for layout that has to change in script, not only in CSS. */\nexport const breakpoints = { sm: 640, md: 768, lg: 1024, xl: 1280 } as const;\n\nexport type Breakpoint = keyof typeof breakpoints;\n\nconst noop = () => undefined;\n\n/**\n * True while the media query matches. Server-side and without `matchMedia`\n * (old browsers, jsdom) it is false, so ask the question whose \"false\" is the\n * desktop layout: `useMediaQuery('(max-width: 767px)')` rather than\n * `(min-width: 768px)`. The value is read with useSyncExternalStore, so it is\n * right on the first client render and never flashes the wrong layout.\n */\nexport function useMediaQuery(query: string | null): boolean {\n const subscribe = React.useCallback(\n (onChange: () => void) => {\n if (!query || typeof matchMedia !== 'function') return noop;\n const mq = matchMedia(query);\n mq.addEventListener?.('change', onChange);\n return () => mq.removeEventListener?.('change', onChange);\n },\n [query],\n );\n return React.useSyncExternalStore(\n subscribe,\n () => Boolean(query && typeof matchMedia === 'function' && matchMedia(query).matches),\n () => false,\n );\n}\n\n/** True while the viewport is narrower than the breakpoint; false with no `matchMedia`. */\nexport function useNarrowerThan(breakpoint: Breakpoint | false): boolean {\n return useMediaQuery(breakpoint ? `(max-width: ${breakpoints[breakpoint] - 0.02}px)` : null);\n}\n"],"mappings":";;;AAGA,IAAa,cAAc;CAAE,IAAI;CAAK,IAAI;CAAK,IAAI;CAAM,IAAI;AAAK;AAIlE,IAAM,aAAa,KAAA;;;;;;;;AASnB,SAAgB,cAAc,OAA+B;CAC3D,MAAM,YAAY,MAAM,aACrB,aAAyB;EACxB,IAAI,CAAC,SAAS,OAAO,eAAe,YAAY,OAAO;EACvD,MAAM,KAAK,WAAW,KAAK;EAC3B,GAAG,mBAAmB,UAAU,QAAQ;EACxC,aAAa,GAAG,sBAAsB,UAAU,QAAQ;CAC1D,GACA,CAAC,KAAK,CACR;CACA,OAAO,MAAM,qBACX,iBACM,QAAQ,SAAS,OAAO,eAAe,cAAc,WAAW,KAAK,CAAC,CAAC,OAAO,SAC9E,KACR;AACF;;AAGA,SAAgB,gBAAgB,YAAyC;CACvE,OAAO,cAAc,aAAa,eAAe,YAAY,cAAc,IAAK,OAAO,IAAI;AAC7F"}
|
package/dist/lib/utils.d.ts
CHANGED
|
@@ -1,3 +1,35 @@
|
|
|
1
1
|
import { type ClassValue } from 'clsx';
|
|
2
2
|
/** Joins class names and lets later Tailwind utilities override earlier ones. */
|
|
3
3
|
export declare function cn(...inputs: ClassValue[]): string;
|
|
4
|
+
/**
|
|
5
|
+
* Keyboard focus for buttons, toggles, tabs, links and every other control
|
|
6
|
+
* that is not a text field: a 2px outline in the ring colour, 2px outside the
|
|
7
|
+
* box, so it follows the control's radius and reads at 3:1 on any surface.
|
|
8
|
+
* (Fields use `fieldFocusClasses`: the border and a 1px inset ring. Menu and
|
|
9
|
+
* list rows use a fill.) The same outline theme.css draws for any `[data-slot]`
|
|
10
|
+
* by default; spelling it out here keeps it when a host page sets
|
|
11
|
+
* `outline: none` on buttons. (`outline-solid` matters: Tailwind's
|
|
12
|
+
* `outline-none` sets the shared outline-style variable to none, and
|
|
13
|
+
* `outline-2` alone would read it back.)
|
|
14
|
+
*/
|
|
15
|
+
export declare const focusRingClasses = "outline-none focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring";
|
|
16
|
+
/**
|
|
17
|
+
* Suppresses the outline outright (a control that draws focus another way, or
|
|
18
|
+
* whose box is not the focus target), with `!important` so a host page's
|
|
19
|
+
* unlayered `:focus-visible { outline }` cannot draw a second box. In forced-
|
|
20
|
+
* colors mode (Windows High Contrast) no ring or border colour survives, so
|
|
21
|
+
* keyboard focus gets a system-colour outline there and nothing at rest.
|
|
22
|
+
*/
|
|
23
|
+
export declare const noOutlineClasses = "outline-none! forced-colors:focus-visible:[outline:2px_solid_Highlight]! forced-colors:focus-visible:outline-offset-2";
|
|
24
|
+
/**
|
|
25
|
+
* A 44px hit area on touch screens for a small control (a 16px checkbox, a
|
|
26
|
+
* 20px switch), drawn as an invisible square centred on it. The layout does
|
|
27
|
+
* not change; the control just becomes easier to tap. The control needs
|
|
28
|
+
* `relative` (included).
|
|
29
|
+
*/
|
|
30
|
+
export declare const touchTargetClasses = "relative pointer-coarse:before:absolute pointer-coarse:before:top-1/2 pointer-coarse:before:left-1/2 pointer-coarse:before:size-11 pointer-coarse:before:-translate-1/2 pointer-coarse:before:content-['']";
|
|
31
|
+
/**
|
|
32
|
+
* The same for a control that already spans its row (a tab, a menubar
|
|
33
|
+
* trigger): the hit area keeps the control's width and grows to 44px tall.
|
|
34
|
+
*/
|
|
35
|
+
export declare const touchTargetRowClasses = "relative pointer-coarse:before:absolute pointer-coarse:before:inset-x-0 pointer-coarse:before:top-1/2 pointer-coarse:before:h-11 pointer-coarse:before:-translate-y-1/2 pointer-coarse:before:content-['']";
|
package/dist/lib/utils.js
CHANGED
|
@@ -5,7 +5,39 @@ import { twMerge } from "tailwind-merge";
|
|
|
5
5
|
function cn(...inputs) {
|
|
6
6
|
return twMerge(clsx(inputs));
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Keyboard focus for buttons, toggles, tabs, links and every other control
|
|
10
|
+
* that is not a text field: a 2px outline in the ring colour, 2px outside the
|
|
11
|
+
* box, so it follows the control's radius and reads at 3:1 on any surface.
|
|
12
|
+
* (Fields use `fieldFocusClasses`: the border and a 1px inset ring. Menu and
|
|
13
|
+
* list rows use a fill.) The same outline theme.css draws for any `[data-slot]`
|
|
14
|
+
* by default; spelling it out here keeps it when a host page sets
|
|
15
|
+
* `outline: none` on buttons. (`outline-solid` matters: Tailwind's
|
|
16
|
+
* `outline-none` sets the shared outline-style variable to none, and
|
|
17
|
+
* `outline-2` alone would read it back.)
|
|
18
|
+
*/
|
|
19
|
+
var focusRingClasses = "outline-none focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring";
|
|
20
|
+
/**
|
|
21
|
+
* Suppresses the outline outright (a control that draws focus another way, or
|
|
22
|
+
* whose box is not the focus target), with `!important` so a host page's
|
|
23
|
+
* unlayered `:focus-visible { outline }` cannot draw a second box. In forced-
|
|
24
|
+
* colors mode (Windows High Contrast) no ring or border colour survives, so
|
|
25
|
+
* keyboard focus gets a system-colour outline there and nothing at rest.
|
|
26
|
+
*/
|
|
27
|
+
var noOutlineClasses = "outline-none! forced-colors:focus-visible:[outline:2px_solid_Highlight]! forced-colors:focus-visible:outline-offset-2";
|
|
28
|
+
/**
|
|
29
|
+
* A 44px hit area on touch screens for a small control (a 16px checkbox, a
|
|
30
|
+
* 20px switch), drawn as an invisible square centred on it. The layout does
|
|
31
|
+
* not change; the control just becomes easier to tap. The control needs
|
|
32
|
+
* `relative` (included).
|
|
33
|
+
*/
|
|
34
|
+
var touchTargetClasses = "relative pointer-coarse:before:absolute pointer-coarse:before:top-1/2 pointer-coarse:before:left-1/2 pointer-coarse:before:size-11 pointer-coarse:before:-translate-1/2 pointer-coarse:before:content-['']";
|
|
35
|
+
/**
|
|
36
|
+
* The same for a control that already spans its row (a tab, a menubar
|
|
37
|
+
* trigger): the hit area keeps the control's width and grows to 44px tall.
|
|
38
|
+
*/
|
|
39
|
+
var touchTargetRowClasses = "relative pointer-coarse:before:absolute pointer-coarse:before:inset-x-0 pointer-coarse:before:top-1/2 pointer-coarse:before:h-11 pointer-coarse:before:-translate-y-1/2 pointer-coarse:before:content-['']";
|
|
8
40
|
//#endregion
|
|
9
|
-
export { cn };
|
|
41
|
+
export { cn, focusRingClasses, noOutlineClasses, touchTargetClasses, touchTargetRowClasses };
|
|
10
42
|
|
|
11
43
|
//# sourceMappingURL=utils.js.map
|
package/dist/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":[],"sources":["../../src/lib/utils.ts"],"sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\n/** Joins class names and lets later Tailwind utilities override earlier ones. */\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";;;;AAIA,SAAgB,GAAG,GAAG,QAA8B;CAClD,OAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B"}
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../../src/lib/utils.ts"],"sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\n/** Joins class names and lets later Tailwind utilities override earlier ones. */\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n\n/**\n * Keyboard focus for buttons, toggles, tabs, links and every other control\n * that is not a text field: a 2px outline in the ring colour, 2px outside the\n * box, so it follows the control's radius and reads at 3:1 on any surface.\n * (Fields use `fieldFocusClasses`: the border and a 1px inset ring. Menu and\n * list rows use a fill.) The same outline theme.css draws for any `[data-slot]`\n * by default; spelling it out here keeps it when a host page sets\n * `outline: none` on buttons. (`outline-solid` matters: Tailwind's\n * `outline-none` sets the shared outline-style variable to none, and\n * `outline-2` alone would read it back.)\n */\nexport const focusRingClasses =\n 'outline-none focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring';\n\n/**\n * Suppresses the outline outright (a control that draws focus another way, or\n * whose box is not the focus target), with `!important` so a host page's\n * unlayered `:focus-visible { outline }` cannot draw a second box. In forced-\n * colors mode (Windows High Contrast) no ring or border colour survives, so\n * keyboard focus gets a system-colour outline there and nothing at rest.\n */\nexport const noOutlineClasses =\n 'outline-none! forced-colors:focus-visible:[outline:2px_solid_Highlight]! forced-colors:focus-visible:outline-offset-2';\n\n/**\n * A 44px hit area on touch screens for a small control (a 16px checkbox, a\n * 20px switch), drawn as an invisible square centred on it. The layout does\n * not change; the control just becomes easier to tap. The control needs\n * `relative` (included).\n */\nexport const touchTargetClasses =\n \"relative pointer-coarse:before:absolute pointer-coarse:before:top-1/2 pointer-coarse:before:left-1/2 pointer-coarse:before:size-11 pointer-coarse:before:-translate-1/2 pointer-coarse:before:content-['']\";\n\n/**\n * The same for a control that already spans its row (a tab, a menubar\n * trigger): the hit area keeps the control's width and grows to 44px tall.\n */\nexport const touchTargetRowClasses =\n \"relative pointer-coarse:before:absolute pointer-coarse:before:inset-x-0 pointer-coarse:before:top-1/2 pointer-coarse:before:h-11 pointer-coarse:before:-translate-y-1/2 pointer-coarse:before:content-['']\";\n"],"mappings":";;;;AAIA,SAAgB,GAAG,GAAG,QAA8B;CAClD,OAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;;;;;;;;;;AAaA,IAAa,mBACX;;;;;;;;AASF,IAAa,mBACX;;;;;;;AAQF,IAAa,qBACX;;;;;AAMF,IAAa,wBACX"}
|
package/dist/mui/index.js
CHANGED
|
@@ -32,9 +32,11 @@ function shadows() {
|
|
|
32
32
|
shadow.xs,
|
|
33
33
|
shadow.sm,
|
|
34
34
|
shadow.sm,
|
|
35
|
-
shadow.sm
|
|
35
|
+
shadow.sm,
|
|
36
|
+
shadow.md,
|
|
37
|
+
shadow.md
|
|
36
38
|
];
|
|
37
|
-
return Array.from({ length: 25 }, (_, i) => levels[i] ?? shadow.
|
|
39
|
+
return Array.from({ length: 25 }, (_, i) => i === 24 ? shadow.xl : levels[i] ?? shadow.lg);
|
|
38
40
|
}
|
|
39
41
|
/** Theme options only, for apps that deep-merge their own overrides first. */
|
|
40
42
|
function burtsonThemeOptions(modeOrConfig = "dark") {
|
|
@@ -187,13 +189,13 @@ function burtsonThemeOptions(modeOrConfig = "dark") {
|
|
|
187
189
|
MuiDialog: { styleOverrides: { paper: {
|
|
188
190
|
borderRadius: radius.xl,
|
|
189
191
|
border: `1px solid ${p.border}`,
|
|
190
|
-
boxShadow: shadow.
|
|
192
|
+
boxShadow: shadow.xl
|
|
191
193
|
} } },
|
|
192
194
|
MuiMenu: { styleOverrides: {
|
|
193
195
|
paper: {
|
|
194
196
|
borderRadius: radius.lg,
|
|
195
197
|
border: `1px solid ${p["border-strong"]}`,
|
|
196
|
-
boxShadow: shadow.
|
|
198
|
+
boxShadow: shadow.lg
|
|
197
199
|
},
|
|
198
200
|
list: {
|
|
199
201
|
paddingTop: 4,
|
|
@@ -202,7 +204,8 @@ function burtsonThemeOptions(modeOrConfig = "dark") {
|
|
|
202
204
|
} },
|
|
203
205
|
MuiPopover: { styleOverrides: { paper: {
|
|
204
206
|
borderRadius: radius.lg,
|
|
205
|
-
border: `1px solid ${p.border}
|
|
207
|
+
border: `1px solid ${p.border}`,
|
|
208
|
+
boxShadow: shadow.lg
|
|
206
209
|
} } },
|
|
207
210
|
MuiChip: {
|
|
208
211
|
defaultProps: { size: "small" },
|
|
@@ -245,7 +248,8 @@ function burtsonThemeOptions(modeOrConfig = "dark") {
|
|
|
245
248
|
MuiAutocomplete: { styleOverrides: {
|
|
246
249
|
paper: {
|
|
247
250
|
borderRadius: radius.lg,
|
|
248
|
-
border: `1px solid ${p["border-strong"]}
|
|
251
|
+
border: `1px solid ${p["border-strong"]}`,
|
|
252
|
+
boxShadow: shadow.lg
|
|
249
253
|
},
|
|
250
254
|
listbox: {
|
|
251
255
|
padding: 4,
|
|
@@ -270,14 +274,22 @@ function burtsonThemeOptions(modeOrConfig = "dark") {
|
|
|
270
274
|
} } },
|
|
271
275
|
MuiSwitch: { styleOverrides: {
|
|
272
276
|
switchBase: { "&.Mui-checked + .MuiSwitch-track": {
|
|
273
|
-
backgroundColor: p.brand,
|
|
277
|
+
backgroundColor: mode === "dark" ? p.brand : p.primary,
|
|
274
278
|
opacity: 1
|
|
275
279
|
} },
|
|
276
280
|
track: {
|
|
277
|
-
backgroundColor: p
|
|
281
|
+
backgroundColor: p.input,
|
|
278
282
|
opacity: 1
|
|
279
283
|
}
|
|
280
284
|
} },
|
|
285
|
+
MuiCheckbox: { styleOverrides: { root: {
|
|
286
|
+
color: p.input,
|
|
287
|
+
"&.Mui-checked, &.MuiCheckbox-indeterminate": { color: mode === "dark" ? p.brand : p.primary }
|
|
288
|
+
} } },
|
|
289
|
+
MuiRadio: { styleOverrides: { root: {
|
|
290
|
+
color: p.input,
|
|
291
|
+
"&.Mui-checked": { color: mode === "dark" ? p.brand : p.primary }
|
|
292
|
+
} } },
|
|
281
293
|
MuiList: { defaultProps: { dense: compact } },
|
|
282
294
|
MuiTable: { defaultProps: { size: compact ? "small" : "medium" } },
|
|
283
295
|
MuiToolbar: { defaultProps: { variant: compact ? "dense" : "regular" } },
|
package/dist/mui/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/mui/index.ts"],"sourcesContent":["/**\n * The Burtson palette for MUI apps, so a screen built with MUI and one built\n * with Burtson UI components look like the same product.\n *\n * import { ThemeProvider } from '@mui/material/styles';\n * import { createBurtsonTheme } from '@burtson-labs/ui/mui';\n * <ThemeProvider theme={createBurtsonTheme('dark')}>…</ThemeProvider>\n * <ThemeProvider theme={createBurtsonTheme({ mode: 'dark', accent: '#2563eb', density: 'compact' })}>\n *\n * MUI is an adapter here: every colour, radius, shadow and timing comes from\n * the Burtson tokens, and the component overrides give MUI controls the same\n * shape and states as the Burtson components (focus ring, radius per role,\n * no uppercase buttons, quiet borders instead of heavy shadows).\n */\nimport { createTheme, type Shadows, type Theme, type ThemeOptions } from '@mui/material/styles';\n\nimport {\n accentTokens,\n contrast,\n dark,\n duration,\n easing,\n fontMono,\n fontSans,\n light,\n type Palette,\n radius,\n shadow,\n} from '../tokens';\n\nexport type BurtsonMode = 'light' | 'dark';\nexport type BurtsonDensity = 'comfortable' | 'compact';\n\nexport interface BurtsonThemeConfig {\n mode?: BurtsonMode;\n /** Any hex colour; primary, brand, soft and ring tones are derived with contrast kept. */\n accent?: string;\n /** `compact` for admin and data-dense screens: smaller controls, dense lists and tables. */\n density?: BurtsonDensity;\n /** Replace individual palette tokens (a product skin's tinted surfaces). */\n palette?: Partial<Palette>;\n}\n\nconst px = (rem: string) => Math.round(parseFloat(rem) * 16);\n\n/** The full token palette for a config: base mode, accent-derived brand tones, then explicit overrides. */\nexport function burtsonPalette(config: BurtsonThemeConfig = {}): Palette {\n const mode = config.mode ?? 'dark';\n const base = mode === 'dark' ? dark : light;\n return {\n ...base,\n ...(config.accent ? accentTokens(config.accent, mode) : {}),\n ...config.palette,\n };\n}\n\nfunction shadows(): Shadows {\n // MUI indexes elevation 0–24; the Burtson scale has three real levels.\n const levels = ['none', shadow.xs, shadow.xs, shadow.sm, shadow.sm, shadow.sm];\n return Array.from({ length: 25 }, (_, i) => levels[i] ?? shadow.md) as Shadows;\n}\n\n/** Theme options only, for apps that deep-merge their own overrides first. */\nexport function burtsonThemeOptions(\n modeOrConfig: BurtsonMode | BurtsonThemeConfig = 'dark',\n): ThemeOptions {\n const config = typeof modeOrConfig === 'string' ? { mode: modeOrConfig } : modeOrConfig;\n const mode = config.mode ?? 'dark';\n const compact = config.density === 'compact';\n const p = burtsonPalette(config);\n const focusRing = `0 0 0 3px color-mix(in srgb, ${p.ring} 24%, transparent)`;\n return {\n palette: {\n mode,\n primary: { main: p.primary, contrastText: p['primary-foreground'] },\n // Secondary fills use the brand text tone, which is light in dark mode;\n // their text is whichever of white or the page background reads.\n secondary: {\n main: p.brand,\n contrastText: contrast(p.brand, '#ffffff') >= 4.5 ? '#ffffff' : p.background,\n },\n info: { main: p.info, contrastText: p['info-foreground'] },\n error: { main: p.destructive, contrastText: p['destructive-foreground'] },\n warning: { main: p.warning, contrastText: p['warning-foreground'] },\n success: { main: p.success, contrastText: p['success-foreground'] },\n background: { default: p.background, paper: p.surface },\n text: { primary: p.foreground, secondary: p['muted-foreground'] },\n divider: p.border,\n action: { hover: p.muted, selected: p['brand-soft'], focus: p['brand-soft'] },\n },\n shape: { borderRadius: px(radius.md) },\n shadows: shadows(),\n typography: {\n fontFamily: fontSans,\n fontSize: compact ? 13 : 14,\n button: { textTransform: 'none', fontWeight: 600, letterSpacing: '-0.01em' },\n h1: { fontWeight: 700, letterSpacing: '-0.03em' },\n h2: { fontWeight: 700, letterSpacing: '-0.025em' },\n h3: { fontWeight: 650, letterSpacing: '-0.02em' },\n h4: { fontWeight: 650, letterSpacing: '-0.015em' },\n h5: { fontWeight: 600 },\n h6: { fontWeight: 600 },\n overline: { fontWeight: 600, letterSpacing: '0.08em' },\n },\n transitions: {\n duration: {\n shortest: duration.fast,\n shorter: duration.fast,\n short: duration.standard,\n standard: duration.standard,\n complex: duration.emphasis,\n enteringScreen: duration.emphasis,\n leavingScreen: duration.exit,\n },\n easing: {\n easeInOut: easing.standard,\n easeOut: easing.emphasized,\n easeIn: easing.exit,\n sharp: easing.standard,\n },\n },\n components: {\n MuiCssBaseline: {\n styleOverrides: {\n 'code, kbd, pre, samp': { fontFamily: fontMono },\n '@media (prefers-reduced-motion: reduce)': {\n '*, ::before, ::after': {\n animationDuration: '1ms !important',\n transitionDuration: '1ms !important',\n },\n },\n },\n },\n MuiButtonBase: { defaultProps: { disableRipple: true } },\n MuiButton: {\n defaultProps: { disableElevation: true, size: compact ? 'small' : 'medium' },\n styleOverrides: {\n root: {\n borderRadius: radius.md,\n '&:focus-visible': {\n boxShadow: focusRing,\n outline: `2px solid ${p.ring}`,\n outlineOffset: 2,\n },\n },\n outlined: { borderColor: p['border-strong'] },\n },\n },\n MuiIconButton: {\n defaultProps: { size: compact ? 'small' : 'medium' },\n styleOverrides: {\n root: {\n borderRadius: radius.md,\n '&:focus-visible': { outline: `2px solid ${p.ring}`, outlineOffset: 2 },\n },\n },\n },\n MuiPaper: {\n styleOverrides: {\n root: { backgroundImage: 'none' },\n outlined: { borderColor: p.border },\n rounded: { borderRadius: radius.lg },\n },\n },\n MuiCard: {\n defaultProps: { variant: 'outlined' },\n styleOverrides: {\n root: { borderRadius: radius.lg, backgroundColor: p.card, borderColor: p.border },\n },\n },\n MuiDialog: {\n styleOverrides: {\n paper: { borderRadius: radius.xl, border: `1px solid ${p.border}`, boxShadow: shadow.md },\n },\n },\n MuiMenu: {\n styleOverrides: {\n paper: {\n borderRadius: radius.lg,\n border: `1px solid ${p['border-strong']}`,\n boxShadow: shadow.md,\n },\n list: { paddingTop: 4, paddingBottom: 4 },\n },\n },\n MuiPopover: {\n styleOverrides: { paper: { borderRadius: radius.lg, border: `1px solid ${p.border}` } },\n },\n MuiChip: {\n defaultProps: { size: 'small' },\n styleOverrides: { root: { borderRadius: radius.full, fontWeight: 500 } },\n },\n MuiTabs: {\n styleOverrides: { indicator: { backgroundColor: p.brand, height: 2 } },\n },\n MuiTab: {\n styleOverrides: {\n root: {\n textTransform: 'none',\n fontWeight: 500,\n minHeight: compact ? 36 : 44,\n '&.Mui-selected': { color: p.foreground },\n },\n },\n },\n MuiOutlinedInput: {\n styleOverrides: {\n root: {\n borderRadius: radius.md,\n backgroundColor: p.surface,\n '& .MuiOutlinedInput-notchedOutline': { borderColor: p.input },\n '&:hover .MuiOutlinedInput-notchedOutline': { borderColor: p['border-strong'] },\n // Same focus as the Tailwind fields: a 2px ring-coloured edge inside\n // the radius, no outer halo that a scroll container could clip.\n '&.Mui-focused .MuiOutlinedInput-notchedOutline': {\n borderColor: p.ring,\n borderWidth: 2,\n },\n '&.Mui-error .MuiOutlinedInput-notchedOutline': { borderColor: p.destructive },\n },\n },\n },\n // Menu, Select and Autocomplete rows: inset 4px in a 12px surface, 8px\n // radius, a quiet secondary fill for the active row (as MenuItem and\n // SelectItem in the Tailwind kit).\n MuiMenuItem: {\n styleOverrides: {\n root: {\n margin: '0 4px',\n borderRadius: radius.sm,\n '&.Mui-focusVisible, &:hover': { backgroundColor: p.secondary },\n '&.Mui-selected': { backgroundColor: 'transparent', fontWeight: 600 },\n '&.Mui-selected.Mui-focusVisible, &.Mui-selected:hover': {\n backgroundColor: p.secondary,\n },\n },\n },\n },\n MuiAutocomplete: {\n styleOverrides: {\n paper: { borderRadius: radius.lg, border: `1px solid ${p['border-strong']}` },\n listbox: {\n padding: 4,\n '& .MuiAutocomplete-option': {\n borderRadius: radius.sm,\n '&.Mui-focused, &.Mui-focusVisible': { backgroundColor: p.secondary },\n '&[aria-selected=\"true\"]': { backgroundColor: 'transparent', fontWeight: 600 },\n '&[aria-selected=\"true\"].Mui-focused': { backgroundColor: p.secondary },\n },\n },\n },\n },\n MuiTextField: { defaultProps: { size: compact ? 'small' : 'medium' } },\n MuiAlert: { styleOverrides: { root: { borderRadius: radius.md } } },\n MuiTooltip: {\n styleOverrides: {\n tooltip: {\n backgroundColor: p.code,\n color: p['code-foreground'],\n fontSize: 12,\n borderRadius: radius.sm,\n },\n },\n },\n MuiSwitch: {\n styleOverrides: {\n switchBase: {\n '&.Mui-checked + .MuiSwitch-track': { backgroundColor: p.brand, opacity: 1 },\n },\n track: { backgroundColor: p['border-strong'], opacity: 1 },\n },\n },\n MuiList: { defaultProps: { dense: compact } },\n MuiTable: { defaultProps: { size: compact ? 'small' : 'medium' } },\n MuiToolbar: { defaultProps: { variant: compact ? 'dense' : 'regular' } },\n MuiDivider: { styleOverrides: { root: { borderColor: p.border } } },\n },\n };\n}\n\n/**\n * `createBurtsonTheme('dark')` or `createBurtsonTheme({ mode, accent, density })`,\n * then any MUI overrides, merged in order.\n */\nexport function createBurtsonTheme(\n modeOrConfig: BurtsonMode | BurtsonThemeConfig = 'dark',\n ...overrides: ThemeOptions[]\n): Theme {\n return createTheme(burtsonThemeOptions(modeOrConfig), ...overrides);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA2CA,IAAM,MAAM,QAAgB,KAAK,MAAM,WAAW,GAAG,IAAI,EAAE;;AAG3D,SAAgB,eAAe,SAA6B,CAAC,GAAY;CACvE,MAAM,OAAO,OAAO,QAAQ;CAE5B,OAAO;EACL,GAFW,SAAS,SAAS,OAAO;EAGpC,GAAI,OAAO,SAAS,aAAa,OAAO,QAAQ,IAAI,IAAI,CAAC;EACzD,GAAG,OAAO;CACZ;AACF;AAEA,SAAS,UAAmB;CAE1B,MAAM,SAAS;EAAC;EAAQ,OAAO;EAAI,OAAO;EAAI,OAAO;EAAI,OAAO;EAAI,OAAO;CAAE;CAC7E,OAAO,MAAM,KAAK,EAAE,QAAQ,GAAG,IAAI,GAAG,MAAM,OAAO,MAAM,OAAO,EAAE;AACpE;;AAGA,SAAgB,oBACd,eAAiD,QACnC;CACd,MAAM,SAAS,OAAO,iBAAiB,WAAW,EAAE,MAAM,aAAa,IAAI;CAC3E,MAAM,OAAO,OAAO,QAAQ;CAC5B,MAAM,UAAU,OAAO,YAAY;CACnC,MAAM,IAAI,eAAe,MAAM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A,cAAc,EAAE,cAAc,EAAE,MAAM,UAAU,UAAU,SAAS,EAAE;GACrE,UAAU,EAAE,gBAAgB,EAAE,MAAM,EAAE,cAAc,OAAO,GAAG,EAAE,EAAE;GAClE,YAAY,EACV,gBAAgB,EACd,SAAS;IACP,iBAAiB,EAAE;IACnB,OAAO,EAAE;IACT,UAAU;IACV,cAAc,OAAO;GACvB,EACF,EACF;GACA,WAAW,EACT,gBAAgB;IACd,YAAY,EACV,oCAAoC;KAAE,iBAAiB,EAAE;KAAO,SAAS;IAAE,EAC7E;IACA,OAAO;KAAE,iBAAiB,EAAE;KAAkB,SAAS;IAAE;GAC3D,EACF;GACA,SAAS,EAAE,cAAc,EAAE,OAAO,QAAQ,EAAE;GAC5C,UAAU,EAAE,cAAc,EAAE,MAAM,UAAU,UAAU,SAAS,EAAE;GACjE,YAAY,EAAE,cAAc,EAAE,SAAS,UAAU,UAAU,UAAU,EAAE;GACvE,YAAY,EAAE,gBAAgB,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,EAAE;EACpE;CACF;AACF;;;;;AAMA,SAAgB,mBACd,eAAiD,QACjD,GAAG,WACI;CACP,OAAO,YAAY,oBAAoB,YAAY,GAAG,GAAG,SAAS;AACpE"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/mui/index.ts"],"sourcesContent":["/**\n * The Burtson palette for MUI apps, so a screen built with MUI and one built\n * with Burtson UI components look like the same product.\n *\n * import { ThemeProvider } from '@mui/material/styles';\n * import { createBurtsonTheme } from '@burtson-labs/ui/mui';\n * <ThemeProvider theme={createBurtsonTheme('dark')}>…</ThemeProvider>\n * <ThemeProvider theme={createBurtsonTheme({ mode: 'dark', accent: '#2563eb', density: 'compact' })}>\n *\n * MUI is an adapter here: every colour, radius, shadow and timing comes from\n * the Burtson tokens, and the component overrides give MUI controls the same\n * shape and states as the Burtson components (focus ring, radius per role,\n * no uppercase buttons, quiet borders instead of heavy shadows).\n */\nimport { createTheme, type Shadows, type Theme, type ThemeOptions } from '@mui/material/styles';\n\nimport {\n accentTokens,\n contrast,\n dark,\n duration,\n easing,\n fontMono,\n fontSans,\n light,\n type Palette,\n radius,\n shadow,\n} from '../tokens';\n\nexport type BurtsonMode = 'light' | 'dark';\nexport type BurtsonDensity = 'comfortable' | 'compact';\n\nexport interface BurtsonThemeConfig {\n mode?: BurtsonMode;\n /** Any hex colour; primary, brand, soft and ring tones are derived with contrast kept. */\n accent?: string;\n /** `compact` for admin and data-dense screens: smaller controls, dense lists and tables. */\n density?: BurtsonDensity;\n /** Replace individual palette tokens (a product skin's tinted surfaces). */\n palette?: Partial<Palette>;\n}\n\nconst px = (rem: string) => Math.round(parseFloat(rem) * 16);\n\n/** The full token palette for a config: base mode, accent-derived brand tones, then explicit overrides. */\nexport function burtsonPalette(config: BurtsonThemeConfig = {}): Palette {\n const mode = config.mode ?? 'dark';\n const base = mode === 'dark' ? dark : light;\n return {\n ...base,\n ...(config.accent ? accentTokens(config.accent, mode) : {}),\n ...config.palette,\n };\n}\n\nfunction shadows(): Shadows {\n // MUI indexes elevation 0–24; the Burtson scale has five real levels:\n // resting, card, raised, floating (8+: menus, popovers) and modal (24).\n const levels = [\n 'none',\n shadow.xs,\n shadow.xs,\n shadow.sm,\n shadow.sm,\n shadow.sm,\n shadow.md,\n shadow.md,\n ];\n return Array.from({ length: 25 }, (_, i) =>\n i === 24 ? shadow.xl : (levels[i] ?? shadow.lg),\n ) as Shadows;\n}\n\n/** Theme options only, for apps that deep-merge their own overrides first. */\nexport function burtsonThemeOptions(\n modeOrConfig: BurtsonMode | BurtsonThemeConfig = 'dark',\n): ThemeOptions {\n const config = typeof modeOrConfig === 'string' ? { mode: modeOrConfig } : modeOrConfig;\n const mode = config.mode ?? 'dark';\n const compact = config.density === 'compact';\n const p = burtsonPalette(config);\n const focusRing = `0 0 0 3px color-mix(in srgb, ${p.ring} 24%, transparent)`;\n return {\n palette: {\n mode,\n primary: { main: p.primary, contrastText: p['primary-foreground'] },\n // Secondary fills use the brand text tone, which is light in dark mode;\n // their text is whichever of white or the page background reads.\n secondary: {\n main: p.brand,\n contrastText: contrast(p.brand, '#ffffff') >= 4.5 ? '#ffffff' : p.background,\n },\n info: { main: p.info, contrastText: p['info-foreground'] },\n error: { main: p.destructive, contrastText: p['destructive-foreground'] },\n warning: { main: p.warning, contrastText: p['warning-foreground'] },\n success: { main: p.success, contrastText: p['success-foreground'] },\n background: { default: p.background, paper: p.surface },\n text: { primary: p.foreground, secondary: p['muted-foreground'] },\n divider: p.border,\n action: { hover: p.muted, selected: p['brand-soft'], focus: p['brand-soft'] },\n },\n shape: { borderRadius: px(radius.md) },\n shadows: shadows(),\n typography: {\n fontFamily: fontSans,\n fontSize: compact ? 13 : 14,\n button: { textTransform: 'none', fontWeight: 600, letterSpacing: '-0.01em' },\n h1: { fontWeight: 700, letterSpacing: '-0.03em' },\n h2: { fontWeight: 700, letterSpacing: '-0.025em' },\n h3: { fontWeight: 650, letterSpacing: '-0.02em' },\n h4: { fontWeight: 650, letterSpacing: '-0.015em' },\n h5: { fontWeight: 600 },\n h6: { fontWeight: 600 },\n overline: { fontWeight: 600, letterSpacing: '0.08em' },\n },\n transitions: {\n duration: {\n shortest: duration.fast,\n shorter: duration.fast,\n short: duration.standard,\n standard: duration.standard,\n complex: duration.emphasis,\n enteringScreen: duration.emphasis,\n leavingScreen: duration.exit,\n },\n easing: {\n easeInOut: easing.standard,\n easeOut: easing.emphasized,\n easeIn: easing.exit,\n sharp: easing.standard,\n },\n },\n components: {\n MuiCssBaseline: {\n styleOverrides: {\n 'code, kbd, pre, samp': { fontFamily: fontMono },\n '@media (prefers-reduced-motion: reduce)': {\n '*, ::before, ::after': {\n animationDuration: '1ms !important',\n transitionDuration: '1ms !important',\n },\n },\n },\n },\n MuiButtonBase: { defaultProps: { disableRipple: true } },\n MuiButton: {\n defaultProps: { disableElevation: true, size: compact ? 'small' : 'medium' },\n styleOverrides: {\n root: {\n borderRadius: radius.md,\n '&:focus-visible': {\n boxShadow: focusRing,\n outline: `2px solid ${p.ring}`,\n outlineOffset: 2,\n },\n },\n outlined: { borderColor: p['border-strong'] },\n },\n },\n MuiIconButton: {\n defaultProps: { size: compact ? 'small' : 'medium' },\n styleOverrides: {\n root: {\n borderRadius: radius.md,\n '&:focus-visible': { outline: `2px solid ${p.ring}`, outlineOffset: 2 },\n },\n },\n },\n MuiPaper: {\n styleOverrides: {\n root: { backgroundImage: 'none' },\n outlined: { borderColor: p.border },\n rounded: { borderRadius: radius.lg },\n },\n },\n MuiCard: {\n defaultProps: { variant: 'outlined' },\n styleOverrides: {\n root: { borderRadius: radius.lg, backgroundColor: p.card, borderColor: p.border },\n },\n },\n MuiDialog: {\n styleOverrides: {\n paper: { borderRadius: radius.xl, border: `1px solid ${p.border}`, boxShadow: shadow.xl },\n },\n },\n MuiMenu: {\n styleOverrides: {\n paper: {\n borderRadius: radius.lg,\n border: `1px solid ${p['border-strong']}`,\n boxShadow: shadow.lg,\n },\n list: { paddingTop: 4, paddingBottom: 4 },\n },\n },\n MuiPopover: {\n styleOverrides: {\n paper: { borderRadius: radius.lg, border: `1px solid ${p.border}`, boxShadow: shadow.lg },\n },\n },\n MuiChip: {\n defaultProps: { size: 'small' },\n styleOverrides: { root: { borderRadius: radius.full, fontWeight: 500 } },\n },\n MuiTabs: {\n styleOverrides: { indicator: { backgroundColor: p.brand, height: 2 } },\n },\n MuiTab: {\n styleOverrides: {\n root: {\n textTransform: 'none',\n fontWeight: 500,\n minHeight: compact ? 36 : 44,\n '&.Mui-selected': { color: p.foreground },\n },\n },\n },\n MuiOutlinedInput: {\n styleOverrides: {\n root: {\n borderRadius: radius.md,\n backgroundColor: p.surface,\n '& .MuiOutlinedInput-notchedOutline': { borderColor: p.input },\n '&:hover .MuiOutlinedInput-notchedOutline': { borderColor: p['border-strong'] },\n // Same focus as the Tailwind fields: a 2px ring-coloured edge inside\n // the radius, no outer halo that a scroll container could clip.\n '&.Mui-focused .MuiOutlinedInput-notchedOutline': {\n borderColor: p.ring,\n borderWidth: 2,\n },\n '&.Mui-error .MuiOutlinedInput-notchedOutline': { borderColor: p.destructive },\n },\n },\n },\n // Menu, Select and Autocomplete rows: inset 4px in a 12px surface, 8px\n // radius, a quiet secondary fill for the active row (as MenuItem and\n // SelectItem in the Tailwind kit).\n MuiMenuItem: {\n styleOverrides: {\n root: {\n margin: '0 4px',\n borderRadius: radius.sm,\n '&.Mui-focusVisible, &:hover': { backgroundColor: p.secondary },\n '&.Mui-selected': { backgroundColor: 'transparent', fontWeight: 600 },\n '&.Mui-selected.Mui-focusVisible, &.Mui-selected:hover': {\n backgroundColor: p.secondary,\n },\n },\n },\n },\n MuiAutocomplete: {\n styleOverrides: {\n paper: {\n borderRadius: radius.lg,\n border: `1px solid ${p['border-strong']}`,\n boxShadow: shadow.lg,\n },\n listbox: {\n padding: 4,\n '& .MuiAutocomplete-option': {\n borderRadius: radius.sm,\n '&.Mui-focused, &.Mui-focusVisible': { backgroundColor: p.secondary },\n '&[aria-selected=\"true\"]': { backgroundColor: 'transparent', fontWeight: 600 },\n '&[aria-selected=\"true\"].Mui-focused': { backgroundColor: p.secondary },\n },\n },\n },\n },\n MuiTextField: { defaultProps: { size: compact ? 'small' : 'medium' } },\n MuiAlert: { styleOverrides: { root: { borderRadius: radius.md } } },\n MuiTooltip: {\n styleOverrides: {\n tooltip: {\n backgroundColor: p.code,\n color: p['code-foreground'],\n fontSize: 12,\n borderRadius: radius.sm,\n },\n },\n },\n MuiSwitch: {\n styleOverrides: {\n switchBase: {\n '&.Mui-checked + .MuiSwitch-track': {\n backgroundColor: mode === 'dark' ? p.brand : p.primary,\n opacity: 1,\n },\n },\n // The off track is the field border tone: 3:1 on the page.\n track: { backgroundColor: p.input, opacity: 1 },\n },\n },\n MuiCheckbox: {\n styleOverrides: {\n root: {\n color: p.input,\n '&.Mui-checked, &.MuiCheckbox-indeterminate': {\n color: mode === 'dark' ? p.brand : p.primary,\n },\n },\n },\n },\n MuiRadio: {\n styleOverrides: {\n root: {\n color: p.input,\n '&.Mui-checked': { color: mode === 'dark' ? p.brand : p.primary },\n },\n },\n },\n MuiList: { defaultProps: { dense: compact } },\n MuiTable: { defaultProps: { size: compact ? 'small' : 'medium' } },\n MuiToolbar: { defaultProps: { variant: compact ? 'dense' : 'regular' } },\n MuiDivider: { styleOverrides: { root: { borderColor: p.border } } },\n },\n };\n}\n\n/**\n * `createBurtsonTheme('dark')` or `createBurtsonTheme({ mode, accent, density })`,\n * then any MUI overrides, merged in order.\n */\nexport function createBurtsonTheme(\n modeOrConfig: BurtsonMode | BurtsonThemeConfig = 'dark',\n ...overrides: ThemeOptions[]\n): Theme {\n return createTheme(burtsonThemeOptions(modeOrConfig), ...overrides);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA2CA,IAAM,MAAM,QAAgB,KAAK,MAAM,WAAW,GAAG,IAAI,EAAE;;AAG3D,SAAgB,eAAe,SAA6B,CAAC,GAAY;CACvE,MAAM,OAAO,OAAO,QAAQ;CAE5B,OAAO;EACL,GAFW,SAAS,SAAS,OAAO;EAGpC,GAAI,OAAO,SAAS,aAAa,OAAO,QAAQ,IAAI,IAAI,CAAC;EACzD,GAAG,OAAO;CACZ;AACF;AAEA,SAAS,UAAmB;CAG1B,MAAM,SAAS;EACb;EACA,OAAO;EACP,OAAO;EACP,OAAO;EACP,OAAO;EACP,OAAO;EACP,OAAO;EACP,OAAO;CACT;CACA,OAAO,MAAM,KAAK,EAAE,QAAQ,GAAG,IAAI,GAAG,MACpC,MAAM,KAAK,OAAO,KAAM,OAAO,MAAM,OAAO,EAC9C;AACF;;AAGA,SAAgB,oBACd,eAAiD,QACnC;CACd,MAAM,SAAS,OAAO,iBAAiB,WAAW,EAAE,MAAM,aAAa,IAAI;CAC3E,MAAM,OAAO,OAAO,QAAQ;CAC5B,MAAM,UAAU,OAAO,YAAY;CACnC,MAAM,IAAI,eAAe,MAAM;CAC/B,MAAM,YAAY,gCAAgC,EAAE,KAAK;CACzD,OAAO;EACL,SAAS;GACP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,UAAU,SAAS,EAAE;GACrE,UAAU,EAAE,gBAAgB,EAAE,MAAM,EAAE,cAAc,OAAO,GAAG,EAAE,EAAE;GAClE,YAAY,EACV,gBAAgB,EACd,SAAS;IACP,iBAAiB,EAAE;IACnB,OAAO,EAAE;IACT,UAAU;IACV,cAAc,OAAO;GACvB,EACF,EACF;GACA,WAAW,EACT,gBAAgB;IACd,YAAY,EACV,oCAAoC;KAClC,iBAAiB,SAAS,SAAS,EAAE,QAAQ,EAAE;KAC/C,SAAS;IACX,EACF;IAEA,OAAO;KAAE,iBAAiB,EAAE;KAAO,SAAS;IAAE;GAChD,EACF;GACA,aAAa,EACX,gBAAgB,EACd,MAAM;IACJ,OAAO,EAAE;IACT,8CAA8C,EAC5C,OAAO,SAAS,SAAS,EAAE,QAAQ,EAAE,QACvC;GACF,EACF,EACF;GACA,UAAU,EACR,gBAAgB,EACd,MAAM;IACJ,OAAO,EAAE;IACT,iBAAiB,EAAE,OAAO,SAAS,SAAS,EAAE,QAAQ,EAAE,QAAQ;GAClE,EACF,EACF;GACA,SAAS,EAAE,cAAc,EAAE,OAAO,QAAQ,EAAE;GAC5C,UAAU,EAAE,cAAc,EAAE,MAAM,UAAU,UAAU,SAAS,EAAE;GACjE,YAAY,EAAE,cAAc,EAAE,SAAS,UAAU,UAAU,UAAU,EAAE;GACvE,YAAY,EAAE,gBAAgB,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,EAAE;EACpE;CACF;AACF;;;;;AAMA,SAAgB,mBACd,eAAiD,QACjD,GAAG,WACI;CACP,OAAO,YAAY,oBAAoB,YAAY,GAAG,GAAG,SAAS;AACpE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function commandScore(string: string, abbreviation: string, aliases?: string[]): number;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/primitives/vendor/cmdk/command-score.ts
|
|
3
|
+
var SCORE_CONTINUE_MATCH = 1;
|
|
4
|
+
var SCORE_SPACE_WORD_JUMP = .9;
|
|
5
|
+
var SCORE_NON_SPACE_WORD_JUMP = .8;
|
|
6
|
+
var SCORE_CHARACTER_JUMP = .17;
|
|
7
|
+
var SCORE_TRANSPOSITION = .1;
|
|
8
|
+
var PENALTY_SKIPPED = .999;
|
|
9
|
+
var PENALTY_CASE_MISMATCH = .9999;
|
|
10
|
+
var PENALTY_NOT_COMPLETE = .99;
|
|
11
|
+
var IS_GAP_REGEXP = /[\\\/_+.#"@\[\(\{&]/;
|
|
12
|
+
var COUNT_GAPS_REGEXP = /[\\\/_+.#"@\[\(\{&]/g;
|
|
13
|
+
var IS_SPACE_REGEXP = /[\s-]/;
|
|
14
|
+
var COUNT_SPACE_REGEXP = /[\s-]/g;
|
|
15
|
+
function commandScoreInner(string, abbreviation, lowerString, lowerAbbreviation, stringIndex, abbreviationIndex, memoizedResults) {
|
|
16
|
+
if (abbreviationIndex === abbreviation.length) {
|
|
17
|
+
if (stringIndex === string.length) return SCORE_CONTINUE_MATCH;
|
|
18
|
+
return PENALTY_NOT_COMPLETE;
|
|
19
|
+
}
|
|
20
|
+
var memoizeKey = `${stringIndex},${abbreviationIndex}`;
|
|
21
|
+
if (memoizedResults[memoizeKey] !== void 0) return memoizedResults[memoizeKey];
|
|
22
|
+
var abbreviationChar = lowerAbbreviation.charAt(abbreviationIndex);
|
|
23
|
+
var index = lowerString.indexOf(abbreviationChar, stringIndex);
|
|
24
|
+
var highScore = 0;
|
|
25
|
+
var score, transposedScore, wordBreaks, spaceBreaks;
|
|
26
|
+
while (index >= 0) {
|
|
27
|
+
score = commandScoreInner(string, abbreviation, lowerString, lowerAbbreviation, index + 1, abbreviationIndex + 1, memoizedResults);
|
|
28
|
+
if (score > highScore) {
|
|
29
|
+
if (index === stringIndex) score *= SCORE_CONTINUE_MATCH;
|
|
30
|
+
else if (IS_GAP_REGEXP.test(string.charAt(index - 1))) {
|
|
31
|
+
score *= SCORE_NON_SPACE_WORD_JUMP;
|
|
32
|
+
wordBreaks = string.slice(stringIndex, index - 1).match(COUNT_GAPS_REGEXP);
|
|
33
|
+
if (wordBreaks && stringIndex > 0) score *= Math.pow(PENALTY_SKIPPED, wordBreaks.length);
|
|
34
|
+
} else if (IS_SPACE_REGEXP.test(string.charAt(index - 1))) {
|
|
35
|
+
score *= SCORE_SPACE_WORD_JUMP;
|
|
36
|
+
spaceBreaks = string.slice(stringIndex, index - 1).match(COUNT_SPACE_REGEXP);
|
|
37
|
+
if (spaceBreaks && stringIndex > 0) score *= Math.pow(PENALTY_SKIPPED, spaceBreaks.length);
|
|
38
|
+
} else {
|
|
39
|
+
score *= SCORE_CHARACTER_JUMP;
|
|
40
|
+
if (stringIndex > 0) score *= Math.pow(PENALTY_SKIPPED, index - stringIndex);
|
|
41
|
+
}
|
|
42
|
+
if (string.charAt(index) !== abbreviation.charAt(abbreviationIndex)) score *= PENALTY_CASE_MISMATCH;
|
|
43
|
+
}
|
|
44
|
+
if (score < SCORE_TRANSPOSITION && lowerString.charAt(index - 1) === lowerAbbreviation.charAt(abbreviationIndex + 1) || lowerAbbreviation.charAt(abbreviationIndex + 1) === lowerAbbreviation.charAt(abbreviationIndex) && lowerString.charAt(index - 1) !== lowerAbbreviation.charAt(abbreviationIndex)) {
|
|
45
|
+
transposedScore = commandScoreInner(string, abbreviation, lowerString, lowerAbbreviation, index + 1, abbreviationIndex + 2, memoizedResults);
|
|
46
|
+
if (transposedScore * SCORE_TRANSPOSITION > score) score = transposedScore * SCORE_TRANSPOSITION;
|
|
47
|
+
}
|
|
48
|
+
if (score > highScore) highScore = score;
|
|
49
|
+
index = lowerString.indexOf(abbreviationChar, index + 1);
|
|
50
|
+
}
|
|
51
|
+
memoizedResults[memoizeKey] = highScore;
|
|
52
|
+
return highScore;
|
|
53
|
+
}
|
|
54
|
+
function formatInput(string) {
|
|
55
|
+
return string.toLowerCase().replace(COUNT_SPACE_REGEXP, " ");
|
|
56
|
+
}
|
|
57
|
+
function commandScore(string, abbreviation, aliases) {
|
|
58
|
+
string = aliases && aliases.length > 0 ? `${string + " " + aliases.join(" ")}` : string;
|
|
59
|
+
return commandScoreInner(string, abbreviation, formatInput(string), formatInput(abbreviation), 0, 0, {});
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
export { commandScore };
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=command-score.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-score.js","names":[],"sources":["../../../../src/primitives/vendor/cmdk/command-score.ts"],"sourcesContent":["// Vendored from cmdk (c) 2022 Paco Coursey, MIT. See vendor/LICENSE.cmdk.\n// Local modification: Radix imports resolve to the pinned local source.\n// The scores are arranged so that a continuous match of characters will\n// result in a total score of 1.\n//\n// The best case, this character is a match, and either this is the start\n// of the string, or the previous character was also a match.\nvar SCORE_CONTINUE_MATCH = 1,\n // A new match at the start of a word scores better than a new match\n // elsewhere as it's more likely that the user will type the starts\n // of fragments.\n // NOTE: We score word jumps between spaces slightly higher than slashes, brackets\n // hyphens, etc.\n SCORE_SPACE_WORD_JUMP = 0.9,\n SCORE_NON_SPACE_WORD_JUMP = 0.8,\n // Any other match isn't ideal, but we include it for completeness.\n SCORE_CHARACTER_JUMP = 0.17,\n // If the user transposed two letters, it should be significantly penalized.\n //\n // i.e. \"ouch\" is more likely than \"curtain\" when \"uc\" is typed.\n SCORE_TRANSPOSITION = 0.1,\n // The goodness of a match should decay slightly with each missing\n // character.\n //\n // i.e. \"bad\" is more likely than \"bard\" when \"bd\" is typed.\n //\n // This will not change the order of suggestions based on SCORE_* until\n // 100 characters are inserted between matches.\n PENALTY_SKIPPED = 0.999,\n // The goodness of an exact-case match should be higher than a\n // case-insensitive match by a small amount.\n //\n // i.e. \"HTML\" is more likely than \"haml\" when \"HM\" is typed.\n //\n // This will not change the order of suggestions based on SCORE_* until\n // 1000 characters are inserted between matches.\n PENALTY_CASE_MISMATCH = 0.9999,\n // Match higher for letters closer to the beginning of the word\n // Unused upstream constant omitted for noUnusedLocals.\n\n // If the word has more characters than the user typed, it should\n // be penalised slightly.\n //\n // i.e. \"html\" is more likely than \"html5\" if I type \"html\".\n //\n // However, it may well be the case that there's a sensible secondary\n // ordering (like alphabetical) that it makes sense to rely on when\n // there are many prefix matches, so we don't make the penalty increase\n // with the number of tokens.\n PENALTY_NOT_COMPLETE = 0.99\n\nvar IS_GAP_REGEXP = /[\\\\\\/_+.#\"@\\[\\(\\{&]/,\n COUNT_GAPS_REGEXP = /[\\\\\\/_+.#\"@\\[\\(\\{&]/g,\n IS_SPACE_REGEXP = /[\\s-]/,\n COUNT_SPACE_REGEXP = /[\\s-]/g\n\nfunction commandScoreInner(\n string: string,\n abbreviation: string,\n lowerString: string,\n lowerAbbreviation: string,\n stringIndex: number,\n abbreviationIndex: number,\n memoizedResults: Record<string, number>,\n): number {\n if (abbreviationIndex === abbreviation.length) {\n if (stringIndex === string.length) {\n return SCORE_CONTINUE_MATCH\n }\n return PENALTY_NOT_COMPLETE\n }\n\n var memoizeKey = `${stringIndex},${abbreviationIndex}`\n if (memoizedResults[memoizeKey] !== undefined) {\n return memoizedResults[memoizeKey]!\n }\n\n var abbreviationChar = lowerAbbreviation.charAt(abbreviationIndex)\n var index = lowerString.indexOf(abbreviationChar, stringIndex)\n var highScore = 0\n\n var score, transposedScore, wordBreaks, spaceBreaks\n\n while (index >= 0) {\n score = commandScoreInner(\n string,\n abbreviation,\n lowerString,\n lowerAbbreviation,\n index + 1,\n abbreviationIndex + 1,\n memoizedResults,\n )\n if (score > highScore) {\n if (index === stringIndex) {\n score *= SCORE_CONTINUE_MATCH\n } else if (IS_GAP_REGEXP.test(string.charAt(index - 1))) {\n score *= SCORE_NON_SPACE_WORD_JUMP\n wordBreaks = string.slice(stringIndex, index - 1).match(COUNT_GAPS_REGEXP)\n if (wordBreaks && stringIndex > 0) {\n score *= Math.pow(PENALTY_SKIPPED, wordBreaks.length)\n }\n } else if (IS_SPACE_REGEXP.test(string.charAt(index - 1))) {\n score *= SCORE_SPACE_WORD_JUMP\n spaceBreaks = string.slice(stringIndex, index - 1).match(COUNT_SPACE_REGEXP)\n if (spaceBreaks && stringIndex > 0) {\n score *= Math.pow(PENALTY_SKIPPED, spaceBreaks.length)\n }\n } else {\n score *= SCORE_CHARACTER_JUMP\n if (stringIndex > 0) {\n score *= Math.pow(PENALTY_SKIPPED, index - stringIndex)\n }\n }\n\n if (string.charAt(index) !== abbreviation.charAt(abbreviationIndex)) {\n score *= PENALTY_CASE_MISMATCH\n }\n }\n\n if (\n (score < SCORE_TRANSPOSITION &&\n lowerString.charAt(index - 1) === lowerAbbreviation.charAt(abbreviationIndex + 1)) ||\n (lowerAbbreviation.charAt(abbreviationIndex + 1) === lowerAbbreviation.charAt(abbreviationIndex) && // allow duplicate letters. Ref #7428\n lowerString.charAt(index - 1) !== lowerAbbreviation.charAt(abbreviationIndex))\n ) {\n transposedScore = commandScoreInner(\n string,\n abbreviation,\n lowerString,\n lowerAbbreviation,\n index + 1,\n abbreviationIndex + 2,\n memoizedResults,\n )\n\n if (transposedScore * SCORE_TRANSPOSITION > score) {\n score = transposedScore * SCORE_TRANSPOSITION\n }\n }\n\n if (score > highScore) {\n highScore = score\n }\n\n index = lowerString.indexOf(abbreviationChar, index + 1)\n }\n\n memoizedResults[memoizeKey] = highScore\n return highScore\n}\n\nfunction formatInput(string: string) {\n // convert all valid space characters to space so they match each other\n return string.toLowerCase().replace(COUNT_SPACE_REGEXP, ' ')\n}\n\nexport function commandScore(string: string, abbreviation: string, aliases?: string[]): number {\n /* NOTE:\n * in the original, we used to do the lower-casing on each recursive call, but this meant that toLowerCase()\n * was the dominating cost in the algorithm, passing both is a little ugly, but considerably faster.\n */\n string = aliases && aliases.length > 0 ? `${string + ' ' + aliases.join(' ')}` : string\n return commandScoreInner(string, abbreviation, formatInput(string), formatInput(abbreviation), 0, 0, {})\n}\n"],"mappings":";;AAOA,IAAI,uBAAuB;AAMzB,IAAA,wBAAwB;AACxB,IAAA,4BAA4B;AAE5B,IAAA,u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