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