@acronis-platform/ui-react 5.5.2 → 5.5.4

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.
@@ -3,14 +3,14 @@ import { cn as e } from "../../../lib/utils.js";
3
3
  import { cva as t } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
4
4
  import { Tooltip as n, TooltipContent as r, TooltipTrigger as i } from "../tooltip/tooltip.js";
5
5
  import { ChartContainer as a, ChartLegend as o, ChartLegendContent as s, ChartTooltip as c, ChartTooltipContent as l, resolveChartColors as u, toCssKey as d } from "../chart/chart.js";
6
- import { resolveAnimation as f, resolveAxisDomain as p, resolveBrushProps as m, resolveCartesianLabelPosition as h, resolveCategoryRange as g, resolveChartReferenceValue as _, resolveLabelFillClass as v, resolveReferenceLineProps as ee, resolveRotatedTickAnchor as te, resolveXAxisTickLabels as ne, resolveXAxisTitle as re, resolveYAxisTitle as ie, toLabelFormatter as ae, toReferenceLineList as oe } from "../chart/chart-format.js";
7
- import { mergeXAxisLayoutMargin as se, useXAxisLayout as ce } from "../chart/use-x-axis-layout.js";
8
- import * as y from "react";
9
- import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
10
- import { Bar as C, BarChart as le, Brush as ue, CartesianGrid as de, Cell as w, LabelList as fe, Rectangle as T, ReferenceArea as pe, ReferenceLine as me, Text as he, XAxis as ge, YAxis as _e } from "recharts";
11
- import { Meter as E } from "@base-ui/react/meter";
6
+ import { resolveAnimation as f, resolveAxisDomain as p, resolveBrushProps as m, resolveCartesianLabelPosition as h, resolveCategoryRange as g, resolveChartReferenceValue as _, resolveLabelFillClass as ee, resolveReferenceLineProps as te, resolveRotatedTickAnchor as ne, resolveXAxisTickLabels as re, resolveXAxisTitle as ie, resolveYAxisTitle as ae, resolveYAxisWidth as oe, toLabelFormatter as se, toReferenceLineList as ce } from "../chart/chart-format.js";
7
+ import { mergeXAxisLayoutMargin as le, useXAxisLayout as ue } from "../chart/use-x-axis-layout.js";
8
+ import * as v from "react";
9
+ import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
10
+ import { Bar as S, BarChart as de, Brush as fe, CartesianGrid as pe, Cell as C, LabelList as me, Rectangle as w, ReferenceArea as he, ReferenceLine as ge, Text as _e, XAxis as ve, YAxis as ye } from "recharts";
11
+ import { Meter as T } from "@base-ui/react/meter";
12
12
  //#region src/components/ui/bar-chart/bar-chart.tsx
13
- var D = t("", {
13
+ var E = t("", {
14
14
  variants: {
15
15
  orientation: {
16
16
  vertical: "",
@@ -25,41 +25,41 @@ var D = t("", {
25
25
  orientation: "vertical",
26
26
  layout: "grouped"
27
27
  }
28
- }), O = "__headroom_";
29
- function k(e, t) {
30
- let n = e?.filter((e) => !String(e.dataKey).startsWith(O));
28
+ }), D = "__headroom_";
29
+ function O(e, t) {
30
+ let n = e?.filter((e) => !String(e.dataKey).startsWith(D));
31
31
  return t ? n?.slice().sort((e, n) => t.indexOf(String(e.dataKey)) - t.indexOf(String(n.dataKey))) : n;
32
32
  }
33
- function A(e) {
33
+ function k(e) {
34
34
  return e?.map((e) => e.color?.startsWith("url(") ? {
35
35
  ...e,
36
36
  color: `var(--color-${d(String(e.dataKey))})`
37
37
  } : e);
38
38
  }
39
- function j({ content: e, dataKeys: t, ...n }) {
39
+ function A({ content: e, dataKeys: t, ...n }) {
40
40
  let r = {
41
41
  ...n,
42
- payload: A(k(n.payload, t))
42
+ payload: k(O(n.payload, t))
43
43
  };
44
- return e ? typeof e == "function" ? y.createElement(e, r) : y.cloneElement(e, r) : /* @__PURE__ */ x(l, { ...r });
44
+ return e ? typeof e == "function" ? v.createElement(e, r) : v.cloneElement(e, r) : /* @__PURE__ */ b(l, { ...r });
45
45
  }
46
- function M({ dataKeys: e, fontSize: t, legendAriaLabel: n, ...r }) {
47
- return /* @__PURE__ */ x(s, {
46
+ function j({ dataKeys: e, fontSize: t, legendAriaLabel: n, ...r }) {
47
+ return /* @__PURE__ */ b(s, {
48
48
  verticalAlign: r.verticalAlign,
49
49
  fontSize: t,
50
50
  ariaLabel: n,
51
- payload: A(k(r.payload, e))
51
+ payload: k(O(r.payload, e))
52
52
  });
53
53
  }
54
- function N({ bar: e, track: t, trackFill: n, paint: r }) {
55
- return /* @__PURE__ */ S(b, { children: [t && /* @__PURE__ */ x(T, {
54
+ function M({ bar: e, track: t, trackFill: n, paint: r }) {
55
+ return /* @__PURE__ */ x(y, { children: [t && /* @__PURE__ */ b(w, {
56
56
  className: "recharts-bar-background-rectangle",
57
57
  x: t.x ?? void 0,
58
58
  y: t.y ?? void 0,
59
59
  width: t.width ?? void 0,
60
60
  height: t.height ?? void 0,
61
61
  fill: n
62
- }), /* @__PURE__ */ x(T, {
62
+ }), /* @__PURE__ */ b(w, {
63
63
  x: e.x ?? void 0,
64
64
  y: e.y ?? void 0,
65
65
  width: e.width ?? void 0,
@@ -72,21 +72,21 @@ function N({ bar: e, track: t, trackFill: n, paint: r }) {
72
72
  strokeDasharray: e.strokeDasharray
73
73
  })] });
74
74
  }
75
- function P({ inRange: e, trackFill: t, paint: n }) {
76
- return ({ background: r, index: i, ...a }) => N({
75
+ function N({ inRange: e, trackFill: t, paint: n }) {
76
+ return ({ background: r, index: i, ...a }) => M({
77
77
  bar: a,
78
78
  track: e(i) ? r : void 0,
79
79
  trackFill: t,
80
80
  paint: n
81
81
  });
82
82
  }
83
- function ve({ rangeBackground: e, inRange: t, trackFill: n, activeBarOption: r }) {
83
+ function be({ rangeBackground: e, inRange: t, trackFill: n, activeBarOption: r }) {
84
84
  return e ? {
85
- shape: P({
85
+ shape: N({
86
86
  inRange: t,
87
87
  trackFill: n
88
88
  }),
89
- activeBar: r && P({
89
+ activeBar: r && N({
90
90
  inRange: t,
91
91
  trackFill: n,
92
92
  paint: r
@@ -96,9 +96,9 @@ function ve({ rangeBackground: e, inRange: t, trackFill: n, activeBarOption: r }
96
96
  activeBar: r
97
97
  };
98
98
  }
99
- function F(e) {
99
+ function P(e) {
100
100
  let { x: t = 0, y: n = 0, width: r = 0, height: i = 0, fill: a, fillOpacity: o } = e;
101
- return /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(T, {
101
+ return /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(w, {
102
102
  className: "recharts-reference-area-rect",
103
103
  x: t,
104
104
  y: n,
@@ -106,7 +106,7 @@ function F(e) {
106
106
  height: i,
107
107
  fill: a,
108
108
  fillOpacity: o
109
- }), /* @__PURE__ */ x("line", {
109
+ }), /* @__PURE__ */ b("line", {
110
110
  x1: t,
111
111
  y1: n,
112
112
  x2: t,
@@ -115,10 +115,10 @@ function F(e) {
115
115
  strokeDasharray: "4 4"
116
116
  })] });
117
117
  }
118
- function ye(e) {
119
- if (e) return F;
118
+ function xe(e) {
119
+ if (e) return P;
120
120
  }
121
- function be(e) {
121
+ function Se(e) {
122
122
  return e ? {
123
123
  value: e,
124
124
  position: "insideTop",
@@ -126,35 +126,35 @@ function be(e) {
126
126
  fontSize: 12
127
127
  } : void 0;
128
128
  }
129
- function xe({ id: e, dataKeys: t, shapes: n }) {
129
+ function Ce({ id: e, dataKeys: t, shapes: n }) {
130
130
  let r = n.has("gradient"), i = n.has("pattern");
131
- return !r && !i ? null : /* @__PURE__ */ x("defs", { children: t.map((t) => /* @__PURE__ */ S(y.Fragment, { children: [r && /* @__PURE__ */ S("linearGradient", {
131
+ return !r && !i ? null : /* @__PURE__ */ b("defs", { children: t.map((t) => /* @__PURE__ */ x(v.Fragment, { children: [r && /* @__PURE__ */ x("linearGradient", {
132
132
  id: `${e}-gradient-${d(t)}`,
133
133
  x1: "0",
134
134
  y1: "0",
135
135
  x2: "0",
136
136
  y2: "1",
137
- children: [/* @__PURE__ */ x("stop", {
137
+ children: [/* @__PURE__ */ b("stop", {
138
138
  offset: "0%",
139
139
  stopColor: `var(--color-${d(t)})`,
140
140
  stopOpacity: 1
141
- }), /* @__PURE__ */ x("stop", {
141
+ }), /* @__PURE__ */ b("stop", {
142
142
  offset: "100%",
143
143
  stopColor: `var(--color-${d(t)})`,
144
144
  stopOpacity: .35
145
145
  })]
146
- }), i && /* @__PURE__ */ S("pattern", {
146
+ }), i && /* @__PURE__ */ x("pattern", {
147
147
  id: `${e}-pattern-${d(t)}`,
148
148
  patternUnits: "userSpaceOnUse",
149
149
  width: 6,
150
150
  height: 6,
151
151
  patternTransform: "rotate(45)",
152
- children: [/* @__PURE__ */ x("rect", {
152
+ children: [/* @__PURE__ */ b("rect", {
153
153
  width: 6,
154
154
  height: 6,
155
155
  fill: `var(--color-${d(t)})`,
156
156
  fillOpacity: .25
157
- }), /* @__PURE__ */ x("line", {
157
+ }), /* @__PURE__ */ b("line", {
158
158
  x1: 0,
159
159
  y1: 0,
160
160
  x2: 0,
@@ -164,40 +164,40 @@ function xe({ id: e, dataKeys: t, shapes: n }) {
164
164
  })]
165
165
  })] }, t)) });
166
166
  }
167
- function Se({ data: e, chartData: t, xKey: n, seriesKey: r, settings: i, range: a, headroomKey: o, barShape: s, rounded: c, fillOf: l, radiusFor: u }) {
167
+ function we({ data: e, chartData: t, xKey: n, seriesKey: r, settings: i, range: a, headroomKey: o, barShape: s, rounded: c, fillOf: l, radiusFor: u }) {
168
168
  let { fill: f, opacity: p, dashed: m } = i;
169
169
  return e.map((e, h) => {
170
- let g = h >= a[0] && h <= a[1], _ = g && i.shape || s, v = o !== void 0 && Number(t[h]?.[`${O}${r}`]) > 0;
171
- return /* @__PURE__ */ x(w, {
170
+ let g = h >= a[0] && h <= a[1], _ = g && i.shape || s, ee = o !== void 0 && Number(t[h]?.[`${D}${r}`]) > 0;
171
+ return /* @__PURE__ */ b(C, {
172
172
  fill: g ? f ?? l(r, _) : l(r, s),
173
173
  fillOpacity: g ? p : void 0,
174
174
  stroke: g && m ? `var(--color-${d(r)})` : void 0,
175
175
  strokeWidth: g && m ? 1 : void 0,
176
176
  strokeDasharray: g && m ? "4 3" : void 0,
177
- radius: v ? void 0 : u(_, c)
177
+ radius: ee ? void 0 : u(_, c)
178
178
  }, `${r}-${String(e[n])}-${h}`);
179
179
  });
180
180
  }
181
- var I = (e) => e.toLocaleString();
182
- function L({ item: t, resolvedColor: a, max: o, valueFormatter: s, showTooltip: c, tooltip: l }) {
183
- let { label: u, value: d, forecast: f } = t, p = a, m = o > 0 ? Math.round(d / o * 100) : 0, h = f != null && f > d, g = /* @__PURE__ */ S(E.Root, {
181
+ var F = (e) => e.toLocaleString();
182
+ function I({ item: t, resolvedColor: a, max: o, valueFormatter: s, showTooltip: c, tooltip: l }) {
183
+ let { label: u, value: d, forecast: f } = t, p = a, m = o > 0 ? Math.round(d / o * 100) : 0, h = f != null && f > d, g = /* @__PURE__ */ x(T.Root, {
184
184
  value: d,
185
185
  max: o,
186
186
  "aria-valuemax": o,
187
187
  "aria-valuetext": h ? `${s(d)} of ${s(o)} (${m}%), forecast ${s(f)}` : `${s(d)} of ${s(o)} (${m}%)`,
188
188
  tabIndex: c ? 0 : void 0,
189
189
  className: "flex w-full flex-col gap-1.5",
190
- children: [/* @__PURE__ */ S("div", {
190
+ children: [/* @__PURE__ */ x("div", {
191
191
  className: "flex items-baseline justify-between gap-2 text-sm leading-none",
192
- children: [/* @__PURE__ */ x(E.Label, {
192
+ children: [/* @__PURE__ */ b(T.Label, {
193
193
  className: "truncate font-semibold",
194
194
  children: u
195
- }), /* @__PURE__ */ S("span", {
195
+ }), /* @__PURE__ */ x("span", {
196
196
  className: "shrink-0 tabular-nums",
197
- children: [/* @__PURE__ */ x("span", {
197
+ children: [/* @__PURE__ */ b("span", {
198
198
  className: "font-semibold text-[var(--ui-text-on-surface-link-idle)]",
199
199
  children: s(d)
200
- }), /* @__PURE__ */ S("span", {
200
+ }), /* @__PURE__ */ x("span", {
201
201
  className: "text-muted-foreground",
202
202
  children: [
203
203
  " ",
@@ -206,9 +206,9 @@ function L({ item: t, resolvedColor: a, max: o, valueFormatter: s, showTooltip:
206
206
  ]
207
207
  })]
208
208
  })]
209
- }), /* @__PURE__ */ S(E.Track, {
209
+ }), /* @__PURE__ */ x(T.Track, {
210
210
  className: "relative h-2 w-full overflow-hidden rounded-full bg-[var(--ui-background-status-neutral-pressed)]",
211
- children: [h && /* @__PURE__ */ x("div", {
211
+ children: [h && /* @__PURE__ */ b("div", {
212
212
  "data-forecast": !0,
213
213
  className: "absolute inset-y-0 start-0 rounded-full",
214
214
  style: {
@@ -216,24 +216,24 @@ function L({ item: t, resolvedColor: a, max: o, valueFormatter: s, showTooltip:
216
216
  opacity: .3,
217
217
  width: `${f / o * 100}%`
218
218
  }
219
- }), /* @__PURE__ */ x(E.Indicator, {
219
+ }), /* @__PURE__ */ b(T.Indicator, {
220
220
  className: "relative rounded-full",
221
221
  style: { backgroundColor: p }
222
222
  })]
223
223
  })]
224
224
  });
225
- return c ? /* @__PURE__ */ S(n, { children: [/* @__PURE__ */ x(i, { render: g }), /* @__PURE__ */ x(r, {
225
+ return c ? /* @__PURE__ */ x(n, { children: [/* @__PURE__ */ b(i, { render: g }), /* @__PURE__ */ b(r, {
226
226
  className: e("border border-border bg-background text-foreground shadow-md", !l && "flex items-center gap-2"),
227
- children: l ?? /* @__PURE__ */ S(b, { children: [
228
- /* @__PURE__ */ x("span", {
227
+ children: l ?? /* @__PURE__ */ x(y, { children: [
228
+ /* @__PURE__ */ b("span", {
229
229
  className: "size-2.5 shrink-0 rounded-full",
230
230
  style: { backgroundColor: p }
231
231
  }),
232
- /* @__PURE__ */ x("span", {
232
+ /* @__PURE__ */ b("span", {
233
233
  className: "font-semibold",
234
234
  children: u
235
235
  }),
236
- /* @__PURE__ */ S("span", {
236
+ /* @__PURE__ */ x("span", {
237
237
  className: "text-muted-foreground",
238
238
  children: [
239
239
  s(d),
@@ -247,8 +247,8 @@ function L({ item: t, resolvedColor: a, max: o, valueFormatter: s, showTooltip:
247
247
  ] })
248
248
  })] }) : g;
249
249
  }
250
- var R = y.forwardRef(({ items: t, max: n, palette: r, valueFormatter: i = I, showTooltip: a = !0, tooltip: o, className: s, ...c }, l) => {
251
- let d = n !== void 0 && n > 0 ? n : t.reduce((e, t) => e + t.value, 0) || 1, f = y.useMemo(() => {
250
+ var L = v.forwardRef(({ items: t, max: n, palette: r, valueFormatter: i = F, showTooltip: a = !0, tooltip: o, className: s, ...c }, l) => {
251
+ let d = n !== void 0 && n > 0 ? n : t.reduce((e, t) => e + t.value, 0) || 1, f = v.useMemo(() => {
252
252
  if (!r) return null;
253
253
  let e = Object.fromEntries(t.map((e, t) => [`item${t}`, {
254
254
  label: e.label,
@@ -256,12 +256,12 @@ var R = y.forwardRef(({ items: t, max: n, palette: r, valueFormatter: i = I, sho
256
256
  }])), n = u(e, r);
257
257
  return t.map((e, t) => e.color ?? n[`item${t}`]?.color ?? "");
258
258
  }, [t, r]);
259
- return /* @__PURE__ */ x("div", {
259
+ return /* @__PURE__ */ b("div", {
260
260
  ref: l,
261
261
  "data-orientation": "horizontal",
262
262
  className: e("flex flex-col gap-4", s),
263
263
  ...c,
264
- children: t.map((e, t) => /* @__PURE__ */ x(L, {
264
+ children: t.map((e, t) => /* @__PURE__ */ b(I, {
265
265
  item: e,
266
266
  resolvedColor: f ? f[t] ?? "" : e.color ?? "",
267
267
  max: d,
@@ -271,207 +271,207 @@ var R = y.forwardRef(({ items: t, max: n, palette: r, valueFormatter: i = I, sho
271
271
  }, `${t}-${e.label}`))
272
272
  });
273
273
  });
274
- R.displayName = "HorizontalBarLayout";
275
- var z = y.forwardRef((t, n) => {
276
- let r = y.useId().replace(/:/g, ""), i = y.useRef(null), s = t, l = s.xKey, u = ne(s.data && l ? s.data.map((e) => e[l]) : [], s.xTickFormatter), w = ce(i, s.xAxisAngle, s.xAxisLabel, u.join("\0"));
274
+ L.displayName = "HorizontalBarLayout";
275
+ var R = v.forwardRef((t, n) => {
276
+ let r = v.useId().replace(/:/g, ""), i = v.useRef(null), s = t, l = s.xKey, u = re(s.data && l ? s.data.map((e) => e[l]) : [], s.xTickFormatter), C = ue(i, s.xAxisAngle, s.xAxisLabel, u.join("\0"));
277
277
  if (t.orientation === "horizontal") {
278
278
  let { orientation: e, ...r } = t;
279
- return /* @__PURE__ */ x(R, {
279
+ return /* @__PURE__ */ b(L, {
280
280
  ...r,
281
281
  ref: n
282
282
  });
283
283
  }
284
- let { className: T, config: E, palette: k, data: A, dataKeys: N, xKey: P, referenceLine: F, referenceArea: I, barSettings: L, xAxisLabel: z, yAxisLabel: B, yUnit: Ce, orientation: V = "vertical", layout: H = "grouped", barRadius: U = 8, barShape: W = "rounded", barSize: we = 8, maxBarSize: Te, barGap: Ee = 4, barCategoryGap: De, minPointSize: Oe, showBackground: ke = !1, backgroundFill: Ae = "var(--ui-background-surface-secondary)", showActiveBar: je = !1, activeBar: G, showGrid: Me = !0, showTooltip: Ne = !0, showLegend: Pe = !0, legendFontSize: Fe, legendAriaLabel: Ie, showXAxis: Le = !0, showYAxis: Re = !0, xTickFormatter: K, yTickFormatter: ze, xAxisAngle: Be, xAxisInterval: Ve, yAxisTickCount: He, yAxisDomain: Ue, gridDashed: We = !0, gridHorizontal: Ge, gridVertical: Ke, tooltipContent: qe, animate: Je, animationDuration: Ye, animationBegin: Xe, animationEasing: Ze, showLabels: Qe = !1, labelPosition: $e, labelFormatter: et, showBrush: tt = !1, brushHeight: nt, brushAriaLabel: rt, ...it } = t, at = f({
284
+ let { className: w, config: T, palette: O, data: k, dataKeys: M, xKey: N, referenceLine: P, referenceArea: F, barSettings: I, xAxisLabel: R, yAxisLabel: z, yUnit: Te, orientation: B = "vertical", layout: V = "grouped", barRadius: H = 8, barShape: U = "rounded", barSize: Ee = 8, maxBarSize: De, barGap: Oe = 4, barCategoryGap: ke, minPointSize: W, showBackground: Ae = !1, backgroundFill: G = "var(--ui-background-surface-secondary)", showActiveBar: je = !1, activeBar: K, showGrid: Me = !0, showTooltip: Ne = !0, showLegend: Pe = !0, legendFontSize: Fe, legendAriaLabel: Ie, showXAxis: Le = !0, showYAxis: Re = !0, xTickFormatter: q, yTickFormatter: ze, xAxisAngle: Be, xAxisInterval: Ve, yAxisTickCount: He, yAxisDomain: Ue, gridDashed: We = !0, gridHorizontal: Ge, gridVertical: Ke, tooltipContent: qe, animate: Je, animationDuration: Ye, animationBegin: Xe, animationEasing: Ze, showLabels: Qe = !1, labelPosition: $e, labelFormatter: et, showBrush: tt = !1, brushHeight: nt, brushAriaLabel: rt, ...it } = t, at = f({
285
285
  animate: Je,
286
286
  animationDuration: Ye,
287
287
  animationBegin: Xe,
288
288
  animationEasing: Ze
289
- }), q = H === "stacked", ot = h({
289
+ }), J = V === "stacked", ot = h({
290
290
  labelPosition: $e,
291
- isStacked: q,
291
+ isStacked: J,
292
292
  growingEnd: "top"
293
- }), st = oe(F), ct = (I ? Array.isArray(I) ? I : [I] : []).map((e) => ({
293
+ }), st = ce(P), ct = (F ? Array.isArray(F) ? F : [F] : []).map((e) => ({
294
294
  area: e,
295
- range: g(e, A, P)
296
- })).filter((e) => e.range !== void 0), J = new Map(N.flatMap((e) => {
297
- let t = L?.[e], n = t ? g(t, A, P) : void 0;
295
+ range: g(e, k, N)
296
+ })).filter((e) => e.range !== void 0), Y = new Map(M.flatMap((e) => {
297
+ let t = I?.[e], n = t ? g(t, k, N) : void 0;
298
298
  return t && n ? [[e, {
299
299
  settings: t,
300
300
  range: n
301
301
  }]] : [];
302
- })), Y = new Map(q ? [] : Array.from(J, ([e, t]) => typeof t.settings.background == "string" ? [e, t.settings.background] : void 0).filter((e) => e !== void 0)), X = Y.size ? A.map((e, t) => {
302
+ })), X = new Map(J ? [] : Array.from(Y, ([e, t]) => typeof t.settings.background == "string" ? [e, t.settings.background] : void 0).filter((e) => e !== void 0)), Z = X.size ? k.map((e, t) => {
303
303
  let n = {};
304
- return Y.forEach((r, i) => {
305
- let a = J.get(i);
304
+ return X.forEach((r, i) => {
305
+ let a = Y.get(i);
306
306
  if (!a) return;
307
307
  let [o, s] = a.range;
308
308
  if (t < o || t > s) return;
309
309
  let c = e[i], l = e[r];
310
- typeof c == "number" && typeof l == "number" && (n[`${O}${i}`] = Math.max(0, l - c));
310
+ typeof c == "number" && typeof l == "number" && (n[`${D}${i}`] = Math.max(0, l - c));
311
311
  }), {
312
312
  ...e,
313
313
  ...n
314
314
  };
315
- }) : A, lt = new Set(ct.filter(({ area: e }) => e.highlightTicks !== !1).flatMap(({ range: e }) => A.slice(e[0], e[1] + 1).map((e) => e[P]))), ut = lt.size ? ({ payload: t, index: n, ...r }) => {
316
- let i = K ? K(t.value, n) : t.value;
317
- return /* @__PURE__ */ x(he, {
315
+ }) : k, lt = new Set(ct.filter(({ area: e }) => e.highlightTicks !== !1).flatMap(({ range: e }) => k.slice(e[0], e[1] + 1).map((e) => e[N]))), ut = lt.size ? ({ payload: t, index: n, ...r }) => {
316
+ let i = q ? q(t.value, n) : t.value;
317
+ return /* @__PURE__ */ b(_e, {
318
318
  ...r,
319
319
  className: e("fill-muted-foreground", lt.has(t.value) && "fill-primary italic"),
320
320
  fontSize: 12,
321
321
  children: i
322
322
  });
323
323
  } : void 0, dt = je ? {
324
- ...G?.fill === void 0 ? {} : { fill: G.fill },
325
- fillOpacity: G?.opacity ?? .85
326
- } : !1, Z = `bar-${r}`, ft = /* @__PURE__ */ new Set([W]);
327
- J.forEach(({ settings: e }) => {
324
+ ...K?.fill === void 0 ? {} : { fill: K.fill },
325
+ fillOpacity: K?.opacity ?? .85
326
+ } : !1, Q = `bar-${r}`, ft = /* @__PURE__ */ new Set([U]);
327
+ Y.forEach(({ settings: e }) => {
328
328
  e.shape && ft.add(e.shape);
329
329
  });
330
- let pt = (e) => Oe === void 0 ? void 0 : (t, n) => {
331
- let r = q ? X[n]?.[e] : t;
332
- return typeof r == "number" && r !== 0 ? Oe : 0;
333
- }, Q = (e, t) => t === "gradient" ? `url(#${Z}-gradient-${d(e)})` : t === "pattern" ? `url(#${Z}-pattern-${d(e)})` : `var(--color-${d(e)})`, mt = re(z), ht = ie(B), gt = p(Ue), _t = [
334
- U,
335
- U,
330
+ let pt = (e) => W === void 0 ? void 0 : (t, n) => {
331
+ let r = J ? Z[n]?.[e] : t;
332
+ return typeof r == "number" && r !== 0 ? W : 0;
333
+ }, mt = (e, t) => t === "gradient" ? `url(#${Q}-gradient-${d(e)})` : t === "pattern" ? `url(#${Q}-pattern-${d(e)})` : `var(--color-${d(e)})`, ht = ie(R), gt = ae(z), _t = p(Ue), vt = [
334
+ H,
335
+ H,
336
336
  0,
337
337
  0
338
- ], $ = (e, t) => e === "pill" ? 9999 : U > 0 && t ? _t : void 0, vt = /* @__PURE__ */ x(j, {
338
+ ], $ = (e, t) => e === "pill" ? 9999 : H > 0 && t ? vt : void 0, yt = /* @__PURE__ */ b(A, {
339
339
  content: qe,
340
- dataKeys: N
341
- }), yt = /* @__PURE__ */ x(M, {
342
- dataKeys: N,
340
+ dataKeys: M
341
+ }), bt = /* @__PURE__ */ b(j, {
342
+ dataKeys: M,
343
343
  fontSize: Fe,
344
344
  legendAriaLabel: Ie
345
- }), bt = () => /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(ge, {
346
- dataKey: P,
345
+ }), xt = () => /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(ve, {
346
+ dataKey: N,
347
347
  type: "category",
348
348
  hide: !Le,
349
349
  tickLine: !1,
350
350
  axisLine: !1,
351
351
  tick: ut,
352
- tickFormatter: K,
352
+ tickFormatter: q,
353
353
  angle: Be,
354
354
  interval: Ve,
355
- textAnchor: te(Be),
356
- height: w.height,
357
- label: mt
358
- }), /* @__PURE__ */ x(_e, {
355
+ textAnchor: ne(Be),
356
+ height: C.height,
357
+ label: ht
358
+ }), /* @__PURE__ */ b(ye, {
359
359
  type: "number",
360
360
  hide: !Re,
361
361
  tickLine: !1,
362
362
  axisLine: !1,
363
- unit: Ce,
363
+ unit: Te,
364
364
  tickFormatter: ze,
365
365
  tickCount: He,
366
- domain: gt,
367
- width: B ? 72 : void 0,
368
- label: ht
369
- })] }), xt = () => N.map((e, t) => {
370
- let n = !q || t === N.length - 1, r = J.get(e), i = (e) => r !== void 0 && e >= r.range[0] && e <= r.range[1], a = Y.get(e), { shape: o, activeBar: s } = ve({
366
+ domain: _t,
367
+ width: oe(k.length > 0, !!z),
368
+ label: gt
369
+ })] }), St = () => M.map((e, t) => {
370
+ let n = !J || t === M.length - 1, r = Y.get(e), i = (e) => r !== void 0 && e >= r.range[0] && e <= r.range[1], a = X.get(e), { shape: o, activeBar: s } = be({
371
371
  rangeBackground: r?.settings.background === !0,
372
372
  inRange: i,
373
- trackFill: Ae,
373
+ trackFill: G,
374
374
  activeBarOption: dt
375
- }), c = r && Se({
376
- data: A,
377
- chartData: X,
378
- xKey: P,
375
+ }), c = r && we({
376
+ data: k,
377
+ chartData: Z,
378
+ xKey: N,
379
379
  seriesKey: e,
380
380
  settings: r.settings,
381
381
  range: r.range,
382
382
  headroomKey: a,
383
- barShape: W,
383
+ barShape: U,
384
384
  rounded: n,
385
- fillOf: Q,
385
+ fillOf: mt,
386
386
  radiusFor: $
387
- }), l = Qe && /* @__PURE__ */ x(fe, {
387
+ }), l = Qe && /* @__PURE__ */ b(me, {
388
388
  dataKey: e,
389
389
  position: ot,
390
- formatter: ae(et),
391
- className: v(ot),
390
+ formatter: se(et),
391
+ className: ee(ot),
392
392
  fontSize: 12
393
393
  });
394
- return /* @__PURE__ */ S(y.Fragment, { children: [/* @__PURE__ */ S(C, {
394
+ return /* @__PURE__ */ x(v.Fragment, { children: [/* @__PURE__ */ x(S, {
395
395
  dataKey: e,
396
- fill: Q(e, W),
397
- stackId: q ? "a" : a ? e : void 0,
398
- radius: $(W, n),
396
+ fill: mt(e, U),
397
+ stackId: J ? "a" : a ? e : void 0,
398
+ radius: $(U, n),
399
399
  minPointSize: pt(e),
400
- background: ke ? { fill: Ae } : void 0,
400
+ background: Ae ? { fill: G } : void 0,
401
401
  shape: o,
402
402
  activeBar: s,
403
403
  ...at,
404
404
  children: [c, l]
405
- }), a && /* @__PURE__ */ x(C, {
406
- dataKey: `${O}${e}`,
405
+ }), a && /* @__PURE__ */ b(S, {
406
+ dataKey: `${D}${e}`,
407
407
  stackId: e,
408
408
  fill: `var(--color-${d(e)})`,
409
409
  fillOpacity: .25,
410
- radius: $(W, !0),
410
+ radius: $(U, !0),
411
411
  legendType: "none",
412
412
  tooltipType: "none",
413
413
  ...at
414
414
  })] }, e);
415
- }), St = () => ct.map(({ area: e, range: t }, n) => {
415
+ }), Ct = () => ct.map(({ area: e, range: t }, n) => {
416
416
  let [r, i] = t;
417
- return /* @__PURE__ */ x(pe, {
418
- x1: A[r]?.[P],
419
- x2: A[i]?.[P],
417
+ return /* @__PURE__ */ b(he, {
418
+ x1: k[r]?.[N],
419
+ x2: k[i]?.[N],
420
420
  fill: "var(--ui-background-surface-secondary)",
421
421
  fillOpacity: .6,
422
422
  ifOverflow: "extendDomain",
423
- shape: ye(e.divider),
424
- label: be(e.label)
423
+ shape: xe(e.divider),
424
+ label: Se(e.label)
425
425
  }, `${e.label ?? "area"}-${n}`);
426
- }), Ct = () => st.map((e, t) => {
427
- let n = _(e, A, N);
428
- return n === void 0 ? null : /* @__PURE__ */ x(me, {
426
+ }), wt = () => st.map((e, t) => {
427
+ let n = _(e, k, M);
428
+ return n === void 0 ? null : /* @__PURE__ */ b(ge, {
429
429
  y: n,
430
- ...ee(e.label, e.labelPosition ?? "insideTopRight")
430
+ ...te(e.label, e.labelPosition ?? "insideTopRight")
431
431
  }, `${e.label ?? "ref"}-${t}`);
432
432
  });
433
- return /* @__PURE__ */ x("div", {
433
+ return /* @__PURE__ */ b("div", {
434
434
  ref: n,
435
- "data-orientation": V,
436
- "data-layout": H,
437
- className: e(D({
438
- orientation: V,
439
- layout: H
440
- }), T),
435
+ "data-orientation": B,
436
+ "data-layout": V,
437
+ className: e(E({
438
+ orientation: B,
439
+ layout: V
440
+ }), w),
441
441
  ...it,
442
- children: /* @__PURE__ */ x(a, {
442
+ children: /* @__PURE__ */ b(a, {
443
443
  ref: i,
444
- config: E,
445
- palette: k,
444
+ config: T,
445
+ palette: O,
446
446
  className: "size-full [&_.recharts-label]:fill-foreground",
447
- children: /* @__PURE__ */ S(le, {
448
- data: X,
447
+ children: /* @__PURE__ */ x(de, {
448
+ data: Z,
449
449
  layout: "horizontal",
450
- barSize: we,
451
- maxBarSize: Te,
452
- barGap: Ee,
453
- barCategoryGap: De,
454
- margin: se(void 0, w.margin),
450
+ barSize: Ee,
451
+ maxBarSize: De,
452
+ barGap: Oe,
453
+ barCategoryGap: ke,
454
+ margin: le(void 0, C.margin),
455
455
  children: [
456
- /* @__PURE__ */ x(xe, {
457
- id: Z,
458
- dataKeys: N,
456
+ /* @__PURE__ */ b(Ce, {
457
+ id: Q,
458
+ dataKeys: M,
459
459
  shapes: ft
460
460
  }),
461
- Me && /* @__PURE__ */ x(de, {
461
+ Me && /* @__PURE__ */ b(pe, {
462
462
  horizontal: Ge ?? !0,
463
463
  vertical: Ke ?? !1,
464
464
  strokeDasharray: We ? "3 3" : void 0
465
465
  }),
466
- bt(),
467
- Ne && /* @__PURE__ */ x(c, { content: vt }),
468
- Pe && /* @__PURE__ */ x(o, { content: yt }),
469
466
  xt(),
467
+ Ne && /* @__PURE__ */ b(c, { content: yt }),
468
+ Pe && /* @__PURE__ */ b(o, { content: bt }),
470
469
  St(),
471
470
  Ct(),
472
- tt && /* @__PURE__ */ x(ue, {
473
- dataKey: P,
474
- tickFormatter: K,
471
+ wt(),
472
+ tt && /* @__PURE__ */ b(fe, {
473
+ dataKey: N,
474
+ tickFormatter: q,
475
475
  ...m({
476
476
  brushHeight: nt,
477
477
  brushAriaLabel: rt
@@ -482,8 +482,8 @@ var z = y.forwardRef((t, n) => {
482
482
  })
483
483
  });
484
484
  });
485
- z.displayName = "BarChart";
485
+ R.displayName = "BarChart";
486
486
  //#endregion
487
- export { z as BarChart, M as NormalizedLegendContent, j as NormalizedTooltipContent, D as barChartVariants, P as createTrackShape, k as dropHeadroomSeries, A as withSeriesColor };
487
+ export { R as BarChart, j as NormalizedLegendContent, A as NormalizedTooltipContent, E as barChartVariants, N as createTrackShape, O as dropHeadroomSeries, k as withSeriesColor };
488
488
 
489
489
  //# sourceMappingURL=bar-chart.js.map