@juv/codego-react-ui 1.0.4 → 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.js
CHANGED
|
@@ -361,7 +361,9 @@ var Button = React3.forwardRef(
|
|
|
361
361
|
debounceTime,
|
|
362
362
|
throttleTime,
|
|
363
363
|
confirmBeforeClick,
|
|
364
|
-
|
|
364
|
+
confirmBeforeClickModalTitle,
|
|
365
|
+
confirmBeforeClickModalContent,
|
|
366
|
+
confirmBeforeClickFooterAction,
|
|
365
367
|
href,
|
|
366
368
|
target,
|
|
367
369
|
as = "button",
|
|
@@ -432,12 +434,27 @@ var Button = React3.forwardRef(
|
|
|
432
434
|
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,
|
|
433
435
|
...style
|
|
434
436
|
};
|
|
437
|
+
const [confirmOpen, setConfirmOpen] = React3.useState(false);
|
|
438
|
+
const pendingEvent = React3.useRef(null);
|
|
435
439
|
const handleClick = (e) => {
|
|
436
440
|
if (preventDefault) e.preventDefault();
|
|
437
441
|
if (stopPropagation) e.stopPropagation();
|
|
438
|
-
if (confirmBeforeClick
|
|
442
|
+
if (confirmBeforeClick) {
|
|
443
|
+
pendingEvent.current = e;
|
|
444
|
+
setConfirmOpen(true);
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
439
447
|
onClick?.(e);
|
|
440
448
|
};
|
|
449
|
+
function handleConfirmProceed() {
|
|
450
|
+
setConfirmOpen(false);
|
|
451
|
+
onClick?.(pendingEvent.current ?? void 0);
|
|
452
|
+
pendingEvent.current = null;
|
|
453
|
+
}
|
|
454
|
+
function handleConfirmCancel() {
|
|
455
|
+
setConfirmOpen(false);
|
|
456
|
+
pendingEvent.current = null;
|
|
457
|
+
}
|
|
441
458
|
const buttonContent = /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
442
459
|
loading && loadingPosition === "left" && /* @__PURE__ */ jsx5("div", { className: "animate-spin mr-2", children: "\u27F3" }),
|
|
443
460
|
leftIcon && /* @__PURE__ */ jsx5("span", { className: "mr-2", children: leftIcon }),
|
|
@@ -462,22 +479,72 @@ var Button = React3.forwardRef(
|
|
|
462
479
|
tabIndex,
|
|
463
480
|
"data-testid": testID
|
|
464
481
|
};
|
|
482
|
+
const confirmModal = confirmBeforeClick && confirmOpen ? /* @__PURE__ */ jsxs5(
|
|
483
|
+
"div",
|
|
484
|
+
{
|
|
485
|
+
className: "fixed inset-0 z-50 flex items-center justify-center",
|
|
486
|
+
onClick: handleConfirmCancel,
|
|
487
|
+
children: [
|
|
488
|
+
/* @__PURE__ */ jsx5("div", { className: "absolute inset-0 bg-black/50 backdrop-blur-sm" }),
|
|
489
|
+
/* @__PURE__ */ jsxs5(
|
|
490
|
+
"div",
|
|
491
|
+
{
|
|
492
|
+
className: "relative z-10 w-full max-w-sm rounded-2xl border border-border bg-card p-6 shadow-2xl",
|
|
493
|
+
onClick: (e) => e.stopPropagation(),
|
|
494
|
+
children: [
|
|
495
|
+
/* @__PURE__ */ jsx5("p", { className: "text-base font-semibold text-foreground mb-2", children: confirmBeforeClickModalTitle ?? "Are you sure?" }),
|
|
496
|
+
confirmBeforeClickModalContent && /* @__PURE__ */ jsx5("div", { className: "text-sm text-muted-foreground mb-5", children: confirmBeforeClickModalContent }),
|
|
497
|
+
/* @__PURE__ */ jsx5("div", { className: "flex justify-end gap-2 mt-4", children: confirmBeforeClickFooterAction ?? /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
498
|
+
/* @__PURE__ */ jsx5(
|
|
499
|
+
"button",
|
|
500
|
+
{
|
|
501
|
+
type: "button",
|
|
502
|
+
onClick: handleConfirmCancel,
|
|
503
|
+
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",
|
|
504
|
+
children: "Cancel"
|
|
505
|
+
}
|
|
506
|
+
),
|
|
507
|
+
/* @__PURE__ */ jsx5(
|
|
508
|
+
"button",
|
|
509
|
+
{
|
|
510
|
+
type: "button",
|
|
511
|
+
onClick: handleConfirmProceed,
|
|
512
|
+
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",
|
|
513
|
+
children: "Proceed"
|
|
514
|
+
}
|
|
515
|
+
)
|
|
516
|
+
] }) })
|
|
517
|
+
]
|
|
518
|
+
}
|
|
519
|
+
)
|
|
520
|
+
]
|
|
521
|
+
}
|
|
522
|
+
) : null;
|
|
465
523
|
if (Element === "a") {
|
|
466
|
-
return /* @__PURE__ */
|
|
524
|
+
return /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
525
|
+
confirmModal,
|
|
526
|
+
/* @__PURE__ */ jsx5("a", { ...sharedProps, href, target, children: buttonContent })
|
|
527
|
+
] });
|
|
467
528
|
}
|
|
468
529
|
if (Element === "div") {
|
|
469
|
-
return /* @__PURE__ */
|
|
530
|
+
return /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
531
|
+
confirmModal,
|
|
532
|
+
/* @__PURE__ */ jsx5("div", { ...sharedProps, children: buttonContent })
|
|
533
|
+
] });
|
|
470
534
|
}
|
|
471
|
-
return /* @__PURE__ */
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
535
|
+
return /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
536
|
+
confirmModal,
|
|
537
|
+
/* @__PURE__ */ jsx5(
|
|
538
|
+
"button",
|
|
539
|
+
{
|
|
540
|
+
...sharedProps,
|
|
541
|
+
type,
|
|
542
|
+
disabled,
|
|
543
|
+
...props,
|
|
544
|
+
children: buttonContent
|
|
545
|
+
}
|
|
546
|
+
)
|
|
547
|
+
] });
|
|
481
548
|
}
|
|
482
549
|
);
|
|
483
550
|
Button.displayName = "Button";
|
|
@@ -1472,12 +1539,12 @@ function DonutChart({ data, color, height, showValues, unit }) {
|
|
|
1472
1539
|
const total = data.reduce((s, d) => s + d.value, 0) || 1;
|
|
1473
1540
|
const cx = 80, cy = height / 2, r = Math.min(cx, cy) - 10, inner = r * 0.58;
|
|
1474
1541
|
let angle = -Math.PI / 2;
|
|
1475
|
-
const
|
|
1542
|
+
const defaultColors2 = ["primary", "info", "success", "warning", "danger"];
|
|
1476
1543
|
const slices = data.map((d, i) => {
|
|
1477
1544
|
const sweep = d.value / total * 2 * Math.PI;
|
|
1478
1545
|
const start = angle;
|
|
1479
1546
|
angle += sweep;
|
|
1480
|
-
const c = d.color ??
|
|
1547
|
+
const c = d.color ?? defaultColors2[i % defaultColors2.length];
|
|
1481
1548
|
return { ...d, start, sweep, color: c };
|
|
1482
1549
|
});
|
|
1483
1550
|
const arc = (cx2, cy2, r2, start, end) => {
|
|
@@ -5240,8 +5307,8 @@ function Repeater({
|
|
|
5240
5307
|
}
|
|
5241
5308
|
|
|
5242
5309
|
// src/components/ui/panel.tsx
|
|
5243
|
-
import * as
|
|
5244
|
-
import { PanelLeftClose, PanelLeftOpen } from "lucide-react";
|
|
5310
|
+
import * as React32 from "react";
|
|
5311
|
+
import { PanelLeftClose, PanelLeftOpen, Sun as Sun2, Moon } from "lucide-react";
|
|
5245
5312
|
|
|
5246
5313
|
// src/components/ui/tooltip.tsx
|
|
5247
5314
|
import * as React30 from "react";
|
|
@@ -5321,9 +5388,59 @@ function Tooltip({
|
|
|
5321
5388
|
);
|
|
5322
5389
|
}
|
|
5323
5390
|
|
|
5391
|
+
// src/components/theme-provider.tsx
|
|
5392
|
+
import { createContext as createContext2, useContext as useContext2, useEffect as useEffect19, useState as useState25 } from "react";
|
|
5393
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
5394
|
+
var defaultColors = {
|
|
5395
|
+
primary: "#8b5cf6",
|
|
5396
|
+
primaryHover: "#7c3aed",
|
|
5397
|
+
secondary: "#171717",
|
|
5398
|
+
secondaryHover: "#262626",
|
|
5399
|
+
info: "#3b82f6",
|
|
5400
|
+
infoHover: "#2563eb",
|
|
5401
|
+
warning: "#f59e0b",
|
|
5402
|
+
warningHover: "#d97706",
|
|
5403
|
+
danger: "#ef4444",
|
|
5404
|
+
dangerHover: "#dc2626"
|
|
5405
|
+
};
|
|
5406
|
+
var initialState = {
|
|
5407
|
+
theme: "system",
|
|
5408
|
+
colors: defaultColors,
|
|
5409
|
+
fontSize: "16px",
|
|
5410
|
+
fontFamily: '"Space Grotesk", "Inter", sans-serif',
|
|
5411
|
+
setTheme: () => null,
|
|
5412
|
+
setColors: () => null,
|
|
5413
|
+
setFontSize: () => null,
|
|
5414
|
+
setFontFamily: () => null,
|
|
5415
|
+
resetSettings: () => null
|
|
5416
|
+
};
|
|
5417
|
+
var ThemeProviderContext = createContext2(initialState);
|
|
5418
|
+
var useTheme = () => {
|
|
5419
|
+
const context = useContext2(ThemeProviderContext);
|
|
5420
|
+
if (context === void 0)
|
|
5421
|
+
throw new Error("useTheme must be used within a ThemeProvider");
|
|
5422
|
+
return context;
|
|
5423
|
+
};
|
|
5424
|
+
|
|
5324
5425
|
// src/components/ui/panel.tsx
|
|
5325
|
-
import { jsx as
|
|
5326
|
-
var PanelCollapsedContext =
|
|
5426
|
+
import { jsx as jsx39, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
5427
|
+
var PanelCollapsedContext = React32.createContext(false);
|
|
5428
|
+
function PanelThemeToggle() {
|
|
5429
|
+
const { theme, setTheme } = useTheme();
|
|
5430
|
+
return /* @__PURE__ */ jsxs34(
|
|
5431
|
+
"button",
|
|
5432
|
+
{
|
|
5433
|
+
type: "button",
|
|
5434
|
+
onClick: () => setTheme(theme === "light" ? "dark" : "light"),
|
|
5435
|
+
className: "text-muted-foreground hover:text-foreground transition-colors",
|
|
5436
|
+
"aria-label": "Toggle theme",
|
|
5437
|
+
children: [
|
|
5438
|
+
/* @__PURE__ */ jsx39(Sun2, { className: "h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" }),
|
|
5439
|
+
/* @__PURE__ */ jsx39(Moon, { className: "absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" })
|
|
5440
|
+
]
|
|
5441
|
+
}
|
|
5442
|
+
);
|
|
5443
|
+
}
|
|
5327
5444
|
function Panel({
|
|
5328
5445
|
sidebar,
|
|
5329
5446
|
sidebarHeader,
|
|
@@ -5333,60 +5450,86 @@ function Panel({
|
|
|
5333
5450
|
topbarTrailing,
|
|
5334
5451
|
defaultCollapsed = false,
|
|
5335
5452
|
collapsible = false,
|
|
5453
|
+
showThemeToggle = false,
|
|
5454
|
+
defaultPage,
|
|
5336
5455
|
height = "h-[520px]",
|
|
5337
5456
|
children,
|
|
5338
5457
|
className
|
|
5339
5458
|
}) {
|
|
5340
|
-
const [collapsed, setCollapsed] =
|
|
5341
|
-
return /* @__PURE__ */
|
|
5459
|
+
const [collapsed, setCollapsed] = React32.useState(defaultCollapsed);
|
|
5460
|
+
return /* @__PURE__ */ jsx39(PanelCollapsedContext.Provider, { value: collapsed, children: /* @__PURE__ */ jsxs34(
|
|
5342
5461
|
"div",
|
|
5343
5462
|
{
|
|
5344
5463
|
className: cn(
|
|
5345
|
-
"flex overflow-hidden rounded-xl border border-border
|
|
5464
|
+
"relative flex overflow-hidden rounded-xl border border-border bg-background shadow-lg",
|
|
5346
5465
|
height,
|
|
5347
5466
|
className
|
|
5348
5467
|
),
|
|
5349
5468
|
children: [
|
|
5469
|
+
/* @__PURE__ */ jsxs34("div", { className: "pointer-events-none absolute inset-0 overflow-hidden", children: [
|
|
5470
|
+
/* @__PURE__ */ jsx39("div", { className: "absolute -top-[40%] -left-[20%] h-[80%] w-[60%] rounded-full bg-primary/10 blur-[120px]" }),
|
|
5471
|
+
/* @__PURE__ */ jsx39("div", { className: "absolute -bottom-[40%] -right-[20%] h-[80%] w-[60%] rounded-full bg-info/10 blur-[120px]" })
|
|
5472
|
+
] }),
|
|
5350
5473
|
sidebar && /* @__PURE__ */ jsxs34(
|
|
5351
5474
|
"aside",
|
|
5352
5475
|
{
|
|
5353
5476
|
className: cn(
|
|
5354
|
-
"flex flex-col shrink-0 border-r border-border transition-all duration-200",
|
|
5477
|
+
"relative z-10 flex flex-col shrink-0 border-r border-border transition-all duration-200",
|
|
5355
5478
|
collapsed ? "w-14" : sidebarWidth
|
|
5356
5479
|
),
|
|
5357
5480
|
children: [
|
|
5358
|
-
sidebarHeader &&
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
|
|
5481
|
+
sidebarHeader && /* @__PURE__ */ jsx39(
|
|
5482
|
+
"div",
|
|
5483
|
+
{
|
|
5484
|
+
className: cn(
|
|
5485
|
+
"shrink-0 border-b border-border",
|
|
5486
|
+
collapsed ? "flex items-center justify-center py-3" : "px-4 py-3 text-sm font-semibold"
|
|
5487
|
+
),
|
|
5488
|
+
children: sidebarHeader
|
|
5489
|
+
}
|
|
5490
|
+
),
|
|
5491
|
+
/* @__PURE__ */ jsx39("div", { className: "flex-1 overflow-y-auto py-2", children: sidebar }),
|
|
5492
|
+
sidebarFooter && /* @__PURE__ */ jsx39(
|
|
5493
|
+
"div",
|
|
5494
|
+
{
|
|
5495
|
+
className: cn(
|
|
5496
|
+
"shrink-0 border-t border-border",
|
|
5497
|
+
collapsed ? "flex items-center justify-center py-3" : "px-4 py-3"
|
|
5498
|
+
),
|
|
5499
|
+
children: !collapsed && sidebarFooter
|
|
5500
|
+
}
|
|
5501
|
+
)
|
|
5362
5502
|
]
|
|
5363
5503
|
}
|
|
5364
5504
|
),
|
|
5365
|
-
/* @__PURE__ */ jsxs34("div", { className: "flex flex-1 min-w-0 flex-col", children: [
|
|
5366
|
-
/* @__PURE__ */ jsxs34("header", { className: "flex h-
|
|
5505
|
+
/* @__PURE__ */ jsxs34("div", { className: "relative z-10 flex flex-1 min-w-0 flex-col", children: [
|
|
5506
|
+
/* @__PURE__ */ jsxs34("header", { className: "flex h-14 shrink-0 items-center justify-between border-b glass px-4 gap-2", children: [
|
|
5367
5507
|
/* @__PURE__ */ jsxs34("div", { className: "flex items-center gap-2", children: [
|
|
5368
|
-
collapsible && sidebar && /* @__PURE__ */
|
|
5508
|
+
collapsible && sidebar && /* @__PURE__ */ jsx39(
|
|
5369
5509
|
Tooltip,
|
|
5370
5510
|
{
|
|
5371
5511
|
content: collapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
5372
5512
|
side: "bottom",
|
|
5373
|
-
children: /* @__PURE__ */
|
|
5513
|
+
children: /* @__PURE__ */ jsx39(
|
|
5374
5514
|
"button",
|
|
5375
5515
|
{
|
|
5376
5516
|
type: "button",
|
|
5377
5517
|
onClick: () => setCollapsed((c) => !c),
|
|
5378
5518
|
className: "text-muted-foreground hover:text-foreground transition-colors",
|
|
5379
5519
|
"aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
5380
|
-
children: collapsed ? /* @__PURE__ */
|
|
5520
|
+
children: collapsed ? /* @__PURE__ */ jsx39(PanelLeftOpen, { className: "h-5 w-5" }) : /* @__PURE__ */ jsx39(PanelLeftClose, { className: "h-5 w-5" })
|
|
5381
5521
|
}
|
|
5382
5522
|
)
|
|
5383
5523
|
}
|
|
5384
5524
|
),
|
|
5385
|
-
topbar && /* @__PURE__ */
|
|
5525
|
+
topbar && /* @__PURE__ */ jsx39("div", { className: "flex items-center gap-2", children: topbar })
|
|
5386
5526
|
] }),
|
|
5387
|
-
|
|
5527
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex items-center gap-2", children: [
|
|
5528
|
+
topbarTrailing,
|
|
5529
|
+
showThemeToggle && /* @__PURE__ */ jsx39(PanelThemeToggle, {})
|
|
5530
|
+
] })
|
|
5388
5531
|
] }),
|
|
5389
|
-
/* @__PURE__ */
|
|
5532
|
+
/* @__PURE__ */ jsx39("main", { className: "flex-1 overflow-y-auto p-4", children })
|
|
5390
5533
|
] })
|
|
5391
5534
|
]
|
|
5392
5535
|
}
|
|
@@ -5398,8 +5541,8 @@ function PanelSidebarItem({
|
|
|
5398
5541
|
active,
|
|
5399
5542
|
onClick
|
|
5400
5543
|
}) {
|
|
5401
|
-
const collapsed =
|
|
5402
|
-
return /* @__PURE__ */
|
|
5544
|
+
const collapsed = React32.useContext(PanelCollapsedContext);
|
|
5545
|
+
return /* @__PURE__ */ jsx39(Tooltip, { content: label, side: "right", enabled: collapsed, children: /* @__PURE__ */ jsxs34(
|
|
5403
5546
|
"button",
|
|
5404
5547
|
{
|
|
5405
5548
|
type: "button",
|
|
@@ -5410,8 +5553,8 @@ function PanelSidebarItem({
|
|
|
5410
5553
|
active ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-primary/20 hover:text-primary cursor-pointer"
|
|
5411
5554
|
),
|
|
5412
5555
|
children: [
|
|
5413
|
-
Icon && /* @__PURE__ */
|
|
5414
|
-
!collapsed && /* @__PURE__ */
|
|
5556
|
+
Icon && /* @__PURE__ */ jsx39(Icon, { className: "h-4 w-4 shrink-0" }),
|
|
5557
|
+
!collapsed && /* @__PURE__ */ jsx39("span", { className: "truncate", children: label })
|
|
5415
5558
|
]
|
|
5416
5559
|
}
|
|
5417
5560
|
) });
|
|
@@ -5420,17 +5563,17 @@ function PanelSidebarGroup({
|
|
|
5420
5563
|
title,
|
|
5421
5564
|
children
|
|
5422
5565
|
}) {
|
|
5423
|
-
const collapsed =
|
|
5566
|
+
const collapsed = React32.useContext(PanelCollapsedContext);
|
|
5424
5567
|
return /* @__PURE__ */ jsxs34("div", { className: "px-2 py-1", children: [
|
|
5425
|
-
title && !collapsed && /* @__PURE__ */
|
|
5426
|
-
title && collapsed && /* @__PURE__ */
|
|
5427
|
-
/* @__PURE__ */
|
|
5568
|
+
title && !collapsed && /* @__PURE__ */ jsx39("p", { className: "mb-1 px-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground", children: title }),
|
|
5569
|
+
title && collapsed && /* @__PURE__ */ jsx39("div", { className: "mx-1 mb-1 h-px bg-border" }),
|
|
5570
|
+
/* @__PURE__ */ jsx39("main", { className: "space-y-0.5", children })
|
|
5428
5571
|
] });
|
|
5429
5572
|
}
|
|
5430
5573
|
|
|
5431
5574
|
// src/components/ui/resizable-panels.tsx
|
|
5432
|
-
import * as
|
|
5433
|
-
import { jsx as
|
|
5575
|
+
import * as React33 from "react";
|
|
5576
|
+
import { jsx as jsx40, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
5434
5577
|
function ResizablePanels({
|
|
5435
5578
|
children,
|
|
5436
5579
|
orientation = "horizontal",
|
|
@@ -5440,15 +5583,15 @@ function ResizablePanels({
|
|
|
5440
5583
|
handleClassName,
|
|
5441
5584
|
className
|
|
5442
5585
|
}) {
|
|
5443
|
-
const [size, setSize] =
|
|
5444
|
-
const [dragging, setDragging] =
|
|
5445
|
-
const containerRef =
|
|
5586
|
+
const [size, setSize] = React33.useState(defaultSize);
|
|
5587
|
+
const [dragging, setDragging] = React33.useState(false);
|
|
5588
|
+
const containerRef = React33.useRef(null);
|
|
5446
5589
|
const isHorizontal = orientation === "horizontal";
|
|
5447
5590
|
function onMouseDown(e) {
|
|
5448
5591
|
e.preventDefault();
|
|
5449
5592
|
setDragging(true);
|
|
5450
5593
|
}
|
|
5451
|
-
|
|
5594
|
+
React33.useEffect(() => {
|
|
5452
5595
|
if (!dragging) return;
|
|
5453
5596
|
function onMove(e) {
|
|
5454
5597
|
const container = containerRef.current;
|
|
@@ -5478,7 +5621,7 @@ function ResizablePanels({
|
|
|
5478
5621
|
className
|
|
5479
5622
|
),
|
|
5480
5623
|
children: [
|
|
5481
|
-
/* @__PURE__ */
|
|
5624
|
+
/* @__PURE__ */ jsx40(
|
|
5482
5625
|
"div",
|
|
5483
5626
|
{
|
|
5484
5627
|
className: "overflow-auto",
|
|
@@ -5486,7 +5629,7 @@ function ResizablePanels({
|
|
|
5486
5629
|
children: children[0]
|
|
5487
5630
|
}
|
|
5488
5631
|
),
|
|
5489
|
-
/* @__PURE__ */
|
|
5632
|
+
/* @__PURE__ */ jsx40(
|
|
5490
5633
|
"div",
|
|
5491
5634
|
{
|
|
5492
5635
|
onMouseDown,
|
|
@@ -5496,13 +5639,13 @@ function ResizablePanels({
|
|
|
5496
5639
|
dragging && (isHorizontal ? "w-1.5 bg-primary/60" : "h-1.5 bg-primary/60"),
|
|
5497
5640
|
handleClassName
|
|
5498
5641
|
),
|
|
5499
|
-
children: /* @__PURE__ */
|
|
5642
|
+
children: /* @__PURE__ */ jsx40("div", { className: cn(
|
|
5500
5643
|
"rounded-full bg-muted-foreground/40",
|
|
5501
5644
|
isHorizontal ? "h-8 w-0.5" : "w-8 h-0.5"
|
|
5502
5645
|
) })
|
|
5503
5646
|
}
|
|
5504
5647
|
),
|
|
5505
|
-
/* @__PURE__ */
|
|
5648
|
+
/* @__PURE__ */ jsx40(
|
|
5506
5649
|
"div",
|
|
5507
5650
|
{
|
|
5508
5651
|
className: "flex-1 overflow-auto",
|
|
@@ -5516,26 +5659,26 @@ function ResizablePanels({
|
|
|
5516
5659
|
}
|
|
5517
5660
|
|
|
5518
5661
|
// src/components/ui/rich-text-editor.tsx
|
|
5519
|
-
import * as
|
|
5662
|
+
import * as React34 from "react";
|
|
5520
5663
|
import { Bold, Italic, Underline, List, ListOrdered, Link, Heading2, Heading3, Quote, Code, Undo, Redo } from "lucide-react";
|
|
5521
|
-
import { jsx as
|
|
5664
|
+
import { jsx as jsx41, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
5522
5665
|
var TOOLBAR = [
|
|
5523
|
-
{ icon: /* @__PURE__ */
|
|
5524
|
-
{ icon: /* @__PURE__ */
|
|
5666
|
+
{ icon: /* @__PURE__ */ jsx41(Undo, { className: "h-3.5 w-3.5" }), command: "undo", title: "Undo" },
|
|
5667
|
+
{ icon: /* @__PURE__ */ jsx41(Redo, { className: "h-3.5 w-3.5" }), command: "redo", title: "Redo" },
|
|
5525
5668
|
"divider",
|
|
5526
|
-
{ icon: /* @__PURE__ */
|
|
5527
|
-
{ icon: /* @__PURE__ */
|
|
5669
|
+
{ icon: /* @__PURE__ */ jsx41(Heading2, { className: "h-3.5 w-3.5" }), command: "formatBlock", value: "h2", title: "Heading 2" },
|
|
5670
|
+
{ icon: /* @__PURE__ */ jsx41(Heading3, { className: "h-3.5 w-3.5" }), command: "formatBlock", value: "h3", title: "Heading 3" },
|
|
5528
5671
|
"divider",
|
|
5529
|
-
{ icon: /* @__PURE__ */
|
|
5530
|
-
{ icon: /* @__PURE__ */
|
|
5531
|
-
{ icon: /* @__PURE__ */
|
|
5532
|
-
{ icon: /* @__PURE__ */
|
|
5672
|
+
{ icon: /* @__PURE__ */ jsx41(Bold, { className: "h-3.5 w-3.5" }), command: "bold", title: "Bold" },
|
|
5673
|
+
{ icon: /* @__PURE__ */ jsx41(Italic, { className: "h-3.5 w-3.5" }), command: "italic", title: "Italic" },
|
|
5674
|
+
{ icon: /* @__PURE__ */ jsx41(Underline, { className: "h-3.5 w-3.5" }), command: "underline", title: "Underline" },
|
|
5675
|
+
{ icon: /* @__PURE__ */ jsx41(Code, { className: "h-3.5 w-3.5" }), command: "formatBlock", value: "pre", title: "Code block" },
|
|
5533
5676
|
"divider",
|
|
5534
|
-
{ icon: /* @__PURE__ */
|
|
5535
|
-
{ icon: /* @__PURE__ */
|
|
5536
|
-
{ icon: /* @__PURE__ */
|
|
5677
|
+
{ icon: /* @__PURE__ */ jsx41(List, { className: "h-3.5 w-3.5" }), command: "insertUnorderedList", title: "Bullet list" },
|
|
5678
|
+
{ icon: /* @__PURE__ */ jsx41(ListOrdered, { className: "h-3.5 w-3.5" }), command: "insertOrderedList", title: "Numbered list" },
|
|
5679
|
+
{ icon: /* @__PURE__ */ jsx41(Quote, { className: "h-3.5 w-3.5" }), command: "formatBlock", value: "blockquote", title: "Quote" },
|
|
5537
5680
|
"divider",
|
|
5538
|
-
{ icon: /* @__PURE__ */
|
|
5681
|
+
{ icon: /* @__PURE__ */ jsx41(Link, { className: "h-3.5 w-3.5" }), command: "createLink", title: "Insert link" }
|
|
5539
5682
|
];
|
|
5540
5683
|
function RichTextEditor({
|
|
5541
5684
|
value: controlled,
|
|
@@ -5546,17 +5689,17 @@ function RichTextEditor({
|
|
|
5546
5689
|
disabled = false,
|
|
5547
5690
|
className
|
|
5548
5691
|
}) {
|
|
5549
|
-
const editorRef =
|
|
5550
|
-
const [focused, setFocused] =
|
|
5551
|
-
const [isEmpty, setIsEmpty] =
|
|
5552
|
-
|
|
5692
|
+
const editorRef = React34.useRef(null);
|
|
5693
|
+
const [focused, setFocused] = React34.useState(false);
|
|
5694
|
+
const [isEmpty, setIsEmpty] = React34.useState(!defaultValue);
|
|
5695
|
+
React34.useEffect(() => {
|
|
5553
5696
|
if (editorRef.current && controlled !== void 0) {
|
|
5554
5697
|
if (editorRef.current.innerHTML !== controlled) {
|
|
5555
5698
|
editorRef.current.innerHTML = controlled;
|
|
5556
5699
|
}
|
|
5557
5700
|
}
|
|
5558
5701
|
}, [controlled]);
|
|
5559
|
-
|
|
5702
|
+
React34.useEffect(() => {
|
|
5560
5703
|
if (editorRef.current && defaultValue) {
|
|
5561
5704
|
editorRef.current.innerHTML = defaultValue;
|
|
5562
5705
|
setIsEmpty(false);
|
|
@@ -5590,8 +5733,8 @@ function RichTextEditor({
|
|
|
5590
5733
|
disabled && "opacity-50 pointer-events-none",
|
|
5591
5734
|
className
|
|
5592
5735
|
), children: [
|
|
5593
|
-
/* @__PURE__ */
|
|
5594
|
-
(item, i) => item === "divider" ? /* @__PURE__ */
|
|
5736
|
+
/* @__PURE__ */ jsx41("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(
|
|
5737
|
+
(item, i) => item === "divider" ? /* @__PURE__ */ jsx41("span", { className: "mx-1 h-4 w-px bg-border" }, i) : /* @__PURE__ */ jsx41(
|
|
5595
5738
|
"button",
|
|
5596
5739
|
{
|
|
5597
5740
|
type: "button",
|
|
@@ -5610,8 +5753,8 @@ function RichTextEditor({
|
|
|
5610
5753
|
)
|
|
5611
5754
|
) }),
|
|
5612
5755
|
/* @__PURE__ */ jsxs36("div", { className: "relative", children: [
|
|
5613
|
-
isEmpty && !focused && /* @__PURE__ */
|
|
5614
|
-
/* @__PURE__ */
|
|
5756
|
+
isEmpty && !focused && /* @__PURE__ */ jsx41("p", { className: "absolute top-3 left-4 text-sm text-muted-foreground pointer-events-none select-none", children: placeholder }),
|
|
5757
|
+
/* @__PURE__ */ jsx41(
|
|
5615
5758
|
"div",
|
|
5616
5759
|
{
|
|
5617
5760
|
ref: editorRef,
|
|
@@ -5638,7 +5781,7 @@ function RichTextEditor({
|
|
|
5638
5781
|
}
|
|
5639
5782
|
|
|
5640
5783
|
// src/components/ui/scroll-area.tsx
|
|
5641
|
-
import { jsx as
|
|
5784
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
5642
5785
|
function ScrollArea({
|
|
5643
5786
|
maxHeight,
|
|
5644
5787
|
maxWidth,
|
|
@@ -5653,7 +5796,7 @@ function ScrollArea({
|
|
|
5653
5796
|
horizontal: "overflow-x-auto overflow-y-hidden",
|
|
5654
5797
|
both: "overflow-auto"
|
|
5655
5798
|
}[orientation];
|
|
5656
|
-
return /* @__PURE__ */
|
|
5799
|
+
return /* @__PURE__ */ jsx42(
|
|
5657
5800
|
"div",
|
|
5658
5801
|
{
|
|
5659
5802
|
className: cn(
|
|
@@ -5673,9 +5816,9 @@ function ScrollArea({
|
|
|
5673
5816
|
}
|
|
5674
5817
|
|
|
5675
5818
|
// src/components/ui/section.tsx
|
|
5676
|
-
import * as
|
|
5819
|
+
import * as React35 from "react";
|
|
5677
5820
|
import { ChevronDown as ChevronDown6 } from "lucide-react";
|
|
5678
|
-
import { jsx as
|
|
5821
|
+
import { jsx as jsx43, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
5679
5822
|
var variantWrap = {
|
|
5680
5823
|
default: "",
|
|
5681
5824
|
card: "rounded-xl glass shadow-lg overflow-hidden",
|
|
@@ -5707,7 +5850,7 @@ function SectionBlock({
|
|
|
5707
5850
|
className,
|
|
5708
5851
|
contentClassName
|
|
5709
5852
|
}) {
|
|
5710
|
-
const [open, setOpen] =
|
|
5853
|
+
const [open, setOpen] = React35.useState(defaultOpen);
|
|
5711
5854
|
return /* @__PURE__ */ jsxs37("div", { className: cn(variantWrap[variant], className), children: [
|
|
5712
5855
|
(title || description || action) && /* @__PURE__ */ jsxs37(
|
|
5713
5856
|
"div",
|
|
@@ -5721,15 +5864,15 @@ function SectionBlock({
|
|
|
5721
5864
|
onClick: collapsible ? () => setOpen((o) => !o) : void 0,
|
|
5722
5865
|
children: [
|
|
5723
5866
|
/* @__PURE__ */ jsxs37("div", { className: "flex items-start gap-3 min-w-0", children: [
|
|
5724
|
-
icon && /* @__PURE__ */
|
|
5867
|
+
icon && /* @__PURE__ */ jsx43("span", { className: "mt-0.5 shrink-0 text-primary", children: icon }),
|
|
5725
5868
|
/* @__PURE__ */ jsxs37("div", { className: "min-w-0", children: [
|
|
5726
|
-
title && /* @__PURE__ */
|
|
5727
|
-
description && /* @__PURE__ */
|
|
5869
|
+
title && /* @__PURE__ */ jsx43("h3", { className: "text-base font-semibold leading-tight", children: title }),
|
|
5870
|
+
description && /* @__PURE__ */ jsx43("p", { className: "mt-0.5 text-sm text-muted-foreground", children: description })
|
|
5728
5871
|
] })
|
|
5729
5872
|
] }),
|
|
5730
5873
|
/* @__PURE__ */ jsxs37("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
5731
|
-
action && /* @__PURE__ */
|
|
5732
|
-
collapsible && /* @__PURE__ */
|
|
5874
|
+
action && /* @__PURE__ */ jsx43("div", { onClick: (e) => e.stopPropagation(), children: action }),
|
|
5875
|
+
collapsible && /* @__PURE__ */ jsx43(
|
|
5733
5876
|
ChevronDown6,
|
|
5734
5877
|
{
|
|
5735
5878
|
className: cn(
|
|
@@ -5742,17 +5885,17 @@ function SectionBlock({
|
|
|
5742
5885
|
]
|
|
5743
5886
|
}
|
|
5744
5887
|
),
|
|
5745
|
-
(!collapsible || open) && /* @__PURE__ */
|
|
5888
|
+
(!collapsible || open) && /* @__PURE__ */ jsx43("div", { className: cn(variantBody[variant], contentClassName), children })
|
|
5746
5889
|
] });
|
|
5747
5890
|
}
|
|
5748
5891
|
|
|
5749
5892
|
// src/components/ui/skeleton.tsx
|
|
5750
|
-
import { jsx as
|
|
5893
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
5751
5894
|
function Skeleton({
|
|
5752
5895
|
className,
|
|
5753
5896
|
...props
|
|
5754
5897
|
}) {
|
|
5755
|
-
return /* @__PURE__ */
|
|
5898
|
+
return /* @__PURE__ */ jsx44(
|
|
5756
5899
|
"div",
|
|
5757
5900
|
{
|
|
5758
5901
|
className: cn("animate-pulse rounded-md bg-white/5 backdrop-blur-sm", className),
|
|
@@ -5762,8 +5905,8 @@ function Skeleton({
|
|
|
5762
5905
|
}
|
|
5763
5906
|
|
|
5764
5907
|
// src/components/ui/slider.tsx
|
|
5765
|
-
import * as
|
|
5766
|
-
import { jsx as
|
|
5908
|
+
import * as React36 from "react";
|
|
5909
|
+
import { jsx as jsx45, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
5767
5910
|
function pct(val, min, max) {
|
|
5768
5911
|
return (val - min) / (max - min) * 100;
|
|
5769
5912
|
}
|
|
@@ -5782,8 +5925,8 @@ function Slider({
|
|
|
5782
5925
|
showValue = false,
|
|
5783
5926
|
className
|
|
5784
5927
|
}) {
|
|
5785
|
-
const [internal, setInternal] =
|
|
5786
|
-
const [hovering, setHovering] =
|
|
5928
|
+
const [internal, setInternal] = React36.useState(defaultValue);
|
|
5929
|
+
const [hovering, setHovering] = React36.useState(false);
|
|
5787
5930
|
const val = controlled ?? internal;
|
|
5788
5931
|
function handleChange(e) {
|
|
5789
5932
|
const v = Number(e.target.value);
|
|
@@ -5793,8 +5936,8 @@ function Slider({
|
|
|
5793
5936
|
const p = pct(val, min, max);
|
|
5794
5937
|
return /* @__PURE__ */ jsxs38("div", { className: cn("w-full space-y-2", className), children: [
|
|
5795
5938
|
(label || showValue) && /* @__PURE__ */ jsxs38("div", { className: "flex items-center justify-between text-sm", children: [
|
|
5796
|
-
label && /* @__PURE__ */
|
|
5797
|
-
showValue && /* @__PURE__ */
|
|
5939
|
+
label && /* @__PURE__ */ jsx45("span", { className: "font-medium", children: label }),
|
|
5940
|
+
showValue && /* @__PURE__ */ jsx45("span", { className: "text-muted-foreground tabular-nums", children: val })
|
|
5798
5941
|
] }),
|
|
5799
5942
|
/* @__PURE__ */ jsxs38(
|
|
5800
5943
|
"div",
|
|
@@ -5803,8 +5946,8 @@ function Slider({
|
|
|
5803
5946
|
onMouseEnter: () => setHovering(true),
|
|
5804
5947
|
onMouseLeave: () => setHovering(false),
|
|
5805
5948
|
children: [
|
|
5806
|
-
/* @__PURE__ */
|
|
5807
|
-
showTooltip && hovering && !disabled && /* @__PURE__ */
|
|
5949
|
+
/* @__PURE__ */ jsx45("div", { className: "absolute w-full h-1.5 rounded-full bg-muted overflow-hidden", children: /* @__PURE__ */ jsx45("div", { className: "h-full rounded-full bg-primary", style: { width: `${p}%` } }) }),
|
|
5950
|
+
showTooltip && hovering && !disabled && /* @__PURE__ */ jsx45(
|
|
5808
5951
|
"div",
|
|
5809
5952
|
{
|
|
5810
5953
|
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",
|
|
@@ -5812,7 +5955,7 @@ function Slider({
|
|
|
5812
5955
|
children: val
|
|
5813
5956
|
}
|
|
5814
5957
|
),
|
|
5815
|
-
/* @__PURE__ */
|
|
5958
|
+
/* @__PURE__ */ jsx45(
|
|
5816
5959
|
"input",
|
|
5817
5960
|
{
|
|
5818
5961
|
type: "range",
|
|
@@ -5828,7 +5971,7 @@ function Slider({
|
|
|
5828
5971
|
)
|
|
5829
5972
|
}
|
|
5830
5973
|
),
|
|
5831
|
-
/* @__PURE__ */
|
|
5974
|
+
/* @__PURE__ */ jsx45(
|
|
5832
5975
|
"div",
|
|
5833
5976
|
{
|
|
5834
5977
|
className: cn(
|
|
@@ -5841,9 +5984,9 @@ function Slider({
|
|
|
5841
5984
|
]
|
|
5842
5985
|
}
|
|
5843
5986
|
),
|
|
5844
|
-
(showMarks || marks) && /* @__PURE__ */
|
|
5845
|
-
/* @__PURE__ */
|
|
5846
|
-
m.label && /* @__PURE__ */
|
|
5987
|
+
(showMarks || marks) && /* @__PURE__ */ jsx45("div", { className: "relative w-full flex justify-between px-0", children: (marks ?? [{ value: min }, { value: max }]).map((m) => /* @__PURE__ */ jsxs38("div", { className: "flex flex-col items-center gap-0.5", style: { position: "absolute", left: `${pct(m.value, min, max)}%`, transform: "translateX(-50%)" }, children: [
|
|
5988
|
+
/* @__PURE__ */ jsx45("span", { className: "h-1 w-0.5 bg-border" }),
|
|
5989
|
+
m.label && /* @__PURE__ */ jsx45("span", { className: "text-[10px] text-muted-foreground", children: m.label })
|
|
5847
5990
|
] }, m.value)) })
|
|
5848
5991
|
] });
|
|
5849
5992
|
}
|
|
@@ -5860,8 +6003,8 @@ function RangeSlider({
|
|
|
5860
6003
|
showValue = false,
|
|
5861
6004
|
className
|
|
5862
6005
|
}) {
|
|
5863
|
-
const [internal, setInternal] =
|
|
5864
|
-
const [active, setActive] =
|
|
6006
|
+
const [internal, setInternal] = React36.useState(defaultValue);
|
|
6007
|
+
const [active, setActive] = React36.useState(null);
|
|
5865
6008
|
const val = controlled ?? internal;
|
|
5866
6009
|
function handleChange(idx, e) {
|
|
5867
6010
|
const v = Number(e.target.value);
|
|
@@ -5873,7 +6016,7 @@ function RangeSlider({
|
|
|
5873
6016
|
const p1 = pct(val[1], min, max);
|
|
5874
6017
|
return /* @__PURE__ */ jsxs38("div", { className: cn("w-full space-y-2", className), children: [
|
|
5875
6018
|
(label || showValue) && /* @__PURE__ */ jsxs38("div", { className: "flex items-center justify-between text-sm", children: [
|
|
5876
|
-
label && /* @__PURE__ */
|
|
6019
|
+
label && /* @__PURE__ */ jsx45("span", { className: "font-medium", children: label }),
|
|
5877
6020
|
showValue && /* @__PURE__ */ jsxs38("span", { className: "text-muted-foreground tabular-nums", children: [
|
|
5878
6021
|
val[0],
|
|
5879
6022
|
" \u2013 ",
|
|
@@ -5881,11 +6024,11 @@ function RangeSlider({
|
|
|
5881
6024
|
] })
|
|
5882
6025
|
] }),
|
|
5883
6026
|
/* @__PURE__ */ jsxs38("div", { className: "relative flex items-center h-5", children: [
|
|
5884
|
-
/* @__PURE__ */
|
|
6027
|
+
/* @__PURE__ */ jsx45("div", { className: "absolute w-full h-1.5 rounded-full bg-muted", children: /* @__PURE__ */ jsx45("div", { className: "absolute h-full rounded-full bg-primary", style: { left: `${p0}%`, width: `${p1 - p0}%` } }) }),
|
|
5885
6028
|
[0, 1].map((idx) => {
|
|
5886
6029
|
const p = idx === 0 ? p0 : p1;
|
|
5887
|
-
return /* @__PURE__ */ jsxs38(
|
|
5888
|
-
showTooltip && active === idx && !disabled && /* @__PURE__ */
|
|
6030
|
+
return /* @__PURE__ */ jsxs38(React36.Fragment, { children: [
|
|
6031
|
+
showTooltip && active === idx && !disabled && /* @__PURE__ */ jsx45(
|
|
5889
6032
|
"div",
|
|
5890
6033
|
{
|
|
5891
6034
|
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",
|
|
@@ -5893,7 +6036,7 @@ function RangeSlider({
|
|
|
5893
6036
|
children: val[idx]
|
|
5894
6037
|
}
|
|
5895
6038
|
),
|
|
5896
|
-
/* @__PURE__ */
|
|
6039
|
+
/* @__PURE__ */ jsx45(
|
|
5897
6040
|
"input",
|
|
5898
6041
|
{
|
|
5899
6042
|
type: "range",
|
|
@@ -5909,7 +6052,7 @@ function RangeSlider({
|
|
|
5909
6052
|
style: { zIndex: idx === 1 ? 2 : 1 }
|
|
5910
6053
|
}
|
|
5911
6054
|
),
|
|
5912
|
-
/* @__PURE__ */
|
|
6055
|
+
/* @__PURE__ */ jsx45(
|
|
5913
6056
|
"div",
|
|
5914
6057
|
{
|
|
5915
6058
|
className: "absolute h-4 w-4 rounded-full border-2 border-primary bg-background shadow-md pointer-events-none",
|
|
@@ -5924,7 +6067,7 @@ function RangeSlider({
|
|
|
5924
6067
|
|
|
5925
6068
|
// src/components/ui/stat-card.tsx
|
|
5926
6069
|
import { TrendingUp, TrendingDown, Minus } from "lucide-react";
|
|
5927
|
-
import { jsx as
|
|
6070
|
+
import { jsx as jsx46, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
5928
6071
|
function Sparkline2({ data, trend }) {
|
|
5929
6072
|
if (data.length < 2) return null;
|
|
5930
6073
|
const min = Math.min(...data);
|
|
@@ -5938,7 +6081,7 @@ function Sparkline2({ data, trend }) {
|
|
|
5938
6081
|
return `${x},${y}`;
|
|
5939
6082
|
}).join(" ");
|
|
5940
6083
|
const color = trend === "up" ? "stroke-success" : trend === "down" ? "stroke-danger" : "stroke-primary";
|
|
5941
|
-
return /* @__PURE__ */
|
|
6084
|
+
return /* @__PURE__ */ jsx46("svg", { width: w, height: h, className: "overflow-visible", children: /* @__PURE__ */ jsx46(
|
|
5942
6085
|
"polyline",
|
|
5943
6086
|
{
|
|
5944
6087
|
points: pts,
|
|
@@ -5967,37 +6110,37 @@ function StatCard({
|
|
|
5967
6110
|
const trendColor = autoTrend === "up" ? "text-success" : autoTrend === "down" ? "text-danger" : "text-muted-foreground";
|
|
5968
6111
|
if (loading) {
|
|
5969
6112
|
return /* @__PURE__ */ jsxs39("div", { className: cn("rounded-xl glass p-5 space-y-3 animate-pulse", className), children: [
|
|
5970
|
-
/* @__PURE__ */
|
|
5971
|
-
/* @__PURE__ */
|
|
5972
|
-
/* @__PURE__ */
|
|
6113
|
+
/* @__PURE__ */ jsx46("div", { className: "h-3 w-24 rounded bg-muted" }),
|
|
6114
|
+
/* @__PURE__ */ jsx46("div", { className: "h-7 w-32 rounded bg-muted" }),
|
|
6115
|
+
/* @__PURE__ */ jsx46("div", { className: "h-3 w-16 rounded bg-muted" })
|
|
5973
6116
|
] });
|
|
5974
6117
|
}
|
|
5975
6118
|
return /* @__PURE__ */ jsxs39("div", { className: cn("rounded-xl glass p-5 space-y-3", className), children: [
|
|
5976
6119
|
/* @__PURE__ */ jsxs39("div", { className: "flex items-start justify-between gap-2", children: [
|
|
5977
|
-
/* @__PURE__ */
|
|
5978
|
-
icon && /* @__PURE__ */
|
|
6120
|
+
/* @__PURE__ */ jsx46("p", { className: "text-sm text-muted-foreground font-medium", children: title }),
|
|
6121
|
+
icon && /* @__PURE__ */ jsx46("span", { className: "flex h-9 w-9 items-center justify-center rounded-lg bg-primary/10 text-primary shrink-0", children: icon })
|
|
5979
6122
|
] }),
|
|
5980
6123
|
/* @__PURE__ */ jsxs39("div", { className: "flex items-end justify-between gap-2", children: [
|
|
5981
|
-
/* @__PURE__ */
|
|
5982
|
-
sparkline && /* @__PURE__ */
|
|
6124
|
+
/* @__PURE__ */ jsx46("p", { className: "text-3xl font-bold tracking-tight", children: value }),
|
|
6125
|
+
sparkline && /* @__PURE__ */ jsx46(Sparkline2, { data: sparkline, trend: autoTrend })
|
|
5983
6126
|
] }),
|
|
5984
6127
|
/* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-1.5", children: [
|
|
5985
6128
|
change !== void 0 && /* @__PURE__ */ jsxs39("span", { className: cn("flex items-center gap-0.5 text-xs font-semibold", trendColor), children: [
|
|
5986
|
-
/* @__PURE__ */
|
|
6129
|
+
/* @__PURE__ */ jsx46(TrendIcon, { className: "h-3.5 w-3.5" }),
|
|
5987
6130
|
change > 0 ? "+" : "",
|
|
5988
6131
|
change,
|
|
5989
6132
|
"%"
|
|
5990
6133
|
] }),
|
|
5991
|
-
changeLabel && /* @__PURE__ */
|
|
5992
|
-
description && !changeLabel && /* @__PURE__ */
|
|
6134
|
+
changeLabel && /* @__PURE__ */ jsx46("span", { className: "text-xs text-muted-foreground", children: changeLabel }),
|
|
6135
|
+
description && !changeLabel && /* @__PURE__ */ jsx46("span", { className: "text-xs text-muted-foreground", children: description })
|
|
5993
6136
|
] })
|
|
5994
6137
|
] });
|
|
5995
6138
|
}
|
|
5996
6139
|
|
|
5997
6140
|
// src/components/ui/stepper.tsx
|
|
5998
|
-
import * as
|
|
6141
|
+
import * as React37 from "react";
|
|
5999
6142
|
import { Check as Check6, X as X10 } from "lucide-react";
|
|
6000
|
-
import { jsx as
|
|
6143
|
+
import { jsx as jsx47, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
6001
6144
|
function getStatus(idx, current) {
|
|
6002
6145
|
if (idx < current) return "complete";
|
|
6003
6146
|
if (idx === current) return "current";
|
|
@@ -6018,7 +6161,7 @@ function Stepper({
|
|
|
6018
6161
|
clickable = false,
|
|
6019
6162
|
className
|
|
6020
6163
|
}) {
|
|
6021
|
-
const [internal, setInternal] =
|
|
6164
|
+
const [internal, setInternal] = React37.useState(defaultCurrent);
|
|
6022
6165
|
const current = controlled ?? internal;
|
|
6023
6166
|
function go(idx) {
|
|
6024
6167
|
if (!clickable) return;
|
|
@@ -6027,19 +6170,19 @@ function Stepper({
|
|
|
6027
6170
|
}
|
|
6028
6171
|
const isHorizontal = orientation === "horizontal";
|
|
6029
6172
|
return /* @__PURE__ */ jsxs40("div", { className: cn("w-full", className), children: [
|
|
6030
|
-
/* @__PURE__ */
|
|
6173
|
+
/* @__PURE__ */ jsx47("div", { className: cn(
|
|
6031
6174
|
"flex",
|
|
6032
6175
|
isHorizontal ? "flex-row items-start" : "flex-col gap-0"
|
|
6033
6176
|
), children: steps.map((step, i) => {
|
|
6034
6177
|
const status = getStatus(i, current);
|
|
6035
6178
|
const isLast = i === steps.length - 1;
|
|
6036
|
-
return /* @__PURE__ */
|
|
6179
|
+
return /* @__PURE__ */ jsx47(React37.Fragment, { children: /* @__PURE__ */ jsxs40("div", { className: cn(
|
|
6037
6180
|
"flex",
|
|
6038
6181
|
isHorizontal ? "flex-col items-center flex-1" : "flex-row gap-4"
|
|
6039
6182
|
), children: [
|
|
6040
6183
|
/* @__PURE__ */ jsxs40("div", { className: cn("flex items-center", isHorizontal ? "w-full" : "flex-col"), children: [
|
|
6041
|
-
isHorizontal && i > 0 && /* @__PURE__ */
|
|
6042
|
-
/* @__PURE__ */
|
|
6184
|
+
isHorizontal && i > 0 && /* @__PURE__ */ jsx47("div", { className: cn("flex-1 h-0.5 transition-colors", i <= current ? "bg-primary" : "bg-border") }),
|
|
6185
|
+
/* @__PURE__ */ jsx47(
|
|
6043
6186
|
"button",
|
|
6044
6187
|
{
|
|
6045
6188
|
type: "button",
|
|
@@ -6051,11 +6194,11 @@ function Stepper({
|
|
|
6051
6194
|
clickable && "cursor-pointer hover:scale-110",
|
|
6052
6195
|
!clickable && "cursor-default"
|
|
6053
6196
|
),
|
|
6054
|
-
children: status === "complete" ? /* @__PURE__ */
|
|
6197
|
+
children: status === "complete" ? /* @__PURE__ */ jsx47(Check6, { className: "h-4 w-4" }) : status === "error" ? /* @__PURE__ */ jsx47(X10, { className: "h-4 w-4" }) : step.icon ?? /* @__PURE__ */ jsx47("span", { children: i + 1 })
|
|
6055
6198
|
}
|
|
6056
6199
|
),
|
|
6057
|
-
isHorizontal && !isLast && /* @__PURE__ */
|
|
6058
|
-
!isHorizontal && !isLast && /* @__PURE__ */
|
|
6200
|
+
isHorizontal && !isLast && /* @__PURE__ */ jsx47("div", { className: cn("flex-1 h-0.5 transition-colors", i < current ? "bg-primary" : "bg-border") }),
|
|
6201
|
+
!isHorizontal && !isLast && /* @__PURE__ */ jsx47("div", { className: cn("w-0.5 flex-1 min-h-8 transition-colors mt-1", i < current ? "bg-primary" : "bg-border") })
|
|
6059
6202
|
] }),
|
|
6060
6203
|
/* @__PURE__ */ jsxs40("div", { className: cn(
|
|
6061
6204
|
isHorizontal ? "mt-2 text-center px-1" : "pb-6 min-w-0"
|
|
@@ -6065,21 +6208,21 @@ function Stepper({
|
|
|
6065
6208
|
status === "current" ? "text-primary" : status === "complete" ? "text-foreground" : "text-muted-foreground"
|
|
6066
6209
|
), children: [
|
|
6067
6210
|
step.label,
|
|
6068
|
-
step.optional && /* @__PURE__ */
|
|
6211
|
+
step.optional && /* @__PURE__ */ jsx47("span", { className: "ml-1 text-xs text-muted-foreground", children: "(optional)" })
|
|
6069
6212
|
] }),
|
|
6070
|
-
step.description && /* @__PURE__ */
|
|
6071
|
-
!isHorizontal && step.content && i === current && /* @__PURE__ */
|
|
6213
|
+
step.description && /* @__PURE__ */ jsx47("p", { className: "text-xs text-muted-foreground mt-0.5", children: step.description }),
|
|
6214
|
+
!isHorizontal && step.content && i === current && /* @__PURE__ */ jsx47("div", { className: "mt-3", children: step.content })
|
|
6072
6215
|
] })
|
|
6073
6216
|
] }) }, i);
|
|
6074
6217
|
}) }),
|
|
6075
|
-
isHorizontal && steps[current]?.content && /* @__PURE__ */
|
|
6218
|
+
isHorizontal && steps[current]?.content && /* @__PURE__ */ jsx47("div", { className: "mt-6", children: steps[current].content })
|
|
6076
6219
|
] });
|
|
6077
6220
|
}
|
|
6078
6221
|
|
|
6079
6222
|
// src/components/ui/table.tsx
|
|
6080
|
-
import * as
|
|
6223
|
+
import * as React38 from "react";
|
|
6081
6224
|
import { ChevronLeft as ChevronLeft5, ChevronRight as ChevronRight8, Search as Search5, Trash2 as Trash23, ChevronsUpDown as ChevronsUpDown2, ChevronUp as ChevronUp2, ChevronDown as ChevronDown7, X as X11 } from "lucide-react";
|
|
6082
|
-
import { Fragment as Fragment10, jsx as
|
|
6225
|
+
import { Fragment as Fragment10, jsx as jsx48, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
6083
6226
|
var BADGE_COLORS = {
|
|
6084
6227
|
active: "bg-success/10 text-success border-success/20",
|
|
6085
6228
|
inactive: "bg-muted text-muted-foreground border-border",
|
|
@@ -6102,11 +6245,11 @@ function Table({
|
|
|
6102
6245
|
idKey = "id",
|
|
6103
6246
|
className
|
|
6104
6247
|
}) {
|
|
6105
|
-
const [search, setSearch] =
|
|
6106
|
-
const [currentPage, setCurrentPage] =
|
|
6107
|
-
const [selectedIds, setSelectedIds] =
|
|
6108
|
-
const [sortKey, setSortKey] =
|
|
6109
|
-
const [sortDir, setSortDir] =
|
|
6248
|
+
const [search, setSearch] = React38.useState("");
|
|
6249
|
+
const [currentPage, setCurrentPage] = React38.useState(1);
|
|
6250
|
+
const [selectedIds, setSelectedIds] = React38.useState([]);
|
|
6251
|
+
const [sortKey, setSortKey] = React38.useState(null);
|
|
6252
|
+
const [sortDir, setSortDir] = React38.useState(null);
|
|
6110
6253
|
const handleSort = (key) => {
|
|
6111
6254
|
if (sortKey !== key) {
|
|
6112
6255
|
setSortKey(key);
|
|
@@ -6120,7 +6263,7 @@ function Table({
|
|
|
6120
6263
|
setSortKey(null);
|
|
6121
6264
|
setSortDir(null);
|
|
6122
6265
|
};
|
|
6123
|
-
const filteredData =
|
|
6266
|
+
const filteredData = React38.useMemo(() => {
|
|
6124
6267
|
let d = search ? data.filter(
|
|
6125
6268
|
(item) => Object.values(item).some(
|
|
6126
6269
|
(val) => val && typeof val === "string" && val.toLowerCase().includes(search.toLowerCase())
|
|
@@ -6138,18 +6281,18 @@ function Table({
|
|
|
6138
6281
|
}, [data, search, sortKey, sortDir]);
|
|
6139
6282
|
const totalPages = Math.max(1, Math.ceil(filteredData.length / itemsPerPage));
|
|
6140
6283
|
const safePage = Math.min(currentPage, totalPages);
|
|
6141
|
-
const paginatedData =
|
|
6284
|
+
const paginatedData = React38.useMemo(() => {
|
|
6142
6285
|
if (!pagination) return filteredData;
|
|
6143
6286
|
const start = (safePage - 1) * itemsPerPage;
|
|
6144
6287
|
return filteredData.slice(start, start + itemsPerPage);
|
|
6145
6288
|
}, [filteredData, pagination, safePage, itemsPerPage]);
|
|
6146
|
-
|
|
6289
|
+
React38.useEffect(() => {
|
|
6147
6290
|
setCurrentPage(1);
|
|
6148
6291
|
}, [search]);
|
|
6149
6292
|
const handleSelectAll = (checked) => setSelectedIds(checked ? paginatedData.map((item) => String(item[idKey])) : []);
|
|
6150
6293
|
const handleSelect = (id, checked) => setSelectedIds((prev) => checked ? [...prev, id] : prev.filter((i) => i !== id));
|
|
6151
6294
|
const allSelected = paginatedData.length > 0 && selectedIds.length === paginatedData.length;
|
|
6152
|
-
const pagePills =
|
|
6295
|
+
const pagePills = React38.useMemo(() => {
|
|
6153
6296
|
if (totalPages <= 5) return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
6154
6297
|
if (safePage <= 3) return [1, 2, 3, 4, 5];
|
|
6155
6298
|
if (safePage >= totalPages - 2) return [totalPages - 4, totalPages - 3, totalPages - 2, totalPages - 1, totalPages];
|
|
@@ -6157,14 +6300,14 @@ function Table({
|
|
|
6157
6300
|
}, [totalPages, safePage]);
|
|
6158
6301
|
const SortIcon = ({ col }) => {
|
|
6159
6302
|
if (!col.sortable) return null;
|
|
6160
|
-
if (sortKey !== String(col.key)) return /* @__PURE__ */
|
|
6161
|
-
return sortDir === "asc" ? /* @__PURE__ */
|
|
6303
|
+
if (sortKey !== String(col.key)) return /* @__PURE__ */ jsx48(ChevronsUpDown2, { className: "ml-1.5 h-3.5 w-3.5 opacity-40" });
|
|
6304
|
+
return sortDir === "asc" ? /* @__PURE__ */ jsx48(ChevronUp2, { className: "ml-1.5 h-3.5 w-3.5 text-primary" }) : /* @__PURE__ */ jsx48(ChevronDown7, { className: "ml-1.5 h-3.5 w-3.5 text-primary" });
|
|
6162
6305
|
};
|
|
6163
6306
|
return /* @__PURE__ */ jsxs41("div", { className: cn("w-full space-y-3", className), children: [
|
|
6164
6307
|
/* @__PURE__ */ jsxs41("div", { className: "flex items-center justify-between gap-3 flex-wrap", children: [
|
|
6165
6308
|
searchable && /* @__PURE__ */ jsxs41("div", { className: "relative w-72", children: [
|
|
6166
|
-
/* @__PURE__ */
|
|
6167
|
-
/* @__PURE__ */
|
|
6309
|
+
/* @__PURE__ */ jsx48(Search5, { className: "absolute text-primary left-3 top-1/2 -translate-y-1/2 h-4 w-4 z-10" }),
|
|
6310
|
+
/* @__PURE__ */ jsx48(
|
|
6168
6311
|
"input",
|
|
6169
6312
|
{
|
|
6170
6313
|
placeholder: searchPlaceholder,
|
|
@@ -6173,12 +6316,12 @@ function Table({
|
|
|
6173
6316
|
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"
|
|
6174
6317
|
}
|
|
6175
6318
|
),
|
|
6176
|
-
search && /* @__PURE__ */
|
|
6319
|
+
search && /* @__PURE__ */ jsx48(
|
|
6177
6320
|
"button",
|
|
6178
6321
|
{
|
|
6179
6322
|
onClick: () => setSearch(""),
|
|
6180
6323
|
className: "absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",
|
|
6181
|
-
children: /* @__PURE__ */
|
|
6324
|
+
children: /* @__PURE__ */ jsx48(X11, { className: "h-3.5 w-3.5" })
|
|
6182
6325
|
}
|
|
6183
6326
|
)
|
|
6184
6327
|
] }),
|
|
@@ -6192,7 +6335,7 @@ function Table({
|
|
|
6192
6335
|
},
|
|
6193
6336
|
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",
|
|
6194
6337
|
children: [
|
|
6195
|
-
/* @__PURE__ */
|
|
6338
|
+
/* @__PURE__ */ jsx48(Trash23, { className: "h-3.5 w-3.5" }),
|
|
6196
6339
|
"Delete ",
|
|
6197
6340
|
selectedIds.length,
|
|
6198
6341
|
" selected"
|
|
@@ -6207,16 +6350,16 @@ function Table({
|
|
|
6207
6350
|
] })
|
|
6208
6351
|
] })
|
|
6209
6352
|
] }),
|
|
6210
|
-
/* @__PURE__ */
|
|
6211
|
-
/* @__PURE__ */
|
|
6212
|
-
selectable && /* @__PURE__ */
|
|
6353
|
+
/* @__PURE__ */ jsx48("div", { className: "rounded-xl border border-border overflow-hidden bg-card/50 backdrop-blur-sm shadow-sm", children: /* @__PURE__ */ jsx48("div", { className: "w-full overflow-auto", children: /* @__PURE__ */ jsxs41("table", { className: "w-full caption-bottom text-sm", children: [
|
|
6354
|
+
/* @__PURE__ */ jsx48("thead", { children: /* @__PURE__ */ jsxs41("tr", { className: "border-b border-border bg-muted/40", children: [
|
|
6355
|
+
selectable && /* @__PURE__ */ jsx48("th", { className: "h-11 w-[46px] px-4 text-left align-middle", children: /* @__PURE__ */ jsx48(
|
|
6213
6356
|
Checkbox,
|
|
6214
6357
|
{
|
|
6215
6358
|
checked: allSelected,
|
|
6216
6359
|
onChange: (e) => handleSelectAll(e.target.checked)
|
|
6217
6360
|
}
|
|
6218
6361
|
) }),
|
|
6219
|
-
columns.map((col) => /* @__PURE__ */
|
|
6362
|
+
columns.map((col) => /* @__PURE__ */ jsx48(
|
|
6220
6363
|
"th",
|
|
6221
6364
|
{
|
|
6222
6365
|
onClick: () => col.sortable && handleSort(String(col.key)),
|
|
@@ -6226,21 +6369,21 @@ function Table({
|
|
|
6226
6369
|
),
|
|
6227
6370
|
children: /* @__PURE__ */ jsxs41("span", { className: "inline-flex items-center", children: [
|
|
6228
6371
|
col.title,
|
|
6229
|
-
/* @__PURE__ */
|
|
6372
|
+
/* @__PURE__ */ jsx48(SortIcon, { col })
|
|
6230
6373
|
] })
|
|
6231
6374
|
},
|
|
6232
6375
|
String(col.key)
|
|
6233
6376
|
))
|
|
6234
6377
|
] }) }),
|
|
6235
|
-
/* @__PURE__ */
|
|
6378
|
+
/* @__PURE__ */ jsx48("tbody", { children: paginatedData.length === 0 ? /* @__PURE__ */ jsx48("tr", { children: /* @__PURE__ */ jsx48(
|
|
6236
6379
|
"td",
|
|
6237
6380
|
{
|
|
6238
6381
|
colSpan: columns.length + (selectable ? 1 : 0),
|
|
6239
6382
|
className: "h-32 text-center align-middle",
|
|
6240
6383
|
children: /* @__PURE__ */ jsxs41("div", { className: "flex flex-col items-center gap-1 text-muted-foreground", children: [
|
|
6241
|
-
/* @__PURE__ */
|
|
6242
|
-
/* @__PURE__ */
|
|
6243
|
-
search && /* @__PURE__ */
|
|
6384
|
+
/* @__PURE__ */ jsx48(Search5, { className: "h-8 w-8 opacity-20" }),
|
|
6385
|
+
/* @__PURE__ */ jsx48("span", { className: "text-sm", children: "No results found" }),
|
|
6386
|
+
search && /* @__PURE__ */ jsx48("button", { onClick: () => setSearch(""), className: "text-xs text-primary hover:underline", children: "Clear search" })
|
|
6244
6387
|
] })
|
|
6245
6388
|
}
|
|
6246
6389
|
) }) : paginatedData.map((item, i) => {
|
|
@@ -6254,14 +6397,14 @@ function Table({
|
|
|
6254
6397
|
isSelected ? "bg-primary/5 hover:bg-primary/8" : "hover:bg-muted/30"
|
|
6255
6398
|
),
|
|
6256
6399
|
children: [
|
|
6257
|
-
selectable && /* @__PURE__ */
|
|
6400
|
+
selectable && /* @__PURE__ */ jsx48("td", { className: "px-4 py-3 align-middle", children: /* @__PURE__ */ jsx48(
|
|
6258
6401
|
Checkbox,
|
|
6259
6402
|
{
|
|
6260
6403
|
checked: isSelected,
|
|
6261
6404
|
onChange: (e) => handleSelect(id, e.target.checked)
|
|
6262
6405
|
}
|
|
6263
6406
|
) }),
|
|
6264
|
-
columns.map((col) => /* @__PURE__ */
|
|
6407
|
+
columns.map((col) => /* @__PURE__ */ jsx48("td", { className: "px-4 py-3 align-middle", children: col.render ? col.render(item) : col.type === "image" ? /* @__PURE__ */ jsx48(
|
|
6265
6408
|
"img",
|
|
6266
6409
|
{
|
|
6267
6410
|
src: item[col.key],
|
|
@@ -6272,20 +6415,20 @@ function Table({
|
|
|
6272
6415
|
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-medium",
|
|
6273
6416
|
badgeClass(String(item[col.key]))
|
|
6274
6417
|
), children: [
|
|
6275
|
-
/* @__PURE__ */
|
|
6418
|
+
/* @__PURE__ */ jsx48("span", { className: cn(
|
|
6276
6419
|
"mr-1.5 h-1.5 w-1.5 rounded-full",
|
|
6277
6420
|
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"
|
|
6278
6421
|
) }),
|
|
6279
6422
|
item[col.key]
|
|
6280
|
-
] }) : col.type === "stack" ? /* @__PURE__ */
|
|
6423
|
+
] }) : col.type === "stack" ? /* @__PURE__ */ jsx48(AvatarStack, { images: Array.isArray(item[col.key]) ? item[col.key] : [], ...col.stackProps ?? {} }) : col.type === "icon" ? /* @__PURE__ */ jsx48("span", { className: "flex items-center", children: item[col.key] }) : col.type === "select" ? /* @__PURE__ */ jsx48(
|
|
6281
6424
|
"select",
|
|
6282
6425
|
{
|
|
6283
6426
|
value: item[col.key],
|
|
6284
6427
|
onChange: (e) => col.onChange?.(item, e.target.value),
|
|
6285
6428
|
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",
|
|
6286
|
-
children: (col.selectOptions ?? []).map((opt) => /* @__PURE__ */
|
|
6429
|
+
children: (col.selectOptions ?? []).map((opt) => /* @__PURE__ */ jsx48("option", { value: opt, children: opt }, opt))
|
|
6287
6430
|
}
|
|
6288
|
-
) : col.type === "toggle" ? /* @__PURE__ */
|
|
6431
|
+
) : col.type === "toggle" ? /* @__PURE__ */ jsx48(
|
|
6289
6432
|
"button",
|
|
6290
6433
|
{
|
|
6291
6434
|
role: "switch",
|
|
@@ -6295,13 +6438,13 @@ function Table({
|
|
|
6295
6438
|
"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",
|
|
6296
6439
|
item[col.key] ? "bg-primary" : "bg-muted"
|
|
6297
6440
|
),
|
|
6298
|
-
children: /* @__PURE__ */
|
|
6441
|
+
children: /* @__PURE__ */ jsx48("span", { className: cn(
|
|
6299
6442
|
"pointer-events-none inline-block h-4 w-4 rounded-full bg-white shadow-sm transition-transform",
|
|
6300
6443
|
item[col.key] ? "translate-x-4" : "translate-x-0"
|
|
6301
6444
|
) })
|
|
6302
6445
|
}
|
|
6303
6446
|
) : col.type === "color" ? /* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-2", children: [
|
|
6304
|
-
/* @__PURE__ */
|
|
6447
|
+
/* @__PURE__ */ jsx48(
|
|
6305
6448
|
"input",
|
|
6306
6449
|
{
|
|
6307
6450
|
type: "color",
|
|
@@ -6310,14 +6453,14 @@ function Table({
|
|
|
6310
6453
|
className: "h-7 w-7 cursor-pointer rounded border border-border bg-transparent p-0.5"
|
|
6311
6454
|
}
|
|
6312
6455
|
),
|
|
6313
|
-
/* @__PURE__ */
|
|
6314
|
-
] }) : col.type === "checkbox" ? /* @__PURE__ */
|
|
6456
|
+
/* @__PURE__ */ jsx48("span", { className: "text-xs text-muted-foreground font-mono", children: item[col.key] })
|
|
6457
|
+
] }) : col.type === "checkbox" ? /* @__PURE__ */ jsx48(
|
|
6315
6458
|
Checkbox,
|
|
6316
6459
|
{
|
|
6317
6460
|
checked: !!item[col.key],
|
|
6318
6461
|
onChange: (e) => col.onChange?.(item, e.target.checked)
|
|
6319
6462
|
}
|
|
6320
|
-
) : /* @__PURE__ */
|
|
6463
|
+
) : /* @__PURE__ */ jsx48("span", { className: "text-foreground/90", children: item[col.key] }) }, String(col.key)))
|
|
6321
6464
|
]
|
|
6322
6465
|
},
|
|
6323
6466
|
id
|
|
@@ -6334,20 +6477,20 @@ function Table({
|
|
|
6334
6477
|
filteredData.length
|
|
6335
6478
|
] }),
|
|
6336
6479
|
/* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-1", children: [
|
|
6337
|
-
/* @__PURE__ */
|
|
6480
|
+
/* @__PURE__ */ jsx48(
|
|
6338
6481
|
"button",
|
|
6339
6482
|
{
|
|
6340
6483
|
onClick: () => setCurrentPage((p) => Math.max(1, p - 1)),
|
|
6341
6484
|
disabled: safePage === 1,
|
|
6342
6485
|
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",
|
|
6343
|
-
children: /* @__PURE__ */
|
|
6486
|
+
children: /* @__PURE__ */ jsx48(ChevronLeft5, { className: "h-4 w-4" })
|
|
6344
6487
|
}
|
|
6345
6488
|
),
|
|
6346
6489
|
pagePills[0] > 1 && /* @__PURE__ */ jsxs41(Fragment10, { children: [
|
|
6347
|
-
/* @__PURE__ */
|
|
6348
|
-
pagePills[0] > 2 && /* @__PURE__ */
|
|
6490
|
+
/* @__PURE__ */ jsx48("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" }),
|
|
6491
|
+
pagePills[0] > 2 && /* @__PURE__ */ jsx48("span", { className: "px-1 text-muted-foreground text-xs", children: "\u2026" })
|
|
6349
6492
|
] }),
|
|
6350
|
-
pagePills.map((p) => /* @__PURE__ */
|
|
6493
|
+
pagePills.map((p) => /* @__PURE__ */ jsx48(
|
|
6351
6494
|
"button",
|
|
6352
6495
|
{
|
|
6353
6496
|
onClick: () => setCurrentPage(p),
|
|
@@ -6360,16 +6503,16 @@ function Table({
|
|
|
6360
6503
|
p
|
|
6361
6504
|
)),
|
|
6362
6505
|
pagePills[pagePills.length - 1] < totalPages && /* @__PURE__ */ jsxs41(Fragment10, { children: [
|
|
6363
|
-
pagePills[pagePills.length - 1] < totalPages - 1 && /* @__PURE__ */
|
|
6364
|
-
/* @__PURE__ */
|
|
6506
|
+
pagePills[pagePills.length - 1] < totalPages - 1 && /* @__PURE__ */ jsx48("span", { className: "px-1 text-muted-foreground text-xs", children: "\u2026" }),
|
|
6507
|
+
/* @__PURE__ */ jsx48("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 })
|
|
6365
6508
|
] }),
|
|
6366
|
-
/* @__PURE__ */
|
|
6509
|
+
/* @__PURE__ */ jsx48(
|
|
6367
6510
|
"button",
|
|
6368
6511
|
{
|
|
6369
6512
|
onClick: () => setCurrentPage((p) => Math.min(totalPages, p + 1)),
|
|
6370
6513
|
disabled: safePage === totalPages,
|
|
6371
6514
|
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",
|
|
6372
|
-
children: /* @__PURE__ */
|
|
6515
|
+
children: /* @__PURE__ */ jsx48(ChevronRight8, { className: "h-4 w-4" })
|
|
6373
6516
|
}
|
|
6374
6517
|
)
|
|
6375
6518
|
] })
|
|
@@ -6378,8 +6521,8 @@ function Table({
|
|
|
6378
6521
|
}
|
|
6379
6522
|
|
|
6380
6523
|
// src/components/ui/tabs.tsx
|
|
6381
|
-
import * as
|
|
6382
|
-
import { jsx as
|
|
6524
|
+
import * as React39 from "react";
|
|
6525
|
+
import { jsx as jsx49, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
6383
6526
|
var sizeMap = {
|
|
6384
6527
|
sm: "px-3 py-1.5 text-xs",
|
|
6385
6528
|
md: "px-4 py-2 text-sm",
|
|
@@ -6429,7 +6572,7 @@ function Tabs({
|
|
|
6429
6572
|
fullWidth = false,
|
|
6430
6573
|
className
|
|
6431
6574
|
}) {
|
|
6432
|
-
const [internal, setInternal] =
|
|
6575
|
+
const [internal, setInternal] = React39.useState(defaultValue ?? items[0]?.value ?? "");
|
|
6433
6576
|
const active = controlledValue ?? internal;
|
|
6434
6577
|
const select = (v) => {
|
|
6435
6578
|
if (!controlledValue) setInternal(v);
|
|
@@ -6437,7 +6580,7 @@ function Tabs({
|
|
|
6437
6580
|
};
|
|
6438
6581
|
const activeItem = items.find((i) => i.value === active);
|
|
6439
6582
|
return /* @__PURE__ */ jsxs42("div", { className: cn("w-full", className), children: [
|
|
6440
|
-
/* @__PURE__ */
|
|
6583
|
+
/* @__PURE__ */ jsx49("div", { className: cn("flex", fullWidth && "w-full", variantTrack[variant]), children: items.map((item) => /* @__PURE__ */ jsxs42(
|
|
6441
6584
|
"button",
|
|
6442
6585
|
{
|
|
6443
6586
|
type: "button",
|
|
@@ -6448,20 +6591,20 @@ function Tabs({
|
|
|
6448
6591
|
fullWidth && "flex-1 justify-center"
|
|
6449
6592
|
),
|
|
6450
6593
|
children: [
|
|
6451
|
-
item.icon && /* @__PURE__ */
|
|
6594
|
+
item.icon && /* @__PURE__ */ jsx49("span", { className: "shrink-0", children: item.icon }),
|
|
6452
6595
|
item.label,
|
|
6453
|
-
item.badge && /* @__PURE__ */
|
|
6596
|
+
item.badge && /* @__PURE__ */ jsx49("span", { className: "shrink-0", children: item.badge })
|
|
6454
6597
|
]
|
|
6455
6598
|
},
|
|
6456
6599
|
item.value
|
|
6457
6600
|
)) }),
|
|
6458
|
-
activeItem?.content && /* @__PURE__ */
|
|
6601
|
+
activeItem?.content && /* @__PURE__ */ jsx49("div", { className: "mt-4", children: activeItem.content })
|
|
6459
6602
|
] });
|
|
6460
6603
|
}
|
|
6461
6604
|
|
|
6462
6605
|
// src/components/ui/tag-input.tsx
|
|
6463
|
-
import * as
|
|
6464
|
-
import { jsx as
|
|
6606
|
+
import * as React40 from "react";
|
|
6607
|
+
import { jsx as jsx50, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
6465
6608
|
function TagInput({
|
|
6466
6609
|
value: controlled,
|
|
6467
6610
|
defaultValue = [],
|
|
@@ -6472,9 +6615,9 @@ function TagInput({
|
|
|
6472
6615
|
disabled = false,
|
|
6473
6616
|
className
|
|
6474
6617
|
}) {
|
|
6475
|
-
const [internal, setInternal] =
|
|
6476
|
-
const [input, setInput] =
|
|
6477
|
-
const inputRef =
|
|
6618
|
+
const [internal, setInternal] = React40.useState(defaultValue);
|
|
6619
|
+
const [input, setInput] = React40.useState("");
|
|
6620
|
+
const inputRef = React40.useRef(null);
|
|
6478
6621
|
const tags = controlled ?? internal;
|
|
6479
6622
|
function addTag(raw) {
|
|
6480
6623
|
const tag = raw.trim();
|
|
@@ -6510,8 +6653,8 @@ function TagInput({
|
|
|
6510
6653
|
),
|
|
6511
6654
|
onClick: () => inputRef.current?.focus(),
|
|
6512
6655
|
children: [
|
|
6513
|
-
tags.map((tag, i) => /* @__PURE__ */
|
|
6514
|
-
/* @__PURE__ */
|
|
6656
|
+
tags.map((tag, i) => /* @__PURE__ */ jsx50(Badge, { variant: "default", size: "sm", removable: true, onRemove: () => removeTag(i), children: tag }, i)),
|
|
6657
|
+
/* @__PURE__ */ jsx50(
|
|
6515
6658
|
"input",
|
|
6516
6659
|
{
|
|
6517
6660
|
ref: inputRef,
|
|
@@ -6531,7 +6674,7 @@ function TagInput({
|
|
|
6531
6674
|
|
|
6532
6675
|
// src/components/ui/timeline.tsx
|
|
6533
6676
|
import { CheckCircle as CheckCircle3, XCircle as XCircle2, AlertTriangle as AlertTriangle3, Info as Info2, Circle } from "lucide-react";
|
|
6534
|
-
import { jsx as
|
|
6677
|
+
import { jsx as jsx51, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
6535
6678
|
var DOT_COLOR = {
|
|
6536
6679
|
default: "bg-primary border-primary/30",
|
|
6537
6680
|
success: "bg-success border-success/30",
|
|
@@ -6547,41 +6690,41 @@ var ICON_COLOR = {
|
|
|
6547
6690
|
info: "text-info"
|
|
6548
6691
|
};
|
|
6549
6692
|
var DEFAULT_ICON = {
|
|
6550
|
-
default: /* @__PURE__ */
|
|
6551
|
-
success: /* @__PURE__ */
|
|
6552
|
-
error: /* @__PURE__ */
|
|
6553
|
-
warning: /* @__PURE__ */
|
|
6554
|
-
info: /* @__PURE__ */
|
|
6693
|
+
default: /* @__PURE__ */ jsx51(Circle, { className: "h-3 w-3" }),
|
|
6694
|
+
success: /* @__PURE__ */ jsx51(CheckCircle3, { className: "h-3.5 w-3.5" }),
|
|
6695
|
+
error: /* @__PURE__ */ jsx51(XCircle2, { className: "h-3.5 w-3.5" }),
|
|
6696
|
+
warning: /* @__PURE__ */ jsx51(AlertTriangle3, { className: "h-3.5 w-3.5" }),
|
|
6697
|
+
info: /* @__PURE__ */ jsx51(Info2, { className: "h-3.5 w-3.5" })
|
|
6555
6698
|
};
|
|
6556
6699
|
function Timeline({ items, align = "left", className }) {
|
|
6557
|
-
return /* @__PURE__ */
|
|
6700
|
+
return /* @__PURE__ */ jsx51("div", { className: cn("relative", className), children: items.map((item, i) => {
|
|
6558
6701
|
const variant = item.variant ?? "default";
|
|
6559
6702
|
const isLast = i === items.length - 1;
|
|
6560
6703
|
const isRight = align === "alternate" && i % 2 === 1;
|
|
6561
6704
|
return /* @__PURE__ */ jsxs44("div", { className: cn("relative flex gap-4", align === "alternate" && "justify-center", isRight && "flex-row-reverse"), children: [
|
|
6562
6705
|
/* @__PURE__ */ jsxs44("div", { className: "flex flex-col items-center", children: [
|
|
6563
|
-
/* @__PURE__ */
|
|
6706
|
+
/* @__PURE__ */ jsx51("div", { className: cn(
|
|
6564
6707
|
"flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 z-10",
|
|
6565
6708
|
item.icon ? "bg-background border-border" : DOT_COLOR[variant]
|
|
6566
|
-
), children: /* @__PURE__ */
|
|
6567
|
-
!isLast && /* @__PURE__ */
|
|
6709
|
+
), children: /* @__PURE__ */ jsx51("span", { className: cn("shrink-0", item.icon ? ICON_COLOR[variant] : "text-white"), children: item.icon ?? DEFAULT_ICON[variant] }) }),
|
|
6710
|
+
!isLast && /* @__PURE__ */ jsx51("div", { className: "w-0.5 flex-1 bg-border mt-1 mb-1 min-h-4" })
|
|
6568
6711
|
] }),
|
|
6569
6712
|
/* @__PURE__ */ jsxs44("div", { className: cn("flex-1 pb-6 min-w-0", isRight && "text-right"), children: [
|
|
6570
6713
|
/* @__PURE__ */ jsxs44("div", { className: cn("flex items-start justify-between gap-2", isRight && "flex-row-reverse"), children: [
|
|
6571
|
-
/* @__PURE__ */
|
|
6572
|
-
item.time && /* @__PURE__ */
|
|
6714
|
+
/* @__PURE__ */ jsx51("p", { className: "text-sm font-semibold leading-tight", children: item.title }),
|
|
6715
|
+
item.time && /* @__PURE__ */ jsx51("span", { className: "shrink-0 text-xs text-muted-foreground whitespace-nowrap", children: item.time })
|
|
6573
6716
|
] }),
|
|
6574
|
-
item.description && /* @__PURE__ */
|
|
6575
|
-
item.content && /* @__PURE__ */
|
|
6717
|
+
item.description && /* @__PURE__ */ jsx51("p", { className: "mt-0.5 text-xs text-muted-foreground leading-snug", children: item.description }),
|
|
6718
|
+
item.content && /* @__PURE__ */ jsx51("div", { className: "mt-2", children: item.content })
|
|
6576
6719
|
] })
|
|
6577
6720
|
] }, item.id ?? i);
|
|
6578
6721
|
}) });
|
|
6579
6722
|
}
|
|
6580
6723
|
|
|
6581
6724
|
// src/components/ui/toggle-switch.tsx
|
|
6582
|
-
import * as
|
|
6583
|
-
import { jsx as
|
|
6584
|
-
var ToggleSwitch =
|
|
6725
|
+
import * as React41 from "react";
|
|
6726
|
+
import { jsx as jsx52, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
6727
|
+
var ToggleSwitch = React41.forwardRef(
|
|
6585
6728
|
({
|
|
6586
6729
|
className,
|
|
6587
6730
|
inline = false,
|
|
@@ -6599,10 +6742,10 @@ var ToggleSwitch = React40.forwardRef(
|
|
|
6599
6742
|
disabled,
|
|
6600
6743
|
...props
|
|
6601
6744
|
}, ref) => {
|
|
6602
|
-
const toggleId = id ??
|
|
6745
|
+
const toggleId = id ?? React41.useId();
|
|
6603
6746
|
const trackW = width ? typeof width === "number" ? `${width}px` : width : "2.75rem";
|
|
6604
6747
|
const trackH = height ? typeof height === "number" ? `${height}px` : height : "1.5rem";
|
|
6605
|
-
const [internalChecked, setInternalChecked] =
|
|
6748
|
+
const [internalChecked, setInternalChecked] = React41.useState(defaultChecked ?? false);
|
|
6606
6749
|
const isControlled = checked !== void 0;
|
|
6607
6750
|
const isOn = accepted ? true : declined ? false : isControlled ? checked : internalChecked;
|
|
6608
6751
|
const stateColor = accepted ? acceptedColor ?? "#22c55e" : declined ? declinedColor ?? "#ef4444" : isOn ? void 0 : void 0;
|
|
@@ -6617,7 +6760,7 @@ var ToggleSwitch = React40.forwardRef(
|
|
|
6617
6760
|
htmlFor: toggleId,
|
|
6618
6761
|
className: cn("relative inline-flex items-center cursor-pointer", disabled && "opacity-50 cursor-not-allowed"),
|
|
6619
6762
|
children: [
|
|
6620
|
-
/* @__PURE__ */
|
|
6763
|
+
/* @__PURE__ */ jsx52(
|
|
6621
6764
|
"input",
|
|
6622
6765
|
{
|
|
6623
6766
|
type: "checkbox",
|
|
@@ -6630,7 +6773,7 @@ var ToggleSwitch = React40.forwardRef(
|
|
|
6630
6773
|
...props
|
|
6631
6774
|
}
|
|
6632
6775
|
),
|
|
6633
|
-
/* @__PURE__ */
|
|
6776
|
+
/* @__PURE__ */ jsx52(
|
|
6634
6777
|
"div",
|
|
6635
6778
|
{
|
|
6636
6779
|
className: cn(
|
|
@@ -6643,7 +6786,7 @@ var ToggleSwitch = React40.forwardRef(
|
|
|
6643
6786
|
height: trackH,
|
|
6644
6787
|
...stateColor ? { backgroundColor: stateColor } : {}
|
|
6645
6788
|
},
|
|
6646
|
-
children: /* @__PURE__ */
|
|
6789
|
+
children: /* @__PURE__ */ jsx52(
|
|
6647
6790
|
"span",
|
|
6648
6791
|
{
|
|
6649
6792
|
className: `absolute top-[1px] ${isOn ? "bg-slate-50/40" : "bg-primary"} rounded-full border border-slate-300/50 shadow transition-transform duration-200`,
|
|
@@ -6663,7 +6806,7 @@ var ToggleSwitch = React40.forwardRef(
|
|
|
6663
6806
|
if (inline && label) {
|
|
6664
6807
|
return /* @__PURE__ */ jsxs45("div", { className: "inline-flex items-center gap-2 select-none", children: [
|
|
6665
6808
|
toggle,
|
|
6666
|
-
/* @__PURE__ */
|
|
6809
|
+
/* @__PURE__ */ jsx52("label", { htmlFor: toggleId, className: cn("text-sm cursor-pointer", disabled && "opacity-50 cursor-not-allowed"), children: label })
|
|
6667
6810
|
] });
|
|
6668
6811
|
}
|
|
6669
6812
|
return toggle;
|
|
@@ -6672,14 +6815,14 @@ var ToggleSwitch = React40.forwardRef(
|
|
|
6672
6815
|
ToggleSwitch.displayName = "ToggleSwitch";
|
|
6673
6816
|
|
|
6674
6817
|
// src/components/ui/tree-view.tsx
|
|
6675
|
-
import * as
|
|
6818
|
+
import * as React42 from "react";
|
|
6676
6819
|
import { ChevronRight as ChevronRight9, Folder, FolderOpen, File } from "lucide-react";
|
|
6677
|
-
import { jsx as
|
|
6820
|
+
import { jsx as jsx53, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
6678
6821
|
function TreeNodeItem({ node, depth, selected, expanded, onToggleExpand, onSelect, multiple }) {
|
|
6679
6822
|
const hasChildren = !!node.children?.length;
|
|
6680
6823
|
const isExpanded = expanded.includes(node.id);
|
|
6681
6824
|
const isSelected = selected.includes(node.id);
|
|
6682
|
-
const defaultIcon = hasChildren ? isExpanded ? /* @__PURE__ */
|
|
6825
|
+
const defaultIcon = hasChildren ? isExpanded ? /* @__PURE__ */ jsx53(FolderOpen, { className: "h-4 w-4 text-warning" }) : /* @__PURE__ */ jsx53(Folder, { className: "h-4 w-4 text-warning" }) : /* @__PURE__ */ jsx53(File, { className: "h-4 w-4 text-muted-foreground" });
|
|
6683
6826
|
return /* @__PURE__ */ jsxs46("div", { children: [
|
|
6684
6827
|
/* @__PURE__ */ jsxs46(
|
|
6685
6828
|
"div",
|
|
@@ -6695,13 +6838,13 @@ function TreeNodeItem({ node, depth, selected, expanded, onToggleExpand, onSelec
|
|
|
6695
6838
|
onSelect(node.id);
|
|
6696
6839
|
},
|
|
6697
6840
|
children: [
|
|
6698
|
-
hasChildren ? /* @__PURE__ */
|
|
6699
|
-
/* @__PURE__ */
|
|
6700
|
-
/* @__PURE__ */
|
|
6841
|
+
hasChildren ? /* @__PURE__ */ jsx53(ChevronRight9, { className: cn("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform", isExpanded && "rotate-90") }) : /* @__PURE__ */ jsx53("span", { className: "w-3.5 shrink-0" }),
|
|
6842
|
+
/* @__PURE__ */ jsx53("span", { className: "shrink-0", children: node.icon ?? defaultIcon }),
|
|
6843
|
+
/* @__PURE__ */ jsx53("span", { className: "truncate", children: node.label })
|
|
6701
6844
|
]
|
|
6702
6845
|
}
|
|
6703
6846
|
),
|
|
6704
|
-
hasChildren && isExpanded && /* @__PURE__ */
|
|
6847
|
+
hasChildren && isExpanded && /* @__PURE__ */ jsx53("div", { children: node.children.map((child) => /* @__PURE__ */ jsx53(
|
|
6705
6848
|
TreeNodeItem,
|
|
6706
6849
|
{
|
|
6707
6850
|
node: child,
|
|
@@ -6726,8 +6869,8 @@ function TreeView({
|
|
|
6726
6869
|
className
|
|
6727
6870
|
}) {
|
|
6728
6871
|
const init = defaultSelected ? Array.isArray(defaultSelected) ? defaultSelected : [defaultSelected] : [];
|
|
6729
|
-
const [internal, setInternal] =
|
|
6730
|
-
const [expanded, setExpanded] =
|
|
6872
|
+
const [internal, setInternal] = React42.useState(init);
|
|
6873
|
+
const [expanded, setExpanded] = React42.useState(defaultExpanded);
|
|
6731
6874
|
const selected = controlled ? Array.isArray(controlled) ? controlled : [controlled] : internal;
|
|
6732
6875
|
function handleSelect(id) {
|
|
6733
6876
|
let next;
|
|
@@ -6742,7 +6885,7 @@ function TreeView({
|
|
|
6742
6885
|
function toggleExpand(id) {
|
|
6743
6886
|
setExpanded((prev) => prev.includes(id) ? prev.filter((v) => v !== id) : [...prev, id]);
|
|
6744
6887
|
}
|
|
6745
|
-
return /* @__PURE__ */
|
|
6888
|
+
return /* @__PURE__ */ jsx53("div", { className: cn("w-full", className), children: nodes.map((node) => /* @__PURE__ */ jsx53(
|
|
6746
6889
|
TreeNodeItem,
|
|
6747
6890
|
{
|
|
6748
6891
|
node,
|
|
@@ -6758,8 +6901,8 @@ function TreeView({
|
|
|
6758
6901
|
}
|
|
6759
6902
|
|
|
6760
6903
|
// src/components/ui/widget.tsx
|
|
6761
|
-
import * as
|
|
6762
|
-
import { jsx as
|
|
6904
|
+
import * as React43 from "react";
|
|
6905
|
+
import { jsx as jsx54, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
6763
6906
|
var iconColorMap = {
|
|
6764
6907
|
primary: "bg-primary/10 text-primary",
|
|
6765
6908
|
info: "bg-info/10 text-info",
|
|
@@ -6787,8 +6930,8 @@ var variantMap = {
|
|
|
6787
6930
|
outline: "bg-transparent border-2"
|
|
6788
6931
|
};
|
|
6789
6932
|
function useCountUp(target, enabled, duration = 1e3) {
|
|
6790
|
-
const [display, setDisplay] =
|
|
6791
|
-
|
|
6933
|
+
const [display, setDisplay] = React43.useState(enabled ? 0 : target);
|
|
6934
|
+
React43.useEffect(() => {
|
|
6792
6935
|
if (!enabled) {
|
|
6793
6936
|
setDisplay(target);
|
|
6794
6937
|
return;
|
|
@@ -6831,7 +6974,7 @@ function Widget({
|
|
|
6831
6974
|
const counted = useCountUp(isNumeric ? value : 0, animate && isNumeric);
|
|
6832
6975
|
const displayValue = animate && isNumeric ? counted : value;
|
|
6833
6976
|
const s = sizeMap2[size];
|
|
6834
|
-
return /* @__PURE__ */
|
|
6977
|
+
return /* @__PURE__ */ jsx54(
|
|
6835
6978
|
Card,
|
|
6836
6979
|
{
|
|
6837
6980
|
className: cn(
|
|
@@ -6846,19 +6989,19 @@ function Widget({
|
|
|
6846
6989
|
/* @__PURE__ */ jsxs47("div", { className: "flex items-start justify-between gap-3", children: [
|
|
6847
6990
|
/* @__PURE__ */ jsxs47("div", { className: "min-w-0 flex-1 space-y-1", children: [
|
|
6848
6991
|
/* @__PURE__ */ jsxs47("div", { className: "flex items-center gap-2", children: [
|
|
6849
|
-
/* @__PURE__ */
|
|
6850
|
-
badge && /* @__PURE__ */
|
|
6992
|
+
/* @__PURE__ */ jsx54("p", { className: "text-sm font-medium text-muted-foreground truncate", children: title }),
|
|
6993
|
+
badge && /* @__PURE__ */ jsx54("span", { className: "shrink-0", children: badge })
|
|
6851
6994
|
] }),
|
|
6852
|
-
loading ? /* @__PURE__ */
|
|
6853
|
-
description && /* @__PURE__ */
|
|
6995
|
+
loading ? /* @__PURE__ */ jsx54("div", { className: "h-8 w-24 animate-pulse rounded-md bg-muted" }) : /* @__PURE__ */ jsx54("div", { className: cn("font-bold tabular-nums", s.value), children: displayValue }),
|
|
6996
|
+
description && /* @__PURE__ */ jsx54("p", { className: "text-xs text-muted-foreground", children: description })
|
|
6854
6997
|
] }),
|
|
6855
6998
|
icon && /* @__PURE__ */ jsxs47("div", { className: cn(
|
|
6856
6999
|
"relative flex shrink-0 items-center justify-center rounded-full",
|
|
6857
7000
|
s.icon,
|
|
6858
7001
|
iconColorMap[iconColor]
|
|
6859
7002
|
), children: [
|
|
6860
|
-
pulse && /* @__PURE__ */
|
|
6861
|
-
/* @__PURE__ */
|
|
7003
|
+
pulse && /* @__PURE__ */ jsx54("span", { className: "absolute inset-0 rounded-full animate-ping opacity-30 bg-current" }),
|
|
7004
|
+
/* @__PURE__ */ jsx54("span", { className: s.iconSize, children: icon })
|
|
6862
7005
|
] })
|
|
6863
7006
|
] }),
|
|
6864
7007
|
trendValue && !loading && /* @__PURE__ */ jsxs47("div", { className: "mt-3 flex items-center gap-1.5 text-sm", children: [
|
|
@@ -6876,17 +7019,17 @@ function Widget({
|
|
|
6876
7019
|
"vs ",
|
|
6877
7020
|
previousValue
|
|
6878
7021
|
] }),
|
|
6879
|
-
/* @__PURE__ */
|
|
7022
|
+
/* @__PURE__ */ jsx54("span", { className: "text-muted-foreground", children: trendLabel })
|
|
6880
7023
|
] }),
|
|
6881
7024
|
progress !== void 0 && /* @__PURE__ */ jsxs47("div", { className: "mt-4 space-y-1", children: [
|
|
6882
7025
|
/* @__PURE__ */ jsxs47("div", { className: "flex justify-between text-xs text-muted-foreground", children: [
|
|
6883
|
-
/* @__PURE__ */
|
|
7026
|
+
/* @__PURE__ */ jsx54("span", { children: "Progress" }),
|
|
6884
7027
|
/* @__PURE__ */ jsxs47("span", { children: [
|
|
6885
7028
|
Math.min(100, Math.max(0, progress)),
|
|
6886
7029
|
"%"
|
|
6887
7030
|
] })
|
|
6888
7031
|
] }),
|
|
6889
|
-
/* @__PURE__ */
|
|
7032
|
+
/* @__PURE__ */ jsx54("div", { className: "h-1.5 w-full rounded-full bg-muted overflow-hidden", children: /* @__PURE__ */ jsx54(
|
|
6890
7033
|
"div",
|
|
6891
7034
|
{
|
|
6892
7035
|
className: cn("h-full rounded-full transition-all duration-700", progressColorMap[progressColor]),
|
|
@@ -6894,7 +7037,7 @@ function Widget({
|
|
|
6894
7037
|
}
|
|
6895
7038
|
) })
|
|
6896
7039
|
] }),
|
|
6897
|
-
footer && /* @__PURE__ */
|
|
7040
|
+
footer && /* @__PURE__ */ jsx54("div", { className: "mt-4 border-t pt-3 text-sm text-muted-foreground", children: footer })
|
|
6898
7041
|
] })
|
|
6899
7042
|
}
|
|
6900
7043
|
);
|