@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,457 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn, cnState } from "../../utilities/cn/index.js";
|
|
3
|
+
import { Button } from "../button/button.js";
|
|
4
|
+
import { CodeBlock, CodeBlockContent, CodeBlockCopyButton, CodeBlockLine, codeBlockActionClasses } from "../code-block/code-block.js";
|
|
5
|
+
import { Icon } from "../icon/icon.js";
|
|
6
|
+
import { useHighlightedCode } from "../code-block/use-highlighted-code.js";
|
|
7
|
+
import { Trace, TraceCollapsible, TraceCollapsibleContent, TraceCollapsibleTrigger, TraceIcon, TraceLine, TraceTitle } from "../trace/trace.js";
|
|
8
|
+
import { c } from "react/compiler-runtime";
|
|
9
|
+
import { createContext, useContext, useEffect, useRef, useState } from "react";
|
|
10
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { ComputerTerminal01Icon, Delete02Icon } from "@hugeicons/core-free-icons";
|
|
12
|
+
// src/components/terminal/terminal.tsx
|
|
13
|
+
const TerminalContext = createContext(null);
|
|
14
|
+
/** What `Terminal` shares with its parts. Call it inside a `Terminal`. */
|
|
15
|
+
function useTerminal() {
|
|
16
|
+
const context = useContext(TerminalContext);
|
|
17
|
+
if (!context) throw new Error("Terminal's parts must be used within Terminal.");
|
|
18
|
+
return context;
|
|
19
|
+
}
|
|
20
|
+
const ansiCodes = new RegExp(`${String.fromCharCode(27)}\\[[\\d;]*m`, "g");
|
|
21
|
+
/**
|
|
22
|
+
* One command: a `TerminalHeader` and a `TerminalContent`. Until the command
|
|
23
|
+
* prints something the line is plain text; then it is a button, open while
|
|
24
|
+
* `isStreaming` and closed when it ends, until the person opens or closes it.
|
|
25
|
+
* It takes Collapsible's props.
|
|
26
|
+
*/
|
|
27
|
+
function Terminal({ output, isStreaming = false, autoScroll = true, onClear, open, defaultOpen, onOpenChange, className, children = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(TerminalHeader, { children: [/* @__PURE__ */ jsx(TerminalTitle, {}), /* @__PURE__ */ jsxs(TerminalActions, { children: [/* @__PURE__ */ jsx(TerminalCopyButton, {}), /* @__PURE__ */ jsx(TerminalClearButton, {})] })] }), /* @__PURE__ */ jsx(TerminalContent, {})] }), ...props }) {
|
|
28
|
+
const [choice, setChoice] = useState(defaultOpen);
|
|
29
|
+
const collapsible = output.length > 0;
|
|
30
|
+
return /* @__PURE__ */ jsx(TerminalContext.Provider, {
|
|
31
|
+
value: {
|
|
32
|
+
output,
|
|
33
|
+
isStreaming,
|
|
34
|
+
autoScroll,
|
|
35
|
+
onClear,
|
|
36
|
+
collapsible
|
|
37
|
+
},
|
|
38
|
+
children: /* @__PURE__ */ jsx(Trace, {
|
|
39
|
+
"data-slot": "terminal",
|
|
40
|
+
className,
|
|
41
|
+
children: collapsible ? /* @__PURE__ */ jsx(TraceCollapsible, {
|
|
42
|
+
open: open ?? choice ?? isStreaming,
|
|
43
|
+
onOpenChange: (next, details) => {
|
|
44
|
+
onOpenChange?.(next, details);
|
|
45
|
+
if (!details.canceled) setChoice(next);
|
|
46
|
+
},
|
|
47
|
+
...props,
|
|
48
|
+
children
|
|
49
|
+
}) : children
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/** The row with the line and, next to it, what can't sit inside a button: the status and the actions. */
|
|
54
|
+
function TerminalHeader(t0) {
|
|
55
|
+
const $ = c(8);
|
|
56
|
+
let className;
|
|
57
|
+
let props;
|
|
58
|
+
if ($[0] !== t0) {
|
|
59
|
+
({className, ...props} = t0);
|
|
60
|
+
$[0] = t0;
|
|
61
|
+
$[1] = className;
|
|
62
|
+
$[2] = props;
|
|
63
|
+
} else {
|
|
64
|
+
className = $[1];
|
|
65
|
+
props = $[2];
|
|
66
|
+
}
|
|
67
|
+
let t1;
|
|
68
|
+
if ($[3] !== className) {
|
|
69
|
+
t1 = cn("flex min-w-0 items-center gap-2", className);
|
|
70
|
+
$[3] = className;
|
|
71
|
+
$[4] = t1;
|
|
72
|
+
} else t1 = $[4];
|
|
73
|
+
let t2;
|
|
74
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
75
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
76
|
+
"data-slot": "terminal-header",
|
|
77
|
+
className: t1,
|
|
78
|
+
...props
|
|
79
|
+
});
|
|
80
|
+
$[5] = props;
|
|
81
|
+
$[6] = t1;
|
|
82
|
+
$[7] = t2;
|
|
83
|
+
} else t2 = $[7];
|
|
84
|
+
return t2;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The line: an icon and a title that says what ran. It opens the output once
|
|
88
|
+
* there is some. While the command runs the title is a live region, so it is
|
|
89
|
+
* announced once; the output is not, or a log would be read line by line.
|
|
90
|
+
*/
|
|
91
|
+
function TerminalTitle(t0) {
|
|
92
|
+
const $ = c(21);
|
|
93
|
+
let icon;
|
|
94
|
+
let props;
|
|
95
|
+
let status;
|
|
96
|
+
let t1;
|
|
97
|
+
if ($[0] !== t0) {
|
|
98
|
+
({icon, status, children: t1, ...props} = t0);
|
|
99
|
+
$[0] = t0;
|
|
100
|
+
$[1] = icon;
|
|
101
|
+
$[2] = props;
|
|
102
|
+
$[3] = status;
|
|
103
|
+
$[4] = t1;
|
|
104
|
+
} else {
|
|
105
|
+
icon = $[1];
|
|
106
|
+
props = $[2];
|
|
107
|
+
status = $[3];
|
|
108
|
+
t1 = $[4];
|
|
109
|
+
}
|
|
110
|
+
const children = t1 === void 0 ? "Terminal" : t1;
|
|
111
|
+
const { isStreaming, collapsible } = useTerminal();
|
|
112
|
+
const t2 = status ?? (isStreaming ? "running" : void 0);
|
|
113
|
+
let t3;
|
|
114
|
+
if ($[5] !== icon) {
|
|
115
|
+
t3 = icon ?? /* @__PURE__ */ jsx(Icon, { icon: ComputerTerminal01Icon });
|
|
116
|
+
$[5] = icon;
|
|
117
|
+
$[6] = t3;
|
|
118
|
+
} else t3 = $[6];
|
|
119
|
+
let t4;
|
|
120
|
+
if ($[7] !== t3) {
|
|
121
|
+
t4 = /* @__PURE__ */ jsx(TraceIcon, { children: t3 });
|
|
122
|
+
$[7] = t3;
|
|
123
|
+
$[8] = t4;
|
|
124
|
+
} else t4 = $[8];
|
|
125
|
+
const t5 = isStreaming ? "status" : void 0;
|
|
126
|
+
let t6;
|
|
127
|
+
if ($[9] !== children || $[10] !== t5) {
|
|
128
|
+
t6 = /* @__PURE__ */ jsx(TraceTitle, {
|
|
129
|
+
role: t5,
|
|
130
|
+
children
|
|
131
|
+
});
|
|
132
|
+
$[9] = children;
|
|
133
|
+
$[10] = t5;
|
|
134
|
+
$[11] = t6;
|
|
135
|
+
} else t6 = $[11];
|
|
136
|
+
let t7;
|
|
137
|
+
if ($[12] !== t2 || $[13] !== t4 || $[14] !== t6) {
|
|
138
|
+
t7 = /* @__PURE__ */ jsxs(TraceLine, {
|
|
139
|
+
status: t2,
|
|
140
|
+
children: [t4, t6]
|
|
141
|
+
});
|
|
142
|
+
$[12] = t2;
|
|
143
|
+
$[13] = t4;
|
|
144
|
+
$[14] = t6;
|
|
145
|
+
$[15] = t7;
|
|
146
|
+
} else t7 = $[15];
|
|
147
|
+
const line = t7;
|
|
148
|
+
if (!collapsible) {
|
|
149
|
+
let t8;
|
|
150
|
+
if ($[16] !== line) {
|
|
151
|
+
t8 = /* @__PURE__ */ jsx("div", {
|
|
152
|
+
"data-slot": "terminal-title",
|
|
153
|
+
className: "flex min-w-0",
|
|
154
|
+
children: line
|
|
155
|
+
});
|
|
156
|
+
$[16] = line;
|
|
157
|
+
$[17] = t8;
|
|
158
|
+
} else t8 = $[17];
|
|
159
|
+
return t8;
|
|
160
|
+
}
|
|
161
|
+
let t8;
|
|
162
|
+
if ($[18] !== line || $[19] !== props) {
|
|
163
|
+
t8 = /* @__PURE__ */ jsx(TraceCollapsibleTrigger, {
|
|
164
|
+
"data-slot": "terminal-title",
|
|
165
|
+
...props,
|
|
166
|
+
children: line
|
|
167
|
+
});
|
|
168
|
+
$[18] = line;
|
|
169
|
+
$[19] = props;
|
|
170
|
+
$[20] = t8;
|
|
171
|
+
} else t8 = $[20];
|
|
172
|
+
return t8;
|
|
173
|
+
}
|
|
174
|
+
/** A note next to the line that shows only while the command runs. */
|
|
175
|
+
function TerminalStatus(t0) {
|
|
176
|
+
const $ = c(8);
|
|
177
|
+
let className;
|
|
178
|
+
let props;
|
|
179
|
+
if ($[0] !== t0) {
|
|
180
|
+
({className, ...props} = t0);
|
|
181
|
+
$[0] = t0;
|
|
182
|
+
$[1] = className;
|
|
183
|
+
$[2] = props;
|
|
184
|
+
} else {
|
|
185
|
+
className = $[1];
|
|
186
|
+
props = $[2];
|
|
187
|
+
}
|
|
188
|
+
const { isStreaming } = useTerminal();
|
|
189
|
+
if (!isStreaming) return null;
|
|
190
|
+
let t1;
|
|
191
|
+
if ($[3] !== className) {
|
|
192
|
+
t1 = cn("shrink-0 text-xs text-muted-foreground", className);
|
|
193
|
+
$[3] = className;
|
|
194
|
+
$[4] = t1;
|
|
195
|
+
} else t1 = $[4];
|
|
196
|
+
let t2;
|
|
197
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
198
|
+
t2 = /* @__PURE__ */ jsx("span", {
|
|
199
|
+
"data-slot": "terminal-status",
|
|
200
|
+
className: t1,
|
|
201
|
+
...props
|
|
202
|
+
});
|
|
203
|
+
$[5] = props;
|
|
204
|
+
$[6] = t1;
|
|
205
|
+
$[7] = t2;
|
|
206
|
+
} else t2 = $[7];
|
|
207
|
+
return t2;
|
|
208
|
+
}
|
|
209
|
+
/** The buttons next to the line. */
|
|
210
|
+
function TerminalActions(t0) {
|
|
211
|
+
const $ = c(8);
|
|
212
|
+
let className;
|
|
213
|
+
let props;
|
|
214
|
+
if ($[0] !== t0) {
|
|
215
|
+
({className, ...props} = t0);
|
|
216
|
+
$[0] = t0;
|
|
217
|
+
$[1] = className;
|
|
218
|
+
$[2] = props;
|
|
219
|
+
} else {
|
|
220
|
+
className = $[1];
|
|
221
|
+
props = $[2];
|
|
222
|
+
}
|
|
223
|
+
let t1;
|
|
224
|
+
if ($[3] !== className) {
|
|
225
|
+
t1 = cn("flex shrink-0 items-center gap-1", className);
|
|
226
|
+
$[3] = className;
|
|
227
|
+
$[4] = t1;
|
|
228
|
+
} else t1 = $[4];
|
|
229
|
+
let t2;
|
|
230
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
231
|
+
t2 = /* @__PURE__ */ jsx("div", {
|
|
232
|
+
"data-slot": "terminal-actions",
|
|
233
|
+
className: t1,
|
|
234
|
+
...props
|
|
235
|
+
});
|
|
236
|
+
$[5] = props;
|
|
237
|
+
$[6] = t1;
|
|
238
|
+
$[7] = t2;
|
|
239
|
+
} else t2 = $[7];
|
|
240
|
+
return t2;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Copies the output, without its ANSI codes. Its name is `aria-label`, "Copy"
|
|
244
|
+
* by default: with several terminals on a page, name the command in it.
|
|
245
|
+
*/
|
|
246
|
+
function TerminalCopyButton(props) {
|
|
247
|
+
const $ = c(5);
|
|
248
|
+
const { output } = useTerminal();
|
|
249
|
+
let t0;
|
|
250
|
+
if ($[0] !== output) {
|
|
251
|
+
t0 = output.replace(ansiCodes, "");
|
|
252
|
+
$[0] = output;
|
|
253
|
+
$[1] = t0;
|
|
254
|
+
} else t0 = $[1];
|
|
255
|
+
let t1;
|
|
256
|
+
if ($[2] !== props || $[3] !== t0) {
|
|
257
|
+
t1 = /* @__PURE__ */ jsx(CodeBlockCopyButton, {
|
|
258
|
+
value: t0,
|
|
259
|
+
...props
|
|
260
|
+
});
|
|
261
|
+
$[2] = props;
|
|
262
|
+
$[3] = t0;
|
|
263
|
+
$[4] = t1;
|
|
264
|
+
} else t1 = $[4];
|
|
265
|
+
return t1;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Calls the terminal's `onClear`, and draws nothing without it. Its name is
|
|
269
|
+
* `aria-label`, "Clear" by default.
|
|
270
|
+
*/
|
|
271
|
+
function TerminalClearButton(t0) {
|
|
272
|
+
const $ = c(23);
|
|
273
|
+
let children;
|
|
274
|
+
let className;
|
|
275
|
+
let onClick;
|
|
276
|
+
let props;
|
|
277
|
+
let t1;
|
|
278
|
+
let t2;
|
|
279
|
+
let t3;
|
|
280
|
+
if ($[0] !== t0) {
|
|
281
|
+
({variant: t1, size: t2, className, onClick, children, "aria-label": t3, ...props} = t0);
|
|
282
|
+
$[0] = t0;
|
|
283
|
+
$[1] = children;
|
|
284
|
+
$[2] = className;
|
|
285
|
+
$[3] = onClick;
|
|
286
|
+
$[4] = props;
|
|
287
|
+
$[5] = t1;
|
|
288
|
+
$[6] = t2;
|
|
289
|
+
$[7] = t3;
|
|
290
|
+
} else {
|
|
291
|
+
children = $[1];
|
|
292
|
+
className = $[2];
|
|
293
|
+
onClick = $[3];
|
|
294
|
+
props = $[4];
|
|
295
|
+
t1 = $[5];
|
|
296
|
+
t2 = $[6];
|
|
297
|
+
t3 = $[7];
|
|
298
|
+
}
|
|
299
|
+
const variant = t1 === void 0 ? "ghost" : t1;
|
|
300
|
+
const size = t2 === void 0 ? "icon-xs" : t2;
|
|
301
|
+
const label = t3 === void 0 ? "Clear" : t3;
|
|
302
|
+
const { onClear } = useTerminal();
|
|
303
|
+
if (!onClear) return null;
|
|
304
|
+
let t4;
|
|
305
|
+
if ($[8] !== className) {
|
|
306
|
+
t4 = cnState(codeBlockActionClasses, className);
|
|
307
|
+
$[8] = className;
|
|
308
|
+
$[9] = t4;
|
|
309
|
+
} else t4 = $[9];
|
|
310
|
+
let t5;
|
|
311
|
+
if ($[10] !== onClear || $[11] !== onClick) {
|
|
312
|
+
t5 = (event, details) => {
|
|
313
|
+
onClear();
|
|
314
|
+
return onClick?.(event, details);
|
|
315
|
+
};
|
|
316
|
+
$[10] = onClear;
|
|
317
|
+
$[11] = onClick;
|
|
318
|
+
$[12] = t5;
|
|
319
|
+
} else t5 = $[12];
|
|
320
|
+
let t6;
|
|
321
|
+
if ($[13] !== children) {
|
|
322
|
+
t6 = children ?? /* @__PURE__ */ jsx(Icon, { icon: Delete02Icon });
|
|
323
|
+
$[13] = children;
|
|
324
|
+
$[14] = t6;
|
|
325
|
+
} else t6 = $[14];
|
|
326
|
+
let t7;
|
|
327
|
+
if ($[15] !== label || $[16] !== props || $[17] !== size || $[18] !== t4 || $[19] !== t5 || $[20] !== t6 || $[21] !== variant) {
|
|
328
|
+
t7 = /* @__PURE__ */ jsx(Button, {
|
|
329
|
+
variant,
|
|
330
|
+
size,
|
|
331
|
+
"aria-label": label,
|
|
332
|
+
className: t4,
|
|
333
|
+
onClick: t5,
|
|
334
|
+
...props,
|
|
335
|
+
children: t6
|
|
336
|
+
});
|
|
337
|
+
$[15] = label;
|
|
338
|
+
$[16] = props;
|
|
339
|
+
$[17] = size;
|
|
340
|
+
$[18] = t4;
|
|
341
|
+
$[19] = t5;
|
|
342
|
+
$[20] = t6;
|
|
343
|
+
$[21] = variant;
|
|
344
|
+
$[22] = t7;
|
|
345
|
+
} else t7 = $[22];
|
|
346
|
+
return t7;
|
|
347
|
+
}
|
|
348
|
+
/** The block itself, apart so it highlights only once the line has output. */
|
|
349
|
+
function TerminalOutput(t0) {
|
|
350
|
+
const $ = c(14);
|
|
351
|
+
const { label, className, children } = t0;
|
|
352
|
+
const { output, autoScroll } = useTerminal();
|
|
353
|
+
const lines = useHighlightedCode(output, "ansi");
|
|
354
|
+
const content = useRef(null);
|
|
355
|
+
let t1;
|
|
356
|
+
if ($[0] !== autoScroll) {
|
|
357
|
+
t1 = () => {
|
|
358
|
+
if (autoScroll && content.current) content.current.scrollTop = content.current.scrollHeight;
|
|
359
|
+
};
|
|
360
|
+
$[0] = autoScroll;
|
|
361
|
+
$[1] = t1;
|
|
362
|
+
} else t1 = $[1];
|
|
363
|
+
let t2;
|
|
364
|
+
if ($[2] !== autoScroll || $[3] !== output) {
|
|
365
|
+
t2 = [output, autoScroll];
|
|
366
|
+
$[2] = autoScroll;
|
|
367
|
+
$[3] = output;
|
|
368
|
+
$[4] = t2;
|
|
369
|
+
} else t2 = $[4];
|
|
370
|
+
useEffect(t1, t2);
|
|
371
|
+
let t3;
|
|
372
|
+
if ($[5] !== className) {
|
|
373
|
+
t3 = cn("max-h-64", className);
|
|
374
|
+
$[5] = className;
|
|
375
|
+
$[6] = t3;
|
|
376
|
+
} else t3 = $[6];
|
|
377
|
+
let t4;
|
|
378
|
+
if ($[7] !== children || $[8] !== lines) {
|
|
379
|
+
t4 = children ?? lines.map(_temp);
|
|
380
|
+
$[7] = children;
|
|
381
|
+
$[8] = lines;
|
|
382
|
+
$[9] = t4;
|
|
383
|
+
} else t4 = $[9];
|
|
384
|
+
let t5;
|
|
385
|
+
if ($[10] !== label || $[11] !== t3 || $[12] !== t4) {
|
|
386
|
+
t5 = /* @__PURE__ */ jsx(CodeBlock, {
|
|
387
|
+
size: "sm",
|
|
388
|
+
children: /* @__PURE__ */ jsx(CodeBlockContent, {
|
|
389
|
+
ref: content,
|
|
390
|
+
wrap: true,
|
|
391
|
+
"aria-label": label,
|
|
392
|
+
className: t3,
|
|
393
|
+
children: t4
|
|
394
|
+
})
|
|
395
|
+
});
|
|
396
|
+
$[10] = label;
|
|
397
|
+
$[11] = t3;
|
|
398
|
+
$[12] = t4;
|
|
399
|
+
$[13] = t5;
|
|
400
|
+
} else t5 = $[13];
|
|
401
|
+
return t5;
|
|
402
|
+
}
|
|
403
|
+
function _temp(line, index) {
|
|
404
|
+
return /* @__PURE__ */ jsx(CodeBlockLine, { children: typeof line === "string" ? line.replace(ansiCodes, "") : line }, index);
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* The output in a Code Block, under the line, with its ANSI colors. It draws
|
|
408
|
+
* nothing until there is output. Children replace the output's lines.
|
|
409
|
+
*/
|
|
410
|
+
function TerminalContent(t0) {
|
|
411
|
+
const $ = c(12);
|
|
412
|
+
let children;
|
|
413
|
+
let className;
|
|
414
|
+
let props;
|
|
415
|
+
let t1;
|
|
416
|
+
if ($[0] !== t0) {
|
|
417
|
+
({label: t1, className, children, ...props} = t0);
|
|
418
|
+
$[0] = t0;
|
|
419
|
+
$[1] = children;
|
|
420
|
+
$[2] = className;
|
|
421
|
+
$[3] = props;
|
|
422
|
+
$[4] = t1;
|
|
423
|
+
} else {
|
|
424
|
+
children = $[1];
|
|
425
|
+
className = $[2];
|
|
426
|
+
props = $[3];
|
|
427
|
+
t1 = $[4];
|
|
428
|
+
}
|
|
429
|
+
const label = t1 === void 0 ? "Output" : t1;
|
|
430
|
+
const { collapsible } = useTerminal();
|
|
431
|
+
if (!collapsible) return null;
|
|
432
|
+
let t2;
|
|
433
|
+
if ($[5] !== children || $[6] !== className || $[7] !== label) {
|
|
434
|
+
t2 = /* @__PURE__ */ jsx(TerminalOutput, {
|
|
435
|
+
label,
|
|
436
|
+
className,
|
|
437
|
+
children
|
|
438
|
+
});
|
|
439
|
+
$[5] = children;
|
|
440
|
+
$[6] = className;
|
|
441
|
+
$[7] = label;
|
|
442
|
+
$[8] = t2;
|
|
443
|
+
} else t2 = $[8];
|
|
444
|
+
let t3;
|
|
445
|
+
if ($[9] !== props || $[10] !== t2) {
|
|
446
|
+
t3 = /* @__PURE__ */ jsx(TraceCollapsibleContent, {
|
|
447
|
+
"data-slot": "terminal-content",
|
|
448
|
+
...props,
|
|
449
|
+
children: t2
|
|
450
|
+
});
|
|
451
|
+
$[9] = props;
|
|
452
|
+
$[10] = t2;
|
|
453
|
+
$[11] = t3;
|
|
454
|
+
} else t3 = $[11];
|
|
455
|
+
return t3;
|
|
456
|
+
}
|
|
457
|
+
export { Terminal, TerminalActions, TerminalClearButton, TerminalContent, TerminalCopyButton, TerminalHeader, TerminalStatus, TerminalTitle, useTerminal };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { CodeBlockProps } from "../code-block/code-block.js";
|
|
2
|
+
import { TraceCollapsibleContent, TraceCollapsibleProps, TraceCollapsibleTrigger, TraceDescription, TraceIcon, TraceLineProps, TraceTitle } from "../trace/trace.js";
|
|
3
|
+
import { ComponentProps, ReactNode } from "react";
|
|
4
|
+
type TestStatusValue = "passed" | "failed" | "skipped" | "running";
|
|
5
|
+
type TestResultsSummaryData = {
|
|
6
|
+
passed: number;
|
|
7
|
+
failed: number;
|
|
8
|
+
skipped: number;
|
|
9
|
+
total: number;
|
|
10
|
+
/** How long the run took, in milliseconds. */
|
|
11
|
+
duration?: number;
|
|
12
|
+
};
|
|
13
|
+
type Counts = {
|
|
14
|
+
total?: number;
|
|
15
|
+
passed?: number;
|
|
16
|
+
failed?: number;
|
|
17
|
+
skipped?: number;
|
|
18
|
+
};
|
|
19
|
+
type TestResultsProps = Omit<TraceCollapsibleProps, "className" | "children"> & {
|
|
20
|
+
/** The run's counts, which the header parts read. A run with a failure starts open. */
|
|
21
|
+
summary?: TestResultsSummaryData;
|
|
22
|
+
/**
|
|
23
|
+
* Set it to `false` while the tests run: with nothing to open, the line is
|
|
24
|
+
* plain text instead of a button, and `TestResultsContent` draws nothing.
|
|
25
|
+
*/
|
|
26
|
+
collapsible?: boolean;
|
|
27
|
+
className?: string;
|
|
28
|
+
children?: ReactNode;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* A test run: a `TestResultsHeader` and a `TestResultsContent`. It starts open
|
|
32
|
+
* when `summary` has a failure, unless `defaultOpen` says otherwise. It takes
|
|
33
|
+
* Collapsible's props: `open`, `defaultOpen`, `onOpenChange`, `controller`.
|
|
34
|
+
*/
|
|
35
|
+
declare function TestResults({ summary, collapsible, defaultOpen, className, children, ...props }: TestResultsProps): import("react").JSX.Element;
|
|
36
|
+
type TestResultsHeaderProps = Omit<ComponentProps<typeof TraceCollapsibleTrigger>, "children"> & {
|
|
37
|
+
/** The line's status. By default `error` when the summary has a failure; pass `running` while the tests run. */
|
|
38
|
+
status?: TraceLineProps["status"];
|
|
39
|
+
children?: ReactNode;
|
|
40
|
+
};
|
|
41
|
+
/** The run's line, which opens the suites: a `TestResultsSummary` and a `TestResultsDuration`. */
|
|
42
|
+
declare function TestResultsHeader({ status, children, ...props }: TestResultsHeaderProps): import("react").JSX.Element;
|
|
43
|
+
type TestResultsSummaryProps = ComponentProps<typeof TraceTitle> & {
|
|
44
|
+
/** Replaces the test tube. */
|
|
45
|
+
icon?: ReactNode;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* The run's icon and title. By default the title counts the summary, "Ran 8
|
|
49
|
+
* tests, 2 failed, 1 skipped". Children replace it: while the tests run, pass
|
|
50
|
+
* the text and `role="status"`.
|
|
51
|
+
*/
|
|
52
|
+
declare function TestResultsSummary({ icon, children, ...props }: TestResultsSummaryProps): import("react").JSX.Element | null;
|
|
53
|
+
/** How long the run took, after the title. It draws nothing when the summary has no `duration`. */
|
|
54
|
+
declare function TestResultsDuration({ children, ...props }: ComponentProps<typeof TraceDescription>): import("react").JSX.Element | null;
|
|
55
|
+
type TestResultsContentProps = ComponentProps<typeof TraceCollapsibleContent>;
|
|
56
|
+
/** What the run opens: a Trace of `TestSuite` parts, or of `Test` parts. */
|
|
57
|
+
declare function TestResultsContent({ children, ...props }: TestResultsContentProps): import("react").JSX.Element | null;
|
|
58
|
+
type TestSuiteProps = TraceCollapsibleProps & {
|
|
59
|
+
/** The suite's name, usually its file. */
|
|
60
|
+
name: string;
|
|
61
|
+
/** A failed suite starts open. */
|
|
62
|
+
status: TestStatusValue;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* The tests of one file: a `TestSuiteName` and a `TestSuiteContent`. It starts
|
|
66
|
+
* open when it failed, unless `defaultOpen` says otherwise. It takes
|
|
67
|
+
* Collapsible's props.
|
|
68
|
+
*/
|
|
69
|
+
declare function TestSuite({ name, status, defaultOpen, ...props }: TestSuiteProps): import("react").JSX.Element;
|
|
70
|
+
type TestSuiteNameProps = Omit<ComponentProps<typeof TraceCollapsibleTrigger>, "children"> & {
|
|
71
|
+
/** Replaces the file icon. */
|
|
72
|
+
icon?: ReactNode;
|
|
73
|
+
/** The title. By default the suite's name. */
|
|
74
|
+
children?: ReactNode;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* The suite's line, which opens its tests. Say the counts in the title, with
|
|
78
|
+
* `TestSuiteStats`, so the line reads without being opened.
|
|
79
|
+
*/
|
|
80
|
+
declare function TestSuiteName({ icon, children, ...props }: TestSuiteNameProps): import("react").JSX.Element;
|
|
81
|
+
type TestSuiteStatsProps = ComponentProps<"span"> & Counts;
|
|
82
|
+
/**
|
|
83
|
+
* A suite's counts as text, "3 tests, 1 failed, 1 skipped": the `total`, then
|
|
84
|
+
* each count that isn't zero. It goes inside `TestSuiteName`, after the name.
|
|
85
|
+
*/
|
|
86
|
+
declare function TestSuiteStats({ total, passed, failed, skipped, children, ...props }: TestSuiteStatsProps): import("react").JSX.Element;
|
|
87
|
+
type TestSuiteContentProps = ComponentProps<typeof TraceCollapsibleContent>;
|
|
88
|
+
/** What the suite opens: a Trace of its `Test` parts. */
|
|
89
|
+
declare function TestSuiteContent({ children, ...props }: TestSuiteContentProps): import("react").JSX.Element;
|
|
90
|
+
type TestProps = Omit<TraceCollapsibleProps, "className" | "children"> & {
|
|
91
|
+
name: string;
|
|
92
|
+
status: TestStatusValue;
|
|
93
|
+
/** How long the test took, in milliseconds. */
|
|
94
|
+
duration?: number;
|
|
95
|
+
/**
|
|
96
|
+
* The failure, a `TestError`. With it the test is a line that opens into
|
|
97
|
+
* the error and takes Collapsible's props; without it, a plain line.
|
|
98
|
+
*/
|
|
99
|
+
error?: ReactNode;
|
|
100
|
+
className?: string;
|
|
101
|
+
/** Replaces the line's content: `TestStatus`, `TestName` and `TestDuration`. */
|
|
102
|
+
children?: ReactNode;
|
|
103
|
+
};
|
|
104
|
+
/** One test: its status, its name and its duration on a line, destructive when it failed. */
|
|
105
|
+
declare function Test({ name, status, duration, error, className, children, ...props }: TestProps): import("react").JSX.Element;
|
|
106
|
+
/** The icon of the test's status. It is decorative, so the name has to say a status the color doesn't. */
|
|
107
|
+
declare function TestStatus({ children, ...props }: ComponentProps<typeof TraceIcon>): import("react").JSX.Element;
|
|
108
|
+
/** The test's name. Children replace it, as in "Skipped deletes a user". */
|
|
109
|
+
declare function TestName({ children, ...props }: ComponentProps<typeof TraceTitle>): import("react").JSX.Element;
|
|
110
|
+
/** How long the test took, after its name. It draws nothing when the test has no `duration`. */
|
|
111
|
+
declare function TestDuration({ children, ...props }: ComponentProps<typeof TraceDescription>): import("react").JSX.Element | null;
|
|
112
|
+
type TestErrorProps = CodeBlockProps & {
|
|
113
|
+
/**
|
|
114
|
+
* The name of the block, "Error" by default. The block is a tab stop so the
|
|
115
|
+
* keyboard can scroll it: with several failures on a page, name the test in it.
|
|
116
|
+
*/
|
|
117
|
+
label?: string;
|
|
118
|
+
/** Goes on the block that scrolls, which is 16rem tall at most. */
|
|
119
|
+
className?: string;
|
|
120
|
+
};
|
|
121
|
+
/** A failure in a Code Block: a `TestErrorMessage` and a `TestErrorStack`. Pass it to `Test` as `error`. */
|
|
122
|
+
declare function TestError({ label, className, children, ...props }: TestErrorProps): import("react").JSX.Element;
|
|
123
|
+
/** What the assertion says, in the destructive color. */
|
|
124
|
+
declare function TestErrorMessage({ className, ...props }: ComponentProps<"span">): import("react").JSX.Element;
|
|
125
|
+
/** Where it failed: the stack, under the message. */
|
|
126
|
+
declare function TestErrorStack({ className, ...props }: ComponentProps<"span">): import("react").JSX.Element;
|
|
127
|
+
export { Test, TestDuration, TestError, TestErrorMessage, type TestErrorProps, TestErrorStack, TestName, type TestProps, TestResults, TestResultsContent, type TestResultsContentProps, TestResultsDuration, TestResultsHeader, type TestResultsHeaderProps, type TestResultsProps, TestResultsSummary, type TestResultsSummaryData, type TestResultsSummaryProps, TestStatus, type TestStatusValue, TestSuite, TestSuiteContent, TestSuiteName, type TestSuiteNameProps, type TestSuiteProps, TestSuiteStats, type TestSuiteStatsProps };
|