@acronis-platform/ui-react 3.0.0 → 4.0.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.
- package/dist/components/ui/accordion-container/accordion-container.js +14 -14
- package/dist/components/ui/accordion-container/accordion-container.js.map +1 -1
- package/dist/components/ui/app-shell-chat/app-shell-chat.js.map +1 -1
- package/dist/components/ui/area-chart/area-chart.js +141 -139
- package/dist/components/ui/area-chart/area-chart.js.map +1 -1
- package/dist/components/ui/bar-chart/bar-chart.js +295 -293
- package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
- package/dist/components/ui/category-bar/category-bar.js +109 -93
- package/dist/components/ui/category-bar/category-bar.js.map +1 -1
- package/dist/components/ui/chart/chart-palette.js +113 -0
- package/dist/components/ui/chart/chart-palette.js.map +1 -0
- package/dist/components/ui/chart/chart.js +176 -129
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/chart-state/chart-state-illustrations.js +310 -0
- package/dist/components/ui/chart-state/chart-state-illustrations.js.map +1 -0
- package/dist/components/ui/chart-state/chart-state.js +48 -34
- package/dist/components/ui/chart-state/chart-state.js.map +1 -1
- package/dist/components/ui/chart-widget/chart-widget.js +87 -0
- package/dist/components/ui/chart-widget/chart-widget.js.map +1 -0
- package/dist/components/ui/composed-chart/composed-chart.js +117 -115
- package/dist/components/ui/composed-chart/composed-chart.js.map +1 -1
- package/dist/components/ui/confidence-cone/confidence-cone.js +166 -158
- package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -1
- package/dist/components/ui/funnel-chart/funnel-chart.js +162 -161
- package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -1
- package/dist/components/ui/histogram/histogram.js +94 -92
- package/dist/components/ui/histogram/histogram.js.map +1 -1
- package/dist/components/ui/input/input.js.map +1 -1
- package/dist/components/ui/label/label.js +2 -9
- package/dist/components/ui/label/label.js.map +1 -1
- package/dist/components/ui/line-chart/line-chart.js +143 -141
- package/dist/components/ui/line-chart/line-chart.js.map +1 -1
- package/dist/components/ui/metric/metric.js +74 -185
- package/dist/components/ui/metric/metric.js.map +1 -1
- package/dist/components/ui/page-content/page-content.js.map +1 -1
- package/dist/components/ui/pie-chart/pie-chart.js +201 -195
- package/dist/components/ui/pie-chart/pie-chart.js.map +1 -1
- package/dist/components/ui/radar-chart/radar-chart.js +133 -131
- package/dist/components/ui/radar-chart/radar-chart.js.map +1 -1
- package/dist/components/ui/radial-bar-chart/radial-bar-chart.js +297 -265
- package/dist/components/ui/radial-bar-chart/radial-bar-chart.js.map +1 -1
- package/dist/components/ui/sankey-chart/sankey-chart.js +123 -101
- package/dist/components/ui/sankey-chart/sankey-chart.js.map +1 -1
- package/dist/components/ui/scatter-chart/scatter-chart.js +76 -74
- package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -1
- package/dist/components/ui/section/section.js +157 -31
- package/dist/components/ui/section/section.js.map +1 -1
- package/dist/components/ui/stepper/stepper.js +24 -24
- package/dist/components/ui/stepper/stepper.js.map +1 -1
- package/dist/components/ui/stepper-item/stepper-item.js +43 -24
- package/dist/components/ui/stepper-item/stepper-item.js.map +1 -1
- package/dist/components/ui/treemap/treemap.js +133 -124
- package/dist/components/ui/treemap/treemap.js.map +1 -1
- package/dist/components/ui/trend-indicator/trend-indicator.js +34 -69
- package/dist/components/ui/trend-indicator/trend-indicator.js.map +1 -1
- package/dist/components/ui/wizard/wizard.js +59 -0
- package/dist/components/ui/wizard/wizard.js.map +1 -0
- package/dist/hooks/use-wizard.js +75 -0
- package/dist/hooks/use-wizard.js.map +1 -0
- package/dist/index.js +502 -497
- package/dist/index.js.map +1 -1
- package/dist/llms/accordion-container.md +181 -0
- package/dist/llms/accordion.md +124 -0
- package/dist/llms/alert.md +225 -0
- package/dist/llms/app-shell-chat.md +415 -0
- package/dist/llms/area-chart.md +355 -0
- package/dist/llms/avatar.md +208 -0
- package/dist/llms/bar-chart.md +406 -0
- package/dist/llms/breadcrumb.md +326 -0
- package/dist/llms/button-group.md +298 -0
- package/dist/llms/button-icon-input.md +142 -0
- package/dist/llms/button-icon-menu.md +209 -0
- package/dist/llms/button-icon.md +128 -0
- package/dist/llms/button-menu.md +172 -0
- package/dist/llms/button.md +185 -0
- package/dist/llms/calendar-panel.md +733 -0
- package/dist/llms/calendar.md +188 -0
- package/dist/llms/card-filter.md +214 -0
- package/dist/llms/card-section.md +293 -0
- package/dist/llms/card.md +447 -0
- package/dist/llms/carousel-dialog.md +156 -0
- package/dist/llms/category-bar.md +193 -0
- package/dist/llms/chart-state.md +190 -0
- package/dist/llms/chart-widget.md +209 -0
- package/dist/llms/chart.md +182 -0
- package/dist/llms/checkbox.md +257 -0
- package/dist/llms/chip.md +195 -0
- package/dist/llms/combobox.md +164 -0
- package/dist/llms/composed-chart.md +508 -0
- package/dist/llms/confidence-cone.md +277 -0
- package/dist/llms/data-table.md +474 -0
- package/dist/llms/date-range-picker.md +272 -0
- package/dist/llms/description-list.md +131 -0
- package/dist/llms/dialog-footer-carousel.md +147 -0
- package/dist/llms/dialog-footer-default.md +142 -0
- package/dist/llms/dialog-root.md +246 -0
- package/dist/llms/dialog-welcome.md +223 -0
- package/dist/llms/dialog.md +403 -0
- package/dist/llms/dropdown-menu.md +193 -0
- package/dist/llms/empty-overlay.md +146 -0
- package/dist/llms/empty.md +156 -0
- package/dist/llms/field.md +185 -0
- package/dist/llms/filter-cards.md +157 -0
- package/dist/llms/filter-chips.md +323 -0
- package/dist/llms/filter-search.md +512 -0
- package/dist/llms/form.md +154 -0
- package/dist/llms/funnel-chart.md +333 -0
- package/dist/llms/grid.md +80 -0
- package/dist/llms/histogram.md +190 -0
- package/dist/llms/input-date-picker.md +203 -0
- package/dist/llms/input-otp.md +173 -0
- package/dist/llms/input-password.md +197 -0
- package/dist/llms/input-search.md +170 -0
- package/dist/llms/input-select.md +278 -0
- package/dist/llms/input-text-area.md +271 -0
- package/dist/llms/input-text.md +192 -0
- package/dist/llms/line-chart.md +369 -0
- package/dist/llms/link.md +209 -0
- package/dist/llms/loading.md +130 -0
- package/dist/llms/meter.md +177 -0
- package/dist/llms/metric.md +204 -0
- package/dist/llms/number-field.md +122 -0
- package/dist/llms/page-content.md +69 -0
- package/dist/llms/page-header.md +182 -0
- package/dist/llms/pagination.md +133 -0
- package/dist/llms/pie-chart.md +307 -0
- package/dist/llms/popover.md +252 -0
- package/dist/llms/progress-circle.md +126 -0
- package/dist/llms/progress.md +111 -0
- package/dist/llms/radar-chart.md +316 -0
- package/dist/llms/radial-bar-chart.md +319 -0
- package/dist/llms/radio.md +255 -0
- package/dist/llms/resizable.md +195 -0
- package/dist/llms/sankey-chart.md +208 -0
- package/dist/llms/scatter-chart.md +239 -0
- package/dist/llms/scroll-area.md +183 -0
- package/dist/llms/section.md +401 -0
- package/dist/llms/select.md +210 -0
- package/dist/llms/separator.md +87 -0
- package/dist/llms/sheet.md +202 -0
- package/dist/llms/sidebar-primary.md +360 -0
- package/dist/llms/sidebar-secondary.md +417 -0
- package/dist/llms/skeleton.md +81 -0
- package/dist/llms/slider.md +97 -0
- package/dist/llms/spinner.md +100 -0
- package/dist/llms/stack.md +80 -0
- package/dist/llms/stepper-item.md +309 -0
- package/dist/llms/stepper.md +251 -0
- package/dist/llms/switch.md +140 -0
- package/dist/llms/table.md +436 -0
- package/dist/llms/tabs.md +197 -0
- package/dist/llms/tag.md +139 -0
- package/dist/llms/timeline.md +361 -0
- package/dist/llms/timer.md +259 -0
- package/dist/llms/toast.md +241 -0
- package/dist/llms/toggle-group.md +121 -0
- package/dist/llms/toolbar.md +453 -0
- package/dist/llms/tooltip.md +164 -0
- package/dist/llms/treemap.md +254 -0
- package/dist/llms/trend-indicator.md +132 -0
- package/dist/llms/widget-placeholder.md +169 -0
- package/dist/llms/wizard.md +412 -0
- package/dist/llms.txt +142 -0
- package/dist/react.js +502 -497
- package/dist/react.js.map +1 -1
- package/dist/src/components/ui/area-chart/area-chart.d.ts +9 -4
- package/dist/src/components/ui/avatar/avatar.d.ts +1 -1
- package/dist/src/components/ui/bar-chart/bar-chart.d.ts +9 -4
- package/dist/src/components/ui/category-bar/category-bar.d.ts +10 -4
- package/dist/src/components/ui/chart/__stories__/palette-control.d.ts +48 -0
- package/dist/src/components/ui/chart/__tests__/chart-palette.test.d.ts +1 -0
- package/dist/src/components/ui/chart/chart-palette.d.ts +128 -0
- package/dist/src/components/ui/chart/chart.d.ts +66 -15
- package/dist/src/components/ui/chart/index.d.ts +4 -2
- package/dist/src/components/ui/chart-state/chart-state-illustrations.d.ts +6 -0
- package/dist/src/components/ui/chart-state/chart-state.d.ts +13 -2
- package/dist/src/components/ui/chart-state/index.d.ts +1 -0
- package/dist/src/components/ui/chart-widget/chart-widget.d.ts +64 -0
- package/dist/src/components/ui/chart-widget/index.d.ts +1 -0
- package/dist/src/components/ui/composed-chart/composed-chart.d.ts +12 -7
- package/dist/src/components/ui/confidence-cone/confidence-cone.d.ts +10 -5
- package/dist/src/components/ui/empty-overlay/empty-overlay.d.ts +1 -1
- package/dist/src/components/ui/funnel-chart/funnel-chart.d.ts +11 -5
- package/dist/src/components/ui/histogram/histogram.d.ts +10 -4
- package/dist/src/components/ui/label/index.d.ts +1 -1
- package/dist/src/components/ui/label/label.d.ts +1 -5
- package/dist/src/components/ui/line-chart/line-chart.d.ts +9 -4
- package/dist/src/components/ui/metric/metric.d.ts +13 -14
- package/dist/src/components/ui/pie-chart/pie-chart.d.ts +17 -8
- package/dist/src/components/ui/radar-chart/radar-chart.d.ts +10 -5
- package/dist/src/components/ui/radial-bar-chart/radial-bar-chart.d.ts +17 -6
- package/dist/src/components/ui/sankey-chart/sankey-chart.d.ts +10 -5
- package/dist/src/components/ui/scatter-chart/scatter-chart.d.ts +10 -5
- package/dist/src/components/ui/section/index.d.ts +1 -1
- package/dist/src/components/ui/section/section.d.ts +75 -6
- package/dist/src/components/ui/stepper-item/stepper-item.d.ts +6 -5
- package/dist/src/components/ui/tag/tag.d.ts +1 -1
- package/dist/src/components/ui/treemap/treemap.d.ts +11 -5
- package/dist/src/components/ui/trend-indicator/trend-indicator.d.ts +3 -7
- package/dist/src/components/ui/wizard/index.d.ts +1 -0
- package/dist/src/components/ui/wizard/wizard.d.ts +6 -0
- package/dist/src/hooks/index.d.ts +1 -0
- package/dist/src/hooks/use-wizard.d.ts +80 -0
- package/dist/src/index.d.ts +2 -3
- package/dist/ui-react.css +1 -1
- package/package.json +9 -3
- package/dist/components/ui/app-shell/app-shell.js +0 -75
- package/dist/components/ui/app-shell/app-shell.js.map +0 -1
- package/dist/components/ui/auth-layout/auth-layout.js +0 -56
- package/dist/components/ui/auth-layout/auth-layout.js.map +0 -1
- package/dist/components/ui/collapsible/collapsible.js +0 -22
- package/dist/components/ui/collapsible/collapsible.js.map +0 -1
- package/dist/src/components/ui/app-shell/app-shell.d.ts +0 -8
- package/dist/src/components/ui/app-shell/index.d.ts +0 -1
- package/dist/src/components/ui/auth-layout/auth-layout.d.ts +0 -6
- package/dist/src/components/ui/auth-layout/index.d.ts +0 -1
- package/dist/src/components/ui/collapsible/collapsible.d.ts +0 -5
- package/dist/src/components/ui/collapsible/index.d.ts +0 -1
- package/dist/src/components/ui/label/label.docs.d.ts +0 -10
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as
|
|
3
|
-
import { RadialBarChart as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { resolveAnimation as
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { jsxs as N, jsx as i, Fragment as me } from "react/jsx-runtime";
|
|
2
|
+
import * as $ from "react";
|
|
3
|
+
import { RadialBarChart as fe, PolarGrid as de, PolarAngleAxis as he, RadialBar as O, Cell as ge, LabelList as pe, Label as ve } from "recharts";
|
|
4
|
+
import { cn as I } from "../../../lib/utils.js";
|
|
5
|
+
import { resolveAnimation as Ce, CHART_LABEL_FONT_SIZE as xe, resolveLabelFillClass as be } from "../chart/chart-format.js";
|
|
6
|
+
import { resolveChartColors as Se, ChartTooltip as Ne, ChartContainer as Te, ChartLegendContent as Be, ChartTooltipContent as F } from "../chart/chart.js";
|
|
7
|
+
import { CHART_DEFAULT_PALETTE as $e } from "../chart/chart-palette.js";
|
|
8
|
+
function V({
|
|
8
9
|
centerLabel: a
|
|
9
10
|
}) {
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
-
|
|
11
|
+
return /* @__PURE__ */ i(
|
|
12
|
+
ve,
|
|
12
13
|
{
|
|
13
|
-
content: ({ viewBox:
|
|
14
|
-
if (!
|
|
15
|
-
const { cx:
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
|
|
14
|
+
content: ({ viewBox: t }) => {
|
|
15
|
+
if (!t || !("cx" in t)) return null;
|
|
16
|
+
const { cx: n = 0, cy: e = 0 } = t, l = a.value != null, o = a.label != null, r = l && o;
|
|
17
|
+
return /* @__PURE__ */ N("g", { children: [
|
|
18
|
+
l && /* @__PURE__ */ i(
|
|
18
19
|
"text",
|
|
19
20
|
{
|
|
20
|
-
x:
|
|
21
|
-
y:
|
|
21
|
+
x: n,
|
|
22
|
+
y: r ? e - 10 : e,
|
|
22
23
|
textAnchor: "middle",
|
|
23
24
|
dominantBaseline: "central",
|
|
24
25
|
className: "fill-foreground text-2xl font-semibold",
|
|
25
26
|
children: a.value
|
|
26
27
|
}
|
|
27
28
|
),
|
|
28
|
-
|
|
29
|
+
o && /* @__PURE__ */ i(
|
|
29
30
|
"text",
|
|
30
31
|
{
|
|
31
|
-
x:
|
|
32
|
-
y:
|
|
32
|
+
x: n,
|
|
33
|
+
y: r ? e + 13 : e,
|
|
33
34
|
textAnchor: "middle",
|
|
34
35
|
dominantBaseline: "central",
|
|
35
36
|
className: "fill-muted-foreground text-sm",
|
|
@@ -41,337 +42,368 @@ function z({
|
|
|
41
42
|
}
|
|
42
43
|
);
|
|
43
44
|
}
|
|
44
|
-
function
|
|
45
|
-
const { format:
|
|
46
|
-
if (
|
|
47
|
-
const
|
|
48
|
-
return
|
|
45
|
+
function ke(a) {
|
|
46
|
+
const { format: t, name: n, value: e, formatter: l } = a;
|
|
47
|
+
if (e == null) return "";
|
|
48
|
+
const o = l ? l(e) : String(e);
|
|
49
|
+
return t === "name-value" && n != null ? `${n}: ${o}` : o;
|
|
49
50
|
}
|
|
50
|
-
const
|
|
51
|
-
function
|
|
52
|
-
const { value:
|
|
53
|
-
let
|
|
54
|
-
const
|
|
55
|
-
for (let
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
key: `seg-${
|
|
59
|
-
degrees:
|
|
51
|
+
const Me = 3;
|
|
52
|
+
function Re(a) {
|
|
53
|
+
const { value: t, domain: n, segments: e, sweep: l, closed: o } = a, r = o ? e : e - 1, s = r > 0 ? Math.min(Math.max(a.gap, 0), l / (2 * r)) : 0, h = (l - s * r) / e, [u, x] = n, m = x - u;
|
|
54
|
+
let S = (m > 0 ? Math.min(Math.max((t - u) / m, 0), 1) : 0) * h * e;
|
|
55
|
+
const f = [];
|
|
56
|
+
for (let g = 0; g < e; g++) {
|
|
57
|
+
const p = Math.min(Math.max(S, 0), h);
|
|
58
|
+
S -= p, f.push({ key: `seg-${g}-value`, degrees: p, kind: "value" }), f.push({
|
|
59
|
+
key: `seg-${g}-track`,
|
|
60
|
+
degrees: h - p,
|
|
60
61
|
kind: "track"
|
|
61
|
-
}),
|
|
62
|
+
}), s > 0 && (o || g < e - 1) && f.push({ key: `seg-${g}-gap`, degrees: s, kind: "gap" });
|
|
62
63
|
}
|
|
63
|
-
return
|
|
64
|
+
return f;
|
|
64
65
|
}
|
|
65
|
-
function
|
|
66
|
-
return a === "gap" ? "transparent" : a === "track" ? "var(--ui-
|
|
66
|
+
function Le(a, t) {
|
|
67
|
+
return a === "gap" ? "transparent" : a === "track" ? "var(--ui-border-on-status-neutral)" : `var(--color-${t})`;
|
|
67
68
|
}
|
|
68
|
-
function
|
|
69
|
+
function Ee(a) {
|
|
69
70
|
var u;
|
|
70
|
-
const { config:
|
|
71
|
+
const { config: t, row: n, nameKey: e, dataKey: l, domainMax: o } = a, r = String(n[e]), s = n[l], h = typeof s == "number" ? s.toLocaleString() : String(s ?? "");
|
|
71
72
|
return {
|
|
72
|
-
colorName:
|
|
73
|
-
label: ((u = r
|
|
73
|
+
colorName: r,
|
|
74
|
+
label: ((u = t[r]) == null ? void 0 : u.label) ?? r,
|
|
74
75
|
// The gauge's scale is the other half of the reading, so a known maximum
|
|
75
76
|
// comes along: "29 / 38", not a bare "29".
|
|
76
|
-
valueText:
|
|
77
|
+
valueText: o == null ? h : `${h} / ${o.toLocaleString()}`
|
|
77
78
|
};
|
|
78
79
|
}
|
|
79
|
-
function
|
|
80
|
+
function Fe({
|
|
80
81
|
active: a,
|
|
81
|
-
payload:
|
|
82
|
-
...
|
|
82
|
+
payload: t,
|
|
83
|
+
...n
|
|
83
84
|
}) {
|
|
84
|
-
const { colorName:
|
|
85
|
-
return /* @__PURE__ */
|
|
86
|
-
|
|
85
|
+
const { colorName: e, label: l, valueText: o } = Ee(n);
|
|
86
|
+
return /* @__PURE__ */ i(
|
|
87
|
+
F,
|
|
87
88
|
{
|
|
88
89
|
active: a,
|
|
89
|
-
payload:
|
|
90
|
+
payload: t == null ? void 0 : t.slice(0, 1),
|
|
90
91
|
hideLabel: !0,
|
|
91
|
-
formatter: () => /* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */
|
|
92
|
+
formatter: () => /* @__PURE__ */ N(me, { children: [
|
|
93
|
+
/* @__PURE__ */ i(
|
|
93
94
|
"div",
|
|
94
95
|
{
|
|
95
96
|
className: "h-2.5 w-2.5 shrink-0 rounded-full",
|
|
96
|
-
style: { backgroundColor: `var(--color-${
|
|
97
|
+
style: { backgroundColor: `var(--color-${e})` }
|
|
97
98
|
}
|
|
98
99
|
),
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ N("div", { className: "flex flex-1 items-center justify-between gap-2 leading-none", children: [
|
|
101
|
+
/* @__PURE__ */ i("span", { className: "text-muted-foreground", children: l }),
|
|
102
|
+
/* @__PURE__ */ i("span", { className: "font-medium tabular-nums text-foreground", children: o })
|
|
102
103
|
] })
|
|
103
104
|
] })
|
|
104
105
|
}
|
|
105
106
|
);
|
|
106
107
|
}
|
|
107
|
-
function
|
|
108
|
-
const
|
|
109
|
-
return
|
|
108
|
+
function Ae(a, t) {
|
|
109
|
+
const n = a == null ? void 0 : a[t];
|
|
110
|
+
return n == null ? "" : String(n);
|
|
110
111
|
}
|
|
111
|
-
function
|
|
112
|
-
var
|
|
113
|
-
const { key:
|
|
114
|
-
if (!
|
|
115
|
-
const
|
|
116
|
-
return typeof
|
|
112
|
+
function Pe(a) {
|
|
113
|
+
var s;
|
|
114
|
+
const { key: t, row: n, isMultiMetric: e, nameKey: l, config: o } = a;
|
|
115
|
+
if (!e) return n == null ? void 0 : n[l];
|
|
116
|
+
const r = (s = o[t]) == null ? void 0 : s.label;
|
|
117
|
+
return typeof r == "string" || typeof r == "number" ? r : t;
|
|
117
118
|
}
|
|
118
|
-
function
|
|
119
|
+
function _e({
|
|
119
120
|
seriesKeys: a,
|
|
120
|
-
seriesData:
|
|
121
|
-
isMultiMetric:
|
|
122
|
-
config:
|
|
123
|
-
nameKey:
|
|
124
|
-
showBackground:
|
|
125
|
-
cornerRadius:
|
|
126
|
-
minPointSize:
|
|
127
|
-
animation:
|
|
121
|
+
seriesData: t,
|
|
122
|
+
isMultiMetric: n,
|
|
123
|
+
config: e,
|
|
124
|
+
nameKey: l,
|
|
125
|
+
showBackground: o,
|
|
126
|
+
cornerRadius: r,
|
|
127
|
+
minPointSize: s,
|
|
128
|
+
animation: h,
|
|
128
129
|
centerLabel: u,
|
|
129
|
-
showLabels:
|
|
130
|
-
labelPosition:
|
|
131
|
-
labelFormat:
|
|
132
|
-
labelFormatter:
|
|
130
|
+
showLabels: x,
|
|
131
|
+
labelPosition: m,
|
|
132
|
+
labelFormat: T,
|
|
133
|
+
labelFormatter: S
|
|
133
134
|
}) {
|
|
134
|
-
return a.map((
|
|
135
|
-
|
|
135
|
+
return a.map((f, g) => /* @__PURE__ */ N(
|
|
136
|
+
O,
|
|
136
137
|
{
|
|
137
|
-
dataKey:
|
|
138
|
-
fill:
|
|
139
|
-
background:
|
|
140
|
-
cornerRadius:
|
|
141
|
-
minPointSize:
|
|
142
|
-
...
|
|
138
|
+
dataKey: f,
|
|
139
|
+
fill: n ? `var(--color-${f})` : void 0,
|
|
140
|
+
background: o ? { fill: "var(--ui-border-on-status-neutral)" } : !1,
|
|
141
|
+
cornerRadius: r,
|
|
142
|
+
minPointSize: s,
|
|
143
|
+
...h,
|
|
143
144
|
children: [
|
|
144
|
-
!
|
|
145
|
+
!n && t.map((p, k) => (
|
|
145
146
|
// Keyed by index, not the name: two arcs could share a nameKey
|
|
146
147
|
// value, which would collide as a React key. Same-named arcs
|
|
147
148
|
// intentionally share a color/config entry via `--color-<name>`.
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ i(ge, { fill: `var(--color-${p[l]})` }, k)
|
|
149
150
|
)),
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
g === 0 && u && /* @__PURE__ */ i(V, { centerLabel: u }),
|
|
152
|
+
x && /* @__PURE__ */ i(
|
|
153
|
+
pe,
|
|
153
154
|
{
|
|
154
|
-
valueAccessor: (
|
|
155
|
-
format:
|
|
156
|
-
name:
|
|
157
|
-
key:
|
|
158
|
-
row:
|
|
159
|
-
isMultiMetric:
|
|
160
|
-
nameKey:
|
|
161
|
-
config:
|
|
155
|
+
valueAccessor: (p) => ke({
|
|
156
|
+
format: T,
|
|
157
|
+
name: Pe({
|
|
158
|
+
key: f,
|
|
159
|
+
row: p.payload,
|
|
160
|
+
isMultiMetric: n,
|
|
161
|
+
nameKey: l,
|
|
162
|
+
config: e
|
|
162
163
|
}),
|
|
163
|
-
value:
|
|
164
|
-
formatter:
|
|
164
|
+
value: p.value,
|
|
165
|
+
formatter: S
|
|
165
166
|
}),
|
|
166
|
-
position:
|
|
167
|
-
className:
|
|
168
|
-
fontSize:
|
|
167
|
+
position: m,
|
|
168
|
+
className: be(m),
|
|
169
|
+
fontSize: xe
|
|
169
170
|
}
|
|
170
171
|
)
|
|
171
172
|
]
|
|
172
173
|
},
|
|
173
|
-
|
|
174
|
+
f
|
|
174
175
|
));
|
|
175
176
|
}
|
|
176
|
-
function
|
|
177
|
+
function ze({
|
|
177
178
|
ringSegments: a,
|
|
178
|
-
row:
|
|
179
|
-
nameKey:
|
|
180
|
-
cornerRadius:
|
|
181
|
-
animation:
|
|
182
|
-
centerLabel:
|
|
179
|
+
row: t,
|
|
180
|
+
nameKey: n,
|
|
181
|
+
cornerRadius: e,
|
|
182
|
+
animation: l,
|
|
183
|
+
centerLabel: o
|
|
183
184
|
}) {
|
|
184
|
-
return a.map((
|
|
185
|
-
|
|
185
|
+
return a.map((r, s) => /* @__PURE__ */ i(
|
|
186
|
+
O,
|
|
186
187
|
{
|
|
187
|
-
dataKey:
|
|
188
|
+
dataKey: r.key,
|
|
188
189
|
stackId: "segments",
|
|
189
|
-
name: String(
|
|
190
|
-
fill:
|
|
191
|
-
cornerRadius:
|
|
192
|
-
...
|
|
193
|
-
children:
|
|
190
|
+
name: String(t[n]),
|
|
191
|
+
fill: Le(r.kind, t[n]),
|
|
192
|
+
cornerRadius: e,
|
|
193
|
+
...l,
|
|
194
|
+
children: s === 0 && o && /* @__PURE__ */ i(V, { centerLabel: o })
|
|
194
195
|
},
|
|
195
|
-
|
|
196
|
+
r.key
|
|
196
197
|
));
|
|
197
198
|
}
|
|
198
|
-
const
|
|
199
|
+
const je = $.forwardRef(
|
|
199
200
|
({
|
|
200
201
|
className: a,
|
|
201
|
-
config:
|
|
202
|
+
config: t,
|
|
203
|
+
palette: n,
|
|
202
204
|
data: e,
|
|
203
|
-
dataKey:
|
|
204
|
-
dataKeys:
|
|
205
|
-
nameKey:
|
|
206
|
-
innerRadius:
|
|
207
|
-
outerRadius:
|
|
208
|
-
startAngle:
|
|
209
|
-
endAngle:
|
|
210
|
-
valueDomain:
|
|
211
|
-
cornerRadius:
|
|
212
|
-
cx:
|
|
213
|
-
cy:
|
|
214
|
-
barSize:
|
|
215
|
-
barGap:
|
|
216
|
-
barCategoryGap:
|
|
217
|
-
minAngle:
|
|
218
|
-
margin:
|
|
219
|
-
segments:
|
|
220
|
-
segmentGap:
|
|
221
|
-
showBackground:
|
|
222
|
-
showPolarGrid:
|
|
223
|
-
centerLabel:
|
|
224
|
-
showTooltip:
|
|
225
|
-
showLegend:
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
205
|
+
dataKey: l,
|
|
206
|
+
dataKeys: o,
|
|
207
|
+
nameKey: r,
|
|
208
|
+
innerRadius: s = 20,
|
|
209
|
+
outerRadius: h = 60,
|
|
210
|
+
startAngle: u = 90,
|
|
211
|
+
endAngle: x = -270,
|
|
212
|
+
valueDomain: m,
|
|
213
|
+
cornerRadius: T = 4,
|
|
214
|
+
cx: S,
|
|
215
|
+
cy: f,
|
|
216
|
+
barSize: g,
|
|
217
|
+
barGap: p,
|
|
218
|
+
barCategoryGap: k,
|
|
219
|
+
minAngle: M,
|
|
220
|
+
margin: U,
|
|
221
|
+
segments: R,
|
|
222
|
+
segmentGap: X = Me,
|
|
223
|
+
showBackground: Y = !0,
|
|
224
|
+
showPolarGrid: Z = !1,
|
|
225
|
+
centerLabel: A,
|
|
226
|
+
showTooltip: q = !0,
|
|
227
|
+
showLegend: B = !0,
|
|
228
|
+
legendValueFormatter: D,
|
|
229
|
+
tooltipContent: J,
|
|
230
|
+
animate: Q,
|
|
231
|
+
animationDuration: W,
|
|
229
232
|
animationBegin: w,
|
|
230
|
-
animationEasing:
|
|
231
|
-
showLabels:
|
|
232
|
-
labelPosition:
|
|
233
|
-
labelFormat:
|
|
234
|
-
labelFormatter:
|
|
235
|
-
...
|
|
236
|
-
},
|
|
237
|
-
const
|
|
238
|
-
animate:
|
|
239
|
-
animationDuration:
|
|
233
|
+
animationEasing: y,
|
|
234
|
+
showLabels: P = !1,
|
|
235
|
+
labelPosition: K,
|
|
236
|
+
labelFormat: ee = "value",
|
|
237
|
+
labelFormatter: re,
|
|
238
|
+
...te
|
|
239
|
+
}, ne) => {
|
|
240
|
+
const _ = Ce({
|
|
241
|
+
animate: Q,
|
|
242
|
+
animationDuration: W,
|
|
240
243
|
animationBegin: w,
|
|
241
|
-
animationEasing:
|
|
242
|
-
}),
|
|
243
|
-
() =>
|
|
244
|
-
[
|
|
245
|
-
),
|
|
246
|
-
value: e[0][
|
|
244
|
+
animationEasing: y
|
|
245
|
+
}), L = K ?? "insideStart", d = !!(o != null && o.length), v = R != null && R > 1 && !d && e.length === 1 && typeof e[0][l] == "number", oe = d ? o : [l], z = $.useMemo(
|
|
246
|
+
() => o != null && o.length ? o : [l],
|
|
247
|
+
[o, l]
|
|
248
|
+
), E = Math.abs(x - u), j = v ? Re({
|
|
249
|
+
value: e[0][l],
|
|
247
250
|
// Without a domain a lone value is its own maximum, so the ring fills.
|
|
248
|
-
domain:
|
|
249
|
-
segments:
|
|
250
|
-
gap:
|
|
251
|
-
sweep:
|
|
252
|
-
closed:
|
|
253
|
-
}) : [],
|
|
254
|
-
...
|
|
255
|
-
fill: `var(--color-${
|
|
256
|
-
})),
|
|
251
|
+
domain: m ?? [0, e[0][l]],
|
|
252
|
+
segments: R,
|
|
253
|
+
gap: X,
|
|
254
|
+
sweep: E,
|
|
255
|
+
closed: E >= 360
|
|
256
|
+
}) : [], G = d ? e : e.map((c) => ({
|
|
257
|
+
...c,
|
|
258
|
+
fill: `var(--color-${c[r]})`
|
|
259
|
+
})), le = v ? [
|
|
257
260
|
{
|
|
258
261
|
...e[0],
|
|
259
|
-
...Object.fromEntries(
|
|
260
|
-
}
|
|
261
|
-
] : P, ne = b === void 0 ? void 0 : u < s ? -b : b, ae = L.useCallback(
|
|
262
|
-
() => /* @__PURE__ */ o(
|
|
263
|
-
j,
|
|
264
|
-
{
|
|
265
|
-
payload: E.map((g) => ({
|
|
266
|
-
value: g,
|
|
267
|
-
dataKey: g,
|
|
268
|
-
color: `var(--color-${g})`,
|
|
269
|
-
type: "rect"
|
|
270
|
-
}))
|
|
271
|
-
}
|
|
272
|
-
),
|
|
273
|
-
[E]
|
|
274
|
-
), le = x ? ae : /* @__PURE__ */ o(j, { nameKey: l }), oe = () => p ? /* @__PURE__ */ o(
|
|
275
|
-
Le,
|
|
276
|
-
{
|
|
277
|
-
config: r,
|
|
278
|
-
row: e[0],
|
|
279
|
-
nameKey: l,
|
|
280
|
-
dataKey: t,
|
|
281
|
-
domainMax: d == null ? void 0 : d[1]
|
|
262
|
+
...Object.fromEntries(j.map((c) => [c.key, c.degrees]))
|
|
282
263
|
}
|
|
283
|
-
|
|
284
|
-
|
|
264
|
+
] : G, ae = M === void 0 ? void 0 : x < u ? -M : M, b = $.useMemo(
|
|
265
|
+
() => B ? Se(t, n ?? $e) : null,
|
|
266
|
+
[B, t, n]
|
|
267
|
+
), ie = $.useMemo(() => b ? d ? z.map((c) => {
|
|
268
|
+
var C;
|
|
269
|
+
return {
|
|
270
|
+
value: c,
|
|
271
|
+
dataKey: c,
|
|
272
|
+
color: ((C = b[c]) == null ? void 0 : C.color) ?? `var(--color-${c})`,
|
|
273
|
+
type: "rect",
|
|
274
|
+
payload: {}
|
|
275
|
+
};
|
|
276
|
+
}) : e.map((c) => {
|
|
277
|
+
var C;
|
|
278
|
+
return {
|
|
279
|
+
value: String(c[r]),
|
|
280
|
+
dataKey: r,
|
|
281
|
+
color: ((C = b[String(c[r])]) == null ? void 0 : C.color) ?? `var(--color-${String(c[r])})`,
|
|
282
|
+
type: "rect",
|
|
283
|
+
payload: c
|
|
284
|
+
};
|
|
285
|
+
}) : [], [b, d, z, e, r]), se = B && !v && !!b, ce = /* @__PURE__ */ N(
|
|
286
|
+
fe,
|
|
285
287
|
{
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
data: re,
|
|
299
|
-
dataKey: x || p ? void 0 : t,
|
|
300
|
-
cx: B,
|
|
301
|
-
cy: v,
|
|
302
|
-
innerRadius: i,
|
|
303
|
-
outerRadius: c,
|
|
304
|
-
startAngle: s,
|
|
305
|
-
endAngle: u,
|
|
306
|
-
barSize: m,
|
|
307
|
-
barGap: f,
|
|
308
|
-
barCategoryGap: h,
|
|
309
|
-
margin: G,
|
|
288
|
+
data: le,
|
|
289
|
+
dataKey: d || v ? void 0 : l,
|
|
290
|
+
cx: S,
|
|
291
|
+
cy: f,
|
|
292
|
+
innerRadius: s,
|
|
293
|
+
outerRadius: h,
|
|
294
|
+
startAngle: u,
|
|
295
|
+
endAngle: x,
|
|
296
|
+
barSize: g,
|
|
297
|
+
barGap: p,
|
|
298
|
+
barCategoryGap: k,
|
|
299
|
+
margin: U ?? { top: 0, right: 0, bottom: 0, left: 0 },
|
|
310
300
|
children: [
|
|
311
|
-
|
|
312
|
-
(
|
|
301
|
+
Z && /* @__PURE__ */ i(de, { gridType: "circle", radialLines: !1 }),
|
|
302
|
+
(m || v) && // The angular scale itself, not chrome: it maps a value onto a
|
|
313
303
|
// fraction of the sweep. Ticks/axis line stay off — the arcs and
|
|
314
304
|
// the optional center readout are the readout. A segmented ring is
|
|
315
305
|
// already measured in degrees, so its scale *is* the sweep.
|
|
316
|
-
/* @__PURE__ */
|
|
317
|
-
|
|
306
|
+
/* @__PURE__ */ i(
|
|
307
|
+
he,
|
|
318
308
|
{
|
|
319
309
|
type: "number",
|
|
320
|
-
domain:
|
|
310
|
+
domain: v ? [0, E] : m,
|
|
321
311
|
tick: !1,
|
|
322
312
|
axisLine: !1
|
|
323
313
|
}
|
|
324
314
|
),
|
|
325
|
-
|
|
326
|
-
|
|
315
|
+
q && /* @__PURE__ */ i(
|
|
316
|
+
Ne,
|
|
327
317
|
{
|
|
328
|
-
cursor:
|
|
329
|
-
content:
|
|
318
|
+
cursor: v ? !1 : void 0,
|
|
319
|
+
content: J ?? (v ? /* @__PURE__ */ i(
|
|
320
|
+
Fe,
|
|
321
|
+
{
|
|
322
|
+
config: t,
|
|
323
|
+
row: e[0],
|
|
324
|
+
nameKey: r,
|
|
325
|
+
dataKey: l,
|
|
326
|
+
domainMax: m == null ? void 0 : m[1]
|
|
327
|
+
}
|
|
328
|
+
) : d ? /* @__PURE__ */ i(
|
|
329
|
+
F,
|
|
330
|
+
{
|
|
331
|
+
labelFormatter: (c, C) => {
|
|
332
|
+
var H;
|
|
333
|
+
return Ae(
|
|
334
|
+
(H = C == null ? void 0 : C[0]) == null ? void 0 : H.payload,
|
|
335
|
+
r
|
|
336
|
+
);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
) : /* @__PURE__ */ i(F, { nameKey: r, hideLabel: !0 }))
|
|
330
340
|
}
|
|
331
341
|
),
|
|
332
|
-
|
|
333
|
-
|
|
342
|
+
v ? /* @__PURE__ */ i(
|
|
343
|
+
ze,
|
|
334
344
|
{
|
|
335
|
-
ringSegments:
|
|
345
|
+
ringSegments: j,
|
|
336
346
|
row: e[0],
|
|
337
|
-
nameKey:
|
|
338
|
-
cornerRadius:
|
|
339
|
-
animation:
|
|
340
|
-
centerLabel:
|
|
347
|
+
nameKey: r,
|
|
348
|
+
cornerRadius: T,
|
|
349
|
+
animation: _,
|
|
350
|
+
centerLabel: A
|
|
341
351
|
}
|
|
342
|
-
) : /* @__PURE__ */
|
|
343
|
-
|
|
352
|
+
) : /* @__PURE__ */ i(
|
|
353
|
+
_e,
|
|
344
354
|
{
|
|
345
|
-
seriesKeys:
|
|
346
|
-
seriesData:
|
|
347
|
-
isMultiMetric:
|
|
348
|
-
config:
|
|
349
|
-
nameKey:
|
|
350
|
-
showBackground:
|
|
351
|
-
cornerRadius:
|
|
352
|
-
minPointSize:
|
|
353
|
-
animation:
|
|
354
|
-
centerLabel:
|
|
355
|
-
showLabels:
|
|
356
|
-
labelPosition:
|
|
357
|
-
labelFormat:
|
|
358
|
-
labelFormatter:
|
|
355
|
+
seriesKeys: oe,
|
|
356
|
+
seriesData: G,
|
|
357
|
+
isMultiMetric: d,
|
|
358
|
+
config: t,
|
|
359
|
+
nameKey: r,
|
|
360
|
+
showBackground: Y,
|
|
361
|
+
cornerRadius: T,
|
|
362
|
+
minPointSize: ae,
|
|
363
|
+
animation: _,
|
|
364
|
+
centerLabel: A,
|
|
365
|
+
showLabels: P,
|
|
366
|
+
labelPosition: L,
|
|
367
|
+
labelFormat: ee,
|
|
368
|
+
labelFormatter: re
|
|
359
369
|
}
|
|
360
|
-
)
|
|
361
|
-
|
|
370
|
+
)
|
|
371
|
+
]
|
|
372
|
+
}
|
|
373
|
+
), ue = P && (L === "outside" || L === "end") ? "size-[200px]" : "size-[120px]";
|
|
374
|
+
return /* @__PURE__ */ N(
|
|
375
|
+
"div",
|
|
376
|
+
{
|
|
377
|
+
ref: ne,
|
|
378
|
+
className: I("flex flex-row items-center gap-4", !se && "justify-center", a),
|
|
379
|
+
...te,
|
|
380
|
+
children: [
|
|
381
|
+
/* @__PURE__ */ i("div", { className: I(ue, "shrink-0"), children: /* @__PURE__ */ i(Te, { config: t, palette: n, className: "size-full", children: ce }) }),
|
|
382
|
+
B && !v && b && /* @__PURE__ */ i(
|
|
383
|
+
Be,
|
|
384
|
+
{
|
|
385
|
+
variant: "list",
|
|
386
|
+
payload: ie,
|
|
387
|
+
config: b,
|
|
388
|
+
nameKey: d ? void 0 : r,
|
|
389
|
+
valueKey: d ? void 0 : l,
|
|
390
|
+
valueFormatter: d ? void 0 : D,
|
|
391
|
+
className: "min-w-0 flex-1"
|
|
392
|
+
}
|
|
393
|
+
)
|
|
362
394
|
]
|
|
363
395
|
}
|
|
364
|
-
)
|
|
396
|
+
);
|
|
365
397
|
}
|
|
366
398
|
);
|
|
367
|
-
|
|
399
|
+
je.displayName = "RadialBarChart";
|
|
368
400
|
export {
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
401
|
+
je as RadialBarChart,
|
|
402
|
+
Fe as RadialBarChartSegmentedTooltipContent,
|
|
403
|
+
Ae as radialBarChartBandName,
|
|
404
|
+
ke as radialBarChartLabelText,
|
|
405
|
+
Le as radialBarChartSegmentFill,
|
|
406
|
+
Ee as radialBarChartSegmentedReading,
|
|
407
|
+
Re as radialBarChartSegments
|
|
376
408
|
};
|
|
377
409
|
//# sourceMappingURL=radial-bar-chart.js.map
|