@orangecheck/app-design 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +39 -2
  3. package/dist/brand.d.mts +46 -0
  4. package/dist/brand.d.ts +46 -0
  5. package/dist/brand.js +142 -0
  6. package/dist/brand.js.map +1 -0
  7. package/dist/brand.mjs +134 -0
  8. package/dist/brand.mjs.map +1 -0
  9. package/dist/chrome.d.mts +64 -0
  10. package/dist/chrome.d.ts +64 -0
  11. package/dist/chrome.js +479 -0
  12. package/dist/chrome.js.map +1 -0
  13. package/dist/chrome.mjs +447 -0
  14. package/dist/chrome.mjs.map +1 -0
  15. package/dist/components.d.mts +474 -0
  16. package/dist/components.d.ts +474 -0
  17. package/dist/components.js +619 -0
  18. package/dist/components.js.map +1 -0
  19. package/dist/components.mjs +588 -0
  20. package/dist/components.mjs.map +1 -0
  21. package/dist/index.d.mts +21 -0
  22. package/dist/index.d.ts +21 -0
  23. package/dist/index.js +1595 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/index.mjs +1446 -0
  26. package/dist/index.mjs.map +1 -0
  27. package/dist/primitives.d.mts +140 -0
  28. package/dist/primitives.d.ts +140 -0
  29. package/dist/primitives.js +706 -0
  30. package/dist/primitives.js.map +1 -0
  31. package/dist/primitives.mjs +606 -0
  32. package/dist/primitives.mjs.map +1 -0
  33. package/dist/styles/fonts/inter-latin-ext.woff2 +0 -0
  34. package/dist/styles/fonts/inter-latin.woff2 +0 -0
  35. package/dist/styles/fonts/jetbrains-mono-latin-ext.woff2 +0 -0
  36. package/dist/styles/fonts/jetbrains-mono-latin.woff2 +0 -0
  37. package/dist/styles/fonts.css +74 -0
  38. package/dist/styles/motion.css +80 -0
  39. package/dist/styles/theme.css +226 -0
  40. package/dist/styles/tokens.css +152 -0
  41. package/dist/styles.css +14 -0
  42. package/dist/tokens.d.mts +42 -0
  43. package/dist/tokens.d.ts +42 -0
  44. package/dist/tokens.js +50 -0
  45. package/dist/tokens.js.map +1 -0
  46. package/dist/tokens.mjs +45 -0
  47. package/dist/tokens.mjs.map +1 -0
  48. package/package.json +114 -4
@@ -0,0 +1,588 @@
1
+ import { forwardRef, createElement, useState, useRef, useEffect, useCallback } from 'react';
2
+ import { clsx } from 'clsx';
3
+ import { extendTailwindMerge } from 'tailwind-merge';
4
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
+ import { cva } from 'class-variance-authority';
6
+ import { Check, Copy } from 'lucide-react';
7
+
8
+ var merge = extendTailwindMerge({
9
+ extend: {
10
+ classGroups: {
11
+ "oca-type": [
12
+ "oca-display-1",
13
+ "oca-display-2",
14
+ "oca-display-3",
15
+ "oca-title",
16
+ "oca-title-sm",
17
+ "oca-eyebrow",
18
+ "oca-lead",
19
+ "oca-body",
20
+ "oca-numeral"
21
+ ]
22
+ }
23
+ }
24
+ });
25
+ function cn(...inputs) {
26
+ return merge(clsx(inputs));
27
+ }
28
+ function Eyebrow({ className, onInk, ...props }) {
29
+ return /* @__PURE__ */ jsx("p", { className: cn("oca-eyebrow", onInk && "text-oca-ink-eyebrow", className), ...props });
30
+ }
31
+ function Display({ level = 2, as, className, ...props }) {
32
+ const tag = as ?? `h${level}`;
33
+ return createElement(tag, { className: cn(`oca-display-${level}`, className), ...props });
34
+ }
35
+ function Accent({ children, className }) {
36
+ return /* @__PURE__ */ jsx("span", { className: cn("text-oca-accent-display", className), children });
37
+ }
38
+ function Lead({ className, ...props }) {
39
+ return /* @__PURE__ */ jsx("p", { className: cn("oca-lead max-w-[40rem]", className), ...props });
40
+ }
41
+ function Footnote({ className, ...props }) {
42
+ return /* @__PURE__ */ jsx("p", { className: cn("text-[0.9375rem] text-muted-foreground", className), ...props });
43
+ }
44
+ function Prose({ className, ...props }) {
45
+ return /* @__PURE__ */ jsx(
46
+ "div",
47
+ {
48
+ className: cn(
49
+ "max-w-[42rem] text-[1.0625rem] leading-[1.7] text-muted-foreground",
50
+ "[&_h2]:oca-display-3 [&_h2]:mb-4 [&_h2]:mt-14 [&_h2]:text-foreground",
51
+ "[&_h3]:oca-title [&_h3]:mb-3 [&_h3]:mt-10 [&_h3]:text-foreground",
52
+ "[&_p]:my-4 [&_strong]:font-medium [&_strong]:text-foreground",
53
+ "[&_a]:text-foreground [&_a]:underline [&_a]:decoration-border [&_a]:underline-offset-4 hover:[&_a]:decoration-foreground",
54
+ "[&_ul]:my-4 [&_ul]:list-disc [&_ul]:pl-5 [&_li]:my-1.5 [&_code]:text-foreground",
55
+ className
56
+ ),
57
+ ...props
58
+ }
59
+ );
60
+ }
61
+ var sectionVariants = cva("relative w-full overflow-x-clip", {
62
+ variants: {
63
+ tone: {
64
+ canvas: "bg-background text-foreground",
65
+ card: "bg-card text-card-foreground",
66
+ ink: "bg-oca-ink text-oca-ink-foreground",
67
+ brand: "bg-brand text-brand-foreground"
68
+ },
69
+ space: {
70
+ none: "",
71
+ sm: "py-12 md:py-16",
72
+ md: "oca-section",
73
+ lg: "py-24 md:py-40"
74
+ }
75
+ },
76
+ defaultVariants: { tone: "canvas", space: "md" }
77
+ });
78
+ function Section({ tone, space, contained = true, className, children, ...props }) {
79
+ return /* @__PURE__ */ jsx("section", { className: cn(sectionVariants({ tone, space }), className), ...props, children: contained ? /* @__PURE__ */ jsx("div", { className: "oca-container", children }) : children });
80
+ }
81
+ function Container({ className, ...props }) {
82
+ return /* @__PURE__ */ jsx("div", { className: cn("oca-container", className), ...props });
83
+ }
84
+ function SectionIntro({
85
+ className,
86
+ align = "start",
87
+ ...props
88
+ }) {
89
+ return /* @__PURE__ */ jsx(
90
+ "div",
91
+ {
92
+ className: cn(
93
+ "flex flex-col gap-4 md:gap-5",
94
+ align === "center" && "mx-auto items-center text-center",
95
+ className
96
+ ),
97
+ ...props
98
+ }
99
+ );
100
+ }
101
+ var badgeVariants = cva(
102
+ "inline-flex h-6 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full border px-2.5 text-[0.8125rem] font-medium leading-none",
103
+ {
104
+ variants: {
105
+ tone: {
106
+ neutral: "border-border bg-card text-foreground",
107
+ muted: "border-transparent bg-muted text-muted-foreground",
108
+ brand: "border-transparent bg-[color-mix(in_oklab,var(--oca-orange)_12%,var(--card))] text-oca-accent-ink",
109
+ success: "border-transparent bg-[color-mix(in_oklab,var(--success)_12%,var(--card))] text-success",
110
+ warning: "border-transparent bg-[color-mix(in_oklab,var(--warning)_14%,var(--card))] text-warning",
111
+ danger: "border-transparent bg-[color-mix(in_oklab,var(--destructive)_12%,var(--card))] text-destructive",
112
+ info: "border-transparent bg-[color-mix(in_oklab,var(--info)_12%,var(--card))] text-info",
113
+ ink: "border-transparent bg-oca-ink text-oca-ink-foreground",
114
+ onInk: "border-white/15 bg-white/5 text-white/90"
115
+ }
116
+ },
117
+ defaultVariants: { tone: "neutral" }
118
+ }
119
+ );
120
+ function Badge({ className, tone, ...props }) {
121
+ return /* @__PURE__ */ jsx("span", { "data-ui": "badge", className: cn(badgeVariants({ tone }), className), ...props });
122
+ }
123
+ var cardVariants = cva("relative rounded-[1.25rem] border", {
124
+ variants: {
125
+ tone: {
126
+ default: "border-border bg-card text-card-foreground",
127
+ sunken: "border-transparent bg-muted text-foreground",
128
+ ink: "border-oca-ink-line bg-oca-ink-card text-oca-ink-foreground",
129
+ outline: "border-border bg-transparent text-foreground"
130
+ },
131
+ padding: {
132
+ none: "",
133
+ sm: "p-5",
134
+ md: "p-6 md:p-8",
135
+ lg: "p-8 md:p-10"
136
+ },
137
+ interactive: {
138
+ true: "transition-colors hover:border-oca-hairline-strong focus-within:border-oca-hairline-strong",
139
+ false: ""
140
+ }
141
+ },
142
+ defaultVariants: { tone: "default", padding: "md", interactive: false }
143
+ });
144
+ var Card = forwardRef(function Card2({ className, tone, padding, interactive, ...props }, ref) {
145
+ return /* @__PURE__ */ jsx("div", { ref, "data-ui": "card", className: cn(cardVariants({ tone, padding, interactive }), className), ...props });
146
+ });
147
+ function CardNumeral({ className, ...props }) {
148
+ return /* @__PURE__ */ jsx("span", { className: cn("oca-numeral block", className), ...props });
149
+ }
150
+ function CardTitle({ className, ...props }) {
151
+ return /* @__PURE__ */ jsx("h3", { className: cn("oca-title flex flex-wrap items-center gap-2.5", className), ...props });
152
+ }
153
+ var pad = (n) => String(n + 1).padStart(2, "0");
154
+ function StepGrid({ items, look = "cards", className }) {
155
+ const cols = items.length >= 3 ? "md:grid-cols-3" : items.length === 2 ? "md:grid-cols-2" : "";
156
+ return /* @__PURE__ */ jsx("ol", { className: cn("grid gap-4 md:gap-5", cols, className), children: items.map(
157
+ (it, i) => look === "plain" ? /* @__PURE__ */ jsxs("li", { className: "flex flex-col gap-3 pr-4", children: [
158
+ /* @__PURE__ */ jsx(CardNumeral, { children: it.numeral ?? pad(i) }),
159
+ /* @__PURE__ */ jsxs(CardTitle, { className: "oca-title-sm", children: [
160
+ it.title,
161
+ it.badge ? /* @__PURE__ */ jsx(Badge, { children: it.badge }) : null
162
+ ] }),
163
+ /* @__PURE__ */ jsx("div", { className: "oca-body text-[0.9375rem]", children: it.body })
164
+ ] }, i) : look === "ink" ? /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(Card, { tone: "ink", padding: "md", className: "h-full", children: [
165
+ /* @__PURE__ */ jsxs(CardTitle, { className: "text-oca-ink-title", children: [
166
+ it.title,
167
+ it.badge ? /* @__PURE__ */ jsx(Badge, { tone: "onInk", children: it.badge }) : null
168
+ ] }),
169
+ /* @__PURE__ */ jsx("div", { className: "mt-3 text-[1rem] leading-relaxed text-oca-ink-muted", children: it.body })
170
+ ] }) }, i) : /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(Card, { padding: "md", className: "flex h-full flex-col gap-3", children: [
171
+ /* @__PURE__ */ jsx(CardNumeral, { children: it.numeral ?? pad(i) }),
172
+ /* @__PURE__ */ jsxs(CardTitle, { children: [
173
+ it.title,
174
+ it.badge ? /* @__PURE__ */ jsx(Badge, { children: it.badge }) : null
175
+ ] }),
176
+ /* @__PURE__ */ jsx("div", { className: "oca-body", children: it.body })
177
+ ] }) }, i)
178
+ ) });
179
+ }
180
+ var KIND = {
181
+ package: "text-oca-code-package",
182
+ tag: "text-oca-code-tag",
183
+ link: "text-oca-code-link"
184
+ };
185
+ function PackageCard({ items, className }) {
186
+ return /* @__PURE__ */ jsx(
187
+ "div",
188
+ {
189
+ className: cn(
190
+ "grid gap-x-10 gap-y-7 rounded-[1.25rem] border border-oca-ink-line bg-oca-ink-card p-6 text-oca-ink-foreground md:grid-cols-2 md:p-9",
191
+ className
192
+ ),
193
+ children: items.map((it, i) => {
194
+ const code = /* @__PURE__ */ jsx("span", { className: cn("text-[0.9375rem]", KIND[it.kind ?? "package"]), children: it.code });
195
+ return /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-1.5", children: [
196
+ /* @__PURE__ */ jsx("h3", { className: "text-[1.125rem] font-semibold tracking-[-0.01em] text-oca-ink-title", children: it.title }),
197
+ it.href ? /* @__PURE__ */ jsx("a", { href: it.href, className: "w-fit underline decoration-transparent underline-offset-4 hover:decoration-current", children: code }) : code,
198
+ it.note ? /* @__PURE__ */ jsxs("p", { className: "text-[0.9375rem] leading-relaxed text-oca-ink-subtle", children: [
199
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "// " }),
200
+ it.note
201
+ ] }) : null
202
+ ] }, i);
203
+ })
204
+ }
205
+ );
206
+ }
207
+ function CodeBlock({
208
+ code,
209
+ caption,
210
+ className
211
+ }) {
212
+ return /* @__PURE__ */ jsxs("figure", { className: cn("overflow-hidden rounded-[1.25rem] border border-oca-ink-line bg-oca-ink-card", className), children: [
213
+ caption ? /* @__PURE__ */ jsx("figcaption", { className: "border-b border-oca-ink-line px-5 py-3 text-[0.8125rem] text-oca-ink-subtle", children: caption }) : null,
214
+ /* @__PURE__ */ jsx("pre", { className: "overflow-x-auto p-5 font-mono text-[0.875rem] leading-relaxed text-oca-ink-muted", children: /* @__PURE__ */ jsx("code", { children: code }) })
215
+ ] });
216
+ }
217
+ var LABEL = {
218
+ yes: "Yes",
219
+ testing: "In testing",
220
+ "not-yet": "Not yet",
221
+ no: "No"
222
+ };
223
+ var TONE = {
224
+ yes: "text-oca-accent-ink",
225
+ testing: "text-foreground",
226
+ "not-yet": "text-muted-foreground",
227
+ no: "text-muted-foreground"
228
+ };
229
+ function TruthTable({
230
+ rows,
231
+ statusHeading = "Status",
232
+ whatHeading = "What",
233
+ className
234
+ }) {
235
+ return /* @__PURE__ */ jsx("div", { className: cn("overflow-hidden rounded-xl border border-oca-hairline-strong", className), children: /* @__PURE__ */ jsxs("table", { className: "w-full border-collapse text-left text-[0.9375rem] md:text-[1rem]", children: [
236
+ /* @__PURE__ */ jsx("thead", { className: "bg-oca-table-head", children: /* @__PURE__ */ jsxs("tr", { children: [
237
+ /* @__PURE__ */ jsx("th", { scope: "col", className: "w-[30%] border-b border-oca-hairline-strong px-4 py-3 font-semibold md:w-[22%]", children: statusHeading }),
238
+ /* @__PURE__ */ jsx("th", { scope: "col", className: "border-b border-l border-oca-hairline-strong px-4 py-3 font-semibold", children: whatHeading })
239
+ ] }) }),
240
+ /* @__PURE__ */ jsx("tbody", { className: "bg-card", children: rows.map((r, i) => /* @__PURE__ */ jsxs("tr", { className: "align-top", children: [
241
+ /* @__PURE__ */ jsx(
242
+ "td",
243
+ {
244
+ className: cn(
245
+ "border-t border-oca-hairline-strong px-4 py-3 font-medium",
246
+ i === 0 && "border-t-0",
247
+ TONE[r.status]
248
+ ),
249
+ children: LABEL[r.status]
250
+ }
251
+ ),
252
+ /* @__PURE__ */ jsx(
253
+ "td",
254
+ {
255
+ className: cn(
256
+ "border-l border-t border-oca-hairline-strong px-4 py-3 leading-relaxed",
257
+ i === 0 && "border-t-0"
258
+ ),
259
+ children: r.what
260
+ }
261
+ )
262
+ ] }, i)) })
263
+ ] }) });
264
+ }
265
+ var INT = new Intl.NumberFormat("en-US", { maximumFractionDigits: 0 });
266
+ var COMPACT = new Intl.NumberFormat("en-US", { notation: "compact", maximumFractionDigits: 1 });
267
+ function satsText(value, opts = {}) {
268
+ if (value == null || !Number.isFinite(value)) return null;
269
+ const whole = Math.trunc(value);
270
+ const body = (opts.compact ? COMPACT : INT).format(Math.abs(whole));
271
+ const sign = whole < 0 ? "\u2212" : opts.signed && whole > 0 ? "+" : "";
272
+ const unit = opts.unit === "none" ? "" : whole === 1 || whole === -1 ? " sat" : " sats";
273
+ return `${sign}${body}${unit}`;
274
+ }
275
+ function Sats({ value, unit, compact, signed, unknown = "\u2014", className, ...props }) {
276
+ const text = satsText(value, { unit, compact, signed });
277
+ if (text === null) {
278
+ return /* @__PURE__ */ jsxs("span", { className: cn("oca-tabular text-muted-foreground", className), ...props, children: [
279
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: unknown }),
280
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "unknown" })
281
+ ] });
282
+ }
283
+ return /* @__PURE__ */ jsx("span", { className: cn("oca-tabular whitespace-nowrap", className), ...props, children: text });
284
+ }
285
+ function UsdApprox({
286
+ sats,
287
+ usdPerBtc,
288
+ className
289
+ }) {
290
+ if (sats == null || usdPerBtc == null || !Number.isFinite(sats) || !Number.isFinite(usdPerBtc)) return null;
291
+ const usd = sats / 1e8 * usdPerBtc;
292
+ const text = new Intl.NumberFormat("en-US", {
293
+ style: "currency",
294
+ currency: "USD",
295
+ maximumFractionDigits: usd < 1 ? 4 : 2
296
+ }).format(usd);
297
+ return /* @__PURE__ */ jsxs("span", { className: cn("oca-tabular text-muted-foreground", className), children: [
298
+ "\u2248 ",
299
+ text
300
+ ] });
301
+ }
302
+ function SatsFigure({
303
+ label,
304
+ value,
305
+ hint,
306
+ className
307
+ }) {
308
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-1.5", className), children: [
309
+ /* @__PURE__ */ jsx("span", { className: "text-[0.9375rem] text-muted-foreground", children: label }),
310
+ /* @__PURE__ */ jsxs("span", { className: "oca-display-3 oca-tabular", children: [
311
+ /* @__PURE__ */ jsx(Sats, { value, unit: "none" }),
312
+ /* @__PURE__ */ jsx("span", { className: "ml-2 text-[0.5em] tracking-normal text-muted-foreground", children: "sats" })
313
+ ] }),
314
+ hint ? /* @__PURE__ */ jsx("span", { className: "text-[0.875rem] text-muted-foreground", children: hint }) : null
315
+ ] });
316
+ }
317
+ var TOP = "0,3 2,2 6,4 14,0 16,1 6,6";
318
+ var LEFT = "0,3 6,6 6,8 0,5";
319
+ var RIGHT = "6,6 16,1 16,3 6,8";
320
+ var MARK_FACES = { top: "#FED8AB", left: "#FB933C", right: "#EA580B" };
321
+ function Mark({ title, size, className, ...rest }) {
322
+ return /* @__PURE__ */ jsxs(
323
+ "svg",
324
+ {
325
+ viewBox: "0 0 16 8",
326
+ width: size,
327
+ height: size ? size / 2 : void 0,
328
+ role: title ? "img" : void 0,
329
+ "aria-hidden": title ? void 0 : true,
330
+ className: cn("shrink-0", className),
331
+ ...rest,
332
+ children: [
333
+ title ? /* @__PURE__ */ jsx("title", { children: title }) : null,
334
+ /* @__PURE__ */ jsx("polygon", { points: LEFT, fill: MARK_FACES.left }),
335
+ /* @__PURE__ */ jsx("polygon", { points: RIGHT, fill: MARK_FACES.right }),
336
+ /* @__PURE__ */ jsx("polygon", { points: TOP, fill: MARK_FACES.top })
337
+ ]
338
+ }
339
+ );
340
+ }
341
+ function PageHeader({
342
+ eyebrow,
343
+ title,
344
+ description,
345
+ actions,
346
+ className
347
+ }) {
348
+ return /* @__PURE__ */ jsxs("header", { className: cn("flex flex-col gap-5 md:flex-row md:items-end md:justify-between", className), children: [
349
+ /* @__PURE__ */ jsxs("div", { className: "flex max-w-[44rem] flex-col gap-3", children: [
350
+ eyebrow ? /* @__PURE__ */ jsx("p", { className: "oca-eyebrow", children: eyebrow }) : null,
351
+ /* @__PURE__ */ jsx("h1", { className: "oca-display-3", children: title }),
352
+ description ? /* @__PURE__ */ jsx("p", { className: "oca-body text-[1.0625rem]", children: description }) : null
353
+ ] }),
354
+ actions ? /* @__PURE__ */ jsx("div", { className: "flex shrink-0 flex-wrap items-center gap-3", children: actions }) : null
355
+ ] });
356
+ }
357
+ function StatCard({
358
+ label,
359
+ value,
360
+ hint,
361
+ className
362
+ }) {
363
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-2 rounded-[1.25rem] border border-border bg-card p-5 md:p-6", className), children: [
364
+ /* @__PURE__ */ jsx("span", { className: "text-[0.875rem] text-muted-foreground", children: label }),
365
+ /* @__PURE__ */ jsx("span", { className: "oca-tabular text-[1.75rem] leading-tight tracking-[-0.02em]", children: value }),
366
+ hint ? /* @__PURE__ */ jsx("span", { className: "text-[0.8125rem] leading-snug text-muted-foreground", children: hint }) : null
367
+ ] });
368
+ }
369
+ function StatGrid({ className, ...props }) {
370
+ return /* @__PURE__ */ jsx("div", { className: cn("grid grid-cols-2 gap-3 md:grid-cols-4 md:gap-4", className), ...props });
371
+ }
372
+ function KeyValueList({ items, className }) {
373
+ return /* @__PURE__ */ jsx("dl", { className: cn("divide-y divide-border rounded-[1.25rem] border border-border bg-card", className), children: items.map((it, i) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 px-5 py-3.5 sm:flex-row sm:items-baseline sm:gap-6", children: [
374
+ /* @__PURE__ */ jsx("dt", { className: "shrink-0 text-[0.875rem] text-muted-foreground sm:w-48", children: it.label }),
375
+ /* @__PURE__ */ jsx("dd", { className: cn("min-w-0 break-words text-[0.9375rem]", it.mono && "font-mono text-[0.875rem]"), children: it.value })
376
+ ] }, i)) });
377
+ }
378
+ function DataTable({
379
+ columns,
380
+ rows,
381
+ rowKey,
382
+ empty,
383
+ caption,
384
+ className
385
+ }) {
386
+ if (rows.length === 0 && empty) return /* @__PURE__ */ jsx(Fragment, { children: empty });
387
+ return /* @__PURE__ */ jsx("div", { className: cn("overflow-x-auto rounded-[1.25rem] border border-border bg-card", className), children: /* @__PURE__ */ jsxs("table", { className: "w-full border-collapse text-left text-[0.9375rem]", children: [
388
+ caption ? /* @__PURE__ */ jsx("caption", { className: "sr-only", children: caption }) : null,
389
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { className: "border-b border-border", children: columns.map((c) => /* @__PURE__ */ jsx(
390
+ "th",
391
+ {
392
+ scope: "col",
393
+ className: cn(
394
+ "whitespace-nowrap px-5 py-3 text-[0.8125rem] font-medium text-muted-foreground",
395
+ c.align === "end" && "text-right",
396
+ c.wide && "hidden md:table-cell"
397
+ ),
398
+ children: c.header
399
+ },
400
+ c.key
401
+ )) }) }),
402
+ /* @__PURE__ */ jsx("tbody", { className: "divide-y divide-border", children: rows.map((r, i) => /* @__PURE__ */ jsx("tr", { className: "transition-colors hover:bg-accent/60", children: columns.map((c) => /* @__PURE__ */ jsx(
403
+ "td",
404
+ {
405
+ className: cn(
406
+ "px-5 py-3.5 align-middle",
407
+ c.align === "end" && "text-right",
408
+ c.wide && "hidden md:table-cell"
409
+ ),
410
+ children: c.cell(r)
411
+ },
412
+ c.key
413
+ )) }, rowKey(r, i))) })
414
+ ] }) });
415
+ }
416
+ function EmptyState({
417
+ title,
418
+ children,
419
+ action,
420
+ className
421
+ }) {
422
+ return /* @__PURE__ */ jsxs(
423
+ "div",
424
+ {
425
+ className: cn(
426
+ "flex flex-col items-center gap-4 rounded-[1.25rem] border border-dashed border-oca-hairline-strong px-6 py-12 text-center",
427
+ className
428
+ ),
429
+ children: [
430
+ /* @__PURE__ */ jsx(Mark, { size: 56 }),
431
+ /* @__PURE__ */ jsx("h3", { className: "oca-title-sm", children: title }),
432
+ children ? /* @__PURE__ */ jsx("div", { className: "oca-body max-w-md text-[0.9375rem]", children }) : null,
433
+ action ? /* @__PURE__ */ jsx("div", { className: "mt-1 flex flex-wrap justify-center gap-3", children: action }) : null
434
+ ]
435
+ }
436
+ );
437
+ }
438
+ var NOTICE = {
439
+ neutral: "border-border bg-card",
440
+ info: "border-[color-mix(in_oklab,var(--info)_30%,var(--border))] bg-[color-mix(in_oklab,var(--info)_6%,var(--card))]",
441
+ success: "border-[color-mix(in_oklab,var(--success)_30%,var(--border))] bg-[color-mix(in_oklab,var(--success)_6%,var(--card))]",
442
+ warning: "border-[color-mix(in_oklab,var(--warning)_35%,var(--border))] bg-[color-mix(in_oklab,var(--warning)_7%,var(--card))]",
443
+ danger: "border-[color-mix(in_oklab,var(--destructive)_32%,var(--border))] bg-[color-mix(in_oklab,var(--destructive)_6%,var(--card))]",
444
+ brand: "border-[color-mix(in_oklab,var(--oca-orange)_35%,var(--border))] bg-[color-mix(in_oklab,var(--oca-orange)_7%,var(--card))]"
445
+ };
446
+ var NOTICE_TITLE = {
447
+ neutral: "text-foreground",
448
+ info: "text-info",
449
+ success: "text-success",
450
+ warning: "text-warning",
451
+ danger: "text-destructive",
452
+ brand: "text-oca-accent-ink"
453
+ };
454
+ function Notice({
455
+ tone = "neutral",
456
+ title,
457
+ children,
458
+ action,
459
+ className
460
+ }) {
461
+ return /* @__PURE__ */ jsxs(
462
+ "div",
463
+ {
464
+ role: tone === "danger" || tone === "warning" ? "alert" : "note",
465
+ className: cn(
466
+ "flex flex-col gap-3 rounded-2xl border px-5 py-4 sm:flex-row sm:items-start sm:justify-between",
467
+ NOTICE[tone],
468
+ className
469
+ ),
470
+ children: [
471
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-1", children: [
472
+ title ? /* @__PURE__ */ jsx("p", { className: cn("text-[0.9375rem] font-medium", NOTICE_TITLE[tone]), children: title }) : null,
473
+ children ? /* @__PURE__ */ jsx("div", { className: "text-[0.9375rem] leading-relaxed text-foreground/85", children }) : null
474
+ ] }),
475
+ action ? /* @__PURE__ */ jsx("div", { className: "shrink-0", children: action }) : null
476
+ ]
477
+ }
478
+ );
479
+ }
480
+ function middle(v, head, tail) {
481
+ return v.length <= head + tail + 1 ? v : `${v.slice(0, head)}\u2026${v.slice(-tail)}`;
482
+ }
483
+ function useCopy(timeoutMs = 1600) {
484
+ const [copied, setCopied] = useState(false);
485
+ const t = useRef(null);
486
+ useEffect(() => () => {
487
+ if (t.current) clearTimeout(t.current);
488
+ }, []);
489
+ const copy = useCallback(
490
+ async (text) => {
491
+ try {
492
+ await navigator.clipboard.writeText(text);
493
+ setCopied(true);
494
+ if (t.current) clearTimeout(t.current);
495
+ t.current = setTimeout(() => setCopied(false), timeoutMs);
496
+ } catch {
497
+ setCopied(false);
498
+ }
499
+ },
500
+ [timeoutMs]
501
+ );
502
+ return { copied, copy };
503
+ }
504
+ function CopyButton({ value, label = "Copy", className }) {
505
+ const { copied, copy } = useCopy();
506
+ return /* @__PURE__ */ jsxs(
507
+ "button",
508
+ {
509
+ type: "button",
510
+ onClick: () => void copy(value),
511
+ "aria-label": copied ? "Copied" : label,
512
+ className: cn(
513
+ "inline-flex size-8 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
514
+ className
515
+ ),
516
+ children: [
517
+ copied ? /* @__PURE__ */ jsx(Check, { className: "size-4 text-success" }) : /* @__PURE__ */ jsx(Copy, { className: "size-4" }),
518
+ /* @__PURE__ */ jsx("span", { "aria-live": "polite", className: "sr-only", children: copied ? "Copied" : "" })
519
+ ]
520
+ }
521
+ );
522
+ }
523
+ function HashChip({
524
+ value,
525
+ head = 8,
526
+ tail = 6,
527
+ copy = true,
528
+ href,
529
+ className
530
+ }) {
531
+ const shown = middle(value, head, tail);
532
+ const text = /* @__PURE__ */ jsx("span", { title: value, className: "font-mono text-[0.875rem]", children: shown });
533
+ return /* @__PURE__ */ jsxs("span", { className: cn("inline-flex max-w-full items-center gap-1", className), children: [
534
+ href ? /* @__PURE__ */ jsx("a", { href, className: "underline decoration-border underline-offset-4 hover:decoration-foreground", children: text }) : text,
535
+ copy ? /* @__PURE__ */ jsx(CopyButton, { value, label: "Copy full value" }) : null
536
+ ] });
537
+ }
538
+ function ProgressSteps({ steps, className }) {
539
+ return /* @__PURE__ */ jsx("ol", { className: cn("flex flex-col gap-0", className), children: steps.map((s, i) => {
540
+ const last = i === steps.length - 1;
541
+ return /* @__PURE__ */ jsxs("li", { className: "relative flex gap-4 pb-6 last:pb-0", "aria-current": s.state === "current" ? "step" : void 0, children: [
542
+ !last ? /* @__PURE__ */ jsx(
543
+ "span",
544
+ {
545
+ "aria-hidden": true,
546
+ className: cn(
547
+ "absolute left-[11px] top-7 h-[calc(100%-1.5rem)] w-px",
548
+ s.state === "done" ? "bg-foreground/30" : "bg-border"
549
+ )
550
+ }
551
+ ) : null,
552
+ /* @__PURE__ */ jsx(
553
+ "span",
554
+ {
555
+ className: cn(
556
+ "relative z-10 mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-full border text-[0.75rem] oca-tabular",
557
+ s.state === "done" && "border-primary bg-primary text-primary-foreground",
558
+ s.state === "current" && "border-brand bg-card text-oca-accent-ink",
559
+ s.state === "upcoming" && "border-border bg-card text-muted-foreground",
560
+ s.state === "blocked" && "border-destructive bg-card text-destructive"
561
+ ),
562
+ children: s.state === "done" ? /* @__PURE__ */ jsx(Check, { className: "size-3.5", strokeWidth: 3 }) : String(i + 1).padStart(2, "0")
563
+ }
564
+ ),
565
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-1", children: [
566
+ /* @__PURE__ */ jsx("span", { className: cn("text-[0.9375rem]", s.state === "upcoming" ? "text-muted-foreground" : "font-medium"), children: s.label }),
567
+ s.hint ? /* @__PURE__ */ jsx("span", { className: "text-[0.875rem] leading-snug text-muted-foreground", children: s.hint }) : null
568
+ ] })
569
+ ] }, i);
570
+ }) });
571
+ }
572
+ function ActivityList({ items, empty, className }) {
573
+ if (items.length === 0 && empty) return /* @__PURE__ */ jsx(Fragment, { children: empty });
574
+ return /* @__PURE__ */ jsx("ul", { className: cn("divide-y divide-border rounded-[1.25rem] border border-border bg-card", className), children: items.map((it) => {
575
+ const body = /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4 px-5 py-4", children: [
576
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-0.5", children: [
577
+ /* @__PURE__ */ jsx("span", { className: "truncate text-[0.9375rem]", children: it.title }),
578
+ it.meta ? /* @__PURE__ */ jsx("span", { className: "truncate text-[0.8125rem] text-muted-foreground", children: it.meta }) : null
579
+ ] }),
580
+ it.trailing ? /* @__PURE__ */ jsx("div", { className: "shrink-0 text-right", children: it.trailing }) : null
581
+ ] });
582
+ return /* @__PURE__ */ jsx("li", { children: it.href ? /* @__PURE__ */ jsx("a", { href: it.href, className: "block transition-colors hover:bg-accent/60", children: body }) : body }, it.id);
583
+ }) });
584
+ }
585
+
586
+ export { Accent, ActivityList, CodeBlock, Container, CopyButton, DataTable, Display, EmptyState, Eyebrow, Footnote, HashChip, KeyValueList, Lead, Notice, PackageCard, PageHeader, ProgressSteps, Prose, Sats, SatsFigure, Section, SectionIntro, StatCard, StatGrid, StepGrid, TruthTable, UsdApprox, satsText, sectionVariants, useCopy };
587
+ //# sourceMappingURL=components.mjs.map
588
+ //# sourceMappingURL=components.mjs.map