@brett_lamy/ui 2.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -5
- package/dist/components/adaptive-pane.d.ts.map +1 -1
- package/dist/components/adaptive-pane.js +30 -0
- package/dist/components/animated-height.d.ts.map +1 -1
- package/dist/components/animated-height.js +82 -0
- package/dist/{templates → components}/artifact-chat-container.d.ts +12 -5
- package/dist/components/artifact-chat-container.d.ts.map +1 -0
- package/dist/components/artifact-chat-container.js +200 -0
- package/dist/components/avatar.js +26 -0
- package/dist/components/badge.js +24 -0
- package/dist/components/button.d.ts.map +1 -1
- package/dist/components/button.js +46 -0
- package/dist/components/card.js +56 -0
- package/dist/components/celebrate.d.ts.map +1 -1
- package/dist/components/celebrate.js +142 -0
- package/dist/components/chat-column.d.ts.map +1 -0
- package/dist/components/chat-column.js +26 -0
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox.js +55 -0
- package/dist/components/combobox.d.ts +1 -1
- package/dist/components/combobox.d.ts.map +1 -1
- package/dist/components/combobox.js +65 -0
- package/dist/components/command-menu.d.ts.map +1 -1
- package/dist/components/command-menu.js +906 -0
- package/dist/components/composer/annotator.d.ts.map +1 -0
- package/dist/components/composer/annotator.js +17 -0
- package/dist/components/composer/composer-files.d.ts.map +1 -0
- package/dist/components/composer/composer-files.js +91 -0
- package/dist/components/{workbench/wb-popover.d.ts → composer/composer-popover.d.ts} +1 -1
- package/dist/components/composer/composer-popover.d.ts.map +1 -0
- package/dist/components/composer/composer-popover.js +29 -0
- package/dist/components/{workbench → composer}/composer.d.ts +3 -3
- package/dist/components/composer/composer.d.ts.map +1 -0
- package/dist/components/composer/composer.js +1633 -0
- package/dist/components/{workbench/chat.d.ts → conversation.d.ts} +2 -2
- package/dist/components/conversation.d.ts.map +1 -0
- package/dist/components/conversation.js +357 -0
- package/dist/components/credenza.d.ts.map +1 -1
- package/dist/components/credenza.js +294 -0
- package/dist/components/dialog.d.ts +2 -2
- package/dist/components/dialog.d.ts.map +1 -1
- package/dist/components/dialog.js +125 -0
- package/dist/components/disclosure.d.ts.map +1 -1
- package/dist/components/disclosure.js +59 -0
- package/dist/components/dropdown-menu.d.ts +1 -1
- package/dist/components/dropdown-menu.d.ts.map +1 -1
- package/dist/components/dropdown-menu.js +114 -0
- package/dist/components/edge-drawer.js +73 -0
- package/dist/components/edit-bar.d.ts.map +1 -1
- package/dist/components/edit-bar.js +33 -0
- package/dist/components/{chat/floating-chat.d.ts → floating-chat.d.ts} +8 -4
- package/dist/components/floating-chat.d.ts.map +1 -0
- package/dist/components/floating-chat.js +288 -0
- package/dist/components/{chat/floating-sheet.d.ts → floating-sheet.d.ts} +5 -5
- package/dist/components/floating-sheet.d.ts.map +1 -0
- package/dist/components/floating-sheet.js +252 -0
- package/dist/components/form.d.ts.map +1 -1
- package/dist/components/form.js +32 -0
- package/dist/{lib/workbench/icons.d.ts → components/icon-button.d.ts} +5 -5
- package/dist/components/icon-button.d.ts.map +1 -0
- package/dist/components/icon-button.js +31 -0
- package/dist/components/icon-swap.d.ts.map +1 -1
- package/dist/components/icon-swap.js +80 -0
- package/dist/components/index-bar.d.ts +14 -1
- package/dist/components/index-bar.d.ts.map +1 -1
- package/dist/components/index-bar.js +249 -0
- package/dist/components/input.d.ts.map +1 -1
- package/dist/components/input.js +30 -0
- package/dist/components/kbd.d.ts.map +1 -1
- package/dist/components/kbd.js +21 -0
- package/dist/components/label.d.ts.map +1 -1
- package/dist/components/label.js +22 -0
- package/dist/components/list-box.d.ts +1 -3
- package/dist/components/list-box.d.ts.map +1 -1
- package/dist/components/list-box.js +104 -0
- package/dist/components/list.d.ts.map +1 -1
- package/dist/components/list.js +491 -0
- package/dist/components/markdown-editor.d.ts.map +1 -1
- package/dist/components/markdown-editor.js +322 -0
- package/dist/components/{workbench/markdown.d.ts → markdown-view.d.ts} +1 -1
- package/dist/components/markdown-view.d.ts.map +1 -0
- package/dist/components/markdown-view.js +129 -0
- package/dist/components/measure-h.d.ts.map +1 -1
- package/dist/components/measure-h.js +20 -0
- package/dist/components/message-scroller.d.ts.map +1 -0
- package/dist/components/message-scroller.js +247 -0
- package/dist/components/morph.d.ts.map +1 -1
- package/dist/components/morph.js +89 -0
- package/dist/components/navigation-stack.d.ts +14 -0
- package/dist/components/navigation-stack.d.ts.map +1 -1
- package/dist/components/navigation-stack.js +506 -0
- package/dist/components/now-playing-bars.js +38 -0
- package/dist/components/number-morph.d.ts.map +1 -1
- package/dist/components/number-morph.js +123 -0
- package/dist/components/pencilkit/constants.d.ts.map +1 -0
- package/dist/components/pencilkit/constants.js +63 -0
- package/dist/components/pencilkit/pencil-canvas.d.ts +1 -1
- package/dist/components/pencilkit/pencil-canvas.d.ts.map +1 -1
- package/dist/components/pencilkit/pencil-canvas.js +105 -0
- package/dist/components/pencilkit/pencil-toolbar.d.ts +2 -2
- package/dist/components/pencilkit/pencil-toolbar.d.ts.map +1 -1
- package/dist/components/pencilkit/pencil-toolbar.js +186 -0
- package/dist/components/pencilkit/pencilkit-annotator.d.ts +1 -1
- package/dist/components/pencilkit/pencilkit-annotator.d.ts.map +1 -1
- package/dist/components/pencilkit/pencilkit-annotator.js +44 -0
- package/dist/components/pencilkit/stroke-path.d.ts +1 -1
- package/dist/components/pencilkit/stroke-path.d.ts.map +1 -1
- package/dist/components/pencilkit/stroke-path.js +44 -0
- package/dist/components/pencilkit/use-pencil-history.d.ts +2 -2
- package/dist/components/pencilkit/use-pencil-history.d.ts.map +1 -1
- package/dist/components/pencilkit/use-pencil-history.js +25 -0
- package/dist/components/plain-button.d.ts +10 -0
- package/dist/components/plain-button.d.ts.map +1 -0
- package/dist/components/plain-button.js +23 -0
- package/dist/components/popover.d.ts +1 -1
- package/dist/components/popover.d.ts.map +1 -1
- package/dist/components/popover.js +36 -0
- package/dist/components/progress-ring.d.ts.map +1 -1
- package/dist/components/progress-ring.js +195 -0
- package/dist/components/progress-stepper.d.ts.map +1 -0
- package/dist/components/progress-stepper.js +62 -0
- package/dist/components/progress.d.ts.map +1 -1
- package/dist/components/progress.js +54 -0
- package/dist/components/qr-svg.d.ts.map +1 -1
- package/dist/components/qr-svg.js +74 -0
- package/dist/components/radio-group.d.ts +1 -1
- package/dist/components/radio-group.d.ts.map +1 -1
- package/dist/components/radio-group.js +41 -0
- package/dist/components/replay-preview.d.ts +4 -0
- package/dist/components/replay-preview.d.ts.map +1 -0
- package/dist/components/replay-preview.js +3 -0
- package/dist/components/scroll-area.js +23 -0
- package/dist/components/search-field.d.ts.map +1 -1
- package/dist/components/search-field.js +44 -0
- package/dist/components/segmented.d.ts +1 -1
- package/dist/components/segmented.d.ts.map +1 -1
- package/dist/components/segmented.js +32 -0
- package/dist/components/select.d.ts +1 -1
- package/dist/components/select.d.ts.map +1 -1
- package/dist/components/select.js +93 -0
- package/dist/components/separator.d.ts.map +1 -1
- package/dist/components/separator.js +40 -0
- package/dist/components/sheet.d.ts.map +1 -1
- package/dist/components/sheet.js +55 -0
- package/dist/components/side-drawer.d.ts +10 -1
- package/dist/components/side-drawer.d.ts.map +1 -1
- package/dist/components/side-drawer.js +247 -0
- package/dist/components/sidebar.d.ts.map +1 -1
- package/dist/components/sidebar.js +282 -0
- package/dist/components/skeleton.js +48 -0
- package/dist/components/slider.d.ts +1 -1
- package/dist/components/slider.d.ts.map +1 -1
- package/dist/components/slider.js +98 -0
- package/dist/components/snap-sheet.d.ts.map +1 -0
- package/dist/components/snap-sheet.js +100 -0
- package/dist/components/spinner.js +35 -0
- package/dist/components/split-view.d.ts.map +1 -1
- package/dist/components/split-view.js +1060 -0
- package/dist/components/switch.d.ts.map +1 -1
- package/dist/components/switch.js +27 -0
- package/dist/components/syntax-highlighting.d.ts.map +1 -1
- package/dist/components/syntax-highlighting.js +293 -0
- package/dist/components/tab-bar.js +28 -0
- package/dist/components/tab-view.d.ts +1 -1
- package/dist/components/tab-view.d.ts.map +1 -1
- package/dist/components/tab-view.js +307 -0
- package/dist/components/tabs.d.ts +1 -1
- package/dist/components/tabs.d.ts.map +1 -1
- package/dist/components/tabs.js +86 -0
- package/dist/components/text-field.d.ts.map +1 -1
- package/dist/components/text-field.js +29 -0
- package/dist/components/text-morph.d.ts.map +1 -1
- package/dist/components/text-morph.js +131 -0
- package/dist/components/textarea.d.ts.map +1 -1
- package/dist/components/textarea.js +30 -0
- package/dist/components/toast.d.ts +0 -2
- package/dist/components/toast.d.ts.map +1 -1
- package/dist/components/toast.js +302 -0
- package/dist/components/toggle-group.d.ts +1 -1
- package/dist/components/toggle-group.d.ts.map +1 -1
- package/dist/components/toggle-group.js +48 -0
- package/dist/components/toggle.d.ts +1 -1
- package/dist/components/toggle.d.ts.map +1 -1
- package/dist/components/toggle.js +42 -0
- package/dist/components/tooltip.d.ts +1 -1
- package/dist/components/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip.js +42 -0
- package/dist/{lib/workbench/theme.d.ts → components/workbench-theme.d.ts} +2 -2
- package/dist/components/workbench-theme.d.ts.map +1 -0
- package/dist/components/workbench-theme.js +34 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +29 -47
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +94 -20350
- package/dist/lib/append-stream.d.ts +43 -0
- package/dist/lib/append-stream.d.ts.map +1 -0
- package/dist/lib/append-stream.js +128 -0
- package/dist/lib/container.d.ts.map +1 -1
- package/dist/lib/container.js +49 -0
- package/dist/lib/durable-streams.d.ts +102 -0
- package/dist/lib/durable-streams.d.ts.map +1 -0
- package/dist/lib/durable-streams.js +280 -0
- package/dist/lib/icon-shapes/chat.js +13 -0
- package/dist/lib/icon-shapes/pencilkit.js +20 -0
- package/dist/lib/icon-shapes/workbench.js +47 -0
- package/dist/lib/icon.d.ts +1 -1
- package/dist/lib/icon.d.ts.map +1 -1
- package/dist/lib/icon.js +1774 -0
- package/dist/lib/motion.d.ts +16 -0
- package/dist/lib/motion.d.ts.map +1 -1
- package/dist/lib/motion.js +104 -0
- package/dist/lib/{chat/persistent-host.d.ts → persistent-host.d.ts} +1 -1
- package/dist/lib/persistent-host.d.ts.map +1 -0
- package/dist/lib/persistent-host.js +41 -0
- package/dist/lib/primitives.js +8 -0
- package/dist/lib/qr.js +552 -0
- package/dist/lib/row-label.d.ts.map +1 -1
- package/dist/lib/row-label.js +10 -0
- package/dist/lib/session-recorder.d.ts +87 -0
- package/dist/lib/session-recorder.d.ts.map +1 -0
- package/dist/lib/session-recorder.js +257 -0
- package/dist/lib/sheet-drag.d.ts +1 -1
- package/dist/lib/sheet-drag.d.ts.map +1 -1
- package/dist/lib/sheet-drag.js +128 -0
- package/dist/lib/syntax.js +204 -0
- package/dist/lib/theme.d.ts +33 -8
- package/dist/lib/theme.d.ts.map +1 -1
- package/dist/lib/theme.js +138 -0
- package/dist/lib/tokens.generated.d.ts +16 -0
- package/dist/lib/tokens.generated.d.ts.map +1 -0
- package/dist/lib/tokens.generated.js +22 -0
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +18 -0
- package/dist/theme.css +0 -60
- package/package.json +5 -7
- package/dist/components/adaptive-pane.stories.d.ts +0 -7
- package/dist/components/adaptive-pane.stories.d.ts.map +0 -1
- package/dist/components/avatar.stories.d.ts +0 -9
- package/dist/components/avatar.stories.d.ts.map +0 -1
- package/dist/components/badge.stories.d.ts +0 -9
- package/dist/components/badge.stories.d.ts.map +0 -1
- package/dist/components/button.stories.d.ts +0 -11
- package/dist/components/button.stories.d.ts.map +0 -1
- package/dist/components/card.stories.d.ts +0 -9
- package/dist/components/card.stories.d.ts.map +0 -1
- package/dist/components/chat/chat-column.d.ts.map +0 -1
- package/dist/components/chat/chat-column.stories.d.ts +0 -9
- package/dist/components/chat/chat-column.stories.d.ts.map +0 -1
- package/dist/components/chat/floating-chat.d.ts.map +0 -1
- package/dist/components/chat/floating-chat.stories.d.ts +0 -17
- package/dist/components/chat/floating-chat.stories.d.ts.map +0 -1
- package/dist/components/chat/floating-sheet.d.ts.map +0 -1
- package/dist/components/chat/floating-sheet.stories.d.ts +0 -22
- package/dist/components/chat/floating-sheet.stories.d.ts.map +0 -1
- package/dist/components/chat/progress-stepper.d.ts.map +0 -1
- package/dist/components/checkbox.stories.d.ts +0 -11
- package/dist/components/checkbox.stories.d.ts.map +0 -1
- package/dist/components/combobox.stories.d.ts +0 -10
- package/dist/components/combobox.stories.d.ts.map +0 -1
- package/dist/components/command-menu.stories.d.ts +0 -17
- package/dist/components/command-menu.stories.d.ts.map +0 -1
- package/dist/components/credenza.stories.d.ts +0 -8
- package/dist/components/credenza.stories.d.ts.map +0 -1
- package/dist/components/dialog.stories.d.ts +0 -12
- package/dist/components/dialog.stories.d.ts.map +0 -1
- package/dist/components/disclosure.stories.d.ts +0 -10
- package/dist/components/disclosure.stories.d.ts.map +0 -1
- package/dist/components/dropdown-menu.stories.d.ts +0 -11
- package/dist/components/dropdown-menu.stories.d.ts.map +0 -1
- package/dist/components/edge-drawer.stories.d.ts +0 -8
- package/dist/components/edge-drawer.stories.d.ts.map +0 -1
- package/dist/components/edit-bar.stories.d.ts +0 -10
- package/dist/components/edit-bar.stories.d.ts.map +0 -1
- package/dist/components/form.stories.d.ts +0 -9
- package/dist/components/form.stories.d.ts.map +0 -1
- package/dist/components/haptic-indicator.d.ts +0 -11
- package/dist/components/haptic-indicator.d.ts.map +0 -1
- package/dist/components/haptic-indicator.stories.d.ts +0 -8
- package/dist/components/haptic-indicator.stories.d.ts.map +0 -1
- package/dist/components/index-bar.stories.d.ts +0 -12
- package/dist/components/index-bar.stories.d.ts.map +0 -1
- package/dist/components/input.stories.d.ts +0 -10
- package/dist/components/input.stories.d.ts.map +0 -1
- package/dist/components/kbd.stories.d.ts +0 -9
- package/dist/components/kbd.stories.d.ts.map +0 -1
- package/dist/components/label.stories.d.ts +0 -8
- package/dist/components/label.stories.d.ts.map +0 -1
- package/dist/components/list-box.stories.d.ts +0 -9
- package/dist/components/list-box.stories.d.ts.map +0 -1
- package/dist/components/list-row.stories.d.ts +0 -24
- package/dist/components/list-row.stories.d.ts.map +0 -1
- package/dist/components/list.stories.d.ts +0 -27
- package/dist/components/list.stories.d.ts.map +0 -1
- package/dist/components/markdown-editor.stories.d.ts +0 -17
- package/dist/components/markdown-editor.stories.d.ts.map +0 -1
- package/dist/components/morph.stories.d.ts +0 -14
- package/dist/components/morph.stories.d.ts.map +0 -1
- package/dist/components/motion.stories.d.ts +0 -15
- package/dist/components/motion.stories.d.ts.map +0 -1
- package/dist/components/navigation-stack.stories.d.ts +0 -31
- package/dist/components/navigation-stack.stories.d.ts.map +0 -1
- package/dist/components/now-playing-bars.stories.d.ts +0 -12
- package/dist/components/now-playing-bars.stories.d.ts.map +0 -1
- package/dist/components/pencilkit/pencil-canvas.stories.d.ts +0 -18
- package/dist/components/pencilkit/pencil-canvas.stories.d.ts.map +0 -1
- package/dist/components/pencilkit/pencil-toolbar.stories.d.ts +0 -10
- package/dist/components/pencilkit/pencil-toolbar.stories.d.ts.map +0 -1
- package/dist/components/popover.stories.d.ts +0 -9
- package/dist/components/popover.stories.d.ts.map +0 -1
- package/dist/components/progress-ring.stories.d.ts +0 -15
- package/dist/components/progress-ring.stories.d.ts.map +0 -1
- package/dist/components/progress.stories.d.ts +0 -10
- package/dist/components/progress.stories.d.ts.map +0 -1
- package/dist/components/qr-svg.stories.d.ts +0 -16
- package/dist/components/qr-svg.stories.d.ts.map +0 -1
- package/dist/components/radio-group.stories.d.ts +0 -10
- package/dist/components/radio-group.stories.d.ts.map +0 -1
- package/dist/components/scroll-area.stories.d.ts +0 -8
- package/dist/components/scroll-area.stories.d.ts.map +0 -1
- package/dist/components/search-field.stories.d.ts +0 -10
- package/dist/components/search-field.stories.d.ts.map +0 -1
- package/dist/components/segmented.stories.d.ts +0 -8
- package/dist/components/segmented.stories.d.ts.map +0 -1
- package/dist/components/select.stories.d.ts +0 -12
- package/dist/components/select.stories.d.ts.map +0 -1
- package/dist/components/separator.stories.d.ts +0 -9
- package/dist/components/separator.stories.d.ts.map +0 -1
- package/dist/components/sheet.stories.d.ts +0 -12
- package/dist/components/sheet.stories.d.ts.map +0 -1
- package/dist/components/side-drawer.stories.d.ts +0 -8
- package/dist/components/side-drawer.stories.d.ts.map +0 -1
- package/dist/components/sidebar.stories.d.ts +0 -10
- package/dist/components/sidebar.stories.d.ts.map +0 -1
- package/dist/components/skeleton.stories.d.ts +0 -11
- package/dist/components/skeleton.stories.d.ts.map +0 -1
- package/dist/components/slider.stories.d.ts +0 -12
- package/dist/components/slider.stories.d.ts.map +0 -1
- package/dist/components/spinner.stories.d.ts +0 -9
- package/dist/components/spinner.stories.d.ts.map +0 -1
- package/dist/components/split-view.stories.d.ts +0 -58
- package/dist/components/split-view.stories.d.ts.map +0 -1
- package/dist/components/switch.stories.d.ts +0 -9
- package/dist/components/switch.stories.d.ts.map +0 -1
- package/dist/components/syntax-highlighting.stories.d.ts +0 -18
- package/dist/components/syntax-highlighting.stories.d.ts.map +0 -1
- package/dist/components/tab-bar.stories.d.ts +0 -8
- package/dist/components/tab-bar.stories.d.ts.map +0 -1
- package/dist/components/tab-view.stories.d.ts +0 -37
- package/dist/components/tab-view.stories.d.ts.map +0 -1
- package/dist/components/tabs.stories.d.ts +0 -9
- package/dist/components/tabs.stories.d.ts.map +0 -1
- package/dist/components/text-field.stories.d.ts +0 -9
- package/dist/components/text-field.stories.d.ts.map +0 -1
- package/dist/components/toast.stories.d.ts +0 -13
- package/dist/components/toast.stories.d.ts.map +0 -1
- package/dist/components/toggle-group.stories.d.ts +0 -10
- package/dist/components/toggle-group.stories.d.ts.map +0 -1
- package/dist/components/toggle.stories.d.ts +0 -9
- package/dist/components/toggle.stories.d.ts.map +0 -1
- package/dist/components/tooltip.stories.d.ts +0 -11
- package/dist/components/tooltip.stories.d.ts.map +0 -1
- package/dist/components/workbench/annotator.d.ts.map +0 -1
- package/dist/components/workbench/chat.d.ts.map +0 -1
- package/dist/components/workbench/chat.stories.d.ts +0 -13
- package/dist/components/workbench/chat.stories.d.ts.map +0 -1
- package/dist/components/workbench/composer-files.d.ts.map +0 -1
- package/dist/components/workbench/composer.d.ts.map +0 -1
- package/dist/components/workbench/composer.stories.d.ts +0 -35
- package/dist/components/workbench/composer.stories.d.ts.map +0 -1
- package/dist/components/workbench/fixtures.d.ts +0 -38
- package/dist/components/workbench/fixtures.d.ts.map +0 -1
- package/dist/components/workbench/markdown.d.ts.map +0 -1
- package/dist/components/workbench/message-scroller.d.ts.map +0 -1
- package/dist/components/workbench/message-scroller.stories.d.ts +0 -9
- package/dist/components/workbench/message-scroller.stories.d.ts.map +0 -1
- package/dist/components/workbench/model-picker.d.ts +0 -29
- package/dist/components/workbench/model-picker.d.ts.map +0 -1
- package/dist/components/workbench/models.d.ts +0 -32
- package/dist/components/workbench/models.d.ts.map +0 -1
- package/dist/components/workbench/snap-sheet.d.ts.map +0 -1
- package/dist/components/workbench/snap-sheet.stories.d.ts +0 -8
- package/dist/components/workbench/snap-sheet.stories.d.ts.map +0 -1
- package/dist/components/workbench/surfaces.d.ts +0 -67
- package/dist/components/workbench/surfaces.d.ts.map +0 -1
- package/dist/components/workbench/surfaces.stories.d.ts +0 -15
- package/dist/components/workbench/surfaces.stories.d.ts.map +0 -1
- package/dist/components/workbench/terminal.d.ts +0 -51
- package/dist/components/workbench/terminal.d.ts.map +0 -1
- package/dist/components/workbench/terminal.stories.d.ts +0 -8
- package/dist/components/workbench/terminal.stories.d.ts.map +0 -1
- package/dist/components/workbench/wb-popover.d.ts.map +0 -1
- package/dist/components/workbench/workbench-composer.d.ts +0 -26
- package/dist/components/workbench/workbench-composer.d.ts.map +0 -1
- package/dist/demos/delivery/delivery-tracking-demo.d.ts +0 -41
- package/dist/demos/delivery/delivery-tracking-demo.d.ts.map +0 -1
- package/dist/demos/delivery/delivery-tracking-demo.stories.d.ts +0 -13
- package/dist/demos/delivery/delivery-tracking-demo.stories.d.ts.map +0 -1
- package/dist/demos/haptics-playground.d.ts +0 -18
- package/dist/demos/haptics-playground.d.ts.map +0 -1
- package/dist/demos/haptics-playground.stories.d.ts +0 -8
- package/dist/demos/haptics-playground.stories.d.ts.map +0 -1
- package/dist/demos/map-chat/geo.d.ts +0 -46
- package/dist/demos/map-chat/geo.d.ts.map +0 -1
- package/dist/demos/map-chat/map-agent.d.ts +0 -48
- package/dist/demos/map-chat/map-agent.d.ts.map +0 -1
- package/dist/demos/map-chat/map-chat-demo.d.ts +0 -19
- package/dist/demos/map-chat/map-chat-demo.d.ts.map +0 -1
- package/dist/demos/map-chat/map-chat-demo.stories.d.ts +0 -16
- package/dist/demos/map-chat/map-chat-demo.stories.d.ts.map +0 -1
- package/dist/demos/map-chat/map-icons.d.ts +0 -44
- package/dist/demos/map-chat/map-icons.d.ts.map +0 -1
- package/dist/demos/map-chat/places.d.ts +0 -29
- package/dist/demos/map-chat/places.d.ts.map +0 -1
- package/dist/demos/map-chat/tile-map.d.ts +0 -108
- package/dist/demos/map-chat/tile-map.d.ts.map +0 -1
- package/dist/demos/pencilkit/demo-strokes.d.ts +0 -4
- package/dist/demos/pencilkit/demo-strokes.d.ts.map +0 -1
- package/dist/demos/pencilkit/pencilkit-demo.d.ts +0 -17
- package/dist/demos/pencilkit/pencilkit-demo.d.ts.map +0 -1
- package/dist/demos/pencilkit/pencilkit-demo.stories.d.ts +0 -11
- package/dist/demos/pencilkit/pencilkit-demo.stories.d.ts.map +0 -1
- package/dist/demos/sidebar-demo.d.ts +0 -6
- package/dist/demos/sidebar-demo.d.ts.map +0 -1
- package/dist/demos/split-view-demos.d.ts +0 -50
- package/dist/demos/split-view-demos.d.ts.map +0 -1
- package/dist/lib/chat/chat-shell-context.d.ts +0 -20
- package/dist/lib/chat/chat-shell-context.d.ts.map +0 -1
- package/dist/lib/chat/persistent-host.d.ts.map +0 -1
- package/dist/lib/haptics.d.ts +0 -27
- package/dist/lib/haptics.d.ts.map +0 -1
- package/dist/lib/icon.stories.d.ts +0 -15
- package/dist/lib/icon.stories.d.ts.map +0 -1
- package/dist/lib/pencilkit/constants.d.ts.map +0 -1
- package/dist/lib/workbench/haptics.d.ts +0 -3
- package/dist/lib/workbench/haptics.d.ts.map +0 -1
- package/dist/lib/workbench/icons.d.ts.map +0 -1
- package/dist/lib/workbench/motion.d.ts +0 -19
- package/dist/lib/workbench/motion.d.ts.map +0 -1
- package/dist/lib/workbench/press.d.ts +0 -10
- package/dist/lib/workbench/press.d.ts.map +0 -1
- package/dist/lib/workbench/theme.d.ts.map +0 -1
- package/dist/lib/workbench/util.d.ts +0 -8
- package/dist/lib/workbench/util.d.ts.map +0 -1
- package/dist/stories/frame.d.ts +0 -16
- package/dist/stories/frame.d.ts.map +0 -1
- package/dist/stories/primitive-frame.d.ts +0 -20
- package/dist/stories/primitive-frame.d.ts.map +0 -1
- package/dist/templates/artifact-chat-container.d.ts.map +0 -1
- package/dist/templates/artifact-chat-container.stories.d.ts +0 -24
- package/dist/templates/artifact-chat-container.stories.d.ts.map +0 -1
- package/dist/templates/chat-shell.d.ts +0 -87
- package/dist/templates/chat-shell.d.ts.map +0 -1
- package/dist/templates/workbench-shell.d.ts +0 -177
- package/dist/templates/workbench-shell.d.ts.map +0 -1
- package/dist/templates/workbench-shell.stories.d.ts +0 -17
- package/dist/templates/workbench-shell.stories.d.ts.map +0 -1
- /package/dist/components/{chat/chat-column.d.ts → chat-column.d.ts} +0 -0
- /package/dist/components/{workbench → composer}/annotator.d.ts +0 -0
- /package/dist/components/{workbench → composer}/composer-files.d.ts +0 -0
- /package/dist/components/{workbench/message-scroller.d.ts → message-scroller.d.ts} +0 -0
- /package/dist/{lib → components}/pencilkit/constants.d.ts +0 -0
- /package/dist/components/{chat/progress-stepper.d.ts → progress-stepper.d.ts} +0 -0
- /package/dist/components/{workbench/snap-sheet.d.ts → snap-sheet.d.ts} +0 -0
|
@@ -0,0 +1,906 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../lib/utils.js";
|
|
3
|
+
import { fades as t, springs as n } from "../lib/motion.js";
|
|
4
|
+
import { Icon as r } from "../lib/icon.js";
|
|
5
|
+
import { IconSwap as i } from "./icon-swap.js";
|
|
6
|
+
import { AnimatedHeight as a, ContentSwap as o } from "./animated-height.js";
|
|
7
|
+
import { useThemeScopeProps as s } from "../lib/theme.js";
|
|
8
|
+
import { Kbd as c } from "./kbd.js";
|
|
9
|
+
import { overlayZ as l, selectableText as u } from "../lib/primitives.js";
|
|
10
|
+
import { AnimatePresence as d, motion as f, useReducedMotion as p } from "framer-motion";
|
|
11
|
+
import { Children as m, createContext as h, isValidElement as g, useCallback as _, useContext as v, useEffect as y, useId as b, useImperativeHandle as x, useLayoutEffect as S, useMemo as C, useRef as w, useState as T, useSyncExternalStore as E } from "react";
|
|
12
|
+
import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
13
|
+
import { UNSAFE_PortalProvider as A } from "react-aria/PortalProvider";
|
|
14
|
+
import { Dialog as j, Modal as M, ModalOverlay as N } from "react-aria-components";
|
|
15
|
+
//#region src/components/command-menu.tsx
|
|
16
|
+
var P = (e, t) => t === 0 || /[\s\-_/.:·@]/.test(e[t - 1]) || e[t - 1] === e[t - 1].toLowerCase() && e[t] !== e[t].toLowerCase();
|
|
17
|
+
function F(e, t) {
|
|
18
|
+
let n = t.toLowerCase(), r = n.indexOf(e);
|
|
19
|
+
if (r >= 0) {
|
|
20
|
+
let i = Array.from({ length: e.length }, (e, t) => r + t);
|
|
21
|
+
return {
|
|
22
|
+
score: (r === 0 ? 1 : P(t, r) ? .93 : .82) - Math.min(.08, (n.length - e.length) / 400),
|
|
23
|
+
indices: i
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
let i = [], a = 0, o = 0, s = -2;
|
|
27
|
+
for (let r of e) {
|
|
28
|
+
let e = -1;
|
|
29
|
+
for (let i = a; i < n.length; i++) if (n[i] === r && P(t, i)) {
|
|
30
|
+
e = i;
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
let c = n.indexOf(r, a);
|
|
34
|
+
if ((e < 0 || c >= 0 && c === s + 1) && (e = c), e < 0) return null;
|
|
35
|
+
o += e === s + 1 ? 1 : P(t, e) ? .8 : .35, i.push(e), s = e, a = e + 1;
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
score: Math.max(.05, .7 * (o / e.length) - Math.min(.1, (i[i.length - 1] - i[0]) / 300)),
|
|
39
|
+
indices: i
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function I(e, t) {
|
|
43
|
+
let n = e.toLowerCase().trim().split(/\s+/).filter(Boolean);
|
|
44
|
+
if (!n.length) return {
|
|
45
|
+
score: 1,
|
|
46
|
+
indices: []
|
|
47
|
+
};
|
|
48
|
+
let r = 0, i = /* @__PURE__ */ new Set();
|
|
49
|
+
for (let e of n) {
|
|
50
|
+
let n = F(e, t);
|
|
51
|
+
if (!n) return null;
|
|
52
|
+
r += n.score, n.indices.forEach((e) => i.add(e));
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
score: r / n.length,
|
|
56
|
+
indices: [...i].sort((e, t) => e - t)
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function L({ text: t, query: n, className: r }) {
|
|
60
|
+
let i = v(B), a = n ?? i?.query ?? "", o = a ? I(a, t) : null;
|
|
61
|
+
if (!o || !o.indices.length) return /* @__PURE__ */ O(D, { children: t });
|
|
62
|
+
let s = new Set(o.indices), c = [], l = "", u = !1, d = (t) => {
|
|
63
|
+
l &&= (c.push(u ? /* @__PURE__ */ O("mark", {
|
|
64
|
+
"data-slot": "command-highlight",
|
|
65
|
+
className: e("bg-transparent font-semibold text-foreground", r),
|
|
66
|
+
children: l
|
|
67
|
+
}, t) : l), "");
|
|
68
|
+
};
|
|
69
|
+
for (let e = 0; e < t.length; e++) {
|
|
70
|
+
let n = s.has(e);
|
|
71
|
+
n !== u && (d(e), u = n), l += t[e];
|
|
72
|
+
}
|
|
73
|
+
return d(t.length), /* @__PURE__ */ O(D, { children: c });
|
|
74
|
+
}
|
|
75
|
+
function R() {
|
|
76
|
+
let e = /* @__PURE__ */ new Set(), t = {
|
|
77
|
+
items: /* @__PURE__ */ new Map(),
|
|
78
|
+
groups: /* @__PURE__ */ new Map(),
|
|
79
|
+
pages: /* @__PURE__ */ new Map(),
|
|
80
|
+
visible: [],
|
|
81
|
+
enabled: [],
|
|
82
|
+
groupBest: /* @__PURE__ */ new Map(),
|
|
83
|
+
ranking: "group",
|
|
84
|
+
active: null,
|
|
85
|
+
source: "auto",
|
|
86
|
+
page: "root",
|
|
87
|
+
query: "",
|
|
88
|
+
seen: "",
|
|
89
|
+
restore: null,
|
|
90
|
+
scroller: null,
|
|
91
|
+
version: 0,
|
|
92
|
+
queued: !1,
|
|
93
|
+
subscribe(t) {
|
|
94
|
+
return e.add(t), () => {
|
|
95
|
+
e.delete(t);
|
|
96
|
+
};
|
|
97
|
+
},
|
|
98
|
+
emit() {
|
|
99
|
+
t.version++, e.forEach((e) => e());
|
|
100
|
+
},
|
|
101
|
+
setActive(e, n) {
|
|
102
|
+
t.active !== e && (t.active = e, t.source = n, t.emit(), n === "keyboard" && t.reveal());
|
|
103
|
+
},
|
|
104
|
+
reveal() {
|
|
105
|
+
let e = t.active ? t.items.get(t.active) : null, n = t.scroller;
|
|
106
|
+
if (!e?.el || !n) return;
|
|
107
|
+
if (t.visible[0] === e.id) {
|
|
108
|
+
n.scrollTop = 0;
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
let r = e.group ? t.groups.get(e.group) : null, i = !!e.group && t.visible.find((n) => t.items.get(n)?.group === e.group) === e.id, a = n.getBoundingClientRect(), o = e.el.getBoundingClientRect(), s = r?.heading && getComputedStyle(r.heading).position === "sticky" ? r.heading.offsetHeight : 0, c = o.top - a.top + n.scrollTop - s;
|
|
112
|
+
i && r?.heading && (c = r.heading.getBoundingClientRect().top - a.top + n.scrollTop);
|
|
113
|
+
let l = o.bottom - a.top + n.scrollTop + 8;
|
|
114
|
+
c < n.scrollTop ? n.scrollTop = Math.max(0, c) : l > n.scrollTop + n.clientHeight && (n.scrollTop = l - n.clientHeight);
|
|
115
|
+
},
|
|
116
|
+
reconcile() {
|
|
117
|
+
t.queued = !1;
|
|
118
|
+
let e = [...t.items.values()].filter((e) => e.page === t.page && e.score > 0 && e.el?.isConnected), n = /* @__PURE__ */ new Map();
|
|
119
|
+
e.sort((e, t) => e.el.compareDocumentPosition(t.el) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1), e.forEach((e, t) => n.set(e, t));
|
|
120
|
+
let r = /* @__PURE__ */ new Map();
|
|
121
|
+
for (let t of e) t.group && !r.has(t.group) && r.set(t.group, n.get(t));
|
|
122
|
+
let i = !!t.query.trim(), a = /* @__PURE__ */ new Map();
|
|
123
|
+
for (let t of e) t.group && a.set(t.group, Math.max(a.get(t.group) ?? 0, t.score));
|
|
124
|
+
let o = a.size !== t.groupBest.size || [...a].some(([e, n]) => t.groupBest.get(e) !== n);
|
|
125
|
+
o && (t.groupBest = a);
|
|
126
|
+
let s = i && t.ranking === "global";
|
|
127
|
+
e.sort((e, t) => {
|
|
128
|
+
if (s) {
|
|
129
|
+
let n = e.group ? a.get(e.group) : e.score, r = t.group ? a.get(t.group) : t.score;
|
|
130
|
+
if (n !== r) return r - n;
|
|
131
|
+
}
|
|
132
|
+
let o = e.group ? r.get(e.group) : n.get(e), c = t.group ? r.get(t.group) : n.get(t);
|
|
133
|
+
return o === c ? i && e.score !== t.score ? t.score - e.score : n.get(e) - n.get(t) : o - c;
|
|
134
|
+
});
|
|
135
|
+
let c = e.map((e) => e.id), l = o || c.length !== t.visible.length || c.some((e, n) => e !== t.visible[n]);
|
|
136
|
+
l && (t.visible = c);
|
|
137
|
+
let u = t.page + "\0" + t.query, d = c.filter((e) => !t.items.get(e).disabled), f = t.active;
|
|
138
|
+
if (u !== t.seen) f = (t.restore === null ? void 0 : d.find((e) => t.items.get(e).value === t.restore)) ?? d[0] ?? null, t.restore = null, t.seen = u;
|
|
139
|
+
else if (!f || !d.includes(f)) {
|
|
140
|
+
let e = f ? t.enabled.indexOf(f) : -1;
|
|
141
|
+
f = e >= 0 ? d[Math.min(e, d.length - 1)] ?? null : d[0] ?? null;
|
|
142
|
+
}
|
|
143
|
+
t.enabled = d, f === t.active ? l && t.emit() : (t.active = f, t.source = "auto", t.emit(), requestAnimationFrame(() => t.reveal()));
|
|
144
|
+
},
|
|
145
|
+
queue() {
|
|
146
|
+
t.queued || (t.queued = !0, queueMicrotask(() => t.queued && t.reconcile()));
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
return t;
|
|
150
|
+
}
|
|
151
|
+
function z(e, t) {
|
|
152
|
+
return E(e.subscribe, () => t(e), () => t(e));
|
|
153
|
+
}
|
|
154
|
+
var B = h(null), V = h({
|
|
155
|
+
id: "root",
|
|
156
|
+
filter: null,
|
|
157
|
+
numbered: !1
|
|
158
|
+
}), H = h(null);
|
|
159
|
+
function U(e) {
|
|
160
|
+
let t = v(B);
|
|
161
|
+
if (!t) throw Error(`<${e}> must be used within <CommandMenu>`);
|
|
162
|
+
return t;
|
|
163
|
+
}
|
|
164
|
+
function W() {
|
|
165
|
+
let e = U("useCommandMenu");
|
|
166
|
+
return {
|
|
167
|
+
query: e.query,
|
|
168
|
+
setQuery: e.setQuery,
|
|
169
|
+
page: e.page,
|
|
170
|
+
pages: e.pages,
|
|
171
|
+
depth: e.depth,
|
|
172
|
+
push: e.push,
|
|
173
|
+
pop: e.pop,
|
|
174
|
+
popTo: e.popTo,
|
|
175
|
+
reset: e.reset,
|
|
176
|
+
close: e.close,
|
|
177
|
+
move: e.move,
|
|
178
|
+
setActive: e.setActive,
|
|
179
|
+
select: e.select
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
function G() {
|
|
183
|
+
let { store: e } = U("useCommandActive");
|
|
184
|
+
return z(e, (e) => e.active ? e.items.get(e.active)?.value ?? null : null);
|
|
185
|
+
}
|
|
186
|
+
var K = () => typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent), q = {
|
|
187
|
+
space: {
|
|
188
|
+
codes: ["Space"],
|
|
189
|
+
keys: [
|
|
190
|
+
" ",
|
|
191
|
+
"\xA0",
|
|
192
|
+
"Spacebar"
|
|
193
|
+
]
|
|
194
|
+
},
|
|
195
|
+
enter: {
|
|
196
|
+
codes: ["Enter", "NumpadEnter"],
|
|
197
|
+
keys: ["Enter"]
|
|
198
|
+
},
|
|
199
|
+
return: {
|
|
200
|
+
codes: ["Enter", "NumpadEnter"],
|
|
201
|
+
keys: ["Enter"]
|
|
202
|
+
},
|
|
203
|
+
escape: {
|
|
204
|
+
codes: ["Escape"],
|
|
205
|
+
keys: ["Escape", "Esc"]
|
|
206
|
+
},
|
|
207
|
+
esc: {
|
|
208
|
+
codes: ["Escape"],
|
|
209
|
+
keys: ["Escape", "Esc"]
|
|
210
|
+
},
|
|
211
|
+
tab: {
|
|
212
|
+
codes: ["Tab"],
|
|
213
|
+
keys: ["Tab"]
|
|
214
|
+
},
|
|
215
|
+
backspace: {
|
|
216
|
+
codes: ["Backspace"],
|
|
217
|
+
keys: ["Backspace"]
|
|
218
|
+
},
|
|
219
|
+
delete: {
|
|
220
|
+
codes: ["Delete"],
|
|
221
|
+
keys: ["Delete"]
|
|
222
|
+
},
|
|
223
|
+
up: {
|
|
224
|
+
codes: ["ArrowUp"],
|
|
225
|
+
keys: ["ArrowUp"]
|
|
226
|
+
},
|
|
227
|
+
down: {
|
|
228
|
+
codes: ["ArrowDown"],
|
|
229
|
+
keys: ["ArrowDown"]
|
|
230
|
+
},
|
|
231
|
+
left: {
|
|
232
|
+
codes: ["ArrowLeft"],
|
|
233
|
+
keys: ["ArrowLeft"]
|
|
234
|
+
},
|
|
235
|
+
right: {
|
|
236
|
+
codes: ["ArrowRight"],
|
|
237
|
+
keys: ["ArrowRight"]
|
|
238
|
+
},
|
|
239
|
+
comma: {
|
|
240
|
+
codes: ["Comma"],
|
|
241
|
+
keys: [","]
|
|
242
|
+
},
|
|
243
|
+
period: {
|
|
244
|
+
codes: ["Period"],
|
|
245
|
+
keys: ["."]
|
|
246
|
+
},
|
|
247
|
+
slash: {
|
|
248
|
+
codes: ["Slash"],
|
|
249
|
+
keys: ["/"]
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
function J(e, t) {
|
|
253
|
+
let n = t.toLowerCase().split("+"), r = n.pop(), i = K(), a = {
|
|
254
|
+
meta: n.includes("meta") || i && n.includes("mod"),
|
|
255
|
+
ctrl: n.includes("ctrl") || !i && n.includes("mod"),
|
|
256
|
+
alt: n.includes("alt"),
|
|
257
|
+
shift: n.includes("shift")
|
|
258
|
+
};
|
|
259
|
+
if (e.metaKey !== a.meta || e.ctrlKey !== a.ctrl || e.altKey !== a.alt || e.shiftKey !== a.shift) return !1;
|
|
260
|
+
let o = e.code ?? "";
|
|
261
|
+
if (/^[a-z]$/.test(r)) return o ? o === `Key${r.toUpperCase()}` : e.key.toLowerCase() === r;
|
|
262
|
+
if (/^[0-9]$/.test(r)) return o ? o === `Digit${r}` : e.key === r;
|
|
263
|
+
let s = q[r];
|
|
264
|
+
return s ? o ? s.codes.includes(o) : s.keys.includes(e.key) : e.key.toLowerCase() === r;
|
|
265
|
+
}
|
|
266
|
+
function Y(e, t, n = !0) {
|
|
267
|
+
let r = w(t);
|
|
268
|
+
r.current = t, y(() => {
|
|
269
|
+
if (!e || !n) return;
|
|
270
|
+
let t = (t) => {
|
|
271
|
+
t.defaultPrevented || !J(t, e) || (t.preventDefault(), r.current(t));
|
|
272
|
+
};
|
|
273
|
+
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
274
|
+
}, [e, n]);
|
|
275
|
+
}
|
|
276
|
+
function ee({ variant: t = "inline", isOpen: n, defaultOpen: r = !1, onOpenChange: i, hotkey: a, query: o, onQueryChange: c, defaultPages: u, onPageChange: d, loop: f = !0, closeOnSelect: p, escapeBehavior: m = "close", filter: h = !0, ranking: g = "group", menuRef: v, "aria-label": y = "Command menu", className: b, style: x, overlayClassName: S, container: C, children: w }) {
|
|
277
|
+
let [E, D] = T(r), k = n ?? E, P = _((e) => {
|
|
278
|
+
n === void 0 && D(e), i?.(e);
|
|
279
|
+
}, [n, i]);
|
|
280
|
+
Y(t === "dialog" ? a : void 0, () => P(!k));
|
|
281
|
+
let F = s(), I = /* @__PURE__ */ O(te, {
|
|
282
|
+
variant: t,
|
|
283
|
+
open: k,
|
|
284
|
+
setOpen: P,
|
|
285
|
+
queryProp: o,
|
|
286
|
+
onQueryChange: c,
|
|
287
|
+
defaultPages: u,
|
|
288
|
+
onPageChange: d,
|
|
289
|
+
loop: f,
|
|
290
|
+
closeOnSelect: p ?? t === "dialog",
|
|
291
|
+
escapeBehavior: m,
|
|
292
|
+
filter: h,
|
|
293
|
+
ranking: g,
|
|
294
|
+
menuRef: v,
|
|
295
|
+
ariaLabel: y,
|
|
296
|
+
className: b,
|
|
297
|
+
style: t === "inline" ? x : void 0,
|
|
298
|
+
children: w
|
|
299
|
+
});
|
|
300
|
+
if (t === "inline") return I;
|
|
301
|
+
let L = /* @__PURE__ */ O(N, {
|
|
302
|
+
"data-slot": "command-overlay",
|
|
303
|
+
"data-theme-scope": F["data-theme-scope"],
|
|
304
|
+
style: F.style,
|
|
305
|
+
isOpen: k,
|
|
306
|
+
onOpenChange: P,
|
|
307
|
+
isDismissable: !0,
|
|
308
|
+
isKeyboardDismissDisabled: !0,
|
|
309
|
+
className: e("absolute inset-0 flex items-start justify-center bg-overlay px-4 pt-[min(14vh,120px)] data-entering:animate-bl-fade-in data-exiting:animate-bl-fade-out", l, F.className, S),
|
|
310
|
+
children: /* @__PURE__ */ O(M, {
|
|
311
|
+
"data-slot": "command-modal",
|
|
312
|
+
className: "w-full max-w-[600px] outline-none data-entering:animate-bl-pop-in data-exiting:animate-bl-pop-out motion-reduce:data-entering:animate-bl-fade-in motion-reduce:data-exiting:animate-bl-fade-out",
|
|
313
|
+
style: x,
|
|
314
|
+
children: /* @__PURE__ */ O(j, {
|
|
315
|
+
"aria-label": y,
|
|
316
|
+
className: "outline-none",
|
|
317
|
+
children: I
|
|
318
|
+
})
|
|
319
|
+
})
|
|
320
|
+
});
|
|
321
|
+
return C ? /* @__PURE__ */ O(A, {
|
|
322
|
+
getContainer: () => C,
|
|
323
|
+
children: L
|
|
324
|
+
}) : L;
|
|
325
|
+
}
|
|
326
|
+
function te({ variant: t, setOpen: n, queryProp: r, onQueryChange: i, defaultPages: a, onPageChange: o, loop: s, closeOnSelect: c, escapeBehavior: l, filter: u, ranking: d, menuRef: f, ariaLabel: p, className: m, style: h, children: g }) {
|
|
327
|
+
let [v] = T(R), E = b(), D = `${E}-list`, k = w(null), [A, j] = T(""), M = r ?? A, N = _((e) => {
|
|
328
|
+
r === void 0 && j(e), i?.(e);
|
|
329
|
+
}, [r, i]), [P, F] = T(() => ["root", ...a ?? []].map((e) => ({
|
|
330
|
+
id: e,
|
|
331
|
+
query: "",
|
|
332
|
+
active: null,
|
|
333
|
+
scroll: 0
|
|
334
|
+
}))), [I, L] = T(0), z = P[P.length - 1].id;
|
|
335
|
+
v.page = z, v.query = u ? M : "", v.ranking = d;
|
|
336
|
+
let V = w(o);
|
|
337
|
+
V.current = o;
|
|
338
|
+
let H = C(() => P.map((e) => e.id), [P]);
|
|
339
|
+
y(() => {
|
|
340
|
+
V.current?.(z, H);
|
|
341
|
+
}, [z, H]), S(() => v.reconcile());
|
|
342
|
+
let U = w(P), W = w(M);
|
|
343
|
+
S(() => {
|
|
344
|
+
U.current = P, W.current = M;
|
|
345
|
+
});
|
|
346
|
+
let G = _((e) => {
|
|
347
|
+
W.current = e, N(e);
|
|
348
|
+
}, [N]), q = _((e, t) => {
|
|
349
|
+
U.current = e, F(e), L(t);
|
|
350
|
+
let n = e[e.length - 1];
|
|
351
|
+
v.restore = t < 0 ? n.active : null, G(n.query), requestAnimationFrame(() => {
|
|
352
|
+
v.scroller && (v.scroller.scrollTop = n.scroll);
|
|
353
|
+
}), k.current?.focus();
|
|
354
|
+
}, [v, G]), J = _((e) => {
|
|
355
|
+
let t = U.current, n = {
|
|
356
|
+
...t[t.length - 1],
|
|
357
|
+
query: W.current,
|
|
358
|
+
active: v.active ? v.items.get(v.active)?.value ?? null : null,
|
|
359
|
+
scroll: v.scroller?.scrollTop ?? 0
|
|
360
|
+
};
|
|
361
|
+
q([
|
|
362
|
+
...t.slice(0, -1),
|
|
363
|
+
n,
|
|
364
|
+
{
|
|
365
|
+
id: e,
|
|
366
|
+
query: "",
|
|
367
|
+
active: null,
|
|
368
|
+
scroll: 0
|
|
369
|
+
}
|
|
370
|
+
], 1);
|
|
371
|
+
}, [q, v]), Y = _(() => {
|
|
372
|
+
let e = U.current;
|
|
373
|
+
return e.length < 2 ? !1 : (q(e.slice(0, -1), -1), !0);
|
|
374
|
+
}, [q]), ee = _((e) => {
|
|
375
|
+
let t = U.current, n = t.map((e) => e.id).lastIndexOf(e);
|
|
376
|
+
return n < 0 || n === t.length - 1 ? !1 : (q(t.slice(0, n + 1), -1), !0);
|
|
377
|
+
}, [q]), te = _(() => {
|
|
378
|
+
U.current.length === 1 && !W.current || (q([{
|
|
379
|
+
id: "root",
|
|
380
|
+
query: "",
|
|
381
|
+
active: null,
|
|
382
|
+
scroll: 0
|
|
383
|
+
}], -1), v.restore = null);
|
|
384
|
+
}, [q, v]), X = _(() => n(!1), [n]), Z = _((e, t = s) => {
|
|
385
|
+
let n = v.visible.filter((e) => !v.items.get(e).disabled);
|
|
386
|
+
if (!n.length) return;
|
|
387
|
+
let r = v.active ? n.indexOf(v.active) : -1, i = r < 0 ? e > 0 ? 0 : n.length - 1 : r + e;
|
|
388
|
+
i = t && Math.abs(e) === 1 ? (i + n.length) % n.length : Math.max(0, Math.min(n.length - 1, i)), v.setActive(n[i], "keyboard");
|
|
389
|
+
}, [s, v]), ne = _((e) => {
|
|
390
|
+
let t = v.visible.find((t) => v.items.get(t).value === e);
|
|
391
|
+
t && v.setActive(t, "keyboard");
|
|
392
|
+
}, [v]), Q = _((e) => {
|
|
393
|
+
let t = e === void 0 ? v.active ? v.items.get(v.active) : void 0 : [...v.items.values()].find((t) => t.page === v.page && t.value === e);
|
|
394
|
+
t && !t.disabled && t.select();
|
|
395
|
+
}, [v]), $ = w(null), re = _((e) => {
|
|
396
|
+
if (e.nativeEvent.isComposing || (v.pages.get(v.page)?.onKeyDown?.(e, $.current), e.defaultPrevented)) return;
|
|
397
|
+
let t = K() ? e.metaKey : e.ctrlKey, n = v.visible, r = v.active ? v.items.get(v.active) : void 0, i = r?.group ? v.groups.get(r.group)?.columns ?? 1 : 1, a = () => {
|
|
398
|
+
e.preventDefault(), e.stopPropagation();
|
|
399
|
+
};
|
|
400
|
+
if (i > 1 && r && !e.altKey && !t && [
|
|
401
|
+
"ArrowLeft",
|
|
402
|
+
"ArrowRight",
|
|
403
|
+
"ArrowUp",
|
|
404
|
+
"ArrowDown"
|
|
405
|
+
].includes(e.key)) {
|
|
406
|
+
let t = n.filter((e) => v.items.get(e).group === r.group), o = t.indexOf(r.id);
|
|
407
|
+
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
408
|
+
let n = o + (e.key === "ArrowRight" ? 1 : -1);
|
|
409
|
+
return n >= 0 && n < t.length && v.setActive(t[n], "keyboard"), a();
|
|
410
|
+
}
|
|
411
|
+
let s = e.key === "ArrowDown", c = o + (s ? i : -i);
|
|
412
|
+
if (c >= 0 && c < t.length) return v.setActive(t[c], "keyboard"), a();
|
|
413
|
+
if (s && Math.floor(o / i) < Math.floor((t.length - 1) / i)) return v.setActive(t[t.length - 1], "keyboard"), a();
|
|
414
|
+
let l = s ? t[t.length - 1] : t[0];
|
|
415
|
+
return v.setActive(l, "auto"), Z(s ? 1 : -1), a();
|
|
416
|
+
}
|
|
417
|
+
if (e.key === "ArrowDown" || e.ctrlKey && (e.key === "n" || e.key === "j")) return e.altKey ? o(1) : Z(1), a();
|
|
418
|
+
if (e.key === "ArrowUp" || e.ctrlKey && (e.key === "p" || e.key === "k")) return e.altKey ? o(-1) : Z(-1), a();
|
|
419
|
+
if (e.key === "Home" || e.key === "End") {
|
|
420
|
+
let t = n.filter((e) => !v.items.get(e).disabled);
|
|
421
|
+
return t.length && v.setActive(e.key === "Home" ? t[0] : t[t.length - 1], "keyboard"), a();
|
|
422
|
+
}
|
|
423
|
+
if (e.key === "PageDown" || e.key === "PageUp") return Z(e.key === "PageDown" ? 5 : -5, !1), a();
|
|
424
|
+
if (e.key === "Enter") {
|
|
425
|
+
r && (a(), Q());
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
if (t && !e.altKey && !e.shiftKey && /^[1-9]$/.test(e.key)) {
|
|
429
|
+
let t = v.items.get(n[Number(e.key) - 1]);
|
|
430
|
+
t && (a(), v.setActive(t.id, "keyboard"), t.disabled || t.select());
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
433
|
+
if (e.key === "Backspace" && !e.repeat && U.current.length > 1) {
|
|
434
|
+
let e = k.current;
|
|
435
|
+
(!e || e.value === "") && Y() && a();
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
438
|
+
if (e.key === "Escape") {
|
|
439
|
+
if (a(), k.current?.value) {
|
|
440
|
+
G("");
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
if (l === "pop" && Y()) return;
|
|
444
|
+
X();
|
|
445
|
+
}
|
|
446
|
+
function o(e) {
|
|
447
|
+
let t = n.filter((e) => !v.items.get(e).disabled);
|
|
448
|
+
if (!t.length) return;
|
|
449
|
+
let i = r?.group ?? null, a = r ? t.indexOf(r.id) : -1;
|
|
450
|
+
if (e > 0) {
|
|
451
|
+
let e = t.slice(a + 1).find((e) => v.items.get(e).group !== i);
|
|
452
|
+
v.setActive(e ?? t[t.length - 1], "keyboard");
|
|
453
|
+
} else {
|
|
454
|
+
let e = (e) => v.items.get(e).group, n = a;
|
|
455
|
+
for (; n > 0 && e(t[n - 1]) === i && i !== null;) n--;
|
|
456
|
+
if (n === a && n > 0) {
|
|
457
|
+
let r = e(t[n - 1]);
|
|
458
|
+
for (n--; n > 0 && e(t[n - 1]) === r && r !== null;) n--;
|
|
459
|
+
}
|
|
460
|
+
v.setActive(t[Math.max(0, n)], "keyboard");
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}, [
|
|
464
|
+
v,
|
|
465
|
+
Z,
|
|
466
|
+
Q,
|
|
467
|
+
Y,
|
|
468
|
+
G,
|
|
469
|
+
X,
|
|
470
|
+
l
|
|
471
|
+
]), ie = {
|
|
472
|
+
store: v,
|
|
473
|
+
menuId: E,
|
|
474
|
+
listId: D,
|
|
475
|
+
inputRef: k,
|
|
476
|
+
direction: I,
|
|
477
|
+
loop: s,
|
|
478
|
+
closeOnSelect: c,
|
|
479
|
+
filter: u,
|
|
480
|
+
onKeyDown: re,
|
|
481
|
+
query: M,
|
|
482
|
+
setQuery: G,
|
|
483
|
+
page: z,
|
|
484
|
+
pages: H,
|
|
485
|
+
depth: P.length - 1,
|
|
486
|
+
push: J,
|
|
487
|
+
pop: Y,
|
|
488
|
+
popTo: ee,
|
|
489
|
+
reset: te,
|
|
490
|
+
close: X,
|
|
491
|
+
move: Z,
|
|
492
|
+
setActive: ne,
|
|
493
|
+
select: Q
|
|
494
|
+
};
|
|
495
|
+
return $.current = ie, x(f, () => $.current), /* @__PURE__ */ O(B.Provider, {
|
|
496
|
+
value: ie,
|
|
497
|
+
children: /* @__PURE__ */ O("div", {
|
|
498
|
+
"data-slot": "command-menu",
|
|
499
|
+
"data-variant": t,
|
|
500
|
+
"data-depth": P.length - 1,
|
|
501
|
+
"aria-label": t === "inline" ? p : void 0,
|
|
502
|
+
role: t === "inline" ? "group" : void 0,
|
|
503
|
+
onKeyDown: re,
|
|
504
|
+
className: e("relative box-border flex w-full min-w-0 flex-col overflow-hidden bg-(--command-surface) text-popover-foreground [--command-surface:var(--popover)]", t === "dialog" ? "max-h-[min(640px,calc(100dvh-160px))] rounded-sheet shadow-[0_24px_80px_--alpha(black/35%),0_0_0_.5px_var(--border)]" : "rounded-card shadow-[0_0_0_.5px_var(--border)]", m),
|
|
505
|
+
style: h,
|
|
506
|
+
children: g
|
|
507
|
+
})
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
function X({ placeholder: a = "Search…", backButton: o = !0, pageTitle: s = !0, trailing: c, className: l, style: m, autoFocus: h = !0, ...g }) {
|
|
511
|
+
let { store: _, inputRef: v, listId: b, menuId: x, query: S, setQuery: C, depth: w, pop: T } = U("CommandInput"), E = z(_, (e) => e.pages.get(e.page)), D = z(_, (e) => e.active ? e.items.get(e.active)?.domId : void 0), A = p(), j = E?.placeholder ?? (w > 0 ? "Search…" : a), M = o && w > 0;
|
|
512
|
+
return y(() => {
|
|
513
|
+
h && v.current?.focus({ preventScroll: !0 });
|
|
514
|
+
}, [h, v]), /* @__PURE__ */ k("div", {
|
|
515
|
+
"data-slot": "command-input-wrapper",
|
|
516
|
+
className: "flex h-toolbar shrink-0 items-center gap-2.5 px-4",
|
|
517
|
+
children: [
|
|
518
|
+
M ? /* @__PURE__ */ O("button", {
|
|
519
|
+
type: "button",
|
|
520
|
+
"data-slot": "command-back",
|
|
521
|
+
"aria-label": "Back",
|
|
522
|
+
tabIndex: -1,
|
|
523
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
524
|
+
onClick: () => T(),
|
|
525
|
+
className: "-m-1.5 grid size-8 shrink-0 cursor-pointer place-items-center rounded-lg border-0 bg-transparent p-0 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
|
|
526
|
+
children: /* @__PURE__ */ O(i, {
|
|
527
|
+
id: "back",
|
|
528
|
+
children: /* @__PURE__ */ O(r, {
|
|
529
|
+
name: "arrow-left",
|
|
530
|
+
size: 18,
|
|
531
|
+
sw: 2
|
|
532
|
+
})
|
|
533
|
+
})
|
|
534
|
+
}) : /* @__PURE__ */ O("span", {
|
|
535
|
+
"aria-hidden": "true",
|
|
536
|
+
className: "-m-1.5 grid size-8 shrink-0 place-items-center text-muted-foreground",
|
|
537
|
+
children: /* @__PURE__ */ O(i, {
|
|
538
|
+
id: "search",
|
|
539
|
+
children: /* @__PURE__ */ O(r, {
|
|
540
|
+
name: "magnifier",
|
|
541
|
+
size: 18,
|
|
542
|
+
sw: 1.8
|
|
543
|
+
})
|
|
544
|
+
})
|
|
545
|
+
}),
|
|
546
|
+
/* @__PURE__ */ O(d, {
|
|
547
|
+
initial: !1,
|
|
548
|
+
mode: "popLayout",
|
|
549
|
+
children: s && w > 0 && E?.title ? /* @__PURE__ */ O(f.span, {
|
|
550
|
+
"data-slot": "command-page-title",
|
|
551
|
+
initial: A ? { opacity: 0 } : {
|
|
552
|
+
opacity: 0,
|
|
553
|
+
x: 8,
|
|
554
|
+
filter: "blur(3px)"
|
|
555
|
+
},
|
|
556
|
+
animate: {
|
|
557
|
+
opacity: 1,
|
|
558
|
+
x: 0,
|
|
559
|
+
filter: "blur(0px)"
|
|
560
|
+
},
|
|
561
|
+
exit: {
|
|
562
|
+
opacity: 0,
|
|
563
|
+
transition: t.out
|
|
564
|
+
},
|
|
565
|
+
transition: A ? { duration: .12 } : {
|
|
566
|
+
x: n.smooth,
|
|
567
|
+
default: t.in
|
|
568
|
+
},
|
|
569
|
+
className: "inline-flex h-6 shrink-0 items-center rounded-md bg-secondary px-2 text-[12.5px] font-medium whitespace-nowrap text-secondary-foreground",
|
|
570
|
+
children: E.title
|
|
571
|
+
}, E.title) : null
|
|
572
|
+
}),
|
|
573
|
+
/* @__PURE__ */ O("input", {
|
|
574
|
+
ref: v,
|
|
575
|
+
id: `${x}-input`,
|
|
576
|
+
"data-slot": "command-input",
|
|
577
|
+
type: "text",
|
|
578
|
+
role: "combobox",
|
|
579
|
+
"aria-expanded": !0,
|
|
580
|
+
"aria-controls": b,
|
|
581
|
+
"aria-activedescendant": D,
|
|
582
|
+
"aria-autocomplete": "list",
|
|
583
|
+
autoComplete: "off",
|
|
584
|
+
autoCorrect: "off",
|
|
585
|
+
spellCheck: !1,
|
|
586
|
+
placeholder: j,
|
|
587
|
+
value: S,
|
|
588
|
+
onChange: (e) => C(e.target.value),
|
|
589
|
+
style: {
|
|
590
|
+
outline: "none",
|
|
591
|
+
...m
|
|
592
|
+
},
|
|
593
|
+
className: e("h-full min-w-0 flex-1 border-0 bg-transparent p-0 font-[inherit] text-callout text-foreground outline-none placeholder:text-tertiary-foreground", u, l),
|
|
594
|
+
...g
|
|
595
|
+
}),
|
|
596
|
+
c
|
|
597
|
+
]
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
function Z({ children: t, maxHeight: n = 360, stickyHeadings: r = !0, "aria-label": i = "Results", className: s }) {
|
|
601
|
+
let { store: c, listId: l, page: u, direction: d } = U("CommandList"), f = typeof t == "function" ? t(u) : m.map(t, (e) => g(e) && e.type === ne && e.props.id !== u ? null : e);
|
|
602
|
+
return /* @__PURE__ */ O(a, {
|
|
603
|
+
spring: "tray",
|
|
604
|
+
className: "shrink-0",
|
|
605
|
+
children: /* @__PURE__ */ O("div", {
|
|
606
|
+
ref: (e) => {
|
|
607
|
+
c.scroller = e;
|
|
608
|
+
},
|
|
609
|
+
id: l,
|
|
610
|
+
role: "listbox",
|
|
611
|
+
"aria-label": i,
|
|
612
|
+
"data-slot": "command-list",
|
|
613
|
+
"data-sticky-headings": r,
|
|
614
|
+
className: e("group/command-list bl-scroll relative overflow-x-hidden overflow-y-auto overscroll-contain", s),
|
|
615
|
+
style: { maxHeight: n },
|
|
616
|
+
children: /* @__PURE__ */ O(o, {
|
|
617
|
+
id: u,
|
|
618
|
+
direction: d,
|
|
619
|
+
distance: 28,
|
|
620
|
+
children: /* @__PURE__ */ O("div", {
|
|
621
|
+
className: "flex flex-col px-2 pb-2",
|
|
622
|
+
children: f
|
|
623
|
+
})
|
|
624
|
+
})
|
|
625
|
+
})
|
|
626
|
+
});
|
|
627
|
+
}
|
|
628
|
+
function ne({ id: e, placeholder: t, title: n, filter: r, numbered: i = !1, onKeyDown: a, children: o }) {
|
|
629
|
+
let { store: s, filter: c } = U("CommandPage"), l = w(a);
|
|
630
|
+
l.current = a, S(() => (s.pages.set(e, {
|
|
631
|
+
placeholder: t,
|
|
632
|
+
title: n,
|
|
633
|
+
onKeyDown: (e, t) => l.current?.(e, t)
|
|
634
|
+
}), s.emit(), () => {
|
|
635
|
+
s.pages.delete(e), s.emit();
|
|
636
|
+
}), [
|
|
637
|
+
s,
|
|
638
|
+
e,
|
|
639
|
+
t,
|
|
640
|
+
n
|
|
641
|
+
]);
|
|
642
|
+
let u = C(() => ({
|
|
643
|
+
id: e,
|
|
644
|
+
filter: r ?? c,
|
|
645
|
+
numbered: i
|
|
646
|
+
}), [
|
|
647
|
+
e,
|
|
648
|
+
r,
|
|
649
|
+
c,
|
|
650
|
+
i
|
|
651
|
+
]);
|
|
652
|
+
return /* @__PURE__ */ O(V.Provider, {
|
|
653
|
+
value: u,
|
|
654
|
+
children: o
|
|
655
|
+
});
|
|
656
|
+
}
|
|
657
|
+
function Q({ heading: t, columns: n = 1, forceMount: r, className: i, children: a }) {
|
|
658
|
+
let { store: o } = U("CommandGroup"), s = b(), c = `${s}-heading`, l = w(null), u = w(null);
|
|
659
|
+
S(() => (o.groups.set(s, {
|
|
660
|
+
el: l.current,
|
|
661
|
+
heading: u.current,
|
|
662
|
+
columns: n
|
|
663
|
+
}), () => {
|
|
664
|
+
o.groups.delete(s);
|
|
665
|
+
}), [
|
|
666
|
+
o,
|
|
667
|
+
s,
|
|
668
|
+
n
|
|
669
|
+
]);
|
|
670
|
+
let d = z(o, (e) => e.visible.reduce((t, n) => t + +(e.items.get(n)?.group === s), 0)), f = C(() => ({
|
|
671
|
+
id: s,
|
|
672
|
+
columns: n
|
|
673
|
+
}), [s, n]), p = z(o, (e) => e.ranking === "global" && e.query.trim() ? -Math.round((e.groupBest.get(s) ?? 0) * 1e3) : void 0);
|
|
674
|
+
return /* @__PURE__ */ k("div", {
|
|
675
|
+
ref: l,
|
|
676
|
+
role: "group",
|
|
677
|
+
"aria-labelledby": t ? c : void 0,
|
|
678
|
+
"data-slot": "command-group",
|
|
679
|
+
hidden: !r && d === 0,
|
|
680
|
+
className: e("pt-1", i),
|
|
681
|
+
style: p === void 0 ? void 0 : { order: p },
|
|
682
|
+
children: [t ? /* @__PURE__ */ O("div", {
|
|
683
|
+
ref: u,
|
|
684
|
+
id: c,
|
|
685
|
+
"data-slot": "command-group-heading",
|
|
686
|
+
"aria-hidden": "true",
|
|
687
|
+
className: "sticky top-0 z-1 bg-(--command-heading-surface,var(--command-surface)) px-3 pt-2 pb-1.5 text-[12.5px] font-medium text-muted-foreground group-data-[sticky-headings=false]/command-list:static group-data-[sticky-headings=false]/command-list:bg-transparent",
|
|
688
|
+
children: t
|
|
689
|
+
}) : null, /* @__PURE__ */ O(H.Provider, {
|
|
690
|
+
value: f,
|
|
691
|
+
children: /* @__PURE__ */ O("div", {
|
|
692
|
+
"data-slot": "command-group-items",
|
|
693
|
+
className: n > 1 ? "grid gap-1" : "flex flex-col",
|
|
694
|
+
style: n > 1 ? { gridTemplateColumns: `repeat(${n}, minmax(0, 1fr))` } : void 0,
|
|
695
|
+
children: a
|
|
696
|
+
})
|
|
697
|
+
})]
|
|
698
|
+
});
|
|
699
|
+
}
|
|
700
|
+
function $({ keys: e }) {
|
|
701
|
+
let t = Array.isArray(e) ? e : [...e];
|
|
702
|
+
return /* @__PURE__ */ O("span", {
|
|
703
|
+
"data-slot": "command-shortcut",
|
|
704
|
+
className: "ml-auto inline-flex shrink-0 items-center gap-0.5 pl-3 text-footnote text-muted-foreground",
|
|
705
|
+
children: t.map((e, t) => /* @__PURE__ */ O("kbd", {
|
|
706
|
+
className: "min-w-3 text-center font-sans font-normal",
|
|
707
|
+
children: e
|
|
708
|
+
}, t))
|
|
709
|
+
});
|
|
710
|
+
}
|
|
711
|
+
function re({ value: t, keywords: n, icon: i, title: a, description: o, shortcut: s, badge: c, page: l, chevron: u, disabled: d = !1, dimmed: f = !1, onSelect: p, closeOnSelect: m, boost: h = 1, keywordWeight: g = .92, searchDescription: _ = !0, className: y, children: x }) {
|
|
712
|
+
let T = U("CommandItem"), { store: E, menuId: A, query: j } = T, M = v(V), N = v(H), P = b(), F = `${A}-item-${P.replace(/:/g, "")}`, R = t ?? (typeof a == "string" ? a : P), B = w(null), W = (M.filter ?? T.filter) && j.trim() !== "", G = C(() => {
|
|
713
|
+
if (!W) return 1;
|
|
714
|
+
let e = [[R, 1], ...(n ?? []).map((e) => [e, g])];
|
|
715
|
+
typeof a == "string" && a !== R && e.push([a, 1]), _ && typeof o == "string" && e.push([o, .7]);
|
|
716
|
+
let t = 0;
|
|
717
|
+
for (let [n, r] of e) {
|
|
718
|
+
let e = I(j, n);
|
|
719
|
+
e && (t = Math.max(t, e.score * r));
|
|
720
|
+
}
|
|
721
|
+
return t * h;
|
|
722
|
+
}, [
|
|
723
|
+
W,
|
|
724
|
+
j,
|
|
725
|
+
R,
|
|
726
|
+
n,
|
|
727
|
+
g,
|
|
728
|
+
a,
|
|
729
|
+
o,
|
|
730
|
+
_,
|
|
731
|
+
h
|
|
732
|
+
]), K = w(() => {});
|
|
733
|
+
K.current = () => {
|
|
734
|
+
if (!d) {
|
|
735
|
+
if (l) {
|
|
736
|
+
T.push(l), p?.(R);
|
|
737
|
+
return;
|
|
738
|
+
}
|
|
739
|
+
p?.(R), (m ?? T.closeOnSelect) && T.close();
|
|
740
|
+
}
|
|
741
|
+
}, S(() => {
|
|
742
|
+
let e = {
|
|
743
|
+
id: P,
|
|
744
|
+
domId: F,
|
|
745
|
+
page: M.id,
|
|
746
|
+
group: N?.id ?? null,
|
|
747
|
+
value: R,
|
|
748
|
+
score: G,
|
|
749
|
+
disabled: d,
|
|
750
|
+
el: B.current,
|
|
751
|
+
select: () => K.current()
|
|
752
|
+
};
|
|
753
|
+
E.items.set(P, e), E.queue();
|
|
754
|
+
}), S(() => () => {
|
|
755
|
+
E.items.delete(P), E.queue();
|
|
756
|
+
}, [E, P]);
|
|
757
|
+
let q = z(E, (e) => e.active === P), J = z(E, (e) => M.numbered ? e.visible.indexOf(P) : -1);
|
|
758
|
+
if (G <= 0) return null;
|
|
759
|
+
let Y = c ?? (s ? /* @__PURE__ */ O($, { keys: s }) : J >= 0 && J < 9 ? /* @__PURE__ */ O($, { keys: ["⌘", String(J + 1)] }) : null), ee = u ?? !!l, te = (N?.columns ?? 1) > 1;
|
|
760
|
+
return /* @__PURE__ */ O("div", {
|
|
761
|
+
ref: B,
|
|
762
|
+
id: F,
|
|
763
|
+
role: "option",
|
|
764
|
+
"aria-selected": q,
|
|
765
|
+
"aria-disabled": d || void 0,
|
|
766
|
+
"data-slot": "command-item",
|
|
767
|
+
"data-active": q || void 0,
|
|
768
|
+
"data-disabled": d || void 0,
|
|
769
|
+
"data-dimmed": f || void 0,
|
|
770
|
+
"data-value": R,
|
|
771
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
772
|
+
onClick: () => {
|
|
773
|
+
E.setActive(P, "pointer"), K.current();
|
|
774
|
+
},
|
|
775
|
+
onPointerMove: () => {
|
|
776
|
+
!d && E.active !== P && E.setActive(P, "pointer");
|
|
777
|
+
},
|
|
778
|
+
style: W && (N || E.ranking === "global") ? { order: -Math.round(G * 1e3) } : void 0,
|
|
779
|
+
className: e("relative flex min-w-0 cursor-default items-center gap-3 rounded-ctl px-3 text-subhead text-foreground outline-none select-none", te ? "aspect-square justify-center p-0" : o ? "min-h-toolbar py-1.5" : "min-h-10 py-1", "transition-[background-color] duration-100 data-active:bg-accent", (d || f) && "text-muted-foreground", d && "opacity-60", y),
|
|
780
|
+
children: x ?? /* @__PURE__ */ k(D, { children: [
|
|
781
|
+
i == null ? null : /* @__PURE__ */ O("span", {
|
|
782
|
+
"data-slot": "command-item-icon",
|
|
783
|
+
className: e("grid size-6 shrink-0 place-items-center text-muted-foreground", (d || f) && "opacity-60"),
|
|
784
|
+
children: typeof i == "string" ? /* @__PURE__ */ O(r, {
|
|
785
|
+
name: i,
|
|
786
|
+
size: 19,
|
|
787
|
+
sw: 1.7
|
|
788
|
+
}) : i
|
|
789
|
+
}),
|
|
790
|
+
a != null || o != null ? /* @__PURE__ */ k("span", {
|
|
791
|
+
className: "flex min-w-0 flex-1 flex-col",
|
|
792
|
+
children: [/* @__PURE__ */ O("span", {
|
|
793
|
+
"data-slot": "command-item-title",
|
|
794
|
+
className: "truncate leading-[20px]",
|
|
795
|
+
children: typeof a == "string" && W ? /* @__PURE__ */ O(L, { text: a }) : a
|
|
796
|
+
}), o == null ? null : /* @__PURE__ */ O("span", {
|
|
797
|
+
"data-slot": "command-item-description",
|
|
798
|
+
className: e("truncate text-footnote leading-[18px] text-muted-foreground", (d || f) && "opacity-70"),
|
|
799
|
+
children: o
|
|
800
|
+
})]
|
|
801
|
+
}) : null,
|
|
802
|
+
Y,
|
|
803
|
+
ee ? /* @__PURE__ */ O(r, {
|
|
804
|
+
name: "chevron-right",
|
|
805
|
+
size: 15,
|
|
806
|
+
sw: 2,
|
|
807
|
+
className: "ml-auto shrink-0 text-muted-foreground"
|
|
808
|
+
}) : null
|
|
809
|
+
] })
|
|
810
|
+
});
|
|
811
|
+
}
|
|
812
|
+
function ie({ children: t = "No results", className: n }) {
|
|
813
|
+
let { store: r, query: i } = U("CommandEmpty"), a = z(r, (e) => e.visible.length);
|
|
814
|
+
return !i.trim() || a > 0 ? null : /* @__PURE__ */ O("div", {
|
|
815
|
+
"data-slot": "command-empty",
|
|
816
|
+
role: "presentation",
|
|
817
|
+
className: e("py-10 text-center text-detail text-muted-foreground", n),
|
|
818
|
+
children: t
|
|
819
|
+
});
|
|
820
|
+
}
|
|
821
|
+
function ae({ className: t }) {
|
|
822
|
+
let { query: n } = U("CommandSeparator");
|
|
823
|
+
return n.trim() ? null : /* @__PURE__ */ O("div", {
|
|
824
|
+
role: "separator",
|
|
825
|
+
"data-slot": "command-separator",
|
|
826
|
+
className: e("mx-3 my-1.5 h-px bg-border", t)
|
|
827
|
+
});
|
|
828
|
+
}
|
|
829
|
+
function oe({ legend: i = !0, className: a, children: o }) {
|
|
830
|
+
let { depth: s } = U("CommandFooter"), l = p(), u = Array.isArray(i) ? i.map((e, t) => ({
|
|
831
|
+
...e,
|
|
832
|
+
id: `${t}-${e.label}`
|
|
833
|
+
})) : i ? [
|
|
834
|
+
{
|
|
835
|
+
id: "nav",
|
|
836
|
+
keys: [/* @__PURE__ */ O(r, {
|
|
837
|
+
name: "arrow-up",
|
|
838
|
+
size: 12,
|
|
839
|
+
sw: 2.2
|
|
840
|
+
}, "u"), /* @__PURE__ */ O(r, {
|
|
841
|
+
name: "arrow-down",
|
|
842
|
+
size: 12,
|
|
843
|
+
sw: 2.2
|
|
844
|
+
}, "d")],
|
|
845
|
+
label: "Navigate"
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
id: "enter",
|
|
849
|
+
keys: ["Enter"],
|
|
850
|
+
label: "Select"
|
|
851
|
+
},
|
|
852
|
+
...s > 0 ? [{
|
|
853
|
+
id: "back",
|
|
854
|
+
keys: ["Backspace"],
|
|
855
|
+
label: "Back"
|
|
856
|
+
}] : [],
|
|
857
|
+
{
|
|
858
|
+
id: "esc",
|
|
859
|
+
keys: ["Esc"],
|
|
860
|
+
label: "Close"
|
|
861
|
+
}
|
|
862
|
+
] : [];
|
|
863
|
+
return /* @__PURE__ */ k("div", {
|
|
864
|
+
"data-slot": "command-footer",
|
|
865
|
+
onMouseDown: (e) => {
|
|
866
|
+
e.target.closest("button,a,input") || e.preventDefault();
|
|
867
|
+
},
|
|
868
|
+
className: e("flex h-11 shrink-0 items-center gap-4 border-t border-border bg-secondary/40 px-3 text-footnote text-muted-foreground", a),
|
|
869
|
+
children: [/* @__PURE__ */ O(d, {
|
|
870
|
+
initial: !1,
|
|
871
|
+
children: u.map((e) => /* @__PURE__ */ k(f.span, {
|
|
872
|
+
layout: !l && "position",
|
|
873
|
+
initial: l ? { opacity: 0 } : {
|
|
874
|
+
opacity: 0,
|
|
875
|
+
scale: .9,
|
|
876
|
+
filter: "blur(3px)"
|
|
877
|
+
},
|
|
878
|
+
animate: {
|
|
879
|
+
opacity: 1,
|
|
880
|
+
scale: 1,
|
|
881
|
+
filter: "blur(0px)"
|
|
882
|
+
},
|
|
883
|
+
exit: {
|
|
884
|
+
opacity: 0,
|
|
885
|
+
scale: .9,
|
|
886
|
+
transition: t.out
|
|
887
|
+
},
|
|
888
|
+
transition: l ? { duration: .12 } : {
|
|
889
|
+
layout: n.smooth,
|
|
890
|
+
scale: n.snappy,
|
|
891
|
+
default: t.in
|
|
892
|
+
},
|
|
893
|
+
className: "inline-flex items-center gap-1.5 whitespace-nowrap",
|
|
894
|
+
children: [e.keys.map((e, t) => /* @__PURE__ */ O(c, {
|
|
895
|
+
className: "h-6 min-w-6 rounded-md px-1.5 text-[12.5px] text-foreground",
|
|
896
|
+
children: e
|
|
897
|
+
}, t)), /* @__PURE__ */ O("span", { children: e.label })]
|
|
898
|
+
}, e.id))
|
|
899
|
+
}), o ? /* @__PURE__ */ O("div", {
|
|
900
|
+
className: "ml-auto flex items-center gap-2",
|
|
901
|
+
children: o
|
|
902
|
+
}) : null]
|
|
903
|
+
});
|
|
904
|
+
}
|
|
905
|
+
//#endregion
|
|
906
|
+
export { ie as CommandEmpty, oe as CommandFooter, Q as CommandGroup, L as CommandHighlight, X as CommandInput, re as CommandItem, Z as CommandList, ee as CommandMenu, ne as CommandPage, ae as CommandSeparator, I as commandMatch, J as matchesHotkey, G as useCommandActive, W as useCommandMenu, Y as useHotkey };
|