@yamada-ui/charts 2.0.0-next-20240820160301 → 2.0.0-next-20240908154823

Sign up to get free protection for your applications and to get access to all the features.
Files changed (202) hide show
  1. package/README.md +7 -13
  2. package/dist/area-chart-split.js +4 -2
  3. package/dist/area-chart-split.js.map +1 -1
  4. package/dist/area-chart-split.mjs +1 -1
  5. package/dist/area-chart.d.mts +1 -2
  6. package/dist/area-chart.d.ts +1 -2
  7. package/dist/area-chart.js +57 -50
  8. package/dist/area-chart.js.map +1 -1
  9. package/dist/area-chart.mjs +12 -12
  10. package/dist/bar-chart.d.mts +1 -2
  11. package/dist/bar-chart.d.ts +1 -2
  12. package/dist/bar-chart.js +15 -9
  13. package/dist/bar-chart.js.map +1 -1
  14. package/dist/bar-chart.mjs +11 -11
  15. package/dist/chart-legend.mjs +3 -3
  16. package/dist/chart-tooltip.d.mts +3 -1
  17. package/dist/chart-tooltip.d.ts +3 -1
  18. package/dist/chart-tooltip.js +9 -1
  19. package/dist/chart-tooltip.js.map +1 -1
  20. package/dist/chart-tooltip.mjs +3 -3
  21. package/dist/chart.types.d.mts +12 -5
  22. package/dist/chart.types.d.ts +12 -5
  23. package/dist/chart.types.js.map +1 -1
  24. package/dist/{chunk-STBYN5JW.mjs → chunk-3AOICU4Q.mjs} +2 -2
  25. package/dist/chunk-3HQ2UC3I.mjs +45 -0
  26. package/dist/chunk-3HQ2UC3I.mjs.map +1 -0
  27. package/dist/{chunk-FALZDKAW.mjs → chunk-3VKCTSPC.mjs} +10 -11
  28. package/dist/chunk-3VKCTSPC.mjs.map +1 -0
  29. package/dist/{chunk-S5NKKKV5.mjs → chunk-5PSRSNGH.mjs} +7 -8
  30. package/dist/chunk-5PSRSNGH.mjs.map +1 -0
  31. package/dist/{chunk-F34FV5DY.mjs → chunk-6YUJLLGN.mjs} +59 -3
  32. package/dist/chunk-6YUJLLGN.mjs.map +1 -0
  33. package/dist/{chunk-KBBHISBO.mjs → chunk-BYL7HWNN.mjs} +13 -14
  34. package/dist/chunk-BYL7HWNN.mjs.map +1 -0
  35. package/dist/chunk-D5IRVU4W.mjs +46 -0
  36. package/dist/chunk-D5IRVU4W.mjs.map +1 -0
  37. package/dist/{chunk-DGOXJ373.mjs → chunk-EL2VTGFB.mjs} +2 -2
  38. package/dist/{chunk-6L73M52L.mjs → chunk-FPFCMFCJ.mjs} +7 -9
  39. package/dist/chunk-FPFCMFCJ.mjs.map +1 -0
  40. package/dist/{chunk-Q7CCSKX3.mjs → chunk-JTQ5QCML.mjs} +4 -4
  41. package/dist/chunk-JTQ5QCML.mjs.map +1 -0
  42. package/dist/chunk-KVE6VXTJ.mjs +37 -0
  43. package/dist/chunk-KVE6VXTJ.mjs.map +1 -0
  44. package/dist/{chunk-PNE3JG54.mjs → chunk-MGTMKKSH.mjs} +5 -3
  45. package/dist/chunk-MGTMKKSH.mjs.map +1 -0
  46. package/dist/chunk-PG7ZV76C.mjs +155 -0
  47. package/dist/chunk-PG7ZV76C.mjs.map +1 -0
  48. package/dist/{chunk-D7EZKGCJ.mjs → chunk-PPBHLDVN.mjs} +2 -2
  49. package/dist/{chunk-AODYT4HF.mjs → chunk-RKO6KM3T.mjs} +13 -14
  50. package/dist/chunk-RKO6KM3T.mjs.map +1 -0
  51. package/dist/chunk-SBPKRYF2.mjs +199 -0
  52. package/dist/chunk-SBPKRYF2.mjs.map +1 -0
  53. package/dist/{chunk-FCMP6QEZ.mjs → chunk-SWATR7CU.mjs} +14 -15
  54. package/dist/chunk-SWATR7CU.mjs.map +1 -0
  55. package/dist/{chunk-MT5JI4OR.mjs → chunk-T5DNDBW6.mjs} +11 -3
  56. package/dist/chunk-T5DNDBW6.mjs.map +1 -0
  57. package/dist/{chunk-5Q6O726L.mjs → chunk-TCSYDMC7.mjs} +2 -2
  58. package/dist/{chunk-UHQ6WE5D.mjs → chunk-TMHSYM3V.mjs} +17 -13
  59. package/dist/chunk-TMHSYM3V.mjs.map +1 -0
  60. package/dist/{chunk-AOGTJ4EN.mjs → chunk-VMBRDEM2.mjs} +2 -2
  61. package/dist/{chunk-XUAAKVRL.mjs → chunk-WMG5U5AU.mjs} +26 -13
  62. package/dist/chunk-WMG5U5AU.mjs.map +1 -0
  63. package/dist/{chunk-6BNJZIBK.mjs → chunk-X7XFG7TS.mjs} +10 -12
  64. package/dist/chunk-X7XFG7TS.mjs.map +1 -0
  65. package/dist/{chunk-MOFNE6PO.mjs → chunk-XRF3TNSQ.mjs} +6 -30
  66. package/dist/chunk-XRF3TNSQ.mjs.map +1 -0
  67. package/dist/{chunk-VK4VQQYY.mjs → chunk-YNJ423BR.mjs} +2 -2
  68. package/dist/{chunk-BGMNYKQY.mjs → chunk-ZQWVMOT6.mjs} +9 -7
  69. package/dist/chunk-ZQWVMOT6.mjs.map +1 -0
  70. package/dist/donut-chart.d.mts +3 -3
  71. package/dist/donut-chart.d.ts +3 -3
  72. package/dist/donut-chart.js +109 -58
  73. package/dist/donut-chart.js.map +1 -1
  74. package/dist/donut-chart.mjs +9 -8
  75. package/dist/index.d.mts +6 -2
  76. package/dist/index.d.ts +6 -2
  77. package/dist/index.js +599 -167
  78. package/dist/index.js.map +1 -1
  79. package/dist/index.mjs +30 -22
  80. package/dist/index.mjs.map +1 -1
  81. package/dist/line-chart.d.mts +1 -2
  82. package/dist/line-chart.d.ts +1 -2
  83. package/dist/line-chart.js +15 -10
  84. package/dist/line-chart.js.map +1 -1
  85. package/dist/line-chart.mjs +11 -11
  86. package/dist/pie-chart.d.mts +2 -3
  87. package/dist/pie-chart.d.ts +2 -3
  88. package/dist/pie-chart.js +13 -7
  89. package/dist/pie-chart.js.map +1 -1
  90. package/dist/pie-chart.mjs +8 -8
  91. package/dist/radar-chart.d.mts +3 -3
  92. package/dist/radar-chart.d.ts +3 -3
  93. package/dist/radar-chart.js +90 -70
  94. package/dist/radar-chart.js.map +1 -1
  95. package/dist/radar-chart.mjs +9 -8
  96. package/dist/radial-chart.d.mts +53 -0
  97. package/dist/radial-chart.d.ts +53 -0
  98. package/dist/radial-chart.js +767 -0
  99. package/dist/radial-chart.js.map +1 -0
  100. package/dist/radial-chart.mjs +18 -0
  101. package/dist/radial-chart.mjs.map +1 -0
  102. package/dist/rechart-properties.d.mts +5 -1
  103. package/dist/rechart-properties.d.ts +5 -1
  104. package/dist/rechart-properties.js +60 -1
  105. package/dist/rechart-properties.js.map +1 -1
  106. package/dist/rechart-properties.mjs +7 -1
  107. package/dist/use-area-chart.d.mts +1 -2
  108. package/dist/use-area-chart.d.ts +1 -2
  109. package/dist/use-area-chart.js +7 -9
  110. package/dist/use-area-chart.js.map +1 -1
  111. package/dist/use-area-chart.mjs +2 -2
  112. package/dist/use-bar-chart.d.mts +1 -2
  113. package/dist/use-bar-chart.d.ts +1 -2
  114. package/dist/use-bar-chart.js +4 -5
  115. package/dist/use-bar-chart.js.map +1 -1
  116. package/dist/use-bar-chart.mjs +2 -2
  117. package/dist/use-chart-axis.d.mts +0 -1
  118. package/dist/use-chart-axis.d.ts +0 -1
  119. package/dist/use-chart-axis.js.map +1 -1
  120. package/dist/use-chart-axis.mjs +2 -2
  121. package/dist/use-chart-grid.d.mts +0 -1
  122. package/dist/use-chart-grid.d.ts +0 -1
  123. package/dist/use-chart-grid.js.map +1 -1
  124. package/dist/use-chart-grid.mjs +2 -2
  125. package/dist/use-chart-label-list.d.mts +22 -0
  126. package/dist/use-chart-label-list.d.ts +22 -0
  127. package/dist/use-chart-label-list.js +93 -0
  128. package/dist/use-chart-label-list.js.map +1 -0
  129. package/dist/use-chart-label-list.mjs +10 -0
  130. package/dist/use-chart-label-list.mjs.map +1 -0
  131. package/dist/use-chart-label.d.mts +20 -0
  132. package/dist/use-chart-label.d.ts +20 -0
  133. package/dist/use-chart-label.js +82 -0
  134. package/dist/use-chart-label.js.map +1 -0
  135. package/dist/use-chart-label.mjs +10 -0
  136. package/dist/use-chart-label.mjs.map +1 -0
  137. package/dist/use-chart-legend.d.mts +0 -1
  138. package/dist/use-chart-legend.d.ts +0 -1
  139. package/dist/use-chart-legend.js.map +1 -1
  140. package/dist/use-chart-legend.mjs +2 -2
  141. package/dist/use-chart-reference-line.d.mts +0 -1
  142. package/dist/use-chart-reference-line.d.ts +0 -1
  143. package/dist/use-chart-reference-line.js +1 -1
  144. package/dist/use-chart-reference-line.js.map +1 -1
  145. package/dist/use-chart-reference-line.mjs +2 -2
  146. package/dist/use-chart-tooltip.d.mts +0 -1
  147. package/dist/use-chart-tooltip.d.ts +0 -1
  148. package/dist/use-chart-tooltip.js.map +1 -1
  149. package/dist/use-chart-tooltip.mjs +2 -2
  150. package/dist/use-chart.d.mts +0 -1
  151. package/dist/use-chart.d.ts +0 -1
  152. package/dist/use-chart.js.map +1 -1
  153. package/dist/use-chart.mjs +2 -2
  154. package/dist/use-line-chart.d.mts +1 -2
  155. package/dist/use-line-chart.d.ts +1 -2
  156. package/dist/use-line-chart.js +4 -6
  157. package/dist/use-line-chart.js.map +1 -1
  158. package/dist/use-line-chart.mjs +2 -2
  159. package/dist/use-pie-chart.d.mts +1 -2
  160. package/dist/use-pie-chart.d.ts +1 -2
  161. package/dist/use-pie-chart.js +3 -4
  162. package/dist/use-pie-chart.js.map +1 -1
  163. package/dist/use-pie-chart.mjs +2 -2
  164. package/dist/use-polar-grid.d.mts +24 -0
  165. package/dist/use-polar-grid.d.ts +24 -0
  166. package/dist/use-polar-grid.js +90 -0
  167. package/dist/use-polar-grid.js.map +1 -0
  168. package/dist/use-polar-grid.mjs +10 -0
  169. package/dist/use-polar-grid.mjs.map +1 -0
  170. package/dist/use-radar-chart.d.mts +3 -13
  171. package/dist/use-radar-chart.d.ts +3 -13
  172. package/dist/use-radar-chart.js +3 -35
  173. package/dist/use-radar-chart.js.map +1 -1
  174. package/dist/use-radar-chart.mjs +2 -2
  175. package/dist/use-radial-chart.d.mts +80 -0
  176. package/dist/use-radial-chart.d.ts +80 -0
  177. package/dist/use-radial-chart.js +228 -0
  178. package/dist/use-radial-chart.js.map +1 -0
  179. package/dist/use-radial-chart.mjs +10 -0
  180. package/dist/use-radial-chart.mjs.map +1 -0
  181. package/package.json +4 -4
  182. package/dist/chunk-6BNJZIBK.mjs.map +0 -1
  183. package/dist/chunk-6L73M52L.mjs.map +0 -1
  184. package/dist/chunk-AODYT4HF.mjs.map +0 -1
  185. package/dist/chunk-BGMNYKQY.mjs.map +0 -1
  186. package/dist/chunk-F34FV5DY.mjs.map +0 -1
  187. package/dist/chunk-FALZDKAW.mjs.map +0 -1
  188. package/dist/chunk-FCMP6QEZ.mjs.map +0 -1
  189. package/dist/chunk-KBBHISBO.mjs.map +0 -1
  190. package/dist/chunk-MOFNE6PO.mjs.map +0 -1
  191. package/dist/chunk-MT5JI4OR.mjs.map +0 -1
  192. package/dist/chunk-PNE3JG54.mjs.map +0 -1
  193. package/dist/chunk-Q7CCSKX3.mjs.map +0 -1
  194. package/dist/chunk-S5NKKKV5.mjs.map +0 -1
  195. package/dist/chunk-UHQ6WE5D.mjs.map +0 -1
  196. package/dist/chunk-XUAAKVRL.mjs.map +0 -1
  197. /package/dist/{chunk-STBYN5JW.mjs.map → chunk-3AOICU4Q.mjs.map} +0 -0
  198. /package/dist/{chunk-DGOXJ373.mjs.map → chunk-EL2VTGFB.mjs.map} +0 -0
  199. /package/dist/{chunk-D7EZKGCJ.mjs.map → chunk-PPBHLDVN.mjs.map} +0 -0
  200. /package/dist/{chunk-5Q6O726L.mjs.map → chunk-TCSYDMC7.mjs.map} +0 -0
  201. /package/dist/{chunk-AOGTJ4EN.mjs.map → chunk-VMBRDEM2.mjs.map} +0 -0
  202. /package/dist/{chunk-VK4VQQYY.mjs.map → chunk-YNJ423BR.mjs.map} +0 -0
@@ -24,9 +24,9 @@ __export(radar_chart_exports, {
24
24
  RadarChart: () => RadarChart
25
25
  });
26
26
  module.exports = __toCommonJS(radar_chart_exports);
27
- var import_core7 = require("@yamada-ui/core");
28
- var import_utils8 = require("@yamada-ui/utils");
29
- var import_react5 = require("react");
27
+ var import_core8 = require("@yamada-ui/core");
28
+ var import_utils9 = require("@yamada-ui/utils");
29
+ var import_react6 = require("react");
30
30
  var import_recharts = require("recharts");
31
31
 
32
32
  // src/chart-legend.tsx
@@ -158,7 +158,8 @@ var polarGridProperties = [
158
158
  "outerRadius",
159
159
  "polarAngles",
160
160
  "polarRadius",
161
- "gridType"
161
+ "gridType",
162
+ "radialLines"
162
163
  ];
163
164
  var polarAngleAxisProperties = [
164
165
  "dataKey",
@@ -296,18 +297,26 @@ var import_jsx_runtime2 = require("react/jsx-runtime");
296
297
  var ChartTooltip = (0, import_core4.forwardRef)(
297
298
  ({
298
299
  label,
300
+ dataKey = "value",
299
301
  className,
300
302
  payload = [],
301
303
  valueFormatter,
302
304
  labelFormatter,
303
305
  unit,
306
+ isRadialChart,
304
307
  ...rest
305
308
  }, ref) => {
306
309
  var _a;
307
310
  const { styles } = useTooltip();
308
311
  const items = payload.map(
309
- ({ color: colorProp, name, value: valueProp, payload: payload2 } = {}, index) => {
312
+ ({
313
+ color: colorProp,
314
+ name: nameProp,
315
+ [dataKey]: valueProp,
316
+ payload: payload2
317
+ } = {}, index) => {
310
318
  var _a2;
319
+ const name = isRadialChart ? payload2 == null ? void 0 : payload2.name : nameProp;
311
320
  const color = colorProp != null ? colorProp : payload2 == null ? void 0 : payload2.color;
312
321
  let value;
313
322
  if ((0, import_utils4.isArray)(valueProp)) {
@@ -432,10 +441,43 @@ var useChartTooltip = ({
432
441
  return { tooltipProps: tooltipUIProps, getTooltipProps };
433
442
  };
434
443
 
435
- // src/use-radar-chart.ts
444
+ // src/use-polar-grid.tsx
436
445
  var import_core6 = require("@yamada-ui/core");
437
446
  var import_utils7 = require("@yamada-ui/utils");
438
447
  var import_react4 = require("react");
448
+ var usePolarGrid = ({
449
+ strokeDasharray,
450
+ styles,
451
+ ...rest
452
+ }) => {
453
+ const { theme } = (0, import_core6.useTheme)();
454
+ const [polarGridProps, polarGridClassName] = (0, import_react4.useMemo)(
455
+ () => {
456
+ var _a;
457
+ return getComponentProps(
458
+ [(_a = rest.polarGridProps) != null ? _a : {}, polarGridProperties],
459
+ styles.polarGrid
460
+ )(theme);
461
+ },
462
+ [rest.polarGridProps, styles.polarGrid, theme]
463
+ );
464
+ const getPolarGridProps = (0, import_react4.useCallback)(
465
+ ({ className, ...props } = {}, ref = null) => ({
466
+ ref,
467
+ className: (0, import_utils7.cx)(className, polarGridClassName),
468
+ strokeDasharray,
469
+ ...props,
470
+ ...polarGridProps
471
+ }),
472
+ [polarGridClassName, polarGridProps, strokeDasharray]
473
+ );
474
+ return { getPolarGridProps };
475
+ };
476
+
477
+ // src/use-radar-chart.ts
478
+ var import_core7 = require("@yamada-ui/core");
479
+ var import_utils8 = require("@yamada-ui/utils");
480
+ var import_react5 = require("react");
439
481
  var useRadarChart = ({
440
482
  data,
441
483
  series,
@@ -446,13 +488,12 @@ var useRadarChart = ({
446
488
  fillOpacity = 0.4,
447
489
  polarAngleAxisTickFormatter,
448
490
  polarRadiusAxisTickFormatter,
449
- strokeDasharray,
450
491
  styles,
451
492
  ...rest
452
493
  }) => {
453
494
  var _a;
454
- const { theme } = (0, import_core6.useTheme)();
455
- const [highlightedArea, setHighlightedArea] = (0, import_react4.useState)(null);
495
+ const { theme } = (0, import_core7.useTheme)();
496
+ const [highlightedArea, setHighlightedArea] = (0, import_react5.useState)(null);
456
497
  const shouldHighlight = highlightedArea !== null;
457
498
  const {
458
499
  dot = {},
@@ -461,23 +502,22 @@ var useRadarChart = ({
461
502
  dimRadar = {},
462
503
  ...computedRadarProps
463
504
  } = (_a = rest.radarProps) != null ? _a : {};
464
- const radarColors = (0, import_react4.useMemo)(
505
+ const radarColors = (0, import_react5.useMemo)(
465
506
  () => series.map(({ color }, index) => ({
466
- __prefix: "ui",
467
507
  name: `radar-${index}`,
468
508
  token: "colors",
469
509
  value: color != null ? color : "transparent"
470
510
  })),
471
511
  [series]
472
512
  );
473
- const radarVars = (0, import_react4.useMemo)(
513
+ const radarVars = (0, import_react5.useMemo)(
474
514
  () => [
475
515
  ...radarColors,
476
- { __prefix: "ui", name: "fill-opacity", value: fillOpacity }
516
+ { name: "fill-opacity", value: fillOpacity }
477
517
  ],
478
518
  [fillOpacity, radarColors]
479
519
  );
480
- const [chartProps, radarChartClassName] = (0, import_react4.useMemo)(
520
+ const [chartProps, radarChartClassName] = (0, import_react5.useMemo)(
481
521
  () => {
482
522
  var _a2;
483
523
  return getComponentProps(
@@ -487,17 +527,7 @@ var useRadarChart = ({
487
527
  },
488
528
  [rest.chartProps, styles.chart, theme]
489
529
  );
490
- const [polarGridProps, polarGridClassName] = (0, import_react4.useMemo)(
491
- () => {
492
- var _a2;
493
- return getComponentProps(
494
- [(_a2 = rest.polarGridProps) != null ? _a2 : {}, polarGridProperties],
495
- styles.polarGrid
496
- )(theme);
497
- },
498
- [rest.polarGridProps, styles.polarGrid, theme]
499
- );
500
- const [polarAngleAxisProps, polarAngleAxisClassName] = (0, import_react4.useMemo)(
530
+ const [polarAngleAxisProps, polarAngleAxisClassName] = (0, import_react5.useMemo)(
501
531
  () => {
502
532
  var _a2;
503
533
  return getComponentProps(
@@ -507,14 +537,14 @@ var useRadarChart = ({
507
537
  },
508
538
  [rest.polarAngleAxisProps, styles.polarAngleAxis, theme]
509
539
  );
510
- const polarAngleAxisTickClassName = (0, import_react4.useMemo)(
540
+ const polarAngleAxisTickClassName = (0, import_react5.useMemo)(
511
541
  () => getClassName({
512
542
  ...styles.polarAngleAxisTick,
513
543
  ...rest.polarAngleAxisTickProps
514
544
  })(theme),
515
545
  [rest.polarAngleAxisTickProps, styles.polarAngleAxisTick, theme]
516
546
  );
517
- const [polarRadiusAxisProps, polarRadiusAxisClassName] = (0, import_react4.useMemo)(
547
+ const [polarRadiusAxisProps, polarRadiusAxisClassName] = (0, import_react5.useMemo)(
518
548
  () => {
519
549
  var _a2;
520
550
  return getComponentProps(
@@ -524,16 +554,16 @@ var useRadarChart = ({
524
554
  },
525
555
  [rest.polarRadiusAxisProps, styles.polarRadiusAxis, theme]
526
556
  );
527
- const polarRadiusAxisTickClassName = (0, import_react4.useMemo)(
557
+ const polarRadiusAxisTickClassName = (0, import_react5.useMemo)(
528
558
  () => getClassName({
529
559
  ...styles.polarRadiusAxisTick,
530
560
  ...rest.polarRadiusAxisTickProps
531
561
  })(theme),
532
562
  [rest.polarRadiusAxisTickProps, styles.polarRadiusAxisTick, theme]
533
563
  );
534
- const [radarProps, radarClassName] = (0, import_react4.useMemo)(() => {
564
+ const [radarProps, radarClassName] = (0, import_react5.useMemo)(() => {
535
565
  const resolvedRadarProps = {
536
- fillOpacity: "var(--ui-fill-opacity)",
566
+ fillOpacity: "$fill-opacity",
537
567
  ...computedRadarProps
538
568
  };
539
569
  return getComponentProps(
@@ -541,32 +571,32 @@ var useRadarChart = ({
541
571
  styles.radar
542
572
  )(theme);
543
573
  }, [computedRadarProps, styles.radar, theme]);
544
- const [dimRadarProps, dimRadarClassName] = (0, import_react4.useMemo)(
574
+ const [dimRadarProps, dimRadarClassName] = (0, import_react5.useMemo)(
545
575
  () => getComponentProps(
546
576
  [dimRadar, radarProperties],
547
577
  styles.dimRadar
548
578
  )(theme),
549
579
  [dimRadar, styles.dimRadar, theme]
550
580
  );
551
- const [dotProps, dotClassName] = (0, import_react4.useMemo)(
581
+ const [dotProps, dotClassName] = (0, import_react5.useMemo)(
552
582
  () => getComponentProps([dot, dotProperties], styles.dot)(theme),
553
583
  [dot, styles.dot, theme]
554
584
  );
555
- const [activeDotProps, activeDotClassName] = (0, import_react4.useMemo)(
585
+ const [activeDotProps, activeDotClassName] = (0, import_react5.useMemo)(
556
586
  () => getComponentProps(
557
587
  [activeDot, dotProperties],
558
588
  styles.activeDot
559
589
  )(theme),
560
590
  [activeDot, styles.activeDot, theme]
561
591
  );
562
- const [dimDotProps, dimDotClassName] = (0, import_react4.useMemo)(
592
+ const [dimDotProps, dimDotClassName] = (0, import_react5.useMemo)(
563
593
  () => getComponentProps(
564
594
  [dimDot, dotProperties],
565
595
  styles.dimDot
566
596
  )(theme),
567
597
  [dimDot, styles.dimDot, theme]
568
598
  );
569
- const radarPropList = (0, import_react4.useMemo)(
599
+ const radarPropList = (0, import_react5.useMemo)(
570
600
  () => series.map((props, index) => {
571
601
  const {
572
602
  dataKey: dataKey2,
@@ -576,7 +606,7 @@ var useRadarChart = ({
576
606
  dimRadar: dimRadar2 = {},
577
607
  ...computedProps
578
608
  } = props;
579
- const color = `var(--ui-radar-${index})`;
609
+ const color = (0, import_core7.getVar)(`radar-${index}`)(theme);
580
610
  const dimmed = shouldHighlight && highlightedArea !== dataKey2;
581
611
  const computedDimRadar = { ...dimRadarProps, ...dimRadar2 };
582
612
  const resolvedProps = {
@@ -600,7 +630,7 @@ var useRadarChart = ({
600
630
  activeDotClassName
601
631
  )(theme);
602
632
  resolvedActiveDot = {
603
- className: (0, import_utils7.cx)(
633
+ className: (0, import_utils8.cx)(
604
634
  "ui-radar-chart__dot",
605
635
  "ui-radar-chart__dot--active",
606
636
  className
@@ -627,7 +657,7 @@ var useRadarChart = ({
627
657
  dimmed ? dimDotClassName : void 0
628
658
  )(theme);
629
659
  resolvedDot = {
630
- className: (0, import_utils7.cx)("ui-radar-chart__dot", className),
660
+ className: (0, import_utils8.cx)("ui-radar-chart__dot", className),
631
661
  fill: color,
632
662
  r: 4,
633
663
  ...rest3
@@ -662,22 +692,22 @@ var useRadarChart = ({
662
692
  withDots
663
693
  ]
664
694
  );
665
- const getRadarChartProps = (0, import_react4.useCallback)(
695
+ const getRadarChartProps = (0, import_react5.useCallback)(
666
696
  ({ className, ...props } = {}, ref = null) => ({
667
697
  ref,
668
- className: (0, import_utils7.cx)(className, radarChartClassName),
698
+ className: (0, import_utils8.cx)(className, radarChartClassName),
669
699
  data,
670
700
  ...props,
671
701
  ...chartProps
672
702
  }),
673
703
  [data, radarChartClassName, chartProps]
674
704
  );
675
- const getRadarProps = (0, import_react4.useCallback)(
705
+ const getRadarProps = (0, import_react5.useCallback)(
676
706
  ({ index, className: classNameProp, ...props }, ref = null) => {
677
707
  const { color, className, dataKey: dataKey2, activeDot: activeDot2, dot: dot2, ...rest2 } = radarPropList[index];
678
708
  return {
679
709
  ref,
680
- className: (0, import_utils7.cx)(classNameProp, className),
710
+ className: (0, import_utils8.cx)(classNameProp, className),
681
711
  activeDot: activeDot2,
682
712
  dot: dot2,
683
713
  name: dataKey2,
@@ -692,23 +722,13 @@ var useRadarChart = ({
692
722
  },
693
723
  [radarPropList, strokeWidth]
694
724
  );
695
- const getPolarGridProps = (0, import_react4.useCallback)(
696
- ({ className, ...props } = {}, ref = null) => ({
697
- ref,
698
- className: (0, import_utils7.cx)(className, polarGridClassName),
699
- strokeDasharray,
700
- ...props,
701
- ...polarGridProps
702
- }),
703
- [polarGridClassName, polarGridProps, strokeDasharray]
704
- );
705
- const getPolarAngleAxisProps = (0, import_react4.useCallback)(
725
+ const getPolarAngleAxisProps = (0, import_react5.useCallback)(
706
726
  ({ className, ...props } = {}, ref = null) => ({
707
727
  ref,
708
- className: (0, import_utils7.cx)(className, polarAngleAxisClassName),
728
+ className: (0, import_utils8.cx)(className, polarAngleAxisClassName),
709
729
  dataKey,
710
730
  tick: {
711
- className: (0, import_utils7.cx)(
731
+ className: (0, import_utils8.cx)(
712
732
  "ui-radar-chart__polar-angle-axis-tick",
713
733
  polarAngleAxisTickClassName
714
734
  )
@@ -726,12 +746,12 @@ var useRadarChart = ({
726
746
  polarAngleAxisTickFormatter
727
747
  ]
728
748
  );
729
- const getPolarRadiusAxisProps = (0, import_react4.useCallback)(
749
+ const getPolarRadiusAxisProps = (0, import_react5.useCallback)(
730
750
  ({ className, ...props } = {}, ref = null) => ({
731
751
  ref,
732
- className: (0, import_utils7.cx)(className, polarRadiusAxisClassName),
752
+ className: (0, import_utils8.cx)(className, polarRadiusAxisClassName),
733
753
  tick: {
734
- className: (0, import_utils7.cx)(
754
+ className: (0, import_utils8.cx)(
735
755
  "ui-radar-chart__polar-radius-axis-tick",
736
756
  polarRadiusAxisTickClassName
737
757
  )
@@ -751,7 +771,6 @@ var useRadarChart = ({
751
771
  radarVars,
752
772
  getRadarChartProps,
753
773
  getRadarProps,
754
- getPolarGridProps,
755
774
  getPolarAngleAxisProps,
756
775
  getPolarRadiusAxisProps,
757
776
  setHighlightedArea
@@ -760,8 +779,8 @@ var useRadarChart = ({
760
779
 
761
780
  // src/radar-chart.tsx
762
781
  var import_jsx_runtime3 = require("react/jsx-runtime");
763
- var RadarChart = (0, import_core7.forwardRef)((props, ref) => {
764
- const [styles, mergedProps] = (0, import_core7.useMultiComponentStyle)("RadarChart", props);
782
+ var RadarChart = (0, import_core8.forwardRef)((props, ref) => {
783
+ const [styles, mergedProps] = (0, import_core8.useMultiComponentStyle)("RadarChart", props);
765
784
  const {
766
785
  className,
767
786
  data,
@@ -793,11 +812,10 @@ var RadarChart = (0, import_core7.forwardRef)((props, ref) => {
793
812
  withPolarAngleAxis = true,
794
813
  withPolarRadiusAxis = false,
795
814
  ...rest
796
- } = (0, import_core7.omitThemeProps)(mergedProps);
815
+ } = (0, import_core8.omitThemeProps)(mergedProps);
797
816
  const {
798
817
  getRadarProps,
799
818
  getRadarChartProps,
800
- getPolarGridProps,
801
819
  getPolarAngleAxisProps,
802
820
  getPolarRadiusAxisProps,
803
821
  radarVars,
@@ -808,7 +826,6 @@ var RadarChart = (0, import_core7.forwardRef)((props, ref) => {
808
826
  dataKey,
809
827
  radarProps,
810
828
  chartProps,
811
- polarGridProps,
812
829
  polarAngleAxisProps,
813
830
  polarAngleAxisTickProps,
814
831
  polarRadiusAxisProps,
@@ -819,7 +836,6 @@ var RadarChart = (0, import_core7.forwardRef)((props, ref) => {
819
836
  fillOpacity,
820
837
  polarAngleAxisTickFormatter,
821
838
  polarRadiusAxisTickFormatter,
822
- strokeDasharray,
823
839
  styles
824
840
  });
825
841
  const { getContainerProps } = useChart({ containerProps });
@@ -831,7 +847,12 @@ var RadarChart = (0, import_core7.forwardRef)((props, ref) => {
831
847
  const { legendProps: computedLegendProps, getLegendProps } = useChartLegend({
832
848
  legendProps
833
849
  });
834
- const radars = (0, import_react5.useMemo)(
850
+ const { getPolarGridProps } = usePolarGrid({
851
+ polarGridProps,
852
+ strokeDasharray,
853
+ styles
854
+ });
855
+ const radars = (0, import_react6.useMemo)(
835
856
  () => series.map(({ dataKey: dataKey2 }, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
836
857
  import_recharts.Radar,
837
858
  {
@@ -842,12 +863,11 @@ var RadarChart = (0, import_core7.forwardRef)((props, ref) => {
842
863
  [getRadarProps, series]
843
864
  );
844
865
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ChartProvider, { value: { styles }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
845
- import_core7.ui.div,
866
+ import_core8.ui.div,
846
867
  {
847
868
  ref,
848
- className: (0, import_utils8.cx)("ui-radar-chart", className),
849
- var: radarVars,
850
- __css: { ...styles.container },
869
+ className: (0, import_utils9.cx)("ui-radar-chart", className),
870
+ __css: { maxW: "full", vars: radarVars, ...styles.container },
851
871
  ...rest,
852
872
  children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
853
873
  import_recharts.ResponsiveContainer,