@underverse-ui/underverse 1.0.48 → 1.0.49

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
@@ -476,18 +476,18 @@ var Card = React2.forwardRef(
476
476
  )
477
477
  }
478
478
  ),
479
- (title || description) && /* @__PURE__ */ jsxs3("div", { className: cn("relative flex flex-col space-y-2 p-4 md:p-6 max-md:space-y-1.5 max-md:p-3", headerClassName), children: [
479
+ (title || description) && /* @__PURE__ */ jsxs3("div", { className: cn("relative flex min-w-0 flex-col space-y-2 p-4 md:p-6 max-md:space-y-1.5 max-md:p-3", headerClassName), children: [
480
480
  title && /* @__PURE__ */ jsx3(
481
481
  "h3",
482
482
  {
483
483
  className: cn(
484
- "text-base md:text-lg font-semibold leading-none tracking-tight transition-colors duration-200 max-md:text-sm",
484
+ "min-w-0 text-base md:text-lg font-semibold leading-tight tracking-tight break-words [overflow-wrap:anywhere] transition-colors duration-200 max-md:text-sm",
485
485
  hoverable && "group-hover:text-primary"
486
486
  ),
487
487
  children: title
488
488
  }
489
489
  ),
490
- description && /* @__PURE__ */ jsx3("p", { className: "text-sm md:text-base text-muted-foreground leading-relaxed", children: description })
490
+ description && /* @__PURE__ */ jsx3("p", { className: "min-w-0 text-sm md:text-base text-muted-foreground leading-relaxed break-words [overflow-wrap:anywhere]", children: description })
491
491
  ] }),
492
492
  children && /* @__PURE__ */ jsx3("div", { className: cn("relative", defaultPaddingX, defaultPaddingY, contentClassName), children }),
493
493
  footer && /* @__PURE__ */ jsx3("div", { className: cn("relative flex items-center p-4 md:p-6 pt-0 border-t border-border mt-4 max-md:mt-3 max-md:p-3 max-md:pt-0", footerClassName), children: footer })
@@ -14782,7 +14782,7 @@ function OverlayControls({
14782
14782
  // src/components/CategoryTreeSelect.tsx
14783
14783
  import { useEffect as useEffect22, useId as useId7, useMemo as useMemo17, useRef as useRef17, useState as useState29 } from "react";
14784
14784
  import { ChevronRight as ChevronRight6, ChevronDown as ChevronDown5, FolderTree, Layers, Search as Search5, SearchX as SearchX3, X as X13 } from "lucide-react";
14785
- import { Fragment as Fragment16, jsx as jsx46, jsxs as jsxs38 } from "react/jsx-runtime";
14785
+ import { jsx as jsx46, jsxs as jsxs38 } from "react/jsx-runtime";
14786
14786
  var defaultLabels = {
14787
14787
  emptyText: "No categories",
14788
14788
  selectedText: (count) => `${count} selected`,
@@ -14827,6 +14827,7 @@ function CategoryTreeSelect(props) {
14827
14827
  const describedBy = errorId || helperId;
14828
14828
  const mergedLabels = { ...defaultLabels, ...labels };
14829
14829
  const valueArray = singleSelect ? props.value != null ? [props.value] : [] : props.value || [];
14830
+ const selectedIds = useMemo17(() => new Set(valueArray), [valueArray]);
14830
14831
  const { parentCategories, childrenMap, byId } = useMemo17(() => {
14831
14832
  const byId2 = /* @__PURE__ */ new Map();
14832
14833
  const childrenMap2 = /* @__PURE__ */ new Map();
@@ -14941,65 +14942,80 @@ function CategoryTreeSelect(props) {
14941
14942
  }
14942
14943
  };
14943
14944
  const renderCategory = (category, level = 0) => {
14944
- const allChildren = childrenMap.get(category.id) || [];
14945
- const children = isSearchMode ? allChildren.filter((c) => visibleIds?.has(c.id)) : allChildren;
14945
+ const children = effectiveChildrenMap.get(category.id) || [];
14946
14946
  const hasChildren = children.length > 0;
14947
14947
  const isExpanded = hasChildren && (isSearchMode || expandedNodes.has(category.id));
14948
- const isSelected = valueArray.includes(category.id);
14949
- const isParent = level === 0;
14950
- return /* @__PURE__ */ jsxs38("div", { className: "animate-in fade-in-50 duration-200", style: { animationDelay: `${level * 30}ms` }, children: [
14951
- /* @__PURE__ */ jsxs38(
14952
- "div",
14953
- {
14954
- onClick: () => !viewOnly && handleSelect(category.id, category),
14955
- className: cn(
14956
- "relative flex items-center gap-2.5 px-3 py-2.5 min-h-11 transition-all duration-200 rounded-full",
14957
- // Không phân biệt parent/child - đồng bộ màu
14958
- !viewOnly && "cursor-pointer",
14959
- !viewOnly && !isSelected && "hover:bg-accent/50",
14960
- // Selected state - đồng bộ cho tất cả
14961
- !viewOnly && isSelected && "bg-accent/40"
14948
+ const isSelected = selectedIds.has(category.id);
14949
+ return /* @__PURE__ */ jsxs38(
14950
+ "div",
14951
+ {
14952
+ className: "min-w-0 animate-in fade-in-50 duration-200 [content-visibility:auto] [contain-intrinsic-size:44px]",
14953
+ style: { animationDelay: `${level * 30}ms` },
14954
+ children: [
14955
+ /* @__PURE__ */ jsxs38(
14956
+ "div",
14957
+ {
14958
+ onClick: () => !viewOnly && handleSelect(category.id, category),
14959
+ className: cn(
14960
+ "relative flex min-w-0 items-center gap-2.5 px-3 py-2.5 min-h-11 transition-all duration-200 rounded-3xl",
14961
+ // Không phân biệt parent/child - đồng bộ màu
14962
+ !viewOnly && "cursor-pointer",
14963
+ !viewOnly && !isSelected && "hover:bg-accent/50",
14964
+ // Selected state - đồng bộ cho tất cả
14965
+ !viewOnly && isSelected && "bg-accent/40"
14966
+ ),
14967
+ style: { paddingLeft: `${level * 1.25 + 0.75}rem` },
14968
+ children: [
14969
+ hasChildren ? /* @__PURE__ */ jsx46(
14970
+ "button",
14971
+ {
14972
+ type: "button",
14973
+ onClick: (e) => {
14974
+ e.stopPropagation();
14975
+ toggleExpand(category.id);
14976
+ },
14977
+ className: cn(
14978
+ "p-1.5 rounded-lg transition-all duration-200",
14979
+ "hover:scale-110 active:scale-95",
14980
+ "focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/50",
14981
+ isExpanded && "text-primary",
14982
+ isSearchMode && "opacity-60 cursor-not-allowed hover:scale-100 active:scale-100"
14983
+ ),
14984
+ disabled: isSearchMode,
14985
+ children: /* @__PURE__ */ jsx46("div", { className: cn("transition-transform duration-200", isExpanded && "rotate-90"), children: /* @__PURE__ */ jsx46(ChevronRight6, { className: "w-4 h-4" }) })
14986
+ }
14987
+ ) : /* @__PURE__ */ jsx46("span", { className: "w-7" }),
14988
+ viewOnly ? (
14989
+ // View-only mode: just display the name with folder icon
14990
+ /* @__PURE__ */ jsxs38("div", { className: "flex min-w-0 items-center gap-2.5", children: [
14991
+ category.icon ? /* @__PURE__ */ jsx46("div", { className: "h-4 w-4 shrink-0 flex items-center justify-center text-muted-foreground/60", children: category.icon }) : hasChildren ? /* @__PURE__ */ jsx46(FolderTree, { className: "h-4 w-4 shrink-0 text-muted-foreground/60" }) : /* @__PURE__ */ jsx46("div", { className: "h-1.5 w-1.5 shrink-0 rounded-full bg-muted-foreground/40" }),
14992
+ /* @__PURE__ */ jsx46("span", { className: "min-w-0 text-sm font-medium leading-snug break-words [overflow-wrap:anywhere]", children: category.name })
14993
+ ] })
14994
+ ) : (
14995
+ // Single/Multi select mode: icon + text + badge
14996
+ /* @__PURE__ */ jsxs38("div", { className: "flex min-w-0 flex-1 items-center gap-2.5 overflow-hidden", children: [
14997
+ category.icon && /* @__PURE__ */ jsx46("div", { className: "h-4 w-4 shrink-0 flex items-center justify-center text-current", children: category.icon }),
14998
+ /* @__PURE__ */ jsx46(
14999
+ "span",
15000
+ {
15001
+ className: cn(
15002
+ "min-w-0 flex-1 text-sm leading-snug break-words [overflow-wrap:anywhere] transition-all duration-200",
15003
+ isSelected ? "font-semibold text-primary" : "text-foreground/80"
15004
+ ),
15005
+ children: category.name
15006
+ }
15007
+ ),
15008
+ hasChildren && !isSelected && /* @__PURE__ */ jsx46("span", { className: "ml-auto shrink-0 text-[10px] font-medium text-muted-foreground/50 bg-muted/50 px-1.5 py-0.5 rounded-md", children: children.length })
15009
+ ] })
15010
+ )
15011
+ ]
15012
+ }
14962
15013
  ),
14963
- style: { paddingLeft: `${level * 1.25 + 0.75}rem` },
14964
- children: [
14965
- hasChildren ? /* @__PURE__ */ jsx46(
14966
- "button",
14967
- {
14968
- type: "button",
14969
- onClick: (e) => {
14970
- e.stopPropagation();
14971
- toggleExpand(category.id);
14972
- },
14973
- className: cn(
14974
- "p-1.5 rounded-lg transition-all duration-200",
14975
- "hover:scale-110 active:scale-95",
14976
- "focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/50",
14977
- isExpanded && "text-primary",
14978
- isSearchMode && "opacity-60 cursor-not-allowed hover:scale-100 active:scale-100"
14979
- ),
14980
- disabled: isSearchMode,
14981
- children: /* @__PURE__ */ jsx46("div", { className: cn("transition-transform duration-200", isExpanded && "rotate-90"), children: /* @__PURE__ */ jsx46(ChevronRight6, { className: "w-4 h-4" }) })
14982
- }
14983
- ) : /* @__PURE__ */ jsx46("span", { className: "w-7" }),
14984
- viewOnly ? (
14985
- // View-only mode: just display the name with folder icon
14986
- /* @__PURE__ */ jsxs38("div", { className: "flex items-center gap-2.5", children: [
14987
- category.icon ? /* @__PURE__ */ jsx46("div", { className: "w-4 h-4 flex items-center justify-center text-muted-foreground/60", children: category.icon }) : hasChildren ? /* @__PURE__ */ jsx46(FolderTree, { className: "w-4 h-4 text-muted-foreground/60" }) : /* @__PURE__ */ jsx46("div", { className: "w-1.5 h-1.5 rounded-full bg-muted-foreground/40" }),
14988
- /* @__PURE__ */ jsx46("span", { className: "text-sm font-medium", children: category.name })
14989
- ] })
14990
- ) : (
14991
- // Single/Multi select mode: icon + text + badge
14992
- /* @__PURE__ */ jsxs38("div", { className: "flex items-center gap-2.5 flex-1", children: [
14993
- category.icon && /* @__PURE__ */ jsx46("div", { className: "w-4 h-4 flex items-center justify-center text-current", children: category.icon }),
14994
- /* @__PURE__ */ jsx46("span", { className: cn("text-sm transition-all duration-200", isSelected ? "font-semibold text-primary" : "text-foreground/80"), children: category.name }),
14995
- hasChildren && !isSelected && /* @__PURE__ */ jsx46("span", { className: "ml-auto text-[10px] font-medium text-muted-foreground/50 bg-muted/50 px-1.5 py-0.5 rounded-md", children: children.length })
14996
- ] })
14997
- )
14998
- ]
14999
- }
15000
- ),
15001
- hasChildren && isExpanded && /* @__PURE__ */ jsx46("div", { className: cn("ml-2 pl-2 border-l-2 border-dashed border-border/50", "animate-in slide-in-from-top-2 fade-in-50 duration-200"), children: children.map((child) => renderCategory(child, level + 1)) })
15002
- ] }, category.id);
15014
+ hasChildren && isExpanded && /* @__PURE__ */ jsx46("div", { className: cn("ml-2 pl-2 border-l-2 border-dashed border-border/50", "animate-in slide-in-from-top-2 fade-in-50 duration-200"), children: children.map((child) => renderCategory(child, level + 1)) })
15015
+ ]
15016
+ },
15017
+ category.id
15018
+ );
15003
15019
  };
15004
15020
  const renderSearch = () => {
15005
15021
  if (!isSearchEnabled) return null;
@@ -15045,7 +15061,18 @@ function CategoryTreeSelect(props) {
15045
15061
  if (!isSearchMode) return parentCategories;
15046
15062
  return parentCategories.filter((c) => visibleIds?.has(c.id));
15047
15063
  }, [isSearchMode, parentCategories, visibleIds]);
15048
- const renderTreeContent = () => /* @__PURE__ */ jsx46("div", { className: "space-y-0.5", children: effectiveParentCategories.length === 0 ? /* @__PURE__ */ jsxs38("div", { className: "flex flex-col items-center justify-center py-8 text-center", children: [
15064
+ const effectiveChildrenMap = useMemo17(() => {
15065
+ if (!isSearchMode || !visibleIds) return childrenMap;
15066
+ const next = /* @__PURE__ */ new Map();
15067
+ for (const [parentId, children] of childrenMap.entries()) {
15068
+ next.set(
15069
+ parentId,
15070
+ children.filter((child) => visibleIds.has(child.id))
15071
+ );
15072
+ }
15073
+ return next;
15074
+ }, [childrenMap, isSearchMode, visibleIds]);
15075
+ const renderTreeContent = () => /* @__PURE__ */ jsx46("div", { className: "space-y-0.5 overflow-x-hidden", children: effectiveParentCategories.length === 0 ? /* @__PURE__ */ jsxs38("div", { className: "flex flex-col items-center justify-center py-8 text-center", children: [
15049
15076
  /* @__PURE__ */ jsx46("div", { className: "w-12 h-12 rounded-2xl bg-muted/50 flex items-center justify-center mb-3", children: isSearchMode ? /* @__PURE__ */ jsx46(SearchX3, { className: "w-6 h-6 text-muted-foreground/50" }) : /* @__PURE__ */ jsx46(Layers, { className: "w-6 h-6 text-muted-foreground/50" }) }),
15050
15077
  /* @__PURE__ */ jsx46("span", { className: "text-sm text-muted-foreground", children: isSearchMode ? mergedLabels.noResultsText : mergedLabels.emptyText })
15051
15078
  ] }) : effectiveParentCategories.map((cat) => renderCategory(cat)) });
@@ -15168,104 +15195,108 @@ function CategoryTreeSelect(props) {
15168
15195
  displayText = mergedLabels.selectedText(selectedCount);
15169
15196
  }
15170
15197
  }
15198
+ const dropdownBody = /* @__PURE__ */ jsxs38(
15199
+ "div",
15200
+ {
15201
+ ref: dropdownViewportRef,
15202
+ id: `${resolvedId}-tree`,
15203
+ className: cn("max-h-80 overflow-auto overflow-x-hidden p-2"),
15204
+ children: [
15205
+ renderSearch(),
15206
+ renderTreeContent()
15207
+ ]
15208
+ }
15209
+ );
15171
15210
  return /* @__PURE__ */ jsxs38("div", { className: cn("w-full space-y-2", className), children: [
15172
15211
  renderLabel(),
15173
- /* @__PURE__ */ jsxs38("div", { className: "relative", children: [
15174
- /* @__PURE__ */ jsxs38(
15175
- "button",
15176
- {
15177
- id: resolvedId,
15178
- type: "button",
15179
- onClick: () => !disabled && setIsOpen(!isOpen),
15180
- disabled,
15181
- role: "combobox",
15182
- "aria-haspopup": "tree",
15183
- "aria-expanded": isOpen,
15184
- "aria-controls": `${resolvedId}-tree`,
15185
- "aria-labelledby": labelId,
15186
- "aria-describedby": describedBy,
15187
- "aria-invalid": !!error,
15188
- className: cn(
15189
- "group flex w-full items-center justify-between rounded-full transition-all duration-200",
15190
- "backdrop-blur-sm",
15191
- triggerSizeStyles[size].button,
15192
- triggerVariantStyles[variant],
15193
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-2 focus-visible:ring-offset-background",
15194
- disabled && "opacity-50 cursor-not-allowed hover:transform-none hover:shadow-none",
15195
- isOpen && "ring-2 ring-primary/30 border-primary/50 shadow-lg shadow-primary/10",
15196
- error && "border-destructive focus-visible:ring-destructive/30"
15197
- ),
15198
- children: [
15199
- /* @__PURE__ */ jsxs38("div", { className: "flex min-w-0 flex-1 items-center gap-2.5 text-left", children: [
15200
- /* @__PURE__ */ jsx46(
15201
- "div",
15202
- {
15203
- className: cn(
15204
- "shrink-0 flex items-center justify-center rounded-lg transition-all duration-300",
15205
- triggerSizeStyles[size].iconWrap,
15206
- isOpen ? "bg-primary/15 text-primary" : "bg-muted/50 text-muted-foreground group-hover:bg-primary/10 group-hover:text-primary"
15207
- ),
15208
- children: /* @__PURE__ */ jsx46(FolderTree, { className: cn(triggerSizeStyles[size].icon, "transition-transform duration-300", isOpen && "scale-110") })
15209
- }
15210
- ),
15211
- /* @__PURE__ */ jsx46(
15212
- "span",
15213
- {
15214
- className: cn(
15215
- "min-w-0 flex-1 truncate font-medium transition-colors duration-200",
15216
- triggerSizeStyles[size].text,
15217
- selectedCount === 0 ? "text-muted-foreground" : "text-foreground"
15218
- ),
15219
- title: displayText,
15220
- children: displayText
15221
- }
15222
- )
15223
- ] }),
15224
- /* @__PURE__ */ jsxs38("div", { className: "ml-2 flex shrink-0 items-center gap-1.5", children: [
15225
- allowClear && selectedCount > 0 && !disabled && /* @__PURE__ */ jsx46(
15226
- "div",
15227
- {
15228
- role: "button",
15229
- tabIndex: 0,
15230
- "aria-label": "Clear selection",
15231
- onClick: handleClear,
15232
- onKeyDown: (event) => (event.key === "Enter" || event.key === " ") && handleClear(event),
15233
- className: cn(
15234
- "opacity-0 group-hover:opacity-100 transition-all duration-200",
15235
- "p-1 rounded-lg hover:bg-destructive/10 text-muted-foreground hover:text-destructive",
15236
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/30"
15237
- ),
15238
- children: /* @__PURE__ */ jsx46(X13, { className: triggerSizeStyles[size].clearIcon })
15239
- }
15240
- ),
15241
- selectedCount > 0 && !singleSelect && /* @__PURE__ */ jsx46("span", { className: cn("rounded-full bg-primary/15 font-bold text-primary", triggerSizeStyles[size].badge), children: selectedCount }),
15242
- /* @__PURE__ */ jsx46("span", { className: cn("transition-all duration-300 text-muted-foreground group-hover:text-foreground", isOpen && "rotate-180 text-primary"), children: /* @__PURE__ */ jsx46(ChevronDown5, { className: triggerSizeStyles[size].actionIcon }) })
15243
- ] })
15244
- ]
15245
- }
15246
- ),
15247
- isOpen && !disabled && /* @__PURE__ */ jsxs38(Fragment16, { children: [
15248
- /* @__PURE__ */ jsx46("div", { className: "fixed inset-0 z-10", onClick: () => setIsOpen(false) }),
15249
- /* @__PURE__ */ jsxs38(
15250
- "div",
15212
+ /* @__PURE__ */ jsx46(
15213
+ Popover,
15214
+ {
15215
+ open: isOpen,
15216
+ onOpenChange: setIsOpen,
15217
+ disabled,
15218
+ placement: "bottom-start",
15219
+ matchTriggerWidth: true,
15220
+ className: "z-9999",
15221
+ contentClassName: cn(
15222
+ "p-0 overflow-hidden rounded-2xl md:rounded-3xl",
15223
+ "border-border/40 bg-popover/95 text-popover-foreground",
15224
+ "shadow-2xl backdrop-blur-xl"
15225
+ ),
15226
+ trigger: /* @__PURE__ */ jsxs38(
15227
+ "button",
15251
15228
  {
15252
- ref: dropdownViewportRef,
15253
- id: `${resolvedId}-tree`,
15229
+ id: resolvedId,
15230
+ type: "button",
15231
+ disabled,
15232
+ role: "combobox",
15233
+ "aria-haspopup": "tree",
15234
+ "aria-controls": `${resolvedId}-tree`,
15235
+ "aria-labelledby": labelId,
15236
+ "aria-describedby": describedBy,
15237
+ "aria-invalid": !!error,
15254
15238
  className: cn(
15255
- "absolute z-20 mt-2 w-full max-h-80 overflow-auto",
15256
- "rounded-2xl md:rounded-3xl border border-border/40 bg-popover/95 text-popover-foreground",
15257
- "shadow-2xl backdrop-blur-xl",
15258
- "p-2",
15259
- "animate-in fade-in-0 zoom-in-95 slide-in-from-top-2 duration-300"
15239
+ "group flex w-full items-center justify-between rounded-full transition-all duration-200",
15240
+ "backdrop-blur-sm",
15241
+ triggerSizeStyles[size].button,
15242
+ triggerVariantStyles[variant],
15243
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-2 focus-visible:ring-offset-background",
15244
+ disabled && "opacity-50 cursor-not-allowed hover:transform-none hover:shadow-none",
15245
+ isOpen && "ring-2 ring-primary/30 border-primary/50 shadow-lg shadow-primary/10",
15246
+ error && "border-destructive focus-visible:ring-destructive/30"
15260
15247
  ),
15261
15248
  children: [
15262
- renderSearch(),
15263
- renderTreeContent()
15249
+ /* @__PURE__ */ jsxs38("div", { className: "flex min-w-0 flex-1 items-center gap-2.5 text-left", children: [
15250
+ /* @__PURE__ */ jsx46(
15251
+ "div",
15252
+ {
15253
+ className: cn(
15254
+ "shrink-0 flex items-center justify-center rounded-lg transition-all duration-300",
15255
+ triggerSizeStyles[size].iconWrap,
15256
+ isOpen ? "bg-primary/15 text-primary" : "bg-muted/50 text-muted-foreground group-hover:bg-primary/10 group-hover:text-primary"
15257
+ ),
15258
+ children: /* @__PURE__ */ jsx46(FolderTree, { className: cn(triggerSizeStyles[size].icon, "transition-transform duration-300", isOpen && "scale-110") })
15259
+ }
15260
+ ),
15261
+ /* @__PURE__ */ jsx46(
15262
+ "span",
15263
+ {
15264
+ className: cn(
15265
+ "min-w-0 flex-1 truncate font-medium transition-colors duration-200",
15266
+ triggerSizeStyles[size].text,
15267
+ selectedCount === 0 ? "text-muted-foreground" : "text-foreground"
15268
+ ),
15269
+ title: displayText,
15270
+ children: displayText
15271
+ }
15272
+ )
15273
+ ] }),
15274
+ /* @__PURE__ */ jsxs38("div", { className: "ml-2 flex shrink-0 items-center gap-1.5", children: [
15275
+ allowClear && selectedCount > 0 && !disabled && /* @__PURE__ */ jsx46(
15276
+ "div",
15277
+ {
15278
+ role: "button",
15279
+ tabIndex: 0,
15280
+ "aria-label": "Clear selection",
15281
+ onClick: handleClear,
15282
+ onKeyDown: (event) => (event.key === "Enter" || event.key === " ") && handleClear(event),
15283
+ className: cn(
15284
+ "opacity-0 group-hover:opacity-100 transition-all duration-200",
15285
+ "p-1 rounded-lg hover:bg-destructive/10 text-muted-foreground hover:text-destructive",
15286
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/30"
15287
+ ),
15288
+ children: /* @__PURE__ */ jsx46(X13, { className: triggerSizeStyles[size].clearIcon })
15289
+ }
15290
+ ),
15291
+ selectedCount > 0 && !singleSelect && /* @__PURE__ */ jsx46("span", { className: cn("rounded-full bg-primary/15 font-bold text-primary", triggerSizeStyles[size].badge), children: selectedCount }),
15292
+ /* @__PURE__ */ jsx46("span", { className: cn("transition-all duration-300 text-muted-foreground group-hover:text-foreground", isOpen && "rotate-180 text-primary"), children: /* @__PURE__ */ jsx46(ChevronDown5, { className: triggerSizeStyles[size].actionIcon }) })
15293
+ ] })
15264
15294
  ]
15265
15295
  }
15266
- )
15267
- ] })
15268
- ] }),
15296
+ ),
15297
+ children: dropdownBody
15298
+ }
15299
+ ),
15269
15300
  renderAssistiveText()
15270
15301
  ] });
15271
15302
  }
@@ -15511,7 +15542,7 @@ import {
15511
15542
  Upload as Upload2
15512
15543
  } from "lucide-react";
15513
15544
  import { useCallback as useCallback14, useMemo as useMemo18, useRef as useRef19, useState as useState31 } from "react";
15514
- import { Fragment as Fragment17, jsx as jsx48, jsxs as jsxs40 } from "react/jsx-runtime";
15545
+ import { Fragment as Fragment16, jsx as jsx48, jsxs as jsxs40 } from "react/jsx-runtime";
15515
15546
  var formatFileSize = (bytes) => {
15516
15547
  if (bytes === 0) return "0 Bytes";
15517
15548
  const k = 1024;
@@ -15944,7 +15975,7 @@ function FileUpload({
15944
15975
  ] }),
15945
15976
  /* @__PURE__ */ jsx48("p", { className: cn("text-muted-foreground", size === "lg" ? "text-sm" : "text-xs"), children: supportedFormatsText || t("supportedFormats") || `Max ${maxSize}MB per file \u2022 Up to ${maxFiles} files` })
15946
15977
  ] }),
15947
- variant === "compact" && /* @__PURE__ */ jsxs40(Fragment17, { children: [
15978
+ variant === "compact" && /* @__PURE__ */ jsxs40(Fragment16, { children: [
15948
15979
  /* @__PURE__ */ jsx48("div", { className: cn("shrink-0 rounded-lg flex items-center justify-center", "bg-primary/10", currentSize.iconSize), children: /* @__PURE__ */ jsx48(Upload2, { className: cn("text-primary", size === "sm" ? "w-4 h-4" : "w-5 h-5") }) }),
15949
15980
  /* @__PURE__ */ jsxs40("div", { className: "flex-1 min-w-0", children: [
15950
15981
  /* @__PURE__ */ jsx48("p", { className: cn("font-medium truncate", currentSize.text), children: dragDropText || t("dragDropText") || "Drop files here or" }),
@@ -16011,7 +16042,7 @@ function FileUpload({
16011
16042
  // src/components/Carousel.tsx
16012
16043
  import * as React42 from "react";
16013
16044
  import { ChevronLeft as ChevronLeft5, ChevronRight as ChevronRight7 } from "lucide-react";
16014
- import { Fragment as Fragment18, jsx as jsx49, jsxs as jsxs41 } from "react/jsx-runtime";
16045
+ import { Fragment as Fragment17, jsx as jsx49, jsxs as jsxs41 } from "react/jsx-runtime";
16015
16046
  function Carousel({
16016
16047
  children,
16017
16048
  autoScroll = true,
@@ -16223,7 +16254,7 @@ function Carousel({
16223
16254
  ))
16224
16255
  }
16225
16256
  ),
16226
- showArrows && totalSlides > slidesToShow && /* @__PURE__ */ jsxs41(Fragment18, { children: [
16257
+ showArrows && totalSlides > slidesToShow && /* @__PURE__ */ jsxs41(Fragment17, { children: [
16227
16258
  /* @__PURE__ */ jsx49(
16228
16259
  Button_default,
16229
16260
  {
@@ -16585,7 +16616,7 @@ function FallingIcons({
16585
16616
  // src/components/List.tsx
16586
16617
  import * as React44 from "react";
16587
16618
  import { ChevronRight as ChevronRight8 } from "lucide-react";
16588
- import { Fragment as Fragment19, jsx as jsx51, jsxs as jsxs43 } from "react/jsx-runtime";
16619
+ import { Fragment as Fragment18, jsx as jsx51, jsxs as jsxs43 } from "react/jsx-runtime";
16589
16620
  var SIZE_STYLES2 = {
16590
16621
  xs: { label: "text-xs", desc: "text-[11px]", icon: "h-3.5 w-3.5", avatar: "h-6 w-6" },
16591
16622
  sm: { label: "text-[13px]", desc: "text-[12px]", icon: "h-4 w-4", avatar: "h-8 w-8" },
@@ -16737,7 +16768,7 @@ var ListItem = React44.forwardRef(
16737
16768
  }
16738
16769
  }
16739
16770
  } : {};
16740
- const inner = /* @__PURE__ */ jsxs43(Fragment19, { children: [
16771
+ const inner = /* @__PURE__ */ jsxs43(Fragment18, { children: [
16741
16772
  /* @__PURE__ */ jsxs43("div", { className: cn("flex items-center gap-3 group/item relative max-md:gap-2.5", contentClassName), ...headerProps, children: [
16742
16773
  avatar && /* @__PURE__ */ jsx51("div", { className: cn("shrink-0", sz.avatar), children: typeof avatar === "string" ? /* @__PURE__ */ jsx51("img", { src: avatar, alt: "", className: cn("rounded-full object-cover", sz.avatar) }) : avatar }),
16743
16774
  Left && !avatar && /* @__PURE__ */ jsx51("span", { className: cn("text-muted-foreground shrink-0", sz.icon), children: /* @__PURE__ */ jsx51(Left, { className: cn(sz.icon) }) }),
@@ -16782,7 +16813,7 @@ var List_default = List;
16782
16813
  // src/components/Watermark.tsx
16783
16814
  import * as React45 from "react";
16784
16815
  import { createPortal as createPortal5 } from "react-dom";
16785
- import { Fragment as Fragment20, jsx as jsx52, jsxs as jsxs44 } from "react/jsx-runtime";
16816
+ import { Fragment as Fragment19, jsx as jsx52, jsxs as jsxs44 } from "react/jsx-runtime";
16786
16817
  var PRESETS2 = {
16787
16818
  confidential: { text: "CONFIDENTIAL", color: "rgba(220, 38, 38, 0.15)", rotate: -22, fontSize: 16, fontWeight: "bold" },
16788
16819
  draft: { text: "DRAFT", color: "rgba(59, 130, 246, 0.15)", rotate: -22, fontSize: 18, fontWeight: "bold" },
@@ -17061,7 +17092,7 @@ var Watermark = ({
17061
17092
  }
17062
17093
  );
17063
17094
  if (fullPage) {
17064
- return /* @__PURE__ */ jsxs44(Fragment20, { children: [
17095
+ return /* @__PURE__ */ jsxs44(Fragment19, { children: [
17065
17096
  children,
17066
17097
  typeof window !== "undefined" ? createPortal5(overlay, document.body) : null
17067
17098
  ] });
@@ -18226,7 +18257,7 @@ var MusicPlayer_default = MusicPlayer;
18226
18257
 
18227
18258
  // src/components/Grid.tsx
18228
18259
  import React49, { useId as useId8 } from "react";
18229
- import { Fragment as Fragment21, jsx as jsx56, jsxs as jsxs48 } from "react/jsx-runtime";
18260
+ import { Fragment as Fragment20, jsx as jsx56, jsxs as jsxs48 } from "react/jsx-runtime";
18230
18261
  var BP_MIN = {
18231
18262
  sm: 640,
18232
18263
  md: 768,
@@ -18383,7 +18414,7 @@ var GridItem = React49.forwardRef(
18383
18414
  st.opacity = 0;
18384
18415
  st.animation = `uvGridItemFadeIn 0.5s ease-out forwards`;
18385
18416
  }
18386
- return /* @__PURE__ */ jsxs48(Fragment21, { children: [
18417
+ return /* @__PURE__ */ jsxs48(Fragment20, { children: [
18387
18418
  animationDelay != null && /* @__PURE__ */ jsx56(
18388
18419
  "style",
18389
18420
  {
@@ -18418,7 +18449,7 @@ import { useMemo as useMemo19, useState as useState39, useRef as useRef23, useCa
18418
18449
  // src/components/ChartTooltip.tsx
18419
18450
  import { useEffect as useEffect27, useState as useState38, useRef as useRef22 } from "react";
18420
18451
  import { createPortal as createPortal6 } from "react-dom";
18421
- import { Fragment as Fragment22, jsx as jsx57, jsxs as jsxs49 } from "react/jsx-runtime";
18452
+ import { Fragment as Fragment21, jsx as jsx57, jsxs as jsxs49 } from "react/jsx-runtime";
18422
18453
  function ChartTooltip({
18423
18454
  x,
18424
18455
  y,
@@ -18488,7 +18519,7 @@ function ChartTooltip({
18488
18519
  ":"
18489
18520
  ] }),
18490
18521
  /* @__PURE__ */ jsx57("span", { className: "font-semibold ml-auto", children: formatter ? formatter(item.value) : item.value })
18491
- ] }, i)) }) : /* @__PURE__ */ jsxs49(Fragment22, { children: [
18522
+ ] }, i)) }) : /* @__PURE__ */ jsxs49(Fragment21, { children: [
18492
18523
  /* @__PURE__ */ jsxs49("div", { className: "flex items-center gap-2", children: [
18493
18524
  color && /* @__PURE__ */ jsx57("div", { className: "w-2 h-2 rounded-full shrink-0", style: { backgroundColor: color } }),
18494
18525
  /* @__PURE__ */ jsx57("span", { className: "font-semibold", children: formatter && value != null ? formatter(value) : value })
@@ -18543,7 +18574,7 @@ function getPathLength(points) {
18543
18574
  }
18544
18575
 
18545
18576
  // src/components/LineChart.tsx
18546
- import { Fragment as Fragment23, jsx as jsx58, jsxs as jsxs50 } from "react/jsx-runtime";
18577
+ import { Fragment as Fragment22, jsx as jsx58, jsxs as jsxs50 } from "react/jsx-runtime";
18547
18578
  function LineChart({
18548
18579
  data,
18549
18580
  series,
@@ -18623,7 +18654,7 @@ function LineChart({
18623
18654
  }
18624
18655
  return lines;
18625
18656
  }, [minValue, maxValue, chartHeight, padding.top]);
18626
- return /* @__PURE__ */ jsxs50(Fragment23, { children: [
18657
+ return /* @__PURE__ */ jsxs50(Fragment22, { children: [
18627
18658
  /* @__PURE__ */ jsxs50("svg", { ref: svgRef, width, height, className: `overflow-visible ${className}`, style: { fontFamily: "inherit" }, children: [
18628
18659
  /* @__PURE__ */ jsx58("defs", { children: /* @__PURE__ */ jsx58("clipPath", { id: clipId, children: /* @__PURE__ */ jsx58("rect", { x: padding.left, y: padding.top, width: chartWidth, height: chartHeight }) }) }),
18629
18660
  showGrid && /* @__PURE__ */ jsx58("g", { className: "text-muted-foreground/20", children: gridLines.map((line, i) => /* @__PURE__ */ jsxs50("g", { children: [
@@ -18817,7 +18848,7 @@ function LineChart({
18817
18848
 
18818
18849
  // src/components/BarChart.tsx
18819
18850
  import { useMemo as useMemo20, useState as useState40, useRef as useRef24 } from "react";
18820
- import { Fragment as Fragment24, jsx as jsx59, jsxs as jsxs51 } from "react/jsx-runtime";
18851
+ import { Fragment as Fragment23, jsx as jsx59, jsxs as jsxs51 } from "react/jsx-runtime";
18821
18852
  function BarChart({
18822
18853
  data,
18823
18854
  series,
@@ -18959,9 +18990,9 @@ function BarChart({
18959
18990
  }
18960
18991
  return { maxValue: max, barGroups: groups, gridLines: lines };
18961
18992
  }, [normalizedSeries, chartWidth, chartHeight, horizontal, stacked, barGap, padding, width, height]);
18962
- return /* @__PURE__ */ jsxs51(Fragment24, { children: [
18993
+ return /* @__PURE__ */ jsxs51(Fragment23, { children: [
18963
18994
  /* @__PURE__ */ jsxs51("svg", { ref: svgRef, width, height, className: `overflow-visible ${className}`, style: { fontFamily: "inherit" }, children: [
18964
- showGrid && /* @__PURE__ */ jsx59("g", { className: "text-muted-foreground/20", children: gridLines.map((line, i) => /* @__PURE__ */ jsx59("g", { children: horizontal ? /* @__PURE__ */ jsxs51(Fragment24, { children: [
18995
+ showGrid && /* @__PURE__ */ jsx59("g", { className: "text-muted-foreground/20", children: gridLines.map((line, i) => /* @__PURE__ */ jsx59("g", { children: horizontal ? /* @__PURE__ */ jsxs51(Fragment23, { children: [
18965
18996
  /* @__PURE__ */ jsx59("line", { x1: line.x, y1: line.y1, x2: line.x, y2: line.y2, stroke: "currentColor", strokeDasharray: "4 4" }),
18966
18997
  /* @__PURE__ */ jsx59(
18967
18998
  "text",
@@ -18975,7 +19006,7 @@ function BarChart({
18975
19006
  children: formatValue ? formatValue(line.value) : line.value.toFixed(0)
18976
19007
  }
18977
19008
  )
18978
- ] }) : /* @__PURE__ */ jsxs51(Fragment24, { children: [
19009
+ ] }) : /* @__PURE__ */ jsxs51(Fragment23, { children: [
18979
19010
  /* @__PURE__ */ jsx59("line", { x1: line.x1, y1: line.y, x2: line.x2, y2: line.y, stroke: "currentColor", strokeDasharray: "4 4" }),
18980
19011
  /* @__PURE__ */ jsx59(
18981
19012
  "text",
@@ -20062,16 +20093,16 @@ function GaugeChart({
20062
20093
 
20063
20094
  // src/components/ClientOnly.tsx
20064
20095
  import { useEffect as useEffect28, useState as useState44 } from "react";
20065
- import { Fragment as Fragment25, jsx as jsx65 } from "react/jsx-runtime";
20096
+ import { Fragment as Fragment24, jsx as jsx65 } from "react/jsx-runtime";
20066
20097
  function ClientOnly({ children, fallback = null }) {
20067
20098
  const [hasMounted, setHasMounted] = useState44(false);
20068
20099
  useEffect28(() => {
20069
20100
  setHasMounted(true);
20070
20101
  }, []);
20071
20102
  if (!hasMounted) {
20072
- return /* @__PURE__ */ jsx65(Fragment25, { children: fallback });
20103
+ return /* @__PURE__ */ jsx65(Fragment24, { children: fallback });
20073
20104
  }
20074
- return /* @__PURE__ */ jsx65(Fragment25, { children });
20105
+ return /* @__PURE__ */ jsx65(Fragment24, { children });
20075
20106
  }
20076
20107
 
20077
20108
  // src/components/Loading.tsx
@@ -20316,7 +20347,7 @@ function DataTableBodyRows({
20316
20347
  // src/components/DataTable/components/DataTableHeader.tsx
20317
20348
  import React59 from "react";
20318
20349
  import { Filter as FilterIcon } from "lucide-react";
20319
- import { Fragment as Fragment26, jsx as jsx69, jsxs as jsxs60 } from "react/jsx-runtime";
20350
+ import { Fragment as Fragment25, jsx as jsx69, jsxs as jsxs60 } from "react/jsx-runtime";
20320
20351
  function DataTableHeader({
20321
20352
  headerRows,
20322
20353
  headerAlign,
@@ -20497,10 +20528,10 @@ function DataTableHeader({
20497
20528
  isCenterAlign && "justify-center",
20498
20529
  !isRightAlign && !isCenterAlign && "justify-start"
20499
20530
  ),
20500
- children: isRightAlign ? /* @__PURE__ */ jsxs60(Fragment26, { children: [
20531
+ children: isRightAlign ? /* @__PURE__ */ jsxs60(Fragment25, { children: [
20501
20532
  filterContent,
20502
20533
  titleContent
20503
- ] }) : /* @__PURE__ */ jsxs60(Fragment26, { children: [
20534
+ ] }) : /* @__PURE__ */ jsxs60(Fragment25, { children: [
20504
20535
  titleContent,
20505
20536
  filterContent
20506
20537
  ] })
@@ -20521,7 +20552,7 @@ function DataTableHeader({
20521
20552
  t
20522
20553
  ]
20523
20554
  );
20524
- return /* @__PURE__ */ jsx69(Fragment26, { children: headerRows.map((row, rowIndex) => /* @__PURE__ */ jsx69(TableRow, { children: row.map((headerCell, cellIndex) => {
20555
+ return /* @__PURE__ */ jsx69(Fragment25, { children: headerRows.map((row, rowIndex) => /* @__PURE__ */ jsx69(TableRow, { children: row.map((headerCell, cellIndex) => {
20525
20556
  const { column: col, colSpan, rowSpan, isLeaf } = headerCell;
20526
20557
  const prevCell = cellIndex > 0 ? row[cellIndex - 1] : null;
20527
20558
  const prevCol = prevCell?.column;
@@ -21641,7 +21672,7 @@ function AccessDenied({
21641
21672
  import { Moon as Moon2, Sun as Sun2, Monitor } from "lucide-react";
21642
21673
  import { useEffect as useEffect30, useRef as useRef28, useState as useState45 } from "react";
21643
21674
  import { createPortal as createPortal7 } from "react-dom";
21644
- import { Fragment as Fragment27, jsx as jsx76, jsxs as jsxs67 } from "react/jsx-runtime";
21675
+ import { Fragment as Fragment26, jsx as jsx76, jsxs as jsxs67 } from "react/jsx-runtime";
21645
21676
  function ThemeToggleHeadless({
21646
21677
  theme,
21647
21678
  onChange,
@@ -21692,7 +21723,7 @@ function ThemeToggleHeadless({
21692
21723
  children: /* @__PURE__ */ jsx76(CurrentIcon, { className: "h-5 w-5" })
21693
21724
  }
21694
21725
  ),
21695
- isOpen && /* @__PURE__ */ jsxs67(Fragment27, { children: [
21726
+ isOpen && /* @__PURE__ */ jsxs67(Fragment26, { children: [
21696
21727
  typeof window !== "undefined" && createPortal7(/* @__PURE__ */ jsx76("div", { className: "fixed inset-0 z-9998", onClick: () => setIsOpen(false) }), document.body),
21697
21728
  typeof window !== "undefined" && dropdownPosition && createPortal7(
21698
21729
  /* @__PURE__ */ jsx76(
@@ -21744,7 +21775,7 @@ function ThemeToggleHeadless({
21744
21775
  import { useRef as useRef29, useState as useState46 } from "react";
21745
21776
  import { createPortal as createPortal8 } from "react-dom";
21746
21777
  import { Globe } from "lucide-react";
21747
- import { Fragment as Fragment28, jsx as jsx77, jsxs as jsxs68 } from "react/jsx-runtime";
21778
+ import { Fragment as Fragment27, jsx as jsx77, jsxs as jsxs68 } from "react/jsx-runtime";
21748
21779
  function LanguageSwitcherHeadless({
21749
21780
  locales,
21750
21781
  currentLocale,
@@ -21789,7 +21820,7 @@ function LanguageSwitcherHeadless({
21789
21820
  children: /* @__PURE__ */ jsx77(Globe, { className: "h-5 w-5" })
21790
21821
  }
21791
21822
  ),
21792
- isOpen && /* @__PURE__ */ jsxs68(Fragment28, { children: [
21823
+ isOpen && /* @__PURE__ */ jsxs68(Fragment27, { children: [
21793
21824
  typeof window !== "undefined" && createPortal8(/* @__PURE__ */ jsx77("div", { className: "fixed inset-0 z-9998", onClick: () => setIsOpen(false) }), document.body),
21794
21825
  typeof window !== "undefined" && dropdownPosition && createPortal8(
21795
21826
  /* @__PURE__ */ jsx77(
@@ -24290,7 +24321,7 @@ var EmojiPicker = ({ onSelect, onClose }) => {
24290
24321
  };
24291
24322
 
24292
24323
  // src/components/UEditor/toolbar.tsx
24293
- import { Fragment as Fragment29, jsx as jsx85, jsxs as jsxs75 } from "react/jsx-runtime";
24324
+ import { Fragment as Fragment28, jsx as jsx85, jsxs as jsxs75 } from "react/jsx-runtime";
24294
24325
  function fileToDataUrl2(file) {
24295
24326
  return new Promise((resolve, reject) => {
24296
24327
  const reader = new FileReader();
@@ -24647,7 +24678,7 @@ var EditorToolbar = ({
24647
24678
  },
24648
24679
  onCancel: () => setShowImageInput(false)
24649
24680
  }
24650
- ) : /* @__PURE__ */ jsxs75(Fragment29, { children: [
24681
+ ) : /* @__PURE__ */ jsxs75(Fragment28, { children: [
24651
24682
  /* @__PURE__ */ jsx85(DropdownMenuItem, { icon: LinkIcon, label: t("imageInput.addFromUrl"), onClick: () => setShowImageInput(true) }),
24652
24683
  /* @__PURE__ */ jsx85(
24653
24684
  DropdownMenuItem,