@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,553 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cnState } from "../../utilities/cn/index.js";
|
|
3
|
+
import { notLabel } from "../not-label.js";
|
|
4
|
+
import { buttonLook } from "../button/button.js";
|
|
5
|
+
import { Icon } from "../icon/icon.js";
|
|
6
|
+
import { c } from "react/compiler-runtime";
|
|
7
|
+
import { createContext, use } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { ArrowRight01Icon, Tick02Icon } from "@hugeicons/core-free-icons";
|
|
10
|
+
import { Menu as Menu$1, MenuCheckboxItem as MenuCheckboxItem$1, MenuContent as MenuContent$1, MenuContextTrigger as MenuContextTrigger$1, MenuGroup as MenuGroup$1, MenuGroupLabel as MenuGroupLabel$1, MenuItem as MenuItem$1, MenuItemIcon as MenuItemIcon$1, MenuItemIndicator as MenuItemIndicator$1, MenuRadioGroup as MenuRadioGroup$1, MenuRadioItem as MenuRadioItem$1, MenuSeparator as MenuSeparator$1, MenuShortcut as MenuShortcut$1, MenuSub as MenuSub$1, MenuSubContent as MenuSubContent$1, MenuSubTrigger as MenuSubTrigger$1, MenuTrigger as MenuTrigger$1, createMenuController } from "@ui-sdk/react/menu";
|
|
11
|
+
// src/components/menu/menu.tsx
|
|
12
|
+
/** The menu's `items`, for a `MenuContent` with no children to render styled. */
|
|
13
|
+
const MenuDataContext = createContext(void 0);
|
|
14
|
+
function Menu(t0) {
|
|
15
|
+
const $ = c(9);
|
|
16
|
+
let items;
|
|
17
|
+
let props;
|
|
18
|
+
if ($[0] !== t0) {
|
|
19
|
+
({items, ...props} = t0);
|
|
20
|
+
$[0] = t0;
|
|
21
|
+
$[1] = items;
|
|
22
|
+
$[2] = props;
|
|
23
|
+
} else {
|
|
24
|
+
items = $[1];
|
|
25
|
+
props = $[2];
|
|
26
|
+
}
|
|
27
|
+
let t1;
|
|
28
|
+
if ($[3] !== items || $[4] !== props) {
|
|
29
|
+
t1 = /* @__PURE__ */ jsx(Menu$1, {
|
|
30
|
+
items,
|
|
31
|
+
...props
|
|
32
|
+
});
|
|
33
|
+
$[3] = items;
|
|
34
|
+
$[4] = props;
|
|
35
|
+
$[5] = t1;
|
|
36
|
+
} else t1 = $[5];
|
|
37
|
+
let t2;
|
|
38
|
+
if ($[6] !== items || $[7] !== t1) {
|
|
39
|
+
t2 = /* @__PURE__ */ jsx(MenuDataContext, {
|
|
40
|
+
value: items,
|
|
41
|
+
children: t1
|
|
42
|
+
});
|
|
43
|
+
$[6] = items;
|
|
44
|
+
$[7] = t1;
|
|
45
|
+
$[8] = t2;
|
|
46
|
+
} else t2 = $[8];
|
|
47
|
+
return t2;
|
|
48
|
+
}
|
|
49
|
+
function MenuTrigger(t0) {
|
|
50
|
+
const $ = c(12);
|
|
51
|
+
let className;
|
|
52
|
+
let props;
|
|
53
|
+
let size;
|
|
54
|
+
let variant;
|
|
55
|
+
if ($[0] !== t0) {
|
|
56
|
+
({variant, size, className, ...props} = t0);
|
|
57
|
+
$[0] = t0;
|
|
58
|
+
$[1] = className;
|
|
59
|
+
$[2] = props;
|
|
60
|
+
$[3] = size;
|
|
61
|
+
$[4] = variant;
|
|
62
|
+
} else {
|
|
63
|
+
className = $[1];
|
|
64
|
+
props = $[2];
|
|
65
|
+
size = $[3];
|
|
66
|
+
variant = $[4];
|
|
67
|
+
}
|
|
68
|
+
let t1;
|
|
69
|
+
if ($[5] !== className || $[6] !== size || $[7] !== variant) {
|
|
70
|
+
t1 = cnState([buttonLook({
|
|
71
|
+
variant,
|
|
72
|
+
size
|
|
73
|
+
}), "disabled:pointer-events-none disabled:opacity-50 aria-disabled:opacity-50"], className);
|
|
74
|
+
$[5] = className;
|
|
75
|
+
$[6] = size;
|
|
76
|
+
$[7] = variant;
|
|
77
|
+
$[8] = t1;
|
|
78
|
+
} else t1 = $[8];
|
|
79
|
+
let t2;
|
|
80
|
+
if ($[9] !== props || $[10] !== t1) {
|
|
81
|
+
t2 = /* @__PURE__ */ jsx(MenuTrigger$1, {
|
|
82
|
+
className: t1,
|
|
83
|
+
...props
|
|
84
|
+
});
|
|
85
|
+
$[9] = props;
|
|
86
|
+
$[10] = t1;
|
|
87
|
+
$[11] = t2;
|
|
88
|
+
} else t2 = $[11];
|
|
89
|
+
return t2;
|
|
90
|
+
}
|
|
91
|
+
/** The area a right-click or a long press opens the menu from. Give it a `tabIndex` for the keyboard. */
|
|
92
|
+
function MenuContextTrigger(t0) {
|
|
93
|
+
const $ = c(8);
|
|
94
|
+
let className;
|
|
95
|
+
let props;
|
|
96
|
+
if ($[0] !== t0) {
|
|
97
|
+
({className, ...props} = t0);
|
|
98
|
+
$[0] = t0;
|
|
99
|
+
$[1] = className;
|
|
100
|
+
$[2] = props;
|
|
101
|
+
} else {
|
|
102
|
+
className = $[1];
|
|
103
|
+
props = $[2];
|
|
104
|
+
}
|
|
105
|
+
let t1;
|
|
106
|
+
if ($[3] !== className) {
|
|
107
|
+
t1 = cnState("focus-ring", className);
|
|
108
|
+
$[3] = className;
|
|
109
|
+
$[4] = t1;
|
|
110
|
+
} else t1 = $[4];
|
|
111
|
+
let t2;
|
|
112
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
113
|
+
t2 = /* @__PURE__ */ jsx(MenuContextTrigger$1, {
|
|
114
|
+
className: t1,
|
|
115
|
+
...props
|
|
116
|
+
});
|
|
117
|
+
$[5] = props;
|
|
118
|
+
$[6] = t1;
|
|
119
|
+
$[7] = t2;
|
|
120
|
+
} else t2 = $[7];
|
|
121
|
+
return t2;
|
|
122
|
+
}
|
|
123
|
+
const contentClasses = [
|
|
124
|
+
"isolate flex flex-col overflow-x-hidden overflow-y-auto popup-surface p-1 text-sm",
|
|
125
|
+
"data-[presentation=popover]:popup-motion data-[presentation=popover]:max-h-(--available-height) data-[presentation=popover]:max-w-(--available-width) data-[presentation=popover]:min-w-32 data-[presentation=popover]:origin-(--transform-origin) data-[presentation=popover]:rounded-xl data-[presentation=popover]:[--popup-duration:100ms] data-[presentation=popover]:data-starting-style:scale-95 data-[presentation=popover]:data-closed:scale-95",
|
|
126
|
+
"data-[presentation=sheet]:rounded-t-2xl data-[presentation=sheet]:p-2 data-[presentation=sheet]:shadow-lg data-[presentation=sheet]:pb-[max(--spacing(2),env(safe-area-inset-bottom))]"
|
|
127
|
+
];
|
|
128
|
+
/** Without children it renders the menu's `items`, styled. */
|
|
129
|
+
function MenuContent(t0) {
|
|
130
|
+
const $ = c(15);
|
|
131
|
+
let children;
|
|
132
|
+
let className;
|
|
133
|
+
let props;
|
|
134
|
+
let t1;
|
|
135
|
+
if ($[0] !== t0) {
|
|
136
|
+
({className, sideOffset: t1, children, ...props} = t0);
|
|
137
|
+
$[0] = t0;
|
|
138
|
+
$[1] = children;
|
|
139
|
+
$[2] = className;
|
|
140
|
+
$[3] = props;
|
|
141
|
+
$[4] = t1;
|
|
142
|
+
} else {
|
|
143
|
+
children = $[1];
|
|
144
|
+
className = $[2];
|
|
145
|
+
props = $[3];
|
|
146
|
+
t1 = $[4];
|
|
147
|
+
}
|
|
148
|
+
const sideOffset = t1 === void 0 ? 4 : t1;
|
|
149
|
+
const items = use(MenuDataContext);
|
|
150
|
+
let t2;
|
|
151
|
+
if ($[5] !== className) {
|
|
152
|
+
t2 = cnState(contentClasses, className);
|
|
153
|
+
$[5] = className;
|
|
154
|
+
$[6] = t2;
|
|
155
|
+
} else t2 = $[6];
|
|
156
|
+
let t3;
|
|
157
|
+
if ($[7] !== children || $[8] !== items) {
|
|
158
|
+
t3 = children ?? (items && dataItems(items));
|
|
159
|
+
$[7] = children;
|
|
160
|
+
$[8] = items;
|
|
161
|
+
$[9] = t3;
|
|
162
|
+
} else t3 = $[9];
|
|
163
|
+
let t4;
|
|
164
|
+
if ($[10] !== props || $[11] !== sideOffset || $[12] !== t2 || $[13] !== t3) {
|
|
165
|
+
t4 = /* @__PURE__ */ jsx(MenuContent$1, {
|
|
166
|
+
sideOffset,
|
|
167
|
+
className: t2,
|
|
168
|
+
...props,
|
|
169
|
+
children: t3
|
|
170
|
+
});
|
|
171
|
+
$[10] = props;
|
|
172
|
+
$[11] = sideOffset;
|
|
173
|
+
$[12] = t2;
|
|
174
|
+
$[13] = t3;
|
|
175
|
+
$[14] = t4;
|
|
176
|
+
} else t4 = $[14];
|
|
177
|
+
return t4;
|
|
178
|
+
}
|
|
179
|
+
function MenuSub(props) {
|
|
180
|
+
const $ = c(2);
|
|
181
|
+
let t0;
|
|
182
|
+
if ($[0] !== props) {
|
|
183
|
+
t0 = /* @__PURE__ */ jsx(MenuSub$1, { ...props });
|
|
184
|
+
$[0] = props;
|
|
185
|
+
$[1] = t0;
|
|
186
|
+
} else t0 = $[1];
|
|
187
|
+
return t0;
|
|
188
|
+
}
|
|
189
|
+
/** End it with an `Icon` and it sits at the trigger's far edge. */
|
|
190
|
+
function MenuSubTrigger(t0) {
|
|
191
|
+
const $ = c(8);
|
|
192
|
+
let className;
|
|
193
|
+
let props;
|
|
194
|
+
if ($[0] !== t0) {
|
|
195
|
+
({className, ...props} = t0);
|
|
196
|
+
$[0] = t0;
|
|
197
|
+
$[1] = className;
|
|
198
|
+
$[2] = props;
|
|
199
|
+
} else {
|
|
200
|
+
className = $[1];
|
|
201
|
+
props = $[2];
|
|
202
|
+
}
|
|
203
|
+
let t1;
|
|
204
|
+
if ($[3] !== className) {
|
|
205
|
+
t1 = cnState([itemClasses, "data-open:bg-accent data-open:text-accent-foreground data-open:ring-1 data-open:ring-input data-open:ring-inset [&>svg:last-child]:ms-auto [&>svg:last-child]:text-subtle"], className);
|
|
206
|
+
$[3] = className;
|
|
207
|
+
$[4] = t1;
|
|
208
|
+
} else t1 = $[4];
|
|
209
|
+
let t2;
|
|
210
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
211
|
+
t2 = /* @__PURE__ */ jsx(MenuSubTrigger$1, {
|
|
212
|
+
className: t1,
|
|
213
|
+
...props
|
|
214
|
+
});
|
|
215
|
+
$[5] = props;
|
|
216
|
+
$[6] = t1;
|
|
217
|
+
$[7] = t2;
|
|
218
|
+
} else t2 = $[7];
|
|
219
|
+
return t2;
|
|
220
|
+
}
|
|
221
|
+
function MenuSubContent(t0) {
|
|
222
|
+
const $ = c(8);
|
|
223
|
+
let className;
|
|
224
|
+
let props;
|
|
225
|
+
if ($[0] !== t0) {
|
|
226
|
+
({className, ...props} = t0);
|
|
227
|
+
$[0] = t0;
|
|
228
|
+
$[1] = className;
|
|
229
|
+
$[2] = props;
|
|
230
|
+
} else {
|
|
231
|
+
className = $[1];
|
|
232
|
+
props = $[2];
|
|
233
|
+
}
|
|
234
|
+
let t1;
|
|
235
|
+
if ($[3] !== className) {
|
|
236
|
+
t1 = cnState(contentClasses, className);
|
|
237
|
+
$[3] = className;
|
|
238
|
+
$[4] = t1;
|
|
239
|
+
} else t1 = $[4];
|
|
240
|
+
let t2;
|
|
241
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
242
|
+
t2 = /* @__PURE__ */ jsx(MenuSubContent$1, {
|
|
243
|
+
className: t1,
|
|
244
|
+
...props
|
|
245
|
+
});
|
|
246
|
+
$[5] = props;
|
|
247
|
+
$[6] = t1;
|
|
248
|
+
$[7] = t2;
|
|
249
|
+
} else t2 = $[7];
|
|
250
|
+
return t2;
|
|
251
|
+
}
|
|
252
|
+
/** A row in the menu, shared by every kind of item and the submenu trigger. */
|
|
253
|
+
const itemClasses = "list-row in-data-[presentation=sheet]:py-2.5 in-data-has-icons:not-data-has-icon:ps-8";
|
|
254
|
+
function MenuItem(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([
|
|
270
|
+
itemClasses,
|
|
271
|
+
"data-pending:cursor-progress data-destructive:text-destructive data-destructive:data-highlighted:bg-destructive/10 data-destructive:data-highlighted:text-destructive",
|
|
272
|
+
"*:data-[slot=menu-shortcut]:ms-auto *:data-[slot=menu-shortcut]:ps-4 *:data-[slot=menu-shortcut]:text-xs *:data-[slot=menu-shortcut]:tracking-widest *:data-[slot=menu-shortcut]:text-muted-foreground data-highlighted:*:data-[slot=menu-shortcut]:text-accent-foreground"
|
|
273
|
+
], className);
|
|
274
|
+
$[3] = className;
|
|
275
|
+
$[4] = t1;
|
|
276
|
+
} else t1 = $[4];
|
|
277
|
+
let t2;
|
|
278
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
279
|
+
t2 = /* @__PURE__ */ jsx(MenuItem$1, {
|
|
280
|
+
className: t1,
|
|
281
|
+
...props
|
|
282
|
+
});
|
|
283
|
+
$[5] = props;
|
|
284
|
+
$[6] = t1;
|
|
285
|
+
$[7] = t2;
|
|
286
|
+
} else t2 = $[7];
|
|
287
|
+
return t2;
|
|
288
|
+
}
|
|
289
|
+
function MenuCheckboxItem(t0) {
|
|
290
|
+
const $ = c(8);
|
|
291
|
+
let className;
|
|
292
|
+
let props;
|
|
293
|
+
if ($[0] !== t0) {
|
|
294
|
+
({className, ...props} = t0);
|
|
295
|
+
$[0] = t0;
|
|
296
|
+
$[1] = className;
|
|
297
|
+
$[2] = props;
|
|
298
|
+
} else {
|
|
299
|
+
className = $[1];
|
|
300
|
+
props = $[2];
|
|
301
|
+
}
|
|
302
|
+
let t1;
|
|
303
|
+
if ($[3] !== className) {
|
|
304
|
+
t1 = cnState([itemClasses, "pe-8"], className);
|
|
305
|
+
$[3] = className;
|
|
306
|
+
$[4] = t1;
|
|
307
|
+
} else t1 = $[4];
|
|
308
|
+
let t2;
|
|
309
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
310
|
+
t2 = /* @__PURE__ */ jsx(MenuCheckboxItem$1, {
|
|
311
|
+
className: t1,
|
|
312
|
+
...props
|
|
313
|
+
});
|
|
314
|
+
$[5] = props;
|
|
315
|
+
$[6] = t1;
|
|
316
|
+
$[7] = t2;
|
|
317
|
+
} else t2 = $[7];
|
|
318
|
+
return t2;
|
|
319
|
+
}
|
|
320
|
+
function MenuRadioGroup(t0) {
|
|
321
|
+
const $ = c(8);
|
|
322
|
+
let className;
|
|
323
|
+
let props;
|
|
324
|
+
if ($[0] !== t0) {
|
|
325
|
+
({className, ...props} = t0);
|
|
326
|
+
$[0] = t0;
|
|
327
|
+
$[1] = className;
|
|
328
|
+
$[2] = props;
|
|
329
|
+
} else {
|
|
330
|
+
className = $[1];
|
|
331
|
+
props = $[2];
|
|
332
|
+
}
|
|
333
|
+
let t1;
|
|
334
|
+
if ($[3] !== className) {
|
|
335
|
+
t1 = cnState("flex shrink-0 flex-col", className);
|
|
336
|
+
$[3] = className;
|
|
337
|
+
$[4] = t1;
|
|
338
|
+
} else t1 = $[4];
|
|
339
|
+
let t2;
|
|
340
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
341
|
+
t2 = /* @__PURE__ */ jsx(MenuRadioGroup$1, {
|
|
342
|
+
className: t1,
|
|
343
|
+
...props
|
|
344
|
+
});
|
|
345
|
+
$[5] = props;
|
|
346
|
+
$[6] = t1;
|
|
347
|
+
$[7] = t2;
|
|
348
|
+
} else t2 = $[7];
|
|
349
|
+
return t2;
|
|
350
|
+
}
|
|
351
|
+
function MenuRadioItem(t0) {
|
|
352
|
+
const $ = c(8);
|
|
353
|
+
let className;
|
|
354
|
+
let props;
|
|
355
|
+
if ($[0] !== t0) {
|
|
356
|
+
({className, ...props} = t0);
|
|
357
|
+
$[0] = t0;
|
|
358
|
+
$[1] = className;
|
|
359
|
+
$[2] = props;
|
|
360
|
+
} else {
|
|
361
|
+
className = $[1];
|
|
362
|
+
props = $[2];
|
|
363
|
+
}
|
|
364
|
+
let t1;
|
|
365
|
+
if ($[3] !== className) {
|
|
366
|
+
t1 = cnState([itemClasses, "pe-8"], className);
|
|
367
|
+
$[3] = className;
|
|
368
|
+
$[4] = t1;
|
|
369
|
+
} else t1 = $[4];
|
|
370
|
+
let t2;
|
|
371
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
372
|
+
t2 = /* @__PURE__ */ jsx(MenuRadioItem$1, {
|
|
373
|
+
className: t1,
|
|
374
|
+
...props
|
|
375
|
+
});
|
|
376
|
+
$[5] = props;
|
|
377
|
+
$[6] = t1;
|
|
378
|
+
$[7] = t2;
|
|
379
|
+
} else t2 = $[7];
|
|
380
|
+
return t2;
|
|
381
|
+
}
|
|
382
|
+
/** Without children it shows a check. With `keepMounted` it keeps its place and hides while unchecked. */
|
|
383
|
+
const MenuItemIndicator = Object.assign(function MenuItemIndicator({ className, children = /* @__PURE__ */ jsx(Icon, { icon: Tick02Icon }), ...props }) {
|
|
384
|
+
return /* @__PURE__ */ jsx(MenuItemIndicator$1, {
|
|
385
|
+
className: cnState("pointer-events-none absolute end-2 flex size-4 items-center justify-center data-unchecked:invisible", className),
|
|
386
|
+
...props,
|
|
387
|
+
children
|
|
388
|
+
});
|
|
389
|
+
}, notLabel);
|
|
390
|
+
const MenuItemIcon = Object.assign(function MenuItemIcon({ className, ...props }) {
|
|
391
|
+
return /* @__PURE__ */ jsx(MenuItemIcon$1, {
|
|
392
|
+
className: cnState("flex size-4 shrink-0 items-center justify-center text-muted-foreground in-data-destructive:text-destructive", className),
|
|
393
|
+
...props
|
|
394
|
+
});
|
|
395
|
+
}, notLabel);
|
|
396
|
+
const MenuShortcut = Object.assign(function MenuShortcut({ className, ...props }) {
|
|
397
|
+
return /* @__PURE__ */ jsx(MenuShortcut$1, {
|
|
398
|
+
className: cnState(shortcutClasses, className),
|
|
399
|
+
...props
|
|
400
|
+
});
|
|
401
|
+
}, notLabel);
|
|
402
|
+
const shortcutClasses = "ms-auto ps-4 text-xs tracking-widest text-muted-foreground empty:hidden in-data-highlighted:text-accent-foreground";
|
|
403
|
+
function MenuGroup(t0) {
|
|
404
|
+
const $ = c(8);
|
|
405
|
+
let className;
|
|
406
|
+
let props;
|
|
407
|
+
if ($[0] !== t0) {
|
|
408
|
+
({className, ...props} = t0);
|
|
409
|
+
$[0] = t0;
|
|
410
|
+
$[1] = className;
|
|
411
|
+
$[2] = props;
|
|
412
|
+
} else {
|
|
413
|
+
className = $[1];
|
|
414
|
+
props = $[2];
|
|
415
|
+
}
|
|
416
|
+
let t1;
|
|
417
|
+
if ($[3] !== className) {
|
|
418
|
+
t1 = cnState("flex shrink-0 flex-col", className);
|
|
419
|
+
$[3] = className;
|
|
420
|
+
$[4] = t1;
|
|
421
|
+
} else t1 = $[4];
|
|
422
|
+
let t2;
|
|
423
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
424
|
+
t2 = /* @__PURE__ */ jsx(MenuGroup$1, {
|
|
425
|
+
className: t1,
|
|
426
|
+
...props
|
|
427
|
+
});
|
|
428
|
+
$[5] = props;
|
|
429
|
+
$[6] = t1;
|
|
430
|
+
$[7] = t2;
|
|
431
|
+
} else t2 = $[7];
|
|
432
|
+
return t2;
|
|
433
|
+
}
|
|
434
|
+
function MenuGroupLabel(t0) {
|
|
435
|
+
const $ = c(8);
|
|
436
|
+
let className;
|
|
437
|
+
let props;
|
|
438
|
+
if ($[0] !== t0) {
|
|
439
|
+
({className, ...props} = t0);
|
|
440
|
+
$[0] = t0;
|
|
441
|
+
$[1] = className;
|
|
442
|
+
$[2] = props;
|
|
443
|
+
} else {
|
|
444
|
+
className = $[1];
|
|
445
|
+
props = $[2];
|
|
446
|
+
}
|
|
447
|
+
let t1;
|
|
448
|
+
if ($[3] !== className) {
|
|
449
|
+
t1 = cnState("px-2 py-1.5 text-xs text-muted-foreground", className);
|
|
450
|
+
$[3] = className;
|
|
451
|
+
$[4] = t1;
|
|
452
|
+
} else t1 = $[4];
|
|
453
|
+
let t2;
|
|
454
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
455
|
+
t2 = /* @__PURE__ */ jsx(MenuGroupLabel$1, {
|
|
456
|
+
className: t1,
|
|
457
|
+
...props
|
|
458
|
+
});
|
|
459
|
+
$[5] = props;
|
|
460
|
+
$[6] = t1;
|
|
461
|
+
$[7] = t2;
|
|
462
|
+
} else t2 = $[7];
|
|
463
|
+
return t2;
|
|
464
|
+
}
|
|
465
|
+
function MenuSeparator(t0) {
|
|
466
|
+
const $ = c(8);
|
|
467
|
+
let className;
|
|
468
|
+
let props;
|
|
469
|
+
if ($[0] !== t0) {
|
|
470
|
+
({className, ...props} = t0);
|
|
471
|
+
$[0] = t0;
|
|
472
|
+
$[1] = className;
|
|
473
|
+
$[2] = props;
|
|
474
|
+
} else {
|
|
475
|
+
className = $[1];
|
|
476
|
+
props = $[2];
|
|
477
|
+
}
|
|
478
|
+
let t1;
|
|
479
|
+
if ($[3] !== className) {
|
|
480
|
+
t1 = cnState("pointer-events-none -mx-1 my-1 h-px shrink-0 bg-border", className);
|
|
481
|
+
$[3] = className;
|
|
482
|
+
$[4] = t1;
|
|
483
|
+
} else t1 = $[4];
|
|
484
|
+
let t2;
|
|
485
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
486
|
+
t2 = /* @__PURE__ */ jsx(MenuSeparator$1, {
|
|
487
|
+
className: t1,
|
|
488
|
+
...props
|
|
489
|
+
});
|
|
490
|
+
$[5] = props;
|
|
491
|
+
$[6] = t1;
|
|
492
|
+
$[7] = t2;
|
|
493
|
+
} else t2 = $[7];
|
|
494
|
+
return t2;
|
|
495
|
+
}
|
|
496
|
+
/** A data menu's entries, as styled parts. */
|
|
497
|
+
function dataItems(items) {
|
|
498
|
+
return items.map((entry, index) => {
|
|
499
|
+
if (typeof entry === "string") return /* @__PURE__ */ jsx(MenuItem, {
|
|
500
|
+
value: entry,
|
|
501
|
+
children: entry
|
|
502
|
+
}, `item-${entry}`);
|
|
503
|
+
if (entry.type === "separator") return /* @__PURE__ */ jsx(MenuSeparator, {}, `separator-${index}`);
|
|
504
|
+
if (entry.type === "group") return /* @__PURE__ */ jsxs(MenuGroup, { children: [entry.label && /* @__PURE__ */ jsx(MenuGroupLabel, { children: entry.label }), dataItems(entry.items)] }, `group-${entry.label ?? index}`);
|
|
505
|
+
if (entry.type === "checkbox") {
|
|
506
|
+
const { value, label, disabled, checked, defaultChecked, closeOnSelect } = entry;
|
|
507
|
+
return /* @__PURE__ */ jsxs(MenuCheckboxItem, {
|
|
508
|
+
value,
|
|
509
|
+
label,
|
|
510
|
+
disabled,
|
|
511
|
+
defaultChecked,
|
|
512
|
+
closeOnSelect,
|
|
513
|
+
...checked !== void 0 && { checked },
|
|
514
|
+
children: [label, /* @__PURE__ */ jsx(MenuItemIndicator, {})]
|
|
515
|
+
}, `checkbox-${value}`);
|
|
516
|
+
}
|
|
517
|
+
if (entry.type === "radio-group") {
|
|
518
|
+
const { name, label, value, defaultValue } = entry;
|
|
519
|
+
return /* @__PURE__ */ jsxs(MenuRadioGroup, {
|
|
520
|
+
name,
|
|
521
|
+
defaultValue,
|
|
522
|
+
...value !== void 0 && { value },
|
|
523
|
+
children: [label && /* @__PURE__ */ jsx(MenuGroupLabel, { children: label }), entry.items.map((item) => /* @__PURE__ */ jsxs(MenuRadioItem, {
|
|
524
|
+
value: item.value,
|
|
525
|
+
disabled: item.disabled,
|
|
526
|
+
children: [item.label, /* @__PURE__ */ jsx(MenuItemIndicator, {})]
|
|
527
|
+
}, item.value))]
|
|
528
|
+
}, `radio-group-${name}`);
|
|
529
|
+
}
|
|
530
|
+
if (entry.type === "submenu") return /* @__PURE__ */ jsxs(MenuSub, { children: [/* @__PURE__ */ jsxs(MenuSubTrigger, {
|
|
531
|
+
disabled: entry.disabled,
|
|
532
|
+
children: [entry.label, /* @__PURE__ */ jsx(Icon, {
|
|
533
|
+
icon: ArrowRight01Icon,
|
|
534
|
+
className: "rtl:-scale-x-100"
|
|
535
|
+
})]
|
|
536
|
+
}), /* @__PURE__ */ jsx(MenuSubContent, { children: dataItems(entry.items) })] }, `submenu-${entry.label}`);
|
|
537
|
+
const { value, label, disabled, shortcut, destructive, closeOnSelect } = entry;
|
|
538
|
+
return /* @__PURE__ */ jsx(MenuItem, {
|
|
539
|
+
value,
|
|
540
|
+
label,
|
|
541
|
+
disabled,
|
|
542
|
+
shortcut,
|
|
543
|
+
destructive,
|
|
544
|
+
closeOnSelect,
|
|
545
|
+
children: label
|
|
546
|
+
}, `item-${value}`);
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
/** Renders a data menu's `items` as styled parts, for a layout of your own. */
|
|
550
|
+
function MenuItems({ items }) {
|
|
551
|
+
return dataItems(items);
|
|
552
|
+
}
|
|
553
|
+
export { Menu, MenuCheckboxItem, MenuContent, MenuContextTrigger, MenuGroup, MenuGroupLabel, MenuItem, MenuItemIcon, MenuItemIndicator, MenuItems, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuShortcut, MenuSub, MenuSubContent, MenuSubTrigger, MenuTrigger, createMenuController };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import { Menubar as Menubar$1, MenubarController, MenubarOrientation, createMenubarController } from "@ui-sdk/react/menubar";
|
|
3
|
+
type MenubarProps = ComponentProps<typeof Menubar$1>;
|
|
4
|
+
/**
|
|
5
|
+
* A row of menus. ui-sdk has no trigger part for a menubar, so the bar styles
|
|
6
|
+
* the `MenuTrigger`s placed in it: leave them without a `variant`.
|
|
7
|
+
*/
|
|
8
|
+
declare function Menubar({ className, ...props }: MenubarProps): import("react").JSX.Element;
|
|
9
|
+
export { Menubar, type MenubarController, type MenubarOrientation, type MenubarProps, createMenubarController };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cnState } from "../../utilities/cn/index.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { Menubar as Menubar$1, createMenubarController } from "@ui-sdk/react/menubar";
|
|
6
|
+
// src/components/menubar/menubar.tsx
|
|
7
|
+
/**
|
|
8
|
+
* A row of menus. ui-sdk has no trigger part for a menubar, so the bar styles
|
|
9
|
+
* the `MenuTrigger`s placed in it: leave them without a `variant`.
|
|
10
|
+
*/
|
|
11
|
+
function Menubar(t0) {
|
|
12
|
+
const $ = c(8);
|
|
13
|
+
let className;
|
|
14
|
+
let props;
|
|
15
|
+
if ($[0] !== t0) {
|
|
16
|
+
({className, ...props} = t0);
|
|
17
|
+
$[0] = t0;
|
|
18
|
+
$[1] = className;
|
|
19
|
+
$[2] = props;
|
|
20
|
+
} else {
|
|
21
|
+
className = $[1];
|
|
22
|
+
props = $[2];
|
|
23
|
+
}
|
|
24
|
+
let t1;
|
|
25
|
+
if ($[3] !== className) {
|
|
26
|
+
t1 = cnState([
|
|
27
|
+
"flex h-9 w-fit items-center gap-0.5 rounded-full border bg-background p-[3px] data-disabled:pointer-events-none data-disabled:opacity-50 data-[orientation=vertical]:h-auto data-[orientation=vertical]:rounded-2xl data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch",
|
|
28
|
+
"*:data-[slot=menu-trigger]:flex *:data-[slot=menu-trigger]:h-full *:data-[slot=menu-trigger]:cursor-default *:data-[slot=menu-trigger]:items-center *:data-[slot=menu-trigger]:rounded-full *:data-[slot=menu-trigger]:px-3 *:data-[slot=menu-trigger]:text-sm *:data-[slot=menu-trigger]:font-medium *:data-[slot=menu-trigger]:select-none *:data-[slot=menu-trigger]:focus-ring-inset *:data-[slot=menu-trigger]:hover:bg-accent *:data-[slot=menu-trigger]:data-open:bg-accent *:data-[slot=menu-trigger]:data-open:ring-1 *:data-[slot=menu-trigger]:data-open:ring-input *:data-[slot=menu-trigger]:data-open:ring-inset *:data-[slot=menu-trigger]:data-open:text-accent-foreground",
|
|
29
|
+
"data-[orientation=vertical]:*:data-[slot=menu-trigger]:h-7",
|
|
30
|
+
"data-disabled:*:data-[slot=menu-trigger]:opacity-100"
|
|
31
|
+
], className);
|
|
32
|
+
$[3] = className;
|
|
33
|
+
$[4] = t1;
|
|
34
|
+
} else t1 = $[4];
|
|
35
|
+
let t2;
|
|
36
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
37
|
+
t2 = /* @__PURE__ */ jsx(Menubar$1, {
|
|
38
|
+
className: t1,
|
|
39
|
+
...props
|
|
40
|
+
});
|
|
41
|
+
$[5] = props;
|
|
42
|
+
$[6] = t1;
|
|
43
|
+
$[7] = t2;
|
|
44
|
+
} else t2 = $[7];
|
|
45
|
+
return t2;
|
|
46
|
+
}
|
|
47
|
+
export { Menubar, createMenubarController };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ButtonProps } from "../button/button.js";
|
|
2
|
+
import { ToggleProps } from "../toggle/toggle.js";
|
|
3
|
+
import { ComponentProps, ReactNode } from "react";
|
|
4
|
+
/** Consecutive messages from the same sender. */
|
|
5
|
+
declare function MessageGroup({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
6
|
+
type MessageProps = ComponentProps<"div"> & {
|
|
7
|
+
/** `end` puts the turn on the far side, for the person's own messages. */
|
|
8
|
+
align?: "start" | "end";
|
|
9
|
+
};
|
|
10
|
+
declare function Message({ className, align, ...props }: MessageProps): import("react").JSX.Element;
|
|
11
|
+
declare function MessageAvatar({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
12
|
+
declare function MessageContent({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
13
|
+
declare function MessageHeader({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
14
|
+
declare function MessageFooter({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
15
|
+
type MessageActionsProps = ComponentProps<typeof MessageFooter>;
|
|
16
|
+
/**
|
|
17
|
+
* The footer of a message when it holds its actions: copy, retry, a rating.
|
|
18
|
+
* It follows the message's side, and lines the first and last icon up with
|
|
19
|
+
* the edge of the content above (a bubble's edge, or the reply's text)
|
|
20
|
+
* rather than with the buttons' padding.
|
|
21
|
+
*/
|
|
22
|
+
declare function MessageActions({ className, ...props }: MessageActionsProps): import("react").JSX.Element;
|
|
23
|
+
type MessageActionShared = {
|
|
24
|
+
/** The action's accessible name, and what its tooltip says. */
|
|
25
|
+
label: string;
|
|
26
|
+
/** `false` keeps the tooltip open after a press, for a label that changes, like "Copied". */
|
|
27
|
+
closeOnPress?: boolean;
|
|
28
|
+
/** The icon. */
|
|
29
|
+
children?: ReactNode;
|
|
30
|
+
};
|
|
31
|
+
type MessageActionButtonProps = Omit<ButtonProps, "children" | "aria-label"> & MessageActionShared & {
|
|
32
|
+
pressed?: undefined;
|
|
33
|
+
defaultPressed?: undefined;
|
|
34
|
+
onPressedChange?: undefined;
|
|
35
|
+
};
|
|
36
|
+
type MessageActionToggleProps = Omit<ToggleProps, "children" | "aria-label"> & MessageActionShared;
|
|
37
|
+
type MessageActionProps = MessageActionButtonProps | MessageActionToggleProps;
|
|
38
|
+
/**
|
|
39
|
+
* An icon button with a tooltip, named by `label`. With `pressed`,
|
|
40
|
+
* `defaultPressed` or `onPressedChange` it is a Toggle that stays pressed,
|
|
41
|
+
* for a rating. The tooltip repeats the name, so it is hidden from agents.
|
|
42
|
+
*/
|
|
43
|
+
declare function MessageAction({ label, closeOnPress, children, className, ...props }: MessageActionProps): import("react").JSX.Element;
|
|
44
|
+
export { Message, MessageAction, type MessageActionProps, MessageActions, type MessageActionsProps, MessageAvatar, MessageContent, MessageFooter, MessageGroup, MessageHeader, type MessageProps };
|