@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,1088 @@
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/line-chart.tsx
22
+ var line_chart_exports = {};
23
+ __export(line_chart_exports, {
24
+ LineChart: () => LineChart
25
+ });
26
+ module.exports = __toCommonJS(line_chart_exports);
27
+ var import_core10 = require("@yamada-ui/core");
28
+ var import_utils11 = require("@yamada-ui/utils");
29
+ var import_react8 = require("react");
30
+ var import_recharts = require("recharts");
31
+
32
+ // src/chart-legend.tsx
33
+ var import_core3 = require("@yamada-ui/core");
34
+ var import_utils3 = require("@yamada-ui/utils");
35
+
36
+ // src/use-chart.ts
37
+ var import_core2 = require("@yamada-ui/core");
38
+ var import_utils2 = require("@yamada-ui/utils");
39
+ var import_react = require("react");
40
+
41
+ // src/chart-utils.ts
42
+ var import_core = require("@yamada-ui/core");
43
+ var import_utils = require("@yamada-ui/utils");
44
+ var getClassName = (...styles) => (theme) => (0, import_utils.cx)(
45
+ ...styles.map(
46
+ (style) => (0, import_utils.isString)(style) ? style : (0, import_core.getCSS)(style)(theme)
47
+ )
48
+ );
49
+ var getComponentProps = ([obj, keys], ...props) => (theme, isContain) => {
50
+ const [pickedProps, omittedProps] = (0, import_utils.splitObject)(obj, keys);
51
+ const className = getClassName(...props, omittedProps)(theme);
52
+ return !isContain ? [pickedProps, className] : { ...pickedProps, className };
53
+ };
54
+
55
+ // src/rechart-properties.ts
56
+ var lineChartProperties = [
57
+ "layout",
58
+ "syncId",
59
+ "syncMethod",
60
+ "width",
61
+ "height",
62
+ "data",
63
+ "margin",
64
+ "onClick",
65
+ "onMouseEnter",
66
+ "onMouseMove",
67
+ "onMouseLeave"
68
+ ];
69
+ var referenceLineProperties = [
70
+ "xAxisId",
71
+ "yAxisId",
72
+ "x",
73
+ "y",
74
+ "ifOverflow",
75
+ "viewBox",
76
+ "xAxis",
77
+ "yAxis",
78
+ "label",
79
+ "isFront",
80
+ "strokeWidth",
81
+ "segment"
82
+ ];
83
+ var containerProperties = [
84
+ "aspect",
85
+ "width",
86
+ "height",
87
+ "minWidth",
88
+ "minHeight",
89
+ "debounce",
90
+ "onResize"
91
+ ];
92
+ var gridProperties = [
93
+ "x",
94
+ "y",
95
+ "width",
96
+ "height",
97
+ "horizontal",
98
+ "vertical",
99
+ "horizontalPoints",
100
+ "horizontalCoordinatesGenerator",
101
+ "verticalPoints",
102
+ "verticalCoordinatesGenerator",
103
+ "fill",
104
+ "fillOpacity",
105
+ "strokeDasharray"
106
+ ];
107
+ var xAxisProperties = [
108
+ "hide",
109
+ "dataKey",
110
+ "xAxisId",
111
+ "width",
112
+ "height",
113
+ "orientation",
114
+ "type",
115
+ "allowDecimals",
116
+ "allowDataOverflow",
117
+ "allowDuplicatedCategory",
118
+ "angle",
119
+ "tickCount",
120
+ "domain",
121
+ "includeHidden",
122
+ "interval",
123
+ "padding",
124
+ "minTickGap",
125
+ "axisLine",
126
+ "tickLine",
127
+ "tickSize",
128
+ "tickFormatter",
129
+ "ticks",
130
+ "tick",
131
+ "mirror",
132
+ "reversed",
133
+ "label",
134
+ "scale",
135
+ "unit",
136
+ "name",
137
+ "onClick",
138
+ "onMouseDown",
139
+ "onMouseUp",
140
+ "onMouseMove",
141
+ "onMouseOver",
142
+ "onMouseOut",
143
+ "onMouseEnter",
144
+ "onMouseLeave",
145
+ "tickMargin"
146
+ ];
147
+ var yAxisProperties = [
148
+ "hide",
149
+ "dataKey",
150
+ "yAxisId",
151
+ "width",
152
+ "height",
153
+ "orientation",
154
+ "type",
155
+ "tickCount",
156
+ "domain",
157
+ "includeHidden",
158
+ "interval",
159
+ "padding",
160
+ "minTickGap",
161
+ "allowDecimals",
162
+ "allowDataOverflow",
163
+ "allowDuplicatedCategory",
164
+ "axisLine",
165
+ "tickLine",
166
+ "tickSize",
167
+ "tickFormatter",
168
+ "ticks",
169
+ "tick",
170
+ "mirror",
171
+ "reversed",
172
+ "label",
173
+ "scale",
174
+ "unit",
175
+ "name",
176
+ "onClick",
177
+ "onMouseDown",
178
+ "onMouseUp",
179
+ "onMouseMove",
180
+ "onMouseOver",
181
+ "onMouseOut",
182
+ "onMouseEnter",
183
+ "onMouseLeave",
184
+ "tickMargin"
185
+ ];
186
+ var legendProperties = [
187
+ "width",
188
+ "height",
189
+ "layout",
190
+ "align",
191
+ "verticalAlign",
192
+ "iconSize",
193
+ "iconType",
194
+ "payload",
195
+ "chartWidth",
196
+ "chartHeight",
197
+ "margin",
198
+ "content",
199
+ "formatter",
200
+ "wrapperStyle",
201
+ "onClick",
202
+ "onMouseDown",
203
+ "onMouseUp",
204
+ "onMouseMove",
205
+ "onMouseOver",
206
+ "onMouseOut",
207
+ "onMouseEnter",
208
+ "onMouseLeave"
209
+ ];
210
+ var tooltipProperties = [
211
+ "offset",
212
+ "filterNull",
213
+ "itemStyle",
214
+ "wrapperStyle",
215
+ "contentStyle",
216
+ "labelStyle",
217
+ "cursor",
218
+ "viewBox",
219
+ "allowEscapeViewBox",
220
+ "active",
221
+ "position",
222
+ "coordinate",
223
+ "payload",
224
+ "label",
225
+ "content",
226
+ "formatter",
227
+ "labelFormatter",
228
+ "itemSorter",
229
+ "isAnimationActive",
230
+ "animationDuration",
231
+ "animationEasing"
232
+ ];
233
+ var lineProperties = [
234
+ "type",
235
+ "dataKey",
236
+ "xAxisId",
237
+ "yAxisId",
238
+ "legendType",
239
+ "dot",
240
+ "activeDot",
241
+ "label",
242
+ "hide",
243
+ "points",
244
+ "stroke",
245
+ "strokeWidth",
246
+ "layout",
247
+ "connectNulls",
248
+ "unit",
249
+ "name",
250
+ "isAnimationActive",
251
+ "animationBegin",
252
+ "animationDuration",
253
+ "animationEasing",
254
+ "id",
255
+ "onAnimationStart",
256
+ "onAnimationEnd",
257
+ "onClick",
258
+ "onMouseDown",
259
+ "onMouseUp",
260
+ "onMouseMove",
261
+ "onMouseOver",
262
+ "onMouseOut",
263
+ "onMouseEnter",
264
+ "onMouseLeave",
265
+ "strokeDasharray"
266
+ ];
267
+ var dotProperties = [
268
+ "cx",
269
+ "cy",
270
+ "r",
271
+ "onClick",
272
+ "onMouseDown",
273
+ "onMouseUp",
274
+ "onMouseMove",
275
+ "onMouseOver",
276
+ "onMouseOut",
277
+ "onMouseEnter",
278
+ "onMouseLeave"
279
+ ];
280
+
281
+ // src/use-chart.ts
282
+ var [ChartProvider, useChartContext] = (0, import_utils2.createContext)({
283
+ name: "ChartContext",
284
+ errorMessage: `useChartContext returned is 'undefined'. Seems you forgot to wrap the components in "<LineChart />" or "<BarChart />" etc.`
285
+ });
286
+ var useChart = ({ containerProps = {} }) => {
287
+ const { theme } = (0, import_core2.useTheme)();
288
+ const [reChartsProps, propClassName] = getComponentProps([
289
+ containerProps,
290
+ containerProperties
291
+ ])(theme);
292
+ const getContainerProps = (0, import_react.useCallback)(
293
+ ({ className, ...props } = {}, ref = null) => ({
294
+ ref,
295
+ className: (0, import_utils2.cx)("ui-chart__container", className, propClassName),
296
+ ...props,
297
+ ...reChartsProps
298
+ }),
299
+ [propClassName, reChartsProps]
300
+ );
301
+ return {
302
+ getContainerProps
303
+ };
304
+ };
305
+ var useLegend = ({} = {}) => {
306
+ const { styles } = useChartContext();
307
+ return {
308
+ styles
309
+ };
310
+ };
311
+ var useTooltip = ({} = {}) => {
312
+ const { styles } = useChartContext();
313
+ return {
314
+ styles
315
+ };
316
+ };
317
+
318
+ // src/chart-legend.tsx
319
+ var import_jsx_runtime = require("react/jsx-runtime");
320
+ var ChartLegend = (0, import_core3.forwardRef)(
321
+ ({ className, payload = [], onHighlight, ...rest }, ref) => {
322
+ const { styles } = useLegend();
323
+ const items = payload.map(({ dataKey, value: valueProp, color }, index) => {
324
+ const value = dataKey != null ? dataKey : valueProp;
325
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
326
+ import_core3.ui.div,
327
+ {
328
+ className: "ui-chart__legend-item",
329
+ onMouseEnter: () => onHighlight(value),
330
+ onMouseLeave: () => onHighlight(null),
331
+ __css: styles.legendItem,
332
+ children: [
333
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
334
+ import_core3.ui.div,
335
+ {
336
+ className: "ui-chart__legend-swatch",
337
+ background: color,
338
+ __css: styles.legendSwatch
339
+ }
340
+ ),
341
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core3.ui.span, { className: "ui-chart__legend-label", children: value })
342
+ ]
343
+ },
344
+ `legend-${index}`
345
+ );
346
+ });
347
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
348
+ import_core3.ui.div,
349
+ {
350
+ ref,
351
+ className: (0, import_utils3.cx)("ui-chart__legend", className),
352
+ __css: styles.legend,
353
+ ...rest,
354
+ children: items
355
+ }
356
+ );
357
+ }
358
+ );
359
+
360
+ // src/chart-tooltip.tsx
361
+ var import_core4 = require("@yamada-ui/core");
362
+ var import_utils4 = require("@yamada-ui/utils");
363
+ var import_jsx_runtime2 = require("react/jsx-runtime");
364
+ var ChartTooltip = (0, import_core4.forwardRef)(
365
+ ({ label, className, payload = [], valueFormatter, unit, ...rest }, ref) => {
366
+ const { styles } = useTooltip();
367
+ const items = payload.map(
368
+ ({ color: colorProp, name, value: valueProp, payload: payload2 } = {}, index) => {
369
+ var _a;
370
+ const color = colorProp != null ? colorProp : payload2 == null ? void 0 : payload2.color;
371
+ let value;
372
+ if ((0, import_utils4.isArray)(valueProp)) {
373
+ value = valueProp.map((value2) => {
374
+ var _a2;
375
+ return `${(_a2 = valueFormatter == null ? void 0 : valueFormatter(value2)) != null ? _a2 : value2}`;
376
+ }).join(" - ");
377
+ } else {
378
+ value = (_a = valueFormatter == null ? void 0 : valueFormatter(valueProp)) != null ? _a : valueProp;
379
+ }
380
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
381
+ import_core4.ui.div,
382
+ {
383
+ className: "ui-chart__tooltip-item",
384
+ __css: styles.tooltipItem,
385
+ children: [
386
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
387
+ import_core4.ui.div,
388
+ {
389
+ className: "ui-chart__tooltip-swatch",
390
+ background: color,
391
+ __css: styles.tooltipSwatch
392
+ }
393
+ ),
394
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
395
+ import_core4.ui.span,
396
+ {
397
+ className: "ui-chart__tooltip-label",
398
+ __css: styles.tooltipLabel,
399
+ children: name
400
+ }
401
+ ),
402
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
403
+ import_core4.ui.span,
404
+ {
405
+ className: "ui-chart__tooltip-value",
406
+ __css: styles.tooltipValue,
407
+ children: [
408
+ value,
409
+ unit ? unit : ""
410
+ ]
411
+ }
412
+ )
413
+ ]
414
+ },
415
+ `tooltip-payload-${index}`
416
+ );
417
+ }
418
+ );
419
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
420
+ import_core4.ui.div,
421
+ {
422
+ ref,
423
+ className: (0, import_utils4.cx)("ui-chart__tooltip", className),
424
+ __css: styles.tooltip,
425
+ ...rest,
426
+ children: [
427
+ label ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core4.ui.p, { className: "ui-chart__tooltip-title", __css: styles.tooltipTitle, children: label }) : null,
428
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core4.ui.div, { className: "ui-chart__tooltip-list", __css: styles.tooltipList, children: items })
429
+ ]
430
+ }
431
+ );
432
+ }
433
+ );
434
+
435
+ // src/use-chart-axis.ts
436
+ var import_core5 = require("@yamada-ui/core");
437
+ var import_utils5 = require("@yamada-ui/utils");
438
+ var import_react2 = require("react");
439
+ var useChartAxis = ({
440
+ dataKey,
441
+ type,
442
+ layoutType = "horizontal",
443
+ tickLine = "y",
444
+ gridAxis = "x",
445
+ withXAxis = true,
446
+ withYAxis = true,
447
+ xAxisProps: _xAxisProps = {},
448
+ yAxisProps: _yAxisProps = {},
449
+ unit,
450
+ valueFormatter,
451
+ styles
452
+ }) => {
453
+ const { theme } = (0, import_core5.useTheme)();
454
+ const xAxisKey = (0, import_react2.useMemo)(
455
+ () => layoutType === "vertical" ? { type: "number" } : { dataKey },
456
+ [dataKey, layoutType]
457
+ );
458
+ const yAxisKey = (0, import_react2.useMemo)(
459
+ () => layoutType === "vertical" ? { dataKey, type: "category" } : { type: "number" },
460
+ [dataKey, layoutType]
461
+ );
462
+ const withXTickLine = gridAxis !== "none" && (tickLine === "x" || tickLine === "xy");
463
+ const withYTickLine = gridAxis !== "none" && (tickLine === "y" || tickLine === "xy");
464
+ const getTickLine = (withTickLine) => withTickLine ? { stroke: "currentColor" } : false;
465
+ const xTickLine = getTickLine(withXTickLine);
466
+ const yTickLine = getTickLine(withYTickLine);
467
+ const yAxisTickFormatter = type === "percent" && layoutType !== "vertical" ? valueToPercent : valueFormatter;
468
+ const xAxisTickFormatter = type === "percent" && layoutType === "vertical" ? valueToPercent : valueFormatter;
469
+ const [xAxisReChartsProps, xAxisClassName] = getComponentProps(
470
+ [_xAxisProps, xAxisProperties],
471
+ styles.xAxis
472
+ )(theme);
473
+ const [yAxisReChartsProps, yAxisClassName] = getComponentProps(
474
+ [_yAxisProps, yAxisProperties],
475
+ styles.yAxis
476
+ )(theme);
477
+ const getXAxisProps = (0, import_react2.useCallback)(
478
+ ({ className, ...props } = {}) => ({
479
+ className: (0, import_utils5.cx)(className, xAxisClassName),
480
+ hide: !withXAxis,
481
+ ...xAxisKey,
482
+ tick: {
483
+ transform: "translate(0, 10)",
484
+ fill: "currentColor"
485
+ },
486
+ stroke: "",
487
+ interval: "preserveStartEnd",
488
+ tickLine: xTickLine,
489
+ minTickGap: 5,
490
+ tickFormatter: xAxisTickFormatter,
491
+ ...props,
492
+ ...xAxisReChartsProps
493
+ }),
494
+ [
495
+ xAxisClassName,
496
+ withXAxis,
497
+ xAxisKey,
498
+ xTickLine,
499
+ xAxisTickFormatter,
500
+ xAxisReChartsProps
501
+ ]
502
+ );
503
+ const getYAxisProps = (0, import_react2.useCallback)(
504
+ ({ className, ...props } = {}) => ({
505
+ className: (0, import_utils5.cx)(className, yAxisClassName),
506
+ hide: !withYAxis,
507
+ axisLine: false,
508
+ ...yAxisKey,
509
+ tickLine: yTickLine,
510
+ tick: {
511
+ transform: "translate(-10, 0)",
512
+ fill: "currentColor"
513
+ },
514
+ allowDecimals: true,
515
+ unit,
516
+ tickFormatter: yAxisTickFormatter,
517
+ ...props,
518
+ ...yAxisReChartsProps
519
+ }),
520
+ [
521
+ yAxisClassName,
522
+ withYAxis,
523
+ yAxisKey,
524
+ yTickLine,
525
+ unit,
526
+ yAxisTickFormatter,
527
+ yAxisReChartsProps
528
+ ]
529
+ );
530
+ return { getXAxisProps, getYAxisProps };
531
+ };
532
+ var valueToPercent = (value) => {
533
+ return `${(value * 100).toFixed(0)}%`;
534
+ };
535
+
536
+ // src/use-chart-grid.ts
537
+ var import_core6 = require("@yamada-ui/core");
538
+ var import_utils6 = require("@yamada-ui/utils");
539
+ var import_react3 = require("react");
540
+ var useChartGrid = ({
541
+ gridProps = {},
542
+ gridAxis = "x",
543
+ strokeDasharray = "5 5",
544
+ styles
545
+ }) => {
546
+ const { theme } = (0, import_core6.useTheme)();
547
+ const [reChartsProps, propClassName] = getComponentProps(
548
+ [gridProps, gridProperties],
549
+ styles.grid
550
+ )(theme);
551
+ const getGridProps = (0, import_react3.useCallback)(
552
+ ({ className, ...props } = {}, ref = null) => ({
553
+ ref,
554
+ className: (0, import_utils6.cx)("ui-chart__grid", className, propClassName),
555
+ strokeDasharray,
556
+ vertical: gridAxis === "y" || gridAxis === "xy",
557
+ horizontal: gridAxis === "x" || gridAxis === "xy",
558
+ ...props,
559
+ ...reChartsProps
560
+ }),
561
+ [propClassName, strokeDasharray, gridAxis, reChartsProps]
562
+ );
563
+ return { getGridProps };
564
+ };
565
+
566
+ // src/use-chart-legend.ts
567
+ var import_utils7 = require("@yamada-ui/utils");
568
+ var import_react4 = require("react");
569
+ var useChartLegend = ({
570
+ legendProps: _legendProps = {}
571
+ }) => {
572
+ const [rest, legendProps] = (0, import_utils7.splitObject)(
573
+ _legendProps,
574
+ legendProperties
575
+ );
576
+ const getLegendProps = (0, import_react4.useCallback)(
577
+ (props, ref = null) => {
578
+ return {
579
+ ref,
580
+ verticalAlign: "top",
581
+ ...props,
582
+ ...rest
583
+ };
584
+ },
585
+ [rest]
586
+ );
587
+ return { legendProps, getLegendProps };
588
+ };
589
+
590
+ // src/use-chart-reference-line.ts
591
+ var import_core7 = require("@yamada-ui/core");
592
+ var import_utils8 = require("@yamada-ui/utils");
593
+ var import_react5 = require("react");
594
+ var useChartReferenceLine = ({
595
+ referenceLineProps = [],
596
+ styles
597
+ }) => {
598
+ const { theme } = (0, import_core7.useTheme)();
599
+ const styleClassName = (0, import_core7.getCSS)(styles.referenceLine)(theme);
600
+ const propList = (0, import_react5.useMemo)(
601
+ () => referenceLineProps.map((props, index) => {
602
+ const [{ label: labelProp, ...rest }, propClassName] = getComponentProps(
603
+ [props, referenceLineProperties],
604
+ styleClassName
605
+ )(theme);
606
+ const color = `var(--ui-reference-line-${index})`;
607
+ const label = {
608
+ value: labelProp,
609
+ fill: color,
610
+ position: "insideBottomLeft",
611
+ ...(0, import_utils8.isObject)(labelProp) ? labelProp : {}
612
+ };
613
+ return { propClassName, color, label, ...rest };
614
+ }),
615
+ [referenceLineProps, styleClassName, theme]
616
+ );
617
+ const getReferenceLineProps = (0, import_react5.useCallback)(
618
+ ({ index, className, ...props }, ref = null) => {
619
+ const { propClassName, color, label, ...rest } = propList[index];
620
+ return {
621
+ ref,
622
+ className: (0, import_utils8.cx)(className, propClassName),
623
+ stroke: color,
624
+ label,
625
+ ...props,
626
+ ...rest
627
+ };
628
+ },
629
+ [propList]
630
+ );
631
+ return { getReferenceLineProps };
632
+ };
633
+
634
+ // src/use-chart-tooltip.ts
635
+ var import_core8 = require("@yamada-ui/core");
636
+ var import_utils9 = require("@yamada-ui/utils");
637
+ var import_react6 = require("react");
638
+ var useChartTooltip = ({
639
+ tooltipProps: _tooltipProps = {},
640
+ tooltipAnimationDuration = 0,
641
+ styles
642
+ }) => {
643
+ const { theme } = (0, import_core8.useTheme)();
644
+ const { cursor, ...rest } = _tooltipProps;
645
+ const cursorClassName = (0, import_react6.useMemo)(
646
+ () => getClassName({ ...styles.cursor, ...cursor })(theme),
647
+ [cursor, styles.cursor, theme]
648
+ );
649
+ const [tooltipProps, tooltipUIProps] = (0, import_utils9.splitObject)(
650
+ rest,
651
+ tooltipProperties
652
+ );
653
+ const getTooltipProps = (0, import_react6.useCallback)(
654
+ (props, ref = null) => ({
655
+ ref,
656
+ animationDuration: tooltipAnimationDuration,
657
+ isAnimationActive: (tooltipAnimationDuration || 0) > 0,
658
+ cursor: {
659
+ className: (0, import_utils9.cx)("ui-chart__cursor", cursorClassName)
660
+ },
661
+ ...props,
662
+ ...tooltipProps
663
+ }),
664
+ [cursorClassName, tooltipAnimationDuration, tooltipProps]
665
+ );
666
+ return { tooltipProps: tooltipUIProps, getTooltipProps };
667
+ };
668
+
669
+ // src/use-line-chart.ts
670
+ var import_core9 = require("@yamada-ui/core");
671
+ var import_utils10 = require("@yamada-ui/utils");
672
+ var import_react7 = require("react");
673
+ var useLineChart = ({
674
+ data,
675
+ series,
676
+ layoutType = "horizontal",
677
+ withDots = true,
678
+ withActiveDots = true,
679
+ curveType = "monotone",
680
+ strokeWidth = 2,
681
+ connectNulls = true,
682
+ referenceLineProps,
683
+ fillOpacity = 1,
684
+ syncId,
685
+ styles,
686
+ ...rest
687
+ }) => {
688
+ var _a;
689
+ const { theme } = (0, import_core9.useTheme)();
690
+ const [highlightedArea, setHighlightedArea] = (0, import_react7.useState)(null);
691
+ const shouldHighlight = highlightedArea !== null;
692
+ const {
693
+ dot = {},
694
+ activeDot = {},
695
+ dimDot,
696
+ dimLine,
697
+ ...computedLineProps
698
+ } = (_a = rest.lineProps) != null ? _a : {};
699
+ const lineColors = (0, import_react7.useMemo)(
700
+ () => series.map(({ color }, index) => ({
701
+ __prefix: "ui",
702
+ name: `line-${index}`,
703
+ token: "colors",
704
+ value: color != null ? color : "transparent"
705
+ })),
706
+ [series]
707
+ );
708
+ const referenceLineColors = (0, import_react7.useMemo)(
709
+ () => referenceLineProps ? referenceLineProps.map(({ color }, index) => ({
710
+ __prefix: "ui",
711
+ name: `reference-line-${index}`,
712
+ token: "colors",
713
+ value: color != null ? color : "transparent"
714
+ })) : [],
715
+ [referenceLineProps]
716
+ );
717
+ const lineVars = (0, import_react7.useMemo)(
718
+ () => [
719
+ ...lineColors,
720
+ ...referenceLineColors,
721
+ { __prefix: "ui", name: "fill-opacity", value: fillOpacity }
722
+ ],
723
+ [fillOpacity, lineColors, referenceLineColors]
724
+ );
725
+ const [chartProps, lineChartClassName] = (0, import_react7.useMemo)(
726
+ () => {
727
+ var _a2;
728
+ return getComponentProps(
729
+ [(_a2 = rest.chartProps) != null ? _a2 : {}, lineChartProperties],
730
+ styles.chart
731
+ )(theme);
732
+ },
733
+ [rest.chartProps, styles.chart, theme]
734
+ );
735
+ const [lineProps, lineClassName] = (0, import_react7.useMemo)(() => {
736
+ const resolvedLineProps = {
737
+ fillOpacity: "var(--ui-fill-opacity)",
738
+ strokeOpacity: "var(--ui-fill-opacity)",
739
+ ...computedLineProps
740
+ };
741
+ return getComponentProps(
742
+ [resolvedLineProps, lineProperties],
743
+ styles.line
744
+ )(theme);
745
+ }, [computedLineProps, styles.line, theme]);
746
+ const [dimLineProps, dimLineClassName] = (0, import_react7.useMemo)(() => {
747
+ const resolvedDimLine = { fillOpacity: 0, strokeOpacity: 0.3, ...dimLine };
748
+ return getComponentProps([resolvedDimLine, lineProperties])(
749
+ theme
750
+ );
751
+ }, [dimLine, theme]);
752
+ const [dotProps, dotClassName] = (0, import_react7.useMemo)(() => {
753
+ const resolvedDot = { fillOpacity: 1, strokeOpacity: 1, ...dot };
754
+ return getComponentProps(
755
+ [resolvedDot, dotProperties],
756
+ styles.dot
757
+ )(theme);
758
+ }, [dot, styles.dot, theme]);
759
+ const [activeDotProps, activeDotClassName] = (0, import_react7.useMemo)(
760
+ () => getComponentProps(
761
+ [activeDot, dotProperties],
762
+ styles.activeDot
763
+ )(theme),
764
+ [activeDot, styles.activeDot, theme]
765
+ );
766
+ const [dimDotProps, dimDotClassName] = (0, import_react7.useMemo)(() => {
767
+ const resolvedDimDot = {
768
+ fillOpacity: 0,
769
+ strokeOpacity: 0,
770
+ ...dimDot
771
+ };
772
+ return getComponentProps([resolvedDimDot, dotProperties])(
773
+ theme
774
+ );
775
+ }, [dimDot, theme]);
776
+ const linePropList = (0, import_react7.useMemo)(
777
+ () => series.map((props, index) => {
778
+ const {
779
+ dataKey,
780
+ dot: dot2 = {},
781
+ activeDot: activeDot2 = {},
782
+ dimDot: dimDot2 = {},
783
+ dimLine: dimLine2 = {},
784
+ ...computedProps
785
+ } = props;
786
+ const color = `var(--ui-line-${index})`;
787
+ const dimmed = shouldHighlight && highlightedArea !== dataKey;
788
+ const computedDimLine = { ...dimLineProps, ...dimLine2 };
789
+ const resolvedProps = {
790
+ ...lineProps,
791
+ ...computedProps,
792
+ ...dimmed ? computedDimLine : {}
793
+ };
794
+ const rest2 = getComponentProps(
795
+ [resolvedProps, lineProperties],
796
+ lineClassName,
797
+ dimmed ? dimLineClassName : void 0
798
+ )(theme, true);
799
+ let resolvedActiveDot;
800
+ if (withActiveDots) {
801
+ const computedActiveDot = { ...activeDotProps, ...activeDot2 };
802
+ const [rest3, className] = getComponentProps(
803
+ [computedActiveDot, dotProperties],
804
+ activeDotClassName
805
+ )(theme);
806
+ resolvedActiveDot = {
807
+ className: (0, import_utils10.cx)("ui-line-chart__active-dot", className),
808
+ fill: color,
809
+ stroke: color,
810
+ r: 4,
811
+ ...rest3
812
+ };
813
+ } else {
814
+ resolvedActiveDot = false;
815
+ }
816
+ let resolvedDot;
817
+ if (withDots) {
818
+ const computedDimDot = { ...dimDotProps, ...dimDot2 };
819
+ const computedDot = {
820
+ ...dotProps,
821
+ ...dot2,
822
+ ...dimmed ? computedDimDot : {}
823
+ };
824
+ const [rest3, className] = getComponentProps(
825
+ [computedDot, dotProperties],
826
+ dotClassName,
827
+ dimmed ? dimDotClassName : void 0
828
+ )(theme);
829
+ resolvedDot = {
830
+ className: (0, import_utils10.cx)("ui-line-chart__dot", className),
831
+ fill: color,
832
+ ...rest3
833
+ };
834
+ } else {
835
+ resolvedDot = false;
836
+ }
837
+ return {
838
+ ...rest2,
839
+ color,
840
+ dataKey,
841
+ activeDot: resolvedActiveDot,
842
+ dot: resolvedDot
843
+ };
844
+ }),
845
+ [
846
+ series,
847
+ shouldHighlight,
848
+ highlightedArea,
849
+ dimLineProps,
850
+ lineProps,
851
+ lineClassName,
852
+ dimLineClassName,
853
+ theme,
854
+ withActiveDots,
855
+ withDots,
856
+ activeDotProps,
857
+ activeDotClassName,
858
+ dimDotProps,
859
+ dotProps,
860
+ dotClassName,
861
+ dimDotClassName
862
+ ]
863
+ );
864
+ const getLineChartProps = (0, import_react7.useCallback)(
865
+ ({ className, ...props } = {}, ref = null) => ({
866
+ ref,
867
+ className: (0, import_utils10.cx)(className, lineChartClassName),
868
+ data,
869
+ layout: layoutType,
870
+ syncId,
871
+ ...props,
872
+ ...chartProps
873
+ }),
874
+ [data, layoutType, syncId, lineChartClassName, chartProps]
875
+ );
876
+ const getLineProps = (0, import_react7.useCallback)(
877
+ ({ index, className: classNameProp, ...props }, ref = null) => {
878
+ const { color, className, dataKey, activeDot: activeDot2, dot: dot2, ...rest2 } = linePropList[index];
879
+ return {
880
+ ref,
881
+ className: (0, import_utils10.cx)(classNameProp, className),
882
+ activeDot: activeDot2,
883
+ dot: dot2,
884
+ name: dataKey,
885
+ type: curveType,
886
+ dataKey,
887
+ fill: color,
888
+ strokeWidth,
889
+ stroke: color,
890
+ isAnimationActive: false,
891
+ connectNulls,
892
+ ...props,
893
+ ...rest2
894
+ };
895
+ },
896
+ [connectNulls, curveType, linePropList, strokeWidth]
897
+ );
898
+ return {
899
+ getLineProps,
900
+ getLineChartProps,
901
+ lineVars,
902
+ setHighlightedArea
903
+ };
904
+ };
905
+
906
+ // src/line-chart.tsx
907
+ var import_jsx_runtime3 = require("react/jsx-runtime");
908
+ var LineChart = (0, import_core10.forwardRef)((props, ref) => {
909
+ const [styles, mergedProps] = (0, import_core10.useMultiComponentStyle)("LineChart", props);
910
+ const {
911
+ className,
912
+ containerProps,
913
+ gridProps,
914
+ gridAxis,
915
+ strokeDasharray,
916
+ dataKey,
917
+ type,
918
+ layoutType,
919
+ tickLine,
920
+ withXAxis,
921
+ withYAxis,
922
+ xAxisProps,
923
+ yAxisProps,
924
+ unit,
925
+ valueFormatter,
926
+ referenceLineProps,
927
+ tooltipProps,
928
+ tooltipAnimationDuration,
929
+ legendProps,
930
+ withLegend = false,
931
+ withTooltip = true,
932
+ series,
933
+ data,
934
+ chartProps,
935
+ lineProps,
936
+ withDots,
937
+ withActiveDots,
938
+ curveType,
939
+ strokeWidth,
940
+ connectNulls,
941
+ fillOpacity,
942
+ syncId,
943
+ ...rest
944
+ } = (0, import_core10.omitThemeProps)(mergedProps);
945
+ const { getLineProps, getLineChartProps, lineVars, setHighlightedArea } = useLineChart({
946
+ layoutType,
947
+ series,
948
+ referenceLineProps,
949
+ data,
950
+ chartProps,
951
+ lineProps,
952
+ withDots,
953
+ withActiveDots,
954
+ curveType,
955
+ strokeWidth,
956
+ connectNulls,
957
+ fillOpacity,
958
+ syncId,
959
+ styles
960
+ });
961
+ const { getContainerProps } = useChart({ containerProps });
962
+ const { getXAxisProps, getYAxisProps } = useChartAxis({
963
+ dataKey,
964
+ type,
965
+ layoutType,
966
+ tickLine,
967
+ gridAxis,
968
+ withXAxis,
969
+ withYAxis,
970
+ xAxisProps,
971
+ yAxisProps,
972
+ unit,
973
+ valueFormatter,
974
+ styles
975
+ });
976
+ const { getReferenceLineProps } = useChartReferenceLine({
977
+ referenceLineProps,
978
+ styles
979
+ });
980
+ const { getGridProps } = useChartGrid({
981
+ gridProps,
982
+ gridAxis,
983
+ strokeDasharray,
984
+ styles
985
+ });
986
+ const { tooltipProps: computedTooltipProps, getTooltipProps } = useChartTooltip({
987
+ tooltipProps,
988
+ tooltipAnimationDuration,
989
+ styles
990
+ });
991
+ const { legendProps: computedLegendProps, getLegendProps } = useChartLegend({
992
+ legendProps
993
+ });
994
+ const lines = (0, import_react8.useMemo)(
995
+ () => series.map(({ dataKey: dataKey2 }, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
996
+ import_recharts.Line,
997
+ {
998
+ ...getLineProps({ index, className: "ui-line-chart__line" })
999
+ },
1000
+ `line-${dataKey2}`
1001
+ )),
1002
+ [getLineProps, series]
1003
+ );
1004
+ const referenceLinesItems = (0, import_react8.useMemo)(
1005
+ () => referenceLineProps == null ? void 0 : referenceLineProps.map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1006
+ import_recharts.ReferenceLine,
1007
+ {
1008
+ ...getReferenceLineProps({
1009
+ index,
1010
+ className: "ui-line-chart__reference-line"
1011
+ })
1012
+ },
1013
+ `referenceLine-${index}`
1014
+ )),
1015
+ [getReferenceLineProps, referenceLineProps]
1016
+ );
1017
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ChartProvider, { value: { styles }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1018
+ import_core10.ui.div,
1019
+ {
1020
+ ref,
1021
+ className: (0, import_utils11.cx)("ui-line-chart", className),
1022
+ var: lineVars,
1023
+ __css: { maxW: "full", ...styles.container },
1024
+ ...rest,
1025
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1026
+ import_recharts.ResponsiveContainer,
1027
+ {
1028
+ ...getContainerProps({ className: "ui-line-chart__container" }),
1029
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
1030
+ import_recharts.LineChart,
1031
+ {
1032
+ ...getLineChartProps({ className: "ui-line-chart__chart" }),
1033
+ children: [
1034
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1035
+ import_recharts.CartesianGrid,
1036
+ {
1037
+ ...getGridProps({ className: "ui-line-chart__grid" })
1038
+ }
1039
+ ),
1040
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_recharts.XAxis, { ...getXAxisProps({ className: "ui-line-chart__x-axis" }) }),
1041
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_recharts.YAxis, { ...getYAxisProps({ className: "ui-line-chart__y-axis" }) }),
1042
+ withLegend ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1043
+ import_recharts.Legend,
1044
+ {
1045
+ content: ({ payload }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1046
+ ChartLegend,
1047
+ {
1048
+ className: "ui-line-chart__legend",
1049
+ payload,
1050
+ onHighlight: setHighlightedArea,
1051
+ ...computedLegendProps
1052
+ }
1053
+ ),
1054
+ ...getLegendProps()
1055
+ }
1056
+ ) : null,
1057
+ withTooltip ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1058
+ import_recharts.Tooltip,
1059
+ {
1060
+ content: ({ label, payload }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1061
+ ChartTooltip,
1062
+ {
1063
+ className: "ui-line-chart__tooltip",
1064
+ label,
1065
+ payload,
1066
+ valueFormatter,
1067
+ unit,
1068
+ ...computedTooltipProps
1069
+ }
1070
+ ),
1071
+ ...getTooltipProps()
1072
+ }
1073
+ ) : null,
1074
+ lines,
1075
+ referenceLinesItems
1076
+ ]
1077
+ }
1078
+ )
1079
+ }
1080
+ )
1081
+ }
1082
+ ) });
1083
+ });
1084
+ // Annotate the CommonJS export names for ESM import in node:
1085
+ 0 && (module.exports = {
1086
+ LineChart
1087
+ });
1088
+ //# sourceMappingURL=line-chart.js.map