@craftzbay/ui 0.11.3 → 0.11.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.
- package/dist-lib/_virtual/_rolldown/runtime.js +11 -0
- package/dist-lib/components/ui/Accordion.js +42 -67
- package/dist-lib/components/ui/Accordion.js.map +1 -1
- package/dist-lib/components/ui/Alert.js +71 -77
- package/dist-lib/components/ui/Alert.js.map +1 -1
- package/dist-lib/components/ui/Avatar.js +67 -92
- package/dist-lib/components/ui/Avatar.js.map +1 -1
- package/dist-lib/components/ui/Badge.js +119 -74
- package/dist-lib/components/ui/Badge.js.map +1 -1
- package/dist-lib/components/ui/Breadcrumbs.js +62 -50
- package/dist-lib/components/ui/Breadcrumbs.js.map +1 -1
- package/dist-lib/components/ui/Button.js +129 -131
- package/dist-lib/components/ui/Button.js.map +1 -1
- package/dist-lib/components/ui/Calendar.d.ts +1 -1
- package/dist-lib/components/ui/Calendar.js +99 -136
- package/dist-lib/components/ui/Calendar.js.map +1 -1
- package/dist-lib/components/ui/Card.js +88 -94
- package/dist-lib/components/ui/Card.js.map +1 -1
- package/dist-lib/components/ui/Carousel.js +125 -170
- package/dist-lib/components/ui/Carousel.js.map +1 -1
- package/dist-lib/components/ui/Chart.d.ts +3 -3
- package/dist-lib/components/ui/Chart.js +435 -464
- package/dist-lib/components/ui/Chart.js.map +1 -1
- package/dist-lib/components/ui/Checkbox.js +60 -69
- package/dist-lib/components/ui/Checkbox.js.map +1 -1
- package/dist-lib/components/ui/Combobox.js +179 -192
- package/dist-lib/components/ui/Combobox.js.map +1 -1
- package/dist-lib/components/ui/CommandPalette.d.ts +2 -2
- package/dist-lib/components/ui/CommandPalette.js +106 -167
- package/dist-lib/components/ui/CommandPalette.js.map +1 -1
- package/dist-lib/components/ui/ContextMenu.d.ts +1 -1
- package/dist-lib/components/ui/ContextMenu.js +89 -154
- package/dist-lib/components/ui/ContextMenu.js.map +1 -1
- package/dist-lib/components/ui/DataGrid.d.ts +1 -1
- package/dist-lib/components/ui/DataGrid.js +99 -96
- package/dist-lib/components/ui/DataGrid.js.map +1 -1
- package/dist-lib/components/ui/DatePicker.js +151 -188
- package/dist-lib/components/ui/DatePicker.js.map +1 -1
- package/dist-lib/components/ui/DesignSystemProvider.d.ts +1 -1
- package/dist-lib/components/ui/DesignSystemProvider.js +120 -130
- package/dist-lib/components/ui/DesignSystemProvider.js.map +1 -1
- package/dist-lib/components/ui/Dialog.d.ts +3 -3
- package/dist-lib/components/ui/Dialog.js +108 -156
- package/dist-lib/components/ui/Dialog.js.map +1 -1
- package/dist-lib/components/ui/Drawer.d.ts +3 -3
- package/dist-lib/components/ui/Drawer.js +90 -124
- package/dist-lib/components/ui/Drawer.js.map +1 -1
- package/dist-lib/components/ui/DropdownMenu.d.ts +1 -1
- package/dist-lib/components/ui/DropdownMenu.js +92 -158
- package/dist-lib/components/ui/DropdownMenu.js.map +1 -1
- package/dist-lib/components/ui/EmptyState.js +31 -44
- package/dist-lib/components/ui/EmptyState.js.map +1 -1
- package/dist-lib/components/ui/ErrorState.js +57 -67
- package/dist-lib/components/ui/ErrorState.js.map +1 -1
- package/dist-lib/components/ui/FileUpload.js +113 -107
- package/dist-lib/components/ui/FileUpload.js.map +1 -1
- package/dist-lib/components/ui/Form.d.ts +6 -4
- package/dist-lib/components/ui/Form.js +117 -122
- package/dist-lib/components/ui/Form.js.map +1 -1
- package/dist-lib/components/ui/Icon.d.ts +1 -1
- package/dist-lib/components/ui/Icon.js +30 -29
- package/dist-lib/components/ui/Icon.js.map +1 -1
- package/dist-lib/components/ui/IconButton.js +61 -63
- package/dist-lib/components/ui/IconButton.js.map +1 -1
- package/dist-lib/components/ui/Input.js +133 -156
- package/dist-lib/components/ui/Input.js.map +1 -1
- package/dist-lib/components/ui/Kbd.js +14 -21
- package/dist-lib/components/ui/Kbd.js.map +1 -1
- package/dist-lib/components/ui/MultiSelect.js +176 -208
- package/dist-lib/components/ui/MultiSelect.js.map +1 -1
- package/dist-lib/components/ui/Pagination.js +152 -149
- package/dist-lib/components/ui/Pagination.js.map +1 -1
- package/dist-lib/components/ui/Popover.js +18 -33
- package/dist-lib/components/ui/Popover.js.map +1 -1
- package/dist-lib/components/ui/Progress.js +77 -99
- package/dist-lib/components/ui/Progress.js.map +1 -1
- package/dist-lib/components/ui/RadioGroup.js +51 -80
- package/dist-lib/components/ui/RadioGroup.js.map +1 -1
- package/dist-lib/components/ui/RelativeTime.js +22 -29
- package/dist-lib/components/ui/RelativeTime.js.map +1 -1
- package/dist-lib/components/ui/ScrollArea.js +39 -58
- package/dist-lib/components/ui/ScrollArea.js.map +1 -1
- package/dist-lib/components/ui/Select.js +108 -131
- package/dist-lib/components/ui/Select.js.map +1 -1
- package/dist-lib/components/ui/Separator.js +18 -24
- package/dist-lib/components/ui/Separator.js.map +1 -1
- package/dist-lib/components/ui/Sheet.d.ts +2 -2
- package/dist-lib/components/ui/Sheet.js +77 -129
- package/dist-lib/components/ui/Sheet.js.map +1 -1
- package/dist-lib/components/ui/Sidebar.d.ts +1 -1
- package/dist-lib/components/ui/Sidebar.js +168 -207
- package/dist-lib/components/ui/Sidebar.js.map +1 -1
- package/dist-lib/components/ui/Skeleton.js +17 -27
- package/dist-lib/components/ui/Skeleton.js.map +1 -1
- package/dist-lib/components/ui/Slider.js +45 -62
- package/dist-lib/components/ui/Slider.js.map +1 -1
- package/dist-lib/components/ui/Snackbar.js +75 -55
- package/dist-lib/components/ui/Snackbar.js.map +1 -1
- package/dist-lib/components/ui/Spinner.js +45 -52
- package/dist-lib/components/ui/Spinner.js.map +1 -1
- package/dist-lib/components/ui/Stepper.js +56 -108
- package/dist-lib/components/ui/Stepper.js.map +1 -1
- package/dist-lib/components/ui/Switch.js +46 -79
- package/dist-lib/components/ui/Switch.js.map +1 -1
- package/dist-lib/components/ui/Table.js +108 -169
- package/dist-lib/components/ui/Table.js.map +1 -1
- package/dist-lib/components/ui/Tabs.js +57 -88
- package/dist-lib/components/ui/Tabs.js.map +1 -1
- package/dist-lib/components/ui/TagInput.js +76 -109
- package/dist-lib/components/ui/TagInput.js.map +1 -1
- package/dist-lib/components/ui/Textarea.js +74 -86
- package/dist-lib/components/ui/Textarea.js.map +1 -1
- package/dist-lib/components/ui/Timeline.d.ts +3 -3
- package/dist-lib/components/ui/Timeline.js +61 -49
- package/dist-lib/components/ui/Timeline.js.map +1 -1
- package/dist-lib/components/ui/Toast.d.ts +1 -1
- package/dist-lib/components/ui/Toast.js +136 -150
- package/dist-lib/components/ui/Toast.js.map +1 -1
- package/dist-lib/components/ui/Tooltip.d.ts +2 -2
- package/dist-lib/components/ui/Tooltip.js +35 -56
- package/dist-lib/components/ui/Tooltip.js.map +1 -1
- package/dist-lib/components/ui/TopNav.js +46 -66
- package/dist-lib/components/ui/TopNav.js.map +1 -1
- package/dist-lib/components/ui/Tree.js +134 -168
- package/dist-lib/components/ui/Tree.js.map +1 -1
- package/dist-lib/hooks/use-debounce.js +27 -33
- package/dist-lib/hooks/use-debounce.js.map +1 -1
- package/dist-lib/hooks/use-delayed-loading.js +19 -18
- package/dist-lib/hooks/use-delayed-loading.js.map +1 -1
- package/dist-lib/hooks/use-field-ids.js +14 -16
- package/dist-lib/hooks/use-field-ids.js.map +1 -1
- package/dist-lib/hooks/use-media-query.js +15 -19
- package/dist-lib/hooks/use-media-query.js.map +1 -1
- package/dist-lib/hooks/use-modifier-key.js +20 -15
- package/dist-lib/hooks/use-modifier-key.js.map +1 -1
- package/dist-lib/hooks/use-strings.js +10 -10
- package/dist-lib/hooks/use-strings.js.map +1 -1
- package/dist-lib/hooks/use-toast.js +73 -62
- package/dist-lib/hooks/use-toast.js.map +1 -1
- package/dist-lib/icon.js +2 -6
- package/dist-lib/icons/index.js +166 -163
- package/dist-lib/icons/index.js.map +1 -1
- package/dist-lib/illustrations/index.d.ts +7 -7
- package/dist-lib/illustrations/index.js +255 -106
- package/dist-lib/illustrations/index.js.map +1 -1
- package/dist-lib/index.js +69 -291
- package/dist-lib/lib/cva.js +2 -0
- package/dist-lib/lib/format.js +71 -87
- package/dist-lib/lib/format.js.map +1 -1
- package/dist-lib/lib/return-focus.js +11 -11
- package/dist-lib/lib/return-focus.js.map +1 -1
- package/dist-lib/lib/strings.js +167 -135
- package/dist-lib/lib/strings.js.map +1 -1
- package/dist-lib/lib/strings.mn.js +150 -113
- package/dist-lib/lib/strings.mn.js.map +1 -1
- package/dist-lib/lib/utils.js +9 -9
- package/dist-lib/lib/utils.js.map +1 -1
- package/dist-lib/styles.css +3 -1
- package/package.json +50 -50
- package/dist-lib/__tests__/helpers/color.d.ts +0 -9
- package/dist-lib/__tests__/helpers/theme.d.ts +0 -18
- package/dist-lib/icon.js.map +0 -1
- package/dist-lib/index.js.map +0 -1
|
@@ -1,487 +1,458 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { formatString as t } from "../../lib/strings.js";
|
|
4
|
+
import { useStrings as n } from "../../hooks/use-strings.js";
|
|
5
|
+
import { Skeleton as r } from "./Skeleton.js";
|
|
6
|
+
import { useCallback as i, useEffect as a, useId as o, useLayoutEffect as s, useRef as c, useState as l } from "react";
|
|
7
|
+
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/ui/Chart.tsx
|
|
9
|
+
var p = {
|
|
10
|
+
summary: ({ name: e, count: t, min: n, max: r, lastX: i, lastY: a }) => `${e}: ${t} points, min ${n}, max ${r}, last ${i}: ${a}`,
|
|
11
|
+
point: (e, t, n) => `${e ? `${e} — ` : ""}${t}: ${n}`,
|
|
12
|
+
series: (e, t) => `${e}, ${t} points. Use arrow keys to move between points.`
|
|
12
13
|
};
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
function m(e) {
|
|
15
|
+
return {
|
|
16
|
+
summary: ({ name: n, count: r, min: i, max: a, lastX: o, lastY: s }) => t(e.summary, {
|
|
17
|
+
name: n,
|
|
18
|
+
count: r,
|
|
19
|
+
min: i,
|
|
20
|
+
max: a,
|
|
21
|
+
x: o,
|
|
22
|
+
y: s
|
|
23
|
+
}),
|
|
24
|
+
point: (n, r, i) => (n ? `${n} — ` : "") + t(e.point, {
|
|
25
|
+
x: r,
|
|
26
|
+
y: i
|
|
27
|
+
}),
|
|
28
|
+
series: (n, r) => t(e.seriesNav, {
|
|
29
|
+
name: n,
|
|
30
|
+
count: r
|
|
31
|
+
})
|
|
32
|
+
};
|
|
19
33
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
],
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
var h = [
|
|
35
|
+
"var(--chart-1)",
|
|
36
|
+
"var(--chart-2)",
|
|
37
|
+
"var(--chart-3)",
|
|
38
|
+
"var(--chart-4)",
|
|
39
|
+
"var(--chart-5)",
|
|
40
|
+
"var(--chart-6)"
|
|
41
|
+
], g = 600, _ = 6;
|
|
42
|
+
function v() {
|
|
43
|
+
let e = c(null), [t, n] = l(0);
|
|
44
|
+
return (typeof window > "u" ? a : s)(() => {
|
|
45
|
+
let t = e.current;
|
|
46
|
+
if (!t) return;
|
|
47
|
+
let r = () => n(t.clientWidth);
|
|
48
|
+
if (r(), typeof ResizeObserver > "u") return;
|
|
49
|
+
let i = new ResizeObserver(r);
|
|
50
|
+
return i.observe(t), () => i.disconnect();
|
|
51
|
+
}, []), {
|
|
52
|
+
ref: e,
|
|
53
|
+
width: t || g
|
|
54
|
+
};
|
|
38
55
|
}
|
|
39
|
-
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
|
|
56
|
+
var y = 5;
|
|
57
|
+
function b(e) {
|
|
58
|
+
let t = Math.abs(e), n = (e, t) => `${(Math.round(e * 10) / 10).toString()}${t}`;
|
|
59
|
+
return t >= 1e9 ? n(e / 1e9, "B") : t >= 1e6 ? n(e / 1e6, "M") : t >= 1e3 ? n(e / 1e3, "K") : Number.isInteger(e) ? String(e) : (Math.round(e * 100) / 100).toString();
|
|
43
60
|
}
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
61
|
+
function x(e) {
|
|
62
|
+
if (e <= 0) return 1;
|
|
63
|
+
let t = 10 ** Math.floor(Math.log10(e)), n = e / t;
|
|
64
|
+
return (n <= 1 ? 1 : n <= 2 ? 2 : n <= 2.5 ? 2.5 : n <= 5 ? 5 : 10) * t;
|
|
48
65
|
}
|
|
49
|
-
function
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
66
|
+
function S(e, t, n = y) {
|
|
67
|
+
t === e && (t = e + 1);
|
|
68
|
+
let r = x((t - e) / Math.max(1, n - 1)), i = Math.floor(e / r) * r, a = Math.ceil(t / r) * r, o = [];
|
|
69
|
+
for (let e = a; e >= i - r / 2; e -= r) o.push(Number(e.toFixed(10)));
|
|
70
|
+
return {
|
|
71
|
+
min: i,
|
|
72
|
+
max: a,
|
|
73
|
+
ticks: o
|
|
74
|
+
};
|
|
54
75
|
}
|
|
55
|
-
function
|
|
56
|
-
|
|
76
|
+
function C(e, t) {
|
|
77
|
+
return t && t.length ? t : [{ data: e ?? [] }];
|
|
57
78
|
}
|
|
58
|
-
|
|
59
|
-
function
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
79
|
+
var w = (e) => typeof e == "number";
|
|
80
|
+
function T(e, t = !0) {
|
|
81
|
+
let n = e.flatMap((e) => e.data.map((e) => e.y).filter(w)), r = t ? Math.min(0, ...n) : Math.min(...n), i = Math.max(...n, t ? 1 : -Infinity), { min: a, max: o, ticks: s } = S(Number.isFinite(r) ? r : 0, i === -Infinity ? 1 : i);
|
|
82
|
+
return {
|
|
83
|
+
min: a,
|
|
84
|
+
max: o,
|
|
85
|
+
range: o - a || 1,
|
|
86
|
+
ticks: s
|
|
87
|
+
};
|
|
65
88
|
}
|
|
66
|
-
function
|
|
67
|
-
|
|
68
|
-
|
|
89
|
+
function E(e, t, n, r, i) {
|
|
90
|
+
let a = t - 12, o = n - 12;
|
|
91
|
+
return {
|
|
92
|
+
sx: (t) => e <= 1 ? _ + a / 2 : _ + t / (e - 1) * a,
|
|
93
|
+
sy: (e) => _ + o - (e - r) / i * o
|
|
94
|
+
};
|
|
69
95
|
}
|
|
70
|
-
function
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
96
|
+
function D(e) {
|
|
97
|
+
if (e.length === 0) return "";
|
|
98
|
+
if (e.length < 3) return e.map((e, t) => `${t ? "L" : "M"}${e[0]},${e[1]}`).join(" ");
|
|
99
|
+
let t = `M${e[0][0]},${e[0][1]}`;
|
|
100
|
+
for (let n = 0; n < e.length - 1; n++) {
|
|
101
|
+
let r = e[n - 1] ?? e[n], i = e[n], a = e[n + 1], o = e[n + 2] ?? a, s = i[0] + (a[0] - r[0]) / 6, c = i[1] + (a[1] - r[1]) / 6, l = a[0] - (o[0] - i[0]) / 6, u = a[1] - (o[1] - i[1]) / 6;
|
|
102
|
+
t += ` C${s.toFixed(1)},${c.toFixed(1)} ${l.toFixed(1)},${u.toFixed(1)} ${a[0].toFixed(1)},${a[1].toFixed(1)}`;
|
|
103
|
+
}
|
|
104
|
+
return t;
|
|
79
105
|
}
|
|
80
|
-
function
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}), o.length && t.push(o), t;
|
|
106
|
+
function O(e, t, n) {
|
|
107
|
+
let r = [], i = [];
|
|
108
|
+
return e.forEach((e, a) => {
|
|
109
|
+
w(e.y) ? i.push([t(a), n(e.y)]) : i.length && (r.push(i), i = []);
|
|
110
|
+
}), i.length && r.push(i), r;
|
|
86
111
|
}
|
|
87
|
-
|
|
88
|
-
function
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
112
|
+
var k = (e, n, r) => e.name ?? t(r.series, { n: n + 1 });
|
|
113
|
+
function A(e, t, n) {
|
|
114
|
+
return e.map((e, r) => {
|
|
115
|
+
let i = e.data.map((e) => e.y).filter(w), a = k(e, r, t);
|
|
116
|
+
if (!i.length) return `${a}: ${t.noData}`;
|
|
117
|
+
let o = [...e.data].reverse().find((e) => w(e.y));
|
|
118
|
+
return n.summary({
|
|
119
|
+
name: a,
|
|
120
|
+
count: i.length,
|
|
121
|
+
min: Math.min(...i),
|
|
122
|
+
max: Math.max(...i),
|
|
123
|
+
lastX: o?.x,
|
|
124
|
+
lastY: o?.y ?? void 0
|
|
125
|
+
});
|
|
126
|
+
}).join(". ");
|
|
102
127
|
}
|
|
103
|
-
function
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}) });
|
|
128
|
+
function j({ width: e, height: t, lines: n }) {
|
|
129
|
+
let r = t - 12, i = Math.max(1, n);
|
|
130
|
+
return /* @__PURE__ */ d("g", {
|
|
131
|
+
"aria-hidden": !0,
|
|
132
|
+
children: Array.from({ length: i + 1 }, (t, n) => {
|
|
133
|
+
let a = _ + n / i * r;
|
|
134
|
+
return /* @__PURE__ */ d("line", {
|
|
135
|
+
x1: 0,
|
|
136
|
+
x2: e,
|
|
137
|
+
y1: a,
|
|
138
|
+
y2: a,
|
|
139
|
+
stroke: "var(--color-border)",
|
|
140
|
+
strokeWidth: 1,
|
|
141
|
+
opacity: .6
|
|
142
|
+
}, n);
|
|
143
|
+
})
|
|
144
|
+
});
|
|
121
145
|
}
|
|
122
|
-
function
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
146
|
+
function M({ ticks: e }) {
|
|
147
|
+
return /* @__PURE__ */ d("div", {
|
|
148
|
+
"aria-hidden": !0,
|
|
149
|
+
className: "tabular text-foreground-subtle pointer-events-none flex shrink-0 flex-col justify-between py-1.5 pr-1.5 text-right text-xs",
|
|
150
|
+
children: e.map((e, t) => /* @__PURE__ */ d("span", {
|
|
151
|
+
className: "leading-none",
|
|
152
|
+
children: b(e)
|
|
153
|
+
}, t))
|
|
154
|
+
});
|
|
131
155
|
}
|
|
132
|
-
function
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
156
|
+
function N({ first: e, last: t }) {
|
|
157
|
+
return e ? /* @__PURE__ */ f("div", {
|
|
158
|
+
"aria-hidden": !0,
|
|
159
|
+
className: "text-foreground-subtle flex justify-between text-xs",
|
|
160
|
+
children: [/* @__PURE__ */ d("span", { children: String(e.x) }), t && t !== e && /* @__PURE__ */ d("span", { children: String(t.x) })]
|
|
161
|
+
}) : null;
|
|
137
162
|
}
|
|
138
|
-
function
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
})
|
|
172
|
-
] }, l)) })
|
|
173
|
-
]
|
|
174
|
-
}
|
|
175
|
-
);
|
|
176
|
-
return t ? c : /* @__PURE__ */ s("div", { className: "sr-only", children: c });
|
|
163
|
+
function P({ id: n, all: r, name: i, visible: a, t: o }) {
|
|
164
|
+
let s = Math.max(...r.map((e) => e.data.length)), c = r.find((e) => e.data.length === s)?.data ?? [], l = /* @__PURE__ */ f("table", {
|
|
165
|
+
id: n,
|
|
166
|
+
"data-chart-table": !0,
|
|
167
|
+
className: e(a && "tabular text-foreground-muted mt-2 w-full text-left text-xs"),
|
|
168
|
+
children: [
|
|
169
|
+
/* @__PURE__ */ d("caption", {
|
|
170
|
+
className: e(a && "text-foreground-subtle pb-1 text-left"),
|
|
171
|
+
children: t(o.tableCaption, { name: i ?? "" }).trim()
|
|
172
|
+
}),
|
|
173
|
+
/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ f("tr", { children: [/* @__PURE__ */ d("th", {
|
|
174
|
+
scope: "col",
|
|
175
|
+
className: e(a && "border-border border-b py-1 pr-3 font-medium"),
|
|
176
|
+
children: "x"
|
|
177
|
+
}), r.map((t, n) => /* @__PURE__ */ d("th", {
|
|
178
|
+
scope: "col",
|
|
179
|
+
className: e(a && "border-border border-b py-1 pr-3 font-medium"),
|
|
180
|
+
children: k(t, n, o)
|
|
181
|
+
}, n))] }) }),
|
|
182
|
+
/* @__PURE__ */ d("tbody", { children: c.map((t, n) => /* @__PURE__ */ f("tr", { children: [/* @__PURE__ */ d("th", {
|
|
183
|
+
scope: "row",
|
|
184
|
+
className: e(a && "py-0.5 pr-3 font-normal"),
|
|
185
|
+
children: String(t.x)
|
|
186
|
+
}), r.map((t, r) => /* @__PURE__ */ d("td", {
|
|
187
|
+
className: e(a && "py-0.5 pr-3"),
|
|
188
|
+
children: w(t.data[n]?.y) ? String(t.data[n]?.y) : "—"
|
|
189
|
+
}, r))] }, n)) })
|
|
190
|
+
]
|
|
191
|
+
});
|
|
192
|
+
return a ? l : /* @__PURE__ */ d("div", {
|
|
193
|
+
className: "sr-only",
|
|
194
|
+
children: l
|
|
195
|
+
});
|
|
177
196
|
}
|
|
178
|
-
function
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
197
|
+
function F({ caption: t, ariaLabel: i, title: a, all: s, height: c, width: p, className: m, showAxis: h, ticks: g, xFirst: _, xLast: y, tableFallback: b, showTableToggle: x, state: S, labels: C, children: w }) {
|
|
198
|
+
let T = n().chart, E = o().replace(/:/g, ""), D = `chart-cap-${E}`, O = `chart-title-${E}`, k = `chart-desc-${E}`, j = `chart-table-${E}`, F = i ?? a, [L, R] = l(!1), { ref: z, width: B } = v(), V = I(s, T, C);
|
|
199
|
+
process.env.NODE_ENV !== "production" && !F && !t && console.warn("[craftzbay/ui] Chart: provide `caption`, `aria-label`, or `title` so the chart has an accessible name.");
|
|
200
|
+
let H = (b || L) && !S, U = S === "loading" ? /* @__PURE__ */ f("div", {
|
|
201
|
+
role: "status",
|
|
202
|
+
"aria-label": T.loading,
|
|
203
|
+
style: { height: c },
|
|
204
|
+
className: "w-full",
|
|
205
|
+
children: [/* @__PURE__ */ d(r, {
|
|
206
|
+
style: { height: c },
|
|
207
|
+
className: "w-full"
|
|
208
|
+
}), /* @__PURE__ */ d("span", {
|
|
209
|
+
className: "sr-only",
|
|
210
|
+
children: T.loading
|
|
211
|
+
})]
|
|
212
|
+
}) : S ? /* @__PURE__ */ d("div", {
|
|
213
|
+
role: S === "error" ? "alert" : "status",
|
|
214
|
+
style: { height: c },
|
|
215
|
+
className: "text-foreground-subtle flex w-full items-center justify-center text-sm",
|
|
216
|
+
children: S === "error" ? T.error : T.empty
|
|
217
|
+
}) : null;
|
|
218
|
+
return /* @__PURE__ */ f("figure", {
|
|
219
|
+
className: e("flex flex-col gap-1.5", m),
|
|
220
|
+
style: { width: p },
|
|
221
|
+
children: [
|
|
222
|
+
t && /* @__PURE__ */ d("figcaption", {
|
|
223
|
+
id: D,
|
|
224
|
+
className: "text-foreground-muted text-xs",
|
|
225
|
+
children: t
|
|
226
|
+
}),
|
|
227
|
+
U ?? /* @__PURE__ */ f(u, { children: [
|
|
228
|
+
/* @__PURE__ */ f("div", {
|
|
229
|
+
className: "flex",
|
|
230
|
+
children: [h && /* @__PURE__ */ d(M, { ticks: g }), /* @__PURE__ */ d("div", {
|
|
231
|
+
ref: z,
|
|
232
|
+
className: "min-w-0 flex-1",
|
|
233
|
+
children: /* @__PURE__ */ f("svg", {
|
|
234
|
+
viewBox: `0 0 ${B} ${c}`,
|
|
235
|
+
width: B,
|
|
236
|
+
height: c,
|
|
237
|
+
role: "group",
|
|
238
|
+
"aria-labelledby": t ? D : F ? O : void 0,
|
|
239
|
+
"aria-describedby": k,
|
|
240
|
+
className: "block max-w-full overflow-visible",
|
|
241
|
+
children: [
|
|
242
|
+
F && /* @__PURE__ */ d("title", {
|
|
243
|
+
id: O,
|
|
244
|
+
children: F
|
|
245
|
+
}),
|
|
246
|
+
/* @__PURE__ */ d("desc", {
|
|
247
|
+
id: k,
|
|
248
|
+
children: A(s, T, C)
|
|
249
|
+
}),
|
|
250
|
+
w({
|
|
251
|
+
width: B,
|
|
252
|
+
...V
|
|
253
|
+
})
|
|
254
|
+
]
|
|
255
|
+
})
|
|
256
|
+
})]
|
|
257
|
+
}),
|
|
258
|
+
h && /* @__PURE__ */ d(N, {
|
|
259
|
+
first: _,
|
|
260
|
+
last: y
|
|
261
|
+
}),
|
|
262
|
+
/* @__PURE__ */ d("span", {
|
|
263
|
+
className: "sr-only",
|
|
264
|
+
"aria-live": "polite",
|
|
265
|
+
"aria-atomic": "true",
|
|
266
|
+
children: V.announcement
|
|
267
|
+
})
|
|
268
|
+
] }),
|
|
269
|
+
x && !S && /* @__PURE__ */ d("button", {
|
|
270
|
+
type: "button",
|
|
271
|
+
onClick: () => R((e) => !e),
|
|
272
|
+
"aria-expanded": L,
|
|
273
|
+
"aria-controls": H ? j : void 0,
|
|
274
|
+
className: e("text-foreground-subtle hover:text-foreground self-start rounded-sm text-xs underline-offset-2 outline-none hover:underline", "focus-visible:ring-ring focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2"),
|
|
275
|
+
children: L ? T.hideTable : T.viewAsTable
|
|
276
|
+
}),
|
|
277
|
+
H && /* @__PURE__ */ d(P, {
|
|
278
|
+
id: j,
|
|
279
|
+
all: s,
|
|
280
|
+
name: F ?? (typeof t == "string" ? t : void 0),
|
|
281
|
+
visible: L,
|
|
282
|
+
t: T
|
|
283
|
+
})
|
|
284
|
+
]
|
|
285
|
+
});
|
|
263
286
|
}
|
|
264
|
-
function
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
}) };
|
|
287
|
+
function I(t, n, r) {
|
|
288
|
+
let [a, o] = l(null), [s, c] = l(""), u = i((e, n) => {
|
|
289
|
+
let i = t[e], a = i?.data[n];
|
|
290
|
+
a && w(a.y) && (o({
|
|
291
|
+
series: e,
|
|
292
|
+
index: n
|
|
293
|
+
}), c(r.point(i.name, a.x, a.y)));
|
|
294
|
+
}, [t, r]), d = (e) => t[e].data.map((e, t) => w(e.y) ? t : -1).filter((e) => e >= 0);
|
|
295
|
+
return {
|
|
296
|
+
active: a,
|
|
297
|
+
announcement: s,
|
|
298
|
+
seriesProps: (i) => ({
|
|
299
|
+
tabIndex: 0,
|
|
300
|
+
role: "group",
|
|
301
|
+
"aria-label": r.series(k(t[i], i, n), d(i).length),
|
|
302
|
+
"data-chart-series": !0,
|
|
303
|
+
className: e("[&:focus-visible_[data-active]]:stroke-[var(--ring)] [&:focus-visible_[data-active]]:stroke-[3px]"),
|
|
304
|
+
onFocus: () => {
|
|
305
|
+
let e = d(i);
|
|
306
|
+
e.length && u(i, a?.series === i ? a.index : e[e.length - 1]);
|
|
307
|
+
},
|
|
308
|
+
onBlur: () => {
|
|
309
|
+
o(null), c("");
|
|
310
|
+
},
|
|
311
|
+
onKeyDown: (e) => {
|
|
312
|
+
let t = d(i);
|
|
313
|
+
if (!t.length) return;
|
|
314
|
+
let n = a?.series === i ? t.indexOf(a.index) : t.length - 1, r = n;
|
|
315
|
+
if (e.key === "ArrowRight" || e.key === "ArrowUp") r = Math.min(t.length - 1, n + 1);
|
|
316
|
+
else if (e.key === "ArrowLeft" || e.key === "ArrowDown") r = Math.max(0, n - 1);
|
|
317
|
+
else if (e.key === "Home") r = 0;
|
|
318
|
+
else if (e.key === "End") r = t.length - 1;
|
|
319
|
+
else return;
|
|
320
|
+
e.preventDefault(), u(i, t[r]);
|
|
321
|
+
}
|
|
322
|
+
})
|
|
323
|
+
};
|
|
302
324
|
}
|
|
303
|
-
function
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
{
|
|
314
|
-
cx: e,
|
|
315
|
-
cy: n,
|
|
316
|
-
r: 3.5,
|
|
317
|
-
fill: r,
|
|
318
|
-
"data-active": a || void 0,
|
|
319
|
-
className: w(!o && !a && "opacity-0 hover:opacity-100"),
|
|
320
|
-
children: /* @__PURE__ */ s("title", { children: t })
|
|
321
|
-
}
|
|
322
|
-
);
|
|
325
|
+
function L({ x: t, y: n, color: r, label: i, always: a, active: o }) {
|
|
326
|
+
return /* @__PURE__ */ d("circle", {
|
|
327
|
+
cx: t,
|
|
328
|
+
cy: n,
|
|
329
|
+
r: 3.5,
|
|
330
|
+
fill: r,
|
|
331
|
+
"data-active": o || void 0,
|
|
332
|
+
className: e(!a && !o && "opacity-0 hover:opacity-100"),
|
|
333
|
+
children: /* @__PURE__ */ d("title", { children: i })
|
|
334
|
+
});
|
|
323
335
|
}
|
|
324
|
-
function
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
A.data.map(
|
|
380
|
-
(b, _) => k(b.y) ? /* @__PURE__ */ s(
|
|
381
|
-
Me,
|
|
382
|
-
{
|
|
383
|
-
x: R(_),
|
|
384
|
-
y: W(b.y),
|
|
385
|
-
color: L,
|
|
386
|
-
always: _ === B,
|
|
387
|
-
active: (M == null ? void 0 : M.series) === N && M.index === _,
|
|
388
|
-
label: g.point(A.name, b.x, b.y)
|
|
389
|
-
},
|
|
390
|
-
_
|
|
391
|
-
) : null
|
|
392
|
-
)
|
|
393
|
-
] }, N);
|
|
394
|
-
})
|
|
395
|
-
] })
|
|
396
|
-
}
|
|
397
|
-
);
|
|
336
|
+
function R({ data: e, series: t, colors: r = h, height: i = 160, width: a = "100%", caption: o, "aria-label": s, title: c, grid: l = !0, showAxis: p = !0, tableFallback: g = !0, showTableToggle: _, state: v, labels: y, className: b }) {
|
|
337
|
+
let x = n().chart, S = {
|
|
338
|
+
...m(x),
|
|
339
|
+
...y
|
|
340
|
+
}, k = C(e, t), { min: A, range: M, ticks: N } = T(k), P = Math.max(...k.map((e) => e.data.length)), I = k[0].data;
|
|
341
|
+
return /* @__PURE__ */ d(F, {
|
|
342
|
+
caption: o,
|
|
343
|
+
ariaLabel: s,
|
|
344
|
+
title: c,
|
|
345
|
+
all: k,
|
|
346
|
+
height: i,
|
|
347
|
+
width: a,
|
|
348
|
+
className: b,
|
|
349
|
+
showAxis: p,
|
|
350
|
+
ticks: N,
|
|
351
|
+
xFirst: I[0],
|
|
352
|
+
xLast: I[I.length - 1],
|
|
353
|
+
tableFallback: g,
|
|
354
|
+
showTableToggle: _,
|
|
355
|
+
state: v,
|
|
356
|
+
labels: S,
|
|
357
|
+
children: ({ width: e, active: t, seriesProps: n }) => /* @__PURE__ */ f(u, { children: [l && /* @__PURE__ */ d(j, {
|
|
358
|
+
width: e,
|
|
359
|
+
height: i,
|
|
360
|
+
lines: N.length - 1
|
|
361
|
+
}), k.map((a, o) => {
|
|
362
|
+
let s = r[o % r.length], { sx: c, sy: l } = E(P, e, i, A, M), u = O(a.data, c, l), p = u.map(D).join(" "), m = l(Math.max(A, 0)), h = u.map((e) => `${D(e)} L${e[e.length - 1][0].toFixed(1)},${m.toFixed(1)} L${e[0][0].toFixed(1)},${m.toFixed(1)} Z`).join(" "), g = a.data.map((e) => w(e.y)).lastIndexOf(!0);
|
|
363
|
+
return /* @__PURE__ */ f("g", {
|
|
364
|
+
...n(o),
|
|
365
|
+
children: [
|
|
366
|
+
h && /* @__PURE__ */ d("path", {
|
|
367
|
+
d: h,
|
|
368
|
+
fill: s,
|
|
369
|
+
fillOpacity: .08
|
|
370
|
+
}),
|
|
371
|
+
/* @__PURE__ */ d("path", {
|
|
372
|
+
d: p,
|
|
373
|
+
fill: "none",
|
|
374
|
+
stroke: s,
|
|
375
|
+
strokeWidth: 2,
|
|
376
|
+
strokeLinecap: "round",
|
|
377
|
+
strokeLinejoin: "round"
|
|
378
|
+
}),
|
|
379
|
+
a.data.map((e, n) => w(e.y) ? /* @__PURE__ */ d(L, {
|
|
380
|
+
x: c(n),
|
|
381
|
+
y: l(e.y),
|
|
382
|
+
color: s,
|
|
383
|
+
always: n === g,
|
|
384
|
+
active: t?.series === o && t.index === n,
|
|
385
|
+
label: S.point(a.name, e.x, e.y)
|
|
386
|
+
}, n) : null)
|
|
387
|
+
]
|
|
388
|
+
}, o);
|
|
389
|
+
})] })
|
|
390
|
+
});
|
|
398
391
|
}
|
|
399
|
-
function
|
|
400
|
-
|
|
392
|
+
function z(e) {
|
|
393
|
+
return /* @__PURE__ */ d(R, { ...e });
|
|
401
394
|
}
|
|
402
|
-
function
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
y: Math.min(D, b),
|
|
462
|
-
width: R,
|
|
463
|
-
height: Math.abs(D - b),
|
|
464
|
-
fill: r[j % r.length],
|
|
465
|
-
rx: 2,
|
|
466
|
-
"data-active": re || void 0,
|
|
467
|
-
className: "transition-opacity hover:opacity-80",
|
|
468
|
-
children: /* @__PURE__ */ s("title", { children: ne })
|
|
469
|
-
},
|
|
470
|
-
B
|
|
471
|
-
);
|
|
472
|
-
}) }, j))
|
|
473
|
-
] });
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
);
|
|
395
|
+
function B({ data: e, series: t, colors: r = h, height: i = 160, width: a = "100%", caption: o, "aria-label": s, title: c, grid: l = !0, showAxis: p = !0, tableFallback: g = !0, showTableToggle: v, state: y, labels: b, className: x }) {
|
|
396
|
+
let S = n().chart, D = {
|
|
397
|
+
...m(S),
|
|
398
|
+
...b
|
|
399
|
+
}, O = C(e, t), k = Math.max(...O.map((e) => e.data.length)), { min: A, range: M, ticks: N } = T(O), P = O[0].data;
|
|
400
|
+
return /* @__PURE__ */ d(F, {
|
|
401
|
+
caption: o,
|
|
402
|
+
ariaLabel: s,
|
|
403
|
+
title: c,
|
|
404
|
+
all: O,
|
|
405
|
+
height: i,
|
|
406
|
+
width: a,
|
|
407
|
+
className: x,
|
|
408
|
+
showAxis: p,
|
|
409
|
+
ticks: N,
|
|
410
|
+
xFirst: P[0],
|
|
411
|
+
xLast: P[P.length - 1],
|
|
412
|
+
tableFallback: g,
|
|
413
|
+
showTableToggle: v,
|
|
414
|
+
state: y,
|
|
415
|
+
labels: D,
|
|
416
|
+
children: ({ width: e, active: t, seriesProps: n }) => {
|
|
417
|
+
let a = (e - 12) / Math.max(1, k), o = a * .62, s = Math.max(2, o / O.length), { sy: c } = E(k, e, i, A, M), p = c(Math.min(Math.max(0, A), A + M));
|
|
418
|
+
return /* @__PURE__ */ f(u, { children: [
|
|
419
|
+
l && /* @__PURE__ */ d(j, {
|
|
420
|
+
width: e,
|
|
421
|
+
height: i,
|
|
422
|
+
lines: N.length - 1
|
|
423
|
+
}),
|
|
424
|
+
A < 0 && /* @__PURE__ */ d("line", {
|
|
425
|
+
"aria-hidden": !0,
|
|
426
|
+
x1: 0,
|
|
427
|
+
x2: e,
|
|
428
|
+
y1: p,
|
|
429
|
+
y2: p,
|
|
430
|
+
stroke: "var(--color-border-strong)",
|
|
431
|
+
strokeWidth: 1
|
|
432
|
+
}),
|
|
433
|
+
O.map((e, i) => /* @__PURE__ */ d("g", {
|
|
434
|
+
...n(i),
|
|
435
|
+
children: e.data.map((n, l) => {
|
|
436
|
+
if (!w(n.y)) return null;
|
|
437
|
+
let u = c(n.y), f = _ + l * a + (a - o) / 2 + i * s, m = D.point(e.name, n.x, n.y), h = t?.series === i && t.index === l;
|
|
438
|
+
return /* @__PURE__ */ d("rect", {
|
|
439
|
+
x: f,
|
|
440
|
+
y: Math.min(p, u),
|
|
441
|
+
width: s,
|
|
442
|
+
height: Math.abs(p - u),
|
|
443
|
+
fill: r[i % r.length],
|
|
444
|
+
rx: 2,
|
|
445
|
+
"data-active": h || void 0,
|
|
446
|
+
className: "transition-opacity hover:opacity-80",
|
|
447
|
+
children: /* @__PURE__ */ d("title", { children: m })
|
|
448
|
+
}, l);
|
|
449
|
+
})
|
|
450
|
+
}, i))
|
|
451
|
+
] });
|
|
452
|
+
}
|
|
453
|
+
});
|
|
477
454
|
}
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
Ne as LineChart,
|
|
483
|
-
fe as abbreviateNumber,
|
|
484
|
-
Ie as defaultChartLabels,
|
|
485
|
-
xe as niceTicks
|
|
486
|
-
};
|
|
487
|
-
//# sourceMappingURL=Chart.js.map
|
|
455
|
+
//#endregion
|
|
456
|
+
export { z as AreaChart, B as BarChart, h as DEFAULT_CHART_COLORS, R as LineChart, b as abbreviateNumber, p as defaultChartLabels, S as niceTicks };
|
|
457
|
+
|
|
458
|
+
//# sourceMappingURL=Chart.js.map
|