@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
@@ -44,6 +44,7 @@ __export(chart_exports, {
44
44
  useChart: () => useChart
45
45
  });
46
46
  module.exports = __toCommonJS(chart_exports);
47
+ var import_jsx_runtime = require("react/jsx-runtime");
47
48
  var React = __toESM(require("react"));
48
49
  var RechartsPrimitive = __toESM(require("recharts"));
49
50
  var import_utils = require("../../lib/utils");
@@ -68,7 +69,7 @@ function Chart({
68
69
  const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
69
70
  const [activeIndex, setActiveIndex] = React.useState(null);
70
71
  const [activeDataKey, setActiveDataKey] = React.useState(null);
71
- return /* @__PURE__ */ React.createElement(ChartContext.Provider, { value: { config, hoverFade, activeIndex, setActiveIndex, activeDataKey, setActiveDataKey } }, /* @__PURE__ */ React.createElement(
72
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChartContext.Provider, { value: { config, hoverFade, activeIndex, setActiveIndex, activeDataKey, setActiveDataKey }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
72
73
  "div",
73
74
  {
74
75
  "data-slot": "chart",
@@ -97,11 +98,13 @@ function Chart({
97
98
  "[&_.recharts-surface]:outline-none",
98
99
  className
99
100
  ),
100
- ...props
101
- },
102
- /* @__PURE__ */ React.createElement(ChartStyle, { id: chartId, config }),
103
- /* @__PURE__ */ React.createElement(RechartsPrimitive.ResponsiveContainer, null, children)
104
- ));
101
+ ...props,
102
+ children: [
103
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChartStyle, { id: chartId, config }),
104
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RechartsPrimitive.ResponsiveContainer, { children })
105
+ ]
106
+ }
107
+ ) });
105
108
  }
106
109
  const CHART_TOOLTIP_KEYFRAME = "@keyframes chart-tooltip-in{from{opacity:0}to{opacity:1}}";
107
110
  const ChartStyle = ({ id, config }) => {
@@ -118,7 +121,7 @@ ${colorConfig.map(([key, itemConfig]) => {
118
121
  }
119
122
  `
120
123
  ).join("\n") : "";
121
- return /* @__PURE__ */ React.createElement(
124
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
122
125
  "style",
123
126
  {
124
127
  dangerouslySetInnerHTML: {
@@ -159,12 +162,12 @@ function ChartBar({
159
162
  const y = shapeProps.y ?? 0;
160
163
  const width = shapeProps.width ?? 0;
161
164
  const height = shapeProps.height ?? 0;
162
- if (!width || !height || width <= 0 || height <= 0) return /* @__PURE__ */ React.createElement("g", null);
165
+ if (!width || !height || width <= 0 || height <= 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", {});
163
166
  const sw = 2;
164
167
  const inset = sw / 2;
165
168
  const rx = typeof appliedRadius === "number" ? Math.max(0, appliedRadius - inset) : 0;
166
169
  const fadeMultiplier = hoverFade && activeIndex !== null && shapeProps.index !== activeIndex ? CHART_HOVER_FADE_OPACITY : 1;
167
- return /* @__PURE__ */ React.createElement(
170
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
168
171
  "rect",
169
172
  {
170
173
  x: x + inset,
@@ -183,7 +186,7 @@ function ChartBar({
183
186
  }, [appliedRadius, fill, hoverFade, activeIndex]);
184
187
  const solidHoverShape = React.useCallback((shapeProps) => {
185
188
  const opacity = activeIndex === null ? 1 : shapeProps.index === activeIndex ? 1 : CHART_HOVER_FADE_OPACITY;
186
- return /* @__PURE__ */ React.createElement(
189
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
187
190
  RechartsPrimitive.Rectangle,
188
191
  {
189
192
  ...shapeProps,
@@ -194,7 +197,7 @@ function ChartBar({
194
197
  }, [activeIndex]);
195
198
  const useOutline = variant === "outline" && !isStacked;
196
199
  const needsHoverShape = hoverFade && variant === "solid" && !useOutline;
197
- return /* @__PURE__ */ React.createElement(
200
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
198
201
  RechartsPrimitive.Bar,
199
202
  {
200
203
  radius: appliedRadius,
@@ -209,7 +212,7 @@ function ChartBar({
209
212
  );
210
213
  }
211
214
  function ChartTooltip(props) {
212
- return /* @__PURE__ */ React.createElement(RechartsPrimitive.Tooltip, { animationDuration: 0, ...props });
215
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RechartsPrimitive.Tooltip, { animationDuration: 0, ...props });
213
216
  }
214
217
  function ChartTooltipContent({
215
218
  active,
@@ -236,70 +239,80 @@ function ChartTooltipContent({
236
239
  const itemConfig = getPayloadConfigFromPayload(config, item, key);
237
240
  const value = !labelKey && typeof label === "string" ? config[label]?.label || label : itemConfig?.label;
238
241
  if (labelFormatter) {
239
- return /* @__PURE__ */ React.createElement("div", { className: (0, import_utils.cn)("font-semibold", labelClassName) }, labelFormatter(value, payload));
242
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_utils.cn)("font-semibold", labelClassName), children: labelFormatter(value, payload) });
240
243
  }
241
244
  if (!value) {
242
245
  return null;
243
246
  }
244
- return /* @__PURE__ */ React.createElement("div", { className: (0, import_utils.cn)("font-semibold", labelClassName) }, value);
247
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_utils.cn)("font-semibold", labelClassName), children: value });
245
248
  }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);
246
249
  if (!active || !payload?.length) {
247
250
  return null;
248
251
  }
249
252
  const nestLabel = payload.length === 1 && indicator !== "dot";
250
- return /* @__PURE__ */ React.createElement(
253
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
251
254
  "div",
252
255
  {
253
256
  className: (0, import_utils.cn)(
254
257
  "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",
255
258
  className
256
259
  ),
257
- style: { animation: "chart-tooltip-in var(--duration-slow) ease-out" }
258
- },
259
- !nestLabel ? tooltipLabel : null,
260
- /* @__PURE__ */ React.createElement("div", { className: "grid gap-1.5" }, payload.filter((item) => item.type !== "none").map((item, index) => {
261
- const key = `${nameKey || item.name || item.dataKey || "value"}`;
262
- const itemConfig = getPayloadConfigFromPayload(config, item, key);
263
- const indicatorColor = color || item.payload?.fill || item.color;
264
- return /* @__PURE__ */ React.createElement(
265
- "div",
266
- {
267
- key: item.dataKey,
268
- className: (0, import_utils.cn)(
269
- "flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-text-muted",
270
- indicator === "dot" && "items-center"
271
- )
272
- },
273
- 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(
274
- "div",
275
- {
276
- className: (0, import_utils.cn)(
277
- "shrink-0 rounded-sm",
278
- {
279
- "h-2.5 w-2.5": indicator === "dot",
280
- "w-1": indicator === "line",
281
- "w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
282
- "my-0.5": nestLabel && indicator === "dashed"
283
- }
284
- ),
285
- style: {
286
- backgroundColor: indicator === "dashed" ? "transparent" : indicatorColor,
287
- borderColor: indicatorColor
288
- }
289
- }
290
- ), /* @__PURE__ */ React.createElement(
291
- "div",
292
- {
293
- className: (0, import_utils.cn)(
294
- "flex flex-1 justify-between leading-none",
295
- nestLabel ? "items-end" : "items-center"
296
- )
297
- },
298
- /* @__PURE__ */ React.createElement("div", { className: "grid gap-1.5" }, nestLabel ? tooltipLabel : null, /* @__PURE__ */ React.createElement("span", { className: "text-text-muted" }, itemConfig?.label || item.name)),
299
- item.value && /* @__PURE__ */ React.createElement("span", { className: "font-mono font-semibold text-foreground tabular-nums" }, item.value.toLocaleString())
300
- ))
301
- );
302
- }))
260
+ style: { animation: "chart-tooltip-in var(--duration-slow) ease-out" },
261
+ children: [
262
+ !nestLabel ? tooltipLabel : null,
263
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid gap-1.5", children: payload.filter((item) => item.type !== "none").map((item, index) => {
264
+ const key = `${nameKey || item.name || item.dataKey || "value"}`;
265
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
266
+ const indicatorColor = color || item.payload?.fill || item.color;
267
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
268
+ "div",
269
+ {
270
+ className: (0, import_utils.cn)(
271
+ "flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-text-muted",
272
+ indicator === "dot" && "items-center"
273
+ ),
274
+ children: formatter && item?.value !== void 0 && item.name ? formatter(item.value, item.name, item, index, item.payload) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
275
+ itemConfig?.icon ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
276
+ "div",
277
+ {
278
+ className: (0, import_utils.cn)(
279
+ "shrink-0 rounded-sm",
280
+ {
281
+ "h-2.5 w-2.5": indicator === "dot",
282
+ "w-1": indicator === "line",
283
+ "w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
284
+ "my-0.5": nestLabel && indicator === "dashed"
285
+ }
286
+ ),
287
+ style: {
288
+ backgroundColor: indicator === "dashed" ? "transparent" : indicatorColor,
289
+ borderColor: indicatorColor
290
+ }
291
+ }
292
+ ),
293
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
294
+ "div",
295
+ {
296
+ className: (0, import_utils.cn)(
297
+ "flex flex-1 justify-between gap-4 leading-none",
298
+ nestLabel ? "items-end" : "items-center"
299
+ ),
300
+ children: [
301
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid gap-1.5", children: [
302
+ nestLabel ? tooltipLabel : null,
303
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-text-muted", children: itemConfig?.label || item.name })
304
+ ] }),
305
+ item.value && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "font-mono font-semibold text-foreground tabular-nums", children: item.value.toLocaleString() })
306
+ ]
307
+ }
308
+ )
309
+ ] })
310
+ },
311
+ item.dataKey
312
+ );
313
+ }) })
314
+ ]
315
+ }
303
316
  );
304
317
  }
305
318
  const ChartLegend = RechartsPrimitive.Legend;
@@ -317,7 +330,7 @@ function ChartLegendContent({
317
330
  return null;
318
331
  }
319
332
  const isVertical = layout === "vertical";
320
- return /* @__PURE__ */ React.createElement(
333
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
321
334
  "div",
322
335
  {
323
336
  className: (0, import_utils.cn)(
@@ -328,29 +341,31 @@ function ChartLegendContent({
328
341
  verticalAlign === "top" ? "pb-3" : "pt-3"
329
342
  ],
330
343
  className
331
- )
332
- },
333
- payload.filter((item) => item.type !== "none").map((item) => {
334
- const key = `${nameKey || item.dataKey || "value"}`;
335
- const itemConfig = getPayloadConfigFromPayload(config, item, key);
336
- return /* @__PURE__ */ React.createElement(
337
- "div",
338
- {
339
- key: item.value,
340
- className: "flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-text-muted"
341
- },
342
- itemConfig?.icon && !hideIcon ? /* @__PURE__ */ React.createElement(itemConfig.icon, null) : /* @__PURE__ */ React.createElement(
344
+ ),
345
+ children: payload.filter((item) => item.type !== "none").map((item) => {
346
+ const key = `${nameKey || item.dataKey || "value"}`;
347
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
348
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
343
349
  "div",
344
350
  {
345
- className: "h-2 w-2 shrink-0 rounded-sm",
346
- style: {
347
- backgroundColor: item.color
348
- }
349
- }
350
- ),
351
- /* @__PURE__ */ React.createElement("span", { className: "text-foreground" }, itemConfig?.label)
352
- );
353
- })
351
+ className: "flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-text-muted",
352
+ children: [
353
+ itemConfig?.icon && !hideIcon ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(itemConfig.icon, {}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
354
+ "div",
355
+ {
356
+ className: "h-2 w-2 shrink-0 rounded-sm",
357
+ style: {
358
+ backgroundColor: item.color
359
+ }
360
+ }
361
+ ),
362
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-foreground", children: itemConfig?.label })
363
+ ]
364
+ },
365
+ item.value
366
+ );
367
+ })
368
+ }
354
369
  );
355
370
  }
356
371
  function getPayloadConfigFromPayload(config, payload, key) {
@@ -369,10 +384,10 @@ function getPayloadConfigFromPayload(config, payload, key) {
369
384
  const CHART_AXIS_TICK_STYLE = { style: { fontSize: "var(--chart-axis-fs)", fill: "var(--color-text-subtle)" } };
370
385
  const CHART_XAXIS_PADDING = { left: 16, right: 16 };
371
386
  function ChartXAxis({ tick, padding, ...props }) {
372
- return /* @__PURE__ */ React.createElement(RechartsPrimitive.XAxis, { tick: tick ?? CHART_AXIS_TICK_STYLE, padding: padding ?? CHART_XAXIS_PADDING, ...props });
387
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RechartsPrimitive.XAxis, { tick: tick ?? CHART_AXIS_TICK_STYLE, padding: padding ?? CHART_XAXIS_PADDING, ...props });
373
388
  }
374
389
  function ChartYAxis({ tick, width = "auto", ...props }) {
375
- return /* @__PURE__ */ React.createElement(RechartsPrimitive.YAxis, { tick: tick ?? CHART_AXIS_TICK_STYLE, width, ...props });
390
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RechartsPrimitive.YAxis, { tick: tick ?? CHART_AXIS_TICK_STYLE, width, ...props });
376
391
  }
377
392
  const CHART_LINE_DASH = "5 5";
378
393
  const CHART_DOT_PROPS = { r: 3, strokeWidth: 2 };
@@ -391,7 +406,7 @@ function ChartLine({
391
406
  const opacity = isFaded ? CHART_HOVER_FADE_OPACITY : 1;
392
407
  const dotProps = showDot ? variant === "dashed" ? { ...CHART_DOT_PROPS, strokeDasharray: "0" } : CHART_DOT_PROPS : false;
393
408
  const activeDotProps = showActiveDot ? variant === "dashed" ? { ...CHART_ACTIVE_DOT_PROPS, strokeDasharray: "0" } : CHART_ACTIVE_DOT_PROPS : false;
394
- return /* @__PURE__ */ React.createElement(
409
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
395
410
  RechartsPrimitive.Line,
396
411
  {
397
412
  type,
@@ -429,24 +444,30 @@ function ChartArea({
429
444
  const gradientId = `area-gradient-${String(dataKey)}`;
430
445
  const effectiveFill = variant === "gradient" ? `url(#${gradientId})` : fill || stroke;
431
446
  const effectiveFillOpacity = variant === "gradient" ? 1 : fillOpacity;
432
- 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(
433
- RechartsPrimitive.Area,
434
- {
435
- type,
436
- dataKey,
437
- stroke,
438
- fill: effectiveFill,
439
- fillOpacity: effectiveFillOpacity * opacity,
440
- strokeWidth: 2,
441
- dot: dotProps,
442
- activeDot: activeDotProps,
443
- strokeOpacity: opacity,
444
- ...hoverFade && { isAnimationActive: false },
445
- ...hoverFade && { onMouseEnter: () => setActiveDataKey(dataKey) },
446
- style: hoverFade ? { transition: "fill-opacity var(--duration-fast) ease-out, stroke-opacity var(--duration-fast) ease-out" } : void 0,
447
- ...props
448
- }
449
- ));
447
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
448
+ variant === "gradient" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
449
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("stop", { offset: "5%", stopColor: fill || stroke, stopOpacity: 0.8 }),
450
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("stop", { offset: "95%", stopColor: fill || stroke, stopOpacity: 0 })
451
+ ] }) }),
452
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
453
+ RechartsPrimitive.Area,
454
+ {
455
+ type,
456
+ dataKey,
457
+ stroke,
458
+ fill: effectiveFill,
459
+ fillOpacity: effectiveFillOpacity * opacity,
460
+ strokeWidth: 2,
461
+ dot: dotProps,
462
+ activeDot: activeDotProps,
463
+ strokeOpacity: opacity,
464
+ ...hoverFade && { isAnimationActive: false },
465
+ ...hoverFade && { onMouseEnter: () => setActiveDataKey(dataKey) },
466
+ style: hoverFade ? { transition: "fill-opacity var(--duration-fast) ease-out, stroke-opacity var(--duration-fast) ease-out" } : void 0,
467
+ ...props
468
+ }
469
+ )
470
+ ] });
450
471
  }
451
472
  const CHART_PIE_ACTIVE_OFFSET = 8;
452
473
  const CHART_PIE_DONUT_INNER_RADIUS = 60;
@@ -466,7 +487,7 @@ function ChartPie({
466
487
  ...props
467
488
  }) {
468
489
  const resolvedInnerRadius = innerRadius ?? (variant === "donut" ? CHART_PIE_DONUT_INNER_RADIUS : 0);
469
- const activeShapeConfig = showActiveShape ? (props2) => /* @__PURE__ */ React.createElement(
490
+ const activeShapeConfig = showActiveShape ? (props2) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
470
491
  RechartsPrimitive.Sector,
471
492
  {
472
493
  ...props2,
@@ -483,26 +504,29 @@ function ChartPie({
483
504
  const my = cy + (outerRadius + CHART_PIE_LABEL_RADIAL) * Math.sin(-midAngle * RADIAN);
484
505
  const isRight = mx > cx;
485
506
  const ex = mx + (isRight ? CHART_PIE_LABEL_HORIZ : -CHART_PIE_LABEL_HORIZ);
486
- return /* @__PURE__ */ React.createElement("g", null, /* @__PURE__ */ React.createElement(
487
- "polyline",
488
- {
489
- points: `${sx},${sy} ${mx},${my} ${ex},${my}`,
490
- fill: "none",
491
- stroke: fill,
492
- strokeWidth: 1,
493
- strokeOpacity: 0.5
494
- }
495
- ), /* @__PURE__ */ React.createElement(
496
- "text",
497
- {
498
- x: ex + (isRight ? 4 : -4),
499
- y: my,
500
- textAnchor: isRight ? "start" : "end",
501
- dominantBaseline: "central",
502
- style: { fontSize: "var(--font-size-xs)", fill: "var(--color-text-muted)" }
503
- },
504
- getDisplayText(entry)
505
- ));
507
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { children: [
508
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
509
+ "polyline",
510
+ {
511
+ points: `${sx},${sy} ${mx},${my} ${ex},${my}`,
512
+ fill: "none",
513
+ stroke: fill,
514
+ strokeWidth: 1,
515
+ strokeOpacity: 0.5
516
+ }
517
+ ),
518
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
519
+ "text",
520
+ {
521
+ x: ex + (isRight ? 4 : -4),
522
+ y: my,
523
+ textAnchor: isRight ? "start" : "end",
524
+ dominantBaseline: "central",
525
+ style: { fontSize: "var(--font-size-xs)", fill: "var(--color-text-muted)" },
526
+ children: getDisplayText(entry)
527
+ }
528
+ )
529
+ ] });
506
530
  } : labelMode === "inside" ? (entry) => {
507
531
  const angle = Math.abs(entry.endAngle - entry.startAngle);
508
532
  if (angle < CHART_PIE_SKIP_ANGLE) return null;
@@ -512,19 +536,19 @@ function ChartPie({
512
536
  const radius = ir + (or - ir) * ratio;
513
537
  const x = cx + radius * Math.cos(-midAngle * RADIAN);
514
538
  const y = cy + radius * Math.sin(-midAngle * RADIAN);
515
- return /* @__PURE__ */ React.createElement(
539
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
516
540
  "text",
517
541
  {
518
542
  x,
519
543
  y,
520
544
  textAnchor: "middle",
521
545
  dominantBaseline: "central",
522
- style: { fontSize: "var(--font-size-xs)", fill: "white", fontWeight: 600 }
523
- },
524
- getDisplayText(entry)
546
+ style: { fontSize: "var(--font-size-xs)", fill: "white", fontWeight: 600 },
547
+ children: getDisplayText(entry)
548
+ }
525
549
  );
526
550
  } : false;
527
- return /* @__PURE__ */ React.createElement(
551
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
528
552
  RechartsPrimitive.Pie,
529
553
  {
530
554
  innerRadius: resolvedInnerRadius,