@yamada-ui/charts 1.1.2 → 1.1.3

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 (197) hide show
  1. package/dist/area-chart-gradient.d.mts +11 -0
  2. package/dist/area-chart-gradient.d.ts +11 -0
  3. package/dist/area-chart-gradient.js +47 -0
  4. package/dist/area-chart-gradient.js.map +1 -0
  5. package/dist/area-chart-gradient.mjs +8 -0
  6. package/dist/area-chart-gradient.mjs.map +1 -0
  7. package/dist/area-chart-split.d.mts +10 -0
  8. package/dist/area-chart-split.d.ts +10 -0
  9. package/dist/area-chart-split.js +52 -0
  10. package/dist/area-chart-split.js.map +1 -0
  11. package/dist/area-chart-split.mjs +8 -0
  12. package/dist/area-chart-split.mjs.map +1 -0
  13. package/dist/area-chart.d.mts +41 -0
  14. package/dist/area-chart.d.ts +41 -0
  15. package/dist/area-chart.js +1223 -0
  16. package/dist/area-chart.js.map +1 -0
  17. package/dist/area-chart.mjs +21 -0
  18. package/dist/area-chart.mjs.map +1 -0
  19. package/dist/bar-chart.d.mts +38 -0
  20. package/dist/bar-chart.d.ts +38 -0
  21. package/dist/bar-chart.js +1027 -0
  22. package/dist/bar-chart.js.map +1 -0
  23. package/dist/bar-chart.mjs +19 -0
  24. package/dist/bar-chart.mjs.map +1 -0
  25. package/dist/chart-legend.d.mts +12 -0
  26. package/dist/chart-legend.d.ts +12 -0
  27. package/dist/chart-legend.js +90 -0
  28. package/dist/chart-legend.js.map +1 -0
  29. package/dist/chart-legend.mjs +11 -0
  30. package/dist/chart-legend.mjs.map +1 -0
  31. package/dist/chart-tooltip.d.mts +12 -0
  32. package/dist/chart-tooltip.d.ts +12 -0
  33. package/dist/chart-tooltip.js +121 -0
  34. package/dist/chart-tooltip.js.map +1 -0
  35. package/dist/chart-tooltip.mjs +11 -0
  36. package/dist/chart-tooltip.mjs.map +1 -0
  37. package/dist/chart-utils.d.mts +9 -0
  38. package/dist/chart-utils.d.ts +9 -0
  39. package/dist/chart-utils.js +45 -0
  40. package/dist/chart-utils.js.map +1 -0
  41. package/dist/chart-utils.mjs +10 -0
  42. package/dist/chart-utils.mjs.map +1 -0
  43. package/dist/chart.types.d.mts +78 -0
  44. package/dist/chart.types.d.ts +78 -0
  45. package/dist/chart.types.js +20 -0
  46. package/dist/chart.types.js.map +1 -0
  47. package/dist/chart.types.mjs +2 -0
  48. package/dist/chart.types.mjs.map +1 -0
  49. package/dist/chunk-4WX5YS7M.mjs +179 -0
  50. package/dist/chunk-4WX5YS7M.mjs.map +1 -0
  51. package/dist/chunk-5TVYPA64.mjs +256 -0
  52. package/dist/chunk-5TVYPA64.mjs.map +1 -0
  53. package/dist/chunk-BPR7YL3O.mjs +179 -0
  54. package/dist/chunk-BPR7YL3O.mjs.map +1 -0
  55. package/dist/chunk-E2I2XAZ6.mjs +232 -0
  56. package/dist/chunk-E2I2XAZ6.mjs.map +1 -0
  57. package/dist/chunk-HDOYOHLA.mjs +326 -0
  58. package/dist/chunk-HDOYOHLA.mjs.map +1 -0
  59. package/dist/chunk-KNAADLWO.mjs +225 -0
  60. package/dist/chunk-KNAADLWO.mjs.map +1 -0
  61. package/dist/chunk-KT4YOMM4.mjs +344 -0
  62. package/dist/chunk-KT4YOMM4.mjs.map +1 -0
  63. package/dist/chunk-LBC2B6UX.mjs +84 -0
  64. package/dist/chunk-LBC2B6UX.mjs.map +1 -0
  65. package/dist/chunk-LGMALZCN.mjs +42 -0
  66. package/dist/chunk-LGMALZCN.mjs.map +1 -0
  67. package/dist/chunk-LHI57S6P.mjs +215 -0
  68. package/dist/chunk-LHI57S6P.mjs.map +1 -0
  69. package/dist/chunk-LM2DQK2P.mjs +33 -0
  70. package/dist/chunk-LM2DQK2P.mjs.map +1 -0
  71. package/dist/chunk-MSIOYYWR.mjs +24 -0
  72. package/dist/chunk-MSIOYYWR.mjs.map +1 -0
  73. package/dist/chunk-MWPICUEW.mjs +56 -0
  74. package/dist/chunk-MWPICUEW.mjs.map +1 -0
  75. package/dist/chunk-NEGDEVRX.mjs +53 -0
  76. package/dist/chunk-NEGDEVRX.mjs.map +1 -0
  77. package/dist/chunk-OSNFBRHL.mjs +474 -0
  78. package/dist/chunk-OSNFBRHL.mjs.map +1 -0
  79. package/dist/chunk-OW7SOTEF.mjs +206 -0
  80. package/dist/chunk-OW7SOTEF.mjs.map +1 -0
  81. package/dist/chunk-P7AFSM5W.mjs +114 -0
  82. package/dist/chunk-P7AFSM5W.mjs.map +1 -0
  83. package/dist/chunk-PNE3JG54.mjs +29 -0
  84. package/dist/chunk-PNE3JG54.mjs.map +1 -0
  85. package/dist/chunk-QL3DB7OJ.mjs +21 -0
  86. package/dist/chunk-QL3DB7OJ.mjs.map +1 -0
  87. package/dist/chunk-QZ5OXZ6Z.mjs +251 -0
  88. package/dist/chunk-QZ5OXZ6Z.mjs.map +1 -0
  89. package/dist/chunk-RN6PXJAD.mjs +47 -0
  90. package/dist/chunk-RN6PXJAD.mjs.map +1 -0
  91. package/dist/chunk-STBYRLC5.mjs +208 -0
  92. package/dist/chunk-STBYRLC5.mjs.map +1 -0
  93. package/dist/chunk-XIFDRM7J.mjs +56 -0
  94. package/dist/chunk-XIFDRM7J.mjs.map +1 -0
  95. package/dist/donut-chart.d.mts +31 -0
  96. package/dist/donut-chart.d.ts +31 -0
  97. package/dist/donut-chart.js +702 -0
  98. package/dist/donut-chart.js.map +1 -0
  99. package/dist/donut-chart.mjs +16 -0
  100. package/dist/donut-chart.mjs.map +1 -0
  101. package/dist/index.d.mts +26 -0
  102. package/dist/index.d.ts +26 -0
  103. package/dist/index.js +3228 -0
  104. package/dist/index.js.map +1 -0
  105. package/dist/index.mjs +45 -0
  106. package/dist/index.mjs.map +1 -0
  107. package/dist/line-chart.d.mts +38 -0
  108. package/dist/line-chart.d.ts +38 -0
  109. package/dist/line-chart.js +1088 -0
  110. package/dist/line-chart.js.map +1 -0
  111. package/dist/line-chart.mjs +19 -0
  112. package/dist/line-chart.mjs.map +1 -0
  113. package/dist/pie-chart.d.mts +49 -0
  114. package/dist/pie-chart.d.ts +49 -0
  115. package/dist/pie-chart.js +702 -0
  116. package/dist/pie-chart.js.map +1 -0
  117. package/dist/pie-chart.mjs +16 -0
  118. package/dist/pie-chart.mjs.map +1 -0
  119. package/dist/radar-chart.d.mts +57 -0
  120. package/dist/radar-chart.d.ts +57 -0
  121. package/dist/radar-chart.js +918 -0
  122. package/dist/radar-chart.js.map +1 -0
  123. package/dist/radar-chart.mjs +16 -0
  124. package/dist/radar-chart.mjs.map +1 -0
  125. package/dist/rechart-properties.d.mts +26 -0
  126. package/dist/rechart-properties.d.ts +26 -0
  127. package/dist/rechart-properties.js +517 -0
  128. package/dist/rechart-properties.js.map +1 -0
  129. package/dist/rechart-properties.mjs +48 -0
  130. package/dist/rechart-properties.mjs.map +1 -0
  131. package/dist/use-area-chart.d.mts +123 -0
  132. package/dist/use-area-chart.d.ts +123 -0
  133. package/dist/use-area-chart.js +420 -0
  134. package/dist/use-area-chart.js.map +1 -0
  135. package/dist/use-area-chart.mjs +10 -0
  136. package/dist/use-area-chart.mjs.map +1 -0
  137. package/dist/use-bar-chart.d.mts +73 -0
  138. package/dist/use-bar-chart.d.ts +73 -0
  139. package/dist/use-bar-chart.js +290 -0
  140. package/dist/use-bar-chart.js.map +1 -0
  141. package/dist/use-bar-chart.mjs +10 -0
  142. package/dist/use-bar-chart.mjs.map +1 -0
  143. package/dist/use-chart-axis.d.mts +73 -0
  144. package/dist/use-chart-axis.d.ts +73 -0
  145. package/dist/use-chart-axis.js +227 -0
  146. package/dist/use-chart-axis.js.map +1 -0
  147. package/dist/use-chart-axis.mjs +10 -0
  148. package/dist/use-chart-axis.mjs.map +1 -0
  149. package/dist/use-chart-grid.d.mts +32 -0
  150. package/dist/use-chart-grid.d.ts +32 -0
  151. package/dist/use-chart-grid.js +92 -0
  152. package/dist/use-chart-grid.js.map +1 -0
  153. package/dist/use-chart-grid.mjs +10 -0
  154. package/dist/use-chart-grid.mjs.map +1 -0
  155. package/dist/use-chart-legend.d.mts +18 -0
  156. package/dist/use-chart-legend.d.ts +18 -0
  157. package/dist/use-chart-legend.js +81 -0
  158. package/dist/use-chart-legend.js.map +1 -0
  159. package/dist/use-chart-legend.mjs +9 -0
  160. package/dist/use-chart-legend.mjs.map +1 -0
  161. package/dist/use-chart-reference-line.d.mts +22 -0
  162. package/dist/use-chart-reference-line.d.ts +22 -0
  163. package/dist/use-chart-reference-line.js +105 -0
  164. package/dist/use-chart-reference-line.js.map +1 -0
  165. package/dist/use-chart-reference-line.mjs +10 -0
  166. package/dist/use-chart-reference-line.mjs.map +1 -0
  167. package/dist/use-chart-tooltip.d.mts +27 -0
  168. package/dist/use-chart-tooltip.d.ts +27 -0
  169. package/dist/use-chart-tooltip.js +100 -0
  170. package/dist/use-chart-tooltip.js.map +1 -0
  171. package/dist/use-chart-tooltip.mjs +10 -0
  172. package/dist/use-chart-tooltip.mjs.map +1 -0
  173. package/dist/use-chart.d.mts +33 -0
  174. package/dist/use-chart.d.ts +33 -0
  175. package/dist/use-chart.js +104 -0
  176. package/dist/use-chart.js.map +1 -0
  177. package/dist/use-chart.mjs +18 -0
  178. package/dist/use-chart.mjs.map +1 -0
  179. package/dist/use-line-chart.d.mts +97 -0
  180. package/dist/use-line-chart.d.ts +97 -0
  181. package/dist/use-line-chart.js +344 -0
  182. package/dist/use-line-chart.js.map +1 -0
  183. package/dist/use-line-chart.mjs +10 -0
  184. package/dist/use-line-chart.mjs.map +1 -0
  185. package/dist/use-pie-chart.d.mts +112 -0
  186. package/dist/use-pie-chart.d.ts +112 -0
  187. package/dist/use-pie-chart.js +282 -0
  188. package/dist/use-pie-chart.js.map +1 -0
  189. package/dist/use-pie-chart.mjs +10 -0
  190. package/dist/use-pie-chart.mjs.map +1 -0
  191. package/dist/use-radar-chart.d.mts +105 -0
  192. package/dist/use-radar-chart.d.ts +105 -0
  193. package/dist/use-radar-chart.js +473 -0
  194. package/dist/use-radar-chart.js.map +1 -0
  195. package/dist/use-radar-chart.mjs +10 -0
  196. package/dist/use-radar-chart.mjs.map +1 -0
  197. package/package.json +1 -1
@@ -0,0 +1,18 @@
1
+ import { Dict } from '@yamada-ui/utils';
2
+ import * as Recharts from 'recharts';
3
+ import { LegendProps, ChartPropGetter } from './chart.types.mjs';
4
+ import '@yamada-ui/core';
5
+ import 'react';
6
+
7
+ type UseChartLegendProps = {
8
+ /**
9
+ * Props passed down to recharts 'Legend' component.
10
+ */
11
+ legendProps?: LegendProps;
12
+ };
13
+ declare const useChartLegend: ({ legendProps: _legendProps, }: UseChartLegendProps) => {
14
+ legendProps: Omit<Dict, string>;
15
+ getLegendProps: ChartPropGetter<"div", Partial<Recharts.LegendProps>, Omit<Recharts.LegendProps, "ref">>;
16
+ };
17
+
18
+ export { type UseChartLegendProps, useChartLegend };
@@ -0,0 +1,18 @@
1
+ import { Dict } from '@yamada-ui/utils';
2
+ import * as Recharts from 'recharts';
3
+ import { LegendProps, ChartPropGetter } from './chart.types.js';
4
+ import '@yamada-ui/core';
5
+ import 'react';
6
+
7
+ type UseChartLegendProps = {
8
+ /**
9
+ * Props passed down to recharts 'Legend' component.
10
+ */
11
+ legendProps?: LegendProps;
12
+ };
13
+ declare const useChartLegend: ({ legendProps: _legendProps, }: UseChartLegendProps) => {
14
+ legendProps: Omit<Dict, string>;
15
+ getLegendProps: ChartPropGetter<"div", Partial<Recharts.LegendProps>, Omit<Recharts.LegendProps, "ref">>;
16
+ };
17
+
18
+ export { type UseChartLegendProps, useChartLegend };
@@ -0,0 +1,81 @@
1
+ "use client"
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/use-chart-legend.ts
22
+ var use_chart_legend_exports = {};
23
+ __export(use_chart_legend_exports, {
24
+ useChartLegend: () => useChartLegend
25
+ });
26
+ module.exports = __toCommonJS(use_chart_legend_exports);
27
+ var import_utils = require("@yamada-ui/utils");
28
+ var import_react = require("react");
29
+
30
+ // src/rechart-properties.ts
31
+ var legendProperties = [
32
+ "width",
33
+ "height",
34
+ "layout",
35
+ "align",
36
+ "verticalAlign",
37
+ "iconSize",
38
+ "iconType",
39
+ "payload",
40
+ "chartWidth",
41
+ "chartHeight",
42
+ "margin",
43
+ "content",
44
+ "formatter",
45
+ "wrapperStyle",
46
+ "onClick",
47
+ "onMouseDown",
48
+ "onMouseUp",
49
+ "onMouseMove",
50
+ "onMouseOver",
51
+ "onMouseOut",
52
+ "onMouseEnter",
53
+ "onMouseLeave"
54
+ ];
55
+
56
+ // src/use-chart-legend.ts
57
+ var useChartLegend = ({
58
+ legendProps: _legendProps = {}
59
+ }) => {
60
+ const [rest, legendProps] = (0, import_utils.splitObject)(
61
+ _legendProps,
62
+ legendProperties
63
+ );
64
+ const getLegendProps = (0, import_react.useCallback)(
65
+ (props, ref = null) => {
66
+ return {
67
+ ref,
68
+ verticalAlign: "top",
69
+ ...props,
70
+ ...rest
71
+ };
72
+ },
73
+ [rest]
74
+ );
75
+ return { legendProps, getLegendProps };
76
+ };
77
+ // Annotate the CommonJS export names for ESM import in node:
78
+ 0 && (module.exports = {
79
+ useChartLegend
80
+ });
81
+ //# sourceMappingURL=use-chart-legend.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/use-chart-legend.ts","../src/rechart-properties.ts"],"sourcesContent":["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 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 ]\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAA4B;AAC5B,mBAA4B;;;AC0MrB,IAAM,mBAAgE;AAAA,EAC3E;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;;ADrNO,IAAM,iBAAiB,CAAC;AAAA,EAC7B,aAAa,eAAe,CAAC;AAC/B,MAA2B;AACzB,QAAM,CAAC,MAAM,WAAW,QAAI;AAAA,IAC1B;AAAA,IACA;AAAA,EACF;AAEA,QAAM,qBAIF;AAAA,IACF,CAAC,OAAO,MAAM,SAAS;AACrB,aAAO;AAAA,QACL;AAAA,QACA,eAAe;AAAA,QACf,GAAG;AAAA,QACH,GAAG;AAAA,MACL;AAAA,IACF;AAAA,IACA,CAAC,IAAI;AAAA,EACP;AAEA,SAAO,EAAE,aAAa,eAAe;AACvC;","names":[]}
@@ -0,0 +1,9 @@
1
+ "use client"
2
+ import {
3
+ useChartLegend
4
+ } from "./chunk-LM2DQK2P.mjs";
5
+ import "./chunk-OSNFBRHL.mjs";
6
+ export {
7
+ useChartLegend
8
+ };
9
+ //# sourceMappingURL=use-chart-legend.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,22 @@
1
+ import { CSSUIObject } from '@yamada-ui/core';
2
+ import { Dict } from '@yamada-ui/utils';
3
+ import * as Recharts from 'recharts';
4
+ import { ReferenceLineProps, RequiredChartPropGetter } from './chart.types.mjs';
5
+ import 'react';
6
+
7
+ type UseChartReferenceLineOptions = {
8
+ /**
9
+ * Reference lines that should be displayed on the chart.
10
+ */
11
+ referenceLineProps?: ReferenceLineProps[];
12
+ };
13
+ type UseChartReferenceLineProps = UseChartReferenceLineOptions & {
14
+ styles: Dict<CSSUIObject>;
15
+ };
16
+ declare const useChartReferenceLine: ({ referenceLineProps, styles, }: UseChartReferenceLineProps) => {
17
+ getReferenceLineProps: RequiredChartPropGetter<"div", {
18
+ index: number;
19
+ }, Omit<Recharts.ReferenceLineProps, "ref">>;
20
+ };
21
+
22
+ export { type UseChartReferenceLineOptions, useChartReferenceLine };
@@ -0,0 +1,22 @@
1
+ import { CSSUIObject } from '@yamada-ui/core';
2
+ import { Dict } from '@yamada-ui/utils';
3
+ import * as Recharts from 'recharts';
4
+ import { ReferenceLineProps, RequiredChartPropGetter } from './chart.types.js';
5
+ import 'react';
6
+
7
+ type UseChartReferenceLineOptions = {
8
+ /**
9
+ * Reference lines that should be displayed on the chart.
10
+ */
11
+ referenceLineProps?: ReferenceLineProps[];
12
+ };
13
+ type UseChartReferenceLineProps = UseChartReferenceLineOptions & {
14
+ styles: Dict<CSSUIObject>;
15
+ };
16
+ declare const useChartReferenceLine: ({ referenceLineProps, styles, }: UseChartReferenceLineProps) => {
17
+ getReferenceLineProps: RequiredChartPropGetter<"div", {
18
+ index: number;
19
+ }, Omit<Recharts.ReferenceLineProps, "ref">>;
20
+ };
21
+
22
+ export { type UseChartReferenceLineOptions, useChartReferenceLine };
@@ -0,0 +1,105 @@
1
+ "use client"
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/use-chart-reference-line.ts
22
+ var use_chart_reference_line_exports = {};
23
+ __export(use_chart_reference_line_exports, {
24
+ useChartReferenceLine: () => useChartReferenceLine
25
+ });
26
+ module.exports = __toCommonJS(use_chart_reference_line_exports);
27
+ var import_core2 = require("@yamada-ui/core");
28
+ var import_utils2 = require("@yamada-ui/utils");
29
+ var import_react = require("react");
30
+
31
+ // src/chart-utils.ts
32
+ var import_core = require("@yamada-ui/core");
33
+ var import_utils = require("@yamada-ui/utils");
34
+ var getClassName = (...styles) => (theme) => (0, import_utils.cx)(
35
+ ...styles.map(
36
+ (style) => (0, import_utils.isString)(style) ? style : (0, import_core.getCSS)(style)(theme)
37
+ )
38
+ );
39
+ var getComponentProps = ([obj, keys], ...props) => (theme, isContain) => {
40
+ const [pickedProps, omittedProps] = (0, import_utils.splitObject)(obj, keys);
41
+ const className = getClassName(...props, omittedProps)(theme);
42
+ return !isContain ? [pickedProps, className] : { ...pickedProps, className };
43
+ };
44
+
45
+ // src/rechart-properties.ts
46
+ var referenceLineProperties = [
47
+ "xAxisId",
48
+ "yAxisId",
49
+ "x",
50
+ "y",
51
+ "ifOverflow",
52
+ "viewBox",
53
+ "xAxis",
54
+ "yAxis",
55
+ "label",
56
+ "isFront",
57
+ "strokeWidth",
58
+ "segment"
59
+ ];
60
+
61
+ // src/use-chart-reference-line.ts
62
+ var useChartReferenceLine = ({
63
+ referenceLineProps = [],
64
+ styles
65
+ }) => {
66
+ const { theme } = (0, import_core2.useTheme)();
67
+ const styleClassName = (0, import_core2.getCSS)(styles.referenceLine)(theme);
68
+ const propList = (0, import_react.useMemo)(
69
+ () => referenceLineProps.map((props, index) => {
70
+ const [{ label: labelProp, ...rest }, propClassName] = getComponentProps(
71
+ [props, referenceLineProperties],
72
+ styleClassName
73
+ )(theme);
74
+ const color = `var(--ui-reference-line-${index})`;
75
+ const label = {
76
+ value: labelProp,
77
+ fill: color,
78
+ position: "insideBottomLeft",
79
+ ...(0, import_utils2.isObject)(labelProp) ? labelProp : {}
80
+ };
81
+ return { propClassName, color, label, ...rest };
82
+ }),
83
+ [referenceLineProps, styleClassName, theme]
84
+ );
85
+ const getReferenceLineProps = (0, import_react.useCallback)(
86
+ ({ index, className, ...props }, ref = null) => {
87
+ const { propClassName, color, label, ...rest } = propList[index];
88
+ return {
89
+ ref,
90
+ className: (0, import_utils2.cx)(className, propClassName),
91
+ stroke: color,
92
+ label,
93
+ ...props,
94
+ ...rest
95
+ };
96
+ },
97
+ [propList]
98
+ );
99
+ return { getReferenceLineProps };
100
+ };
101
+ // Annotate the CommonJS export names for ESM import in node:
102
+ 0 && (module.exports = {
103
+ useChartReferenceLine
104
+ });
105
+ //# sourceMappingURL=use-chart-reference-line.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/use-chart-reference-line.ts","../src/chart-utils.ts","../src/rechart-properties.ts"],"sourcesContent":["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 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 ]\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,eAAiC;AAGjC,IAAAC,gBAA6B;AAC7B,mBAAqC;;;ACHrC,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;;;ACmDK,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;;;AFvEO,IAAM,wBAAwB,CAAC;AAAA,EACpC,qBAAqB,CAAC;AAAA,EACtB;AACF,MAAkC;AAChC,QAAM,EAAE,MAAM,QAAI,uBAAS;AAC3B,QAAM,qBAAiB,qBAAO,OAAO,aAAa,EAAE,KAAK;AACzD,QAAM,eAAW;AAAA,IACf,MACE,mBAAmB,IAAI,CAAC,OAAO,UAAU;AACvC,YAAM,CAAC,EAAE,OAAO,WAAW,GAAG,KAAK,GAAG,aAAa,IACjD;AAAA,QACE,CAAC,OAAO,uBAAuB;AAAA,QAC/B;AAAA,MACF,EAAE,KAAK;AAET,YAAM,QAAQ,2BAA2B,KAAK;AAC9C,YAAM,QAA8C;AAAA,QAClD,OAAO;AAAA,QACP,MAAM;AAAA,QACN,UAAU;AAAA,QACV,OAAI,wBAAS,SAAS,IAAI,YAAY,CAAC;AAAA,MACzC;AAEA,aAAO,EAAE,eAAe,OAAO,OAAO,GAAG,KAAK;AAAA,IAChD,CAAC;AAAA,IACH,CAAC,oBAAoB,gBAAgB,KAAK;AAAA,EAC5C;AAEA,QAAM,4BAMF;AAAA,IACF,CAAC,EAAE,OAAO,WAAW,GAAG,MAAM,GAAG,MAAM,SAAS;AAC9C,YAAM,EAAE,eAAe,OAAO,OAAO,GAAG,KAAK,IAAI,SAAS,KAAK;AAE/D,aAAO;AAAA,QACL;AAAA,QACA,eAAW,kBAAG,WAAW,aAAa;AAAA,QACtC,QAAQ;AAAA,QACR;AAAA,QACA,GAAI;AAAA,QACJ,GAAG;AAAA,MACL;AAAA,IACF;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,SAAO,EAAE,sBAAsB;AACjC;","names":["import_core","import_utils"]}
@@ -0,0 +1,10 @@
1
+ "use client"
2
+ import {
3
+ useChartReferenceLine
4
+ } from "./chunk-MWPICUEW.mjs";
5
+ import "./chunk-OSNFBRHL.mjs";
6
+ import "./chunk-QL3DB7OJ.mjs";
7
+ export {
8
+ useChartReferenceLine
9
+ };
10
+ //# sourceMappingURL=use-chart-reference-line.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,27 @@
1
+ import { CSSUIObject } from '@yamada-ui/core';
2
+ import { Dict } from '@yamada-ui/utils';
3
+ import * as Recharts from 'recharts';
4
+ import { TooltipProps, ChartPropGetter } from './chart.types.mjs';
5
+ import 'react';
6
+
7
+ type UseChartTooltipOptions = {
8
+ /**
9
+ * Props passed down to recharts 'Tooltip' component.
10
+ */
11
+ tooltipProps?: TooltipProps;
12
+ /**
13
+ * Specifies the duration of animation, the unit of this option is ms.
14
+ *
15
+ * @default 0
16
+ */
17
+ tooltipAnimationDuration?: number;
18
+ };
19
+ type UseChartTooltipProps = UseChartTooltipOptions & {
20
+ styles: Dict<CSSUIObject>;
21
+ };
22
+ declare const useChartTooltip: ({ tooltipProps: _tooltipProps, tooltipAnimationDuration, styles, }: UseChartTooltipProps) => {
23
+ tooltipProps: Omit<Dict, string>;
24
+ getTooltipProps: ChartPropGetter<"div", Partial<Recharts.TooltipProps<any, any>>, Omit<Recharts.TooltipProps<any, any>, "ref">>;
25
+ };
26
+
27
+ export { type UseChartTooltipOptions, useChartTooltip };
@@ -0,0 +1,27 @@
1
+ import { CSSUIObject } from '@yamada-ui/core';
2
+ import { Dict } from '@yamada-ui/utils';
3
+ import * as Recharts from 'recharts';
4
+ import { TooltipProps, ChartPropGetter } from './chart.types.js';
5
+ import 'react';
6
+
7
+ type UseChartTooltipOptions = {
8
+ /**
9
+ * Props passed down to recharts 'Tooltip' component.
10
+ */
11
+ tooltipProps?: TooltipProps;
12
+ /**
13
+ * Specifies the duration of animation, the unit of this option is ms.
14
+ *
15
+ * @default 0
16
+ */
17
+ tooltipAnimationDuration?: number;
18
+ };
19
+ type UseChartTooltipProps = UseChartTooltipOptions & {
20
+ styles: Dict<CSSUIObject>;
21
+ };
22
+ declare const useChartTooltip: ({ tooltipProps: _tooltipProps, tooltipAnimationDuration, styles, }: UseChartTooltipProps) => {
23
+ tooltipProps: Omit<Dict, string>;
24
+ getTooltipProps: ChartPropGetter<"div", Partial<Recharts.TooltipProps<any, any>>, Omit<Recharts.TooltipProps<any, any>, "ref">>;
25
+ };
26
+
27
+ export { type UseChartTooltipOptions, useChartTooltip };
@@ -0,0 +1,100 @@
1
+ "use client"
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/use-chart-tooltip.ts
22
+ var use_chart_tooltip_exports = {};
23
+ __export(use_chart_tooltip_exports, {
24
+ useChartTooltip: () => useChartTooltip
25
+ });
26
+ module.exports = __toCommonJS(use_chart_tooltip_exports);
27
+ var import_core2 = require("@yamada-ui/core");
28
+ var import_utils2 = require("@yamada-ui/utils");
29
+ var import_react = require("react");
30
+
31
+ // src/chart-utils.ts
32
+ var import_core = require("@yamada-ui/core");
33
+ var import_utils = require("@yamada-ui/utils");
34
+ var getClassName = (...styles) => (theme) => (0, import_utils.cx)(
35
+ ...styles.map(
36
+ (style) => (0, import_utils.isString)(style) ? style : (0, import_core.getCSS)(style)(theme)
37
+ )
38
+ );
39
+
40
+ // src/rechart-properties.ts
41
+ var tooltipProperties = [
42
+ "offset",
43
+ "filterNull",
44
+ "itemStyle",
45
+ "wrapperStyle",
46
+ "contentStyle",
47
+ "labelStyle",
48
+ "cursor",
49
+ "viewBox",
50
+ "allowEscapeViewBox",
51
+ "active",
52
+ "position",
53
+ "coordinate",
54
+ "payload",
55
+ "label",
56
+ "content",
57
+ "formatter",
58
+ "labelFormatter",
59
+ "itemSorter",
60
+ "isAnimationActive",
61
+ "animationDuration",
62
+ "animationEasing"
63
+ ];
64
+
65
+ // src/use-chart-tooltip.ts
66
+ var useChartTooltip = ({
67
+ tooltipProps: _tooltipProps = {},
68
+ tooltipAnimationDuration = 0,
69
+ styles
70
+ }) => {
71
+ const { theme } = (0, import_core2.useTheme)();
72
+ const { cursor, ...rest } = _tooltipProps;
73
+ const cursorClassName = (0, import_react.useMemo)(
74
+ () => getClassName({ ...styles.cursor, ...cursor })(theme),
75
+ [cursor, styles.cursor, theme]
76
+ );
77
+ const [tooltipProps, tooltipUIProps] = (0, import_utils2.splitObject)(
78
+ rest,
79
+ tooltipProperties
80
+ );
81
+ const getTooltipProps = (0, import_react.useCallback)(
82
+ (props, ref = null) => ({
83
+ ref,
84
+ animationDuration: tooltipAnimationDuration,
85
+ isAnimationActive: (tooltipAnimationDuration || 0) > 0,
86
+ cursor: {
87
+ className: (0, import_utils2.cx)("ui-chart__cursor", cursorClassName)
88
+ },
89
+ ...props,
90
+ ...tooltipProps
91
+ }),
92
+ [cursorClassName, tooltipAnimationDuration, tooltipProps]
93
+ );
94
+ return { tooltipProps: tooltipUIProps, getTooltipProps };
95
+ };
96
+ // Annotate the CommonJS export names for ESM import in node:
97
+ 0 && (module.exports = {
98
+ useChartTooltip
99
+ });
100
+ //# sourceMappingURL=use-chart-tooltip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/use-chart-tooltip.ts","../src/chart-utils.ts","../src/rechart-properties.ts"],"sourcesContent":["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\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","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 ]\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,eAA2C;AAC3C,IAAAC,gBAA2C;AAC3C,mBAAqC;;;ACDrC,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;;;ACyNG,IAAM,oBAA+D;AAAA,EAC1E;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;;AFlOO,IAAM,kBAAkB,CAAC;AAAA,EAC9B,cAAc,gBAAgB,CAAC;AAAA,EAC/B,2BAA2B;AAAA,EAC3B;AACF,MAA4B;AAC1B,QAAM,EAAE,MAAM,QAAI,uBAAS;AAC3B,QAAM,EAAE,QAAQ,GAAG,KAAK,IAAI;AAC5B,QAAM,sBAAkB;AAAA,IACtB,MAAM,aAAa,EAAE,GAAG,OAAO,QAAQ,GAAG,OAAO,CAAC,EAAE,KAAK;AAAA,IACzD,CAAC,QAAQ,OAAO,QAAQ,KAAK;AAAA,EAC/B;AAEA,QAAM,CAAC,cAAc,cAAc,QAAI;AAAA,IACrC;AAAA,IACA;AAAA,EACF;AAEA,QAAM,sBAIF;AAAA,IACF,CAAC,OAAO,MAAM,UAAU;AAAA,MACtB;AAAA,MACA,mBAAmB;AAAA,MACnB,oBAAoB,4BAA4B,KAAK;AAAA,MACrD,QAAQ;AAAA,QACN,eAAW,kBAAG,oBAAoB,eAAe;AAAA,MACnD;AAAA,MACA,GAAG;AAAA,MACH,GAAG;AAAA,IACL;AAAA,IACA,CAAC,iBAAiB,0BAA0B,YAAY;AAAA,EAC1D;AAEA,SAAO,EAAE,cAAc,gBAAgB,gBAAgB;AACzD;","names":["import_core","import_utils"]}
@@ -0,0 +1,10 @@
1
+ "use client"
2
+ import {
3
+ useChartTooltip
4
+ } from "./chunk-RN6PXJAD.mjs";
5
+ import "./chunk-OSNFBRHL.mjs";
6
+ import "./chunk-QL3DB7OJ.mjs";
7
+ export {
8
+ useChartTooltip
9
+ };
10
+ //# sourceMappingURL=use-chart-tooltip.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,33 @@
1
+ import * as react from 'react';
2
+ import { CSSUIObject } from '@yamada-ui/core';
3
+ import * as Recharts from 'recharts';
4
+ import { ResponsiveContainerProps, ChartPropGetter } from './chart.types.mjs';
5
+ import '@yamada-ui/utils';
6
+
7
+ type ChartContext = {
8
+ styles: Record<string, CSSUIObject>;
9
+ };
10
+ declare const ChartProvider: react.Provider<ChartContext>;
11
+ declare const useChartContext: () => ChartContext;
12
+ type UseChartProps = {
13
+ /**
14
+ * Props passed down to recharts `ResponsiveContainer` component.
15
+ */
16
+ containerProps?: ResponsiveContainerProps;
17
+ };
18
+ declare const useChart: ({ containerProps }: UseChartProps) => {
19
+ getContainerProps: ChartPropGetter<"div", Partial<Omit<Recharts.ResponsiveContainerProps, "children">>, Omit<Recharts.ResponsiveContainerProps, "children">>;
20
+ };
21
+ type UseChartReturn = ReturnType<typeof useChart>;
22
+ type UseLegendProps = {};
23
+ declare const useLegend: ({}?: UseLegendProps) => {
24
+ styles: Record<string, CSSUIObject>;
25
+ };
26
+ type UseLegendReturn = ReturnType<typeof useLegend>;
27
+ type UseTooltipProps = {};
28
+ declare const useTooltip: ({}?: UseTooltipProps) => {
29
+ styles: Record<string, CSSUIObject>;
30
+ };
31
+ type UseTooltipReturn = ReturnType<typeof useTooltip>;
32
+
33
+ export { ChartProvider, type UseChartProps, type UseChartReturn, type UseLegendProps, type UseLegendReturn, type UseTooltipProps, type UseTooltipReturn, useChart, useChartContext, useLegend, useTooltip };