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