lldlab-ui 0.2.0 → 0.3.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 +50 -1
- package/dist/index.d.ts +247 -75
- package/dist/index.js +303 -126
- 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,27 @@ 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
|
+
};
|
|
84
105
|
|
|
85
106
|
// src/primitives/Box.tsx
|
|
86
107
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
@@ -89,6 +110,7 @@ var SURFACE_TONE = {
|
|
|
89
110
|
subtle: "bg-surface-subtle text-on-surface",
|
|
90
111
|
elevated: "bg-surface-elevated text-on-surface",
|
|
91
112
|
low: "bg-surface-container-low text-on-surface",
|
|
113
|
+
container: "bg-surface-container text-on-surface",
|
|
92
114
|
inverse: "bg-brand-obsidian text-on-primary"
|
|
93
115
|
};
|
|
94
116
|
var RADIUS = { none: "", sm: "rounded", md: "rounded-lg", lg: "rounded-xl" };
|
|
@@ -142,6 +164,10 @@ function Grid({ as, cols = 1, gap = "md", ...rest }) {
|
|
|
142
164
|
const c = typeof cols === "object" ? { base: 1, ...cols } : { base: 1, md: cols };
|
|
143
165
|
return /* @__PURE__ */ jsx4(C, { ...rest, className: cx("grid min-w-0", responsive(COLS, c), responsive(GAP, gap)) });
|
|
144
166
|
}
|
|
167
|
+
function GridItem({ as, span, ...rest }) {
|
|
168
|
+
const C = as ?? "div";
|
|
169
|
+
return /* @__PURE__ */ jsx4(C, { ...rest, className: cx("min-w-0", responsive(COL_SPAN, span)) });
|
|
170
|
+
}
|
|
145
171
|
|
|
146
172
|
// src/primitives/Container.tsx
|
|
147
173
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
@@ -153,26 +179,38 @@ function Container({ as, size = "xl", ...rest }) {
|
|
|
153
179
|
|
|
154
180
|
// src/primitives/Section.tsx
|
|
155
181
|
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 }) {
|
|
182
|
+
var PADDING2 = { none: "", md: "py-section-md", lg: "py-section-lg", xl: "py-section-xl" };
|
|
183
|
+
var PATTERN = { none: "", dots: "bg-pattern-dots", "dots-brand": "bg-pattern-dots-brand", grid: "bg-pattern-grid" };
|
|
184
|
+
function Section({ as, tone, padding = "lg", paddingTop, paddingBottom, pattern = "none", ...rest }) {
|
|
185
|
+
const fixed = paddingTop !== void 0 || paddingBottom !== void 0;
|
|
159
186
|
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]) });
|
|
187
|
+
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
188
|
}
|
|
162
189
|
|
|
163
190
|
// src/primitives/Split.tsx
|
|
164
191
|
import { jsx as jsx7, jsxs } from "react/jsx-runtime";
|
|
165
|
-
var MAIN = {
|
|
166
|
-
|
|
192
|
+
var MAIN = {
|
|
193
|
+
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" },
|
|
194
|
+
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" }
|
|
195
|
+
};
|
|
196
|
+
var ASIDE = {
|
|
197
|
+
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" },
|
|
198
|
+
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" }
|
|
199
|
+
};
|
|
200
|
+
var GRID = { lg: "lg:grid-cols-12", xl: "xl:grid-cols-12" };
|
|
167
201
|
var STICKY_ASIDE = {
|
|
168
202
|
none: "xl:sticky xl:top-space-lg xl:self-start",
|
|
169
203
|
appbar: "xl:sticky xl:top-[calc(var(--spacing-appbar)+1rem)] xl:self-start"
|
|
170
204
|
};
|
|
205
|
+
var STICKY_ASIDE_LG = {
|
|
206
|
+
none: "lg:sticky lg:top-space-lg lg:self-start",
|
|
207
|
+
appbar: "lg:sticky lg:top-[calc(var(--spacing-appbar)+1rem)] lg:self-start"
|
|
208
|
+
};
|
|
171
209
|
var STICKY_START = {
|
|
172
210
|
none: "lg:sticky lg:top-space-lg lg:self-start",
|
|
173
211
|
appbar: "lg:sticky lg:top-[calc(var(--spacing-appbar)+1rem)] lg:self-start"
|
|
174
212
|
};
|
|
175
|
-
function Split({ ratio = "8/4", aside, start, sticky, stickyOffset = "none", gap = "lg", children, ...rest }) {
|
|
213
|
+
function Split({ ratio = "8/4", breakpoint = "xl", asideAs = "aside", aside, start, sticky, stickyOffset = "none", gap = "lg", children, ...rest }) {
|
|
176
214
|
if (start) {
|
|
177
215
|
return /* @__PURE__ */ jsxs("div", { ...rest, className: cx("grid min-w-0 grid-cols-1 lg:grid-cols-12", responsive(GAP, gap)), children: [
|
|
178
216
|
/* @__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 +218,10 @@ function Split({ ratio = "8/4", aside, start, sticky, stickyOffset = "none", gap
|
|
|
180
218
|
/* @__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
219
|
] });
|
|
182
220
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
/* @__PURE__ */ jsx7("
|
|
221
|
+
const Side = asideAs;
|
|
222
|
+
return /* @__PURE__ */ jsxs("div", { ...rest, className: cx("grid min-w-0 grid-cols-1", GRID[breakpoint], responsive(GAP, gap)), children: [
|
|
223
|
+
/* @__PURE__ */ jsx7("div", { className: cx("min-w-0", MAIN[breakpoint][ratio]), children }),
|
|
224
|
+
/* @__PURE__ */ jsx7(Side, { className: cx("min-w-0", ASIDE[breakpoint][ratio], sticky && (breakpoint === "lg" ? STICKY_ASIDE_LG : STICKY_ASIDE)[stickyOffset]), children: aside })
|
|
186
225
|
] });
|
|
187
226
|
}
|
|
188
227
|
|
|
@@ -207,7 +246,7 @@ var DOT_TONE = {
|
|
|
207
246
|
|
|
208
247
|
// src/components/Icon.tsx
|
|
209
248
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
210
|
-
var SIZE2 = { sm: "text-[16px]", md: "text-[20px]", lg: "text-[24px]", xl: "text-[32px]" };
|
|
249
|
+
var SIZE2 = { xs: "text-[14px]", sm: "text-[16px]", ms: "text-[18px]", md: "text-[20px]", lg: "text-[24px]", xl: "text-[32px]" };
|
|
211
250
|
function Icon({ name, size = "md", tone = "inherit", filled, spin, label, ...rest }) {
|
|
212
251
|
return /* @__PURE__ */ jsx8(
|
|
213
252
|
"span",
|
|
@@ -230,7 +269,7 @@ function Icon({ name, size = "md", tone = "inherit", filled, spin, label, ...res
|
|
|
230
269
|
|
|
231
270
|
// src/components/Dot.tsx
|
|
232
271
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
233
|
-
var SIZE3 = { sm: "size-1.5", md: "size-2" };
|
|
272
|
+
var SIZE3 = { sm: "size-1.5", md: "size-2", lg: "size-3" };
|
|
234
273
|
function Dot({ tone = "neutral", size = "sm", pulse, ...rest }) {
|
|
235
274
|
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
275
|
}
|
|
@@ -259,6 +298,7 @@ function Text({
|
|
|
259
298
|
align,
|
|
260
299
|
measure,
|
|
261
300
|
uppercase,
|
|
301
|
+
underline,
|
|
262
302
|
...rest
|
|
263
303
|
}) {
|
|
264
304
|
const C = as ?? "p";
|
|
@@ -276,7 +316,8 @@ function Text({
|
|
|
276
316
|
clamp2 && CLAMP[clamp2],
|
|
277
317
|
align && ALIGN2[align],
|
|
278
318
|
measure && "max-w-prose",
|
|
279
|
-
upper && "uppercase"
|
|
319
|
+
upper && "uppercase",
|
|
320
|
+
underline === "wavy" && "underline decoration-wavy decoration-2 decoration-brand-crimson/30 underline-offset-4"
|
|
280
321
|
)
|
|
281
322
|
}
|
|
282
323
|
);
|
|
@@ -296,13 +337,13 @@ var TONE = {
|
|
|
296
337
|
warning: "text-fg-warning"
|
|
297
338
|
};
|
|
298
339
|
var ALIGN3 = { start: "", center: "text-center" };
|
|
299
|
-
function Heading({ level, size, tone = "default", truncate, align = "start", ...rest }) {
|
|
340
|
+
function Heading({ level, size, tone = "default", truncate, align = "start", balance = true, leading, ...rest }) {
|
|
300
341
|
const C = TAG[level];
|
|
301
342
|
return /* @__PURE__ */ jsx11(
|
|
302
343
|
C,
|
|
303
344
|
{
|
|
304
345
|
...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])
|
|
346
|
+
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
347
|
}
|
|
307
348
|
);
|
|
308
349
|
}
|
|
@@ -310,12 +351,15 @@ function Heading({ level, size, tone = "default", truncate, align = "start", ...
|
|
|
310
351
|
// src/primitives/Eyebrow.tsx
|
|
311
352
|
import { jsx as jsx12, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
312
353
|
var VARIANT2 = {
|
|
313
|
-
pill: "rounded-full
|
|
354
|
+
pill: "rounded-full bg-surface-elevated shadow-sm px-space-sm py-space-2xs",
|
|
355
|
+
tinted: "rounded-full bg-surface-container px-space-sm py-space-2xs",
|
|
314
356
|
plain: ""
|
|
315
357
|
};
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
358
|
+
var TEXT = { neutral: "text-on-surface-variant", brand: "text-fg-brand", success: "text-fg-success", warning: "text-fg-warning", danger: "text-fg-danger" };
|
|
359
|
+
function Eyebrow({ tone = "brand", pulse, variant = "pill", dot = true, children, ...rest }) {
|
|
360
|
+
const text = variant === "tinted" && tone === "brand" ? "text-badge-intermediate-text" : TEXT[tone];
|
|
361
|
+
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: [
|
|
362
|
+
dot && /* @__PURE__ */ jsx12(Dot, { tone, pulse, "data-dot": "" }),
|
|
319
363
|
/* @__PURE__ */ jsx12("span", { className: "truncate", children })
|
|
320
364
|
] });
|
|
321
365
|
}
|
|
@@ -423,7 +467,7 @@ function Highlighted({ code, language, numbered }) {
|
|
|
423
467
|
const tokens = useTokenize({ prism: Prism, code, grammar: Prism.languages[language], language });
|
|
424
468
|
return /* @__PURE__ */ jsx14(Lines, { numbered, lines: tokens.map((line) => line.map((t) => ({ content: t.content, className: tokenClass(t.types) }))) });
|
|
425
469
|
}
|
|
426
|
-
function CodeBlock({ language, highlight, title, meta, actions, lineNumbers, tone = "dark", children, ...rest }) {
|
|
470
|
+
function CodeBlock({ language, highlight, title, meta, actions, lineNumbers, tone = "dark", bare, children, ...rest }) {
|
|
427
471
|
const t = TONE2[tone];
|
|
428
472
|
const code = typeof children === "string" ? children.replace(/\n$/, "") : null;
|
|
429
473
|
const lang = highlight && code !== null ? resolveLanguage(language) : void 0;
|
|
@@ -431,8 +475,8 @@ function CodeBlock({ language, highlight, title, meta, actions, lineNumbers, ton
|
|
|
431
475
|
let body = children;
|
|
432
476
|
if (code !== null && lang) body = /* @__PURE__ */ jsx14(Highlighted, { code, language: lang, numbered: lineNumbers });
|
|
433
477
|
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: [
|
|
478
|
+
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: [
|
|
479
|
+
!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
480
|
heading && /* @__PURE__ */ jsx14("span", { className: cx("min-w-0 truncate", !title && "uppercase"), children: heading }),
|
|
437
481
|
meta,
|
|
438
482
|
actions && /* @__PURE__ */ jsx14("span", { className: "ml-auto flex shrink-0 items-center gap-space-xs", children: actions })
|
|
@@ -441,7 +485,7 @@ function CodeBlock({ language, highlight, title, meta, actions, lineNumbers, ton
|
|
|
441
485
|
"pre",
|
|
442
486
|
{
|
|
443
487
|
tabIndex: 0,
|
|
444
|
-
className: "overflow-x-auto
|
|
488
|
+
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
489
|
children: /* @__PURE__ */ jsx14("code", { className: lineNumbers ? "table" : void 0, children: body })
|
|
446
490
|
}
|
|
447
491
|
)
|
|
@@ -489,15 +533,18 @@ function Markdown({ children, ...rest }) {
|
|
|
489
533
|
import { jsx as jsx16, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
490
534
|
var TONE3 = {
|
|
491
535
|
neutral: "bg-surface-muted text-on-surface-variant",
|
|
536
|
+
subtle: "bg-surface-subtle text-on-surface",
|
|
537
|
+
container: "bg-surface-container text-secondary",
|
|
492
538
|
brand: "bg-ink text-on-ink",
|
|
493
539
|
success: "bg-badge-beginner-bg text-badge-beginner-text",
|
|
494
540
|
warning: "bg-badge-amber-bg text-badge-amber-text",
|
|
495
541
|
danger: "bg-badge-advanced-bg text-badge-advanced-text",
|
|
496
542
|
info: "bg-badge-intermediate-bg text-badge-intermediate-text"
|
|
497
543
|
};
|
|
498
|
-
var SIZE4 = { sm: "px-space-xs py-space-2xs", md: "px-space-sm py-space-xs" };
|
|
499
|
-
|
|
500
|
-
|
|
544
|
+
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" };
|
|
545
|
+
var SHAPE = { square: "rounded", pill: "rounded-full" };
|
|
546
|
+
function Badge({ tone = "neutral", uppercase, size = "sm", shape = "square", outlined, icon, dot, pulse, children, ...rest }) {
|
|
547
|
+
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
548
|
dot && /* @__PURE__ */ jsx16(Dot, { tone: dot, pulse }),
|
|
502
549
|
icon && /* @__PURE__ */ jsx16(Icon, { name: icon, size: "sm" }),
|
|
503
550
|
/* @__PURE__ */ jsx16("span", { className: "min-w-0 truncate", children })
|
|
@@ -535,12 +582,14 @@ function Chip({ tone = "neutral", icon, dot, onRemove, children, ...rest }) {
|
|
|
535
582
|
|
|
536
583
|
// src/components/Stat.tsx
|
|
537
584
|
import { jsx as jsx18, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
585
|
+
var ICON_TONE = { muted: "text-on-surface-variant", brand: "text-brand-cobalt", success: "text-brand-emerald", warning: "text-brand-amber", danger: "text-brand-crimson" };
|
|
586
|
+
var VARIANT3 = { plain: "gap-space-sm", tile: "gap-space-xs rounded-lg bg-surface-subtle px-space-md py-space-xs shadow-sm" };
|
|
587
|
+
function Stat({ icon, label, value, variant = "plain", iconTone = "muted", ...rest }) {
|
|
588
|
+
return /* @__PURE__ */ jsxs6("div", { ...rest, className: cx("flex min-w-0 items-center", VARIANT3[variant]), children: [
|
|
589
|
+
/* @__PURE__ */ jsx18("span", { className: ICON_TONE[iconTone], children: /* @__PURE__ */ jsx18(Icon, { name: icon, tone: "inherit" }) }),
|
|
541
590
|
/* @__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 })
|
|
591
|
+
/* @__PURE__ */ jsx18("p", { className: "truncate font-label-mono text-label-mono uppercase leading-none text-on-surface-variant", children: label }),
|
|
592
|
+
/* @__PURE__ */ jsx18("p", { className: "mt-space-2xs truncate font-display text-headline-sm leading-none text-ink", children: value })
|
|
544
593
|
] })
|
|
545
594
|
] });
|
|
546
595
|
}
|
|
@@ -594,7 +643,7 @@ var FILLED = {
|
|
|
594
643
|
};
|
|
595
644
|
var SIZE6 = { sm: "size-8", md: "size-10", lg: "size-12", xl: "size-14" };
|
|
596
645
|
var ICON_SIZE = { sm: "sm", md: "md", lg: "lg", xl: "xl" };
|
|
597
|
-
var
|
|
646
|
+
var SHAPE2 = { square: "rounded-lg", circle: "rounded-full" };
|
|
598
647
|
function IconTile({ icon, tone = "neutral", size = "md", shape = "square", filled, label, ...rest }) {
|
|
599
648
|
return /* @__PURE__ */ jsx20(
|
|
600
649
|
"span",
|
|
@@ -603,7 +652,7 @@ function IconTile({ icon, tone = "neutral", size = "md", shape = "square", fille
|
|
|
603
652
|
role: label ? "img" : void 0,
|
|
604
653
|
"aria-label": label,
|
|
605
654
|
"aria-hidden": label ? void 0 : true,
|
|
606
|
-
className: cx("inline-flex shrink-0 items-center justify-center", filled ? FILLED[tone] : TONE6[tone], SIZE6[size],
|
|
655
|
+
className: cx("inline-flex shrink-0 items-center justify-center", filled ? FILLED[tone] : TONE6[tone], SIZE6[size], SHAPE2[shape]),
|
|
607
656
|
children: /* @__PURE__ */ jsx20(Icon, { name: icon, size: ICON_SIZE[size], filled })
|
|
608
657
|
}
|
|
609
658
|
);
|
|
@@ -618,13 +667,13 @@ var ACCENT = {
|
|
|
618
667
|
warning: "border-b-2 border-b-brand-amber",
|
|
619
668
|
danger: "border-b-2 border-b-brand-crimson"
|
|
620
669
|
};
|
|
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: [
|
|
670
|
+
function SectionHeader({ title, level = 2, dot, tag, tagTone = "neutral", meta, description, icon, accent, size = "sm", divider = true, metaUppercase = true, ...rest }) {
|
|
671
|
+
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
672
|
icon && /* @__PURE__ */ jsx21(IconTile, { icon, size: "sm", tone: accent ?? "neutral" }),
|
|
624
|
-
dot && /* @__PURE__ */ jsx21(Dot, { tone: dot, size: "md" }),
|
|
673
|
+
dot && /* @__PURE__ */ jsx21(Dot, { tone: dot, size: divider ? "md" : "lg" }),
|
|
625
674
|
/* @__PURE__ */ jsx21(Heading, { level, size, children: title }),
|
|
626
675
|
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
|
|
676
|
+
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
677
|
description && /* @__PURE__ */ jsx21("p", { className: "basis-full font-body-sm text-body-sm text-on-surface-variant wrap-break-word", children: description })
|
|
629
678
|
] });
|
|
630
679
|
}
|
|
@@ -659,10 +708,10 @@ var STATUS = {
|
|
|
659
708
|
warning: { icon: "warning", tone: "warning", label: "Warning" },
|
|
660
709
|
pending: { icon: "schedule", tone: "muted", label: "Pending" }
|
|
661
710
|
};
|
|
662
|
-
var
|
|
711
|
+
var VARIANT4 = { plain: "items-start py-space-sm", boxed: "items-center rounded bg-surface-subtle p-space-sm" };
|
|
663
712
|
function ResultRow({ status, title, detail, meta, badge, variant = "plain", selected, titleMono, ...rest }) {
|
|
664
713
|
const s = STATUS[status];
|
|
665
|
-
return /* @__PURE__ */ jsxs10("div", { ...rest, className: cx("flex min-w-0
|
|
714
|
+
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
715
|
/* @__PURE__ */ jsx23(Icon, { name: s.icon, tone: s.tone, filled: true, label: s.label }),
|
|
667
716
|
/* @__PURE__ */ jsxs10("div", { className: "min-w-0 flex-1", children: [
|
|
668
717
|
/* @__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 +736,11 @@ var TONE8 = {
|
|
|
687
736
|
default: { tile: "bg-surface-muted text-on-surface-variant", text: "text-on-surface-variant" },
|
|
688
737
|
danger: { tile: "bg-badge-advanced-bg text-badge-advanced-text", text: "text-fg-danger" }
|
|
689
738
|
};
|
|
690
|
-
function EmptyState({ icon = "inbox", title, description, action, media, code, tone = "default", ...rest }) {
|
|
739
|
+
function EmptyState({ icon = "inbox", title, description, action, media, code, tone = "default", headingLevel = 3, ...rest }) {
|
|
691
740
|
const t = TONE8[tone];
|
|
692
741
|
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
742
|
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:
|
|
743
|
+
/* @__PURE__ */ jsx25("div", { className: "w-full min-w-0", children: /* @__PURE__ */ jsx25(Heading, { level: headingLevel, size: headingLevel === 1 ? "lg" : "sm", children: title }) }),
|
|
695
744
|
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
745
|
action
|
|
697
746
|
] });
|
|
@@ -710,19 +759,29 @@ function CheckList({ items, icon = "check", tone = "success", ...rest }) {
|
|
|
710
759
|
import { Children, isValidElement } from "react";
|
|
711
760
|
import { jsx as jsx27, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
712
761
|
var TONE9 = {
|
|
713
|
-
default: "bg-surface-elevated
|
|
714
|
-
subtle: "bg-surface-subtle
|
|
715
|
-
inverse: "bg-brand-obsidian
|
|
762
|
+
default: "bg-surface-elevated text-on-surface",
|
|
763
|
+
subtle: "bg-surface-subtle text-on-surface",
|
|
764
|
+
inverse: "bg-brand-obsidian text-on-primary"
|
|
716
765
|
};
|
|
766
|
+
var SHADOW2 = { none: "", sm: "shadow-sm", md: "shadow-md", xl: "shadow-xl" };
|
|
767
|
+
var BAR_TONE = { default: "bg-surface-subtle", slate: "bg-brand-slate", none: "" };
|
|
768
|
+
var BAR_DENSITY = { md: "px-space-lg py-space-sm", sm: "px-space-md py-space-sm" };
|
|
717
769
|
var PATTERN2 = { none: "", dots: "bg-pattern-dots", grid: "bg-pattern-grid" };
|
|
718
770
|
var ASPECT = { video: "aspect-video", wide: "aspect-[21/9]", square: "aspect-square" };
|
|
719
771
|
var HEIGHT = { sm: "h-30", md: "h-35" };
|
|
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
|
-
|
|
772
|
+
var INVERSE_BAR = "group-data-[tone=inverse]/card:border-white/10 group-data-[tone=inverse]/card:bg-brand-slate";
|
|
773
|
+
function CardHeader({ start, end, children, divider = false, density = "md", tone = "default", ...rest }) {
|
|
774
|
+
return /* @__PURE__ */ jsxs13(
|
|
775
|
+
"div",
|
|
776
|
+
{
|
|
777
|
+
...rest,
|
|
778
|
+
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),
|
|
779
|
+
children: [
|
|
780
|
+
/* @__PURE__ */ jsx27("div", { className: "flex min-w-0 items-center gap-space-sm", children: start ?? children }),
|
|
781
|
+
end && /* @__PURE__ */ jsx27("div", { className: "flex shrink-0 flex-wrap items-center gap-space-sm", children: end })
|
|
782
|
+
]
|
|
783
|
+
}
|
|
784
|
+
);
|
|
726
785
|
}
|
|
727
786
|
function CardMedia({ pattern = "dots", aspect = "video", height, caption, children, ...rest }) {
|
|
728
787
|
return /* @__PURE__ */ jsxs13(
|
|
@@ -737,10 +796,17 @@ function CardMedia({ pattern = "dots", aspect = "video", height, caption, childr
|
|
|
737
796
|
}
|
|
738
797
|
);
|
|
739
798
|
}
|
|
740
|
-
function CardFooter({ children, ...rest }) {
|
|
741
|
-
return /* @__PURE__ */ jsx27(
|
|
799
|
+
function CardFooter({ children, divider = false, density = "md", tone = "default", ...rest }) {
|
|
800
|
+
return /* @__PURE__ */ jsx27(
|
|
801
|
+
"div",
|
|
802
|
+
{
|
|
803
|
+
...rest,
|
|
804
|
+
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),
|
|
805
|
+
children
|
|
806
|
+
}
|
|
807
|
+
);
|
|
742
808
|
}
|
|
743
|
-
function CardRoot({ as, padding = "lg", interactive, tone = "default", pattern = "none", children, ...rest }) {
|
|
809
|
+
function CardRoot({ as, padding = "lg", interactive, tone = "default", pattern = "none", shadow = "sm", outlined, gap = "sm", children, ...rest }) {
|
|
744
810
|
const C = as ?? "div";
|
|
745
811
|
const parts = Children.toArray(children);
|
|
746
812
|
const isType = (t) => (p) => isValidElement(p) && p.type === t;
|
|
@@ -754,11 +820,11 @@ function CardRoot({ as, padding = "lg", interactive, tone = "default", pattern =
|
|
|
754
820
|
...rest,
|
|
755
821
|
"data-tone": tone,
|
|
756
822
|
"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)),
|
|
823
|
+
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], interactive && cx("transition-shadow hover:shadow-md", FOCUS_RING)),
|
|
758
824
|
children: [
|
|
759
825
|
header,
|
|
760
826
|
media,
|
|
761
|
-
/* @__PURE__ */ jsx27("div", { className: cx("flex min-w-0 flex-1 flex-col gap
|
|
827
|
+
/* @__PURE__ */ jsx27("div", { className: cx("flex min-w-0 flex-1 flex-col", responsive(GAP, gap), responsive(PADDING, padding)), children: body }),
|
|
762
828
|
footer
|
|
763
829
|
]
|
|
764
830
|
}
|
|
@@ -768,17 +834,21 @@ var Card = Object.assign(CardRoot, { Header: CardHeader, Media: CardMedia, Foote
|
|
|
768
834
|
|
|
769
835
|
// src/components/Button.tsx
|
|
770
836
|
import { jsx as jsx28, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
771
|
-
var
|
|
837
|
+
var VARIANT5 = {
|
|
772
838
|
primary: "bg-ink text-on-ink shadow-sm hover:bg-ink-hover",
|
|
773
839
|
secondary: "border border-border-subtle bg-surface-elevated text-ink shadow-sm hover:bg-surface-muted",
|
|
774
|
-
|
|
840
|
+
// Stitch's white button: lifted by shadow, no border.
|
|
841
|
+
raised: "bg-surface-elevated text-ink shadow-sm hover:bg-surface-container",
|
|
842
|
+
subtle: "bg-surface-subtle text-on-surface hover:bg-surface-container",
|
|
843
|
+
// Secondary action on a dark surface.
|
|
844
|
+
slate: "bg-brand-slate text-white hover:bg-surface-tint",
|
|
775
845
|
ghost: "bg-transparent text-on-surface hover:bg-surface-muted",
|
|
776
846
|
danger: "bg-danger text-white shadow-sm hover:bg-danger-hover",
|
|
777
847
|
brand: "bg-brand-cobalt text-white shadow-sm hover:bg-brand-cobalt-hover",
|
|
778
848
|
// Crimson call to action (not destructive): #DC2626 keeps white text at AA.
|
|
779
849
|
accent: "bg-brand-crimson-hover text-white shadow-sm hover:bg-danger"
|
|
780
850
|
};
|
|
781
|
-
var SIZE8 = { sm: "h-8 px-space-md", md: "h-10 px-space-lg", lg: "h-12 px-space-lg" };
|
|
851
|
+
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
852
|
function Button({
|
|
783
853
|
as,
|
|
784
854
|
variant = "primary",
|
|
@@ -808,7 +878,7 @@ function Button({
|
|
|
808
878
|
className: cx(
|
|
809
879
|
"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
880
|
"disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
811
|
-
|
|
881
|
+
VARIANT5[variant],
|
|
812
882
|
SIZE8[size],
|
|
813
883
|
FOCUS_RING,
|
|
814
884
|
TOUCH,
|
|
@@ -825,13 +895,13 @@ function Button({
|
|
|
825
895
|
|
|
826
896
|
// src/components/IconButton.tsx
|
|
827
897
|
import { jsx as jsx29, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
828
|
-
var
|
|
898
|
+
var VARIANT6 = {
|
|
829
899
|
ghost: "text-on-surface-variant hover:bg-surface-muted hover:text-on-surface",
|
|
830
|
-
subtle: "bg-surface-subtle text-on-surface hover:bg-surface-
|
|
900
|
+
subtle: "bg-surface-subtle text-on-surface-variant hover:bg-surface-container hover:text-on-surface",
|
|
831
901
|
secondary: "border border-border-subtle bg-surface-elevated text-on-surface hover:bg-surface-muted",
|
|
832
902
|
primary: "bg-ink text-on-ink hover:bg-ink-hover"
|
|
833
903
|
};
|
|
834
|
-
var SIZE9 = { xs: "size-6", sm: "size-8", md: "size-10" };
|
|
904
|
+
var SIZE9 = { xs: "size-6", sm: "size-8", ms: "size-9", md: "size-10" };
|
|
835
905
|
function IconButton({ as, icon, label, variant = "ghost", size = "md", dot, badge, ...rest }) {
|
|
836
906
|
const C = as ?? "button";
|
|
837
907
|
const native = C === "button";
|
|
@@ -845,13 +915,13 @@ function IconButton({ as, icon, label, variant = "ghost", size = "md", dot, badg
|
|
|
845
915
|
title: label,
|
|
846
916
|
className: cx(
|
|
847
917
|
"relative inline-flex shrink-0 items-center justify-center rounded-lg transition-colors disabled:pointer-events-none disabled:opacity-50",
|
|
848
|
-
|
|
918
|
+
VARIANT6[variant],
|
|
849
919
|
SIZE9[size],
|
|
850
920
|
FOCUS_RING,
|
|
851
921
|
TOUCH_ICON
|
|
852
922
|
),
|
|
853
923
|
children: [
|
|
854
|
-
/* @__PURE__ */ jsx29(Icon, { name: icon, size: size === "md" ? "md" : "sm" }),
|
|
924
|
+
/* @__PURE__ */ jsx29(Icon, { name: icon, size: size === "md" ? "md" : size === "ms" ? "ms" : "sm" }),
|
|
855
925
|
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
926
|
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
927
|
]
|
|
@@ -861,21 +931,32 @@ function IconButton({ as, icon, label, variant = "ghost", size = "md", dot, badg
|
|
|
861
931
|
|
|
862
932
|
// src/components/Kbd.tsx
|
|
863
933
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
864
|
-
|
|
865
|
-
|
|
934
|
+
var VARIANT7 = {
|
|
935
|
+
outline: "rounded border border-border-subtle bg-surface-subtle",
|
|
936
|
+
// Lifted keycap for filled fields (the header search).
|
|
937
|
+
raised: "rounded bg-surface-elevated shadow-sm"
|
|
938
|
+
};
|
|
939
|
+
function Kbd({ variant = "outline", children, ...rest }) {
|
|
940
|
+
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
941
|
}
|
|
867
942
|
|
|
868
943
|
// src/components/TextField.tsx
|
|
869
944
|
import { useId as useId2, useState } from "react";
|
|
870
945
|
import { jsx as jsx31, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
871
|
-
var SIZE10 = { sm: "h-8", md: "h-10" };
|
|
872
|
-
var
|
|
873
|
-
|
|
946
|
+
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" };
|
|
947
|
+
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" };
|
|
948
|
+
var WIDTH = { auto: "", full: "w-full", sm: "w-64", md: "w-80", lg: "w-full max-w-xl" };
|
|
949
|
+
var VARIANT8 = {
|
|
950
|
+
outline: "border bg-surface-subtle focus-within:ring-2",
|
|
951
|
+
filled: "bg-surface-subtle hover:bg-surface-container/40 focus-within:ring-1",
|
|
952
|
+
raised: "bg-surface-elevated shadow-sm focus-within:ring-2"
|
|
953
|
+
};
|
|
954
|
+
function TextField({ label, hideLabel, icon, hint, error, labelEnd, revealable, size = "md", variant = "outline", iconPosition = "start", width = "auto", id, type, ...rest }) {
|
|
874
955
|
const generated = useId2();
|
|
875
956
|
const inputId = id ?? generated;
|
|
876
957
|
const errorId = `${inputId}-error`;
|
|
877
958
|
const [shown, setShown] = useState(false);
|
|
878
|
-
return /* @__PURE__ */ jsxs16("div", { className: "flex min-w-0 flex-col gap-space-2xs", children: [
|
|
959
|
+
return /* @__PURE__ */ jsxs16("div", { className: cx("flex min-w-0 flex-col gap-space-2xs", WIDTH[width]), children: [
|
|
879
960
|
/* @__PURE__ */ jsxs16("div", { className: cx("flex min-w-0 items-center justify-between gap-space-sm", hideLabel && !labelEnd && "sr-only"), children: [
|
|
880
961
|
/* @__PURE__ */ jsx31("label", { htmlFor: inputId, className: cx("font-body-sm text-body-sm font-medium text-on-surface", hideLabel && "sr-only"), children: label }),
|
|
881
962
|
labelEnd
|
|
@@ -884,13 +965,14 @@ function TextField({ label, hideLabel, icon, hint, error, labelEnd, revealable,
|
|
|
884
965
|
"div",
|
|
885
966
|
{
|
|
886
967
|
className: cx(
|
|
887
|
-
"flex min-w-0 items-center gap-space-xs rounded-lg
|
|
968
|
+
"flex min-w-0 items-center gap-space-xs rounded-lg focus-within:ring-brand-cobalt",
|
|
969
|
+
VARIANT8[variant],
|
|
888
970
|
SIZE10[size],
|
|
889
|
-
error ? "border-fg-danger" : "border-border-subtle",
|
|
971
|
+
error ? "border border-fg-danger" : variant === "outline" && "border-border-subtle",
|
|
890
972
|
TOUCH
|
|
891
973
|
),
|
|
892
974
|
children: [
|
|
893
|
-
icon && /* @__PURE__ */ jsx31(Icon, { name: icon, size: "sm", tone: "muted" }),
|
|
975
|
+
icon && iconPosition === "start" && /* @__PURE__ */ jsx31(Icon, { name: icon, size: size === "lg" ? "md" : "sm", tone: "muted" }),
|
|
894
976
|
/* @__PURE__ */ jsx31(
|
|
895
977
|
"input",
|
|
896
978
|
{
|
|
@@ -899,11 +981,12 @@ function TextField({ label, hideLabel, icon, hint, error, labelEnd, revealable,
|
|
|
899
981
|
type: revealable ? shown ? "text" : "password" : type,
|
|
900
982
|
"aria-invalid": error ? true : rest["aria-invalid"],
|
|
901
983
|
"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",
|
|
984
|
+
className: cx("h-full min-w-0 flex-1 bg-transparent text-on-surface outline-none placeholder:text-on-surface-variant", TEXT2[size])
|
|
903
985
|
}
|
|
904
986
|
),
|
|
905
987
|
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) })
|
|
988
|
+
revealable && /* @__PURE__ */ jsx31(IconButton, { icon: shown ? "visibility_off" : "visibility", label: "Show password", "aria-pressed": shown, size: "xs", onClick: () => setShown((s) => !s) }),
|
|
989
|
+
icon && iconPosition === "end" && /* @__PURE__ */ jsx31(Icon, { name: icon, size: "sm", tone: "muted" })
|
|
907
990
|
]
|
|
908
991
|
}
|
|
909
992
|
),
|
|
@@ -914,7 +997,9 @@ function TextField({ label, hideLabel, icon, hint, error, labelEnd, revealable,
|
|
|
914
997
|
// src/components/Select.tsx
|
|
915
998
|
import { useId as useId3 } from "react";
|
|
916
999
|
import { jsx as jsx32, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
917
|
-
|
|
1000
|
+
var VARIANT9 = { outline: "border border-border-subtle bg-surface-subtle", raised: "bg-surface-elevated shadow-sm" };
|
|
1001
|
+
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" };
|
|
1002
|
+
function Select({ label, hideLabel, options, variant = "outline", size = "md", id, ...rest }) {
|
|
918
1003
|
const generated = useId3();
|
|
919
1004
|
const selectId = id ?? generated;
|
|
920
1005
|
return /* @__PURE__ */ jsxs17("div", { className: "flex min-w-0 flex-col gap-space-2xs", children: [
|
|
@@ -925,7 +1010,7 @@ function Select({ label, hideLabel, options, id, ...rest }) {
|
|
|
925
1010
|
{
|
|
926
1011
|
...rest,
|
|
927
1012
|
id: selectId,
|
|
928
|
-
className: cx("
|
|
1013
|
+
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
1014
|
children: options.map((o) => /* @__PURE__ */ jsx32("option", { value: o.value, children: o.label }, o.value))
|
|
930
1015
|
}
|
|
931
1016
|
),
|
|
@@ -957,7 +1042,8 @@ function rovingIndex(key, index, count) {
|
|
|
957
1042
|
|
|
958
1043
|
// src/components/Tabs.tsx
|
|
959
1044
|
import { Fragment as Fragment2, jsx as jsx33, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
960
|
-
var
|
|
1045
|
+
var HIDE_BELOW = { sm: "hidden sm:flex", md: "hidden md:flex", lg: "hidden lg:flex", xl: "hidden xl:flex", "2xl": "hidden 2xl:flex" };
|
|
1046
|
+
var VARIANT10 = {
|
|
961
1047
|
underline: {
|
|
962
1048
|
list: "flex min-w-0 max-w-full gap-space-lg overflow-x-auto border-b border-border-subtle [scrollbar-width:none]",
|
|
963
1049
|
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 +1055,58 @@ var VARIANT6 = {
|
|
|
969
1055
|
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
1056
|
active: "bg-surface-elevated text-ink shadow-sm",
|
|
971
1057
|
idle: "text-on-surface-variant hover:text-on-surface"
|
|
1058
|
+
},
|
|
1059
|
+
// Header navigation: icon + label + count pill; active is a cobalt tint.
|
|
1060
|
+
nav: {
|
|
1061
|
+
list: "flex min-w-0 max-w-full items-center gap-space-xs overflow-x-auto [scrollbar-width:none]",
|
|
1062
|
+
// One weight for every item: a bolder active item would widen and shift its neighbours.
|
|
1063
|
+
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",
|
|
1064
|
+
active: "bg-surface-container/60 text-brand-cobalt",
|
|
1065
|
+
idle: "text-on-surface-variant hover:bg-surface-subtle hover:text-on-surface"
|
|
1066
|
+
},
|
|
1067
|
+
// Filter chips: separate buttons, active filled with ink, dot leading.
|
|
1068
|
+
solid: {
|
|
1069
|
+
list: "flex min-w-0 max-w-full gap-space-xs overflow-x-auto pb-space-2xs [scrollbar-width:none]",
|
|
1070
|
+
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",
|
|
1071
|
+
active: "bg-ink text-on-ink shadow-sm",
|
|
1072
|
+
idle: "bg-surface-subtle text-on-surface-variant hover:bg-surface-container hover:text-on-surface"
|
|
1073
|
+
},
|
|
1074
|
+
// Workspace tabs: mono caps, cobalt underline on the active tab, no rule under the list.
|
|
1075
|
+
label: {
|
|
1076
|
+
list: "flex min-w-0 max-w-full gap-space-md overflow-x-auto [scrollbar-width:none]",
|
|
1077
|
+
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",
|
|
1078
|
+
active: "border-brand-cobalt text-fg-brand",
|
|
1079
|
+
idle: "border-transparent text-on-surface-variant hover:text-on-surface"
|
|
972
1080
|
}
|
|
973
1081
|
};
|
|
974
|
-
|
|
1082
|
+
var DISABLED = "cursor-not-allowed opacity-60";
|
|
1083
|
+
function TabBody({ item, variant, active }) {
|
|
1084
|
+
const leadingDot = variant === "solid";
|
|
1085
|
+
let count = null;
|
|
1086
|
+
if (item.count !== void 0) {
|
|
1087
|
+
if (variant === "nav") count = /* @__PURE__ */ jsx33(Badge, { shape: "pill", tone: item.countTone ?? "info", children: item.count });
|
|
1088
|
+
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 });
|
|
1089
|
+
else count = /* @__PURE__ */ jsx33(Badge, { children: item.count });
|
|
1090
|
+
}
|
|
975
1091
|
return /* @__PURE__ */ jsxs18(Fragment2, { children: [
|
|
1092
|
+
item.dot && leadingDot && /* @__PURE__ */ jsx33(Dot, { tone: item.dot, size: "md" }),
|
|
1093
|
+
item.icon && /* @__PURE__ */ jsx33(Icon, { name: item.icon, size: "ms" }),
|
|
976
1094
|
item.label,
|
|
977
|
-
|
|
978
|
-
item.badge,
|
|
979
|
-
item.dot && /* @__PURE__ */ jsx33(Dot, { tone: item.dot })
|
|
1095
|
+
count,
|
|
1096
|
+
item.badge && (typeof item.badge === "string" ? /* @__PURE__ */ jsx33(Badge, { size: "xs", tone: "subtle", uppercase: true, children: item.badge }) : item.badge),
|
|
1097
|
+
item.dot && !leadingDot && /* @__PURE__ */ jsx33(Dot, { tone: item.dot })
|
|
980
1098
|
] });
|
|
981
1099
|
}
|
|
982
1100
|
function Tabs({ items, value, onChange, variant = "underline", label, ...rest }) {
|
|
983
1101
|
const baseId = useId4();
|
|
984
1102
|
const refs = useRef([]);
|
|
985
1103
|
if (!items.length) return null;
|
|
986
|
-
const v =
|
|
1104
|
+
const v = VARIANT10[variant];
|
|
987
1105
|
if (items.some((i) => i.href)) {
|
|
988
1106
|
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
1107
|
const C = item.as ?? "a";
|
|
990
1108
|
const active = item.id === value;
|
|
991
|
-
return /* @__PURE__ */ jsx33("li", { className: "
|
|
1109
|
+
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
1110
|
}) }) });
|
|
993
1111
|
}
|
|
994
1112
|
const activeIndex = Math.max(0, items.findIndex((i) => i.id === value));
|
|
@@ -1013,10 +1131,12 @@ function Tabs({ items, value, onChange, variant = "underline", label, ...rest })
|
|
|
1013
1131
|
"aria-controls": item.panelId,
|
|
1014
1132
|
"aria-selected": active,
|
|
1015
1133
|
tabIndex: active ? 0 : -1,
|
|
1134
|
+
disabled: item.disabled,
|
|
1135
|
+
title: item.title,
|
|
1016
1136
|
onClick: () => onChange?.(item.id),
|
|
1017
1137
|
onKeyDown: (e) => onKeyDown(e, i),
|
|
1018
|
-
className: cx(v.tab, active ? v.active : v.idle, FOCUS_RING, TOUCH),
|
|
1019
|
-
children: /* @__PURE__ */ jsx33(TabBody, { item })
|
|
1138
|
+
className: cx(v.tab, active ? v.active : v.idle, item.disabled && DISABLED, FOCUS_RING, TOUCH),
|
|
1139
|
+
children: /* @__PURE__ */ jsx33(TabBody, { item, variant, active })
|
|
1020
1140
|
},
|
|
1021
1141
|
item.id
|
|
1022
1142
|
);
|
|
@@ -1029,7 +1149,17 @@ function TabPanel({ id, active, children, ...rest }) {
|
|
|
1029
1149
|
// src/components/SegmentedControl.tsx
|
|
1030
1150
|
import { useRef as useRef2 } from "react";
|
|
1031
1151
|
import { jsx as jsx34, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1032
|
-
|
|
1152
|
+
var TRACK = {
|
|
1153
|
+
default: "rounded-lg border border-border-subtle bg-surface-subtle p-space-2xs",
|
|
1154
|
+
// Compact mono switcher for toolbars (the IDE header).
|
|
1155
|
+
label: ""
|
|
1156
|
+
};
|
|
1157
|
+
var OPTION = {
|
|
1158
|
+
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" },
|
|
1159
|
+
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" }
|
|
1160
|
+
};
|
|
1161
|
+
function SegmentedControl({ label, options, value, onChange, variant = "default", ...rest }) {
|
|
1162
|
+
const opt = OPTION[variant];
|
|
1033
1163
|
const refs = useRef2([]);
|
|
1034
1164
|
const checkedIndex = options.findIndex((o) => o.value === value);
|
|
1035
1165
|
const tabbable = checkedIndex === -1 ? 0 : checkedIndex;
|
|
@@ -1040,7 +1170,7 @@ function SegmentedControl({ label, options, value, onChange, ...rest }) {
|
|
|
1040
1170
|
refs.current[next]?.focus();
|
|
1041
1171
|
onChange(options[next].value);
|
|
1042
1172
|
};
|
|
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
|
|
1173
|
+
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
1174
|
const checked = i === checkedIndex;
|
|
1045
1175
|
return /* @__PURE__ */ jsxs19(
|
|
1046
1176
|
"button",
|
|
@@ -1057,9 +1187,10 @@ function SegmentedControl({ label, options, value, onChange, ...rest }) {
|
|
|
1057
1187
|
onClick: () => onChange(o.value),
|
|
1058
1188
|
onKeyDown: (e) => onKeyDown(e, i),
|
|
1059
1189
|
className: cx(
|
|
1060
|
-
"inline-flex shrink-0 items-center justify-center gap-space-xs whitespace-nowrap
|
|
1061
|
-
|
|
1062
|
-
|
|
1190
|
+
"inline-flex shrink-0 items-center justify-center gap-space-xs whitespace-nowrap transition-colors",
|
|
1191
|
+
opt.base,
|
|
1192
|
+
variant === "default" && (o.hideLabel ? "px-space-xs" : "px-space-sm"),
|
|
1193
|
+
checked ? opt.on : opt.off,
|
|
1063
1194
|
FOCUS_RING,
|
|
1064
1195
|
o.hideLabel ? TOUCH_ICON : TOUCH
|
|
1065
1196
|
),
|
|
@@ -1148,7 +1279,7 @@ function useModal({ open, onClose, panelRef, initialFocusRef }) {
|
|
|
1148
1279
|
|
|
1149
1280
|
// src/components/Dialog.tsx
|
|
1150
1281
|
import { jsx as jsx35, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1151
|
-
var
|
|
1282
|
+
var SIZE12 = { sm: "max-w-sm", md: "max-w-md", lg: "max-w-2xl" };
|
|
1152
1283
|
function Dialog({ open, onClose, title, description, footer, size = "md", children, ...rest }) {
|
|
1153
1284
|
const titleId = useId5();
|
|
1154
1285
|
const descId = useId5();
|
|
@@ -1176,7 +1307,7 @@ function Dialog({ open, onClose, title, description, footer, size = "md", childr
|
|
|
1176
1307
|
"aria-labelledby": titleId,
|
|
1177
1308
|
"aria-describedby": description ? descId : void 0,
|
|
1178
1309
|
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",
|
|
1310
|
+
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
1311
|
children: [
|
|
1181
1312
|
/* @__PURE__ */ jsxs20("div", { className: "min-w-0 pr-space-xl", children: [
|
|
1182
1313
|
/* @__PURE__ */ jsx35("h2", { id: titleId, className: "font-display text-headline-md text-ink wrap-break-word", children: title }),
|
|
@@ -1343,8 +1474,13 @@ function StatusItem({ icon, tone = "default", children, ...rest }) {
|
|
|
1343
1474
|
children
|
|
1344
1475
|
] });
|
|
1345
1476
|
}
|
|
1346
|
-
|
|
1347
|
-
|
|
1477
|
+
var BAR = {
|
|
1478
|
+
default: "h-7 border-t border-border-subtle bg-surface-subtle",
|
|
1479
|
+
// Filled strip without a rule (dark IDE card footer).
|
|
1480
|
+
raised: "h-9 bg-surface-container"
|
|
1481
|
+
};
|
|
1482
|
+
function StatusBarRoot({ start, end, label = "Status", tone = "default", ...rest }) {
|
|
1483
|
+
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
1484
|
/* @__PURE__ */ jsx38("div", { className: "flex min-w-0 items-center gap-space-md overflow-hidden", children: start }),
|
|
1349
1485
|
/* @__PURE__ */ jsx38("div", { className: "flex min-w-0 items-center gap-space-md overflow-hidden", children: end })
|
|
1350
1486
|
] });
|
|
@@ -1354,8 +1490,14 @@ var StatusBar = Object.assign(StatusBarRoot, { Item: StatusItem });
|
|
|
1354
1490
|
// src/ide/MetricTile.tsx
|
|
1355
1491
|
import { jsx as jsx39, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
1356
1492
|
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
|
-
|
|
1493
|
+
function MetricTile({ label, value, tone = "neutral", icon, hint, hintTone = "muted", variant = "default", ...rest }) {
|
|
1494
|
+
if (variant === "centered") {
|
|
1495
|
+
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: [
|
|
1496
|
+
/* @__PURE__ */ jsx39("span", { className: cx("truncate font-display text-headline-lg", TONE11[tone]), children: value }),
|
|
1497
|
+
/* @__PURE__ */ jsx39("span", { className: "truncate font-body-sm text-body-sm text-on-surface-variant", children: label })
|
|
1498
|
+
] });
|
|
1499
|
+
}
|
|
1500
|
+
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
1501
|
/* @__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
1502
|
icon && /* @__PURE__ */ jsx39(Icon, { name: icon, size: "sm" }),
|
|
1361
1503
|
/* @__PURE__ */ jsx39("span", { className: "truncate", children: label })
|
|
@@ -1368,8 +1510,8 @@ function MetricTile({ label, value, tone = "neutral", icon, hint, hintTone = "mu
|
|
|
1368
1510
|
// src/ide/Avatar.tsx
|
|
1369
1511
|
import { useState as useState3 } from "react";
|
|
1370
1512
|
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
|
|
1513
|
+
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" };
|
|
1514
|
+
var SHAPE3 = { circle: "rounded-full", square: "rounded-lg" };
|
|
1373
1515
|
var TONE12 = {
|
|
1374
1516
|
ink: "bg-ink text-on-ink",
|
|
1375
1517
|
brand: "bg-brand-cobalt text-white",
|
|
@@ -1384,7 +1526,7 @@ function Avatar({ name, src, size = "md", shape = "circle", tone = "ink", badge,
|
|
|
1384
1526
|
const [failedSrc, setFailedSrc] = useState3(void 0);
|
|
1385
1527
|
const accessibleName = statusLabel ? `${name}, ${statusLabel}` : name;
|
|
1386
1528
|
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",
|
|
1529
|
+
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
1530
|
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
1531
|
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
1532
|
] });
|
|
@@ -1456,7 +1598,7 @@ function formatClock(totalSeconds) {
|
|
|
1456
1598
|
const m = Math.floor(s % 3600 / 60);
|
|
1457
1599
|
return h > 0 ? `${h}:${pad(m)}:${pad(s % 60)}` : `${pad(m)}:${pad(s % 60)}`;
|
|
1458
1600
|
}
|
|
1459
|
-
function Countdown({ seconds, until, direction = "down", warnAt, onExpire, label = "Time remaining", ...rest }) {
|
|
1601
|
+
function Countdown({ seconds, until, direction = "down", warnAt, onExpire, label = "Time remaining", variant = "plain", ...rest }) {
|
|
1460
1602
|
const [start] = useState4(() => Date.now());
|
|
1461
1603
|
const [now, setNow] = useState4(() => until ? null : start);
|
|
1462
1604
|
const onExpireRef = useRef6(onExpire);
|
|
@@ -1484,10 +1626,23 @@ function Countdown({ seconds, until, direction = "down", warnAt, onExpire, label
|
|
|
1484
1626
|
}
|
|
1485
1627
|
}, [expired]);
|
|
1486
1628
|
const warn = direction === "down" && warnAt !== void 0 && value !== null && value <= warnAt;
|
|
1487
|
-
return /* @__PURE__ */ jsxs27(
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1629
|
+
return /* @__PURE__ */ jsxs27(
|
|
1630
|
+
"span",
|
|
1631
|
+
{
|
|
1632
|
+
...rest,
|
|
1633
|
+
role: "timer",
|
|
1634
|
+
"aria-label": label,
|
|
1635
|
+
className: cx(
|
|
1636
|
+
"inline-flex items-center gap-space-2xs tabular-nums",
|
|
1637
|
+
variant === "chip" ? "rounded bg-surface-subtle px-space-sm py-space-xs font-label-mono text-label-mono" : "font-code-inline text-code-inline",
|
|
1638
|
+
warn ? "text-fg-danger" : "text-on-surface"
|
|
1639
|
+
),
|
|
1640
|
+
children: [
|
|
1641
|
+
/* @__PURE__ */ jsx42("span", { className: variant === "chip" ? "text-fg-brand" : void 0, children: /* @__PURE__ */ jsx42(Icon, { name: "timer", size: "sm", tone: "inherit" }) }),
|
|
1642
|
+
value === null ? "--:--" : formatClock(value)
|
|
1643
|
+
]
|
|
1644
|
+
}
|
|
1645
|
+
);
|
|
1491
1646
|
}
|
|
1492
1647
|
|
|
1493
1648
|
// src/ide/FileTree.tsx
|
|
@@ -1900,7 +2055,7 @@ import { useId as useId9, useRef as useRef9 } from "react";
|
|
|
1900
2055
|
import { createPortal as createPortal2 } from "react-dom";
|
|
1901
2056
|
import { jsx as jsx45, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
1902
2057
|
var SIDE = { left: "left-0 border-r", right: "right-0 border-l" };
|
|
1903
|
-
var
|
|
2058
|
+
var SIZE13 = { sm: "w-[min(85vw,20rem)]", md: "w-[min(90vw,28rem)]" };
|
|
1904
2059
|
function Drawer({ open, onClose, title, side = "left", size = "sm", children, ...rest }) {
|
|
1905
2060
|
const titleId = useId9();
|
|
1906
2061
|
const panelRef = useRef9(null);
|
|
@@ -1926,7 +2081,7 @@ function Drawer({ open, onClose, title, side = "left", size = "sm", children, ..
|
|
|
1926
2081
|
"aria-modal": "true",
|
|
1927
2082
|
"aria-labelledby": titleId,
|
|
1928
2083
|
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],
|
|
2084
|
+
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
2085
|
children: [
|
|
1931
2086
|
/* @__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
2087
|
/* @__PURE__ */ jsx45("h2", { id: titleId, className: "min-w-0 truncate font-display text-headline-sm text-ink", children: title }),
|
|
@@ -1952,7 +2107,7 @@ var TONE13 = {
|
|
|
1952
2107
|
success: "text-fg-success",
|
|
1953
2108
|
warning: "text-fg-warning"
|
|
1954
2109
|
};
|
|
1955
|
-
var
|
|
2110
|
+
var SIZE14 = { sm: "font-body-sm text-body-sm", md: "font-body-md text-body-md" };
|
|
1956
2111
|
var UNDERLINE = { hover: "underline-offset-2 hover:underline", always: "underline underline-offset-2", none: "" };
|
|
1957
2112
|
function TextLink({ as, tone = "brand", size = "md", icon, iconRight, underline = "hover", children, ...rest }) {
|
|
1958
2113
|
const C = as ?? "a";
|
|
@@ -1960,7 +2115,7 @@ function TextLink({ as, tone = "brand", size = "md", icon, iconRight, underline
|
|
|
1960
2115
|
C,
|
|
1961
2116
|
{
|
|
1962
2117
|
...rest,
|
|
1963
|
-
className: cx("inline-flex max-w-full items-center gap-space-2xs rounded font-medium wrap-break-word transition-colors", TONE13[tone],
|
|
2118
|
+
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
2119
|
children: [
|
|
1965
2120
|
icon && /* @__PURE__ */ jsx46(Icon, { name: icon, size: "sm" }),
|
|
1966
2121
|
/* @__PURE__ */ jsx46("span", { className: "min-w-0", children }),
|
|
@@ -2026,8 +2181,9 @@ function AvatarGroup({ children, max, size = "md", label, ...rest }) {
|
|
|
2026
2181
|
import { jsx as jsx49, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
2027
2182
|
var POSITION = { sticky: "sticky top-0", fixed: "fixed inset-x-0 top-0", static: "relative" };
|
|
2028
2183
|
var HEIGHT2 = { sm: "h-12", md: "h-16" };
|
|
2029
|
-
|
|
2030
|
-
|
|
2184
|
+
var DIVIDER = { shadow: "shadow-appbar", border: "border-b border-border-subtle" };
|
|
2185
|
+
function AppBar({ position = "sticky", start, center, end, blur = true, height = "md", contained = true, divider = "shadow", ...rest }) {
|
|
2186
|
+
return /* @__PURE__ */ jsx49("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", HEIGHT2[height], contained && "mx-auto max-w-7xl"), children: [
|
|
2031
2187
|
/* @__PURE__ */ jsx49("div", { className: "flex min-w-0 shrink-0 items-center gap-space-sm", children: start }),
|
|
2032
2188
|
/* @__PURE__ */ jsx49("div", { className: "flex min-w-0 flex-1 items-center justify-center", children: center }),
|
|
2033
2189
|
/* @__PURE__ */ jsx49("div", { className: "flex shrink-0 items-center gap-space-xs", children: end })
|
|
@@ -2036,7 +2192,7 @@ function AppBar({ position = "sticky", start, center, end, blur = true, height =
|
|
|
2036
2192
|
|
|
2037
2193
|
// src/components/NavList.tsx
|
|
2038
2194
|
import { jsx as jsx50, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
2039
|
-
var
|
|
2195
|
+
var VARIANT11 = {
|
|
2040
2196
|
sidebar: {
|
|
2041
2197
|
item: "rounded-lg px-space-sm py-space-xs font-body-md text-body-md",
|
|
2042
2198
|
active: "bg-surface-container-high font-medium text-ink",
|
|
@@ -2049,7 +2205,7 @@ var VARIANT7 = {
|
|
|
2049
2205
|
}
|
|
2050
2206
|
};
|
|
2051
2207
|
function NavList({ label, items, current, heading, variant = "sidebar", ...rest }) {
|
|
2052
|
-
const v =
|
|
2208
|
+
const v = VARIANT11[variant];
|
|
2053
2209
|
return /* @__PURE__ */ jsxs35("nav", { ...rest, "aria-label": label, className: "min-w-0", children: [
|
|
2054
2210
|
heading && /* @__PURE__ */ jsx50("p", { className: "px-space-sm pb-space-xs font-label-mono text-label-mono uppercase text-on-surface-variant", children: heading }),
|
|
2055
2211
|
/* @__PURE__ */ jsx50("ul", { className: "flex min-w-0 flex-col gap-space-2xs", children: items.map((item) => {
|
|
@@ -2127,7 +2283,7 @@ function Pagination({ page, pageCount, onChange, siblingCount = 1, summary, labe
|
|
|
2127
2283
|
import { jsx as jsx52, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
2128
2284
|
var PAD = { compact: "px-space-sm py-space-xs", normal: "px-space-md py-space-sm" };
|
|
2129
2285
|
var ALIGN4 = { start: "text-start", end: "text-end" };
|
|
2130
|
-
var
|
|
2286
|
+
var WIDTH2 = { auto: "", min: "w-px whitespace-nowrap" };
|
|
2131
2287
|
function Table({ caption, showCaption, columns, rows, rowKey, density = "normal", empty, ...rest }) {
|
|
2132
2288
|
return /* @__PURE__ */ jsx52(
|
|
2133
2289
|
"div",
|
|
@@ -2139,8 +2295,8 @@ function Table({ caption, showCaption, columns, rows, rowKey, density = "normal"
|
|
|
2139
2295
|
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
2296
|
children: /* @__PURE__ */ jsxs37("table", { className: "w-full border-collapse font-body-sm text-body-sm text-on-surface", children: [
|
|
2141
2297
|
/* @__PURE__ */ jsx52("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 }),
|
|
2142
|
-
/* @__PURE__ */ jsx52("thead", { className: "bg-surface-subtle", children: /* @__PURE__ */ jsx52("tr", { children: columns.map((c) => /* @__PURE__ */ jsx52("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"],
|
|
2143
|
-
/* @__PURE__ */ jsx52("tbody", { className: "divide-y divide-border-subtle", children: rows.length ? rows.map((row, i) => /* @__PURE__ */ jsx52("tr", { children: columns.map((c) => /* @__PURE__ */ jsx52("td", { className: cx("align-top wrap-break-word", PAD[density], ALIGN4[c.align ?? "start"],
|
|
2298
|
+
/* @__PURE__ */ jsx52("thead", { className: "bg-surface-subtle", children: /* @__PURE__ */ jsx52("tr", { children: columns.map((c) => /* @__PURE__ */ jsx52("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)) }) }),
|
|
2299
|
+
/* @__PURE__ */ jsx52("tbody", { className: "divide-y divide-border-subtle", children: rows.length ? rows.map((row, i) => /* @__PURE__ */ jsx52("tr", { children: columns.map((c) => /* @__PURE__ */ jsx52("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__ */ jsx52("tr", { children: /* @__PURE__ */ jsx52("td", { colSpan: columns.length, className: "px-space-md py-space-lg text-center text-on-surface-variant", children: empty ?? "No rows" }) }) })
|
|
2144
2300
|
] })
|
|
2145
2301
|
}
|
|
2146
2302
|
);
|
|
@@ -2229,8 +2385,8 @@ function Disclosure({ summary, children, open, defaultOpen = false, onOpenChange
|
|
|
2229
2385
|
|
|
2230
2386
|
// src/components/Skeleton.tsx
|
|
2231
2387
|
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
2232
|
-
var
|
|
2233
|
-
var
|
|
2388
|
+
var SHAPE4 = { line: "rounded", pill: "rounded-full", rect: "rounded-xl", circle: "rounded-full aspect-square" };
|
|
2389
|
+
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" };
|
|
2234
2390
|
var HEIGHT3 = { xs: "h-2", sm: "h-3", md: "h-4", lg: "h-8", xl: "h-24" };
|
|
2235
2391
|
var DEFAULT_HEIGHT = { line: "sm", pill: "lg", rect: "xl", circle: "lg" };
|
|
2236
2392
|
function Skeleton({ shape = "line", width = "full", height, lines, ...rest }) {
|
|
@@ -2238,7 +2394,7 @@ function Skeleton({ shape = "line", width = "full", height, lines, ...rest }) {
|
|
|
2238
2394
|
if (lines && lines > 1) {
|
|
2239
2395
|
return /* @__PURE__ */ jsx56("div", { ...rest, "aria-hidden": "true", className: "flex w-full min-w-0 flex-col gap-space-xs", children: Array.from({ length: lines }, (_, i) => /* @__PURE__ */ jsx56("div", { className: cx("skeleton-shimmer rounded", h, i === lines - 1 ? "w-3/4" : "w-full") }, i)) });
|
|
2240
2396
|
}
|
|
2241
|
-
return /* @__PURE__ */ jsx56("div", { ...rest, "aria-hidden": "true", className: cx("skeleton-shimmer shrink-0",
|
|
2397
|
+
return /* @__PURE__ */ jsx56("div", { ...rest, "aria-hidden": "true", className: cx("skeleton-shimmer shrink-0", SHAPE4[shape], h, shape !== "circle" && WIDTH3[width]) });
|
|
2242
2398
|
}
|
|
2243
2399
|
|
|
2244
2400
|
// src/components/TerminalOutput.tsx
|
|
@@ -2300,7 +2456,7 @@ function VerdictBanner({ tone, icon, title, badge, meta, actions, ...rest }) {
|
|
|
2300
2456
|
// src/components/Checkbox.tsx
|
|
2301
2457
|
import { useEffect as useEffect5, useId as useId11, useRef as useRef10 } from "react";
|
|
2302
2458
|
import { jsx as jsx59, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
2303
|
-
function Checkbox({ label, description, strikeWhenChecked, indeterminate, id, ...rest }) {
|
|
2459
|
+
function Checkbox({ label, description, strikeWhenChecked, indeterminate, size = "md", id, ...rest }) {
|
|
2304
2460
|
const generated = useId11();
|
|
2305
2461
|
const inputId = id ?? generated;
|
|
2306
2462
|
const descId = `${inputId}-desc`;
|
|
@@ -2328,7 +2484,7 @@ function Checkbox({ label, description, strikeWhenChecked, indeterminate, id, ..
|
|
|
2328
2484
|
/* @__PURE__ */ jsx59("span", { "aria-hidden": "true", className: "pointer-events-none absolute inset-0 hidden items-center justify-center text-white peer-checked:flex", children: /* @__PURE__ */ jsx59(Icon, { name: "check", size: "sm" }) }),
|
|
2329
2485
|
/* @__PURE__ */ jsx59("span", { "aria-hidden": "true", className: "pointer-events-none absolute inset-0 hidden items-center justify-center text-white peer-indeterminate:flex", children: /* @__PURE__ */ jsx59(Icon, { name: "remove", size: "sm" }) })
|
|
2330
2486
|
] }),
|
|
2331
|
-
/* @__PURE__ */ jsx59("span", { className: cx("min-w-0 font-body-
|
|
2487
|
+
/* @__PURE__ */ jsx59("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
2488
|
] }),
|
|
2333
2489
|
description && /* @__PURE__ */ jsx59("p", { id: descId, className: "pl-6 font-body-sm text-body-sm text-on-surface-variant wrap-break-word", children: description })
|
|
2334
2490
|
] });
|
|
@@ -2509,9 +2665,29 @@ function BarChart({ label, bars, highlight, highlightLabel, axis, height = "md",
|
|
|
2509
2665
|
// src/ide/UmlClass.tsx
|
|
2510
2666
|
import { jsx as jsx65, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
2511
2667
|
var EMPHASIS = { default: "border border-border-strong", brand: "border-2 border-brand-cobalt", strong: "border-2 border-ink" };
|
|
2512
|
-
var
|
|
2513
|
-
|
|
2514
|
-
|
|
2668
|
+
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" } };
|
|
2669
|
+
var HEADER_TONE = { container: "bg-surface-container", info: "bg-badge-intermediate-bg", strong: "bg-surface-container-high" };
|
|
2670
|
+
var STEREO_TONE = { container: "text-secondary", info: "text-badge-intermediate-text", strong: "text-secondary" };
|
|
2671
|
+
function UmlClass({ name, stereotype, attributes = [], methods = [], tag, emphasis = "default", size = "md", dashed, variant = "box", headerTone = "container", columns = 1, ...rest }) {
|
|
2672
|
+
const s = SIZE15[size];
|
|
2673
|
+
if (variant === "tinted") {
|
|
2674
|
+
const strong = headerTone === "strong";
|
|
2675
|
+
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: [
|
|
2676
|
+
/* @__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: [
|
|
2677
|
+
stereotype && /* @__PURE__ */ jsxs48("span", { className: cx("font-label-mono text-label-mono italic", STEREO_TONE[headerTone]), children: [
|
|
2678
|
+
"\xAB",
|
|
2679
|
+
stereotype,
|
|
2680
|
+
"\xBB"
|
|
2681
|
+
] }),
|
|
2682
|
+
/* @__PURE__ */ jsx65("span", { className: "truncate font-headline-sm text-headline-sm text-ink", children: name }),
|
|
2683
|
+
tag
|
|
2684
|
+
] }),
|
|
2685
|
+
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: [
|
|
2686
|
+
attributes.map((a, i) => /* @__PURE__ */ jsx65("li", { className: "min-w-0 truncate text-on-surface-variant", children: a }, `a${i}`)),
|
|
2687
|
+
methods.map((m, i) => /* @__PURE__ */ jsx65("li", { className: cx("min-w-0 truncate text-fg-brand", columns === 2 && "col-span-2"), children: m }, `m${i}`))
|
|
2688
|
+
] })
|
|
2689
|
+
] });
|
|
2690
|
+
}
|
|
2515
2691
|
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
2692
|
/* @__PURE__ */ jsxs48("div", { className: cx("flex flex-col items-center text-center", s.pad), children: [
|
|
2517
2693
|
stereotype && /* @__PURE__ */ jsxs48("span", { className: "text-on-surface-variant", children: [
|
|
@@ -2994,8 +3170,8 @@ function CommandPalette({ open, onClose, query, onQueryChange, groups, placehold
|
|
|
2994
3170
|
|
|
2995
3171
|
// src/primitives/Show.tsx
|
|
2996
3172
|
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
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" };
|
|
3173
|
+
var ABOVE = { sm: "hidden sm:contents", md: "hidden md:contents", lg: "hidden lg:contents", xl: "hidden xl:contents", "2xl": "hidden 2xl:contents" };
|
|
3174
|
+
var BELOW = { sm: "contents sm:hidden", md: "contents md:hidden", lg: "contents lg:hidden", xl: "contents xl:hidden", "2xl": "contents 2xl:hidden" };
|
|
2999
3175
|
function Show({ above, below, children, ...rest }) {
|
|
3000
3176
|
return /* @__PURE__ */ jsx70("div", { ...rest, className: cx(above && ABOVE[above], below && BELOW[below]), children });
|
|
3001
3177
|
}
|
|
@@ -3034,6 +3210,7 @@ export {
|
|
|
3034
3210
|
Eyebrow,
|
|
3035
3211
|
FileTree,
|
|
3036
3212
|
Grid,
|
|
3213
|
+
GridItem,
|
|
3037
3214
|
Heading,
|
|
3038
3215
|
Icon,
|
|
3039
3216
|
IconButton,
|