@nebutra/ui 0.2.2 → 2.0.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 (43) hide show
  1. package/dist/animate-in-BlvjVh2S.d.ts +250 -0
  2. package/dist/{canonical-CrO71UPO.d.ts → canonical-Bf4czR2u.d.ts} +225 -211
  3. package/dist/chat/index.d.ts +1 -0
  4. package/dist/chat/index.js +3 -0
  5. package/dist/chat/index.js.map +1 -0
  6. package/dist/components/index.d.ts +58 -123
  7. package/dist/components/index.js +504 -203
  8. package/dist/components/index.js.map +1 -1
  9. package/dist/editorial/index.d.ts +404 -0
  10. package/dist/editorial/index.js +868 -0
  11. package/dist/editorial/index.js.map +1 -0
  12. package/dist/icons/index.d.ts +1 -0
  13. package/dist/layout/index.d.ts +2 -2
  14. package/dist/layout/index.js +116 -26
  15. package/dist/layout/index.js.map +1 -1
  16. package/dist/layouts/index.d.ts +80 -2
  17. package/dist/layouts/index.js +13 -11
  18. package/dist/layouts/index.js.map +1 -1
  19. package/dist/patterns/index.d.ts +4 -5
  20. package/dist/patterns/index.js +221 -106
  21. package/dist/patterns/index.js.map +1 -1
  22. package/dist/primitives/canonical.d.ts +4 -3
  23. package/dist/primitives/canonical.js +609 -197
  24. package/dist/primitives/canonical.js.map +1 -1
  25. package/dist/primitives/index.d.ts +213 -21
  26. package/dist/primitives/index.js +2209 -1317
  27. package/dist/primitives/index.js.map +1 -1
  28. package/dist/tailwind.preset.d.ts +2 -2
  29. package/dist/tailwind.preset.js +1 -1
  30. package/dist/tailwind.preset.js.map +1 -1
  31. package/dist/typography/fonts.css +21 -26
  32. package/dist/typography/index.d.ts +4 -4
  33. package/dist/typography/index.js +1 -1
  34. package/dist/typography/index.js.map +1 -1
  35. package/dist/utils/auth-surfaces.d.ts +33 -0
  36. package/dist/utils/auth-surfaces.js +9 -0
  37. package/dist/utils/auth-surfaces.js.map +1 -0
  38. package/dist/utils/index.d.ts +33 -5
  39. package/dist/utils/index.js +15 -3
  40. package/dist/utils/index.js.map +1 -1
  41. package/package.json +43 -9
  42. package/src/styles/sources.css +10 -0
  43. package/src/typography/fonts.css +21 -26
@@ -0,0 +1,868 @@
1
+ import { ArrowUpRight, WarningFill, Warning, CheckCircle, Sparkles, Information, Globe, Plus, External } from '@nebutra/icons';
2
+ import { clsx } from 'clsx';
3
+ import { twMerge } from 'tailwind-merge';
4
+ import { cva } from 'class-variance-authority';
5
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
6
+ import { SiYoutube, SiX, SiGithub } from '@icons-pack/react-simple-icons';
7
+
8
+ // src/editorial/editorial-author-bio.tsx
9
+ function cn(...inputs) {
10
+ return twMerge(clsx(inputs));
11
+ }
12
+ var EDITORIAL_EYEBROW = "text-[0.6875rem] font-semibold uppercase leading-none tracking-[0.14em] text-muted-foreground";
13
+ var EDITORIAL_CAPTION = "text-sm leading-6 text-muted-foreground";
14
+ var EDITORIAL_BODY = "text-[0.9375rem] leading-7 text-muted-foreground";
15
+ var EDITORIAL_TITLE = "text-base font-semibold leading-6 text-foreground";
16
+ var EDITORIAL_FIGURE = "font-mono font-semibold tabular-nums text-foreground";
17
+ var editorialBlock = cva("", {
18
+ variants: {
19
+ width: {
20
+ column: "",
21
+ breakout: "lg:-mx-12",
22
+ full: "lg:-mx-20"
23
+ },
24
+ spacing: {
25
+ none: "",
26
+ tight: "my-8",
27
+ normal: "my-10",
28
+ loose: "my-14"
29
+ }
30
+ },
31
+ defaultVariants: { width: "column", spacing: "normal" }
32
+ });
33
+ var editorialFrame = cva("border border-border bg-background", {
34
+ variants: {
35
+ radius: {
36
+ card: "rounded-[var(--radius-xl)]",
37
+ panel: "rounded-[var(--radius-2xl)]",
38
+ inner: "rounded-[var(--radius-md)]"
39
+ },
40
+ elevation: {
41
+ flat: "",
42
+ resting: "shadow-ambient-sm",
43
+ raised: "shadow-ambient-md"
44
+ }
45
+ },
46
+ defaultVariants: { radius: "card", elevation: "resting" }
47
+ });
48
+ var EDITORIAL_TONES = ["note", "insight", "success", "warning", "danger"];
49
+ var TONE_ACCENT = {
50
+ note: "var(--neutral-8)",
51
+ insight: "hsl(var(--primary))",
52
+ success: "var(--status-success)",
53
+ warning: "var(--status-warning)",
54
+ danger: "var(--status-danger)"
55
+ };
56
+ function editorialToneAccent(tone) {
57
+ return TONE_ACCENT[tone];
58
+ }
59
+ function isEditorialTone(value) {
60
+ return typeof value === "string" && EDITORIAL_TONES.includes(value);
61
+ }
62
+ function editorialToneStyle(tone) {
63
+ return { "--editorial-tone": editorialToneAccent(tone) };
64
+ }
65
+ var EDITORIAL_TONE_FG = "text-[color:var(--editorial-tone)]";
66
+ var EDITORIAL_TONE_WASH = "bg-[color-mix(in_srgb,var(--editorial-tone)_5%,transparent)]";
67
+ var EDITORIAL_TONE_PLATE = "bg-[color-mix(in_srgb,var(--editorial-tone)_12%,transparent)]";
68
+ function EditorialAuthorBio({
69
+ avatar,
70
+ bio,
71
+ className,
72
+ label = "Written by",
73
+ links = [],
74
+ name,
75
+ role
76
+ }) {
77
+ if (!name.trim()) return null;
78
+ const visibleLinks = links.filter((link) => link.href && link.label);
79
+ return /* @__PURE__ */ jsxs(
80
+ "aside",
81
+ {
82
+ className: cn(
83
+ editorialBlock({ spacing: "loose", width: "breakout" }),
84
+ editorialFrame({ elevation: "resting", radius: "panel" }),
85
+ "flex flex-col gap-4 px-6 py-6 sm:flex-row sm:gap-5",
86
+ className
87
+ ),
88
+ children: [
89
+ avatar && /* @__PURE__ */ jsx("span", { className: "size-12 shrink-0 overflow-hidden rounded-full bg-muted", children: avatar }),
90
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
91
+ /* @__PURE__ */ jsx("div", { className: EDITORIAL_EYEBROW, children: label }),
92
+ /* @__PURE__ */ jsx("p", { className: "mt-2 text-base font-semibold leading-6 text-foreground", children: name }),
93
+ role && /* @__PURE__ */ jsx("p", { className: "mt-0.5 text-sm text-muted-foreground", children: role }),
94
+ bio && /* @__PURE__ */ jsx("p", { className: cn("mt-3", EDITORIAL_BODY), children: bio }),
95
+ visibleLinks.length > 0 && /* @__PURE__ */ jsx("div", { className: "mt-4 flex flex-wrap gap-2", children: visibleLinks.map((link) => /* @__PURE__ */ jsxs(
96
+ "a",
97
+ {
98
+ className: "inline-flex items-center gap-1.5 rounded-full border border-border px-3 py-1.5 text-sm font-medium text-foreground transition-colors hover:bg-muted",
99
+ href: link.href,
100
+ rel: "noopener noreferrer",
101
+ target: "_blank",
102
+ children: [
103
+ link.label,
104
+ /* @__PURE__ */ jsx(ArrowUpRight, { "aria-hidden": true, className: "size-3.5 text-muted-foreground" })
105
+ ]
106
+ },
107
+ link.key ?? link.href
108
+ )) })
109
+ ] })
110
+ ]
111
+ }
112
+ );
113
+ }
114
+ var TONE_ICON = {
115
+ note: Information,
116
+ insight: Sparkles,
117
+ success: CheckCircle,
118
+ warning: Warning,
119
+ danger: WarningFill
120
+ };
121
+ function EditorialCallout({
122
+ children,
123
+ className,
124
+ label,
125
+ title,
126
+ tone = "note"
127
+ }) {
128
+ if (!title && !children) return null;
129
+ const Icon = TONE_ICON[tone];
130
+ const eyebrow = title ?? label ?? tone;
131
+ return /* @__PURE__ */ jsxs(
132
+ "aside",
133
+ {
134
+ className: cn(
135
+ editorialBlock({ spacing: "normal" }),
136
+ editorialFrame({ elevation: "resting" }),
137
+ EDITORIAL_TONE_WASH,
138
+ "relative overflow-hidden pl-6 pr-5 py-5",
139
+ className
140
+ ),
141
+ style: editorialToneStyle(tone),
142
+ children: [
143
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "absolute inset-y-0 left-0 w-0.5 bg-[var(--editorial-tone)]" }),
144
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-3.5", children: [
145
+ /* @__PURE__ */ jsx(
146
+ "span",
147
+ {
148
+ "aria-hidden": true,
149
+ className: cn(
150
+ "mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-full",
151
+ EDITORIAL_TONE_PLATE,
152
+ EDITORIAL_TONE_FG
153
+ ),
154
+ children: /* @__PURE__ */ jsx(Icon, { className: "size-3.5" })
155
+ }
156
+ ),
157
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
158
+ /* @__PURE__ */ jsx("div", { className: EDITORIAL_EYEBROW, children: eyebrow }),
159
+ typeof children === "string" ? /* @__PURE__ */ jsx("p", { className: cn("mt-2.5", EDITORIAL_BODY), children }) : children && /* @__PURE__ */ jsx("div", { className: cn("mt-2.5", EDITORIAL_BODY), children })
160
+ ] })
161
+ ] })
162
+ ]
163
+ }
164
+ );
165
+ }
166
+ var VIEWBOX_WIDTH = 640;
167
+ var VIEWBOX_HEIGHT = 200;
168
+ function formatPoint(point) {
169
+ return point.display ?? String(point.value);
170
+ }
171
+ function BarChart({ points, max }) {
172
+ return /* @__PURE__ */ jsx("div", { className: "grid gap-3", children: points.map((point, index) => {
173
+ const share = max > 0 ? Math.max(point.value / max * 100, 1.5) : 0;
174
+ return /* @__PURE__ */ jsxs(
175
+ "div",
176
+ {
177
+ className: "grid grid-cols-[minmax(5rem,9rem)_1fr_auto] items-center gap-3",
178
+ children: [
179
+ /* @__PURE__ */ jsx("span", { className: "truncate text-sm text-muted-foreground", title: point.label, children: point.label }),
180
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "h-2.5 overflow-hidden rounded-full bg-muted", children: /* @__PURE__ */ jsx(
181
+ "span",
182
+ {
183
+ className: "block h-full w-[var(--editorial-bar)] rounded-full bg-primary",
184
+ style: { "--editorial-bar": `${share}%` }
185
+ }
186
+ ) }),
187
+ /* @__PURE__ */ jsx("span", { className: "font-mono text-sm font-semibold tabular-nums text-foreground", children: formatPoint(point) })
188
+ ]
189
+ },
190
+ point.key ?? `${index}-${point.label}`
191
+ );
192
+ }) });
193
+ }
194
+ function LineChart({ max, points }) {
195
+ const step = points.length > 1 ? VIEWBOX_WIDTH / (points.length - 1) : 0;
196
+ const coords = points.map((point, index) => {
197
+ const x = points.length > 1 ? index * step : VIEWBOX_WIDTH / 2;
198
+ const y = VIEWBOX_HEIGHT - (max > 0 ? point.value / max * (VIEWBOX_HEIGHT - 16) : 0) - 8;
199
+ return { x, y };
200
+ });
201
+ const path = coords.map((coord, index) => `${index === 0 ? "M" : "L"}${coord.x.toFixed(1)} ${coord.y.toFixed(1)}`).join(" ");
202
+ return /* @__PURE__ */ jsxs("div", { children: [
203
+ /* @__PURE__ */ jsxs(
204
+ "svg",
205
+ {
206
+ "aria-hidden": true,
207
+ className: "h-40 w-full",
208
+ preserveAspectRatio: "none",
209
+ viewBox: `0 0 ${VIEWBOX_WIDTH} ${VIEWBOX_HEIGHT}`,
210
+ children: [
211
+ /* @__PURE__ */ jsx("title", { children: "Trend" }),
212
+ /* @__PURE__ */ jsx(
213
+ "path",
214
+ {
215
+ d: `${path} L${VIEWBOX_WIDTH} ${VIEWBOX_HEIGHT} L0 ${VIEWBOX_HEIGHT} Z`,
216
+ fill: "color-mix(in srgb, hsl(var(--primary)) 10%, transparent)"
217
+ }
218
+ ),
219
+ /* @__PURE__ */ jsx(
220
+ "path",
221
+ {
222
+ d: path,
223
+ fill: "none",
224
+ stroke: "hsl(var(--primary))",
225
+ strokeLinecap: "round",
226
+ strokeLinejoin: "round",
227
+ strokeWidth: 2,
228
+ vectorEffect: "non-scaling-stroke"
229
+ }
230
+ )
231
+ ]
232
+ }
233
+ ),
234
+ /* @__PURE__ */ jsx("div", { className: "mt-3 flex justify-between gap-2", children: points.map((point, index) => /* @__PURE__ */ jsxs("div", { className: "min-w-0 text-center", children: [
235
+ /* @__PURE__ */ jsx("div", { className: "font-mono text-sm font-semibold tabular-nums text-foreground", children: formatPoint(point) }),
236
+ /* @__PURE__ */ jsx("div", { className: "mt-0.5 truncate text-xs text-muted-foreground", children: point.label })
237
+ ] }, point.key ?? `${index}-${point.label}`)) })
238
+ ] });
239
+ }
240
+ function EditorialChart({
241
+ caption,
242
+ className,
243
+ label,
244
+ points,
245
+ title,
246
+ variant = "bar"
247
+ }) {
248
+ const visible = points.filter((point) => point.label.trim() && Number.isFinite(point.value));
249
+ if (!visible.length) return null;
250
+ const max = Math.max(...visible.map((point) => point.value), 0);
251
+ return /* @__PURE__ */ jsxs("figure", { className: cn(editorialBlock({ spacing: "loose", width: "breakout" }), className), children: [
252
+ /* @__PURE__ */ jsxs("div", { className: cn(editorialFrame({ elevation: "resting" }), "px-5 py-5 sm:px-6"), children: [
253
+ (label || title) && /* @__PURE__ */ jsxs("div", { className: "mb-5", children: [
254
+ label && /* @__PURE__ */ jsx("div", { className: EDITORIAL_EYEBROW, children: label }),
255
+ title && /* @__PURE__ */ jsx("h3", { className: "mt-2 text-base font-semibold leading-6 text-foreground", children: title })
256
+ ] }),
257
+ variant === "line" ? /* @__PURE__ */ jsx(LineChart, { max, points: visible }) : /* @__PURE__ */ jsx(BarChart, { max, points: visible }),
258
+ /* @__PURE__ */ jsxs("table", { className: "sr-only", children: [
259
+ /* @__PURE__ */ jsx("caption", { children: title ?? label ?? "Chart data" }),
260
+ /* @__PURE__ */ jsx("tbody", { children: visible.map((point, index) => /* @__PURE__ */ jsxs("tr", { children: [
261
+ /* @__PURE__ */ jsx("th", { scope: "row", children: point.label }),
262
+ /* @__PURE__ */ jsx("td", { children: formatPoint(point) })
263
+ ] }, point.key ?? `${index}-${point.label}`)) })
264
+ ] })
265
+ ] }),
266
+ caption && /* @__PURE__ */ jsx("figcaption", { className: cn("mt-3", EDITORIAL_CAPTION), children: caption })
267
+ ] });
268
+ }
269
+ function EditorialComparisonTable({
270
+ className,
271
+ columns,
272
+ dimensionLabel = "Dimension",
273
+ label,
274
+ rows,
275
+ title
276
+ }) {
277
+ const visibleColumns = columns.filter(Boolean);
278
+ const visibleRows = rows.filter((row) => row.label || row.cells.some(Boolean));
279
+ if (visibleColumns.length < 2 || !visibleRows.length) return null;
280
+ return /* @__PURE__ */ jsxs(
281
+ "section",
282
+ {
283
+ className: cn(editorialBlock({ spacing: "loose", width: "breakout" }), className),
284
+ "aria-label": title ?? label ?? void 0,
285
+ children: [
286
+ (label || title) && /* @__PURE__ */ jsxs("div", { className: "mb-5", children: [
287
+ label && /* @__PURE__ */ jsx("div", { className: EDITORIAL_EYEBROW, children: label }),
288
+ title && /* @__PURE__ */ jsx("h3", { className: "mt-2 text-lg font-semibold leading-6 text-foreground", children: title })
289
+ ] }),
290
+ /* @__PURE__ */ jsx("div", { className: cn(editorialFrame({ elevation: "resting" }), "overflow-hidden"), children: /* @__PURE__ */ jsxs("table", { className: "w-full border-collapse text-left text-sm", children: [
291
+ /* @__PURE__ */ jsx("thead", { className: "hidden md:table-header-group", children: /* @__PURE__ */ jsxs("tr", { className: "bg-muted", children: [
292
+ /* @__PURE__ */ jsx(
293
+ "th",
294
+ {
295
+ className: "w-[22%] border-b border-border px-4 py-3 font-semibold text-foreground",
296
+ scope: "col",
297
+ children: dimensionLabel
298
+ }
299
+ ),
300
+ visibleColumns.map((column) => /* @__PURE__ */ jsx(
301
+ "th",
302
+ {
303
+ className: "border-b border-border px-4 py-3 font-semibold text-foreground",
304
+ scope: "col",
305
+ children: column
306
+ },
307
+ column
308
+ ))
309
+ ] }) }),
310
+ /* @__PURE__ */ jsx("tbody", { className: "block md:table-row-group", children: visibleRows.map((row, rowIndex) => /* @__PURE__ */ jsxs(
311
+ "tr",
312
+ {
313
+ className: "block border-b border-border last:border-b-0 md:table-row",
314
+ children: [
315
+ /* @__PURE__ */ jsx(
316
+ "th",
317
+ {
318
+ className: "block bg-muted px-4 pb-2 pt-3 text-left align-top font-semibold text-foreground md:table-cell md:bg-transparent md:py-3",
319
+ scope: "row",
320
+ children: row.label
321
+ }
322
+ ),
323
+ visibleColumns.map((column, cellIndex) => /* @__PURE__ */ jsxs(
324
+ "td",
325
+ {
326
+ className: "block px-4 py-2 align-top leading-6 text-muted-foreground last:pb-3 md:table-cell md:py-3 md:last:pb-3",
327
+ children: [
328
+ /* @__PURE__ */ jsx("span", { className: cn("mb-1 block md:hidden", EDITORIAL_EYEBROW), children: column }),
329
+ row.cells[cellIndex]
330
+ ]
331
+ },
332
+ `${row.key ?? rowIndex}-${column}`
333
+ ))
334
+ ]
335
+ },
336
+ row.key ?? `${rowIndex}-${row.label}`
337
+ )) })
338
+ ] }) })
339
+ ]
340
+ }
341
+ );
342
+ }
343
+ function EditorialDataTable({ caption, className, head, rows }) {
344
+ if (!head.length || !rows.length) return null;
345
+ return /* @__PURE__ */ jsxs("figure", { className: cn(editorialBlock({ spacing: "normal", width: "breakout" }), className), children: [
346
+ /* @__PURE__ */ jsx("div", { className: cn(editorialFrame({ elevation: "resting" }), "overflow-x-auto"), children: /* @__PURE__ */ jsxs("table", { className: "w-full min-w-[36rem] border-collapse text-left text-sm text-muted-foreground", children: [
347
+ /* @__PURE__ */ jsx("thead", { className: "bg-muted", children: /* @__PURE__ */ jsx("tr", { children: head.map((cell, index) => /* @__PURE__ */ jsx(
348
+ "th",
349
+ {
350
+ className: "border-b border-border px-4 py-3 font-semibold text-foreground",
351
+ scope: "col",
352
+ children: cell
353
+ },
354
+ `head-${index}`
355
+ )) }) }),
356
+ /* @__PURE__ */ jsx("tbody", { children: rows.map((row) => /* @__PURE__ */ jsx("tr", { className: "border-b border-border last:border-b-0", children: row.cells.map((cell, cellIndex) => /* @__PURE__ */ jsx("td", { className: "px-4 py-3 align-top leading-6", children: cell }, `${row.key}-${cellIndex}`)) }, row.key)) })
357
+ ] }) }),
358
+ caption && /* @__PURE__ */ jsx("figcaption", { className: cn("mt-3", EDITORIAL_CAPTION), children: caption })
359
+ ] });
360
+ }
361
+ function EditorialDivider({ className }) {
362
+ return /* @__PURE__ */ jsxs("div", { className: cn("my-14 flex items-center gap-4", className), children: [
363
+ /* @__PURE__ */ jsx("hr", { className: "h-px flex-1 border-0 bg-border" }),
364
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "size-1.5 rounded-full bg-[hsl(var(--primary))]" }),
365
+ /* @__PURE__ */ jsx("hr", { className: "h-px flex-1 border-0 bg-border" })
366
+ ] });
367
+ }
368
+ var EDITORIAL_EMBED_PROVIDERS = ["youtube", "x", "github", "website"];
369
+ var PROVIDER_ICON = {
370
+ github: SiGithub,
371
+ website: Globe,
372
+ x: SiX,
373
+ youtube: SiYoutube
374
+ };
375
+ var PROVIDER_NAME = {
376
+ github: "GitHub",
377
+ website: "Website",
378
+ x: "X",
379
+ youtube: "YouTube"
380
+ };
381
+ function hostname(url) {
382
+ try {
383
+ return new URL(url).hostname.replace(/^www\./, "");
384
+ } catch {
385
+ return null;
386
+ }
387
+ }
388
+ function isEditorialEmbedProvider(value) {
389
+ return typeof value === "string" && EDITORIAL_EMBED_PROVIDERS.includes(value);
390
+ }
391
+ function EditorialEmbedCard({
392
+ caption,
393
+ className,
394
+ provider = "website",
395
+ title,
396
+ url
397
+ }) {
398
+ if (!title.trim() || !url.trim()) return null;
399
+ const Icon = PROVIDER_ICON[provider];
400
+ const host = hostname(url);
401
+ return /* @__PURE__ */ jsxs("figure", { className: cn(editorialBlock({ spacing: "normal" }), className), children: [
402
+ /* @__PURE__ */ jsxs(
403
+ "a",
404
+ {
405
+ className: cn(
406
+ editorialFrame({ elevation: "resting" }),
407
+ "group flex items-center gap-4 p-4 transition-shadow hover:shadow-ambient-md"
408
+ ),
409
+ href: url,
410
+ rel: "noopener noreferrer",
411
+ target: "_blank",
412
+ children: [
413
+ /* @__PURE__ */ jsx(
414
+ "span",
415
+ {
416
+ "aria-hidden": true,
417
+ className: "flex size-10 shrink-0 items-center justify-center rounded-[var(--radius-md)] border border-border bg-muted text-foreground",
418
+ children: /* @__PURE__ */ jsx(Icon, { className: "size-4" })
419
+ }
420
+ ),
421
+ /* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1", children: [
422
+ /* @__PURE__ */ jsx("span", { className: "block text-[0.9375rem] font-semibold leading-6 text-foreground", children: title }),
423
+ /* @__PURE__ */ jsx("span", { className: "mt-0.5 block truncate text-sm text-muted-foreground", children: [PROVIDER_NAME[provider], host].filter(Boolean).join(" \xB7 ") })
424
+ ] }),
425
+ /* @__PURE__ */ jsx(
426
+ ArrowUpRight,
427
+ {
428
+ "aria-hidden": true,
429
+ className: "size-4 shrink-0 text-muted-foreground transition-colors group-hover:text-[hsl(var(--primary))]"
430
+ }
431
+ )
432
+ ]
433
+ }
434
+ ),
435
+ caption && /* @__PURE__ */ jsx("figcaption", { className: cn("mt-2.5", EDITORIAL_CAPTION), children: caption })
436
+ ] });
437
+ }
438
+ function EditorialEntityChip({ className, href, logo, name }) {
439
+ if (!name.trim()) return null;
440
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
441
+ logo && /* @__PURE__ */ jsx(
442
+ "span",
443
+ {
444
+ "aria-hidden": true,
445
+ className: "inline-flex size-[1.1em] shrink-0 items-center justify-center overflow-hidden rounded-[0.25em] bg-muted",
446
+ children: logo
447
+ }
448
+ ),
449
+ /* @__PURE__ */ jsx("span", { children: name })
450
+ ] });
451
+ const shared = cn(
452
+ "mx-0.5 inline-flex items-baseline gap-1 align-baseline font-medium text-foreground",
453
+ className
454
+ );
455
+ if (!href) {
456
+ return /* @__PURE__ */ jsx("span", { className: shared, children: content });
457
+ }
458
+ return /* @__PURE__ */ jsx(
459
+ "a",
460
+ {
461
+ className: cn(
462
+ shared,
463
+ "underline decoration-border decoration-dotted underline-offset-4 transition-colors hover:decoration-[hsl(var(--primary))] hover:decoration-solid"
464
+ ),
465
+ href,
466
+ rel: "noopener noreferrer",
467
+ target: "_blank",
468
+ children: content
469
+ }
470
+ );
471
+ }
472
+ function EditorialFaq({
473
+ className,
474
+ defaultOpenFirst = false,
475
+ items,
476
+ label,
477
+ title
478
+ }) {
479
+ const visible = items.filter((item) => item.question.trim() && item.answer.trim());
480
+ if (!visible.length) return null;
481
+ return /* @__PURE__ */ jsxs(
482
+ "section",
483
+ {
484
+ "aria-label": title ?? label ?? void 0,
485
+ className: cn(editorialBlock({ spacing: "loose" }), className),
486
+ children: [
487
+ (label || title) && /* @__PURE__ */ jsxs("div", { className: "mb-5", children: [
488
+ label && /* @__PURE__ */ jsx("div", { className: EDITORIAL_EYEBROW, children: label }),
489
+ title && /* @__PURE__ */ jsx("h3", { className: "mt-2 text-lg font-semibold leading-6 text-foreground", children: title })
490
+ ] }),
491
+ /* @__PURE__ */ jsx("div", { className: "divide-y divide-border border-y border-border", children: visible.map((item, index) => /* @__PURE__ */ jsxs(
492
+ "details",
493
+ {
494
+ className: "group",
495
+ open: defaultOpenFirst && index === 0,
496
+ children: [
497
+ /* @__PURE__ */ jsxs("summary", { className: "flex cursor-pointer list-none items-start justify-between gap-4 py-4 text-[0.9375rem] font-semibold leading-6 text-foreground marker:hidden [&::-webkit-details-marker]:hidden", children: [
498
+ item.question,
499
+ /* @__PURE__ */ jsx(
500
+ Plus,
501
+ {
502
+ "aria-hidden": true,
503
+ className: "mt-0.5 size-4 shrink-0 text-muted-foreground transition-transform duration-micro group-open:rotate-45"
504
+ }
505
+ )
506
+ ] }),
507
+ /* @__PURE__ */ jsx("p", { className: cn("pb-4 pr-8", EDITORIAL_BODY), children: item.answer })
508
+ ]
509
+ },
510
+ item.key ?? `${index}-${item.question.slice(0, 24)}`
511
+ )) })
512
+ ]
513
+ }
514
+ );
515
+ }
516
+ function EditorialFigure({
517
+ caption,
518
+ className,
519
+ media,
520
+ width = "column"
521
+ }) {
522
+ return /* @__PURE__ */ jsxs("figure", { className: cn(editorialBlock({ spacing: "normal", width }), className), children: [
523
+ /* @__PURE__ */ jsx("div", { className: "relative overflow-hidden rounded-[var(--radius-xl)] border border-border bg-muted shadow-ambient-sm", children: media }),
524
+ caption && /* @__PURE__ */ jsx("figcaption", { className: cn("mt-3 text-center", EDITORIAL_CAPTION), children: caption })
525
+ ] });
526
+ }
527
+ var GROUP_LAYOUT = {
528
+ comparison: "grid gap-4 sm:grid-cols-2",
529
+ grid: "grid gap-4 sm:grid-cols-2",
530
+ sequence: "grid gap-4"
531
+ };
532
+ function EditorialFigureGroup({
533
+ children,
534
+ className,
535
+ label,
536
+ title,
537
+ variant = "grid"
538
+ }) {
539
+ return /* @__PURE__ */ jsxs(
540
+ "section",
541
+ {
542
+ "aria-label": title ?? label ?? void 0,
543
+ className: cn(editorialBlock({ spacing: "loose", width: "breakout" }), className),
544
+ children: [
545
+ (label || title) && /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
546
+ label && /* @__PURE__ */ jsx("div", { className: EDITORIAL_EYEBROW, children: label }),
547
+ title && /* @__PURE__ */ jsx("h3", { className: "mt-2 text-lg font-semibold leading-6 text-foreground", children: title })
548
+ ] }),
549
+ /* @__PURE__ */ jsx("div", { className: GROUP_LAYOUT[variant], children })
550
+ ]
551
+ }
552
+ );
553
+ }
554
+ function EditorialKeyTakeaways({
555
+ className,
556
+ items,
557
+ label = "Key takeaways",
558
+ title
559
+ }) {
560
+ const visible = items.filter((item) => item.text.trim());
561
+ if (!visible.length) return null;
562
+ return /* @__PURE__ */ jsxs(
563
+ "aside",
564
+ {
565
+ "aria-label": title ?? label,
566
+ className: cn(
567
+ editorialBlock({ spacing: "loose", width: "breakout" }),
568
+ editorialFrame({ elevation: "resting", radius: "panel" }),
569
+ "px-6 py-6 sm:px-8 sm:py-7",
570
+ className
571
+ ),
572
+ children: [
573
+ /* @__PURE__ */ jsx("div", { className: EDITORIAL_EYEBROW, children: label }),
574
+ title && /* @__PURE__ */ jsx("h2", { className: "mt-3 text-xl font-semibold leading-7 text-foreground", children: title }),
575
+ /* @__PURE__ */ jsx("ol", { className: "mt-5 divide-y divide-border border-t border-border", children: visible.map((item, index) => /* @__PURE__ */ jsxs(
576
+ "li",
577
+ {
578
+ className: "flex gap-4 py-3.5 first:pt-4",
579
+ children: [
580
+ /* @__PURE__ */ jsx(
581
+ "span",
582
+ {
583
+ "aria-hidden": true,
584
+ className: "mt-0.5 shrink-0 font-mono text-xs font-semibold tabular-nums text-muted-foreground",
585
+ children: String(index + 1).padStart(2, "0")
586
+ }
587
+ ),
588
+ /* @__PURE__ */ jsx("p", { className: "text-[0.9375rem] leading-7 text-foreground", children: item.text })
589
+ ]
590
+ },
591
+ item.key ?? `${index}-${item.text.slice(0, 24)}`
592
+ )) })
593
+ ]
594
+ }
595
+ );
596
+ }
597
+ function EditorialMarginNote({
598
+ children,
599
+ className,
600
+ label,
601
+ title
602
+ }) {
603
+ if (!title && !children) return null;
604
+ return /* @__PURE__ */ jsxs(
605
+ "aside",
606
+ {
607
+ className: cn(
608
+ "my-6 border-l-2 border-border py-1 pl-4 text-sm leading-6 text-muted-foreground",
609
+ "xl:float-right xl:-mr-56 xl:my-2 xl:ml-8 xl:w-48 xl:border-l xl:pl-4",
610
+ className
611
+ ),
612
+ children: [
613
+ label && /* @__PURE__ */ jsx("div", { className: cn("mb-1.5", EDITORIAL_EYEBROW), children: label }),
614
+ title && /* @__PURE__ */ jsx("p", { className: "font-semibold text-foreground", children: title }),
615
+ children && /* @__PURE__ */ jsx("p", { className: cn(title && "mt-1"), children })
616
+ ]
617
+ }
618
+ );
619
+ }
620
+ function EditorialPullQuote({
621
+ attribution,
622
+ className,
623
+ portrait,
624
+ quote,
625
+ role,
626
+ sourceHref
627
+ }) {
628
+ if (!quote.trim()) return null;
629
+ const name = attribution ? sourceHref ? /* @__PURE__ */ jsxs(
630
+ "a",
631
+ {
632
+ className: "inline-flex items-center gap-1.5 text-foreground underline decoration-border underline-offset-4 transition-colors hover:decoration-[hsl(var(--primary))]",
633
+ href: sourceHref,
634
+ rel: "noopener noreferrer",
635
+ target: "_blank",
636
+ children: [
637
+ attribution,
638
+ /* @__PURE__ */ jsx(External, { "aria-hidden": true, className: "size-3.5 text-muted-foreground" })
639
+ ]
640
+ }
641
+ ) : attribution : null;
642
+ return /* @__PURE__ */ jsxs(
643
+ "figure",
644
+ {
645
+ className: cn(
646
+ editorialBlock({ spacing: "loose", width: "breakout" }),
647
+ "border-y border-border py-8 sm:py-10",
648
+ className
649
+ ),
650
+ children: [
651
+ /* @__PURE__ */ jsx("blockquote", { className: "text-pretty text-xl font-medium leading-9 text-foreground sm:text-[1.6rem] sm:leading-[2.6rem]", children: quote }),
652
+ (name || role || portrait) && /* @__PURE__ */ jsxs("figcaption", { className: "mt-6 flex items-center gap-3", children: [
653
+ portrait && /* @__PURE__ */ jsx("span", { className: "size-9 shrink-0 overflow-hidden rounded-full bg-muted", children: portrait }),
654
+ /* @__PURE__ */ jsxs("span", { className: "min-w-0", children: [
655
+ name && /* @__PURE__ */ jsx("span", { className: "block text-sm font-semibold text-foreground", children: name }),
656
+ role && /* @__PURE__ */ jsx("span", { className: "mt-0.5 block text-sm text-muted-foreground", children: role })
657
+ ] })
658
+ ] })
659
+ ]
660
+ }
661
+ );
662
+ }
663
+ function hostname2(url) {
664
+ try {
665
+ return new URL(url).hostname.replace(/^www\./, "");
666
+ } catch {
667
+ return null;
668
+ }
669
+ }
670
+ function EditorialSourceIndex({
671
+ className,
672
+ label = "Source index",
673
+ sources,
674
+ summary
675
+ }) {
676
+ const visible = sources.filter((source) => source.title && source.url);
677
+ if (!visible.length) return null;
678
+ return /* @__PURE__ */ jsxs(
679
+ "section",
680
+ {
681
+ "aria-label": label,
682
+ className: cn(editorialBlock({ spacing: "loose", width: "breakout" }), className),
683
+ children: [
684
+ /* @__PURE__ */ jsxs("div", { className: "border-b border-border pb-3", children: [
685
+ /* @__PURE__ */ jsx("div", { className: EDITORIAL_EYEBROW, children: label }),
686
+ summary && /* @__PURE__ */ jsx("p", { className: cn("mt-2", EDITORIAL_BODY), children: summary })
687
+ ] }),
688
+ /* @__PURE__ */ jsx("ol", { className: "divide-y divide-border", children: visible.map((source, index) => {
689
+ const meta = [source.publisher, source.author, source.accessedAt].filter(Boolean);
690
+ const host = hostname2(source.url);
691
+ return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
692
+ "a",
693
+ {
694
+ className: "group flex gap-4 py-4 transition-colors hover:bg-muted/60",
695
+ href: source.url,
696
+ rel: "noopener noreferrer",
697
+ target: "_blank",
698
+ children: [
699
+ /* @__PURE__ */ jsx(
700
+ "span",
701
+ {
702
+ "aria-hidden": true,
703
+ className: "mt-0.5 shrink-0 font-mono text-xs font-semibold tabular-nums text-muted-foreground",
704
+ children: String(index + 1).padStart(2, "0")
705
+ }
706
+ ),
707
+ /* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1", children: [
708
+ /* @__PURE__ */ jsxs("span", { className: "flex items-start justify-between gap-3", children: [
709
+ /* @__PURE__ */ jsx("span", { className: "text-[0.9375rem] font-semibold leading-6 text-foreground", children: source.title }),
710
+ /* @__PURE__ */ jsx(
711
+ ArrowUpRight,
712
+ {
713
+ "aria-hidden": true,
714
+ className: "mt-0.5 size-4 shrink-0 text-muted-foreground transition-colors group-hover:text-[hsl(var(--primary))]"
715
+ }
716
+ )
717
+ ] }),
718
+ (meta.length > 0 || host) && /* @__PURE__ */ jsx("span", { className: "mt-1 block text-sm text-muted-foreground", children: (meta.length ? meta : [host]).join(" \xB7 ") }),
719
+ source.summary && /* @__PURE__ */ jsx("span", { className: "mt-1.5 block text-sm leading-6 text-muted-foreground", children: source.summary })
720
+ ] })
721
+ ]
722
+ }
723
+ ) }, source.key ?? source.url);
724
+ }) })
725
+ ]
726
+ }
727
+ );
728
+ }
729
+ var COLUMNS = {
730
+ 1: "sm:grid-cols-1",
731
+ 2: "sm:grid-cols-2",
732
+ 3: "sm:grid-cols-3",
733
+ 4: "sm:grid-cols-2 lg:grid-cols-4"
734
+ };
735
+ function EditorialStatGrid({ className, items, label, title }) {
736
+ const visible = items.filter((item) => item.value.trim() && item.label.trim());
737
+ if (!visible.length) return null;
738
+ const columns = COLUMNS[Math.min(visible.length, 4)] ?? COLUMNS[4];
739
+ return /* @__PURE__ */ jsxs(
740
+ "section",
741
+ {
742
+ className: cn(editorialBlock({ spacing: "loose", width: "breakout" }), className),
743
+ "aria-label": title ?? label ?? void 0,
744
+ children: [
745
+ (label || title) && /* @__PURE__ */ jsxs("div", { className: "mb-5", children: [
746
+ label && /* @__PURE__ */ jsx("div", { className: EDITORIAL_EYEBROW, children: label }),
747
+ title && /* @__PURE__ */ jsx("h3", { className: "mt-2 text-lg font-semibold leading-6 text-foreground", children: title })
748
+ ] }),
749
+ /* @__PURE__ */ jsx(
750
+ "dl",
751
+ {
752
+ className: cn(
753
+ "grid divide-y divide-border border-y border-border",
754
+ columns,
755
+ "sm:divide-x sm:divide-y-0"
756
+ ),
757
+ children: visible.map((item, index) => /* @__PURE__ */ jsxs(
758
+ "div",
759
+ {
760
+ className: "px-0 py-5 sm:px-6 sm:first:pl-0 sm:last:pr-0",
761
+ children: [
762
+ /* @__PURE__ */ jsx("dt", { className: "sr-only", children: item.label }),
763
+ /* @__PURE__ */ jsxs("dd", { children: [
764
+ /* @__PURE__ */ jsx("span", { className: cn("block text-3xl leading-none sm:text-4xl", EDITORIAL_FIGURE), children: item.value }),
765
+ /* @__PURE__ */ jsx("span", { className: "mt-3 block text-sm font-medium text-foreground", children: item.label }),
766
+ item.caption && /* @__PURE__ */ jsx("span", { className: cn("mt-1.5 block", EDITORIAL_CAPTION), children: item.caption })
767
+ ] })
768
+ ]
769
+ },
770
+ item.key ?? `${index}-${item.label}`
771
+ ))
772
+ }
773
+ )
774
+ ]
775
+ }
776
+ );
777
+ }
778
+ function EditorialStepLadder({ className, label, steps, title }) {
779
+ const visible = steps.filter((step) => step.title.trim());
780
+ if (!visible.length) return null;
781
+ return /* @__PURE__ */ jsxs(
782
+ "section",
783
+ {
784
+ "aria-label": title ?? label ?? void 0,
785
+ className: cn(editorialBlock({ spacing: "loose" }), className),
786
+ children: [
787
+ (label || title) && /* @__PURE__ */ jsxs("div", { className: "mb-5", children: [
788
+ label && /* @__PURE__ */ jsx("div", { className: EDITORIAL_EYEBROW, children: label }),
789
+ title && /* @__PURE__ */ jsx("h3", { className: "mt-2 text-lg font-semibold leading-6 text-foreground", children: title })
790
+ ] }),
791
+ /* @__PURE__ */ jsx("ol", { className: "grid gap-0", children: visible.map((step, index) => /* @__PURE__ */ jsxs(
792
+ "li",
793
+ {
794
+ className: "relative grid grid-cols-[2rem_1fr] gap-4 pb-6 last:pb-0",
795
+ children: [
796
+ index < visible.length - 1 && /* @__PURE__ */ jsx(
797
+ "span",
798
+ {
799
+ "aria-hidden": true,
800
+ className: "absolute bottom-2 left-4 top-9 w-px -translate-x-1/2 bg-border"
801
+ }
802
+ ),
803
+ /* @__PURE__ */ jsx(
804
+ "span",
805
+ {
806
+ "aria-hidden": true,
807
+ className: "z-10 flex size-8 items-center justify-center rounded-full border border-border bg-background font-mono text-xs font-semibold tabular-nums text-foreground",
808
+ children: index + 1
809
+ }
810
+ ),
811
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 pt-1.5", children: [
812
+ /* @__PURE__ */ jsx("h4", { className: "text-[0.9375rem] font-semibold leading-6 text-foreground", children: step.title }),
813
+ step.body && /* @__PURE__ */ jsx("p", { className: cn("mt-1.5", EDITORIAL_BODY), children: step.body })
814
+ ] })
815
+ ]
816
+ },
817
+ step.key ?? `${index}-${step.title}`
818
+ )) })
819
+ ]
820
+ }
821
+ );
822
+ }
823
+ function EditorialTimeline({ className, items, label, title }) {
824
+ const visible = items.filter((item) => item.marker.trim() && item.title.trim());
825
+ if (!visible.length) return null;
826
+ return /* @__PURE__ */ jsxs(
827
+ "section",
828
+ {
829
+ "aria-label": title ?? label ?? void 0,
830
+ className: cn(editorialBlock({ spacing: "loose" }), className),
831
+ children: [
832
+ (label || title) && /* @__PURE__ */ jsxs("div", { className: "mb-5", children: [
833
+ label && /* @__PURE__ */ jsx("div", { className: EDITORIAL_EYEBROW, children: label }),
834
+ title && /* @__PURE__ */ jsx("h3", { className: "mt-2 text-lg font-semibold leading-6 text-foreground", children: title })
835
+ ] }),
836
+ /* @__PURE__ */ jsx("ol", { className: "ml-[3.25rem] border-l border-border sm:ml-24", children: visible.map((item, index) => /* @__PURE__ */ jsxs("li", { className: "relative pb-7 pl-6 last:pb-0", children: [
837
+ /* @__PURE__ */ jsx(
838
+ "span",
839
+ {
840
+ "aria-hidden": true,
841
+ className: "absolute -left-[0.3125rem] top-1.5 size-2.5 rounded-full border-2 border-background bg-[hsl(var(--primary))]"
842
+ }
843
+ ),
844
+ /* @__PURE__ */ jsx(
845
+ "span",
846
+ {
847
+ className: "absolute right-[calc(100%+1.5rem)] top-0 whitespace-nowrap font-mono text-xs font-semibold tabular-nums leading-6 text-muted-foreground",
848
+ "aria-hidden": true,
849
+ children: item.marker
850
+ }
851
+ ),
852
+ /* @__PURE__ */ jsxs("h4", { className: "text-[0.9375rem] font-semibold leading-6 text-foreground", children: [
853
+ /* @__PURE__ */ jsxs("span", { className: "sr-only", children: [
854
+ item.marker,
855
+ " \u2014 "
856
+ ] }),
857
+ item.title
858
+ ] }),
859
+ item.body && /* @__PURE__ */ jsx("p", { className: cn("mt-1.5", EDITORIAL_BODY), children: item.body })
860
+ ] }, item.key ?? `${index}-${item.marker}`)) })
861
+ ]
862
+ }
863
+ );
864
+ }
865
+
866
+ export { EDITORIAL_BODY, EDITORIAL_CAPTION, EDITORIAL_EMBED_PROVIDERS, EDITORIAL_EYEBROW, EDITORIAL_FIGURE, EDITORIAL_TITLE, EDITORIAL_TONES, EDITORIAL_TONE_FG, EDITORIAL_TONE_PLATE, EDITORIAL_TONE_WASH, EditorialAuthorBio, EditorialCallout, EditorialChart, EditorialComparisonTable, EditorialDataTable, EditorialDivider, EditorialEmbedCard, EditorialEntityChip, EditorialFaq, EditorialFigure, EditorialFigureGroup, EditorialKeyTakeaways, EditorialMarginNote, EditorialPullQuote, EditorialSourceIndex, EditorialStatGrid, EditorialStepLadder, EditorialTimeline, editorialBlock, editorialFrame, editorialToneAccent, editorialToneStyle, isEditorialEmbedProvider, isEditorialTone };
867
+ //# sourceMappingURL=index.js.map
868
+ //# sourceMappingURL=index.js.map