@yamada-ui/charts 1.0.0

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 (175) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +28 -0
  3. package/dist/area-chart-gradient.d.mts +11 -0
  4. package/dist/area-chart-gradient.d.ts +11 -0
  5. package/dist/area-chart-gradient.js +47 -0
  6. package/dist/area-chart-gradient.js.map +1 -0
  7. package/dist/area-chart-gradient.mjs +8 -0
  8. package/dist/area-chart-gradient.mjs.map +1 -0
  9. package/dist/area-chart-split.d.mts +10 -0
  10. package/dist/area-chart-split.d.ts +10 -0
  11. package/dist/area-chart-split.js +52 -0
  12. package/dist/area-chart-split.js.map +1 -0
  13. package/dist/area-chart-split.mjs +8 -0
  14. package/dist/area-chart-split.mjs.map +1 -0
  15. package/dist/area-chart.d.mts +36 -0
  16. package/dist/area-chart.d.ts +36 -0
  17. package/dist/area-chart.js +1249 -0
  18. package/dist/area-chart.js.map +1 -0
  19. package/dist/area-chart.mjs +21 -0
  20. package/dist/area-chart.mjs.map +1 -0
  21. package/dist/bar-chart.d.mts +33 -0
  22. package/dist/bar-chart.d.ts +33 -0
  23. package/dist/bar-chart.js +1053 -0
  24. package/dist/bar-chart.js.map +1 -0
  25. package/dist/bar-chart.mjs +19 -0
  26. package/dist/bar-chart.mjs.map +1 -0
  27. package/dist/chart-legend.d.mts +12 -0
  28. package/dist/chart-legend.d.ts +12 -0
  29. package/dist/chart-legend.js +87 -0
  30. package/dist/chart-legend.js.map +1 -0
  31. package/dist/chart-legend.mjs +11 -0
  32. package/dist/chart-legend.mjs.map +1 -0
  33. package/dist/chart-tooltip.d.mts +12 -0
  34. package/dist/chart-tooltip.d.ts +12 -0
  35. package/dist/chart-tooltip.js +120 -0
  36. package/dist/chart-tooltip.js.map +1 -0
  37. package/dist/chart-tooltip.mjs +11 -0
  38. package/dist/chart-tooltip.mjs.map +1 -0
  39. package/dist/chart-utils.d.mts +9 -0
  40. package/dist/chart-utils.d.ts +9 -0
  41. package/dist/chart-utils.js +45 -0
  42. package/dist/chart-utils.js.map +1 -0
  43. package/dist/chart-utils.mjs +10 -0
  44. package/dist/chart-utils.mjs.map +1 -0
  45. package/dist/chart.types.d.mts +65 -0
  46. package/dist/chart.types.d.ts +65 -0
  47. package/dist/chart.types.js +20 -0
  48. package/dist/chart.types.js.map +1 -0
  49. package/dist/chart.types.mjs +2 -0
  50. package/dist/chart.types.mjs.map +1 -0
  51. package/dist/chunk-32BO2QEP.mjs +83 -0
  52. package/dist/chunk-32BO2QEP.mjs.map +1 -0
  53. package/dist/chunk-3CY3IFRN.mjs +42 -0
  54. package/dist/chunk-3CY3IFRN.mjs.map +1 -0
  55. package/dist/chunk-3IBGJT6F.mjs +341 -0
  56. package/dist/chunk-3IBGJT6F.mjs.map +1 -0
  57. package/dist/chunk-5QCKM3B3.mjs +438 -0
  58. package/dist/chunk-5QCKM3B3.mjs.map +1 -0
  59. package/dist/chunk-AURFFNDQ.mjs +114 -0
  60. package/dist/chunk-AURFFNDQ.mjs.map +1 -0
  61. package/dist/chunk-FGDWJUA3.mjs +56 -0
  62. package/dist/chunk-FGDWJUA3.mjs.map +1 -0
  63. package/dist/chunk-GZLE5XDS.mjs +227 -0
  64. package/dist/chunk-GZLE5XDS.mjs.map +1 -0
  65. package/dist/chunk-HE6SM47L.mjs +234 -0
  66. package/dist/chunk-HE6SM47L.mjs.map +1 -0
  67. package/dist/chunk-LXZCGIND.mjs +33 -0
  68. package/dist/chunk-LXZCGIND.mjs.map +1 -0
  69. package/dist/chunk-MSIOYYWR.mjs +24 -0
  70. package/dist/chunk-MSIOYYWR.mjs.map +1 -0
  71. package/dist/chunk-PNE3JG54.mjs +29 -0
  72. package/dist/chunk-PNE3JG54.mjs.map +1 -0
  73. package/dist/chunk-QL3DB7OJ.mjs +21 -0
  74. package/dist/chunk-QL3DB7OJ.mjs.map +1 -0
  75. package/dist/chunk-RG5JQJXE.mjs +249 -0
  76. package/dist/chunk-RG5JQJXE.mjs.map +1 -0
  77. package/dist/chunk-RTTZPOUT.mjs +50 -0
  78. package/dist/chunk-RTTZPOUT.mjs.map +1 -0
  79. package/dist/chunk-RXWD2EJ2.mjs +56 -0
  80. package/dist/chunk-RXWD2EJ2.mjs.map +1 -0
  81. package/dist/chunk-TKLHZBVY.mjs +206 -0
  82. package/dist/chunk-TKLHZBVY.mjs.map +1 -0
  83. package/dist/chunk-WDSR6B47.mjs +324 -0
  84. package/dist/chunk-WDSR6B47.mjs.map +1 -0
  85. package/dist/chunk-WF3BD34Y.mjs +74 -0
  86. package/dist/chunk-WF3BD34Y.mjs.map +1 -0
  87. package/dist/chunk-YBAGOHS5.mjs +204 -0
  88. package/dist/chunk-YBAGOHS5.mjs.map +1 -0
  89. package/dist/chunk-YRY7MUCR.mjs +258 -0
  90. package/dist/chunk-YRY7MUCR.mjs.map +1 -0
  91. package/dist/index.d.mts +23 -0
  92. package/dist/index.d.ts +23 -0
  93. package/dist/index.js +2725 -0
  94. package/dist/index.js.map +1 -0
  95. package/dist/index.mjs +36 -0
  96. package/dist/index.mjs.map +1 -0
  97. package/dist/line-chart.d.mts +33 -0
  98. package/dist/line-chart.d.ts +33 -0
  99. package/dist/line-chart.js +1114 -0
  100. package/dist/line-chart.js.map +1 -0
  101. package/dist/line-chart.mjs +19 -0
  102. package/dist/line-chart.mjs.map +1 -0
  103. package/dist/radar-chart.d.mts +52 -0
  104. package/dist/radar-chart.d.ts +52 -0
  105. package/dist/radar-chart.js +940 -0
  106. package/dist/radar-chart.js.map +1 -0
  107. package/dist/radar-chart.mjs +16 -0
  108. package/dist/radar-chart.mjs.map +1 -0
  109. package/dist/rechart-properties.d.mts +24 -0
  110. package/dist/rechart-properties.d.ts +24 -0
  111. package/dist/rechart-properties.js +479 -0
  112. package/dist/rechart-properties.js.map +1 -0
  113. package/dist/rechart-properties.mjs +44 -0
  114. package/dist/rechart-properties.mjs.map +1 -0
  115. package/dist/use-area-chart.d.mts +118 -0
  116. package/dist/use-area-chart.d.ts +118 -0
  117. package/dist/use-area-chart.js +418 -0
  118. package/dist/use-area-chart.js.map +1 -0
  119. package/dist/use-area-chart.mjs +10 -0
  120. package/dist/use-area-chart.mjs.map +1 -0
  121. package/dist/use-bar-chart.d.mts +68 -0
  122. package/dist/use-bar-chart.d.ts +68 -0
  123. package/dist/use-bar-chart.js +288 -0
  124. package/dist/use-bar-chart.js.map +1 -0
  125. package/dist/use-bar-chart.mjs +10 -0
  126. package/dist/use-bar-chart.mjs.map +1 -0
  127. package/dist/use-chart-axis.d.mts +73 -0
  128. package/dist/use-chart-axis.d.ts +73 -0
  129. package/dist/use-chart-axis.js +227 -0
  130. package/dist/use-chart-axis.js.map +1 -0
  131. package/dist/use-chart-axis.mjs +10 -0
  132. package/dist/use-chart-axis.mjs.map +1 -0
  133. package/dist/use-chart-grid.d.mts +32 -0
  134. package/dist/use-chart-grid.d.ts +32 -0
  135. package/dist/use-chart-grid.js +92 -0
  136. package/dist/use-chart-grid.js.map +1 -0
  137. package/dist/use-chart-grid.mjs +10 -0
  138. package/dist/use-chart-grid.mjs.map +1 -0
  139. package/dist/use-chart-legend.d.mts +18 -0
  140. package/dist/use-chart-legend.d.ts +18 -0
  141. package/dist/use-chart-legend.js +81 -0
  142. package/dist/use-chart-legend.js.map +1 -0
  143. package/dist/use-chart-legend.mjs +9 -0
  144. package/dist/use-chart-legend.mjs.map +1 -0
  145. package/dist/use-chart-reference-line.d.mts +22 -0
  146. package/dist/use-chart-reference-line.d.ts +22 -0
  147. package/dist/use-chart-reference-line.js +105 -0
  148. package/dist/use-chart-reference-line.js.map +1 -0
  149. package/dist/use-chart-reference-line.mjs +10 -0
  150. package/dist/use-chart-reference-line.mjs.map +1 -0
  151. package/dist/use-chart-tooltip.d.mts +35 -0
  152. package/dist/use-chart-tooltip.d.ts +35 -0
  153. package/dist/use-chart-tooltip.js +121 -0
  154. package/dist/use-chart-tooltip.js.map +1 -0
  155. package/dist/use-chart-tooltip.mjs +9 -0
  156. package/dist/use-chart-tooltip.mjs.map +1 -0
  157. package/dist/use-chart.d.mts +33 -0
  158. package/dist/use-chart.d.ts +33 -0
  159. package/dist/use-chart.js +104 -0
  160. package/dist/use-chart.js.map +1 -0
  161. package/dist/use-chart.mjs +18 -0
  162. package/dist/use-chart.mjs.map +1 -0
  163. package/dist/use-line-chart.d.mts +92 -0
  164. package/dist/use-line-chart.d.ts +92 -0
  165. package/dist/use-line-chart.js +342 -0
  166. package/dist/use-line-chart.js.map +1 -0
  167. package/dist/use-line-chart.mjs +10 -0
  168. package/dist/use-line-chart.mjs.map +1 -0
  169. package/dist/use-radar-chart.d.mts +93 -0
  170. package/dist/use-radar-chart.d.ts +93 -0
  171. package/dist/use-radar-chart.js +471 -0
  172. package/dist/use-radar-chart.js.map +1 -0
  173. package/dist/use-radar-chart.mjs +10 -0
  174. package/dist/use-radar-chart.mjs.map +1 -0
  175. package/package.json +84 -0
@@ -0,0 +1,1114 @@
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_core9 = 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, color }, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
324
+ import_core3.ui.div,
325
+ {
326
+ className: "ui-chart__legend-item",
327
+ onMouseEnter: () => onHighlight(dataKey),
328
+ onMouseLeave: () => onHighlight(null),
329
+ __css: styles.legendItem,
330
+ children: [
331
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
332
+ import_core3.ui.div,
333
+ {
334
+ className: "ui-chart__legend-swatch",
335
+ background: color,
336
+ __css: styles.legendSwatch
337
+ }
338
+ ),
339
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core3.ui.span, { className: "ui-chart__legend-label", children: dataKey })
340
+ ]
341
+ },
342
+ `legend-${index}`
343
+ ));
344
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
345
+ import_core3.ui.div,
346
+ {
347
+ ref,
348
+ className: (0, import_utils3.cx)("ui-chart__legend", className),
349
+ __css: styles.legend,
350
+ ...rest,
351
+ children: items
352
+ }
353
+ );
354
+ }
355
+ );
356
+
357
+ // src/chart-tooltip.tsx
358
+ var import_core4 = require("@yamada-ui/core");
359
+ var import_utils4 = require("@yamada-ui/utils");
360
+ var import_jsx_runtime2 = require("react/jsx-runtime");
361
+ var ChartTooltip = (0, import_core4.forwardRef)(
362
+ ({ label, className, payload = [], valueFormatter, unit, ...rest }, ref) => {
363
+ const { styles } = useTooltip();
364
+ const items = payload.map(
365
+ ({ color, name, value: valueProp } = {}, index) => {
366
+ var _a;
367
+ let value;
368
+ if ((0, import_utils4.isArray)(valueProp)) {
369
+ value = valueProp.map((value2) => {
370
+ var _a2;
371
+ return `${(_a2 = valueFormatter == null ? void 0 : valueFormatter(value2)) != null ? _a2 : value2}`;
372
+ }).join(" - ");
373
+ } else {
374
+ value = (_a = valueFormatter == null ? void 0 : valueFormatter(valueProp)) != null ? _a : valueProp;
375
+ }
376
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
377
+ import_core4.ui.div,
378
+ {
379
+ className: "ui-chart__tooltip-item",
380
+ __css: styles.tooltipItem,
381
+ children: [
382
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
383
+ import_core4.ui.div,
384
+ {
385
+ className: "ui-chart__tooltip-swatch",
386
+ background: color,
387
+ __css: styles.tooltipSwatch
388
+ }
389
+ ),
390
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
391
+ import_core4.ui.span,
392
+ {
393
+ className: "ui-chart__tooltip-label",
394
+ __css: styles.tooltipLabel,
395
+ children: name
396
+ }
397
+ ),
398
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
399
+ import_core4.ui.span,
400
+ {
401
+ className: "ui-chart__tooltip-value",
402
+ __css: styles.tooltipValue,
403
+ children: [
404
+ value,
405
+ unit ? unit : ""
406
+ ]
407
+ }
408
+ )
409
+ ]
410
+ },
411
+ `tooltip-payload-${index}`
412
+ );
413
+ }
414
+ );
415
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
416
+ import_core4.ui.div,
417
+ {
418
+ ref,
419
+ className: (0, import_utils4.cx)("ui-chart__tooltip", className),
420
+ __css: styles.tooltip,
421
+ ...rest,
422
+ children: [
423
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core4.ui.p, { className: "ui-chart__tooltip-title", __css: styles.tooltipTitle, children: label }),
424
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core4.ui.div, { className: "ui-chart__tooltip-list", __css: styles.tooltipList, children: items })
425
+ ]
426
+ }
427
+ );
428
+ }
429
+ );
430
+
431
+ // src/use-chart-axis.ts
432
+ var import_core5 = require("@yamada-ui/core");
433
+ var import_utils5 = require("@yamada-ui/utils");
434
+ var import_react2 = require("react");
435
+ var useChartAxis = ({
436
+ dataKey,
437
+ type,
438
+ layoutType = "horizontal",
439
+ tickLine = "y",
440
+ gridAxis = "x",
441
+ withXAxis = true,
442
+ withYAxis = true,
443
+ xAxisProps: _xAxisProps = {},
444
+ yAxisProps: _yAxisProps = {},
445
+ unit,
446
+ valueFormatter,
447
+ styles
448
+ }) => {
449
+ const { theme } = (0, import_core5.useTheme)();
450
+ const xAxisKey = (0, import_react2.useMemo)(
451
+ () => layoutType === "vertical" ? { type: "number" } : { dataKey },
452
+ [dataKey, layoutType]
453
+ );
454
+ const yAxisKey = (0, import_react2.useMemo)(
455
+ () => layoutType === "vertical" ? { dataKey, type: "category" } : { type: "number" },
456
+ [dataKey, layoutType]
457
+ );
458
+ const withXTickLine = gridAxis !== "none" && (tickLine === "x" || tickLine === "xy");
459
+ const withYTickLine = gridAxis !== "none" && (tickLine === "y" || tickLine === "xy");
460
+ const getTickLine = (withTickLine) => withTickLine ? { stroke: "currentColor" } : false;
461
+ const xTickLine = getTickLine(withXTickLine);
462
+ const yTickLine = getTickLine(withYTickLine);
463
+ const yAxisTickFormatter = type === "percent" && layoutType !== "vertical" ? valueToPercent : valueFormatter;
464
+ const xAxisTickFormatter = type === "percent" && layoutType === "vertical" ? valueToPercent : valueFormatter;
465
+ const [xAxisReChartsProps, xAxisClassName] = getComponentProps(
466
+ [_xAxisProps, xAxisProperties],
467
+ styles.xAxis
468
+ )(theme);
469
+ const [yAxisReChartsProps, yAxisClassName] = getComponentProps(
470
+ [_yAxisProps, yAxisProperties],
471
+ styles.yAxis
472
+ )(theme);
473
+ const getXAxisProps = (0, import_react2.useCallback)(
474
+ ({ className, ...props } = {}) => ({
475
+ className: (0, import_utils5.cx)(className, xAxisClassName),
476
+ hide: !withXAxis,
477
+ ...xAxisKey,
478
+ tick: {
479
+ transform: "translate(0, 10)",
480
+ fill: "currentColor"
481
+ },
482
+ stroke: "",
483
+ interval: "preserveStartEnd",
484
+ tickLine: xTickLine,
485
+ minTickGap: 5,
486
+ tickFormatter: xAxisTickFormatter,
487
+ ...props,
488
+ ...xAxisReChartsProps
489
+ }),
490
+ [
491
+ xAxisClassName,
492
+ withXAxis,
493
+ xAxisKey,
494
+ xTickLine,
495
+ xAxisTickFormatter,
496
+ xAxisReChartsProps
497
+ ]
498
+ );
499
+ const getYAxisProps = (0, import_react2.useCallback)(
500
+ ({ className, ...props } = {}) => ({
501
+ className: (0, import_utils5.cx)(className, yAxisClassName),
502
+ hide: !withYAxis,
503
+ axisLine: false,
504
+ ...yAxisKey,
505
+ tickLine: yTickLine,
506
+ tick: {
507
+ transform: "translate(-10, 0)",
508
+ fill: "currentColor"
509
+ },
510
+ allowDecimals: true,
511
+ unit,
512
+ tickFormatter: yAxisTickFormatter,
513
+ ...props,
514
+ ...yAxisReChartsProps
515
+ }),
516
+ [
517
+ yAxisClassName,
518
+ withYAxis,
519
+ yAxisKey,
520
+ yTickLine,
521
+ unit,
522
+ yAxisTickFormatter,
523
+ yAxisReChartsProps
524
+ ]
525
+ );
526
+ return { getXAxisProps, getYAxisProps };
527
+ };
528
+ var valueToPercent = (value) => {
529
+ return `${(value * 100).toFixed(0)}%`;
530
+ };
531
+
532
+ // src/use-chart-grid.ts
533
+ var import_core6 = require("@yamada-ui/core");
534
+ var import_utils6 = require("@yamada-ui/utils");
535
+ var import_react3 = require("react");
536
+ var useChartGrid = ({
537
+ gridProps = {},
538
+ gridAxis = "x",
539
+ strokeDasharray = "5 5",
540
+ styles
541
+ }) => {
542
+ const { theme } = (0, import_core6.useTheme)();
543
+ const [reChartsProps, propClassName] = getComponentProps(
544
+ [gridProps, gridProperties],
545
+ styles.grid
546
+ )(theme);
547
+ const getGridProps = (0, import_react3.useCallback)(
548
+ ({ className, ...props } = {}, ref = null) => ({
549
+ ref,
550
+ className: (0, import_utils6.cx)("ui-chart__grid", className, propClassName),
551
+ strokeDasharray,
552
+ vertical: gridAxis === "y" || gridAxis === "xy",
553
+ horizontal: gridAxis === "x" || gridAxis === "xy",
554
+ ...props,
555
+ ...reChartsProps
556
+ }),
557
+ [propClassName, strokeDasharray, gridAxis, reChartsProps]
558
+ );
559
+ return { getGridProps };
560
+ };
561
+
562
+ // src/use-chart-legend.ts
563
+ var import_utils7 = require("@yamada-ui/utils");
564
+ var import_react4 = require("react");
565
+ var useChartLegend = ({
566
+ legendProps: _legendProps = {}
567
+ }) => {
568
+ const [rest, legendProps] = (0, import_utils7.splitObject)(
569
+ _legendProps,
570
+ legendProperties
571
+ );
572
+ const getLegendProps = (0, import_react4.useCallback)(
573
+ (props, ref = null) => {
574
+ return {
575
+ ref,
576
+ verticalAlign: "top",
577
+ ...props,
578
+ ...rest
579
+ };
580
+ },
581
+ [rest]
582
+ );
583
+ return { legendProps, getLegendProps };
584
+ };
585
+
586
+ // src/use-chart-reference-line.ts
587
+ var import_core7 = require("@yamada-ui/core");
588
+ var import_utils8 = require("@yamada-ui/utils");
589
+ var import_react5 = require("react");
590
+ var useChartReferenceLine = ({
591
+ referenceLineProps = [],
592
+ styles
593
+ }) => {
594
+ const { theme } = (0, import_core7.useTheme)();
595
+ const styleClassName = (0, import_core7.getCSS)(styles.referenceLine)(theme);
596
+ const propList = (0, import_react5.useMemo)(
597
+ () => referenceLineProps.map((props, index) => {
598
+ const [{ label: labelProp, ...rest }, propClassName] = getComponentProps(
599
+ [props, referenceLineProperties],
600
+ styleClassName
601
+ )(theme);
602
+ const color = `var(--ui-reference-line-${index})`;
603
+ const label = {
604
+ value: labelProp,
605
+ fill: color,
606
+ position: "insideBottomLeft",
607
+ ...(0, import_utils8.isObject)(labelProp) ? labelProp : {}
608
+ };
609
+ return { propClassName, color, label, ...rest };
610
+ }),
611
+ [referenceLineProps, styleClassName, theme]
612
+ );
613
+ const getReferenceLineProps = (0, import_react5.useCallback)(
614
+ ({ index, className, ...props }, ref = null) => {
615
+ const { propClassName, color, label, ...rest } = propList[index];
616
+ return {
617
+ ref,
618
+ className: (0, import_utils8.cx)(className, propClassName),
619
+ stroke: color,
620
+ label,
621
+ ...props,
622
+ ...rest
623
+ };
624
+ },
625
+ [propList]
626
+ );
627
+ return { getReferenceLineProps };
628
+ };
629
+
630
+ // src/use-chart-tooltip.ts
631
+ var import_utils9 = require("@yamada-ui/utils");
632
+ var import_react6 = require("react");
633
+ var useChartTooltip = ({
634
+ tooltipProps: _tooltipProps = {},
635
+ tooltipAnimationDuration = 0,
636
+ styles
637
+ }) => {
638
+ const { cursor, ...rest } = _tooltipProps;
639
+ const resolvedCursor = (0, import_react6.useMemo)(
640
+ () => ({ ...styles.cursor, ...cursor }),
641
+ [cursor, styles]
642
+ );
643
+ const tooltipVars = (0, import_react6.useMemo)(
644
+ () => [
645
+ {
646
+ __prefix: "ui",
647
+ name: "cursor-fill",
648
+ token: "colors",
649
+ value: resolvedCursor.fill
650
+ },
651
+ {
652
+ __prefix: "ui",
653
+ name: "cursor-stroke",
654
+ token: "colors",
655
+ value: resolvedCursor.stroke
656
+ },
657
+ {
658
+ __prefix: "ui",
659
+ name: "cursor-stroke-width",
660
+ token: "colors",
661
+ value: resolvedCursor.strokeWidth
662
+ },
663
+ {
664
+ __prefix: "ui",
665
+ name: "cursor-stroke-dasharray",
666
+ token: "colors",
667
+ value: resolvedCursor.strokeDasharray
668
+ }
669
+ ],
670
+ [resolvedCursor]
671
+ );
672
+ const [tooltipProps, tooltipUIProps] = (0, import_utils9.splitObject)(
673
+ rest,
674
+ tooltipProperties
675
+ );
676
+ const getTooltipProps = (0, import_react6.useCallback)(
677
+ (props, ref = null) => ({
678
+ ref,
679
+ animationDuration: tooltipAnimationDuration,
680
+ isAnimationActive: (tooltipAnimationDuration || 0) > 0,
681
+ cursor: {
682
+ fill: "var(--ui-cursor-fill)",
683
+ stroke: "var(--ui-cursor-stroke)",
684
+ strokeWidth: "var(--ui-cursor-stroke-width)",
685
+ strokeDasharray: "var(--ui-cursor-stroke-dasharray)"
686
+ },
687
+ ...props,
688
+ ...tooltipProps
689
+ }),
690
+ [tooltipAnimationDuration, tooltipProps]
691
+ );
692
+ return { tooltipProps: tooltipUIProps, getTooltipProps, tooltipVars };
693
+ };
694
+
695
+ // src/use-line-chart.ts
696
+ var import_core8 = require("@yamada-ui/core");
697
+ var import_utils10 = require("@yamada-ui/utils");
698
+ var import_react7 = require("react");
699
+ var useLineChart = ({
700
+ data,
701
+ series,
702
+ layoutType = "horizontal",
703
+ withDots = true,
704
+ withActiveDots = true,
705
+ curveType = "monotone",
706
+ strokeWidth = 2,
707
+ connectNulls = true,
708
+ referenceLineProps,
709
+ fillOpacity = 1,
710
+ styles,
711
+ ...rest
712
+ }) => {
713
+ var _a;
714
+ const { theme } = (0, import_core8.useTheme)();
715
+ const [highlightedArea, setHighlightedArea] = (0, import_react7.useState)(null);
716
+ const shouldHighlight = highlightedArea !== null;
717
+ const {
718
+ dot = {},
719
+ activeDot = {},
720
+ dimDot,
721
+ dimLine,
722
+ ...computedLineProps
723
+ } = (_a = rest.lineProps) != null ? _a : {};
724
+ const lineColors = (0, import_react7.useMemo)(
725
+ () => series.map(({ color }, index) => ({
726
+ __prefix: "ui",
727
+ name: `line-${index}`,
728
+ token: "colors",
729
+ value: color != null ? color : "transparent"
730
+ })),
731
+ [series]
732
+ );
733
+ const referenceLineColors = (0, import_react7.useMemo)(
734
+ () => referenceLineProps ? referenceLineProps.map(({ color }, index) => ({
735
+ __prefix: "ui",
736
+ name: `reference-line-${index}`,
737
+ token: "colors",
738
+ value: color != null ? color : "transparent"
739
+ })) : [],
740
+ [referenceLineProps]
741
+ );
742
+ const lineVars = (0, import_react7.useMemo)(
743
+ () => [
744
+ ...lineColors,
745
+ ...referenceLineColors,
746
+ { __prefix: "ui", name: "fill-opacity", value: fillOpacity }
747
+ ],
748
+ [fillOpacity, lineColors, referenceLineColors]
749
+ );
750
+ const [lineChartProps, lineChartClassName] = (0, import_react7.useMemo)(
751
+ () => {
752
+ var _a2;
753
+ return getComponentProps(
754
+ [(_a2 = rest.lineChartProps) != null ? _a2 : {}, lineChartProperties],
755
+ styles.chart
756
+ )(theme);
757
+ },
758
+ [rest.lineChartProps, styles.chart, theme]
759
+ );
760
+ const [lineProps, lineClassName] = (0, import_react7.useMemo)(() => {
761
+ const resolvedLineProps = {
762
+ fillOpacity: "var(--ui-fill-opacity)",
763
+ strokeOpacity: "var(--ui-fill-opacity)",
764
+ ...computedLineProps
765
+ };
766
+ return getComponentProps(
767
+ [resolvedLineProps, lineProperties],
768
+ styles.line
769
+ )(theme);
770
+ }, [computedLineProps, styles.line, theme]);
771
+ const [dimLineProps, dimLineClassName] = (0, import_react7.useMemo)(() => {
772
+ const resolvedDimLine = { fillOpacity: 0, strokeOpacity: 0.3, ...dimLine };
773
+ return getComponentProps([resolvedDimLine, lineProperties])(
774
+ theme
775
+ );
776
+ }, [dimLine, theme]);
777
+ const [dotProps, dotClassName] = (0, import_react7.useMemo)(() => {
778
+ const resolvedDot = { fillOpacity: 1, strokeOpacity: 1, ...dot };
779
+ return getComponentProps(
780
+ [resolvedDot, dotProperties],
781
+ styles.dot
782
+ )(theme);
783
+ }, [dot, styles.dot, theme]);
784
+ const [activeDotProps, activeDotClassName] = (0, import_react7.useMemo)(
785
+ () => getComponentProps(
786
+ [activeDot, dotProperties],
787
+ styles.activeDot
788
+ )(theme),
789
+ [activeDot, styles.activeDot, theme]
790
+ );
791
+ const [dimDotProps, dimDotClassName] = (0, import_react7.useMemo)(() => {
792
+ const resolvedDimDot = {
793
+ fillOpacity: 0,
794
+ strokeOpacity: 0,
795
+ ...dimDot
796
+ };
797
+ return getComponentProps([resolvedDimDot, dotProperties])(
798
+ theme
799
+ );
800
+ }, [dimDot, theme]);
801
+ const linePropList = (0, import_react7.useMemo)(
802
+ () => series.map((props, index) => {
803
+ const {
804
+ dataKey,
805
+ dot: dot2 = {},
806
+ activeDot: activeDot2 = {},
807
+ dimDot: dimDot2 = {},
808
+ dimLine: dimLine2 = {},
809
+ ...computedProps
810
+ } = props;
811
+ const color = `var(--ui-line-${index})`;
812
+ const dimmed = shouldHighlight && highlightedArea !== dataKey;
813
+ const computedDimLine = { ...dimLineProps, ...dimLine2 };
814
+ const resolvedProps = {
815
+ ...lineProps,
816
+ ...computedProps,
817
+ ...dimmed ? computedDimLine : {}
818
+ };
819
+ const rest2 = getComponentProps(
820
+ [resolvedProps, lineProperties],
821
+ lineClassName,
822
+ dimmed ? dimLineClassName : void 0
823
+ )(theme, true);
824
+ let resolvedActiveDot;
825
+ if (withActiveDots) {
826
+ const computedActiveDot = { ...activeDotProps, ...activeDot2 };
827
+ const [rest3, className] = getComponentProps(
828
+ [computedActiveDot, dotProperties],
829
+ activeDotClassName
830
+ )(theme);
831
+ resolvedActiveDot = {
832
+ className: (0, import_utils10.cx)("ui-line-chart__active-dot", className),
833
+ fill: color,
834
+ stroke: color,
835
+ r: 4,
836
+ ...rest3
837
+ };
838
+ } else {
839
+ resolvedActiveDot = false;
840
+ }
841
+ let resolvedDot;
842
+ if (withDots) {
843
+ const computedDimDot = { ...dimDotProps, ...dimDot2 };
844
+ const computedDot = {
845
+ ...dotProps,
846
+ ...dot2,
847
+ ...dimmed ? computedDimDot : {}
848
+ };
849
+ const [rest3, className] = getComponentProps(
850
+ [computedDot, dotProperties],
851
+ dotClassName,
852
+ dimmed ? dimDotClassName : void 0
853
+ )(theme);
854
+ resolvedDot = {
855
+ className: (0, import_utils10.cx)("ui-line-chart__dot", className),
856
+ fill: color,
857
+ ...rest3
858
+ };
859
+ } else {
860
+ resolvedDot = false;
861
+ }
862
+ return {
863
+ ...rest2,
864
+ color,
865
+ dataKey,
866
+ activeDot: resolvedActiveDot,
867
+ dot: resolvedDot
868
+ };
869
+ }),
870
+ [
871
+ series,
872
+ shouldHighlight,
873
+ highlightedArea,
874
+ dimLineProps,
875
+ lineProps,
876
+ lineClassName,
877
+ dimLineClassName,
878
+ theme,
879
+ withActiveDots,
880
+ withDots,
881
+ activeDotProps,
882
+ activeDotClassName,
883
+ dimDotProps,
884
+ dotProps,
885
+ dotClassName,
886
+ dimDotClassName
887
+ ]
888
+ );
889
+ const getLineChartProps = (0, import_react7.useCallback)(
890
+ ({ className, ...props } = {}, ref = null) => ({
891
+ ref,
892
+ className: (0, import_utils10.cx)(className, lineChartClassName),
893
+ data,
894
+ layout: layoutType,
895
+ ...props,
896
+ ...lineChartProps
897
+ }),
898
+ [data, layoutType, lineChartClassName, lineChartProps]
899
+ );
900
+ const getLineProps = (0, import_react7.useCallback)(
901
+ ({ index, className: classNameProp, ...props }, ref = null) => {
902
+ const { color, className, dataKey, activeDot: activeDot2, dot: dot2, ...rest2 } = linePropList[index];
903
+ return {
904
+ ref,
905
+ className: (0, import_utils10.cx)(classNameProp, className),
906
+ activeDot: activeDot2,
907
+ dot: dot2,
908
+ name: dataKey,
909
+ type: curveType,
910
+ dataKey,
911
+ fill: color,
912
+ strokeWidth,
913
+ stroke: color,
914
+ isAnimationActive: false,
915
+ connectNulls,
916
+ ...props,
917
+ ...rest2
918
+ };
919
+ },
920
+ [connectNulls, curveType, linePropList, strokeWidth]
921
+ );
922
+ return {
923
+ getLineProps,
924
+ getLineChartProps,
925
+ lineVars,
926
+ setHighlightedArea
927
+ };
928
+ };
929
+
930
+ // src/line-chart.tsx
931
+ var import_jsx_runtime3 = require("react/jsx-runtime");
932
+ var LineChart = (0, import_core9.forwardRef)((props, ref) => {
933
+ const [styles, mergedProps] = (0, import_core9.useMultiComponentStyle)("LineChart", props);
934
+ const {
935
+ className,
936
+ containerProps,
937
+ gridProps,
938
+ gridAxis,
939
+ strokeDasharray,
940
+ dataKey,
941
+ type,
942
+ layoutType,
943
+ tickLine,
944
+ withXAxis,
945
+ withYAxis,
946
+ xAxisProps,
947
+ yAxisProps,
948
+ unit,
949
+ valueFormatter,
950
+ referenceLineProps,
951
+ tooltipProps,
952
+ tooltipAnimationDuration,
953
+ legendProps,
954
+ withLegend = false,
955
+ withTooltip = true,
956
+ series,
957
+ data,
958
+ lineChartProps,
959
+ lineProps,
960
+ withDots,
961
+ withActiveDots,
962
+ curveType,
963
+ strokeWidth,
964
+ connectNulls,
965
+ fillOpacity,
966
+ ...rest
967
+ } = (0, import_core9.omitThemeProps)(mergedProps);
968
+ const { getLineProps, getLineChartProps, lineVars, setHighlightedArea } = useLineChart({
969
+ layoutType,
970
+ series,
971
+ referenceLineProps,
972
+ data,
973
+ lineChartProps,
974
+ lineProps,
975
+ withDots,
976
+ withActiveDots,
977
+ curveType,
978
+ strokeWidth,
979
+ connectNulls,
980
+ fillOpacity,
981
+ styles
982
+ });
983
+ const { getContainerProps } = useChart({ containerProps });
984
+ const { getXAxisProps, getYAxisProps } = useChartAxis({
985
+ dataKey,
986
+ type,
987
+ layoutType,
988
+ tickLine,
989
+ gridAxis,
990
+ withXAxis,
991
+ withYAxis,
992
+ xAxisProps,
993
+ yAxisProps,
994
+ unit,
995
+ valueFormatter,
996
+ styles
997
+ });
998
+ const { getReferenceLineProps } = useChartReferenceLine({
999
+ referenceLineProps,
1000
+ styles
1001
+ });
1002
+ const { getGridProps } = useChartGrid({
1003
+ gridProps,
1004
+ gridAxis,
1005
+ strokeDasharray,
1006
+ styles
1007
+ });
1008
+ const {
1009
+ tooltipProps: computedTooltipProps,
1010
+ getTooltipProps,
1011
+ tooltipVars
1012
+ } = useChartTooltip({
1013
+ tooltipProps,
1014
+ tooltipAnimationDuration,
1015
+ styles
1016
+ });
1017
+ const { legendProps: computedLegendProps, getLegendProps } = useChartLegend({
1018
+ legendProps
1019
+ });
1020
+ const lines = (0, import_react8.useMemo)(
1021
+ () => series.map(({ dataKey: dataKey2 }, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1022
+ import_recharts.Line,
1023
+ {
1024
+ ...getLineProps({ index, className: "ui-line-chart__line" })
1025
+ },
1026
+ `line-${dataKey2}`
1027
+ )),
1028
+ [getLineProps, series]
1029
+ );
1030
+ const referenceLinesItems = (0, import_react8.useMemo)(
1031
+ () => referenceLineProps == null ? void 0 : referenceLineProps.map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1032
+ import_recharts.ReferenceLine,
1033
+ {
1034
+ ...getReferenceLineProps({
1035
+ index,
1036
+ className: "ui-line-chart__reference-line"
1037
+ })
1038
+ },
1039
+ `referenceLine-${index}`
1040
+ )),
1041
+ [getReferenceLineProps, referenceLineProps]
1042
+ );
1043
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ChartProvider, { value: { styles }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1044
+ import_core9.ui.div,
1045
+ {
1046
+ ref,
1047
+ className: (0, import_utils11.cx)("ui-line-chart", className),
1048
+ var: [...lineVars, ...tooltipVars],
1049
+ __css: { maxW: "full", ...styles.container },
1050
+ ...rest,
1051
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1052
+ import_recharts.ResponsiveContainer,
1053
+ {
1054
+ ...getContainerProps({ className: "ui-line-chart__container" }),
1055
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
1056
+ import_recharts.LineChart,
1057
+ {
1058
+ ...getLineChartProps({ className: "ui-line-chart__chart" }),
1059
+ children: [
1060
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1061
+ import_recharts.CartesianGrid,
1062
+ {
1063
+ ...getGridProps({ className: "ui-line-chart__grid" })
1064
+ }
1065
+ ),
1066
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_recharts.XAxis, { ...getXAxisProps({ className: "ui-line-chart__x-axis" }) }),
1067
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_recharts.YAxis, { ...getYAxisProps({ className: "ui-line-chart__y-axis" }) }),
1068
+ withLegend ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1069
+ import_recharts.Legend,
1070
+ {
1071
+ content: ({ payload }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1072
+ ChartLegend,
1073
+ {
1074
+ className: "ui-line-chart__legend",
1075
+ payload,
1076
+ onHighlight: setHighlightedArea,
1077
+ ...computedLegendProps
1078
+ }
1079
+ ),
1080
+ ...getLegendProps()
1081
+ }
1082
+ ) : null,
1083
+ withTooltip ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1084
+ import_recharts.Tooltip,
1085
+ {
1086
+ content: ({ label, payload }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1087
+ ChartTooltip,
1088
+ {
1089
+ className: "ui-line-chart__tooltip",
1090
+ label,
1091
+ payload,
1092
+ valueFormatter,
1093
+ unit,
1094
+ ...computedTooltipProps
1095
+ }
1096
+ ),
1097
+ ...getTooltipProps()
1098
+ }
1099
+ ) : null,
1100
+ lines,
1101
+ referenceLinesItems
1102
+ ]
1103
+ }
1104
+ )
1105
+ }
1106
+ )
1107
+ }
1108
+ ) });
1109
+ });
1110
+ // Annotate the CommonJS export names for ESM import in node:
1111
+ 0 && (module.exports = {
1112
+ LineChart
1113
+ });
1114
+ //# sourceMappingURL=line-chart.js.map