@underverse-ui/underverse 1.0.15 → 1.0.16

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
@@ -17388,6 +17388,7 @@ function LineChart({
17388
17388
  className = ""
17389
17389
  }) {
17390
17390
  const svgRef = (0, import_react25.useRef)(null);
17391
+ const clipId = (0, import_react25.useRef)(`line-clip-${Math.random().toString(36).slice(2, 8)}`).current;
17391
17392
  const padding = { top: 20, right: 20, bottom: 40, left: 40 };
17392
17393
  const chartWidth = width - padding.left - padding.right;
17393
17394
  const chartHeight = height - padding.top - padding.bottom;
@@ -17448,42 +17449,45 @@ function LineChart({
17448
17449
  }, [minValue, maxValue, chartHeight, padding.top]);
17449
17450
  return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
17450
17451
  /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("svg", { ref: svgRef, width, height, className: `overflow-visible ${className}`, style: { fontFamily: "inherit" }, children: [
17452
+ /* @__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
17453
  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
17454
  /* @__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
17455
  /* @__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) })
17454
17456
  ] }, i)) }),
17455
- processedSeries.map(
17456
- (s, si) => s.fillColor && s.areaPath && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
17457
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("g", { clipPath: `url(#${clipId})`, children: [
17458
+ processedSeries.map(
17459
+ (s, si) => s.fillColor && s.areaPath && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
17460
+ "path",
17461
+ {
17462
+ d: s.areaPath,
17463
+ fill: s.fillColor,
17464
+ className: "transition-opacity duration-300",
17465
+ opacity: hiddenSeries.has(s.name) ? 0 : 0.15,
17466
+ style: animated ? { opacity: 0, animation: `fadeIn 0.6s ease-out ${si * 0.1}s forwards` } : void 0
17467
+ },
17468
+ `area-${si}`
17469
+ )
17470
+ ),
17471
+ processedSeries.map((s, si) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
17457
17472
  "path",
17458
17473
  {
17459
- d: s.areaPath,
17460
- fill: s.fillColor,
17474
+ d: s.linePath,
17475
+ fill: "none",
17476
+ stroke: s.color,
17477
+ strokeWidth: 2,
17478
+ strokeLinecap: "round",
17479
+ strokeLinejoin: "round",
17461
17480
  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
17481
+ opacity: hiddenSeries.has(s.name) ? 0 : 1,
17482
+ style: animated ? {
17483
+ strokeDasharray: s.lineLength,
17484
+ strokeDashoffset: s.lineLength,
17485
+ animation: `drawLine 1s ease-out ${si * 0.15}s forwards`
17486
+ } : void 0
17464
17487
  },
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
- )),
17488
+ `line-${si}`
17489
+ ))
17490
+ ] }),
17487
17491
  showDots && processedSeries.map(
17488
17492
  (s, si) => !hiddenSeries.has(s.name) && s.points.map((point, i) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
17489
17493
  "g",
@@ -18063,6 +18067,7 @@ function AreaChart({
18063
18067
  className = ""
18064
18068
  }) {
18065
18069
  const containerRef = (0, import_react28.useRef)(null);
18070
+ const clipId = (0, import_react28.useRef)(`area-clip-${Math.random().toString(36).slice(2, 8)}`).current;
18066
18071
  const padding = { top: 20, right: 20, bottom: 40, left: 50 };
18067
18072
  const chartWidth = width - padding.left - padding.right;
18068
18073
  const chartHeight = height - padding.top - padding.bottom;
@@ -18146,11 +18151,12 @@ function AreaChart({
18146
18151
  }, [series, chartWidth, chartHeight, padding, stacked, curved]);
18147
18152
  return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { ref: containerRef, className: `relative flex flex-col gap-4 ${className}`, children: [
18148
18153
  /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("svg", { width, height, className: "overflow-visible", style: { fontFamily: "inherit" }, children: [
18154
+ /* @__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
18155
  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
18156
  /* @__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
18157
  /* @__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) })
18152
18158
  ] }, i)) }),
18153
- [...processedSeries].reverse().map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
18159
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("g", { clipPath: `url(#${clipId})`, children: [...processedSeries].reverse().map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
18154
18160
  "path",
18155
18161
  {
18156
18162
  d: s.areaPath,
@@ -18163,8 +18169,8 @@ function AreaChart({
18163
18169
  } : void 0
18164
18170
  },
18165
18171
  `area-${i}`
18166
- )),
18167
- processedSeries.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
18172
+ )) }),
18173
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("g", { clipPath: `url(#${clipId})`, children: processedSeries.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
18168
18174
  "path",
18169
18175
  {
18170
18176
  d: s.linePath,
@@ -18182,7 +18188,7 @@ function AreaChart({
18182
18188
  } : void 0
18183
18189
  },
18184
18190
  `line-${i}`
18185
- )),
18191
+ )) }),
18186
18192
  showDots && processedSeries.map(
18187
18193
  (s, seriesIdx) => !hiddenSeries.has(s.name) && s.points.map((point, i) => /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
18188
18194
  "g",