@devalok/shilp-sutra 0.27.2 → 0.29.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/_chunks/badge-group.js +299 -0
- package/dist/_chunks/framer.js +1915 -1980
- package/dist/_chunks/keybinding.js +4 -5
- package/dist/_chunks/primitives.js +3198 -3272
- package/dist/_chunks/sonner.js +29 -31
- package/dist/_chunks/stat-row.js +110 -131
- package/dist/_chunks/tiptap.js +42 -78
- package/dist/_chunks/tree-view.js +138 -149
- package/dist/_chunks/typing-indicator.js +565 -0
- package/dist/_chunks/use-calendar.js +416 -439
- package/dist/_chunks/vendor-client.js +977 -814
- package/dist/_chunks/vendor-utils.js +5 -5
- package/dist/ai/block-renderer.js +22 -22
- package/dist/ai/blocks/loading.d.ts.map +1 -1
- package/dist/ai/command-bar.d.ts.map +1 -1
- package/dist/ai/command-bar.js +241 -263
- package/dist/ai/conversation.d.ts.map +1 -1
- package/dist/ai/conversation.js +87 -107
- package/dist/composed/activity-feed.d.ts +2 -0
- package/dist/composed/activity-feed.d.ts.map +1 -1
- package/dist/composed/activity-feed.js +118 -90
- package/dist/composed/avatar-group.d.ts +1 -0
- package/dist/composed/avatar-group.d.ts.map +1 -1
- package/dist/composed/avatar-group.js +91 -67
- package/dist/composed/bulk-action-bar.d.ts.map +1 -1
- package/dist/composed/bulk-action-bar.js +29 -28
- package/dist/composed/command-palette.d.ts.map +1 -1
- package/dist/composed/command-palette.js +99 -113
- package/dist/composed/content-card.js +1 -1
- package/dist/composed/date-picker/calendar-grid.d.ts.map +1 -1
- package/dist/composed/date-picker/date-picker.d.ts.map +1 -1
- package/dist/composed/date-picker/date-range-picker.d.ts.map +1 -1
- package/dist/composed/date-picker/date-time-picker.d.ts.map +1 -1
- package/dist/composed/date-picker/time-picker.d.ts.map +1 -1
- package/dist/composed/deadline-indicator.d.ts.map +1 -1
- package/dist/composed/deadline-indicator.js +29 -28
- package/dist/composed/error-boundary.d.ts.map +1 -1
- package/dist/composed/error-boundary.js +30 -27
- package/dist/composed/extensions/file-attachment.d.ts.map +1 -1
- package/dist/composed/file-preview.d.ts.map +1 -1
- package/dist/composed/file-preview.js +261 -271
- package/dist/composed/filter-bar.d.ts.map +1 -1
- package/dist/composed/filter-bar.js +49 -48
- package/dist/composed/form-section.d.ts.map +1 -1
- package/dist/composed/form-section.js +12 -11
- package/dist/composed/global-loading.js +1 -1
- package/dist/composed/index.js +63 -63
- package/dist/composed/inline-edit.d.ts.map +1 -1
- package/dist/composed/inline-edit.js +55 -54
- package/dist/composed/markdown-viewer.d.ts.map +1 -1
- package/dist/composed/markdown-viewer.js +44 -43
- package/dist/composed/master-detail.d.ts.map +1 -1
- package/dist/composed/master-detail.js +35 -34
- package/dist/composed/multi-select-popover.d.ts.map +1 -1
- package/dist/composed/multi-select-popover.js +64 -64
- package/dist/composed/page-header.d.ts.map +1 -1
- package/dist/composed/page-header.js +31 -37
- package/dist/composed/priority-indicator.d.ts.map +1 -1
- package/dist/composed/priority-indicator.js +37 -36
- package/dist/composed/rich-text-editor.d.ts.map +1 -1
- package/dist/composed/rich-text-editor.js +287 -306
- package/dist/composed/schedule-view.js +62 -62
- package/dist/composed/status-badge.d.ts +4 -2
- package/dist/composed/status-badge.d.ts.map +1 -1
- package/dist/composed/status-badge.js +58 -45
- package/dist/shell/app-command-palette.d.ts.map +1 -1
- package/dist/shell/app-command-palette.js +93 -93
- package/dist/shell/bottom-navbar.d.ts.map +1 -1
- package/dist/shell/bottom-navbar.js +21 -20
- package/dist/shell/index.js +18 -18
- package/dist/shell/notification-center.d.ts.map +1 -1
- package/dist/shell/notification-center.js +96 -95
- package/dist/shell/notification-preferences.d.ts.map +1 -1
- package/dist/shell/notification-preferences.js +82 -85
- package/dist/shell/sidebar.js +59 -60
- package/dist/shell/top-bar.d.ts.map +1 -1
- package/dist/shell/top-bar.js +103 -103
- package/dist/tailwind/index.cjs +37 -4
- package/dist/tailwind/preset.d.ts.map +1 -1
- package/dist/tailwind/preset.js +38 -5
- package/dist/tokens/primitives.css +10 -0
- package/dist/tokens/semantic.css +70 -7
- package/dist/ui/accordion.d.ts +5 -2
- package/dist/ui/accordion.d.ts.map +1 -1
- package/dist/ui/accordion.js +44 -39
- package/dist/ui/alert-dialog.js +57 -57
- package/dist/ui/alert.d.ts +1 -1
- package/dist/ui/alert.d.ts.map +1 -1
- package/dist/ui/alert.js +30 -29
- package/dist/ui/aspect-ratio.js +4 -4
- package/dist/ui/autocomplete.js +56 -56
- package/dist/ui/avatar.js +2 -2
- package/dist/ui/badge-group.d.ts +22 -0
- package/dist/ui/badge-group.d.ts.map +1 -0
- package/dist/ui/badge-group.js +8 -0
- package/dist/ui/badge-indicator.d.ts +32 -0
- package/dist/ui/badge-indicator.d.ts.map +1 -0
- package/dist/ui/badge-indicator.js +54 -0
- package/dist/ui/badge.d.ts +27 -24
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/badge.js +13 -129
- package/dist/ui/banner.d.ts +1 -1
- package/dist/ui/banner.d.ts.map +1 -1
- package/dist/ui/banner.js +27 -26
- package/dist/ui/breadcrumb.d.ts.map +1 -1
- package/dist/ui/breadcrumb.js +37 -36
- package/dist/ui/button-group.d.ts +12 -6
- package/dist/ui/button-group.d.ts.map +1 -1
- package/dist/ui/button-group.js +18 -18
- package/dist/ui/button-processing.d.ts +15 -0
- package/dist/ui/button-processing.d.ts.map +1 -0
- package/dist/ui/button-processing.js +77 -0
- package/dist/ui/button.d.ts +50 -25
- package/dist/ui/button.d.ts.map +1 -1
- package/dist/ui/button.js +243 -127
- package/dist/ui/card.js +20 -21
- package/dist/ui/charts/index.js +499 -508
- package/dist/ui/chat/date-separator.d.ts +12 -0
- package/dist/ui/chat/date-separator.d.ts.map +1 -0
- package/dist/ui/chat/index.d.ts +9 -0
- package/dist/ui/chat/index.d.ts.map +1 -0
- package/dist/ui/chat/index.js +12 -0
- package/dist/ui/chat/message-input.d.ts +16 -0
- package/dist/ui/chat/message-input.d.ts.map +1 -0
- package/dist/ui/chat/message-list.d.ts +24 -0
- package/dist/ui/chat/message-list.d.ts.map +1 -0
- package/dist/ui/chat/message.d.ts +108 -0
- package/dist/ui/chat/message.d.ts.map +1 -0
- package/dist/ui/chat/system-message.d.ts +11 -0
- package/dist/ui/chat/system-message.d.ts.map +1 -0
- package/dist/ui/chat/typing-indicator.d.ts +14 -0
- package/dist/ui/chat/typing-indicator.d.ts.map +1 -0
- package/dist/ui/chat/unread-separator.d.ts +12 -0
- package/dist/ui/chat/unread-separator.d.ts.map +1 -0
- package/dist/ui/checkbox.js +18 -18
- package/dist/ui/chip.d.ts +13 -62
- package/dist/ui/chip.d.ts.map +1 -1
- package/dist/ui/chip.js +10 -109
- package/dist/ui/collapsible.js +4 -4
- package/dist/ui/color-input.d.ts +19 -5
- package/dist/ui/color-input.d.ts.map +1 -1
- package/dist/ui/color-input.js +371 -79
- package/dist/ui/color-swatch.js +11 -11
- package/dist/ui/combobox.d.ts.map +1 -1
- package/dist/ui/combobox.js +74 -80
- package/dist/ui/context-menu.d.ts.map +1 -1
- package/dist/ui/context-menu.js +86 -85
- package/dist/ui/data-table-toolbar.d.ts.map +1 -1
- package/dist/ui/data-table-toolbar.js +51 -57
- package/dist/ui/data-table.d.ts.map +1 -1
- package/dist/ui/data-table.js +268 -296
- package/dist/ui/devalok-grain.d.ts +81 -0
- package/dist/ui/devalok-grain.d.ts.map +1 -0
- package/dist/ui/devalok-grain.js +69 -0
- package/dist/ui/dialog.d.ts.map +1 -1
- package/dist/ui/dialog.js +73 -72
- package/dist/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/ui/dropdown-menu.js +93 -92
- package/dist/ui/file-upload.d.ts.map +1 -1
- package/dist/ui/file-upload.js +82 -82
- package/dist/ui/hover-card.js +29 -29
- package/dist/ui/icon-button.d.ts +7 -7
- package/dist/ui/icon-button.d.ts.map +1 -1
- package/dist/ui/icon-context.d.ts +15 -0
- package/dist/ui/icon-context.d.ts.map +1 -0
- package/dist/ui/icon-context.js +20 -0
- package/dist/ui/icon-group.d.ts +22 -0
- package/dist/ui/icon-group.d.ts.map +1 -0
- package/dist/ui/icon-group.js +32 -0
- package/dist/ui/icon.d.ts +57 -0
- package/dist/ui/icon.d.ts.map +1 -0
- package/dist/ui/icon.js +122 -0
- package/dist/ui/index.d.ts +8 -1
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +351 -329
- package/dist/ui/input-otp.d.ts.map +1 -1
- package/dist/ui/input-otp.js +21 -20
- package/dist/ui/input.d.ts +32 -11
- package/dist/ui/input.d.ts.map +1 -1
- package/dist/ui/input.js +149 -44
- package/dist/ui/label.js +1 -1
- package/dist/ui/lib/motion.d.ts +2 -0
- package/dist/ui/lib/motion.d.ts.map +1 -1
- package/dist/ui/lib/motion.js +13 -11
- package/dist/ui/lib/utils.js +1 -1
- package/dist/ui/menubar.d.ts.map +1 -1
- package/dist/ui/menubar.js +87 -86
- package/dist/ui/navigation-menu.d.ts.map +1 -1
- package/dist/ui/navigation-menu.js +23 -28
- package/dist/ui/number-input.d.ts.map +1 -1
- package/dist/ui/number-input.js +54 -53
- package/dist/ui/pagination.d.ts.map +1 -1
- package/dist/ui/pagination.js +45 -44
- package/dist/ui/popover.js +30 -30
- package/dist/ui/progress.d.ts +3 -1
- package/dist/ui/progress.d.ts.map +1 -1
- package/dist/ui/progress.js +43 -39
- package/dist/ui/radio.js +1 -1
- package/dist/ui/search-input.d.ts.map +1 -1
- package/dist/ui/search-input.js +47 -60
- package/dist/ui/segmented-control.js +1 -1
- package/dist/ui/select.d.ts.map +1 -1
- package/dist/ui/select.js +54 -53
- package/dist/ui/separator.js +5 -5
- package/dist/ui/sheet.d.ts.map +1 -1
- package/dist/ui/sheet.js +46 -45
- package/dist/ui/sidebar.d.ts.map +1 -1
- package/dist/ui/sidebar.js +196 -193
- package/dist/ui/skeleton.js +1 -1
- package/dist/ui/slider.js +1 -1
- package/dist/ui/spinner.js +74 -74
- package/dist/ui/stat-card.d.ts.map +1 -1
- package/dist/ui/stat-card.js +85 -86
- package/dist/ui/switch.d.ts +3 -0
- package/dist/ui/switch.d.ts.map +1 -1
- package/dist/ui/switch.js +40 -26
- package/dist/ui/tabs.js +43 -43
- package/dist/ui/text.js +1 -1
- package/dist/ui/textarea.js +10 -10
- package/dist/ui/toast.d.ts.map +1 -1
- package/dist/ui/toast.js +169 -169
- package/dist/ui/toggle-group.js +1 -1
- package/dist/ui/toggle.js +5 -5
- package/dist/ui/tooltip.js +41 -41
- package/dist/ui/tree-view/tree-item.d.ts.map +1 -1
- package/docs/components/_header.md +4 -4
- package/docs/components/composed/activity-feed.md +7 -0
- package/docs/components/composed/avatar-group.md +8 -5
- package/docs/components/composed/status-badge.md +14 -1
- package/docs/components/ui/accordion.md +5 -2
- package/docs/components/ui/badge-group.md +38 -0
- package/docs/components/ui/badge-indicator.md +40 -0
- package/docs/components/ui/badge.md +36 -5
- package/docs/components/ui/button-processing.md +15 -0
- package/docs/components/ui/button.md +40 -11
- package/docs/components/ui/chat.md +214 -0
- package/docs/components/ui/color-input.md +58 -4
- package/docs/components/ui/data-table.md +3 -0
- package/docs/components/ui/devalok-grain.md +55 -0
- package/docs/components/ui/icon-button.md +12 -5
- package/docs/components/ui/icon-context.md +38 -0
- package/docs/components/ui/icon-group.md +36 -0
- package/docs/components/ui/icon.md +47 -0
- package/docs/components/ui/input.md +32 -6
- package/docs/components/ui/progress.md +5 -0
- package/docs/components/ui/spinner.md +3 -0
- package/docs/components/ui/switch.md +13 -0
- package/llms-full.txt +724 -44
- package/llms.txt +38 -19
- package/package.json +8 -2
package/dist/ui/charts/index.js
CHANGED
|
@@ -1,115 +1,115 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as e, jsxs as
|
|
3
|
-
import * as
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { scaleBand as
|
|
7
|
-
import { tweens as
|
|
2
|
+
import { jsx as e, jsxs as p, Fragment as ee } from "react/jsx-runtime";
|
|
3
|
+
import * as te from "react";
|
|
4
|
+
import { useRef as ve, useState as de, useEffect as ye, useCallback as ke } from "react";
|
|
5
|
+
import { cn as Q } from "../lib/utils.js";
|
|
6
|
+
import { scaleBand as Ge, scaleLinear as ae, scalePoint as Ce } from "d3-scale";
|
|
7
|
+
import { tweens as le, motionProps as se } from "../lib/motion.js";
|
|
8
8
|
import { axisLeft as Xe, axisBottom as De, axisRight as Pe, axisTop as ze } from "d3-axis";
|
|
9
9
|
import { select as Be } from "d3-selection";
|
|
10
10
|
import { u as Ve } from "../../_chunks/motion-provider.js";
|
|
11
|
-
import { m as
|
|
12
|
-
import { line as
|
|
11
|
+
import { m as ne } from "../../_chunks/framer.js";
|
|
12
|
+
import { line as me, curveMonotoneX as ue, curveLinear as Ae, stack as _e, stackOrderNone as je, stackOffsetNone as Te, area as Me, pie as Ye, arc as ge, lineRadial as Oe, curveLinearClosed as We } from "d3-shape";
|
|
13
13
|
const Ie = {
|
|
14
14
|
top: 20,
|
|
15
15
|
right: 20,
|
|
16
16
|
bottom: 40,
|
|
17
17
|
left: 50
|
|
18
|
-
},
|
|
18
|
+
}, xe = te.forwardRef(
|
|
19
19
|
({
|
|
20
20
|
height: t = 300,
|
|
21
|
-
margin:
|
|
22
|
-
className:
|
|
21
|
+
margin: a,
|
|
22
|
+
className: o,
|
|
23
23
|
children: y,
|
|
24
|
-
...
|
|
24
|
+
...m
|
|
25
25
|
}, x) => {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
if (!
|
|
29
|
-
const
|
|
30
|
-
const R =
|
|
31
|
-
R &&
|
|
26
|
+
const c = ve(null), [M, z] = de(0), N = { ...Ie, ...a };
|
|
27
|
+
ye(() => {
|
|
28
|
+
if (!c.current) return;
|
|
29
|
+
const j = new ResizeObserver((P) => {
|
|
30
|
+
const R = P[0];
|
|
31
|
+
R && z(R.contentRect.width);
|
|
32
32
|
});
|
|
33
|
-
return
|
|
33
|
+
return j.observe(c.current), () => j.disconnect();
|
|
34
34
|
}, []);
|
|
35
35
|
const A = Math.max(0, M - N.left - N.right), k = Math.max(0, t - N.top - N.bottom);
|
|
36
36
|
return /* @__PURE__ */ e(
|
|
37
37
|
"div",
|
|
38
38
|
{
|
|
39
|
-
ref: (
|
|
40
|
-
|
|
39
|
+
ref: (j) => {
|
|
40
|
+
c.current = j, typeof x == "function" ? x(j) : x && (x.current = j);
|
|
41
41
|
},
|
|
42
|
-
className:
|
|
43
|
-
...
|
|
42
|
+
className: Q("relative w-full", o),
|
|
43
|
+
...m,
|
|
44
44
|
children: M > 0 && /* @__PURE__ */ e("svg", { width: M, height: t, role: "img", "aria-label": "Chart", children: /* @__PURE__ */ e("g", { transform: `translate(${N.left},${N.top})`, children: y({ width: A, height: k, margin: N }) }) })
|
|
45
45
|
}
|
|
46
46
|
);
|
|
47
47
|
}
|
|
48
48
|
);
|
|
49
|
-
|
|
50
|
-
function
|
|
49
|
+
xe.displayName = "ChartContainer";
|
|
50
|
+
function K({
|
|
51
51
|
scale: t,
|
|
52
|
-
orientation:
|
|
53
|
-
transform:
|
|
52
|
+
orientation: a,
|
|
53
|
+
transform: o,
|
|
54
54
|
tickCount: y,
|
|
55
|
-
tickFormat:
|
|
55
|
+
tickFormat: m,
|
|
56
56
|
label: x,
|
|
57
|
-
className:
|
|
57
|
+
className: c
|
|
58
58
|
}) {
|
|
59
|
-
const M =
|
|
60
|
-
return
|
|
59
|
+
const M = ve(null);
|
|
60
|
+
return ye(() => {
|
|
61
61
|
if (!M.current) return;
|
|
62
62
|
const N = {
|
|
63
63
|
top: ze,
|
|
64
64
|
right: Pe,
|
|
65
65
|
bottom: De,
|
|
66
66
|
left: Xe
|
|
67
|
-
}[
|
|
67
|
+
}[a];
|
|
68
68
|
let A = N(t);
|
|
69
|
-
y && (A = A.ticks(y)),
|
|
69
|
+
y && (A = A.ticks(y)), m && (A = A.tickFormat(m));
|
|
70
70
|
const k = Be(M.current);
|
|
71
71
|
k.call(A), k.selectAll(".tick line").attr("stroke", "var(--color-surface-border)"), k.selectAll(".tick text").attr("fill", "var(--color-surface-fg-muted)").attr("font-size", "var(--font-size-xs)"), k.selectAll(".domain").attr("stroke", "var(--color-surface-border-strong)");
|
|
72
|
-
}, [t,
|
|
72
|
+
}, [t, a, y, m]), /* @__PURE__ */ e("g", { ref: M, transform: o, className: c, children: x && /* @__PURE__ */ e(
|
|
73
73
|
"text",
|
|
74
74
|
{
|
|
75
75
|
textAnchor: "middle",
|
|
76
76
|
fill: "var(--color-surface-fg-muted)",
|
|
77
77
|
fontSize: "var(--font-size-sm)",
|
|
78
|
-
...
|
|
78
|
+
...a === "bottom" ? { x: "50%", dy: 35 } : a === "left" ? { transform: "rotate(-90)", y: -40, x: 0 } : {},
|
|
79
79
|
children: x
|
|
80
80
|
}
|
|
81
81
|
) });
|
|
82
82
|
}
|
|
83
|
-
|
|
84
|
-
function
|
|
83
|
+
K.displayName = "Axis";
|
|
84
|
+
function he({
|
|
85
85
|
width: t,
|
|
86
|
-
height:
|
|
87
|
-
xScale:
|
|
86
|
+
height: a,
|
|
87
|
+
xScale: o,
|
|
88
88
|
yScale: y,
|
|
89
|
-
horizontal:
|
|
89
|
+
horizontal: m = !0,
|
|
90
90
|
vertical: x = !1
|
|
91
91
|
}) {
|
|
92
|
-
return /* @__PURE__ */
|
|
93
|
-
|
|
92
|
+
return /* @__PURE__ */ p("g", { className: "grid-lines", children: [
|
|
93
|
+
m && y?.ticks && y.ticks().map((c, M) => /* @__PURE__ */ e(
|
|
94
94
|
"line",
|
|
95
95
|
{
|
|
96
96
|
x1: 0,
|
|
97
97
|
x2: t,
|
|
98
|
-
y1: y(
|
|
99
|
-
y2: y(
|
|
98
|
+
y1: y(c),
|
|
99
|
+
y2: y(c),
|
|
100
100
|
stroke: "var(--color-surface-border)",
|
|
101
101
|
strokeDasharray: "3,3",
|
|
102
102
|
opacity: 0.6
|
|
103
103
|
},
|
|
104
104
|
`h-${M}`
|
|
105
105
|
)),
|
|
106
|
-
x &&
|
|
106
|
+
x && o?.ticks && o.ticks().map((c, M) => /* @__PURE__ */ e(
|
|
107
107
|
"line",
|
|
108
108
|
{
|
|
109
|
-
x1:
|
|
110
|
-
x2:
|
|
109
|
+
x1: o(c),
|
|
110
|
+
x2: o(c),
|
|
111
111
|
y1: 0,
|
|
112
|
-
y2:
|
|
112
|
+
y2: a,
|
|
113
113
|
stroke: "var(--color-surface-border)",
|
|
114
114
|
strokeDasharray: "3,3",
|
|
115
115
|
opacity: 0.6
|
|
@@ -118,62 +118,62 @@ function fe({
|
|
|
118
118
|
))
|
|
119
119
|
] });
|
|
120
120
|
}
|
|
121
|
-
|
|
122
|
-
function ce({ items: t, position:
|
|
121
|
+
he.displayName = "GridLines";
|
|
122
|
+
function ce({ items: t, position: a = "bottom", className: o }) {
|
|
123
123
|
return /* @__PURE__ */ e(
|
|
124
124
|
"div",
|
|
125
125
|
{
|
|
126
|
-
className:
|
|
126
|
+
className: Q(
|
|
127
127
|
"flex gap-ds-04 text-ds-sm text-surface-fg-muted",
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
a === "left" || a === "right" ? "flex-col" : "flex-row flex-wrap justify-center",
|
|
129
|
+
o
|
|
130
130
|
),
|
|
131
|
-
children: t.map((
|
|
131
|
+
children: t.map((m) => /* @__PURE__ */ p("div", { className: "flex items-center gap-ds-02", children: [
|
|
132
132
|
/* @__PURE__ */ e(
|
|
133
133
|
"span",
|
|
134
134
|
{
|
|
135
135
|
className: "inline-block h-3 w-3 shrink-0 rounded-ds-sm",
|
|
136
|
-
style: { backgroundColor:
|
|
136
|
+
style: { backgroundColor: m.color }
|
|
137
137
|
}
|
|
138
138
|
),
|
|
139
|
-
/* @__PURE__ */ e("span", { children:
|
|
140
|
-
] },
|
|
139
|
+
/* @__PURE__ */ e("span", { children: m.label })
|
|
140
|
+
] }, m.label))
|
|
141
141
|
}
|
|
142
142
|
);
|
|
143
143
|
}
|
|
144
144
|
ce.displayName = "Legend";
|
|
145
|
-
function
|
|
145
|
+
function ie({ state: t, className: a }) {
|
|
146
146
|
return t.visible ? /* @__PURE__ */ e(
|
|
147
147
|
"div",
|
|
148
148
|
{
|
|
149
|
-
className:
|
|
149
|
+
className: Q(
|
|
150
150
|
"pointer-events-none absolute z-tooltip",
|
|
151
151
|
"rounded-ds-md border border-surface-border-strong",
|
|
152
152
|
"bg-surface-overlay px-ds-03 py-ds-02",
|
|
153
153
|
"shadow-raised-hover",
|
|
154
154
|
"text-ds-sm text-surface-fg",
|
|
155
|
-
|
|
155
|
+
a
|
|
156
156
|
),
|
|
157
157
|
style: { left: t.x + 12, top: t.y - 12 },
|
|
158
158
|
children: t.content
|
|
159
159
|
}
|
|
160
160
|
) : null;
|
|
161
161
|
}
|
|
162
|
-
|
|
163
|
-
function
|
|
164
|
-
const [t,
|
|
162
|
+
ie.displayName = "ChartTooltip";
|
|
163
|
+
function fe() {
|
|
164
|
+
const [t, a] = de({
|
|
165
165
|
visible: !1,
|
|
166
166
|
x: 0,
|
|
167
167
|
y: 0,
|
|
168
168
|
content: null
|
|
169
|
-
}),
|
|
170
|
-
|
|
169
|
+
}), o = ke((m, x, c) => {
|
|
170
|
+
a({ visible: !0, x: m, y: x, content: c });
|
|
171
171
|
}, []), y = ke(() => {
|
|
172
|
-
|
|
172
|
+
a((m) => ({ ...m, visible: !1 }));
|
|
173
173
|
}, []);
|
|
174
|
-
return { tooltip: t, show:
|
|
174
|
+
return { tooltip: t, show: o, hide: y };
|
|
175
175
|
}
|
|
176
|
-
const
|
|
176
|
+
const be = [
|
|
177
177
|
"chart-1",
|
|
178
178
|
"chart-2",
|
|
179
179
|
"chart-3",
|
|
@@ -186,141 +186,140 @@ const Me = [
|
|
|
186
186
|
function Re(t) {
|
|
187
187
|
return `var(--${t})`;
|
|
188
188
|
}
|
|
189
|
-
function
|
|
190
|
-
return t ?
|
|
189
|
+
function re(t, a = 0) {
|
|
190
|
+
return t ? be.includes(t) ? Re(t) : t : Re(be[a % be.length]);
|
|
191
191
|
}
|
|
192
|
-
function
|
|
192
|
+
function oe() {
|
|
193
193
|
const { reducedMotion: t } = Ve();
|
|
194
194
|
return t;
|
|
195
195
|
}
|
|
196
|
-
function Fe(t,
|
|
197
|
-
return t ? 0 :
|
|
196
|
+
function Fe(t, a = 300) {
|
|
197
|
+
return t ? 0 : a;
|
|
198
198
|
}
|
|
199
|
-
const Ee =
|
|
199
|
+
const Ee = te.forwardRef(
|
|
200
200
|
({
|
|
201
201
|
data: t,
|
|
202
|
-
xKey:
|
|
203
|
-
yKey:
|
|
202
|
+
xKey: a,
|
|
203
|
+
yKey: o,
|
|
204
204
|
orientation: y = "vertical",
|
|
205
|
-
stacked:
|
|
205
|
+
stacked: m = !1,
|
|
206
206
|
grouped: x = !1,
|
|
207
|
-
color:
|
|
207
|
+
color: c,
|
|
208
208
|
height: M = 300,
|
|
209
|
-
showGrid:
|
|
209
|
+
showGrid: z = !0,
|
|
210
210
|
showTooltip: N = !0,
|
|
211
211
|
showLegend: A = !1,
|
|
212
212
|
animate: k = !0,
|
|
213
|
-
barRadius:
|
|
214
|
-
xLabel:
|
|
213
|
+
barRadius: j = 4,
|
|
214
|
+
xLabel: P,
|
|
215
215
|
yLabel: R,
|
|
216
|
-
seriesLabels:
|
|
217
|
-
className:
|
|
218
|
-
...
|
|
219
|
-
},
|
|
220
|
-
const { tooltip:
|
|
221
|
-
($, L) =>
|
|
222
|
-
Array.isArray(
|
|
216
|
+
seriesLabels: X,
|
|
217
|
+
className: E,
|
|
218
|
+
...W
|
|
219
|
+
}, U) => {
|
|
220
|
+
const { tooltip: I, show: T, hide: B } = fe(), q = oe(), d = y === "vertical", w = k && !q, b = Array.isArray(o) ? o : [o], i = b.length > 1, V = i ? b.map(
|
|
221
|
+
($, L) => re(
|
|
222
|
+
Array.isArray(c) ? c[L] : typeof c == "string" ? c : void 0,
|
|
223
223
|
L
|
|
224
224
|
)
|
|
225
225
|
) : [
|
|
226
|
-
|
|
227
|
-
typeof
|
|
226
|
+
re(
|
|
227
|
+
typeof c == "string" ? c : Array.isArray(c) ? c[0] : void 0,
|
|
228
228
|
0
|
|
229
229
|
)
|
|
230
230
|
];
|
|
231
|
-
return /* @__PURE__ */
|
|
232
|
-
|
|
231
|
+
return /* @__PURE__ */ p(
|
|
232
|
+
ne.div,
|
|
233
233
|
{
|
|
234
|
-
ref:
|
|
235
|
-
className:
|
|
236
|
-
...
|
|
237
|
-
...
|
|
234
|
+
ref: U,
|
|
235
|
+
className: Q("relative", E),
|
|
236
|
+
...w ? { initial: { opacity: 0, scale: 0.96 }, animate: { opacity: 1, scale: 1 }, transition: le.fade } : {},
|
|
237
|
+
...se(W),
|
|
238
238
|
children: [
|
|
239
|
-
/* @__PURE__ */ e(
|
|
240
|
-
const s = t.map((
|
|
239
|
+
/* @__PURE__ */ e(xe, { height: M, children: ({ width: $, height: L, margin: u }) => {
|
|
240
|
+
const s = t.map((S) => String(S[a]));
|
|
241
241
|
let l;
|
|
242
|
-
|
|
242
|
+
m ? l = Math.max(
|
|
243
243
|
...t.map(
|
|
244
|
-
(
|
|
244
|
+
(S) => b.reduce((G, C) => G + (Number(S[C]) || 0), 0)
|
|
245
245
|
)
|
|
246
246
|
) : l = Math.max(
|
|
247
|
-
...t.flatMap((
|
|
247
|
+
...t.flatMap((S) => b.map((G) => Number(S[G]) || 0))
|
|
248
248
|
);
|
|
249
|
-
const
|
|
250
|
-
return /* @__PURE__ */
|
|
251
|
-
|
|
252
|
-
|
|
249
|
+
const g = Ge().domain(s).range(d ? [0, $] : [0, L]).padding(0.2), n = ae().domain([0, l * 1.1]).range(d ? [L, 0] : [0, $]).nice(), r = g.bandwidth(), f = i && x ? r / b.length : r;
|
|
250
|
+
return /* @__PURE__ */ p(ee, { children: [
|
|
251
|
+
z && /* @__PURE__ */ e(
|
|
252
|
+
he,
|
|
253
253
|
{
|
|
254
254
|
width: $,
|
|
255
255
|
height: L,
|
|
256
|
-
yScale:
|
|
257
|
-
xScale:
|
|
258
|
-
horizontal:
|
|
259
|
-
vertical: !
|
|
256
|
+
yScale: d ? n : void 0,
|
|
257
|
+
xScale: d ? void 0 : n,
|
|
258
|
+
horizontal: d,
|
|
259
|
+
vertical: !d
|
|
260
260
|
}
|
|
261
261
|
),
|
|
262
|
-
t.map((
|
|
263
|
-
const
|
|
262
|
+
t.map((S) => {
|
|
263
|
+
const G = String(S[a]);
|
|
264
264
|
let C = 0;
|
|
265
|
-
return b.map((
|
|
266
|
-
const v = Number(
|
|
267
|
-
let
|
|
268
|
-
return
|
|
265
|
+
return b.map((J, h) => {
|
|
266
|
+
const v = Number(S[J]) || 0, _ = V[h] || V[0];
|
|
267
|
+
let Y, F, H, D;
|
|
268
|
+
return d ? (Y = (g(G) ?? 0) + (x && i ? h * f : 0), F = n(m ? C + v : v), H = f, D = m ? n(C) - n(C + v) : L - n(v)) : (Y = m ? n(C) : 0, F = (g(G) ?? 0) + (x && i ? h * f : 0), H = m ? n(C + v) - n(C) : n(v), D = f), m && (C += v), /* @__PURE__ */ e(
|
|
269
269
|
"rect",
|
|
270
270
|
{
|
|
271
|
-
x:
|
|
272
|
-
y:
|
|
273
|
-
width: Math.max(0,
|
|
274
|
-
height: Math.max(0,
|
|
275
|
-
rx:
|
|
276
|
-
fill:
|
|
271
|
+
x: Y,
|
|
272
|
+
y: F,
|
|
273
|
+
width: Math.max(0, H),
|
|
274
|
+
height: Math.max(0, D),
|
|
275
|
+
rx: j,
|
|
276
|
+
fill: _,
|
|
277
277
|
className: "transition-opacity hover:opacity-80",
|
|
278
|
-
onMouseMove: (
|
|
279
|
-
var Y;
|
|
278
|
+
onMouseMove: (Z) => {
|
|
280
279
|
if (N) {
|
|
281
|
-
const
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
/* @__PURE__ */
|
|
286
|
-
/* @__PURE__ */ e("div", { className: "font-medium", children:
|
|
287
|
-
|
|
280
|
+
const O = Z.currentTarget.closest("div")?.getBoundingClientRect();
|
|
281
|
+
T(
|
|
282
|
+
Z.clientX - (O?.left ?? 0),
|
|
283
|
+
Z.clientY - (O?.top ?? 0),
|
|
284
|
+
/* @__PURE__ */ p("div", { children: [
|
|
285
|
+
/* @__PURE__ */ e("div", { className: "font-medium", children: G }),
|
|
286
|
+
i && /* @__PURE__ */ e("div", { className: "text-surface-fg-muted", children: X?.[h] ?? J }),
|
|
288
287
|
/* @__PURE__ */ e("div", { children: v.toLocaleString() })
|
|
289
288
|
] })
|
|
290
289
|
);
|
|
291
290
|
}
|
|
292
291
|
},
|
|
293
|
-
onMouseLeave:
|
|
292
|
+
onMouseLeave: B
|
|
294
293
|
},
|
|
295
|
-
`${
|
|
294
|
+
`${G}-${J}`
|
|
296
295
|
);
|
|
297
296
|
});
|
|
298
297
|
}),
|
|
299
|
-
|
|
298
|
+
d ? /* @__PURE__ */ p(ee, { children: [
|
|
300
299
|
/* @__PURE__ */ e(
|
|
301
|
-
|
|
300
|
+
K,
|
|
302
301
|
{
|
|
303
|
-
scale:
|
|
302
|
+
scale: g,
|
|
304
303
|
orientation: "bottom",
|
|
305
304
|
transform: `translate(0,${L})`,
|
|
306
|
-
label:
|
|
305
|
+
label: P
|
|
307
306
|
}
|
|
308
307
|
),
|
|
309
|
-
/* @__PURE__ */ e(
|
|
310
|
-
] }) : /* @__PURE__ */
|
|
308
|
+
/* @__PURE__ */ e(K, { scale: n, orientation: "left", label: R })
|
|
309
|
+
] }) : /* @__PURE__ */ p(ee, { children: [
|
|
311
310
|
/* @__PURE__ */ e(
|
|
312
|
-
|
|
311
|
+
K,
|
|
313
312
|
{
|
|
314
313
|
scale: n,
|
|
315
314
|
orientation: "bottom",
|
|
316
315
|
transform: `translate(0,${L})`,
|
|
317
|
-
label:
|
|
316
|
+
label: P
|
|
318
317
|
}
|
|
319
318
|
),
|
|
320
319
|
/* @__PURE__ */ e(
|
|
321
|
-
|
|
320
|
+
K,
|
|
322
321
|
{
|
|
323
|
-
scale:
|
|
322
|
+
scale: g,
|
|
324
323
|
orientation: "left",
|
|
325
324
|
label: R
|
|
326
325
|
}
|
|
@@ -328,13 +327,13 @@ const Ee = ne.forwardRef(
|
|
|
328
327
|
] })
|
|
329
328
|
] });
|
|
330
329
|
} }),
|
|
331
|
-
N && /* @__PURE__ */ e(
|
|
332
|
-
A &&
|
|
330
|
+
N && /* @__PURE__ */ e(ie, { state: I }),
|
|
331
|
+
A && i && /* @__PURE__ */ e(
|
|
333
332
|
ce,
|
|
334
333
|
{
|
|
335
334
|
items: b.map(($, L) => ({
|
|
336
|
-
label:
|
|
337
|
-
color:
|
|
335
|
+
label: X?.[L] ?? $,
|
|
336
|
+
color: V[L]
|
|
338
337
|
})),
|
|
339
338
|
className: "mt-ds-04"
|
|
340
339
|
}
|
|
@@ -345,106 +344,105 @@ const Ee = ne.forwardRef(
|
|
|
345
344
|
}
|
|
346
345
|
);
|
|
347
346
|
Ee.displayName = "BarChart";
|
|
348
|
-
const Ue =
|
|
347
|
+
const Ue = te.forwardRef(
|
|
349
348
|
({
|
|
350
349
|
data: t,
|
|
351
|
-
xKey:
|
|
352
|
-
series:
|
|
350
|
+
xKey: a,
|
|
351
|
+
series: o,
|
|
353
352
|
curved: y = !1,
|
|
354
|
-
showDots:
|
|
353
|
+
showDots: m = !1,
|
|
355
354
|
dotSize: x = 4,
|
|
356
|
-
strokeWidth:
|
|
355
|
+
strokeWidth: c = 2,
|
|
357
356
|
height: M = 300,
|
|
358
|
-
showGrid:
|
|
357
|
+
showGrid: z = !0,
|
|
359
358
|
showTooltip: N = !0,
|
|
360
359
|
showLegend: A = !1,
|
|
361
360
|
animate: k = !0,
|
|
362
|
-
xLabel:
|
|
363
|
-
yLabel:
|
|
361
|
+
xLabel: j,
|
|
362
|
+
yLabel: P,
|
|
364
363
|
className: R,
|
|
365
|
-
...
|
|
366
|
-
},
|
|
367
|
-
const { tooltip:
|
|
368
|
-
return /* @__PURE__ */
|
|
369
|
-
|
|
364
|
+
...X
|
|
365
|
+
}, E) => {
|
|
366
|
+
const { tooltip: W, show: U, hide: I } = fe(), T = oe(), B = k && !T, q = o.map((d, w) => re(d.color, w));
|
|
367
|
+
return /* @__PURE__ */ p(
|
|
368
|
+
ne.div,
|
|
370
369
|
{
|
|
371
|
-
ref:
|
|
372
|
-
className:
|
|
373
|
-
...
|
|
374
|
-
...
|
|
370
|
+
ref: E,
|
|
371
|
+
className: Q("relative", R),
|
|
372
|
+
...B ? { initial: { opacity: 0, scale: 0.96 }, animate: { opacity: 1, scale: 1 }, transition: le.fade } : {},
|
|
373
|
+
...se(X),
|
|
375
374
|
children: [
|
|
376
|
-
/* @__PURE__ */ e(
|
|
377
|
-
const
|
|
375
|
+
/* @__PURE__ */ e(xe, { height: M, children: ({ width: d, height: w, margin: b }) => {
|
|
376
|
+
const i = t.map((r) => r[a]), V = i.every((r) => typeof r == "number");
|
|
378
377
|
let $, L;
|
|
379
|
-
if (
|
|
380
|
-
const r =
|
|
381
|
-
$ =
|
|
378
|
+
if (V) {
|
|
379
|
+
const r = i, f = Math.min(...r), S = Math.max(...r), G = ae().domain([f, S]).range([0, d]);
|
|
380
|
+
$ = G, L = (C) => G(Number(C[a]));
|
|
382
381
|
} else {
|
|
383
|
-
const r =
|
|
384
|
-
$ =
|
|
382
|
+
const r = i.map(String), f = Ce().domain(r).range([0, d]).padding(0.5);
|
|
383
|
+
$ = f, L = (S) => f(String(S[a])) ?? 0;
|
|
385
384
|
}
|
|
386
385
|
const u = t.flatMap(
|
|
387
|
-
(r) =>
|
|
388
|
-
), s = Math.max(...u), l =
|
|
389
|
-
return /* @__PURE__ */
|
|
390
|
-
|
|
391
|
-
|
|
386
|
+
(r) => o.map((f) => Number(r[f.key]) || 0)
|
|
387
|
+
), s = Math.max(...u), l = ae().domain([0, s * 1.1]).range([w, 0]).nice(), g = y ? ue : Ae, n = me().curve(g).defined((r) => r != null);
|
|
388
|
+
return /* @__PURE__ */ p(ee, { children: [
|
|
389
|
+
z && /* @__PURE__ */ e(
|
|
390
|
+
he,
|
|
392
391
|
{
|
|
393
|
-
width:
|
|
394
|
-
height:
|
|
392
|
+
width: d,
|
|
393
|
+
height: w,
|
|
395
394
|
yScale: l,
|
|
396
395
|
horizontal: !0
|
|
397
396
|
}
|
|
398
397
|
),
|
|
399
|
-
|
|
400
|
-
const
|
|
401
|
-
return /* @__PURE__ */
|
|
398
|
+
o.map((r, f) => {
|
|
399
|
+
const G = n.x((C) => L(C)).y((C) => l(Number(C[r.key]) || 0))(t) ?? "";
|
|
400
|
+
return /* @__PURE__ */ p("g", { children: [
|
|
402
401
|
/* @__PURE__ */ e(
|
|
403
402
|
"path",
|
|
404
403
|
{
|
|
405
|
-
d:
|
|
404
|
+
d: G,
|
|
406
405
|
fill: "none",
|
|
407
|
-
stroke:
|
|
408
|
-
strokeWidth:
|
|
406
|
+
stroke: q[f],
|
|
407
|
+
strokeWidth: c,
|
|
409
408
|
strokeLinejoin: "round",
|
|
410
409
|
strokeLinecap: "round"
|
|
411
410
|
}
|
|
412
411
|
),
|
|
413
|
-
|
|
414
|
-
const
|
|
412
|
+
m && t.map((C, J) => {
|
|
413
|
+
const h = L(C), v = l(Number(C[r.key]) || 0);
|
|
415
414
|
return /* @__PURE__ */ e(
|
|
416
415
|
"circle",
|
|
417
416
|
{
|
|
418
|
-
cx:
|
|
417
|
+
cx: h,
|
|
419
418
|
cy: v,
|
|
420
419
|
r: x,
|
|
421
|
-
fill:
|
|
420
|
+
fill: q[f],
|
|
422
421
|
className: "transition-opacity hover:opacity-80"
|
|
423
422
|
},
|
|
424
|
-
`${r.key}-dot-${
|
|
423
|
+
`${r.key}-dot-${J}`
|
|
425
424
|
);
|
|
426
425
|
})
|
|
427
426
|
] }, r.key);
|
|
428
427
|
}),
|
|
429
|
-
N && t.map((r,
|
|
430
|
-
const
|
|
428
|
+
N && t.map((r, f) => {
|
|
429
|
+
const S = L(r), G = d / Math.max(t.length - 1, 1);
|
|
431
430
|
return /* @__PURE__ */ e(
|
|
432
431
|
"rect",
|
|
433
432
|
{
|
|
434
|
-
x:
|
|
433
|
+
x: S - G / 2,
|
|
435
434
|
y: 0,
|
|
436
|
-
width:
|
|
437
|
-
height:
|
|
435
|
+
width: G,
|
|
436
|
+
height: w,
|
|
438
437
|
fill: "transparent",
|
|
439
438
|
onMouseMove: (C) => {
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
C.
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
/* @__PURE__ */
|
|
447
|
-
a.map((v, P) => /* @__PURE__ */ g(
|
|
439
|
+
const J = C.currentTarget.closest("div")?.getBoundingClientRect();
|
|
440
|
+
U(
|
|
441
|
+
C.clientX - (J?.left ?? 0),
|
|
442
|
+
C.clientY - (J?.top ?? 0),
|
|
443
|
+
/* @__PURE__ */ p("div", { children: [
|
|
444
|
+
/* @__PURE__ */ e("div", { className: "font-medium", children: String(r[a]) }),
|
|
445
|
+
o.map((h, v) => /* @__PURE__ */ p(
|
|
448
446
|
"div",
|
|
449
447
|
{
|
|
450
448
|
className: "flex items-center gap-ds-02",
|
|
@@ -453,46 +451,46 @@ const Ue = ne.forwardRef(
|
|
|
453
451
|
"span",
|
|
454
452
|
{
|
|
455
453
|
className: "inline-block h-2 w-2 rounded-ds-full",
|
|
456
|
-
style: { backgroundColor:
|
|
454
|
+
style: { backgroundColor: q[v] }
|
|
457
455
|
}
|
|
458
456
|
),
|
|
459
|
-
/* @__PURE__ */
|
|
460
|
-
|
|
457
|
+
/* @__PURE__ */ p("span", { className: "text-surface-fg-muted", children: [
|
|
458
|
+
h.label,
|
|
461
459
|
":"
|
|
462
460
|
] }),
|
|
463
461
|
" ",
|
|
464
|
-
Number(r[
|
|
462
|
+
Number(r[h.key]).toLocaleString()
|
|
465
463
|
]
|
|
466
464
|
},
|
|
467
|
-
|
|
465
|
+
h.key
|
|
468
466
|
))
|
|
469
467
|
] })
|
|
470
468
|
);
|
|
471
469
|
},
|
|
472
|
-
onMouseLeave:
|
|
470
|
+
onMouseLeave: I
|
|
473
471
|
},
|
|
474
|
-
`hover-${
|
|
472
|
+
`hover-${f}`
|
|
475
473
|
);
|
|
476
474
|
}),
|
|
477
475
|
/* @__PURE__ */ e(
|
|
478
|
-
|
|
476
|
+
K,
|
|
479
477
|
{
|
|
480
478
|
scale: $,
|
|
481
479
|
orientation: "bottom",
|
|
482
|
-
transform: `translate(0,${
|
|
483
|
-
label:
|
|
480
|
+
transform: `translate(0,${w})`,
|
|
481
|
+
label: j
|
|
484
482
|
}
|
|
485
483
|
),
|
|
486
|
-
/* @__PURE__ */ e(
|
|
484
|
+
/* @__PURE__ */ e(K, { scale: l, orientation: "left", label: P })
|
|
487
485
|
] });
|
|
488
486
|
} }),
|
|
489
|
-
N && /* @__PURE__ */ e(
|
|
490
|
-
A &&
|
|
487
|
+
N && /* @__PURE__ */ e(ie, { state: W }),
|
|
488
|
+
A && o.length > 1 && /* @__PURE__ */ e(
|
|
491
489
|
ce,
|
|
492
490
|
{
|
|
493
|
-
items:
|
|
494
|
-
label:
|
|
495
|
-
color:
|
|
491
|
+
items: o.map((d, w) => ({
|
|
492
|
+
label: d.label,
|
|
493
|
+
color: q[w]
|
|
496
494
|
})),
|
|
497
495
|
className: "mt-ds-04"
|
|
498
496
|
}
|
|
@@ -503,74 +501,73 @@ const Ue = ne.forwardRef(
|
|
|
503
501
|
}
|
|
504
502
|
);
|
|
505
503
|
Ue.displayName = "LineChart";
|
|
506
|
-
const Ze =
|
|
504
|
+
const Ze = te.forwardRef(
|
|
507
505
|
({
|
|
508
506
|
data: t,
|
|
509
|
-
xKey:
|
|
510
|
-
series:
|
|
507
|
+
xKey: a,
|
|
508
|
+
series: o,
|
|
511
509
|
curved: y = !1,
|
|
512
|
-
stacked:
|
|
510
|
+
stacked: m = !1,
|
|
513
511
|
fillOpacity: x = 0.3,
|
|
514
|
-
gradient:
|
|
512
|
+
gradient: c = !1,
|
|
515
513
|
strokeWidth: M = 2,
|
|
516
|
-
height:
|
|
514
|
+
height: z = 300,
|
|
517
515
|
showGrid: N = !0,
|
|
518
516
|
showTooltip: A = !0,
|
|
519
517
|
showLegend: k = !1,
|
|
520
|
-
animate:
|
|
521
|
-
xLabel:
|
|
518
|
+
animate: j = !0,
|
|
519
|
+
xLabel: P,
|
|
522
520
|
yLabel: R,
|
|
523
|
-
className:
|
|
524
|
-
...
|
|
525
|
-
},
|
|
526
|
-
const { tooltip:
|
|
527
|
-
return /* @__PURE__ */
|
|
528
|
-
|
|
521
|
+
className: X,
|
|
522
|
+
...E
|
|
523
|
+
}, W) => {
|
|
524
|
+
const { tooltip: U, show: I, hide: T } = fe(), B = oe(), q = j && !B, d = o.map((b, i) => re(b.color, i)), w = te.useId();
|
|
525
|
+
return /* @__PURE__ */ p(
|
|
526
|
+
ne.div,
|
|
529
527
|
{
|
|
530
|
-
ref:
|
|
531
|
-
className:
|
|
532
|
-
...
|
|
533
|
-
...
|
|
528
|
+
ref: W,
|
|
529
|
+
className: Q("relative", X),
|
|
530
|
+
...q ? { initial: { opacity: 0, scale: 0.96 }, animate: { opacity: 1, scale: 1 }, transition: le.fade } : {},
|
|
531
|
+
...se(E),
|
|
534
532
|
children: [
|
|
535
|
-
/* @__PURE__ */ e(
|
|
536
|
-
const $ = t.map((
|
|
533
|
+
/* @__PURE__ */ e(xe, { height: z, children: ({ width: b, height: i, margin: V }) => {
|
|
534
|
+
const $ = t.map((h) => h[a]), L = $.every((h) => typeof h == "number");
|
|
537
535
|
let u, s, l;
|
|
538
536
|
if (L) {
|
|
539
|
-
const
|
|
540
|
-
u =
|
|
537
|
+
const h = $, v = Math.min(...h), _ = Math.max(...h), Y = ae().domain([v, _]).range([0, b]);
|
|
538
|
+
u = Y, s = (F) => Y(Number(F[a])), l = (F) => Y(Number(t[F][a]));
|
|
541
539
|
} else {
|
|
542
|
-
const
|
|
543
|
-
u = v, s = (
|
|
540
|
+
const h = $.map(String), v = Ce().domain(h).range([0, b]).padding(0.5);
|
|
541
|
+
u = v, s = (_) => v(String(_[a])) ?? 0, l = (_) => v(String(t[_][a])) ?? 0;
|
|
544
542
|
}
|
|
545
|
-
let
|
|
546
|
-
|
|
543
|
+
let g;
|
|
544
|
+
m ? g = Math.max(
|
|
547
545
|
...t.map(
|
|
548
|
-
(
|
|
546
|
+
(h) => o.reduce((v, _) => v + (Number(h[_.key]) || 0), 0)
|
|
549
547
|
)
|
|
550
|
-
) :
|
|
548
|
+
) : g = Math.max(
|
|
551
549
|
...t.flatMap(
|
|
552
|
-
(
|
|
550
|
+
(h) => o.map((v) => Number(h[v.key]) || 0)
|
|
553
551
|
)
|
|
554
552
|
);
|
|
555
|
-
const n =
|
|
556
|
-
const
|
|
553
|
+
const n = ae().domain([0, g * 1.1]).range([i, 0]).nice(), r = y ? ue : Ae, f = () => t.map((h, v) => {
|
|
554
|
+
const _ = s(h), Y = b / Math.max(t.length - 1, 1);
|
|
557
555
|
return /* @__PURE__ */ e(
|
|
558
556
|
"rect",
|
|
559
557
|
{
|
|
560
|
-
x:
|
|
558
|
+
x: _ - Y / 2,
|
|
561
559
|
y: 0,
|
|
562
|
-
width:
|
|
563
|
-
height:
|
|
560
|
+
width: Y,
|
|
561
|
+
height: i,
|
|
564
562
|
fill: "transparent",
|
|
565
|
-
onMouseMove: (
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
/* @__PURE__ */
|
|
573
|
-
a.map((F, Y) => /* @__PURE__ */ g(
|
|
563
|
+
onMouseMove: (F) => {
|
|
564
|
+
const H = F.currentTarget.closest("div")?.getBoundingClientRect();
|
|
565
|
+
I(
|
|
566
|
+
F.clientX - (H?.left ?? 0),
|
|
567
|
+
F.clientY - (H?.top ?? 0),
|
|
568
|
+
/* @__PURE__ */ p("div", { children: [
|
|
569
|
+
/* @__PURE__ */ e("div", { className: "font-medium", children: String(h[a]) }),
|
|
570
|
+
o.map((D, Z) => /* @__PURE__ */ p(
|
|
574
571
|
"div",
|
|
575
572
|
{
|
|
576
573
|
className: "flex items-center gap-ds-02",
|
|
@@ -579,30 +576,30 @@ const Ze = ne.forwardRef(
|
|
|
579
576
|
"span",
|
|
580
577
|
{
|
|
581
578
|
className: "inline-block h-2 w-2 rounded-ds-full",
|
|
582
|
-
style: { backgroundColor:
|
|
579
|
+
style: { backgroundColor: d[Z] }
|
|
583
580
|
}
|
|
584
581
|
),
|
|
585
|
-
/* @__PURE__ */
|
|
586
|
-
|
|
582
|
+
/* @__PURE__ */ p("span", { className: "text-surface-fg-muted", children: [
|
|
583
|
+
D.label,
|
|
587
584
|
":"
|
|
588
585
|
] }),
|
|
589
586
|
" ",
|
|
590
|
-
Number(
|
|
587
|
+
Number(h[D.key]).toLocaleString()
|
|
591
588
|
]
|
|
592
589
|
},
|
|
593
|
-
|
|
590
|
+
D.key
|
|
594
591
|
))
|
|
595
592
|
] })
|
|
596
593
|
);
|
|
597
594
|
},
|
|
598
|
-
onMouseLeave:
|
|
595
|
+
onMouseLeave: T
|
|
599
596
|
},
|
|
600
597
|
`hover-${v}`
|
|
601
598
|
);
|
|
602
|
-
}),
|
|
599
|
+
}), S = () => c ? /* @__PURE__ */ e("defs", { children: o.map((h, v) => /* @__PURE__ */ p(
|
|
603
600
|
"linearGradient",
|
|
604
601
|
{
|
|
605
|
-
id: `${
|
|
602
|
+
id: `${w}-gradient-${v}`,
|
|
606
603
|
x1: "0",
|
|
607
604
|
y1: "0",
|
|
608
605
|
x2: "0",
|
|
@@ -612,7 +609,7 @@ const Ze = ne.forwardRef(
|
|
|
612
609
|
"stop",
|
|
613
610
|
{
|
|
614
611
|
offset: "0%",
|
|
615
|
-
stopColor:
|
|
612
|
+
stopColor: d[v],
|
|
616
613
|
stopOpacity: x
|
|
617
614
|
}
|
|
618
615
|
),
|
|
@@ -620,118 +617,118 @@ const Ze = ne.forwardRef(
|
|
|
620
617
|
"stop",
|
|
621
618
|
{
|
|
622
619
|
offset: "100%",
|
|
623
|
-
stopColor:
|
|
620
|
+
stopColor: d[v],
|
|
624
621
|
stopOpacity: 0.05
|
|
625
622
|
}
|
|
626
623
|
)
|
|
627
624
|
]
|
|
628
625
|
},
|
|
629
626
|
`grad-${v}`
|
|
630
|
-
)) }) : null,
|
|
627
|
+
)) }) : null, G = () => /* @__PURE__ */ p(ee, { children: [
|
|
631
628
|
/* @__PURE__ */ e(
|
|
632
|
-
|
|
629
|
+
K,
|
|
633
630
|
{
|
|
634
631
|
scale: u,
|
|
635
632
|
orientation: "bottom",
|
|
636
|
-
transform: `translate(0,${
|
|
637
|
-
label:
|
|
633
|
+
transform: `translate(0,${i})`,
|
|
634
|
+
label: P
|
|
638
635
|
}
|
|
639
636
|
),
|
|
640
|
-
/* @__PURE__ */ e(
|
|
637
|
+
/* @__PURE__ */ e(K, { scale: n, orientation: "left", label: R })
|
|
641
638
|
] });
|
|
642
|
-
if (
|
|
643
|
-
const
|
|
644
|
-
const
|
|
645
|
-
for (const
|
|
646
|
-
|
|
647
|
-
return
|
|
648
|
-
}),
|
|
649
|
-
return /* @__PURE__ */
|
|
650
|
-
|
|
639
|
+
if (m) {
|
|
640
|
+
const h = o.map((D) => D.key), v = _e().keys(h).order(je).offset(Te), _ = t.map((D) => {
|
|
641
|
+
const Z = { [a]: String(D[a]) };
|
|
642
|
+
for (const O of o)
|
|
643
|
+
Z[O.key] = Number(D[O.key]) || 0;
|
|
644
|
+
return Z;
|
|
645
|
+
}), Y = v(_), F = Me().curve(r).x((D, Z) => l(Z)).y0((D) => n(D[0])).y1((D) => n(D[1])), H = me().curve(r).x((D, Z) => l(Z)).y((D) => n(D[1]));
|
|
646
|
+
return /* @__PURE__ */ p(ee, { children: [
|
|
647
|
+
S(),
|
|
651
648
|
N && /* @__PURE__ */ e(
|
|
652
|
-
|
|
649
|
+
he,
|
|
653
650
|
{
|
|
654
651
|
width: b,
|
|
655
|
-
height:
|
|
652
|
+
height: i,
|
|
656
653
|
yScale: n,
|
|
657
654
|
horizontal: !0
|
|
658
655
|
}
|
|
659
656
|
),
|
|
660
|
-
[...
|
|
661
|
-
const
|
|
662
|
-
return /* @__PURE__ */
|
|
657
|
+
[...Y].reverse().map((D, Z) => {
|
|
658
|
+
const O = Y.length - 1 - Z, Ne = D, Le = F(Ne) ?? "", Se = H(Ne) ?? "", we = c ? `url(#${w}-gradient-${O})` : d[O];
|
|
659
|
+
return /* @__PURE__ */ p("g", { children: [
|
|
663
660
|
/* @__PURE__ */ e(
|
|
664
661
|
"path",
|
|
665
662
|
{
|
|
666
|
-
d:
|
|
667
|
-
fill:
|
|
668
|
-
opacity:
|
|
663
|
+
d: Le,
|
|
664
|
+
fill: we,
|
|
665
|
+
opacity: c ? 1 : x
|
|
669
666
|
}
|
|
670
667
|
),
|
|
671
668
|
/* @__PURE__ */ e(
|
|
672
669
|
"path",
|
|
673
670
|
{
|
|
674
|
-
d:
|
|
671
|
+
d: Se,
|
|
675
672
|
fill: "none",
|
|
676
|
-
stroke:
|
|
673
|
+
stroke: d[O],
|
|
677
674
|
strokeWidth: M,
|
|
678
675
|
strokeLinejoin: "round",
|
|
679
676
|
strokeLinecap: "round"
|
|
680
677
|
}
|
|
681
678
|
)
|
|
682
|
-
] },
|
|
679
|
+
] }, o[O].key);
|
|
683
680
|
}),
|
|
684
|
-
A &&
|
|
685
|
-
|
|
681
|
+
A && f(),
|
|
682
|
+
G()
|
|
686
683
|
] });
|
|
687
684
|
}
|
|
688
|
-
const C =
|
|
689
|
-
return /* @__PURE__ */
|
|
690
|
-
|
|
685
|
+
const C = Me().curve(r).defined((h) => h != null), J = me().curve(r).defined((h) => h != null);
|
|
686
|
+
return /* @__PURE__ */ p(ee, { children: [
|
|
687
|
+
S(),
|
|
691
688
|
N && /* @__PURE__ */ e(
|
|
692
|
-
|
|
689
|
+
he,
|
|
693
690
|
{
|
|
694
691
|
width: b,
|
|
695
|
-
height:
|
|
692
|
+
height: i,
|
|
696
693
|
yScale: n,
|
|
697
694
|
horizontal: !0
|
|
698
695
|
}
|
|
699
696
|
),
|
|
700
|
-
[...
|
|
701
|
-
const
|
|
702
|
-
return /* @__PURE__ */
|
|
697
|
+
[...o].reverse().map((h, v) => {
|
|
698
|
+
const _ = o.length - 1 - v, Y = C.x((O) => s(O)).y0(i).y1((O) => n(Number(O[h.key]) || 0)), F = J.x((O) => s(O)).y((O) => n(Number(O[h.key]) || 0)), H = Y(t) ?? "", D = F(t) ?? "", Z = c ? `url(#${w}-gradient-${_})` : d[_];
|
|
699
|
+
return /* @__PURE__ */ p("g", { children: [
|
|
703
700
|
/* @__PURE__ */ e(
|
|
704
701
|
"path",
|
|
705
702
|
{
|
|
706
|
-
d:
|
|
707
|
-
fill:
|
|
708
|
-
opacity:
|
|
703
|
+
d: H,
|
|
704
|
+
fill: Z,
|
|
705
|
+
opacity: c ? 1 : x
|
|
709
706
|
}
|
|
710
707
|
),
|
|
711
708
|
/* @__PURE__ */ e(
|
|
712
709
|
"path",
|
|
713
710
|
{
|
|
714
|
-
d:
|
|
711
|
+
d: D,
|
|
715
712
|
fill: "none",
|
|
716
|
-
stroke:
|
|
713
|
+
stroke: d[_],
|
|
717
714
|
strokeWidth: M,
|
|
718
715
|
strokeLinejoin: "round",
|
|
719
716
|
strokeLinecap: "round"
|
|
720
717
|
}
|
|
721
718
|
)
|
|
722
|
-
] },
|
|
719
|
+
] }, h.key);
|
|
723
720
|
}),
|
|
724
|
-
A &&
|
|
725
|
-
|
|
721
|
+
A && f(),
|
|
722
|
+
G()
|
|
726
723
|
] });
|
|
727
724
|
} }),
|
|
728
|
-
A && /* @__PURE__ */ e(
|
|
729
|
-
k &&
|
|
725
|
+
A && /* @__PURE__ */ e(ie, { state: U }),
|
|
726
|
+
k && o.length > 1 && /* @__PURE__ */ e(
|
|
730
727
|
ce,
|
|
731
728
|
{
|
|
732
|
-
items:
|
|
729
|
+
items: o.map((b, i) => ({
|
|
733
730
|
label: b.label,
|
|
734
|
-
color:
|
|
731
|
+
color: d[i]
|
|
735
732
|
})),
|
|
736
733
|
className: "mt-ds-04"
|
|
737
734
|
}
|
|
@@ -742,78 +739,77 @@ const Ze = ne.forwardRef(
|
|
|
742
739
|
}
|
|
743
740
|
);
|
|
744
741
|
Ze.displayName = "AreaChart";
|
|
745
|
-
const qe =
|
|
742
|
+
const qe = te.forwardRef(
|
|
746
743
|
({
|
|
747
744
|
data: t,
|
|
748
|
-
variant:
|
|
749
|
-
innerRadius:
|
|
745
|
+
variant: a = "pie",
|
|
746
|
+
innerRadius: o = 0.6,
|
|
750
747
|
padAngle: y = 0,
|
|
751
|
-
cornerRadius:
|
|
748
|
+
cornerRadius: m = 0,
|
|
752
749
|
height: x = 300,
|
|
753
|
-
showTooltip:
|
|
750
|
+
showTooltip: c = !0,
|
|
754
751
|
showLegend: M = !1,
|
|
755
|
-
showLabels:
|
|
752
|
+
showLabels: z = !1,
|
|
756
753
|
animate: N = !0,
|
|
757
754
|
className: A,
|
|
758
755
|
centerLabel: k,
|
|
759
|
-
...
|
|
760
|
-
},
|
|
761
|
-
const R =
|
|
762
|
-
|
|
756
|
+
...j
|
|
757
|
+
}, P) => {
|
|
758
|
+
const R = ve(null), [X, E] = de(0), [W, U] = de(null), { tooltip: I, show: T, hide: B } = fe(), q = oe(), d = N && !q;
|
|
759
|
+
ye(() => {
|
|
763
760
|
if (!R.current) return;
|
|
764
761
|
const n = new ResizeObserver((r) => {
|
|
765
|
-
const
|
|
766
|
-
|
|
762
|
+
const f = r[0];
|
|
763
|
+
f && E(f.contentRect.width);
|
|
767
764
|
});
|
|
768
765
|
return n.observe(R.current), () => n.disconnect();
|
|
769
766
|
}, []);
|
|
770
|
-
const b = (
|
|
771
|
-
return /* @__PURE__ */
|
|
772
|
-
|
|
767
|
+
const b = (X > 0 ? Math.min(X, x) : x) / 2, i = a === "donut" ? b * o : 0, V = t.map((n, r) => re(n.color, r)), $ = t.reduce((n, r) => n + r.value, 0), u = Ye().value((n) => n.value).padAngle(y).sort(null)(t), s = ge().innerRadius(i).outerRadius(b - 2).cornerRadius(m), l = i + (b - 2 - i) * 0.7, g = ge().innerRadius(l).outerRadius(l);
|
|
768
|
+
return /* @__PURE__ */ p(
|
|
769
|
+
ne.div,
|
|
773
770
|
{
|
|
774
771
|
ref: (n) => {
|
|
775
|
-
R.current = n, typeof
|
|
772
|
+
R.current = n, typeof P == "function" ? P(n) : P && (P.current = n);
|
|
776
773
|
},
|
|
777
|
-
className:
|
|
778
|
-
...
|
|
779
|
-
...
|
|
774
|
+
className: Q("relative w-full", A),
|
|
775
|
+
...d ? { initial: { opacity: 0, scale: 0.96 }, animate: { opacity: 1, scale: 1 }, transition: le.fade } : {},
|
|
776
|
+
...se(j),
|
|
780
777
|
children: [
|
|
781
|
-
|
|
778
|
+
X > 0 && /* @__PURE__ */ p(ee, { children: [
|
|
782
779
|
/* @__PURE__ */ e(
|
|
783
780
|
"svg",
|
|
784
781
|
{
|
|
785
|
-
width:
|
|
782
|
+
width: X,
|
|
786
783
|
height: x,
|
|
787
784
|
role: "img",
|
|
788
785
|
"aria-label": "Pie chart",
|
|
789
|
-
children: /* @__PURE__ */
|
|
786
|
+
children: /* @__PURE__ */ p("g", { transform: `translate(${X / 2},${x / 2})`, children: [
|
|
790
787
|
u.map((n, r) => {
|
|
791
|
-
const
|
|
792
|
-
if (!
|
|
793
|
-
const [
|
|
788
|
+
const f = s(n);
|
|
789
|
+
if (!f) return null;
|
|
790
|
+
const [S, G] = s.centroid(n), C = Math.atan2(G, S), J = Math.cos(C) * 4, h = Math.sin(C) * 4, v = W === r;
|
|
794
791
|
return /* @__PURE__ */ e(
|
|
795
792
|
"path",
|
|
796
793
|
{
|
|
797
|
-
d,
|
|
798
|
-
fill:
|
|
794
|
+
d: f,
|
|
795
|
+
fill: V[r],
|
|
799
796
|
className: "cursor-pointer transition-transform",
|
|
800
797
|
style: {
|
|
801
|
-
transform: v ? `translate(${
|
|
798
|
+
transform: v ? `translate(${J}px, ${h}px)` : void 0
|
|
802
799
|
},
|
|
803
|
-
onMouseEnter: () =>
|
|
804
|
-
onMouseMove: (
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
/* @__PURE__ */ g("div", { children: [
|
|
800
|
+
onMouseEnter: () => U(r),
|
|
801
|
+
onMouseMove: (_) => {
|
|
802
|
+
if (c) {
|
|
803
|
+
const Y = _.currentTarget.closest("div")?.getBoundingClientRect(), F = $ > 0 ? (n.data.value / $ * 100).toFixed(1) : "0";
|
|
804
|
+
T(
|
|
805
|
+
_.clientX - (Y?.left ?? 0),
|
|
806
|
+
_.clientY - (Y?.top ?? 0),
|
|
807
|
+
/* @__PURE__ */ p("div", { children: [
|
|
812
808
|
/* @__PURE__ */ e("div", { className: "font-medium", children: n.data.label }),
|
|
813
|
-
/* @__PURE__ */
|
|
809
|
+
/* @__PURE__ */ p("div", { children: [
|
|
814
810
|
n.data.value.toLocaleString(),
|
|
815
811
|
" (",
|
|
816
|
-
|
|
812
|
+
F,
|
|
817
813
|
"%)"
|
|
818
814
|
] })
|
|
819
815
|
] })
|
|
@@ -821,51 +817,51 @@ const qe = ne.forwardRef(
|
|
|
821
817
|
}
|
|
822
818
|
},
|
|
823
819
|
onMouseLeave: () => {
|
|
824
|
-
|
|
820
|
+
U(null), B();
|
|
825
821
|
}
|
|
826
822
|
},
|
|
827
823
|
`slice-${n.data.label}-${r}`
|
|
828
824
|
);
|
|
829
825
|
}),
|
|
830
|
-
|
|
831
|
-
const [
|
|
832
|
-
return $ > 0 && n.data.value / $ < 0.03 ? null : /* @__PURE__ */
|
|
826
|
+
z && u.map((n, r) => {
|
|
827
|
+
const [f, S] = g.centroid(n), G = $ > 0 ? (n.data.value / $ * 100).toFixed(0) : "0";
|
|
828
|
+
return $ > 0 && n.data.value / $ < 0.03 ? null : /* @__PURE__ */ p(
|
|
833
829
|
"text",
|
|
834
830
|
{
|
|
835
|
-
x:
|
|
836
|
-
y:
|
|
831
|
+
x: f,
|
|
832
|
+
y: S,
|
|
837
833
|
textAnchor: "middle",
|
|
838
834
|
dominantBaseline: "central",
|
|
839
835
|
className: "pointer-events-none fill-accent-fg text-ds-xs font-medium",
|
|
840
836
|
children: [
|
|
841
|
-
|
|
837
|
+
G,
|
|
842
838
|
"%"
|
|
843
839
|
]
|
|
844
840
|
},
|
|
845
841
|
`label-${n.data.label}-${r}`
|
|
846
842
|
);
|
|
847
843
|
}),
|
|
848
|
-
|
|
844
|
+
a === "donut" && k && i > 0 && /* @__PURE__ */ e(
|
|
849
845
|
"foreignObject",
|
|
850
846
|
{
|
|
851
|
-
x: -
|
|
852
|
-
y: -
|
|
853
|
-
width:
|
|
854
|
-
height:
|
|
847
|
+
x: -i * 0.7,
|
|
848
|
+
y: -i * 0.7,
|
|
849
|
+
width: i * 1.4,
|
|
850
|
+
height: i * 1.4,
|
|
855
851
|
children: /* @__PURE__ */ e("div", { className: "flex h-full w-full items-center justify-center text-center text-surface-fg", children: k })
|
|
856
852
|
}
|
|
857
853
|
)
|
|
858
854
|
] })
|
|
859
855
|
}
|
|
860
856
|
),
|
|
861
|
-
|
|
857
|
+
c && /* @__PURE__ */ e(ie, { state: I })
|
|
862
858
|
] }),
|
|
863
859
|
M && /* @__PURE__ */ e(
|
|
864
860
|
ce,
|
|
865
861
|
{
|
|
866
862
|
items: t.map((n, r) => ({
|
|
867
863
|
label: n.label,
|
|
868
|
-
color:
|
|
864
|
+
color: V[r]
|
|
869
865
|
})),
|
|
870
866
|
className: "mt-ds-04"
|
|
871
867
|
}
|
|
@@ -876,47 +872,47 @@ const qe = ne.forwardRef(
|
|
|
876
872
|
}
|
|
877
873
|
);
|
|
878
874
|
qe.displayName = "PieChart";
|
|
879
|
-
const $e = { duration: 1, ease: "easeOut" }, Je =
|
|
875
|
+
const $e = { duration: 1, ease: "easeOut" }, Je = te.forwardRef(
|
|
880
876
|
({
|
|
881
877
|
data: t,
|
|
882
|
-
variant:
|
|
883
|
-
width:
|
|
878
|
+
variant: a = "line",
|
|
879
|
+
width: o = 120,
|
|
884
880
|
height: y = 32,
|
|
885
|
-
color:
|
|
881
|
+
color: m,
|
|
886
882
|
showLastDot: x = !1,
|
|
887
|
-
strokeWidth:
|
|
883
|
+
strokeWidth: c = 1.5,
|
|
888
884
|
animate: M = !0,
|
|
889
|
-
className:
|
|
885
|
+
className: z,
|
|
890
886
|
...N
|
|
891
887
|
}, A) => {
|
|
892
|
-
const k =
|
|
888
|
+
const k = re(m, 0), j = oe(), P = M && !j;
|
|
893
889
|
if (!t.length) return null;
|
|
894
|
-
const R =
|
|
895
|
-
if (
|
|
896
|
-
const
|
|
890
|
+
const R = a === "bar" ? 1 : c, X = o - R * 2, E = y - R * 2, W = ae().domain([0, Math.max(t.length - 1, 1)]).range([R, R + X]), U = Math.min(...t), I = Math.max(...t), T = U === I ? [U - 1, I + 1] : [U, I], B = ae().domain(T).range([R + E, R]);
|
|
891
|
+
if (a === "bar") {
|
|
892
|
+
const V = Math.max(
|
|
897
893
|
1,
|
|
898
|
-
(
|
|
899
|
-
), $ = R +
|
|
894
|
+
(X - 1 * (t.length - 1)) / t.length
|
|
895
|
+
), $ = R + E;
|
|
900
896
|
return /* @__PURE__ */ e(
|
|
901
897
|
"svg",
|
|
902
898
|
{
|
|
903
899
|
ref: A,
|
|
904
|
-
width:
|
|
900
|
+
width: o,
|
|
905
901
|
height: y,
|
|
906
902
|
role: "img",
|
|
907
903
|
"aria-label": "Sparkline bar chart",
|
|
908
|
-
className:
|
|
904
|
+
className: Q("inline-block align-middle", z),
|
|
909
905
|
...N,
|
|
910
906
|
children: t.map((L, u) => {
|
|
911
|
-
const s = R + u * (
|
|
907
|
+
const s = R + u * (V + 1), l = B(L), g = Math.max(1, $ - l);
|
|
912
908
|
return /* @__PURE__ */ e(
|
|
913
909
|
"rect",
|
|
914
910
|
{
|
|
915
911
|
x: s,
|
|
916
912
|
y: l,
|
|
917
|
-
width:
|
|
918
|
-
height:
|
|
919
|
-
rx: Math.min(1,
|
|
913
|
+
width: V,
|
|
914
|
+
height: g,
|
|
915
|
+
rx: Math.min(1, V / 2),
|
|
920
916
|
fill: k
|
|
921
917
|
},
|
|
922
918
|
u
|
|
@@ -925,27 +921,27 @@ const $e = { duration: 1, ease: "easeOut" }, Je = ne.forwardRef(
|
|
|
925
921
|
}
|
|
926
922
|
);
|
|
927
923
|
}
|
|
928
|
-
if (
|
|
929
|
-
const
|
|
930
|
-
return /* @__PURE__ */
|
|
924
|
+
if (a === "area") {
|
|
925
|
+
const i = Me().curve(ue).x((l, g) => W(g)).y0(R + E).y1((l) => B(l)), V = me().curve(ue).x((l, g) => W(g)).y((l) => B(l)), $ = i(t) ?? "", L = V(t) ?? "", u = W(t.length - 1), s = B(t[t.length - 1]);
|
|
926
|
+
return /* @__PURE__ */ p(
|
|
931
927
|
"svg",
|
|
932
928
|
{
|
|
933
929
|
ref: A,
|
|
934
|
-
width:
|
|
930
|
+
width: o,
|
|
935
931
|
height: y,
|
|
936
932
|
role: "img",
|
|
937
933
|
"aria-label": "Sparkline area chart",
|
|
938
|
-
className:
|
|
934
|
+
className: Q("inline-block align-middle", z),
|
|
939
935
|
...N,
|
|
940
936
|
children: [
|
|
941
937
|
/* @__PURE__ */ e("path", { d: $, fill: k, opacity: 0.2 }),
|
|
942
|
-
|
|
943
|
-
|
|
938
|
+
P ? /* @__PURE__ */ e(
|
|
939
|
+
ne.path,
|
|
944
940
|
{
|
|
945
941
|
d: L,
|
|
946
942
|
fill: "none",
|
|
947
943
|
stroke: k,
|
|
948
|
-
strokeWidth:
|
|
944
|
+
strokeWidth: c,
|
|
949
945
|
strokeLinejoin: "round",
|
|
950
946
|
strokeLinecap: "round",
|
|
951
947
|
initial: { pathLength: 0 },
|
|
@@ -958,7 +954,7 @@ const $e = { duration: 1, ease: "easeOut" }, Je = ne.forwardRef(
|
|
|
958
954
|
d: L,
|
|
959
955
|
fill: "none",
|
|
960
956
|
stroke: k,
|
|
961
|
-
strokeWidth:
|
|
957
|
+
strokeWidth: c,
|
|
962
958
|
strokeLinejoin: "round",
|
|
963
959
|
strokeLinecap: "round"
|
|
964
960
|
}
|
|
@@ -968,7 +964,7 @@ const $e = { duration: 1, ease: "easeOut" }, Je = ne.forwardRef(
|
|
|
968
964
|
{
|
|
969
965
|
cx: u,
|
|
970
966
|
cy: s,
|
|
971
|
-
r:
|
|
967
|
+
r: c + 1,
|
|
972
968
|
fill: k
|
|
973
969
|
}
|
|
974
970
|
)
|
|
@@ -976,25 +972,25 @@ const $e = { duration: 1, ease: "easeOut" }, Je = ne.forwardRef(
|
|
|
976
972
|
}
|
|
977
973
|
);
|
|
978
974
|
}
|
|
979
|
-
const
|
|
980
|
-
return /* @__PURE__ */
|
|
975
|
+
const d = me().curve(ue).x((i, V) => W(V)).y((i) => B(i))(t) ?? "", w = W(t.length - 1), b = B(t[t.length - 1]);
|
|
976
|
+
return /* @__PURE__ */ p(
|
|
981
977
|
"svg",
|
|
982
978
|
{
|
|
983
979
|
ref: A,
|
|
984
|
-
width:
|
|
980
|
+
width: o,
|
|
985
981
|
height: y,
|
|
986
982
|
role: "img",
|
|
987
983
|
"aria-label": "Sparkline chart",
|
|
988
|
-
className:
|
|
984
|
+
className: Q("inline-block align-middle", z),
|
|
989
985
|
...N,
|
|
990
986
|
children: [
|
|
991
|
-
|
|
992
|
-
|
|
987
|
+
P ? /* @__PURE__ */ e(
|
|
988
|
+
ne.path,
|
|
993
989
|
{
|
|
994
|
-
d
|
|
990
|
+
d,
|
|
995
991
|
fill: "none",
|
|
996
992
|
stroke: k,
|
|
997
|
-
strokeWidth:
|
|
993
|
+
strokeWidth: c,
|
|
998
994
|
strokeLinejoin: "round",
|
|
999
995
|
strokeLinecap: "round",
|
|
1000
996
|
initial: { pathLength: 0 },
|
|
@@ -1004,10 +1000,10 @@ const $e = { duration: 1, ease: "easeOut" }, Je = ne.forwardRef(
|
|
|
1004
1000
|
) : /* @__PURE__ */ e(
|
|
1005
1001
|
"path",
|
|
1006
1002
|
{
|
|
1007
|
-
d
|
|
1003
|
+
d,
|
|
1008
1004
|
fill: "none",
|
|
1009
1005
|
stroke: k,
|
|
1010
|
-
strokeWidth:
|
|
1006
|
+
strokeWidth: c,
|
|
1011
1007
|
strokeLinejoin: "round",
|
|
1012
1008
|
strokeLinecap: "round"
|
|
1013
1009
|
}
|
|
@@ -1015,9 +1011,9 @@ const $e = { duration: 1, ease: "easeOut" }, Je = ne.forwardRef(
|
|
|
1015
1011
|
x && /* @__PURE__ */ e(
|
|
1016
1012
|
"circle",
|
|
1017
1013
|
{
|
|
1018
|
-
cx:
|
|
1014
|
+
cx: w,
|
|
1019
1015
|
cy: b,
|
|
1020
|
-
r:
|
|
1016
|
+
r: c + 1,
|
|
1021
1017
|
fill: k
|
|
1022
1018
|
}
|
|
1023
1019
|
)
|
|
@@ -1027,44 +1023,44 @@ const $e = { duration: 1, ease: "easeOut" }, Je = ne.forwardRef(
|
|
|
1027
1023
|
}
|
|
1028
1024
|
);
|
|
1029
1025
|
Je.displayName = "Sparkline";
|
|
1030
|
-
const
|
|
1026
|
+
const pe = (t) => t * Math.PI / 180, Qe = te.forwardRef(
|
|
1031
1027
|
({
|
|
1032
1028
|
value: t,
|
|
1033
|
-
max:
|
|
1034
|
-
min:
|
|
1029
|
+
max: a = 100,
|
|
1030
|
+
min: o = 0,
|
|
1035
1031
|
label: y,
|
|
1036
|
-
valueLabel:
|
|
1032
|
+
valueLabel: m,
|
|
1037
1033
|
color: x,
|
|
1038
|
-
trackColor:
|
|
1034
|
+
trackColor: c = "var(--color-surface-border)",
|
|
1039
1035
|
height: M = 200,
|
|
1040
|
-
startAngle:
|
|
1036
|
+
startAngle: z = -120,
|
|
1041
1037
|
endAngle: N = 120,
|
|
1042
1038
|
thickness: A = 16,
|
|
1043
1039
|
animate: k = !0,
|
|
1044
|
-
className:
|
|
1045
|
-
...
|
|
1040
|
+
className: j,
|
|
1041
|
+
...P
|
|
1046
1042
|
}, R) => {
|
|
1047
|
-
const
|
|
1043
|
+
const X = oe(), E = Fe(X, k ? 600 : 0), W = k && !X, U = re(x, 0), I = M, T = I / 2, B = Math.min(Math.max(t, o), a), q = a === o ? 0 : (B - o) / (a - o), d = z + (N - z) * q, w = typeof m == "function" ? m(B) : typeof m == "string" ? m : String(B), b = ge().innerRadius(T - A).outerRadius(T).startAngle(pe(z)).endAngle(pe(N)).cornerRadius(A / 2), i = ge().innerRadius(T - A).outerRadius(T).startAngle(pe(z)).endAngle(pe(d)).cornerRadius(A / 2), V = b(null) ?? "", $ = i(null) ?? "";
|
|
1048
1044
|
return /* @__PURE__ */ e(
|
|
1049
|
-
|
|
1045
|
+
ne.div,
|
|
1050
1046
|
{
|
|
1051
1047
|
ref: R,
|
|
1052
|
-
className:
|
|
1053
|
-
...
|
|
1054
|
-
...
|
|
1048
|
+
className: Q("inline-flex flex-col items-center", j),
|
|
1049
|
+
...W ? { initial: { opacity: 0, scale: 0.96 }, animate: { opacity: 1, scale: 1 }, transition: le.fade } : {},
|
|
1050
|
+
...se(P),
|
|
1055
1051
|
role: "meter",
|
|
1056
|
-
"aria-valuenow":
|
|
1057
|
-
"aria-valuemin":
|
|
1058
|
-
"aria-valuemax":
|
|
1052
|
+
"aria-valuenow": B,
|
|
1053
|
+
"aria-valuemin": o,
|
|
1054
|
+
"aria-valuemax": a,
|
|
1059
1055
|
"aria-label": y ?? "Gauge chart",
|
|
1060
|
-
children: /* @__PURE__ */ e("svg", { width:
|
|
1061
|
-
/* @__PURE__ */ e("path", { d:
|
|
1056
|
+
children: /* @__PURE__ */ e("svg", { width: I, height: I, role: "img", "aria-hidden": "true", children: /* @__PURE__ */ p("g", { transform: `translate(${T},${T})`, children: [
|
|
1057
|
+
/* @__PURE__ */ e("path", { d: V, fill: c }),
|
|
1062
1058
|
/* @__PURE__ */ e(
|
|
1063
1059
|
"path",
|
|
1064
1060
|
{
|
|
1065
1061
|
d: $,
|
|
1066
|
-
fill:
|
|
1067
|
-
style:
|
|
1062
|
+
fill: U,
|
|
1063
|
+
style: E > 0 ? { transition: `d ${E}ms ease-out` } : void 0
|
|
1068
1064
|
}
|
|
1069
1065
|
),
|
|
1070
1066
|
/* @__PURE__ */ e(
|
|
@@ -1075,7 +1071,7 @@ const ge = (t) => t * Math.PI / 180, Qe = ne.forwardRef(
|
|
|
1075
1071
|
textAnchor: "middle",
|
|
1076
1072
|
dominantBaseline: "central",
|
|
1077
1073
|
className: "fill-surface-fg text-ds-2xl font-semibold",
|
|
1078
|
-
children:
|
|
1074
|
+
children: w
|
|
1079
1075
|
}
|
|
1080
1076
|
),
|
|
1081
1077
|
y && /* @__PURE__ */ e(
|
|
@@ -1095,72 +1091,69 @@ const ge = (t) => t * Math.PI / 180, Qe = ne.forwardRef(
|
|
|
1095
1091
|
}
|
|
1096
1092
|
);
|
|
1097
1093
|
Qe.displayName = "GaugeChart";
|
|
1098
|
-
const He =
|
|
1094
|
+
const He = te.forwardRef(
|
|
1099
1095
|
({
|
|
1100
1096
|
data: t,
|
|
1101
|
-
axes:
|
|
1102
|
-
series:
|
|
1097
|
+
axes: a,
|
|
1098
|
+
series: o,
|
|
1103
1099
|
maxValue: y,
|
|
1104
|
-
levels:
|
|
1100
|
+
levels: m = 5,
|
|
1105
1101
|
fillOpacity: x = 0.25,
|
|
1106
|
-
showDots:
|
|
1102
|
+
showDots: c = !1,
|
|
1107
1103
|
height: M = 300,
|
|
1108
|
-
showTooltip:
|
|
1104
|
+
showTooltip: z = !0,
|
|
1109
1105
|
showLegend: N = !1,
|
|
1110
1106
|
animate: A = !0,
|
|
1111
1107
|
className: k,
|
|
1112
|
-
...
|
|
1113
|
-
},
|
|
1114
|
-
const R =
|
|
1115
|
-
|
|
1108
|
+
...j
|
|
1109
|
+
}, P) => {
|
|
1110
|
+
const R = ve(null), [X, E] = de(0), { tooltip: W, show: U, hide: I } = fe(), T = oe(), B = A && !T;
|
|
1111
|
+
ye(() => {
|
|
1116
1112
|
if (!R.current) return;
|
|
1117
1113
|
const u = new ResizeObserver((s) => {
|
|
1118
1114
|
const l = s[0];
|
|
1119
|
-
l &&
|
|
1115
|
+
l && E(l.contentRect.width);
|
|
1120
1116
|
});
|
|
1121
1117
|
return u.observe(R.current), () => u.disconnect();
|
|
1122
1118
|
}, []);
|
|
1123
|
-
const
|
|
1124
|
-
...t.flatMap((u) =>
|
|
1119
|
+
const d = (X > 0 ? Math.min(X, M) : M) / 2 - 40, w = o.map((u, s) => re(u.color, s)), b = y ?? Math.max(
|
|
1120
|
+
...t.flatMap((u) => o.map((s) => Number(u[s.key]) || 0)),
|
|
1125
1121
|
1
|
|
1126
|
-
),
|
|
1127
|
-
|
|
1128
|
-
return Number((p = t[l]) == null ? void 0 : p[u]) || 0;
|
|
1129
|
-
}), L = (u, s) => {
|
|
1130
|
-
const l = c * u - Math.PI / 2, p = h * s / b;
|
|
1122
|
+
), i = 2 * Math.PI / a.length, V = Oe().radius((u) => d * u / b).angle((u, s) => s * i).curve(We), $ = (u) => a.map((s, l) => Number(t[l]?.[u]) || 0), L = (u, s) => {
|
|
1123
|
+
const l = i * u - Math.PI / 2, g = d * s / b;
|
|
1131
1124
|
return {
|
|
1132
|
-
x:
|
|
1133
|
-
y:
|
|
1125
|
+
x: g * Math.cos(l),
|
|
1126
|
+
y: g * Math.sin(l)
|
|
1134
1127
|
};
|
|
1135
1128
|
};
|
|
1136
|
-
return /* @__PURE__ */
|
|
1137
|
-
|
|
1129
|
+
return /* @__PURE__ */ p(
|
|
1130
|
+
ne.div,
|
|
1138
1131
|
{
|
|
1139
1132
|
ref: (u) => {
|
|
1140
|
-
R.current = u, typeof
|
|
1133
|
+
R.current = u, typeof P == "function" ? P(u) : P && (P.current = u);
|
|
1141
1134
|
},
|
|
1142
|
-
className:
|
|
1143
|
-
...
|
|
1144
|
-
...
|
|
1135
|
+
className: Q("relative w-full", k),
|
|
1136
|
+
...B ? { initial: { opacity: 0, scale: 0.96 }, animate: { opacity: 1, scale: 1 }, transition: le.fade } : {},
|
|
1137
|
+
...se(j),
|
|
1145
1138
|
children: [
|
|
1146
|
-
|
|
1139
|
+
X > 0 && /* @__PURE__ */ p(ee, { children: [
|
|
1147
1140
|
/* @__PURE__ */ e(
|
|
1148
1141
|
"svg",
|
|
1149
1142
|
{
|
|
1150
|
-
width:
|
|
1143
|
+
width: X,
|
|
1151
1144
|
height: M,
|
|
1152
1145
|
role: "img",
|
|
1153
1146
|
"aria-label": "Radar chart",
|
|
1154
|
-
children: /* @__PURE__ */
|
|
1155
|
-
Array.from({ length:
|
|
1156
|
-
const l =
|
|
1157
|
-
const
|
|
1158
|
-
return `${l * Math.cos(
|
|
1147
|
+
children: /* @__PURE__ */ p("g", { transform: `translate(${X / 2},${M / 2})`, children: [
|
|
1148
|
+
Array.from({ length: m }, (u, s) => {
|
|
1149
|
+
const l = d / m * (s + 1), g = a.map((n, r) => {
|
|
1150
|
+
const f = i * r - Math.PI / 2;
|
|
1151
|
+
return `${l * Math.cos(f)},${l * Math.sin(f)}`;
|
|
1159
1152
|
}).join(" ");
|
|
1160
1153
|
return /* @__PURE__ */ e(
|
|
1161
1154
|
"polygon",
|
|
1162
1155
|
{
|
|
1163
|
-
points:
|
|
1156
|
+
points: g,
|
|
1164
1157
|
fill: "none",
|
|
1165
1158
|
stroke: "var(--color-surface-border)",
|
|
1166
1159
|
strokeDasharray: "3,3",
|
|
@@ -1169,14 +1162,14 @@ const He = ne.forwardRef(
|
|
|
1169
1162
|
`grid-${s}`
|
|
1170
1163
|
);
|
|
1171
1164
|
}),
|
|
1172
|
-
|
|
1173
|
-
const l =
|
|
1165
|
+
a.map((u, s) => {
|
|
1166
|
+
const l = i * s - Math.PI / 2, g = d * Math.cos(l), n = d * Math.sin(l);
|
|
1174
1167
|
return /* @__PURE__ */ e(
|
|
1175
1168
|
"line",
|
|
1176
1169
|
{
|
|
1177
1170
|
x1: 0,
|
|
1178
1171
|
y1: 0,
|
|
1179
|
-
x2:
|
|
1172
|
+
x2: g,
|
|
1180
1173
|
y2: n,
|
|
1181
1174
|
stroke: "var(--color-surface-border)",
|
|
1182
1175
|
strokeWidth: 1
|
|
@@ -1184,15 +1177,15 @@ const He = ne.forwardRef(
|
|
|
1184
1177
|
`axis-${s}`
|
|
1185
1178
|
);
|
|
1186
1179
|
}),
|
|
1187
|
-
|
|
1188
|
-
const l =
|
|
1189
|
-
let
|
|
1190
|
-
return Math.abs(Math.cos(l)) > 0.1 && (
|
|
1180
|
+
a.map((u, s) => {
|
|
1181
|
+
const l = i * s - Math.PI / 2, g = d + 18, n = g * Math.cos(l), r = g * Math.sin(l);
|
|
1182
|
+
let f = "middle";
|
|
1183
|
+
return Math.abs(Math.cos(l)) > 0.1 && (f = Math.cos(l) > 0 ? "start" : "end"), /* @__PURE__ */ e(
|
|
1191
1184
|
"text",
|
|
1192
1185
|
{
|
|
1193
1186
|
x: n,
|
|
1194
1187
|
y: r,
|
|
1195
|
-
textAnchor:
|
|
1188
|
+
textAnchor: f,
|
|
1196
1189
|
dominantBaseline: "central",
|
|
1197
1190
|
className: "fill-surface-fg-muted text-ds-xs",
|
|
1198
1191
|
children: u
|
|
@@ -1200,13 +1193,13 @@ const He = ne.forwardRef(
|
|
|
1200
1193
|
`label-${s}`
|
|
1201
1194
|
);
|
|
1202
1195
|
}),
|
|
1203
|
-
Array.from({ length:
|
|
1204
|
-
const l = Math.round(b /
|
|
1196
|
+
Array.from({ length: m }, (u, s) => {
|
|
1197
|
+
const l = Math.round(b / m * (s + 1)), g = d / m * (s + 1), n = -Math.PI / 2, r = g * Math.cos(n) + 4, f = g * Math.sin(n);
|
|
1205
1198
|
return /* @__PURE__ */ e(
|
|
1206
1199
|
"text",
|
|
1207
1200
|
{
|
|
1208
1201
|
x: r,
|
|
1209
|
-
y:
|
|
1202
|
+
y: f,
|
|
1210
1203
|
textAnchor: "start",
|
|
1211
1204
|
dominantBaseline: "auto",
|
|
1212
1205
|
className: "fill-surface-fg-subtle text-ds-xs",
|
|
@@ -1215,29 +1208,29 @@ const He = ne.forwardRef(
|
|
|
1215
1208
|
`level-label-${s}`
|
|
1216
1209
|
);
|
|
1217
1210
|
}),
|
|
1218
|
-
|
|
1219
|
-
const l = $(u.key),
|
|
1220
|
-
return
|
|
1211
|
+
o.map((u, s) => {
|
|
1212
|
+
const l = $(u.key), g = V(l);
|
|
1213
|
+
return g ? /* @__PURE__ */ p("g", { children: [
|
|
1221
1214
|
/* @__PURE__ */ e(
|
|
1222
1215
|
"path",
|
|
1223
1216
|
{
|
|
1224
|
-
d:
|
|
1225
|
-
fill:
|
|
1217
|
+
d: g,
|
|
1218
|
+
fill: w[s],
|
|
1226
1219
|
fillOpacity: x,
|
|
1227
|
-
stroke:
|
|
1220
|
+
stroke: w[s],
|
|
1228
1221
|
strokeWidth: 2,
|
|
1229
1222
|
strokeLinejoin: "round"
|
|
1230
1223
|
}
|
|
1231
1224
|
),
|
|
1232
|
-
|
|
1233
|
-
const { x:
|
|
1225
|
+
c && l.map((n, r) => {
|
|
1226
|
+
const { x: f, y: S } = L(r, n);
|
|
1234
1227
|
return /* @__PURE__ */ e(
|
|
1235
1228
|
"circle",
|
|
1236
1229
|
{
|
|
1237
|
-
cx:
|
|
1238
|
-
cy:
|
|
1230
|
+
cx: f,
|
|
1231
|
+
cy: S,
|
|
1239
1232
|
r: 4,
|
|
1240
|
-
fill:
|
|
1233
|
+
fill: w[s],
|
|
1241
1234
|
stroke: "var(--color-surface-base)",
|
|
1242
1235
|
strokeWidth: 2,
|
|
1243
1236
|
className: "transition-opacity"
|
|
@@ -1247,28 +1240,26 @@ const He = ne.forwardRef(
|
|
|
1247
1240
|
})
|
|
1248
1241
|
] }, u.key) : null;
|
|
1249
1242
|
}),
|
|
1250
|
-
|
|
1251
|
-
const l =
|
|
1243
|
+
z && a.map((u, s) => {
|
|
1244
|
+
const l = i * s - Math.PI / 2, g = d * Math.cos(l), n = d * Math.sin(l);
|
|
1252
1245
|
return /* @__PURE__ */ e(
|
|
1253
1246
|
"circle",
|
|
1254
1247
|
{
|
|
1255
|
-
cx:
|
|
1248
|
+
cx: g,
|
|
1256
1249
|
cy: n,
|
|
1257
1250
|
r: 16,
|
|
1258
1251
|
fill: "transparent",
|
|
1259
1252
|
className: "cursor-pointer",
|
|
1260
1253
|
onMouseMove: (r) => {
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
r.
|
|
1265
|
-
|
|
1266
|
-
/* @__PURE__ */ g("div", { children: [
|
|
1254
|
+
const f = r.currentTarget.closest("div")?.getBoundingClientRect();
|
|
1255
|
+
U(
|
|
1256
|
+
r.clientX - (f?.left ?? 0),
|
|
1257
|
+
r.clientY - (f?.top ?? 0),
|
|
1258
|
+
/* @__PURE__ */ p("div", { children: [
|
|
1267
1259
|
/* @__PURE__ */ e("div", { className: "font-medium", children: u }),
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
return /* @__PURE__ */ g(
|
|
1260
|
+
o.map((S, G) => {
|
|
1261
|
+
const C = Number(t[s]?.[S.key]) || 0;
|
|
1262
|
+
return /* @__PURE__ */ p(
|
|
1272
1263
|
"div",
|
|
1273
1264
|
{
|
|
1274
1265
|
className: "flex items-center gap-ds-02",
|
|
@@ -1277,15 +1268,15 @@ const He = ne.forwardRef(
|
|
|
1277
1268
|
"span",
|
|
1278
1269
|
{
|
|
1279
1270
|
className: "inline-block h-2 w-2 rounded-ds-full",
|
|
1280
|
-
style: { backgroundColor:
|
|
1271
|
+
style: { backgroundColor: w[G] }
|
|
1281
1272
|
}
|
|
1282
1273
|
),
|
|
1283
|
-
/* @__PURE__ */
|
|
1274
|
+
/* @__PURE__ */ p("span", { className: "text-surface-fg-muted", children: [
|
|
1284
1275
|
S.label,
|
|
1285
1276
|
":"
|
|
1286
1277
|
] }),
|
|
1287
1278
|
" ",
|
|
1288
|
-
|
|
1279
|
+
C.toLocaleString()
|
|
1289
1280
|
]
|
|
1290
1281
|
},
|
|
1291
1282
|
S.key
|
|
@@ -1294,7 +1285,7 @@ const He = ne.forwardRef(
|
|
|
1294
1285
|
] })
|
|
1295
1286
|
);
|
|
1296
1287
|
},
|
|
1297
|
-
onMouseLeave:
|
|
1288
|
+
onMouseLeave: I
|
|
1298
1289
|
},
|
|
1299
1290
|
`hover-${s}`
|
|
1300
1291
|
);
|
|
@@ -1302,14 +1293,14 @@ const He = ne.forwardRef(
|
|
|
1302
1293
|
] })
|
|
1303
1294
|
}
|
|
1304
1295
|
),
|
|
1305
|
-
|
|
1296
|
+
z && /* @__PURE__ */ e(ie, { state: W })
|
|
1306
1297
|
] }),
|
|
1307
1298
|
N && /* @__PURE__ */ e(
|
|
1308
1299
|
ce,
|
|
1309
1300
|
{
|
|
1310
|
-
items:
|
|
1301
|
+
items: o.map((u, s) => ({
|
|
1311
1302
|
label: u.label,
|
|
1312
|
-
color:
|
|
1303
|
+
color: w[s]
|
|
1313
1304
|
})),
|
|
1314
1305
|
className: "mt-ds-04"
|
|
1315
1306
|
}
|
|
@@ -1323,7 +1314,7 @@ He.displayName = "RadarChart";
|
|
|
1323
1314
|
export {
|
|
1324
1315
|
Ze as AreaChart,
|
|
1325
1316
|
Ee as BarChart,
|
|
1326
|
-
|
|
1317
|
+
xe as ChartContainer,
|
|
1327
1318
|
Qe as GaugeChart,
|
|
1328
1319
|
ce as Legend,
|
|
1329
1320
|
Ue as LineChart,
|