@tangle-network/sandbox-ui 0.2.2 → 0.3.4

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 (70) 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-QSQBDR3N.js → chunk-BX6AQMUS.js} +5 -2
  9. package/dist/chunk-CCKNIAS7.js +124 -0
  10. package/dist/chunk-CJ2RYVZH.js +128 -0
  11. package/dist/{chunk-KMXV7DDX.js → chunk-CNWVHQFY.js} +1 -1
  12. package/dist/{chunk-OU4TRNQZ.js → chunk-COCSO7FG.js} +3 -3
  13. package/dist/chunk-FJSVPBKY.js +85 -0
  14. package/dist/chunk-FRGMMANX.js +102 -0
  15. package/dist/{chunk-E6FS7R4X.js → chunk-HWLX5NME.js} +1 -1
  16. package/dist/chunk-HY5IBRCE.js +1171 -0
  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-NI2EI43H.js → chunk-PDV7W4NY.js} +9 -124
  21. package/dist/chunk-QGI5E7JD.js +1106 -0
  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 +4 -111
  28. package/dist/dashboard.js +17 -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-BOjBJwzD.d.ts +219 -0
  37. package/dist/index.d.ts +39 -10
  38. package/dist/index.js +190 -121
  39. package/dist/markdown.d.ts +1 -24
  40. package/dist/markdown.js +1 -7
  41. package/dist/openui.d.ts +115 -0
  42. package/dist/openui.js +11 -0
  43. package/dist/pages.d.ts +3 -2
  44. package/dist/pages.js +19 -16
  45. package/dist/primitives.js +25 -19
  46. package/dist/run.d.ts +2 -2
  47. package/dist/run.js +8 -7
  48. package/dist/{use-sidecar-auth-Bb0-w3lX.d.ts → sdk-hooks.d.ts} +61 -72
  49. package/dist/sdk-hooks.js +29 -0
  50. package/dist/styles.css +179 -0
  51. package/dist/tokens.css +275 -0
  52. package/dist/{tool-display-BvsVW_Ur.d.ts → tool-display-Ct9nFAzJ.d.ts} +1 -1
  53. package/dist/types.d.ts +1 -1
  54. package/dist/{usage-chart-DINgSVL5.d.ts → usage-chart-CY9xo3KX.d.ts} +8 -3
  55. package/dist/use-pty-session-DeZSxOCN.d.ts +69 -0
  56. package/dist/utils.d.ts +1 -1
  57. package/dist/utils.js +1 -1
  58. package/dist/workspace.d.ts +171 -33
  59. package/dist/workspace.js +25 -1
  60. package/package.json +10 -3
  61. package/tailwind.config.cjs +39 -0
  62. package/dist/chunk-2UHPE5T7.js +0 -201
  63. package/dist/chunk-6MQIDUPA.js +0 -502
  64. package/dist/chunk-J4OADEUK.js +0 -814
  65. package/dist/chunk-KYY2X6LY.js +0 -318
  66. package/dist/chunk-L6ZDH5F4.js +0 -334
  67. package/dist/chunk-M34OA6PQ.js +0 -233
  68. package/dist/chunk-M6VLC32S.js +0 -219
  69. package/dist/chunk-U62G5TS7.js +0 -472
  70. 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,111 +1,4 @@
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';
3
- import * as React from 'react';
4
-
5
- type ProductVariant = "sandbox";
6
- interface NavItem {
7
- id: string;
8
- label: string;
9
- href: string;
10
- icon: React.ComponentType<{
11
- className?: string;
12
- }>;
13
- }
14
- interface DashboardUser {
15
- email: string;
16
- name?: string;
17
- tier?: string;
18
- avatarUrl?: string;
19
- }
20
- interface DashboardLayoutProps {
21
- children: React.ReactNode;
22
- variant?: ProductVariant;
23
- navItems: NavItem[];
24
- activeNavId?: string;
25
- user?: DashboardUser | null;
26
- isLoading?: boolean;
27
- onLogout?: () => void;
28
- onSettingsClick?: () => void;
29
- settingsHref?: string;
30
- /** Custom link component (e.g., Next.js Link). Use any type to support various router implementations. */
31
- LinkComponent?: React.ComponentType<any>;
32
- }
33
- declare function DashboardLayout({ children, variant, navItems, activeNavId, user, isLoading, onLogout, onSettingsClick, settingsHref, LinkComponent, }: DashboardLayoutProps): react_jsx_runtime.JSX.Element;
34
-
35
- interface Backend {
36
- type: string;
37
- label: string;
38
- description?: string;
39
- }
40
- interface BackendSelectorProps {
41
- backends: Backend[];
42
- selected: string[];
43
- onChange: (selected: string[]) => void;
44
- label?: string;
45
- hint?: string;
46
- multiSelect?: boolean;
47
- className?: string;
48
- }
49
- declare function BackendSelector({ backends, selected, onChange, label, hint, multiSelect, className, }: BackendSelectorProps): react_jsx_runtime.JSX.Element;
50
-
51
- interface Profile {
52
- id: string;
53
- name: string;
54
- description?: string;
55
- is_builtin?: boolean;
56
- extends?: string;
57
- model?: string;
58
- metrics?: {
59
- total_runs: number;
60
- success_rate: number;
61
- avg_duration_ms: number;
62
- };
63
- }
64
- interface ProfileSelectorProps {
65
- profiles: Profile[];
66
- selectedId?: string | null;
67
- onSelect: (profile: Profile | null) => void;
68
- onCreateClick?: () => void;
69
- onManageClick?: () => void;
70
- label?: string;
71
- placeholder?: string;
72
- showMetrics?: boolean;
73
- className?: string;
74
- }
75
- declare function ProfileSelector({ profiles, selectedId, onSelect, onCreateClick, onManageClick, label, placeholder, showMetrics, className, }: ProfileSelectorProps): react_jsx_runtime.JSX.Element;
76
- /**
77
- * Profile performance comparison card.
78
- * Shows metrics from multiple profiles side by side.
79
- */
80
- interface ProfileComparisonProps {
81
- profiles: Profile[];
82
- className?: string;
83
- }
84
- declare function ProfileComparison({ profiles, className, }: ProfileComparisonProps): react_jsx_runtime.JSX.Element | null;
85
-
86
- type VariantStatus = "pending" | "running" | "completed" | "failed" | "cancelled";
87
- type VariantOutcome = "pending_review" | "accepted" | "rejected" | "merged_with_conflicts" | "expired";
88
- interface Variant {
89
- id: string;
90
- label: string;
91
- sublabel?: string;
92
- status: VariantStatus;
93
- outcome?: VariantOutcome;
94
- durationMs?: number;
95
- error?: string;
96
- summary?: string;
97
- /** Link to view variant details (e.g., chat UI) */
98
- detailsUrl?: string;
99
- }
100
- interface VariantListProps {
101
- variants: Variant[];
102
- selectedId?: string | null;
103
- onSelect?: (id: string) => void;
104
- onAccept?: (id: string) => void;
105
- onReject?: (id: string) => void;
106
- isActioning?: string | null;
107
- className?: string;
108
- }
109
- declare function VariantList({ variants, selectedId, onSelect, onAccept, onReject, isActioning, className, }: VariantListProps): react_jsx_runtime.JSX.Element;
110
-
111
- export { type Backend, BackendSelector, type BackendSelectorProps, DashboardLayout, type DashboardLayoutProps, type Profile as DashboardProfile, type DashboardUser, type NavItem, type ProductVariant, ProfileComparison, type ProfileComparisonProps, ProfileSelector, type ProfileSelectorProps, type Variant, VariantList, type VariantListProps, type VariantOutcome, type VariantStatus };
1
+ export { A as AppSidebar, a as AppSidebarProps, B as Backend, b as BackendSelector, c as BackendSelectorProps, C as ClusterStatusBar, d as ClusterStatusBarProps, e as ClusterStatusItem, D as DashboardLayout, f as DashboardLayoutProps, v as DashboardProfile, g as DashboardUser, N as NavItem, h as NewSandboxCard, i as NewSandboxCardProps, w as ProductVariant, P as ProfileComparison, j as ProfileComparisonProps, k as ProfileSelector, l as ProfileSelectorProps, R as ResourceMeter, m as ResourceMeterProps, S as SandboxCard, n as SandboxCardData, o as SandboxCardProps, p as SandboxStatus, q as SandboxTable, r as SandboxTableProps, s as SidebarNavItem, t as SidebarSandbox, x as Variant, V as VariantList, u as VariantListProps, y as VariantOutcome, z as VariantStatus } from './index-BOjBJwzD.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
+ import 'react/jsx-runtime';
4
+ import 'react';
package/dist/dashboard.js CHANGED
@@ -1,27 +1,40 @@
1
1
  import {
2
+ AppSidebar,
2
3
  BackendSelector,
4
+ ClusterStatusBar,
3
5
  DashboardLayout,
6
+ NewSandboxCard,
4
7
  ProfileComparison,
5
8
  ProfileSelector,
9
+ ResourceMeter,
10
+ SandboxCard,
11
+ SandboxTable,
6
12
  VariantList
7
- } from "./chunk-J4OADEUK.js";
13
+ } from "./chunk-HY5IBRCE.js";
8
14
  import {
9
15
  BillingDashboard,
10
16
  PricingPage,
11
17
  UsageChart
12
- } from "./chunk-4EIWPJMJ.js";
18
+ } from "./chunk-ZP6GSX4D.js";
13
19
  import "./chunk-OKCIKTXQ.js";
14
20
  import "./chunk-MCGKDCOR.js";
15
- import "./chunk-2UHPE5T7.js";
16
- import "./chunk-E6FS7R4X.js";
21
+ import "./chunk-FRGMMANX.js";
22
+ import "./chunk-MXCSSOGH.js";
23
+ import "./chunk-HWLX5NME.js";
17
24
  import "./chunk-RQHJBTEU.js";
18
25
  export {
26
+ AppSidebar,
19
27
  BackendSelector,
20
28
  BillingDashboard,
29
+ ClusterStatusBar,
21
30
  DashboardLayout,
31
+ NewSandboxCard,
22
32
  PricingPage,
23
33
  ProfileComparison,
24
34
  ProfileSelector,
35
+ ResourceMeter,
36
+ SandboxCard,
37
+ SandboxTable,
25
38
  UsageChart,
26
39
  VariantList
27
40
  };