@asanchez-sa/abby 0.0.0-stage → 0.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 +217 -2
- package/dist/_virtual/_rolldown/runtime.js +26 -0
- package/dist/agents/approvals.d.ts +46 -0
- package/dist/agents/approvals.js +58 -0
- package/dist/agents/changes.d.ts +21 -0
- package/dist/agents/changes.js +21 -0
- package/dist/agents/hooks.d.ts +20 -0
- package/dist/agents/hooks.js +58 -0
- package/dist/agents/index.d.ts +11 -0
- package/dist/agents/index.js +9 -0
- package/dist/agents/run-tool.d.ts +44 -0
- package/dist/agents/run-tool.js +79 -0
- package/dist/agents/ui-sdk.d.ts +5 -0
- package/dist/agents/ui-sdk.js +3 -0
- package/dist/behaviors/canvas/index.d.ts +2 -0
- package/dist/behaviors/canvas/index.js +1 -0
- package/dist/behaviors/canvas/ui-sdk.d.ts +2 -0
- package/dist/behaviors/canvas/ui-sdk.js +1 -0
- package/dist/behaviors/drag-and-drop/index.d.ts +2 -0
- package/dist/behaviors/drag-and-drop/index.js +1 -0
- package/dist/behaviors/drag-and-drop/ui-sdk.d.ts +2 -0
- package/dist/behaviors/drag-and-drop/ui-sdk.js +1 -0
- package/dist/behaviors/dragging/index.d.ts +2 -0
- package/dist/behaviors/dragging/index.js +1 -0
- package/dist/behaviors/dragging/ui-sdk.d.ts +2 -0
- package/dist/behaviors/dragging/ui-sdk.js +1 -0
- package/dist/behaviors/focus/index.d.ts +2 -0
- package/dist/behaviors/focus/index.js +1 -0
- package/dist/behaviors/focus/ui-sdk.d.ts +2 -0
- package/dist/behaviors/focus/ui-sdk.js +1 -0
- package/dist/behaviors/lists/index.d.ts +3 -0
- package/dist/behaviors/lists/index.js +3 -0
- package/dist/behaviors/lists/ui-sdk.d.ts +3 -0
- package/dist/behaviors/lists/ui-sdk.js +3 -0
- package/dist/behaviors/popups/index.d.ts +3 -0
- package/dist/behaviors/popups/index.js +3 -0
- package/dist/behaviors/popups/ui-sdk.d.ts +3 -0
- package/dist/behaviors/popups/ui-sdk.js +3 -0
- package/dist/behaviors/preferences/index.d.ts +3 -0
- package/dist/behaviors/preferences/index.js +3 -0
- package/dist/behaviors/preferences/ui-sdk.d.ts +3 -0
- package/dist/behaviors/preferences/ui-sdk.js +3 -0
- package/dist/behaviors/selection/index.d.ts +3 -0
- package/dist/behaviors/selection/index.js +3 -0
- package/dist/behaviors/selection/indicator.d.ts +13 -0
- package/dist/behaviors/selection/indicator.js +20 -0
- package/dist/behaviors/selection/ui-sdk.d.ts +2 -0
- package/dist/behaviors/selection/ui-sdk.js +1 -0
- package/dist/behaviors/transitions/index.d.ts +3 -0
- package/dist/behaviors/transitions/index.js +3 -0
- package/dist/behaviors/transitions/ui-sdk.d.ts +3 -0
- package/dist/behaviors/transitions/ui-sdk.js +3 -0
- package/dist/behaviors/trees/index.d.ts +2 -0
- package/dist/behaviors/trees/index.js +1 -0
- package/dist/behaviors/trees/ui-sdk.d.ts +2 -0
- package/dist/behaviors/trees/ui-sdk.js +1 -0
- package/dist/components/accordion/accordion.d.ts +13 -0
- package/dist/components/accordion/accordion.js +165 -0
- package/dist/components/alert/alert.d.ts +13 -0
- package/dist/components/alert/alert.js +131 -0
- package/dist/components/alert-dialog/alert-dialog.d.ts +15 -0
- package/dist/components/alert-dialog/alert-dialog.js +257 -0
- package/dist/components/aspect-ratio/aspect-ratio.d.ts +7 -0
- package/dist/components/aspect-ratio/aspect-ratio.js +57 -0
- package/dist/components/attachment/attachment.d.ts +48 -0
- package/dist/components/attachment/attachment.js +372 -0
- package/dist/components/autocomplete/autocomplete.d.ts +32 -0
- package/dist/components/autocomplete/autocomplete.js +466 -0
- package/dist/components/avatar/avatar.d.ts +6 -0
- package/dist/components/avatar/avatar.js +100 -0
- package/dist/components/avatar-group/avatar-group.d.ts +9 -0
- package/dist/components/avatar-group/avatar-group.js +75 -0
- package/dist/components/badge/badge.d.ts +15 -0
- package/dist/components/badge/badge.js +31 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +24 -0
- package/dist/components/breadcrumb/breadcrumb.js +279 -0
- package/dist/components/bubble/bubble.d.ts +26 -0
- package/dist/components/bubble/bubble.js +173 -0
- package/dist/components/button/button.d.ts +18 -0
- package/dist/components/button/button.js +91 -0
- package/dist/components/button-group/button-group.d.ts +15 -0
- package/dist/components/button-group/button-group.js +71 -0
- package/dist/components/calendar/calendar.d.ts +29 -0
- package/dist/components/calendar/calendar.js +453 -0
- package/dist/components/card/card.d.ts +14 -0
- package/dist/components/card/card.js +213 -0
- package/dist/components/carousel/carousel.d.ts +16 -0
- package/dist/components/carousel/carousel.js +364 -0
- package/dist/components/chain-of-thought/chain-of-thought.d.ts +72 -0
- package/dist/components/chain-of-thought/chain-of-thought.js +491 -0
- package/dist/components/chat/chat.d.ts +48 -0
- package/dist/components/chat/chat.js +207 -0
- package/dist/components/checkbox/checkbox.d.ts +10 -0
- package/dist/components/checkbox/checkbox.js +118 -0
- package/dist/components/checkpoint/checkpoint.d.ts +24 -0
- package/dist/components/checkpoint/checkpoint.js +178 -0
- package/dist/components/choice-cards/choice-cards.d.ts +38 -0
- package/dist/components/choice-cards/choice-cards.js +255 -0
- package/dist/components/code-block/code-block.d.ts +58 -0
- package/dist/components/code-block/code-block.js +506 -0
- package/dist/components/code-block/highlighter.js +96 -0
- package/dist/components/code-block/use-highlighted-code.d.ts +11 -0
- package/dist/components/code-block/use-highlighted-code.js +54 -0
- package/dist/components/collapsible/collapsible.d.ts +10 -0
- package/dist/components/collapsible/collapsible.js +92 -0
- package/dist/components/color-picker/color-picker.d.ts +17 -0
- package/dist/components/color-picker/color-picker.js +395 -0
- package/dist/components/combobox/combobox.d.ts +54 -0
- package/dist/components/combobox/combobox.js +683 -0
- package/dist/components/command/command.d.ts +23 -0
- package/dist/components/command/command.js +373 -0
- package/dist/components/command-dock/command-dock.d.ts +118 -0
- package/dist/components/command-dock/command-dock.js +944 -0
- package/dist/components/confirmation/confirmation.d.ts +58 -0
- package/dist/components/confirmation/confirmation.js +181 -0
- package/dist/components/context/context.d.ts +82 -0
- package/dist/components/context/context.js +490 -0
- package/dist/components/date-input/date-input.d.ts +16 -0
- package/dist/components/date-input/date-input.js +89 -0
- package/dist/components/date-picker/date-picker.d.ts +28 -0
- package/dist/components/date-picker/date-picker.js +361 -0
- package/dist/components/dialog/dialog.d.ts +14 -0
- package/dist/components/dialog/dialog.js +261 -0
- package/dist/components/drawer/drawer.d.ts +16 -0
- package/dist/components/drawer/drawer.js +309 -0
- package/dist/components/empty/empty.d.ts +18 -0
- package/dist/components/empty/empty.js +192 -0
- package/dist/components/field/field.d.ts +15 -0
- package/dist/components/field/field.js +261 -0
- package/dist/components/file-input/file-input.d.ts +12 -0
- package/dist/components/file-input/file-input.js +216 -0
- package/dist/components/file-tree/file-tree.d.ts +45 -0
- package/dist/components/file-tree/file-tree.js +283 -0
- package/dist/components/hover-card/hover-card.d.ts +10 -0
- package/dist/components/hover-card/hover-card.js +118 -0
- package/dist/components/icon/icon.d.ts +14 -0
- package/dist/components/icon/icon.js +60 -0
- package/dist/components/image-cropper/image-cropper.d.ts +15 -0
- package/dist/components/image-cropper/image-cropper.js +334 -0
- package/dist/components/inline-citation/inline-citation.d.ts +46 -0
- package/dist/components/inline-citation/inline-citation.js +269 -0
- package/dist/components/input/input.d.ts +9 -0
- package/dist/components/input/input.js +43 -0
- package/dist/components/input-group/input-group.d.ts +42 -0
- package/dist/components/input-group/input-group.js +192 -0
- package/dist/components/item/item.d.ts +32 -0
- package/dist/components/item/item.js +394 -0
- package/dist/components/kbd/kbd.d.ts +9 -0
- package/dist/components/kbd/kbd.js +75 -0
- package/dist/components/label/label.d.ts +6 -0
- package/dist/components/label/label.js +40 -0
- package/dist/components/link/link.d.ts +21 -0
- package/dist/components/link/link.js +126 -0
- package/dist/components/listbox/listbox.d.ts +20 -0
- package/dist/components/listbox/listbox.js +199 -0
- package/dist/components/marker/marker.d.ts +11 -0
- package/dist/components/marker/marker.js +88 -0
- package/dist/components/menu/menu.d.ts +38 -0
- package/dist/components/menu/menu.js +553 -0
- package/dist/components/menubar/menubar.d.ts +9 -0
- package/dist/components/menubar/menubar.js +47 -0
- package/dist/components/message/message.d.ts +44 -0
- package/dist/components/message/message.js +328 -0
- package/dist/components/message-scroller/message-scroller.d.ts +111 -0
- package/dist/components/message-scroller/message-scroller.js +957 -0
- package/dist/components/meter/meter.d.ts +8 -0
- package/dist/components/meter/meter.js +162 -0
- package/dist/components/model-selector/model-selector.d.ts +155 -0
- package/dist/components/model-selector/model-selector.js +905 -0
- package/dist/components/native-select/native-select.d.ts +27 -0
- package/dist/components/native-select/native-select.js +226 -0
- package/dist/components/navigation-menu/navigation-menu.d.ts +29 -0
- package/dist/components/navigation-menu/navigation-menu.js +318 -0
- package/dist/components/not-label.js +9 -0
- package/dist/components/note-editor/blocks.d.ts +22 -0
- package/dist/components/note-editor/blocks.js +245 -0
- package/dist/components/note-editor/diff.d.ts +19 -0
- package/dist/components/note-editor/diff.js +64 -0
- package/dist/components/note-editor/editor.js +249 -0
- package/dist/components/note-editor/note-editor.d.ts +109 -0
- package/dist/components/note-editor/note-editor.js +954 -0
- package/dist/components/note-editor/parts/comments.d.ts +24 -0
- package/dist/components/note-editor/parts/comments.js +336 -0
- package/dist/components/note-editor/parts/header.d.ts +25 -0
- package/dist/components/note-editor/parts/header.js +263 -0
- package/dist/components/note-editor/parts/history.d.ts +56 -0
- package/dist/components/note-editor/parts/history.js +409 -0
- package/dist/components/note-editor/parts/presence.d.ts +31 -0
- package/dist/components/note-editor/parts/presence.js +140 -0
- package/dist/components/note-editor/parts/suggestions.d.ts +45 -0
- package/dist/components/note-editor/parts/suggestions.js +316 -0
- package/dist/components/note-editor/parts/toolbar.d.ts +38 -0
- package/dist/components/note-editor/parts/toolbar.js +683 -0
- package/dist/components/note-editor/people.d.ts +84 -0
- package/dist/components/note-editor/people.js +276 -0
- package/dist/components/note-editor/person.d.ts +11 -0
- package/dist/components/note-editor/person.js +15 -0
- package/dist/components/note-place/note-place.d.ts +42 -0
- package/dist/components/note-place/note-place.js +256 -0
- package/dist/components/note-status/note-status.d.ts +59 -0
- package/dist/components/note-status/note-status.js +380 -0
- package/dist/components/number-input/number-input.d.ts +12 -0
- package/dist/components/number-input/number-input.js +252 -0
- package/dist/components/otp-input/otp-input.d.ts +12 -0
- package/dist/components/otp-input/otp-input.js +136 -0
- package/dist/components/pagination/pagination.d.ts +23 -0
- package/dist/components/pagination/pagination.js +218 -0
- package/dist/components/password-input/password-input.d.ts +11 -0
- package/dist/components/password-input/password-input.js +117 -0
- package/dist/components/plan/plan.d.ts +51 -0
- package/dist/components/plan/plan.js +320 -0
- package/dist/components/popover/popover.d.ts +16 -0
- package/dist/components/popover/popover.js +268 -0
- package/dist/components/preferences/preferences.d.ts +5 -0
- package/dist/components/preferences/preferences.js +18 -0
- package/dist/components/progress/progress.d.ts +8 -0
- package/dist/components/progress/progress.js +162 -0
- package/dist/components/prompt-input/prompt-input.d.ts +247 -0
- package/dist/components/prompt-input/prompt-input.js +1367 -0
- package/dist/components/questionnaire/questionnaire.d.ts +174 -0
- package/dist/components/questionnaire/questionnaire.js +1628 -0
- package/dist/components/queue/queue.d.ts +82 -0
- package/dist/components/queue/queue.js +471 -0
- package/dist/components/radio/radio.d.ts +7 -0
- package/dist/components/radio/radio.js +101 -0
- package/dist/components/rating/rating.d.ts +10 -0
- package/dist/components/rating/rating.js +95 -0
- package/dist/components/reasoning/reasoning.d.ts +50 -0
- package/dist/components/reasoning/reasoning.js +233 -0
- package/dist/components/resizable/resizable.d.ts +6 -0
- package/dist/components/resizable/resizable.js +100 -0
- package/dist/components/scroll-area/scroll-area.d.ts +17 -0
- package/dist/components/scroll-area/scroll-area.js +211 -0
- package/dist/components/segmented-control/segmented-control.d.ts +16 -0
- package/dist/components/segmented-control/segmented-control.js +142 -0
- package/dist/components/select/select.d.ts +43 -0
- package/dist/components/select/select.js +577 -0
- package/dist/components/separator/separator.d.ts +4 -0
- package/dist/components/separator/separator.js +38 -0
- package/dist/components/sheet/sheet.d.ts +24 -0
- package/dist/components/sheet/sheet.js +330 -0
- package/dist/components/sidebar/sidebar.d.ts +138 -0
- package/dist/components/sidebar/sidebar.js +1374 -0
- package/dist/components/skeleton/skeleton.d.ts +4 -0
- package/dist/components/skeleton/skeleton.js +40 -0
- package/dist/components/slider/slider.d.ts +9 -0
- package/dist/components/slider/slider.js +193 -0
- package/dist/components/sources/sources.d.ts +35 -0
- package/dist/components/sources/sources.js +209 -0
- package/dist/components/spinner/spinner.d.ts +11 -0
- package/dist/components/spinner/spinner.js +59 -0
- package/dist/components/stack-trace/parse-stack-trace.d.ts +21 -0
- package/dist/components/stack-trace/parse-stack-trace.js +61 -0
- package/dist/components/stack-trace/stack-trace.d.ts +79 -0
- package/dist/components/stack-trace/stack-trace.js +434 -0
- package/dist/components/subagent/subagent.d.ts +71 -0
- package/dist/components/subagent/subagent.js +450 -0
- package/dist/components/suggestion/suggestion.d.ts +21 -0
- package/dist/components/suggestion/suggestion.js +130 -0
- package/dist/components/switch/switch.d.ts +6 -0
- package/dist/components/switch/switch.js +70 -0
- package/dist/components/table/table.d.ts +19 -0
- package/dist/components/table/table.js +284 -0
- package/dist/components/table-of-contents/spy.js +84 -0
- package/dist/components/table-of-contents/table-of-contents.d.ts +92 -0
- package/dist/components/table-of-contents/table-of-contents.js +787 -0
- package/dist/components/tabs/tabs.d.ts +25 -0
- package/dist/components/tabs/tabs.js +273 -0
- package/dist/components/task/task.d.ts +40 -0
- package/dist/components/task/task.js +262 -0
- package/dist/components/terminal/terminal.d.ts +82 -0
- package/dist/components/terminal/terminal.js +457 -0
- package/dist/components/test-results/test-results.d.ts +127 -0
- package/dist/components/test-results/test-results.js +687 -0
- package/dist/components/textarea/textarea.d.ts +8 -0
- package/dist/components/textarea/textarea.js +43 -0
- package/dist/components/time-input/time-input.d.ts +7 -0
- package/dist/components/time-input/time-input.js +82 -0
- package/dist/components/timeline/timeline.d.ts +19 -0
- package/dist/components/timeline/timeline.js +247 -0
- package/dist/components/toast/toast.d.ts +12 -0
- package/dist/components/toast/toast.js +285 -0
- package/dist/components/toggle/toggle.d.ts +15 -0
- package/dist/components/toggle/toggle.js +137 -0
- package/dist/components/token-input/token-input.d.ts +7 -0
- package/dist/components/token-input/token-input.js +117 -0
- package/dist/components/tool/tool.d.ts +66 -0
- package/dist/components/tool/tool.js +413 -0
- package/dist/components/toolbar/toolbar.d.ts +91 -0
- package/dist/components/toolbar/toolbar.js +655 -0
- package/dist/components/tooltip/tooltip.d.ts +8 -0
- package/dist/components/tooltip/tooltip.js +97 -0
- package/dist/components/trace/trace.d.ts +31 -0
- package/dist/components/trace/trace.js +309 -0
- package/dist/components/tree/tree.d.ts +13 -0
- package/dist/components/tree/tree.js +258 -0
- package/dist/components/trigger-menu/trigger-menu.d.ts +30 -0
- package/dist/components/trigger-menu/trigger-menu.js +352 -0
- package/dist/components/usage/usage.d.ts +132 -0
- package/dist/components/usage/usage.js +1368 -0
- package/dist/components/waterfall/waterfall.d.ts +20 -0
- package/dist/components/waterfall/waterfall.js +360 -0
- package/dist/components/week-strip/week-strip.d.ts +177 -0
- package/dist/components/week-strip/week-strip.js +1081 -0
- package/dist/core/index.d.ts +7 -0
- package/dist/core/index.js +27 -0
- package/dist/core/ui-sdk.d.ts +3 -0
- package/dist/core/ui-sdk.js +3 -0
- package/dist/core/use-primitive-state.d.ts +14 -0
- package/dist/core/use-primitive-state.js +25 -0
- package/dist/styles/LICENSE-shadcn.md +21 -0
- package/dist/styles/color-scheme.css +32 -0
- package/dist/styles/components.css +303 -0
- package/dist/styles/index.css +41 -0
- package/dist/styles/tokens.css +474 -0
- package/dist/styles/typeset/shadcn.css +506 -0
- package/dist/styles/typeset.css +70 -0
- package/dist/styles/utilities.css +555 -0
- package/dist/tools/observe/index.d.ts +2 -0
- package/dist/tools/observe/index.js +3 -0
- package/dist/tools/observe/ui-sdk.d.ts +1 -0
- package/dist/tools/observe/ui-sdk.js +2 -0
- package/dist/tools/testing/check-agent.d.ts +28 -0
- package/dist/tools/testing/check-agent.js +42 -0
- package/dist/tools/testing/index.d.ts +4 -0
- package/dist/tools/testing/index.js +4 -0
- package/dist/tools/testing/ui-sdk.d.ts +1 -0
- package/dist/tools/testing/ui-sdk.js +2 -0
- package/dist/utilities/cn/index.d.ts +12 -0
- package/dist/utilities/cn/index.js +47 -0
- package/dist/utilities/color/index.d.ts +2 -0
- package/dist/utilities/color/index.js +3 -0
- package/dist/utilities/color/ui-sdk.d.ts +1 -0
- package/dist/utilities/color/ui-sdk.js +2 -0
- package/dist/utilities/date/index.d.ts +2 -0
- package/dist/utilities/date/index.js +6 -0
- package/dist/utilities/date/ui-sdk.d.ts +1 -0
- package/dist/utilities/date/ui-sdk.js +2 -0
- package/dist/utilities/image/index.d.ts +2 -0
- package/dist/utilities/image/index.js +3 -0
- package/dist/utilities/image/ui-sdk.d.ts +1 -0
- package/dist/utilities/image/ui-sdk.js +2 -0
- package/dist/utilities/mobile/index.d.ts +2 -0
- package/dist/utilities/mobile/index.js +1 -0
- package/dist/utilities/mobile/ui-sdk.d.ts +2 -0
- package/dist/utilities/mobile/ui-sdk.js +1 -0
- package/dist/utilities/number/index.d.ts +2 -0
- package/dist/utilities/number/index.js +3 -0
- package/dist/utilities/number/ui-sdk.d.ts +1 -0
- package/dist/utilities/number/ui-sdk.js +2 -0
- package/dist/utilities/platform/index.d.ts +3 -0
- package/dist/utilities/platform/index.js +14 -0
- package/dist/utilities/platform/ui-sdk.d.ts +3 -0
- package/dist/utilities/platform/ui-sdk.js +3 -0
- package/dist/utilities/storage/index.d.ts +2 -0
- package/dist/utilities/storage/index.js +1 -0
- package/dist/utilities/storage/ui-sdk.d.ts +2 -0
- package/dist/utilities/storage/ui-sdk.js +1 -0
- package/dist/utilities/text/index.d.ts +3 -0
- package/dist/utilities/text/index.js +3 -0
- package/dist/utilities/text/ui-sdk.d.ts +3 -0
- package/dist/utilities/text/ui-sdk.js +3 -0
- package/package.json +192 -4
- package/skills/agent-ready-ui/SKILL.md +229 -0
- package/skills/blocks/SKILL.md +262 -0
- package/skills/compose-screens/SKILL.md +354 -0
- package/skills/note-editor/SKILL.md +493 -0
- package/skills/note-status/SKILL.md +295 -0
- package/skills/setup/SKILL.md +136 -0
- package/skills/theming/SKILL.md +216 -0
- package/src/blocks/notes/adapters.ts +77 -0
- package/src/blocks/notes/data.ts +508 -0
- package/src/blocks/notes/notes-block.tsx +244 -0
- package/src/blocks/notes/parts/home.tsx +219 -0
- package/src/blocks/notes/parts/no-access.tsx +84 -0
- package/src/blocks/notes/parts/note-screen.tsx +412 -0
- package/src/blocks/notes/parts/notes-sidebar.tsx +277 -0
- package/src/blocks/notes/parts/panels.tsx +393 -0
- package/src/blocks/notes/parts/place.ts +15 -0
- package/src/blocks/notes/parts/review-dialog.tsx +159 -0
- package/src/blocks/notes/parts/share.tsx +172 -0
- package/src/blocks/notes/texts.ts +135 -0
- package/src/blocks/shell/adapters.ts +69 -0
- package/src/blocks/shell/data.ts +281 -0
- package/src/blocks/shell/parts/compose.tsx +292 -0
- package/src/blocks/shell/parts/home.tsx +203 -0
- package/src/blocks/shell/parts/marks.tsx +144 -0
- package/src/blocks/shell/parts/rail.tsx +166 -0
- package/src/blocks/shell/parts/rooms-column.tsx +326 -0
- package/src/blocks/shell/shell-block.tsx +210 -0
- package/src/blocks/shell/texts.ts +80 -0
|
@@ -0,0 +1,944 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createChange, definePrimitive, dispatch, openAttrs } from "../../core/ui-sdk.js";
|
|
3
|
+
import { usePrimitiveState } from "../../core/use-primitive-state.js";
|
|
4
|
+
import "../../behaviors/popups/index.js";
|
|
5
|
+
import { bindLayer } from "../../behaviors/popups/ui-sdk.js";
|
|
6
|
+
import { core_exports } from "../../core/index.js";
|
|
7
|
+
import { cn, cnState } from "../../utilities/cn/index.js";
|
|
8
|
+
import "../../utilities/text/index.js";
|
|
9
|
+
import { buttonVariants } from "../button/button.js";
|
|
10
|
+
import { isComposing } from "../../utilities/text/ui-sdk.js";
|
|
11
|
+
import { Icon } from "../icon/icon.js";
|
|
12
|
+
import { c } from "react/compiler-runtime";
|
|
13
|
+
import { Children, createContext, use, useId } from "react";
|
|
14
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
import { Button } from "@ui-sdk/react/button";
|
|
16
|
+
import { ArrowUp02Icon } from "@hugeicons/core-free-icons";
|
|
17
|
+
import { Input } from "@ui-sdk/react/input";
|
|
18
|
+
// src/components/command-dock/command-dock.tsx
|
|
19
|
+
const present = (on) => on ? "" : void 0;
|
|
20
|
+
const ROW_STAGGER = 40;
|
|
21
|
+
const ROW_STAGGER_MAX = 5;
|
|
22
|
+
/**
|
|
23
|
+
* Not exported: its inferred type names ui-sdk types that aren't public, so
|
|
24
|
+
* the declaration build can't describe it from another module.
|
|
25
|
+
*/
|
|
26
|
+
const commandDock = definePrimitive({
|
|
27
|
+
name: "command-dock",
|
|
28
|
+
options: {
|
|
29
|
+
open: "boolean",
|
|
30
|
+
defaultOpen: "boolean",
|
|
31
|
+
onOpenChange: "callback",
|
|
32
|
+
value: "string",
|
|
33
|
+
defaultValue: "string",
|
|
34
|
+
onValueChange: "callback",
|
|
35
|
+
onSubmit: "callback",
|
|
36
|
+
busy: "boolean"
|
|
37
|
+
},
|
|
38
|
+
controlled: ["open", "value"],
|
|
39
|
+
state: (options) => ({
|
|
40
|
+
open: options.open ?? options.defaultOpen ?? false,
|
|
41
|
+
value: options.value ?? options.defaultValue ?? "",
|
|
42
|
+
busy: options.busy ?? false
|
|
43
|
+
}),
|
|
44
|
+
sync: (options) => ({
|
|
45
|
+
...options.open === void 0 ? {} : { open: options.open },
|
|
46
|
+
...options.value === void 0 ? {} : { value: options.value },
|
|
47
|
+
busy: options.busy ?? false
|
|
48
|
+
}),
|
|
49
|
+
api: (context) => {
|
|
50
|
+
const { store } = context;
|
|
51
|
+
const change = createChange(context);
|
|
52
|
+
const view = () => context.element("root")?.ownerDocument.defaultView;
|
|
53
|
+
const trigger = () => {
|
|
54
|
+
const id = context.element("panel")?.id;
|
|
55
|
+
return [...context.element("root")?.querySelectorAll("[aria-controls]") ?? []].find((el) => el.getAttribute("aria-controls") === id);
|
|
56
|
+
};
|
|
57
|
+
const field = () => context.element("form")?.querySelector("input");
|
|
58
|
+
const setOpen = (open, from = {}) => {
|
|
59
|
+
if (Boolean(open) === store.get().open) return false;
|
|
60
|
+
return change("open", Boolean(open), {
|
|
61
|
+
reason: from.reason ?? "imperative",
|
|
62
|
+
...from.event ? { event: from.event } : {},
|
|
63
|
+
...from.source ? { source: from.source } : {}
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
const setValue = (value, from = {}) => {
|
|
67
|
+
const text = String(value ?? "");
|
|
68
|
+
if (text === store.get().value) return false;
|
|
69
|
+
return change("value", text, {
|
|
70
|
+
reason: from.reason ?? "imperative",
|
|
71
|
+
...from.event ? { event: from.event } : {},
|
|
72
|
+
...from.source ? { source: from.source } : {}
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
/** Sends the trimmed text. Not while closed, empty or busy. */
|
|
76
|
+
const submit = (event) => {
|
|
77
|
+
const state = store.get();
|
|
78
|
+
const text = state.value.trim();
|
|
79
|
+
if (!state.open || !text || state.busy) return false;
|
|
80
|
+
dispatch(context, "onSubmit", text, {
|
|
81
|
+
reason: event ? "form-submit" : "imperative",
|
|
82
|
+
...event ? { event } : {}
|
|
83
|
+
});
|
|
84
|
+
return true;
|
|
85
|
+
};
|
|
86
|
+
let pressedOutside = false;
|
|
87
|
+
const dismiss = (reason, event) => {
|
|
88
|
+
if (reason === "window-blur") return;
|
|
89
|
+
pressedOutside = reason === "outside-press";
|
|
90
|
+
setOpen(false, {
|
|
91
|
+
reason,
|
|
92
|
+
event
|
|
93
|
+
});
|
|
94
|
+
view()?.setTimeout(() => {
|
|
95
|
+
pressedOutside = false;
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
let wasOpen = store.get().open;
|
|
99
|
+
context.onDestroy(store.subscribe(() => {
|
|
100
|
+
const { open } = store.get();
|
|
101
|
+
if (open === wasOpen) return;
|
|
102
|
+
wasOpen = open;
|
|
103
|
+
const panel = context.element("panel");
|
|
104
|
+
const frame = view();
|
|
105
|
+
if (!panel || !frame) return;
|
|
106
|
+
if (open) frame.requestAnimationFrame(() => {
|
|
107
|
+
if (store.get().open) field()?.focus({ preventScroll: true });
|
|
108
|
+
});
|
|
109
|
+
else if (panel.contains(panel.ownerDocument.activeElement) && !pressedOutside) frame.requestAnimationFrame(() => {
|
|
110
|
+
if (!store.get().open) trigger()?.focus({ preventScroll: true });
|
|
111
|
+
});
|
|
112
|
+
}));
|
|
113
|
+
let mounted = false;
|
|
114
|
+
let batch = 0;
|
|
115
|
+
const enterDelay = () => {
|
|
116
|
+
if (!mounted) return void 0;
|
|
117
|
+
const index = batch++;
|
|
118
|
+
if (index === 0) queueMicrotask(() => batch = 0);
|
|
119
|
+
return Math.min(index, ROW_STAGGER_MAX) * ROW_STAGGER;
|
|
120
|
+
};
|
|
121
|
+
const markMounted = () => {
|
|
122
|
+
const frame = view()?.requestAnimationFrame(() => mounted = true);
|
|
123
|
+
return () => {
|
|
124
|
+
if (frame !== void 0) view()?.cancelAnimationFrame(frame);
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
return {
|
|
128
|
+
setOpen,
|
|
129
|
+
setValue,
|
|
130
|
+
submit,
|
|
131
|
+
dismiss,
|
|
132
|
+
enterDelay,
|
|
133
|
+
markMounted
|
|
134
|
+
};
|
|
135
|
+
},
|
|
136
|
+
slots: (slot) => ({
|
|
137
|
+
root: slot({
|
|
138
|
+
role: "group",
|
|
139
|
+
state: (state) => ({
|
|
140
|
+
open: state.open,
|
|
141
|
+
busy: state.busy
|
|
142
|
+
}),
|
|
143
|
+
attrs: (state) => ({
|
|
144
|
+
...openAttrs(state.open),
|
|
145
|
+
"data-busy": present(state.busy)
|
|
146
|
+
}),
|
|
147
|
+
bind: (_el, { api }) => api.markMounted()
|
|
148
|
+
}),
|
|
149
|
+
surface: slot({
|
|
150
|
+
attrs: (state) => openAttrs(state.open),
|
|
151
|
+
bind: (el, { api, store }) => {
|
|
152
|
+
let unbind;
|
|
153
|
+
const update = () => {
|
|
154
|
+
const { open } = store.get();
|
|
155
|
+
if (open && !unbind) unbind = bindLayer(el, { onDismiss: (reason, event) => api.dismiss(reason, event) });
|
|
156
|
+
else if (!open && unbind) {
|
|
157
|
+
unbind();
|
|
158
|
+
unbind = void 0;
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
update();
|
|
162
|
+
const unsubscribe = store.subscribe(update);
|
|
163
|
+
return () => {
|
|
164
|
+
unsubscribe();
|
|
165
|
+
unbind?.();
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
}),
|
|
169
|
+
panel: slot({
|
|
170
|
+
state: (state) => ({
|
|
171
|
+
open: state.open,
|
|
172
|
+
busy: state.busy
|
|
173
|
+
}),
|
|
174
|
+
attrs: (state) => openAttrs(state.open)
|
|
175
|
+
}),
|
|
176
|
+
form: slot({
|
|
177
|
+
role: "search",
|
|
178
|
+
on: { submit: (event, { api }) => {
|
|
179
|
+
event.preventDefault();
|
|
180
|
+
api.submit(event);
|
|
181
|
+
} }
|
|
182
|
+
}),
|
|
183
|
+
results: slot({
|
|
184
|
+
props: { filled: "boolean" },
|
|
185
|
+
attrs: (state, part) => {
|
|
186
|
+
const content = Boolean(part.props.filled) || state.busy;
|
|
187
|
+
return {
|
|
188
|
+
"data-content": present(content),
|
|
189
|
+
"data-filled": present(state.open && content)
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
}),
|
|
193
|
+
row: slot({
|
|
194
|
+
role: "listitem",
|
|
195
|
+
props: { id: "id" },
|
|
196
|
+
bind: (el, { api }) => {
|
|
197
|
+
const delay = api.enterDelay();
|
|
198
|
+
if (delay === void 0) return;
|
|
199
|
+
el.setAttribute("data-entering", "");
|
|
200
|
+
if (delay > 0) el.style.setProperty("--enter-delay", `${delay}ms`);
|
|
201
|
+
}
|
|
202
|
+
})
|
|
203
|
+
}),
|
|
204
|
+
agent: { actions: [
|
|
205
|
+
"setOpen",
|
|
206
|
+
"setValue",
|
|
207
|
+
"submit"
|
|
208
|
+
] }
|
|
209
|
+
});
|
|
210
|
+
const CommandDockHandle = createContext(null);
|
|
211
|
+
function useCommandDockHandle() {
|
|
212
|
+
const dock = use(CommandDockHandle);
|
|
213
|
+
if (!dock) throw new Error("CommandDock parts must be used within a CommandDock.");
|
|
214
|
+
return dock;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* The dock's state and the methods that change it, for a component inside
|
|
218
|
+
* `CommandDock`. It re-renders when the state changes.
|
|
219
|
+
*/
|
|
220
|
+
function useCommandDock() {
|
|
221
|
+
const $ = c(11);
|
|
222
|
+
const { handle } = useCommandDockHandle();
|
|
223
|
+
const state = usePrimitiveState(handle);
|
|
224
|
+
let t0;
|
|
225
|
+
let t1;
|
|
226
|
+
let t2;
|
|
227
|
+
if ($[0] !== handle) {
|
|
228
|
+
t0 = (open) => handle.api.setOpen(open);
|
|
229
|
+
t1 = (value) => handle.api.setValue(value);
|
|
230
|
+
t2 = () => handle.api.submit();
|
|
231
|
+
$[0] = handle;
|
|
232
|
+
$[1] = t0;
|
|
233
|
+
$[2] = t1;
|
|
234
|
+
$[3] = t2;
|
|
235
|
+
} else {
|
|
236
|
+
t0 = $[1];
|
|
237
|
+
t1 = $[2];
|
|
238
|
+
t2 = $[3];
|
|
239
|
+
}
|
|
240
|
+
let t3;
|
|
241
|
+
if ($[4] !== state.busy || $[5] !== state.open || $[6] !== state.value || $[7] !== t0 || $[8] !== t1 || $[9] !== t2) {
|
|
242
|
+
t3 = {
|
|
243
|
+
open: state.open,
|
|
244
|
+
value: state.value,
|
|
245
|
+
busy: state.busy,
|
|
246
|
+
setOpen: t0,
|
|
247
|
+
setValue: t1,
|
|
248
|
+
submit: t2
|
|
249
|
+
};
|
|
250
|
+
$[4] = state.busy;
|
|
251
|
+
$[5] = state.open;
|
|
252
|
+
$[6] = state.value;
|
|
253
|
+
$[7] = t0;
|
|
254
|
+
$[8] = t1;
|
|
255
|
+
$[9] = t2;
|
|
256
|
+
$[10] = t3;
|
|
257
|
+
} else t3 = $[10];
|
|
258
|
+
return t3;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* The root. The trigger and the panel inside it are one surface: closed, a
|
|
262
|
+
* pill `closedWidth` wide; open, it widens in place and grows downward as
|
|
263
|
+
* rows arrive. Escape and a press outside close it, and what was typed and
|
|
264
|
+
* the rows are kept.
|
|
265
|
+
*/
|
|
266
|
+
function CommandDock(t0) {
|
|
267
|
+
const $ = c(40);
|
|
268
|
+
let busy;
|
|
269
|
+
let children;
|
|
270
|
+
let className;
|
|
271
|
+
let defaultOpen;
|
|
272
|
+
let defaultValue;
|
|
273
|
+
let onOpenChange;
|
|
274
|
+
let onSubmit;
|
|
275
|
+
let onValueChange;
|
|
276
|
+
let open;
|
|
277
|
+
let props;
|
|
278
|
+
let style;
|
|
279
|
+
let t1;
|
|
280
|
+
let t2;
|
|
281
|
+
let value;
|
|
282
|
+
if ($[0] !== t0) {
|
|
283
|
+
({open, defaultOpen, onOpenChange, value, defaultValue, onValueChange, onSubmit, busy, closedWidth: t1, label: t2, className, style, children, ...props} = t0);
|
|
284
|
+
$[0] = t0;
|
|
285
|
+
$[1] = busy;
|
|
286
|
+
$[2] = children;
|
|
287
|
+
$[3] = className;
|
|
288
|
+
$[4] = defaultOpen;
|
|
289
|
+
$[5] = defaultValue;
|
|
290
|
+
$[6] = onOpenChange;
|
|
291
|
+
$[7] = onSubmit;
|
|
292
|
+
$[8] = onValueChange;
|
|
293
|
+
$[9] = open;
|
|
294
|
+
$[10] = props;
|
|
295
|
+
$[11] = style;
|
|
296
|
+
$[12] = t1;
|
|
297
|
+
$[13] = t2;
|
|
298
|
+
$[14] = value;
|
|
299
|
+
} else {
|
|
300
|
+
busy = $[1];
|
|
301
|
+
children = $[2];
|
|
302
|
+
className = $[3];
|
|
303
|
+
defaultOpen = $[4];
|
|
304
|
+
defaultValue = $[5];
|
|
305
|
+
onOpenChange = $[6];
|
|
306
|
+
onSubmit = $[7];
|
|
307
|
+
onValueChange = $[8];
|
|
308
|
+
open = $[9];
|
|
309
|
+
props = $[10];
|
|
310
|
+
style = $[11];
|
|
311
|
+
t1 = $[12];
|
|
312
|
+
t2 = $[13];
|
|
313
|
+
value = $[14];
|
|
314
|
+
}
|
|
315
|
+
const closedWidth = t1 === void 0 ? "9rem" : t1;
|
|
316
|
+
const label = t2 === void 0 ? "Command dock" : t2;
|
|
317
|
+
let t3;
|
|
318
|
+
if ($[15] !== busy || $[16] !== defaultOpen || $[17] !== defaultValue || $[18] !== onOpenChange || $[19] !== onSubmit || $[20] !== onValueChange || $[21] !== open || $[22] !== value) {
|
|
319
|
+
t3 = {
|
|
320
|
+
open,
|
|
321
|
+
defaultOpen,
|
|
322
|
+
onOpenChange,
|
|
323
|
+
value,
|
|
324
|
+
defaultValue,
|
|
325
|
+
onValueChange,
|
|
326
|
+
onSubmit,
|
|
327
|
+
busy
|
|
328
|
+
};
|
|
329
|
+
$[15] = busy;
|
|
330
|
+
$[16] = defaultOpen;
|
|
331
|
+
$[17] = defaultValue;
|
|
332
|
+
$[18] = onOpenChange;
|
|
333
|
+
$[19] = onSubmit;
|
|
334
|
+
$[20] = onValueChange;
|
|
335
|
+
$[21] = open;
|
|
336
|
+
$[22] = value;
|
|
337
|
+
$[23] = t3;
|
|
338
|
+
} else t3 = $[23];
|
|
339
|
+
const handle = (0, core_exports.usePrimitive)(commandDock, t3);
|
|
340
|
+
const panelId = useId();
|
|
341
|
+
let t4;
|
|
342
|
+
if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
|
|
343
|
+
t4 = {};
|
|
344
|
+
$[24] = t4;
|
|
345
|
+
} else t4 = $[24];
|
|
346
|
+
let t5;
|
|
347
|
+
if ($[25] !== className) {
|
|
348
|
+
t5 = cnState("relative flex w-full justify-center", className);
|
|
349
|
+
$[25] = className;
|
|
350
|
+
$[26] = t5;
|
|
351
|
+
} else t5 = $[26];
|
|
352
|
+
let t6;
|
|
353
|
+
if ($[27] !== closedWidth || $[28] !== style) {
|
|
354
|
+
t6 = (state) => ({
|
|
355
|
+
"--command-dock-closed-width": closedWidth,
|
|
356
|
+
...typeof style === "function" ? style(state) : style
|
|
357
|
+
});
|
|
358
|
+
$[27] = closedWidth;
|
|
359
|
+
$[28] = style;
|
|
360
|
+
$[29] = t6;
|
|
361
|
+
} else t6 = $[29];
|
|
362
|
+
let t7;
|
|
363
|
+
if ($[30] !== children || $[31] !== handle || $[32] !== panelId) {
|
|
364
|
+
t7 = (state_0) => /* @__PURE__ */ jsx(CommandDockHandle, {
|
|
365
|
+
value: {
|
|
366
|
+
handle,
|
|
367
|
+
panelId
|
|
368
|
+
},
|
|
369
|
+
children: /* @__PURE__ */ jsx(CommandDockSurface, { children: typeof children === "function" ? children(state_0) : children })
|
|
370
|
+
});
|
|
371
|
+
$[30] = children;
|
|
372
|
+
$[31] = handle;
|
|
373
|
+
$[32] = panelId;
|
|
374
|
+
$[33] = t7;
|
|
375
|
+
} else t7 = $[33];
|
|
376
|
+
let t8;
|
|
377
|
+
if ($[34] !== label || $[35] !== props || $[36] !== t5 || $[37] !== t6 || $[38] !== t7) {
|
|
378
|
+
t8 = {
|
|
379
|
+
"aria-label": label,
|
|
380
|
+
className: t5,
|
|
381
|
+
style: t6,
|
|
382
|
+
children: t7,
|
|
383
|
+
...props
|
|
384
|
+
};
|
|
385
|
+
$[34] = label;
|
|
386
|
+
$[35] = props;
|
|
387
|
+
$[36] = t5;
|
|
388
|
+
$[37] = t6;
|
|
389
|
+
$[38] = t7;
|
|
390
|
+
$[39] = t8;
|
|
391
|
+
} else t8 = $[39];
|
|
392
|
+
return (0, core_exports.usePart)(handle, "root", t4, t8, "div");
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* The one surface the trigger and the panel share. Both widths are real
|
|
396
|
+
* lengths, so the change between them animates; `auto` can't. Closing, the
|
|
397
|
+
* rows fold first and the surface narrows after them.
|
|
398
|
+
*/
|
|
399
|
+
function CommandDockSurface(t0) {
|
|
400
|
+
const $ = c(4);
|
|
401
|
+
const { children } = t0;
|
|
402
|
+
let t1;
|
|
403
|
+
let t2;
|
|
404
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
405
|
+
t1 = {};
|
|
406
|
+
t2 = cn("group/command-dock overflow-hidden border border-input bg-card text-card-foreground focus-ring-field", "transition-[width,border-radius,box-shadow] duration-modal ease-out motion-reduce:transition-none", "data-open:w-[min(100%,28rem)] data-open:rounded-3xl data-open:shadow-md", "data-closed:w-(--command-dock-closed-width) data-closed:rounded-[1.375rem] data-closed:shadow-sm", "data-closed:has-[[data-content]]:delay-(--transition-duration-popup)");
|
|
407
|
+
$[0] = t1;
|
|
408
|
+
$[1] = t2;
|
|
409
|
+
} else {
|
|
410
|
+
t1 = $[0];
|
|
411
|
+
t2 = $[1];
|
|
412
|
+
}
|
|
413
|
+
let t3;
|
|
414
|
+
if ($[2] !== children) {
|
|
415
|
+
t3 = {
|
|
416
|
+
className: t2,
|
|
417
|
+
children
|
|
418
|
+
};
|
|
419
|
+
$[2] = children;
|
|
420
|
+
$[3] = t3;
|
|
421
|
+
} else t3 = $[3];
|
|
422
|
+
return (0, core_exports.usePart)(commandDock, "surface", t1, t3, "div");
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* The closed form: a button with the app's label that opens the dock. It
|
|
426
|
+
* keeps its row while the dock is open, faded out and inert, so the surface
|
|
427
|
+
* is never shorter than one row.
|
|
428
|
+
*/
|
|
429
|
+
function CommandDockTrigger(t0) {
|
|
430
|
+
const $ = c(19);
|
|
431
|
+
let children;
|
|
432
|
+
let className;
|
|
433
|
+
let onClick;
|
|
434
|
+
let props;
|
|
435
|
+
if ($[0] !== t0) {
|
|
436
|
+
({className, onClick, children, ...props} = t0);
|
|
437
|
+
$[0] = t0;
|
|
438
|
+
$[1] = children;
|
|
439
|
+
$[2] = className;
|
|
440
|
+
$[3] = onClick;
|
|
441
|
+
$[4] = props;
|
|
442
|
+
} else {
|
|
443
|
+
children = $[1];
|
|
444
|
+
className = $[2];
|
|
445
|
+
onClick = $[3];
|
|
446
|
+
props = $[4];
|
|
447
|
+
}
|
|
448
|
+
const { handle, panelId } = useCommandDockHandle();
|
|
449
|
+
const { open } = usePrimitiveState(handle);
|
|
450
|
+
let t1;
|
|
451
|
+
if ($[5] !== className) {
|
|
452
|
+
t1 = cnState("flex h-11 w-full cursor-pointer items-center justify-center rounded-[inherit] px-4 text-sm font-medium whitespace-nowrap select-none focus-ring-inset press hover:bg-accent", className);
|
|
453
|
+
$[5] = className;
|
|
454
|
+
$[6] = t1;
|
|
455
|
+
} else t1 = $[6];
|
|
456
|
+
let t2;
|
|
457
|
+
if ($[7] !== handle || $[8] !== onClick) {
|
|
458
|
+
t2 = (event, details) => {
|
|
459
|
+
const result = onClick?.(event, details);
|
|
460
|
+
if (!event.defaultPrevented) handle.api.setOpen(true, {
|
|
461
|
+
reason: "trigger-press",
|
|
462
|
+
event: event.nativeEvent,
|
|
463
|
+
source: details.source
|
|
464
|
+
});
|
|
465
|
+
return result;
|
|
466
|
+
};
|
|
467
|
+
$[7] = handle;
|
|
468
|
+
$[8] = onClick;
|
|
469
|
+
$[9] = t2;
|
|
470
|
+
} else t2 = $[9];
|
|
471
|
+
let t3;
|
|
472
|
+
if ($[10] !== children) {
|
|
473
|
+
t3 = /* @__PURE__ */ jsx("span", {
|
|
474
|
+
"data-slot": "command-dock-trigger-label",
|
|
475
|
+
className: "flex min-w-0 items-center justify-center gap-2 transition-opacity ease-out group-data-closed/command-dock:delay-(--transition-duration-popup) group-data-closed/command-dock:duration-popup group-data-open/command-dock:opacity-0 group-data-open/command-dock:duration-quick motion-reduce:transition-none [&_svg]:shrink-0",
|
|
476
|
+
children
|
|
477
|
+
});
|
|
478
|
+
$[10] = children;
|
|
479
|
+
$[11] = t3;
|
|
480
|
+
} else t3 = $[11];
|
|
481
|
+
let t4;
|
|
482
|
+
if ($[12] !== open || $[13] !== panelId || $[14] !== props || $[15] !== t1 || $[16] !== t2 || $[17] !== t3) {
|
|
483
|
+
t4 = /* @__PURE__ */ jsx(Button, {
|
|
484
|
+
"aria-expanded": open,
|
|
485
|
+
"aria-controls": panelId,
|
|
486
|
+
inert: open,
|
|
487
|
+
className: t1,
|
|
488
|
+
onClick: t2,
|
|
489
|
+
...props,
|
|
490
|
+
children: t3
|
|
491
|
+
});
|
|
492
|
+
$[12] = open;
|
|
493
|
+
$[13] = panelId;
|
|
494
|
+
$[14] = props;
|
|
495
|
+
$[15] = t1;
|
|
496
|
+
$[16] = t2;
|
|
497
|
+
$[17] = t3;
|
|
498
|
+
$[18] = t4;
|
|
499
|
+
} else t4 = $[18];
|
|
500
|
+
return t4;
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* The open form: the field, and the rows under it. It stays in the page
|
|
504
|
+
* while closed, folded away and inert, so closing can be seen and the text
|
|
505
|
+
* and the rows are still there when it opens again.
|
|
506
|
+
*/
|
|
507
|
+
function CommandDockPanel(t0) {
|
|
508
|
+
const $ = c(11);
|
|
509
|
+
let className;
|
|
510
|
+
let props;
|
|
511
|
+
if ($[0] !== t0) {
|
|
512
|
+
({className, ...props} = t0);
|
|
513
|
+
$[0] = t0;
|
|
514
|
+
$[1] = className;
|
|
515
|
+
$[2] = props;
|
|
516
|
+
} else {
|
|
517
|
+
className = $[1];
|
|
518
|
+
props = $[2];
|
|
519
|
+
}
|
|
520
|
+
const { handle, panelId } = useCommandDockHandle();
|
|
521
|
+
const { open } = usePrimitiveState(handle);
|
|
522
|
+
let t1;
|
|
523
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
524
|
+
t1 = {};
|
|
525
|
+
$[3] = t1;
|
|
526
|
+
} else t1 = $[3];
|
|
527
|
+
const t2 = !open;
|
|
528
|
+
let t3;
|
|
529
|
+
if ($[4] !== className) {
|
|
530
|
+
t3 = cnState("-mt-11 flex flex-col", className);
|
|
531
|
+
$[4] = className;
|
|
532
|
+
$[5] = t3;
|
|
533
|
+
} else t3 = $[5];
|
|
534
|
+
let t4;
|
|
535
|
+
if ($[6] !== panelId || $[7] !== props || $[8] !== t2 || $[9] !== t3) {
|
|
536
|
+
t4 = {
|
|
537
|
+
id: panelId,
|
|
538
|
+
inert: t2,
|
|
539
|
+
className: t3,
|
|
540
|
+
...props
|
|
541
|
+
};
|
|
542
|
+
$[6] = panelId;
|
|
543
|
+
$[7] = props;
|
|
544
|
+
$[8] = t2;
|
|
545
|
+
$[9] = t3;
|
|
546
|
+
$[10] = t4;
|
|
547
|
+
} else t4 = $[10];
|
|
548
|
+
return (0, core_exports.usePart)(commandDock, "panel", t1, t4, "div");
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* The field, with a button that sends what is in it. Enter sends too. Name
|
|
552
|
+
* the field with `aria-label` in words the trigger's label doesn't hold: a
|
|
553
|
+
* placeholder isn't a name, and an agent finds each control by its own.
|
|
554
|
+
*/
|
|
555
|
+
function CommandDockInput(t0) {
|
|
556
|
+
const $ = c(31);
|
|
557
|
+
let className;
|
|
558
|
+
let onKeyDown;
|
|
559
|
+
let props;
|
|
560
|
+
let t1;
|
|
561
|
+
let t2;
|
|
562
|
+
if ($[0] !== t0) {
|
|
563
|
+
({className, submitLabel: t1, "aria-label": t2, onKeyDown, ...props} = t0);
|
|
564
|
+
$[0] = t0;
|
|
565
|
+
$[1] = className;
|
|
566
|
+
$[2] = onKeyDown;
|
|
567
|
+
$[3] = props;
|
|
568
|
+
$[4] = t1;
|
|
569
|
+
$[5] = t2;
|
|
570
|
+
} else {
|
|
571
|
+
className = $[1];
|
|
572
|
+
onKeyDown = $[2];
|
|
573
|
+
props = $[3];
|
|
574
|
+
t1 = $[4];
|
|
575
|
+
t2 = $[5];
|
|
576
|
+
}
|
|
577
|
+
const submitLabel = t1 === void 0 ? "Send" : t1;
|
|
578
|
+
const ariaLabel = t2 === void 0 ? "Query" : t2;
|
|
579
|
+
const { handle } = useCommandDockHandle();
|
|
580
|
+
const { value, busy } = usePrimitiveState(handle);
|
|
581
|
+
let t3;
|
|
582
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
583
|
+
t3 = {};
|
|
584
|
+
$[6] = t3;
|
|
585
|
+
} else t3 = $[6];
|
|
586
|
+
let t4;
|
|
587
|
+
if ($[7] !== handle.api) {
|
|
588
|
+
t4 = (text, details) => {
|
|
589
|
+
handle.api.setValue(text, {
|
|
590
|
+
reason: details.reason,
|
|
591
|
+
event: details.event,
|
|
592
|
+
source: details.source
|
|
593
|
+
});
|
|
594
|
+
};
|
|
595
|
+
$[7] = handle.api;
|
|
596
|
+
$[8] = t4;
|
|
597
|
+
} else t4 = $[8];
|
|
598
|
+
let t5;
|
|
599
|
+
if ($[9] !== onKeyDown) {
|
|
600
|
+
t5 = (event) => {
|
|
601
|
+
onKeyDown?.(event);
|
|
602
|
+
if (event.key === "Enter" && isComposing(event)) event.preventDefault();
|
|
603
|
+
};
|
|
604
|
+
$[9] = onKeyDown;
|
|
605
|
+
$[10] = t5;
|
|
606
|
+
} else t5 = $[10];
|
|
607
|
+
let t6;
|
|
608
|
+
if ($[11] !== className) {
|
|
609
|
+
t6 = cnState("h-full min-w-0 flex-1 bg-transparent text-base outline-none placeholder:text-placeholder md:text-sm", className);
|
|
610
|
+
$[11] = className;
|
|
611
|
+
$[12] = t6;
|
|
612
|
+
} else t6 = $[12];
|
|
613
|
+
let t7;
|
|
614
|
+
if ($[13] !== ariaLabel || $[14] !== props || $[15] !== t4 || $[16] !== t5 || $[17] !== t6 || $[18] !== value) {
|
|
615
|
+
t7 = /* @__PURE__ */ jsx(Input, {
|
|
616
|
+
type: "text",
|
|
617
|
+
enterKeyHint: "send",
|
|
618
|
+
"aria-label": ariaLabel,
|
|
619
|
+
value,
|
|
620
|
+
onValueChange: t4,
|
|
621
|
+
onKeyDown: t5,
|
|
622
|
+
className: t6,
|
|
623
|
+
...props
|
|
624
|
+
});
|
|
625
|
+
$[13] = ariaLabel;
|
|
626
|
+
$[14] = props;
|
|
627
|
+
$[15] = t4;
|
|
628
|
+
$[16] = t5;
|
|
629
|
+
$[17] = t6;
|
|
630
|
+
$[18] = value;
|
|
631
|
+
$[19] = t7;
|
|
632
|
+
} else t7 = $[19];
|
|
633
|
+
let t8;
|
|
634
|
+
if ($[20] !== busy || $[21] !== value) {
|
|
635
|
+
t8 = busy || value.trim() === "";
|
|
636
|
+
$[20] = busy;
|
|
637
|
+
$[21] = value;
|
|
638
|
+
$[22] = t8;
|
|
639
|
+
} else t8 = $[22];
|
|
640
|
+
let t10;
|
|
641
|
+
let t9;
|
|
642
|
+
if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
|
|
643
|
+
t9 = cn(buttonVariants({ size: "icon-sm" }), "shrink-0 rounded-full");
|
|
644
|
+
t10 = /* @__PURE__ */ jsx(Icon, { icon: ArrowUp02Icon });
|
|
645
|
+
$[23] = t10;
|
|
646
|
+
$[24] = t9;
|
|
647
|
+
} else {
|
|
648
|
+
t10 = $[23];
|
|
649
|
+
t9 = $[24];
|
|
650
|
+
}
|
|
651
|
+
let t11;
|
|
652
|
+
if ($[25] !== submitLabel || $[26] !== t8) {
|
|
653
|
+
t11 = /* @__PURE__ */ jsx(Button, {
|
|
654
|
+
type: "submit",
|
|
655
|
+
"aria-label": submitLabel,
|
|
656
|
+
disabled: t8,
|
|
657
|
+
focusableWhenDisabled: true,
|
|
658
|
+
className: t9,
|
|
659
|
+
children: t10
|
|
660
|
+
});
|
|
661
|
+
$[25] = submitLabel;
|
|
662
|
+
$[26] = t8;
|
|
663
|
+
$[27] = t11;
|
|
664
|
+
} else t11 = $[27];
|
|
665
|
+
let t12;
|
|
666
|
+
if ($[28] !== t11 || $[29] !== t7) {
|
|
667
|
+
t12 = {
|
|
668
|
+
className: "flex h-11 items-center gap-2 ps-4 pe-2 transition-opacity ease-out group-data-closed/command-dock:opacity-0 group-data-closed/command-dock:duration-quick group-data-open/command-dock:delay-(--transition-duration-quick) group-data-open/command-dock:duration-popup motion-reduce:transition-none",
|
|
669
|
+
children: /* @__PURE__ */ jsxs(Fragment$1, { children: [t7, t11] })
|
|
670
|
+
};
|
|
671
|
+
$[28] = t11;
|
|
672
|
+
$[29] = t7;
|
|
673
|
+
$[30] = t12;
|
|
674
|
+
} else t12 = $[30];
|
|
675
|
+
return (0, core_exports.usePart)(commandDock, "form", t3, t12, "form");
|
|
676
|
+
}
|
|
677
|
+
/**
|
|
678
|
+
* Where the rows go. It takes no room until there is a row or the dock is
|
|
679
|
+
* busy, and folds away what it holds while the dock is closed. Rows are read
|
|
680
|
+
* out as they arrive, without cutting in on typing.
|
|
681
|
+
*/
|
|
682
|
+
function CommandDockResults(t0) {
|
|
683
|
+
const $ = c(16);
|
|
684
|
+
let children;
|
|
685
|
+
let className;
|
|
686
|
+
let props;
|
|
687
|
+
let t1;
|
|
688
|
+
if ($[0] !== t0) {
|
|
689
|
+
({label: t1, className, children, ...props} = t0);
|
|
690
|
+
$[0] = t0;
|
|
691
|
+
$[1] = children;
|
|
692
|
+
$[2] = className;
|
|
693
|
+
$[3] = props;
|
|
694
|
+
$[4] = t1;
|
|
695
|
+
} else {
|
|
696
|
+
children = $[1];
|
|
697
|
+
className = $[2];
|
|
698
|
+
props = $[3];
|
|
699
|
+
t1 = $[4];
|
|
700
|
+
}
|
|
701
|
+
const label = t1 === void 0 ? "Results" : t1;
|
|
702
|
+
let t2;
|
|
703
|
+
if ($[5] !== children) {
|
|
704
|
+
t2 = Children.toArray(children);
|
|
705
|
+
$[5] = children;
|
|
706
|
+
$[6] = t2;
|
|
707
|
+
} else t2 = $[6];
|
|
708
|
+
const t3 = t2.length > 0;
|
|
709
|
+
let t4;
|
|
710
|
+
if ($[7] !== t3) {
|
|
711
|
+
t4 = { filled: t3 };
|
|
712
|
+
$[7] = t3;
|
|
713
|
+
$[8] = t4;
|
|
714
|
+
} else t4 = $[8];
|
|
715
|
+
let t5;
|
|
716
|
+
if ($[9] !== className) {
|
|
717
|
+
t5 = cn("flex flex-col gap-0.5 border-t p-1.5", className);
|
|
718
|
+
$[9] = className;
|
|
719
|
+
$[10] = t5;
|
|
720
|
+
} else t5 = $[10];
|
|
721
|
+
let t6;
|
|
722
|
+
if ($[11] !== children || $[12] !== label || $[13] !== props || $[14] !== t5) {
|
|
723
|
+
t6 = {
|
|
724
|
+
className: "grid grid-rows-[0fr] transition-[grid-template-rows] duration-popup ease-out data-filled:grid-rows-[1fr] group-data-open/command-dock:delay-(--transition-duration-quick) motion-reduce:transition-none",
|
|
725
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
726
|
+
"data-slot": "command-dock-results-clip",
|
|
727
|
+
className: "min-h-0 overflow-hidden",
|
|
728
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
729
|
+
"data-slot": "command-dock-list",
|
|
730
|
+
role: "list",
|
|
731
|
+
"aria-label": label,
|
|
732
|
+
"aria-live": "polite",
|
|
733
|
+
className: t5,
|
|
734
|
+
...props,
|
|
735
|
+
children
|
|
736
|
+
})
|
|
737
|
+
})
|
|
738
|
+
};
|
|
739
|
+
$[11] = children;
|
|
740
|
+
$[12] = label;
|
|
741
|
+
$[13] = props;
|
|
742
|
+
$[14] = t5;
|
|
743
|
+
$[15] = t6;
|
|
744
|
+
} else t6 = $[15];
|
|
745
|
+
return (0, core_exports.usePart)(commandDock, "results", t4, t6, "div");
|
|
746
|
+
}
|
|
747
|
+
const rowClasses = "flex w-full items-center gap-3 rounded-xl px-2.5 py-2 text-start text-sm [&_svg]:shrink-0 [&_svg]:text-muted-foreground";
|
|
748
|
+
/**
|
|
749
|
+
* One row of the answer. A row added while the dock is on the page slides
|
|
750
|
+
* in, and rows added together enter one after another.
|
|
751
|
+
*/
|
|
752
|
+
function CommandDockRow(t0) {
|
|
753
|
+
const $ = c(16);
|
|
754
|
+
let children;
|
|
755
|
+
let className;
|
|
756
|
+
let disabled;
|
|
757
|
+
let onSelect;
|
|
758
|
+
let props;
|
|
759
|
+
if ($[0] !== t0) {
|
|
760
|
+
({onSelect, disabled, className, children, ...props} = t0);
|
|
761
|
+
$[0] = t0;
|
|
762
|
+
$[1] = children;
|
|
763
|
+
$[2] = className;
|
|
764
|
+
$[3] = disabled;
|
|
765
|
+
$[4] = onSelect;
|
|
766
|
+
$[5] = props;
|
|
767
|
+
} else {
|
|
768
|
+
children = $[1];
|
|
769
|
+
className = $[2];
|
|
770
|
+
disabled = $[3];
|
|
771
|
+
onSelect = $[4];
|
|
772
|
+
props = $[5];
|
|
773
|
+
}
|
|
774
|
+
let t1;
|
|
775
|
+
if ($[6] !== props.id) {
|
|
776
|
+
t1 = { id: props.id };
|
|
777
|
+
$[6] = props.id;
|
|
778
|
+
$[7] = t1;
|
|
779
|
+
} else t1 = $[7];
|
|
780
|
+
let t2;
|
|
781
|
+
if ($[8] !== children || $[9] !== className || $[10] !== disabled || $[11] !== onSelect) {
|
|
782
|
+
t2 = onSelect ? /* @__PURE__ */ jsx(Button, {
|
|
783
|
+
disabled,
|
|
784
|
+
onClick: () => onSelect(),
|
|
785
|
+
className: cn(rowClasses, "cursor-pointer focus-ring-inset press hover:bg-accent data-disabled:pointer-events-none data-disabled:opacity-50", className),
|
|
786
|
+
children
|
|
787
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
788
|
+
"data-slot": "command-dock-row-content",
|
|
789
|
+
className: cn(rowClasses, className),
|
|
790
|
+
children
|
|
791
|
+
});
|
|
792
|
+
$[8] = children;
|
|
793
|
+
$[9] = className;
|
|
794
|
+
$[10] = disabled;
|
|
795
|
+
$[11] = onSelect;
|
|
796
|
+
$[12] = t2;
|
|
797
|
+
} else t2 = $[12];
|
|
798
|
+
let t3;
|
|
799
|
+
if ($[13] !== props || $[14] !== t2) {
|
|
800
|
+
t3 = {
|
|
801
|
+
className: "data-entering:motion-enter",
|
|
802
|
+
children: t2,
|
|
803
|
+
...props
|
|
804
|
+
};
|
|
805
|
+
$[13] = props;
|
|
806
|
+
$[14] = t2;
|
|
807
|
+
$[15] = t3;
|
|
808
|
+
} else t3 = $[15];
|
|
809
|
+
return (0, core_exports.usePart)(commandDock, "row", t1, t3, "div");
|
|
810
|
+
}
|
|
811
|
+
/** What the row is. It takes the width the row has spare and is cut to one line. */
|
|
812
|
+
function CommandDockRowTitle(t0) {
|
|
813
|
+
const $ = c(8);
|
|
814
|
+
let className;
|
|
815
|
+
let props;
|
|
816
|
+
if ($[0] !== t0) {
|
|
817
|
+
({className, ...props} = t0);
|
|
818
|
+
$[0] = t0;
|
|
819
|
+
$[1] = className;
|
|
820
|
+
$[2] = props;
|
|
821
|
+
} else {
|
|
822
|
+
className = $[1];
|
|
823
|
+
props = $[2];
|
|
824
|
+
}
|
|
825
|
+
let t1;
|
|
826
|
+
if ($[3] !== className) {
|
|
827
|
+
t1 = cn("min-w-0 flex-1 truncate font-medium", className);
|
|
828
|
+
$[3] = className;
|
|
829
|
+
$[4] = t1;
|
|
830
|
+
} else t1 = $[4];
|
|
831
|
+
let t2;
|
|
832
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
833
|
+
t2 = /* @__PURE__ */ jsx("span", {
|
|
834
|
+
"data-slot": "command-dock-row-title",
|
|
835
|
+
className: t1,
|
|
836
|
+
...props
|
|
837
|
+
});
|
|
838
|
+
$[5] = props;
|
|
839
|
+
$[6] = t1;
|
|
840
|
+
$[7] = t2;
|
|
841
|
+
} else t2 = $[7];
|
|
842
|
+
return t2;
|
|
843
|
+
}
|
|
844
|
+
/** Something short at the end of the row, quieter than its title. It keeps its width. */
|
|
845
|
+
function CommandDockRowMeta(t0) {
|
|
846
|
+
const $ = c(8);
|
|
847
|
+
let className;
|
|
848
|
+
let props;
|
|
849
|
+
if ($[0] !== t0) {
|
|
850
|
+
({className, ...props} = t0);
|
|
851
|
+
$[0] = t0;
|
|
852
|
+
$[1] = className;
|
|
853
|
+
$[2] = props;
|
|
854
|
+
} else {
|
|
855
|
+
className = $[1];
|
|
856
|
+
props = $[2];
|
|
857
|
+
}
|
|
858
|
+
let t1;
|
|
859
|
+
if ($[3] !== className) {
|
|
860
|
+
t1 = cn("shrink-0 text-muted-foreground", className);
|
|
861
|
+
$[3] = className;
|
|
862
|
+
$[4] = t1;
|
|
863
|
+
} else t1 = $[4];
|
|
864
|
+
let t2;
|
|
865
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
866
|
+
t2 = /* @__PURE__ */ jsx("span", {
|
|
867
|
+
"data-slot": "command-dock-row-meta",
|
|
868
|
+
className: t1,
|
|
869
|
+
...props
|
|
870
|
+
});
|
|
871
|
+
$[5] = props;
|
|
872
|
+
$[6] = t1;
|
|
873
|
+
$[7] = t2;
|
|
874
|
+
} else t2 = $[7];
|
|
875
|
+
return t2;
|
|
876
|
+
}
|
|
877
|
+
const dotClasses = "size-1 animate-pulse rounded-full bg-muted-foreground motion-reduce:animate-none";
|
|
878
|
+
/**
|
|
879
|
+
* Three dots and a few words, for while an answer is on its way. It goes
|
|
880
|
+
* last in `CommandDockResults`, while the dock is `busy`. Children replace
|
|
881
|
+
* "Working".
|
|
882
|
+
*/
|
|
883
|
+
function CommandDockStatus(t0) {
|
|
884
|
+
const $ = c(13);
|
|
885
|
+
let className;
|
|
886
|
+
let props;
|
|
887
|
+
let t1;
|
|
888
|
+
if ($[0] !== t0) {
|
|
889
|
+
({className, children: t1, ...props} = t0);
|
|
890
|
+
$[0] = t0;
|
|
891
|
+
$[1] = className;
|
|
892
|
+
$[2] = props;
|
|
893
|
+
$[3] = t1;
|
|
894
|
+
} else {
|
|
895
|
+
className = $[1];
|
|
896
|
+
props = $[2];
|
|
897
|
+
t1 = $[3];
|
|
898
|
+
}
|
|
899
|
+
const children = t1 === void 0 ? "Working" : t1;
|
|
900
|
+
let t2;
|
|
901
|
+
if ($[4] !== className) {
|
|
902
|
+
t2 = cn("flex items-center gap-2 px-2.5 py-2 text-sm text-muted-foreground", className);
|
|
903
|
+
$[4] = className;
|
|
904
|
+
$[5] = t2;
|
|
905
|
+
} else t2 = $[5];
|
|
906
|
+
let t3;
|
|
907
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
908
|
+
t3 = /* @__PURE__ */ jsxs("span", {
|
|
909
|
+
"aria-hidden": "true",
|
|
910
|
+
className: "flex gap-1",
|
|
911
|
+
children: [
|
|
912
|
+
/* @__PURE__ */ jsx("span", { className: dotClasses }),
|
|
913
|
+
/* @__PURE__ */ jsx("span", { className: cn(dotClasses, "[animation-delay:var(--transition-duration-quick)]") }),
|
|
914
|
+
/* @__PURE__ */ jsx("span", { className: cn(dotClasses, "[animation-delay:var(--transition-duration-modal)]") })
|
|
915
|
+
]
|
|
916
|
+
});
|
|
917
|
+
$[6] = t3;
|
|
918
|
+
} else t3 = $[6];
|
|
919
|
+
let t4;
|
|
920
|
+
if ($[7] !== children) {
|
|
921
|
+
t4 = /* @__PURE__ */ jsx("span", {
|
|
922
|
+
role: "status",
|
|
923
|
+
children
|
|
924
|
+
});
|
|
925
|
+
$[7] = children;
|
|
926
|
+
$[8] = t4;
|
|
927
|
+
} else t4 = $[8];
|
|
928
|
+
let t5;
|
|
929
|
+
if ($[9] !== props || $[10] !== t2 || $[11] !== t4) {
|
|
930
|
+
t5 = /* @__PURE__ */ jsxs("div", {
|
|
931
|
+
"data-slot": "command-dock-status",
|
|
932
|
+
role: "listitem",
|
|
933
|
+
className: t2,
|
|
934
|
+
...props,
|
|
935
|
+
children: [t3, t4]
|
|
936
|
+
});
|
|
937
|
+
$[9] = props;
|
|
938
|
+
$[10] = t2;
|
|
939
|
+
$[11] = t4;
|
|
940
|
+
$[12] = t5;
|
|
941
|
+
} else t5 = $[12];
|
|
942
|
+
return t5;
|
|
943
|
+
}
|
|
944
|
+
export { CommandDock, CommandDockInput, CommandDockPanel, CommandDockResults, CommandDockRow, CommandDockRowMeta, CommandDockRowTitle, CommandDockStatus, CommandDockTrigger, useCommandDock };
|