@yamada-ui/charts 1.5.4-dev-20241005224505 → 1.5.4-dev-20241006000212

Sign up to get free protection for your applications and to get access to all the features.
Files changed (222) hide show
  1. package/dist/area-chart-gradient.d.mts +1 -1
  2. package/dist/area-chart-gradient.d.ts +1 -1
  3. package/dist/area-chart-gradient.js +5 -5
  4. package/dist/area-chart-gradient.js.map +1 -1
  5. package/dist/area-chart-gradient.mjs +1 -1
  6. package/dist/area-chart-split.d.mts +1 -1
  7. package/dist/area-chart-split.d.ts +1 -1
  8. package/dist/area-chart-split.js +2 -2
  9. package/dist/area-chart-split.js.map +1 -1
  10. package/dist/area-chart-split.mjs +1 -1
  11. package/dist/area-chart.d.mts +8 -8
  12. package/dist/area-chart.d.ts +8 -8
  13. package/dist/area-chart.js +180 -175
  14. package/dist/area-chart.js.map +1 -1
  15. package/dist/area-chart.mjs +13 -13
  16. package/dist/bar-chart.d.mts +8 -8
  17. package/dist/bar-chart.d.ts +8 -8
  18. package/dist/bar-chart.js +137 -127
  19. package/dist/bar-chart.js.map +1 -1
  20. package/dist/bar-chart.mjs +11 -11
  21. package/dist/chart-legend.d.mts +1 -1
  22. package/dist/chart-legend.d.ts +1 -1
  23. package/dist/chart-legend.js +2 -2
  24. package/dist/chart-legend.js.map +1 -1
  25. package/dist/chart-legend.mjs +3 -3
  26. package/dist/chart-tooltip.d.mts +4 -4
  27. package/dist/chart-tooltip.d.ts +4 -4
  28. package/dist/chart-tooltip.js +7 -7
  29. package/dist/chart-tooltip.js.map +1 -1
  30. package/dist/chart-tooltip.mjs +3 -3
  31. package/dist/chart-utils.js.map +1 -1
  32. package/dist/chart-utils.mjs +1 -1
  33. package/dist/chart.types.d.mts +14 -14
  34. package/dist/chart.types.d.ts +14 -14
  35. package/dist/chart.types.js.map +1 -1
  36. package/dist/{chunk-YSPGYMRF.mjs → chunk-5VLSGWQD.mjs} +8 -8
  37. package/dist/{chunk-YSPGYMRF.mjs.map → chunk-5VLSGWQD.mjs.map} +1 -1
  38. package/dist/{chunk-XYUYAHJX.mjs → chunk-6JRMEI6J.mjs} +2 -2
  39. package/dist/chunk-6JRMEI6J.mjs.map +1 -0
  40. package/dist/{chunk-VKBRU4Z4.mjs → chunk-AYVTBRCS.mjs} +29 -28
  41. package/dist/chunk-AYVTBRCS.mjs.map +1 -0
  42. package/dist/{chunk-6O5G3WYP.mjs → chunk-EZG52466.mjs} +29 -21
  43. package/dist/chunk-EZG52466.mjs.map +1 -0
  44. package/dist/{chunk-VEFEKDMH.mjs → chunk-FDALM73K.mjs} +15 -14
  45. package/dist/chunk-FDALM73K.mjs.map +1 -0
  46. package/dist/{chunk-2GQHI23M.mjs → chunk-GU4SGNWX.mjs} +5 -5
  47. package/dist/chunk-GU4SGNWX.mjs.map +1 -0
  48. package/dist/{chunk-MVRWZTQ5.mjs → chunk-NLXYCM5J.mjs} +2 -2
  49. package/dist/chunk-NLXYCM5J.mjs.map +1 -0
  50. package/dist/{chunk-54WAXZP7.mjs → chunk-NMPNNSBN.mjs} +74 -74
  51. package/dist/chunk-NMPNNSBN.mjs.map +1 -0
  52. package/dist/{chunk-OEM3VCHN.mjs → chunk-NQPC5LPY.mjs} +82 -82
  53. package/dist/chunk-NQPC5LPY.mjs.map +1 -0
  54. package/dist/{chunk-AYVZF37W.mjs → chunk-OG5CVPPV.mjs} +3 -3
  55. package/dist/chunk-OG5CVPPV.mjs.map +1 -0
  56. package/dist/{chunk-X6CD7LHX.mjs → chunk-OUIKA4AX.mjs} +3 -3
  57. package/dist/{chunk-X6CD7LHX.mjs.map → chunk-OUIKA4AX.mjs.map} +1 -1
  58. package/dist/{chunk-3EHZJFIA.mjs → chunk-PKQB4BFG.mjs} +28 -28
  59. package/dist/chunk-PKQB4BFG.mjs.map +1 -0
  60. package/dist/{chunk-C3ZYUDXE.mjs → chunk-QPMW56KA.mjs} +52 -48
  61. package/dist/chunk-QPMW56KA.mjs.map +1 -0
  62. package/dist/{chunk-IJRYXT4V.mjs → chunk-R2LOTDR3.mjs} +2 -2
  63. package/dist/{chunk-IJRYXT4V.mjs.map → chunk-R2LOTDR3.mjs.map} +1 -1
  64. package/dist/{chunk-6OYWQ3NO.mjs → chunk-SCY5V45W.mjs} +56 -56
  65. package/dist/chunk-SCY5V45W.mjs.map +1 -0
  66. package/dist/{chunk-CQTRL3BW.mjs → chunk-SYBJTMPL.mjs} +90 -90
  67. package/dist/chunk-SYBJTMPL.mjs.map +1 -0
  68. package/dist/{chunk-XKVM7WUW.mjs → chunk-TA7YJAW4.mjs} +47 -47
  69. package/dist/{chunk-XKVM7WUW.mjs.map → chunk-TA7YJAW4.mjs.map} +1 -1
  70. package/dist/{chunk-O3LMKYXK.mjs → chunk-TU6MKMMV.mjs} +29 -28
  71. package/dist/chunk-TU6MKMMV.mjs.map +1 -0
  72. package/dist/{chunk-QL3DB7OJ.mjs → chunk-TXNC7GLT.mjs} +1 -1
  73. package/dist/{chunk-QL3DB7OJ.mjs.map → chunk-TXNC7GLT.mjs.map} +1 -1
  74. package/dist/{chunk-EE6KEX6V.mjs → chunk-U325CYNR.mjs} +6 -6
  75. package/dist/chunk-U325CYNR.mjs.map +1 -0
  76. package/dist/{chunk-OPPMMNGP.mjs → chunk-UER5GW4M.mjs} +33 -24
  77. package/dist/chunk-UER5GW4M.mjs.map +1 -0
  78. package/dist/{chunk-FYAC4RRZ.mjs → chunk-UTD4XZDM.mjs} +11 -10
  79. package/dist/chunk-UTD4XZDM.mjs.map +1 -0
  80. package/dist/{chunk-A3IWA366.mjs → chunk-VK65X6Q2.mjs} +4 -4
  81. package/dist/chunk-VK65X6Q2.mjs.map +1 -0
  82. package/dist/{chunk-OJ2MLZZ7.mjs → chunk-X6PIY2M3.mjs} +7 -7
  83. package/dist/chunk-X6PIY2M3.mjs.map +1 -0
  84. package/dist/{chunk-MSG3WFBO.mjs → chunk-YIAK5DIM.mjs} +7 -6
  85. package/dist/chunk-YIAK5DIM.mjs.map +1 -0
  86. package/dist/{chunk-NETTMC2D.mjs → chunk-YTUEG4IY.mjs} +45 -45
  87. package/dist/chunk-YTUEG4IY.mjs.map +1 -0
  88. package/dist/{chunk-VUTCH2CU.mjs → chunk-YX23LEQ7.mjs} +13 -13
  89. package/dist/chunk-YX23LEQ7.mjs.map +1 -0
  90. package/dist/{chunk-DZL5KQOJ.mjs → chunk-ZRV4LO67.mjs} +42 -42
  91. package/dist/chunk-ZRV4LO67.mjs.map +1 -0
  92. package/dist/donut-chart.js +91 -89
  93. package/dist/donut-chart.js.map +1 -1
  94. package/dist/donut-chart.mjs +10 -10
  95. package/dist/index.d.mts +14 -14
  96. package/dist/index.d.ts +14 -14
  97. package/dist/index.js +2069 -2043
  98. package/dist/index.js.map +1 -1
  99. package/dist/index.mjs +28 -28
  100. package/dist/index.mjs.map +1 -1
  101. package/dist/line-chart.d.mts +7 -7
  102. package/dist/line-chart.d.ts +7 -7
  103. package/dist/line-chart.js +140 -138
  104. package/dist/line-chart.js.map +1 -1
  105. package/dist/line-chart.mjs +11 -11
  106. package/dist/pie-chart-label.d.mts +9 -9
  107. package/dist/pie-chart-label.d.ts +9 -9
  108. package/dist/pie-chart-label.js +14 -13
  109. package/dist/pie-chart-label.js.map +1 -1
  110. package/dist/pie-chart-label.mjs +1 -1
  111. package/dist/pie-chart.d.mts +11 -11
  112. package/dist/pie-chart.d.ts +11 -11
  113. package/dist/pie-chart.js +89 -87
  114. package/dist/pie-chart.js.map +1 -1
  115. package/dist/pie-chart.mjs +9 -9
  116. package/dist/radar-chart.d.mts +11 -11
  117. package/dist/radar-chart.d.ts +11 -11
  118. package/dist/radar-chart.js +81 -73
  119. package/dist/radar-chart.js.map +1 -1
  120. package/dist/radar-chart.mjs +9 -9
  121. package/dist/radial-chart.d.mts +10 -10
  122. package/dist/radial-chart.d.ts +10 -10
  123. package/dist/radial-chart.js +63 -62
  124. package/dist/radial-chart.js.map +1 -1
  125. package/dist/radial-chart.mjs +10 -10
  126. package/dist/use-area-chart.d.mts +53 -53
  127. package/dist/use-area-chart.d.ts +53 -53
  128. package/dist/use-area-chart.js +50 -46
  129. package/dist/use-area-chart.js.map +1 -1
  130. package/dist/use-area-chart.mjs +2 -2
  131. package/dist/use-bar-chart.d.mts +32 -32
  132. package/dist/use-bar-chart.d.ts +32 -32
  133. package/dist/use-bar-chart.js +30 -21
  134. package/dist/use-bar-chart.js.map +1 -1
  135. package/dist/use-bar-chart.mjs +2 -2
  136. package/dist/use-chart-axis.d.mts +27 -27
  137. package/dist/use-chart-axis.d.ts +27 -27
  138. package/dist/use-chart-axis.js +26 -26
  139. package/dist/use-chart-axis.js.map +1 -1
  140. package/dist/use-chart-axis.mjs +2 -2
  141. package/dist/use-chart-grid.d.mts +8 -8
  142. package/dist/use-chart-grid.d.ts +8 -8
  143. package/dist/use-chart-grid.js +3 -3
  144. package/dist/use-chart-grid.js.map +1 -1
  145. package/dist/use-chart-grid.mjs +2 -2
  146. package/dist/use-chart-label-list.d.mts +4 -4
  147. package/dist/use-chart-label-list.d.ts +4 -4
  148. package/dist/use-chart-label-list.js +5 -4
  149. package/dist/use-chart-label-list.js.map +1 -1
  150. package/dist/use-chart-label-list.mjs +2 -2
  151. package/dist/use-chart-label.d.mts +1 -1
  152. package/dist/use-chart-label.d.ts +1 -1
  153. package/dist/use-chart-label.js.map +1 -1
  154. package/dist/use-chart-label.mjs +2 -2
  155. package/dist/use-chart-legend.d.mts +1 -1
  156. package/dist/use-chart-legend.d.ts +1 -1
  157. package/dist/use-chart-legend.js +1 -1
  158. package/dist/use-chart-legend.js.map +1 -1
  159. package/dist/use-chart-legend.mjs +1 -1
  160. package/dist/use-chart-reference-line.d.mts +4 -4
  161. package/dist/use-chart-reference-line.d.ts +4 -4
  162. package/dist/use-chart-reference-line.js +8 -7
  163. package/dist/use-chart-reference-line.js.map +1 -1
  164. package/dist/use-chart-reference-line.mjs +2 -2
  165. package/dist/use-chart-tooltip.d.mts +7 -7
  166. package/dist/use-chart-tooltip.d.ts +7 -7
  167. package/dist/use-chart-tooltip.js +4 -4
  168. package/dist/use-chart-tooltip.js.map +1 -1
  169. package/dist/use-chart-tooltip.mjs +2 -2
  170. package/dist/use-chart.d.mts +6 -10
  171. package/dist/use-chart.d.ts +6 -10
  172. package/dist/use-chart.js +2 -2
  173. package/dist/use-chart.js.map +1 -1
  174. package/dist/use-chart.mjs +2 -2
  175. package/dist/use-line-chart.d.mts +43 -43
  176. package/dist/use-line-chart.d.ts +43 -43
  177. package/dist/use-line-chart.js +26 -25
  178. package/dist/use-line-chart.js.map +1 -1
  179. package/dist/use-line-chart.mjs +2 -2
  180. package/dist/use-pie-chart.d.mts +47 -47
  181. package/dist/use-pie-chart.d.ts +47 -47
  182. package/dist/use-pie-chart.js +40 -38
  183. package/dist/use-pie-chart.js.map +1 -1
  184. package/dist/use-pie-chart.mjs +3 -3
  185. package/dist/use-polar-grid.d.mts +5 -5
  186. package/dist/use-polar-grid.d.ts +5 -5
  187. package/dist/use-polar-grid.js.map +1 -1
  188. package/dist/use-polar-grid.mjs +2 -2
  189. package/dist/use-radar-chart.d.mts +41 -41
  190. package/dist/use-radar-chart.d.ts +41 -41
  191. package/dist/use-radar-chart.js +27 -19
  192. package/dist/use-radar-chart.js.map +1 -1
  193. package/dist/use-radar-chart.mjs +2 -2
  194. package/dist/use-radial-chart.d.mts +17 -17
  195. package/dist/use-radial-chart.d.ts +17 -17
  196. package/dist/use-radial-chart.js +11 -11
  197. package/dist/use-radial-chart.js.map +1 -1
  198. package/dist/use-radial-chart.mjs +2 -2
  199. package/package.json +3 -3
  200. package/dist/chunk-2GQHI23M.mjs.map +0 -1
  201. package/dist/chunk-3EHZJFIA.mjs.map +0 -1
  202. package/dist/chunk-54WAXZP7.mjs.map +0 -1
  203. package/dist/chunk-6O5G3WYP.mjs.map +0 -1
  204. package/dist/chunk-6OYWQ3NO.mjs.map +0 -1
  205. package/dist/chunk-A3IWA366.mjs.map +0 -1
  206. package/dist/chunk-AYVZF37W.mjs.map +0 -1
  207. package/dist/chunk-C3ZYUDXE.mjs.map +0 -1
  208. package/dist/chunk-CQTRL3BW.mjs.map +0 -1
  209. package/dist/chunk-DZL5KQOJ.mjs.map +0 -1
  210. package/dist/chunk-EE6KEX6V.mjs.map +0 -1
  211. package/dist/chunk-FYAC4RRZ.mjs.map +0 -1
  212. package/dist/chunk-MSG3WFBO.mjs.map +0 -1
  213. package/dist/chunk-MVRWZTQ5.mjs.map +0 -1
  214. package/dist/chunk-NETTMC2D.mjs.map +0 -1
  215. package/dist/chunk-O3LMKYXK.mjs.map +0 -1
  216. package/dist/chunk-OEM3VCHN.mjs.map +0 -1
  217. package/dist/chunk-OJ2MLZZ7.mjs.map +0 -1
  218. package/dist/chunk-OPPMMNGP.mjs.map +0 -1
  219. package/dist/chunk-VEFEKDMH.mjs.map +0 -1
  220. package/dist/chunk-VKBRU4Z4.mjs.map +0 -1
  221. package/dist/chunk-VUTCH2CU.mjs.map +0 -1
  222. package/dist/chunk-XYUYAHJX.mjs.map +0 -1
@@ -178,13 +178,13 @@ var useChart = ({ containerProps = {} }) => {
178
178
  getContainerProps
179
179
  };
180
180
  };
181
- var useLegend = ({} = {}) => {
181
+ var useLegend = () => {
182
182
  const { styles } = useChartContext();
183
183
  return {
184
184
  styles
185
185
  };
186
186
  };
187
- var useTooltip = ({} = {}) => {
187
+ var useTooltip = () => {
188
188
  const { styles } = useChartContext();
189
189
  return {
190
190
  styles
@@ -196,7 +196,7 @@ var import_jsx_runtime = require("react/jsx-runtime");
196
196
  var ChartLegend = (0, import_core3.forwardRef)(
197
197
  ({ className, payload = [], onHighlight, ...rest }, ref) => {
198
198
  const { styles } = useLegend();
199
- const items = payload.map(({ dataKey, value: valueProp, color }, index) => {
199
+ const items = payload.map(({ color, dataKey, value: valueProp }, index) => {
200
200
  const value = dataKey != null ? dataKey : valueProp;
201
201
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
202
202
  import_core3.ui.div,
@@ -241,22 +241,22 @@ var import_utils4 = require("@yamada-ui/utils");
241
241
  var import_jsx_runtime2 = require("react/jsx-runtime");
242
242
  var ChartTooltip = (0, import_core4.forwardRef)(
243
243
  ({
244
- label,
245
- dataKey = "value",
246
244
  className,
247
- payload = [],
248
- valueFormatter,
245
+ dataKey = "value",
246
+ isRadialChart,
247
+ label,
249
248
  labelFormatter,
249
+ payload = [],
250
250
  unit,
251
- isRadialChart,
251
+ valueFormatter,
252
252
  ...rest
253
253
  }, ref) => {
254
254
  var _a;
255
255
  const { styles } = useTooltip();
256
256
  const items = payload.map(
257
257
  ({
258
- color: colorProp,
259
258
  name: nameProp,
259
+ color: colorProp,
260
260
  [dataKey]: valueProp,
261
261
  payload: payload2
262
262
  } = {}, index) => {
@@ -375,7 +375,7 @@ var useChartLegend = ({
375
375
  },
376
376
  [rest]
377
377
  );
378
- return { legendProps, getLegendProps };
378
+ return { getLegendProps, legendProps };
379
379
  };
380
380
 
381
381
  // src/use-chart-tooltip.ts
@@ -383,9 +383,9 @@ var import_core6 = require("@yamada-ui/core");
383
383
  var import_utils7 = require("@yamada-ui/utils");
384
384
  var import_react4 = require("react");
385
385
  var useChartTooltip = ({
386
- tooltipProps: _tooltipProps = {},
386
+ styles,
387
387
  tooltipAnimationDuration = 0,
388
- styles
388
+ tooltipProps: _tooltipProps = {}
389
389
  }) => {
390
390
  const { theme } = (0, import_core6.useTheme)();
391
391
  const { cursor, ...rest } = _tooltipProps;
@@ -401,16 +401,16 @@ var useChartTooltip = ({
401
401
  (props, ref = null) => ({
402
402
  ref,
403
403
  animationDuration: tooltipAnimationDuration,
404
- isAnimationActive: (tooltipAnimationDuration || 0) > 0,
405
404
  cursor: {
406
405
  className: (0, import_utils7.cx)("ui-chart__cursor", cursorClassName)
407
406
  },
407
+ isAnimationActive: (tooltipAnimationDuration || 0) > 0,
408
408
  ...props,
409
409
  ...tooltipProps
410
410
  }),
411
411
  [cursorClassName, tooltipAnimationDuration, tooltipProps]
412
412
  );
413
- return { tooltipProps: tooltipUIProps, getTooltipProps };
413
+ return { getTooltipProps, tooltipProps: tooltipUIProps };
414
414
  };
415
415
 
416
416
  // src/use-pie-chart.ts
@@ -428,17 +428,17 @@ var pieChartLabel = ({
428
428
  className: cellClassName,
429
429
  cx: cxProp = 0,
430
430
  cy: cyProp = 0,
431
- midAngle = 0,
432
431
  innerRadius = 0,
433
- outerRadius = 0,
432
+ isPercent,
433
+ labelFormatter,
434
+ labelOffset: labelOffsetProp,
435
+ midAngle = 0,
434
436
  middleRadius = 0,
437
+ outerRadius = 0,
435
438
  percent = 0,
439
+ styles,
436
440
  value = 0,
437
- labelOffset: labelOffsetProp,
438
- isPercent,
439
- labelProps,
440
- labelFormatter,
441
- styles
441
+ labelProps
442
442
  }) => {
443
443
  const labelOffset = labelOffsetProp != null ? labelOffsetProp : (outerRadius - innerRadius) * 0.5 + DEFAULT_LABEL_OFFSET;
444
444
  const x = cxProp + (middleRadius + labelOffset) * Math.cos(-midAngle * RADIAN);
@@ -457,10 +457,10 @@ var pieChartLabel = ({
457
457
  import_core7.ui.text,
458
458
  {
459
459
  className: (0, import_utils8.cx)(cellClassName, "ui-chart__label"),
460
+ dominantBaseline: "central",
461
+ textAnchor,
460
462
  x,
461
463
  y,
462
- textAnchor,
463
- dominantBaseline: "central",
464
464
  __css: styles,
465
465
  ...labelProps,
466
466
  children: displayLabel()
@@ -472,18 +472,19 @@ var pieChartLabelLine = ({
472
472
  cx: cxProp = 0,
473
473
  cy: cyProp = 0,
474
474
  innerRadius = 0,
475
+ labelOffset: labelOffsetProp,
475
476
  midAngle = 0,
476
477
  middleRadius = 0,
477
478
  outerRadius = 0,
478
479
  points = [{ x: 0, y: 0 }],
479
- labelOffset: labelOffsetProp,
480
- labelLineProps,
481
- styles
480
+ styles,
481
+ labelLineProps
482
482
  }) => {
483
+ var _a, _b;
483
484
  const labelOffset = labelOffsetProp != null ? labelOffsetProp : (outerRadius - innerRadius) * 0.5 + DEFAULT_LABEL_OFFSET;
484
485
  const x = cxProp + (middleRadius + labelOffset) * Math.cos(-midAngle * RADIAN);
485
486
  const y = cyProp + (middleRadius + labelOffset) * Math.sin(-midAngle * RADIAN);
486
- const d = `M ${points[0].x} ${points[0].y} L ${x} ${y}`;
487
+ const d = `M ${(_a = points[0]) == null ? void 0 : _a.x} ${(_b = points[0]) == null ? void 0 : _b.y} L ${x} ${y}`;
487
488
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
488
489
  import_core7.ui.path,
489
490
  {
@@ -498,19 +499,19 @@ var pieChartLabelLine = ({
498
499
  // src/use-pie-chart.ts
499
500
  var usePieChart = ({
500
501
  data,
501
- withLabels = false,
502
- withLabelLines = false,
503
- labelOffset,
504
- isPercent = false,
505
- strokeWidth = 1,
502
+ endAngle = -270,
506
503
  fillOpacity = 1,
507
504
  innerRadius = "0%",
505
+ isPercent = false,
506
+ labelFormatter,
507
+ labelOffset,
508
+ withLabels = false,
508
509
  outerRadius = withLabels ? "80%" : "100%",
509
510
  paddingAngle = 0,
510
511
  startAngle = 90,
511
- endAngle = -270,
512
- labelFormatter,
512
+ strokeWidth = 1,
513
513
  styles,
514
+ withLabelLines = false,
514
515
  ...rest
515
516
  }) => {
516
517
  var _a, _b;
@@ -585,11 +586,11 @@ var usePieChart = ({
585
586
  );
586
587
  const label = (0, import_react5.useCallback)(
587
588
  (props) => pieChartLabel({
588
- labelOffset,
589
589
  isPercent,
590
- labelProps,
591
590
  labelFormatter,
591
+ labelOffset,
592
592
  styles: styles.label,
593
+ labelProps,
593
594
  ...props
594
595
  }),
595
596
  [isPercent, labelOffset, labelProps, styles.label, labelFormatter]
@@ -598,8 +599,8 @@ var usePieChart = ({
598
599
  (props) => {
599
600
  return pieChartLabelLine({
600
601
  labelOffset,
601
- labelLineProps,
602
602
  styles: styles.labelLine,
603
+ labelLineProps,
603
604
  ...props
604
605
  });
605
606
  },
@@ -622,8 +623,8 @@ var usePieChart = ({
622
623
  dimmed ? dimCellClassName : void 0
623
624
  )(theme);
624
625
  return {
625
- color,
626
- className
626
+ className,
627
+ color
627
628
  };
628
629
  }),
629
630
  [
@@ -648,19 +649,19 @@ var usePieChart = ({
648
649
  ({ className, ...props }, ref = null) => ({
649
650
  ref,
650
651
  className: (0, import_utils9.cx)(className, pieClassName),
651
- dataKey: "value",
652
+ activeShape: activeShapeProps,
652
653
  data,
653
- rootTabIndex: -1,
654
- outerRadius,
655
- innerRadius,
656
- paddingAngle,
657
- startAngle,
654
+ dataKey: "value",
658
655
  endAngle,
656
+ inactiveShape: inactiveShapeProps,
657
+ innerRadius,
659
658
  isAnimationActive: false,
660
659
  label: withLabels ? label : false,
661
660
  labelLine: withLabelLines ? labelLine : false,
662
- activeShape: activeShapeProps,
663
- inactiveShape: inactiveShapeProps,
661
+ outerRadius,
662
+ paddingAngle,
663
+ rootTabIndex: -1,
664
+ startAngle,
664
665
  ...props,
665
666
  ...pieProps
666
667
  }),
@@ -682,8 +683,9 @@ var usePieChart = ({
682
683
  ]
683
684
  );
684
685
  const getCellProps = (0, import_react5.useCallback)(
685
- ({ index, className: classNameProp, ...props }, ref = null) => {
686
- const { className, color } = cellPropList[index];
686
+ ({ className: classNameProp, index, ...props }, ref = null) => {
687
+ var _a2;
688
+ const { className, color } = (_a2 = cellPropList[index]) != null ? _a2 : {};
687
689
  return {
688
690
  ref,
689
691
  className: (0, import_utils9.cx)(classNameProp, className),
@@ -697,10 +699,10 @@ var usePieChart = ({
697
699
  );
698
700
  return {
699
701
  pieVars,
700
- getPieProps,
701
- getPieChartProps,
702
+ setHighlightedArea,
702
703
  getCellProps,
703
- setHighlightedArea
704
+ getPieChartProps,
705
+ getPieProps
704
706
  };
705
707
  };
706
708
 
@@ -711,71 +713,71 @@ var DonutChart = (0, import_core9.forwardRef)((props, ref) => {
711
713
  const {
712
714
  className,
713
715
  data,
714
- pieProps,
715
- chartProps,
716
- cellProps,
717
- containerProps,
718
- withTooltip = true,
719
- withLegend = false,
720
- tooltipProps,
721
- tooltipAnimationDuration,
722
- tooltipDataSource = "all",
723
- valueFormatter,
724
- labelFormatter,
725
- unit,
726
- paddingAngle,
727
- startAngle,
728
716
  endAngle,
729
717
  withLabels,
730
- withLabelLines,
731
- labelOffset,
732
- isPercent,
733
718
  innerRadius = withLabels ? "60%" : "80%",
719
+ isPercent,
720
+ labelFormatter,
721
+ labelOffset,
734
722
  outerRadius,
723
+ paddingAngle,
724
+ startAngle,
735
725
  strokeWidth,
736
- legendProps,
726
+ tooltipAnimationDuration,
727
+ tooltipDataSource = "all",
728
+ unit,
729
+ valueFormatter,
730
+ withLabelLines,
731
+ withLegend = false,
732
+ withTooltip = true,
733
+ cellProps,
734
+ chartProps,
735
+ containerProps,
737
736
  labelProps,
737
+ legendProps,
738
+ pieProps,
739
+ tooltipProps,
738
740
  ...rest
739
741
  } = (0, import_core9.omitThemeProps)(mergedProps);
740
742
  const {
741
743
  pieVars,
742
- getPieProps,
743
- getPieChartProps,
744
+ setHighlightedArea,
744
745
  getCellProps,
745
- setHighlightedArea
746
+ getPieChartProps,
747
+ getPieProps
746
748
  } = usePieChart({
747
749
  data,
748
- pieProps,
749
- chartProps,
750
- cellProps,
750
+ endAngle,
751
751
  innerRadius,
752
+ isPercent,
753
+ labelFormatter,
754
+ labelOffset,
752
755
  outerRadius,
753
756
  paddingAngle,
754
757
  startAngle,
755
- endAngle,
756
758
  strokeWidth,
757
- withLabels,
759
+ styles,
758
760
  withLabelLines,
759
- labelOffset,
760
- isPercent,
761
- labelFormatter,
762
- styles
761
+ withLabels,
762
+ cellProps,
763
+ chartProps,
764
+ pieProps
763
765
  });
764
766
  const { getContainerProps } = useChart({ containerProps });
765
- const { tooltipProps: computedTooltipProps, getTooltipProps } = useChartTooltip({
766
- tooltipProps,
767
+ const { getTooltipProps, tooltipProps: computedTooltipProps } = useChartTooltip({
768
+ styles,
767
769
  tooltipAnimationDuration,
768
- styles
770
+ tooltipProps
769
771
  });
770
- const { legendProps: computedLegendProps, getLegendProps } = useChartLegend({
772
+ const { getLegendProps, legendProps: computedLegendProps } = useChartLegend({
771
773
  legendProps
772
774
  });
773
- const { getLabelProps } = useChartLabel({ labelProps, styles });
775
+ const { getLabelProps } = useChartLabel({ styles, labelProps });
774
776
  const cells = (0, import_react6.useMemo)(
775
777
  () => data.map(({ name }, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
776
778
  import_recharts.Cell,
777
779
  {
778
- ...getCellProps({ index, className: "ui-donut-chart__cell" })
780
+ ...getCellProps({ className: "ui-donut-chart__cell", index })
779
781
  },
780
782
  `donut-cell-${name}`
781
783
  )),
@@ -838,8 +840,8 @@ var DonutChart = (0, import_core9.forwardRef)((props, ref) => {
838
840
  className: "ui-donut-chart__tooltip",
839
841
  label,
840
842
  payload: tooltipDataSource === "segment" ? payload : data,
841
- valueFormatter,
842
843
  unit,
844
+ valueFormatter,
843
845
  ...computedTooltipProps
844
846
  }
845
847
  ),