@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,655 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { core_exports } from "../../core/index.js";
|
|
3
|
+
import { cnState, cva } from "../../utilities/cn/index.js";
|
|
4
|
+
import { platform_exports } from "../../utilities/platform/index.js";
|
|
5
|
+
import { buttonLook } from "../button/button.js";
|
|
6
|
+
import { Icon } from "../icon/icon.js";
|
|
7
|
+
import "../input/input.js";
|
|
8
|
+
import { Kbd } from "../kbd/kbd.js";
|
|
9
|
+
import { Tooltip as Tooltip$1, TooltipContent as TooltipContent$1, TooltipTrigger as TooltipTrigger$1 } from "../tooltip/tooltip.js";
|
|
10
|
+
import { c } from "react/compiler-runtime";
|
|
11
|
+
import { createContext, isValidElement, use, useRef, useState } from "react";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { ArrowDown01Icon } from "@hugeicons/core-free-icons";
|
|
14
|
+
import { TooltipShortcut } from "@ui-sdk/react/tooltip";
|
|
15
|
+
import { Toggle, ToggleGroup, createToggleGroupController } from "@ui-sdk/react/toggle";
|
|
16
|
+
import { Toolbar as Toolbar$1, ToolbarButton as ToolbarButton$1, ToolbarGroup as ToolbarGroup$1, ToolbarInput as ToolbarInput$1, ToolbarLink as ToolbarLink$1, ToolbarSeparator as ToolbarSeparator$1, createToolbarController } from "@ui-sdk/react/toolbar";
|
|
17
|
+
// src/components/toolbar/toolbar.tsx
|
|
18
|
+
const toolbarVariants = cva([
|
|
19
|
+
"flex w-fit max-w-full items-center gap-1 data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch",
|
|
20
|
+
"[--toolbar-radius:calc(var(--toolbar-item)/2)]",
|
|
21
|
+
"[&_:is([data-slot=select-trigger],[data-slot=toolbar-input])]:h-(--toolbar-item) [&_:is([data-slot=select-trigger],[data-slot=toolbar-input])]:rounded-(--toolbar-radius) [&_[data-slot=number-input-control]]:h-(--toolbar-item) [&_:is([data-slot=number-input-decrement],[data-slot=number-input-increment])]:size-(--toolbar-item)"
|
|
22
|
+
], {
|
|
23
|
+
variants: {
|
|
24
|
+
variant: {
|
|
25
|
+
default: "rounded-full border border-border bg-background p-1",
|
|
26
|
+
floating: "rounded-[calc(var(--toolbar-radius)+var(--toolbar-pad))] popup-surface p-(--toolbar-pad)",
|
|
27
|
+
inline: ""
|
|
28
|
+
},
|
|
29
|
+
size: {
|
|
30
|
+
sm: "[--toolbar-icon:--spacing(3.5)] [--toolbar-item:--spacing(6)] [--toolbar-pad:--spacing(1)]",
|
|
31
|
+
md: "[--toolbar-icon:--spacing(4)] [--toolbar-item:--spacing(7)] [--toolbar-pad:--spacing(1)]",
|
|
32
|
+
lg: "[--toolbar-icon:--spacing(5)] [--toolbar-item:--spacing(11)] [--toolbar-pad:--spacing(1.5)]"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
defaultVariants: {
|
|
36
|
+
variant: "default",
|
|
37
|
+
size: "md"
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const ToolbarContext = createContext({
|
|
41
|
+
orientation: "horizontal",
|
|
42
|
+
shortcuts: false,
|
|
43
|
+
tooltipSide: "bottom"
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Name it with `aria-label`. `variant="floating"` raises it over a canvas and
|
|
47
|
+
* `inline` draws the buttons only; `size` sets every tool and button in it.
|
|
48
|
+
*/
|
|
49
|
+
function Toolbar(t0) {
|
|
50
|
+
const $ = c(23);
|
|
51
|
+
let className;
|
|
52
|
+
let props;
|
|
53
|
+
let size;
|
|
54
|
+
let t1;
|
|
55
|
+
let tooltipSide;
|
|
56
|
+
let variant;
|
|
57
|
+
if ($[0] !== t0) {
|
|
58
|
+
({variant, size, shortcuts: t1, tooltipSide, className, ...props} = t0);
|
|
59
|
+
$[0] = t0;
|
|
60
|
+
$[1] = className;
|
|
61
|
+
$[2] = props;
|
|
62
|
+
$[3] = size;
|
|
63
|
+
$[4] = t1;
|
|
64
|
+
$[5] = tooltipSide;
|
|
65
|
+
$[6] = variant;
|
|
66
|
+
} else {
|
|
67
|
+
className = $[1];
|
|
68
|
+
props = $[2];
|
|
69
|
+
size = $[3];
|
|
70
|
+
t1 = $[4];
|
|
71
|
+
tooltipSide = $[5];
|
|
72
|
+
variant = $[6];
|
|
73
|
+
}
|
|
74
|
+
const shortcuts = t1 === void 0 ? false : t1;
|
|
75
|
+
const orientation = props.orientation === "vertical" ? "vertical" : "horizontal";
|
|
76
|
+
const t2 = shortcuts && !props.disabled;
|
|
77
|
+
const t3 = tooltipSide ?? (orientation === "vertical" ? "end" : "bottom");
|
|
78
|
+
let t4;
|
|
79
|
+
if ($[7] !== orientation || $[8] !== t2 || $[9] !== t3) {
|
|
80
|
+
t4 = {
|
|
81
|
+
orientation,
|
|
82
|
+
shortcuts: t2,
|
|
83
|
+
tooltipSide: t3
|
|
84
|
+
};
|
|
85
|
+
$[7] = orientation;
|
|
86
|
+
$[8] = t2;
|
|
87
|
+
$[9] = t3;
|
|
88
|
+
$[10] = t4;
|
|
89
|
+
} else t4 = $[10];
|
|
90
|
+
const t5 = variant ?? "default";
|
|
91
|
+
const t6 = size ?? "md";
|
|
92
|
+
let t7;
|
|
93
|
+
if ($[11] !== className || $[12] !== size || $[13] !== variant) {
|
|
94
|
+
t7 = cnState(toolbarVariants({
|
|
95
|
+
variant,
|
|
96
|
+
size
|
|
97
|
+
}), className);
|
|
98
|
+
$[11] = className;
|
|
99
|
+
$[12] = size;
|
|
100
|
+
$[13] = variant;
|
|
101
|
+
$[14] = t7;
|
|
102
|
+
} else t7 = $[14];
|
|
103
|
+
let t8;
|
|
104
|
+
if ($[15] !== props || $[16] !== t5 || $[17] !== t6 || $[18] !== t7) {
|
|
105
|
+
t8 = /* @__PURE__ */ jsx(Toolbar$1, {
|
|
106
|
+
"data-variant": t5,
|
|
107
|
+
"data-size": t6,
|
|
108
|
+
className: t7,
|
|
109
|
+
...props
|
|
110
|
+
});
|
|
111
|
+
$[15] = props;
|
|
112
|
+
$[16] = t5;
|
|
113
|
+
$[17] = t6;
|
|
114
|
+
$[18] = t7;
|
|
115
|
+
$[19] = t8;
|
|
116
|
+
} else t8 = $[19];
|
|
117
|
+
let t9;
|
|
118
|
+
if ($[20] !== t4 || $[21] !== t8) {
|
|
119
|
+
t9 = /* @__PURE__ */ jsx(ToolbarContext, {
|
|
120
|
+
value: t4,
|
|
121
|
+
children: t8
|
|
122
|
+
});
|
|
123
|
+
$[20] = t4;
|
|
124
|
+
$[21] = t8;
|
|
125
|
+
$[22] = t9;
|
|
126
|
+
} else t9 = $[22];
|
|
127
|
+
return t9;
|
|
128
|
+
}
|
|
129
|
+
/** A shortcut that is one key on its own, like `v`: the only kind `shortcuts` answers. */
|
|
130
|
+
const singleKey = (shortcut) => shortcut && (shortcut.length === 1 || !shortcut.includes("+")) ? shortcut : null;
|
|
131
|
+
/**
|
|
132
|
+
* Wraps a tool or a button in a tooltip that shows its `label` and its
|
|
133
|
+
* `shortcut`. The control already carries the name, so an agent skips it.
|
|
134
|
+
*/
|
|
135
|
+
function ToolbarTooltip(t0) {
|
|
136
|
+
const $ = c(12);
|
|
137
|
+
const { label, shortcut, children } = t0;
|
|
138
|
+
const { tooltipSide } = use(ToolbarContext);
|
|
139
|
+
if (!label) return children;
|
|
140
|
+
let t1;
|
|
141
|
+
if ($[0] !== children) {
|
|
142
|
+
t1 = /* @__PURE__ */ jsx(TooltipTrigger$1, { render: children });
|
|
143
|
+
$[0] = children;
|
|
144
|
+
$[1] = t1;
|
|
145
|
+
} else t1 = $[1];
|
|
146
|
+
let t2;
|
|
147
|
+
if ($[2] !== shortcut) {
|
|
148
|
+
t2 = shortcut && /* @__PURE__ */ jsx(TooltipShortcut, { render: /* @__PURE__ */ jsx(Kbd, {}) });
|
|
149
|
+
$[2] = shortcut;
|
|
150
|
+
$[3] = t2;
|
|
151
|
+
} else t2 = $[3];
|
|
152
|
+
let t3;
|
|
153
|
+
if ($[4] !== label || $[5] !== t2 || $[6] !== tooltipSide) {
|
|
154
|
+
t3 = /* @__PURE__ */ jsxs(TooltipContent$1, {
|
|
155
|
+
side: tooltipSide,
|
|
156
|
+
sideOffset: 8,
|
|
157
|
+
"data-agent-hidden": "",
|
|
158
|
+
className: "flex items-center gap-2 px-2",
|
|
159
|
+
children: [label, t2]
|
|
160
|
+
});
|
|
161
|
+
$[4] = label;
|
|
162
|
+
$[5] = t2;
|
|
163
|
+
$[6] = tooltipSide;
|
|
164
|
+
$[7] = t3;
|
|
165
|
+
} else t3 = $[7];
|
|
166
|
+
let t4;
|
|
167
|
+
if ($[8] !== shortcut || $[9] !== t1 || $[10] !== t3) {
|
|
168
|
+
t4 = /* @__PURE__ */ jsxs(Tooltip$1, {
|
|
169
|
+
type: "label",
|
|
170
|
+
shortcut,
|
|
171
|
+
children: [t1, t3]
|
|
172
|
+
});
|
|
173
|
+
$[8] = shortcut;
|
|
174
|
+
$[9] = t1;
|
|
175
|
+
$[10] = t3;
|
|
176
|
+
$[11] = t4;
|
|
177
|
+
} else t4 = $[11];
|
|
178
|
+
return t4;
|
|
179
|
+
}
|
|
180
|
+
const itemSize = "h-(--toolbar-item) min-w-(--toolbar-item) rounded-(--toolbar-radius) px-[calc((var(--toolbar-item)-var(--toolbar-icon))/2)] [&_[data-slot=icon]]:size-(--toolbar-icon)";
|
|
181
|
+
/**
|
|
182
|
+
* A component rendered through a part, like `render={<SelectTrigger />}`,
|
|
183
|
+
* brings its own look, so the part adds none. A tag or a function doesn't.
|
|
184
|
+
*/
|
|
185
|
+
const rendersComponent = (render) => isValidElement(render) && typeof render.type !== "string";
|
|
186
|
+
/**
|
|
187
|
+
* A ghost button, as wide as a toggle. A button with only an icon needs a
|
|
188
|
+
* `label`, or an `aria-label`. A component rendered through it keeps its own
|
|
189
|
+
* look, unless the button is given a `variant` or a `size`.
|
|
190
|
+
*/
|
|
191
|
+
function ToolbarButton(t0) {
|
|
192
|
+
const $ = c(17);
|
|
193
|
+
const { variant, size, label, shortcut, className, ref, ...props } = t0;
|
|
194
|
+
const { shortcuts } = use(ToolbarContext);
|
|
195
|
+
const self = useRef(null);
|
|
196
|
+
let t1;
|
|
197
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
198
|
+
t1 = () => self.current?.click();
|
|
199
|
+
$[0] = t1;
|
|
200
|
+
} else t1 = $[0];
|
|
201
|
+
(0, platform_exports.useShortcut)(shortcuts && !props.disabled ? singleKey(shortcut) : null, t1);
|
|
202
|
+
const own = !variant && !size && rendersComponent(props.render);
|
|
203
|
+
let t2;
|
|
204
|
+
if ($[1] !== ref) {
|
|
205
|
+
t2 = (element) => {
|
|
206
|
+
self.current = element;
|
|
207
|
+
if (typeof ref === "function") return ref(element);
|
|
208
|
+
if (ref) ref.current = element;
|
|
209
|
+
};
|
|
210
|
+
$[1] = ref;
|
|
211
|
+
$[2] = t2;
|
|
212
|
+
} else t2 = $[2];
|
|
213
|
+
let t3;
|
|
214
|
+
if ($[3] !== className || $[4] !== own || $[5] !== size || $[6] !== variant) {
|
|
215
|
+
t3 = cnState(!own && [
|
|
216
|
+
buttonLook({
|
|
217
|
+
variant: variant ?? "ghost",
|
|
218
|
+
size: size ?? "default"
|
|
219
|
+
}),
|
|
220
|
+
!size && [itemSize, "has-[>[data-slot=toolbar-caret]:only-child]:min-w-6 has-[>[data-slot=toolbar-caret]:only-child]:px-0"],
|
|
221
|
+
"in-data-[orientation=vertical]:justify-start data-open:bg-accent data-open:ring-1 data-open:ring-input data-open:ring-inset"
|
|
222
|
+
], className);
|
|
223
|
+
$[3] = className;
|
|
224
|
+
$[4] = own;
|
|
225
|
+
$[5] = size;
|
|
226
|
+
$[6] = variant;
|
|
227
|
+
$[7] = t3;
|
|
228
|
+
} else t3 = $[7];
|
|
229
|
+
let t4;
|
|
230
|
+
if ($[8] !== label || $[9] !== props || $[10] !== t2 || $[11] !== t3) {
|
|
231
|
+
t4 = /* @__PURE__ */ jsx(ToolbarButton$1, {
|
|
232
|
+
ref: t2,
|
|
233
|
+
"aria-label": label,
|
|
234
|
+
className: t3,
|
|
235
|
+
...props
|
|
236
|
+
});
|
|
237
|
+
$[8] = label;
|
|
238
|
+
$[9] = props;
|
|
239
|
+
$[10] = t2;
|
|
240
|
+
$[11] = t3;
|
|
241
|
+
$[12] = t4;
|
|
242
|
+
} else t4 = $[12];
|
|
243
|
+
let t5;
|
|
244
|
+
if ($[13] !== label || $[14] !== shortcut || $[15] !== t4) {
|
|
245
|
+
t5 = /* @__PURE__ */ jsx(ToolbarTooltip, {
|
|
246
|
+
label,
|
|
247
|
+
shortcut,
|
|
248
|
+
children: t4
|
|
249
|
+
});
|
|
250
|
+
$[13] = label;
|
|
251
|
+
$[14] = shortcut;
|
|
252
|
+
$[15] = t4;
|
|
253
|
+
$[16] = t5;
|
|
254
|
+
} else t5 = $[16];
|
|
255
|
+
return t5;
|
|
256
|
+
}
|
|
257
|
+
function ToolbarLink(t0) {
|
|
258
|
+
const $ = c(8);
|
|
259
|
+
let className;
|
|
260
|
+
let props;
|
|
261
|
+
if ($[0] !== t0) {
|
|
262
|
+
({className, ...props} = t0);
|
|
263
|
+
$[0] = t0;
|
|
264
|
+
$[1] = className;
|
|
265
|
+
$[2] = props;
|
|
266
|
+
} else {
|
|
267
|
+
className = $[1];
|
|
268
|
+
props = $[2];
|
|
269
|
+
}
|
|
270
|
+
let t1;
|
|
271
|
+
if ($[3] !== className) {
|
|
272
|
+
t1 = cnState("inline-flex h-(--toolbar-item) items-center rounded-(--toolbar-radius) px-2.5 text-sm font-medium whitespace-nowrap text-foreground underline underline-offset-4 hover:bg-accent focus-ring data-disabled:pointer-events-none data-disabled:opacity-50", className);
|
|
273
|
+
$[3] = className;
|
|
274
|
+
$[4] = t1;
|
|
275
|
+
} else t1 = $[4];
|
|
276
|
+
let t2;
|
|
277
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
278
|
+
t2 = /* @__PURE__ */ jsx(ToolbarLink$1, {
|
|
279
|
+
className: t1,
|
|
280
|
+
...props
|
|
281
|
+
});
|
|
282
|
+
$[5] = props;
|
|
283
|
+
$[6] = t1;
|
|
284
|
+
$[7] = t2;
|
|
285
|
+
} else t2 = $[7];
|
|
286
|
+
return t2;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Looks like abby's `Input`. Name it with `aria-label`. A component rendered
|
|
290
|
+
* through it, like a number input's control, keeps its own look.
|
|
291
|
+
*/
|
|
292
|
+
function ToolbarInput(t0) {
|
|
293
|
+
const $ = c(8);
|
|
294
|
+
let T0;
|
|
295
|
+
let props;
|
|
296
|
+
let t1;
|
|
297
|
+
if ($[0] !== t0) {
|
|
298
|
+
const { className, ...t2 } = t0;
|
|
299
|
+
props = t2;
|
|
300
|
+
T0 = ToolbarInput$1;
|
|
301
|
+
t1 = cnState(!rendersComponent(props.render) && ["h-9 w-full min-w-0 rounded-full border border-input bg-transparent px-3.5 py-1 text-base transition-colors file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-placeholder focus-field data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:bg-input/50 data-disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30", "w-40 in-data-[orientation=vertical]:w-full"], className);
|
|
302
|
+
$[0] = t0;
|
|
303
|
+
$[1] = T0;
|
|
304
|
+
$[2] = props;
|
|
305
|
+
$[3] = t1;
|
|
306
|
+
} else {
|
|
307
|
+
T0 = $[1];
|
|
308
|
+
props = $[2];
|
|
309
|
+
t1 = $[3];
|
|
310
|
+
}
|
|
311
|
+
let t2;
|
|
312
|
+
if ($[4] !== T0 || $[5] !== props || $[6] !== t1) {
|
|
313
|
+
t2 = /* @__PURE__ */ jsx(T0, {
|
|
314
|
+
className: t1,
|
|
315
|
+
...props
|
|
316
|
+
});
|
|
317
|
+
$[4] = T0;
|
|
318
|
+
$[5] = props;
|
|
319
|
+
$[6] = t1;
|
|
320
|
+
$[7] = t2;
|
|
321
|
+
} else t2 = $[7];
|
|
322
|
+
return t2;
|
|
323
|
+
}
|
|
324
|
+
/** Name it with `aria-label`. */
|
|
325
|
+
function ToolbarGroup(t0) {
|
|
326
|
+
const $ = c(8);
|
|
327
|
+
let className;
|
|
328
|
+
let props;
|
|
329
|
+
if ($[0] !== t0) {
|
|
330
|
+
({className, ...props} = t0);
|
|
331
|
+
$[0] = t0;
|
|
332
|
+
$[1] = className;
|
|
333
|
+
$[2] = props;
|
|
334
|
+
} else {
|
|
335
|
+
className = $[1];
|
|
336
|
+
props = $[2];
|
|
337
|
+
}
|
|
338
|
+
let t1;
|
|
339
|
+
if ($[3] !== className) {
|
|
340
|
+
t1 = cnState("flex items-center gap-1 data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch", className);
|
|
341
|
+
$[3] = className;
|
|
342
|
+
$[4] = t1;
|
|
343
|
+
} else t1 = $[4];
|
|
344
|
+
let t2;
|
|
345
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
346
|
+
t2 = /* @__PURE__ */ jsx(ToolbarGroup$1, {
|
|
347
|
+
className: t1,
|
|
348
|
+
...props
|
|
349
|
+
});
|
|
350
|
+
$[5] = props;
|
|
351
|
+
$[6] = t1;
|
|
352
|
+
$[7] = t2;
|
|
353
|
+
} else t2 = $[7];
|
|
354
|
+
return t2;
|
|
355
|
+
}
|
|
356
|
+
function ToolbarSeparator(t0) {
|
|
357
|
+
const $ = c(8);
|
|
358
|
+
let className;
|
|
359
|
+
let props;
|
|
360
|
+
if ($[0] !== t0) {
|
|
361
|
+
({className, ...props} = t0);
|
|
362
|
+
$[0] = t0;
|
|
363
|
+
$[1] = className;
|
|
364
|
+
$[2] = props;
|
|
365
|
+
} else {
|
|
366
|
+
className = $[1];
|
|
367
|
+
props = $[2];
|
|
368
|
+
}
|
|
369
|
+
let t1;
|
|
370
|
+
if ($[3] !== className) {
|
|
371
|
+
t1 = cnState("shrink-0 self-stretch bg-border data-[orientation=horizontal]:my-0.5 data-[orientation=horizontal]:h-px data-[orientation=vertical]:mx-0.5 data-[orientation=vertical]:w-px", className);
|
|
372
|
+
$[3] = className;
|
|
373
|
+
$[4] = t1;
|
|
374
|
+
} else t1 = $[4];
|
|
375
|
+
let t2;
|
|
376
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
377
|
+
t2 = /* @__PURE__ */ jsx(ToolbarSeparator$1, {
|
|
378
|
+
className: t1,
|
|
379
|
+
...props
|
|
380
|
+
});
|
|
381
|
+
$[5] = props;
|
|
382
|
+
$[6] = t1;
|
|
383
|
+
$[7] = t2;
|
|
384
|
+
} else t2 = $[7];
|
|
385
|
+
return t2;
|
|
386
|
+
}
|
|
387
|
+
/** The group's controller, for a tool's `shortcut` to choose it, and whether the group is disabled. */
|
|
388
|
+
const ToolbarToolsContext = createContext(null);
|
|
389
|
+
/**
|
|
390
|
+
* Keeps the marker on the pressed tool: measured where the tool sits in the
|
|
391
|
+
* group, and again when the group or the tool changes size.
|
|
392
|
+
*/
|
|
393
|
+
function trackMarker(marker) {
|
|
394
|
+
const group = marker?.parentElement;
|
|
395
|
+
if (!marker || !group) return;
|
|
396
|
+
let tool = null;
|
|
397
|
+
const place = () => {
|
|
398
|
+
const pressed = group.querySelector("[data-toolbar-tool][data-pressed]");
|
|
399
|
+
if (pressed !== tool) {
|
|
400
|
+
if (tool) sizes.unobserve(tool);
|
|
401
|
+
if (pressed) sizes.observe(pressed);
|
|
402
|
+
tool = pressed;
|
|
403
|
+
}
|
|
404
|
+
if (!tool) {
|
|
405
|
+
marker.removeAttribute("data-ready");
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
let x = 0;
|
|
409
|
+
let y = 0;
|
|
410
|
+
for (let box = tool; box && box !== group; box = box.offsetParent) {
|
|
411
|
+
x += box.offsetLeft;
|
|
412
|
+
y += box.offsetTop;
|
|
413
|
+
}
|
|
414
|
+
marker.style.setProperty("--marker-x", `${x}px`);
|
|
415
|
+
marker.style.setProperty("--marker-y", `${y}px`);
|
|
416
|
+
marker.style.setProperty("--marker-width", `${tool.offsetWidth}px`);
|
|
417
|
+
marker.style.setProperty("--marker-height", `${tool.offsetHeight}px`);
|
|
418
|
+
if (!marker.hasAttribute("data-ready")) {
|
|
419
|
+
marker.offsetWidth;
|
|
420
|
+
marker.setAttribute("data-ready", "");
|
|
421
|
+
}
|
|
422
|
+
};
|
|
423
|
+
const sizes = new ResizeObserver(place);
|
|
424
|
+
const presses = new MutationObserver(place);
|
|
425
|
+
place();
|
|
426
|
+
sizes.observe(group);
|
|
427
|
+
presses.observe(group, {
|
|
428
|
+
attributeFilter: ["data-pressed"],
|
|
429
|
+
childList: true,
|
|
430
|
+
subtree: true
|
|
431
|
+
});
|
|
432
|
+
return () => {
|
|
433
|
+
sizes.disconnect();
|
|
434
|
+
presses.disconnect();
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Tools of which exactly one is on, like the pen or the select tool: a
|
|
439
|
+
* ui-sdk ToggleGroup that joins the toolbar's arrow keys. Choosing the tool
|
|
440
|
+
* already on leaves it on. Name it with `aria-label`, and start it with
|
|
441
|
+
* `defaultValue` or `value`.
|
|
442
|
+
*/
|
|
443
|
+
function ToolbarTools(t0) {
|
|
444
|
+
const $ = c(32);
|
|
445
|
+
let children;
|
|
446
|
+
let className;
|
|
447
|
+
let controller;
|
|
448
|
+
let defaultValue;
|
|
449
|
+
let onValueChange;
|
|
450
|
+
let props;
|
|
451
|
+
let value;
|
|
452
|
+
if ($[0] !== t0) {
|
|
453
|
+
({value, defaultValue, onValueChange, controller, className, children, ...props} = t0);
|
|
454
|
+
$[0] = t0;
|
|
455
|
+
$[1] = children;
|
|
456
|
+
$[2] = className;
|
|
457
|
+
$[3] = controller;
|
|
458
|
+
$[4] = defaultValue;
|
|
459
|
+
$[5] = onValueChange;
|
|
460
|
+
$[6] = props;
|
|
461
|
+
$[7] = value;
|
|
462
|
+
} else {
|
|
463
|
+
children = $[1];
|
|
464
|
+
className = $[2];
|
|
465
|
+
controller = $[3];
|
|
466
|
+
defaultValue = $[4];
|
|
467
|
+
onValueChange = $[5];
|
|
468
|
+
props = $[6];
|
|
469
|
+
value = $[7];
|
|
470
|
+
}
|
|
471
|
+
const { orientation } = use(ToolbarContext);
|
|
472
|
+
const [own] = useState(createToggleGroupController);
|
|
473
|
+
const group = controller ?? own;
|
|
474
|
+
const t1 = group;
|
|
475
|
+
const t2 = !!props.disabled;
|
|
476
|
+
let t3;
|
|
477
|
+
if ($[8] !== t1 || $[9] !== t2) {
|
|
478
|
+
t3 = {
|
|
479
|
+
group: t1,
|
|
480
|
+
disabled: t2
|
|
481
|
+
};
|
|
482
|
+
$[8] = t1;
|
|
483
|
+
$[9] = t2;
|
|
484
|
+
$[10] = t3;
|
|
485
|
+
} else t3 = $[10];
|
|
486
|
+
let t4;
|
|
487
|
+
if ($[11] !== value) {
|
|
488
|
+
t4 = value !== void 0 && { value: [value] };
|
|
489
|
+
$[11] = value;
|
|
490
|
+
$[12] = t4;
|
|
491
|
+
} else t4 = $[12];
|
|
492
|
+
let t5;
|
|
493
|
+
if ($[13] !== defaultValue) {
|
|
494
|
+
t5 = defaultValue !== void 0 && { defaultValue: [defaultValue] };
|
|
495
|
+
$[13] = defaultValue;
|
|
496
|
+
$[14] = t5;
|
|
497
|
+
} else t5 = $[14];
|
|
498
|
+
let t6;
|
|
499
|
+
if ($[15] !== onValueChange) {
|
|
500
|
+
t6 = (t7, details) => {
|
|
501
|
+
const [chosen] = t7;
|
|
502
|
+
if (chosen !== void 0) onValueChange?.(chosen, details);
|
|
503
|
+
};
|
|
504
|
+
$[15] = onValueChange;
|
|
505
|
+
$[16] = t6;
|
|
506
|
+
} else t6 = $[16];
|
|
507
|
+
let t7;
|
|
508
|
+
if ($[17] !== className) {
|
|
509
|
+
t7 = cnState("group/toolbar-tools relative isolate flex items-center gap-0.5 data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch", className);
|
|
510
|
+
$[17] = className;
|
|
511
|
+
$[18] = t7;
|
|
512
|
+
} else t7 = $[18];
|
|
513
|
+
let t8;
|
|
514
|
+
if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
|
|
515
|
+
t8 = /* @__PURE__ */ jsx("span", {
|
|
516
|
+
ref: trackMarker,
|
|
517
|
+
"aria-hidden": "true",
|
|
518
|
+
"data-slot": "toolbar-marker",
|
|
519
|
+
className: "pointer-events-none absolute top-0 left-0 -z-1 h-(--marker-height) w-(--marker-width) translate-x-(--marker-x) translate-y-(--marker-y) rounded-(--toolbar-radius) bg-primary opacity-0 transition-[translate,width,height] duration-popup ease-out not-data-ready:transition-none data-ready:opacity-100 motion-reduce:transition-none"
|
|
520
|
+
});
|
|
521
|
+
$[19] = t8;
|
|
522
|
+
} else t8 = $[19];
|
|
523
|
+
let t9;
|
|
524
|
+
if ($[20] !== children || $[21] !== group || $[22] !== orientation || $[23] !== props || $[24] !== t4 || $[25] !== t5 || $[26] !== t6 || $[27] !== t7) {
|
|
525
|
+
t9 = /* @__PURE__ */ jsxs(ToggleGroup, {
|
|
526
|
+
orientation,
|
|
527
|
+
...props,
|
|
528
|
+
...t4,
|
|
529
|
+
...t5,
|
|
530
|
+
controller: group,
|
|
531
|
+
deselectable: false,
|
|
532
|
+
onValueChange: t6,
|
|
533
|
+
className: t7,
|
|
534
|
+
children: [t8, children]
|
|
535
|
+
});
|
|
536
|
+
$[20] = children;
|
|
537
|
+
$[21] = group;
|
|
538
|
+
$[22] = orientation;
|
|
539
|
+
$[23] = props;
|
|
540
|
+
$[24] = t4;
|
|
541
|
+
$[25] = t5;
|
|
542
|
+
$[26] = t6;
|
|
543
|
+
$[27] = t7;
|
|
544
|
+
$[28] = t9;
|
|
545
|
+
} else t9 = $[28];
|
|
546
|
+
let t10;
|
|
547
|
+
if ($[29] !== t3 || $[30] !== t9) {
|
|
548
|
+
t10 = /* @__PURE__ */ jsx(ToolbarToolsContext, {
|
|
549
|
+
value: t3,
|
|
550
|
+
children: t9
|
|
551
|
+
});
|
|
552
|
+
$[29] = t3;
|
|
553
|
+
$[30] = t9;
|
|
554
|
+
$[31] = t10;
|
|
555
|
+
} else t10 = $[31];
|
|
556
|
+
return t10;
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* One tool in a `ToolbarTools`. A tool with only an icon needs a `label`, or
|
|
560
|
+
* an `aria-label`.
|
|
561
|
+
*/
|
|
562
|
+
function ToolbarTool(t0) {
|
|
563
|
+
const $ = c(22);
|
|
564
|
+
let className;
|
|
565
|
+
let label;
|
|
566
|
+
let props;
|
|
567
|
+
let shortcut;
|
|
568
|
+
if ($[0] !== t0) {
|
|
569
|
+
({label, shortcut, className, ...props} = t0);
|
|
570
|
+
$[0] = t0;
|
|
571
|
+
$[1] = className;
|
|
572
|
+
$[2] = label;
|
|
573
|
+
$[3] = props;
|
|
574
|
+
$[4] = shortcut;
|
|
575
|
+
} else {
|
|
576
|
+
className = $[1];
|
|
577
|
+
label = $[2];
|
|
578
|
+
props = $[3];
|
|
579
|
+
shortcut = $[4];
|
|
580
|
+
}
|
|
581
|
+
const { shortcuts } = use(ToolbarContext);
|
|
582
|
+
const tools = use(ToolbarToolsContext);
|
|
583
|
+
const off = props.disabled || tools?.disabled;
|
|
584
|
+
let t1;
|
|
585
|
+
if ($[5] !== off || $[6] !== shortcut || $[7] !== shortcuts) {
|
|
586
|
+
t1 = shortcuts && !off ? singleKey(shortcut) : null;
|
|
587
|
+
$[5] = off;
|
|
588
|
+
$[6] = shortcut;
|
|
589
|
+
$[7] = shortcuts;
|
|
590
|
+
$[8] = t1;
|
|
591
|
+
} else t1 = $[8];
|
|
592
|
+
let t2;
|
|
593
|
+
if ($[9] !== props.value || $[10] !== tools?.group) {
|
|
594
|
+
t2 = (event) => {
|
|
595
|
+
tools?.group.toggle(props.value, {
|
|
596
|
+
reason: "item-press",
|
|
597
|
+
event
|
|
598
|
+
});
|
|
599
|
+
};
|
|
600
|
+
$[9] = props.value;
|
|
601
|
+
$[10] = tools?.group;
|
|
602
|
+
$[11] = t2;
|
|
603
|
+
} else t2 = $[11];
|
|
604
|
+
(0, platform_exports.useShortcut)(t1, t2);
|
|
605
|
+
let t3;
|
|
606
|
+
if ($[12] !== className) {
|
|
607
|
+
t3 = cnState([
|
|
608
|
+
"inline-flex shrink-0 items-center justify-center gap-0.5 text-sm font-medium whitespace-nowrap text-foreground select-none press not-data-pressed:hover:bg-accent focus-ring data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
609
|
+
itemSize,
|
|
610
|
+
"data-pressed:bg-primary data-pressed:text-primary-foreground group-has-[[data-slot=toolbar-marker][data-ready]]/toolbar-tools:data-pressed:bg-transparent"
|
|
611
|
+
], className);
|
|
612
|
+
$[12] = className;
|
|
613
|
+
$[13] = t3;
|
|
614
|
+
} else t3 = $[13];
|
|
615
|
+
let t4;
|
|
616
|
+
if ($[14] !== label || $[15] !== props || $[16] !== t3) {
|
|
617
|
+
t4 = /* @__PURE__ */ jsx(Toggle, {
|
|
618
|
+
"data-toolbar-tool": "",
|
|
619
|
+
"aria-label": label,
|
|
620
|
+
className: t3,
|
|
621
|
+
...props
|
|
622
|
+
});
|
|
623
|
+
$[14] = label;
|
|
624
|
+
$[15] = props;
|
|
625
|
+
$[16] = t3;
|
|
626
|
+
$[17] = t4;
|
|
627
|
+
} else t4 = $[17];
|
|
628
|
+
let t5;
|
|
629
|
+
if ($[18] !== label || $[19] !== shortcut || $[20] !== t4) {
|
|
630
|
+
t5 = /* @__PURE__ */ jsx(ToolbarTooltip, {
|
|
631
|
+
label,
|
|
632
|
+
shortcut,
|
|
633
|
+
children: t4
|
|
634
|
+
});
|
|
635
|
+
$[18] = label;
|
|
636
|
+
$[19] = shortcut;
|
|
637
|
+
$[20] = t4;
|
|
638
|
+
$[21] = t5;
|
|
639
|
+
} else t5 = $[21];
|
|
640
|
+
return t5;
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* A small chevron that says a control opens more choices: after a tool's
|
|
644
|
+
* icon, or alone in a `ToolbarButton` rendered as a menu's trigger.
|
|
645
|
+
*/
|
|
646
|
+
function ToolbarCaret({ className, render, children = /* @__PURE__ */ jsx(Icon, { icon: ArrowDown01Icon }), ...props }) {
|
|
647
|
+
return (0, core_exports.renderElement)("span", {
|
|
648
|
+
"aria-hidden": true,
|
|
649
|
+
"data-slot": "toolbar-caret",
|
|
650
|
+
...props,
|
|
651
|
+
className: cnState("pointer-events-none -me-1 flex size-3 shrink-0 items-center justify-center opacity-60 only:me-0 only:opacity-100 [&_[data-slot=icon]]:size-3!", className),
|
|
652
|
+
children
|
|
653
|
+
}, render);
|
|
654
|
+
}
|
|
655
|
+
export { Toolbar, ToolbarButton, ToolbarCaret, ToolbarGroup, ToolbarInput, ToolbarLink, ToolbarSeparator, ToolbarTool, ToolbarTools, createToolbarController, toolbarVariants };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ButtonLook } from "../button/button.js";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
import { Tooltip as Tooltip$1, TooltipContent as TooltipContent$1, TooltipTrigger as TooltipTrigger$1, createTooltipController } from "@ui-sdk/react/tooltip";
|
|
4
|
+
declare function Tooltip(props: ComponentProps<typeof Tooltip$1>): import("react").JSX.Element;
|
|
5
|
+
type TooltipTriggerProps = ComponentProps<typeof TooltipTrigger$1> & ButtonLook;
|
|
6
|
+
declare function TooltipTrigger({ variant, size, className, ...props }: TooltipTriggerProps): import("react").JSX.Element;
|
|
7
|
+
declare function TooltipContent({ className, sideOffset, ...props }: ComponentProps<typeof TooltipContent$1>): import("react").JSX.Element;
|
|
8
|
+
export { Tooltip, TooltipContent, TooltipTrigger, type TooltipTriggerProps, createTooltipController };
|