@still-void/ui 3.0.1 → 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 +24 -0
- package/dist/react/client/index.cjs.map +1 -1
- 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 +98 -25
- package/package.json +1 -1
package/dist/react/index.cjs
CHANGED
|
@@ -101,6 +101,7 @@ __export(react_exports, {
|
|
|
101
101
|
featuredPostCardClasses: () => featuredPostCardClasses,
|
|
102
102
|
field: () => field,
|
|
103
103
|
fieldClasses: () => fieldClasses,
|
|
104
|
+
fieldMessage: () => fieldMessage,
|
|
104
105
|
fontFamilies: () => fontFamilies,
|
|
105
106
|
fontSizes: () => fontSizes,
|
|
106
107
|
fontWeights: () => fontWeights,
|
|
@@ -140,6 +141,63 @@ __export(react_exports, {
|
|
|
140
141
|
});
|
|
141
142
|
module.exports = __toCommonJS(react_exports);
|
|
142
143
|
|
|
144
|
+
// src/components/ui/icon.tsx
|
|
145
|
+
var React = __toESM(require("react"), 1);
|
|
146
|
+
|
|
147
|
+
// src/lib/utils.ts
|
|
148
|
+
var import_clsx = require("clsx");
|
|
149
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
150
|
+
function cn(...inputs) {
|
|
151
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// src/components/ui/icon-set.ts
|
|
155
|
+
var import_outline = require("@heroicons/react/24/outline");
|
|
156
|
+
var ICON_GLYPHS = {
|
|
157
|
+
x: import_outline.XMarkIcon,
|
|
158
|
+
check: import_outline.CheckIcon,
|
|
159
|
+
"chevron-down": import_outline.ChevronDownIcon,
|
|
160
|
+
"chevron-up": import_outline.ChevronUpIcon,
|
|
161
|
+
"chevron-right": import_outline.ChevronRightIcon,
|
|
162
|
+
"chevron-left": import_outline.ChevronLeftIcon,
|
|
163
|
+
info: import_outline.InformationCircleIcon,
|
|
164
|
+
"alert-triangle": import_outline.ExclamationTriangleIcon,
|
|
165
|
+
"alert-circle": import_outline.ExclamationCircleIcon,
|
|
166
|
+
"check-circle": import_outline.CheckCircleIcon,
|
|
167
|
+
copy: import_outline.DocumentDuplicateIcon,
|
|
168
|
+
sun: import_outline.SunIcon,
|
|
169
|
+
moon: import_outline.MoonIcon,
|
|
170
|
+
search: import_outline.MagnifyingGlassIcon,
|
|
171
|
+
menu: import_outline.Bars3Icon
|
|
172
|
+
};
|
|
173
|
+
var ICON_NAMES = Object.keys(ICON_GLYPHS);
|
|
174
|
+
var ICON_FALLBACK_NAME = "alert-circle";
|
|
175
|
+
|
|
176
|
+
// src/components/ui/icon.tsx
|
|
177
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
178
|
+
var Icon = React.forwardRef(
|
|
179
|
+
({ name, size = "md", label, className, ...props }, ref) => {
|
|
180
|
+
const Glyph = ICON_GLYPHS[name] ?? ICON_GLYPHS[ICON_FALLBACK_NAME];
|
|
181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
182
|
+
Glyph,
|
|
183
|
+
{
|
|
184
|
+
...props,
|
|
185
|
+
ref,
|
|
186
|
+
className: cn(
|
|
187
|
+
"sv-icon",
|
|
188
|
+
size === "sm" && "sv-icon--sm",
|
|
189
|
+
size === "lg" && "sv-icon--lg",
|
|
190
|
+
className
|
|
191
|
+
),
|
|
192
|
+
"aria-hidden": label === void 0 ? "true" : void 0,
|
|
193
|
+
role: label === void 0 ? void 0 : "img",
|
|
194
|
+
"aria-label": label
|
|
195
|
+
}
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
);
|
|
199
|
+
Icon.displayName = "Icon";
|
|
200
|
+
|
|
143
201
|
// src/recipes/cx.ts
|
|
144
202
|
function cx(...parts) {
|
|
145
203
|
return parts.filter(Boolean).join(" ");
|
|
@@ -151,6 +209,10 @@ function header(options = {}) {
|
|
|
151
209
|
}
|
|
152
210
|
var headerClasses = {
|
|
153
211
|
nav: "sv-header__nav",
|
|
212
|
+
/** Wraps <nav> in a native <details> — collapsible below 640px, a no-op
|
|
213
|
+
* wrapper above it, with zero JavaScript (see DESIGN.md §5 Navigation). */
|
|
214
|
+
navToggle: "sv-header__nav-toggle",
|
|
215
|
+
navSummary: "sv-header__nav-summary",
|
|
154
216
|
link: "sv-header__link",
|
|
155
217
|
linkActive: cx("sv-header__link", "sv-header__link--active"),
|
|
156
218
|
actions: "sv-header__actions"
|
|
@@ -170,33 +232,39 @@ var footerClasses = {
|
|
|
170
232
|
};
|
|
171
233
|
|
|
172
234
|
// src/react/components/Shell.tsx
|
|
173
|
-
var
|
|
235
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
174
236
|
function Logo({ label, href = "/", className, ...rest }) {
|
|
175
|
-
return /* @__PURE__ */ (0,
|
|
176
|
-
/* @__PURE__ */ (0,
|
|
237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("a", { href, className: cx(logo(), className), ...rest, children: [
|
|
238
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: logoClasses.dot, "aria-hidden": "true" }),
|
|
177
239
|
label
|
|
178
240
|
] });
|
|
179
241
|
}
|
|
180
242
|
function Header({ logo: logoSlot, items = [], actions, glass, className, ...rest }) {
|
|
181
|
-
return /* @__PURE__ */ (0,
|
|
243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("header", { className: cx(header({ glass }), className), ...rest, children: [
|
|
182
244
|
logoSlot,
|
|
183
|
-
items.length > 0 &&
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
245
|
+
items.length > 0 && // <details> makes the nav collapsible below 640px with zero
|
|
246
|
+
// JavaScript: CSS forces it open above that width (a no-op wrapper),
|
|
247
|
+
// native click-to-toggle handles it below (see DESIGN.md §5).
|
|
248
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("details", { className: headerClasses.navToggle, children: [
|
|
249
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("summary", { className: headerClasses.navSummary, "aria-label": "Menu", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Icon, { name: "menu" }) }),
|
|
250
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("nav", { className: headerClasses.nav, children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
251
|
+
"a",
|
|
252
|
+
{
|
|
253
|
+
href: item.href,
|
|
254
|
+
className: item.active ? headerClasses.linkActive : headerClasses.link,
|
|
255
|
+
"aria-current": item.active ? "page" : void 0,
|
|
256
|
+
children: item.label
|
|
257
|
+
},
|
|
258
|
+
item.href
|
|
259
|
+
)) })
|
|
260
|
+
] }),
|
|
261
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: headerClasses.actions, children: actions })
|
|
194
262
|
] });
|
|
195
263
|
}
|
|
196
264
|
function Footer({ author, links = [], children, className, ...rest }) {
|
|
197
|
-
return /* @__PURE__ */ (0,
|
|
198
|
-
author && /* @__PURE__ */ (0,
|
|
199
|
-
links.length > 0 && /* @__PURE__ */ (0,
|
|
265
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("footer", { className: cx(footer(), className), ...rest, children: [
|
|
266
|
+
author && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: author }),
|
|
267
|
+
links.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: footerClasses.links, children: links.map((link) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("a", { href: link.href, className: footerClasses.link, children: link.label }, link.href)) }),
|
|
200
268
|
children
|
|
201
269
|
] });
|
|
202
270
|
}
|
|
@@ -363,15 +431,15 @@ function resolveCategoryColor(color) {
|
|
|
363
431
|
}
|
|
364
432
|
|
|
365
433
|
// src/react/components/Content.tsx
|
|
366
|
-
var
|
|
434
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
367
435
|
function CategoryPill({ label, color, active, interactive, className, style, ...rest }) {
|
|
368
436
|
const pillStyle = color ? { ...style, "--sv-pill-color": resolveCategoryColor(color) } : style;
|
|
369
|
-
const content = /* @__PURE__ */ (0,
|
|
370
|
-
/* @__PURE__ */ (0,
|
|
437
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
438
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: categoryPillClasses.dot, "aria-hidden": "true" }),
|
|
371
439
|
label
|
|
372
440
|
] });
|
|
373
441
|
if (interactive) {
|
|
374
|
-
return /* @__PURE__ */ (0,
|
|
442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
375
443
|
"button",
|
|
376
444
|
{
|
|
377
445
|
type: "button",
|
|
@@ -383,7 +451,7 @@ function CategoryPill({ label, color, active, interactive, className, style, ...
|
|
|
383
451
|
}
|
|
384
452
|
);
|
|
385
453
|
}
|
|
386
|
-
return /* @__PURE__ */ (0,
|
|
454
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
387
455
|
"span",
|
|
388
456
|
{
|
|
389
457
|
className: cx(categoryPill({ active, interactive }), className),
|
|
@@ -395,65 +463,65 @@ function CategoryPill({ label, color, active, interactive, className, style, ...
|
|
|
395
463
|
}
|
|
396
464
|
function PostMeta({ post }) {
|
|
397
465
|
if (!post.category && !post.date && post.readMinutes === void 0) return null;
|
|
398
|
-
return /* @__PURE__ */ (0,
|
|
399
|
-
post.category && /* @__PURE__ */ (0,
|
|
400
|
-
post.date && /* @__PURE__ */ (0,
|
|
401
|
-
post.readMinutes !== void 0 && /* @__PURE__ */ (0,
|
|
466
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: postCardClasses.meta, children: [
|
|
467
|
+
post.category && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(CategoryPill, { label: post.category.label, color: post.category.color }),
|
|
468
|
+
post.date && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: post.date }),
|
|
469
|
+
post.readMinutes !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { children: [
|
|
402
470
|
post.readMinutes,
|
|
403
471
|
" min"
|
|
404
472
|
] })
|
|
405
473
|
] });
|
|
406
474
|
}
|
|
407
475
|
function PostCard({ post, dense, className, children, ...rest }) {
|
|
408
|
-
return /* @__PURE__ */ (0,
|
|
409
|
-
/* @__PURE__ */ (0,
|
|
410
|
-
/* @__PURE__ */ (0,
|
|
411
|
-
!dense && post.excerpt && /* @__PURE__ */ (0,
|
|
476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("article", { className: cx(postCard({ dense }), className), ...rest, children: [
|
|
477
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PostMeta, { post }),
|
|
478
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h3", { className: postCardClasses.title, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("a", { href: post.href, children: post.title }) }),
|
|
479
|
+
!dense && post.excerpt && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: postCardClasses.excerpt, children: post.excerpt }),
|
|
412
480
|
children
|
|
413
481
|
] });
|
|
414
482
|
}
|
|
415
483
|
function FeaturedPostCard({ post, visual, className, children, ...rest }) {
|
|
416
|
-
return /* @__PURE__ */ (0,
|
|
417
|
-
/* @__PURE__ */ (0,
|
|
418
|
-
/* @__PURE__ */ (0,
|
|
419
|
-
/* @__PURE__ */ (0,
|
|
420
|
-
post.excerpt && /* @__PURE__ */ (0,
|
|
484
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("article", { className: cx(featuredPostCard(), className), ...rest, children: [
|
|
485
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: featuredPostCardClasses.body, children: [
|
|
486
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PostMeta, { post }),
|
|
487
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h2", { className: featuredPostCardClasses.title, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("a", { href: post.href, children: post.title }) }),
|
|
488
|
+
post.excerpt && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: postCardClasses.excerpt, children: post.excerpt }),
|
|
421
489
|
children
|
|
422
490
|
] }),
|
|
423
|
-
visual && /* @__PURE__ */ (0,
|
|
491
|
+
visual && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: featuredPostCardClasses.visual, children: visual })
|
|
424
492
|
] });
|
|
425
493
|
}
|
|
426
494
|
function PostGrid({ className, ...rest }) {
|
|
427
|
-
return /* @__PURE__ */ (0,
|
|
495
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: cx(postGrid(), className), ...rest });
|
|
428
496
|
}
|
|
429
497
|
function Layout({ withSidebar, className, ...rest }) {
|
|
430
|
-
return /* @__PURE__ */ (0,
|
|
498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: cx(layout({ withSidebar }), className), ...rest });
|
|
431
499
|
}
|
|
432
500
|
function Sidebar({ className, ...rest }) {
|
|
433
|
-
return /* @__PURE__ */ (0,
|
|
501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("aside", { className: cx(sidebar(), className), ...rest });
|
|
434
502
|
}
|
|
435
503
|
function SidebarSection({ title, children, ...rest }) {
|
|
436
|
-
return /* @__PURE__ */ (0,
|
|
437
|
-
/* @__PURE__ */ (0,
|
|
504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("section", { ...rest, children: [
|
|
505
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h4", { className: sidebarClasses.sectionTitle, children: title }),
|
|
438
506
|
children
|
|
439
507
|
] });
|
|
440
508
|
}
|
|
441
509
|
function Hero({ eyebrow, title, description, className, children, ...rest }) {
|
|
442
|
-
return /* @__PURE__ */ (0,
|
|
443
|
-
eyebrow && /* @__PURE__ */ (0,
|
|
444
|
-
/* @__PURE__ */ (0,
|
|
445
|
-
description && /* @__PURE__ */ (0,
|
|
510
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("section", { className: cx(hero(), className), ...rest, children: [
|
|
511
|
+
eyebrow && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: heroClasses.eyebrow, children: eyebrow }),
|
|
512
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h1", { className: heroClasses.title, children: title }),
|
|
513
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: heroClasses.description, children: description }),
|
|
446
514
|
children
|
|
447
515
|
] });
|
|
448
516
|
}
|
|
449
517
|
function Skeleton({ small, className, ...rest }) {
|
|
450
|
-
return /* @__PURE__ */ (0,
|
|
518
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: cx(skeletonLine({ small }), className), "aria-hidden": "true", ...rest });
|
|
451
519
|
}
|
|
452
520
|
function CardSkeleton({ className, ...rest }) {
|
|
453
|
-
return /* @__PURE__ */ (0,
|
|
454
|
-
/* @__PURE__ */ (0,
|
|
455
|
-
/* @__PURE__ */ (0,
|
|
456
|
-
/* @__PURE__ */ (0,
|
|
521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: cx(cardSkeleton(), className), "aria-hidden": "true", ...rest, children: [
|
|
522
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Skeleton, { small: true }),
|
|
523
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Skeleton, {}),
|
|
524
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Skeleton, {})
|
|
457
525
|
] });
|
|
458
526
|
}
|
|
459
527
|
|
|
@@ -511,7 +579,7 @@ var proseClasses = {
|
|
|
511
579
|
};
|
|
512
580
|
|
|
513
581
|
// src/react/components/Article.tsx
|
|
514
|
-
var
|
|
582
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
515
583
|
function CodeBlock({
|
|
516
584
|
code,
|
|
517
585
|
language,
|
|
@@ -521,18 +589,18 @@ function CodeBlock({
|
|
|
521
589
|
className,
|
|
522
590
|
...rest
|
|
523
591
|
}) {
|
|
524
|
-
return /* @__PURE__ */ (0,
|
|
525
|
-
/* @__PURE__ */ (0,
|
|
526
|
-
/* @__PURE__ */ (0,
|
|
592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("figure", { className: cx(codeBlock(), className), ...rest, children: [
|
|
593
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("figcaption", { className: codeBlockClasses.header, children: [
|
|
594
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: filename ?? language ?? "code" }),
|
|
527
595
|
actions
|
|
528
596
|
] }),
|
|
529
|
-
/* @__PURE__ */ (0,
|
|
597
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("pre", { className: codeBlockClasses.pre, children: rendered ?? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("code", { children: code }) })
|
|
530
598
|
] });
|
|
531
599
|
}
|
|
532
600
|
function Callout({ kind, label, className, children, ...rest }) {
|
|
533
|
-
return /* @__PURE__ */ (0,
|
|
534
|
-
/* @__PURE__ */ (0,
|
|
535
|
-
/* @__PURE__ */ (0,
|
|
601
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("aside", { className: cx(callout(kind), className), ...rest, children: [
|
|
602
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: calloutClasses.label, children: label ?? calloutLabels[kind] }),
|
|
603
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { children })
|
|
536
604
|
] });
|
|
537
605
|
}
|
|
538
606
|
function ArticleHeader({
|
|
@@ -544,13 +612,13 @@ function ArticleHeader({
|
|
|
544
612
|
className,
|
|
545
613
|
...rest
|
|
546
614
|
}) {
|
|
547
|
-
return /* @__PURE__ */ (0,
|
|
615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { className: cx(articleHeader(), className), ...rest, children: [
|
|
548
616
|
eyebrow,
|
|
549
|
-
/* @__PURE__ */ (0,
|
|
550
|
-
(author || date || readMinutes !== void 0) && /* @__PURE__ */ (0,
|
|
551
|
-
author && /* @__PURE__ */ (0,
|
|
552
|
-
date && /* @__PURE__ */ (0,
|
|
553
|
-
readMinutes !== void 0 && /* @__PURE__ */ (0,
|
|
617
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h1", { className: articleHeaderClasses.title, children: title }),
|
|
618
|
+
(author || date || readMinutes !== void 0) && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: articleHeaderClasses.meta, children: [
|
|
619
|
+
author && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: articleHeaderClasses.author, children: author }),
|
|
620
|
+
date && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: date }),
|
|
621
|
+
readMinutes !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { children: [
|
|
554
622
|
readMinutes,
|
|
555
623
|
" min"
|
|
556
624
|
] })
|
|
@@ -558,17 +626,17 @@ function ArticleHeader({
|
|
|
558
626
|
] });
|
|
559
627
|
}
|
|
560
628
|
function Prose({ className, ...rest }) {
|
|
561
|
-
return /* @__PURE__ */ (0,
|
|
629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: cx(prose(), className), ...rest });
|
|
562
630
|
}
|
|
563
631
|
function Lead({ className, ...rest }) {
|
|
564
|
-
return /* @__PURE__ */ (0,
|
|
632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: cx(proseClasses.lead, className), ...rest });
|
|
565
633
|
}
|
|
566
634
|
|
|
567
635
|
// src/behaviors/themeManager.ts
|
|
568
636
|
var DEFAULT_STORAGE_KEY = "still-void-theme";
|
|
569
637
|
|
|
570
638
|
// src/react/components/ThemeScript.tsx
|
|
571
|
-
var
|
|
639
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
572
640
|
function toScriptLiteral(value) {
|
|
573
641
|
return JSON.stringify(value).replace(/</g, "\\u003c");
|
|
574
642
|
}
|
|
@@ -577,23 +645,14 @@ function ThemeScript({ storageKey = DEFAULT_STORAGE_KEY, nonce } = {}) {
|
|
|
577
645
|
const accents2 = toScriptLiteral(accentNames);
|
|
578
646
|
const key = toScriptLiteral(storageKey);
|
|
579
647
|
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){}})();`;
|
|
580
|
-
return /* @__PURE__ */ (0,
|
|
648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("script", { nonce, dangerouslySetInnerHTML: { __html: script } });
|
|
581
649
|
}
|
|
582
650
|
|
|
583
651
|
// src/components/ui/button.tsx
|
|
584
|
-
var
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
var import_tailwind_merge = require("tailwind-merge");
|
|
589
|
-
function cn(...inputs) {
|
|
590
|
-
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
// src/components/ui/button.tsx
|
|
594
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
595
|
-
var Button = React.forwardRef(
|
|
596
|
-
({ className, variant = "default", size = "default", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
652
|
+
var React2 = __toESM(require("react"), 1);
|
|
653
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
654
|
+
var Button = React2.forwardRef(
|
|
655
|
+
({ className, variant = "default", size = "default", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
597
656
|
"button",
|
|
598
657
|
{
|
|
599
658
|
className: cn(
|
|
@@ -617,10 +676,10 @@ var Button = React.forwardRef(
|
|
|
617
676
|
Button.displayName = "Button";
|
|
618
677
|
|
|
619
678
|
// src/components/ui/card.tsx
|
|
620
|
-
var
|
|
679
|
+
var React4 = __toESM(require("react"), 1);
|
|
621
680
|
|
|
622
681
|
// src/components/ui/slot.tsx
|
|
623
|
-
var
|
|
682
|
+
var React3 = __toESM(require("react"), 1);
|
|
624
683
|
function composeRefs(...refs) {
|
|
625
684
|
return (node) => {
|
|
626
685
|
for (const ref of refs) {
|
|
@@ -653,9 +712,9 @@ function mergeProps(slotProps, childProps) {
|
|
|
653
712
|
}
|
|
654
713
|
return merged;
|
|
655
714
|
}
|
|
656
|
-
var Slot =
|
|
715
|
+
var Slot = React3.forwardRef(
|
|
657
716
|
({ children, ...slotProps }, forwardedRef) => {
|
|
658
|
-
if (!
|
|
717
|
+
if (!React3.isValidElement(children) || React3.Children.count(children) !== 1 || children.type === React3.Fragment) {
|
|
659
718
|
throw new Error(
|
|
660
719
|
"Slot expected a single React element child. Pass exactly one element to asChild."
|
|
661
720
|
);
|
|
@@ -664,21 +723,21 @@ var Slot = React2.forwardRef(
|
|
|
664
723
|
const childRef = child.props.ref ?? null;
|
|
665
724
|
const mergedProps = mergeProps(slotProps, child.props);
|
|
666
725
|
mergedProps.ref = forwardedRef ? composeRefs(forwardedRef, childRef) : childRef;
|
|
667
|
-
return
|
|
726
|
+
return React3.cloneElement(child, mergedProps);
|
|
668
727
|
}
|
|
669
728
|
);
|
|
670
729
|
Slot.displayName = "Slot";
|
|
671
730
|
|
|
672
731
|
// src/components/ui/card.tsx
|
|
673
|
-
var
|
|
732
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
674
733
|
var CARD_ELEMENTS = /* @__PURE__ */ new Set(["div", "section", "article", "li", "aside"]);
|
|
675
|
-
var Card =
|
|
734
|
+
var Card = React4.forwardRef(
|
|
676
735
|
({ className, as, asChild = false, ...props }, ref) => {
|
|
677
736
|
if (asChild) {
|
|
678
|
-
return /* @__PURE__ */ (0,
|
|
737
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Slot, { ref, className: cn("sv-card", className), ...props });
|
|
679
738
|
}
|
|
680
739
|
const Comp = as !== void 0 && CARD_ELEMENTS.has(as) ? as : "div";
|
|
681
|
-
return
|
|
740
|
+
return React4.createElement(Comp, {
|
|
682
741
|
ref,
|
|
683
742
|
className: cn("sv-card", className),
|
|
684
743
|
...props
|
|
@@ -686,21 +745,21 @@ var Card = React3.forwardRef(
|
|
|
686
745
|
}
|
|
687
746
|
);
|
|
688
747
|
Card.displayName = "Card";
|
|
689
|
-
var CardHeader =
|
|
748
|
+
var CardHeader = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { ref, className: cn("sv-card__header", className), ...props }));
|
|
690
749
|
CardHeader.displayName = "CardHeader";
|
|
691
|
-
var CardTitle =
|
|
750
|
+
var CardTitle = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h2", { ref, className: cn("sv-card__title", className), ...props }));
|
|
692
751
|
CardTitle.displayName = "CardTitle";
|
|
693
|
-
var CardDescription =
|
|
752
|
+
var CardDescription = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { ref, className: cn("sv-card__description", className), ...props }));
|
|
694
753
|
CardDescription.displayName = "CardDescription";
|
|
695
|
-
var CardContent =
|
|
754
|
+
var CardContent = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { ref, className: cn("sv-card__content", className), ...props }));
|
|
696
755
|
CardContent.displayName = "CardContent";
|
|
697
|
-
var CardFooter =
|
|
756
|
+
var CardFooter = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { ref, className: cn("sv-card__footer", className), ...props }));
|
|
698
757
|
CardFooter.displayName = "CardFooter";
|
|
699
758
|
|
|
700
759
|
// src/components/ui/alert.tsx
|
|
701
|
-
var
|
|
702
|
-
var
|
|
703
|
-
var Alert =
|
|
760
|
+
var React5 = __toESM(require("react"), 1);
|
|
761
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
762
|
+
var Alert = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
704
763
|
"div",
|
|
705
764
|
{
|
|
706
765
|
ref,
|
|
@@ -710,16 +769,16 @@ var Alert = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
710
769
|
}
|
|
711
770
|
));
|
|
712
771
|
Alert.displayName = "Alert";
|
|
713
|
-
var AlertTitle =
|
|
772
|
+
var AlertTitle = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h5", { ref, className: cn("sv-alert__title", className), ...props }));
|
|
714
773
|
AlertTitle.displayName = "AlertTitle";
|
|
715
|
-
var AlertDescription =
|
|
774
|
+
var AlertDescription = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { ref, className: cn("sv-alert__description", className), ...props }));
|
|
716
775
|
AlertDescription.displayName = "AlertDescription";
|
|
717
776
|
|
|
718
777
|
// src/components/ui/badge.tsx
|
|
719
|
-
var
|
|
720
|
-
var
|
|
778
|
+
var React6 = require("react");
|
|
779
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
721
780
|
function Badge({ className, variant = "default", ...props }) {
|
|
722
|
-
return /* @__PURE__ */ (0,
|
|
781
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
723
782
|
"div",
|
|
724
783
|
{
|
|
725
784
|
className: cn(
|
|
@@ -734,56 +793,6 @@ function Badge({ className, variant = "default", ...props }) {
|
|
|
734
793
|
);
|
|
735
794
|
}
|
|
736
795
|
|
|
737
|
-
// src/components/ui/icon.tsx
|
|
738
|
-
var React6 = __toESM(require("react"), 1);
|
|
739
|
-
|
|
740
|
-
// src/components/ui/icon-set.ts
|
|
741
|
-
var import_outline = require("@heroicons/react/24/outline");
|
|
742
|
-
var ICON_GLYPHS = {
|
|
743
|
-
x: import_outline.XMarkIcon,
|
|
744
|
-
check: import_outline.CheckIcon,
|
|
745
|
-
"chevron-down": import_outline.ChevronDownIcon,
|
|
746
|
-
"chevron-up": import_outline.ChevronUpIcon,
|
|
747
|
-
"chevron-right": import_outline.ChevronRightIcon,
|
|
748
|
-
"chevron-left": import_outline.ChevronLeftIcon,
|
|
749
|
-
info: import_outline.InformationCircleIcon,
|
|
750
|
-
"alert-triangle": import_outline.ExclamationTriangleIcon,
|
|
751
|
-
"alert-circle": import_outline.ExclamationCircleIcon,
|
|
752
|
-
"check-circle": import_outline.CheckCircleIcon,
|
|
753
|
-
copy: import_outline.DocumentDuplicateIcon,
|
|
754
|
-
sun: import_outline.SunIcon,
|
|
755
|
-
moon: import_outline.MoonIcon,
|
|
756
|
-
search: import_outline.MagnifyingGlassIcon,
|
|
757
|
-
menu: import_outline.Bars3Icon
|
|
758
|
-
};
|
|
759
|
-
var ICON_NAMES = Object.keys(ICON_GLYPHS);
|
|
760
|
-
var ICON_FALLBACK_NAME = "alert-circle";
|
|
761
|
-
|
|
762
|
-
// src/components/ui/icon.tsx
|
|
763
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
764
|
-
var Icon = React6.forwardRef(
|
|
765
|
-
({ name, size = "md", label, className, ...props }, ref) => {
|
|
766
|
-
const Glyph = ICON_GLYPHS[name] ?? ICON_GLYPHS[ICON_FALLBACK_NAME];
|
|
767
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
768
|
-
Glyph,
|
|
769
|
-
{
|
|
770
|
-
...props,
|
|
771
|
-
ref,
|
|
772
|
-
className: cn(
|
|
773
|
-
"sv-icon",
|
|
774
|
-
size === "sm" && "sv-icon--sm",
|
|
775
|
-
size === "lg" && "sv-icon--lg",
|
|
776
|
-
className
|
|
777
|
-
),
|
|
778
|
-
"aria-hidden": label === void 0 ? "true" : void 0,
|
|
779
|
-
role: label === void 0 ? void 0 : "img",
|
|
780
|
-
"aria-label": label
|
|
781
|
-
}
|
|
782
|
-
);
|
|
783
|
-
}
|
|
784
|
-
);
|
|
785
|
-
Icon.displayName = "Icon";
|
|
786
|
-
|
|
787
796
|
// src/components/ui/input.tsx
|
|
788
797
|
var React7 = __toESM(require("react"), 1);
|
|
789
798
|
|
|
@@ -798,6 +807,9 @@ var fieldClasses = {
|
|
|
798
807
|
choice: "sv-choice",
|
|
799
808
|
srOnly: "sv-sr-only"
|
|
800
809
|
};
|
|
810
|
+
function fieldMessage(options = {}) {
|
|
811
|
+
return cx("sv-field-message", options.variant === "error" && "sv-field-message--error");
|
|
812
|
+
}
|
|
801
813
|
|
|
802
814
|
// src/components/ui/input.tsx
|
|
803
815
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
@@ -1140,6 +1152,7 @@ var zIndex = {
|
|
|
1140
1152
|
featuredPostCardClasses,
|
|
1141
1153
|
field,
|
|
1142
1154
|
fieldClasses,
|
|
1155
|
+
fieldMessage,
|
|
1143
1156
|
fontFamilies,
|
|
1144
1157
|
fontSizes,
|
|
1145
1158
|
fontWeights,
|