@karakuri-ui/react 0.3.3 → 0.3.5

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.
Files changed (149) hide show
  1. package/README.md +27 -4
  2. package/dist/components/ui/accordion.js +27 -24
  3. package/dist/components/ui/accordion.js.map +1 -1
  4. package/dist/components/ui/accordion.mjs +28 -25
  5. package/dist/components/ui/accordion.mjs.map +1 -1
  6. package/dist/components/ui/alert.js +45 -27
  7. package/dist/components/ui/alert.js.map +1 -1
  8. package/dist/components/ui/alert.mjs +46 -28
  9. package/dist/components/ui/alert.mjs.map +1 -1
  10. package/dist/components/ui/avatar.js +41 -32
  11. package/dist/components/ui/avatar.js.map +1 -1
  12. package/dist/components/ui/avatar.mjs +42 -33
  13. package/dist/components/ui/avatar.mjs.map +1 -1
  14. package/dist/components/ui/badge.js +46 -43
  15. package/dist/components/ui/badge.js.map +1 -1
  16. package/dist/components/ui/badge.mjs +47 -44
  17. package/dist/components/ui/badge.mjs.map +1 -1
  18. package/dist/components/ui/breadcrumb.js +30 -25
  19. package/dist/components/ui/breadcrumb.js.map +1 -1
  20. package/dist/components/ui/breadcrumb.mjs +31 -26
  21. package/dist/components/ui/breadcrumb.mjs.map +1 -1
  22. package/dist/components/ui/button-group.js +6 -5
  23. package/dist/components/ui/button-group.js.map +1 -1
  24. package/dist/components/ui/button-group.mjs +7 -6
  25. package/dist/components/ui/button-group.mjs.map +1 -1
  26. package/dist/components/ui/button.js +24 -14
  27. package/dist/components/ui/button.js.map +1 -1
  28. package/dist/components/ui/button.mjs +26 -16
  29. package/dist/components/ui/button.mjs.map +1 -1
  30. package/dist/components/ui/card.js +53 -39
  31. package/dist/components/ui/card.js.map +1 -1
  32. package/dist/components/ui/card.mjs +54 -40
  33. package/dist/components/ui/card.mjs.map +1 -1
  34. package/dist/components/ui/chart.d.mts +1 -1
  35. package/dist/components/ui/chart.d.ts +1 -1
  36. package/dist/components/ui/chart.js +154 -130
  37. package/dist/components/ui/chart.js.map +1 -1
  38. package/dist/components/ui/chart.mjs +155 -131
  39. package/dist/components/ui/chart.mjs.map +1 -1
  40. package/dist/components/ui/checkbox.js +47 -40
  41. package/dist/components/ui/checkbox.js.map +1 -1
  42. package/dist/components/ui/checkbox.mjs +49 -42
  43. package/dist/components/ui/checkbox.mjs.map +1 -1
  44. package/dist/components/ui/divider.js +16 -13
  45. package/dist/components/ui/divider.js.map +1 -1
  46. package/dist/components/ui/divider.mjs +17 -14
  47. package/dist/components/ui/divider.mjs.map +1 -1
  48. package/dist/components/ui/drawer.js +44 -35
  49. package/dist/components/ui/drawer.js.map +1 -1
  50. package/dist/components/ui/drawer.mjs +45 -36
  51. package/dist/components/ui/drawer.mjs.map +1 -1
  52. package/dist/components/ui/dropdown.js +31 -24
  53. package/dist/components/ui/dropdown.js.map +1 -1
  54. package/dist/components/ui/dropdown.mjs +32 -25
  55. package/dist/components/ui/dropdown.mjs.map +1 -1
  56. package/dist/components/ui/field.js +18 -15
  57. package/dist/components/ui/field.js.map +1 -1
  58. package/dist/components/ui/field.mjs +19 -16
  59. package/dist/components/ui/field.mjs.map +1 -1
  60. package/dist/components/ui/icon-button.js +17 -14
  61. package/dist/components/ui/icon-button.js.map +1 -1
  62. package/dist/components/ui/icon-button.mjs +19 -16
  63. package/dist/components/ui/icon-button.mjs.map +1 -1
  64. package/dist/components/ui/index.mjs +35 -35
  65. package/dist/components/ui/input.js +34 -29
  66. package/dist/components/ui/input.js.map +1 -1
  67. package/dist/components/ui/input.mjs +36 -31
  68. package/dist/components/ui/input.mjs.map +1 -1
  69. package/dist/components/ui/metric-card.js +24 -21
  70. package/dist/components/ui/metric-card.js.map +1 -1
  71. package/dist/components/ui/metric-card.mjs +25 -22
  72. package/dist/components/ui/metric-card.mjs.map +1 -1
  73. package/dist/components/ui/modal.js +91 -74
  74. package/dist/components/ui/modal.js.map +1 -1
  75. package/dist/components/ui/modal.mjs +92 -75
  76. package/dist/components/ui/modal.mjs.map +1 -1
  77. package/dist/components/ui/navigation-menu.js +114 -93
  78. package/dist/components/ui/navigation-menu.js.map +1 -1
  79. package/dist/components/ui/navigation-menu.mjs +115 -94
  80. package/dist/components/ui/navigation-menu.mjs.map +1 -1
  81. package/dist/components/ui/pagination.js +66 -55
  82. package/dist/components/ui/pagination.js.map +1 -1
  83. package/dist/components/ui/pagination.mjs +67 -56
  84. package/dist/components/ui/pagination.mjs.map +1 -1
  85. package/dist/components/ui/popover.js +39 -36
  86. package/dist/components/ui/popover.js.map +1 -1
  87. package/dist/components/ui/popover.mjs +40 -37
  88. package/dist/components/ui/popover.mjs.map +1 -1
  89. package/dist/components/ui/progress.js +73 -64
  90. package/dist/components/ui/progress.js.map +1 -1
  91. package/dist/components/ui/progress.mjs +74 -65
  92. package/dist/components/ui/progress.mjs.map +1 -1
  93. package/dist/components/ui/radio-group.js +23 -19
  94. package/dist/components/ui/radio-group.js.map +1 -1
  95. package/dist/components/ui/radio-group.mjs +25 -21
  96. package/dist/components/ui/radio-group.mjs.map +1 -1
  97. package/dist/components/ui/segmented.js +7 -6
  98. package/dist/components/ui/segmented.js.map +1 -1
  99. package/dist/components/ui/segmented.mjs +8 -7
  100. package/dist/components/ui/segmented.mjs.map +1 -1
  101. package/dist/components/ui/select.js +55 -48
  102. package/dist/components/ui/select.js.map +1 -1
  103. package/dist/components/ui/select.mjs +56 -49
  104. package/dist/components/ui/select.mjs.map +1 -1
  105. package/dist/components/ui/skeleton.js +20 -19
  106. package/dist/components/ui/skeleton.js.map +1 -1
  107. package/dist/components/ui/skeleton.mjs +21 -20
  108. package/dist/components/ui/skeleton.mjs.map +1 -1
  109. package/dist/components/ui/slider.js +68 -58
  110. package/dist/components/ui/slider.js.map +1 -1
  111. package/dist/components/ui/slider.mjs +69 -59
  112. package/dist/components/ui/slider.mjs.map +1 -1
  113. package/dist/components/ui/spinner.js +185 -176
  114. package/dist/components/ui/spinner.js.map +1 -1
  115. package/dist/components/ui/spinner.mjs +186 -177
  116. package/dist/components/ui/spinner.mjs.map +1 -1
  117. package/dist/components/ui/switch.js +39 -28
  118. package/dist/components/ui/switch.js.map +1 -1
  119. package/dist/components/ui/switch.mjs +41 -30
  120. package/dist/components/ui/switch.mjs.map +1 -1
  121. package/dist/components/ui/table.js +26 -23
  122. package/dist/components/ui/table.js.map +1 -1
  123. package/dist/components/ui/table.mjs +27 -24
  124. package/dist/components/ui/table.mjs.map +1 -1
  125. package/dist/components/ui/tabs.js +25 -9
  126. package/dist/components/ui/tabs.js.map +1 -1
  127. package/dist/components/ui/tabs.mjs +26 -10
  128. package/dist/components/ui/tabs.mjs.map +1 -1
  129. package/dist/components/ui/textarea.js +2 -1
  130. package/dist/components/ui/textarea.js.map +1 -1
  131. package/dist/components/ui/textarea.mjs +4 -3
  132. package/dist/components/ui/textarea.mjs.map +1 -1
  133. package/dist/components/ui/toast.js +104 -80
  134. package/dist/components/ui/toast.js.map +1 -1
  135. package/dist/components/ui/toast.mjs +105 -81
  136. package/dist/components/ui/toast.mjs.map +1 -1
  137. package/dist/components/ui/toggle-group.js +9 -8
  138. package/dist/components/ui/toggle-group.js.map +1 -1
  139. package/dist/components/ui/toggle-group.mjs +10 -9
  140. package/dist/components/ui/toggle-group.mjs.map +1 -1
  141. package/dist/components/ui/toggle.js +3 -2
  142. package/dist/components/ui/toggle.js.map +1 -1
  143. package/dist/components/ui/toggle.mjs +4 -3
  144. package/dist/components/ui/toggle.mjs.map +1 -1
  145. package/dist/components/ui/tooltip.js +18 -15
  146. package/dist/components/ui/tooltip.js.map +1 -1
  147. package/dist/components/ui/tooltip.mjs +19 -16
  148. package/dist/components/ui/tooltip.mjs.map +1 -1
  149. package/package.json +27 -19
@@ -1,7 +1,8 @@
1
1
  "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
3
  import * as React from "react";
3
4
  import * as RechartsPrimitive from "recharts";
4
- import { cn } from "../../lib/utils";
5
+ import { cn } from "../../lib/utils.mjs";
5
6
  const THEMES = { light: "", dark: ".dark" };
6
7
  const ChartContext = React.createContext(null);
7
8
  function useChart() {
@@ -23,7 +24,7 @@ function Chart({
23
24
  const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
24
25
  const [activeIndex, setActiveIndex] = React.useState(null);
25
26
  const [activeDataKey, setActiveDataKey] = React.useState(null);
26
- return /* @__PURE__ */ React.createElement(ChartContext.Provider, { value: { config, hoverFade, activeIndex, setActiveIndex, activeDataKey, setActiveDataKey } }, /* @__PURE__ */ React.createElement(
27
+ return /* @__PURE__ */ jsx(ChartContext.Provider, { value: { config, hoverFade, activeIndex, setActiveIndex, activeDataKey, setActiveDataKey }, children: /* @__PURE__ */ jsxs(
27
28
  "div",
28
29
  {
29
30
  "data-slot": "chart",
@@ -52,11 +53,13 @@ function Chart({
52
53
  "[&_.recharts-surface]:outline-none",
53
54
  className
54
55
  ),
55
- ...props
56
- },
57
- /* @__PURE__ */ React.createElement(ChartStyle, { id: chartId, config }),
58
- /* @__PURE__ */ React.createElement(RechartsPrimitive.ResponsiveContainer, null, children)
59
- ));
56
+ ...props,
57
+ children: [
58
+ /* @__PURE__ */ jsx(ChartStyle, { id: chartId, config }),
59
+ /* @__PURE__ */ jsx(RechartsPrimitive.ResponsiveContainer, { children })
60
+ ]
61
+ }
62
+ ) });
60
63
  }
61
64
  const CHART_TOOLTIP_KEYFRAME = "@keyframes chart-tooltip-in{from{opacity:0}to{opacity:1}}";
62
65
  const ChartStyle = ({ id, config }) => {
@@ -73,7 +76,7 @@ ${colorConfig.map(([key, itemConfig]) => {
73
76
  }
74
77
  `
75
78
  ).join("\n") : "";
76
- return /* @__PURE__ */ React.createElement(
79
+ return /* @__PURE__ */ jsx(
77
80
  "style",
78
81
  {
79
82
  dangerouslySetInnerHTML: {
@@ -114,12 +117,12 @@ function ChartBar({
114
117
  const y = shapeProps.y ?? 0;
115
118
  const width = shapeProps.width ?? 0;
116
119
  const height = shapeProps.height ?? 0;
117
- if (!width || !height || width <= 0 || height <= 0) return /* @__PURE__ */ React.createElement("g", null);
120
+ if (!width || !height || width <= 0 || height <= 0) return /* @__PURE__ */ jsx("g", {});
118
121
  const sw = 2;
119
122
  const inset = sw / 2;
120
123
  const rx = typeof appliedRadius === "number" ? Math.max(0, appliedRadius - inset) : 0;
121
124
  const fadeMultiplier = hoverFade && activeIndex !== null && shapeProps.index !== activeIndex ? CHART_HOVER_FADE_OPACITY : 1;
122
- return /* @__PURE__ */ React.createElement(
125
+ return /* @__PURE__ */ jsx(
123
126
  "rect",
124
127
  {
125
128
  x: x + inset,
@@ -138,7 +141,7 @@ function ChartBar({
138
141
  }, [appliedRadius, fill, hoverFade, activeIndex]);
139
142
  const solidHoverShape = React.useCallback((shapeProps) => {
140
143
  const opacity = activeIndex === null ? 1 : shapeProps.index === activeIndex ? 1 : CHART_HOVER_FADE_OPACITY;
141
- return /* @__PURE__ */ React.createElement(
144
+ return /* @__PURE__ */ jsx(
142
145
  RechartsPrimitive.Rectangle,
143
146
  {
144
147
  ...shapeProps,
@@ -149,7 +152,7 @@ function ChartBar({
149
152
  }, [activeIndex]);
150
153
  const useOutline = variant === "outline" && !isStacked;
151
154
  const needsHoverShape = hoverFade && variant === "solid" && !useOutline;
152
- return /* @__PURE__ */ React.createElement(
155
+ return /* @__PURE__ */ jsx(
153
156
  RechartsPrimitive.Bar,
154
157
  {
155
158
  radius: appliedRadius,
@@ -164,7 +167,7 @@ function ChartBar({
164
167
  );
165
168
  }
166
169
  function ChartTooltip(props) {
167
- return /* @__PURE__ */ React.createElement(RechartsPrimitive.Tooltip, { animationDuration: 0, ...props });
170
+ return /* @__PURE__ */ jsx(RechartsPrimitive.Tooltip, { animationDuration: 0, ...props });
168
171
  }
169
172
  function ChartTooltipContent({
170
173
  active,
@@ -191,70 +194,80 @@ function ChartTooltipContent({
191
194
  const itemConfig = getPayloadConfigFromPayload(config, item, key);
192
195
  const value = !labelKey && typeof label === "string" ? config[label]?.label || label : itemConfig?.label;
193
196
  if (labelFormatter) {
194
- return /* @__PURE__ */ React.createElement("div", { className: cn("font-semibold", labelClassName) }, labelFormatter(value, payload));
197
+ return /* @__PURE__ */ jsx("div", { className: cn("font-semibold", labelClassName), children: labelFormatter(value, payload) });
195
198
  }
196
199
  if (!value) {
197
200
  return null;
198
201
  }
199
- return /* @__PURE__ */ React.createElement("div", { className: cn("font-semibold", labelClassName) }, value);
202
+ return /* @__PURE__ */ jsx("div", { className: cn("font-semibold", labelClassName), children: value });
200
203
  }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);
201
204
  if (!active || !payload?.length) {
202
205
  return null;
203
206
  }
204
207
  const nestLabel = payload.length === 1 && indicator !== "dot";
205
- return /* @__PURE__ */ React.createElement(
208
+ return /* @__PURE__ */ jsxs(
206
209
  "div",
207
210
  {
208
211
  className: cn(
209
212
  "grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border bg-background px-2.5 py-1.5 text-xs shadow-xl",
210
213
  className
211
214
  ),
212
- style: { animation: "chart-tooltip-in var(--duration-slow) ease-out" }
213
- },
214
- !nestLabel ? tooltipLabel : null,
215
- /* @__PURE__ */ React.createElement("div", { className: "grid gap-1.5" }, payload.filter((item) => item.type !== "none").map((item, index) => {
216
- const key = `${nameKey || item.name || item.dataKey || "value"}`;
217
- const itemConfig = getPayloadConfigFromPayload(config, item, key);
218
- const indicatorColor = color || item.payload?.fill || item.color;
219
- return /* @__PURE__ */ React.createElement(
220
- "div",
221
- {
222
- key: item.dataKey,
223
- className: cn(
224
- "flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-text-muted",
225
- indicator === "dot" && "items-center"
226
- )
227
- },
228
- formatter && item?.value !== void 0 && item.name ? formatter(item.value, item.name, item, index, item.payload) : /* @__PURE__ */ React.createElement(React.Fragment, null, itemConfig?.icon ? /* @__PURE__ */ React.createElement(itemConfig.icon, null) : !hideIndicator && /* @__PURE__ */ React.createElement(
229
- "div",
230
- {
231
- className: cn(
232
- "shrink-0 rounded-sm",
233
- {
234
- "h-2.5 w-2.5": indicator === "dot",
235
- "w-1": indicator === "line",
236
- "w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
237
- "my-0.5": nestLabel && indicator === "dashed"
238
- }
239
- ),
240
- style: {
241
- backgroundColor: indicator === "dashed" ? "transparent" : indicatorColor,
242
- borderColor: indicatorColor
243
- }
244
- }
245
- ), /* @__PURE__ */ React.createElement(
246
- "div",
247
- {
248
- className: cn(
249
- "flex flex-1 justify-between leading-none",
250
- nestLabel ? "items-end" : "items-center"
251
- )
252
- },
253
- /* @__PURE__ */ React.createElement("div", { className: "grid gap-1.5" }, nestLabel ? tooltipLabel : null, /* @__PURE__ */ React.createElement("span", { className: "text-text-muted" }, itemConfig?.label || item.name)),
254
- item.value && /* @__PURE__ */ React.createElement("span", { className: "font-mono font-semibold text-foreground tabular-nums" }, item.value.toLocaleString())
255
- ))
256
- );
257
- }))
215
+ style: { animation: "chart-tooltip-in var(--duration-slow) ease-out" },
216
+ children: [
217
+ !nestLabel ? tooltipLabel : null,
218
+ /* @__PURE__ */ jsx("div", { className: "grid gap-1.5", children: payload.filter((item) => item.type !== "none").map((item, index) => {
219
+ const key = `${nameKey || item.name || item.dataKey || "value"}`;
220
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
221
+ const indicatorColor = color || item.payload?.fill || item.color;
222
+ return /* @__PURE__ */ jsx(
223
+ "div",
224
+ {
225
+ className: cn(
226
+ "flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-text-muted",
227
+ indicator === "dot" && "items-center"
228
+ ),
229
+ children: formatter && item?.value !== void 0 && item.name ? formatter(item.value, item.name, item, index, item.payload) : /* @__PURE__ */ jsxs(Fragment, { children: [
230
+ itemConfig?.icon ? /* @__PURE__ */ jsx(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ jsx(
231
+ "div",
232
+ {
233
+ className: cn(
234
+ "shrink-0 rounded-sm",
235
+ {
236
+ "h-2.5 w-2.5": indicator === "dot",
237
+ "w-1": indicator === "line",
238
+ "w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
239
+ "my-0.5": nestLabel && indicator === "dashed"
240
+ }
241
+ ),
242
+ style: {
243
+ backgroundColor: indicator === "dashed" ? "transparent" : indicatorColor,
244
+ borderColor: indicatorColor
245
+ }
246
+ }
247
+ ),
248
+ /* @__PURE__ */ jsxs(
249
+ "div",
250
+ {
251
+ className: cn(
252
+ "flex flex-1 justify-between gap-4 leading-none",
253
+ nestLabel ? "items-end" : "items-center"
254
+ ),
255
+ children: [
256
+ /* @__PURE__ */ jsxs("div", { className: "grid gap-1.5", children: [
257
+ nestLabel ? tooltipLabel : null,
258
+ /* @__PURE__ */ jsx("span", { className: "text-text-muted", children: itemConfig?.label || item.name })
259
+ ] }),
260
+ item.value && /* @__PURE__ */ jsx("span", { className: "font-mono font-semibold text-foreground tabular-nums", children: item.value.toLocaleString() })
261
+ ]
262
+ }
263
+ )
264
+ ] })
265
+ },
266
+ item.dataKey
267
+ );
268
+ }) })
269
+ ]
270
+ }
258
271
  );
259
272
  }
260
273
  const ChartLegend = RechartsPrimitive.Legend;
@@ -272,7 +285,7 @@ function ChartLegendContent({
272
285
  return null;
273
286
  }
274
287
  const isVertical = layout === "vertical";
275
- return /* @__PURE__ */ React.createElement(
288
+ return /* @__PURE__ */ jsx(
276
289
  "div",
277
290
  {
278
291
  className: cn(
@@ -283,29 +296,31 @@ function ChartLegendContent({
283
296
  verticalAlign === "top" ? "pb-3" : "pt-3"
284
297
  ],
285
298
  className
286
- )
287
- },
288
- payload.filter((item) => item.type !== "none").map((item) => {
289
- const key = `${nameKey || item.dataKey || "value"}`;
290
- const itemConfig = getPayloadConfigFromPayload(config, item, key);
291
- return /* @__PURE__ */ React.createElement(
292
- "div",
293
- {
294
- key: item.value,
295
- className: "flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-text-muted"
296
- },
297
- itemConfig?.icon && !hideIcon ? /* @__PURE__ */ React.createElement(itemConfig.icon, null) : /* @__PURE__ */ React.createElement(
299
+ ),
300
+ children: payload.filter((item) => item.type !== "none").map((item) => {
301
+ const key = `${nameKey || item.dataKey || "value"}`;
302
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
303
+ return /* @__PURE__ */ jsxs(
298
304
  "div",
299
305
  {
300
- className: "h-2 w-2 shrink-0 rounded-sm",
301
- style: {
302
- backgroundColor: item.color
303
- }
304
- }
305
- ),
306
- /* @__PURE__ */ React.createElement("span", { className: "text-foreground" }, itemConfig?.label)
307
- );
308
- })
306
+ className: "flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-text-muted",
307
+ children: [
308
+ itemConfig?.icon && !hideIcon ? /* @__PURE__ */ jsx(itemConfig.icon, {}) : /* @__PURE__ */ jsx(
309
+ "div",
310
+ {
311
+ className: "h-2 w-2 shrink-0 rounded-sm",
312
+ style: {
313
+ backgroundColor: item.color
314
+ }
315
+ }
316
+ ),
317
+ /* @__PURE__ */ jsx("span", { className: "text-foreground", children: itemConfig?.label })
318
+ ]
319
+ },
320
+ item.value
321
+ );
322
+ })
323
+ }
309
324
  );
310
325
  }
311
326
  function getPayloadConfigFromPayload(config, payload, key) {
@@ -324,10 +339,10 @@ function getPayloadConfigFromPayload(config, payload, key) {
324
339
  const CHART_AXIS_TICK_STYLE = { style: { fontSize: "var(--chart-axis-fs)", fill: "var(--color-text-subtle)" } };
325
340
  const CHART_XAXIS_PADDING = { left: 16, right: 16 };
326
341
  function ChartXAxis({ tick, padding, ...props }) {
327
- return /* @__PURE__ */ React.createElement(RechartsPrimitive.XAxis, { tick: tick ?? CHART_AXIS_TICK_STYLE, padding: padding ?? CHART_XAXIS_PADDING, ...props });
342
+ return /* @__PURE__ */ jsx(RechartsPrimitive.XAxis, { tick: tick ?? CHART_AXIS_TICK_STYLE, padding: padding ?? CHART_XAXIS_PADDING, ...props });
328
343
  }
329
344
  function ChartYAxis({ tick, width = "auto", ...props }) {
330
- return /* @__PURE__ */ React.createElement(RechartsPrimitive.YAxis, { tick: tick ?? CHART_AXIS_TICK_STYLE, width, ...props });
345
+ return /* @__PURE__ */ jsx(RechartsPrimitive.YAxis, { tick: tick ?? CHART_AXIS_TICK_STYLE, width, ...props });
331
346
  }
332
347
  const CHART_LINE_DASH = "5 5";
333
348
  const CHART_DOT_PROPS = { r: 3, strokeWidth: 2 };
@@ -346,7 +361,7 @@ function ChartLine({
346
361
  const opacity = isFaded ? CHART_HOVER_FADE_OPACITY : 1;
347
362
  const dotProps = showDot ? variant === "dashed" ? { ...CHART_DOT_PROPS, strokeDasharray: "0" } : CHART_DOT_PROPS : false;
348
363
  const activeDotProps = showActiveDot ? variant === "dashed" ? { ...CHART_ACTIVE_DOT_PROPS, strokeDasharray: "0" } : CHART_ACTIVE_DOT_PROPS : false;
349
- return /* @__PURE__ */ React.createElement(
364
+ return /* @__PURE__ */ jsx(
350
365
  RechartsPrimitive.Line,
351
366
  {
352
367
  type,
@@ -384,24 +399,30 @@ function ChartArea({
384
399
  const gradientId = `area-gradient-${String(dataKey)}`;
385
400
  const effectiveFill = variant === "gradient" ? `url(#${gradientId})` : fill || stroke;
386
401
  const effectiveFillOpacity = variant === "gradient" ? 1 : fillOpacity;
387
- return /* @__PURE__ */ React.createElement(React.Fragment, null, variant === "gradient" && /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1" }, /* @__PURE__ */ React.createElement("stop", { offset: "5%", stopColor: fill || stroke, stopOpacity: 0.8 }), /* @__PURE__ */ React.createElement("stop", { offset: "95%", stopColor: fill || stroke, stopOpacity: 0 }))), /* @__PURE__ */ React.createElement(
388
- RechartsPrimitive.Area,
389
- {
390
- type,
391
- dataKey,
392
- stroke,
393
- fill: effectiveFill,
394
- fillOpacity: effectiveFillOpacity * opacity,
395
- strokeWidth: 2,
396
- dot: dotProps,
397
- activeDot: activeDotProps,
398
- strokeOpacity: opacity,
399
- ...hoverFade && { isAnimationActive: false },
400
- ...hoverFade && { onMouseEnter: () => setActiveDataKey(dataKey) },
401
- style: hoverFade ? { transition: "fill-opacity var(--duration-fast) ease-out, stroke-opacity var(--duration-fast) ease-out" } : void 0,
402
- ...props
403
- }
404
- ));
402
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
403
+ variant === "gradient" && /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
404
+ /* @__PURE__ */ jsx("stop", { offset: "5%", stopColor: fill || stroke, stopOpacity: 0.8 }),
405
+ /* @__PURE__ */ jsx("stop", { offset: "95%", stopColor: fill || stroke, stopOpacity: 0 })
406
+ ] }) }),
407
+ /* @__PURE__ */ jsx(
408
+ RechartsPrimitive.Area,
409
+ {
410
+ type,
411
+ dataKey,
412
+ stroke,
413
+ fill: effectiveFill,
414
+ fillOpacity: effectiveFillOpacity * opacity,
415
+ strokeWidth: 2,
416
+ dot: dotProps,
417
+ activeDot: activeDotProps,
418
+ strokeOpacity: opacity,
419
+ ...hoverFade && { isAnimationActive: false },
420
+ ...hoverFade && { onMouseEnter: () => setActiveDataKey(dataKey) },
421
+ style: hoverFade ? { transition: "fill-opacity var(--duration-fast) ease-out, stroke-opacity var(--duration-fast) ease-out" } : void 0,
422
+ ...props
423
+ }
424
+ )
425
+ ] });
405
426
  }
406
427
  const CHART_PIE_ACTIVE_OFFSET = 8;
407
428
  const CHART_PIE_DONUT_INNER_RADIUS = 60;
@@ -421,7 +442,7 @@ function ChartPie({
421
442
  ...props
422
443
  }) {
423
444
  const resolvedInnerRadius = innerRadius ?? (variant === "donut" ? CHART_PIE_DONUT_INNER_RADIUS : 0);
424
- const activeShapeConfig = showActiveShape ? (props2) => /* @__PURE__ */ React.createElement(
445
+ const activeShapeConfig = showActiveShape ? (props2) => /* @__PURE__ */ jsx(
425
446
  RechartsPrimitive.Sector,
426
447
  {
427
448
  ...props2,
@@ -438,26 +459,29 @@ function ChartPie({
438
459
  const my = cy + (outerRadius + CHART_PIE_LABEL_RADIAL) * Math.sin(-midAngle * RADIAN);
439
460
  const isRight = mx > cx;
440
461
  const ex = mx + (isRight ? CHART_PIE_LABEL_HORIZ : -CHART_PIE_LABEL_HORIZ);
441
- return /* @__PURE__ */ React.createElement("g", null, /* @__PURE__ */ React.createElement(
442
- "polyline",
443
- {
444
- points: `${sx},${sy} ${mx},${my} ${ex},${my}`,
445
- fill: "none",
446
- stroke: fill,
447
- strokeWidth: 1,
448
- strokeOpacity: 0.5
449
- }
450
- ), /* @__PURE__ */ React.createElement(
451
- "text",
452
- {
453
- x: ex + (isRight ? 4 : -4),
454
- y: my,
455
- textAnchor: isRight ? "start" : "end",
456
- dominantBaseline: "central",
457
- style: { fontSize: "var(--font-size-xs)", fill: "var(--color-text-muted)" }
458
- },
459
- getDisplayText(entry)
460
- ));
462
+ return /* @__PURE__ */ jsxs("g", { children: [
463
+ /* @__PURE__ */ jsx(
464
+ "polyline",
465
+ {
466
+ points: `${sx},${sy} ${mx},${my} ${ex},${my}`,
467
+ fill: "none",
468
+ stroke: fill,
469
+ strokeWidth: 1,
470
+ strokeOpacity: 0.5
471
+ }
472
+ ),
473
+ /* @__PURE__ */ jsx(
474
+ "text",
475
+ {
476
+ x: ex + (isRight ? 4 : -4),
477
+ y: my,
478
+ textAnchor: isRight ? "start" : "end",
479
+ dominantBaseline: "central",
480
+ style: { fontSize: "var(--font-size-xs)", fill: "var(--color-text-muted)" },
481
+ children: getDisplayText(entry)
482
+ }
483
+ )
484
+ ] });
461
485
  } : labelMode === "inside" ? (entry) => {
462
486
  const angle = Math.abs(entry.endAngle - entry.startAngle);
463
487
  if (angle < CHART_PIE_SKIP_ANGLE) return null;
@@ -467,19 +491,19 @@ function ChartPie({
467
491
  const radius = ir + (or - ir) * ratio;
468
492
  const x = cx + radius * Math.cos(-midAngle * RADIAN);
469
493
  const y = cy + radius * Math.sin(-midAngle * RADIAN);
470
- return /* @__PURE__ */ React.createElement(
494
+ return /* @__PURE__ */ jsx(
471
495
  "text",
472
496
  {
473
497
  x,
474
498
  y,
475
499
  textAnchor: "middle",
476
500
  dominantBaseline: "central",
477
- style: { fontSize: "var(--font-size-xs)", fill: "white", fontWeight: 600 }
478
- },
479
- getDisplayText(entry)
501
+ style: { fontSize: "var(--font-size-xs)", fill: "white", fontWeight: 600 },
502
+ children: getDisplayText(entry)
503
+ }
480
504
  );
481
505
  } : false;
482
- return /* @__PURE__ */ React.createElement(
506
+ return /* @__PURE__ */ jsx(
483
507
  RechartsPrimitive.Pie,
484
508
  {
485
509
  innerRadius: resolvedInnerRadius,