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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/dist/area-chart-gradient.d.mts +4 -4
  2. package/dist/area-chart-gradient.d.ts +4 -4
  3. package/dist/area-chart-gradient.js.map +1 -1
  4. package/dist/area-chart-gradient.mjs +1 -1
  5. package/dist/area-chart-split.d.mts +4 -4
  6. package/dist/area-chart-split.d.ts +4 -4
  7. package/dist/area-chart-split.js.map +1 -1
  8. package/dist/area-chart-split.mjs +1 -1
  9. package/dist/area-chart.d.mts +4 -4
  10. package/dist/area-chart.d.ts +4 -4
  11. package/dist/area-chart.js +1 -1
  12. package/dist/area-chart.js.map +1 -1
  13. package/dist/area-chart.mjs +12 -12
  14. package/dist/bar-chart.d.mts +3 -3
  15. package/dist/bar-chart.d.ts +3 -3
  16. package/dist/bar-chart.js +1 -1
  17. package/dist/bar-chart.js.map +1 -1
  18. package/dist/bar-chart.mjs +10 -10
  19. package/dist/chart-legend.d.mts +4 -3
  20. package/dist/chart-legend.d.ts +4 -3
  21. package/dist/chart-legend.js.map +1 -1
  22. package/dist/chart-legend.mjs +2 -2
  23. package/dist/chart-tooltip.d.mts +2 -2
  24. package/dist/chart-tooltip.d.ts +2 -2
  25. package/dist/chart-tooltip.js.map +1 -1
  26. package/dist/chart-tooltip.mjs +2 -2
  27. package/dist/chart.types.d.mts +64 -46
  28. package/dist/chart.types.d.ts +64 -46
  29. package/dist/chart.types.js.map +1 -1
  30. package/dist/{chunk-PPBHLDVN.mjs → chunk-2GQHI23M.mjs} +1 -1
  31. package/dist/chunk-2GQHI23M.mjs.map +1 -0
  32. package/dist/{chunk-YNJ423BR.mjs → chunk-3EHZJFIA.mjs} +1 -1
  33. package/dist/chunk-3EHZJFIA.mjs.map +1 -0
  34. package/dist/{chunk-FPFCMFCJ.mjs → chunk-4TQ4VOYH.mjs} +2 -3
  35. package/dist/chunk-4TQ4VOYH.mjs.map +1 -0
  36. package/dist/{chunk-BYL7HWNN.mjs → chunk-5A6462N5.mjs} +12 -12
  37. package/dist/chunk-5A6462N5.mjs.map +1 -0
  38. package/dist/{chunk-3AOICU4Q.mjs → chunk-A3IWA366.mjs} +1 -1
  39. package/dist/chunk-A3IWA366.mjs.map +1 -0
  40. package/dist/{chunk-SWATR7CU.mjs → chunk-AZB43WEN.mjs} +14 -14
  41. package/dist/chunk-AZB43WEN.mjs.map +1 -0
  42. package/dist/{chunk-JTQ5QCML.mjs → chunk-FYAC4RRZ.mjs} +1 -1
  43. package/dist/chunk-FYAC4RRZ.mjs.map +1 -0
  44. package/dist/{chunk-5PSRSNGH.mjs → chunk-H3B6RJ63.mjs} +1 -1
  45. package/dist/chunk-H3B6RJ63.mjs.map +1 -0
  46. package/dist/{chunk-TCSYDMC7.mjs → chunk-IJRYXT4V.mjs} +1 -1
  47. package/dist/chunk-IJRYXT4V.mjs.map +1 -0
  48. package/dist/{chunk-EL2VTGFB.mjs → chunk-LLOU2WIV.mjs} +2 -2
  49. package/dist/chunk-LLOU2WIV.mjs.map +1 -0
  50. package/dist/{chunk-MGTMKKSH.mjs → chunk-MN7T76SY.mjs} +1 -1
  51. package/dist/chunk-MN7T76SY.mjs.map +1 -0
  52. package/dist/{chunk-D5IRVU4W.mjs → chunk-MSG3WFBO.mjs} +1 -1
  53. package/dist/chunk-MSG3WFBO.mjs.map +1 -0
  54. package/dist/{chunk-KVE6VXTJ.mjs → chunk-MVRWZTQ5.mjs} +1 -1
  55. package/dist/chunk-MVRWZTQ5.mjs.map +1 -0
  56. package/dist/{chunk-MSIOYYWR.mjs → chunk-NHHJ5XFF.mjs} +1 -1
  57. package/dist/chunk-NHHJ5XFF.mjs.map +1 -0
  58. package/dist/{chunk-TMHSYM3V.mjs → chunk-NR7N3R5C.mjs} +10 -10
  59. package/dist/chunk-NR7N3R5C.mjs.map +1 -0
  60. package/dist/{chunk-ZQWVMOT6.mjs → chunk-OFD66B3S.mjs} +3 -6
  61. package/dist/chunk-OFD66B3S.mjs.map +1 -0
  62. package/dist/{chunk-VMBRDEM2.mjs → chunk-OJ2MLZZ7.mjs} +1 -1
  63. package/dist/chunk-OJ2MLZZ7.mjs.map +1 -0
  64. package/dist/{chunk-XRF3TNSQ.mjs → chunk-QGVADS6Z.mjs} +1 -1
  65. package/dist/chunk-QGVADS6Z.mjs.map +1 -0
  66. package/dist/{chunk-3VKCTSPC.mjs → chunk-RMYXEG2O.mjs} +9 -9
  67. package/dist/chunk-RMYXEG2O.mjs.map +1 -0
  68. package/dist/{chunk-T5DNDBW6.mjs → chunk-UANITMH7.mjs} +2 -2
  69. package/dist/chunk-UANITMH7.mjs.map +1 -0
  70. package/dist/{chunk-4MW4FB2T.mjs → chunk-VEFEKDMH.mjs} +1 -1
  71. package/dist/chunk-VEFEKDMH.mjs.map +1 -0
  72. package/dist/{chunk-RKO6KM3T.mjs → chunk-VFDCEQYP.mjs} +12 -12
  73. package/dist/chunk-VFDCEQYP.mjs.map +1 -0
  74. package/dist/{chunk-X7XFG7TS.mjs → chunk-VQJ6VQ45.mjs} +1 -1
  75. package/dist/chunk-VQJ6VQ45.mjs.map +1 -0
  76. package/dist/{chunk-PG7ZV76C.mjs → chunk-VUTCH2CU.mjs} +1 -1
  77. package/dist/chunk-VUTCH2CU.mjs.map +1 -0
  78. package/dist/{chunk-WMG5U5AU.mjs → chunk-W7BIYCYH.mjs} +10 -10
  79. package/dist/chunk-W7BIYCYH.mjs.map +1 -0
  80. package/dist/{chunk-3HQ2UC3I.mjs → chunk-XYUYAHJX.mjs} +1 -1
  81. package/dist/chunk-XYUYAHJX.mjs.map +1 -0
  82. package/dist/{chunk-SBPKRYF2.mjs → chunk-ZGXEF3LO.mjs} +11 -11
  83. package/dist/chunk-ZGXEF3LO.mjs.map +1 -0
  84. package/dist/donut-chart.d.mts +4 -3
  85. package/dist/donut-chart.d.ts +4 -3
  86. package/dist/donut-chart.js +1 -1
  87. package/dist/donut-chart.js.map +1 -1
  88. package/dist/donut-chart.mjs +9 -9
  89. package/dist/index.js +8 -9
  90. package/dist/index.js.map +1 -1
  91. package/dist/index.mjs +27 -27
  92. package/dist/line-chart.d.mts +4 -3
  93. package/dist/line-chart.d.ts +4 -3
  94. package/dist/line-chart.js +2 -3
  95. package/dist/line-chart.js.map +1 -1
  96. package/dist/line-chart.mjs +10 -10
  97. package/dist/pie-chart-label.d.mts +9 -8
  98. package/dist/pie-chart-label.d.ts +9 -8
  99. package/dist/pie-chart-label.js.map +1 -1
  100. package/dist/pie-chart-label.mjs +1 -1
  101. package/dist/pie-chart.d.mts +4 -3
  102. package/dist/pie-chart.d.ts +4 -3
  103. package/dist/pie-chart.js +1 -1
  104. package/dist/pie-chart.js.map +1 -1
  105. package/dist/pie-chart.mjs +8 -8
  106. package/dist/radar-chart.d.mts +4 -3
  107. package/dist/radar-chart.d.ts +4 -3
  108. package/dist/radar-chart.js +1 -1
  109. package/dist/radar-chart.js.map +1 -1
  110. package/dist/radar-chart.mjs +8 -8
  111. package/dist/radial-chart.d.mts +4 -3
  112. package/dist/radial-chart.d.ts +4 -3
  113. package/dist/radial-chart.js +1 -1
  114. package/dist/radial-chart.js.map +1 -1
  115. package/dist/radial-chart.mjs +9 -9
  116. package/dist/use-area-chart.d.mts +11 -12
  117. package/dist/use-area-chart.d.ts +11 -12
  118. package/dist/use-area-chart.js.map +1 -1
  119. package/dist/use-area-chart.mjs +1 -1
  120. package/dist/use-bar-chart.d.mts +10 -10
  121. package/dist/use-bar-chart.d.ts +10 -10
  122. package/dist/use-bar-chart.js.map +1 -1
  123. package/dist/use-bar-chart.mjs +1 -1
  124. package/dist/use-chart-axis.d.mts +10 -10
  125. package/dist/use-chart-axis.d.ts +10 -10
  126. package/dist/use-chart-axis.js.map +1 -1
  127. package/dist/use-chart-axis.mjs +1 -1
  128. package/dist/use-chart-grid.d.mts +7 -7
  129. package/dist/use-chart-grid.d.ts +7 -7
  130. package/dist/use-chart-grid.js.map +1 -1
  131. package/dist/use-chart-grid.mjs +1 -1
  132. package/dist/use-chart-label-list.d.mts +8 -8
  133. package/dist/use-chart-label-list.d.ts +8 -8
  134. package/dist/use-chart-label-list.js.map +1 -1
  135. package/dist/use-chart-label-list.mjs +1 -1
  136. package/dist/use-chart-label.d.mts +7 -7
  137. package/dist/use-chart-label.d.ts +7 -7
  138. package/dist/use-chart-label.js.map +1 -1
  139. package/dist/use-chart-label.mjs +1 -1
  140. package/dist/use-chart-legend.d.mts +6 -6
  141. package/dist/use-chart-legend.d.ts +6 -6
  142. package/dist/use-chart-legend.js.map +1 -1
  143. package/dist/use-chart-legend.mjs +1 -1
  144. package/dist/use-chart-reference-line.d.mts +7 -7
  145. package/dist/use-chart-reference-line.d.ts +7 -7
  146. package/dist/use-chart-reference-line.js.map +1 -1
  147. package/dist/use-chart-reference-line.mjs +1 -1
  148. package/dist/use-chart-tooltip.d.mts +8 -8
  149. package/dist/use-chart-tooltip.d.ts +8 -8
  150. package/dist/use-chart-tooltip.js.map +1 -1
  151. package/dist/use-chart-tooltip.mjs +1 -1
  152. package/dist/use-chart.d.mts +20 -12
  153. package/dist/use-chart.d.ts +20 -12
  154. package/dist/use-chart.js.map +1 -1
  155. package/dist/use-chart.mjs +1 -1
  156. package/dist/use-line-chart.d.mts +8 -8
  157. package/dist/use-line-chart.d.ts +8 -8
  158. package/dist/use-line-chart.js +1 -2
  159. package/dist/use-line-chart.js.map +1 -1
  160. package/dist/use-line-chart.mjs +1 -1
  161. package/dist/use-pie-chart.d.mts +10 -10
  162. package/dist/use-pie-chart.d.ts +10 -10
  163. package/dist/use-pie-chart.js.map +1 -1
  164. package/dist/use-pie-chart.mjs +2 -2
  165. package/dist/use-polar-grid.d.mts +7 -7
  166. package/dist/use-polar-grid.d.ts +7 -7
  167. package/dist/use-polar-grid.js.map +1 -1
  168. package/dist/use-polar-grid.mjs +1 -1
  169. package/dist/use-radar-chart.d.mts +10 -10
  170. package/dist/use-radar-chart.d.ts +10 -10
  171. package/dist/use-radar-chart.js.map +1 -1
  172. package/dist/use-radar-chart.mjs +1 -1
  173. package/dist/use-radial-chart.d.mts +8 -8
  174. package/dist/use-radial-chart.d.ts +8 -8
  175. package/dist/use-radial-chart.js.map +1 -1
  176. package/dist/use-radial-chart.mjs +1 -1
  177. package/package.json +3 -3
  178. package/dist/chunk-3AOICU4Q.mjs.map +0 -1
  179. package/dist/chunk-3HQ2UC3I.mjs.map +0 -1
  180. package/dist/chunk-3VKCTSPC.mjs.map +0 -1
  181. package/dist/chunk-4MW4FB2T.mjs.map +0 -1
  182. package/dist/chunk-5PSRSNGH.mjs.map +0 -1
  183. package/dist/chunk-BYL7HWNN.mjs.map +0 -1
  184. package/dist/chunk-D5IRVU4W.mjs.map +0 -1
  185. package/dist/chunk-EL2VTGFB.mjs.map +0 -1
  186. package/dist/chunk-FPFCMFCJ.mjs.map +0 -1
  187. package/dist/chunk-JTQ5QCML.mjs.map +0 -1
  188. package/dist/chunk-KVE6VXTJ.mjs.map +0 -1
  189. package/dist/chunk-MGTMKKSH.mjs.map +0 -1
  190. package/dist/chunk-MSIOYYWR.mjs.map +0 -1
  191. package/dist/chunk-PG7ZV76C.mjs.map +0 -1
  192. package/dist/chunk-PPBHLDVN.mjs.map +0 -1
  193. package/dist/chunk-RKO6KM3T.mjs.map +0 -1
  194. package/dist/chunk-SBPKRYF2.mjs.map +0 -1
  195. package/dist/chunk-SWATR7CU.mjs.map +0 -1
  196. package/dist/chunk-T5DNDBW6.mjs.map +0 -1
  197. package/dist/chunk-TCSYDMC7.mjs.map +0 -1
  198. package/dist/chunk-TMHSYM3V.mjs.map +0 -1
  199. package/dist/chunk-VMBRDEM2.mjs.map +0 -1
  200. package/dist/chunk-WMG5U5AU.mjs.map +0 -1
  201. package/dist/chunk-X7XFG7TS.mjs.map +0 -1
  202. package/dist/chunk-XRF3TNSQ.mjs.map +0 -1
  203. package/dist/chunk-YNJ423BR.mjs.map +0 -1
  204. package/dist/chunk-ZQWVMOT6.mjs.map +0 -1
@@ -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\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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,UAAH;AAAA,YACC,WAAU;AAAA,YAEV,OAAO,OAAO;AAAA,YAEd;AAAA;AAAA,gBAAC,gBAAG;AAAA,gBAAH;AAAA,kBACC,WAAU;AAAA,kBACV,YAAY;AAAA,kBACZ,OAAO,OAAO;AAAA;AAAA,cAChB;AAAA,cAEA;AAAA,gBAAC,gBAAG;AAAA,gBAAH;AAAA,kBACC,WAAU;AAAA,kBACV,OAAO,OAAO;AAAA,kBAEb;AAAA;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 } from \"@yamada-ui/utils\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport { useTooltip } from \"./use-chart\"\n\nexport interface ChartTooltipProps {\n label?: string\n dataKey?: string\n payload: Dict[] | undefined\n valueFormatter?: (value: any) => string\n labelFormatter?: (label: string) => string\n unit?: string\n isRadialChart?: boolean\n}\n\nexport const ChartTooltip = forwardRef<ChartTooltipProps, \"div\">(\n (\n {\n label,\n dataKey = \"value\",\n className,\n payload = [],\n valueFormatter,\n labelFormatter,\n unit,\n isRadialChart,\n ...rest\n },\n ref,\n ) => {\n const { styles } = useTooltip()\n\n const items = payload.map(\n (\n {\n color: colorProp,\n name: nameProp,\n [dataKey]: valueProp,\n payload,\n } = {},\n index,\n ) => {\n const name = isRadialChart ? payload?.name : nameProp\n const color = colorProp ?? payload?.color\n let value: string\n\n if (isArray(valueProp)) {\n value = valueProp\n .map((value) => {\n return `${valueFormatter?.(value) ?? value}`\n })\n .join(\" - \")\n } else {\n value = valueFormatter?.(valueProp) ?? valueProp\n }\n\n return (\n <ui.div\n className=\"ui-chart__tooltip-item\"\n key={`tooltip-payload-${index}`}\n __css={styles.tooltipItem}\n >\n <ui.div\n className=\"ui-chart__tooltip-swatch\"\n background={color}\n __css={styles.tooltipSwatch}\n />\n\n <ui.span\n className=\"ui-chart__tooltip-label\"\n __css={styles.tooltipLabel}\n >\n {name}\n </ui.span>\n\n <ui.span\n className=\"ui-chart__tooltip-value\"\n __css={styles.tooltipValue}\n >\n {value}\n {unit ? unit : \"\"}\n </ui.span>\n </ui.div>\n )\n },\n )\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-chart__tooltip\", className)}\n __css={styles.tooltip}\n {...rest}\n >\n {label ? (\n <ui.p className=\"ui-chart__tooltip-title\" __css={styles.tooltipTitle}>\n {labelFormatter?.(label) ?? label}\n </ui.p>\n ) : null}\n\n <ui.div className=\"ui-chart__tooltip-list\" __css={styles.tooltipList}>\n {items}\n </ui.div>\n </ui.div>\n )\n },\n)\n","import { useTheme } from \"@yamada-ui/core\"\nimport type { CSSUIObject, PropGetter } 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 { ResponsiveContainerProps } from \"./chart.types\"\nimport { containerProperties } from \"./rechart-properties\"\n\ninterface ChartContext {\n styles: { [key: string]: CSSUIObject }\n}\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 interface 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: PropGetter<\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 interface UseLegendProps {}\n\nexport const useLegend = ({}: UseLegendProps = {}) => {\n const { styles } = useChartContext()\n return {\n styles,\n }\n}\nexport type UseLegendReturn = ReturnType<typeof useLegend>\n\nexport interface 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,gBAA4B;;;ACD5B,kBAAyB;AAGzB,mBAAkC;AAClC,mBAA4B;AAUrB,IAAM,CAAC,eAAe,eAAe,QAAI,4BAA4B;AAAA,EAC1E,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAgDM,I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,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,8 +1,8 @@
1
1
  "use client"
2
2
  import {
3
3
  ChartTooltip
4
- } from "./chunk-T5DNDBW6.mjs";
5
- import "./chunk-3AOICU4Q.mjs";
4
+ } from "./chunk-UANITMH7.mjs";
5
+ import "./chunk-A3IWA366.mjs";
6
6
  import "./chunk-6YUJLLGN.mjs";
7
7
  import "./chunk-QL3DB7OJ.mjs";
8
8
  export {
@@ -1,88 +1,106 @@
1
- import { As, HTMLUIProps, CSSUIProps } from '@yamada-ui/core';
1
+ import { CSSUIProps, HTMLUIProps } from '@yamada-ui/core';
2
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
5
 
6
- type ChartPropGetter<Y extends As = "div", M = undefined, D = undefined> = (props?: Merge<HTMLUIProps<Y>, M>, ref?: React.Ref<any>) => D;
7
- type RequiredChartPropGetter<Y extends As = "div", M = undefined, D = undefined> = (props: Merge<HTMLUIProps<Y>, M>, ref?: React.Ref<any>) => D;
8
6
  type ChartLayoutType = "horizontal" | "vertical";
9
7
  type AreaChartType = "default" | "stacked" | "percent" | "split";
10
8
  type BarChartType = Exclude<AreaChartType, "split">;
11
9
  type ChartAxisType = "x" | "y" | "xy" | "none";
12
10
  type ChartCurveType = "bump" | "linear" | "natural" | "monotone" | "step" | "stepBefore" | "stepAfter";
13
11
  type TooltipDataSourceType = "segment" | "all";
14
- type AreaChartProps = Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.AreaChart>>;
15
- type BarChartProps = Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.BarChart>>;
16
- type LineChartProps = Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.LineChart>>;
17
- type RadarChartProps = Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.RadarChart>>;
18
- type PieChartProps = Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.PieChart>>;
19
- type RadialChartProps = Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.RadialBarChart>>;
20
- type ReferenceLineProps = Merge<CSSUIProps, Recharts.ReferenceLineProps>;
21
- type ResponsiveContainerProps = Merge<CSSUIProps, Omit<Recharts.ResponsiveContainerProps, "children">>;
22
- type AreaProps = Merge<Merge<CSSUIProps, Recharts.AreaProps>, {
12
+ interface AreaChartProps extends Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.AreaChart>> {
13
+ }
14
+ interface BarChartProps extends Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.BarChart>> {
15
+ }
16
+ interface LineChartProps extends Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.LineChart>> {
17
+ }
18
+ interface RadarChartProps extends Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.RadarChart>> {
19
+ }
20
+ interface PieChartProps extends Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.PieChart>> {
21
+ }
22
+ interface RadialChartProps extends Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.RadialBarChart>> {
23
+ }
24
+ interface ReferenceLineProps extends Merge<CSSUIProps, Recharts.ReferenceLineProps> {
25
+ }
26
+ interface ResponsiveContainerProps extends Merge<CSSUIProps, Omit<Recharts.ResponsiveContainerProps, "children">> {
27
+ }
28
+ interface AreaProps extends Merge<Merge<CSSUIProps, Recharts.AreaProps>, {
23
29
  color: CSSUIProps["color"];
24
30
  dot?: DotProps;
25
31
  activeDot?: DotProps;
26
32
  dimDot?: DotProps;
27
33
  dimArea?: Partial<AreaProps>;
28
- }>;
29
- type LineProps = Merge<Merge<CSSUIProps, Recharts.LineProps>, {
34
+ }> {
35
+ }
36
+ interface LineProps extends Merge<Merge<CSSUIProps, Recharts.LineProps>, {
30
37
  color: CSSUIProps["color"];
31
38
  activeDot?: DotProps;
32
39
  dot?: DotProps;
33
40
  dimDot?: DotProps;
34
41
  dimLine?: Partial<LineProps>;
35
- }>;
36
- type BarProps = Merge<Merge<CSSUIProps, Recharts.BarProps>, {
42
+ }> {
43
+ }
44
+ interface BarProps extends Merge<Merge<CSSUIProps, Recharts.BarProps>, {
37
45
  color: CSSUIProps["color"];
38
46
  activeBar?: Merge<SVGProps<SVGPathElement>, CSSUIProps>;
39
47
  background?: Merge<SVGProps<SVGPathElement>, CSSUIProps>;
40
48
  dimBar?: Partial<BarProps>;
41
- }>;
42
- type RadarProps = Merge<Merge<CSSUIProps, Recharts.RadarProps>, {
49
+ }> {
50
+ }
51
+ interface RadarProps extends Merge<Merge<CSSUIProps, Recharts.RadarProps>, {
43
52
  color: CSSUIProps["color"];
44
53
  dot?: DotProps;
45
54
  activeDot?: DotProps;
46
55
  dimDot?: DotProps;
47
56
  dimRadar?: Partial<RadarProps>;
48
- }>;
49
- type PieProps = Merge<Merge<Recharts.PieProps, CSSUIProps>, {
57
+ }> {
58
+ }
59
+ interface PieProps extends Merge<Merge<Recharts.PieProps, CSSUIProps>, {
50
60
  activeShape?: Partial<PieProps>;
51
61
  inactiveShape?: Partial<PieProps>;
52
62
  label?: HTMLUIProps<"text">;
53
63
  labelLine?: HTMLUIProps<"path">;
54
- }>;
55
- type CellProps = Merge<CSSUIProps, {
64
+ }> {
65
+ }
66
+ interface CellProps extends CSSUIProps {
56
67
  name: string;
57
68
  value: number;
58
69
  dimCell?: Partial<CellProps>;
59
- }>;
60
- type RadialBarProps = Merge<Merge<Recharts.RadialBarProps, CSSUIProps>, {
70
+ }
71
+ interface RadialBarProps extends Merge<Merge<Recharts.RadialBarProps, CSSUIProps>, {
61
72
  background?: Partial<RadialBarProps>;
62
73
  dimRadialBar?: CSSUIProps;
63
- }>;
64
- type DotProps = Merge<Omit<Recharts.DotProps, "ref">, CSSUIProps>;
65
- type XAxisProps = Merge<Merge<CSSUIProps, Recharts.XAxisProps>, {
66
- color?: CSSUIProps["color"];
67
- stroke?: CSSUIProps["color"];
68
- fill?: CSSUIProps["color"];
69
- }>;
70
- type YAxisProps = Merge<Merge<CSSUIProps, Recharts.YAxisProps>, {
71
- color?: CSSUIProps["color"];
72
- }>;
73
- type LegendProps = Merge<CSSUIProps, Omit<Recharts.LegendProps, "ref">>;
74
- type TooltipProps = Merge<Merge<CSSUIProps, Omit<Recharts.TooltipProps<any, any>, "ref">>, {
74
+ }> {
75
+ }
76
+ interface DotProps extends Merge<Omit<Recharts.DotProps, "ref">, CSSUIProps> {
77
+ }
78
+ interface XAxisProps extends Merge<CSSUIProps, Omit<Recharts.XAxisProps, "color" | "stroke" | "fill">> {
79
+ }
80
+ interface YAxisProps extends Merge<CSSUIProps, Omit<Recharts.YAxisProps, "color">> {
81
+ }
82
+ interface LegendProps extends Merge<CSSUIProps, Omit<Recharts.LegendProps, "ref">> {
83
+ }
84
+ interface TooltipProps extends Merge<Merge<CSSUIProps, Omit<Recharts.TooltipProps<any, any>, "ref">>, {
75
85
  cursor?: CSSUIProps;
76
- }>;
77
- type GridProps = Merge<CSSUIProps, Recharts.CartesianGridProps>;
78
- type PolarGridProps = Merge<CSSUIProps, Recharts.PolarGridProps>;
79
- type PolarAngleAxisProps = Merge<Recharts.PolarAngleAxisProps, CSSUIProps>;
80
- type PolarRadiusAxisProps = Merge<CSSUIProps, Recharts.PolarRadiusAxisProps>;
81
- type LabelProps = Merge<CSSUIProps, Omit<Recharts.LabelProps, "fill">>;
82
- type LabelListProps = Merge<Recharts.LabelListProps<Dict>, Omit<CSSUIProps, "position">>;
83
- type ChartTooltipProps = Recharts.TooltipProps<number | string | Array<number | string>, number | string>;
86
+ }> {
87
+ }
88
+ interface GridProps extends Merge<CSSUIProps, Recharts.CartesianGridProps> {
89
+ }
90
+ interface PolarGridProps extends Merge<CSSUIProps, Recharts.PolarGridProps> {
91
+ }
92
+ interface PolarAngleAxisProps extends Merge<Recharts.PolarAngleAxisProps, CSSUIProps> {
93
+ }
94
+ interface PolarRadiusAxisProps extends Merge<CSSUIProps, Recharts.PolarRadiusAxisProps> {
95
+ }
96
+ interface LabelProps extends Merge<CSSUIProps, Omit<Recharts.LabelProps, "fill">> {
97
+ }
98
+ interface LabelListProps extends Merge<Recharts.LabelListProps<Dict>, Omit<CSSUIProps, "position">> {
99
+ }
100
+ type ChartTooltipProps = Recharts.TooltipProps<number | string | (number | string)[], number | string>;
84
101
  type ChartTooltip = ReactElement | ((props: ChartTooltipProps) => ReactNode);
85
- type ChartLabelProps = Omit<React.SVGProps<SVGTextElement>, "viewBox"> & LabelProps;
102
+ interface ChartLabelProps extends Omit<React.SVGProps<SVGTextElement>, "viewBox" | "fill" | "offset">, LabelProps {
103
+ }
86
104
  type ChartLabel = ReactElement | ((props: ChartLabelProps) => ReactNode);
87
105
 
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 };
106
+ export type { AreaChartProps, AreaChartType, AreaProps, BarChartProps, BarChartType, BarProps, CellProps, ChartAxisType, ChartCurveType, ChartLabel, ChartLabelProps, ChartLayoutType, ChartTooltip, ChartTooltipProps, DotProps, GridProps, LabelListProps, LabelProps, LegendProps, LineChartProps, LineProps, PieChartProps, PieProps, PolarAngleAxisProps, PolarGridProps, PolarRadiusAxisProps, RadarChartProps, RadarProps, RadialBarProps, RadialChartProps, ReferenceLineProps, ResponsiveContainerProps, TooltipDataSourceType, TooltipProps, XAxisProps, YAxisProps };
@@ -1,88 +1,106 @@
1
- import { As, HTMLUIProps, CSSUIProps } from '@yamada-ui/core';
1
+ import { CSSUIProps, HTMLUIProps } from '@yamada-ui/core';
2
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
5
 
6
- type ChartPropGetter<Y extends As = "div", M = undefined, D = undefined> = (props?: Merge<HTMLUIProps<Y>, M>, ref?: React.Ref<any>) => D;
7
- type RequiredChartPropGetter<Y extends As = "div", M = undefined, D = undefined> = (props: Merge<HTMLUIProps<Y>, M>, ref?: React.Ref<any>) => D;
8
6
  type ChartLayoutType = "horizontal" | "vertical";
9
7
  type AreaChartType = "default" | "stacked" | "percent" | "split";
10
8
  type BarChartType = Exclude<AreaChartType, "split">;
11
9
  type ChartAxisType = "x" | "y" | "xy" | "none";
12
10
  type ChartCurveType = "bump" | "linear" | "natural" | "monotone" | "step" | "stepBefore" | "stepAfter";
13
11
  type TooltipDataSourceType = "segment" | "all";
14
- type AreaChartProps = Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.AreaChart>>;
15
- type BarChartProps = Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.BarChart>>;
16
- type LineChartProps = Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.LineChart>>;
17
- type RadarChartProps = Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.RadarChart>>;
18
- type PieChartProps = Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.PieChart>>;
19
- type RadialChartProps = Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.RadialBarChart>>;
20
- type ReferenceLineProps = Merge<CSSUIProps, Recharts.ReferenceLineProps>;
21
- type ResponsiveContainerProps = Merge<CSSUIProps, Omit<Recharts.ResponsiveContainerProps, "children">>;
22
- type AreaProps = Merge<Merge<CSSUIProps, Recharts.AreaProps>, {
12
+ interface AreaChartProps extends Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.AreaChart>> {
13
+ }
14
+ interface BarChartProps extends Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.BarChart>> {
15
+ }
16
+ interface LineChartProps extends Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.LineChart>> {
17
+ }
18
+ interface RadarChartProps extends Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.RadarChart>> {
19
+ }
20
+ interface PieChartProps extends Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.PieChart>> {
21
+ }
22
+ interface RadialChartProps extends Merge<CSSUIProps, ComponentPropsWithoutRef<typeof Recharts.RadialBarChart>> {
23
+ }
24
+ interface ReferenceLineProps extends Merge<CSSUIProps, Recharts.ReferenceLineProps> {
25
+ }
26
+ interface ResponsiveContainerProps extends Merge<CSSUIProps, Omit<Recharts.ResponsiveContainerProps, "children">> {
27
+ }
28
+ interface AreaProps extends Merge<Merge<CSSUIProps, Recharts.AreaProps>, {
23
29
  color: CSSUIProps["color"];
24
30
  dot?: DotProps;
25
31
  activeDot?: DotProps;
26
32
  dimDot?: DotProps;
27
33
  dimArea?: Partial<AreaProps>;
28
- }>;
29
- type LineProps = Merge<Merge<CSSUIProps, Recharts.LineProps>, {
34
+ }> {
35
+ }
36
+ interface LineProps extends Merge<Merge<CSSUIProps, Recharts.LineProps>, {
30
37
  color: CSSUIProps["color"];
31
38
  activeDot?: DotProps;
32
39
  dot?: DotProps;
33
40
  dimDot?: DotProps;
34
41
  dimLine?: Partial<LineProps>;
35
- }>;
36
- type BarProps = Merge<Merge<CSSUIProps, Recharts.BarProps>, {
42
+ }> {
43
+ }
44
+ interface BarProps extends Merge<Merge<CSSUIProps, Recharts.BarProps>, {
37
45
  color: CSSUIProps["color"];
38
46
  activeBar?: Merge<SVGProps<SVGPathElement>, CSSUIProps>;
39
47
  background?: Merge<SVGProps<SVGPathElement>, CSSUIProps>;
40
48
  dimBar?: Partial<BarProps>;
41
- }>;
42
- type RadarProps = Merge<Merge<CSSUIProps, Recharts.RadarProps>, {
49
+ }> {
50
+ }
51
+ interface RadarProps extends Merge<Merge<CSSUIProps, Recharts.RadarProps>, {
43
52
  color: CSSUIProps["color"];
44
53
  dot?: DotProps;
45
54
  activeDot?: DotProps;
46
55
  dimDot?: DotProps;
47
56
  dimRadar?: Partial<RadarProps>;
48
- }>;
49
- type PieProps = Merge<Merge<Recharts.PieProps, CSSUIProps>, {
57
+ }> {
58
+ }
59
+ interface PieProps extends Merge<Merge<Recharts.PieProps, CSSUIProps>, {
50
60
  activeShape?: Partial<PieProps>;
51
61
  inactiveShape?: Partial<PieProps>;
52
62
  label?: HTMLUIProps<"text">;
53
63
  labelLine?: HTMLUIProps<"path">;
54
- }>;
55
- type CellProps = Merge<CSSUIProps, {
64
+ }> {
65
+ }
66
+ interface CellProps extends CSSUIProps {
56
67
  name: string;
57
68
  value: number;
58
69
  dimCell?: Partial<CellProps>;
59
- }>;
60
- type RadialBarProps = Merge<Merge<Recharts.RadialBarProps, CSSUIProps>, {
70
+ }
71
+ interface RadialBarProps extends Merge<Merge<Recharts.RadialBarProps, CSSUIProps>, {
61
72
  background?: Partial<RadialBarProps>;
62
73
  dimRadialBar?: CSSUIProps;
63
- }>;
64
- type DotProps = Merge<Omit<Recharts.DotProps, "ref">, CSSUIProps>;
65
- type XAxisProps = Merge<Merge<CSSUIProps, Recharts.XAxisProps>, {
66
- color?: CSSUIProps["color"];
67
- stroke?: CSSUIProps["color"];
68
- fill?: CSSUIProps["color"];
69
- }>;
70
- type YAxisProps = Merge<Merge<CSSUIProps, Recharts.YAxisProps>, {
71
- color?: CSSUIProps["color"];
72
- }>;
73
- type LegendProps = Merge<CSSUIProps, Omit<Recharts.LegendProps, "ref">>;
74
- type TooltipProps = Merge<Merge<CSSUIProps, Omit<Recharts.TooltipProps<any, any>, "ref">>, {
74
+ }> {
75
+ }
76
+ interface DotProps extends Merge<Omit<Recharts.DotProps, "ref">, CSSUIProps> {
77
+ }
78
+ interface XAxisProps extends Merge<CSSUIProps, Omit<Recharts.XAxisProps, "color" | "stroke" | "fill">> {
79
+ }
80
+ interface YAxisProps extends Merge<CSSUIProps, Omit<Recharts.YAxisProps, "color">> {
81
+ }
82
+ interface LegendProps extends Merge<CSSUIProps, Omit<Recharts.LegendProps, "ref">> {
83
+ }
84
+ interface TooltipProps extends Merge<Merge<CSSUIProps, Omit<Recharts.TooltipProps<any, any>, "ref">>, {
75
85
  cursor?: CSSUIProps;
76
- }>;
77
- type GridProps = Merge<CSSUIProps, Recharts.CartesianGridProps>;
78
- type PolarGridProps = Merge<CSSUIProps, Recharts.PolarGridProps>;
79
- type PolarAngleAxisProps = Merge<Recharts.PolarAngleAxisProps, CSSUIProps>;
80
- type PolarRadiusAxisProps = Merge<CSSUIProps, Recharts.PolarRadiusAxisProps>;
81
- type LabelProps = Merge<CSSUIProps, Omit<Recharts.LabelProps, "fill">>;
82
- type LabelListProps = Merge<Recharts.LabelListProps<Dict>, Omit<CSSUIProps, "position">>;
83
- type ChartTooltipProps = Recharts.TooltipProps<number | string | Array<number | string>, number | string>;
86
+ }> {
87
+ }
88
+ interface GridProps extends Merge<CSSUIProps, Recharts.CartesianGridProps> {
89
+ }
90
+ interface PolarGridProps extends Merge<CSSUIProps, Recharts.PolarGridProps> {
91
+ }
92
+ interface PolarAngleAxisProps extends Merge<Recharts.PolarAngleAxisProps, CSSUIProps> {
93
+ }
94
+ interface PolarRadiusAxisProps extends Merge<CSSUIProps, Recharts.PolarRadiusAxisProps> {
95
+ }
96
+ interface LabelProps extends Merge<CSSUIProps, Omit<Recharts.LabelProps, "fill">> {
97
+ }
98
+ interface LabelListProps extends Merge<Recharts.LabelListProps<Dict>, Omit<CSSUIProps, "position">> {
99
+ }
100
+ type ChartTooltipProps = Recharts.TooltipProps<number | string | (number | string)[], number | string>;
84
101
  type ChartTooltip = ReactElement | ((props: ChartTooltipProps) => ReactNode);
85
- type ChartLabelProps = Omit<React.SVGProps<SVGTextElement>, "viewBox"> & LabelProps;
102
+ interface ChartLabelProps extends Omit<React.SVGProps<SVGTextElement>, "viewBox" | "fill" | "offset">, LabelProps {
103
+ }
86
104
  type ChartLabel = ReactElement | ((props: ChartLabelProps) => ReactNode);
87
105
 
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 };
106
+ export type { AreaChartProps, AreaChartType, AreaProps, BarChartProps, BarChartType, BarProps, CellProps, ChartAxisType, ChartCurveType, ChartLabel, ChartLabelProps, ChartLayoutType, ChartTooltip, ChartTooltipProps, DotProps, GridProps, LabelListProps, LabelProps, LegendProps, LineChartProps, LineProps, PieChartProps, PieProps, PolarAngleAxisProps, PolarGridProps, PolarRadiusAxisProps, RadarChartProps, RadarProps, RadialBarProps, RadialChartProps, ReferenceLineProps, ResponsiveContainerProps, TooltipDataSourceType, TooltipProps, XAxisProps, YAxisProps };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/chart.types.ts"],"sourcesContent":["import type { As, CSSUIProps, HTMLUIProps } from \"@yamada-ui/core\"\nimport type { Dict, Merge } from \"@yamada-ui/utils\"\nimport type {\n ComponentPropsWithoutRef,\n ReactElement,\n ReactNode,\n SVGProps,\n} from \"react\"\nimport type * as Recharts from \"recharts\"\n\nexport type ChartPropGetter<\n Y extends As = \"div\",\n M = undefined,\n D = undefined,\n> = (props?: Merge<HTMLUIProps<Y>, M>, ref?: React.Ref<any>) => D\n\nexport type RequiredChartPropGetter<\n Y extends As = \"div\",\n M = undefined,\n D = undefined,\n> = (props: Merge<HTMLUIProps<Y>, M>, ref?: React.Ref<any>) => D\nexport type ChartLayoutType = \"horizontal\" | \"vertical\"\nexport type AreaChartType = \"default\" | \"stacked\" | \"percent\" | \"split\"\nexport type BarChartType = Exclude<AreaChartType, \"split\">\nexport type ChartAxisType = \"x\" | \"y\" | \"xy\" | \"none\"\nexport type ChartCurveType =\n | \"bump\"\n | \"linear\"\n | \"natural\"\n | \"monotone\"\n | \"step\"\n | \"stepBefore\"\n | \"stepAfter\"\nexport type TooltipDataSourceType = \"segment\" | \"all\"\n\nexport type AreaChartProps = Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.AreaChart>\n>\nexport type BarChartProps = Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.BarChart>\n>\nexport type LineChartProps = Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.LineChart>\n>\nexport type RadarChartProps = Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.RadarChart>\n>\nexport type PieChartProps = Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.PieChart>\n>\nexport type RadialChartProps = Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.RadialBarChart>\n>\nexport type ReferenceLineProps = Merge<CSSUIProps, Recharts.ReferenceLineProps>\nexport type ResponsiveContainerProps = Merge<\n CSSUIProps,\n Omit<Recharts.ResponsiveContainerProps, \"children\">\n>\nexport type AreaProps = Merge<\n Merge<CSSUIProps, Recharts.AreaProps>,\n {\n color: CSSUIProps[\"color\"]\n dot?: DotProps\n activeDot?: DotProps\n dimDot?: DotProps\n dimArea?: Partial<AreaProps>\n }\n>\nexport type LineProps = Merge<\n Merge<CSSUIProps, Recharts.LineProps>,\n {\n color: CSSUIProps[\"color\"]\n activeDot?: DotProps\n dot?: DotProps\n dimDot?: DotProps\n dimLine?: Partial<LineProps>\n }\n>\nexport type BarProps = Merge<\n Merge<CSSUIProps, Recharts.BarProps>,\n {\n color: CSSUIProps[\"color\"]\n activeBar?: Merge<SVGProps<SVGPathElement>, CSSUIProps>\n background?: Merge<SVGProps<SVGPathElement>, CSSUIProps>\n dimBar?: Partial<BarProps>\n }\n>\nexport type RadarProps = Merge<\n Merge<CSSUIProps, Recharts.RadarProps>,\n {\n color: CSSUIProps[\"color\"]\n dot?: DotProps\n activeDot?: DotProps\n dimDot?: DotProps\n dimRadar?: Partial<RadarProps>\n }\n>\nexport type PieProps = Merge<\n Merge<Recharts.PieProps, CSSUIProps>,\n {\n activeShape?: Partial<PieProps>\n inactiveShape?: Partial<PieProps>\n label?: HTMLUIProps<\"text\">\n labelLine?: HTMLUIProps<\"path\">\n }\n>\nexport type CellProps = Merge<\n CSSUIProps,\n {\n name: string\n value: number\n dimCell?: Partial<CellProps>\n }\n>\nexport type RadialBarProps = Merge<\n Merge<Recharts.RadialBarProps, CSSUIProps>,\n {\n background?: Partial<RadialBarProps>\n dimRadialBar?: CSSUIProps\n }\n>\nexport type DotProps = Merge<Omit<Recharts.DotProps, \"ref\">, CSSUIProps>\nexport type XAxisProps = Merge<\n Merge<CSSUIProps, Recharts.XAxisProps>,\n {\n color?: CSSUIProps[\"color\"]\n stroke?: CSSUIProps[\"color\"]\n fill?: CSSUIProps[\"color\"]\n }\n>\nexport type YAxisProps = Merge<\n Merge<CSSUIProps, Recharts.YAxisProps>,\n { color?: CSSUIProps[\"color\"] }\n>\nexport type LegendProps = Merge<CSSUIProps, Omit<Recharts.LegendProps, \"ref\">>\nexport type TooltipProps = Merge<\n Merge<CSSUIProps, Omit<Recharts.TooltipProps<any, any>, \"ref\">>,\n { cursor?: CSSUIProps }\n>\nexport type GridProps = Merge<CSSUIProps, Recharts.CartesianGridProps>\nexport type PolarGridProps = Merge<CSSUIProps, Recharts.PolarGridProps>\nexport type PolarAngleAxisProps = Merge<\n Recharts.PolarAngleAxisProps,\n CSSUIProps\n>\nexport type PolarRadiusAxisProps = Merge<\n CSSUIProps,\n Recharts.PolarRadiusAxisProps\n>\nexport type LabelProps = Merge<CSSUIProps, Omit<Recharts.LabelProps, \"fill\">>\nexport type LabelListProps = Merge<\n Recharts.LabelListProps<Dict>,\n Omit<CSSUIProps, \"position\">\n>\nexport type ChartTooltipProps = Recharts.TooltipProps<\n number | string | Array<number | string>,\n number | string\n>\nexport type ChartTooltip =\n | ReactElement\n | ((props: ChartTooltipProps) => ReactNode)\n\nexport type ChartLabelProps = Omit<React.SVGProps<SVGTextElement>, \"viewBox\"> &\n LabelProps\nexport type ChartLabel = ReactElement | ((props: ChartLabelProps) => ReactNode)\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../src/chart.types.ts"],"sourcesContent":["import type { CSSUIProps, HTMLUIProps } from \"@yamada-ui/core\"\nimport type { Dict, Merge } from \"@yamada-ui/utils\"\nimport type {\n ComponentPropsWithoutRef,\n ReactElement,\n ReactNode,\n SVGProps,\n} from \"react\"\nimport type * as Recharts from \"recharts\"\n\nexport type ChartLayoutType = \"horizontal\" | \"vertical\"\nexport type AreaChartType = \"default\" | \"stacked\" | \"percent\" | \"split\"\nexport type BarChartType = Exclude<AreaChartType, \"split\">\nexport type ChartAxisType = \"x\" | \"y\" | \"xy\" | \"none\"\nexport type ChartCurveType =\n | \"bump\"\n | \"linear\"\n | \"natural\"\n | \"monotone\"\n | \"step\"\n | \"stepBefore\"\n | \"stepAfter\"\nexport type TooltipDataSourceType = \"segment\" | \"all\"\n\nexport interface AreaChartProps\n extends Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.AreaChart>\n > {}\nexport interface BarChartProps\n extends Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.BarChart>\n > {}\nexport interface LineChartProps\n extends Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.LineChart>\n > {}\nexport interface RadarChartProps\n extends Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.RadarChart>\n > {}\nexport interface PieChartProps\n extends Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.PieChart>\n > {}\nexport interface RadialChartProps\n extends Merge<\n CSSUIProps,\n ComponentPropsWithoutRef<typeof Recharts.RadialBarChart>\n > {}\nexport interface ReferenceLineProps\n extends Merge<CSSUIProps, Recharts.ReferenceLineProps> {}\nexport interface ResponsiveContainerProps\n extends Merge<\n CSSUIProps,\n Omit<Recharts.ResponsiveContainerProps, \"children\">\n > {}\nexport interface AreaProps\n extends Merge<\n Merge<CSSUIProps, Recharts.AreaProps>,\n {\n color: CSSUIProps[\"color\"]\n dot?: DotProps\n activeDot?: DotProps\n dimDot?: DotProps\n dimArea?: Partial<AreaProps>\n }\n > {}\nexport interface LineProps\n extends Merge<\n Merge<CSSUIProps, Recharts.LineProps>,\n {\n color: CSSUIProps[\"color\"]\n activeDot?: DotProps\n dot?: DotProps\n dimDot?: DotProps\n dimLine?: Partial<LineProps>\n }\n > {}\nexport interface BarProps\n extends Merge<\n Merge<CSSUIProps, Recharts.BarProps>,\n {\n color: CSSUIProps[\"color\"]\n activeBar?: Merge<SVGProps<SVGPathElement>, CSSUIProps>\n background?: Merge<SVGProps<SVGPathElement>, CSSUIProps>\n dimBar?: Partial<BarProps>\n }\n > {}\nexport interface RadarProps\n extends Merge<\n Merge<CSSUIProps, Recharts.RadarProps>,\n {\n color: CSSUIProps[\"color\"]\n dot?: DotProps\n activeDot?: DotProps\n dimDot?: DotProps\n dimRadar?: Partial<RadarProps>\n }\n > {}\nexport interface PieProps\n extends Merge<\n Merge<Recharts.PieProps, CSSUIProps>,\n {\n activeShape?: Partial<PieProps>\n inactiveShape?: Partial<PieProps>\n label?: HTMLUIProps<\"text\">\n labelLine?: HTMLUIProps<\"path\">\n }\n > {}\nexport interface CellProps extends CSSUIProps {\n name: string\n value: number\n dimCell?: Partial<CellProps>\n}\nexport interface RadialBarProps\n extends Merge<\n Merge<Recharts.RadialBarProps, CSSUIProps>,\n {\n background?: Partial<RadialBarProps>\n dimRadialBar?: CSSUIProps\n }\n > {}\nexport interface DotProps\n extends Merge<Omit<Recharts.DotProps, \"ref\">, CSSUIProps> {}\nexport interface XAxisProps\n extends Merge<\n CSSUIProps,\n Omit<Recharts.XAxisProps, \"color\" | \"stroke\" | \"fill\">\n > {}\nexport interface YAxisProps\n extends Merge<CSSUIProps, Omit<Recharts.YAxisProps, \"color\">> {}\nexport interface LegendProps\n extends Merge<CSSUIProps, Omit<Recharts.LegendProps, \"ref\">> {}\nexport interface TooltipProps\n extends Merge<\n Merge<CSSUIProps, Omit<Recharts.TooltipProps<any, any>, \"ref\">>,\n { cursor?: CSSUIProps }\n > {}\nexport interface GridProps\n extends Merge<CSSUIProps, Recharts.CartesianGridProps> {}\nexport interface PolarGridProps\n extends Merge<CSSUIProps, Recharts.PolarGridProps> {}\nexport interface PolarAngleAxisProps\n extends Merge<Recharts.PolarAngleAxisProps, CSSUIProps> {}\nexport interface PolarRadiusAxisProps\n extends Merge<CSSUIProps, Recharts.PolarRadiusAxisProps> {}\nexport interface LabelProps\n extends Merge<CSSUIProps, Omit<Recharts.LabelProps, \"fill\">> {}\nexport interface LabelListProps\n extends Merge<Recharts.LabelListProps<Dict>, Omit<CSSUIProps, \"position\">> {}\nexport type ChartTooltipProps = Recharts.TooltipProps<\n number | string | (number | string)[],\n number | string\n>\nexport type ChartTooltip =\n | ReactElement\n | ((props: ChartTooltipProps) => ReactNode)\nexport interface ChartLabelProps\n extends Omit<React.SVGProps<SVGTextElement>, \"viewBox\" | \"fill\" | \"offset\">,\n LabelProps {}\nexport type ChartLabel = ReactElement | ((props: ChartLabelProps) => ReactNode)\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -39,4 +39,4 @@ var useChartGrid = ({
39
39
  export {
40
40
  useChartGrid
41
41
  };
42
- //# sourceMappingURL=chunk-PPBHLDVN.mjs.map
42
+ //# sourceMappingURL=chunk-2GQHI23M.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/use-chart-grid.ts"],"sourcesContent":["import type { CSSUIObject, PropGetter } 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, GridProps } from \"./chart.types\"\nimport { gridProperties } from \"./rechart-properties\"\n\nexport interface 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\ninterface UseChartGridProps extends 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: PropGetter<\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"],"mappings":";;;;;;;;;AACA,SAAS,gBAAgB;AAEzB,SAAS,UAAU;AACnB,SAAS,mBAAmB;AA6BrB,IAAM,eAAe,CAAC;AAAA,EAC3B,YAAY,CAAC;AAAA,EACb,WAAW;AAAA,EACX,kBAAkB;AAAA,EAClB;AACF,MAAyB;AACvB,QAAM,EAAE,MAAM,IAAI,SAAS;AAC3B,QAAM,CAAC,eAAe,aAAa,IAAI;AAAA,IACrC,CAAC,WAAW,cAAc;AAAA,IAC1B,OAAO;AAAA,EACT,EAAE,KAAK;AAEP,QAAM,eAGF;AAAA,IACF,CAAC,EAAE,WAAW,GAAG,MAAM,IAAI,CAAC,GAAG,MAAM,UAAU;AAAA,MAC7C;AAAA,MACA,WAAW,GAAG,kBAAkB,WAAW,aAAa;AAAA,MACxD;AAAA,MACA,UAAU,aAAa,OAAO,aAAa;AAAA,MAC3C,YAAY,aAAa,OAAO,aAAa;AAAA,MAC7C,GAAG;AAAA,MACH,GAAG;AAAA,IACL;AAAA,IACA,CAAC,eAAe,iBAAiB,UAAU,aAAa;AAAA,EAC1D;AAEA,SAAO,EAAE,aAAa;AACxB;","names":[]}
@@ -152,4 +152,4 @@ var valueToPercent = (value) => {
152
152
  export {
153
153
  useChartAxis
154
154
  };
155
- //# sourceMappingURL=chunk-YNJ423BR.mjs.map
155
+ //# sourceMappingURL=chunk-3EHZJFIA.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/use-chart-axis.ts"],"sourcesContent":["import type { CSSUIObject, PropGetter } 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 AreaChartType,\n LabelProps,\n} from \"./chart.types\"\nimport {\n labelProperties,\n xAxisProperties,\n yAxisProperties,\n} from \"./rechart-properties\"\n\nexport interface 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 interface UseChartAxisProps extends 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: PropGetter<\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: PropGetter<\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: PropGetter<\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: PropGetter<\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"],"mappings":";;;;;;;;;;;AACA,SAAS,gBAAgB;AAEzB,SAAS,UAAU;AAEnB,SAAS,aAAa,eAAe;AAoG9B,IAAM,eAAe,CAAC;AAAA,EAC3B;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb,WAAW;AAAA,EACX,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ;AAAA,EACA,qBAAqB,SAAS,aAAa,eAAe,eACtD,iBACA;AAAA,EACJ,qBAAqB,SAAS,aAAa,eAAe,aACtD,iBACA;AAAA,EACJ;AAAA,EACA,GAAG;AACL,MAAyB;AA5HzB;AA6HE,QAAM,EAAE,MAAM,IAAI,SAAS;AAC3B,QAAM,WAAgC;AAAA,IACpC,MAAO,eAAe,aAAa,EAAE,MAAM,SAAS,IAAI,EAAE,QAAQ;AAAA,IAClE,CAAC,SAAS,UAAU;AAAA,EACtB;AAEA,QAAM,WAAgC;AAAA,IACpC,MACE,eAAe,aACX,EAAE,SAAS,MAAM,WAAW,IAC5B,EAAE,MAAM,SAAS;AAAA,IACvB,CAAC,SAAS,UAAU;AAAA,EACtB;AACA,QAAM,gBACJ,aAAa,WAAW,aAAa,OAAO,aAAa;AAC3D,QAAM,gBACJ,aAAa,WAAW,aAAa,OAAO,aAAa;AAC3D,QAAM,cAAc,CAClB,iBAEA,eAAe,EAAE,QAAQ,eAAe,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AAW,GAAG,WAAW,cAAc;AAAA,MACvC,MAAM,CAAC;AAAA,MACP,UAAU;AAAA,MACV,GAAG;AAAA,MACH,UAAU;AAAA,MACV,MAAM;AAAA,QACJ,WAAW;AAAA,QACX,MAAM;AAAA,MACR;AAAA,MACA,eAAe;AAAA,MACf;AAAA,MACA,eAAe;AAAA,MACf,GAAG;AAAA,MACH,GAAI;AAAA,IACN;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,QAAM,qBAGF;AAAA,IACF,CAAC,EAAE,WAAW,GAAG,MAAM,IAAI,CAAC,OAAO;AAAA,MACjC,WAAW,GAAG,WAAW,mBAAmB;AAAA,MAC5C,OAAO;AAAA,MACP,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,GAAG;AAAA,MACH,GAAG;AAAA,IACL;AAAA,IACA,CAAC,YAAY,qBAAqB,eAAe;AAAA,EACnD;AAEA,QAAM,qBAGF;AAAA,IACF,CAAC,EAAE,WAAW,GAAG,MAAM,IAAI,CAAC,OAAO;AAAA,MACjC,WAAW,GAAG,WAAW,mBAAmB;AAAA,MAC5C,OAAO;AAAA,MACP,UAAU;AAAA,MACV,OAAO;AAAA,MACP,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,GAAG;AAAA,MACH,GAAG;AAAA,IACL;AAAA,IACA,CAAC,YAAY,qBAAqB,eAAe;AAAA,EACnD;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEA,IAAM,iBAAiB,CAAC,UAAe;AACrC,SAAO,IAAI,QAAQ,KAAK,QAAQ,CAAC,CAAC;AACpC;","names":[]}
@@ -228,10 +228,9 @@ var useLineChart = ({
228
228
  ]
229
229
  );
230
230
  const getLineProps = useCallback(
231
- ({ index, className: classNameProp, ...props }, ref = null) => {
231
+ ({ index, className: classNameProp, ...props }) => {
232
232
  const { color, className, dataKey, activeDot: activeDot2, dot: dot2, ...rest2 } = linePropList[index];
233
233
  return {
234
- ref,
235
234
  className: cx(classNameProp, className),
236
235
  activeDot: activeDot2,
237
236
  dot: dot2,
@@ -260,4 +259,4 @@ var useLineChart = ({
260
259
  export {
261
260
  useLineChart
262
261
  };
263
- //# sourceMappingURL=chunk-FPFCMFCJ.mjs.map
262
+ //# sourceMappingURL=chunk-4TQ4VOYH.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/use-line-chart.ts"],"sourcesContent":["import { getVar, useTheme } from \"@yamada-ui/core\"\nimport type {\n CSSUIObject,\n CSSUIProps,\n PropGetter,\n RequiredPropGetter,\n} from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport type { ComponentPropsWithoutRef } from \"react\"\nimport { useCallback, useMemo, useState } from \"react\"\nimport type * as Recharts from \"recharts\"\nimport { getComponentProps } from \"./chart-utils\"\nimport type {\n ChartLayoutType,\n LineProps,\n LineChartProps,\n ReferenceLineProps,\n ChartCurveType,\n} from \"./chart.types\"\nimport {\n dotProperties,\n lineChartProperties,\n lineProperties,\n} from \"./rechart-properties\"\n\nexport interface UseLineChartOptions {\n /**\n * Chart data.\n */\n data: Dict[]\n /**\n * An array of objects with `dataKey` and `color` keys. Determines which data should be consumed from the `data` array.\n */\n series: LineProps[]\n /**\n * Props for the lines.\n */\n lineProps?: Partial<LineProps>\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 `LineChart` component.\n */\n chartProps?: LineChartProps\n /**\n * Chart orientation.\n *\n * @default 'horizontal'\n */\n layoutType?: ChartLayoutType\n /**\n * Determines whether dots should be displayed.\n *\n * @default true\n */\n withDots?: boolean\n /**\n * Determines whether activeDots should be displayed.\n *\n * @default true\n */\n withActiveDots?: boolean\n /**\n * Type of the curve.\n *\n * @default `monotone`\n */\n curveType?: ChartCurveType\n /**\n * Stroke width for the chart lines.\n *\n * @default 2\n */\n strokeWidth?: number\n /**\n * Determines whether points with `null` values should be connected.\n *\n * @default true\n */\n connectNulls?: boolean\n /**\n * Reference lines that should be displayed on the chart.\n */\n referenceLineProps?: ReferenceLineProps[]\n /**\n * Controls fill opacity of all lines.\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\ninterface UseLineChartProps extends UseLineChartOptions {\n styles: Dict<CSSUIObject>\n}\n\nexport const useLineChart = ({\n data,\n series,\n layoutType = \"horizontal\",\n withDots = true,\n withActiveDots = true,\n curveType = \"monotone\",\n strokeWidth = 2,\n connectNulls = true,\n referenceLineProps,\n fillOpacity = 1,\n syncId,\n xAxisLabel,\n yAxisLabel,\n styles,\n ...rest\n}: UseLineChartProps) => {\n const { theme } = useTheme()\n const [highlightedArea, setHighlightedArea] = useState<string | null>(null)\n const shouldHighlight = highlightedArea !== null\n const {\n dot = {},\n activeDot = {},\n dimDot = {},\n dimLine = {},\n ...computedLineProps\n } = rest.lineProps ?? {}\n\n const lineColors: CSSUIProps[\"vars\"] = useMemo(\n () =>\n series.map(({ color }, index) => ({\n name: `line-${index}`,\n token: \"colors\",\n value: color ?? \"transparent\",\n })),\n [series],\n )\n\n const referenceLineColors: CSSUIProps[\"vars\"] = useMemo(\n () =>\n referenceLineProps\n ? referenceLineProps.map(({ color }, index) => ({\n name: `reference-line-${index}`,\n token: \"colors\",\n value: color ?? \"transparent\",\n }))\n : [],\n [referenceLineProps],\n )\n\n const lineVars: CSSUIProps[\"vars\"] = useMemo(\n () => [\n ...lineColors,\n ...referenceLineColors,\n { name: \"fill-opacity\", value: fillOpacity },\n ],\n [fillOpacity, lineColors, referenceLineColors],\n )\n\n const [chartProps, lineChartClassName] = useMemo(\n () =>\n getComponentProps<Dict, string>(\n [rest.chartProps ?? {}, lineChartProperties],\n styles.chart,\n )(theme),\n [rest.chartProps, styles.chart, theme],\n )\n\n const [lineProps, lineClassName] = useMemo(() => {\n const resolvedLineProps = {\n fillOpacity: \"$fill-opacity\",\n strokeOpacity: \"$fill-opacity\",\n ...computedLineProps,\n }\n\n return getComponentProps<Dict, string>(\n [resolvedLineProps, lineProperties],\n styles.line,\n )(theme)\n }, [computedLineProps, styles.line, theme])\n\n const [dimLineProps, dimLineClassName] = useMemo(\n () =>\n getComponentProps<Dict, string>(\n [dimLine, lineProperties],\n styles.dimLine,\n )(theme),\n [dimLine, styles.dimLine, theme],\n )\n\n const [dotProps, dotClassName] = useMemo(\n () =>\n getComponentProps<Dict, string>([dot, dotProperties], styles.dot)(theme),\n [dot, styles.dot, theme],\n )\n\n const [activeDotProps, activeDotClassName] = useMemo(\n () =>\n getComponentProps<Dict, string>(\n [activeDot, dotProperties],\n styles.activeDot,\n )(theme),\n [activeDot, styles.activeDot, theme],\n )\n\n const [dimDotProps, dimDotClassName] = useMemo(\n () =>\n getComponentProps<Dict, string>(\n [dimDot, dotProperties],\n styles.dimDot,\n )(theme),\n [dimDot, styles.dimDot, theme],\n )\n\n const linePropList = useMemo(\n () =>\n series.map((props, index) => {\n const {\n dataKey,\n dot = {},\n activeDot = {},\n dimDot = {},\n dimLine = {},\n ...computedProps\n } = props\n const color = getVar(`line-${index}`)(theme)\n const dimmed = shouldHighlight && highlightedArea !== dataKey\n const computedDimLine = { ...dimLineProps, ...dimLine }\n const resolvedProps = {\n ...lineProps,\n ...computedProps,\n ...(dimmed ? computedDimLine : {}),\n }\n\n const rest = getComponentProps<Dict, string>(\n [resolvedProps, lineProperties],\n lineClassName,\n dimmed ? dimLineClassName : undefined,\n )(theme, true)\n\n let resolvedActiveDot: Recharts.DotProps | boolean\n\n if (withActiveDots) {\n const computedActiveDot = { ...activeDotProps, ...activeDot }\n\n const [rest, className] = getComponentProps(\n [computedActiveDot, dotProperties],\n activeDotClassName,\n )(theme)\n\n resolvedActiveDot = {\n className: cx(\n \"ui-line-chart__dot\",\n \"ui-line-chart__dot--active\",\n className,\n ),\n fill: color,\n stroke: color,\n r: 4,\n ...rest,\n } as Recharts.DotProps\n } else {\n resolvedActiveDot = false\n }\n\n let resolvedDot: Recharts.DotProps | boolean\n\n if (withDots) {\n const computedDimDot = { ...dimDotProps, ...dimDot }\n const computedDot = {\n ...dotProps,\n ...dot,\n ...(dimmed ? computedDimDot : {}),\n }\n\n const [rest, className] = getComponentProps(\n [computedDot, dotProperties],\n dotClassName,\n dimmed ? dimDotClassName : undefined,\n )(theme)\n\n resolvedDot = {\n className: cx(\"ui-line-chart__dot\", className),\n fill: color,\n ...rest,\n } as Recharts.DotProps\n } else {\n resolvedDot = false\n }\n\n return {\n ...rest,\n color,\n dataKey,\n activeDot: resolvedActiveDot,\n dot: resolvedDot,\n }\n }),\n [\n series,\n shouldHighlight,\n highlightedArea,\n dimLineProps,\n lineProps,\n lineClassName,\n dimLineClassName,\n theme,\n withActiveDots,\n withDots,\n activeDotProps,\n activeDotClassName,\n dimDotProps,\n dotProps,\n dotClassName,\n dimDotClassName,\n ],\n )\n\n const getLineChartProps: PropGetter<\n ComponentPropsWithoutRef<typeof Recharts.LineChart>,\n ComponentPropsWithoutRef<typeof Recharts.LineChart>\n > = useCallback(\n ({ className, ...props } = {}, ref = null) => ({\n ref,\n className: cx(className, lineChartClassName),\n data,\n layout: layoutType,\n 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 lineChartClassName,\n data,\n layoutType,\n syncId,\n xAxisLabel,\n yAxisLabel,\n chartProps,\n ],\n )\n\n const getLineProps: RequiredPropGetter<\n Partial<Recharts.LineProps> & { index: number },\n Omit<Recharts.LineProps, \"ref\">\n > = useCallback(\n ({ index, className: classNameProp, ...props }) => {\n const { color, className, dataKey, activeDot, dot, ...rest } =\n linePropList[index]\n\n return {\n className: cx(classNameProp, className),\n activeDot,\n dot,\n name: dataKey as string,\n type: curveType,\n dataKey,\n fill: color,\n strokeWidth,\n stroke: color,\n isAnimationActive: false,\n connectNulls,\n ...(props as Omit<Recharts.LineProps, \"dataKey\">),\n ...rest,\n }\n },\n [connectNulls, curveType, linePropList, strokeWidth],\n )\n\n return {\n getLineProps,\n getLineChartProps,\n lineVars,\n setHighlightedArea,\n }\n}\n\nexport type UseLineChartReturn = ReturnType<typeof useLineChart>\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,QAAQ,gBAAgB;AAOjC,SAAS,UAAU;AAGnB,SAAS,aAAa,SAAS,gBAAgB;AAkGxC,IAAM,eAAe,CAAC;AAAA,EAC3B;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,eAAe;AAAA,EACf;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAyB;AA5HzB;AA6HE,QAAM,EAAE,MAAM,IAAI,SAAS;AAC3B,QAAM,CAAC,iBAAiB,kBAAkB,IAAI,SAAwB,IAAI;AAC1E,QAAM,kBAAkB,oBAAoB;AAC5C,QAAM;AAAA,IACJ,MAAM,CAAC;AAAA,IACP,YAAY,CAAC;AAAA,IACb,SAAS,CAAC;AAAA,IACV,UAAU,CAAC;AAAA,IACX,GAAG;AAAA,EACL,KAAI,UAAK,cAAL,YAAkB,CAAC;AAEvB,QAAM,aAAiC;AAAA,IACrC,MACE,OAAO,IAAI,CAAC,EAAE,MAAM,GAAG,WAAW;AAAA,MAChC,MAAM,QAAQ,KAAK;AAAA,MACnB,OAAO;AAAA,MACP,OAAO,wBAAS;AAAA,IAClB,EAAE;AAAA,IACJ,CAAC,MAAM;AAAA,EACT;AAEA,QAAM,sBAA0C;AAAA,IAC9C,MACE,qBACI,mBAAmB,IAAI,CAAC,EAA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AAAA,IACL;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,QAAM,eAGF;AAAA,IACF,CAAC,EAAE,OAAO,WAAW,eAAe,GAAG,MAAM,MAAM;AACjD,YAAM,EAAE,OAAO,WAAW,SAAS,WAAAH,YAAW,KAAAD,MAAK,GAAGI,MAAK,IACzD,aAAa,KAAK;AAEpB,aAAO;AAAA,QACL,WAAW,GAAG,eAAe,SAAS;AAAA,QACtC,WAAAH;AAAA,QACA,KAAAD;AAAA,QACA,MAAM;AAAA,QACN,MAAM;AAAA,QACN;AAAA,QACA,MAAM;AAAA,QACN;AAAA,QACA,QAAQ;AAAA,QACR,mBAAmB;AAAA,QACnB;AAAA,QACA,GAAI;AAAA,QACJ,GAAGI;AAAA,MACL;AAAA,IACF;AAAA,IACA,CAAC,cAAc,WAAW,cAAc,WAAW;AAAA,EACrD;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["_a","dot","activeDot","dimDot","dimLine","rest"]}
@@ -1,38 +1,38 @@
1
1
  "use client"
2
2
  import {
3
3
  useLineChart
4
- } from "./chunk-FPFCMFCJ.mjs";
4
+ } from "./chunk-4TQ4VOYH.mjs";
5
5
  import {
6
6
  useChartAxis
7
- } from "./chunk-YNJ423BR.mjs";
7
+ } from "./chunk-3EHZJFIA.mjs";
8
8
  import {
9
9
  useChartGrid
10
- } from "./chunk-PPBHLDVN.mjs";
10
+ } from "./chunk-2GQHI23M.mjs";
11
11
  import {
12
12
  useChartReferenceLine
13
- } from "./chunk-JTQ5QCML.mjs";
13
+ } from "./chunk-FYAC4RRZ.mjs";
14
14
  import {
15
15
  useChartTooltip
16
- } from "./chunk-VMBRDEM2.mjs";
16
+ } from "./chunk-OJ2MLZZ7.mjs";
17
17
  import {
18
18
  useChartLegend
19
- } from "./chunk-TCSYDMC7.mjs";
19
+ } from "./chunk-IJRYXT4V.mjs";
20
20
  import {
21
21
  ChartLegend
22
- } from "./chunk-EL2VTGFB.mjs";
22
+ } from "./chunk-LLOU2WIV.mjs";
23
23
  import {
24
24
  ChartTooltip
25
- } from "./chunk-T5DNDBW6.mjs";
25
+ } from "./chunk-UANITMH7.mjs";
26
26
  import {
27
27
  ChartProvider,
28
28
  useChart
29
- } from "./chunk-3AOICU4Q.mjs";
29
+ } from "./chunk-A3IWA366.mjs";
30
30
 
31
31
  // src/line-chart.tsx
32
32
  import {
33
33
  ui,
34
34
  forwardRef,
35
- useMultiComponentStyle,
35
+ useComponentMultiStyle,
36
36
  omitThemeProps
37
37
  } from "@yamada-ui/core";
38
38
  import { cx } from "@yamada-ui/utils";
@@ -51,7 +51,7 @@ import {
51
51
  } from "recharts";
52
52
  import { jsx, jsxs } from "react/jsx-runtime";
53
53
  var LineChart = forwardRef((props, ref) => {
54
- const [styles, mergedProps] = useMultiComponentStyle("LineChart", props);
54
+ const [styles, mergedProps] = useComponentMultiStyle("LineChart", props);
55
55
  const {
56
56
  className,
57
57
  containerProps,
@@ -263,4 +263,4 @@ var LineChart = forwardRef((props, ref) => {
263
263
  export {
264
264
  LineChart
265
265
  };
266
- //# sourceMappingURL=chunk-BYL7HWNN.mjs.map
266
+ //# sourceMappingURL=chunk-5A6462N5.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/line-chart.tsx"],"sourcesContent":["import type { HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n useComponentMultiStyle,\n omitThemeProps,\n} from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useMemo } from \"react\"\nimport {\n LineChart as ReChartsLineChart,\n Legend,\n CartesianGrid,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n ReferenceLine,\n Line,\n Label,\n} from \"recharts\"\nimport { ChartLegend } from \"./chart-legend\"\nimport { ChartTooltip } from \"./chart-tooltip\"\nimport type { UseChartProps } from \"./use-chart\"\nimport { ChartProvider, useChart } from \"./use-chart\"\nimport type { UseChartAxisOptions } from \"./use-chart-axis\"\nimport { useChartAxis } from \"./use-chart-axis\"\nimport type { UseChartGridOptions } from \"./use-chart-grid\"\nimport { useChartGrid } from \"./use-chart-grid\"\nimport type { UseChartLegendProps } from \"./use-chart-legend\"\nimport { useChartLegend } from \"./use-chart-legend\"\nimport type { UseChartReferenceLineOptions } from \"./use-chart-reference-line\"\nimport { useChartReferenceLine } from \"./use-chart-reference-line\"\nimport { useChartTooltip } from \"./use-chart-tooltip\"\nimport type { UseChartTooltipOptions } from \"./use-chart-tooltip\"\nimport { useLineChart } from \"./use-line-chart\"\nimport type { UseLineChartOptions } from \"./use-line-chart\"\n\ninterface LineChartOptions {\n /**\n * If `true`, tooltip is visible.\n *\n * @default true\n */\n withTooltip?: boolean\n /**\n * If `true`, legend is visible.\n *\n * @default false\n */\n withLegend?: boolean\n}\n\nexport interface LineChartProps\n extends Omit<HTMLUIProps, \"strokeWidth\" | \"fillOpacity\" | \"strokeDasharray\">,\n ThemeProps<\"LineChart\">,\n LineChartOptions,\n UseChartProps,\n UseChartAxisOptions,\n UseChartReferenceLineOptions,\n UseChartGridOptions,\n UseChartTooltipOptions,\n UseChartLegendProps,\n UseLineChartOptions {}\n\n/**\n * `LineChart` is a component for drawing line charts to compare multiple sets of data.\n *\n * @see Docs https://yamada-ui.com/components/data-display/line-chart\n */\nexport const LineChart = forwardRef<LineChartProps, \"div\">((props, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"LineChart\", props)\n const {\n className,\n containerProps,\n gridProps,\n gridAxis,\n strokeDasharray,\n dataKey,\n type,\n layoutType,\n tickLine,\n withXAxis,\n withYAxis,\n xAxisProps,\n yAxisProps,\n xAxisLabel,\n yAxisLabel,\n xAxisLabelProps,\n yAxisLabelProps,\n unit,\n yAxisTickFormatter,\n xAxisTickFormatter,\n valueFormatter,\n labelFormatter,\n referenceLineProps,\n tooltipProps,\n tooltipAnimationDuration,\n legendProps,\n withLegend = false,\n withTooltip = true,\n series,\n data,\n chartProps,\n lineProps,\n withDots,\n withActiveDots,\n curveType,\n strokeWidth,\n connectNulls,\n fillOpacity,\n syncId,\n ...rest\n } = omitThemeProps(mergedProps)\n\n const { getLineProps, getLineChartProps, lineVars, setHighlightedArea } =\n useLineChart({\n layoutType,\n series,\n referenceLineProps,\n data,\n chartProps,\n lineProps,\n withDots,\n withActiveDots,\n curveType,\n strokeWidth,\n connectNulls,\n fillOpacity,\n syncId,\n xAxisLabel,\n yAxisLabel,\n styles,\n })\n const { getContainerProps } = useChart({ containerProps })\n const {\n getXAxisProps,\n getYAxisProps,\n getXAxisLabelProps,\n getYAxisLabelProps,\n } = useChartAxis({\n dataKey,\n type,\n layoutType,\n tickLine,\n gridAxis,\n withXAxis,\n withYAxis,\n xAxisProps,\n yAxisProps,\n xAxisLabel,\n yAxisLabel,\n xAxisLabelProps,\n yAxisLabelProps,\n unit,\n yAxisTickFormatter,\n xAxisTickFormatter,\n styles,\n })\n const { getReferenceLineProps } = useChartReferenceLine({\n referenceLineProps,\n styles,\n })\n const { getGridProps } = useChartGrid({\n gridProps,\n gridAxis,\n strokeDasharray,\n styles,\n })\n const { tooltipProps: computedTooltipProps, getTooltipProps } =\n useChartTooltip({\n tooltipProps,\n tooltipAnimationDuration,\n styles,\n })\n const { legendProps: computedLegendProps, getLegendProps } = useChartLegend({\n legendProps,\n })\n\n const lines = useMemo(\n () =>\n series.map(({ dataKey }, index) => (\n <Line\n key={`line-${dataKey}`}\n {...getLineProps({ index, className: \"ui-line-chart__line\" })}\n />\n )),\n [getLineProps, series],\n )\n\n const referenceLinesItems = useMemo(\n () =>\n referenceLineProps?.map((_, index) => (\n <ReferenceLine\n key={`referenceLine-${index}`}\n {...getReferenceLineProps({\n index,\n className: \"ui-line-chart__reference-line\",\n })}\n />\n )),\n [getReferenceLineProps, referenceLineProps],\n )\n\n return (\n <ChartProvider value={{ styles }}>\n <ui.div\n ref={ref}\n className={cx(\"ui-line-chart\", className)}\n __css={{ maxW: \"full\", vars: lineVars, ...styles.container }}\n {...rest}\n >\n <ResponsiveContainer\n {...getContainerProps({ className: \"ui-line-chart__container\" })}\n >\n <ReChartsLineChart\n {...getLineChartProps({ className: \"ui-line-chart__chart\" })}\n >\n <CartesianGrid\n {...getGridProps({ className: \"ui-line-chart__grid\" })}\n />\n\n <XAxis {...getXAxisProps({ className: \"ui-line-chart__x-axis\" })}>\n <Label\n {...getXAxisLabelProps({\n className: \"ui-line-chart__x-axis-label\",\n })}\n />\n </XAxis>\n\n <YAxis {...getYAxisProps({ className: \"ui-line-chart__y-axis\" })}>\n <Label\n {...getYAxisLabelProps({\n className: \"ui-line-chart__y-axis-label\",\n })}\n />\n </YAxis>\n\n {withLegend ? (\n <Legend\n content={({ payload }) => (\n <ChartLegend\n className=\"ui-line-chart__legend\"\n payload={payload}\n onHighlight={setHighlightedArea}\n {...computedLegendProps}\n />\n )}\n {...getLegendProps()}\n />\n ) : null}\n\n {withTooltip ? (\n <Tooltip\n content={({ label, payload }) => (\n <ChartTooltip\n className=\"ui-line-chart__tooltip\"\n label={label}\n payload={payload}\n valueFormatter={valueFormatter}\n labelFormatter={labelFormatter}\n unit={unit}\n {...computedTooltipProps}\n />\n )}\n {...getTooltipProps()}\n />\n ) : null}\n\n {lines}\n {referenceLinesItems}\n </ReChartsLineChart>\n </ResponsiveContainer>\n </ui.div>\n </ChartProvider>\n )\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,UAAU;AACnB,SAAS,eAAe;AACxB;AAAA,EACE,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAkKC,cAiCE,YAjCF;AAhHD,IAAM,YAAY,WAAk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aAAa,EAAE,WAAW,sBAAsB,CAAC;AAAA;AAAA,gBACvD;AAAA,gBAEA,oBAAC,SAAO,GAAG,cAAc,EAAE,WAAW,wBAAwB,CAAC,GAC7D;AAAA,kBAAC;AAAA;AAAA,oBACE,GAAG,mBAAmB;AAAA,sBACrB,WAAW;AAAA,oBACb,CAAC;AAAA;AAAA,gBACH,GACF;AAAA,gBAEA,oBAAC,SAAO,GAAG,cAAc,EAAE,WAAW,wBAAwB,CAAC,GAC7D;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":["dataKey"]}
@@ -53,4 +53,4 @@ export {
53
53
  useLegend,
54
54
  useTooltip
55
55
  };
56
- //# sourceMappingURL=chunk-3AOICU4Q.mjs.map
56
+ //# sourceMappingURL=chunk-A3IWA366.mjs.map