@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,491 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../utilities/cn/index.js";
|
|
3
|
+
import { Badge } from "../badge/badge.js";
|
|
4
|
+
import { Icon } from "../icon/icon.js";
|
|
5
|
+
import { Trace, TraceCollapsible, TraceCollapsibleContent, TraceCollapsibleTrigger, TraceDescription, TraceIcon, TraceLine, TraceTitle } from "../trace/trace.js";
|
|
6
|
+
import { c } from "react/compiler-runtime";
|
|
7
|
+
import { createContext, useContext, useState } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { AlertCircleIcon, CheckmarkCircle02Icon, CircleIcon, Loading03Icon } from "@hugeicons/core-free-icons";
|
|
10
|
+
// src/components/chain-of-thought/chain-of-thought.tsx
|
|
11
|
+
const ChainOfThoughtContext = createContext(null);
|
|
12
|
+
/** What `ChainOfThought` shares with its parts. Call it inside a `ChainOfThought`. */
|
|
13
|
+
function useChainOfThought() {
|
|
14
|
+
const context = useContext(ChainOfThoughtContext);
|
|
15
|
+
if (!context) throw new Error("ChainOfThought's parts must be used within ChainOfThought.");
|
|
16
|
+
return context;
|
|
17
|
+
}
|
|
18
|
+
const lineStatus = {
|
|
19
|
+
active: "running",
|
|
20
|
+
complete: void 0,
|
|
21
|
+
pending: "pending",
|
|
22
|
+
error: "error"
|
|
23
|
+
};
|
|
24
|
+
/** The icon a line draws for its status when it is given none. */
|
|
25
|
+
function StatusIcon(t0) {
|
|
26
|
+
const $ = c(4);
|
|
27
|
+
const { status } = t0;
|
|
28
|
+
if (status === "active") {
|
|
29
|
+
let t1;
|
|
30
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
31
|
+
t1 = /* @__PURE__ */ jsx(Icon, {
|
|
32
|
+
icon: Loading03Icon,
|
|
33
|
+
className: "animate-spin motion-reduce:animate-none"
|
|
34
|
+
});
|
|
35
|
+
$[0] = t1;
|
|
36
|
+
} else t1 = $[0];
|
|
37
|
+
return t1;
|
|
38
|
+
}
|
|
39
|
+
if (status === "pending") {
|
|
40
|
+
let t1;
|
|
41
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
42
|
+
t1 = /* @__PURE__ */ jsx(Icon, { icon: CircleIcon });
|
|
43
|
+
$[1] = t1;
|
|
44
|
+
} else t1 = $[1];
|
|
45
|
+
return t1;
|
|
46
|
+
}
|
|
47
|
+
const t1 = status === "error" ? AlertCircleIcon : CheckmarkCircle02Icon;
|
|
48
|
+
let t2;
|
|
49
|
+
if ($[2] !== t1) {
|
|
50
|
+
t2 = /* @__PURE__ */ jsx(Icon, { icon: t1 });
|
|
51
|
+
$[2] = t1;
|
|
52
|
+
$[3] = t2;
|
|
53
|
+
} else t2 = $[3];
|
|
54
|
+
return t2;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* A summary line and the steps under it: a `ChainOfThoughtHeader` and a
|
|
58
|
+
* `ChainOfThoughtContent`. It is open while `status` is `active` and closes
|
|
59
|
+
* when the steps end, until the person opens or closes it; from then on their
|
|
60
|
+
* choice stays. It takes Collapsible's props.
|
|
61
|
+
*/
|
|
62
|
+
function ChainOfThought(t0) {
|
|
63
|
+
const $ = c(24);
|
|
64
|
+
let children;
|
|
65
|
+
let className;
|
|
66
|
+
let defaultOpen;
|
|
67
|
+
let onOpenChange;
|
|
68
|
+
let open;
|
|
69
|
+
let props;
|
|
70
|
+
let t1;
|
|
71
|
+
if ($[0] !== t0) {
|
|
72
|
+
({status: t1, open, defaultOpen, onOpenChange, className, children, ...props} = t0);
|
|
73
|
+
$[0] = t0;
|
|
74
|
+
$[1] = children;
|
|
75
|
+
$[2] = className;
|
|
76
|
+
$[3] = defaultOpen;
|
|
77
|
+
$[4] = onOpenChange;
|
|
78
|
+
$[5] = open;
|
|
79
|
+
$[6] = props;
|
|
80
|
+
$[7] = t1;
|
|
81
|
+
} else {
|
|
82
|
+
children = $[1];
|
|
83
|
+
className = $[2];
|
|
84
|
+
defaultOpen = $[3];
|
|
85
|
+
onOpenChange = $[4];
|
|
86
|
+
open = $[5];
|
|
87
|
+
props = $[6];
|
|
88
|
+
t1 = $[7];
|
|
89
|
+
}
|
|
90
|
+
const status = t1 === void 0 ? "complete" : t1;
|
|
91
|
+
const [choice, setChoice] = useState(defaultOpen);
|
|
92
|
+
const isOpen = open ?? choice ?? status === "active";
|
|
93
|
+
let t2;
|
|
94
|
+
if ($[8] !== isOpen || $[9] !== status) {
|
|
95
|
+
t2 = {
|
|
96
|
+
status,
|
|
97
|
+
isOpen,
|
|
98
|
+
setIsOpen: setChoice
|
|
99
|
+
};
|
|
100
|
+
$[8] = isOpen;
|
|
101
|
+
$[9] = status;
|
|
102
|
+
$[10] = t2;
|
|
103
|
+
} else t2 = $[10];
|
|
104
|
+
let t3;
|
|
105
|
+
if ($[11] !== onOpenChange) {
|
|
106
|
+
t3 = (next, details) => {
|
|
107
|
+
onOpenChange?.(next, details);
|
|
108
|
+
if (!details.canceled) setChoice(next);
|
|
109
|
+
};
|
|
110
|
+
$[11] = onOpenChange;
|
|
111
|
+
$[12] = t3;
|
|
112
|
+
} else t3 = $[12];
|
|
113
|
+
let t4;
|
|
114
|
+
if ($[13] !== children || $[14] !== isOpen || $[15] !== props || $[16] !== t3) {
|
|
115
|
+
t4 = /* @__PURE__ */ jsx(TraceCollapsible, {
|
|
116
|
+
open: isOpen,
|
|
117
|
+
onOpenChange: t3,
|
|
118
|
+
...props,
|
|
119
|
+
children
|
|
120
|
+
});
|
|
121
|
+
$[13] = children;
|
|
122
|
+
$[14] = isOpen;
|
|
123
|
+
$[15] = props;
|
|
124
|
+
$[16] = t3;
|
|
125
|
+
$[17] = t4;
|
|
126
|
+
} else t4 = $[17];
|
|
127
|
+
let t5;
|
|
128
|
+
if ($[18] !== className || $[19] !== t4) {
|
|
129
|
+
t5 = /* @__PURE__ */ jsx(Trace, {
|
|
130
|
+
"data-slot": "chain-of-thought",
|
|
131
|
+
className,
|
|
132
|
+
children: t4
|
|
133
|
+
});
|
|
134
|
+
$[18] = className;
|
|
135
|
+
$[19] = t4;
|
|
136
|
+
$[20] = t5;
|
|
137
|
+
} else t5 = $[20];
|
|
138
|
+
let t6;
|
|
139
|
+
if ($[21] !== t2 || $[22] !== t5) {
|
|
140
|
+
t6 = /* @__PURE__ */ jsx(ChainOfThoughtContext.Provider, {
|
|
141
|
+
value: t2,
|
|
142
|
+
children: t5
|
|
143
|
+
});
|
|
144
|
+
$[21] = t2;
|
|
145
|
+
$[22] = t5;
|
|
146
|
+
$[23] = t6;
|
|
147
|
+
} else t6 = $[23];
|
|
148
|
+
return t6;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* The summary line, like "Researched in 3 steps". Its children are the title,
|
|
152
|
+
* "Chain of Thought" by default.
|
|
153
|
+
*/
|
|
154
|
+
function ChainOfThoughtHeader(t0) {
|
|
155
|
+
const $ = c(18);
|
|
156
|
+
let children;
|
|
157
|
+
let icon;
|
|
158
|
+
let props;
|
|
159
|
+
if ($[0] !== t0) {
|
|
160
|
+
({icon, children, ...props} = t0);
|
|
161
|
+
$[0] = t0;
|
|
162
|
+
$[1] = children;
|
|
163
|
+
$[2] = icon;
|
|
164
|
+
$[3] = props;
|
|
165
|
+
} else {
|
|
166
|
+
children = $[1];
|
|
167
|
+
icon = $[2];
|
|
168
|
+
props = $[3];
|
|
169
|
+
}
|
|
170
|
+
const { status } = useChainOfThought();
|
|
171
|
+
const t1 = lineStatus[status];
|
|
172
|
+
let t2;
|
|
173
|
+
if ($[4] !== icon || $[5] !== status) {
|
|
174
|
+
t2 = icon ?? /* @__PURE__ */ jsx(StatusIcon, { status });
|
|
175
|
+
$[4] = icon;
|
|
176
|
+
$[5] = status;
|
|
177
|
+
$[6] = t2;
|
|
178
|
+
} else t2 = $[6];
|
|
179
|
+
let t3;
|
|
180
|
+
if ($[7] !== t2) {
|
|
181
|
+
t3 = /* @__PURE__ */ jsx(TraceIcon, { children: t2 });
|
|
182
|
+
$[7] = t2;
|
|
183
|
+
$[8] = t3;
|
|
184
|
+
} else t3 = $[8];
|
|
185
|
+
const t4 = children ?? "Chain of Thought";
|
|
186
|
+
let t5;
|
|
187
|
+
if ($[9] !== t4) {
|
|
188
|
+
t5 = /* @__PURE__ */ jsx(TraceTitle, { children: t4 });
|
|
189
|
+
$[9] = t4;
|
|
190
|
+
$[10] = t5;
|
|
191
|
+
} else t5 = $[10];
|
|
192
|
+
let t6;
|
|
193
|
+
if ($[11] !== t1 || $[12] !== t3 || $[13] !== t5) {
|
|
194
|
+
t6 = /* @__PURE__ */ jsxs(TraceLine, {
|
|
195
|
+
status: t1,
|
|
196
|
+
children: [t3, t5]
|
|
197
|
+
});
|
|
198
|
+
$[11] = t1;
|
|
199
|
+
$[12] = t3;
|
|
200
|
+
$[13] = t5;
|
|
201
|
+
$[14] = t6;
|
|
202
|
+
} else t6 = $[14];
|
|
203
|
+
let t7;
|
|
204
|
+
if ($[15] !== props || $[16] !== t6) {
|
|
205
|
+
t7 = /* @__PURE__ */ jsx(TraceCollapsibleTrigger, {
|
|
206
|
+
"data-slot": "chain-of-thought-header",
|
|
207
|
+
...props,
|
|
208
|
+
children: t6
|
|
209
|
+
});
|
|
210
|
+
$[15] = props;
|
|
211
|
+
$[16] = t6;
|
|
212
|
+
$[17] = t7;
|
|
213
|
+
} else t7 = $[17];
|
|
214
|
+
return t7;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* The steps, in a Trace of their own. It stays mounted while closed, so a step
|
|
218
|
+
* the person opened is still open when the summary opens again.
|
|
219
|
+
*/
|
|
220
|
+
function ChainOfThoughtContent(t0) {
|
|
221
|
+
const $ = c(8);
|
|
222
|
+
let children;
|
|
223
|
+
let props;
|
|
224
|
+
if ($[0] !== t0) {
|
|
225
|
+
({children, ...props} = t0);
|
|
226
|
+
$[0] = t0;
|
|
227
|
+
$[1] = children;
|
|
228
|
+
$[2] = props;
|
|
229
|
+
} else {
|
|
230
|
+
children = $[1];
|
|
231
|
+
props = $[2];
|
|
232
|
+
}
|
|
233
|
+
let t1;
|
|
234
|
+
if ($[3] !== children) {
|
|
235
|
+
t1 = /* @__PURE__ */ jsx(Trace, { children });
|
|
236
|
+
$[3] = children;
|
|
237
|
+
$[4] = t1;
|
|
238
|
+
} else t1 = $[4];
|
|
239
|
+
let t2;
|
|
240
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
241
|
+
t2 = /* @__PURE__ */ jsx(TraceCollapsibleContent, {
|
|
242
|
+
"data-slot": "chain-of-thought-content",
|
|
243
|
+
keepMounted: true,
|
|
244
|
+
...props,
|
|
245
|
+
children: t1
|
|
246
|
+
});
|
|
247
|
+
$[5] = props;
|
|
248
|
+
$[6] = t1;
|
|
249
|
+
$[7] = t2;
|
|
250
|
+
} else t2 = $[7];
|
|
251
|
+
return t2;
|
|
252
|
+
}
|
|
253
|
+
/** One step: a line, and a collapsible when it has detail to show. */
|
|
254
|
+
function ChainOfThoughtStep(t0) {
|
|
255
|
+
const $ = c(34);
|
|
256
|
+
let children;
|
|
257
|
+
let className;
|
|
258
|
+
let description;
|
|
259
|
+
let icon;
|
|
260
|
+
let label;
|
|
261
|
+
let props;
|
|
262
|
+
let t1;
|
|
263
|
+
if ($[0] !== t0) {
|
|
264
|
+
({icon, label, description, status: t1, className, children, ...props} = t0);
|
|
265
|
+
$[0] = t0;
|
|
266
|
+
$[1] = children;
|
|
267
|
+
$[2] = className;
|
|
268
|
+
$[3] = description;
|
|
269
|
+
$[4] = icon;
|
|
270
|
+
$[5] = label;
|
|
271
|
+
$[6] = props;
|
|
272
|
+
$[7] = t1;
|
|
273
|
+
} else {
|
|
274
|
+
children = $[1];
|
|
275
|
+
className = $[2];
|
|
276
|
+
description = $[3];
|
|
277
|
+
icon = $[4];
|
|
278
|
+
label = $[5];
|
|
279
|
+
props = $[6];
|
|
280
|
+
t1 = $[7];
|
|
281
|
+
}
|
|
282
|
+
const status = t1 === void 0 ? "complete" : t1;
|
|
283
|
+
const t2 = lineStatus[status];
|
|
284
|
+
let t3;
|
|
285
|
+
if ($[8] !== icon || $[9] !== status) {
|
|
286
|
+
t3 = icon ?? /* @__PURE__ */ jsx(StatusIcon, { status });
|
|
287
|
+
$[8] = icon;
|
|
288
|
+
$[9] = status;
|
|
289
|
+
$[10] = t3;
|
|
290
|
+
} else t3 = $[10];
|
|
291
|
+
let t4;
|
|
292
|
+
if ($[11] !== t3) {
|
|
293
|
+
t4 = /* @__PURE__ */ jsx(TraceIcon, { children: t3 });
|
|
294
|
+
$[11] = t3;
|
|
295
|
+
$[12] = t4;
|
|
296
|
+
} else t4 = $[12];
|
|
297
|
+
const t5 = status === "active" ? "status" : void 0;
|
|
298
|
+
let t6;
|
|
299
|
+
if ($[13] !== label || $[14] !== t5) {
|
|
300
|
+
t6 = /* @__PURE__ */ jsx(TraceTitle, {
|
|
301
|
+
role: t5,
|
|
302
|
+
children: label
|
|
303
|
+
});
|
|
304
|
+
$[13] = label;
|
|
305
|
+
$[14] = t5;
|
|
306
|
+
$[15] = t6;
|
|
307
|
+
} else t6 = $[15];
|
|
308
|
+
let t7;
|
|
309
|
+
if ($[16] !== description) {
|
|
310
|
+
t7 = description != null && /* @__PURE__ */ jsx(TraceDescription, { children: description });
|
|
311
|
+
$[16] = description;
|
|
312
|
+
$[17] = t7;
|
|
313
|
+
} else t7 = $[17];
|
|
314
|
+
let t8;
|
|
315
|
+
if ($[18] !== className || $[19] !== t2 || $[20] !== t4 || $[21] !== t6 || $[22] !== t7) {
|
|
316
|
+
t8 = /* @__PURE__ */ jsxs(TraceLine, {
|
|
317
|
+
status: t2,
|
|
318
|
+
className,
|
|
319
|
+
children: [
|
|
320
|
+
t4,
|
|
321
|
+
t6,
|
|
322
|
+
t7
|
|
323
|
+
]
|
|
324
|
+
});
|
|
325
|
+
$[18] = className;
|
|
326
|
+
$[19] = t2;
|
|
327
|
+
$[20] = t4;
|
|
328
|
+
$[21] = t6;
|
|
329
|
+
$[22] = t7;
|
|
330
|
+
$[23] = t8;
|
|
331
|
+
} else t8 = $[23];
|
|
332
|
+
const line = t8;
|
|
333
|
+
if (children == null || children === false) {
|
|
334
|
+
let t9;
|
|
335
|
+
if ($[24] !== line) {
|
|
336
|
+
t9 = /* @__PURE__ */ jsx("div", {
|
|
337
|
+
"data-slot": "chain-of-thought-step",
|
|
338
|
+
children: line
|
|
339
|
+
});
|
|
340
|
+
$[24] = line;
|
|
341
|
+
$[25] = t9;
|
|
342
|
+
} else t9 = $[25];
|
|
343
|
+
return t9;
|
|
344
|
+
}
|
|
345
|
+
let t9;
|
|
346
|
+
if ($[26] !== line) {
|
|
347
|
+
t9 = /* @__PURE__ */ jsx(TraceCollapsibleTrigger, { children: line });
|
|
348
|
+
$[26] = line;
|
|
349
|
+
$[27] = t9;
|
|
350
|
+
} else t9 = $[27];
|
|
351
|
+
let t10;
|
|
352
|
+
if ($[28] !== children) {
|
|
353
|
+
t10 = /* @__PURE__ */ jsx(TraceCollapsibleContent, { children });
|
|
354
|
+
$[28] = children;
|
|
355
|
+
$[29] = t10;
|
|
356
|
+
} else t10 = $[29];
|
|
357
|
+
let t11;
|
|
358
|
+
if ($[30] !== props || $[31] !== t10 || $[32] !== t9) {
|
|
359
|
+
t11 = /* @__PURE__ */ jsxs(TraceCollapsible, {
|
|
360
|
+
"data-slot": "chain-of-thought-step",
|
|
361
|
+
...props,
|
|
362
|
+
children: [t9, t10]
|
|
363
|
+
});
|
|
364
|
+
$[30] = props;
|
|
365
|
+
$[31] = t10;
|
|
366
|
+
$[32] = t9;
|
|
367
|
+
$[33] = t11;
|
|
368
|
+
} else t11 = $[33];
|
|
369
|
+
return t11;
|
|
370
|
+
}
|
|
371
|
+
/** A wrapping row of `ChainOfThoughtSearchResult`, as a step's detail. */
|
|
372
|
+
function ChainOfThoughtSearchResults(t0) {
|
|
373
|
+
const $ = c(8);
|
|
374
|
+
let className;
|
|
375
|
+
let props;
|
|
376
|
+
if ($[0] !== t0) {
|
|
377
|
+
({className, ...props} = t0);
|
|
378
|
+
$[0] = t0;
|
|
379
|
+
$[1] = className;
|
|
380
|
+
$[2] = props;
|
|
381
|
+
} else {
|
|
382
|
+
className = $[1];
|
|
383
|
+
props = $[2];
|
|
384
|
+
}
|
|
385
|
+
let t1;
|
|
386
|
+
if ($[3] !== className) {
|
|
387
|
+
t1 = cn("flex flex-wrap items-center gap-1.5", className);
|
|
388
|
+
$[3] = className;
|
|
389
|
+
$[4] = t1;
|
|
390
|
+
} else t1 = $[4];
|
|
391
|
+
let t2;
|
|
392
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
393
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
394
|
+
"data-slot": "chain-of-thought-search-results",
|
|
395
|
+
className: t1,
|
|
396
|
+
...props
|
|
397
|
+
});
|
|
398
|
+
$[5] = props;
|
|
399
|
+
$[6] = t1;
|
|
400
|
+
$[7] = t2;
|
|
401
|
+
} else t2 = $[7];
|
|
402
|
+
return t2;
|
|
403
|
+
}
|
|
404
|
+
/** One thing a step found, like a hostname or a file, as a secondary Badge. */
|
|
405
|
+
function ChainOfThoughtSearchResult(t0) {
|
|
406
|
+
const $ = c(6);
|
|
407
|
+
let props;
|
|
408
|
+
let t1;
|
|
409
|
+
if ($[0] !== t0) {
|
|
410
|
+
({variant: t1, ...props} = t0);
|
|
411
|
+
$[0] = t0;
|
|
412
|
+
$[1] = props;
|
|
413
|
+
$[2] = t1;
|
|
414
|
+
} else {
|
|
415
|
+
props = $[1];
|
|
416
|
+
t1 = $[2];
|
|
417
|
+
}
|
|
418
|
+
const variant = t1 === void 0 ? "secondary" : t1;
|
|
419
|
+
let t2;
|
|
420
|
+
if ($[3] !== props || $[4] !== variant) {
|
|
421
|
+
t2 = /* @__PURE__ */ jsx(Badge, {
|
|
422
|
+
variant,
|
|
423
|
+
...props
|
|
424
|
+
});
|
|
425
|
+
$[3] = props;
|
|
426
|
+
$[4] = variant;
|
|
427
|
+
$[5] = t2;
|
|
428
|
+
} else t2 = $[5];
|
|
429
|
+
return t2;
|
|
430
|
+
}
|
|
431
|
+
/** An image a step produced or looked at, on a muted box, with an optional caption. */
|
|
432
|
+
function ChainOfThoughtImage(t0) {
|
|
433
|
+
const $ = c(16);
|
|
434
|
+
let caption;
|
|
435
|
+
let children;
|
|
436
|
+
let className;
|
|
437
|
+
let props;
|
|
438
|
+
if ($[0] !== t0) {
|
|
439
|
+
({className, children, caption, ...props} = t0);
|
|
440
|
+
$[0] = t0;
|
|
441
|
+
$[1] = caption;
|
|
442
|
+
$[2] = children;
|
|
443
|
+
$[3] = className;
|
|
444
|
+
$[4] = props;
|
|
445
|
+
} else {
|
|
446
|
+
caption = $[1];
|
|
447
|
+
children = $[2];
|
|
448
|
+
className = $[3];
|
|
449
|
+
props = $[4];
|
|
450
|
+
}
|
|
451
|
+
let t1;
|
|
452
|
+
if ($[5] !== className) {
|
|
453
|
+
t1 = cn("flex flex-col gap-2", className);
|
|
454
|
+
$[5] = className;
|
|
455
|
+
$[6] = t1;
|
|
456
|
+
} else t1 = $[6];
|
|
457
|
+
let t2;
|
|
458
|
+
if ($[7] !== children) {
|
|
459
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
460
|
+
className: "relative flex max-h-88 items-center justify-center overflow-hidden rounded-xl bg-muted p-3",
|
|
461
|
+
children
|
|
462
|
+
});
|
|
463
|
+
$[7] = children;
|
|
464
|
+
$[8] = t2;
|
|
465
|
+
} else t2 = $[8];
|
|
466
|
+
let t3;
|
|
467
|
+
if ($[9] !== caption) {
|
|
468
|
+
t3 = caption != null && /* @__PURE__ */ jsx("p", {
|
|
469
|
+
className: "text-xs text-muted-foreground",
|
|
470
|
+
children: caption
|
|
471
|
+
});
|
|
472
|
+
$[9] = caption;
|
|
473
|
+
$[10] = t3;
|
|
474
|
+
} else t3 = $[10];
|
|
475
|
+
let t4;
|
|
476
|
+
if ($[11] !== props || $[12] !== t1 || $[13] !== t2 || $[14] !== t3) {
|
|
477
|
+
t4 = /* @__PURE__ */ jsxs("div", {
|
|
478
|
+
"data-slot": "chain-of-thought-image",
|
|
479
|
+
className: t1,
|
|
480
|
+
...props,
|
|
481
|
+
children: [t2, t3]
|
|
482
|
+
});
|
|
483
|
+
$[11] = props;
|
|
484
|
+
$[12] = t1;
|
|
485
|
+
$[13] = t2;
|
|
486
|
+
$[14] = t3;
|
|
487
|
+
$[15] = t4;
|
|
488
|
+
} else t4 = $[15];
|
|
489
|
+
return t4;
|
|
490
|
+
}
|
|
491
|
+
export { ChainOfThought, ChainOfThoughtContent, ChainOfThoughtHeader, ChainOfThoughtImage, ChainOfThoughtSearchResult, ChainOfThoughtSearchResults, ChainOfThoughtStep, useChainOfThought };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Empty } from "../empty/empty.js";
|
|
2
|
+
import { MessageScrollerButtonProps, MessageScrollerContentProps, MessageScrollerItemProps, MessageScrollerOptions, MessageScrollerProps, MessageScrollerViewportProps, useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility } from "../message-scroller/message-scroller.js";
|
|
3
|
+
import { ComponentProps, ReactNode } from "react";
|
|
4
|
+
type ChatProps = MessageScrollerOptions & MessageScrollerProps;
|
|
5
|
+
/**
|
|
6
|
+
* The thread's frame. It follows the reply while the reader stays at the end
|
|
7
|
+
* (`autoScroll`, on by default) and takes Message Scroller's other options.
|
|
8
|
+
* It fills its parent, which sets the height; `label` names it.
|
|
9
|
+
*/
|
|
10
|
+
declare function Chat({ autoScroll, defaultScrollPosition, scrollEdgeThreshold, scrollMargin, scrollPreviousItemPeek, preserveScrollOnPrepend, ...props }: ChatProps): import("react").JSX.Element;
|
|
11
|
+
type ChatContentProps = MessageScrollerContentProps & {
|
|
12
|
+
/** Names the region that scrolls, "Messages" by default. Set it in the page's language. */
|
|
13
|
+
label?: MessageScrollerViewportProps["label"];
|
|
14
|
+
/** Classes for the element that scrolls. `className` goes to the list of messages inside it. */
|
|
15
|
+
viewportClassName?: MessageScrollerViewportProps["className"];
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* The messages: the region that scrolls and, inside it, the log that holds one
|
|
19
|
+
* `ChatItem` for each message. Set `aria-busy` on it while a reply streams.
|
|
20
|
+
*/
|
|
21
|
+
declare function ChatContent({ label, viewportClassName, ...props }: ChatContentProps): import("react").JSX.Element;
|
|
22
|
+
type ChatItemProps = MessageScrollerItemProps;
|
|
23
|
+
/**
|
|
24
|
+
* One row of the thread, around a message. Give it the message's `messageId`,
|
|
25
|
+
* and `scrollAnchor` on the person's messages, which start a turn.
|
|
26
|
+
*/
|
|
27
|
+
declare function ChatItem(props: ChatItemProps): import("react").JSX.Element;
|
|
28
|
+
type ChatScrollButtonProps = MessageScrollerButtonProps;
|
|
29
|
+
/**
|
|
30
|
+
* The button that goes back to the newest message. It shows only while there
|
|
31
|
+
* are messages below what the reader sees. Put it in `Chat`, after `ChatContent`.
|
|
32
|
+
*/
|
|
33
|
+
declare function ChatScrollButton(props: ChatScrollButtonProps): import("react").JSX.Element;
|
|
34
|
+
type ChatEmptyStateProps = Omit<ComponentProps<typeof Empty>, "title"> & {
|
|
35
|
+
/** "No messages yet" by default. */
|
|
36
|
+
title?: ReactNode;
|
|
37
|
+
/** What to do next, under the title. Pass `null` to leave it out. */
|
|
38
|
+
description?: ReactNode;
|
|
39
|
+
/** An icon above the title. */
|
|
40
|
+
icon?: ReactNode;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* What the thread shows before its first message, on abby's Empty. Render it
|
|
44
|
+
* in `Chat` in place of `ChatContent`, or inside `ChatContent`. Children
|
|
45
|
+
* replace the icon, the title and the description: compose Empty's parts there.
|
|
46
|
+
*/
|
|
47
|
+
declare function ChatEmptyState({ title, description, icon, className, children, ...props }: ChatEmptyStateProps): import("react").JSX.Element;
|
|
48
|
+
export { Chat, ChatContent, type ChatContentProps, ChatEmptyState, type ChatEmptyStateProps, ChatItem, type ChatItemProps, type ChatProps, ChatScrollButton, type ChatScrollButtonProps, useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility };
|