@juv/codego-react-ui 1.0.2 → 1.0.5
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/README.md +160 -0
- package/dist/index.cjs +488 -336
- package/dist/index.d.cts +27 -5
- package/dist/index.d.ts +27 -5
- package/dist/index.global.js +14850 -0
- package/dist/index.js +477 -328
- package/package.json +8 -5
package/dist/index.js
CHANGED
|
@@ -3807,6 +3807,8 @@ function Select({
|
|
|
3807
3807
|
const [search, setSearch] = React23.useState("");
|
|
3808
3808
|
const [isSearching, setIsSearching] = React23.useState(false);
|
|
3809
3809
|
const containerRef = React23.useRef(null);
|
|
3810
|
+
const getKey = (opt) => String(Object.keys(opt)[0]);
|
|
3811
|
+
const getLabel = (opt) => Object.values(opt)[0];
|
|
3810
3812
|
const selectedValues = React23.useMemo(() => {
|
|
3811
3813
|
if (multiple && Array.isArray(value)) {
|
|
3812
3814
|
return value;
|
|
@@ -3816,10 +3818,10 @@ function Select({
|
|
|
3816
3818
|
return [];
|
|
3817
3819
|
}, [value, multiple]);
|
|
3818
3820
|
const selectedOptions = React23.useMemo(() => {
|
|
3819
|
-
return options.filter((opt) => selectedValues.includes(opt
|
|
3821
|
+
return options.filter((opt) => selectedValues.includes(getKey(opt)));
|
|
3820
3822
|
}, [options, selectedValues]);
|
|
3821
3823
|
const filteredOptions = searchable ? options.filter(
|
|
3822
|
-
(opt) => opt.
|
|
3824
|
+
(opt) => getLabel(opt).toLowerCase().includes(search.toLowerCase())
|
|
3823
3825
|
) : options;
|
|
3824
3826
|
React23.useEffect(() => {
|
|
3825
3827
|
const handleClickOutside = (event) => {
|
|
@@ -3883,23 +3885,23 @@ function Select({
|
|
|
3883
3885
|
{
|
|
3884
3886
|
className: "inline-flex items-center gap-1 rounded-sm bg-primary/15 text-primary px-2 py-0.5 text-xs",
|
|
3885
3887
|
children: [
|
|
3886
|
-
opt
|
|
3888
|
+
getLabel(opt),
|
|
3887
3889
|
/* @__PURE__ */ jsx28(
|
|
3888
3890
|
"button",
|
|
3889
3891
|
{
|
|
3890
3892
|
type: "button",
|
|
3891
3893
|
disabled,
|
|
3892
|
-
onClick: () => onChange?.(selectedValues.filter((v) => v !== opt
|
|
3894
|
+
onClick: () => onChange?.(selectedValues.filter((v) => v !== getKey(opt))),
|
|
3893
3895
|
className: "hover:text-destructive",
|
|
3894
3896
|
children: /* @__PURE__ */ jsx28(X7, { className: "h-3 w-3" })
|
|
3895
3897
|
}
|
|
3896
3898
|
)
|
|
3897
3899
|
]
|
|
3898
3900
|
},
|
|
3899
|
-
opt
|
|
3901
|
+
getKey(opt)
|
|
3900
3902
|
)) }),
|
|
3901
3903
|
/* @__PURE__ */ jsx28("div", { className: "max-h-48 overflow-y-auto p-1", children: options.map((option) => {
|
|
3902
|
-
const checked = selectedValues.includes(option
|
|
3904
|
+
const checked = selectedValues.includes(getKey(option));
|
|
3903
3905
|
return /* @__PURE__ */ jsxs24(
|
|
3904
3906
|
"label",
|
|
3905
3907
|
{
|
|
@@ -3920,15 +3922,15 @@ function Select({
|
|
|
3920
3922
|
checked,
|
|
3921
3923
|
disabled,
|
|
3922
3924
|
onChange: () => {
|
|
3923
|
-
const newValues = checked ? selectedValues.filter((v) => v !== option
|
|
3925
|
+
const newValues = checked ? selectedValues.filter((v) => v !== getKey(option)) : [...selectedValues, getKey(option)];
|
|
3924
3926
|
onChange?.(newValues);
|
|
3925
3927
|
}
|
|
3926
3928
|
}
|
|
3927
3929
|
),
|
|
3928
|
-
option
|
|
3930
|
+
getLabel(option)
|
|
3929
3931
|
]
|
|
3930
3932
|
},
|
|
3931
|
-
option
|
|
3933
|
+
getKey(option)
|
|
3932
3934
|
);
|
|
3933
3935
|
}) })
|
|
3934
3936
|
] })
|
|
@@ -3946,7 +3948,7 @@ function Select({
|
|
|
3946
3948
|
className: "w-full appearance-none rounded-xl border border-slate-900/30 bg-background/50 backdrop-blur-sm px-4 py-2 pr-10 h-10 text-sm text-foreground transition-colors hover:bg-background/80 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
3947
3949
|
children: [
|
|
3948
3950
|
/* @__PURE__ */ jsx28("option", { value: "", disabled: true, children: placeholder }),
|
|
3949
|
-
options.map((option) => /* @__PURE__ */ jsx28("option", { value: option
|
|
3951
|
+
options.map((option) => /* @__PURE__ */ jsx28("option", { value: getKey(option), children: getLabel(option) }, getKey(option)))
|
|
3950
3952
|
]
|
|
3951
3953
|
}
|
|
3952
3954
|
),
|
|
@@ -3982,20 +3984,20 @@ function Select({
|
|
|
3982
3984
|
),
|
|
3983
3985
|
children: [
|
|
3984
3986
|
reorderable && /* @__PURE__ */ jsx28(GripVertical3, { className: "h-3 w-3 opacity-50" }),
|
|
3985
|
-
option
|
|
3987
|
+
getLabel(option),
|
|
3986
3988
|
/* @__PURE__ */ jsx28(
|
|
3987
3989
|
"button",
|
|
3988
3990
|
{
|
|
3989
3991
|
type: "button",
|
|
3990
|
-
onClick: (e) => handleRemove(option
|
|
3992
|
+
onClick: (e) => handleRemove(getKey(option), e),
|
|
3991
3993
|
className: "ml-1 hover:text-destructive",
|
|
3992
3994
|
children: /* @__PURE__ */ jsx28(X7, { className: "h-3 w-3" })
|
|
3993
3995
|
}
|
|
3994
3996
|
)
|
|
3995
3997
|
]
|
|
3996
3998
|
},
|
|
3997
|
-
option
|
|
3998
|
-
)) }) : /* @__PURE__ */ jsx28("span", { className: cn("truncate flex-1 text-left", !selectedOptions.length && "text-muted-foreground"), children: selectedOptions.length > 0 ? selectedOptions.map((opt) => opt
|
|
3999
|
+
getKey(option)
|
|
4000
|
+
)) }) : /* @__PURE__ */ jsx28("span", { className: cn("truncate flex-1 text-left", !selectedOptions.length && "text-muted-foreground"), children: selectedOptions.length > 0 ? selectedOptions.map((opt) => getLabel(opt)).join(", ") : placeholder })
|
|
3999
4001
|
}
|
|
4000
4002
|
),
|
|
4001
4003
|
!suffixIcon && /* @__PURE__ */ jsx28("span", { className: "absolute right-3 top-1/2 -translate-y-1/2 z-10 pointer-events-none", children: /* @__PURE__ */ jsx28(ChevronDown4, { className: "h-4 w-4 opacity-50" }) }),
|
|
@@ -4035,15 +4037,15 @@ function Select({
|
|
|
4035
4037
|
{
|
|
4036
4038
|
className: cn(
|
|
4037
4039
|
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
4038
|
-
(multiple ? selectedValues.includes(option
|
|
4040
|
+
(multiple ? selectedValues.includes(getKey(option)) : value === getKey(option)) && "bg-accent text-accent-foreground"
|
|
4039
4041
|
),
|
|
4040
|
-
onClick: () => handleSelect(option
|
|
4042
|
+
onClick: () => handleSelect(getKey(option)),
|
|
4041
4043
|
children: [
|
|
4042
|
-
/* @__PURE__ */ jsx28("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: (multiple ? selectedValues.includes(option
|
|
4043
|
-
/* @__PURE__ */ jsx28("span", { className: "truncate", children: option
|
|
4044
|
+
/* @__PURE__ */ jsx28("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: (multiple ? selectedValues.includes(getKey(option)) : value === getKey(option)) && /* @__PURE__ */ jsx28(Check5, { className: "h-4 w-4" }) }),
|
|
4045
|
+
/* @__PURE__ */ jsx28("span", { className: "truncate", children: getLabel(option) })
|
|
4044
4046
|
]
|
|
4045
4047
|
},
|
|
4046
|
-
option
|
|
4048
|
+
getKey(option)
|
|
4047
4049
|
)),
|
|
4048
4050
|
createOptionForm && /* @__PURE__ */ jsx28("div", { className: "border-t border-white/10 mt-1 pt-1", children: createOptionForm })
|
|
4049
4051
|
] }) })
|
|
@@ -5237,9 +5239,198 @@ function Repeater({
|
|
|
5237
5239
|
] });
|
|
5238
5240
|
}
|
|
5239
5241
|
|
|
5240
|
-
// src/components/ui/
|
|
5242
|
+
// src/components/ui/panel.tsx
|
|
5243
|
+
import * as React31 from "react";
|
|
5244
|
+
import { PanelLeftClose, PanelLeftOpen } from "lucide-react";
|
|
5245
|
+
|
|
5246
|
+
// src/components/ui/tooltip.tsx
|
|
5241
5247
|
import * as React30 from "react";
|
|
5242
|
-
import
|
|
5248
|
+
import * as ReactDOM from "react-dom";
|
|
5249
|
+
import { Fragment as Fragment7, jsx as jsx37, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
5250
|
+
function Tooltip({
|
|
5251
|
+
content,
|
|
5252
|
+
children,
|
|
5253
|
+
side = "right",
|
|
5254
|
+
className,
|
|
5255
|
+
enabled = true
|
|
5256
|
+
}) {
|
|
5257
|
+
const [visible, setVisible] = React30.useState(false);
|
|
5258
|
+
const [coords, setCoords] = React30.useState({ top: 0, left: 0 });
|
|
5259
|
+
const ref = React30.useRef(null);
|
|
5260
|
+
if (!enabled) return /* @__PURE__ */ jsx37(Fragment7, { children });
|
|
5261
|
+
function calcCoords() {
|
|
5262
|
+
const r = ref.current?.getBoundingClientRect();
|
|
5263
|
+
if (!r) return;
|
|
5264
|
+
const GAP = 8;
|
|
5265
|
+
switch (side) {
|
|
5266
|
+
case "right":
|
|
5267
|
+
setCoords({ top: r.top + r.height / 2, left: r.right + GAP });
|
|
5268
|
+
break;
|
|
5269
|
+
case "left":
|
|
5270
|
+
setCoords({ top: r.top + r.height / 2, left: r.left - GAP });
|
|
5271
|
+
break;
|
|
5272
|
+
case "top":
|
|
5273
|
+
setCoords({ top: r.top - GAP, left: r.left + r.width / 2 });
|
|
5274
|
+
break;
|
|
5275
|
+
case "bottom":
|
|
5276
|
+
setCoords({ top: r.bottom + GAP, left: r.left + r.width / 2 });
|
|
5277
|
+
break;
|
|
5278
|
+
}
|
|
5279
|
+
}
|
|
5280
|
+
const transformClass = {
|
|
5281
|
+
right: "-translate-y-1/2",
|
|
5282
|
+
left: "-translate-y-1/2 -translate-x-full",
|
|
5283
|
+
top: "-translate-x-1/2 -translate-y-full",
|
|
5284
|
+
bottom: "-translate-x-1/2"
|
|
5285
|
+
}[side];
|
|
5286
|
+
return /* @__PURE__ */ jsxs33(
|
|
5287
|
+
"div",
|
|
5288
|
+
{
|
|
5289
|
+
ref,
|
|
5290
|
+
className: "relative inline-flex",
|
|
5291
|
+
onMouseEnter: () => {
|
|
5292
|
+
calcCoords();
|
|
5293
|
+
setVisible(true);
|
|
5294
|
+
},
|
|
5295
|
+
onMouseLeave: () => setVisible(false),
|
|
5296
|
+
onFocus: () => {
|
|
5297
|
+
calcCoords();
|
|
5298
|
+
setVisible(true);
|
|
5299
|
+
},
|
|
5300
|
+
onBlur: () => setVisible(false),
|
|
5301
|
+
children: [
|
|
5302
|
+
children,
|
|
5303
|
+
visible && ReactDOM.createPortal(
|
|
5304
|
+
/* @__PURE__ */ jsx37(
|
|
5305
|
+
"div",
|
|
5306
|
+
{
|
|
5307
|
+
role: "tooltip",
|
|
5308
|
+
style: { top: coords.top, left: coords.left },
|
|
5309
|
+
className: cn(
|
|
5310
|
+
"fixed z-[9999] whitespace-nowrap rounded-md bg-foreground px-2.5 py-1 text-xs font-medium text-background shadow-lg pointer-events-none",
|
|
5311
|
+
transformClass,
|
|
5312
|
+
className
|
|
5313
|
+
),
|
|
5314
|
+
children: content
|
|
5315
|
+
}
|
|
5316
|
+
),
|
|
5317
|
+
document.body
|
|
5318
|
+
)
|
|
5319
|
+
]
|
|
5320
|
+
}
|
|
5321
|
+
);
|
|
5322
|
+
}
|
|
5323
|
+
|
|
5324
|
+
// src/components/ui/panel.tsx
|
|
5325
|
+
import { jsx as jsx38, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
5326
|
+
var PanelCollapsedContext = React31.createContext(false);
|
|
5327
|
+
function Panel({
|
|
5328
|
+
sidebar,
|
|
5329
|
+
sidebarHeader,
|
|
5330
|
+
sidebarFooter,
|
|
5331
|
+
sidebarWidth = "w-56",
|
|
5332
|
+
topbar,
|
|
5333
|
+
topbarTrailing,
|
|
5334
|
+
defaultCollapsed = false,
|
|
5335
|
+
collapsible = false,
|
|
5336
|
+
height = "h-[520px]",
|
|
5337
|
+
children,
|
|
5338
|
+
className
|
|
5339
|
+
}) {
|
|
5340
|
+
const [collapsed, setCollapsed] = React31.useState(defaultCollapsed);
|
|
5341
|
+
return /* @__PURE__ */ jsx38(PanelCollapsedContext.Provider, { value: collapsed, children: /* @__PURE__ */ jsxs34(
|
|
5342
|
+
"div",
|
|
5343
|
+
{
|
|
5344
|
+
className: cn(
|
|
5345
|
+
"flex overflow-hidden rounded-xl border border-border glass shadow-lg",
|
|
5346
|
+
height,
|
|
5347
|
+
className
|
|
5348
|
+
),
|
|
5349
|
+
children: [
|
|
5350
|
+
sidebar && /* @__PURE__ */ jsxs34(
|
|
5351
|
+
"aside",
|
|
5352
|
+
{
|
|
5353
|
+
className: cn(
|
|
5354
|
+
"flex flex-col shrink-0 border-r border-border transition-all duration-200",
|
|
5355
|
+
collapsed ? "w-14" : sidebarWidth
|
|
5356
|
+
),
|
|
5357
|
+
children: [
|
|
5358
|
+
sidebarHeader && !collapsed && /* @__PURE__ */ jsx38("div", { className: "shrink-0 border-b border-border px-4 py-3 text-sm font-semibold", children: sidebarHeader }),
|
|
5359
|
+
sidebarHeader && collapsed && /* @__PURE__ */ jsx38("div", { className: "shrink-0 border-b border-border flex items-center justify-center py-3", children: sidebarHeader }),
|
|
5360
|
+
/* @__PURE__ */ jsx38("div", { className: "flex-1 overflow-y-auto py-2", children: sidebar }),
|
|
5361
|
+
sidebarFooter && !collapsed && /* @__PURE__ */ jsx38("div", { className: "shrink-0 border-t border-border px-4 py-3", children: sidebarFooter })
|
|
5362
|
+
]
|
|
5363
|
+
}
|
|
5364
|
+
),
|
|
5365
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex flex-1 min-w-0 flex-col", children: [
|
|
5366
|
+
/* @__PURE__ */ jsxs34("header", { className: "flex h-12 shrink-0 items-center justify-between border-b border-border px-4 gap-2", children: [
|
|
5367
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex items-center gap-2", children: [
|
|
5368
|
+
collapsible && sidebar && /* @__PURE__ */ jsx38(
|
|
5369
|
+
Tooltip,
|
|
5370
|
+
{
|
|
5371
|
+
content: collapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
5372
|
+
side: "bottom",
|
|
5373
|
+
children: /* @__PURE__ */ jsx38(
|
|
5374
|
+
"button",
|
|
5375
|
+
{
|
|
5376
|
+
type: "button",
|
|
5377
|
+
onClick: () => setCollapsed((c) => !c),
|
|
5378
|
+
className: "text-muted-foreground hover:text-foreground transition-colors",
|
|
5379
|
+
"aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
5380
|
+
children: collapsed ? /* @__PURE__ */ jsx38(PanelLeftOpen, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx38(PanelLeftClose, { className: "h-4 w-4" })
|
|
5381
|
+
}
|
|
5382
|
+
)
|
|
5383
|
+
}
|
|
5384
|
+
),
|
|
5385
|
+
topbar && /* @__PURE__ */ jsx38("div", { className: "flex items-center gap-2", children: topbar })
|
|
5386
|
+
] }),
|
|
5387
|
+
topbarTrailing && /* @__PURE__ */ jsx38("div", { className: "flex items-center gap-2", children: topbarTrailing })
|
|
5388
|
+
] }),
|
|
5389
|
+
/* @__PURE__ */ jsx38("main", { className: "flex-1 overflow-y-auto p-4", children })
|
|
5390
|
+
] })
|
|
5391
|
+
]
|
|
5392
|
+
}
|
|
5393
|
+
) });
|
|
5394
|
+
}
|
|
5395
|
+
function PanelSidebarItem({
|
|
5396
|
+
icon: Icon,
|
|
5397
|
+
label,
|
|
5398
|
+
active,
|
|
5399
|
+
onClick
|
|
5400
|
+
}) {
|
|
5401
|
+
const collapsed = React31.useContext(PanelCollapsedContext);
|
|
5402
|
+
return /* @__PURE__ */ jsx38(Tooltip, { content: label, side: "right", enabled: collapsed, children: /* @__PURE__ */ jsxs34(
|
|
5403
|
+
"button",
|
|
5404
|
+
{
|
|
5405
|
+
type: "button",
|
|
5406
|
+
onClick,
|
|
5407
|
+
className: cn(
|
|
5408
|
+
"flex w-full items-center rounded-md text-sm font-medium transition-colors",
|
|
5409
|
+
collapsed ? "justify-center h-9 w-9 mx-auto px-0" : "gap-2 px-3 py-2",
|
|
5410
|
+
active ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-primary/20 hover:text-primary cursor-pointer"
|
|
5411
|
+
),
|
|
5412
|
+
children: [
|
|
5413
|
+
Icon && /* @__PURE__ */ jsx38(Icon, { className: "h-4 w-4 shrink-0" }),
|
|
5414
|
+
!collapsed && /* @__PURE__ */ jsx38("span", { className: "truncate", children: label })
|
|
5415
|
+
]
|
|
5416
|
+
}
|
|
5417
|
+
) });
|
|
5418
|
+
}
|
|
5419
|
+
function PanelSidebarGroup({
|
|
5420
|
+
title,
|
|
5421
|
+
children
|
|
5422
|
+
}) {
|
|
5423
|
+
const collapsed = React31.useContext(PanelCollapsedContext);
|
|
5424
|
+
return /* @__PURE__ */ jsxs34("div", { className: "px-2 py-1", children: [
|
|
5425
|
+
title && !collapsed && /* @__PURE__ */ jsx38("p", { className: "mb-1 px-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground", children: title }),
|
|
5426
|
+
title && collapsed && /* @__PURE__ */ jsx38("div", { className: "mx-1 mb-1 h-px bg-border" }),
|
|
5427
|
+
/* @__PURE__ */ jsx38("div", { className: "space-y-0.5", children })
|
|
5428
|
+
] });
|
|
5429
|
+
}
|
|
5430
|
+
|
|
5431
|
+
// src/components/ui/resizable-panels.tsx
|
|
5432
|
+
import * as React32 from "react";
|
|
5433
|
+
import { jsx as jsx39, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
5243
5434
|
function ResizablePanels({
|
|
5244
5435
|
children,
|
|
5245
5436
|
orientation = "horizontal",
|
|
@@ -5249,15 +5440,15 @@ function ResizablePanels({
|
|
|
5249
5440
|
handleClassName,
|
|
5250
5441
|
className
|
|
5251
5442
|
}) {
|
|
5252
|
-
const [size, setSize] =
|
|
5253
|
-
const [dragging, setDragging] =
|
|
5254
|
-
const containerRef =
|
|
5443
|
+
const [size, setSize] = React32.useState(defaultSize);
|
|
5444
|
+
const [dragging, setDragging] = React32.useState(false);
|
|
5445
|
+
const containerRef = React32.useRef(null);
|
|
5255
5446
|
const isHorizontal = orientation === "horizontal";
|
|
5256
5447
|
function onMouseDown(e) {
|
|
5257
5448
|
e.preventDefault();
|
|
5258
5449
|
setDragging(true);
|
|
5259
5450
|
}
|
|
5260
|
-
|
|
5451
|
+
React32.useEffect(() => {
|
|
5261
5452
|
if (!dragging) return;
|
|
5262
5453
|
function onMove(e) {
|
|
5263
5454
|
const container = containerRef.current;
|
|
@@ -5276,7 +5467,7 @@ function ResizablePanels({
|
|
|
5276
5467
|
document.removeEventListener("mouseup", onUp);
|
|
5277
5468
|
};
|
|
5278
5469
|
}, [dragging, isHorizontal, minSize, maxSize]);
|
|
5279
|
-
return /* @__PURE__ */
|
|
5470
|
+
return /* @__PURE__ */ jsxs35(
|
|
5280
5471
|
"div",
|
|
5281
5472
|
{
|
|
5282
5473
|
ref: containerRef,
|
|
@@ -5287,7 +5478,7 @@ function ResizablePanels({
|
|
|
5287
5478
|
className
|
|
5288
5479
|
),
|
|
5289
5480
|
children: [
|
|
5290
|
-
/* @__PURE__ */
|
|
5481
|
+
/* @__PURE__ */ jsx39(
|
|
5291
5482
|
"div",
|
|
5292
5483
|
{
|
|
5293
5484
|
className: "overflow-auto",
|
|
@@ -5295,7 +5486,7 @@ function ResizablePanels({
|
|
|
5295
5486
|
children: children[0]
|
|
5296
5487
|
}
|
|
5297
5488
|
),
|
|
5298
|
-
/* @__PURE__ */
|
|
5489
|
+
/* @__PURE__ */ jsx39(
|
|
5299
5490
|
"div",
|
|
5300
5491
|
{
|
|
5301
5492
|
onMouseDown,
|
|
@@ -5305,13 +5496,13 @@ function ResizablePanels({
|
|
|
5305
5496
|
dragging && (isHorizontal ? "w-1.5 bg-primary/60" : "h-1.5 bg-primary/60"),
|
|
5306
5497
|
handleClassName
|
|
5307
5498
|
),
|
|
5308
|
-
children: /* @__PURE__ */
|
|
5499
|
+
children: /* @__PURE__ */ jsx39("div", { className: cn(
|
|
5309
5500
|
"rounded-full bg-muted-foreground/40",
|
|
5310
5501
|
isHorizontal ? "h-8 w-0.5" : "w-8 h-0.5"
|
|
5311
5502
|
) })
|
|
5312
5503
|
}
|
|
5313
5504
|
),
|
|
5314
|
-
/* @__PURE__ */
|
|
5505
|
+
/* @__PURE__ */ jsx39(
|
|
5315
5506
|
"div",
|
|
5316
5507
|
{
|
|
5317
5508
|
className: "flex-1 overflow-auto",
|
|
@@ -5325,26 +5516,26 @@ function ResizablePanels({
|
|
|
5325
5516
|
}
|
|
5326
5517
|
|
|
5327
5518
|
// src/components/ui/rich-text-editor.tsx
|
|
5328
|
-
import * as
|
|
5519
|
+
import * as React33 from "react";
|
|
5329
5520
|
import { Bold, Italic, Underline, List, ListOrdered, Link, Heading2, Heading3, Quote, Code, Undo, Redo } from "lucide-react";
|
|
5330
|
-
import { jsx as
|
|
5521
|
+
import { jsx as jsx40, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
5331
5522
|
var TOOLBAR = [
|
|
5332
|
-
{ icon: /* @__PURE__ */
|
|
5333
|
-
{ icon: /* @__PURE__ */
|
|
5523
|
+
{ icon: /* @__PURE__ */ jsx40(Undo, { className: "h-3.5 w-3.5" }), command: "undo", title: "Undo" },
|
|
5524
|
+
{ icon: /* @__PURE__ */ jsx40(Redo, { className: "h-3.5 w-3.5" }), command: "redo", title: "Redo" },
|
|
5334
5525
|
"divider",
|
|
5335
|
-
{ icon: /* @__PURE__ */
|
|
5336
|
-
{ icon: /* @__PURE__ */
|
|
5526
|
+
{ icon: /* @__PURE__ */ jsx40(Heading2, { className: "h-3.5 w-3.5" }), command: "formatBlock", value: "h2", title: "Heading 2" },
|
|
5527
|
+
{ icon: /* @__PURE__ */ jsx40(Heading3, { className: "h-3.5 w-3.5" }), command: "formatBlock", value: "h3", title: "Heading 3" },
|
|
5337
5528
|
"divider",
|
|
5338
|
-
{ icon: /* @__PURE__ */
|
|
5339
|
-
{ icon: /* @__PURE__ */
|
|
5340
|
-
{ icon: /* @__PURE__ */
|
|
5341
|
-
{ icon: /* @__PURE__ */
|
|
5529
|
+
{ icon: /* @__PURE__ */ jsx40(Bold, { className: "h-3.5 w-3.5" }), command: "bold", title: "Bold" },
|
|
5530
|
+
{ icon: /* @__PURE__ */ jsx40(Italic, { className: "h-3.5 w-3.5" }), command: "italic", title: "Italic" },
|
|
5531
|
+
{ icon: /* @__PURE__ */ jsx40(Underline, { className: "h-3.5 w-3.5" }), command: "underline", title: "Underline" },
|
|
5532
|
+
{ icon: /* @__PURE__ */ jsx40(Code, { className: "h-3.5 w-3.5" }), command: "formatBlock", value: "pre", title: "Code block" },
|
|
5342
5533
|
"divider",
|
|
5343
|
-
{ icon: /* @__PURE__ */
|
|
5344
|
-
{ icon: /* @__PURE__ */
|
|
5345
|
-
{ icon: /* @__PURE__ */
|
|
5534
|
+
{ icon: /* @__PURE__ */ jsx40(List, { className: "h-3.5 w-3.5" }), command: "insertUnorderedList", title: "Bullet list" },
|
|
5535
|
+
{ icon: /* @__PURE__ */ jsx40(ListOrdered, { className: "h-3.5 w-3.5" }), command: "insertOrderedList", title: "Numbered list" },
|
|
5536
|
+
{ icon: /* @__PURE__ */ jsx40(Quote, { className: "h-3.5 w-3.5" }), command: "formatBlock", value: "blockquote", title: "Quote" },
|
|
5346
5537
|
"divider",
|
|
5347
|
-
{ icon: /* @__PURE__ */
|
|
5538
|
+
{ icon: /* @__PURE__ */ jsx40(Link, { className: "h-3.5 w-3.5" }), command: "createLink", title: "Insert link" }
|
|
5348
5539
|
];
|
|
5349
5540
|
function RichTextEditor({
|
|
5350
5541
|
value: controlled,
|
|
@@ -5355,17 +5546,17 @@ function RichTextEditor({
|
|
|
5355
5546
|
disabled = false,
|
|
5356
5547
|
className
|
|
5357
5548
|
}) {
|
|
5358
|
-
const editorRef =
|
|
5359
|
-
const [focused, setFocused] =
|
|
5360
|
-
const [isEmpty, setIsEmpty] =
|
|
5361
|
-
|
|
5549
|
+
const editorRef = React33.useRef(null);
|
|
5550
|
+
const [focused, setFocused] = React33.useState(false);
|
|
5551
|
+
const [isEmpty, setIsEmpty] = React33.useState(!defaultValue);
|
|
5552
|
+
React33.useEffect(() => {
|
|
5362
5553
|
if (editorRef.current && controlled !== void 0) {
|
|
5363
5554
|
if (editorRef.current.innerHTML !== controlled) {
|
|
5364
5555
|
editorRef.current.innerHTML = controlled;
|
|
5365
5556
|
}
|
|
5366
5557
|
}
|
|
5367
5558
|
}, [controlled]);
|
|
5368
|
-
|
|
5559
|
+
React33.useEffect(() => {
|
|
5369
5560
|
if (editorRef.current && defaultValue) {
|
|
5370
5561
|
editorRef.current.innerHTML = defaultValue;
|
|
5371
5562
|
setIsEmpty(false);
|
|
@@ -5393,14 +5584,14 @@ function RichTextEditor({
|
|
|
5393
5584
|
return false;
|
|
5394
5585
|
}
|
|
5395
5586
|
}
|
|
5396
|
-
return /* @__PURE__ */
|
|
5587
|
+
return /* @__PURE__ */ jsxs36("div", { className: cn(
|
|
5397
5588
|
"rounded-xl border border-border overflow-hidden transition-colors",
|
|
5398
5589
|
focused && "ring-2 ring-ring border-primary",
|
|
5399
5590
|
disabled && "opacity-50 pointer-events-none",
|
|
5400
5591
|
className
|
|
5401
5592
|
), children: [
|
|
5402
|
-
/* @__PURE__ */
|
|
5403
|
-
(item, i) => item === "divider" ? /* @__PURE__ */
|
|
5593
|
+
/* @__PURE__ */ jsx40("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(
|
|
5594
|
+
(item, i) => item === "divider" ? /* @__PURE__ */ jsx40("span", { className: "mx-1 h-4 w-px bg-border" }, i) : /* @__PURE__ */ jsx40(
|
|
5404
5595
|
"button",
|
|
5405
5596
|
{
|
|
5406
5597
|
type: "button",
|
|
@@ -5418,9 +5609,9 @@ function RichTextEditor({
|
|
|
5418
5609
|
i
|
|
5419
5610
|
)
|
|
5420
5611
|
) }),
|
|
5421
|
-
/* @__PURE__ */
|
|
5422
|
-
isEmpty && !focused && /* @__PURE__ */
|
|
5423
|
-
/* @__PURE__ */
|
|
5612
|
+
/* @__PURE__ */ jsxs36("div", { className: "relative", children: [
|
|
5613
|
+
isEmpty && !focused && /* @__PURE__ */ jsx40("p", { className: "absolute top-3 left-4 text-sm text-muted-foreground pointer-events-none select-none", children: placeholder }),
|
|
5614
|
+
/* @__PURE__ */ jsx40(
|
|
5424
5615
|
"div",
|
|
5425
5616
|
{
|
|
5426
5617
|
ref: editorRef,
|
|
@@ -5447,7 +5638,7 @@ function RichTextEditor({
|
|
|
5447
5638
|
}
|
|
5448
5639
|
|
|
5449
5640
|
// src/components/ui/scroll-area.tsx
|
|
5450
|
-
import { jsx as
|
|
5641
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
5451
5642
|
function ScrollArea({
|
|
5452
5643
|
maxHeight,
|
|
5453
5644
|
maxWidth,
|
|
@@ -5462,7 +5653,7 @@ function ScrollArea({
|
|
|
5462
5653
|
horizontal: "overflow-x-auto overflow-y-hidden",
|
|
5463
5654
|
both: "overflow-auto"
|
|
5464
5655
|
}[orientation];
|
|
5465
|
-
return /* @__PURE__ */
|
|
5656
|
+
return /* @__PURE__ */ jsx41(
|
|
5466
5657
|
"div",
|
|
5467
5658
|
{
|
|
5468
5659
|
className: cn(
|
|
@@ -5482,9 +5673,9 @@ function ScrollArea({
|
|
|
5482
5673
|
}
|
|
5483
5674
|
|
|
5484
5675
|
// src/components/ui/section.tsx
|
|
5485
|
-
import * as
|
|
5676
|
+
import * as React34 from "react";
|
|
5486
5677
|
import { ChevronDown as ChevronDown6 } from "lucide-react";
|
|
5487
|
-
import { jsx as
|
|
5678
|
+
import { jsx as jsx42, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
5488
5679
|
var variantWrap = {
|
|
5489
5680
|
default: "",
|
|
5490
5681
|
card: "rounded-xl glass shadow-lg overflow-hidden",
|
|
@@ -5516,9 +5707,9 @@ function SectionBlock({
|
|
|
5516
5707
|
className,
|
|
5517
5708
|
contentClassName
|
|
5518
5709
|
}) {
|
|
5519
|
-
const [open, setOpen] =
|
|
5520
|
-
return /* @__PURE__ */
|
|
5521
|
-
(title || description || action) && /* @__PURE__ */
|
|
5710
|
+
const [open, setOpen] = React34.useState(defaultOpen);
|
|
5711
|
+
return /* @__PURE__ */ jsxs37("div", { className: cn(variantWrap[variant], className), children: [
|
|
5712
|
+
(title || description || action) && /* @__PURE__ */ jsxs37(
|
|
5522
5713
|
"div",
|
|
5523
5714
|
{
|
|
5524
5715
|
className: cn(
|
|
@@ -5529,16 +5720,16 @@ function SectionBlock({
|
|
|
5529
5720
|
),
|
|
5530
5721
|
onClick: collapsible ? () => setOpen((o) => !o) : void 0,
|
|
5531
5722
|
children: [
|
|
5532
|
-
/* @__PURE__ */
|
|
5533
|
-
icon && /* @__PURE__ */
|
|
5534
|
-
/* @__PURE__ */
|
|
5535
|
-
title && /* @__PURE__ */
|
|
5536
|
-
description && /* @__PURE__ */
|
|
5723
|
+
/* @__PURE__ */ jsxs37("div", { className: "flex items-start gap-3 min-w-0", children: [
|
|
5724
|
+
icon && /* @__PURE__ */ jsx42("span", { className: "mt-0.5 shrink-0 text-primary", children: icon }),
|
|
5725
|
+
/* @__PURE__ */ jsxs37("div", { className: "min-w-0", children: [
|
|
5726
|
+
title && /* @__PURE__ */ jsx42("h3", { className: "text-base font-semibold leading-tight", children: title }),
|
|
5727
|
+
description && /* @__PURE__ */ jsx42("p", { className: "mt-0.5 text-sm text-muted-foreground", children: description })
|
|
5537
5728
|
] })
|
|
5538
5729
|
] }),
|
|
5539
|
-
/* @__PURE__ */
|
|
5540
|
-
action && /* @__PURE__ */
|
|
5541
|
-
collapsible && /* @__PURE__ */
|
|
5730
|
+
/* @__PURE__ */ jsxs37("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
5731
|
+
action && /* @__PURE__ */ jsx42("div", { onClick: (e) => e.stopPropagation(), children: action }),
|
|
5732
|
+
collapsible && /* @__PURE__ */ jsx42(
|
|
5542
5733
|
ChevronDown6,
|
|
5543
5734
|
{
|
|
5544
5735
|
className: cn(
|
|
@@ -5551,17 +5742,17 @@ function SectionBlock({
|
|
|
5551
5742
|
]
|
|
5552
5743
|
}
|
|
5553
5744
|
),
|
|
5554
|
-
(!collapsible || open) && /* @__PURE__ */
|
|
5745
|
+
(!collapsible || open) && /* @__PURE__ */ jsx42("div", { className: cn(variantBody[variant], contentClassName), children })
|
|
5555
5746
|
] });
|
|
5556
5747
|
}
|
|
5557
5748
|
|
|
5558
5749
|
// src/components/ui/skeleton.tsx
|
|
5559
|
-
import { jsx as
|
|
5750
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
5560
5751
|
function Skeleton({
|
|
5561
5752
|
className,
|
|
5562
5753
|
...props
|
|
5563
5754
|
}) {
|
|
5564
|
-
return /* @__PURE__ */
|
|
5755
|
+
return /* @__PURE__ */ jsx43(
|
|
5565
5756
|
"div",
|
|
5566
5757
|
{
|
|
5567
5758
|
className: cn("animate-pulse rounded-md bg-white/5 backdrop-blur-sm", className),
|
|
@@ -5571,8 +5762,8 @@ function Skeleton({
|
|
|
5571
5762
|
}
|
|
5572
5763
|
|
|
5573
5764
|
// src/components/ui/slider.tsx
|
|
5574
|
-
import * as
|
|
5575
|
-
import { jsx as
|
|
5765
|
+
import * as React35 from "react";
|
|
5766
|
+
import { jsx as jsx44, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
5576
5767
|
function pct(val, min, max) {
|
|
5577
5768
|
return (val - min) / (max - min) * 100;
|
|
5578
5769
|
}
|
|
@@ -5591,8 +5782,8 @@ function Slider({
|
|
|
5591
5782
|
showValue = false,
|
|
5592
5783
|
className
|
|
5593
5784
|
}) {
|
|
5594
|
-
const [internal, setInternal] =
|
|
5595
|
-
const [hovering, setHovering] =
|
|
5785
|
+
const [internal, setInternal] = React35.useState(defaultValue);
|
|
5786
|
+
const [hovering, setHovering] = React35.useState(false);
|
|
5596
5787
|
const val = controlled ?? internal;
|
|
5597
5788
|
function handleChange(e) {
|
|
5598
5789
|
const v = Number(e.target.value);
|
|
@@ -5600,20 +5791,20 @@ function Slider({
|
|
|
5600
5791
|
onChange?.(v);
|
|
5601
5792
|
}
|
|
5602
5793
|
const p = pct(val, min, max);
|
|
5603
|
-
return /* @__PURE__ */
|
|
5604
|
-
(label || showValue) && /* @__PURE__ */
|
|
5605
|
-
label && /* @__PURE__ */
|
|
5606
|
-
showValue && /* @__PURE__ */
|
|
5794
|
+
return /* @__PURE__ */ jsxs38("div", { className: cn("w-full space-y-2", className), children: [
|
|
5795
|
+
(label || showValue) && /* @__PURE__ */ jsxs38("div", { className: "flex items-center justify-between text-sm", children: [
|
|
5796
|
+
label && /* @__PURE__ */ jsx44("span", { className: "font-medium", children: label }),
|
|
5797
|
+
showValue && /* @__PURE__ */ jsx44("span", { className: "text-muted-foreground tabular-nums", children: val })
|
|
5607
5798
|
] }),
|
|
5608
|
-
/* @__PURE__ */
|
|
5799
|
+
/* @__PURE__ */ jsxs38(
|
|
5609
5800
|
"div",
|
|
5610
5801
|
{
|
|
5611
5802
|
className: "relative flex items-center h-5",
|
|
5612
5803
|
onMouseEnter: () => setHovering(true),
|
|
5613
5804
|
onMouseLeave: () => setHovering(false),
|
|
5614
5805
|
children: [
|
|
5615
|
-
/* @__PURE__ */
|
|
5616
|
-
showTooltip && hovering && !disabled && /* @__PURE__ */
|
|
5806
|
+
/* @__PURE__ */ jsx44("div", { className: "absolute w-full h-1.5 rounded-full bg-muted overflow-hidden", children: /* @__PURE__ */ jsx44("div", { className: "h-full rounded-full bg-primary", style: { width: `${p}%` } }) }),
|
|
5807
|
+
showTooltip && hovering && !disabled && /* @__PURE__ */ jsx44(
|
|
5617
5808
|
"div",
|
|
5618
5809
|
{
|
|
5619
5810
|
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",
|
|
@@ -5621,7 +5812,7 @@ function Slider({
|
|
|
5621
5812
|
children: val
|
|
5622
5813
|
}
|
|
5623
5814
|
),
|
|
5624
|
-
/* @__PURE__ */
|
|
5815
|
+
/* @__PURE__ */ jsx44(
|
|
5625
5816
|
"input",
|
|
5626
5817
|
{
|
|
5627
5818
|
type: "range",
|
|
@@ -5637,7 +5828,7 @@ function Slider({
|
|
|
5637
5828
|
)
|
|
5638
5829
|
}
|
|
5639
5830
|
),
|
|
5640
|
-
/* @__PURE__ */
|
|
5831
|
+
/* @__PURE__ */ jsx44(
|
|
5641
5832
|
"div",
|
|
5642
5833
|
{
|
|
5643
5834
|
className: cn(
|
|
@@ -5650,9 +5841,9 @@ function Slider({
|
|
|
5650
5841
|
]
|
|
5651
5842
|
}
|
|
5652
5843
|
),
|
|
5653
|
-
(showMarks || marks) && /* @__PURE__ */
|
|
5654
|
-
/* @__PURE__ */
|
|
5655
|
-
m.label && /* @__PURE__ */
|
|
5844
|
+
(showMarks || marks) && /* @__PURE__ */ jsx44("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: [
|
|
5845
|
+
/* @__PURE__ */ jsx44("span", { className: "h-1 w-0.5 bg-border" }),
|
|
5846
|
+
m.label && /* @__PURE__ */ jsx44("span", { className: "text-[10px] text-muted-foreground", children: m.label })
|
|
5656
5847
|
] }, m.value)) })
|
|
5657
5848
|
] });
|
|
5658
5849
|
}
|
|
@@ -5669,8 +5860,8 @@ function RangeSlider({
|
|
|
5669
5860
|
showValue = false,
|
|
5670
5861
|
className
|
|
5671
5862
|
}) {
|
|
5672
|
-
const [internal, setInternal] =
|
|
5673
|
-
const [active, setActive] =
|
|
5863
|
+
const [internal, setInternal] = React35.useState(defaultValue);
|
|
5864
|
+
const [active, setActive] = React35.useState(null);
|
|
5674
5865
|
const val = controlled ?? internal;
|
|
5675
5866
|
function handleChange(idx, e) {
|
|
5676
5867
|
const v = Number(e.target.value);
|
|
@@ -5680,21 +5871,21 @@ function RangeSlider({
|
|
|
5680
5871
|
}
|
|
5681
5872
|
const p0 = pct(val[0], min, max);
|
|
5682
5873
|
const p1 = pct(val[1], min, max);
|
|
5683
|
-
return /* @__PURE__ */
|
|
5684
|
-
(label || showValue) && /* @__PURE__ */
|
|
5685
|
-
label && /* @__PURE__ */
|
|
5686
|
-
showValue && /* @__PURE__ */
|
|
5874
|
+
return /* @__PURE__ */ jsxs38("div", { className: cn("w-full space-y-2", className), children: [
|
|
5875
|
+
(label || showValue) && /* @__PURE__ */ jsxs38("div", { className: "flex items-center justify-between text-sm", children: [
|
|
5876
|
+
label && /* @__PURE__ */ jsx44("span", { className: "font-medium", children: label }),
|
|
5877
|
+
showValue && /* @__PURE__ */ jsxs38("span", { className: "text-muted-foreground tabular-nums", children: [
|
|
5687
5878
|
val[0],
|
|
5688
5879
|
" \u2013 ",
|
|
5689
5880
|
val[1]
|
|
5690
5881
|
] })
|
|
5691
5882
|
] }),
|
|
5692
|
-
/* @__PURE__ */
|
|
5693
|
-
/* @__PURE__ */
|
|
5883
|
+
/* @__PURE__ */ jsxs38("div", { className: "relative flex items-center h-5", children: [
|
|
5884
|
+
/* @__PURE__ */ jsx44("div", { className: "absolute w-full h-1.5 rounded-full bg-muted", children: /* @__PURE__ */ jsx44("div", { className: "absolute h-full rounded-full bg-primary", style: { left: `${p0}%`, width: `${p1 - p0}%` } }) }),
|
|
5694
5885
|
[0, 1].map((idx) => {
|
|
5695
5886
|
const p = idx === 0 ? p0 : p1;
|
|
5696
|
-
return /* @__PURE__ */
|
|
5697
|
-
showTooltip && active === idx && !disabled && /* @__PURE__ */
|
|
5887
|
+
return /* @__PURE__ */ jsxs38(React35.Fragment, { children: [
|
|
5888
|
+
showTooltip && active === idx && !disabled && /* @__PURE__ */ jsx44(
|
|
5698
5889
|
"div",
|
|
5699
5890
|
{
|
|
5700
5891
|
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",
|
|
@@ -5702,7 +5893,7 @@ function RangeSlider({
|
|
|
5702
5893
|
children: val[idx]
|
|
5703
5894
|
}
|
|
5704
5895
|
),
|
|
5705
|
-
/* @__PURE__ */
|
|
5896
|
+
/* @__PURE__ */ jsx44(
|
|
5706
5897
|
"input",
|
|
5707
5898
|
{
|
|
5708
5899
|
type: "range",
|
|
@@ -5718,7 +5909,7 @@ function RangeSlider({
|
|
|
5718
5909
|
style: { zIndex: idx === 1 ? 2 : 1 }
|
|
5719
5910
|
}
|
|
5720
5911
|
),
|
|
5721
|
-
/* @__PURE__ */
|
|
5912
|
+
/* @__PURE__ */ jsx44(
|
|
5722
5913
|
"div",
|
|
5723
5914
|
{
|
|
5724
5915
|
className: "absolute h-4 w-4 rounded-full border-2 border-primary bg-background shadow-md pointer-events-none",
|
|
@@ -5733,7 +5924,7 @@ function RangeSlider({
|
|
|
5733
5924
|
|
|
5734
5925
|
// src/components/ui/stat-card.tsx
|
|
5735
5926
|
import { TrendingUp, TrendingDown, Minus } from "lucide-react";
|
|
5736
|
-
import { jsx as
|
|
5927
|
+
import { jsx as jsx45, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
5737
5928
|
function Sparkline2({ data, trend }) {
|
|
5738
5929
|
if (data.length < 2) return null;
|
|
5739
5930
|
const min = Math.min(...data);
|
|
@@ -5747,7 +5938,7 @@ function Sparkline2({ data, trend }) {
|
|
|
5747
5938
|
return `${x},${y}`;
|
|
5748
5939
|
}).join(" ");
|
|
5749
5940
|
const color = trend === "up" ? "stroke-success" : trend === "down" ? "stroke-danger" : "stroke-primary";
|
|
5750
|
-
return /* @__PURE__ */
|
|
5941
|
+
return /* @__PURE__ */ jsx45("svg", { width: w, height: h, className: "overflow-visible", children: /* @__PURE__ */ jsx45(
|
|
5751
5942
|
"polyline",
|
|
5752
5943
|
{
|
|
5753
5944
|
points: pts,
|
|
@@ -5775,38 +5966,38 @@ function StatCard({
|
|
|
5775
5966
|
const TrendIcon = autoTrend === "up" ? TrendingUp : autoTrend === "down" ? TrendingDown : Minus;
|
|
5776
5967
|
const trendColor = autoTrend === "up" ? "text-success" : autoTrend === "down" ? "text-danger" : "text-muted-foreground";
|
|
5777
5968
|
if (loading) {
|
|
5778
|
-
return /* @__PURE__ */
|
|
5779
|
-
/* @__PURE__ */
|
|
5780
|
-
/* @__PURE__ */
|
|
5781
|
-
/* @__PURE__ */
|
|
5969
|
+
return /* @__PURE__ */ jsxs39("div", { className: cn("rounded-xl glass p-5 space-y-3 animate-pulse", className), children: [
|
|
5970
|
+
/* @__PURE__ */ jsx45("div", { className: "h-3 w-24 rounded bg-muted" }),
|
|
5971
|
+
/* @__PURE__ */ jsx45("div", { className: "h-7 w-32 rounded bg-muted" }),
|
|
5972
|
+
/* @__PURE__ */ jsx45("div", { className: "h-3 w-16 rounded bg-muted" })
|
|
5782
5973
|
] });
|
|
5783
5974
|
}
|
|
5784
|
-
return /* @__PURE__ */
|
|
5785
|
-
/* @__PURE__ */
|
|
5786
|
-
/* @__PURE__ */
|
|
5787
|
-
icon && /* @__PURE__ */
|
|
5975
|
+
return /* @__PURE__ */ jsxs39("div", { className: cn("rounded-xl glass p-5 space-y-3", className), children: [
|
|
5976
|
+
/* @__PURE__ */ jsxs39("div", { className: "flex items-start justify-between gap-2", children: [
|
|
5977
|
+
/* @__PURE__ */ jsx45("p", { className: "text-sm text-muted-foreground font-medium", children: title }),
|
|
5978
|
+
icon && /* @__PURE__ */ jsx45("span", { className: "flex h-9 w-9 items-center justify-center rounded-lg bg-primary/10 text-primary shrink-0", children: icon })
|
|
5788
5979
|
] }),
|
|
5789
|
-
/* @__PURE__ */
|
|
5790
|
-
/* @__PURE__ */
|
|
5791
|
-
sparkline && /* @__PURE__ */
|
|
5980
|
+
/* @__PURE__ */ jsxs39("div", { className: "flex items-end justify-between gap-2", children: [
|
|
5981
|
+
/* @__PURE__ */ jsx45("p", { className: "text-3xl font-bold tracking-tight", children: value }),
|
|
5982
|
+
sparkline && /* @__PURE__ */ jsx45(Sparkline2, { data: sparkline, trend: autoTrend })
|
|
5792
5983
|
] }),
|
|
5793
|
-
/* @__PURE__ */
|
|
5794
|
-
change !== void 0 && /* @__PURE__ */
|
|
5795
|
-
/* @__PURE__ */
|
|
5984
|
+
/* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-1.5", children: [
|
|
5985
|
+
change !== void 0 && /* @__PURE__ */ jsxs39("span", { className: cn("flex items-center gap-0.5 text-xs font-semibold", trendColor), children: [
|
|
5986
|
+
/* @__PURE__ */ jsx45(TrendIcon, { className: "h-3.5 w-3.5" }),
|
|
5796
5987
|
change > 0 ? "+" : "",
|
|
5797
5988
|
change,
|
|
5798
5989
|
"%"
|
|
5799
5990
|
] }),
|
|
5800
|
-
changeLabel && /* @__PURE__ */
|
|
5801
|
-
description && !changeLabel && /* @__PURE__ */
|
|
5991
|
+
changeLabel && /* @__PURE__ */ jsx45("span", { className: "text-xs text-muted-foreground", children: changeLabel }),
|
|
5992
|
+
description && !changeLabel && /* @__PURE__ */ jsx45("span", { className: "text-xs text-muted-foreground", children: description })
|
|
5802
5993
|
] })
|
|
5803
5994
|
] });
|
|
5804
5995
|
}
|
|
5805
5996
|
|
|
5806
5997
|
// src/components/ui/stepper.tsx
|
|
5807
|
-
import * as
|
|
5998
|
+
import * as React36 from "react";
|
|
5808
5999
|
import { Check as Check6, X as X10 } from "lucide-react";
|
|
5809
|
-
import { jsx as
|
|
6000
|
+
import { jsx as jsx46, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
5810
6001
|
function getStatus(idx, current) {
|
|
5811
6002
|
if (idx < current) return "complete";
|
|
5812
6003
|
if (idx === current) return "current";
|
|
@@ -5827,7 +6018,7 @@ function Stepper({
|
|
|
5827
6018
|
clickable = false,
|
|
5828
6019
|
className
|
|
5829
6020
|
}) {
|
|
5830
|
-
const [internal, setInternal] =
|
|
6021
|
+
const [internal, setInternal] = React36.useState(defaultCurrent);
|
|
5831
6022
|
const current = controlled ?? internal;
|
|
5832
6023
|
function go(idx) {
|
|
5833
6024
|
if (!clickable) return;
|
|
@@ -5835,20 +6026,20 @@ function Stepper({
|
|
|
5835
6026
|
onChange?.(idx);
|
|
5836
6027
|
}
|
|
5837
6028
|
const isHorizontal = orientation === "horizontal";
|
|
5838
|
-
return /* @__PURE__ */
|
|
5839
|
-
/* @__PURE__ */
|
|
6029
|
+
return /* @__PURE__ */ jsxs40("div", { className: cn("w-full", className), children: [
|
|
6030
|
+
/* @__PURE__ */ jsx46("div", { className: cn(
|
|
5840
6031
|
"flex",
|
|
5841
6032
|
isHorizontal ? "flex-row items-start" : "flex-col gap-0"
|
|
5842
6033
|
), children: steps.map((step, i) => {
|
|
5843
6034
|
const status = getStatus(i, current);
|
|
5844
6035
|
const isLast = i === steps.length - 1;
|
|
5845
|
-
return /* @__PURE__ */
|
|
6036
|
+
return /* @__PURE__ */ jsx46(React36.Fragment, { children: /* @__PURE__ */ jsxs40("div", { className: cn(
|
|
5846
6037
|
"flex",
|
|
5847
6038
|
isHorizontal ? "flex-col items-center flex-1" : "flex-row gap-4"
|
|
5848
6039
|
), children: [
|
|
5849
|
-
/* @__PURE__ */
|
|
5850
|
-
isHorizontal && i > 0 && /* @__PURE__ */
|
|
5851
|
-
/* @__PURE__ */
|
|
6040
|
+
/* @__PURE__ */ jsxs40("div", { className: cn("flex items-center", isHorizontal ? "w-full" : "flex-col"), children: [
|
|
6041
|
+
isHorizontal && i > 0 && /* @__PURE__ */ jsx46("div", { className: cn("flex-1 h-0.5 transition-colors", i <= current ? "bg-primary" : "bg-border") }),
|
|
6042
|
+
/* @__PURE__ */ jsx46(
|
|
5852
6043
|
"button",
|
|
5853
6044
|
{
|
|
5854
6045
|
type: "button",
|
|
@@ -5860,35 +6051,35 @@ function Stepper({
|
|
|
5860
6051
|
clickable && "cursor-pointer hover:scale-110",
|
|
5861
6052
|
!clickable && "cursor-default"
|
|
5862
6053
|
),
|
|
5863
|
-
children: status === "complete" ? /* @__PURE__ */
|
|
6054
|
+
children: status === "complete" ? /* @__PURE__ */ jsx46(Check6, { className: "h-4 w-4" }) : status === "error" ? /* @__PURE__ */ jsx46(X10, { className: "h-4 w-4" }) : step.icon ?? /* @__PURE__ */ jsx46("span", { children: i + 1 })
|
|
5864
6055
|
}
|
|
5865
6056
|
),
|
|
5866
|
-
isHorizontal && !isLast && /* @__PURE__ */
|
|
5867
|
-
!isHorizontal && !isLast && /* @__PURE__ */
|
|
6057
|
+
isHorizontal && !isLast && /* @__PURE__ */ jsx46("div", { className: cn("flex-1 h-0.5 transition-colors", i < current ? "bg-primary" : "bg-border") }),
|
|
6058
|
+
!isHorizontal && !isLast && /* @__PURE__ */ jsx46("div", { className: cn("w-0.5 flex-1 min-h-8 transition-colors mt-1", i < current ? "bg-primary" : "bg-border") })
|
|
5868
6059
|
] }),
|
|
5869
|
-
/* @__PURE__ */
|
|
6060
|
+
/* @__PURE__ */ jsxs40("div", { className: cn(
|
|
5870
6061
|
isHorizontal ? "mt-2 text-center px-1" : "pb-6 min-w-0"
|
|
5871
6062
|
), children: [
|
|
5872
|
-
/* @__PURE__ */
|
|
6063
|
+
/* @__PURE__ */ jsxs40("p", { className: cn(
|
|
5873
6064
|
"text-sm font-medium leading-tight",
|
|
5874
6065
|
status === "current" ? "text-primary" : status === "complete" ? "text-foreground" : "text-muted-foreground"
|
|
5875
6066
|
), children: [
|
|
5876
6067
|
step.label,
|
|
5877
|
-
step.optional && /* @__PURE__ */
|
|
6068
|
+
step.optional && /* @__PURE__ */ jsx46("span", { className: "ml-1 text-xs text-muted-foreground", children: "(optional)" })
|
|
5878
6069
|
] }),
|
|
5879
|
-
step.description && /* @__PURE__ */
|
|
5880
|
-
!isHorizontal && step.content && i === current && /* @__PURE__ */
|
|
6070
|
+
step.description && /* @__PURE__ */ jsx46("p", { className: "text-xs text-muted-foreground mt-0.5", children: step.description }),
|
|
6071
|
+
!isHorizontal && step.content && i === current && /* @__PURE__ */ jsx46("div", { className: "mt-3", children: step.content })
|
|
5881
6072
|
] })
|
|
5882
6073
|
] }) }, i);
|
|
5883
6074
|
}) }),
|
|
5884
|
-
isHorizontal && steps[current]?.content && /* @__PURE__ */
|
|
6075
|
+
isHorizontal && steps[current]?.content && /* @__PURE__ */ jsx46("div", { className: "mt-6", children: steps[current].content })
|
|
5885
6076
|
] });
|
|
5886
6077
|
}
|
|
5887
6078
|
|
|
5888
6079
|
// src/components/ui/table.tsx
|
|
5889
|
-
import * as
|
|
6080
|
+
import * as React37 from "react";
|
|
5890
6081
|
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";
|
|
5891
|
-
import { Fragment as
|
|
6082
|
+
import { Fragment as Fragment10, jsx as jsx47, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
5892
6083
|
var BADGE_COLORS = {
|
|
5893
6084
|
active: "bg-success/10 text-success border-success/20",
|
|
5894
6085
|
inactive: "bg-muted text-muted-foreground border-border",
|
|
@@ -5911,11 +6102,11 @@ function Table({
|
|
|
5911
6102
|
idKey = "id",
|
|
5912
6103
|
className
|
|
5913
6104
|
}) {
|
|
5914
|
-
const [search, setSearch] =
|
|
5915
|
-
const [currentPage, setCurrentPage] =
|
|
5916
|
-
const [selectedIds, setSelectedIds] =
|
|
5917
|
-
const [sortKey, setSortKey] =
|
|
5918
|
-
const [sortDir, setSortDir] =
|
|
6105
|
+
const [search, setSearch] = React37.useState("");
|
|
6106
|
+
const [currentPage, setCurrentPage] = React37.useState(1);
|
|
6107
|
+
const [selectedIds, setSelectedIds] = React37.useState([]);
|
|
6108
|
+
const [sortKey, setSortKey] = React37.useState(null);
|
|
6109
|
+
const [sortDir, setSortDir] = React37.useState(null);
|
|
5919
6110
|
const handleSort = (key) => {
|
|
5920
6111
|
if (sortKey !== key) {
|
|
5921
6112
|
setSortKey(key);
|
|
@@ -5929,7 +6120,7 @@ function Table({
|
|
|
5929
6120
|
setSortKey(null);
|
|
5930
6121
|
setSortDir(null);
|
|
5931
6122
|
};
|
|
5932
|
-
const filteredData =
|
|
6123
|
+
const filteredData = React37.useMemo(() => {
|
|
5933
6124
|
let d = search ? data.filter(
|
|
5934
6125
|
(item) => Object.values(item).some(
|
|
5935
6126
|
(val) => val && typeof val === "string" && val.toLowerCase().includes(search.toLowerCase())
|
|
@@ -5947,18 +6138,18 @@ function Table({
|
|
|
5947
6138
|
}, [data, search, sortKey, sortDir]);
|
|
5948
6139
|
const totalPages = Math.max(1, Math.ceil(filteredData.length / itemsPerPage));
|
|
5949
6140
|
const safePage = Math.min(currentPage, totalPages);
|
|
5950
|
-
const paginatedData =
|
|
6141
|
+
const paginatedData = React37.useMemo(() => {
|
|
5951
6142
|
if (!pagination) return filteredData;
|
|
5952
6143
|
const start = (safePage - 1) * itemsPerPage;
|
|
5953
6144
|
return filteredData.slice(start, start + itemsPerPage);
|
|
5954
6145
|
}, [filteredData, pagination, safePage, itemsPerPage]);
|
|
5955
|
-
|
|
6146
|
+
React37.useEffect(() => {
|
|
5956
6147
|
setCurrentPage(1);
|
|
5957
6148
|
}, [search]);
|
|
5958
6149
|
const handleSelectAll = (checked) => setSelectedIds(checked ? paginatedData.map((item) => String(item[idKey])) : []);
|
|
5959
6150
|
const handleSelect = (id, checked) => setSelectedIds((prev) => checked ? [...prev, id] : prev.filter((i) => i !== id));
|
|
5960
6151
|
const allSelected = paginatedData.length > 0 && selectedIds.length === paginatedData.length;
|
|
5961
|
-
const pagePills =
|
|
6152
|
+
const pagePills = React37.useMemo(() => {
|
|
5962
6153
|
if (totalPages <= 5) return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
5963
6154
|
if (safePage <= 3) return [1, 2, 3, 4, 5];
|
|
5964
6155
|
if (safePage >= totalPages - 2) return [totalPages - 4, totalPages - 3, totalPages - 2, totalPages - 1, totalPages];
|
|
@@ -5966,14 +6157,14 @@ function Table({
|
|
|
5966
6157
|
}, [totalPages, safePage]);
|
|
5967
6158
|
const SortIcon = ({ col }) => {
|
|
5968
6159
|
if (!col.sortable) return null;
|
|
5969
|
-
if (sortKey !== String(col.key)) return /* @__PURE__ */
|
|
5970
|
-
return sortDir === "asc" ? /* @__PURE__ */
|
|
6160
|
+
if (sortKey !== String(col.key)) return /* @__PURE__ */ jsx47(ChevronsUpDown2, { className: "ml-1.5 h-3.5 w-3.5 opacity-40" });
|
|
6161
|
+
return sortDir === "asc" ? /* @__PURE__ */ jsx47(ChevronUp2, { className: "ml-1.5 h-3.5 w-3.5 text-primary" }) : /* @__PURE__ */ jsx47(ChevronDown7, { className: "ml-1.5 h-3.5 w-3.5 text-primary" });
|
|
5971
6162
|
};
|
|
5972
|
-
return /* @__PURE__ */
|
|
5973
|
-
/* @__PURE__ */
|
|
5974
|
-
searchable && /* @__PURE__ */
|
|
5975
|
-
/* @__PURE__ */
|
|
5976
|
-
/* @__PURE__ */
|
|
6163
|
+
return /* @__PURE__ */ jsxs41("div", { className: cn("w-full space-y-3", className), children: [
|
|
6164
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex items-center justify-between gap-3 flex-wrap", children: [
|
|
6165
|
+
searchable && /* @__PURE__ */ jsxs41("div", { className: "relative w-72", children: [
|
|
6166
|
+
/* @__PURE__ */ jsx47(Search5, { className: "absolute text-primary left-3 top-1/2 -translate-y-1/2 h-4 w-4 z-10" }),
|
|
6167
|
+
/* @__PURE__ */ jsx47(
|
|
5977
6168
|
"input",
|
|
5978
6169
|
{
|
|
5979
6170
|
placeholder: searchPlaceholder,
|
|
@@ -5982,17 +6173,17 @@ function Table({
|
|
|
5982
6173
|
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"
|
|
5983
6174
|
}
|
|
5984
6175
|
),
|
|
5985
|
-
search && /* @__PURE__ */
|
|
6176
|
+
search && /* @__PURE__ */ jsx47(
|
|
5986
6177
|
"button",
|
|
5987
6178
|
{
|
|
5988
6179
|
onClick: () => setSearch(""),
|
|
5989
6180
|
className: "absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",
|
|
5990
|
-
children: /* @__PURE__ */
|
|
6181
|
+
children: /* @__PURE__ */ jsx47(X11, { className: "h-3.5 w-3.5" })
|
|
5991
6182
|
}
|
|
5992
6183
|
)
|
|
5993
6184
|
] }),
|
|
5994
|
-
/* @__PURE__ */
|
|
5995
|
-
selectable && onBulkDelete && selectedIds.length > 0 && /* @__PURE__ */
|
|
6185
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-2 ml-auto", children: [
|
|
6186
|
+
selectable && onBulkDelete && selectedIds.length > 0 && /* @__PURE__ */ jsxs41(
|
|
5996
6187
|
"button",
|
|
5997
6188
|
{
|
|
5998
6189
|
onClick: () => {
|
|
@@ -6001,14 +6192,14 @@ function Table({
|
|
|
6001
6192
|
},
|
|
6002
6193
|
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",
|
|
6003
6194
|
children: [
|
|
6004
|
-
/* @__PURE__ */
|
|
6195
|
+
/* @__PURE__ */ jsx47(Trash23, { className: "h-3.5 w-3.5" }),
|
|
6005
6196
|
"Delete ",
|
|
6006
6197
|
selectedIds.length,
|
|
6007
6198
|
" selected"
|
|
6008
6199
|
]
|
|
6009
6200
|
}
|
|
6010
6201
|
),
|
|
6011
|
-
/* @__PURE__ */
|
|
6202
|
+
/* @__PURE__ */ jsxs41("span", { className: "text-xs text-muted-foreground", children: [
|
|
6012
6203
|
filteredData.length,
|
|
6013
6204
|
" ",
|
|
6014
6205
|
filteredData.length === 1 ? "row" : "rows",
|
|
@@ -6016,16 +6207,16 @@ function Table({
|
|
|
6016
6207
|
] })
|
|
6017
6208
|
] })
|
|
6018
6209
|
] }),
|
|
6019
|
-
/* @__PURE__ */
|
|
6020
|
-
/* @__PURE__ */
|
|
6021
|
-
selectable && /* @__PURE__ */
|
|
6210
|
+
/* @__PURE__ */ jsx47("div", { className: "rounded-xl border border-border overflow-hidden bg-card/50 backdrop-blur-sm shadow-sm", children: /* @__PURE__ */ jsx47("div", { className: "w-full overflow-auto", children: /* @__PURE__ */ jsxs41("table", { className: "w-full caption-bottom text-sm", children: [
|
|
6211
|
+
/* @__PURE__ */ jsx47("thead", { children: /* @__PURE__ */ jsxs41("tr", { className: "border-b border-border bg-muted/40", children: [
|
|
6212
|
+
selectable && /* @__PURE__ */ jsx47("th", { className: "h-11 w-[46px] px-4 text-left align-middle", children: /* @__PURE__ */ jsx47(
|
|
6022
6213
|
Checkbox,
|
|
6023
6214
|
{
|
|
6024
6215
|
checked: allSelected,
|
|
6025
6216
|
onChange: (e) => handleSelectAll(e.target.checked)
|
|
6026
6217
|
}
|
|
6027
6218
|
) }),
|
|
6028
|
-
columns.map((col) => /* @__PURE__ */
|
|
6219
|
+
columns.map((col) => /* @__PURE__ */ jsx47(
|
|
6029
6220
|
"th",
|
|
6030
6221
|
{
|
|
6031
6222
|
onClick: () => col.sortable && handleSort(String(col.key)),
|
|
@@ -6033,29 +6224,29 @@ function Table({
|
|
|
6033
6224
|
"h-11 px-4 text-left align-middle text-xs font-semibold uppercase tracking-wider text-muted-foreground select-none whitespace-nowrap",
|
|
6034
6225
|
col.sortable && "cursor-pointer hover:text-foreground transition-colors"
|
|
6035
6226
|
),
|
|
6036
|
-
children: /* @__PURE__ */
|
|
6227
|
+
children: /* @__PURE__ */ jsxs41("span", { className: "inline-flex items-center", children: [
|
|
6037
6228
|
col.title,
|
|
6038
|
-
/* @__PURE__ */
|
|
6229
|
+
/* @__PURE__ */ jsx47(SortIcon, { col })
|
|
6039
6230
|
] })
|
|
6040
6231
|
},
|
|
6041
6232
|
String(col.key)
|
|
6042
6233
|
))
|
|
6043
6234
|
] }) }),
|
|
6044
|
-
/* @__PURE__ */
|
|
6235
|
+
/* @__PURE__ */ jsx47("tbody", { children: paginatedData.length === 0 ? /* @__PURE__ */ jsx47("tr", { children: /* @__PURE__ */ jsx47(
|
|
6045
6236
|
"td",
|
|
6046
6237
|
{
|
|
6047
6238
|
colSpan: columns.length + (selectable ? 1 : 0),
|
|
6048
6239
|
className: "h-32 text-center align-middle",
|
|
6049
|
-
children: /* @__PURE__ */
|
|
6050
|
-
/* @__PURE__ */
|
|
6051
|
-
/* @__PURE__ */
|
|
6052
|
-
search && /* @__PURE__ */
|
|
6240
|
+
children: /* @__PURE__ */ jsxs41("div", { className: "flex flex-col items-center gap-1 text-muted-foreground", children: [
|
|
6241
|
+
/* @__PURE__ */ jsx47(Search5, { className: "h-8 w-8 opacity-20" }),
|
|
6242
|
+
/* @__PURE__ */ jsx47("span", { className: "text-sm", children: "No results found" }),
|
|
6243
|
+
search && /* @__PURE__ */ jsx47("button", { onClick: () => setSearch(""), className: "text-xs text-primary hover:underline", children: "Clear search" })
|
|
6053
6244
|
] })
|
|
6054
6245
|
}
|
|
6055
6246
|
) }) : paginatedData.map((item, i) => {
|
|
6056
6247
|
const id = String(item[idKey] || i);
|
|
6057
6248
|
const isSelected = selectedIds.includes(id);
|
|
6058
|
-
return /* @__PURE__ */
|
|
6249
|
+
return /* @__PURE__ */ jsxs41(
|
|
6059
6250
|
"tr",
|
|
6060
6251
|
{
|
|
6061
6252
|
className: cn(
|
|
@@ -6063,38 +6254,38 @@ function Table({
|
|
|
6063
6254
|
isSelected ? "bg-primary/5 hover:bg-primary/8" : "hover:bg-muted/30"
|
|
6064
6255
|
),
|
|
6065
6256
|
children: [
|
|
6066
|
-
selectable && /* @__PURE__ */
|
|
6257
|
+
selectable && /* @__PURE__ */ jsx47("td", { className: "px-4 py-3 align-middle", children: /* @__PURE__ */ jsx47(
|
|
6067
6258
|
Checkbox,
|
|
6068
6259
|
{
|
|
6069
6260
|
checked: isSelected,
|
|
6070
6261
|
onChange: (e) => handleSelect(id, e.target.checked)
|
|
6071
6262
|
}
|
|
6072
6263
|
) }),
|
|
6073
|
-
columns.map((col) => /* @__PURE__ */
|
|
6264
|
+
columns.map((col) => /* @__PURE__ */ jsx47("td", { className: "px-4 py-3 align-middle", children: col.render ? col.render(item) : col.type === "image" ? /* @__PURE__ */ jsx47(
|
|
6074
6265
|
"img",
|
|
6075
6266
|
{
|
|
6076
6267
|
src: item[col.key],
|
|
6077
6268
|
alt: item[col.key],
|
|
6078
6269
|
className: "h-9 w-9 rounded-lg object-cover ring-1 ring-border"
|
|
6079
6270
|
}
|
|
6080
|
-
) : col.type === "badge" ? /* @__PURE__ */
|
|
6271
|
+
) : col.type === "badge" ? /* @__PURE__ */ jsxs41("span", { className: cn(
|
|
6081
6272
|
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-medium",
|
|
6082
6273
|
badgeClass(String(item[col.key]))
|
|
6083
6274
|
), children: [
|
|
6084
|
-
/* @__PURE__ */
|
|
6275
|
+
/* @__PURE__ */ jsx47("span", { className: cn(
|
|
6085
6276
|
"mr-1.5 h-1.5 w-1.5 rounded-full",
|
|
6086
6277
|
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"
|
|
6087
6278
|
) }),
|
|
6088
6279
|
item[col.key]
|
|
6089
|
-
] }) : col.type === "stack" ? /* @__PURE__ */
|
|
6280
|
+
] }) : col.type === "stack" ? /* @__PURE__ */ jsx47(AvatarStack, { images: Array.isArray(item[col.key]) ? item[col.key] : [], ...col.stackProps ?? {} }) : col.type === "icon" ? /* @__PURE__ */ jsx47("span", { className: "flex items-center", children: item[col.key] }) : col.type === "select" ? /* @__PURE__ */ jsx47(
|
|
6090
6281
|
"select",
|
|
6091
6282
|
{
|
|
6092
6283
|
value: item[col.key],
|
|
6093
6284
|
onChange: (e) => col.onChange?.(item, e.target.value),
|
|
6094
6285
|
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",
|
|
6095
|
-
children: (col.selectOptions ?? []).map((opt) => /* @__PURE__ */
|
|
6286
|
+
children: (col.selectOptions ?? []).map((opt) => /* @__PURE__ */ jsx47("option", { value: opt, children: opt }, opt))
|
|
6096
6287
|
}
|
|
6097
|
-
) : col.type === "toggle" ? /* @__PURE__ */
|
|
6288
|
+
) : col.type === "toggle" ? /* @__PURE__ */ jsx47(
|
|
6098
6289
|
"button",
|
|
6099
6290
|
{
|
|
6100
6291
|
role: "switch",
|
|
@@ -6104,13 +6295,13 @@ function Table({
|
|
|
6104
6295
|
"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",
|
|
6105
6296
|
item[col.key] ? "bg-primary" : "bg-muted"
|
|
6106
6297
|
),
|
|
6107
|
-
children: /* @__PURE__ */
|
|
6298
|
+
children: /* @__PURE__ */ jsx47("span", { className: cn(
|
|
6108
6299
|
"pointer-events-none inline-block h-4 w-4 rounded-full bg-white shadow-sm transition-transform",
|
|
6109
6300
|
item[col.key] ? "translate-x-4" : "translate-x-0"
|
|
6110
6301
|
) })
|
|
6111
6302
|
}
|
|
6112
|
-
) : col.type === "color" ? /* @__PURE__ */
|
|
6113
|
-
/* @__PURE__ */
|
|
6303
|
+
) : col.type === "color" ? /* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-2", children: [
|
|
6304
|
+
/* @__PURE__ */ jsx47(
|
|
6114
6305
|
"input",
|
|
6115
6306
|
{
|
|
6116
6307
|
type: "color",
|
|
@@ -6119,22 +6310,22 @@ function Table({
|
|
|
6119
6310
|
className: "h-7 w-7 cursor-pointer rounded border border-border bg-transparent p-0.5"
|
|
6120
6311
|
}
|
|
6121
6312
|
),
|
|
6122
|
-
/* @__PURE__ */
|
|
6123
|
-
] }) : col.type === "checkbox" ? /* @__PURE__ */
|
|
6313
|
+
/* @__PURE__ */ jsx47("span", { className: "text-xs text-muted-foreground font-mono", children: item[col.key] })
|
|
6314
|
+
] }) : col.type === "checkbox" ? /* @__PURE__ */ jsx47(
|
|
6124
6315
|
Checkbox,
|
|
6125
6316
|
{
|
|
6126
6317
|
checked: !!item[col.key],
|
|
6127
6318
|
onChange: (e) => col.onChange?.(item, e.target.checked)
|
|
6128
6319
|
}
|
|
6129
|
-
) : /* @__PURE__ */
|
|
6320
|
+
) : /* @__PURE__ */ jsx47("span", { className: "text-foreground/90", children: item[col.key] }) }, String(col.key)))
|
|
6130
6321
|
]
|
|
6131
6322
|
},
|
|
6132
6323
|
id
|
|
6133
6324
|
);
|
|
6134
6325
|
}) })
|
|
6135
6326
|
] }) }) }),
|
|
6136
|
-
pagination && totalPages > 1 && /* @__PURE__ */
|
|
6137
|
-
/* @__PURE__ */
|
|
6327
|
+
pagination && totalPages > 1 && /* @__PURE__ */ jsxs41("div", { className: "flex items-center justify-between gap-2 flex-wrap", children: [
|
|
6328
|
+
/* @__PURE__ */ jsxs41("span", { className: "text-xs text-muted-foreground", children: [
|
|
6138
6329
|
"Showing ",
|
|
6139
6330
|
(safePage - 1) * itemsPerPage + 1,
|
|
6140
6331
|
"\u2013",
|
|
@@ -6142,21 +6333,21 @@ function Table({
|
|
|
6142
6333
|
" of ",
|
|
6143
6334
|
filteredData.length
|
|
6144
6335
|
] }),
|
|
6145
|
-
/* @__PURE__ */
|
|
6146
|
-
/* @__PURE__ */
|
|
6336
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-1", children: [
|
|
6337
|
+
/* @__PURE__ */ jsx47(
|
|
6147
6338
|
"button",
|
|
6148
6339
|
{
|
|
6149
6340
|
onClick: () => setCurrentPage((p) => Math.max(1, p - 1)),
|
|
6150
6341
|
disabled: safePage === 1,
|
|
6151
6342
|
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",
|
|
6152
|
-
children: /* @__PURE__ */
|
|
6343
|
+
children: /* @__PURE__ */ jsx47(ChevronLeft5, { className: "h-4 w-4" })
|
|
6153
6344
|
}
|
|
6154
6345
|
),
|
|
6155
|
-
pagePills[0] > 1 && /* @__PURE__ */
|
|
6156
|
-
/* @__PURE__ */
|
|
6157
|
-
pagePills[0] > 2 && /* @__PURE__ */
|
|
6346
|
+
pagePills[0] > 1 && /* @__PURE__ */ jsxs41(Fragment10, { children: [
|
|
6347
|
+
/* @__PURE__ */ jsx47("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" }),
|
|
6348
|
+
pagePills[0] > 2 && /* @__PURE__ */ jsx47("span", { className: "px-1 text-muted-foreground text-xs", children: "\u2026" })
|
|
6158
6349
|
] }),
|
|
6159
|
-
pagePills.map((p) => /* @__PURE__ */
|
|
6350
|
+
pagePills.map((p) => /* @__PURE__ */ jsx47(
|
|
6160
6351
|
"button",
|
|
6161
6352
|
{
|
|
6162
6353
|
onClick: () => setCurrentPage(p),
|
|
@@ -6168,17 +6359,17 @@ function Table({
|
|
|
6168
6359
|
},
|
|
6169
6360
|
p
|
|
6170
6361
|
)),
|
|
6171
|
-
pagePills[pagePills.length - 1] < totalPages && /* @__PURE__ */
|
|
6172
|
-
pagePills[pagePills.length - 1] < totalPages - 1 && /* @__PURE__ */
|
|
6173
|
-
/* @__PURE__ */
|
|
6362
|
+
pagePills[pagePills.length - 1] < totalPages && /* @__PURE__ */ jsxs41(Fragment10, { children: [
|
|
6363
|
+
pagePills[pagePills.length - 1] < totalPages - 1 && /* @__PURE__ */ jsx47("span", { className: "px-1 text-muted-foreground text-xs", children: "\u2026" }),
|
|
6364
|
+
/* @__PURE__ */ jsx47("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 })
|
|
6174
6365
|
] }),
|
|
6175
|
-
/* @__PURE__ */
|
|
6366
|
+
/* @__PURE__ */ jsx47(
|
|
6176
6367
|
"button",
|
|
6177
6368
|
{
|
|
6178
6369
|
onClick: () => setCurrentPage((p) => Math.min(totalPages, p + 1)),
|
|
6179
6370
|
disabled: safePage === totalPages,
|
|
6180
6371
|
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",
|
|
6181
|
-
children: /* @__PURE__ */
|
|
6372
|
+
children: /* @__PURE__ */ jsx47(ChevronRight8, { className: "h-4 w-4" })
|
|
6182
6373
|
}
|
|
6183
6374
|
)
|
|
6184
6375
|
] })
|
|
@@ -6187,8 +6378,8 @@ function Table({
|
|
|
6187
6378
|
}
|
|
6188
6379
|
|
|
6189
6380
|
// src/components/ui/tabs.tsx
|
|
6190
|
-
import * as
|
|
6191
|
-
import { jsx as
|
|
6381
|
+
import * as React38 from "react";
|
|
6382
|
+
import { jsx as jsx48, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
6192
6383
|
var sizeMap = {
|
|
6193
6384
|
sm: "px-3 py-1.5 text-xs",
|
|
6194
6385
|
md: "px-4 py-2 text-sm",
|
|
@@ -6238,15 +6429,15 @@ function Tabs({
|
|
|
6238
6429
|
fullWidth = false,
|
|
6239
6430
|
className
|
|
6240
6431
|
}) {
|
|
6241
|
-
const [internal, setInternal] =
|
|
6432
|
+
const [internal, setInternal] = React38.useState(defaultValue ?? items[0]?.value ?? "");
|
|
6242
6433
|
const active = controlledValue ?? internal;
|
|
6243
6434
|
const select = (v) => {
|
|
6244
6435
|
if (!controlledValue) setInternal(v);
|
|
6245
6436
|
onChange?.(v);
|
|
6246
6437
|
};
|
|
6247
6438
|
const activeItem = items.find((i) => i.value === active);
|
|
6248
|
-
return /* @__PURE__ */
|
|
6249
|
-
/* @__PURE__ */
|
|
6439
|
+
return /* @__PURE__ */ jsxs42("div", { className: cn("w-full", className), children: [
|
|
6440
|
+
/* @__PURE__ */ jsx48("div", { className: cn("flex", fullWidth && "w-full", variantTrack[variant]), children: items.map((item) => /* @__PURE__ */ jsxs42(
|
|
6250
6441
|
"button",
|
|
6251
6442
|
{
|
|
6252
6443
|
type: "button",
|
|
@@ -6257,20 +6448,20 @@ function Tabs({
|
|
|
6257
6448
|
fullWidth && "flex-1 justify-center"
|
|
6258
6449
|
),
|
|
6259
6450
|
children: [
|
|
6260
|
-
item.icon && /* @__PURE__ */
|
|
6451
|
+
item.icon && /* @__PURE__ */ jsx48("span", { className: "shrink-0", children: item.icon }),
|
|
6261
6452
|
item.label,
|
|
6262
|
-
item.badge && /* @__PURE__ */
|
|
6453
|
+
item.badge && /* @__PURE__ */ jsx48("span", { className: "shrink-0", children: item.badge })
|
|
6263
6454
|
]
|
|
6264
6455
|
},
|
|
6265
6456
|
item.value
|
|
6266
6457
|
)) }),
|
|
6267
|
-
activeItem?.content && /* @__PURE__ */
|
|
6458
|
+
activeItem?.content && /* @__PURE__ */ jsx48("div", { className: "mt-4", children: activeItem.content })
|
|
6268
6459
|
] });
|
|
6269
6460
|
}
|
|
6270
6461
|
|
|
6271
6462
|
// src/components/ui/tag-input.tsx
|
|
6272
|
-
import * as
|
|
6273
|
-
import { jsx as
|
|
6463
|
+
import * as React39 from "react";
|
|
6464
|
+
import { jsx as jsx49, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
6274
6465
|
function TagInput({
|
|
6275
6466
|
value: controlled,
|
|
6276
6467
|
defaultValue = [],
|
|
@@ -6281,9 +6472,9 @@ function TagInput({
|
|
|
6281
6472
|
disabled = false,
|
|
6282
6473
|
className
|
|
6283
6474
|
}) {
|
|
6284
|
-
const [internal, setInternal] =
|
|
6285
|
-
const [input, setInput] =
|
|
6286
|
-
const inputRef =
|
|
6475
|
+
const [internal, setInternal] = React39.useState(defaultValue);
|
|
6476
|
+
const [input, setInput] = React39.useState("");
|
|
6477
|
+
const inputRef = React39.useRef(null);
|
|
6287
6478
|
const tags = controlled ?? internal;
|
|
6288
6479
|
function addTag(raw) {
|
|
6289
6480
|
const tag = raw.trim();
|
|
@@ -6308,7 +6499,7 @@ function TagInput({
|
|
|
6308
6499
|
removeTag(tags.length - 1);
|
|
6309
6500
|
}
|
|
6310
6501
|
}
|
|
6311
|
-
return /* @__PURE__ */
|
|
6502
|
+
return /* @__PURE__ */ jsxs43(
|
|
6312
6503
|
"div",
|
|
6313
6504
|
{
|
|
6314
6505
|
className: cn(
|
|
@@ -6319,8 +6510,8 @@ function TagInput({
|
|
|
6319
6510
|
),
|
|
6320
6511
|
onClick: () => inputRef.current?.focus(),
|
|
6321
6512
|
children: [
|
|
6322
|
-
tags.map((tag, i) => /* @__PURE__ */
|
|
6323
|
-
/* @__PURE__ */
|
|
6513
|
+
tags.map((tag, i) => /* @__PURE__ */ jsx49(Badge, { variant: "default", size: "sm", removable: true, onRemove: () => removeTag(i), children: tag }, i)),
|
|
6514
|
+
/* @__PURE__ */ jsx49(
|
|
6324
6515
|
"input",
|
|
6325
6516
|
{
|
|
6326
6517
|
ref: inputRef,
|
|
@@ -6340,7 +6531,7 @@ function TagInput({
|
|
|
6340
6531
|
|
|
6341
6532
|
// src/components/ui/timeline.tsx
|
|
6342
6533
|
import { CheckCircle as CheckCircle3, XCircle as XCircle2, AlertTriangle as AlertTriangle3, Info as Info2, Circle } from "lucide-react";
|
|
6343
|
-
import { jsx as
|
|
6534
|
+
import { jsx as jsx50, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
6344
6535
|
var DOT_COLOR = {
|
|
6345
6536
|
default: "bg-primary border-primary/30",
|
|
6346
6537
|
success: "bg-success border-success/30",
|
|
@@ -6356,41 +6547,41 @@ var ICON_COLOR = {
|
|
|
6356
6547
|
info: "text-info"
|
|
6357
6548
|
};
|
|
6358
6549
|
var DEFAULT_ICON = {
|
|
6359
|
-
default: /* @__PURE__ */
|
|
6360
|
-
success: /* @__PURE__ */
|
|
6361
|
-
error: /* @__PURE__ */
|
|
6362
|
-
warning: /* @__PURE__ */
|
|
6363
|
-
info: /* @__PURE__ */
|
|
6550
|
+
default: /* @__PURE__ */ jsx50(Circle, { className: "h-3 w-3" }),
|
|
6551
|
+
success: /* @__PURE__ */ jsx50(CheckCircle3, { className: "h-3.5 w-3.5" }),
|
|
6552
|
+
error: /* @__PURE__ */ jsx50(XCircle2, { className: "h-3.5 w-3.5" }),
|
|
6553
|
+
warning: /* @__PURE__ */ jsx50(AlertTriangle3, { className: "h-3.5 w-3.5" }),
|
|
6554
|
+
info: /* @__PURE__ */ jsx50(Info2, { className: "h-3.5 w-3.5" })
|
|
6364
6555
|
};
|
|
6365
6556
|
function Timeline({ items, align = "left", className }) {
|
|
6366
|
-
return /* @__PURE__ */
|
|
6557
|
+
return /* @__PURE__ */ jsx50("div", { className: cn("relative", className), children: items.map((item, i) => {
|
|
6367
6558
|
const variant = item.variant ?? "default";
|
|
6368
6559
|
const isLast = i === items.length - 1;
|
|
6369
6560
|
const isRight = align === "alternate" && i % 2 === 1;
|
|
6370
|
-
return /* @__PURE__ */
|
|
6371
|
-
/* @__PURE__ */
|
|
6372
|
-
/* @__PURE__ */
|
|
6561
|
+
return /* @__PURE__ */ jsxs44("div", { className: cn("relative flex gap-4", align === "alternate" && "justify-center", isRight && "flex-row-reverse"), children: [
|
|
6562
|
+
/* @__PURE__ */ jsxs44("div", { className: "flex flex-col items-center", children: [
|
|
6563
|
+
/* @__PURE__ */ jsx50("div", { className: cn(
|
|
6373
6564
|
"flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 z-10",
|
|
6374
6565
|
item.icon ? "bg-background border-border" : DOT_COLOR[variant]
|
|
6375
|
-
), children: /* @__PURE__ */
|
|
6376
|
-
!isLast && /* @__PURE__ */
|
|
6566
|
+
), children: /* @__PURE__ */ jsx50("span", { className: cn("shrink-0", item.icon ? ICON_COLOR[variant] : "text-white"), children: item.icon ?? DEFAULT_ICON[variant] }) }),
|
|
6567
|
+
!isLast && /* @__PURE__ */ jsx50("div", { className: "w-0.5 flex-1 bg-border mt-1 mb-1 min-h-4" })
|
|
6377
6568
|
] }),
|
|
6378
|
-
/* @__PURE__ */
|
|
6379
|
-
/* @__PURE__ */
|
|
6380
|
-
/* @__PURE__ */
|
|
6381
|
-
item.time && /* @__PURE__ */
|
|
6569
|
+
/* @__PURE__ */ jsxs44("div", { className: cn("flex-1 pb-6 min-w-0", isRight && "text-right"), children: [
|
|
6570
|
+
/* @__PURE__ */ jsxs44("div", { className: cn("flex items-start justify-between gap-2", isRight && "flex-row-reverse"), children: [
|
|
6571
|
+
/* @__PURE__ */ jsx50("p", { className: "text-sm font-semibold leading-tight", children: item.title }),
|
|
6572
|
+
item.time && /* @__PURE__ */ jsx50("span", { className: "shrink-0 text-xs text-muted-foreground whitespace-nowrap", children: item.time })
|
|
6382
6573
|
] }),
|
|
6383
|
-
item.description && /* @__PURE__ */
|
|
6384
|
-
item.content && /* @__PURE__ */
|
|
6574
|
+
item.description && /* @__PURE__ */ jsx50("p", { className: "mt-0.5 text-xs text-muted-foreground leading-snug", children: item.description }),
|
|
6575
|
+
item.content && /* @__PURE__ */ jsx50("div", { className: "mt-2", children: item.content })
|
|
6385
6576
|
] })
|
|
6386
6577
|
] }, item.id ?? i);
|
|
6387
6578
|
}) });
|
|
6388
6579
|
}
|
|
6389
6580
|
|
|
6390
6581
|
// src/components/ui/toggle-switch.tsx
|
|
6391
|
-
import * as
|
|
6392
|
-
import { jsx as
|
|
6393
|
-
var ToggleSwitch =
|
|
6582
|
+
import * as React40 from "react";
|
|
6583
|
+
import { jsx as jsx51, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
6584
|
+
var ToggleSwitch = React40.forwardRef(
|
|
6394
6585
|
({
|
|
6395
6586
|
className,
|
|
6396
6587
|
inline = false,
|
|
@@ -6408,10 +6599,10 @@ var ToggleSwitch = React38.forwardRef(
|
|
|
6408
6599
|
disabled,
|
|
6409
6600
|
...props
|
|
6410
6601
|
}, ref) => {
|
|
6411
|
-
const toggleId = id ??
|
|
6602
|
+
const toggleId = id ?? React40.useId();
|
|
6412
6603
|
const trackW = width ? typeof width === "number" ? `${width}px` : width : "2.75rem";
|
|
6413
6604
|
const trackH = height ? typeof height === "number" ? `${height}px` : height : "1.5rem";
|
|
6414
|
-
const [internalChecked, setInternalChecked] =
|
|
6605
|
+
const [internalChecked, setInternalChecked] = React40.useState(defaultChecked ?? false);
|
|
6415
6606
|
const isControlled = checked !== void 0;
|
|
6416
6607
|
const isOn = accepted ? true : declined ? false : isControlled ? checked : internalChecked;
|
|
6417
6608
|
const stateColor = accepted ? acceptedColor ?? "#22c55e" : declined ? declinedColor ?? "#ef4444" : isOn ? void 0 : void 0;
|
|
@@ -6420,13 +6611,13 @@ var ToggleSwitch = React38.forwardRef(
|
|
|
6420
6611
|
if (!isControlled) setInternalChecked(e.target.checked);
|
|
6421
6612
|
onChange?.(e);
|
|
6422
6613
|
};
|
|
6423
|
-
const toggle = /* @__PURE__ */
|
|
6614
|
+
const toggle = /* @__PURE__ */ jsxs45(
|
|
6424
6615
|
"label",
|
|
6425
6616
|
{
|
|
6426
6617
|
htmlFor: toggleId,
|
|
6427
6618
|
className: cn("relative inline-flex items-center cursor-pointer", disabled && "opacity-50 cursor-not-allowed"),
|
|
6428
6619
|
children: [
|
|
6429
|
-
/* @__PURE__ */
|
|
6620
|
+
/* @__PURE__ */ jsx51(
|
|
6430
6621
|
"input",
|
|
6431
6622
|
{
|
|
6432
6623
|
type: "checkbox",
|
|
@@ -6439,7 +6630,7 @@ var ToggleSwitch = React38.forwardRef(
|
|
|
6439
6630
|
...props
|
|
6440
6631
|
}
|
|
6441
6632
|
),
|
|
6442
|
-
/* @__PURE__ */
|
|
6633
|
+
/* @__PURE__ */ jsx51(
|
|
6443
6634
|
"div",
|
|
6444
6635
|
{
|
|
6445
6636
|
className: cn(
|
|
@@ -6452,7 +6643,7 @@ var ToggleSwitch = React38.forwardRef(
|
|
|
6452
6643
|
height: trackH,
|
|
6453
6644
|
...stateColor ? { backgroundColor: stateColor } : {}
|
|
6454
6645
|
},
|
|
6455
|
-
children: /* @__PURE__ */
|
|
6646
|
+
children: /* @__PURE__ */ jsx51(
|
|
6456
6647
|
"span",
|
|
6457
6648
|
{
|
|
6458
6649
|
className: `absolute top-[1px] ${isOn ? "bg-slate-50/40" : "bg-primary"} rounded-full border border-slate-300/50 shadow transition-transform duration-200`,
|
|
@@ -6470,9 +6661,9 @@ var ToggleSwitch = React38.forwardRef(
|
|
|
6470
6661
|
}
|
|
6471
6662
|
);
|
|
6472
6663
|
if (inline && label) {
|
|
6473
|
-
return /* @__PURE__ */
|
|
6664
|
+
return /* @__PURE__ */ jsxs45("div", { className: "inline-flex items-center gap-2 select-none", children: [
|
|
6474
6665
|
toggle,
|
|
6475
|
-
/* @__PURE__ */
|
|
6666
|
+
/* @__PURE__ */ jsx51("label", { htmlFor: toggleId, className: cn("text-sm cursor-pointer", disabled && "opacity-50 cursor-not-allowed"), children: label })
|
|
6476
6667
|
] });
|
|
6477
6668
|
}
|
|
6478
6669
|
return toggle;
|
|
@@ -6480,62 +6671,17 @@ var ToggleSwitch = React38.forwardRef(
|
|
|
6480
6671
|
);
|
|
6481
6672
|
ToggleSwitch.displayName = "ToggleSwitch";
|
|
6482
6673
|
|
|
6483
|
-
// src/components/ui/tooltip.tsx
|
|
6484
|
-
import * as React39 from "react";
|
|
6485
|
-
import { Fragment as Fragment10, jsx as jsx50, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
6486
|
-
function Tooltip({
|
|
6487
|
-
content,
|
|
6488
|
-
children,
|
|
6489
|
-
side = "right",
|
|
6490
|
-
className,
|
|
6491
|
-
enabled = true
|
|
6492
|
-
}) {
|
|
6493
|
-
const [visible, setVisible] = React39.useState(false);
|
|
6494
|
-
if (!enabled) return /* @__PURE__ */ jsx50(Fragment10, { children });
|
|
6495
|
-
const sideClasses = {
|
|
6496
|
-
right: "left-full top-1/2 -translate-y-1/2 ml-2",
|
|
6497
|
-
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
6498
|
-
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
6499
|
-
bottom: "top-full left-1/2 -translate-x-1/2 mt-2"
|
|
6500
|
-
};
|
|
6501
|
-
return /* @__PURE__ */ jsxs44(
|
|
6502
|
-
"div",
|
|
6503
|
-
{
|
|
6504
|
-
className: "relative inline-flex",
|
|
6505
|
-
onMouseEnter: () => setVisible(true),
|
|
6506
|
-
onMouseLeave: () => setVisible(false),
|
|
6507
|
-
onFocus: () => setVisible(true),
|
|
6508
|
-
onBlur: () => setVisible(false),
|
|
6509
|
-
children: [
|
|
6510
|
-
children,
|
|
6511
|
-
visible && /* @__PURE__ */ jsx50(
|
|
6512
|
-
"div",
|
|
6513
|
-
{
|
|
6514
|
-
role: "tooltip",
|
|
6515
|
-
className: cn(
|
|
6516
|
-
"absolute z-50 whitespace-nowrap rounded-md bg-foreground px-2.5 py-1 text-xs font-medium text-background shadow-lg pointer-events-none",
|
|
6517
|
-
sideClasses[side],
|
|
6518
|
-
className
|
|
6519
|
-
),
|
|
6520
|
-
children: content
|
|
6521
|
-
}
|
|
6522
|
-
)
|
|
6523
|
-
]
|
|
6524
|
-
}
|
|
6525
|
-
);
|
|
6526
|
-
}
|
|
6527
|
-
|
|
6528
6674
|
// src/components/ui/tree-view.tsx
|
|
6529
|
-
import * as
|
|
6675
|
+
import * as React41 from "react";
|
|
6530
6676
|
import { ChevronRight as ChevronRight9, Folder, FolderOpen, File } from "lucide-react";
|
|
6531
|
-
import { jsx as
|
|
6677
|
+
import { jsx as jsx52, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
6532
6678
|
function TreeNodeItem({ node, depth, selected, expanded, onToggleExpand, onSelect, multiple }) {
|
|
6533
6679
|
const hasChildren = !!node.children?.length;
|
|
6534
6680
|
const isExpanded = expanded.includes(node.id);
|
|
6535
6681
|
const isSelected = selected.includes(node.id);
|
|
6536
|
-
const defaultIcon = hasChildren ? isExpanded ? /* @__PURE__ */
|
|
6537
|
-
return /* @__PURE__ */
|
|
6538
|
-
/* @__PURE__ */
|
|
6682
|
+
const defaultIcon = hasChildren ? isExpanded ? /* @__PURE__ */ jsx52(FolderOpen, { className: "h-4 w-4 text-warning" }) : /* @__PURE__ */ jsx52(Folder, { className: "h-4 w-4 text-warning" }) : /* @__PURE__ */ jsx52(File, { className: "h-4 w-4 text-muted-foreground" });
|
|
6683
|
+
return /* @__PURE__ */ jsxs46("div", { children: [
|
|
6684
|
+
/* @__PURE__ */ jsxs46(
|
|
6539
6685
|
"div",
|
|
6540
6686
|
{
|
|
6541
6687
|
className: cn(
|
|
@@ -6549,13 +6695,13 @@ function TreeNodeItem({ node, depth, selected, expanded, onToggleExpand, onSelec
|
|
|
6549
6695
|
onSelect(node.id);
|
|
6550
6696
|
},
|
|
6551
6697
|
children: [
|
|
6552
|
-
hasChildren ? /* @__PURE__ */
|
|
6553
|
-
/* @__PURE__ */
|
|
6554
|
-
/* @__PURE__ */
|
|
6698
|
+
hasChildren ? /* @__PURE__ */ jsx52(ChevronRight9, { className: cn("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform", isExpanded && "rotate-90") }) : /* @__PURE__ */ jsx52("span", { className: "w-3.5 shrink-0" }),
|
|
6699
|
+
/* @__PURE__ */ jsx52("span", { className: "shrink-0", children: node.icon ?? defaultIcon }),
|
|
6700
|
+
/* @__PURE__ */ jsx52("span", { className: "truncate", children: node.label })
|
|
6555
6701
|
]
|
|
6556
6702
|
}
|
|
6557
6703
|
),
|
|
6558
|
-
hasChildren && isExpanded && /* @__PURE__ */
|
|
6704
|
+
hasChildren && isExpanded && /* @__PURE__ */ jsx52("div", { children: node.children.map((child) => /* @__PURE__ */ jsx52(
|
|
6559
6705
|
TreeNodeItem,
|
|
6560
6706
|
{
|
|
6561
6707
|
node: child,
|
|
@@ -6580,8 +6726,8 @@ function TreeView({
|
|
|
6580
6726
|
className
|
|
6581
6727
|
}) {
|
|
6582
6728
|
const init = defaultSelected ? Array.isArray(defaultSelected) ? defaultSelected : [defaultSelected] : [];
|
|
6583
|
-
const [internal, setInternal] =
|
|
6584
|
-
const [expanded, setExpanded] =
|
|
6729
|
+
const [internal, setInternal] = React41.useState(init);
|
|
6730
|
+
const [expanded, setExpanded] = React41.useState(defaultExpanded);
|
|
6585
6731
|
const selected = controlled ? Array.isArray(controlled) ? controlled : [controlled] : internal;
|
|
6586
6732
|
function handleSelect(id) {
|
|
6587
6733
|
let next;
|
|
@@ -6596,7 +6742,7 @@ function TreeView({
|
|
|
6596
6742
|
function toggleExpand(id) {
|
|
6597
6743
|
setExpanded((prev) => prev.includes(id) ? prev.filter((v) => v !== id) : [...prev, id]);
|
|
6598
6744
|
}
|
|
6599
|
-
return /* @__PURE__ */
|
|
6745
|
+
return /* @__PURE__ */ jsx52("div", { className: cn("w-full", className), children: nodes.map((node) => /* @__PURE__ */ jsx52(
|
|
6600
6746
|
TreeNodeItem,
|
|
6601
6747
|
{
|
|
6602
6748
|
node,
|
|
@@ -6612,8 +6758,8 @@ function TreeView({
|
|
|
6612
6758
|
}
|
|
6613
6759
|
|
|
6614
6760
|
// src/components/ui/widget.tsx
|
|
6615
|
-
import * as
|
|
6616
|
-
import { jsx as
|
|
6761
|
+
import * as React42 from "react";
|
|
6762
|
+
import { jsx as jsx53, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
6617
6763
|
var iconColorMap = {
|
|
6618
6764
|
primary: "bg-primary/10 text-primary",
|
|
6619
6765
|
info: "bg-info/10 text-info",
|
|
@@ -6641,8 +6787,8 @@ var variantMap = {
|
|
|
6641
6787
|
outline: "bg-transparent border-2"
|
|
6642
6788
|
};
|
|
6643
6789
|
function useCountUp(target, enabled, duration = 1e3) {
|
|
6644
|
-
const [display, setDisplay] =
|
|
6645
|
-
|
|
6790
|
+
const [display, setDisplay] = React42.useState(enabled ? 0 : target);
|
|
6791
|
+
React42.useEffect(() => {
|
|
6646
6792
|
if (!enabled) {
|
|
6647
6793
|
setDisplay(target);
|
|
6648
6794
|
return;
|
|
@@ -6685,7 +6831,7 @@ function Widget({
|
|
|
6685
6831
|
const counted = useCountUp(isNumeric ? value : 0, animate && isNumeric);
|
|
6686
6832
|
const displayValue = animate && isNumeric ? counted : value;
|
|
6687
6833
|
const s = sizeMap2[size];
|
|
6688
|
-
return /* @__PURE__ */
|
|
6834
|
+
return /* @__PURE__ */ jsx53(
|
|
6689
6835
|
Card,
|
|
6690
6836
|
{
|
|
6691
6837
|
className: cn(
|
|
@@ -6696,27 +6842,27 @@ function Widget({
|
|
|
6696
6842
|
),
|
|
6697
6843
|
onClick,
|
|
6698
6844
|
...props,
|
|
6699
|
-
children: /* @__PURE__ */
|
|
6700
|
-
/* @__PURE__ */
|
|
6701
|
-
/* @__PURE__ */
|
|
6702
|
-
/* @__PURE__ */
|
|
6703
|
-
/* @__PURE__ */
|
|
6704
|
-
badge && /* @__PURE__ */
|
|
6845
|
+
children: /* @__PURE__ */ jsxs47(CardContent, { className: s.card, children: [
|
|
6846
|
+
/* @__PURE__ */ jsxs47("div", { className: "flex items-start justify-between gap-3", children: [
|
|
6847
|
+
/* @__PURE__ */ jsxs47("div", { className: "min-w-0 flex-1 space-y-1", children: [
|
|
6848
|
+
/* @__PURE__ */ jsxs47("div", { className: "flex items-center gap-2", children: [
|
|
6849
|
+
/* @__PURE__ */ jsx53("p", { className: "text-sm font-medium text-muted-foreground truncate", children: title }),
|
|
6850
|
+
badge && /* @__PURE__ */ jsx53("span", { className: "shrink-0", children: badge })
|
|
6705
6851
|
] }),
|
|
6706
|
-
loading ? /* @__PURE__ */
|
|
6707
|
-
description && /* @__PURE__ */
|
|
6852
|
+
loading ? /* @__PURE__ */ jsx53("div", { className: "h-8 w-24 animate-pulse rounded-md bg-muted" }) : /* @__PURE__ */ jsx53("div", { className: cn("font-bold tabular-nums", s.value), children: displayValue }),
|
|
6853
|
+
description && /* @__PURE__ */ jsx53("p", { className: "text-xs text-muted-foreground", children: description })
|
|
6708
6854
|
] }),
|
|
6709
|
-
icon && /* @__PURE__ */
|
|
6855
|
+
icon && /* @__PURE__ */ jsxs47("div", { className: cn(
|
|
6710
6856
|
"relative flex shrink-0 items-center justify-center rounded-full",
|
|
6711
6857
|
s.icon,
|
|
6712
6858
|
iconColorMap[iconColor]
|
|
6713
6859
|
), children: [
|
|
6714
|
-
pulse && /* @__PURE__ */
|
|
6715
|
-
/* @__PURE__ */
|
|
6860
|
+
pulse && /* @__PURE__ */ jsx53("span", { className: "absolute inset-0 rounded-full animate-ping opacity-30 bg-current" }),
|
|
6861
|
+
/* @__PURE__ */ jsx53("span", { className: s.iconSize, children: icon })
|
|
6716
6862
|
] })
|
|
6717
6863
|
] }),
|
|
6718
|
-
trendValue && !loading && /* @__PURE__ */
|
|
6719
|
-
/* @__PURE__ */
|
|
6864
|
+
trendValue && !loading && /* @__PURE__ */ jsxs47("div", { className: "mt-3 flex items-center gap-1.5 text-sm", children: [
|
|
6865
|
+
/* @__PURE__ */ jsxs47("span", { className: cn(
|
|
6720
6866
|
"font-medium",
|
|
6721
6867
|
trend === "up" && "text-success",
|
|
6722
6868
|
trend === "down" && "text-danger",
|
|
@@ -6726,21 +6872,21 @@ function Widget({
|
|
|
6726
6872
|
trend === "down" && "\u2193 ",
|
|
6727
6873
|
trendValue
|
|
6728
6874
|
] }),
|
|
6729
|
-
previousValue !== void 0 && /* @__PURE__ */
|
|
6875
|
+
previousValue !== void 0 && /* @__PURE__ */ jsxs47("span", { className: "text-muted-foreground", children: [
|
|
6730
6876
|
"vs ",
|
|
6731
6877
|
previousValue
|
|
6732
6878
|
] }),
|
|
6733
|
-
/* @__PURE__ */
|
|
6879
|
+
/* @__PURE__ */ jsx53("span", { className: "text-muted-foreground", children: trendLabel })
|
|
6734
6880
|
] }),
|
|
6735
|
-
progress !== void 0 && /* @__PURE__ */
|
|
6736
|
-
/* @__PURE__ */
|
|
6737
|
-
/* @__PURE__ */
|
|
6738
|
-
/* @__PURE__ */
|
|
6881
|
+
progress !== void 0 && /* @__PURE__ */ jsxs47("div", { className: "mt-4 space-y-1", children: [
|
|
6882
|
+
/* @__PURE__ */ jsxs47("div", { className: "flex justify-between text-xs text-muted-foreground", children: [
|
|
6883
|
+
/* @__PURE__ */ jsx53("span", { children: "Progress" }),
|
|
6884
|
+
/* @__PURE__ */ jsxs47("span", { children: [
|
|
6739
6885
|
Math.min(100, Math.max(0, progress)),
|
|
6740
6886
|
"%"
|
|
6741
6887
|
] })
|
|
6742
6888
|
] }),
|
|
6743
|
-
/* @__PURE__ */
|
|
6889
|
+
/* @__PURE__ */ jsx53("div", { className: "h-1.5 w-full rounded-full bg-muted overflow-hidden", children: /* @__PURE__ */ jsx53(
|
|
6744
6890
|
"div",
|
|
6745
6891
|
{
|
|
6746
6892
|
className: cn("h-full rounded-full transition-all duration-700", progressColorMap[progressColor]),
|
|
@@ -6748,7 +6894,7 @@ function Widget({
|
|
|
6748
6894
|
}
|
|
6749
6895
|
) })
|
|
6750
6896
|
] }),
|
|
6751
|
-
footer && /* @__PURE__ */
|
|
6897
|
+
footer && /* @__PURE__ */ jsx53("div", { className: "mt-4 border-t pt-3 text-sm text-muted-foreground", children: footer })
|
|
6752
6898
|
] })
|
|
6753
6899
|
}
|
|
6754
6900
|
);
|
|
@@ -6796,6 +6942,9 @@ export {
|
|
|
6796
6942
|
NotificationPanel,
|
|
6797
6943
|
OtpInput,
|
|
6798
6944
|
Pagination,
|
|
6945
|
+
Panel,
|
|
6946
|
+
PanelSidebarGroup,
|
|
6947
|
+
PanelSidebarItem,
|
|
6799
6948
|
Popover,
|
|
6800
6949
|
Progress,
|
|
6801
6950
|
RadioGroup,
|