@still-void/ui 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/dist/react/client/index.cjs +38 -30
- package/dist/react/client/index.cjs.map +1 -1
- package/dist/react/client/index.d.cts +1 -1
- package/dist/react/client/index.d.ts +1 -1
- package/dist/react/client/index.js +38 -30
- package/dist/react/client/index.js.map +1 -1
- package/dist/react/index.cjs +167 -154
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +20 -1
- package/dist/react/index.d.ts +20 -1
- package/dist/react/index.js +163 -151
- package/dist/react/index.js.map +1 -1
- package/dist/style.css +102 -25
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -1,3 +1,76 @@
|
|
|
1
|
+
// src/components/ui/icon.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
// src/lib/utils.ts
|
|
5
|
+
import { clsx } from "clsx";
|
|
6
|
+
import { twMerge } from "tailwind-merge";
|
|
7
|
+
function cn(...inputs) {
|
|
8
|
+
return twMerge(clsx(inputs));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// src/components/ui/icon-set.ts
|
|
12
|
+
import {
|
|
13
|
+
Bars3Icon,
|
|
14
|
+
CheckCircleIcon,
|
|
15
|
+
CheckIcon,
|
|
16
|
+
ChevronDownIcon,
|
|
17
|
+
ChevronLeftIcon,
|
|
18
|
+
ChevronRightIcon,
|
|
19
|
+
ChevronUpIcon,
|
|
20
|
+
DocumentDuplicateIcon,
|
|
21
|
+
ExclamationCircleIcon,
|
|
22
|
+
ExclamationTriangleIcon,
|
|
23
|
+
InformationCircleIcon,
|
|
24
|
+
MagnifyingGlassIcon,
|
|
25
|
+
MoonIcon,
|
|
26
|
+
SunIcon,
|
|
27
|
+
XMarkIcon
|
|
28
|
+
} from "@heroicons/react/24/outline";
|
|
29
|
+
var ICON_GLYPHS = {
|
|
30
|
+
x: XMarkIcon,
|
|
31
|
+
check: CheckIcon,
|
|
32
|
+
"chevron-down": ChevronDownIcon,
|
|
33
|
+
"chevron-up": ChevronUpIcon,
|
|
34
|
+
"chevron-right": ChevronRightIcon,
|
|
35
|
+
"chevron-left": ChevronLeftIcon,
|
|
36
|
+
info: InformationCircleIcon,
|
|
37
|
+
"alert-triangle": ExclamationTriangleIcon,
|
|
38
|
+
"alert-circle": ExclamationCircleIcon,
|
|
39
|
+
"check-circle": CheckCircleIcon,
|
|
40
|
+
copy: DocumentDuplicateIcon,
|
|
41
|
+
sun: SunIcon,
|
|
42
|
+
moon: MoonIcon,
|
|
43
|
+
search: MagnifyingGlassIcon,
|
|
44
|
+
menu: Bars3Icon
|
|
45
|
+
};
|
|
46
|
+
var ICON_NAMES = Object.keys(ICON_GLYPHS);
|
|
47
|
+
var ICON_FALLBACK_NAME = "alert-circle";
|
|
48
|
+
|
|
49
|
+
// src/components/ui/icon.tsx
|
|
50
|
+
import { jsx } from "react/jsx-runtime";
|
|
51
|
+
var Icon = React.forwardRef(
|
|
52
|
+
({ name, size = "md", label, className, ...props }, ref) => {
|
|
53
|
+
const Glyph = ICON_GLYPHS[name] ?? ICON_GLYPHS[ICON_FALLBACK_NAME];
|
|
54
|
+
return /* @__PURE__ */ jsx(
|
|
55
|
+
Glyph,
|
|
56
|
+
{
|
|
57
|
+
...props,
|
|
58
|
+
ref,
|
|
59
|
+
className: cn(
|
|
60
|
+
"sv-icon",
|
|
61
|
+
size === "sm" && "sv-icon--sm",
|
|
62
|
+
size === "lg" && "sv-icon--lg",
|
|
63
|
+
className
|
|
64
|
+
),
|
|
65
|
+
"aria-hidden": label === void 0 ? "true" : void 0,
|
|
66
|
+
role: label === void 0 ? void 0 : "img",
|
|
67
|
+
"aria-label": label
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
Icon.displayName = "Icon";
|
|
73
|
+
|
|
1
74
|
// src/recipes/cx.ts
|
|
2
75
|
function cx(...parts) {
|
|
3
76
|
return parts.filter(Boolean).join(" ");
|
|
@@ -9,6 +82,10 @@ function header(options = {}) {
|
|
|
9
82
|
}
|
|
10
83
|
var headerClasses = {
|
|
11
84
|
nav: "sv-header__nav",
|
|
85
|
+
/** Wraps <nav> in a native <details> — collapsible below 640px, a no-op
|
|
86
|
+
* wrapper above it, with zero JavaScript (see DESIGN.md §5 Navigation). */
|
|
87
|
+
navToggle: "sv-header__nav-toggle",
|
|
88
|
+
navSummary: "sv-header__nav-summary",
|
|
12
89
|
link: "sv-header__link",
|
|
13
90
|
linkActive: cx("sv-header__link", "sv-header__link--active"),
|
|
14
91
|
actions: "sv-header__actions"
|
|
@@ -28,33 +105,39 @@ var footerClasses = {
|
|
|
28
105
|
};
|
|
29
106
|
|
|
30
107
|
// src/react/components/Shell.tsx
|
|
31
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
108
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
32
109
|
function Logo({ label, href = "/", className, ...rest }) {
|
|
33
110
|
return /* @__PURE__ */ jsxs("a", { href, className: cx(logo(), className), ...rest, children: [
|
|
34
|
-
/* @__PURE__ */
|
|
111
|
+
/* @__PURE__ */ jsx2("span", { className: logoClasses.dot, "aria-hidden": "true" }),
|
|
35
112
|
label
|
|
36
113
|
] });
|
|
37
114
|
}
|
|
38
115
|
function Header({ logo: logoSlot, items = [], actions, glass, className, ...rest }) {
|
|
39
116
|
return /* @__PURE__ */ jsxs("header", { className: cx(header({ glass }), className), ...rest, children: [
|
|
40
117
|
logoSlot,
|
|
41
|
-
items.length > 0 &&
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
118
|
+
items.length > 0 && // <details> makes the nav collapsible below 640px with zero
|
|
119
|
+
// JavaScript: CSS forces it open above that width (a no-op wrapper),
|
|
120
|
+
// native click-to-toggle handles it below (see DESIGN.md §5).
|
|
121
|
+
/* @__PURE__ */ jsxs("details", { className: headerClasses.navToggle, children: [
|
|
122
|
+
/* @__PURE__ */ jsx2("summary", { className: headerClasses.navSummary, "aria-label": "Menu", children: /* @__PURE__ */ jsx2(Icon, { name: "menu" }) }),
|
|
123
|
+
/* @__PURE__ */ jsx2("nav", { className: headerClasses.nav, children: items.map((item) => /* @__PURE__ */ jsx2(
|
|
124
|
+
"a",
|
|
125
|
+
{
|
|
126
|
+
href: item.href,
|
|
127
|
+
className: item.active ? headerClasses.linkActive : headerClasses.link,
|
|
128
|
+
"aria-current": item.active ? "page" : void 0,
|
|
129
|
+
children: item.label
|
|
130
|
+
},
|
|
131
|
+
item.href
|
|
132
|
+
)) })
|
|
133
|
+
] }),
|
|
134
|
+
actions && /* @__PURE__ */ jsx2("div", { className: headerClasses.actions, children: actions })
|
|
52
135
|
] });
|
|
53
136
|
}
|
|
54
137
|
function Footer({ author, links = [], children, className, ...rest }) {
|
|
55
138
|
return /* @__PURE__ */ jsxs("footer", { className: cx(footer(), className), ...rest, children: [
|
|
56
|
-
author && /* @__PURE__ */
|
|
57
|
-
links.length > 0 && /* @__PURE__ */
|
|
139
|
+
author && /* @__PURE__ */ jsx2("span", { children: author }),
|
|
140
|
+
links.length > 0 && /* @__PURE__ */ jsx2("div", { className: footerClasses.links, children: links.map((link) => /* @__PURE__ */ jsx2("a", { href: link.href, className: footerClasses.link, children: link.label }, link.href)) }),
|
|
58
141
|
children
|
|
59
142
|
] });
|
|
60
143
|
}
|
|
@@ -221,15 +304,15 @@ function resolveCategoryColor(color) {
|
|
|
221
304
|
}
|
|
222
305
|
|
|
223
306
|
// src/react/components/Content.tsx
|
|
224
|
-
import { Fragment, jsx as
|
|
307
|
+
import { Fragment, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
225
308
|
function CategoryPill({ label, color, active, interactive, className, style, ...rest }) {
|
|
226
309
|
const pillStyle = color ? { ...style, "--sv-pill-color": resolveCategoryColor(color) } : style;
|
|
227
310
|
const content = /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
228
|
-
/* @__PURE__ */
|
|
311
|
+
/* @__PURE__ */ jsx3("span", { className: categoryPillClasses.dot, "aria-hidden": "true" }),
|
|
229
312
|
label
|
|
230
313
|
] });
|
|
231
314
|
if (interactive) {
|
|
232
|
-
return /* @__PURE__ */
|
|
315
|
+
return /* @__PURE__ */ jsx3(
|
|
233
316
|
"button",
|
|
234
317
|
{
|
|
235
318
|
type: "button",
|
|
@@ -241,7 +324,7 @@ function CategoryPill({ label, color, active, interactive, className, style, ...
|
|
|
241
324
|
}
|
|
242
325
|
);
|
|
243
326
|
}
|
|
244
|
-
return /* @__PURE__ */
|
|
327
|
+
return /* @__PURE__ */ jsx3(
|
|
245
328
|
"span",
|
|
246
329
|
{
|
|
247
330
|
className: cx(categoryPill({ active, interactive }), className),
|
|
@@ -254,8 +337,8 @@ function CategoryPill({ label, color, active, interactive, className, style, ...
|
|
|
254
337
|
function PostMeta({ post }) {
|
|
255
338
|
if (!post.category && !post.date && post.readMinutes === void 0) return null;
|
|
256
339
|
return /* @__PURE__ */ jsxs2("div", { className: postCardClasses.meta, children: [
|
|
257
|
-
post.category && /* @__PURE__ */
|
|
258
|
-
post.date && /* @__PURE__ */
|
|
340
|
+
post.category && /* @__PURE__ */ jsx3(CategoryPill, { label: post.category.label, color: post.category.color }),
|
|
341
|
+
post.date && /* @__PURE__ */ jsx3("span", { children: post.date }),
|
|
259
342
|
post.readMinutes !== void 0 && /* @__PURE__ */ jsxs2("span", { children: [
|
|
260
343
|
post.readMinutes,
|
|
261
344
|
" min"
|
|
@@ -264,54 +347,54 @@ function PostMeta({ post }) {
|
|
|
264
347
|
}
|
|
265
348
|
function PostCard({ post, dense, className, children, ...rest }) {
|
|
266
349
|
return /* @__PURE__ */ jsxs2("article", { className: cx(postCard({ dense }), className), ...rest, children: [
|
|
267
|
-
/* @__PURE__ */
|
|
268
|
-
/* @__PURE__ */
|
|
269
|
-
!dense && post.excerpt && /* @__PURE__ */
|
|
350
|
+
/* @__PURE__ */ jsx3(PostMeta, { post }),
|
|
351
|
+
/* @__PURE__ */ jsx3("h3", { className: postCardClasses.title, children: /* @__PURE__ */ jsx3("a", { href: post.href, children: post.title }) }),
|
|
352
|
+
!dense && post.excerpt && /* @__PURE__ */ jsx3("p", { className: postCardClasses.excerpt, children: post.excerpt }),
|
|
270
353
|
children
|
|
271
354
|
] });
|
|
272
355
|
}
|
|
273
356
|
function FeaturedPostCard({ post, visual, className, children, ...rest }) {
|
|
274
357
|
return /* @__PURE__ */ jsxs2("article", { className: cx(featuredPostCard(), className), ...rest, children: [
|
|
275
358
|
/* @__PURE__ */ jsxs2("div", { className: featuredPostCardClasses.body, children: [
|
|
276
|
-
/* @__PURE__ */
|
|
277
|
-
/* @__PURE__ */
|
|
278
|
-
post.excerpt && /* @__PURE__ */
|
|
359
|
+
/* @__PURE__ */ jsx3(PostMeta, { post }),
|
|
360
|
+
/* @__PURE__ */ jsx3("h2", { className: featuredPostCardClasses.title, children: /* @__PURE__ */ jsx3("a", { href: post.href, children: post.title }) }),
|
|
361
|
+
post.excerpt && /* @__PURE__ */ jsx3("p", { className: postCardClasses.excerpt, children: post.excerpt }),
|
|
279
362
|
children
|
|
280
363
|
] }),
|
|
281
|
-
visual && /* @__PURE__ */
|
|
364
|
+
visual && /* @__PURE__ */ jsx3("div", { className: featuredPostCardClasses.visual, children: visual })
|
|
282
365
|
] });
|
|
283
366
|
}
|
|
284
367
|
function PostGrid({ className, ...rest }) {
|
|
285
|
-
return /* @__PURE__ */
|
|
368
|
+
return /* @__PURE__ */ jsx3("div", { className: cx(postGrid(), className), ...rest });
|
|
286
369
|
}
|
|
287
370
|
function Layout({ withSidebar, className, ...rest }) {
|
|
288
|
-
return /* @__PURE__ */
|
|
371
|
+
return /* @__PURE__ */ jsx3("div", { className: cx(layout({ withSidebar }), className), ...rest });
|
|
289
372
|
}
|
|
290
373
|
function Sidebar({ className, ...rest }) {
|
|
291
|
-
return /* @__PURE__ */
|
|
374
|
+
return /* @__PURE__ */ jsx3("aside", { className: cx(sidebar(), className), ...rest });
|
|
292
375
|
}
|
|
293
376
|
function SidebarSection({ title, children, ...rest }) {
|
|
294
377
|
return /* @__PURE__ */ jsxs2("section", { ...rest, children: [
|
|
295
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ jsx3("h4", { className: sidebarClasses.sectionTitle, children: title }),
|
|
296
379
|
children
|
|
297
380
|
] });
|
|
298
381
|
}
|
|
299
382
|
function Hero({ eyebrow, title, description, className, children, ...rest }) {
|
|
300
383
|
return /* @__PURE__ */ jsxs2("section", { className: cx(hero(), className), ...rest, children: [
|
|
301
|
-
eyebrow && /* @__PURE__ */
|
|
302
|
-
/* @__PURE__ */
|
|
303
|
-
description && /* @__PURE__ */
|
|
384
|
+
eyebrow && /* @__PURE__ */ jsx3("span", { className: heroClasses.eyebrow, children: eyebrow }),
|
|
385
|
+
/* @__PURE__ */ jsx3("h1", { className: heroClasses.title, children: title }),
|
|
386
|
+
description && /* @__PURE__ */ jsx3("p", { className: heroClasses.description, children: description }),
|
|
304
387
|
children
|
|
305
388
|
] });
|
|
306
389
|
}
|
|
307
390
|
function Skeleton({ small, className, ...rest }) {
|
|
308
|
-
return /* @__PURE__ */
|
|
391
|
+
return /* @__PURE__ */ jsx3("div", { className: cx(skeletonLine({ small }), className), "aria-hidden": "true", ...rest });
|
|
309
392
|
}
|
|
310
393
|
function CardSkeleton({ className, ...rest }) {
|
|
311
394
|
return /* @__PURE__ */ jsxs2("div", { className: cx(cardSkeleton(), className), "aria-hidden": "true", ...rest, children: [
|
|
312
|
-
/* @__PURE__ */
|
|
313
|
-
/* @__PURE__ */
|
|
314
|
-
/* @__PURE__ */
|
|
395
|
+
/* @__PURE__ */ jsx3(Skeleton, { small: true }),
|
|
396
|
+
/* @__PURE__ */ jsx3(Skeleton, {}),
|
|
397
|
+
/* @__PURE__ */ jsx3(Skeleton, {})
|
|
315
398
|
] });
|
|
316
399
|
}
|
|
317
400
|
|
|
@@ -369,7 +452,7 @@ var proseClasses = {
|
|
|
369
452
|
};
|
|
370
453
|
|
|
371
454
|
// src/react/components/Article.tsx
|
|
372
|
-
import { jsx as
|
|
455
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
373
456
|
function CodeBlock({
|
|
374
457
|
code,
|
|
375
458
|
language,
|
|
@@ -381,16 +464,16 @@ function CodeBlock({
|
|
|
381
464
|
}) {
|
|
382
465
|
return /* @__PURE__ */ jsxs3("figure", { className: cx(codeBlock(), className), ...rest, children: [
|
|
383
466
|
/* @__PURE__ */ jsxs3("figcaption", { className: codeBlockClasses.header, children: [
|
|
384
|
-
/* @__PURE__ */
|
|
467
|
+
/* @__PURE__ */ jsx4("span", { children: filename ?? language ?? "code" }),
|
|
385
468
|
actions
|
|
386
469
|
] }),
|
|
387
|
-
/* @__PURE__ */
|
|
470
|
+
/* @__PURE__ */ jsx4("pre", { className: codeBlockClasses.pre, children: rendered ?? /* @__PURE__ */ jsx4("code", { children: code }) })
|
|
388
471
|
] });
|
|
389
472
|
}
|
|
390
473
|
function Callout({ kind, label, className, children, ...rest }) {
|
|
391
474
|
return /* @__PURE__ */ jsxs3("aside", { className: cx(callout(kind), className), ...rest, children: [
|
|
392
|
-
/* @__PURE__ */
|
|
393
|
-
/* @__PURE__ */
|
|
475
|
+
/* @__PURE__ */ jsx4("span", { className: calloutClasses.label, children: label ?? calloutLabels[kind] }),
|
|
476
|
+
/* @__PURE__ */ jsx4("div", { children })
|
|
394
477
|
] });
|
|
395
478
|
}
|
|
396
479
|
function ArticleHeader({
|
|
@@ -404,10 +487,10 @@ function ArticleHeader({
|
|
|
404
487
|
}) {
|
|
405
488
|
return /* @__PURE__ */ jsxs3("header", { className: cx(articleHeader(), className), ...rest, children: [
|
|
406
489
|
eyebrow,
|
|
407
|
-
/* @__PURE__ */
|
|
490
|
+
/* @__PURE__ */ jsx4("h1", { className: articleHeaderClasses.title, children: title }),
|
|
408
491
|
(author || date || readMinutes !== void 0) && /* @__PURE__ */ jsxs3("div", { className: articleHeaderClasses.meta, children: [
|
|
409
|
-
author && /* @__PURE__ */
|
|
410
|
-
date && /* @__PURE__ */
|
|
492
|
+
author && /* @__PURE__ */ jsx4("span", { className: articleHeaderClasses.author, children: author }),
|
|
493
|
+
date && /* @__PURE__ */ jsx4("span", { children: date }),
|
|
411
494
|
readMinutes !== void 0 && /* @__PURE__ */ jsxs3("span", { children: [
|
|
412
495
|
readMinutes,
|
|
413
496
|
" min"
|
|
@@ -416,17 +499,17 @@ function ArticleHeader({
|
|
|
416
499
|
] });
|
|
417
500
|
}
|
|
418
501
|
function Prose({ className, ...rest }) {
|
|
419
|
-
return /* @__PURE__ */
|
|
502
|
+
return /* @__PURE__ */ jsx4("div", { className: cx(prose(), className), ...rest });
|
|
420
503
|
}
|
|
421
504
|
function Lead({ className, ...rest }) {
|
|
422
|
-
return /* @__PURE__ */
|
|
505
|
+
return /* @__PURE__ */ jsx4("p", { className: cx(proseClasses.lead, className), ...rest });
|
|
423
506
|
}
|
|
424
507
|
|
|
425
508
|
// src/behaviors/themeManager.ts
|
|
426
509
|
var DEFAULT_STORAGE_KEY = "still-void-theme";
|
|
427
510
|
|
|
428
511
|
// src/react/components/ThemeScript.tsx
|
|
429
|
-
import { jsx as
|
|
512
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
430
513
|
function toScriptLiteral(value) {
|
|
431
514
|
return JSON.stringify(value).replace(/</g, "\\u003c");
|
|
432
515
|
}
|
|
@@ -435,23 +518,14 @@ function ThemeScript({ storageKey = DEFAULT_STORAGE_KEY, nonce } = {}) {
|
|
|
435
518
|
const accents2 = toScriptLiteral(accentNames);
|
|
436
519
|
const key = toScriptLiteral(storageKey);
|
|
437
520
|
const script = `(function(){try{var s=JSON.parse(localStorage.getItem(${key})||"null");if(!s)return;var m=${modes},a=${accents2},r=document.documentElement;if(m.indexOf(s.mode)!==-1)r.setAttribute("data-theme",s.mode);if(a.indexOf(s.accent)!==-1)r.setAttribute("data-accent",s.accent);}catch(e){}})();`;
|
|
438
|
-
return /* @__PURE__ */
|
|
521
|
+
return /* @__PURE__ */ jsx5("script", { nonce, dangerouslySetInnerHTML: { __html: script } });
|
|
439
522
|
}
|
|
440
523
|
|
|
441
524
|
// src/components/ui/button.tsx
|
|
442
|
-
import * as
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
import { twMerge } from "tailwind-merge";
|
|
447
|
-
function cn(...inputs) {
|
|
448
|
-
return twMerge(clsx(inputs));
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
// src/components/ui/button.tsx
|
|
452
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
453
|
-
var Button = React.forwardRef(
|
|
454
|
-
({ className, variant = "default", size = "default", ...props }, ref) => /* @__PURE__ */ jsx5(
|
|
525
|
+
import * as React2 from "react";
|
|
526
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
527
|
+
var Button = React2.forwardRef(
|
|
528
|
+
({ className, variant = "default", size = "default", ...props }, ref) => /* @__PURE__ */ jsx6(
|
|
455
529
|
"button",
|
|
456
530
|
{
|
|
457
531
|
className: cn(
|
|
@@ -475,10 +549,10 @@ var Button = React.forwardRef(
|
|
|
475
549
|
Button.displayName = "Button";
|
|
476
550
|
|
|
477
551
|
// src/components/ui/card.tsx
|
|
478
|
-
import * as
|
|
552
|
+
import * as React4 from "react";
|
|
479
553
|
|
|
480
554
|
// src/components/ui/slot.tsx
|
|
481
|
-
import * as
|
|
555
|
+
import * as React3 from "react";
|
|
482
556
|
function composeRefs(...refs) {
|
|
483
557
|
return (node) => {
|
|
484
558
|
for (const ref of refs) {
|
|
@@ -511,9 +585,9 @@ function mergeProps(slotProps, childProps) {
|
|
|
511
585
|
}
|
|
512
586
|
return merged;
|
|
513
587
|
}
|
|
514
|
-
var Slot =
|
|
588
|
+
var Slot = React3.forwardRef(
|
|
515
589
|
({ children, ...slotProps }, forwardedRef) => {
|
|
516
|
-
if (!
|
|
590
|
+
if (!React3.isValidElement(children) || React3.Children.count(children) !== 1 || children.type === React3.Fragment) {
|
|
517
591
|
throw new Error(
|
|
518
592
|
"Slot expected a single React element child. Pass exactly one element to asChild."
|
|
519
593
|
);
|
|
@@ -522,21 +596,21 @@ var Slot = React2.forwardRef(
|
|
|
522
596
|
const childRef = child.props.ref ?? null;
|
|
523
597
|
const mergedProps = mergeProps(slotProps, child.props);
|
|
524
598
|
mergedProps.ref = forwardedRef ? composeRefs(forwardedRef, childRef) : childRef;
|
|
525
|
-
return
|
|
599
|
+
return React3.cloneElement(child, mergedProps);
|
|
526
600
|
}
|
|
527
601
|
);
|
|
528
602
|
Slot.displayName = "Slot";
|
|
529
603
|
|
|
530
604
|
// src/components/ui/card.tsx
|
|
531
|
-
import { jsx as
|
|
605
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
532
606
|
var CARD_ELEMENTS = /* @__PURE__ */ new Set(["div", "section", "article", "li", "aside"]);
|
|
533
|
-
var Card =
|
|
607
|
+
var Card = React4.forwardRef(
|
|
534
608
|
({ className, as, asChild = false, ...props }, ref) => {
|
|
535
609
|
if (asChild) {
|
|
536
|
-
return /* @__PURE__ */
|
|
610
|
+
return /* @__PURE__ */ jsx7(Slot, { ref, className: cn("sv-card", className), ...props });
|
|
537
611
|
}
|
|
538
612
|
const Comp = as !== void 0 && CARD_ELEMENTS.has(as) ? as : "div";
|
|
539
|
-
return
|
|
613
|
+
return React4.createElement(Comp, {
|
|
540
614
|
ref,
|
|
541
615
|
className: cn("sv-card", className),
|
|
542
616
|
...props
|
|
@@ -544,21 +618,21 @@ var Card = React3.forwardRef(
|
|
|
544
618
|
}
|
|
545
619
|
);
|
|
546
620
|
Card.displayName = "Card";
|
|
547
|
-
var CardHeader =
|
|
621
|
+
var CardHeader = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx7("div", { ref, className: cn("sv-card__header", className), ...props }));
|
|
548
622
|
CardHeader.displayName = "CardHeader";
|
|
549
|
-
var CardTitle =
|
|
623
|
+
var CardTitle = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx7("h2", { ref, className: cn("sv-card__title", className), ...props }));
|
|
550
624
|
CardTitle.displayName = "CardTitle";
|
|
551
|
-
var CardDescription =
|
|
625
|
+
var CardDescription = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx7("p", { ref, className: cn("sv-card__description", className), ...props }));
|
|
552
626
|
CardDescription.displayName = "CardDescription";
|
|
553
|
-
var CardContent =
|
|
627
|
+
var CardContent = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx7("div", { ref, className: cn("sv-card__content", className), ...props }));
|
|
554
628
|
CardContent.displayName = "CardContent";
|
|
555
|
-
var CardFooter =
|
|
629
|
+
var CardFooter = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx7("div", { ref, className: cn("sv-card__footer", className), ...props }));
|
|
556
630
|
CardFooter.displayName = "CardFooter";
|
|
557
631
|
|
|
558
632
|
// src/components/ui/alert.tsx
|
|
559
|
-
import * as
|
|
560
|
-
import { jsx as
|
|
561
|
-
var Alert =
|
|
633
|
+
import * as React5 from "react";
|
|
634
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
635
|
+
var Alert = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
562
636
|
"div",
|
|
563
637
|
{
|
|
564
638
|
ref,
|
|
@@ -568,16 +642,16 @@ var Alert = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
568
642
|
}
|
|
569
643
|
));
|
|
570
644
|
Alert.displayName = "Alert";
|
|
571
|
-
var AlertTitle =
|
|
645
|
+
var AlertTitle = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx8("h5", { ref, className: cn("sv-alert__title", className), ...props }));
|
|
572
646
|
AlertTitle.displayName = "AlertTitle";
|
|
573
|
-
var AlertDescription =
|
|
647
|
+
var AlertDescription = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx8("div", { ref, className: cn("sv-alert__description", className), ...props }));
|
|
574
648
|
AlertDescription.displayName = "AlertDescription";
|
|
575
649
|
|
|
576
650
|
// src/components/ui/badge.tsx
|
|
577
651
|
import "react";
|
|
578
|
-
import { jsx as
|
|
652
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
579
653
|
function Badge({ className, variant = "default", ...props }) {
|
|
580
|
-
return /* @__PURE__ */
|
|
654
|
+
return /* @__PURE__ */ jsx9(
|
|
581
655
|
"div",
|
|
582
656
|
{
|
|
583
657
|
className: cn(
|
|
@@ -592,72 +666,6 @@ function Badge({ className, variant = "default", ...props }) {
|
|
|
592
666
|
);
|
|
593
667
|
}
|
|
594
668
|
|
|
595
|
-
// src/components/ui/icon.tsx
|
|
596
|
-
import * as React6 from "react";
|
|
597
|
-
|
|
598
|
-
// src/components/ui/icon-set.ts
|
|
599
|
-
import {
|
|
600
|
-
Bars3Icon,
|
|
601
|
-
CheckCircleIcon,
|
|
602
|
-
CheckIcon,
|
|
603
|
-
ChevronDownIcon,
|
|
604
|
-
ChevronLeftIcon,
|
|
605
|
-
ChevronRightIcon,
|
|
606
|
-
ChevronUpIcon,
|
|
607
|
-
DocumentDuplicateIcon,
|
|
608
|
-
ExclamationCircleIcon,
|
|
609
|
-
ExclamationTriangleIcon,
|
|
610
|
-
InformationCircleIcon,
|
|
611
|
-
MagnifyingGlassIcon,
|
|
612
|
-
MoonIcon,
|
|
613
|
-
SunIcon,
|
|
614
|
-
XMarkIcon
|
|
615
|
-
} from "@heroicons/react/24/outline";
|
|
616
|
-
var ICON_GLYPHS = {
|
|
617
|
-
x: XMarkIcon,
|
|
618
|
-
check: CheckIcon,
|
|
619
|
-
"chevron-down": ChevronDownIcon,
|
|
620
|
-
"chevron-up": ChevronUpIcon,
|
|
621
|
-
"chevron-right": ChevronRightIcon,
|
|
622
|
-
"chevron-left": ChevronLeftIcon,
|
|
623
|
-
info: InformationCircleIcon,
|
|
624
|
-
"alert-triangle": ExclamationTriangleIcon,
|
|
625
|
-
"alert-circle": ExclamationCircleIcon,
|
|
626
|
-
"check-circle": CheckCircleIcon,
|
|
627
|
-
copy: DocumentDuplicateIcon,
|
|
628
|
-
sun: SunIcon,
|
|
629
|
-
moon: MoonIcon,
|
|
630
|
-
search: MagnifyingGlassIcon,
|
|
631
|
-
menu: Bars3Icon
|
|
632
|
-
};
|
|
633
|
-
var ICON_NAMES = Object.keys(ICON_GLYPHS);
|
|
634
|
-
var ICON_FALLBACK_NAME = "alert-circle";
|
|
635
|
-
|
|
636
|
-
// src/components/ui/icon.tsx
|
|
637
|
-
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
638
|
-
var Icon = React6.forwardRef(
|
|
639
|
-
({ name, size = "md", label, className, ...props }, ref) => {
|
|
640
|
-
const Glyph = ICON_GLYPHS[name] ?? ICON_GLYPHS[ICON_FALLBACK_NAME];
|
|
641
|
-
return /* @__PURE__ */ jsx9(
|
|
642
|
-
Glyph,
|
|
643
|
-
{
|
|
644
|
-
...props,
|
|
645
|
-
ref,
|
|
646
|
-
className: cn(
|
|
647
|
-
"sv-icon",
|
|
648
|
-
size === "sm" && "sv-icon--sm",
|
|
649
|
-
size === "lg" && "sv-icon--lg",
|
|
650
|
-
className
|
|
651
|
-
),
|
|
652
|
-
"aria-hidden": label === void 0 ? "true" : void 0,
|
|
653
|
-
role: label === void 0 ? void 0 : "img",
|
|
654
|
-
"aria-label": label
|
|
655
|
-
}
|
|
656
|
-
);
|
|
657
|
-
}
|
|
658
|
-
);
|
|
659
|
-
Icon.displayName = "Icon";
|
|
660
|
-
|
|
661
669
|
// src/components/ui/input.tsx
|
|
662
670
|
import * as React7 from "react";
|
|
663
671
|
|
|
@@ -672,6 +680,9 @@ var fieldClasses = {
|
|
|
672
680
|
choice: "sv-choice",
|
|
673
681
|
srOnly: "sv-sr-only"
|
|
674
682
|
};
|
|
683
|
+
function fieldMessage(options = {}) {
|
|
684
|
+
return cx("sv-field-message", options.variant === "error" && "sv-field-message--error");
|
|
685
|
+
}
|
|
675
686
|
|
|
676
687
|
// src/components/ui/input.tsx
|
|
677
688
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
@@ -1013,6 +1024,7 @@ export {
|
|
|
1013
1024
|
featuredPostCardClasses,
|
|
1014
1025
|
field,
|
|
1015
1026
|
fieldClasses,
|
|
1027
|
+
fieldMessage,
|
|
1016
1028
|
fontFamilies,
|
|
1017
1029
|
fontSizes,
|
|
1018
1030
|
fontWeights,
|