@underverse-ui/underverse 0.2.56 → 0.2.57
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 +1180 -1351
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +1188 -1359
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -80,7 +80,7 @@ var Button = forwardRef(
|
|
|
80
80
|
gradient = false,
|
|
81
81
|
...rest
|
|
82
82
|
}, ref) => {
|
|
83
|
-
const baseStyles = asContainer ? "relative inline-flex justify-center rounded-
|
|
83
|
+
const baseStyles = asContainer ? "relative inline-flex justify-center rounded-xl font-medium transition-colors duration-150 ease-soft outline-none focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background active:translate-y-px" : "relative inline-flex items-center justify-center gap-2 rounded-xl font-medium overflow-hidden transition-colors duration-150 ease-soft outline-none focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background active:translate-y-px";
|
|
84
84
|
const finalVariant = gradient ? "gradient" : variant;
|
|
85
85
|
const variantStyle = VARIANT_STYLES_BTN[finalVariant] || VARIANT_STYLES_BTN.default;
|
|
86
86
|
const sizeStyle = SIZE_STYLES_BTN[size] || SIZE_STYLES_BTN.md;
|
|
@@ -267,7 +267,7 @@ var Badge = ({
|
|
|
267
267
|
}
|
|
268
268
|
);
|
|
269
269
|
}
|
|
270
|
-
return /* @__PURE__ */ jsxs2("span", { className: cn(baseClasses, "rounded-
|
|
270
|
+
return /* @__PURE__ */ jsxs2("span", { className: cn(baseClasses, "rounded-lg gap-1", sizeStyles[size], className), onClick: handleClick, role: "status", children: [
|
|
271
271
|
Icon && /* @__PURE__ */ jsx2(
|
|
272
272
|
Icon,
|
|
273
273
|
{
|
|
@@ -420,7 +420,7 @@ var Card = ({
|
|
|
420
420
|
"div",
|
|
421
421
|
{
|
|
422
422
|
className: cn(
|
|
423
|
-
"rounded-
|
|
423
|
+
"rounded-2xl md:rounded-3xl bg-card text-card-foreground transition-[transform,box-shadow,border-color,background-color] duration-300 ease-soft",
|
|
424
424
|
"shadow-sm md:hover:shadow-md mx-2 md:mx-0 border border-border",
|
|
425
425
|
hoverable && "md:hover:-translate-y-0.5 md:hover:border-primary/15",
|
|
426
426
|
clickable && "cursor-pointer active:translate-y-px md:hover:bg-accent/5",
|
|
@@ -431,7 +431,7 @@ var Card = ({
|
|
|
431
431
|
onMouseLeave: () => setIsHovered(false),
|
|
432
432
|
onClick,
|
|
433
433
|
...rest,
|
|
434
|
-
children: /* @__PURE__ */ jsxs3("div", { className: cn("relative overflow-hidden rounded-
|
|
434
|
+
children: /* @__PURE__ */ jsxs3("div", { className: cn("relative overflow-hidden rounded-2xl md:rounded-3xl", innerClassName), children: [
|
|
435
435
|
(hoverable || clickable) && /* @__PURE__ */ jsx3(
|
|
436
436
|
"div",
|
|
437
437
|
{
|
|
@@ -489,7 +489,7 @@ var Checkbox = React3.forwardRef(
|
|
|
489
489
|
"div",
|
|
490
490
|
{
|
|
491
491
|
className: cn(
|
|
492
|
-
"w-5 h-5 border rounded-
|
|
492
|
+
"w-5 h-5 border rounded-md flex items-center justify-center transition-all duration-200 ease-soft",
|
|
493
493
|
"hover:shadow-sm active:scale-95",
|
|
494
494
|
isChecked ? "bg-primary border-primary shadow-md text-primary-foreground" : "bg-background border-input hover:border-accent-foreground/30 hover:bg-accent/10"
|
|
495
495
|
),
|
|
@@ -987,7 +987,7 @@ var Input = forwardRef3(
|
|
|
987
987
|
setIsFocused(false);
|
|
988
988
|
onBlurProp?.(e);
|
|
989
989
|
};
|
|
990
|
-
const radiusClass = size === "sm" ? "rounded-
|
|
990
|
+
const radiusClass = size === "sm" ? "rounded-lg" : "rounded-xl";
|
|
991
991
|
return /* @__PURE__ */ jsxs5("div", { className: cn("w-full group", containerSpacing), children: [
|
|
992
992
|
label && /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between", children: [
|
|
993
993
|
/* @__PURE__ */ jsxs5(
|
|
@@ -1091,7 +1091,7 @@ var Input = forwardRef3(
|
|
|
1091
1091
|
rest.onChange?.({ target: { value: "" } });
|
|
1092
1092
|
},
|
|
1093
1093
|
className: cn(
|
|
1094
|
-
"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors rounded-
|
|
1094
|
+
"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors rounded-md",
|
|
1095
1095
|
"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",
|
|
1096
1096
|
"active:bg-accent active:text-accent-foreground",
|
|
1097
1097
|
sizeStyles8[size].button
|
|
@@ -1310,7 +1310,7 @@ var NumberInput = forwardRef3(
|
|
|
1310
1310
|
onClick: handleIncrement,
|
|
1311
1311
|
disabled: max !== void 0 && currentValue >= max,
|
|
1312
1312
|
className: cn(
|
|
1313
|
-
"flex items-center justify-center w-4 h-4 rounded-
|
|
1313
|
+
"flex items-center justify-center w-4 h-4 rounded-md transition-colors",
|
|
1314
1314
|
"hover:bg-accent focus:outline-none focus:bg-accent",
|
|
1315
1315
|
"disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",
|
|
1316
1316
|
"text-muted-foreground hover:text-foreground"
|
|
@@ -1326,7 +1326,7 @@ var NumberInput = forwardRef3(
|
|
|
1326
1326
|
onClick: handleDecrement,
|
|
1327
1327
|
disabled: min !== void 0 && currentValue <= min,
|
|
1328
1328
|
className: cn(
|
|
1329
|
-
"flex items-center justify-center w-4 h-4 rounded-
|
|
1329
|
+
"flex items-center justify-center w-4 h-4 rounded-md transition-colors",
|
|
1330
1330
|
"hover:bg-accent focus:outline-none focus:bg-accent",
|
|
1331
1331
|
"disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent",
|
|
1332
1332
|
"text-muted-foreground hover:text-foreground"
|
|
@@ -1398,7 +1398,7 @@ var Textarea = forwardRef3(
|
|
|
1398
1398
|
onFocus: () => setIsFocused(true),
|
|
1399
1399
|
onBlur: () => setIsFocused(false),
|
|
1400
1400
|
className: cn(
|
|
1401
|
-
"w-full rounded-
|
|
1401
|
+
"w-full rounded-xl px-4 py-3 text-sm text-foreground transition-all duration-200",
|
|
1402
1402
|
"placeholder:text-muted-foreground focus:outline-none min-h-20",
|
|
1403
1403
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
1404
1404
|
variantStyles6[variant],
|
|
@@ -1462,23 +1462,23 @@ var TagInput = forwardRef4(
|
|
|
1462
1462
|
const moreLabel = labels?.moreCount?.replace("{count}", String(hiddenCount)) ?? `+${hiddenCount} more`;
|
|
1463
1463
|
const sizeStyles8 = {
|
|
1464
1464
|
sm: {
|
|
1465
|
-
container: "min-h-8 p-1.5 gap-1",
|
|
1465
|
+
container: "min-h-8 p-1.5 gap-1 rounded-lg",
|
|
1466
1466
|
input: "text-xs",
|
|
1467
|
-
tag: "px-1.5 py-0.5 text-xs gap-1",
|
|
1467
|
+
tag: "px-1.5 py-0.5 text-xs gap-1 rounded-md",
|
|
1468
1468
|
tagIcon: "h-3 w-3",
|
|
1469
1469
|
button: "h-7 text-xs px-2"
|
|
1470
1470
|
},
|
|
1471
1471
|
md: {
|
|
1472
|
-
container: "min-h-10 p-2 gap-1.5",
|
|
1472
|
+
container: "min-h-10 p-2 gap-1.5 rounded-xl",
|
|
1473
1473
|
input: "text-sm",
|
|
1474
|
-
tag: "px-2 py-1 text-sm gap-1.5",
|
|
1474
|
+
tag: "px-2 py-1 text-sm gap-1.5 rounded-lg",
|
|
1475
1475
|
tagIcon: "h-3.5 w-3.5",
|
|
1476
1476
|
button: "h-8 text-sm px-3"
|
|
1477
1477
|
},
|
|
1478
1478
|
lg: {
|
|
1479
|
-
container: "min-h-12 p-2.5 gap-2",
|
|
1479
|
+
container: "min-h-12 p-2.5 gap-2 rounded-xl",
|
|
1480
1480
|
input: "text-base",
|
|
1481
|
-
tag: "px-2.5 py-1.5 text-base gap-2",
|
|
1481
|
+
tag: "px-2.5 py-1.5 text-base gap-2 rounded-lg",
|
|
1482
1482
|
tagIcon: "h-4 w-4",
|
|
1483
1483
|
button: "h-9 text-base px-4"
|
|
1484
1484
|
}
|
|
@@ -1568,7 +1568,7 @@ var TagInput = forwardRef4(
|
|
|
1568
1568
|
onClick: handleContainerClick,
|
|
1569
1569
|
className: cn(
|
|
1570
1570
|
"flex flex-wrap items-center cursor-text",
|
|
1571
|
-
"bg-background border border-input
|
|
1571
|
+
"bg-background border border-input",
|
|
1572
1572
|
"transition-all duration-200",
|
|
1573
1573
|
"hover:border-accent-foreground/20",
|
|
1574
1574
|
isFocused && "ring-1 ring-ring ring-offset-1 ring-offset-background border-transparent shadow-md",
|
|
@@ -1580,7 +1580,7 @@ var TagInput = forwardRef4(
|
|
|
1580
1580
|
"span",
|
|
1581
1581
|
{
|
|
1582
1582
|
className: cn(
|
|
1583
|
-
"inline-flex items-center
|
|
1583
|
+
"inline-flex items-center",
|
|
1584
1584
|
"bg-primary/10 text-primary font-mono",
|
|
1585
1585
|
"animate-in fade-in-0 zoom-in-95 duration-200",
|
|
1586
1586
|
sizeStyles8[size].tag
|
|
@@ -1597,7 +1597,7 @@ var TagInput = forwardRef4(
|
|
|
1597
1597
|
},
|
|
1598
1598
|
disabled,
|
|
1599
1599
|
className: cn(
|
|
1600
|
-
"flex items-center justify-center rounded-
|
|
1600
|
+
"flex items-center justify-center rounded-md",
|
|
1601
1601
|
"text-primary/70 hover:text-primary hover:bg-primary/20",
|
|
1602
1602
|
"transition-colors duration-150",
|
|
1603
1603
|
"focus:outline-none focus-visible:ring-1 focus-visible:ring-primary",
|
|
@@ -1620,7 +1620,7 @@ var TagInput = forwardRef4(
|
|
|
1620
1620
|
setIsExpanded(true);
|
|
1621
1621
|
},
|
|
1622
1622
|
className: cn(
|
|
1623
|
-
"inline-flex items-center
|
|
1623
|
+
"inline-flex items-center cursor-pointer",
|
|
1624
1624
|
"bg-muted text-muted-foreground hover:bg-muted/80",
|
|
1625
1625
|
"transition-colors duration-150",
|
|
1626
1626
|
"focus:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
@@ -1639,7 +1639,7 @@ var TagInput = forwardRef4(
|
|
|
1639
1639
|
setIsExpanded(false);
|
|
1640
1640
|
},
|
|
1641
1641
|
className: cn(
|
|
1642
|
-
"inline-flex items-center
|
|
1642
|
+
"inline-flex items-center cursor-pointer",
|
|
1643
1643
|
"bg-muted/50 text-muted-foreground hover:bg-muted/80",
|
|
1644
1644
|
"transition-colors duration-150",
|
|
1645
1645
|
"focus:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
@@ -1732,27 +1732,25 @@ var Textarea2 = forwardRef5(
|
|
|
1732
1732
|
"hover:border-accent-foreground/20",
|
|
1733
1733
|
"focus:border-primary focus:ring-2 focus:ring-primary/20"
|
|
1734
1734
|
),
|
|
1735
|
-
filled: cn(
|
|
1736
|
-
|
|
1737
|
-
"hover:bg-muted/80",
|
|
1738
|
-
"focus:bg-background focus:ring-2 focus:ring-primary/20"
|
|
1739
|
-
),
|
|
1740
|
-
outlined: cn(
|
|
1741
|
-
"border-2 border-border bg-transparent",
|
|
1742
|
-
"hover:border-primary/50",
|
|
1743
|
-
"focus:border-primary focus:ring-0"
|
|
1744
|
-
)
|
|
1735
|
+
filled: cn("border-0 bg-muted", "hover:bg-muted/80", "focus:bg-background focus:ring-2 focus:ring-primary/20"),
|
|
1736
|
+
outlined: cn("border-2 border-border bg-transparent", "hover:border-primary/50", "focus:border-primary focus:ring-0")
|
|
1745
1737
|
};
|
|
1746
1738
|
return /* @__PURE__ */ jsxs7("div", { className: "w-full space-y-2", children: [
|
|
1747
1739
|
label && /* @__PURE__ */ jsxs7("div", { className: "flex items-center", children: [
|
|
1748
|
-
/* @__PURE__ */ jsxs7(
|
|
1749
|
-
"
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1740
|
+
/* @__PURE__ */ jsxs7(
|
|
1741
|
+
"label",
|
|
1742
|
+
{
|
|
1743
|
+
className: cn(
|
|
1744
|
+
"text-sm font-medium transition-colors duration-200",
|
|
1745
|
+
isFocused ? "text-primary" : "text-foreground",
|
|
1746
|
+
error && "text-destructive"
|
|
1747
|
+
),
|
|
1748
|
+
children: [
|
|
1749
|
+
label,
|
|
1750
|
+
required && /* @__PURE__ */ jsx8("span", { className: "text-destructive ml-1", children: "*" })
|
|
1751
|
+
]
|
|
1752
|
+
}
|
|
1753
|
+
),
|
|
1756
1754
|
error && /* @__PURE__ */ jsx8("span", { className: "text-xs text-destructive ml-auto animate-in slide-in-from-right-2 duration-200", "aria-live": "polite", role: "alert", children: error })
|
|
1757
1755
|
] }),
|
|
1758
1756
|
/* @__PURE__ */ jsxs7("div", { className: "relative group", children: [
|
|
@@ -1765,7 +1763,7 @@ var Textarea2 = forwardRef5(
|
|
|
1765
1763
|
onFocus: () => setIsFocused(true),
|
|
1766
1764
|
onBlur: () => setIsFocused(false),
|
|
1767
1765
|
className: cn(
|
|
1768
|
-
"w-full rounded-
|
|
1766
|
+
"w-full rounded-xl transition-all duration-200 ease-soft resize-y",
|
|
1769
1767
|
"text-foreground placeholder:text-muted-foreground",
|
|
1770
1768
|
"focus:outline-none shadow-sm focus:shadow-md",
|
|
1771
1769
|
"backdrop-blur-sm",
|
|
@@ -1777,17 +1775,28 @@ var Textarea2 = forwardRef5(
|
|
|
1777
1775
|
...rest
|
|
1778
1776
|
}
|
|
1779
1777
|
),
|
|
1780
|
-
variant === "default" && /* @__PURE__ */ jsx8(
|
|
1781
|
-
"
|
|
1782
|
-
|
|
1783
|
-
|
|
1778
|
+
variant === "default" && /* @__PURE__ */ jsx8(
|
|
1779
|
+
"div",
|
|
1780
|
+
{
|
|
1781
|
+
className: cn(
|
|
1782
|
+
"absolute bottom-0 left-0 h-0.5 bg-linear-to-r from-primary to-primary/60 transition-all duration-300 ease-soft",
|
|
1783
|
+
isFocused ? "w-full opacity-100" : "w-0 opacity-0"
|
|
1784
|
+
)
|
|
1785
|
+
}
|
|
1786
|
+
),
|
|
1784
1787
|
isFocused && variant !== "outlined" && /* @__PURE__ */ jsx8("div", { className: "absolute inset-0 rounded-lg bg-primary/5 -z-10 animate-pulse" })
|
|
1785
1788
|
] }),
|
|
1786
|
-
description && /* @__PURE__ */ jsx8(
|
|
1787
|
-
"
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1789
|
+
description && /* @__PURE__ */ jsx8(
|
|
1790
|
+
"p",
|
|
1791
|
+
{
|
|
1792
|
+
className: cn(
|
|
1793
|
+
"text-xs transition-colors duration-200",
|
|
1794
|
+
isFocused ? "text-primary/70" : "text-muted-foreground",
|
|
1795
|
+
error && "text-destructive/70"
|
|
1796
|
+
),
|
|
1797
|
+
children: description
|
|
1798
|
+
}
|
|
1799
|
+
)
|
|
1791
1800
|
] });
|
|
1792
1801
|
}
|
|
1793
1802
|
);
|
|
@@ -1948,7 +1957,7 @@ function SmartImage({
|
|
|
1948
1957
|
alt,
|
|
1949
1958
|
className,
|
|
1950
1959
|
ratioClass,
|
|
1951
|
-
roundedClass = "rounded-
|
|
1960
|
+
roundedClass = "rounded-xl",
|
|
1952
1961
|
fill = true,
|
|
1953
1962
|
width,
|
|
1954
1963
|
height,
|
|
@@ -2136,14 +2145,7 @@ var Avatar_default = Avatar;
|
|
|
2136
2145
|
|
|
2137
2146
|
// ../../components/ui/Skeleton.tsx
|
|
2138
2147
|
import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2139
|
-
var Skeleton = ({
|
|
2140
|
-
className,
|
|
2141
|
-
width,
|
|
2142
|
-
height,
|
|
2143
|
-
variant = "rectangular",
|
|
2144
|
-
animation = "pulse",
|
|
2145
|
-
lines = 1
|
|
2146
|
-
}) => {
|
|
2148
|
+
var Skeleton = ({ className, width, height, variant = "rectangular", animation = "pulse", lines = 1 }) => {
|
|
2147
2149
|
const variantClasses2 = {
|
|
2148
2150
|
rectangular: "rounded-md",
|
|
2149
2151
|
circular: "rounded-full",
|
|
@@ -2174,79 +2176,32 @@ var Skeleton = ({
|
|
|
2174
2176
|
index
|
|
2175
2177
|
)) });
|
|
2176
2178
|
}
|
|
2177
|
-
return /* @__PURE__ */ jsx13(
|
|
2178
|
-
"div",
|
|
2179
|
-
{
|
|
2180
|
-
className: cn(
|
|
2181
|
-
"bg-muted",
|
|
2182
|
-
variantClasses2[variant],
|
|
2183
|
-
animationClasses[animation],
|
|
2184
|
-
className
|
|
2185
|
-
),
|
|
2186
|
-
style: { width, height }
|
|
2187
|
-
}
|
|
2188
|
-
);
|
|
2179
|
+
return /* @__PURE__ */ jsx13("div", { className: cn("bg-muted", variantClasses2[variant], animationClasses[animation], className), style: { width, height } });
|
|
2189
2180
|
};
|
|
2190
|
-
var SkeletonAvatar = ({
|
|
2191
|
-
size = "md",
|
|
2192
|
-
className
|
|
2193
|
-
}) => {
|
|
2181
|
+
var SkeletonAvatar = ({ size = "md", className }) => {
|
|
2194
2182
|
const sizeClasses2 = {
|
|
2195
2183
|
sm: "w-8 h-8",
|
|
2196
2184
|
md: "w-10 h-10",
|
|
2197
2185
|
lg: "w-12 h-12"
|
|
2198
2186
|
};
|
|
2199
|
-
return /* @__PURE__ */ jsx13(
|
|
2200
|
-
Skeleton,
|
|
2201
|
-
{
|
|
2202
|
-
variant: "circular",
|
|
2203
|
-
className: cn(sizeClasses2[size], className)
|
|
2204
|
-
}
|
|
2205
|
-
);
|
|
2187
|
+
return /* @__PURE__ */ jsx13(Skeleton, { variant: "circular", className: cn(sizeClasses2[size], className) });
|
|
2206
2188
|
};
|
|
2207
|
-
var SkeletonButton = ({
|
|
2208
|
-
size = "md",
|
|
2209
|
-
className
|
|
2210
|
-
}) => {
|
|
2189
|
+
var SkeletonButton = ({ size = "md", className }) => {
|
|
2211
2190
|
const sizeClasses2 = {
|
|
2212
2191
|
sm: "h-8 w-20",
|
|
2213
2192
|
md: "h-10 w-24",
|
|
2214
2193
|
lg: "h-12 w-28"
|
|
2215
2194
|
};
|
|
2216
|
-
return /* @__PURE__ */ jsx13(
|
|
2217
|
-
Skeleton,
|
|
2218
|
-
{
|
|
2219
|
-
variant: "rounded",
|
|
2220
|
-
className: cn(sizeClasses2[size], className)
|
|
2221
|
-
}
|
|
2222
|
-
);
|
|
2195
|
+
return /* @__PURE__ */ jsx13(Skeleton, { variant: "rounded", className: cn(sizeClasses2[size], className) });
|
|
2223
2196
|
};
|
|
2224
|
-
var SkeletonText = ({
|
|
2225
|
-
lines
|
|
2226
|
-
className,
|
|
2227
|
-
width = "100%"
|
|
2228
|
-
}) => {
|
|
2229
|
-
return /* @__PURE__ */ jsx13(
|
|
2230
|
-
Skeleton,
|
|
2231
|
-
{
|
|
2232
|
-
variant: "text",
|
|
2233
|
-
lines,
|
|
2234
|
-
width,
|
|
2235
|
-
className
|
|
2236
|
-
}
|
|
2237
|
-
);
|
|
2197
|
+
var SkeletonText = ({ lines = 3, className, width = "100%" }) => {
|
|
2198
|
+
return /* @__PURE__ */ jsx13(Skeleton, { variant: "text", lines, width, className });
|
|
2238
2199
|
};
|
|
2239
|
-
var SkeletonCard = ({
|
|
2240
|
-
showAvatar = true,
|
|
2241
|
-
showImage = false,
|
|
2242
|
-
textLines = 3,
|
|
2243
|
-
className,
|
|
2244
|
-
children
|
|
2245
|
-
}) => {
|
|
2200
|
+
var SkeletonCard = ({ showAvatar = true, showImage = false, textLines = 3, className, children }) => {
|
|
2246
2201
|
if (children) {
|
|
2247
2202
|
return /* @__PURE__ */ jsx13("div", { className: cn("p-4 space-y-4 rounded-lg bg-card outline-none focus:outline-none", className), children });
|
|
2248
2203
|
}
|
|
2249
|
-
return /* @__PURE__ */ jsxs10("div", { className: cn("p-4 space-y-4 rounded-
|
|
2204
|
+
return /* @__PURE__ */ jsxs10("div", { className: cn("p-4 space-y-4 rounded-2xl bg-card outline-none focus:outline-none", className), children: [
|
|
2250
2205
|
showAvatar && /* @__PURE__ */ jsxs10("div", { className: "flex items-center space-x-3", children: [
|
|
2251
2206
|
/* @__PURE__ */ jsx13(SkeletonAvatar, {}),
|
|
2252
2207
|
/* @__PURE__ */ jsxs10("div", { className: "space-y-2", children: [
|
|
@@ -2254,7 +2209,7 @@ var SkeletonCard = ({
|
|
|
2254
2209
|
/* @__PURE__ */ jsx13(Skeleton, { className: "h-3 w-16" })
|
|
2255
2210
|
] })
|
|
2256
2211
|
] }),
|
|
2257
|
-
showImage && /* @__PURE__ */ jsx13(Skeleton, { className: "h-48 w-full rounded-
|
|
2212
|
+
showImage && /* @__PURE__ */ jsx13(Skeleton, { className: "h-48 w-full rounded-xl" }),
|
|
2258
2213
|
/* @__PURE__ */ jsx13(SkeletonText, { lines: textLines }),
|
|
2259
2214
|
/* @__PURE__ */ jsxs10("div", { className: "flex space-x-2", children: [
|
|
2260
2215
|
/* @__PURE__ */ jsx13(SkeletonButton, { size: "sm" }),
|
|
@@ -2263,7 +2218,7 @@ var SkeletonCard = ({
|
|
|
2263
2218
|
] });
|
|
2264
2219
|
};
|
|
2265
2220
|
var SkeletonPost = ({ className }) => {
|
|
2266
|
-
return /* @__PURE__ */ jsxs10("div", { className: cn("p-6 space-y-4 rounded-
|
|
2221
|
+
return /* @__PURE__ */ jsxs10("div", { className: cn("p-6 space-y-4 rounded-3xl bg-card outline-none focus:outline-none", className), children: [
|
|
2267
2222
|
/* @__PURE__ */ jsxs10("div", { className: "flex items-center space-x-3", children: [
|
|
2268
2223
|
/* @__PURE__ */ jsx13(SkeletonAvatar, { size: "lg" }),
|
|
2269
2224
|
/* @__PURE__ */ jsxs10("div", { className: "space-y-2", children: [
|
|
@@ -2272,7 +2227,7 @@ var SkeletonPost = ({ className }) => {
|
|
|
2272
2227
|
] })
|
|
2273
2228
|
] }),
|
|
2274
2229
|
/* @__PURE__ */ jsx13(SkeletonText, { lines: 2 }),
|
|
2275
|
-
/* @__PURE__ */ jsx13(Skeleton, { className: "h-64 w-full rounded-
|
|
2230
|
+
/* @__PURE__ */ jsx13(Skeleton, { className: "h-64 w-full rounded-2xl" }),
|
|
2276
2231
|
/* @__PURE__ */ jsxs10("div", { className: "flex items-center space-x-4", children: [
|
|
2277
2232
|
/* @__PURE__ */ jsx13(Skeleton, { className: "h-3 w-16" }),
|
|
2278
2233
|
/* @__PURE__ */ jsx13(Skeleton, { className: "h-3 w-20" }),
|
|
@@ -2285,36 +2240,17 @@ var SkeletonPost = ({ className }) => {
|
|
|
2285
2240
|
] }) })
|
|
2286
2241
|
] });
|
|
2287
2242
|
};
|
|
2288
|
-
var SkeletonMessage = ({
|
|
2289
|
-
own
|
|
2290
|
-
showAvatar = true,
|
|
2291
|
-
className
|
|
2292
|
-
}) => {
|
|
2293
|
-
return /* @__PURE__ */ jsxs10("div", { className: cn(
|
|
2294
|
-
"flex items-end space-x-2",
|
|
2295
|
-
own && "flex-row-reverse space-x-reverse",
|
|
2296
|
-
className
|
|
2297
|
-
), children: [
|
|
2243
|
+
var SkeletonMessage = ({ own = false, showAvatar = true, className }) => {
|
|
2244
|
+
return /* @__PURE__ */ jsxs10("div", { className: cn("flex items-end space-x-2", own && "flex-row-reverse space-x-reverse", className), children: [
|
|
2298
2245
|
showAvatar && !own && /* @__PURE__ */ jsx13(SkeletonAvatar, { size: "sm" }),
|
|
2299
|
-
/* @__PURE__ */ jsxs10("div", { className: cn(
|
|
2300
|
-
"
|
|
2301
|
-
own ? "items-end" : "items-start"
|
|
2302
|
-
), children: [
|
|
2303
|
-
/* @__PURE__ */ jsx13(Skeleton, { className: cn(
|
|
2304
|
-
"h-10 rounded-2xl",
|
|
2305
|
-
own ? "w-32 bg-primary/20" : "w-40 bg-muted"
|
|
2306
|
-
) }),
|
|
2246
|
+
/* @__PURE__ */ jsxs10("div", { className: cn("max-w-xs space-y-1", own ? "items-end" : "items-start"), children: [
|
|
2247
|
+
/* @__PURE__ */ jsx13(Skeleton, { className: cn("h-10 rounded-3xl", own ? "w-32 bg-primary/20" : "w-40 bg-muted") }),
|
|
2307
2248
|
/* @__PURE__ */ jsx13(Skeleton, { className: "h-3 w-12" })
|
|
2308
2249
|
] })
|
|
2309
2250
|
] });
|
|
2310
2251
|
};
|
|
2311
|
-
var SkeletonList = ({
|
|
2312
|
-
items
|
|
2313
|
-
itemHeight = 60,
|
|
2314
|
-
showAvatar = true,
|
|
2315
|
-
className
|
|
2316
|
-
}) => {
|
|
2317
|
-
return /* @__PURE__ */ jsx13("div", { className: cn("space-y-3", className), children: Array.from({ length: items }).map((_, index) => /* @__PURE__ */ jsxs10("div", { className: "flex items-center space-x-3 p-3 rounded-lg", children: [
|
|
2252
|
+
var SkeletonList = ({ items = 5, itemHeight = 60, showAvatar = true, className }) => {
|
|
2253
|
+
return /* @__PURE__ */ jsx13("div", { className: cn("space-y-3", className), children: Array.from({ length: items }).map((_, index) => /* @__PURE__ */ jsxs10("div", { className: "flex items-center space-x-3 p-3 rounded-xl", children: [
|
|
2318
2254
|
showAvatar && /* @__PURE__ */ jsx13(SkeletonAvatar, {}),
|
|
2319
2255
|
/* @__PURE__ */ jsxs10("div", { className: "flex-1 space-y-2", children: [
|
|
2320
2256
|
/* @__PURE__ */ jsx13(Skeleton, { className: "h-4 w-3/4" }),
|
|
@@ -2323,11 +2259,7 @@ var SkeletonList = ({
|
|
|
2323
2259
|
/* @__PURE__ */ jsx13(Skeleton, { className: "h-6 w-16" })
|
|
2324
2260
|
] }, index)) });
|
|
2325
2261
|
};
|
|
2326
|
-
var SkeletonTable = ({
|
|
2327
|
-
rows = 5,
|
|
2328
|
-
columns = 4,
|
|
2329
|
-
className
|
|
2330
|
-
}) => {
|
|
2262
|
+
var SkeletonTable = ({ rows = 5, columns = 4, className }) => {
|
|
2331
2263
|
return /* @__PURE__ */ jsxs10("div", { className: cn("space-y-3", className), children: [
|
|
2332
2264
|
/* @__PURE__ */ jsx13("div", { className: "flex space-x-4 p-3", children: Array.from({ length: columns }).map((_, index) => /* @__PURE__ */ jsx13(Skeleton, { className: "h-4 flex-1" }, index)) }),
|
|
2333
2265
|
Array.from({ length: rows }).map((_, rowIndex) => /* @__PURE__ */ jsx13("div", { className: "flex space-x-4 p-3", children: Array.from({ length: columns }).map((_2, colIndex) => /* @__PURE__ */ jsx13(Skeleton, { className: "h-4 flex-1" }, colIndex)) }, rowIndex))
|
|
@@ -2385,10 +2317,7 @@ var Progress = ({
|
|
|
2385
2317
|
label && /* @__PURE__ */ jsx14("span", { id: labelId, className: "font-medium text-foreground", children: label }),
|
|
2386
2318
|
getStatusIcon()
|
|
2387
2319
|
] }),
|
|
2388
|
-
showValue && !indeterminate && /* @__PURE__ */ jsx14("span", { className: cn(
|
|
2389
|
-
"text-sm font-medium",
|
|
2390
|
-
isComplete ? "text-success" : isError ? "text-destructive" : "text-muted-foreground"
|
|
2391
|
-
), children: isComplete ? "Complete" : isError ? "Error" : `${Math.round(percentage)}%` })
|
|
2320
|
+
showValue && !indeterminate && /* @__PURE__ */ jsx14("span", { className: cn("text-sm font-medium", isComplete ? "text-success" : isError ? "text-destructive" : "text-muted-foreground"), children: isComplete ? "Complete" : isError ? "Error" : `${Math.round(percentage)}%` })
|
|
2392
2321
|
] }),
|
|
2393
2322
|
description && /* @__PURE__ */ jsx14("p", { id: descId, className: "text-sm text-muted-foreground", children: description })
|
|
2394
2323
|
] }),
|
|
@@ -2401,11 +2330,7 @@ var Progress = ({
|
|
|
2401
2330
|
"aria-valuenow": indeterminate ? void 0 : Math.round(percentage),
|
|
2402
2331
|
"aria-labelledby": label ? labelId : void 0,
|
|
2403
2332
|
"aria-describedby": description ? descId : void 0,
|
|
2404
|
-
className: cn(
|
|
2405
|
-
"w-full bg-muted/50 rounded-full overflow-hidden backdrop-blur-sm",
|
|
2406
|
-
"border border-border/50",
|
|
2407
|
-
sizeStyles2[size]
|
|
2408
|
-
),
|
|
2333
|
+
className: cn("w-full bg-muted/50 rounded-full overflow-hidden backdrop-blur-sm", "border border-border/50", sizeStyles2[size]),
|
|
2409
2334
|
children: /* @__PURE__ */ jsx14(
|
|
2410
2335
|
"div",
|
|
2411
2336
|
{
|
|
@@ -2478,24 +2403,10 @@ var CircularProgress = ({
|
|
|
2478
2403
|
{
|
|
2479
2404
|
width: size,
|
|
2480
2405
|
height: size,
|
|
2481
|
-
className: cn(
|
|
2482
|
-
"transform -rotate-90",
|
|
2483
|
-
indeterminate && "animate-spin"
|
|
2484
|
-
),
|
|
2406
|
+
className: cn("transform -rotate-90", indeterminate && "animate-spin"),
|
|
2485
2407
|
style: { animationDuration: indeterminate ? "2s" : void 0 },
|
|
2486
2408
|
children: [
|
|
2487
|
-
/* @__PURE__ */ jsx14(
|
|
2488
|
-
"circle",
|
|
2489
|
-
{
|
|
2490
|
-
cx: size / 2,
|
|
2491
|
-
cy: size / 2,
|
|
2492
|
-
r: radius,
|
|
2493
|
-
stroke: "currentColor",
|
|
2494
|
-
strokeWidth,
|
|
2495
|
-
fill: "transparent",
|
|
2496
|
-
className: trackColor
|
|
2497
|
-
}
|
|
2498
|
-
),
|
|
2409
|
+
/* @__PURE__ */ jsx14("circle", { cx: size / 2, cy: size / 2, r: radius, stroke: "currentColor", strokeWidth, fill: "transparent", className: trackColor }),
|
|
2499
2410
|
/* @__PURE__ */ jsx14(
|
|
2500
2411
|
"circle",
|
|
2501
2412
|
{
|
|
@@ -2522,23 +2433,14 @@ var CircularProgress = ({
|
|
|
2522
2433
|
),
|
|
2523
2434
|
/* @__PURE__ */ jsx14("div", { className: "absolute inset-0 flex flex-col items-center justify-center text-center", children: children ? children : /* @__PURE__ */ jsxs11(Fragment2, { children: [
|
|
2524
2435
|
getContentIcon(),
|
|
2525
|
-
showValue && !indeterminate && /* @__PURE__ */ jsx14("span", { className: cn(
|
|
2526
|
-
"text-sm font-semibold",
|
|
2527
|
-
isComplete ? "text-success" : isError ? "text-destructive" : "text-foreground"
|
|
2528
|
-
), children: isComplete ? "\u2713" : isError ? "\u2717" : `${Math.round(percentage)}%` }),
|
|
2436
|
+
showValue && !indeterminate && /* @__PURE__ */ jsx14("span", { className: cn("text-sm font-semibold", isComplete ? "text-success" : isError ? "text-destructive" : "text-foreground"), children: isComplete ? "\u2713" : isError ? "\u2717" : `${Math.round(percentage)}%` }),
|
|
2529
2437
|
indeterminate && /* @__PURE__ */ jsx14(Clock, { className: "w-4 h-4 text-muted-foreground animate-pulse" })
|
|
2530
2438
|
] }) })
|
|
2531
2439
|
]
|
|
2532
2440
|
}
|
|
2533
2441
|
);
|
|
2534
2442
|
};
|
|
2535
|
-
var StepProgress = ({
|
|
2536
|
-
steps,
|
|
2537
|
-
currentStep,
|
|
2538
|
-
className,
|
|
2539
|
-
variant = "primary",
|
|
2540
|
-
size = "md"
|
|
2541
|
-
}) => {
|
|
2443
|
+
var StepProgress = ({ steps, currentStep, className, variant = "primary", size = "md" }) => {
|
|
2542
2444
|
const stepSizes = {
|
|
2543
2445
|
sm: "w-6 h-6 text-xs",
|
|
2544
2446
|
md: "w-8 h-8 text-sm",
|
|
@@ -2559,19 +2461,9 @@ var StepProgress = ({
|
|
|
2559
2461
|
"rounded-full border-2 flex items-center justify-center font-medium transition-all duration-300",
|
|
2560
2462
|
"shadow-sm hover:shadow-md",
|
|
2561
2463
|
stepSizes[size],
|
|
2562
|
-
status === "completed" && [
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
],
|
|
2566
|
-
status === "current" && [
|
|
2567
|
-
"border-primary bg-primary/10 text-primary",
|
|
2568
|
-
"ring-2 ring-primary/20 ring-offset-2",
|
|
2569
|
-
"shadow-primary/20"
|
|
2570
|
-
],
|
|
2571
|
-
status === "upcoming" && [
|
|
2572
|
-
"border-muted-foreground/30 text-muted-foreground bg-background",
|
|
2573
|
-
"hover:border-muted-foreground/50"
|
|
2574
|
-
]
|
|
2464
|
+
status === "completed" && ["border-success bg-success text-success-foreground", "shadow-success/20"],
|
|
2465
|
+
status === "current" && ["border-primary bg-primary/10 text-primary", "ring-2 ring-primary/20 ring-offset-2", "shadow-primary/20"],
|
|
2466
|
+
status === "upcoming" && ["border-muted-foreground/30 text-muted-foreground bg-background", "hover:border-muted-foreground/50"]
|
|
2575
2467
|
),
|
|
2576
2468
|
children: status === "completed" ? /* @__PURE__ */ jsx14(Check2, { className: "w-3 h-3" }) : index + 1
|
|
2577
2469
|
}
|
|
@@ -2588,25 +2480,11 @@ var StepProgress = ({
|
|
|
2588
2480
|
children: step
|
|
2589
2481
|
}
|
|
2590
2482
|
),
|
|
2591
|
-
index < steps.length - 1 && /* @__PURE__ */ jsx14(
|
|
2592
|
-
"div",
|
|
2593
|
-
{
|
|
2594
|
-
className: cn(
|
|
2595
|
-
"flex-1 h-0.5 mx-4 transition-colors duration-200",
|
|
2596
|
-
index < currentStep ? variantStyles2[variant] : "bg-muted"
|
|
2597
|
-
)
|
|
2598
|
-
}
|
|
2599
|
-
)
|
|
2483
|
+
index < steps.length - 1 && /* @__PURE__ */ jsx14("div", { className: cn("flex-1 h-0.5 mx-4 transition-colors duration-200", index < currentStep ? variantStyles2[variant] : "bg-muted") })
|
|
2600
2484
|
] }, step);
|
|
2601
2485
|
}) }) });
|
|
2602
2486
|
};
|
|
2603
|
-
var MiniProgress = ({
|
|
2604
|
-
value,
|
|
2605
|
-
max = 100,
|
|
2606
|
-
className,
|
|
2607
|
-
variant = "primary",
|
|
2608
|
-
showValue = false
|
|
2609
|
-
}) => {
|
|
2487
|
+
var MiniProgress = ({ value, max = 100, className, variant = "primary", showValue = false }) => {
|
|
2610
2488
|
const percentage = Math.min(Math.max(value / max * 100, 0), 100);
|
|
2611
2489
|
return /* @__PURE__ */ jsxs11("div", { className: cn("flex items-center gap-2", className), children: [
|
|
2612
2490
|
/* @__PURE__ */ jsx14(
|
|
@@ -2617,16 +2495,7 @@ var MiniProgress = ({
|
|
|
2617
2495
|
"aria-valuemin": 0,
|
|
2618
2496
|
"aria-valuemax": max,
|
|
2619
2497
|
"aria-valuenow": Math.round(percentage),
|
|
2620
|
-
children: /* @__PURE__ */ jsx14(
|
|
2621
|
-
"div",
|
|
2622
|
-
{
|
|
2623
|
-
className: cn(
|
|
2624
|
-
"h-full transition-all duration-500 ease-out rounded-full",
|
|
2625
|
-
variantStyles2[variant]
|
|
2626
|
-
),
|
|
2627
|
-
style: { width: `${percentage}%` }
|
|
2628
|
-
}
|
|
2629
|
-
)
|
|
2498
|
+
children: /* @__PURE__ */ jsx14("div", { className: cn("h-full transition-all duration-500 ease-out rounded-full", variantStyles2[variant]), style: { width: `${percentage}%` } })
|
|
2630
2499
|
}
|
|
2631
2500
|
),
|
|
2632
2501
|
showValue && /* @__PURE__ */ jsxs11("span", { className: "text-xs font-medium text-muted-foreground min-w-10 text-right", children: [
|
|
@@ -2635,13 +2504,7 @@ var MiniProgress = ({
|
|
|
2635
2504
|
] })
|
|
2636
2505
|
] });
|
|
2637
2506
|
};
|
|
2638
|
-
var BatteryProgress = ({
|
|
2639
|
-
value,
|
|
2640
|
-
max = 100,
|
|
2641
|
-
className,
|
|
2642
|
-
charging = false,
|
|
2643
|
-
showValue = false
|
|
2644
|
-
}) => {
|
|
2507
|
+
var BatteryProgress = ({ value, max = 100, className, charging = false, showValue = false }) => {
|
|
2645
2508
|
const percentage = Math.min(Math.max(value / max * 100, 0), 100);
|
|
2646
2509
|
const getVariant = () => {
|
|
2647
2510
|
if (charging) return "info";
|
|
@@ -2650,65 +2513,53 @@ var BatteryProgress = ({
|
|
|
2650
2513
|
return "success";
|
|
2651
2514
|
};
|
|
2652
2515
|
return /* @__PURE__ */ jsxs11("div", { className: cn("flex items-center gap-2", className), children: [
|
|
2653
|
-
/* @__PURE__ */ jsxs11(
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2516
|
+
/* @__PURE__ */ jsxs11(
|
|
2517
|
+
"div",
|
|
2518
|
+
{
|
|
2519
|
+
className: "relative",
|
|
2520
|
+
role: "progressbar",
|
|
2521
|
+
"aria-label": "Battery level",
|
|
2522
|
+
"aria-valuemin": 0,
|
|
2523
|
+
"aria-valuemax": max,
|
|
2524
|
+
"aria-valuenow": Math.round(percentage),
|
|
2525
|
+
children: [
|
|
2526
|
+
/* @__PURE__ */ jsxs11("div", { className: "w-6 h-3 border-2 border-foreground/20 rounded-md relative", children: [
|
|
2527
|
+
/* @__PURE__ */ jsx14("div", { className: "absolute -right-1 top-0.5 w-0.5 h-1 bg-foreground/20 rounded-r-sm" }),
|
|
2528
|
+
/* @__PURE__ */ jsx14(
|
|
2529
|
+
"div",
|
|
2530
|
+
{
|
|
2531
|
+
className: cn("h-full transition-all duration-500 ease-out rounded-md", variantStyles2[getVariant()], charging && "animate-pulse"),
|
|
2532
|
+
style: { width: `${percentage}%` }
|
|
2533
|
+
}
|
|
2534
|
+
)
|
|
2535
|
+
] }),
|
|
2536
|
+
charging && /* @__PURE__ */ jsx14("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx14("div", { className: "w-2 h-2 text-info-foreground", children: "\u26A1" }) })
|
|
2537
|
+
]
|
|
2538
|
+
}
|
|
2539
|
+
),
|
|
2540
|
+
showValue && /* @__PURE__ */ jsxs11("span", { className: cn("text-xs font-medium", percentage <= 20 ? "text-destructive" : "text-muted-foreground"), children: [
|
|
2674
2541
|
Math.round(percentage),
|
|
2675
2542
|
"%"
|
|
2676
2543
|
] })
|
|
2677
2544
|
] });
|
|
2678
2545
|
};
|
|
2679
|
-
var SegmentedProgress = ({
|
|
2680
|
-
segments,
|
|
2681
|
-
activeSegments,
|
|
2682
|
-
className,
|
|
2683
|
-
variant = "primary",
|
|
2684
|
-
size = "md"
|
|
2685
|
-
}) => {
|
|
2546
|
+
var SegmentedProgress = ({ segments, activeSegments, className, variant = "primary", size = "md" }) => {
|
|
2686
2547
|
const segmentSizes = {
|
|
2687
2548
|
sm: "h-1",
|
|
2688
2549
|
md: "h-2",
|
|
2689
2550
|
lg: "h-3"
|
|
2690
2551
|
};
|
|
2691
|
-
return /* @__PURE__ */ jsx14(
|
|
2552
|
+
return /* @__PURE__ */ jsx14("div", { className: cn("flex gap-1", className), role: "progressbar", "aria-valuemin": 0, "aria-valuemax": segments, "aria-valuenow": activeSegments, children: Array.from({ length: segments }, (_, index) => /* @__PURE__ */ jsx14(
|
|
2692
2553
|
"div",
|
|
2693
2554
|
{
|
|
2694
|
-
className: cn(
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
className: cn(
|
|
2703
|
-
"flex-1 rounded-full transition-all duration-300",
|
|
2704
|
-
segmentSizes[size],
|
|
2705
|
-
index < activeSegments ? variantStyles2[variant] : "bg-muted/50"
|
|
2706
|
-
)
|
|
2707
|
-
},
|
|
2708
|
-
index
|
|
2709
|
-
))
|
|
2710
|
-
}
|
|
2711
|
-
);
|
|
2555
|
+
className: cn(
|
|
2556
|
+
"flex-1 rounded-full transition-all duration-300",
|
|
2557
|
+
segmentSizes[size],
|
|
2558
|
+
index < activeSegments ? variantStyles2[variant] : "bg-muted/50"
|
|
2559
|
+
)
|
|
2560
|
+
},
|
|
2561
|
+
index
|
|
2562
|
+
)) });
|
|
2712
2563
|
};
|
|
2713
2564
|
var LoadingProgress = ({
|
|
2714
2565
|
value,
|
|
@@ -2911,7 +2762,7 @@ var Modal = ({
|
|
|
2911
2762
|
{
|
|
2912
2763
|
ref: modalContentRef,
|
|
2913
2764
|
className: cn(
|
|
2914
|
-
"relative w-full rounded-
|
|
2765
|
+
"relative w-full rounded-2xl md:rounded-3xl bg-card text-card-foreground shadow-xl",
|
|
2915
2766
|
"transition-all duration-200 ease-out",
|
|
2916
2767
|
maxWidthClass,
|
|
2917
2768
|
fullWidth && "mx-0",
|
|
@@ -2938,7 +2789,7 @@ var Modal = ({
|
|
|
2938
2789
|
onClick: onClose,
|
|
2939
2790
|
"aria-label": "Close modal",
|
|
2940
2791
|
className: cn(
|
|
2941
|
-
"rounded-
|
|
2792
|
+
"rounded-lg opacity-70 ring-offset-background transition-opacity",
|
|
2942
2793
|
"hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
2943
2794
|
"disabled:pointer-events-none "
|
|
2944
2795
|
),
|
|
@@ -3064,7 +2915,7 @@ var ToastComponent = ({ toast, onRemove }) => {
|
|
|
3064
2915
|
"div",
|
|
3065
2916
|
{
|
|
3066
2917
|
className: cn(
|
|
3067
|
-
"relative w-80 rounded-r-
|
|
2918
|
+
"relative w-80 rounded-r-xl border border-l-0 backdrop-blur-md transition-all duration-300 pointer-events-auto overflow-hidden",
|
|
3068
2919
|
"bg-card shadow-xl",
|
|
3069
2920
|
"animate-in slide-in-from-right-full",
|
|
3070
2921
|
config.containerClassName,
|
|
@@ -3108,7 +2959,7 @@ var ToastComponent = ({ toast, onRemove }) => {
|
|
|
3108
2959
|
{
|
|
3109
2960
|
onClick: handleRemove,
|
|
3110
2961
|
className: cn(
|
|
3111
|
-
"rounded-
|
|
2962
|
+
"rounded-lg p-1 hover:bg-accent hover:text-accent-foreground",
|
|
3112
2963
|
"transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-primary/50"
|
|
3113
2964
|
),
|
|
3114
2965
|
"aria-label": "Close toast",
|
|
@@ -3146,6 +2997,62 @@ var variantStyles3 = {
|
|
|
3146
2997
|
error: "bg-destructive text-destructive-foreground border-destructive/20",
|
|
3147
2998
|
success: "bg-success text-success-foreground border-success/20"
|
|
3148
2999
|
};
|
|
3000
|
+
function assignRef(ref, value) {
|
|
3001
|
+
if (!ref) return;
|
|
3002
|
+
if (typeof ref === "function") {
|
|
3003
|
+
ref(value);
|
|
3004
|
+
return;
|
|
3005
|
+
}
|
|
3006
|
+
try {
|
|
3007
|
+
ref.current = value;
|
|
3008
|
+
} catch {
|
|
3009
|
+
}
|
|
3010
|
+
}
|
|
3011
|
+
var clamp = (value, min, max) => Math.max(min, Math.min(max, value));
|
|
3012
|
+
function getTransformOrigin(side) {
|
|
3013
|
+
switch (side) {
|
|
3014
|
+
case "top":
|
|
3015
|
+
return "center bottom";
|
|
3016
|
+
case "bottom":
|
|
3017
|
+
return "center top";
|
|
3018
|
+
case "left":
|
|
3019
|
+
return "right center";
|
|
3020
|
+
case "right":
|
|
3021
|
+
return "left center";
|
|
3022
|
+
}
|
|
3023
|
+
}
|
|
3024
|
+
function computeTooltipPosition(args) {
|
|
3025
|
+
const { triggerRect, contentSize, placement, offset, padding, viewport } = args;
|
|
3026
|
+
let side = placement;
|
|
3027
|
+
const fitsTop = triggerRect.top - offset - contentSize.height >= padding;
|
|
3028
|
+
const fitsBottom = triggerRect.bottom + offset + contentSize.height <= viewport.height - padding;
|
|
3029
|
+
const fitsLeft = triggerRect.left - offset - contentSize.width >= padding;
|
|
3030
|
+
const fitsRight = triggerRect.right + offset + contentSize.width <= viewport.width - padding;
|
|
3031
|
+
if (side === "top" && !fitsTop && fitsBottom) side = "bottom";
|
|
3032
|
+
if (side === "bottom" && !fitsBottom && fitsTop) side = "top";
|
|
3033
|
+
if (side === "left" && !fitsLeft && fitsRight) side = "right";
|
|
3034
|
+
if (side === "right" && !fitsRight && fitsLeft) side = "left";
|
|
3035
|
+
const centerX = triggerRect.left + triggerRect.width / 2;
|
|
3036
|
+
const centerY = triggerRect.top + triggerRect.height / 2;
|
|
3037
|
+
let left = 0;
|
|
3038
|
+
let top = 0;
|
|
3039
|
+
if (side === "top") {
|
|
3040
|
+
top = triggerRect.top - offset - contentSize.height;
|
|
3041
|
+
left = centerX - contentSize.width / 2;
|
|
3042
|
+
} else if (side === "bottom") {
|
|
3043
|
+
top = triggerRect.bottom + offset;
|
|
3044
|
+
left = centerX - contentSize.width / 2;
|
|
3045
|
+
} else if (side === "left") {
|
|
3046
|
+
top = centerY - contentSize.height / 2;
|
|
3047
|
+
left = triggerRect.left - offset - contentSize.width;
|
|
3048
|
+
} else {
|
|
3049
|
+
top = centerY - contentSize.height / 2;
|
|
3050
|
+
left = triggerRect.right + offset;
|
|
3051
|
+
}
|
|
3052
|
+
left = clamp(left, padding, viewport.width - contentSize.width - padding);
|
|
3053
|
+
top = clamp(top, padding, viewport.height - contentSize.height - padding);
|
|
3054
|
+
return { top, left, side };
|
|
3055
|
+
}
|
|
3149
3056
|
var Tooltip = ({
|
|
3150
3057
|
children,
|
|
3151
3058
|
content,
|
|
@@ -3156,54 +3063,52 @@ var Tooltip = ({
|
|
|
3156
3063
|
variant = "default"
|
|
3157
3064
|
}) => {
|
|
3158
3065
|
const [isOpen, setIsOpen] = React13.useState(false);
|
|
3159
|
-
const [position, setPosition] = React13.useState(null);
|
|
3160
3066
|
const [isMounted, setIsMounted] = React13.useState(false);
|
|
3161
3067
|
const triggerRef = React13.useRef(null);
|
|
3068
|
+
const positionerRef = React13.useRef(null);
|
|
3069
|
+
const panelRef = React13.useRef(null);
|
|
3162
3070
|
const timeoutRef = React13.useRef(void 0);
|
|
3071
|
+
const lastAppliedRef = React13.useRef(null);
|
|
3163
3072
|
React13.useEffect(() => {
|
|
3164
3073
|
setIsMounted(true);
|
|
3165
3074
|
}, []);
|
|
3166
3075
|
const delayOpen = typeof delay === "object" ? delay.open || 700 : delay;
|
|
3167
3076
|
const delayClose = typeof delay === "object" ? delay.close || 300 : delay;
|
|
3168
|
-
const
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
const
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
const
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
}
|
|
3200
|
-
setPosition({ top, left });
|
|
3201
|
-
};
|
|
3077
|
+
const offset = 8;
|
|
3078
|
+
const padding = 8;
|
|
3079
|
+
const updatePosition = React13.useCallback(() => {
|
|
3080
|
+
const triggerEl = triggerRef.current;
|
|
3081
|
+
const positionerEl = positionerRef.current;
|
|
3082
|
+
const panelEl = panelRef.current;
|
|
3083
|
+
if (!triggerEl || !positionerEl || !panelEl) return;
|
|
3084
|
+
const triggerRect = triggerEl.getBoundingClientRect();
|
|
3085
|
+
const measuredWidth = panelEl.offsetWidth;
|
|
3086
|
+
const measuredHeight = panelEl.offsetHeight;
|
|
3087
|
+
const rect = panelEl.getBoundingClientRect();
|
|
3088
|
+
const contentWidth = measuredWidth || rect.width;
|
|
3089
|
+
const contentHeight = measuredHeight || rect.height;
|
|
3090
|
+
const next = computeTooltipPosition({
|
|
3091
|
+
triggerRect,
|
|
3092
|
+
contentSize: { width: contentWidth, height: contentHeight },
|
|
3093
|
+
placement,
|
|
3094
|
+
offset,
|
|
3095
|
+
padding,
|
|
3096
|
+
viewport: { width: window.innerWidth, height: window.innerHeight }
|
|
3097
|
+
});
|
|
3098
|
+
const top = Math.round(next.top);
|
|
3099
|
+
const left = Math.round(next.left);
|
|
3100
|
+
const prev = lastAppliedRef.current;
|
|
3101
|
+
const same = prev && Math.abs(prev.top - top) < 0.5 && Math.abs(prev.left - left) < 0.5 && prev.side === next.side;
|
|
3102
|
+
if (same) return;
|
|
3103
|
+
lastAppliedRef.current = { top, left, side: next.side };
|
|
3104
|
+
positionerEl.style.transform = `translate3d(${left}px, ${top}px, 0)`;
|
|
3105
|
+
panelEl.style.transformOrigin = getTransformOrigin(next.side);
|
|
3106
|
+
if (positionerEl.style.visibility !== "visible") positionerEl.style.visibility = "visible";
|
|
3107
|
+
}, [placement]);
|
|
3202
3108
|
const handleMouseEnter = () => {
|
|
3203
3109
|
if (disabled) return;
|
|
3204
3110
|
clearTimeout(timeoutRef.current);
|
|
3205
3111
|
timeoutRef.current = setTimeout(() => {
|
|
3206
|
-
calculatePosition();
|
|
3207
3112
|
setIsOpen(true);
|
|
3208
3113
|
}, delayOpen);
|
|
3209
3114
|
};
|
|
@@ -3215,45 +3120,117 @@ var Tooltip = ({
|
|
|
3215
3120
|
};
|
|
3216
3121
|
const handleFocus = () => {
|
|
3217
3122
|
if (disabled) return;
|
|
3218
|
-
calculatePosition();
|
|
3219
3123
|
setIsOpen(true);
|
|
3220
3124
|
};
|
|
3221
3125
|
const handleBlur = () => {
|
|
3222
3126
|
setIsOpen(false);
|
|
3223
3127
|
};
|
|
3128
|
+
React13.useEffect(() => {
|
|
3129
|
+
return () => clearTimeout(timeoutRef.current);
|
|
3130
|
+
}, []);
|
|
3131
|
+
React13.useLayoutEffect(() => {
|
|
3132
|
+
if (!isOpen) {
|
|
3133
|
+
lastAppliedRef.current = null;
|
|
3134
|
+
return;
|
|
3135
|
+
}
|
|
3136
|
+
updatePosition();
|
|
3137
|
+
let raf1 = 0;
|
|
3138
|
+
let raf2 = 0;
|
|
3139
|
+
raf1 = window.requestAnimationFrame(() => {
|
|
3140
|
+
updatePosition();
|
|
3141
|
+
raf2 = window.requestAnimationFrame(() => updatePosition());
|
|
3142
|
+
});
|
|
3143
|
+
return () => {
|
|
3144
|
+
cancelAnimationFrame(raf1);
|
|
3145
|
+
cancelAnimationFrame(raf2);
|
|
3146
|
+
};
|
|
3147
|
+
}, [isOpen, updatePosition]);
|
|
3148
|
+
React13.useEffect(() => {
|
|
3149
|
+
if (!isOpen) return;
|
|
3150
|
+
let raf = 0;
|
|
3151
|
+
const handler = () => {
|
|
3152
|
+
cancelAnimationFrame(raf);
|
|
3153
|
+
raf = window.requestAnimationFrame(() => updatePosition());
|
|
3154
|
+
};
|
|
3155
|
+
handler();
|
|
3156
|
+
window.addEventListener("resize", handler);
|
|
3157
|
+
window.addEventListener("scroll", handler, true);
|
|
3158
|
+
document.addEventListener("scroll", handler, true);
|
|
3159
|
+
return () => {
|
|
3160
|
+
cancelAnimationFrame(raf);
|
|
3161
|
+
window.removeEventListener("resize", handler);
|
|
3162
|
+
window.removeEventListener("scroll", handler, true);
|
|
3163
|
+
document.removeEventListener("scroll", handler, true);
|
|
3164
|
+
};
|
|
3165
|
+
}, [isOpen, updatePosition]);
|
|
3166
|
+
React13.useEffect(() => {
|
|
3167
|
+
if (!isOpen) return;
|
|
3168
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
3169
|
+
const ro = new ResizeObserver(() => updatePosition());
|
|
3170
|
+
if (triggerRef.current) ro.observe(triggerRef.current);
|
|
3171
|
+
if (panelRef.current) ro.observe(panelRef.current);
|
|
3172
|
+
return () => ro.disconnect();
|
|
3173
|
+
}, [isOpen, updatePosition]);
|
|
3224
3174
|
if (disabled || !content) {
|
|
3225
3175
|
return children;
|
|
3226
3176
|
}
|
|
3227
3177
|
return /* @__PURE__ */ jsxs14(Fragment3, { children: [
|
|
3228
3178
|
React13.cloneElement(children, {
|
|
3229
|
-
ref:
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3179
|
+
ref: (node) => {
|
|
3180
|
+
triggerRef.current = node;
|
|
3181
|
+
assignRef(children.props?.ref, node);
|
|
3182
|
+
},
|
|
3183
|
+
onMouseEnter: (e) => {
|
|
3184
|
+
handleMouseEnter();
|
|
3185
|
+
if (typeof children.props?.onMouseEnter === "function") children.props.onMouseEnter(e);
|
|
3186
|
+
},
|
|
3187
|
+
onMouseLeave: (e) => {
|
|
3188
|
+
handleMouseLeave();
|
|
3189
|
+
if (typeof children.props?.onMouseLeave === "function") children.props.onMouseLeave(e);
|
|
3190
|
+
},
|
|
3191
|
+
onFocus: (e) => {
|
|
3192
|
+
handleFocus();
|
|
3193
|
+
if (typeof children.props?.onFocus === "function") children.props.onFocus(e);
|
|
3194
|
+
},
|
|
3195
|
+
onBlur: (e) => {
|
|
3196
|
+
handleBlur();
|
|
3197
|
+
if (typeof children.props?.onBlur === "function") children.props.onBlur(e);
|
|
3198
|
+
}
|
|
3234
3199
|
}),
|
|
3235
|
-
isMounted && isOpen &&
|
|
3200
|
+
isMounted && isOpen && createPortal2(
|
|
3236
3201
|
/* @__PURE__ */ jsx17(
|
|
3237
3202
|
"div",
|
|
3238
3203
|
{
|
|
3239
|
-
|
|
3204
|
+
ref: positionerRef,
|
|
3240
3205
|
style: {
|
|
3241
3206
|
position: "fixed",
|
|
3242
|
-
top:
|
|
3243
|
-
left:
|
|
3244
|
-
transform:
|
|
3207
|
+
top: 0,
|
|
3208
|
+
left: 0,
|
|
3209
|
+
transform: "translate3d(0, 0, 0)",
|
|
3245
3210
|
zIndex: 99999,
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3211
|
+
visibility: "hidden",
|
|
3212
|
+
pointerEvents: "none",
|
|
3213
|
+
willChange: "transform"
|
|
3249
3214
|
},
|
|
3250
|
-
|
|
3251
|
-
"
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3215
|
+
children: /* @__PURE__ */ jsx17(
|
|
3216
|
+
"div",
|
|
3217
|
+
{
|
|
3218
|
+
ref: panelRef,
|
|
3219
|
+
role: "tooltip",
|
|
3220
|
+
style: {
|
|
3221
|
+
opacity: 1,
|
|
3222
|
+
transition: "opacity 150ms",
|
|
3223
|
+
transformOrigin: getTransformOrigin(placement)
|
|
3224
|
+
},
|
|
3225
|
+
className: cn(
|
|
3226
|
+
"px-3 py-2 text-sm font-medium rounded-xl shadow-lg border",
|
|
3227
|
+
"max-w-xs wrap-break-word backdrop-blur-sm",
|
|
3228
|
+
variantStyles3[variant],
|
|
3229
|
+
className
|
|
3230
|
+
),
|
|
3231
|
+
children: content
|
|
3232
|
+
}
|
|
3233
|
+
)
|
|
3257
3234
|
}
|
|
3258
3235
|
),
|
|
3259
3236
|
document.body
|
|
@@ -3477,7 +3454,7 @@ var useShadCNAnimations = () => {
|
|
|
3477
3454
|
|
|
3478
3455
|
// ../../components/ui/Popover.tsx
|
|
3479
3456
|
import { Fragment as Fragment4, jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3480
|
-
function
|
|
3457
|
+
function assignRef2(ref, value) {
|
|
3481
3458
|
if (!ref) return;
|
|
3482
3459
|
if (typeof ref === "function") {
|
|
3483
3460
|
ref(value);
|
|
@@ -3488,7 +3465,7 @@ function assignRef(ref, value) {
|
|
|
3488
3465
|
} catch {
|
|
3489
3466
|
}
|
|
3490
3467
|
}
|
|
3491
|
-
function
|
|
3468
|
+
function getTransformOrigin2(side, align) {
|
|
3492
3469
|
if (side === "top") return `${align === "end" ? "right" : "left"} bottom`;
|
|
3493
3470
|
if (side === "bottom") return `${align === "end" ? "right" : "left"} top`;
|
|
3494
3471
|
if (side === "left") return "right top";
|
|
@@ -3510,7 +3487,7 @@ function normalizePlacement(placement) {
|
|
|
3510
3487
|
}
|
|
3511
3488
|
}
|
|
3512
3489
|
}
|
|
3513
|
-
var
|
|
3490
|
+
var clamp2 = (value, min, max) => Math.max(min, Math.min(max, value));
|
|
3514
3491
|
function overflowAmount(left, width, viewportWidth, padding) {
|
|
3515
3492
|
const min = padding;
|
|
3516
3493
|
const max = viewportWidth - padding;
|
|
@@ -3557,14 +3534,14 @@ function computePopoverPosition(args) {
|
|
|
3557
3534
|
if (align === "end" && endOverflow > 0 && startOverflow < endOverflow) align = "start";
|
|
3558
3535
|
left = align === "end" ? leftEnd : leftStart;
|
|
3559
3536
|
top = side === "top" ? triggerRect.top - offset - contentSize.height : triggerRect.bottom + offset;
|
|
3560
|
-
left =
|
|
3561
|
-
top =
|
|
3537
|
+
left = clamp2(left, padding, viewport.width - contentSize.width - padding);
|
|
3538
|
+
top = clamp2(top, padding, viewport.height - contentSize.height - padding);
|
|
3562
3539
|
return { top, left, side, align };
|
|
3563
3540
|
}
|
|
3564
3541
|
top = triggerRect.top;
|
|
3565
3542
|
left = side === "left" ? triggerRect.left - offset - contentSize.width : triggerRect.right + offset;
|
|
3566
|
-
left =
|
|
3567
|
-
top =
|
|
3543
|
+
left = clamp2(left, padding, viewport.width - contentSize.width - padding);
|
|
3544
|
+
top = clamp2(top, padding, viewport.height - contentSize.height - padding);
|
|
3568
3545
|
return { top, left, side, align };
|
|
3569
3546
|
}
|
|
3570
3547
|
var Popover = ({
|
|
@@ -3631,7 +3608,7 @@ var Popover = ({
|
|
|
3631
3608
|
if (applied) return;
|
|
3632
3609
|
lastAppliedRef.current = { top, left, side: next.side, align: next.align, width: widthPx };
|
|
3633
3610
|
positionerEl.style.transform = `translate3d(${left}px, ${top}px, 0)`;
|
|
3634
|
-
panelEl.style.transformOrigin =
|
|
3611
|
+
panelEl.style.transformOrigin = getTransformOrigin2(next.side, next.align);
|
|
3635
3612
|
if (positionerEl.style.visibility !== "visible") positionerEl.style.visibility = "visible";
|
|
3636
3613
|
if (positionerEl.style.pointerEvents !== "auto") positionerEl.style.pointerEvents = "auto";
|
|
3637
3614
|
}, [placement, matchTriggerWidth, contentWidth]);
|
|
@@ -3746,7 +3723,7 @@ var Popover = ({
|
|
|
3746
3723
|
role: "dialog",
|
|
3747
3724
|
"aria-modal": modal || void 0,
|
|
3748
3725
|
style: {
|
|
3749
|
-
transformOrigin:
|
|
3726
|
+
transformOrigin: getTransformOrigin2(initialPlacement.side, initialPlacement.align)
|
|
3750
3727
|
},
|
|
3751
3728
|
className: cn(
|
|
3752
3729
|
// shadcn-like enter animation
|
|
@@ -3757,7 +3734,7 @@ var Popover = ({
|
|
|
3757
3734
|
"div",
|
|
3758
3735
|
{
|
|
3759
3736
|
className: cn(
|
|
3760
|
-
"rounded-
|
|
3737
|
+
"rounded-xl border bg-popover text-popover-foreground shadow-md",
|
|
3761
3738
|
"backdrop-blur-sm bg-popover/95 border-border/60 p-4",
|
|
3762
3739
|
contentClassName
|
|
3763
3740
|
),
|
|
@@ -3777,7 +3754,7 @@ var Popover = ({
|
|
|
3777
3754
|
return React14.cloneElement(triggerEl, {
|
|
3778
3755
|
ref: (node) => {
|
|
3779
3756
|
triggerRef.current = node;
|
|
3780
|
-
|
|
3757
|
+
assignRef2(triggerEl.props?.ref, node);
|
|
3781
3758
|
},
|
|
3782
3759
|
onClick: (e) => {
|
|
3783
3760
|
e.preventDefault();
|
|
@@ -3788,10 +3765,10 @@ var Popover = ({
|
|
|
3788
3765
|
}
|
|
3789
3766
|
},
|
|
3790
3767
|
"aria-expanded": isOpen,
|
|
3791
|
-
"aria-haspopup": "dialog",
|
|
3768
|
+
"aria-haspopup": triggerEl.props?.["aria-haspopup"] ?? "dialog",
|
|
3792
3769
|
className: cn(
|
|
3793
3770
|
triggerEl.props?.className,
|
|
3794
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background
|
|
3771
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"
|
|
3795
3772
|
)
|
|
3796
3773
|
});
|
|
3797
3774
|
})(),
|
|
@@ -3997,7 +3974,7 @@ var SlideOver = (props) => {
|
|
|
3997
3974
|
return /* @__PURE__ */ jsx19(Sheet, { ...props, side: "right", variant: "overlay", size: "lg" });
|
|
3998
3975
|
};
|
|
3999
3976
|
var BottomSheet = ({ snapPoints = ["25%", "50%", "90%"], defaultSnap = 1, ...props }) => {
|
|
4000
|
-
return /* @__PURE__ */ jsx19(Sheet, { ...props, side: "bottom", variant: "overlay", className: cn("rounded-t-
|
|
3977
|
+
return /* @__PURE__ */ jsx19(Sheet, { ...props, side: "bottom", variant: "overlay", className: cn("rounded-t-3xl", props.className) });
|
|
4001
3978
|
};
|
|
4002
3979
|
var SidebarSheet = ({ navigation, children, ...props }) => {
|
|
4003
3980
|
return /* @__PURE__ */ jsxs16(Sheet, { ...props, side: "left", variant: "push", size: "md", children: [
|
|
@@ -4061,7 +4038,7 @@ var Alert = ({ title, description, variant = "default", className, icon, dismiss
|
|
|
4061
4038
|
"div",
|
|
4062
4039
|
{
|
|
4063
4040
|
className: cn(
|
|
4064
|
-
"relative w-full rounded-r-
|
|
4041
|
+
"relative w-full rounded-r-xl border border-l-0 overflow-hidden",
|
|
4065
4042
|
"flex items-start gap-3 p-4 pl-5",
|
|
4066
4043
|
"backdrop-blur-md",
|
|
4067
4044
|
config.containerClassName,
|
|
@@ -4081,7 +4058,7 @@ var Alert = ({ title, description, variant = "default", className, icon, dismiss
|
|
|
4081
4058
|
"button",
|
|
4082
4059
|
{
|
|
4083
4060
|
onClick: handleClose,
|
|
4084
|
-
className: "rounded-
|
|
4061
|
+
className: "rounded-lg p-1 hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
4085
4062
|
"aria-label": closeAriaLabel || t("closeAlert"),
|
|
4086
4063
|
children: /* @__PURE__ */ jsx20(X7, { className: "h-4 w-4" })
|
|
4087
4064
|
}
|
|
@@ -4241,7 +4218,7 @@ var variantStyles4 = {
|
|
|
4241
4218
|
simple: "text-muted-foreground hover:text-foreground underline-offset-4 hover:underline",
|
|
4242
4219
|
slash: "text-muted-foreground hover:text-foreground",
|
|
4243
4220
|
arrow: "text-muted-foreground hover:text-foreground",
|
|
4244
|
-
pill: "text-muted-foreground hover:text-foreground hover:bg-accent rounded-
|
|
4221
|
+
pill: "text-muted-foreground hover:text-foreground hover:bg-accent rounded-lg transition-colors"
|
|
4245
4222
|
};
|
|
4246
4223
|
var Breadcrumb = ({
|
|
4247
4224
|
items,
|
|
@@ -4292,72 +4269,57 @@ var Breadcrumb = ({
|
|
|
4292
4269
|
const handleCollapseToggle = () => {
|
|
4293
4270
|
setIsCollapsed(!isCollapsed);
|
|
4294
4271
|
};
|
|
4295
|
-
return /* @__PURE__ */ jsx22(
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
"
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
className: cn(
|
|
4310
|
-
"inline-flex items-center gap-1 transition-all duration-200",
|
|
4311
|
-
"hover:bg-accent rounded-md",
|
|
4312
|
-
sizeStyles5[size].padding,
|
|
4313
|
-
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1"
|
|
4314
|
-
),
|
|
4315
|
-
"aria-label": "Show all breadcrumb items",
|
|
4316
|
-
children: /* @__PURE__ */ jsx22(MoreHorizontal, { className: sizeStyles5[size].icon })
|
|
4317
|
-
}
|
|
4318
|
-
) : item.href && !isLast && !item.disabled ? /* @__PURE__ */ jsxs19(
|
|
4319
|
-
Link,
|
|
4320
|
-
{
|
|
4321
|
-
href: item.href,
|
|
4322
|
-
className: cn(
|
|
4323
|
-
"inline-flex items-center gap-1 font-medium transition-all duration-200",
|
|
4324
|
-
variantStyles4[variant],
|
|
4325
|
-
variant === "pill" && sizeStyles5[size].padding,
|
|
4326
|
-
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1 rounded-sm"
|
|
4327
|
-
),
|
|
4328
|
-
children: [
|
|
4329
|
-
Icon && /* @__PURE__ */ jsx22(Icon, { className: sizeStyles5[size].icon }),
|
|
4330
|
-
/* @__PURE__ */ jsx22("span", { children: item.label })
|
|
4331
|
-
]
|
|
4332
|
-
}
|
|
4333
|
-
) : /* @__PURE__ */ jsxs19(
|
|
4334
|
-
"span",
|
|
4335
|
-
{
|
|
4336
|
-
className: cn(
|
|
4337
|
-
"inline-flex items-center gap-1 font-medium",
|
|
4338
|
-
isLast ? "text-foreground" : item.disabled ? "text-muted-foreground/60 cursor-not-allowed" : "text-muted-foreground",
|
|
4339
|
-
variant === "pill" && !isLast && sizeStyles5[size].padding
|
|
4340
|
-
),
|
|
4341
|
-
"aria-current": isLast ? "page" : void 0,
|
|
4342
|
-
children: [
|
|
4343
|
-
Icon && /* @__PURE__ */ jsx22(Icon, { className: sizeStyles5[size].icon }),
|
|
4344
|
-
/* @__PURE__ */ jsx22("span", { children: item.label })
|
|
4345
|
-
]
|
|
4346
|
-
}
|
|
4272
|
+
return /* @__PURE__ */ jsx22("nav", { className: cn("flex w-full items-center", sizeStyles5[size].text, className), "aria-label": "Breadcrumb navigation", children: /* @__PURE__ */ jsx22("ol", { className: cn("flex items-center", sizeStyles5[size].spacing), children: processedItems.map((item, index) => {
|
|
4273
|
+
const isLast = index === processedItems.length - 1;
|
|
4274
|
+
const isCollapsedIndicator = item.label === "...";
|
|
4275
|
+
const Icon = item.icon;
|
|
4276
|
+
return /* @__PURE__ */ jsxs19("li", { className: "flex items-center", children: [
|
|
4277
|
+
isCollapsedIndicator ? /* @__PURE__ */ jsx22(
|
|
4278
|
+
"button",
|
|
4279
|
+
{
|
|
4280
|
+
onClick: handleCollapseToggle,
|
|
4281
|
+
className: cn(
|
|
4282
|
+
"inline-flex items-center gap-1 transition-all duration-200",
|
|
4283
|
+
"hover:bg-accent rounded-md",
|
|
4284
|
+
sizeStyles5[size].padding,
|
|
4285
|
+
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1"
|
|
4347
4286
|
),
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4287
|
+
"aria-label": "Show all breadcrumb items",
|
|
4288
|
+
children: /* @__PURE__ */ jsx22(MoreHorizontal, { className: sizeStyles5[size].icon })
|
|
4289
|
+
}
|
|
4290
|
+
) : item.href && !isLast && !item.disabled ? /* @__PURE__ */ jsxs19(
|
|
4291
|
+
Link,
|
|
4292
|
+
{
|
|
4293
|
+
href: item.href,
|
|
4294
|
+
className: cn(
|
|
4295
|
+
"inline-flex items-center gap-1 font-medium transition-all duration-200",
|
|
4296
|
+
variantStyles4[variant],
|
|
4297
|
+
variant === "pill" && sizeStyles5[size].padding,
|
|
4298
|
+
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1 rounded-md"
|
|
4299
|
+
),
|
|
4300
|
+
children: [
|
|
4301
|
+
Icon && /* @__PURE__ */ jsx22(Icon, { className: sizeStyles5[size].icon }),
|
|
4302
|
+
/* @__PURE__ */ jsx22("span", { children: item.label })
|
|
4303
|
+
]
|
|
4304
|
+
}
|
|
4305
|
+
) : /* @__PURE__ */ jsxs19(
|
|
4306
|
+
"span",
|
|
4307
|
+
{
|
|
4308
|
+
className: cn(
|
|
4309
|
+
"inline-flex items-center gap-1 font-medium",
|
|
4310
|
+
isLast ? "text-foreground" : item.disabled ? "text-muted-foreground/60 cursor-not-allowed" : "text-muted-foreground",
|
|
4311
|
+
variant === "pill" && !isLast && sizeStyles5[size].padding
|
|
4312
|
+
),
|
|
4313
|
+
"aria-current": isLast ? "page" : void 0,
|
|
4314
|
+
children: [
|
|
4315
|
+
Icon && /* @__PURE__ */ jsx22(Icon, { className: sizeStyles5[size].icon }),
|
|
4316
|
+
/* @__PURE__ */ jsx22("span", { children: item.label })
|
|
4317
|
+
]
|
|
4318
|
+
}
|
|
4319
|
+
),
|
|
4320
|
+
!isLast && /* @__PURE__ */ jsx22("span", { className: cn("mx-1", sizeStyles5[size].spacing), role: "presentation", "aria-hidden": "true", children: getSeparator() })
|
|
4321
|
+
] }, `${item.label}-${index}`);
|
|
4322
|
+
}) }) });
|
|
4361
4323
|
};
|
|
4362
4324
|
var Breadcrumb_default = Breadcrumb;
|
|
4363
4325
|
|
|
@@ -4399,12 +4361,12 @@ var variantStyles5 = {
|
|
|
4399
4361
|
},
|
|
4400
4362
|
card: {
|
|
4401
4363
|
container: "space-y-1",
|
|
4402
|
-
tab: "rounded-
|
|
4364
|
+
tab: "rounded-xl border border-transparent transition-all duration-200",
|
|
4403
4365
|
activeTab: "bg-primary text-primary-foreground border-primary",
|
|
4404
4366
|
inactiveTab: "text-muted-foreground hover:text-foreground hover:bg-accent/50 hover:border-border hover:shadow-sm"
|
|
4405
4367
|
},
|
|
4406
4368
|
"underline-card": {
|
|
4407
|
-
container: "border-b border-border bg-card rounded-t-
|
|
4369
|
+
container: "border-b border-border bg-card rounded-t-2xl",
|
|
4408
4370
|
tab: "relative transition-all duration-200 pb-3 px-4 border-b-2 border-transparent hover:border-primary/50 hover:bg-accent/30",
|
|
4409
4371
|
activeTab: "text-primary border-primary font-medium bg-accent/20",
|
|
4410
4372
|
inactiveTab: "text-muted-foreground hover:text-foreground"
|
|
@@ -4517,13 +4479,7 @@ var Tabs = ({
|
|
|
4517
4479
|
tab.value
|
|
4518
4480
|
);
|
|
4519
4481
|
}),
|
|
4520
|
-
variant === "underline" && orientation === "horizontal" && /* @__PURE__ */ jsx23(
|
|
4521
|
-
"div",
|
|
4522
|
-
{
|
|
4523
|
-
className: "absolute bottom-0 h-0.5 bg-primary transition-all duration-300 ease-out",
|
|
4524
|
-
style: underlineStyle
|
|
4525
|
-
}
|
|
4526
|
-
)
|
|
4482
|
+
variant === "underline" && orientation === "horizontal" && /* @__PURE__ */ jsx23("div", { className: "absolute bottom-0 h-0.5 bg-primary transition-all duration-300 ease-out", style: underlineStyle })
|
|
4527
4483
|
] }),
|
|
4528
4484
|
/* @__PURE__ */ jsx23(
|
|
4529
4485
|
"div",
|
|
@@ -4532,7 +4488,7 @@ var Tabs = ({
|
|
|
4532
4488
|
id: `${baseId}-panel-${tabs.findIndex((t) => t.value === active)}`,
|
|
4533
4489
|
"aria-labelledby": `${baseId}-tab-${tabs.findIndex((t) => t.value === active)}`,
|
|
4534
4490
|
className: cn(
|
|
4535
|
-
"bg-card rounded-
|
|
4491
|
+
"bg-card rounded-xl border border-border shadow-sm text-card-foreground transition-all duration-200",
|
|
4536
4492
|
sizeStyles6[size].content,
|
|
4537
4493
|
orientation === "vertical" && "flex-1"
|
|
4538
4494
|
),
|
|
@@ -4543,47 +4499,18 @@ var Tabs = ({
|
|
|
4543
4499
|
] });
|
|
4544
4500
|
};
|
|
4545
4501
|
var SimpleTabs = ({ tabs, defaultValue, className }) => {
|
|
4546
|
-
return /* @__PURE__ */ jsx23(
|
|
4547
|
-
Tabs,
|
|
4548
|
-
{
|
|
4549
|
-
tabs,
|
|
4550
|
-
defaultValue,
|
|
4551
|
-
className,
|
|
4552
|
-
variant: "default",
|
|
4553
|
-
size: "sm"
|
|
4554
|
-
}
|
|
4555
|
-
);
|
|
4502
|
+
return /* @__PURE__ */ jsx23(Tabs, { tabs, defaultValue, className, variant: "default", size: "sm" });
|
|
4556
4503
|
};
|
|
4557
4504
|
var PillTabs = ({ contained = true, ...props }) => {
|
|
4558
|
-
return /* @__PURE__ */ jsx23(
|
|
4559
|
-
Tabs,
|
|
4560
|
-
{
|
|
4561
|
-
...props,
|
|
4562
|
-
variant: "pills",
|
|
4563
|
-
className: cn(contained && "max-w-fit", props.className)
|
|
4564
|
-
}
|
|
4565
|
-
);
|
|
4505
|
+
return /* @__PURE__ */ jsx23(Tabs, { ...props, variant: "pills", className: cn(contained && "max-w-fit", props.className) });
|
|
4566
4506
|
};
|
|
4567
|
-
var VerticalTabs = ({
|
|
4568
|
-
sidebarWidth
|
|
4569
|
-
className,
|
|
4570
|
-
...props
|
|
4571
|
-
}) => {
|
|
4572
|
-
return /* @__PURE__ */ jsx23("div", { className: cn("flex gap-6", className), children: /* @__PURE__ */ jsx23("div", { className: cn(sidebarWidth, "shrink-0"), children: /* @__PURE__ */ jsx23(
|
|
4573
|
-
Tabs,
|
|
4574
|
-
{
|
|
4575
|
-
...props,
|
|
4576
|
-
orientation: "vertical",
|
|
4577
|
-
variant: "card",
|
|
4578
|
-
className: "w-full"
|
|
4579
|
-
}
|
|
4580
|
-
) }) });
|
|
4507
|
+
var VerticalTabs = ({ sidebarWidth = "w-48", className, ...props }) => {
|
|
4508
|
+
return /* @__PURE__ */ jsx23("div", { className: cn("flex gap-6", className), children: /* @__PURE__ */ jsx23("div", { className: cn(sidebarWidth, "shrink-0"), children: /* @__PURE__ */ jsx23(Tabs, { ...props, orientation: "vertical", variant: "card", className: "w-full" }) }) });
|
|
4581
4509
|
};
|
|
4582
4510
|
|
|
4583
4511
|
// ../../components/ui/DropdownMenu.tsx
|
|
4584
4512
|
import React19, { useState as useState17 } from "react";
|
|
4585
|
-
import {
|
|
4586
|
-
import { Fragment as Fragment5, jsx as jsx24, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4513
|
+
import { jsx as jsx24, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4587
4514
|
var DropdownMenu = ({
|
|
4588
4515
|
trigger,
|
|
4589
4516
|
children,
|
|
@@ -4597,72 +4524,26 @@ var DropdownMenu = ({
|
|
|
4597
4524
|
items
|
|
4598
4525
|
}) => {
|
|
4599
4526
|
const [internalOpen, setInternalOpen] = useState17(false);
|
|
4600
|
-
const [position, setPosition] = useState17(null);
|
|
4601
4527
|
const triggerRef = React19.useRef(null);
|
|
4602
|
-
const
|
|
4528
|
+
const menuRef = React19.useRef(null);
|
|
4603
4529
|
const itemsRef = React19.useRef([]);
|
|
4604
4530
|
const [activeIndex, setActiveIndex] = useState17(-1);
|
|
4605
4531
|
useShadCNAnimations();
|
|
4606
4532
|
const open = isOpen !== void 0 ? isOpen : internalOpen;
|
|
4607
4533
|
const setOpen = onOpenChange || setInternalOpen;
|
|
4608
4534
|
React19.useEffect(() => {
|
|
4609
|
-
if (open && triggerRef.current && contentRef.current) {
|
|
4610
|
-
const rect = triggerRef.current.getBoundingClientRect();
|
|
4611
|
-
const menuRect = contentRef.current.getBoundingClientRect();
|
|
4612
|
-
const viewportHeight = window.innerHeight;
|
|
4613
|
-
let top = rect.bottom + 4;
|
|
4614
|
-
let left = rect.left;
|
|
4615
|
-
if (rect.bottom + menuRect.height > viewportHeight && rect.top > menuRect.height) {
|
|
4616
|
-
top = rect.top - menuRect.height - 4;
|
|
4617
|
-
}
|
|
4618
|
-
switch (placement) {
|
|
4619
|
-
case "top":
|
|
4620
|
-
case "top-start":
|
|
4621
|
-
top = rect.top - menuRect.height - 4;
|
|
4622
|
-
break;
|
|
4623
|
-
case "top-end":
|
|
4624
|
-
top = rect.top - menuRect.height - 4;
|
|
4625
|
-
left = rect.right - menuRect.width;
|
|
4626
|
-
break;
|
|
4627
|
-
case "bottom":
|
|
4628
|
-
case "bottom-start":
|
|
4629
|
-
break;
|
|
4630
|
-
case "bottom-end":
|
|
4631
|
-
left = rect.right - menuRect.width;
|
|
4632
|
-
break;
|
|
4633
|
-
case "left":
|
|
4634
|
-
top = rect.top;
|
|
4635
|
-
left = rect.left - menuRect.width - 4;
|
|
4636
|
-
break;
|
|
4637
|
-
case "right":
|
|
4638
|
-
top = rect.top;
|
|
4639
|
-
left = rect.right + 4;
|
|
4640
|
-
break;
|
|
4641
|
-
}
|
|
4642
|
-
setPosition({ top, left });
|
|
4643
|
-
}
|
|
4644
4535
|
if (open) setActiveIndex(-1);
|
|
4645
|
-
}, [open
|
|
4536
|
+
}, [open]);
|
|
4646
4537
|
React19.useEffect(() => {
|
|
4647
4538
|
if (!open) return;
|
|
4648
|
-
const handleClickOutside = (event) => {
|
|
4649
|
-
const target = event.target;
|
|
4650
|
-
if (triggerRef.current && !triggerRef.current.contains(target)) {
|
|
4651
|
-
const dropdown = document.querySelector("[data-dropdown-menu]");
|
|
4652
|
-
if (dropdown && !dropdown.contains(target)) {
|
|
4653
|
-
setOpen(false);
|
|
4654
|
-
}
|
|
4655
|
-
}
|
|
4656
|
-
};
|
|
4657
|
-
const handleEscape = (event) => {
|
|
4658
|
-
if (event.key === "Escape") {
|
|
4659
|
-
setOpen(false);
|
|
4660
|
-
}
|
|
4661
|
-
};
|
|
4662
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
4663
|
-
document.addEventListener("keydown", handleEscape);
|
|
4664
4539
|
const handleKeyNav = (e) => {
|
|
4665
|
-
|
|
4540
|
+
const active = document.activeElement;
|
|
4541
|
+
const triggerEl = triggerRef.current;
|
|
4542
|
+
const menuEl = menuRef.current;
|
|
4543
|
+
if (!active || !triggerEl || !menuEl) return;
|
|
4544
|
+
const isInMenu = menuEl.contains(active);
|
|
4545
|
+
const isOnTrigger = triggerEl.contains(active);
|
|
4546
|
+
if (!isInMenu && !isOnTrigger) return;
|
|
4666
4547
|
const enabled = itemsRef.current.filter((el) => el && !el.disabled);
|
|
4667
4548
|
if (enabled.length === 0) return;
|
|
4668
4549
|
if (e.key === "ArrowDown") {
|
|
@@ -4687,97 +4568,88 @@ var DropdownMenu = ({
|
|
|
4687
4568
|
};
|
|
4688
4569
|
document.addEventListener("keydown", handleKeyNav);
|
|
4689
4570
|
return () => {
|
|
4690
|
-
document.removeEventListener("mousedown", handleClickOutside);
|
|
4691
|
-
document.removeEventListener("keydown", handleEscape);
|
|
4692
4571
|
document.removeEventListener("keydown", handleKeyNav);
|
|
4693
4572
|
};
|
|
4694
|
-
}, [open,
|
|
4695
|
-
const handleTriggerClick = () => {
|
|
4696
|
-
if (!disabled) {
|
|
4697
|
-
setOpen(!open);
|
|
4698
|
-
}
|
|
4699
|
-
};
|
|
4573
|
+
}, [open, activeIndex]);
|
|
4700
4574
|
const handleItemClick = (itemOnClick) => {
|
|
4701
4575
|
itemOnClick();
|
|
4702
4576
|
if (closeOnSelect) {
|
|
4703
4577
|
setOpen(false);
|
|
4704
4578
|
}
|
|
4705
4579
|
};
|
|
4706
|
-
const
|
|
4707
|
-
|
|
4580
|
+
const menuBody = /* @__PURE__ */ jsx24("div", { ref: menuRef, "data-dropdown-menu": true, "data-state": open ? "open" : "closed", role: "menu", className: cn("min-w-40", className), children: items ? items.map((item, index) => {
|
|
4581
|
+
const IconComponent = item.icon;
|
|
4582
|
+
return /* @__PURE__ */ jsxs21(
|
|
4583
|
+
"button",
|
|
4584
|
+
{
|
|
4585
|
+
ref: (el) => {
|
|
4586
|
+
if (el) itemsRef.current[index] = el;
|
|
4587
|
+
},
|
|
4588
|
+
onClick: () => handleItemClick(item.onClick),
|
|
4589
|
+
disabled: item.disabled,
|
|
4590
|
+
role: "menuitem",
|
|
4591
|
+
tabIndex: -1,
|
|
4592
|
+
style: {
|
|
4593
|
+
animationDelay: open ? `${Math.min(index * 20, 200)}ms` : "0ms"
|
|
4594
|
+
},
|
|
4595
|
+
className: cn(
|
|
4596
|
+
"dropdown-item flex w-full items-center gap-2 px-2.5 py-1.5 text-sm rounded-lg",
|
|
4597
|
+
"outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
4598
|
+
"hover:bg-accent hover:text-accent-foreground",
|
|
4599
|
+
"focus:bg-accent focus:text-accent-foreground",
|
|
4600
|
+
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
4601
|
+
item.destructive && "text-destructive hover:bg-destructive/10 focus:bg-destructive/10"
|
|
4602
|
+
),
|
|
4603
|
+
children: [
|
|
4604
|
+
IconComponent && /* @__PURE__ */ jsx24(IconComponent, { className: "h-4 w-4" }),
|
|
4605
|
+
item.label
|
|
4606
|
+
]
|
|
4607
|
+
},
|
|
4608
|
+
index
|
|
4609
|
+
);
|
|
4610
|
+
}) : children });
|
|
4611
|
+
const enhancedTrigger = React19.cloneElement(trigger, {
|
|
4612
|
+
ref: triggerRef,
|
|
4613
|
+
"aria-haspopup": "menu",
|
|
4614
|
+
"aria-expanded": open,
|
|
4615
|
+
onKeyDown: (e) => {
|
|
4616
|
+
if (disabled) return;
|
|
4617
|
+
if (e.key === "ArrowDown") {
|
|
4618
|
+
e.preventDefault();
|
|
4619
|
+
setOpen(true);
|
|
4620
|
+
requestAnimationFrame(() => itemsRef.current.find((el) => el && !el.disabled)?.focus());
|
|
4621
|
+
} else if (e.key === "ArrowUp") {
|
|
4622
|
+
e.preventDefault();
|
|
4623
|
+
setOpen(true);
|
|
4624
|
+
requestAnimationFrame(() => {
|
|
4625
|
+
const enabled = itemsRef.current.filter((el) => el && !el.disabled);
|
|
4626
|
+
enabled[enabled.length - 1]?.focus();
|
|
4627
|
+
});
|
|
4628
|
+
} else if (e.key === "Escape") {
|
|
4629
|
+
e.preventDefault();
|
|
4630
|
+
setOpen(false);
|
|
4631
|
+
}
|
|
4632
|
+
if (typeof trigger.props?.onKeyDown === "function") {
|
|
4633
|
+
trigger.props.onKeyDown(e);
|
|
4634
|
+
}
|
|
4635
|
+
},
|
|
4636
|
+
className: cn(
|
|
4637
|
+
trigger.props?.className,
|
|
4638
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"
|
|
4639
|
+
)
|
|
4640
|
+
});
|
|
4641
|
+
return /* @__PURE__ */ jsx24(
|
|
4642
|
+
Popover,
|
|
4708
4643
|
{
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
zIndex: 9999,
|
|
4717
|
-
visibility: position ? "visible" : "hidden",
|
|
4718
|
-
transformOrigin: "top center"
|
|
4719
|
-
},
|
|
4720
|
-
"data-state": open ? "open" : "closed",
|
|
4721
|
-
role: "menu",
|
|
4722
|
-
className: cn("z-9999 min-w-40", className),
|
|
4723
|
-
children: /* @__PURE__ */ jsx24(
|
|
4724
|
-
"div",
|
|
4725
|
-
{
|
|
4726
|
-
className: cn(
|
|
4727
|
-
"rounded-md border bg-popover text-popover-foreground shadow-md",
|
|
4728
|
-
"backdrop-blur-sm bg-popover/95 border-border/60 p-1",
|
|
4729
|
-
contentClassName
|
|
4730
|
-
),
|
|
4731
|
-
children: items ? items.map((item, index) => {
|
|
4732
|
-
const IconComponent = item.icon;
|
|
4733
|
-
return /* @__PURE__ */ jsxs21(
|
|
4734
|
-
"button",
|
|
4735
|
-
{
|
|
4736
|
-
ref: (el) => {
|
|
4737
|
-
if (el) itemsRef.current[index] = el;
|
|
4738
|
-
},
|
|
4739
|
-
onClick: () => handleItemClick(item.onClick),
|
|
4740
|
-
disabled: item.disabled,
|
|
4741
|
-
role: "menuitem",
|
|
4742
|
-
tabIndex: -1,
|
|
4743
|
-
style: {
|
|
4744
|
-
animationDelay: open ? `${Math.min(index * 20, 200)}ms` : "0ms"
|
|
4745
|
-
},
|
|
4746
|
-
className: cn(
|
|
4747
|
-
"dropdown-item flex w-full items-center gap-2 px-2.5 py-1.5 text-sm rounded-sm",
|
|
4748
|
-
"outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
4749
|
-
"hover:bg-accent hover:text-accent-foreground",
|
|
4750
|
-
"focus:bg-accent focus:text-accent-foreground",
|
|
4751
|
-
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
4752
|
-
item.destructive && "text-destructive hover:bg-destructive/10 focus:bg-destructive/10"
|
|
4753
|
-
),
|
|
4754
|
-
children: [
|
|
4755
|
-
IconComponent && /* @__PURE__ */ jsx24(IconComponent, { className: "h-4 w-4" }),
|
|
4756
|
-
item.label
|
|
4757
|
-
]
|
|
4758
|
-
},
|
|
4759
|
-
index
|
|
4760
|
-
);
|
|
4761
|
-
}) : children
|
|
4762
|
-
}
|
|
4763
|
-
)
|
|
4644
|
+
open,
|
|
4645
|
+
onOpenChange: setOpen,
|
|
4646
|
+
trigger: enhancedTrigger,
|
|
4647
|
+
placement,
|
|
4648
|
+
disabled,
|
|
4649
|
+
contentClassName: cn("p-1", contentClassName),
|
|
4650
|
+
children: menuBody
|
|
4764
4651
|
}
|
|
4765
|
-
)
|
|
4766
|
-
return /* @__PURE__ */ jsxs21(Fragment5, { children: [
|
|
4767
|
-
React19.cloneElement(trigger, {
|
|
4768
|
-
ref: triggerRef,
|
|
4769
|
-
onClick: handleTriggerClick,
|
|
4770
|
-
"aria-expanded": open,
|
|
4771
|
-
"aria-haspopup": "menu",
|
|
4772
|
-
className: cn(
|
|
4773
|
-
// keep original classes on trigger
|
|
4774
|
-
trigger.props?.className,
|
|
4775
|
-
// ensure focus-visible ring for trigger too
|
|
4776
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"
|
|
4777
|
-
)
|
|
4778
|
-
}),
|
|
4779
|
-
dropdownContent && typeof window !== "undefined" && createPortal5(dropdownContent, document.body)
|
|
4780
|
-
] });
|
|
4652
|
+
);
|
|
4781
4653
|
};
|
|
4782
4654
|
var DropdownMenuItem = ({ children, onClick, disabled, destructive, className }) => /* @__PURE__ */ jsx24(
|
|
4783
4655
|
"button",
|
|
@@ -4785,7 +4657,7 @@ var DropdownMenuItem = ({ children, onClick, disabled, destructive, className })
|
|
|
4785
4657
|
onClick,
|
|
4786
4658
|
disabled,
|
|
4787
4659
|
className: cn(
|
|
4788
|
-
"flex w-full items-center gap-2 px-3 py-2 text-sm rounded-
|
|
4660
|
+
"flex w-full items-center gap-2 px-3 py-2 text-sm rounded-lg transition-colors",
|
|
4789
4661
|
"hover:bg-accent hover:text-accent-foreground",
|
|
4790
4662
|
"focus:bg-accent focus:text-accent-foreground focus:outline-none",
|
|
4791
4663
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
@@ -4803,7 +4675,7 @@ var SelectDropdown = ({ options, value, onChange, placeholder = "Select...", cla
|
|
|
4803
4675
|
"button",
|
|
4804
4676
|
{
|
|
4805
4677
|
className: cn(
|
|
4806
|
-
"inline-flex items-center justify-between gap-2 px-3 py-2 text-sm rounded-
|
|
4678
|
+
"inline-flex items-center justify-between gap-2 px-3 py-2 text-sm rounded-xl border bg-background border-border/60",
|
|
4807
4679
|
"hover:bg-accent/50",
|
|
4808
4680
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
4809
4681
|
className
|
|
@@ -4829,9 +4701,8 @@ import { ChevronLeft, ChevronRight as ChevronRight2, ChevronsLeft, ChevronsRight
|
|
|
4829
4701
|
// ../../components/ui/Combobox.tsx
|
|
4830
4702
|
import * as React20 from "react";
|
|
4831
4703
|
import { useId as useId3 } from "react";
|
|
4832
|
-
import { createPortal as createPortal6 } from "react-dom";
|
|
4833
4704
|
import { ChevronDown, Search as Search3, SearchX, Check as Check3, X as X8, Loader2 as Loader23 } from "lucide-react";
|
|
4834
|
-
import { jsx as jsx25, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4705
|
+
import { Fragment as Fragment5, jsx as jsx25, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4835
4706
|
var getOptionLabel = (option) => {
|
|
4836
4707
|
return typeof option === "string" ? option : option.label;
|
|
4837
4708
|
};
|
|
@@ -4874,55 +4745,7 @@ var Combobox = ({
|
|
|
4874
4745
|
() => enableSearch ? options.filter((o) => getOptionLabel(o).toLowerCase().includes(query.toLowerCase())) : options,
|
|
4875
4746
|
[options, query, enableSearch]
|
|
4876
4747
|
);
|
|
4877
|
-
const [dropdownPosition, setDropdownPosition] = React20.useState(null);
|
|
4878
4748
|
const triggerRef = React20.useRef(null);
|
|
4879
|
-
const dropdownRef = React20.useRef(null);
|
|
4880
|
-
const calculatePosition = React20.useCallback(() => {
|
|
4881
|
-
if (!triggerRef.current) return null;
|
|
4882
|
-
const rect = triggerRef.current.getBoundingClientRect();
|
|
4883
|
-
const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
|
|
4884
|
-
const scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;
|
|
4885
|
-
return {
|
|
4886
|
-
top: rect.bottom + scrollTop + 4,
|
|
4887
|
-
left: rect.left + scrollLeft,
|
|
4888
|
-
width: rect.width
|
|
4889
|
-
};
|
|
4890
|
-
}, []);
|
|
4891
|
-
React20.useEffect(() => {
|
|
4892
|
-
if (!open) return;
|
|
4893
|
-
const handler = () => {
|
|
4894
|
-
const pos = calculatePosition();
|
|
4895
|
-
if (pos) setDropdownPosition(pos);
|
|
4896
|
-
};
|
|
4897
|
-
window.addEventListener("resize", handler);
|
|
4898
|
-
window.addEventListener("scroll", handler, true);
|
|
4899
|
-
return () => {
|
|
4900
|
-
window.removeEventListener("resize", handler);
|
|
4901
|
-
window.removeEventListener("scroll", handler, true);
|
|
4902
|
-
};
|
|
4903
|
-
}, [open, calculatePosition]);
|
|
4904
|
-
React20.useEffect(() => {
|
|
4905
|
-
if (!open) return;
|
|
4906
|
-
const handleClickOutside = (event) => {
|
|
4907
|
-
const target = event.target;
|
|
4908
|
-
const triggerEl = triggerRef.current;
|
|
4909
|
-
const dropdownEl = dropdownRef.current;
|
|
4910
|
-
if (triggerEl && !triggerEl.contains(target) && dropdownEl && !dropdownEl.contains(target)) {
|
|
4911
|
-
setOpen(false);
|
|
4912
|
-
}
|
|
4913
|
-
};
|
|
4914
|
-
const handleEscape = (event) => {
|
|
4915
|
-
if (event.key === "Escape") {
|
|
4916
|
-
setOpen(false);
|
|
4917
|
-
}
|
|
4918
|
-
};
|
|
4919
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
4920
|
-
document.addEventListener("keydown", handleEscape);
|
|
4921
|
-
return () => {
|
|
4922
|
-
document.removeEventListener("mousedown", handleClickOutside);
|
|
4923
|
-
document.removeEventListener("keydown", handleEscape);
|
|
4924
|
-
};
|
|
4925
|
-
}, [open]);
|
|
4926
4749
|
const handleSelect = (option) => {
|
|
4927
4750
|
const val = getOptionValue(option);
|
|
4928
4751
|
if (val !== void 0 && val !== null) {
|
|
@@ -4948,110 +4771,91 @@ var Combobox = ({
|
|
|
4948
4771
|
}, [open, enableSearch]);
|
|
4949
4772
|
const selectedOption = findOptionByValue(options, value);
|
|
4950
4773
|
const displayValue = selectedOption ? getOptionLabel(selectedOption) : "";
|
|
4951
|
-
const
|
|
4952
|
-
"div",
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
const next = prev === null ? 0 : prev + 1;
|
|
4985
|
-
return next >= filteredOptions.length ? 0 : next;
|
|
4986
|
-
});
|
|
4987
|
-
} else if (e.key === "ArrowUp") {
|
|
4988
|
-
e.preventDefault();
|
|
4989
|
-
setActiveIndex((prev) => {
|
|
4990
|
-
const next = prev === null ? filteredOptions.length - 1 : prev - 1;
|
|
4991
|
-
return next < 0 ? filteredOptions.length - 1 : next;
|
|
4992
|
-
});
|
|
4993
|
-
} else if (e.key === "Enter") {
|
|
4994
|
-
e.preventDefault();
|
|
4995
|
-
if (activeIndex !== null && filteredOptions[activeIndex]) {
|
|
4996
|
-
handleSelect(filteredOptions[activeIndex]);
|
|
4997
|
-
}
|
|
4998
|
-
} else if (e.key === "Escape") {
|
|
4999
|
-
e.preventDefault();
|
|
5000
|
-
setOpen(false);
|
|
5001
|
-
}
|
|
5002
|
-
},
|
|
5003
|
-
placeholder: searchPlaceholder,
|
|
5004
|
-
className: "w-full rounded-md bg-background/50 py-2 pl-8 pr-3 text-sm border-0 focus:outline-none focus:bg-background/80 transition-colors placeholder:text-muted-foreground/60",
|
|
5005
|
-
"aria-autocomplete": "list",
|
|
5006
|
-
"aria-activedescendant": activeIndex != null ? `combobox-item-${activeIndex}` : void 0
|
|
4774
|
+
const dropdownBody = /* @__PURE__ */ jsxs22("div", { "data-combobox-dropdown": true, "data-state": open ? "open" : "closed", role: "listbox", id: `${resolvedId}-listbox`, className: "w-full", children: [
|
|
4775
|
+
enableSearch && /* @__PURE__ */ jsxs22("div", { className: "relative p-3 border-b border-border/50 bg-muted/20", children: [
|
|
4776
|
+
/* @__PURE__ */ jsx25(Search3, { className: "absolute left-6 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground transition-colors" }),
|
|
4777
|
+
/* @__PURE__ */ jsx25(
|
|
4778
|
+
"input",
|
|
4779
|
+
{
|
|
4780
|
+
ref: inputRef,
|
|
4781
|
+
value: query,
|
|
4782
|
+
onChange: (e) => {
|
|
4783
|
+
setQuery(e.target.value);
|
|
4784
|
+
setActiveIndex(null);
|
|
4785
|
+
},
|
|
4786
|
+
onKeyDown: (e) => {
|
|
4787
|
+
if (e.key === "ArrowDown") {
|
|
4788
|
+
e.preventDefault();
|
|
4789
|
+
setActiveIndex((prev) => {
|
|
4790
|
+
const next = prev === null ? 0 : prev + 1;
|
|
4791
|
+
return next >= filteredOptions.length ? 0 : next;
|
|
4792
|
+
});
|
|
4793
|
+
} else if (e.key === "ArrowUp") {
|
|
4794
|
+
e.preventDefault();
|
|
4795
|
+
setActiveIndex((prev) => {
|
|
4796
|
+
const next = prev === null ? filteredOptions.length - 1 : prev - 1;
|
|
4797
|
+
return next < 0 ? filteredOptions.length - 1 : next;
|
|
4798
|
+
});
|
|
4799
|
+
} else if (e.key === "Enter") {
|
|
4800
|
+
e.preventDefault();
|
|
4801
|
+
if (activeIndex !== null && filteredOptions[activeIndex]) {
|
|
4802
|
+
handleSelect(filteredOptions[activeIndex]);
|
|
4803
|
+
}
|
|
4804
|
+
} else if (e.key === "Escape") {
|
|
4805
|
+
e.preventDefault();
|
|
4806
|
+
setOpen(false);
|
|
5007
4807
|
}
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
}
|
|
5054
|
-
|
|
4808
|
+
},
|
|
4809
|
+
placeholder: searchPlaceholder,
|
|
4810
|
+
className: "w-full rounded-xl bg-background/50 py-2 pl-8 pr-3 text-sm border-0 focus:outline-none focus:bg-background/80 transition-colors placeholder:text-muted-foreground/60",
|
|
4811
|
+
"aria-autocomplete": "list",
|
|
4812
|
+
"aria-activedescendant": activeIndex != null ? `combobox-item-${activeIndex}` : void 0
|
|
4813
|
+
}
|
|
4814
|
+
)
|
|
4815
|
+
] }),
|
|
4816
|
+
/* @__PURE__ */ jsx25("div", { className: "max-h-64 overflow-y-auto overscroll-contain", children: /* @__PURE__ */ jsx25("ul", { className: "p-1 space-y-1", children: loading2 ? /* @__PURE__ */ jsx25("li", { className: "px-3 py-8 text-center", children: /* @__PURE__ */ jsxs22("div", { className: "flex flex-col items-center gap-2 animate-in fade-in-0 zoom-in-95 duration-300", children: [
|
|
4817
|
+
/* @__PURE__ */ jsx25(Loader23, { className: "h-6 w-6 animate-spin text-primary" }),
|
|
4818
|
+
/* @__PURE__ */ jsx25("span", { className: "text-sm text-muted-foreground", children: loadingText || "Loading\u2026" })
|
|
4819
|
+
] }) }) : filteredOptions.length > 0 ? filteredOptions.map((item, index) => {
|
|
4820
|
+
const itemValue = getOptionValue(item);
|
|
4821
|
+
const itemLabel = getOptionLabel(item);
|
|
4822
|
+
const isSelected = itemValue === value;
|
|
4823
|
+
return /* @__PURE__ */ jsxs22(
|
|
4824
|
+
"li",
|
|
4825
|
+
{
|
|
4826
|
+
ref: (node) => {
|
|
4827
|
+
listRef.current[index] = node;
|
|
4828
|
+
},
|
|
4829
|
+
id: `combobox-item-${index}`,
|
|
4830
|
+
role: "option",
|
|
4831
|
+
tabIndex: -1,
|
|
4832
|
+
"aria-selected": isSelected,
|
|
4833
|
+
onClick: () => handleSelect(item),
|
|
4834
|
+
style: {
|
|
4835
|
+
animationDelay: open ? `${Math.min(index * 20, 200)}ms` : "0ms"
|
|
4836
|
+
},
|
|
4837
|
+
className: cn(
|
|
4838
|
+
"dropdown-item group flex cursor-pointer items-center justify-between rounded-lg px-2.5 py-1.5 text-sm",
|
|
4839
|
+
"outline-none focus:outline-none focus-visible:outline-none",
|
|
4840
|
+
"hover:bg-accent hover:text-accent-foreground",
|
|
4841
|
+
"focus:bg-accent focus:text-accent-foreground",
|
|
4842
|
+
"data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
4843
|
+
index === activeIndex && "bg-accent text-accent-foreground",
|
|
4844
|
+
isSelected && "bg-accent text-accent-foreground"
|
|
4845
|
+
),
|
|
4846
|
+
children: [
|
|
4847
|
+
/* @__PURE__ */ jsx25("span", { className: "truncate", children: itemLabel }),
|
|
4848
|
+
isSelected && /* @__PURE__ */ jsx25(Check3, { className: "h-4 w-4 text-primary" })
|
|
4849
|
+
]
|
|
4850
|
+
},
|
|
4851
|
+
`${itemValue}-${index}`
|
|
4852
|
+
);
|
|
4853
|
+
}) : /* @__PURE__ */ jsx25("li", { className: "px-3 py-8 text-center text-muted-foreground text-sm", children: /* @__PURE__ */ jsxs22("div", { className: "flex flex-col items-center gap-2 animate-in fade-in-0 zoom-in-95 duration-300", children: [
|
|
4854
|
+
/* @__PURE__ */ jsx25(SearchX, { className: "h-8 w-8 opacity-40 text-muted-foreground" }),
|
|
4855
|
+
/* @__PURE__ */ jsx25("span", { className: "text-sm", children: emptyText }),
|
|
4856
|
+
query && /* @__PURE__ */ jsx25("button", { type: "button", onClick: () => setQuery(""), className: "text-xs text-primary hover:underline", children: "Clear" })
|
|
4857
|
+
] }) }) }) })
|
|
4858
|
+
] });
|
|
5055
4859
|
const sizeStyles8 = {
|
|
5056
4860
|
// Keep consistent with Input size heights
|
|
5057
4861
|
sm: "h-8 py-1.5 text-sm md:h-7 md:text-xs",
|
|
@@ -5059,8 +4863,68 @@ var Combobox = ({
|
|
|
5059
4863
|
lg: "h-12 py-3 text-base"
|
|
5060
4864
|
};
|
|
5061
4865
|
const labelSize = size === "sm" ? "text-xs" : size === "lg" ? "text-base" : "text-sm";
|
|
5062
|
-
const radiusClass = size === "sm" ? "rounded-
|
|
4866
|
+
const radiusClass = size === "sm" ? "rounded-lg" : "rounded-xl";
|
|
5063
4867
|
const verticalGap = size === "sm" ? "space-y-1.5" : "space-y-2";
|
|
4868
|
+
const triggerButtonBaseProps = {
|
|
4869
|
+
ref: triggerRef,
|
|
4870
|
+
type: "button",
|
|
4871
|
+
disabled,
|
|
4872
|
+
role: "combobox",
|
|
4873
|
+
"aria-haspopup": "listbox",
|
|
4874
|
+
"aria-expanded": open,
|
|
4875
|
+
"aria-controls": `${resolvedId}-listbox`,
|
|
4876
|
+
id: resolvedId,
|
|
4877
|
+
"aria-labelledby": labelId,
|
|
4878
|
+
onKeyDown: (e) => {
|
|
4879
|
+
if (disabled) return;
|
|
4880
|
+
if (e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") {
|
|
4881
|
+
e.preventDefault();
|
|
4882
|
+
setOpen(true);
|
|
4883
|
+
} else if (e.key === "Escape") {
|
|
4884
|
+
e.preventDefault();
|
|
4885
|
+
setOpen(false);
|
|
4886
|
+
}
|
|
4887
|
+
},
|
|
4888
|
+
className: cn(
|
|
4889
|
+
"flex w-full items-center justify-between border border-input bg-background px-3",
|
|
4890
|
+
radiusClass,
|
|
4891
|
+
sizeStyles8[size],
|
|
4892
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
4893
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
4894
|
+
"hover:bg-accent/5 transition-colors hover:border-primary/40 focus:border-primary",
|
|
4895
|
+
className
|
|
4896
|
+
)
|
|
4897
|
+
};
|
|
4898
|
+
const triggerContents = /* @__PURE__ */ jsxs22(Fragment5, { children: [
|
|
4899
|
+
/* @__PURE__ */ jsx25("span", { className: cn("truncate", !displayValue && "text-muted-foreground", fontBold && "font-bold"), children: displayValue || placeholder }),
|
|
4900
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-1 ml-2", children: [
|
|
4901
|
+
allowClear && value && !disabled && /* @__PURE__ */ jsx25(
|
|
4902
|
+
"div",
|
|
4903
|
+
{
|
|
4904
|
+
role: "button",
|
|
4905
|
+
tabIndex: 0,
|
|
4906
|
+
"aria-label": "Clear selection",
|
|
4907
|
+
onClick: handleClear,
|
|
4908
|
+
onKeyDown: (e) => (e.key === "Enter" || e.key === " ") && handleClear(e),
|
|
4909
|
+
className: "opacity-0 group-hover:opacity-100 transition-opacity p-0.5 rounded-md hover:bg-destructive/10 text-muted-foreground hover:text-destructive",
|
|
4910
|
+
children: /* @__PURE__ */ jsx25(X8, { className: "h-3 w-3" })
|
|
4911
|
+
}
|
|
4912
|
+
),
|
|
4913
|
+
/* @__PURE__ */ jsx25(ChevronDown, { className: cn("h-4 w-4 text-muted-foreground transition-all duration-200", open && "rotate-180 scale-110 text-primary") })
|
|
4914
|
+
] })
|
|
4915
|
+
] });
|
|
4916
|
+
const triggerButtonForPopover = /* @__PURE__ */ jsx25("button", { ...triggerButtonBaseProps, children: triggerContents });
|
|
4917
|
+
const triggerButtonInline = /* @__PURE__ */ jsx25(
|
|
4918
|
+
"button",
|
|
4919
|
+
{
|
|
4920
|
+
...triggerButtonBaseProps,
|
|
4921
|
+
onClick: () => {
|
|
4922
|
+
if (disabled) return;
|
|
4923
|
+
setOpen((prev) => !prev);
|
|
4924
|
+
},
|
|
4925
|
+
children: triggerContents
|
|
4926
|
+
}
|
|
4927
|
+
);
|
|
5064
4928
|
return /* @__PURE__ */ jsxs22("div", { className: cn("w-full group", verticalGap), children: [
|
|
5065
4929
|
label && /* @__PURE__ */ jsx25("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsxs22(
|
|
5066
4930
|
"label",
|
|
@@ -5079,57 +4943,22 @@ var Combobox = ({
|
|
|
5079
4943
|
]
|
|
5080
4944
|
}
|
|
5081
4945
|
) }),
|
|
5082
|
-
/* @__PURE__ */
|
|
5083
|
-
|
|
4946
|
+
usePortal ? /* @__PURE__ */ jsx25(
|
|
4947
|
+
Popover,
|
|
5084
4948
|
{
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
"
|
|
5091
|
-
"
|
|
5092
|
-
|
|
5093
|
-
"aria-labelledby": labelId,
|
|
5094
|
-
onClick: () => {
|
|
5095
|
-
const next = !open;
|
|
5096
|
-
if (next) {
|
|
5097
|
-
const pos = calculatePosition();
|
|
5098
|
-
if (pos) setDropdownPosition(pos);
|
|
5099
|
-
}
|
|
5100
|
-
setOpen(next);
|
|
5101
|
-
},
|
|
5102
|
-
className: cn(
|
|
5103
|
-
"flex w-full items-center justify-between border border-input bg-background px-3",
|
|
5104
|
-
radiusClass,
|
|
5105
|
-
sizeStyles8[size],
|
|
5106
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
5107
|
-
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
5108
|
-
"hover:bg-accent/5 transition-colors hover:border-primary/40 focus:border-primary",
|
|
5109
|
-
className
|
|
5110
|
-
),
|
|
5111
|
-
children: [
|
|
5112
|
-
/* @__PURE__ */ jsx25("span", { className: cn("truncate", !displayValue && "text-muted-foreground", fontBold && "font-bold"), children: displayValue || placeholder }),
|
|
5113
|
-
/* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-1 ml-2", children: [
|
|
5114
|
-
allowClear && value && !disabled && // FIX: Use a div instead of a nested button
|
|
5115
|
-
/* @__PURE__ */ jsx25(
|
|
5116
|
-
"div",
|
|
5117
|
-
{
|
|
5118
|
-
role: "button",
|
|
5119
|
-
tabIndex: 0,
|
|
5120
|
-
"aria-label": "Clear selection",
|
|
5121
|
-
onClick: handleClear,
|
|
5122
|
-
onKeyDown: (e) => (e.key === "Enter" || e.key === " ") && handleClear(e),
|
|
5123
|
-
className: "opacity-0 group-hover:opacity-100 transition-opacity p-0.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive",
|
|
5124
|
-
children: /* @__PURE__ */ jsx25(X8, { className: "h-3 w-3" })
|
|
5125
|
-
}
|
|
5126
|
-
),
|
|
5127
|
-
/* @__PURE__ */ jsx25(ChevronDown, { className: cn("h-4 w-4 text-muted-foreground transition-all duration-200", open && "rotate-180 scale-110 text-primary") })
|
|
5128
|
-
] })
|
|
5129
|
-
]
|
|
4949
|
+
open,
|
|
4950
|
+
onOpenChange: setOpen,
|
|
4951
|
+
trigger: triggerButtonForPopover,
|
|
4952
|
+
placement: "bottom-start",
|
|
4953
|
+
matchTriggerWidth: true,
|
|
4954
|
+
className: "z-9999",
|
|
4955
|
+
contentClassName: "p-0",
|
|
4956
|
+
children: dropdownBody
|
|
5130
4957
|
}
|
|
5131
|
-
),
|
|
5132
|
-
|
|
4958
|
+
) : /* @__PURE__ */ jsxs22("div", { className: "relative", children: [
|
|
4959
|
+
triggerButtonInline,
|
|
4960
|
+
open && /* @__PURE__ */ jsx25("div", { className: "absolute left-0 top-full mt-1 z-50 w-full", children: /* @__PURE__ */ jsx25("div", { className: "rounded-xl border bg-popover text-popover-foreground shadow-md backdrop-blur-sm bg-popover/95 border-border/60", children: dropdownBody }) })
|
|
4961
|
+
] })
|
|
5133
4962
|
] });
|
|
5134
4963
|
};
|
|
5135
4964
|
|
|
@@ -5228,7 +5057,7 @@ var Pagination = ({
|
|
|
5228
5057
|
disabled: disabled || page === 1,
|
|
5229
5058
|
className: cn(
|
|
5230
5059
|
sizeClass.btn,
|
|
5231
|
-
"p-0 rounded transition-colors hidden sm:flex items-center justify-center",
|
|
5060
|
+
"p-0 rounded-lg transition-colors hidden sm:flex items-center justify-center",
|
|
5232
5061
|
disabled || page === 1 ? "opacity-40 cursor-not-allowed" : "hover:bg-accent hover:text-accent-foreground"
|
|
5233
5062
|
),
|
|
5234
5063
|
title: labels?.firstPage || t("firstPage"),
|
|
@@ -5243,7 +5072,7 @@ var Pagination = ({
|
|
|
5243
5072
|
disabled: disabled || page === 1,
|
|
5244
5073
|
className: cn(
|
|
5245
5074
|
sizeClass.btn,
|
|
5246
|
-
"p-0 rounded transition-colors flex items-center justify-center",
|
|
5075
|
+
"p-0 rounded-lg transition-colors flex items-center justify-center",
|
|
5247
5076
|
disabled || page === 1 ? "opacity-40 cursor-not-allowed" : "hover:bg-accent hover:text-accent-foreground"
|
|
5248
5077
|
),
|
|
5249
5078
|
title: labels?.previousPage || t("previousPage"),
|
|
@@ -5259,7 +5088,7 @@ var Pagination = ({
|
|
|
5259
5088
|
disabled,
|
|
5260
5089
|
className: cn(
|
|
5261
5090
|
sizeClass.page,
|
|
5262
|
-
"rounded font-medium transition-colors",
|
|
5091
|
+
"rounded-lg font-medium transition-colors",
|
|
5263
5092
|
page === p ? "bg-primary text-primary-foreground" : "hover:bg-accent hover:text-accent-foreground",
|
|
5264
5093
|
disabled && "opacity-40 cursor-not-allowed"
|
|
5265
5094
|
),
|
|
@@ -5277,7 +5106,7 @@ var Pagination = ({
|
|
|
5277
5106
|
disabled: disabled || page === totalPages,
|
|
5278
5107
|
className: cn(
|
|
5279
5108
|
sizeClass.btn,
|
|
5280
|
-
"p-0 rounded transition-colors flex items-center justify-center",
|
|
5109
|
+
"p-0 rounded-lg transition-colors flex items-center justify-center",
|
|
5281
5110
|
disabled || page === totalPages ? "opacity-40 cursor-not-allowed" : "hover:bg-accent hover:text-accent-foreground"
|
|
5282
5111
|
),
|
|
5283
5112
|
title: labels?.nextPage || t("nextPage"),
|
|
@@ -5292,7 +5121,7 @@ var Pagination = ({
|
|
|
5292
5121
|
disabled: disabled || page === totalPages,
|
|
5293
5122
|
className: cn(
|
|
5294
5123
|
sizeClass.btn,
|
|
5295
|
-
"p-0 rounded transition-colors hidden sm:flex items-center justify-center",
|
|
5124
|
+
"p-0 rounded-lg transition-colors hidden sm:flex items-center justify-center",
|
|
5296
5125
|
disabled || page === totalPages ? "opacity-40 cursor-not-allowed" : "hover:bg-accent hover:text-accent-foreground"
|
|
5297
5126
|
),
|
|
5298
5127
|
title: labels?.lastPage || t("lastPage"),
|
|
@@ -5352,7 +5181,7 @@ var SimplePagination = ({
|
|
|
5352
5181
|
disabled: disabled || page === 1,
|
|
5353
5182
|
className: cn(
|
|
5354
5183
|
sizeClass.btn,
|
|
5355
|
-
"p-0 rounded transition-colors flex items-center justify-center",
|
|
5184
|
+
"p-0 rounded-lg transition-colors flex items-center justify-center",
|
|
5356
5185
|
disabled || page === 1 ? "opacity-40 cursor-not-allowed" : "hover:bg-accent hover:text-accent-foreground"
|
|
5357
5186
|
),
|
|
5358
5187
|
"aria-label": "Previous page",
|
|
@@ -5371,7 +5200,7 @@ var SimplePagination = ({
|
|
|
5371
5200
|
disabled: disabled || page === totalPages,
|
|
5372
5201
|
className: cn(
|
|
5373
5202
|
sizeClass.btn,
|
|
5374
|
-
"p-0 rounded transition-colors flex items-center justify-center",
|
|
5203
|
+
"p-0 rounded-lg transition-colors flex items-center justify-center",
|
|
5375
5204
|
disabled || page === totalPages ? "opacity-40 cursor-not-allowed" : "hover:bg-accent hover:text-accent-foreground"
|
|
5376
5205
|
),
|
|
5377
5206
|
"aria-label": "Next page",
|
|
@@ -5391,7 +5220,7 @@ var CompactPagination = ({ page, totalPages, onChange, className, disabled = fal
|
|
|
5391
5220
|
onClick: () => onChange(1),
|
|
5392
5221
|
disabled: disabled || page === 1,
|
|
5393
5222
|
className: cn(
|
|
5394
|
-
"h-6 w-6 p-0 rounded transition-colors flex items-center justify-center",
|
|
5223
|
+
"h-6 w-6 p-0 rounded-lg transition-colors flex items-center justify-center",
|
|
5395
5224
|
disabled || page === 1 ? "opacity-40 cursor-not-allowed" : "hover:bg-accent hover:text-accent-foreground"
|
|
5396
5225
|
),
|
|
5397
5226
|
title: "First page",
|
|
@@ -5405,7 +5234,7 @@ var CompactPagination = ({ page, totalPages, onChange, className, disabled = fal
|
|
|
5405
5234
|
onClick: () => onChange(Math.max(1, page - 1)),
|
|
5406
5235
|
disabled: disabled || page === 1,
|
|
5407
5236
|
className: cn(
|
|
5408
|
-
"h-6 w-6 p-0 rounded transition-colors flex items-center justify-center",
|
|
5237
|
+
"h-6 w-6 p-0 rounded-lg transition-colors flex items-center justify-center",
|
|
5409
5238
|
disabled || page === 1 ? "opacity-40 cursor-not-allowed" : "hover:bg-accent hover:text-accent-foreground"
|
|
5410
5239
|
),
|
|
5411
5240
|
title: "Previous page",
|
|
@@ -5424,7 +5253,7 @@ var CompactPagination = ({ page, totalPages, onChange, className, disabled = fal
|
|
|
5424
5253
|
onClick: () => onChange(Math.min(totalPages, page + 1)),
|
|
5425
5254
|
disabled: disabled || page === totalPages,
|
|
5426
5255
|
className: cn(
|
|
5427
|
-
"h-6 w-6 p-0 rounded transition-colors flex items-center justify-center",
|
|
5256
|
+
"h-6 w-6 p-0 rounded-lg transition-colors flex items-center justify-center",
|
|
5428
5257
|
disabled || page === totalPages ? "opacity-40 cursor-not-allowed" : "hover:bg-accent hover:text-accent-foreground"
|
|
5429
5258
|
),
|
|
5430
5259
|
title: "Next page",
|
|
@@ -5438,7 +5267,7 @@ var CompactPagination = ({ page, totalPages, onChange, className, disabled = fal
|
|
|
5438
5267
|
onClick: () => onChange(totalPages),
|
|
5439
5268
|
disabled: disabled || page === totalPages,
|
|
5440
5269
|
className: cn(
|
|
5441
|
-
"h-6 w-6 p-0 rounded transition-colors flex items-center justify-center",
|
|
5270
|
+
"h-6 w-6 p-0 rounded-lg transition-colors flex items-center justify-center",
|
|
5442
5271
|
disabled || page === totalPages ? "opacity-40 cursor-not-allowed" : "hover:bg-accent hover:text-accent-foreground"
|
|
5443
5272
|
),
|
|
5444
5273
|
title: "Last page",
|
|
@@ -5509,7 +5338,7 @@ var Section = React22.forwardRef(
|
|
|
5509
5338
|
variant === "gradient" ? getGradientClasses() : variantClasses2[variant],
|
|
5510
5339
|
spacingClasses[spacing],
|
|
5511
5340
|
paddingXClasses[paddingX],
|
|
5512
|
-
outlined && "rounded-
|
|
5341
|
+
outlined && "rounded-2xl md:rounded-3xl border border-border/60",
|
|
5513
5342
|
contained && "container mx-auto",
|
|
5514
5343
|
className
|
|
5515
5344
|
),
|
|
@@ -5537,7 +5366,7 @@ var ScrollArea = forwardRef7(
|
|
|
5537
5366
|
"div",
|
|
5538
5367
|
{
|
|
5539
5368
|
ref,
|
|
5540
|
-
className: cn("relative overflow-hidden", variantClasses[variant], outlined && "rounded-
|
|
5369
|
+
className: cn("relative overflow-hidden", variantClasses[variant], outlined && "rounded-xl border border-border/60", className),
|
|
5541
5370
|
...props,
|
|
5542
5371
|
children: /* @__PURE__ */ jsx28("div", { className: cn("h-full w-full overflow-y-auto scroll-area-viewport", contentClassName), children })
|
|
5543
5372
|
}
|
|
@@ -5689,7 +5518,7 @@ var DatePicker = ({
|
|
|
5689
5518
|
"datepicker-day rounded-lg focus:outline-none relative",
|
|
5690
5519
|
"transition-all duration-200 font-medium",
|
|
5691
5520
|
isPastDate && "opacity-30 cursor-not-allowed text-muted-foreground",
|
|
5692
|
-
isSelected ? "bg-
|
|
5521
|
+
isSelected ? "bg-linear-to-br from-primary to-primary/80 text-primary-foreground font-bold shadow-lg shadow-primary/30 scale-110 z-10 hover:from-primary hover:to-primary/70" : !isPastDate && "hover:bg-accent/80 hover:text-accent-foreground hover:scale-105 focus:bg-accent focus:text-accent-foreground",
|
|
5693
5522
|
isToday2 && !isSelected && "bg-primary/15 text-primary font-bold ring-2 ring-primary/30"
|
|
5694
5523
|
),
|
|
5695
5524
|
children: [
|
|
@@ -5764,7 +5593,7 @@ var DatePicker = ({
|
|
|
5764
5593
|
},
|
|
5765
5594
|
className: cn(
|
|
5766
5595
|
"flex-1 px-3 py-2 text-xs font-semibold rounded-xl",
|
|
5767
|
-
"bg-
|
|
5596
|
+
"bg-linear-to-r from-primary/10 to-primary/5 border border-primary/30",
|
|
5768
5597
|
"text-primary hover:from-primary/20 hover:to-primary/10 hover:border-primary/50",
|
|
5769
5598
|
"transition-all duration-300 flex items-center justify-center gap-2",
|
|
5770
5599
|
"hover:scale-[1.02] active:scale-[0.98] hover:shadow-md hover:shadow-primary/10"
|
|
@@ -5786,7 +5615,7 @@ var DatePicker = ({
|
|
|
5786
5615
|
},
|
|
5787
5616
|
className: cn(
|
|
5788
5617
|
"flex-1 px-3 py-2 text-xs font-semibold rounded-xl",
|
|
5789
|
-
"bg-
|
|
5618
|
+
"bg-linear-to-r from-destructive/10 to-destructive/5 border border-destructive/30",
|
|
5790
5619
|
"text-destructive hover:from-destructive/20 hover:to-destructive/10 hover:border-destructive/50",
|
|
5791
5620
|
"transition-all duration-300 flex items-center justify-center gap-2",
|
|
5792
5621
|
"hover:scale-[1.02] active:scale-[0.98] hover:shadow-md hover:shadow-destructive/10"
|
|
@@ -6046,7 +5875,7 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
6046
5875
|
!isPastDate && !isInRange && !isRangeStart && !isRangeEnd && "hover:bg-accent/80 hover:text-accent-foreground hover:scale-105 rounded-lg",
|
|
6047
5876
|
// Range selection styling - smooth continuous background with gradient
|
|
6048
5877
|
isInRange && "bg-primary/15 text-foreground",
|
|
6049
|
-
(isRangeStart || isRangeEnd) && "bg-
|
|
5878
|
+
(isRangeStart || isRangeEnd) && "bg-linear-to-br from-primary to-primary/80 text-primary-foreground hover:from-primary hover:to-primary/70 shadow-lg shadow-primary/25",
|
|
6050
5879
|
// Only round the actual start and end of the range
|
|
6051
5880
|
isRangeStart && !isRangeEnd && "rounded-l-lg rounded-r-none",
|
|
6052
5881
|
isRangeEnd && !isRangeStart && "rounded-r-lg rounded-l-none",
|
|
@@ -6332,17 +6161,20 @@ function Calendar2({
|
|
|
6332
6161
|
}
|
|
6333
6162
|
}
|
|
6334
6163
|
};
|
|
6335
|
-
const isDateDisabled = React24.useCallback(
|
|
6336
|
-
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6344
|
-
|
|
6345
|
-
|
|
6164
|
+
const isDateDisabled = React24.useCallback(
|
|
6165
|
+
(d) => {
|
|
6166
|
+
if (minDate && d < new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate())) return true;
|
|
6167
|
+
if (maxDate && d > new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate())) return true;
|
|
6168
|
+
if (Array.isArray(disabledDates)) {
|
|
6169
|
+
return disabledDates.some((dd) => isSameDay(dd, d));
|
|
6170
|
+
}
|
|
6171
|
+
if (typeof disabledDates === "function") {
|
|
6172
|
+
return disabledDates(d);
|
|
6173
|
+
}
|
|
6174
|
+
return false;
|
|
6175
|
+
},
|
|
6176
|
+
[minDate, maxDate, disabledDates]
|
|
6177
|
+
);
|
|
6346
6178
|
const SIZE_STYLES3 = {
|
|
6347
6179
|
sm: { day: "w-8 h-8 text-[12px]", grid: dense ? "gap-0.5" : "gap-1", head: "text-[11px]", header: "text-sm" },
|
|
6348
6180
|
md: { day: "w-9 h-9 text-sm", grid: dense ? "gap-1" : "gap-1.5", head: "text-xs", header: "text-sm" },
|
|
@@ -6351,9 +6183,9 @@ function Calendar2({
|
|
|
6351
6183
|
};
|
|
6352
6184
|
const sz = SIZE_STYLES3[size];
|
|
6353
6185
|
const VARIANT_STYLES2 = {
|
|
6354
|
-
default: "border border-border rounded-
|
|
6355
|
-
bordered: "border-2 border-border rounded-
|
|
6356
|
-
card: "border border-border rounded-
|
|
6186
|
+
default: "border border-border rounded-2xl bg-card",
|
|
6187
|
+
bordered: "border-2 border-border rounded-2xl bg-card shadow-sm",
|
|
6188
|
+
card: "border border-border rounded-3xl bg-card shadow-lg",
|
|
6357
6189
|
minimal: "bg-transparent"
|
|
6358
6190
|
};
|
|
6359
6191
|
const weekDays = React24.useMemo(() => {
|
|
@@ -6379,7 +6211,7 @@ function Calendar2({
|
|
|
6379
6211
|
onClick: () => handleClickDay(d),
|
|
6380
6212
|
disabled,
|
|
6381
6213
|
className: cn(
|
|
6382
|
-
"rounded-
|
|
6214
|
+
"rounded-lg flex items-center justify-center relative",
|
|
6383
6215
|
sz.day,
|
|
6384
6216
|
!inMonth && "text-muted-foreground/60",
|
|
6385
6217
|
disabled && "opacity-40 cursor-not-allowed",
|
|
@@ -6422,9 +6254,27 @@ function Calendar2({
|
|
|
6422
6254
|
}, [display, view, weekStartsOn, maxBound]);
|
|
6423
6255
|
return /* @__PURE__ */ jsxs25("div", { className: cn("w-full", className), ...rest, children: [
|
|
6424
6256
|
showHeader && /* @__PURE__ */ jsxs25("div", { className: "flex items-center justify-between mb-2", children: [
|
|
6425
|
-
/* @__PURE__ */ jsx30(
|
|
6257
|
+
/* @__PURE__ */ jsx30(
|
|
6258
|
+
"button",
|
|
6259
|
+
{
|
|
6260
|
+
onClick: () => goByView(-1),
|
|
6261
|
+
disabled: prevDisabled,
|
|
6262
|
+
className: cn("p-1 rounded-lg hover:bg-accent", prevDisabled && "opacity-40 cursor-not-allowed hover:bg-transparent"),
|
|
6263
|
+
"aria-label": labels?.prev || (display === "week" ? "Previous week" : "Previous month"),
|
|
6264
|
+
children: /* @__PURE__ */ jsx30(ChevronLeft3, { className: "h-4 w-4" })
|
|
6265
|
+
}
|
|
6266
|
+
),
|
|
6426
6267
|
/* @__PURE__ */ jsx30("div", { className: "text-sm font-semibold", children: display === "week" ? `${labels?.month ? labels.month(weekDays[0]) : weekDays[0].toLocaleDateString("en-US", { month: "short" })} ${weekDays[0].getDate()} \u2013 ${labels?.month ? labels.month(weekDays[6]) : weekDays[6].toLocaleDateString("en-US", { month: "short" })} ${weekDays[6].getDate()}` : labels?.month ? labels.month(view) : view.toLocaleDateString("en-US", { month: "long", year: "numeric" }) }),
|
|
6427
|
-
/* @__PURE__ */ jsx30(
|
|
6268
|
+
/* @__PURE__ */ jsx30(
|
|
6269
|
+
"button",
|
|
6270
|
+
{
|
|
6271
|
+
onClick: () => goByView(1),
|
|
6272
|
+
disabled: nextDisabled,
|
|
6273
|
+
className: cn("p-1 rounded-lg hover:bg-accent", nextDisabled && "opacity-40 cursor-not-allowed hover:bg-transparent"),
|
|
6274
|
+
"aria-label": labels?.next || (display === "week" ? "Next week" : "Next month"),
|
|
6275
|
+
children: /* @__PURE__ */ jsx30(ChevronRight4, { className: "h-4 w-4" })
|
|
6276
|
+
}
|
|
6277
|
+
)
|
|
6428
6278
|
] }),
|
|
6429
6279
|
display === "week" ? /* @__PURE__ */ jsxs25(Fragment7, { children: [
|
|
6430
6280
|
showWeekdays && /* @__PURE__ */ jsx30("div", { className: cn("grid grid-cols-7", sz.grid, "mb-1 text-center text-muted-foreground font-medium"), children: weekdays.map((w) => /* @__PURE__ */ jsx30("div", { className: cn(sz.head), children: w }, `w-${w}`)) }),
|
|
@@ -6441,7 +6291,7 @@ function Calendar2({
|
|
|
6441
6291
|
onClick: () => handleClickDay(d),
|
|
6442
6292
|
disabled,
|
|
6443
6293
|
className: cn(
|
|
6444
|
-
"rounded-
|
|
6294
|
+
"rounded-lg flex items-center justify-center relative",
|
|
6445
6295
|
sz.day,
|
|
6446
6296
|
disabled && "opacity-40 cursor-not-allowed",
|
|
6447
6297
|
isToday2 && !selectedDay && "ring-1 ring-primary/50",
|
|
@@ -6577,12 +6427,12 @@ function WheelColumn({
|
|
|
6577
6427
|
/* @__PURE__ */ jsx31(
|
|
6578
6428
|
"div",
|
|
6579
6429
|
{
|
|
6580
|
-
className: "pointer-events-none absolute inset-x-2 top-1/2 -translate-y-1/2 rounded-lg bg-
|
|
6430
|
+
className: "pointer-events-none absolute inset-x-2 top-1/2 -translate-y-1/2 rounded-lg bg-linear-to-r from-primary/20 via-primary/15 to-primary/20 border border-primary/30 shadow-sm shadow-primary/10",
|
|
6581
6431
|
style: { height: itemHeight }
|
|
6582
6432
|
}
|
|
6583
6433
|
),
|
|
6584
|
-
/* @__PURE__ */ jsx31("div", { className: "pointer-events-none absolute inset-x-0 top-0 h-12 bg-
|
|
6585
|
-
/* @__PURE__ */ jsx31("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-12 bg-
|
|
6434
|
+
/* @__PURE__ */ jsx31("div", { className: "pointer-events-none absolute inset-x-0 top-0 h-12 bg-linear-to-b from-background/95 via-background/60 to-transparent z-10" }),
|
|
6435
|
+
/* @__PURE__ */ jsx31("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-12 bg-linear-to-t from-background/95 via-background/60 to-transparent z-10" }),
|
|
6586
6436
|
/* @__PURE__ */ jsx31(
|
|
6587
6437
|
"div",
|
|
6588
6438
|
{
|
|
@@ -6930,7 +6780,7 @@ function TimePicker({
|
|
|
6930
6780
|
emit(next);
|
|
6931
6781
|
};
|
|
6932
6782
|
const timePickerContent = /* @__PURE__ */ jsxs26("div", { className: "space-y-4", children: [
|
|
6933
|
-
/* @__PURE__ */ jsx31("div", { className: "flex items-center justify-center py-2 px-3 rounded-xl bg-
|
|
6783
|
+
/* @__PURE__ */ jsx31("div", { className: "flex items-center justify-center py-2 px-3 rounded-xl bg-linear-to-r from-primary/10 via-primary/5 to-primary/10 border border-primary/20", children: /* @__PURE__ */ jsx31("span", { className: "text-2xl font-bold tabular-nums tracking-wide text-foreground", children: display }) }),
|
|
6934
6784
|
allowManualInput && /* @__PURE__ */ jsxs26("div", { className: "relative", children: [
|
|
6935
6785
|
/* @__PURE__ */ jsx31(
|
|
6936
6786
|
Input_default,
|
|
@@ -6953,7 +6803,7 @@ function TimePicker({
|
|
|
6953
6803
|
type: "button",
|
|
6954
6804
|
className: cn(
|
|
6955
6805
|
"group relative px-3 py-2.5 text-xs font-medium rounded-xl border border-border/50 overflow-hidden",
|
|
6956
|
-
"bg-
|
|
6806
|
+
"bg-linear-to-br from-background to-muted/30",
|
|
6957
6807
|
"hover:border-primary/40 hover:shadow-md transition-all duration-300",
|
|
6958
6808
|
animate && "hover:scale-[1.02] active:scale-[0.98]"
|
|
6959
6809
|
),
|
|
@@ -6963,7 +6813,7 @@ function TimePicker({
|
|
|
6963
6813
|
/* @__PURE__ */ jsx31(
|
|
6964
6814
|
"div",
|
|
6965
6815
|
{
|
|
6966
|
-
className: cn("absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-300", "bg-
|
|
6816
|
+
className: cn("absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-300", "bg-linear-to-r", color),
|
|
6967
6817
|
style: { opacity: 0.08 }
|
|
6968
6818
|
}
|
|
6969
6819
|
),
|
|
@@ -6982,7 +6832,7 @@ function TimePicker({
|
|
|
6982
6832
|
type: "button",
|
|
6983
6833
|
className: cn(
|
|
6984
6834
|
"px-3 py-2.5 text-xs font-medium rounded-xl border border-border/50",
|
|
6985
|
-
"bg-
|
|
6835
|
+
"bg-linear-to-br from-background to-muted/30",
|
|
6986
6836
|
"hover:border-primary/40 hover:bg-primary/5 hover:shadow-md transition-all duration-300",
|
|
6987
6837
|
animate && "hover:scale-[1.02] active:scale-[0.98]"
|
|
6988
6838
|
),
|
|
@@ -7091,7 +6941,7 @@ function TimePicker({
|
|
|
7091
6941
|
className: cn(
|
|
7092
6942
|
"relative px-4 py-3 rounded-lg transition-all duration-300 text-sm font-bold overflow-hidden",
|
|
7093
6943
|
"focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-1",
|
|
7094
|
-
isSelected && "bg-
|
|
6944
|
+
isSelected && "bg-linear-to-r from-primary to-primary/80 text-primary-foreground shadow-lg shadow-primary/25",
|
|
7095
6945
|
!isSelected && "text-muted-foreground hover:text-foreground hover:bg-muted/50",
|
|
7096
6946
|
animate && "hover:scale-[1.02] active:scale-[0.98]"
|
|
7097
6947
|
),
|
|
@@ -7105,7 +6955,7 @@ function TimePicker({
|
|
|
7105
6955
|
emit(next);
|
|
7106
6956
|
},
|
|
7107
6957
|
children: [
|
|
7108
|
-
isSelected && /* @__PURE__ */ jsx31("div", { className: "absolute inset-0 bg-
|
|
6958
|
+
isSelected && /* @__PURE__ */ jsx31("div", { className: "absolute inset-0 bg-linear-to-tr from-white/20 to-transparent" }),
|
|
7109
6959
|
/* @__PURE__ */ jsx31("span", { className: "relative", children: p })
|
|
7110
6960
|
]
|
|
7111
6961
|
},
|
|
@@ -7123,7 +6973,7 @@ function TimePicker({
|
|
|
7123
6973
|
type: "button",
|
|
7124
6974
|
className: cn(
|
|
7125
6975
|
"flex-1 px-4 py-2.5 text-xs font-semibold rounded-xl",
|
|
7126
|
-
"bg-
|
|
6976
|
+
"bg-linear-to-r from-primary/10 to-primary/5 border border-primary/30",
|
|
7127
6977
|
"text-primary hover:from-primary/20 hover:to-primary/10 hover:border-primary/50",
|
|
7128
6978
|
"transition-all duration-300 flex items-center justify-center gap-2",
|
|
7129
6979
|
animate && "hover:scale-[1.02] active:scale-[0.98] hover:shadow-md hover:shadow-primary/10"
|
|
@@ -7145,7 +6995,7 @@ function TimePicker({
|
|
|
7145
6995
|
type: "button",
|
|
7146
6996
|
className: cn(
|
|
7147
6997
|
"flex-1 px-4 py-2.5 text-xs font-semibold rounded-xl",
|
|
7148
|
-
"bg-
|
|
6998
|
+
"bg-linear-to-r from-destructive/10 to-destructive/5 border border-destructive/30",
|
|
7149
6999
|
"text-destructive hover:from-destructive/20 hover:to-destructive/10 hover:border-destructive/50",
|
|
7150
7000
|
"transition-all duration-300 flex items-center justify-center gap-2",
|
|
7151
7001
|
animate && "hover:scale-[1.02] active:scale-[0.98] hover:shadow-md hover:shadow-destructive/10"
|
|
@@ -7353,7 +7203,7 @@ var DateTimePicker = ({
|
|
|
7353
7203
|
type: "button",
|
|
7354
7204
|
disabled,
|
|
7355
7205
|
className: cn(
|
|
7356
|
-
"flex w-full items-center justify-between rounded-
|
|
7206
|
+
"flex w-full items-center justify-between rounded-xl border border-input bg-background px-3 py-2 text-sm",
|
|
7357
7207
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
7358
7208
|
disabled && "opacity-50 cursor-not-allowed",
|
|
7359
7209
|
!displayValue && "text-muted-foreground"
|
|
@@ -7370,7 +7220,7 @@ var DateTimePicker = ({
|
|
|
7370
7220
|
e.stopPropagation();
|
|
7371
7221
|
onChange(void 0);
|
|
7372
7222
|
},
|
|
7373
|
-
className: "hover:text-foreground p-0.5 rounded-
|
|
7223
|
+
className: "hover:text-foreground p-0.5 rounded-md hover:bg-accent",
|
|
7374
7224
|
children: /* @__PURE__ */ jsx32(X10, { className: "h-4 w-4" })
|
|
7375
7225
|
}
|
|
7376
7226
|
),
|
|
@@ -7380,7 +7230,7 @@ var DateTimePicker = ({
|
|
|
7380
7230
|
}
|
|
7381
7231
|
),
|
|
7382
7232
|
contentClassName: cn(
|
|
7383
|
-
"w-auto p-0",
|
|
7233
|
+
"w-auto p-0 rounded-2xl",
|
|
7384
7234
|
// Keep the popover usable on small viewports
|
|
7385
7235
|
"max-w-[calc(100vw-1rem)] max-h-[calc(100vh-6rem)] overflow-auto"
|
|
7386
7236
|
),
|
|
@@ -7436,7 +7286,6 @@ var DateTimePicker = ({
|
|
|
7436
7286
|
// ../../components/ui/MultiCombobox.tsx
|
|
7437
7287
|
import * as React27 from "react";
|
|
7438
7288
|
import { useId as useId5 } from "react";
|
|
7439
|
-
import { createPortal as createPortal7 } from "react-dom";
|
|
7440
7289
|
import { ChevronDown as ChevronDown2, Search as Search4, Check as Check5, SearchX as SearchX2, Loader2 as Loader24 } from "lucide-react";
|
|
7441
7290
|
import { jsx as jsx33, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
7442
7291
|
var MultiCombobox = ({
|
|
@@ -7465,56 +7314,8 @@ var MultiCombobox = ({
|
|
|
7465
7314
|
const [activeIndex, setActiveIndex] = React27.useState(null);
|
|
7466
7315
|
const inputRef = React27.useRef(null);
|
|
7467
7316
|
const listRef = React27.useRef([]);
|
|
7468
|
-
const [dropdownPosition, setDropdownPosition] = React27.useState(null);
|
|
7469
7317
|
const triggerRef = React27.useRef(null);
|
|
7470
|
-
const dropdownRef = React27.useRef(null);
|
|
7471
7318
|
useShadCNAnimations();
|
|
7472
|
-
const calculatePosition = React27.useCallback(() => {
|
|
7473
|
-
if (!triggerRef.current) return null;
|
|
7474
|
-
const rect = triggerRef.current.getBoundingClientRect();
|
|
7475
|
-
const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
|
|
7476
|
-
const scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;
|
|
7477
|
-
return {
|
|
7478
|
-
top: rect.bottom + scrollTop + 4,
|
|
7479
|
-
left: rect.left + scrollLeft,
|
|
7480
|
-
width: rect.width
|
|
7481
|
-
};
|
|
7482
|
-
}, []);
|
|
7483
|
-
React27.useEffect(() => {
|
|
7484
|
-
if (!open) return;
|
|
7485
|
-
const handler = () => {
|
|
7486
|
-
const pos = calculatePosition();
|
|
7487
|
-
if (pos) setDropdownPosition(pos);
|
|
7488
|
-
};
|
|
7489
|
-
window.addEventListener("resize", handler);
|
|
7490
|
-
window.addEventListener("scroll", handler, true);
|
|
7491
|
-
return () => {
|
|
7492
|
-
window.removeEventListener("resize", handler);
|
|
7493
|
-
window.removeEventListener("scroll", handler, true);
|
|
7494
|
-
};
|
|
7495
|
-
}, [open, calculatePosition]);
|
|
7496
|
-
React27.useEffect(() => {
|
|
7497
|
-
if (!open) return;
|
|
7498
|
-
const handleClickOutside = (event) => {
|
|
7499
|
-
const target = event.target;
|
|
7500
|
-
const triggerEl = triggerRef.current;
|
|
7501
|
-
const dropdownEl = dropdownRef.current;
|
|
7502
|
-
if (triggerEl && !triggerEl.contains(target) && dropdownEl && !dropdownEl.contains(target)) {
|
|
7503
|
-
setOpen(false);
|
|
7504
|
-
}
|
|
7505
|
-
};
|
|
7506
|
-
const handleEscape = (event) => {
|
|
7507
|
-
if (event.key === "Escape") {
|
|
7508
|
-
setOpen(false);
|
|
7509
|
-
}
|
|
7510
|
-
};
|
|
7511
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
7512
|
-
document.addEventListener("keydown", handleEscape);
|
|
7513
|
-
return () => {
|
|
7514
|
-
document.removeEventListener("mousedown", handleClickOutside);
|
|
7515
|
-
document.removeEventListener("keydown", handleEscape);
|
|
7516
|
-
};
|
|
7517
|
-
}, [open]);
|
|
7518
7319
|
const normalizedOptions = React27.useMemo(
|
|
7519
7320
|
() => options.map((o) => typeof o === "string" ? { value: o, label: o } : { value: o.value, label: o.label }),
|
|
7520
7321
|
[options]
|
|
@@ -7578,11 +7379,151 @@ var MultiCombobox = ({
|
|
|
7578
7379
|
item: "text-base px-3 py-3",
|
|
7579
7380
|
tag: "px-2.5 py-1 text-sm"
|
|
7580
7381
|
}
|
|
7581
|
-
};
|
|
7582
|
-
const autoId = useId5();
|
|
7583
|
-
const resolvedId = id ? String(id) : `multicombobox-${autoId}`;
|
|
7584
|
-
const labelId = label ? `${resolvedId}-label` : void 0;
|
|
7585
|
-
const labelSize = size === "sm" ? "text-xs" : size === "lg" ? "text-base" : "text-sm";
|
|
7382
|
+
};
|
|
7383
|
+
const autoId = useId5();
|
|
7384
|
+
const resolvedId = id ? String(id) : `multicombobox-${autoId}`;
|
|
7385
|
+
const labelId = label ? `${resolvedId}-label` : void 0;
|
|
7386
|
+
const labelSize = size === "sm" ? "text-xs" : size === "lg" ? "text-base" : "text-sm";
|
|
7387
|
+
const listboxId = `${resolvedId}-listbox`;
|
|
7388
|
+
const dropdownBody = /* @__PURE__ */ jsxs28("div", { "data-combobox-dropdown": true, "data-state": open ? "open" : "closed", className: "w-full", children: [
|
|
7389
|
+
showClear && value.length > 0 && /* @__PURE__ */ jsx33("div", { className: "px-3 py-2 border-b border-border/60 flex justify-end", children: /* @__PURE__ */ jsx33(
|
|
7390
|
+
"button",
|
|
7391
|
+
{
|
|
7392
|
+
type: "button",
|
|
7393
|
+
onClick: (e) => {
|
|
7394
|
+
e.preventDefault();
|
|
7395
|
+
e.stopPropagation();
|
|
7396
|
+
handleClearAll();
|
|
7397
|
+
},
|
|
7398
|
+
className: "text-xs text-muted-foreground hover:underline cursor-pointer",
|
|
7399
|
+
children: "Clear all"
|
|
7400
|
+
}
|
|
7401
|
+
) }),
|
|
7402
|
+
enableSearch && /* @__PURE__ */ jsxs28("div", { className: "relative border-b border-border/60", children: [
|
|
7403
|
+
/* @__PURE__ */ jsx33(Search4, { className: cn("absolute left-2 top-2.5 text-muted-foreground", sizeStyles8[size].icon) }),
|
|
7404
|
+
/* @__PURE__ */ jsx33(
|
|
7405
|
+
"input",
|
|
7406
|
+
{
|
|
7407
|
+
ref: inputRef,
|
|
7408
|
+
value: query,
|
|
7409
|
+
onChange: (e) => {
|
|
7410
|
+
setQuery(e.target.value);
|
|
7411
|
+
setActiveIndex(null);
|
|
7412
|
+
},
|
|
7413
|
+
onKeyDown: handleKeyDown,
|
|
7414
|
+
placeholder,
|
|
7415
|
+
className: cn("w-full rounded-t-xl bg-transparent focus:outline-none cursor-text", sizeStyles8[size].search)
|
|
7416
|
+
}
|
|
7417
|
+
)
|
|
7418
|
+
] }),
|
|
7419
|
+
/* @__PURE__ */ jsx33(
|
|
7420
|
+
"ul",
|
|
7421
|
+
{
|
|
7422
|
+
id: listboxId,
|
|
7423
|
+
role: "listbox",
|
|
7424
|
+
className: cn("max-h-60 overflow-y-auto p-1", size === "lg" ? "text-base" : size === "sm" ? "text-xs" : "text-sm"),
|
|
7425
|
+
children: loading2 ? /* @__PURE__ */ jsx33("li", { className: "px-3 py-8 text-center", children: /* @__PURE__ */ jsxs28("div", { className: "flex flex-col items-center gap-2 animate-in fade-in-0 zoom-in-95 duration-300", children: [
|
|
7426
|
+
/* @__PURE__ */ jsx33(Loader24, { className: "h-6 w-6 animate-spin text-primary" }),
|
|
7427
|
+
/* @__PURE__ */ jsx33("span", { className: "text-muted-foreground", children: loadingText })
|
|
7428
|
+
] }) }) : filtered.length ? filtered.map((item, index) => {
|
|
7429
|
+
const isSelected = value.includes(item.value);
|
|
7430
|
+
const isDisabled = disabledOptions.includes(item.value);
|
|
7431
|
+
return /* @__PURE__ */ jsxs28(
|
|
7432
|
+
"li",
|
|
7433
|
+
{
|
|
7434
|
+
ref: (node) => {
|
|
7435
|
+
listRef.current[index] = node;
|
|
7436
|
+
},
|
|
7437
|
+
onClick: (e) => {
|
|
7438
|
+
e.preventDefault();
|
|
7439
|
+
e.stopPropagation();
|
|
7440
|
+
toggleSelect(item.value);
|
|
7441
|
+
inputRef.current?.focus();
|
|
7442
|
+
},
|
|
7443
|
+
style: {
|
|
7444
|
+
animationDelay: open ? `${Math.min(index * 20, 200)}ms` : "0ms"
|
|
7445
|
+
},
|
|
7446
|
+
className: cn(
|
|
7447
|
+
"dropdown-item flex cursor-pointer items-center justify-between rounded-lg transition-colors",
|
|
7448
|
+
sizeStyles8[size].item,
|
|
7449
|
+
"hover:bg-accent hover:text-accent-foreground",
|
|
7450
|
+
index === activeIndex && "bg-accent text-accent-foreground",
|
|
7451
|
+
isDisabled && "opacity-50 cursor-not-allowed pointer-events-none"
|
|
7452
|
+
),
|
|
7453
|
+
children: [
|
|
7454
|
+
item.label,
|
|
7455
|
+
isSelected && /* @__PURE__ */ jsx33(Check5, { className: sizeStyles8[size].icon })
|
|
7456
|
+
]
|
|
7457
|
+
},
|
|
7458
|
+
item.value
|
|
7459
|
+
);
|
|
7460
|
+
}) : /* @__PURE__ */ jsx33("li", { className: cn("px-3 py-8 text-center text-muted-foreground", size === "lg" ? "text-base" : size === "sm" ? "text-xs" : "text-sm"), children: /* @__PURE__ */ jsxs28("div", { className: "flex flex-col items-center gap-2 animate-in fade-in-0 zoom-in-95 duration-300", children: [
|
|
7461
|
+
/* @__PURE__ */ jsx33(SearchX2, { className: "h-8 w-8 opacity-40 text-muted-foreground" }),
|
|
7462
|
+
/* @__PURE__ */ jsx33("span", { children: emptyText }),
|
|
7463
|
+
query && /* @__PURE__ */ jsx33("button", { type: "button", onClick: () => setQuery(""), className: "text-xs text-primary hover:underline", children: "Clear search" })
|
|
7464
|
+
] }) })
|
|
7465
|
+
}
|
|
7466
|
+
)
|
|
7467
|
+
] });
|
|
7468
|
+
const triggerButton = /* @__PURE__ */ jsxs28(
|
|
7469
|
+
"button",
|
|
7470
|
+
{
|
|
7471
|
+
ref: triggerRef,
|
|
7472
|
+
type: "button",
|
|
7473
|
+
disabled,
|
|
7474
|
+
id: resolvedId,
|
|
7475
|
+
"aria-labelledby": labelId,
|
|
7476
|
+
role: "combobox",
|
|
7477
|
+
"aria-haspopup": "listbox",
|
|
7478
|
+
"aria-expanded": open,
|
|
7479
|
+
"aria-controls": listboxId,
|
|
7480
|
+
className: cn(
|
|
7481
|
+
"flex w-full items-center gap-2 rounded-xl border border-input bg-background shadow-sm min-h-10",
|
|
7482
|
+
"px-3 py-2",
|
|
7483
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
7484
|
+
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
7485
|
+
),
|
|
7486
|
+
children: [
|
|
7487
|
+
/* @__PURE__ */ jsx33("div", { className: "flex items-center gap-1 flex-wrap min-h-6 flex-1", children: value.length > 0 ? showTags ? value.map((itemValue) => {
|
|
7488
|
+
const option = normalizedOptions.find((o) => o.value === itemValue);
|
|
7489
|
+
return /* @__PURE__ */ jsxs28("span", { className: "inline-flex items-center gap-1 bg-accent text-accent-foreground rounded-lg px-2 py-1 text-xs", children: [
|
|
7490
|
+
/* @__PURE__ */ jsx33("span", { className: "truncate max-w-30", children: option ? displayFormat(option) : itemValue }),
|
|
7491
|
+
/* @__PURE__ */ jsx33(
|
|
7492
|
+
"span",
|
|
7493
|
+
{
|
|
7494
|
+
role: "button",
|
|
7495
|
+
tabIndex: 0,
|
|
7496
|
+
"aria-label": `Remove ${option ? displayFormat(option) : itemValue}`,
|
|
7497
|
+
onClick: (e) => {
|
|
7498
|
+
e.preventDefault();
|
|
7499
|
+
e.stopPropagation();
|
|
7500
|
+
handleRemove(itemValue);
|
|
7501
|
+
},
|
|
7502
|
+
onKeyDown: (e) => {
|
|
7503
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
7504
|
+
e.preventDefault();
|
|
7505
|
+
e.stopPropagation();
|
|
7506
|
+
handleRemove(itemValue);
|
|
7507
|
+
}
|
|
7508
|
+
},
|
|
7509
|
+
className: "hover:text-destructive transition-colors cursor-pointer select-none",
|
|
7510
|
+
children: "\xD7"
|
|
7511
|
+
}
|
|
7512
|
+
)
|
|
7513
|
+
] }, itemValue);
|
|
7514
|
+
}) : /* @__PURE__ */ jsxs28("span", { className: "truncate text-sm", children: [
|
|
7515
|
+
value.length,
|
|
7516
|
+
" selected"
|
|
7517
|
+
] }) : /* @__PURE__ */ jsx33("span", { className: "text-muted-foreground", children: placeholder || "Select..." }) }),
|
|
7518
|
+
/* @__PURE__ */ jsx33(
|
|
7519
|
+
ChevronDown2,
|
|
7520
|
+
{
|
|
7521
|
+
className: cn("opacity-50 transition-all duration-200", sizeStyles8[size].icon, open && "rotate-180 scale-110 text-primary opacity-100")
|
|
7522
|
+
}
|
|
7523
|
+
)
|
|
7524
|
+
]
|
|
7525
|
+
}
|
|
7526
|
+
);
|
|
7586
7527
|
return /* @__PURE__ */ jsxs28("div", { className: cn("w-full space-y-2 group", className), children: [
|
|
7587
7528
|
title && /* @__PURE__ */ jsx33("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsxs28(
|
|
7588
7529
|
"label",
|
|
@@ -7614,177 +7555,19 @@ var MultiCombobox = ({
|
|
|
7614
7555
|
]
|
|
7615
7556
|
}
|
|
7616
7557
|
),
|
|
7617
|
-
/* @__PURE__ */ jsx33(
|
|
7618
|
-
|
|
7619
|
-
"button",
|
|
7558
|
+
/* @__PURE__ */ jsx33(
|
|
7559
|
+
Popover,
|
|
7620
7560
|
{
|
|
7621
|
-
|
|
7622
|
-
|
|
7623
|
-
|
|
7624
|
-
|
|
7625
|
-
|
|
7626
|
-
|
|
7627
|
-
|
|
7628
|
-
|
|
7629
|
-
const pos = calculatePosition();
|
|
7630
|
-
if (pos) setDropdownPosition(pos);
|
|
7631
|
-
}
|
|
7632
|
-
setOpen(next);
|
|
7633
|
-
},
|
|
7634
|
-
className: cn(
|
|
7635
|
-
"flex w-full items-center gap-2 rounded-lg border border-input bg-background shadow-sm min-h-10",
|
|
7636
|
-
"px-3 py-2",
|
|
7637
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
7638
|
-
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
7639
|
-
),
|
|
7640
|
-
children: [
|
|
7641
|
-
/* @__PURE__ */ jsx33("div", { className: "flex items-center gap-1 flex-wrap min-h-6 flex-1", children: value.length > 0 ? showTags ? value.map((itemValue) => {
|
|
7642
|
-
const option = normalizedOptions.find((o) => o.value === itemValue);
|
|
7643
|
-
return /* @__PURE__ */ jsxs28("span", { className: "inline-flex items-center gap-1 bg-accent text-accent-foreground rounded px-2 py-1 text-xs", children: [
|
|
7644
|
-
/* @__PURE__ */ jsx33("span", { className: "truncate max-w-[120px]", children: option ? displayFormat(option) : itemValue }),
|
|
7645
|
-
/* @__PURE__ */ jsx33(
|
|
7646
|
-
"span",
|
|
7647
|
-
{
|
|
7648
|
-
role: "button",
|
|
7649
|
-
tabIndex: 0,
|
|
7650
|
-
"aria-label": `Remove ${option ? displayFormat(option) : itemValue}`,
|
|
7651
|
-
onClick: (e) => {
|
|
7652
|
-
e.preventDefault();
|
|
7653
|
-
e.stopPropagation();
|
|
7654
|
-
handleRemove(itemValue);
|
|
7655
|
-
},
|
|
7656
|
-
onKeyDown: (e) => {
|
|
7657
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
7658
|
-
e.preventDefault();
|
|
7659
|
-
e.stopPropagation();
|
|
7660
|
-
handleRemove(itemValue);
|
|
7661
|
-
}
|
|
7662
|
-
},
|
|
7663
|
-
className: "hover:text-destructive transition-colors cursor-pointer select-none",
|
|
7664
|
-
children: "\xD7"
|
|
7665
|
-
}
|
|
7666
|
-
)
|
|
7667
|
-
] }, itemValue);
|
|
7668
|
-
}) : /* @__PURE__ */ jsxs28("span", { className: "truncate text-sm", children: [
|
|
7669
|
-
value.length,
|
|
7670
|
-
" selected"
|
|
7671
|
-
] }) : /* @__PURE__ */ jsx33("span", { className: "text-muted-foreground", children: placeholder || "Select..." }) }),
|
|
7672
|
-
/* @__PURE__ */ jsx33(
|
|
7673
|
-
ChevronDown2,
|
|
7674
|
-
{
|
|
7675
|
-
className: cn("opacity-50 transition-all duration-200", sizeStyles8[size].icon, open && "rotate-180 scale-110 text-primary opacity-100")
|
|
7676
|
-
}
|
|
7677
|
-
)
|
|
7678
|
-
]
|
|
7561
|
+
open,
|
|
7562
|
+
onOpenChange: setOpen,
|
|
7563
|
+
trigger: triggerButton,
|
|
7564
|
+
placement: "bottom-start",
|
|
7565
|
+
matchTriggerWidth: true,
|
|
7566
|
+
className: "z-9999",
|
|
7567
|
+
contentClassName: "p-0",
|
|
7568
|
+
children: dropdownBody
|
|
7679
7569
|
}
|
|
7680
|
-
)
|
|
7681
|
-
open && dropdownPosition && typeof window !== "undefined" ? createPortal7(
|
|
7682
|
-
/* @__PURE__ */ jsx33(
|
|
7683
|
-
"div",
|
|
7684
|
-
{
|
|
7685
|
-
ref: dropdownRef,
|
|
7686
|
-
"data-combobox-dropdown": true,
|
|
7687
|
-
style: {
|
|
7688
|
-
position: "absolute",
|
|
7689
|
-
top: dropdownPosition?.top || 0,
|
|
7690
|
-
left: dropdownPosition?.left || 0,
|
|
7691
|
-
width: dropdownPosition?.width || 200,
|
|
7692
|
-
zIndex: 9999,
|
|
7693
|
-
transformOrigin: "top center"
|
|
7694
|
-
},
|
|
7695
|
-
"data-state": open ? "open" : "closed",
|
|
7696
|
-
className: "z-9999",
|
|
7697
|
-
children: /* @__PURE__ */ jsxs28(
|
|
7698
|
-
"div",
|
|
7699
|
-
{
|
|
7700
|
-
className: cn("rounded-md border bg-popover text-popover-foreground shadow-md", "backdrop-blur-sm bg-popover/95 border-border/60"),
|
|
7701
|
-
children: [
|
|
7702
|
-
showClear && value.length > 0 && /* @__PURE__ */ jsx33("div", { className: "px-3 py-2 border-b border-border/60 flex justify-end", children: /* @__PURE__ */ jsx33(
|
|
7703
|
-
"button",
|
|
7704
|
-
{
|
|
7705
|
-
type: "button",
|
|
7706
|
-
onClick: (e) => {
|
|
7707
|
-
e.preventDefault();
|
|
7708
|
-
e.stopPropagation();
|
|
7709
|
-
handleClearAll();
|
|
7710
|
-
},
|
|
7711
|
-
className: "text-xs text-muted-foreground hover:underline cursor-pointer",
|
|
7712
|
-
children: "Clear all"
|
|
7713
|
-
}
|
|
7714
|
-
) }),
|
|
7715
|
-
enableSearch && /* @__PURE__ */ jsxs28("div", { className: "relative border-b border-border/60", children: [
|
|
7716
|
-
/* @__PURE__ */ jsx33(Search4, { className: cn("absolute left-2 top-2.5 text-muted-foreground", sizeStyles8[size].icon) }),
|
|
7717
|
-
/* @__PURE__ */ jsx33(
|
|
7718
|
-
"input",
|
|
7719
|
-
{
|
|
7720
|
-
ref: inputRef,
|
|
7721
|
-
value: query,
|
|
7722
|
-
onChange: (e) => {
|
|
7723
|
-
setQuery(e.target.value);
|
|
7724
|
-
setActiveIndex(null);
|
|
7725
|
-
},
|
|
7726
|
-
onKeyDown: handleKeyDown,
|
|
7727
|
-
placeholder,
|
|
7728
|
-
className: cn("w-full rounded-t-md bg-transparent focus:outline-none cursor-text", sizeStyles8[size].search)
|
|
7729
|
-
}
|
|
7730
|
-
)
|
|
7731
|
-
] }),
|
|
7732
|
-
/* @__PURE__ */ jsx33("ul", { className: cn("max-h-60 overflow-y-auto p-1", size === "lg" ? "text-base" : size === "sm" ? "text-xs" : "text-sm"), children: loading2 ? /* @__PURE__ */ jsx33("li", { className: "px-3 py-8 text-center", children: /* @__PURE__ */ jsxs28("div", { className: "flex flex-col items-center gap-2 animate-in fade-in-0 zoom-in-95 duration-300", children: [
|
|
7733
|
-
/* @__PURE__ */ jsx33(Loader24, { className: "h-6 w-6 animate-spin text-primary" }),
|
|
7734
|
-
/* @__PURE__ */ jsx33("span", { className: "text-muted-foreground", children: loadingText })
|
|
7735
|
-
] }) }) : filtered.length ? filtered.map((item, index) => {
|
|
7736
|
-
const isSelected = value.includes(item.value);
|
|
7737
|
-
const isDisabled = disabledOptions.includes(item.value);
|
|
7738
|
-
return /* @__PURE__ */ jsxs28(
|
|
7739
|
-
"li",
|
|
7740
|
-
{
|
|
7741
|
-
ref: (node) => {
|
|
7742
|
-
listRef.current[index] = node;
|
|
7743
|
-
},
|
|
7744
|
-
onClick: (e) => {
|
|
7745
|
-
e.preventDefault();
|
|
7746
|
-
e.stopPropagation();
|
|
7747
|
-
toggleSelect(item.value);
|
|
7748
|
-
inputRef.current?.focus();
|
|
7749
|
-
},
|
|
7750
|
-
style: {
|
|
7751
|
-
animationDelay: open ? `${Math.min(index * 20, 200)}ms` : "0ms"
|
|
7752
|
-
},
|
|
7753
|
-
className: cn(
|
|
7754
|
-
"dropdown-item flex cursor-pointer items-center justify-between rounded-sm transition-colors",
|
|
7755
|
-
sizeStyles8[size].item,
|
|
7756
|
-
"hover:bg-accent hover:text-accent-foreground",
|
|
7757
|
-
index === activeIndex && "bg-accent text-accent-foreground",
|
|
7758
|
-
isDisabled && "opacity-50 cursor-not-allowed pointer-events-none"
|
|
7759
|
-
),
|
|
7760
|
-
children: [
|
|
7761
|
-
item.label,
|
|
7762
|
-
isSelected && /* @__PURE__ */ jsx33(Check5, { className: sizeStyles8[size].icon })
|
|
7763
|
-
]
|
|
7764
|
-
},
|
|
7765
|
-
item.value
|
|
7766
|
-
);
|
|
7767
|
-
}) : /* @__PURE__ */ jsx33(
|
|
7768
|
-
"li",
|
|
7769
|
-
{
|
|
7770
|
-
className: cn(
|
|
7771
|
-
"px-3 py-8 text-center text-muted-foreground",
|
|
7772
|
-
size === "lg" ? "text-base" : size === "sm" ? "text-xs" : "text-sm"
|
|
7773
|
-
),
|
|
7774
|
-
children: /* @__PURE__ */ jsxs28("div", { className: "flex flex-col items-center gap-2 animate-in fade-in-0 zoom-in-95 duration-300", children: [
|
|
7775
|
-
/* @__PURE__ */ jsx33(SearchX2, { className: "h-8 w-8 opacity-40 text-muted-foreground" }),
|
|
7776
|
-
/* @__PURE__ */ jsx33("span", { children: emptyText }),
|
|
7777
|
-
query && /* @__PURE__ */ jsx33("button", { type: "button", onClick: () => setQuery(""), className: "text-xs text-primary hover:underline", children: "Clear search" })
|
|
7778
|
-
] })
|
|
7779
|
-
}
|
|
7780
|
-
) })
|
|
7781
|
-
]
|
|
7782
|
-
}
|
|
7783
|
-
)
|
|
7784
|
-
}
|
|
7785
|
-
),
|
|
7786
|
-
document.body
|
|
7787
|
-
) : null
|
|
7570
|
+
)
|
|
7788
7571
|
] });
|
|
7789
7572
|
};
|
|
7790
7573
|
|
|
@@ -7886,14 +7669,7 @@ var sizeStyles7 = {
|
|
|
7886
7669
|
};
|
|
7887
7670
|
var RadioGroupItem = React28.forwardRef(
|
|
7888
7671
|
({ value, id, disabled, className, children, label, description, icon }, ref) => {
|
|
7889
|
-
const {
|
|
7890
|
-
value: selectedValue,
|
|
7891
|
-
onValueChange,
|
|
7892
|
-
name,
|
|
7893
|
-
disabled: groupDisabled,
|
|
7894
|
-
size = "md",
|
|
7895
|
-
variant = "default"
|
|
7896
|
-
} = useRadioGroup();
|
|
7672
|
+
const { value: selectedValue, onValueChange, name, disabled: groupDisabled, size = "md", variant = "default" } = useRadioGroup();
|
|
7897
7673
|
const isDisabled = disabled || groupDisabled;
|
|
7898
7674
|
const isSelected = selectedValue === value;
|
|
7899
7675
|
const Icon = icon;
|
|
@@ -7903,7 +7679,7 @@ var RadioGroupItem = React28.forwardRef(
|
|
|
7903
7679
|
"div",
|
|
7904
7680
|
{
|
|
7905
7681
|
className: cn(
|
|
7906
|
-
"relative rounded-
|
|
7682
|
+
"relative rounded-xl border transition-all duration-200 cursor-pointer",
|
|
7907
7683
|
"hover:bg-accent/50 focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",
|
|
7908
7684
|
isSelected && "border-primary bg-primary/5 ring-1 ring-primary/20",
|
|
7909
7685
|
isDisabled && "cursor-not-allowed opacity-50",
|
|
@@ -7934,10 +7710,7 @@ var RadioGroupItem = React28.forwardRef(
|
|
|
7934
7710
|
children: /* @__PURE__ */ jsx34(
|
|
7935
7711
|
"span",
|
|
7936
7712
|
{
|
|
7937
|
-
className: cn(
|
|
7938
|
-
"flex items-center justify-center w-full h-full rounded-full transition-all duration-200",
|
|
7939
|
-
isSelected && "bg-primary"
|
|
7940
|
-
),
|
|
7713
|
+
className: cn("flex items-center justify-center w-full h-full rounded-full transition-all duration-200", isSelected && "bg-primary"),
|
|
7941
7714
|
children: isSelected && /* @__PURE__ */ jsx34("span", { className: cn("bg-primary-foreground rounded-full", sizeStyles7[size].dot) })
|
|
7942
7715
|
}
|
|
7943
7716
|
)
|
|
@@ -7946,17 +7719,7 @@ var RadioGroupItem = React28.forwardRef(
|
|
|
7946
7719
|
/* @__PURE__ */ jsxs29("div", { className: "flex-1 min-w-0", children: [
|
|
7947
7720
|
/* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-2", children: [
|
|
7948
7721
|
Icon && /* @__PURE__ */ jsx34(Icon, { className: "h-4 w-4 text-foreground" }),
|
|
7949
|
-
/* @__PURE__ */ jsx34(
|
|
7950
|
-
"label",
|
|
7951
|
-
{
|
|
7952
|
-
htmlFor: radioId,
|
|
7953
|
-
className: cn(
|
|
7954
|
-
"font-medium text-foreground cursor-pointer",
|
|
7955
|
-
sizeStyles7[size].text
|
|
7956
|
-
),
|
|
7957
|
-
children: label || children
|
|
7958
|
-
}
|
|
7959
|
-
)
|
|
7722
|
+
/* @__PURE__ */ jsx34("label", { htmlFor: radioId, className: cn("font-medium text-foreground cursor-pointer", sizeStyles7[size].text), children: label || children })
|
|
7960
7723
|
] }),
|
|
7961
7724
|
description && /* @__PURE__ */ jsx34("p", { className: "text-muted-foreground mt-1 text-xs", children: description })
|
|
7962
7725
|
] })
|
|
@@ -7991,7 +7754,7 @@ var RadioGroupItem = React28.forwardRef(
|
|
|
7991
7754
|
id: radioId,
|
|
7992
7755
|
disabled: isDisabled,
|
|
7993
7756
|
className: cn(
|
|
7994
|
-
"inline-flex items-center justify-center gap-2 rounded-
|
|
7757
|
+
"inline-flex items-center justify-center gap-2 rounded-lg border font-medium transition-all duration-200",
|
|
7995
7758
|
"focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
7996
7759
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
7997
7760
|
isSelected ? "border-primary bg-primary text-primary-foreground shadow-sm" : "border-border bg-background hover:bg-accent hover:text-accent-foreground",
|
|
@@ -8040,16 +7803,7 @@ var RadioGroupItem = React28.forwardRef(
|
|
|
8040
7803
|
sizeStyles7[size].radio
|
|
8041
7804
|
),
|
|
8042
7805
|
onClick: () => onValueChange?.(value),
|
|
8043
|
-
children: /* @__PURE__ */ jsx34(
|
|
8044
|
-
"span",
|
|
8045
|
-
{
|
|
8046
|
-
className: cn(
|
|
8047
|
-
"flex items-center justify-center w-full h-full rounded-full transition-all duration-200",
|
|
8048
|
-
isSelected && "bg-primary"
|
|
8049
|
-
),
|
|
8050
|
-
children: isSelected && /* @__PURE__ */ jsx34("span", { className: cn("bg-primary-foreground rounded-full", sizeStyles7[size].dot) })
|
|
8051
|
-
}
|
|
8052
|
-
)
|
|
7806
|
+
children: /* @__PURE__ */ jsx34("span", { className: cn("flex items-center justify-center w-full h-full rounded-full transition-all duration-200", isSelected && "bg-primary"), children: isSelected && /* @__PURE__ */ jsx34("span", { className: cn("bg-primary-foreground rounded-full", sizeStyles7[size].dot) }) })
|
|
8053
7807
|
}
|
|
8054
7808
|
),
|
|
8055
7809
|
(label || children) && /* @__PURE__ */ jsxs29(
|
|
@@ -8455,7 +8209,7 @@ function OverlayControls({
|
|
|
8455
8209
|
"absolute inset-0 flex items-center pointer-events-none z-50",
|
|
8456
8210
|
keyboardFeedback.type === "seek" && (keyboardFeedback.value ?? 0) > 0 ? "justify-end pr-32" : keyboardFeedback.type === "seek" && (keyboardFeedback.value ?? 0) < 0 ? "justify-start pl-32" : "justify-center"
|
|
8457
8211
|
),
|
|
8458
|
-
children: /* @__PURE__ */ jsxs31("div", { className: "bg-black/50 backdrop-blur-sm rounded-
|
|
8212
|
+
children: /* @__PURE__ */ jsxs31("div", { className: "bg-black/50 backdrop-blur-sm rounded-2xl px-6 py-4 shadow-xl border border-white/10 animate-in fade-in zoom-in duration-200", children: [
|
|
8459
8213
|
keyboardFeedback.type === "play" && /* @__PURE__ */ jsx36(Play, { className: "w-16 h-16 text-white", fill: "white" }),
|
|
8460
8214
|
keyboardFeedback.type === "pause" && /* @__PURE__ */ jsx36(Pause, { className: "w-16 h-16 text-white", fill: "white" }),
|
|
8461
8215
|
keyboardFeedback.type === "seek" && /* @__PURE__ */ jsxs31("div", { className: "flex items-center gap-3", children: [
|
|
@@ -8517,7 +8271,7 @@ function OverlayControls({
|
|
|
8517
8271
|
noFocus: true
|
|
8518
8272
|
}
|
|
8519
8273
|
),
|
|
8520
|
-
previewData && /* @__PURE__ */ jsx36("div", { className: "absolute bottom-full mb-2 transform -translate-x-1/2 pointer-events-none z-30", style: { left: `${previewData.x}px` }, children: previewData.url ? /* @__PURE__ */ jsxs31("div", { className: "bg-background/95 backdrop-blur rounded-
|
|
8274
|
+
previewData && /* @__PURE__ */ jsx36("div", { className: "absolute bottom-full mb-2 transform -translate-x-1/2 pointer-events-none z-30", style: { left: `${previewData.x}px` }, children: previewData.url ? /* @__PURE__ */ jsxs31("div", { className: "bg-background/95 backdrop-blur rounded-xl border border-border shadow-lg overflow-hidden", children: [
|
|
8521
8275
|
/* @__PURE__ */ jsx36("img", { src: previewData.url, alt: "Preview", className: "w-40 h-24 object-cover" }),
|
|
8522
8276
|
/* @__PURE__ */ jsx36("div", { className: "px-2 py-1 text-xs font-mono text-center bg-background/80", children: formatTime3(previewData.time) })
|
|
8523
8277
|
] }) : /* @__PURE__ */ jsx36("div", { className: "px-3 py-1.5 rounded-md bg-background/90 backdrop-blur border border-border shadow-lg", children: /* @__PURE__ */ jsx36("div", { className: "text-xs font-mono text-center", children: formatTime3(previewData.time) }) }) })
|
|
@@ -8626,7 +8380,7 @@ function OverlayControls({
|
|
|
8626
8380
|
onChangeRate(r);
|
|
8627
8381
|
setRateOpen(false);
|
|
8628
8382
|
},
|
|
8629
|
-
className: cn("block w-full text-left px-3 py-1 text-sm rounded hover:bg-accent", rate === r && "bg-accent"),
|
|
8383
|
+
className: cn("block w-full text-left px-3 py-1 text-sm rounded-lg hover:bg-accent", rate === r && "bg-accent"),
|
|
8630
8384
|
children: [
|
|
8631
8385
|
r,
|
|
8632
8386
|
"x"
|
|
@@ -8749,7 +8503,7 @@ function CategoryTreeSelect(props) {
|
|
|
8749
8503
|
!viewOnly && "cursor-pointer",
|
|
8750
8504
|
!viewOnly && !isSelected && "hover:bg-accent/60 hover:shadow-sm",
|
|
8751
8505
|
// Selected state
|
|
8752
|
-
!viewOnly && isSelected && "bg-
|
|
8506
|
+
!viewOnly && isSelected && "bg-linear-to-r from-primary/15 via-primary/10 to-primary/5 shadow-sm"
|
|
8753
8507
|
),
|
|
8754
8508
|
style: { paddingLeft: `${level * 1.25 + 0.75}rem` },
|
|
8755
8509
|
children: [
|
|
@@ -8757,7 +8511,7 @@ function CategoryTreeSelect(props) {
|
|
|
8757
8511
|
"span",
|
|
8758
8512
|
{
|
|
8759
8513
|
"aria-hidden": true,
|
|
8760
|
-
className: "absolute left-0 top-2 bottom-2 w-1 rounded-full bg-
|
|
8514
|
+
className: "absolute left-0 top-2 bottom-2 w-1 rounded-full bg-linear-to-b from-primary to-primary/70 shadow-sm shadow-primary/30"
|
|
8761
8515
|
}
|
|
8762
8516
|
),
|
|
8763
8517
|
hasChildren ? /* @__PURE__ */ jsx37(
|
|
@@ -8793,7 +8547,7 @@ function CategoryTreeSelect(props) {
|
|
|
8793
8547
|
"w-5 h-5 border-2 rounded-full flex items-center justify-center transition-all duration-200",
|
|
8794
8548
|
isSelected ? "border-primary bg-primary/10 shadow-sm shadow-primary/20" : "border-muted-foreground/30 hover:border-primary/50"
|
|
8795
8549
|
),
|
|
8796
|
-
children: isSelected && /* @__PURE__ */ jsx37("div", { className: "w-2.5 h-2.5 rounded-full bg-
|
|
8550
|
+
children: isSelected && /* @__PURE__ */ jsx37("div", { className: "w-2.5 h-2.5 rounded-full bg-linear-to-br from-primary to-primary/80 shadow-sm" })
|
|
8797
8551
|
}
|
|
8798
8552
|
),
|
|
8799
8553
|
/* @__PURE__ */ jsx37(
|
|
@@ -8816,7 +8570,7 @@ function CategoryTreeSelect(props) {
|
|
|
8816
8570
|
{
|
|
8817
8571
|
className: cn(
|
|
8818
8572
|
"w-5 h-5 border-2 rounded-lg flex items-center justify-center transition-all duration-200",
|
|
8819
|
-
isSelected ? "bg-
|
|
8573
|
+
isSelected ? "bg-linear-to-br from-primary to-primary/80 border-primary shadow-sm shadow-primary/25" : "border-muted-foreground/30 hover:border-primary/50 hover:bg-primary/5"
|
|
8820
8574
|
),
|
|
8821
8575
|
children: isSelected && /* @__PURE__ */ jsx37(Check6, { className: "w-3 h-3 text-primary-foreground", strokeWidth: 3 })
|
|
8822
8576
|
}
|
|
@@ -8919,7 +8673,7 @@ function CategoryTreeSelect(props) {
|
|
|
8919
8673
|
}
|
|
8920
8674
|
|
|
8921
8675
|
// ../../components/ui/ImageUpload.tsx
|
|
8922
|
-
import { useState as useState27, useRef as useRef12, useCallback as
|
|
8676
|
+
import { useState as useState27, useRef as useRef12, useCallback as useCallback9 } from "react";
|
|
8923
8677
|
import { Upload, X as X11, Image as ImageIcon, Loader2 as Loader25, Check as Check7 } from "lucide-react";
|
|
8924
8678
|
import { jsx as jsx38, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
8925
8679
|
function ImageUpload({
|
|
@@ -8948,7 +8702,7 @@ function ImageUpload({
|
|
|
8948
8702
|
md: "w-24 h-24",
|
|
8949
8703
|
lg: "w-32 h-32"
|
|
8950
8704
|
};
|
|
8951
|
-
const handleDragOver =
|
|
8705
|
+
const handleDragOver = useCallback9(
|
|
8952
8706
|
(e) => {
|
|
8953
8707
|
e.preventDefault();
|
|
8954
8708
|
if (!disabled) {
|
|
@@ -8957,11 +8711,11 @@ function ImageUpload({
|
|
|
8957
8711
|
},
|
|
8958
8712
|
[disabled]
|
|
8959
8713
|
);
|
|
8960
|
-
const handleDragLeave =
|
|
8714
|
+
const handleDragLeave = useCallback9((e) => {
|
|
8961
8715
|
e.preventDefault();
|
|
8962
8716
|
setIsDragging(false);
|
|
8963
8717
|
}, []);
|
|
8964
|
-
const handleFiles =
|
|
8718
|
+
const handleFiles = useCallback9(
|
|
8965
8719
|
async (files) => {
|
|
8966
8720
|
if (files.length === 0) return;
|
|
8967
8721
|
const validFiles = files.filter((file) => {
|
|
@@ -9028,7 +8782,7 @@ function ImageUpload({
|
|
|
9028
8782
|
},
|
|
9029
8783
|
[maxSize, addToast, onUpload]
|
|
9030
8784
|
);
|
|
9031
|
-
const handleDrop =
|
|
8785
|
+
const handleDrop = useCallback9(
|
|
9032
8786
|
(e) => {
|
|
9033
8787
|
e.preventDefault();
|
|
9034
8788
|
setIsDragging(false);
|
|
@@ -9038,7 +8792,7 @@ function ImageUpload({
|
|
|
9038
8792
|
},
|
|
9039
8793
|
[disabled, handleFiles]
|
|
9040
8794
|
);
|
|
9041
|
-
const handleFileSelect =
|
|
8795
|
+
const handleFileSelect = useCallback9(
|
|
9042
8796
|
(e) => {
|
|
9043
8797
|
const files = Array.from(e.target.files || []);
|
|
9044
8798
|
handleFiles(files);
|
|
@@ -9060,7 +8814,7 @@ function ImageUpload({
|
|
|
9060
8814
|
"div",
|
|
9061
8815
|
{
|
|
9062
8816
|
className: cn(
|
|
9063
|
-
"relative border-2 border-dashed rounded-
|
|
8817
|
+
"relative border-2 border-dashed rounded-xl p-8 text-center transition-all duration-200",
|
|
9064
8818
|
isDragging && !disabled ? "border-primary bg-primary/5 scale-[1.02]" : "border-border hover:border-primary/50",
|
|
9065
8819
|
disabled && "opacity-50 cursor-not-allowed",
|
|
9066
8820
|
uploading && "pointer-events-none"
|
|
@@ -9069,7 +8823,7 @@ function ImageUpload({
|
|
|
9069
8823
|
onDragLeave: handleDragLeave,
|
|
9070
8824
|
onDrop: handleDrop,
|
|
9071
8825
|
children: [
|
|
9072
|
-
uploading && /* @__PURE__ */ jsx38("div", { className: "absolute inset-0 bg-background/80 flex items-center justify-center rounded-
|
|
8826
|
+
uploading && /* @__PURE__ */ jsx38("div", { className: "absolute inset-0 bg-background/80 flex items-center justify-center rounded-xl", children: /* @__PURE__ */ jsxs33("div", { className: "flex items-center gap-3", children: [
|
|
9073
8827
|
/* @__PURE__ */ jsx38(Loader25, { className: "w-6 h-6 animate-spin text-primary" }),
|
|
9074
8828
|
/* @__PURE__ */ jsx38("span", { className: "text-sm font-medium", children: "Uploading..." })
|
|
9075
8829
|
] }) }),
|
|
@@ -9098,7 +8852,7 @@ function ImageUpload({
|
|
|
9098
8852
|
),
|
|
9099
8853
|
showPreview && uploadedImages.length > 0 && /* @__PURE__ */ jsxs33("div", { className: "space-y-3", children: [
|
|
9100
8854
|
/* @__PURE__ */ jsx38("h4", { className: "text-sm font-medium", children: "Uploaded Images" }),
|
|
9101
|
-
/* @__PURE__ */ jsx38("div", { className: "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4", children: uploadedImages.map((image) => /* @__PURE__ */ jsxs33("div", { className: "relative group bg-card border border-border rounded-
|
|
8855
|
+
/* @__PURE__ */ jsx38("div", { className: "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4", children: uploadedImages.map((image) => /* @__PURE__ */ jsxs33("div", { className: "relative group bg-card border border-border rounded-xl p-3", children: [
|
|
9102
8856
|
/* @__PURE__ */ jsx38(
|
|
9103
8857
|
Button_default,
|
|
9104
8858
|
{
|
|
@@ -9109,7 +8863,7 @@ function ImageUpload({
|
|
|
9109
8863
|
children: /* @__PURE__ */ jsx38(X11, { className: "w-3 h-3" })
|
|
9110
8864
|
}
|
|
9111
8865
|
),
|
|
9112
|
-
/* @__PURE__ */ jsxs33("div", { className: cn("mx-auto mb-2 overflow-hidden rounded-
|
|
8866
|
+
/* @__PURE__ */ jsxs33("div", { className: cn("mx-auto mb-2 overflow-hidden rounded-lg", previewSizes[previewSize]), children: [
|
|
9113
8867
|
/* @__PURE__ */ jsx38(
|
|
9114
8868
|
"img",
|
|
9115
8869
|
{
|
|
@@ -9305,7 +9059,7 @@ function Carousel({
|
|
|
9305
9059
|
"div",
|
|
9306
9060
|
{
|
|
9307
9061
|
ref: carouselRef,
|
|
9308
|
-
className: cn("relative w-full overflow-hidden focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 rounded-
|
|
9062
|
+
className: cn("relative w-full overflow-hidden focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 rounded-2xl", className),
|
|
9309
9063
|
onMouseEnter: () => setIsPaused(true),
|
|
9310
9064
|
onMouseLeave: () => setIsPaused(false),
|
|
9311
9065
|
role: "region",
|
|
@@ -9424,7 +9178,7 @@ function Carousel({
|
|
|
9424
9178
|
{
|
|
9425
9179
|
onClick: () => scrollTo(idx),
|
|
9426
9180
|
className: cn(
|
|
9427
|
-
"shrink-0 w-16 h-16 rounded-
|
|
9181
|
+
"shrink-0 w-16 h-16 rounded-lg overflow-hidden border-2 transition-all focus:outline-none focus:ring-2 focus:ring-primary",
|
|
9428
9182
|
idx === currentIndex ? "border-primary scale-110" : "border-transparent opacity-70 hover:opacity-100"
|
|
9429
9183
|
),
|
|
9430
9184
|
"aria-label": `Thumbnail ${idx + 1}`,
|
|
@@ -9536,24 +9290,16 @@ function FallingIcons({
|
|
|
9536
9290
|
filter: `drop-shadow(0 0 ${4 * intensity}px ${glowColor}) drop-shadow(0 0 ${8 * intensity}px ${glowColor})`
|
|
9537
9291
|
};
|
|
9538
9292
|
}, [glow, glowColor, glowIntensity]);
|
|
9539
|
-
const FallbackIcon = React33.useMemo(
|
|
9540
|
-
|
|
9541
|
-
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
alt: "",
|
|
9545
|
-
className: cn("w-full h-full object-cover rounded-sm", imgClassName),
|
|
9546
|
-
draggable: false
|
|
9547
|
-
}
|
|
9548
|
-
) : Icon || FallbackIcon;
|
|
9293
|
+
const FallbackIcon = React33.useMemo(
|
|
9294
|
+
() => (props) => /* @__PURE__ */ jsx40("svg", { viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", ...props, children: /* @__PURE__ */ jsx40("circle", { cx: "12", cy: "12", r: "10" }) }),
|
|
9295
|
+
[]
|
|
9296
|
+
);
|
|
9297
|
+
const TheIcon = imageUrl ? ({ className: imgClassName }) => /* @__PURE__ */ jsx40("img", { src: imageUrl, alt: "", className: cn("w-full h-full object-cover rounded-lg", imgClassName), draggable: false }) : Icon || FallbackIcon;
|
|
9549
9298
|
return /* @__PURE__ */ jsxs35(
|
|
9550
9299
|
"div",
|
|
9551
9300
|
{
|
|
9552
9301
|
ref: containerRef,
|
|
9553
|
-
className: cn(
|
|
9554
|
-
fullScreen ? "fixed inset-0 overflow-hidden pointer-events-none" : "relative w-full h-full overflow-hidden",
|
|
9555
|
-
areaClassName
|
|
9556
|
-
),
|
|
9302
|
+
className: cn(fullScreen ? "fixed inset-0 overflow-hidden pointer-events-none" : "relative w-full h-full overflow-hidden", areaClassName),
|
|
9557
9303
|
style: { zIndex },
|
|
9558
9304
|
children: [
|
|
9559
9305
|
/* @__PURE__ */ jsx40("style", { children: `
|
|
@@ -9589,141 +9335,131 @@ function FallingIcons({
|
|
|
9589
9335
|
}
|
|
9590
9336
|
}
|
|
9591
9337
|
` }),
|
|
9592
|
-
/* @__PURE__ */ jsx40(
|
|
9593
|
-
|
|
9594
|
-
|
|
9595
|
-
|
|
9596
|
-
|
|
9597
|
-
|
|
9598
|
-
|
|
9599
|
-
|
|
9600
|
-
|
|
9601
|
-
|
|
9602
|
-
|
|
9603
|
-
|
|
9604
|
-
|
|
9605
|
-
|
|
9606
|
-
|
|
9607
|
-
|
|
9608
|
-
|
|
9609
|
-
|
|
9610
|
-
|
|
9611
|
-
|
|
9612
|
-
|
|
9613
|
-
|
|
9614
|
-
|
|
9615
|
-
|
|
9616
|
-
|
|
9617
|
-
|
|
9618
|
-
|
|
9338
|
+
/* @__PURE__ */ jsx40("div", { className: cn("absolute inset-0 pointer-events-none", className), "aria-hidden": true, children: particles.map((p, i) => {
|
|
9339
|
+
const swayDuration = p.fallDur * (0.8 + i % 5 * 0.05);
|
|
9340
|
+
const spinDuration = Math.max(1, p.spinDur);
|
|
9341
|
+
const handlePop = () => {
|
|
9342
|
+
setParticles((prev) => {
|
|
9343
|
+
const next = prev.slice();
|
|
9344
|
+
const np = makeParticle();
|
|
9345
|
+
np.delay = -Math.random() * 8;
|
|
9346
|
+
next[i] = np;
|
|
9347
|
+
return next;
|
|
9348
|
+
});
|
|
9349
|
+
};
|
|
9350
|
+
const trailParticles = trail ? Array.from({ length: Math.min(5, Math.max(1, trailLength)) }) : [];
|
|
9351
|
+
return /* @__PURE__ */ jsxs35(React33.Fragment, { children: [
|
|
9352
|
+
trail && trailParticles.map((_, trailIndex) => {
|
|
9353
|
+
const trailDelay = p.delay - (trailIndex + 1) * 0.15;
|
|
9354
|
+
const trailOpacity = 1 - (trailIndex + 1) * (1 / (trailParticles.length + 1));
|
|
9355
|
+
const trailScale = 1 - (trailIndex + 1) * 0.15;
|
|
9356
|
+
return /* @__PURE__ */ jsx40(
|
|
9357
|
+
"span",
|
|
9358
|
+
{
|
|
9359
|
+
className: cn("absolute top-0 will-change-transform pointer-events-none uv-falling-particle", colorClassName),
|
|
9360
|
+
style: {
|
|
9361
|
+
left: `${p.leftPct}%`,
|
|
9362
|
+
animationDelay: `${trailDelay}s`,
|
|
9363
|
+
animationDuration: `${p.fallDur}s`,
|
|
9364
|
+
animationName: FallName,
|
|
9365
|
+
animationTimingFunction: easingMap[easingFunction] || "linear",
|
|
9366
|
+
animationIterationCount: "infinite",
|
|
9367
|
+
opacity: trailOpacity * 0.4,
|
|
9368
|
+
["--fall"]: `${fallDist ?? (typeof window !== "undefined" ? window.innerHeight + 200 : 1200)}px`
|
|
9369
|
+
},
|
|
9370
|
+
children: /* @__PURE__ */ jsx40(
|
|
9619
9371
|
"span",
|
|
9620
9372
|
{
|
|
9621
|
-
className:
|
|
9373
|
+
className: "inline-block uv-sway",
|
|
9622
9374
|
style: {
|
|
9623
|
-
|
|
9624
|
-
|
|
9625
|
-
animationDuration: `${
|
|
9626
|
-
|
|
9627
|
-
animationTimingFunction: easingMap[easingFunction] || "linear",
|
|
9375
|
+
transform: `translateX(-50%) scale(${trailScale})`,
|
|
9376
|
+
animationName: SwayName,
|
|
9377
|
+
animationDuration: `${swayDuration}s`,
|
|
9378
|
+
animationTimingFunction: "ease-in-out",
|
|
9628
9379
|
animationIterationCount: "infinite",
|
|
9629
|
-
|
|
9630
|
-
["--fall"]: `${fallDist ?? (typeof window !== "undefined" ? window.innerHeight + 200 : 1200)}px`
|
|
9380
|
+
["--amp"]: `${Math.round(p.driftAmp)}px`
|
|
9631
9381
|
},
|
|
9632
9382
|
children: /* @__PURE__ */ jsx40(
|
|
9633
9383
|
"span",
|
|
9634
9384
|
{
|
|
9635
|
-
className: "
|
|
9385
|
+
className: "block",
|
|
9636
9386
|
style: {
|
|
9637
|
-
|
|
9638
|
-
|
|
9639
|
-
|
|
9640
|
-
animationTimingFunction: "ease-in-out",
|
|
9641
|
-
animationIterationCount: "infinite",
|
|
9642
|
-
["--amp"]: `${Math.round(p.driftAmp)}px`
|
|
9387
|
+
width: p.size,
|
|
9388
|
+
height: p.size,
|
|
9389
|
+
...glowStyles
|
|
9643
9390
|
},
|
|
9644
|
-
children: /* @__PURE__ */ jsx40(
|
|
9645
|
-
"span",
|
|
9646
|
-
{
|
|
9647
|
-
className: "block",
|
|
9648
|
-
style: {
|
|
9649
|
-
width: p.size,
|
|
9650
|
-
height: p.size,
|
|
9651
|
-
...glowStyles
|
|
9652
|
-
},
|
|
9653
|
-
children: /* @__PURE__ */ jsx40(TheIcon, { className: cn("w-full h-full text-primary/70", colorClassName) })
|
|
9654
|
-
}
|
|
9655
|
-
)
|
|
9391
|
+
children: /* @__PURE__ */ jsx40(TheIcon, { className: cn("w-full h-full text-primary/70", colorClassName) })
|
|
9656
9392
|
}
|
|
9657
9393
|
)
|
|
9658
|
-
}
|
|
9659
|
-
|
|
9660
|
-
|
|
9661
|
-
}
|
|
9662
|
-
|
|
9394
|
+
}
|
|
9395
|
+
)
|
|
9396
|
+
},
|
|
9397
|
+
`${p.key}-trail-${trailIndex}`
|
|
9398
|
+
);
|
|
9399
|
+
}),
|
|
9400
|
+
/* @__PURE__ */ jsx40(
|
|
9401
|
+
"span",
|
|
9402
|
+
{
|
|
9403
|
+
className: cn("absolute top-0 will-change-transform pointer-events-auto uv-falling-particle", colorClassName),
|
|
9404
|
+
style: {
|
|
9405
|
+
left: `${p.leftPct}%`,
|
|
9406
|
+
animationDelay: `${p.delay}s`,
|
|
9407
|
+
animationDuration: `${p.fallDur}s`,
|
|
9408
|
+
animationName: FallName,
|
|
9409
|
+
animationTimingFunction: easingMap[easingFunction] || "linear",
|
|
9410
|
+
animationIterationCount: "infinite",
|
|
9411
|
+
["--fall"]: `${fallDist ?? (typeof window !== "undefined" ? window.innerHeight + 200 : 1200)}px`
|
|
9412
|
+
},
|
|
9413
|
+
onMouseEnter: handlePop,
|
|
9414
|
+
onAnimationIteration: (ev) => {
|
|
9415
|
+
if (ev.currentTarget !== ev.target) return;
|
|
9416
|
+
if (!randomizeEachLoop) return;
|
|
9417
|
+
if (ev.animationName !== FallName) return;
|
|
9418
|
+
setParticles((prev) => {
|
|
9419
|
+
const next = prev.slice();
|
|
9420
|
+
const np = makeParticle();
|
|
9421
|
+
np.delay = -Math.random() * 4;
|
|
9422
|
+
next[i] = np;
|
|
9423
|
+
return next;
|
|
9424
|
+
});
|
|
9425
|
+
},
|
|
9426
|
+
children: /* @__PURE__ */ jsx40(
|
|
9663
9427
|
"span",
|
|
9664
9428
|
{
|
|
9665
|
-
className:
|
|
9429
|
+
className: "inline-block uv-sway",
|
|
9666
9430
|
style: {
|
|
9667
|
-
|
|
9668
|
-
|
|
9669
|
-
animationDuration: `${
|
|
9670
|
-
|
|
9671
|
-
animationTimingFunction: easingMap[easingFunction] || "linear",
|
|
9431
|
+
transform: `translateX(-50%)`,
|
|
9432
|
+
animationName: SwayName,
|
|
9433
|
+
animationDuration: `${swayDuration}s`,
|
|
9434
|
+
animationTimingFunction: "ease-in-out",
|
|
9672
9435
|
animationIterationCount: "infinite",
|
|
9673
|
-
["--
|
|
9674
|
-
},
|
|
9675
|
-
onMouseEnter: handlePop,
|
|
9676
|
-
onAnimationIteration: (ev) => {
|
|
9677
|
-
if (ev.currentTarget !== ev.target) return;
|
|
9678
|
-
if (!randomizeEachLoop) return;
|
|
9679
|
-
if (ev.animationName !== FallName) return;
|
|
9680
|
-
setParticles((prev) => {
|
|
9681
|
-
const next = prev.slice();
|
|
9682
|
-
const np = makeParticle();
|
|
9683
|
-
np.delay = -Math.random() * 4;
|
|
9684
|
-
next[i] = np;
|
|
9685
|
-
return next;
|
|
9686
|
-
});
|
|
9436
|
+
["--amp"]: `${Math.round(p.driftAmp)}px`
|
|
9687
9437
|
},
|
|
9688
9438
|
children: /* @__PURE__ */ jsx40(
|
|
9689
9439
|
"span",
|
|
9690
9440
|
{
|
|
9691
|
-
className:
|
|
9441
|
+
className: cn(
|
|
9442
|
+
"block uv-spin hover:animate-[var(--popName)_0.35s_ease-out_forwards]",
|
|
9443
|
+
physicsRotation ? "animate-[var(--physicsSpinName)_var(--spinDur)_ease-in-out_infinite]" : spin && "animate-[var(--spinName)_var(--spinDur)_linear_infinite]"
|
|
9444
|
+
),
|
|
9692
9445
|
style: {
|
|
9693
|
-
|
|
9694
|
-
|
|
9695
|
-
|
|
9696
|
-
|
|
9697
|
-
|
|
9698
|
-
["--
|
|
9446
|
+
width: p.size,
|
|
9447
|
+
height: p.size,
|
|
9448
|
+
["--spinName"]: SpinName,
|
|
9449
|
+
["--physicsSpinName"]: PhysicsSpinName,
|
|
9450
|
+
["--spinDur"]: `${spinDuration}s`,
|
|
9451
|
+
["--popName"]: PopName,
|
|
9452
|
+
...glowStyles
|
|
9699
9453
|
},
|
|
9700
|
-
children: /* @__PURE__ */ jsx40(
|
|
9701
|
-
"span",
|
|
9702
|
-
{
|
|
9703
|
-
className: cn(
|
|
9704
|
-
"block uv-spin hover:animate-[var(--popName)_0.35s_ease-out_forwards]",
|
|
9705
|
-
physicsRotation ? "animate-[var(--physicsSpinName)_var(--spinDur)_ease-in-out_infinite]" : spin && "animate-[var(--spinName)_var(--spinDur)_linear_infinite]"
|
|
9706
|
-
),
|
|
9707
|
-
style: {
|
|
9708
|
-
width: p.size,
|
|
9709
|
-
height: p.size,
|
|
9710
|
-
["--spinName"]: SpinName,
|
|
9711
|
-
["--physicsSpinName"]: PhysicsSpinName,
|
|
9712
|
-
["--spinDur"]: `${spinDuration}s`,
|
|
9713
|
-
["--popName"]: PopName,
|
|
9714
|
-
...glowStyles
|
|
9715
|
-
},
|
|
9716
|
-
children: /* @__PURE__ */ jsx40(TheIcon, { className: cn("w-full h-full text-primary/70", colorClassName) })
|
|
9717
|
-
}
|
|
9718
|
-
)
|
|
9454
|
+
children: /* @__PURE__ */ jsx40(TheIcon, { className: cn("w-full h-full text-primary/70", colorClassName) })
|
|
9719
9455
|
}
|
|
9720
9456
|
)
|
|
9721
9457
|
}
|
|
9722
9458
|
)
|
|
9723
|
-
|
|
9724
|
-
|
|
9725
|
-
}
|
|
9726
|
-
)
|
|
9459
|
+
}
|
|
9460
|
+
)
|
|
9461
|
+
] }, p.key);
|
|
9462
|
+
}) })
|
|
9727
9463
|
]
|
|
9728
9464
|
}
|
|
9729
9465
|
);
|
|
@@ -9751,8 +9487,8 @@ var ListItemSkeleton = ({ size }) => {
|
|
|
9751
9487
|
return /* @__PURE__ */ jsxs36("div", { className: cn("flex items-center gap-3 animate-pulse p-2"), children: [
|
|
9752
9488
|
/* @__PURE__ */ jsx41("div", { className: cn("rounded-full bg-muted shrink-0", sz.avatar) }),
|
|
9753
9489
|
/* @__PURE__ */ jsxs36("div", { className: "flex-1 space-y-2", children: [
|
|
9754
|
-
/* @__PURE__ */ jsx41("div", { className: "h-4 bg-muted rounded w-3/4" }),
|
|
9755
|
-
/* @__PURE__ */ jsx41("div", { className: "h-3 bg-muted rounded w-1/2" })
|
|
9490
|
+
/* @__PURE__ */ jsx41("div", { className: "h-4 bg-muted rounded-md w-3/4" }),
|
|
9491
|
+
/* @__PURE__ */ jsx41("div", { className: "h-3 bg-muted rounded-md w-1/2" })
|
|
9756
9492
|
] })
|
|
9757
9493
|
] });
|
|
9758
9494
|
};
|
|
@@ -9780,12 +9516,12 @@ var ListRoot = React34.forwardRef(
|
|
|
9780
9516
|
const hasChildren = childCount > 0;
|
|
9781
9517
|
const variantClasses2 = {
|
|
9782
9518
|
plain: "",
|
|
9783
|
-
outlined: "rounded-
|
|
9784
|
-
soft: "rounded-
|
|
9785
|
-
bordered: "border border-border rounded-
|
|
9786
|
-
card: "rounded-
|
|
9519
|
+
outlined: "rounded-xl md:rounded-2xl bg-card text-card-foreground border border-border shadow-sm",
|
|
9520
|
+
soft: "rounded-xl bg-muted/40 border border-border/60",
|
|
9521
|
+
bordered: "border border-border rounded-xl",
|
|
9522
|
+
card: "rounded-xl bg-card shadow-md border border-border",
|
|
9787
9523
|
flush: "",
|
|
9788
|
-
striped: "rounded-
|
|
9524
|
+
striped: "rounded-xl border border-border overflow-hidden"
|
|
9789
9525
|
};
|
|
9790
9526
|
if (loading2) {
|
|
9791
9527
|
return /* @__PURE__ */ jsx41(
|
|
@@ -9928,7 +9664,7 @@ var List_default = List;
|
|
|
9928
9664
|
|
|
9929
9665
|
// ../../components/ui/Watermark.tsx
|
|
9930
9666
|
import * as React35 from "react";
|
|
9931
|
-
import { createPortal as
|
|
9667
|
+
import { createPortal as createPortal5 } from "react-dom";
|
|
9932
9668
|
import { Fragment as Fragment13, jsx as jsx42, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
9933
9669
|
var PRESETS2 = {
|
|
9934
9670
|
confidential: { text: "CONFIDENTIAL", color: "rgba(220, 38, 38, 0.15)", rotate: -22, fontSize: 16, fontWeight: "bold" },
|
|
@@ -10210,7 +9946,7 @@ var Watermark = ({
|
|
|
10210
9946
|
if (fullPage) {
|
|
10211
9947
|
return /* @__PURE__ */ jsxs37(Fragment13, { children: [
|
|
10212
9948
|
children,
|
|
10213
|
-
typeof window !== "undefined" ?
|
|
9949
|
+
typeof window !== "undefined" ? createPortal5(overlay, document.body) : null
|
|
10214
9950
|
] });
|
|
10215
9951
|
}
|
|
10216
9952
|
return /* @__PURE__ */ jsxs37("div", { className: cn("relative", className), style, ...rest, children: [
|
|
@@ -10225,10 +9961,46 @@ import * as React36 from "react";
|
|
|
10225
9961
|
import { ChevronDown as ChevronDown4 } from "lucide-react";
|
|
10226
9962
|
import { jsx as jsx43, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
10227
9963
|
var SIZE_STYLE = {
|
|
10228
|
-
sm: {
|
|
10229
|
-
|
|
10230
|
-
|
|
10231
|
-
|
|
9964
|
+
sm: {
|
|
9965
|
+
dot: "h-2.5 w-2.5",
|
|
9966
|
+
iconDot: "h-6 w-6",
|
|
9967
|
+
padY: "py-3",
|
|
9968
|
+
densePadY: "py-2",
|
|
9969
|
+
title: "text-sm",
|
|
9970
|
+
desc: "text-xs",
|
|
9971
|
+
time: "text-[11px]",
|
|
9972
|
+
icon: "h-3.5 w-3.5"
|
|
9973
|
+
},
|
|
9974
|
+
md: {
|
|
9975
|
+
dot: "h-3 w-3",
|
|
9976
|
+
iconDot: "h-8 w-8",
|
|
9977
|
+
padY: "py-4",
|
|
9978
|
+
densePadY: "py-2.5",
|
|
9979
|
+
title: "text-base",
|
|
9980
|
+
desc: "text-sm",
|
|
9981
|
+
time: "text-xs",
|
|
9982
|
+
icon: "h-4 w-4"
|
|
9983
|
+
},
|
|
9984
|
+
lg: {
|
|
9985
|
+
dot: "h-3.5 w-3.5",
|
|
9986
|
+
iconDot: "h-10 w-10",
|
|
9987
|
+
padY: "py-5",
|
|
9988
|
+
densePadY: "py-3",
|
|
9989
|
+
title: "text-lg",
|
|
9990
|
+
desc: "text-sm",
|
|
9991
|
+
time: "text-xs",
|
|
9992
|
+
icon: "h-5 w-5"
|
|
9993
|
+
},
|
|
9994
|
+
xl: {
|
|
9995
|
+
dot: "h-4 w-4",
|
|
9996
|
+
iconDot: "h-12 w-12",
|
|
9997
|
+
padY: "py-6",
|
|
9998
|
+
densePadY: "py-3.5",
|
|
9999
|
+
title: "text-xl",
|
|
10000
|
+
desc: "text-base",
|
|
10001
|
+
time: "text-sm",
|
|
10002
|
+
icon: "h-6 w-6"
|
|
10003
|
+
}
|
|
10232
10004
|
};
|
|
10233
10005
|
var STATUS_COLOR = {
|
|
10234
10006
|
default: "bg-muted/60",
|
|
@@ -10263,13 +10035,7 @@ var Marker = ({ index, last, size, color, status = "default", lineColor, lineSty
|
|
|
10263
10035
|
style: dotColor ? { background: color } : void 0
|
|
10264
10036
|
}
|
|
10265
10037
|
),
|
|
10266
|
-
!last && showLine && /* @__PURE__ */ jsx43(
|
|
10267
|
-
"div",
|
|
10268
|
-
{
|
|
10269
|
-
className: cn("flex-1 border-l-2", LINE_STYLE_MAP[lineStyle]),
|
|
10270
|
-
style: { borderColor: lineColor || "hsl(var(--border))" }
|
|
10271
|
-
}
|
|
10272
|
-
)
|
|
10038
|
+
!last && showLine && /* @__PURE__ */ jsx43("div", { className: cn("flex-1 border-l-2", LINE_STYLE_MAP[lineStyle]), style: { borderColor: lineColor || "hsl(var(--border))" } })
|
|
10273
10039
|
] });
|
|
10274
10040
|
};
|
|
10275
10041
|
var TimelineRoot = React36.forwardRef(
|
|
@@ -10294,12 +10060,7 @@ var TimelineRoot = React36.forwardRef(
|
|
|
10294
10060
|
"div",
|
|
10295
10061
|
{
|
|
10296
10062
|
ref,
|
|
10297
|
-
className: cn(
|
|
10298
|
-
"relative",
|
|
10299
|
-
mode === "horizontal" && "flex gap-4 overflow-x-auto",
|
|
10300
|
-
mode === "vertical" && "space-y-0",
|
|
10301
|
-
className
|
|
10302
|
-
),
|
|
10063
|
+
className: cn("relative", mode === "horizontal" && "flex gap-4 overflow-x-auto", mode === "vertical" && "space-y-0", className),
|
|
10303
10064
|
...rest,
|
|
10304
10065
|
children: mode === "vertical" ? /* @__PURE__ */ jsx43("div", { className: "space-y-0", children: content }) : content
|
|
10305
10066
|
}
|
|
@@ -10343,11 +10104,11 @@ var TimelineItem = React36.forwardRef(
|
|
|
10343
10104
|
const padding = ctx.dense ? sz.densePadY : sz.padY;
|
|
10344
10105
|
const variantClasses2 = {
|
|
10345
10106
|
default: "",
|
|
10346
|
-
outlined: "rounded-
|
|
10347
|
-
card: "rounded-
|
|
10107
|
+
outlined: "rounded-xl border border-border bg-card shadow-sm px-4 py-3",
|
|
10108
|
+
card: "rounded-2xl border border-border bg-card shadow-md px-5 py-4",
|
|
10348
10109
|
minimal: "border-l-2 pl-4 py-2",
|
|
10349
|
-
modern: "rounded-
|
|
10350
|
-
gradient: "rounded-
|
|
10110
|
+
modern: "rounded-xl bg-linear-to-r from-card to-muted/20 border border-border/50 px-5 py-4 backdrop-blur-sm",
|
|
10111
|
+
gradient: "rounded-2xl bg-linear-to-br from-primary/10 via-card to-accent/10 border border-primary/20 px-5 py-4 shadow-lg"
|
|
10351
10112
|
};
|
|
10352
10113
|
const contentBox = /* @__PURE__ */ jsxs38("div", { className: cn("min-w-0 flex-1", variantClasses2[ctx.variant]), children: [
|
|
10353
10114
|
/* @__PURE__ */ jsxs38("div", { className: "flex items-start justify-between gap-2", children: [
|
|
@@ -10373,25 +10134,87 @@ var TimelineItem = React36.forwardRef(
|
|
|
10373
10134
|
collapsible && isExpanded && expandContent && /* @__PURE__ */ jsx43("div", { className: "mt-3 pt-3 border-t border-border/50 text-sm", children: expandContent })
|
|
10374
10135
|
] });
|
|
10375
10136
|
const markerWidth = Icon || dot ? "w-auto" : "w-6";
|
|
10376
|
-
const leftSide = /* @__PURE__ */ jsxs38(
|
|
10377
|
-
|
|
10378
|
-
|
|
10379
|
-
|
|
10380
|
-
|
|
10381
|
-
|
|
10382
|
-
|
|
10383
|
-
|
|
10137
|
+
const leftSide = /* @__PURE__ */ jsxs38(
|
|
10138
|
+
"div",
|
|
10139
|
+
{
|
|
10140
|
+
className: cn("flex items-stretch gap-4", padding, ctx.animate && "animate-in slide-in-from-left duration-500"),
|
|
10141
|
+
style: { animationDelay: ctx.animate ? `${(idx ?? 0) * 100}ms` : void 0 },
|
|
10142
|
+
children: [
|
|
10143
|
+
/* @__PURE__ */ jsx43("div", { className: cn("shrink-0 flex items-stretch", markerWidth), children: /* @__PURE__ */ jsx43(
|
|
10144
|
+
Marker,
|
|
10145
|
+
{
|
|
10146
|
+
index: idx ?? 0,
|
|
10147
|
+
last: isLast,
|
|
10148
|
+
size: ctx.size,
|
|
10149
|
+
color,
|
|
10150
|
+
status,
|
|
10151
|
+
lineColor: ctx.lineColor,
|
|
10152
|
+
lineStyle: ctx.lineStyle,
|
|
10153
|
+
active,
|
|
10154
|
+
dot,
|
|
10155
|
+
icon: Icon,
|
|
10156
|
+
showLine: ctx.showLine
|
|
10157
|
+
}
|
|
10158
|
+
) }),
|
|
10159
|
+
/* @__PURE__ */ jsx43("div", { className: "flex-1", children: contentBox })
|
|
10160
|
+
]
|
|
10161
|
+
}
|
|
10162
|
+
);
|
|
10163
|
+
const rightSide = /* @__PURE__ */ jsxs38(
|
|
10164
|
+
"div",
|
|
10165
|
+
{
|
|
10166
|
+
className: cn("flex items-stretch gap-4", padding, ctx.animate && "animate-in slide-in-from-right duration-500"),
|
|
10167
|
+
style: { animationDelay: ctx.animate ? `${(idx ?? 0) * 100}ms` : void 0 },
|
|
10168
|
+
children: [
|
|
10169
|
+
/* @__PURE__ */ jsx43("div", { className: "flex-1 flex justify-end", children: contentBox }),
|
|
10170
|
+
/* @__PURE__ */ jsx43("div", { className: cn("shrink-0 flex items-stretch", markerWidth), children: /* @__PURE__ */ jsx43(
|
|
10171
|
+
Marker,
|
|
10172
|
+
{
|
|
10173
|
+
index: idx ?? 0,
|
|
10174
|
+
last: isLast,
|
|
10175
|
+
size: ctx.size,
|
|
10176
|
+
color,
|
|
10177
|
+
status,
|
|
10178
|
+
lineColor: ctx.lineColor,
|
|
10179
|
+
lineStyle: ctx.lineStyle,
|
|
10180
|
+
active,
|
|
10181
|
+
dot,
|
|
10182
|
+
icon: Icon,
|
|
10183
|
+
showLine: ctx.showLine
|
|
10184
|
+
}
|
|
10185
|
+
) })
|
|
10186
|
+
]
|
|
10187
|
+
}
|
|
10188
|
+
);
|
|
10384
10189
|
const horizontalItem = /* @__PURE__ */ jsxs38(
|
|
10385
10190
|
"div",
|
|
10386
10191
|
{
|
|
10387
|
-
className: cn(
|
|
10388
|
-
"flex flex-col items-center gap-2 min-w-[200px]",
|
|
10389
|
-
ctx.animate && "animate-in fade-in-50 zoom-in-95 duration-500"
|
|
10390
|
-
),
|
|
10192
|
+
className: cn("flex flex-col items-center gap-2 min-w-[200px]", ctx.animate && "animate-in fade-in-50 zoom-in-95 duration-500"),
|
|
10391
10193
|
style: { animationDelay: ctx.animate ? `${(idx ?? 0) * 100}ms` : void 0 },
|
|
10392
10194
|
children: [
|
|
10393
|
-
/* @__PURE__ */ jsx43(
|
|
10394
|
-
|
|
10195
|
+
/* @__PURE__ */ jsx43(
|
|
10196
|
+
Marker,
|
|
10197
|
+
{
|
|
10198
|
+
index: idx ?? 0,
|
|
10199
|
+
last: isLast,
|
|
10200
|
+
size: ctx.size,
|
|
10201
|
+
color,
|
|
10202
|
+
status,
|
|
10203
|
+
lineColor: ctx.lineColor,
|
|
10204
|
+
lineStyle: ctx.lineStyle,
|
|
10205
|
+
active,
|
|
10206
|
+
dot,
|
|
10207
|
+
icon: Icon,
|
|
10208
|
+
showLine: false
|
|
10209
|
+
}
|
|
10210
|
+
),
|
|
10211
|
+
!isLast && ctx.showLine && /* @__PURE__ */ jsx43(
|
|
10212
|
+
"div",
|
|
10213
|
+
{
|
|
10214
|
+
className: cn("h-px w-full border-t-2", LINE_STYLE_MAP[ctx.lineStyle]),
|
|
10215
|
+
style: { borderColor: ctx.lineColor || "hsl(var(--border))" }
|
|
10216
|
+
}
|
|
10217
|
+
),
|
|
10395
10218
|
contentBox
|
|
10396
10219
|
]
|
|
10397
10220
|
}
|
|
@@ -10413,7 +10236,7 @@ var Timeline_default = Timeline;
|
|
|
10413
10236
|
import * as React37 from "react";
|
|
10414
10237
|
import { Pipette, X as X12, Copy, Check as Check8, Palette, History } from "lucide-react";
|
|
10415
10238
|
import { jsx as jsx44, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
10416
|
-
var
|
|
10239
|
+
var clamp3 = (n, min, max) => Math.max(min, Math.min(max, n));
|
|
10417
10240
|
function hexToRgb(hex) {
|
|
10418
10241
|
const str = hex.replace(/^#/, "").trim();
|
|
10419
10242
|
if (str.length === 3) {
|
|
@@ -10431,7 +10254,7 @@ function hexToRgb(hex) {
|
|
|
10431
10254
|
return null;
|
|
10432
10255
|
}
|
|
10433
10256
|
function rgbToHex(r, g, b) {
|
|
10434
|
-
return `#${[r, g, b].map((v) =>
|
|
10257
|
+
return `#${[r, g, b].map((v) => clamp3(Math.round(v), 0, 255).toString(16).padStart(2, "0")).join("")}`;
|
|
10435
10258
|
}
|
|
10436
10259
|
function rgbToHsl(r, g, b) {
|
|
10437
10260
|
r /= 255;
|
|
@@ -10492,10 +10315,10 @@ function parseAnyColor(input) {
|
|
|
10492
10315
|
}
|
|
10493
10316
|
const rgbaMatch = s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})(?:\s*,\s*(\d*\.?\d+))?\s*\)/i);
|
|
10494
10317
|
if (rgbaMatch) {
|
|
10495
|
-
const r =
|
|
10496
|
-
const g =
|
|
10497
|
-
const b =
|
|
10498
|
-
const a = rgbaMatch[4] != null ?
|
|
10318
|
+
const r = clamp3(parseInt(rgbaMatch[1], 10), 0, 255);
|
|
10319
|
+
const g = clamp3(parseInt(rgbaMatch[2], 10), 0, 255);
|
|
10320
|
+
const b = clamp3(parseInt(rgbaMatch[3], 10), 0, 255);
|
|
10321
|
+
const a = rgbaMatch[4] != null ? clamp3(parseFloat(rgbaMatch[4]), 0, 1) : 1;
|
|
10499
10322
|
return { r, g, b, a };
|
|
10500
10323
|
}
|
|
10501
10324
|
const hslaMatch = s.match(/hsla?\(\s*(\d{1,3}(?:\.\d+)?)\s*,?\s*(\d{1,3}(?:\.\d+)?)%?\s*,?\s*(\d{1,3}(?:\.\d+)?)%?(?:\s*,?\s*(\d*\.?\d+))?\s*\)/i);
|
|
@@ -10503,7 +10326,7 @@ function parseAnyColor(input) {
|
|
|
10503
10326
|
const h = parseFloat(hslaMatch[1]);
|
|
10504
10327
|
const sl = parseFloat(hslaMatch[2]);
|
|
10505
10328
|
const l = parseFloat(hslaMatch[3]);
|
|
10506
|
-
const a = hslaMatch[4] != null ?
|
|
10329
|
+
const a = hslaMatch[4] != null ? clamp3(parseFloat(hslaMatch[4]), 0, 1) : 1;
|
|
10507
10330
|
const rgb = hslToRgb(h, sl, l);
|
|
10508
10331
|
return { ...rgb, a };
|
|
10509
10332
|
}
|
|
@@ -10516,12 +10339,12 @@ function formatOutput({ r, g, b, a }, withAlpha, format) {
|
|
|
10516
10339
|
if (format === "hsl" || format === "hsla") {
|
|
10517
10340
|
const hsl = rgbToHsl(r, g, b);
|
|
10518
10341
|
if (format === "hsla" || withAlpha) {
|
|
10519
|
-
return `hsla(${Math.round(hsl.h)}, ${Math.round(hsl.s)}%, ${Math.round(hsl.l)}%, ${
|
|
10342
|
+
return `hsla(${Math.round(hsl.h)}, ${Math.round(hsl.s)}%, ${Math.round(hsl.l)}%, ${clamp3(a, 0, 1)})`;
|
|
10520
10343
|
}
|
|
10521
10344
|
return `hsl(${Math.round(hsl.h)}, ${Math.round(hsl.s)}%, ${Math.round(hsl.l)}%)`;
|
|
10522
10345
|
}
|
|
10523
10346
|
if (withAlpha || a !== 1) {
|
|
10524
|
-
return `rgba(${
|
|
10347
|
+
return `rgba(${clamp3(r, 0, 255)}, ${clamp3(g, 0, 255)}, ${clamp3(b, 0, 255)}, ${clamp3(a, 0, 1)})`;
|
|
10525
10348
|
}
|
|
10526
10349
|
return rgbToHex(r, g, b);
|
|
10527
10350
|
}
|
|
@@ -10575,11 +10398,7 @@ var Swatch = ({
|
|
|
10575
10398
|
"button",
|
|
10576
10399
|
{
|
|
10577
10400
|
type: "button",
|
|
10578
|
-
className: cn(
|
|
10579
|
-
sizeClasses2[size],
|
|
10580
|
-
"rounded-md border border-border shadow-sm hover:scale-110 transition-transform",
|
|
10581
|
-
onClick && "cursor-pointer"
|
|
10582
|
-
),
|
|
10401
|
+
className: cn(sizeClasses2[size], "rounded-lg border border-border shadow-sm hover:scale-110 transition-transform", onClick && "cursor-pointer"),
|
|
10583
10402
|
style: { backgroundColor: color },
|
|
10584
10403
|
onClick,
|
|
10585
10404
|
"aria-label": ariaLabel
|
|
@@ -10659,7 +10478,7 @@ function ColorPicker({
|
|
|
10659
10478
|
emit(next);
|
|
10660
10479
|
};
|
|
10661
10480
|
const setAlpha = (aPct) => {
|
|
10662
|
-
const a =
|
|
10481
|
+
const a = clamp3(aPct / 100, 0, 1);
|
|
10663
10482
|
const next = { ...rgba, a };
|
|
10664
10483
|
setRgba(next);
|
|
10665
10484
|
emit(next);
|
|
@@ -10701,7 +10520,7 @@ function ColorPicker({
|
|
|
10701
10520
|
type: "button",
|
|
10702
10521
|
disabled,
|
|
10703
10522
|
className: cn(
|
|
10704
|
-
"w-full px-3 rounded-
|
|
10523
|
+
"w-full px-3 rounded-xl border border-input bg-background flex items-center justify-between",
|
|
10705
10524
|
sizeClasses2[size],
|
|
10706
10525
|
"hover:border-accent-foreground/30 transition-colors",
|
|
10707
10526
|
disabled && "opacity-50 cursor-not-allowed",
|
|
@@ -10713,10 +10532,7 @@ function ColorPicker({
|
|
|
10713
10532
|
/* @__PURE__ */ jsx44(
|
|
10714
10533
|
"span",
|
|
10715
10534
|
{
|
|
10716
|
-
className: cn(
|
|
10717
|
-
"rounded border border-border shadow-sm",
|
|
10718
|
-
size === "sm" ? "h-4 w-4" : size === "lg" ? "h-6 w-6" : "h-5 w-5"
|
|
10719
|
-
),
|
|
10535
|
+
className: cn("rounded-md border border-border shadow-sm", size === "sm" ? "h-4 w-4" : size === "lg" ? "h-6 w-6" : "h-5 w-5"),
|
|
10720
10536
|
style: { backgroundColor: withAlpha ? `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})` : hexForInput }
|
|
10721
10537
|
}
|
|
10722
10538
|
),
|
|
@@ -10741,16 +10557,24 @@ function ColorPicker({
|
|
|
10741
10557
|
placement: "bottom-start",
|
|
10742
10558
|
matchTriggerWidth: variant === "minimal",
|
|
10743
10559
|
contentWidth: contentWidthByVariant[variant],
|
|
10744
|
-
contentClassName: cn("p-3 rounded-
|
|
10560
|
+
contentClassName: cn("p-3 rounded-xl border border-border bg-card shadow-lg", contentClassName),
|
|
10745
10561
|
children: /* @__PURE__ */ jsxs39("div", { className: "space-y-3", children: [
|
|
10746
10562
|
variant !== "minimal" && /* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-2", children: [
|
|
10747
|
-
/* @__PURE__ */ jsx44(
|
|
10563
|
+
/* @__PURE__ */ jsx44(
|
|
10564
|
+
"input",
|
|
10565
|
+
{
|
|
10566
|
+
type: "color",
|
|
10567
|
+
value: hexForInput,
|
|
10568
|
+
onChange: handleNativeChange,
|
|
10569
|
+
className: "h-9 w-9 rounded-lg cursor-pointer border border-border"
|
|
10570
|
+
}
|
|
10571
|
+
),
|
|
10748
10572
|
/* @__PURE__ */ jsxs39(
|
|
10749
10573
|
"button",
|
|
10750
10574
|
{
|
|
10751
10575
|
type: "button",
|
|
10752
10576
|
onClick: tryEyedropper,
|
|
10753
|
-
className: cn("h-9 px-3 rounded-
|
|
10577
|
+
className: cn("h-9 px-3 rounded-lg border border-border text-xs hover:bg-accent/10 transition-colors flex items-center gap-1.5"),
|
|
10754
10578
|
children: [
|
|
10755
10579
|
/* @__PURE__ */ jsx44(Pipette, { className: "w-3.5 h-3.5" }),
|
|
10756
10580
|
variant === "full" && "Pick"
|
|
@@ -10763,7 +10587,7 @@ function ColorPicker({
|
|
|
10763
10587
|
type: "button",
|
|
10764
10588
|
onClick: copyToClipboard,
|
|
10765
10589
|
className: cn(
|
|
10766
|
-
"h-9 px-3 rounded-
|
|
10590
|
+
"h-9 px-3 rounded-lg border border-border text-xs hover:bg-accent/10 transition-colors flex items-center gap-1.5",
|
|
10767
10591
|
copied && "bg-green-500/10 border-green-500/30"
|
|
10768
10592
|
),
|
|
10769
10593
|
children: [
|
|
@@ -10777,7 +10601,7 @@ function ColorPicker({
|
|
|
10777
10601
|
{
|
|
10778
10602
|
type: "button",
|
|
10779
10603
|
onClick: clear,
|
|
10780
|
-
className: "ml-auto h-9 px-2 rounded-
|
|
10604
|
+
className: "ml-auto h-9 px-2 rounded-lg border border-border text-xs hover:bg-destructive/10 transition-colors flex items-center gap-1",
|
|
10781
10605
|
children: [
|
|
10782
10606
|
/* @__PURE__ */ jsx44(X12, { className: "w-3.5 h-3.5" }),
|
|
10783
10607
|
variant === "full" && "Clear"
|
|
@@ -10803,14 +10627,27 @@ function ColorPicker({
|
|
|
10803
10627
|
type: "button",
|
|
10804
10628
|
onClick: copyToClipboard,
|
|
10805
10629
|
className: cn(
|
|
10806
|
-
"h-9 w-9 rounded-
|
|
10630
|
+
"h-9 w-9 rounded-lg border border-border hover:bg-accent/10 transition-colors flex items-center justify-center",
|
|
10807
10631
|
copied && "bg-green-500/10 border-green-500/30"
|
|
10808
10632
|
),
|
|
10809
10633
|
children: copied ? /* @__PURE__ */ jsx44(Check8, { className: "w-3.5 h-3.5 text-green-600" }) : /* @__PURE__ */ jsx44(Copy, { className: "w-3.5 h-3.5" })
|
|
10810
10634
|
}
|
|
10811
10635
|
)
|
|
10812
10636
|
] }),
|
|
10813
|
-
withAlpha && /* @__PURE__ */ jsx44("div", { className: "pt-1", children: /* @__PURE__ */ jsx44(
|
|
10637
|
+
withAlpha && /* @__PURE__ */ jsx44("div", { className: "pt-1", children: /* @__PURE__ */ jsx44(
|
|
10638
|
+
Slider,
|
|
10639
|
+
{
|
|
10640
|
+
min: 0,
|
|
10641
|
+
max: 100,
|
|
10642
|
+
step: 1,
|
|
10643
|
+
value: alphaPct,
|
|
10644
|
+
onChange: (v) => setAlpha(v),
|
|
10645
|
+
label: "Alpha",
|
|
10646
|
+
showValue: true,
|
|
10647
|
+
formatValue: (v) => `${v}%`,
|
|
10648
|
+
size: "sm"
|
|
10649
|
+
}
|
|
10650
|
+
) }),
|
|
10814
10651
|
variant !== "minimal" && /* @__PURE__ */ jsxs39("div", { children: [
|
|
10815
10652
|
/* @__PURE__ */ jsxs39("div", { className: "text-xs font-medium text-muted-foreground mb-2 flex items-center gap-1.5", children: [
|
|
10816
10653
|
/* @__PURE__ */ jsx44(Palette, { className: "w-3.5 h-3.5" }),
|
|
@@ -10947,14 +10784,14 @@ function joinAreas(areas) {
|
|
|
10947
10784
|
}
|
|
10948
10785
|
function getVariantClasses(variant = "default", outlined) {
|
|
10949
10786
|
if (outlined) {
|
|
10950
|
-
return "rounded-
|
|
10787
|
+
return "rounded-xl md:rounded-2xl bg-card text-card-foreground border border-border shadow-sm";
|
|
10951
10788
|
}
|
|
10952
10789
|
const variants = {
|
|
10953
10790
|
default: "",
|
|
10954
|
-
bordered: "border border-border rounded-
|
|
10955
|
-
card: "rounded-
|
|
10956
|
-
flat: "bg-muted/30 rounded-
|
|
10957
|
-
glass: "bg-background/80 backdrop-blur-sm border border-border/50 rounded-
|
|
10791
|
+
bordered: "border border-border rounded-xl",
|
|
10792
|
+
card: "rounded-xl md:rounded-2xl bg-card text-card-foreground border border-border shadow-sm",
|
|
10793
|
+
flat: "bg-muted/30 rounded-xl",
|
|
10794
|
+
glass: "bg-background/80 backdrop-blur-sm border border-border/50 rounded-xl shadow-lg"
|
|
10958
10795
|
};
|
|
10959
10796
|
return variants[variant] || "";
|
|
10960
10797
|
}
|
|
@@ -11030,12 +10867,7 @@ var GridRoot = React38.forwardRef(
|
|
|
11030
10867
|
"div",
|
|
11031
10868
|
{
|
|
11032
10869
|
ref,
|
|
11033
|
-
className: cn(
|
|
11034
|
-
baseClass,
|
|
11035
|
-
getVariantClasses(variant, outlined),
|
|
11036
|
-
animated && "transition-all duration-300 ease-in-out",
|
|
11037
|
-
className
|
|
11038
|
-
),
|
|
10870
|
+
className: cn(baseClass, getVariantClasses(variant, outlined), animated && "transition-all duration-300 ease-in-out", className),
|
|
11039
10871
|
style,
|
|
11040
10872
|
...rest,
|
|
11041
10873
|
children: [
|
|
@@ -11094,10 +10926,7 @@ var GridItem = React38.forwardRef(
|
|
|
11094
10926
|
"div",
|
|
11095
10927
|
{
|
|
11096
10928
|
ref,
|
|
11097
|
-
className: cn(
|
|
11098
|
-
hoverable && "transition-all duration-200 hover:scale-[1.02] hover:shadow-md cursor-pointer",
|
|
11099
|
-
className
|
|
11100
|
-
),
|
|
10929
|
+
className: cn(hoverable && "transition-all duration-200 hover:scale-[1.02] hover:shadow-md cursor-pointer", className),
|
|
11101
10930
|
style: st,
|
|
11102
10931
|
...rest
|
|
11103
10932
|
}
|
|
@@ -11114,7 +10943,7 @@ import { useMemo as useMemo7, useState as useState34, useRef as useRef14 } from
|
|
|
11114
10943
|
|
|
11115
10944
|
// ../../components/ui/ChartTooltip.tsx
|
|
11116
10945
|
import { useEffect as useEffect20, useState as useState33 } from "react";
|
|
11117
|
-
import { createPortal as
|
|
10946
|
+
import { createPortal as createPortal6 } from "react-dom";
|
|
11118
10947
|
import { Fragment as Fragment15, jsx as jsx46, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
11119
10948
|
function ChartTooltip({ x, y, visible, label, value, color, secondaryLabel, secondaryValue, items, containerRef }) {
|
|
11120
10949
|
const [isMounted, setIsMounted] = useState33(false);
|
|
@@ -11147,7 +10976,7 @@ function ChartTooltip({ x, y, visible, label, value, color, secondaryLabel, seco
|
|
|
11147
10976
|
/* @__PURE__ */ jsxs41(
|
|
11148
10977
|
"div",
|
|
11149
10978
|
{
|
|
11150
|
-
className: cn("bg-popover text-popover-foreground border border-border", "rounded-
|
|
10979
|
+
className: cn("bg-popover text-popover-foreground border border-border", "rounded-xl shadow-xl px-3 py-2 text-sm", "backdrop-blur-sm"),
|
|
11151
10980
|
style: {
|
|
11152
10981
|
minWidth: "80px",
|
|
11153
10982
|
width: "max-content",
|
|
@@ -11185,7 +11014,7 @@ function ChartTooltip({ x, y, visible, label, value, color, secondaryLabel, seco
|
|
|
11185
11014
|
]
|
|
11186
11015
|
}
|
|
11187
11016
|
);
|
|
11188
|
-
return
|
|
11017
|
+
return createPortal6(tooltipContent, document.body);
|
|
11189
11018
|
}
|
|
11190
11019
|
|
|
11191
11020
|
// ../../components/ui/LineChart.tsx
|
|
@@ -11686,7 +11515,7 @@ function PieChart({
|
|
|
11686
11515
|
className: "flex items-center gap-2 text-sm",
|
|
11687
11516
|
style: animated ? { opacity: 0, animation: `fadeIn 0.3s ease-out ${i * 0.1 + 0.3}s forwards` } : void 0,
|
|
11688
11517
|
children: [
|
|
11689
|
-
/* @__PURE__ */ jsx49("div", { className: "w-3 h-3 rounded-
|
|
11518
|
+
/* @__PURE__ */ jsx49("div", { className: "w-3 h-3 rounded-md shrink-0", style: { backgroundColor: seg.color } }),
|
|
11690
11519
|
/* @__PURE__ */ jsx49("span", { className: "text-muted-foreground", children: seg.label }),
|
|
11691
11520
|
/* @__PURE__ */ jsx49("span", { className: "text-foreground font-medium ml-auto", children: showPercentage ? `${(seg.percentage * 100).toFixed(0)}%` : seg.value })
|
|
11692
11521
|
]
|
|
@@ -11942,7 +11771,7 @@ function AreaChart({
|
|
|
11942
11771
|
className: "flex items-center gap-2 text-sm",
|
|
11943
11772
|
style: animated ? { opacity: 0, animation: `fadeIn 0.3s ease-out ${i * 0.1 + 0.5}s forwards` } : void 0,
|
|
11944
11773
|
children: [
|
|
11945
|
-
/* @__PURE__ */ jsx50("div", { className: "w-3 h-3 rounded-
|
|
11774
|
+
/* @__PURE__ */ jsx50("div", { className: "w-3 h-3 rounded-md", style: { backgroundColor: s.color } }),
|
|
11946
11775
|
/* @__PURE__ */ jsx50("span", { className: "text-muted-foreground", children: s.name })
|
|
11947
11776
|
]
|
|
11948
11777
|
},
|
|
@@ -12285,7 +12114,7 @@ function RadarChart({
|
|
|
12285
12114
|
className: "flex items-center gap-2 text-sm",
|
|
12286
12115
|
style: animated ? { opacity: 0, animation: `fadeIn 0.3s ease-out ${i * 0.1 + 0.5}s forwards` } : void 0,
|
|
12287
12116
|
children: [
|
|
12288
|
-
/* @__PURE__ */ jsx52("div", { className: "w-3 h-3 rounded-
|
|
12117
|
+
/* @__PURE__ */ jsx52("div", { className: "w-3 h-3 rounded-md", style: { backgroundColor: s.color } }),
|
|
12289
12118
|
/* @__PURE__ */ jsx52("span", { className: "text-muted-foreground", children: s.name })
|
|
12290
12119
|
]
|
|
12291
12120
|
},
|
|
@@ -12581,7 +12410,7 @@ var Table = React47.forwardRef(({ className, containerClassName, ...props }, ref
|
|
|
12581
12410
|
{
|
|
12582
12411
|
className: cn(
|
|
12583
12412
|
"relative w-full overflow-auto",
|
|
12584
|
-
"rounded-
|
|
12413
|
+
"rounded-2xl md:rounded-3xl border border-border",
|
|
12585
12414
|
"bg-card text-card-foreground shadow-sm",
|
|
12586
12415
|
"backdrop-blur-sm transition-all duration-300",
|
|
12587
12416
|
containerClassName
|
|
@@ -12798,7 +12627,7 @@ function DataTable({
|
|
|
12798
12627
|
"button",
|
|
12799
12628
|
{
|
|
12800
12629
|
className: cn(
|
|
12801
|
-
"p-1 rounded-
|
|
12630
|
+
"p-1 rounded-lg transition-all duration-200 hover:bg-accent",
|
|
12802
12631
|
sort?.key === col.key ? "opacity-100 bg-accent" : "opacity-60 hover:opacity-100"
|
|
12803
12632
|
),
|
|
12804
12633
|
onClick: () => {
|
|
@@ -12846,7 +12675,7 @@ function DataTable({
|
|
|
12846
12675
|
"button",
|
|
12847
12676
|
{
|
|
12848
12677
|
className: cn(
|
|
12849
|
-
"p-1.5 rounded-
|
|
12678
|
+
"p-1.5 rounded-lg hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",
|
|
12850
12679
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
12851
12680
|
filters[col.key] && "bg-accent text-foreground"
|
|
12852
12681
|
),
|
|
@@ -12980,7 +12809,7 @@ function DataTable({
|
|
|
12980
12809
|
setVisibleCols((prev) => prev.includes(c.key) ? prev.filter((k) => k !== c.key) : [...prev, c.key]);
|
|
12981
12810
|
},
|
|
12982
12811
|
children: [
|
|
12983
|
-
/* @__PURE__ */ jsx57("input", { type: "checkbox", className: "mr-2 rounded border-border", readOnly: true, checked: visibleCols.includes(c.key) }),
|
|
12812
|
+
/* @__PURE__ */ jsx57("input", { type: "checkbox", className: "mr-2 rounded-md border-border", readOnly: true, checked: visibleCols.includes(c.key) }),
|
|
12984
12813
|
/* @__PURE__ */ jsx57("span", { className: "truncate", children: c.title })
|
|
12985
12814
|
]
|
|
12986
12815
|
},
|
|
@@ -13005,7 +12834,7 @@ function DataTable({
|
|
|
13005
12834
|
toolbar
|
|
13006
12835
|
] })
|
|
13007
12836
|
] }),
|
|
13008
|
-
/* @__PURE__ */ jsx57("div", { className: cn("relative rounded-md border border-border/50 overflow-hidden", loading2 && "opacity-60 pointer-events-none"), children: /* @__PURE__ */ jsxs51(
|
|
12837
|
+
/* @__PURE__ */ jsx57("div", { className: cn("relative rounded-2xl md:rounded-3xl border border-border/50 overflow-hidden", loading2 && "opacity-60 pointer-events-none"), children: /* @__PURE__ */ jsxs51(
|
|
13009
12838
|
Table,
|
|
13010
12839
|
{
|
|
13011
12840
|
containerClassName: "border-0 md:border-0 rounded-none md:rounded-none shadow-none bg-transparent",
|
|
@@ -13049,8 +12878,8 @@ function DataTable({
|
|
|
13049
12878
|
col.align === "right" && "text-right",
|
|
13050
12879
|
col.align === "center" && "text-center",
|
|
13051
12880
|
columnDividers && colIdx > 0 && "border-l border-border/60",
|
|
13052
|
-
isLastRow && col === visibleColumns[0] && "rounded-bl-md",
|
|
13053
|
-
isLastRow && col === visibleColumns[visibleColumns.length - 1] && "rounded-br-md"
|
|
12881
|
+
isLastRow && col === visibleColumns[0] && "rounded-bl-2xl md:rounded-bl-3xl",
|
|
12882
|
+
isLastRow && col === visibleColumns[visibleColumns.length - 1] && "rounded-br-2xl md:rounded-br-3xl"
|
|
13054
12883
|
),
|
|
13055
12884
|
children: col.render ? col.render(value, row, idx) : String(value ?? "")
|
|
13056
12885
|
},
|
|
@@ -13094,7 +12923,7 @@ function DataTable({
|
|
|
13094
12923
|
{
|
|
13095
12924
|
onClick: () => setCurPage(p),
|
|
13096
12925
|
className: cn(
|
|
13097
|
-
"h-7 min-w-7 px-1.5 rounded text-xs font-medium transition-colors",
|
|
12926
|
+
"h-7 min-w-7 px-1.5 rounded-lg text-xs font-medium transition-colors",
|
|
13098
12927
|
curPage === p ? "bg-primary text-primary-foreground" : "hover:bg-accent hover:text-accent-foreground"
|
|
13099
12928
|
),
|
|
13100
12929
|
children: p
|
|
@@ -13447,7 +13276,7 @@ function AccessDenied({
|
|
|
13447
13276
|
// ../../components/ui/ThemeToggleHeadless.tsx
|
|
13448
13277
|
import { Moon as Moon2, Sun as Sun2, Monitor } from "lucide-react";
|
|
13449
13278
|
import { useEffect as useEffect23, useRef as useRef19, useState as useState40 } from "react";
|
|
13450
|
-
import { createPortal as
|
|
13279
|
+
import { createPortal as createPortal7 } from "react-dom";
|
|
13451
13280
|
import { Fragment as Fragment20, jsx as jsx62, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
13452
13281
|
function ThemeToggleHeadless({
|
|
13453
13282
|
theme,
|
|
@@ -13500,8 +13329,8 @@ function ThemeToggleHeadless({
|
|
|
13500
13329
|
}
|
|
13501
13330
|
),
|
|
13502
13331
|
isOpen && /* @__PURE__ */ jsxs56(Fragment20, { children: [
|
|
13503
|
-
typeof window !== "undefined" &&
|
|
13504
|
-
typeof window !== "undefined" && dropdownPosition &&
|
|
13332
|
+
typeof window !== "undefined" && createPortal7(/* @__PURE__ */ jsx62("div", { className: "fixed inset-0 z-9998", onClick: () => setIsOpen(false) }), document.body),
|
|
13333
|
+
typeof window !== "undefined" && dropdownPosition && createPortal7(
|
|
13505
13334
|
/* @__PURE__ */ jsx62(
|
|
13506
13335
|
"div",
|
|
13507
13336
|
{
|
|
@@ -13549,7 +13378,7 @@ function ThemeToggleHeadless({
|
|
|
13549
13378
|
|
|
13550
13379
|
// ../../components/ui/LanguageSwitcherHeadless.tsx
|
|
13551
13380
|
import { useRef as useRef20, useState as useState41 } from "react";
|
|
13552
|
-
import { createPortal as
|
|
13381
|
+
import { createPortal as createPortal8 } from "react-dom";
|
|
13553
13382
|
import { Globe } from "lucide-react";
|
|
13554
13383
|
import { Fragment as Fragment21, jsx as jsx63, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
13555
13384
|
function LanguageSwitcherHeadless({
|
|
@@ -13597,8 +13426,8 @@ function LanguageSwitcherHeadless({
|
|
|
13597
13426
|
}
|
|
13598
13427
|
),
|
|
13599
13428
|
isOpen && /* @__PURE__ */ jsxs57(Fragment21, { children: [
|
|
13600
|
-
typeof window !== "undefined" &&
|
|
13601
|
-
typeof window !== "undefined" && dropdownPosition &&
|
|
13429
|
+
typeof window !== "undefined" && createPortal8(/* @__PURE__ */ jsx63("div", { className: "fixed inset-0 z-9998", onClick: () => setIsOpen(false) }), document.body),
|
|
13430
|
+
typeof window !== "undefined" && dropdownPosition && createPortal8(
|
|
13602
13431
|
/* @__PURE__ */ jsx63(
|
|
13603
13432
|
"div",
|
|
13604
13433
|
{
|