@underverse-ui/underverse 0.2.19 → 0.2.21
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 +198 -139
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +198 -139
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -182,13 +182,13 @@ var VARIANT_STYLES_BTN = {
|
|
|
182
182
|
// Link: chỉ văn bản
|
|
183
183
|
link: "text-primary bg-transparent underline-offset-4 hover:underline hover:text-primary/85 transition-colors",
|
|
184
184
|
// Gradient: tuỳ chọn, giảm shadow
|
|
185
|
-
gradient: "bg-
|
|
185
|
+
gradient: "bg-linear-to-r from-primary via-secondary to-accent text-primary-foreground hover:opacity-90 shadow-sm border border-primary/10"
|
|
186
186
|
};
|
|
187
187
|
var SIZE_STYLES_BTN = {
|
|
188
|
-
sm: "px-3 py-1.5 text-sm h-8 min-w-
|
|
189
|
-
md: "px-4 py-2 text-sm h-10 min-w-
|
|
190
|
-
lg: "px-6 py-3 text-base h-12 min-w-
|
|
191
|
-
smx: "px-3.5 py-1.5 text-[13px] h-9 min-w-
|
|
188
|
+
sm: "px-3 py-1.5 text-sm h-8 min-w-8 md:px-2.5 md:py-1 md:h-7 md:text-xs",
|
|
189
|
+
md: "px-4 py-2 text-sm h-10 min-w-10 md:px-3 md:py-1.5 md:h-9",
|
|
190
|
+
lg: "px-6 py-3 text-base h-12 min-w-12 md:px-4 md:py-2 md:h-10 md:text-sm",
|
|
191
|
+
smx: "px-3.5 py-1.5 text-[13px] h-9 min-w-9 md:px-3 md:py-1 md:h-8 md:text-xs",
|
|
192
192
|
icon: "w-11 h-11 p-0 rounded-full flex items-center justify-center md:w-10 md:h-10"
|
|
193
193
|
};
|
|
194
194
|
|
|
@@ -289,7 +289,7 @@ var Button = (0, import_react.forwardRef)(
|
|
|
289
289
|
"aria-label": rest["aria-label"] || title,
|
|
290
290
|
...rest,
|
|
291
291
|
children: [
|
|
292
|
-
!noHoverOverlay && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "absolute inset-0 bg-
|
|
292
|
+
!noHoverOverlay && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "absolute inset-0 bg-linear-to-r from-primary-foreground/20 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-200 dark:hidden" }),
|
|
293
293
|
loading2 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
294
294
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SpinnerIcon, { className: "w-4 h-4 animate-spin" }),
|
|
295
295
|
loadingText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "ml-2", "aria-live": "polite", children: loadingText }),
|
|
@@ -321,7 +321,7 @@ var variantStyles = {
|
|
|
321
321
|
outline: "bg-transparent text-foreground border-border hover:bg-accent/50",
|
|
322
322
|
ghost: "bg-transparent hover:bg-accent/20 hover:text-accent-foreground border-transparent transition-colors",
|
|
323
323
|
transparent: "bg-transparent text-foreground border-transparent hover:bg-accent/30",
|
|
324
|
-
gradient: "bg-
|
|
324
|
+
gradient: "bg-linear-to-r from-primary to-secondary text-primary-foreground border-transparent hover:from-primary/90 hover:to-secondary/90"
|
|
325
325
|
};
|
|
326
326
|
var sizeStyles = {
|
|
327
327
|
xs: "px-1.5 py-0.5 text-xs font-medium min-h-[18px]",
|
|
@@ -398,12 +398,12 @@ var Badge = ({
|
|
|
398
398
|
className: cn(
|
|
399
399
|
baseClasses,
|
|
400
400
|
"justify-center rounded-full",
|
|
401
|
-
"min-w-
|
|
402
|
-
size === "xs" && "min-w-
|
|
403
|
-
size === "sm" && "min-w-
|
|
404
|
-
size === "md" && "min-w-
|
|
405
|
-
size === "lg" && "min-w-
|
|
406
|
-
size === "xl" && "min-w-
|
|
401
|
+
"min-w-6 h-6 px-1.5 text-xs font-bold",
|
|
402
|
+
size === "xs" && "min-w-5 h-5 px-1 text-xs",
|
|
403
|
+
size === "sm" && "min-w-6 h-6 px-1.5 text-xs",
|
|
404
|
+
size === "md" && "min-w-7 h-7 px-2 text-xs",
|
|
405
|
+
size === "lg" && "min-w-8 h-8 px-2.5 text-sm",
|
|
406
|
+
size === "xl" && "min-w-9 h-9 px-3 text-sm",
|
|
407
407
|
className
|
|
408
408
|
),
|
|
409
409
|
onClick: handleClick,
|
|
@@ -418,7 +418,7 @@ var Badge = ({
|
|
|
418
418
|
Icon,
|
|
419
419
|
{
|
|
420
420
|
className: cn(
|
|
421
|
-
"
|
|
421
|
+
"shrink-0",
|
|
422
422
|
size === "xs" && "h-3 w-3",
|
|
423
423
|
size === "sm" && "h-3 w-3",
|
|
424
424
|
size === "md" && "h-4 w-4",
|
|
@@ -434,7 +434,7 @@ var Badge = ({
|
|
|
434
434
|
onClick: handleRemove,
|
|
435
435
|
className: cn(
|
|
436
436
|
"ml-1 rounded-full hover:bg-accent focus:outline-none focus:bg-accent",
|
|
437
|
-
"transition-colors duration-150
|
|
437
|
+
"transition-colors duration-150 shrink-0",
|
|
438
438
|
size === "xs" && "h-3 w-3",
|
|
439
439
|
size === "sm" && "h-3 w-3",
|
|
440
440
|
size === "md" && "h-4 w-4",
|
|
@@ -523,7 +523,7 @@ var GradientBadge = ({ from = "from-primary", to = "to-secondary", className, ..
|
|
|
523
523
|
{
|
|
524
524
|
...props,
|
|
525
525
|
variant: "transparent",
|
|
526
|
-
className: cn(`bg-
|
|
526
|
+
className: cn(`bg-linear-to-r ${from} ${to} text-primary-foreground border-transparent`, "hover:opacity-90", className)
|
|
527
527
|
}
|
|
528
528
|
);
|
|
529
529
|
};
|
|
@@ -562,7 +562,7 @@ var Card = ({ title, description, children, footer, className, hoverable = false
|
|
|
562
562
|
"div",
|
|
563
563
|
{
|
|
564
564
|
className: cn(
|
|
565
|
-
"absolute inset-0 bg-
|
|
565
|
+
"absolute inset-0 bg-linear-to-br from-primary/5 to-transparent transition-opacity duration-300",
|
|
566
566
|
isHovered ? "opacity-100" : "opacity-0"
|
|
567
567
|
)
|
|
568
568
|
}
|
|
@@ -880,7 +880,7 @@ var Input = (0, import_react3.forwardRef)(
|
|
|
880
880
|
"div",
|
|
881
881
|
{
|
|
882
882
|
className: cn(
|
|
883
|
-
"absolute bottom-0 left-0 h-0.5 bg-
|
|
883
|
+
"absolute bottom-0 left-0 h-0.5 bg-linear-to-r from-primary to-primary/60 transition-all duration-300",
|
|
884
884
|
// default hidden
|
|
885
885
|
"w-0 opacity-0",
|
|
886
886
|
// expand underline when focused within input container
|
|
@@ -890,7 +890,7 @@ var Input = (0, import_react3.forwardRef)(
|
|
|
890
890
|
)
|
|
891
891
|
] }),
|
|
892
892
|
errMsg && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { id: errorId, className: "flex items-center gap-2 text-sm text-destructive animate-in slide-in-from-top-1 duration-200", children: [
|
|
893
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react3.AlertCircle, { className: "w-4 h-4
|
|
893
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react3.AlertCircle, { className: "w-4 h-4 shrink-0" }),
|
|
894
894
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: errMsg })
|
|
895
895
|
] }),
|
|
896
896
|
(description || hint) && !errMsg && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
@@ -1074,7 +1074,7 @@ var NumberInput = (0, import_react3.forwardRef)(
|
|
|
1074
1074
|
"text-muted-foreground hover:text-foreground"
|
|
1075
1075
|
),
|
|
1076
1076
|
"aria-label": "Increase value",
|
|
1077
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { width: "8", height: "8", viewBox: "0 0 8 8", fill: "none", className: "
|
|
1077
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { width: "8", height: "8", viewBox: "0 0 8 8", fill: "none", className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M4 2L6 6H2L4 2Z", fill: "currentColor" }) })
|
|
1078
1078
|
}
|
|
1079
1079
|
),
|
|
1080
1080
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
@@ -1090,7 +1090,7 @@ var NumberInput = (0, import_react3.forwardRef)(
|
|
|
1090
1090
|
"text-muted-foreground hover:text-foreground"
|
|
1091
1091
|
),
|
|
1092
1092
|
"aria-label": "Decrease value",
|
|
1093
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { width: "8", height: "8", viewBox: "0 0 8 8", fill: "none", className: "
|
|
1093
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { width: "8", height: "8", viewBox: "0 0 8 8", fill: "none", className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M4 6L2 2H6L4 6Z", fill: "currentColor" }) })
|
|
1094
1094
|
}
|
|
1095
1095
|
)
|
|
1096
1096
|
] })
|
|
@@ -1171,7 +1171,7 @@ var Textarea = (0, import_react3.forwardRef)(
|
|
|
1171
1171
|
}
|
|
1172
1172
|
),
|
|
1173
1173
|
error && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex items-center gap-2 text-sm text-destructive animate-in slide-in-from-top-1 duration-200", children: [
|
|
1174
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react3.AlertCircle, { className: "w-4 h-4
|
|
1174
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react3.AlertCircle, { className: "w-4 h-4 shrink-0" }),
|
|
1175
1175
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: error })
|
|
1176
1176
|
] }),
|
|
1177
1177
|
description && !error && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: cn("text-xs transition-colors duration-200", isFocused ? "text-primary/70" : "text-muted-foreground"), children: description })
|
|
@@ -1244,7 +1244,7 @@ var Textarea2 = (0, import_react4.forwardRef)(
|
|
|
1244
1244
|
}
|
|
1245
1245
|
),
|
|
1246
1246
|
variant === "default" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: cn(
|
|
1247
|
-
"absolute bottom-0 left-0 h-0.5 bg-
|
|
1247
|
+
"absolute bottom-0 left-0 h-0.5 bg-linear-to-r from-primary to-primary/60 transition-all duration-300 ease-soft",
|
|
1248
1248
|
isFocused ? "w-full opacity-100" : "w-0 opacity-0"
|
|
1249
1249
|
) }),
|
|
1250
1250
|
isFocused && variant !== "outlined" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "absolute inset-0 rounded-lg bg-primary/5 -z-10 animate-pulse" })
|
|
@@ -1595,7 +1595,7 @@ var Avatar = ({ src, alt = "avatar", fallback = "?", size = "md", className, onC
|
|
|
1595
1595
|
"span",
|
|
1596
1596
|
{
|
|
1597
1597
|
className: cn(
|
|
1598
|
-
"font-bold uppercase bg-
|
|
1598
|
+
"font-bold uppercase bg-linear-to-br from-primary to-primary/80 bg-clip-text text-transparent",
|
|
1599
1599
|
"transition-all duration-200 animate-fade-in"
|
|
1600
1600
|
),
|
|
1601
1601
|
children: fallback
|
|
@@ -1626,7 +1626,7 @@ var Skeleton = ({
|
|
|
1626
1626
|
};
|
|
1627
1627
|
const animationClasses = {
|
|
1628
1628
|
pulse: "animate-pulse",
|
|
1629
|
-
wave: "animate-shimmer bg-
|
|
1629
|
+
wave: "animate-shimmer bg-linear-to-r from-muted via-muted/50 to-muted bg-size-[200%_100%]",
|
|
1630
1630
|
none: ""
|
|
1631
1631
|
};
|
|
1632
1632
|
if (variant === "text" && lines > 1) {
|
|
@@ -1815,11 +1815,11 @@ var import_lucide_react4 = require("lucide-react");
|
|
|
1815
1815
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1816
1816
|
var variantStyles2 = {
|
|
1817
1817
|
default: "bg-muted-foreground",
|
|
1818
|
-
primary: "bg-
|
|
1819
|
-
success: "bg-
|
|
1820
|
-
warning: "bg-
|
|
1821
|
-
danger: "bg-
|
|
1822
|
-
info: "bg-
|
|
1818
|
+
primary: "bg-linear-to-r from-primary via-primary/90 to-primary",
|
|
1819
|
+
success: "bg-linear-to-r from-success via-success/90 to-success shadow-sm shadow-success/20",
|
|
1820
|
+
warning: "bg-linear-to-r from-warning via-warning/90 to-warning shadow-sm shadow-warning/20",
|
|
1821
|
+
danger: "bg-linear-to-r from-destructive via-destructive/90 to-destructive shadow-sm shadow-destructive/20",
|
|
1822
|
+
info: "bg-linear-to-r from-info via-info/90 to-info shadow-sm shadow-info/20"
|
|
1823
1823
|
};
|
|
1824
1824
|
var sizeStyles2 = {
|
|
1825
1825
|
sm: "h-1.5",
|
|
@@ -1888,12 +1888,12 @@ var Progress = ({
|
|
|
1888
1888
|
"before:absolute before:inset-0 before:rounded-full before:opacity-30",
|
|
1889
1889
|
indeterminate && "animate-pulse",
|
|
1890
1890
|
!indeterminate && variantStyles2[variant],
|
|
1891
|
-
isComplete && "bg-
|
|
1892
|
-
isError && "bg-
|
|
1893
|
-
striped && "bg-
|
|
1891
|
+
isComplete && "bg-linear-to-r from-success via-success/90 to-success shadow-sm shadow-success/20",
|
|
1892
|
+
isError && "bg-linear-to-r from-destructive via-destructive/90 to-destructive shadow-sm shadow-destructive/20",
|
|
1893
|
+
striped && "bg-linear-to-r from-transparent via-primary-foreground/20 to-transparent bg-size-[1rem_1rem]",
|
|
1894
1894
|
animated && !indeterminate && "before:animate-pulse",
|
|
1895
1895
|
// Shimmer effect for indeterminate
|
|
1896
|
-
indeterminate && "bg-
|
|
1896
|
+
indeterminate && "bg-linear-to-r from-muted via-primary/50 to-muted bg-size-[200%_100%] animate-[shimmer_2s_infinite]"
|
|
1897
1897
|
),
|
|
1898
1898
|
style: {
|
|
1899
1899
|
width: indeterminate ? "100%" : `${percentage}%`,
|
|
@@ -2103,7 +2103,7 @@ var MiniProgress = ({
|
|
|
2103
2103
|
)
|
|
2104
2104
|
}
|
|
2105
2105
|
),
|
|
2106
|
-
showValue && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "text-xs font-medium text-muted-foreground min-w-
|
|
2106
|
+
showValue && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "text-xs font-medium text-muted-foreground min-w-10 text-right", children: [
|
|
2107
2107
|
Math.round(percentage),
|
|
2108
2108
|
"%"
|
|
2109
2109
|
] })
|
|
@@ -2337,7 +2337,7 @@ var Modal = ({
|
|
|
2337
2337
|
return null;
|
|
2338
2338
|
}
|
|
2339
2339
|
const maxWidthClass = width ? "max-w-none" : fullWidth ? "max-w-full" : sizeStyles3[size];
|
|
2340
|
-
const modalContent = /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: cn("fixed inset-0 z-
|
|
2340
|
+
const modalContent = /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: cn("fixed inset-0 z-9999 flex items-center justify-center", overlayClassName), onClick: handleOverlayClick, children: [
|
|
2341
2341
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2342
2342
|
"div",
|
|
2343
2343
|
{
|
|
@@ -2438,7 +2438,7 @@ var ToastProvider = ({ children, position = "top-right", maxToasts = 5 }) => {
|
|
|
2438
2438
|
};
|
|
2439
2439
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(ToastContext.Provider, { value: { addToast, removeToast, toasts }, children: [
|
|
2440
2440
|
children,
|
|
2441
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: cn("fixed z-
|
|
2441
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: cn("fixed z-99999 flex flex-col gap-2 pointer-events-none", positionClasses[position]), "aria-live": "polite", "aria-atomic": true, children: toasts.map((toast) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ToastComponent, { toast, onRemove: removeToast }, toast.id)) })
|
|
2442
2442
|
] });
|
|
2443
2443
|
};
|
|
2444
2444
|
var ToastComponent = ({ toast, onRemove }) => {
|
|
@@ -2672,7 +2672,7 @@ var Tooltip = ({
|
|
|
2672
2672
|
},
|
|
2673
2673
|
className: cn(
|
|
2674
2674
|
"px-3 py-2 text-sm font-medium rounded-lg shadow-lg border",
|
|
2675
|
-
"max-w-xs break-
|
|
2675
|
+
"max-w-xs wrap-break-word backdrop-blur-sm",
|
|
2676
2676
|
variantStyles3[variant],
|
|
2677
2677
|
className
|
|
2678
2678
|
),
|
|
@@ -3027,7 +3027,7 @@ var Popover = ({
|
|
|
3027
3027
|
role: "dialog",
|
|
3028
3028
|
"aria-modal": modal || void 0,
|
|
3029
3029
|
className: cn(
|
|
3030
|
-
"z-
|
|
3030
|
+
"z-9999",
|
|
3031
3031
|
// shadcn-like enter animation
|
|
3032
3032
|
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
3033
3033
|
className
|
|
@@ -3236,7 +3236,7 @@ var Sheet = ({
|
|
|
3236
3236
|
transition: "transform 300ms cubic-bezier(0.4, 0, 0.2, 1)"
|
|
3237
3237
|
},
|
|
3238
3238
|
children: [
|
|
3239
|
-
(title || description || header || showClose) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "
|
|
3239
|
+
(title || description || header || showClose) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "shrink-0 border-b border-border", children: header || /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center justify-between p-4", children: [
|
|
3240
3240
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex-1", children: [
|
|
3241
3241
|
title && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h2", { className: "text-lg font-semibold text-foreground", children: title }),
|
|
3242
3242
|
description && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-sm text-muted-foreground mt-1", children: description })
|
|
@@ -3255,7 +3255,7 @@ var Sheet = ({
|
|
|
3255
3255
|
children
|
|
3256
3256
|
}
|
|
3257
3257
|
),
|
|
3258
|
-
footer && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "
|
|
3258
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "shrink-0 border-t border-border p-4", children: footer })
|
|
3259
3259
|
]
|
|
3260
3260
|
}
|
|
3261
3261
|
)
|
|
@@ -3320,7 +3320,7 @@ var Alert = ({ title, description, variant = "default", className, icon, dismiss
|
|
|
3320
3320
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "pt-1", children: icon ?? variantIcons[variant] }),
|
|
3321
3321
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
3322
3322
|
title && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "font-semibold text-sm leading-none mb-1 text-foreground", children: title }),
|
|
3323
|
-
description && (typeof description === "string" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm text-muted-foreground leading-relaxed break-
|
|
3323
|
+
description && (typeof description === "string" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm text-muted-foreground leading-relaxed wrap-break-word", children: description }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "text-sm text-muted-foreground leading-relaxed wrap-break-word", children: description })),
|
|
3324
3324
|
actions && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "mt-2 flex flex-wrap gap-2", children: actions })
|
|
3325
3325
|
] }),
|
|
3326
3326
|
dismissible && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
@@ -3402,7 +3402,7 @@ var GlobalLoading = ({
|
|
|
3402
3402
|
"div",
|
|
3403
3403
|
{
|
|
3404
3404
|
className: cn(
|
|
3405
|
-
"inset-0 z-
|
|
3405
|
+
"inset-0 z-100000 flex items-center justify-center",
|
|
3406
3406
|
position === "fixed" ? "fixed" : "absolute",
|
|
3407
3407
|
backdrop && "bg-background/90 backdrop-blur-sm",
|
|
3408
3408
|
className
|
|
@@ -3839,7 +3839,7 @@ var VerticalTabs = ({
|
|
|
3839
3839
|
className,
|
|
3840
3840
|
...props
|
|
3841
3841
|
}) => {
|
|
3842
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: cn("flex gap-6", className), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: cn(sidebarWidth, "
|
|
3842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: cn("flex gap-6", className), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: cn(sidebarWidth, "shrink-0"), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3843
3843
|
Tabs,
|
|
3844
3844
|
{
|
|
3845
3845
|
...props,
|
|
@@ -4303,7 +4303,7 @@ var Combobox = ({
|
|
|
4303
4303
|
"outline-none focus:outline-none focus-visible:outline-none",
|
|
4304
4304
|
"hover:bg-accent hover:text-accent-foreground",
|
|
4305
4305
|
"focus:bg-accent focus:text-accent-foreground",
|
|
4306
|
-
"data-
|
|
4306
|
+
"data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
4307
4307
|
index === activeIndex && "bg-accent text-accent-foreground",
|
|
4308
4308
|
isSelected && "bg-accent text-accent-foreground"
|
|
4309
4309
|
),
|
|
@@ -4534,7 +4534,7 @@ var Pagination = ({
|
|
|
4534
4534
|
size,
|
|
4535
4535
|
onClick: () => onChange(pageNumber),
|
|
4536
4536
|
disabled,
|
|
4537
|
-
className: cn("min-w-
|
|
4537
|
+
className: cn("min-w-10", isActive && "font-semibold"),
|
|
4538
4538
|
"aria-label": labels?.pageNumber ? labels.pageNumber(pageNumber) : t("pageNumber", { page: pageNumber }),
|
|
4539
4539
|
"aria-current": isActive ? "page" : void 0,
|
|
4540
4540
|
children: pageNumber
|
|
@@ -4670,7 +4670,7 @@ var CompactPagination = ({
|
|
|
4670
4670
|
title: "Previous page"
|
|
4671
4671
|
}
|
|
4672
4672
|
),
|
|
4673
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "px-2 py-1 text-sm text-muted-foreground min-w-
|
|
4673
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "px-2 py-1 text-sm text-muted-foreground min-w-16 text-center", children: [
|
|
4674
4674
|
page,
|
|
4675
4675
|
" / ",
|
|
4676
4676
|
totalPages
|
|
@@ -5071,7 +5071,7 @@ var DatePicker = ({
|
|
|
5071
5071
|
size === "sm" ? "w-7 h-7 text-[12px]" : "w-8 h-8 text-sm",
|
|
5072
5072
|
"datepicker-day rounded-md focus:outline-none",
|
|
5073
5073
|
"transition-colors",
|
|
5074
|
-
isSelected ? "
|
|
5074
|
+
isSelected ? "bg-primary! text-primary-foreground font-bold ring-2 ring-primary-foreground/60 shadow-lg scale-105 z-10 hover:bg-primary! focus:bg-primary! focus:text-primary-foreground" : "hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",
|
|
5075
5075
|
isToday2 && !isSelected && "bg-accent text-accent-foreground font-semibold"
|
|
5076
5076
|
),
|
|
5077
5077
|
children: day
|
|
@@ -5096,7 +5096,7 @@ var DatePicker = ({
|
|
|
5096
5096
|
},
|
|
5097
5097
|
"data-state": isOpen ? "open" : "closed",
|
|
5098
5098
|
className: cn(
|
|
5099
|
-
"z-
|
|
5099
|
+
"z-9999",
|
|
5100
5100
|
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
5101
5101
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"
|
|
5102
5102
|
),
|
|
@@ -5359,7 +5359,7 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
|
|
|
5359
5359
|
style: { position: "absolute", top: dropdownPosition.top, left: dropdownPosition.left, width: dropdownPosition.width || 256, zIndex: 9999 },
|
|
5360
5360
|
"data-state": isOpen ? "open" : "closed",
|
|
5361
5361
|
className: cn(
|
|
5362
|
-
"z-
|
|
5362
|
+
"z-9999",
|
|
5363
5363
|
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
5364
5364
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"
|
|
5365
5365
|
),
|
|
@@ -6004,11 +6004,11 @@ function TimePicker({
|
|
|
6004
6004
|
),
|
|
6005
6005
|
(error || success || helperText) && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: cn("mt-1.5 flex items-start gap-1.5", sz.label), children: [
|
|
6006
6006
|
error && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center gap-1.5 text-destructive", children: [
|
|
6007
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react14.X, { className: "w-3.5 h-3.5
|
|
6007
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react14.X, { className: "w-3.5 h-3.5 shrink-0" }),
|
|
6008
6008
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: error })
|
|
6009
6009
|
] }),
|
|
6010
6010
|
success && !error && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center gap-1.5 text-green-600", children: [
|
|
6011
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react14.Check, { className: "w-3.5 h-3.5
|
|
6011
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react14.Check, { className: "w-3.5 h-3.5 shrink-0" }),
|
|
6012
6012
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: "Valid time selected" })
|
|
6013
6013
|
] }),
|
|
6014
6014
|
helperText && !error && !success && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-muted-foreground", children: helperText })
|
|
@@ -6497,13 +6497,13 @@ var MultiCombobox = ({
|
|
|
6497
6497
|
setOpen(next);
|
|
6498
6498
|
},
|
|
6499
6499
|
className: cn(
|
|
6500
|
-
"flex w-full items-center gap-2 rounded-lg border border-input bg-background shadow-sm min-h-
|
|
6500
|
+
"flex w-full items-center gap-2 rounded-lg border border-input bg-background shadow-sm min-h-10",
|
|
6501
6501
|
"px-3 py-2",
|
|
6502
6502
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
6503
6503
|
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
6504
6504
|
),
|
|
6505
6505
|
children: [
|
|
6506
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex items-center gap-1 flex-wrap min-h-
|
|
6506
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex items-center gap-1 flex-wrap min-h-6 flex-1", children: value.length > 0 ? showTags ? value.map((itemValue) => {
|
|
6507
6507
|
const option = normalizedOptions.find((o) => o.value === itemValue);
|
|
6508
6508
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { className: "inline-flex items-center gap-1 bg-accent text-accent-foreground rounded px-2 py-1 text-xs", children: [
|
|
6509
6509
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "truncate max-w-[120px]", children: option ? displayFormat(option) : itemValue }),
|
|
@@ -7019,7 +7019,7 @@ var Slider = React26.forwardRef(
|
|
|
7019
7019
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: cn("w-full space-y-2", containerClassName), children: [
|
|
7020
7020
|
(label || showValue) && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
7021
7021
|
label && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("label", { className: cn("text-sm font-medium text-foreground", labelClassName), children: label }),
|
|
7022
|
-
showValue && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: cn("text-xs font-mono text-muted-foreground min-w-
|
|
7022
|
+
showValue && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: cn("text-xs font-mono text-muted-foreground min-w-8 text-right", valueClassName), children: displayValue })
|
|
7023
7023
|
] }),
|
|
7024
7024
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: cn("relative flex items-center", sizeStyles8.container), children: [
|
|
7025
7025
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: cn("w-full rounded-full bg-secondary relative overflow-hidden", sizeStyles8.track, trackClassName), children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
@@ -7356,7 +7356,7 @@ function OverlayControls({
|
|
|
7356
7356
|
"div",
|
|
7357
7357
|
{
|
|
7358
7358
|
className: cn(
|
|
7359
|
-
"absolute bottom-0 left-0 right-0 pb-2 pt-8 bg-
|
|
7359
|
+
"absolute bottom-0 left-0 right-0 pb-2 pt-8 bg-linear-to-t from-black/40 to-transparent z-20 transition-opacity duration-200",
|
|
7360
7360
|
hoverClasses,
|
|
7361
7361
|
autoHide && !controlsVisible && "opacity-0 pointer-events-none",
|
|
7362
7362
|
className
|
|
@@ -8084,7 +8084,7 @@ function Carousel({
|
|
|
8084
8084
|
"div",
|
|
8085
8085
|
{
|
|
8086
8086
|
className: cn(
|
|
8087
|
-
"
|
|
8087
|
+
"shrink-0",
|
|
8088
8088
|
isHorizontal ? "h-full" : "w-full",
|
|
8089
8089
|
animation === "fade" && idx !== currentIndex && "opacity-0",
|
|
8090
8090
|
animation === "scale" && idx !== currentIndex && "scale-95",
|
|
@@ -8167,7 +8167,7 @@ function Carousel({
|
|
|
8167
8167
|
"div",
|
|
8168
8168
|
{
|
|
8169
8169
|
className: cn(
|
|
8170
|
-
"absolute bottom-0 left-0 right-0 flex gap-2 p-4 bg-
|
|
8170
|
+
"absolute bottom-0 left-0 right-0 flex gap-2 p-4 bg-linear-to-t from-black/50 to-transparent overflow-x-auto",
|
|
8171
8171
|
isHorizontal ? "flex-row" : "flex-col"
|
|
8172
8172
|
),
|
|
8173
8173
|
children: React29.Children.map(children, (child, idx) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
@@ -8175,7 +8175,7 @@ function Carousel({
|
|
|
8175
8175
|
{
|
|
8176
8176
|
onClick: () => scrollTo(idx),
|
|
8177
8177
|
className: cn(
|
|
8178
|
-
"
|
|
8178
|
+
"shrink-0 w-16 h-16 rounded-md overflow-hidden border-2 transition-all focus:outline-none focus:ring-2 focus:ring-primary",
|
|
8179
8179
|
idx === currentIndex ? "border-primary scale-110" : "border-transparent opacity-70 hover:opacity-100"
|
|
8180
8180
|
),
|
|
8181
8181
|
"aria-label": `Thumbnail ${idx + 1}`,
|
|
@@ -8452,8 +8452,8 @@ function FallingIcons({
|
|
|
8452
8452
|
"span",
|
|
8453
8453
|
{
|
|
8454
8454
|
className: cn(
|
|
8455
|
-
"block uv-spin hover:[
|
|
8456
|
-
physicsRotation ? "[
|
|
8455
|
+
"block uv-spin hover:animate-[var(--popName)_0.35s_ease-out_forwards]",
|
|
8456
|
+
physicsRotation ? "animate-[var(--physicsSpinName)_var(--spinDur)_ease-in-out_infinite]" : spin && "animate-[var(--spinName)_var(--spinDur)_linear_infinite]"
|
|
8457
8457
|
),
|
|
8458
8458
|
style: {
|
|
8459
8459
|
width: p.size,
|
|
@@ -9120,8 +9120,8 @@ var TimelineItem = React33.forwardRef(
|
|
|
9120
9120
|
outlined: "rounded-lg border border-border bg-card shadow-sm px-4 py-3",
|
|
9121
9121
|
card: "rounded-xl border border-border bg-card shadow-md px-5 py-4",
|
|
9122
9122
|
minimal: "border-l-2 pl-4 py-2",
|
|
9123
|
-
modern: "rounded-lg bg-
|
|
9124
|
-
gradient: "rounded-xl bg-
|
|
9123
|
+
modern: "rounded-lg bg-linear-to-r from-card to-muted/20 border border-border/50 px-5 py-4 backdrop-blur-sm",
|
|
9124
|
+
gradient: "rounded-xl bg-linear-to-br from-primary/10 via-card to-accent/10 border border-primary/20 px-5 py-4 shadow-lg"
|
|
9125
9125
|
};
|
|
9126
9126
|
const contentBox = /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: cn("min-w-0 flex-1", variantClasses[ctx.variant]), children: [
|
|
9127
9127
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex items-start justify-between gap-2", children: [
|
|
@@ -9148,12 +9148,12 @@ var TimelineItem = React33.forwardRef(
|
|
|
9148
9148
|
] });
|
|
9149
9149
|
const markerWidth = Icon || dot ? "w-auto" : "w-6";
|
|
9150
9150
|
const leftSide = /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: cn("flex items-stretch gap-4", padding, ctx.animate && "animate-in slide-in-from-left duration-500"), style: { animationDelay: ctx.animate ? `${(idx ?? 0) * 100}ms` : void 0 }, children: [
|
|
9151
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: cn("
|
|
9151
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: cn("shrink-0 flex items-stretch", markerWidth), children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Marker, { index: idx ?? 0, last: isLast, size: ctx.size, color, status, lineColor: ctx.lineColor, lineStyle: ctx.lineStyle, active, dot, icon: Icon, showLine: ctx.showLine }) }),
|
|
9152
9152
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex-1", children: contentBox })
|
|
9153
9153
|
] });
|
|
9154
9154
|
const rightSide = /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: cn("flex items-stretch gap-4", padding, ctx.animate && "animate-in slide-in-from-right duration-500"), style: { animationDelay: ctx.animate ? `${(idx ?? 0) * 100}ms` : void 0 }, children: [
|
|
9155
9155
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex-1 flex justify-end", children: contentBox }),
|
|
9156
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: cn("
|
|
9156
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: cn("shrink-0 flex items-stretch", markerWidth), children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Marker, { index: idx ?? 0, last: isLast, size: ctx.size, color, status, lineColor: ctx.lineColor, lineStyle: ctx.lineStyle, active, dot, icon: Icon, showLine: ctx.showLine }) })
|
|
9157
9157
|
] });
|
|
9158
9158
|
const horizontalItem = /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
9159
9159
|
"div",
|
|
@@ -10170,7 +10170,7 @@ function DataTable({
|
|
|
10170
10170
|
children: (() => {
|
|
10171
10171
|
const isRightAlign = col.align === "right" || !col.align && headerAlign === "right";
|
|
10172
10172
|
const isCenterAlign = col.align === "center" || !col.align && headerAlign === "center";
|
|
10173
|
-
const titleContent = /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-center gap-1 min-w-0
|
|
10173
|
+
const titleContent = /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-center gap-1 min-w-0 shrink", children: [
|
|
10174
10174
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "truncate font-medium text-sm", children: col.title }),
|
|
10175
10175
|
col.sortable && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
10176
10176
|
"button",
|
|
@@ -10261,7 +10261,7 @@ function DataTable({
|
|
|
10261
10261
|
"div",
|
|
10262
10262
|
{
|
|
10263
10263
|
className: cn(
|
|
10264
|
-
"flex items-center gap-2 select-none min-h-
|
|
10264
|
+
"flex items-center gap-2 select-none min-h-10",
|
|
10265
10265
|
isRightAlign && "justify-end",
|
|
10266
10266
|
isCenterAlign && "justify-center",
|
|
10267
10267
|
!isRightAlign && !isCenterAlign && "justify-between"
|
|
@@ -10387,7 +10387,7 @@ function DataTable({
|
|
|
10387
10387
|
Table,
|
|
10388
10388
|
{
|
|
10389
10389
|
containerClassName: "border-0 md:border-0 rounded-none md:rounded-none shadow-none bg-transparent",
|
|
10390
|
-
className: "[&_thead]:sticky [&_thead]:top-0 [&_thead]:z-
|
|
10390
|
+
className: "[&_thead]:sticky [&_thead]:top-0 [&_thead]:z-5 [&_thead]:bg-background [&_thead]:backdrop-blur-sm",
|
|
10391
10391
|
children: [
|
|
10392
10392
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TableHeader, { children: renderHeader }),
|
|
10393
10393
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TableBody, { children: loading2 ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TableRow, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TableCell, { colSpan: visibleColumns.length, className: "text-center py-8", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-center justify-center gap-2 text-muted-foreground", children: [
|
|
@@ -10467,25 +10467,23 @@ var isPlainObject = (tempObject) => {
|
|
|
10467
10467
|
};
|
|
10468
10468
|
var isWeb = typeof window !== "undefined" && typeof window.HTMLElement !== "undefined" && typeof document !== "undefined";
|
|
10469
10469
|
function cloneObject(data) {
|
|
10470
|
-
let copy;
|
|
10471
|
-
const isArray = Array.isArray(data);
|
|
10472
|
-
const isFileListInstance = typeof FileList !== "undefined" ? data instanceof FileList : false;
|
|
10473
10470
|
if (data instanceof Date) {
|
|
10474
|
-
|
|
10475
|
-
}
|
|
10476
|
-
|
|
10477
|
-
|
|
10478
|
-
|
|
10479
|
-
|
|
10480
|
-
|
|
10481
|
-
|
|
10482
|
-
copy[key] = cloneObject(data[key]);
|
|
10483
|
-
}
|
|
10484
|
-
}
|
|
10485
|
-
}
|
|
10486
|
-
} else {
|
|
10471
|
+
return new Date(data);
|
|
10472
|
+
}
|
|
10473
|
+
const isFileListInstance = typeof FileList !== "undefined" && data instanceof FileList;
|
|
10474
|
+
if (isWeb && (data instanceof Blob || isFileListInstance)) {
|
|
10475
|
+
return data;
|
|
10476
|
+
}
|
|
10477
|
+
const isArray = Array.isArray(data);
|
|
10478
|
+
if (!isArray && !(isObject(data) && isPlainObject(data))) {
|
|
10487
10479
|
return data;
|
|
10488
10480
|
}
|
|
10481
|
+
const copy = isArray ? [] : Object.create(Object.getPrototypeOf(data));
|
|
10482
|
+
for (const key in data) {
|
|
10483
|
+
if (Object.prototype.hasOwnProperty.call(data, key)) {
|
|
10484
|
+
copy[key] = cloneObject(data[key]);
|
|
10485
|
+
}
|
|
10486
|
+
}
|
|
10489
10487
|
return copy;
|
|
10490
10488
|
}
|
|
10491
10489
|
var isKey = (value) => /^\w*$/.test(value);
|
|
@@ -10500,6 +10498,7 @@ var get = (object, path, defaultValue) => {
|
|
|
10500
10498
|
return isUndefined(result) || result === object ? isUndefined(object[path]) ? defaultValue : object[path] : result;
|
|
10501
10499
|
};
|
|
10502
10500
|
var isBoolean = (value) => typeof value === "boolean";
|
|
10501
|
+
var isFunction = (value) => typeof value === "function";
|
|
10503
10502
|
var set = (object, path, value) => {
|
|
10504
10503
|
let index = -1;
|
|
10505
10504
|
const tempPath = isKey(path) ? [path] : stringToPath(path);
|
|
@@ -10611,7 +10610,7 @@ var generateWatchOutput = (names, _names, formValues, isGlobal, defaultValue) =>
|
|
|
10611
10610
|
var isPrimitive = (value) => isNullOrUndefined(value) || !isObjectType(value);
|
|
10612
10611
|
function deepEqual(object1, object2, _internal_visited = /* @__PURE__ */ new WeakSet()) {
|
|
10613
10612
|
if (isPrimitive(object1) || isPrimitive(object2)) {
|
|
10614
|
-
return object1
|
|
10613
|
+
return Object.is(object1, object2);
|
|
10615
10614
|
}
|
|
10616
10615
|
if (isDateObject(object1) && isDateObject(object2)) {
|
|
10617
10616
|
return object1.getTime() === object2.getTime();
|
|
@@ -10633,7 +10632,7 @@ function deepEqual(object1, object2, _internal_visited = /* @__PURE__ */ new Wea
|
|
|
10633
10632
|
}
|
|
10634
10633
|
if (key !== "ref") {
|
|
10635
10634
|
const val2 = object2[key];
|
|
10636
|
-
if (isDateObject(val1) && isDateObject(val2) || isObject(val1) && isObject(val2) || Array.isArray(val1) && Array.isArray(val2) ? !deepEqual(val1, val2, _internal_visited) : val1
|
|
10635
|
+
if (isDateObject(val1) && isDateObject(val2) || isObject(val1) && isObject(val2) || Array.isArray(val1) && Array.isArray(val2) ? !deepEqual(val1, val2, _internal_visited) : !Object.is(val1, val2)) {
|
|
10637
10636
|
return false;
|
|
10638
10637
|
}
|
|
10639
10638
|
}
|
|
@@ -10646,48 +10645,76 @@ function useWatch(props) {
|
|
|
10646
10645
|
const _defaultValue = import_react24.default.useRef(defaultValue);
|
|
10647
10646
|
const _compute = import_react24.default.useRef(compute);
|
|
10648
10647
|
const _computeFormValues = import_react24.default.useRef(void 0);
|
|
10648
|
+
const _prevControl = import_react24.default.useRef(control);
|
|
10649
|
+
const _prevName = import_react24.default.useRef(name);
|
|
10649
10650
|
_compute.current = compute;
|
|
10650
|
-
const
|
|
10651
|
-
|
|
10652
|
-
|
|
10653
|
-
|
|
10654
|
-
|
|
10655
|
-
|
|
10656
|
-
|
|
10657
|
-
|
|
10658
|
-
|
|
10659
|
-
|
|
10660
|
-
|
|
10661
|
-
|
|
10662
|
-
|
|
10663
|
-
|
|
10664
|
-
|
|
10665
|
-
|
|
10666
|
-
}
|
|
10667
|
-
} else {
|
|
10668
|
-
updateValue(formValues);
|
|
10651
|
+
const [value, updateValue] = import_react24.default.useState(() => {
|
|
10652
|
+
const defaultValue2 = control._getWatch(name, _defaultValue.current);
|
|
10653
|
+
return _compute.current ? _compute.current(defaultValue2) : defaultValue2;
|
|
10654
|
+
});
|
|
10655
|
+
const getCurrentOutput = import_react24.default.useCallback((values) => {
|
|
10656
|
+
const formValues = generateWatchOutput(name, control._names, values || control._formValues, false, _defaultValue.current);
|
|
10657
|
+
return _compute.current ? _compute.current(formValues) : formValues;
|
|
10658
|
+
}, [control._formValues, control._names, name]);
|
|
10659
|
+
const refreshValue = import_react24.default.useCallback((values) => {
|
|
10660
|
+
if (!disabled) {
|
|
10661
|
+
const formValues = generateWatchOutput(name, control._names, values || control._formValues, false, _defaultValue.current);
|
|
10662
|
+
if (_compute.current) {
|
|
10663
|
+
const computedFormValues = _compute.current(formValues);
|
|
10664
|
+
if (!deepEqual(computedFormValues, _computeFormValues.current)) {
|
|
10665
|
+
updateValue(computedFormValues);
|
|
10666
|
+
_computeFormValues.current = computedFormValues;
|
|
10669
10667
|
}
|
|
10668
|
+
} else {
|
|
10669
|
+
updateValue(formValues);
|
|
10670
10670
|
}
|
|
10671
10671
|
}
|
|
10672
|
-
}
|
|
10672
|
+
}, [control._formValues, control._names, disabled, name]);
|
|
10673
|
+
useIsomorphicLayoutEffect(() => {
|
|
10674
|
+
if (_prevControl.current !== control || !deepEqual(_prevName.current, name)) {
|
|
10675
|
+
_prevControl.current = control;
|
|
10676
|
+
_prevName.current = name;
|
|
10677
|
+
refreshValue();
|
|
10678
|
+
}
|
|
10679
|
+
return control._subscribe({
|
|
10680
|
+
name,
|
|
10681
|
+
formState: {
|
|
10682
|
+
values: true
|
|
10683
|
+
},
|
|
10684
|
+
exact,
|
|
10685
|
+
callback: (formState) => {
|
|
10686
|
+
refreshValue(formState.values);
|
|
10687
|
+
}
|
|
10688
|
+
});
|
|
10689
|
+
}, [control, exact, name, refreshValue]);
|
|
10673
10690
|
import_react24.default.useEffect(() => control._removeUnmounted());
|
|
10674
|
-
|
|
10691
|
+
const controlChanged = _prevControl.current !== control;
|
|
10692
|
+
const prevName = _prevName.current;
|
|
10693
|
+
const computedOutput = import_react24.default.useMemo(() => {
|
|
10694
|
+
if (disabled) {
|
|
10695
|
+
return null;
|
|
10696
|
+
}
|
|
10697
|
+
const nameChanged = !controlChanged && !deepEqual(prevName, name);
|
|
10698
|
+
const shouldReturnImmediate = controlChanged || nameChanged;
|
|
10699
|
+
return shouldReturnImmediate ? getCurrentOutput() : null;
|
|
10700
|
+
}, [disabled, controlChanged, name, prevName, getCurrentOutput]);
|
|
10701
|
+
return computedOutput !== null ? computedOutput : value;
|
|
10675
10702
|
}
|
|
10676
10703
|
function useController(props) {
|
|
10677
10704
|
const methods = useFormContext();
|
|
10678
|
-
const { name, disabled, control = methods.control, shouldUnregister, defaultValue } = props;
|
|
10705
|
+
const { name, disabled, control = methods.control, shouldUnregister, defaultValue, exact = true } = props;
|
|
10679
10706
|
const isArrayField = isNameInFieldArray(control._names.array, name);
|
|
10680
10707
|
const defaultValueMemo = import_react24.default.useMemo(() => get(control._formValues, name, get(control._defaultValues, name, defaultValue)), [control, name, defaultValue]);
|
|
10681
10708
|
const value = useWatch({
|
|
10682
10709
|
control,
|
|
10683
10710
|
name,
|
|
10684
10711
|
defaultValue: defaultValueMemo,
|
|
10685
|
-
exact
|
|
10712
|
+
exact
|
|
10686
10713
|
});
|
|
10687
10714
|
const formState = useFormState({
|
|
10688
10715
|
control,
|
|
10689
10716
|
name,
|
|
10690
|
-
exact
|
|
10717
|
+
exact
|
|
10691
10718
|
});
|
|
10692
10719
|
const _props = import_react24.default.useRef(props);
|
|
10693
10720
|
const _previousNameRef = import_react24.default.useRef(void 0);
|
|
@@ -10735,12 +10762,12 @@ function useController(props) {
|
|
|
10735
10762
|
}), [name, control._formValues]);
|
|
10736
10763
|
const ref = import_react24.default.useCallback((elm) => {
|
|
10737
10764
|
const field2 = get(control._fields, name);
|
|
10738
|
-
if (field2 && elm) {
|
|
10765
|
+
if (field2 && field2._f && elm) {
|
|
10739
10766
|
field2._f.ref = {
|
|
10740
|
-
focus: () => elm.focus && elm.focus(),
|
|
10741
|
-
select: () => elm.select && elm.select(),
|
|
10742
|
-
setCustomValidity: (message) => elm.setCustomValidity(message),
|
|
10743
|
-
reportValidity: () => elm.reportValidity()
|
|
10767
|
+
focus: () => isFunction(elm.focus) && elm.focus(),
|
|
10768
|
+
select: () => isFunction(elm.select) && elm.select(),
|
|
10769
|
+
setCustomValidity: (message) => isFunction(elm.setCustomValidity) && elm.setCustomValidity(message),
|
|
10770
|
+
reportValidity: () => isFunction(elm.reportValidity) && elm.reportValidity()
|
|
10744
10771
|
};
|
|
10745
10772
|
}
|
|
10746
10773
|
}, [control._fields, name]);
|
|
@@ -10850,7 +10877,6 @@ function extractFormValues(fieldsState, formValues) {
|
|
|
10850
10877
|
}
|
|
10851
10878
|
var isEmptyObject = (value) => isObject(value) && !Object.keys(value).length;
|
|
10852
10879
|
var isFileInput = (element) => element.type === "file";
|
|
10853
|
-
var isFunction = (value) => typeof value === "function";
|
|
10854
10880
|
var isHTMLElement = (value) => {
|
|
10855
10881
|
if (!isWeb) {
|
|
10856
10882
|
return false;
|
|
@@ -10904,10 +10930,11 @@ function isTraversable(value) {
|
|
|
10904
10930
|
}
|
|
10905
10931
|
function markFieldsDirty(data, fields = {}) {
|
|
10906
10932
|
for (const key in data) {
|
|
10907
|
-
|
|
10908
|
-
|
|
10909
|
-
|
|
10910
|
-
|
|
10933
|
+
const value = data[key];
|
|
10934
|
+
if (isTraversable(value)) {
|
|
10935
|
+
fields[key] = Array.isArray(value) ? [] : {};
|
|
10936
|
+
markFieldsDirty(value, fields[key]);
|
|
10937
|
+
} else if (!isUndefined(value)) {
|
|
10911
10938
|
fields[key] = true;
|
|
10912
10939
|
}
|
|
10913
10940
|
}
|
|
@@ -10918,14 +10945,16 @@ function getDirtyFields(data, formValues, dirtyFieldsFromValues) {
|
|
|
10918
10945
|
dirtyFieldsFromValues = markFieldsDirty(formValues);
|
|
10919
10946
|
}
|
|
10920
10947
|
for (const key in data) {
|
|
10921
|
-
|
|
10948
|
+
const value = data[key];
|
|
10949
|
+
if (isTraversable(value)) {
|
|
10922
10950
|
if (isUndefined(formValues) || isPrimitive(dirtyFieldsFromValues[key])) {
|
|
10923
|
-
dirtyFieldsFromValues[key] = markFieldsDirty(
|
|
10951
|
+
dirtyFieldsFromValues[key] = markFieldsDirty(value, Array.isArray(value) ? [] : {});
|
|
10924
10952
|
} else {
|
|
10925
|
-
getDirtyFields(
|
|
10953
|
+
getDirtyFields(value, isNullOrUndefined(formValues) ? {} : formValues[key], dirtyFieldsFromValues[key]);
|
|
10926
10954
|
}
|
|
10927
10955
|
} else {
|
|
10928
|
-
|
|
10956
|
+
const formValue = formValues[key];
|
|
10957
|
+
dirtyFieldsFromValues[key] = !deepEqual(value, formValue);
|
|
10929
10958
|
}
|
|
10930
10959
|
}
|
|
10931
10960
|
return dirtyFieldsFromValues;
|
|
@@ -11277,7 +11306,8 @@ function createFormControl(props = {}) {
|
|
|
11277
11306
|
let _state = {
|
|
11278
11307
|
action: false,
|
|
11279
11308
|
mount: false,
|
|
11280
|
-
watch: false
|
|
11309
|
+
watch: false,
|
|
11310
|
+
keepIsValid: false
|
|
11281
11311
|
};
|
|
11282
11312
|
let _names = {
|
|
11283
11313
|
mount: /* @__PURE__ */ new Set(),
|
|
@@ -11288,7 +11318,7 @@ function createFormControl(props = {}) {
|
|
|
11288
11318
|
};
|
|
11289
11319
|
let delayErrorCallback;
|
|
11290
11320
|
let timer = 0;
|
|
11291
|
-
const
|
|
11321
|
+
const defaultProxyFormState = {
|
|
11292
11322
|
isDirty: false,
|
|
11293
11323
|
dirtyFields: false,
|
|
11294
11324
|
validatingFields: false,
|
|
@@ -11297,6 +11327,9 @@ function createFormControl(props = {}) {
|
|
|
11297
11327
|
isValid: false,
|
|
11298
11328
|
errors: false
|
|
11299
11329
|
};
|
|
11330
|
+
const _proxyFormState = {
|
|
11331
|
+
...defaultProxyFormState
|
|
11332
|
+
};
|
|
11300
11333
|
let _proxySubscribeFormState = {
|
|
11301
11334
|
..._proxyFormState
|
|
11302
11335
|
};
|
|
@@ -11310,8 +11343,17 @@ function createFormControl(props = {}) {
|
|
|
11310
11343
|
timer = setTimeout(callback, wait);
|
|
11311
11344
|
};
|
|
11312
11345
|
const _setValid = async (shouldUpdateValid) => {
|
|
11346
|
+
if (_state.keepIsValid) {
|
|
11347
|
+
return;
|
|
11348
|
+
}
|
|
11313
11349
|
if (!_options.disabled && (_proxyFormState.isValid || _proxySubscribeFormState.isValid || shouldUpdateValid)) {
|
|
11314
|
-
|
|
11350
|
+
let isValid;
|
|
11351
|
+
if (_options.resolver) {
|
|
11352
|
+
isValid = isEmptyObject((await _runSchema()).errors);
|
|
11353
|
+
_updateIsValidating();
|
|
11354
|
+
} else {
|
|
11355
|
+
isValid = await executeBuiltInValidation(_fields, true);
|
|
11356
|
+
}
|
|
11315
11357
|
if (isValid !== _formState.isValid) {
|
|
11316
11358
|
_subjects.state.next({
|
|
11317
11359
|
isValid
|
|
@@ -11380,7 +11422,7 @@ function createFormControl(props = {}) {
|
|
|
11380
11422
|
if (field) {
|
|
11381
11423
|
const defaultValue = get(_formValues, name, isUndefined(value) ? get(_defaultValues, name) : value);
|
|
11382
11424
|
isUndefined(defaultValue) || ref && ref.defaultChecked || shouldSkipSetValueAs ? set(_formValues, name, shouldSkipSetValueAs ? defaultValue : getFieldValue(field._f)) : setFieldValue(name, defaultValue);
|
|
11383
|
-
_state.mount && _setValid();
|
|
11425
|
+
_state.mount && !_state.action && _setValid();
|
|
11384
11426
|
}
|
|
11385
11427
|
};
|
|
11386
11428
|
const updateTouchAndDirty = (name, fieldValue, isBlurEvent, shouldDirty, shouldRender) => {
|
|
@@ -11442,11 +11484,11 @@ function createFormControl(props = {}) {
|
|
|
11442
11484
|
const _runSchema = async (name) => {
|
|
11443
11485
|
_updateIsValidating(name, true);
|
|
11444
11486
|
const result = await _options.resolver(_formValues, _options.context, getResolverOptions(name || _names.mount, _fields, _options.criteriaMode, _options.shouldUseNativeValidation));
|
|
11445
|
-
_updateIsValidating(name);
|
|
11446
11487
|
return result;
|
|
11447
11488
|
};
|
|
11448
11489
|
const executeSchemaAndUpdateState = async (names) => {
|
|
11449
11490
|
const { errors } = await _runSchema(names);
|
|
11491
|
+
_updateIsValidating(names);
|
|
11450
11492
|
if (names) {
|
|
11451
11493
|
for (const name of names) {
|
|
11452
11494
|
const error = get(errors, name);
|
|
@@ -11625,6 +11667,7 @@ function createFormControl(props = {}) {
|
|
|
11625
11667
|
!isBlurEvent && watched && _subjects.state.next({ ..._formState });
|
|
11626
11668
|
if (_options.resolver) {
|
|
11627
11669
|
const { errors } = await _runSchema([name]);
|
|
11670
|
+
_updateIsValidating([name]);
|
|
11628
11671
|
_updateIsFieldValueUpdated(fieldValue);
|
|
11629
11672
|
if (isFieldValueUpdated) {
|
|
11630
11673
|
const previousErrorLookupResult = schemaErrorLookup(_formState.errors, _fields, name);
|
|
@@ -11745,7 +11788,10 @@ function createFormControl(props = {}) {
|
|
|
11745
11788
|
};
|
|
11746
11789
|
return _subscribe({
|
|
11747
11790
|
...props2,
|
|
11748
|
-
formState:
|
|
11791
|
+
formState: {
|
|
11792
|
+
...defaultProxyFormState,
|
|
11793
|
+
...props2.formState
|
|
11794
|
+
}
|
|
11749
11795
|
});
|
|
11750
11796
|
};
|
|
11751
11797
|
const unregister = (name, options = {}) => {
|
|
@@ -11873,6 +11919,7 @@ function createFormControl(props = {}) {
|
|
|
11873
11919
|
});
|
|
11874
11920
|
if (_options.resolver) {
|
|
11875
11921
|
const { errors, values } = await _runSchema();
|
|
11922
|
+
_updateIsValidating();
|
|
11876
11923
|
_formState.errors = errors;
|
|
11877
11924
|
fieldValues = cloneObject(values);
|
|
11878
11925
|
} else {
|
|
@@ -11991,8 +12038,13 @@ function createFormControl(props = {}) {
|
|
|
11991
12038
|
watchAll: false,
|
|
11992
12039
|
focus: ""
|
|
11993
12040
|
};
|
|
11994
|
-
_state.mount = !_proxyFormState.isValid || !!keepStateOptions.keepIsValid || !!keepStateOptions.keepDirtyValues;
|
|
12041
|
+
_state.mount = !_proxyFormState.isValid || !!keepStateOptions.keepIsValid || !!keepStateOptions.keepDirtyValues || !_options.shouldUnregister && !isEmptyObject(values);
|
|
11995
12042
|
_state.watch = !!_options.shouldUnregister;
|
|
12043
|
+
_state.keepIsValid = !!keepStateOptions.keepIsValid;
|
|
12044
|
+
_state.action = false;
|
|
12045
|
+
if (!keepStateOptions.keepErrors) {
|
|
12046
|
+
_formState.errors = {};
|
|
12047
|
+
}
|
|
11996
12048
|
_subjects.state.next({
|
|
11997
12049
|
submitCount: keepStateOptions.keepSubmitCount ? _formState.submitCount : 0,
|
|
11998
12050
|
isDirty: isEmptyResetValues ? false : keepStateOptions.keepDirty ? _formState.isDirty : !!(keepStateOptions.keepDefaultValues && !deepEqual(formValues, _defaultValues)),
|
|
@@ -12005,15 +12057,17 @@ function createFormControl(props = {}) {
|
|
|
12005
12057
|
defaultValues: _defaultValues
|
|
12006
12058
|
});
|
|
12007
12059
|
};
|
|
12008
|
-
const reset = (formValues, keepStateOptions) => _reset(isFunction(formValues) ? formValues(_formValues) : formValues, keepStateOptions);
|
|
12060
|
+
const reset = (formValues, keepStateOptions) => _reset(isFunction(formValues) ? formValues(_formValues) : formValues, { ..._options.resetOptions, ...keepStateOptions });
|
|
12009
12061
|
const setFocus = (name, options = {}) => {
|
|
12010
12062
|
const field = get(_fields, name);
|
|
12011
12063
|
const fieldReference = field && field._f;
|
|
12012
12064
|
if (fieldReference) {
|
|
12013
12065
|
const fieldRef = fieldReference.refs ? fieldReference.refs[0] : fieldReference.ref;
|
|
12014
12066
|
if (fieldRef.focus) {
|
|
12015
|
-
|
|
12016
|
-
|
|
12067
|
+
setTimeout(() => {
|
|
12068
|
+
fieldRef.focus();
|
|
12069
|
+
options.shouldSelect && isFunction(fieldRef.select) && fieldRef.select();
|
|
12070
|
+
});
|
|
12017
12071
|
}
|
|
12018
12072
|
}
|
|
12019
12073
|
};
|
|
@@ -12038,6 +12092,7 @@ function createFormControl(props = {}) {
|
|
|
12038
12092
|
setError,
|
|
12039
12093
|
_subscribe,
|
|
12040
12094
|
_runSchema,
|
|
12095
|
+
_updateIsValidating,
|
|
12041
12096
|
_focusError,
|
|
12042
12097
|
_getWatch,
|
|
12043
12098
|
_getDirty,
|
|
@@ -12189,11 +12244,15 @@ function useForm(props = {}) {
|
|
|
12189
12244
|
}
|
|
12190
12245
|
}, [control, formState.isDirty]);
|
|
12191
12246
|
import_react24.default.useEffect(() => {
|
|
12247
|
+
var _a;
|
|
12192
12248
|
if (props.values && !deepEqual(props.values, _values.current)) {
|
|
12193
12249
|
control._reset(props.values, {
|
|
12194
12250
|
keepFieldsRef: true,
|
|
12195
12251
|
...control._options.resetOptions
|
|
12196
12252
|
});
|
|
12253
|
+
if (!((_a = control._options.resetOptions) === null || _a === void 0 ? void 0 : _a.keepIsValid)) {
|
|
12254
|
+
control._setValid();
|
|
12255
|
+
}
|
|
12197
12256
|
_values.current = props.values;
|
|
12198
12257
|
updateFormState((state) => ({ ...state }));
|
|
12199
12258
|
} else {
|
|
@@ -12493,7 +12552,7 @@ function FloatingContacts({ className }) {
|
|
|
12493
12552
|
external: true
|
|
12494
12553
|
}
|
|
12495
12554
|
];
|
|
12496
|
-
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: cn("fixed bottom-6 right-4 z-
|
|
12555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: cn("fixed bottom-6 right-4 z-100000", "flex flex-col items-end gap-3", className), "aria-label": "Quick contacts", children: [
|
|
12497
12556
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12498
12557
|
import_link2.default,
|
|
12499
12558
|
{
|
|
@@ -12616,12 +12675,12 @@ function ThemeToggleHeadless({
|
|
|
12616
12675
|
}
|
|
12617
12676
|
),
|
|
12618
12677
|
isOpen && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
12619
|
-
typeof window !== "undefined" && (0, import_react_dom10.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "fixed inset-0 z-
|
|
12678
|
+
typeof window !== "undefined" && (0, import_react_dom10.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "fixed inset-0 z-9998", onClick: () => setIsOpen(false) }), document.body),
|
|
12620
12679
|
typeof window !== "undefined" && dropdownPosition && (0, import_react_dom10.createPortal)(
|
|
12621
12680
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
12622
12681
|
"div",
|
|
12623
12682
|
{
|
|
12624
|
-
className: "z-
|
|
12683
|
+
className: "z-9999 bg-card border border-border rounded-lg shadow-lg overflow-hidden",
|
|
12625
12684
|
style: { position: "absolute", top: dropdownPosition.top, left: dropdownPosition.left, width: dropdownPosition.width },
|
|
12626
12685
|
onMouseDown: (e) => e.stopPropagation(),
|
|
12627
12686
|
role: "menu",
|
|
@@ -12713,12 +12772,12 @@ function LanguageSwitcherHeadless({
|
|
|
12713
12772
|
}
|
|
12714
12773
|
),
|
|
12715
12774
|
isOpen && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
|
|
12716
|
-
typeof window !== "undefined" && (0, import_react_dom11.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "fixed inset-0 z-
|
|
12775
|
+
typeof window !== "undefined" && (0, import_react_dom11.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "fixed inset-0 z-9998", onClick: () => setIsOpen(false) }), document.body),
|
|
12717
12776
|
typeof window !== "undefined" && dropdownPosition && (0, import_react_dom11.createPortal)(
|
|
12718
12777
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12719
12778
|
"div",
|
|
12720
12779
|
{
|
|
12721
|
-
className: "z-
|
|
12780
|
+
className: "z-9999 bg-card border border-border rounded-lg shadow-lg overflow-hidden",
|
|
12722
12781
|
style: { position: "absolute", top: dropdownPosition.top, left: dropdownPosition.left, width: dropdownPosition.width },
|
|
12723
12782
|
onMouseDown: (e) => e.stopPropagation(),
|
|
12724
12783
|
role: "menu",
|