@acronis-platform/ui-react 0.60.0 → 0.61.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 (83) 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/category-bar/category-bar.js +98 -77
  10. package/dist/components/ui/category-bar/category-bar.js.map +1 -1
  11. package/dist/components/ui/chart/chart-format.js +144 -14
  12. package/dist/components/ui/chart/chart-format.js.map +1 -1
  13. package/dist/components/ui/chart/chart.js +204 -150
  14. package/dist/components/ui/chart/chart.js.map +1 -1
  15. package/dist/components/ui/composed-chart/composed-chart.js +422 -125
  16. package/dist/components/ui/composed-chart/composed-chart.js.map +1 -1
  17. package/dist/components/ui/confidence-cone/confidence-cone.js +308 -202
  18. package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -1
  19. package/dist/components/ui/funnel-chart/funnel-chart.js +245 -51
  20. package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -1
  21. package/dist/components/ui/histogram/histogram.js +85 -81
  22. package/dist/components/ui/histogram/histogram.js.map +1 -1
  23. package/dist/components/ui/line-chart/line-chart.js +227 -184
  24. package/dist/components/ui/line-chart/line-chart.js.map +1 -1
  25. package/dist/components/ui/metric/metric.js +88 -70
  26. package/dist/components/ui/metric/metric.js.map +1 -1
  27. package/dist/components/ui/pie-chart/pie-chart.js +234 -80
  28. package/dist/components/ui/pie-chart/pie-chart.js.map +1 -1
  29. package/dist/components/ui/radar-chart/radar-chart.js +210 -57
  30. package/dist/components/ui/radar-chart/radar-chart.js.map +1 -1
  31. package/dist/components/ui/radial-bar-chart/radial-bar-chart.js +358 -50
  32. package/dist/components/ui/radial-bar-chart/radial-bar-chart.js.map +1 -1
  33. package/dist/components/ui/sankey-chart/sankey-chart.js +25 -18
  34. package/dist/components/ui/sankey-chart/sankey-chart.js.map +1 -1
  35. package/dist/components/ui/scatter-chart/scatter-chart.js +86 -78
  36. package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -1
  37. package/dist/components/ui/timeline/timeline.js +206 -142
  38. package/dist/components/ui/timeline/timeline.js.map +1 -1
  39. package/dist/components/ui/treemap/treemap.js +183 -59
  40. package/dist/components/ui/treemap/treemap.js.map +1 -1
  41. package/dist/index.js +441 -421
  42. package/dist/index.js.map +1 -1
  43. package/dist/react.js +441 -421
  44. package/dist/react.js.map +1 -1
  45. package/dist/src/components/ui/area-chart/area-chart.d.ts +53 -3
  46. package/dist/src/components/ui/area-chart/index.d.ts +1 -1
  47. package/dist/src/components/ui/avatar/avatar.d.ts +1 -1
  48. package/dist/src/components/ui/bar-chart/bar-chart.d.ts +154 -16
  49. package/dist/src/components/ui/bar-chart/index.d.ts +1 -1
  50. package/dist/src/components/ui/button/button.d.ts +1 -1
  51. package/dist/src/components/ui/button-menu/button-menu.d.ts +1 -1
  52. package/dist/src/components/ui/chart/__tests__/chart-layout.d.ts +63 -0
  53. package/dist/src/components/ui/chart/__tests__/chart-layout.test.d.ts +1 -0
  54. package/dist/src/components/ui/chart/chart-format.d.ts +415 -0
  55. package/dist/src/components/ui/chart/chart.d.ts +9 -3
  56. package/dist/src/components/ui/chart/index.d.ts +2 -2
  57. package/dist/src/components/ui/composed-chart/composed-chart.d.ts +156 -7
  58. package/dist/src/components/ui/composed-chart/index.d.ts +1 -1
  59. package/dist/src/components/ui/confidence-cone/confidence-cone.d.ts +138 -20
  60. package/dist/src/components/ui/confidence-cone/index.d.ts +1 -1
  61. package/dist/src/components/ui/funnel-chart/funnel-chart.d.ts +201 -3
  62. package/dist/src/components/ui/funnel-chart/index.d.ts +1 -1
  63. package/dist/src/components/ui/histogram/histogram.d.ts +2 -2
  64. package/dist/src/components/ui/line-chart/index.d.ts +1 -1
  65. package/dist/src/components/ui/line-chart/line-chart.d.ts +51 -3
  66. package/dist/src/components/ui/pie-chart/index.d.ts +1 -1
  67. package/dist/src/components/ui/pie-chart/pie-chart.d.ts +145 -4
  68. package/dist/src/components/ui/radar-chart/index.d.ts +1 -1
  69. package/dist/src/components/ui/radar-chart/radar-chart.d.ts +219 -6
  70. package/dist/src/components/ui/radial-bar-chart/index.d.ts +1 -1
  71. package/dist/src/components/ui/radial-bar-chart/radial-bar-chart.d.ts +215 -9
  72. package/dist/src/components/ui/scatter-chart/scatter-chart.d.ts +2 -2
  73. package/dist/src/components/ui/timeline/index.d.ts +1 -1
  74. package/dist/src/components/ui/timeline/timeline.d.ts +79 -20
  75. package/dist/src/components/ui/treemap/index.d.ts +1 -1
  76. package/dist/src/components/ui/treemap/treemap.d.ts +68 -8
  77. package/dist/src/index.d.ts +0 -1
  78. package/dist/ui-react.css +1 -1
  79. package/package.json +3 -3
  80. package/dist/components/ui/search-global/search-global.js +0 -60
  81. package/dist/components/ui/search-global/search-global.js.map +0 -1
  82. package/dist/src/components/ui/search-global/index.d.ts +0 -1
  83. package/dist/src/components/ui/search-global/search-global.d.ts +0 -7
@@ -1,11 +1,11 @@
1
- import { jsx as t, jsxs as p, Fragment as V } from "react/jsx-runtime";
2
- import * as Q from "react";
3
- import { cva as U } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
4
- import { BarChart as W, CartesianGrid as X, XAxis as j, YAxis as w, Bar as Y, ReferenceLine as Z } from "recharts";
5
- import { cn as x } from "../../../lib/utils.js";
6
- import { ChartContainer as A, ChartTooltip as tt, ChartTooltipContent as at, ChartLegend as rt, ChartLegendContent as et } from "../chart/chart.js";
7
- import { resolveAxisDomain as ot } from "../chart/chart-format.js";
8
- const it = U("", {
1
+ import { jsx as i, jsxs as g, Fragment as _ } from "react/jsx-runtime";
2
+ import * as T from "react";
3
+ import { cva as Qe } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
4
+ import { Text as Ke, BarChart as et, CartesianGrid as tt, Brush as rt, XAxis as de, YAxis as he, LabelList as ot, Bar as fe, ReferenceArea as nt, ReferenceLine as it, Cell as lt, Rectangle as j } from "recharts";
5
+ import { cn as ue } from "../../../lib/utils.js";
6
+ import { resolveAnimation as at, resolveCartesianLabelPosition as st, resolveCategoryRange as ve, resolveBrushProps as ct, resolveRotatedTickAnchor as ge, CHART_LABEL_FONT_SIZE as dt, resolveLabelFillClass as ht, toLabelFormatter as ft, resolveChartReferenceValue as ut, resolveReferenceLineProps as vt, resolveXAxisTitle as gt, resolveXAxisHeight as pt, resolveAxisDomain as mt, resolveYAxisTitle as $t, toReferenceLineList as Ct } from "../chart/chart-format.js";
7
+ import { ChartContainer as Lt, ChartTooltip as zt, ChartLegend as yt, ChartTooltipContent as Ot, ChartLegendContent as kt } from "../chart/chart.js";
8
+ const St = Qe("", {
9
9
  variants: {
10
10
  orientation: {
11
11
  vertical: "",
@@ -20,191 +20,606 @@ const it = U("", {
20
20
  orientation: "vertical",
21
21
  layout: "grouped"
22
22
  }
23
- });
24
- function nt(e, v, u) {
25
- if (!e) return;
26
- if (typeof e.value == "number") return e.value;
27
- if (!e.average) return;
28
- const s = typeof e.average == "string" ? [e.average] : u, l = v.flatMap(
29
- (o) => s.map((a) => o[a]).filter((a) => typeof a == "number")
23
+ }), F = "__headroom_";
24
+ function me(t, n) {
25
+ const o = t == null ? void 0 : t.filter(
26
+ (r) => !String(r.dataKey).startsWith(F)
30
27
  );
31
- if (l.length !== 0)
32
- return l.reduce((o, a) => o + a, 0) / l.length;
28
+ return n ? o == null ? void 0 : o.slice().sort(
29
+ (r, a) => n.indexOf(String(r.dataKey)) - n.indexOf(String(a.dataKey))
30
+ ) : o;
33
31
  }
34
- const lt = Q.forwardRef(
32
+ function $e(t) {
33
+ return t == null ? void 0 : t.map(
34
+ (n) => {
35
+ var o;
36
+ return (o = n.color) != null && o.startsWith("url(") ? { ...n, color: `var(--color-${String(n.dataKey)})` } : n;
37
+ }
38
+ );
39
+ }
40
+ function Rt({
41
+ content: t,
42
+ dataKeys: n,
43
+ ...o
44
+ }) {
45
+ const r = {
46
+ ...o,
47
+ payload: $e(me(o.payload, n))
48
+ };
49
+ return t ? typeof t == "function" ? T.createElement(
50
+ t,
51
+ r
52
+ ) : T.cloneElement(t, r) : /* @__PURE__ */ i(Ot, { ...r });
53
+ }
54
+ function Tt({
55
+ dataKeys: t,
56
+ ...n
57
+ }) {
58
+ return /* @__PURE__ */ i(
59
+ kt,
60
+ {
61
+ verticalAlign: n.verticalAlign,
62
+ payload: $e(
63
+ me(n.payload, t)
64
+ )
65
+ }
66
+ );
67
+ }
68
+ function bt({
69
+ bar: t,
70
+ track: n,
71
+ trackFill: o,
72
+ paint: r
73
+ }) {
74
+ return /* @__PURE__ */ g(_, { children: [
75
+ n && /* @__PURE__ */ i(
76
+ j,
77
+ {
78
+ className: "recharts-bar-background-rectangle",
79
+ x: n.x ?? void 0,
80
+ y: n.y ?? void 0,
81
+ width: n.width ?? void 0,
82
+ height: n.height ?? void 0,
83
+ fill: o
84
+ }
85
+ ),
86
+ /* @__PURE__ */ i(
87
+ j,
88
+ {
89
+ x: t.x ?? void 0,
90
+ y: t.y ?? void 0,
91
+ width: t.width ?? void 0,
92
+ height: t.height ?? void 0,
93
+ radius: t.radius,
94
+ fill: (r == null ? void 0 : r.fill) ?? t.fill,
95
+ fillOpacity: (r == null ? void 0 : r.fillOpacity) ?? t.fillOpacity,
96
+ stroke: t.stroke,
97
+ strokeWidth: t.strokeWidth,
98
+ strokeDasharray: t.strokeDasharray
99
+ }
100
+ )
101
+ ] });
102
+ }
103
+ function pe({
104
+ inRange: t,
105
+ trackFill: n,
106
+ paint: o
107
+ }) {
108
+ return ({ background: r, index: a, ...u }) => bt({
109
+ bar: u,
110
+ track: t(a) ? r : void 0,
111
+ trackFill: n,
112
+ paint: o
113
+ });
114
+ }
115
+ function Dt({
116
+ rangeBackground: t,
117
+ inRange: n,
118
+ trackFill: o,
119
+ activeBarOption: r
120
+ }) {
121
+ return t ? {
122
+ shape: pe({ inRange: n, trackFill: o }),
123
+ activeBar: r && pe({ inRange: n, trackFill: o, paint: r })
124
+ } : { shape: void 0, activeBar: r };
125
+ }
126
+ function Et({
127
+ band: t,
128
+ vertical: n
129
+ }) {
130
+ const { x: o = 0, y: r = 0, width: a = 0, height: u = 0, fill: h, fillOpacity: p } = t;
131
+ return /* @__PURE__ */ g(_, { children: [
132
+ /* @__PURE__ */ i(
133
+ j,
134
+ {
135
+ className: "recharts-reference-area-rect",
136
+ x: o,
137
+ y: r,
138
+ width: a,
139
+ height: u,
140
+ fill: h,
141
+ fillOpacity: p
142
+ }
143
+ ),
144
+ /* @__PURE__ */ i(
145
+ "line",
146
+ {
147
+ x1: o,
148
+ y1: r,
149
+ x2: n ? o : o + a,
150
+ y2: n ? r + u : r,
151
+ stroke: "var(--ui-border-on-surface-border)",
152
+ strokeDasharray: "4 4"
153
+ }
154
+ )
155
+ ] });
156
+ }
157
+ function Nt({
158
+ divider: t,
159
+ vertical: n
160
+ }) {
161
+ if (t)
162
+ return (o) => Et({ band: o, vertical: n });
163
+ }
164
+ function wt(t) {
165
+ return t ? {
166
+ value: t,
167
+ position: "insideTop",
168
+ fill: "var(--ui-text-on-surface-secondary)",
169
+ fontSize: 12
170
+ } : void 0;
171
+ }
172
+ function xt({
173
+ id: t,
174
+ dataKeys: n,
175
+ shapes: o,
176
+ horizontal: r
177
+ }) {
178
+ const a = o.has("gradient"), u = o.has("pattern");
179
+ return !a && !u ? null : /* @__PURE__ */ i("defs", { children: n.map((h) => /* @__PURE__ */ g(T.Fragment, { children: [
180
+ a && /* @__PURE__ */ g(
181
+ "linearGradient",
182
+ {
183
+ id: `${t}-gradient-${h}`,
184
+ x1: "0",
185
+ y1: "0",
186
+ x2: r ? "1" : "0",
187
+ y2: r ? "0" : "1",
188
+ children: [
189
+ /* @__PURE__ */ i(
190
+ "stop",
191
+ {
192
+ offset: "0%",
193
+ stopColor: `var(--color-${h})`,
194
+ stopOpacity: 1
195
+ }
196
+ ),
197
+ /* @__PURE__ */ i(
198
+ "stop",
199
+ {
200
+ offset: "100%",
201
+ stopColor: `var(--color-${h})`,
202
+ stopOpacity: 0.35
203
+ }
204
+ )
205
+ ]
206
+ }
207
+ ),
208
+ u && /* @__PURE__ */ g(
209
+ "pattern",
210
+ {
211
+ id: `${t}-pattern-${h}`,
212
+ patternUnits: "userSpaceOnUse",
213
+ width: 6,
214
+ height: 6,
215
+ patternTransform: "rotate(45)",
216
+ children: [
217
+ /* @__PURE__ */ i(
218
+ "rect",
219
+ {
220
+ width: 6,
221
+ height: 6,
222
+ fill: `var(--color-${h})`,
223
+ fillOpacity: 0.25
224
+ }
225
+ ),
226
+ /* @__PURE__ */ i(
227
+ "line",
228
+ {
229
+ x1: 0,
230
+ y1: 0,
231
+ x2: 0,
232
+ y2: 6,
233
+ stroke: `var(--color-${h})`,
234
+ strokeWidth: 3
235
+ }
236
+ )
237
+ ]
238
+ }
239
+ )
240
+ ] }, h)) });
241
+ }
242
+ function Bt({
243
+ data: t,
244
+ chartData: n,
245
+ xKey: o,
246
+ seriesKey: r,
247
+ settings: a,
248
+ range: u,
249
+ headroomKey: h,
250
+ barShape: p,
251
+ rounded: E,
252
+ fillOf: k,
253
+ radiusFor: W
254
+ }) {
255
+ const { fill: A, opacity: d, dashed: C } = a;
256
+ return t.map((L, v) => {
257
+ var w;
258
+ const m = v >= u[0] && v <= u[1], N = m && a.shape || p, H = h !== void 0 && Number(
259
+ (w = n[v]) == null ? void 0 : w[`${F}${r}`]
260
+ ) > 0;
261
+ return /* @__PURE__ */ i(
262
+ lt,
263
+ {
264
+ fill: m ? A ?? k(r, N) : k(r, p),
265
+ fillOpacity: m ? d : void 0,
266
+ stroke: m && C ? `var(--color-${r})` : void 0,
267
+ strokeWidth: m && C ? 1 : void 0,
268
+ strokeDasharray: m && C ? "4 3" : void 0,
269
+ radius: H ? void 0 : W(N, E)
270
+ },
271
+ `${r}-${String(L[o])}-${v}`
272
+ );
273
+ });
274
+ }
275
+ const Pt = T.forwardRef(
35
276
  ({
36
- className: e,
37
- config: v,
38
- data: u,
39
- dataKeys: s,
40
- xKey: l,
41
- referenceLine: o,
42
- xAxisLabel: a,
43
- yAxisLabel: h,
44
- xUnit: R,
45
- yUnit: S,
46
- orientation: r = "vertical",
47
- layout: f = "grouped",
48
- barRadius: d = 4,
49
- showGrid: T = !0,
50
- showTooltip: G = !0,
51
- showLegend: H = !0,
52
- showXAxis: y = !0,
53
- showYAxis: g = !0,
54
- xTickFormatter: C,
55
- yTickFormatter: k,
56
- xAxisAngle: i,
57
- xAxisInterval: z,
58
- yAxisTickCount: B,
59
- yAxisDomain: M,
60
- gridDashed: O,
61
- gridHorizontal: _,
62
- gridVertical: q,
63
- tooltipContent: E,
64
- ...I
65
- }, J) => {
66
- const K = r === "horizontal" ? "vertical" : "horizontal", b = f === "stacked", L = o ? Array.isArray(o) ? o : [o] : [], D = a ? { value: a, position: "insideBottom", offset: 0 } : void 0, $ = h ? {
67
- value: h,
68
- angle: -90,
69
- position: "insideLeft",
70
- style: { textAnchor: "middle" }
71
- } : void 0, F = ot(M), N = a || i != null ? 30 + (i != null ? 20 : 0) + (a ? 18 : 0) : void 0, P = r === "horizontal" ? [0, d, d, 0] : [d, d, 0, 0];
72
- return /* @__PURE__ */ t(
277
+ className: t,
278
+ config: n,
279
+ data: o,
280
+ dataKeys: r,
281
+ xKey: a,
282
+ referenceLine: u,
283
+ referenceArea: h,
284
+ barSettings: p,
285
+ xAxisLabel: E,
286
+ yAxisLabel: k,
287
+ xUnit: W,
288
+ yUnit: A,
289
+ orientation: d = "vertical",
290
+ layout: C = "grouped",
291
+ barRadius: L = 4,
292
+ barShape: v = "rounded",
293
+ barSize: m,
294
+ maxBarSize: N,
295
+ barGap: H,
296
+ barCategoryGap: w,
297
+ minPointSize: I,
298
+ showBackground: Ce = !1,
299
+ backgroundFill: U = "var(--ui-background-surface-secondary)",
300
+ showActiveBar: Le = !1,
301
+ activeBar: z,
302
+ showGrid: ze = !0,
303
+ showTooltip: ye = !0,
304
+ showLegend: Oe = !0,
305
+ showXAxis: Y = !0,
306
+ showYAxis: Z = !0,
307
+ xTickFormatter: x,
308
+ yTickFormatter: B,
309
+ xAxisAngle: b,
310
+ xAxisInterval: q,
311
+ yAxisTickCount: J,
312
+ yAxisDomain: ke,
313
+ gridDashed: Se,
314
+ gridHorizontal: Re,
315
+ gridVertical: Te,
316
+ tooltipContent: be,
317
+ animate: De,
318
+ animationDuration: Ee,
319
+ animationBegin: Ne,
320
+ animationEasing: we,
321
+ showLabels: xe = !1,
322
+ labelPosition: Be,
323
+ labelFormatter: Pe,
324
+ showBrush: _e = !1,
325
+ brushHeight: Fe,
326
+ brushAriaLabel: We,
327
+ ...Ae
328
+ }, He) => {
329
+ const Q = at({
330
+ animate: De,
331
+ animationDuration: Ee,
332
+ animationBegin: Ne,
333
+ animationEasing: we
334
+ }), Me = d === "horizontal" ? "vertical" : "horizontal", D = C === "stacked", K = st({
335
+ labelPosition: Be,
336
+ isStacked: D,
337
+ growingEnd: d === "horizontal" ? "right" : "top"
338
+ }), Ve = Ct(u), ee = (h ? Array.isArray(h) ? h : [h] : []).map((e) => ({ area: e, range: ve(e, o, a) })).filter(
339
+ (e) => e.range !== void 0
340
+ ), P = new Map(
341
+ r.flatMap((e) => {
342
+ const l = p == null ? void 0 : p[e], c = l ? ve(l, o, a) : void 0;
343
+ return l && c ? [[e, { settings: l, range: c }]] : [];
344
+ })
345
+ ), M = new Map(
346
+ D ? [] : Array.from(
347
+ P,
348
+ ([e, l]) => typeof l.settings.background == "string" ? [e, l.settings.background] : void 0
349
+ ).filter((e) => e !== void 0)
350
+ ), V = M.size ? o.map((e, l) => {
351
+ const c = {};
352
+ return M.forEach((s, f) => {
353
+ const $ = P.get(f);
354
+ if (!$) return;
355
+ const [S, R] = $.range;
356
+ if (l < S || l > R) return;
357
+ const y = e[f], O = e[s];
358
+ typeof y != "number" || typeof O != "number" || (c[`${F}${f}`] = Math.max(0, O - y));
359
+ }), { ...e, ...c };
360
+ }) : o, te = new Set(
361
+ ee.filter(({ area: e }) => e.highlightTicks !== !1).flatMap(
362
+ ({ range: e }) => o.slice(e[0], e[1] + 1).map((l) => l[a])
363
+ )
364
+ ), re = te.size ? ({
365
+ payload: e,
366
+ index: l,
367
+ ...c
368
+ }) => {
369
+ const s = d === "horizontal" ? B : x, f = s ? s(e.value, l) : e.value;
370
+ return /* @__PURE__ */ i(
371
+ Ke,
372
+ {
373
+ ...c,
374
+ className: ue(
375
+ "fill-muted-foreground",
376
+ te.has(e.value) && "fill-primary italic"
377
+ ),
378
+ fontSize: 12,
379
+ children: f
380
+ }
381
+ );
382
+ } : void 0, Ge = Le ? {
383
+ ...(z == null ? void 0 : z.fill) !== void 0 ? { fill: z.fill } : {},
384
+ fillOpacity: (z == null ? void 0 : z.opacity) ?? 0.85
385
+ } : !1, G = `bar-${T.useId().replace(/:/g, "")}`, oe = /* @__PURE__ */ new Set([v]);
386
+ P.forEach(({ settings: e }) => {
387
+ e.shape && oe.add(e.shape);
388
+ });
389
+ const Xe = (e) => I === void 0 ? void 0 : (l, c) => {
390
+ var f;
391
+ const s = D ? (f = V[c]) == null ? void 0 : f[e] : l;
392
+ return typeof s == "number" && s !== 0 ? I : 0;
393
+ }, ne = (e, l) => l === "gradient" ? `url(#${G}-gradient-${e})` : l === "pattern" ? `url(#${G}-pattern-${e})` : `var(--color-${e})`, ie = gt(E), le = $t(k), ae = mt(ke), se = pt(E, b), je = d === "horizontal" ? [0, L, L, 0] : [L, L, 0, 0], X = (e, l) => e === "pill" ? 9999 : L > 0 && l ? je : void 0, Ie = /* @__PURE__ */ i(Rt, { content: be, dataKeys: r }), Ue = /* @__PURE__ */ i(Tt, { dataKeys: r }), Ye = () => d === "horizontal" ? /* @__PURE__ */ g(_, { children: [
394
+ /* @__PURE__ */ i(
395
+ de,
396
+ {
397
+ type: "number",
398
+ hide: !Y,
399
+ tickLine: !1,
400
+ axisLine: !1,
401
+ unit: W,
402
+ tickFormatter: x,
403
+ angle: b,
404
+ interval: q,
405
+ textAnchor: ge(b),
406
+ tickCount: J,
407
+ domain: ae,
408
+ height: se,
409
+ label: ie
410
+ }
411
+ ),
412
+ /* @__PURE__ */ i(
413
+ he,
414
+ {
415
+ dataKey: a,
416
+ type: "category",
417
+ hide: !Z,
418
+ tickLine: !1,
419
+ axisLine: !1,
420
+ tick: re,
421
+ tickFormatter: B,
422
+ width: k ? 96 : 80,
423
+ label: le
424
+ }
425
+ )
426
+ ] }) : /* @__PURE__ */ g(_, { children: [
427
+ /* @__PURE__ */ i(
428
+ de,
429
+ {
430
+ dataKey: a,
431
+ type: "category",
432
+ hide: !Y,
433
+ tickLine: !1,
434
+ axisLine: !1,
435
+ tick: re,
436
+ tickFormatter: x,
437
+ angle: b,
438
+ interval: q,
439
+ textAnchor: ge(b),
440
+ height: se,
441
+ label: ie
442
+ }
443
+ ),
444
+ /* @__PURE__ */ i(
445
+ he,
446
+ {
447
+ type: "number",
448
+ hide: !Z,
449
+ tickLine: !1,
450
+ axisLine: !1,
451
+ unit: A,
452
+ tickFormatter: B,
453
+ tickCount: J,
454
+ domain: ae,
455
+ width: k ? 72 : void 0,
456
+ label: le
457
+ }
458
+ )
459
+ ] }), Ze = () => r.map((e, l) => {
460
+ const c = D ? l === r.length - 1 : !0, s = P.get(e), f = (ce) => s !== void 0 && ce >= s.range[0] && ce <= s.range[1], $ = M.get(e), { shape: S, activeBar: R } = Dt({
461
+ rangeBackground: (s == null ? void 0 : s.settings.background) === !0,
462
+ inRange: f,
463
+ trackFill: U,
464
+ activeBarOption: Ge
465
+ }), y = s && Bt({
466
+ data: o,
467
+ chartData: V,
468
+ xKey: a,
469
+ seriesKey: e,
470
+ settings: s.settings,
471
+ range: s.range,
472
+ headroomKey: $,
473
+ barShape: v,
474
+ rounded: c,
475
+ fillOf: ne,
476
+ radiusFor: X
477
+ }), O = xe && /* @__PURE__ */ i(
478
+ ot,
479
+ {
480
+ dataKey: e,
481
+ position: K,
482
+ formatter: ft(Pe),
483
+ className: ht(K),
484
+ fontSize: dt
485
+ }
486
+ );
487
+ return /* @__PURE__ */ g(T.Fragment, { children: [
488
+ /* @__PURE__ */ g(
489
+ fe,
490
+ {
491
+ dataKey: e,
492
+ fill: ne(e, v),
493
+ stackId: D ? "a" : $ ? e : void 0,
494
+ radius: X(v, c),
495
+ minPointSize: Xe(e),
496
+ background: Ce ? { fill: U } : void 0,
497
+ shape: S,
498
+ activeBar: R,
499
+ ...Q,
500
+ children: [
501
+ y,
502
+ O
503
+ ]
504
+ }
505
+ ),
506
+ $ && /* @__PURE__ */ i(
507
+ fe,
508
+ {
509
+ dataKey: `${F}${e}`,
510
+ stackId: e,
511
+ fill: `var(--color-${e})`,
512
+ fillOpacity: 0.25,
513
+ radius: X(v, !0),
514
+ legendType: "none",
515
+ tooltipType: "none",
516
+ ...Q
517
+ }
518
+ )
519
+ ] }, e);
520
+ }), qe = () => ee.map(({ area: e, range: l }, c) => {
521
+ var S, R, y, O;
522
+ const [s, f] = l, $ = d === "horizontal" ? { y1: (S = o[s]) == null ? void 0 : S[a], y2: (R = o[f]) == null ? void 0 : R[a] } : { x1: (y = o[s]) == null ? void 0 : y[a], x2: (O = o[f]) == null ? void 0 : O[a] };
523
+ return /* @__PURE__ */ i(
524
+ nt,
525
+ {
526
+ ...$,
527
+ fill: "var(--ui-background-surface-secondary)",
528
+ fillOpacity: 0.6,
529
+ ifOverflow: "extendDomain",
530
+ shape: Nt({
531
+ divider: e.divider,
532
+ vertical: d !== "horizontal"
533
+ }),
534
+ label: wt(e.label)
535
+ },
536
+ `${e.label ?? "area"}-${c}`
537
+ );
538
+ }), Je = () => Ve.map((e, l) => {
539
+ const c = ut(e, o, r);
540
+ return c === void 0 ? null : /* @__PURE__ */ i(
541
+ it,
542
+ {
543
+ ...d === "horizontal" ? { x: c } : { y: c },
544
+ ...vt(
545
+ e.label,
546
+ e.labelPosition ?? (d === "horizontal" ? "top" : "insideTopRight")
547
+ )
548
+ },
549
+ `${e.label ?? "ref"}-${l}`
550
+ );
551
+ });
552
+ return /* @__PURE__ */ i(
73
553
  "div",
74
554
  {
75
- ref: J,
76
- "data-orientation": r,
77
- "data-layout": f,
78
- className: x(it({ orientation: r, layout: f }), e),
79
- ...I,
80
- children: /* @__PURE__ */ t(
81
- A,
555
+ ref: He,
556
+ "data-orientation": d,
557
+ "data-layout": C,
558
+ className: ue(St({ orientation: d, layout: C }), t),
559
+ ...Ae,
560
+ children: /* @__PURE__ */ i(
561
+ Lt,
82
562
  {
83
- config: v,
563
+ config: n,
84
564
  className: "size-full [&_.recharts-label]:fill-foreground",
85
- children: /* @__PURE__ */ p(W, { data: u, layout: K, children: [
86
- T && /* @__PURE__ */ t(
87
- X,
88
- {
89
- horizontal: _ ?? r === "vertical",
90
- vertical: q ?? r === "horizontal",
91
- strokeDasharray: O ? "3 3" : void 0
92
- }
93
- ),
94
- r === "horizontal" ? /* @__PURE__ */ p(V, { children: [
95
- /* @__PURE__ */ t(
96
- j,
97
- {
98
- type: "number",
99
- hide: !y,
100
- tickLine: !1,
101
- axisLine: !1,
102
- unit: R,
103
- tickFormatter: C,
104
- angle: i,
105
- interval: z,
106
- textAnchor: i != null ? i < 0 ? "end" : "start" : void 0,
107
- tickCount: B,
108
- domain: F,
109
- height: N,
110
- label: D
111
- }
112
- ),
113
- /* @__PURE__ */ t(
114
- w,
115
- {
116
- dataKey: l,
117
- type: "category",
118
- hide: !g,
119
- tickLine: !1,
120
- axisLine: !1,
121
- tickFormatter: k,
122
- width: h ? 96 : 80,
123
- label: $
124
- }
125
- )
126
- ] }) : /* @__PURE__ */ p(V, { children: [
127
- /* @__PURE__ */ t(
128
- j,
129
- {
130
- dataKey: l,
131
- type: "category",
132
- hide: !y,
133
- tickLine: !1,
134
- axisLine: !1,
135
- tickFormatter: C,
136
- angle: i,
137
- interval: z,
138
- textAnchor: i != null ? i < 0 ? "end" : "start" : void 0,
139
- height: N,
140
- label: D
141
- }
142
- ),
143
- /* @__PURE__ */ t(
144
- w,
145
- {
146
- type: "number",
147
- hide: !g,
148
- tickLine: !1,
149
- axisLine: !1,
150
- unit: S,
151
- tickFormatter: k,
152
- tickCount: B,
153
- domain: F,
154
- width: h ? 72 : void 0,
155
- label: $
156
- }
157
- )
158
- ] }),
159
- G && /* @__PURE__ */ t(tt, { content: E ?? /* @__PURE__ */ t(at, {}) }),
160
- H && /* @__PURE__ */ t(rt, { content: /* @__PURE__ */ t(et, {}) }),
161
- s.map((n, m) => {
162
- const c = b ? m === s.length - 1 : !0;
163
- return /* @__PURE__ */ t(
164
- Y,
165
- {
166
- dataKey: n,
167
- fill: `var(--color-${n})`,
168
- stackId: b ? "a" : void 0,
169
- radius: d > 0 && c ? P : void 0,
170
- isAnimationActive: !1
171
- },
172
- n
173
- );
174
- }),
175
- L.map((n, m) => {
176
- const c = nt(n, u, s);
177
- return c === void 0 ? null : /* @__PURE__ */ t(
178
- Z,
179
- {
180
- ...r === "horizontal" ? { x: c } : { y: c },
181
- stroke: "var(--ui-text-on-surface-secondary)",
182
- strokeDasharray: "4 4",
183
- ifOverflow: "extendDomain",
184
- label: n.label ? {
185
- value: n.label,
186
- // Sit the caption at the top of the line: above the
187
- // right end of a horizontal line (vertical bars), or
188
- // above the top of a vertical line (horizontal bars).
189
- position: r === "horizontal" ? "top" : "insideTopRight",
190
- fill: "var(--ui-text-on-surface-secondary)",
191
- fontSize: 12
192
- } : void 0
193
- },
194
- `${n.label ?? "ref"}-${m}`
195
- );
196
- })
197
- ] })
565
+ children: /* @__PURE__ */ g(
566
+ et,
567
+ {
568
+ data: V,
569
+ layout: Me,
570
+ barSize: m,
571
+ maxBarSize: N,
572
+ barGap: H,
573
+ barCategoryGap: w,
574
+ children: [
575
+ /* @__PURE__ */ i(
576
+ xt,
577
+ {
578
+ id: G,
579
+ dataKeys: r,
580
+ shapes: oe,
581
+ horizontal: d === "horizontal"
582
+ }
583
+ ),
584
+ ze && /* @__PURE__ */ i(
585
+ tt,
586
+ {
587
+ horizontal: Re ?? d === "vertical",
588
+ vertical: Te ?? d === "horizontal",
589
+ strokeDasharray: Se ? "3 3" : void 0
590
+ }
591
+ ),
592
+ Ye(),
593
+ ye && /* @__PURE__ */ i(zt, { content: Ie }),
594
+ Oe && /* @__PURE__ */ i(yt, { content: Ue }),
595
+ Ze(),
596
+ qe(),
597
+ Je(),
598
+ _e && /* @__PURE__ */ i(
599
+ rt,
600
+ {
601
+ dataKey: a,
602
+ tickFormatter: d === "horizontal" ? B : x,
603
+ ...ct({ brushHeight: Fe, brushAriaLabel: We })
604
+ }
605
+ )
606
+ ]
607
+ }
608
+ )
198
609
  }
199
610
  )
200
611
  }
201
612
  );
202
613
  }
203
614
  );
204
- lt.displayName = "BarChart";
615
+ Pt.displayName = "BarChart";
205
616
  export {
206
- lt as BarChart,
207
- nt as barChartReferenceValue,
208
- it as barChartVariants
617
+ Pt as BarChart,
618
+ Tt as NormalizedLegendContent,
619
+ Rt as NormalizedTooltipContent,
620
+ St as barChartVariants,
621
+ pe as createTrackShape,
622
+ me as dropHeadroomSeries,
623
+ $e as withSeriesColor
209
624
  };
210
625
  //# sourceMappingURL=bar-chart.js.map