@juv/codego-react-ui 1.0.5 → 1.0.6
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.cjs +453 -310
- package/dist/index.d.cts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.global.js +520 -364
- package/dist/index.js +389 -246
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -469,7 +469,9 @@ var Button = React3.forwardRef(
|
|
|
469
469
|
debounceTime,
|
|
470
470
|
throttleTime,
|
|
471
471
|
confirmBeforeClick,
|
|
472
|
-
|
|
472
|
+
confirmBeforeClickModalTitle,
|
|
473
|
+
confirmBeforeClickModalContent,
|
|
474
|
+
confirmBeforeClickFooterAction,
|
|
473
475
|
href,
|
|
474
476
|
target,
|
|
475
477
|
as = "button",
|
|
@@ -540,12 +542,27 @@ var Button = React3.forwardRef(
|
|
|
540
542
|
background: gradientFrom && gradientTo ? `linear-gradient(${gradientDirection === "to-r" ? "to right" : gradientDirection === "to-l" ? "to left" : gradientDirection === "to-t" ? "to top" : gradientDirection === "to-b" ? "to bottom" : gradientDirection === "to-tr" ? "to top right" : gradientDirection === "to-tl" ? "to top left" : gradientDirection === "to-br" ? "to bottom right" : "to bottom left"}, ${gradientFrom}, ${gradientTo})` : void 0,
|
|
541
543
|
...style
|
|
542
544
|
};
|
|
545
|
+
const [confirmOpen, setConfirmOpen] = React3.useState(false);
|
|
546
|
+
const pendingEvent = React3.useRef(null);
|
|
543
547
|
const handleClick = (e) => {
|
|
544
548
|
if (preventDefault) e.preventDefault();
|
|
545
549
|
if (stopPropagation) e.stopPropagation();
|
|
546
|
-
if (confirmBeforeClick
|
|
550
|
+
if (confirmBeforeClick) {
|
|
551
|
+
pendingEvent.current = e;
|
|
552
|
+
setConfirmOpen(true);
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
547
555
|
onClick?.(e);
|
|
548
556
|
};
|
|
557
|
+
function handleConfirmProceed() {
|
|
558
|
+
setConfirmOpen(false);
|
|
559
|
+
onClick?.(pendingEvent.current ?? void 0);
|
|
560
|
+
pendingEvent.current = null;
|
|
561
|
+
}
|
|
562
|
+
function handleConfirmCancel() {
|
|
563
|
+
setConfirmOpen(false);
|
|
564
|
+
pendingEvent.current = null;
|
|
565
|
+
}
|
|
549
566
|
const buttonContent = /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
550
567
|
loading && loadingPosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "animate-spin mr-2", children: "\u27F3" }),
|
|
551
568
|
leftIcon && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "mr-2", children: leftIcon }),
|
|
@@ -570,22 +587,72 @@ var Button = React3.forwardRef(
|
|
|
570
587
|
tabIndex,
|
|
571
588
|
"data-testid": testID
|
|
572
589
|
};
|
|
590
|
+
const confirmModal = confirmBeforeClick && confirmOpen ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
591
|
+
"div",
|
|
592
|
+
{
|
|
593
|
+
className: "fixed inset-0 z-50 flex items-center justify-center",
|
|
594
|
+
onClick: handleConfirmCancel,
|
|
595
|
+
children: [
|
|
596
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "absolute inset-0 bg-black/50 backdrop-blur-sm" }),
|
|
597
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
598
|
+
"div",
|
|
599
|
+
{
|
|
600
|
+
className: "relative z-10 w-full max-w-sm rounded-2xl border border-border bg-card p-6 shadow-2xl",
|
|
601
|
+
onClick: (e) => e.stopPropagation(),
|
|
602
|
+
children: [
|
|
603
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-base font-semibold text-foreground mb-2", children: confirmBeforeClickModalTitle ?? "Are you sure?" }),
|
|
604
|
+
confirmBeforeClickModalContent && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "text-sm text-muted-foreground mb-5", children: confirmBeforeClickModalContent }),
|
|
605
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex justify-end gap-2 mt-4", children: confirmBeforeClickFooterAction ?? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
606
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
607
|
+
"button",
|
|
608
|
+
{
|
|
609
|
+
type: "button",
|
|
610
|
+
onClick: handleConfirmCancel,
|
|
611
|
+
className: "inline-flex items-center justify-center rounded-md border border-border bg-background px-4 py-2 text-sm font-medium text-foreground hover:bg-accent transition-colors",
|
|
612
|
+
children: "Cancel"
|
|
613
|
+
}
|
|
614
|
+
),
|
|
615
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
616
|
+
"button",
|
|
617
|
+
{
|
|
618
|
+
type: "button",
|
|
619
|
+
onClick: handleConfirmProceed,
|
|
620
|
+
className: "inline-flex items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary-hover transition-colors",
|
|
621
|
+
children: "Proceed"
|
|
622
|
+
}
|
|
623
|
+
)
|
|
624
|
+
] }) })
|
|
625
|
+
]
|
|
626
|
+
}
|
|
627
|
+
)
|
|
628
|
+
]
|
|
629
|
+
}
|
|
630
|
+
) : null;
|
|
573
631
|
if (Element === "a") {
|
|
574
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.
|
|
632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
633
|
+
confirmModal,
|
|
634
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("a", { ...sharedProps, href, target, children: buttonContent })
|
|
635
|
+
] });
|
|
575
636
|
}
|
|
576
637
|
if (Element === "div") {
|
|
577
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.
|
|
638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
639
|
+
confirmModal,
|
|
640
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { ...sharedProps, children: buttonContent })
|
|
641
|
+
] });
|
|
578
642
|
}
|
|
579
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
644
|
+
confirmModal,
|
|
645
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
646
|
+
"button",
|
|
647
|
+
{
|
|
648
|
+
...sharedProps,
|
|
649
|
+
type,
|
|
650
|
+
disabled,
|
|
651
|
+
...props,
|
|
652
|
+
children: buttonContent
|
|
653
|
+
}
|
|
654
|
+
)
|
|
655
|
+
] });
|
|
589
656
|
}
|
|
590
657
|
);
|
|
591
658
|
Button.displayName = "Button";
|
|
@@ -1580,12 +1647,12 @@ function DonutChart({ data, color, height, showValues, unit }) {
|
|
|
1580
1647
|
const total = data.reduce((s, d) => s + d.value, 0) || 1;
|
|
1581
1648
|
const cx = 80, cy = height / 2, r = Math.min(cx, cy) - 10, inner = r * 0.58;
|
|
1582
1649
|
let angle = -Math.PI / 2;
|
|
1583
|
-
const
|
|
1650
|
+
const defaultColors2 = ["primary", "info", "success", "warning", "danger"];
|
|
1584
1651
|
const slices = data.map((d, i) => {
|
|
1585
1652
|
const sweep = d.value / total * 2 * Math.PI;
|
|
1586
1653
|
const start = angle;
|
|
1587
1654
|
angle += sweep;
|
|
1588
|
-
const c = d.color ??
|
|
1655
|
+
const c = d.color ?? defaultColors2[i % defaultColors2.length];
|
|
1589
1656
|
return { ...d, start, sweep, color: c };
|
|
1590
1657
|
});
|
|
1591
1658
|
const arc = (cx2, cy2, r2, start, end) => {
|
|
@@ -5331,7 +5398,7 @@ function Repeater({
|
|
|
5331
5398
|
}
|
|
5332
5399
|
|
|
5333
5400
|
// src/components/ui/panel.tsx
|
|
5334
|
-
var
|
|
5401
|
+
var React32 = __toESM(require("react"), 1);
|
|
5335
5402
|
var import_lucide_react21 = require("lucide-react");
|
|
5336
5403
|
|
|
5337
5404
|
// src/components/ui/tooltip.tsx
|
|
@@ -5412,9 +5479,59 @@ function Tooltip({
|
|
|
5412
5479
|
);
|
|
5413
5480
|
}
|
|
5414
5481
|
|
|
5415
|
-
// src/components/
|
|
5482
|
+
// src/components/theme-provider.tsx
|
|
5483
|
+
var import_react = require("react");
|
|
5416
5484
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
5417
|
-
var
|
|
5485
|
+
var defaultColors = {
|
|
5486
|
+
primary: "#8b5cf6",
|
|
5487
|
+
primaryHover: "#7c3aed",
|
|
5488
|
+
secondary: "#171717",
|
|
5489
|
+
secondaryHover: "#262626",
|
|
5490
|
+
info: "#3b82f6",
|
|
5491
|
+
infoHover: "#2563eb",
|
|
5492
|
+
warning: "#f59e0b",
|
|
5493
|
+
warningHover: "#d97706",
|
|
5494
|
+
danger: "#ef4444",
|
|
5495
|
+
dangerHover: "#dc2626"
|
|
5496
|
+
};
|
|
5497
|
+
var initialState = {
|
|
5498
|
+
theme: "system",
|
|
5499
|
+
colors: defaultColors,
|
|
5500
|
+
fontSize: "16px",
|
|
5501
|
+
fontFamily: '"Space Grotesk", "Inter", sans-serif',
|
|
5502
|
+
setTheme: () => null,
|
|
5503
|
+
setColors: () => null,
|
|
5504
|
+
setFontSize: () => null,
|
|
5505
|
+
setFontFamily: () => null,
|
|
5506
|
+
resetSettings: () => null
|
|
5507
|
+
};
|
|
5508
|
+
var ThemeProviderContext = (0, import_react.createContext)(initialState);
|
|
5509
|
+
var useTheme = () => {
|
|
5510
|
+
const context = (0, import_react.useContext)(ThemeProviderContext);
|
|
5511
|
+
if (context === void 0)
|
|
5512
|
+
throw new Error("useTheme must be used within a ThemeProvider");
|
|
5513
|
+
return context;
|
|
5514
|
+
};
|
|
5515
|
+
|
|
5516
|
+
// src/components/ui/panel.tsx
|
|
5517
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
5518
|
+
var PanelCollapsedContext = React32.createContext(false);
|
|
5519
|
+
function PanelThemeToggle() {
|
|
5520
|
+
const { theme, setTheme } = useTheme();
|
|
5521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
5522
|
+
"button",
|
|
5523
|
+
{
|
|
5524
|
+
type: "button",
|
|
5525
|
+
onClick: () => setTheme(theme === "light" ? "dark" : "light"),
|
|
5526
|
+
className: "text-muted-foreground hover:text-foreground transition-colors",
|
|
5527
|
+
"aria-label": "Toggle theme",
|
|
5528
|
+
children: [
|
|
5529
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react21.Sun, { className: "h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" }),
|
|
5530
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react21.Moon, { className: "absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" })
|
|
5531
|
+
]
|
|
5532
|
+
}
|
|
5533
|
+
);
|
|
5534
|
+
}
|
|
5418
5535
|
function Panel({
|
|
5419
5536
|
sidebar,
|
|
5420
5537
|
sidebarHeader,
|
|
@@ -5424,60 +5541,86 @@ function Panel({
|
|
|
5424
5541
|
topbarTrailing,
|
|
5425
5542
|
defaultCollapsed = false,
|
|
5426
5543
|
collapsible = false,
|
|
5544
|
+
showThemeToggle = false,
|
|
5545
|
+
defaultPage,
|
|
5427
5546
|
height = "h-[520px]",
|
|
5428
5547
|
children,
|
|
5429
5548
|
className
|
|
5430
5549
|
}) {
|
|
5431
|
-
const [collapsed, setCollapsed] =
|
|
5432
|
-
return /* @__PURE__ */ (0,
|
|
5550
|
+
const [collapsed, setCollapsed] = React32.useState(defaultCollapsed);
|
|
5551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PanelCollapsedContext.Provider, { value: collapsed, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
5433
5552
|
"div",
|
|
5434
5553
|
{
|
|
5435
5554
|
className: cn(
|
|
5436
|
-
"flex overflow-hidden rounded-xl border border-border
|
|
5555
|
+
"relative flex overflow-hidden rounded-xl border border-border bg-background shadow-lg",
|
|
5437
5556
|
height,
|
|
5438
5557
|
className
|
|
5439
5558
|
),
|
|
5440
5559
|
children: [
|
|
5441
|
-
|
|
5560
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "pointer-events-none absolute inset-0 overflow-hidden", children: [
|
|
5561
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "absolute -top-[40%] -left-[20%] h-[80%] w-[60%] rounded-full bg-primary/10 blur-[120px]" }),
|
|
5562
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "absolute -bottom-[40%] -right-[20%] h-[80%] w-[60%] rounded-full bg-info/10 blur-[120px]" })
|
|
5563
|
+
] }),
|
|
5564
|
+
sidebar && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
5442
5565
|
"aside",
|
|
5443
5566
|
{
|
|
5444
5567
|
className: cn(
|
|
5445
|
-
"flex flex-col shrink-0 border-r border-border transition-all duration-200",
|
|
5568
|
+
"relative z-10 flex flex-col shrink-0 border-r border-border transition-all duration-200",
|
|
5446
5569
|
collapsed ? "w-14" : sidebarWidth
|
|
5447
5570
|
),
|
|
5448
5571
|
children: [
|
|
5449
|
-
sidebarHeader &&
|
|
5450
|
-
|
|
5451
|
-
|
|
5452
|
-
|
|
5572
|
+
sidebarHeader && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
5573
|
+
"div",
|
|
5574
|
+
{
|
|
5575
|
+
className: cn(
|
|
5576
|
+
"shrink-0 border-b border-border",
|
|
5577
|
+
collapsed ? "flex items-center justify-center py-3" : "px-4 py-3 text-sm font-semibold"
|
|
5578
|
+
),
|
|
5579
|
+
children: sidebarHeader
|
|
5580
|
+
}
|
|
5581
|
+
),
|
|
5582
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "flex-1 overflow-y-auto py-2", children: sidebar }),
|
|
5583
|
+
sidebarFooter && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
5584
|
+
"div",
|
|
5585
|
+
{
|
|
5586
|
+
className: cn(
|
|
5587
|
+
"shrink-0 border-t border-border",
|
|
5588
|
+
collapsed ? "flex items-center justify-center py-3" : "px-4 py-3"
|
|
5589
|
+
),
|
|
5590
|
+
children: !collapsed && sidebarFooter
|
|
5591
|
+
}
|
|
5592
|
+
)
|
|
5453
5593
|
]
|
|
5454
5594
|
}
|
|
5455
5595
|
),
|
|
5456
|
-
/* @__PURE__ */ (0,
|
|
5457
|
-
/* @__PURE__ */ (0,
|
|
5458
|
-
/* @__PURE__ */ (0,
|
|
5459
|
-
collapsible && sidebar && /* @__PURE__ */ (0,
|
|
5596
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "relative z-10 flex flex-1 min-w-0 flex-col", children: [
|
|
5597
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("header", { className: "flex h-14 shrink-0 items-center justify-between border-b glass px-4 gap-2", children: [
|
|
5598
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
5599
|
+
collapsible && sidebar && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
5460
5600
|
Tooltip,
|
|
5461
5601
|
{
|
|
5462
5602
|
content: collapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
5463
5603
|
side: "bottom",
|
|
5464
|
-
children: /* @__PURE__ */ (0,
|
|
5604
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
5465
5605
|
"button",
|
|
5466
5606
|
{
|
|
5467
5607
|
type: "button",
|
|
5468
5608
|
onClick: () => setCollapsed((c) => !c),
|
|
5469
5609
|
className: "text-muted-foreground hover:text-foreground transition-colors",
|
|
5470
5610
|
"aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
5471
|
-
children: collapsed ? /* @__PURE__ */ (0,
|
|
5611
|
+
children: collapsed ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react21.PanelLeftOpen, { className: "h-5 w-5" }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react21.PanelLeftClose, { className: "h-5 w-5" })
|
|
5472
5612
|
}
|
|
5473
5613
|
)
|
|
5474
5614
|
}
|
|
5475
5615
|
),
|
|
5476
|
-
topbar && /* @__PURE__ */ (0,
|
|
5616
|
+
topbar && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "flex items-center gap-2", children: topbar })
|
|
5477
5617
|
] }),
|
|
5478
|
-
|
|
5618
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
5619
|
+
topbarTrailing,
|
|
5620
|
+
showThemeToggle && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PanelThemeToggle, {})
|
|
5621
|
+
] })
|
|
5479
5622
|
] }),
|
|
5480
|
-
/* @__PURE__ */ (0,
|
|
5623
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("main", { className: "flex-1 overflow-y-auto p-4", children })
|
|
5481
5624
|
] })
|
|
5482
5625
|
]
|
|
5483
5626
|
}
|
|
@@ -5489,8 +5632,8 @@ function PanelSidebarItem({
|
|
|
5489
5632
|
active,
|
|
5490
5633
|
onClick
|
|
5491
5634
|
}) {
|
|
5492
|
-
const collapsed =
|
|
5493
|
-
return /* @__PURE__ */ (0,
|
|
5635
|
+
const collapsed = React32.useContext(PanelCollapsedContext);
|
|
5636
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Tooltip, { content: label, side: "right", enabled: collapsed, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
5494
5637
|
"button",
|
|
5495
5638
|
{
|
|
5496
5639
|
type: "button",
|
|
@@ -5501,8 +5644,8 @@ function PanelSidebarItem({
|
|
|
5501
5644
|
active ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-primary/20 hover:text-primary cursor-pointer"
|
|
5502
5645
|
),
|
|
5503
5646
|
children: [
|
|
5504
|
-
Icon && /* @__PURE__ */ (0,
|
|
5505
|
-
!collapsed && /* @__PURE__ */ (0,
|
|
5647
|
+
Icon && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Icon, { className: "h-4 w-4 shrink-0" }),
|
|
5648
|
+
!collapsed && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "truncate", children: label })
|
|
5506
5649
|
]
|
|
5507
5650
|
}
|
|
5508
5651
|
) });
|
|
@@ -5511,17 +5654,17 @@ function PanelSidebarGroup({
|
|
|
5511
5654
|
title,
|
|
5512
5655
|
children
|
|
5513
5656
|
}) {
|
|
5514
|
-
const collapsed =
|
|
5515
|
-
return /* @__PURE__ */ (0,
|
|
5516
|
-
title && !collapsed && /* @__PURE__ */ (0,
|
|
5517
|
-
title && collapsed && /* @__PURE__ */ (0,
|
|
5518
|
-
/* @__PURE__ */ (0,
|
|
5657
|
+
const collapsed = React32.useContext(PanelCollapsedContext);
|
|
5658
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "px-2 py-1", children: [
|
|
5659
|
+
title && !collapsed && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "mb-1 px-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground", children: title }),
|
|
5660
|
+
title && collapsed && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "mx-1 mb-1 h-px bg-border" }),
|
|
5661
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("main", { className: "space-y-0.5", children })
|
|
5519
5662
|
] });
|
|
5520
5663
|
}
|
|
5521
5664
|
|
|
5522
5665
|
// src/components/ui/resizable-panels.tsx
|
|
5523
|
-
var
|
|
5524
|
-
var
|
|
5666
|
+
var React33 = __toESM(require("react"), 1);
|
|
5667
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
5525
5668
|
function ResizablePanels({
|
|
5526
5669
|
children,
|
|
5527
5670
|
orientation = "horizontal",
|
|
@@ -5531,15 +5674,15 @@ function ResizablePanels({
|
|
|
5531
5674
|
handleClassName,
|
|
5532
5675
|
className
|
|
5533
5676
|
}) {
|
|
5534
|
-
const [size, setSize] =
|
|
5535
|
-
const [dragging, setDragging] =
|
|
5536
|
-
const containerRef =
|
|
5677
|
+
const [size, setSize] = React33.useState(defaultSize);
|
|
5678
|
+
const [dragging, setDragging] = React33.useState(false);
|
|
5679
|
+
const containerRef = React33.useRef(null);
|
|
5537
5680
|
const isHorizontal = orientation === "horizontal";
|
|
5538
5681
|
function onMouseDown(e) {
|
|
5539
5682
|
e.preventDefault();
|
|
5540
5683
|
setDragging(true);
|
|
5541
5684
|
}
|
|
5542
|
-
|
|
5685
|
+
React33.useEffect(() => {
|
|
5543
5686
|
if (!dragging) return;
|
|
5544
5687
|
function onMove(e) {
|
|
5545
5688
|
const container = containerRef.current;
|
|
@@ -5558,7 +5701,7 @@ function ResizablePanels({
|
|
|
5558
5701
|
document.removeEventListener("mouseup", onUp);
|
|
5559
5702
|
};
|
|
5560
5703
|
}, [dragging, isHorizontal, minSize, maxSize]);
|
|
5561
|
-
return /* @__PURE__ */ (0,
|
|
5704
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
5562
5705
|
"div",
|
|
5563
5706
|
{
|
|
5564
5707
|
ref: containerRef,
|
|
@@ -5569,7 +5712,7 @@ function ResizablePanels({
|
|
|
5569
5712
|
className
|
|
5570
5713
|
),
|
|
5571
5714
|
children: [
|
|
5572
|
-
/* @__PURE__ */ (0,
|
|
5715
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
5573
5716
|
"div",
|
|
5574
5717
|
{
|
|
5575
5718
|
className: "overflow-auto",
|
|
@@ -5577,7 +5720,7 @@ function ResizablePanels({
|
|
|
5577
5720
|
children: children[0]
|
|
5578
5721
|
}
|
|
5579
5722
|
),
|
|
5580
|
-
/* @__PURE__ */ (0,
|
|
5723
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
5581
5724
|
"div",
|
|
5582
5725
|
{
|
|
5583
5726
|
onMouseDown,
|
|
@@ -5587,13 +5730,13 @@ function ResizablePanels({
|
|
|
5587
5730
|
dragging && (isHorizontal ? "w-1.5 bg-primary/60" : "h-1.5 bg-primary/60"),
|
|
5588
5731
|
handleClassName
|
|
5589
5732
|
),
|
|
5590
|
-
children: /* @__PURE__ */ (0,
|
|
5733
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: cn(
|
|
5591
5734
|
"rounded-full bg-muted-foreground/40",
|
|
5592
5735
|
isHorizontal ? "h-8 w-0.5" : "w-8 h-0.5"
|
|
5593
5736
|
) })
|
|
5594
5737
|
}
|
|
5595
5738
|
),
|
|
5596
|
-
/* @__PURE__ */ (0,
|
|
5739
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
5597
5740
|
"div",
|
|
5598
5741
|
{
|
|
5599
5742
|
className: "flex-1 overflow-auto",
|
|
@@ -5607,26 +5750,26 @@ function ResizablePanels({
|
|
|
5607
5750
|
}
|
|
5608
5751
|
|
|
5609
5752
|
// src/components/ui/rich-text-editor.tsx
|
|
5610
|
-
var
|
|
5753
|
+
var React34 = __toESM(require("react"), 1);
|
|
5611
5754
|
var import_lucide_react22 = require("lucide-react");
|
|
5612
|
-
var
|
|
5755
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
5613
5756
|
var TOOLBAR = [
|
|
5614
|
-
{ icon: /* @__PURE__ */ (0,
|
|
5615
|
-
{ icon: /* @__PURE__ */ (0,
|
|
5757
|
+
{ icon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react22.Undo, { className: "h-3.5 w-3.5" }), command: "undo", title: "Undo" },
|
|
5758
|
+
{ icon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react22.Redo, { className: "h-3.5 w-3.5" }), command: "redo", title: "Redo" },
|
|
5616
5759
|
"divider",
|
|
5617
|
-
{ icon: /* @__PURE__ */ (0,
|
|
5618
|
-
{ icon: /* @__PURE__ */ (0,
|
|
5760
|
+
{ icon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react22.Heading2, { className: "h-3.5 w-3.5" }), command: "formatBlock", value: "h2", title: "Heading 2" },
|
|
5761
|
+
{ icon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react22.Heading3, { className: "h-3.5 w-3.5" }), command: "formatBlock", value: "h3", title: "Heading 3" },
|
|
5619
5762
|
"divider",
|
|
5620
|
-
{ icon: /* @__PURE__ */ (0,
|
|
5621
|
-
{ icon: /* @__PURE__ */ (0,
|
|
5622
|
-
{ icon: /* @__PURE__ */ (0,
|
|
5623
|
-
{ icon: /* @__PURE__ */ (0,
|
|
5763
|
+
{ icon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react22.Bold, { className: "h-3.5 w-3.5" }), command: "bold", title: "Bold" },
|
|
5764
|
+
{ icon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react22.Italic, { className: "h-3.5 w-3.5" }), command: "italic", title: "Italic" },
|
|
5765
|
+
{ icon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react22.Underline, { className: "h-3.5 w-3.5" }), command: "underline", title: "Underline" },
|
|
5766
|
+
{ icon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react22.Code, { className: "h-3.5 w-3.5" }), command: "formatBlock", value: "pre", title: "Code block" },
|
|
5624
5767
|
"divider",
|
|
5625
|
-
{ icon: /* @__PURE__ */ (0,
|
|
5626
|
-
{ icon: /* @__PURE__ */ (0,
|
|
5627
|
-
{ icon: /* @__PURE__ */ (0,
|
|
5768
|
+
{ icon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react22.List, { className: "h-3.5 w-3.5" }), command: "insertUnorderedList", title: "Bullet list" },
|
|
5769
|
+
{ icon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react22.ListOrdered, { className: "h-3.5 w-3.5" }), command: "insertOrderedList", title: "Numbered list" },
|
|
5770
|
+
{ icon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react22.Quote, { className: "h-3.5 w-3.5" }), command: "formatBlock", value: "blockquote", title: "Quote" },
|
|
5628
5771
|
"divider",
|
|
5629
|
-
{ icon: /* @__PURE__ */ (0,
|
|
5772
|
+
{ icon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react22.Link, { className: "h-3.5 w-3.5" }), command: "createLink", title: "Insert link" }
|
|
5630
5773
|
];
|
|
5631
5774
|
function RichTextEditor({
|
|
5632
5775
|
value: controlled,
|
|
@@ -5637,17 +5780,17 @@ function RichTextEditor({
|
|
|
5637
5780
|
disabled = false,
|
|
5638
5781
|
className
|
|
5639
5782
|
}) {
|
|
5640
|
-
const editorRef =
|
|
5641
|
-
const [focused, setFocused] =
|
|
5642
|
-
const [isEmpty, setIsEmpty] =
|
|
5643
|
-
|
|
5783
|
+
const editorRef = React34.useRef(null);
|
|
5784
|
+
const [focused, setFocused] = React34.useState(false);
|
|
5785
|
+
const [isEmpty, setIsEmpty] = React34.useState(!defaultValue);
|
|
5786
|
+
React34.useEffect(() => {
|
|
5644
5787
|
if (editorRef.current && controlled !== void 0) {
|
|
5645
5788
|
if (editorRef.current.innerHTML !== controlled) {
|
|
5646
5789
|
editorRef.current.innerHTML = controlled;
|
|
5647
5790
|
}
|
|
5648
5791
|
}
|
|
5649
5792
|
}, [controlled]);
|
|
5650
|
-
|
|
5793
|
+
React34.useEffect(() => {
|
|
5651
5794
|
if (editorRef.current && defaultValue) {
|
|
5652
5795
|
editorRef.current.innerHTML = defaultValue;
|
|
5653
5796
|
setIsEmpty(false);
|
|
@@ -5675,14 +5818,14 @@ function RichTextEditor({
|
|
|
5675
5818
|
return false;
|
|
5676
5819
|
}
|
|
5677
5820
|
}
|
|
5678
|
-
return /* @__PURE__ */ (0,
|
|
5821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: cn(
|
|
5679
5822
|
"rounded-xl border border-border overflow-hidden transition-colors",
|
|
5680
5823
|
focused && "ring-2 ring-ring border-primary",
|
|
5681
5824
|
disabled && "opacity-50 pointer-events-none",
|
|
5682
5825
|
className
|
|
5683
5826
|
), children: [
|
|
5684
|
-
/* @__PURE__ */ (0,
|
|
5685
|
-
(item, i) => item === "divider" ? /* @__PURE__ */ (0,
|
|
5827
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex flex-wrap items-center gap-0.5 border-b border-border bg-muted/30 px-2 py-1.5", children: TOOLBAR.map(
|
|
5828
|
+
(item, i) => item === "divider" ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "mx-1 h-4 w-px bg-border" }, i) : /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
5686
5829
|
"button",
|
|
5687
5830
|
{
|
|
5688
5831
|
type: "button",
|
|
@@ -5700,9 +5843,9 @@ function RichTextEditor({
|
|
|
5700
5843
|
i
|
|
5701
5844
|
)
|
|
5702
5845
|
) }),
|
|
5703
|
-
/* @__PURE__ */ (0,
|
|
5704
|
-
isEmpty && !focused && /* @__PURE__ */ (0,
|
|
5705
|
-
/* @__PURE__ */ (0,
|
|
5846
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "relative", children: [
|
|
5847
|
+
isEmpty && !focused && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "absolute top-3 left-4 text-sm text-muted-foreground pointer-events-none select-none", children: placeholder }),
|
|
5848
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
5706
5849
|
"div",
|
|
5707
5850
|
{
|
|
5708
5851
|
ref: editorRef,
|
|
@@ -5729,7 +5872,7 @@ function RichTextEditor({
|
|
|
5729
5872
|
}
|
|
5730
5873
|
|
|
5731
5874
|
// src/components/ui/scroll-area.tsx
|
|
5732
|
-
var
|
|
5875
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
5733
5876
|
function ScrollArea({
|
|
5734
5877
|
maxHeight,
|
|
5735
5878
|
maxWidth,
|
|
@@ -5744,7 +5887,7 @@ function ScrollArea({
|
|
|
5744
5887
|
horizontal: "overflow-x-auto overflow-y-hidden",
|
|
5745
5888
|
both: "overflow-auto"
|
|
5746
5889
|
}[orientation];
|
|
5747
|
-
return /* @__PURE__ */ (0,
|
|
5890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5748
5891
|
"div",
|
|
5749
5892
|
{
|
|
5750
5893
|
className: cn(
|
|
@@ -5764,9 +5907,9 @@ function ScrollArea({
|
|
|
5764
5907
|
}
|
|
5765
5908
|
|
|
5766
5909
|
// src/components/ui/section.tsx
|
|
5767
|
-
var
|
|
5910
|
+
var React35 = __toESM(require("react"), 1);
|
|
5768
5911
|
var import_lucide_react23 = require("lucide-react");
|
|
5769
|
-
var
|
|
5912
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
5770
5913
|
var variantWrap = {
|
|
5771
5914
|
default: "",
|
|
5772
5915
|
card: "rounded-xl glass shadow-lg overflow-hidden",
|
|
@@ -5798,9 +5941,9 @@ function SectionBlock({
|
|
|
5798
5941
|
className,
|
|
5799
5942
|
contentClassName
|
|
5800
5943
|
}) {
|
|
5801
|
-
const [open, setOpen] =
|
|
5802
|
-
return /* @__PURE__ */ (0,
|
|
5803
|
-
(title || description || action) && /* @__PURE__ */ (0,
|
|
5944
|
+
const [open, setOpen] = React35.useState(defaultOpen);
|
|
5945
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: cn(variantWrap[variant], className), children: [
|
|
5946
|
+
(title || description || action) && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
5804
5947
|
"div",
|
|
5805
5948
|
{
|
|
5806
5949
|
className: cn(
|
|
@@ -5811,16 +5954,16 @@ function SectionBlock({
|
|
|
5811
5954
|
),
|
|
5812
5955
|
onClick: collapsible ? () => setOpen((o) => !o) : void 0,
|
|
5813
5956
|
children: [
|
|
5814
|
-
/* @__PURE__ */ (0,
|
|
5815
|
-
icon && /* @__PURE__ */ (0,
|
|
5816
|
-
/* @__PURE__ */ (0,
|
|
5817
|
-
title && /* @__PURE__ */ (0,
|
|
5818
|
-
description && /* @__PURE__ */ (0,
|
|
5957
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex items-start gap-3 min-w-0", children: [
|
|
5958
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "mt-0.5 shrink-0 text-primary", children: icon }),
|
|
5959
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "min-w-0", children: [
|
|
5960
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("h3", { className: "text-base font-semibold leading-tight", children: title }),
|
|
5961
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "mt-0.5 text-sm text-muted-foreground", children: description })
|
|
5819
5962
|
] })
|
|
5820
5963
|
] }),
|
|
5821
|
-
/* @__PURE__ */ (0,
|
|
5822
|
-
action && /* @__PURE__ */ (0,
|
|
5823
|
-
collapsible && /* @__PURE__ */ (0,
|
|
5964
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
5965
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { onClick: (e) => e.stopPropagation(), children: action }),
|
|
5966
|
+
collapsible && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5824
5967
|
import_lucide_react23.ChevronDown,
|
|
5825
5968
|
{
|
|
5826
5969
|
className: cn(
|
|
@@ -5833,17 +5976,17 @@ function SectionBlock({
|
|
|
5833
5976
|
]
|
|
5834
5977
|
}
|
|
5835
5978
|
),
|
|
5836
|
-
(!collapsible || open) && /* @__PURE__ */ (0,
|
|
5979
|
+
(!collapsible || open) && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: cn(variantBody[variant], contentClassName), children })
|
|
5837
5980
|
] });
|
|
5838
5981
|
}
|
|
5839
5982
|
|
|
5840
5983
|
// src/components/ui/skeleton.tsx
|
|
5841
|
-
var
|
|
5984
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
5842
5985
|
function Skeleton({
|
|
5843
5986
|
className,
|
|
5844
5987
|
...props
|
|
5845
5988
|
}) {
|
|
5846
|
-
return /* @__PURE__ */ (0,
|
|
5989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
5847
5990
|
"div",
|
|
5848
5991
|
{
|
|
5849
5992
|
className: cn("animate-pulse rounded-md bg-white/5 backdrop-blur-sm", className),
|
|
@@ -5853,8 +5996,8 @@ function Skeleton({
|
|
|
5853
5996
|
}
|
|
5854
5997
|
|
|
5855
5998
|
// src/components/ui/slider.tsx
|
|
5856
|
-
var
|
|
5857
|
-
var
|
|
5999
|
+
var React36 = __toESM(require("react"), 1);
|
|
6000
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
5858
6001
|
function pct(val, min, max) {
|
|
5859
6002
|
return (val - min) / (max - min) * 100;
|
|
5860
6003
|
}
|
|
@@ -5873,8 +6016,8 @@ function Slider({
|
|
|
5873
6016
|
showValue = false,
|
|
5874
6017
|
className
|
|
5875
6018
|
}) {
|
|
5876
|
-
const [internal, setInternal] =
|
|
5877
|
-
const [hovering, setHovering] =
|
|
6019
|
+
const [internal, setInternal] = React36.useState(defaultValue);
|
|
6020
|
+
const [hovering, setHovering] = React36.useState(false);
|
|
5878
6021
|
const val = controlled ?? internal;
|
|
5879
6022
|
function handleChange(e) {
|
|
5880
6023
|
const v = Number(e.target.value);
|
|
@@ -5882,20 +6025,20 @@ function Slider({
|
|
|
5882
6025
|
onChange?.(v);
|
|
5883
6026
|
}
|
|
5884
6027
|
const p = pct(val, min, max);
|
|
5885
|
-
return /* @__PURE__ */ (0,
|
|
5886
|
-
(label || showValue) && /* @__PURE__ */ (0,
|
|
5887
|
-
label && /* @__PURE__ */ (0,
|
|
5888
|
-
showValue && /* @__PURE__ */ (0,
|
|
6028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: cn("w-full space-y-2", className), children: [
|
|
6029
|
+
(label || showValue) && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center justify-between text-sm", children: [
|
|
6030
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "font-medium", children: label }),
|
|
6031
|
+
showValue && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "text-muted-foreground tabular-nums", children: val })
|
|
5889
6032
|
] }),
|
|
5890
|
-
/* @__PURE__ */ (0,
|
|
6033
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
5891
6034
|
"div",
|
|
5892
6035
|
{
|
|
5893
6036
|
className: "relative flex items-center h-5",
|
|
5894
6037
|
onMouseEnter: () => setHovering(true),
|
|
5895
6038
|
onMouseLeave: () => setHovering(false),
|
|
5896
6039
|
children: [
|
|
5897
|
-
/* @__PURE__ */ (0,
|
|
5898
|
-
showTooltip && hovering && !disabled && /* @__PURE__ */ (0,
|
|
6040
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "absolute w-full h-1.5 rounded-full bg-muted overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "h-full rounded-full bg-primary", style: { width: `${p}%` } }) }),
|
|
6041
|
+
showTooltip && hovering && !disabled && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
5899
6042
|
"div",
|
|
5900
6043
|
{
|
|
5901
6044
|
className: "absolute -top-8 -translate-x-1/2 bg-foreground text-background text-xs font-medium px-2 py-0.5 rounded-md pointer-events-none",
|
|
@@ -5903,7 +6046,7 @@ function Slider({
|
|
|
5903
6046
|
children: val
|
|
5904
6047
|
}
|
|
5905
6048
|
),
|
|
5906
|
-
/* @__PURE__ */ (0,
|
|
6049
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
5907
6050
|
"input",
|
|
5908
6051
|
{
|
|
5909
6052
|
type: "range",
|
|
@@ -5919,7 +6062,7 @@ function Slider({
|
|
|
5919
6062
|
)
|
|
5920
6063
|
}
|
|
5921
6064
|
),
|
|
5922
|
-
/* @__PURE__ */ (0,
|
|
6065
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
5923
6066
|
"div",
|
|
5924
6067
|
{
|
|
5925
6068
|
className: cn(
|
|
@@ -5932,9 +6075,9 @@ function Slider({
|
|
|
5932
6075
|
]
|
|
5933
6076
|
}
|
|
5934
6077
|
),
|
|
5935
|
-
(showMarks || marks) && /* @__PURE__ */ (0,
|
|
5936
|
-
/* @__PURE__ */ (0,
|
|
5937
|
-
m.label && /* @__PURE__ */ (0,
|
|
6078
|
+
(showMarks || marks) && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "relative w-full flex justify-between px-0", children: (marks ?? [{ value: min }, { value: max }]).map((m) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex flex-col items-center gap-0.5", style: { position: "absolute", left: `${pct(m.value, min, max)}%`, transform: "translateX(-50%)" }, children: [
|
|
6079
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "h-1 w-0.5 bg-border" }),
|
|
6080
|
+
m.label && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "text-[10px] text-muted-foreground", children: m.label })
|
|
5938
6081
|
] }, m.value)) })
|
|
5939
6082
|
] });
|
|
5940
6083
|
}
|
|
@@ -5951,8 +6094,8 @@ function RangeSlider({
|
|
|
5951
6094
|
showValue = false,
|
|
5952
6095
|
className
|
|
5953
6096
|
}) {
|
|
5954
|
-
const [internal, setInternal] =
|
|
5955
|
-
const [active, setActive] =
|
|
6097
|
+
const [internal, setInternal] = React36.useState(defaultValue);
|
|
6098
|
+
const [active, setActive] = React36.useState(null);
|
|
5956
6099
|
const val = controlled ?? internal;
|
|
5957
6100
|
function handleChange(idx, e) {
|
|
5958
6101
|
const v = Number(e.target.value);
|
|
@@ -5962,21 +6105,21 @@ function RangeSlider({
|
|
|
5962
6105
|
}
|
|
5963
6106
|
const p0 = pct(val[0], min, max);
|
|
5964
6107
|
const p1 = pct(val[1], min, max);
|
|
5965
|
-
return /* @__PURE__ */ (0,
|
|
5966
|
-
(label || showValue) && /* @__PURE__ */ (0,
|
|
5967
|
-
label && /* @__PURE__ */ (0,
|
|
5968
|
-
showValue && /* @__PURE__ */ (0,
|
|
6108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: cn("w-full space-y-2", className), children: [
|
|
6109
|
+
(label || showValue) && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center justify-between text-sm", children: [
|
|
6110
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "font-medium", children: label }),
|
|
6111
|
+
showValue && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", { className: "text-muted-foreground tabular-nums", children: [
|
|
5969
6112
|
val[0],
|
|
5970
6113
|
" \u2013 ",
|
|
5971
6114
|
val[1]
|
|
5972
6115
|
] })
|
|
5973
6116
|
] }),
|
|
5974
|
-
/* @__PURE__ */ (0,
|
|
5975
|
-
/* @__PURE__ */ (0,
|
|
6117
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "relative flex items-center h-5", children: [
|
|
6118
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "absolute w-full h-1.5 rounded-full bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "absolute h-full rounded-full bg-primary", style: { left: `${p0}%`, width: `${p1 - p0}%` } }) }),
|
|
5976
6119
|
[0, 1].map((idx) => {
|
|
5977
6120
|
const p = idx === 0 ? p0 : p1;
|
|
5978
|
-
return /* @__PURE__ */ (0,
|
|
5979
|
-
showTooltip && active === idx && !disabled && /* @__PURE__ */ (0,
|
|
6121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(React36.Fragment, { children: [
|
|
6122
|
+
showTooltip && active === idx && !disabled && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
5980
6123
|
"div",
|
|
5981
6124
|
{
|
|
5982
6125
|
className: "absolute -top-8 -translate-x-1/2 bg-foreground text-background text-xs font-medium px-2 py-0.5 rounded-md pointer-events-none z-10",
|
|
@@ -5984,7 +6127,7 @@ function RangeSlider({
|
|
|
5984
6127
|
children: val[idx]
|
|
5985
6128
|
}
|
|
5986
6129
|
),
|
|
5987
|
-
/* @__PURE__ */ (0,
|
|
6130
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
5988
6131
|
"input",
|
|
5989
6132
|
{
|
|
5990
6133
|
type: "range",
|
|
@@ -6000,7 +6143,7 @@ function RangeSlider({
|
|
|
6000
6143
|
style: { zIndex: idx === 1 ? 2 : 1 }
|
|
6001
6144
|
}
|
|
6002
6145
|
),
|
|
6003
|
-
/* @__PURE__ */ (0,
|
|
6146
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
6004
6147
|
"div",
|
|
6005
6148
|
{
|
|
6006
6149
|
className: "absolute h-4 w-4 rounded-full border-2 border-primary bg-background shadow-md pointer-events-none",
|
|
@@ -6015,7 +6158,7 @@ function RangeSlider({
|
|
|
6015
6158
|
|
|
6016
6159
|
// src/components/ui/stat-card.tsx
|
|
6017
6160
|
var import_lucide_react24 = require("lucide-react");
|
|
6018
|
-
var
|
|
6161
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
6019
6162
|
function Sparkline2({ data, trend }) {
|
|
6020
6163
|
if (data.length < 2) return null;
|
|
6021
6164
|
const min = Math.min(...data);
|
|
@@ -6029,7 +6172,7 @@ function Sparkline2({ data, trend }) {
|
|
|
6029
6172
|
return `${x},${y}`;
|
|
6030
6173
|
}).join(" ");
|
|
6031
6174
|
const color = trend === "up" ? "stroke-success" : trend === "down" ? "stroke-danger" : "stroke-primary";
|
|
6032
|
-
return /* @__PURE__ */ (0,
|
|
6175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("svg", { width: w, height: h, className: "overflow-visible", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6033
6176
|
"polyline",
|
|
6034
6177
|
{
|
|
6035
6178
|
points: pts,
|
|
@@ -6057,38 +6200,38 @@ function StatCard({
|
|
|
6057
6200
|
const TrendIcon = autoTrend === "up" ? import_lucide_react24.TrendingUp : autoTrend === "down" ? import_lucide_react24.TrendingDown : import_lucide_react24.Minus;
|
|
6058
6201
|
const trendColor = autoTrend === "up" ? "text-success" : autoTrend === "down" ? "text-danger" : "text-muted-foreground";
|
|
6059
6202
|
if (loading) {
|
|
6060
|
-
return /* @__PURE__ */ (0,
|
|
6061
|
-
/* @__PURE__ */ (0,
|
|
6062
|
-
/* @__PURE__ */ (0,
|
|
6063
|
-
/* @__PURE__ */ (0,
|
|
6203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: cn("rounded-xl glass p-5 space-y-3 animate-pulse", className), children: [
|
|
6204
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "h-3 w-24 rounded bg-muted" }),
|
|
6205
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "h-7 w-32 rounded bg-muted" }),
|
|
6206
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "h-3 w-16 rounded bg-muted" })
|
|
6064
6207
|
] });
|
|
6065
6208
|
}
|
|
6066
|
-
return /* @__PURE__ */ (0,
|
|
6067
|
-
/* @__PURE__ */ (0,
|
|
6068
|
-
/* @__PURE__ */ (0,
|
|
6069
|
-
icon && /* @__PURE__ */ (0,
|
|
6209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: cn("rounded-xl glass p-5 space-y-3", className), children: [
|
|
6210
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-start justify-between gap-2", children: [
|
|
6211
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "text-sm text-muted-foreground font-medium", children: title }),
|
|
6212
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "flex h-9 w-9 items-center justify-center rounded-lg bg-primary/10 text-primary shrink-0", children: icon })
|
|
6070
6213
|
] }),
|
|
6071
|
-
/* @__PURE__ */ (0,
|
|
6072
|
-
/* @__PURE__ */ (0,
|
|
6073
|
-
sparkline && /* @__PURE__ */ (0,
|
|
6214
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-end justify-between gap-2", children: [
|
|
6215
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "text-3xl font-bold tracking-tight", children: value }),
|
|
6216
|
+
sparkline && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Sparkline2, { data: sparkline, trend: autoTrend })
|
|
6074
6217
|
] }),
|
|
6075
|
-
/* @__PURE__ */ (0,
|
|
6076
|
-
change !== void 0 && /* @__PURE__ */ (0,
|
|
6077
|
-
/* @__PURE__ */ (0,
|
|
6218
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
6219
|
+
change !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { className: cn("flex items-center gap-0.5 text-xs font-semibold", trendColor), children: [
|
|
6220
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TrendIcon, { className: "h-3.5 w-3.5" }),
|
|
6078
6221
|
change > 0 ? "+" : "",
|
|
6079
6222
|
change,
|
|
6080
6223
|
"%"
|
|
6081
6224
|
] }),
|
|
6082
|
-
changeLabel && /* @__PURE__ */ (0,
|
|
6083
|
-
description && !changeLabel && /* @__PURE__ */ (0,
|
|
6225
|
+
changeLabel && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-xs text-muted-foreground", children: changeLabel }),
|
|
6226
|
+
description && !changeLabel && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-xs text-muted-foreground", children: description })
|
|
6084
6227
|
] })
|
|
6085
6228
|
] });
|
|
6086
6229
|
}
|
|
6087
6230
|
|
|
6088
6231
|
// src/components/ui/stepper.tsx
|
|
6089
|
-
var
|
|
6232
|
+
var React37 = __toESM(require("react"), 1);
|
|
6090
6233
|
var import_lucide_react25 = require("lucide-react");
|
|
6091
|
-
var
|
|
6234
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
6092
6235
|
function getStatus(idx, current) {
|
|
6093
6236
|
if (idx < current) return "complete";
|
|
6094
6237
|
if (idx === current) return "current";
|
|
@@ -6109,7 +6252,7 @@ function Stepper({
|
|
|
6109
6252
|
clickable = false,
|
|
6110
6253
|
className
|
|
6111
6254
|
}) {
|
|
6112
|
-
const [internal, setInternal] =
|
|
6255
|
+
const [internal, setInternal] = React37.useState(defaultCurrent);
|
|
6113
6256
|
const current = controlled ?? internal;
|
|
6114
6257
|
function go(idx) {
|
|
6115
6258
|
if (!clickable) return;
|
|
@@ -6117,20 +6260,20 @@ function Stepper({
|
|
|
6117
6260
|
onChange?.(idx);
|
|
6118
6261
|
}
|
|
6119
6262
|
const isHorizontal = orientation === "horizontal";
|
|
6120
|
-
return /* @__PURE__ */ (0,
|
|
6121
|
-
/* @__PURE__ */ (0,
|
|
6263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: cn("w-full", className), children: [
|
|
6264
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: cn(
|
|
6122
6265
|
"flex",
|
|
6123
6266
|
isHorizontal ? "flex-row items-start" : "flex-col gap-0"
|
|
6124
6267
|
), children: steps.map((step, i) => {
|
|
6125
6268
|
const status = getStatus(i, current);
|
|
6126
6269
|
const isLast = i === steps.length - 1;
|
|
6127
|
-
return /* @__PURE__ */ (0,
|
|
6270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(React37.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: cn(
|
|
6128
6271
|
"flex",
|
|
6129
6272
|
isHorizontal ? "flex-col items-center flex-1" : "flex-row gap-4"
|
|
6130
6273
|
), children: [
|
|
6131
|
-
/* @__PURE__ */ (0,
|
|
6132
|
-
isHorizontal && i > 0 && /* @__PURE__ */ (0,
|
|
6133
|
-
/* @__PURE__ */ (0,
|
|
6274
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: cn("flex items-center", isHorizontal ? "w-full" : "flex-col"), children: [
|
|
6275
|
+
isHorizontal && i > 0 && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: cn("flex-1 h-0.5 transition-colors", i <= current ? "bg-primary" : "bg-border") }),
|
|
6276
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
6134
6277
|
"button",
|
|
6135
6278
|
{
|
|
6136
6279
|
type: "button",
|
|
@@ -6142,35 +6285,35 @@ function Stepper({
|
|
|
6142
6285
|
clickable && "cursor-pointer hover:scale-110",
|
|
6143
6286
|
!clickable && "cursor-default"
|
|
6144
6287
|
),
|
|
6145
|
-
children: status === "complete" ? /* @__PURE__ */ (0,
|
|
6288
|
+
children: status === "complete" ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react25.Check, { className: "h-4 w-4" }) : status === "error" ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react25.X, { className: "h-4 w-4" }) : step.icon ?? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { children: i + 1 })
|
|
6146
6289
|
}
|
|
6147
6290
|
),
|
|
6148
|
-
isHorizontal && !isLast && /* @__PURE__ */ (0,
|
|
6149
|
-
!isHorizontal && !isLast && /* @__PURE__ */ (0,
|
|
6291
|
+
isHorizontal && !isLast && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: cn("flex-1 h-0.5 transition-colors", i < current ? "bg-primary" : "bg-border") }),
|
|
6292
|
+
!isHorizontal && !isLast && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: cn("w-0.5 flex-1 min-h-8 transition-colors mt-1", i < current ? "bg-primary" : "bg-border") })
|
|
6150
6293
|
] }),
|
|
6151
|
-
/* @__PURE__ */ (0,
|
|
6294
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: cn(
|
|
6152
6295
|
isHorizontal ? "mt-2 text-center px-1" : "pb-6 min-w-0"
|
|
6153
6296
|
), children: [
|
|
6154
|
-
/* @__PURE__ */ (0,
|
|
6297
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("p", { className: cn(
|
|
6155
6298
|
"text-sm font-medium leading-tight",
|
|
6156
6299
|
status === "current" ? "text-primary" : status === "complete" ? "text-foreground" : "text-muted-foreground"
|
|
6157
6300
|
), children: [
|
|
6158
6301
|
step.label,
|
|
6159
|
-
step.optional && /* @__PURE__ */ (0,
|
|
6302
|
+
step.optional && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "ml-1 text-xs text-muted-foreground", children: "(optional)" })
|
|
6160
6303
|
] }),
|
|
6161
|
-
step.description && /* @__PURE__ */ (0,
|
|
6162
|
-
!isHorizontal && step.content && i === current && /* @__PURE__ */ (0,
|
|
6304
|
+
step.description && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { className: "text-xs text-muted-foreground mt-0.5", children: step.description }),
|
|
6305
|
+
!isHorizontal && step.content && i === current && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "mt-3", children: step.content })
|
|
6163
6306
|
] })
|
|
6164
6307
|
] }) }, i);
|
|
6165
6308
|
}) }),
|
|
6166
|
-
isHorizontal && steps[current]?.content && /* @__PURE__ */ (0,
|
|
6309
|
+
isHorizontal && steps[current]?.content && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "mt-6", children: steps[current].content })
|
|
6167
6310
|
] });
|
|
6168
6311
|
}
|
|
6169
6312
|
|
|
6170
6313
|
// src/components/ui/table.tsx
|
|
6171
|
-
var
|
|
6314
|
+
var React38 = __toESM(require("react"), 1);
|
|
6172
6315
|
var import_lucide_react26 = require("lucide-react");
|
|
6173
|
-
var
|
|
6316
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
6174
6317
|
var BADGE_COLORS = {
|
|
6175
6318
|
active: "bg-success/10 text-success border-success/20",
|
|
6176
6319
|
inactive: "bg-muted text-muted-foreground border-border",
|
|
@@ -6193,11 +6336,11 @@ function Table({
|
|
|
6193
6336
|
idKey = "id",
|
|
6194
6337
|
className
|
|
6195
6338
|
}) {
|
|
6196
|
-
const [search, setSearch] =
|
|
6197
|
-
const [currentPage, setCurrentPage] =
|
|
6198
|
-
const [selectedIds, setSelectedIds] =
|
|
6199
|
-
const [sortKey, setSortKey] =
|
|
6200
|
-
const [sortDir, setSortDir] =
|
|
6339
|
+
const [search, setSearch] = React38.useState("");
|
|
6340
|
+
const [currentPage, setCurrentPage] = React38.useState(1);
|
|
6341
|
+
const [selectedIds, setSelectedIds] = React38.useState([]);
|
|
6342
|
+
const [sortKey, setSortKey] = React38.useState(null);
|
|
6343
|
+
const [sortDir, setSortDir] = React38.useState(null);
|
|
6201
6344
|
const handleSort = (key) => {
|
|
6202
6345
|
if (sortKey !== key) {
|
|
6203
6346
|
setSortKey(key);
|
|
@@ -6211,7 +6354,7 @@ function Table({
|
|
|
6211
6354
|
setSortKey(null);
|
|
6212
6355
|
setSortDir(null);
|
|
6213
6356
|
};
|
|
6214
|
-
const filteredData =
|
|
6357
|
+
const filteredData = React38.useMemo(() => {
|
|
6215
6358
|
let d = search ? data.filter(
|
|
6216
6359
|
(item) => Object.values(item).some(
|
|
6217
6360
|
(val) => val && typeof val === "string" && val.toLowerCase().includes(search.toLowerCase())
|
|
@@ -6229,18 +6372,18 @@ function Table({
|
|
|
6229
6372
|
}, [data, search, sortKey, sortDir]);
|
|
6230
6373
|
const totalPages = Math.max(1, Math.ceil(filteredData.length / itemsPerPage));
|
|
6231
6374
|
const safePage = Math.min(currentPage, totalPages);
|
|
6232
|
-
const paginatedData =
|
|
6375
|
+
const paginatedData = React38.useMemo(() => {
|
|
6233
6376
|
if (!pagination) return filteredData;
|
|
6234
6377
|
const start = (safePage - 1) * itemsPerPage;
|
|
6235
6378
|
return filteredData.slice(start, start + itemsPerPage);
|
|
6236
6379
|
}, [filteredData, pagination, safePage, itemsPerPage]);
|
|
6237
|
-
|
|
6380
|
+
React38.useEffect(() => {
|
|
6238
6381
|
setCurrentPage(1);
|
|
6239
6382
|
}, [search]);
|
|
6240
6383
|
const handleSelectAll = (checked) => setSelectedIds(checked ? paginatedData.map((item) => String(item[idKey])) : []);
|
|
6241
6384
|
const handleSelect = (id, checked) => setSelectedIds((prev) => checked ? [...prev, id] : prev.filter((i) => i !== id));
|
|
6242
6385
|
const allSelected = paginatedData.length > 0 && selectedIds.length === paginatedData.length;
|
|
6243
|
-
const pagePills =
|
|
6386
|
+
const pagePills = React38.useMemo(() => {
|
|
6244
6387
|
if (totalPages <= 5) return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
6245
6388
|
if (safePage <= 3) return [1, 2, 3, 4, 5];
|
|
6246
6389
|
if (safePage >= totalPages - 2) return [totalPages - 4, totalPages - 3, totalPages - 2, totalPages - 1, totalPages];
|
|
@@ -6248,14 +6391,14 @@ function Table({
|
|
|
6248
6391
|
}, [totalPages, safePage]);
|
|
6249
6392
|
const SortIcon = ({ col }) => {
|
|
6250
6393
|
if (!col.sortable) return null;
|
|
6251
|
-
if (sortKey !== String(col.key)) return /* @__PURE__ */ (0,
|
|
6252
|
-
return sortDir === "asc" ? /* @__PURE__ */ (0,
|
|
6394
|
+
if (sortKey !== String(col.key)) return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react26.ChevronsUpDown, { className: "ml-1.5 h-3.5 w-3.5 opacity-40" });
|
|
6395
|
+
return sortDir === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react26.ChevronUp, { className: "ml-1.5 h-3.5 w-3.5 text-primary" }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react26.ChevronDown, { className: "ml-1.5 h-3.5 w-3.5 text-primary" });
|
|
6253
6396
|
};
|
|
6254
|
-
return /* @__PURE__ */ (0,
|
|
6255
|
-
/* @__PURE__ */ (0,
|
|
6256
|
-
searchable && /* @__PURE__ */ (0,
|
|
6257
|
-
/* @__PURE__ */ (0,
|
|
6258
|
-
/* @__PURE__ */ (0,
|
|
6397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: cn("w-full space-y-3", className), children: [
|
|
6398
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center justify-between gap-3 flex-wrap", children: [
|
|
6399
|
+
searchable && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "relative w-72", children: [
|
|
6400
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react26.Search, { className: "absolute text-primary left-3 top-1/2 -translate-y-1/2 h-4 w-4 z-10" }),
|
|
6401
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6259
6402
|
"input",
|
|
6260
6403
|
{
|
|
6261
6404
|
placeholder: searchPlaceholder,
|
|
@@ -6264,17 +6407,17 @@ function Table({
|
|
|
6264
6407
|
className: "h-9 w-full rounded-xl border border-border bg-background/50 backdrop-blur-sm pl-9 pr-8 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-colors hover:bg-background/80"
|
|
6265
6408
|
}
|
|
6266
6409
|
),
|
|
6267
|
-
search && /* @__PURE__ */ (0,
|
|
6410
|
+
search && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6268
6411
|
"button",
|
|
6269
6412
|
{
|
|
6270
6413
|
onClick: () => setSearch(""),
|
|
6271
6414
|
className: "absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",
|
|
6272
|
-
children: /* @__PURE__ */ (0,
|
|
6415
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react26.X, { className: "h-3.5 w-3.5" })
|
|
6273
6416
|
}
|
|
6274
6417
|
)
|
|
6275
6418
|
] }),
|
|
6276
|
-
/* @__PURE__ */ (0,
|
|
6277
|
-
selectable && onBulkDelete && selectedIds.length > 0 && /* @__PURE__ */ (0,
|
|
6419
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center gap-2 ml-auto", children: [
|
|
6420
|
+
selectable && onBulkDelete && selectedIds.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
6278
6421
|
"button",
|
|
6279
6422
|
{
|
|
6280
6423
|
onClick: () => {
|
|
@@ -6283,14 +6426,14 @@ function Table({
|
|
|
6283
6426
|
},
|
|
6284
6427
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-danger/10 border border-danger/20 px-3 py-1.5 text-xs font-medium text-danger hover:bg-danger/20 transition-colors",
|
|
6285
6428
|
children: [
|
|
6286
|
-
/* @__PURE__ */ (0,
|
|
6429
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react26.Trash2, { className: "h-3.5 w-3.5" }),
|
|
6287
6430
|
"Delete ",
|
|
6288
6431
|
selectedIds.length,
|
|
6289
6432
|
" selected"
|
|
6290
6433
|
]
|
|
6291
6434
|
}
|
|
6292
6435
|
),
|
|
6293
|
-
/* @__PURE__ */ (0,
|
|
6436
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { className: "text-xs text-muted-foreground", children: [
|
|
6294
6437
|
filteredData.length,
|
|
6295
6438
|
" ",
|
|
6296
6439
|
filteredData.length === 1 ? "row" : "rows",
|
|
@@ -6298,16 +6441,16 @@ function Table({
|
|
|
6298
6441
|
] })
|
|
6299
6442
|
] })
|
|
6300
6443
|
] }),
|
|
6301
|
-
/* @__PURE__ */ (0,
|
|
6302
|
-
/* @__PURE__ */ (0,
|
|
6303
|
-
selectable && /* @__PURE__ */ (0,
|
|
6444
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "rounded-xl border border-border overflow-hidden bg-card/50 backdrop-blur-sm shadow-sm", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "w-full overflow-auto", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("table", { className: "w-full caption-bottom text-sm", children: [
|
|
6445
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("tr", { className: "border-b border-border bg-muted/40", children: [
|
|
6446
|
+
selectable && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("th", { className: "h-11 w-[46px] px-4 text-left align-middle", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6304
6447
|
Checkbox,
|
|
6305
6448
|
{
|
|
6306
6449
|
checked: allSelected,
|
|
6307
6450
|
onChange: (e) => handleSelectAll(e.target.checked)
|
|
6308
6451
|
}
|
|
6309
6452
|
) }),
|
|
6310
|
-
columns.map((col) => /* @__PURE__ */ (0,
|
|
6453
|
+
columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6311
6454
|
"th",
|
|
6312
6455
|
{
|
|
6313
6456
|
onClick: () => col.sortable && handleSort(String(col.key)),
|
|
@@ -6315,29 +6458,29 @@ function Table({
|
|
|
6315
6458
|
"h-11 px-4 text-left align-middle text-xs font-semibold uppercase tracking-wider text-muted-foreground select-none whitespace-nowrap",
|
|
6316
6459
|
col.sortable && "cursor-pointer hover:text-foreground transition-colors"
|
|
6317
6460
|
),
|
|
6318
|
-
children: /* @__PURE__ */ (0,
|
|
6461
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { className: "inline-flex items-center", children: [
|
|
6319
6462
|
col.title,
|
|
6320
|
-
/* @__PURE__ */ (0,
|
|
6463
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SortIcon, { col })
|
|
6321
6464
|
] })
|
|
6322
6465
|
},
|
|
6323
6466
|
String(col.key)
|
|
6324
6467
|
))
|
|
6325
6468
|
] }) }),
|
|
6326
|
-
/* @__PURE__ */ (0,
|
|
6469
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("tbody", { children: paginatedData.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6327
6470
|
"td",
|
|
6328
6471
|
{
|
|
6329
6472
|
colSpan: columns.length + (selectable ? 1 : 0),
|
|
6330
6473
|
className: "h-32 text-center align-middle",
|
|
6331
|
-
children: /* @__PURE__ */ (0,
|
|
6332
|
-
/* @__PURE__ */ (0,
|
|
6333
|
-
/* @__PURE__ */ (0,
|
|
6334
|
-
search && /* @__PURE__ */ (0,
|
|
6474
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex flex-col items-center gap-1 text-muted-foreground", children: [
|
|
6475
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react26.Search, { className: "h-8 w-8 opacity-20" }),
|
|
6476
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "text-sm", children: "No results found" }),
|
|
6477
|
+
search && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { onClick: () => setSearch(""), className: "text-xs text-primary hover:underline", children: "Clear search" })
|
|
6335
6478
|
] })
|
|
6336
6479
|
}
|
|
6337
6480
|
) }) : paginatedData.map((item, i) => {
|
|
6338
6481
|
const id = String(item[idKey] || i);
|
|
6339
6482
|
const isSelected = selectedIds.includes(id);
|
|
6340
|
-
return /* @__PURE__ */ (0,
|
|
6483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
6341
6484
|
"tr",
|
|
6342
6485
|
{
|
|
6343
6486
|
className: cn(
|
|
@@ -6345,38 +6488,38 @@ function Table({
|
|
|
6345
6488
|
isSelected ? "bg-primary/5 hover:bg-primary/8" : "hover:bg-muted/30"
|
|
6346
6489
|
),
|
|
6347
6490
|
children: [
|
|
6348
|
-
selectable && /* @__PURE__ */ (0,
|
|
6491
|
+
selectable && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("td", { className: "px-4 py-3 align-middle", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6349
6492
|
Checkbox,
|
|
6350
6493
|
{
|
|
6351
6494
|
checked: isSelected,
|
|
6352
6495
|
onChange: (e) => handleSelect(id, e.target.checked)
|
|
6353
6496
|
}
|
|
6354
6497
|
) }),
|
|
6355
|
-
columns.map((col) => /* @__PURE__ */ (0,
|
|
6498
|
+
columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("td", { className: "px-4 py-3 align-middle", children: col.render ? col.render(item) : col.type === "image" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6356
6499
|
"img",
|
|
6357
6500
|
{
|
|
6358
6501
|
src: item[col.key],
|
|
6359
6502
|
alt: item[col.key],
|
|
6360
6503
|
className: "h-9 w-9 rounded-lg object-cover ring-1 ring-border"
|
|
6361
6504
|
}
|
|
6362
|
-
) : col.type === "badge" ? /* @__PURE__ */ (0,
|
|
6505
|
+
) : col.type === "badge" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { className: cn(
|
|
6363
6506
|
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-medium",
|
|
6364
6507
|
badgeClass(String(item[col.key]))
|
|
6365
6508
|
), children: [
|
|
6366
|
-
/* @__PURE__ */ (0,
|
|
6509
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: cn(
|
|
6367
6510
|
"mr-1.5 h-1.5 w-1.5 rounded-full",
|
|
6368
6511
|
badgeClass(String(item[col.key])).includes("success") ? "bg-success" : badgeClass(String(item[col.key])).includes("warning") ? "bg-warning" : badgeClass(String(item[col.key])).includes("danger") ? "bg-danger" : badgeClass(String(item[col.key])).includes("info") ? "bg-info" : "bg-primary"
|
|
6369
6512
|
) }),
|
|
6370
6513
|
item[col.key]
|
|
6371
|
-
] }) : col.type === "stack" ? /* @__PURE__ */ (0,
|
|
6514
|
+
] }) : col.type === "stack" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(AvatarStack, { images: Array.isArray(item[col.key]) ? item[col.key] : [], ...col.stackProps ?? {} }) : col.type === "icon" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "flex items-center", children: item[col.key] }) : col.type === "select" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6372
6515
|
"select",
|
|
6373
6516
|
{
|
|
6374
6517
|
value: item[col.key],
|
|
6375
6518
|
onChange: (e) => col.onChange?.(item, e.target.value),
|
|
6376
6519
|
className: "h-8 rounded-lg border border-border bg-background/50 px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-ring transition-colors",
|
|
6377
|
-
children: (col.selectOptions ?? []).map((opt) => /* @__PURE__ */ (0,
|
|
6520
|
+
children: (col.selectOptions ?? []).map((opt) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("option", { value: opt, children: opt }, opt))
|
|
6378
6521
|
}
|
|
6379
|
-
) : col.type === "toggle" ? /* @__PURE__ */ (0,
|
|
6522
|
+
) : col.type === "toggle" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6380
6523
|
"button",
|
|
6381
6524
|
{
|
|
6382
6525
|
role: "switch",
|
|
@@ -6386,13 +6529,13 @@ function Table({
|
|
|
6386
6529
|
"relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
6387
6530
|
item[col.key] ? "bg-primary" : "bg-muted"
|
|
6388
6531
|
),
|
|
6389
|
-
children: /* @__PURE__ */ (0,
|
|
6532
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: cn(
|
|
6390
6533
|
"pointer-events-none inline-block h-4 w-4 rounded-full bg-white shadow-sm transition-transform",
|
|
6391
6534
|
item[col.key] ? "translate-x-4" : "translate-x-0"
|
|
6392
6535
|
) })
|
|
6393
6536
|
}
|
|
6394
|
-
) : col.type === "color" ? /* @__PURE__ */ (0,
|
|
6395
|
-
/* @__PURE__ */ (0,
|
|
6537
|
+
) : col.type === "color" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
6538
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6396
6539
|
"input",
|
|
6397
6540
|
{
|
|
6398
6541
|
type: "color",
|
|
@@ -6401,22 +6544,22 @@ function Table({
|
|
|
6401
6544
|
className: "h-7 w-7 cursor-pointer rounded border border-border bg-transparent p-0.5"
|
|
6402
6545
|
}
|
|
6403
6546
|
),
|
|
6404
|
-
/* @__PURE__ */ (0,
|
|
6405
|
-
] }) : col.type === "checkbox" ? /* @__PURE__ */ (0,
|
|
6547
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "text-xs text-muted-foreground font-mono", children: item[col.key] })
|
|
6548
|
+
] }) : col.type === "checkbox" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6406
6549
|
Checkbox,
|
|
6407
6550
|
{
|
|
6408
6551
|
checked: !!item[col.key],
|
|
6409
6552
|
onChange: (e) => col.onChange?.(item, e.target.checked)
|
|
6410
6553
|
}
|
|
6411
|
-
) : /* @__PURE__ */ (0,
|
|
6554
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "text-foreground/90", children: item[col.key] }) }, String(col.key)))
|
|
6412
6555
|
]
|
|
6413
6556
|
},
|
|
6414
6557
|
id
|
|
6415
6558
|
);
|
|
6416
6559
|
}) })
|
|
6417
6560
|
] }) }) }),
|
|
6418
|
-
pagination && totalPages > 1 && /* @__PURE__ */ (0,
|
|
6419
|
-
/* @__PURE__ */ (0,
|
|
6561
|
+
pagination && totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center justify-between gap-2 flex-wrap", children: [
|
|
6562
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { className: "text-xs text-muted-foreground", children: [
|
|
6420
6563
|
"Showing ",
|
|
6421
6564
|
(safePage - 1) * itemsPerPage + 1,
|
|
6422
6565
|
"\u2013",
|
|
@@ -6424,21 +6567,21 @@ function Table({
|
|
|
6424
6567
|
" of ",
|
|
6425
6568
|
filteredData.length
|
|
6426
6569
|
] }),
|
|
6427
|
-
/* @__PURE__ */ (0,
|
|
6428
|
-
/* @__PURE__ */ (0,
|
|
6570
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
6571
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6429
6572
|
"button",
|
|
6430
6573
|
{
|
|
6431
6574
|
onClick: () => setCurrentPage((p) => Math.max(1, p - 1)),
|
|
6432
6575
|
disabled: safePage === 1,
|
|
6433
6576
|
className: "flex h-8 w-8 items-center justify-center rounded-lg border border-border text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-40 disabled:pointer-events-none",
|
|
6434
|
-
children: /* @__PURE__ */ (0,
|
|
6577
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react26.ChevronLeft, { className: "h-4 w-4" })
|
|
6435
6578
|
}
|
|
6436
6579
|
),
|
|
6437
|
-
pagePills[0] > 1 && /* @__PURE__ */ (0,
|
|
6438
|
-
/* @__PURE__ */ (0,
|
|
6439
|
-
pagePills[0] > 2 && /* @__PURE__ */ (0,
|
|
6580
|
+
pagePills[0] > 1 && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
6581
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { onClick: () => setCurrentPage(1), className: "flex h-8 w-8 items-center justify-center rounded-lg border border-border text-xs text-muted-foreground hover:bg-muted transition-colors", children: "1" }),
|
|
6582
|
+
pagePills[0] > 2 && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "px-1 text-muted-foreground text-xs", children: "\u2026" })
|
|
6440
6583
|
] }),
|
|
6441
|
-
pagePills.map((p) => /* @__PURE__ */ (0,
|
|
6584
|
+
pagePills.map((p) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6442
6585
|
"button",
|
|
6443
6586
|
{
|
|
6444
6587
|
onClick: () => setCurrentPage(p),
|
|
@@ -6450,17 +6593,17 @@ function Table({
|
|
|
6450
6593
|
},
|
|
6451
6594
|
p
|
|
6452
6595
|
)),
|
|
6453
|
-
pagePills[pagePills.length - 1] < totalPages && /* @__PURE__ */ (0,
|
|
6454
|
-
pagePills[pagePills.length - 1] < totalPages - 1 && /* @__PURE__ */ (0,
|
|
6455
|
-
/* @__PURE__ */ (0,
|
|
6596
|
+
pagePills[pagePills.length - 1] < totalPages && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
6597
|
+
pagePills[pagePills.length - 1] < totalPages - 1 && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "px-1 text-muted-foreground text-xs", children: "\u2026" }),
|
|
6598
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { onClick: () => setCurrentPage(totalPages), className: "flex h-8 w-8 items-center justify-center rounded-lg border border-border text-xs text-muted-foreground hover:bg-muted transition-colors", children: totalPages })
|
|
6456
6599
|
] }),
|
|
6457
|
-
/* @__PURE__ */ (0,
|
|
6600
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6458
6601
|
"button",
|
|
6459
6602
|
{
|
|
6460
6603
|
onClick: () => setCurrentPage((p) => Math.min(totalPages, p + 1)),
|
|
6461
6604
|
disabled: safePage === totalPages,
|
|
6462
6605
|
className: "flex h-8 w-8 items-center justify-center rounded-lg border border-border text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-40 disabled:pointer-events-none",
|
|
6463
|
-
children: /* @__PURE__ */ (0,
|
|
6606
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react26.ChevronRight, { className: "h-4 w-4" })
|
|
6464
6607
|
}
|
|
6465
6608
|
)
|
|
6466
6609
|
] })
|
|
@@ -6469,8 +6612,8 @@ function Table({
|
|
|
6469
6612
|
}
|
|
6470
6613
|
|
|
6471
6614
|
// src/components/ui/tabs.tsx
|
|
6472
|
-
var
|
|
6473
|
-
var
|
|
6615
|
+
var React39 = __toESM(require("react"), 1);
|
|
6616
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
6474
6617
|
var sizeMap = {
|
|
6475
6618
|
sm: "px-3 py-1.5 text-xs",
|
|
6476
6619
|
md: "px-4 py-2 text-sm",
|
|
@@ -6520,15 +6663,15 @@ function Tabs({
|
|
|
6520
6663
|
fullWidth = false,
|
|
6521
6664
|
className
|
|
6522
6665
|
}) {
|
|
6523
|
-
const [internal, setInternal] =
|
|
6666
|
+
const [internal, setInternal] = React39.useState(defaultValue ?? items[0]?.value ?? "");
|
|
6524
6667
|
const active = controlledValue ?? internal;
|
|
6525
6668
|
const select = (v) => {
|
|
6526
6669
|
if (!controlledValue) setInternal(v);
|
|
6527
6670
|
onChange?.(v);
|
|
6528
6671
|
};
|
|
6529
6672
|
const activeItem = items.find((i) => i.value === active);
|
|
6530
|
-
return /* @__PURE__ */ (0,
|
|
6531
|
-
/* @__PURE__ */ (0,
|
|
6673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: cn("w-full", className), children: [
|
|
6674
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: cn("flex", fullWidth && "w-full", variantTrack[variant]), children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
6532
6675
|
"button",
|
|
6533
6676
|
{
|
|
6534
6677
|
type: "button",
|
|
@@ -6539,20 +6682,20 @@ function Tabs({
|
|
|
6539
6682
|
fullWidth && "flex-1 justify-center"
|
|
6540
6683
|
),
|
|
6541
6684
|
children: [
|
|
6542
|
-
item.icon && /* @__PURE__ */ (0,
|
|
6685
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "shrink-0", children: item.icon }),
|
|
6543
6686
|
item.label,
|
|
6544
|
-
item.badge && /* @__PURE__ */ (0,
|
|
6687
|
+
item.badge && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "shrink-0", children: item.badge })
|
|
6545
6688
|
]
|
|
6546
6689
|
},
|
|
6547
6690
|
item.value
|
|
6548
6691
|
)) }),
|
|
6549
|
-
activeItem?.content && /* @__PURE__ */ (0,
|
|
6692
|
+
activeItem?.content && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "mt-4", children: activeItem.content })
|
|
6550
6693
|
] });
|
|
6551
6694
|
}
|
|
6552
6695
|
|
|
6553
6696
|
// src/components/ui/tag-input.tsx
|
|
6554
|
-
var
|
|
6555
|
-
var
|
|
6697
|
+
var React40 = __toESM(require("react"), 1);
|
|
6698
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
6556
6699
|
function TagInput({
|
|
6557
6700
|
value: controlled,
|
|
6558
6701
|
defaultValue = [],
|
|
@@ -6563,9 +6706,9 @@ function TagInput({
|
|
|
6563
6706
|
disabled = false,
|
|
6564
6707
|
className
|
|
6565
6708
|
}) {
|
|
6566
|
-
const [internal, setInternal] =
|
|
6567
|
-
const [input, setInput] =
|
|
6568
|
-
const inputRef =
|
|
6709
|
+
const [internal, setInternal] = React40.useState(defaultValue);
|
|
6710
|
+
const [input, setInput] = React40.useState("");
|
|
6711
|
+
const inputRef = React40.useRef(null);
|
|
6569
6712
|
const tags = controlled ?? internal;
|
|
6570
6713
|
function addTag(raw) {
|
|
6571
6714
|
const tag = raw.trim();
|
|
@@ -6590,7 +6733,7 @@ function TagInput({
|
|
|
6590
6733
|
removeTag(tags.length - 1);
|
|
6591
6734
|
}
|
|
6592
6735
|
}
|
|
6593
|
-
return /* @__PURE__ */ (0,
|
|
6736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
6594
6737
|
"div",
|
|
6595
6738
|
{
|
|
6596
6739
|
className: cn(
|
|
@@ -6601,8 +6744,8 @@ function TagInput({
|
|
|
6601
6744
|
),
|
|
6602
6745
|
onClick: () => inputRef.current?.focus(),
|
|
6603
6746
|
children: [
|
|
6604
|
-
tags.map((tag, i) => /* @__PURE__ */ (0,
|
|
6605
|
-
/* @__PURE__ */ (0,
|
|
6747
|
+
tags.map((tag, i) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Badge, { variant: "default", size: "sm", removable: true, onRemove: () => removeTag(i), children: tag }, i)),
|
|
6748
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
6606
6749
|
"input",
|
|
6607
6750
|
{
|
|
6608
6751
|
ref: inputRef,
|
|
@@ -6622,7 +6765,7 @@ function TagInput({
|
|
|
6622
6765
|
|
|
6623
6766
|
// src/components/ui/timeline.tsx
|
|
6624
6767
|
var import_lucide_react27 = require("lucide-react");
|
|
6625
|
-
var
|
|
6768
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
6626
6769
|
var DOT_COLOR = {
|
|
6627
6770
|
default: "bg-primary border-primary/30",
|
|
6628
6771
|
success: "bg-success border-success/30",
|
|
@@ -6638,41 +6781,41 @@ var ICON_COLOR = {
|
|
|
6638
6781
|
info: "text-info"
|
|
6639
6782
|
};
|
|
6640
6783
|
var DEFAULT_ICON = {
|
|
6641
|
-
default: /* @__PURE__ */ (0,
|
|
6642
|
-
success: /* @__PURE__ */ (0,
|
|
6643
|
-
error: /* @__PURE__ */ (0,
|
|
6644
|
-
warning: /* @__PURE__ */ (0,
|
|
6645
|
-
info: /* @__PURE__ */ (0,
|
|
6784
|
+
default: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react27.Circle, { className: "h-3 w-3" }),
|
|
6785
|
+
success: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react27.CheckCircle, { className: "h-3.5 w-3.5" }),
|
|
6786
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react27.XCircle, { className: "h-3.5 w-3.5" }),
|
|
6787
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react27.AlertTriangle, { className: "h-3.5 w-3.5" }),
|
|
6788
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react27.Info, { className: "h-3.5 w-3.5" })
|
|
6646
6789
|
};
|
|
6647
6790
|
function Timeline({ items, align = "left", className }) {
|
|
6648
|
-
return /* @__PURE__ */ (0,
|
|
6791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: cn("relative", className), children: items.map((item, i) => {
|
|
6649
6792
|
const variant = item.variant ?? "default";
|
|
6650
6793
|
const isLast = i === items.length - 1;
|
|
6651
6794
|
const isRight = align === "alternate" && i % 2 === 1;
|
|
6652
|
-
return /* @__PURE__ */ (0,
|
|
6653
|
-
/* @__PURE__ */ (0,
|
|
6654
|
-
/* @__PURE__ */ (0,
|
|
6795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: cn("relative flex gap-4", align === "alternate" && "justify-center", isRight && "flex-row-reverse"), children: [
|
|
6796
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex flex-col items-center", children: [
|
|
6797
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: cn(
|
|
6655
6798
|
"flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 z-10",
|
|
6656
6799
|
item.icon ? "bg-background border-border" : DOT_COLOR[variant]
|
|
6657
|
-
), children: /* @__PURE__ */ (0,
|
|
6658
|
-
!isLast && /* @__PURE__ */ (0,
|
|
6800
|
+
), children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: cn("shrink-0", item.icon ? ICON_COLOR[variant] : "text-white"), children: item.icon ?? DEFAULT_ICON[variant] }) }),
|
|
6801
|
+
!isLast && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "w-0.5 flex-1 bg-border mt-1 mb-1 min-h-4" })
|
|
6659
6802
|
] }),
|
|
6660
|
-
/* @__PURE__ */ (0,
|
|
6661
|
-
/* @__PURE__ */ (0,
|
|
6662
|
-
/* @__PURE__ */ (0,
|
|
6663
|
-
item.time && /* @__PURE__ */ (0,
|
|
6803
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: cn("flex-1 pb-6 min-w-0", isRight && "text-right"), children: [
|
|
6804
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: cn("flex items-start justify-between gap-2", isRight && "flex-row-reverse"), children: [
|
|
6805
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { className: "text-sm font-semibold leading-tight", children: item.title }),
|
|
6806
|
+
item.time && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "shrink-0 text-xs text-muted-foreground whitespace-nowrap", children: item.time })
|
|
6664
6807
|
] }),
|
|
6665
|
-
item.description && /* @__PURE__ */ (0,
|
|
6666
|
-
item.content && /* @__PURE__ */ (0,
|
|
6808
|
+
item.description && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { className: "mt-0.5 text-xs text-muted-foreground leading-snug", children: item.description }),
|
|
6809
|
+
item.content && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mt-2", children: item.content })
|
|
6667
6810
|
] })
|
|
6668
6811
|
] }, item.id ?? i);
|
|
6669
6812
|
}) });
|
|
6670
6813
|
}
|
|
6671
6814
|
|
|
6672
6815
|
// src/components/ui/toggle-switch.tsx
|
|
6673
|
-
var
|
|
6674
|
-
var
|
|
6675
|
-
var ToggleSwitch =
|
|
6816
|
+
var React41 = __toESM(require("react"), 1);
|
|
6817
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
6818
|
+
var ToggleSwitch = React41.forwardRef(
|
|
6676
6819
|
({
|
|
6677
6820
|
className,
|
|
6678
6821
|
inline = false,
|
|
@@ -6690,10 +6833,10 @@ var ToggleSwitch = React40.forwardRef(
|
|
|
6690
6833
|
disabled,
|
|
6691
6834
|
...props
|
|
6692
6835
|
}, ref) => {
|
|
6693
|
-
const toggleId = id ??
|
|
6836
|
+
const toggleId = id ?? React41.useId();
|
|
6694
6837
|
const trackW = width ? typeof width === "number" ? `${width}px` : width : "2.75rem";
|
|
6695
6838
|
const trackH = height ? typeof height === "number" ? `${height}px` : height : "1.5rem";
|
|
6696
|
-
const [internalChecked, setInternalChecked] =
|
|
6839
|
+
const [internalChecked, setInternalChecked] = React41.useState(defaultChecked ?? false);
|
|
6697
6840
|
const isControlled = checked !== void 0;
|
|
6698
6841
|
const isOn = accepted ? true : declined ? false : isControlled ? checked : internalChecked;
|
|
6699
6842
|
const stateColor = accepted ? acceptedColor ?? "#22c55e" : declined ? declinedColor ?? "#ef4444" : isOn ? void 0 : void 0;
|
|
@@ -6702,13 +6845,13 @@ var ToggleSwitch = React40.forwardRef(
|
|
|
6702
6845
|
if (!isControlled) setInternalChecked(e.target.checked);
|
|
6703
6846
|
onChange?.(e);
|
|
6704
6847
|
};
|
|
6705
|
-
const toggle = /* @__PURE__ */ (0,
|
|
6848
|
+
const toggle = /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
6706
6849
|
"label",
|
|
6707
6850
|
{
|
|
6708
6851
|
htmlFor: toggleId,
|
|
6709
6852
|
className: cn("relative inline-flex items-center cursor-pointer", disabled && "opacity-50 cursor-not-allowed"),
|
|
6710
6853
|
children: [
|
|
6711
|
-
/* @__PURE__ */ (0,
|
|
6854
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
6712
6855
|
"input",
|
|
6713
6856
|
{
|
|
6714
6857
|
type: "checkbox",
|
|
@@ -6721,7 +6864,7 @@ var ToggleSwitch = React40.forwardRef(
|
|
|
6721
6864
|
...props
|
|
6722
6865
|
}
|
|
6723
6866
|
),
|
|
6724
|
-
/* @__PURE__ */ (0,
|
|
6867
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
6725
6868
|
"div",
|
|
6726
6869
|
{
|
|
6727
6870
|
className: cn(
|
|
@@ -6734,7 +6877,7 @@ var ToggleSwitch = React40.forwardRef(
|
|
|
6734
6877
|
height: trackH,
|
|
6735
6878
|
...stateColor ? { backgroundColor: stateColor } : {}
|
|
6736
6879
|
},
|
|
6737
|
-
children: /* @__PURE__ */ (0,
|
|
6880
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
6738
6881
|
"span",
|
|
6739
6882
|
{
|
|
6740
6883
|
className: `absolute top-[1px] ${isOn ? "bg-slate-50/40" : "bg-primary"} rounded-full border border-slate-300/50 shadow transition-transform duration-200`,
|
|
@@ -6752,9 +6895,9 @@ var ToggleSwitch = React40.forwardRef(
|
|
|
6752
6895
|
}
|
|
6753
6896
|
);
|
|
6754
6897
|
if (inline && label) {
|
|
6755
|
-
return /* @__PURE__ */ (0,
|
|
6898
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "inline-flex items-center gap-2 select-none", children: [
|
|
6756
6899
|
toggle,
|
|
6757
|
-
/* @__PURE__ */ (0,
|
|
6900
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("label", { htmlFor: toggleId, className: cn("text-sm cursor-pointer", disabled && "opacity-50 cursor-not-allowed"), children: label })
|
|
6758
6901
|
] });
|
|
6759
6902
|
}
|
|
6760
6903
|
return toggle;
|
|
@@ -6763,16 +6906,16 @@ var ToggleSwitch = React40.forwardRef(
|
|
|
6763
6906
|
ToggleSwitch.displayName = "ToggleSwitch";
|
|
6764
6907
|
|
|
6765
6908
|
// src/components/ui/tree-view.tsx
|
|
6766
|
-
var
|
|
6909
|
+
var React42 = __toESM(require("react"), 1);
|
|
6767
6910
|
var import_lucide_react28 = require("lucide-react");
|
|
6768
|
-
var
|
|
6911
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
6769
6912
|
function TreeNodeItem({ node, depth, selected, expanded, onToggleExpand, onSelect, multiple }) {
|
|
6770
6913
|
const hasChildren = !!node.children?.length;
|
|
6771
6914
|
const isExpanded = expanded.includes(node.id);
|
|
6772
6915
|
const isSelected = selected.includes(node.id);
|
|
6773
|
-
const defaultIcon = hasChildren ? isExpanded ? /* @__PURE__ */ (0,
|
|
6774
|
-
return /* @__PURE__ */ (0,
|
|
6775
|
-
/* @__PURE__ */ (0,
|
|
6916
|
+
const defaultIcon = hasChildren ? isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react28.FolderOpen, { className: "h-4 w-4 text-warning" }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react28.Folder, { className: "h-4 w-4 text-warning" }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react28.File, { className: "h-4 w-4 text-muted-foreground" });
|
|
6917
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { children: [
|
|
6918
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
6776
6919
|
"div",
|
|
6777
6920
|
{
|
|
6778
6921
|
className: cn(
|
|
@@ -6786,13 +6929,13 @@ function TreeNodeItem({ node, depth, selected, expanded, onToggleExpand, onSelec
|
|
|
6786
6929
|
onSelect(node.id);
|
|
6787
6930
|
},
|
|
6788
6931
|
children: [
|
|
6789
|
-
hasChildren ? /* @__PURE__ */ (0,
|
|
6790
|
-
/* @__PURE__ */ (0,
|
|
6791
|
-
/* @__PURE__ */ (0,
|
|
6932
|
+
hasChildren ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react28.ChevronRight, { className: cn("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform", isExpanded && "rotate-90") }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "w-3.5 shrink-0" }),
|
|
6933
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "shrink-0", children: node.icon ?? defaultIcon }),
|
|
6934
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "truncate", children: node.label })
|
|
6792
6935
|
]
|
|
6793
6936
|
}
|
|
6794
6937
|
),
|
|
6795
|
-
hasChildren && isExpanded && /* @__PURE__ */ (0,
|
|
6938
|
+
hasChildren && isExpanded && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { children: node.children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6796
6939
|
TreeNodeItem,
|
|
6797
6940
|
{
|
|
6798
6941
|
node: child,
|
|
@@ -6817,8 +6960,8 @@ function TreeView({
|
|
|
6817
6960
|
className
|
|
6818
6961
|
}) {
|
|
6819
6962
|
const init = defaultSelected ? Array.isArray(defaultSelected) ? defaultSelected : [defaultSelected] : [];
|
|
6820
|
-
const [internal, setInternal] =
|
|
6821
|
-
const [expanded, setExpanded] =
|
|
6963
|
+
const [internal, setInternal] = React42.useState(init);
|
|
6964
|
+
const [expanded, setExpanded] = React42.useState(defaultExpanded);
|
|
6822
6965
|
const selected = controlled ? Array.isArray(controlled) ? controlled : [controlled] : internal;
|
|
6823
6966
|
function handleSelect(id) {
|
|
6824
6967
|
let next;
|
|
@@ -6833,7 +6976,7 @@ function TreeView({
|
|
|
6833
6976
|
function toggleExpand(id) {
|
|
6834
6977
|
setExpanded((prev) => prev.includes(id) ? prev.filter((v) => v !== id) : [...prev, id]);
|
|
6835
6978
|
}
|
|
6836
|
-
return /* @__PURE__ */ (0,
|
|
6979
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: cn("w-full", className), children: nodes.map((node) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6837
6980
|
TreeNodeItem,
|
|
6838
6981
|
{
|
|
6839
6982
|
node,
|
|
@@ -6849,8 +6992,8 @@ function TreeView({
|
|
|
6849
6992
|
}
|
|
6850
6993
|
|
|
6851
6994
|
// src/components/ui/widget.tsx
|
|
6852
|
-
var
|
|
6853
|
-
var
|
|
6995
|
+
var React43 = __toESM(require("react"), 1);
|
|
6996
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
6854
6997
|
var iconColorMap = {
|
|
6855
6998
|
primary: "bg-primary/10 text-primary",
|
|
6856
6999
|
info: "bg-info/10 text-info",
|
|
@@ -6878,8 +7021,8 @@ var variantMap = {
|
|
|
6878
7021
|
outline: "bg-transparent border-2"
|
|
6879
7022
|
};
|
|
6880
7023
|
function useCountUp(target, enabled, duration = 1e3) {
|
|
6881
|
-
const [display, setDisplay] =
|
|
6882
|
-
|
|
7024
|
+
const [display, setDisplay] = React43.useState(enabled ? 0 : target);
|
|
7025
|
+
React43.useEffect(() => {
|
|
6883
7026
|
if (!enabled) {
|
|
6884
7027
|
setDisplay(target);
|
|
6885
7028
|
return;
|
|
@@ -6922,7 +7065,7 @@ function Widget({
|
|
|
6922
7065
|
const counted = useCountUp(isNumeric ? value : 0, animate && isNumeric);
|
|
6923
7066
|
const displayValue = animate && isNumeric ? counted : value;
|
|
6924
7067
|
const s = sizeMap2[size];
|
|
6925
|
-
return /* @__PURE__ */ (0,
|
|
7068
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
6926
7069
|
Card,
|
|
6927
7070
|
{
|
|
6928
7071
|
className: cn(
|
|
@@ -6933,27 +7076,27 @@ function Widget({
|
|
|
6933
7076
|
),
|
|
6934
7077
|
onClick,
|
|
6935
7078
|
...props,
|
|
6936
|
-
children: /* @__PURE__ */ (0,
|
|
6937
|
-
/* @__PURE__ */ (0,
|
|
6938
|
-
/* @__PURE__ */ (0,
|
|
6939
|
-
/* @__PURE__ */ (0,
|
|
6940
|
-
/* @__PURE__ */ (0,
|
|
6941
|
-
badge && /* @__PURE__ */ (0,
|
|
7079
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(CardContent, { className: s.card, children: [
|
|
7080
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
7081
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "min-w-0 flex-1 space-y-1", children: [
|
|
7082
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
7083
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "text-sm font-medium text-muted-foreground truncate", children: title }),
|
|
7084
|
+
badge && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "shrink-0", children: badge })
|
|
6942
7085
|
] }),
|
|
6943
|
-
loading ? /* @__PURE__ */ (0,
|
|
6944
|
-
description && /* @__PURE__ */ (0,
|
|
7086
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "h-8 w-24 animate-pulse rounded-md bg-muted" }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: cn("font-bold tabular-nums", s.value), children: displayValue }),
|
|
7087
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "text-xs text-muted-foreground", children: description })
|
|
6945
7088
|
] }),
|
|
6946
|
-
icon && /* @__PURE__ */ (0,
|
|
7089
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: cn(
|
|
6947
7090
|
"relative flex shrink-0 items-center justify-center rounded-full",
|
|
6948
7091
|
s.icon,
|
|
6949
7092
|
iconColorMap[iconColor]
|
|
6950
7093
|
), children: [
|
|
6951
|
-
pulse && /* @__PURE__ */ (0,
|
|
6952
|
-
/* @__PURE__ */ (0,
|
|
7094
|
+
pulse && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "absolute inset-0 rounded-full animate-ping opacity-30 bg-current" }),
|
|
7095
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: s.iconSize, children: icon })
|
|
6953
7096
|
] })
|
|
6954
7097
|
] }),
|
|
6955
|
-
trendValue && !loading && /* @__PURE__ */ (0,
|
|
6956
|
-
/* @__PURE__ */ (0,
|
|
7098
|
+
trendValue && !loading && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "mt-3 flex items-center gap-1.5 text-sm", children: [
|
|
7099
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className: cn(
|
|
6957
7100
|
"font-medium",
|
|
6958
7101
|
trend === "up" && "text-success",
|
|
6959
7102
|
trend === "down" && "text-danger",
|
|
@@ -6963,21 +7106,21 @@ function Widget({
|
|
|
6963
7106
|
trend === "down" && "\u2193 ",
|
|
6964
7107
|
trendValue
|
|
6965
7108
|
] }),
|
|
6966
|
-
previousValue !== void 0 && /* @__PURE__ */ (0,
|
|
7109
|
+
previousValue !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className: "text-muted-foreground", children: [
|
|
6967
7110
|
"vs ",
|
|
6968
7111
|
previousValue
|
|
6969
7112
|
] }),
|
|
6970
|
-
/* @__PURE__ */ (0,
|
|
7113
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-muted-foreground", children: trendLabel })
|
|
6971
7114
|
] }),
|
|
6972
|
-
progress !== void 0 && /* @__PURE__ */ (0,
|
|
6973
|
-
/* @__PURE__ */ (0,
|
|
6974
|
-
/* @__PURE__ */ (0,
|
|
6975
|
-
/* @__PURE__ */ (0,
|
|
7115
|
+
progress !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "mt-4 space-y-1", children: [
|
|
7116
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "flex justify-between text-xs text-muted-foreground", children: [
|
|
7117
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { children: "Progress" }),
|
|
7118
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { children: [
|
|
6976
7119
|
Math.min(100, Math.max(0, progress)),
|
|
6977
7120
|
"%"
|
|
6978
7121
|
] })
|
|
6979
7122
|
] }),
|
|
6980
|
-
/* @__PURE__ */ (0,
|
|
7123
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "h-1.5 w-full rounded-full bg-muted overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
6981
7124
|
"div",
|
|
6982
7125
|
{
|
|
6983
7126
|
className: cn("h-full rounded-full transition-all duration-700", progressColorMap[progressColor]),
|
|
@@ -6985,7 +7128,7 @@ function Widget({
|
|
|
6985
7128
|
}
|
|
6986
7129
|
) })
|
|
6987
7130
|
] }),
|
|
6988
|
-
footer && /* @__PURE__ */ (0,
|
|
7131
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "mt-4 border-t pt-3 text-sm text-muted-foreground", children: footer })
|
|
6989
7132
|
] })
|
|
6990
7133
|
}
|
|
6991
7134
|
);
|