@yamada-ui/charts 1.5.0-dev-20240825095648 → 1.5.0-dev-20240825115929

Sign up to get free protection for your applications and to get access to all the features.
Files changed (195) hide show
  1. package/dist/area-chart-split.js +4 -2
  2. package/dist/area-chart-split.js.map +1 -1
  3. package/dist/area-chart-split.mjs +1 -1
  4. package/dist/area-chart.d.mts +0 -1
  5. package/dist/area-chart.d.ts +0 -1
  6. package/dist/area-chart.js +56 -48
  7. package/dist/area-chart.js.map +1 -1
  8. package/dist/area-chart.mjs +12 -12
  9. package/dist/bar-chart.d.mts +0 -1
  10. package/dist/bar-chart.d.ts +0 -1
  11. package/dist/bar-chart.js +13 -7
  12. package/dist/bar-chart.js.map +1 -1
  13. package/dist/bar-chart.mjs +11 -11
  14. package/dist/chart-legend.mjs +3 -3
  15. package/dist/chart-tooltip.d.mts +3 -1
  16. package/dist/chart-tooltip.d.ts +3 -1
  17. package/dist/chart-tooltip.js +9 -1
  18. package/dist/chart-tooltip.js.map +1 -1
  19. package/dist/chart-tooltip.mjs +3 -3
  20. package/dist/chart.types.d.mts +9 -4
  21. package/dist/chart.types.d.ts +9 -4
  22. package/dist/chart.types.js.map +1 -1
  23. package/dist/{chunk-STBYN5JW.mjs → chunk-3AOICU4Q.mjs} +2 -2
  24. package/dist/chunk-3HQ2UC3I.mjs +45 -0
  25. package/dist/chunk-3HQ2UC3I.mjs.map +1 -0
  26. package/dist/{chunk-FIWHBTKQ.mjs → chunk-6IEXTVWL.mjs} +7 -9
  27. package/dist/chunk-6IEXTVWL.mjs.map +1 -0
  28. package/dist/{chunk-F34FV5DY.mjs → chunk-6YUJLLGN.mjs} +59 -3
  29. package/dist/chunk-6YUJLLGN.mjs.map +1 -0
  30. package/dist/{chunk-LHW3WK3C.mjs → chunk-AJYZ7MDC.mjs} +6 -30
  31. package/dist/chunk-AJYZ7MDC.mjs.map +1 -0
  32. package/dist/chunk-D5IRVU4W.mjs +46 -0
  33. package/dist/chunk-D5IRVU4W.mjs.map +1 -0
  34. package/dist/{chunk-DGOXJ373.mjs → chunk-EL2VTGFB.mjs} +2 -2
  35. package/dist/chunk-EL6SJYI5.mjs +200 -0
  36. package/dist/chunk-EL6SJYI5.mjs.map +1 -0
  37. package/dist/{chunk-LF3ENX7Z.mjs → chunk-FQTDUZK2.mjs} +16 -11
  38. package/dist/chunk-FQTDUZK2.mjs.map +1 -0
  39. package/dist/{chunk-Q7CCSKX3.mjs → chunk-JTQ5QCML.mjs} +4 -4
  40. package/dist/chunk-JTQ5QCML.mjs.map +1 -0
  41. package/dist/{chunk-7HKRIEAT.mjs → chunk-KBZKJSZJ.mjs} +10 -10
  42. package/dist/{chunk-5XSML5U3.mjs → chunk-KVE6VXTJ.mjs} +2 -2
  43. package/dist/{chunk-PNE3JG54.mjs → chunk-MGTMKKSH.mjs} +5 -3
  44. package/dist/chunk-MGTMKKSH.mjs.map +1 -0
  45. package/dist/chunk-NUAKNL26.mjs +155 -0
  46. package/dist/chunk-NUAKNL26.mjs.map +1 -0
  47. package/dist/{chunk-QNX4DJVS.mjs → chunk-OOSVO2GS.mjs} +12 -12
  48. package/dist/{chunk-WY5PI2CR.mjs → chunk-PBPH3WDW.mjs} +12 -12
  49. package/dist/{chunk-D7EZKGCJ.mjs → chunk-PPBHLDVN.mjs} +2 -2
  50. package/dist/{chunk-IF4O4CBA.mjs → chunk-PSPBUPC7.mjs} +9 -7
  51. package/dist/chunk-PSPBUPC7.mjs.map +1 -0
  52. package/dist/{chunk-DKZISSE6.mjs → chunk-S6C5VMIZ.mjs} +13 -13
  53. package/dist/{chunk-MT5JI4OR.mjs → chunk-T5DNDBW6.mjs} +11 -3
  54. package/dist/chunk-T5DNDBW6.mjs.map +1 -0
  55. package/dist/{chunk-5Q6O726L.mjs → chunk-TCSYDMC7.mjs} +2 -2
  56. package/dist/{chunk-6ICKO7GY.mjs → chunk-TQRELNDO.mjs} +6 -8
  57. package/dist/chunk-TQRELNDO.mjs.map +1 -0
  58. package/dist/{chunk-AOGTJ4EN.mjs → chunk-VMBRDEM2.mjs} +2 -2
  59. package/dist/{chunk-BNTTQQFO.mjs → chunk-VMKJ4Z46.mjs} +9 -9
  60. package/dist/chunk-VMKJ4Z46.mjs.map +1 -0
  61. package/dist/{chunk-WPJDHMPD.mjs → chunk-YASR4L6D.mjs} +10 -12
  62. package/dist/chunk-YASR4L6D.mjs.map +1 -0
  63. package/dist/{chunk-VK4VQQYY.mjs → chunk-YNJ423BR.mjs} +2 -2
  64. package/dist/donut-chart.d.mts +0 -1
  65. package/dist/donut-chart.d.ts +0 -1
  66. package/dist/donut-chart.js +12 -5
  67. package/dist/donut-chart.js.map +1 -1
  68. package/dist/donut-chart.mjs +9 -9
  69. package/dist/index.d.mts +4 -1
  70. package/dist/index.d.ts +4 -1
  71. package/dist/index.js +563 -160
  72. package/dist/index.js.map +1 -1
  73. package/dist/index.mjs +30 -23
  74. package/dist/index.mjs.map +1 -1
  75. package/dist/line-chart.d.mts +0 -1
  76. package/dist/line-chart.d.ts +0 -1
  77. package/dist/line-chart.js +14 -8
  78. package/dist/line-chart.js.map +1 -1
  79. package/dist/line-chart.mjs +11 -11
  80. package/dist/pie-chart.d.mts +1 -2
  81. package/dist/pie-chart.d.ts +1 -2
  82. package/dist/pie-chart.js +12 -5
  83. package/dist/pie-chart.js.map +1 -1
  84. package/dist/pie-chart.mjs +8 -8
  85. package/dist/radar-chart.d.mts +2 -2
  86. package/dist/radar-chart.d.ts +2 -2
  87. package/dist/radar-chart.js +89 -68
  88. package/dist/radar-chart.js.map +1 -1
  89. package/dist/radar-chart.mjs +9 -8
  90. package/dist/radial-chart.d.mts +53 -0
  91. package/dist/radial-chart.d.ts +53 -0
  92. package/dist/radial-chart.js +768 -0
  93. package/dist/radial-chart.js.map +1 -0
  94. package/dist/radial-chart.mjs +18 -0
  95. package/dist/radial-chart.mjs.map +1 -0
  96. package/dist/rechart-properties.d.mts +5 -1
  97. package/dist/rechart-properties.d.ts +5 -1
  98. package/dist/rechart-properties.js +60 -1
  99. package/dist/rechart-properties.js.map +1 -1
  100. package/dist/rechart-properties.mjs +7 -1
  101. package/dist/use-area-chart.d.mts +0 -1
  102. package/dist/use-area-chart.d.ts +0 -1
  103. package/dist/use-area-chart.js +7 -9
  104. package/dist/use-area-chart.js.map +1 -1
  105. package/dist/use-area-chart.mjs +2 -2
  106. package/dist/use-bar-chart.d.mts +0 -1
  107. package/dist/use-bar-chart.d.ts +0 -1
  108. package/dist/use-bar-chart.js +3 -5
  109. package/dist/use-bar-chart.js.map +1 -1
  110. package/dist/use-bar-chart.mjs +2 -2
  111. package/dist/use-chart-axis.d.mts +0 -1
  112. package/dist/use-chart-axis.d.ts +0 -1
  113. package/dist/use-chart-axis.js.map +1 -1
  114. package/dist/use-chart-axis.mjs +2 -2
  115. package/dist/use-chart-grid.d.mts +0 -1
  116. package/dist/use-chart-grid.d.ts +0 -1
  117. package/dist/use-chart-grid.js.map +1 -1
  118. package/dist/use-chart-grid.mjs +2 -2
  119. package/dist/use-chart-label-list.d.mts +22 -0
  120. package/dist/use-chart-label-list.d.ts +22 -0
  121. package/dist/use-chart-label-list.js +93 -0
  122. package/dist/use-chart-label-list.js.map +1 -0
  123. package/dist/use-chart-label-list.mjs +10 -0
  124. package/dist/use-chart-label-list.mjs.map +1 -0
  125. package/dist/use-chart-label.d.mts +0 -1
  126. package/dist/use-chart-label.d.ts +0 -1
  127. package/dist/use-chart-label.js.map +1 -1
  128. package/dist/use-chart-label.mjs +2 -2
  129. package/dist/use-chart-legend.d.mts +0 -1
  130. package/dist/use-chart-legend.d.ts +0 -1
  131. package/dist/use-chart-legend.js.map +1 -1
  132. package/dist/use-chart-legend.mjs +2 -2
  133. package/dist/use-chart-reference-line.d.mts +0 -1
  134. package/dist/use-chart-reference-line.d.ts +0 -1
  135. package/dist/use-chart-reference-line.js +1 -1
  136. package/dist/use-chart-reference-line.js.map +1 -1
  137. package/dist/use-chart-reference-line.mjs +2 -2
  138. package/dist/use-chart-tooltip.d.mts +0 -1
  139. package/dist/use-chart-tooltip.d.ts +0 -1
  140. package/dist/use-chart-tooltip.js.map +1 -1
  141. package/dist/use-chart-tooltip.mjs +2 -2
  142. package/dist/use-chart.d.mts +0 -1
  143. package/dist/use-chart.d.ts +0 -1
  144. package/dist/use-chart.js.map +1 -1
  145. package/dist/use-chart.mjs +2 -2
  146. package/dist/use-line-chart.d.mts +0 -1
  147. package/dist/use-line-chart.d.ts +0 -1
  148. package/dist/use-line-chart.js +4 -6
  149. package/dist/use-line-chart.js.map +1 -1
  150. package/dist/use-line-chart.mjs +2 -2
  151. package/dist/use-pie-chart.d.mts +0 -1
  152. package/dist/use-pie-chart.d.ts +0 -1
  153. package/dist/use-pie-chart.js +3 -4
  154. package/dist/use-pie-chart.js.map +1 -1
  155. package/dist/use-pie-chart.mjs +2 -2
  156. package/dist/use-polar-grid.d.mts +24 -0
  157. package/dist/use-polar-grid.d.ts +24 -0
  158. package/dist/use-polar-grid.js +90 -0
  159. package/dist/use-polar-grid.js.map +1 -0
  160. package/dist/use-polar-grid.mjs +10 -0
  161. package/dist/use-polar-grid.mjs.map +1 -0
  162. package/dist/use-radar-chart.d.mts +2 -12
  163. package/dist/use-radar-chart.d.ts +2 -12
  164. package/dist/use-radar-chart.js +3 -35
  165. package/dist/use-radar-chart.js.map +1 -1
  166. package/dist/use-radar-chart.mjs +2 -2
  167. package/dist/use-radial-chart.d.mts +80 -0
  168. package/dist/use-radial-chart.d.ts +80 -0
  169. package/dist/use-radial-chart.js +228 -0
  170. package/dist/use-radial-chart.js.map +1 -0
  171. package/dist/use-radial-chart.mjs +10 -0
  172. package/dist/use-radial-chart.mjs.map +1 -0
  173. package/package.json +3 -3
  174. package/dist/chunk-6ICKO7GY.mjs.map +0 -1
  175. package/dist/chunk-BNTTQQFO.mjs.map +0 -1
  176. package/dist/chunk-F34FV5DY.mjs.map +0 -1
  177. package/dist/chunk-FIWHBTKQ.mjs.map +0 -1
  178. package/dist/chunk-IF4O4CBA.mjs.map +0 -1
  179. package/dist/chunk-LF3ENX7Z.mjs.map +0 -1
  180. package/dist/chunk-LHW3WK3C.mjs.map +0 -1
  181. package/dist/chunk-MT5JI4OR.mjs.map +0 -1
  182. package/dist/chunk-PNE3JG54.mjs.map +0 -1
  183. package/dist/chunk-Q7CCSKX3.mjs.map +0 -1
  184. package/dist/chunk-WPJDHMPD.mjs.map +0 -1
  185. /package/dist/{chunk-STBYN5JW.mjs.map → chunk-3AOICU4Q.mjs.map} +0 -0
  186. /package/dist/{chunk-DGOXJ373.mjs.map → chunk-EL2VTGFB.mjs.map} +0 -0
  187. /package/dist/{chunk-7HKRIEAT.mjs.map → chunk-KBZKJSZJ.mjs.map} +0 -0
  188. /package/dist/{chunk-5XSML5U3.mjs.map → chunk-KVE6VXTJ.mjs.map} +0 -0
  189. /package/dist/{chunk-QNX4DJVS.mjs.map → chunk-OOSVO2GS.mjs.map} +0 -0
  190. /package/dist/{chunk-WY5PI2CR.mjs.map → chunk-PBPH3WDW.mjs.map} +0 -0
  191. /package/dist/{chunk-D7EZKGCJ.mjs.map → chunk-PPBHLDVN.mjs.map} +0 -0
  192. /package/dist/{chunk-DKZISSE6.mjs.map → chunk-S6C5VMIZ.mjs.map} +0 -0
  193. /package/dist/{chunk-5Q6O726L.mjs.map → chunk-TCSYDMC7.mjs.map} +0 -0
  194. /package/dist/{chunk-AOGTJ4EN.mjs.map → chunk-VMBRDEM2.mjs.map} +0 -0
  195. /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,7 +571,7 @@ 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
  const resolvedDimRadar = {
546
576
  fillOpacity: 0.3,
547
577
  strokeOpacity: 0.3,
@@ -551,27 +581,27 @@ var useRadarChart = ({
551
581
  theme
552
582
  );
553
583
  }, [dimRadar, theme]);
554
- const [dotProps, dotClassName] = (0, import_react4.useMemo)(() => {
584
+ const [dotProps, dotClassName] = (0, import_react5.useMemo)(() => {
555
585
  const resolvedDot = { fillOpacity: 1, strokeWidth: 2, ...dot };
556
586
  return getComponentProps(
557
587
  [resolvedDot, dotProperties],
558
588
  styles.dot
559
589
  )(theme);
560
590
  }, [dot, styles.dot, theme]);
561
- const [activeDotProps, activeDotClassName] = (0, import_react4.useMemo)(
591
+ const [activeDotProps, activeDotClassName] = (0, import_react5.useMemo)(
562
592
  () => getComponentProps(
563
593
  [activeDot, dotProperties],
564
594
  styles.activeDot
565
595
  )(theme),
566
596
  [activeDot, styles.activeDot, theme]
567
597
  );
568
- const [dimDotProps, dimDotClassName] = (0, import_react4.useMemo)(() => {
598
+ const [dimDotProps, dimDotClassName] = (0, import_react5.useMemo)(() => {
569
599
  const resolvedDimDot = { fillOpacity: 0, strokeOpacity: 0, ...dimDot };
570
600
  return getComponentProps([resolvedDimDot, dotProperties])(
571
601
  theme
572
602
  );
573
603
  }, [dimDot, theme]);
574
- const radarPropList = (0, import_react4.useMemo)(
604
+ const radarPropList = (0, import_react5.useMemo)(
575
605
  () => series.map((props, index) => {
576
606
  const {
577
607
  dataKey: dataKey2,
@@ -581,7 +611,7 @@ var useRadarChart = ({
581
611
  dimRadar: dimRadar2 = {},
582
612
  ...computedProps
583
613
  } = props;
584
- const color = `var(--ui-radar-${index})`;
614
+ const color = (0, import_core7.getVar)(`radar-${index}`)(theme);
585
615
  const dimmed = shouldHighlight && highlightedArea !== dataKey2;
586
616
  const computedDimRadar = { ...dimRadarProps, ...dimRadar2 };
587
617
  const resolvedProps = {
@@ -605,7 +635,7 @@ var useRadarChart = ({
605
635
  activeDotClassName
606
636
  )(theme);
607
637
  resolvedActiveDot = {
608
- className: (0, import_utils7.cx)("ui-radar-chart__active-dot", className),
638
+ className: (0, import_utils8.cx)("ui-radar-chart__active-dot", className),
609
639
  fill: color,
610
640
  stroke: color,
611
641
  r: 4,
@@ -628,7 +658,7 @@ var useRadarChart = ({
628
658
  dimmed ? dimDotClassName : void 0
629
659
  )(theme);
630
660
  resolvedDot = {
631
- className: (0, import_utils7.cx)("ui-radar-chart__dot", className),
661
+ className: (0, import_utils8.cx)("ui-radar-chart__dot", className),
632
662
  fill: color,
633
663
  r: 4,
634
664
  ...rest3
@@ -663,22 +693,22 @@ var useRadarChart = ({
663
693
  withDots
664
694
  ]
665
695
  );
666
- const getRadarChartProps = (0, import_react4.useCallback)(
696
+ const getRadarChartProps = (0, import_react5.useCallback)(
667
697
  ({ className, ...props } = {}, ref = null) => ({
668
698
  ref,
669
- className: (0, import_utils7.cx)(className, radarChartClassName),
699
+ className: (0, import_utils8.cx)(className, radarChartClassName),
670
700
  data,
671
701
  ...props,
672
702
  ...chartProps
673
703
  }),
674
704
  [data, radarChartClassName, chartProps]
675
705
  );
676
- const getRadarProps = (0, import_react4.useCallback)(
706
+ const getRadarProps = (0, import_react5.useCallback)(
677
707
  ({ index, className: classNameProp, ...props }, ref = null) => {
678
708
  const { color, className, dataKey: dataKey2, activeDot: activeDot2, dot: dot2, ...rest2 } = radarPropList[index];
679
709
  return {
680
710
  ref,
681
- className: (0, import_utils7.cx)(classNameProp, className),
711
+ className: (0, import_utils8.cx)(classNameProp, className),
682
712
  activeDot: activeDot2,
683
713
  dot: dot2,
684
714
  name: dataKey2,
@@ -693,23 +723,13 @@ var useRadarChart = ({
693
723
  },
694
724
  [radarPropList, strokeWidth]
695
725
  );
696
- const getPolarGridProps = (0, import_react4.useCallback)(
697
- ({ className, ...props } = {}, ref = null) => ({
698
- ref,
699
- className: (0, import_utils7.cx)(className, polarGridClassName),
700
- strokeDasharray,
701
- ...props,
702
- ...polarGridProps
703
- }),
704
- [polarGridClassName, polarGridProps, strokeDasharray]
705
- );
706
- const getPolarAngleAxisProps = (0, import_react4.useCallback)(
726
+ const getPolarAngleAxisProps = (0, import_react5.useCallback)(
707
727
  ({ className, ...props } = {}, ref = null) => ({
708
728
  ref,
709
- className: (0, import_utils7.cx)(className, polarAngleAxisClassName),
729
+ className: (0, import_utils8.cx)(className, polarAngleAxisClassName),
710
730
  dataKey,
711
731
  tick: {
712
- className: (0, import_utils7.cx)(
732
+ className: (0, import_utils8.cx)(
713
733
  "ui-radar-chart__polar-angle-axis-tick",
714
734
  polarAngleAxisTickClassName
715
735
  )
@@ -727,12 +747,12 @@ var useRadarChart = ({
727
747
  polarAngleAxisTickFormatter
728
748
  ]
729
749
  );
730
- const getPolarRadiusAxisProps = (0, import_react4.useCallback)(
750
+ const getPolarRadiusAxisProps = (0, import_react5.useCallback)(
731
751
  ({ className, ...props } = {}, ref = null) => ({
732
752
  ref,
733
- className: (0, import_utils7.cx)(className, polarRadiusAxisClassName),
753
+ className: (0, import_utils8.cx)(className, polarRadiusAxisClassName),
734
754
  tick: {
735
- className: (0, import_utils7.cx)(
755
+ className: (0, import_utils8.cx)(
736
756
  "ui-radar-chart__polar-radius-axis-tick",
737
757
  polarRadiusAxisTickClassName
738
758
  )
@@ -752,7 +772,6 @@ var useRadarChart = ({
752
772
  radarVars,
753
773
  getRadarChartProps,
754
774
  getRadarProps,
755
- getPolarGridProps,
756
775
  getPolarAngleAxisProps,
757
776
  getPolarRadiusAxisProps,
758
777
  setHighlightedArea
@@ -761,8 +780,8 @@ var useRadarChart = ({
761
780
 
762
781
  // src/radar-chart.tsx
763
782
  var import_jsx_runtime3 = require("react/jsx-runtime");
764
- var RadarChart = (0, import_core7.forwardRef)((props, ref) => {
765
- const [styles, mergedProps] = (0, import_core7.useMultiComponentStyle)("RadarChart", props);
783
+ var RadarChart = (0, import_core8.forwardRef)((props, ref) => {
784
+ const [styles, mergedProps] = (0, import_core8.useMultiComponentStyle)("RadarChart", props);
766
785
  const {
767
786
  className,
768
787
  data,
@@ -794,11 +813,10 @@ var RadarChart = (0, import_core7.forwardRef)((props, ref) => {
794
813
  withPolarAngleAxis = true,
795
814
  withPolarRadiusAxis = false,
796
815
  ...rest
797
- } = (0, import_core7.omitThemeProps)(mergedProps);
816
+ } = (0, import_core8.omitThemeProps)(mergedProps);
798
817
  const {
799
818
  getRadarProps,
800
819
  getRadarChartProps,
801
- getPolarGridProps,
802
820
  getPolarAngleAxisProps,
803
821
  getPolarRadiusAxisProps,
804
822
  radarVars,
@@ -809,7 +827,6 @@ var RadarChart = (0, import_core7.forwardRef)((props, ref) => {
809
827
  dataKey,
810
828
  radarProps,
811
829
  chartProps,
812
- polarGridProps,
813
830
  polarAngleAxisProps,
814
831
  polarAngleAxisTickProps,
815
832
  polarRadiusAxisProps,
@@ -820,7 +837,6 @@ var RadarChart = (0, import_core7.forwardRef)((props, ref) => {
820
837
  fillOpacity,
821
838
  polarAngleAxisTickFormatter,
822
839
  polarRadiusAxisTickFormatter,
823
- strokeDasharray,
824
840
  styles
825
841
  });
826
842
  const { getContainerProps } = useChart({ containerProps });
@@ -832,7 +848,12 @@ var RadarChart = (0, import_core7.forwardRef)((props, ref) => {
832
848
  const { legendProps: computedLegendProps, getLegendProps } = useChartLegend({
833
849
  legendProps
834
850
  });
835
- const radars = (0, import_react5.useMemo)(
851
+ const { getPolarGridProps } = usePolarGrid({
852
+ polarGridProps,
853
+ strokeDasharray,
854
+ styles
855
+ });
856
+ const radars = (0, import_react6.useMemo)(
836
857
  () => series.map(({ dataKey: dataKey2 }, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
837
858
  import_recharts.Radar,
838
859
  {
@@ -843,10 +864,10 @@ var RadarChart = (0, import_core7.forwardRef)((props, ref) => {
843
864
  [getRadarProps, series]
844
865
  );
845
866
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ChartProvider, { value: { styles }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
846
- import_core7.ui.div,
867
+ import_core8.ui.div,
847
868
  {
848
869
  ref,
849
- className: (0, import_utils8.cx)("ui-radar-chart", className),
870
+ className: (0, import_utils9.cx)("ui-radar-chart", className),
850
871
  var: radarVars,
851
872
  __css: { maxW: "full", ...styles.container },
852
873
  ...rest,