lldlab-ui 0.2.0 → 0.4.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 +90 -4
- package/dist/index.d.ts +284 -77
- package/dist/index.js +504 -290
- package/dist/index.js.map +1 -1
- package/dist/theme.css +19 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -81,6 +81,29 @@ var HEADING_SIZE = {
|
|
|
81
81
|
lg: { display: "lg:text-display", xl: "lg:text-headline-xl", lg: "lg:text-headline-lg", md: "lg:text-headline-md", sm: "lg:text-headline-sm" },
|
|
82
82
|
xl: { display: "xl:text-display", xl: "xl:text-headline-xl", lg: "xl:text-headline-lg", md: "xl:text-headline-md", sm: "xl:text-headline-sm" }
|
|
83
83
|
};
|
|
84
|
+
var PADDING_TOP = {
|
|
85
|
+
base: { none: "pt-0", "2xs": "pt-space-2xs", xs: "pt-space-xs", sm: "pt-space-sm", md: "pt-space-md", lg: "pt-space-lg", xl: "pt-space-xl", "2xl": "pt-space-2xl" },
|
|
86
|
+
sm: { none: "sm:pt-0", "2xs": "sm:pt-space-2xs", xs: "sm:pt-space-xs", sm: "sm:pt-space-sm", md: "sm:pt-space-md", lg: "sm:pt-space-lg", xl: "sm:pt-space-xl", "2xl": "sm:pt-space-2xl" },
|
|
87
|
+
md: { none: "md:pt-0", "2xs": "md:pt-space-2xs", xs: "md:pt-space-xs", sm: "md:pt-space-sm", md: "md:pt-space-md", lg: "md:pt-space-lg", xl: "md:pt-space-xl", "2xl": "md:pt-space-2xl" },
|
|
88
|
+
lg: { none: "lg:pt-0", "2xs": "lg:pt-space-2xs", xs: "lg:pt-space-xs", sm: "lg:pt-space-sm", md: "lg:pt-space-md", lg: "lg:pt-space-lg", xl: "lg:pt-space-xl", "2xl": "lg:pt-space-2xl" },
|
|
89
|
+
xl: { none: "xl:pt-0", "2xs": "xl:pt-space-2xs", xs: "xl:pt-space-xs", sm: "xl:pt-space-sm", md: "xl:pt-space-md", lg: "xl:pt-space-lg", xl: "xl:pt-space-xl", "2xl": "xl:pt-space-2xl" }
|
|
90
|
+
};
|
|
91
|
+
var PADDING_BOTTOM = {
|
|
92
|
+
base: { none: "pb-0", "2xs": "pb-space-2xs", xs: "pb-space-xs", sm: "pb-space-sm", md: "pb-space-md", lg: "pb-space-lg", xl: "pb-space-xl", "2xl": "pb-space-2xl" },
|
|
93
|
+
sm: { none: "sm:pb-0", "2xs": "sm:pb-space-2xs", xs: "sm:pb-space-xs", sm: "sm:pb-space-sm", md: "sm:pb-space-md", lg: "sm:pb-space-lg", xl: "sm:pb-space-xl", "2xl": "sm:pb-space-2xl" },
|
|
94
|
+
md: { none: "md:pb-0", "2xs": "md:pb-space-2xs", xs: "md:pb-space-xs", sm: "md:pb-space-sm", md: "md:pb-space-md", lg: "md:pb-space-lg", xl: "md:pb-space-xl", "2xl": "md:pb-space-2xl" },
|
|
95
|
+
lg: { none: "lg:pb-0", "2xs": "lg:pb-space-2xs", xs: "lg:pb-space-xs", sm: "lg:pb-space-sm", md: "lg:pb-space-md", lg: "lg:pb-space-lg", xl: "lg:pb-space-xl", "2xl": "lg:pb-space-2xl" },
|
|
96
|
+
xl: { none: "xl:pb-0", "2xs": "xl:pb-space-2xs", xs: "xl:pb-space-xs", sm: "xl:pb-space-sm", md: "xl:pb-space-md", lg: "xl:pb-space-lg", xl: "xl:pb-space-xl", "2xl": "xl:pb-space-2xl" }
|
|
97
|
+
};
|
|
98
|
+
var COL_SPAN = {
|
|
99
|
+
base: { 1: "col-span-1", 2: "col-span-2", 3: "col-span-3", 4: "col-span-4", 5: "col-span-5", 6: "col-span-6" },
|
|
100
|
+
sm: { 1: "sm:col-span-1", 2: "sm:col-span-2", 3: "sm:col-span-3", 4: "sm:col-span-4", 5: "sm:col-span-5", 6: "sm:col-span-6" },
|
|
101
|
+
md: { 1: "md:col-span-1", 2: "md:col-span-2", 3: "md:col-span-3", 4: "md:col-span-4", 5: "md:col-span-5", 6: "md:col-span-6" },
|
|
102
|
+
lg: { 1: "lg:col-span-1", 2: "lg:col-span-2", 3: "lg:col-span-3", 4: "lg:col-span-4", 5: "lg:col-span-5", 6: "lg:col-span-6" },
|
|
103
|
+
xl: { 1: "xl:col-span-1", 2: "xl:col-span-2", 3: "xl:col-span-3", 4: "xl:col-span-4", 5: "xl:col-span-5", 6: "xl:col-span-6" }
|
|
104
|
+
};
|
|
105
|
+
var FILL = "h-full min-h-0";
|
|
106
|
+
var GROW = "min-h-0 flex-1";
|
|
84
107
|
|
|
85
108
|
// src/primitives/Box.tsx
|
|
86
109
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
@@ -89,12 +112,14 @@ var SURFACE_TONE = {
|
|
|
89
112
|
subtle: "bg-surface-subtle text-on-surface",
|
|
90
113
|
elevated: "bg-surface-elevated text-on-surface",
|
|
91
114
|
low: "bg-surface-container-low text-on-surface",
|
|
115
|
+
container: "bg-surface-container text-on-surface",
|
|
92
116
|
inverse: "bg-brand-obsidian text-on-primary"
|
|
93
117
|
};
|
|
94
118
|
var RADIUS = { none: "", sm: "rounded", md: "rounded-lg", lg: "rounded-xl" };
|
|
95
119
|
var BORDER = { none: "", subtle: "border border-border-subtle", strong: "border border-border-strong" };
|
|
96
120
|
var SHADOW = { none: "", sm: "shadow-sm", md: "shadow-md" };
|
|
97
|
-
|
|
121
|
+
var HEIGHT = { sm: "h-[20rem]", md: "h-[28rem]", lg: "h-[32rem]", xl: "h-[40rem]" };
|
|
122
|
+
function Box({ as, padding, radius = "none", tone, border = "none", shadow = "none", dimmed, height, fill, grow, ...rest }) {
|
|
98
123
|
const C = as ?? "div";
|
|
99
124
|
return /* @__PURE__ */ jsx2(
|
|
100
125
|
C,
|
|
@@ -109,7 +134,10 @@ function Box({ as, padding, radius = "none", tone, border = "none", shadow = "no
|
|
|
109
134
|
RADIUS[radius],
|
|
110
135
|
BORDER[border],
|
|
111
136
|
SHADOW[shadow],
|
|
112
|
-
dimmed && "pointer-events-none select-none opacity-40"
|
|
137
|
+
dimmed && "pointer-events-none select-none opacity-40",
|
|
138
|
+
height && HEIGHT[height],
|
|
139
|
+
fill && FILL,
|
|
140
|
+
grow && GROW
|
|
113
141
|
)
|
|
114
142
|
}
|
|
115
143
|
);
|
|
@@ -117,7 +145,7 @@ function Box({ as, padding, radius = "none", tone, border = "none", shadow = "no
|
|
|
117
145
|
|
|
118
146
|
// src/primitives/Stack.tsx
|
|
119
147
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
120
|
-
function Stack({ as, direction = "column", gap = "md", align, justify, wrap, ...rest }) {
|
|
148
|
+
function Stack({ as, direction = "column", gap = "md", align, justify, wrap, fill, grow, ...rest }) {
|
|
121
149
|
const C = as ?? "div";
|
|
122
150
|
return /* @__PURE__ */ jsx3(
|
|
123
151
|
C,
|
|
@@ -129,7 +157,9 @@ function Stack({ as, direction = "column", gap = "md", align, justify, wrap, ...
|
|
|
129
157
|
responsive(GAP, gap),
|
|
130
158
|
responsive(ALIGN, align),
|
|
131
159
|
responsive(JUSTIFY, justify),
|
|
132
|
-
wrap && "flex-wrap"
|
|
160
|
+
wrap && "flex-wrap",
|
|
161
|
+
fill && FILL,
|
|
162
|
+
grow && GROW
|
|
133
163
|
)
|
|
134
164
|
}
|
|
135
165
|
);
|
|
@@ -142,10 +172,14 @@ function Grid({ as, cols = 1, gap = "md", ...rest }) {
|
|
|
142
172
|
const c = typeof cols === "object" ? { base: 1, ...cols } : { base: 1, md: cols };
|
|
143
173
|
return /* @__PURE__ */ jsx4(C, { ...rest, className: cx("grid min-w-0", responsive(COLS, c), responsive(GAP, gap)) });
|
|
144
174
|
}
|
|
175
|
+
function GridItem({ as, span, ...rest }) {
|
|
176
|
+
const C = as ?? "div";
|
|
177
|
+
return /* @__PURE__ */ jsx4(C, { ...rest, className: cx("min-w-0", responsive(COL_SPAN, span)) });
|
|
178
|
+
}
|
|
145
179
|
|
|
146
180
|
// src/primitives/Container.tsx
|
|
147
181
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
148
|
-
var SIZE = { md: "max-w-3xl", lg: "max-w-5xl", xl: "max-w-7xl" };
|
|
182
|
+
var SIZE = { md: "max-w-3xl", lg: "max-w-5xl", xl: "max-w-7xl", full: "max-w-none" };
|
|
149
183
|
function Container({ as, size = "xl", ...rest }) {
|
|
150
184
|
const C = as ?? "div";
|
|
151
185
|
return /* @__PURE__ */ jsx5(C, { ...rest, className: cx("mx-auto w-full min-w-0 px-gutter-fluid", SIZE[size]) });
|
|
@@ -153,26 +187,38 @@ function Container({ as, size = "xl", ...rest }) {
|
|
|
153
187
|
|
|
154
188
|
// src/primitives/Section.tsx
|
|
155
189
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
156
|
-
var PADDING2 = { md: "py-section-md", lg: "py-section-lg", xl: "py-section-xl" };
|
|
157
|
-
var PATTERN = { none: "", dots: "bg-pattern-dots", grid: "bg-pattern-grid" };
|
|
158
|
-
function Section({ as, tone, padding = "lg", pattern = "none", ...rest }) {
|
|
190
|
+
var PADDING2 = { none: "", md: "py-section-md", lg: "py-section-lg", xl: "py-section-xl" };
|
|
191
|
+
var PATTERN = { none: "", dots: "bg-pattern-dots", "dots-brand": "bg-pattern-dots-brand", grid: "bg-pattern-grid" };
|
|
192
|
+
function Section({ as, tone, padding = "lg", paddingTop, paddingBottom, pattern = "none", ...rest }) {
|
|
193
|
+
const fixed = paddingTop !== void 0 || paddingBottom !== void 0;
|
|
159
194
|
const C = as ?? "section";
|
|
160
|
-
return /* @__PURE__ */ jsx6(C, { ...rest, "data-theme": tone === "inverse" ? "dark" : void 0, className: cx("w-full min-w-0", tone && SURFACE_TONE[tone], PADDING2[padding], PATTERN[pattern]) });
|
|
195
|
+
return /* @__PURE__ */ jsx6(C, { ...rest, "data-theme": tone === "inverse" ? "dark" : void 0, className: cx("w-full min-w-0", tone && SURFACE_TONE[tone], fixed ? cx(responsive(PADDING_TOP, paddingTop), responsive(PADDING_BOTTOM, paddingBottom)) : PADDING2[padding], PATTERN[pattern]) });
|
|
161
196
|
}
|
|
162
197
|
|
|
163
198
|
// src/primitives/Split.tsx
|
|
164
199
|
import { jsx as jsx7, jsxs } from "react/jsx-runtime";
|
|
165
|
-
var MAIN = {
|
|
166
|
-
|
|
200
|
+
var MAIN = {
|
|
201
|
+
lg: { "8/4": "lg:col-span-8", "1/1": "lg:col-span-6", "9/3": "lg:col-span-9", "7/5": "lg:col-span-7", "5/7": "lg:col-span-5" },
|
|
202
|
+
xl: { "8/4": "xl:col-span-8", "1/1": "xl:col-span-6", "9/3": "xl:col-span-9", "7/5": "xl:col-span-7", "5/7": "xl:col-span-5" }
|
|
203
|
+
};
|
|
204
|
+
var ASIDE = {
|
|
205
|
+
lg: { "8/4": "lg:col-span-4", "1/1": "lg:col-span-6", "9/3": "lg:col-span-3", "7/5": "lg:col-span-5", "5/7": "lg:col-span-7" },
|
|
206
|
+
xl: { "8/4": "xl:col-span-4", "1/1": "xl:col-span-6", "9/3": "xl:col-span-3", "7/5": "xl:col-span-5", "5/7": "xl:col-span-7" }
|
|
207
|
+
};
|
|
208
|
+
var GRID = { lg: "lg:grid-cols-12", xl: "xl:grid-cols-12" };
|
|
167
209
|
var STICKY_ASIDE = {
|
|
168
210
|
none: "xl:sticky xl:top-space-lg xl:self-start",
|
|
169
211
|
appbar: "xl:sticky xl:top-[calc(var(--spacing-appbar)+1rem)] xl:self-start"
|
|
170
212
|
};
|
|
213
|
+
var STICKY_ASIDE_LG = {
|
|
214
|
+
none: "lg:sticky lg:top-space-lg lg:self-start",
|
|
215
|
+
appbar: "lg:sticky lg:top-[calc(var(--spacing-appbar)+1rem)] lg:self-start"
|
|
216
|
+
};
|
|
171
217
|
var STICKY_START = {
|
|
172
218
|
none: "lg:sticky lg:top-space-lg lg:self-start",
|
|
173
219
|
appbar: "lg:sticky lg:top-[calc(var(--spacing-appbar)+1rem)] lg:self-start"
|
|
174
220
|
};
|
|
175
|
-
function Split({ ratio = "8/4", aside, start, sticky, stickyOffset = "none", gap = "lg", children, ...rest }) {
|
|
221
|
+
function Split({ ratio = "8/4", breakpoint = "xl", asideAs = "aside", aside, start, sticky, stickyOffset = "none", gap = "lg", children, ...rest }) {
|
|
176
222
|
if (start) {
|
|
177
223
|
return /* @__PURE__ */ jsxs("div", { ...rest, className: cx("grid min-w-0 grid-cols-1 lg:grid-cols-12", responsive(GAP, gap)), children: [
|
|
178
224
|
/* @__PURE__ */ jsx7("div", { className: cx("hidden min-w-0 lg:col-span-3 lg:block xl:col-span-2", sticky && STICKY_START[stickyOffset]), children: start }),
|
|
@@ -180,9 +226,10 @@ function Split({ ratio = "8/4", aside, start, sticky, stickyOffset = "none", gap
|
|
|
180
226
|
/* @__PURE__ */ jsx7("aside", { className: cx("min-w-0 lg:col-span-9 lg:col-start-4 xl:col-span-3 xl:col-start-auto", sticky && STICKY_ASIDE[stickyOffset]), children: aside })
|
|
181
227
|
] });
|
|
182
228
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
/* @__PURE__ */ jsx7("
|
|
229
|
+
const Side = asideAs;
|
|
230
|
+
return /* @__PURE__ */ jsxs("div", { ...rest, className: cx("grid min-w-0 grid-cols-1", GRID[breakpoint], responsive(GAP, gap)), children: [
|
|
231
|
+
/* @__PURE__ */ jsx7("div", { className: cx("min-w-0", MAIN[breakpoint][ratio]), children }),
|
|
232
|
+
/* @__PURE__ */ jsx7(Side, { className: cx("min-w-0", ASIDE[breakpoint][ratio], sticky && (breakpoint === "lg" ? STICKY_ASIDE_LG : STICKY_ASIDE)[stickyOffset]), children: aside })
|
|
186
233
|
] });
|
|
187
234
|
}
|
|
188
235
|
|
|
@@ -207,7 +254,7 @@ var DOT_TONE = {
|
|
|
207
254
|
|
|
208
255
|
// src/components/Icon.tsx
|
|
209
256
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
210
|
-
var SIZE2 = { sm: "text-[16px]", md: "text-[20px]", lg: "text-[24px]", xl: "text-[32px]" };
|
|
257
|
+
var SIZE2 = { xs: "text-[14px]", sm: "text-[16px]", ms: "text-[18px]", md: "text-[20px]", lg: "text-[24px]", xl: "text-[32px]" };
|
|
211
258
|
function Icon({ name, size = "md", tone = "inherit", filled, spin, label, ...rest }) {
|
|
212
259
|
return /* @__PURE__ */ jsx8(
|
|
213
260
|
"span",
|
|
@@ -230,7 +277,7 @@ function Icon({ name, size = "md", tone = "inherit", filled, spin, label, ...res
|
|
|
230
277
|
|
|
231
278
|
// src/components/Dot.tsx
|
|
232
279
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
233
|
-
var SIZE3 = { sm: "size-1.5", md: "size-2" };
|
|
280
|
+
var SIZE3 = { sm: "size-1.5", md: "size-2", lg: "size-3" };
|
|
234
281
|
function Dot({ tone = "neutral", size = "sm", pulse, ...rest }) {
|
|
235
282
|
return /* @__PURE__ */ jsx9("span", { ...rest, "aria-hidden": "true", className: cx("inline-block shrink-0 rounded-full", DOT_TONE[tone], SIZE3[size], pulse && "animate-pulse") });
|
|
236
283
|
}
|
|
@@ -259,6 +306,7 @@ function Text({
|
|
|
259
306
|
align,
|
|
260
307
|
measure,
|
|
261
308
|
uppercase,
|
|
309
|
+
underline,
|
|
262
310
|
...rest
|
|
263
311
|
}) {
|
|
264
312
|
const C = as ?? "p";
|
|
@@ -276,7 +324,8 @@ function Text({
|
|
|
276
324
|
clamp2 && CLAMP[clamp2],
|
|
277
325
|
align && ALIGN2[align],
|
|
278
326
|
measure && "max-w-prose",
|
|
279
|
-
upper && "uppercase"
|
|
327
|
+
upper && "uppercase",
|
|
328
|
+
underline === "wavy" && "underline decoration-wavy decoration-2 decoration-brand-crimson/30 underline-offset-4"
|
|
280
329
|
)
|
|
281
330
|
}
|
|
282
331
|
);
|
|
@@ -296,13 +345,13 @@ var TONE = {
|
|
|
296
345
|
warning: "text-fg-warning"
|
|
297
346
|
};
|
|
298
347
|
var ALIGN3 = { start: "", center: "text-center" };
|
|
299
|
-
function Heading({ level, size, tone = "default", truncate, align = "start", ...rest }) {
|
|
348
|
+
function Heading({ level, size, tone = "default", truncate, align = "start", balance = true, leading, ...rest }) {
|
|
300
349
|
const C = TAG[level];
|
|
301
350
|
return /* @__PURE__ */ jsx11(
|
|
302
351
|
C,
|
|
303
352
|
{
|
|
304
353
|
...rest,
|
|
305
|
-
className: cx("min-w-0 font-display", truncate ? "truncate" : "text-balance wrap-break-word", responsive(HEADING_SIZE, size ?? DEFAULT_SIZE[level]), TONE[tone], ALIGN3[align])
|
|
354
|
+
className: cx("min-w-0 font-display", truncate ? "truncate" : cx(balance && "text-balance", "wrap-break-word"), responsive(HEADING_SIZE, size ?? DEFAULT_SIZE[level]), leading === "none" && "leading-none", TONE[tone], ALIGN3[align])
|
|
306
355
|
}
|
|
307
356
|
);
|
|
308
357
|
}
|
|
@@ -310,12 +359,15 @@ function Heading({ level, size, tone = "default", truncate, align = "start", ...
|
|
|
310
359
|
// src/primitives/Eyebrow.tsx
|
|
311
360
|
import { jsx as jsx12, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
312
361
|
var VARIANT2 = {
|
|
313
|
-
pill: "rounded-full
|
|
362
|
+
pill: "rounded-full bg-surface-elevated shadow-sm px-space-sm py-space-2xs",
|
|
363
|
+
tinted: "rounded-full bg-surface-container px-space-sm py-space-2xs",
|
|
314
364
|
plain: ""
|
|
315
365
|
};
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
366
|
+
var TEXT = { neutral: "text-on-surface-variant", brand: "text-fg-brand", success: "text-fg-success", warning: "text-fg-warning", danger: "text-fg-danger" };
|
|
367
|
+
function Eyebrow({ tone = "brand", pulse, variant = "pill", dot = true, children, ...rest }) {
|
|
368
|
+
const text = variant === "tinted" && tone === "brand" ? "text-badge-intermediate-text" : TEXT[tone];
|
|
369
|
+
return /* @__PURE__ */ jsxs2("span", { ...rest, className: cx("inline-flex max-w-full items-center gap-space-xs font-label-mono text-label-mono uppercase", text, VARIANT2[variant]), children: [
|
|
370
|
+
dot && /* @__PURE__ */ jsx12(Dot, { tone, pulse, "data-dot": "" }),
|
|
319
371
|
/* @__PURE__ */ jsx12("span", { className: "truncate", children })
|
|
320
372
|
] });
|
|
321
373
|
}
|
|
@@ -423,7 +475,7 @@ function Highlighted({ code, language, numbered }) {
|
|
|
423
475
|
const tokens = useTokenize({ prism: Prism, code, grammar: Prism.languages[language], language });
|
|
424
476
|
return /* @__PURE__ */ jsx14(Lines, { numbered, lines: tokens.map((line) => line.map((t) => ({ content: t.content, className: tokenClass(t.types) }))) });
|
|
425
477
|
}
|
|
426
|
-
function CodeBlock({ language, highlight, title, meta, actions, lineNumbers, tone = "dark", children, ...rest }) {
|
|
478
|
+
function CodeBlock({ language, highlight, title, meta, actions, lineNumbers, tone = "dark", bare, children, ...rest }) {
|
|
427
479
|
const t = TONE2[tone];
|
|
428
480
|
const code = typeof children === "string" ? children.replace(/\n$/, "") : null;
|
|
429
481
|
const lang = highlight && code !== null ? resolveLanguage(language) : void 0;
|
|
@@ -431,8 +483,8 @@ function CodeBlock({ language, highlight, title, meta, actions, lineNumbers, ton
|
|
|
431
483
|
let body = children;
|
|
432
484
|
if (code !== null && lang) body = /* @__PURE__ */ jsx14(Highlighted, { code, language: lang, numbered: lineNumbers });
|
|
433
485
|
else if (code !== null && lineNumbers) body = /* @__PURE__ */ jsx14(Lines, { numbered: true, lines: code.split("\n").map((l) => [{ content: l, className: "" }]) });
|
|
434
|
-
return /* @__PURE__ */ jsxs3("figure", { ...rest, className: cx("min-w-0 max-w-full overflow-hidden rounded-xl", t.root), children: [
|
|
435
|
-
(heading || meta || actions) && /* @__PURE__ */ jsxs3("figcaption", { className: cx("flex min-w-0 flex-wrap items-center gap-space-sm border-b px-space-md py-space-xs font-label-mono text-label-mono", t.header), children: [
|
|
486
|
+
return /* @__PURE__ */ jsxs3("figure", { ...rest, "data-theme": tone === "dark" ? "dark" : void 0, className: cx("min-w-0 max-w-full overflow-hidden", !bare && cx("rounded-xl", t.root)), children: [
|
|
487
|
+
!bare && (heading || meta || actions) && /* @__PURE__ */ jsxs3("figcaption", { className: cx("flex min-w-0 flex-wrap items-center gap-space-sm border-b px-space-md py-space-xs font-label-mono text-label-mono", t.header), children: [
|
|
436
488
|
heading && /* @__PURE__ */ jsx14("span", { className: cx("min-w-0 truncate", !title && "uppercase"), children: heading }),
|
|
437
489
|
meta,
|
|
438
490
|
actions && /* @__PURE__ */ jsx14("span", { className: "ml-auto flex shrink-0 items-center gap-space-xs", children: actions })
|
|
@@ -441,7 +493,7 @@ function CodeBlock({ language, highlight, title, meta, actions, lineNumbers, ton
|
|
|
441
493
|
"pre",
|
|
442
494
|
{
|
|
443
495
|
tabIndex: 0,
|
|
444
|
-
className: "overflow-x-auto
|
|
496
|
+
className: cx("overflow-x-auto font-code-inline text-code-inline text-code-plain focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-brand-cobalt", bare ? "p-0" : "p-space-md"),
|
|
445
497
|
children: /* @__PURE__ */ jsx14("code", { className: lineNumbers ? "table" : void 0, children: body })
|
|
446
498
|
}
|
|
447
499
|
)
|
|
@@ -489,15 +541,18 @@ function Markdown({ children, ...rest }) {
|
|
|
489
541
|
import { jsx as jsx16, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
490
542
|
var TONE3 = {
|
|
491
543
|
neutral: "bg-surface-muted text-on-surface-variant",
|
|
544
|
+
subtle: "bg-surface-subtle text-on-surface",
|
|
545
|
+
container: "bg-surface-container text-secondary",
|
|
492
546
|
brand: "bg-ink text-on-ink",
|
|
493
547
|
success: "bg-badge-beginner-bg text-badge-beginner-text",
|
|
494
548
|
warning: "bg-badge-amber-bg text-badge-amber-text",
|
|
495
549
|
danger: "bg-badge-advanced-bg text-badge-advanced-text",
|
|
496
550
|
info: "bg-badge-intermediate-bg text-badge-intermediate-text"
|
|
497
551
|
};
|
|
498
|
-
var SIZE4 = { sm: "px-space-xs py-space-2xs", md: "px-space-sm py-space-xs" };
|
|
499
|
-
|
|
500
|
-
|
|
552
|
+
var SIZE4 = { xs: "px-space-xs py-space-2xs text-[10px]", sm: "px-space-xs py-space-2xs", md: "px-space-sm py-space-xs" };
|
|
553
|
+
var SHAPE = { square: "rounded", pill: "rounded-full" };
|
|
554
|
+
function Badge({ tone = "neutral", uppercase, size = "sm", shape = "square", outlined, icon, dot, pulse, children, ...rest }) {
|
|
555
|
+
return /* @__PURE__ */ jsxs4("span", { ...rest, className: cx("inline-flex max-w-full items-center gap-space-2xs whitespace-nowrap font-label-mono text-label-mono", SHAPE[shape], TONE3[tone], SIZE4[size], outlined && "border border-current/25", uppercase && "uppercase"), children: [
|
|
501
556
|
dot && /* @__PURE__ */ jsx16(Dot, { tone: dot, pulse }),
|
|
502
557
|
icon && /* @__PURE__ */ jsx16(Icon, { name: icon, size: "sm" }),
|
|
503
558
|
/* @__PURE__ */ jsx16("span", { className: "min-w-0 truncate", children })
|
|
@@ -535,12 +590,14 @@ function Chip({ tone = "neutral", icon, dot, onRemove, children, ...rest }) {
|
|
|
535
590
|
|
|
536
591
|
// src/components/Stat.tsx
|
|
537
592
|
import { jsx as jsx18, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
593
|
+
var ICON_TONE = { muted: "text-on-surface-variant", brand: "text-brand-cobalt", success: "text-brand-emerald", warning: "text-brand-amber", danger: "text-brand-crimson" };
|
|
594
|
+
var VARIANT3 = { plain: "gap-space-sm", tile: "gap-space-xs rounded-lg bg-surface-subtle px-space-md py-space-xs shadow-sm" };
|
|
595
|
+
function Stat({ icon, label, value, variant = "plain", iconTone = "muted", ...rest }) {
|
|
596
|
+
return /* @__PURE__ */ jsxs6("div", { ...rest, className: cx("flex min-w-0 items-center", VARIANT3[variant]), children: [
|
|
597
|
+
/* @__PURE__ */ jsx18("span", { className: ICON_TONE[iconTone], children: /* @__PURE__ */ jsx18(Icon, { name: icon, tone: "inherit" }) }),
|
|
541
598
|
/* @__PURE__ */ jsxs6("div", { className: "min-w-0", children: [
|
|
542
|
-
/* @__PURE__ */ jsx18("p", { className: "truncate font-label-mono text-label-mono uppercase text-on-surface-variant", children: label }),
|
|
543
|
-
/* @__PURE__ */ jsx18("p", { className: "truncate font-display text-headline-sm text-ink", children: value })
|
|
599
|
+
/* @__PURE__ */ jsx18("p", { className: "truncate font-label-mono text-label-mono uppercase leading-none text-on-surface-variant", children: label }),
|
|
600
|
+
/* @__PURE__ */ jsx18("p", { className: "mt-space-2xs truncate font-display text-headline-sm leading-none text-ink", children: value })
|
|
544
601
|
] })
|
|
545
602
|
] });
|
|
546
603
|
}
|
|
@@ -594,7 +651,7 @@ var FILLED = {
|
|
|
594
651
|
};
|
|
595
652
|
var SIZE6 = { sm: "size-8", md: "size-10", lg: "size-12", xl: "size-14" };
|
|
596
653
|
var ICON_SIZE = { sm: "sm", md: "md", lg: "lg", xl: "xl" };
|
|
597
|
-
var
|
|
654
|
+
var SHAPE2 = { square: "rounded-lg", circle: "rounded-full" };
|
|
598
655
|
function IconTile({ icon, tone = "neutral", size = "md", shape = "square", filled, label, ...rest }) {
|
|
599
656
|
return /* @__PURE__ */ jsx20(
|
|
600
657
|
"span",
|
|
@@ -603,7 +660,7 @@ function IconTile({ icon, tone = "neutral", size = "md", shape = "square", fille
|
|
|
603
660
|
role: label ? "img" : void 0,
|
|
604
661
|
"aria-label": label,
|
|
605
662
|
"aria-hidden": label ? void 0 : true,
|
|
606
|
-
className: cx("inline-flex shrink-0 items-center justify-center", filled ? FILLED[tone] : TONE6[tone], SIZE6[size],
|
|
663
|
+
className: cx("inline-flex shrink-0 items-center justify-center", filled ? FILLED[tone] : TONE6[tone], SIZE6[size], SHAPE2[shape]),
|
|
607
664
|
children: /* @__PURE__ */ jsx20(Icon, { name: icon, size: ICON_SIZE[size], filled })
|
|
608
665
|
}
|
|
609
666
|
);
|
|
@@ -618,13 +675,13 @@ var ACCENT = {
|
|
|
618
675
|
warning: "border-b-2 border-b-brand-amber",
|
|
619
676
|
danger: "border-b-2 border-b-brand-crimson"
|
|
620
677
|
};
|
|
621
|
-
function SectionHeader({ title, level = 2, dot, tag, tagTone = "neutral", meta, description, icon, accent, size = "sm", ...rest }) {
|
|
622
|
-
return /* @__PURE__ */ jsxs8("div", { ...rest, className: cx("flex min-w-0 flex-wrap items-center gap-x-space-sm gap-y-space-xs pb-space-sm", accent ? ACCENT[accent] : "border-b border-border-subtle"), children: [
|
|
678
|
+
function SectionHeader({ title, level = 2, dot, tag, tagTone = "neutral", meta, description, icon, accent, size = "sm", divider = true, metaUppercase = true, ...rest }) {
|
|
679
|
+
return /* @__PURE__ */ jsxs8("div", { ...rest, className: cx("flex min-w-0 flex-wrap items-center gap-x-space-sm gap-y-space-xs pb-space-sm", accent ? ACCENT[accent] : divider && "border-b border-border-subtle"), children: [
|
|
623
680
|
icon && /* @__PURE__ */ jsx21(IconTile, { icon, size: "sm", tone: accent ?? "neutral" }),
|
|
624
|
-
dot && /* @__PURE__ */ jsx21(Dot, { tone: dot, size: "md" }),
|
|
681
|
+
dot && /* @__PURE__ */ jsx21(Dot, { tone: dot, size: divider ? "md" : "lg" }),
|
|
625
682
|
/* @__PURE__ */ jsx21(Heading, { level, size, children: title }),
|
|
626
683
|
tag && /* @__PURE__ */ jsx21(Badge, { tone: tagTone, uppercase: true, children: tag }),
|
|
627
|
-
meta && /* @__PURE__ */ jsx21("span", { className: "ml-auto min-w-0 max-w-full truncate font-label-mono text-label-mono
|
|
684
|
+
meta && /* @__PURE__ */ jsx21("span", { className: cx("ml-auto min-w-0 max-w-full truncate font-label-mono text-label-mono text-on-surface-variant", metaUppercase && "uppercase"), children: meta }),
|
|
628
685
|
description && /* @__PURE__ */ jsx21("p", { className: "basis-full font-body-sm text-body-sm text-on-surface-variant wrap-break-word", children: description })
|
|
629
686
|
] });
|
|
630
687
|
}
|
|
@@ -659,10 +716,10 @@ var STATUS = {
|
|
|
659
716
|
warning: { icon: "warning", tone: "warning", label: "Warning" },
|
|
660
717
|
pending: { icon: "schedule", tone: "muted", label: "Pending" }
|
|
661
718
|
};
|
|
662
|
-
var
|
|
719
|
+
var VARIANT4 = { plain: "items-start py-space-sm", boxed: "items-center rounded bg-surface-subtle p-space-sm" };
|
|
663
720
|
function ResultRow({ status, title, detail, meta, badge, variant = "plain", selected, titleMono, ...rest }) {
|
|
664
721
|
const s = STATUS[status];
|
|
665
|
-
return /* @__PURE__ */ jsxs10("div", { ...rest, className: cx("flex min-w-0
|
|
722
|
+
return /* @__PURE__ */ jsxs10("div", { ...rest, className: cx("flex min-w-0 gap-space-sm", VARIANT4[variant], selected && "border-l-4 border-l-brand-cobalt pl-space-sm"), children: [
|
|
666
723
|
/* @__PURE__ */ jsx23(Icon, { name: s.icon, tone: s.tone, filled: true, label: s.label }),
|
|
667
724
|
/* @__PURE__ */ jsxs10("div", { className: "min-w-0 flex-1", children: [
|
|
668
725
|
/* @__PURE__ */ jsx23("p", { className: cx("text-on-surface wrap-break-word", titleMono ? "font-code-inline text-code-inline" : "font-body-md text-body-md"), children: title }),
|
|
@@ -687,11 +744,11 @@ var TONE8 = {
|
|
|
687
744
|
default: { tile: "bg-surface-muted text-on-surface-variant", text: "text-on-surface-variant" },
|
|
688
745
|
danger: { tile: "bg-badge-advanced-bg text-badge-advanced-text", text: "text-fg-danger" }
|
|
689
746
|
};
|
|
690
|
-
function EmptyState({ icon = "inbox", title, description, action, media, code, tone = "default", ...rest }) {
|
|
747
|
+
function EmptyState({ icon = "inbox", title, description, action, media, code, tone = "default", headingLevel = 3, ...rest }) {
|
|
691
748
|
const t = TONE8[tone];
|
|
692
749
|
return /* @__PURE__ */ jsxs11("div", { ...rest, className: "flex min-w-0 flex-col items-center gap-space-sm px-space-md py-space-xl text-center", children: [
|
|
693
750
|
media ? /* @__PURE__ */ jsx25("div", { className: "w-full min-w-0", children: media }) : code ? /* @__PURE__ */ jsx25("p", { className: "font-label-mono text-6xl font-semibold text-ink", children: code }) : /* @__PURE__ */ jsx25("span", { className: cx("inline-flex size-12 items-center justify-center rounded-full", t.tile), children: /* @__PURE__ */ jsx25(Icon, { name: icon, size: "lg" }) }),
|
|
694
|
-
/* @__PURE__ */ jsx25("div", { className: "w-full min-w-0", children: /* @__PURE__ */ jsx25(Heading, { level:
|
|
751
|
+
/* @__PURE__ */ jsx25("div", { className: "w-full min-w-0", children: /* @__PURE__ */ jsx25(Heading, { level: headingLevel, size: headingLevel === 1 ? "lg" : "sm", children: title }) }),
|
|
695
752
|
description && /* @__PURE__ */ jsx25("p", { className: cx("w-full min-w-0 max-w-prose font-body-sm text-body-sm wrap-break-word", t.text), children: description }),
|
|
696
753
|
action
|
|
697
754
|
] });
|
|
@@ -710,26 +767,36 @@ function CheckList({ items, icon = "check", tone = "success", ...rest }) {
|
|
|
710
767
|
import { Children, isValidElement } from "react";
|
|
711
768
|
import { jsx as jsx27, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
712
769
|
var TONE9 = {
|
|
713
|
-
default: "bg-surface-elevated
|
|
714
|
-
subtle: "bg-surface-subtle
|
|
715
|
-
inverse: "bg-brand-obsidian
|
|
770
|
+
default: "bg-surface-elevated text-on-surface",
|
|
771
|
+
subtle: "bg-surface-subtle text-on-surface",
|
|
772
|
+
inverse: "bg-brand-obsidian text-on-primary"
|
|
716
773
|
};
|
|
774
|
+
var SHADOW2 = { none: "", sm: "shadow-sm", md: "shadow-md", xl: "shadow-xl" };
|
|
775
|
+
var BAR_TONE = { default: "bg-surface-subtle", slate: "bg-brand-slate", none: "" };
|
|
776
|
+
var BAR_DENSITY = { md: "px-space-lg py-space-sm", sm: "px-space-md py-space-sm" };
|
|
717
777
|
var PATTERN2 = { none: "", dots: "bg-pattern-dots", grid: "bg-pattern-grid" };
|
|
718
778
|
var ASPECT = { video: "aspect-video", wide: "aspect-[21/9]", square: "aspect-square" };
|
|
719
|
-
var
|
|
720
|
-
var INVERSE_BAR = "group-data-[tone=inverse]/card:border-white/10 group-data-[tone=inverse]/card:bg-
|
|
721
|
-
function CardHeader({ start, end, children, ...rest }) {
|
|
722
|
-
return /* @__PURE__ */ jsxs13(
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
779
|
+
var HEIGHT2 = { sm: "h-30", md: "h-35" };
|
|
780
|
+
var INVERSE_BAR = "group-data-[tone=inverse]/card:border-white/10 group-data-[tone=inverse]/card:bg-brand-slate";
|
|
781
|
+
function CardHeader({ start, end, children, divider = false, density = "md", tone = "default", ...rest }) {
|
|
782
|
+
return /* @__PURE__ */ jsxs13(
|
|
783
|
+
"div",
|
|
784
|
+
{
|
|
785
|
+
...rest,
|
|
786
|
+
className: cx("flex min-w-0 flex-wrap items-center justify-between gap-space-sm", BAR_TONE[tone], BAR_DENSITY[density], divider && "border-b border-border-subtle", tone === "default" && INVERSE_BAR),
|
|
787
|
+
children: [
|
|
788
|
+
/* @__PURE__ */ jsx27("div", { className: "flex min-w-0 items-center gap-space-sm", children: start ?? children }),
|
|
789
|
+
end && /* @__PURE__ */ jsx27("div", { className: "flex shrink-0 flex-wrap items-center gap-space-sm", children: end })
|
|
790
|
+
]
|
|
791
|
+
}
|
|
792
|
+
);
|
|
726
793
|
}
|
|
727
794
|
function CardMedia({ pattern = "dots", aspect = "video", height, caption, children, ...rest }) {
|
|
728
795
|
return /* @__PURE__ */ jsxs13(
|
|
729
796
|
"div",
|
|
730
797
|
{
|
|
731
798
|
...rest,
|
|
732
|
-
className: cx("relative flex min-w-0 items-center justify-center border-b border-border-subtle bg-surface-subtle", INVERSE_BAR, PATTERN2[pattern], height ?
|
|
799
|
+
className: cx("relative flex min-w-0 items-center justify-center border-b border-border-subtle bg-surface-subtle", INVERSE_BAR, PATTERN2[pattern], height ? HEIGHT2[height] : ASPECT[aspect]),
|
|
733
800
|
children: [
|
|
734
801
|
caption && /* @__PURE__ */ jsx27("span", { className: "absolute left-space-sm top-space-sm font-label-mono text-[10px] uppercase tracking-wider text-on-surface-variant", children: caption }),
|
|
735
802
|
children
|
|
@@ -737,10 +804,17 @@ function CardMedia({ pattern = "dots", aspect = "video", height, caption, childr
|
|
|
737
804
|
}
|
|
738
805
|
);
|
|
739
806
|
}
|
|
740
|
-
function CardFooter({ children, ...rest }) {
|
|
741
|
-
return /* @__PURE__ */ jsx27(
|
|
807
|
+
function CardFooter({ children, divider = false, density = "md", tone = "default", ...rest }) {
|
|
808
|
+
return /* @__PURE__ */ jsx27(
|
|
809
|
+
"div",
|
|
810
|
+
{
|
|
811
|
+
...rest,
|
|
812
|
+
className: cx("flex min-w-0 flex-wrap items-center justify-between gap-space-sm", BAR_TONE[tone], BAR_DENSITY[density], divider && "border-t border-border-subtle", tone === "default" && INVERSE_BAR),
|
|
813
|
+
children
|
|
814
|
+
}
|
|
815
|
+
);
|
|
742
816
|
}
|
|
743
|
-
function CardRoot({ as, padding = "lg", interactive, tone = "default", pattern = "none", children, ...rest }) {
|
|
817
|
+
function CardRoot({ as, padding = "lg", interactive, tone = "default", pattern = "none", shadow = "sm", outlined, gap = "sm", fill, children, ...rest }) {
|
|
744
818
|
const C = as ?? "div";
|
|
745
819
|
const parts = Children.toArray(children);
|
|
746
820
|
const isType = (t) => (p) => isValidElement(p) && p.type === t;
|
|
@@ -754,11 +828,11 @@ function CardRoot({ as, padding = "lg", interactive, tone = "default", pattern =
|
|
|
754
828
|
...rest,
|
|
755
829
|
"data-tone": tone,
|
|
756
830
|
"data-theme": tone === "inverse" ? "dark" : void 0,
|
|
757
|
-
className: cx("group/card flex min-w-0 flex-col overflow-hidden rounded-xl", TONE9[tone], PATTERN2[pattern], interactive && cx("transition-shadow hover:shadow-md", FOCUS_RING)),
|
|
831
|
+
className: cx("group/card flex min-w-0 flex-col overflow-hidden rounded-xl", TONE9[tone], SHADOW2[shadow], outlined && "border border-border-subtle", PATTERN2[pattern], fill && "h-full", interactive && cx("transition-shadow hover:shadow-md", FOCUS_RING)),
|
|
758
832
|
children: [
|
|
759
833
|
header,
|
|
760
834
|
media,
|
|
761
|
-
/* @__PURE__ */ jsx27("div", { className: cx("flex min-w-0 flex-1 flex-col
|
|
835
|
+
/* @__PURE__ */ jsx27("div", { className: cx("flex min-w-0 flex-1 flex-col", fill && "min-h-0", responsive(GAP, gap), responsive(PADDING, padding)), children: body }),
|
|
762
836
|
footer
|
|
763
837
|
]
|
|
764
838
|
}
|
|
@@ -768,17 +842,21 @@ var Card = Object.assign(CardRoot, { Header: CardHeader, Media: CardMedia, Foote
|
|
|
768
842
|
|
|
769
843
|
// src/components/Button.tsx
|
|
770
844
|
import { jsx as jsx28, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
771
|
-
var
|
|
845
|
+
var VARIANT5 = {
|
|
772
846
|
primary: "bg-ink text-on-ink shadow-sm hover:bg-ink-hover",
|
|
773
847
|
secondary: "border border-border-subtle bg-surface-elevated text-ink shadow-sm hover:bg-surface-muted",
|
|
774
|
-
|
|
848
|
+
// Stitch's white button: lifted by shadow, no border.
|
|
849
|
+
raised: "bg-surface-elevated text-ink shadow-sm hover:bg-surface-container",
|
|
850
|
+
subtle: "bg-surface-subtle text-on-surface hover:bg-surface-container",
|
|
851
|
+
// Secondary action on a dark surface.
|
|
852
|
+
slate: "bg-brand-slate text-white hover:bg-surface-tint",
|
|
775
853
|
ghost: "bg-transparent text-on-surface hover:bg-surface-muted",
|
|
776
854
|
danger: "bg-danger text-white shadow-sm hover:bg-danger-hover",
|
|
777
855
|
brand: "bg-brand-cobalt text-white shadow-sm hover:bg-brand-cobalt-hover",
|
|
778
856
|
// Crimson call to action (not destructive): #DC2626 keeps white text at AA.
|
|
779
857
|
accent: "bg-brand-crimson-hover text-white shadow-sm hover:bg-danger"
|
|
780
858
|
};
|
|
781
|
-
var SIZE8 = { sm: "h-8 px-space-md", md: "h-10 px-space-lg", lg: "h-12 px-space-lg" };
|
|
859
|
+
var SIZE8 = { xs: "px-space-md py-space-xs", ms: "px-space-lg py-space-sm", sm: "h-8 px-space-md", md: "h-10 px-space-lg", lg: "h-12 px-space-lg" };
|
|
782
860
|
function Button({
|
|
783
861
|
as,
|
|
784
862
|
variant = "primary",
|
|
@@ -808,7 +886,7 @@ function Button({
|
|
|
808
886
|
className: cx(
|
|
809
887
|
"inline-flex max-w-full items-center justify-center gap-space-xs whitespace-nowrap rounded-lg font-button-text text-button-text transition-colors",
|
|
810
888
|
"disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
811
|
-
|
|
889
|
+
VARIANT5[variant],
|
|
812
890
|
SIZE8[size],
|
|
813
891
|
FOCUS_RING,
|
|
814
892
|
TOUCH,
|
|
@@ -825,13 +903,13 @@ function Button({
|
|
|
825
903
|
|
|
826
904
|
// src/components/IconButton.tsx
|
|
827
905
|
import { jsx as jsx29, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
828
|
-
var
|
|
906
|
+
var VARIANT6 = {
|
|
829
907
|
ghost: "text-on-surface-variant hover:bg-surface-muted hover:text-on-surface",
|
|
830
|
-
subtle: "bg-surface-subtle text-on-surface hover:bg-surface-
|
|
908
|
+
subtle: "bg-surface-subtle text-on-surface-variant hover:bg-surface-container hover:text-on-surface",
|
|
831
909
|
secondary: "border border-border-subtle bg-surface-elevated text-on-surface hover:bg-surface-muted",
|
|
832
910
|
primary: "bg-ink text-on-ink hover:bg-ink-hover"
|
|
833
911
|
};
|
|
834
|
-
var SIZE9 = { xs: "size-6", sm: "size-8", md: "size-10" };
|
|
912
|
+
var SIZE9 = { xs: "size-6", sm: "size-8", ms: "size-9", md: "size-10" };
|
|
835
913
|
function IconButton({ as, icon, label, variant = "ghost", size = "md", dot, badge, ...rest }) {
|
|
836
914
|
const C = as ?? "button";
|
|
837
915
|
const native = C === "button";
|
|
@@ -845,13 +923,13 @@ function IconButton({ as, icon, label, variant = "ghost", size = "md", dot, badg
|
|
|
845
923
|
title: label,
|
|
846
924
|
className: cx(
|
|
847
925
|
"relative inline-flex shrink-0 items-center justify-center rounded-lg transition-colors disabled:pointer-events-none disabled:opacity-50",
|
|
848
|
-
|
|
926
|
+
VARIANT6[variant],
|
|
849
927
|
SIZE9[size],
|
|
850
928
|
FOCUS_RING,
|
|
851
929
|
TOUCH_ICON
|
|
852
930
|
),
|
|
853
931
|
children: [
|
|
854
|
-
/* @__PURE__ */ jsx29(Icon, { name: icon, size: size === "md" ? "md" : "sm" }),
|
|
932
|
+
/* @__PURE__ */ jsx29(Icon, { name: icon, size: size === "md" ? "md" : size === "ms" ? "ms" : "sm" }),
|
|
855
933
|
dot && /* @__PURE__ */ jsx29("span", { "aria-hidden": "true", className: cx("absolute right-1.5 top-1.5 size-2 rounded-full ring-2 ring-surface-elevated", DOT_TONE[dot]) }),
|
|
856
934
|
badge && /* @__PURE__ */ jsx29("span", { "aria-hidden": "true", className: "absolute -right-1 -top-1 min-w-4 rounded-full bg-brand-crimson-hover px-1 text-center font-label-mono text-[10px] leading-4 text-white", children: badge })
|
|
857
935
|
]
|
|
@@ -861,21 +939,32 @@ function IconButton({ as, icon, label, variant = "ghost", size = "md", dot, badg
|
|
|
861
939
|
|
|
862
940
|
// src/components/Kbd.tsx
|
|
863
941
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
864
|
-
|
|
865
|
-
|
|
942
|
+
var VARIANT7 = {
|
|
943
|
+
outline: "rounded border border-border-subtle bg-surface-subtle",
|
|
944
|
+
// Lifted keycap for filled fields (the header search).
|
|
945
|
+
raised: "rounded bg-surface-elevated shadow-sm"
|
|
946
|
+
};
|
|
947
|
+
function Kbd({ variant = "outline", children, ...rest }) {
|
|
948
|
+
return /* @__PURE__ */ jsx30("kbd", { ...rest, className: cx("inline-flex items-center px-space-xs font-label-mono text-[11px] leading-5 text-on-surface-variant", VARIANT7[variant]), children });
|
|
866
949
|
}
|
|
867
950
|
|
|
868
951
|
// src/components/TextField.tsx
|
|
869
952
|
import { useId as useId2, useState } from "react";
|
|
870
953
|
import { jsx as jsx31, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
871
|
-
var SIZE10 = { sm: "h-8", md: "h-10" };
|
|
872
|
-
var
|
|
873
|
-
|
|
954
|
+
var SIZE10 = { sm: "h-8 px-space-sm", ms: "h-9 px-space-sm", md: "h-10 px-space-sm", lg: "h-11 px-space-md" };
|
|
955
|
+
var TEXT2 = { sm: "font-body-sm text-body-sm", ms: "font-body-sm text-body-sm", md: "font-body-md text-body-md", lg: "font-body-sm text-body-sm" };
|
|
956
|
+
var WIDTH = { auto: "", full: "w-full", sm: "w-64", md: "w-80", lg: "w-full max-w-xl" };
|
|
957
|
+
var VARIANT8 = {
|
|
958
|
+
outline: "border bg-surface-subtle focus-within:ring-2",
|
|
959
|
+
filled: "bg-surface-subtle hover:bg-surface-container/40 focus-within:ring-1",
|
|
960
|
+
raised: "bg-surface-elevated shadow-sm focus-within:ring-2"
|
|
961
|
+
};
|
|
962
|
+
function TextField({ label, hideLabel, icon, hint, error, labelEnd, revealable, size = "md", variant = "outline", iconPosition = "start", width = "auto", id, type, ...rest }) {
|
|
874
963
|
const generated = useId2();
|
|
875
964
|
const inputId = id ?? generated;
|
|
876
965
|
const errorId = `${inputId}-error`;
|
|
877
966
|
const [shown, setShown] = useState(false);
|
|
878
|
-
return /* @__PURE__ */ jsxs16("div", { className: "flex min-w-0 flex-col gap-space-2xs", children: [
|
|
967
|
+
return /* @__PURE__ */ jsxs16("div", { className: cx("flex min-w-0 flex-col gap-space-2xs", WIDTH[width]), children: [
|
|
879
968
|
/* @__PURE__ */ jsxs16("div", { className: cx("flex min-w-0 items-center justify-between gap-space-sm", hideLabel && !labelEnd && "sr-only"), children: [
|
|
880
969
|
/* @__PURE__ */ jsx31("label", { htmlFor: inputId, className: cx("font-body-sm text-body-sm font-medium text-on-surface", hideLabel && "sr-only"), children: label }),
|
|
881
970
|
labelEnd
|
|
@@ -884,13 +973,14 @@ function TextField({ label, hideLabel, icon, hint, error, labelEnd, revealable,
|
|
|
884
973
|
"div",
|
|
885
974
|
{
|
|
886
975
|
className: cx(
|
|
887
|
-
"flex min-w-0 items-center gap-space-xs rounded-lg
|
|
976
|
+
"flex min-w-0 items-center gap-space-xs rounded-lg focus-within:ring-brand-cobalt",
|
|
977
|
+
VARIANT8[variant],
|
|
888
978
|
SIZE10[size],
|
|
889
|
-
error ? "border-fg-danger" : "border-border-subtle",
|
|
979
|
+
error ? "border border-fg-danger" : variant === "outline" && "border-border-subtle",
|
|
890
980
|
TOUCH
|
|
891
981
|
),
|
|
892
982
|
children: [
|
|
893
|
-
icon && /* @__PURE__ */ jsx31(Icon, { name: icon, size: "sm", tone: "muted" }),
|
|
983
|
+
icon && iconPosition === "start" && /* @__PURE__ */ jsx31(Icon, { name: icon, size: size === "lg" ? "md" : "sm", tone: "muted" }),
|
|
894
984
|
/* @__PURE__ */ jsx31(
|
|
895
985
|
"input",
|
|
896
986
|
{
|
|
@@ -899,11 +989,12 @@ function TextField({ label, hideLabel, icon, hint, error, labelEnd, revealable,
|
|
|
899
989
|
type: revealable ? shown ? "text" : "password" : type,
|
|
900
990
|
"aria-invalid": error ? true : rest["aria-invalid"],
|
|
901
991
|
"aria-describedby": cx(rest["aria-describedby"], error && errorId) || void 0,
|
|
902
|
-
className: cx("h-full min-w-0 flex-1 bg-transparent text-on-surface outline-none placeholder:text-on-surface-variant",
|
|
992
|
+
className: cx("h-full min-w-0 flex-1 bg-transparent text-on-surface outline-none placeholder:text-on-surface-variant", TEXT2[size])
|
|
903
993
|
}
|
|
904
994
|
),
|
|
905
995
|
hint && /* @__PURE__ */ jsx31("span", { className: "shrink-0", children: hint }),
|
|
906
|
-
revealable && /* @__PURE__ */ jsx31(IconButton, { icon: shown ? "visibility_off" : "visibility", label: "Show password", "aria-pressed": shown, size: "xs", onClick: () => setShown((s) => !s) })
|
|
996
|
+
revealable && /* @__PURE__ */ jsx31(IconButton, { icon: shown ? "visibility_off" : "visibility", label: "Show password", "aria-pressed": shown, size: "xs", onClick: () => setShown((s) => !s) }),
|
|
997
|
+
icon && iconPosition === "end" && /* @__PURE__ */ jsx31(Icon, { name: icon, size: "sm", tone: "muted" })
|
|
907
998
|
]
|
|
908
999
|
}
|
|
909
1000
|
),
|
|
@@ -914,7 +1005,9 @@ function TextField({ label, hideLabel, icon, hint, error, labelEnd, revealable,
|
|
|
914
1005
|
// src/components/Select.tsx
|
|
915
1006
|
import { useId as useId3 } from "react";
|
|
916
1007
|
import { jsx as jsx32, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
917
|
-
|
|
1008
|
+
var VARIANT9 = { outline: "border border-border-subtle bg-surface-subtle", raised: "bg-surface-elevated shadow-sm" };
|
|
1009
|
+
var SIZE11 = { md: "h-10 pl-space-sm font-body-md text-body-md", lg: "h-11 pl-space-md font-body-sm text-body-sm" };
|
|
1010
|
+
function Select({ label, hideLabel, options, variant = "outline", size = "md", id, ...rest }) {
|
|
918
1011
|
const generated = useId3();
|
|
919
1012
|
const selectId = id ?? generated;
|
|
920
1013
|
return /* @__PURE__ */ jsxs17("div", { className: "flex min-w-0 flex-col gap-space-2xs", children: [
|
|
@@ -925,7 +1018,7 @@ function Select({ label, hideLabel, options, id, ...rest }) {
|
|
|
925
1018
|
{
|
|
926
1019
|
...rest,
|
|
927
1020
|
id: selectId,
|
|
928
|
-
className: cx("
|
|
1021
|
+
className: cx("w-full min-w-0 appearance-none rounded-lg pr-space-xl text-on-surface", VARIANT9[variant], SIZE11[size], FOCUS_RING, TOUCH),
|
|
929
1022
|
children: options.map((o) => /* @__PURE__ */ jsx32("option", { value: o.value, children: o.label }, o.value))
|
|
930
1023
|
}
|
|
931
1024
|
),
|
|
@@ -957,7 +1050,8 @@ function rovingIndex(key, index, count) {
|
|
|
957
1050
|
|
|
958
1051
|
// src/components/Tabs.tsx
|
|
959
1052
|
import { Fragment as Fragment2, jsx as jsx33, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
960
|
-
var
|
|
1053
|
+
var HIDE_BELOW = { sm: "hidden sm:flex", md: "hidden md:flex", lg: "hidden lg:flex", xl: "hidden xl:flex", "2xl": "hidden 2xl:flex" };
|
|
1054
|
+
var VARIANT10 = {
|
|
961
1055
|
underline: {
|
|
962
1056
|
list: "flex min-w-0 max-w-full gap-space-lg overflow-x-auto border-b border-border-subtle [scrollbar-width:none]",
|
|
963
1057
|
tab: "inline-flex shrink-0 items-center gap-space-xs whitespace-nowrap border-b-2 py-space-sm font-button-text text-button-text transition-colors",
|
|
@@ -969,26 +1063,58 @@ var VARIANT6 = {
|
|
|
969
1063
|
tab: "inline-flex shrink-0 items-center gap-space-xs whitespace-nowrap rounded-md px-space-md py-space-xs font-button-text text-button-text transition-colors",
|
|
970
1064
|
active: "bg-surface-elevated text-ink shadow-sm",
|
|
971
1065
|
idle: "text-on-surface-variant hover:text-on-surface"
|
|
1066
|
+
},
|
|
1067
|
+
// Header navigation: icon + label + count pill; active is a cobalt tint.
|
|
1068
|
+
nav: {
|
|
1069
|
+
list: "flex min-w-0 max-w-full items-center gap-space-xs overflow-x-auto [scrollbar-width:none]",
|
|
1070
|
+
// One weight for every item: a bolder active item would widen and shift its neighbours.
|
|
1071
|
+
tab: "inline-flex shrink-0 items-center gap-space-xs whitespace-nowrap rounded-lg px-space-sm py-space-xs font-body-md text-body-md font-medium transition-colors",
|
|
1072
|
+
active: "bg-surface-container/60 text-brand-cobalt",
|
|
1073
|
+
idle: "text-on-surface-variant hover:bg-surface-subtle hover:text-on-surface"
|
|
1074
|
+
},
|
|
1075
|
+
// Filter chips: separate buttons, active filled with ink, dot leading.
|
|
1076
|
+
solid: {
|
|
1077
|
+
list: "flex min-w-0 max-w-full gap-space-xs overflow-x-auto pb-space-2xs [scrollbar-width:none]",
|
|
1078
|
+
tab: "inline-flex shrink-0 items-center gap-space-xs whitespace-nowrap rounded-lg px-space-md py-space-xs font-button-text text-button-text transition-colors",
|
|
1079
|
+
active: "bg-ink text-on-ink shadow-sm",
|
|
1080
|
+
idle: "bg-surface-subtle text-on-surface-variant hover:bg-surface-container hover:text-on-surface"
|
|
1081
|
+
},
|
|
1082
|
+
// Workspace tabs: mono caps, cobalt underline on the active tab, no rule under the list.
|
|
1083
|
+
label: {
|
|
1084
|
+
list: "flex min-w-0 max-w-full gap-space-md overflow-x-auto [scrollbar-width:none]",
|
|
1085
|
+
tab: "inline-flex shrink-0 items-center gap-space-xs whitespace-nowrap border-b-2 py-space-sm font-label-mono text-label-mono uppercase transition-colors",
|
|
1086
|
+
active: "border-brand-cobalt text-fg-brand",
|
|
1087
|
+
idle: "border-transparent text-on-surface-variant hover:text-on-surface"
|
|
972
1088
|
}
|
|
973
1089
|
};
|
|
974
|
-
|
|
1090
|
+
var DISABLED = "cursor-not-allowed opacity-60";
|
|
1091
|
+
function TabBody({ item, variant, active }) {
|
|
1092
|
+
const leadingDot = variant === "solid";
|
|
1093
|
+
let count = null;
|
|
1094
|
+
if (item.count !== void 0) {
|
|
1095
|
+
if (variant === "nav") count = /* @__PURE__ */ jsx33(Badge, { shape: "pill", tone: item.countTone ?? "info", children: item.count });
|
|
1096
|
+
else if (variant === "solid") count = /* @__PURE__ */ jsx33("span", { className: cx("rounded px-space-2xs font-label-mono text-label-mono", active ? "bg-white/20" : "bg-surface-elevated"), children: item.count });
|
|
1097
|
+
else count = /* @__PURE__ */ jsx33(Badge, { children: item.count });
|
|
1098
|
+
}
|
|
975
1099
|
return /* @__PURE__ */ jsxs18(Fragment2, { children: [
|
|
1100
|
+
item.dot && leadingDot && /* @__PURE__ */ jsx33(Dot, { tone: item.dot, size: "md" }),
|
|
1101
|
+
item.icon && /* @__PURE__ */ jsx33(Icon, { name: item.icon, size: "ms" }),
|
|
976
1102
|
item.label,
|
|
977
|
-
|
|
978
|
-
item.badge,
|
|
979
|
-
item.dot && /* @__PURE__ */ jsx33(Dot, { tone: item.dot })
|
|
1103
|
+
count,
|
|
1104
|
+
item.badge && (typeof item.badge === "string" ? /* @__PURE__ */ jsx33(Badge, { size: "xs", tone: "subtle", uppercase: true, children: item.badge }) : item.badge),
|
|
1105
|
+
item.dot && !leadingDot && /* @__PURE__ */ jsx33(Dot, { tone: item.dot })
|
|
980
1106
|
] });
|
|
981
1107
|
}
|
|
982
1108
|
function Tabs({ items, value, onChange, variant = "underline", label, ...rest }) {
|
|
983
1109
|
const baseId = useId4();
|
|
984
1110
|
const refs = useRef([]);
|
|
985
1111
|
if (!items.length) return null;
|
|
986
|
-
const v =
|
|
1112
|
+
const v = VARIANT10[variant];
|
|
987
1113
|
if (items.some((i) => i.href)) {
|
|
988
1114
|
return /* @__PURE__ */ jsx33("nav", { ...rest, "aria-label": label, className: "min-w-0 max-w-full", children: /* @__PURE__ */ jsx33("ul", { className: v.list, children: items.map((item) => {
|
|
989
1115
|
const C = item.as ?? "a";
|
|
990
1116
|
const active = item.id === value;
|
|
991
|
-
return /* @__PURE__ */ jsx33("li", { className: "
|
|
1117
|
+
return /* @__PURE__ */ jsx33("li", { className: cx("shrink-0", item.hideBelow ? HIDE_BELOW[item.hideBelow] : "flex"), children: item.disabled ? /* @__PURE__ */ jsx33("span", { "aria-disabled": "true", title: item.title, className: cx(v.tab, v.idle, DISABLED), children: /* @__PURE__ */ jsx33(TabBody, { item, variant, active: false }) }) : /* @__PURE__ */ jsx33(C, { href: item.href, title: item.title, "aria-current": active ? "page" : void 0, className: cx(v.tab, active ? v.active : v.idle, FOCUS_RING, TOUCH), children: /* @__PURE__ */ jsx33(TabBody, { item, variant, active }) }) }, item.id);
|
|
992
1118
|
}) }) });
|
|
993
1119
|
}
|
|
994
1120
|
const activeIndex = Math.max(0, items.findIndex((i) => i.id === value));
|
|
@@ -1013,10 +1139,12 @@ function Tabs({ items, value, onChange, variant = "underline", label, ...rest })
|
|
|
1013
1139
|
"aria-controls": item.panelId,
|
|
1014
1140
|
"aria-selected": active,
|
|
1015
1141
|
tabIndex: active ? 0 : -1,
|
|
1142
|
+
disabled: item.disabled,
|
|
1143
|
+
title: item.title,
|
|
1016
1144
|
onClick: () => onChange?.(item.id),
|
|
1017
1145
|
onKeyDown: (e) => onKeyDown(e, i),
|
|
1018
|
-
className: cx(v.tab, active ? v.active : v.idle, FOCUS_RING, TOUCH),
|
|
1019
|
-
children: /* @__PURE__ */ jsx33(TabBody, { item })
|
|
1146
|
+
className: cx(v.tab, active ? v.active : v.idle, item.disabled && DISABLED, FOCUS_RING, TOUCH),
|
|
1147
|
+
children: /* @__PURE__ */ jsx33(TabBody, { item, variant, active })
|
|
1020
1148
|
},
|
|
1021
1149
|
item.id
|
|
1022
1150
|
);
|
|
@@ -1029,7 +1157,17 @@ function TabPanel({ id, active, children, ...rest }) {
|
|
|
1029
1157
|
// src/components/SegmentedControl.tsx
|
|
1030
1158
|
import { useRef as useRef2 } from "react";
|
|
1031
1159
|
import { jsx as jsx34, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1032
|
-
|
|
1160
|
+
var TRACK = {
|
|
1161
|
+
default: "rounded-lg border border-border-subtle bg-surface-subtle p-space-2xs",
|
|
1162
|
+
// Compact mono switcher for toolbars (the IDE header).
|
|
1163
|
+
label: ""
|
|
1164
|
+
};
|
|
1165
|
+
var OPTION = {
|
|
1166
|
+
default: { base: "rounded-md py-space-xs font-button-text text-button-text", on: "bg-surface-elevated text-ink shadow-sm", off: "text-on-surface-variant hover:text-on-surface" },
|
|
1167
|
+
label: { base: "rounded px-space-xs py-space-2xs font-label-mono text-label-mono", on: "bg-surface-subtle text-fg-brand", off: "text-on-surface-variant hover:text-ink" }
|
|
1168
|
+
};
|
|
1169
|
+
function SegmentedControl({ label, options, value, onChange, variant = "default", ...rest }) {
|
|
1170
|
+
const opt = OPTION[variant];
|
|
1033
1171
|
const refs = useRef2([]);
|
|
1034
1172
|
const checkedIndex = options.findIndex((o) => o.value === value);
|
|
1035
1173
|
const tabbable = checkedIndex === -1 ? 0 : checkedIndex;
|
|
@@ -1040,7 +1178,7 @@ function SegmentedControl({ label, options, value, onChange, ...rest }) {
|
|
|
1040
1178
|
refs.current[next]?.focus();
|
|
1041
1179
|
onChange(options[next].value);
|
|
1042
1180
|
};
|
|
1043
|
-
return /* @__PURE__ */ jsx34("div", { ...rest, role: "radiogroup", "aria-label": label, className: "inline-flex min-w-0 max-w-full gap-space-2xs overflow-x-auto
|
|
1181
|
+
return /* @__PURE__ */ jsx34("div", { ...rest, role: "radiogroup", "aria-label": label, className: cx("inline-flex min-w-0 max-w-full gap-space-2xs overflow-x-auto [scrollbar-width:none]", TRACK[variant]), children: options.map((o, i) => {
|
|
1044
1182
|
const checked = i === checkedIndex;
|
|
1045
1183
|
return /* @__PURE__ */ jsxs19(
|
|
1046
1184
|
"button",
|
|
@@ -1057,9 +1195,10 @@ function SegmentedControl({ label, options, value, onChange, ...rest }) {
|
|
|
1057
1195
|
onClick: () => onChange(o.value),
|
|
1058
1196
|
onKeyDown: (e) => onKeyDown(e, i),
|
|
1059
1197
|
className: cx(
|
|
1060
|
-
"inline-flex shrink-0 items-center justify-center gap-space-xs whitespace-nowrap
|
|
1061
|
-
|
|
1062
|
-
|
|
1198
|
+
"inline-flex shrink-0 items-center justify-center gap-space-xs whitespace-nowrap transition-colors",
|
|
1199
|
+
opt.base,
|
|
1200
|
+
variant === "default" && (o.hideLabel ? "px-space-xs" : "px-space-sm"),
|
|
1201
|
+
checked ? opt.on : opt.off,
|
|
1063
1202
|
FOCUS_RING,
|
|
1064
1203
|
o.hideLabel ? TOUCH_ICON : TOUCH
|
|
1065
1204
|
),
|
|
@@ -1148,7 +1287,7 @@ function useModal({ open, onClose, panelRef, initialFocusRef }) {
|
|
|
1148
1287
|
|
|
1149
1288
|
// src/components/Dialog.tsx
|
|
1150
1289
|
import { jsx as jsx35, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1151
|
-
var
|
|
1290
|
+
var SIZE12 = { sm: "max-w-sm", md: "max-w-md", lg: "max-w-2xl" };
|
|
1152
1291
|
function Dialog({ open, onClose, title, description, footer, size = "md", children, ...rest }) {
|
|
1153
1292
|
const titleId = useId5();
|
|
1154
1293
|
const descId = useId5();
|
|
@@ -1176,7 +1315,7 @@ function Dialog({ open, onClose, title, description, footer, size = "md", childr
|
|
|
1176
1315
|
"aria-labelledby": titleId,
|
|
1177
1316
|
"aria-describedby": description ? descId : void 0,
|
|
1178
1317
|
tabIndex: -1,
|
|
1179
|
-
className: cx("relative flex max-h-[calc(100dvh-2rem)] w-full min-w-0 flex-col gap-space-md overflow-y-auto rounded-xl bg-surface-elevated p-space-lg text-on-surface shadow-md outline-none",
|
|
1318
|
+
className: cx("relative flex max-h-[calc(100dvh-2rem)] w-full min-w-0 flex-col gap-space-md overflow-y-auto rounded-xl bg-surface-elevated p-space-lg text-on-surface shadow-md outline-none", SIZE12[size]),
|
|
1180
1319
|
children: [
|
|
1181
1320
|
/* @__PURE__ */ jsxs20("div", { className: "min-w-0 pr-space-xl", children: [
|
|
1182
1321
|
/* @__PURE__ */ jsx35("h2", { id: titleId, className: "font-display text-headline-md text-ink wrap-break-word", children: title }),
|
|
@@ -1343,8 +1482,13 @@ function StatusItem({ icon, tone = "default", children, ...rest }) {
|
|
|
1343
1482
|
children
|
|
1344
1483
|
] });
|
|
1345
1484
|
}
|
|
1346
|
-
|
|
1347
|
-
|
|
1485
|
+
var BAR = {
|
|
1486
|
+
default: "h-7 border-t border-border-subtle bg-surface-subtle",
|
|
1487
|
+
// Filled strip without a rule (dark IDE card footer).
|
|
1488
|
+
raised: "h-9 bg-surface-container"
|
|
1489
|
+
};
|
|
1490
|
+
function StatusBarRoot({ start, end, label = "Status", tone = "default", ...rest }) {
|
|
1491
|
+
return /* @__PURE__ */ jsxs23("footer", { ...rest, "aria-label": label, className: cx("flex min-w-0 shrink-0 items-center justify-between gap-space-md overflow-hidden px-space-sm font-label-mono text-[11px] text-on-surface-variant", BAR[tone]), children: [
|
|
1348
1492
|
/* @__PURE__ */ jsx38("div", { className: "flex min-w-0 items-center gap-space-md overflow-hidden", children: start }),
|
|
1349
1493
|
/* @__PURE__ */ jsx38("div", { className: "flex min-w-0 items-center gap-space-md overflow-hidden", children: end })
|
|
1350
1494
|
] });
|
|
@@ -1354,8 +1498,14 @@ var StatusBar = Object.assign(StatusBarRoot, { Item: StatusItem });
|
|
|
1354
1498
|
// src/ide/MetricTile.tsx
|
|
1355
1499
|
import { jsx as jsx39, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
1356
1500
|
var TONE11 = { success: "text-fg-success", danger: "text-fg-danger", warning: "text-fg-warning", brand: "text-fg-brand", neutral: "text-ink" };
|
|
1357
|
-
function MetricTile({ label, value, tone = "neutral", icon, hint, hintTone = "muted", ...rest }) {
|
|
1358
|
-
|
|
1501
|
+
function MetricTile({ label, value, tone = "neutral", icon, hint, hintTone = "muted", variant = "default", ...rest }) {
|
|
1502
|
+
if (variant === "centered") {
|
|
1503
|
+
return /* @__PURE__ */ jsxs24("div", { ...rest, className: "flex min-w-0 flex-col items-center rounded-lg bg-surface-subtle p-space-sm text-center", children: [
|
|
1504
|
+
/* @__PURE__ */ jsx39("span", { className: cx("truncate font-display text-headline-lg", TONE11[tone]), children: value }),
|
|
1505
|
+
/* @__PURE__ */ jsx39("span", { className: "truncate font-body-sm text-body-sm text-on-surface-variant", children: label })
|
|
1506
|
+
] });
|
|
1507
|
+
}
|
|
1508
|
+
return /* @__PURE__ */ jsxs24("div", { ...rest, className: "flex min-w-0 flex-col gap-space-2xs rounded-lg bg-surface-subtle p-space-sm", children: [
|
|
1359
1509
|
/* @__PURE__ */ jsxs24("span", { className: "flex min-w-0 items-center gap-space-2xs font-label-mono text-label-mono uppercase text-on-surface-variant", children: [
|
|
1360
1510
|
icon && /* @__PURE__ */ jsx39(Icon, { name: icon, size: "sm" }),
|
|
1361
1511
|
/* @__PURE__ */ jsx39("span", { className: "truncate", children: label })
|
|
@@ -1368,8 +1518,8 @@ function MetricTile({ label, value, tone = "neutral", icon, hint, hintTone = "mu
|
|
|
1368
1518
|
// src/ide/Avatar.tsx
|
|
1369
1519
|
import { useState as useState3 } from "react";
|
|
1370
1520
|
import { jsx as jsx40, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
1371
|
-
var AVATAR_SIZE = { sm: "size-7 text-[11px]", md: "size-9 text-xs", lg: "size-12 text-sm" };
|
|
1372
|
-
var
|
|
1521
|
+
var AVATAR_SIZE = { sm: "size-7 text-[11px]", ms: "size-8 text-xs", md: "size-9 text-xs", ml: "size-10 text-sm", lg: "size-12 text-sm" };
|
|
1522
|
+
var SHAPE3 = { circle: "rounded-full", square: "rounded-lg" };
|
|
1373
1523
|
var TONE12 = {
|
|
1374
1524
|
ink: "bg-ink text-on-ink",
|
|
1375
1525
|
brand: "bg-brand-cobalt text-white",
|
|
@@ -1384,7 +1534,7 @@ function Avatar({ name, src, size = "md", shape = "circle", tone = "ink", badge,
|
|
|
1384
1534
|
const [failedSrc, setFailedSrc] = useState3(void 0);
|
|
1385
1535
|
const accessibleName = statusLabel ? `${name}, ${statusLabel}` : name;
|
|
1386
1536
|
return /* @__PURE__ */ jsxs25("span", { ...rest, className: "relative inline-flex shrink-0", children: [
|
|
1387
|
-
src && failedSrc !== src ? /* @__PURE__ */ jsx40("img", { src, alt: accessibleName, onError: () => setFailedSrc(src), className: cx("object-cover",
|
|
1537
|
+
src && failedSrc !== src ? /* @__PURE__ */ jsx40("img", { src, alt: accessibleName, onError: () => setFailedSrc(src), className: cx("object-cover", SHAPE3[shape], AVATAR_SIZE[size]) }) : /* @__PURE__ */ jsx40("span", { role: "img", "aria-label": accessibleName, className: cx("inline-flex items-center justify-center font-label-mono", SHAPE3[shape], TONE12[tone], AVATAR_SIZE[size]), children: initials(name) }),
|
|
1388
1538
|
status && /* @__PURE__ */ jsx40("span", { "aria-hidden": "true", className: cx("absolute bottom-0 right-0 size-2.5 rounded-full ring-2 ring-surface-elevated", DOT_TONE[status]) }),
|
|
1389
1539
|
badge && /* @__PURE__ */ jsx40("span", { className: "absolute -bottom-1 -right-1 rounded-full border-2 border-surface-elevated bg-brand-cobalt px-1 font-label-mono text-[10px] leading-4 text-white", children: badge })
|
|
1390
1540
|
] });
|
|
@@ -1456,7 +1606,7 @@ function formatClock(totalSeconds) {
|
|
|
1456
1606
|
const m = Math.floor(s % 3600 / 60);
|
|
1457
1607
|
return h > 0 ? `${h}:${pad(m)}:${pad(s % 60)}` : `${pad(m)}:${pad(s % 60)}`;
|
|
1458
1608
|
}
|
|
1459
|
-
function Countdown({ seconds, until, direction = "down", warnAt, onExpire, label = "Time remaining", ...rest }) {
|
|
1609
|
+
function Countdown({ seconds, until, direction = "down", warnAt, onExpire, label = "Time remaining", variant = "plain", ...rest }) {
|
|
1460
1610
|
const [start] = useState4(() => Date.now());
|
|
1461
1611
|
const [now, setNow] = useState4(() => until ? null : start);
|
|
1462
1612
|
const onExpireRef = useRef6(onExpire);
|
|
@@ -1484,10 +1634,23 @@ function Countdown({ seconds, until, direction = "down", warnAt, onExpire, label
|
|
|
1484
1634
|
}
|
|
1485
1635
|
}, [expired]);
|
|
1486
1636
|
const warn = direction === "down" && warnAt !== void 0 && value !== null && value <= warnAt;
|
|
1487
|
-
return /* @__PURE__ */ jsxs27(
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1637
|
+
return /* @__PURE__ */ jsxs27(
|
|
1638
|
+
"span",
|
|
1639
|
+
{
|
|
1640
|
+
...rest,
|
|
1641
|
+
role: "timer",
|
|
1642
|
+
"aria-label": label,
|
|
1643
|
+
className: cx(
|
|
1644
|
+
"inline-flex items-center gap-space-2xs tabular-nums",
|
|
1645
|
+
variant === "chip" ? "rounded bg-surface-subtle px-space-sm py-space-xs font-label-mono text-label-mono" : "font-code-inline text-code-inline",
|
|
1646
|
+
warn ? "text-fg-danger" : "text-on-surface"
|
|
1647
|
+
),
|
|
1648
|
+
children: [
|
|
1649
|
+
/* @__PURE__ */ jsx42("span", { className: variant === "chip" ? "text-fg-brand" : void 0, children: /* @__PURE__ */ jsx42(Icon, { name: "timer", size: "sm", tone: "inherit" }) }),
|
|
1650
|
+
value === null ? "--:--" : formatClock(value)
|
|
1651
|
+
]
|
|
1652
|
+
}
|
|
1653
|
+
);
|
|
1491
1654
|
}
|
|
1492
1655
|
|
|
1493
1656
|
// src/ide/FileTree.tsx
|
|
@@ -1900,7 +2063,7 @@ import { useId as useId9, useRef as useRef9 } from "react";
|
|
|
1900
2063
|
import { createPortal as createPortal2 } from "react-dom";
|
|
1901
2064
|
import { jsx as jsx45, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
1902
2065
|
var SIDE = { left: "left-0 border-r", right: "right-0 border-l" };
|
|
1903
|
-
var
|
|
2066
|
+
var SIZE13 = { sm: "w-[min(85vw,20rem)]", md: "w-[min(90vw,28rem)]" };
|
|
1904
2067
|
function Drawer({ open, onClose, title, side = "left", size = "sm", children, ...rest }) {
|
|
1905
2068
|
const titleId = useId9();
|
|
1906
2069
|
const panelRef = useRef9(null);
|
|
@@ -1926,7 +2089,7 @@ function Drawer({ open, onClose, title, side = "left", size = "sm", children, ..
|
|
|
1926
2089
|
"aria-modal": "true",
|
|
1927
2090
|
"aria-labelledby": titleId,
|
|
1928
2091
|
tabIndex: -1,
|
|
1929
|
-
className: cx("fixed inset-y-0 flex flex-col border-border-subtle bg-surface-elevated text-on-surface shadow-md outline-none", SIDE[side],
|
|
2092
|
+
className: cx("fixed inset-y-0 flex flex-col border-border-subtle bg-surface-elevated text-on-surface shadow-md outline-none", SIDE[side], SIZE13[size]),
|
|
1930
2093
|
children: [
|
|
1931
2094
|
/* @__PURE__ */ jsxs30("div", { className: "flex min-w-0 items-center justify-between gap-space-sm border-b border-border-subtle px-space-md py-space-sm", children: [
|
|
1932
2095
|
/* @__PURE__ */ jsx45("h2", { id: titleId, className: "min-w-0 truncate font-display text-headline-sm text-ink", children: title }),
|
|
@@ -1942,8 +2105,36 @@ function Drawer({ open, onClose, title, side = "left", size = "sm", children, ..
|
|
|
1942
2105
|
);
|
|
1943
2106
|
}
|
|
1944
2107
|
|
|
2108
|
+
// src/components/FullScreen.tsx
|
|
2109
|
+
import { useRef as useRef10 } from "react";
|
|
2110
|
+
import { createPortal as createPortal3 } from "react-dom";
|
|
2111
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
2112
|
+
function FullScreen({ open, onClose, label, initialFocusRef, children, ...rest }) {
|
|
2113
|
+
const panelRef = useRef10(null);
|
|
2114
|
+
const theme = useThemeTone();
|
|
2115
|
+
useModal({ open, onClose, panelRef, initialFocusRef });
|
|
2116
|
+
if (!open || typeof document === "undefined") return null;
|
|
2117
|
+
return createPortal3(
|
|
2118
|
+
/* @__PURE__ */ jsx46(
|
|
2119
|
+
"div",
|
|
2120
|
+
{
|
|
2121
|
+
...rest,
|
|
2122
|
+
ref: panelRef,
|
|
2123
|
+
role: "dialog",
|
|
2124
|
+
"aria-modal": "true",
|
|
2125
|
+
"aria-label": label,
|
|
2126
|
+
tabIndex: -1,
|
|
2127
|
+
"data-theme": theme,
|
|
2128
|
+
className: "fixed inset-0 z-50 flex min-w-0 flex-col bg-surface text-on-surface outline-none",
|
|
2129
|
+
children
|
|
2130
|
+
}
|
|
2131
|
+
),
|
|
2132
|
+
document.body
|
|
2133
|
+
);
|
|
2134
|
+
}
|
|
2135
|
+
|
|
1945
2136
|
// src/components/TextLink.tsx
|
|
1946
|
-
import { jsx as
|
|
2137
|
+
import { jsx as jsx47, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
1947
2138
|
var TONE13 = {
|
|
1948
2139
|
brand: "text-fg-brand hover:text-fg-brand-hover",
|
|
1949
2140
|
default: "text-on-surface hover:text-ink",
|
|
@@ -1952,7 +2143,7 @@ var TONE13 = {
|
|
|
1952
2143
|
success: "text-fg-success",
|
|
1953
2144
|
warning: "text-fg-warning"
|
|
1954
2145
|
};
|
|
1955
|
-
var
|
|
2146
|
+
var SIZE14 = { sm: "font-body-sm text-body-sm", md: "font-body-md text-body-md" };
|
|
1956
2147
|
var UNDERLINE = { hover: "underline-offset-2 hover:underline", always: "underline underline-offset-2", none: "" };
|
|
1957
2148
|
function TextLink({ as, tone = "brand", size = "md", icon, iconRight, underline = "hover", children, ...rest }) {
|
|
1958
2149
|
const C = as ?? "a";
|
|
@@ -1960,18 +2151,18 @@ function TextLink({ as, tone = "brand", size = "md", icon, iconRight, underline
|
|
|
1960
2151
|
C,
|
|
1961
2152
|
{
|
|
1962
2153
|
...rest,
|
|
1963
|
-
className: cx("inline-flex max-w-full items-center gap-space-2xs rounded font-medium wrap-break-word transition-colors", TONE13[tone],
|
|
2154
|
+
className: cx("inline-flex max-w-full items-center gap-space-2xs rounded font-medium wrap-break-word transition-colors", TONE13[tone], SIZE14[size], UNDERLINE[underline], FOCUS_RING),
|
|
1964
2155
|
children: [
|
|
1965
|
-
icon && /* @__PURE__ */
|
|
1966
|
-
/* @__PURE__ */
|
|
1967
|
-
iconRight && /* @__PURE__ */
|
|
2156
|
+
icon && /* @__PURE__ */ jsx47(Icon, { name: icon, size: "sm" }),
|
|
2157
|
+
/* @__PURE__ */ jsx47("span", { className: "min-w-0", children }),
|
|
2158
|
+
iconRight && /* @__PURE__ */ jsx47(Icon, { name: iconRight, size: "sm" })
|
|
1968
2159
|
]
|
|
1969
2160
|
}
|
|
1970
2161
|
);
|
|
1971
2162
|
}
|
|
1972
2163
|
|
|
1973
2164
|
// src/components/Divider.tsx
|
|
1974
|
-
import { jsx as
|
|
2165
|
+
import { jsx as jsx48, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
1975
2166
|
var SPACE_Y = {
|
|
1976
2167
|
none: "",
|
|
1977
2168
|
"2xs": "my-space-2xs",
|
|
@@ -1994,27 +2185,27 @@ var SPACE_X = {
|
|
|
1994
2185
|
};
|
|
1995
2186
|
function Divider({ orientation = "horizontal", label, spacing = "none", ...rest }) {
|
|
1996
2187
|
if (orientation === "vertical") {
|
|
1997
|
-
return /* @__PURE__ */
|
|
2188
|
+
return /* @__PURE__ */ jsx48("div", { ...rest, role: "separator", "aria-orientation": "vertical", className: cx("min-h-4 w-px shrink-0 self-stretch bg-border-subtle", SPACE_X[spacing]) });
|
|
1998
2189
|
}
|
|
1999
2190
|
if (label) {
|
|
2000
2191
|
return /* @__PURE__ */ jsxs32("div", { ...rest, role: "separator", "aria-orientation": "horizontal", className: cx("flex w-full min-w-0 items-center gap-space-sm", SPACE_Y[spacing]), children: [
|
|
2001
|
-
/* @__PURE__ */
|
|
2002
|
-
/* @__PURE__ */
|
|
2003
|
-
/* @__PURE__ */
|
|
2192
|
+
/* @__PURE__ */ jsx48("span", { className: "h-px flex-1 bg-border-subtle" }),
|
|
2193
|
+
/* @__PURE__ */ jsx48("span", { className: "shrink-0 font-label-mono text-label-mono uppercase text-on-surface-variant", children: label }),
|
|
2194
|
+
/* @__PURE__ */ jsx48("span", { className: "h-px flex-1 bg-border-subtle" })
|
|
2004
2195
|
] });
|
|
2005
2196
|
}
|
|
2006
|
-
return /* @__PURE__ */
|
|
2197
|
+
return /* @__PURE__ */ jsx48("div", { ...rest, role: "separator", "aria-orientation": "horizontal", className: cx("h-px w-full shrink-0 bg-border-subtle", SPACE_Y[spacing]) });
|
|
2007
2198
|
}
|
|
2008
2199
|
|
|
2009
2200
|
// src/ide/AvatarGroup.tsx
|
|
2010
2201
|
import { Children as Children2, cloneElement, isValidElement as isValidElement2 } from "react";
|
|
2011
|
-
import { jsx as
|
|
2202
|
+
import { jsx as jsx49, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
2012
2203
|
function AvatarGroup({ children, max, size = "md", label, ...rest }) {
|
|
2013
2204
|
const all = Children2.toArray(children);
|
|
2014
2205
|
const shown = max !== void 0 ? all.slice(0, Math.max(0, max)) : all;
|
|
2015
2206
|
const extra = all.length - shown.length;
|
|
2016
2207
|
return /* @__PURE__ */ jsxs33("div", { ...rest, role: "group", "aria-label": label, className: "flex items-center -space-x-2", children: [
|
|
2017
|
-
shown.map((child, i) => /* @__PURE__ */
|
|
2208
|
+
shown.map((child, i) => /* @__PURE__ */ jsx49("span", { className: "inline-flex rounded-full ring-2 ring-surface-elevated", children: isValidElement2(child) ? cloneElement(child, { size }) : child }, i)),
|
|
2018
2209
|
extra > 0 && /* @__PURE__ */ jsxs33("span", { className: cx("inline-flex items-center justify-center rounded-full bg-surface-muted font-label-mono text-on-surface-variant ring-2 ring-surface-elevated", AVATAR_SIZE[size]), children: [
|
|
2019
2210
|
"+",
|
|
2020
2211
|
extra
|
|
@@ -2023,20 +2214,21 @@ function AvatarGroup({ children, max, size = "md", label, ...rest }) {
|
|
|
2023
2214
|
}
|
|
2024
2215
|
|
|
2025
2216
|
// src/primitives/AppBar.tsx
|
|
2026
|
-
import { jsx as
|
|
2217
|
+
import { jsx as jsx50, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
2027
2218
|
var POSITION = { sticky: "sticky top-0", fixed: "fixed inset-x-0 top-0", static: "relative" };
|
|
2028
|
-
var
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
/* @__PURE__ */
|
|
2033
|
-
/* @__PURE__ */
|
|
2219
|
+
var HEIGHT3 = { sm: "h-12", md: "h-16" };
|
|
2220
|
+
var DIVIDER = { shadow: "shadow-appbar", border: "border-b border-border-subtle" };
|
|
2221
|
+
function AppBar({ position = "sticky", start, center, end, blur = true, height = "md", contained = true, divider = "shadow", ...rest }) {
|
|
2222
|
+
return /* @__PURE__ */ jsx50("header", { ...rest, className: cx("z-40 w-full min-w-0", DIVIDER[divider], POSITION[position], blur ? "bg-surface-elevated/95 backdrop-blur-md" : "bg-surface-elevated"), children: /* @__PURE__ */ jsxs34("div", { className: cx("flex min-w-0 items-center gap-space-md px-gutter-fluid", HEIGHT3[height], contained && "mx-auto max-w-7xl"), children: [
|
|
2223
|
+
/* @__PURE__ */ jsx50("div", { className: "flex min-w-0 shrink-0 items-center gap-space-sm", children: start }),
|
|
2224
|
+
/* @__PURE__ */ jsx50("div", { className: "flex min-w-0 flex-1 items-center justify-center", children: center }),
|
|
2225
|
+
/* @__PURE__ */ jsx50("div", { className: "flex shrink-0 items-center gap-space-xs", children: end })
|
|
2034
2226
|
] }) });
|
|
2035
2227
|
}
|
|
2036
2228
|
|
|
2037
2229
|
// src/components/NavList.tsx
|
|
2038
|
-
import { jsx as
|
|
2039
|
-
var
|
|
2230
|
+
import { jsx as jsx51, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
2231
|
+
var VARIANT11 = {
|
|
2040
2232
|
sidebar: {
|
|
2041
2233
|
item: "rounded-lg px-space-sm py-space-xs font-body-md text-body-md",
|
|
2042
2234
|
active: "bg-surface-container-high font-medium text-ink",
|
|
@@ -2049,13 +2241,13 @@ var VARIANT7 = {
|
|
|
2049
2241
|
}
|
|
2050
2242
|
};
|
|
2051
2243
|
function NavList({ label, items, current, heading, variant = "sidebar", ...rest }) {
|
|
2052
|
-
const v =
|
|
2244
|
+
const v = VARIANT11[variant];
|
|
2053
2245
|
return /* @__PURE__ */ jsxs35("nav", { ...rest, "aria-label": label, className: "min-w-0", children: [
|
|
2054
|
-
heading && /* @__PURE__ */
|
|
2055
|
-
/* @__PURE__ */
|
|
2246
|
+
heading && /* @__PURE__ */ jsx51("p", { className: "px-space-sm pb-space-xs font-label-mono text-label-mono uppercase text-on-surface-variant", children: heading }),
|
|
2247
|
+
/* @__PURE__ */ jsx51("ul", { className: "flex min-w-0 flex-col gap-space-2xs", children: items.map((item) => {
|
|
2056
2248
|
const active = item.id === current;
|
|
2057
2249
|
const C = item.href ? item.as ?? "a" : "button";
|
|
2058
|
-
return /* @__PURE__ */
|
|
2250
|
+
return /* @__PURE__ */ jsx51("li", { className: "min-w-0", children: /* @__PURE__ */ jsxs35(
|
|
2059
2251
|
C,
|
|
2060
2252
|
{
|
|
2061
2253
|
...item.href ? { href: item.href } : { type: "button" },
|
|
@@ -2063,9 +2255,9 @@ function NavList({ label, items, current, heading, variant = "sidebar", ...rest
|
|
|
2063
2255
|
onClick: item.onSelect,
|
|
2064
2256
|
className: cx("flex w-full min-w-0 items-center gap-space-sm text-left transition-colors", v.item, active ? v.active : v.idle, FOCUS_RING, TOUCH),
|
|
2065
2257
|
children: [
|
|
2066
|
-
item.icon && /* @__PURE__ */
|
|
2067
|
-
/* @__PURE__ */
|
|
2068
|
-
item.count !== void 0 && /* @__PURE__ */
|
|
2258
|
+
item.icon && /* @__PURE__ */ jsx51(Icon, { name: item.icon, size: "sm" }),
|
|
2259
|
+
/* @__PURE__ */ jsx51("span", { className: "min-w-0 flex-1 truncate", children: item.label }),
|
|
2260
|
+
item.count !== void 0 && /* @__PURE__ */ jsx51("span", { className: cx("shrink-0 font-label-mono text-label-mono", active ? "text-ink" : "text-on-surface-variant"), children: item.count })
|
|
2069
2261
|
]
|
|
2070
2262
|
}
|
|
2071
2263
|
) }, item.id);
|
|
@@ -2074,7 +2266,7 @@ function NavList({ label, items, current, heading, variant = "sidebar", ...rest
|
|
|
2074
2266
|
}
|
|
2075
2267
|
|
|
2076
2268
|
// src/components/Pagination.tsx
|
|
2077
|
-
import { jsx as
|
|
2269
|
+
import { jsx as jsx52, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
2078
2270
|
var range = (a, b) => Array.from({ length: Math.max(0, b - a + 1) }, (_, i) => a + i);
|
|
2079
2271
|
function pageRange(page, pageCount, siblingCount = 1) {
|
|
2080
2272
|
if (pageCount <= 0) return [];
|
|
@@ -2093,11 +2285,11 @@ function Pagination({ page, pageCount, onChange, siblingCount = 1, summary, labe
|
|
|
2093
2285
|
if (pageCount <= 1) return null;
|
|
2094
2286
|
const p = Math.min(Math.max(1, Math.trunc(page)), pageCount);
|
|
2095
2287
|
return /* @__PURE__ */ jsxs36("nav", { ...rest, "aria-label": label, className: "flex min-w-0 flex-wrap items-center justify-between gap-space-sm", children: [
|
|
2096
|
-
summary && /* @__PURE__ */
|
|
2288
|
+
summary && /* @__PURE__ */ jsx52("p", { className: "font-body-sm text-body-sm text-on-surface-variant", children: summary }),
|
|
2097
2289
|
/* @__PURE__ */ jsxs36("ul", { className: "flex items-center gap-space-2xs", children: [
|
|
2098
|
-
/* @__PURE__ */
|
|
2290
|
+
/* @__PURE__ */ jsx52("li", { children: /* @__PURE__ */ jsx52(IconButton, { icon: "chevron_left", label: "Previous page", variant: "secondary", size: "sm", disabled: p <= 1, onClick: () => onChange(p - 1) }) }),
|
|
2099
2291
|
pageRange(p, pageCount, siblingCount).map(
|
|
2100
|
-
(item, i) => item === "gap" ? /* @__PURE__ */
|
|
2292
|
+
(item, i) => item === "gap" ? /* @__PURE__ */ jsx52("li", { "aria-hidden": "true", className: "px-space-2xs text-on-surface-variant max-md:hidden", children: "\u2026" }, `gap-${i}`) : /* @__PURE__ */ jsx52("li", { className: item === p ? "" : "max-md:hidden", children: /* @__PURE__ */ jsx52(
|
|
2101
2293
|
"button",
|
|
2102
2294
|
{
|
|
2103
2295
|
type: "button",
|
|
@@ -2118,18 +2310,18 @@ function Pagination({ page, pageCount, onChange, siblingCount = 1, summary, labe
|
|
|
2118
2310
|
"/ ",
|
|
2119
2311
|
pageCount
|
|
2120
2312
|
] }),
|
|
2121
|
-
/* @__PURE__ */
|
|
2313
|
+
/* @__PURE__ */ jsx52("li", { children: /* @__PURE__ */ jsx52(IconButton, { icon: "chevron_right", label: "Next page", variant: "secondary", size: "sm", disabled: p >= pageCount, onClick: () => onChange(p + 1) }) })
|
|
2122
2314
|
] })
|
|
2123
2315
|
] });
|
|
2124
2316
|
}
|
|
2125
2317
|
|
|
2126
2318
|
// src/components/Table.tsx
|
|
2127
|
-
import { jsx as
|
|
2319
|
+
import { jsx as jsx53, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
2128
2320
|
var PAD = { compact: "px-space-sm py-space-xs", normal: "px-space-md py-space-sm" };
|
|
2129
2321
|
var ALIGN4 = { start: "text-start", end: "text-end" };
|
|
2130
|
-
var
|
|
2322
|
+
var WIDTH2 = { auto: "", min: "w-px whitespace-nowrap" };
|
|
2131
2323
|
function Table({ caption, showCaption, columns, rows, rowKey, density = "normal", empty, ...rest }) {
|
|
2132
|
-
return /* @__PURE__ */
|
|
2324
|
+
return /* @__PURE__ */ jsx53(
|
|
2133
2325
|
"div",
|
|
2134
2326
|
{
|
|
2135
2327
|
...rest,
|
|
@@ -2138,29 +2330,29 @@ function Table({ caption, showCaption, columns, rows, rowKey, density = "normal"
|
|
|
2138
2330
|
tabIndex: 0,
|
|
2139
2331
|
className: "min-w-0 max-w-full overflow-x-auto rounded-xl border border-border-subtle focus-visible:outline-2 focus-visible:outline-brand-cobalt",
|
|
2140
2332
|
children: /* @__PURE__ */ jsxs37("table", { className: "w-full border-collapse font-body-sm text-body-sm text-on-surface", children: [
|
|
2141
|
-
/* @__PURE__ */
|
|
2142
|
-
/* @__PURE__ */
|
|
2143
|
-
/* @__PURE__ */
|
|
2333
|
+
/* @__PURE__ */ jsx53("caption", { className: showCaption ? "caption-top px-space-md py-space-sm text-start font-label-mono text-label-mono uppercase text-on-surface-variant" : "sr-only", children: caption }),
|
|
2334
|
+
/* @__PURE__ */ jsx53("thead", { className: "bg-surface-subtle", children: /* @__PURE__ */ jsx53("tr", { children: columns.map((c) => /* @__PURE__ */ jsx53("th", { scope: "col", className: cx("border-b border-border-subtle font-label-mono text-label-mono uppercase text-on-surface-variant", PAD[density], ALIGN4[c.align ?? "start"], WIDTH2[c.width ?? "auto"]), children: c.header }, c.key)) }) }),
|
|
2335
|
+
/* @__PURE__ */ jsx53("tbody", { className: "divide-y divide-border-subtle", children: rows.length ? rows.map((row, i) => /* @__PURE__ */ jsx53("tr", { children: columns.map((c) => /* @__PURE__ */ jsx53("td", { className: cx("align-top wrap-break-word", PAD[density], ALIGN4[c.align ?? "start"], WIDTH2[c.width ?? "auto"], c.mono && "font-code-inline text-code-inline"), children: row[c.key] }, c.key)) }, rowKey ? rowKey(row, i) : i)) : /* @__PURE__ */ jsx53("tr", { children: /* @__PURE__ */ jsx53("td", { colSpan: columns.length, className: "px-space-md py-space-lg text-center text-on-surface-variant", children: empty ?? "No rows" }) }) })
|
|
2144
2336
|
] })
|
|
2145
2337
|
}
|
|
2146
2338
|
);
|
|
2147
2339
|
}
|
|
2148
2340
|
|
|
2149
2341
|
// src/components/DescriptionList.tsx
|
|
2150
|
-
import { jsx as
|
|
2342
|
+
import { jsx as jsx54, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
2151
2343
|
var LAYOUT = {
|
|
2152
2344
|
stacked: "flex flex-col gap-space-sm",
|
|
2153
2345
|
inline: "grid grid-cols-1 gap-x-space-md gap-y-space-xs sm:grid-cols-[minmax(0,auto)_minmax(0,1fr)]"
|
|
2154
2346
|
};
|
|
2155
2347
|
function DescriptionList({ items, layout = "stacked", mono, ...rest }) {
|
|
2156
|
-
return /* @__PURE__ */
|
|
2157
|
-
/* @__PURE__ */
|
|
2158
|
-
/* @__PURE__ */
|
|
2348
|
+
return /* @__PURE__ */ jsx54("dl", { ...rest, className: cx("min-w-0", LAYOUT[layout]), children: items.map((item, i) => /* @__PURE__ */ jsxs38("div", { className: cx("min-w-0", layout === "inline" && "sm:contents"), children: [
|
|
2349
|
+
/* @__PURE__ */ jsx54("dt", { className: "font-label-mono text-label-mono uppercase text-on-surface-variant", children: item.term }),
|
|
2350
|
+
/* @__PURE__ */ jsx54("dd", { className: cx("min-w-0 text-on-surface wrap-break-word", mono ? "font-code-inline text-code-inline" : "font-body-md text-body-md"), children: item.detail })
|
|
2159
2351
|
] }, i)) });
|
|
2160
2352
|
}
|
|
2161
2353
|
|
|
2162
2354
|
// src/components/Timeline.tsx
|
|
2163
|
-
import { jsx as
|
|
2355
|
+
import { jsx as jsx55, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
2164
2356
|
var STATUS2 = {
|
|
2165
2357
|
done: { icon: "check", marker: "bg-badge-beginner-text text-badge-beginner-bg", text: "Completed" },
|
|
2166
2358
|
current: { icon: "radio_button_checked", marker: "bg-badge-intermediate-text text-badge-intermediate-bg ring-4 ring-badge-intermediate-bg", text: "Current" },
|
|
@@ -2171,11 +2363,11 @@ var STATUS2 = {
|
|
|
2171
2363
|
pending: { icon: "schedule", marker: "bg-surface-muted text-on-surface-variant", text: "Pending" }
|
|
2172
2364
|
};
|
|
2173
2365
|
function Timeline({ label, items, ...rest }) {
|
|
2174
|
-
return /* @__PURE__ */
|
|
2366
|
+
return /* @__PURE__ */ jsx55("ol", { ...rest, "aria-label": label, className: "flex min-w-0 flex-col", children: items.map((item, i) => {
|
|
2175
2367
|
const s = STATUS2[item.status];
|
|
2176
2368
|
return /* @__PURE__ */ jsxs39("li", { "aria-current": item.status === "current" ? "step" : void 0, className: "relative flex min-w-0 gap-space-sm pb-space-md last:pb-0", children: [
|
|
2177
|
-
i < items.length - 1 && /* @__PURE__ */
|
|
2178
|
-
/* @__PURE__ */
|
|
2369
|
+
i < items.length - 1 && /* @__PURE__ */ jsx55("span", { "aria-hidden": "true", className: "absolute bottom-0 left-3 top-7 w-px -translate-x-1/2 bg-border-subtle" }),
|
|
2370
|
+
/* @__PURE__ */ jsx55("span", { "aria-hidden": "true", className: cx("relative inline-flex size-6 shrink-0 items-center justify-center rounded-full", s.marker), children: /* @__PURE__ */ jsx55(Icon, { name: s.icon, size: "sm" }) }),
|
|
2179
2371
|
/* @__PURE__ */ jsxs39("div", { className: "min-w-0 flex-1 pt-0.5", children: [
|
|
2180
2372
|
/* @__PURE__ */ jsxs39("div", { className: "flex min-w-0 flex-wrap items-center gap-space-xs", children: [
|
|
2181
2373
|
/* @__PURE__ */ jsxs39("p", { className: "font-body-md text-body-md font-medium text-on-surface wrap-break-word", children: [
|
|
@@ -2187,8 +2379,8 @@ function Timeline({ label, items, ...rest }) {
|
|
|
2187
2379
|
] }),
|
|
2188
2380
|
item.badge
|
|
2189
2381
|
] }),
|
|
2190
|
-
item.description && /* @__PURE__ */
|
|
2191
|
-
item.meta && /* @__PURE__ */
|
|
2382
|
+
item.description && /* @__PURE__ */ jsx55("p", { className: "font-body-sm text-body-sm text-on-surface-variant wrap-break-word", children: item.description }),
|
|
2383
|
+
item.meta && /* @__PURE__ */ jsx55("p", { className: "font-label-mono text-label-mono text-on-surface-variant", children: item.meta })
|
|
2192
2384
|
] })
|
|
2193
2385
|
] }, item.id);
|
|
2194
2386
|
}) });
|
|
@@ -2196,7 +2388,7 @@ function Timeline({ label, items, ...rest }) {
|
|
|
2196
2388
|
|
|
2197
2389
|
// src/components/Disclosure.tsx
|
|
2198
2390
|
import { useId as useId10, useState as useState7 } from "react";
|
|
2199
|
-
import { jsx as
|
|
2391
|
+
import { jsx as jsx56, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
2200
2392
|
function Disclosure({ summary, children, open, defaultOpen = false, onOpenChange, selected, variant = "plain", ...rest }) {
|
|
2201
2393
|
const id = useId10();
|
|
2202
2394
|
const [inner, setInner] = useState7(defaultOpen);
|
|
@@ -2218,31 +2410,31 @@ function Disclosure({ summary, children, open, defaultOpen = false, onOpenChange
|
|
|
2218
2410
|
onClick: toggle,
|
|
2219
2411
|
className: cx("flex w-full min-w-0 items-center gap-space-sm text-left", row ? "px-space-sm py-space-sm hover:bg-surface-subtle" : "py-space-xs", FOCUS_RING, TOUCH),
|
|
2220
2412
|
children: [
|
|
2221
|
-
/* @__PURE__ */
|
|
2222
|
-
/* @__PURE__ */
|
|
2413
|
+
/* @__PURE__ */ jsx56("span", { className: "min-w-0 flex-1", children: summary }),
|
|
2414
|
+
/* @__PURE__ */ jsx56(Icon, { name: isOpen ? "expand_less" : "expand_more", size: "sm", tone: "muted" })
|
|
2223
2415
|
]
|
|
2224
2416
|
}
|
|
2225
2417
|
),
|
|
2226
|
-
/* @__PURE__ */
|
|
2418
|
+
/* @__PURE__ */ jsx56("div", { id: `${id}-panel`, role: "region", "aria-labelledby": `${id}-button`, hidden: !isOpen, className: cx("min-w-0", row ? "px-space-sm pb-space-sm" : "pb-space-xs"), children })
|
|
2227
2419
|
] });
|
|
2228
2420
|
}
|
|
2229
2421
|
|
|
2230
2422
|
// src/components/Skeleton.tsx
|
|
2231
|
-
import { jsx as
|
|
2232
|
-
var
|
|
2233
|
-
var
|
|
2234
|
-
var
|
|
2423
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
2424
|
+
var SHAPE4 = { line: "rounded", pill: "rounded-full", rect: "rounded-xl", circle: "rounded-full aspect-square" };
|
|
2425
|
+
var WIDTH3 = { full: "w-full", "3/4": "w-3/4", "1/2": "w-1/2", "1/3": "w-1/3", "1/4": "w-1/4" };
|
|
2426
|
+
var HEIGHT4 = { xs: "h-2", sm: "h-3", md: "h-4", lg: "h-8", xl: "h-24" };
|
|
2235
2427
|
var DEFAULT_HEIGHT = { line: "sm", pill: "lg", rect: "xl", circle: "lg" };
|
|
2236
2428
|
function Skeleton({ shape = "line", width = "full", height, lines, ...rest }) {
|
|
2237
|
-
const h =
|
|
2429
|
+
const h = HEIGHT4[height ?? DEFAULT_HEIGHT[shape]];
|
|
2238
2430
|
if (lines && lines > 1) {
|
|
2239
|
-
return /* @__PURE__ */
|
|
2431
|
+
return /* @__PURE__ */ jsx57("div", { ...rest, "aria-hidden": "true", className: "flex w-full min-w-0 flex-col gap-space-xs", children: Array.from({ length: lines }, (_, i) => /* @__PURE__ */ jsx57("div", { className: cx("skeleton-shimmer rounded", h, i === lines - 1 ? "w-3/4" : "w-full") }, i)) });
|
|
2240
2432
|
}
|
|
2241
|
-
return /* @__PURE__ */
|
|
2433
|
+
return /* @__PURE__ */ jsx57("div", { ...rest, "aria-hidden": "true", className: cx("skeleton-shimmer shrink-0", SHAPE4[shape], h, shape !== "circle" && WIDTH3[width]) });
|
|
2242
2434
|
}
|
|
2243
2435
|
|
|
2244
2436
|
// src/components/TerminalOutput.tsx
|
|
2245
|
-
import { jsx as
|
|
2437
|
+
import { jsx as jsx58, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
2246
2438
|
var KIND = {
|
|
2247
2439
|
command: "text-slate-100",
|
|
2248
2440
|
plain: "text-slate-300",
|
|
@@ -2255,10 +2447,10 @@ var MAX = { sm: "max-h-40", md: "max-h-72", lg: "max-h-[32rem]", none: "" };
|
|
|
2255
2447
|
function TerminalOutput({ lines, title, status, maxHeight = "md", ...rest }) {
|
|
2256
2448
|
return /* @__PURE__ */ jsxs41("figure", { ...rest, className: "min-w-0 max-w-full overflow-hidden rounded-xl bg-brand-obsidian", children: [
|
|
2257
2449
|
(title || status) && /* @__PURE__ */ jsxs41("figcaption", { className: "flex min-w-0 items-center justify-between gap-space-sm border-b border-white/10 px-space-md py-space-xs font-label-mono text-label-mono uppercase text-slate-300", children: [
|
|
2258
|
-
/* @__PURE__ */
|
|
2450
|
+
/* @__PURE__ */ jsx58("span", { className: "truncate", children: title }),
|
|
2259
2451
|
status
|
|
2260
2452
|
] }),
|
|
2261
|
-
/* @__PURE__ */
|
|
2453
|
+
/* @__PURE__ */ jsx58(
|
|
2262
2454
|
"div",
|
|
2263
2455
|
{
|
|
2264
2456
|
role: "log",
|
|
@@ -2270,7 +2462,7 @@ function TerminalOutput({ lines, title, status, maxHeight = "md", ...rest }) {
|
|
|
2270
2462
|
"$",
|
|
2271
2463
|
" "
|
|
2272
2464
|
] }),
|
|
2273
|
-
/* @__PURE__ */
|
|
2465
|
+
/* @__PURE__ */ jsx58("span", { children: line.text })
|
|
2274
2466
|
] }, i))
|
|
2275
2467
|
}
|
|
2276
2468
|
)
|
|
@@ -2278,40 +2470,40 @@ function TerminalOutput({ lines, title, status, maxHeight = "md", ...rest }) {
|
|
|
2278
2470
|
}
|
|
2279
2471
|
|
|
2280
2472
|
// src/components/VerdictBanner.tsx
|
|
2281
|
-
import { jsx as
|
|
2473
|
+
import { jsx as jsx59, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
2282
2474
|
var TITLE = { success: "text-fg-success", danger: "text-fg-danger", warning: "text-fg-warning" };
|
|
2283
2475
|
function VerdictBanner({ tone, icon, title, badge, meta, actions, ...rest }) {
|
|
2284
2476
|
return /* @__PURE__ */ jsxs42("section", { ...rest, className: "flex min-w-0 flex-col gap-space-md rounded-xl border border-border-subtle bg-surface-elevated p-space-lg md:flex-row md:items-center", children: [
|
|
2285
|
-
/* @__PURE__ */
|
|
2477
|
+
/* @__PURE__ */ jsx59(IconTile, { icon, tone, size: "xl", shape: "circle", filled: true }),
|
|
2286
2478
|
/* @__PURE__ */ jsxs42("div", { className: "min-w-0 flex-1", children: [
|
|
2287
2479
|
/* @__PURE__ */ jsxs42("div", { className: "flex min-w-0 flex-wrap items-center gap-space-sm", children: [
|
|
2288
|
-
/* @__PURE__ */
|
|
2480
|
+
/* @__PURE__ */ jsx59("h2", { className: cx("min-w-0 font-display text-headline-xl wrap-break-word", TITLE[tone]), children: title }),
|
|
2289
2481
|
badge
|
|
2290
2482
|
] }),
|
|
2291
|
-
meta && meta.length > 0 && /* @__PURE__ */
|
|
2292
|
-
i > 0 && /* @__PURE__ */
|
|
2483
|
+
meta && meta.length > 0 && /* @__PURE__ */ jsx59("ul", { className: "mt-space-xs flex min-w-0 flex-wrap items-center gap-x-space-sm gap-y-space-2xs font-body-sm text-body-sm text-on-surface-variant", children: meta.map((m, i) => /* @__PURE__ */ jsxs42("li", { className: "flex items-center gap-space-sm", children: [
|
|
2484
|
+
i > 0 && /* @__PURE__ */ jsx59("span", { "aria-hidden": "true", className: "h-3 w-px bg-border-strong" }),
|
|
2293
2485
|
m
|
|
2294
2486
|
] }, i)) })
|
|
2295
2487
|
] }),
|
|
2296
|
-
actions && /* @__PURE__ */
|
|
2488
|
+
actions && /* @__PURE__ */ jsx59("div", { className: "flex shrink-0 flex-wrap items-center gap-space-sm", children: actions })
|
|
2297
2489
|
] });
|
|
2298
2490
|
}
|
|
2299
2491
|
|
|
2300
2492
|
// src/components/Checkbox.tsx
|
|
2301
|
-
import { useEffect as useEffect5, useId as useId11, useRef as
|
|
2302
|
-
import { jsx as
|
|
2303
|
-
function Checkbox({ label, description, strikeWhenChecked, indeterminate, id, ...rest }) {
|
|
2493
|
+
import { useEffect as useEffect5, useId as useId11, useRef as useRef11 } from "react";
|
|
2494
|
+
import { jsx as jsx60, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
2495
|
+
function Checkbox({ label, description, strikeWhenChecked, indeterminate, size = "md", id, ...rest }) {
|
|
2304
2496
|
const generated = useId11();
|
|
2305
2497
|
const inputId = id ?? generated;
|
|
2306
2498
|
const descId = `${inputId}-desc`;
|
|
2307
|
-
const ref =
|
|
2499
|
+
const ref = useRef11(null);
|
|
2308
2500
|
useEffect5(() => {
|
|
2309
2501
|
if (ref.current) ref.current.indeterminate = Boolean(indeterminate);
|
|
2310
2502
|
}, [indeterminate]);
|
|
2311
2503
|
return /* @__PURE__ */ jsxs43("div", { className: "min-w-0", children: [
|
|
2312
2504
|
/* @__PURE__ */ jsxs43("label", { htmlFor: inputId, className: cx("group flex min-w-0 cursor-pointer items-start gap-space-sm", TOUCH), children: [
|
|
2313
2505
|
/* @__PURE__ */ jsxs43("span", { className: "relative mt-0.5 inline-flex size-4 shrink-0", children: [
|
|
2314
|
-
/* @__PURE__ */
|
|
2506
|
+
/* @__PURE__ */ jsx60(
|
|
2315
2507
|
"input",
|
|
2316
2508
|
{
|
|
2317
2509
|
...rest,
|
|
@@ -2325,18 +2517,18 @@ function Checkbox({ label, description, strikeWhenChecked, indeterminate, id, ..
|
|
|
2325
2517
|
)
|
|
2326
2518
|
}
|
|
2327
2519
|
),
|
|
2328
|
-
/* @__PURE__ */
|
|
2329
|
-
/* @__PURE__ */
|
|
2520
|
+
/* @__PURE__ */ jsx60("span", { "aria-hidden": "true", className: "pointer-events-none absolute inset-0 hidden items-center justify-center text-white peer-checked:flex", children: /* @__PURE__ */ jsx60(Icon, { name: "check", size: "sm" }) }),
|
|
2521
|
+
/* @__PURE__ */ jsx60("span", { "aria-hidden": "true", className: "pointer-events-none absolute inset-0 hidden items-center justify-center text-white peer-indeterminate:flex", children: /* @__PURE__ */ jsx60(Icon, { name: "remove", size: "sm" }) })
|
|
2330
2522
|
] }),
|
|
2331
|
-
/* @__PURE__ */
|
|
2523
|
+
/* @__PURE__ */ jsx60("span", { className: cx("min-w-0 text-on-surface wrap-break-word", size === "sm" ? "font-body-sm text-body-sm" : "font-body-md text-body-md", strikeWhenChecked && "group-has-checked:text-on-surface-variant group-has-checked:line-through"), children: label })
|
|
2332
2524
|
] }),
|
|
2333
|
-
description && /* @__PURE__ */
|
|
2525
|
+
description && /* @__PURE__ */ jsx60("p", { id: descId, className: "pl-6 font-body-sm text-body-sm text-on-surface-variant wrap-break-word", children: description })
|
|
2334
2526
|
] });
|
|
2335
2527
|
}
|
|
2336
2528
|
|
|
2337
2529
|
// src/components/Switch.tsx
|
|
2338
2530
|
import { useId as useId12 } from "react";
|
|
2339
|
-
import { jsx as
|
|
2531
|
+
import { jsx as jsx61, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
2340
2532
|
function Switch({ label, checked, onChange, description, ...rest }) {
|
|
2341
2533
|
const id = useId12();
|
|
2342
2534
|
const buttonId = rest.id ?? `${id}-switch`;
|
|
@@ -2344,10 +2536,10 @@ function Switch({ label, checked, onChange, description, ...rest }) {
|
|
|
2344
2536
|
// The row is a <label> for the button, so tapping the text toggles it and the target is the full row.
|
|
2345
2537
|
/* @__PURE__ */ jsxs44("label", { htmlFor: buttonId, className: cx("flex min-w-0 cursor-pointer items-start justify-between gap-space-md", TOUCH), children: [
|
|
2346
2538
|
/* @__PURE__ */ jsxs44("span", { className: "min-w-0", children: [
|
|
2347
|
-
/* @__PURE__ */
|
|
2348
|
-
description && /* @__PURE__ */
|
|
2539
|
+
/* @__PURE__ */ jsx61("span", { id: `${id}-label`, className: "font-body-md text-body-md text-on-surface", children: label }),
|
|
2540
|
+
description && /* @__PURE__ */ jsx61("span", { id: `${id}-desc`, className: "block font-body-sm text-body-sm text-on-surface-variant wrap-break-word", children: description })
|
|
2349
2541
|
] }),
|
|
2350
|
-
/* @__PURE__ */
|
|
2542
|
+
/* @__PURE__ */ jsx61(
|
|
2351
2543
|
"button",
|
|
2352
2544
|
{
|
|
2353
2545
|
...rest,
|
|
@@ -2359,7 +2551,7 @@ function Switch({ label, checked, onChange, description, ...rest }) {
|
|
|
2359
2551
|
"aria-describedby": description ? `${id}-desc` : void 0,
|
|
2360
2552
|
onClick: () => onChange(!checked),
|
|
2361
2553
|
className: cx("relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors disabled:pointer-events-none disabled:opacity-50", checked ? "bg-brand-cobalt" : "bg-border-strong", FOCUS_RING),
|
|
2362
|
-
children: /* @__PURE__ */
|
|
2554
|
+
children: /* @__PURE__ */ jsx61("span", { "aria-hidden": "true", className: cx("inline-block size-5 rounded-full bg-white shadow-sm transition-transform", checked ? "translate-x-5.5" : "translate-x-0.5") })
|
|
2363
2555
|
}
|
|
2364
2556
|
)
|
|
2365
2557
|
] })
|
|
@@ -2367,17 +2559,17 @@ function Switch({ label, checked, onChange, description, ...rest }) {
|
|
|
2367
2559
|
}
|
|
2368
2560
|
|
|
2369
2561
|
// src/components/Overlay.tsx
|
|
2370
|
-
import { jsx as
|
|
2562
|
+
import { jsx as jsx62, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
2371
2563
|
function Overlay({ children, overlay, blur = true, ...rest }) {
|
|
2372
2564
|
return /* @__PURE__ */ jsxs45("div", { ...rest, className: "relative min-w-0 overflow-hidden rounded-xl", children: [
|
|
2373
|
-
/* @__PURE__ */
|
|
2374
|
-
/* @__PURE__ */
|
|
2565
|
+
/* @__PURE__ */ jsx62("div", { inert: true, "aria-hidden": "true", className: cx("pointer-events-none select-none", blur && "blur-sm"), children }),
|
|
2566
|
+
/* @__PURE__ */ jsx62("div", { className: "absolute inset-0 flex items-center justify-center bg-surface/70 p-space-md", children: overlay })
|
|
2375
2567
|
] });
|
|
2376
2568
|
}
|
|
2377
2569
|
|
|
2378
2570
|
// src/components/CopyButton.tsx
|
|
2379
2571
|
import { useEffect as useEffect6, useState as useState8 } from "react";
|
|
2380
|
-
import { jsx as
|
|
2572
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
2381
2573
|
function CopyButton({ value, label = "Copy", copiedLabel = "Copied", size = "sm", variant = "secondary", ...rest }) {
|
|
2382
2574
|
const [state, setState] = useState8("idle");
|
|
2383
2575
|
useEffect6(() => {
|
|
@@ -2393,7 +2585,7 @@ function CopyButton({ value, label = "Copy", copiedLabel = "Copied", size = "sm"
|
|
|
2393
2585
|
setState("failed");
|
|
2394
2586
|
}
|
|
2395
2587
|
};
|
|
2396
|
-
return /* @__PURE__ */
|
|
2588
|
+
return /* @__PURE__ */ jsx63(Button, { ...rest, variant, size, icon: state === "copied" ? "check" : state === "failed" ? "error" : "content_copy", onClick: copy, "aria-live": "polite", children: state === "copied" ? copiedLabel : state === "failed" ? "Copy failed" : label });
|
|
2397
2589
|
}
|
|
2398
2590
|
|
|
2399
2591
|
// src/internal/diff.ts
|
|
@@ -2441,41 +2633,41 @@ function splitRows(lines) {
|
|
|
2441
2633
|
}
|
|
2442
2634
|
|
|
2443
2635
|
// src/components/DiffViewer.tsx
|
|
2444
|
-
import { jsx as
|
|
2636
|
+
import { jsx as jsx64, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
2445
2637
|
var KIND2 = { same: "text-code-plain", add: "bg-diff-add-bg text-diff-add-fg", del: "bg-diff-del-bg text-diff-del-fg" };
|
|
2446
2638
|
var SIGN = { same: " ", add: "+", del: "\u2212" };
|
|
2447
2639
|
var SPOKEN = { same: "", add: "added:", del: "removed:" };
|
|
2448
2640
|
var PRE = "overflow-x-auto py-space-sm font-code-inline text-code-inline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-brand-cobalt";
|
|
2449
2641
|
function Row({ line, gutters }) {
|
|
2450
|
-
if (!line) return /* @__PURE__ */
|
|
2642
|
+
if (!line) return /* @__PURE__ */ jsx64("div", { className: "min-h-5 bg-white/5" });
|
|
2451
2643
|
return /* @__PURE__ */ jsxs46("div", { className: cx("flex min-w-0 px-space-sm", KIND2[line.kind]), children: [
|
|
2452
|
-
gutters !== "new" && /* @__PURE__ */
|
|
2453
|
-
gutters !== "old" && /* @__PURE__ */
|
|
2454
|
-
/* @__PURE__ */
|
|
2455
|
-
SPOKEN[line.kind] && /* @__PURE__ */
|
|
2456
|
-
/* @__PURE__ */
|
|
2644
|
+
gutters !== "new" && /* @__PURE__ */ jsx64("span", { "aria-hidden": "true", className: "w-8 shrink-0 select-none pr-space-xs text-right text-code-comment", children: line.oldNo ?? "" }),
|
|
2645
|
+
gutters !== "old" && /* @__PURE__ */ jsx64("span", { "aria-hidden": "true", className: "w-8 shrink-0 select-none pr-space-xs text-right text-code-comment", children: line.newNo ?? "" }),
|
|
2646
|
+
/* @__PURE__ */ jsx64("span", { "aria-hidden": "true", className: "w-4 shrink-0 select-none", children: SIGN[line.kind] }),
|
|
2647
|
+
SPOKEN[line.kind] && /* @__PURE__ */ jsx64("span", { className: "sr-only", children: SPOKEN[line.kind] }),
|
|
2648
|
+
/* @__PURE__ */ jsx64("span", { className: "min-w-0 whitespace-pre-wrap wrap-break-word", children: line.text || " " })
|
|
2457
2649
|
] });
|
|
2458
2650
|
}
|
|
2459
2651
|
function DiffViewer({ oldValue, newValue, oldTitle, newTitle, mode = "unified", ...rest }) {
|
|
2460
2652
|
const lines = diffLines(oldValue, newValue);
|
|
2461
|
-
const unified = /* @__PURE__ */
|
|
2653
|
+
const unified = /* @__PURE__ */ jsx64("pre", { tabIndex: 0, className: cx(PRE, mode === "split" && "lg:hidden"), children: lines.map((l, i) => /* @__PURE__ */ jsx64(Row, { line: l, gutters: "both" }, i)) });
|
|
2462
2654
|
return /* @__PURE__ */ jsxs46("figure", { ...rest, className: "min-w-0 max-w-full overflow-hidden rounded-xl bg-brand-obsidian", children: [
|
|
2463
2655
|
(oldTitle || newTitle) && /* @__PURE__ */ jsxs46("figcaption", { className: "flex min-w-0 flex-wrap items-center gap-space-xs border-b border-white/10 px-space-md py-space-xs font-label-mono text-label-mono text-slate-300", children: [
|
|
2464
|
-
oldTitle && /* @__PURE__ */
|
|
2465
|
-
oldTitle && newTitle && /* @__PURE__ */
|
|
2466
|
-
newTitle && /* @__PURE__ */
|
|
2656
|
+
oldTitle && /* @__PURE__ */ jsx64("span", { className: "truncate", children: oldTitle }),
|
|
2657
|
+
oldTitle && newTitle && /* @__PURE__ */ jsx64("span", { "aria-hidden": "true", children: "\u2192" }),
|
|
2658
|
+
newTitle && /* @__PURE__ */ jsx64("span", { className: "truncate", children: newTitle })
|
|
2467
2659
|
] }),
|
|
2468
2660
|
unified,
|
|
2469
|
-
mode === "split" && /* @__PURE__ */
|
|
2470
|
-
/* @__PURE__ */
|
|
2471
|
-
/* @__PURE__ */
|
|
2661
|
+
mode === "split" && /* @__PURE__ */ jsx64("pre", { tabIndex: 0, className: cx(PRE, "hidden grid-cols-2 lg:grid"), children: splitRows(lines).map((r, i) => /* @__PURE__ */ jsxs46("div", { className: "contents", children: [
|
|
2662
|
+
/* @__PURE__ */ jsx64(Row, { line: r.left, gutters: "old" }),
|
|
2663
|
+
/* @__PURE__ */ jsx64(Row, { line: r.right, gutters: "new" })
|
|
2472
2664
|
] }, i)) })
|
|
2473
2665
|
] });
|
|
2474
2666
|
}
|
|
2475
2667
|
|
|
2476
2668
|
// src/components/BarChart.tsx
|
|
2477
|
-
import { jsx as
|
|
2478
|
-
var
|
|
2669
|
+
import { jsx as jsx65, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
2670
|
+
var HEIGHT5 = { sm: "h-16", md: "h-28" };
|
|
2479
2671
|
var TONE14 = { brand: "bg-brand-cobalt", success: "bg-brand-emerald" };
|
|
2480
2672
|
function BarChart({ label, bars, highlight, highlightLabel, axis, height = "md", tone = "brand", ...rest }) {
|
|
2481
2673
|
const max = Math.max(0, ...bars.map((b) => b.value));
|
|
@@ -2483,35 +2675,55 @@ function BarChart({ label, bars, highlight, highlightLabel, axis, height = "md",
|
|
|
2483
2675
|
const hl = highlight !== void 0 && bars[highlight] ? `; highlighted ${name(highlight)} = ${bars[highlight].value}` : "";
|
|
2484
2676
|
const summary = `${label}: ${bars.length} bars, highest ${max}${hl}`;
|
|
2485
2677
|
return /* @__PURE__ */ jsxs47("figure", { ...rest, className: "flex min-w-0 flex-col gap-space-xs", children: [
|
|
2486
|
-
/* @__PURE__ */
|
|
2678
|
+
/* @__PURE__ */ jsx65("div", { role: "img", "aria-label": summary, className: cx("flex items-end gap-1", HEIGHT5[height], highlightLabel && "pt-space-lg"), children: bars.map((b, i) => {
|
|
2487
2679
|
const pct = max > 0 ? Math.max(2, Math.round(Math.max(0, b.value) / max * 100)) : 2;
|
|
2488
2680
|
const strong = highlight === void 0 || i === highlight;
|
|
2489
2681
|
return /* @__PURE__ */ jsxs47("div", { className: "relative flex h-full min-w-0 flex-1 items-end", children: [
|
|
2490
|
-
i === highlight && highlightLabel && /* @__PURE__ */
|
|
2491
|
-
/* @__PURE__ */
|
|
2682
|
+
i === highlight && highlightLabel && /* @__PURE__ */ jsx65("span", { className: "absolute -top-space-lg left-1/2 -translate-x-1/2 whitespace-nowrap font-label-mono text-[10px] text-fg-brand", children: highlightLabel }),
|
|
2683
|
+
/* @__PURE__ */ jsx65("div", { "data-bar": "", className: cx("w-full rounded-t", strong ? TONE14[tone] : "bg-surface-container-high"), style: { height: `${pct}%` } })
|
|
2492
2684
|
] }, i);
|
|
2493
2685
|
}) }),
|
|
2494
2686
|
axis && /* @__PURE__ */ jsxs47("div", { "aria-hidden": "true", className: "flex justify-between font-label-mono text-[10px] text-on-surface-variant", children: [
|
|
2495
|
-
/* @__PURE__ */
|
|
2496
|
-
/* @__PURE__ */
|
|
2497
|
-
/* @__PURE__ */
|
|
2687
|
+
/* @__PURE__ */ jsx65("span", { children: axis[0] }),
|
|
2688
|
+
/* @__PURE__ */ jsx65("span", { children: axis[1] }),
|
|
2689
|
+
/* @__PURE__ */ jsx65("span", { children: axis[2] })
|
|
2498
2690
|
] }),
|
|
2499
2691
|
/* @__PURE__ */ jsxs47("table", { className: "sr-only", children: [
|
|
2500
|
-
/* @__PURE__ */
|
|
2501
|
-
/* @__PURE__ */
|
|
2502
|
-
/* @__PURE__ */
|
|
2503
|
-
/* @__PURE__ */
|
|
2692
|
+
/* @__PURE__ */ jsx65("caption", { children: label }),
|
|
2693
|
+
/* @__PURE__ */ jsx65("tbody", { children: bars.map((b, i) => /* @__PURE__ */ jsxs47("tr", { children: [
|
|
2694
|
+
/* @__PURE__ */ jsx65("th", { scope: "row", children: name(i) }),
|
|
2695
|
+
/* @__PURE__ */ jsx65("td", { children: b.value })
|
|
2504
2696
|
] }, i)) })
|
|
2505
2697
|
] })
|
|
2506
2698
|
] });
|
|
2507
2699
|
}
|
|
2508
2700
|
|
|
2509
2701
|
// src/ide/UmlClass.tsx
|
|
2510
|
-
import { jsx as
|
|
2702
|
+
import { jsx as jsx66, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
2511
2703
|
var EMPHASIS = { default: "border border-border-strong", brand: "border-2 border-brand-cobalt", strong: "border-2 border-ink" };
|
|
2512
|
-
var
|
|
2513
|
-
|
|
2514
|
-
|
|
2704
|
+
var SIZE15 = { sm: { text: "text-[11px] leading-4", pad: "px-space-xs py-space-2xs" }, md: { text: "text-code-inline", pad: "px-space-sm py-space-xs" } };
|
|
2705
|
+
var HEADER_TONE = { container: "bg-surface-container", info: "bg-badge-intermediate-bg", strong: "bg-surface-container-high" };
|
|
2706
|
+
var STEREO_TONE = { container: "text-secondary", info: "text-badge-intermediate-text", strong: "text-secondary" };
|
|
2707
|
+
function UmlClass({ name, stereotype, attributes = [], methods = [], tag, emphasis = "default", size = "md", dashed, variant = "box", headerTone = "container", columns = 1, ...rest }) {
|
|
2708
|
+
const s = SIZE15[size];
|
|
2709
|
+
if (variant === "tinted") {
|
|
2710
|
+
const strong = headerTone === "strong";
|
|
2711
|
+
return /* @__PURE__ */ jsxs48("div", { ...rest, className: "flex min-w-0 flex-col gap-space-xs rounded-lg bg-surface-elevated p-space-sm shadow-sm", children: [
|
|
2712
|
+
/* @__PURE__ */ jsxs48("div", { className: cx("flex min-w-0 gap-space-xs rounded px-space-xs py-space-2xs", HEADER_TONE[headerTone], strong ? "items-center justify-between" : "flex-col items-center text-center"), children: [
|
|
2713
|
+
stereotype && /* @__PURE__ */ jsxs48("span", { className: cx("font-label-mono text-label-mono italic", STEREO_TONE[headerTone]), children: [
|
|
2714
|
+
"\xAB",
|
|
2715
|
+
stereotype,
|
|
2716
|
+
"\xBB"
|
|
2717
|
+
] }),
|
|
2718
|
+
/* @__PURE__ */ jsx66("span", { className: "truncate font-headline-sm text-headline-sm text-ink", children: name }),
|
|
2719
|
+
tag
|
|
2720
|
+
] }),
|
|
2721
|
+
attributes.length + methods.length > 0 && /* @__PURE__ */ jsxs48("ul", { className: cx("grid min-w-0 gap-space-2xs p-space-2xs font-code-inline text-code-inline", columns === 2 ? "grid-cols-2" : "grid-cols-1"), children: [
|
|
2722
|
+
attributes.map((a, i) => /* @__PURE__ */ jsx66("li", { className: "min-w-0 truncate text-on-surface-variant", children: a }, `a${i}`)),
|
|
2723
|
+
methods.map((m, i) => /* @__PURE__ */ jsx66("li", { className: cx("min-w-0 truncate text-fg-brand", columns === 2 && "col-span-2"), children: m }, `m${i}`))
|
|
2724
|
+
] })
|
|
2725
|
+
] });
|
|
2726
|
+
}
|
|
2515
2727
|
return /* @__PURE__ */ jsxs48("div", { ...rest, className: cx("inline-flex min-w-0 max-w-full flex-col overflow-hidden rounded-lg bg-surface-elevated font-code-inline text-on-surface shadow-sm", EMPHASIS[emphasis], dashed && "border-dashed", s.text), children: [
|
|
2516
2728
|
/* @__PURE__ */ jsxs48("div", { className: cx("flex flex-col items-center text-center", s.pad), children: [
|
|
2517
2729
|
stereotype && /* @__PURE__ */ jsxs48("span", { className: "text-on-surface-variant", children: [
|
|
@@ -2519,17 +2731,17 @@ function UmlClass({ name, stereotype, attributes = [], methods = [], tag, emphas
|
|
|
2519
2731
|
stereotype,
|
|
2520
2732
|
"\xBB"
|
|
2521
2733
|
] }),
|
|
2522
|
-
/* @__PURE__ */
|
|
2734
|
+
/* @__PURE__ */ jsx66("span", { className: "font-semibold text-ink", children: name }),
|
|
2523
2735
|
tag
|
|
2524
2736
|
] }),
|
|
2525
|
-
attributes.length > 0 && /* @__PURE__ */
|
|
2526
|
-
methods.length > 0 && /* @__PURE__ */
|
|
2737
|
+
attributes.length > 0 && /* @__PURE__ */ jsx66("ul", { className: cx("border-t border-border-subtle", s.pad), children: attributes.map((a, i) => /* @__PURE__ */ jsx66("li", { className: "whitespace-nowrap", children: a }, i)) }),
|
|
2738
|
+
methods.length > 0 && /* @__PURE__ */ jsx66("ul", { className: cx("border-t border-border-subtle", s.pad), children: methods.map((m, i) => /* @__PURE__ */ jsx66("li", { className: "whitespace-nowrap", children: m }, i)) })
|
|
2527
2739
|
] });
|
|
2528
2740
|
}
|
|
2529
2741
|
|
|
2530
2742
|
// src/ide/UmlDiagram.tsx
|
|
2531
|
-
import { useEffect as useEffect7, useId as useId13, useRef as
|
|
2532
|
-
import { jsx as
|
|
2743
|
+
import { useEffect as useEffect7, useId as useId13, useRef as useRef12, useState as useState9 } from "react";
|
|
2744
|
+
import { jsx as jsx67, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
2533
2745
|
var VERB = {
|
|
2534
2746
|
association: "is associated with",
|
|
2535
2747
|
dependency: "depends on",
|
|
@@ -2558,14 +2770,14 @@ function edgeStyle(kind, id) {
|
|
|
2558
2770
|
}
|
|
2559
2771
|
function UmlDiagram({ label, nodes, edges, direction = "TB", zoomable = true, compact, pattern = "dots", ...rest }) {
|
|
2560
2772
|
const id = useId13().replace(/[^a-zA-Z0-9_-]/g, "");
|
|
2561
|
-
const nodeRefs =
|
|
2562
|
-
const viewportRef =
|
|
2773
|
+
const nodeRefs = useRef12(/* @__PURE__ */ new Map());
|
|
2774
|
+
const viewportRef = useRef12(null);
|
|
2563
2775
|
const [layout, setLayout] = useState9(null);
|
|
2564
2776
|
const [zoom, setZoom] = useState9(1);
|
|
2565
2777
|
const [fit, setFit] = useState9(1);
|
|
2566
2778
|
const contentKey = JSON.stringify({ n: nodes.map((n) => [n.id, n.name, n.stereotype, n.attributes, n.methods]), e: edges.map((e) => [e.from, e.to, e.kind]), direction, compact });
|
|
2567
2779
|
const [sizeTick, setSizeTick] = useState9(0);
|
|
2568
|
-
const sizes =
|
|
2780
|
+
const sizes = useRef12(/* @__PURE__ */ new Map());
|
|
2569
2781
|
const key = `${contentKey}#${sizeTick}`;
|
|
2570
2782
|
useEffect7(() => {
|
|
2571
2783
|
if (typeof ResizeObserver === "undefined") return;
|
|
@@ -2629,17 +2841,17 @@ function UmlDiagram({ label, nodes, edges, direction = "TB", zoomable = true, co
|
|
|
2629
2841
|
const scale = compact ? fit : zoom;
|
|
2630
2842
|
const descId = `${id}-desc`;
|
|
2631
2843
|
return /* @__PURE__ */ jsxs49("figure", { ...rest, className: "relative min-w-0 max-w-full overflow-hidden rounded-xl border border-border-subtle bg-surface-subtle", children: [
|
|
2632
|
-
/* @__PURE__ */
|
|
2844
|
+
/* @__PURE__ */ jsx67("figcaption", { id: descId, className: "sr-only", children: describeDiagram(label, nodes, edges) }),
|
|
2633
2845
|
zoomable && !compact && /* @__PURE__ */ jsxs49("div", { className: "absolute right-space-sm top-space-sm z-10 flex items-center gap-space-2xs rounded-lg bg-surface-elevated/90 p-space-2xs shadow-sm", children: [
|
|
2634
|
-
/* @__PURE__ */
|
|
2846
|
+
/* @__PURE__ */ jsx67(IconButton, { icon: "zoom_out", label: "Zoom out", size: "xs", variant: "secondary", disabled: zoom <= ZOOM_MIN, onClick: () => setZoom((z) => Math.max(ZOOM_MIN, z - ZOOM_STEP)) }),
|
|
2635
2847
|
/* @__PURE__ */ jsxs49("span", { "aria-live": "polite", className: "w-10 text-center font-label-mono text-[11px] text-on-surface-variant", children: [
|
|
2636
2848
|
Math.round(zoom * 100),
|
|
2637
2849
|
"%"
|
|
2638
2850
|
] }),
|
|
2639
|
-
/* @__PURE__ */
|
|
2640
|
-
/* @__PURE__ */
|
|
2851
|
+
/* @__PURE__ */ jsx67(IconButton, { icon: "zoom_in", label: "Zoom in", size: "xs", variant: "secondary", disabled: zoom >= ZOOM_MAX, onClick: () => setZoom((z) => Math.min(ZOOM_MAX, z + ZOOM_STEP)) }),
|
|
2852
|
+
/* @__PURE__ */ jsx67(IconButton, { icon: "fit_screen", label: "Reset zoom", size: "xs", variant: "secondary", onClick: () => setZoom(1) })
|
|
2641
2853
|
] }),
|
|
2642
|
-
/* @__PURE__ */
|
|
2854
|
+
/* @__PURE__ */ jsx67(
|
|
2643
2855
|
"div",
|
|
2644
2856
|
{
|
|
2645
2857
|
ref: viewportRef,
|
|
@@ -2658,10 +2870,10 @@ function UmlDiagram({ label, nodes, edges, direction = "TB", zoomable = true, co
|
|
|
2658
2870
|
children: [
|
|
2659
2871
|
layout && /* @__PURE__ */ jsxs49("svg", { "aria-hidden": "true", className: "pointer-events-none absolute inset-0 overflow-visible text-on-surface-variant", width: layout.width, height: layout.height, children: [
|
|
2660
2872
|
/* @__PURE__ */ jsxs49("defs", { children: [
|
|
2661
|
-
/* @__PURE__ */
|
|
2662
|
-
/* @__PURE__ */
|
|
2663
|
-
/* @__PURE__ */
|
|
2664
|
-
/* @__PURE__ */
|
|
2873
|
+
/* @__PURE__ */ jsx67("marker", { id: `${id}-arrow`, viewBox: "0 0 10 10", refX: "10", refY: "5", markerWidth: "10", markerHeight: "10", orient: "auto-start-reverse", children: /* @__PURE__ */ jsx67("path", { d: "M0,0 L10,5 L0,10", fill: "none", stroke: "currentColor", strokeWidth: "1.5" }) }),
|
|
2874
|
+
/* @__PURE__ */ jsx67("marker", { id: `${id}-triangle`, viewBox: "0 0 12 12", refX: "12", refY: "6", markerWidth: "12", markerHeight: "12", orient: "auto-start-reverse", children: /* @__PURE__ */ jsx67("path", { d: "M0,0 L12,6 L0,12 z", fill: "var(--color-surface-elevated)", stroke: "currentColor", strokeWidth: "1.5" }) }),
|
|
2875
|
+
/* @__PURE__ */ jsx67("marker", { id: `${id}-diamond-hollow`, viewBox: "0 0 14 8", refX: "14", refY: "4", markerWidth: "14", markerHeight: "8", orient: "auto-start-reverse", children: /* @__PURE__ */ jsx67("path", { d: "M0,4 L7,0 L14,4 L7,8 z", fill: "var(--color-surface-elevated)", stroke: "currentColor", strokeWidth: "1.5" }) }),
|
|
2876
|
+
/* @__PURE__ */ jsx67("marker", { id: `${id}-diamond-filled`, viewBox: "0 0 14 8", refX: "14", refY: "4", markerWidth: "14", markerHeight: "8", orient: "auto-start-reverse", children: /* @__PURE__ */ jsx67("path", { d: "M0,4 L7,0 L14,4 L7,8 z", fill: "currentColor", stroke: "currentColor", strokeWidth: "1.5" }) })
|
|
2665
2877
|
] }),
|
|
2666
2878
|
edges.map((e, i) => {
|
|
2667
2879
|
const pts = layout.edges[i];
|
|
@@ -2670,7 +2882,7 @@ function UmlDiagram({ label, nodes, edges, direction = "TB", zoomable = true, co
|
|
|
2670
2882
|
const d = pts.map((p, k) => `${k === 0 ? "M" : "L"}${p.x},${p.y}`).join(" ");
|
|
2671
2883
|
const mid = pts[Math.floor(pts.length / 2)];
|
|
2672
2884
|
return /* @__PURE__ */ jsxs49("g", { children: [
|
|
2673
|
-
/* @__PURE__ */
|
|
2885
|
+
/* @__PURE__ */ jsx67(
|
|
2674
2886
|
"path",
|
|
2675
2887
|
{
|
|
2676
2888
|
"data-edge": "",
|
|
@@ -2683,13 +2895,13 @@ function UmlDiagram({ label, nodes, edges, direction = "TB", zoomable = true, co
|
|
|
2683
2895
|
markerStart: s.start
|
|
2684
2896
|
}
|
|
2685
2897
|
),
|
|
2686
|
-
e.label && /* @__PURE__ */
|
|
2687
|
-
e.fromMultiplicity && /* @__PURE__ */
|
|
2688
|
-
e.toMultiplicity && /* @__PURE__ */
|
|
2898
|
+
e.label && /* @__PURE__ */ jsx67("text", { x: mid.x + 6, y: mid.y - 6, className: "fill-on-surface-variant font-code-inline text-[10px]", children: e.label }),
|
|
2899
|
+
e.fromMultiplicity && /* @__PURE__ */ jsx67("text", { x: pts[0].x + 6, y: pts[0].y + 14, className: "fill-on-surface-variant font-code-inline text-[10px]", children: e.fromMultiplicity }),
|
|
2900
|
+
e.toMultiplicity && /* @__PURE__ */ jsx67("text", { x: pts[pts.length - 1].x + 6, y: pts[pts.length - 1].y - 6, className: "fill-on-surface-variant font-code-inline text-[10px]", children: e.toMultiplicity })
|
|
2689
2901
|
] }, i);
|
|
2690
2902
|
})
|
|
2691
2903
|
] }),
|
|
2692
|
-
nodes.map((n) => /* @__PURE__ */
|
|
2904
|
+
nodes.map((n) => /* @__PURE__ */ jsx67(
|
|
2693
2905
|
"div",
|
|
2694
2906
|
{
|
|
2695
2907
|
"data-node": "",
|
|
@@ -2699,7 +2911,7 @@ function UmlDiagram({ label, nodes, edges, direction = "TB", zoomable = true, co
|
|
|
2699
2911
|
},
|
|
2700
2912
|
className: layout ? "absolute" : void 0,
|
|
2701
2913
|
style: layout?.nodes[n.id] ? { left: layout.nodes[n.id].x, top: layout.nodes[n.id].y } : void 0,
|
|
2702
|
-
children: /* @__PURE__ */
|
|
2914
|
+
children: /* @__PURE__ */ jsx67(UmlClass, { name: n.name, stereotype: n.stereotype, attributes: n.attributes, methods: n.methods, tag: n.tag, emphasis: n.emphasis, dashed: n.dashed, size: compact ? "sm" : "md" })
|
|
2703
2915
|
},
|
|
2704
2916
|
n.id
|
|
2705
2917
|
))
|
|
@@ -2717,20 +2929,20 @@ import {
|
|
|
2717
2929
|
useEffect as useEffect8,
|
|
2718
2930
|
useId as useId14,
|
|
2719
2931
|
useLayoutEffect,
|
|
2720
|
-
useRef as
|
|
2932
|
+
useRef as useRef13,
|
|
2721
2933
|
useState as useState10
|
|
2722
2934
|
} from "react";
|
|
2723
|
-
import { createPortal as
|
|
2724
|
-
import { Fragment as Fragment6, jsx as
|
|
2935
|
+
import { createPortal as createPortal4 } from "react-dom";
|
|
2936
|
+
import { Fragment as Fragment6, jsx as jsx68, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
2725
2937
|
var GAP2 = 8;
|
|
2726
2938
|
function Tooltip({ content, children, side = "top", delay = 400 }) {
|
|
2727
2939
|
const id = useId14();
|
|
2728
2940
|
const theme = useThemeTone();
|
|
2729
2941
|
const [open, setOpen] = useState10(false);
|
|
2730
2942
|
const [pos, setPos] = useState10(null);
|
|
2731
|
-
const triggerRef =
|
|
2732
|
-
const tipRef =
|
|
2733
|
-
const timer =
|
|
2943
|
+
const triggerRef = useRef13(null);
|
|
2944
|
+
const tipRef = useRef13(null);
|
|
2945
|
+
const timer = useRef13(void 0);
|
|
2734
2946
|
const show = () => {
|
|
2735
2947
|
clearTimeout(timer.current);
|
|
2736
2948
|
timer.current = setTimeout(() => setOpen(true), delay);
|
|
@@ -2794,8 +3006,8 @@ function Tooltip({ content, children, side = "top", delay = 400 }) {
|
|
|
2794
3006
|
});
|
|
2795
3007
|
return /* @__PURE__ */ jsxs50(Fragment6, { children: [
|
|
2796
3008
|
trigger,
|
|
2797
|
-
open && typeof document !== "undefined" &&
|
|
2798
|
-
/* @__PURE__ */
|
|
3009
|
+
open && typeof document !== "undefined" && createPortal4(
|
|
3010
|
+
/* @__PURE__ */ jsx68(
|
|
2799
3011
|
"div",
|
|
2800
3012
|
{
|
|
2801
3013
|
ref: tipRef,
|
|
@@ -2814,7 +3026,7 @@ function Tooltip({ content, children, side = "top", delay = 400 }) {
|
|
|
2814
3026
|
|
|
2815
3027
|
// src/components/Toast.tsx
|
|
2816
3028
|
import { useEffect as useEffect9, useState as useState11, useSyncExternalStore } from "react";
|
|
2817
|
-
import { jsx as
|
|
3029
|
+
import { jsx as jsx69, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
2818
3030
|
var toasts = [];
|
|
2819
3031
|
var nextId = 1;
|
|
2820
3032
|
var listeners = /* @__PURE__ */ new Set();
|
|
@@ -2864,29 +3076,29 @@ function ToastItem({ toast }) {
|
|
|
2864
3076
|
className: cx("pointer-events-auto flex min-w-0 items-start gap-space-sm rounded-lg border border-l-4 border-border-subtle bg-surface-elevated p-space-sm text-on-surface shadow-md", TONE15[toast.tone]),
|
|
2865
3077
|
children: [
|
|
2866
3078
|
/* @__PURE__ */ jsxs51("div", { className: "min-w-0 flex-1", children: [
|
|
2867
|
-
/* @__PURE__ */
|
|
2868
|
-
toast.description && /* @__PURE__ */
|
|
2869
|
-
toast.action && /* @__PURE__ */
|
|
3079
|
+
/* @__PURE__ */ jsx69("p", { className: "font-body-md text-body-md font-semibold wrap-break-word", children: toast.title }),
|
|
3080
|
+
toast.description && /* @__PURE__ */ jsx69("p", { className: "font-body-sm text-body-sm text-on-surface-variant wrap-break-word", children: toast.description }),
|
|
3081
|
+
toast.action && /* @__PURE__ */ jsx69("div", { className: "mt-space-xs", children: toast.action })
|
|
2870
3082
|
] }),
|
|
2871
|
-
/* @__PURE__ */
|
|
3083
|
+
/* @__PURE__ */ jsx69(IconButton, { icon: "close", label: "Dismiss notification", size: "xs", onClick: () => toastStore.dismiss(toast.id) })
|
|
2872
3084
|
]
|
|
2873
3085
|
}
|
|
2874
3086
|
);
|
|
2875
3087
|
}
|
|
2876
3088
|
function Toaster({ label = "Notifications" }) {
|
|
2877
3089
|
const list = useSyncExternalStore(toastStore.subscribe, toastStore.get, () => EMPTY);
|
|
2878
|
-
return /* @__PURE__ */
|
|
3090
|
+
return /* @__PURE__ */ jsx69("section", { "aria-label": label, className: "pointer-events-none fixed inset-x-0 bottom-0 z-50 p-space-md md:inset-x-auto md:right-0 md:w-96", children: /* @__PURE__ */ jsx69("div", { "aria-live": "polite", "aria-relevant": "additions", children: /* @__PURE__ */ jsx69("ol", { className: "flex flex-col gap-space-xs", children: list.map((t) => /* @__PURE__ */ jsx69(ToastItem, { toast: t }, t.id)) }) }) });
|
|
2879
3091
|
}
|
|
2880
3092
|
|
|
2881
3093
|
// src/components/CommandPalette.tsx
|
|
2882
|
-
import { useEffect as useEffect10, useId as useId15, useRef as
|
|
2883
|
-
import { createPortal as
|
|
2884
|
-
import { jsx as
|
|
3094
|
+
import { useEffect as useEffect10, useId as useId15, useRef as useRef14, useState as useState12 } from "react";
|
|
3095
|
+
import { createPortal as createPortal5 } from "react-dom";
|
|
3096
|
+
import { jsx as jsx70, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
2885
3097
|
function CommandPalette({ open, onClose, query, onQueryChange, groups, placeholder = "Search\u2026", emptyText = "No results", label = "Command palette", ...rest }) {
|
|
2886
3098
|
const base = useId15();
|
|
2887
3099
|
const theme = useThemeTone();
|
|
2888
|
-
const panelRef =
|
|
2889
|
-
const inputRef =
|
|
3100
|
+
const panelRef = useRef14(null);
|
|
3101
|
+
const inputRef = useRef14(null);
|
|
2890
3102
|
const [activeId, setActiveId] = useState12(null);
|
|
2891
3103
|
useModal({ open, onClose, panelRef, initialFocusRef: inputRef });
|
|
2892
3104
|
const flat = groups.flatMap((g) => g.items);
|
|
@@ -2913,8 +3125,8 @@ function CommandPalette({ open, onClose, query, onQueryChange, groups, placehold
|
|
|
2913
3125
|
};
|
|
2914
3126
|
if (!open || typeof document === "undefined") return null;
|
|
2915
3127
|
const listId = `${base}-list`;
|
|
2916
|
-
return
|
|
2917
|
-
/* @__PURE__ */
|
|
3128
|
+
return createPortal5(
|
|
3129
|
+
/* @__PURE__ */ jsx70(
|
|
2918
3130
|
"div",
|
|
2919
3131
|
{
|
|
2920
3132
|
"data-theme": theme,
|
|
@@ -2934,8 +3146,8 @@ function CommandPalette({ open, onClose, query, onQueryChange, groups, placehold
|
|
|
2934
3146
|
className: "flex max-h-[80vh] w-full min-w-0 max-w-xl flex-col overflow-hidden rounded-xl border border-border-subtle bg-surface-elevated text-on-surface shadow-md outline-none",
|
|
2935
3147
|
children: [
|
|
2936
3148
|
/* @__PURE__ */ jsxs52("div", { className: "flex items-center gap-space-sm border-b border-border-subtle px-space-md", children: [
|
|
2937
|
-
/* @__PURE__ */
|
|
2938
|
-
/* @__PURE__ */
|
|
3149
|
+
/* @__PURE__ */ jsx70(Icon, { name: "search", tone: "muted" }),
|
|
3150
|
+
/* @__PURE__ */ jsx70(
|
|
2939
3151
|
"input",
|
|
2940
3152
|
{
|
|
2941
3153
|
ref: inputRef,
|
|
@@ -2957,9 +3169,9 @@ function CommandPalette({ open, onClose, query, onQueryChange, groups, placehold
|
|
|
2957
3169
|
)
|
|
2958
3170
|
] }),
|
|
2959
3171
|
/* @__PURE__ */ jsxs52("div", { id: listId, role: "listbox", "aria-label": label, className: "min-h-0 flex-1 overflow-y-auto p-space-2xs", children: [
|
|
2960
|
-
flat.length === 0 && /* @__PURE__ */
|
|
3172
|
+
flat.length === 0 && /* @__PURE__ */ jsx70("p", { className: "px-space-sm py-space-md text-center font-body-sm text-body-sm text-on-surface-variant", children: emptyText }),
|
|
2961
3173
|
groups.map((g, gi) => /* @__PURE__ */ jsxs52("div", { role: "group", "aria-labelledby": `${base}-g${gi}`, children: [
|
|
2962
|
-
/* @__PURE__ */
|
|
3174
|
+
/* @__PURE__ */ jsx70("p", { id: `${base}-g${gi}`, className: "px-space-sm pb-space-2xs pt-space-sm font-label-mono text-label-mono uppercase text-on-surface-variant", children: g.label }),
|
|
2963
3175
|
g.items.map((item) => {
|
|
2964
3176
|
const isActive = item === active;
|
|
2965
3177
|
return /* @__PURE__ */ jsxs52(
|
|
@@ -2973,9 +3185,9 @@ function CommandPalette({ open, onClose, query, onQueryChange, groups, placehold
|
|
|
2973
3185
|
onClick: () => select(item),
|
|
2974
3186
|
className: cx("flex min-w-0 cursor-pointer items-center gap-space-sm rounded-lg px-space-sm py-space-xs font-body-md text-body-md max-md:min-h-11", isActive ? "bg-surface-muted text-ink" : "text-on-surface"),
|
|
2975
3187
|
children: [
|
|
2976
|
-
item.icon && /* @__PURE__ */
|
|
2977
|
-
/* @__PURE__ */
|
|
2978
|
-
item.meta && /* @__PURE__ */
|
|
3188
|
+
item.icon && /* @__PURE__ */ jsx70(Icon, { name: item.icon, size: "sm", tone: "muted" }),
|
|
3189
|
+
/* @__PURE__ */ jsx70("span", { className: "min-w-0 flex-1 truncate", children: item.label }),
|
|
3190
|
+
item.meta && /* @__PURE__ */ jsx70("span", { className: "shrink-0 font-label-mono text-label-mono text-on-surface-variant", children: item.meta })
|
|
2979
3191
|
]
|
|
2980
3192
|
},
|
|
2981
3193
|
item.id
|
|
@@ -2993,11 +3205,11 @@ function CommandPalette({ open, onClose, query, onQueryChange, groups, placehold
|
|
|
2993
3205
|
}
|
|
2994
3206
|
|
|
2995
3207
|
// src/primitives/Show.tsx
|
|
2996
|
-
import { jsx as
|
|
2997
|
-
var ABOVE = { sm: "hidden sm:contents", md: "hidden md:contents", lg: "hidden lg:contents", xl: "hidden xl:contents" };
|
|
2998
|
-
var BELOW = { sm: "contents sm:hidden", md: "contents md:hidden", lg: "contents lg:hidden", xl: "contents xl:hidden" };
|
|
3208
|
+
import { jsx as jsx71 } from "react/jsx-runtime";
|
|
3209
|
+
var ABOVE = { sm: "hidden sm:contents", md: "hidden md:contents", lg: "hidden lg:contents", xl: "hidden xl:contents", "2xl": "hidden 2xl:contents" };
|
|
3210
|
+
var BELOW = { sm: "contents sm:hidden", md: "contents md:hidden", lg: "contents lg:hidden", xl: "contents xl:hidden", "2xl": "contents 2xl:hidden" };
|
|
2999
3211
|
function Show({ above, below, children, ...rest }) {
|
|
3000
|
-
return /* @__PURE__ */
|
|
3212
|
+
return /* @__PURE__ */ jsx71("div", { ...rest, className: cx(above && ABOVE[above], below && BELOW[below]), children });
|
|
3001
3213
|
}
|
|
3002
3214
|
export {
|
|
3003
3215
|
AppBar,
|
|
@@ -3033,7 +3245,9 @@ export {
|
|
|
3033
3245
|
EmptyState,
|
|
3034
3246
|
Eyebrow,
|
|
3035
3247
|
FileTree,
|
|
3248
|
+
FullScreen,
|
|
3036
3249
|
Grid,
|
|
3250
|
+
GridItem,
|
|
3037
3251
|
Heading,
|
|
3038
3252
|
Icon,
|
|
3039
3253
|
IconButton,
|