@tangle-network/sandbox-ui 0.2.2 → 0.3.3

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 (67) hide show
  1. package/README.md +201 -10
  2. package/dist/auth.js +2 -2
  3. package/dist/chat-container-C8eHLw8z.d.ts +67 -0
  4. package/dist/chat.d.ts +70 -78
  5. package/dist/chat.js +8 -8
  6. package/dist/chunk-4F2GJRGU.js +756 -0
  7. package/dist/{chunk-HYEAX3DC.js → chunk-5LV6DZZF.js} +445 -114
  8. package/dist/chunk-67C53XVV.js +1106 -0
  9. package/dist/{chunk-QSQBDR3N.js → chunk-BX6AQMUS.js} +5 -2
  10. package/dist/chunk-CCKNIAS7.js +124 -0
  11. package/dist/chunk-CJ2RYVZH.js +128 -0
  12. package/dist/{chunk-KMXV7DDX.js → chunk-CNWVHQFY.js} +1 -1
  13. package/dist/{chunk-OU4TRNQZ.js → chunk-COCSO7FG.js} +3 -3
  14. package/dist/chunk-FJSVPBKY.js +85 -0
  15. package/dist/chunk-FRGMMANX.js +102 -0
  16. package/dist/{chunk-E6FS7R4X.js → chunk-HWLX5NME.js} +1 -1
  17. package/dist/chunk-JF6E2DS5.js +610 -0
  18. package/dist/chunk-MUOL44AE.js +121 -0
  19. package/dist/chunk-MXCSSOGH.js +105 -0
  20. package/dist/{chunk-J4OADEUK.js → chunk-OM6ON27W.js} +24 -9
  21. package/dist/{chunk-NI2EI43H.js → chunk-PDV7W4NY.js} +9 -124
  22. package/dist/chunk-TQN3VR4F.js +92 -0
  23. package/dist/{chunk-SOT2V7TX.js → chunk-TXI4MZAZ.js} +62 -144
  24. package/dist/chunk-WUR652Y3.js +1140 -0
  25. package/dist/chunk-YDBXQQLC.js +336 -0
  26. package/dist/{chunk-4EIWPJMJ.js → chunk-ZP6GSX4D.js} +36 -27
  27. package/dist/dashboard.d.ts +5 -2
  28. package/dist/dashboard.js +5 -4
  29. package/dist/{expanded-tool-detail-OkXGqTHe.d.ts → expanded-tool-detail-BDi_h_dZ.d.ts} +11 -4
  30. package/dist/file-tabs-CmaoDVBI.d.ts +72 -0
  31. package/dist/files.d.ts +25 -44
  32. package/dist/files.js +8 -3
  33. package/{src/styles → dist}/globals.css +16 -67
  34. package/dist/hooks.d.ts +5 -4
  35. package/dist/hooks.js +14 -9
  36. package/dist/index.d.ts +38 -9
  37. package/dist/index.js +100 -126
  38. package/dist/markdown.d.ts +1 -24
  39. package/dist/markdown.js +1 -7
  40. package/dist/openui.d.ts +115 -0
  41. package/dist/openui.js +11 -0
  42. package/dist/pages.d.ts +3 -2
  43. package/dist/pages.js +19 -16
  44. package/dist/primitives.js +25 -19
  45. package/dist/run.d.ts +2 -2
  46. package/dist/run.js +8 -7
  47. package/dist/{use-sidecar-auth-Bb0-w3lX.d.ts → sdk-hooks.d.ts} +61 -72
  48. package/dist/sdk-hooks.js +29 -0
  49. package/dist/styles.css +179 -0
  50. package/dist/tokens.css +165 -0
  51. package/dist/{tool-display-BvsVW_Ur.d.ts → tool-display-Ct9nFAzJ.d.ts} +1 -1
  52. package/dist/types.d.ts +1 -1
  53. package/dist/{usage-chart-DINgSVL5.d.ts → usage-chart-CY9xo3KX.d.ts} +8 -3
  54. package/dist/use-pty-session-DeZSxOCN.d.ts +69 -0
  55. package/dist/utils.d.ts +1 -1
  56. package/dist/utils.js +1 -1
  57. package/dist/workspace.d.ts +171 -33
  58. package/dist/workspace.js +25 -1
  59. package/package.json +10 -3
  60. package/dist/chunk-2UHPE5T7.js +0 -201
  61. package/dist/chunk-6MQIDUPA.js +0 -502
  62. package/dist/chunk-KYY2X6LY.js +0 -318
  63. package/dist/chunk-L6ZDH5F4.js +0 -334
  64. package/dist/chunk-M34OA6PQ.js +0 -233
  65. package/dist/chunk-M6VLC32S.js +0 -219
  66. package/dist/chunk-U62G5TS7.js +0 -472
  67. package/src/styles/tokens.css +0 -73
@@ -0,0 +1,336 @@
1
+ import {
2
+ Table,
3
+ TableBody,
4
+ TableCell,
5
+ TableHead,
6
+ TableHeader,
7
+ TableRow
8
+ } from "./chunk-TQN3VR4F.js";
9
+ import {
10
+ Markdown
11
+ } from "./chunk-LTFK464G.js";
12
+ import {
13
+ Badge,
14
+ Card,
15
+ CardContent,
16
+ CardDescription,
17
+ CardHeader,
18
+ CardTitle
19
+ } from "./chunk-MXCSSOGH.js";
20
+ import {
21
+ Button
22
+ } from "./chunk-HWLX5NME.js";
23
+ import {
24
+ cn
25
+ } from "./chunk-RQHJBTEU.js";
26
+
27
+ // src/primitives/code-block.tsx
28
+ import { clsx } from "clsx";
29
+ import { useState } from "react";
30
+ import { jsx, jsxs } from "react/jsx-runtime";
31
+ function CodeBlock({
32
+ code,
33
+ language,
34
+ showCopy = true,
35
+ showLineNumbers = false,
36
+ className,
37
+ ...props
38
+ }) {
39
+ const [copied, setCopied] = useState(false);
40
+ const handleCopy = async () => {
41
+ await navigator.clipboard.writeText(code);
42
+ setCopied(true);
43
+ setTimeout(() => setCopied(false), 2e3);
44
+ };
45
+ const lines = code.split("\n");
46
+ return /* @__PURE__ */ jsxs("div", { className: "group relative", children: [
47
+ /* @__PURE__ */ jsx(
48
+ "pre",
49
+ {
50
+ className: clsx(
51
+ "overflow-x-auto rounded-lg border border-[#262626] bg-[#0a0a0a] p-4 font-mono text-sm",
52
+ className
53
+ ),
54
+ ...props,
55
+ children: /* @__PURE__ */ jsx("code", { className: language ? `language-${language}` : void 0, children: showLineNumbers ? /* @__PURE__ */ jsx("table", { className: "w-full", children: /* @__PURE__ */ jsx("tbody", { children: lines.map((line, i) => /* @__PURE__ */ jsxs("tr", { children: [
56
+ /* @__PURE__ */ jsx("td", { className: "w-8 select-none pr-4 text-right text-[#525252]", children: i + 1 }),
57
+ /* @__PURE__ */ jsx("td", { className: "text-[#a1a1a1]", children: line || " " })
58
+ ] }, i)) }) }) : /* @__PURE__ */ jsx("span", { className: "text-[#a1a1a1]", children: code }) })
59
+ }
60
+ ),
61
+ showCopy && /* @__PURE__ */ jsx(
62
+ "button",
63
+ {
64
+ onClick: handleCopy,
65
+ className: clsx(
66
+ "absolute top-2 right-2 rounded px-2 py-1 text-xs",
67
+ "bg-[#262626] text-[#a1a1a1] hover:bg-[#363636] hover:text-white",
68
+ "opacity-0 transition-opacity group-hover:opacity-100"
69
+ ),
70
+ children: copied ? "Copied!" : "Copy"
71
+ }
72
+ )
73
+ ] });
74
+ }
75
+ function InlineCode({ className, children, ...props }) {
76
+ return /* @__PURE__ */ jsx(
77
+ "code",
78
+ {
79
+ className: clsx(
80
+ "rounded border border-[#262626] bg-[#1a1a1a] px-1.5 py-0.5 font-mono text-sm",
81
+ className
82
+ ),
83
+ ...props,
84
+ children
85
+ }
86
+ );
87
+ }
88
+
89
+ // src/openui/openui-artifact-renderer.tsx
90
+ import { Fragment } from "react";
91
+ import { ArrowRight, Minus } from "lucide-react";
92
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
93
+ var GAP_STYLES = {
94
+ sm: "gap-2",
95
+ md: "gap-4",
96
+ lg: "gap-6"
97
+ };
98
+ var GRID_STYLES = {
99
+ 1: "grid-cols-1",
100
+ 2: "grid-cols-1 md:grid-cols-2",
101
+ 3: "grid-cols-1 md:grid-cols-3",
102
+ 4: "grid-cols-1 md:grid-cols-2 xl:grid-cols-4"
103
+ };
104
+ var ALIGN_STYLES = {
105
+ start: "items-start",
106
+ center: "items-center",
107
+ end: "items-end",
108
+ stretch: "items-stretch"
109
+ };
110
+ function formatValue(value) {
111
+ if (value === null || value === void 0) {
112
+ return /* @__PURE__ */ jsx2("span", { className: "text-[var(--text-muted)]", children: "\u2014" });
113
+ }
114
+ if (typeof value === "boolean") {
115
+ return value ? "Yes" : "No";
116
+ }
117
+ return value;
118
+ }
119
+ function renderActions(actions, onAction) {
120
+ if (actions.length === 0) return null;
121
+ return /* @__PURE__ */ jsx2("div", { className: "flex flex-wrap items-center gap-2", children: actions.map((action) => /* @__PURE__ */ jsx2(
122
+ Button,
123
+ {
124
+ type: "button",
125
+ size: "sm",
126
+ variant: action.tone ?? "outline",
127
+ disabled: action.disabled,
128
+ onClick: () => {
129
+ action.onPress?.();
130
+ onAction?.(action);
131
+ },
132
+ children: action.label
133
+ },
134
+ action.id
135
+ )) });
136
+ }
137
+ function renderNode(node, onAction) {
138
+ switch (node.type) {
139
+ case "heading": {
140
+ const level = node.level ?? 2;
141
+ const HeadingTag = `h${level}`;
142
+ return /* @__PURE__ */ jsxs2("div", { className: "space-y-1", children: [
143
+ node.kicker && /* @__PURE__ */ jsx2("div", { className: "text-[10px] font-semibold uppercase tracking-[0.16em] text-[var(--text-muted)]", children: node.kicker }),
144
+ /* @__PURE__ */ jsx2(
145
+ HeadingTag,
146
+ {
147
+ className: cn(
148
+ "font-semibold tracking-tight text-[var(--text-primary)]",
149
+ level === 1 && "text-2xl",
150
+ level === 2 && "text-xl",
151
+ level === 3 && "text-lg",
152
+ level === 4 && "text-base"
153
+ ),
154
+ children: node.text
155
+ }
156
+ ),
157
+ node.meta && /* @__PURE__ */ jsx2("p", { className: "text-sm text-[var(--text-muted)]", children: node.meta })
158
+ ] });
159
+ }
160
+ case "text":
161
+ return /* @__PURE__ */ jsx2(
162
+ "p",
163
+ {
164
+ className: cn(
165
+ "text-sm leading-6 text-[var(--text-secondary)]",
166
+ node.tone === "muted" && "text-[var(--text-muted)]",
167
+ node.tone === "success" && "text-emerald-300",
168
+ node.tone === "warning" && "text-amber-200",
169
+ node.tone === "error" && "text-red-200",
170
+ node.mono && "font-[var(--font-mono)] text-[13px]"
171
+ ),
172
+ children: node.text
173
+ }
174
+ );
175
+ case "badge":
176
+ return /* @__PURE__ */ jsx2(Badge, { variant: node.tone ?? "outline", children: node.label });
177
+ case "stat":
178
+ return /* @__PURE__ */ jsx2(Card, { variant: "glass", className: "border-[var(--border-subtle)] shadow-[var(--shadow-card)]", children: /* @__PURE__ */ jsxs2(CardContent, { className: "space-y-2 p-4", children: [
179
+ /* @__PURE__ */ jsx2("div", { className: "text-xs uppercase tracking-[0.12em] text-[var(--text-muted)]", children: node.label }),
180
+ /* @__PURE__ */ jsx2("div", { className: "text-2xl font-semibold tracking-tight text-[var(--text-primary)]", children: node.value }),
181
+ node.change && /* @__PURE__ */ jsx2(
182
+ "div",
183
+ {
184
+ className: cn(
185
+ "text-xs",
186
+ node.tone === "success" && "text-emerald-300",
187
+ node.tone === "warning" && "text-amber-200",
188
+ node.tone === "error" && "text-red-200",
189
+ node.tone === "info" && "text-sky-200",
190
+ !node.tone || node.tone === "default" ? "text-[var(--text-muted)]" : void 0
191
+ ),
192
+ children: node.change
193
+ }
194
+ )
195
+ ] }) });
196
+ case "key_value":
197
+ return /* @__PURE__ */ jsx2("dl", { className: "grid gap-3 sm:grid-cols-2", children: node.items.map((item, index) => /* @__PURE__ */ jsxs2(
198
+ "div",
199
+ {
200
+ className: "rounded-[var(--radius-lg)] border border-[var(--border-subtle)] bg-[var(--bg-card)] px-4 py-3",
201
+ children: [
202
+ /* @__PURE__ */ jsx2("dt", { className: "text-[11px] uppercase tracking-[0.12em] text-[var(--text-muted)]", children: item.label }),
203
+ /* @__PURE__ */ jsx2(
204
+ "dd",
205
+ {
206
+ className: cn(
207
+ "mt-1 text-sm font-medium text-[var(--text-primary)]",
208
+ item.tone === "muted" && "text-[var(--text-secondary)]"
209
+ ),
210
+ children: formatValue(item.value)
211
+ }
212
+ )
213
+ ]
214
+ },
215
+ item.id ?? `${item.label}-${index}`
216
+ )) });
217
+ case "code":
218
+ return /* @__PURE__ */ jsxs2("div", { className: "space-y-2", children: [
219
+ node.title && /* @__PURE__ */ jsx2("div", { className: "text-xs uppercase tracking-[0.12em] text-[var(--text-muted)]", children: node.title }),
220
+ /* @__PURE__ */ jsx2(
221
+ CodeBlock,
222
+ {
223
+ code: node.code,
224
+ language: node.language,
225
+ showLineNumbers: node.showLineNumbers,
226
+ className: "border-[var(--border-subtle)] bg-[var(--bg-input)]"
227
+ }
228
+ )
229
+ ] });
230
+ case "markdown":
231
+ return /* @__PURE__ */ jsx2("div", { className: "rounded-[var(--radius-lg)] border border-[var(--border-subtle)] bg-[var(--bg-card)] p-5", children: /* @__PURE__ */ jsx2(Markdown, { className: "prose-sm max-w-none", children: node.content }) });
232
+ case "table":
233
+ return /* @__PURE__ */ jsxs2("div", { className: "overflow-hidden rounded-[var(--radius-lg)] border border-[var(--border-subtle)] bg-[var(--bg-card)]", children: [
234
+ /* @__PURE__ */ jsxs2(Table, { children: [
235
+ /* @__PURE__ */ jsx2(TableHeader, { children: /* @__PURE__ */ jsx2(TableRow, { className: "border-[var(--border-subtle)]", children: node.columns.map((column) => /* @__PURE__ */ jsx2(
236
+ TableHead,
237
+ {
238
+ className: cn(
239
+ "h-10 text-[11px] uppercase tracking-[0.1em] text-[var(--text-muted)]",
240
+ column.align === "right" && "text-right"
241
+ ),
242
+ children: column.header
243
+ },
244
+ column.key
245
+ )) }) }),
246
+ /* @__PURE__ */ jsx2(TableBody, { children: node.rows.map((row, rowIndex) => /* @__PURE__ */ jsx2(TableRow, { className: "border-[var(--border-subtle)]", children: node.columns.map((column) => /* @__PURE__ */ jsx2(
247
+ TableCell,
248
+ {
249
+ className: cn(
250
+ "py-3 text-sm text-[var(--text-secondary)]",
251
+ column.align === "right" && "text-right tabular-nums"
252
+ ),
253
+ children: formatValue(row[column.key])
254
+ },
255
+ column.key
256
+ )) }, rowIndex)) })
257
+ ] }),
258
+ node.caption && /* @__PURE__ */ jsx2("div", { className: "border-t border-[var(--border-subtle)] px-4 py-2 text-xs text-[var(--text-muted)]", children: node.caption })
259
+ ] });
260
+ case "actions":
261
+ return renderActions(node.actions, onAction);
262
+ case "separator":
263
+ return /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-3", children: [
264
+ /* @__PURE__ */ jsx2("div", { className: "h-px flex-1 bg-[var(--border-subtle)]" }),
265
+ node.label && /* @__PURE__ */ jsx2("span", { className: "text-[10px] uppercase tracking-[0.14em] text-[var(--text-muted)]", children: node.label }),
266
+ /* @__PURE__ */ jsx2("div", { className: "h-px flex-1 bg-[var(--border-subtle)]" })
267
+ ] });
268
+ case "stack":
269
+ return /* @__PURE__ */ jsx2(
270
+ "div",
271
+ {
272
+ className: cn(
273
+ "flex",
274
+ node.direction === "row" ? "flex-row" : "flex-col",
275
+ GAP_STYLES[node.gap ?? "md"],
276
+ ALIGN_STYLES[node.align ?? "stretch"],
277
+ node.wrap && "flex-wrap"
278
+ ),
279
+ children: node.children.map((child, index) => /* @__PURE__ */ jsx2(Fragment, { children: renderNode(child, onAction) }, child.id ?? `${child.type}-${index}`))
280
+ }
281
+ );
282
+ case "grid":
283
+ return /* @__PURE__ */ jsx2("div", { className: cn("grid", GRID_STYLES[node.columns ?? 2], GAP_STYLES[node.gap ?? "md"]), children: node.children.map((child, index) => /* @__PURE__ */ jsx2(Fragment, { children: renderNode(child, onAction) }, child.id ?? `${child.type}-${index}`)) });
284
+ case "card":
285
+ return /* @__PURE__ */ jsxs2(Card, { variant: "glass", className: "border-[var(--border-subtle)] shadow-[var(--shadow-card)]", children: [
286
+ (node.eyebrow || node.title || node.description || node.badge || node.actions) && /* @__PURE__ */ jsxs2(CardHeader, { className: "gap-2 p-4 pb-0", children: [
287
+ /* @__PURE__ */ jsxs2("div", { className: "flex items-start justify-between gap-3", children: [
288
+ /* @__PURE__ */ jsxs2("div", { className: "min-w-0 flex-1 space-y-1", children: [
289
+ node.eyebrow && /* @__PURE__ */ jsx2("div", { className: "text-[10px] font-semibold uppercase tracking-[0.16em] text-[var(--text-muted)]", children: node.eyebrow }),
290
+ node.title && /* @__PURE__ */ jsx2(CardTitle, { className: "text-base text-[var(--text-primary)]", children: node.title }),
291
+ node.description && /* @__PURE__ */ jsx2(CardDescription, { className: "text-[var(--text-muted)]", children: node.description })
292
+ ] }),
293
+ node.badge && /* @__PURE__ */ jsx2(Badge, { variant: node.badge.tone ?? "outline", children: node.badge.label })
294
+ ] }),
295
+ node.actions && renderActions(node.actions, onAction)
296
+ ] }),
297
+ node.children && node.children.length > 0 && /* @__PURE__ */ jsx2(CardContent, { className: "space-y-4 p-4", children: node.children.map((child, index) => /* @__PURE__ */ jsx2(Fragment, { children: renderNode(child, onAction) }, child.id ?? `${child.type}-${index}`)) })
298
+ ] });
299
+ }
300
+ }
301
+ function OpenUIArtifactRenderer({
302
+ schema,
303
+ onAction,
304
+ className
305
+ }) {
306
+ const nodes = Array.isArray(schema) ? schema : [schema];
307
+ if (nodes.length === 0) {
308
+ return /* @__PURE__ */ jsx2(
309
+ "div",
310
+ {
311
+ className: cn(
312
+ "flex h-full min-h-[16rem] items-center justify-center rounded-[var(--radius-xl)] border border-dashed border-[var(--border-subtle)] bg-[var(--bg-card)] p-6 text-center",
313
+ className
314
+ ),
315
+ children: /* @__PURE__ */ jsxs2("div", { className: "space-y-2", children: [
316
+ /* @__PURE__ */ jsx2("div", { className: "mx-auto flex h-10 w-10 items-center justify-center rounded-full bg-[var(--bg-elevated)] text-[var(--text-muted)]", children: /* @__PURE__ */ jsx2(Minus, { className: "h-4 w-4" }) }),
317
+ /* @__PURE__ */ jsx2("div", { className: "text-sm font-medium text-[var(--text-primary)]", children: "No structured artifact payload" }),
318
+ /* @__PURE__ */ jsx2("div", { className: "text-sm text-[var(--text-muted)]", children: "Pass an OpenUI-like schema to render dynamic result panels with sandbox-ui primitives." })
319
+ ] })
320
+ }
321
+ );
322
+ }
323
+ return /* @__PURE__ */ jsxs2("div", { className: cn("space-y-4 p-4", className), children: [
324
+ nodes.map((node, index) => /* @__PURE__ */ jsx2(Fragment, { children: renderNode(node, onAction) }, node.id ?? `${node.type}-${index}`)),
325
+ /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2 rounded-[var(--radius-lg)] border border-[var(--border-subtle)] bg-[var(--bg-card)] px-3 py-2 text-xs text-[var(--text-muted)]", children: [
326
+ /* @__PURE__ */ jsx2(ArrowRight, { className: "h-3.5 w-3.5" }),
327
+ "Structured artifact rendered through sandbox-ui primitives"
328
+ ] })
329
+ ] });
330
+ }
331
+
332
+ export {
333
+ CodeBlock,
334
+ InlineCode,
335
+ OpenUIArtifactRenderer
336
+ };
@@ -1,3 +1,6 @@
1
+ import {
2
+ Progress
3
+ } from "./chunk-FRGMMANX.js";
1
4
  import {
2
5
  Badge,
3
6
  Card,
@@ -5,12 +8,11 @@ import {
5
8
  CardDescription,
6
9
  CardFooter,
7
10
  CardHeader,
8
- CardTitle,
9
- Progress
10
- } from "./chunk-2UHPE5T7.js";
11
+ CardTitle
12
+ } from "./chunk-MXCSSOGH.js";
11
13
  import {
12
14
  Button
13
- } from "./chunk-E6FS7R4X.js";
15
+ } from "./chunk-HWLX5NME.js";
14
16
  import {
15
17
  cn
16
18
  } from "./chunk-RQHJBTEU.js";
@@ -19,9 +21,10 @@ import {
19
21
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
20
22
  var variantColors = {
21
23
  sandbox: {
22
- accent: "text-purple-400",
23
- accentBg: "bg-purple-500/10",
24
- border: "border-purple-500/20"
24
+ accent: "text-[var(--accent-text)]",
25
+ accentBg: "bg-[var(--accent-surface-soft)]",
26
+ border: "border-[var(--border-accent)]",
27
+ progress: "bg-[image:var(--accent-gradient-strong)]"
25
28
  }
26
29
  };
27
30
  function formatCredits(value) {
@@ -123,7 +126,9 @@ function BillingDashboard({
123
126
  usage,
124
127
  onManageSubscription,
125
128
  onAddCredits,
126
- variant = "sandbox"
129
+ variant = "sandbox",
130
+ className,
131
+ cardClassName
127
132
  }) {
128
133
  const colors = variantColors[variant];
129
134
  const totalCredits = balance.available + balance.used;
@@ -131,8 +136,8 @@ function BillingDashboard({
131
136
  const sortedModels = Object.entries(usage.byModel).sort(
132
137
  ([, a], [, b]) => b - a
133
138
  );
134
- return /* @__PURE__ */ jsxs("div", { className: "grid gap-6 lg:grid-cols-3", children: [
135
- /* @__PURE__ */ jsxs(Card, { variant, className: "lg:col-span-1", children: [
139
+ return /* @__PURE__ */ jsxs("div", { className: cn("grid gap-6 lg:grid-cols-3", className), children: [
140
+ /* @__PURE__ */ jsxs(Card, { variant, className: cn("lg:col-span-1", cardClassName), children: [
136
141
  /* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
137
142
  /* @__PURE__ */ jsxs(CardTitle, { className: "flex items-center gap-2 text-base", children: [
138
143
  /* @__PURE__ */ jsx(CreditCardIcon, { className: colors.accent }),
@@ -173,7 +178,7 @@ function BillingDashboard({
173
178
  )
174
179
  ] }) })
175
180
  ] }),
176
- /* @__PURE__ */ jsxs(Card, { variant, className: "lg:col-span-1", children: [
181
+ /* @__PURE__ */ jsxs(Card, { variant, className: cn("lg:col-span-1", cardClassName), children: [
177
182
  /* @__PURE__ */ jsxs(CardHeader, { children: [
178
183
  /* @__PURE__ */ jsxs(CardTitle, { className: "flex items-center gap-2 text-base", children: [
179
184
  /* @__PURE__ */ jsx(CoinsIcon, { className: colors.accent }),
@@ -199,7 +204,7 @@ function BillingDashboard({
199
204
  /* @__PURE__ */ jsx(Button, { variant, className: "w-full", onClick: onAddCredits, children: "Add Credits" })
200
205
  ] })
201
206
  ] }),
202
- /* @__PURE__ */ jsxs(Card, { variant, className: "lg:col-span-1", children: [
207
+ /* @__PURE__ */ jsxs(Card, { variant, className: cn("lg:col-span-1", cardClassName), children: [
203
208
  /* @__PURE__ */ jsxs(CardHeader, { children: [
204
209
  /* @__PURE__ */ jsxs(CardTitle, { className: "flex items-center gap-2 text-base", children: [
205
210
  /* @__PURE__ */ jsx(ChartIcon, { className: colors.accent }),
@@ -227,7 +232,7 @@ function BillingDashboard({
227
232
  {
228
233
  className: cn(
229
234
  "h-full rounded-full transition-all",
230
- variant === "sandbox" && "bg-purple-500"
235
+ variant === "sandbox" && colors.progress
231
236
  ),
232
237
  style: { width: `${modelPercent}%` }
233
238
  }
@@ -251,10 +256,10 @@ function BillingDashboard({
251
256
  import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
252
257
  var variantColors2 = {
253
258
  sandbox: {
254
- accent: "text-purple-400",
255
- border: "border-purple-500",
256
- bg: "bg-purple-500/10",
257
- ring: "ring-purple-500/50"
259
+ accent: "text-[var(--accent-text)]",
260
+ border: "border-[var(--border-accent)]",
261
+ bg: "bg-[var(--accent-surface-soft)]",
262
+ ring: "ring-[hsl(var(--primary)/0.35)]"
258
263
  }
259
264
  };
260
265
  function formatPrice(cents) {
@@ -294,10 +299,12 @@ function PricingPage({
294
299
  onBillingPeriodChange,
295
300
  onSelectTier,
296
301
  variant = "sandbox",
297
- loading = false
302
+ loading = false,
303
+ className,
304
+ cardClassName
298
305
  }) {
299
306
  const colors = variantColors2[variant];
300
- return /* @__PURE__ */ jsxs2("div", { className: "w-full space-y-8", children: [
307
+ return /* @__PURE__ */ jsxs2("div", { className: cn("w-full space-y-8", className), children: [
301
308
  /* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-center gap-4", children: [
302
309
  /* @__PURE__ */ jsx2(
303
310
  "button",
@@ -337,6 +344,7 @@ function PricingPage({
337
344
  variant,
338
345
  className: cn(
339
346
  "relative flex flex-col",
347
+ cardClassName,
340
348
  tier.recommended && cn(colors.border, "border-2 ring-2", colors.ring),
341
349
  isCurrentTier && "ring-2 ring-offset-2 ring-offset-background",
342
350
  isCurrentTier && colors.ring
@@ -405,9 +413,9 @@ var variantColors3 = {
405
413
  text: "text-blue-400"
406
414
  },
407
415
  automateai: {
408
- bar: "bg-gradient-to-t from-violet-600 to-violet-400",
409
- barHover: "hover:from-violet-500 hover:to-violet-300",
410
- text: "text-violet-400"
416
+ bar: "bg-[image:linear-gradient(to_top,var(--brand-purple),var(--brand-cool))]",
417
+ barHover: "hover:brightness-110",
418
+ text: "text-[var(--brand-purple)]"
411
419
  },
412
420
  tradingbots: {
413
421
  bar: "bg-gradient-to-t from-green-600 to-green-400",
@@ -415,9 +423,9 @@ var variantColors3 = {
415
423
  text: "text-green-400"
416
424
  },
417
425
  sandbox: {
418
- bar: "bg-gradient-to-t from-purple-600 to-purple-400",
419
- barHover: "hover:from-purple-500 hover:to-purple-300",
420
- text: "text-purple-400"
426
+ bar: "bg-[image:var(--accent-gradient-strong)]",
427
+ barHover: "hover:brightness-110",
428
+ text: "text-[var(--accent-text)]"
421
429
  }
422
430
  };
423
431
  function formatDate2(dateStr) {
@@ -437,13 +445,14 @@ function UsageChart({
437
445
  data,
438
446
  title,
439
447
  unit,
440
- variant = "agentrun"
448
+ variant = "agentrun",
449
+ className
441
450
  }) {
442
451
  const colors = variantColors3[variant];
443
452
  const maxValue = Math.max(...data.map((d) => d.value), 1);
444
453
  const total = data.reduce((sum, d) => sum + d.value, 0);
445
454
  const [hoveredIndex, setHoveredIndex] = React.useState(null);
446
- return /* @__PURE__ */ jsxs3(Card, { children: [
455
+ return /* @__PURE__ */ jsxs3(Card, { className, children: [
447
456
  /* @__PURE__ */ jsxs3(CardHeader, { className: "flex flex-row items-center justify-between pb-2", children: [
448
457
  /* @__PURE__ */ jsx3(CardTitle, { className: "font-medium text-base", children: title }),
449
458
  /* @__PURE__ */ jsxs3("div", { className: "text-right", children: [
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- export { a as BillingBalance, c as BillingDashboard, d as BillingDashboardProps, B as BillingSubscription, b as BillingUsage, e as PricingPage, f as PricingPageProps, P as PricingTier, g as UsageChart, h as UsageChartProps, U as UsageDataPoint } from './usage-chart-DINgSVL5.js';
2
+ export { a as BillingBalance, c as BillingDashboard, d as BillingDashboardProps, B as BillingSubscription, b as BillingUsage, e as PricingPage, f as PricingPageProps, P as PricingTier, g as UsageChart, h as UsageChartProps, U as UsageDataPoint } from './usage-chart-CY9xo3KX.js';
3
3
  import * as React from 'react';
4
4
 
5
5
  type ProductVariant = "sandbox";
@@ -27,10 +27,13 @@ interface DashboardLayoutProps {
27
27
  onLogout?: () => void;
28
28
  onSettingsClick?: () => void;
29
29
  settingsHref?: string;
30
+ className?: string;
31
+ sidebarClassName?: string;
32
+ contentClassName?: string;
30
33
  /** Custom link component (e.g., Next.js Link). Use any type to support various router implementations. */
31
34
  LinkComponent?: React.ComponentType<any>;
32
35
  }
33
- declare function DashboardLayout({ children, variant, navItems, activeNavId, user, isLoading, onLogout, onSettingsClick, settingsHref, LinkComponent, }: DashboardLayoutProps): react_jsx_runtime.JSX.Element;
36
+ declare function DashboardLayout({ children, variant, navItems, activeNavId, user, isLoading, onLogout, onSettingsClick, settingsHref, className, sidebarClassName, contentClassName, LinkComponent, }: DashboardLayoutProps): react_jsx_runtime.JSX.Element;
34
37
 
35
38
  interface Backend {
36
39
  type: string;
package/dist/dashboard.js CHANGED
@@ -4,16 +4,17 @@ import {
4
4
  ProfileComparison,
5
5
  ProfileSelector,
6
6
  VariantList
7
- } from "./chunk-J4OADEUK.js";
7
+ } from "./chunk-OM6ON27W.js";
8
8
  import {
9
9
  BillingDashboard,
10
10
  PricingPage,
11
11
  UsageChart
12
- } from "./chunk-4EIWPJMJ.js";
12
+ } from "./chunk-ZP6GSX4D.js";
13
13
  import "./chunk-OKCIKTXQ.js";
14
14
  import "./chunk-MCGKDCOR.js";
15
- import "./chunk-2UHPE5T7.js";
16
- import "./chunk-E6FS7R4X.js";
15
+ import "./chunk-FRGMMANX.js";
16
+ import "./chunk-MXCSSOGH.js";
17
+ import "./chunk-HWLX5NME.js";
17
18
  import "./chunk-RQHJBTEU.js";
18
19
  export {
19
20
  BackendSelector,
@@ -3,7 +3,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
  import { R as Run } from './run-CtFZ6s-D.js';
4
4
  import { a as SessionPart, b as ToolPart, R as ReasoningPart } from './parts-CyGkM6Fp.js';
5
5
  import { A as AgentBranding } from './branding-DCi5VEik.js';
6
- import { C as CustomToolRenderer } from './tool-display-BvsVW_Ur.js';
6
+ import { C as CustomToolRenderer } from './tool-display-Ct9nFAzJ.js';
7
7
 
8
8
  interface RunGroupProps {
9
9
  run: Run;
@@ -17,27 +17,34 @@ interface RunGroupProps {
17
17
  * Collapsible container for a consecutive group of assistant messages (a "run").
18
18
  * Shows a summary header with stats and renders tool/thinking/text parts.
19
19
  */
20
- declare const RunGroup: React.MemoExoticComponent<({ run, partMap, collapsed, onToggle, branding, renderToolDetail, }: RunGroupProps) => react_jsx_runtime.JSX.Element>;
20
+ declare const RunGroup: React.MemoExoticComponent<({ run, partMap, collapsed, onToggle, branding, renderToolDetail, }: RunGroupProps) => react_jsx_runtime.JSX.Element | null>;
21
21
 
22
22
  interface InlineToolItemProps {
23
23
  part: ToolPart;
24
24
  renderToolDetail?: CustomToolRenderer;
25
+ groupPosition?: "single" | "first" | "middle" | "last";
26
+ className?: string;
27
+ contentClassName?: string;
25
28
  }
26
29
  /**
27
30
  * Compact single-line tool call display (32px height).
28
31
  * Shows icon, title, description, duration, and status indicator.
29
32
  * Expands on click to show ExpandedToolDetail.
30
33
  */
31
- declare const InlineToolItem: React.MemoExoticComponent<({ part, renderToolDetail }: InlineToolItemProps) => react_jsx_runtime.JSX.Element>;
34
+ declare const InlineToolItem: React.MemoExoticComponent<({ part, renderToolDetail, groupPosition, className, contentClassName, }: InlineToolItemProps) => react_jsx_runtime.JSX.Element>;
32
35
 
33
36
  interface InlineThinkingItemProps {
34
37
  part: ReasoningPart;
38
+ defaultOpen?: boolean;
39
+ autoCollapse?: boolean;
40
+ className?: string;
41
+ contentClassName?: string;
35
42
  }
36
43
  /**
37
44
  * Minimal collapsible display for thinking/reasoning parts.
38
45
  * Shows "Thinking..." with optional preview text and duration.
39
46
  */
40
- declare const InlineThinkingItem: React.MemoExoticComponent<({ part }: InlineThinkingItemProps) => react_jsx_runtime.JSX.Element>;
47
+ declare const InlineThinkingItem: React.MemoExoticComponent<({ part, defaultOpen, autoCollapse, className, contentClassName, }: InlineThinkingItemProps) => react_jsx_runtime.JSX.Element>;
41
48
 
42
49
  interface ExpandedToolDetailProps {
43
50
  part: ToolPart;
@@ -0,0 +1,72 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+
4
+ interface ArtifactPaneProps {
5
+ eyebrow?: ReactNode;
6
+ title: ReactNode;
7
+ subtitle?: ReactNode;
8
+ meta?: ReactNode;
9
+ headerActions?: ReactNode;
10
+ tabs?: ReactNode;
11
+ toolbar?: ReactNode;
12
+ footer?: ReactNode;
13
+ emptyState?: ReactNode;
14
+ children?: ReactNode;
15
+ className?: string;
16
+ contentClassName?: string;
17
+ }
18
+ /**
19
+ * ArtifactPane — shared frame for files, previews, documents, inspectors, and
20
+ * other artifact-like surfaces inside sandbox applications.
21
+ */
22
+ declare function ArtifactPane({ eyebrow, title, subtitle, meta, headerActions, tabs, toolbar, footer, emptyState, children, className, contentClassName, }: ArtifactPaneProps): react_jsx_runtime.JSX.Element;
23
+
24
+ /**
25
+ * FileTree — directory browser with file type icons.
26
+ *
27
+ * Renders a hierarchical file system view. Clicking a file
28
+ * triggers onSelect with the full path.
29
+ */
30
+ interface FileNode {
31
+ name: string;
32
+ path: string;
33
+ type: "file" | "directory";
34
+ children?: FileNode[];
35
+ size?: number;
36
+ mimeType?: string;
37
+ }
38
+ interface FileTreeProps {
39
+ root: FileNode;
40
+ selectedPath?: string;
41
+ onSelect?: (path: string, node: FileNode) => void;
42
+ className?: string;
43
+ defaultExpanded?: boolean;
44
+ visibility?: FileTreeVisibilityOptions;
45
+ }
46
+ interface FileTreeVisibilityOptions {
47
+ hiddenPaths?: string[];
48
+ hiddenPathPrefixes?: string[];
49
+ isVisible?: (node: FileNode) => boolean;
50
+ }
51
+ declare function filterFileTree(root: FileNode, visibility?: FileTreeVisibilityOptions): FileNode | null;
52
+ declare function FileTree({ root, selectedPath, onSelect, className, defaultExpanded, visibility, }: FileTreeProps): react_jsx_runtime.JSX.Element | null;
53
+
54
+ /**
55
+ * FileTabs — tab bar for open files in the preview panel.
56
+ */
57
+ interface FileTabData {
58
+ id: string;
59
+ name: string;
60
+ path: string;
61
+ dirty?: boolean;
62
+ }
63
+ interface FileTabsProps {
64
+ tabs: FileTabData[];
65
+ activeId?: string;
66
+ onSelect: (id: string) => void;
67
+ onClose: (id: string) => void;
68
+ className?: string;
69
+ }
70
+ declare function FileTabs({ tabs, activeId, onSelect, onClose, className }: FileTabsProps): react_jsx_runtime.JSX.Element | null;
71
+
72
+ export { ArtifactPane as A, type FileNode as F, type ArtifactPaneProps as a, type FileTabData as b, FileTabs as c, type FileTabsProps as d, FileTree as e, type FileTreeProps as f, type FileTreeVisibilityOptions as g, filterFileTree as h };