@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,413 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../utilities/cn/index.js";
|
|
3
|
+
import { CodeBlock, CodeBlockContent } from "../code-block/code-block.js";
|
|
4
|
+
import { Icon } from "../icon/icon.js";
|
|
5
|
+
import { Trace, TraceCollapsible, TraceCollapsibleContent, TraceCollapsibleTrigger, TraceIcon, TraceLine, TraceTitle } from "../trace/trace.js";
|
|
6
|
+
import { c } from "react/compiler-runtime";
|
|
7
|
+
import { createContext, isValidElement, useContext } from "react";
|
|
8
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { Wrench01Icon } from "@hugeicons/core-free-icons";
|
|
10
|
+
// src/components/tool/tool.tsx
|
|
11
|
+
/** The status of the Trace line that shows a call in `state`. */
|
|
12
|
+
function getToolStatus(state) {
|
|
13
|
+
if (state === "output-error") return "error";
|
|
14
|
+
if (state === "approval-requested") return "pending";
|
|
15
|
+
if (state === "output-available" || state === "output-denied") return void 0;
|
|
16
|
+
return "running";
|
|
17
|
+
}
|
|
18
|
+
function defaultToolTitle(state, name) {
|
|
19
|
+
if (state === "output-available") return `Ran ${name}`;
|
|
20
|
+
if (state === "output-error") return `Failed to run ${name}`;
|
|
21
|
+
if (state === "output-denied") return `Denied ${name}`;
|
|
22
|
+
if (state === "approval-requested") return `Waiting to run ${name}`;
|
|
23
|
+
return `Running ${name}`;
|
|
24
|
+
}
|
|
25
|
+
const ToolContext = createContext(null);
|
|
26
|
+
/**
|
|
27
|
+
* One tool call: a `ToolHeader` and a `ToolContent`. It takes Collapsible's
|
|
28
|
+
* props. Put several in one `Trace` to space them as a list.
|
|
29
|
+
*/
|
|
30
|
+
function Tool(t0) {
|
|
31
|
+
const $ = c(17);
|
|
32
|
+
let children;
|
|
33
|
+
let className;
|
|
34
|
+
let props;
|
|
35
|
+
let t1;
|
|
36
|
+
if ($[0] !== t0) {
|
|
37
|
+
({collapsible: t1, className, children, ...props} = t0);
|
|
38
|
+
$[0] = t0;
|
|
39
|
+
$[1] = children;
|
|
40
|
+
$[2] = className;
|
|
41
|
+
$[3] = props;
|
|
42
|
+
$[4] = t1;
|
|
43
|
+
} else {
|
|
44
|
+
children = $[1];
|
|
45
|
+
className = $[2];
|
|
46
|
+
props = $[3];
|
|
47
|
+
t1 = $[4];
|
|
48
|
+
}
|
|
49
|
+
const collapsible = t1 === void 0 ? true : t1;
|
|
50
|
+
let t2;
|
|
51
|
+
if ($[5] !== collapsible) {
|
|
52
|
+
t2 = { collapsible };
|
|
53
|
+
$[5] = collapsible;
|
|
54
|
+
$[6] = t2;
|
|
55
|
+
} else t2 = $[6];
|
|
56
|
+
let t3;
|
|
57
|
+
if ($[7] !== children || $[8] !== collapsible || $[9] !== props) {
|
|
58
|
+
t3 = collapsible ? /* @__PURE__ */ jsx(TraceCollapsible, {
|
|
59
|
+
...props,
|
|
60
|
+
children
|
|
61
|
+
}) : children;
|
|
62
|
+
$[7] = children;
|
|
63
|
+
$[8] = collapsible;
|
|
64
|
+
$[9] = props;
|
|
65
|
+
$[10] = t3;
|
|
66
|
+
} else t3 = $[10];
|
|
67
|
+
let t4;
|
|
68
|
+
if ($[11] !== className || $[12] !== t3) {
|
|
69
|
+
t4 = /* @__PURE__ */ jsx(Trace, {
|
|
70
|
+
"data-slot": "tool",
|
|
71
|
+
className,
|
|
72
|
+
children: t3
|
|
73
|
+
});
|
|
74
|
+
$[11] = className;
|
|
75
|
+
$[12] = t3;
|
|
76
|
+
$[13] = t4;
|
|
77
|
+
} else t4 = $[13];
|
|
78
|
+
let t5;
|
|
79
|
+
if ($[14] !== t2 || $[15] !== t4) {
|
|
80
|
+
t5 = /* @__PURE__ */ jsx(ToolContext.Provider, {
|
|
81
|
+
value: t2,
|
|
82
|
+
children: t4
|
|
83
|
+
});
|
|
84
|
+
$[14] = t2;
|
|
85
|
+
$[15] = t4;
|
|
86
|
+
$[16] = t5;
|
|
87
|
+
} else t5 = $[16];
|
|
88
|
+
return t5;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The line: "Running …" while the input streams or waits for its output, then
|
|
92
|
+
* "Ran …", "Failed to run …" or "Denied …". Children replace the icon and the
|
|
93
|
+
* title, inside the `TraceLine`. Outside a `Tool`, or in one that is not
|
|
94
|
+
* `collapsible`, it is a plain line, which a link or another trigger can wrap.
|
|
95
|
+
*/
|
|
96
|
+
function ToolHeader(t0) {
|
|
97
|
+
const $ = c(30);
|
|
98
|
+
let children;
|
|
99
|
+
let icon;
|
|
100
|
+
let props;
|
|
101
|
+
let state;
|
|
102
|
+
let t1;
|
|
103
|
+
let title;
|
|
104
|
+
let toolName;
|
|
105
|
+
let type;
|
|
106
|
+
if ($[0] !== t0) {
|
|
107
|
+
({state, type, toolName, title, icon, getTitle: t1, children, ...props} = t0);
|
|
108
|
+
$[0] = t0;
|
|
109
|
+
$[1] = children;
|
|
110
|
+
$[2] = icon;
|
|
111
|
+
$[3] = props;
|
|
112
|
+
$[4] = state;
|
|
113
|
+
$[5] = t1;
|
|
114
|
+
$[6] = title;
|
|
115
|
+
$[7] = toolName;
|
|
116
|
+
$[8] = type;
|
|
117
|
+
} else {
|
|
118
|
+
children = $[1];
|
|
119
|
+
icon = $[2];
|
|
120
|
+
props = $[3];
|
|
121
|
+
state = $[4];
|
|
122
|
+
t1 = $[5];
|
|
123
|
+
title = $[6];
|
|
124
|
+
toolName = $[7];
|
|
125
|
+
type = $[8];
|
|
126
|
+
}
|
|
127
|
+
const getTitle = t1 === void 0 ? defaultToolTitle : t1;
|
|
128
|
+
const context = useContext(ToolContext);
|
|
129
|
+
let t2;
|
|
130
|
+
if ($[9] !== state) {
|
|
131
|
+
t2 = getToolStatus(state);
|
|
132
|
+
$[9] = state;
|
|
133
|
+
$[10] = t2;
|
|
134
|
+
} else t2 = $[10];
|
|
135
|
+
const status = t2;
|
|
136
|
+
let t3;
|
|
137
|
+
if ($[11] !== title || $[12] !== toolName || $[13] !== type) {
|
|
138
|
+
t3 = title ?? toolName ?? type?.split("-").slice(1).join("-") ?? "";
|
|
139
|
+
$[11] = title;
|
|
140
|
+
$[12] = toolName;
|
|
141
|
+
$[13] = type;
|
|
142
|
+
$[14] = t3;
|
|
143
|
+
} else t3 = $[14];
|
|
144
|
+
const name = t3;
|
|
145
|
+
let t4;
|
|
146
|
+
if ($[15] !== children || $[16] !== getTitle || $[17] !== icon || $[18] !== name || $[19] !== state || $[20] !== status) {
|
|
147
|
+
t4 = children ?? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(TraceIcon, { children: icon ?? /* @__PURE__ */ jsx(Icon, { icon: Wrench01Icon }) }), /* @__PURE__ */ jsx(TraceTitle, {
|
|
148
|
+
role: status === "running" ? "status" : void 0,
|
|
149
|
+
children: getTitle(state, name)
|
|
150
|
+
})] });
|
|
151
|
+
$[15] = children;
|
|
152
|
+
$[16] = getTitle;
|
|
153
|
+
$[17] = icon;
|
|
154
|
+
$[18] = name;
|
|
155
|
+
$[19] = state;
|
|
156
|
+
$[20] = status;
|
|
157
|
+
$[21] = t4;
|
|
158
|
+
} else t4 = $[21];
|
|
159
|
+
let t5;
|
|
160
|
+
if ($[22] !== status || $[23] !== t4) {
|
|
161
|
+
t5 = /* @__PURE__ */ jsx(TraceLine, {
|
|
162
|
+
status,
|
|
163
|
+
children: t4
|
|
164
|
+
});
|
|
165
|
+
$[22] = status;
|
|
166
|
+
$[23] = t4;
|
|
167
|
+
$[24] = t5;
|
|
168
|
+
} else t5 = $[24];
|
|
169
|
+
const line = t5;
|
|
170
|
+
if (!context) return line;
|
|
171
|
+
if (!context.collapsible) {
|
|
172
|
+
let t6;
|
|
173
|
+
if ($[25] !== line) {
|
|
174
|
+
t6 = /* @__PURE__ */ jsx("div", {
|
|
175
|
+
"data-slot": "tool-header",
|
|
176
|
+
children: line
|
|
177
|
+
});
|
|
178
|
+
$[25] = line;
|
|
179
|
+
$[26] = t6;
|
|
180
|
+
} else t6 = $[26];
|
|
181
|
+
return t6;
|
|
182
|
+
}
|
|
183
|
+
let t6;
|
|
184
|
+
if ($[27] !== line || $[28] !== props) {
|
|
185
|
+
t6 = /* @__PURE__ */ jsx(TraceCollapsibleTrigger, {
|
|
186
|
+
"data-slot": "tool-header",
|
|
187
|
+
...props,
|
|
188
|
+
children: line
|
|
189
|
+
});
|
|
190
|
+
$[27] = line;
|
|
191
|
+
$[28] = props;
|
|
192
|
+
$[29] = t6;
|
|
193
|
+
} else t6 = $[29];
|
|
194
|
+
return t6;
|
|
195
|
+
}
|
|
196
|
+
/** What opens under the line: a `ToolInput`, a `ToolOutput`, or anything else. */
|
|
197
|
+
function ToolContent(t0) {
|
|
198
|
+
const $ = c(8);
|
|
199
|
+
let className;
|
|
200
|
+
let props;
|
|
201
|
+
if ($[0] !== t0) {
|
|
202
|
+
({className, ...props} = t0);
|
|
203
|
+
$[0] = t0;
|
|
204
|
+
$[1] = className;
|
|
205
|
+
$[2] = props;
|
|
206
|
+
} else {
|
|
207
|
+
className = $[1];
|
|
208
|
+
props = $[2];
|
|
209
|
+
}
|
|
210
|
+
const context = useContext(ToolContext);
|
|
211
|
+
if (context && !context.collapsible) return null;
|
|
212
|
+
let t1;
|
|
213
|
+
if ($[3] !== className) {
|
|
214
|
+
t1 = cn("flex flex-col gap-2", className);
|
|
215
|
+
$[3] = className;
|
|
216
|
+
$[4] = t1;
|
|
217
|
+
} else t1 = $[4];
|
|
218
|
+
let t2;
|
|
219
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
220
|
+
t2 = /* @__PURE__ */ jsx(TraceCollapsibleContent, {
|
|
221
|
+
"data-slot": "tool-content",
|
|
222
|
+
className: t1,
|
|
223
|
+
...props
|
|
224
|
+
});
|
|
225
|
+
$[5] = props;
|
|
226
|
+
$[6] = t1;
|
|
227
|
+
$[7] = t2;
|
|
228
|
+
} else t2 = $[7];
|
|
229
|
+
return t2;
|
|
230
|
+
}
|
|
231
|
+
/** A value as the text of a code block: a string as it is, anything else as JSON. */
|
|
232
|
+
function toText(value) {
|
|
233
|
+
return typeof value === "string" ? value : JSON.stringify(value, null, 2);
|
|
234
|
+
}
|
|
235
|
+
/** The call's input in a small code block. */
|
|
236
|
+
function ToolInput(t0) {
|
|
237
|
+
const $ = c(14);
|
|
238
|
+
let input;
|
|
239
|
+
let props;
|
|
240
|
+
let t1;
|
|
241
|
+
let t2;
|
|
242
|
+
if ($[0] !== t0) {
|
|
243
|
+
({input, label: t1, size: t2, ...props} = t0);
|
|
244
|
+
$[0] = t0;
|
|
245
|
+
$[1] = input;
|
|
246
|
+
$[2] = props;
|
|
247
|
+
$[3] = t1;
|
|
248
|
+
$[4] = t2;
|
|
249
|
+
} else {
|
|
250
|
+
input = $[1];
|
|
251
|
+
props = $[2];
|
|
252
|
+
t1 = $[3];
|
|
253
|
+
t2 = $[4];
|
|
254
|
+
}
|
|
255
|
+
const label = t1 === void 0 ? "Parameters" : t1;
|
|
256
|
+
const size = t2 === void 0 ? "sm" : t2;
|
|
257
|
+
let t3;
|
|
258
|
+
if ($[5] !== input) {
|
|
259
|
+
t3 = toText(input);
|
|
260
|
+
$[5] = input;
|
|
261
|
+
$[6] = t3;
|
|
262
|
+
} else t3 = $[6];
|
|
263
|
+
let t4;
|
|
264
|
+
if ($[7] !== label || $[8] !== t3) {
|
|
265
|
+
t4 = /* @__PURE__ */ jsx(CodeBlockContent, {
|
|
266
|
+
wrap: true,
|
|
267
|
+
className: "max-h-64",
|
|
268
|
+
"aria-label": label,
|
|
269
|
+
children: t3
|
|
270
|
+
});
|
|
271
|
+
$[7] = label;
|
|
272
|
+
$[8] = t3;
|
|
273
|
+
$[9] = t4;
|
|
274
|
+
} else t4 = $[9];
|
|
275
|
+
let t5;
|
|
276
|
+
if ($[10] !== props || $[11] !== size || $[12] !== t4) {
|
|
277
|
+
t5 = /* @__PURE__ */ jsx(CodeBlock, {
|
|
278
|
+
size,
|
|
279
|
+
...props,
|
|
280
|
+
children: t4
|
|
281
|
+
});
|
|
282
|
+
$[10] = props;
|
|
283
|
+
$[11] = size;
|
|
284
|
+
$[12] = t4;
|
|
285
|
+
$[13] = t5;
|
|
286
|
+
} else t5 = $[13];
|
|
287
|
+
return t5;
|
|
288
|
+
}
|
|
289
|
+
/** The call's output in a small code block, or its error when it failed. It draws nothing with neither. */
|
|
290
|
+
function ToolOutput(t0) {
|
|
291
|
+
const $ = c(34);
|
|
292
|
+
let className;
|
|
293
|
+
let errorText;
|
|
294
|
+
let label;
|
|
295
|
+
let output;
|
|
296
|
+
let props;
|
|
297
|
+
let t1;
|
|
298
|
+
let t2;
|
|
299
|
+
let variant;
|
|
300
|
+
if ($[0] !== t0) {
|
|
301
|
+
({output, errorText, label, errorLabel: t1, size: t2, variant, className, ...props} = t0);
|
|
302
|
+
$[0] = t0;
|
|
303
|
+
$[1] = className;
|
|
304
|
+
$[2] = errorText;
|
|
305
|
+
$[3] = label;
|
|
306
|
+
$[4] = output;
|
|
307
|
+
$[5] = props;
|
|
308
|
+
$[6] = t1;
|
|
309
|
+
$[7] = t2;
|
|
310
|
+
$[8] = variant;
|
|
311
|
+
} else {
|
|
312
|
+
className = $[1];
|
|
313
|
+
errorText = $[2];
|
|
314
|
+
label = $[3];
|
|
315
|
+
output = $[4];
|
|
316
|
+
props = $[5];
|
|
317
|
+
t1 = $[6];
|
|
318
|
+
t2 = $[7];
|
|
319
|
+
variant = $[8];
|
|
320
|
+
}
|
|
321
|
+
const errorLabel = t1 === void 0 ? label ?? "Error" : t1;
|
|
322
|
+
const size = t2 === void 0 ? "sm" : t2;
|
|
323
|
+
if (errorText) {
|
|
324
|
+
const t3 = variant ?? "destructive";
|
|
325
|
+
let t4;
|
|
326
|
+
if ($[9] !== errorLabel || $[10] !== errorText) {
|
|
327
|
+
t4 = /* @__PURE__ */ jsx(CodeBlockContent, {
|
|
328
|
+
wrap: true,
|
|
329
|
+
className: "max-h-64",
|
|
330
|
+
"aria-label": errorLabel,
|
|
331
|
+
children: errorText
|
|
332
|
+
});
|
|
333
|
+
$[9] = errorLabel;
|
|
334
|
+
$[10] = errorText;
|
|
335
|
+
$[11] = t4;
|
|
336
|
+
} else t4 = $[11];
|
|
337
|
+
let t5;
|
|
338
|
+
if ($[12] !== className || $[13] !== props || $[14] !== size || $[15] !== t3 || $[16] !== t4) {
|
|
339
|
+
t5 = /* @__PURE__ */ jsx(CodeBlock, {
|
|
340
|
+
size,
|
|
341
|
+
variant: t3,
|
|
342
|
+
className,
|
|
343
|
+
...props,
|
|
344
|
+
children: t4
|
|
345
|
+
});
|
|
346
|
+
$[12] = className;
|
|
347
|
+
$[13] = props;
|
|
348
|
+
$[14] = size;
|
|
349
|
+
$[15] = t3;
|
|
350
|
+
$[16] = t4;
|
|
351
|
+
$[17] = t5;
|
|
352
|
+
} else t5 = $[17];
|
|
353
|
+
return t5;
|
|
354
|
+
}
|
|
355
|
+
if (output == null || output === "" || output === false) return null;
|
|
356
|
+
if (isValidElement(output)) {
|
|
357
|
+
let t3;
|
|
358
|
+
if ($[18] !== className) {
|
|
359
|
+
t3 = cn("min-w-0", className);
|
|
360
|
+
$[18] = className;
|
|
361
|
+
$[19] = t3;
|
|
362
|
+
} else t3 = $[19];
|
|
363
|
+
let t4;
|
|
364
|
+
if ($[20] !== output || $[21] !== t3) {
|
|
365
|
+
t4 = /* @__PURE__ */ jsx("div", {
|
|
366
|
+
"data-slot": "tool-output",
|
|
367
|
+
className: t3,
|
|
368
|
+
children: output
|
|
369
|
+
});
|
|
370
|
+
$[20] = output;
|
|
371
|
+
$[21] = t3;
|
|
372
|
+
$[22] = t4;
|
|
373
|
+
} else t4 = $[22];
|
|
374
|
+
return t4;
|
|
375
|
+
}
|
|
376
|
+
const t3 = label ?? "Result";
|
|
377
|
+
let t4;
|
|
378
|
+
if ($[23] !== output) {
|
|
379
|
+
t4 = toText(output);
|
|
380
|
+
$[23] = output;
|
|
381
|
+
$[24] = t4;
|
|
382
|
+
} else t4 = $[24];
|
|
383
|
+
let t5;
|
|
384
|
+
if ($[25] !== t3 || $[26] !== t4) {
|
|
385
|
+
t5 = /* @__PURE__ */ jsx(CodeBlockContent, {
|
|
386
|
+
wrap: true,
|
|
387
|
+
className: "max-h-64",
|
|
388
|
+
"aria-label": t3,
|
|
389
|
+
children: t4
|
|
390
|
+
});
|
|
391
|
+
$[25] = t3;
|
|
392
|
+
$[26] = t4;
|
|
393
|
+
$[27] = t5;
|
|
394
|
+
} else t5 = $[27];
|
|
395
|
+
let t6;
|
|
396
|
+
if ($[28] !== className || $[29] !== props || $[30] !== size || $[31] !== t5 || $[32] !== variant) {
|
|
397
|
+
t6 = /* @__PURE__ */ jsx(CodeBlock, {
|
|
398
|
+
size,
|
|
399
|
+
variant,
|
|
400
|
+
className,
|
|
401
|
+
...props,
|
|
402
|
+
children: t5
|
|
403
|
+
});
|
|
404
|
+
$[28] = className;
|
|
405
|
+
$[29] = props;
|
|
406
|
+
$[30] = size;
|
|
407
|
+
$[31] = t5;
|
|
408
|
+
$[32] = variant;
|
|
409
|
+
$[33] = t6;
|
|
410
|
+
} else t6 = $[33];
|
|
411
|
+
return t6;
|
|
412
|
+
}
|
|
413
|
+
export { Tool, ToolContent, ToolHeader, ToolInput, ToolOutput, getToolStatus };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { index_d_exports } from "../../core/index.js";
|
|
2
|
+
import { VariantProps } from "../../utilities/cn/index.js";
|
|
3
|
+
import { ButtonLook } from "../button/button.js";
|
|
4
|
+
import { TooltipContent } from "../tooltip/tooltip.js";
|
|
5
|
+
import { ComponentProps, ReactElement, ReactNode } from "react";
|
|
6
|
+
import { Toggle, ToggleGroup } from "@ui-sdk/react/toggle";
|
|
7
|
+
import { Toolbar as Toolbar$1, ToolbarButton as ToolbarButton$1, ToolbarController, ToolbarGroup as ToolbarGroup$1, ToolbarInput as ToolbarInput$1, ToolbarLink as ToolbarLink$1, ToolbarOrientation, ToolbarSeparator as ToolbarSeparator$1, createToolbarController } from "@ui-sdk/react/toolbar";
|
|
8
|
+
declare const toolbarVariants: (props?: ({
|
|
9
|
+
variant?: "default" | "floating" | "inline" | null | undefined;
|
|
10
|
+
size?: "lg" | "md" | "sm" | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
|
+
type TooltipSide = ComponentProps<typeof TooltipContent>["side"];
|
|
13
|
+
type ToolbarProps = ComponentProps<typeof Toolbar$1> & VariantProps<typeof toolbarVariants> & {
|
|
14
|
+
/**
|
|
15
|
+
* Answers the single-key `shortcut` of each tool and button anywhere on
|
|
16
|
+
* the page, except while someone types in a field. For the one toolbar
|
|
17
|
+
* that owns the page.
|
|
18
|
+
*/
|
|
19
|
+
shortcuts?: boolean;
|
|
20
|
+
/** The side a tool's tooltip opens on. Below a row and beside a column by default. */
|
|
21
|
+
tooltipSide?: TooltipSide;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Name it with `aria-label`. `variant="floating"` raises it over a canvas and
|
|
25
|
+
* `inline` draws the buttons only; `size` sets every tool and button in it.
|
|
26
|
+
*/
|
|
27
|
+
declare function Toolbar({ variant, size, shortcuts, tooltipSide, className, ...props }: ToolbarProps): import("react").JSX.Element;
|
|
28
|
+
type ToolbarButtonProps = ComponentProps<typeof ToolbarButton$1> & ButtonLook & {
|
|
29
|
+
/** Its accessible name, shown in a tooltip. */
|
|
30
|
+
label?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Its keys, like `mod+z`, shown in the tooltip. With `shortcuts` on the
|
|
33
|
+
* toolbar a single key, like `u`, also presses it.
|
|
34
|
+
*/
|
|
35
|
+
shortcut?: string;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* A ghost button, as wide as a toggle. A button with only an icon needs a
|
|
39
|
+
* `label`, or an `aria-label`. A component rendered through it keeps its own
|
|
40
|
+
* look, unless the button is given a `variant` or a `size`.
|
|
41
|
+
*/
|
|
42
|
+
declare function ToolbarButton({ variant, size, label, shortcut, className, ref, ...props }: ToolbarButtonProps): import("react").JSX.Element;
|
|
43
|
+
declare function ToolbarLink({ className, ...props }: ComponentProps<typeof ToolbarLink$1>): import("react").JSX.Element;
|
|
44
|
+
/**
|
|
45
|
+
* Looks like abby's `Input`. Name it with `aria-label`. A component rendered
|
|
46
|
+
* through it, like a number input's control, keeps its own look.
|
|
47
|
+
*/
|
|
48
|
+
declare function ToolbarInput({ className, ...props }: ComponentProps<typeof ToolbarInput$1>): import("react").JSX.Element;
|
|
49
|
+
/** Name it with `aria-label`. */
|
|
50
|
+
declare function ToolbarGroup({ className, ...props }: ComponentProps<typeof ToolbarGroup$1>): import("react").JSX.Element;
|
|
51
|
+
declare function ToolbarSeparator({ className, ...props }: ComponentProps<typeof ToolbarSeparator$1>): import("react").JSX.Element;
|
|
52
|
+
type ToggleGroupProps<T extends string> = Parameters<typeof ToggleGroup<T>>[0];
|
|
53
|
+
type ToolbarToolsChangeDetails<T extends string = string> = Parameters<NonNullable<ToggleGroupProps<T>["onValueChange"]>>[1];
|
|
54
|
+
type ToolbarToolsProps<T extends string = string> = Omit<ToggleGroupProps<T>, "value" | "defaultValue" | "onValueChange" | "multiple" | "deselectable" | "children"> & {
|
|
55
|
+
/** The chosen tool's `value`, to control it. */
|
|
56
|
+
value?: T;
|
|
57
|
+
/** The tool chosen at first. */
|
|
58
|
+
defaultValue?: T;
|
|
59
|
+
/** Runs with the chosen tool's `value`. `details.cancel()` refuses the change. */
|
|
60
|
+
onValueChange?: (value: T, details: ToolbarToolsChangeDetails<T>) => void;
|
|
61
|
+
children?: ReactNode;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Tools of which exactly one is on, like the pen or the select tool: a
|
|
65
|
+
* ui-sdk ToggleGroup that joins the toolbar's arrow keys. Choosing the tool
|
|
66
|
+
* already on leaves it on. Name it with `aria-label`, and start it with
|
|
67
|
+
* `defaultValue` or `value`.
|
|
68
|
+
*/
|
|
69
|
+
declare function ToolbarTools<T extends string = string>({ value, defaultValue, onValueChange, controller, className, children, ...props }: ToolbarToolsProps<T>): import("react").JSX.Element;
|
|
70
|
+
type ToolbarToolProps = Omit<ComponentProps<typeof Toggle>, "value"> & {
|
|
71
|
+
/** Names the tool in its group's `value`. */
|
|
72
|
+
value: string;
|
|
73
|
+
/** Its accessible name, shown in a tooltip. */
|
|
74
|
+
label?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Its key, like `v`, shown in the tooltip. With `shortcuts` on the toolbar
|
|
77
|
+
* a single key also chooses the tool.
|
|
78
|
+
*/
|
|
79
|
+
shortcut?: string;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* One tool in a `ToolbarTools`. A tool with only an icon needs a `label`, or
|
|
83
|
+
* an `aria-label`.
|
|
84
|
+
*/
|
|
85
|
+
declare function ToolbarTool({ label, shortcut, className, ...props }: ToolbarToolProps): import("react").JSX.Element;
|
|
86
|
+
/**
|
|
87
|
+
* A small chevron that says a control opens more choices: after a tool's
|
|
88
|
+
* icon, or alone in a `ToolbarButton` rendered as a menu's trigger.
|
|
89
|
+
*/
|
|
90
|
+
declare function ToolbarCaret({ className, render, children, ...props }: index_d_exports.PartProps<"span">): ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
91
|
+
export { Toolbar, ToolbarButton, type ToolbarButtonProps, ToolbarCaret, type ToolbarController, ToolbarGroup, ToolbarInput, ToolbarLink, type ToolbarOrientation, type ToolbarProps, ToolbarSeparator, ToolbarTool, type ToolbarToolProps, ToolbarTools, type ToolbarToolsChangeDetails, type ToolbarToolsProps, createToolbarController, toolbarVariants };
|