@acronis-platform/ui-react 0.58.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 (118) 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 +210 -119
  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 -149
  8. package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
  9. package/dist/components/ui/calendar/calendar.js +17 -15
  10. package/dist/components/ui/calendar/calendar.js.map +1 -1
  11. package/dist/components/ui/carousel-dialog/carousel-dialog.js +87 -0
  12. package/dist/components/ui/carousel-dialog/carousel-dialog.js.map +1 -0
  13. package/dist/components/ui/category-bar/category-bar.js +147 -0
  14. package/dist/components/ui/category-bar/category-bar.js.map +1 -0
  15. package/dist/components/ui/chart/chart-format.js +170 -0
  16. package/dist/components/ui/chart/chart-format.js.map +1 -0
  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 +423 -98
  20. package/dist/components/ui/composed-chart/composed-chart.js.map +1 -1
  21. package/dist/components/ui/confidence-cone/confidence-cone.js +306 -172
  22. package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -1
  23. package/dist/components/ui/dialog/dialog.js +29 -29
  24. package/dist/components/ui/dialog/dialog.js.map +1 -1
  25. package/dist/components/ui/dialog-footer-carousel/dialog-footer-carousel.js +57 -0
  26. package/dist/components/ui/dialog-footer-carousel/dialog-footer-carousel.js.map +1 -0
  27. package/dist/components/ui/dialog-footer-default/dialog-footer-default.js +1 -1
  28. package/dist/components/ui/dialog-footer-default/dialog-footer-default.js.map +1 -1
  29. package/dist/components/ui/dialog-welcome/dialog-welcome.js +272 -0
  30. package/dist/components/ui/dialog-welcome/dialog-welcome.js.map +1 -0
  31. package/dist/components/ui/funnel-chart/funnel-chart.js +245 -51
  32. package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -1
  33. package/dist/components/ui/histogram/histogram.js +96 -64
  34. package/dist/components/ui/histogram/histogram.js.map +1 -1
  35. package/dist/components/ui/input/input.js.map +1 -1
  36. package/dist/components/ui/line-chart/line-chart.js +230 -159
  37. package/dist/components/ui/line-chart/line-chart.js.map +1 -1
  38. package/dist/components/ui/metric/metric.js +88 -70
  39. package/dist/components/ui/metric/metric.js.map +1 -1
  40. package/dist/components/ui/pie-chart/pie-chart.js +234 -80
  41. package/dist/components/ui/pie-chart/pie-chart.js.map +1 -1
  42. package/dist/components/ui/radar-chart/radar-chart.js +210 -57
  43. package/dist/components/ui/radar-chart/radar-chart.js.map +1 -1
  44. package/dist/components/ui/radial-bar-chart/radial-bar-chart.js +358 -50
  45. package/dist/components/ui/radial-bar-chart/radial-bar-chart.js.map +1 -1
  46. package/dist/components/ui/sankey-chart/sankey-chart.js +199 -0
  47. package/dist/components/ui/sankey-chart/sankey-chart.js.map +1 -0
  48. package/dist/components/ui/scatter-chart/scatter-chart.js +86 -50
  49. package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -1
  50. package/dist/components/ui/timeline/timeline.js +206 -142
  51. package/dist/components/ui/timeline/timeline.js.map +1 -1
  52. package/dist/components/ui/toolbar/toolbar.js +82 -92
  53. package/dist/components/ui/toolbar/toolbar.js.map +1 -1
  54. package/dist/components/ui/treemap/treemap.js +183 -59
  55. package/dist/components/ui/treemap/treemap.js.map +1 -1
  56. package/dist/index.js +481 -439
  57. package/dist/index.js.map +1 -1
  58. package/dist/lib/breakpoints.js +9 -6
  59. package/dist/lib/breakpoints.js.map +1 -1
  60. package/dist/node_modules/.pnpm/embla-carousel-react@8.6.0_react@19.2.6/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +25 -0
  61. package/dist/node_modules/.pnpm/embla-carousel-react@8.6.0_react@19.2.6/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js.map +1 -0
  62. package/dist/node_modules/.pnpm/embla-carousel-reactive-utils@8.6.0_embla-carousel@8.6.0/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +36 -0
  63. package/dist/node_modules/.pnpm/embla-carousel-reactive-utils@8.6.0_embla-carousel@8.6.0/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js.map +1 -0
  64. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/embla-carousel.esm.js +1205 -0
  65. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/embla-carousel.esm.js.map +1 -0
  66. package/dist/react.js +481 -439
  67. package/dist/react.js.map +1 -1
  68. package/dist/src/components/ui/area-chart/area-chart.d.ts +52 -17
  69. package/dist/src/components/ui/area-chart/index.d.ts +1 -1
  70. package/dist/src/components/ui/avatar/avatar.d.ts +1 -1
  71. package/dist/src/components/ui/bar-chart/bar-chart.d.ts +152 -29
  72. package/dist/src/components/ui/bar-chart/index.d.ts +1 -1
  73. package/dist/src/components/ui/button/button.d.ts +1 -1
  74. package/dist/src/components/ui/button-menu/button-menu.d.ts +1 -1
  75. package/dist/src/components/ui/carousel-dialog/carousel-dialog.d.ts +28 -0
  76. package/dist/src/components/ui/carousel-dialog/index.d.ts +1 -0
  77. package/dist/src/components/ui/category-bar/category-bar.d.ts +51 -0
  78. package/dist/src/components/ui/category-bar/index.d.ts +1 -0
  79. package/dist/src/components/ui/chart/__tests__/chart-format.test.d.ts +1 -0
  80. package/dist/src/components/ui/chart/__tests__/chart-layout.d.ts +63 -0
  81. package/dist/src/components/ui/chart/__tests__/chart-layout.test.d.ts +1 -0
  82. package/dist/src/components/ui/chart/chart-format.d.ts +526 -0
  83. package/dist/src/components/ui/chart/chart.d.ts +11 -3
  84. package/dist/src/components/ui/chart/index.d.ts +3 -1
  85. package/dist/src/components/ui/composed-chart/composed-chart.d.ts +154 -20
  86. package/dist/src/components/ui/composed-chart/index.d.ts +1 -1
  87. package/dist/src/components/ui/confidence-cone/confidence-cone.d.ts +138 -37
  88. package/dist/src/components/ui/confidence-cone/index.d.ts +1 -1
  89. package/dist/src/components/ui/dialog-footer-carousel/dialog-footer-carousel.d.ts +9 -0
  90. package/dist/src/components/ui/dialog-footer-carousel/index.d.ts +1 -0
  91. package/dist/src/components/ui/dialog-welcome/dialog-welcome.d.ts +54 -0
  92. package/dist/src/components/ui/dialog-welcome/dialog-welcome.docs.d.ts +55 -0
  93. package/dist/src/components/ui/dialog-welcome/index.d.ts +1 -0
  94. package/dist/src/components/ui/funnel-chart/funnel-chart.d.ts +201 -3
  95. package/dist/src/components/ui/funnel-chart/index.d.ts +1 -1
  96. package/dist/src/components/ui/histogram/histogram.d.ts +2 -17
  97. package/dist/src/components/ui/line-chart/index.d.ts +1 -1
  98. package/dist/src/components/ui/line-chart/line-chart.d.ts +50 -17
  99. package/dist/src/components/ui/pie-chart/index.d.ts +1 -1
  100. package/dist/src/components/ui/pie-chart/pie-chart.d.ts +145 -4
  101. package/dist/src/components/ui/radar-chart/index.d.ts +1 -1
  102. package/dist/src/components/ui/radar-chart/radar-chart.d.ts +219 -6
  103. package/dist/src/components/ui/radial-bar-chart/index.d.ts +1 -1
  104. package/dist/src/components/ui/radial-bar-chart/radial-bar-chart.d.ts +215 -9
  105. package/dist/src/components/ui/sankey-chart/index.d.ts +2 -0
  106. package/dist/src/components/ui/sankey-chart/sankey-chart.d.ts +69 -0
  107. package/dist/src/components/ui/scatter-chart/scatter-chart.d.ts +2 -17
  108. package/dist/src/components/ui/timeline/index.d.ts +1 -1
  109. package/dist/src/components/ui/timeline/timeline.d.ts +79 -20
  110. package/dist/src/components/ui/treemap/index.d.ts +1 -1
  111. package/dist/src/components/ui/treemap/treemap.d.ts +68 -8
  112. package/dist/src/index.d.ts +5 -1
  113. package/dist/ui-react.css +1 -1
  114. package/package.json +5 -4
  115. package/dist/components/ui/search-global/search-global.js +0 -60
  116. package/dist/components/ui/search-global/search-global.js.map +0 -1
  117. package/dist/src/components/ui/search-global/index.d.ts +0 -1
  118. package/dist/src/components/ui/search-global/search-global.d.ts +0 -7
@@ -1,10 +1,11 @@
1
- import { jsx as t, jsxs as p, Fragment as C } from "react/jsx-runtime";
2
- import * as R from "react";
3
- import { cva as S } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
4
- import { BarChart as F, CartesianGrid as G, XAxis as z, YAxis as k, Bar as I, ReferenceLine as M } from "recharts";
5
- import { cn as O } from "../../../lib/utils.js";
6
- import { ChartContainer as X, ChartTooltip as Y, ChartTooltipContent as _, ChartLegend as q, ChartLegendContent as E } from "../chart/chart.js";
7
- const H = S("", {
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("", {
8
9
  variants: {
9
10
  orientation: {
10
11
  vertical: "",
@@ -19,161 +20,606 @@ const H = S("", {
19
20
  orientation: "vertical",
20
21
  layout: "grouped"
21
22
  }
22
- });
23
- function J(e, h, d) {
24
- if (!e) return;
25
- if (typeof e.value == "number") return e.value;
26
- if (!e.average) return;
27
- const n = typeof e.average == "string" ? [e.average] : d, l = h.flatMap(
28
- (o) => n.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)
29
27
  );
30
- if (l.length !== 0)
31
- 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;
32
31
  }
33
- const K = R.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(
34
276
  ({
35
- className: e,
36
- config: h,
37
- data: d,
38
- dataKeys: n,
39
- xKey: l,
40
- referenceLine: o,
41
- xAxisLabel: a,
42
- yAxisLabel: u,
43
- xUnit: x,
44
- yUnit: B,
45
- orientation: r = "vertical",
46
- layout: f = "grouped",
47
- barRadius: s = 4,
48
- showGrid: b = !0,
49
- showTooltip: T = !0,
50
- showLegend: w = !0,
51
- tooltipContent: $,
52
- ...A
53
- }, N) => {
54
- const V = r === "horizontal" ? "vertical" : "horizontal", m = f === "stacked", j = o ? Array.isArray(o) ? o : [o] : [], g = a ? { value: a, position: "insideBottom", offset: 0 } : void 0, y = u ? {
55
- value: u,
56
- angle: -90,
57
- position: "insideLeft",
58
- style: { textAnchor: "middle" }
59
- } : void 0, D = r === "horizontal" ? [0, s, s, 0] : [s, s, 0, 0];
60
- 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(
61
553
  "div",
62
554
  {
63
- ref: N,
64
- "data-orientation": r,
65
- "data-layout": f,
66
- className: O(H({ orientation: r, layout: f }), e),
67
- ...A,
68
- children: /* @__PURE__ */ t(
69
- X,
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,
70
562
  {
71
- config: h,
563
+ config: n,
72
564
  className: "size-full [&_.recharts-label]:fill-foreground",
73
- children: /* @__PURE__ */ p(F, { data: d, layout: V, children: [
74
- b && /* @__PURE__ */ t(
75
- G,
76
- {
77
- horizontal: r === "vertical",
78
- vertical: r === "horizontal"
79
- }
80
- ),
81
- r === "horizontal" ? /* @__PURE__ */ p(C, { children: [
82
- /* @__PURE__ */ t(
83
- z,
84
- {
85
- type: "number",
86
- tickLine: !1,
87
- axisLine: !1,
88
- unit: x,
89
- height: a ? 48 : void 0,
90
- label: g
91
- }
92
- ),
93
- /* @__PURE__ */ t(
94
- k,
95
- {
96
- dataKey: l,
97
- type: "category",
98
- tickLine: !1,
99
- axisLine: !1,
100
- width: u ? 96 : 80,
101
- label: y
102
- }
103
- )
104
- ] }) : /* @__PURE__ */ p(C, { children: [
105
- /* @__PURE__ */ t(
106
- z,
107
- {
108
- dataKey: l,
109
- type: "category",
110
- tickLine: !1,
111
- axisLine: !1,
112
- height: a ? 48 : void 0,
113
- label: g
114
- }
115
- ),
116
- /* @__PURE__ */ t(
117
- k,
118
- {
119
- type: "number",
120
- tickLine: !1,
121
- axisLine: !1,
122
- unit: B,
123
- width: u ? 72 : void 0,
124
- label: y
125
- }
126
- )
127
- ] }),
128
- T && /* @__PURE__ */ t(Y, { content: $ ?? /* @__PURE__ */ t(_, {}) }),
129
- w && /* @__PURE__ */ t(q, { content: /* @__PURE__ */ t(E, {}) }),
130
- n.map((i, v) => {
131
- const c = m ? v === n.length - 1 : !0;
132
- return /* @__PURE__ */ t(
133
- I,
134
- {
135
- dataKey: i,
136
- fill: `var(--color-${i})`,
137
- stackId: m ? "a" : void 0,
138
- radius: s > 0 && c ? D : void 0,
139
- isAnimationActive: !1
140
- },
141
- i
142
- );
143
- }),
144
- j.map((i, v) => {
145
- const c = J(i, d, n);
146
- return c === void 0 ? null : /* @__PURE__ */ t(
147
- M,
148
- {
149
- ...r === "horizontal" ? { x: c } : { y: c },
150
- stroke: "var(--ui-text-on-surface-secondary)",
151
- strokeDasharray: "4 4",
152
- ifOverflow: "extendDomain",
153
- label: i.label ? {
154
- value: i.label,
155
- // Sit the caption at the top of the line: above the
156
- // right end of a horizontal line (vertical bars), or
157
- // above the top of a vertical line (horizontal bars).
158
- position: r === "horizontal" ? "top" : "insideTopRight",
159
- fill: "var(--ui-text-on-surface-secondary)",
160
- fontSize: 12
161
- } : void 0
162
- },
163
- `${i.label ?? "ref"}-${v}`
164
- );
165
- })
166
- ] })
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
+ )
167
609
  }
168
610
  )
169
611
  }
170
612
  );
171
613
  }
172
614
  );
173
- K.displayName = "BarChart";
615
+ Pt.displayName = "BarChart";
174
616
  export {
175
- K as BarChart,
176
- J as barChartReferenceValue,
177
- H 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
178
624
  };
179
625
  //# sourceMappingURL=bar-chart.js.map