@vvedantb/ui 0.17.0 → 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.
Files changed (130) hide show
  1. package/README.md +253 -3
  2. package/package.json +13 -5
  3. package/shell/src/SidebarResize.tsx +1 -4
  4. package/src/ai-elements/__snapshots__/queue.test.tsx.snap +11 -0
  5. package/src/ai-elements/activity-question-utils.ts +26 -0
  6. package/src/ai-elements/activity-question.tsx +159 -0
  7. package/src/ai-elements/activity-shared.tsx +459 -0
  8. package/src/ai-elements/activity-step-detail.tsx +115 -0
  9. package/src/ai-elements/activity-step-label.ts +981 -0
  10. package/src/ai-elements/activity-tasks-utils.ts +199 -0
  11. package/src/ai-elements/activity-tasks.tsx +770 -0
  12. package/src/ai-elements/artifact.tsx +162 -52
  13. package/src/ai-elements/attachments.tsx +62 -32
  14. package/src/ai-elements/code-block.tsx +76 -22
  15. package/src/ai-elements/context.tsx +370 -0
  16. package/src/ai-elements/conversation.tsx +186 -62
  17. package/src/ai-elements/file-chip.tsx +53 -0
  18. package/src/ai-elements/message.tsx +161 -50
  19. package/src/ai-elements/model-picker-content.tsx +505 -0
  20. package/src/ai-elements/model-picker-types.ts +56 -0
  21. package/src/ai-elements/model-picker.tsx +301 -0
  22. package/src/ai-elements/model-selector.tsx +102 -21
  23. package/src/ai-elements/plan.tsx +130 -0
  24. package/src/ai-elements/prompt-input-settings.tsx +144 -0
  25. package/src/ai-elements/prompt-input-speech.tsx +189 -0
  26. package/src/ai-elements/prompt-input-traits.tsx +281 -0
  27. package/src/ai-elements/prompt-input.tsx +320 -134
  28. package/src/ai-elements/provider-icon.tsx +133 -0
  29. package/src/ai-elements/queue.tsx +293 -9
  30. package/src/ai-elements/shimmer.tsx +72 -1
  31. package/src/ai-elements/simple-model-ladder.tsx +108 -0
  32. package/src/ai-elements/test-results.tsx +510 -0
  33. package/src/ai-elements/trace.tsx +243 -0
  34. package/src/ai-elements/use-streaming-disclosure.ts +50 -0
  35. package/src/ai-elements/web-preview.tsx +349 -0
  36. package/src/composer/input-area/ComposerSlashMenu.tsx +1 -1
  37. package/src/index.ts +66 -12
  38. package/src/kibo/avatar-stack.tsx +40 -0
  39. package/src/kibo/contribution-graph.tsx +539 -0
  40. package/src/kibo/cursor.tsx +72 -0
  41. package/src/kibo/gantt-features.tsx +439 -0
  42. package/src/kibo/gantt-header.tsx +181 -0
  43. package/src/kibo/gantt-provider.tsx +657 -0
  44. package/src/kibo/gantt-sidebar.tsx +157 -0
  45. package/src/kibo/gantt-timeline.tsx +154 -0
  46. package/src/kibo/index.ts +151 -0
  47. package/src/kibo/kanban.tsx +338 -0
  48. package/src/kibo/kanbanDropTarget.ts +25 -0
  49. package/src/kibo/list.tsx +162 -0
  50. package/src/kibo/theme-switcher.tsx +109 -0
  51. package/src/kibo/video-player.tsx +237 -0
  52. package/src/markdown/Markdown.tsx +112 -0
  53. package/src/markdown/MarkdownBlockquote.tsx +45 -0
  54. package/src/markdown/MarkdownCodeBlock.tsx +197 -0
  55. package/src/markdown/MarkdownInlineCode.tsx +40 -0
  56. package/src/markdown/MarkdownLink.tsx +92 -0
  57. package/src/markdown/codeFence.ts +57 -0
  58. package/src/markdown/codeHighlight.ts +138 -0
  59. package/src/markdown/incrementalBlocks.ts +182 -0
  60. package/src/markdown/index.ts +3 -0
  61. package/src/markdown/markdownClipboard.ts +178 -0
  62. package/src/markdown/mermaid.ts +155 -0
  63. package/src/markdown/rehypeGithubAlerts.ts +80 -0
  64. package/src/motion/presets.ts +24 -0
  65. package/src/ui/__snapshots__/alt-wrappers.test.tsx.snap +19 -0
  66. package/src/ui/__snapshots__/sonner-dom.test.tsx.snap +5 -0
  67. package/src/ui/_menu-parts.tsx +29 -0
  68. package/src/ui/accordion.alt.tsx +46 -53
  69. package/src/ui/accordion.tsx +59 -10
  70. package/src/ui/avatar.tsx +56 -0
  71. package/src/ui/badge.tsx +45 -21
  72. package/src/ui/border-beam.tsx +97 -0
  73. package/src/ui/button-group.tsx +50 -21
  74. package/src/ui/button.tsx +67 -45
  75. package/src/ui/calendar.tsx +48 -5
  76. package/src/ui/card.tsx +77 -8
  77. package/src/ui/carousel.tsx +60 -0
  78. package/src/ui/centered-spinner.tsx +30 -0
  79. package/src/ui/checkbox.tsx +34 -16
  80. package/src/ui/clear-input.alt.tsx +33 -75
  81. package/src/ui/clear-input.tsx +140 -15
  82. package/src/ui/collapsible.tsx +40 -2
  83. package/src/ui/command.tsx +143 -70
  84. package/src/ui/context-menu.tsx +159 -93
  85. package/src/ui/crossfade-icon.tsx +123 -0
  86. package/src/ui/dialog.tsx +154 -70
  87. package/src/ui/dropdown-menu.tsx +177 -117
  88. package/src/ui/hover-card.tsx +59 -17
  89. package/src/ui/input-group.alt.tsx +83 -83
  90. package/src/ui/input-group.tsx +129 -58
  91. package/src/ui/input.tsx +13 -4
  92. package/src/ui/label.tsx +11 -8
  93. package/src/ui/list-row.tsx +232 -0
  94. package/src/ui/loading-state.tsx +215 -0
  95. package/src/ui/popover.tsx +56 -23
  96. package/src/ui/progress.tsx +28 -16
  97. package/src/ui/refresh-spin-icon.tsx +41 -0
  98. package/src/ui/search-input.tsx +66 -15
  99. package/src/ui/select.tsx +171 -100
  100. package/src/ui/separator.tsx +23 -14
  101. package/src/ui/slider.tsx +21 -7
  102. package/src/ui/sonner.tsx +68 -30
  103. package/src/ui/spinner.tsx +229 -11
  104. package/src/ui/status-dot.tsx +84 -0
  105. package/src/ui/surface.tsx +49 -0
  106. package/src/ui/switch.tsx +29 -15
  107. package/src/ui/table.tsx +38 -16
  108. package/src/ui/tabs.tsx +123 -35
  109. package/src/ui/tabsSliding.ts +33 -1
  110. package/src/ui/textarea.tsx +13 -4
  111. package/src/ui/tooltip.tsx +50 -14
  112. package/src/ui/ui-config.tsx +149 -0
  113. package/src/utils/cat-color.ts +123 -0
  114. package/src/utils/dayjs.ts +6 -0
  115. package/src/utils/gesture.ts +59 -0
  116. package/src/utils/runtimeVisibility.ts +167 -0
  117. package/src/utils/sharedClock.ts +96 -0
  118. package/src/utils/surface-radius.ts +16 -0
  119. package/src/utils/useDragSensors.ts +58 -0
  120. package/tokens/examples/tokens-moved/Fixture.tsx +283 -0
  121. package/tokens/examples/tokens-moved/README.md +20 -0
  122. package/tokens/examples/tokens-moved/index.html +12 -0
  123. package/tokens/examples/tokens-moved/main.tsx +6 -0
  124. package/tokens/examples/tokens-moved/package.json +14 -0
  125. package/tokens/examples/tokens-moved/styles.css +12 -0
  126. package/tokens/examples/tokens-moved/tsconfig.json +14 -0
  127. package/tokens/examples/tokens-moved/vite.config.ts +11 -0
  128. package/tokens/src/css/border-beam.css +116 -0
  129. package/tokens/src/css/compat-shadcn-rgb.css +6 -0
  130. 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
+ }