@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.js CHANGED
@@ -27,13 +27,13 @@ var VARIANT_STYLES_BTN = {
27
27
  // Link: chỉ văn bản
28
28
  link: "text-primary bg-transparent underline-offset-4 hover:underline hover:text-primary/85 transition-colors",
29
29
  // Gradient: tuỳ chọn, giảm shadow
30
- gradient: "bg-gradient-to-r from-primary via-secondary to-accent text-primary-foreground hover:opacity-90 shadow-sm border border-primary/10"
30
+ gradient: "bg-linear-to-r from-primary via-secondary to-accent text-primary-foreground hover:opacity-90 shadow-sm border border-primary/10"
31
31
  };
32
32
  var SIZE_STYLES_BTN = {
33
- sm: "px-3 py-1.5 text-sm h-8 min-w-[2rem] md:px-2.5 md:py-1 md:h-7 md:text-xs",
34
- md: "px-4 py-2 text-sm h-10 min-w-[2.5rem] md:px-3 md:py-1.5 md:h-9",
35
- lg: "px-6 py-3 text-base h-12 min-w-[3rem] md:px-4 md:py-2 md:h-10 md:text-sm",
36
- smx: "px-3.5 py-1.5 text-[13px] h-9 min-w-[2.25rem] md:px-3 md:py-1 md:h-8 md:text-xs",
33
+ 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",
34
+ md: "px-4 py-2 text-sm h-10 min-w-10 md:px-3 md:py-1.5 md:h-9",
35
+ lg: "px-6 py-3 text-base h-12 min-w-12 md:px-4 md:py-2 md:h-10 md:text-sm",
36
+ 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",
37
37
  icon: "w-11 h-11 p-0 rounded-full flex items-center justify-center md:w-10 md:h-10"
38
38
  };
39
39
 
@@ -134,7 +134,7 @@ var Button = forwardRef(
134
134
  "aria-label": rest["aria-label"] || title,
135
135
  ...rest,
136
136
  children: [
137
- !noHoverOverlay && /* @__PURE__ */ jsx("span", { className: "absolute inset-0 bg-gradient-to-r from-primary-foreground/20 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-200 dark:hidden" }),
137
+ !noHoverOverlay && /* @__PURE__ */ 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" }),
138
138
  loading2 ? /* @__PURE__ */ jsxs(Fragment, { children: [
139
139
  /* @__PURE__ */ jsx(SpinnerIcon, { className: "w-4 h-4 animate-spin" }),
140
140
  loadingText && /* @__PURE__ */ jsx("span", { className: "ml-2", "aria-live": "polite", children: loadingText }),
@@ -166,7 +166,7 @@ var variantStyles = {
166
166
  outline: "bg-transparent text-foreground border-border hover:bg-accent/50",
167
167
  ghost: "bg-transparent hover:bg-accent/20 hover:text-accent-foreground border-transparent transition-colors",
168
168
  transparent: "bg-transparent text-foreground border-transparent hover:bg-accent/30",
169
- gradient: "bg-gradient-to-r from-primary to-secondary text-primary-foreground border-transparent hover:from-primary/90 hover:to-secondary/90"
169
+ gradient: "bg-linear-to-r from-primary to-secondary text-primary-foreground border-transparent hover:from-primary/90 hover:to-secondary/90"
170
170
  };
171
171
  var sizeStyles = {
172
172
  xs: "px-1.5 py-0.5 text-xs font-medium min-h-[18px]",
@@ -243,12 +243,12 @@ var Badge = ({
243
243
  className: cn(
244
244
  baseClasses,
245
245
  "justify-center rounded-full",
246
- "min-w-[1.5rem] h-6 px-1.5 text-xs font-bold",
247
- size === "xs" && "min-w-[1.25rem] h-5 px-1 text-xs",
248
- size === "sm" && "min-w-[1.5rem] h-6 px-1.5 text-xs",
249
- size === "md" && "min-w-[1.75rem] h-7 px-2 text-xs",
250
- size === "lg" && "min-w-[2rem] h-8 px-2.5 text-sm",
251
- size === "xl" && "min-w-[2.25rem] h-9 px-3 text-sm",
246
+ "min-w-6 h-6 px-1.5 text-xs font-bold",
247
+ size === "xs" && "min-w-5 h-5 px-1 text-xs",
248
+ size === "sm" && "min-w-6 h-6 px-1.5 text-xs",
249
+ size === "md" && "min-w-7 h-7 px-2 text-xs",
250
+ size === "lg" && "min-w-8 h-8 px-2.5 text-sm",
251
+ size === "xl" && "min-w-9 h-9 px-3 text-sm",
252
252
  className
253
253
  ),
254
254
  onClick: handleClick,
@@ -263,7 +263,7 @@ var Badge = ({
263
263
  Icon,
264
264
  {
265
265
  className: cn(
266
- "flex-shrink-0",
266
+ "shrink-0",
267
267
  size === "xs" && "h-3 w-3",
268
268
  size === "sm" && "h-3 w-3",
269
269
  size === "md" && "h-4 w-4",
@@ -279,7 +279,7 @@ var Badge = ({
279
279
  onClick: handleRemove,
280
280
  className: cn(
281
281
  "ml-1 rounded-full hover:bg-accent focus:outline-none focus:bg-accent",
282
- "transition-colors duration-150 flex-shrink-0",
282
+ "transition-colors duration-150 shrink-0",
283
283
  size === "xs" && "h-3 w-3",
284
284
  size === "sm" && "h-3 w-3",
285
285
  size === "md" && "h-4 w-4",
@@ -368,7 +368,7 @@ var GradientBadge = ({ from = "from-primary", to = "to-secondary", className, ..
368
368
  {
369
369
  ...props,
370
370
  variant: "transparent",
371
- className: cn(`bg-gradient-to-r ${from} ${to} text-primary-foreground border-transparent`, "hover:opacity-90", className)
371
+ className: cn(`bg-linear-to-r ${from} ${to} text-primary-foreground border-transparent`, "hover:opacity-90", className)
372
372
  }
373
373
  );
374
374
  };
@@ -407,7 +407,7 @@ var Card = ({ title, description, children, footer, className, hoverable = false
407
407
  "div",
408
408
  {
409
409
  className: cn(
410
- "absolute inset-0 bg-gradient-to-br from-primary/5 to-transparent transition-opacity duration-300",
410
+ "absolute inset-0 bg-linear-to-br from-primary/5 to-transparent transition-opacity duration-300",
411
411
  isHovered ? "opacity-100" : "opacity-0"
412
412
  )
413
413
  }
@@ -725,7 +725,7 @@ var Input = forwardRef3(
725
725
  "div",
726
726
  {
727
727
  className: cn(
728
- "absolute bottom-0 left-0 h-0.5 bg-gradient-to-r from-primary to-primary/60 transition-all duration-300",
728
+ "absolute bottom-0 left-0 h-0.5 bg-linear-to-r from-primary to-primary/60 transition-all duration-300",
729
729
  // default hidden
730
730
  "w-0 opacity-0",
731
731
  // expand underline when focused within input container
@@ -735,7 +735,7 @@ var Input = forwardRef3(
735
735
  )
736
736
  ] }),
737
737
  errMsg && /* @__PURE__ */ jsxs5("div", { id: errorId, className: "flex items-center gap-2 text-sm text-destructive animate-in slide-in-from-top-1 duration-200", children: [
738
- /* @__PURE__ */ jsx5(AlertCircle, { className: "w-4 h-4 flex-shrink-0" }),
738
+ /* @__PURE__ */ jsx5(AlertCircle, { className: "w-4 h-4 shrink-0" }),
739
739
  /* @__PURE__ */ jsx5("span", { children: errMsg })
740
740
  ] }),
741
741
  (description || hint) && !errMsg && /* @__PURE__ */ jsx5(
@@ -919,7 +919,7 @@ var NumberInput = forwardRef3(
919
919
  "text-muted-foreground hover:text-foreground"
920
920
  ),
921
921
  "aria-label": "Increase value",
922
- children: /* @__PURE__ */ jsx5("svg", { width: "8", height: "8", viewBox: "0 0 8 8", fill: "none", className: "flex-shrink-0", children: /* @__PURE__ */ jsx5("path", { d: "M4 2L6 6H2L4 2Z", fill: "currentColor" }) })
922
+ children: /* @__PURE__ */ jsx5("svg", { width: "8", height: "8", viewBox: "0 0 8 8", fill: "none", className: "shrink-0", children: /* @__PURE__ */ jsx5("path", { d: "M4 2L6 6H2L4 2Z", fill: "currentColor" }) })
923
923
  }
924
924
  ),
925
925
  /* @__PURE__ */ jsx5(
@@ -935,7 +935,7 @@ var NumberInput = forwardRef3(
935
935
  "text-muted-foreground hover:text-foreground"
936
936
  ),
937
937
  "aria-label": "Decrease value",
938
- children: /* @__PURE__ */ jsx5("svg", { width: "8", height: "8", viewBox: "0 0 8 8", fill: "none", className: "flex-shrink-0", children: /* @__PURE__ */ jsx5("path", { d: "M4 6L2 2H6L4 6Z", fill: "currentColor" }) })
938
+ children: /* @__PURE__ */ jsx5("svg", { width: "8", height: "8", viewBox: "0 0 8 8", fill: "none", className: "shrink-0", children: /* @__PURE__ */ jsx5("path", { d: "M4 6L2 2H6L4 6Z", fill: "currentColor" }) })
939
939
  }
940
940
  )
941
941
  ] })
@@ -1016,7 +1016,7 @@ var Textarea = forwardRef3(
1016
1016
  }
1017
1017
  ),
1018
1018
  error && /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2 text-sm text-destructive animate-in slide-in-from-top-1 duration-200", children: [
1019
- /* @__PURE__ */ jsx5(AlertCircle, { className: "w-4 h-4 flex-shrink-0" }),
1019
+ /* @__PURE__ */ jsx5(AlertCircle, { className: "w-4 h-4 shrink-0" }),
1020
1020
  /* @__PURE__ */ jsx5("span", { children: error })
1021
1021
  ] }),
1022
1022
  description && !error && /* @__PURE__ */ jsx5("p", { className: cn("text-xs transition-colors duration-200", isFocused ? "text-primary/70" : "text-muted-foreground"), children: description })
@@ -1089,7 +1089,7 @@ var Textarea2 = forwardRef4(
1089
1089
  }
1090
1090
  ),
1091
1091
  variant === "default" && /* @__PURE__ */ jsx6("div", { className: cn(
1092
- "absolute bottom-0 left-0 h-0.5 bg-gradient-to-r from-primary to-primary/60 transition-all duration-300 ease-soft",
1092
+ "absolute bottom-0 left-0 h-0.5 bg-linear-to-r from-primary to-primary/60 transition-all duration-300 ease-soft",
1093
1093
  isFocused ? "w-full opacity-100" : "w-0 opacity-0"
1094
1094
  ) }),
1095
1095
  isFocused && variant !== "outlined" && /* @__PURE__ */ jsx6("div", { className: "absolute inset-0 rounded-lg bg-primary/5 -z-10 animate-pulse" })
@@ -1440,7 +1440,7 @@ var Avatar = ({ src, alt = "avatar", fallback = "?", size = "md", className, onC
1440
1440
  "span",
1441
1441
  {
1442
1442
  className: cn(
1443
- "font-bold uppercase bg-gradient-to-br from-primary to-primary/80 bg-clip-text text-transparent",
1443
+ "font-bold uppercase bg-linear-to-br from-primary to-primary/80 bg-clip-text text-transparent",
1444
1444
  "transition-all duration-200 animate-fade-in"
1445
1445
  ),
1446
1446
  children: fallback
@@ -1471,7 +1471,7 @@ var Skeleton = ({
1471
1471
  };
1472
1472
  const animationClasses = {
1473
1473
  pulse: "animate-pulse",
1474
- wave: "animate-shimmer bg-gradient-to-r from-muted via-muted/50 to-muted bg-[length:200%_100%]",
1474
+ wave: "animate-shimmer bg-linear-to-r from-muted via-muted/50 to-muted bg-size-[200%_100%]",
1475
1475
  none: ""
1476
1476
  };
1477
1477
  if (variant === "text" && lines > 1) {
@@ -1660,11 +1660,11 @@ import { Check as Check2, X as X2, Clock } from "lucide-react";
1660
1660
  import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
1661
1661
  var variantStyles2 = {
1662
1662
  default: "bg-muted-foreground",
1663
- primary: "bg-gradient-to-r from-primary via-primary/90 to-primary",
1664
- success: "bg-gradient-to-r from-success via-success/90 to-success shadow-sm shadow-success/20",
1665
- warning: "bg-gradient-to-r from-warning via-warning/90 to-warning shadow-sm shadow-warning/20",
1666
- danger: "bg-gradient-to-r from-destructive via-destructive/90 to-destructive shadow-sm shadow-destructive/20",
1667
- info: "bg-gradient-to-r from-info via-info/90 to-info shadow-sm shadow-info/20"
1663
+ primary: "bg-linear-to-r from-primary via-primary/90 to-primary",
1664
+ success: "bg-linear-to-r from-success via-success/90 to-success shadow-sm shadow-success/20",
1665
+ warning: "bg-linear-to-r from-warning via-warning/90 to-warning shadow-sm shadow-warning/20",
1666
+ danger: "bg-linear-to-r from-destructive via-destructive/90 to-destructive shadow-sm shadow-destructive/20",
1667
+ info: "bg-linear-to-r from-info via-info/90 to-info shadow-sm shadow-info/20"
1668
1668
  };
1669
1669
  var sizeStyles2 = {
1670
1670
  sm: "h-1.5",
@@ -1733,12 +1733,12 @@ var Progress = ({
1733
1733
  "before:absolute before:inset-0 before:rounded-full before:opacity-30",
1734
1734
  indeterminate && "animate-pulse",
1735
1735
  !indeterminate && variantStyles2[variant],
1736
- isComplete && "bg-gradient-to-r from-success via-success/90 to-success shadow-sm shadow-success/20",
1737
- isError && "bg-gradient-to-r from-destructive via-destructive/90 to-destructive shadow-sm shadow-destructive/20",
1738
- striped && "bg-gradient-to-r from-transparent via-primary-foreground/20 to-transparent bg-[length:1rem_1rem]",
1736
+ isComplete && "bg-linear-to-r from-success via-success/90 to-success shadow-sm shadow-success/20",
1737
+ isError && "bg-linear-to-r from-destructive via-destructive/90 to-destructive shadow-sm shadow-destructive/20",
1738
+ striped && "bg-linear-to-r from-transparent via-primary-foreground/20 to-transparent bg-size-[1rem_1rem]",
1739
1739
  animated && !indeterminate && "before:animate-pulse",
1740
1740
  // Shimmer effect for indeterminate
1741
- indeterminate && "bg-gradient-to-r from-muted via-primary/50 to-muted bg-[length:200%_100%] animate-[shimmer_2s_infinite]"
1741
+ indeterminate && "bg-linear-to-r from-muted via-primary/50 to-muted bg-size-[200%_100%] animate-[shimmer_2s_infinite]"
1742
1742
  ),
1743
1743
  style: {
1744
1744
  width: indeterminate ? "100%" : `${percentage}%`,
@@ -1948,7 +1948,7 @@ var MiniProgress = ({
1948
1948
  )
1949
1949
  }
1950
1950
  ),
1951
- showValue && /* @__PURE__ */ jsxs10("span", { className: "text-xs font-medium text-muted-foreground min-w-[2.5rem] text-right", children: [
1951
+ showValue && /* @__PURE__ */ jsxs10("span", { className: "text-xs font-medium text-muted-foreground min-w-10 text-right", children: [
1952
1952
  Math.round(percentage),
1953
1953
  "%"
1954
1954
  ] })
@@ -2182,7 +2182,7 @@ var Modal = ({
2182
2182
  return null;
2183
2183
  }
2184
2184
  const maxWidthClass = width ? "max-w-none" : fullWidth ? "max-w-full" : sizeStyles3[size];
2185
- const modalContent = /* @__PURE__ */ jsxs11("div", { className: cn("fixed inset-0 z-[9999] flex items-center justify-center", overlayClassName), onClick: handleOverlayClick, children: [
2185
+ const modalContent = /* @__PURE__ */ jsxs11("div", { className: cn("fixed inset-0 z-9999 flex items-center justify-center", overlayClassName), onClick: handleOverlayClick, children: [
2186
2186
  /* @__PURE__ */ jsx13(
2187
2187
  "div",
2188
2188
  {
@@ -2283,7 +2283,7 @@ var ToastProvider = ({ children, position = "top-right", maxToasts = 5 }) => {
2283
2283
  };
2284
2284
  return /* @__PURE__ */ jsxs12(ToastContext.Provider, { value: { addToast, removeToast, toasts }, children: [
2285
2285
  children,
2286
- /* @__PURE__ */ jsx14("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__ */ jsx14(ToastComponent, { toast, onRemove: removeToast }, toast.id)) })
2286
+ /* @__PURE__ */ jsx14("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__ */ jsx14(ToastComponent, { toast, onRemove: removeToast }, toast.id)) })
2287
2287
  ] });
2288
2288
  };
2289
2289
  var ToastComponent = ({ toast, onRemove }) => {
@@ -2517,7 +2517,7 @@ var Tooltip = ({
2517
2517
  },
2518
2518
  className: cn(
2519
2519
  "px-3 py-2 text-sm font-medium rounded-lg shadow-lg border",
2520
- "max-w-xs break-words backdrop-blur-sm",
2520
+ "max-w-xs wrap-break-word backdrop-blur-sm",
2521
2521
  variantStyles3[variant],
2522
2522
  className
2523
2523
  ),
@@ -2872,7 +2872,7 @@ var Popover = ({
2872
2872
  role: "dialog",
2873
2873
  "aria-modal": modal || void 0,
2874
2874
  className: cn(
2875
- "z-[9999]",
2875
+ "z-9999",
2876
2876
  // shadcn-like enter animation
2877
2877
  "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
2878
2878
  className
@@ -3081,7 +3081,7 @@ var Sheet = ({
3081
3081
  transition: "transform 300ms cubic-bezier(0.4, 0, 0.2, 1)"
3082
3082
  },
3083
3083
  children: [
3084
- (title || description || header || showClose) && /* @__PURE__ */ jsx17("div", { className: "flex-shrink-0 border-b border-border", children: header || /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between p-4", children: [
3084
+ (title || description || header || showClose) && /* @__PURE__ */ jsx17("div", { className: "shrink-0 border-b border-border", children: header || /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between p-4", children: [
3085
3085
  /* @__PURE__ */ jsxs15("div", { className: "flex-1", children: [
3086
3086
  title && /* @__PURE__ */ jsx17("h2", { className: "text-lg font-semibold text-foreground", children: title }),
3087
3087
  description && /* @__PURE__ */ jsx17("p", { className: "text-sm text-muted-foreground mt-1", children: description })
@@ -3100,7 +3100,7 @@ var Sheet = ({
3100
3100
  children
3101
3101
  }
3102
3102
  ),
3103
- footer && /* @__PURE__ */ jsx17("div", { className: "flex-shrink-0 border-t border-border p-4", children: footer })
3103
+ footer && /* @__PURE__ */ jsx17("div", { className: "shrink-0 border-t border-border p-4", children: footer })
3104
3104
  ]
3105
3105
  }
3106
3106
  )
@@ -3165,7 +3165,7 @@ var Alert = ({ title, description, variant = "default", className, icon, dismiss
3165
3165
  /* @__PURE__ */ jsx18("div", { className: "pt-1", children: icon ?? variantIcons[variant] }),
3166
3166
  /* @__PURE__ */ jsxs16("div", { className: "flex-1 min-w-0", children: [
3167
3167
  title && /* @__PURE__ */ jsx18("p", { className: "font-semibold text-sm leading-none mb-1 text-foreground", children: title }),
3168
- description && (typeof description === "string" ? /* @__PURE__ */ jsx18("p", { className: "text-sm text-muted-foreground leading-relaxed break-words", children: description }) : /* @__PURE__ */ jsx18("div", { className: "text-sm text-muted-foreground leading-relaxed break-words", children: description })),
3168
+ description && (typeof description === "string" ? /* @__PURE__ */ jsx18("p", { className: "text-sm text-muted-foreground leading-relaxed wrap-break-word", children: description }) : /* @__PURE__ */ jsx18("div", { className: "text-sm text-muted-foreground leading-relaxed wrap-break-word", children: description })),
3169
3169
  actions && /* @__PURE__ */ jsx18("div", { className: "mt-2 flex flex-wrap gap-2", children: actions })
3170
3170
  ] }),
3171
3171
  dismissible && /* @__PURE__ */ jsx18(
@@ -3247,7 +3247,7 @@ var GlobalLoading = ({
3247
3247
  "div",
3248
3248
  {
3249
3249
  className: cn(
3250
- "inset-0 z-[100000] flex items-center justify-center",
3250
+ "inset-0 z-100000 flex items-center justify-center",
3251
3251
  position === "fixed" ? "fixed" : "absolute",
3252
3252
  backdrop && "bg-background/90 backdrop-blur-sm",
3253
3253
  className
@@ -3684,7 +3684,7 @@ var VerticalTabs = ({
3684
3684
  className,
3685
3685
  ...props
3686
3686
  }) => {
3687
- return /* @__PURE__ */ jsx21("div", { className: cn("flex gap-6", className), children: /* @__PURE__ */ jsx21("div", { className: cn(sidebarWidth, "flex-shrink-0"), children: /* @__PURE__ */ jsx21(
3687
+ return /* @__PURE__ */ jsx21("div", { className: cn("flex gap-6", className), children: /* @__PURE__ */ jsx21("div", { className: cn(sidebarWidth, "shrink-0"), children: /* @__PURE__ */ jsx21(
3688
3688
  Tabs,
3689
3689
  {
3690
3690
  ...props,
@@ -4148,7 +4148,7 @@ var Combobox = ({
4148
4148
  "outline-none focus:outline-none focus-visible:outline-none",
4149
4149
  "hover:bg-accent hover:text-accent-foreground",
4150
4150
  "focus:bg-accent focus:text-accent-foreground",
4151
- "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
4151
+ "data-disabled:pointer-events-none data-disabled:opacity-50",
4152
4152
  index === activeIndex && "bg-accent text-accent-foreground",
4153
4153
  isSelected && "bg-accent text-accent-foreground"
4154
4154
  ),
@@ -4379,7 +4379,7 @@ var Pagination = ({
4379
4379
  size,
4380
4380
  onClick: () => onChange(pageNumber),
4381
4381
  disabled,
4382
- className: cn("min-w-[2.5rem]", isActive && "font-semibold"),
4382
+ className: cn("min-w-10", isActive && "font-semibold"),
4383
4383
  "aria-label": labels?.pageNumber ? labels.pageNumber(pageNumber) : t("pageNumber", { page: pageNumber }),
4384
4384
  "aria-current": isActive ? "page" : void 0,
4385
4385
  children: pageNumber
@@ -4515,7 +4515,7 @@ var CompactPagination = ({
4515
4515
  title: "Previous page"
4516
4516
  }
4517
4517
  ),
4518
- /* @__PURE__ */ jsxs22("div", { className: "px-2 py-1 text-sm text-muted-foreground min-w-[4rem] text-center", children: [
4518
+ /* @__PURE__ */ jsxs22("div", { className: "px-2 py-1 text-sm text-muted-foreground min-w-16 text-center", children: [
4519
4519
  page,
4520
4520
  " / ",
4521
4521
  totalPages
@@ -4916,7 +4916,7 @@ var DatePicker = ({
4916
4916
  size === "sm" ? "w-7 h-7 text-[12px]" : "w-8 h-8 text-sm",
4917
4917
  "datepicker-day rounded-md focus:outline-none",
4918
4918
  "transition-colors",
4919
- 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",
4919
+ 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",
4920
4920
  isToday2 && !isSelected && "bg-accent text-accent-foreground font-semibold"
4921
4921
  ),
4922
4922
  children: day
@@ -4941,7 +4941,7 @@ var DatePicker = ({
4941
4941
  },
4942
4942
  "data-state": isOpen ? "open" : "closed",
4943
4943
  className: cn(
4944
- "z-[9999]",
4944
+ "z-9999",
4945
4945
  "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
4946
4946
  "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"
4947
4947
  ),
@@ -5204,7 +5204,7 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
5204
5204
  style: { position: "absolute", top: dropdownPosition.top, left: dropdownPosition.left, width: dropdownPosition.width || 256, zIndex: 9999 },
5205
5205
  "data-state": isOpen ? "open" : "closed",
5206
5206
  className: cn(
5207
- "z-[9999]",
5207
+ "z-9999",
5208
5208
  "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
5209
5209
  "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"
5210
5210
  ),
@@ -5849,11 +5849,11 @@ function TimePicker({
5849
5849
  ),
5850
5850
  (error || success || helperText) && /* @__PURE__ */ jsxs24("div", { className: cn("mt-1.5 flex items-start gap-1.5", sz.label), children: [
5851
5851
  error && /* @__PURE__ */ jsxs24("div", { className: "flex items-center gap-1.5 text-destructive", children: [
5852
- /* @__PURE__ */ jsx28(X8, { className: "w-3.5 h-3.5 flex-shrink-0" }),
5852
+ /* @__PURE__ */ jsx28(X8, { className: "w-3.5 h-3.5 shrink-0" }),
5853
5853
  /* @__PURE__ */ jsx28("span", { children: error })
5854
5854
  ] }),
5855
5855
  success && !error && /* @__PURE__ */ jsxs24("div", { className: "flex items-center gap-1.5 text-green-600", children: [
5856
- /* @__PURE__ */ jsx28(Check4, { className: "w-3.5 h-3.5 flex-shrink-0" }),
5856
+ /* @__PURE__ */ jsx28(Check4, { className: "w-3.5 h-3.5 shrink-0" }),
5857
5857
  /* @__PURE__ */ jsx28("span", { children: "Valid time selected" })
5858
5858
  ] }),
5859
5859
  helperText && !error && !success && /* @__PURE__ */ jsx28("span", { className: "text-muted-foreground", children: helperText })
@@ -6342,13 +6342,13 @@ var MultiCombobox = ({
6342
6342
  setOpen(next);
6343
6343
  },
6344
6344
  className: cn(
6345
- "flex w-full items-center gap-2 rounded-lg border border-input bg-background shadow-sm min-h-[2.5rem]",
6345
+ "flex w-full items-center gap-2 rounded-lg border border-input bg-background shadow-sm min-h-10",
6346
6346
  "px-3 py-2",
6347
6347
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
6348
6348
  "disabled:cursor-not-allowed disabled:opacity-50"
6349
6349
  ),
6350
6350
  children: [
6351
- /* @__PURE__ */ jsx30("div", { className: "flex items-center gap-1 flex-wrap min-h-[1.5rem] flex-1", children: value.length > 0 ? showTags ? value.map((itemValue) => {
6351
+ /* @__PURE__ */ jsx30("div", { className: "flex items-center gap-1 flex-wrap min-h-6 flex-1", children: value.length > 0 ? showTags ? value.map((itemValue) => {
6352
6352
  const option = normalizedOptions.find((o) => o.value === itemValue);
6353
6353
  return /* @__PURE__ */ jsxs26("span", { className: "inline-flex items-center gap-1 bg-accent text-accent-foreground rounded px-2 py-1 text-xs", children: [
6354
6354
  /* @__PURE__ */ jsx30("span", { className: "truncate max-w-[120px]", children: option ? displayFormat(option) : itemValue }),
@@ -6864,7 +6864,7 @@ var Slider = React26.forwardRef(
6864
6864
  return /* @__PURE__ */ jsxs28("div", { className: cn("w-full space-y-2", containerClassName), children: [
6865
6865
  (label || showValue) && /* @__PURE__ */ jsxs28("div", { className: "flex items-center justify-between", children: [
6866
6866
  label && /* @__PURE__ */ jsx32("label", { className: cn("text-sm font-medium text-foreground", labelClassName), children: label }),
6867
- showValue && /* @__PURE__ */ jsx32("span", { className: cn("text-xs font-mono text-muted-foreground min-w-[2rem] text-right", valueClassName), children: displayValue })
6867
+ showValue && /* @__PURE__ */ jsx32("span", { className: cn("text-xs font-mono text-muted-foreground min-w-8 text-right", valueClassName), children: displayValue })
6868
6868
  ] }),
6869
6869
  /* @__PURE__ */ jsxs28("div", { className: cn("relative flex items-center", sizeStyles8.container), children: [
6870
6870
  /* @__PURE__ */ jsx32("div", { className: cn("w-full rounded-full bg-secondary relative overflow-hidden", sizeStyles8.track, trackClassName), children: /* @__PURE__ */ jsx32(
@@ -7201,7 +7201,7 @@ function OverlayControls({
7201
7201
  "div",
7202
7202
  {
7203
7203
  className: cn(
7204
- "absolute bottom-0 left-0 right-0 pb-2 pt-8 bg-gradient-to-t from-black/40 to-transparent z-20 transition-opacity duration-200",
7204
+ "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",
7205
7205
  hoverClasses,
7206
7206
  autoHide && !controlsVisible && "opacity-0 pointer-events-none",
7207
7207
  className
@@ -7929,7 +7929,7 @@ function Carousel({
7929
7929
  "div",
7930
7930
  {
7931
7931
  className: cn(
7932
- "flex-shrink-0",
7932
+ "shrink-0",
7933
7933
  isHorizontal ? "h-full" : "w-full",
7934
7934
  animation === "fade" && idx !== currentIndex && "opacity-0",
7935
7935
  animation === "scale" && idx !== currentIndex && "scale-95",
@@ -8012,7 +8012,7 @@ function Carousel({
8012
8012
  "div",
8013
8013
  {
8014
8014
  className: cn(
8015
- "absolute bottom-0 left-0 right-0 flex gap-2 p-4 bg-gradient-to-t from-black/50 to-transparent overflow-x-auto",
8015
+ "absolute bottom-0 left-0 right-0 flex gap-2 p-4 bg-linear-to-t from-black/50 to-transparent overflow-x-auto",
8016
8016
  isHorizontal ? "flex-row" : "flex-col"
8017
8017
  ),
8018
8018
  children: React29.Children.map(children, (child, idx) => /* @__PURE__ */ jsx36(
@@ -8020,7 +8020,7 @@ function Carousel({
8020
8020
  {
8021
8021
  onClick: () => scrollTo(idx),
8022
8022
  className: cn(
8023
- "flex-shrink-0 w-16 h-16 rounded-md overflow-hidden border-2 transition-all focus:outline-none focus:ring-2 focus:ring-primary",
8023
+ "shrink-0 w-16 h-16 rounded-md overflow-hidden border-2 transition-all focus:outline-none focus:ring-2 focus:ring-primary",
8024
8024
  idx === currentIndex ? "border-primary scale-110" : "border-transparent opacity-70 hover:opacity-100"
8025
8025
  ),
8026
8026
  "aria-label": `Thumbnail ${idx + 1}`,
@@ -8297,8 +8297,8 @@ function FallingIcons({
8297
8297
  "span",
8298
8298
  {
8299
8299
  className: cn(
8300
- "block uv-spin hover:[animation:var(--popName)_0.35s_ease-out_forwards]",
8301
- physicsRotation ? "[animation:var(--physicsSpinName)_var(--spinDur)_ease-in-out_infinite]" : spin && "[animation:var(--spinName)_var(--spinDur)_linear_infinite]"
8300
+ "block uv-spin hover:animate-[var(--popName)_0.35s_ease-out_forwards]",
8301
+ physicsRotation ? "animate-[var(--physicsSpinName)_var(--spinDur)_ease-in-out_infinite]" : spin && "animate-[var(--spinName)_var(--spinDur)_linear_infinite]"
8302
8302
  ),
8303
8303
  style: {
8304
8304
  width: p.size,
@@ -8965,8 +8965,8 @@ var TimelineItem = React33.forwardRef(
8965
8965
  outlined: "rounded-lg border border-border bg-card shadow-sm px-4 py-3",
8966
8966
  card: "rounded-xl border border-border bg-card shadow-md px-5 py-4",
8967
8967
  minimal: "border-l-2 pl-4 py-2",
8968
- modern: "rounded-lg bg-gradient-to-r from-card to-muted/20 border border-border/50 px-5 py-4 backdrop-blur-sm",
8969
- gradient: "rounded-xl bg-gradient-to-br from-primary/10 via-card to-accent/10 border border-primary/20 px-5 py-4 shadow-lg"
8968
+ modern: "rounded-lg bg-linear-to-r from-card to-muted/20 border border-border/50 px-5 py-4 backdrop-blur-sm",
8969
+ 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"
8970
8970
  };
8971
8971
  const contentBox = /* @__PURE__ */ jsxs36("div", { className: cn("min-w-0 flex-1", variantClasses[ctx.variant]), children: [
8972
8972
  /* @__PURE__ */ jsxs36("div", { className: "flex items-start justify-between gap-2", children: [
@@ -8993,12 +8993,12 @@ var TimelineItem = React33.forwardRef(
8993
8993
  ] });
8994
8994
  const markerWidth = Icon || dot ? "w-auto" : "w-6";
8995
8995
  const leftSide = /* @__PURE__ */ jsxs36("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: [
8996
- /* @__PURE__ */ jsx40("div", { className: cn("flex-shrink-0 flex items-stretch", markerWidth), children: /* @__PURE__ */ jsx40(Marker, { index: idx ?? 0, last: isLast, size: ctx.size, color, status, lineColor: ctx.lineColor, lineStyle: ctx.lineStyle, active, dot, icon: Icon, showLine: ctx.showLine }) }),
8996
+ /* @__PURE__ */ jsx40("div", { className: cn("shrink-0 flex items-stretch", markerWidth), children: /* @__PURE__ */ jsx40(Marker, { index: idx ?? 0, last: isLast, size: ctx.size, color, status, lineColor: ctx.lineColor, lineStyle: ctx.lineStyle, active, dot, icon: Icon, showLine: ctx.showLine }) }),
8997
8997
  /* @__PURE__ */ jsx40("div", { className: "flex-1", children: contentBox })
8998
8998
  ] });
8999
8999
  const rightSide = /* @__PURE__ */ jsxs36("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: [
9000
9000
  /* @__PURE__ */ jsx40("div", { className: "flex-1 flex justify-end", children: contentBox }),
9001
- /* @__PURE__ */ jsx40("div", { className: cn("flex-shrink-0 flex items-stretch", markerWidth), children: /* @__PURE__ */ jsx40(Marker, { index: idx ?? 0, last: isLast, size: ctx.size, color, status, lineColor: ctx.lineColor, lineStyle: ctx.lineStyle, active, dot, icon: Icon, showLine: ctx.showLine }) })
9001
+ /* @__PURE__ */ jsx40("div", { className: cn("shrink-0 flex items-stretch", markerWidth), children: /* @__PURE__ */ jsx40(Marker, { index: idx ?? 0, last: isLast, size: ctx.size, color, status, lineColor: ctx.lineColor, lineStyle: ctx.lineStyle, active, dot, icon: Icon, showLine: ctx.showLine }) })
9002
9002
  ] });
9003
9003
  const horizontalItem = /* @__PURE__ */ jsxs36(
9004
9004
  "div",
@@ -10015,7 +10015,7 @@ function DataTable({
10015
10015
  children: (() => {
10016
10016
  const isRightAlign = col.align === "right" || !col.align && headerAlign === "right";
10017
10017
  const isCenterAlign = col.align === "center" || !col.align && headerAlign === "center";
10018
- const titleContent = /* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-1 min-w-0 flex-shrink", children: [
10018
+ const titleContent = /* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-1 min-w-0 shrink", children: [
10019
10019
  /* @__PURE__ */ jsx46("span", { className: "truncate font-medium text-sm", children: col.title }),
10020
10020
  col.sortable && /* @__PURE__ */ jsx46(
10021
10021
  "button",
@@ -10106,7 +10106,7 @@ function DataTable({
10106
10106
  "div",
10107
10107
  {
10108
10108
  className: cn(
10109
- "flex items-center gap-2 select-none min-h-[2.5rem]",
10109
+ "flex items-center gap-2 select-none min-h-10",
10110
10110
  isRightAlign && "justify-end",
10111
10111
  isCenterAlign && "justify-center",
10112
10112
  !isRightAlign && !isCenterAlign && "justify-between"
@@ -10232,7 +10232,7 @@ function DataTable({
10232
10232
  Table,
10233
10233
  {
10234
10234
  containerClassName: "border-0 md:border-0 rounded-none md:rounded-none shadow-none bg-transparent",
10235
- className: "[&_thead]:sticky [&_thead]:top-0 [&_thead]:z-[5] [&_thead]:bg-background [&_thead]:backdrop-blur-sm",
10235
+ className: "[&_thead]:sticky [&_thead]:top-0 [&_thead]:z-5 [&_thead]:bg-background [&_thead]:backdrop-blur-sm",
10236
10236
  children: [
10237
10237
  /* @__PURE__ */ jsx46(TableHeader, { children: renderHeader }),
10238
10238
  /* @__PURE__ */ jsx46(TableBody, { children: loading2 ? /* @__PURE__ */ jsx46(TableRow, { children: /* @__PURE__ */ jsx46(TableCell, { colSpan: visibleColumns.length, className: "text-center py-8", children: /* @__PURE__ */ jsxs41("div", { className: "flex items-center justify-center gap-2 text-muted-foreground", children: [
@@ -10312,25 +10312,23 @@ var isPlainObject = (tempObject) => {
10312
10312
  };
10313
10313
  var isWeb = typeof window !== "undefined" && typeof window.HTMLElement !== "undefined" && typeof document !== "undefined";
10314
10314
  function cloneObject(data) {
10315
- let copy;
10316
- const isArray = Array.isArray(data);
10317
- const isFileListInstance = typeof FileList !== "undefined" ? data instanceof FileList : false;
10318
10315
  if (data instanceof Date) {
10319
- copy = new Date(data);
10320
- } else if (!(isWeb && (data instanceof Blob || isFileListInstance)) && (isArray || isObject(data))) {
10321
- copy = isArray ? [] : Object.create(Object.getPrototypeOf(data));
10322
- if (!isArray && !isPlainObject(data)) {
10323
- copy = data;
10324
- } else {
10325
- for (const key in data) {
10326
- if (data.hasOwnProperty(key)) {
10327
- copy[key] = cloneObject(data[key]);
10328
- }
10329
- }
10330
- }
10331
- } else {
10316
+ return new Date(data);
10317
+ }
10318
+ const isFileListInstance = typeof FileList !== "undefined" && data instanceof FileList;
10319
+ if (isWeb && (data instanceof Blob || isFileListInstance)) {
10320
+ return data;
10321
+ }
10322
+ const isArray = Array.isArray(data);
10323
+ if (!isArray && !(isObject(data) && isPlainObject(data))) {
10332
10324
  return data;
10333
10325
  }
10326
+ const copy = isArray ? [] : Object.create(Object.getPrototypeOf(data));
10327
+ for (const key in data) {
10328
+ if (Object.prototype.hasOwnProperty.call(data, key)) {
10329
+ copy[key] = cloneObject(data[key]);
10330
+ }
10331
+ }
10334
10332
  return copy;
10335
10333
  }
10336
10334
  var isKey = (value) => /^\w*$/.test(value);
@@ -10345,6 +10343,7 @@ var get = (object, path, defaultValue) => {
10345
10343
  return isUndefined(result) || result === object ? isUndefined(object[path]) ? defaultValue : object[path] : result;
10346
10344
  };
10347
10345
  var isBoolean = (value) => typeof value === "boolean";
10346
+ var isFunction = (value) => typeof value === "function";
10348
10347
  var set = (object, path, value) => {
10349
10348
  let index = -1;
10350
10349
  const tempPath = isKey(path) ? [path] : stringToPath(path);
@@ -10456,7 +10455,7 @@ var generateWatchOutput = (names, _names, formValues, isGlobal, defaultValue) =>
10456
10455
  var isPrimitive = (value) => isNullOrUndefined(value) || !isObjectType(value);
10457
10456
  function deepEqual(object1, object2, _internal_visited = /* @__PURE__ */ new WeakSet()) {
10458
10457
  if (isPrimitive(object1) || isPrimitive(object2)) {
10459
- return object1 === object2;
10458
+ return Object.is(object1, object2);
10460
10459
  }
10461
10460
  if (isDateObject(object1) && isDateObject(object2)) {
10462
10461
  return object1.getTime() === object2.getTime();
@@ -10478,7 +10477,7 @@ function deepEqual(object1, object2, _internal_visited = /* @__PURE__ */ new Wea
10478
10477
  }
10479
10478
  if (key !== "ref") {
10480
10479
  const val2 = object2[key];
10481
- if (isDateObject(val1) && isDateObject(val2) || isObject(val1) && isObject(val2) || Array.isArray(val1) && Array.isArray(val2) ? !deepEqual(val1, val2, _internal_visited) : val1 !== val2) {
10480
+ if (isDateObject(val1) && isDateObject(val2) || isObject(val1) && isObject(val2) || Array.isArray(val1) && Array.isArray(val2) ? !deepEqual(val1, val2, _internal_visited) : !Object.is(val1, val2)) {
10482
10481
  return false;
10483
10482
  }
10484
10483
  }
@@ -10491,48 +10490,76 @@ function useWatch(props) {
10491
10490
  const _defaultValue = React38.useRef(defaultValue);
10492
10491
  const _compute = React38.useRef(compute);
10493
10492
  const _computeFormValues = React38.useRef(void 0);
10493
+ const _prevControl = React38.useRef(control);
10494
+ const _prevName = React38.useRef(name);
10494
10495
  _compute.current = compute;
10495
- const defaultValueMemo = React38.useMemo(() => control._getWatch(name, _defaultValue.current), [control, name]);
10496
- const [value, updateValue] = React38.useState(_compute.current ? _compute.current(defaultValueMemo) : defaultValueMemo);
10497
- useIsomorphicLayoutEffect(() => control._subscribe({
10498
- name,
10499
- formState: {
10500
- values: true
10501
- },
10502
- exact,
10503
- callback: (formState) => {
10504
- if (!disabled) {
10505
- const formValues = generateWatchOutput(name, control._names, formState.values || control._formValues, false, _defaultValue.current);
10506
- if (_compute.current) {
10507
- const computedFormValues = _compute.current(formValues);
10508
- if (!deepEqual(computedFormValues, _computeFormValues.current)) {
10509
- updateValue(computedFormValues);
10510
- _computeFormValues.current = computedFormValues;
10511
- }
10512
- } else {
10513
- updateValue(formValues);
10496
+ const [value, updateValue] = React38.useState(() => {
10497
+ const defaultValue2 = control._getWatch(name, _defaultValue.current);
10498
+ return _compute.current ? _compute.current(defaultValue2) : defaultValue2;
10499
+ });
10500
+ const getCurrentOutput = React38.useCallback((values) => {
10501
+ const formValues = generateWatchOutput(name, control._names, values || control._formValues, false, _defaultValue.current);
10502
+ return _compute.current ? _compute.current(formValues) : formValues;
10503
+ }, [control._formValues, control._names, name]);
10504
+ const refreshValue = React38.useCallback((values) => {
10505
+ if (!disabled) {
10506
+ const formValues = generateWatchOutput(name, control._names, values || control._formValues, false, _defaultValue.current);
10507
+ if (_compute.current) {
10508
+ const computedFormValues = _compute.current(formValues);
10509
+ if (!deepEqual(computedFormValues, _computeFormValues.current)) {
10510
+ updateValue(computedFormValues);
10511
+ _computeFormValues.current = computedFormValues;
10514
10512
  }
10513
+ } else {
10514
+ updateValue(formValues);
10515
10515
  }
10516
10516
  }
10517
- }), [control, disabled, name, exact]);
10517
+ }, [control._formValues, control._names, disabled, name]);
10518
+ useIsomorphicLayoutEffect(() => {
10519
+ if (_prevControl.current !== control || !deepEqual(_prevName.current, name)) {
10520
+ _prevControl.current = control;
10521
+ _prevName.current = name;
10522
+ refreshValue();
10523
+ }
10524
+ return control._subscribe({
10525
+ name,
10526
+ formState: {
10527
+ values: true
10528
+ },
10529
+ exact,
10530
+ callback: (formState) => {
10531
+ refreshValue(formState.values);
10532
+ }
10533
+ });
10534
+ }, [control, exact, name, refreshValue]);
10518
10535
  React38.useEffect(() => control._removeUnmounted());
10519
- return value;
10536
+ const controlChanged = _prevControl.current !== control;
10537
+ const prevName = _prevName.current;
10538
+ const computedOutput = React38.useMemo(() => {
10539
+ if (disabled) {
10540
+ return null;
10541
+ }
10542
+ const nameChanged = !controlChanged && !deepEqual(prevName, name);
10543
+ const shouldReturnImmediate = controlChanged || nameChanged;
10544
+ return shouldReturnImmediate ? getCurrentOutput() : null;
10545
+ }, [disabled, controlChanged, name, prevName, getCurrentOutput]);
10546
+ return computedOutput !== null ? computedOutput : value;
10520
10547
  }
10521
10548
  function useController(props) {
10522
10549
  const methods = useFormContext();
10523
- const { name, disabled, control = methods.control, shouldUnregister, defaultValue } = props;
10550
+ const { name, disabled, control = methods.control, shouldUnregister, defaultValue, exact = true } = props;
10524
10551
  const isArrayField = isNameInFieldArray(control._names.array, name);
10525
10552
  const defaultValueMemo = React38.useMemo(() => get(control._formValues, name, get(control._defaultValues, name, defaultValue)), [control, name, defaultValue]);
10526
10553
  const value = useWatch({
10527
10554
  control,
10528
10555
  name,
10529
10556
  defaultValue: defaultValueMemo,
10530
- exact: true
10557
+ exact
10531
10558
  });
10532
10559
  const formState = useFormState({
10533
10560
  control,
10534
10561
  name,
10535
- exact: true
10562
+ exact
10536
10563
  });
10537
10564
  const _props = React38.useRef(props);
10538
10565
  const _previousNameRef = React38.useRef(void 0);
@@ -10580,12 +10607,12 @@ function useController(props) {
10580
10607
  }), [name, control._formValues]);
10581
10608
  const ref = React38.useCallback((elm) => {
10582
10609
  const field2 = get(control._fields, name);
10583
- if (field2 && elm) {
10610
+ if (field2 && field2._f && elm) {
10584
10611
  field2._f.ref = {
10585
- focus: () => elm.focus && elm.focus(),
10586
- select: () => elm.select && elm.select(),
10587
- setCustomValidity: (message) => elm.setCustomValidity(message),
10588
- reportValidity: () => elm.reportValidity()
10612
+ focus: () => isFunction(elm.focus) && elm.focus(),
10613
+ select: () => isFunction(elm.select) && elm.select(),
10614
+ setCustomValidity: (message) => isFunction(elm.setCustomValidity) && elm.setCustomValidity(message),
10615
+ reportValidity: () => isFunction(elm.reportValidity) && elm.reportValidity()
10589
10616
  };
10590
10617
  }
10591
10618
  }, [control._fields, name]);
@@ -10695,7 +10722,6 @@ function extractFormValues(fieldsState, formValues) {
10695
10722
  }
10696
10723
  var isEmptyObject = (value) => isObject(value) && !Object.keys(value).length;
10697
10724
  var isFileInput = (element) => element.type === "file";
10698
- var isFunction = (value) => typeof value === "function";
10699
10725
  var isHTMLElement = (value) => {
10700
10726
  if (!isWeb) {
10701
10727
  return false;
@@ -10749,10 +10775,11 @@ function isTraversable(value) {
10749
10775
  }
10750
10776
  function markFieldsDirty(data, fields = {}) {
10751
10777
  for (const key in data) {
10752
- if (isTraversable(data[key])) {
10753
- fields[key] = Array.isArray(data[key]) ? [] : {};
10754
- markFieldsDirty(data[key], fields[key]);
10755
- } else if (!isUndefined(data[key])) {
10778
+ const value = data[key];
10779
+ if (isTraversable(value)) {
10780
+ fields[key] = Array.isArray(value) ? [] : {};
10781
+ markFieldsDirty(value, fields[key]);
10782
+ } else if (!isUndefined(value)) {
10756
10783
  fields[key] = true;
10757
10784
  }
10758
10785
  }
@@ -10763,14 +10790,16 @@ function getDirtyFields(data, formValues, dirtyFieldsFromValues) {
10763
10790
  dirtyFieldsFromValues = markFieldsDirty(formValues);
10764
10791
  }
10765
10792
  for (const key in data) {
10766
- if (isTraversable(data[key])) {
10793
+ const value = data[key];
10794
+ if (isTraversable(value)) {
10767
10795
  if (isUndefined(formValues) || isPrimitive(dirtyFieldsFromValues[key])) {
10768
- dirtyFieldsFromValues[key] = markFieldsDirty(data[key], Array.isArray(data[key]) ? [] : {});
10796
+ dirtyFieldsFromValues[key] = markFieldsDirty(value, Array.isArray(value) ? [] : {});
10769
10797
  } else {
10770
- getDirtyFields(data[key], isNullOrUndefined(formValues) ? {} : formValues[key], dirtyFieldsFromValues[key]);
10798
+ getDirtyFields(value, isNullOrUndefined(formValues) ? {} : formValues[key], dirtyFieldsFromValues[key]);
10771
10799
  }
10772
10800
  } else {
10773
- dirtyFieldsFromValues[key] = !deepEqual(data[key], formValues[key]);
10801
+ const formValue = formValues[key];
10802
+ dirtyFieldsFromValues[key] = !deepEqual(value, formValue);
10774
10803
  }
10775
10804
  }
10776
10805
  return dirtyFieldsFromValues;
@@ -11122,7 +11151,8 @@ function createFormControl(props = {}) {
11122
11151
  let _state = {
11123
11152
  action: false,
11124
11153
  mount: false,
11125
- watch: false
11154
+ watch: false,
11155
+ keepIsValid: false
11126
11156
  };
11127
11157
  let _names = {
11128
11158
  mount: /* @__PURE__ */ new Set(),
@@ -11133,7 +11163,7 @@ function createFormControl(props = {}) {
11133
11163
  };
11134
11164
  let delayErrorCallback;
11135
11165
  let timer = 0;
11136
- const _proxyFormState = {
11166
+ const defaultProxyFormState = {
11137
11167
  isDirty: false,
11138
11168
  dirtyFields: false,
11139
11169
  validatingFields: false,
@@ -11142,6 +11172,9 @@ function createFormControl(props = {}) {
11142
11172
  isValid: false,
11143
11173
  errors: false
11144
11174
  };
11175
+ const _proxyFormState = {
11176
+ ...defaultProxyFormState
11177
+ };
11145
11178
  let _proxySubscribeFormState = {
11146
11179
  ..._proxyFormState
11147
11180
  };
@@ -11155,8 +11188,17 @@ function createFormControl(props = {}) {
11155
11188
  timer = setTimeout(callback, wait);
11156
11189
  };
11157
11190
  const _setValid = async (shouldUpdateValid) => {
11191
+ if (_state.keepIsValid) {
11192
+ return;
11193
+ }
11158
11194
  if (!_options.disabled && (_proxyFormState.isValid || _proxySubscribeFormState.isValid || shouldUpdateValid)) {
11159
- const isValid = _options.resolver ? isEmptyObject((await _runSchema()).errors) : await executeBuiltInValidation(_fields, true);
11195
+ let isValid;
11196
+ if (_options.resolver) {
11197
+ isValid = isEmptyObject((await _runSchema()).errors);
11198
+ _updateIsValidating();
11199
+ } else {
11200
+ isValid = await executeBuiltInValidation(_fields, true);
11201
+ }
11160
11202
  if (isValid !== _formState.isValid) {
11161
11203
  _subjects.state.next({
11162
11204
  isValid
@@ -11225,7 +11267,7 @@ function createFormControl(props = {}) {
11225
11267
  if (field) {
11226
11268
  const defaultValue = get(_formValues, name, isUndefined(value) ? get(_defaultValues, name) : value);
11227
11269
  isUndefined(defaultValue) || ref && ref.defaultChecked || shouldSkipSetValueAs ? set(_formValues, name, shouldSkipSetValueAs ? defaultValue : getFieldValue(field._f)) : setFieldValue(name, defaultValue);
11228
- _state.mount && _setValid();
11270
+ _state.mount && !_state.action && _setValid();
11229
11271
  }
11230
11272
  };
11231
11273
  const updateTouchAndDirty = (name, fieldValue, isBlurEvent, shouldDirty, shouldRender) => {
@@ -11287,11 +11329,11 @@ function createFormControl(props = {}) {
11287
11329
  const _runSchema = async (name) => {
11288
11330
  _updateIsValidating(name, true);
11289
11331
  const result = await _options.resolver(_formValues, _options.context, getResolverOptions(name || _names.mount, _fields, _options.criteriaMode, _options.shouldUseNativeValidation));
11290
- _updateIsValidating(name);
11291
11332
  return result;
11292
11333
  };
11293
11334
  const executeSchemaAndUpdateState = async (names) => {
11294
11335
  const { errors } = await _runSchema(names);
11336
+ _updateIsValidating(names);
11295
11337
  if (names) {
11296
11338
  for (const name of names) {
11297
11339
  const error = get(errors, name);
@@ -11470,6 +11512,7 @@ function createFormControl(props = {}) {
11470
11512
  !isBlurEvent && watched && _subjects.state.next({ ..._formState });
11471
11513
  if (_options.resolver) {
11472
11514
  const { errors } = await _runSchema([name]);
11515
+ _updateIsValidating([name]);
11473
11516
  _updateIsFieldValueUpdated(fieldValue);
11474
11517
  if (isFieldValueUpdated) {
11475
11518
  const previousErrorLookupResult = schemaErrorLookup(_formState.errors, _fields, name);
@@ -11590,7 +11633,10 @@ function createFormControl(props = {}) {
11590
11633
  };
11591
11634
  return _subscribe({
11592
11635
  ...props2,
11593
- formState: _proxySubscribeFormState
11636
+ formState: {
11637
+ ...defaultProxyFormState,
11638
+ ...props2.formState
11639
+ }
11594
11640
  });
11595
11641
  };
11596
11642
  const unregister = (name, options = {}) => {
@@ -11718,6 +11764,7 @@ function createFormControl(props = {}) {
11718
11764
  });
11719
11765
  if (_options.resolver) {
11720
11766
  const { errors, values } = await _runSchema();
11767
+ _updateIsValidating();
11721
11768
  _formState.errors = errors;
11722
11769
  fieldValues = cloneObject(values);
11723
11770
  } else {
@@ -11836,8 +11883,13 @@ function createFormControl(props = {}) {
11836
11883
  watchAll: false,
11837
11884
  focus: ""
11838
11885
  };
11839
- _state.mount = !_proxyFormState.isValid || !!keepStateOptions.keepIsValid || !!keepStateOptions.keepDirtyValues;
11886
+ _state.mount = !_proxyFormState.isValid || !!keepStateOptions.keepIsValid || !!keepStateOptions.keepDirtyValues || !_options.shouldUnregister && !isEmptyObject(values);
11840
11887
  _state.watch = !!_options.shouldUnregister;
11888
+ _state.keepIsValid = !!keepStateOptions.keepIsValid;
11889
+ _state.action = false;
11890
+ if (!keepStateOptions.keepErrors) {
11891
+ _formState.errors = {};
11892
+ }
11841
11893
  _subjects.state.next({
11842
11894
  submitCount: keepStateOptions.keepSubmitCount ? _formState.submitCount : 0,
11843
11895
  isDirty: isEmptyResetValues ? false : keepStateOptions.keepDirty ? _formState.isDirty : !!(keepStateOptions.keepDefaultValues && !deepEqual(formValues, _defaultValues)),
@@ -11850,15 +11902,17 @@ function createFormControl(props = {}) {
11850
11902
  defaultValues: _defaultValues
11851
11903
  });
11852
11904
  };
11853
- const reset = (formValues, keepStateOptions) => _reset(isFunction(formValues) ? formValues(_formValues) : formValues, keepStateOptions);
11905
+ const reset = (formValues, keepStateOptions) => _reset(isFunction(formValues) ? formValues(_formValues) : formValues, { ..._options.resetOptions, ...keepStateOptions });
11854
11906
  const setFocus = (name, options = {}) => {
11855
11907
  const field = get(_fields, name);
11856
11908
  const fieldReference = field && field._f;
11857
11909
  if (fieldReference) {
11858
11910
  const fieldRef = fieldReference.refs ? fieldReference.refs[0] : fieldReference.ref;
11859
11911
  if (fieldRef.focus) {
11860
- fieldRef.focus();
11861
- options.shouldSelect && isFunction(fieldRef.select) && fieldRef.select();
11912
+ setTimeout(() => {
11913
+ fieldRef.focus();
11914
+ options.shouldSelect && isFunction(fieldRef.select) && fieldRef.select();
11915
+ });
11862
11916
  }
11863
11917
  }
11864
11918
  };
@@ -11883,6 +11937,7 @@ function createFormControl(props = {}) {
11883
11937
  setError,
11884
11938
  _subscribe,
11885
11939
  _runSchema,
11940
+ _updateIsValidating,
11886
11941
  _focusError,
11887
11942
  _getWatch,
11888
11943
  _getDirty,
@@ -12034,11 +12089,15 @@ function useForm(props = {}) {
12034
12089
  }
12035
12090
  }, [control, formState.isDirty]);
12036
12091
  React38.useEffect(() => {
12092
+ var _a;
12037
12093
  if (props.values && !deepEqual(props.values, _values.current)) {
12038
12094
  control._reset(props.values, {
12039
12095
  keepFieldsRef: true,
12040
12096
  ...control._options.resetOptions
12041
12097
  });
12098
+ if (!((_a = control._options.resetOptions) === null || _a === void 0 ? void 0 : _a.keepIsValid)) {
12099
+ control._setValid();
12100
+ }
12042
12101
  _values.current = props.values;
12043
12102
  updateFormState((state) => ({ ...state }));
12044
12103
  } else {
@@ -12338,7 +12397,7 @@ function FloatingContacts({ className }) {
12338
12397
  external: true
12339
12398
  }
12340
12399
  ];
12341
- return /* @__PURE__ */ jsxs44("div", { className: cn("fixed bottom-6 right-4 z-[100000]", "flex flex-col items-end gap-3", className), "aria-label": "Quick contacts", children: [
12400
+ return /* @__PURE__ */ jsxs44("div", { className: cn("fixed bottom-6 right-4 z-100000", "flex flex-col items-end gap-3", className), "aria-label": "Quick contacts", children: [
12342
12401
  /* @__PURE__ */ jsx49(
12343
12402
  Link2,
12344
12403
  {
@@ -12461,12 +12520,12 @@ function ThemeToggleHeadless({
12461
12520
  }
12462
12521
  ),
12463
12522
  isOpen && /* @__PURE__ */ jsxs46(Fragment18, { children: [
12464
- typeof window !== "undefined" && createPortal10(/* @__PURE__ */ jsx51("div", { className: "fixed inset-0 z-[9998]", onClick: () => setIsOpen(false) }), document.body),
12523
+ typeof window !== "undefined" && createPortal10(/* @__PURE__ */ jsx51("div", { className: "fixed inset-0 z-9998", onClick: () => setIsOpen(false) }), document.body),
12465
12524
  typeof window !== "undefined" && dropdownPosition && createPortal10(
12466
12525
  /* @__PURE__ */ jsx51(
12467
12526
  "div",
12468
12527
  {
12469
- className: "z-[9999] bg-card border border-border rounded-lg shadow-lg overflow-hidden",
12528
+ className: "z-9999 bg-card border border-border rounded-lg shadow-lg overflow-hidden",
12470
12529
  style: { position: "absolute", top: dropdownPosition.top, left: dropdownPosition.left, width: dropdownPosition.width },
12471
12530
  onMouseDown: (e) => e.stopPropagation(),
12472
12531
  role: "menu",
@@ -12558,12 +12617,12 @@ function LanguageSwitcherHeadless({
12558
12617
  }
12559
12618
  ),
12560
12619
  isOpen && /* @__PURE__ */ jsxs47(Fragment19, { children: [
12561
- typeof window !== "undefined" && createPortal11(/* @__PURE__ */ jsx52("div", { className: "fixed inset-0 z-[9998]", onClick: () => setIsOpen(false) }), document.body),
12620
+ typeof window !== "undefined" && createPortal11(/* @__PURE__ */ jsx52("div", { className: "fixed inset-0 z-9998", onClick: () => setIsOpen(false) }), document.body),
12562
12621
  typeof window !== "undefined" && dropdownPosition && createPortal11(
12563
12622
  /* @__PURE__ */ jsx52(
12564
12623
  "div",
12565
12624
  {
12566
- className: "z-[9999] bg-card border border-border rounded-lg shadow-lg overflow-hidden",
12625
+ className: "z-9999 bg-card border border-border rounded-lg shadow-lg overflow-hidden",
12567
12626
  style: { position: "absolute", top: dropdownPosition.top, left: dropdownPosition.left, width: dropdownPosition.width },
12568
12627
  onMouseDown: (e) => e.stopPropagation(),
12569
12628
  role: "menu",