@asanchez-sa/abby 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +245 -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 +337 -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 +687 -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,258 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cnState } from "../../utilities/cn/index.js";
|
|
3
|
+
import { Icon } from "../icon/icon.js";
|
|
4
|
+
import { LinkPart } from "../link/link.js";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { ArrowRight01Icon, Loading03Icon, MinusSignIcon, RefreshIcon, Tick02Icon } from "@hugeicons/core-free-icons";
|
|
8
|
+
import { Tree as Tree$1, TreeGroup as TreeGroup$1, TreeItem as TreeItem$1, TreeItemCheckbox as TreeItemCheckbox$1, TreeItemIndicator as TreeItemIndicator$1, TreeItemLabel as TreeItemLabel$1, createTreeController, toggleTreeChecked, treeCheckedStates, treeFromPaths, visibleTreeRows } from "@ui-sdk/react/tree";
|
|
9
|
+
// src/components/tree/tree.tsx
|
|
10
|
+
/** The tree's `items`, as styled parts. */
|
|
11
|
+
function dataItems(items, checkable) {
|
|
12
|
+
return items.map((item) => /* @__PURE__ */ jsxs(TreeItem, {
|
|
13
|
+
value: item.value,
|
|
14
|
+
disabled: item.disabled,
|
|
15
|
+
children: [/* @__PURE__ */ jsxs(TreeItemLabel, {
|
|
16
|
+
render: item.href ? /* @__PURE__ */ jsx(LinkPart, { href: item.href }) : void 0,
|
|
17
|
+
children: [
|
|
18
|
+
item.children && /* @__PURE__ */ jsx(TreeItemIndicator, {}),
|
|
19
|
+
checkable && /* @__PURE__ */ jsx(TreeItemCheckbox, {}),
|
|
20
|
+
/* @__PURE__ */ jsx("span", {
|
|
21
|
+
className: "min-w-0 truncate",
|
|
22
|
+
children: item.label
|
|
23
|
+
})
|
|
24
|
+
]
|
|
25
|
+
}), item.children && /* @__PURE__ */ jsx(TreeGroup, { children: dataItems(item.children, checkable) })]
|
|
26
|
+
}, item.value));
|
|
27
|
+
}
|
|
28
|
+
/** Without children it renders its `items` or `paths`, each row with its arrow and, with `checkable`, its checkbox. */
|
|
29
|
+
function Tree(t0) {
|
|
30
|
+
const $ = c(12);
|
|
31
|
+
let T0;
|
|
32
|
+
let t1;
|
|
33
|
+
let t2;
|
|
34
|
+
let t3;
|
|
35
|
+
if ($[0] !== t0) {
|
|
36
|
+
const { className, children, ...props } = t0;
|
|
37
|
+
const data = props.items ?? (props.paths ? treeFromPaths(props.paths) : void 0);
|
|
38
|
+
T0 = Tree$1;
|
|
39
|
+
if ($[5] !== className) {
|
|
40
|
+
t1 = cnState("flex w-full flex-col gap-0.5 text-sm", className);
|
|
41
|
+
$[5] = className;
|
|
42
|
+
$[6] = t1;
|
|
43
|
+
} else t1 = $[6];
|
|
44
|
+
t2 = props;
|
|
45
|
+
t3 = children ?? (data ? dataItems(data, props.checkable) : null);
|
|
46
|
+
$[0] = t0;
|
|
47
|
+
$[1] = T0;
|
|
48
|
+
$[2] = t1;
|
|
49
|
+
$[3] = t2;
|
|
50
|
+
$[4] = t3;
|
|
51
|
+
} else {
|
|
52
|
+
T0 = $[1];
|
|
53
|
+
t1 = $[2];
|
|
54
|
+
t2 = $[3];
|
|
55
|
+
t3 = $[4];
|
|
56
|
+
}
|
|
57
|
+
let t4;
|
|
58
|
+
if ($[7] !== T0 || $[8] !== t1 || $[9] !== t2 || $[10] !== t3) {
|
|
59
|
+
t4 = /* @__PURE__ */ jsx(T0, {
|
|
60
|
+
className: t1,
|
|
61
|
+
...t2,
|
|
62
|
+
children: t3
|
|
63
|
+
});
|
|
64
|
+
$[7] = T0;
|
|
65
|
+
$[8] = t1;
|
|
66
|
+
$[9] = t2;
|
|
67
|
+
$[10] = t3;
|
|
68
|
+
$[11] = t4;
|
|
69
|
+
} else t4 = $[11];
|
|
70
|
+
return t4;
|
|
71
|
+
}
|
|
72
|
+
function TreeItem(t0) {
|
|
73
|
+
const $ = c(8);
|
|
74
|
+
let className;
|
|
75
|
+
let props;
|
|
76
|
+
if ($[0] !== t0) {
|
|
77
|
+
({className, ...props} = t0);
|
|
78
|
+
$[0] = t0;
|
|
79
|
+
$[1] = className;
|
|
80
|
+
$[2] = props;
|
|
81
|
+
} else {
|
|
82
|
+
className = $[1];
|
|
83
|
+
props = $[2];
|
|
84
|
+
}
|
|
85
|
+
let t1;
|
|
86
|
+
if ($[3] !== className) {
|
|
87
|
+
t1 = cnState("flex flex-col outline-none [&:focus-visible>[data-slot=tree-label]]:outline-[color:var(--focus-ring,var(--ring))]", className);
|
|
88
|
+
$[3] = className;
|
|
89
|
+
$[4] = t1;
|
|
90
|
+
} else t1 = $[4];
|
|
91
|
+
let t2;
|
|
92
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
93
|
+
t2 = /* @__PURE__ */ jsx(TreeItem$1, {
|
|
94
|
+
className: t1,
|
|
95
|
+
...props
|
|
96
|
+
});
|
|
97
|
+
$[5] = props;
|
|
98
|
+
$[6] = t1;
|
|
99
|
+
$[7] = t2;
|
|
100
|
+
} else t2 = $[7];
|
|
101
|
+
return t2;
|
|
102
|
+
}
|
|
103
|
+
/** The item's row. It indents by the item's depth, and leaves room for the arrow when it has none. */
|
|
104
|
+
function TreeItemLabel(t0) {
|
|
105
|
+
const $ = c(8);
|
|
106
|
+
let className;
|
|
107
|
+
let props;
|
|
108
|
+
if ($[0] !== t0) {
|
|
109
|
+
({className, ...props} = t0);
|
|
110
|
+
$[0] = t0;
|
|
111
|
+
$[1] = className;
|
|
112
|
+
$[2] = props;
|
|
113
|
+
} else {
|
|
114
|
+
className = $[1];
|
|
115
|
+
props = $[2];
|
|
116
|
+
}
|
|
117
|
+
let t1;
|
|
118
|
+
if ($[3] !== className) {
|
|
119
|
+
t1 = cnState([
|
|
120
|
+
"relative flex min-h-8 cursor-default items-center gap-2 rounded-lg py-1.5 ps-[calc(--spacing(2)+(var(--tree-level,1)-1)*--spacing(4)+var(--tree-arrow-room))] pe-2 text-sm select-none focus-outline-inset [--tree-arrow-room:--spacing(6)] hover:bg-accent hover:text-accent-foreground has-data-[slot=tree-indicator]:[--tree-arrow-room:0px] [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
121
|
+
"data-current:bg-accent data-current:font-medium data-current:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 data-pending:cursor-progress data-selected:bg-accent data-selected:font-medium data-selected:text-accent-foreground",
|
|
122
|
+
"after:pointer-events-none after:absolute after:top-0 after:z-2 after:hidden after:h-1/2 after:start-[calc((var(--tree-level,1)-1)*--spacing(4)-1px)] after:w-2 after:rounded-es-md after:border-s-2 after:border-b-2 after:border-brand data-current:not-data-[level=1]:after:block"
|
|
123
|
+
], className);
|
|
124
|
+
$[3] = className;
|
|
125
|
+
$[4] = t1;
|
|
126
|
+
} else t1 = $[4];
|
|
127
|
+
let t2;
|
|
128
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
129
|
+
t2 = /* @__PURE__ */ jsx(TreeItemLabel$1, {
|
|
130
|
+
className: t1,
|
|
131
|
+
...props
|
|
132
|
+
});
|
|
133
|
+
$[5] = props;
|
|
134
|
+
$[6] = t1;
|
|
135
|
+
$[7] = t2;
|
|
136
|
+
} else t2 = $[7];
|
|
137
|
+
return t2;
|
|
138
|
+
}
|
|
139
|
+
/** Without children it shows an arrow that turns as the branch expands, a spinner while its children load and a retry mark after they failed. */
|
|
140
|
+
function TreeItemIndicator(t0) {
|
|
141
|
+
const $ = c(10);
|
|
142
|
+
let children;
|
|
143
|
+
let className;
|
|
144
|
+
let props;
|
|
145
|
+
if ($[0] !== t0) {
|
|
146
|
+
({className, children, ...props} = t0);
|
|
147
|
+
$[0] = t0;
|
|
148
|
+
$[1] = children;
|
|
149
|
+
$[2] = className;
|
|
150
|
+
$[3] = props;
|
|
151
|
+
} else {
|
|
152
|
+
children = $[1];
|
|
153
|
+
className = $[2];
|
|
154
|
+
props = $[3];
|
|
155
|
+
}
|
|
156
|
+
let t1;
|
|
157
|
+
if ($[4] !== className) {
|
|
158
|
+
t1 = cnState("flex size-4 shrink-0 items-center justify-center rounded-sm text-muted-foreground transition-transform duration-quick ease-out not-data-loading:not-data-failed:data-expanded:rotate-90 motion-reduce:transition-none rtl:not-data-expanded:-scale-x-100", className);
|
|
159
|
+
$[4] = className;
|
|
160
|
+
$[5] = t1;
|
|
161
|
+
} else t1 = $[5];
|
|
162
|
+
const t2 = children ?? _temp;
|
|
163
|
+
let t3;
|
|
164
|
+
if ($[6] !== props || $[7] !== t1 || $[8] !== t2) {
|
|
165
|
+
t3 = /* @__PURE__ */ jsx(TreeItemIndicator$1, {
|
|
166
|
+
className: t1,
|
|
167
|
+
...props,
|
|
168
|
+
children: t2
|
|
169
|
+
});
|
|
170
|
+
$[6] = props;
|
|
171
|
+
$[7] = t1;
|
|
172
|
+
$[8] = t2;
|
|
173
|
+
$[9] = t3;
|
|
174
|
+
} else t3 = $[9];
|
|
175
|
+
return t3;
|
|
176
|
+
}
|
|
177
|
+
/** Looks like abby's `Checkbox`. Without children it shows a check, or a dash while only some of its branch is checked. */
|
|
178
|
+
function _temp(state) {
|
|
179
|
+
return state.loading ? /* @__PURE__ */ jsx(Icon, {
|
|
180
|
+
icon: Loading03Icon,
|
|
181
|
+
className: "animate-spin motion-reduce:animate-none"
|
|
182
|
+
}) : /* @__PURE__ */ jsx(Icon, { icon: state.failed ? RefreshIcon : ArrowRight01Icon });
|
|
183
|
+
}
|
|
184
|
+
function TreeItemCheckbox(t0) {
|
|
185
|
+
const $ = c(10);
|
|
186
|
+
let children;
|
|
187
|
+
let className;
|
|
188
|
+
let props;
|
|
189
|
+
if ($[0] !== t0) {
|
|
190
|
+
({className, children, ...props} = t0);
|
|
191
|
+
$[0] = t0;
|
|
192
|
+
$[1] = children;
|
|
193
|
+
$[2] = className;
|
|
194
|
+
$[3] = props;
|
|
195
|
+
} else {
|
|
196
|
+
children = $[1];
|
|
197
|
+
className = $[2];
|
|
198
|
+
props = $[3];
|
|
199
|
+
}
|
|
200
|
+
let t1;
|
|
201
|
+
if ($[4] !== className) {
|
|
202
|
+
t1 = cnState("flex size-4 shrink-0 items-center justify-center rounded-xs border border-input transition-colors data-checked:border-brand data-checked:bg-brand data-checked:text-brand-foreground data-indeterminate:border-brand data-indeterminate:bg-brand data-indeterminate:text-brand-foreground dark:bg-input/30 dark:data-checked:bg-brand dark:data-indeterminate:bg-brand [&>svg]:size-3.5", className);
|
|
203
|
+
$[4] = className;
|
|
204
|
+
$[5] = t1;
|
|
205
|
+
} else t1 = $[5];
|
|
206
|
+
const t2 = children ?? _temp2;
|
|
207
|
+
let t3;
|
|
208
|
+
if ($[6] !== props || $[7] !== t1 || $[8] !== t2) {
|
|
209
|
+
t3 = /* @__PURE__ */ jsx(TreeItemCheckbox$1, {
|
|
210
|
+
className: t1,
|
|
211
|
+
...props,
|
|
212
|
+
children: t2
|
|
213
|
+
});
|
|
214
|
+
$[6] = props;
|
|
215
|
+
$[7] = t1;
|
|
216
|
+
$[8] = t2;
|
|
217
|
+
$[9] = t3;
|
|
218
|
+
} else t3 = $[9];
|
|
219
|
+
return t3;
|
|
220
|
+
}
|
|
221
|
+
function _temp2(state) {
|
|
222
|
+
return state.checked ? /* @__PURE__ */ jsx(Icon, {
|
|
223
|
+
icon: state.checked === "indeterminate" ? MinusSignIcon : Tick02Icon,
|
|
224
|
+
strokeWidth: 3
|
|
225
|
+
}) : null;
|
|
226
|
+
}
|
|
227
|
+
function TreeGroup(t0) {
|
|
228
|
+
const $ = c(8);
|
|
229
|
+
let className;
|
|
230
|
+
let props;
|
|
231
|
+
if ($[0] !== t0) {
|
|
232
|
+
({className, ...props} = t0);
|
|
233
|
+
$[0] = t0;
|
|
234
|
+
$[1] = className;
|
|
235
|
+
$[2] = props;
|
|
236
|
+
} else {
|
|
237
|
+
className = $[1];
|
|
238
|
+
props = $[2];
|
|
239
|
+
}
|
|
240
|
+
let t1;
|
|
241
|
+
if ($[3] !== className) {
|
|
242
|
+
t1 = cnState(["relative flex h-(--tree-group-height) flex-col gap-0.5 overflow-hidden transition-[height] [&>:first-child]:mt-0.5 duration-quick ease-out data-closed:h-0 data-starting-style:h-0 motion-reduce:transition-none", "before:pointer-events-none before:absolute before:inset-y-0 before:start-[calc(var(--tree-level,1)*--spacing(4)-0.5px)] before:z-1 before:w-px before:bg-foreground/10"], className);
|
|
243
|
+
$[3] = className;
|
|
244
|
+
$[4] = t1;
|
|
245
|
+
} else t1 = $[4];
|
|
246
|
+
let t2;
|
|
247
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
248
|
+
t2 = /* @__PURE__ */ jsx(TreeGroup$1, {
|
|
249
|
+
className: t1,
|
|
250
|
+
...props
|
|
251
|
+
});
|
|
252
|
+
$[5] = props;
|
|
253
|
+
$[6] = t1;
|
|
254
|
+
$[7] = t2;
|
|
255
|
+
} else t2 = $[7];
|
|
256
|
+
return t2;
|
|
257
|
+
}
|
|
258
|
+
export { Tree, TreeGroup, TreeItem, TreeItemCheckbox, TreeItemIndicator, TreeItemLabel, createTreeController, toggleTreeChecked, treeCheckedStates, treeFromPaths, visibleTreeRows };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from "react";
|
|
2
|
+
import { TextEditorAdapter, TriggerArgument, TriggerDefinition, TriggerItemsLoader, TriggerMatch, TriggerMenuContent as TriggerMenuContent$1, TriggerMenuController, TriggerMenuData, TriggerMenuDataGroup, TriggerMenuDataItem, TriggerMenuEmpty as TriggerMenuEmpty$1, TriggerMenuGroup as TriggerMenuGroup$1, TriggerMenuGroupLabel as TriggerMenuGroupLabel$1, TriggerMenuHint as TriggerMenuHint$1, TriggerMenuInput as TriggerMenuInput$1, TriggerMenuItem as TriggerMenuItem$1, TriggerMenuItemIcon as TriggerMenuItemIcon$1, TriggerMenuList as TriggerMenuList$1, TriggerMenuProps, TriggerMenuSelectDetails, TriggerMenuSeparator as TriggerMenuSeparator$1, TriggerMenuStatus as TriggerMenuStatus$1, createTriggerMenuController, textFieldAdapter } from "@ui-sdk/react/trigger-menu";
|
|
3
|
+
declare function TriggerMenu<T = string>(props: TriggerMenuProps<T>): import("react").JSX.Element;
|
|
4
|
+
/**
|
|
5
|
+
* Looks like abby's `Textarea`, or like `Input` when rendered as an `<input>`.
|
|
6
|
+
* In a `Field`, pass it to `FieldControl` as `render`.
|
|
7
|
+
*/
|
|
8
|
+
declare function TriggerMenuInput({ className, ...props }: ComponentProps<typeof TriggerMenuInput$1>): import("react").JSX.Element;
|
|
9
|
+
/** A polite status. Give it `sr-only` to keep it for screen readers alone. */
|
|
10
|
+
declare function TriggerMenuStatus({ className, ...props }: ComponentProps<typeof TriggerMenuStatus$1>): import("react").JSX.Element;
|
|
11
|
+
/** Without children it holds a `TriggerMenuList`, which renders the current trigger's items. */
|
|
12
|
+
declare function TriggerMenuContent({ className, sideOffset, children, ...props }: ComponentProps<typeof TriggerMenuContent$1>): import("react").JSX.Element;
|
|
13
|
+
declare function TriggerMenuEmpty({ className, ...props }: ComponentProps<typeof TriggerMenuEmpty$1>): import("react").JSX.Element;
|
|
14
|
+
/** Without children it renders the current trigger's items that match, styled. */
|
|
15
|
+
declare function TriggerMenuList({ className, children, ...props }: ComponentProps<typeof TriggerMenuList$1>): import("react").JSX.Element;
|
|
16
|
+
type TriggerMenuItemProps<T = string> = Parameters<typeof TriggerMenuItem$1<T>>[0];
|
|
17
|
+
declare function TriggerMenuItem<T = string>({ className, ...props }: TriggerMenuItemProps<T>): import("react").JSX.Element;
|
|
18
|
+
declare const TriggerMenuItemIcon: (({ className, ...props }: ComponentProps<typeof TriggerMenuItemIcon$1>) => import("react").JSX.Element) & {
|
|
19
|
+
[x: symbol]: boolean;
|
|
20
|
+
};
|
|
21
|
+
declare function TriggerMenuGroup({ className, ...props }: ComponentProps<typeof TriggerMenuGroup$1>): import("react").JSX.Element;
|
|
22
|
+
declare function TriggerMenuGroupLabel({ className, ...props }: ComponentProps<typeof TriggerMenuGroupLabel$1>): import("react").JSX.Element;
|
|
23
|
+
declare function TriggerMenuSeparator({ className, ...props }: ComponentProps<typeof TriggerMenuSeparator$1>): import("react").JSX.Element;
|
|
24
|
+
/** Ghost text at the caret, in the field's type size. ui-sdk places it. */
|
|
25
|
+
declare function TriggerMenuHint({ className, ...props }: ComponentProps<typeof TriggerMenuHint$1>): import("react").JSX.Element;
|
|
26
|
+
/** Renders data items as styled parts, for a layout of your own. */
|
|
27
|
+
declare function TriggerMenuItems<T = string>({ items }: {
|
|
28
|
+
items: TriggerMenuData<T>;
|
|
29
|
+
}): ReactNode;
|
|
30
|
+
export { type TextEditorAdapter, type TriggerArgument, type TriggerDefinition, type TriggerItemsLoader, type TriggerMatch, TriggerMenu, TriggerMenuContent, type TriggerMenuController, type TriggerMenuData, type TriggerMenuDataGroup, type TriggerMenuDataItem, TriggerMenuEmpty, TriggerMenuGroup, TriggerMenuGroupLabel, TriggerMenuHint, TriggerMenuInput, TriggerMenuItem, TriggerMenuItemIcon, type TriggerMenuItemProps, TriggerMenuItems, TriggerMenuList, type TriggerMenuProps, type TriggerMenuSelectDetails, TriggerMenuSeparator, TriggerMenuStatus, createTriggerMenuController, textFieldAdapter };
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cnState } from "../../utilities/cn/index.js";
|
|
3
|
+
import { notLabel } from "../not-label.js";
|
|
4
|
+
import { inputClasses } from "../input/input.js";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { TriggerMenu as TriggerMenu$1, TriggerMenuContent as TriggerMenuContent$1, TriggerMenuEmpty as TriggerMenuEmpty$1, TriggerMenuGroup as TriggerMenuGroup$1, TriggerMenuGroupLabel as TriggerMenuGroupLabel$1, TriggerMenuHint as TriggerMenuHint$1, TriggerMenuInput as TriggerMenuInput$1, TriggerMenuItem as TriggerMenuItem$1, TriggerMenuItemIcon as TriggerMenuItemIcon$1, TriggerMenuList as TriggerMenuList$1, TriggerMenuSeparator as TriggerMenuSeparator$1, TriggerMenuStatus as TriggerMenuStatus$1, createTriggerMenuController, textFieldAdapter } from "@ui-sdk/react/trigger-menu";
|
|
8
|
+
// src/components/trigger-menu/trigger-menu.tsx
|
|
9
|
+
function TriggerMenu(props) {
|
|
10
|
+
const $ = c(2);
|
|
11
|
+
let t0;
|
|
12
|
+
if ($[0] !== props) {
|
|
13
|
+
t0 = /* @__PURE__ */ jsx(TriggerMenu$1, { ...props });
|
|
14
|
+
$[0] = props;
|
|
15
|
+
$[1] = t0;
|
|
16
|
+
} else t0 = $[1];
|
|
17
|
+
return t0;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Looks like abby's `Textarea`, or like `Input` when rendered as an `<input>`.
|
|
21
|
+
* In a `Field`, pass it to `FieldControl` as `render`.
|
|
22
|
+
*/
|
|
23
|
+
function TriggerMenuInput(t0) {
|
|
24
|
+
const $ = c(8);
|
|
25
|
+
let className;
|
|
26
|
+
let props;
|
|
27
|
+
if ($[0] !== t0) {
|
|
28
|
+
({className, ...props} = t0);
|
|
29
|
+
$[0] = t0;
|
|
30
|
+
$[1] = className;
|
|
31
|
+
$[2] = props;
|
|
32
|
+
} else {
|
|
33
|
+
className = $[1];
|
|
34
|
+
props = $[2];
|
|
35
|
+
}
|
|
36
|
+
let t1;
|
|
37
|
+
if ($[3] !== className) {
|
|
38
|
+
t1 = cnState([inputClasses, "[textarea&]:h-auto [textarea&]:min-h-16 [textarea&]:rounded-2xl [textarea&]:py-2"], className);
|
|
39
|
+
$[3] = className;
|
|
40
|
+
$[4] = t1;
|
|
41
|
+
} else t1 = $[4];
|
|
42
|
+
let t2;
|
|
43
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
44
|
+
t2 = /* @__PURE__ */ jsx(TriggerMenuInput$1, {
|
|
45
|
+
className: t1,
|
|
46
|
+
...props
|
|
47
|
+
});
|
|
48
|
+
$[5] = props;
|
|
49
|
+
$[6] = t1;
|
|
50
|
+
$[7] = t2;
|
|
51
|
+
} else t2 = $[7];
|
|
52
|
+
return t2;
|
|
53
|
+
}
|
|
54
|
+
/** A polite status. Give it `sr-only` to keep it for screen readers alone. */
|
|
55
|
+
function TriggerMenuStatus(t0) {
|
|
56
|
+
const $ = c(8);
|
|
57
|
+
let className;
|
|
58
|
+
let props;
|
|
59
|
+
if ($[0] !== t0) {
|
|
60
|
+
({className, ...props} = t0);
|
|
61
|
+
$[0] = t0;
|
|
62
|
+
$[1] = className;
|
|
63
|
+
$[2] = props;
|
|
64
|
+
} else {
|
|
65
|
+
className = $[1];
|
|
66
|
+
props = $[2];
|
|
67
|
+
}
|
|
68
|
+
let t1;
|
|
69
|
+
if ($[3] !== className) {
|
|
70
|
+
t1 = cnState("px-2 py-1.5 text-sm text-muted-foreground empty:p-0", className);
|
|
71
|
+
$[3] = className;
|
|
72
|
+
$[4] = t1;
|
|
73
|
+
} else t1 = $[4];
|
|
74
|
+
let t2;
|
|
75
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
76
|
+
t2 = /* @__PURE__ */ jsx(TriggerMenuStatus$1, {
|
|
77
|
+
className: t1,
|
|
78
|
+
...props
|
|
79
|
+
});
|
|
80
|
+
$[5] = props;
|
|
81
|
+
$[6] = t1;
|
|
82
|
+
$[7] = t2;
|
|
83
|
+
} else t2 = $[7];
|
|
84
|
+
return t2;
|
|
85
|
+
}
|
|
86
|
+
/** The trigger's visible data items, as styled parts. */
|
|
87
|
+
function dataItems(items) {
|
|
88
|
+
return items.map((entry, index) => {
|
|
89
|
+
if (typeof entry === "string") return /* @__PURE__ */ jsx(TriggerMenuItem, {
|
|
90
|
+
value: entry,
|
|
91
|
+
label: entry,
|
|
92
|
+
children: entry
|
|
93
|
+
}, `item-${entry}`);
|
|
94
|
+
if ("type" in entry && entry.type === "separator") return /* @__PURE__ */ jsx(TriggerMenuSeparator, {}, `separator-${index}`);
|
|
95
|
+
if ("type" in entry && entry.type === "group") return /* @__PURE__ */ jsxs(TriggerMenuGroup, { children: [entry.label && /* @__PURE__ */ jsx(TriggerMenuGroupLabel, { children: entry.label }), dataItems(entry.items)] }, `group-${entry.label ?? index}`);
|
|
96
|
+
const { value, label, disabled, keywords } = entry;
|
|
97
|
+
return /* @__PURE__ */ jsx(TriggerMenuItem, {
|
|
98
|
+
value,
|
|
99
|
+
label,
|
|
100
|
+
disabled,
|
|
101
|
+
keywords,
|
|
102
|
+
children: label
|
|
103
|
+
}, typeof value === "string" ? `item-${value}` : `item-${index}`);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
/** What a list with no children shows: the current trigger's items. */
|
|
107
|
+
const dataChildren = (state) => state.items.length > 0 ? dataItems(state.items) : null;
|
|
108
|
+
/** Without children it holds a `TriggerMenuList`, which renders the current trigger's items. */
|
|
109
|
+
function TriggerMenuContent({ className, sideOffset = 4, children = /* @__PURE__ */ jsx(TriggerMenuList, {}), ...props }) {
|
|
110
|
+
return /* @__PURE__ */ jsx(TriggerMenuContent$1, {
|
|
111
|
+
sideOffset,
|
|
112
|
+
className: cnState("isolate flex max-h-(--available-height) max-w-(--available-width) min-w-40 origin-(--transform-origin) flex-col overflow-x-hidden overflow-y-auto rounded-xl popup-motion popup-surface p-1 text-sm [--popup-duration:100ms] data-closed:scale-95 data-starting-style:scale-95", className),
|
|
113
|
+
...props,
|
|
114
|
+
children
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
function TriggerMenuEmpty(t0) {
|
|
118
|
+
const $ = c(8);
|
|
119
|
+
let className;
|
|
120
|
+
let props;
|
|
121
|
+
if ($[0] !== t0) {
|
|
122
|
+
({className, ...props} = t0);
|
|
123
|
+
$[0] = t0;
|
|
124
|
+
$[1] = className;
|
|
125
|
+
$[2] = props;
|
|
126
|
+
} else {
|
|
127
|
+
className = $[1];
|
|
128
|
+
props = $[2];
|
|
129
|
+
}
|
|
130
|
+
let t1;
|
|
131
|
+
if ($[3] !== className) {
|
|
132
|
+
t1 = cnState("px-2 py-6 text-center text-sm text-muted-foreground empty:hidden", className);
|
|
133
|
+
$[3] = className;
|
|
134
|
+
$[4] = t1;
|
|
135
|
+
} else t1 = $[4];
|
|
136
|
+
let t2;
|
|
137
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
138
|
+
t2 = /* @__PURE__ */ jsx(TriggerMenuEmpty$1, {
|
|
139
|
+
className: t1,
|
|
140
|
+
...props
|
|
141
|
+
});
|
|
142
|
+
$[5] = props;
|
|
143
|
+
$[6] = t1;
|
|
144
|
+
$[7] = t2;
|
|
145
|
+
} else t2 = $[7];
|
|
146
|
+
return t2;
|
|
147
|
+
}
|
|
148
|
+
/** Without children it renders the current trigger's items that match, styled. */
|
|
149
|
+
function TriggerMenuList(t0) {
|
|
150
|
+
const $ = c(10);
|
|
151
|
+
let className;
|
|
152
|
+
let props;
|
|
153
|
+
let t1;
|
|
154
|
+
if ($[0] !== t0) {
|
|
155
|
+
({className, children: t1, ...props} = t0);
|
|
156
|
+
$[0] = t0;
|
|
157
|
+
$[1] = className;
|
|
158
|
+
$[2] = props;
|
|
159
|
+
$[3] = t1;
|
|
160
|
+
} else {
|
|
161
|
+
className = $[1];
|
|
162
|
+
props = $[2];
|
|
163
|
+
t1 = $[3];
|
|
164
|
+
}
|
|
165
|
+
const children = t1 === void 0 ? dataChildren : t1;
|
|
166
|
+
let t2;
|
|
167
|
+
if ($[4] !== className) {
|
|
168
|
+
t2 = cnState("flex min-h-0 flex-col outline-none aria-busy:opacity-60", className);
|
|
169
|
+
$[4] = className;
|
|
170
|
+
$[5] = t2;
|
|
171
|
+
} else t2 = $[5];
|
|
172
|
+
let t3;
|
|
173
|
+
if ($[6] !== children || $[7] !== props || $[8] !== t2) {
|
|
174
|
+
t3 = /* @__PURE__ */ jsx(TriggerMenuList$1, {
|
|
175
|
+
className: t2,
|
|
176
|
+
...props,
|
|
177
|
+
children
|
|
178
|
+
});
|
|
179
|
+
$[6] = children;
|
|
180
|
+
$[7] = props;
|
|
181
|
+
$[8] = t2;
|
|
182
|
+
$[9] = t3;
|
|
183
|
+
} else t3 = $[9];
|
|
184
|
+
return t3;
|
|
185
|
+
}
|
|
186
|
+
function TriggerMenuItem(t0) {
|
|
187
|
+
const $ = c(8);
|
|
188
|
+
let className;
|
|
189
|
+
let props;
|
|
190
|
+
if ($[0] !== t0) {
|
|
191
|
+
({className, ...props} = t0);
|
|
192
|
+
$[0] = t0;
|
|
193
|
+
$[1] = className;
|
|
194
|
+
$[2] = props;
|
|
195
|
+
} else {
|
|
196
|
+
className = $[1];
|
|
197
|
+
props = $[2];
|
|
198
|
+
}
|
|
199
|
+
let t1;
|
|
200
|
+
if ($[3] !== className) {
|
|
201
|
+
t1 = cnState(["list-row in-data-has-icons:not-data-has-icon:ps-8", "[[data-slot=trigger-menu-list]:not(:hover)_&]:data-highlighted:outline-[color:var(--focus-ring,var(--ring))]"], className);
|
|
202
|
+
$[3] = className;
|
|
203
|
+
$[4] = t1;
|
|
204
|
+
} else t1 = $[4];
|
|
205
|
+
let t2;
|
|
206
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
207
|
+
t2 = /* @__PURE__ */ jsx(TriggerMenuItem$1, {
|
|
208
|
+
className: t1,
|
|
209
|
+
...props
|
|
210
|
+
});
|
|
211
|
+
$[5] = props;
|
|
212
|
+
$[6] = t1;
|
|
213
|
+
$[7] = t2;
|
|
214
|
+
} else t2 = $[7];
|
|
215
|
+
return t2;
|
|
216
|
+
}
|
|
217
|
+
const TriggerMenuItemIcon = Object.assign(function TriggerMenuItemIcon({ className, ...props }) {
|
|
218
|
+
return /* @__PURE__ */ jsx(TriggerMenuItemIcon$1, {
|
|
219
|
+
className: cnState("flex size-4 shrink-0 items-center justify-center text-muted-foreground", className),
|
|
220
|
+
...props
|
|
221
|
+
});
|
|
222
|
+
}, notLabel);
|
|
223
|
+
function TriggerMenuGroup(t0) {
|
|
224
|
+
const $ = c(8);
|
|
225
|
+
let className;
|
|
226
|
+
let props;
|
|
227
|
+
if ($[0] !== t0) {
|
|
228
|
+
({className, ...props} = t0);
|
|
229
|
+
$[0] = t0;
|
|
230
|
+
$[1] = className;
|
|
231
|
+
$[2] = props;
|
|
232
|
+
} else {
|
|
233
|
+
className = $[1];
|
|
234
|
+
props = $[2];
|
|
235
|
+
}
|
|
236
|
+
let t1;
|
|
237
|
+
if ($[3] !== className) {
|
|
238
|
+
t1 = cnState("flex shrink-0 flex-col", className);
|
|
239
|
+
$[3] = className;
|
|
240
|
+
$[4] = t1;
|
|
241
|
+
} else t1 = $[4];
|
|
242
|
+
let t2;
|
|
243
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
244
|
+
t2 = /* @__PURE__ */ jsx(TriggerMenuGroup$1, {
|
|
245
|
+
className: t1,
|
|
246
|
+
...props
|
|
247
|
+
});
|
|
248
|
+
$[5] = props;
|
|
249
|
+
$[6] = t1;
|
|
250
|
+
$[7] = t2;
|
|
251
|
+
} else t2 = $[7];
|
|
252
|
+
return t2;
|
|
253
|
+
}
|
|
254
|
+
function TriggerMenuGroupLabel(t0) {
|
|
255
|
+
const $ = c(8);
|
|
256
|
+
let className;
|
|
257
|
+
let props;
|
|
258
|
+
if ($[0] !== t0) {
|
|
259
|
+
({className, ...props} = t0);
|
|
260
|
+
$[0] = t0;
|
|
261
|
+
$[1] = className;
|
|
262
|
+
$[2] = props;
|
|
263
|
+
} else {
|
|
264
|
+
className = $[1];
|
|
265
|
+
props = $[2];
|
|
266
|
+
}
|
|
267
|
+
let t1;
|
|
268
|
+
if ($[3] !== className) {
|
|
269
|
+
t1 = cnState("px-2 py-1.5 text-xs text-muted-foreground", className);
|
|
270
|
+
$[3] = className;
|
|
271
|
+
$[4] = t1;
|
|
272
|
+
} else t1 = $[4];
|
|
273
|
+
let t2;
|
|
274
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
275
|
+
t2 = /* @__PURE__ */ jsx(TriggerMenuGroupLabel$1, {
|
|
276
|
+
className: t1,
|
|
277
|
+
...props
|
|
278
|
+
});
|
|
279
|
+
$[5] = props;
|
|
280
|
+
$[6] = t1;
|
|
281
|
+
$[7] = t2;
|
|
282
|
+
} else t2 = $[7];
|
|
283
|
+
return t2;
|
|
284
|
+
}
|
|
285
|
+
function TriggerMenuSeparator(t0) {
|
|
286
|
+
const $ = c(8);
|
|
287
|
+
let className;
|
|
288
|
+
let props;
|
|
289
|
+
if ($[0] !== t0) {
|
|
290
|
+
({className, ...props} = t0);
|
|
291
|
+
$[0] = t0;
|
|
292
|
+
$[1] = className;
|
|
293
|
+
$[2] = props;
|
|
294
|
+
} else {
|
|
295
|
+
className = $[1];
|
|
296
|
+
props = $[2];
|
|
297
|
+
}
|
|
298
|
+
let t1;
|
|
299
|
+
if ($[3] !== className) {
|
|
300
|
+
t1 = cnState("pointer-events-none -mx-1 my-1 h-px shrink-0 bg-border", className);
|
|
301
|
+
$[3] = className;
|
|
302
|
+
$[4] = t1;
|
|
303
|
+
} else t1 = $[4];
|
|
304
|
+
let t2;
|
|
305
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
306
|
+
t2 = /* @__PURE__ */ jsx(TriggerMenuSeparator$1, {
|
|
307
|
+
className: t1,
|
|
308
|
+
...props
|
|
309
|
+
});
|
|
310
|
+
$[5] = props;
|
|
311
|
+
$[6] = t1;
|
|
312
|
+
$[7] = t2;
|
|
313
|
+
} else t2 = $[7];
|
|
314
|
+
return t2;
|
|
315
|
+
}
|
|
316
|
+
/** Ghost text at the caret, in the field's type size. ui-sdk places it. */
|
|
317
|
+
function TriggerMenuHint(t0) {
|
|
318
|
+
const $ = c(8);
|
|
319
|
+
let className;
|
|
320
|
+
let props;
|
|
321
|
+
if ($[0] !== t0) {
|
|
322
|
+
({className, ...props} = t0);
|
|
323
|
+
$[0] = t0;
|
|
324
|
+
$[1] = className;
|
|
325
|
+
$[2] = props;
|
|
326
|
+
} else {
|
|
327
|
+
className = $[1];
|
|
328
|
+
props = $[2];
|
|
329
|
+
}
|
|
330
|
+
let t1;
|
|
331
|
+
if ($[3] !== className) {
|
|
332
|
+
t1 = cnState("pointer-events-none text-base text-muted-foreground select-none md:text-sm", className);
|
|
333
|
+
$[3] = className;
|
|
334
|
+
$[4] = t1;
|
|
335
|
+
} else t1 = $[4];
|
|
336
|
+
let t2;
|
|
337
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
338
|
+
t2 = /* @__PURE__ */ jsx(TriggerMenuHint$1, {
|
|
339
|
+
className: t1,
|
|
340
|
+
...props
|
|
341
|
+
});
|
|
342
|
+
$[5] = props;
|
|
343
|
+
$[6] = t1;
|
|
344
|
+
$[7] = t2;
|
|
345
|
+
} else t2 = $[7];
|
|
346
|
+
return t2;
|
|
347
|
+
}
|
|
348
|
+
/** Renders data items as styled parts, for a layout of your own. */
|
|
349
|
+
function TriggerMenuItems({ items }) {
|
|
350
|
+
return dataItems(items);
|
|
351
|
+
}
|
|
352
|
+
export { TriggerMenu, TriggerMenuContent, TriggerMenuEmpty, TriggerMenuGroup, TriggerMenuGroupLabel, TriggerMenuHint, TriggerMenuInput, TriggerMenuItem, TriggerMenuItemIcon, TriggerMenuItems, TriggerMenuList, TriggerMenuSeparator, TriggerMenuStatus, createTriggerMenuController, textFieldAdapter };
|