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