@slipstream-ui/core 0.4.0 → 0.5.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/index.d.mts +296 -15
- package/dist/index.d.ts +296 -15
- package/dist/index.js +1047 -473
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1096 -530
- package/dist/index.mjs.map +1 -1
- package/dist/manifests/app-shell.manifest.json +50 -0
- package/dist/manifests/badge.manifest.json +9 -4
- package/dist/manifests/breadcrumb.manifest.json +6 -0
- package/dist/manifests/button.manifest.json +14 -0
- package/dist/manifests/confirm-dialog.manifest.json +132 -0
- package/dist/manifests/data-table.manifest.json +50 -0
- package/dist/manifests/dialog.manifest.json +7 -0
- package/dist/manifests/drawer.manifest.json +7 -0
- package/dist/manifests/link.manifest.json +106 -0
- package/dist/manifests/page-header.manifest.json +30 -0
- package/dist/manifests/pagination.manifest.json +6 -0
- package/dist/manifests/prose.manifest.json +75 -0
- package/dist/manifests/search.manifest.json +41 -9
- package/dist/manifests/section-heading.manifest.json +108 -0
- package/dist/manifests/select.manifest.json +6 -0
- package/dist/manifests/site-footer.manifest.json +94 -0
- package/dist/manifests/site-header.manifest.json +130 -0
- package/dist/manifests/table-of-contents.manifest.json +87 -0
- package/package.json +2 -2
- package/src/components/alert/Alert.tsx +2 -2
- package/src/components/app-shell/AppShell.test.tsx +49 -1
- package/src/components/app-shell/AppShell.tsx +147 -43
- package/src/components/badge/Badge.test.tsx +21 -0
- package/src/components/badge/Badge.tsx +6 -0
- package/src/components/breadcrumb/Breadcrumb.test.tsx +16 -0
- package/src/components/breadcrumb/Breadcrumb.tsx +10 -5
- package/src/components/button/Button.test.tsx +40 -2
- package/src/components/button/Button.tsx +31 -7
- package/src/components/confirm-dialog/ConfirmDialog.test.tsx +46 -0
- package/src/components/confirm-dialog/ConfirmDialog.tsx +86 -0
- package/src/components/confirm-dialog/index.ts +1 -0
- package/src/components/data-table/DataTable.test.tsx +92 -0
- package/src/components/data-table/DataTable.tsx +98 -7
- package/src/components/dialog/Dialog.test.tsx +7 -0
- package/src/components/dialog/Dialog.tsx +4 -1
- package/src/components/drawer/Drawer.test.tsx +11 -2
- package/src/components/drawer/Drawer.tsx +5 -2
- package/src/components/input/Input.tsx +1 -0
- package/src/components/link/Link.test.tsx +60 -0
- package/src/components/link/Link.tsx +85 -0
- package/src/components/link/index.ts +1 -0
- package/src/components/page-header/PageHeader.test.tsx +17 -0
- package/src/components/page-header/PageHeader.tsx +22 -6
- package/src/components/pagination/Pagination.test.tsx +8 -0
- package/src/components/pagination/Pagination.tsx +16 -6
- package/src/components/prose/Prose.test.tsx +35 -0
- package/src/components/prose/Prose.tsx +61 -0
- package/src/components/prose/index.ts +1 -0
- package/src/components/search/Search.test.tsx +16 -0
- package/src/components/search/Search.tsx +11 -2
- package/src/components/section-heading/SectionHeading.test.tsx +32 -0
- package/src/components/section-heading/SectionHeading.tsx +54 -0
- package/src/components/section-heading/index.ts +1 -0
- package/src/components/select/Select.tsx +9 -7
- package/src/components/site-footer/SiteFooter.test.tsx +30 -0
- package/src/components/site-footer/SiteFooter.tsx +79 -0
- package/src/components/site-footer/index.ts +1 -0
- package/src/components/site-header/SiteHeader.test.tsx +53 -0
- package/src/components/site-header/SiteHeader.tsx +124 -0
- package/src/components/site-header/index.ts +1 -0
- package/src/components/switch/Switch.test.tsx +10 -0
- package/src/components/switch/Switch.tsx +8 -3
- package/src/components/table-of-contents/TableOfContents.test.tsx +31 -0
- package/src/components/table-of-contents/TableOfContents.tsx +100 -0
- package/src/components/table-of-contents/index.ts +1 -0
- package/src/components/textarea/Textarea.tsx +1 -0
- package/src/index.ts +7 -0
- package/src/manifests/app-shell.manifest.json +50 -0
- package/src/manifests/badge.manifest.json +9 -4
- package/src/manifests/breadcrumb.manifest.json +6 -0
- package/src/manifests/button.manifest.json +14 -0
- package/src/manifests/confirm-dialog.manifest.json +132 -0
- package/src/manifests/data-table.manifest.json +50 -0
- package/src/manifests/dialog.manifest.json +7 -0
- package/src/manifests/drawer.manifest.json +7 -0
- package/src/manifests/link.manifest.json +106 -0
- package/src/manifests/page-header.manifest.json +30 -0
- package/src/manifests/pagination.manifest.json +6 -0
- package/src/manifests/prose.manifest.json +75 -0
- package/src/manifests/search.manifest.json +41 -9
- package/src/manifests/section-heading.manifest.json +108 -0
- package/src/manifests/select.manifest.json +6 -0
- package/src/manifests/site-footer.manifest.json +94 -0
- package/src/manifests/site-header.manifest.json +130 -0
- package/src/manifests/table-of-contents.manifest.json +87 -0
- package/src/test/tailwind-v4.test.ts +103 -0
package/dist/index.js
CHANGED
|
@@ -57,6 +57,7 @@ __export(index_exports, {
|
|
|
57
57
|
Checkbox: () => Checkbox,
|
|
58
58
|
CheckboxGroup: () => CheckboxGroup,
|
|
59
59
|
CheckboxGroupItem: () => CheckboxGroupItem,
|
|
60
|
+
ConfirmDialog: () => ConfirmDialog,
|
|
60
61
|
DataTable: () => DataTable,
|
|
61
62
|
DatePicker: () => DatePicker,
|
|
62
63
|
Dialog: () => Dialog,
|
|
@@ -83,6 +84,7 @@ __export(index_exports, {
|
|
|
83
84
|
InputGroup: () => InputGroup,
|
|
84
85
|
InputGroupAddon: () => InputGroupAddon,
|
|
85
86
|
Label: () => Label,
|
|
87
|
+
Link: () => Link,
|
|
86
88
|
List: () => List,
|
|
87
89
|
ListItem: () => ListItem,
|
|
88
90
|
Menu: () => Menu,
|
|
@@ -99,16 +101,20 @@ __export(index_exports, {
|
|
|
99
101
|
PopoverContent: () => PopoverContent,
|
|
100
102
|
PopoverTrigger: () => PopoverTrigger,
|
|
101
103
|
Progress: () => Progress,
|
|
104
|
+
Prose: () => Prose,
|
|
102
105
|
Radio: () => Radio,
|
|
103
106
|
RadioCard: () => RadioCard,
|
|
104
107
|
RadioGroup: () => RadioGroup,
|
|
105
108
|
RadioGroupContext: () => RadioGroupContext,
|
|
106
109
|
RadioGroupItem: () => RadioGroupItem,
|
|
107
110
|
Search: () => Search,
|
|
111
|
+
SectionHeading: () => SectionHeading,
|
|
108
112
|
Select: () => Select,
|
|
109
113
|
SelectMenu: () => SelectMenu,
|
|
110
114
|
Separator: () => Separator,
|
|
111
115
|
Sidebar: () => Sidebar,
|
|
116
|
+
SiteFooter: () => SiteFooter,
|
|
117
|
+
SiteHeader: () => SiteHeader,
|
|
112
118
|
Skeleton: () => Skeleton,
|
|
113
119
|
Spinner: () => Spinner,
|
|
114
120
|
Stepper: () => Stepper,
|
|
@@ -121,6 +127,7 @@ __export(index_exports, {
|
|
|
121
127
|
TableFooter: () => TableFooter,
|
|
122
128
|
TableHead: () => TableHead,
|
|
123
129
|
TableHeader: () => TableHeader,
|
|
130
|
+
TableOfContents: () => TableOfContents,
|
|
124
131
|
TableRow: () => TableRow,
|
|
125
132
|
Tabs: () => Tabs,
|
|
126
133
|
TabsContent: () => TabsContent,
|
|
@@ -144,6 +151,7 @@ __export(index_exports, {
|
|
|
144
151
|
toast: () => toast,
|
|
145
152
|
useCombobox: () => useCombobox,
|
|
146
153
|
usePresence: () => usePresence,
|
|
154
|
+
useScrollSpy: () => useScrollSpy,
|
|
147
155
|
useToast: () => useToast
|
|
148
156
|
});
|
|
149
157
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -258,6 +266,7 @@ function Drawer({
|
|
|
258
266
|
height,
|
|
259
267
|
closeOnBackdrop = true,
|
|
260
268
|
showClose = true,
|
|
269
|
+
closeLabel = "Close drawer",
|
|
261
270
|
initialFocusRef,
|
|
262
271
|
ariaLabel,
|
|
263
272
|
animate = false
|
|
@@ -354,8 +363,8 @@ function Drawer({
|
|
|
354
363
|
{
|
|
355
364
|
type: "button",
|
|
356
365
|
onClick: () => onOpenChange(false),
|
|
357
|
-
"aria-label":
|
|
358
|
-
className: "-
|
|
366
|
+
"aria-label": closeLabel,
|
|
367
|
+
className: "-me-1 rounded p-1 text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
359
368
|
children: "\u2715"
|
|
360
369
|
}
|
|
361
370
|
)
|
|
@@ -372,6 +381,14 @@ function Drawer({
|
|
|
372
381
|
|
|
373
382
|
// src/components/app-shell/AppShell.tsx
|
|
374
383
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
384
|
+
function containsActive(item, activeHref) {
|
|
385
|
+
if (!activeHref) return false;
|
|
386
|
+
if (item.href === activeHref) return true;
|
|
387
|
+
return (item.children ?? []).some((child) => containsActive(child, activeHref));
|
|
388
|
+
}
|
|
389
|
+
var itemClass = "flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring";
|
|
390
|
+
var activeClass = "bg-primary/10 font-medium text-primary";
|
|
391
|
+
var idleClass = "text-muted-foreground hover:bg-accent hover:text-accent-foreground";
|
|
375
392
|
function Sidebar({
|
|
376
393
|
sections,
|
|
377
394
|
heading,
|
|
@@ -379,50 +396,131 @@ function Sidebar({
|
|
|
379
396
|
activeHref,
|
|
380
397
|
linkComponent,
|
|
381
398
|
label = "Primary",
|
|
399
|
+
collapsible = false,
|
|
400
|
+
defaultCollapsed = false,
|
|
401
|
+
collapsed: collapsedProp,
|
|
402
|
+
onCollapsedChange,
|
|
403
|
+
defaultExpanded = [],
|
|
382
404
|
className,
|
|
383
405
|
...props
|
|
384
406
|
}) {
|
|
385
|
-
const
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
407
|
+
const Link3 = linkComponent ?? "a";
|
|
408
|
+
const [internalCollapsed, setInternalCollapsed] = React3.useState(defaultCollapsed);
|
|
409
|
+
const collapsed = collapsedProp ?? internalCollapsed;
|
|
410
|
+
const [openGroups, setOpenGroups] = React3.useState(defaultExpanded);
|
|
411
|
+
const isOpen = (item) => collapsed ? false : openGroups.includes(item.href) || containsActive(item, activeHref);
|
|
412
|
+
const toggleGroup = (href) => {
|
|
413
|
+
setOpenGroups(
|
|
414
|
+
(current) => current.includes(href) ? current.filter((entry) => entry !== href) : [...current, href]
|
|
415
|
+
);
|
|
416
|
+
};
|
|
417
|
+
const toggleCollapsed = () => {
|
|
418
|
+
const next = !collapsed;
|
|
419
|
+
if (collapsedProp === void 0) setInternalCollapsed(next);
|
|
420
|
+
onCollapsedChange?.(next);
|
|
421
|
+
};
|
|
422
|
+
const renderItems = (items, depth = 0) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ul", { className: cn("space-y-0.5", depth > 0 && "ml-3.5 border-l border-border pl-2.5"), children: items.map((item) => {
|
|
423
|
+
const active = item.active ?? containsActive(item, activeHref);
|
|
424
|
+
const hasChildren = Boolean(item.children?.length);
|
|
425
|
+
const expanded = hasChildren && isOpen(item);
|
|
426
|
+
const panelId = `sidebar-group-${item.href.replace(/[^a-z0-9-]/gi, "-")}`;
|
|
427
|
+
if (hasChildren) {
|
|
428
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("li", { children: [
|
|
429
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
430
|
+
"button",
|
|
394
431
|
{
|
|
395
|
-
|
|
396
|
-
"aria-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
),
|
|
432
|
+
type: "button",
|
|
433
|
+
"aria-expanded": expanded,
|
|
434
|
+
"aria-controls": expanded ? panelId : void 0,
|
|
435
|
+
onClick: () => toggleGroup(item.href),
|
|
436
|
+
title: collapsed ? item.label : void 0,
|
|
437
|
+
className: cn(itemClass, active ? activeClass : idleClass, collapsed && "justify-center px-0"),
|
|
402
438
|
children: [
|
|
403
439
|
item.icon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "shrink-0 [&_svg]:size-4", children: item.icon }),
|
|
404
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "min-w-0 flex-1 truncate", children: item.label }),
|
|
405
|
-
|
|
440
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: cn("min-w-0 flex-1 truncate text-left", collapsed && "sr-only"), children: item.label }),
|
|
441
|
+
!collapsed && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { "aria-hidden": "true", className: cn("shrink-0 text-xs transition-transform", expanded && "rotate-90"), children: "\u203A" })
|
|
406
442
|
]
|
|
407
443
|
}
|
|
408
|
-
)
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
444
|
+
),
|
|
445
|
+
expanded && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { id: panelId, children: renderItems(item.children, depth + 1) })
|
|
446
|
+
] }, item.href);
|
|
447
|
+
}
|
|
448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
449
|
+
Link3,
|
|
450
|
+
{
|
|
451
|
+
href: item.href,
|
|
452
|
+
"aria-current": active ? "page" : void 0,
|
|
453
|
+
title: collapsed ? item.label : void 0,
|
|
454
|
+
className: cn(itemClass, active ? activeClass : idleClass, collapsed && "justify-center px-0"),
|
|
455
|
+
children: [
|
|
456
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "shrink-0 [&_svg]:size-4", children: item.icon }),
|
|
457
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: cn("min-w-0 flex-1 truncate", collapsed && "sr-only"), children: item.label }),
|
|
458
|
+
!collapsed && item.badge && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "shrink-0 text-xs", children: item.badge })
|
|
459
|
+
]
|
|
460
|
+
}
|
|
461
|
+
) }, item.href);
|
|
462
|
+
}) });
|
|
463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
464
|
+
"div",
|
|
465
|
+
{
|
|
466
|
+
"data-collapsed": collapsed || void 0,
|
|
467
|
+
className: cn("flex h-full min-h-0 flex-col gap-5 p-3", className),
|
|
468
|
+
...props,
|
|
469
|
+
children: [
|
|
470
|
+
heading && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: cn("px-1", collapsed && "sr-only"), children: heading }),
|
|
471
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("nav", { "aria-label": label, className: "flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto", children: sections.map((section, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
|
|
472
|
+
section.title && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: cn("mb-1.5 px-2 text-xs font-medium uppercase tracking-wide text-muted-foreground", collapsed && "sr-only"), children: section.title }),
|
|
473
|
+
renderItems(section.items)
|
|
474
|
+
] }, section.title ?? `section-${index}`)) }),
|
|
475
|
+
collapsible && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
476
|
+
"button",
|
|
477
|
+
{
|
|
478
|
+
type: "button",
|
|
479
|
+
onClick: toggleCollapsed,
|
|
480
|
+
"aria-expanded": !collapsed,
|
|
481
|
+
"aria-label": collapsed ? "Expand navigation" : "Collapse navigation",
|
|
482
|
+
className: cn(itemClass, idleClass, "justify-center"),
|
|
483
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { "aria-hidden": "true", className: cn("transition-transform", collapsed && "rotate-180"), children: "\xAB" })
|
|
484
|
+
}
|
|
485
|
+
),
|
|
486
|
+
footer && !collapsed && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "border-t border-border pt-3", children: footer })
|
|
487
|
+
]
|
|
488
|
+
}
|
|
489
|
+
);
|
|
413
490
|
}
|
|
491
|
+
var hideAt = {
|
|
492
|
+
sm: "hidden sm:block",
|
|
493
|
+
md: "hidden md:block",
|
|
494
|
+
lg: "hidden lg:block"
|
|
495
|
+
};
|
|
496
|
+
var showBelow = {
|
|
497
|
+
sm: "sm:hidden",
|
|
498
|
+
md: "md:hidden",
|
|
499
|
+
lg: "lg:hidden"
|
|
500
|
+
};
|
|
414
501
|
function AppShell({
|
|
415
502
|
sidebar,
|
|
416
503
|
header,
|
|
417
504
|
hideMobileMenu = false,
|
|
418
505
|
sidebarWidth = "w-64",
|
|
506
|
+
mobileBreakpoint = "md",
|
|
419
507
|
className,
|
|
420
508
|
children,
|
|
421
509
|
...props
|
|
422
510
|
}) {
|
|
423
511
|
const [mobileOpen, setMobileOpen] = React3.useState(false);
|
|
424
512
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: cn("flex min-h-screen bg-background text-foreground", className), ...props, children: [
|
|
425
|
-
sidebar && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
513
|
+
sidebar && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
514
|
+
"aside",
|
|
515
|
+
{
|
|
516
|
+
className: cn(
|
|
517
|
+
"shrink-0 border-r border-border has-[[data-collapsed]]:w-16",
|
|
518
|
+
hideAt[mobileBreakpoint],
|
|
519
|
+
sidebarWidth
|
|
520
|
+
),
|
|
521
|
+
children: sidebar
|
|
522
|
+
}
|
|
523
|
+
),
|
|
426
524
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
427
525
|
(header || sidebar && !hideMobileMenu) && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("header", { className: "sticky top-0 z-30 flex h-14 items-center gap-3 border-b border-border bg-background/80 px-4 backdrop-blur supports-[backdrop-filter]:bg-background/60", children: [
|
|
428
526
|
sidebar && !hideMobileMenu && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
@@ -431,7 +529,7 @@ function AppShell({
|
|
|
431
529
|
type: "button",
|
|
432
530
|
onClick: () => setMobileOpen(true),
|
|
433
531
|
"aria-label": "Open navigation",
|
|
434
|
-
className: "rounded-md border border-border p-2 text-muted-foreground hover:bg-muted
|
|
532
|
+
className: cn("rounded-md border border-border p-2 text-muted-foreground hover:bg-muted", showBelow[mobileBreakpoint]),
|
|
435
533
|
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { "aria-hidden": "true", children: "\u2630" })
|
|
436
534
|
}
|
|
437
535
|
),
|
|
@@ -439,18 +537,7 @@ function AppShell({
|
|
|
439
537
|
] }),
|
|
440
538
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("main", { className: "min-w-0 flex-1", children })
|
|
441
539
|
] }),
|
|
442
|
-
sidebar && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
443
|
-
Drawer,
|
|
444
|
-
{
|
|
445
|
-
open: mobileOpen,
|
|
446
|
-
onOpenChange: setMobileOpen,
|
|
447
|
-
title: "Navigation",
|
|
448
|
-
side: "left",
|
|
449
|
-
size: "sm",
|
|
450
|
-
animate: true,
|
|
451
|
-
children: sidebar
|
|
452
|
-
}
|
|
453
|
-
)
|
|
540
|
+
sidebar && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Drawer, { open: mobileOpen, onOpenChange: setMobileOpen, title: "Navigation", side: "left", size: "sm", animate: true, children: sidebar })
|
|
454
541
|
] });
|
|
455
542
|
}
|
|
456
543
|
|
|
@@ -465,19 +552,21 @@ var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
|
465
552
|
variants: {
|
|
466
553
|
variant: {
|
|
467
554
|
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
555
|
+
primary: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
468
556
|
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
557
|
+
danger: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
469
558
|
// Semantic status variants — foregrounds are the paired AA tokens
|
|
470
559
|
// (white on dark green, ink on amber/cyan) in both themes.
|
|
471
560
|
success: "bg-success text-success-foreground hover:bg-success/90",
|
|
472
561
|
warning: "bg-warning text-warning-foreground hover:bg-warning/90",
|
|
473
562
|
info: "bg-info text-info-foreground hover:bg-info/90",
|
|
474
563
|
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
475
|
-
// Colored outlines: semantic border + label on the page
|
|
476
|
-
// a faint tint on hover
|
|
564
|
+
// Colored outlines: semantic border + AA ink label on the page
|
|
565
|
+
// surface, with a faint tint on hover - mirrors the Alert recipe.
|
|
477
566
|
"outline-destructive": "border border-destructive/50 bg-background text-destructive hover:border-destructive hover:bg-destructive/10",
|
|
478
567
|
"outline-success": "border border-success/50 bg-background text-success hover:border-success hover:bg-success/10",
|
|
479
|
-
"outline-warning": "border border-warning/50 bg-background text-warning hover:border-warning hover:bg-warning/10",
|
|
480
|
-
"outline-info": "border border-info/50 bg-background text-info hover:border-info hover:bg-info/10",
|
|
568
|
+
"outline-warning": "border border-warning/50 bg-background text-warning-ink hover:border-warning hover:bg-warning/10",
|
|
569
|
+
"outline-info": "border border-info/50 bg-background text-info-ink hover:border-info hover:bg-info/10",
|
|
481
570
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
482
571
|
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
483
572
|
link: "text-primary underline-offset-4 hover:underline"
|
|
@@ -496,14 +585,30 @@ var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
|
496
585
|
}
|
|
497
586
|
);
|
|
498
587
|
var Button = React4.forwardRef(
|
|
499
|
-
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
588
|
+
({ className, variant, size, asChild = false, loading = false, loadingLabel = "Loading", disabled, children, ...props }, ref) => {
|
|
500
589
|
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
501
|
-
|
|
502
|
-
Comp,
|
|
590
|
+
if (asChild) {
|
|
591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Comp, { className: cn(buttonVariants({ variant, size, className })), ref, ...props, children });
|
|
592
|
+
}
|
|
593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
594
|
+
"button",
|
|
503
595
|
{
|
|
504
596
|
className: cn(buttonVariants({ variant, size, className })),
|
|
505
597
|
ref,
|
|
506
|
-
|
|
598
|
+
disabled: disabled || loading,
|
|
599
|
+
"aria-busy": loading || void 0,
|
|
600
|
+
...props,
|
|
601
|
+
children: [
|
|
602
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
603
|
+
"span",
|
|
604
|
+
{
|
|
605
|
+
"aria-hidden": "true",
|
|
606
|
+
className: "h-4 w-4 shrink-0 animate-spin rounded-full border-2 border-current border-t-transparent"
|
|
607
|
+
}
|
|
608
|
+
),
|
|
609
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "sr-only", children: loadingLabel }),
|
|
610
|
+
children
|
|
611
|
+
]
|
|
507
612
|
}
|
|
508
613
|
);
|
|
509
614
|
}
|
|
@@ -550,6 +655,7 @@ var Input = React6.forwardRef(
|
|
|
550
655
|
"placeholder:text-muted-foreground",
|
|
551
656
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
552
657
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
658
|
+
"aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20",
|
|
553
659
|
className
|
|
554
660
|
),
|
|
555
661
|
ref,
|
|
@@ -576,6 +682,7 @@ var Textarea = React7.forwardRef(
|
|
|
576
682
|
"placeholder:text-muted-foreground",
|
|
577
683
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
578
684
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
685
|
+
"aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20",
|
|
579
686
|
className
|
|
580
687
|
),
|
|
581
688
|
...props
|
|
@@ -587,7 +694,7 @@ Textarea.displayName = "Textarea";
|
|
|
587
694
|
// src/components/select/Select.tsx
|
|
588
695
|
var React8 = __toESM(require("react"));
|
|
589
696
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
590
|
-
var Select = React8.forwardRef(function Select2({ options, groups, label, placeholder, multiple = false, value, defaultValue, onChange, id, className, ...props }, ref) {
|
|
697
|
+
var Select = React8.forwardRef(function Select2({ options, groups, label, placeholder, multiple = false, value, defaultValue, onChange, onValueChange, id, className, ...props }, ref) {
|
|
591
698
|
const generatedId = React8.useId();
|
|
592
699
|
const selectId = id ?? generatedId;
|
|
593
700
|
const labelId = `${selectId}-label`;
|
|
@@ -606,17 +713,15 @@ var Select = React8.forwardRef(function Select2({ options, groups, label, placeh
|
|
|
606
713
|
multiple && "min-h-32",
|
|
607
714
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
608
715
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
716
|
+
"aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20",
|
|
609
717
|
className
|
|
610
718
|
),
|
|
611
719
|
value,
|
|
612
720
|
defaultValue,
|
|
613
721
|
onChange: (event) => {
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
return;
|
|
618
|
-
}
|
|
619
|
-
onChange(event.target.value);
|
|
722
|
+
const next = multiple ? Array.from(event.target.selectedOptions, (option) => option.value) : event.target.value;
|
|
723
|
+
onChange?.(next);
|
|
724
|
+
onValueChange?.(next);
|
|
620
725
|
},
|
|
621
726
|
...props,
|
|
622
727
|
children: [
|
|
@@ -710,6 +815,12 @@ var badgeVariants = (0, import_class_variance_authority2.cva)(
|
|
|
710
815
|
variants: {
|
|
711
816
|
variant: {
|
|
712
817
|
default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
|
818
|
+
// Aliases used by shadcn/Bootstrap-style codebases.
|
|
819
|
+
primary: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
|
820
|
+
danger: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
821
|
+
success: "border-transparent bg-success text-success-foreground hover:bg-success/80",
|
|
822
|
+
warning: "border-transparent bg-warning text-warning-foreground hover:bg-warning/80",
|
|
823
|
+
info: "border-transparent bg-info text-info-foreground hover:bg-info/80",
|
|
713
824
|
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
714
825
|
destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
715
826
|
outline: "text-foreground"
|
|
@@ -1073,6 +1184,7 @@ function Dialog({
|
|
|
1073
1184
|
bodyClassName,
|
|
1074
1185
|
closeOnBackdrop = true,
|
|
1075
1186
|
showClose = true,
|
|
1187
|
+
closeLabel = "Close dialog",
|
|
1076
1188
|
initialFocusRef,
|
|
1077
1189
|
ariaLabel,
|
|
1078
1190
|
animate = false
|
|
@@ -1162,7 +1274,7 @@ function Dialog({
|
|
|
1162
1274
|
{
|
|
1163
1275
|
type: "button",
|
|
1164
1276
|
onClick: () => onOpenChange(false),
|
|
1165
|
-
"aria-label":
|
|
1277
|
+
"aria-label": closeLabel,
|
|
1166
1278
|
className: "rounded p-1 text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
1167
1279
|
children: "\u2715"
|
|
1168
1280
|
}
|
|
@@ -1613,6 +1725,7 @@ function useCombobox({
|
|
|
1613
1725
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1614
1726
|
function Search({
|
|
1615
1727
|
options,
|
|
1728
|
+
value,
|
|
1616
1729
|
defaultValue,
|
|
1617
1730
|
onValueChange,
|
|
1618
1731
|
placeholder = "Search\u2026",
|
|
@@ -1623,11 +1736,15 @@ function Search({
|
|
|
1623
1736
|
className,
|
|
1624
1737
|
"aria-label": ariaLabel
|
|
1625
1738
|
}) {
|
|
1739
|
+
const activeValue = value === void 0 ? defaultValue : value ?? void 0;
|
|
1626
1740
|
const selected = React18.useMemo(
|
|
1627
|
-
() => options.find((option) => option.value ===
|
|
1628
|
-
[options,
|
|
1741
|
+
() => options.find((option) => option.value === activeValue),
|
|
1742
|
+
[options, activeValue]
|
|
1629
1743
|
);
|
|
1630
1744
|
const [query, setQuery] = React18.useState(selected?.label ?? "");
|
|
1745
|
+
React18.useEffect(() => {
|
|
1746
|
+
if (value !== void 0) setQuery(selected?.label ?? "");
|
|
1747
|
+
}, [value, selected]);
|
|
1631
1748
|
const filtered = React18.useMemo(() => {
|
|
1632
1749
|
if (!query.trim()) return options;
|
|
1633
1750
|
const q = query.trim().toLowerCase();
|
|
@@ -2373,42 +2490,45 @@ FormLayout.displayName = "FormLayout";
|
|
|
2373
2490
|
var React30 = __toESM(require("react"));
|
|
2374
2491
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2375
2492
|
var Switch = React30.forwardRef(
|
|
2376
|
-
({ className, checked, defaultChecked, onCheckedChange, disabled, ...props }, ref) => {
|
|
2493
|
+
({ className, checked, defaultChecked, onCheckedChange, disabled, name, ...props }, ref) => {
|
|
2377
2494
|
const [internalChecked, setInternalChecked] = React30.useState(defaultChecked ?? false);
|
|
2378
2495
|
const isOn = checked ?? internalChecked;
|
|
2379
2496
|
const toggle = () => {
|
|
2380
2497
|
if (checked === void 0) setInternalChecked((prev) => !prev);
|
|
2381
2498
|
onCheckedChange?.(!isOn);
|
|
2382
2499
|
};
|
|
2383
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.
|
|
2384
|
-
"
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
"
|
|
2404
|
-
|
|
2405
|
-
"
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2500
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
2501
|
+
name && isOn && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("input", { type: "hidden", name, value: "on" }),
|
|
2502
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2503
|
+
"button",
|
|
2504
|
+
{
|
|
2505
|
+
type: "button",
|
|
2506
|
+
role: "switch",
|
|
2507
|
+
"aria-checked": isOn,
|
|
2508
|
+
ref,
|
|
2509
|
+
disabled,
|
|
2510
|
+
onClick: toggle,
|
|
2511
|
+
className: cn(
|
|
2512
|
+
"peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors",
|
|
2513
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
2514
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
2515
|
+
isOn ? "bg-primary" : "bg-input",
|
|
2516
|
+
className
|
|
2517
|
+
),
|
|
2518
|
+
...props,
|
|
2519
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2520
|
+
"span",
|
|
2521
|
+
{
|
|
2522
|
+
"aria-hidden": "true",
|
|
2523
|
+
className: cn(
|
|
2524
|
+
"pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg transition-transform",
|
|
2525
|
+
isOn ? "translate-x-4" : "translate-x-0"
|
|
2526
|
+
)
|
|
2527
|
+
}
|
|
2528
|
+
)
|
|
2529
|
+
}
|
|
2530
|
+
)
|
|
2531
|
+
] });
|
|
2412
2532
|
}
|
|
2413
2533
|
);
|
|
2414
2534
|
Switch.displayName = "Switch";
|
|
@@ -2722,16 +2842,291 @@ var CardFooter = React35.forwardRef(
|
|
|
2722
2842
|
);
|
|
2723
2843
|
CardFooter.displayName = "CardFooter";
|
|
2724
2844
|
|
|
2725
|
-
// src/components/
|
|
2845
|
+
// src/components/confirm-dialog/ConfirmDialog.tsx
|
|
2726
2846
|
var React36 = __toESM(require("react"));
|
|
2727
2847
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2728
|
-
|
|
2848
|
+
function ConfirmDialog({
|
|
2849
|
+
open,
|
|
2850
|
+
onOpenChange,
|
|
2851
|
+
title,
|
|
2852
|
+
description,
|
|
2853
|
+
confirmLabel = "Confirm",
|
|
2854
|
+
cancelLabel = "Cancel",
|
|
2855
|
+
destructive = false,
|
|
2856
|
+
onConfirm,
|
|
2857
|
+
closeOnConfirm = true,
|
|
2858
|
+
children
|
|
2859
|
+
}) {
|
|
2860
|
+
const [pending, setPending] = React36.useState(false);
|
|
2861
|
+
const handleConfirm = async () => {
|
|
2862
|
+
try {
|
|
2863
|
+
setPending(true);
|
|
2864
|
+
await onConfirm();
|
|
2865
|
+
if (closeOnConfirm) onOpenChange(false);
|
|
2866
|
+
} finally {
|
|
2867
|
+
setPending(false);
|
|
2868
|
+
}
|
|
2869
|
+
};
|
|
2870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2871
|
+
Dialog,
|
|
2872
|
+
{
|
|
2873
|
+
open,
|
|
2874
|
+
onOpenChange: (next) => {
|
|
2875
|
+
if (pending) return;
|
|
2876
|
+
onOpenChange(next);
|
|
2877
|
+
},
|
|
2878
|
+
title,
|
|
2879
|
+
description,
|
|
2880
|
+
size: "sm",
|
|
2881
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(DialogFooter, { children: [
|
|
2882
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Button, { variant: "ghost", onClick: () => onOpenChange(false), disabled: pending, children: cancelLabel }),
|
|
2883
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2884
|
+
Button,
|
|
2885
|
+
{
|
|
2886
|
+
variant: destructive ? "destructive" : "default",
|
|
2887
|
+
onClick: handleConfirm,
|
|
2888
|
+
loading: pending,
|
|
2889
|
+
children: confirmLabel
|
|
2890
|
+
}
|
|
2891
|
+
)
|
|
2892
|
+
] }),
|
|
2893
|
+
children
|
|
2894
|
+
}
|
|
2895
|
+
);
|
|
2896
|
+
}
|
|
2897
|
+
|
|
2898
|
+
// src/components/table-of-contents/TableOfContents.tsx
|
|
2899
|
+
var React37 = __toESM(require("react"));
|
|
2900
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2901
|
+
function TableOfContents({
|
|
2902
|
+
headings,
|
|
2903
|
+
activeId,
|
|
2904
|
+
label = "On this page",
|
|
2905
|
+
sticky = true,
|
|
2906
|
+
className,
|
|
2907
|
+
...props
|
|
2908
|
+
}) {
|
|
2909
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
2910
|
+
"nav",
|
|
2911
|
+
{
|
|
2912
|
+
"aria-label": label,
|
|
2913
|
+
className: cn("text-sm", sticky && "sticky top-20 max-h-[calc(100vh-6rem)] overflow-y-auto", className),
|
|
2914
|
+
...props,
|
|
2915
|
+
children: [
|
|
2916
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: label }),
|
|
2917
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("ul", { className: "space-y-1 border-l border-border", children: headings.map((heading) => {
|
|
2918
|
+
const active = heading.id === activeId;
|
|
2919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("li", { style: { paddingLeft: `${(heading.level - 2) * 0.75}rem` }, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2920
|
+
"a",
|
|
2921
|
+
{
|
|
2922
|
+
href: `#${heading.id}`,
|
|
2923
|
+
"aria-current": active ? "location" : void 0,
|
|
2924
|
+
className: cn(
|
|
2925
|
+
"-ml-px block border-l py-1 pl-3 transition-colors",
|
|
2926
|
+
active ? "border-primary font-medium text-primary" : "border-transparent text-muted-foreground hover:border-border hover:text-foreground"
|
|
2927
|
+
),
|
|
2928
|
+
children: heading.text
|
|
2929
|
+
}
|
|
2930
|
+
) }, heading.id);
|
|
2931
|
+
}) })
|
|
2932
|
+
]
|
|
2933
|
+
}
|
|
2934
|
+
);
|
|
2935
|
+
}
|
|
2936
|
+
function useScrollSpy(ids, options) {
|
|
2937
|
+
const [activeId, setActiveId] = React37.useState();
|
|
2938
|
+
const idKey = ids.join("|");
|
|
2939
|
+
const rootMargin = options?.rootMargin ?? "0px 0px -70% 0px";
|
|
2940
|
+
React37.useEffect(() => {
|
|
2941
|
+
if (idKey.length === 0 || typeof IntersectionObserver === "undefined") return;
|
|
2942
|
+
const elements = idKey.split("|").map((id) => document.getElementById(id)).filter((element) => element !== null);
|
|
2943
|
+
if (elements.length === 0) return;
|
|
2944
|
+
const observer = new IntersectionObserver(
|
|
2945
|
+
(entries) => {
|
|
2946
|
+
const visible = entries.filter((entry) => entry.isIntersecting).sort((a, b) => a.boundingClientRect.top - b.boundingClientRect.top);
|
|
2947
|
+
if (visible[0]) setActiveId(visible[0].target.id);
|
|
2948
|
+
return;
|
|
2949
|
+
},
|
|
2950
|
+
{ rootMargin, threshold: 0 }
|
|
2951
|
+
);
|
|
2952
|
+
elements.forEach((element) => observer.observe(element));
|
|
2953
|
+
return () => observer.disconnect();
|
|
2954
|
+
}, [idKey, rootMargin]);
|
|
2955
|
+
return activeId;
|
|
2956
|
+
}
|
|
2957
|
+
|
|
2958
|
+
// src/components/prose/Prose.tsx
|
|
2959
|
+
var React38 = __toESM(require("react"));
|
|
2960
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2961
|
+
var sizeClasses3 = {
|
|
2962
|
+
sm: "text-sm [&_h2]:text-xl [&_h3]:text-lg",
|
|
2963
|
+
md: "text-base [&_h2]:text-2xl [&_h3]:text-xl",
|
|
2964
|
+
lg: "text-lg [&_h2]:text-3xl [&_h3]:text-2xl"
|
|
2965
|
+
};
|
|
2966
|
+
var Prose = React38.forwardRef(function Prose2({ size = "md", className, ...props }, ref) {
|
|
2967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2968
|
+
"div",
|
|
2969
|
+
{
|
|
2970
|
+
ref,
|
|
2971
|
+
className: cn(
|
|
2972
|
+
"max-w-none text-foreground",
|
|
2973
|
+
sizeClasses3[size],
|
|
2974
|
+
// Headings
|
|
2975
|
+
"[&_h1]:mb-4 [&_h1]:mt-10 [&_h1]:scroll-mt-24 [&_h1]:text-3xl [&_h1]:font-bold [&_h1]:tracking-tight",
|
|
2976
|
+
"[&_h2]:mb-3 [&_h2]:mt-9 [&_h2]:scroll-mt-24 [&_h2]:font-semibold [&_h2]:tracking-tight",
|
|
2977
|
+
"[&_h3]:mb-2 [&_h3]:mt-7 [&_h3]:scroll-mt-24 [&_h3]:font-semibold",
|
|
2978
|
+
"[&_h4]:mb-2 [&_h4]:mt-6 [&_h4]:scroll-mt-24 [&_h4]:font-semibold",
|
|
2979
|
+
// Body copy
|
|
2980
|
+
"[&_p]:my-4 [&_p]:leading-7",
|
|
2981
|
+
"[&_a]:text-primary [&_a]:underline [&_a]:decoration-primary/40 [&_a]:underline-offset-4 hover:[&_a]:decoration-primary",
|
|
2982
|
+
"[&_strong]:font-semibold [&_strong]:text-foreground [&_em]:italic",
|
|
2983
|
+
"[&_ul]:my-4 [&_ul]:list-disc [&_ul]:space-y-1.5 [&_ul]:pl-6",
|
|
2984
|
+
"[&_ol]:my-4 [&_ol]:list-decimal [&_ol]:space-y-1.5 [&_ol]:pl-6",
|
|
2985
|
+
"[&_li]:leading-7 [&_li>p]:my-0",
|
|
2986
|
+
"[&_blockquote]:my-6 [&_blockquote]:border-l-2 [&_blockquote]:border-primary/40 [&_blockquote]:pl-4 [&_blockquote]:italic [&_blockquote]:text-muted-foreground",
|
|
2987
|
+
// Code
|
|
2988
|
+
"[&_code]:rounded [&_code]:bg-muted [&_code]:px-1.5 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[0.875em]",
|
|
2989
|
+
"[&_pre]:my-5 [&_pre]:overflow-x-auto [&_pre]:rounded-lg [&_pre]:border [&_pre]:border-border [&_pre]:bg-muted/50 [&_pre]:p-4",
|
|
2990
|
+
"[&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_pre_code]:text-sm",
|
|
2991
|
+
// Media, rules, tables
|
|
2992
|
+
"[&_hr]:my-8 [&_hr]:border-border",
|
|
2993
|
+
"[&_img]:my-6 [&_img]:rounded-lg [&_img]:border [&_img]:border-border",
|
|
2994
|
+
"[&_figure]:my-6 [&_figcaption]:mt-2 [&_figcaption]:text-center [&_figcaption]:text-xs [&_figcaption]:text-muted-foreground",
|
|
2995
|
+
"[&_table]:my-6 [&_table]:w-full [&_table]:border-collapse [&_table]:text-sm",
|
|
2996
|
+
"[&_th]:border-b [&_th]:border-border [&_th]:px-3 [&_th]:py-2 [&_th]:text-left [&_th]:font-semibold",
|
|
2997
|
+
"[&_td]:border-b [&_td]:border-border [&_td]:px-3 [&_td]:py-2",
|
|
2998
|
+
className
|
|
2999
|
+
),
|
|
3000
|
+
...props
|
|
3001
|
+
}
|
|
3002
|
+
);
|
|
3003
|
+
});
|
|
3004
|
+
|
|
3005
|
+
// src/components/site-footer/SiteFooter.tsx
|
|
3006
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3007
|
+
function SiteFooter({
|
|
3008
|
+
brand,
|
|
3009
|
+
tagline,
|
|
3010
|
+
columns,
|
|
3011
|
+
legal,
|
|
3012
|
+
linkComponent,
|
|
3013
|
+
className,
|
|
3014
|
+
...props
|
|
3015
|
+
}) {
|
|
3016
|
+
const Link3 = linkComponent ?? "a";
|
|
3017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("footer", { className: cn("border-t border-border bg-muted/30", className), ...props, children: [
|
|
3018
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "mx-auto grid w-full max-w-7xl gap-8 px-4 py-12 sm:grid-cols-2 sm:px-6 lg:grid-cols-4", children: [
|
|
3019
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "min-w-0", children: [
|
|
3020
|
+
brand,
|
|
3021
|
+
tagline && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "mt-3 max-w-56 text-sm text-muted-foreground", children: tagline })
|
|
3022
|
+
] }),
|
|
3023
|
+
columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { children: [
|
|
3024
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h3", { className: "mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground", children: column.title }),
|
|
3025
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("ul", { className: "space-y-2 text-sm", children: column.links.map((link) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3026
|
+
Link3,
|
|
3027
|
+
{
|
|
3028
|
+
href: link.href,
|
|
3029
|
+
...link.external ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
3030
|
+
className: "text-muted-foreground transition-colors hover:text-foreground",
|
|
3031
|
+
children: link.label
|
|
3032
|
+
}
|
|
3033
|
+
) }, `${column.title}-${link.href}-${link.label}`)) })
|
|
3034
|
+
] }, column.title))
|
|
3035
|
+
] }),
|
|
3036
|
+
legal && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "border-t border-border", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "mx-auto flex w-full max-w-7xl flex-wrap items-center justify-between gap-2 px-4 py-4 text-xs text-muted-foreground sm:px-6", children: legal }) })
|
|
3037
|
+
] });
|
|
3038
|
+
}
|
|
3039
|
+
|
|
3040
|
+
// src/components/site-header/SiteHeader.tsx
|
|
3041
|
+
var React39 = __toESM(require("react"));
|
|
3042
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3043
|
+
function isActive(itemHref, activeHref, match) {
|
|
3044
|
+
if (!activeHref) return false;
|
|
3045
|
+
if (itemHref === activeHref) return true;
|
|
3046
|
+
if (match === "exact") return false;
|
|
3047
|
+
return activeHref === itemHref || activeHref.startsWith(itemHref.endsWith("/") ? itemHref : `${itemHref}/`);
|
|
3048
|
+
}
|
|
3049
|
+
function SiteHeader({
|
|
3050
|
+
brand,
|
|
3051
|
+
items,
|
|
3052
|
+
activeHref,
|
|
3053
|
+
match = "prefix",
|
|
3054
|
+
actions,
|
|
3055
|
+
linkComponent,
|
|
3056
|
+
sticky = true,
|
|
3057
|
+
mobileLabel = "Menu",
|
|
3058
|
+
className,
|
|
3059
|
+
...props
|
|
3060
|
+
}) {
|
|
3061
|
+
const [mobileOpen, setMobileOpen] = React39.useState(false);
|
|
3062
|
+
const Link3 = linkComponent ?? "a";
|
|
3063
|
+
const navLink = (item, extra) => {
|
|
3064
|
+
const active = isActive(item.href, activeHref, match);
|
|
3065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3066
|
+
Link3,
|
|
3067
|
+
{
|
|
3068
|
+
href: item.href,
|
|
3069
|
+
"aria-current": active ? "page" : void 0,
|
|
3070
|
+
...item.external ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
3071
|
+
onClick: extra === "mobile" ? () => setMobileOpen(false) : void 0,
|
|
3072
|
+
className: cn(
|
|
3073
|
+
"rounded-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3074
|
+
extra === "mobile" ? "block rounded-md px-3 py-2 text-base hover:bg-accent" : "text-sm hover:text-foreground",
|
|
3075
|
+
active ? "font-medium text-foreground" : "text-muted-foreground"
|
|
3076
|
+
),
|
|
3077
|
+
children: item.label
|
|
3078
|
+
},
|
|
3079
|
+
item.href
|
|
3080
|
+
);
|
|
3081
|
+
};
|
|
3082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
3083
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3084
|
+
"header",
|
|
3085
|
+
{
|
|
3086
|
+
className: cn(
|
|
3087
|
+
"w-full border-b border-border bg-background/80 backdrop-blur supports-[backdrop-filter]:bg-background/60",
|
|
3088
|
+
sticky && "sticky top-0 z-40",
|
|
3089
|
+
className
|
|
3090
|
+
),
|
|
3091
|
+
...props,
|
|
3092
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("nav", { className: "mx-auto flex h-14 w-full max-w-7xl items-center justify-between gap-4 px-4 sm:px-6", children: [
|
|
3093
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex min-w-0 items-center gap-6", children: [
|
|
3094
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Link3, { href: "/", "aria-label": "Home", className: "flex shrink-0 items-center", children: brand }),
|
|
3095
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "hidden items-center gap-5 md:flex", children: items.map((item) => navLink(item)) })
|
|
3096
|
+
] }),
|
|
3097
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3098
|
+
actions,
|
|
3099
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3100
|
+
"button",
|
|
3101
|
+
{
|
|
3102
|
+
type: "button",
|
|
3103
|
+
onClick: () => setMobileOpen(true),
|
|
3104
|
+
"aria-label": "Open menu",
|
|
3105
|
+
className: "rounded-md border border-border p-2 text-muted-foreground hover:bg-muted md:hidden",
|
|
3106
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { "aria-hidden": "true", children: "\u2630" })
|
|
3107
|
+
}
|
|
3108
|
+
)
|
|
3109
|
+
] })
|
|
3110
|
+
] })
|
|
3111
|
+
}
|
|
3112
|
+
),
|
|
3113
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(Drawer, { open: mobileOpen, onOpenChange: setMobileOpen, title: mobileLabel, side: "right", size: "sm", animate: true, children: [
|
|
3114
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("nav", { "aria-label": "Mobile", className: "flex flex-col gap-1", children: items.map((item) => navLink(item, "mobile")) }),
|
|
3115
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "mt-4 border-t border-border pt-4", children: actions })
|
|
3116
|
+
] })
|
|
3117
|
+
] });
|
|
3118
|
+
}
|
|
3119
|
+
|
|
3120
|
+
// src/components/accordion/Accordion.tsx
|
|
3121
|
+
var React40 = __toESM(require("react"));
|
|
3122
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3123
|
+
var AccordionContext = React40.createContext({
|
|
2729
3124
|
openItems: /* @__PURE__ */ new Set(),
|
|
2730
3125
|
toggle: () => {
|
|
2731
3126
|
},
|
|
2732
3127
|
collapsible: true
|
|
2733
3128
|
});
|
|
2734
|
-
var Accordion =
|
|
3129
|
+
var Accordion = React40.forwardRef(
|
|
2735
3130
|
({
|
|
2736
3131
|
value,
|
|
2737
3132
|
defaultValue = [],
|
|
@@ -2743,9 +3138,9 @@ var Accordion = React36.forwardRef(
|
|
|
2743
3138
|
style,
|
|
2744
3139
|
children
|
|
2745
3140
|
}, ref) => {
|
|
2746
|
-
const [internalOpen, setInternalOpen] =
|
|
3141
|
+
const [internalOpen, setInternalOpen] = React40.useState(defaultValue);
|
|
2747
3142
|
const current = value ?? internalOpen;
|
|
2748
|
-
const toggle =
|
|
3143
|
+
const toggle = React40.useCallback(
|
|
2749
3144
|
(id) => {
|
|
2750
3145
|
const next = current.includes(id) ? current.filter((item) => item !== id) : collapsible ? [id] : [...current, id];
|
|
2751
3146
|
if (value === void 0) setInternalOpen(next);
|
|
@@ -2754,7 +3149,7 @@ var Accordion = React36.forwardRef(
|
|
|
2754
3149
|
[current, collapsible, value, onValueChange]
|
|
2755
3150
|
);
|
|
2756
3151
|
const gapResolved = resolveGap(gap);
|
|
2757
|
-
return /* @__PURE__ */ (0,
|
|
3152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2758
3153
|
"div",
|
|
2759
3154
|
{
|
|
2760
3155
|
ref,
|
|
@@ -2767,25 +3162,25 @@ var Accordion = React36.forwardRef(
|
|
|
2767
3162
|
className
|
|
2768
3163
|
),
|
|
2769
3164
|
style: { ...gapResolved.style, ...style },
|
|
2770
|
-
children: /* @__PURE__ */ (0,
|
|
3165
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(AccordionContext.Provider, { value: { openItems: new Set(current), toggle, collapsible }, children })
|
|
2771
3166
|
}
|
|
2772
3167
|
);
|
|
2773
3168
|
}
|
|
2774
3169
|
);
|
|
2775
3170
|
Accordion.displayName = "Accordion";
|
|
2776
|
-
var AccordionItem =
|
|
2777
|
-
({ id, className, children }, ref) => /* @__PURE__ */ (0,
|
|
3171
|
+
var AccordionItem = React40.forwardRef(
|
|
3172
|
+
({ id, className, children }, ref) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { ref, "data-accordion-item": id, className, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(AccordionItemContext.Provider, { value: { id }, children }) })
|
|
2778
3173
|
);
|
|
2779
3174
|
AccordionItem.displayName = "AccordionItem";
|
|
2780
|
-
var AccordionItemContext =
|
|
2781
|
-
var AccordionTrigger =
|
|
3175
|
+
var AccordionItemContext = React40.createContext({ id: "" });
|
|
3176
|
+
var AccordionTrigger = React40.forwardRef(
|
|
2782
3177
|
({ className, children, icon, ...props }, ref) => {
|
|
2783
|
-
const { id } =
|
|
2784
|
-
const { openItems, toggle } =
|
|
3178
|
+
const { id } = React40.useContext(AccordionItemContext);
|
|
3179
|
+
const { openItems, toggle } = React40.useContext(AccordionContext);
|
|
2785
3180
|
const open = openItems.has(id);
|
|
2786
3181
|
const panelId = `${id}-panel`;
|
|
2787
3182
|
const triggerId = `${id}-trigger`;
|
|
2788
|
-
return /* @__PURE__ */ (0,
|
|
3183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
2789
3184
|
"button",
|
|
2790
3185
|
{
|
|
2791
3186
|
ref,
|
|
@@ -2804,7 +3199,7 @@ var AccordionTrigger = React36.forwardRef(
|
|
|
2804
3199
|
...props,
|
|
2805
3200
|
children: [
|
|
2806
3201
|
children,
|
|
2807
|
-
icon ?? /* @__PURE__ */ (0,
|
|
3202
|
+
icon ?? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2808
3203
|
"svg",
|
|
2809
3204
|
{
|
|
2810
3205
|
"aria-hidden": "true",
|
|
@@ -2814,7 +3209,7 @@ var AccordionTrigger = React36.forwardRef(
|
|
|
2814
3209
|
strokeWidth: "2",
|
|
2815
3210
|
strokeLinecap: "round",
|
|
2816
3211
|
className: cn("h-4 w-4 shrink-0 transition-transform duration-200", open && "rotate-180"),
|
|
2817
|
-
children: /* @__PURE__ */ (0,
|
|
3212
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("polyline", { points: "6 9 12 15 18 9" })
|
|
2818
3213
|
}
|
|
2819
3214
|
)
|
|
2820
3215
|
]
|
|
@@ -2823,13 +3218,13 @@ var AccordionTrigger = React36.forwardRef(
|
|
|
2823
3218
|
}
|
|
2824
3219
|
);
|
|
2825
3220
|
AccordionTrigger.displayName = "AccordionTrigger";
|
|
2826
|
-
var AccordionContent =
|
|
3221
|
+
var AccordionContent = React40.forwardRef(
|
|
2827
3222
|
({ className, children, ...props }, ref) => {
|
|
2828
|
-
const { id } =
|
|
2829
|
-
const { openItems } =
|
|
3223
|
+
const { id } = React40.useContext(AccordionItemContext);
|
|
3224
|
+
const { openItems } = React40.useContext(AccordionContext);
|
|
2830
3225
|
const open = openItems.has(id);
|
|
2831
|
-
const [expanded, setExpanded] =
|
|
2832
|
-
|
|
3226
|
+
const [expanded, setExpanded] = React40.useState(open);
|
|
3227
|
+
React40.useEffect(() => {
|
|
2833
3228
|
if (!open) {
|
|
2834
3229
|
setExpanded(false);
|
|
2835
3230
|
return;
|
|
@@ -2848,7 +3243,7 @@ var AccordionContent = React36.forwardRef(
|
|
|
2848
3243
|
cancelAnimationFrame(second);
|
|
2849
3244
|
};
|
|
2850
3245
|
}, [open]);
|
|
2851
|
-
return /* @__PURE__ */ (0,
|
|
3246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2852
3247
|
"div",
|
|
2853
3248
|
{
|
|
2854
3249
|
ref,
|
|
@@ -2867,7 +3262,7 @@ var AccordionContent = React36.forwardRef(
|
|
|
2867
3262
|
className
|
|
2868
3263
|
),
|
|
2869
3264
|
...props,
|
|
2870
|
-
children: /* @__PURE__ */ (0,
|
|
3265
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "px-4 pb-3 text-sm text-muted-foreground", children }) })
|
|
2871
3266
|
}
|
|
2872
3267
|
);
|
|
2873
3268
|
}
|
|
@@ -2875,10 +3270,10 @@ var AccordionContent = React36.forwardRef(
|
|
|
2875
3270
|
AccordionContent.displayName = "AccordionContent";
|
|
2876
3271
|
|
|
2877
3272
|
// src/components/table/Table.tsx
|
|
2878
|
-
var
|
|
2879
|
-
var
|
|
2880
|
-
var Table =
|
|
2881
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3273
|
+
var React41 = __toESM(require("react"));
|
|
3274
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3275
|
+
var Table = React41.forwardRef(
|
|
3276
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2882
3277
|
"table",
|
|
2883
3278
|
{
|
|
2884
3279
|
ref,
|
|
@@ -2888,16 +3283,16 @@ var Table = React37.forwardRef(
|
|
|
2888
3283
|
) })
|
|
2889
3284
|
);
|
|
2890
3285
|
Table.displayName = "Table";
|
|
2891
|
-
var TableHeader =
|
|
2892
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3286
|
+
var TableHeader = React41.forwardRef(
|
|
3287
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("thead", { ref, className: cn("[&_tr]:border-b", className), ...props })
|
|
2893
3288
|
);
|
|
2894
3289
|
TableHeader.displayName = "TableHeader";
|
|
2895
|
-
var TableBody =
|
|
2896
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3290
|
+
var TableBody = React41.forwardRef(
|
|
3291
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("tbody", { ref, className: cn("[&_tr:last-child]:border-0", className), ...props })
|
|
2897
3292
|
);
|
|
2898
3293
|
TableBody.displayName = "TableBody";
|
|
2899
|
-
var TableFooter =
|
|
2900
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3294
|
+
var TableFooter = React41.forwardRef(
|
|
3295
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2901
3296
|
"tfoot",
|
|
2902
3297
|
{
|
|
2903
3298
|
ref,
|
|
@@ -2907,8 +3302,8 @@ var TableFooter = React37.forwardRef(
|
|
|
2907
3302
|
)
|
|
2908
3303
|
);
|
|
2909
3304
|
TableFooter.displayName = "TableFooter";
|
|
2910
|
-
var TableRow =
|
|
2911
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3305
|
+
var TableRow = React41.forwardRef(
|
|
3306
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2912
3307
|
"tr",
|
|
2913
3308
|
{
|
|
2914
3309
|
ref,
|
|
@@ -2921,8 +3316,8 @@ var TableRow = React37.forwardRef(
|
|
|
2921
3316
|
)
|
|
2922
3317
|
);
|
|
2923
3318
|
TableRow.displayName = "TableRow";
|
|
2924
|
-
var TableHead =
|
|
2925
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3319
|
+
var TableHead = React41.forwardRef(
|
|
3320
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2926
3321
|
"th",
|
|
2927
3322
|
{
|
|
2928
3323
|
ref,
|
|
@@ -2936,23 +3331,23 @@ var TableHead = React37.forwardRef(
|
|
|
2936
3331
|
)
|
|
2937
3332
|
);
|
|
2938
3333
|
TableHead.displayName = "TableHead";
|
|
2939
|
-
var TableCell =
|
|
2940
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3334
|
+
var TableCell = React41.forwardRef(
|
|
3335
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("td", { ref, className: cn("px-3 py-2 align-middle", className), ...props })
|
|
2941
3336
|
);
|
|
2942
3337
|
TableCell.displayName = "TableCell";
|
|
2943
|
-
var TableCaption =
|
|
2944
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3338
|
+
var TableCaption = React41.forwardRef(
|
|
3339
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("caption", { ref, className: cn("mt-3 text-xs text-muted-foreground", className), ...props })
|
|
2945
3340
|
);
|
|
2946
3341
|
TableCaption.displayName = "TableCaption";
|
|
2947
3342
|
|
|
2948
3343
|
// src/components/data-table/DataTable.tsx
|
|
2949
|
-
var
|
|
3344
|
+
var React43 = __toESM(require("react"));
|
|
2950
3345
|
|
|
2951
3346
|
// src/components/pagination/Pagination.tsx
|
|
2952
|
-
var
|
|
2953
|
-
var
|
|
3347
|
+
var React42 = __toESM(require("react"));
|
|
3348
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2954
3349
|
var controlClass = "inline-flex h-8 items-center rounded-md border border-border px-2.5 text-sm transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50";
|
|
2955
|
-
var Pagination =
|
|
3350
|
+
var Pagination = React42.forwardRef(
|
|
2956
3351
|
({
|
|
2957
3352
|
page: pageProp,
|
|
2958
3353
|
pageCount: pageCountProp,
|
|
@@ -2968,6 +3363,7 @@ var Pagination = React38.forwardRef(
|
|
|
2968
3363
|
showFirst,
|
|
2969
3364
|
showLast,
|
|
2970
3365
|
icons,
|
|
3366
|
+
labels,
|
|
2971
3367
|
className,
|
|
2972
3368
|
...props
|
|
2973
3369
|
}, ref) => {
|
|
@@ -2987,38 +3383,38 @@ var Pagination = React38.forwardRef(
|
|
|
2987
3383
|
const summaryEnabled = showSummary ?? (total !== void 0 && pageSize !== void 0);
|
|
2988
3384
|
const rangeStart = pageSize !== void 0 ? (page - 1) * pageSize + 1 : void 0;
|
|
2989
3385
|
const rangeEnd = pageSize !== void 0 && total !== void 0 ? Math.min(total, page * pageSize) : void 0;
|
|
2990
|
-
const nav = /* @__PURE__ */ (0,
|
|
3386
|
+
const nav = /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
2991
3387
|
"nav",
|
|
2992
3388
|
{
|
|
2993
3389
|
ref,
|
|
2994
|
-
"aria-label": "Pagination",
|
|
3390
|
+
"aria-label": labels?.pagination ?? "Pagination",
|
|
2995
3391
|
className: cn("flex items-center justify-center gap-1", summaryEnabled ? void 0 : className),
|
|
2996
3392
|
...props,
|
|
2997
3393
|
children: [
|
|
2998
|
-
withFirst && /* @__PURE__ */ (0,
|
|
3394
|
+
withFirst && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
2999
3395
|
"button",
|
|
3000
3396
|
{
|
|
3001
3397
|
type: "button",
|
|
3002
3398
|
onClick: () => onPageChange?.(1),
|
|
3003
3399
|
disabled: page <= 1,
|
|
3004
|
-
"aria-label": "First page",
|
|
3400
|
+
"aria-label": labels?.first ?? "First page",
|
|
3005
3401
|
className: controlClass,
|
|
3006
3402
|
children: icons?.first ?? "\xAB"
|
|
3007
3403
|
}
|
|
3008
3404
|
),
|
|
3009
|
-
/* @__PURE__ */ (0,
|
|
3405
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3010
3406
|
"button",
|
|
3011
3407
|
{
|
|
3012
3408
|
type: "button",
|
|
3013
3409
|
onClick: () => onPageChange?.(page - 1),
|
|
3014
3410
|
disabled: page <= 1,
|
|
3015
|
-
"aria-label": "Previous page",
|
|
3411
|
+
"aria-label": labels?.previous ?? "Previous page",
|
|
3016
3412
|
className: controlClass,
|
|
3017
3413
|
children: icons?.previous ?? "\u2039"
|
|
3018
3414
|
}
|
|
3019
3415
|
),
|
|
3020
3416
|
pages.map(
|
|
3021
|
-
(entry, index) => entry === "ellipsis" ? /* @__PURE__ */ (0,
|
|
3417
|
+
(entry, index) => entry === "ellipsis" ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3022
3418
|
"span",
|
|
3023
3419
|
{
|
|
3024
3420
|
"aria-hidden": "true",
|
|
@@ -3026,13 +3422,13 @@ var Pagination = React38.forwardRef(
|
|
|
3026
3422
|
children: "\u2026"
|
|
3027
3423
|
},
|
|
3028
3424
|
`ellipsis-${index}`
|
|
3029
|
-
) : /* @__PURE__ */ (0,
|
|
3425
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3030
3426
|
"button",
|
|
3031
3427
|
{
|
|
3032
3428
|
type: "button",
|
|
3033
3429
|
onClick: () => onPageChange?.(entry),
|
|
3034
3430
|
"aria-current": entry === page ? "page" : void 0,
|
|
3035
|
-
"aria-label": `Page ${entry}`,
|
|
3431
|
+
"aria-label": labels?.page?.(entry) ?? `Page ${entry}`,
|
|
3036
3432
|
className: cn(
|
|
3037
3433
|
"inline-flex h-8 w-8 items-center justify-center rounded-md border text-sm transition-colors",
|
|
3038
3434
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
@@ -3043,24 +3439,24 @@ var Pagination = React38.forwardRef(
|
|
|
3043
3439
|
entry
|
|
3044
3440
|
)
|
|
3045
3441
|
),
|
|
3046
|
-
/* @__PURE__ */ (0,
|
|
3442
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3047
3443
|
"button",
|
|
3048
3444
|
{
|
|
3049
3445
|
type: "button",
|
|
3050
3446
|
onClick: () => onPageChange?.(page + 1),
|
|
3051
3447
|
disabled: page >= pageCount,
|
|
3052
|
-
"aria-label": "Next page",
|
|
3448
|
+
"aria-label": labels?.next ?? "Next page",
|
|
3053
3449
|
className: controlClass,
|
|
3054
3450
|
children: icons?.next ?? "\u203A"
|
|
3055
3451
|
}
|
|
3056
3452
|
),
|
|
3057
|
-
withLast && /* @__PURE__ */ (0,
|
|
3453
|
+
withLast && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3058
3454
|
"button",
|
|
3059
3455
|
{
|
|
3060
3456
|
type: "button",
|
|
3061
3457
|
onClick: () => onPageChange?.(pageCount),
|
|
3062
3458
|
disabled: page >= pageCount,
|
|
3063
|
-
"aria-label": "Last page",
|
|
3459
|
+
"aria-label": labels?.last ?? "Last page",
|
|
3064
3460
|
className: controlClass,
|
|
3065
3461
|
children: icons?.last ?? "\xBB"
|
|
3066
3462
|
}
|
|
@@ -3069,8 +3465,8 @@ var Pagination = React38.forwardRef(
|
|
|
3069
3465
|
}
|
|
3070
3466
|
);
|
|
3071
3467
|
if (!summaryEnabled) return nav;
|
|
3072
|
-
return /* @__PURE__ */ (0,
|
|
3073
|
-
/* @__PURE__ */ (0,
|
|
3468
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: cn("flex flex-wrap items-center justify-between gap-3", className), children: [
|
|
3469
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-sm text-muted-foreground", children: rangeStart !== void 0 && rangeEnd !== void 0 && total !== void 0 ? `Showing ${rangeStart}\u2013${rangeEnd} of ${total} ${itemLabel}` : `Page ${page} of ${pageCount}` }),
|
|
3074
3470
|
nav
|
|
3075
3471
|
] });
|
|
3076
3472
|
}
|
|
@@ -3078,7 +3474,7 @@ var Pagination = React38.forwardRef(
|
|
|
3078
3474
|
Pagination.displayName = "Pagination";
|
|
3079
3475
|
|
|
3080
3476
|
// src/components/data-table/DataTable.tsx
|
|
3081
|
-
var
|
|
3477
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3082
3478
|
function compareValues(a, b) {
|
|
3083
3479
|
if (typeof a === "number" && typeof b === "number") return a - b;
|
|
3084
3480
|
if (a instanceof Date && b instanceof Date) return a.getTime() - b.getTime();
|
|
@@ -3099,8 +3495,16 @@ function DataTable({
|
|
|
3099
3495
|
pageSize,
|
|
3100
3496
|
page,
|
|
3101
3497
|
onPageChange,
|
|
3498
|
+
pageCount: pageCountProp,
|
|
3499
|
+
total,
|
|
3500
|
+
manualPagination = false,
|
|
3501
|
+
selectedRowIds,
|
|
3502
|
+
onSelectedRowIdsChange,
|
|
3503
|
+
isRowSelectable,
|
|
3504
|
+
bulkActions,
|
|
3102
3505
|
onRowClick,
|
|
3103
3506
|
emptyMessage = "No results.",
|
|
3507
|
+
selectAllLabel = "Select all rows",
|
|
3104
3508
|
stickyHeader,
|
|
3105
3509
|
density = "default",
|
|
3106
3510
|
zebra,
|
|
@@ -3108,9 +3512,9 @@ function DataTable({
|
|
|
3108
3512
|
loadingRows,
|
|
3109
3513
|
className
|
|
3110
3514
|
}) {
|
|
3111
|
-
const [internalSort, setInternalSort] =
|
|
3112
|
-
const [internalPage, setInternalPage] =
|
|
3113
|
-
const sort =
|
|
3515
|
+
const [internalSort, setInternalSort] = React43.useState(defaultSort);
|
|
3516
|
+
const [internalPage, setInternalPage] = React43.useState(1);
|
|
3517
|
+
const sort = React43.useMemo(() => {
|
|
3114
3518
|
if (sortKey !== void 0) {
|
|
3115
3519
|
return sortKey === null ? null : { key: sortKey, dir: sortDir ?? "asc" };
|
|
3116
3520
|
}
|
|
@@ -3127,7 +3531,7 @@ function DataTable({
|
|
|
3127
3531
|
if (page === void 0) setInternalPage(next);
|
|
3128
3532
|
onPageChange?.(next);
|
|
3129
3533
|
};
|
|
3130
|
-
const sorted =
|
|
3534
|
+
const sorted = React43.useMemo(() => {
|
|
3131
3535
|
if (!sort) return data;
|
|
3132
3536
|
const column = columns.find((c) => c.key === sort.key);
|
|
3133
3537
|
if (!column) return data;
|
|
@@ -3142,9 +3546,34 @@ function DataTable({
|
|
|
3142
3546
|
});
|
|
3143
3547
|
return copy;
|
|
3144
3548
|
}, [data, sort, columns]);
|
|
3145
|
-
const
|
|
3549
|
+
const effectiveTotal = total ?? sorted.length;
|
|
3550
|
+
const computedPageCount = pageSize ? Math.max(1, Math.ceil(effectiveTotal / pageSize)) : 0;
|
|
3551
|
+
const pageCount = pageCountProp ?? computedPageCount;
|
|
3146
3552
|
const safePage = Math.min(currentPage, pageCount || 1);
|
|
3147
|
-
const visible = pageSize ? sorted.slice((safePage - 1) * pageSize, safePage * pageSize) : sorted;
|
|
3553
|
+
const visible = manualPagination ? data : pageSize ? sorted.slice((safePage - 1) * pageSize, safePage * pageSize) : sorted;
|
|
3554
|
+
const [internalSelected, setInternalSelected] = React43.useState([]);
|
|
3555
|
+
const selectionEnabled = selectedRowIds !== void 0 || onSelectedRowIdsChange !== void 0;
|
|
3556
|
+
const selectedIds = selectedRowIds ?? internalSelected;
|
|
3557
|
+
const selectedSet = React43.useMemo(() => new Set(selectedIds), [selectedIds]);
|
|
3558
|
+
const selectableVisible = isRowSelectable ? visible.filter(isRowSelectable) : visible;
|
|
3559
|
+
const allSelected = selectableVisible.length > 0 && selectableVisible.every((row) => selectedSet.has(rowId(row)));
|
|
3560
|
+
const someSelected = selectableVisible.some((row) => selectedSet.has(rowId(row)));
|
|
3561
|
+
const commitSelection = (next) => {
|
|
3562
|
+
if (selectedRowIds === void 0) setInternalSelected(next);
|
|
3563
|
+
onSelectedRowIdsChange?.(next);
|
|
3564
|
+
};
|
|
3565
|
+
const toggleAll = () => {
|
|
3566
|
+
if (allSelected) {
|
|
3567
|
+
const visibleIds = new Set(selectableVisible.map((row) => rowId(row)));
|
|
3568
|
+
commitSelection(selectedIds.filter((id) => !visibleIds.has(id)));
|
|
3569
|
+
return;
|
|
3570
|
+
}
|
|
3571
|
+
const merged = /* @__PURE__ */ new Set([...selectedIds, ...selectableVisible.map((row) => rowId(row))]);
|
|
3572
|
+
commitSelection([...merged]);
|
|
3573
|
+
};
|
|
3574
|
+
const toggleRow = (id) => {
|
|
3575
|
+
commitSelection(selectedSet.has(id) ? selectedIds.filter((entry) => entry !== id) : [...selectedIds, id]);
|
|
3576
|
+
};
|
|
3148
3577
|
const cellValue = (row, column, index) => {
|
|
3149
3578
|
if (column.cell) return column.cell(row, index);
|
|
3150
3579
|
const raw = row[column.key];
|
|
@@ -3153,53 +3582,76 @@ function DataTable({
|
|
|
3153
3582
|
return String(raw);
|
|
3154
3583
|
};
|
|
3155
3584
|
const alignClass = (align) => align === "right" ? "text-right" : align === "center" ? "text-center" : "text-left";
|
|
3156
|
-
return /* @__PURE__ */ (0,
|
|
3157
|
-
/* @__PURE__ */ (0,
|
|
3585
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: cn("w-full space-y-3", className), children: [
|
|
3586
|
+
selectionEnabled && selectedIds.length > 0 && bulkActions && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex flex-wrap items-center justify-between gap-2 rounded-lg border border-border bg-muted/40 px-3 py-2 text-sm", children: [
|
|
3587
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { className: "font-medium", children: [
|
|
3588
|
+
selectedIds.length,
|
|
3589
|
+
" selected"
|
|
3590
|
+
] }),
|
|
3591
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "flex flex-wrap items-center gap-2", children: bulkActions })
|
|
3592
|
+
] }),
|
|
3593
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "w-full overflow-x-auto rounded-lg border border-border", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
3158
3594
|
"table",
|
|
3159
3595
|
{
|
|
3160
3596
|
className: cn("w-full caption-bottom", density === "compact" ? "text-xs" : "text-sm"),
|
|
3161
3597
|
children: [
|
|
3162
|
-
caption && /* @__PURE__ */ (0,
|
|
3163
|
-
/* @__PURE__ */ (0,
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3167
|
-
"th",
|
|
3598
|
+
caption && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("caption", { className: "px-3 py-2 text-left text-xs text-muted-foreground", children: caption }),
|
|
3599
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("thead", { className: cn("bg-muted/50", stickyHeader && "sticky top-0 z-10 bg-background"), children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("tr", { children: [
|
|
3600
|
+
selectionEnabled && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("th", { scope: "col", className: "w-10 border-b border-border px-3 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3601
|
+
Checkbox,
|
|
3168
3602
|
{
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3603
|
+
"aria-label": selectAllLabel,
|
|
3604
|
+
checked: allSelected,
|
|
3605
|
+
ref: (node) => {
|
|
3606
|
+
if (node) node.indeterminate = someSelected && !allSelected;
|
|
3607
|
+
},
|
|
3608
|
+
onCheckedChange: toggleAll
|
|
3609
|
+
}
|
|
3610
|
+
) }),
|
|
3611
|
+
columns.map((column) => {
|
|
3612
|
+
const isSorted = sort?.key === column.key;
|
|
3613
|
+
const ariaSort = !column.sortable ? void 0 : isSorted ? sort.dir === "asc" ? "ascending" : "descending" : "none";
|
|
3614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3615
|
+
"th",
|
|
3616
|
+
{
|
|
3617
|
+
scope: "col",
|
|
3618
|
+
"aria-sort": ariaSort,
|
|
3619
|
+
className: cn(
|
|
3620
|
+
"border-b border-border px-3 py-2 font-medium",
|
|
3621
|
+
alignClass(column.align),
|
|
3622
|
+
column.className
|
|
3623
|
+
),
|
|
3624
|
+
children: column.sortable ? /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
3625
|
+
"button",
|
|
3626
|
+
{
|
|
3627
|
+
type: "button",
|
|
3628
|
+
onClick: () => applySort(column.key),
|
|
3629
|
+
className: "inline-flex items-center gap-1 rounded px-1 py-0.5 transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3630
|
+
children: [
|
|
3631
|
+
column.header,
|
|
3632
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { "aria-hidden": "true", className: "text-[10px] text-muted-foreground", children: renderSortIcon ? renderSortIcon(isSorted ? sort.dir === "asc" ? "asc" : "desc" : "none") : isSorted ? sort.dir === "asc" ? "\u25B2" : "\u25BC" : "\u2195" })
|
|
3633
|
+
]
|
|
3634
|
+
}
|
|
3635
|
+
) : column.header
|
|
3636
|
+
},
|
|
3637
|
+
column.key
|
|
3638
|
+
);
|
|
3639
|
+
})
|
|
3640
|
+
] }) }),
|
|
3641
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("tbody", { "aria-busy": loading || void 0, children: loading ? Array.from(
|
|
3193
3642
|
{ length: (loadingRows ?? pageSize ?? Math.min(visible.length, 5)) || 5 },
|
|
3194
|
-
(_, skeletonRow) => /* @__PURE__ */ (0,
|
|
3195
|
-
|
|
3643
|
+
(_, skeletonRow) => /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("tr", { children: [
|
|
3644
|
+
selectionEnabled && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("td", { className: cn("px-3 py-2", density === "compact" && "px-2 py-1"), children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Skeleton, { className: "h-4 w-4" }) }),
|
|
3645
|
+
columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("td", { className: cn("px-3 py-2", density === "compact" && "px-2 py-1"), children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Skeleton, { className: density === "compact" ? "h-3 w-full" : "h-4 w-full" }) }, column.key))
|
|
3646
|
+
] }, `skeleton-${skeletonRow}`)
|
|
3647
|
+
) : visible.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3196
3648
|
"td",
|
|
3197
3649
|
{
|
|
3198
|
-
colSpan: columns.length,
|
|
3650
|
+
colSpan: columns.length + (selectionEnabled ? 1 : 0),
|
|
3199
3651
|
className: "px-3 py-8 text-center text-sm text-muted-foreground",
|
|
3200
3652
|
children: emptyMessage
|
|
3201
3653
|
}
|
|
3202
|
-
) }) : visible.map((row, index) => /* @__PURE__ */ (0,
|
|
3654
|
+
) }) : visible.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
3203
3655
|
"tr",
|
|
3204
3656
|
{
|
|
3205
3657
|
tabIndex: onRowClick ? 0 : void 0,
|
|
@@ -3215,35 +3667,53 @@ function DataTable({
|
|
|
3215
3667
|
zebra && "[&:nth-child(odd)]:bg-muted/30",
|
|
3216
3668
|
onRowClick && "cursor-pointer transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring"
|
|
3217
3669
|
),
|
|
3218
|
-
children:
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
"align-middle",
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3670
|
+
children: [
|
|
3671
|
+
selectionEnabled && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3672
|
+
"td",
|
|
3673
|
+
{
|
|
3674
|
+
className: cn("align-middle", density === "compact" ? "px-2 py-1" : "px-3 py-2"),
|
|
3675
|
+
onClick: (event) => event.stopPropagation(),
|
|
3676
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3677
|
+
Checkbox,
|
|
3678
|
+
{
|
|
3679
|
+
"aria-label": `Select row ${rowId(row)}`,
|
|
3680
|
+
checked: selectedSet.has(rowId(row)),
|
|
3681
|
+
disabled: isRowSelectable ? !isRowSelectable(row) : void 0,
|
|
3682
|
+
onCheckedChange: () => toggleRow(rowId(row))
|
|
3683
|
+
}
|
|
3684
|
+
)
|
|
3685
|
+
}
|
|
3686
|
+
),
|
|
3687
|
+
columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3688
|
+
"td",
|
|
3689
|
+
{
|
|
3690
|
+
className: cn(
|
|
3691
|
+
"align-middle",
|
|
3692
|
+
density === "compact" ? "px-2 py-1" : "px-3 py-2",
|
|
3693
|
+
alignClass(column.align),
|
|
3694
|
+
column.className
|
|
3695
|
+
),
|
|
3696
|
+
children: column.onClick ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3697
|
+
"button",
|
|
3698
|
+
{
|
|
3699
|
+
type: "button",
|
|
3700
|
+
onClick: () => column.onClick(row),
|
|
3701
|
+
className: "block w-full rounded px-1.5 py-0.5 text-left transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3702
|
+
children: cellValue(row, column, index)
|
|
3703
|
+
}
|
|
3704
|
+
) : cellValue(row, column, index)
|
|
3705
|
+
},
|
|
3706
|
+
column.key
|
|
3707
|
+
))
|
|
3708
|
+
]
|
|
3239
3709
|
},
|
|
3240
3710
|
rowId(row)
|
|
3241
3711
|
)) })
|
|
3242
3712
|
]
|
|
3243
3713
|
}
|
|
3244
3714
|
) }),
|
|
3245
|
-
pageSize && pageCount > 1 && /* @__PURE__ */ (0,
|
|
3246
|
-
/* @__PURE__ */ (0,
|
|
3715
|
+
pageSize && pageCount > 1 && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex flex-wrap items-center justify-between gap-x-4 gap-y-2", children: [
|
|
3716
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
3247
3717
|
"p",
|
|
3248
3718
|
{
|
|
3249
3719
|
className: "min-h-8 leading-none text-xs text-muted-foreground",
|
|
@@ -3251,23 +3721,23 @@ function DataTable({
|
|
|
3251
3721
|
children: [
|
|
3252
3722
|
(safePage - 1) * pageSize + 1,
|
|
3253
3723
|
"\u2013",
|
|
3254
|
-
Math.min(safePage * pageSize,
|
|
3724
|
+
Math.min(safePage * pageSize, effectiveTotal),
|
|
3255
3725
|
" of",
|
|
3256
3726
|
" ",
|
|
3257
|
-
|
|
3727
|
+
effectiveTotal
|
|
3258
3728
|
]
|
|
3259
3729
|
}
|
|
3260
3730
|
),
|
|
3261
|
-
/* @__PURE__ */ (0,
|
|
3731
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Pagination, { page: safePage, pageCount, onPageChange: setPage })
|
|
3262
3732
|
] })
|
|
3263
3733
|
] });
|
|
3264
3734
|
}
|
|
3265
3735
|
|
|
3266
3736
|
// src/components/list/List.tsx
|
|
3267
|
-
var
|
|
3268
|
-
var
|
|
3269
|
-
var List =
|
|
3270
|
-
({ divided, bordered, size = "default", className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3737
|
+
var React44 = __toESM(require("react"));
|
|
3738
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3739
|
+
var List = React44.forwardRef(
|
|
3740
|
+
({ divided, bordered, size = "default", className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3271
3741
|
"ul",
|
|
3272
3742
|
{
|
|
3273
3743
|
ref,
|
|
@@ -3283,7 +3753,7 @@ var List = React40.forwardRef(
|
|
|
3283
3753
|
)
|
|
3284
3754
|
);
|
|
3285
3755
|
List.displayName = "List";
|
|
3286
|
-
var ListItem =
|
|
3756
|
+
var ListItem = React44.forwardRef(
|
|
3287
3757
|
({ leading, trailing, selected, onClick, description, disabled, className, children, ...props }, ref) => {
|
|
3288
3758
|
const padding = "px-3 py-2.5";
|
|
3289
3759
|
const rowClass = cn(
|
|
@@ -3293,23 +3763,77 @@ var ListItem = React40.forwardRef(
|
|
|
3293
3763
|
disabled && "opacity-50",
|
|
3294
3764
|
className
|
|
3295
3765
|
);
|
|
3296
|
-
const body = /* @__PURE__ */ (0,
|
|
3297
|
-
leading && /* @__PURE__ */ (0,
|
|
3298
|
-
/* @__PURE__ */ (0,
|
|
3299
|
-
/* @__PURE__ */ (0,
|
|
3300
|
-
description && /* @__PURE__ */ (0,
|
|
3766
|
+
const body = /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
3767
|
+
leading && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "flex shrink-0 items-center", children: leading }),
|
|
3768
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: "min-w-0 flex-1", children: [
|
|
3769
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "block truncate", children }),
|
|
3770
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "mt-0.5 block truncate text-xs text-muted-foreground", children: description })
|
|
3301
3771
|
] }),
|
|
3302
|
-
trailing && /* @__PURE__ */ (0,
|
|
3772
|
+
trailing && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "flex shrink-0 items-center text-xs text-muted-foreground", children: trailing })
|
|
3303
3773
|
] });
|
|
3304
|
-
return /* @__PURE__ */ (0,
|
|
3774
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("li", { ref, ...props, children: onClick ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("button", { type: "button", onClick, disabled, className: cn(padding, rowClass), children: body }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: cn(padding, rowClass), children: body }) });
|
|
3305
3775
|
}
|
|
3306
3776
|
);
|
|
3307
3777
|
ListItem.displayName = "ListItem";
|
|
3308
3778
|
|
|
3779
|
+
// src/components/link/Link.tsx
|
|
3780
|
+
var React45 = __toESM(require("react"));
|
|
3781
|
+
var import_react_slot4 = require("@radix-ui/react-slot");
|
|
3782
|
+
var import_class_variance_authority6 = require("class-variance-authority");
|
|
3783
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3784
|
+
var linkVariants = (0, import_class_variance_authority6.cva)("inline-flex items-center gap-1 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background rounded-sm", {
|
|
3785
|
+
variants: {
|
|
3786
|
+
variant: {
|
|
3787
|
+
default: "text-primary hover:underline underline-offset-4",
|
|
3788
|
+
muted: "text-muted-foreground hover:text-foreground",
|
|
3789
|
+
underline: "underline underline-offset-4 hover:text-primary",
|
|
3790
|
+
arrow: "font-medium text-primary hover:underline underline-offset-4",
|
|
3791
|
+
external: "text-primary hover:underline underline-offset-4"
|
|
3792
|
+
}
|
|
3793
|
+
},
|
|
3794
|
+
defaultVariants: { variant: "default" }
|
|
3795
|
+
});
|
|
3796
|
+
var ABSOLUTE = /^https?:\/\//i;
|
|
3797
|
+
var Link = React45.forwardRef(function Link2({ className, variant, asChild = false, external, target, rel, children, ...props }, ref) {
|
|
3798
|
+
const isAbsolute = typeof props.href === "string" && ABSOLUTE.test(props.href);
|
|
3799
|
+
const isExternal = external ?? isAbsolute;
|
|
3800
|
+
const Comp = asChild ? import_react_slot4.Slot : "a";
|
|
3801
|
+
if (asChild) {
|
|
3802
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3803
|
+
Comp,
|
|
3804
|
+
{
|
|
3805
|
+
ref,
|
|
3806
|
+
className: cn(linkVariants({ variant }), className),
|
|
3807
|
+
target: isExternal ? target ?? "_blank" : target,
|
|
3808
|
+
rel: isExternal ? rel ?? "noopener noreferrer" : rel,
|
|
3809
|
+
...props,
|
|
3810
|
+
children
|
|
3811
|
+
}
|
|
3812
|
+
);
|
|
3813
|
+
}
|
|
3814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
3815
|
+
Comp,
|
|
3816
|
+
{
|
|
3817
|
+
ref,
|
|
3818
|
+
className: cn(linkVariants({ variant }), className),
|
|
3819
|
+
target: isExternal ? target ?? "_blank" : target,
|
|
3820
|
+
rel: isExternal ? rel ?? "noopener noreferrer" : rel,
|
|
3821
|
+
...props,
|
|
3822
|
+
children: [
|
|
3823
|
+
children,
|
|
3824
|
+
isExternal && variant !== "muted" && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
|
|
3825
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { "aria-hidden": "true", className: "text-[0.75em]", children: "\u2197" }),
|
|
3826
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "sr-only", children: "(opens in a new tab)" })
|
|
3827
|
+
] })
|
|
3828
|
+
]
|
|
3829
|
+
}
|
|
3830
|
+
);
|
|
3831
|
+
});
|
|
3832
|
+
|
|
3309
3833
|
// src/components/text/Text.tsx
|
|
3310
|
-
var
|
|
3311
|
-
var
|
|
3312
|
-
var
|
|
3834
|
+
var React46 = __toESM(require("react"));
|
|
3835
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3836
|
+
var sizeClasses4 = {
|
|
3313
3837
|
xs: "text-xs",
|
|
3314
3838
|
sm: "text-sm",
|
|
3315
3839
|
base: "text-base",
|
|
@@ -3322,15 +3846,15 @@ var weightClasses = {
|
|
|
3322
3846
|
semibold: "font-semibold",
|
|
3323
3847
|
bold: "font-bold"
|
|
3324
3848
|
};
|
|
3325
|
-
var Text =
|
|
3849
|
+
var Text = React46.forwardRef(
|
|
3326
3850
|
({ inline, size = "base", weight, muted, className, ...props }, ref) => {
|
|
3327
3851
|
const Tag = inline ? "span" : "p";
|
|
3328
|
-
return /* @__PURE__ */ (0,
|
|
3852
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3329
3853
|
Tag,
|
|
3330
3854
|
{
|
|
3331
3855
|
ref,
|
|
3332
3856
|
className: cn(
|
|
3333
|
-
|
|
3857
|
+
sizeClasses4[size],
|
|
3334
3858
|
weight && weightClasses[weight],
|
|
3335
3859
|
muted && "text-muted-foreground",
|
|
3336
3860
|
inline ? "inline" : "block",
|
|
@@ -3344,8 +3868,8 @@ var Text = React41.forwardRef(
|
|
|
3344
3868
|
Text.displayName = "Text";
|
|
3345
3869
|
|
|
3346
3870
|
// src/components/heading/Heading.tsx
|
|
3347
|
-
var
|
|
3348
|
-
var
|
|
3871
|
+
var React47 = __toESM(require("react"));
|
|
3872
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3349
3873
|
var levelClasses = {
|
|
3350
3874
|
1: "text-4xl",
|
|
3351
3875
|
2: "text-3xl",
|
|
@@ -3354,7 +3878,7 @@ var levelClasses = {
|
|
|
3354
3878
|
5: "text-lg",
|
|
3355
3879
|
6: "text-base"
|
|
3356
3880
|
};
|
|
3357
|
-
var
|
|
3881
|
+
var sizeClasses5 = {
|
|
3358
3882
|
sm: "text-lg",
|
|
3359
3883
|
md: "text-xl",
|
|
3360
3884
|
lg: "text-2xl",
|
|
@@ -3362,16 +3886,16 @@ var sizeClasses4 = {
|
|
|
3362
3886
|
"2xl": "text-4xl",
|
|
3363
3887
|
"3xl": "text-5xl"
|
|
3364
3888
|
};
|
|
3365
|
-
var Heading =
|
|
3889
|
+
var Heading = React47.forwardRef(
|
|
3366
3890
|
({ level, size, muted, className, ...props }, ref) => {
|
|
3367
3891
|
const Tag = `h${level}`;
|
|
3368
|
-
return /* @__PURE__ */ (0,
|
|
3892
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3369
3893
|
Tag,
|
|
3370
3894
|
{
|
|
3371
3895
|
ref,
|
|
3372
3896
|
className: cn(
|
|
3373
3897
|
"font-semibold tracking-tight",
|
|
3374
|
-
size ?
|
|
3898
|
+
size ? sizeClasses5[size] : levelClasses[level],
|
|
3375
3899
|
muted && "text-muted-foreground",
|
|
3376
3900
|
className
|
|
3377
3901
|
),
|
|
@@ -3383,10 +3907,10 @@ var Heading = React42.forwardRef(
|
|
|
3383
3907
|
Heading.displayName = "Heading";
|
|
3384
3908
|
|
|
3385
3909
|
// src/components/empty-state/EmptyState.tsx
|
|
3386
|
-
var
|
|
3387
|
-
var
|
|
3388
|
-
var EmptyState =
|
|
3389
|
-
return /* @__PURE__ */ (0,
|
|
3910
|
+
var React48 = __toESM(require("react"));
|
|
3911
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3912
|
+
var EmptyState = React48.forwardRef(function EmptyState2({ icon, title, description, action, secondaryAction, size = "md", className, children, ...props }, ref) {
|
|
3913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
3390
3914
|
"div",
|
|
3391
3915
|
{
|
|
3392
3916
|
ref,
|
|
@@ -3397,11 +3921,11 @@ var EmptyState = React43.forwardRef(function EmptyState2({ icon, title, descript
|
|
|
3397
3921
|
),
|
|
3398
3922
|
...props,
|
|
3399
3923
|
children: [
|
|
3400
|
-
icon && /* @__PURE__ */ (0,
|
|
3401
|
-
/* @__PURE__ */ (0,
|
|
3402
|
-
description && /* @__PURE__ */ (0,
|
|
3924
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "text-muted-foreground [&_svg]:size-8", children: icon }),
|
|
3925
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: cn("font-semibold", size === "md" ? "text-base" : "text-sm"), children: title }),
|
|
3926
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "max-w-sm text-sm text-muted-foreground", children: description }),
|
|
3403
3927
|
children,
|
|
3404
|
-
(action || secondaryAction) && /* @__PURE__ */ (0,
|
|
3928
|
+
(action || secondaryAction) && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "mt-1 flex flex-wrap items-center justify-center gap-2", children: [
|
|
3405
3929
|
action,
|
|
3406
3930
|
secondaryAction
|
|
3407
3931
|
] })
|
|
@@ -3411,57 +3935,96 @@ var EmptyState = React43.forwardRef(function EmptyState2({ icon, title, descript
|
|
|
3411
3935
|
});
|
|
3412
3936
|
|
|
3413
3937
|
// src/components/page-header/PageHeader.tsx
|
|
3414
|
-
var
|
|
3415
|
-
var
|
|
3416
|
-
var
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3938
|
+
var React49 = __toESM(require("react"));
|
|
3939
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3940
|
+
var sizeClasses6 = {
|
|
3941
|
+
sm: "text-xl",
|
|
3942
|
+
md: "text-2xl",
|
|
3943
|
+
lg: "text-3xl",
|
|
3944
|
+
hero: "text-4xl sm:text-5xl lg:text-[3.4rem] lg:leading-[1.1]"
|
|
3945
|
+
};
|
|
3946
|
+
var PageHeader = React49.forwardRef(function PageHeader2({ title, description, breadcrumbs, actions, eyebrow, size = "md", align = "left", className, children, ...props }, ref) {
|
|
3947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { ref, className: cn("flex flex-col gap-2", align === "center" && "items-center text-center", className), ...props, children: [
|
|
3948
|
+
breadcrumbs && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "text-sm text-muted-foreground", children: breadcrumbs }),
|
|
3949
|
+
eyebrow && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "text-xs font-medium uppercase tracking-wide text-primary", children: eyebrow }),
|
|
3950
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: cn("flex w-full flex-wrap items-start justify-between gap-3", align === "center" && "justify-center"), children: [
|
|
3951
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: cn("min-w-0", align === "center" && "flex flex-col items-center"), children: [
|
|
3952
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("h1", { className: cn("font-semibold tracking-tight", sizeClasses6[size]), children: title }),
|
|
3953
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "mt-2 max-w-2xl text-base text-muted-foreground", children: description })
|
|
3423
3954
|
] }),
|
|
3424
|
-
actions && /* @__PURE__ */ (0,
|
|
3955
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions })
|
|
3425
3956
|
] }),
|
|
3426
|
-
children && /* @__PURE__ */ (0,
|
|
3957
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "mt-2", children })
|
|
3427
3958
|
] });
|
|
3428
3959
|
});
|
|
3429
3960
|
|
|
3961
|
+
// src/components/section-heading/SectionHeading.tsx
|
|
3962
|
+
var React50 = __toESM(require("react"));
|
|
3963
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3964
|
+
var sizeClasses7 = {
|
|
3965
|
+
sm: "text-lg",
|
|
3966
|
+
md: "text-2xl",
|
|
3967
|
+
lg: "text-3xl"
|
|
3968
|
+
};
|
|
3969
|
+
var SectionHeading = React50.forwardRef(function SectionHeading2({ title, description, eyebrow, actions, level = 2, align = "left", size = "md", className, ...props }, ref) {
|
|
3970
|
+
const Heading2 = `h${level}`;
|
|
3971
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
3972
|
+
"div",
|
|
3973
|
+
{
|
|
3974
|
+
ref,
|
|
3975
|
+
className: cn(
|
|
3976
|
+
"flex flex-col gap-2",
|
|
3977
|
+
align === "center" ? "items-center text-center" : "sm:flex-row sm:items-end sm:justify-between",
|
|
3978
|
+
className
|
|
3979
|
+
),
|
|
3980
|
+
...props,
|
|
3981
|
+
children: [
|
|
3982
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: cn("min-w-0", align === "center" && "flex flex-col items-center"), children: [
|
|
3983
|
+
eyebrow && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { className: "mb-1 text-xs font-medium uppercase tracking-wide text-primary", children: eyebrow }),
|
|
3984
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Heading2, { className: cn("font-semibold tracking-tight", sizeClasses7[size]), children: title }),
|
|
3985
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { className: cn("mt-2 max-w-2xl text-muted-foreground", align === "center" ? "mx-auto" : ""), children: description })
|
|
3986
|
+
] }),
|
|
3987
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "flex shrink-0 items-center gap-2", children: actions })
|
|
3988
|
+
]
|
|
3989
|
+
}
|
|
3990
|
+
);
|
|
3991
|
+
});
|
|
3992
|
+
|
|
3430
3993
|
// src/components/metric-card/MetricCard.tsx
|
|
3431
|
-
var
|
|
3432
|
-
var
|
|
3994
|
+
var React51 = __toESM(require("react"));
|
|
3995
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
3433
3996
|
var trendClasses = {
|
|
3434
3997
|
up: "text-success",
|
|
3435
3998
|
down: "text-destructive",
|
|
3436
3999
|
flat: "text-muted-foreground"
|
|
3437
4000
|
};
|
|
3438
4001
|
var trendGlyph = { up: "\u2191", down: "\u2193", flat: "\u2192" };
|
|
3439
|
-
var MetricCard =
|
|
3440
|
-
return /* @__PURE__ */ (0,
|
|
3441
|
-
/* @__PURE__ */ (0,
|
|
3442
|
-
/* @__PURE__ */ (0,
|
|
3443
|
-
icon && /* @__PURE__ */ (0,
|
|
4002
|
+
var MetricCard = React51.forwardRef(function MetricCard2({ label, value, hint, delta, trend = "flat", icon, className, ...props }, ref) {
|
|
4003
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { ref, className: cn("rounded-xl border border-border bg-card p-5", className), ...props, children: [
|
|
4004
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
4005
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { className: "text-sm text-muted-foreground", children: label }),
|
|
4006
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "text-muted-foreground [&_svg]:size-4", children: icon })
|
|
3444
4007
|
] }),
|
|
3445
|
-
/* @__PURE__ */ (0,
|
|
3446
|
-
(delta || hint) && /* @__PURE__ */ (0,
|
|
3447
|
-
delta && /* @__PURE__ */ (0,
|
|
3448
|
-
/* @__PURE__ */ (0,
|
|
4008
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { className: "mt-2 text-2xl font-semibold tabular-nums", children: value }),
|
|
4009
|
+
(delta || hint) && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("p", { className: "mt-1 flex items-center gap-2 text-sm", children: [
|
|
4010
|
+
delta && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("span", { className: cn("font-medium tabular-nums", trendClasses[trend]), children: [
|
|
4011
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { "aria-hidden": "true", children: trendGlyph[trend] }),
|
|
3449
4012
|
" ",
|
|
3450
4013
|
delta
|
|
3451
4014
|
] }),
|
|
3452
|
-
hint && /* @__PURE__ */ (0,
|
|
4015
|
+
hint && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "text-muted-foreground", children: hint })
|
|
3453
4016
|
] })
|
|
3454
4017
|
] });
|
|
3455
4018
|
});
|
|
3456
4019
|
|
|
3457
4020
|
// src/components/password-input/PasswordInput.tsx
|
|
3458
|
-
var
|
|
3459
|
-
var
|
|
3460
|
-
var PasswordInput =
|
|
3461
|
-
const [visible, setVisible] =
|
|
3462
|
-
return /* @__PURE__ */ (0,
|
|
3463
|
-
/* @__PURE__ */ (0,
|
|
3464
|
-
/* @__PURE__ */ (0,
|
|
4021
|
+
var React52 = __toESM(require("react"));
|
|
4022
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4023
|
+
var PasswordInput = React52.forwardRef(function PasswordInput2({ className, showLabel = "Show password", hideLabel = "Hide password", ...props }, ref) {
|
|
4024
|
+
const [visible, setVisible] = React52.useState(false);
|
|
4025
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: cn("relative flex items-center", className), children: [
|
|
4026
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Input, { ref, type: visible ? "text" : "password", className: "pr-24", ...props }),
|
|
4027
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3465
4028
|
Button,
|
|
3466
4029
|
{
|
|
3467
4030
|
type: "button",
|
|
@@ -3478,37 +4041,37 @@ var PasswordInput = React46.forwardRef(function PasswordInput2({ className, show
|
|
|
3478
4041
|
});
|
|
3479
4042
|
|
|
3480
4043
|
// src/components/auth-layout/AuthLayout.tsx
|
|
3481
|
-
var
|
|
3482
|
-
var
|
|
3483
|
-
var
|
|
4044
|
+
var React53 = __toESM(require("react"));
|
|
4045
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4046
|
+
var sizeClasses8 = {
|
|
3484
4047
|
sm: "max-w-sm",
|
|
3485
4048
|
md: "max-w-md",
|
|
3486
4049
|
lg: "max-w-lg"
|
|
3487
4050
|
};
|
|
3488
|
-
var AuthLayout =
|
|
3489
|
-
return /* @__PURE__ */ (0,
|
|
4051
|
+
var AuthLayout = React53.forwardRef(function AuthLayout2({ title, description, brand, footer, children, size = "md", className, ...props }, ref) {
|
|
4052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
3490
4053
|
"div",
|
|
3491
4054
|
{
|
|
3492
4055
|
ref,
|
|
3493
4056
|
className: cn("flex min-h-screen flex-col items-center justify-center bg-muted/30 px-4 py-12", className),
|
|
3494
4057
|
...props,
|
|
3495
4058
|
children: [
|
|
3496
|
-
brand && /* @__PURE__ */ (0,
|
|
3497
|
-
/* @__PURE__ */ (0,
|
|
3498
|
-
/* @__PURE__ */ (0,
|
|
3499
|
-
description && /* @__PURE__ */ (0,
|
|
3500
|
-
/* @__PURE__ */ (0,
|
|
4059
|
+
brand && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "mb-6", children: brand }),
|
|
4060
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: cn("w-full rounded-xl border border-border bg-card p-6 shadow-sm sm:p-8", sizeClasses8[size]), children: [
|
|
4061
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("h1", { className: "text-xl font-semibold tracking-tight", children: title }),
|
|
4062
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "mt-1 text-sm text-muted-foreground", children: description }),
|
|
4063
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "mt-6", children })
|
|
3501
4064
|
] }),
|
|
3502
|
-
footer && /* @__PURE__ */ (0,
|
|
4065
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "mt-6 text-center text-sm text-muted-foreground", children: footer })
|
|
3503
4066
|
]
|
|
3504
4067
|
}
|
|
3505
4068
|
);
|
|
3506
4069
|
});
|
|
3507
4070
|
|
|
3508
4071
|
// src/components/filter-bar/FilterBar.tsx
|
|
3509
|
-
var
|
|
3510
|
-
var
|
|
3511
|
-
var FilterBar =
|
|
4072
|
+
var React54 = __toESM(require("react"));
|
|
4073
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4074
|
+
var FilterBar = React54.forwardRef(function FilterBar2({
|
|
3512
4075
|
searchValue,
|
|
3513
4076
|
onSearchChange,
|
|
3514
4077
|
searchPlaceholder = "Search\u2026",
|
|
@@ -3519,7 +4082,7 @@ var FilterBar = React48.forwardRef(function FilterBar2({
|
|
|
3519
4082
|
children,
|
|
3520
4083
|
...props
|
|
3521
4084
|
}, ref) {
|
|
3522
|
-
return /* @__PURE__ */ (0,
|
|
4085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
3523
4086
|
"div",
|
|
3524
4087
|
{
|
|
3525
4088
|
ref,
|
|
@@ -3530,7 +4093,7 @@ var FilterBar = React48.forwardRef(function FilterBar2({
|
|
|
3530
4093
|
),
|
|
3531
4094
|
...props,
|
|
3532
4095
|
children: [
|
|
3533
|
-
onSearchChange !== void 0 && /* @__PURE__ */ (0,
|
|
4096
|
+
onSearchChange !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3534
4097
|
Input,
|
|
3535
4098
|
{
|
|
3536
4099
|
type: "search",
|
|
@@ -3541,29 +4104,29 @@ var FilterBar = React48.forwardRef(function FilterBar2({
|
|
|
3541
4104
|
className: "h-9 w-full min-w-40 flex-1 sm:w-auto"
|
|
3542
4105
|
}
|
|
3543
4106
|
),
|
|
3544
|
-
/* @__PURE__ */ (0,
|
|
3545
|
-
onReset && /* @__PURE__ */ (0,
|
|
4107
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "flex flex-wrap items-center gap-2", children }),
|
|
4108
|
+
onReset && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Button, { type: "button", variant: "ghost", size: "sm", onClick: onReset, children: [
|
|
3546
4109
|
"Reset",
|
|
3547
4110
|
activeCount > 0 ? ` (${activeCount})` : ""
|
|
3548
4111
|
] }),
|
|
3549
|
-
trailing && /* @__PURE__ */ (0,
|
|
4112
|
+
trailing && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "ml-auto flex items-center gap-2", children: trailing })
|
|
3550
4113
|
]
|
|
3551
4114
|
}
|
|
3552
4115
|
);
|
|
3553
4116
|
});
|
|
3554
4117
|
|
|
3555
4118
|
// src/components/date-picker/DatePicker.tsx
|
|
3556
|
-
var
|
|
3557
|
-
var
|
|
3558
|
-
var DatePicker =
|
|
3559
|
-
const [internal, setInternal] =
|
|
4119
|
+
var React55 = __toESM(require("react"));
|
|
4120
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4121
|
+
var DatePicker = React55.forwardRef(function DatePicker2({ value, defaultValue, onValueChange, clearable = false, className, ...props }, ref) {
|
|
4122
|
+
const [internal, setInternal] = React55.useState(defaultValue ?? "");
|
|
3560
4123
|
const current = value ?? internal;
|
|
3561
4124
|
const commit = (next) => {
|
|
3562
4125
|
if (value === void 0) setInternal(next);
|
|
3563
4126
|
onValueChange?.(next);
|
|
3564
4127
|
};
|
|
3565
|
-
return /* @__PURE__ */ (0,
|
|
3566
|
-
/* @__PURE__ */ (0,
|
|
4128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: cn("relative flex items-center", className), children: [
|
|
4129
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3567
4130
|
Input,
|
|
3568
4131
|
{
|
|
3569
4132
|
ref,
|
|
@@ -3574,7 +4137,7 @@ var DatePicker = React49.forwardRef(function DatePicker2({ value, defaultValue,
|
|
|
3574
4137
|
...props
|
|
3575
4138
|
}
|
|
3576
4139
|
),
|
|
3577
|
-
clearable && current && /* @__PURE__ */ (0,
|
|
4140
|
+
clearable && current && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
3578
4141
|
"button",
|
|
3579
4142
|
{
|
|
3580
4143
|
type: "button",
|
|
@@ -3588,17 +4151,17 @@ var DatePicker = React49.forwardRef(function DatePicker2({ value, defaultValue,
|
|
|
3588
4151
|
});
|
|
3589
4152
|
|
|
3590
4153
|
// src/components/time-picker/TimePicker.tsx
|
|
3591
|
-
var
|
|
3592
|
-
var
|
|
3593
|
-
var TimePicker =
|
|
3594
|
-
const [internal, setInternal] =
|
|
4154
|
+
var React56 = __toESM(require("react"));
|
|
4155
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4156
|
+
var TimePicker = React56.forwardRef(function TimePicker2({ value, defaultValue, onValueChange, clearable = false, className, ...props }, ref) {
|
|
4157
|
+
const [internal, setInternal] = React56.useState(defaultValue ?? "");
|
|
3595
4158
|
const current = value ?? internal;
|
|
3596
4159
|
const commit = (next) => {
|
|
3597
4160
|
if (value === void 0) setInternal(next);
|
|
3598
4161
|
onValueChange?.(next);
|
|
3599
4162
|
};
|
|
3600
|
-
return /* @__PURE__ */ (0,
|
|
3601
|
-
/* @__PURE__ */ (0,
|
|
4163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: cn("relative flex items-center", className), children: [
|
|
4164
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
3602
4165
|
Input,
|
|
3603
4166
|
{
|
|
3604
4167
|
ref,
|
|
@@ -3609,7 +4172,7 @@ var TimePicker = React50.forwardRef(function TimePicker2({ value, defaultValue,
|
|
|
3609
4172
|
...props
|
|
3610
4173
|
}
|
|
3611
4174
|
),
|
|
3612
|
-
clearable && current && /* @__PURE__ */ (0,
|
|
4175
|
+
clearable && current && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
3613
4176
|
"button",
|
|
3614
4177
|
{
|
|
3615
4178
|
type: "button",
|
|
@@ -3623,10 +4186,10 @@ var TimePicker = React50.forwardRef(function TimePicker2({ value, defaultValue,
|
|
|
3623
4186
|
});
|
|
3624
4187
|
|
|
3625
4188
|
// src/components/stepper/Stepper.tsx
|
|
3626
|
-
var
|
|
3627
|
-
var
|
|
3628
|
-
var Stepper =
|
|
3629
|
-
return /* @__PURE__ */ (0,
|
|
4189
|
+
var React57 = __toESM(require("react"));
|
|
4190
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4191
|
+
var Stepper = React57.forwardRef(function Stepper2({ steps, current, orientation = "horizontal", onStepClick, className, ...props }, ref) {
|
|
4192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
3630
4193
|
"ol",
|
|
3631
4194
|
{
|
|
3632
4195
|
ref,
|
|
@@ -3639,8 +4202,8 @@ var Stepper = React51.forwardRef(function Stepper2({ steps, current, orientation
|
|
|
3639
4202
|
children: steps.map((step, index) => {
|
|
3640
4203
|
const state = index < current ? "complete" : index === current ? "current" : "upcoming";
|
|
3641
4204
|
const interactive = Boolean(onStepClick);
|
|
3642
|
-
const content = /* @__PURE__ */ (0,
|
|
3643
|
-
/* @__PURE__ */ (0,
|
|
4205
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
4206
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
3644
4207
|
"span",
|
|
3645
4208
|
{
|
|
3646
4209
|
"aria-hidden": "true",
|
|
@@ -3653,14 +4216,14 @@ var Stepper = React51.forwardRef(function Stepper2({ steps, current, orientation
|
|
|
3653
4216
|
children: state === "complete" ? "\u2713" : index + 1
|
|
3654
4217
|
}
|
|
3655
4218
|
),
|
|
3656
|
-
/* @__PURE__ */ (0,
|
|
3657
|
-
/* @__PURE__ */ (0,
|
|
3658
|
-
step.description && /* @__PURE__ */ (0,
|
|
3659
|
-
/* @__PURE__ */ (0,
|
|
4219
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { className: "min-w-0", children: [
|
|
4220
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: cn("block text-sm", state === "upcoming" ? "text-muted-foreground" : "font-medium"), children: step.label }),
|
|
4221
|
+
step.description && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "block text-xs text-muted-foreground", children: step.description }),
|
|
4222
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "sr-only", children: state === "complete" ? " (completed)" : state === "current" ? " (current step)" : " (upcoming)" })
|
|
3660
4223
|
] })
|
|
3661
4224
|
] });
|
|
3662
|
-
return /* @__PURE__ */ (0,
|
|
3663
|
-
interactive ? /* @__PURE__ */ (0,
|
|
4225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("li", { className: "flex min-w-0 items-start gap-2", children: [
|
|
4226
|
+
interactive ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
3664
4227
|
"button",
|
|
3665
4228
|
{
|
|
3666
4229
|
type: "button",
|
|
@@ -3669,8 +4232,8 @@ var Stepper = React51.forwardRef(function Stepper2({ steps, current, orientation
|
|
|
3669
4232
|
className: "flex items-start gap-2 rounded-md text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
3670
4233
|
children: content
|
|
3671
4234
|
}
|
|
3672
|
-
) : /* @__PURE__ */ (0,
|
|
3673
|
-
orientation === "horizontal" && index < steps.length - 1 && /* @__PURE__ */ (0,
|
|
4235
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { "aria-current": state === "current" ? "step" : void 0, className: "flex items-start gap-2", children: content }),
|
|
4236
|
+
orientation === "horizontal" && index < steps.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { "aria-hidden": "true", className: "mt-3.5 hidden h-px w-8 bg-border sm:block" })
|
|
3674
4237
|
] }, step.label);
|
|
3675
4238
|
})
|
|
3676
4239
|
}
|
|
@@ -3678,14 +4241,14 @@ var Stepper = React51.forwardRef(function Stepper2({ steps, current, orientation
|
|
|
3678
4241
|
});
|
|
3679
4242
|
|
|
3680
4243
|
// src/components/file-upload/FileUpload.tsx
|
|
3681
|
-
var
|
|
3682
|
-
var
|
|
4244
|
+
var React58 = __toESM(require("react"));
|
|
4245
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
3683
4246
|
function formatSize(bytes) {
|
|
3684
4247
|
if (bytes < 1024) return `${bytes} B`;
|
|
3685
4248
|
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
3686
4249
|
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
3687
4250
|
}
|
|
3688
|
-
var FileUpload =
|
|
4251
|
+
var FileUpload = React58.forwardRef(function FileUpload2({
|
|
3689
4252
|
files,
|
|
3690
4253
|
defaultFiles,
|
|
3691
4254
|
onFilesChange,
|
|
@@ -3699,10 +4262,10 @@ var FileUpload = React52.forwardRef(function FileUpload2({
|
|
|
3699
4262
|
id,
|
|
3700
4263
|
...props
|
|
3701
4264
|
}, ref) {
|
|
3702
|
-
const [internal, setInternal] =
|
|
3703
|
-
const [dragging, setDragging] =
|
|
4265
|
+
const [internal, setInternal] = React58.useState(defaultFiles ?? []);
|
|
4266
|
+
const [dragging, setDragging] = React58.useState(false);
|
|
3704
4267
|
const current = files ?? internal;
|
|
3705
|
-
const generatedId =
|
|
4268
|
+
const generatedId = React58.useId();
|
|
3706
4269
|
const inputId = id ?? generatedId;
|
|
3707
4270
|
const commit = (next) => {
|
|
3708
4271
|
if (files === void 0) setInternal(next);
|
|
@@ -3713,8 +4276,8 @@ var FileUpload = React52.forwardRef(function FileUpload2({
|
|
|
3713
4276
|
const list = Array.from(incoming);
|
|
3714
4277
|
commit(multiple ? [...current, ...list] : list.slice(0, 1));
|
|
3715
4278
|
};
|
|
3716
|
-
return /* @__PURE__ */ (0,
|
|
3717
|
-
/* @__PURE__ */ (0,
|
|
4279
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: cn("flex flex-col gap-3", className), children: [
|
|
4280
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
3718
4281
|
"div",
|
|
3719
4282
|
{
|
|
3720
4283
|
onDragOver: (event) => {
|
|
@@ -3735,9 +4298,9 @@ var FileUpload = React52.forwardRef(function FileUpload2({
|
|
|
3735
4298
|
disabled && "opacity-50"
|
|
3736
4299
|
),
|
|
3737
4300
|
children: [
|
|
3738
|
-
/* @__PURE__ */ (0,
|
|
4301
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("label", { htmlFor: inputId, className: cn("block text-sm", disabled ? "cursor-not-allowed" : "cursor-pointer"), children: [
|
|
3739
4302
|
label,
|
|
3740
|
-
/* @__PURE__ */ (0,
|
|
4303
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
3741
4304
|
"input",
|
|
3742
4305
|
{
|
|
3743
4306
|
ref,
|
|
@@ -3755,15 +4318,15 @@ var FileUpload = React52.forwardRef(function FileUpload2({
|
|
|
3755
4318
|
}
|
|
3756
4319
|
)
|
|
3757
4320
|
] }),
|
|
3758
|
-
/* @__PURE__ */ (0,
|
|
4321
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("p", { className: "mt-1 text-xs text-muted-foreground", children: hint ?? (accept ? `Accepted: ${accept}` : "Any file type") })
|
|
3759
4322
|
]
|
|
3760
4323
|
}
|
|
3761
4324
|
),
|
|
3762
|
-
current.length > 0 && /* @__PURE__ */ (0,
|
|
3763
|
-
/* @__PURE__ */ (0,
|
|
3764
|
-
/* @__PURE__ */ (0,
|
|
3765
|
-
/* @__PURE__ */ (0,
|
|
3766
|
-
progress?.[file.name] !== void 0 && /* @__PURE__ */ (0,
|
|
4325
|
+
current.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("ul", { "aria-label": "Selected files", className: "space-y-2", children: current.map((file) => /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("li", { className: "flex items-center justify-between gap-3 rounded-md border border-border px-3 py-2", children: [
|
|
4326
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "min-w-0", children: [
|
|
4327
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("p", { className: "truncate text-sm", children: file.name }),
|
|
4328
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("p", { className: "text-xs text-muted-foreground", children: formatSize(file.size) }),
|
|
4329
|
+
progress?.[file.name] !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
3767
4330
|
"div",
|
|
3768
4331
|
{
|
|
3769
4332
|
role: "progressbar",
|
|
@@ -3772,11 +4335,11 @@ var FileUpload = React52.forwardRef(function FileUpload2({
|
|
|
3772
4335
|
"aria-valuemax": 100,
|
|
3773
4336
|
"aria-label": `Uploading ${file.name}`,
|
|
3774
4337
|
className: "mt-1 h-1.5 w-40 overflow-hidden rounded-full bg-muted",
|
|
3775
|
-
children: /* @__PURE__ */ (0,
|
|
4338
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "h-full bg-primary", style: { width: `${progress[file.name]}%` } })
|
|
3776
4339
|
}
|
|
3777
4340
|
)
|
|
3778
4341
|
] }),
|
|
3779
|
-
/* @__PURE__ */ (0,
|
|
4342
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
3780
4343
|
"button",
|
|
3781
4344
|
{
|
|
3782
4345
|
type: "button",
|
|
@@ -3791,12 +4354,12 @@ var FileUpload = React52.forwardRef(function FileUpload2({
|
|
|
3791
4354
|
});
|
|
3792
4355
|
|
|
3793
4356
|
// src/components/timeline/Timeline.tsx
|
|
3794
|
-
var
|
|
3795
|
-
var
|
|
3796
|
-
var Timeline =
|
|
3797
|
-
return /* @__PURE__ */ (0,
|
|
3798
|
-
/* @__PURE__ */ (0,
|
|
3799
|
-
/* @__PURE__ */ (0,
|
|
4357
|
+
var React59 = __toESM(require("react"));
|
|
4358
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4359
|
+
var Timeline = React59.forwardRef(function Timeline2({ items, className, ...props }, ref) {
|
|
4360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("ol", { ref, className: cn("relative flex flex-col gap-6", className), ...props, children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("li", { className: "relative flex gap-4", children: [
|
|
4361
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex flex-col items-center", children: [
|
|
4362
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
3800
4363
|
"span",
|
|
3801
4364
|
{
|
|
3802
4365
|
"aria-hidden": "true",
|
|
@@ -3806,24 +4369,24 @@ var Timeline = React53.forwardRef(function Timeline2({ items, className, ...prop
|
|
|
3806
4369
|
)
|
|
3807
4370
|
}
|
|
3808
4371
|
),
|
|
3809
|
-
index < items.length - 1 && /* @__PURE__ */ (0,
|
|
4372
|
+
index < items.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { "aria-hidden": "true", className: "mt-1 w-px flex-1 bg-border" })
|
|
3810
4373
|
] }),
|
|
3811
|
-
/* @__PURE__ */ (0,
|
|
3812
|
-
item.period && /* @__PURE__ */ (0,
|
|
3813
|
-
/* @__PURE__ */ (0,
|
|
3814
|
-
item.description && /* @__PURE__ */ (0,
|
|
3815
|
-
item.icon && /* @__PURE__ */ (0,
|
|
4374
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: cn("min-w-0 pb-1", item.muted && "opacity-60"), children: [
|
|
4375
|
+
item.period && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("p", { className: "text-xs font-medium uppercase tracking-wide text-muted-foreground", children: item.period }),
|
|
4376
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("p", { className: "text-sm font-semibold", children: item.title }),
|
|
4377
|
+
item.description && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("p", { className: "mt-1 text-sm text-muted-foreground", children: item.description }),
|
|
4378
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "mt-1 text-muted-foreground [&_svg]:size-4", children: item.icon })
|
|
3816
4379
|
] })
|
|
3817
4380
|
] }, `${item.title}-${index}`)) });
|
|
3818
4381
|
});
|
|
3819
4382
|
|
|
3820
4383
|
// src/components/block/Block.tsx
|
|
3821
|
-
var
|
|
3822
|
-
var
|
|
3823
|
-
var Block =
|
|
4384
|
+
var React60 = __toESM(require("react"));
|
|
4385
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
4386
|
+
var Block = React60.forwardRef(
|
|
3824
4387
|
({ as = "div", inline, muted, className, ...props }, ref) => {
|
|
3825
4388
|
const Tag = inline ? "span" : as;
|
|
3826
|
-
return /* @__PURE__ */ (0,
|
|
4389
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
3827
4390
|
Tag,
|
|
3828
4391
|
{
|
|
3829
4392
|
ref,
|
|
@@ -3836,8 +4399,8 @@ var Block = React54.forwardRef(
|
|
|
3836
4399
|
Block.displayName = "Block";
|
|
3837
4400
|
|
|
3838
4401
|
// src/components/flex/Flex.tsx
|
|
3839
|
-
var
|
|
3840
|
-
var
|
|
4402
|
+
var React61 = __toESM(require("react"));
|
|
4403
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
3841
4404
|
var justifyClasses = {
|
|
3842
4405
|
start: "justify-start",
|
|
3843
4406
|
center: "justify-center",
|
|
@@ -3853,11 +4416,11 @@ var alignClasses = {
|
|
|
3853
4416
|
stretch: "items-stretch",
|
|
3854
4417
|
baseline: "items-baseline"
|
|
3855
4418
|
};
|
|
3856
|
-
var Flex =
|
|
4419
|
+
var Flex = React61.forwardRef(
|
|
3857
4420
|
({ direction = "row", align, justify, wrap, gap = "md", as = "div", className, style, ...props }, ref) => {
|
|
3858
4421
|
const Tag = as;
|
|
3859
4422
|
const gapResolved = resolveGap(gap);
|
|
3860
|
-
return /* @__PURE__ */ (0,
|
|
4423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3861
4424
|
Tag,
|
|
3862
4425
|
{
|
|
3863
4426
|
ref,
|
|
@@ -3884,7 +4447,7 @@ var selfAlignClasses = {
|
|
|
3884
4447
|
stretch: "self-stretch",
|
|
3885
4448
|
baseline: "self-baseline"
|
|
3886
4449
|
};
|
|
3887
|
-
var FlexItem =
|
|
4450
|
+
var FlexItem = React61.forwardRef(
|
|
3888
4451
|
({ grow, shrink, basis, align, as = "div", className, ...props }, ref) => {
|
|
3889
4452
|
const Tag = as;
|
|
3890
4453
|
const style = {
|
|
@@ -3892,7 +4455,7 @@ var FlexItem = React55.forwardRef(
|
|
|
3892
4455
|
...shrink === false ? { flexShrink: 0 } : typeof shrink === "string" && shrink ? { flexShrink: Number(shrink) || shrink } : {},
|
|
3893
4456
|
...basis ? { flexBasis: basis } : {}
|
|
3894
4457
|
};
|
|
3895
|
-
return /* @__PURE__ */ (0,
|
|
4458
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3896
4459
|
Tag,
|
|
3897
4460
|
{
|
|
3898
4461
|
ref,
|
|
@@ -3906,8 +4469,8 @@ var FlexItem = React55.forwardRef(
|
|
|
3906
4469
|
FlexItem.displayName = "FlexItem";
|
|
3907
4470
|
|
|
3908
4471
|
// src/components/grid/Grid.tsx
|
|
3909
|
-
var
|
|
3910
|
-
var
|
|
4472
|
+
var React62 = __toESM(require("react"));
|
|
4473
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
3911
4474
|
var BASE_COLS = {
|
|
3912
4475
|
1: "grid-cols-1",
|
|
3913
4476
|
2: "grid-cols-2",
|
|
@@ -3972,11 +4535,11 @@ var LG_COL_SPAN = {
|
|
|
3972
4535
|
5: "lg:col-span-5",
|
|
3973
4536
|
6: "lg:col-span-6"
|
|
3974
4537
|
};
|
|
3975
|
-
var Grid =
|
|
4538
|
+
var Grid = React62.forwardRef(
|
|
3976
4539
|
({ cols, smCols, mdCols, lgCols, minCol, gap = "md", as = "div", className, style, ...props }, ref) => {
|
|
3977
4540
|
const Tag = as;
|
|
3978
4541
|
const gapResolved = resolveGap(gap);
|
|
3979
|
-
return /* @__PURE__ */ (0,
|
|
4542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3980
4543
|
Tag,
|
|
3981
4544
|
{
|
|
3982
4545
|
ref,
|
|
@@ -4000,10 +4563,10 @@ var Grid = React56.forwardRef(
|
|
|
4000
4563
|
}
|
|
4001
4564
|
);
|
|
4002
4565
|
Grid.displayName = "Grid";
|
|
4003
|
-
var GridItem =
|
|
4566
|
+
var GridItem = React62.forwardRef(
|
|
4004
4567
|
({ span, smSpan, mdSpan, lgSpan, as = "div", className, ...props }, ref) => {
|
|
4005
4568
|
const Tag = as;
|
|
4006
|
-
return /* @__PURE__ */ (0,
|
|
4569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4007
4570
|
Tag,
|
|
4008
4571
|
{
|
|
4009
4572
|
ref,
|
|
@@ -4022,11 +4585,11 @@ var GridItem = React56.forwardRef(
|
|
|
4022
4585
|
GridItem.displayName = "GridItem";
|
|
4023
4586
|
|
|
4024
4587
|
// src/components/menu/Menu.tsx
|
|
4025
|
-
var
|
|
4588
|
+
var React63 = __toESM(require("react"));
|
|
4026
4589
|
var import_react_dom7 = require("react-dom");
|
|
4027
|
-
var
|
|
4028
|
-
var
|
|
4029
|
-
var MenuContext =
|
|
4590
|
+
var import_react_slot5 = require("@radix-ui/react-slot");
|
|
4591
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
4592
|
+
var MenuContext = React63.createContext({
|
|
4030
4593
|
open: false,
|
|
4031
4594
|
setOpen: () => {
|
|
4032
4595
|
},
|
|
@@ -4035,13 +4598,13 @@ var MenuContext = React57.createContext({
|
|
|
4035
4598
|
},
|
|
4036
4599
|
wrapperRef: { current: null }
|
|
4037
4600
|
});
|
|
4038
|
-
var Menu =
|
|
4601
|
+
var Menu = React63.forwardRef(
|
|
4039
4602
|
({ open, onOpenChange, className, children }, ref) => {
|
|
4040
|
-
const [internalOpen, setInternalOpen] =
|
|
4041
|
-
const [activeIndex, setActiveIndex] =
|
|
4603
|
+
const [internalOpen, setInternalOpen] = React63.useState(false);
|
|
4604
|
+
const [activeIndex, setActiveIndex] = React63.useState(-1);
|
|
4042
4605
|
const current = open ?? internalOpen;
|
|
4043
|
-
const wrapperRef =
|
|
4044
|
-
const setRefs =
|
|
4606
|
+
const wrapperRef = React63.useRef(null);
|
|
4607
|
+
const setRefs = React63.useCallback(
|
|
4045
4608
|
(node) => {
|
|
4046
4609
|
wrapperRef.current = node;
|
|
4047
4610
|
if (typeof ref === "function") ref(node);
|
|
@@ -4049,7 +4612,7 @@ var Menu = React57.forwardRef(
|
|
|
4049
4612
|
},
|
|
4050
4613
|
[ref]
|
|
4051
4614
|
);
|
|
4052
|
-
const setOpen =
|
|
4615
|
+
const setOpen = React63.useCallback(
|
|
4053
4616
|
(next) => {
|
|
4054
4617
|
if (open === void 0) setInternalOpen(next);
|
|
4055
4618
|
onOpenChange?.(next);
|
|
@@ -4057,7 +4620,7 @@ var Menu = React57.forwardRef(
|
|
|
4057
4620
|
},
|
|
4058
4621
|
[open, onOpenChange]
|
|
4059
4622
|
);
|
|
4060
|
-
return /* @__PURE__ */ (0,
|
|
4623
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { ref: setRefs, className: cn("relative inline-block", className), children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
4061
4624
|
MenuContext.Provider,
|
|
4062
4625
|
{
|
|
4063
4626
|
value: { open: current, setOpen, activeIndex, setActiveIndex, wrapperRef },
|
|
@@ -4067,10 +4630,10 @@ var Menu = React57.forwardRef(
|
|
|
4067
4630
|
}
|
|
4068
4631
|
);
|
|
4069
4632
|
Menu.displayName = "Menu";
|
|
4070
|
-
var MenuTrigger =
|
|
4633
|
+
var MenuTrigger = React63.forwardRef(
|
|
4071
4634
|
({ className, children, ...props }, ref) => {
|
|
4072
|
-
const { open, setOpen } =
|
|
4073
|
-
return /* @__PURE__ */ (0,
|
|
4635
|
+
const { open, setOpen } = React63.useContext(MenuContext);
|
|
4636
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
4074
4637
|
"button",
|
|
4075
4638
|
{
|
|
4076
4639
|
ref,
|
|
@@ -4090,13 +4653,13 @@ var MenuTrigger = React57.forwardRef(
|
|
|
4090
4653
|
}
|
|
4091
4654
|
);
|
|
4092
4655
|
MenuTrigger.displayName = "MenuTrigger";
|
|
4093
|
-
var MenuContent =
|
|
4656
|
+
var MenuContent = React63.forwardRef(
|
|
4094
4657
|
({ className, children, ...props }, ref) => {
|
|
4095
|
-
const { open, setOpen, activeIndex, setActiveIndex, wrapperRef } =
|
|
4096
|
-
const contentRef =
|
|
4097
|
-
const [pos, setPos] =
|
|
4098
|
-
const itemsRef =
|
|
4099
|
-
|
|
4658
|
+
const { open, setOpen, activeIndex, setActiveIndex, wrapperRef } = React63.useContext(MenuContext);
|
|
4659
|
+
const contentRef = React63.useRef(null);
|
|
4660
|
+
const [pos, setPos] = React63.useState(null);
|
|
4661
|
+
const itemsRef = React63.useRef([]);
|
|
4662
|
+
React63.useLayoutEffect(() => {
|
|
4100
4663
|
if (!open) {
|
|
4101
4664
|
setPos(null);
|
|
4102
4665
|
return;
|
|
@@ -4116,7 +4679,7 @@ var MenuContent = React57.forwardRef(
|
|
|
4116
4679
|
window.removeEventListener("resize", measure);
|
|
4117
4680
|
};
|
|
4118
4681
|
}, [open, setOpen, wrapperRef]);
|
|
4119
|
-
|
|
4682
|
+
React63.useEffect(() => {
|
|
4120
4683
|
if (!open) return;
|
|
4121
4684
|
function onPointerDown(event) {
|
|
4122
4685
|
if (!contentRef.current?.contains(event.target)) setOpen(false);
|
|
@@ -4124,7 +4687,7 @@ var MenuContent = React57.forwardRef(
|
|
|
4124
4687
|
document.addEventListener("pointerdown", onPointerDown);
|
|
4125
4688
|
return () => document.removeEventListener("pointerdown", onPointerDown);
|
|
4126
4689
|
}, [open, setOpen]);
|
|
4127
|
-
|
|
4690
|
+
React63.useEffect(() => {
|
|
4128
4691
|
if (open && pos && contentRef.current) {
|
|
4129
4692
|
itemsRef.current = Array.from(
|
|
4130
4693
|
contentRef.current.querySelectorAll('[role="menuitem"]:not([disabled])')
|
|
@@ -4160,7 +4723,7 @@ var MenuContent = React57.forwardRef(
|
|
|
4160
4723
|
};
|
|
4161
4724
|
if (!open || !pos || typeof document === "undefined") return null;
|
|
4162
4725
|
return (0, import_react_dom7.createPortal)(
|
|
4163
|
-
/* @__PURE__ */ (0,
|
|
4726
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
4164
4727
|
"div",
|
|
4165
4728
|
{
|
|
4166
4729
|
ref: (node) => {
|
|
@@ -4184,12 +4747,12 @@ var MenuContent = React57.forwardRef(
|
|
|
4184
4747
|
}
|
|
4185
4748
|
);
|
|
4186
4749
|
MenuContent.displayName = "MenuContent";
|
|
4187
|
-
var MenuItem =
|
|
4750
|
+
var MenuItem = React63.forwardRef(
|
|
4188
4751
|
({ className, destructive, asChild = false, onClick, ...props }, ref) => {
|
|
4189
|
-
const { setOpen } =
|
|
4190
|
-
const Comp = asChild ?
|
|
4752
|
+
const { setOpen } = React63.useContext(MenuContext);
|
|
4753
|
+
const Comp = asChild ? import_react_slot5.Slot : "button";
|
|
4191
4754
|
const typeProp = asChild ? {} : { type: "button" };
|
|
4192
|
-
return /* @__PURE__ */ (0,
|
|
4755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
4193
4756
|
Comp,
|
|
4194
4757
|
{
|
|
4195
4758
|
ref,
|
|
@@ -4211,12 +4774,12 @@ var MenuItem = React57.forwardRef(
|
|
|
4211
4774
|
}
|
|
4212
4775
|
);
|
|
4213
4776
|
MenuItem.displayName = "MenuItem";
|
|
4214
|
-
var MenuSeparator =
|
|
4215
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4777
|
+
var MenuSeparator = React63.forwardRef(
|
|
4778
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { ref, role: "separator", className: cn("-mx-1 my-1 h-px bg-border", className), ...props })
|
|
4216
4779
|
);
|
|
4217
4780
|
MenuSeparator.displayName = "MenuSeparator";
|
|
4218
|
-
var MenuLabel =
|
|
4219
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4781
|
+
var MenuLabel = React63.forwardRef(
|
|
4782
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
4220
4783
|
"div",
|
|
4221
4784
|
{
|
|
4222
4785
|
ref,
|
|
@@ -4228,10 +4791,10 @@ var MenuLabel = React57.forwardRef(
|
|
|
4228
4791
|
MenuLabel.displayName = "MenuLabel";
|
|
4229
4792
|
|
|
4230
4793
|
// src/components/alert/Alert.tsx
|
|
4231
|
-
var
|
|
4232
|
-
var
|
|
4233
|
-
var
|
|
4234
|
-
var alertVariants = (0,
|
|
4794
|
+
var React64 = __toESM(require("react"));
|
|
4795
|
+
var import_class_variance_authority7 = require("class-variance-authority");
|
|
4796
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
4797
|
+
var alertVariants = (0, import_class_variance_authority7.cva)(
|
|
4235
4798
|
"relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",
|
|
4236
4799
|
{
|
|
4237
4800
|
variants: {
|
|
@@ -4239,8 +4802,8 @@ var alertVariants = (0, import_class_variance_authority6.cva)(
|
|
|
4239
4802
|
default: "bg-background text-foreground border-border",
|
|
4240
4803
|
destructive: "border-destructive/50 text-destructive bg-destructive/10 [&>svg]:text-destructive",
|
|
4241
4804
|
success: "border-success/50 text-success bg-success/10 [&>svg]:text-success",
|
|
4242
|
-
warning: "border-warning/50 text-warning bg-warning/10 [&>svg]:text-warning",
|
|
4243
|
-
info: "border-info/50 text-info bg-info/10 [&>svg]:text-info"
|
|
4805
|
+
warning: "border-warning/50 text-warning-ink bg-warning/10 [&>svg]:text-warning-ink",
|
|
4806
|
+
info: "border-info/50 text-info-ink bg-info/10 [&>svg]:text-info-ink"
|
|
4244
4807
|
}
|
|
4245
4808
|
},
|
|
4246
4809
|
defaultVariants: {
|
|
@@ -4248,8 +4811,8 @@ var alertVariants = (0, import_class_variance_authority6.cva)(
|
|
|
4248
4811
|
}
|
|
4249
4812
|
}
|
|
4250
4813
|
);
|
|
4251
|
-
var Alert =
|
|
4252
|
-
({ className, variant, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4814
|
+
var Alert = React64.forwardRef(
|
|
4815
|
+
({ className, variant, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
4253
4816
|
"div",
|
|
4254
4817
|
{
|
|
4255
4818
|
ref,
|
|
@@ -4260,8 +4823,8 @@ var Alert = React58.forwardRef(
|
|
|
4260
4823
|
)
|
|
4261
4824
|
);
|
|
4262
4825
|
Alert.displayName = "Alert";
|
|
4263
|
-
var AlertTitle =
|
|
4264
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4826
|
+
var AlertTitle = React64.forwardRef(
|
|
4827
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
4265
4828
|
"h5",
|
|
4266
4829
|
{
|
|
4267
4830
|
ref,
|
|
@@ -4271,8 +4834,8 @@ var AlertTitle = React58.forwardRef(
|
|
|
4271
4834
|
)
|
|
4272
4835
|
);
|
|
4273
4836
|
AlertTitle.displayName = "AlertTitle";
|
|
4274
|
-
var AlertDescription =
|
|
4275
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
4837
|
+
var AlertDescription = React64.forwardRef(
|
|
4838
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
4276
4839
|
"div",
|
|
4277
4840
|
{
|
|
4278
4841
|
ref,
|
|
@@ -4284,10 +4847,10 @@ var AlertDescription = React58.forwardRef(
|
|
|
4284
4847
|
AlertDescription.displayName = "AlertDescription";
|
|
4285
4848
|
|
|
4286
4849
|
// src/components/popover/Popover.tsx
|
|
4287
|
-
var
|
|
4850
|
+
var React65 = __toESM(require("react"));
|
|
4288
4851
|
var import_react_dom8 = require("react-dom");
|
|
4289
|
-
var
|
|
4290
|
-
var PopoverContext =
|
|
4852
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
4853
|
+
var PopoverContext = React65.createContext({
|
|
4291
4854
|
open: false,
|
|
4292
4855
|
setOpen: () => {
|
|
4293
4856
|
},
|
|
@@ -4295,14 +4858,14 @@ var PopoverContext = React59.createContext({
|
|
|
4295
4858
|
contentId: "",
|
|
4296
4859
|
wrapperRef: { current: null }
|
|
4297
4860
|
});
|
|
4298
|
-
var Popover =
|
|
4861
|
+
var Popover = React65.forwardRef(
|
|
4299
4862
|
({ open, onOpenChange, className, children }, ref) => {
|
|
4300
|
-
const [internalOpen, setInternalOpen] =
|
|
4863
|
+
const [internalOpen, setInternalOpen] = React65.useState(false);
|
|
4301
4864
|
const current = open ?? internalOpen;
|
|
4302
|
-
const triggerId =
|
|
4303
|
-
const contentId =
|
|
4304
|
-
const wrapperRef =
|
|
4305
|
-
const setRefs =
|
|
4865
|
+
const triggerId = React65.useId();
|
|
4866
|
+
const contentId = React65.useId();
|
|
4867
|
+
const wrapperRef = React65.useRef(null);
|
|
4868
|
+
const setRefs = React65.useCallback(
|
|
4306
4869
|
(node) => {
|
|
4307
4870
|
wrapperRef.current = node;
|
|
4308
4871
|
if (typeof ref === "function") ref(node);
|
|
@@ -4310,14 +4873,14 @@ var Popover = React59.forwardRef(
|
|
|
4310
4873
|
},
|
|
4311
4874
|
[ref]
|
|
4312
4875
|
);
|
|
4313
|
-
const setOpen =
|
|
4876
|
+
const setOpen = React65.useCallback(
|
|
4314
4877
|
(next) => {
|
|
4315
4878
|
if (open === void 0) setInternalOpen(next);
|
|
4316
4879
|
onOpenChange?.(next);
|
|
4317
4880
|
},
|
|
4318
4881
|
[open, onOpenChange]
|
|
4319
4882
|
);
|
|
4320
|
-
return /* @__PURE__ */ (0,
|
|
4883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { ref: setRefs, className: cn("relative inline-block", className), children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4321
4884
|
PopoverContext.Provider,
|
|
4322
4885
|
{
|
|
4323
4886
|
value: { open: current, setOpen, triggerId, contentId, wrapperRef },
|
|
@@ -4327,10 +4890,10 @@ var Popover = React59.forwardRef(
|
|
|
4327
4890
|
}
|
|
4328
4891
|
);
|
|
4329
4892
|
Popover.displayName = "Popover";
|
|
4330
|
-
var PopoverTrigger =
|
|
4893
|
+
var PopoverTrigger = React65.forwardRef(
|
|
4331
4894
|
({ className, children, onClick, ...props }, ref) => {
|
|
4332
|
-
const { open, setOpen, triggerId, contentId } =
|
|
4333
|
-
return /* @__PURE__ */ (0,
|
|
4895
|
+
const { open, setOpen, triggerId, contentId } = React65.useContext(PopoverContext);
|
|
4896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4334
4897
|
"button",
|
|
4335
4898
|
{
|
|
4336
4899
|
ref,
|
|
@@ -4355,12 +4918,12 @@ var PopoverTrigger = React59.forwardRef(
|
|
|
4355
4918
|
}
|
|
4356
4919
|
);
|
|
4357
4920
|
PopoverTrigger.displayName = "PopoverTrigger";
|
|
4358
|
-
var PopoverContent =
|
|
4921
|
+
var PopoverContent = React65.forwardRef(
|
|
4359
4922
|
({ className, children, onKeyDown, ...props }, ref) => {
|
|
4360
|
-
const { open, setOpen, triggerId, contentId, wrapperRef } =
|
|
4361
|
-
const contentRef =
|
|
4362
|
-
const [pos, setPos] =
|
|
4363
|
-
|
|
4923
|
+
const { open, setOpen, triggerId, contentId, wrapperRef } = React65.useContext(PopoverContext);
|
|
4924
|
+
const contentRef = React65.useRef(null);
|
|
4925
|
+
const [pos, setPos] = React65.useState(null);
|
|
4926
|
+
React65.useLayoutEffect(() => {
|
|
4364
4927
|
if (!open) {
|
|
4365
4928
|
setPos(null);
|
|
4366
4929
|
return;
|
|
@@ -4380,7 +4943,7 @@ var PopoverContent = React59.forwardRef(
|
|
|
4380
4943
|
window.removeEventListener("resize", measure);
|
|
4381
4944
|
};
|
|
4382
4945
|
}, [open, setOpen, wrapperRef]);
|
|
4383
|
-
|
|
4946
|
+
React65.useEffect(() => {
|
|
4384
4947
|
if (!open) return;
|
|
4385
4948
|
function onPointerDown(event) {
|
|
4386
4949
|
if (!contentRef.current?.contains(event.target)) setOpen(false);
|
|
@@ -4388,14 +4951,14 @@ var PopoverContent = React59.forwardRef(
|
|
|
4388
4951
|
document.addEventListener("pointerdown", onPointerDown);
|
|
4389
4952
|
return () => document.removeEventListener("pointerdown", onPointerDown);
|
|
4390
4953
|
}, [open, setOpen]);
|
|
4391
|
-
|
|
4954
|
+
React65.useEffect(() => {
|
|
4392
4955
|
if (open && pos && contentRef.current) {
|
|
4393
4956
|
contentRef.current.focus();
|
|
4394
4957
|
}
|
|
4395
4958
|
}, [open, pos]);
|
|
4396
4959
|
if (!open || !pos || typeof document === "undefined") return null;
|
|
4397
4960
|
return (0, import_react_dom8.createPortal)(
|
|
4398
|
-
/* @__PURE__ */ (0,
|
|
4961
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4399
4962
|
"div",
|
|
4400
4963
|
{
|
|
4401
4964
|
ref: (node) => {
|
|
@@ -4430,43 +4993,46 @@ var PopoverContent = React59.forwardRef(
|
|
|
4430
4993
|
PopoverContent.displayName = "PopoverContent";
|
|
4431
4994
|
|
|
4432
4995
|
// src/components/breadcrumb/Breadcrumb.tsx
|
|
4433
|
-
var
|
|
4434
|
-
var
|
|
4435
|
-
var Breadcrumb =
|
|
4436
|
-
({ items, separator = "/", onItemClick, className, ...props }, ref) =>
|
|
4437
|
-
"
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
"
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
onItemClick(
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
"
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4996
|
+
var React66 = __toESM(require("react"));
|
|
4997
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
4998
|
+
var Breadcrumb = React66.forwardRef(
|
|
4999
|
+
({ items, separator = "/", onItemClick, linkComponent, className, ...props }, ref) => {
|
|
5000
|
+
const LinkEl = linkComponent ?? "a";
|
|
5001
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5002
|
+
"nav",
|
|
5003
|
+
{
|
|
5004
|
+
ref,
|
|
5005
|
+
"aria-label": "Breadcrumb",
|
|
5006
|
+
className: cn("flex items-center space-x-1.5 text-sm text-muted-foreground", className),
|
|
5007
|
+
...props,
|
|
5008
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("ol", { className: "flex flex-wrap items-center space-x-1.5", children: items.map((item, index) => {
|
|
5009
|
+
const isLast = index === items.length - 1;
|
|
5010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("li", { className: "flex items-center space-x-1.5", children: [
|
|
5011
|
+
index > 0 && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { "aria-hidden": "true", className: "text-muted-foreground/50", children: separator }),
|
|
5012
|
+
item.href && !isLast ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5013
|
+
LinkEl,
|
|
5014
|
+
{
|
|
5015
|
+
href: item.href,
|
|
5016
|
+
className: "transition-colors hover:text-foreground",
|
|
5017
|
+
onClick: onItemClick ? (event) => {
|
|
5018
|
+
event.preventDefault();
|
|
5019
|
+
onItemClick(item, index);
|
|
5020
|
+
} : void 0,
|
|
5021
|
+
children: item.label
|
|
5022
|
+
}
|
|
5023
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
5024
|
+
"span",
|
|
5025
|
+
{
|
|
5026
|
+
"aria-current": isLast ? "page" : void 0,
|
|
5027
|
+
className: isLast ? "font-medium text-foreground" : void 0,
|
|
5028
|
+
children: item.label
|
|
5029
|
+
}
|
|
5030
|
+
)
|
|
5031
|
+
] }, `${item.label}-${index}`);
|
|
5032
|
+
}) })
|
|
5033
|
+
}
|
|
5034
|
+
);
|
|
5035
|
+
}
|
|
4470
5036
|
);
|
|
4471
5037
|
Breadcrumb.displayName = "Breadcrumb";
|
|
4472
5038
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -4498,6 +5064,7 @@ Breadcrumb.displayName = "Breadcrumb";
|
|
|
4498
5064
|
Checkbox,
|
|
4499
5065
|
CheckboxGroup,
|
|
4500
5066
|
CheckboxGroupItem,
|
|
5067
|
+
ConfirmDialog,
|
|
4501
5068
|
DataTable,
|
|
4502
5069
|
DatePicker,
|
|
4503
5070
|
Dialog,
|
|
@@ -4524,6 +5091,7 @@ Breadcrumb.displayName = "Breadcrumb";
|
|
|
4524
5091
|
InputGroup,
|
|
4525
5092
|
InputGroupAddon,
|
|
4526
5093
|
Label,
|
|
5094
|
+
Link,
|
|
4527
5095
|
List,
|
|
4528
5096
|
ListItem,
|
|
4529
5097
|
Menu,
|
|
@@ -4540,16 +5108,20 @@ Breadcrumb.displayName = "Breadcrumb";
|
|
|
4540
5108
|
PopoverContent,
|
|
4541
5109
|
PopoverTrigger,
|
|
4542
5110
|
Progress,
|
|
5111
|
+
Prose,
|
|
4543
5112
|
Radio,
|
|
4544
5113
|
RadioCard,
|
|
4545
5114
|
RadioGroup,
|
|
4546
5115
|
RadioGroupContext,
|
|
4547
5116
|
RadioGroupItem,
|
|
4548
5117
|
Search,
|
|
5118
|
+
SectionHeading,
|
|
4549
5119
|
Select,
|
|
4550
5120
|
SelectMenu,
|
|
4551
5121
|
Separator,
|
|
4552
5122
|
Sidebar,
|
|
5123
|
+
SiteFooter,
|
|
5124
|
+
SiteHeader,
|
|
4553
5125
|
Skeleton,
|
|
4554
5126
|
Spinner,
|
|
4555
5127
|
Stepper,
|
|
@@ -4562,6 +5134,7 @@ Breadcrumb.displayName = "Breadcrumb";
|
|
|
4562
5134
|
TableFooter,
|
|
4563
5135
|
TableHead,
|
|
4564
5136
|
TableHeader,
|
|
5137
|
+
TableOfContents,
|
|
4565
5138
|
TableRow,
|
|
4566
5139
|
Tabs,
|
|
4567
5140
|
TabsContent,
|
|
@@ -4585,6 +5158,7 @@ Breadcrumb.displayName = "Breadcrumb";
|
|
|
4585
5158
|
toast,
|
|
4586
5159
|
useCombobox,
|
|
4587
5160
|
usePresence,
|
|
5161
|
+
useScrollSpy,
|
|
4588
5162
|
useToast
|
|
4589
5163
|
});
|
|
4590
5164
|
//# sourceMappingURL=index.js.map
|