@juv/codego-react-ui 1.0.7 → 1.0.8
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 +1624 -799
- package/dist/index.d.cts +208 -28
- package/dist/index.d.ts +208 -28
- package/dist/index.global.js +1684 -863
- package/dist/index.js +1640 -824
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1651,6 +1651,32 @@ function ComposableWidget({
|
|
|
1651
1651
|
] })
|
|
1652
1652
|
] });
|
|
1653
1653
|
}
|
|
1654
|
+
function MetricRow({ items, divided = true, className }) {
|
|
1655
|
+
return /* @__PURE__ */ jsx13(Card, { className: cn("overflow-hidden", className), children: /* @__PURE__ */ jsx13(CardContent, { className: "p-0", children: /* @__PURE__ */ jsx13("div", { className: cn("grid", `grid-cols-${Math.min(items.length, 4)}`), children: items.map((item, i) => /* @__PURE__ */ jsxs12(
|
|
1656
|
+
"div",
|
|
1657
|
+
{
|
|
1658
|
+
className: cn(
|
|
1659
|
+
"flex flex-col gap-1 px-5 py-4",
|
|
1660
|
+
divided && i > 0 && "border-l border-border"
|
|
1661
|
+
),
|
|
1662
|
+
children: [
|
|
1663
|
+
/* @__PURE__ */ jsx13("span", { className: "text-xs font-medium text-muted-foreground", children: item.label }),
|
|
1664
|
+
/* @__PURE__ */ jsx13("span", { className: cn("text-xl font-bold tabular-nums", item.color && semanticText[item.color]), children: item.value }),
|
|
1665
|
+
item.trendValue && /* @__PURE__ */ jsxs12("span", { className: cn(
|
|
1666
|
+
"text-xs font-medium",
|
|
1667
|
+
item.trend === "up" && "text-success",
|
|
1668
|
+
item.trend === "down" && "text-danger",
|
|
1669
|
+
item.trend === "neutral" && "text-muted-foreground"
|
|
1670
|
+
), children: [
|
|
1671
|
+
item.trend === "up" && "\u2191 ",
|
|
1672
|
+
item.trend === "down" && "\u2193 ",
|
|
1673
|
+
item.trendValue
|
|
1674
|
+
] })
|
|
1675
|
+
]
|
|
1676
|
+
},
|
|
1677
|
+
i
|
|
1678
|
+
)) }) }) });
|
|
1679
|
+
}
|
|
1654
1680
|
|
|
1655
1681
|
// src/components/ui/data-grid.tsx
|
|
1656
1682
|
import * as React12 from "react";
|
|
@@ -2672,6 +2698,42 @@ function Dropdown({
|
|
|
2672
2698
|
)
|
|
2673
2699
|
] });
|
|
2674
2700
|
}
|
|
2701
|
+
function DropdownItem({
|
|
2702
|
+
children,
|
|
2703
|
+
onClick,
|
|
2704
|
+
icon,
|
|
2705
|
+
disabled = false,
|
|
2706
|
+
variant = "default",
|
|
2707
|
+
className
|
|
2708
|
+
}) {
|
|
2709
|
+
return /* @__PURE__ */ jsxs18(
|
|
2710
|
+
"button",
|
|
2711
|
+
{
|
|
2712
|
+
onClick,
|
|
2713
|
+
disabled,
|
|
2714
|
+
className: cn(
|
|
2715
|
+
"flex w-full items-center gap-2.5 px-3.5 py-2 text-left text-sm rounded-lg mx-1 transition-colors duration-100",
|
|
2716
|
+
"w-[calc(100%-0.5rem)]",
|
|
2717
|
+
variant === "danger" ? "text-red-400 hover:bg-red-500/15 hover:text-red-300" : "hover:bg-white/8 hover:text-accent-foreground",
|
|
2718
|
+
disabled && "opacity-40 cursor-not-allowed pointer-events-none",
|
|
2719
|
+
className
|
|
2720
|
+
),
|
|
2721
|
+
children: [
|
|
2722
|
+
icon && /* @__PURE__ */ jsx19("span", { className: "shrink-0 opacity-70", children: icon }),
|
|
2723
|
+
children
|
|
2724
|
+
]
|
|
2725
|
+
}
|
|
2726
|
+
);
|
|
2727
|
+
}
|
|
2728
|
+
function DropdownSeparator({ className }) {
|
|
2729
|
+
return /* @__PURE__ */ jsx19("div", { className: cn("my-1.5 h-px bg-white/8", className) });
|
|
2730
|
+
}
|
|
2731
|
+
function DropdownLabel({
|
|
2732
|
+
children,
|
|
2733
|
+
className
|
|
2734
|
+
}) {
|
|
2735
|
+
return /* @__PURE__ */ jsx19("p", { className: cn("px-3.5 py-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground/60", className), children });
|
|
2736
|
+
}
|
|
2675
2737
|
|
|
2676
2738
|
// src/components/ui/file-upload.tsx
|
|
2677
2739
|
import * as React17 from "react";
|
|
@@ -3111,6 +3173,13 @@ var justifyMap = {
|
|
|
3111
3173
|
around: "justify-around",
|
|
3112
3174
|
evenly: "justify-evenly"
|
|
3113
3175
|
};
|
|
3176
|
+
var selfMap = {
|
|
3177
|
+
start: "self-start",
|
|
3178
|
+
center: "self-center",
|
|
3179
|
+
end: "self-end",
|
|
3180
|
+
stretch: "self-stretch",
|
|
3181
|
+
baseline: "self-baseline"
|
|
3182
|
+
};
|
|
3114
3183
|
function FlexLayout({
|
|
3115
3184
|
direction = "row",
|
|
3116
3185
|
wrap = "nowrap",
|
|
@@ -3131,6 +3200,29 @@ function FlexLayout({
|
|
|
3131
3200
|
className
|
|
3132
3201
|
), children });
|
|
3133
3202
|
}
|
|
3203
|
+
function FlexItem({
|
|
3204
|
+
grow,
|
|
3205
|
+
shrink,
|
|
3206
|
+
basis,
|
|
3207
|
+
order,
|
|
3208
|
+
alignSelf,
|
|
3209
|
+
children,
|
|
3210
|
+
className
|
|
3211
|
+
}) {
|
|
3212
|
+
const style = {};
|
|
3213
|
+
if (grow !== void 0) style.flexGrow = grow === true ? 1 : grow === false ? 0 : grow;
|
|
3214
|
+
if (shrink !== void 0) style.flexShrink = shrink === true ? 1 : shrink === false ? 0 : shrink;
|
|
3215
|
+
if (basis) style.flexBasis = basis;
|
|
3216
|
+
if (order !== void 0) style.order = order;
|
|
3217
|
+
return /* @__PURE__ */ jsx21(
|
|
3218
|
+
"div",
|
|
3219
|
+
{
|
|
3220
|
+
className: cn(alignSelf && selfMap[alignSelf], className),
|
|
3221
|
+
style,
|
|
3222
|
+
children
|
|
3223
|
+
}
|
|
3224
|
+
);
|
|
3225
|
+
}
|
|
3134
3226
|
|
|
3135
3227
|
// src/components/ui/grid-layout.tsx
|
|
3136
3228
|
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
@@ -3206,6 +3298,17 @@ var justifyMap2 = {
|
|
|
3206
3298
|
end: "justify-items-end",
|
|
3207
3299
|
stretch: "justify-items-stretch"
|
|
3208
3300
|
};
|
|
3301
|
+
var spanMap = {
|
|
3302
|
+
1: "col-span-1",
|
|
3303
|
+
2: "col-span-2",
|
|
3304
|
+
3: "col-span-3",
|
|
3305
|
+
4: "col-span-4",
|
|
3306
|
+
5: "col-span-5",
|
|
3307
|
+
6: "col-span-6",
|
|
3308
|
+
12: "col-span-12",
|
|
3309
|
+
full: "col-span-full"
|
|
3310
|
+
};
|
|
3311
|
+
var rowSpanMap = { 1: "row-span-1", 2: "row-span-2", 3: "row-span-3" };
|
|
3209
3312
|
function GridLayout({
|
|
3210
3313
|
cols = 3,
|
|
3211
3314
|
smCols,
|
|
@@ -3233,6 +3336,13 @@ function GridLayout({
|
|
|
3233
3336
|
className
|
|
3234
3337
|
), children });
|
|
3235
3338
|
}
|
|
3339
|
+
function GridItem({ span, rowSpan, children, className }) {
|
|
3340
|
+
return /* @__PURE__ */ jsx22("div", { className: cn(
|
|
3341
|
+
span && spanMap[String(span)],
|
|
3342
|
+
rowSpan && rowSpanMap[rowSpan],
|
|
3343
|
+
className
|
|
3344
|
+
), children });
|
|
3345
|
+
}
|
|
3236
3346
|
|
|
3237
3347
|
// src/components/ui/input.tsx
|
|
3238
3348
|
import * as React18 from "react";
|
|
@@ -4953,113 +5063,400 @@ function OtpInput({
|
|
|
4953
5063
|
] }, i)) });
|
|
4954
5064
|
}
|
|
4955
5065
|
|
|
4956
|
-
// src/components/ui/
|
|
5066
|
+
// src/components/ui/panel.tsx
|
|
5067
|
+
import * as React30 from "react";
|
|
5068
|
+
import { PanelLeftClose, PanelLeftOpen, Sun as Sun2, Moon } from "lucide-react";
|
|
5069
|
+
|
|
5070
|
+
// src/components/ui/tooltip.tsx
|
|
4957
5071
|
import * as React28 from "react";
|
|
4958
|
-
import
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
"bottom": "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
4962
|
-
"left": "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
4963
|
-
"right": "left-full top-1/2 -translate-y-1/2 ml-2",
|
|
4964
|
-
"top-start": "bottom-full left-0 mb-2",
|
|
4965
|
-
"top-end": "bottom-full right-0 mb-2",
|
|
4966
|
-
"bottom-start": "top-full left-0 mt-2",
|
|
4967
|
-
"bottom-end": "top-full right-0 mt-2"
|
|
4968
|
-
};
|
|
4969
|
-
function Popover({
|
|
4970
|
-
trigger,
|
|
5072
|
+
import * as ReactDOM from "react-dom";
|
|
5073
|
+
import { Fragment as Fragment7, jsx as jsx33, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
5074
|
+
function Tooltip({
|
|
4971
5075
|
content,
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
className
|
|
5076
|
+
children,
|
|
5077
|
+
side = "right",
|
|
5078
|
+
className,
|
|
5079
|
+
enabled = true
|
|
4977
5080
|
}) {
|
|
4978
|
-
const [
|
|
5081
|
+
const [visible, setVisible] = React28.useState(false);
|
|
5082
|
+
const [coords, setCoords] = React28.useState({ top: 0, left: 0 });
|
|
4979
5083
|
const ref = React28.useRef(null);
|
|
4980
|
-
|
|
4981
|
-
function
|
|
4982
|
-
|
|
4983
|
-
|
|
5084
|
+
if (!enabled) return /* @__PURE__ */ jsx33(Fragment7, { children });
|
|
5085
|
+
function calcCoords() {
|
|
5086
|
+
const r = ref.current?.getBoundingClientRect();
|
|
5087
|
+
if (!r) return;
|
|
5088
|
+
const GAP = 8;
|
|
5089
|
+
switch (side) {
|
|
5090
|
+
case "right":
|
|
5091
|
+
setCoords({ top: r.top + r.height / 2, left: r.right + GAP });
|
|
5092
|
+
break;
|
|
5093
|
+
case "left":
|
|
5094
|
+
setCoords({ top: r.top + r.height / 2, left: r.left - GAP });
|
|
5095
|
+
break;
|
|
5096
|
+
case "top":
|
|
5097
|
+
setCoords({ top: r.top - GAP, left: r.left + r.width / 2 });
|
|
5098
|
+
break;
|
|
5099
|
+
case "bottom":
|
|
5100
|
+
setCoords({ top: r.bottom + GAP, left: r.left + r.width / 2 });
|
|
5101
|
+
break;
|
|
5102
|
+
}
|
|
4984
5103
|
}
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
5104
|
+
const transformClass = {
|
|
5105
|
+
right: "-translate-y-1/2",
|
|
5106
|
+
left: "-translate-y-1/2 -translate-x-full",
|
|
5107
|
+
top: "-translate-x-1/2 -translate-y-full",
|
|
5108
|
+
bottom: "-translate-x-1/2"
|
|
5109
|
+
}[side];
|
|
5110
|
+
return /* @__PURE__ */ jsxs29(
|
|
5111
|
+
"div",
|
|
5112
|
+
{
|
|
5113
|
+
ref,
|
|
5114
|
+
className: "relative inline-flex",
|
|
5115
|
+
onMouseEnter: () => {
|
|
5116
|
+
calcCoords();
|
|
5117
|
+
setVisible(true);
|
|
5118
|
+
},
|
|
5119
|
+
onMouseLeave: () => setVisible(false),
|
|
5120
|
+
onFocus: () => {
|
|
5121
|
+
calcCoords();
|
|
5122
|
+
setVisible(true);
|
|
5123
|
+
},
|
|
5124
|
+
onBlur: () => setVisible(false),
|
|
5125
|
+
children: [
|
|
5126
|
+
children,
|
|
5127
|
+
visible && ReactDOM.createPortal(
|
|
5128
|
+
/* @__PURE__ */ jsx33(
|
|
5129
|
+
"div",
|
|
5130
|
+
{
|
|
5131
|
+
role: "tooltip",
|
|
5132
|
+
style: { top: coords.top, left: coords.left },
|
|
5133
|
+
className: cn(
|
|
5134
|
+
"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",
|
|
5135
|
+
transformClass,
|
|
5136
|
+
className
|
|
5137
|
+
),
|
|
5138
|
+
children: content
|
|
5139
|
+
}
|
|
5140
|
+
),
|
|
5141
|
+
document.body
|
|
5142
|
+
)
|
|
5143
|
+
]
|
|
4989
5144
|
}
|
|
4990
|
-
|
|
4991
|
-
return () => document.removeEventListener("mousedown", handler);
|
|
4992
|
-
}, [triggerOn]);
|
|
4993
|
-
const hoverProps = triggerOn === "hover" ? { onMouseEnter: () => setOpen(true), onMouseLeave: () => setOpen(false) } : {};
|
|
4994
|
-
return /* @__PURE__ */ jsxs29("div", { ref, className: "relative inline-block", ...hoverProps, children: [
|
|
4995
|
-
/* @__PURE__ */ jsx33("div", { onClick: () => triggerOn === "click" && setOpen(!open), children: trigger }),
|
|
4996
|
-
open && /* @__PURE__ */ jsx33("div", { className: cn(
|
|
4997
|
-
"absolute z-50 min-w-max rounded-xl border border-border glass shadow-2xl",
|
|
4998
|
-
PLACEMENT_CLASSES[placement],
|
|
4999
|
-
className
|
|
5000
|
-
), children: content })
|
|
5001
|
-
] });
|
|
5145
|
+
);
|
|
5002
5146
|
}
|
|
5003
5147
|
|
|
5004
|
-
// src/components/
|
|
5005
|
-
import {
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5148
|
+
// src/components/theme-provider.tsx
|
|
5149
|
+
import { createContext as createContext2, useContext as useContext2, useEffect as useEffect18, useState as useState23 } from "react";
|
|
5150
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
5151
|
+
var defaultColors = {
|
|
5152
|
+
primary: "#8b5cf6",
|
|
5153
|
+
primaryHover: "#7c3aed",
|
|
5154
|
+
secondary: "#171717",
|
|
5155
|
+
secondaryHover: "#262626",
|
|
5156
|
+
info: "#3b82f6",
|
|
5157
|
+
infoHover: "#2563eb",
|
|
5158
|
+
warning: "#f59e0b",
|
|
5159
|
+
warningHover: "#d97706",
|
|
5160
|
+
danger: "#ef4444",
|
|
5161
|
+
dangerHover: "#dc2626"
|
|
5012
5162
|
};
|
|
5013
|
-
var
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5163
|
+
var initialState = {
|
|
5164
|
+
theme: "system",
|
|
5165
|
+
colors: defaultColors,
|
|
5166
|
+
fontSize: "16px",
|
|
5167
|
+
fontFamily: '"Space Grotesk", "Inter", sans-serif',
|
|
5168
|
+
setTheme: () => null,
|
|
5169
|
+
setColors: () => null,
|
|
5170
|
+
setFontSize: () => null,
|
|
5171
|
+
setFontFamily: () => null,
|
|
5172
|
+
resetSettings: () => null
|
|
5019
5173
|
};
|
|
5020
|
-
var
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5174
|
+
var ThemeProviderContext = createContext2(initialState);
|
|
5175
|
+
var COLOR_PALETTE = [
|
|
5176
|
+
{ base: "#6366f1", hover: "#4f46e5" },
|
|
5177
|
+
// Indigo
|
|
5178
|
+
{ base: "#8b5cf6", hover: "#7c3aed" },
|
|
5179
|
+
// Violet
|
|
5180
|
+
{ base: "#3b82f6", hover: "#2563eb" },
|
|
5181
|
+
// Blue
|
|
5182
|
+
{ base: "#10b981", hover: "#059669" },
|
|
5183
|
+
// Emerald
|
|
5184
|
+
{ base: "#22c55e", hover: "#16a34a" },
|
|
5185
|
+
// Green
|
|
5186
|
+
{ base: "#eab308", hover: "#ca8a04" },
|
|
5187
|
+
// Yellow
|
|
5188
|
+
{ base: "#f59e0b", hover: "#d97706" },
|
|
5189
|
+
// Amber
|
|
5190
|
+
{ base: "#f97316", hover: "#ea580c" },
|
|
5191
|
+
// Orange
|
|
5192
|
+
{ base: "#ef4444", hover: "#dc2626" },
|
|
5193
|
+
// Red
|
|
5194
|
+
{ base: "#ec4899", hover: "#db2777" }
|
|
5195
|
+
// Pink
|
|
5196
|
+
];
|
|
5197
|
+
var useTheme = () => {
|
|
5198
|
+
const context = useContext2(ThemeProviderContext);
|
|
5199
|
+
if (context === void 0)
|
|
5200
|
+
throw new Error("useTheme must be used within a ThemeProvider");
|
|
5201
|
+
return context;
|
|
5025
5202
|
};
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5203
|
+
|
|
5204
|
+
// src/components/ui/panel.tsx
|
|
5205
|
+
import { jsx as jsx35, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
5206
|
+
var PanelCollapsedContext = React30.createContext(false);
|
|
5207
|
+
function PanelThemeToggle() {
|
|
5208
|
+
const { theme, setTheme } = useTheme();
|
|
5209
|
+
return /* @__PURE__ */ jsxs30(
|
|
5210
|
+
"button",
|
|
5211
|
+
{
|
|
5212
|
+
type: "button",
|
|
5213
|
+
onClick: () => setTheme(theme === "light" ? "dark" : "light"),
|
|
5214
|
+
className: "text-muted-foreground hover:text-foreground transition-colors",
|
|
5215
|
+
"aria-label": "Toggle theme",
|
|
5216
|
+
children: [
|
|
5217
|
+
/* @__PURE__ */ jsx35(Sun2, { className: "h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" }),
|
|
5218
|
+
/* @__PURE__ */ jsx35(Moon, { className: "absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" })
|
|
5219
|
+
]
|
|
5220
|
+
}
|
|
5221
|
+
);
|
|
5222
|
+
}
|
|
5223
|
+
function Panel({
|
|
5224
|
+
sidebar,
|
|
5225
|
+
sidebarHeader,
|
|
5226
|
+
sidebarFooter,
|
|
5227
|
+
sidebarWidth = "w-56",
|
|
5228
|
+
topbar,
|
|
5229
|
+
topbarTrailing,
|
|
5230
|
+
defaultCollapsed = false,
|
|
5231
|
+
collapsible = false,
|
|
5232
|
+
showThemeToggle = false,
|
|
5233
|
+
defaultPage,
|
|
5234
|
+
height = "h-[520px]",
|
|
5235
|
+
children,
|
|
5036
5236
|
className
|
|
5037
5237
|
}) {
|
|
5038
|
-
const
|
|
5039
|
-
return /* @__PURE__ */
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5238
|
+
const [collapsed, setCollapsed] = React30.useState(defaultCollapsed);
|
|
5239
|
+
return /* @__PURE__ */ jsx35(PanelCollapsedContext.Provider, { value: collapsed, children: /* @__PURE__ */ jsxs30(
|
|
5240
|
+
"div",
|
|
5241
|
+
{
|
|
5242
|
+
className: cn(
|
|
5243
|
+
"relative flex overflow-hidden rounded-xl border border-border bg-background shadow-lg",
|
|
5244
|
+
height,
|
|
5245
|
+
className
|
|
5246
|
+
),
|
|
5247
|
+
children: [
|
|
5248
|
+
/* @__PURE__ */ jsxs30("div", { className: "pointer-events-none absolute inset-0 overflow-hidden", children: [
|
|
5249
|
+
/* @__PURE__ */ jsx35("div", { className: "absolute -top-[40%] -left-[20%] h-[80%] w-[60%] rounded-full bg-primary/10 blur-[120px]" }),
|
|
5250
|
+
/* @__PURE__ */ jsx35("div", { className: "absolute -bottom-[40%] -right-[20%] h-[80%] w-[60%] rounded-full bg-info/10 blur-[120px]" })
|
|
5251
|
+
] }),
|
|
5252
|
+
sidebar && /* @__PURE__ */ jsxs30(
|
|
5253
|
+
"aside",
|
|
5254
|
+
{
|
|
5255
|
+
className: cn(
|
|
5256
|
+
"relative z-10 flex flex-col shrink-0 border-r border-border transition-all duration-200",
|
|
5257
|
+
collapsed ? "w-14" : sidebarWidth
|
|
5258
|
+
),
|
|
5259
|
+
children: [
|
|
5260
|
+
sidebarHeader && /* @__PURE__ */ jsx35(
|
|
5261
|
+
"div",
|
|
5262
|
+
{
|
|
5263
|
+
className: cn(
|
|
5264
|
+
"shrink-0 border-b border-border",
|
|
5265
|
+
collapsed ? "flex items-center justify-center py-3" : "px-4 py-3 text-sm font-semibold"
|
|
5266
|
+
),
|
|
5267
|
+
children: sidebarHeader
|
|
5268
|
+
}
|
|
5269
|
+
),
|
|
5270
|
+
/* @__PURE__ */ jsx35("div", { className: "flex-1 overflow-y-auto py-2", children: sidebar }),
|
|
5271
|
+
sidebarFooter && /* @__PURE__ */ jsx35(
|
|
5272
|
+
"div",
|
|
5273
|
+
{
|
|
5274
|
+
className: cn(
|
|
5275
|
+
"shrink-0 border-t border-border",
|
|
5276
|
+
collapsed ? "flex items-center justify-center py-3" : "px-4 py-3"
|
|
5277
|
+
),
|
|
5278
|
+
children: !collapsed && sidebarFooter
|
|
5279
|
+
}
|
|
5280
|
+
)
|
|
5281
|
+
]
|
|
5282
|
+
}
|
|
5283
|
+
),
|
|
5284
|
+
/* @__PURE__ */ jsxs30("div", { className: "relative z-10 flex flex-1 min-w-0 flex-col", children: [
|
|
5285
|
+
/* @__PURE__ */ jsxs30("header", { className: "flex h-14 shrink-0 items-center justify-between border-b glass px-4 gap-2", children: [
|
|
5286
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-2", children: [
|
|
5287
|
+
collapsible && sidebar && /* @__PURE__ */ jsx35(
|
|
5288
|
+
Tooltip,
|
|
5289
|
+
{
|
|
5290
|
+
content: collapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
5291
|
+
side: "bottom",
|
|
5292
|
+
children: /* @__PURE__ */ jsx35(
|
|
5293
|
+
"button",
|
|
5294
|
+
{
|
|
5295
|
+
type: "button",
|
|
5296
|
+
onClick: () => setCollapsed((c) => !c),
|
|
5297
|
+
className: "text-muted-foreground hover:text-foreground transition-colors",
|
|
5298
|
+
"aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
5299
|
+
children: collapsed ? /* @__PURE__ */ jsx35(PanelLeftOpen, { className: "h-5 w-5" }) : /* @__PURE__ */ jsx35(PanelLeftClose, { className: "h-5 w-5" })
|
|
5300
|
+
}
|
|
5301
|
+
)
|
|
5302
|
+
}
|
|
5303
|
+
),
|
|
5304
|
+
topbar && /* @__PURE__ */ jsx35("div", { className: "flex items-center gap-2", children: topbar })
|
|
5305
|
+
] }),
|
|
5306
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-center gap-2", children: [
|
|
5307
|
+
topbarTrailing,
|
|
5308
|
+
showThemeToggle && /* @__PURE__ */ jsx35(PanelThemeToggle, {})
|
|
5309
|
+
] })
|
|
5310
|
+
] }),
|
|
5311
|
+
/* @__PURE__ */ jsx35("main", { className: "flex-1 overflow-y-auto p-4", children })
|
|
5312
|
+
] })
|
|
5313
|
+
]
|
|
5314
|
+
}
|
|
5315
|
+
) });
|
|
5316
|
+
}
|
|
5317
|
+
function PanelSidebarItem({
|
|
5318
|
+
icon: Icon,
|
|
5319
|
+
label,
|
|
5320
|
+
active,
|
|
5321
|
+
onClick
|
|
5322
|
+
}) {
|
|
5323
|
+
const collapsed = React30.useContext(PanelCollapsedContext);
|
|
5324
|
+
return /* @__PURE__ */ jsx35(Tooltip, { content: label, side: "right", enabled: collapsed, children: /* @__PURE__ */ jsxs30(
|
|
5325
|
+
"button",
|
|
5326
|
+
{
|
|
5327
|
+
type: "button",
|
|
5328
|
+
onClick,
|
|
5329
|
+
className: cn(
|
|
5330
|
+
"flex w-full items-center rounded-md text-sm font-medium transition-colors",
|
|
5331
|
+
collapsed ? "justify-center h-9 w-9 mx-auto px-0" : "gap-2 px-3 py-2",
|
|
5332
|
+
active ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-primary/20 hover:text-primary cursor-pointer"
|
|
5333
|
+
),
|
|
5334
|
+
children: [
|
|
5335
|
+
Icon && /* @__PURE__ */ jsx35(Icon, { className: "h-4 w-4 shrink-0" }),
|
|
5336
|
+
!collapsed && /* @__PURE__ */ jsx35("span", { className: "truncate", children: label })
|
|
5337
|
+
]
|
|
5338
|
+
}
|
|
5339
|
+
) });
|
|
5340
|
+
}
|
|
5341
|
+
function PanelSidebarGroup({
|
|
5342
|
+
title,
|
|
5343
|
+
children
|
|
5344
|
+
}) {
|
|
5345
|
+
const collapsed = React30.useContext(PanelCollapsedContext);
|
|
5346
|
+
return /* @__PURE__ */ jsxs30("div", { className: "px-2 py-1", children: [
|
|
5347
|
+
title && !collapsed && /* @__PURE__ */ jsx35("p", { className: "mb-1 px-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground", children: title }),
|
|
5348
|
+
title && collapsed && /* @__PURE__ */ jsx35("div", { className: "mx-1 mb-1 h-px bg-border" }),
|
|
5349
|
+
/* @__PURE__ */ jsx35("main", { className: "space-y-0.5", children })
|
|
5350
|
+
] });
|
|
5351
|
+
}
|
|
5352
|
+
|
|
5353
|
+
// src/components/ui/popover.tsx
|
|
5354
|
+
import * as React31 from "react";
|
|
5355
|
+
import { jsx as jsx36, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
5356
|
+
var PLACEMENT_CLASSES = {
|
|
5357
|
+
"top": "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
5358
|
+
"bottom": "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
5359
|
+
"left": "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
5360
|
+
"right": "left-full top-1/2 -translate-y-1/2 ml-2",
|
|
5361
|
+
"top-start": "bottom-full left-0 mb-2",
|
|
5362
|
+
"top-end": "bottom-full right-0 mb-2",
|
|
5363
|
+
"bottom-start": "top-full left-0 mt-2",
|
|
5364
|
+
"bottom-end": "top-full right-0 mt-2"
|
|
5365
|
+
};
|
|
5366
|
+
function Popover({
|
|
5367
|
+
trigger,
|
|
5368
|
+
content,
|
|
5369
|
+
placement = "bottom-start",
|
|
5370
|
+
triggerOn = "click",
|
|
5371
|
+
open: controlled,
|
|
5372
|
+
onOpenChange,
|
|
5373
|
+
className
|
|
5374
|
+
}) {
|
|
5375
|
+
const [internal, setInternal] = React31.useState(false);
|
|
5376
|
+
const ref = React31.useRef(null);
|
|
5377
|
+
const open = controlled ?? internal;
|
|
5378
|
+
function setOpen(v) {
|
|
5379
|
+
if (controlled === void 0) setInternal(v);
|
|
5380
|
+
onOpenChange?.(v);
|
|
5381
|
+
}
|
|
5382
|
+
React31.useEffect(() => {
|
|
5383
|
+
if (triggerOn !== "click") return;
|
|
5384
|
+
function handler(e) {
|
|
5385
|
+
if (ref.current && !ref.current.contains(e.target)) setOpen(false);
|
|
5386
|
+
}
|
|
5387
|
+
document.addEventListener("mousedown", handler);
|
|
5388
|
+
return () => document.removeEventListener("mousedown", handler);
|
|
5389
|
+
}, [triggerOn]);
|
|
5390
|
+
const hoverProps = triggerOn === "hover" ? { onMouseEnter: () => setOpen(true), onMouseLeave: () => setOpen(false) } : {};
|
|
5391
|
+
return /* @__PURE__ */ jsxs31("div", { ref, className: "relative inline-block", ...hoverProps, children: [
|
|
5392
|
+
/* @__PURE__ */ jsx36("div", { onClick: () => triggerOn === "click" && setOpen(!open), children: trigger }),
|
|
5393
|
+
open && /* @__PURE__ */ jsx36("div", { className: cn(
|
|
5394
|
+
"absolute z-50 min-w-max rounded-xl border border-border glass shadow-2xl",
|
|
5395
|
+
PLACEMENT_CLASSES[placement],
|
|
5396
|
+
className
|
|
5397
|
+
), children: content })
|
|
5398
|
+
] });
|
|
5399
|
+
}
|
|
5400
|
+
|
|
5401
|
+
// src/components/ui/progress.tsx
|
|
5402
|
+
import { jsx as jsx37, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
5403
|
+
var BAR_COLOR = {
|
|
5404
|
+
default: "bg-primary",
|
|
5405
|
+
success: "bg-success",
|
|
5406
|
+
error: "bg-danger",
|
|
5407
|
+
warning: "bg-warning",
|
|
5408
|
+
info: "bg-info"
|
|
5409
|
+
};
|
|
5410
|
+
var STROKE_COLOR = {
|
|
5411
|
+
default: "stroke-primary",
|
|
5412
|
+
success: "stroke-success",
|
|
5413
|
+
error: "stroke-danger",
|
|
5414
|
+
warning: "stroke-warning",
|
|
5415
|
+
info: "stroke-info"
|
|
5416
|
+
};
|
|
5417
|
+
var HEIGHT = {
|
|
5418
|
+
xs: "h-1",
|
|
5419
|
+
sm: "h-1.5",
|
|
5420
|
+
md: "h-2.5",
|
|
5421
|
+
lg: "h-4"
|
|
5422
|
+
};
|
|
5423
|
+
function Progress({
|
|
5424
|
+
value = 0,
|
|
5425
|
+
max = 100,
|
|
5426
|
+
variant = "default",
|
|
5427
|
+
size = "md",
|
|
5428
|
+
label,
|
|
5429
|
+
showValue = false,
|
|
5430
|
+
animated = false,
|
|
5431
|
+
striped = false,
|
|
5432
|
+
indeterminate = false,
|
|
5433
|
+
className
|
|
5434
|
+
}) {
|
|
5435
|
+
const pct2 = indeterminate ? 100 : Math.min(100, Math.max(0, value / max * 100));
|
|
5436
|
+
return /* @__PURE__ */ jsxs32("div", { className: cn("w-full space-y-1.5", className), children: [
|
|
5437
|
+
(label || showValue) && /* @__PURE__ */ jsxs32("div", { className: "flex items-center justify-between text-xs text-muted-foreground", children: [
|
|
5438
|
+
label && /* @__PURE__ */ jsx37("span", { children: label }),
|
|
5439
|
+
showValue && !indeterminate && /* @__PURE__ */ jsxs32("span", { children: [
|
|
5440
|
+
Math.round(pct2),
|
|
5441
|
+
"%"
|
|
5442
|
+
] })
|
|
5443
|
+
] }),
|
|
5444
|
+
/* @__PURE__ */ jsx37("div", { className: cn("w-full overflow-hidden rounded-full bg-muted", HEIGHT[size]), children: /* @__PURE__ */ jsx37(
|
|
5445
|
+
"div",
|
|
5446
|
+
{
|
|
5447
|
+
className: cn(
|
|
5448
|
+
"h-full rounded-full transition-all duration-500",
|
|
5449
|
+
BAR_COLOR[variant],
|
|
5450
|
+
striped && "bg-[repeating-linear-gradient(45deg,transparent,transparent_6px,rgba(255,255,255,0.15)_6px,rgba(255,255,255,0.15)_12px)]",
|
|
5451
|
+
animated && !indeterminate && "transition-none animate-pulse",
|
|
5452
|
+
indeterminate && "animate-[indeterminate_1.5s_ease-in-out_infinite]"
|
|
5453
|
+
),
|
|
5454
|
+
style: { width: indeterminate ? "40%" : `${pct2}%` }
|
|
5455
|
+
}
|
|
5456
|
+
) })
|
|
5457
|
+
] });
|
|
5458
|
+
}
|
|
5459
|
+
function CircularProgress({
|
|
5063
5460
|
value = 0,
|
|
5064
5461
|
max = 100,
|
|
5065
5462
|
variant = "default",
|
|
@@ -5074,10 +5471,10 @@ function CircularProgress({
|
|
|
5074
5471
|
const circ = 2 * Math.PI * r;
|
|
5075
5472
|
const pct2 = indeterminate ? 0.75 : Math.min(1, Math.max(0, value / max));
|
|
5076
5473
|
const dash = pct2 * circ;
|
|
5077
|
-
return /* @__PURE__ */
|
|
5078
|
-
/* @__PURE__ */
|
|
5079
|
-
/* @__PURE__ */
|
|
5080
|
-
/* @__PURE__ */
|
|
5474
|
+
return /* @__PURE__ */ jsxs32("div", { className: cn("inline-flex flex-col items-center gap-1", className), children: [
|
|
5475
|
+
/* @__PURE__ */ jsxs32("div", { className: "relative", style: { width: size, height: size }, children: [
|
|
5476
|
+
/* @__PURE__ */ jsxs32("svg", { width: size, height: size, className: cn(indeterminate && "animate-spin"), children: [
|
|
5477
|
+
/* @__PURE__ */ jsx37(
|
|
5081
5478
|
"circle",
|
|
5082
5479
|
{
|
|
5083
5480
|
cx: size / 2,
|
|
@@ -5088,7 +5485,7 @@ function CircularProgress({
|
|
|
5088
5485
|
className: "stroke-muted"
|
|
5089
5486
|
}
|
|
5090
5487
|
),
|
|
5091
|
-
/* @__PURE__ */
|
|
5488
|
+
/* @__PURE__ */ jsx37(
|
|
5092
5489
|
"circle",
|
|
5093
5490
|
{
|
|
5094
5491
|
cx: size / 2,
|
|
@@ -5103,18 +5500,55 @@ function CircularProgress({
|
|
|
5103
5500
|
}
|
|
5104
5501
|
)
|
|
5105
5502
|
] }),
|
|
5106
|
-
showValue && !indeterminate && /* @__PURE__ */
|
|
5503
|
+
showValue && !indeterminate && /* @__PURE__ */ jsxs32("span", { className: "absolute inset-0 flex items-center justify-center text-xs font-semibold", children: [
|
|
5107
5504
|
Math.round(pct2 * 100),
|
|
5108
5505
|
"%"
|
|
5109
5506
|
] })
|
|
5110
5507
|
] }),
|
|
5111
|
-
label && /* @__PURE__ */
|
|
5508
|
+
label && /* @__PURE__ */ jsx37("span", { className: "text-xs text-muted-foreground", children: label })
|
|
5509
|
+
] });
|
|
5510
|
+
}
|
|
5511
|
+
|
|
5512
|
+
// src/components/ui/props-table.tsx
|
|
5513
|
+
import { jsx as jsx38, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
5514
|
+
function PropsTable({ rows }) {
|
|
5515
|
+
return /* @__PURE__ */ jsxs33("div", { className: "w-full space-y-3", children: [
|
|
5516
|
+
/* @__PURE__ */ jsxs33("div", { children: [
|
|
5517
|
+
/* @__PURE__ */ jsx38("h2", { className: "text-2xl font-bold tracking-tight text-gradient", children: "Props" }),
|
|
5518
|
+
/* @__PURE__ */ jsx38("p", { className: "text-muted-foreground", children: "All available props for this component." })
|
|
5519
|
+
] }),
|
|
5520
|
+
/* @__PURE__ */ jsx38("div", { className: "rounded-xl border border-border overflow-hidden bg-card/50 backdrop-blur-sm shadow-sm", children: /* @__PURE__ */ jsx38("div", { className: "w-full overflow-auto", children: /* @__PURE__ */ jsxs33("table", { className: "w-full text-sm", children: [
|
|
5521
|
+
/* @__PURE__ */ jsx38("thead", { children: /* @__PURE__ */ jsx38("tr", { className: "border-b border-border bg-muted/40", children: ["Prop", "Type", "Default", "Description"].map((h) => /* @__PURE__ */ jsx38("th", { className: "h-11 px-4 text-left text-xs font-semibold uppercase tracking-wider text-muted-foreground whitespace-nowrap", children: h }, h)) }) }),
|
|
5522
|
+
/* @__PURE__ */ jsx38("tbody", { children: rows.map((row, i) => /* @__PURE__ */ jsxs33(
|
|
5523
|
+
"tr",
|
|
5524
|
+
{
|
|
5525
|
+
className: cn(
|
|
5526
|
+
"border-b border-border/60 last:border-0 transition-colors hover:bg-muted/20",
|
|
5527
|
+
i % 2 !== 0 && "bg-muted/5"
|
|
5528
|
+
),
|
|
5529
|
+
children: [
|
|
5530
|
+
/* @__PURE__ */ jsxs33("td", { className: "px-4 py-3 align-top whitespace-nowrap", children: [
|
|
5531
|
+
/* @__PURE__ */ jsx38("code", { className: "font-mono text-xs font-semibold text-primary", children: row.prop }),
|
|
5532
|
+
row.required && /* @__PURE__ */ jsx38("span", { className: "ml-1 text-[10px] font-bold text-danger", children: "*" })
|
|
5533
|
+
] }),
|
|
5534
|
+
/* @__PURE__ */ jsx38("td", { className: "px-4 py-3 align-top", children: /* @__PURE__ */ jsx38("code", { className: "font-mono text-xs text-info/90 whitespace-pre-wrap", children: row.type }) }),
|
|
5535
|
+
/* @__PURE__ */ jsx38("td", { className: "px-4 py-3 align-top whitespace-nowrap", children: row.default ? /* @__PURE__ */ jsx38("code", { className: "font-mono text-xs text-muted-foreground", children: row.default }) : /* @__PURE__ */ jsx38("span", { className: "text-muted-foreground/40 text-xs", children: "\u2014" }) }),
|
|
5536
|
+
/* @__PURE__ */ jsx38("td", { className: "px-4 py-3 align-top text-xs text-muted-foreground leading-relaxed", children: row.description })
|
|
5537
|
+
]
|
|
5538
|
+
},
|
|
5539
|
+
row.prop
|
|
5540
|
+
)) })
|
|
5541
|
+
] }) }) }),
|
|
5542
|
+
/* @__PURE__ */ jsxs33("p", { className: "text-xs text-muted-foreground", children: [
|
|
5543
|
+
/* @__PURE__ */ jsx38("span", { className: "text-danger font-bold", children: "*" }),
|
|
5544
|
+
" Required prop"
|
|
5545
|
+
] })
|
|
5112
5546
|
] });
|
|
5113
5547
|
}
|
|
5114
5548
|
|
|
5115
5549
|
// src/components/ui/radio-group.tsx
|
|
5116
|
-
import * as
|
|
5117
|
-
import { jsx as
|
|
5550
|
+
import * as React32 from "react";
|
|
5551
|
+
import { jsx as jsx39, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
5118
5552
|
var SIZE_RADIO = {
|
|
5119
5553
|
sm: "h-3.5 w-3.5",
|
|
5120
5554
|
md: "h-4 w-4",
|
|
@@ -5136,14 +5570,14 @@ function RadioGroup({
|
|
|
5136
5570
|
name,
|
|
5137
5571
|
className
|
|
5138
5572
|
}) {
|
|
5139
|
-
const [internal, setInternal] =
|
|
5573
|
+
const [internal, setInternal] = React32.useState(defaultValue ?? "");
|
|
5140
5574
|
const active = controlledValue ?? internal;
|
|
5141
5575
|
function select(val) {
|
|
5142
5576
|
if (!controlledValue) setInternal(val);
|
|
5143
5577
|
onChange?.(val);
|
|
5144
5578
|
}
|
|
5145
5579
|
if (variant === "card") {
|
|
5146
|
-
return /* @__PURE__ */
|
|
5580
|
+
return /* @__PURE__ */ jsx39("div", { className: cn("grid gap-3", orientation === "horizontal" ? "grid-flow-col auto-cols-fr" : "grid-cols-1", className), children: options.map((opt) => /* @__PURE__ */ jsxs34(
|
|
5147
5581
|
"label",
|
|
5148
5582
|
{
|
|
5149
5583
|
className: cn(
|
|
@@ -5152,428 +5586,163 @@ function RadioGroup({
|
|
|
5152
5586
|
active === opt.value ? "border-primary bg-primary/5 ring-1 ring-primary" : "border-border hover:border-primary/40 hover:bg-accent/30"
|
|
5153
5587
|
),
|
|
5154
5588
|
children: [
|
|
5155
|
-
/* @__PURE__ */
|
|
5156
|
-
"input",
|
|
5157
|
-
{
|
|
5158
|
-
type: "radio",
|
|
5159
|
-
name,
|
|
5160
|
-
value: opt.value,
|
|
5161
|
-
checked: active === opt.value,
|
|
5162
|
-
disabled: opt.disabled,
|
|
5163
|
-
onChange: () => select(opt.value),
|
|
5164
|
-
className: "sr-only"
|
|
5165
|
-
}
|
|
5166
|
-
),
|
|
5167
|
-
/* @__PURE__ */ jsxs31("div", { className: "flex w-full gap-3", children: [
|
|
5168
|
-
opt.icon && /* @__PURE__ */ jsx35("span", { className: "shrink-0 mt-0.5 text-muted-foreground", children: opt.icon }),
|
|
5169
|
-
/* @__PURE__ */ jsxs31("div", { className: "flex-1 min-w-0", children: [
|
|
5170
|
-
/* @__PURE__ */ jsx35("p", { className: cn("font-medium", SIZE_TEXT[size], active === opt.value && "text-primary"), children: opt.label }),
|
|
5171
|
-
opt.description && /* @__PURE__ */ jsx35("p", { className: "text-xs text-muted-foreground mt-0.5", children: opt.description })
|
|
5172
|
-
] }),
|
|
5173
|
-
/* @__PURE__ */ jsx35("span", { className: cn(
|
|
5174
|
-
"shrink-0 mt-0.5 rounded-full border-2 flex items-center justify-center transition-colors",
|
|
5175
|
-
SIZE_RADIO[size],
|
|
5176
|
-
active === opt.value ? "border-primary" : "border-muted-foreground/40"
|
|
5177
|
-
), children: active === opt.value && /* @__PURE__ */ jsx35("span", { className: cn("rounded-full bg-primary", size === "sm" ? "h-1.5 w-1.5" : size === "lg" ? "h-2.5 w-2.5" : "h-2 w-2") }) })
|
|
5178
|
-
] })
|
|
5179
|
-
]
|
|
5180
|
-
},
|
|
5181
|
-
opt.value
|
|
5182
|
-
)) });
|
|
5183
|
-
}
|
|
5184
|
-
if (variant === "button") {
|
|
5185
|
-
return /* @__PURE__ */ jsx35("div", { className: cn("flex flex-wrap gap-2", className), children: options.map((opt) => /* @__PURE__ */ jsxs31(
|
|
5186
|
-
"label",
|
|
5187
|
-
{
|
|
5188
|
-
className: cn(
|
|
5189
|
-
"inline-flex items-center gap-2 cursor-pointer rounded-lg border px-3 py-2 font-medium transition-all",
|
|
5190
|
-
SIZE_TEXT[size],
|
|
5191
|
-
opt.disabled && "opacity-40 cursor-not-allowed pointer-events-none",
|
|
5192
|
-
active === opt.value ? "border-primary bg-primary text-primary-foreground" : "border-border hover:border-primary/40 hover:bg-accent/30 text-muted-foreground"
|
|
5193
|
-
),
|
|
5194
|
-
children: [
|
|
5195
|
-
/* @__PURE__ */ jsx35(
|
|
5589
|
+
/* @__PURE__ */ jsx39(
|
|
5196
5590
|
"input",
|
|
5197
|
-
{
|
|
5198
|
-
type: "radio",
|
|
5199
|
-
name,
|
|
5200
|
-
value: opt.value,
|
|
5201
|
-
checked: active === opt.value,
|
|
5202
|
-
disabled: opt.disabled,
|
|
5203
|
-
onChange: () => select(opt.value),
|
|
5204
|
-
className: "sr-only"
|
|
5205
|
-
}
|
|
5206
|
-
),
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
}
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
renderItem,
|
|
5257
|
-
addButtonText = "Add Item",
|
|
5258
|
-
className
|
|
5259
|
-
}) {
|
|
5260
|
-
return /* @__PURE__ */ jsxs32("div", { className: cn("space-y-3", className), children: [
|
|
5261
|
-
items.map((item, index) => /* @__PURE__ */ jsxs32(
|
|
5262
|
-
"div",
|
|
5263
|
-
{
|
|
5264
|
-
className: "group relative flex items-start gap-3 rounded-xl border border-border bg-card/50 backdrop-blur-sm p-4 shadow-sm transition-all duration-200 hover:border-primary/30 hover:shadow-md hover:shadow-primary/5",
|
|
5265
|
-
style: { animation: "fadeSlideIn 0.2s ease-out" },
|
|
5266
|
-
children: [
|
|
5267
|
-
/* @__PURE__ */ jsx36("div", { className: "mt-1 cursor-grab text-muted-foreground/30 group-hover:text-muted-foreground/60 transition-colors shrink-0", children: /* @__PURE__ */ jsx36(GripVertical4, { className: "h-4 w-4" }) }),
|
|
5268
|
-
/* @__PURE__ */ jsx36("div", { className: "mt-1 flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-primary/10 text-[10px] font-semibold text-primary", children: index + 1 }),
|
|
5269
|
-
/* @__PURE__ */ jsx36("div", { className: "flex-1 min-w-0", children: renderItem(item, index) }),
|
|
5270
|
-
/* @__PURE__ */ jsxs32(
|
|
5271
|
-
Button,
|
|
5272
|
-
{
|
|
5273
|
-
type: "button",
|
|
5274
|
-
variant: "ghost",
|
|
5275
|
-
size: "sm",
|
|
5276
|
-
className: "mt-0.5 h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100 text-muted-foreground hover:text-danger hover:bg-danger/10 transition-all duration-150 p-0",
|
|
5277
|
-
onClick: () => onRemove(index),
|
|
5278
|
-
children: [
|
|
5279
|
-
/* @__PURE__ */ jsx36(Trash22, { className: "h-3.5 w-3.5" }),
|
|
5280
|
-
/* @__PURE__ */ jsx36("span", { className: "sr-only", children: "Remove item" })
|
|
5281
|
-
]
|
|
5282
|
-
}
|
|
5283
|
-
)
|
|
5284
|
-
]
|
|
5285
|
-
},
|
|
5286
|
-
index
|
|
5287
|
-
)),
|
|
5288
|
-
/* @__PURE__ */ jsxs32(
|
|
5289
|
-
"button",
|
|
5290
|
-
{
|
|
5291
|
-
type: "button",
|
|
5292
|
-
onClick: onAdd,
|
|
5293
|
-
className: "group flex w-full items-center justify-center gap-2 rounded-xl border border-dashed border-border py-3 text-sm font-medium text-muted-foreground transition-all duration-200 hover:border-primary/50 hover:bg-primary/5 hover:text-primary",
|
|
5294
|
-
children: [
|
|
5295
|
-
/* @__PURE__ */ jsx36("span", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-muted group-hover:bg-primary/10 transition-colors", children: /* @__PURE__ */ jsx36(Plus4, { className: "h-3 w-3" }) }),
|
|
5296
|
-
addButtonText
|
|
5297
|
-
]
|
|
5298
|
-
}
|
|
5299
|
-
),
|
|
5300
|
-
/* @__PURE__ */ jsx36("style", { children: `
|
|
5301
|
-
@keyframes fadeSlideIn {
|
|
5302
|
-
from { opacity: 0; transform: translateY(-6px); }
|
|
5303
|
-
to { opacity: 1; transform: translateY(0); }
|
|
5304
|
-
}
|
|
5305
|
-
` })
|
|
5306
|
-
] });
|
|
5307
|
-
}
|
|
5308
|
-
|
|
5309
|
-
// src/components/ui/panel.tsx
|
|
5310
|
-
import * as React32 from "react";
|
|
5311
|
-
import { PanelLeftClose, PanelLeftOpen, Sun as Sun2, Moon } from "lucide-react";
|
|
5312
|
-
|
|
5313
|
-
// src/components/ui/tooltip.tsx
|
|
5314
|
-
import * as React30 from "react";
|
|
5315
|
-
import * as ReactDOM from "react-dom";
|
|
5316
|
-
import { Fragment as Fragment7, jsx as jsx37, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
5317
|
-
function Tooltip({
|
|
5318
|
-
content,
|
|
5319
|
-
children,
|
|
5320
|
-
side = "right",
|
|
5321
|
-
className,
|
|
5322
|
-
enabled = true
|
|
5323
|
-
}) {
|
|
5324
|
-
const [visible, setVisible] = React30.useState(false);
|
|
5325
|
-
const [coords, setCoords] = React30.useState({ top: 0, left: 0 });
|
|
5326
|
-
const ref = React30.useRef(null);
|
|
5327
|
-
if (!enabled) return /* @__PURE__ */ jsx37(Fragment7, { children });
|
|
5328
|
-
function calcCoords() {
|
|
5329
|
-
const r = ref.current?.getBoundingClientRect();
|
|
5330
|
-
if (!r) return;
|
|
5331
|
-
const GAP = 8;
|
|
5332
|
-
switch (side) {
|
|
5333
|
-
case "right":
|
|
5334
|
-
setCoords({ top: r.top + r.height / 2, left: r.right + GAP });
|
|
5335
|
-
break;
|
|
5336
|
-
case "left":
|
|
5337
|
-
setCoords({ top: r.top + r.height / 2, left: r.left - GAP });
|
|
5338
|
-
break;
|
|
5339
|
-
case "top":
|
|
5340
|
-
setCoords({ top: r.top - GAP, left: r.left + r.width / 2 });
|
|
5341
|
-
break;
|
|
5342
|
-
case "bottom":
|
|
5343
|
-
setCoords({ top: r.bottom + GAP, left: r.left + r.width / 2 });
|
|
5344
|
-
break;
|
|
5345
|
-
}
|
|
5346
|
-
}
|
|
5347
|
-
const transformClass = {
|
|
5348
|
-
right: "-translate-y-1/2",
|
|
5349
|
-
left: "-translate-y-1/2 -translate-x-full",
|
|
5350
|
-
top: "-translate-x-1/2 -translate-y-full",
|
|
5351
|
-
bottom: "-translate-x-1/2"
|
|
5352
|
-
}[side];
|
|
5353
|
-
return /* @__PURE__ */ jsxs33(
|
|
5354
|
-
"div",
|
|
5355
|
-
{
|
|
5356
|
-
ref,
|
|
5357
|
-
className: "relative inline-flex",
|
|
5358
|
-
onMouseEnter: () => {
|
|
5359
|
-
calcCoords();
|
|
5360
|
-
setVisible(true);
|
|
5361
|
-
},
|
|
5362
|
-
onMouseLeave: () => setVisible(false),
|
|
5363
|
-
onFocus: () => {
|
|
5364
|
-
calcCoords();
|
|
5365
|
-
setVisible(true);
|
|
5366
|
-
},
|
|
5367
|
-
onBlur: () => setVisible(false),
|
|
5368
|
-
children: [
|
|
5369
|
-
children,
|
|
5370
|
-
visible && ReactDOM.createPortal(
|
|
5371
|
-
/* @__PURE__ */ jsx37(
|
|
5372
|
-
"div",
|
|
5373
|
-
{
|
|
5374
|
-
role: "tooltip",
|
|
5375
|
-
style: { top: coords.top, left: coords.left },
|
|
5376
|
-
className: cn(
|
|
5377
|
-
"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",
|
|
5378
|
-
transformClass,
|
|
5379
|
-
className
|
|
5380
|
-
),
|
|
5381
|
-
children: content
|
|
5382
|
-
}
|
|
5383
|
-
),
|
|
5384
|
-
document.body
|
|
5385
|
-
)
|
|
5386
|
-
]
|
|
5387
|
-
}
|
|
5388
|
-
);
|
|
5389
|
-
}
|
|
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
|
-
|
|
5425
|
-
// src/components/ui/panel.tsx
|
|
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
|
-
}
|
|
5444
|
-
function Panel({
|
|
5445
|
-
sidebar,
|
|
5446
|
-
sidebarHeader,
|
|
5447
|
-
sidebarFooter,
|
|
5448
|
-
sidebarWidth = "w-56",
|
|
5449
|
-
topbar,
|
|
5450
|
-
topbarTrailing,
|
|
5451
|
-
defaultCollapsed = false,
|
|
5452
|
-
collapsible = false,
|
|
5453
|
-
showThemeToggle = false,
|
|
5454
|
-
defaultPage,
|
|
5455
|
-
height = "h-[520px]",
|
|
5456
|
-
children,
|
|
5457
|
-
className
|
|
5458
|
-
}) {
|
|
5459
|
-
const [collapsed, setCollapsed] = React32.useState(defaultCollapsed);
|
|
5460
|
-
return /* @__PURE__ */ jsx39(PanelCollapsedContext.Provider, { value: collapsed, children: /* @__PURE__ */ jsxs34(
|
|
5461
|
-
"div",
|
|
5462
|
-
{
|
|
5463
|
-
className: cn(
|
|
5464
|
-
"relative flex overflow-hidden rounded-xl border border-border bg-background shadow-lg",
|
|
5465
|
-
height,
|
|
5466
|
-
className
|
|
5467
|
-
),
|
|
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
|
-
] }),
|
|
5473
|
-
sidebar && /* @__PURE__ */ jsxs34(
|
|
5474
|
-
"aside",
|
|
5475
|
-
{
|
|
5476
|
-
className: cn(
|
|
5477
|
-
"relative z-10 flex flex-col shrink-0 border-r border-border transition-all duration-200",
|
|
5478
|
-
collapsed ? "w-14" : sidebarWidth
|
|
5479
|
-
),
|
|
5480
|
-
children: [
|
|
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
|
-
)
|
|
5502
|
-
]
|
|
5503
|
-
}
|
|
5504
|
-
),
|
|
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: [
|
|
5507
|
-
/* @__PURE__ */ jsxs34("div", { className: "flex items-center gap-2", children: [
|
|
5508
|
-
collapsible && sidebar && /* @__PURE__ */ jsx39(
|
|
5509
|
-
Tooltip,
|
|
5510
|
-
{
|
|
5511
|
-
content: collapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
5512
|
-
side: "bottom",
|
|
5513
|
-
children: /* @__PURE__ */ jsx39(
|
|
5514
|
-
"button",
|
|
5515
|
-
{
|
|
5516
|
-
type: "button",
|
|
5517
|
-
onClick: () => setCollapsed((c) => !c),
|
|
5518
|
-
className: "text-muted-foreground hover:text-foreground transition-colors",
|
|
5519
|
-
"aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
5520
|
-
children: collapsed ? /* @__PURE__ */ jsx39(PanelLeftOpen, { className: "h-5 w-5" }) : /* @__PURE__ */ jsx39(PanelLeftClose, { className: "h-5 w-5" })
|
|
5521
|
-
}
|
|
5522
|
-
)
|
|
5523
|
-
}
|
|
5524
|
-
),
|
|
5525
|
-
topbar && /* @__PURE__ */ jsx39("div", { className: "flex items-center gap-2", children: topbar })
|
|
5526
|
-
] }),
|
|
5527
|
-
/* @__PURE__ */ jsxs34("div", { className: "flex items-center gap-2", children: [
|
|
5528
|
-
topbarTrailing,
|
|
5529
|
-
showThemeToggle && /* @__PURE__ */ jsx39(PanelThemeToggle, {})
|
|
5530
|
-
] })
|
|
5531
|
-
] }),
|
|
5532
|
-
/* @__PURE__ */ jsx39("main", { className: "flex-1 overflow-y-auto p-4", children })
|
|
5533
|
-
] })
|
|
5534
|
-
]
|
|
5535
|
-
}
|
|
5536
|
-
) });
|
|
5537
|
-
}
|
|
5538
|
-
function PanelSidebarItem({
|
|
5539
|
-
icon: Icon,
|
|
5540
|
-
label,
|
|
5541
|
-
active,
|
|
5542
|
-
onClick
|
|
5543
|
-
}) {
|
|
5544
|
-
const collapsed = React32.useContext(PanelCollapsedContext);
|
|
5545
|
-
return /* @__PURE__ */ jsx39(Tooltip, { content: label, side: "right", enabled: collapsed, children: /* @__PURE__ */ jsxs34(
|
|
5546
|
-
"button",
|
|
5591
|
+
{
|
|
5592
|
+
type: "radio",
|
|
5593
|
+
name,
|
|
5594
|
+
value: opt.value,
|
|
5595
|
+
checked: active === opt.value,
|
|
5596
|
+
disabled: opt.disabled,
|
|
5597
|
+
onChange: () => select(opt.value),
|
|
5598
|
+
className: "sr-only"
|
|
5599
|
+
}
|
|
5600
|
+
),
|
|
5601
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex w-full gap-3", children: [
|
|
5602
|
+
opt.icon && /* @__PURE__ */ jsx39("span", { className: "shrink-0 mt-0.5 text-muted-foreground", children: opt.icon }),
|
|
5603
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex-1 min-w-0", children: [
|
|
5604
|
+
/* @__PURE__ */ jsx39("p", { className: cn("font-medium", SIZE_TEXT[size], active === opt.value && "text-primary"), children: opt.label }),
|
|
5605
|
+
opt.description && /* @__PURE__ */ jsx39("p", { className: "text-xs text-muted-foreground mt-0.5", children: opt.description })
|
|
5606
|
+
] }),
|
|
5607
|
+
/* @__PURE__ */ jsx39("span", { className: cn(
|
|
5608
|
+
"shrink-0 mt-0.5 rounded-full border-2 flex items-center justify-center transition-colors",
|
|
5609
|
+
SIZE_RADIO[size],
|
|
5610
|
+
active === opt.value ? "border-primary" : "border-muted-foreground/40"
|
|
5611
|
+
), children: active === opt.value && /* @__PURE__ */ jsx39("span", { className: cn("rounded-full bg-primary", size === "sm" ? "h-1.5 w-1.5" : size === "lg" ? "h-2.5 w-2.5" : "h-2 w-2") }) })
|
|
5612
|
+
] })
|
|
5613
|
+
]
|
|
5614
|
+
},
|
|
5615
|
+
opt.value
|
|
5616
|
+
)) });
|
|
5617
|
+
}
|
|
5618
|
+
if (variant === "button") {
|
|
5619
|
+
return /* @__PURE__ */ jsx39("div", { className: cn("flex flex-wrap gap-2", className), children: options.map((opt) => /* @__PURE__ */ jsxs34(
|
|
5620
|
+
"label",
|
|
5621
|
+
{
|
|
5622
|
+
className: cn(
|
|
5623
|
+
"inline-flex items-center gap-2 cursor-pointer rounded-lg border px-3 py-2 font-medium transition-all",
|
|
5624
|
+
SIZE_TEXT[size],
|
|
5625
|
+
opt.disabled && "opacity-40 cursor-not-allowed pointer-events-none",
|
|
5626
|
+
active === opt.value ? "border-primary bg-primary text-primary-foreground" : "border-border hover:border-primary/40 hover:bg-accent/30 text-muted-foreground"
|
|
5627
|
+
),
|
|
5628
|
+
children: [
|
|
5629
|
+
/* @__PURE__ */ jsx39(
|
|
5630
|
+
"input",
|
|
5631
|
+
{
|
|
5632
|
+
type: "radio",
|
|
5633
|
+
name,
|
|
5634
|
+
value: opt.value,
|
|
5635
|
+
checked: active === opt.value,
|
|
5636
|
+
disabled: opt.disabled,
|
|
5637
|
+
onChange: () => select(opt.value),
|
|
5638
|
+
className: "sr-only"
|
|
5639
|
+
}
|
|
5640
|
+
),
|
|
5641
|
+
opt.icon && /* @__PURE__ */ jsx39("span", { className: "shrink-0", children: opt.icon }),
|
|
5642
|
+
opt.label
|
|
5643
|
+
]
|
|
5644
|
+
},
|
|
5645
|
+
opt.value
|
|
5646
|
+
)) });
|
|
5647
|
+
}
|
|
5648
|
+
return /* @__PURE__ */ jsx39("div", { className: cn("flex gap-3", orientation === "horizontal" ? "flex-row flex-wrap" : "flex-col", className), children: options.map((opt) => /* @__PURE__ */ jsxs34(
|
|
5649
|
+
"label",
|
|
5547
5650
|
{
|
|
5548
|
-
type: "button",
|
|
5549
|
-
onClick,
|
|
5550
5651
|
className: cn(
|
|
5551
|
-
"flex
|
|
5552
|
-
|
|
5553
|
-
active ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-primary/20 hover:text-primary cursor-pointer"
|
|
5652
|
+
"flex items-start gap-3 cursor-pointer",
|
|
5653
|
+
opt.disabled && "opacity-40 cursor-not-allowed pointer-events-none"
|
|
5554
5654
|
),
|
|
5555
5655
|
children: [
|
|
5556
|
-
|
|
5557
|
-
|
|
5656
|
+
/* @__PURE__ */ jsx39("span", { className: cn(
|
|
5657
|
+
"mt-0.5 shrink-0 rounded-full border-2 flex items-center justify-center transition-colors",
|
|
5658
|
+
SIZE_RADIO[size],
|
|
5659
|
+
active === opt.value ? "border-primary" : "border-muted-foreground/40"
|
|
5660
|
+
), children: active === opt.value && /* @__PURE__ */ jsx39("span", { className: cn("rounded-full bg-primary", size === "sm" ? "h-1.5 w-1.5" : size === "lg" ? "h-2.5 w-2.5" : "h-2 w-2") }) }),
|
|
5661
|
+
/* @__PURE__ */ jsx39(
|
|
5662
|
+
"input",
|
|
5663
|
+
{
|
|
5664
|
+
type: "radio",
|
|
5665
|
+
name,
|
|
5666
|
+
value: opt.value,
|
|
5667
|
+
checked: active === opt.value,
|
|
5668
|
+
disabled: opt.disabled,
|
|
5669
|
+
onChange: () => select(opt.value),
|
|
5670
|
+
className: "sr-only"
|
|
5671
|
+
}
|
|
5672
|
+
),
|
|
5673
|
+
/* @__PURE__ */ jsxs34("div", { children: [
|
|
5674
|
+
/* @__PURE__ */ jsx39("p", { className: cn("font-medium leading-tight", SIZE_TEXT[size]), children: opt.label }),
|
|
5675
|
+
opt.description && /* @__PURE__ */ jsx39("p", { className: "text-xs text-muted-foreground mt-0.5", children: opt.description })
|
|
5676
|
+
] })
|
|
5558
5677
|
]
|
|
5559
|
-
}
|
|
5560
|
-
|
|
5678
|
+
},
|
|
5679
|
+
opt.value
|
|
5680
|
+
)) });
|
|
5561
5681
|
}
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5682
|
+
|
|
5683
|
+
// src/components/ui/repeater.tsx
|
|
5684
|
+
import { Plus as Plus4, Trash2 as Trash22, GripVertical as GripVertical4 } from "lucide-react";
|
|
5685
|
+
import { jsx as jsx40, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
5686
|
+
function Repeater({
|
|
5687
|
+
items,
|
|
5688
|
+
onAdd,
|
|
5689
|
+
onRemove,
|
|
5690
|
+
renderItem,
|
|
5691
|
+
addButtonText = "Add Item",
|
|
5692
|
+
className
|
|
5565
5693
|
}) {
|
|
5566
|
-
|
|
5567
|
-
|
|
5568
|
-
|
|
5569
|
-
|
|
5570
|
-
|
|
5694
|
+
return /* @__PURE__ */ jsxs35("div", { className: cn("space-y-3", className), children: [
|
|
5695
|
+
items.map((item, index) => /* @__PURE__ */ jsxs35(
|
|
5696
|
+
"div",
|
|
5697
|
+
{
|
|
5698
|
+
className: "group relative flex items-start gap-3 rounded-xl border border-border bg-card/50 backdrop-blur-sm p-4 shadow-sm transition-all duration-200 hover:border-primary/30 hover:shadow-md hover:shadow-primary/5",
|
|
5699
|
+
style: { animation: "fadeSlideIn 0.2s ease-out" },
|
|
5700
|
+
children: [
|
|
5701
|
+
/* @__PURE__ */ jsx40("div", { className: "mt-1 cursor-grab text-muted-foreground/30 group-hover:text-muted-foreground/60 transition-colors shrink-0", children: /* @__PURE__ */ jsx40(GripVertical4, { className: "h-4 w-4" }) }),
|
|
5702
|
+
/* @__PURE__ */ jsx40("div", { className: "mt-1 flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-primary/10 text-[10px] font-semibold text-primary", children: index + 1 }),
|
|
5703
|
+
/* @__PURE__ */ jsx40("div", { className: "flex-1 min-w-0", children: renderItem(item, index) }),
|
|
5704
|
+
/* @__PURE__ */ jsxs35(
|
|
5705
|
+
Button,
|
|
5706
|
+
{
|
|
5707
|
+
type: "button",
|
|
5708
|
+
variant: "ghost",
|
|
5709
|
+
size: "sm",
|
|
5710
|
+
className: "mt-0.5 h-7 w-7 shrink-0 opacity-0 group-hover:opacity-100 text-muted-foreground hover:text-danger hover:bg-danger/10 transition-all duration-150 p-0",
|
|
5711
|
+
onClick: () => onRemove(index),
|
|
5712
|
+
children: [
|
|
5713
|
+
/* @__PURE__ */ jsx40(Trash22, { className: "h-3.5 w-3.5" }),
|
|
5714
|
+
/* @__PURE__ */ jsx40("span", { className: "sr-only", children: "Remove item" })
|
|
5715
|
+
]
|
|
5716
|
+
}
|
|
5717
|
+
)
|
|
5718
|
+
]
|
|
5719
|
+
},
|
|
5720
|
+
index
|
|
5721
|
+
)),
|
|
5722
|
+
/* @__PURE__ */ jsxs35(
|
|
5723
|
+
"button",
|
|
5724
|
+
{
|
|
5725
|
+
type: "button",
|
|
5726
|
+
onClick: onAdd,
|
|
5727
|
+
className: "group flex w-full items-center justify-center gap-2 rounded-xl border border-dashed border-border py-3 text-sm font-medium text-muted-foreground transition-all duration-200 hover:border-primary/50 hover:bg-primary/5 hover:text-primary",
|
|
5728
|
+
children: [
|
|
5729
|
+
/* @__PURE__ */ jsx40("span", { className: "flex h-5 w-5 items-center justify-center rounded-full bg-muted group-hover:bg-primary/10 transition-colors", children: /* @__PURE__ */ jsx40(Plus4, { className: "h-3 w-3" }) }),
|
|
5730
|
+
addButtonText
|
|
5731
|
+
]
|
|
5732
|
+
}
|
|
5733
|
+
),
|
|
5734
|
+
/* @__PURE__ */ jsx40("style", { children: `
|
|
5735
|
+
@keyframes fadeSlideIn {
|
|
5736
|
+
from { opacity: 0; transform: translateY(-6px); }
|
|
5737
|
+
to { opacity: 1; transform: translateY(0); }
|
|
5738
|
+
}
|
|
5739
|
+
` })
|
|
5571
5740
|
] });
|
|
5572
5741
|
}
|
|
5573
5742
|
|
|
5574
5743
|
// src/components/ui/resizable-panels.tsx
|
|
5575
5744
|
import * as React33 from "react";
|
|
5576
|
-
import { jsx as
|
|
5745
|
+
import { jsx as jsx41, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
5577
5746
|
function ResizablePanels({
|
|
5578
5747
|
children,
|
|
5579
5748
|
orientation = "horizontal",
|
|
@@ -5610,7 +5779,7 @@ function ResizablePanels({
|
|
|
5610
5779
|
document.removeEventListener("mouseup", onUp);
|
|
5611
5780
|
};
|
|
5612
5781
|
}, [dragging, isHorizontal, minSize, maxSize]);
|
|
5613
|
-
return /* @__PURE__ */
|
|
5782
|
+
return /* @__PURE__ */ jsxs36(
|
|
5614
5783
|
"div",
|
|
5615
5784
|
{
|
|
5616
5785
|
ref: containerRef,
|
|
@@ -5621,7 +5790,7 @@ function ResizablePanels({
|
|
|
5621
5790
|
className
|
|
5622
5791
|
),
|
|
5623
5792
|
children: [
|
|
5624
|
-
/* @__PURE__ */
|
|
5793
|
+
/* @__PURE__ */ jsx41(
|
|
5625
5794
|
"div",
|
|
5626
5795
|
{
|
|
5627
5796
|
className: "overflow-auto",
|
|
@@ -5629,7 +5798,7 @@ function ResizablePanels({
|
|
|
5629
5798
|
children: children[0]
|
|
5630
5799
|
}
|
|
5631
5800
|
),
|
|
5632
|
-
/* @__PURE__ */
|
|
5801
|
+
/* @__PURE__ */ jsx41(
|
|
5633
5802
|
"div",
|
|
5634
5803
|
{
|
|
5635
5804
|
onMouseDown,
|
|
@@ -5639,13 +5808,13 @@ function ResizablePanels({
|
|
|
5639
5808
|
dragging && (isHorizontal ? "w-1.5 bg-primary/60" : "h-1.5 bg-primary/60"),
|
|
5640
5809
|
handleClassName
|
|
5641
5810
|
),
|
|
5642
|
-
children: /* @__PURE__ */
|
|
5811
|
+
children: /* @__PURE__ */ jsx41("div", { className: cn(
|
|
5643
5812
|
"rounded-full bg-muted-foreground/40",
|
|
5644
5813
|
isHorizontal ? "h-8 w-0.5" : "w-8 h-0.5"
|
|
5645
5814
|
) })
|
|
5646
5815
|
}
|
|
5647
5816
|
),
|
|
5648
|
-
/* @__PURE__ */
|
|
5817
|
+
/* @__PURE__ */ jsx41(
|
|
5649
5818
|
"div",
|
|
5650
5819
|
{
|
|
5651
5820
|
className: "flex-1 overflow-auto",
|
|
@@ -5661,24 +5830,24 @@ function ResizablePanels({
|
|
|
5661
5830
|
// src/components/ui/rich-text-editor.tsx
|
|
5662
5831
|
import * as React34 from "react";
|
|
5663
5832
|
import { Bold, Italic, Underline, List, ListOrdered, Link, Heading2, Heading3, Quote, Code, Undo, Redo } from "lucide-react";
|
|
5664
|
-
import { jsx as
|
|
5833
|
+
import { jsx as jsx42, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
5665
5834
|
var TOOLBAR = [
|
|
5666
|
-
{ icon: /* @__PURE__ */
|
|
5667
|
-
{ icon: /* @__PURE__ */
|
|
5835
|
+
{ icon: /* @__PURE__ */ jsx42(Undo, { className: "h-3.5 w-3.5" }), command: "undo", title: "Undo" },
|
|
5836
|
+
{ icon: /* @__PURE__ */ jsx42(Redo, { className: "h-3.5 w-3.5" }), command: "redo", title: "Redo" },
|
|
5668
5837
|
"divider",
|
|
5669
|
-
{ icon: /* @__PURE__ */
|
|
5670
|
-
{ icon: /* @__PURE__ */
|
|
5838
|
+
{ icon: /* @__PURE__ */ jsx42(Heading2, { className: "h-3.5 w-3.5" }), command: "formatBlock", value: "h2", title: "Heading 2" },
|
|
5839
|
+
{ icon: /* @__PURE__ */ jsx42(Heading3, { className: "h-3.5 w-3.5" }), command: "formatBlock", value: "h3", title: "Heading 3" },
|
|
5671
5840
|
"divider",
|
|
5672
|
-
{ icon: /* @__PURE__ */
|
|
5673
|
-
{ icon: /* @__PURE__ */
|
|
5674
|
-
{ icon: /* @__PURE__ */
|
|
5675
|
-
{ icon: /* @__PURE__ */
|
|
5841
|
+
{ icon: /* @__PURE__ */ jsx42(Bold, { className: "h-3.5 w-3.5" }), command: "bold", title: "Bold" },
|
|
5842
|
+
{ icon: /* @__PURE__ */ jsx42(Italic, { className: "h-3.5 w-3.5" }), command: "italic", title: "Italic" },
|
|
5843
|
+
{ icon: /* @__PURE__ */ jsx42(Underline, { className: "h-3.5 w-3.5" }), command: "underline", title: "Underline" },
|
|
5844
|
+
{ icon: /* @__PURE__ */ jsx42(Code, { className: "h-3.5 w-3.5" }), command: "formatBlock", value: "pre", title: "Code block" },
|
|
5676
5845
|
"divider",
|
|
5677
|
-
{ icon: /* @__PURE__ */
|
|
5678
|
-
{ icon: /* @__PURE__ */
|
|
5679
|
-
{ icon: /* @__PURE__ */
|
|
5846
|
+
{ icon: /* @__PURE__ */ jsx42(List, { className: "h-3.5 w-3.5" }), command: "insertUnorderedList", title: "Bullet list" },
|
|
5847
|
+
{ icon: /* @__PURE__ */ jsx42(ListOrdered, { className: "h-3.5 w-3.5" }), command: "insertOrderedList", title: "Numbered list" },
|
|
5848
|
+
{ icon: /* @__PURE__ */ jsx42(Quote, { className: "h-3.5 w-3.5" }), command: "formatBlock", value: "blockquote", title: "Quote" },
|
|
5680
5849
|
"divider",
|
|
5681
|
-
{ icon: /* @__PURE__ */
|
|
5850
|
+
{ icon: /* @__PURE__ */ jsx42(Link, { className: "h-3.5 w-3.5" }), command: "createLink", title: "Insert link" }
|
|
5682
5851
|
];
|
|
5683
5852
|
function RichTextEditor({
|
|
5684
5853
|
value: controlled,
|
|
@@ -5727,14 +5896,14 @@ function RichTextEditor({
|
|
|
5727
5896
|
return false;
|
|
5728
5897
|
}
|
|
5729
5898
|
}
|
|
5730
|
-
return /* @__PURE__ */
|
|
5899
|
+
return /* @__PURE__ */ jsxs37("div", { className: cn(
|
|
5731
5900
|
"rounded-xl border border-border overflow-hidden transition-colors",
|
|
5732
5901
|
focused && "ring-2 ring-ring border-primary",
|
|
5733
5902
|
disabled && "opacity-50 pointer-events-none",
|
|
5734
5903
|
className
|
|
5735
5904
|
), children: [
|
|
5736
|
-
/* @__PURE__ */
|
|
5737
|
-
(item, i) => item === "divider" ? /* @__PURE__ */
|
|
5905
|
+
/* @__PURE__ */ jsx42("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(
|
|
5906
|
+
(item, i) => item === "divider" ? /* @__PURE__ */ jsx42("span", { className: "mx-1 h-4 w-px bg-border" }, i) : /* @__PURE__ */ jsx42(
|
|
5738
5907
|
"button",
|
|
5739
5908
|
{
|
|
5740
5909
|
type: "button",
|
|
@@ -5752,9 +5921,9 @@ function RichTextEditor({
|
|
|
5752
5921
|
i
|
|
5753
5922
|
)
|
|
5754
5923
|
) }),
|
|
5755
|
-
/* @__PURE__ */
|
|
5756
|
-
isEmpty && !focused && /* @__PURE__ */
|
|
5757
|
-
/* @__PURE__ */
|
|
5924
|
+
/* @__PURE__ */ jsxs37("div", { className: "relative", children: [
|
|
5925
|
+
isEmpty && !focused && /* @__PURE__ */ jsx42("p", { className: "absolute top-3 left-4 text-sm text-muted-foreground pointer-events-none select-none", children: placeholder }),
|
|
5926
|
+
/* @__PURE__ */ jsx42(
|
|
5758
5927
|
"div",
|
|
5759
5928
|
{
|
|
5760
5929
|
ref: editorRef,
|
|
@@ -5781,7 +5950,7 @@ function RichTextEditor({
|
|
|
5781
5950
|
}
|
|
5782
5951
|
|
|
5783
5952
|
// src/components/ui/scroll-area.tsx
|
|
5784
|
-
import { jsx as
|
|
5953
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
5785
5954
|
function ScrollArea({
|
|
5786
5955
|
maxHeight,
|
|
5787
5956
|
maxWidth,
|
|
@@ -5796,7 +5965,7 @@ function ScrollArea({
|
|
|
5796
5965
|
horizontal: "overflow-x-auto overflow-y-hidden",
|
|
5797
5966
|
both: "overflow-auto"
|
|
5798
5967
|
}[orientation];
|
|
5799
|
-
return /* @__PURE__ */
|
|
5968
|
+
return /* @__PURE__ */ jsx43(
|
|
5800
5969
|
"div",
|
|
5801
5970
|
{
|
|
5802
5971
|
className: cn(
|
|
@@ -5818,7 +5987,7 @@ function ScrollArea({
|
|
|
5818
5987
|
// src/components/ui/section.tsx
|
|
5819
5988
|
import * as React35 from "react";
|
|
5820
5989
|
import { ChevronDown as ChevronDown6 } from "lucide-react";
|
|
5821
|
-
import { jsx as
|
|
5990
|
+
import { jsx as jsx44, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
5822
5991
|
var variantWrap = {
|
|
5823
5992
|
default: "",
|
|
5824
5993
|
card: "rounded-xl glass shadow-lg overflow-hidden",
|
|
@@ -5851,8 +6020,8 @@ function SectionBlock({
|
|
|
5851
6020
|
contentClassName
|
|
5852
6021
|
}) {
|
|
5853
6022
|
const [open, setOpen] = React35.useState(defaultOpen);
|
|
5854
|
-
return /* @__PURE__ */
|
|
5855
|
-
(title || description || action) && /* @__PURE__ */
|
|
6023
|
+
return /* @__PURE__ */ jsxs38("div", { className: cn(variantWrap[variant], className), children: [
|
|
6024
|
+
(title || description || action) && /* @__PURE__ */ jsxs38(
|
|
5856
6025
|
"div",
|
|
5857
6026
|
{
|
|
5858
6027
|
className: cn(
|
|
@@ -5863,16 +6032,16 @@ function SectionBlock({
|
|
|
5863
6032
|
),
|
|
5864
6033
|
onClick: collapsible ? () => setOpen((o) => !o) : void 0,
|
|
5865
6034
|
children: [
|
|
5866
|
-
/* @__PURE__ */
|
|
5867
|
-
icon && /* @__PURE__ */
|
|
5868
|
-
/* @__PURE__ */
|
|
5869
|
-
title && /* @__PURE__ */
|
|
5870
|
-
description && /* @__PURE__ */
|
|
6035
|
+
/* @__PURE__ */ jsxs38("div", { className: "flex items-start gap-3 min-w-0", children: [
|
|
6036
|
+
icon && /* @__PURE__ */ jsx44("span", { className: "mt-0.5 shrink-0 text-primary", children: icon }),
|
|
6037
|
+
/* @__PURE__ */ jsxs38("div", { className: "min-w-0", children: [
|
|
6038
|
+
title && /* @__PURE__ */ jsx44("h3", { className: "text-base font-semibold leading-tight", children: title }),
|
|
6039
|
+
description && /* @__PURE__ */ jsx44("p", { className: "mt-0.5 text-sm text-muted-foreground", children: description })
|
|
5871
6040
|
] })
|
|
5872
6041
|
] }),
|
|
5873
|
-
/* @__PURE__ */
|
|
5874
|
-
action && /* @__PURE__ */
|
|
5875
|
-
collapsible && /* @__PURE__ */
|
|
6042
|
+
/* @__PURE__ */ jsxs38("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
6043
|
+
action && /* @__PURE__ */ jsx44("div", { onClick: (e) => e.stopPropagation(), children: action }),
|
|
6044
|
+
collapsible && /* @__PURE__ */ jsx44(
|
|
5876
6045
|
ChevronDown6,
|
|
5877
6046
|
{
|
|
5878
6047
|
className: cn(
|
|
@@ -5885,17 +6054,286 @@ function SectionBlock({
|
|
|
5885
6054
|
]
|
|
5886
6055
|
}
|
|
5887
6056
|
),
|
|
5888
|
-
(!collapsible || open) && /* @__PURE__ */
|
|
6057
|
+
(!collapsible || open) && /* @__PURE__ */ jsx44("div", { className: cn(variantBody[variant], contentClassName), children })
|
|
6058
|
+
] });
|
|
6059
|
+
}
|
|
6060
|
+
|
|
6061
|
+
// src/components/ui/settings.tsx
|
|
6062
|
+
import { RotateCcw as RotateCcw2 } from "lucide-react";
|
|
6063
|
+
|
|
6064
|
+
// src/components/ui/tabs.tsx
|
|
6065
|
+
import * as React36 from "react";
|
|
6066
|
+
import { jsx as jsx45, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
6067
|
+
var sizeMap = {
|
|
6068
|
+
sm: "px-3 py-1.5 text-xs",
|
|
6069
|
+
md: "px-4 py-2 text-sm",
|
|
6070
|
+
lg: "px-5 py-2.5 text-base"
|
|
6071
|
+
};
|
|
6072
|
+
var variantTrack = {
|
|
6073
|
+
line: "border-b border-border gap-0",
|
|
6074
|
+
pill: "bg-muted/50 rounded-xl p-1 gap-1",
|
|
6075
|
+
boxed: "border border-border rounded-xl p-1 gap-1",
|
|
6076
|
+
lifted: "gap-0"
|
|
6077
|
+
};
|
|
6078
|
+
function tabClass(variant, size, active, disabled) {
|
|
6079
|
+
const base = cn(
|
|
6080
|
+
"inline-flex items-center gap-2 font-medium transition-all duration-150 select-none whitespace-nowrap",
|
|
6081
|
+
sizeMap[size],
|
|
6082
|
+
disabled && "opacity-40 cursor-not-allowed pointer-events-none"
|
|
6083
|
+
);
|
|
6084
|
+
if (variant === "line") return cn(
|
|
6085
|
+
base,
|
|
6086
|
+
"rounded-none border-b-2 -mb-px",
|
|
6087
|
+
active ? "border-primary text-primary" : "border-transparent text-muted-foreground hover:text-foreground hover:border-border"
|
|
6088
|
+
);
|
|
6089
|
+
if (variant === "pill") return cn(
|
|
6090
|
+
base,
|
|
6091
|
+
"rounded-lg",
|
|
6092
|
+
active ? "bg-primary text-primary-foreground shadow-sm" : "text-muted-foreground hover:text-foreground hover:bg-background/60"
|
|
6093
|
+
);
|
|
6094
|
+
if (variant === "boxed") return cn(
|
|
6095
|
+
base,
|
|
6096
|
+
"rounded-lg",
|
|
6097
|
+
active ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"
|
|
6098
|
+
);
|
|
6099
|
+
if (variant === "lifted") return cn(
|
|
6100
|
+
base,
|
|
6101
|
+
"rounded-t-lg border border-b-0",
|
|
6102
|
+
active ? "border-border bg-background text-foreground -mb-px" : "border-transparent text-muted-foreground hover:text-foreground"
|
|
6103
|
+
);
|
|
6104
|
+
return base;
|
|
6105
|
+
}
|
|
6106
|
+
function Tabs({
|
|
6107
|
+
items,
|
|
6108
|
+
value: controlledValue,
|
|
6109
|
+
defaultValue,
|
|
6110
|
+
onChange,
|
|
6111
|
+
variant = "line",
|
|
6112
|
+
size = "md",
|
|
6113
|
+
fullWidth = false,
|
|
6114
|
+
className
|
|
6115
|
+
}) {
|
|
6116
|
+
const [internal, setInternal] = React36.useState(defaultValue ?? items[0]?.value ?? "");
|
|
6117
|
+
const active = controlledValue ?? internal;
|
|
6118
|
+
const select = (v) => {
|
|
6119
|
+
if (!controlledValue) setInternal(v);
|
|
6120
|
+
onChange?.(v);
|
|
6121
|
+
};
|
|
6122
|
+
const activeItem = items.find((i) => i.value === active);
|
|
6123
|
+
return /* @__PURE__ */ jsxs39("div", { className: cn("w-full", className), children: [
|
|
6124
|
+
/* @__PURE__ */ jsx45("div", { className: cn("flex", fullWidth && "w-full", variantTrack[variant]), children: items.map((item) => /* @__PURE__ */ jsxs39(
|
|
6125
|
+
"button",
|
|
6126
|
+
{
|
|
6127
|
+
type: "button",
|
|
6128
|
+
disabled: item.disabled,
|
|
6129
|
+
onClick: () => select(item.value),
|
|
6130
|
+
className: cn(
|
|
6131
|
+
tabClass(variant, size, active === item.value, !!item.disabled),
|
|
6132
|
+
fullWidth && "flex-1 justify-center"
|
|
6133
|
+
),
|
|
6134
|
+
children: [
|
|
6135
|
+
item.icon && /* @__PURE__ */ jsx45("span", { className: "shrink-0", children: item.icon }),
|
|
6136
|
+
item.label,
|
|
6137
|
+
item.badge && /* @__PURE__ */ jsx45("span", { className: "shrink-0", children: item.badge })
|
|
6138
|
+
]
|
|
6139
|
+
},
|
|
6140
|
+
item.value
|
|
6141
|
+
)) }),
|
|
6142
|
+
activeItem?.content && /* @__PURE__ */ jsx45("div", { className: "mt-4", children: activeItem.content })
|
|
6143
|
+
] });
|
|
6144
|
+
}
|
|
6145
|
+
|
|
6146
|
+
// src/components/ui/settings.tsx
|
|
6147
|
+
import { jsx as jsx46, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
6148
|
+
var FONT_SIZES = [
|
|
6149
|
+
{ value: "14px", label: "Small (14px)" },
|
|
6150
|
+
{ value: "16px", label: "Medium (16px)" },
|
|
6151
|
+
{ value: "18px", label: "Large (18px)" },
|
|
6152
|
+
{ value: "20px", label: "Extra Large (20px)" }
|
|
6153
|
+
];
|
|
6154
|
+
var FONT_FAMILIES = [
|
|
6155
|
+
{ value: '"Space Grotesk", "Inter", sans-serif', label: "Space Grotesk" },
|
|
6156
|
+
{ value: '"Inter", sans-serif', label: "Inter" },
|
|
6157
|
+
{ value: '"JetBrains Mono", monospace', label: "JetBrains Mono" },
|
|
6158
|
+
{ value: "system-ui, sans-serif", label: "System UI" }
|
|
6159
|
+
];
|
|
6160
|
+
var THEME_OPTIONS = [
|
|
6161
|
+
{ value: "light", label: "Light" },
|
|
6162
|
+
{ value: "dark", label: "Dark" },
|
|
6163
|
+
{ value: "system", label: "System" }
|
|
6164
|
+
];
|
|
6165
|
+
var COLOR_PAIRS = [
|
|
6166
|
+
{ base: "primary", hover: "primaryHover", label: "Primary" },
|
|
6167
|
+
{ base: "secondary", hover: "secondaryHover", label: "Secondary" },
|
|
6168
|
+
{ base: "info", hover: "infoHover", label: "Info" },
|
|
6169
|
+
{ base: "warning", hover: "warningHover", label: "Warning" },
|
|
6170
|
+
{ base: "danger", hover: "dangerHover", label: "Danger" }
|
|
6171
|
+
];
|
|
6172
|
+
function SettingRow({ label, description, children }) {
|
|
6173
|
+
return /* @__PURE__ */ jsxs40("div", { className: "flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-0", children: [
|
|
6174
|
+
/* @__PURE__ */ jsxs40("div", { className: "min-w-0", children: [
|
|
6175
|
+
/* @__PURE__ */ jsx46("p", { className: "text-sm font-medium", children: label }),
|
|
6176
|
+
description && /* @__PURE__ */ jsx46("p", { className: "text-xs text-muted-foreground mt-0.5", children: description })
|
|
6177
|
+
] }),
|
|
6178
|
+
/* @__PURE__ */ jsx46("div", { className: "shrink-0", children })
|
|
6179
|
+
] });
|
|
6180
|
+
}
|
|
6181
|
+
function SectionHeading({ children }) {
|
|
6182
|
+
return /* @__PURE__ */ jsx46("p", { className: "text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-3 mt-1", children });
|
|
6183
|
+
}
|
|
6184
|
+
function AppearancePanel({ onThemeChange }) {
|
|
6185
|
+
const { theme, setTheme } = useTheme();
|
|
6186
|
+
const handleTheme = (v) => {
|
|
6187
|
+
const t = v;
|
|
6188
|
+
setTheme(t);
|
|
6189
|
+
onThemeChange?.(t);
|
|
6190
|
+
};
|
|
6191
|
+
return /* @__PURE__ */ jsxs40("div", { className: "space-y-1", children: [
|
|
6192
|
+
/* @__PURE__ */ jsx46(SectionHeading, { children: "Display" }),
|
|
6193
|
+
/* @__PURE__ */ jsx46(SettingRow, { label: "Theme", description: "Choose between light, dark, or follow system preference.", children: /* @__PURE__ */ jsx46(
|
|
6194
|
+
Select,
|
|
6195
|
+
{
|
|
6196
|
+
options: THEME_OPTIONS,
|
|
6197
|
+
value: theme,
|
|
6198
|
+
onChange: handleTheme,
|
|
6199
|
+
className: "w-32"
|
|
6200
|
+
}
|
|
6201
|
+
) })
|
|
6202
|
+
] });
|
|
6203
|
+
}
|
|
6204
|
+
function ColorsPanel({ onColorsChange }) {
|
|
6205
|
+
const { colors, setColors } = useTheme();
|
|
6206
|
+
const handleColor = (key, value) => {
|
|
6207
|
+
setColors({ [key]: value });
|
|
6208
|
+
onColorsChange?.({ [key]: value });
|
|
6209
|
+
};
|
|
6210
|
+
return /* @__PURE__ */ jsxs40("div", { className: "space-y-4", children: [
|
|
6211
|
+
/* @__PURE__ */ jsxs40("div", { children: [
|
|
6212
|
+
/* @__PURE__ */ jsx46(SectionHeading, { children: "Quick Palette" }),
|
|
6213
|
+
/* @__PURE__ */ jsx46("div", { className: "grid grid-cols-10 gap-1.5", children: COLOR_PALETTE.map((c) => /* @__PURE__ */ jsx46(
|
|
6214
|
+
"button",
|
|
6215
|
+
{
|
|
6216
|
+
type: "button",
|
|
6217
|
+
title: c.base,
|
|
6218
|
+
onClick: () => {
|
|
6219
|
+
setColors({ primary: c.base, primaryHover: c.hover });
|
|
6220
|
+
onColorsChange?.({ primary: c.base, primaryHover: c.hover });
|
|
6221
|
+
},
|
|
6222
|
+
className: cn(
|
|
6223
|
+
"h-7 w-full rounded-md border border-white/10 transition-transform hover:scale-110 focus:outline-none focus:ring-2 focus:ring-ring",
|
|
6224
|
+
colors.primary === c.base && "ring-2 ring-ring ring-offset-1"
|
|
6225
|
+
),
|
|
6226
|
+
style: { backgroundColor: c.base }
|
|
6227
|
+
},
|
|
6228
|
+
c.base
|
|
6229
|
+
)) })
|
|
6230
|
+
] }),
|
|
6231
|
+
/* @__PURE__ */ jsxs40("div", { children: [
|
|
6232
|
+
/* @__PURE__ */ jsx46(SectionHeading, { children: "Custom Colors" }),
|
|
6233
|
+
/* @__PURE__ */ jsx46("div", { className: "space-y-0", children: COLOR_PAIRS.map((pair) => /* @__PURE__ */ jsxs40("div", { className: "py-3 border-b border-border/60 last:border-0", children: [
|
|
6234
|
+
/* @__PURE__ */ jsx46("p", { className: "text-xs font-semibold mb-2", children: pair.label }),
|
|
6235
|
+
/* @__PURE__ */ jsx46("div", { className: "grid grid-cols-2 gap-3", children: ["base", "hover"].map((variant) => {
|
|
6236
|
+
const key = variant === "base" ? pair.base : pair.hover;
|
|
6237
|
+
return /* @__PURE__ */ jsxs40("div", { className: "flex items-center gap-2", children: [
|
|
6238
|
+
/* @__PURE__ */ jsx46(
|
|
6239
|
+
Input,
|
|
6240
|
+
{
|
|
6241
|
+
type: "color",
|
|
6242
|
+
value: colors[key],
|
|
6243
|
+
onChange: (e) => handleColor(key, e.target.value),
|
|
6244
|
+
className: "h-7 w-12 cursor-pointer p-0.5 rounded"
|
|
6245
|
+
}
|
|
6246
|
+
),
|
|
6247
|
+
/* @__PURE__ */ jsxs40("div", { children: [
|
|
6248
|
+
/* @__PURE__ */ jsx46("p", { className: "text-[10px] text-muted-foreground capitalize", children: variant }),
|
|
6249
|
+
/* @__PURE__ */ jsx46("p", { className: "text-xs font-mono", children: colors[key] })
|
|
6250
|
+
] })
|
|
6251
|
+
] }, variant);
|
|
6252
|
+
}) })
|
|
6253
|
+
] }, pair.base)) })
|
|
6254
|
+
] })
|
|
6255
|
+
] });
|
|
6256
|
+
}
|
|
6257
|
+
function TypographyPanel({
|
|
6258
|
+
onFontSizeChange,
|
|
6259
|
+
onFontFamilyChange
|
|
6260
|
+
}) {
|
|
6261
|
+
const { fontSize, setFontSize, fontFamily, setFontFamily } = useTheme();
|
|
6262
|
+
const handleSize = (v) => {
|
|
6263
|
+
setFontSize(v);
|
|
6264
|
+
onFontSizeChange?.(v);
|
|
6265
|
+
};
|
|
6266
|
+
const handleFamily = (v) => {
|
|
6267
|
+
setFontFamily(v);
|
|
6268
|
+
onFontFamilyChange?.(v);
|
|
6269
|
+
};
|
|
6270
|
+
return /* @__PURE__ */ jsxs40("div", { className: "space-y-1", children: [
|
|
6271
|
+
/* @__PURE__ */ jsx46(SectionHeading, { children: "Font" }),
|
|
6272
|
+
/* @__PURE__ */ jsx46(SettingRow, { label: "Font Size", description: "Base font size applied across the UI.", children: /* @__PURE__ */ jsx46(Select, { options: FONT_SIZES, value: fontSize, onChange: handleSize, className: "w-44" }) }),
|
|
6273
|
+
/* @__PURE__ */ jsx46(SettingRow, { label: "Font Family", description: "Primary typeface used for all text.", children: /* @__PURE__ */ jsx46(Select, { options: FONT_FAMILIES, value: fontFamily, onChange: handleFamily, className: "w-44" }) }),
|
|
6274
|
+
/* @__PURE__ */ jsxs40("div", { className: "pt-4", children: [
|
|
6275
|
+
/* @__PURE__ */ jsx46(SectionHeading, { children: "Preview" }),
|
|
6276
|
+
/* @__PURE__ */ jsxs40(
|
|
6277
|
+
"div",
|
|
6278
|
+
{
|
|
6279
|
+
className: "rounded-lg border border-border bg-muted/30 p-4 space-y-1",
|
|
6280
|
+
style: { fontFamily, fontSize },
|
|
6281
|
+
children: [
|
|
6282
|
+
/* @__PURE__ */ jsx46("p", { className: "font-bold text-foreground", children: "The quick brown fox" }),
|
|
6283
|
+
/* @__PURE__ */ jsx46("p", { className: "text-muted-foreground", children: "jumps over the lazy dog. 0123456789" })
|
|
6284
|
+
]
|
|
6285
|
+
}
|
|
6286
|
+
)
|
|
6287
|
+
] })
|
|
6288
|
+
] });
|
|
6289
|
+
}
|
|
6290
|
+
function Settings({
|
|
6291
|
+
defaultTab = "appearance",
|
|
6292
|
+
onThemeChange,
|
|
6293
|
+
onColorsChange,
|
|
6294
|
+
onFontSizeChange,
|
|
6295
|
+
onFontFamilyChange,
|
|
6296
|
+
onReset,
|
|
6297
|
+
className
|
|
6298
|
+
}) {
|
|
6299
|
+
const { resetSettings } = useTheme();
|
|
6300
|
+
const handleReset = () => {
|
|
6301
|
+
resetSettings();
|
|
6302
|
+
onReset?.();
|
|
6303
|
+
};
|
|
6304
|
+
const tabs = [
|
|
6305
|
+
{
|
|
6306
|
+
value: "appearance",
|
|
6307
|
+
label: "Appearance",
|
|
6308
|
+
content: /* @__PURE__ */ jsx46(AppearancePanel, { onThemeChange })
|
|
6309
|
+
},
|
|
6310
|
+
{
|
|
6311
|
+
value: "colors",
|
|
6312
|
+
label: "Colors",
|
|
6313
|
+
content: /* @__PURE__ */ jsx46(ColorsPanel, { onColorsChange })
|
|
6314
|
+
},
|
|
6315
|
+
{
|
|
6316
|
+
value: "typography",
|
|
6317
|
+
label: "Typography",
|
|
6318
|
+
content: /* @__PURE__ */ jsx46(TypographyPanel, { onFontSizeChange, onFontFamilyChange })
|
|
6319
|
+
}
|
|
6320
|
+
];
|
|
6321
|
+
return /* @__PURE__ */ jsxs40("div", { className: cn("flex flex-col gap-4", className), children: [
|
|
6322
|
+
/* @__PURE__ */ jsx46(Tabs, { items: tabs, defaultValue: defaultTab, variant: "pill" }),
|
|
6323
|
+
/* @__PURE__ */ jsx46("div", { className: "flex justify-end pt-1", children: /* @__PURE__ */ jsxs40(Button, { variant: "outline", size: "sm", onClick: handleReset, children: [
|
|
6324
|
+
/* @__PURE__ */ jsx46(RotateCcw2, { className: "h-3.5 w-3.5 mr-1.5" }),
|
|
6325
|
+
"Reset to Defaults"
|
|
6326
|
+
] }) })
|
|
5889
6327
|
] });
|
|
5890
6328
|
}
|
|
5891
6329
|
|
|
5892
6330
|
// src/components/ui/skeleton.tsx
|
|
5893
|
-
import { jsx as
|
|
6331
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
5894
6332
|
function Skeleton({
|
|
5895
6333
|
className,
|
|
5896
6334
|
...props
|
|
5897
6335
|
}) {
|
|
5898
|
-
return /* @__PURE__ */
|
|
6336
|
+
return /* @__PURE__ */ jsx47(
|
|
5899
6337
|
"div",
|
|
5900
6338
|
{
|
|
5901
6339
|
className: cn("animate-pulse rounded-md bg-white/5 backdrop-blur-sm", className),
|
|
@@ -5905,8 +6343,8 @@ function Skeleton({
|
|
|
5905
6343
|
}
|
|
5906
6344
|
|
|
5907
6345
|
// src/components/ui/slider.tsx
|
|
5908
|
-
import * as
|
|
5909
|
-
import { jsx as
|
|
6346
|
+
import * as React37 from "react";
|
|
6347
|
+
import { jsx as jsx48, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
5910
6348
|
function pct(val, min, max) {
|
|
5911
6349
|
return (val - min) / (max - min) * 100;
|
|
5912
6350
|
}
|
|
@@ -5925,8 +6363,8 @@ function Slider({
|
|
|
5925
6363
|
showValue = false,
|
|
5926
6364
|
className
|
|
5927
6365
|
}) {
|
|
5928
|
-
const [internal, setInternal] =
|
|
5929
|
-
const [hovering, setHovering] =
|
|
6366
|
+
const [internal, setInternal] = React37.useState(defaultValue);
|
|
6367
|
+
const [hovering, setHovering] = React37.useState(false);
|
|
5930
6368
|
const val = controlled ?? internal;
|
|
5931
6369
|
function handleChange(e) {
|
|
5932
6370
|
const v = Number(e.target.value);
|
|
@@ -5934,20 +6372,20 @@ function Slider({
|
|
|
5934
6372
|
onChange?.(v);
|
|
5935
6373
|
}
|
|
5936
6374
|
const p = pct(val, min, max);
|
|
5937
|
-
return /* @__PURE__ */
|
|
5938
|
-
(label || showValue) && /* @__PURE__ */
|
|
5939
|
-
label && /* @__PURE__ */
|
|
5940
|
-
showValue && /* @__PURE__ */
|
|
6375
|
+
return /* @__PURE__ */ jsxs41("div", { className: cn("w-full space-y-2", className), children: [
|
|
6376
|
+
(label || showValue) && /* @__PURE__ */ jsxs41("div", { className: "flex items-center justify-between text-sm", children: [
|
|
6377
|
+
label && /* @__PURE__ */ jsx48("span", { className: "font-medium", children: label }),
|
|
6378
|
+
showValue && /* @__PURE__ */ jsx48("span", { className: "text-muted-foreground tabular-nums", children: val })
|
|
5941
6379
|
] }),
|
|
5942
|
-
/* @__PURE__ */
|
|
6380
|
+
/* @__PURE__ */ jsxs41(
|
|
5943
6381
|
"div",
|
|
5944
6382
|
{
|
|
5945
6383
|
className: "relative flex items-center h-5",
|
|
5946
6384
|
onMouseEnter: () => setHovering(true),
|
|
5947
6385
|
onMouseLeave: () => setHovering(false),
|
|
5948
6386
|
children: [
|
|
5949
|
-
/* @__PURE__ */
|
|
5950
|
-
showTooltip && hovering && !disabled && /* @__PURE__ */
|
|
6387
|
+
/* @__PURE__ */ jsx48("div", { className: "absolute w-full h-1.5 rounded-full bg-muted overflow-hidden", children: /* @__PURE__ */ jsx48("div", { className: "h-full rounded-full bg-primary", style: { width: `${p}%` } }) }),
|
|
6388
|
+
showTooltip && hovering && !disabled && /* @__PURE__ */ jsx48(
|
|
5951
6389
|
"div",
|
|
5952
6390
|
{
|
|
5953
6391
|
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",
|
|
@@ -5955,7 +6393,7 @@ function Slider({
|
|
|
5955
6393
|
children: val
|
|
5956
6394
|
}
|
|
5957
6395
|
),
|
|
5958
|
-
/* @__PURE__ */
|
|
6396
|
+
/* @__PURE__ */ jsx48(
|
|
5959
6397
|
"input",
|
|
5960
6398
|
{
|
|
5961
6399
|
type: "range",
|
|
@@ -5971,7 +6409,7 @@ function Slider({
|
|
|
5971
6409
|
)
|
|
5972
6410
|
}
|
|
5973
6411
|
),
|
|
5974
|
-
/* @__PURE__ */
|
|
6412
|
+
/* @__PURE__ */ jsx48(
|
|
5975
6413
|
"div",
|
|
5976
6414
|
{
|
|
5977
6415
|
className: cn(
|
|
@@ -5984,9 +6422,9 @@ function Slider({
|
|
|
5984
6422
|
]
|
|
5985
6423
|
}
|
|
5986
6424
|
),
|
|
5987
|
-
(showMarks || marks) && /* @__PURE__ */
|
|
5988
|
-
/* @__PURE__ */
|
|
5989
|
-
m.label && /* @__PURE__ */
|
|
6425
|
+
(showMarks || marks) && /* @__PURE__ */ jsx48("div", { className: "relative w-full flex justify-between px-0", children: (marks ?? [{ value: min }, { value: max }]).map((m) => /* @__PURE__ */ jsxs41("div", { className: "flex flex-col items-center gap-0.5", style: { position: "absolute", left: `${pct(m.value, min, max)}%`, transform: "translateX(-50%)" }, children: [
|
|
6426
|
+
/* @__PURE__ */ jsx48("span", { className: "h-1 w-0.5 bg-border" }),
|
|
6427
|
+
m.label && /* @__PURE__ */ jsx48("span", { className: "text-[10px] text-muted-foreground", children: m.label })
|
|
5990
6428
|
] }, m.value)) })
|
|
5991
6429
|
] });
|
|
5992
6430
|
}
|
|
@@ -6003,8 +6441,8 @@ function RangeSlider({
|
|
|
6003
6441
|
showValue = false,
|
|
6004
6442
|
className
|
|
6005
6443
|
}) {
|
|
6006
|
-
const [internal, setInternal] =
|
|
6007
|
-
const [active, setActive] =
|
|
6444
|
+
const [internal, setInternal] = React37.useState(defaultValue);
|
|
6445
|
+
const [active, setActive] = React37.useState(null);
|
|
6008
6446
|
const val = controlled ?? internal;
|
|
6009
6447
|
function handleChange(idx, e) {
|
|
6010
6448
|
const v = Number(e.target.value);
|
|
@@ -6014,21 +6452,21 @@ function RangeSlider({
|
|
|
6014
6452
|
}
|
|
6015
6453
|
const p0 = pct(val[0], min, max);
|
|
6016
6454
|
const p1 = pct(val[1], min, max);
|
|
6017
|
-
return /* @__PURE__ */
|
|
6018
|
-
(label || showValue) && /* @__PURE__ */
|
|
6019
|
-
label && /* @__PURE__ */
|
|
6020
|
-
showValue && /* @__PURE__ */
|
|
6455
|
+
return /* @__PURE__ */ jsxs41("div", { className: cn("w-full space-y-2", className), children: [
|
|
6456
|
+
(label || showValue) && /* @__PURE__ */ jsxs41("div", { className: "flex items-center justify-between text-sm", children: [
|
|
6457
|
+
label && /* @__PURE__ */ jsx48("span", { className: "font-medium", children: label }),
|
|
6458
|
+
showValue && /* @__PURE__ */ jsxs41("span", { className: "text-muted-foreground tabular-nums", children: [
|
|
6021
6459
|
val[0],
|
|
6022
6460
|
" \u2013 ",
|
|
6023
6461
|
val[1]
|
|
6024
6462
|
] })
|
|
6025
6463
|
] }),
|
|
6026
|
-
/* @__PURE__ */
|
|
6027
|
-
/* @__PURE__ */
|
|
6464
|
+
/* @__PURE__ */ jsxs41("div", { className: "relative flex items-center h-5", children: [
|
|
6465
|
+
/* @__PURE__ */ jsx48("div", { className: "absolute w-full h-1.5 rounded-full bg-muted", children: /* @__PURE__ */ jsx48("div", { className: "absolute h-full rounded-full bg-primary", style: { left: `${p0}%`, width: `${p1 - p0}%` } }) }),
|
|
6028
6466
|
[0, 1].map((idx) => {
|
|
6029
6467
|
const p = idx === 0 ? p0 : p1;
|
|
6030
|
-
return /* @__PURE__ */
|
|
6031
|
-
showTooltip && active === idx && !disabled && /* @__PURE__ */
|
|
6468
|
+
return /* @__PURE__ */ jsxs41(React37.Fragment, { children: [
|
|
6469
|
+
showTooltip && active === idx && !disabled && /* @__PURE__ */ jsx48(
|
|
6032
6470
|
"div",
|
|
6033
6471
|
{
|
|
6034
6472
|
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",
|
|
@@ -6036,7 +6474,7 @@ function RangeSlider({
|
|
|
6036
6474
|
children: val[idx]
|
|
6037
6475
|
}
|
|
6038
6476
|
),
|
|
6039
|
-
/* @__PURE__ */
|
|
6477
|
+
/* @__PURE__ */ jsx48(
|
|
6040
6478
|
"input",
|
|
6041
6479
|
{
|
|
6042
6480
|
type: "range",
|
|
@@ -6052,7 +6490,7 @@ function RangeSlider({
|
|
|
6052
6490
|
style: { zIndex: idx === 1 ? 2 : 1 }
|
|
6053
6491
|
}
|
|
6054
6492
|
),
|
|
6055
|
-
/* @__PURE__ */
|
|
6493
|
+
/* @__PURE__ */ jsx48(
|
|
6056
6494
|
"div",
|
|
6057
6495
|
{
|
|
6058
6496
|
className: "absolute h-4 w-4 rounded-full border-2 border-primary bg-background shadow-md pointer-events-none",
|
|
@@ -6067,7 +6505,7 @@ function RangeSlider({
|
|
|
6067
6505
|
|
|
6068
6506
|
// src/components/ui/stat-card.tsx
|
|
6069
6507
|
import { TrendingUp, TrendingDown, Minus } from "lucide-react";
|
|
6070
|
-
import { jsx as
|
|
6508
|
+
import { jsx as jsx49, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
6071
6509
|
function Sparkline2({ data, trend }) {
|
|
6072
6510
|
if (data.length < 2) return null;
|
|
6073
6511
|
const min = Math.min(...data);
|
|
@@ -6081,7 +6519,7 @@ function Sparkline2({ data, trend }) {
|
|
|
6081
6519
|
return `${x},${y}`;
|
|
6082
6520
|
}).join(" ");
|
|
6083
6521
|
const color = trend === "up" ? "stroke-success" : trend === "down" ? "stroke-danger" : "stroke-primary";
|
|
6084
|
-
return /* @__PURE__ */
|
|
6522
|
+
return /* @__PURE__ */ jsx49("svg", { width: w, height: h, className: "overflow-visible", children: /* @__PURE__ */ jsx49(
|
|
6085
6523
|
"polyline",
|
|
6086
6524
|
{
|
|
6087
6525
|
points: pts,
|
|
@@ -6109,38 +6547,38 @@ function StatCard({
|
|
|
6109
6547
|
const TrendIcon = autoTrend === "up" ? TrendingUp : autoTrend === "down" ? TrendingDown : Minus;
|
|
6110
6548
|
const trendColor = autoTrend === "up" ? "text-success" : autoTrend === "down" ? "text-danger" : "text-muted-foreground";
|
|
6111
6549
|
if (loading) {
|
|
6112
|
-
return /* @__PURE__ */
|
|
6113
|
-
/* @__PURE__ */
|
|
6114
|
-
/* @__PURE__ */
|
|
6115
|
-
/* @__PURE__ */
|
|
6550
|
+
return /* @__PURE__ */ jsxs42("div", { className: cn("rounded-xl glass p-5 space-y-3 animate-pulse", className), children: [
|
|
6551
|
+
/* @__PURE__ */ jsx49("div", { className: "h-3 w-24 rounded bg-muted" }),
|
|
6552
|
+
/* @__PURE__ */ jsx49("div", { className: "h-7 w-32 rounded bg-muted" }),
|
|
6553
|
+
/* @__PURE__ */ jsx49("div", { className: "h-3 w-16 rounded bg-muted" })
|
|
6116
6554
|
] });
|
|
6117
6555
|
}
|
|
6118
|
-
return /* @__PURE__ */
|
|
6119
|
-
/* @__PURE__ */
|
|
6120
|
-
/* @__PURE__ */
|
|
6121
|
-
icon && /* @__PURE__ */
|
|
6556
|
+
return /* @__PURE__ */ jsxs42("div", { className: cn("rounded-xl glass p-5 space-y-3", className), children: [
|
|
6557
|
+
/* @__PURE__ */ jsxs42("div", { className: "flex items-start justify-between gap-2", children: [
|
|
6558
|
+
/* @__PURE__ */ jsx49("p", { className: "text-sm text-muted-foreground font-medium", children: title }),
|
|
6559
|
+
icon && /* @__PURE__ */ jsx49("span", { className: "flex h-9 w-9 items-center justify-center rounded-lg bg-primary/10 text-primary shrink-0", children: icon })
|
|
6122
6560
|
] }),
|
|
6123
|
-
/* @__PURE__ */
|
|
6124
|
-
/* @__PURE__ */
|
|
6125
|
-
sparkline && /* @__PURE__ */
|
|
6561
|
+
/* @__PURE__ */ jsxs42("div", { className: "flex items-end justify-between gap-2", children: [
|
|
6562
|
+
/* @__PURE__ */ jsx49("p", { className: "text-3xl font-bold tracking-tight", children: value }),
|
|
6563
|
+
sparkline && /* @__PURE__ */ jsx49(Sparkline2, { data: sparkline, trend: autoTrend })
|
|
6126
6564
|
] }),
|
|
6127
|
-
/* @__PURE__ */
|
|
6128
|
-
change !== void 0 && /* @__PURE__ */
|
|
6129
|
-
/* @__PURE__ */
|
|
6565
|
+
/* @__PURE__ */ jsxs42("div", { className: "flex items-center gap-1.5", children: [
|
|
6566
|
+
change !== void 0 && /* @__PURE__ */ jsxs42("span", { className: cn("flex items-center gap-0.5 text-xs font-semibold", trendColor), children: [
|
|
6567
|
+
/* @__PURE__ */ jsx49(TrendIcon, { className: "h-3.5 w-3.5" }),
|
|
6130
6568
|
change > 0 ? "+" : "",
|
|
6131
6569
|
change,
|
|
6132
6570
|
"%"
|
|
6133
6571
|
] }),
|
|
6134
|
-
changeLabel && /* @__PURE__ */
|
|
6135
|
-
description && !changeLabel && /* @__PURE__ */
|
|
6572
|
+
changeLabel && /* @__PURE__ */ jsx49("span", { className: "text-xs text-muted-foreground", children: changeLabel }),
|
|
6573
|
+
description && !changeLabel && /* @__PURE__ */ jsx49("span", { className: "text-xs text-muted-foreground", children: description })
|
|
6136
6574
|
] })
|
|
6137
6575
|
] });
|
|
6138
6576
|
}
|
|
6139
6577
|
|
|
6140
6578
|
// src/components/ui/stepper.tsx
|
|
6141
|
-
import * as
|
|
6579
|
+
import * as React38 from "react";
|
|
6142
6580
|
import { Check as Check6, X as X10 } from "lucide-react";
|
|
6143
|
-
import { jsx as
|
|
6581
|
+
import { jsx as jsx50, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
6144
6582
|
function getStatus(idx, current) {
|
|
6145
6583
|
if (idx < current) return "complete";
|
|
6146
6584
|
if (idx === current) return "current";
|
|
@@ -6161,7 +6599,7 @@ function Stepper({
|
|
|
6161
6599
|
clickable = false,
|
|
6162
6600
|
className
|
|
6163
6601
|
}) {
|
|
6164
|
-
const [internal, setInternal] =
|
|
6602
|
+
const [internal, setInternal] = React38.useState(defaultCurrent);
|
|
6165
6603
|
const current = controlled ?? internal;
|
|
6166
6604
|
function go(idx) {
|
|
6167
6605
|
if (!clickable) return;
|
|
@@ -6169,20 +6607,20 @@ function Stepper({
|
|
|
6169
6607
|
onChange?.(idx);
|
|
6170
6608
|
}
|
|
6171
6609
|
const isHorizontal = orientation === "horizontal";
|
|
6172
|
-
return /* @__PURE__ */
|
|
6173
|
-
/* @__PURE__ */
|
|
6610
|
+
return /* @__PURE__ */ jsxs43("div", { className: cn("w-full", className), children: [
|
|
6611
|
+
/* @__PURE__ */ jsx50("div", { className: cn(
|
|
6174
6612
|
"flex",
|
|
6175
6613
|
isHorizontal ? "flex-row items-start" : "flex-col gap-0"
|
|
6176
6614
|
), children: steps.map((step, i) => {
|
|
6177
6615
|
const status = getStatus(i, current);
|
|
6178
6616
|
const isLast = i === steps.length - 1;
|
|
6179
|
-
return /* @__PURE__ */
|
|
6617
|
+
return /* @__PURE__ */ jsx50(React38.Fragment, { children: /* @__PURE__ */ jsxs43("div", { className: cn(
|
|
6180
6618
|
"flex",
|
|
6181
6619
|
isHorizontal ? "flex-col items-center flex-1" : "flex-row gap-4"
|
|
6182
6620
|
), children: [
|
|
6183
|
-
/* @__PURE__ */
|
|
6184
|
-
isHorizontal && i > 0 && /* @__PURE__ */
|
|
6185
|
-
/* @__PURE__ */
|
|
6621
|
+
/* @__PURE__ */ jsxs43("div", { className: cn("flex items-center", isHorizontal ? "w-full" : "flex-col"), children: [
|
|
6622
|
+
isHorizontal && i > 0 && /* @__PURE__ */ jsx50("div", { className: cn("flex-1 h-0.5 transition-colors", i <= current ? "bg-primary" : "bg-border") }),
|
|
6623
|
+
/* @__PURE__ */ jsx50(
|
|
6186
6624
|
"button",
|
|
6187
6625
|
{
|
|
6188
6626
|
type: "button",
|
|
@@ -6194,35 +6632,35 @@ function Stepper({
|
|
|
6194
6632
|
clickable && "cursor-pointer hover:scale-110",
|
|
6195
6633
|
!clickable && "cursor-default"
|
|
6196
6634
|
),
|
|
6197
|
-
children: status === "complete" ? /* @__PURE__ */
|
|
6635
|
+
children: status === "complete" ? /* @__PURE__ */ jsx50(Check6, { className: "h-4 w-4" }) : status === "error" ? /* @__PURE__ */ jsx50(X10, { className: "h-4 w-4" }) : step.icon ?? /* @__PURE__ */ jsx50("span", { children: i + 1 })
|
|
6198
6636
|
}
|
|
6199
6637
|
),
|
|
6200
|
-
isHorizontal && !isLast && /* @__PURE__ */
|
|
6201
|
-
!isHorizontal && !isLast && /* @__PURE__ */
|
|
6638
|
+
isHorizontal && !isLast && /* @__PURE__ */ jsx50("div", { className: cn("flex-1 h-0.5 transition-colors", i < current ? "bg-primary" : "bg-border") }),
|
|
6639
|
+
!isHorizontal && !isLast && /* @__PURE__ */ jsx50("div", { className: cn("w-0.5 flex-1 min-h-8 transition-colors mt-1", i < current ? "bg-primary" : "bg-border") })
|
|
6202
6640
|
] }),
|
|
6203
|
-
/* @__PURE__ */
|
|
6641
|
+
/* @__PURE__ */ jsxs43("div", { className: cn(
|
|
6204
6642
|
isHorizontal ? "mt-2 text-center px-1" : "pb-6 min-w-0"
|
|
6205
6643
|
), children: [
|
|
6206
|
-
/* @__PURE__ */
|
|
6644
|
+
/* @__PURE__ */ jsxs43("p", { className: cn(
|
|
6207
6645
|
"text-sm font-medium leading-tight",
|
|
6208
6646
|
status === "current" ? "text-primary" : status === "complete" ? "text-foreground" : "text-muted-foreground"
|
|
6209
6647
|
), children: [
|
|
6210
6648
|
step.label,
|
|
6211
|
-
step.optional && /* @__PURE__ */
|
|
6649
|
+
step.optional && /* @__PURE__ */ jsx50("span", { className: "ml-1 text-xs text-muted-foreground", children: "(optional)" })
|
|
6212
6650
|
] }),
|
|
6213
|
-
step.description && /* @__PURE__ */
|
|
6214
|
-
!isHorizontal && step.content && i === current && /* @__PURE__ */
|
|
6651
|
+
step.description && /* @__PURE__ */ jsx50("p", { className: "text-xs text-muted-foreground mt-0.5", children: step.description }),
|
|
6652
|
+
!isHorizontal && step.content && i === current && /* @__PURE__ */ jsx50("div", { className: "mt-3", children: step.content })
|
|
6215
6653
|
] })
|
|
6216
6654
|
] }) }, i);
|
|
6217
6655
|
}) }),
|
|
6218
|
-
isHorizontal && steps[current]?.content && /* @__PURE__ */
|
|
6656
|
+
isHorizontal && steps[current]?.content && /* @__PURE__ */ jsx50("div", { className: "mt-6", children: steps[current].content })
|
|
6219
6657
|
] });
|
|
6220
6658
|
}
|
|
6221
6659
|
|
|
6222
6660
|
// src/components/ui/table.tsx
|
|
6223
|
-
import * as
|
|
6661
|
+
import * as React39 from "react";
|
|
6224
6662
|
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";
|
|
6225
|
-
import { Fragment as Fragment10, jsx as
|
|
6663
|
+
import { Fragment as Fragment10, jsx as jsx51, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
6226
6664
|
var BADGE_COLORS = {
|
|
6227
6665
|
active: "bg-success/10 text-success border-success/20",
|
|
6228
6666
|
inactive: "bg-muted text-muted-foreground border-border",
|
|
@@ -6245,11 +6683,11 @@ function Table({
|
|
|
6245
6683
|
idKey = "id",
|
|
6246
6684
|
className
|
|
6247
6685
|
}) {
|
|
6248
|
-
const [search, setSearch] =
|
|
6249
|
-
const [currentPage, setCurrentPage] =
|
|
6250
|
-
const [selectedIds, setSelectedIds] =
|
|
6251
|
-
const [sortKey, setSortKey] =
|
|
6252
|
-
const [sortDir, setSortDir] =
|
|
6686
|
+
const [search, setSearch] = React39.useState("");
|
|
6687
|
+
const [currentPage, setCurrentPage] = React39.useState(1);
|
|
6688
|
+
const [selectedIds, setSelectedIds] = React39.useState([]);
|
|
6689
|
+
const [sortKey, setSortKey] = React39.useState(null);
|
|
6690
|
+
const [sortDir, setSortDir] = React39.useState(null);
|
|
6253
6691
|
const handleSort = (key) => {
|
|
6254
6692
|
if (sortKey !== key) {
|
|
6255
6693
|
setSortKey(key);
|
|
@@ -6263,7 +6701,7 @@ function Table({
|
|
|
6263
6701
|
setSortKey(null);
|
|
6264
6702
|
setSortDir(null);
|
|
6265
6703
|
};
|
|
6266
|
-
const filteredData =
|
|
6704
|
+
const filteredData = React39.useMemo(() => {
|
|
6267
6705
|
let d = search ? data.filter(
|
|
6268
6706
|
(item) => Object.values(item).some(
|
|
6269
6707
|
(val) => val && typeof val === "string" && val.toLowerCase().includes(search.toLowerCase())
|
|
@@ -6281,18 +6719,18 @@ function Table({
|
|
|
6281
6719
|
}, [data, search, sortKey, sortDir]);
|
|
6282
6720
|
const totalPages = Math.max(1, Math.ceil(filteredData.length / itemsPerPage));
|
|
6283
6721
|
const safePage = Math.min(currentPage, totalPages);
|
|
6284
|
-
const paginatedData =
|
|
6722
|
+
const paginatedData = React39.useMemo(() => {
|
|
6285
6723
|
if (!pagination) return filteredData;
|
|
6286
6724
|
const start = (safePage - 1) * itemsPerPage;
|
|
6287
6725
|
return filteredData.slice(start, start + itemsPerPage);
|
|
6288
6726
|
}, [filteredData, pagination, safePage, itemsPerPage]);
|
|
6289
|
-
|
|
6727
|
+
React39.useEffect(() => {
|
|
6290
6728
|
setCurrentPage(1);
|
|
6291
6729
|
}, [search]);
|
|
6292
6730
|
const handleSelectAll = (checked) => setSelectedIds(checked ? paginatedData.map((item) => String(item[idKey])) : []);
|
|
6293
6731
|
const handleSelect = (id, checked) => setSelectedIds((prev) => checked ? [...prev, id] : prev.filter((i) => i !== id));
|
|
6294
6732
|
const allSelected = paginatedData.length > 0 && selectedIds.length === paginatedData.length;
|
|
6295
|
-
const pagePills =
|
|
6733
|
+
const pagePills = React39.useMemo(() => {
|
|
6296
6734
|
if (totalPages <= 5) return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
6297
6735
|
if (safePage <= 3) return [1, 2, 3, 4, 5];
|
|
6298
6736
|
if (safePage >= totalPages - 2) return [totalPages - 4, totalPages - 3, totalPages - 2, totalPages - 1, totalPages];
|
|
@@ -6300,14 +6738,14 @@ function Table({
|
|
|
6300
6738
|
}, [totalPages, safePage]);
|
|
6301
6739
|
const SortIcon = ({ col }) => {
|
|
6302
6740
|
if (!col.sortable) return null;
|
|
6303
|
-
if (sortKey !== String(col.key)) return /* @__PURE__ */
|
|
6304
|
-
return sortDir === "asc" ? /* @__PURE__ */
|
|
6741
|
+
if (sortKey !== String(col.key)) return /* @__PURE__ */ jsx51(ChevronsUpDown2, { className: "ml-1.5 h-3.5 w-3.5 opacity-40" });
|
|
6742
|
+
return sortDir === "asc" ? /* @__PURE__ */ jsx51(ChevronUp2, { className: "ml-1.5 h-3.5 w-3.5 text-primary" }) : /* @__PURE__ */ jsx51(ChevronDown7, { className: "ml-1.5 h-3.5 w-3.5 text-primary" });
|
|
6305
6743
|
};
|
|
6306
|
-
return /* @__PURE__ */
|
|
6307
|
-
/* @__PURE__ */
|
|
6308
|
-
searchable && /* @__PURE__ */
|
|
6309
|
-
/* @__PURE__ */
|
|
6310
|
-
/* @__PURE__ */
|
|
6744
|
+
return /* @__PURE__ */ jsxs44("div", { className: cn("w-full space-y-3", className), children: [
|
|
6745
|
+
/* @__PURE__ */ jsxs44("div", { className: "flex items-center justify-between gap-3 flex-wrap", children: [
|
|
6746
|
+
searchable && /* @__PURE__ */ jsxs44("div", { className: "relative w-72", children: [
|
|
6747
|
+
/* @__PURE__ */ jsx51(Search5, { className: "absolute text-primary left-3 top-1/2 -translate-y-1/2 h-4 w-4 z-10" }),
|
|
6748
|
+
/* @__PURE__ */ jsx51(
|
|
6311
6749
|
"input",
|
|
6312
6750
|
{
|
|
6313
6751
|
placeholder: searchPlaceholder,
|
|
@@ -6316,17 +6754,17 @@ function Table({
|
|
|
6316
6754
|
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"
|
|
6317
6755
|
}
|
|
6318
6756
|
),
|
|
6319
|
-
search && /* @__PURE__ */
|
|
6757
|
+
search && /* @__PURE__ */ jsx51(
|
|
6320
6758
|
"button",
|
|
6321
6759
|
{
|
|
6322
6760
|
onClick: () => setSearch(""),
|
|
6323
6761
|
className: "absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",
|
|
6324
|
-
children: /* @__PURE__ */
|
|
6762
|
+
children: /* @__PURE__ */ jsx51(X11, { className: "h-3.5 w-3.5" })
|
|
6325
6763
|
}
|
|
6326
6764
|
)
|
|
6327
6765
|
] }),
|
|
6328
|
-
/* @__PURE__ */
|
|
6329
|
-
selectable && onBulkDelete && selectedIds.length > 0 && /* @__PURE__ */
|
|
6766
|
+
/* @__PURE__ */ jsxs44("div", { className: "flex items-center gap-2 ml-auto", children: [
|
|
6767
|
+
selectable && onBulkDelete && selectedIds.length > 0 && /* @__PURE__ */ jsxs44(
|
|
6330
6768
|
"button",
|
|
6331
6769
|
{
|
|
6332
6770
|
onClick: () => {
|
|
@@ -6335,14 +6773,14 @@ function Table({
|
|
|
6335
6773
|
},
|
|
6336
6774
|
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",
|
|
6337
6775
|
children: [
|
|
6338
|
-
/* @__PURE__ */
|
|
6776
|
+
/* @__PURE__ */ jsx51(Trash23, { className: "h-3.5 w-3.5" }),
|
|
6339
6777
|
"Delete ",
|
|
6340
6778
|
selectedIds.length,
|
|
6341
6779
|
" selected"
|
|
6342
6780
|
]
|
|
6343
6781
|
}
|
|
6344
6782
|
),
|
|
6345
|
-
/* @__PURE__ */
|
|
6783
|
+
/* @__PURE__ */ jsxs44("span", { className: "text-xs text-muted-foreground", children: [
|
|
6346
6784
|
filteredData.length,
|
|
6347
6785
|
" ",
|
|
6348
6786
|
filteredData.length === 1 ? "row" : "rows",
|
|
@@ -6350,16 +6788,16 @@ function Table({
|
|
|
6350
6788
|
] })
|
|
6351
6789
|
] })
|
|
6352
6790
|
] }),
|
|
6353
|
-
/* @__PURE__ */
|
|
6354
|
-
/* @__PURE__ */
|
|
6355
|
-
selectable && /* @__PURE__ */
|
|
6791
|
+
/* @__PURE__ */ jsx51("div", { className: "rounded-xl border border-border overflow-hidden bg-card/50 backdrop-blur-sm shadow-sm", children: /* @__PURE__ */ jsx51("div", { className: "w-full overflow-auto", children: /* @__PURE__ */ jsxs44("table", { className: "w-full caption-bottom text-sm", children: [
|
|
6792
|
+
/* @__PURE__ */ jsx51("thead", { children: /* @__PURE__ */ jsxs44("tr", { className: "border-b border-border bg-muted/40", children: [
|
|
6793
|
+
selectable && /* @__PURE__ */ jsx51("th", { className: "h-11 w-[46px] px-4 text-left align-middle", children: /* @__PURE__ */ jsx51(
|
|
6356
6794
|
Checkbox,
|
|
6357
6795
|
{
|
|
6358
6796
|
checked: allSelected,
|
|
6359
6797
|
onChange: (e) => handleSelectAll(e.target.checked)
|
|
6360
6798
|
}
|
|
6361
6799
|
) }),
|
|
6362
|
-
columns.map((col) => /* @__PURE__ */
|
|
6800
|
+
columns.map((col) => /* @__PURE__ */ jsx51(
|
|
6363
6801
|
"th",
|
|
6364
6802
|
{
|
|
6365
6803
|
onClick: () => col.sortable && handleSort(String(col.key)),
|
|
@@ -6367,29 +6805,29 @@ function Table({
|
|
|
6367
6805
|
"h-11 px-4 text-left align-middle text-xs font-semibold uppercase tracking-wider text-muted-foreground select-none whitespace-nowrap",
|
|
6368
6806
|
col.sortable && "cursor-pointer hover:text-foreground transition-colors"
|
|
6369
6807
|
),
|
|
6370
|
-
children: /* @__PURE__ */
|
|
6808
|
+
children: /* @__PURE__ */ jsxs44("span", { className: "inline-flex items-center", children: [
|
|
6371
6809
|
col.title,
|
|
6372
|
-
/* @__PURE__ */
|
|
6810
|
+
/* @__PURE__ */ jsx51(SortIcon, { col })
|
|
6373
6811
|
] })
|
|
6374
6812
|
},
|
|
6375
6813
|
String(col.key)
|
|
6376
6814
|
))
|
|
6377
6815
|
] }) }),
|
|
6378
|
-
/* @__PURE__ */
|
|
6816
|
+
/* @__PURE__ */ jsx51("tbody", { children: paginatedData.length === 0 ? /* @__PURE__ */ jsx51("tr", { children: /* @__PURE__ */ jsx51(
|
|
6379
6817
|
"td",
|
|
6380
6818
|
{
|
|
6381
6819
|
colSpan: columns.length + (selectable ? 1 : 0),
|
|
6382
6820
|
className: "h-32 text-center align-middle",
|
|
6383
|
-
children: /* @__PURE__ */
|
|
6384
|
-
/* @__PURE__ */
|
|
6385
|
-
/* @__PURE__ */
|
|
6386
|
-
search && /* @__PURE__ */
|
|
6821
|
+
children: /* @__PURE__ */ jsxs44("div", { className: "flex flex-col items-center gap-1 text-muted-foreground", children: [
|
|
6822
|
+
/* @__PURE__ */ jsx51(Search5, { className: "h-8 w-8 opacity-20" }),
|
|
6823
|
+
/* @__PURE__ */ jsx51("span", { className: "text-sm", children: "No results found" }),
|
|
6824
|
+
search && /* @__PURE__ */ jsx51("button", { onClick: () => setSearch(""), className: "text-xs text-primary hover:underline", children: "Clear search" })
|
|
6387
6825
|
] })
|
|
6388
6826
|
}
|
|
6389
6827
|
) }) : paginatedData.map((item, i) => {
|
|
6390
6828
|
const id = String(item[idKey] || i);
|
|
6391
6829
|
const isSelected = selectedIds.includes(id);
|
|
6392
|
-
return /* @__PURE__ */
|
|
6830
|
+
return /* @__PURE__ */ jsxs44(
|
|
6393
6831
|
"tr",
|
|
6394
6832
|
{
|
|
6395
6833
|
className: cn(
|
|
@@ -6397,38 +6835,38 @@ function Table({
|
|
|
6397
6835
|
isSelected ? "bg-primary/5 hover:bg-primary/8" : "hover:bg-muted/30"
|
|
6398
6836
|
),
|
|
6399
6837
|
children: [
|
|
6400
|
-
selectable && /* @__PURE__ */
|
|
6838
|
+
selectable && /* @__PURE__ */ jsx51("td", { className: "px-4 py-3 align-middle", children: /* @__PURE__ */ jsx51(
|
|
6401
6839
|
Checkbox,
|
|
6402
6840
|
{
|
|
6403
6841
|
checked: isSelected,
|
|
6404
6842
|
onChange: (e) => handleSelect(id, e.target.checked)
|
|
6405
6843
|
}
|
|
6406
6844
|
) }),
|
|
6407
|
-
columns.map((col) => /* @__PURE__ */
|
|
6845
|
+
columns.map((col) => /* @__PURE__ */ jsx51("td", { className: "px-4 py-3 align-middle", children: col.render ? col.render(item) : col.type === "image" ? /* @__PURE__ */ jsx51(
|
|
6408
6846
|
"img",
|
|
6409
6847
|
{
|
|
6410
6848
|
src: item[col.key],
|
|
6411
6849
|
alt: item[col.key],
|
|
6412
6850
|
className: "h-9 w-9 rounded-lg object-cover ring-1 ring-border"
|
|
6413
6851
|
}
|
|
6414
|
-
) : col.type === "badge" ? /* @__PURE__ */
|
|
6852
|
+
) : col.type === "badge" ? /* @__PURE__ */ jsxs44("span", { className: cn(
|
|
6415
6853
|
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-medium",
|
|
6416
6854
|
badgeClass(String(item[col.key]))
|
|
6417
6855
|
), children: [
|
|
6418
|
-
/* @__PURE__ */
|
|
6856
|
+
/* @__PURE__ */ jsx51("span", { className: cn(
|
|
6419
6857
|
"mr-1.5 h-1.5 w-1.5 rounded-full",
|
|
6420
6858
|
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"
|
|
6421
6859
|
) }),
|
|
6422
6860
|
item[col.key]
|
|
6423
|
-
] }) : col.type === "stack" ? /* @__PURE__ */
|
|
6861
|
+
] }) : col.type === "stack" ? /* @__PURE__ */ jsx51(AvatarStack, { images: Array.isArray(item[col.key]) ? item[col.key] : [], ...col.stackProps ?? {} }) : col.type === "icon" ? /* @__PURE__ */ jsx51("span", { className: "flex items-center", children: item[col.key] }) : col.type === "select" ? /* @__PURE__ */ jsx51(
|
|
6424
6862
|
"select",
|
|
6425
6863
|
{
|
|
6426
6864
|
value: item[col.key],
|
|
6427
6865
|
onChange: (e) => col.onChange?.(item, e.target.value),
|
|
6428
6866
|
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",
|
|
6429
|
-
children: (col.selectOptions ?? []).map((opt) => /* @__PURE__ */
|
|
6867
|
+
children: (col.selectOptions ?? []).map((opt) => /* @__PURE__ */ jsx51("option", { value: opt, children: opt }, opt))
|
|
6430
6868
|
}
|
|
6431
|
-
) : col.type === "toggle" ? /* @__PURE__ */
|
|
6869
|
+
) : col.type === "toggle" ? /* @__PURE__ */ jsx51(
|
|
6432
6870
|
"button",
|
|
6433
6871
|
{
|
|
6434
6872
|
role: "switch",
|
|
@@ -6438,13 +6876,13 @@ function Table({
|
|
|
6438
6876
|
"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",
|
|
6439
6877
|
item[col.key] ? "bg-primary" : "bg-muted"
|
|
6440
6878
|
),
|
|
6441
|
-
children: /* @__PURE__ */
|
|
6879
|
+
children: /* @__PURE__ */ jsx51("span", { className: cn(
|
|
6442
6880
|
"pointer-events-none inline-block h-4 w-4 rounded-full bg-white shadow-sm transition-transform",
|
|
6443
6881
|
item[col.key] ? "translate-x-4" : "translate-x-0"
|
|
6444
6882
|
) })
|
|
6445
6883
|
}
|
|
6446
|
-
) : col.type === "color" ? /* @__PURE__ */
|
|
6447
|
-
/* @__PURE__ */
|
|
6884
|
+
) : col.type === "color" ? /* @__PURE__ */ jsxs44("div", { className: "flex items-center gap-2", children: [
|
|
6885
|
+
/* @__PURE__ */ jsx51(
|
|
6448
6886
|
"input",
|
|
6449
6887
|
{
|
|
6450
6888
|
type: "color",
|
|
@@ -6453,22 +6891,22 @@ function Table({
|
|
|
6453
6891
|
className: "h-7 w-7 cursor-pointer rounded border border-border bg-transparent p-0.5"
|
|
6454
6892
|
}
|
|
6455
6893
|
),
|
|
6456
|
-
/* @__PURE__ */
|
|
6457
|
-
] }) : col.type === "checkbox" ? /* @__PURE__ */
|
|
6894
|
+
/* @__PURE__ */ jsx51("span", { className: "text-xs text-muted-foreground font-mono", children: item[col.key] })
|
|
6895
|
+
] }) : col.type === "checkbox" ? /* @__PURE__ */ jsx51(
|
|
6458
6896
|
Checkbox,
|
|
6459
6897
|
{
|
|
6460
6898
|
checked: !!item[col.key],
|
|
6461
6899
|
onChange: (e) => col.onChange?.(item, e.target.checked)
|
|
6462
6900
|
}
|
|
6463
|
-
) : /* @__PURE__ */
|
|
6901
|
+
) : /* @__PURE__ */ jsx51("span", { className: "text-foreground/90", children: item[col.key] }) }, String(col.key)))
|
|
6464
6902
|
]
|
|
6465
6903
|
},
|
|
6466
6904
|
id
|
|
6467
6905
|
);
|
|
6468
6906
|
}) })
|
|
6469
6907
|
] }) }) }),
|
|
6470
|
-
pagination && totalPages > 1 && /* @__PURE__ */
|
|
6471
|
-
/* @__PURE__ */
|
|
6908
|
+
pagination && totalPages > 1 && /* @__PURE__ */ jsxs44("div", { className: "flex items-center justify-between gap-2 flex-wrap", children: [
|
|
6909
|
+
/* @__PURE__ */ jsxs44("span", { className: "text-xs text-muted-foreground", children: [
|
|
6472
6910
|
"Showing ",
|
|
6473
6911
|
(safePage - 1) * itemsPerPage + 1,
|
|
6474
6912
|
"\u2013",
|
|
@@ -6476,21 +6914,21 @@ function Table({
|
|
|
6476
6914
|
" of ",
|
|
6477
6915
|
filteredData.length
|
|
6478
6916
|
] }),
|
|
6479
|
-
/* @__PURE__ */
|
|
6480
|
-
/* @__PURE__ */
|
|
6917
|
+
/* @__PURE__ */ jsxs44("div", { className: "flex items-center gap-1", children: [
|
|
6918
|
+
/* @__PURE__ */ jsx51(
|
|
6481
6919
|
"button",
|
|
6482
6920
|
{
|
|
6483
6921
|
onClick: () => setCurrentPage((p) => Math.max(1, p - 1)),
|
|
6484
6922
|
disabled: safePage === 1,
|
|
6485
6923
|
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",
|
|
6486
|
-
children: /* @__PURE__ */
|
|
6924
|
+
children: /* @__PURE__ */ jsx51(ChevronLeft5, { className: "h-4 w-4" })
|
|
6487
6925
|
}
|
|
6488
6926
|
),
|
|
6489
|
-
pagePills[0] > 1 && /* @__PURE__ */
|
|
6490
|
-
/* @__PURE__ */
|
|
6491
|
-
pagePills[0] > 2 && /* @__PURE__ */
|
|
6927
|
+
pagePills[0] > 1 && /* @__PURE__ */ jsxs44(Fragment10, { children: [
|
|
6928
|
+
/* @__PURE__ */ jsx51("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" }),
|
|
6929
|
+
pagePills[0] > 2 && /* @__PURE__ */ jsx51("span", { className: "px-1 text-muted-foreground text-xs", children: "\u2026" })
|
|
6492
6930
|
] }),
|
|
6493
|
-
pagePills.map((p) => /* @__PURE__ */
|
|
6931
|
+
pagePills.map((p) => /* @__PURE__ */ jsx51(
|
|
6494
6932
|
"button",
|
|
6495
6933
|
{
|
|
6496
6934
|
onClick: () => setCurrentPage(p),
|
|
@@ -6502,17 +6940,17 @@ function Table({
|
|
|
6502
6940
|
},
|
|
6503
6941
|
p
|
|
6504
6942
|
)),
|
|
6505
|
-
pagePills[pagePills.length - 1] < totalPages && /* @__PURE__ */
|
|
6506
|
-
pagePills[pagePills.length - 1] < totalPages - 1 && /* @__PURE__ */
|
|
6507
|
-
/* @__PURE__ */
|
|
6943
|
+
pagePills[pagePills.length - 1] < totalPages && /* @__PURE__ */ jsxs44(Fragment10, { children: [
|
|
6944
|
+
pagePills[pagePills.length - 1] < totalPages - 1 && /* @__PURE__ */ jsx51("span", { className: "px-1 text-muted-foreground text-xs", children: "\u2026" }),
|
|
6945
|
+
/* @__PURE__ */ jsx51("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 })
|
|
6508
6946
|
] }),
|
|
6509
|
-
/* @__PURE__ */
|
|
6947
|
+
/* @__PURE__ */ jsx51(
|
|
6510
6948
|
"button",
|
|
6511
6949
|
{
|
|
6512
6950
|
onClick: () => setCurrentPage((p) => Math.min(totalPages, p + 1)),
|
|
6513
6951
|
disabled: safePage === totalPages,
|
|
6514
6952
|
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",
|
|
6515
|
-
children: /* @__PURE__ */
|
|
6953
|
+
children: /* @__PURE__ */ jsx51(ChevronRight8, { className: "h-4 w-4" })
|
|
6516
6954
|
}
|
|
6517
6955
|
)
|
|
6518
6956
|
] })
|
|
@@ -6520,91 +6958,9 @@ function Table({
|
|
|
6520
6958
|
] });
|
|
6521
6959
|
}
|
|
6522
6960
|
|
|
6523
|
-
// src/components/ui/tabs.tsx
|
|
6524
|
-
import * as React39 from "react";
|
|
6525
|
-
import { jsx as jsx49, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
6526
|
-
var sizeMap = {
|
|
6527
|
-
sm: "px-3 py-1.5 text-xs",
|
|
6528
|
-
md: "px-4 py-2 text-sm",
|
|
6529
|
-
lg: "px-5 py-2.5 text-base"
|
|
6530
|
-
};
|
|
6531
|
-
var variantTrack = {
|
|
6532
|
-
line: "border-b border-border gap-0",
|
|
6533
|
-
pill: "bg-muted/50 rounded-xl p-1 gap-1",
|
|
6534
|
-
boxed: "border border-border rounded-xl p-1 gap-1",
|
|
6535
|
-
lifted: "gap-0"
|
|
6536
|
-
};
|
|
6537
|
-
function tabClass(variant, size, active, disabled) {
|
|
6538
|
-
const base = cn(
|
|
6539
|
-
"inline-flex items-center gap-2 font-medium transition-all duration-150 select-none whitespace-nowrap",
|
|
6540
|
-
sizeMap[size],
|
|
6541
|
-
disabled && "opacity-40 cursor-not-allowed pointer-events-none"
|
|
6542
|
-
);
|
|
6543
|
-
if (variant === "line") return cn(
|
|
6544
|
-
base,
|
|
6545
|
-
"rounded-none border-b-2 -mb-px",
|
|
6546
|
-
active ? "border-primary text-primary" : "border-transparent text-muted-foreground hover:text-foreground hover:border-border"
|
|
6547
|
-
);
|
|
6548
|
-
if (variant === "pill") return cn(
|
|
6549
|
-
base,
|
|
6550
|
-
"rounded-lg",
|
|
6551
|
-
active ? "bg-primary text-primary-foreground shadow-sm" : "text-muted-foreground hover:text-foreground hover:bg-background/60"
|
|
6552
|
-
);
|
|
6553
|
-
if (variant === "boxed") return cn(
|
|
6554
|
-
base,
|
|
6555
|
-
"rounded-lg",
|
|
6556
|
-
active ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"
|
|
6557
|
-
);
|
|
6558
|
-
if (variant === "lifted") return cn(
|
|
6559
|
-
base,
|
|
6560
|
-
"rounded-t-lg border border-b-0",
|
|
6561
|
-
active ? "border-border bg-background text-foreground -mb-px" : "border-transparent text-muted-foreground hover:text-foreground"
|
|
6562
|
-
);
|
|
6563
|
-
return base;
|
|
6564
|
-
}
|
|
6565
|
-
function Tabs({
|
|
6566
|
-
items,
|
|
6567
|
-
value: controlledValue,
|
|
6568
|
-
defaultValue,
|
|
6569
|
-
onChange,
|
|
6570
|
-
variant = "line",
|
|
6571
|
-
size = "md",
|
|
6572
|
-
fullWidth = false,
|
|
6573
|
-
className
|
|
6574
|
-
}) {
|
|
6575
|
-
const [internal, setInternal] = React39.useState(defaultValue ?? items[0]?.value ?? "");
|
|
6576
|
-
const active = controlledValue ?? internal;
|
|
6577
|
-
const select = (v) => {
|
|
6578
|
-
if (!controlledValue) setInternal(v);
|
|
6579
|
-
onChange?.(v);
|
|
6580
|
-
};
|
|
6581
|
-
const activeItem = items.find((i) => i.value === active);
|
|
6582
|
-
return /* @__PURE__ */ jsxs42("div", { className: cn("w-full", className), children: [
|
|
6583
|
-
/* @__PURE__ */ jsx49("div", { className: cn("flex", fullWidth && "w-full", variantTrack[variant]), children: items.map((item) => /* @__PURE__ */ jsxs42(
|
|
6584
|
-
"button",
|
|
6585
|
-
{
|
|
6586
|
-
type: "button",
|
|
6587
|
-
disabled: item.disabled,
|
|
6588
|
-
onClick: () => select(item.value),
|
|
6589
|
-
className: cn(
|
|
6590
|
-
tabClass(variant, size, active === item.value, !!item.disabled),
|
|
6591
|
-
fullWidth && "flex-1 justify-center"
|
|
6592
|
-
),
|
|
6593
|
-
children: [
|
|
6594
|
-
item.icon && /* @__PURE__ */ jsx49("span", { className: "shrink-0", children: item.icon }),
|
|
6595
|
-
item.label,
|
|
6596
|
-
item.badge && /* @__PURE__ */ jsx49("span", { className: "shrink-0", children: item.badge })
|
|
6597
|
-
]
|
|
6598
|
-
},
|
|
6599
|
-
item.value
|
|
6600
|
-
)) }),
|
|
6601
|
-
activeItem?.content && /* @__PURE__ */ jsx49("div", { className: "mt-4", children: activeItem.content })
|
|
6602
|
-
] });
|
|
6603
|
-
}
|
|
6604
|
-
|
|
6605
6961
|
// src/components/ui/tag-input.tsx
|
|
6606
6962
|
import * as React40 from "react";
|
|
6607
|
-
import { jsx as
|
|
6963
|
+
import { jsx as jsx52, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
6608
6964
|
function TagInput({
|
|
6609
6965
|
value: controlled,
|
|
6610
6966
|
defaultValue = [],
|
|
@@ -6642,7 +6998,7 @@ function TagInput({
|
|
|
6642
6998
|
removeTag(tags.length - 1);
|
|
6643
6999
|
}
|
|
6644
7000
|
}
|
|
6645
|
-
return /* @__PURE__ */
|
|
7001
|
+
return /* @__PURE__ */ jsxs45(
|
|
6646
7002
|
"div",
|
|
6647
7003
|
{
|
|
6648
7004
|
className: cn(
|
|
@@ -6653,8 +7009,8 @@ function TagInput({
|
|
|
6653
7009
|
),
|
|
6654
7010
|
onClick: () => inputRef.current?.focus(),
|
|
6655
7011
|
children: [
|
|
6656
|
-
tags.map((tag, i) => /* @__PURE__ */
|
|
6657
|
-
/* @__PURE__ */
|
|
7012
|
+
tags.map((tag, i) => /* @__PURE__ */ jsx52(Badge, { variant: "default", size: "sm", removable: true, onRemove: () => removeTag(i), children: tag }, i)),
|
|
7013
|
+
/* @__PURE__ */ jsx52(
|
|
6658
7014
|
"input",
|
|
6659
7015
|
{
|
|
6660
7016
|
ref: inputRef,
|
|
@@ -6674,7 +7030,7 @@ function TagInput({
|
|
|
6674
7030
|
|
|
6675
7031
|
// src/components/ui/timeline.tsx
|
|
6676
7032
|
import { CheckCircle as CheckCircle3, XCircle as XCircle2, AlertTriangle as AlertTriangle3, Info as Info2, Circle } from "lucide-react";
|
|
6677
|
-
import { jsx as
|
|
7033
|
+
import { jsx as jsx53, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
6678
7034
|
var DOT_COLOR = {
|
|
6679
7035
|
default: "bg-primary border-primary/30",
|
|
6680
7036
|
success: "bg-success border-success/30",
|
|
@@ -6690,32 +7046,32 @@ var ICON_COLOR = {
|
|
|
6690
7046
|
info: "text-info"
|
|
6691
7047
|
};
|
|
6692
7048
|
var DEFAULT_ICON = {
|
|
6693
|
-
default: /* @__PURE__ */
|
|
6694
|
-
success: /* @__PURE__ */
|
|
6695
|
-
error: /* @__PURE__ */
|
|
6696
|
-
warning: /* @__PURE__ */
|
|
6697
|
-
info: /* @__PURE__ */
|
|
7049
|
+
default: /* @__PURE__ */ jsx53(Circle, { className: "h-3 w-3" }),
|
|
7050
|
+
success: /* @__PURE__ */ jsx53(CheckCircle3, { className: "h-3.5 w-3.5" }),
|
|
7051
|
+
error: /* @__PURE__ */ jsx53(XCircle2, { className: "h-3.5 w-3.5" }),
|
|
7052
|
+
warning: /* @__PURE__ */ jsx53(AlertTriangle3, { className: "h-3.5 w-3.5" }),
|
|
7053
|
+
info: /* @__PURE__ */ jsx53(Info2, { className: "h-3.5 w-3.5" })
|
|
6698
7054
|
};
|
|
6699
7055
|
function Timeline({ items, align = "left", className }) {
|
|
6700
|
-
return /* @__PURE__ */
|
|
7056
|
+
return /* @__PURE__ */ jsx53("div", { className: cn("relative", className), children: items.map((item, i) => {
|
|
6701
7057
|
const variant = item.variant ?? "default";
|
|
6702
7058
|
const isLast = i === items.length - 1;
|
|
6703
7059
|
const isRight = align === "alternate" && i % 2 === 1;
|
|
6704
|
-
return /* @__PURE__ */
|
|
6705
|
-
/* @__PURE__ */
|
|
6706
|
-
/* @__PURE__ */
|
|
7060
|
+
return /* @__PURE__ */ jsxs46("div", { className: cn("relative flex gap-4", align === "alternate" && "justify-center", isRight && "flex-row-reverse"), children: [
|
|
7061
|
+
/* @__PURE__ */ jsxs46("div", { className: "flex flex-col items-center", children: [
|
|
7062
|
+
/* @__PURE__ */ jsx53("div", { className: cn(
|
|
6707
7063
|
"flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 z-10",
|
|
6708
7064
|
item.icon ? "bg-background border-border" : DOT_COLOR[variant]
|
|
6709
|
-
), children: /* @__PURE__ */
|
|
6710
|
-
!isLast && /* @__PURE__ */
|
|
7065
|
+
), children: /* @__PURE__ */ jsx53("span", { className: cn("shrink-0", item.icon ? ICON_COLOR[variant] : "text-white"), children: item.icon ?? DEFAULT_ICON[variant] }) }),
|
|
7066
|
+
!isLast && /* @__PURE__ */ jsx53("div", { className: "w-0.5 flex-1 bg-border mt-1 mb-1 min-h-4" })
|
|
6711
7067
|
] }),
|
|
6712
|
-
/* @__PURE__ */
|
|
6713
|
-
/* @__PURE__ */
|
|
6714
|
-
/* @__PURE__ */
|
|
6715
|
-
item.time && /* @__PURE__ */
|
|
7068
|
+
/* @__PURE__ */ jsxs46("div", { className: cn("flex-1 pb-6 min-w-0", isRight && "text-right"), children: [
|
|
7069
|
+
/* @__PURE__ */ jsxs46("div", { className: cn("flex items-start justify-between gap-2", isRight && "flex-row-reverse"), children: [
|
|
7070
|
+
/* @__PURE__ */ jsx53("p", { className: "text-sm font-semibold leading-tight", children: item.title }),
|
|
7071
|
+
item.time && /* @__PURE__ */ jsx53("span", { className: "shrink-0 text-xs text-muted-foreground whitespace-nowrap", children: item.time })
|
|
6716
7072
|
] }),
|
|
6717
|
-
item.description && /* @__PURE__ */
|
|
6718
|
-
item.content && /* @__PURE__ */
|
|
7073
|
+
item.description && /* @__PURE__ */ jsx53("p", { className: "mt-0.5 text-xs text-muted-foreground leading-snug", children: item.description }),
|
|
7074
|
+
item.content && /* @__PURE__ */ jsx53("div", { className: "mt-2", children: item.content })
|
|
6719
7075
|
] })
|
|
6720
7076
|
] }, item.id ?? i);
|
|
6721
7077
|
}) });
|
|
@@ -6723,7 +7079,7 @@ function Timeline({ items, align = "left", className }) {
|
|
|
6723
7079
|
|
|
6724
7080
|
// src/components/ui/toggle-switch.tsx
|
|
6725
7081
|
import * as React41 from "react";
|
|
6726
|
-
import { jsx as
|
|
7082
|
+
import { jsx as jsx54, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
6727
7083
|
var ToggleSwitch = React41.forwardRef(
|
|
6728
7084
|
({
|
|
6729
7085
|
className,
|
|
@@ -6754,13 +7110,13 @@ var ToggleSwitch = React41.forwardRef(
|
|
|
6754
7110
|
if (!isControlled) setInternalChecked(e.target.checked);
|
|
6755
7111
|
onChange?.(e);
|
|
6756
7112
|
};
|
|
6757
|
-
const toggle = /* @__PURE__ */
|
|
7113
|
+
const toggle = /* @__PURE__ */ jsxs47(
|
|
6758
7114
|
"label",
|
|
6759
7115
|
{
|
|
6760
7116
|
htmlFor: toggleId,
|
|
6761
7117
|
className: cn("relative inline-flex items-center cursor-pointer", disabled && "opacity-50 cursor-not-allowed"),
|
|
6762
7118
|
children: [
|
|
6763
|
-
/* @__PURE__ */
|
|
7119
|
+
/* @__PURE__ */ jsx54(
|
|
6764
7120
|
"input",
|
|
6765
7121
|
{
|
|
6766
7122
|
type: "checkbox",
|
|
@@ -6773,7 +7129,7 @@ var ToggleSwitch = React41.forwardRef(
|
|
|
6773
7129
|
...props
|
|
6774
7130
|
}
|
|
6775
7131
|
),
|
|
6776
|
-
/* @__PURE__ */
|
|
7132
|
+
/* @__PURE__ */ jsx54(
|
|
6777
7133
|
"div",
|
|
6778
7134
|
{
|
|
6779
7135
|
className: cn(
|
|
@@ -6786,7 +7142,7 @@ var ToggleSwitch = React41.forwardRef(
|
|
|
6786
7142
|
height: trackH,
|
|
6787
7143
|
...stateColor ? { backgroundColor: stateColor } : {}
|
|
6788
7144
|
},
|
|
6789
|
-
children: /* @__PURE__ */
|
|
7145
|
+
children: /* @__PURE__ */ jsx54(
|
|
6790
7146
|
"span",
|
|
6791
7147
|
{
|
|
6792
7148
|
className: `absolute top-[1px] ${isOn ? "bg-slate-50/40" : "bg-primary"} rounded-full border border-slate-300/50 shadow transition-transform duration-200`,
|
|
@@ -6804,9 +7160,9 @@ var ToggleSwitch = React41.forwardRef(
|
|
|
6804
7160
|
}
|
|
6805
7161
|
);
|
|
6806
7162
|
if (inline && label) {
|
|
6807
|
-
return /* @__PURE__ */
|
|
7163
|
+
return /* @__PURE__ */ jsxs47("div", { className: "inline-flex items-center gap-2 select-none", children: [
|
|
6808
7164
|
toggle,
|
|
6809
|
-
/* @__PURE__ */
|
|
7165
|
+
/* @__PURE__ */ jsx54("label", { htmlFor: toggleId, className: cn("text-sm cursor-pointer", disabled && "opacity-50 cursor-not-allowed"), children: label })
|
|
6810
7166
|
] });
|
|
6811
7167
|
}
|
|
6812
7168
|
return toggle;
|
|
@@ -6817,14 +7173,14 @@ ToggleSwitch.displayName = "ToggleSwitch";
|
|
|
6817
7173
|
// src/components/ui/tree-view.tsx
|
|
6818
7174
|
import * as React42 from "react";
|
|
6819
7175
|
import { ChevronRight as ChevronRight9, Folder, FolderOpen, File } from "lucide-react";
|
|
6820
|
-
import { jsx as
|
|
7176
|
+
import { jsx as jsx55, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
6821
7177
|
function TreeNodeItem({ node, depth, selected, expanded, onToggleExpand, onSelect, multiple }) {
|
|
6822
7178
|
const hasChildren = !!node.children?.length;
|
|
6823
7179
|
const isExpanded = expanded.includes(node.id);
|
|
6824
7180
|
const isSelected = selected.includes(node.id);
|
|
6825
|
-
const defaultIcon = hasChildren ? isExpanded ? /* @__PURE__ */
|
|
6826
|
-
return /* @__PURE__ */
|
|
6827
|
-
/* @__PURE__ */
|
|
7181
|
+
const defaultIcon = hasChildren ? isExpanded ? /* @__PURE__ */ jsx55(FolderOpen, { className: "h-4 w-4 text-warning" }) : /* @__PURE__ */ jsx55(Folder, { className: "h-4 w-4 text-warning" }) : /* @__PURE__ */ jsx55(File, { className: "h-4 w-4 text-muted-foreground" });
|
|
7182
|
+
return /* @__PURE__ */ jsxs48("div", { children: [
|
|
7183
|
+
/* @__PURE__ */ jsxs48(
|
|
6828
7184
|
"div",
|
|
6829
7185
|
{
|
|
6830
7186
|
className: cn(
|
|
@@ -6838,13 +7194,13 @@ function TreeNodeItem({ node, depth, selected, expanded, onToggleExpand, onSelec
|
|
|
6838
7194
|
onSelect(node.id);
|
|
6839
7195
|
},
|
|
6840
7196
|
children: [
|
|
6841
|
-
hasChildren ? /* @__PURE__ */
|
|
6842
|
-
/* @__PURE__ */
|
|
6843
|
-
/* @__PURE__ */
|
|
7197
|
+
hasChildren ? /* @__PURE__ */ jsx55(ChevronRight9, { className: cn("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform", isExpanded && "rotate-90") }) : /* @__PURE__ */ jsx55("span", { className: "w-3.5 shrink-0" }),
|
|
7198
|
+
/* @__PURE__ */ jsx55("span", { className: "shrink-0", children: node.icon ?? defaultIcon }),
|
|
7199
|
+
/* @__PURE__ */ jsx55("span", { className: "truncate", children: node.label })
|
|
6844
7200
|
]
|
|
6845
7201
|
}
|
|
6846
7202
|
),
|
|
6847
|
-
hasChildren && isExpanded && /* @__PURE__ */
|
|
7203
|
+
hasChildren && isExpanded && /* @__PURE__ */ jsx55("div", { children: node.children.map((child) => /* @__PURE__ */ jsx55(
|
|
6848
7204
|
TreeNodeItem,
|
|
6849
7205
|
{
|
|
6850
7206
|
node: child,
|
|
@@ -6885,7 +7241,7 @@ function TreeView({
|
|
|
6885
7241
|
function toggleExpand(id) {
|
|
6886
7242
|
setExpanded((prev) => prev.includes(id) ? prev.filter((v) => v !== id) : [...prev, id]);
|
|
6887
7243
|
}
|
|
6888
|
-
return /* @__PURE__ */
|
|
7244
|
+
return /* @__PURE__ */ jsx55("div", { className: cn("w-full", className), children: nodes.map((node) => /* @__PURE__ */ jsx55(
|
|
6889
7245
|
TreeNodeItem,
|
|
6890
7246
|
{
|
|
6891
7247
|
node,
|
|
@@ -6902,7 +7258,7 @@ function TreeView({
|
|
|
6902
7258
|
|
|
6903
7259
|
// src/components/ui/widget.tsx
|
|
6904
7260
|
import * as React43 from "react";
|
|
6905
|
-
import { jsx as
|
|
7261
|
+
import { jsx as jsx56, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
6906
7262
|
var iconColorMap = {
|
|
6907
7263
|
primary: "bg-primary/10 text-primary",
|
|
6908
7264
|
info: "bg-info/10 text-info",
|
|
@@ -6974,7 +7330,7 @@ function Widget({
|
|
|
6974
7330
|
const counted = useCountUp(isNumeric ? value : 0, animate && isNumeric);
|
|
6975
7331
|
const displayValue = animate && isNumeric ? counted : value;
|
|
6976
7332
|
const s = sizeMap2[size];
|
|
6977
|
-
return /* @__PURE__ */
|
|
7333
|
+
return /* @__PURE__ */ jsx56(
|
|
6978
7334
|
Card,
|
|
6979
7335
|
{
|
|
6980
7336
|
className: cn(
|
|
@@ -6985,27 +7341,27 @@ function Widget({
|
|
|
6985
7341
|
),
|
|
6986
7342
|
onClick,
|
|
6987
7343
|
...props,
|
|
6988
|
-
children: /* @__PURE__ */
|
|
6989
|
-
/* @__PURE__ */
|
|
6990
|
-
/* @__PURE__ */
|
|
6991
|
-
/* @__PURE__ */
|
|
6992
|
-
/* @__PURE__ */
|
|
6993
|
-
badge && /* @__PURE__ */
|
|
7344
|
+
children: /* @__PURE__ */ jsxs49(CardContent, { className: s.card, children: [
|
|
7345
|
+
/* @__PURE__ */ jsxs49("div", { className: "flex items-start justify-between gap-3", children: [
|
|
7346
|
+
/* @__PURE__ */ jsxs49("div", { className: "min-w-0 flex-1 space-y-1", children: [
|
|
7347
|
+
/* @__PURE__ */ jsxs49("div", { className: "flex items-center gap-2", children: [
|
|
7348
|
+
/* @__PURE__ */ jsx56("p", { className: "text-sm font-medium text-muted-foreground truncate", children: title }),
|
|
7349
|
+
badge && /* @__PURE__ */ jsx56("span", { className: "shrink-0", children: badge })
|
|
6994
7350
|
] }),
|
|
6995
|
-
loading ? /* @__PURE__ */
|
|
6996
|
-
description && /* @__PURE__ */
|
|
7351
|
+
loading ? /* @__PURE__ */ jsx56("div", { className: "h-8 w-24 animate-pulse rounded-md bg-muted" }) : /* @__PURE__ */ jsx56("div", { className: cn("font-bold tabular-nums", s.value), children: displayValue }),
|
|
7352
|
+
description && /* @__PURE__ */ jsx56("p", { className: "text-xs text-muted-foreground", children: description })
|
|
6997
7353
|
] }),
|
|
6998
|
-
icon && /* @__PURE__ */
|
|
7354
|
+
icon && /* @__PURE__ */ jsxs49("div", { className: cn(
|
|
6999
7355
|
"relative flex shrink-0 items-center justify-center rounded-full",
|
|
7000
7356
|
s.icon,
|
|
7001
7357
|
iconColorMap[iconColor]
|
|
7002
7358
|
), children: [
|
|
7003
|
-
pulse && /* @__PURE__ */
|
|
7004
|
-
/* @__PURE__ */
|
|
7359
|
+
pulse && /* @__PURE__ */ jsx56("span", { className: "absolute inset-0 rounded-full animate-ping opacity-30 bg-current" }),
|
|
7360
|
+
/* @__PURE__ */ jsx56("span", { className: s.iconSize, children: icon })
|
|
7005
7361
|
] })
|
|
7006
7362
|
] }),
|
|
7007
|
-
trendValue && !loading && /* @__PURE__ */
|
|
7008
|
-
/* @__PURE__ */
|
|
7363
|
+
trendValue && !loading && /* @__PURE__ */ jsxs49("div", { className: "mt-3 flex items-center gap-1.5 text-sm", children: [
|
|
7364
|
+
/* @__PURE__ */ jsxs49("span", { className: cn(
|
|
7009
7365
|
"font-medium",
|
|
7010
7366
|
trend === "up" && "text-success",
|
|
7011
7367
|
trend === "down" && "text-danger",
|
|
@@ -7015,21 +7371,21 @@ function Widget({
|
|
|
7015
7371
|
trend === "down" && "\u2193 ",
|
|
7016
7372
|
trendValue
|
|
7017
7373
|
] }),
|
|
7018
|
-
previousValue !== void 0 && /* @__PURE__ */
|
|
7374
|
+
previousValue !== void 0 && /* @__PURE__ */ jsxs49("span", { className: "text-muted-foreground", children: [
|
|
7019
7375
|
"vs ",
|
|
7020
7376
|
previousValue
|
|
7021
7377
|
] }),
|
|
7022
|
-
/* @__PURE__ */
|
|
7378
|
+
/* @__PURE__ */ jsx56("span", { className: "text-muted-foreground", children: trendLabel })
|
|
7023
7379
|
] }),
|
|
7024
|
-
progress !== void 0 && /* @__PURE__ */
|
|
7025
|
-
/* @__PURE__ */
|
|
7026
|
-
/* @__PURE__ */
|
|
7027
|
-
/* @__PURE__ */
|
|
7380
|
+
progress !== void 0 && /* @__PURE__ */ jsxs49("div", { className: "mt-4 space-y-1", children: [
|
|
7381
|
+
/* @__PURE__ */ jsxs49("div", { className: "flex justify-between text-xs text-muted-foreground", children: [
|
|
7382
|
+
/* @__PURE__ */ jsx56("span", { children: "Progress" }),
|
|
7383
|
+
/* @__PURE__ */ jsxs49("span", { children: [
|
|
7028
7384
|
Math.min(100, Math.max(0, progress)),
|
|
7029
7385
|
"%"
|
|
7030
7386
|
] })
|
|
7031
7387
|
] }),
|
|
7032
|
-
/* @__PURE__ */
|
|
7388
|
+
/* @__PURE__ */ jsx56("div", { className: "h-1.5 w-full rounded-full bg-muted overflow-hidden", children: /* @__PURE__ */ jsx56(
|
|
7033
7389
|
"div",
|
|
7034
7390
|
{
|
|
7035
7391
|
className: cn("h-full rounded-full transition-all duration-700", progressColorMap[progressColor]),
|
|
@@ -7037,10 +7393,461 @@ function Widget({
|
|
|
7037
7393
|
}
|
|
7038
7394
|
) })
|
|
7039
7395
|
] }),
|
|
7040
|
-
footer && /* @__PURE__ */
|
|
7396
|
+
footer && /* @__PURE__ */ jsx56("div", { className: "mt-4 border-t pt-3 text-sm text-muted-foreground", children: footer })
|
|
7397
|
+
] })
|
|
7398
|
+
}
|
|
7399
|
+
);
|
|
7400
|
+
}
|
|
7401
|
+
|
|
7402
|
+
// src/components/ui/wizard.tsx
|
|
7403
|
+
import * as React44 from "react";
|
|
7404
|
+
import { Check as Check7, X as X12, ChevronLeft as ChevronLeft6, ChevronRight as ChevronRight10, AlertCircle } from "lucide-react";
|
|
7405
|
+
import { Fragment as Fragment12, jsx as jsx57, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
7406
|
+
var SIZE_MAP = {
|
|
7407
|
+
sm: "max-w-sm",
|
|
7408
|
+
md: "max-w-lg",
|
|
7409
|
+
lg: "max-w-2xl",
|
|
7410
|
+
xl: "max-w-4xl",
|
|
7411
|
+
full: "max-w-full"
|
|
7412
|
+
};
|
|
7413
|
+
function stepStatus(idx, current) {
|
|
7414
|
+
if (idx < current) return "complete";
|
|
7415
|
+
if (idx === current) return "current";
|
|
7416
|
+
return "upcoming";
|
|
7417
|
+
}
|
|
7418
|
+
function HeaderDefault({
|
|
7419
|
+
steps,
|
|
7420
|
+
current,
|
|
7421
|
+
clickable,
|
|
7422
|
+
onGo
|
|
7423
|
+
}) {
|
|
7424
|
+
return /* @__PURE__ */ jsx57("div", { className: "flex items-start w-full", children: steps.map((step, i) => {
|
|
7425
|
+
const status = stepStatus(i, current);
|
|
7426
|
+
const isLast = i === steps.length - 1;
|
|
7427
|
+
return /* @__PURE__ */ jsx57(React44.Fragment, { children: /* @__PURE__ */ jsxs50("div", { className: "flex flex-col items-center flex-1 min-w-0", children: [
|
|
7428
|
+
/* @__PURE__ */ jsxs50("div", { className: "flex items-center w-full", children: [
|
|
7429
|
+
i > 0 && /* @__PURE__ */ jsx57("div", { className: cn("flex-1 h-0.5 transition-colors", i <= current ? "bg-primary" : "bg-border") }),
|
|
7430
|
+
/* @__PURE__ */ jsx57(
|
|
7431
|
+
"button",
|
|
7432
|
+
{
|
|
7433
|
+
type: "button",
|
|
7434
|
+
disabled: !clickable || status === "upcoming",
|
|
7435
|
+
onClick: () => clickable && status !== "upcoming" && onGo(i),
|
|
7436
|
+
className: cn(
|
|
7437
|
+
"flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 text-xs font-semibold transition-all",
|
|
7438
|
+
status === "complete" && "bg-primary border-primary text-primary-foreground",
|
|
7439
|
+
status === "current" && "bg-background border-primary text-primary ring-4 ring-primary/20",
|
|
7440
|
+
status === "upcoming" && "bg-background border-border text-muted-foreground",
|
|
7441
|
+
clickable && status !== "upcoming" && "cursor-pointer hover:scale-110"
|
|
7442
|
+
),
|
|
7443
|
+
children: status === "complete" ? /* @__PURE__ */ jsx57(Check7, { className: "h-3.5 w-3.5" }) : step.icon ?? /* @__PURE__ */ jsx57("span", { children: i + 1 })
|
|
7444
|
+
}
|
|
7445
|
+
),
|
|
7446
|
+
!isLast && /* @__PURE__ */ jsx57("div", { className: cn("flex-1 h-0.5 transition-colors", i < current ? "bg-primary" : "bg-border") })
|
|
7447
|
+
] }),
|
|
7448
|
+
/* @__PURE__ */ jsxs50("div", { className: "mt-2 text-center px-1 max-w-[80px]", children: [
|
|
7449
|
+
/* @__PURE__ */ jsx57("p", { className: cn(
|
|
7450
|
+
"text-xs font-medium leading-tight truncate",
|
|
7451
|
+
status === "current" ? "text-primary" : status === "complete" ? "text-foreground" : "text-muted-foreground"
|
|
7452
|
+
), children: step.title }),
|
|
7453
|
+
step.optional && /* @__PURE__ */ jsx57("span", { className: "text-[10px] text-muted-foreground", children: "(optional)" })
|
|
7454
|
+
] })
|
|
7455
|
+
] }) }, i);
|
|
7456
|
+
}) });
|
|
7457
|
+
}
|
|
7458
|
+
function HeaderDots({ steps, current, clickable, onGo }) {
|
|
7459
|
+
return /* @__PURE__ */ jsxs50("div", { className: "flex flex-col items-center gap-3 w-full", children: [
|
|
7460
|
+
/* @__PURE__ */ jsx57("div", { className: "flex items-center gap-2", children: steps.map((_, i) => /* @__PURE__ */ jsx57(
|
|
7461
|
+
"button",
|
|
7462
|
+
{
|
|
7463
|
+
type: "button",
|
|
7464
|
+
disabled: !clickable || i > current,
|
|
7465
|
+
onClick: () => clickable && i <= current && onGo(i),
|
|
7466
|
+
className: cn(
|
|
7467
|
+
"rounded-full transition-all duration-200",
|
|
7468
|
+
i === current ? "w-6 h-2.5 bg-primary" : i < current ? "w-2.5 h-2.5 bg-primary/60 hover:bg-primary cursor-pointer" : "w-2.5 h-2.5 bg-border"
|
|
7469
|
+
)
|
|
7470
|
+
},
|
|
7471
|
+
i
|
|
7472
|
+
)) }),
|
|
7473
|
+
/* @__PURE__ */ jsxs50("div", { className: "text-center", children: [
|
|
7474
|
+
/* @__PURE__ */ jsx57("p", { className: "text-sm font-semibold", children: steps[current]?.title }),
|
|
7475
|
+
steps[current]?.description && /* @__PURE__ */ jsx57("p", { className: "text-xs text-muted-foreground mt-0.5", children: steps[current].description })
|
|
7476
|
+
] })
|
|
7477
|
+
] });
|
|
7478
|
+
}
|
|
7479
|
+
function HeaderMinimal({ steps, current }) {
|
|
7480
|
+
return /* @__PURE__ */ jsxs50("div", { className: "flex items-center justify-between w-full", children: [
|
|
7481
|
+
/* @__PURE__ */ jsxs50("div", { children: [
|
|
7482
|
+
/* @__PURE__ */ jsx57("p", { className: "text-base font-semibold", children: steps[current]?.title }),
|
|
7483
|
+
steps[current]?.description && /* @__PURE__ */ jsx57("p", { className: "text-xs text-muted-foreground mt-0.5", children: steps[current].description })
|
|
7484
|
+
] }),
|
|
7485
|
+
/* @__PURE__ */ jsxs50("span", { className: "text-xs font-medium text-muted-foreground shrink-0 ml-4", children: [
|
|
7486
|
+
"Step ",
|
|
7487
|
+
current + 1,
|
|
7488
|
+
" of ",
|
|
7489
|
+
steps.length
|
|
7490
|
+
] })
|
|
7491
|
+
] });
|
|
7492
|
+
}
|
|
7493
|
+
function HeaderCards({ steps, current, clickable, onGo }) {
|
|
7494
|
+
return /* @__PURE__ */ jsx57("div", { className: "flex gap-2 flex-wrap", children: steps.map((step, i) => {
|
|
7495
|
+
const status = stepStatus(i, current);
|
|
7496
|
+
return /* @__PURE__ */ jsxs50(
|
|
7497
|
+
"button",
|
|
7498
|
+
{
|
|
7499
|
+
type: "button",
|
|
7500
|
+
disabled: !clickable || status === "upcoming",
|
|
7501
|
+
onClick: () => clickable && status !== "upcoming" && onGo(i),
|
|
7502
|
+
className: cn(
|
|
7503
|
+
"flex items-center gap-1.5 rounded-full px-3 py-1.5 text-xs font-medium border transition-all",
|
|
7504
|
+
status === "complete" && "bg-primary/10 border-primary/30 text-primary cursor-pointer",
|
|
7505
|
+
status === "current" && "bg-primary border-primary text-primary-foreground shadow-sm",
|
|
7506
|
+
status === "upcoming" && "bg-muted/40 border-border text-muted-foreground",
|
|
7507
|
+
clickable && status !== "upcoming" && "hover:scale-105"
|
|
7508
|
+
),
|
|
7509
|
+
children: [
|
|
7510
|
+
status === "complete" ? /* @__PURE__ */ jsx57(Check7, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx57("span", { children: i + 1 }),
|
|
7511
|
+
step.title,
|
|
7512
|
+
step.optional && /* @__PURE__ */ jsx57("span", { className: "opacity-60", children: "(opt)" })
|
|
7513
|
+
]
|
|
7514
|
+
},
|
|
7515
|
+
i
|
|
7516
|
+
);
|
|
7517
|
+
}) });
|
|
7518
|
+
}
|
|
7519
|
+
function SidebarNav({ steps, current, clickable, onGo }) {
|
|
7520
|
+
return /* @__PURE__ */ jsx57("nav", { className: "flex flex-col gap-0.5 w-48 shrink-0 border-r border-border pr-4 py-1", children: steps.map((step, i) => {
|
|
7521
|
+
const status = stepStatus(i, current);
|
|
7522
|
+
return /* @__PURE__ */ jsxs50(
|
|
7523
|
+
"button",
|
|
7524
|
+
{
|
|
7525
|
+
type: "button",
|
|
7526
|
+
disabled: !clickable || status === "upcoming",
|
|
7527
|
+
onClick: () => clickable && status !== "upcoming" && onGo(i),
|
|
7528
|
+
className: cn(
|
|
7529
|
+
"flex items-center gap-2.5 rounded-lg px-3 py-2.5 text-sm text-left transition-colors w-full",
|
|
7530
|
+
status === "current" && "bg-primary text-primary-foreground",
|
|
7531
|
+
status === "complete" && "text-foreground hover:bg-muted/60 cursor-pointer",
|
|
7532
|
+
status === "upcoming" && "text-muted-foreground"
|
|
7533
|
+
),
|
|
7534
|
+
children: [
|
|
7535
|
+
/* @__PURE__ */ jsx57("span", { className: cn(
|
|
7536
|
+
"flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-[10px] font-bold border",
|
|
7537
|
+
status === "complete" && "bg-primary/20 border-primary/40 text-primary",
|
|
7538
|
+
status === "current" && "bg-primary-foreground/20 border-primary-foreground/40 text-primary-foreground",
|
|
7539
|
+
status === "upcoming" && "bg-muted border-border text-muted-foreground"
|
|
7540
|
+
), children: status === "complete" ? /* @__PURE__ */ jsx57(Check7, { className: "h-3 w-3" }) : i + 1 }),
|
|
7541
|
+
/* @__PURE__ */ jsxs50("span", { className: "min-w-0", children: [
|
|
7542
|
+
/* @__PURE__ */ jsx57("span", { className: "block truncate font-medium", children: step.title }),
|
|
7543
|
+
step.optional && /* @__PURE__ */ jsx57("span", { className: "text-[10px] opacity-60", children: "Optional" })
|
|
7544
|
+
] })
|
|
7545
|
+
]
|
|
7546
|
+
},
|
|
7547
|
+
i
|
|
7548
|
+
);
|
|
7549
|
+
}) });
|
|
7550
|
+
}
|
|
7551
|
+
function ProgressBar({ current, total }) {
|
|
7552
|
+
const pct2 = Math.round(current / (total - 1) * 100);
|
|
7553
|
+
return /* @__PURE__ */ jsx57("div", { className: "w-full h-1 bg-border rounded-full overflow-hidden", children: /* @__PURE__ */ jsx57(
|
|
7554
|
+
"div",
|
|
7555
|
+
{
|
|
7556
|
+
className: "h-full bg-primary transition-all duration-300 rounded-full",
|
|
7557
|
+
style: { width: `${pct2}%` }
|
|
7558
|
+
}
|
|
7559
|
+
) });
|
|
7560
|
+
}
|
|
7561
|
+
function DefaultActions({
|
|
7562
|
+
step,
|
|
7563
|
+
total,
|
|
7564
|
+
onBack,
|
|
7565
|
+
onNext,
|
|
7566
|
+
onClose,
|
|
7567
|
+
isLast,
|
|
7568
|
+
isFirst,
|
|
7569
|
+
backLabel,
|
|
7570
|
+
nextLabel,
|
|
7571
|
+
finishLabel,
|
|
7572
|
+
cancelLabel,
|
|
7573
|
+
showCancel,
|
|
7574
|
+
showBackOnFirst,
|
|
7575
|
+
loading
|
|
7576
|
+
}) {
|
|
7577
|
+
const showBack = !isFirst || showBackOnFirst;
|
|
7578
|
+
return /* @__PURE__ */ jsxs50("div", { className: "flex items-center justify-between gap-2 w-full", children: [
|
|
7579
|
+
/* @__PURE__ */ jsx57("div", { className: "flex items-center gap-2", children: showCancel && onClose && /* @__PURE__ */ jsx57(
|
|
7580
|
+
"button",
|
|
7581
|
+
{
|
|
7582
|
+
type: "button",
|
|
7583
|
+
onClick: onClose,
|
|
7584
|
+
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",
|
|
7585
|
+
children: cancelLabel ?? "Cancel"
|
|
7586
|
+
}
|
|
7587
|
+
) }),
|
|
7588
|
+
/* @__PURE__ */ jsxs50("div", { className: "flex items-center gap-2", children: [
|
|
7589
|
+
showBack && /* @__PURE__ */ jsxs50(
|
|
7590
|
+
"button",
|
|
7591
|
+
{
|
|
7592
|
+
type: "button",
|
|
7593
|
+
onClick: onBack,
|
|
7594
|
+
disabled: isFirst,
|
|
7595
|
+
className: "inline-flex items-center gap-1.5 rounded-md border border-border bg-background px-4 py-2 text-sm font-medium text-foreground hover:bg-accent transition-colors disabled:opacity-40 disabled:pointer-events-none",
|
|
7596
|
+
children: [
|
|
7597
|
+
/* @__PURE__ */ jsx57(ChevronLeft6, { className: "h-4 w-4" }),
|
|
7598
|
+
backLabel ?? "Back"
|
|
7599
|
+
]
|
|
7600
|
+
}
|
|
7601
|
+
),
|
|
7602
|
+
/* @__PURE__ */ jsx57(
|
|
7603
|
+
"button",
|
|
7604
|
+
{
|
|
7605
|
+
type: "button",
|
|
7606
|
+
onClick: onNext,
|
|
7607
|
+
disabled: loading,
|
|
7608
|
+
className: "inline-flex items-center gap-1.5 rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary-hover transition-colors disabled:opacity-60 disabled:pointer-events-none",
|
|
7609
|
+
children: loading ? /* @__PURE__ */ jsxs50("span", { className: "flex items-center gap-1.5", children: [
|
|
7610
|
+
/* @__PURE__ */ jsxs50("svg", { className: "animate-spin h-3.5 w-3.5", viewBox: "0 0 24 24", fill: "none", children: [
|
|
7611
|
+
/* @__PURE__ */ jsx57("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
7612
|
+
/* @__PURE__ */ jsx57("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" })
|
|
7613
|
+
] }),
|
|
7614
|
+
"Processing..."
|
|
7615
|
+
] }) : isLast ? /* @__PURE__ */ jsxs50(Fragment12, { children: [
|
|
7616
|
+
/* @__PURE__ */ jsx57(Check7, { className: "h-4 w-4" }),
|
|
7617
|
+
finishLabel ?? "Finish"
|
|
7618
|
+
] }) : /* @__PURE__ */ jsxs50(Fragment12, { children: [
|
|
7619
|
+
nextLabel ?? "Next",
|
|
7620
|
+
/* @__PURE__ */ jsx57(ChevronRight10, { className: "h-4 w-4" })
|
|
7621
|
+
] })
|
|
7622
|
+
}
|
|
7623
|
+
)
|
|
7624
|
+
] })
|
|
7625
|
+
] });
|
|
7626
|
+
}
|
|
7627
|
+
function WizardPanel({
|
|
7628
|
+
steps,
|
|
7629
|
+
current,
|
|
7630
|
+
onGo,
|
|
7631
|
+
variant,
|
|
7632
|
+
size,
|
|
7633
|
+
title,
|
|
7634
|
+
description,
|
|
7635
|
+
hideHeader,
|
|
7636
|
+
footer,
|
|
7637
|
+
renderActions,
|
|
7638
|
+
backLabel,
|
|
7639
|
+
nextLabel,
|
|
7640
|
+
finishLabel,
|
|
7641
|
+
cancelLabel,
|
|
7642
|
+
showCancel,
|
|
7643
|
+
showBackOnFirst,
|
|
7644
|
+
loading,
|
|
7645
|
+
clickableSteps,
|
|
7646
|
+
onBack,
|
|
7647
|
+
onNext,
|
|
7648
|
+
onClose,
|
|
7649
|
+
className,
|
|
7650
|
+
contentClassName
|
|
7651
|
+
}) {
|
|
7652
|
+
const isFirst = current === 0;
|
|
7653
|
+
const isLast = current === steps.length - 1;
|
|
7654
|
+
const isSidebar = variant === "sidebar";
|
|
7655
|
+
const [validationError, setValidationError] = React44.useState(null);
|
|
7656
|
+
const handleNext = () => {
|
|
7657
|
+
const validate = steps[current]?.validate;
|
|
7658
|
+
if (validate) {
|
|
7659
|
+
const result = validate();
|
|
7660
|
+
if (result === false) {
|
|
7661
|
+
setValidationError("Please complete this step before continuing.");
|
|
7662
|
+
return;
|
|
7663
|
+
}
|
|
7664
|
+
if (typeof result === "string") {
|
|
7665
|
+
setValidationError(result);
|
|
7666
|
+
return;
|
|
7667
|
+
}
|
|
7668
|
+
}
|
|
7669
|
+
setValidationError(null);
|
|
7670
|
+
onNext();
|
|
7671
|
+
};
|
|
7672
|
+
const actionProps = {
|
|
7673
|
+
step: current,
|
|
7674
|
+
total: steps.length,
|
|
7675
|
+
onBack,
|
|
7676
|
+
onNext: handleNext,
|
|
7677
|
+
onClose,
|
|
7678
|
+
isFirst,
|
|
7679
|
+
isLast,
|
|
7680
|
+
loading
|
|
7681
|
+
};
|
|
7682
|
+
return /* @__PURE__ */ jsxs50("div", { className: cn(
|
|
7683
|
+
"flex flex-col w-full",
|
|
7684
|
+
size && !isSidebar && SIZE_MAP[size ?? "md"],
|
|
7685
|
+
className
|
|
7686
|
+
), children: [
|
|
7687
|
+
!hideHeader && /* @__PURE__ */ jsxs50("div", { className: cn(
|
|
7688
|
+
"shrink-0 px-6 pt-5 pb-4",
|
|
7689
|
+
variant !== "sidebar" && "border-b border-border"
|
|
7690
|
+
), children: [
|
|
7691
|
+
(title || description) && /* @__PURE__ */ jsxs50("div", { className: "mb-4", children: [
|
|
7692
|
+
title && /* @__PURE__ */ jsx57("h2", { className: "text-lg font-semibold", children: title }),
|
|
7693
|
+
description && /* @__PURE__ */ jsx57("p", { className: "text-sm text-muted-foreground mt-0.5", children: description })
|
|
7694
|
+
] }),
|
|
7695
|
+
variant === "default" && /* @__PURE__ */ jsx57(HeaderDefault, { steps, current, clickable: !!clickableSteps, onGo }),
|
|
7696
|
+
variant === "dots" && /* @__PURE__ */ jsx57(HeaderDots, { steps, current, clickable: !!clickableSteps, onGo }),
|
|
7697
|
+
variant === "minimal" && /* @__PURE__ */ jsx57(HeaderMinimal, { steps, current }),
|
|
7698
|
+
variant === "cards" && /* @__PURE__ */ jsx57(HeaderCards, { steps, current, clickable: !!clickableSteps, onGo }),
|
|
7699
|
+
(variant === "default" || variant === "minimal") && /* @__PURE__ */ jsx57("div", { className: "mt-3", children: /* @__PURE__ */ jsx57(ProgressBar, { current, total: steps.length }) })
|
|
7700
|
+
] }),
|
|
7701
|
+
/* @__PURE__ */ jsxs50("div", { className: cn("flex flex-1 min-h-0", isSidebar && "gap-6 px-6 py-5"), children: [
|
|
7702
|
+
isSidebar && /* @__PURE__ */ jsx57(SidebarNav, { steps, current, clickable: !!clickableSteps, onGo }),
|
|
7703
|
+
/* @__PURE__ */ jsxs50("div", { className: cn(
|
|
7704
|
+
"flex-1 min-w-0",
|
|
7705
|
+
!isSidebar && "px-6 py-5",
|
|
7706
|
+
contentClassName
|
|
7707
|
+
), children: [
|
|
7708
|
+
validationError && /* @__PURE__ */ jsxs50("div", { className: "flex items-center gap-2 rounded-lg border border-danger/30 bg-danger/10 px-3 py-2 text-sm text-danger mb-4", children: [
|
|
7709
|
+
/* @__PURE__ */ jsx57(AlertCircle, { className: "h-4 w-4 shrink-0" }),
|
|
7710
|
+
validationError
|
|
7711
|
+
] }),
|
|
7712
|
+
steps[current]?.content
|
|
7041
7713
|
] })
|
|
7714
|
+
] }),
|
|
7715
|
+
/* @__PURE__ */ jsx57("div", { className: "shrink-0 border-t border-border px-6 py-4", children: footer ?? (renderActions ? renderActions(actionProps) : /* @__PURE__ */ jsx57(
|
|
7716
|
+
DefaultActions,
|
|
7717
|
+
{
|
|
7718
|
+
...actionProps,
|
|
7719
|
+
backLabel,
|
|
7720
|
+
nextLabel,
|
|
7721
|
+
finishLabel,
|
|
7722
|
+
cancelLabel,
|
|
7723
|
+
showCancel,
|
|
7724
|
+
showBackOnFirst,
|
|
7725
|
+
loading
|
|
7726
|
+
}
|
|
7727
|
+
)) })
|
|
7728
|
+
] });
|
|
7729
|
+
}
|
|
7730
|
+
function Wizard({
|
|
7731
|
+
steps,
|
|
7732
|
+
step: controlledStep,
|
|
7733
|
+
defaultStep = 0,
|
|
7734
|
+
onStepChange,
|
|
7735
|
+
onFinish,
|
|
7736
|
+
onClose,
|
|
7737
|
+
layout = "inline",
|
|
7738
|
+
variant = "default",
|
|
7739
|
+
size = "md",
|
|
7740
|
+
isOpen = false,
|
|
7741
|
+
showClose = true,
|
|
7742
|
+
unchange = false,
|
|
7743
|
+
title,
|
|
7744
|
+
description,
|
|
7745
|
+
hideHeader = false,
|
|
7746
|
+
footer,
|
|
7747
|
+
renderActions,
|
|
7748
|
+
backLabel,
|
|
7749
|
+
nextLabel,
|
|
7750
|
+
finishLabel,
|
|
7751
|
+
cancelLabel,
|
|
7752
|
+
showCancel = false,
|
|
7753
|
+
showBackOnFirst = false,
|
|
7754
|
+
loading = false,
|
|
7755
|
+
clickableSteps = false,
|
|
7756
|
+
className,
|
|
7757
|
+
contentClassName
|
|
7758
|
+
}) {
|
|
7759
|
+
const [internalStep, setInternalStep] = React44.useState(defaultStep);
|
|
7760
|
+
const current = controlledStep ?? internalStep;
|
|
7761
|
+
const go = (idx) => {
|
|
7762
|
+
const clamped = Math.max(0, Math.min(steps.length - 1, idx));
|
|
7763
|
+
if (controlledStep === void 0) setInternalStep(clamped);
|
|
7764
|
+
onStepChange?.(clamped);
|
|
7765
|
+
};
|
|
7766
|
+
const handleBack = () => go(current - 1);
|
|
7767
|
+
const handleNext = () => {
|
|
7768
|
+
if (current === steps.length - 1) {
|
|
7769
|
+
onFinish?.();
|
|
7770
|
+
return;
|
|
7771
|
+
}
|
|
7772
|
+
go(current + 1);
|
|
7773
|
+
};
|
|
7774
|
+
React44.useEffect(() => {
|
|
7775
|
+
if (layout !== "modal" || !isOpen || unchange) return;
|
|
7776
|
+
const handler = (e) => {
|
|
7777
|
+
if (e.key === "Escape") onClose?.();
|
|
7778
|
+
};
|
|
7779
|
+
window.addEventListener("keydown", handler);
|
|
7780
|
+
return () => window.removeEventListener("keydown", handler);
|
|
7781
|
+
}, [layout, isOpen, unchange, onClose]);
|
|
7782
|
+
const panel = /* @__PURE__ */ jsx57(
|
|
7783
|
+
WizardPanel,
|
|
7784
|
+
{
|
|
7785
|
+
steps,
|
|
7786
|
+
current,
|
|
7787
|
+
onGo: go,
|
|
7788
|
+
onBack: handleBack,
|
|
7789
|
+
onNext: handleNext,
|
|
7790
|
+
onClose,
|
|
7791
|
+
variant,
|
|
7792
|
+
size,
|
|
7793
|
+
title,
|
|
7794
|
+
description,
|
|
7795
|
+
hideHeader,
|
|
7796
|
+
footer,
|
|
7797
|
+
renderActions,
|
|
7798
|
+
backLabel,
|
|
7799
|
+
nextLabel,
|
|
7800
|
+
finishLabel,
|
|
7801
|
+
cancelLabel,
|
|
7802
|
+
showCancel,
|
|
7803
|
+
showBackOnFirst,
|
|
7804
|
+
loading,
|
|
7805
|
+
clickableSteps,
|
|
7806
|
+
contentClassName
|
|
7042
7807
|
}
|
|
7043
7808
|
);
|
|
7809
|
+
if (layout === "modal") {
|
|
7810
|
+
if (!isOpen) return null;
|
|
7811
|
+
return /* @__PURE__ */ jsxs50("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
|
|
7812
|
+
/* @__PURE__ */ jsx57(
|
|
7813
|
+
"div",
|
|
7814
|
+
{
|
|
7815
|
+
className: "absolute inset-0 bg-background/80 backdrop-blur-sm",
|
|
7816
|
+
onClick: () => !unchange && onClose?.()
|
|
7817
|
+
}
|
|
7818
|
+
),
|
|
7819
|
+
/* @__PURE__ */ jsxs50("div", { className: cn(
|
|
7820
|
+
"relative z-10 w-full rounded-2xl border border-border bg-background/90 backdrop-blur-xl shadow-2xl overflow-hidden",
|
|
7821
|
+
SIZE_MAP[size],
|
|
7822
|
+
className
|
|
7823
|
+
), children: [
|
|
7824
|
+
showClose && onClose && /* @__PURE__ */ jsxs50(
|
|
7825
|
+
"button",
|
|
7826
|
+
{
|
|
7827
|
+
type: "button",
|
|
7828
|
+
onClick: onClose,
|
|
7829
|
+
className: "absolute right-4 top-4 z-10 rounded-sm opacity-60 hover:opacity-100 transition-opacity",
|
|
7830
|
+
children: [
|
|
7831
|
+
/* @__PURE__ */ jsx57(X12, { className: "h-4 w-4" }),
|
|
7832
|
+
/* @__PURE__ */ jsx57("span", { className: "sr-only", children: "Close" })
|
|
7833
|
+
]
|
|
7834
|
+
}
|
|
7835
|
+
),
|
|
7836
|
+
panel
|
|
7837
|
+
] })
|
|
7838
|
+
] });
|
|
7839
|
+
}
|
|
7840
|
+
if (layout === "page") {
|
|
7841
|
+
return /* @__PURE__ */ jsx57("div", { className: cn("w-full min-h-screen flex items-start justify-center p-6 bg-background", className), children: /* @__PURE__ */ jsx57("div", { className: cn(
|
|
7842
|
+
"w-full rounded-2xl border border-border bg-card shadow-lg overflow-hidden",
|
|
7843
|
+
SIZE_MAP[size]
|
|
7844
|
+
), children: panel }) });
|
|
7845
|
+
}
|
|
7846
|
+
return /* @__PURE__ */ jsx57("div", { className: cn(
|
|
7847
|
+
"w-full rounded-xl border border-border bg-card shadow-sm overflow-hidden",
|
|
7848
|
+
SIZE_MAP[size],
|
|
7849
|
+
className
|
|
7850
|
+
), children: panel });
|
|
7044
7851
|
}
|
|
7045
7852
|
export {
|
|
7046
7853
|
Accordion,
|
|
@@ -7068,14 +7875,20 @@ export {
|
|
|
7068
7875
|
DateRangePicker,
|
|
7069
7876
|
Drawer,
|
|
7070
7877
|
Dropdown,
|
|
7878
|
+
DropdownItem,
|
|
7879
|
+
DropdownLabel,
|
|
7880
|
+
DropdownSeparator,
|
|
7071
7881
|
FileUpload,
|
|
7882
|
+
FlexItem,
|
|
7072
7883
|
FlexLayout,
|
|
7884
|
+
GridItem,
|
|
7073
7885
|
GridLayout,
|
|
7074
7886
|
GroupNavigation,
|
|
7075
7887
|
Input,
|
|
7076
7888
|
KanbanBoard,
|
|
7077
7889
|
Label,
|
|
7078
7890
|
LeftSidebar,
|
|
7891
|
+
MetricRow,
|
|
7079
7892
|
Modal,
|
|
7080
7893
|
ModalConfirmation,
|
|
7081
7894
|
ModalUnchange,
|
|
@@ -7090,6 +7903,7 @@ export {
|
|
|
7090
7903
|
PanelSidebarItem,
|
|
7091
7904
|
Popover,
|
|
7092
7905
|
Progress,
|
|
7906
|
+
PropsTable,
|
|
7093
7907
|
RadioGroup,
|
|
7094
7908
|
RangeSlider,
|
|
7095
7909
|
Repeater,
|
|
@@ -7099,6 +7913,7 @@ export {
|
|
|
7099
7913
|
ScrollArea,
|
|
7100
7914
|
SectionBlock,
|
|
7101
7915
|
Select,
|
|
7916
|
+
Settings,
|
|
7102
7917
|
Skeleton,
|
|
7103
7918
|
Slider,
|
|
7104
7919
|
StatCard,
|
|
@@ -7116,5 +7931,6 @@ export {
|
|
|
7116
7931
|
Topbar,
|
|
7117
7932
|
TreeView,
|
|
7118
7933
|
Widget,
|
|
7934
|
+
Wizard,
|
|
7119
7935
|
useToast
|
|
7120
7936
|
};
|