@acronis-platform/ui-react 0.60.0 → 0.62.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 (99) hide show
  1. package/README.md +5 -5
  2. package/dist/components/ui/app-shell/app-shell.js.map +1 -1
  3. package/dist/components/ui/area-chart/area-chart.js +209 -146
  4. package/dist/components/ui/area-chart/area-chart.js.map +1 -1
  5. package/dist/components/ui/avatar/avatar.js +26 -23
  6. package/dist/components/ui/avatar/avatar.js.map +1 -1
  7. package/dist/components/ui/bar-chart/bar-chart.js +595 -180
  8. package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
  9. package/dist/components/ui/calendar-panel/calendar-panel-utils.js +63 -0
  10. package/dist/components/ui/calendar-panel/calendar-panel-utils.js.map +1 -0
  11. package/dist/components/ui/calendar-panel/calendar-panel.js +260 -0
  12. package/dist/components/ui/calendar-panel/calendar-panel.js.map +1 -0
  13. package/dist/components/ui/category-bar/category-bar.js +98 -77
  14. package/dist/components/ui/category-bar/category-bar.js.map +1 -1
  15. package/dist/components/ui/chart/chart-format.js +144 -14
  16. package/dist/components/ui/chart/chart-format.js.map +1 -1
  17. package/dist/components/ui/chart/chart.js +204 -150
  18. package/dist/components/ui/chart/chart.js.map +1 -1
  19. package/dist/components/ui/composed-chart/composed-chart.js +422 -125
  20. package/dist/components/ui/composed-chart/composed-chart.js.map +1 -1
  21. package/dist/components/ui/confidence-cone/confidence-cone.js +308 -202
  22. package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -1
  23. package/dist/components/ui/filter-cards/filter-cards.js +25 -0
  24. package/dist/components/ui/filter-cards/filter-cards.js.map +1 -0
  25. package/dist/components/ui/funnel-chart/funnel-chart.js +245 -51
  26. package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -1
  27. package/dist/components/ui/histogram/histogram.js +85 -81
  28. package/dist/components/ui/histogram/histogram.js.map +1 -1
  29. package/dist/components/ui/line-chart/line-chart.js +227 -184
  30. package/dist/components/ui/line-chart/line-chart.js.map +1 -1
  31. package/dist/components/ui/metric/metric.js +88 -70
  32. package/dist/components/ui/metric/metric.js.map +1 -1
  33. package/dist/components/ui/pie-chart/pie-chart.js +234 -80
  34. package/dist/components/ui/pie-chart/pie-chart.js.map +1 -1
  35. package/dist/components/ui/radar-chart/radar-chart.js +210 -57
  36. package/dist/components/ui/radar-chart/radar-chart.js.map +1 -1
  37. package/dist/components/ui/radial-bar-chart/radial-bar-chart.js +358 -50
  38. package/dist/components/ui/radial-bar-chart/radial-bar-chart.js.map +1 -1
  39. package/dist/components/ui/resizable/resizable.js +23 -11
  40. package/dist/components/ui/resizable/resizable.js.map +1 -1
  41. package/dist/components/ui/sankey-chart/sankey-chart.js +25 -18
  42. package/dist/components/ui/sankey-chart/sankey-chart.js.map +1 -1
  43. package/dist/components/ui/scatter-chart/scatter-chart.js +86 -78
  44. package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -1
  45. package/dist/components/ui/sidebar-secondary/sidebar-secondary.js.map +1 -1
  46. package/dist/components/ui/timeline/timeline.js +206 -142
  47. package/dist/components/ui/timeline/timeline.js.map +1 -1
  48. package/dist/components/ui/treemap/treemap.js +183 -59
  49. package/dist/components/ui/treemap/treemap.js.map +1 -1
  50. package/dist/index.js +446 -420
  51. package/dist/index.js.map +1 -1
  52. package/dist/node_modules/.pnpm/react-day-picker@10.0.1_@types_react@19.2.15_react@19.2.6/node_modules/react-day-picker/dist/esm/useDayPicker.js +3 -3
  53. package/dist/react.js +446 -420
  54. package/dist/react.js.map +1 -1
  55. package/dist/src/components/ui/area-chart/area-chart.d.ts +53 -3
  56. package/dist/src/components/ui/area-chart/index.d.ts +1 -1
  57. package/dist/src/components/ui/avatar/avatar.d.ts +1 -1
  58. package/dist/src/components/ui/bar-chart/bar-chart.d.ts +154 -16
  59. package/dist/src/components/ui/bar-chart/index.d.ts +1 -1
  60. package/dist/src/components/ui/button/button.d.ts +1 -1
  61. package/dist/src/components/ui/button-menu/button-menu.d.ts +1 -1
  62. package/dist/src/components/ui/calendar-panel/__tests__/calendar-panel-utils.test.d.ts +1 -0
  63. package/dist/src/components/ui/calendar-panel/calendar-panel-utils.d.ts +55 -0
  64. package/dist/src/components/ui/calendar-panel/calendar-panel.d.ts +112 -0
  65. package/dist/src/components/ui/calendar-panel/index.d.ts +1 -0
  66. package/dist/src/components/ui/chart/__tests__/chart-layout.d.ts +63 -0
  67. package/dist/src/components/ui/chart/__tests__/chart-layout.test.d.ts +1 -0
  68. package/dist/src/components/ui/chart/chart-format.d.ts +415 -0
  69. package/dist/src/components/ui/chart/chart.d.ts +9 -3
  70. package/dist/src/components/ui/chart/index.d.ts +2 -2
  71. package/dist/src/components/ui/composed-chart/composed-chart.d.ts +156 -7
  72. package/dist/src/components/ui/composed-chart/index.d.ts +1 -1
  73. package/dist/src/components/ui/confidence-cone/confidence-cone.d.ts +138 -20
  74. package/dist/src/components/ui/confidence-cone/index.d.ts +1 -1
  75. package/dist/src/components/ui/filter-cards/filter-cards.d.ts +11 -0
  76. package/dist/src/components/ui/filter-cards/index.d.ts +1 -0
  77. package/dist/src/components/ui/funnel-chart/funnel-chart.d.ts +201 -3
  78. package/dist/src/components/ui/funnel-chart/index.d.ts +1 -1
  79. package/dist/src/components/ui/histogram/histogram.d.ts +2 -2
  80. package/dist/src/components/ui/line-chart/index.d.ts +1 -1
  81. package/dist/src/components/ui/line-chart/line-chart.d.ts +51 -3
  82. package/dist/src/components/ui/pie-chart/index.d.ts +1 -1
  83. package/dist/src/components/ui/pie-chart/pie-chart.d.ts +145 -4
  84. package/dist/src/components/ui/radar-chart/index.d.ts +1 -1
  85. package/dist/src/components/ui/radar-chart/radar-chart.d.ts +219 -6
  86. package/dist/src/components/ui/radial-bar-chart/index.d.ts +1 -1
  87. package/dist/src/components/ui/radial-bar-chart/radial-bar-chart.d.ts +215 -9
  88. package/dist/src/components/ui/scatter-chart/scatter-chart.d.ts +2 -2
  89. package/dist/src/components/ui/timeline/index.d.ts +1 -1
  90. package/dist/src/components/ui/timeline/timeline.d.ts +79 -20
  91. package/dist/src/components/ui/treemap/index.d.ts +1 -1
  92. package/dist/src/components/ui/treemap/treemap.d.ts +68 -8
  93. package/dist/src/index.d.ts +2 -1
  94. package/dist/ui-react.css +1 -1
  95. package/package.json +2 -2
  96. package/dist/components/ui/search-global/search-global.js +0 -60
  97. package/dist/components/ui/search-global/search-global.js.map +0 -1
  98. package/dist/src/components/ui/search-global/index.d.ts +0 -1
  99. package/dist/src/components/ui/search-global/search-global.d.ts +0 -7
@@ -1,16 +1,20 @@
1
- import { jsx as e, jsxs as at } from "react/jsx-runtime";
2
- import * as m from "react";
3
- import { cva as nt } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
4
- import { ComposedChart as ot, LineChart as it, CartesianGrid as rt, XAxis as lt, YAxis as st, Area as dt, Line as ct } from "recharts";
5
- import { cn as mt } from "../../../lib/utils.js";
6
- import { ChartContainer as ft, ChartTooltip as C, ChartTooltipContent as b, ChartLegend as _, ChartLegendContent as B } from "../chart/chart.js";
7
- import { resolveAxisDomain as ht } from "../chart/chart-format.js";
8
- const ut = nt("", {
1
+ import { jsx as t, jsxs as Re } from "react/jsx-runtime";
2
+ import * as u from "react";
3
+ import { cva as _e } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
4
+ import { ComposedChart as Be, LineChart as xe, CartesianGrid as Fe, XAxis as Ne, YAxis as ke, Area as Ee, Line as Pe, LabelList as $e, ReferenceLine as Me, Brush as ze } from "recharts";
5
+ import { cn as He } from "../../../lib/utils.js";
6
+ import { resolveAnimation as Ie, CHART_LABEL_MARGIN as Oe, resolveRotatedTickAnchor as Xe, CHART_LABEL_FONT_SIZE as je, resolveLabelFillClass as Ve, toLabelFormatter as We, resolveChartReferenceValue as we, resolveReferenceLineProps as Ge, resolveBrushProps as Ye, resolveXAxisTitle as Ze, resolveXAxisHeight as qe, resolveYAxisTitle as Je, resolveAxisDomain as Ke, toReferenceLineList as Qe } from "../chart/chart-format.js";
7
+ import { ChartContainer as Ue, ChartTooltip as ge, ChartLegend as Se, ChartTooltipContent as P, ChartLegendContent as $ } from "../chart/chart.js";
8
+ const eo = _e("", {
9
9
  variants: {
10
10
  curve: {
11
11
  linear: "",
12
12
  monotone: "",
13
- step: ""
13
+ natural: "",
14
+ basis: "",
15
+ step: "",
16
+ stepBefore: "",
17
+ stepAfter: ""
14
18
  },
15
19
  lineStyle: {
16
20
  solid: "",
@@ -21,214 +25,253 @@ const ut = nt("", {
21
25
  curve: "monotone",
22
26
  lineStyle: "solid"
23
27
  }
24
- }), $ = "__band_";
25
- function T(n) {
28
+ }), M = "__band_";
29
+ function A(n) {
26
30
  return n == null ? void 0 : n.filter(
27
- (l) => !String(l.dataKey).startsWith($)
31
+ (h) => !String(h.dataKey).startsWith(M)
28
32
  );
29
33
  }
30
- function vt(n) {
34
+ function oo(n) {
31
35
  return function(i) {
32
36
  const s = {
33
37
  ...i,
34
- payload: T(i.payload)
38
+ payload: A(i.payload)
35
39
  };
36
- return typeof n == "function" ? m.createElement(
40
+ return typeof n == "function" ? u.createElement(
37
41
  n,
38
42
  s
39
- ) : m.cloneElement(n, s);
43
+ ) : u.cloneElement(n, s);
40
44
  };
41
45
  }
42
- const pt = m.forwardRef(
46
+ const ao = u.forwardRef(
43
47
  ({
44
48
  className: n,
45
- config: l,
49
+ config: h,
46
50
  data: i,
47
51
  dataKeys: s,
48
- comparisonKeys: f,
49
- deltaBands: A,
50
- xKey: E,
51
- xAxisLabel: d,
52
- yAxisLabel: h,
53
- yUnit: F,
54
- curve: c = "monotone",
55
- lineStyle: u = "solid",
56
- strokeWidth: M = 2,
57
- showDots: k = !0,
58
- connectNulls: D = !1,
59
- showGrid: R = !0,
60
- showTooltip: S = !0,
61
- showLegend: N = !0,
62
- showXAxis: j = !0,
63
- showYAxis: z = !0,
64
- xTickFormatter: I,
65
- yTickFormatter: O,
66
- xAxisAngle: r,
67
- xAxisInterval: V,
68
- yAxisTickCount: X,
69
- yAxisDomain: G,
70
- gridDashed: H,
71
- gridHorizontal: P,
72
- gridVertical: W,
73
- tooltipContent: v,
74
- ...Y
75
- }, q) => {
76
- const x = u === "dashed" ? "5 5" : void 0, J = ht(G), K = d || r != null ? 30 + (r != null ? 20 : 0) + (d ? 18 : 0) : void 0, L = m.useMemo(
77
- () => v ? vt(v) : void 0,
78
- [v]
79
- ), Q = d ? { value: d, position: "insideBottom", offset: 0 } : void 0, U = h ? {
80
- value: h,
81
- angle: -90,
82
- position: "insideLeft",
83
- style: { textAnchor: "middle" }
84
- } : void 0, o = (A ?? []).map(([t, a], p) => ({
85
- field: `${$}${p}`,
86
- current: t,
52
+ comparisonKeys: v,
53
+ deltaBands: z,
54
+ xKey: T,
55
+ xAxisLabel: y,
56
+ yAxisLabel: D,
57
+ yUnit: H,
58
+ curve: p = "monotone",
59
+ lineStyle: L = "solid",
60
+ strokeWidth: I = 2,
61
+ showDots: O = !0,
62
+ dotSize: X = 3,
63
+ showActiveDot: j,
64
+ connectNulls: R = !1,
65
+ lineSettings: r,
66
+ referenceLine: V,
67
+ showGrid: W = !0,
68
+ showTooltip: w = !0,
69
+ showLegend: G = !0,
70
+ showXAxis: Y = !0,
71
+ showYAxis: Z = !0,
72
+ xTickFormatter: _,
73
+ yTickFormatter: q,
74
+ xAxisAngle: b,
75
+ xAxisInterval: J,
76
+ yAxisTickCount: K,
77
+ yAxisDomain: Q,
78
+ gridDashed: U,
79
+ gridHorizontal: g,
80
+ gridVertical: S,
81
+ tooltipContent: C,
82
+ animate: ee,
83
+ animationDuration: oe,
84
+ animationBegin: ae,
85
+ animationEasing: te,
86
+ showLabels: B = !1,
87
+ labelPosition: re,
88
+ labelFormatter: ne,
89
+ showBrush: ie = !1,
90
+ brushHeight: se,
91
+ brushAriaLabel: le,
92
+ ...ce
93
+ }, de) => {
94
+ const x = Ie({
95
+ animate: ee,
96
+ animationDuration: oe,
97
+ animationBegin: ae,
98
+ animationEasing: te
99
+ }), he = re ?? "top", me = Ke(Q), fe = Qe(V), F = (e) => {
100
+ var a;
101
+ return ((a = r == null ? void 0 : r[e]) == null ? void 0 : a.color) ?? `var(--color-${e})`;
102
+ }, N = (e) => {
103
+ var a;
104
+ return ((a = r == null ? void 0 : r[e]) == null ? void 0 : a.curveType) ?? p ?? "monotone";
105
+ }, ue = B || Object.values(r ?? {}).some((e) => e.showLabel), ve = qe(y, b), pe = u.useMemo(
106
+ () => C ? oo(C) : void 0,
107
+ [C]
108
+ ), Le = Ze(y), be = Je(D), l = (z ?? []).map(([e, a], o) => ({
109
+ field: `${M}${o}`,
110
+ current: e,
87
111
  comparison: a
88
- })), Z = o.length ? i.map((t) => {
89
- const a = { ...t };
90
- for (const { field: p, current: tt, comparison: et } of o) {
91
- const y = t[tt], g = t[et];
92
- a[p] = typeof y == "number" && typeof g == "number" ? [Math.min(y, g), Math.max(y, g)] : void 0;
112
+ })), k = l.length > 0, Ce = pe ?? (k ? ((e) => /* @__PURE__ */ t(
113
+ P,
114
+ {
115
+ active: e.active,
116
+ label: e.label,
117
+ payload: A(
118
+ e.payload
119
+ )
120
+ }
121
+ )) : /* @__PURE__ */ t(P, {})), Ae = k ? ((e) => /* @__PURE__ */ t(
122
+ $,
123
+ {
124
+ verticalAlign: e.verticalAlign,
125
+ payload: A(e.payload)
126
+ }
127
+ )) : /* @__PURE__ */ t($, {}), Te = l.length ? i.map((e) => {
128
+ const a = { ...e };
129
+ for (const { field: o, current: m, comparison: f } of l) {
130
+ const c = e[m], d = e[f];
131
+ a[o] = typeof c == "number" && typeof d == "number" ? [Math.min(c, d), Math.max(c, d)] : void 0;
93
132
  }
94
133
  return a;
95
- }) : i, w = o.length > 0 ? ot : it;
96
- return /* @__PURE__ */ e(
134
+ }) : i, ye = l.length > 0 ? Be : xe;
135
+ return /* @__PURE__ */ t(
97
136
  "div",
98
137
  {
99
- ref: q,
100
- "data-curve": c,
101
- "data-line-style": u,
102
- className: mt(ut({ curve: c, lineStyle: u }), n),
103
- ...Y,
104
- children: /* @__PURE__ */ e(
105
- ft,
138
+ ref: de,
139
+ "data-curve": p,
140
+ "data-line-style": L,
141
+ className: He(eo({ curve: p, lineStyle: L }), n),
142
+ ...ce,
143
+ children: /* @__PURE__ */ t(
144
+ Ue,
106
145
  {
107
- config: l,
146
+ config: h,
108
147
  className: "size-full [&_.recharts-label]:fill-foreground",
109
- children: /* @__PURE__ */ at(w, { data: Z, children: [
110
- R && /* @__PURE__ */ e(
111
- rt,
112
- {
113
- horizontal: P ?? !0,
114
- vertical: W ?? !1,
115
- strokeDasharray: H ? "3 3" : void 0
116
- }
117
- ),
118
- /* @__PURE__ */ e(
119
- lt,
120
- {
121
- dataKey: E,
122
- type: "category",
123
- hide: !j,
124
- tickLine: !1,
125
- axisLine: !1,
126
- tickMargin: 8,
127
- tickFormatter: I,
128
- angle: r,
129
- interval: V,
130
- textAnchor: r != null ? r < 0 ? "end" : "start" : void 0,
131
- height: K,
132
- label: Q
133
- }
134
- ),
135
- /* @__PURE__ */ e(
136
- st,
137
- {
138
- type: "number",
139
- hide: !z,
140
- tickLine: !1,
141
- axisLine: !1,
142
- unit: F,
143
- tickFormatter: O,
144
- tickCount: X,
145
- domain: J,
146
- width: h ? 72 : void 0,
147
- label: U
148
- }
149
- ),
150
- S && (L ? (
151
- // Strips the synthetic delta bands before the caller's tooltip
152
- // sees them — the `__band_*` series feed the Areas, not the
153
- // tooltip (a no-op when no bands are configured).
154
- /* @__PURE__ */ e(C, { content: L })
155
- ) : o.length > 0 ? /* @__PURE__ */ e(
156
- C,
157
- {
158
- content: (t) => /* @__PURE__ */ e(
159
- b,
148
+ children: /* @__PURE__ */ Re(
149
+ ye,
150
+ {
151
+ data: Te,
152
+ margin: ue ? Oe : void 0,
153
+ children: [
154
+ W && /* @__PURE__ */ t(
155
+ Fe,
160
156
  {
161
- active: t.active,
162
- label: t.label,
163
- payload: T(
164
- t.payload
165
- )
157
+ horizontal: g ?? !0,
158
+ vertical: S ?? !1,
159
+ strokeDasharray: U ? "3 3" : void 0
166
160
  }
167
- )
168
- }
169
- ) : /* @__PURE__ */ e(C, { content: /* @__PURE__ */ e(b, {}) })),
170
- N && (o.length > 0 ? /* @__PURE__ */ e(
171
- _,
172
- {
173
- content: (t) => /* @__PURE__ */ e(
174
- B,
161
+ ),
162
+ /* @__PURE__ */ t(
163
+ Ne,
164
+ {
165
+ dataKey: T,
166
+ type: "category",
167
+ hide: !Y,
168
+ tickLine: !1,
169
+ axisLine: !1,
170
+ tickMargin: 8,
171
+ tickFormatter: _,
172
+ angle: b,
173
+ interval: J,
174
+ textAnchor: Xe(b),
175
+ height: ve,
176
+ label: Le
177
+ }
178
+ ),
179
+ /* @__PURE__ */ t(
180
+ ke,
181
+ {
182
+ type: "number",
183
+ hide: !Z,
184
+ tickLine: !1,
185
+ axisLine: !1,
186
+ unit: H,
187
+ tickFormatter: q,
188
+ tickCount: K,
189
+ domain: me,
190
+ width: D ? 72 : void 0,
191
+ label: be
192
+ }
193
+ ),
194
+ w && /* @__PURE__ */ t(ge, { content: Ce }),
195
+ G && /* @__PURE__ */ t(Se, { content: Ae }),
196
+ l.map(({ field: e, current: a }) => /* @__PURE__ */ t(
197
+ Ee,
198
+ {
199
+ dataKey: e,
200
+ type: N(a),
201
+ stroke: "none",
202
+ fill: F(a),
203
+ fillOpacity: 0.12,
204
+ connectNulls: R,
205
+ dot: !1,
206
+ activeDot: !1,
207
+ ...x,
208
+ legendType: "none",
209
+ tooltipType: "none"
210
+ },
211
+ e
212
+ )),
213
+ s.map((e) => {
214
+ const a = v == null ? void 0 : v.includes(e), o = r == null ? void 0 : r[e], m = !a && ((o == null ? void 0 : o.showDots) ?? O), f = (o == null ? void 0 : o.dotSize) ?? X, c = !a && (j ?? m), d = (o == null ? void 0 : o.dashed) ?? L === "dashed", De = (o == null ? void 0 : o.showLabel) ?? B, E = (o == null ? void 0 : o.labelPosition) ?? he;
215
+ return /* @__PURE__ */ t(
216
+ Pe,
217
+ {
218
+ type: N(e),
219
+ dataKey: e,
220
+ stroke: F(e),
221
+ strokeWidth: (o == null ? void 0 : o.strokeWidth) ?? I,
222
+ strokeDasharray: a || d ? "5 5" : void 0,
223
+ strokeOpacity: a ? 0.5 : void 0,
224
+ dot: m ? { r: f } : !1,
225
+ activeDot: c ? { r: f + 2 } : !1,
226
+ connectNulls: R,
227
+ ...x,
228
+ children: De && /* @__PURE__ */ t(
229
+ $e,
230
+ {
231
+ dataKey: e,
232
+ position: E,
233
+ formatter: We(ne),
234
+ className: Ve(E),
235
+ fontSize: je
236
+ }
237
+ )
238
+ },
239
+ e
240
+ );
241
+ }),
242
+ fe.map((e, a) => {
243
+ const o = we(e, i, s);
244
+ return o === void 0 ? null : /* @__PURE__ */ t(
245
+ Me,
246
+ {
247
+ y: o,
248
+ ...Ge(e.label, e.labelPosition)
249
+ },
250
+ `${e.label ?? "ref"}-${a}`
251
+ );
252
+ }),
253
+ ie && /* @__PURE__ */ t(
254
+ ze,
175
255
  {
176
- verticalAlign: t.verticalAlign,
177
- payload: T(
178
- t.payload
179
- )
256
+ dataKey: T,
257
+ tickFormatter: _,
258
+ ...Ye({ brushHeight: se, brushAriaLabel: le })
180
259
  }
181
260
  )
182
- }
183
- ) : /* @__PURE__ */ e(_, { content: /* @__PURE__ */ e(B, {}) })),
184
- o.map(({ field: t, current: a }) => /* @__PURE__ */ e(
185
- dt,
186
- {
187
- dataKey: t,
188
- type: c ?? "monotone",
189
- stroke: "none",
190
- fill: `var(--color-${a})`,
191
- fillOpacity: 0.12,
192
- connectNulls: D,
193
- dot: !1,
194
- activeDot: !1,
195
- isAnimationActive: !1,
196
- legendType: "none",
197
- tooltipType: "none"
198
- },
199
- t
200
- )),
201
- s.map((t) => {
202
- const a = f == null ? void 0 : f.includes(t);
203
- return /* @__PURE__ */ e(
204
- ct,
205
- {
206
- type: c ?? "monotone",
207
- dataKey: t,
208
- stroke: `var(--color-${t})`,
209
- strokeWidth: M,
210
- strokeDasharray: a ? "5 5" : x,
211
- strokeOpacity: a ? 0.5 : void 0,
212
- dot: !a && k ? { r: 3 } : !1,
213
- activeDot: !a && k ? { r: 5 } : !1,
214
- connectNulls: D,
215
- isAnimationActive: !1
216
- },
217
- t
218
- );
219
- })
220
- ] })
261
+ ]
262
+ }
263
+ )
221
264
  }
222
265
  )
223
266
  }
224
267
  );
225
268
  }
226
269
  );
227
- pt.displayName = "LineChart";
270
+ ao.displayName = "LineChart";
228
271
  export {
229
- pt as LineChart,
230
- vt as createBandStrippedTooltip,
231
- T as dropBandSeries,
232
- ut as lineChartVariants
272
+ ao as LineChart,
273
+ oo as createBandStrippedTooltip,
274
+ A as dropBandSeries,
275
+ eo as lineChartVariants
233
276
  };
234
277
  //# sourceMappingURL=line-chart.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"line-chart.js","sources":["../../../../src/components/ui/line-chart/line-chart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n Area,\n CartesianGrid,\n ComposedChart,\n Line,\n LineChart as RechartsLineChart,\n XAxis,\n YAxis,\n} from 'recharts';\n\nimport { cn } from '@/lib/utils';\nimport {\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartTooltip,\n ChartTooltipContent,\n resolveAxisDomain,\n type ChartConfig,\n type ChartLegendContentProps,\n type ChartTooltipContentProps,\n type CartesianChartProps,\n} from '../chart';\n\n// A typed recharts composition over the shared `Chart` primitives. The two CVA\n// axes are the design's Line-chart variant set: `curve` (how the segments\n// interpolate between points — straight, smoothed, or stepped) and `lineStyle`\n// (a solid or dashed stroke). \"single\" vs \"multi\" line is not a variant — it\n// falls out of how many `dataKeys` the caller plots. The classes stay empty\n// because recharts' SVG — not CSS — draws the lines: `curve` drives each\n// `<Line type>` and `lineStyle` drives its `strokeDasharray`. CVA is kept so the\n// variant set is a first-class, spec-conformant part of the API (matched against\n// ui-spec's api.yaml enums) and exposed via `VariantProps`; the resolved values\n// are also mirrored onto `data-curve` / `data-line-style` for styling hooks and\n// tests.\nconst lineChartVariants = cva('', {\n variants: {\n curve: {\n linear: '',\n monotone: '',\n step: '',\n },\n lineStyle: {\n solid: '',\n dashed: '',\n },\n },\n defaultVariants: {\n curve: 'monotone',\n lineStyle: 'solid',\n },\n});\n\n// Reserved field prefix for the synthetic delta-band range series. Each band\n// mints one `__band_<n>` field that feeds an <Area>; it must never surface in\n// the tooltip or legend (those describe only real, caller-supplied series).\nconst BAND_FIELD_PREFIX = '__band_';\n\n/**\n * Drop the synthetic delta-band range series from a recharts tooltip/legend\n * payload, keeping the real series (and their order). recharts already excludes\n * the band via `legendType`/`tooltipType=\"none\"`, so this is a second, explicit\n * guard — hence it's unit-tested rather than relying on that behavior.\n */\nexport function dropBandSeries<T extends { dataKey?: unknown }>(\n payload: readonly T[] | undefined\n): T[] | undefined {\n return payload?.filter(\n (item) => !String(item.dataKey).startsWith(BAND_FIELD_PREFIX)\n );\n}\n\ntype TooltipContentType = NonNullable<\n React.ComponentProps<typeof ChartTooltip>['content']\n>;\ntype TooltipContentFn = Extract<TooltipContentType, (...args: never[]) => unknown>;\ntype TooltipRenderProps = Parameters<TooltipContentFn>[0];\n\n/**\n * Wrap a caller-supplied `tooltipContent` so the synthetic delta bands are\n * stripped from the payload before it renders, while preserving recharts' own\n * mount semantics — a function is mounted via `createElement` (its own component\n * identity + hook state), an element via `cloneElement`. This mirrors what the\n * pass-through charts get by handing `content` straight to recharts, so a\n * function-form tooltip keeps its state across re-renders here too. The returned\n * component is a stable content type (memoize it on `tooltipContent`).\n */\nexport function createBandStrippedTooltip(tooltipContent: TooltipContentType) {\n return function BandStrippedTooltip(props: TooltipRenderProps) {\n const merged = {\n ...props,\n payload: dropBandSeries(props.payload),\n } as TooltipRenderProps;\n return typeof tooltipContent === 'function'\n ? React.createElement(\n tooltipContent as React.FunctionComponent<TooltipRenderProps>,\n merged\n )\n : React.cloneElement(tooltipContent, merged);\n };\n}\n\nexport interface LineChartProps\n extends Omit<React.ComponentProps<'div'>, 'children'>,\n VariantProps<typeof lineChartVariants>,\n CartesianChartProps {\n /** Row-per-point data. Each object holds the category key + one numeric field per series (`null` breaks the line unless `connectNulls`). */\n data: ReadonlyArray<Record<string, string | number | null>>;\n /**\n * Per-series map of `label` / `color` (imported from the shared `Chart`\n * primitives). Series colors are caller-supplied — reference an existing\n * semantic `--ui-*` token; there is no chart palette tier yet.\n */\n config: ChartConfig;\n /** Series to plot — one `<Line>` per key. Each must exist in `config` and in every data row. */\n dataKeys: string[];\n /**\n * Subset of `dataKeys` to render as comparison/trend overlays (e.g. a\n * previous quarter or year) — dashed, dimmed, and dot-less, so they read as\n * secondary to the current-period lines. Keeps each series' own `config` color.\n */\n comparisonKeys?: string[];\n /**\n * Pairs of `[currentKey, comparisonKey]` to shade a delta band between — a\n * dimmed area filling the gap between the two series at each point,\n * visualizing the QoQ/YoY difference. Tinted with the first key's `config`\n * color. Rows where either value isn't numeric are left un-banded.\n *\n * Each pair mints an internal `__band_<n>` field (kept out of the tooltip and\n * legend), so avoid data/`config` keys with that reserved prefix.\n */\n deltaBands?: Array<[string, string]>;\n /** Category axis key (the shared dimension across rows, e.g. `\"month\"`). */\n xKey: string;\n /** Stroke width of each line. */\n strokeWidth?: number;\n /** Render a dot at each data point. */\n showDots?: boolean;\n /** Bridge `null` gaps in the data instead of breaking the line. */\n connectNulls?: boolean;\n showLegend?: boolean;\n}\n\nconst LineChart = React.forwardRef<HTMLDivElement, LineChartProps>(\n (\n {\n className,\n config,\n data,\n dataKeys,\n comparisonKeys,\n deltaBands,\n xKey,\n xAxisLabel,\n yAxisLabel,\n yUnit,\n curve = 'monotone',\n lineStyle = 'solid',\n strokeWidth = 2,\n showDots = true,\n connectNulls = false,\n showGrid = true,\n showTooltip = true,\n showLegend = true,\n showXAxis = true,\n showYAxis = true,\n xTickFormatter,\n yTickFormatter,\n xAxisAngle,\n xAxisInterval,\n yAxisTickCount,\n yAxisDomain,\n gridDashed,\n gridHorizontal,\n gridVertical,\n tooltipContent,\n ...props\n },\n ref\n ) => {\n const dashArray = lineStyle === 'dashed' ? '5 5' : undefined;\n const yDomain = resolveAxisDomain(yAxisDomain);\n\n // Room for the X tick row: recharts' default 30, plus a rotated tick row\n // (+20) and/or the axis title (+18). Additive — both can be present at once,\n // which the old label-or-angle ternary under-allocated.\n const xAxisHeight =\n xAxisLabel || xAxisAngle != null\n ? 30 + (xAxisAngle != null ? 20 : 0) + (xAxisLabel ? 18 : 0)\n : undefined;\n\n // Memoized so recharts sees a stable content type across renders — a fresh\n // wrapper each render would remount the caller's tooltip and reset its state.\n const customTooltip = React.useMemo(\n () =>\n tooltipContent ? createBandStrippedTooltip(tooltipContent) : undefined,\n [tooltipContent]\n );\n\n // Axis titles: the X title sits below the ticks; the Y title is rotated in\n // the left gutter. Passed to recharts' native `label` (themed via the\n // `.recharts-label` fill selector on the container).\n const xAxisTitle = xAxisLabel\n ? { value: xAxisLabel, position: 'insideBottom' as const, offset: 0 }\n : undefined;\n const yAxisTitle = yAxisLabel\n ? {\n value: yAxisLabel,\n angle: -90,\n position: 'insideLeft' as const,\n style: { textAnchor: 'middle' as const },\n }\n : undefined;\n\n // Each delta band becomes a synthetic `[min, max]` range field per row that\n // a recharts <Area> shades. Rows where either series isn't numeric are left\n // un-banded (the area breaks there).\n const bands = (deltaBands ?? []).map(([current, comparison], index) => ({\n field: `${BAND_FIELD_PREFIX}${index}`,\n current,\n comparison,\n }));\n const chartData = bands.length\n ? data.map((row) => {\n const augmented: Record<string, unknown> = { ...row };\n for (const { field, current, comparison } of bands) {\n const a = row[current];\n const b = row[comparison];\n augmented[field] =\n typeof a === 'number' && typeof b === 'number'\n ? [Math.min(a, b), Math.max(a, b)]\n : undefined;\n }\n return augmented;\n })\n : data;\n\n // Only a delta band needs an <Area>, which recharts renders under\n // ComposedChart, not LineChart. Escalate to ComposedChart only then, so\n // plain line charts keep the LineChart base (and their baselines) untouched.\n const RootChart = bands.length > 0 ? ComposedChart : RechartsLineChart;\n\n return (\n <div\n ref={ref}\n data-curve={curve}\n data-line-style={lineStyle}\n className={cn(lineChartVariants({ curve, lineStyle }), className)}\n {...props}\n >\n <ChartContainer\n config={config}\n className=\"size-full [&_.recharts-label]:fill-foreground\"\n >\n <RootChart data={chartData as readonly unknown[]}>\n {showGrid && (\n <CartesianGrid\n horizontal={gridHorizontal ?? true}\n vertical={gridVertical ?? false}\n strokeDasharray={gridDashed ? '3 3' : undefined}\n />\n )}\n <XAxis\n dataKey={xKey}\n type=\"category\"\n hide={!showXAxis}\n tickLine={false}\n axisLine={false}\n tickMargin={8}\n tickFormatter={xTickFormatter}\n angle={xAxisAngle}\n interval={xAxisInterval}\n textAnchor={\n xAxisAngle != null ? (xAxisAngle < 0 ? 'end' : 'start') : undefined\n }\n height={xAxisHeight}\n label={xAxisTitle}\n />\n <YAxis\n type=\"number\"\n hide={!showYAxis}\n tickLine={false}\n axisLine={false}\n unit={yUnit}\n tickFormatter={yTickFormatter}\n tickCount={yAxisTickCount}\n domain={yDomain}\n width={yAxisLabel ? 72 : undefined}\n label={yAxisTitle}\n />\n {showTooltip &&\n (customTooltip ? (\n // Strips the synthetic delta bands before the caller's tooltip\n // sees them — the `__band_*` series feed the Areas, not the\n // tooltip (a no-op when no bands are configured).\n <ChartTooltip content={customTooltip} />\n ) : bands.length > 0 ? (\n <ChartTooltip\n content={(props) => (\n <ChartTooltipContent\n active={props.active}\n label={props.label}\n payload={\n dropBandSeries(\n props.payload\n ) as ChartTooltipContentProps['payload']\n }\n />\n )}\n />\n ) : (\n <ChartTooltip content={<ChartTooltipContent />} />\n ))}\n {showLegend &&\n (bands.length > 0 ? (\n <ChartLegend\n content={(props) => (\n <ChartLegendContent\n verticalAlign={props.verticalAlign}\n payload={\n dropBandSeries(\n props.payload\n ) as ChartLegendContentProps['payload']\n }\n />\n )}\n />\n ) : (\n <ChartLegend content={<ChartLegendContent />} />\n ))}\n {/* Delta bands render before the lines so the lines draw on top. */}\n {bands.map(({ field, current }) => (\n <Area\n key={field}\n dataKey={field}\n type={curve ?? 'monotone'}\n stroke=\"none\"\n fill={`var(--color-${current})`}\n fillOpacity={0.12}\n connectNulls={connectNulls}\n dot={false}\n activeDot={false}\n isAnimationActive={false}\n legendType=\"none\"\n tooltipType=\"none\"\n />\n ))}\n {dataKeys.map((key) => {\n // Comparison series read as secondary: always dashed, dimmed, and\n // dot-less, regardless of the global lineStyle / showDots.\n const isComparison = comparisonKeys?.includes(key);\n return (\n <Line\n key={key}\n type={curve ?? 'monotone'}\n dataKey={key}\n stroke={`var(--color-${key})`}\n strokeWidth={strokeWidth}\n strokeDasharray={isComparison ? '5 5' : dashArray}\n strokeOpacity={isComparison ? 0.5 : undefined}\n dot={!isComparison && showDots ? { r: 3 } : false}\n activeDot={!isComparison && showDots ? { r: 5 } : false}\n connectNulls={connectNulls}\n isAnimationActive={false}\n />\n );\n })}\n </RootChart>\n </ChartContainer>\n </div>\n );\n }\n);\nLineChart.displayName = 'LineChart';\n\nexport { LineChart, lineChartVariants };\n"],"names":["lineChartVariants","cva","BAND_FIELD_PREFIX","dropBandSeries","payload","item","createBandStrippedTooltip","tooltipContent","props","merged","React","LineChart","className","config","data","dataKeys","comparisonKeys","deltaBands","xKey","xAxisLabel","yAxisLabel","yUnit","curve","lineStyle","strokeWidth","showDots","connectNulls","showGrid","showTooltip","showLegend","showXAxis","showYAxis","xTickFormatter","yTickFormatter","xAxisAngle","xAxisInterval","yAxisTickCount","yAxisDomain","gridDashed","gridHorizontal","gridVertical","ref","dashArray","yDomain","resolveAxisDomain","xAxisHeight","customTooltip","xAxisTitle","yAxisTitle","bands","current","comparison","index","chartData","row","augmented","field","a","b","RootChart","ComposedChart","RechartsLineChart","jsx","cn","ChartContainer","jsxs","CartesianGrid","XAxis","YAxis","ChartTooltip","ChartTooltipContent","ChartLegend","ChartLegendContent","Area","key","isComparison","Line"],"mappings":";;;;;;;AAuCA,MAAMA,KAAoBC,GAAI,IAAI;AAAA,EAChC,UAAU;AAAA,IACR,OAAO;AAAA,M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;AAAA,kBAACc;AAAA,kBAAA;AAAA,oBAEC,MAAMtD,KAAS;AAAA,oBACf,SAASoD;AAAA,oBACT,QAAQ,eAAeA,CAAG;AAAA,oBAC1B,aAAAlD;AAAA,oBACA,iBAAiBmD,IAAe,QAAQjC;AAAA,oBACxC,eAAeiC,IAAe,MAAM;AAAA,oBACpC,KAAK,CAACA,KAAgBlD,IAAW,EAAE,GAAG,MAAM;AAAA,oBAC5C,WAAW,CAACkD,KAAgBlD,IAAW,EAAE,GAAG,MAAM;AAAA,oBAClD,cAAAC;AAAA,oBACA,mBAAmB;AAAA,kBAAA;AAAA,kBAVdgD;AAAA,gBAAA;AAAA,cAaX,CAAC;AAAA,YAAA,EAAA,CACH;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;AACA/D,GAAU,cAAc;"}
1
+ {"version":3,"file":"line-chart.js","sources":["../../../../src/components/ui/line-chart/line-chart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n Area,\n Brush,\n CartesianGrid,\n ComposedChart,\n LabelList,\n Line,\n LineChart as RechartsLineChart,\n ReferenceLine,\n XAxis,\n YAxis,\n} from 'recharts';\n\nimport { cn } from '@/lib/utils';\nimport {\n CHART_LABEL_FONT_SIZE,\n CHART_LABEL_MARGIN,\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartTooltip,\n ChartTooltipContent,\n resolveAnimation,\n resolveAxisDomain,\n resolveBrushProps,\n resolveChartReferenceValue,\n resolveLabelFillClass,\n resolveReferenceLineProps,\n resolveRotatedTickAnchor,\n resolveXAxisHeight,\n resolveXAxisTitle,\n resolveYAxisTitle,\n toLabelFormatter,\n toReferenceLineList,\n type ChartConfig,\n type ChartLegendContentProps,\n type ChartTooltipContentProps,\n type CartesianChartProps,\n type ChartAnimationProps,\n type ChartBrushProps,\n type ChartCurveType,\n type ChartDataLabelProps,\n type ChartReferenceLine,\n type CartesianLabelPosition,\n} from '../chart';\n\n// A typed recharts composition over the shared `Chart` primitives. The two CVA\n// axes are the design's Line-chart variant set: `curve` (how the segments\n// interpolate between points — straight, smoothed, or stepped; the seven values\n// are documented on the shared `ChartCurveType`) and `lineStyle` (a solid or\n// dashed stroke). \"single\" vs \"multi\" line is not a variant — it\n// falls out of how many `dataKeys` the caller plots. The classes stay empty\n// because recharts' SVG — not CSS — draws the lines: `curve` drives each\n// `<Line type>` and `lineStyle` drives its `strokeDasharray`. CVA is kept so the\n// variant set is a first-class, spec-conformant part of the API (matched against\n// ui-spec's api.yaml enums) and exposed via `VariantProps`; the resolved values\n// are also mirrored onto `data-curve` / `data-line-style` for styling hooks and\n// tests.\nconst lineChartVariants = cva('', {\n variants: {\n curve: {\n linear: '',\n monotone: '',\n natural: '',\n basis: '',\n step: '',\n stepBefore: '',\n stepAfter: '',\n },\n lineStyle: {\n solid: '',\n dashed: '',\n },\n },\n defaultVariants: {\n curve: 'monotone',\n lineStyle: 'solid',\n },\n});\n\n// Reserved field prefix for the synthetic delta-band range series. Each band\n// mints one `__band_<n>` field that feeds an <Area>; it must never surface in\n// the tooltip or legend (those describe only real, caller-supplied series).\nconst BAND_FIELD_PREFIX = '__band_';\n\n/**\n * Drop the synthetic delta-band range series from a recharts tooltip/legend\n * payload, keeping the real series (and their order). recharts already excludes\n * the band via `legendType`/`tooltipType=\"none\"`, so this is a second, explicit\n * guard — hence it's unit-tested rather than relying on that behavior.\n */\nexport function dropBandSeries<T extends { dataKey?: unknown }>(\n payload: readonly T[] | undefined\n): T[] | undefined {\n return payload?.filter(\n (item) => !String(item.dataKey).startsWith(BAND_FIELD_PREFIX)\n );\n}\n\ntype TooltipContentType = NonNullable<\n React.ComponentProps<typeof ChartTooltip>['content']\n>;\ntype TooltipContentFn = Extract<TooltipContentType, (...args: never[]) => unknown>;\ntype LegendContentFn = Extract<\n React.ComponentProps<typeof ChartLegend>['content'],\n (...args: never[]) => unknown\n>;\ntype LegendContentProps = Parameters<LegendContentFn>[0];\ntype TooltipRenderProps = Parameters<TooltipContentFn>[0];\n\n/**\n * Wrap a caller-supplied `tooltipContent` so the synthetic delta bands are\n * stripped from the payload before it renders, while preserving recharts' own\n * mount semantics — a function is mounted via `createElement` (its own component\n * identity + hook state), an element via `cloneElement`. This mirrors what the\n * pass-through charts get by handing `content` straight to recharts, so a\n * function-form tooltip keeps its state across re-renders here too. The returned\n * component is a stable content type (memoize it on `tooltipContent`).\n */\nexport function createBandStrippedTooltip(tooltipContent: TooltipContentType) {\n return function BandStrippedTooltip(props: TooltipRenderProps) {\n const merged = {\n ...props,\n payload: dropBandSeries(props.payload),\n } as TooltipRenderProps;\n return typeof tooltipContent === 'function'\n ? React.createElement(\n tooltipContent as React.FunctionComponent<TooltipRenderProps>,\n merged\n )\n : React.cloneElement(tooltipContent, merged);\n };\n}\n\n/**\n * Style override for one series, keyed by its `dataKeys` entry. Anything left\n * unset falls back to the chart-wide prop, so an entry only states what differs\n * — e.g. one thicker, dashed \"target\" line among otherwise identical series.\n *\n * A series listed in `comparisonKeys` keeps its dashed, dimmed, dot-less\n * treatment: `color`, `strokeWidth` and `curveType` still apply to it, but\n * `showDots` / `dotSize` do not (the overlay is defined by having no dots).\n */\nexport interface LineChartLineSettings {\n /** Stroke color. Defaults to the series' `config` color. */\n color?: string;\n /** Stroke width. Defaults to the chart's `strokeWidth`. */\n strokeWidth?: number;\n /** Dash this series' stroke, whatever the chart-wide `lineStyle` is. */\n dashed?: boolean;\n /** Interpolation for this series only. Defaults to the chart's `curve`. */\n curveType?: ChartCurveType;\n /** Render this series' per-point dots. Defaults to the chart's `showDots`. */\n showDots?: boolean;\n /** Dot radius for this series, in px. Defaults to the chart's `dotSize`. */\n dotSize?: number;\n /** Show/hide this series' value labels, overriding the chart's `showLabels`. */\n showLabel?: boolean;\n /** Position of this series' value labels. Defaults to the chart's `labelPosition`. */\n labelPosition?: CartesianLabelPosition;\n}\n\nexport interface LineChartProps\n extends Omit<React.ComponentProps<'div'>, 'children'>,\n VariantProps<typeof lineChartVariants>,\n CartesianChartProps,\n ChartAnimationProps,\n ChartBrushProps,\n ChartDataLabelProps {\n /** Row-per-point data. Each object holds the category key + one numeric field per series (`null` breaks the line unless `connectNulls`). */\n data: ReadonlyArray<Record<string, string | number | null>>;\n /**\n * Per-series map of `label` / `color` (imported from the shared `Chart`\n * primitives). Series colors are caller-supplied — reference an existing\n * semantic `--ui-*` token; there is no chart palette tier yet.\n */\n config: ChartConfig;\n /** Series to plot — one `<Line>` per key. Each must exist in `config` and in every data row. */\n dataKeys: string[];\n /**\n * Subset of `dataKeys` to render as comparison/trend overlays (e.g. a\n * previous quarter or year) — dashed, dimmed, and dot-less, so they read as\n * secondary to the current-period lines. Keeps each series' own `config` color.\n */\n comparisonKeys?: string[];\n /**\n * Pairs of `[currentKey, comparisonKey]` to shade a delta band between — a\n * dimmed area filling the gap between the two series at each point,\n * visualizing the QoQ/YoY difference. Tinted with the first key's `config`\n * color. Rows where either value isn't numeric are left un-banded.\n *\n * Each pair mints an internal `__band_<n>` field (kept out of the tooltip and\n * legend), so avoid data/`config` keys with that reserved prefix.\n */\n deltaBands?: Array<[string, string]>;\n /** Category axis key (the shared dimension across rows, e.g. `\"month\"`). */\n xKey: string;\n /** Stroke width of each line. */\n strokeWidth?: number;\n /** Render a dot at each data point. */\n showDots?: boolean;\n /** Radius of each point's dot, in px. Its hover dot is 2px larger. */\n dotSize?: number;\n /**\n * Enlarge the hovered point's dot. Defaults to following `showDots`, so pass\n * it explicitly to get hover dots on a dot-less line (`showDots={false}`\n * with `showActiveDot`) or a static-only line (dots without the hover one).\n */\n showActiveDot?: boolean;\n /** Bridge `null` gaps in the data instead of breaking the line. */\n connectNulls?: boolean;\n /**\n * Per-series style overrides, keyed by `dataKeys` entry. Series with no entry\n * render from the chart-wide props.\n */\n lineSettings?: Record<string, LineChartLineSettings>;\n /**\n * One or more dashed reference/average lines on the value axis — a target, a\n * threshold, or a series mean. Pass a single object or an array to draw\n * several at once.\n */\n referenceLine?: ChartReferenceLine | ChartReferenceLine[];\n showLegend?: boolean;\n /** Position of the value labels when `showLabels` is on. Defaults to `top`. */\n labelPosition?: CartesianLabelPosition;\n}\n\nconst LineChart = React.forwardRef<HTMLDivElement, LineChartProps>(\n (\n {\n className,\n config,\n data,\n dataKeys,\n comparisonKeys,\n deltaBands,\n xKey,\n xAxisLabel,\n yAxisLabel,\n yUnit,\n curve = 'monotone',\n lineStyle = 'solid',\n strokeWidth = 2,\n showDots = true,\n dotSize = 3,\n showActiveDot,\n connectNulls = false,\n lineSettings,\n referenceLine,\n showGrid = true,\n showTooltip = true,\n showLegend = true,\n showXAxis = true,\n showYAxis = true,\n xTickFormatter,\n yTickFormatter,\n xAxisAngle,\n xAxisInterval,\n yAxisTickCount,\n yAxisDomain,\n gridDashed,\n gridHorizontal,\n gridVertical,\n tooltipContent,\n animate,\n animationDuration,\n animationBegin,\n animationEasing,\n showLabels = false,\n labelPosition,\n labelFormatter,\n showBrush = false,\n brushHeight,\n brushAriaLabel,\n ...props\n },\n ref\n ) => {\n const animation = resolveAnimation({\n animate,\n animationDuration,\n animationBegin,\n animationEasing,\n });\n const lineLabelPosition = labelPosition ?? 'top';\n const yDomain = resolveAxisDomain(yAxisDomain);\n const referenceLines = toReferenceLineList(referenceLine);\n\n // A series' own `color` and `curveType` overrides also drive its delta band,\n // so the band keeps following the line it belongs to instead of the\n // chart-wide defaults.\n const colorFor = (key: string) =>\n lineSettings?.[key]?.color ?? `var(--color-${key})`;\n const curveFor = (key: string) =>\n lineSettings?.[key]?.curveType ?? curve ?? 'monotone';\n\n // The plot inset is needed as soon as *any* series carries outside labels —\n // a per-series `showLabel` counts, not only the chart-wide `showLabels`.\n const hasLabels =\n showLabels ||\n Object.values(lineSettings ?? {}).some((settings) => settings.showLabel);\n\n const xAxisHeight = resolveXAxisHeight(xAxisLabel, xAxisAngle);\n\n // Memoized so recharts sees a stable content type across renders — a fresh\n // wrapper each render would remount the caller's tooltip and reset its state.\n const customTooltip = React.useMemo(\n () =>\n tooltipContent ? createBandStrippedTooltip(tooltipContent) : undefined,\n [tooltipContent]\n );\n\n // Axis titles: the X title sits below the ticks; the Y title is rotated in\n // the left gutter. Passed to recharts' native `label` (themed via the\n // `.recharts-label` fill selector on the container).\n const xAxisTitle = resolveXAxisTitle(xAxisLabel);\n const yAxisTitle = resolveYAxisTitle(yAxisLabel);\n\n // Each delta band becomes a synthetic `[min, max]` range field per row that\n // a recharts <Area> shades. Rows where either series isn't numeric are left\n // un-banded (the area breaks there).\n const bands = (deltaBands ?? []).map(([current, comparison], index) => ({\n field: `${BAND_FIELD_PREFIX}${index}`,\n current,\n comparison,\n }));\n\n // A delta band is a synthetic `__band_*` series feeding an <Area>, not a\n // trend of its own — so it has to be stripped from the tooltip rows and the\n // legend entries before either is rendered. A caller's own tooltip is\n // already wrapped for that above; these cover the two default contents.\n const hasBands = bands.length > 0;\n const tooltipNode =\n customTooltip ??\n (hasBands ? (\n (props: TooltipRenderProps) => (\n <ChartTooltipContent\n active={props.active}\n label={props.label}\n payload={\n dropBandSeries(\n props.payload\n ) as ChartTooltipContentProps['payload']\n }\n />\n )\n ) : (\n <ChartTooltipContent />\n ));\n const legendNode = hasBands ? (\n (props: LegendContentProps) => (\n <ChartLegendContent\n verticalAlign={props.verticalAlign}\n payload={\n dropBandSeries(props.payload) as ChartLegendContentProps['payload']\n }\n />\n )\n ) : (\n <ChartLegendContent />\n );\n const chartData = bands.length\n ? data.map((row) => {\n const augmented: Record<string, unknown> = { ...row };\n for (const { field, current, comparison } of bands) {\n const a = row[current];\n const b = row[comparison];\n augmented[field] =\n typeof a === 'number' && typeof b === 'number'\n ? [Math.min(a, b), Math.max(a, b)]\n : undefined;\n }\n return augmented;\n })\n : data;\n\n // Only a delta band needs an <Area>, which recharts renders under\n // ComposedChart, not LineChart. Escalate to ComposedChart only then, so\n // plain line charts keep the LineChart base (and their baselines) untouched.\n const RootChart = bands.length > 0 ? ComposedChart : RechartsLineChart;\n\n return (\n <div\n ref={ref}\n data-curve={curve}\n data-line-style={lineStyle}\n className={cn(lineChartVariants({ curve, lineStyle }), className)}\n {...props}\n >\n <ChartContainer\n config={config}\n className=\"size-full [&_.recharts-label]:fill-foreground\"\n >\n <RootChart\n data={chartData as readonly unknown[]}\n margin={hasLabels ? CHART_LABEL_MARGIN : undefined}\n >\n {showGrid && (\n <CartesianGrid\n horizontal={gridHorizontal ?? true}\n vertical={gridVertical ?? false}\n strokeDasharray={gridDashed ? '3 3' : undefined}\n />\n )}\n <XAxis\n dataKey={xKey}\n type=\"category\"\n hide={!showXAxis}\n tickLine={false}\n axisLine={false}\n tickMargin={8}\n tickFormatter={xTickFormatter}\n angle={xAxisAngle}\n interval={xAxisInterval}\n textAnchor={resolveRotatedTickAnchor(xAxisAngle)}\n height={xAxisHeight}\n label={xAxisTitle}\n />\n <YAxis\n type=\"number\"\n hide={!showYAxis}\n tickLine={false}\n axisLine={false}\n unit={yUnit}\n tickFormatter={yTickFormatter}\n tickCount={yAxisTickCount}\n domain={yDomain}\n width={yAxisLabel ? 72 : undefined}\n label={yAxisTitle}\n />\n {showTooltip && <ChartTooltip content={tooltipNode} />}\n {showLegend && <ChartLegend content={legendNode} />}\n {/* Delta bands render before the lines so the lines draw on top. */}\n {bands.map(({ field, current }) => (\n <Area\n key={field}\n dataKey={field}\n // An <Area> takes one interpolation, so a pair whose two series\n // set different `curveType`s can only follow the current one.\n type={curveFor(current)}\n stroke=\"none\"\n fill={colorFor(current)}\n fillOpacity={0.12}\n connectNulls={connectNulls}\n dot={false}\n activeDot={false}\n {...animation}\n legendType=\"none\"\n tooltipType=\"none\"\n />\n ))}\n {dataKeys.map((key) => {\n // Comparison series read as secondary: always dashed, dimmed, and\n // dot-less, regardless of the global lineStyle / showDots.\n const isComparison = comparisonKeys?.includes(key);\n const settings = lineSettings?.[key];\n const seriesDots =\n !isComparison && (settings?.showDots ?? showDots);\n const dotRadius = settings?.dotSize ?? dotSize;\n // The hover dot follows the static dots unless asked otherwise, so\n // a chart that sets neither renders exactly as before.\n const activeDot = !isComparison && (showActiveDot ?? seriesDots);\n const seriesDashed = settings?.dashed ?? lineStyle === 'dashed';\n const seriesLabel = settings?.showLabel ?? showLabels;\n const seriesLabelPosition =\n settings?.labelPosition ?? lineLabelPosition;\n return (\n <Line\n key={key}\n type={curveFor(key)}\n dataKey={key}\n stroke={colorFor(key)}\n strokeWidth={settings?.strokeWidth ?? strokeWidth}\n strokeDasharray={isComparison || seriesDashed ? '5 5' : undefined}\n strokeOpacity={isComparison ? 0.5 : undefined}\n dot={seriesDots ? { r: dotRadius } : false}\n activeDot={activeDot ? { r: dotRadius + 2 } : false}\n connectNulls={connectNulls}\n {...animation}\n >\n {seriesLabel && (\n <LabelList\n dataKey={key}\n position={seriesLabelPosition}\n formatter={toLabelFormatter(labelFormatter)}\n className={resolveLabelFillClass(seriesLabelPosition)}\n fontSize={CHART_LABEL_FONT_SIZE}\n />\n )}\n </Line>\n );\n })}\n {/* Annotations draw over the series they describe. */}\n {referenceLines.map((ref, index) => {\n const value = resolveChartReferenceValue(ref, data, dataKeys);\n if (value === undefined) return null;\n return (\n <ReferenceLine\n key={`${ref.label ?? 'ref'}-${index}`}\n y={value}\n {...resolveReferenceLineProps(ref.label, ref.labelPosition)}\n />\n );\n })}\n {showBrush && (\n <Brush\n dataKey={xKey}\n tickFormatter={xTickFormatter}\n {...resolveBrushProps({ brushHeight, brushAriaLabel })}\n />\n )}\n </RootChart>\n </ChartContainer>\n </div>\n );\n }\n);\nLineChart.displayName = 'LineChart';\n\nexport { LineChart, lineChartVariants };\n"],"names":["lineChartVariants","cva","BAND_FIELD_PREFIX","dropBandSeries","payload","item","createBandStrippedTooltip","tooltipContent","props","merged","React","LineChart","className","config","data","dataKeys","comparisonKeys","deltaBands","xKey","xAxisLabel","yAxisLabel","yUnit","curve","lineStyle","strokeWidth","showDots","dotSize","showActiveDot","connectNulls","lineSettings","referenceLine","showGrid","showTooltip","showLegend","showXAxis","showYAxis","xTickFormatter","yTickFormatter","xAxisAngle","xAxisInterval","yAxisTickCount","yAxisDomain","gridDashed","gridHorizontal","gridVertical","animate","animationDuration","animationBegin","animationEasing","showLabels","labelPosition","labelFormatter","showBrush","brushHeight","brushAriaLabel","ref","animation","resolveAnimation","lineLabelPosition","yDomain","resolveAxisDomain","referenceLines","toReferenceLineList","colorFor","key","_a","curveFor","hasLabels","settings","xAxisHeight","resolveXAxisHeight","customTooltip","xAxisTitle","resolveXAxisTitle","yAxisTitle","resolveYAxisTitle","bands","current","comparison","index","hasBands","tooltipNode","jsx","ChartTooltipContent","legendNode","ChartLegendContent","chartData","row","augmented","field","a","b","RootChart","ComposedChart","RechartsLineChart","cn","ChartContainer","jsxs","CHART_LABEL_MARGIN","CartesianGrid","XAxis","resolveRotatedTickAnchor","YAxis","ChartTooltip","ChartLegend","Area","isComparison","seriesDots","dotRadius","activeDot","seriesDashed","seriesLabel","seriesLabelPosition","Line","LabelList","toLabelFormatter","resolveLabelFillClass","CHART_LABEL_FONT_SIZE","value","resolveChartReferenceValue","ReferenceLine","resolveReferenceLineProps","Brush","resolveBrushProps"],"mappings":";;;;;;;AA8DA,MAAMA,KAAoBC,GAAI,IAAI;AAAA,EAChC,UAAU;AAAA,IACR,OAAO;AAAA,MACL,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,SAAS;AAAA,MACT,OAAO;AAAA,MACP,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,WAAW;AAAA,IAAA;AAAA,IAEb,WAAW;AAAA,MACT,OAAO;AAAA,MACP,QAAQ;AAAA,IAAA;AAAA,EACV;AAAA,EAEF,iBAAiB;AAAA,IACf,OAAO;AAAA,IACP,WAAW;AAAA,EAAA;AAEf,CAAC,GAKKC,IAAoB;AAQnB,SAASC,EACdC,GACiB;AACjB,SAAOA,KAAA,gBAAAA,EAAS;AAAA,IACd,CAACC,MAAS,CAAC,OAAOA,EAAK,OAAO,EAAE,WAAWH,CAAiB;AAAA;AAEhE;AAsBO,SAASI,GAA0B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