@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,14 +24,16 @@ __export(area_chart_split_exports, {
24
24
  AreaSplit: () => AreaSplit
25
25
  });
26
26
  module.exports = __toCommonJS(area_chart_split_exports);
27
+ var import_core = require("@yamada-ui/core");
27
28
  var import_jsx_runtime = require("react/jsx-runtime");
28
29
  var AreaSplit = ({ offset, id, fillOpacity }) => {
30
+ const { theme } = (0, import_core.useTheme)();
29
31
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("linearGradient", { id, x1: "0", y1: "0", x2: "0", y2: "1", children: [
30
32
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
31
33
  "stop",
32
34
  {
33
35
  offset,
34
- stopColor: "var(--ui-area-split-0)",
36
+ stopColor: (0, import_core.getVar)(`area-split-0`)(theme),
35
37
  stopOpacity: fillOpacity != null ? fillOpacity : 0.4
36
38
  }
37
39
  ),
@@ -39,7 +41,7 @@ var AreaSplit = ({ offset, id, fillOpacity }) => {
39
41
  "stop",
40
42
  {
41
43
  offset,
42
- stopColor: "var(--ui-area-split-1)",
44
+ stopColor: (0, import_core.getVar)(`area-split-1`)(theme),
43
45
  stopOpacity: fillOpacity != null ? fillOpacity : 0.4
44
46
  }
45
47
  )
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/area-chart-split.tsx"],"sourcesContent":["export type AreaSplitProps = {\n offset: number\n id?: string\n fillOpacity: number | string | undefined\n}\n\nexport const AreaSplit = ({ offset, id, fillOpacity }: AreaSplitProps) => {\n return (\n <linearGradient id={id} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop\n offset={offset}\n stopColor=\"var(--ui-area-split-0)\"\n stopOpacity={fillOpacity ?? 0.4}\n />\n <stop\n offset={offset}\n stopColor=\"var(--ui-area-split-1)\"\n stopOpacity={fillOpacity ?? 0.4}\n />\n </linearGradient>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQI;AAFG,IAAM,YAAY,CAAC,EAAE,QAAQ,IAAI,YAAY,MAAsB;AACxE,SACE,6CAAC,oBAAe,IAAQ,IAAG,KAAI,IAAG,KAAI,IAAG,KAAI,IAAG,KAC9C;AAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAU;AAAA,QACV,aAAa,oCAAe;AAAA;AAAA,IAC9B;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAU;AAAA,QACV,aAAa,oCAAe;AAAA;AAAA,IAC9B;AAAA,KACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../src/area-chart-split.tsx"],"sourcesContent":["import { getVar, useTheme } from \"@yamada-ui/core\"\n\nexport type AreaSplitProps = {\n offset: number\n id?: string\n fillOpacity: number | string | undefined\n}\n\nexport const AreaSplit = ({ offset, id, fillOpacity }: AreaSplitProps) => {\n const { theme } = useTheme()\n\n return (\n <linearGradient id={id} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop\n offset={offset}\n stopColor={getVar(`area-split-0`)(theme)}\n stopOpacity={fillOpacity ?? 0.4}\n />\n <stop\n offset={offset}\n stopColor={getVar(`area-split-1`)(theme)}\n stopOpacity={fillOpacity ?? 0.4}\n />\n </linearGradient>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiC;AAY7B;AAJG,IAAM,YAAY,CAAC,EAAE,QAAQ,IAAI,YAAY,MAAsB;AACxE,QAAM,EAAE,MAAM,QAAI,sBAAS;AAE3B,SACE,6CAAC,oBAAe,IAAQ,IAAG,KAAI,IAAG,KAAI,IAAG,KAAI,IAAG,KAC9C;AAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW,oBAAO,cAAc,EAAE,KAAK;AAAA,QACvC,aAAa,oCAAe;AAAA;AAAA,IAC9B;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW,oBAAO,cAAc,EAAE,KAAK;AAAA,QACvC,aAAa,oCAAe;AAAA;AAAA,IAC9B;AAAA,KACF;AAEJ;","names":[]}
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
  import {
3
3
  AreaSplit
4
- } from "./chunk-PNE3JG54.mjs";
4
+ } from "./chunk-MGTMKKSH.mjs";
5
5
  export {
6
6
  AreaSplit
7
7
  };
@@ -15,7 +15,6 @@ import './area-chart-gradient.mjs';
15
15
  import 'react/jsx-runtime';
16
16
  import './area-chart-split.mjs';
17
17
  import './chart.types.mjs';
18
- import './rechart-properties.mjs';
19
18
 
20
19
  type AreaChartOptions = {
21
20
  /**
@@ -15,7 +15,6 @@ import './area-chart-gradient.js';
15
15
  import 'react/jsx-runtime';
16
16
  import './area-chart-split.js';
17
17
  import './chart.types.js';
18
- import './rechart-properties.js';
19
18
 
20
19
  type AreaChartOptions = {
21
20
  /**
@@ -24,7 +24,7 @@ __export(area_chart_exports, {
24
24
  AreaChart: () => AreaChart
25
25
  });
26
26
  module.exports = __toCommonJS(area_chart_exports);
27
- var import_core10 = require("@yamada-ui/core");
27
+ var import_core11 = require("@yamada-ui/core");
28
28
  var import_utils11 = require("@yamada-ui/utils");
29
29
  var import_react8 = require("react");
30
30
  var import_recharts = require("recharts");
@@ -48,14 +48,16 @@ var AreaGradient = ({
48
48
  };
49
49
 
50
50
  // src/area-chart-split.tsx
51
+ var import_core = require("@yamada-ui/core");
51
52
  var import_jsx_runtime2 = require("react/jsx-runtime");
52
53
  var AreaSplit = ({ offset, id, fillOpacity }) => {
54
+ const { theme } = (0, import_core.useTheme)();
53
55
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("linearGradient", { id, x1: "0", y1: "0", x2: "0", y2: "1", children: [
54
56
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
55
57
  "stop",
56
58
  {
57
59
  offset,
58
- stopColor: "var(--ui-area-split-0)",
60
+ stopColor: (0, import_core.getVar)(`area-split-0`)(theme),
59
61
  stopOpacity: fillOpacity != null ? fillOpacity : 0.4
60
62
  }
61
63
  ),
@@ -63,7 +65,7 @@ var AreaSplit = ({ offset, id, fillOpacity }) => {
63
65
  "stop",
64
66
  {
65
67
  offset,
66
- stopColor: "var(--ui-area-split-1)",
68
+ stopColor: (0, import_core.getVar)(`area-split-1`)(theme),
67
69
  stopOpacity: fillOpacity != null ? fillOpacity : 0.4
68
70
  }
69
71
  )
@@ -71,20 +73,20 @@ var AreaSplit = ({ offset, id, fillOpacity }) => {
71
73
  };
72
74
 
73
75
  // src/chart-legend.tsx
74
- var import_core3 = require("@yamada-ui/core");
76
+ var import_core4 = require("@yamada-ui/core");
75
77
  var import_utils3 = require("@yamada-ui/utils");
76
78
 
77
79
  // src/use-chart.ts
78
- var import_core2 = require("@yamada-ui/core");
80
+ var import_core3 = require("@yamada-ui/core");
79
81
  var import_utils2 = require("@yamada-ui/utils");
80
82
  var import_react = require("react");
81
83
 
82
84
  // src/chart-utils.ts
83
- var import_core = require("@yamada-ui/core");
85
+ var import_core2 = require("@yamada-ui/core");
84
86
  var import_utils = require("@yamada-ui/utils");
85
87
  var getClassName = (...styles) => (theme) => (0, import_utils.cx)(
86
88
  ...styles.map(
87
- (style) => (0, import_utils.isString)(style) ? style : (0, import_core.getCSS)(style)(theme)
89
+ (style) => (0, import_utils.isString)(style) ? style : (0, import_core2.getCSS)(style)(theme)
88
90
  )
89
91
  );
90
92
  var getComponentProps = ([obj, keys], ...props) => (theme, isContain) => {
@@ -336,7 +338,7 @@ var [ChartProvider, useChartContext] = (0, import_utils2.createContext)({
336
338
  errorMessage: `useChartContext returned is 'undefined'. Seems you forgot to wrap the components in "<LineChart />" or "<BarChart />" etc.`
337
339
  });
338
340
  var useChart = ({ containerProps = {} }) => {
339
- const { theme } = (0, import_core2.useTheme)();
341
+ const { theme } = (0, import_core3.useTheme)();
340
342
  const [reChartsProps, propClassName] = getComponentProps([
341
343
  containerProps,
342
344
  containerProperties
@@ -369,13 +371,13 @@ var useTooltip = ({} = {}) => {
369
371
 
370
372
  // src/chart-legend.tsx
371
373
  var import_jsx_runtime3 = require("react/jsx-runtime");
372
- var ChartLegend = (0, import_core3.forwardRef)(
374
+ var ChartLegend = (0, import_core4.forwardRef)(
373
375
  ({ className, payload = [], onHighlight, ...rest }, ref) => {
374
376
  const { styles } = useLegend();
375
377
  const items = payload.map(({ dataKey, value: valueProp, color }, index) => {
376
378
  const value = dataKey != null ? dataKey : valueProp;
377
379
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
378
- import_core3.ui.div,
380
+ import_core4.ui.div,
379
381
  {
380
382
  className: "ui-chart__legend-item",
381
383
  onMouseEnter: () => onHighlight(value),
@@ -383,21 +385,21 @@ var ChartLegend = (0, import_core3.forwardRef)(
383
385
  __css: styles.legendItem,
384
386
  children: [
385
387
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
386
- import_core3.ui.div,
388
+ import_core4.ui.div,
387
389
  {
388
390
  className: "ui-chart__legend-swatch",
389
391
  background: color,
390
392
  __css: styles.legendSwatch
391
393
  }
392
394
  ),
393
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core3.ui.span, { className: "ui-chart__legend-label", children: value })
395
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core4.ui.span, { className: "ui-chart__legend-label", children: value })
394
396
  ]
395
397
  },
396
398
  `legend-${index}`
397
399
  );
398
400
  });
399
401
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
400
- import_core3.ui.div,
402
+ import_core4.ui.div,
401
403
  {
402
404
  ref,
403
405
  className: (0, import_utils3.cx)("ui-chart__legend", className),
@@ -410,24 +412,32 @@ var ChartLegend = (0, import_core3.forwardRef)(
410
412
  );
411
413
 
412
414
  // src/chart-tooltip.tsx
413
- var import_core4 = require("@yamada-ui/core");
415
+ var import_core5 = require("@yamada-ui/core");
414
416
  var import_utils4 = require("@yamada-ui/utils");
415
417
  var import_jsx_runtime4 = require("react/jsx-runtime");
416
- var ChartTooltip = (0, import_core4.forwardRef)(
418
+ var ChartTooltip = (0, import_core5.forwardRef)(
417
419
  ({
418
420
  label,
421
+ dataKey = "value",
419
422
  className,
420
423
  payload = [],
421
424
  valueFormatter,
422
425
  labelFormatter,
423
426
  unit,
427
+ isRadialChart,
424
428
  ...rest
425
429
  }, ref) => {
426
430
  var _a;
427
431
  const { styles } = useTooltip();
428
432
  const items = payload.map(
429
- ({ color: colorProp, name, value: valueProp, payload: payload2 } = {}, index) => {
433
+ ({
434
+ color: colorProp,
435
+ name: nameProp,
436
+ [dataKey]: valueProp,
437
+ payload: payload2
438
+ } = {}, index) => {
430
439
  var _a2;
440
+ const name = isRadialChart ? payload2 == null ? void 0 : payload2.name : nameProp;
431
441
  const color = colorProp != null ? colorProp : payload2 == null ? void 0 : payload2.color;
432
442
  let value;
433
443
  if ((0, import_utils4.isArray)(valueProp)) {
@@ -439,13 +449,13 @@ var ChartTooltip = (0, import_core4.forwardRef)(
439
449
  value = (_a2 = valueFormatter == null ? void 0 : valueFormatter(valueProp)) != null ? _a2 : valueProp;
440
450
  }
441
451
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
442
- import_core4.ui.div,
452
+ import_core5.ui.div,
443
453
  {
444
454
  className: "ui-chart__tooltip-item",
445
455
  __css: styles.tooltipItem,
446
456
  children: [
447
457
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
448
- import_core4.ui.div,
458
+ import_core5.ui.div,
449
459
  {
450
460
  className: "ui-chart__tooltip-swatch",
451
461
  background: color,
@@ -453,7 +463,7 @@ var ChartTooltip = (0, import_core4.forwardRef)(
453
463
  }
454
464
  ),
455
465
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
456
- import_core4.ui.span,
466
+ import_core5.ui.span,
457
467
  {
458
468
  className: "ui-chart__tooltip-label",
459
469
  __css: styles.tooltipLabel,
@@ -461,7 +471,7 @@ var ChartTooltip = (0, import_core4.forwardRef)(
461
471
  }
462
472
  ),
463
473
  /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
464
- import_core4.ui.span,
474
+ import_core5.ui.span,
465
475
  {
466
476
  className: "ui-chart__tooltip-value",
467
477
  __css: styles.tooltipValue,
@@ -478,15 +488,15 @@ var ChartTooltip = (0, import_core4.forwardRef)(
478
488
  }
479
489
  );
480
490
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
481
- import_core4.ui.div,
491
+ import_core5.ui.div,
482
492
  {
483
493
  ref,
484
494
  className: (0, import_utils4.cx)("ui-chart__tooltip", className),
485
495
  __css: styles.tooltip,
486
496
  ...rest,
487
497
  children: [
488
- label ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_core4.ui.p, { className: "ui-chart__tooltip-title", __css: styles.tooltipTitle, children: (_a = labelFormatter == null ? void 0 : labelFormatter(label)) != null ? _a : label }) : null,
489
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_core4.ui.div, { className: "ui-chart__tooltip-list", __css: styles.tooltipList, children: items })
498
+ label ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_core5.ui.p, { className: "ui-chart__tooltip-title", __css: styles.tooltipTitle, children: (_a = labelFormatter == null ? void 0 : labelFormatter(label)) != null ? _a : label }) : null,
499
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_core5.ui.div, { className: "ui-chart__tooltip-list", __css: styles.tooltipList, children: items })
490
500
  ]
491
501
  }
492
502
  );
@@ -494,7 +504,7 @@ var ChartTooltip = (0, import_core4.forwardRef)(
494
504
  );
495
505
 
496
506
  // src/use-area-chart.ts
497
- var import_core5 = require("@yamada-ui/core");
507
+ var import_core6 = require("@yamada-ui/core");
498
508
  var import_utils5 = require("@yamada-ui/utils");
499
509
  var import_react2 = require("react");
500
510
  var useAreaChart = ({
@@ -520,7 +530,7 @@ var useAreaChart = ({
520
530
  }) => {
521
531
  var _a;
522
532
  const uuid = (0, import_react2.useId)();
523
- const { theme } = (0, import_core5.useTheme)();
533
+ const { theme } = (0, import_core6.useTheme)();
524
534
  const [highlightedArea, setHighlightedArea] = (0, import_react2.useState)(null);
525
535
  const splitId = `${uuid}-split`;
526
536
  const stacked = type === "stacked" || type === "percent";
@@ -535,7 +545,6 @@ var useAreaChart = ({
535
545
  } = (_a = rest.areaProps) != null ? _a : {};
536
546
  const areaColors = (0, import_react2.useMemo)(
537
547
  () => series.map(({ color }, index) => ({
538
- __prefix: "ui",
539
548
  name: `area-${index}`,
540
549
  token: "colors",
541
550
  value: color != null ? color : "transparent"
@@ -544,7 +553,6 @@ var useAreaChart = ({
544
553
  );
545
554
  const areaSplitColors = (0, import_react2.useMemo)(
546
555
  () => splitColors.map((color, index) => ({
547
- __prefix: "ui",
548
556
  name: `area-split-${index}`,
549
557
  token: "colors",
550
558
  value: color != null ? color : "transparent"
@@ -553,7 +561,6 @@ var useAreaChart = ({
553
561
  );
554
562
  const referenceLineColors = (0, import_react2.useMemo)(
555
563
  () => referenceLineProps ? referenceLineProps.map(({ color }, index) => ({
556
- __prefix: "ui",
557
564
  name: `reference-line-${index}`,
558
565
  token: "colors",
559
566
  value: color != null ? color : "transparent"
@@ -565,9 +572,10 @@ var useAreaChart = ({
565
572
  ...areaColors,
566
573
  ...areaSplitColors,
567
574
  ...referenceLineColors,
568
- { __prefix: "ui", name: "fill-opacity", value: fillOpacity }
575
+ { name: "fill-opacity", value: fillOpacity }
569
576
  ];
570
577
  }, [areaColors, areaSplitColors, referenceLineColors, fillOpacity]);
578
+ const fillOpacityVar = (0, import_react2.useMemo)(() => (0, import_core6.getVar)("fill-opacity")(theme), [theme]);
571
579
  const [chartProps, areaChartClassName] = (0, import_react2.useMemo)(
572
580
  () => {
573
581
  var _a2;
@@ -642,7 +650,7 @@ var useAreaChart = ({
642
650
  ...computedProps
643
651
  } = props;
644
652
  const id = `${uuid}-${dataKey}`;
645
- const color = `var(--ui-area-${index})`;
653
+ const color = (0, import_core6.getVar)(`area-${index}`)(theme);
646
654
  const dimmed = shouldHighlight && highlightedArea !== dataKey;
647
655
  const computedDimArea = { ...dimAreaProps, ...dimArea2 };
648
656
  const resolvedProps = {
@@ -754,10 +762,10 @@ var useAreaChart = ({
754
762
  (props = {}) => ({
755
763
  id: splitId,
756
764
  offset: splitOffset != null ? splitOffset : defaultSplitOffset,
757
- fillOpacity: "var(--ui-fill-opacity)",
765
+ fillOpacity: fillOpacityVar,
758
766
  ...props
759
767
  }),
760
- [defaultSplitOffset, splitId, splitOffset]
768
+ [defaultSplitOffset, splitId, splitOffset, fillOpacityVar]
761
769
  );
762
770
  const getAreaProps = (0, import_react2.useCallback)(
763
771
  ({ index, className: classNameProp, ...props }, ref = null) => {
@@ -804,10 +812,10 @@ var useAreaChart = ({
804
812
  const getAreaGradientProps = (0, import_react2.useCallback)(
805
813
  (props = {}) => ({
806
814
  withGradient,
807
- fillOpacity: "var(--ui-fill-opacity)",
815
+ fillOpacity: fillOpacityVar,
808
816
  ...props
809
817
  }),
810
- [withGradient]
818
+ [withGradient, fillOpacityVar]
811
819
  );
812
820
  return {
813
821
  getAreaChartProps,
@@ -820,7 +828,7 @@ var useAreaChart = ({
820
828
  };
821
829
 
822
830
  // src/use-chart-axis.ts
823
- var import_core6 = require("@yamada-ui/core");
831
+ var import_core7 = require("@yamada-ui/core");
824
832
  var import_utils6 = require("@yamada-ui/utils");
825
833
  var import_react3 = require("react");
826
834
  var useChartAxis = ({
@@ -840,7 +848,7 @@ var useChartAxis = ({
840
848
  ...rest
841
849
  }) => {
842
850
  var _a, _b, _c, _d;
843
- const { theme } = (0, import_core6.useTheme)();
851
+ const { theme } = (0, import_core7.useTheme)();
844
852
  const xAxisKey = (0, import_react3.useMemo)(
845
853
  () => layoutType === "vertical" ? { type: "number" } : { dataKey },
846
854
  [dataKey, layoutType]
@@ -961,7 +969,7 @@ var valueToPercent = (value) => {
961
969
  };
962
970
 
963
971
  // src/use-chart-grid.ts
964
- var import_core7 = require("@yamada-ui/core");
972
+ var import_core8 = require("@yamada-ui/core");
965
973
  var import_utils7 = require("@yamada-ui/utils");
966
974
  var import_react4 = require("react");
967
975
  var useChartGrid = ({
@@ -970,7 +978,7 @@ var useChartGrid = ({
970
978
  strokeDasharray = "5 5",
971
979
  styles
972
980
  }) => {
973
- const { theme } = (0, import_core7.useTheme)();
981
+ const { theme } = (0, import_core8.useTheme)();
974
982
  const [reChartsProps, propClassName] = getComponentProps(
975
983
  [gridProps, gridProperties],
976
984
  styles.grid
@@ -1015,22 +1023,22 @@ var useChartLegend = ({
1015
1023
  };
1016
1024
 
1017
1025
  // src/use-chart-reference-line.ts
1018
- var import_core8 = require("@yamada-ui/core");
1026
+ var import_core9 = require("@yamada-ui/core");
1019
1027
  var import_utils9 = require("@yamada-ui/utils");
1020
1028
  var import_react6 = require("react");
1021
1029
  var useChartReferenceLine = ({
1022
1030
  referenceLineProps = [],
1023
1031
  styles
1024
1032
  }) => {
1025
- const { theme } = (0, import_core8.useTheme)();
1026
- const styleClassName = (0, import_core8.getCSS)(styles.referenceLine)(theme);
1033
+ const { theme } = (0, import_core9.useTheme)();
1034
+ const styleClassName = (0, import_core9.getCSS)(styles.referenceLine)(theme);
1027
1035
  const propList = (0, import_react6.useMemo)(
1028
1036
  () => referenceLineProps.map((props, index) => {
1029
1037
  const [{ label: labelProp, ...rest }, propClassName] = getComponentProps(
1030
1038
  [props, referenceLineProperties],
1031
1039
  styleClassName
1032
1040
  )(theme);
1033
- const color = `var(--ui-reference-line-${index})`;
1041
+ const color = (0, import_core9.getVar)(`reference-line-${index}`)(theme);
1034
1042
  const label = {
1035
1043
  value: labelProp,
1036
1044
  fill: color,
@@ -1059,7 +1067,7 @@ var useChartReferenceLine = ({
1059
1067
  };
1060
1068
 
1061
1069
  // src/use-chart-tooltip.ts
1062
- var import_core9 = require("@yamada-ui/core");
1070
+ var import_core10 = require("@yamada-ui/core");
1063
1071
  var import_utils10 = require("@yamada-ui/utils");
1064
1072
  var import_react7 = require("react");
1065
1073
  var useChartTooltip = ({
@@ -1067,7 +1075,7 @@ var useChartTooltip = ({
1067
1075
  tooltipAnimationDuration = 0,
1068
1076
  styles
1069
1077
  }) => {
1070
- const { theme } = (0, import_core9.useTheme)();
1078
+ const { theme } = (0, import_core10.useTheme)();
1071
1079
  const { cursor, ...rest } = _tooltipProps;
1072
1080
  const cursorClassName = (0, import_react7.useMemo)(
1073
1081
  () => getClassName({ ...styles.cursor, ...cursor })(theme),
@@ -1095,8 +1103,8 @@ var useChartTooltip = ({
1095
1103
 
1096
1104
  // src/area-chart.tsx
1097
1105
  var import_jsx_runtime5 = require("react/jsx-runtime");
1098
- var AreaChart = (0, import_core10.forwardRef)((props, ref) => {
1099
- const [styles, mergedProps] = (0, import_core10.useMultiComponentStyle)("AreaChart", props);
1106
+ var AreaChart = (0, import_core11.forwardRef)((props, ref) => {
1107
+ const [styles, mergedProps] = (0, import_core11.useMultiComponentStyle)("AreaChart", props);
1100
1108
  const {
1101
1109
  className,
1102
1110
  series,
@@ -1141,7 +1149,7 @@ var AreaChart = (0, import_core10.forwardRef)((props, ref) => {
1141
1149
  splitOffset,
1142
1150
  syncId,
1143
1151
  ...rest
1144
- } = (0, import_core10.omitThemeProps)(mergedProps);
1152
+ } = (0, import_core11.omitThemeProps)(mergedProps);
1145
1153
  const {
1146
1154
  getAreaChartProps,
1147
1155
  getAreaSplitProps,
@@ -1241,7 +1249,7 @@ var AreaChart = (0, import_core10.forwardRef)((props, ref) => {
1241
1249
  [getReferenceLineProps, referenceLineProps]
1242
1250
  );
1243
1251
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ChartProvider, { value: { styles }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1244
- import_core10.ui.div,
1252
+ import_core11.ui.div,
1245
1253
  {
1246
1254
  ref,
1247
1255
  className: (0, import_utils11.cx)("ui-area-chart", className),