@underverse-ui/underverse 1.0.15 → 1.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1113,6 +1113,7 @@ var import_jsx_runtime6 = require("react/jsx-runtime");
1113
1113
  var Input = (0, import_react3.forwardRef)(
1114
1114
  ({
1115
1115
  label,
1116
+ labelClassName,
1116
1117
  error,
1117
1118
  description,
1118
1119
  className,
@@ -1242,7 +1243,8 @@ var Input = (0, import_react3.forwardRef)(
1242
1243
  "font-medium transition-colors duration-200",
1243
1244
  // default color and highlight while any descendant focused
1244
1245
  disabled ? "text-muted-foreground" : cn("text-foreground group-focus-within:text-primary", success && "text-primary"),
1245
- errMsg && "text-destructive"
1246
+ errMsg && "text-destructive",
1247
+ labelClassName
1246
1248
  ),
1247
1249
  children: [
1248
1250
  label,
@@ -1583,7 +1585,20 @@ var NumberInput = (0, import_react3.forwardRef)(
1583
1585
  );
1584
1586
  NumberInput.displayName = "NumberInput";
1585
1587
  var Textarea = (0, import_react3.forwardRef)(
1586
- ({ label, error, description, variant = "default", resize = "vertical", counter = false, className, required, value, maxLength, ...props }, ref) => {
1588
+ ({
1589
+ label,
1590
+ labelClassName,
1591
+ error,
1592
+ description,
1593
+ variant = "default",
1594
+ resize = "vertical",
1595
+ counter = false,
1596
+ className,
1597
+ required,
1598
+ value,
1599
+ maxLength,
1600
+ ...props
1601
+ }, ref) => {
1587
1602
  const [isFocused, setIsFocused] = (0, import_react3.useState)(false);
1588
1603
  const charCount = typeof value === "string" ? value.length : 0;
1589
1604
  const variantStyles6 = {
@@ -1606,7 +1621,8 @@ var Textarea = (0, import_react3.forwardRef)(
1606
1621
  className: cn(
1607
1622
  "text-sm font-medium transition-colors duration-200",
1608
1623
  isFocused ? "text-primary" : "text-foreground",
1609
- error && "text-destructive"
1624
+ error && "text-destructive",
1625
+ labelClassName
1610
1626
  ),
1611
1627
  children: [
1612
1628
  label,
@@ -1678,6 +1694,7 @@ var TagInput = (0, import_react4.forwardRef)(
1678
1694
  placeholder,
1679
1695
  placeholderWithTags,
1680
1696
  label,
1697
+ labelClassName,
1681
1698
  hideSearchButton = false,
1682
1699
  hideClearButton = false,
1683
1700
  className,
@@ -1715,14 +1732,14 @@ var TagInput = (0, import_react4.forwardRef)(
1715
1732
  input: "text-sm",
1716
1733
  tag: "px-2 py-1 text-sm gap-1.5 rounded-full",
1717
1734
  tagIcon: "h-3.5 w-3.5",
1718
- button: "h-8 text-sm px-3"
1735
+ button: "h-9 text-sm px-3"
1719
1736
  },
1720
1737
  lg: {
1721
1738
  container: "min-h-12 p-2.5 gap-2 rounded-full",
1722
1739
  input: "text-base",
1723
1740
  tag: "px-2.5 py-1.5 text-base gap-2 rounded-full",
1724
1741
  tagIcon: "h-4 w-4",
1725
- button: "h-9 text-base px-4"
1742
+ button: "h-11 text-base px-4"
1726
1743
  }
1727
1744
  };
1728
1745
  const addTag = (tagValue) => {
@@ -1790,7 +1807,8 @@ var TagInput = (0, import_react4.forwardRef)(
1790
1807
  className: cn(
1791
1808
  "block font-medium transition-colors duration-200",
1792
1809
  size === "sm" ? "text-xs" : size === "lg" ? "text-base" : "text-sm",
1793
- disabled ? "text-muted-foreground" : isFocused ? "text-primary" : "text-foreground"
1810
+ disabled ? "text-muted-foreground" : isFocused ? "text-primary" : "text-foreground",
1811
+ labelClassName
1794
1812
  ),
1795
1813
  children: [
1796
1814
  label,
@@ -2052,6 +2070,7 @@ var Switch = ({
2052
2070
  checked,
2053
2071
  onCheckedChange,
2054
2072
  label,
2073
+ labelClassName,
2055
2074
  size = "md",
2056
2075
  variant = "default",
2057
2076
  disabled = false,
@@ -2094,79 +2113,60 @@ var Switch = ({
2094
2113
  inactive: "bg-input border-input"
2095
2114
  }
2096
2115
  };
2097
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2098
- "label",
2099
- {
2100
- className: cn(
2101
- "inline-flex items-center gap-3 cursor-pointer select-none",
2102
- disabled && "cursor-not-allowed opacity-50",
2103
- className
2104
- ),
2105
- children: [
2106
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2107
- "div",
2108
- {
2109
- className: cn(
2110
- "relative inline-flex rounded-full align-middle",
2111
- sizeClasses2[size].track,
2112
- // Focus ring styled like shadcn (via peer-visible)
2113
- "peer-focus-visible:ring-2 peer-focus-visible:ring-ring peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-background",
2114
- disabled && "opacity-50"
2115
- ),
2116
- children: [
2117
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2118
- "input",
2119
- {
2120
- type: "checkbox",
2121
- className: "sr-only peer",
2122
- checked,
2123
- disabled,
2124
- onChange: (e) => !disabled && onCheckedChange(e.target.checked),
2125
- ...props
2126
- }
2127
- ),
2128
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2129
- "div",
2130
- {
2131
- className: cn(
2132
- "block w-full h-full rounded-full transition-colors duration-200 ease-out border",
2133
- checked ? variantClasses2[variant].active : variantClasses2[variant].inactive
2134
- )
2135
- }
2136
- ),
2137
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2138
- "div",
2139
- {
2140
- className: cn(
2141
- "absolute top-0.5 left-0.5 rounded-full transition-transform duration-200 ease-out shadow-sm",
2142
- sizeClasses2[size].handle,
2143
- "bg-background border border-border",
2144
- checked ? sizeClasses2[size].translate : "translate-x-0",
2145
- !disabled && "hover:scale-[1.02]",
2146
- isPressed && "scale-95",
2147
- disabled && "opacity-70"
2148
- ),
2149
- onMouseDown: () => !disabled && setIsPressed(true),
2150
- onMouseUp: () => setIsPressed(false),
2151
- onMouseLeave: () => setIsPressed(false)
2152
- }
2153
- )
2154
- ]
2155
- }
2116
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("label", { className: cn("inline-flex items-center gap-3 cursor-pointer select-none", disabled && "cursor-not-allowed opacity-50", className), children: [
2117
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2118
+ "div",
2119
+ {
2120
+ className: cn(
2121
+ "relative inline-flex rounded-full align-middle",
2122
+ sizeClasses2[size].track,
2123
+ // Focus ring styled like shadcn (via peer-visible)
2124
+ "peer-focus-visible:ring-2 peer-focus-visible:ring-ring peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-background",
2125
+ disabled && "opacity-50"
2156
2126
  ),
2157
- label && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2158
- "span",
2159
- {
2160
- className: cn(
2161
- "text-sm font-medium text-foreground transition-colors",
2162
- disabled && "text-muted-foreground"
2163
- ),
2164
- children: label
2165
- }
2166
- )
2167
- ]
2168
- }
2169
- );
2127
+ children: [
2128
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2129
+ "input",
2130
+ {
2131
+ type: "checkbox",
2132
+ className: "sr-only peer",
2133
+ checked,
2134
+ disabled,
2135
+ onChange: (e) => !disabled && onCheckedChange(e.target.checked),
2136
+ ...props
2137
+ }
2138
+ ),
2139
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2140
+ "div",
2141
+ {
2142
+ className: cn(
2143
+ "block w-full h-full rounded-full transition-colors duration-200 ease-out border",
2144
+ checked ? variantClasses2[variant].active : variantClasses2[variant].inactive
2145
+ )
2146
+ }
2147
+ ),
2148
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2149
+ "div",
2150
+ {
2151
+ className: cn(
2152
+ "absolute top-0.5 left-0.5 rounded-full transition-transform duration-200 ease-out shadow-sm",
2153
+ sizeClasses2[size].handle,
2154
+ "bg-background border border-border",
2155
+ checked ? sizeClasses2[size].translate : "translate-x-0",
2156
+ !disabled && "hover:scale-[1.02]",
2157
+ isPressed && "scale-95",
2158
+ disabled && "opacity-70"
2159
+ ),
2160
+ onMouseDown: () => !disabled && setIsPressed(true),
2161
+ onMouseUp: () => setIsPressed(false),
2162
+ onMouseLeave: () => setIsPressed(false)
2163
+ }
2164
+ )
2165
+ ]
2166
+ }
2167
+ ),
2168
+ label && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: cn("text-sm font-medium text-foreground transition-colors", disabled && "text-muted-foreground", labelClassName), children: label })
2169
+ ] });
2170
2170
  };
2171
2171
  Switch.displayName = "Switch";
2172
2172
  var Switch_default = Switch;
@@ -5010,6 +5010,7 @@ var Combobox = ({
5010
5010
  allowClear = false,
5011
5011
  usePortal = true,
5012
5012
  label,
5013
+ labelClassName,
5013
5014
  required,
5014
5015
  fontBold = false,
5015
5016
  loading: loading2 = false,
@@ -5351,7 +5352,8 @@ var Combobox = ({
5351
5352
  className: cn(
5352
5353
  labelSize,
5353
5354
  "font-medium transition-colors duration-200",
5354
- disabled ? "text-muted-foreground" : "text-foreground group-focus-within:text-primary"
5355
+ disabled ? "text-muted-foreground" : "text-foreground group-focus-within:text-primary",
5356
+ labelClassName
5355
5357
  ),
5356
5358
  children: [
5357
5359
  label,
@@ -5839,6 +5841,7 @@ var DatePicker = ({
5839
5841
  disabled = false,
5840
5842
  size = "md",
5841
5843
  label,
5844
+ labelClassName,
5842
5845
  required,
5843
5846
  todayLabel,
5844
5847
  clearLabel,
@@ -5896,7 +5899,7 @@ var DatePicker = ({
5896
5899
  footerMargin: "mt-3 pt-2 gap-1.5"
5897
5900
  },
5898
5901
  md: {
5899
- trigger: "px-3 py-2.5 text-sm h-11",
5902
+ trigger: "px-3 py-2.5 text-sm h-10",
5900
5903
  dayCell: "w-8 h-8 text-sm",
5901
5904
  monthCell: "w-8 h-8 text-sm",
5902
5905
  navButton: "p-2",
@@ -5913,7 +5916,7 @@ var DatePicker = ({
5913
5916
  footerMargin: "mt-4 pt-3 gap-2"
5914
5917
  },
5915
5918
  lg: {
5916
- trigger: "px-4 py-3 text-base h-14",
5919
+ trigger: "px-4 py-3 text-base h-12",
5917
5920
  dayCell: "w-10 h-10 text-base",
5918
5921
  monthCell: "w-10 h-10 text-base",
5919
5922
  navButton: "p-2.5",
@@ -6242,7 +6245,8 @@ var DatePicker = ({
6242
6245
  className: cn(
6243
6246
  labelSize,
6244
6247
  "font-semibold transition-colors duration-300 cursor-pointer",
6245
- disabled ? "text-muted-foreground" : "text-foreground group-focus-within:text-primary hover:text-primary"
6248
+ disabled ? "text-muted-foreground" : "text-foreground group-focus-within:text-primary hover:text-primary",
6249
+ labelClassName
6246
6250
  ),
6247
6251
  children: [
6248
6252
  label,
@@ -6377,7 +6381,7 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
6377
6381
  footerMargin: "mt-3 pt-2 gap-1.5"
6378
6382
  },
6379
6383
  md: {
6380
- trigger: "px-3 py-2.5 text-sm h-11",
6384
+ trigger: "px-3 py-2.5 text-sm h-10",
6381
6385
  dayCell: "w-8 h-8 text-sm",
6382
6386
  monthCell: "w-8 h-8 text-sm",
6383
6387
  navButton: "p-2",
@@ -6394,7 +6398,7 @@ var DateRangePicker = ({ startDate, endDate, onChange, placeholder = "Select dat
6394
6398
  footerMargin: "mt-4 pt-3 gap-2"
6395
6399
  },
6396
6400
  lg: {
6397
- trigger: "px-4 py-3 text-base h-14",
6401
+ trigger: "px-4 py-3 text-base h-12",
6398
6402
  dayCell: "w-10 h-10 text-base",
6399
6403
  monthCell: "w-10 h-10 text-base",
6400
6404
  navButton: "p-2.5",
@@ -7144,6 +7148,7 @@ function MonthYearPicker({
7144
7148
  disabled = false,
7145
7149
  size = "md",
7146
7150
  label,
7151
+ labelClassName,
7147
7152
  required,
7148
7153
  clearable = true,
7149
7154
  variant = "default",
@@ -7455,7 +7460,7 @@ function MonthYearPicker({
7455
7460
  ] });
7456
7461
  if (variant === "inline") {
7457
7462
  return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: cn("w-full", className), ...rest, children: [
7458
- label && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: cn(sz.label, "block mb-1.5 font-medium text-foreground/80"), children: [
7463
+ label && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: cn(sz.label, "block mb-1.5 font-medium text-foreground/80", labelClassName), children: [
7459
7464
  label,
7460
7465
  required && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-destructive ml-0.5", children: "*" })
7461
7466
  ] }),
@@ -7464,7 +7469,7 @@ function MonthYearPicker({
7464
7469
  ] });
7465
7470
  }
7466
7471
  return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: cn("w-full", className), ...rest, children: [
7467
- label && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: cn(sz.label, "block mb-1.5 font-medium text-foreground/80"), children: [
7472
+ label && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: cn(sz.label, "block mb-1.5 font-medium text-foreground/80", labelClassName), children: [
7468
7473
  label,
7469
7474
  required && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-destructive ml-0.5", children: "*" })
7470
7475
  ] }),
@@ -9256,6 +9261,7 @@ var DateTimePicker = ({
9256
9261
  format = "24",
9257
9262
  includeSeconds = false,
9258
9263
  label,
9264
+ labelClassName,
9259
9265
  required,
9260
9266
  doneLabel,
9261
9267
  clearLabel,
@@ -9394,7 +9400,7 @@ var DateTimePicker = ({
9394
9400
  };
9395
9401
  const weekdays = getWeekdays(locale);
9396
9402
  return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: cn("space-y-1.5", className), children: [
9397
- label && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: cn(sizeStyles8[size].label, "font-medium text-foreground flex items-center gap-1"), children: [
9403
+ label && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: cn(sizeStyles8[size].label, "font-medium text-foreground flex items-center gap-1", labelClassName), children: [
9398
9404
  label,
9399
9405
  " ",
9400
9406
  required && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-destructive", children: "*" })
@@ -12237,6 +12243,7 @@ var MultiCombobox = ({
12237
12243
  size = "md",
12238
12244
  variant = "default",
12239
12245
  label,
12246
+ labelClassName,
12240
12247
  title,
12241
12248
  required,
12242
12249
  displayFormat = (option) => option.label,
@@ -12620,7 +12627,8 @@ var MultiCombobox = ({
12620
12627
  className: cn(
12621
12628
  size === "sm" ? "text-xs" : size === "lg" ? "text-base" : "text-sm",
12622
12629
  "font-medium transition-colors duration-200",
12623
- disabled ? "text-muted-foreground" : "text-foreground group-focus-within:text-primary"
12630
+ disabled ? "text-muted-foreground" : "text-foreground group-focus-within:text-primary",
12631
+ labelClassName
12624
12632
  ),
12625
12633
  children: [
12626
12634
  title,
@@ -12636,7 +12644,8 @@ var MultiCombobox = ({
12636
12644
  className: cn(
12637
12645
  labelSize,
12638
12646
  "font-medium transition-colors duration-200",
12639
- disabled ? "text-muted-foreground" : "text-foreground group-focus-within:text-primary"
12647
+ disabled ? "text-muted-foreground" : "text-foreground group-focus-within:text-primary",
12648
+ labelClassName
12640
12649
  ),
12641
12650
  children: [
12642
12651
  label,
@@ -12768,7 +12777,7 @@ var sizeStyles7 = {
12768
12777
  }
12769
12778
  };
12770
12779
  var RadioGroupItem = React35.forwardRef(
12771
- ({ value, id, disabled, className, children, label, description, icon }, ref) => {
12780
+ ({ value, id, disabled, className, children, label, labelClassName, description, icon }, ref) => {
12772
12781
  const { value: selectedValue, onValueChange, name, disabled: groupDisabled, size = "md", variant = "default" } = useRadioGroup();
12773
12782
  const isDisabled = disabled || groupDisabled;
12774
12783
  const isSelected = selectedValue === value;
@@ -12819,7 +12828,7 @@ var RadioGroupItem = React35.forwardRef(
12819
12828
  /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex-1 min-w-0", children: [
12820
12829
  /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center gap-2", children: [
12821
12830
  Icon && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Icon, { className: "h-4 w-4 text-foreground" }),
12822
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("label", { htmlFor: radioId, className: cn("font-medium text-foreground cursor-pointer", sizeStyles7[size].text), children: label || children })
12831
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("label", { htmlFor: radioId, className: cn("font-medium text-foreground cursor-pointer", sizeStyles7[size].text, labelClassName), children: label || children })
12823
12832
  ] }),
12824
12833
  description && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "text-muted-foreground mt-1 text-xs", children: description })
12825
12834
  ] })
@@ -12914,7 +12923,8 @@ var RadioGroupItem = React35.forwardRef(
12914
12923
  "font-medium text-foreground cursor-pointer flex-1",
12915
12924
  "disabled:cursor-not-allowed disabled:opacity-50",
12916
12925
  sizeStyles7[size].text,
12917
- isDisabled && "cursor-not-allowed opacity-50"
12926
+ isDisabled && "cursor-not-allowed opacity-50",
12927
+ labelClassName
12918
12928
  ),
12919
12929
  children: [
12920
12930
  /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex items-center gap-2", children: [
@@ -17385,9 +17395,11 @@ function LineChart({
17385
17395
  curved = true,
17386
17396
  formatValue,
17387
17397
  referenceLines = [],
17398
+ labelClassName,
17388
17399
  className = ""
17389
17400
  }) {
17390
17401
  const svgRef = (0, import_react25.useRef)(null);
17402
+ const clipId = (0, import_react25.useRef)(`line-clip-${Math.random().toString(36).slice(2, 8)}`).current;
17391
17403
  const padding = { top: 20, right: 20, bottom: 40, left: 40 };
17392
17404
  const chartWidth = width - padding.left - padding.right;
17393
17405
  const chartHeight = height - padding.top - padding.bottom;
@@ -17448,42 +17460,56 @@ function LineChart({
17448
17460
  }, [minValue, maxValue, chartHeight, padding.top]);
17449
17461
  return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
17450
17462
  /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("svg", { ref: svgRef, width, height, className: `overflow-visible ${className}`, style: { fontFamily: "inherit" }, children: [
17463
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("clipPath", { id: clipId, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("rect", { x: padding.left, y: padding.top, width: chartWidth, height: chartHeight }) }) }),
17451
17464
  showGrid && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("g", { className: "text-muted-foreground/20", children: gridLines.map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("g", { children: [
17452
17465
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("line", { x1: padding.left, y1: line.y, x2: width - padding.right, y2: line.y, stroke: "currentColor", strokeDasharray: "4 4" }),
17453
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("text", { x: padding.left - 8, y: line.y + 4, textAnchor: "end", fontSize: "10", fill: "currentColor", className: "text-muted-foreground", children: formatValue ? formatValue(line.value) : line.value.toFixed(0) })
17466
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
17467
+ "text",
17468
+ {
17469
+ x: padding.left - 8,
17470
+ y: line.y + 4,
17471
+ textAnchor: "end",
17472
+ fontSize: "10",
17473
+ fill: "currentColor",
17474
+ className: labelClassName || "text-muted-foreground",
17475
+ children: formatValue ? formatValue(line.value) : line.value.toFixed(0)
17476
+ }
17477
+ )
17454
17478
  ] }, i)) }),
17455
- processedSeries.map(
17456
- (s, si) => s.fillColor && s.areaPath && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
17479
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("g", { clipPath: `url(#${clipId})`, children: [
17480
+ processedSeries.map(
17481
+ (s, si) => s.fillColor && s.areaPath && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
17482
+ "path",
17483
+ {
17484
+ d: s.areaPath,
17485
+ fill: s.fillColor,
17486
+ className: "transition-opacity duration-300",
17487
+ opacity: hiddenSeries.has(s.name) ? 0 : 0.15,
17488
+ style: animated ? { opacity: 0, animation: `fadeIn 0.6s ease-out ${si * 0.1}s forwards` } : void 0
17489
+ },
17490
+ `area-${si}`
17491
+ )
17492
+ ),
17493
+ processedSeries.map((s, si) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
17457
17494
  "path",
17458
17495
  {
17459
- d: s.areaPath,
17460
- fill: s.fillColor,
17496
+ d: s.linePath,
17497
+ fill: "none",
17498
+ stroke: s.color,
17499
+ strokeWidth: 2,
17500
+ strokeLinecap: "round",
17501
+ strokeLinejoin: "round",
17461
17502
  className: "transition-opacity duration-300",
17462
- opacity: hiddenSeries.has(s.name) ? 0 : 0.15,
17463
- style: animated ? { opacity: 0, animation: `fadeIn 0.6s ease-out ${si * 0.1}s forwards` } : void 0
17503
+ opacity: hiddenSeries.has(s.name) ? 0 : 1,
17504
+ style: animated ? {
17505
+ strokeDasharray: s.lineLength,
17506
+ strokeDashoffset: s.lineLength,
17507
+ animation: `drawLine 1s ease-out ${si * 0.15}s forwards`
17508
+ } : void 0
17464
17509
  },
17465
- `area-${si}`
17466
- )
17467
- ),
17468
- processedSeries.map((s, si) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
17469
- "path",
17470
- {
17471
- d: s.linePath,
17472
- fill: "none",
17473
- stroke: s.color,
17474
- strokeWidth: 2,
17475
- strokeLinecap: "round",
17476
- strokeLinejoin: "round",
17477
- className: "transition-opacity duration-300",
17478
- opacity: hiddenSeries.has(s.name) ? 0 : 1,
17479
- style: animated ? {
17480
- strokeDasharray: s.lineLength,
17481
- strokeDashoffset: s.lineLength,
17482
- animation: `drawLine 1s ease-out ${si * 0.15}s forwards`
17483
- } : void 0
17484
- },
17485
- `line-${si}`
17486
- )),
17510
+ `line-${si}`
17511
+ ))
17512
+ ] }),
17487
17513
  showDots && processedSeries.map(
17488
17514
  (s, si) => !hiddenSeries.has(s.name) && s.points.map((point, i) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
17489
17515
  "g",
@@ -17569,7 +17595,19 @@ function LineChart({
17569
17595
  ) }),
17570
17596
  showLabels && labels.map((lbl, i) => {
17571
17597
  const x = padding.left + i / (labels.length - 1 || 1) * chartWidth;
17572
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("text", { x, y: height - 10, textAnchor: "middle", fontSize: "10", className: "text-muted-foreground", fill: "currentColor", children: lbl }, i);
17598
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
17599
+ "text",
17600
+ {
17601
+ x,
17602
+ y: height - 10,
17603
+ textAnchor: "middle",
17604
+ fontSize: "10",
17605
+ className: labelClassName || "text-muted-foreground",
17606
+ fill: "currentColor",
17607
+ children: lbl
17608
+ },
17609
+ i
17610
+ );
17573
17611
  }),
17574
17612
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("style", { children: `
17575
17613
  @keyframes drawLine {
@@ -17631,6 +17669,7 @@ function BarChart({
17631
17669
  barRadius = 4,
17632
17670
  barGap = 0.3,
17633
17671
  formatValue,
17672
+ labelClassName,
17634
17673
  className = ""
17635
17674
  }) {
17636
17675
  const svgRef = (0, import_react26.useRef)(null);
@@ -17759,10 +17798,32 @@ function BarChart({
17759
17798
  /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("svg", { ref: svgRef, width, height, className: `overflow-visible ${className}`, style: { fontFamily: "inherit" }, children: [
17760
17799
  showGrid && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("g", { className: "text-muted-foreground/20", children: gridLines.map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("g", { children: horizontal ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
17761
17800
  /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("line", { x1: line.x, y1: line.y1, x2: line.x, y2: line.y2, stroke: "currentColor", strokeDasharray: "4 4" }),
17762
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("text", { x: line.x, y: height - 8, textAnchor: "middle", fontSize: "10", className: "text-muted-foreground", fill: "currentColor", children: formatValue ? formatValue(line.value) : line.value.toFixed(0) })
17801
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
17802
+ "text",
17803
+ {
17804
+ x: line.x,
17805
+ y: height - 8,
17806
+ textAnchor: "middle",
17807
+ fontSize: "10",
17808
+ className: labelClassName || "text-muted-foreground",
17809
+ fill: "currentColor",
17810
+ children: formatValue ? formatValue(line.value) : line.value.toFixed(0)
17811
+ }
17812
+ )
17763
17813
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
17764
17814
  /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("line", { x1: line.x1, y1: line.y, x2: line.x2, y2: line.y, stroke: "currentColor", strokeDasharray: "4 4" }),
17765
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("text", { x: padding.left - 8, y: line.y + 4, textAnchor: "end", fontSize: "10", className: "text-muted-foreground", fill: "currentColor", children: formatValue ? formatValue(line.value) : line.value.toFixed(0) })
17815
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
17816
+ "text",
17817
+ {
17818
+ x: padding.left - 8,
17819
+ y: line.y + 4,
17820
+ textAnchor: "end",
17821
+ fontSize: "10",
17822
+ className: labelClassName || "text-muted-foreground",
17823
+ fill: "currentColor",
17824
+ children: formatValue ? formatValue(line.value) : line.value.toFixed(0)
17825
+ }
17826
+ )
17766
17827
  ] }) }, i)) }),
17767
17828
  barGroups.map((group, gi) => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("g", { children: [
17768
17829
  group.bars.map((bar, bi) => {
@@ -17838,7 +17899,7 @@ function BarChart({
17838
17899
  y: horizontal ? padding.top + (gi + 0.5) * (chartHeight / barGroups.length) + 4 : height - 10,
17839
17900
  textAnchor: horizontal ? "end" : "middle",
17840
17901
  fontSize: "10",
17841
- className: "text-muted-foreground",
17902
+ className: labelClassName || "text-muted-foreground",
17842
17903
  fill: "currentColor",
17843
17904
  children: group.label
17844
17905
  }
@@ -17892,6 +17953,7 @@ function PieChart({
17892
17953
  startAngle = -90,
17893
17954
  renderCenter,
17894
17955
  formatValue,
17956
+ labelClassName,
17895
17957
  className = ""
17896
17958
  }) {
17897
17959
  const containerRef = (0, import_react27.useRef)(null);
@@ -17984,7 +18046,7 @@ function PieChart({
17984
18046
  y: seg.labelY,
17985
18047
  textAnchor: seg.labelX > center ? "start" : "end",
17986
18048
  fontSize: "10",
17987
- className: "text-foreground",
18049
+ className: labelClassName || "text-foreground",
17988
18050
  fill: "currentColor",
17989
18051
  style: animated ? { opacity: 0, animation: `fadeIn 0.3s ease-out ${i * 0.1 + 0.3}s forwards` } : void 0,
17990
18052
  children: showPercentage ? `${(seg.percentage * 100).toFixed(0)}%` : formatValue ? formatValue(seg.value) : seg.value
@@ -18060,9 +18122,11 @@ function AreaChart({
18060
18122
  curved = true,
18061
18123
  formatValue,
18062
18124
  emptyText = "No data",
18125
+ labelClassName,
18063
18126
  className = ""
18064
18127
  }) {
18065
18128
  const containerRef = (0, import_react28.useRef)(null);
18129
+ const clipId = (0, import_react28.useRef)(`area-clip-${Math.random().toString(36).slice(2, 8)}`).current;
18066
18130
  const padding = { top: 20, right: 20, bottom: 40, left: 50 };
18067
18131
  const chartWidth = width - padding.left - padding.right;
18068
18132
  const chartHeight = height - padding.top - padding.bottom;
@@ -18146,11 +18210,23 @@ function AreaChart({
18146
18210
  }, [series, chartWidth, chartHeight, padding, stacked, curved]);
18147
18211
  return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { ref: containerRef, className: `relative flex flex-col gap-4 ${className}`, children: [
18148
18212
  /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("svg", { width, height, className: "overflow-visible", style: { fontFamily: "inherit" }, children: [
18213
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("clipPath", { id: clipId, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("rect", { x: padding.left, y: padding.top, width: chartWidth, height: chartHeight }) }) }),
18149
18214
  showGrid && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("g", { className: "text-muted-foreground/20", children: gridLines.map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("g", { children: [
18150
18215
  /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("line", { x1: padding.left, y1: line.y, x2: width - padding.right, y2: line.y, stroke: "currentColor", strokeDasharray: "4 4" }),
18151
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("text", { x: padding.left - 8, y: line.y + 4, textAnchor: "end", fontSize: "10", className: "text-muted-foreground", fill: "currentColor", children: formatValue ? formatValue(line.value) : line.value.toFixed(0) })
18216
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
18217
+ "text",
18218
+ {
18219
+ x: padding.left - 8,
18220
+ y: line.y + 4,
18221
+ textAnchor: "end",
18222
+ fontSize: "10",
18223
+ className: labelClassName || "text-muted-foreground",
18224
+ fill: "currentColor",
18225
+ children: formatValue ? formatValue(line.value) : line.value.toFixed(0)
18226
+ }
18227
+ )
18152
18228
  ] }, i)) }),
18153
- [...processedSeries].reverse().map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
18229
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("g", { clipPath: `url(#${clipId})`, children: [...processedSeries].reverse().map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
18154
18230
  "path",
18155
18231
  {
18156
18232
  d: s.areaPath,
@@ -18163,8 +18239,8 @@ function AreaChart({
18163
18239
  } : void 0
18164
18240
  },
18165
18241
  `area-${i}`
18166
- )),
18167
- processedSeries.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
18242
+ )) }),
18243
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("g", { clipPath: `url(#${clipId})`, children: processedSeries.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
18168
18244
  "path",
18169
18245
  {
18170
18246
  d: s.linePath,
@@ -18182,7 +18258,7 @@ function AreaChart({
18182
18258
  } : void 0
18183
18259
  },
18184
18260
  `line-${i}`
18185
- )),
18261
+ )) }),
18186
18262
  showDots && processedSeries.map(
18187
18263
  (s, seriesIdx) => !hiddenSeries.has(s.name) && s.points.map((point, i) => /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
18188
18264
  "g",
@@ -18225,7 +18301,7 @@ function AreaChart({
18225
18301
  `dot-${seriesIdx}-${i}`
18226
18302
  ))
18227
18303
  ),
18228
- showLabels && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("g", { className: "text-muted-foreground", children: labels.map((label, i) => {
18304
+ showLabels && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("g", { className: labelClassName || "text-muted-foreground", children: labels.map((label, i) => {
18229
18305
  const x = padding.left + i / (labels.length - 1) * chartWidth;
18230
18306
  return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("text", { x, y: height - 10, textAnchor: "middle", fontSize: "10", fill: "currentColor", children: label }, i);
18231
18307
  }) }),
@@ -18433,6 +18509,7 @@ function RadarChart({
18433
18509
  showValues = false,
18434
18510
  animated = true,
18435
18511
  formatValue,
18512
+ labelClassName,
18436
18513
  className = ""
18437
18514
  }) {
18438
18515
  const containerRef = (0, import_react30.useRef)(null);
@@ -18579,7 +18656,7 @@ function RadarChart({
18579
18656
  ))
18580
18657
  ] }, i)
18581
18658
  ),
18582
- showLabels && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("g", { className: "text-muted-foreground", children: axes.map((axis, i) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("text", { x: axis.labelX, y: axis.labelY, textAnchor: "middle", dominantBaseline: "middle", fontSize: "11", fill: "currentColor", children: axis.label }, i)) }),
18659
+ showLabels && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("g", { className: labelClassName || "text-muted-foreground", children: axes.map((axis, i) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("text", { x: axis.labelX, y: axis.labelY, textAnchor: "middle", dominantBaseline: "middle", fontSize: "11", fill: "currentColor", children: axis.label }, i)) }),
18583
18660
  /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("style", { children: `
18584
18661
  @keyframes radarPop {
18585
18662
  from {
@@ -18659,6 +18736,7 @@ function GaugeChart({
18659
18736
  endAngle = 135,
18660
18737
  zones,
18661
18738
  formatValue,
18739
+ labelClassName,
18662
18740
  className = ""
18663
18741
  }) {
18664
18742
  const center = size / 2;
@@ -18745,7 +18823,7 @@ function GaugeChart({
18745
18823
  ]
18746
18824
  }
18747
18825
  ),
18748
- showMinMax && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("g", { className: "text-muted-foreground", children: [
18826
+ showMinMax && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("g", { className: labelClassName || "text-muted-foreground", children: [
18749
18827
  /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
18750
18828
  "text",
18751
18829
  {