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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (202) hide show
  1. package/README.md +7 -13
  2. package/dist/area-chart-split.js +4 -2
  3. package/dist/area-chart-split.js.map +1 -1
  4. package/dist/area-chart-split.mjs +1 -1
  5. package/dist/area-chart.d.mts +1 -2
  6. package/dist/area-chart.d.ts +1 -2
  7. package/dist/area-chart.js +57 -50
  8. package/dist/area-chart.js.map +1 -1
  9. package/dist/area-chart.mjs +12 -12
  10. package/dist/bar-chart.d.mts +1 -2
  11. package/dist/bar-chart.d.ts +1 -2
  12. package/dist/bar-chart.js +15 -9
  13. package/dist/bar-chart.js.map +1 -1
  14. package/dist/bar-chart.mjs +11 -11
  15. package/dist/chart-legend.mjs +3 -3
  16. package/dist/chart-tooltip.d.mts +3 -1
  17. package/dist/chart-tooltip.d.ts +3 -1
  18. package/dist/chart-tooltip.js +9 -1
  19. package/dist/chart-tooltip.js.map +1 -1
  20. package/dist/chart-tooltip.mjs +3 -3
  21. package/dist/chart.types.d.mts +12 -5
  22. package/dist/chart.types.d.ts +12 -5
  23. package/dist/chart.types.js.map +1 -1
  24. package/dist/{chunk-STBYN5JW.mjs → chunk-3AOICU4Q.mjs} +2 -2
  25. package/dist/chunk-3HQ2UC3I.mjs +45 -0
  26. package/dist/chunk-3HQ2UC3I.mjs.map +1 -0
  27. package/dist/{chunk-FALZDKAW.mjs → chunk-3VKCTSPC.mjs} +10 -11
  28. package/dist/chunk-3VKCTSPC.mjs.map +1 -0
  29. package/dist/{chunk-S5NKKKV5.mjs → chunk-5PSRSNGH.mjs} +7 -8
  30. package/dist/chunk-5PSRSNGH.mjs.map +1 -0
  31. package/dist/{chunk-F34FV5DY.mjs → chunk-6YUJLLGN.mjs} +59 -3
  32. package/dist/chunk-6YUJLLGN.mjs.map +1 -0
  33. package/dist/{chunk-KBBHISBO.mjs → chunk-BYL7HWNN.mjs} +13 -14
  34. package/dist/chunk-BYL7HWNN.mjs.map +1 -0
  35. package/dist/chunk-D5IRVU4W.mjs +46 -0
  36. package/dist/chunk-D5IRVU4W.mjs.map +1 -0
  37. package/dist/{chunk-DGOXJ373.mjs → chunk-EL2VTGFB.mjs} +2 -2
  38. package/dist/{chunk-6L73M52L.mjs → chunk-FPFCMFCJ.mjs} +7 -9
  39. package/dist/chunk-FPFCMFCJ.mjs.map +1 -0
  40. package/dist/{chunk-Q7CCSKX3.mjs → chunk-JTQ5QCML.mjs} +4 -4
  41. package/dist/chunk-JTQ5QCML.mjs.map +1 -0
  42. package/dist/chunk-KVE6VXTJ.mjs +37 -0
  43. package/dist/chunk-KVE6VXTJ.mjs.map +1 -0
  44. package/dist/{chunk-PNE3JG54.mjs → chunk-MGTMKKSH.mjs} +5 -3
  45. package/dist/chunk-MGTMKKSH.mjs.map +1 -0
  46. package/dist/chunk-PG7ZV76C.mjs +155 -0
  47. package/dist/chunk-PG7ZV76C.mjs.map +1 -0
  48. package/dist/{chunk-D7EZKGCJ.mjs → chunk-PPBHLDVN.mjs} +2 -2
  49. package/dist/{chunk-AODYT4HF.mjs → chunk-RKO6KM3T.mjs} +13 -14
  50. package/dist/chunk-RKO6KM3T.mjs.map +1 -0
  51. package/dist/chunk-SBPKRYF2.mjs +199 -0
  52. package/dist/chunk-SBPKRYF2.mjs.map +1 -0
  53. package/dist/{chunk-FCMP6QEZ.mjs → chunk-SWATR7CU.mjs} +14 -15
  54. package/dist/chunk-SWATR7CU.mjs.map +1 -0
  55. package/dist/{chunk-MT5JI4OR.mjs → chunk-T5DNDBW6.mjs} +11 -3
  56. package/dist/chunk-T5DNDBW6.mjs.map +1 -0
  57. package/dist/{chunk-5Q6O726L.mjs → chunk-TCSYDMC7.mjs} +2 -2
  58. package/dist/{chunk-UHQ6WE5D.mjs → chunk-TMHSYM3V.mjs} +17 -13
  59. package/dist/chunk-TMHSYM3V.mjs.map +1 -0
  60. package/dist/{chunk-AOGTJ4EN.mjs → chunk-VMBRDEM2.mjs} +2 -2
  61. package/dist/{chunk-XUAAKVRL.mjs → chunk-WMG5U5AU.mjs} +26 -13
  62. package/dist/chunk-WMG5U5AU.mjs.map +1 -0
  63. package/dist/{chunk-6BNJZIBK.mjs → chunk-X7XFG7TS.mjs} +10 -12
  64. package/dist/chunk-X7XFG7TS.mjs.map +1 -0
  65. package/dist/{chunk-MOFNE6PO.mjs → chunk-XRF3TNSQ.mjs} +6 -30
  66. package/dist/chunk-XRF3TNSQ.mjs.map +1 -0
  67. package/dist/{chunk-VK4VQQYY.mjs → chunk-YNJ423BR.mjs} +2 -2
  68. package/dist/{chunk-BGMNYKQY.mjs → chunk-ZQWVMOT6.mjs} +9 -7
  69. package/dist/chunk-ZQWVMOT6.mjs.map +1 -0
  70. package/dist/donut-chart.d.mts +3 -3
  71. package/dist/donut-chart.d.ts +3 -3
  72. package/dist/donut-chart.js +109 -58
  73. package/dist/donut-chart.js.map +1 -1
  74. package/dist/donut-chart.mjs +9 -8
  75. package/dist/index.d.mts +6 -2
  76. package/dist/index.d.ts +6 -2
  77. package/dist/index.js +599 -167
  78. package/dist/index.js.map +1 -1
  79. package/dist/index.mjs +30 -22
  80. package/dist/index.mjs.map +1 -1
  81. package/dist/line-chart.d.mts +1 -2
  82. package/dist/line-chart.d.ts +1 -2
  83. package/dist/line-chart.js +15 -10
  84. package/dist/line-chart.js.map +1 -1
  85. package/dist/line-chart.mjs +11 -11
  86. package/dist/pie-chart.d.mts +2 -3
  87. package/dist/pie-chart.d.ts +2 -3
  88. package/dist/pie-chart.js +13 -7
  89. package/dist/pie-chart.js.map +1 -1
  90. package/dist/pie-chart.mjs +8 -8
  91. package/dist/radar-chart.d.mts +3 -3
  92. package/dist/radar-chart.d.ts +3 -3
  93. package/dist/radar-chart.js +90 -70
  94. package/dist/radar-chart.js.map +1 -1
  95. package/dist/radar-chart.mjs +9 -8
  96. package/dist/radial-chart.d.mts +53 -0
  97. package/dist/radial-chart.d.ts +53 -0
  98. package/dist/radial-chart.js +767 -0
  99. package/dist/radial-chart.js.map +1 -0
  100. package/dist/radial-chart.mjs +18 -0
  101. package/dist/radial-chart.mjs.map +1 -0
  102. package/dist/rechart-properties.d.mts +5 -1
  103. package/dist/rechart-properties.d.ts +5 -1
  104. package/dist/rechart-properties.js +60 -1
  105. package/dist/rechart-properties.js.map +1 -1
  106. package/dist/rechart-properties.mjs +7 -1
  107. package/dist/use-area-chart.d.mts +1 -2
  108. package/dist/use-area-chart.d.ts +1 -2
  109. package/dist/use-area-chart.js +7 -9
  110. package/dist/use-area-chart.js.map +1 -1
  111. package/dist/use-area-chart.mjs +2 -2
  112. package/dist/use-bar-chart.d.mts +1 -2
  113. package/dist/use-bar-chart.d.ts +1 -2
  114. package/dist/use-bar-chart.js +4 -5
  115. package/dist/use-bar-chart.js.map +1 -1
  116. package/dist/use-bar-chart.mjs +2 -2
  117. package/dist/use-chart-axis.d.mts +0 -1
  118. package/dist/use-chart-axis.d.ts +0 -1
  119. package/dist/use-chart-axis.js.map +1 -1
  120. package/dist/use-chart-axis.mjs +2 -2
  121. package/dist/use-chart-grid.d.mts +0 -1
  122. package/dist/use-chart-grid.d.ts +0 -1
  123. package/dist/use-chart-grid.js.map +1 -1
  124. package/dist/use-chart-grid.mjs +2 -2
  125. package/dist/use-chart-label-list.d.mts +22 -0
  126. package/dist/use-chart-label-list.d.ts +22 -0
  127. package/dist/use-chart-label-list.js +93 -0
  128. package/dist/use-chart-label-list.js.map +1 -0
  129. package/dist/use-chart-label-list.mjs +10 -0
  130. package/dist/use-chart-label-list.mjs.map +1 -0
  131. package/dist/use-chart-label.d.mts +20 -0
  132. package/dist/use-chart-label.d.ts +20 -0
  133. package/dist/use-chart-label.js +82 -0
  134. package/dist/use-chart-label.js.map +1 -0
  135. package/dist/use-chart-label.mjs +10 -0
  136. package/dist/use-chart-label.mjs.map +1 -0
  137. package/dist/use-chart-legend.d.mts +0 -1
  138. package/dist/use-chart-legend.d.ts +0 -1
  139. package/dist/use-chart-legend.js.map +1 -1
  140. package/dist/use-chart-legend.mjs +2 -2
  141. package/dist/use-chart-reference-line.d.mts +0 -1
  142. package/dist/use-chart-reference-line.d.ts +0 -1
  143. package/dist/use-chart-reference-line.js +1 -1
  144. package/dist/use-chart-reference-line.js.map +1 -1
  145. package/dist/use-chart-reference-line.mjs +2 -2
  146. package/dist/use-chart-tooltip.d.mts +0 -1
  147. package/dist/use-chart-tooltip.d.ts +0 -1
  148. package/dist/use-chart-tooltip.js.map +1 -1
  149. package/dist/use-chart-tooltip.mjs +2 -2
  150. package/dist/use-chart.d.mts +0 -1
  151. package/dist/use-chart.d.ts +0 -1
  152. package/dist/use-chart.js.map +1 -1
  153. package/dist/use-chart.mjs +2 -2
  154. package/dist/use-line-chart.d.mts +1 -2
  155. package/dist/use-line-chart.d.ts +1 -2
  156. package/dist/use-line-chart.js +4 -6
  157. package/dist/use-line-chart.js.map +1 -1
  158. package/dist/use-line-chart.mjs +2 -2
  159. package/dist/use-pie-chart.d.mts +1 -2
  160. package/dist/use-pie-chart.d.ts +1 -2
  161. package/dist/use-pie-chart.js +3 -4
  162. package/dist/use-pie-chart.js.map +1 -1
  163. package/dist/use-pie-chart.mjs +2 -2
  164. package/dist/use-polar-grid.d.mts +24 -0
  165. package/dist/use-polar-grid.d.ts +24 -0
  166. package/dist/use-polar-grid.js +90 -0
  167. package/dist/use-polar-grid.js.map +1 -0
  168. package/dist/use-polar-grid.mjs +10 -0
  169. package/dist/use-polar-grid.mjs.map +1 -0
  170. package/dist/use-radar-chart.d.mts +3 -13
  171. package/dist/use-radar-chart.d.ts +3 -13
  172. package/dist/use-radar-chart.js +3 -35
  173. package/dist/use-radar-chart.js.map +1 -1
  174. package/dist/use-radar-chart.mjs +2 -2
  175. package/dist/use-radial-chart.d.mts +80 -0
  176. package/dist/use-radial-chart.d.ts +80 -0
  177. package/dist/use-radial-chart.js +228 -0
  178. package/dist/use-radial-chart.js.map +1 -0
  179. package/dist/use-radial-chart.mjs +10 -0
  180. package/dist/use-radial-chart.mjs.map +1 -0
  181. package/package.json +4 -4
  182. package/dist/chunk-6BNJZIBK.mjs.map +0 -1
  183. package/dist/chunk-6L73M52L.mjs.map +0 -1
  184. package/dist/chunk-AODYT4HF.mjs.map +0 -1
  185. package/dist/chunk-BGMNYKQY.mjs.map +0 -1
  186. package/dist/chunk-F34FV5DY.mjs.map +0 -1
  187. package/dist/chunk-FALZDKAW.mjs.map +0 -1
  188. package/dist/chunk-FCMP6QEZ.mjs.map +0 -1
  189. package/dist/chunk-KBBHISBO.mjs.map +0 -1
  190. package/dist/chunk-MOFNE6PO.mjs.map +0 -1
  191. package/dist/chunk-MT5JI4OR.mjs.map +0 -1
  192. package/dist/chunk-PNE3JG54.mjs.map +0 -1
  193. package/dist/chunk-Q7CCSKX3.mjs.map +0 -1
  194. package/dist/chunk-S5NKKKV5.mjs.map +0 -1
  195. package/dist/chunk-UHQ6WE5D.mjs.map +0 -1
  196. package/dist/chunk-XUAAKVRL.mjs.map +0 -1
  197. /package/dist/{chunk-STBYN5JW.mjs.map → chunk-3AOICU4Q.mjs.map} +0 -0
  198. /package/dist/{chunk-DGOXJ373.mjs.map → chunk-EL2VTGFB.mjs.map} +0 -0
  199. /package/dist/{chunk-D7EZKGCJ.mjs.map → chunk-PPBHLDVN.mjs.map} +0 -0
  200. /package/dist/{chunk-5Q6O726L.mjs.map → chunk-TCSYDMC7.mjs.map} +0 -0
  201. /package/dist/{chunk-AOGTJ4EN.mjs.map → chunk-VMBRDEM2.mjs.map} +0 -0
  202. /package/dist/{chunk-VK4VQQYY.mjs.map → chunk-YNJ423BR.mjs.map} +0 -0
@@ -1,8 +1,7 @@
1
1
  import { As, HTMLUIProps, CSSUIProps } from '@yamada-ui/core';
2
- import { Merge } from '@yamada-ui/utils';
2
+ import { Merge, Dict } from '@yamada-ui/utils';
3
3
  import { ComponentPropsWithoutRef, SVGProps, ReactElement, ReactNode } from 'react';
4
4
  import * as Recharts from 'recharts';
5
- import { pieProperties } from './rechart-properties.js';
6
5
 
7
6
  type ChartPropGetter<Y extends As = "div", M = undefined, D = undefined> = (props?: Merge<HTMLUIProps<Y>, M>, ref?: React.Ref<any>) => D;
8
7
  type RequiredChartPropGetter<Y extends As = "div", M = undefined, D = undefined> = (props: Merge<HTMLUIProps<Y>, M>, ref?: React.Ref<any>) => D;
@@ -17,6 +16,7 @@ type BarChartProps = Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.
17
16
  type LineChartProps = Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.LineChart>>;
18
17
  type RadarChartProps = Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.RadarChart>>;
19
18
  type PieChartProps = Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.PieChart>>;
19
+ type RadialChartProps = Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.RadialBarChart>>;
20
20
  type ReferenceLineProps = Merge<CSSUIProps, Recharts.ReferenceLineProps>;
21
21
  type ResponsiveContainerProps = Merge<CSSUIProps, Omit<Recharts.ResponsiveContainerProps, "children">>;
22
22
  type AreaProps = Merge<Merge<CSSUIProps, Recharts.AreaProps>, {
@@ -46,7 +46,7 @@ type RadarProps = Merge<Merge<CSSUIProps, Recharts.RadarProps>, {
46
46
  dimDot?: DotProps;
47
47
  dimRadar?: Partial<RadarProps>;
48
48
  }>;
49
- type PieProps = Merge<Merge<Pick<Recharts.PieProps, (typeof pieProperties)[number]>, CSSUIProps>, {
49
+ type PieProps = Merge<Merge<Recharts.PieProps, CSSUIProps>, {
50
50
  activeShape?: Partial<PieProps>;
51
51
  inactiveShape?: Partial<PieProps>;
52
52
  label?: HTMLUIProps<"text">;
@@ -57,6 +57,10 @@ type CellProps = Merge<CSSUIProps, {
57
57
  value: number;
58
58
  dimCell?: Partial<CellProps>;
59
59
  }>;
60
+ type RadialBarProps = Merge<Merge<Recharts.RadialBarProps, CSSUIProps>, {
61
+ background?: Partial<RadialBarProps>;
62
+ dimRadialBar?: CSSUIProps;
63
+ }>;
60
64
  type DotProps = Merge<Omit<Recharts.DotProps, "ref">, CSSUIProps>;
61
65
  type XAxisProps = Merge<Merge<CSSUIProps, Recharts.XAxisProps>, {
62
66
  color?: CSSUIProps["color"];
@@ -74,8 +78,11 @@ type GridProps = Merge<CSSUIProps, Recharts.CartesianGridProps>;
74
78
  type PolarGridProps = Merge<CSSUIProps, Recharts.PolarGridProps>;
75
79
  type PolarAngleAxisProps = Merge<Recharts.PolarAngleAxisProps, CSSUIProps>;
76
80
  type PolarRadiusAxisProps = Merge<CSSUIProps, Recharts.PolarRadiusAxisProps>;
77
- type LabelProps = Merge<CSSUIProps, Recharts.LabelProps>;
81
+ type LabelProps = Merge<CSSUIProps, Omit<Recharts.LabelProps, "fill">>;
82
+ type LabelListProps = Merge<Recharts.LabelListProps<Dict>, Omit<CSSUIProps, "position">>;
78
83
  type ChartTooltipProps = Recharts.TooltipProps<number | string | Array<number | string>, number | string>;
79
84
  type ChartTooltip = ReactElement | ((props: ChartTooltipProps) => ReactNode);
85
+ type ChartLabelProps = Omit<React.SVGProps<SVGTextElement>, "viewBox"> & LabelProps;
86
+ type ChartLabel = ReactElement | ((props: ChartLabelProps) => ReactNode);
80
87
 
81
- export type { AreaChartProps, AreaChartType, AreaProps, BarChartProps, BarChartType, BarProps, CellProps, ChartAxisType, ChartCurveType, ChartLayoutType, ChartPropGetter, ChartTooltip, ChartTooltipProps, DotProps, GridProps, LabelProps, LegendProps, LineChartProps, LineProps, PieChartProps, PieProps, PolarAngleAxisProps, PolarGridProps, PolarRadiusAxisProps, RadarChartProps, RadarProps, ReferenceLineProps, RequiredChartPropGetter, ResponsiveContainerProps, TooltipDataSourceType, TooltipProps, XAxisProps, YAxisProps };
88
+ export type { AreaChartProps, AreaChartType, AreaProps, BarChartProps, BarChartType, BarProps, CellProps, ChartAxisType, ChartCurveType, ChartLabel, ChartLabelProps, ChartLayoutType, ChartPropGetter, ChartTooltip, ChartTooltipProps, DotProps, GridProps, LabelListProps, LabelProps, LegendProps, LineChartProps, LineProps, PieChartProps, PieProps, PolarAngleAxisProps, PolarGridProps, PolarRadiusAxisProps, RadarChartProps, RadarProps, RadialBarProps, RadialChartProps, ReferenceLineProps, RequiredChartPropGetter, ResponsiveContainerProps, TooltipDataSourceType, TooltipProps, XAxisProps, YAxisProps };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/chart.types.ts"],"sourcesContent":["import type { As, CSSUIProps, HTMLUIProps } from \"@yamada-ui/core\"\nimport type { Merge } from \"@yamada-ui/utils\"\nimport type {\n ComponentPropsWithoutRef,\n ReactElement,\n ReactNode,\n SVGProps,\n} from \"react\"\nimport type * as Recharts from \"recharts\"\nimport type { pieProperties } from \"./rechart-properties\"\n\nexport type ChartPropGetter<\n Y extends As = \"div\",\n M = undefined,\n D = undefined,\n> = (props?: Merge<HTMLUIProps<Y>, M>, ref?: React.Ref<any>) => D\n\nexport type RequiredChartPropGetter<\n Y extends As = \"div\",\n M = undefined,\n D = undefined,\n> = (props: Merge<HTMLUIProps<Y>, M>, ref?: React.Ref<any>) => D\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 type AreaChartProps = Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.AreaChart>\n>\nexport type BarChartProps = Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.BarChart>\n>\nexport type LineChartProps = Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.LineChart>\n>\nexport type RadarChartProps = Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.RadarChart>\n>\nexport type PieChartProps = Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.PieChart>\n>\nexport type ReferenceLineProps = Merge<CSSUIProps, Recharts.ReferenceLineProps>\nexport type ResponsiveContainerProps = Merge<\n CSSUIProps,\n Omit<Recharts.ResponsiveContainerProps, \"children\">\n>\nexport type AreaProps = 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 type LineProps = 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 type BarProps = 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 type RadarProps = 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 type PieProps = Merge<\n Merge<Pick<Recharts.PieProps, (typeof pieProperties)[number]>, CSSUIProps>,\n {\n activeShape?: Partial<PieProps>\n inactiveShape?: Partial<PieProps>\n label?: HTMLUIProps<\"text\">\n labelLine?: HTMLUIProps<\"path\">\n }\n>\nexport type CellProps = Merge<\n CSSUIProps,\n {\n name: string\n value: number\n dimCell?: Partial<CellProps>\n }\n>\nexport type DotProps = Merge<Omit<Recharts.DotProps, \"ref\">, CSSUIProps>\nexport type XAxisProps = Merge<\n Merge<CSSUIProps, Recharts.XAxisProps>,\n {\n color?: CSSUIProps[\"color\"]\n stroke?: CSSUIProps[\"color\"]\n fill?: CSSUIProps[\"color\"]\n }\n>\nexport type YAxisProps = Merge<\n Merge<CSSUIProps, Recharts.YAxisProps>,\n { color?: CSSUIProps[\"color\"] }\n>\nexport type LegendProps = Merge<CSSUIProps, Omit<Recharts.LegendProps, \"ref\">>\nexport type TooltipProps = Merge<\n Merge<CSSUIProps, Omit<Recharts.TooltipProps<any, any>, \"ref\">>,\n { cursor?: CSSUIProps }\n>\nexport type GridProps = Merge<CSSUIProps, Recharts.CartesianGridProps>\nexport type PolarGridProps = Merge<CSSUIProps, Recharts.PolarGridProps>\nexport type PolarAngleAxisProps = Merge<\n Recharts.PolarAngleAxisProps,\n CSSUIProps\n>\nexport type PolarRadiusAxisProps = Merge<\n CSSUIProps,\n Recharts.PolarRadiusAxisProps\n>\nexport type LabelProps = Merge<CSSUIProps, Recharts.LabelProps>\nexport type ChartTooltipProps = Recharts.TooltipProps<\n number | string | Array<number | string>,\n number | string\n>\nexport type ChartTooltip =\n | ReactElement\n | ((props: ChartTooltipProps) => ReactNode)\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../src/chart.types.ts"],"sourcesContent":["import type { As, 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 ChartPropGetter<\n Y extends As = \"div\",\n M = undefined,\n D = undefined,\n> = (props?: Merge<HTMLUIProps<Y>, M>, ref?: React.Ref<any>) => D\n\nexport type RequiredChartPropGetter<\n Y extends As = \"div\",\n M = undefined,\n D = undefined,\n> = (props: Merge<HTMLUIProps<Y>, M>, ref?: React.Ref<any>) => D\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 type AreaChartProps = Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.AreaChart>\n>\nexport type BarChartProps = Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.BarChart>\n>\nexport type LineChartProps = Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.LineChart>\n>\nexport type RadarChartProps = Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.RadarChart>\n>\nexport type PieChartProps = Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.PieChart>\n>\nexport type RadialChartProps = Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.RadialBarChart>\n>\nexport type ReferenceLineProps = Merge<CSSUIProps, Recharts.ReferenceLineProps>\nexport type ResponsiveContainerProps = Merge<\n CSSUIProps,\n Omit<Recharts.ResponsiveContainerProps, \"children\">\n>\nexport type AreaProps = 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 type LineProps = 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 type BarProps = 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 type RadarProps = 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 type PieProps = 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 type CellProps = Merge<\n CSSUIProps,\n {\n name: string\n value: number\n dimCell?: Partial<CellProps>\n }\n>\nexport type RadialBarProps = Merge<\n Merge<Recharts.RadialBarProps, CSSUIProps>,\n {\n background?: Partial<RadialBarProps>\n dimRadialBar?: CSSUIProps\n }\n>\nexport type DotProps = Merge<Omit<Recharts.DotProps, \"ref\">, CSSUIProps>\nexport type XAxisProps = Merge<\n Merge<CSSUIProps, Recharts.XAxisProps>,\n {\n color?: CSSUIProps[\"color\"]\n stroke?: CSSUIProps[\"color\"]\n fill?: CSSUIProps[\"color\"]\n }\n>\nexport type YAxisProps = Merge<\n Merge<CSSUIProps, Recharts.YAxisProps>,\n { color?: CSSUIProps[\"color\"] }\n>\nexport type LegendProps = Merge<CSSUIProps, Omit<Recharts.LegendProps, \"ref\">>\nexport type TooltipProps = Merge<\n Merge<CSSUIProps, Omit<Recharts.TooltipProps<any, any>, \"ref\">>,\n { cursor?: CSSUIProps }\n>\nexport type GridProps = Merge<CSSUIProps, Recharts.CartesianGridProps>\nexport type PolarGridProps = Merge<CSSUIProps, Recharts.PolarGridProps>\nexport type PolarAngleAxisProps = Merge<\n Recharts.PolarAngleAxisProps,\n CSSUIProps\n>\nexport type PolarRadiusAxisProps = Merge<\n CSSUIProps,\n Recharts.PolarRadiusAxisProps\n>\nexport type LabelProps = Merge<CSSUIProps, Omit<Recharts.LabelProps, \"fill\">>\nexport type LabelListProps = Merge<\n Recharts.LabelListProps<Dict>,\n Omit<CSSUIProps, \"position\">\n>\nexport type ChartTooltipProps = Recharts.TooltipProps<\n number | string | Array<number | string>,\n number | string\n>\nexport type ChartTooltip =\n | ReactElement\n | ((props: ChartTooltipProps) => ReactNode)\n\nexport type ChartLabelProps = Omit<React.SVGProps<SVGTextElement>, \"viewBox\"> &\n LabelProps\nexport type ChartLabel = ReactElement | ((props: ChartLabelProps) => ReactNode)\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
  import {
3
3
  containerProperties
4
- } from "./chunk-F34FV5DY.mjs";
4
+ } from "./chunk-6YUJLLGN.mjs";
5
5
  import {
6
6
  getComponentProps
7
7
  } from "./chunk-QL3DB7OJ.mjs";
@@ -53,4 +53,4 @@ export {
53
53
  useLegend,
54
54
  useTooltip
55
55
  };
56
- //# sourceMappingURL=chunk-STBYN5JW.mjs.map
56
+ //# sourceMappingURL=chunk-3AOICU4Q.mjs.map
@@ -0,0 +1,45 @@
1
+ "use client"
2
+ import {
3
+ polarGridProperties
4
+ } from "./chunk-6YUJLLGN.mjs";
5
+ import {
6
+ getComponentProps
7
+ } from "./chunk-QL3DB7OJ.mjs";
8
+
9
+ // src/use-polar-grid.tsx
10
+ import { useTheme } from "@yamada-ui/core";
11
+ import { cx } from "@yamada-ui/utils";
12
+ import { useCallback, useMemo } from "react";
13
+ var usePolarGrid = ({
14
+ strokeDasharray,
15
+ styles,
16
+ ...rest
17
+ }) => {
18
+ const { theme } = useTheme();
19
+ const [polarGridProps, polarGridClassName] = useMemo(
20
+ () => {
21
+ var _a;
22
+ return getComponentProps(
23
+ [(_a = rest.polarGridProps) != null ? _a : {}, polarGridProperties],
24
+ styles.polarGrid
25
+ )(theme);
26
+ },
27
+ [rest.polarGridProps, styles.polarGrid, theme]
28
+ );
29
+ const getPolarGridProps = useCallback(
30
+ ({ className, ...props } = {}, ref = null) => ({
31
+ ref,
32
+ className: cx(className, polarGridClassName),
33
+ strokeDasharray,
34
+ ...props,
35
+ ...polarGridProps
36
+ }),
37
+ [polarGridClassName, polarGridProps, strokeDasharray]
38
+ );
39
+ return { getPolarGridProps };
40
+ };
41
+
42
+ export {
43
+ usePolarGrid
44
+ };
45
+ //# sourceMappingURL=chunk-3HQ2UC3I.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/use-polar-grid.tsx"],"sourcesContent":["import { useTheme, type CSSUIObject } from \"@yamada-ui/core\"\nimport { cx, type Dict } from \"@yamada-ui/utils\"\nimport { useCallback, useMemo } from \"react\"\nimport type * as Recharts from \"recharts\"\nimport { getComponentProps } from \"./chart-utils\"\nimport type { ChartPropGetter, PolarGridProps } from \"./chart.types\"\nimport { polarGridProperties } from \"./rechart-properties\"\n\nexport type UsePolarGridOptions = {\n /**\n * Props passed down to recharts `PolarGrid` component.\n */\n polarGridProps?: PolarGridProps\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?: string | number\n}\n\ntype UsePolarGridProps = UsePolarGridOptions & {\n styles: Dict<CSSUIObject>\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: ChartPropGetter<\n \"div\",\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":";;;;;;;;;AAAA,SAAS,gBAAkC;AAC3C,SAAS,UAAqB;AAC9B,SAAS,aAAa,eAAe;AAqB9B,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;AA/BP;AAgCM;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,oBAIF;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":[]}
@@ -1,23 +1,23 @@
1
1
  "use client"
2
2
  import {
3
3
  usePieChart
4
- } from "./chunk-BGMNYKQY.mjs";
5
- import {
6
- useChartLegend
7
- } from "./chunk-5Q6O726L.mjs";
4
+ } from "./chunk-ZQWVMOT6.mjs";
8
5
  import {
9
6
  useChartTooltip
10
- } from "./chunk-AOGTJ4EN.mjs";
7
+ } from "./chunk-VMBRDEM2.mjs";
8
+ import {
9
+ useChartLegend
10
+ } from "./chunk-TCSYDMC7.mjs";
11
11
  import {
12
12
  ChartLegend
13
- } from "./chunk-DGOXJ373.mjs";
13
+ } from "./chunk-EL2VTGFB.mjs";
14
14
  import {
15
15
  ChartTooltip
16
- } from "./chunk-MT5JI4OR.mjs";
16
+ } from "./chunk-T5DNDBW6.mjs";
17
17
  import {
18
18
  ChartProvider,
19
19
  useChart
20
- } from "./chunk-STBYN5JW.mjs";
20
+ } from "./chunk-3AOICU4Q.mjs";
21
21
 
22
22
  // src/pie-chart.tsx
23
23
  import {
@@ -115,8 +115,7 @@ var PieChart = forwardRef((props, ref) => {
115
115
  {
116
116
  ref,
117
117
  className: cx("ui-pie-chart", className),
118
- var: pieVars,
119
- __css: { ...styles.container },
118
+ __css: { maxW: "full", vars: pieVars, ...styles.container },
120
119
  ...rest,
121
120
  children: /* @__PURE__ */ jsx(
122
121
  ResponsiveContainer,
@@ -180,4 +179,4 @@ var PieChart = forwardRef((props, ref) => {
180
179
  export {
181
180
  PieChart
182
181
  };
183
- //# sourceMappingURL=chunk-FALZDKAW.mjs.map
182
+ //# sourceMappingURL=chunk-3VKCTSPC.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/pie-chart.tsx"],"sourcesContent":["import type { HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useMultiComponentStyle,\n} from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useMemo } from \"react\"\nimport {\n Cell,\n Legend,\n Pie,\n PieChart as RechartsPieChart,\n ResponsiveContainer,\n Tooltip,\n} from \"recharts\"\nimport { ChartLegend } from \"./chart-legend\"\nimport { ChartTooltip } from \"./chart-tooltip\"\nimport type { TooltipDataSourceType } from \"./chart.types\"\nimport type { UseChartProps } from \"./use-chart\"\nimport { ChartProvider, useChart } from \"./use-chart\"\nimport type { UseChartLegendProps } from \"./use-chart-legend\"\nimport { useChartLegend } from \"./use-chart-legend\"\nimport {\n useChartTooltip,\n type UseChartTooltipOptions,\n} from \"./use-chart-tooltip\"\nimport type { UsePieChartOptions } from \"./use-pie-chart\"\nimport { usePieChart } from \"./use-pie-chart\"\n\ntype PieChartOptions = {\n /**\n * If `true`, tooltip is visible.\n *\n * @default true\n */\n withTooltip?: boolean\n /**\n * If `true`, legend is visible.\n *\n * @default false\n */\n withLegend?: boolean\n /**\n * Determines which data is displayed in the tooltip.\n *\n * @default 'all'\n */\n tooltipDataSource?: TooltipDataSourceType\n /**\n * Unit displayed next to each value in tooltip.\n */\n unit?: string\n}\n\nexport type PieChartProps = HTMLUIProps<\"div\"> &\n ThemeProps<\"pieChart\"> &\n PieChartOptions &\n UsePieChartOptions &\n Omit<UseChartTooltipOptions, \"labelFormatter\"> &\n UseChartLegendProps &\n UseChartProps\n\n/**\n * `PieChart` is a component for drawing pie charts to compare multiple sets of data.\n *\n * @see Docs https://yamada-ui.com/components/data-display/pie-chart\n */\nexport const PieChart = forwardRef<PieChartProps, \"div\">((props, ref) => {\n const [styles, mergedProps] = useMultiComponentStyle(\"PieChart\", props)\n const {\n className,\n data,\n pieProps,\n chartProps,\n cellProps,\n containerProps,\n withTooltip = true,\n withLegend = false,\n tooltipProps,\n tooltipAnimationDuration,\n tooltipDataSource = \"all\",\n valueFormatter,\n labelFormatter,\n unit,\n innerRadius,\n outerRadius,\n paddingAngle,\n startAngle,\n endAngle,\n withLabels,\n withLabelLines,\n labelOffset,\n isPercent,\n strokeWidth,\n legendProps,\n ...rest\n } = omitThemeProps(mergedProps)\n\n const {\n pieVars,\n getPieProps,\n getPieChartProps,\n getCellProps,\n setHighlightedArea,\n } = usePieChart({\n data,\n pieProps,\n chartProps,\n cellProps,\n innerRadius,\n outerRadius,\n paddingAngle,\n startAngle,\n endAngle,\n strokeWidth,\n withLabels,\n withLabelLines,\n labelOffset,\n isPercent,\n labelFormatter,\n styles,\n })\n const { getContainerProps } = useChart({ containerProps })\n const { tooltipProps: computedTooltipProps, getTooltipProps } =\n useChartTooltip({\n tooltipProps,\n tooltipAnimationDuration,\n styles,\n })\n const { legendProps: computedLegendProps, getLegendProps } = useChartLegend({\n legendProps,\n })\n\n const cells = useMemo(\n () =>\n data.map(({ name }, index) => (\n <Cell\n key={`pie-cell-${name}`}\n {...getCellProps({ index, className: \"ui-pie-chart__cell\" })}\n />\n )),\n [data, getCellProps],\n )\n\n return (\n <ChartProvider value={{ styles }}>\n <ui.div\n ref={ref}\n className={cx(\"ui-pie-chart\", className)}\n __css={{ maxW: \"full\", vars: pieVars, ...styles.container }}\n {...rest}\n >\n <ResponsiveContainer\n {...getContainerProps({ className: \"ui-pie-chart__container\" })}\n >\n <RechartsPieChart\n {...getPieChartProps({ className: \"ui-pie-chart__chart\" })}\n >\n <Pie\n {...getPieProps({\n className: \"ui-pie-chart__pie\",\n })}\n >\n {cells}\n </Pie>\n\n {withLegend ? (\n <Legend\n content={({ payload }) => (\n <ChartLegend\n className=\"ui-pie-chart__legend\"\n payload={payload}\n onHighlight={setHighlightedArea}\n {...computedLegendProps}\n />\n )}\n {...getLegendProps()}\n />\n ) : null}\n\n {withTooltip ? (\n <Tooltip\n content={({ label, payload }) => (\n <ChartTooltip\n className=\"ui-pie-chart__tooltip\"\n label={label}\n payload={tooltipDataSource === \"segment\" ? payload : data}\n valueFormatter={valueFormatter}\n unit={unit}\n {...computedTooltipProps}\n />\n )}\n {...getTooltipProps()}\n />\n ) : null}\n </RechartsPieChart>\n </ResponsiveContainer>\n </ui.div>\n </ChartProvider>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,UAAU;AACnB,SAAS,eAAe;AACxB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,OACK;AA0HC,cAmBE,YAnBF;AArED,IAAM,WAAW,WAAiC,CAAC,OAAO,QAAQ;AACvE,QAAM,CAAC,QAAQ,WAAW,IAAI,uBAAuB,YAAY,KAAK;AACtE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA,oBAAoB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI,eAAe,WAAW;AAE9B,QAAM;AAAA,IACJ;AAAA,IACA;A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ACH;AAAA,gBAEC,aACC;AAAA,kBAAC;AAAA;AAAA,oBACC,SAAS,CAAC,EAAE,QAAQ,MAClB;AAAA,sBAAC;AAAA;AAAA,wBACC,WAAU;AAAA,wBACV;AAAA,wBACA,aAAa;AAAA,wBACZ,GAAG;AAAA;AAAA,oBACN;AAAA,oBAED,GAAG,eAAe;AAAA;AAAA,gBACrB,IACE;AAAA,gBAEH,cACC;AAAA,kBAAC;AAAA;AAAA,oBACC,SAAS,CAAC,EAAE,OAAO,QAAQ,MACzB;AAAA,sBAAC;AAAA;AAAA,wBACC,WAAU;AAAA,wBACV;AAAA,wBACA,SAAS,sBAAsB,YAAY,UAAU;AAAA,wBACrD;AAAA,wBACA;AAAA,wBACC,GAAG;AAAA;AAAA,oBACN;AAAA,oBAED,GAAG,gBAAgB;AAAA;AAAA,gBACtB,IACE;AAAA;AAAA;AAAA,UACN;AAAA;AAAA,MACF;AAAA;AAAA,EACF,GACF;AAEJ,CAAC;","names":[]}
@@ -2,13 +2,13 @@
2
2
  import {
3
3
  barChartProperties,
4
4
  barProperties
5
- } from "./chunk-F34FV5DY.mjs";
5
+ } from "./chunk-6YUJLLGN.mjs";
6
6
  import {
7
7
  getComponentProps
8
8
  } from "./chunk-QL3DB7OJ.mjs";
9
9
 
10
10
  // src/use-bar-chart.tsx
11
- import { useTheme } from "@yamada-ui/core";
11
+ import { getVar, useTheme } from "@yamada-ui/core";
12
12
  import { cx, runIfFunc } from "@yamada-ui/utils";
13
13
  import { useCallback, useState, useId, useMemo } from "react";
14
14
  import { Bar, Cell } from "recharts";
@@ -41,7 +41,6 @@ var useBarChart = ({
41
41
  } = (_a = rest.barProps) != null ? _a : {};
42
42
  const barColors = useMemo(
43
43
  () => series.map(({ color }, index) => ({
44
- __prefix: "ui",
45
44
  name: `bar-${index}`,
46
45
  token: "colors",
47
46
  value: color != null ? color : "transparent"
@@ -50,7 +49,6 @@ var useBarChart = ({
50
49
  );
51
50
  const referenceLineColors = useMemo(
52
51
  () => referenceLineProps.map(({ color }, index) => ({
53
- __prefix: "ui",
54
52
  name: `reference-line-${index}`,
55
53
  token: "colors",
56
54
  value: color != null ? color : "transparent"
@@ -61,7 +59,7 @@ var useBarChart = ({
61
59
  return [
62
60
  ...barColors,
63
61
  ...referenceLineColors,
64
- { __prefix: "ui", name: "fill-opacity", value: fillOpacity }
62
+ { name: "fill-opacity", value: fillOpacity }
65
63
  ];
66
64
  }, [barColors, fillOpacity, referenceLineColors]);
67
65
  const [chartProps, barChartClassName] = useMemo(() => {
@@ -73,7 +71,8 @@ var useBarChart = ({
73
71
  }, [rest.chartProps, styles.chart, theme]);
74
72
  const [barProps, barClassName] = useMemo(() => {
75
73
  const resolvedBarProps = {
76
- fillOpacity: "var(--ui-fill-opacity)",
74
+ fillOpacity: "$fill-opacity",
75
+ strokeOpacity: 1,
77
76
  ...computedBarProps
78
77
  };
79
78
  return getComponentProps(
@@ -112,7 +111,7 @@ var useBarChart = ({
112
111
  ...computedProps
113
112
  } = props;
114
113
  const id = `${uuid}-${dataKey}`;
115
- const color = `var(--ui-bar-${index})`;
114
+ const color = getVar(`bar-${index}`)(theme);
116
115
  const dimmed = shouldHighlight && highlightedArea !== dataKey;
117
116
  const computedDimBar = { ...dimBarProps, ...dimBar2 };
118
117
  const resolvedProps = {
@@ -252,4 +251,4 @@ var defaultBarCell = ({
252
251
  export {
253
252
  useBarChart
254
253
  };
255
- //# sourceMappingURL=chunk-S5NKKKV5.mjs.map
254
+ //# sourceMappingURL=chunk-5PSRSNGH.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/use-bar-chart.tsx"],"sourcesContent":["import type { CSSUIObject, CSSUIProps } from \"@yamada-ui/core\"\nimport { getVar, useTheme } from \"@yamada-ui/core\"\nimport { cx, runIfFunc } from \"@yamada-ui/utils\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport type { FC, ComponentPropsWithoutRef, ReactNode } from \"react\"\nimport { useCallback, useState, useId, useMemo } from \"react\"\nimport type * as Recharts from \"recharts\"\nimport { Bar, Cell } from \"recharts\"\nimport { getComponentProps } from \"./chart-utils\"\nimport type {\n BarProps,\n BarChartType,\n BarChartProps,\n ChartPropGetter,\n ChartLayoutType,\n ReferenceLineProps,\n RequiredChartPropGetter,\n} from \"./chart.types\"\nimport { barProperties, barChartProperties } from \"./rechart-properties\"\n\nexport type UseBarChartOptions = {\n /**\n * Chart data.\n */\n data: Dict[]\n /**\n * An array of objects with `name` and `color` keys. Determines which data should be consumed from the `data` array.\n */\n series: BarProps[]\n /**\n * Props for the bars.\n */\n barProps?: Partial<BarProps>\n /**\n * Controls how chart bars are positioned relative to each other.\n *\n * @default `default`\n */\n type?: BarChartType\n /**\n * Chart orientation.\n *\n * @default 'horizontal'\n */\n layoutType?: ChartLayoutType\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 * Props passed down to recharts `BarChart` component.\n */\n chartProps?: BarChartProps\n /**\n * Reference lines that should be displayed on the chart.\n */\n referenceLineProps?: ReferenceLineProps[]\n /**\n * Controls fill opacity of all bars.\n *\n * @default 1\n */\n fillOpacity?: number | [number, number]\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 * A function that returns a component that renders the bar cells.\n */\n cell?: ReactNode | FC<BarCellProps>\n}\n\nexport type UseBarChartProps = UseBarChartOptions & {\n styles: Dict<CSSUIObject>\n}\n\nexport const useBarChart = ({\n data,\n series,\n type = \"default\",\n layoutType = \"horizontal\",\n referenceLineProps = [],\n fillOpacity = 1,\n syncId,\n xAxisLabel,\n yAxisLabel,\n styles,\n cell = defaultBarCell,\n ...rest\n}: UseBarChartProps) => {\n const uuid = useId()\n const { theme } = useTheme()\n const [highlightedArea, setHighlightedArea] = useState<string | null>(null)\n const stacked = type === \"stacked\" || type === \"percent\"\n const shouldHighlight = highlightedArea !== null\n const {\n activeBar = {},\n background = {},\n dimBar = {},\n ...computedBarProps\n } = rest.barProps ?? {}\n\n const barColors: CSSUIProps[\"vars\"] = useMemo(\n () =>\n series.map(({ color }, index) => ({\n name: `bar-${index}`,\n token: \"colors\",\n value: color ?? \"transparent\",\n })),\n [series],\n )\n\n const referenceLineColors: CSSUIProps[\"vars\"] = useMemo(\n () =>\n referenceLineProps.map(({ color }, index) => ({\n name: `reference-line-${index}`,\n token: \"colors\",\n value: color ?? \"transparent\",\n })),\n [referenceLineProps],\n )\n\n const barVars: CSSUIProps[\"vars\"] = useMemo(() => {\n return [\n ...barColors,\n ...referenceLineColors,\n { name: \"fill-opacity\", value: fillOpacity },\n ]\n }, [barColors, fillOpacity, referenceLineColors])\n\n const [chartProps, barChartClassName] = useMemo(() => {\n const resolvedBarChartProps = { barGap: 8, ...rest.chartProps }\n\n return getComponentProps<Dict, string>(\n [resolvedBarChartProps, barChartProperties],\n styles.chart,\n )(theme)\n }, [rest.chartProps, styles.chart, theme])\n\n const [barProps, barClassName] = useMemo(() => {\n const resolvedBarProps = {\n fillOpacity: \"$fill-opacity\",\n strokeOpacity: 1,\n ...computedBarProps,\n }\n\n return getComponentProps<Dict, string>(\n [resolvedBarProps, barProperties],\n styles.bar,\n )(theme)\n }, [computedBarProps, styles.bar, theme])\n\n const [dimBarProps, dimBarClassName] = useMemo(\n () =>\n getComponentProps<Dict, string>(\n [dimBar, barProperties],\n styles.dimBar,\n )(theme),\n [dimBar, styles.dimBar, theme],\n )\n\n const [activeBarProps, activeBarClassName] = useMemo(\n () =>\n getComponentProps<Dict, string>(\n [activeBar, barProperties],\n styles.activeBar,\n )(theme),\n [activeBar, styles.activeBar, theme],\n )\n\n const [backgroundProps, backgroundClassName] = useMemo(\n () =>\n getComponentProps<Dict, string>(\n [background, barProperties],\n styles.background,\n )(theme),\n [background, styles.background, theme],\n )\n\n const barPropsList = useMemo(\n () =>\n series.map((props, index) => {\n const {\n dataKey,\n activeBar = {},\n background = {},\n dimBar = {},\n ...computedProps\n } = props\n const id = `${uuid}-${dataKey}`\n const color = getVar(`bar-${index}`)(theme)\n const dimmed = shouldHighlight && highlightedArea !== dataKey\n const computedDimBar = { ...dimBarProps, ...dimBar }\n const resolvedProps = {\n ...barProps,\n ...computedProps,\n ...(dimmed ? computedDimBar : {}),\n }\n\n const rest = getComponentProps<Dict, string>(\n [resolvedProps, barProperties],\n barClassName,\n dimmed ? dimBarClassName : undefined,\n )(theme, true)\n\n const computedActiveBar = { ...activeBarProps, ...activeBar }\n\n const resolvedActiveBar = getComponentProps<Dict, string>(\n [computedActiveBar, barProperties],\n activeBarClassName,\n )(theme, true)\n\n const computedBackground = { ...backgroundProps, ...background }\n\n const resolvedBackground = getComponentProps<Dict, string>(\n [computedBackground, barProperties],\n backgroundClassName,\n )(theme, true)\n\n return {\n ...rest,\n id,\n activeBar: resolvedActiveBar,\n background: resolvedBackground,\n color,\n dataKey,\n }\n }),\n [\n activeBarClassName,\n activeBarProps,\n backgroundClassName,\n backgroundProps,\n barClassName,\n barProps,\n dimBarClassName,\n dimBarProps,\n highlightedArea,\n series,\n shouldHighlight,\n theme,\n uuid,\n ],\n )\n\n const getBarProps: RequiredChartPropGetter<\n \"div\",\n {\n index: number\n },\n Omit<Recharts.BarProps, \"ref\">\n > = useCallback(\n ({ index, className: classNameProp, ...props }, ref = null) => {\n const { id, className, activeBar, background, color, dataKey, ...rest } =\n barPropsList[index]\n\n return {\n ref,\n className: cx(classNameProp, className),\n activeBar,\n background,\n id,\n name: dataKey as string,\n dataKey,\n fill: color,\n stroke: color,\n isAnimationActive: false,\n stackId: stacked ? \"stack\" : undefined,\n ...(props as Omit<Recharts.BarProps, \"dataKey\">),\n ...rest,\n } as Recharts.BarProps\n },\n [barPropsList, stacked],\n )\n\n const bars = useMemo(() => {\n const hasStack = series.some((entry) => entry.stackId)\n\n return series.map((series, index) => {\n const { dataKey } = series\n\n return (\n <Bar\n key={`bar-${dataKey}`}\n {...getBarProps({ index, className: \"ui-bar-chart__bar\" })}\n >\n {data.map((data, index) =>\n runIfFunc(cell, { series, data, index, hasStack }),\n )}\n </Bar>\n )\n })\n }, [series, getBarProps, cell, data])\n\n const getBarChartProps: ChartPropGetter<\n \"div\",\n ComponentPropsWithoutRef<typeof Recharts.BarChart>,\n ComponentPropsWithoutRef<typeof Recharts.BarChart>\n > = useCallback(\n ({ className, ...props } = {}, ref = null) => ({\n ref,\n className: cx(className, barChartClassName),\n data,\n stackOffset: type === \"percent\" ? \"expand\" : undefined,\n layout: layoutType,\n syncId,\n margin: {\n bottom: xAxisLabel ? 30 : undefined,\n left: yAxisLabel ? 10 : undefined,\n right: yAxisLabel ? 5 : undefined,\n },\n ...props,\n ...chartProps,\n }),\n [\n barChartClassName,\n data,\n type,\n layoutType,\n syncId,\n xAxisLabel,\n yAxisLabel,\n chartProps,\n ],\n )\n\n return {\n bars,\n barVars,\n getBarProps,\n getBarChartProps,\n setHighlightedArea,\n }\n}\n\nexport type UseBarChartReturn = ReturnType<typeof useBarChart>\n\nexport type BarCellProps = {\n hasStack: boolean\n series: BarProps\n data: Dict\n index: number\n}\n\nconst defaultBarCell: FC<BarCellProps> = ({\n hasStack,\n series,\n data,\n index,\n}) => {\n const { dataKey } = series\n const key = `cell-${dataKey}-${index}`\n\n if (!hasStack) return <Cell key={key} />\n\n const keys = Object.keys(data)\n const values = Object.values(data)\n\n const currentIndex = keys.findIndex((key) => key === dataKey)\n const lastIndex = values.findLastIndex((value) => value !== 0)\n\n if (currentIndex === lastIndex) return <Cell key={key} />\n\n return <Cell key={key} radius={0} />\n}\n"],"mappings":";;;;;;;;;;AACA,SAAS,QAAQ,gBAAgB;AACjC,SAAS,IAAI,iBAAiB;AAG9B,SAAS,aAAa,UAAU,OAAO,eAAe;AAEtD,SAAS,KAAK,YAAY;AAyRlB;AA9MD,IAAM,cAAc,CAAC;AAAA,EAC1B;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,aAAa;AAAA,EACb,qBAAqB,CAAC;AAAA,EACtB,cAAc;AAAA,EACd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mC,CAAC;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,EAAE,QAAQ,IAAI;AACpB,QAAM,MAAM,QAAQ,OAAO,IAAI,KAAK;AAEpC,MAAI,CAAC,SAAU,QAAO,oBAAC,UAAU,GAAK;AAEtC,QAAM,OAAO,OAAO,KAAK,IAAI;AAC7B,QAAM,SAAS,OAAO,OAAO,IAAI;AAEjC,QAAM,eAAe,KAAK,UAAU,CAACC,SAAQA,SAAQ,OAAO;AAC5D,QAAM,YAAY,OAAO,cAAc,CAAC,UAAU,UAAU,CAAC;AAE7D,MAAI,iBAAiB,UAAW,QAAO,oBAAC,UAAU,GAAK;AAEvD,SAAO,oBAAC,QAAe,QAAQ,KAAb,GAAgB;AACpC;","names":["activeBar","background","dimBar","rest","series","data","index","key"]}
@@ -62,6 +62,24 @@ var radarChartProperties = [
62
62
  "onClick"
63
63
  ];
64
64
  var pieChartProperties = ["width", "height", "margin", "onClick", "onMouseEnter", "onMouseLeave"];
65
+ var radialChartProperties = [
66
+ "width",
67
+ "height",
68
+ "data",
69
+ "margin",
70
+ "barCategoryGap",
71
+ "barGap",
72
+ "cx",
73
+ "cy",
74
+ "startAngle",
75
+ "endAngle",
76
+ "innerRadius",
77
+ "outerRadius",
78
+ "barSize",
79
+ "onMouseEnter",
80
+ "onMouseLeave",
81
+ "onClick"
82
+ ];
65
83
  var referenceLineProperties = [
66
84
  "xAxisId",
67
85
  "yAxisId",
@@ -376,6 +394,28 @@ var pieProperties = [
376
394
  "onMouseEnter",
377
395
  "onMouseLeave"
378
396
  ];
397
+ var radialBarProperties = [
398
+ "legendType",
399
+ "label",
400
+ "background",
401
+ "data",
402
+ "dataKey",
403
+ "isAnimationActive",
404
+ "animationBegin",
405
+ "animationDuration",
406
+ "animationEasing",
407
+ "onAnimationStart",
408
+ "onAnimationEnd",
409
+ "onClick",
410
+ "onMouseDown",
411
+ "onMouseUp",
412
+ "onMouseMove",
413
+ "onMouseOver",
414
+ "onMouseOut",
415
+ "onMouseEnter",
416
+ "onMouseLeave",
417
+ "cornerRadius"
418
+ ];
379
419
  var dotProperties = [
380
420
  "cx",
381
421
  "cy",
@@ -396,7 +436,8 @@ var polarGridProperties = [
396
436
  "outerRadius",
397
437
  "polarAngles",
398
438
  "polarRadius",
399
- "gridType"
439
+ "gridType",
440
+ "radialLines"
400
441
  ];
401
442
  var polarAngleAxisProperties = [
402
443
  "dataKey",
@@ -457,6 +498,18 @@ var labelProperties = [
457
498
  "content",
458
499
  "id"
459
500
  ];
501
+ var labelListProperties = [
502
+ "dataKey",
503
+ "valueAccessor",
504
+ "content",
505
+ "position",
506
+ "offset",
507
+ "formatter",
508
+ "data",
509
+ "clockWise",
510
+ "id",
511
+ "position"
512
+ ];
460
513
 
461
514
  export {
462
515
  areaChartProperties,
@@ -464,6 +517,7 @@ export {
464
517
  lineChartProperties,
465
518
  radarChartProperties,
466
519
  pieChartProperties,
520
+ radialChartProperties,
467
521
  referenceLineProperties,
468
522
  containerProperties,
469
523
  gridProperties,
@@ -476,10 +530,12 @@ export {
476
530
  radarProperties,
477
531
  lineProperties,
478
532
  pieProperties,
533
+ radialBarProperties,
479
534
  dotProperties,
480
535
  polarGridProperties,
481
536
  polarAngleAxisProperties,
482
537
  polarRadiusAxisProperties,
483
- labelProperties
538
+ labelProperties,
539
+ labelListProperties
484
540
  };
485
- //# sourceMappingURL=chunk-F34FV5DY.mjs.map
541
+ //# sourceMappingURL=chunk-6YUJLLGN.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/rechart-properties.ts"],"sourcesContent":["import type { Dict } from \"@yamada-ui/utils\"\nimport type { ComponentPropsWithoutRef } from \"react\"\nimport type * as Recharts from \"recharts\"\n\nexport const areaChartProperties: (keyof ComponentPropsWithoutRef<\n typeof Recharts.AreaChart\n>)[] = [\n \"layout\",\n \"syncId\",\n \"syncMethod\",\n \"width\",\n \"height\",\n \"data\",\n \"margin\",\n \"stackOffset\",\n \"onClick\",\n \"onMouseEnter\",\n \"onMouseMove\",\n \"onMouseLeave\",\n]\n\nexport const barChartProperties: (keyof ComponentPropsWithoutRef<\n typeof Recharts.BarChart\n>)[] = [\n \"layout\",\n \"syncId\",\n \"syncMethod\",\n \"width\",\n \"height\",\n \"data\",\n \"margin\",\n \"barCategoryGap\",\n \"barGap\",\n \"barSize\",\n \"maxBarSize\",\n \"stackOffset\",\n \"reverseStackOrder\",\n \"onClick\",\n \"onMouseEnter\",\n \"onMouseMove\",\n \"onMouseLeave\",\n]\n\nexport const lineChartProperties: (keyof ComponentPropsWithoutRef<\n typeof Recharts.LineChart\n>)[] = [\n \"layout\",\n \"syncId\",\n \"syncMethod\",\n \"width\",\n \"height\",\n \"data\",\n \"margin\",\n \"onClick\",\n \"onMouseEnter\",\n \"onMouseMove\",\n \"onMouseLeave\",\n]\n\nexport const radarChartProperties: (keyof ComponentPropsWithoutRef<\n typeof Recharts.RadarChart\n>)[] = [\n \"width\",\n \"height\",\n \"data\",\n \"cx\",\n \"cy\",\n \"startAngle\",\n \"endAngle\",\n \"innerRadius\",\n \"outerRadius\",\n \"margin\",\n \"onMouseEnter\",\n \"onClick\",\n]\n\nexport const pieChartProperties: (keyof ComponentPropsWithoutRef<\n typeof Recharts.PieChart\n>)[] = [\"width\", \"height\", \"margin\", \"onClick\", \"onMouseEnter\", \"onMouseLeave\"]\n\nexport const radialChartProperties: (keyof ComponentPropsWithoutRef<\n typeof Recharts.RadialBarChart\n>)[] = [\n \"width\",\n \"height\",\n \"data\",\n \"margin\",\n \"barCategoryGap\",\n \"barGap\",\n \"cx\",\n \"cy\",\n \"startAngle\",\n \"endAngle\",\n \"innerRadius\",\n \"outerRadius\",\n \"barSize\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n \"onClick\",\n]\n\nexport const referenceLineProperties: (keyof Recharts.ReferenceLineProps)[] = [\n \"xAxisId\",\n \"yAxisId\",\n \"x\",\n \"y\",\n \"ifOverflow\",\n \"viewBox\",\n \"xAxis\",\n \"yAxis\",\n \"label\",\n \"isFront\",\n \"strokeWidth\",\n \"segment\",\n]\n\nexport const containerProperties: (keyof Omit<\n Recharts.ResponsiveContainerProps,\n \"children\"\n>)[] = [\n \"aspect\",\n \"width\",\n \"height\",\n \"minWidth\",\n \"minHeight\",\n \"debounce\",\n \"onResize\",\n]\n\nexport const gridProperties: (keyof Recharts.CartesianGridProps)[] = [\n \"x\",\n \"y\",\n \"width\",\n \"height\",\n \"horizontal\",\n \"vertical\",\n \"horizontalPoints\",\n \"horizontalCoordinatesGenerator\",\n \"verticalPoints\",\n \"verticalCoordinatesGenerator\",\n \"fill\",\n \"fillOpacity\",\n \"strokeDasharray\",\n]\n\nexport const xAxisProperties: (keyof Recharts.XAxisProps)[] = [\n \"hide\",\n \"dataKey\",\n \"xAxisId\",\n \"width\",\n \"height\",\n \"orientation\",\n \"type\",\n \"allowDecimals\",\n \"allowDataOverflow\",\n \"allowDuplicatedCategory\",\n \"angle\",\n \"tickCount\",\n \"domain\",\n \"includeHidden\",\n \"interval\",\n \"padding\",\n \"minTickGap\",\n \"axisLine\",\n \"tickLine\",\n \"tickSize\",\n \"tickFormatter\",\n \"ticks\",\n \"tick\",\n \"mirror\",\n \"reversed\",\n \"label\",\n \"scale\",\n \"unit\",\n \"name\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n \"tickMargin\",\n]\n\nexport const yAxisProperties: (keyof Recharts.YAxisProps)[] = [\n \"hide\",\n \"dataKey\",\n \"yAxisId\",\n \"width\",\n \"height\",\n \"orientation\",\n \"type\",\n \"tickCount\",\n \"domain\",\n \"includeHidden\",\n \"interval\",\n \"padding\",\n \"minTickGap\",\n \"allowDecimals\",\n \"allowDataOverflow\",\n \"allowDuplicatedCategory\",\n \"axisLine\",\n \"tickLine\",\n \"tickSize\",\n \"tickFormatter\",\n \"ticks\",\n \"tick\",\n \"mirror\",\n \"reversed\",\n \"label\",\n \"scale\",\n \"unit\",\n \"name\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n \"tickMargin\",\n]\n\nexport const legendProperties: (keyof Omit<Recharts.LegendProps, \"ref\">)[] = [\n \"width\",\n \"height\",\n \"layout\",\n \"align\",\n \"verticalAlign\",\n \"iconSize\",\n \"iconType\",\n \"payload\",\n \"chartWidth\",\n \"chartHeight\",\n \"margin\",\n \"content\",\n \"formatter\",\n \"wrapperStyle\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n]\n\nexport const tooltipProperties: (keyof Recharts.TooltipProps<any, any>)[] = [\n \"offset\",\n \"filterNull\",\n \"itemStyle\",\n \"wrapperStyle\",\n \"contentStyle\",\n \"labelStyle\",\n \"cursor\",\n \"viewBox\",\n \"allowEscapeViewBox\",\n \"active\",\n \"position\",\n \"coordinate\",\n \"payload\",\n \"label\",\n \"content\",\n \"formatter\",\n \"labelFormatter\",\n \"itemSorter\",\n \"isAnimationActive\",\n \"animationDuration\",\n \"animationEasing\",\n]\n\nexport const areaProperties: (keyof Omit<Recharts.AreaProps, \"ref\">)[] = [\n \"type\",\n \"dataKey\",\n \"xAxisId\",\n \"yAxisId\",\n \"legendType\",\n \"dot\",\n \"activeDot\",\n \"label\",\n \"stroke\",\n \"strokeWidth\",\n \"layout\",\n \"baseLine\",\n \"points\",\n \"stackId\",\n \"connectNulls\",\n \"unit\",\n \"name\",\n \"isAnimationActive\",\n \"animationBegin\",\n \"animationDuration\",\n \"animationEasing\",\n \"id\",\n \"onAnimationStart\",\n \"onAnimationEnd\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n]\n\nexport const barProperties: (keyof Omit<Recharts.BarProps, \"ref\">)[] = [\n \"layout\",\n \"dataKey\",\n \"xAxisId\",\n \"yAxisId\",\n \"legendType\",\n \"label\",\n \"data\",\n \"barSize\",\n \"maxBarSize\",\n \"minPointSize\",\n \"background\",\n \"shape\",\n \"activeBar\",\n \"stackId\",\n \"unit\",\n \"name\",\n \"isAnimationActive\",\n \"animationBegin\",\n \"animationDuration\",\n \"animationEasing\",\n \"id\",\n \"onAnimationStart\",\n \"onAnimationEnd\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n \"radius\",\n]\n\nexport const radarProperties: (keyof Omit<Recharts.RadarProps, \"ref\">)[] = [\n \"dataKey\",\n \"points\",\n \"shape\",\n \"dot\",\n \"activeDot\",\n \"legendType\",\n \"label\",\n \"isAnimationActive\",\n \"animationBegin\",\n \"animationDuration\",\n \"animationEasing\",\n \"onAnimationStart\",\n \"onAnimationEnd\",\n]\n\nexport const lineProperties: (keyof Omit<Recharts.LineProps, \"ref\">)[] = [\n \"type\",\n \"dataKey\",\n \"xAxisId\",\n \"yAxisId\",\n \"legendType\",\n \"dot\",\n \"activeDot\",\n \"label\",\n \"hide\",\n \"points\",\n \"stroke\",\n \"strokeWidth\",\n \"layout\",\n \"connectNulls\",\n \"unit\",\n \"name\",\n \"isAnimationActive\",\n \"animationBegin\",\n \"animationDuration\",\n \"animationEasing\",\n \"id\",\n \"onAnimationStart\",\n \"onAnimationEnd\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n \"strokeDasharray\",\n]\n\nexport const pieProperties: (keyof Omit<Recharts.PieProps, \"ref\">)[] = [\n \"cx\",\n \"cy\",\n \"innerRadius\",\n \"outerRadius\",\n \"startAngle\",\n \"endAngle\",\n \"minAngle\",\n \"paddingAngle\",\n \"nameKey\",\n \"dataKey\",\n \"legendType\",\n \"label\",\n \"labelLine\",\n \"data\",\n \"activeIndex\",\n \"activeShape\",\n \"inactiveShape\",\n \"isAnimationActive\",\n \"animationBegin\",\n \"animationDuration\",\n \"animationEasing\",\n \"onAnimationStart\",\n \"onAnimationEnd\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n]\n\nexport const radialBarProperties: (keyof Omit<\n Recharts.RadialBarProps,\n \"ref\"\n>)[] = [\n \"legendType\",\n \"label\",\n \"background\",\n \"data\",\n \"dataKey\",\n \"isAnimationActive\",\n \"animationBegin\",\n \"animationDuration\",\n \"animationEasing\",\n \"onAnimationStart\",\n \"onAnimationEnd\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n \"cornerRadius\",\n]\n\nexport const dotProperties: (keyof Omit<Recharts.DotProps, \"ref\">)[] = [\n \"cx\",\n \"cy\",\n \"r\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n]\n\nexport const polarGridProperties: (keyof Recharts.PolarGridProps)[] = [\n \"cx\",\n \"cy\",\n \"innerRadius\",\n \"outerRadius\",\n \"polarAngles\",\n \"polarRadius\",\n \"gridType\",\n \"radialLines\",\n]\n\nexport const polarAngleAxisProperties: (keyof Recharts.PolarAngleAxisProps)[] =\n [\n \"dataKey\",\n \"cx\",\n \"cy\",\n \"radius\",\n \"axisLine\",\n \"axisLineType\",\n \"tickLine\",\n \"tickSize\",\n \"tick\",\n \"ticks\",\n \"orient\",\n \"tickFormatter\",\n \"type\",\n \"allowDuplicatedCategory\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n ]\n\nexport const polarRadiusAxisProperties: (keyof Recharts.PolarRadiusAxisProps)[] =\n [\n \"angle\",\n \"type\",\n \"allowDuplicatedCategory\",\n \"cx\",\n \"cy\",\n \"domain\",\n \"reversed\",\n \"label\",\n \"orientation\",\n \"axisLine\",\n \"tick\",\n \"tickSize\",\n \"tickFormatter\",\n \"tickCount\",\n \"scale\",\n \"onClick\",\n \"onMouseDown\",\n \"onMouseUp\",\n \"onMouseMove\",\n \"onMouseOver\",\n \"onMouseOut\",\n \"onMouseEnter\",\n \"onMouseLeave\",\n ]\n\nexport const labelProperties: (keyof Recharts.LabelProps)[] = [\n \"viewBox\",\n \"formatter\",\n \"value\",\n \"position\",\n \"offset\",\n \"children\",\n \"content\",\n \"id\",\n]\n\nexport const labelListProperties: (keyof Recharts.LabelListProps<Dict>)[] = [\n \"dataKey\",\n \"valueAccessor\",\n \"content\",\n \"position\",\n \"offset\",\n \"formatter\",\n \"data\",\n \"clockWise\",\n \"id\",\n \"position\",\n]\n"],"mappings":";;;AAIO,IAAM,sBAEN;AAAA,EACL;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,qBAEN;AAAA,EACL;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,sBAEN;AAAA,EACL;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;A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ACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,kBAAiD;AAAA,EAC5D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,mBAAgE;AAAA,EAC3E;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,oBAA+D;AAAA,EAC1E;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,iBAA4D;AAAA,EACvE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,gBAA0D;AAAA,EACrE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,kBAA8D;AAAA,EACzE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,iBAA4D;AAAA,EACvE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,gBAA0D;AAAA,EACrE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,sBAGN;AAAA,EACL;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,gBAA0D;AAAA,EACrE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,sBAAyD;AAAA,EACpE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,2BACX;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEK,IAAM,4BACX;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEK,IAAM,kBAAiD;AAAA,EAC5D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,sBAA+D;AAAA,EAC1E;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":[]}
@@ -1,32 +1,32 @@
1
1
  "use client"
2
2
  import {
3
3
  useLineChart
4
- } from "./chunk-6L73M52L.mjs";
4
+ } from "./chunk-FPFCMFCJ.mjs";
5
5
  import {
6
6
  useChartAxis
7
- } from "./chunk-VK4VQQYY.mjs";
7
+ } from "./chunk-YNJ423BR.mjs";
8
8
  import {
9
9
  useChartGrid
10
- } from "./chunk-D7EZKGCJ.mjs";
10
+ } from "./chunk-PPBHLDVN.mjs";
11
11
  import {
12
12
  useChartReferenceLine
13
- } from "./chunk-Q7CCSKX3.mjs";
14
- import {
15
- useChartLegend
16
- } from "./chunk-5Q6O726L.mjs";
13
+ } from "./chunk-JTQ5QCML.mjs";
17
14
  import {
18
15
  useChartTooltip
19
- } from "./chunk-AOGTJ4EN.mjs";
16
+ } from "./chunk-VMBRDEM2.mjs";
17
+ import {
18
+ useChartLegend
19
+ } from "./chunk-TCSYDMC7.mjs";
20
20
  import {
21
21
  ChartLegend
22
- } from "./chunk-DGOXJ373.mjs";
22
+ } from "./chunk-EL2VTGFB.mjs";
23
23
  import {
24
24
  ChartTooltip
25
- } from "./chunk-MT5JI4OR.mjs";
25
+ } from "./chunk-T5DNDBW6.mjs";
26
26
  import {
27
27
  ChartProvider,
28
28
  useChart
29
- } from "./chunk-STBYN5JW.mjs";
29
+ } from "./chunk-3AOICU4Q.mjs";
30
30
 
31
31
  // src/line-chart.tsx
32
32
  import {
@@ -183,8 +183,7 @@ var LineChart = forwardRef((props, ref) => {
183
183
  {
184
184
  ref,
185
185
  className: cx("ui-line-chart", className),
186
- var: lineVars,
187
- __css: { ...styles.container },
186
+ __css: { maxW: "full", vars: lineVars, ...styles.container },
188
187
  ...rest,
189
188
  children: /* @__PURE__ */ jsx(
190
189
  ResponsiveContainer,
@@ -264,4 +263,4 @@ var LineChart = forwardRef((props, ref) => {
264
263
  export {
265
264
  LineChart
266
265
  };
267
- //# sourceMappingURL=chunk-KBBHISBO.mjs.map
266
+ //# sourceMappingURL=chunk-BYL7HWNN.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/line-chart.tsx"],"sourcesContent":["import type { HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n useMultiComponentStyle,\n omitThemeProps,\n} from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useMemo } from \"react\"\nimport {\n LineChart as ReChartsLineChart,\n Legend,\n CartesianGrid,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n ReferenceLine,\n Line,\n Label,\n} from \"recharts\"\nimport { ChartLegend } from \"./chart-legend\"\nimport { ChartTooltip } from \"./chart-tooltip\"\nimport type { UseChartProps } from \"./use-chart\"\nimport { ChartProvider, useChart } from \"./use-chart\"\nimport type { UseChartAxisOptions } from \"./use-chart-axis\"\nimport { useChartAxis } from \"./use-chart-axis\"\nimport type { UseChartGridOptions } from \"./use-chart-grid\"\nimport { useChartGrid } from \"./use-chart-grid\"\nimport type { UseChartLegendProps } from \"./use-chart-legend\"\nimport { useChartLegend } from \"./use-chart-legend\"\nimport type { UseChartReferenceLineOptions } from \"./use-chart-reference-line\"\nimport { useChartReferenceLine } from \"./use-chart-reference-line\"\nimport {\n useChartTooltip,\n type UseChartTooltipOptions,\n} from \"./use-chart-tooltip\"\nimport { useLineChart } from \"./use-line-chart\"\nimport type { UseLineChartOptions } from \"./use-line-chart\"\n\ntype LineChartOptions = {\n /**\n * If `true`, tooltip is visible.\n *\n * @default true\n */\n withTooltip?: boolean\n /**\n * If `true`, legend is visible.\n *\n * @default false\n */\n withLegend?: boolean\n}\n\nexport type LineChartProps = HTMLUIProps<\"div\"> &\n ThemeProps<\"LineChart\"> &\n LineChartOptions &\n UseChartProps &\n UseChartAxisOptions &\n UseChartReferenceLineOptions &\n UseChartGridOptions &\n UseChartTooltipOptions &\n UseChartLegendProps &\n UseLineChartOptions\n\n/**\n * `LineChart` is a component for drawing line charts to compare multiple sets of data.\n *\n * @see Docs https://yamada-ui.com/components/data-display/line-chart\n */\nexport const LineChart = forwardRef<LineChartProps, \"div\">((props, ref) => {\n const [styles, mergedProps] = useMultiComponentStyle(\"LineChart\", props)\n const {\n className,\n containerProps,\n gridProps,\n gridAxis,\n strokeDasharray,\n dataKey,\n type,\n layoutType,\n tickLine,\n withXAxis,\n withYAxis,\n xAxisProps,\n yAxisProps,\n xAxisLabel,\n yAxisLabel,\n xAxisLabelProps,\n yAxisLabelProps,\n unit,\n yAxisTickFormatter,\n xAxisTickFormatter,\n valueFormatter,\n labelFormatter,\n referenceLineProps,\n tooltipProps,\n tooltipAnimationDuration,\n legendProps,\n withLegend = false,\n withTooltip = true,\n series,\n data,\n chartProps,\n lineProps,\n withDots,\n withActiveDots,\n curveType,\n strokeWidth,\n connectNulls,\n fillOpacity,\n syncId,\n ...rest\n } = omitThemeProps(mergedProps)\n\n const { getLineProps, getLineChartProps, lineVars, setHighlightedArea } =\n useLineChart({\n layoutType,\n series,\n referenceLineProps,\n data,\n chartProps,\n lineProps,\n withDots,\n withActiveDots,\n curveType,\n strokeWidth,\n connectNulls,\n fillOpacity,\n syncId,\n xAxisLabel,\n yAxisLabel,\n styles,\n })\n const { getContainerProps } = useChart({ containerProps })\n const {\n getXAxisProps,\n getYAxisProps,\n getXAxisLabelProps,\n getYAxisLabelProps,\n } = useChartAxis({\n dataKey,\n type,\n layoutType,\n tickLine,\n gridAxis,\n withXAxis,\n withYAxis,\n xAxisProps,\n yAxisProps,\n xAxisLabel,\n yAxisLabel,\n xAxisLabelProps,\n yAxisLabelProps,\n unit,\n yAxisTickFormatter,\n xAxisTickFormatter,\n styles,\n })\n const { getReferenceLineProps } = useChartReferenceLine({\n referenceLineProps,\n styles,\n })\n const { getGridProps } = useChartGrid({\n gridProps,\n gridAxis,\n strokeDasharray,\n styles,\n })\n const { tooltipProps: computedTooltipProps, getTooltipProps } =\n useChartTooltip({\n tooltipProps,\n tooltipAnimationDuration,\n styles,\n })\n const { legendProps: computedLegendProps, getLegendProps } = useChartLegend({\n legendProps,\n })\n\n const lines = useMemo(\n () =>\n series.map(({ dataKey }, index) => (\n <Line\n key={`line-${dataKey}`}\n {...getLineProps({ index, className: \"ui-line-chart__line\" })}\n />\n )),\n [getLineProps, series],\n )\n\n const referenceLinesItems = useMemo(\n () =>\n referenceLineProps?.map((_, index) => (\n <ReferenceLine\n key={`referenceLine-${index}`}\n {...getReferenceLineProps({\n index,\n className: \"ui-line-chart__reference-line\",\n })}\n />\n )),\n [getReferenceLineProps, referenceLineProps],\n )\n\n return (\n <ChartProvider value={{ styles }}>\n <ui.div\n ref={ref}\n className={cx(\"ui-line-chart\", className)}\n __css={{ maxW: \"full\", vars: lineVars, ...styles.container }}\n {...rest}\n >\n <ResponsiveContainer\n {...getContainerProps({ className: \"ui-line-chart__container\" })}\n >\n <ReChartsLineChart\n {...getLineChartProps({ className: \"ui-line-chart__chart\" })}\n >\n <CartesianGrid\n {...getGridProps({ className: \"ui-line-chart__grid\" })}\n />\n\n <XAxis {...getXAxisProps({ className: \"ui-line-chart__x-axis\" })}>\n <Label\n {...getXAxisLabelProps({\n className: \"ui-line-chart__x-axis-label\",\n })}\n />\n </XAxis>\n\n <YAxis {...getYAxisProps({ className: \"ui-line-chart__y-axis\" })}>\n <Label\n {...getYAxisLabelProps({\n className: \"ui-line-chart__y-axis-label\",\n })}\n />\n </YAxis>\n\n {withLegend ? (\n <Legend\n content={({ payload }) => (\n <ChartLegend\n className=\"ui-line-chart__legend\"\n payload={payload}\n onHighlight={setHighlightedArea}\n {...computedLegendProps}\n />\n )}\n {...getLegendProps()}\n />\n ) : null}\n\n {withTooltip ? (\n <Tooltip\n content={({ label, payload }) => (\n <ChartTooltip\n className=\"ui-line-chart__tooltip\"\n label={label}\n payload={payload}\n valueFormatter={valueFormatter}\n labelFormatter={labelFormatter}\n unit={unit}\n {...computedTooltipProps}\n />\n )}\n {...getTooltipProps()}\n />\n ) : null}\n\n {lines}\n {referenceLinesItems}\n </ReChartsLineChart>\n </ResponsiveContainer>\n </ui.div>\n </ChartProvider>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,UAAU;AACnB,SAAS,eAAe;AACxB;AAAA,EACE,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAmKC,cAiCE,YAjCF;AAhHD,IAAM,YAAY,WAAkC,CAAC,OAAO,QAAQ;AACzE,QAAM,CAAC,QAAQ,WAAW,IAAI,uBAAuB,aAAa,KAAK;AACvE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI,eAAe,WAAW;AAE9B,QAAM,EAAE,cAAc,mBAA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ED,GAAG,eAAe;AAAA;AAAA,gBACrB,IACE;AAAA,gBAEH,cACC;AAAA,kBAAC;AAAA;AAAA,oBACC,SAAS,CAAC,EAAE,OAAO,QAAQ,MACzB;AAAA,sBAAC;AAAA;AAAA,wBACC,WAAU;AAAA,wBACV;AAAA,wBACA;AAAA,wBACA;AAAA,wBACA;AAAA,wBACA;AAAA,wBACC,GAAG;AAAA;AAAA,oBACN;AAAA,oBAED,GAAG,gBAAgB;AAAA;AAAA,gBACtB,IACE;AAAA,gBAEH;AAAA,gBACA;AAAA;AAAA;AAAA,UACH;AAAA;AAAA,MACF;AAAA;AAAA,EACF,GACF;AAEJ,CAAC;","names":["dataKey"]}
@@ -0,0 +1,46 @@
1
+ "use client"
2
+ import {
3
+ labelListProperties
4
+ } from "./chunk-6YUJLLGN.mjs";
5
+ import {
6
+ getComponentProps
7
+ } from "./chunk-QL3DB7OJ.mjs";
8
+
9
+ // src/use-chart-label-list.ts
10
+ import { getCSS, useTheme } from "@yamada-ui/core";
11
+ import { cx } from "@yamada-ui/utils";
12
+ import { useCallback, useMemo } from "react";
13
+ var useChartLabelList = ({
14
+ labelListProps = [],
15
+ styles
16
+ }) => {
17
+ const { theme } = useTheme();
18
+ const styleClassName = getCSS(styles.labelList)(theme);
19
+ const propList = useMemo(
20
+ () => labelListProps.map(
21
+ (props) => getComponentProps(
22
+ [props, labelListProperties],
23
+ styleClassName
24
+ )(theme, true)
25
+ ),
26
+ [labelListProps, styleClassName, theme]
27
+ );
28
+ const getLabelLineProps = useCallback(
29
+ ({ index, className, ...props }, ref = null) => {
30
+ const { className: propClassName, ...rest } = propList[index];
31
+ return {
32
+ ref,
33
+ className: cx(className, propClassName),
34
+ ...props,
35
+ ...rest
36
+ };
37
+ },
38
+ [propList]
39
+ );
40
+ return { getLabelLineProps };
41
+ };
42
+
43
+ export {
44
+ useChartLabelList
45
+ };
46
+ //# sourceMappingURL=chunk-D5IRVU4W.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/use-chart-label-list.ts"],"sourcesContent":["import { getCSS, useTheme, type CSSUIObject } from \"@yamada-ui/core\"\nimport { cx, type Dict } from \"@yamada-ui/utils\"\nimport { useCallback, useMemo } from \"react\"\nimport type * as Recharts from \"recharts\"\nimport { getComponentProps } from \"./chart-utils\"\nimport type { LabelListProps, RequiredChartPropGetter } from \"./chart.types\"\nimport { labelListProperties } from \"./rechart-properties\"\n\nexport type UseChartLabelListOptions = {\n /**\n * Props passed down to recharts `LabelList` components.\n */\n labelListProps?: LabelListProps[]\n}\n\ntype UseChartLabelListProps = UseChartLabelListOptions & {\n styles: Dict<CSSUIObject>\n}\n\nexport const useChartLabelList = ({\n labelListProps = [],\n styles,\n}: UseChartLabelListProps) => {\n const { theme } = useTheme()\n const styleClassName = getCSS(styles.labelList)(theme)\n\n const propList = useMemo(\n () =>\n labelListProps.map((props) =>\n getComponentProps<Dict, string>(\n [props, labelListProperties],\n styleClassName,\n )(theme, true),\n ),\n [labelListProps, styleClassName, theme],\n )\n\n const getLabelLineProps: RequiredChartPropGetter<\n \"div\",\n { index: number },\n Omit<Recharts.LabelListProps<Dict>, \"ref\">\n > = useCallback(\n ({ index, className, ...props }, ref = null) => {\n const { className: propClassName, ...rest } = propList[index]\n\n return {\n ref,\n className: cx(className, propClassName),\n ...(props as Recharts.LabelListProps<Dict>),\n ...rest,\n }\n },\n [propList],\n )\n\n return { getLabelLineProps }\n}\n"],"mappings":";;;;;;;;;AAAA,SAAS,QAAQ,gBAAkC;AACnD,SAAS,UAAqB;AAC9B,SAAS,aAAa,eAAe;AAiB9B,IAAM,oBAAoB,CAAC;AAAA,EAChC,iBAAiB,CAAC;AAAA,EAClB;AACF,MAA8B;AAC5B,QAAM,EAAE,MAAM,IAAI,SAAS;AAC3B,QAAM,iBAAiB,OAAO,OAAO,SAAS,EAAE,KAAK;AAErD,QAAM,WAAW;AAAA,IACf,MACE,eAAe;AAAA,MAAI,CAAC,UAClB;AAAA,QACE,CAAC,OAAO,mBAAmB;AAAA,QAC3B;AAAA,MACF,EAAE,OAAO,IAAI;AAAA,IACf;AAAA,IACF,CAAC,gBAAgB,gBAAgB,KAAK;AAAA,EACxC;AAEA,QAAM,oBAIF;AAAA,IACF,CAAC,EAAE,OAAO,WAAW,GAAG,MAAM,GAAG,MAAM,SAAS;AAC9C,YAAM,EAAE,WAAW,eAAe,GAAG,KAAK,IAAI,SAAS,KAAK;AAE5D,aAAO;AAAA,QACL;AAAA,QACA,WAAW,GAAG,WAAW,aAAa;AAAA,QACtC,GAAI;AAAA,QACJ,GAAG;AAAA,MACL;AAAA,IACF;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,SAAO,EAAE,kBAAkB;AAC7B;","names":[]}
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
  import {
3
3
  useLegend
4
- } from "./chunk-STBYN5JW.mjs";
4
+ } from "./chunk-3AOICU4Q.mjs";
5
5
 
6
6
  // src/chart-legend.tsx
7
7
  import { forwardRef, ui } from "@yamada-ui/core";
@@ -50,4 +50,4 @@ var ChartLegend = forwardRef(
50
50
  export {
51
51
  ChartLegend
52
52
  };
53
- //# sourceMappingURL=chunk-DGOXJ373.mjs.map
53
+ //# sourceMappingURL=chunk-EL2VTGFB.mjs.map