@vvedantb/ui 0.17.1 → 0.18.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 +251 -3
- package/package.json +13 -5
- package/shell/src/SidebarResize.tsx +1 -4
- package/src/ai-elements/__snapshots__/queue.test.tsx.snap +11 -0
- package/src/ai-elements/activity-question-utils.ts +26 -0
- package/src/ai-elements/activity-question.tsx +159 -0
- package/src/ai-elements/activity-shared.tsx +459 -0
- package/src/ai-elements/activity-step-detail.tsx +115 -0
- package/src/ai-elements/activity-step-label.ts +981 -0
- package/src/ai-elements/activity-tasks-utils.ts +199 -0
- package/src/ai-elements/activity-tasks.tsx +770 -0
- package/src/ai-elements/artifact.tsx +162 -52
- package/src/ai-elements/attachments.tsx +62 -32
- package/src/ai-elements/code-block.tsx +76 -22
- package/src/ai-elements/context.tsx +370 -0
- package/src/ai-elements/conversation.tsx +186 -62
- package/src/ai-elements/file-chip.tsx +53 -0
- package/src/ai-elements/message.tsx +161 -50
- package/src/ai-elements/model-picker-content.tsx +505 -0
- package/src/ai-elements/model-picker-types.ts +56 -0
- package/src/ai-elements/model-picker.tsx +301 -0
- package/src/ai-elements/model-selector.tsx +102 -21
- package/src/ai-elements/plan.tsx +130 -0
- package/src/ai-elements/prompt-input-settings.tsx +144 -0
- package/src/ai-elements/prompt-input-speech.tsx +189 -0
- package/src/ai-elements/prompt-input-traits.tsx +281 -0
- package/src/ai-elements/prompt-input.tsx +320 -134
- package/src/ai-elements/provider-icon.tsx +133 -0
- package/src/ai-elements/queue.tsx +293 -9
- package/src/ai-elements/shimmer.tsx +72 -1
- package/src/ai-elements/simple-model-ladder.tsx +108 -0
- package/src/ai-elements/test-results.tsx +510 -0
- package/src/ai-elements/trace.tsx +243 -0
- package/src/ai-elements/use-streaming-disclosure.ts +50 -0
- package/src/ai-elements/web-preview.tsx +349 -0
- package/src/composer/input-area/ComposerSlashMenu.tsx +1 -1
- package/src/index.ts +66 -12
- package/src/kibo/avatar-stack.tsx +40 -0
- package/src/kibo/contribution-graph.tsx +539 -0
- package/src/kibo/cursor.tsx +72 -0
- package/src/kibo/gantt-features.tsx +439 -0
- package/src/kibo/gantt-header.tsx +181 -0
- package/src/kibo/gantt-provider.tsx +657 -0
- package/src/kibo/gantt-sidebar.tsx +157 -0
- package/src/kibo/gantt-timeline.tsx +154 -0
- package/src/kibo/index.ts +151 -0
- package/src/kibo/kanban.tsx +338 -0
- package/src/kibo/kanbanDropTarget.ts +25 -0
- package/src/kibo/list.tsx +162 -0
- package/src/kibo/theme-switcher.tsx +109 -0
- package/src/kibo/video-player.tsx +237 -0
- package/src/markdown/Markdown.tsx +112 -0
- package/src/markdown/MarkdownBlockquote.tsx +45 -0
- package/src/markdown/MarkdownCodeBlock.tsx +197 -0
- package/src/markdown/MarkdownInlineCode.tsx +40 -0
- package/src/markdown/MarkdownLink.tsx +92 -0
- package/src/markdown/codeFence.ts +57 -0
- package/src/markdown/codeHighlight.ts +138 -0
- package/src/markdown/incrementalBlocks.ts +182 -0
- package/src/markdown/index.ts +3 -0
- package/src/markdown/markdownClipboard.ts +178 -0
- package/src/markdown/mermaid.ts +155 -0
- package/src/markdown/rehypeGithubAlerts.ts +80 -0
- package/src/motion/presets.ts +24 -0
- package/src/ui/__snapshots__/alt-wrappers.test.tsx.snap +19 -0
- package/src/ui/__snapshots__/sonner-dom.test.tsx.snap +5 -0
- package/src/ui/_menu-parts.tsx +29 -0
- package/src/ui/accordion.alt.tsx +46 -53
- package/src/ui/accordion.tsx +59 -10
- package/src/ui/avatar.tsx +56 -0
- package/src/ui/badge.tsx +45 -21
- package/src/ui/border-beam.tsx +97 -0
- package/src/ui/button-group.tsx +50 -21
- package/src/ui/button.tsx +67 -45
- package/src/ui/calendar.tsx +48 -5
- package/src/ui/card.tsx +77 -8
- package/src/ui/carousel.tsx +60 -0
- package/src/ui/centered-spinner.tsx +30 -0
- package/src/ui/checkbox.tsx +34 -16
- package/src/ui/clear-input.alt.tsx +33 -75
- package/src/ui/clear-input.tsx +140 -15
- package/src/ui/collapsible.tsx +40 -2
- package/src/ui/command.tsx +143 -70
- package/src/ui/context-menu.tsx +159 -93
- package/src/ui/crossfade-icon.tsx +123 -0
- package/src/ui/dialog.tsx +154 -70
- package/src/ui/dropdown-menu.tsx +177 -117
- package/src/ui/hover-card.tsx +59 -17
- package/src/ui/input-group.alt.tsx +83 -83
- package/src/ui/input-group.tsx +129 -58
- package/src/ui/input.tsx +13 -4
- package/src/ui/label.tsx +11 -8
- package/src/ui/list-row.tsx +232 -0
- package/src/ui/loading-state.tsx +215 -0
- package/src/ui/popover.tsx +56 -23
- package/src/ui/progress.tsx +28 -16
- package/src/ui/refresh-spin-icon.tsx +41 -0
- package/src/ui/search-input.tsx +66 -15
- package/src/ui/select.tsx +171 -100
- package/src/ui/separator.tsx +23 -14
- package/src/ui/slider.tsx +21 -7
- package/src/ui/sonner.tsx +68 -30
- package/src/ui/spinner.tsx +229 -11
- package/src/ui/status-dot.tsx +84 -0
- package/src/ui/surface.tsx +49 -0
- package/src/ui/switch.tsx +29 -15
- package/src/ui/table.tsx +38 -16
- package/src/ui/tabs.tsx +123 -35
- package/src/ui/tabsSliding.ts +33 -1
- package/src/ui/textarea.tsx +13 -4
- package/src/ui/tooltip.tsx +50 -14
- package/src/ui/ui-config.tsx +149 -0
- package/src/utils/cat-color.ts +123 -0
- package/src/utils/dayjs.ts +6 -0
- package/src/utils/gesture.ts +59 -0
- package/src/utils/runtimeVisibility.ts +167 -0
- package/src/utils/sharedClock.ts +96 -0
- package/src/utils/surface-radius.ts +16 -0
- package/src/utils/useDragSensors.ts +58 -0
- package/tokens/examples/tokens-moved/Fixture.tsx +283 -0
- package/tokens/examples/tokens-moved/README.md +20 -0
- package/tokens/examples/tokens-moved/index.html +12 -0
- package/tokens/examples/tokens-moved/main.tsx +6 -0
- package/tokens/examples/tokens-moved/package.json +14 -0
- package/tokens/examples/tokens-moved/styles.css +12 -0
- package/tokens/examples/tokens-moved/tsconfig.json +14 -0
- package/tokens/examples/tokens-moved/vite.config.ts +11 -0
- package/tokens/src/css/border-beam.css +116 -0
- package/tokens/src/css/markdown.css +318 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Badge } from "../ui/badge";
|
|
4
|
+
import { useCn } from "../ui/ui-config";
|
|
5
|
+
import type { ActivityStep } from "./activity-shared";
|
|
6
|
+
import { CodeBlock, CodeBlockCopyButton } from "./code-block";
|
|
7
|
+
import { FileChip } from "./file-chip";
|
|
8
|
+
|
|
9
|
+
function basename(value: string): string {
|
|
10
|
+
const slash = Math.max(value.lastIndexOf("/"), value.lastIndexOf("\\"));
|
|
11
|
+
return slash >= 0 ? value.slice(slash + 1) : value;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Expandable body for a tool-call row: shell transcript, exit chip, edits,
|
|
16
|
+
* file chips, and write preview. Presentational only.
|
|
17
|
+
*/
|
|
18
|
+
export function ActivityStepDetail({
|
|
19
|
+
step,
|
|
20
|
+
onOpenFile,
|
|
21
|
+
}: {
|
|
22
|
+
step: ActivityStep;
|
|
23
|
+
onOpenFile?: (path: string) => void;
|
|
24
|
+
}) {
|
|
25
|
+
const merge = useCn();
|
|
26
|
+
const command =
|
|
27
|
+
step.command ?? (step.type === "bash" ? step.detail : undefined);
|
|
28
|
+
const transcript =
|
|
29
|
+
command || step.output
|
|
30
|
+
? [command ? `$ ${command}` : null, step.output?.text ?? null]
|
|
31
|
+
.filter((part): part is string => Boolean(part))
|
|
32
|
+
.join("\n\n")
|
|
33
|
+
: "";
|
|
34
|
+
|
|
35
|
+
// The transcript query strips output/edits/preview; until the full payload
|
|
36
|
+
// lands there is genuinely nothing to show but the command that produced it.
|
|
37
|
+
const awaitingDetail =
|
|
38
|
+
step.hasHiddenDetail === true &&
|
|
39
|
+
!step.output &&
|
|
40
|
+
!step.edits?.length &&
|
|
41
|
+
!step.contentPreview;
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<div
|
|
45
|
+
className={merge("space-y-2 text-xs", step.isError && "text-destructive")}
|
|
46
|
+
>
|
|
47
|
+
{awaitingDetail ? (
|
|
48
|
+
<p className="text-muted-foreground">Loading output...</p>
|
|
49
|
+
) : null}
|
|
50
|
+
{(step.output?.exitCode !== undefined || step.output?.truncated) && (
|
|
51
|
+
<div className="flex flex-wrap items-center gap-1.5">
|
|
52
|
+
{step.output.exitCode !== undefined ? (
|
|
53
|
+
<Badge
|
|
54
|
+
variant={step.output.exitCode === 0 ? "secondary" : "destructive"}
|
|
55
|
+
>
|
|
56
|
+
Exit code {step.output.exitCode}
|
|
57
|
+
</Badge>
|
|
58
|
+
) : null}
|
|
59
|
+
{step.output.truncated ? (
|
|
60
|
+
<Badge variant="outline">Truncated</Badge>
|
|
61
|
+
) : null}
|
|
62
|
+
</div>
|
|
63
|
+
)}
|
|
64
|
+
|
|
65
|
+
{transcript ? (
|
|
66
|
+
<CodeBlock code={transcript} language="shell" plain className="text-xs">
|
|
67
|
+
<CodeBlockCopyButton className="absolute right-2 top-2" />
|
|
68
|
+
<pre className="overflow-x-auto p-3 text-xs">
|
|
69
|
+
<code>{transcript}</code>
|
|
70
|
+
</pre>
|
|
71
|
+
</CodeBlock>
|
|
72
|
+
) : null}
|
|
73
|
+
|
|
74
|
+
{step.edits && step.edits.length > 0 ? (
|
|
75
|
+
<div className="space-y-2">
|
|
76
|
+
{step.edits.map((edit, index) => (
|
|
77
|
+
<div
|
|
78
|
+
key={index}
|
|
79
|
+
className="overflow-hidden rounded-md border border-border"
|
|
80
|
+
>
|
|
81
|
+
<pre className="overflow-x-auto bg-destructive/10 p-2 text-xs text-destructive whitespace-pre-wrap">
|
|
82
|
+
{edit.oldText}
|
|
83
|
+
</pre>
|
|
84
|
+
<pre className="overflow-x-auto bg-emerald-500/10 p-2 text-xs text-emerald-700 dark:text-emerald-300 whitespace-pre-wrap">
|
|
85
|
+
{edit.newText}
|
|
86
|
+
</pre>
|
|
87
|
+
</div>
|
|
88
|
+
))}
|
|
89
|
+
</div>
|
|
90
|
+
) : null}
|
|
91
|
+
|
|
92
|
+
{step.files && step.files.length > 0 ? (
|
|
93
|
+
<div className="flex flex-wrap gap-1.5">
|
|
94
|
+
{step.files.map((filePath) => (
|
|
95
|
+
<FileChip
|
|
96
|
+
key={filePath}
|
|
97
|
+
name={basename(filePath)}
|
|
98
|
+
path={filePath}
|
|
99
|
+
onOpenFile={onOpenFile}
|
|
100
|
+
/>
|
|
101
|
+
))}
|
|
102
|
+
</div>
|
|
103
|
+
) : null}
|
|
104
|
+
|
|
105
|
+
{step.contentPreview ? (
|
|
106
|
+
<CodeBlock code={step.contentPreview} language="text" plain className="text-xs">
|
|
107
|
+
<CodeBlockCopyButton className="absolute right-2 top-2" />
|
|
108
|
+
<pre className="overflow-x-auto p-3 text-xs">
|
|
109
|
+
<code>{step.contentPreview}</code>
|
|
110
|
+
</pre>
|
|
111
|
+
</CodeBlock>
|
|
112
|
+
) : null}
|
|
113
|
+
</div>
|
|
114
|
+
);
|
|
115
|
+
}
|