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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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
@@ -1,10 +1,10 @@
1
1
  "use client"
2
2
  import {
3
3
  ChartTooltip
4
- } from "./chunk-YSPGYMRF.mjs";
5
- import "./chunk-A3IWA366.mjs";
4
+ } from "./chunk-5VLSGWQD.mjs";
5
+ import "./chunk-VK65X6Q2.mjs";
6
6
  import "./chunk-6YUJLLGN.mjs";
7
- import "./chunk-QL3DB7OJ.mjs";
7
+ import "./chunk-TXNC7GLT.mjs";
8
8
  export {
9
9
  ChartTooltip
10
10
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/chart-utils.ts"],"sourcesContent":["import type { StyledTheme } from \"@yamada-ui/core\"\nimport { getCSS } from \"@yamada-ui/core\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport { cx, isString, splitObject } from \"@yamada-ui/utils\"\n\nexport const getClassName =\n (...styles: (Dict | string | undefined)[]) =>\n (theme: StyledTheme) =>\n cx(\n ...styles.map((style) =>\n isString(style) ? style : getCSS(style)(theme),\n ),\n )\n\nexport const getComponentProps =\n <T extends Dict, K extends keyof T>(\n [obj, keys]: [T, K[]],\n ...props: (Dict | string | undefined)[]\n ) =>\n <P extends boolean = false>(theme: StyledTheme, isContain?: P) => {\n const [pickedProps, omittedProps] = splitObject<T, K>(obj, keys)\n const className = getClassName(...props, omittedProps)(theme)\n\n return (\n !isContain ? [pickedProps, className] : { ...pickedProps, className }\n ) as P extends false\n ? [{ [P in K]: T[P] }, string]\n : { [P in K]: T[P] } & { className: string }\n }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAAuB;AAEvB,mBAA0C;AAEnC,IAAM,eACX,IAAI,WACJ,CAAC,cACC;AAAA,EACE,GAAG,OAAO;AAAA,IAAI,CAAC,cACb,uBAAS,KAAK,IAAI,YAAQ,oBAAO,KAAK,EAAE,KAAK;AAAA,EAC/C;AACF;AAEG,IAAM,oBACX,CACE,CAAC,KAAK,IAAI,MACP,UAEL,CAA4B,OAAoB,cAAkB;AAChE,QAAM,CAAC,aAAa,YAAY,QAAI,0BAAkB,KAAK,IAAI;AAC/D,QAAM,YAAY,aAAa,GAAG,OAAO,YAAY,EAAE,KAAK;AAE5D,SACE,CAAC,YAAY,CAAC,aAAa,SAAS,IAAI,EAAE,GAAG,aAAa,UAAU;AAIxE;","names":[]}
1
+ {"version":3,"sources":["../src/chart-utils.ts"],"sourcesContent":["import type { StyledTheme } from \"@yamada-ui/core\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport { getCSS } from \"@yamada-ui/core\"\nimport { cx, isString, splitObject } from \"@yamada-ui/utils\"\n\nexport const getClassName =\n (...styles: (Dict | string | undefined)[]) =>\n (theme: StyledTheme) =>\n cx(\n ...styles.map((style) =>\n isString(style) ? style : getCSS(style)(theme),\n ),\n )\n\nexport const getComponentProps =\n <T extends Dict, K extends keyof T>(\n [obj, keys]: [T, K[]],\n ...props: (Dict | string | undefined)[]\n ) =>\n <P extends boolean = false>(theme: StyledTheme, isContain?: P) => {\n const [pickedProps, omittedProps] = splitObject<T, K>(obj, keys)\n const className = getClassName(...props, omittedProps)(theme)\n\n return (\n !isContain ? [pickedProps, className] : { ...pickedProps, className }\n ) as P extends false\n ? [{ [P in K]: T[P] }, string]\n : { [P in K]: T[P] } & { className: string }\n }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,kBAAuB;AACvB,mBAA0C;AAEnC,IAAM,eACX,IAAI,WACJ,CAAC,cACC;AAAA,EACE,GAAG,OAAO;AAAA,IAAI,CAAC,cACb,uBAAS,KAAK,IAAI,YAAQ,oBAAO,KAAK,EAAE,KAAK;AAAA,EAC/C;AACF;AAEG,IAAM,oBACX,CACE,CAAC,KAAK,IAAI,MACP,UAEL,CAA4B,OAAoB,cAAkB;AAChE,QAAM,CAAC,aAAa,YAAY,QAAI,0BAAkB,KAAK,IAAI;AAC/D,QAAM,YAAY,aAAa,GAAG,OAAO,YAAY,EAAE,KAAK;AAE5D,SACE,CAAC,YAAY,CAAC,aAAa,SAAS,IAAI,EAAE,GAAG,aAAa,UAAU;AAIxE;","names":[]}
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  getClassName,
4
4
  getComponentProps
5
- } from "./chunk-QL3DB7OJ.mjs";
5
+ } from "./chunk-TXNC7GLT.mjs";
6
6
  export {
7
7
  getClassName,
8
8
  getComponentProps
@@ -1,14 +1,14 @@
1
1
  import { CSSUIProps, HTMLUIProps } from '@yamada-ui/core';
2
2
  import { Merge, Dict } from '@yamada-ui/utils';
3
- import { ComponentPropsWithoutRef, SVGProps, ReactElement, ReactNode } from 'react';
3
+ import { ComponentPropsWithoutRef, SVGProps, ReactNode, ReactElement } from 'react';
4
4
  import * as Recharts from 'recharts';
5
5
 
6
6
  type ChartLayoutType = "horizontal" | "vertical";
7
- type AreaChartType = "default" | "stacked" | "percent" | "split";
7
+ type AreaChartType = "default" | "percent" | "split" | "stacked";
8
8
  type BarChartType = Exclude<AreaChartType, "split">;
9
- type ChartAxisType = "x" | "y" | "xy" | "none";
10
- type ChartCurveType = "bump" | "linear" | "natural" | "monotone" | "step" | "stepBefore" | "stepAfter";
11
- type TooltipDataSourceType = "segment" | "all";
9
+ type ChartAxisType = "none" | "x" | "xy" | "y";
10
+ type ChartCurveType = "bump" | "linear" | "monotone" | "natural" | "step" | "stepAfter" | "stepBefore";
11
+ type TooltipDataSourceType = "all" | "segment";
12
12
  interface AreaChartProps extends Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.AreaChart>> {
13
13
  }
14
14
  interface BarChartProps extends Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.BarChart>> {
@@ -27,18 +27,18 @@ interface ResponsiveContainerProps extends Merge<CSSUIProps, Omit<Recharts.Respo
27
27
  }
28
28
  interface AreaProps extends Merge<Merge<CSSUIProps, Recharts.AreaProps>, {
29
29
  color: CSSUIProps["color"];
30
- dot?: DotProps;
31
30
  activeDot?: DotProps;
32
- dimDot?: DotProps;
33
31
  dimArea?: Partial<AreaProps>;
32
+ dimDot?: DotProps;
33
+ dot?: DotProps;
34
34
  }> {
35
35
  }
36
36
  interface LineProps extends Merge<Merge<CSSUIProps, Recharts.LineProps>, {
37
37
  color: CSSUIProps["color"];
38
38
  activeDot?: DotProps;
39
- dot?: DotProps;
40
39
  dimDot?: DotProps;
41
40
  dimLine?: Partial<LineProps>;
41
+ dot?: DotProps;
42
42
  }> {
43
43
  }
44
44
  interface BarProps extends Merge<Merge<CSSUIProps, Recharts.BarProps>, {
@@ -50,10 +50,10 @@ interface BarProps extends Merge<Merge<CSSUIProps, Recharts.BarProps>, {
50
50
  }
51
51
  interface RadarProps extends Merge<Merge<CSSUIProps, Recharts.RadarProps>, {
52
52
  color: CSSUIProps["color"];
53
- dot?: DotProps;
54
53
  activeDot?: DotProps;
55
54
  dimDot?: DotProps;
56
55
  dimRadar?: Partial<RadarProps>;
56
+ dot?: DotProps;
57
57
  }> {
58
58
  }
59
59
  interface PieProps extends Merge<Merge<Recharts.PieProps, CSSUIProps>, {
@@ -75,7 +75,7 @@ interface RadialBarProps extends Merge<Merge<Recharts.RadialBarProps, CSSUIProps
75
75
  }
76
76
  interface DotProps extends Merge<Omit<Recharts.DotProps, "ref">, CSSUIProps> {
77
77
  }
78
- interface XAxisProps extends Merge<CSSUIProps, Omit<Recharts.XAxisProps, "color" | "stroke" | "fill">> {
78
+ interface XAxisProps extends Merge<CSSUIProps, Omit<Recharts.XAxisProps, "color" | "fill" | "stroke">> {
79
79
  }
80
80
  interface YAxisProps extends Merge<CSSUIProps, Omit<Recharts.YAxisProps, "color">> {
81
81
  }
@@ -97,10 +97,10 @@ interface LabelProps extends Merge<CSSUIProps, Omit<Recharts.LabelProps, "fill">
97
97
  }
98
98
  interface LabelListProps extends Merge<Recharts.LabelListProps<Dict>, Omit<CSSUIProps, "position">> {
99
99
  }
100
- type ChartTooltipProps = Recharts.TooltipProps<number | string | (number | string)[], number | string>;
101
- type ChartTooltip = ReactElement | ((props: ChartTooltipProps) => ReactNode);
102
- interface ChartLabelProps extends Omit<React.SVGProps<SVGTextElement>, "viewBox" | "fill" | "offset">, LabelProps {
100
+ type ChartTooltipProps = Recharts.TooltipProps<(number | string)[] | number | string, number | string>;
101
+ type ChartTooltip = ((props: ChartTooltipProps) => ReactNode) | ReactElement;
102
+ interface ChartLabelProps extends Omit<React.SVGProps<SVGTextElement>, "fill" | "offset" | "viewBox">, LabelProps {
103
103
  }
104
- type ChartLabel = ReactElement | ((props: ChartLabelProps) => ReactNode);
104
+ type ChartLabel = ((props: ChartLabelProps) => ReactNode) | ReactElement;
105
105
 
106
106
  export type { AreaChartProps, AreaChartType, AreaProps, BarChartProps, BarChartType, BarProps, CellProps, ChartAxisType, ChartCurveType, ChartLabel, ChartLabelProps, ChartLayoutType, ChartTooltip, ChartTooltipProps, DotProps, GridProps, LabelListProps, LabelProps, LegendProps, LineChartProps, LineProps, PieChartProps, PieProps, PolarAngleAxisProps, PolarGridProps, PolarRadiusAxisProps, RadarChartProps, RadarProps, RadialBarProps, RadialChartProps, ReferenceLineProps, ResponsiveContainerProps, TooltipDataSourceType, TooltipProps, XAxisProps, YAxisProps };
@@ -1,14 +1,14 @@
1
1
  import { CSSUIProps, HTMLUIProps } from '@yamada-ui/core';
2
2
  import { Merge, Dict } from '@yamada-ui/utils';
3
- import { ComponentPropsWithoutRef, SVGProps, ReactElement, ReactNode } from 'react';
3
+ import { ComponentPropsWithoutRef, SVGProps, ReactNode, ReactElement } from 'react';
4
4
  import * as Recharts from 'recharts';
5
5
 
6
6
  type ChartLayoutType = "horizontal" | "vertical";
7
- type AreaChartType = "default" | "stacked" | "percent" | "split";
7
+ type AreaChartType = "default" | "percent" | "split" | "stacked";
8
8
  type BarChartType = Exclude<AreaChartType, "split">;
9
- type ChartAxisType = "x" | "y" | "xy" | "none";
10
- type ChartCurveType = "bump" | "linear" | "natural" | "monotone" | "step" | "stepBefore" | "stepAfter";
11
- type TooltipDataSourceType = "segment" | "all";
9
+ type ChartAxisType = "none" | "x" | "xy" | "y";
10
+ type ChartCurveType = "bump" | "linear" | "monotone" | "natural" | "step" | "stepAfter" | "stepBefore";
11
+ type TooltipDataSourceType = "all" | "segment";
12
12
  interface AreaChartProps extends Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.AreaChart>> {
13
13
  }
14
14
  interface BarChartProps extends Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.BarChart>> {
@@ -27,18 +27,18 @@ interface ResponsiveContainerProps extends Merge<CSSUIProps, Omit<Recharts.Respo
27
27
  }
28
28
  interface AreaProps extends Merge<Merge<CSSUIProps, Recharts.AreaProps>, {
29
29
  color: CSSUIProps["color"];
30
- dot?: DotProps;
31
30
  activeDot?: DotProps;
32
- dimDot?: DotProps;
33
31
  dimArea?: Partial<AreaProps>;
32
+ dimDot?: DotProps;
33
+ dot?: DotProps;
34
34
  }> {
35
35
  }
36
36
  interface LineProps extends Merge<Merge<CSSUIProps, Recharts.LineProps>, {
37
37
  color: CSSUIProps["color"];
38
38
  activeDot?: DotProps;
39
- dot?: DotProps;
40
39
  dimDot?: DotProps;
41
40
  dimLine?: Partial<LineProps>;
41
+ dot?: DotProps;
42
42
  }> {
43
43
  }
44
44
  interface BarProps extends Merge<Merge<CSSUIProps, Recharts.BarProps>, {
@@ -50,10 +50,10 @@ interface BarProps extends Merge<Merge<CSSUIProps, Recharts.BarProps>, {
50
50
  }
51
51
  interface RadarProps extends Merge<Merge<CSSUIProps, Recharts.RadarProps>, {
52
52
  color: CSSUIProps["color"];
53
- dot?: DotProps;
54
53
  activeDot?: DotProps;
55
54
  dimDot?: DotProps;
56
55
  dimRadar?: Partial<RadarProps>;
56
+ dot?: DotProps;
57
57
  }> {
58
58
  }
59
59
  interface PieProps extends Merge<Merge<Recharts.PieProps, CSSUIProps>, {
@@ -75,7 +75,7 @@ interface RadialBarProps extends Merge<Merge<Recharts.RadialBarProps, CSSUIProps
75
75
  }
76
76
  interface DotProps extends Merge<Omit<Recharts.DotProps, "ref">, CSSUIProps> {
77
77
  }
78
- interface XAxisProps extends Merge<CSSUIProps, Omit<Recharts.XAxisProps, "color" | "stroke" | "fill">> {
78
+ interface XAxisProps extends Merge<CSSUIProps, Omit<Recharts.XAxisProps, "color" | "fill" | "stroke">> {
79
79
  }
80
80
  interface YAxisProps extends Merge<CSSUIProps, Omit<Recharts.YAxisProps, "color">> {
81
81
  }
@@ -97,10 +97,10 @@ interface LabelProps extends Merge<CSSUIProps, Omit<Recharts.LabelProps, "fill">
97
97
  }
98
98
  interface LabelListProps extends Merge<Recharts.LabelListProps<Dict>, Omit<CSSUIProps, "position">> {
99
99
  }
100
- type ChartTooltipProps = Recharts.TooltipProps<number | string | (number | string)[], number | string>;
101
- type ChartTooltip = ReactElement | ((props: ChartTooltipProps) => ReactNode);
102
- interface ChartLabelProps extends Omit<React.SVGProps<SVGTextElement>, "viewBox" | "fill" | "offset">, LabelProps {
100
+ type ChartTooltipProps = Recharts.TooltipProps<(number | string)[] | number | string, number | string>;
101
+ type ChartTooltip = ((props: ChartTooltipProps) => ReactNode) | ReactElement;
102
+ interface ChartLabelProps extends Omit<React.SVGProps<SVGTextElement>, "fill" | "offset" | "viewBox">, LabelProps {
103
103
  }
104
- type ChartLabel = ReactElement | ((props: ChartLabelProps) => ReactNode);
104
+ type ChartLabel = ((props: ChartLabelProps) => ReactNode) | ReactElement;
105
105
 
106
106
  export type { AreaChartProps, AreaChartType, AreaProps, BarChartProps, BarChartType, BarProps, CellProps, ChartAxisType, ChartCurveType, ChartLabel, ChartLabelProps, ChartLayoutType, ChartTooltip, ChartTooltipProps, DotProps, GridProps, LabelListProps, LabelProps, LegendProps, LineChartProps, LineProps, PieChartProps, PieProps, PolarAngleAxisProps, PolarGridProps, PolarRadiusAxisProps, RadarChartProps, RadarProps, RadialBarProps, RadialChartProps, ReferenceLineProps, ResponsiveContainerProps, TooltipDataSourceType, TooltipProps, XAxisProps, YAxisProps };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/chart.types.ts"],"sourcesContent":["import type { CSSUIProps, HTMLUIProps } from \"@yamada-ui/core\"\nimport type { Dict, Merge } from \"@yamada-ui/utils\"\nimport type {\n ComponentPropsWithoutRef,\n ReactElement,\n ReactNode,\n SVGProps,\n} from \"react\"\nimport type * as Recharts from \"recharts\"\n\nexport type ChartLayoutType = \"horizontal\" | \"vertical\"\nexport type AreaChartType = \"default\" | \"stacked\" | \"percent\" | \"split\"\nexport type BarChartType = Exclude<AreaChartType, \"split\">\nexport type ChartAxisType = \"x\" | \"y\" | \"xy\" | \"none\"\nexport type ChartCurveType =\n | \"bump\"\n | \"linear\"\n | \"natural\"\n | \"monotone\"\n | \"step\"\n | \"stepBefore\"\n | \"stepAfter\"\nexport type TooltipDataSourceType = \"segment\" | \"all\"\n\nexport interface AreaChartProps\n extends Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.AreaChart>\n > {}\nexport interface BarChartProps\n extends Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.BarChart>\n > {}\nexport interface LineChartProps\n extends Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.LineChart>\n > {}\nexport interface RadarChartProps\n extends Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.RadarChart>\n > {}\nexport interface PieChartProps\n extends Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.PieChart>\n > {}\nexport interface RadialChartProps\n extends Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.RadialBarChart>\n > {}\nexport interface ReferenceLineProps\n extends Merge<CSSUIProps, Recharts.ReferenceLineProps> {}\nexport interface ResponsiveContainerProps\n extends Merge<\n CSSUIProps,\n Omit<Recharts.ResponsiveContainerProps, \"children\">\n > {}\nexport interface AreaProps\n extends Merge<\n Merge<CSSUIProps, Recharts.AreaProps>,\n {\n color: CSSUIProps[\"color\"]\n dot?: DotProps\n activeDot?: DotProps\n dimDot?: DotProps\n dimArea?: Partial<AreaProps>\n }\n > {}\nexport interface LineProps\n extends Merge<\n Merge<CSSUIProps, Recharts.LineProps>,\n {\n color: CSSUIProps[\"color\"]\n activeDot?: DotProps\n dot?: DotProps\n dimDot?: DotProps\n dimLine?: Partial<LineProps>\n }\n > {}\nexport interface BarProps\n extends Merge<\n Merge<CSSUIProps, Recharts.BarProps>,\n {\n color: CSSUIProps[\"color\"]\n activeBar?: Merge<SVGProps<SVGPathElement>, CSSUIProps>\n background?: Merge<SVGProps<SVGPathElement>, CSSUIProps>\n dimBar?: Partial<BarProps>\n }\n > {}\nexport interface RadarProps\n extends Merge<\n Merge<CSSUIProps, Recharts.RadarProps>,\n {\n color: CSSUIProps[\"color\"]\n dot?: DotProps\n activeDot?: DotProps\n dimDot?: DotProps\n dimRadar?: Partial<RadarProps>\n }\n > {}\nexport interface PieProps\n extends Merge<\n Merge<Recharts.PieProps, CSSUIProps>,\n {\n activeShape?: Partial<PieProps>\n inactiveShape?: Partial<PieProps>\n label?: HTMLUIProps<\"text\">\n labelLine?: HTMLUIProps<\"path\">\n }\n > {}\nexport interface CellProps extends CSSUIProps {\n name: string\n value: number\n dimCell?: Partial<CellProps>\n}\nexport interface RadialBarProps\n extends Merge<\n Merge<Recharts.RadialBarProps, CSSUIProps>,\n {\n background?: Partial<RadialBarProps>\n dimRadialBar?: CSSUIProps\n }\n > {}\nexport interface DotProps\n extends Merge<Omit<Recharts.DotProps, \"ref\">, CSSUIProps> {}\nexport interface XAxisProps\n extends Merge<\n CSSUIProps,\n Omit<Recharts.XAxisProps, \"color\" | \"stroke\" | \"fill\">\n > {}\nexport interface YAxisProps\n extends Merge<CSSUIProps, Omit<Recharts.YAxisProps, \"color\">> {}\nexport interface LegendProps\n extends Merge<CSSUIProps, Omit<Recharts.LegendProps, \"ref\">> {}\nexport interface TooltipProps\n extends Merge<\n Merge<CSSUIProps, Omit<Recharts.TooltipProps<any, any>, \"ref\">>,\n { cursor?: CSSUIProps }\n > {}\nexport interface GridProps\n extends Merge<CSSUIProps, Recharts.CartesianGridProps> {}\nexport interface PolarGridProps\n extends Merge<CSSUIProps, Recharts.PolarGridProps> {}\nexport interface PolarAngleAxisProps\n extends Merge<Recharts.PolarAngleAxisProps, CSSUIProps> {}\nexport interface PolarRadiusAxisProps\n extends Merge<CSSUIProps, Recharts.PolarRadiusAxisProps> {}\nexport interface LabelProps\n extends Merge<CSSUIProps, Omit<Recharts.LabelProps, \"fill\">> {}\nexport interface LabelListProps\n extends Merge<Recharts.LabelListProps<Dict>, Omit<CSSUIProps, \"position\">> {}\nexport type ChartTooltipProps = Recharts.TooltipProps<\n number | string | (number | string)[],\n number | string\n>\nexport type ChartTooltip =\n | ReactElement\n | ((props: ChartTooltipProps) => ReactNode)\nexport interface ChartLabelProps\n extends Omit<React.SVGProps<SVGTextElement>, \"viewBox\" | \"fill\" | \"offset\">,\n LabelProps {}\nexport type ChartLabel = ReactElement | ((props: ChartLabelProps) => ReactNode)\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../src/chart.types.ts"],"sourcesContent":["import type { CSSUIProps, HTMLUIProps } from \"@yamada-ui/core\"\nimport type { Dict, Merge } from \"@yamada-ui/utils\"\nimport type {\n ComponentPropsWithoutRef,\n ReactElement,\n ReactNode,\n SVGProps,\n} from \"react\"\nimport type * as Recharts from \"recharts\"\n\nexport type ChartLayoutType = \"horizontal\" | \"vertical\"\nexport type AreaChartType = \"default\" | \"percent\" | \"split\" | \"stacked\"\nexport type BarChartType = Exclude<AreaChartType, \"split\">\nexport type ChartAxisType = \"none\" | \"x\" | \"xy\" | \"y\"\nexport type ChartCurveType =\n | \"bump\"\n | \"linear\"\n | \"monotone\"\n | \"natural\"\n | \"step\"\n | \"stepAfter\"\n | \"stepBefore\"\nexport type TooltipDataSourceType = \"all\" | \"segment\"\n\nexport interface AreaChartProps\n extends Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.AreaChart>\n > {}\nexport interface BarChartProps\n extends Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.BarChart>\n > {}\nexport interface LineChartProps\n extends Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.LineChart>\n > {}\nexport interface RadarChartProps\n extends Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.RadarChart>\n > {}\nexport interface PieChartProps\n extends Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.PieChart>\n > {}\nexport interface RadialChartProps\n extends Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.RadialBarChart>\n > {}\nexport interface ReferenceLineProps\n extends Merge<CSSUIProps, Recharts.ReferenceLineProps> {}\nexport interface ResponsiveContainerProps\n extends Merge<\n CSSUIProps,\n Omit<Recharts.ResponsiveContainerProps, \"children\">\n > {}\nexport interface AreaProps\n extends Merge<\n Merge<CSSUIProps, Recharts.AreaProps>,\n {\n color: CSSUIProps[\"color\"]\n activeDot?: DotProps\n dimArea?: Partial<AreaProps>\n dimDot?: DotProps\n dot?: DotProps\n }\n > {}\nexport interface LineProps\n extends Merge<\n Merge<CSSUIProps, Recharts.LineProps>,\n {\n color: CSSUIProps[\"color\"]\n activeDot?: DotProps\n dimDot?: DotProps\n dimLine?: Partial<LineProps>\n dot?: DotProps\n }\n > {}\nexport interface BarProps\n extends Merge<\n Merge<CSSUIProps, Recharts.BarProps>,\n {\n color: CSSUIProps[\"color\"]\n activeBar?: Merge<SVGProps<SVGPathElement>, CSSUIProps>\n background?: Merge<SVGProps<SVGPathElement>, CSSUIProps>\n dimBar?: Partial<BarProps>\n }\n > {}\nexport interface RadarProps\n extends Merge<\n Merge<CSSUIProps, Recharts.RadarProps>,\n {\n color: CSSUIProps[\"color\"]\n activeDot?: DotProps\n dimDot?: DotProps\n dimRadar?: Partial<RadarProps>\n dot?: DotProps\n }\n > {}\nexport interface PieProps\n extends Merge<\n Merge<Recharts.PieProps, CSSUIProps>,\n {\n activeShape?: Partial<PieProps>\n inactiveShape?: Partial<PieProps>\n label?: HTMLUIProps<\"text\">\n labelLine?: HTMLUIProps<\"path\">\n }\n > {}\nexport interface CellProps extends CSSUIProps {\n name: string\n value: number\n dimCell?: Partial<CellProps>\n}\nexport interface RadialBarProps\n extends Merge<\n Merge<Recharts.RadialBarProps, CSSUIProps>,\n {\n background?: Partial<RadialBarProps>\n dimRadialBar?: CSSUIProps\n }\n > {}\nexport interface DotProps\n extends Merge<Omit<Recharts.DotProps, \"ref\">, CSSUIProps> {}\nexport interface XAxisProps\n extends Merge<\n CSSUIProps,\n Omit<Recharts.XAxisProps, \"color\" | \"fill\" | \"stroke\">\n > {}\nexport interface YAxisProps\n extends Merge<CSSUIProps, Omit<Recharts.YAxisProps, \"color\">> {}\nexport interface LegendProps\n extends Merge<CSSUIProps, Omit<Recharts.LegendProps, \"ref\">> {}\nexport interface TooltipProps\n extends Merge<\n Merge<CSSUIProps, Omit<Recharts.TooltipProps<any, any>, \"ref\">>,\n { cursor?: CSSUIProps }\n > {}\nexport interface GridProps\n extends Merge<CSSUIProps, Recharts.CartesianGridProps> {}\nexport interface PolarGridProps\n extends Merge<CSSUIProps, Recharts.PolarGridProps> {}\nexport interface PolarAngleAxisProps\n extends Merge<Recharts.PolarAngleAxisProps, CSSUIProps> {}\nexport interface PolarRadiusAxisProps\n extends Merge<CSSUIProps, Recharts.PolarRadiusAxisProps> {}\nexport interface LabelProps\n extends Merge<CSSUIProps, Omit<Recharts.LabelProps, \"fill\">> {}\nexport interface LabelListProps\n extends Merge<Recharts.LabelListProps<Dict>, Omit<CSSUIProps, \"position\">> {}\nexport type ChartTooltipProps = Recharts.TooltipProps<\n (number | string)[] | number | string,\n number | string\n>\nexport type ChartTooltip =\n | ((props: ChartTooltipProps) => ReactNode)\n | ReactElement\nexport interface ChartLabelProps\n extends Omit<React.SVGProps<SVGTextElement>, \"fill\" | \"offset\" | \"viewBox\">,\n LabelProps {}\nexport type ChartLabel = ((props: ChartLabelProps) => ReactNode) | ReactElement\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
  import {
3
3
  useTooltip
4
- } from "./chunk-A3IWA366.mjs";
4
+ } from "./chunk-VK65X6Q2.mjs";
5
5
 
6
6
  // src/chart-tooltip.tsx
7
7
  import { forwardRef, ui } from "@yamada-ui/core";
@@ -9,22 +9,22 @@ import { cx, isArray } from "@yamada-ui/utils";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
10
  var ChartTooltip = forwardRef(
11
11
  ({
12
- label,
13
- dataKey = "value",
14
12
  className,
15
- payload = [],
16
- valueFormatter,
13
+ dataKey = "value",
14
+ isRadialChart,
15
+ label,
17
16
  labelFormatter,
17
+ payload = [],
18
18
  unit,
19
- isRadialChart,
19
+ valueFormatter,
20
20
  ...rest
21
21
  }, ref) => {
22
22
  var _a;
23
23
  const { styles } = useTooltip();
24
24
  const items = payload.map(
25
25
  ({
26
- color: colorProp,
27
26
  name: nameProp,
27
+ color: colorProp,
28
28
  [dataKey]: valueProp,
29
29
  payload: payload2
30
30
  } = {}, index) => {
@@ -100,4 +100,4 @@ ChartTooltip.__ui__ = "ChartTooltip";
100
100
  export {
101
101
  ChartTooltip
102
102
  };
103
- //# sourceMappingURL=chunk-YSPGYMRF.mjs.map
103
+ //# sourceMappingURL=chunk-5VLSGWQD.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/chart-tooltip.tsx"],"sourcesContent":["import { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx, isArray } from \"@yamada-ui/utils\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport { useTooltip } from \"./use-chart\"\n\nexport interface ChartTooltipProps {\n label?: string\n dataKey?: string\n payload: Dict[] | undefined\n valueFormatter?: (value: any) => string\n labelFormatter?: (label: string) => string\n unit?: string\n isRadialChart?: boolean\n}\n\nexport const ChartTooltip = forwardRef<ChartTooltipProps, \"div\">(\n (\n {\n label,\n dataKey = \"value\",\n className,\n payload = [],\n valueFormatter,\n labelFormatter,\n unit,\n isRadialChart,\n ...rest\n },\n ref,\n ) => {\n const { styles } = useTooltip()\n\n const items = payload.map(\n (\n {\n color: colorProp,\n name: nameProp,\n [dataKey]: valueProp,\n payload,\n } = {},\n index,\n ) => {\n const name = isRadialChart ? payload?.name : nameProp\n const color = colorProp ?? payload?.color\n let value: string\n\n if (isArray(valueProp)) {\n value = valueProp\n .map((value) => {\n return `${valueFormatter?.(value) ?? value}`\n })\n .join(\" - \")\n } else {\n value = valueFormatter?.(valueProp) ?? valueProp\n }\n\n return (\n <ui.div\n className=\"ui-chart__tooltip-item\"\n key={`tooltip-payload-${index}`}\n __css={styles.tooltipItem}\n >\n <ui.div\n className=\"ui-chart__tooltip-swatch\"\n background={color}\n __css={styles.tooltipSwatch}\n />\n\n <ui.span\n className=\"ui-chart__tooltip-label\"\n __css={styles.tooltipLabel}\n >\n {name}\n </ui.span>\n\n <ui.span\n className=\"ui-chart__tooltip-value\"\n __css={styles.tooltipValue}\n >\n {value}\n {unit ? unit : \"\"}\n </ui.span>\n </ui.div>\n )\n },\n )\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-chart__tooltip\", className)}\n __css={styles.tooltip}\n {...rest}\n >\n {label ? (\n <ui.p className=\"ui-chart__tooltip-title\" __css={styles.tooltipTitle}>\n {labelFormatter?.(label) ?? label}\n </ui.p>\n ) : null}\n\n <ui.div className=\"ui-chart__tooltip-list\" __css={styles.tooltipList}>\n {items}\n </ui.div>\n </ui.div>\n )\n },\n)\n\nChartTooltip.displayName = \"ChartTooltip\"\nChartTooltip.__ui__ = \"ChartTooltip\"\n"],"mappings":";;;;;;AAAA,SAAS,YAAY,UAAU;AAC/B,SAAS,IAAI,eAAe;AA6DhB,cAaA,YAbA;AA/CL,IAAM,eAAe;AAAA,EAC1B,CACE;AAAA,IACE;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,UAAU,CAAC;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GACA,QACG;AA7BP;AA8BI,UAAM,EAAE,OAAO,IAAI,WAAW;AAE9B,UAAM,QAAQ,QAAQ;AAAA,MACpB,CACE;AAAA,QACE,OAAO;AAAA,QACP,MAAM;AAAA,QACN,CAAC,UAAU;AAAA,QACX,SAAAA;AAAA,MACF,IAAI,CAAC,GACL,UACG;AAzCX,YAAAC;AA0CQ,cAAM,OAAO,gBAAgBD,YAAA,gBAAAA,SAAS,OAAO;AAC7C,cAAM,QAAQ,gCAAaA,YAAA,gBAAAA,SAAS;AACpC,YAAI;AAEJ,YAAI,QAAQ,SAAS,GAAG;AACtB,kBAAQ,UACL,IAAI,CAACE,WAAU;AAhD5B,gBAAAD;AAiDc,mBAAO,IAAGA,MAAA,iDAAiBC,YAAjB,OAAAD,MAA2BC,MAAK;AAAA,UAC5C,CAAC,EACA,KAAK,KAAK;AAAA,QACf,OAAO;AACL,mBAAQD,MAAA,iDAAiB,eAAjB,OAAAA,MAA+B;AAAA,QACzC;AAEA,eACE;AAAA,UAAC,GAAG;AAAA,UAAH;AAAA,YACC,WAAU;AAAA,YAEV,OAAO,OAAO;AAAA,YAEd;AAAA;AAAA,gBAAC,GAAG;AAAA,gBAAH;AAAA,kBACC,WAAU;AAAA,kBACV,YAAY;AAAA,kBACZ,OAAO,OAAO;AAAA;AAAA,cAChB;AAAA,cAEA;AAAA,gBAAC,GAAG;AAAA,gBAAH;AAAA,kBACC,WAAU;AAAA,kBACV,OAAO,OAAO;AAAA,kBAEb;AAAA;AAAA,cACH;AAAA,cAEA;AAAA,gBAAC,GAAG;AAAA,gBAAH;AAAA,kBACC,WAAU;AAAA,kBACV,OAAO,OAAO;AAAA,kBAEb;AAAA;AAAA,oBACA,OAAO,OAAO;AAAA;AAAA;AAAA,cACjB;AAAA;AAAA;AAAA,UAtBK,mBAAmB,KAAK;AAAA,QAuB/B;AAAA,MAEJ;AAAA,IACF;AAEA,WACE;AAAA,MAAC,GAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,WAAW,GAAG,qBAAqB,SAAS;AAAA,QAC5C,OAAO,OAAO;AAAA,QACb,GAAG;AAAA,QAEH;AAAA,kBACC,oBAAC,GAAG,GAAH,EAAK,WAAU,2BAA0B,OAAO,OAAO,cACrD,iEAAiB,WAAjB,YAA2B,OAC9B,IACE;AAAA,UAEJ,oBAAC,GAAG,KAAH,EAAO,WAAU,0BAAyB,OAAO,OAAO,aACtD,iBACH;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,aAAa,cAAc;AAC3B,aAAa,SAAS;","names":["payload","_a","value"]}
1
+ {"version":3,"sources":["../src/chart-tooltip.tsx"],"sourcesContent":["import type { Dict } from \"@yamada-ui/utils\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx, isArray } from \"@yamada-ui/utils\"\nimport { useTooltip } from \"./use-chart\"\n\nexport interface ChartTooltipProps {\n payload: Dict[] | undefined\n dataKey?: string\n isRadialChart?: boolean\n label?: string\n labelFormatter?: (label: string) => string\n unit?: string\n valueFormatter?: (value: any) => string\n}\n\nexport const ChartTooltip = forwardRef<ChartTooltipProps, \"div\">(\n (\n {\n className,\n dataKey = \"value\",\n isRadialChart,\n label,\n labelFormatter,\n payload = [],\n unit,\n valueFormatter,\n ...rest\n },\n ref,\n ) => {\n const { styles } = useTooltip()\n\n const items = payload.map(\n (\n {\n name: nameProp,\n color: colorProp,\n [dataKey]: valueProp,\n payload,\n } = {},\n index,\n ) => {\n const name = isRadialChart ? payload?.name : nameProp\n const color = colorProp ?? payload?.color\n let value: string\n\n if (isArray(valueProp)) {\n value = valueProp\n .map((value) => {\n return `${valueFormatter?.(value) ?? value}`\n })\n .join(\" - \")\n } else {\n value = valueFormatter?.(valueProp) ?? valueProp\n }\n\n return (\n <ui.div\n key={`tooltip-payload-${index}`}\n className=\"ui-chart__tooltip-item\"\n __css={styles.tooltipItem}\n >\n <ui.div\n className=\"ui-chart__tooltip-swatch\"\n background={color}\n __css={styles.tooltipSwatch}\n />\n\n <ui.span\n className=\"ui-chart__tooltip-label\"\n __css={styles.tooltipLabel}\n >\n {name}\n </ui.span>\n\n <ui.span\n className=\"ui-chart__tooltip-value\"\n __css={styles.tooltipValue}\n >\n {value}\n {unit ? unit : \"\"}\n </ui.span>\n </ui.div>\n )\n },\n )\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-chart__tooltip\", className)}\n __css={styles.tooltip}\n {...rest}\n >\n {label ? (\n <ui.p className=\"ui-chart__tooltip-title\" __css={styles.tooltipTitle}>\n {labelFormatter?.(label) ?? label}\n </ui.p>\n ) : null}\n\n <ui.div className=\"ui-chart__tooltip-list\" __css={styles.tooltipList}>\n {items}\n </ui.div>\n </ui.div>\n )\n },\n)\n\nChartTooltip.displayName = \"ChartTooltip\"\nChartTooltip.__ui__ = \"ChartTooltip\"\n"],"mappings":";;;;;;AACA,SAAS,YAAY,UAAU;AAC/B,SAAS,IAAI,eAAe;AA4DhB,cAaA,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,OAAO;AAAA;AAAA;AAAA,cACjB;AAAA;AAAA;AAAA,UAvBK,mBAAmB,KAAK;AAAA,QAwB/B;AAAA,MAEJ;AAAA,IACF;AAEA,WACE;AAAA,MAAC,GAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,WAAW,GAAG,qBAAqB,SAAS;AAAA,QAC5C,OAAO,OAAO;AAAA,QACb,GAAG;AAAA,QAEH;AAAA,kBACC,oBAAC,GAAG,GAAH,EAAK,WAAU,2BAA0B,OAAO,OAAO,cACrD,iEAAiB,WAAjB,YAA2B,OAC9B,IACE;AAAA,UAEJ,oBAAC,GAAG,KAAH,EAAO,WAAU,0BAAyB,OAAO,OAAO,aACtD,iBACH;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,aAAa,cAAc;AAC3B,aAAa,SAAS;","names":["payload","_a","value"]}
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-6YUJLLGN.mjs";
5
5
  import {
6
6
  getComponentProps
7
- } from "./chunk-QL3DB7OJ.mjs";
7
+ } from "./chunk-TXNC7GLT.mjs";
8
8
 
9
9
  // src/use-polar-grid.tsx
10
10
  import { useTheme } from "@yamada-ui/core";
@@ -42,4 +42,4 @@ var usePolarGrid = ({
42
42
  export {
43
43
  usePolarGrid
44
44
  };
45
- //# sourceMappingURL=chunk-XYUYAHJX.mjs.map
45
+ //# sourceMappingURL=chunk-6JRMEI6J.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/use-polar-grid.tsx"],"sourcesContent":["import type { CSSUIObject, PropGetter } from \"@yamada-ui/core\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport type * as Recharts from \"recharts\"\nimport type { PolarGridProps } from \"./chart.types\"\nimport { useTheme } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useCallback, useMemo } from \"react\"\nimport { getComponentProps } from \"./chart-utils\"\nimport { polarGridProperties } from \"./rechart-properties\"\n\nexport interface UsePolarGridOptions {\n /**\n * Dash array for the grid lines and cursor. The first number is the length of the solid line section and the second number is the length of the interval.\n */\n strokeDasharray?: number | string\n /**\n * Props passed down to recharts `PolarGrid` component.\n */\n polarGridProps?: PolarGridProps\n}\n\ninterface UsePolarGridProps extends UsePolarGridOptions {\n styles: Dict<CSSUIObject | undefined>\n}\n\nexport const usePolarGrid = ({\n strokeDasharray,\n styles,\n ...rest\n}: UsePolarGridProps) => {\n const { theme } = useTheme()\n\n const [polarGridProps, polarGridClassName] = useMemo(\n () =>\n getComponentProps<Dict, string>(\n [rest.polarGridProps ?? {}, polarGridProperties],\n styles.polarGrid,\n )(theme),\n [rest.polarGridProps, styles.polarGrid, theme],\n )\n\n const getPolarGridProps: PropGetter<\n Recharts.PolarGridProps,\n Recharts.PolarGridProps\n > = useCallback(\n ({ className, ...props } = {}, ref = null) => ({\n ref,\n className: cx(className, polarGridClassName),\n strokeDasharray,\n ...props,\n ...polarGridProps,\n }),\n [polarGridClassName, polarGridProps, strokeDasharray],\n )\n\n return { getPolarGridProps }\n}\n"],"mappings":";;;;;;;;;AAIA,SAAS,gBAAgB;AACzB,SAAS,UAAU;AACnB,SAAS,aAAa,eAAe;AAmB9B,IAAM,eAAe,CAAC;AAAA,EAC3B;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAyB;AACvB,QAAM,EAAE,MAAM,IAAI,SAAS;AAE3B,QAAM,CAAC,gBAAgB,kBAAkB,IAAI;AAAA,IAC3C,MAAG;AAjCP;AAkCM;AAAA,QACE,EAAC,UAAK,mBAAL,YAAuB,CAAC,GAAG,mBAAmB;AAAA,QAC/C,OAAO;AAAA,MACT,EAAE,KAAK;AAAA;AAAA,IACT,CAAC,KAAK,gBAAgB,OAAO,WAAW,KAAK;AAAA,EAC/C;AAEA,QAAM,oBAGF;AAAA,IACF,CAAC,EAAE,WAAW,GAAG,MAAM,IAAI,CAAC,GAAG,MAAM,UAAU;AAAA,MAC7C;AAAA,MACA,WAAW,GAAG,WAAW,kBAAkB;AAAA,MAC3C;AAAA,MACA,GAAG;AAAA,MACH,GAAG;AAAA,IACL;AAAA,IACA,CAAC,oBAAoB,gBAAgB,eAAe;AAAA,EACtD;AAEA,SAAO,EAAE,kBAAkB;AAC7B;","names":[]}
@@ -6,27 +6,27 @@ import {
6
6
  } from "./chunk-6YUJLLGN.mjs";
7
7
  import {
8
8
  getComponentProps
9
- } from "./chunk-QL3DB7OJ.mjs";
9
+ } from "./chunk-TXNC7GLT.mjs";
10
10
 
11
11
  // src/use-line-chart.ts
12
12
  import { getVar, useTheme } from "@yamada-ui/core";
13
- import { cx } from "@yamada-ui/utils";
13
+ import { cx, runIfFunc } from "@yamada-ui/utils";
14
14
  import { useCallback, useMemo, useState } from "react";
15
15
  var useLineChart = ({
16
+ connectNulls = true,
17
+ curveType = "monotone",
16
18
  data,
17
- series,
19
+ fillOpacity = 1,
18
20
  layoutType = "horizontal",
19
- withDots = true,
20
- withActiveDots = true,
21
- curveType = "monotone",
21
+ series,
22
22
  strokeWidth = 2,
23
- connectNulls = true,
24
- referenceLineProps,
25
- fillOpacity = 1,
23
+ styles,
26
24
  syncId,
25
+ withActiveDots = true,
26
+ withDots = true,
27
27
  xAxisLabel,
28
28
  yAxisLabel,
29
- styles,
29
+ referenceLineProps,
30
30
  ...rest
31
31
  }) => {
32
32
  var _a;
@@ -34,10 +34,10 @@ var useLineChart = ({
34
34
  const [highlightedArea, setHighlightedArea] = useState(null);
35
35
  const shouldHighlight = highlightedArea !== null;
36
36
  const {
37
- dot = {},
38
37
  activeDot = {},
39
38
  dimDot,
40
39
  dimLine,
40
+ dot = {},
41
41
  ...computedLineProps
42
42
  } = (_a = rest.lineProps) != null ? _a : {};
43
43
  const lineColors = useMemo(
@@ -118,11 +118,11 @@ var useLineChart = ({
118
118
  const linePropList = useMemo(
119
119
  () => series.map((props, index) => {
120
120
  const {
121
- dataKey,
122
- dot: dot2 = {},
123
121
  activeDot: activeDot2 = {},
122
+ dataKey,
124
123
  dimDot: dimDot2 = {},
125
124
  dimLine: dimLine2 = {},
125
+ dot: dot2 = {},
126
126
  ...computedProps
127
127
  } = props;
128
128
  const color = getVar(`line-${index}`)(theme);
@@ -148,8 +148,8 @@ var useLineChart = ({
148
148
  resolvedActiveDot = {
149
149
  className: cx("ui-line-chart__active-dot", className),
150
150
  fill: color,
151
- stroke: color,
152
151
  r: 4,
152
+ stroke: color,
153
153
  ...rest3
154
154
  };
155
155
  } else {
@@ -178,9 +178,9 @@ var useLineChart = ({
178
178
  }
179
179
  return {
180
180
  ...rest2,
181
+ activeDot: resolvedActiveDot,
181
182
  color,
182
183
  dataKey,
183
- activeDot: resolvedActiveDot,
184
184
  dot: resolvedDot
185
185
  };
186
186
  }),
@@ -209,12 +209,12 @@ var useLineChart = ({
209
209
  className: cx(className, lineChartClassName),
210
210
  data,
211
211
  layout: layoutType,
212
- syncId,
213
212
  margin: {
214
213
  bottom: xAxisLabel ? 30 : void 0,
215
214
  left: yAxisLabel ? 10 : void 0,
216
215
  right: yAxisLabel ? 5 : void 0
217
216
  },
217
+ syncId,
218
218
  ...props,
219
219
  ...chartProps
220
220
  }),
@@ -229,20 +229,21 @@ var useLineChart = ({
229
229
  ]
230
230
  );
231
231
  const getLineProps = useCallback(
232
- ({ index, className: classNameProp, ...props }) => {
233
- const { color, className, dataKey, activeDot: activeDot2, dot: dot2, ...rest2 } = linePropList[index];
232
+ ({ className: classNameProp, index, ...props }) => {
233
+ var _a2;
234
+ const { className, activeDot: activeDot2, color, dataKey, dot: dot2, ...rest2 } = (_a2 = linePropList[index]) != null ? _a2 : {};
234
235
  return {
236
+ type: curveType,
237
+ name: runIfFunc(dataKey, {}),
235
238
  className: cx(classNameProp, className),
236
239
  activeDot: activeDot2,
237
- dot: dot2,
238
- name: dataKey,
239
- type: curveType,
240
+ connectNulls,
240
241
  dataKey,
242
+ dot: dot2,
241
243
  fill: color,
242
- strokeWidth,
243
- stroke: color,
244
244
  isAnimationActive: false,
245
- connectNulls,
245
+ stroke: color,
246
+ strokeWidth,
246
247
  ...props,
247
248
  ...rest2
248
249
  };
@@ -250,14 +251,14 @@ var useLineChart = ({
250
251
  [connectNulls, curveType, linePropList, strokeWidth]
251
252
  );
252
253
  return {
253
- getLineProps,
254
- getLineChartProps,
255
254
  lineVars,
256
- setHighlightedArea
255
+ setHighlightedArea,
256
+ getLineChartProps,
257
+ getLineProps
257
258
  };
258
259
  };
259
260
 
260
261
  export {
261
262
  useLineChart
262
263
  };
263
- //# sourceMappingURL=chunk-VKBRU4Z4.mjs.map
264
+ //# sourceMappingURL=chunk-AYVTBRCS.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/use-line-chart.ts"],"sourcesContent":["import type {\n CSSUIObject,\n CSSUIProps,\n PropGetter,\n RequiredPropGetter,\n} from \"@yamada-ui/core\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport type { ComponentPropsWithoutRef } from \"react\"\nimport type * as Recharts from \"recharts\"\nimport type {\n ChartCurveType,\n ChartLayoutType,\n LineChartProps,\n LineProps,\n ReferenceLineProps,\n} from \"./chart.types\"\nimport { getVar, useTheme } from \"@yamada-ui/core\"\nimport { cx, runIfFunc } from \"@yamada-ui/utils\"\nimport { useCallback, useMemo, useState } from \"react\"\nimport { getComponentProps } from \"./chart-utils\"\nimport {\n dotProperties,\n lineChartProperties,\n lineProperties,\n} from \"./rechart-properties\"\n\nexport interface UseLineChartOptions {\n /**\n * Chart data.\n */\n data: Dict[]\n /**\n * An array of objects with `dataKey` and `color` keys. Determines which data should be consumed from the `data` array.\n */\n series: LineProps[]\n /**\n * Determines whether points with `null` values should be connected.\n *\n * @default true\n */\n connectNulls?: boolean\n /**\n * Type of the curve.\n *\n * @default `monotone`\n */\n curveType?: ChartCurveType\n /**\n * Controls fill opacity of all lines.\n *\n * @default 1\n */\n fillOpacity?: [number, number] | number\n /**\n * Chart orientation.\n *\n * @default 'horizontal'\n */\n layoutType?: ChartLayoutType\n /**\n * Stroke width for the chart lines.\n *\n * @default 2\n */\n strokeWidth?: number\n /**\n * If any two categorical charts have the same syncId,\n * these two charts can sync the position tooltip, and the startIndex, endIndex of Brush.\n */\n syncId?: number | string\n /**\n * Determines whether activeDots should be displayed.\n *\n * @default true\n */\n withActiveDots?: boolean\n /**\n * Determines whether dots should be displayed.\n *\n * @default true\n */\n withDots?: boolean\n /**\n * A label to display below the X axis.\n */\n xAxisLabel?: string\n /**\n * A label to display below the Y axis.\n */\n yAxisLabel?: string\n /**\n * Props passed down to recharts `LineChart` component.\n */\n chartProps?: LineChartProps\n /**\n * Props for the lines.\n */\n lineProps?: Partial<LineProps>\n /**\n * Reference lines that should be displayed on the chart.\n */\n referenceLineProps?: ReferenceLineProps[]\n}\n\ninterface UseLineChartProps extends UseLineChartOptions {\n styles: Dict<CSSUIObject | undefined>\n}\n\nexport const useLineChart = ({\n connectNulls = true,\n curveType = \"monotone\",\n data,\n fillOpacity = 1,\n layoutType = \"horizontal\",\n series,\n strokeWidth = 2,\n styles,\n syncId,\n withActiveDots = true,\n withDots = true,\n xAxisLabel,\n yAxisLabel,\n referenceLineProps,\n ...rest\n}: UseLineChartProps) => {\n const { theme } = useTheme()\n const [highlightedArea, setHighlightedArea] = useState<null | string>(null)\n const shouldHighlight = highlightedArea !== null\n const {\n activeDot = {},\n dimDot,\n dimLine,\n dot = {},\n ...computedLineProps\n } = rest.lineProps ?? {}\n\n const lineColors: CSSUIProps[\"vars\"] = useMemo(\n () =>\n series.map(({ color }, index) => ({\n name: `line-${index}`,\n token: \"colors\",\n value: color ?? \"transparent\",\n })),\n [series],\n )\n\n const referenceLineColors: CSSUIProps[\"vars\"] = useMemo(\n () =>\n referenceLineProps\n ? referenceLineProps.map(({ color }, index) => ({\n name: `reference-line-${index}`,\n token: \"colors\",\n value: color ?? \"transparent\",\n }))\n : [],\n [referenceLineProps],\n )\n\n const lineVars: CSSUIProps[\"vars\"] = useMemo(\n () => [\n ...lineColors,\n ...referenceLineColors,\n { name: \"fill-opacity\", value: fillOpacity },\n ],\n [fillOpacity, lineColors, referenceLineColors],\n )\n\n const [chartProps, lineChartClassName] = useMemo(\n () =>\n getComponentProps<Dict, string>(\n [rest.chartProps ?? {}, lineChartProperties],\n styles.chart,\n )(theme),\n [rest.chartProps, styles.chart, theme],\n )\n\n const [lineProps, lineClassName] = useMemo(() => {\n const resolvedLineProps = {\n fillOpacity: \"$fill-opacity\",\n strokeOpacity: \"$fill-opacity\",\n ...computedLineProps,\n }\n\n return getComponentProps<Dict, string>(\n [resolvedLineProps, lineProperties],\n styles.line,\n )(theme)\n }, [computedLineProps, styles.line, theme])\n\n const [dimLineProps, dimLineClassName] = useMemo(() => {\n const resolvedDimLine = { fillOpacity: 0, strokeOpacity: 0.3, ...dimLine }\n\n return getComponentProps<Dict, string>([resolvedDimLine, lineProperties])(\n theme,\n )\n }, [dimLine, theme])\n\n const [dotProps, dotClassName] = useMemo(() => {\n const resolvedDot = { fillOpacity: 1, strokeOpacity: 1, ...dot }\n\n return getComponentProps<Dict, string>(\n [resolvedDot, dotProperties],\n styles.dot,\n )(theme)\n }, [dot, styles.dot, theme])\n\n const [activeDotProps, activeDotClassName] = useMemo(\n () =>\n getComponentProps<Dict, string>(\n [activeDot, dotProperties],\n styles.activeDot,\n )(theme),\n [activeDot, styles.activeDot, theme],\n )\n\n const [dimDotProps, dimDotClassName] = useMemo(() => {\n const resolvedDimDot = {\n fillOpacity: 0,\n strokeOpacity: 0,\n ...dimDot,\n }\n\n return getComponentProps<Dict, string>([resolvedDimDot, dotProperties])(\n theme,\n )\n }, [dimDot, theme])\n\n const linePropList = useMemo(\n () =>\n series.map((props, index) => {\n const {\n activeDot = {},\n dataKey,\n dimDot = {},\n dimLine = {},\n dot = {},\n ...computedProps\n } = props\n const color = getVar(`line-${index}`)(theme)\n const dimmed = shouldHighlight && highlightedArea !== dataKey\n const computedDimLine = { ...dimLineProps, ...dimLine }\n const resolvedProps = {\n ...lineProps,\n ...computedProps,\n ...(dimmed ? computedDimLine : {}),\n }\n\n const rest = getComponentProps<Dict, string>(\n [resolvedProps, lineProperties],\n lineClassName,\n dimmed ? dimLineClassName : undefined,\n )(theme, true)\n\n let resolvedActiveDot: boolean | Recharts.DotProps\n\n if (withActiveDots) {\n const computedActiveDot = { ...activeDotProps, ...activeDot }\n\n const [rest, className] = getComponentProps(\n [computedActiveDot, dotProperties],\n activeDotClassName,\n )(theme)\n\n resolvedActiveDot = {\n className: cx(\"ui-line-chart__active-dot\", className),\n fill: color,\n r: 4,\n stroke: color,\n ...rest,\n } as Recharts.DotProps\n } else {\n resolvedActiveDot = false\n }\n\n let resolvedDot: boolean | Recharts.DotProps\n\n if (withDots) {\n const computedDimDot = { ...dimDotProps, ...dimDot }\n const computedDot = {\n ...dotProps,\n ...dot,\n ...(dimmed ? computedDimDot : {}),\n }\n\n const [rest, className] = getComponentProps(\n [computedDot, dotProperties],\n dotClassName,\n dimmed ? dimDotClassName : undefined,\n )(theme)\n\n resolvedDot = {\n className: cx(\"ui-line-chart__dot\", className),\n fill: color,\n ...rest,\n } as Recharts.DotProps\n } else {\n resolvedDot = false\n }\n\n return {\n ...rest,\n activeDot: resolvedActiveDot,\n color,\n dataKey,\n dot: resolvedDot,\n }\n }),\n [\n series,\n shouldHighlight,\n highlightedArea,\n dimLineProps,\n lineProps,\n lineClassName,\n dimLineClassName,\n theme,\n withActiveDots,\n withDots,\n activeDotProps,\n activeDotClassName,\n dimDotProps,\n dotProps,\n dotClassName,\n dimDotClassName,\n ],\n )\n\n const getLineChartProps: PropGetter<\n ComponentPropsWithoutRef<typeof Recharts.LineChart>,\n ComponentPropsWithoutRef<typeof Recharts.LineChart>\n > = useCallback(\n ({ className, ...props } = {}, ref = null) => ({\n ref,\n className: cx(className, lineChartClassName),\n data,\n layout: layoutType,\n margin: {\n bottom: xAxisLabel ? 30 : undefined,\n left: yAxisLabel ? 10 : undefined,\n right: yAxisLabel ? 5 : undefined,\n },\n syncId,\n ...props,\n ...chartProps,\n }),\n [\n lineChartClassName,\n data,\n layoutType,\n syncId,\n xAxisLabel,\n yAxisLabel,\n chartProps,\n ],\n )\n\n const getLineProps: RequiredPropGetter<\n { index: number } & Partial<Recharts.LineProps>,\n Omit<Recharts.LineProps, \"ref\">\n > = useCallback(\n ({ className: classNameProp, index, ...props }) => {\n const { className, activeDot, color, dataKey, dot, ...rest } =\n linePropList[index] ?? {}\n\n return {\n type: curveType,\n name: runIfFunc(dataKey, {}),\n className: cx(classNameProp, className),\n activeDot,\n connectNulls,\n dataKey,\n dot,\n fill: color,\n isAnimationActive: false,\n stroke: color,\n strokeWidth,\n ...(props as Omit<Recharts.LineProps, \"dataKey\">),\n ...rest,\n }\n },\n [connectNulls, curveType, linePropList, strokeWidth],\n )\n\n return {\n lineVars,\n setHighlightedArea,\n getLineChartProps,\n getLineProps,\n }\n}\n\nexport type UseLineChartReturn = ReturnType<typeof useLineChart>\n"],"mappings":";;;;;;;;;;;AAgBA,SAAS,QAAQ,gBAAgB;AACjC,SAAS,IAAI,iBAAiB;AAC9B,SAAS,aAAa,SAAS,gBAAgB;AA0FxC,IAAM,eAAe,CAAC;AAAA,EAC3B,eAAe;AAAA,EACf,YAAY;AAAA,EACZ;AAAA,EACA,cAAc;AAAA,EACd,aAAa;AAAA,EACb;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAyB;AA5HzB;AA6HE,QAAM,EAAE,MAAM,IAAI,SAAS;AAC3B,QAAM,CAAC,iBAAiB,kBAAkB,IAAI,SAAwB,IAAI;AAC1E,QAAM,kBAAkB,oBAAoB;AAC5C,QAAM;AAAA,IACJ,YAAY,CAAC;AAAA,IACb;AAAA,IACA;AAAA,IACA,MAAM,CAAC;AAAA,IACP,GAAG;AAAA,EACL,KAAI,UAAK,cAAL,YAAkB,CAAC;AAEvB,QAAM,aAAiC;AAAA,IACrC,MACE,OAAO,IAAI,CAAC,EAAE,MAAM,GAAG,WAAW;AAAA,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MACA;AAAA,IACF;AAAA,EACF;AAEA,QAAM,oBAGF;AAAA,IACF,CAAC,EAAE,WAAW,GAAG,MAAM,IAAI,CAAC,GAAG,MAAM,UAAU;AAAA,MAC7C;AAAA,MACA,WAAW,GAAG,WAAW,kBAAkB;AAAA,MAC3C;AAAA,MACA,QAAQ;AAAA,MACR,QAAQ;AAAA,QACN,QAAQ,aAAa,KAAK;AAAA,QAC1B,MAAM,aAAa,KAAK;AAAA,QACxB,OAAO,aAAa,IAAI;AAAA,MAC1B;AAAA,MACA;AAAA,MACA,GAAG;AAAA,MACH,GAAG;AAAA,IACL;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,QAAM,eAGF;AAAA,IACF,CAAC,EAAE,WAAW,eAAe,OAAO,GAAG,MAAM,MAAM;AAxWvD,UAAAL;AAyWM,YAAM,EAAE,WAAW,WAAAC,YAAW,OAAO,SAAS,KAAAG,MAAK,GAAGC,MAAK,KACzDL,MAAA,aAAa,KAAK,MAAlB,OAAAA,MAAuB,CAAC;AAE1B,aAAO;AAAA,QACL,MAAM;AAAA,QACN,MAAM,UAAU,SAAS,CAAC,CAAC;AAAA,QAC3B,WAAW,GAAG,eAAe,SAAS;AAAA,QACtC,WAAAC;AAAA,QACA;AAAA,QACA;AAAA,QACA,KAAAG;AAAA,QACA,MAAM;AAAA,QACN,mBAAmB;AAAA,QACnB,QAAQ;AAAA,QACR;AAAA,QACA,GAAI;AAAA,QACJ,GAAGC;AAAA,MACL;AAAA,IACF;AAAA,IACA,CAAC,cAAc,WAAW,cAAc,WAAW;AAAA,EACrD;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["_a","activeDot","dimDot","dimLine","dot","rest"]}
@@ -9,7 +9,7 @@ import {
9
9
  import {
10
10
  getClassName,
11
11
  getComponentProps
12
- } from "./chunk-QL3DB7OJ.mjs";
12
+ } from "./chunk-TXNC7GLT.mjs";
13
13
 
14
14
  // src/use-radar-chart.ts
15
15
  import { getVar, useTheme } from "@yamada-ui/core";
@@ -17,15 +17,15 @@ import { cx } from "@yamada-ui/utils";
17
17
  import { useCallback, useMemo, useState } from "react";
18
18
  var useRadarChart = ({
19
19
  data,
20
- series,
21
20
  dataKey,
22
- withDots = false,
23
- withActiveDots = false,
24
- strokeWidth = 2,
25
21
  fillOpacity = 0.4,
26
22
  polarAngleAxisTickFormatter,
27
23
  polarRadiusAxisTickFormatter,
24
+ series,
25
+ strokeWidth = 2,
28
26
  styles,
27
+ withActiveDots = false,
28
+ withDots = false,
29
29
  ...rest
30
30
  }) => {
31
31
  var _a;
@@ -33,10 +33,10 @@ var useRadarChart = ({
33
33
  const [highlightedArea, setHighlightedArea] = useState(null);
34
34
  const shouldHighlight = highlightedArea !== null;
35
35
  const {
36
- dot = {},
37
36
  activeDot = {},
38
37
  dimDot,
39
38
  dimRadar,
39
+ dot = {},
40
40
  ...computedRadarProps
41
41
  } = (_a = rest.radarProps) != null ? _a : {};
42
42
  const radarColors = useMemo(
@@ -141,11 +141,11 @@ var useRadarChart = ({
141
141
  const radarPropList = useMemo(
142
142
  () => series.map((props, index) => {
143
143
  const {
144
- dataKey: dataKey2,
145
- dot: dot2 = {},
146
144
  activeDot: activeDot2 = {},
145
+ dataKey: dataKey2,
147
146
  dimDot: dimDot2 = {},
148
147
  dimRadar: dimRadar2 = {},
148
+ dot: dot2 = {},
149
149
  ...computedProps
150
150
  } = props;
151
151
  const color = getVar(`radar-${index}`)(theme);
@@ -174,8 +174,8 @@ var useRadarChart = ({
174
174
  resolvedActiveDot = {
175
175
  className: cx("ui-radar-chart__active-dot", className),
176
176
  fill: color,
177
- stroke: color,
178
177
  r: 4,
178
+ stroke: color,
179
179
  ...rest3
180
180
  };
181
181
  } else {
@@ -205,10 +205,10 @@ var useRadarChart = ({
205
205
  }
206
206
  return {
207
207
  ...rest2,
208
+ activeDot: resolvedActiveDot,
208
209
  color,
209
210
  dataKey: dataKey2,
210
- dot: resolvedDot,
211
- activeDot: resolvedActiveDot
211
+ dot: resolvedDot
212
212
  };
213
213
  }),
214
214
  [
@@ -241,19 +241,27 @@ var useRadarChart = ({
241
241
  [data, radarChartClassName, chartProps]
242
242
  );
243
243
  const getRadarProps = useCallback(
244
- ({ index, className: classNameProp, ...props }, ref = null) => {
245
- const { color, className, dataKey: dataKey2, activeDot: activeDot2, dot: dot2, ...rest2 } = radarPropList[index];
244
+ ({ className: classNameProp, index, ...props }, ref = null) => {
245
+ var _a2;
246
+ const {
247
+ className,
248
+ activeDot: activeDot2,
249
+ color,
250
+ dataKey: dataKey2 = "",
251
+ dot: dot2,
252
+ ...rest2
253
+ } = (_a2 = radarPropList[index]) != null ? _a2 : {};
246
254
  return {
247
255
  ref,
256
+ name: dataKey2,
248
257
  className: cx(classNameProp, className),
249
258
  activeDot: activeDot2,
250
- dot: dot2,
251
- name: dataKey2,
252
259
  dataKey: dataKey2,
260
+ dot: dot2,
253
261
  fill: color,
254
- strokeWidth,
255
- stroke: color,
256
262
  isAnimationActive: false,
263
+ stroke: color,
264
+ strokeWidth,
257
265
  ...props,
258
266
  ...rest2
259
267
  };
@@ -307,15 +315,15 @@ var useRadarChart = ({
307
315
  );
308
316
  return {
309
317
  radarVars,
310
- getRadarChartProps,
311
- getRadarProps,
318
+ setHighlightedArea,
312
319
  getPolarAngleAxisProps,
313
320
  getPolarRadiusAxisProps,
314
- setHighlightedArea
321
+ getRadarChartProps,
322
+ getRadarProps
315
323
  };
316
324
  };
317
325
 
318
326
  export {
319
327
  useRadarChart
320
328
  };
321
- //# sourceMappingURL=chunk-6O5G3WYP.mjs.map
329
+ //# sourceMappingURL=chunk-EZG52466.mjs.map