@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 +1 @@
1
- {"version":3,"sources":["../src/bar-chart.tsx","../src/chart-legend.tsx","../src/use-chart.ts","../src/chart-utils.ts","../src/rechart-properties.ts","../src/chart-tooltip.tsx","../src/use-bar-chart.tsx","../src/use-chart-axis.ts","../src/use-chart-grid.ts","../src/use-chart-legend.ts","../src/use-chart-reference-line.ts","../src/use-chart-tooltip.ts"],"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 Legend,\n BarChart as ReChartsBarChart,\n CartesianGrid,\n Tooltip,\n XAxis,\n YAxis,\n ResponsiveContainer,\n ReferenceLine,\n Label,\n} from \"recharts\"\nimport { ChartLegend } from \"./chart-legend\"\nimport { ChartTooltip } from \"./chart-tooltip\"\nimport { useBarChart } from \"./use-bar-chart\"\nimport type { UseBarChartOptions } from \"./use-bar-chart\"\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 { useChartGrid, type UseChartGridOptions } from \"./use-chart-grid\"\nimport type { UseChartLegendProps } from \"./use-chart-legend\"\nimport { useChartLegend } from \"./use-chart-legend\"\nimport {\n useChartReferenceLine,\n type UseChartReferenceLineOptions,\n} from \"./use-chart-reference-line\"\nimport type { UseChartTooltipOptions } from \"./use-chart-tooltip\"\nimport { useChartTooltip } from \"./use-chart-tooltip\"\n\ntype BarChartOptions = {\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 BarChartProps = HTMLUIProps<\"div\"> &\n ThemeProps<\"BarChart\"> &\n BarChartOptions &\n UseBarChartOptions &\n UseChartProps &\n UseChartAxisOptions &\n UseChartReferenceLineOptions &\n UseChartGridOptions &\n UseChartTooltipOptions &\n UseChartLegendProps\n\n/**\n * `BarChart` is a component for drawing bar charts to compare multiple sets of data.\n *\n * @see Docs https://yamada-ui.com/components/feedback/bar-chart\n */\nexport const BarChart = forwardRef<BarChartProps, \"div\">((props, ref) => {\n const [styles, mergedProps] = useMultiComponentStyle(\"BarChart\", props)\n const {\n className,\n series,\n dataKey,\n layoutType,\n tickLine,\n gridAxis,\n withXAxis,\n withYAxis,\n barProps,\n xAxisProps,\n yAxisProps,\n xAxisLabel,\n yAxisLabel,\n xAxisLabelProps,\n yAxisLabelProps,\n type = \"default\",\n withTooltip = true,\n withLegend = false,\n containerProps,\n unit,\n yAxisTickFormatter,\n xAxisTickFormatter,\n valueFormatter,\n labelFormatter,\n tooltipProps,\n tooltipAnimationDuration,\n legendProps,\n data,\n referenceLineProps = [],\n gridProps,\n strokeDasharray,\n fillOpacity,\n chartProps,\n syncId,\n cell,\n ...rest\n } = omitThemeProps(mergedProps)\n\n const { bars, barVars, getBarChartProps, setHighlightedArea } = useBarChart({\n data,\n series,\n cell,\n type,\n layoutType,\n chartProps,\n barProps,\n referenceLineProps,\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 referenceLinesItems = useMemo(\n () =>\n referenceLineProps.map((_, index) => (\n <ReferenceLine\n key={`referenceLine-${index}`}\n {...getReferenceLineProps({\n index,\n className: \"ui-bar-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-bar-chart\", className)}\n var={barVars}\n __css={{ ...styles.container }}\n {...rest}\n >\n <ResponsiveContainer\n {...getContainerProps({ className: \"ui-bar-chart__container\" })}\n >\n <ReChartsBarChart\n {...getBarChartProps({ className: \"ui-bar-chart__chart\" })}\n >\n <CartesianGrid\n {...getGridProps({ className: \"ui-bar-chart__grid\" })}\n />\n\n <XAxis {...getXAxisProps({ className: \"ui-bar-chart__x-axis\" })}>\n <Label\n {...getXAxisLabelProps({\n className: \"ui-bar-chart__x-axis-label\",\n })}\n />\n </XAxis>\n\n <YAxis {...getYAxisProps({ className: \"ui-bar-chart__y-axis\" })}>\n <Label\n {...getYAxisLabelProps({\n className: \"ui-bar-chart__y-axis-label\",\n })}\n />\n </YAxis>\n\n {withLegend ? (\n <Legend\n content={({ payload }) => (\n <ChartLegend\n className=\"ui-bar-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-bar-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 {bars}\n {referenceLinesItems}\n </ReChartsBarChart>\n </ResponsiveContainer>\n </ui.div>\n </ChartProvider>\n )\n})\n","import type { HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx, type Dict } from \"@yamada-ui/utils\"\nimport { useLegend } from \"./use-chart\"\n\ntype ChartLegendOptions = {\n payload?: Dict[]\n onHighlight: (area: string | null) => void\n}\n\nexport type ChartLegendProps = HTMLUIProps<\"div\"> & ChartLegendOptions\n\nexport const ChartLegend = forwardRef<ChartLegendProps, \"div\">(\n ({ className, payload = [], onHighlight, ...rest }, ref) => {\n const { styles } = useLegend()\n\n const items = payload.map(({ dataKey, value: valueProp, color }, index) => {\n const value = dataKey ?? valueProp\n\n return (\n <ui.div\n className=\"ui-chart__legend-item\"\n key={`legend-${index}`}\n onMouseEnter={() => onHighlight(value)}\n onMouseLeave={() => onHighlight(null)}\n __css={styles.legendItem}\n >\n <ui.div\n className=\"ui-chart__legend-swatch\"\n background={color}\n __css={styles.legendSwatch}\n />\n\n <ui.span className=\"ui-chart__legend-label\">{value}</ui.span>\n </ui.div>\n )\n })\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-chart__legend\", className)}\n __css={styles.legend}\n {...rest}\n >\n {items}\n </ui.div>\n )\n },\n)\n","import { useTheme, type CSSUIObject } from \"@yamada-ui/core\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport { createContext, cx } from \"@yamada-ui/utils\"\nimport { useCallback } from \"react\"\nimport type * as Recharts from \"recharts\"\nimport { getComponentProps } from \"./chart-utils\"\nimport type { ChartPropGetter, ResponsiveContainerProps } from \"./chart.types\"\nimport { containerProperties } from \"./rechart-properties\"\n\ntype ChartContext = { styles: Record<string, CSSUIObject> }\n\nexport const [ChartProvider, useChartContext] = createContext<ChartContext>({\n name: \"ChartContext\",\n errorMessage: `useChartContext returned is 'undefined'. Seems you forgot to wrap the components in \"<LineChart />\" or \"<BarChart />\" etc.`,\n})\n\nexport type UseChartProps = {\n /**\n * Props passed down to recharts `ResponsiveContainer` component.\n */\n containerProps?: ResponsiveContainerProps\n}\n\nexport const useChart = ({ containerProps = {} }: UseChartProps) => {\n const { theme } = useTheme()\n const [reChartsProps, propClassName] = getComponentProps<Dict, string>([\n containerProps,\n containerProperties,\n ])(theme)\n\n const getContainerProps: ChartPropGetter<\n \"div\",\n Partial<Omit<Recharts.ResponsiveContainerProps, \"children\">>,\n Omit<Recharts.ResponsiveContainerProps, \"children\">\n > = useCallback(\n ({ className, ...props } = {}, ref = null) => ({\n ref,\n className: cx(\"ui-chart__container\", className as string, propClassName),\n ...props,\n ...reChartsProps,\n }),\n [propClassName, reChartsProps],\n )\n\n return {\n getContainerProps,\n }\n}\n\nexport type UseChartReturn = ReturnType<typeof useChart>\n\nexport type UseLegendProps = {}\n\nexport const useLegend = ({}: UseLegendProps = {}) => {\n const { styles } = useChartContext()\n return {\n styles,\n }\n}\nexport type UseLegendReturn = ReturnType<typeof useLegend>\n\nexport type UseTooltipProps = {}\n\nexport const useTooltip = ({}: UseTooltipProps = {}) => {\n const { styles } = useChartContext()\n return {\n styles,\n }\n}\nexport type UseTooltipReturn = ReturnType<typeof useTooltip>\n","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","import 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 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 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]\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","import { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx, isArray, type Dict } from \"@yamada-ui/utils\"\nimport { useTooltip } from \"./use-chart\"\n\nexport type ChartTooltipProps = {\n label: string | undefined\n payload: Dict[] | undefined\n valueFormatter?: (value: any) => string\n labelFormatter?: (label: string) => string\n unit?: string\n}\n\nexport const ChartTooltip = forwardRef<ChartTooltipProps, \"div\">(\n (\n {\n label,\n className,\n payload = [],\n valueFormatter,\n labelFormatter,\n unit,\n ...rest\n },\n ref,\n ) => {\n const { styles } = useTooltip()\n\n const items = payload.map(\n ({ color: colorProp, name, value: valueProp, payload } = {}, index) => {\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","import type { CSSUIObject, CSSUIProps } from \"@yamada-ui/core\"\nimport { 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[\"var\"] = useMemo(\n () =>\n series.map(({ color }, index) => ({\n __prefix: \"ui\",\n name: `bar-${index}`,\n token: \"colors\",\n value: color ?? \"transparent\",\n })),\n [series],\n )\n\n const referenceLineColors: CSSUIProps[\"var\"] = useMemo(\n () =>\n referenceLineProps.map(({ color }, index) => ({\n __prefix: \"ui\",\n name: `reference-line-${index}`,\n token: \"colors\",\n value: color ?? \"transparent\",\n })),\n [referenceLineProps],\n )\n\n const barVars: CSSUIProps[\"var\"] = useMemo(() => {\n return [\n ...barColors,\n ...referenceLineColors,\n { __prefix: \"ui\", 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: \"var(--ui-fill-opacity)\",\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 = `var(--ui-bar-${index})`\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","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport { useTheme } from \"@yamada-ui/core\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport { cx } from \"@yamada-ui/utils\"\nimport type { SVGProps } from \"react\"\nimport { useCallback, useMemo } from \"react\"\nimport type * as Recharts from \"recharts\"\nimport { getComponentProps } from \"./chart-utils\"\nimport type {\n ChartAxisType,\n ChartLayoutType,\n XAxisProps,\n YAxisProps,\n ChartPropGetter,\n AreaChartType,\n LabelProps,\n} from \"./chart.types\"\nimport {\n labelProperties,\n xAxisProperties,\n yAxisProperties,\n} from \"./rechart-properties\"\n\nexport type UseChartAxisOptions = {\n /**\n * The key of a group of data which should be unique in an chart.\n */\n dataKey: string\n /**\n * Controls how chart areas are positioned relative to each other\n *\n * @default `default`\n */\n type?: AreaChartType\n /**\n * Chart orientation.\n *\n * @default 'horizontal'\n */\n layoutType?: ChartLayoutType\n /**\n * The option is the configuration of tick lines.\n *\n * @default 'y'\n */\n tickLine?: ChartAxisType\n /**\n * Specifies which lines should be displayed in the grid.\n *\n * @default 'x'\n */\n gridAxis?: ChartAxisType\n /**\n * If `true`, X axis is visible.\n *\n * @default true\n */\n withXAxis?: boolean\n /**\n * If `true`, Y axis is visible.\n *\n * @default true\n */\n withYAxis?: boolean\n /**\n * Props passed down to recharts 'XAxis' component.\n */\n xAxisProps?: XAxisProps\n /**\n * Props passed down to recharts 'YAxis' component.\n */\n yAxisProps?: YAxisProps\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 'XAxisLabel' component.\n */\n xAxisLabelProps?: LabelProps\n /**\n * Props passed down to recharts 'YAxisLabel' component.\n */\n yAxisLabelProps?: LabelProps\n /**\n * Unit displayed next to each tick in y-axis.\n */\n unit?: string\n /**\n * A function to format Y axis tick.\n */\n yAxisTickFormatter?: (value: any) => string\n /**\n * A function to format X axis tick.\n */\n xAxisTickFormatter?: (value: any) => string\n}\n\nexport type UseChartAxisProps = UseChartAxisOptions & {\n styles: Dict<CSSUIObject>\n}\n\nexport const useChartAxis = ({\n dataKey,\n type,\n layoutType = \"horizontal\",\n tickLine = \"y\",\n gridAxis = \"x\",\n withXAxis = true,\n withYAxis = true,\n xAxisLabel: xAxisLabelProp,\n yAxisLabel: yAxisLabelProp,\n unit,\n yAxisTickFormatter = type === \"percent\" && layoutType === \"horizontal\"\n ? valueToPercent\n : undefined,\n xAxisTickFormatter = type === \"percent\" && layoutType === \"vertical\"\n ? valueToPercent\n : undefined,\n styles,\n ...rest\n}: UseChartAxisProps) => {\n const { theme } = useTheme()\n const xAxisKey: Recharts.XAxisProps = useMemo(\n () => (layoutType === \"vertical\" ? { type: \"number\" } : { dataKey }),\n [dataKey, layoutType],\n )\n\n const yAxisKey: Recharts.YAxisProps = useMemo(\n () =>\n layoutType === \"vertical\"\n ? { dataKey, type: \"category\" }\n : { type: \"number\" },\n [dataKey, layoutType],\n )\n const withXTickLine =\n gridAxis !== \"none\" && (tickLine === \"x\" || tickLine === \"xy\")\n const withYTickLine =\n gridAxis !== \"none\" && (tickLine === \"y\" || tickLine === \"xy\")\n const getTickLine = (\n withTickLine: boolean,\n ): boolean | SVGProps<SVGTextElement> =>\n withTickLine ? { stroke: \"currentColor\" } : false\n const xTickLine = getTickLine(withXTickLine)\n const yTickLine = getTickLine(withYTickLine)\n\n const xAxisLabel = layoutType === \"vertical\" ? yAxisLabelProp : xAxisLabelProp\n const yAxisLabel = layoutType === \"vertical\" ? xAxisLabelProp : yAxisLabelProp\n\n const [xAxisProps, xAxisClassName] = getComponentProps<Dict, string>(\n [rest.xAxisProps ?? {}, xAxisProperties],\n styles.xAxis,\n )(theme)\n\n const [yAxisProps, yAxisClassName] = getComponentProps<Dict, string>(\n [rest.yAxisProps ?? {}, yAxisProperties],\n styles.yAxis,\n )(theme)\n\n const [xAxisLabelProps, xAxisLabelClassName] = getComponentProps<\n Dict,\n string\n >(\n [rest.xAxisLabelProps ?? {}, labelProperties],\n styles.xAxisLabel,\n )(theme)\n\n const [yAxisLabelProps, yAxisLabelClassName] = getComponentProps<\n Dict,\n string\n >(\n [rest.yAxisLabelProps ?? {}, labelProperties],\n styles.yAxisLabel,\n )(theme)\n\n const getXAxisProps: ChartPropGetter<\n \"div\",\n Partial<Recharts.XAxisProps>,\n Recharts.XAxisProps\n > = useCallback(\n ({ className, ...props } = {}) => ({\n className: cx(className, xAxisClassName),\n hide: !withXAxis,\n ...xAxisKey,\n tick: {\n transform: \"translate(0, 10)\",\n fill: \"currentColor\",\n },\n stroke: \"\",\n interval: \"preserveStartEnd\",\n tickLine: xTickLine,\n minTickGap: 5,\n tickFormatter: xAxisTickFormatter,\n ...props,\n ...(xAxisProps as Recharts.XAxisProps),\n }),\n [\n xAxisClassName,\n withXAxis,\n xAxisKey,\n xTickLine,\n xAxisTickFormatter,\n xAxisProps,\n ],\n )\n\n const getYAxisProps: ChartPropGetter<\n \"div\",\n Partial<Recharts.YAxisProps>,\n Recharts.YAxisProps\n > = useCallback(\n ({ className, ...props } = {}) => ({\n className: cx(className, yAxisClassName),\n hide: !withYAxis,\n axisLine: false,\n ...yAxisKey,\n tickLine: yTickLine,\n tick: {\n transform: \"translate(-10, 0)\",\n fill: \"currentColor\",\n },\n allowDecimals: true,\n unit: unit,\n tickFormatter: yAxisTickFormatter,\n ...props,\n ...(yAxisProps as Recharts.YAxisProps),\n }),\n [\n yAxisClassName,\n withYAxis,\n yAxisKey,\n yTickLine,\n unit,\n yAxisTickFormatter,\n yAxisProps,\n ],\n )\n\n const getXAxisLabelProps: ChartPropGetter<\n \"div\",\n Partial<Recharts.LabelProps>,\n Recharts.LabelProps\n > = useCallback(\n ({ className, ...props } = {}) => ({\n className: cx(className, xAxisLabelClassName),\n value: xAxisLabel,\n position: \"insideBottom\",\n offset: -20,\n ...props,\n ...xAxisLabelProps,\n }),\n [xAxisLabel, xAxisLabelClassName, xAxisLabelProps],\n )\n\n const getYAxisLabelProps: ChartPropGetter<\n \"div\",\n Partial<Recharts.LabelProps>,\n Recharts.LabelProps\n > = useCallback(\n ({ className, ...props } = {}) => ({\n className: cx(className, yAxisLabelClassName),\n value: yAxisLabel,\n position: \"insideLeft\",\n angle: -90,\n textAnchor: \"middle\",\n offset: -5,\n ...props,\n ...yAxisLabelProps,\n }),\n [yAxisLabel, yAxisLabelClassName, yAxisLabelProps],\n )\n\n return {\n getXAxisProps,\n getYAxisProps,\n getXAxisLabelProps,\n getYAxisLabelProps,\n }\n}\n\nconst valueToPercent = (value: any) => {\n return `${(value * 100).toFixed(0)}%`\n}\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport { useTheme } from \"@yamada-ui/core\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useCallback } from \"react\"\nimport type { CartesianGridProps } from \"recharts\"\nimport { getComponentProps } from \"./chart-utils\"\nimport type { ChartAxisType, ChartPropGetter, GridProps } from \"./chart.types\"\nimport { gridProperties } from \"./rechart-properties\"\n\nexport type UseChartGridOptions = {\n /**\n * Props passed down to recharts 'CartesianGrid' component.\n */\n gridProps?: GridProps\n /**\n * Specifies which lines should be displayed in the grid.\n *\n * @default 'x'\n */\n gridAxis?: ChartAxisType\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 * @default '5 5'\n */\n strokeDasharray?: string | number\n}\n\ntype UseChartGridProps = UseChartGridOptions & {\n styles: Dict<CSSUIObject>\n}\n\nexport const useChartGrid = ({\n gridProps = {},\n gridAxis = \"x\",\n strokeDasharray = \"5 5\",\n styles,\n}: UseChartGridProps) => {\n const { theme } = useTheme()\n const [reChartsProps, propClassName] = getComponentProps(\n [gridProps, gridProperties],\n styles.grid,\n )(theme)\n\n const getGridProps: ChartPropGetter<\n \"div\",\n Partial<CartesianGridProps>,\n CartesianGridProps\n > = useCallback(\n ({ className, ...props } = {}, ref = null) => ({\n ref,\n className: cx(\"ui-chart__grid\", className, propClassName),\n strokeDasharray: strokeDasharray,\n vertical: gridAxis === \"y\" || gridAxis === \"xy\",\n horizontal: gridAxis === \"x\" || gridAxis === \"xy\",\n ...props,\n ...reChartsProps,\n }),\n [propClassName, strokeDasharray, gridAxis, reChartsProps],\n )\n\n return { getGridProps }\n}\n","import type { Dict } from \"@yamada-ui/utils\"\nimport { splitObject } from \"@yamada-ui/utils\"\nimport { useCallback } from \"react\"\nimport type * as Recharts from \"recharts\"\nimport type { ChartPropGetter, LegendProps } from \"./chart.types\"\nimport { legendProperties } from \"./rechart-properties\"\n\nexport type UseChartLegendProps = {\n /**\n * Props passed down to recharts 'Legend' component.\n */\n legendProps?: LegendProps\n}\n\nexport const useChartLegend = ({\n legendProps: _legendProps = {},\n}: UseChartLegendProps) => {\n const [rest, legendProps] = splitObject<Dict, string>(\n _legendProps,\n legendProperties,\n )\n\n const getLegendProps: ChartPropGetter<\n \"div\",\n Partial<Recharts.LegendProps>,\n Omit<Recharts.LegendProps, \"ref\">\n > = useCallback(\n (props, ref = null) => {\n return {\n ref,\n verticalAlign: \"top\",\n ...props,\n ...rest,\n }\n },\n [rest],\n )\n\n return { legendProps, getLegendProps }\n}\n","import { getCSS, useTheme } from \"@yamada-ui/core\"\nimport type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport { isObject, cx } from \"@yamada-ui/utils\"\nimport { useCallback, useMemo } from \"react\"\nimport type * as Recharts from \"recharts\"\nimport { getComponentProps } from \"./chart-utils\"\nimport type { ReferenceLineProps, RequiredChartPropGetter } from \"./chart.types\"\nimport { referenceLineProperties } from \"./rechart-properties\"\n\nexport type UseChartReferenceLineOptions = {\n /**\n * Reference lines that should be displayed on the chart.\n */\n referenceLineProps?: ReferenceLineProps[]\n}\n\ntype UseChartReferenceLineProps = UseChartReferenceLineOptions & {\n styles: Dict<CSSUIObject>\n}\n\nexport const useChartReferenceLine = ({\n referenceLineProps = [],\n styles,\n}: UseChartReferenceLineProps) => {\n const { theme } = useTheme()\n const styleClassName = getCSS(styles.referenceLine)(theme)\n const propList = useMemo(\n () =>\n referenceLineProps.map((props, index) => {\n const [{ label: labelProp, ...rest }, propClassName] =\n getComponentProps(\n [props, referenceLineProperties],\n styleClassName,\n )(theme)\n\n const color = `var(--ui-reference-line-${index})`\n const label: Recharts.ReferenceLineProps[\"label\"] = {\n value: labelProp as string,\n fill: color,\n position: \"insideBottomLeft\",\n ...(isObject(labelProp) ? labelProp : {}),\n }\n\n return { propClassName, color, label, ...rest }\n }),\n [referenceLineProps, styleClassName, theme],\n )\n\n const getReferenceLineProps: RequiredChartPropGetter<\n \"div\",\n {\n index: number\n },\n Omit<Recharts.ReferenceLineProps, \"ref\">\n > = useCallback(\n ({ index, className, ...props }, ref = null) => {\n const { propClassName, color, label, ...rest } = propList[index]\n\n return {\n ref,\n className: cx(className, propClassName),\n stroke: color,\n label,\n ...(props as Recharts.ReferenceLineProps),\n ...rest,\n }\n },\n [propList],\n )\n\n return { getReferenceLineProps }\n}\n","import { useTheme, type CSSUIObject } from \"@yamada-ui/core\"\nimport { splitObject, type Dict, cx } from \"@yamada-ui/utils\"\nimport { useCallback, useMemo } from \"react\"\nimport type * as Recharts from \"recharts\"\nimport { getClassName } from \"./chart-utils\"\nimport type { ChartPropGetter, TooltipProps } from \"./chart.types\"\nimport { tooltipProperties } from \"./rechart-properties\"\n\nexport type UseChartTooltipOptions = {\n /**\n * Props passed down to recharts 'Tooltip' component.\n */\n tooltipProps?: TooltipProps\n /**\n * Specifies the duration of animation, the unit of this option is ms.\n *\n * @default 0\n */\n tooltipAnimationDuration?: number\n /**\n * A function to format values on inside the tooltip.\n */\n valueFormatter?: (value: any) => string\n /**\n * A function to format labels on inside the tooltip.\n */\n labelFormatter?: (label: string) => string\n}\n\ntype UseChartTooltipProps = UseChartTooltipOptions & {\n styles: Dict<CSSUIObject>\n}\n\nexport const useChartTooltip = ({\n tooltipProps: _tooltipProps = {},\n tooltipAnimationDuration = 0,\n styles,\n}: UseChartTooltipProps) => {\n const { theme } = useTheme()\n const { cursor, ...rest } = _tooltipProps\n const cursorClassName = useMemo(\n () => getClassName({ ...styles.cursor, ...cursor })(theme),\n [cursor, styles.cursor, theme],\n )\n\n const [tooltipProps, tooltipUIProps] = splitObject<Dict, string>(\n rest,\n tooltipProperties,\n )\n\n const getTooltipProps: ChartPropGetter<\n \"div\",\n Partial<Recharts.TooltipProps<any, any>>,\n Omit<Recharts.TooltipProps<any, any>, \"ref\">\n > = useCallback(\n (props, ref = null) => ({\n ref,\n animationDuration: tooltipAnimationDuration,\n isAnimationActive: (tooltipAnimationDuration || 0) > 0,\n cursor: {\n className: cx(\"ui-chart__cursor\", cursorClassName),\n },\n ...props,\n ...tooltipProps,\n }),\n [cursorClassName, tooltipAnimationDuration, tooltipProps],\n )\n\n return { tooltipProps: tooltipUIProps, getTooltipProps }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,IAAAA,gBAKO;AACP,IAAAC,iBAAmB;AACnB,IAAAC,gBAAwB;AACxB,IAAAC,mBAUO;;;AClBP,IAAAC,eAA+B;AAC/B,IAAAC,gBAA8B;;;ACF9B,IAAAC,eAA2C;AAE3C,IAAAC,gBAAkC;AAClC,mBAA4B;;;ACF5B,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;;;ACRK,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;AAC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,kBAAC;AAAA;AAAA,oBACE,GAAG,aAAa,EAAE,WAAW,qBAAqB,CAAC;AAAA;AAAA,gBACtD;AAAA,gBAEA,6CAAC,0BAAO,GAAG,cAAc,EAAE,WAAW,uBAAuB,CAAC,GAC5D;AAAA,kBAAC;AAAA;AAAA,oBACE,GAAG,mBAAmB;AAAA,sBACrB,WAAW;AAAA,oBACb,CAAC;AAAA;AAAA,gBACH,GACF;AAAA,gBAEA,6CAAC,0BAAO,GAAG,cAAc,EAAE,WAAW,uBAAuB,CAAC,GAC5D;AAAA,kBAAC;AAAA;AAAA,oBACE,GAAG,mBAAmB;AAAA,sBACrB,WAAW;AAAA,oBACb,CAAC;AAAA;AAAA,gBACH,GACF;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;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":["import_core","import_utils","import_react","import_recharts","import_core","import_utils","import_core","import_utils","import_core","import_utils","import_jsx_runtime","payload","_a","value","import_core","import_utils","import_react","import_jsx_runtime","activeBar","background","dimBar","rest","series","data","index","key","import_core","import_utils","import_react","import_core","import_utils","import_react","import_utils","import_react","import_core","import_utils","import_react","import_core","import_utils","import_react","import_jsx_runtime","ReChartsBarChart"]}
1
+ {"version":3,"sources":["../src/bar-chart.tsx","../src/chart-legend.tsx","../src/use-chart.ts","../src/chart-utils.ts","../src/rechart-properties.ts","../src/chart-tooltip.tsx","../src/use-bar-chart.tsx","../src/use-chart-axis.ts","../src/use-chart-grid.ts","../src/use-chart-legend.ts","../src/use-chart-reference-line.ts","../src/use-chart-tooltip.ts"],"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 Legend,\n BarChart as ReChartsBarChart,\n CartesianGrid,\n Tooltip,\n XAxis,\n YAxis,\n ResponsiveContainer,\n ReferenceLine,\n Label,\n} from \"recharts\"\nimport { ChartLegend } from \"./chart-legend\"\nimport { ChartTooltip } from \"./chart-tooltip\"\nimport { useBarChart } from \"./use-bar-chart\"\nimport type { UseBarChartOptions } from \"./use-bar-chart\"\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 { useChartGrid, type UseChartGridOptions } from \"./use-chart-grid\"\nimport type { UseChartLegendProps } from \"./use-chart-legend\"\nimport { useChartLegend } from \"./use-chart-legend\"\nimport {\n useChartReferenceLine,\n type UseChartReferenceLineOptions,\n} from \"./use-chart-reference-line\"\nimport type { UseChartTooltipOptions } from \"./use-chart-tooltip\"\nimport { useChartTooltip } from \"./use-chart-tooltip\"\n\ntype BarChartOptions = {\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 BarChartProps = HTMLUIProps<\"div\"> &\n ThemeProps<\"BarChart\"> &\n BarChartOptions &\n UseBarChartOptions &\n UseChartProps &\n UseChartAxisOptions &\n UseChartReferenceLineOptions &\n UseChartGridOptions &\n UseChartTooltipOptions &\n UseChartLegendProps\n\n/**\n * `BarChart` is a component for drawing bar charts to compare multiple sets of data.\n *\n * @see Docs https://yamada-ui.com/components/data-display/bar-chart\n */\nexport const BarChart = forwardRef<BarChartProps, \"div\">((props, ref) => {\n const [styles, mergedProps] = useMultiComponentStyle(\"BarChart\", props)\n const {\n className,\n series,\n dataKey,\n layoutType,\n tickLine,\n gridAxis,\n withXAxis,\n withYAxis,\n barProps,\n xAxisProps,\n yAxisProps,\n xAxisLabel,\n yAxisLabel,\n xAxisLabelProps,\n yAxisLabelProps,\n type = \"default\",\n withTooltip = true,\n withLegend = false,\n containerProps,\n unit,\n yAxisTickFormatter,\n xAxisTickFormatter,\n valueFormatter,\n labelFormatter,\n tooltipProps,\n tooltipAnimationDuration,\n legendProps,\n data,\n referenceLineProps = [],\n gridProps,\n strokeDasharray,\n fillOpacity,\n chartProps,\n syncId,\n cell,\n ...rest\n } = omitThemeProps(mergedProps)\n\n const { bars, barVars, getBarChartProps, setHighlightedArea } = useBarChart({\n data,\n series,\n cell,\n type,\n layoutType,\n chartProps,\n barProps,\n referenceLineProps,\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 referenceLinesItems = useMemo(\n () =>\n referenceLineProps.map((_, index) => (\n <ReferenceLine\n key={`referenceLine-${index}`}\n {...getReferenceLineProps({\n index,\n className: \"ui-bar-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-bar-chart\", className)}\n __css={{ maxW: \"full\", vars: barVars, ...styles.container }}\n {...rest}\n >\n <ResponsiveContainer\n {...getContainerProps({ className: \"ui-bar-chart__container\" })}\n >\n <ReChartsBarChart\n {...getBarChartProps({ className: \"ui-bar-chart__chart\" })}\n >\n <CartesianGrid\n {...getGridProps({ className: \"ui-bar-chart__grid\" })}\n />\n\n <XAxis {...getXAxisProps({ className: \"ui-bar-chart__x-axis\" })}>\n <Label\n {...getXAxisLabelProps({\n className: \"ui-bar-chart__x-axis-label\",\n })}\n />\n </XAxis>\n\n <YAxis {...getYAxisProps({ className: \"ui-bar-chart__y-axis\" })}>\n <Label\n {...getYAxisLabelProps({\n className: \"ui-bar-chart__y-axis-label\",\n })}\n />\n </YAxis>\n\n {withLegend ? (\n <Legend\n content={({ payload }) => (\n <ChartLegend\n className=\"ui-bar-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-bar-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 {bars}\n {referenceLinesItems}\n </ReChartsBarChart>\n </ResponsiveContainer>\n </ui.div>\n </ChartProvider>\n )\n})\n","import type { HTMLUIProps } from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx, type Dict } from \"@yamada-ui/utils\"\nimport { useLegend } from \"./use-chart\"\n\ntype ChartLegendOptions = {\n payload?: Dict[]\n onHighlight: (area: string | null) => void\n}\n\nexport type ChartLegendProps = HTMLUIProps<\"div\"> & ChartLegendOptions\n\nexport const ChartLegend = forwardRef<ChartLegendProps, \"div\">(\n ({ className, payload = [], onHighlight, ...rest }, ref) => {\n const { styles } = useLegend()\n\n const items = payload.map(({ dataKey, value: valueProp, color }, index) => {\n const value = dataKey ?? valueProp\n\n return (\n <ui.div\n className=\"ui-chart__legend-item\"\n key={`legend-${index}`}\n onMouseEnter={() => onHighlight(value)}\n onMouseLeave={() => onHighlight(null)}\n __css={styles.legendItem}\n >\n <ui.div\n className=\"ui-chart__legend-swatch\"\n background={color}\n __css={styles.legendSwatch}\n />\n\n <ui.span className=\"ui-chart__legend-label\">{value}</ui.span>\n </ui.div>\n )\n })\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-chart__legend\", className)}\n __css={styles.legend}\n {...rest}\n >\n {items}\n </ui.div>\n )\n },\n)\n","import { useTheme, type CSSUIObject } from \"@yamada-ui/core\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport { createContext, cx } from \"@yamada-ui/utils\"\nimport { useCallback } from \"react\"\nimport type * as Recharts from \"recharts\"\nimport { getComponentProps } from \"./chart-utils\"\nimport type { ChartPropGetter, ResponsiveContainerProps } from \"./chart.types\"\nimport { containerProperties } from \"./rechart-properties\"\n\ntype ChartContext = { styles: Record<string, CSSUIObject> }\n\nexport const [ChartProvider, useChartContext] = createContext<ChartContext>({\n name: \"ChartContext\",\n errorMessage: `useChartContext returned is 'undefined'. Seems you forgot to wrap the components in \"<LineChart />\" or \"<BarChart />\" etc.`,\n})\n\nexport type UseChartProps = {\n /**\n * Props passed down to recharts `ResponsiveContainer` component.\n */\n containerProps?: ResponsiveContainerProps\n}\n\nexport const useChart = ({ containerProps = {} }: UseChartProps) => {\n const { theme } = useTheme()\n const [reChartsProps, propClassName] = getComponentProps<Dict, string>([\n containerProps,\n containerProperties,\n ])(theme)\n\n const getContainerProps: ChartPropGetter<\n \"div\",\n Partial<Omit<Recharts.ResponsiveContainerProps, \"children\">>,\n Omit<Recharts.ResponsiveContainerProps, \"children\">\n > = useCallback(\n ({ className, ...props } = {}, ref = null) => ({\n ref,\n className: cx(\"ui-chart__container\", className as string, propClassName),\n ...props,\n ...reChartsProps,\n }),\n [propClassName, reChartsProps],\n )\n\n return {\n getContainerProps,\n }\n}\n\nexport type UseChartReturn = ReturnType<typeof useChart>\n\nexport type UseLegendProps = {}\n\nexport const useLegend = ({}: UseLegendProps = {}) => {\n const { styles } = useChartContext()\n return {\n styles,\n }\n}\nexport type UseLegendReturn = ReturnType<typeof useLegend>\n\nexport type UseTooltipProps = {}\n\nexport const useTooltip = ({}: UseTooltipProps = {}) => {\n const { styles } = useChartContext()\n return {\n styles,\n }\n}\nexport type UseTooltipReturn = ReturnType<typeof useTooltip>\n","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","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","import { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx, isArray, type Dict } from \"@yamada-ui/utils\"\nimport { useTooltip } from \"./use-chart\"\n\nexport type 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","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","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport { useTheme } from \"@yamada-ui/core\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport { cx } from \"@yamada-ui/utils\"\nimport type { SVGProps } from \"react\"\nimport { useCallback, useMemo } from \"react\"\nimport type * as Recharts from \"recharts\"\nimport { getComponentProps } from \"./chart-utils\"\nimport type {\n ChartAxisType,\n ChartLayoutType,\n XAxisProps,\n YAxisProps,\n ChartPropGetter,\n AreaChartType,\n LabelProps,\n} from \"./chart.types\"\nimport {\n labelProperties,\n xAxisProperties,\n yAxisProperties,\n} from \"./rechart-properties\"\n\nexport type UseChartAxisOptions = {\n /**\n * The key of a group of data which should be unique in an chart.\n */\n dataKey: string\n /**\n * Controls how chart areas are positioned relative to each other\n *\n * @default `default`\n */\n type?: AreaChartType\n /**\n * Chart orientation.\n *\n * @default 'horizontal'\n */\n layoutType?: ChartLayoutType\n /**\n * The option is the configuration of tick lines.\n *\n * @default 'y'\n */\n tickLine?: ChartAxisType\n /**\n * Specifies which lines should be displayed in the grid.\n *\n * @default 'x'\n */\n gridAxis?: ChartAxisType\n /**\n * If `true`, X axis is visible.\n *\n * @default true\n */\n withXAxis?: boolean\n /**\n * If `true`, Y axis is visible.\n *\n * @default true\n */\n withYAxis?: boolean\n /**\n * Props passed down to recharts 'XAxis' component.\n */\n xAxisProps?: XAxisProps\n /**\n * Props passed down to recharts 'YAxis' component.\n */\n yAxisProps?: YAxisProps\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 'XAxisLabel' component.\n */\n xAxisLabelProps?: LabelProps\n /**\n * Props passed down to recharts 'YAxisLabel' component.\n */\n yAxisLabelProps?: LabelProps\n /**\n * Unit displayed next to each tick in y-axis.\n */\n unit?: string\n /**\n * A function to format Y axis tick.\n */\n yAxisTickFormatter?: (value: any) => string\n /**\n * A function to format X axis tick.\n */\n xAxisTickFormatter?: (value: any) => string\n}\n\nexport type UseChartAxisProps = UseChartAxisOptions & {\n styles: Dict<CSSUIObject>\n}\n\nexport const useChartAxis = ({\n dataKey,\n type,\n layoutType = \"horizontal\",\n tickLine = \"y\",\n gridAxis = \"x\",\n withXAxis = true,\n withYAxis = true,\n xAxisLabel: xAxisLabelProp,\n yAxisLabel: yAxisLabelProp,\n unit,\n yAxisTickFormatter = type === \"percent\" && layoutType === \"horizontal\"\n ? valueToPercent\n : undefined,\n xAxisTickFormatter = type === \"percent\" && layoutType === \"vertical\"\n ? valueToPercent\n : undefined,\n styles,\n ...rest\n}: UseChartAxisProps) => {\n const { theme } = useTheme()\n const xAxisKey: Recharts.XAxisProps = useMemo(\n () => (layoutType === \"vertical\" ? { type: \"number\" } : { dataKey }),\n [dataKey, layoutType],\n )\n\n const yAxisKey: Recharts.YAxisProps = useMemo(\n () =>\n layoutType === \"vertical\"\n ? { dataKey, type: \"category\" }\n : { type: \"number\" },\n [dataKey, layoutType],\n )\n const withXTickLine =\n gridAxis !== \"none\" && (tickLine === \"x\" || tickLine === \"xy\")\n const withYTickLine =\n gridAxis !== \"none\" && (tickLine === \"y\" || tickLine === \"xy\")\n const getTickLine = (\n withTickLine: boolean,\n ): boolean | SVGProps<SVGTextElement> =>\n withTickLine ? { stroke: \"currentColor\" } : false\n const xTickLine = getTickLine(withXTickLine)\n const yTickLine = getTickLine(withYTickLine)\n\n const xAxisLabel = layoutType === \"vertical\" ? yAxisLabelProp : xAxisLabelProp\n const yAxisLabel = layoutType === \"vertical\" ? xAxisLabelProp : yAxisLabelProp\n\n const [xAxisProps, xAxisClassName] = getComponentProps<Dict, string>(\n [rest.xAxisProps ?? {}, xAxisProperties],\n styles.xAxis,\n )(theme)\n\n const [yAxisProps, yAxisClassName] = getComponentProps<Dict, string>(\n [rest.yAxisProps ?? {}, yAxisProperties],\n styles.yAxis,\n )(theme)\n\n const [xAxisLabelProps, xAxisLabelClassName] = getComponentProps<\n Dict,\n string\n >(\n [rest.xAxisLabelProps ?? {}, labelProperties],\n styles.xAxisLabel,\n )(theme)\n\n const [yAxisLabelProps, yAxisLabelClassName] = getComponentProps<\n Dict,\n string\n >(\n [rest.yAxisLabelProps ?? {}, labelProperties],\n styles.yAxisLabel,\n )(theme)\n\n const getXAxisProps: ChartPropGetter<\n \"div\",\n Partial<Recharts.XAxisProps>,\n Recharts.XAxisProps\n > = useCallback(\n ({ className, ...props } = {}) => ({\n className: cx(className, xAxisClassName),\n hide: !withXAxis,\n ...xAxisKey,\n tick: {\n transform: \"translate(0, 10)\",\n fill: \"currentColor\",\n },\n stroke: \"\",\n interval: \"preserveStartEnd\",\n tickLine: xTickLine,\n minTickGap: 5,\n tickFormatter: xAxisTickFormatter,\n ...props,\n ...(xAxisProps as Recharts.XAxisProps),\n }),\n [\n xAxisClassName,\n withXAxis,\n xAxisKey,\n xTickLine,\n xAxisTickFormatter,\n xAxisProps,\n ],\n )\n\n const getYAxisProps: ChartPropGetter<\n \"div\",\n Partial<Recharts.YAxisProps>,\n Recharts.YAxisProps\n > = useCallback(\n ({ className, ...props } = {}) => ({\n className: cx(className, yAxisClassName),\n hide: !withYAxis,\n axisLine: false,\n ...yAxisKey,\n tickLine: yTickLine,\n tick: {\n transform: \"translate(-10, 0)\",\n fill: \"currentColor\",\n },\n allowDecimals: true,\n unit: unit,\n tickFormatter: yAxisTickFormatter,\n ...props,\n ...(yAxisProps as Recharts.YAxisProps),\n }),\n [\n yAxisClassName,\n withYAxis,\n yAxisKey,\n yTickLine,\n unit,\n yAxisTickFormatter,\n yAxisProps,\n ],\n )\n\n const getXAxisLabelProps: ChartPropGetter<\n \"div\",\n Partial<Recharts.LabelProps>,\n Recharts.LabelProps\n > = useCallback(\n ({ className, ...props } = {}) => ({\n className: cx(className, xAxisLabelClassName),\n value: xAxisLabel,\n position: \"insideBottom\",\n offset: -20,\n ...props,\n ...xAxisLabelProps,\n }),\n [xAxisLabel, xAxisLabelClassName, xAxisLabelProps],\n )\n\n const getYAxisLabelProps: ChartPropGetter<\n \"div\",\n Partial<Recharts.LabelProps>,\n Recharts.LabelProps\n > = useCallback(\n ({ className, ...props } = {}) => ({\n className: cx(className, yAxisLabelClassName),\n value: yAxisLabel,\n position: \"insideLeft\",\n angle: -90,\n textAnchor: \"middle\",\n offset: -5,\n ...props,\n ...yAxisLabelProps,\n }),\n [yAxisLabel, yAxisLabelClassName, yAxisLabelProps],\n )\n\n return {\n getXAxisProps,\n getYAxisProps,\n getXAxisLabelProps,\n getYAxisLabelProps,\n }\n}\n\nconst valueToPercent = (value: any) => {\n return `${(value * 100).toFixed(0)}%`\n}\n","import type { CSSUIObject } from \"@yamada-ui/core\"\nimport { useTheme } from \"@yamada-ui/core\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useCallback } from \"react\"\nimport type { CartesianGridProps } from \"recharts\"\nimport { getComponentProps } from \"./chart-utils\"\nimport type { ChartAxisType, ChartPropGetter, GridProps } from \"./chart.types\"\nimport { gridProperties } from \"./rechart-properties\"\n\nexport type UseChartGridOptions = {\n /**\n * Props passed down to recharts 'CartesianGrid' component.\n */\n gridProps?: GridProps\n /**\n * Specifies which lines should be displayed in the grid.\n *\n * @default 'x'\n */\n gridAxis?: ChartAxisType\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 * @default '5 5'\n */\n strokeDasharray?: string | number\n}\n\ntype UseChartGridProps = UseChartGridOptions & {\n styles: Dict<CSSUIObject>\n}\n\nexport const useChartGrid = ({\n gridProps = {},\n gridAxis = \"x\",\n strokeDasharray = \"5 5\",\n styles,\n}: UseChartGridProps) => {\n const { theme } = useTheme()\n const [reChartsProps, propClassName] = getComponentProps(\n [gridProps, gridProperties],\n styles.grid,\n )(theme)\n\n const getGridProps: ChartPropGetter<\n \"div\",\n Partial<CartesianGridProps>,\n CartesianGridProps\n > = useCallback(\n ({ className, ...props } = {}, ref = null) => ({\n ref,\n className: cx(\"ui-chart__grid\", className, propClassName),\n strokeDasharray: strokeDasharray,\n vertical: gridAxis === \"y\" || gridAxis === \"xy\",\n horizontal: gridAxis === \"x\" || gridAxis === \"xy\",\n ...props,\n ...reChartsProps,\n }),\n [propClassName, strokeDasharray, gridAxis, reChartsProps],\n )\n\n return { getGridProps }\n}\n","import type { Dict } from \"@yamada-ui/utils\"\nimport { splitObject } from \"@yamada-ui/utils\"\nimport { useCallback } from \"react\"\nimport type * as Recharts from \"recharts\"\nimport type { ChartPropGetter, LegendProps } from \"./chart.types\"\nimport { legendProperties } from \"./rechart-properties\"\n\nexport type UseChartLegendProps = {\n /**\n * Props passed down to recharts 'Legend' component.\n */\n legendProps?: LegendProps\n}\n\nexport const useChartLegend = ({\n legendProps: _legendProps = {},\n}: UseChartLegendProps) => {\n const [rest, legendProps] = splitObject<Dict, string>(\n _legendProps,\n legendProperties,\n )\n\n const getLegendProps: ChartPropGetter<\n \"div\",\n Partial<Recharts.LegendProps>,\n Omit<Recharts.LegendProps, \"ref\">\n > = useCallback(\n (props, ref = null) => {\n return {\n ref,\n verticalAlign: \"top\",\n ...props,\n ...rest,\n }\n },\n [rest],\n )\n\n return { legendProps, getLegendProps }\n}\n","import { getCSS, getVar, useTheme } from \"@yamada-ui/core\"\nimport type { CSSUIObject } from \"@yamada-ui/core\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport { isObject, cx } from \"@yamada-ui/utils\"\nimport { useCallback, useMemo } from \"react\"\nimport type * as Recharts from \"recharts\"\nimport { getComponentProps } from \"./chart-utils\"\nimport type { ReferenceLineProps, RequiredChartPropGetter } from \"./chart.types\"\nimport { referenceLineProperties } from \"./rechart-properties\"\n\nexport type UseChartReferenceLineOptions = {\n /**\n * Reference lines that should be displayed on the chart.\n */\n referenceLineProps?: ReferenceLineProps[]\n}\n\ntype UseChartReferenceLineProps = UseChartReferenceLineOptions & {\n styles: Dict<CSSUIObject>\n}\n\nexport const useChartReferenceLine = ({\n referenceLineProps = [],\n styles,\n}: UseChartReferenceLineProps) => {\n const { theme } = useTheme()\n const styleClassName = getCSS(styles.referenceLine)(theme)\n const propList = useMemo(\n () =>\n referenceLineProps.map((props, index) => {\n const [{ label: labelProp, ...rest }, propClassName] =\n getComponentProps(\n [props, referenceLineProperties],\n styleClassName,\n )(theme)\n\n const color = getVar(`reference-line-${index}`)(theme)\n const label: Recharts.ReferenceLineProps[\"label\"] = {\n value: labelProp as string,\n fill: color,\n position: \"insideBottomLeft\",\n ...(isObject(labelProp) ? labelProp : {}),\n }\n\n return { propClassName, color, label, ...rest }\n }),\n [referenceLineProps, styleClassName, theme],\n )\n\n const getReferenceLineProps: RequiredChartPropGetter<\n \"div\",\n {\n index: number\n },\n Omit<Recharts.ReferenceLineProps, \"ref\">\n > = useCallback(\n ({ index, className, ...props }, ref = null) => {\n const { propClassName, color, label, ...rest } = propList[index]\n\n return {\n ref,\n className: cx(className, propClassName),\n stroke: color,\n label,\n ...(props as Recharts.ReferenceLineProps),\n ...rest,\n }\n },\n [propList],\n )\n\n return { getReferenceLineProps }\n}\n","import { useTheme, type CSSUIObject } from \"@yamada-ui/core\"\nimport { splitObject, type Dict, cx } from \"@yamada-ui/utils\"\nimport { useCallback, useMemo } from \"react\"\nimport type * as Recharts from \"recharts\"\nimport { getClassName } from \"./chart-utils\"\nimport type { ChartPropGetter, TooltipProps } from \"./chart.types\"\nimport { tooltipProperties } from \"./rechart-properties\"\n\nexport type UseChartTooltipOptions = {\n /**\n * Props passed down to recharts 'Tooltip' component.\n */\n tooltipProps?: TooltipProps\n /**\n * Specifies the duration of animation, the unit of this option is ms.\n *\n * @default 0\n */\n tooltipAnimationDuration?: number\n /**\n * A function to format values on inside the tooltip.\n */\n valueFormatter?: (value: any) => string\n /**\n * A function to format labels on inside the tooltip.\n */\n labelFormatter?: (label: string) => string\n}\n\ntype UseChartTooltipProps = UseChartTooltipOptions & {\n styles: Dict<CSSUIObject>\n}\n\nexport const useChartTooltip = ({\n tooltipProps: _tooltipProps = {},\n tooltipAnimationDuration = 0,\n styles,\n}: UseChartTooltipProps) => {\n const { theme } = useTheme()\n const { cursor, ...rest } = _tooltipProps\n const cursorClassName = useMemo(\n () => getClassName({ ...styles.cursor, ...cursor })(theme),\n [cursor, styles.cursor, theme],\n )\n\n const [tooltipProps, tooltipUIProps] = splitObject<Dict, string>(\n rest,\n tooltipProperties,\n )\n\n const getTooltipProps: ChartPropGetter<\n \"div\",\n Partial<Recharts.TooltipProps<any, any>>,\n Omit<Recharts.TooltipProps<any, any>, \"ref\">\n > = useCallback(\n (props, ref = null) => ({\n ref,\n animationDuration: tooltipAnimationDuration,\n isAnimationActive: (tooltipAnimationDuration || 0) > 0,\n cursor: {\n className: cx(\"ui-chart__cursor\", cursorClassName),\n },\n ...props,\n ...tooltipProps,\n }),\n [cursorClassName, tooltipAnimationDuration, tooltipProps],\n )\n\n return { tooltipProps: tooltipUIProps, getTooltipProps }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,IAAAA,gBAKO;AACP,IAAAC,iBAAmB;AACnB,IAAAC,gBAAwB;AACxB,IAAAC,mBAUO;;;AClBP,IAAAC,eAA+B;AAC/B,IAAAC,gBAA8B;;;ACF9B,IAAAC,eAA2C;AAE3C,IAAAC,gBAAkC;AAClC,mBAA4B;;;ACF5B,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;;;ACPK,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;AA4DO,IAAM,0BAAiE;AAAA,EAC5E;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;AACF;AAEO,IAAM,iBAAwD;AAAA,EACnE;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,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;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,EAC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iBAAAC;AAAA,YAAA;AAAA,cACE,GAAG,iBAAiB,EAAE,WAAW,sBAAsB,CAAC;AAAA,cAEzD;AAAA;AAAA,kBAAC;AAAA;AAAA,oBACE,GAAG,aAAa,EAAE,WAAW,qBAAqB,CAAC;AAAA;AAAA,gBACtD;AAAA,gBAEA,6CAAC,0BAAO,GAAG,cAAc,EAAE,WAAW,uBAAuB,CAAC,GAC5D;AAAA,kBAAC;AAAA;AAAA,oBACE,GAAG,mBAAmB;AAAA,sBACrB,WAAW;AAAA,oBACb,CAAC;AAAA;AAAA,gBACH,GACF;AAAA,gBAEA,6CAAC,0BAAO,GAAG,cAAc,EAAE,WAAW,uBAAuB,CAAC,GAC5D;AAAA,kBAAC;AAAA;AAAA,oBACE,GAAG,mBAAmB;AAAA,sBACrB,WAAW;AAAA,oBACb,CAAC;AAAA;AAAA,gBACH,GACF;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;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":["import_core","import_utils","import_react","import_recharts","import_core","import_utils","import_core","import_utils","import_core","import_utils","import_jsx_runtime","payload","_a","value","import_core","import_utils","import_react","import_jsx_runtime","activeBar","background","dimBar","rest","series","data","index","key","import_core","import_utils","import_react","import_core","import_utils","import_react","import_utils","import_react","import_core","import_utils","import_react","import_core","import_utils","import_react","import_jsx_runtime","ReChartsBarChart"]}
@@ -1,17 +1,17 @@
1
1
  "use client"
2
2
  import {
3
3
  BarChart
4
- } from "./chunk-AODYT4HF.mjs";
5
- import "./chunk-S5NKKKV5.mjs";
6
- import "./chunk-VK4VQQYY.mjs";
7
- import "./chunk-D7EZKGCJ.mjs";
8
- import "./chunk-Q7CCSKX3.mjs";
9
- import "./chunk-5Q6O726L.mjs";
10
- import "./chunk-AOGTJ4EN.mjs";
11
- import "./chunk-DGOXJ373.mjs";
12
- import "./chunk-MT5JI4OR.mjs";
13
- import "./chunk-STBYN5JW.mjs";
14
- import "./chunk-F34FV5DY.mjs";
4
+ } from "./chunk-RKO6KM3T.mjs";
5
+ import "./chunk-5PSRSNGH.mjs";
6
+ import "./chunk-YNJ423BR.mjs";
7
+ import "./chunk-PPBHLDVN.mjs";
8
+ import "./chunk-JTQ5QCML.mjs";
9
+ import "./chunk-VMBRDEM2.mjs";
10
+ import "./chunk-TCSYDMC7.mjs";
11
+ import "./chunk-EL2VTGFB.mjs";
12
+ import "./chunk-T5DNDBW6.mjs";
13
+ import "./chunk-3AOICU4Q.mjs";
14
+ import "./chunk-6YUJLLGN.mjs";
15
15
  import "./chunk-QL3DB7OJ.mjs";
16
16
  export {
17
17
  BarChart
@@ -1,9 +1,9 @@
1
1
  "use client"
2
2
  import {
3
3
  ChartLegend
4
- } from "./chunk-DGOXJ373.mjs";
5
- import "./chunk-STBYN5JW.mjs";
6
- import "./chunk-F34FV5DY.mjs";
4
+ } from "./chunk-EL2VTGFB.mjs";
5
+ import "./chunk-3AOICU4Q.mjs";
6
+ import "./chunk-6YUJLLGN.mjs";
7
7
  import "./chunk-QL3DB7OJ.mjs";
8
8
  export {
9
9
  ChartLegend
@@ -2,11 +2,13 @@ import * as _yamada_ui_core from '@yamada-ui/core';
2
2
  import { Dict } from '@yamada-ui/utils';
3
3
 
4
4
  type ChartTooltipProps = {
5
- label: string | undefined;
5
+ label?: string;
6
+ dataKey?: string;
6
7
  payload: Dict[] | undefined;
7
8
  valueFormatter?: (value: any) => string;
8
9
  labelFormatter?: (label: string) => string;
9
10
  unit?: string;
11
+ isRadialChart?: boolean;
10
12
  };
11
13
  declare const ChartTooltip: _yamada_ui_core.Component<"div", ChartTooltipProps>;
12
14
 
@@ -2,11 +2,13 @@ import * as _yamada_ui_core from '@yamada-ui/core';
2
2
  import { Dict } from '@yamada-ui/utils';
3
3
 
4
4
  type ChartTooltipProps = {
5
- label: string | undefined;
5
+ label?: string;
6
+ dataKey?: string;
6
7
  payload: Dict[] | undefined;
7
8
  valueFormatter?: (value: any) => string;
8
9
  labelFormatter?: (label: string) => string;
9
10
  unit?: string;
11
+ isRadialChart?: boolean;
10
12
  };
11
13
  declare const ChartTooltip: _yamada_ui_core.Component<"div", ChartTooltipProps>;
12
14
 
@@ -47,18 +47,26 @@ var import_jsx_runtime = require("react/jsx-runtime");
47
47
  var ChartTooltip = (0, import_core2.forwardRef)(
48
48
  ({
49
49
  label,
50
+ dataKey = "value",
50
51
  className,
51
52
  payload = [],
52
53
  valueFormatter,
53
54
  labelFormatter,
54
55
  unit,
56
+ isRadialChart,
55
57
  ...rest
56
58
  }, ref) => {
57
59
  var _a;
58
60
  const { styles } = useTooltip();
59
61
  const items = payload.map(
60
- ({ color: colorProp, name, value: valueProp, payload: payload2 } = {}, index) => {
62
+ ({
63
+ color: colorProp,
64
+ name: nameProp,
65
+ [dataKey]: valueProp,
66
+ payload: payload2
67
+ } = {}, index) => {
61
68
  var _a2;
69
+ const name = isRadialChart ? payload2 == null ? void 0 : payload2.name : nameProp;
62
70
  const color = colorProp != null ? colorProp : payload2 == null ? void 0 : payload2.color;
63
71
  let value;
64
72
  if ((0, import_utils2.isArray)(valueProp)) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/chart-tooltip.tsx","../src/use-chart.ts"],"sourcesContent":["import { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx, isArray, type Dict } from \"@yamada-ui/utils\"\nimport { useTooltip } from \"./use-chart\"\n\nexport type ChartTooltipProps = {\n label: string | undefined\n payload: Dict[] | undefined\n valueFormatter?: (value: any) => string\n labelFormatter?: (label: string) => string\n unit?: string\n}\n\nexport const ChartTooltip = forwardRef<ChartTooltipProps, \"div\">(\n (\n {\n label,\n className,\n payload = [],\n valueFormatter,\n labelFormatter,\n unit,\n ...rest\n },\n ref,\n ) => {\n const { styles } = useTooltip()\n\n const items = payload.map(\n ({ color: colorProp, name, value: valueProp, payload } = {}, index) => {\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","import { useTheme, type CSSUIObject } from \"@yamada-ui/core\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport { createContext, cx } from \"@yamada-ui/utils\"\nimport { useCallback } from \"react\"\nimport type * as Recharts from \"recharts\"\nimport { getComponentProps } from \"./chart-utils\"\nimport type { ChartPropGetter, ResponsiveContainerProps } from \"./chart.types\"\nimport { containerProperties } from \"./rechart-properties\"\n\ntype ChartContext = { styles: Record<string, CSSUIObject> }\n\nexport const [ChartProvider, useChartContext] = createContext<ChartContext>({\n name: \"ChartContext\",\n errorMessage: `useChartContext returned is 'undefined'. Seems you forgot to wrap the components in \"<LineChart />\" or \"<BarChart />\" etc.`,\n})\n\nexport type UseChartProps = {\n /**\n * Props passed down to recharts `ResponsiveContainer` component.\n */\n containerProps?: ResponsiveContainerProps\n}\n\nexport const useChart = ({ containerProps = {} }: UseChartProps) => {\n const { theme } = useTheme()\n const [reChartsProps, propClassName] = getComponentProps<Dict, string>([\n containerProps,\n containerProperties,\n ])(theme)\n\n const getContainerProps: ChartPropGetter<\n \"div\",\n Partial<Omit<Recharts.ResponsiveContainerProps, \"children\">>,\n Omit<Recharts.ResponsiveContainerProps, \"children\">\n > = useCallback(\n ({ className, ...props } = {}, ref = null) => ({\n ref,\n className: cx(\"ui-chart__container\", className as string, propClassName),\n ...props,\n ...reChartsProps,\n }),\n [propClassName, reChartsProps],\n )\n\n return {\n getContainerProps,\n }\n}\n\nexport type UseChartReturn = ReturnType<typeof useChart>\n\nexport type UseLegendProps = {}\n\nexport const useLegend = ({}: UseLegendProps = {}) => {\n const { styles } = useChartContext()\n return {\n styles,\n }\n}\nexport type UseLegendReturn = ReturnType<typeof useLegend>\n\nexport type UseTooltipProps = {}\n\nexport const useTooltip = ({}: UseTooltipProps = {}) => {\n const { styles } = useChartContext()\n return {\n styles,\n }\n}\nexport type UseTooltipReturn = ReturnType<typeof useTooltip>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,eAA+B;AAC/B,IAAAC,gBAAuC;;;ACDvC,kBAA2C;AAE3C,mB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AAA;AAAA,cACH;AAAA,cAEA;AAAA,gBAAC,gBAAG;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,gBAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,eAAW,kBAAG,qBAAqB,SAAS;AAAA,QAC5C,OAAO,OAAO;AAAA,QACb,GAAG;AAAA,QAEH;AAAA,kBACC,4CAAC,gBAAG,GAAH,EAAK,WAAU,2BAA0B,OAAO,OAAO,cACrD,iEAAiB,WAAjB,YAA2B,OAC9B,IACE;AAAA,UAEJ,4CAAC,gBAAG,KAAH,EAAO,WAAU,0BAAyB,OAAO,OAAO,aACtD,iBACH;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;","names":["import_core","import_utils","payload","_a","value"]}
1
+ {"version":3,"sources":["../src/chart-tooltip.tsx","../src/use-chart.ts"],"sourcesContent":["import { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx, isArray, type Dict } from \"@yamada-ui/utils\"\nimport { useTooltip } from \"./use-chart\"\n\nexport type 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","import { useTheme, type CSSUIObject } from \"@yamada-ui/core\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport { createContext, cx } from \"@yamada-ui/utils\"\nimport { useCallback } from \"react\"\nimport type * as Recharts from \"recharts\"\nimport { getComponentProps } from \"./chart-utils\"\nimport type { ChartPropGetter, ResponsiveContainerProps } from \"./chart.types\"\nimport { containerProperties } from \"./rechart-properties\"\n\ntype ChartContext = { styles: Record<string, CSSUIObject> }\n\nexport const [ChartProvider, useChartContext] = createContext<ChartContext>({\n name: \"ChartContext\",\n errorMessage: `useChartContext returned is 'undefined'. Seems you forgot to wrap the components in \"<LineChart />\" or \"<BarChart />\" etc.`,\n})\n\nexport type UseChartProps = {\n /**\n * Props passed down to recharts `ResponsiveContainer` component.\n */\n containerProps?: ResponsiveContainerProps\n}\n\nexport const useChart = ({ containerProps = {} }: UseChartProps) => {\n const { theme } = useTheme()\n const [reChartsProps, propClassName] = getComponentProps<Dict, string>([\n containerProps,\n containerProperties,\n ])(theme)\n\n const getContainerProps: ChartPropGetter<\n \"div\",\n Partial<Omit<Recharts.ResponsiveContainerProps, \"children\">>,\n Omit<Recharts.ResponsiveContainerProps, \"children\">\n > = useCallback(\n ({ className, ...props } = {}, ref = null) => ({\n ref,\n className: cx(\"ui-chart__container\", className as string, propClassName),\n ...props,\n ...reChartsProps,\n }),\n [propClassName, reChartsProps],\n )\n\n return {\n getContainerProps,\n }\n}\n\nexport type UseChartReturn = ReturnType<typeof useChart>\n\nexport type UseLegendProps = {}\n\nexport const useLegend = ({}: UseLegendProps = {}) => {\n const { styles } = useChartContext()\n return {\n styles,\n }\n}\nexport type UseLegendReturn = ReturnType<typeof useLegend>\n\nexport type UseTooltipProps = {}\n\nexport const useTooltip = ({}: UseTooltipProps = {}) => {\n const { styles } = useChartContext()\n return {\n styles,\n }\n}\nexport type UseTooltipReturn = ReturnType<typeof useTooltip>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,eAA+B;AAC/B,IAAAC,gBAAuC;;;ACDvC,kBAA2C;AAE3C,mBAAkC;AAClC,mBAA4B;AAQrB,IAAM,CAAC,eAAe,eAAe,QAAI,4BAA4B;AAAA,EAC1E,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAiDM,IAAM,aAAa,CAAC,CAAC,IAAqB,CAAC,MAAM;AACtD,QAAM,EAAE,OAAO,IAAI,gBAAgB;AACnC,SAAO;AAAA,IACL;AAAA,EACF;AACF;;;ADPY;AA/CL,IAAM,mBAAe;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;AA5BP;AA6B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AqB,SAAS;AAAA,QAC5C,OAAO,OAAO;AAAA,QACb,GAAG;AAAA,QAEH;AAAA,kBACC,4CAAC,gBAAG,GAAH,EAAK,WAAU,2BAA0B,OAAO,OAAO,cACrD,iEAAiB,WAAjB,YAA2B,OAC9B,IACE;AAAA,UAEJ,4CAAC,gBAAG,KAAH,EAAO,WAAU,0BAAyB,OAAO,OAAO,aACtD,iBACH;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;","names":["import_core","import_utils","payload","_a","value"]}
@@ -1,9 +1,9 @@
1
1
  "use client"
2
2
  import {
3
3
  ChartTooltip
4
- } from "./chunk-MT5JI4OR.mjs";
5
- import "./chunk-STBYN5JW.mjs";
6
- import "./chunk-F34FV5DY.mjs";
4
+ } from "./chunk-T5DNDBW6.mjs";
5
+ import "./chunk-3AOICU4Q.mjs";
6
+ import "./chunk-6YUJLLGN.mjs";
7
7
  import "./chunk-QL3DB7OJ.mjs";
8
8
  export {
9
9
  ChartTooltip
@@ -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.mjs';
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 };