@orangecheck/app-design 0.2.1 → 0.3.1

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.
@@ -6,6 +6,29 @@ var tailwindMerge = require('tailwind-merge');
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
7
  var classVarianceAuthority = require('class-variance-authority');
8
8
  var lucideReact = require('lucide-react');
9
+ var reactSlot = require('@radix-ui/react-slot');
10
+ var SeparatorPrimitive = require('@radix-ui/react-separator');
11
+ require('sonner');
12
+
13
+ function _interopNamespace(e) {
14
+ if (e && e.__esModule) return e;
15
+ var n = Object.create(null);
16
+ if (e) {
17
+ Object.keys(e).forEach(function (k) {
18
+ if (k !== 'default') {
19
+ var d = Object.getOwnPropertyDescriptor(e, k);
20
+ Object.defineProperty(n, k, d.get ? d : {
21
+ enumerable: true,
22
+ get: function () { return e[k]; }
23
+ });
24
+ }
25
+ });
26
+ }
27
+ n.default = e;
28
+ return Object.freeze(n);
29
+ }
30
+
31
+ var SeparatorPrimitive__namespace = /*#__PURE__*/_interopNamespace(SeparatorPrimitive);
9
32
 
10
33
  var merge = tailwindMerge.extendTailwindMerge({
11
34
  extend: {
@@ -49,7 +72,7 @@ function Prose({ className, ...props }) {
49
72
  {
50
73
  className: cn(
51
74
  "max-w-[42rem] text-[1.0625rem] leading-[1.7] text-muted-foreground",
52
- "[&_h2]:oca-display-3 [&_h2]:mb-4 [&_h2]:mt-14 [&_h2]:text-foreground",
75
+ "[&_h2]:oca-display-3 [&_h2]:mb-4 [&_h2]:mt-14 [&_h2]:scroll-mt-24 [&_h2]:text-foreground",
53
76
  "[&_h3]:oca-title [&_h3]:mb-3 [&_h3]:mt-10 [&_h3]:text-foreground",
54
77
  "[&_p]:my-4 [&_strong]:font-medium [&_strong]:text-foreground",
55
78
  "[&_a]:text-foreground [&_a]:underline [&_a]:decoration-border [&_a]:underline-offset-4 hover:[&_a]:decoration-foreground",
@@ -65,7 +88,9 @@ var sectionVariants = classVarianceAuthority.cva("relative w-full overflow-x-cli
65
88
  tone: {
66
89
  canvas: "bg-background text-foreground",
67
90
  card: "bg-card text-card-foreground",
68
- ink: "bg-oca-ink text-oca-ink-foreground",
91
+ // The band line is transparent in light; in dark it keeps the ink
92
+ // band from melting into the canvas.
93
+ ink: "border-y border-[var(--oca-band-line)] bg-oca-ink text-oca-ink-foreground",
69
94
  brand: "bg-brand text-brand-foreground"
70
95
  },
71
96
  space: {
@@ -100,6 +125,121 @@ function SectionIntro({
100
125
  }
101
126
  );
102
127
  }
128
+ function PageHero({
129
+ eyebrow,
130
+ title,
131
+ lead,
132
+ actions,
133
+ art,
134
+ meta,
135
+ children,
136
+ variant = "page",
137
+ size = "lg",
138
+ className
139
+ }) {
140
+ if (variant === "document") {
141
+ return /* @__PURE__ */ jsxRuntime.jsx(Section, { space: "none", className: cn("pb-12 pt-12 md:pb-16 md:pt-20", className), children: /* @__PURE__ */ jsxRuntime.jsx(DocHeader, { className: "mx-auto max-w-[42rem]", ...{ eyebrow, title, lead, meta, actions }, children }) });
142
+ }
143
+ return /* @__PURE__ */ jsxRuntime.jsx(Section, { space: "none", className: cn("pb-14 pt-12 md:pb-20 md:pt-20", className), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("grid grid-cols-1 gap-10", art && "items-center md:grid-cols-12"), children: [
144
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col items-start gap-6", art ? "md:col-span-7" : "max-w-[52rem]"), children: [
145
+ eyebrow ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "oca-eyebrow", children: eyebrow }) : null,
146
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: size === "xl" ? "oca-display-1" : "oca-display-2", children: title }),
147
+ lead ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "oca-lead max-w-[38rem]", children: lead }) : null,
148
+ meta ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[0.875rem] text-muted-foreground", children: meta }) : null,
149
+ actions ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-3", children: actions }) : null,
150
+ children
151
+ ] }),
152
+ art ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "md:col-span-5", children: art }) : null
153
+ ] }) });
154
+ }
155
+ function DocHeader({
156
+ eyebrow,
157
+ title,
158
+ lead,
159
+ meta,
160
+ actions,
161
+ children,
162
+ className
163
+ }) {
164
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-5", className), children: [
165
+ eyebrow ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "oca-eyebrow", children: eyebrow }) : null,
166
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "oca-display-2", children: title }),
167
+ lead ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "oca-lead", children: lead }) : null,
168
+ meta ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[0.875rem] text-muted-foreground", children: meta }) : null,
169
+ actions ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 flex flex-wrap gap-3", children: actions }) : null,
170
+ children
171
+ ] });
172
+ }
173
+ function useActiveHeading(ids) {
174
+ const [active, setActive] = react.useState(ids[0]);
175
+ const key = ids.join("|");
176
+ react.useEffect(() => {
177
+ const els = key.split("|").map((id) => document.getElementById(id)).filter((el) => el !== null);
178
+ if (els.length === 0 || typeof IntersectionObserver === "undefined") return;
179
+ const io = new IntersectionObserver(
180
+ (entries) => {
181
+ const hit = entries.filter((e) => e.isIntersecting).sort((a, b) => a.boundingClientRect.top - b.boundingClientRect.top)[0];
182
+ if (hit) setActive(hit.target.id);
183
+ },
184
+ { rootMargin: "-80px 0px -65% 0px" }
185
+ );
186
+ els.forEach((el) => io.observe(el));
187
+ return () => io.disconnect();
188
+ }, [key]);
189
+ return active;
190
+ }
191
+ function DocLayout({
192
+ toc,
193
+ header,
194
+ children,
195
+ className
196
+ }) {
197
+ const active = useActiveHeading(toc?.map((t) => t.id) ?? []);
198
+ const links = () => toc?.map((t) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
199
+ "a",
200
+ {
201
+ href: `#${t.id}`,
202
+ "aria-current": active === t.id ? "location" : void 0,
203
+ className: cn(
204
+ "block border-l py-1.5 pl-4 text-[0.875rem] leading-snug transition-colors",
205
+ active === t.id ? "border-foreground text-foreground" : "border-border text-muted-foreground hover:text-foreground"
206
+ ),
207
+ children: t.label
208
+ }
209
+ ) }, t.id));
210
+ const hasToc = !!toc && toc.length > 0;
211
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("oca-container pb-24", header ? "pt-12 md:pt-20" : null, className), children: /* @__PURE__ */ jsxRuntime.jsxs(
212
+ "div",
213
+ {
214
+ className: cn(
215
+ "mx-auto grid grid-cols-1 gap-8",
216
+ hasToc ? "max-w-[42rem] lg:max-w-[64rem] lg:grid-cols-[13rem_minmax(0,42rem)] lg:gap-x-16 lg:gap-y-10" : "max-w-[42rem]"
217
+ ),
218
+ children: [
219
+ header ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(hasToc && "lg:col-start-2", "pb-4"), children: header }) : null,
220
+ hasToc ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
221
+ /* @__PURE__ */ jsxRuntime.jsxs(
222
+ "nav",
223
+ {
224
+ "aria-label": "On this page",
225
+ className: cn("sticky top-24 hidden self-start lg:block", header && "lg:row-start-2"),
226
+ children: [
227
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-3 text-[0.875rem] font-medium", children: "On this page" }),
228
+ /* @__PURE__ */ jsxRuntime.jsx("ul", { children: links() })
229
+ ]
230
+ }
231
+ ),
232
+ /* @__PURE__ */ jsxRuntime.jsxs("details", { className: "group rounded-2xl border border-border bg-card px-4 py-3 lg:hidden", children: [
233
+ /* @__PURE__ */ jsxRuntime.jsx("summary", { className: "cursor-pointer list-none text-[0.9375rem] font-medium marker:hidden", children: "On this page" }),
234
+ /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "mt-3", children: links() })
235
+ ] })
236
+ ] }) : null,
237
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("min-w-0", hasToc && "lg:col-start-2", hasToc && header && "lg:row-start-2"), children })
238
+ ]
239
+ }
240
+ ) });
241
+ }
242
+ var GOOD_DOT = "border-border bg-card text-foreground before:size-1.5 before:shrink-0 before:rounded-full before:bg-success before:content-['']";
103
243
  var badgeVariants = classVarianceAuthority.cva(
104
244
  "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",
105
245
  {
@@ -108,10 +248,13 @@ var badgeVariants = classVarianceAuthority.cva(
108
248
  neutral: "border-border bg-card text-foreground",
109
249
  muted: "border-transparent bg-muted text-muted-foreground",
110
250
  brand: "border-transparent bg-[color-mix(in_oklab,var(--oca-orange)_12%,var(--card))] text-oca-accent-ink",
111
- success: "border-transparent bg-[color-mix(in_oklab,var(--success)_12%,var(--card))] text-success",
112
- warning: "border-transparent bg-[color-mix(in_oklab,var(--warning)_14%,var(--card))] text-warning",
113
251
  danger: "border-transparent bg-[color-mix(in_oklab,var(--destructive)_12%,var(--card))] text-destructive",
114
- info: "border-transparent bg-[color-mix(in_oklab,var(--info)_12%,var(--card))] text-info",
252
+ // A good state is a neutral pill with a green dot, not a green pill.
253
+ success: GOOD_DOT,
254
+ // Aliases kept so older call sites keep compiling: attention is
255
+ // the brand accent, information is neutral.
256
+ warning: "border-transparent bg-[color-mix(in_oklab,var(--oca-orange)_12%,var(--card))] text-oca-accent-ink",
257
+ info: "border-border bg-card text-foreground",
115
258
  ink: "border-transparent bg-oca-ink text-oca-ink-foreground",
116
259
  onInk: "border-white/15 bg-white/5 text-white/90"
117
260
  }
@@ -179,208 +322,161 @@ function StepGrid({ items, look = "cards", className }) {
179
322
  ] }) }, i)
180
323
  ) });
181
324
  }
182
- var KIND = {
183
- package: "text-oca-code-package",
184
- tag: "text-oca-code-tag",
185
- link: "text-oca-code-link"
186
- };
187
- function PackageCard({ items, className }) {
188
- return /* @__PURE__ */ jsxRuntime.jsx(
189
- "div",
190
- {
191
- className: cn(
192
- "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",
193
- className
194
- ),
195
- children: items.map((it, i) => {
196
- const code = /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("text-[0.9375rem]", KIND[it.kind ?? "package"]), children: it.code });
197
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-col gap-1.5", children: [
198
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-[1.125rem] font-semibold tracking-[-0.01em] text-oca-ink-title", children: it.title }),
199
- it.href ? /* @__PURE__ */ jsxRuntime.jsx("a", { href: it.href, className: "w-fit underline decoration-transparent underline-offset-4 hover:decoration-current", children: code }) : code,
200
- it.note ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-[0.9375rem] leading-relaxed text-oca-ink-subtle", children: [
201
- /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, children: "// " }),
202
- it.note
203
- ] }) : null
204
- ] }, i);
205
- })
206
- }
207
- );
208
- }
209
- function CodeBlock({
210
- code,
211
- caption,
212
- className
213
- }) {
214
- return /* @__PURE__ */ jsxRuntime.jsxs("figure", { className: cn("overflow-hidden rounded-[1.25rem] border border-oca-ink-line bg-oca-ink-card", className), children: [
215
- caption ? /* @__PURE__ */ jsxRuntime.jsx("figcaption", { className: "border-b border-oca-ink-line px-5 py-3 text-[0.8125rem] text-oca-ink-subtle", children: caption }) : null,
216
- /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "overflow-x-auto p-5 font-mono text-[0.875rem] leading-relaxed text-oca-ink-muted", children: /* @__PURE__ */ jsxRuntime.jsx("code", { children: code }) })
217
- ] });
218
- }
219
- function SplitBar({
220
- segments,
221
- caption,
222
- className
223
- }) {
224
- return /* @__PURE__ */ jsxRuntime.jsxs("figure", { className: cn("flex flex-col gap-5", className), children: [
225
- caption ? /* @__PURE__ */ jsxRuntime.jsx("figcaption", { className: "text-[0.9375rem]", children: caption }) : null,
226
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-16 w-full gap-1.5 overflow-hidden rounded-[1.25rem] md:h-20", children: segments.map((s, i) => /* @__PURE__ */ jsxRuntime.jsx(
227
- "div",
325
+ function ScrollFade({ fade = "var(--card)", className, innerClassName, children, ...props }) {
326
+ const ref = react.useRef(null);
327
+ const [edges, setEdges] = react.useState({ left: false, right: false });
328
+ const measure = react.useCallback(() => {
329
+ const el = ref.current;
330
+ if (!el) return;
331
+ const left = el.scrollLeft > 1;
332
+ const right = el.scrollLeft + el.clientWidth < el.scrollWidth - 1;
333
+ setEdges((e) => e.left === left && e.right === right ? e : { left, right });
334
+ }, []);
335
+ react.useEffect(() => {
336
+ const el = ref.current;
337
+ if (!el) return;
338
+ measure();
339
+ if (typeof ResizeObserver === "undefined") return;
340
+ const ro = new ResizeObserver(measure);
341
+ ro.observe(el);
342
+ if (el.firstElementChild) ro.observe(el.firstElementChild);
343
+ return () => ro.disconnect();
344
+ }, [measure]);
345
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative min-w-0", className), ...props, children: [
346
+ /* @__PURE__ */ jsxRuntime.jsx("div", { ref, onScroll: measure, className: cn("overflow-x-auto overscroll-x-contain", innerClassName), children }),
347
+ /* @__PURE__ */ jsxRuntime.jsx(
348
+ "span",
228
349
  {
350
+ "aria-hidden": true,
229
351
  className: cn(
230
- "flex min-w-[4.25rem] items-end rounded-[1rem] px-3 pb-2.5 md:px-4 md:pb-3",
231
- s.tone === "card" ? "bg-white text-oca-ink" : "bg-oca-ink text-white"
352
+ "pointer-events-none absolute inset-y-0 left-0 w-8 transition-opacity duration-150",
353
+ edges.left ? "opacity-100" : "opacity-0"
232
354
  ),
233
- style: { flexBasis: `${s.pct}%` },
234
- children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "oca-tabular text-[1.25rem] leading-none tracking-[-0.02em] md:text-[1.875rem]", children: [
235
- s.pct,
236
- "%"
237
- ] })
238
- },
239
- i
240
- )) }),
241
- /* @__PURE__ */ jsxRuntime.jsx("dl", { className: "grid gap-x-8 gap-y-2 sm:grid-cols-2", children: segments.map((s, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline gap-2.5", children: [
242
- /* @__PURE__ */ jsxRuntime.jsxs("dt", { className: "sr-only", children: [
243
- s.pct,
244
- "%"
245
- ] }),
246
- /* @__PURE__ */ jsxRuntime.jsx(
247
- "span",
248
- {
249
- "aria-hidden": true,
250
- className: cn(
251
- "inline-block size-2.5 shrink-0 translate-y-[-1px] rounded-full",
252
- s.tone === "card" ? "bg-white" : "bg-oca-ink"
253
- )
254
- }
255
- ),
256
- /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-[0.9375rem] leading-snug", children: s.label })
257
- ] }, i)) })
258
- ] });
259
- }
260
- var LABEL = {
261
- yes: "Yes",
262
- testing: "In testing",
263
- "not-yet": "Not yet",
264
- no: "No"
265
- };
266
- var TONE = {
267
- yes: "text-oca-accent-ink",
268
- testing: "text-foreground",
269
- "not-yet": "text-muted-foreground",
270
- no: "text-muted-foreground"
271
- };
272
- function TruthTable({
273
- rows,
274
- statusHeading = "Status",
275
- whatHeading = "What",
276
- className
277
- }) {
278
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("overflow-hidden rounded-xl border border-oca-hairline-strong", className), children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full border-collapse text-left text-[0.9375rem] md:text-[1rem]", children: [
279
- /* @__PURE__ */ jsxRuntime.jsx("thead", { className: "bg-oca-table-head", children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
280
- /* @__PURE__ */ jsxRuntime.jsx("th", { scope: "col", className: "w-[30%] border-b border-oca-hairline-strong px-4 py-3 font-semibold md:w-[22%]", children: statusHeading }),
281
- /* @__PURE__ */ jsxRuntime.jsx("th", { scope: "col", className: "border-b border-l border-oca-hairline-strong px-4 py-3 font-semibold", children: whatHeading })
282
- ] }) }),
283
- /* @__PURE__ */ jsxRuntime.jsx("tbody", { className: "bg-card", children: rows.map((r, i) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "align-top", children: [
284
- /* @__PURE__ */ jsxRuntime.jsx(
285
- "td",
286
- {
287
- className: cn(
288
- "border-t border-oca-hairline-strong px-4 py-3 font-medium",
289
- i === 0 && "border-t-0",
290
- TONE[r.status]
291
- ),
292
- children: LABEL[r.status]
293
- }
294
- ),
295
- /* @__PURE__ */ jsxRuntime.jsx(
296
- "td",
297
- {
298
- className: cn(
299
- "border-l border-t border-oca-hairline-strong px-4 py-3 leading-relaxed",
300
- i === 0 && "border-t-0"
301
- ),
302
- children: r.what
303
- }
304
- )
305
- ] }, i)) })
306
- ] }) });
307
- }
308
- var INT = new Intl.NumberFormat("en-US", { maximumFractionDigits: 0 });
309
- var COMPACT = new Intl.NumberFormat("en-US", { notation: "compact", maximumFractionDigits: 1 });
310
- function satsText(value, opts = {}) {
311
- if (value == null || !Number.isFinite(value)) return null;
312
- const whole = Math.trunc(value);
313
- const body = (opts.compact ? COMPACT : INT).format(Math.abs(whole));
314
- const sign = whole < 0 ? "\u2212" : opts.signed && whole > 0 ? "+" : "";
315
- const unit = opts.unit === "none" ? "" : whole === 1 || whole === -1 ? " sat" : " sats";
316
- return `${sign}${body}${unit}`;
317
- }
318
- function Sats({ value, unit, compact, signed, unknown = "\u2014", className, ...props }) {
319
- const text = satsText(value, { unit, compact, signed });
320
- if (text === null) {
321
- return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn("oca-tabular text-muted-foreground", className), ...props, children: [
322
- /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, children: unknown }),
323
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "unknown" })
324
- ] });
325
- }
326
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("oca-tabular whitespace-nowrap", className), ...props, children: text });
327
- }
328
- function UsdApprox({
329
- sats,
330
- usdPerBtc,
331
- className
332
- }) {
333
- if (sats == null || usdPerBtc == null || !Number.isFinite(sats) || !Number.isFinite(usdPerBtc)) return null;
334
- const usd = sats / 1e8 * usdPerBtc;
335
- const text = new Intl.NumberFormat("en-US", {
336
- style: "currency",
337
- currency: "USD",
338
- maximumFractionDigits: usd < 1 ? 4 : 2
339
- }).format(usd);
340
- return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn("oca-tabular text-muted-foreground", className), children: [
341
- "\u2248 ",
342
- text
355
+ style: { background: `linear-gradient(to right, ${fade}, transparent)` }
356
+ }
357
+ ),
358
+ /* @__PURE__ */ jsxRuntime.jsx(
359
+ "span",
360
+ {
361
+ "aria-hidden": true,
362
+ className: cn(
363
+ "pointer-events-none absolute inset-y-0 right-0 w-10 transition-opacity duration-150",
364
+ edges.right ? "opacity-100" : "opacity-0"
365
+ ),
366
+ style: { background: `linear-gradient(to left, ${fade}, transparent)` }
367
+ }
368
+ )
343
369
  ] });
344
370
  }
345
- function SatsFigure({
346
- label,
347
- value,
348
- hint,
349
- className
350
- }) {
351
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-1.5", className), children: [
352
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[0.9375rem] text-muted-foreground", children: label }),
353
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "oca-display-3 oca-tabular", children: [
354
- /* @__PURE__ */ jsxRuntime.jsx(Sats, { value, unit: "none" }),
355
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2 text-[0.5em] tracking-normal text-muted-foreground", children: "sats" })
356
- ] }),
357
- hint ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[0.875rem] text-muted-foreground", children: hint }) : null
358
- ] });
371
+ var ShellContext = react.createContext({});
372
+ function useShellPlace() {
373
+ return react.useContext(ShellContext);
359
374
  }
360
- var TOP = "0,3 2,2 6,4 14,0 16,1 6,6";
361
- var LEFT = "0,3 6,6 6,8 0,5";
362
- var RIGHT = "6,6 16,1 16,3 6,8";
363
- var MARK_FACES = { top: "#FED8AB", left: "#FB933C", right: "#EA580B" };
364
- function Mark({ title, size, className, ...rest }) {
375
+ function Spinner({ className, label }) {
365
376
  return /* @__PURE__ */ jsxRuntime.jsxs(
366
377
  "svg",
367
378
  {
368
- viewBox: "0 0 16 8",
369
- width: size,
370
- height: size ? size / 2 : void 0,
371
- role: title ? "img" : void 0,
372
- "aria-hidden": title ? void 0 : true,
373
- className: cn("shrink-0", className),
374
- ...rest,
379
+ viewBox: "0 0 24 24",
380
+ fill: "none",
381
+ role: label ? "status" : void 0,
382
+ "aria-label": label,
383
+ "aria-hidden": label ? void 0 : true,
384
+ className: cn("size-4 animate-spin", className),
375
385
  children: [
376
- title ? /* @__PURE__ */ jsxRuntime.jsx("title", { children: title }) : null,
377
- /* @__PURE__ */ jsxRuntime.jsx("polygon", { points: LEFT, fill: MARK_FACES.left }),
378
- /* @__PURE__ */ jsxRuntime.jsx("polygon", { points: RIGHT, fill: MARK_FACES.right }),
379
- /* @__PURE__ */ jsxRuntime.jsx("polygon", { points: TOP, fill: MARK_FACES.top })
386
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "9", stroke: "currentColor", strokeOpacity: "0.2", strokeWidth: "2.5" }),
387
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 12a9 9 0 0 0-9-9", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round" })
380
388
  ]
381
389
  }
382
390
  );
383
391
  }
392
+ function Skeleton({ className, ...props }) {
393
+ return /* @__PURE__ */ jsxRuntime.jsx(
394
+ "div",
395
+ {
396
+ "data-ui": "skeleton",
397
+ className: cn("animate-pulse rounded-lg bg-[var(--oca-skeleton)]", className),
398
+ ...props
399
+ }
400
+ );
401
+ }
402
+ function useTimedOut(active, ms = 12e3) {
403
+ const [timedOut, setTimedOut] = react.useState(false);
404
+ react.useEffect(() => {
405
+ const t = setTimeout(() => setTimedOut(true), ms);
406
+ return () => clearTimeout(t);
407
+ }, [active, ms]);
408
+ return timedOut;
409
+ }
410
+ react.forwardRef(function Separator2({ className, orientation = "horizontal", decorative = true, ...props }, ref) {
411
+ return /* @__PURE__ */ jsxRuntime.jsx(
412
+ SeparatorPrimitive__namespace.Root,
413
+ {
414
+ ref,
415
+ decorative,
416
+ orientation,
417
+ className: cn(
418
+ "shrink-0 bg-border",
419
+ orientation === "horizontal" ? "h-px w-full" : "h-full w-px",
420
+ className
421
+ ),
422
+ ...props
423
+ }
424
+ );
425
+ });
426
+ var buttonVariants = classVarianceAuthority.cva(
427
+ [
428
+ "inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-full font-medium",
429
+ "transition-[background-color,border-color,color,box-shadow,transform] duration-150",
430
+ "outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
431
+ "active:translate-y-px disabled:pointer-events-none",
432
+ // Disabled is one look for every variant: a quiet grey pill, never a
433
+ // faded black or orange slab that reads as broken.
434
+ "disabled:border disabled:border-border disabled:bg-muted disabled:text-oca-subtle disabled:shadow-none",
435
+ "[&_svg]:pointer-events-none [&_svg]:size-[1.1em] [&_svg]:shrink-0"
436
+ ],
437
+ {
438
+ variants: {
439
+ variant: {
440
+ primary: "bg-primary text-primary-foreground hover:bg-primary/85",
441
+ secondary: "border border-border bg-secondary text-secondary-foreground hover:border-oca-hairline-strong hover:bg-accent",
442
+ brand: "bg-brand text-brand-foreground hover:bg-oca-orange-deep",
443
+ ghost: "text-foreground hover:bg-accent",
444
+ danger: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
445
+ link: "h-auto rounded-none px-0 text-foreground underline decoration-border underline-offset-4 hover:decoration-foreground",
446
+ onInk: "bg-white text-oca-ink hover:bg-white/90",
447
+ onInkOutline: "border border-white/20 text-white hover:bg-white/10"
448
+ },
449
+ size: {
450
+ sm: "h-9 px-4 text-sm",
451
+ md: "h-11 px-5 text-[0.9375rem]",
452
+ lg: "h-14 px-7 text-[1.0625rem]",
453
+ icon: "size-10",
454
+ "icon-sm": "size-8"
455
+ }
456
+ },
457
+ compoundVariants: [{ variant: "link", className: "h-auto px-0" }],
458
+ defaultVariants: { variant: "primary", size: "md" }
459
+ }
460
+ );
461
+ var Button = react.forwardRef(function Button2({ className, variant, size, asChild = false, loading = false, disabled, children, type, ...props }, ref) {
462
+ const Comp = asChild ? reactSlot.Slot : "button";
463
+ return /* @__PURE__ */ jsxRuntime.jsx(
464
+ Comp,
465
+ {
466
+ ref,
467
+ "data-ui": "button",
468
+ className: cn(buttonVariants({ variant, size }), className),
469
+ disabled: asChild ? void 0 : disabled || loading,
470
+ "aria-busy": loading || void 0,
471
+ type: asChild ? void 0 : type ?? "button",
472
+ ...props,
473
+ children: asChild ? children : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
474
+ loading ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, { className: "size-[1.1em]" }) : null,
475
+ children
476
+ ] })
477
+ }
478
+ );
479
+ });
384
480
  function PageHeader({
385
481
  eyebrow,
386
482
  title,
@@ -388,29 +484,117 @@ function PageHeader({
388
484
  actions,
389
485
  className
390
486
  }) {
487
+ const place = useShellPlace();
488
+ const eb = eyebrow === void 0 ? place.section : eyebrow;
391
489
  return /* @__PURE__ */ jsxRuntime.jsxs("header", { className: cn("flex flex-col gap-5 md:flex-row md:items-end md:justify-between", className), children: [
392
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex max-w-[44rem] flex-col gap-3", children: [
393
- eyebrow ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "oca-eyebrow", children: eyebrow }) : null,
490
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 max-w-[44rem] flex-col gap-2.5", children: [
491
+ eb ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "oca-eyebrow", children: eb }) : null,
394
492
  /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "oca-display-3", children: title }),
395
- description ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "oca-body text-[1.0625rem]", children: description }) : null
493
+ description ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "oca-body max-w-[40rem] text-[1.0625rem]", children: description }) : null
396
494
  ] }),
397
- actions ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex shrink-0 flex-wrap items-center gap-3", children: actions }) : null
495
+ actions ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap items-center gap-2.5 md:shrink-0 md:justify-end", children: actions }) : null
398
496
  ] });
399
497
  }
400
- function StatCard({
401
- label,
402
- value,
403
- hint,
404
- className
405
- }) {
406
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-2 rounded-[1.25rem] border border-border bg-card p-5 md:p-6", className), children: [
407
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[0.875rem] text-muted-foreground", children: label }),
408
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "oca-tabular text-[1.75rem] leading-tight tracking-[-0.02em]", children: value }),
409
- hint ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[0.8125rem] leading-snug text-muted-foreground", children: hint }) : null
410
- ] });
498
+ var InStatGrid = react.createContext(false);
499
+ function StatCard({ label, value, hint, className }) {
500
+ const inGrid = react.useContext(InStatGrid);
501
+ return /* @__PURE__ */ jsxRuntime.jsxs(
502
+ "div",
503
+ {
504
+ "data-ui": "stat",
505
+ className: cn(
506
+ "rounded-[1.25rem] border border-border bg-card p-5 md:p-6",
507
+ // In a grid, label, value and hint each share a row with their
508
+ // neighbours, so values line up whatever wraps above them.
509
+ inGrid ? "row-span-3 grid grid-rows-subgrid gap-1.5" : "flex flex-col gap-2",
510
+ className
511
+ ),
512
+ children: [
513
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[0.875rem] leading-snug text-muted-foreground", children: label }),
514
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "self-end break-words oca-tabular text-[1.5rem] leading-tight tracking-[-0.02em] md:text-[1.75rem]", children: value }),
515
+ hint ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[0.8125rem] leading-snug text-muted-foreground", children: hint }) : inGrid ? /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true }) : null
516
+ ]
517
+ }
518
+ );
519
+ }
520
+ var MD_COLS = {
521
+ 1: "md:grid-cols-1",
522
+ 2: "md:grid-cols-2",
523
+ 3: "md:grid-cols-3",
524
+ 4: "md:grid-cols-4"
525
+ };
526
+ var LG_COLS = {
527
+ 1: "lg:grid-cols-1",
528
+ 2: "lg:grid-cols-2",
529
+ 3: "lg:grid-cols-3",
530
+ 4: "lg:grid-cols-4",
531
+ 5: "lg:grid-cols-5"
532
+ };
533
+ var MD_SPAN = {
534
+ 1: "md:col-span-1",
535
+ 2: "md:col-span-2",
536
+ 3: "md:col-span-3",
537
+ 4: "md:col-span-4"
538
+ };
539
+ var LG_SPAN = {
540
+ 1: "lg:col-span-1",
541
+ 2: "lg:col-span-2",
542
+ 3: "lg:col-span-3",
543
+ 4: "lg:col-span-4"
544
+ };
545
+ function statColumns(n) {
546
+ if (n <= 5) return Math.max(1, n);
547
+ if (n % 4 === 0) return 4;
548
+ if (n % 3 === 0) return 3;
549
+ return 4;
550
+ }
551
+ function lastSpan(n, cols) {
552
+ const rest = n % cols;
553
+ return rest === 0 ? 1 : cols - rest + 1;
554
+ }
555
+ function EmptyLine({ children, className }) {
556
+ return /* @__PURE__ */ jsxRuntime.jsx(
557
+ "p",
558
+ {
559
+ className: cn(
560
+ "rounded-[1.25rem] border border-dashed border-oca-hairline-strong px-5 py-4 text-[0.9375rem] text-muted-foreground",
561
+ className
562
+ ),
563
+ children
564
+ }
565
+ );
411
566
  }
412
- function StatGrid({ className, ...props }) {
413
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("grid grid-cols-2 gap-3 md:grid-cols-4 md:gap-4", className), ...props });
567
+ function StatGrid({ columns, empty, isEmpty, className, children, ...props }) {
568
+ const items = react.Children.toArray(children).filter(react.isValidElement);
569
+ const n = items.length;
570
+ const allZero = n > 0 && items.every((el) => "raw" in el.props && (el.props.raw === 0 || el.props.raw === null));
571
+ if (isEmpty ?? allZero) return /* @__PURE__ */ jsxRuntime.jsx(EmptyLine, { className, children: empty ?? "Nothing here yet." });
572
+ const lg = columns ?? statColumns(n);
573
+ const md = lg > 4 ? 3 : lg;
574
+ const mdSpan = lastSpan(n, md);
575
+ const lgSpan = lastSpan(n, lg);
576
+ return /* @__PURE__ */ jsxRuntime.jsx(InStatGrid.Provider, { value: true, children: /* @__PURE__ */ jsxRuntime.jsx(
577
+ "div",
578
+ {
579
+ className: cn(
580
+ "grid gap-3 md:gap-4",
581
+ n === 1 ? "grid-cols-1" : "grid-cols-2",
582
+ MD_COLS[md],
583
+ LG_COLS[lg],
584
+ className
585
+ ),
586
+ ...props,
587
+ children: items.map((el, i) => {
588
+ if (i !== n - 1) return el;
589
+ const span = cn(
590
+ n % 2 === 1 && n > 1 && "max-md:col-span-2",
591
+ (mdSpan > 1 || lgSpan > 1) && MD_SPAN[mdSpan],
592
+ (mdSpan > 1 || lgSpan > 1) && LG_SPAN[lgSpan]
593
+ );
594
+ return span ? react.cloneElement(el, { className: cn(el.props.className, span) }) : el;
595
+ })
596
+ }
597
+ ) });
414
598
  }
415
599
  function KeyValueList({ items, className }) {
416
600
  return /* @__PURE__ */ jsxRuntime.jsx("dl", { className: cn("divide-y divide-border rounded-[1.25rem] border border-border bg-card", className), children: items.map((it, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 px-5 py-3.5 sm:flex-row sm:items-baseline sm:gap-6", children: [
@@ -424,75 +608,103 @@ function DataTable({
424
608
  rowKey,
425
609
  empty,
426
610
  caption,
611
+ phone = "cards",
427
612
  className
428
613
  }) {
429
614
  if (rows.length === 0 && empty) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: empty });
430
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("overflow-x-auto rounded-[1.25rem] border border-border bg-card", className), children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full border-collapse text-left text-[0.9375rem]", children: [
431
- caption ? /* @__PURE__ */ jsxRuntime.jsx("caption", { className: "sr-only", children: caption }) : null,
432
- /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "border-b border-border", children: columns.map((c) => /* @__PURE__ */ jsxRuntime.jsx(
433
- "th",
434
- {
435
- scope: "col",
436
- className: cn(
437
- "whitespace-nowrap px-5 py-3 text-[0.8125rem] font-medium text-muted-foreground",
438
- c.align === "end" && "text-right",
439
- c.wide && "hidden md:table-cell"
440
- ),
441
- children: c.header
442
- },
443
- c.key
444
- )) }) }),
445
- /* @__PURE__ */ jsxRuntime.jsx("tbody", { className: "divide-y divide-border", children: rows.map((r, i) => /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "transition-colors hover:bg-accent/60", children: columns.map((c) => /* @__PURE__ */ jsxRuntime.jsx(
446
- "td",
615
+ const primary = columns.find((c) => c.primary) ?? columns[0];
616
+ const right = (c) => c.numeric || c.align === "end";
617
+ const table = /* @__PURE__ */ jsxRuntime.jsx(
618
+ "div",
619
+ {
620
+ className: cn(
621
+ "overflow-hidden rounded-[1.25rem] border border-border bg-card",
622
+ phone === "cards" && "max-sm:hidden",
623
+ className
624
+ ),
625
+ children: /* @__PURE__ */ jsxRuntime.jsx(ScrollFade, { fade: "var(--card)", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full border-collapse text-left text-[0.9375rem]", children: [
626
+ caption ? /* @__PURE__ */ jsxRuntime.jsx("caption", { className: "sr-only", children: caption }) : null,
627
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "border-b border-border", children: columns.map((c) => /* @__PURE__ */ jsxRuntime.jsx(
628
+ "th",
629
+ {
630
+ scope: "col",
631
+ style: { width: c.width, minWidth: c.minWidth },
632
+ className: cn(
633
+ "whitespace-nowrap px-5 py-3 text-[0.8125rem] font-medium text-muted-foreground",
634
+ right(c) && "text-right",
635
+ c.wide && "hidden md:table-cell"
636
+ ),
637
+ children: c.header
638
+ },
639
+ c.key
640
+ )) }) }),
641
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { className: "divide-y divide-border", children: rows.map((r, i) => /* @__PURE__ */ jsxRuntime.jsx("tr", { className: "transition-colors hover:bg-accent/60", children: columns.map((c) => /* @__PURE__ */ jsxRuntime.jsx(
642
+ "td",
643
+ {
644
+ style: { minWidth: c.minWidth },
645
+ className: cn(
646
+ "px-5 py-3.5 align-middle",
647
+ right(c) && "text-right",
648
+ c.numeric && "whitespace-nowrap oca-tabular",
649
+ c.wide && "hidden md:table-cell"
650
+ ),
651
+ children: c.truncate ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "truncate", style: { maxWidth: c.width ?? "16rem" }, children: c.cell(r) }) : c.cell(r)
652
+ },
653
+ c.key
654
+ )) }, rowKey(r, i))) })
655
+ ] }) })
656
+ }
657
+ );
658
+ if (phone !== "cards") return table;
659
+ const rest = columns.filter((c) => c !== primary && !c.hideOnPhone);
660
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
661
+ table,
662
+ /* @__PURE__ */ jsxRuntime.jsx(
663
+ "ul",
447
664
  {
448
- className: cn(
449
- "px-5 py-3.5 align-middle",
450
- c.align === "end" && "text-right",
451
- c.wide && "hidden md:table-cell"
452
- ),
453
- children: c.cell(r)
454
- },
455
- c.key
456
- )) }, rowKey(r, i))) })
457
- ] }) });
665
+ "aria-label": caption,
666
+ className: cn("divide-y divide-border rounded-[1.25rem] border border-border bg-card sm:hidden", className),
667
+ children: rows.map((r, i) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex flex-col gap-2.5 px-4 py-4", children: [
668
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0 break-words text-[0.9375rem] font-medium", children: primary?.cell(r) }),
669
+ rest.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("dl", { className: "grid grid-cols-[minmax(5.5rem,auto)_minmax(0,1fr)] gap-x-4 gap-y-1.5 text-[0.875rem]", children: rest.map((c) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "contents", children: [
670
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: c.header }),
671
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: cn("min-w-0 break-words", c.numeric && "oca-tabular"), children: c.cell(r) })
672
+ ] }, c.key)) }) : null
673
+ ] }, rowKey(r, i)))
674
+ }
675
+ )
676
+ ] });
458
677
  }
459
678
  function EmptyState({
460
679
  title,
461
680
  children,
462
681
  action,
682
+ icon,
463
683
  className
464
684
  }) {
465
685
  return /* @__PURE__ */ jsxRuntime.jsxs(
466
686
  "div",
467
687
  {
468
688
  className: cn(
469
- "flex flex-col items-center gap-4 rounded-[1.25rem] border border-dashed border-oca-hairline-strong px-6 py-12 text-center",
689
+ "flex flex-col items-center gap-3 rounded-[1.25rem] border border-dashed border-oca-hairline-strong px-6 py-10 text-center",
470
690
  className
471
691
  ),
472
692
  children: [
473
- /* @__PURE__ */ jsxRuntime.jsx(Mark, { size: 56 }),
693
+ icon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mb-1 flex size-11 items-center justify-center rounded-full bg-muted text-muted-foreground [&_svg]:size-5", children: icon }) : null,
474
694
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "oca-title-sm", children: title }),
475
695
  children ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "oca-body max-w-md text-[0.9375rem]", children }) : null,
476
- action ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 flex flex-wrap justify-center gap-3", children: action }) : null
696
+ action ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2 flex flex-wrap justify-center gap-3", children: action }) : null
477
697
  ]
478
698
  }
479
699
  );
480
700
  }
481
- var NOTICE = {
482
- neutral: "border-border bg-card",
483
- info: "border-[color-mix(in_oklab,var(--info)_30%,var(--border))] bg-[color-mix(in_oklab,var(--info)_6%,var(--card))]",
484
- success: "border-[color-mix(in_oklab,var(--success)_30%,var(--border))] bg-[color-mix(in_oklab,var(--success)_6%,var(--card))]",
485
- warning: "border-[color-mix(in_oklab,var(--warning)_35%,var(--border))] bg-[color-mix(in_oklab,var(--warning)_7%,var(--card))]",
486
- danger: "border-[color-mix(in_oklab,var(--destructive)_32%,var(--border))] bg-[color-mix(in_oklab,var(--destructive)_6%,var(--card))]",
487
- brand: "border-[color-mix(in_oklab,var(--oca-orange)_35%,var(--border))] bg-[color-mix(in_oklab,var(--oca-orange)_7%,var(--card))]"
488
- };
489
- var NOTICE_TITLE = {
490
- neutral: "text-foreground",
491
- info: "text-info",
492
- success: "text-success",
493
- warning: "text-warning",
494
- danger: "text-destructive",
495
- brand: "text-oca-accent-ink"
701
+ var NOTICE_KIND = {
702
+ neutral: "neutral",
703
+ info: "neutral",
704
+ success: "neutral",
705
+ brand: "brand",
706
+ warning: "brand",
707
+ danger: "danger"
496
708
  };
497
709
  function Notice({
498
710
  tone = "neutral",
@@ -501,25 +713,60 @@ function Notice({
501
713
  action,
502
714
  className
503
715
  }) {
716
+ const kind = NOTICE_KIND[tone];
504
717
  return /* @__PURE__ */ jsxRuntime.jsxs(
505
718
  "div",
506
719
  {
507
720
  role: tone === "danger" || tone === "warning" ? "alert" : "note",
721
+ "data-tone": kind,
508
722
  className: cn(
509
- "flex flex-col gap-3 rounded-2xl border px-5 py-4 sm:flex-row sm:items-start sm:justify-between",
510
- NOTICE[tone],
723
+ "flex flex-col gap-3 rounded-2xl border border-border bg-card px-5 py-4 sm:flex-row sm:items-start sm:justify-between",
724
+ kind === "danger" && "border-[color-mix(in_oklab,var(--destructive)_40%,var(--border))]",
511
725
  className
512
726
  ),
513
727
  children: [
514
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-col gap-1", children: [
515
- title ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("text-[0.9375rem] font-medium", NOTICE_TITLE[tone]), children: title }) : null,
516
- children ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[0.9375rem] leading-relaxed text-foreground/85", children }) : null
728
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 gap-3", children: [
729
+ kind !== "neutral" ? /* @__PURE__ */ jsxRuntime.jsx(
730
+ "span",
731
+ {
732
+ "aria-hidden": true,
733
+ className: cn(
734
+ "mt-[0.45rem] size-2 shrink-0 rounded-full",
735
+ kind === "brand" ? "bg-oca-orange" : "bg-destructive"
736
+ )
737
+ }
738
+ ) : null,
739
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-col gap-1", children: [
740
+ title ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("text-[0.9375rem] font-medium", kind === "danger" && "text-destructive"), children: title }) : null,
741
+ children ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[0.9375rem] leading-relaxed text-muted-foreground", children }) : null
742
+ ] })
517
743
  ] }),
518
744
  action ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: action }) : null
519
745
  ]
520
746
  }
521
747
  );
522
748
  }
749
+ function LoadingBlock({
750
+ rows = 3,
751
+ timeoutMs = 12e3,
752
+ onRetry,
753
+ label = "Loading",
754
+ className
755
+ }) {
756
+ const timedOut = useTimedOut(true, timeoutMs);
757
+ if (timedOut) {
758
+ return /* @__PURE__ */ jsxRuntime.jsx(
759
+ Notice,
760
+ {
761
+ className,
762
+ title: "This is taking longer than it should.",
763
+ action: /* @__PURE__ */ jsxRuntime.jsx(Button, { size: "sm", variant: "secondary", onClick: onRetry ?? (() => window.location.reload()), children: "Try again" }),
764
+ children: "Check your connection, then try again."
765
+ }
766
+ );
767
+ }
768
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "status", "aria-label": label, className: cn("flex flex-col gap-3", className), children: Array.from({ length: rows }, (_, i) => /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-16 rounded-2xl" }, i)) });
769
+ }
523
770
  function middle(v, head, tail) {
524
771
  return v.length <= head + tail + 1 ? v : `${v.slice(0, head)}\u2026${v.slice(-tail)}`;
525
772
  }
@@ -625,6 +872,252 @@ function ActivityList({ items, empty, className }) {
625
872
  return /* @__PURE__ */ jsxRuntime.jsx("li", { children: it.href ? /* @__PURE__ */ jsxRuntime.jsx("a", { href: it.href, className: "block transition-colors hover:bg-accent/60", children: body }) : body }, it.id);
626
873
  }) });
627
874
  }
875
+ var KIND = {
876
+ package: "text-oca-code-package",
877
+ tag: "text-oca-code-tag",
878
+ link: "text-oca-code-link"
879
+ };
880
+ function PackageCard({ items, className }) {
881
+ return /* @__PURE__ */ jsxRuntime.jsx(
882
+ "div",
883
+ {
884
+ className: cn(
885
+ "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",
886
+ className
887
+ ),
888
+ children: items.map((it, i) => {
889
+ const code = /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("text-[0.9375rem]", KIND[it.kind ?? "package"]), children: it.code });
890
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-col gap-1.5", children: [
891
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-[1.125rem] font-semibold tracking-[-0.01em] text-oca-ink-title", children: it.title }),
892
+ it.href ? /* @__PURE__ */ jsxRuntime.jsx("a", { href: it.href, className: "w-fit underline decoration-transparent underline-offset-4 hover:decoration-current", children: code }) : code,
893
+ it.note ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-[0.9375rem] leading-relaxed text-oca-ink-subtle", children: [
894
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, children: "// " }),
895
+ it.note
896
+ ] }) : null
897
+ ] }, i);
898
+ })
899
+ }
900
+ );
901
+ }
902
+ function CodeBlock({
903
+ code,
904
+ caption,
905
+ copy = true,
906
+ maxLines,
907
+ className
908
+ }) {
909
+ const lines = code.split("\n").length;
910
+ const foldable = maxLines !== void 0 && lines > maxLines + 2;
911
+ const [open, setOpen] = react.useState(false);
912
+ const folded = foldable && !open;
913
+ return /* @__PURE__ */ jsxRuntime.jsxs(
914
+ "figure",
915
+ {
916
+ className: cn(
917
+ "overflow-hidden rounded-[1.25rem] border border-[var(--oca-code-line)] bg-[var(--oca-code-surface)]",
918
+ className
919
+ ),
920
+ children: [
921
+ /* @__PURE__ */ jsxRuntime.jsxs("figcaption", { className: "flex h-11 items-center justify-between gap-3 border-b border-[var(--oca-code-line)] pl-5 pr-2", children: [
922
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-[0.8125rem] text-oca-ink-subtle", children: caption ?? "Code" }),
923
+ copy ? /* @__PURE__ */ jsxRuntime.jsx(
924
+ CopyButton,
925
+ {
926
+ value: code,
927
+ label: "Copy code",
928
+ className: "text-oca-ink-subtle hover:bg-white/10 hover:text-white"
929
+ }
930
+ ) : null
931
+ ] }),
932
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
933
+ /* @__PURE__ */ jsxRuntime.jsx(
934
+ "div",
935
+ {
936
+ className: cn(folded && "overflow-hidden"),
937
+ style: folded ? { maxHeight: `calc(${maxLines} * 1.625em + 2.5rem)` } : void 0,
938
+ children: /* @__PURE__ */ jsxRuntime.jsx(ScrollFade, { fade: "var(--oca-code-surface)", children: /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "w-max min-w-full p-5 font-mono text-[0.875rem] leading-[1.625] text-oca-ink-muted", children: /* @__PURE__ */ jsxRuntime.jsx("code", { children: code }) }) })
939
+ }
940
+ ),
941
+ foldable ? /* @__PURE__ */ jsxRuntime.jsx(
942
+ "div",
943
+ {
944
+ className: cn(
945
+ "flex justify-center px-5 pb-4",
946
+ folded && "absolute inset-x-0 bottom-0 pt-16"
947
+ ),
948
+ style: folded ? { background: "linear-gradient(to top, var(--oca-code-surface) 40%, transparent)" } : void 0,
949
+ children: /* @__PURE__ */ jsxRuntime.jsx(
950
+ "button",
951
+ {
952
+ type: "button",
953
+ onClick: () => setOpen((v) => !v),
954
+ className: "rounded-full border border-white/20 px-4 py-1.5 text-[0.8125rem] text-white transition-colors hover:bg-white/10",
955
+ children: open ? "Show less" : `Show all ${lines} lines`
956
+ }
957
+ )
958
+ }
959
+ ) : null
960
+ ] })
961
+ ]
962
+ }
963
+ );
964
+ }
965
+ function SplitBar({
966
+ segments,
967
+ caption,
968
+ className
969
+ }) {
970
+ return /* @__PURE__ */ jsxRuntime.jsxs("figure", { className: cn("flex flex-col gap-5", className), children: [
971
+ caption ? /* @__PURE__ */ jsxRuntime.jsx("figcaption", { className: "text-[0.9375rem]", children: caption }) : null,
972
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-16 w-full gap-1.5 overflow-hidden rounded-[1.25rem] md:h-20", children: segments.map((s, i) => /* @__PURE__ */ jsxRuntime.jsx(
973
+ "div",
974
+ {
975
+ className: cn(
976
+ "flex min-w-[4.25rem] items-end rounded-[1rem] px-3 pb-2.5 md:px-4 md:pb-3",
977
+ s.tone === "card" ? "bg-white text-oca-ink" : "bg-oca-ink text-white"
978
+ ),
979
+ style: { flexBasis: `${s.pct}%` },
980
+ children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "oca-tabular text-[1.25rem] leading-none tracking-[-0.02em] md:text-[1.875rem]", children: [
981
+ s.pct,
982
+ "%"
983
+ ] })
984
+ },
985
+ i
986
+ )) }),
987
+ /* @__PURE__ */ jsxRuntime.jsx("dl", { className: "grid gap-x-8 gap-y-2 sm:grid-cols-2", children: segments.map((s, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline gap-2.5", children: [
988
+ /* @__PURE__ */ jsxRuntime.jsxs("dt", { className: "sr-only", children: [
989
+ s.pct,
990
+ "%"
991
+ ] }),
992
+ /* @__PURE__ */ jsxRuntime.jsx(
993
+ "span",
994
+ {
995
+ "aria-hidden": true,
996
+ className: cn(
997
+ "inline-block size-2.5 shrink-0 translate-y-[-1px] rounded-full",
998
+ s.tone === "card" ? "bg-white" : "bg-oca-ink"
999
+ )
1000
+ }
1001
+ ),
1002
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-[0.9375rem] leading-snug", children: s.label })
1003
+ ] }, i)) })
1004
+ ] });
1005
+ }
1006
+ var LABEL = {
1007
+ yes: "Yes",
1008
+ testing: "In testing",
1009
+ "not-yet": "Not yet",
1010
+ no: "No"
1011
+ };
1012
+ var TONE = {
1013
+ yes: "text-oca-accent-ink",
1014
+ testing: "text-foreground",
1015
+ "not-yet": "text-muted-foreground",
1016
+ no: "text-muted-foreground"
1017
+ };
1018
+ function TruthTable({
1019
+ rows,
1020
+ statusHeading = "Status",
1021
+ whatHeading = "What",
1022
+ className
1023
+ }) {
1024
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1025
+ /* @__PURE__ */ jsxRuntime.jsx(
1026
+ "ul",
1027
+ {
1028
+ className: cn(
1029
+ "divide-y divide-oca-hairline-strong overflow-hidden rounded-xl border border-oca-hairline-strong bg-card sm:hidden",
1030
+ className
1031
+ ),
1032
+ children: rows.map((r, i) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex flex-col gap-1.5 px-4 py-3.5", children: [
1033
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("text-[0.875rem] font-medium", TONE[r.status]), children: LABEL[r.status] }),
1034
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[0.9375rem] leading-relaxed", children: r.what })
1035
+ ] }, i))
1036
+ }
1037
+ ),
1038
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("overflow-hidden rounded-xl border border-oca-hairline-strong max-sm:hidden", className), children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full border-collapse text-left text-[0.9375rem] md:text-[1rem]", children: [
1039
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { className: "bg-oca-table-head", children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
1040
+ /* @__PURE__ */ jsxRuntime.jsx("th", { scope: "col", className: "w-[30%] border-b border-oca-hairline-strong px-4 py-3 font-semibold md:w-[22%]", children: statusHeading }),
1041
+ /* @__PURE__ */ jsxRuntime.jsx("th", { scope: "col", className: "border-b border-l border-oca-hairline-strong px-4 py-3 font-semibold", children: whatHeading })
1042
+ ] }) }),
1043
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { className: "bg-card", children: rows.map((r, i) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "align-top", children: [
1044
+ /* @__PURE__ */ jsxRuntime.jsx(
1045
+ "td",
1046
+ {
1047
+ className: cn(
1048
+ "border-t border-oca-hairline-strong px-4 py-3 font-medium",
1049
+ i === 0 && "border-t-0",
1050
+ TONE[r.status]
1051
+ ),
1052
+ children: LABEL[r.status]
1053
+ }
1054
+ ),
1055
+ /* @__PURE__ */ jsxRuntime.jsx(
1056
+ "td",
1057
+ {
1058
+ className: cn(
1059
+ "border-l border-t border-oca-hairline-strong px-4 py-3 leading-relaxed",
1060
+ i === 0 && "border-t-0"
1061
+ ),
1062
+ children: r.what
1063
+ }
1064
+ )
1065
+ ] }, i)) })
1066
+ ] }) })
1067
+ ] });
1068
+ }
1069
+ var INT = new Intl.NumberFormat("en-US", { maximumFractionDigits: 0 });
1070
+ var COMPACT = new Intl.NumberFormat("en-US", { notation: "compact", maximumFractionDigits: 1 });
1071
+ function satsText(value, opts = {}) {
1072
+ if (value == null || !Number.isFinite(value)) return null;
1073
+ const whole = Math.trunc(value);
1074
+ const body = (opts.compact ? COMPACT : INT).format(Math.abs(whole));
1075
+ const sign = whole < 0 ? "\u2212" : opts.signed && whole > 0 ? "+" : "";
1076
+ const unit = opts.unit === "none" ? "" : whole === 1 || whole === -1 ? " sat" : " sats";
1077
+ return `${sign}${body}${unit}`;
1078
+ }
1079
+ function Sats({ value, unit, compact, signed, unknown = "\u2014", className, ...props }) {
1080
+ const text = satsText(value, { unit, compact, signed });
1081
+ if (text === null) {
1082
+ return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn("oca-tabular text-muted-foreground", className), ...props, children: [
1083
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, children: unknown }),
1084
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "unknown" })
1085
+ ] });
1086
+ }
1087
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("oca-tabular whitespace-nowrap", className), ...props, children: text });
1088
+ }
1089
+ function UsdApprox({
1090
+ sats,
1091
+ usdPerBtc,
1092
+ className
1093
+ }) {
1094
+ if (sats == null || usdPerBtc == null || !Number.isFinite(sats) || !Number.isFinite(usdPerBtc)) return null;
1095
+ const usd = sats / 1e8 * usdPerBtc;
1096
+ const text = new Intl.NumberFormat("en-US", {
1097
+ style: "currency",
1098
+ currency: "USD",
1099
+ maximumFractionDigits: usd < 1 ? 4 : 2
1100
+ }).format(usd);
1101
+ return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn("oca-tabular text-muted-foreground", className), children: [
1102
+ "\u2248 ",
1103
+ text
1104
+ ] });
1105
+ }
1106
+ function SatsFigure({
1107
+ label,
1108
+ value,
1109
+ hint,
1110
+ className
1111
+ }) {
1112
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-1.5", className), children: [
1113
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[0.9375rem] text-muted-foreground", children: label }),
1114
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "oca-display-3 oca-tabular", children: [
1115
+ /* @__PURE__ */ jsxRuntime.jsx(Sats, { value, unit: "none" }),
1116
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2 text-[0.5em] tracking-normal text-muted-foreground", children: "sats" })
1117
+ ] }),
1118
+ hint ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[0.875rem] text-muted-foreground", children: hint }) : null
1119
+ ] });
1120
+ }
628
1121
 
629
1122
  exports.Accent = Accent;
630
1123
  exports.ActivityList = ActivityList;
@@ -633,15 +1126,20 @@ exports.Container = Container;
633
1126
  exports.CopyButton = CopyButton;
634
1127
  exports.DataTable = DataTable;
635
1128
  exports.Display = Display;
1129
+ exports.DocHeader = DocHeader;
1130
+ exports.DocLayout = DocLayout;
1131
+ exports.EmptyLine = EmptyLine;
636
1132
  exports.EmptyState = EmptyState;
637
1133
  exports.Eyebrow = Eyebrow;
638
1134
  exports.Footnote = Footnote;
639
1135
  exports.HashChip = HashChip;
640
1136
  exports.KeyValueList = KeyValueList;
641
1137
  exports.Lead = Lead;
1138
+ exports.LoadingBlock = LoadingBlock;
642
1139
  exports.Notice = Notice;
643
1140
  exports.PackageCard = PackageCard;
644
1141
  exports.PageHeader = PageHeader;
1142
+ exports.PageHero = PageHero;
645
1143
  exports.ProgressSteps = ProgressSteps;
646
1144
  exports.Prose = Prose;
647
1145
  exports.Sats = Sats;