@actioneer/ads 0.1.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/LICENSE +21 -0
- package/bin/ads-init.mjs +314 -0
- package/components/accordion.d.ts +13 -0
- package/components/accordion.js +91 -0
- package/components/agents-ui/agent-audio-visualizer-aura.d.ts +11 -0
- package/components/agents-ui/agent-audio-visualizer-aura.js +277 -0
- package/components/agents-ui/agent-audio-visualizer-wave.d.ts +12 -0
- package/components/agents-ui/agent-audio-visualizer-wave.js +203 -0
- package/components/agents-ui/react-shader-toy.d.ts +87 -0
- package/components/agents-ui/react-shader-toy.js +531 -0
- package/components/ai-elements/chain-of-thought.d.ts +30 -0
- package/components/ai-elements/chain-of-thought.js +182 -0
- package/components/ai-elements/index.d.ts +11 -0
- package/components/ai-elements/inline-citation.d.ts +44 -0
- package/components/ai-elements/inline-citation.js +314 -0
- package/components/ai-elements/message.d.ts +96 -0
- package/components/ai-elements/message.js +308 -0
- package/components/ai-elements/queue.d.ts +60 -0
- package/components/ai-elements/queue.js +193 -0
- package/components/ai-elements/reasoning.d.ts +26 -0
- package/components/ai-elements/reasoning.js +131 -0
- package/components/ai-elements/shimmer.d.ts +25 -0
- package/components/ai-elements/shimmer.js +44 -0
- package/components/ai-elements/speech-input.d.ts +16 -0
- package/components/ai-elements/speech-input.js +151 -0
- package/components/ai-elements/task-progress.d.ts +41 -0
- package/components/ai-elements/task-progress.js +211 -0
- package/components/ai-elements/task.d.ts +35 -0
- package/components/ai-elements/task.js +73 -0
- package/components/ai-elements/tool.d.ts +53 -0
- package/components/ai-elements/tool.js +116 -0
- package/components/ai-elements/voice.d.ts +74 -0
- package/components/ai-elements/voice.js +875 -0
- package/components/alert.d.ts +21 -0
- package/components/alert.js +76 -0
- package/components/answer.d.ts +984 -0
- package/components/answer.js +543 -0
- package/components/assistant-ui/action-bar.d.ts +3 -0
- package/components/assistant-ui/action-bar.js +57 -0
- package/components/assistant-ui/answer-tool-ui.d.ts +5 -0
- package/components/assistant-ui/answer-tool-ui.js +42 -0
- package/components/assistant-ui/attachment.d.ts +50 -0
- package/components/assistant-ui/attachment.js +353 -0
- package/components/assistant-ui/badge.d.ts +11 -0
- package/components/assistant-ui/badge.js +54 -0
- package/components/assistant-ui/branch-picker.d.ts +3 -0
- package/components/assistant-ui/branch-picker.js +36 -0
- package/components/assistant-ui/chain-of-thought.d.ts +46 -0
- package/components/assistant-ui/composer-add-context.d.ts +50 -0
- package/components/assistant-ui/composer-add-context.js +209 -0
- package/components/assistant-ui/composer-deep-research.d.ts +16 -0
- package/components/assistant-ui/composer-deep-research.js +38 -0
- package/components/assistant-ui/composer-harness.d.ts +18 -0
- package/components/assistant-ui/composer-harness.js +186 -0
- package/components/assistant-ui/composer-trigger-popover.d.ts +47 -0
- package/components/assistant-ui/composer-trigger-popover.js +147 -0
- package/components/assistant-ui/composer.d.ts +8 -0
- package/components/assistant-ui/composer.js +276 -0
- package/components/assistant-ui/directive-text.d.ts +16 -0
- package/components/assistant-ui/directive-text.js +40 -0
- package/components/assistant-ui/error.d.ts +6 -0
- package/components/assistant-ui/error.js +39 -0
- package/components/assistant-ui/file.d.ts +37 -0
- package/components/assistant-ui/file.js +159 -0
- package/components/assistant-ui/follow-up-suggestions.d.ts +7 -0
- package/components/assistant-ui/follow-up-suggestions.js +44 -0
- package/components/assistant-ui/image.d.ts +46 -0
- package/components/assistant-ui/image.js +351 -0
- package/components/assistant-ui/index.d.ts +28 -0
- package/components/assistant-ui/markdown-text.d.ts +1 -0
- package/components/assistant-ui/markdown-text.js +242 -0
- package/components/assistant-ui/message-timing.d.ts +25 -0
- package/components/assistant-ui/message-timing.js +56 -0
- package/components/assistant-ui/message.d.ts +4 -0
- package/components/assistant-ui/message.js +159 -0
- package/components/assistant-ui/primitives.d.ts +2 -0
- package/components/assistant-ui/quote.d.ts +37 -0
- package/components/assistant-ui/quote.js +150 -0
- package/components/assistant-ui/reasoning.d.ts +44 -0
- package/components/assistant-ui/reasoning.js +261 -0
- package/components/assistant-ui/selection-toolbar.d.ts +29 -0
- package/components/assistant-ui/selection-toolbar.js +91 -0
- package/components/assistant-ui/smart-message-text.d.ts +15 -0
- package/components/assistant-ui/smart-message-text.js +29 -0
- package/components/assistant-ui/sources.d.ts +17 -0
- package/components/assistant-ui/sources.js +121 -0
- package/components/assistant-ui/suggestions.d.ts +7 -0
- package/components/assistant-ui/suggestions.js +19 -0
- package/components/assistant-ui/thread-context.d.ts +37 -0
- package/components/assistant-ui/thread-context.js +8 -0
- package/components/assistant-ui/thread.d.ts +5 -0
- package/components/assistant-ui/thread.js +77 -0
- package/components/assistant-ui/tool-fallback.d.ts +36 -0
- package/components/assistant-ui/tool-fallback.js +428 -0
- package/components/assistant-ui/tool-group.d.ts +33 -0
- package/components/assistant-ui/tool-group.js +173 -0
- package/components/assistant-ui/tooltip-icon-button.d.ts +7 -0
- package/components/assistant-ui/tooltip-icon-button.js +31 -0
- package/components/assistant-ui/voice.d.ts +18 -0
- package/components/autocomplete.d.ts +18 -0
- package/components/autocomplete.js +162 -0
- package/components/avatar.d.ts +26 -0
- package/components/avatar.js +92 -0
- package/components/badge.d.ts +10 -0
- package/components/badge.js +83 -0
- package/components/brand-loader.d.ts +16 -0
- package/components/brand-loader.js +64 -0
- package/components/breadcrumbs.d.ts +8 -0
- package/components/breadcrumbs.js +58 -0
- package/components/button.d.ts +13 -0
- package/components/button.js +100 -0
- package/components/card.d.ts +19 -0
- package/components/card.js +82 -0
- package/components/carousel.d.ts +31 -0
- package/components/carousel.js +351 -0
- package/components/chart.d.ts +165 -0
- package/components/chart.js +841 -0
- package/components/checkbox.d.ts +13 -0
- package/components/checkbox.js +84 -0
- package/components/chip.d.ts +13 -0
- package/components/chip.js +112 -0
- package/components/collapsible.d.ts +5 -0
- package/components/collapsible.js +31 -0
- package/components/connector-card.d.ts +62 -0
- package/components/connector-card.js +154 -0
- package/components/divider.d.ts +23 -0
- package/components/divider.js +69 -0
- package/components/drawer.d.ts +45 -0
- package/components/drawer.js +234 -0
- package/components/dropdown.d.ts +33 -0
- package/components/dropdown.js +198 -0
- package/components/empty-state.d.ts +8 -0
- package/components/empty-state.js +30 -0
- package/components/field.d.ts +20 -0
- package/components/field.js +74 -0
- package/components/index.d.ts +56 -0
- package/components/index.js +444 -0
- package/components/input-field.d.ts +22 -0
- package/components/input-field.js +91 -0
- package/components/input.d.ts +8 -0
- package/components/input.js +61 -0
- package/components/kbd.d.ts +6 -0
- package/components/kbd.js +26 -0
- package/components/link.d.ts +14 -0
- package/components/link.js +72 -0
- package/components/modal.d.ts +18 -0
- package/components/modal.js +156 -0
- package/components/navbar.d.ts +15 -0
- package/components/navbar.js +68 -0
- package/components/number-field.d.ts +11 -0
- package/components/number-field.js +89 -0
- package/components/pagination.d.ts +28 -0
- package/components/pagination.js +179 -0
- package/components/panel.d.ts +14 -0
- package/components/panel.js +71 -0
- package/components/pixel-blast-svg.d.ts +22 -0
- package/components/pixel-blast-svg.js +154 -0
- package/components/popover.d.ts +20 -0
- package/components/popover.js +101 -0
- package/components/progress-circle.d.ts +11 -0
- package/components/progress-circle.js +75 -0
- package/components/progress.d.ts +22 -0
- package/components/progress.js +66 -0
- package/components/radio.d.ts +16 -0
- package/components/radio.js +101 -0
- package/components/segmented.d.ts +16 -0
- package/components/segmented.js +103 -0
- package/components/select.d.ts +28 -0
- package/components/select.js +180 -0
- package/components/selection-action-bar.d.ts +11 -0
- package/components/selection-action-bar.js +59 -0
- package/components/sidebar.d.ts +118 -0
- package/components/sidebar.js +375 -0
- package/components/skeleton.d.ts +6 -0
- package/components/skeleton.js +26 -0
- package/components/slider.d.ts +11 -0
- package/components/slider.js +62 -0
- package/components/spinner.d.ts +11 -0
- package/components/spinner.js +62 -0
- package/components/switch.d.ts +7 -0
- package/components/switch.js +61 -0
- package/components/table.d.ts +59 -0
- package/components/table.js +254 -0
- package/components/tabs.d.ts +29 -0
- package/components/tabs.js +371 -0
- package/components/textarea.d.ts +5 -0
- package/components/textarea.js +24 -0
- package/components/timeline.d.ts +7 -0
- package/components/timeline.js +47 -0
- package/components/toast.d.ts +74 -0
- package/components/toast.js +211 -0
- package/components/tooltip.d.ts +11 -0
- package/components/tooltip.js +143 -0
- package/components/tree.d.ts +42 -0
- package/components/tree.js +86 -0
- package/components/typography.d.ts +33 -0
- package/components/typography.js +65 -0
- package/components/ui/avatar.d.ts +11 -0
- package/components/ui/avatar.js +56 -0
- package/components/ui/button.d.ts +10 -0
- package/components/ui/button.js +57 -0
- package/components/ui/collapsible.d.ts +5 -0
- package/components/ui/collapsible.js +35 -0
- package/components/ui/dialog.d.ts +17 -0
- package/components/ui/dialog.js +93 -0
- package/components/ui/tabs.d.ts +22 -0
- package/components/ui/tooltip.d.ts +7 -0
- package/components/ui/tooltip.js +56 -0
- package/fonts/aribau-grotesk-400.otf +0 -0
- package/fonts/aribau-grotesk-700.otf +0 -0
- package/fonts.css +21 -0
- package/hooks/agents-ui/use-agent-audio-visualizer-aura.d.ts +8 -0
- package/hooks/agents-ui/use-agent-audio-visualizer-aura.js +62 -0
- package/hooks/agents-ui/use-agent-audio-visualizer-wave.d.ts +7 -0
- package/hooks/agents-ui/use-agent-audio-visualizer-wave.js +60 -0
- package/hooks/agents-ui/voice-visualizer-types.d.ts +9 -0
- package/lib/cn.d.ts +3 -0
- package/lib/cn.js +9 -0
- package/lib/icons.d.ts +378 -0
- package/lib/icons.js +119 -0
- package/lib/interactive.d.ts +24 -0
- package/lib/interactive.js +36 -0
- package/lib/motion.d.ts +58 -0
- package/lib/motion.js +70 -0
- package/lib/router.d.ts +3 -0
- package/lib/utils.d.ts +6 -0
- package/llms.txt +537 -0
- package/manifest.json +5085 -0
- package/package.json +60 -0
- package/styles.css +653 -0
- package/theme.css +273 -0
|
@@ -0,0 +1,841 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as g, jsx as e, Fragment as Z } from "react/jsx-runtime";
|
|
3
|
+
import * as N from "react";
|
|
4
|
+
import { ResponsiveContainer as F, LineChart as q, Tooltip as C, Line as z, AreaChart as J, Area as Q, BarChart as K, Bar as G, Cell as W, ComposedChart as ee, YAxis as D, ScatterChart as te, CartesianGrid as E, XAxis as _, Scatter as re, PieChart as ae, Pie as ne, RadarChart as ie, PolarGrid as le, PolarAngleAxis as H, PolarRadiusAxis as oe, Radar as se, RadialBarChart as ce, RadialBar as de, Treemap as me, FunnelChart as fe, Funnel as ue, LabelList as he, ReferenceArea as xe, ReferenceLine as ge, ReferenceDot as ve } from "recharts";
|
|
5
|
+
import { MotionConfig as pe, AnimatePresence as be, motion as Ne } from "motion/react";
|
|
6
|
+
import { cn as k } from "../lib/cn.js";
|
|
7
|
+
import { floatVariants as Ae } from "../lib/motion.js";
|
|
8
|
+
const V = (t) => `var(--color-chart-${t % 6 + 1})`, j = [
|
|
9
|
+
"var(--color-ink-950)",
|
|
10
|
+
"var(--color-ink-700)",
|
|
11
|
+
"var(--color-ink-500)",
|
|
12
|
+
"var(--color-ink-400)",
|
|
13
|
+
"var(--color-ink-300)",
|
|
14
|
+
"var(--color-ink-200)",
|
|
15
|
+
"var(--color-ink-100)"
|
|
16
|
+
], M = (t) => j[t % j.length], P = "var(--color-chart-3)", R = {
|
|
17
|
+
primary: { ref: "var(--brand)", pill: "bg-fill text-fill-foreground" },
|
|
18
|
+
success: { ref: "var(--color-success-600)", pill: "bg-success-50 text-success-700" },
|
|
19
|
+
warning: { ref: "var(--color-warning-500)", pill: "bg-warning-50 text-warning-700" },
|
|
20
|
+
danger: { ref: "var(--color-danger-500)", pill: "bg-danger-50 text-danger-700" },
|
|
21
|
+
info: { ref: "var(--color-info-500)", pill: "bg-info-50 text-info-700" }
|
|
22
|
+
}, w = (t) => new Intl.NumberFormat("en-US", { notation: "compact", maximumFractionDigits: 1 }).format(t), X = (t, r) => {
|
|
23
|
+
const a = [];
|
|
24
|
+
for (const n of t)
|
|
25
|
+
for (const i of Object.keys(n))
|
|
26
|
+
i !== r && typeof n[i] == "number" && !a.includes(i) && a.push(i);
|
|
27
|
+
return a;
|
|
28
|
+
};
|
|
29
|
+
function L({ x: t, y: r, payload: a, anchor: n, dy: i, format: l }) {
|
|
30
|
+
const o = (a == null ? void 0 : a.value) ?? "", s = l && typeof o == "number" ? l(o) : o;
|
|
31
|
+
return /* @__PURE__ */ e("text", { x: t, y: r, dy: i, textAnchor: n, className: "fill-tertiary text-xs tabular-nums", children: s });
|
|
32
|
+
}
|
|
33
|
+
function y({
|
|
34
|
+
active: t,
|
|
35
|
+
payload: r,
|
|
36
|
+
label: a,
|
|
37
|
+
format: n
|
|
38
|
+
}) {
|
|
39
|
+
if (!t || !(r != null && r.length)) return null;
|
|
40
|
+
const i = r.length === 1, l = a ?? (i ? r[0].name : void 0);
|
|
41
|
+
return /* @__PURE__ */ g("div", { className: "rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background", children: [
|
|
42
|
+
/* @__PURE__ */ e("div", { className: k("text-xs font-medium tracking-wide uppercase text-background/60", !i && "mb-1"), children: l }),
|
|
43
|
+
r.map((o, s) => /* @__PURE__ */ g("div", { className: "flex items-center gap-1.5", children: [
|
|
44
|
+
!i && /* @__PURE__ */ g(Z, { children: [
|
|
45
|
+
/* @__PURE__ */ e("span", { "aria-hidden": !0, className: "size-1.5 rounded-dot", style: { background: o.color } }),
|
|
46
|
+
/* @__PURE__ */ e("span", { className: "text-background/70", children: o.name })
|
|
47
|
+
] }),
|
|
48
|
+
/* @__PURE__ */ e("span", { className: "ml-auto pl-3 font-medium tabular-nums", children: typeof o.value == "number" ? n(o.value) : String(o.value ?? "") })
|
|
49
|
+
] }, o.dataKey ?? s))
|
|
50
|
+
] });
|
|
51
|
+
}
|
|
52
|
+
const B = "pointer-events-none inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap";
|
|
53
|
+
function ke({ viewBox: t, label: r, color: a, axis: n }) {
|
|
54
|
+
const i = t ?? {};
|
|
55
|
+
return n === "y" ? /* @__PURE__ */ e("foreignObject", { x: i.x ?? 0, y: (i.y ?? 0) - 10, width: i.width ?? 0, height: 20, className: "overflow-visible", children: /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-end pr-1", children: /* @__PURE__ */ e("span", { className: k(B, R[a].pill), children: r }) }) }) : /* @__PURE__ */ e("foreignObject", { x: (i.x ?? 0) - 90, y: (i.y ?? 0) - 10, width: 180, height: 20, className: "overflow-visible", children: /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e("span", { className: k(B, R[a].pill), children: r }) }) });
|
|
56
|
+
}
|
|
57
|
+
function Ce({ viewBox: t, label: r, color: a }) {
|
|
58
|
+
const n = t ?? {};
|
|
59
|
+
return /* @__PURE__ */ e("foreignObject", { x: n.x ?? 0, y: n.y ?? 0, width: n.width ?? 0, height: 28, className: "overflow-visible", children: /* @__PURE__ */ e("div", { className: "flex h-full items-center pl-1.5", children: /* @__PURE__ */ e("span", { className: k(B, R[a].pill), children: r }) }) });
|
|
60
|
+
}
|
|
61
|
+
function we({
|
|
62
|
+
cx: t,
|
|
63
|
+
cy: r,
|
|
64
|
+
n: a,
|
|
65
|
+
ann: n,
|
|
66
|
+
onEnter: i,
|
|
67
|
+
onLeave: l
|
|
68
|
+
}) {
|
|
69
|
+
const [o, s] = N.useState(!1);
|
|
70
|
+
if (t == null || r == null || !Number.isFinite(t) || !Number.isFinite(r)) return /* @__PURE__ */ e("g", {});
|
|
71
|
+
const f = () => i({ ann: n, n: a, cx: t, cy: r }), d = () => l();
|
|
72
|
+
return /* @__PURE__ */ g(
|
|
73
|
+
"g",
|
|
74
|
+
{
|
|
75
|
+
tabIndex: 0,
|
|
76
|
+
role: "img",
|
|
77
|
+
"aria-label": `Annotation ${a}: ${n.label}`,
|
|
78
|
+
className: "cursor-default outline-none [transform-box:fill-box] origin-center transition-transform ease-out [transition-duration:var(--duration-fast)] hover:scale-110 focus-visible:scale-110",
|
|
79
|
+
onMouseEnter: f,
|
|
80
|
+
onMouseLeave: d,
|
|
81
|
+
onFocus: () => {
|
|
82
|
+
s(!0), f();
|
|
83
|
+
},
|
|
84
|
+
onBlur: () => {
|
|
85
|
+
s(!1), d();
|
|
86
|
+
},
|
|
87
|
+
children: [
|
|
88
|
+
o && /* @__PURE__ */ e("circle", { cx: t, cy: r, r: 12, fill: "none", stroke: "var(--ring)", strokeWidth: 2 }),
|
|
89
|
+
/* @__PURE__ */ e("circle", { cx: t, cy: r, r: 10, fill: "var(--background)" }),
|
|
90
|
+
/* @__PURE__ */ e("circle", { cx: t, cy: r, r: 8, fill: R[n.color ?? "primary"].ref }),
|
|
91
|
+
/* @__PURE__ */ e(
|
|
92
|
+
"text",
|
|
93
|
+
{
|
|
94
|
+
x: t,
|
|
95
|
+
y: r,
|
|
96
|
+
dy: "0.35em",
|
|
97
|
+
textAnchor: "middle",
|
|
98
|
+
className: "pointer-events-none fill-brand-foreground text-xs font-bold select-none",
|
|
99
|
+
children: a
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
function ye({ hovered: t, frameWidth: r, format: a }) {
|
|
107
|
+
return /* @__PURE__ */ e(pe, { reducedMotion: "user", children: /* @__PURE__ */ e(be, { children: t && /* @__PURE__ */ e(
|
|
108
|
+
"div",
|
|
109
|
+
{
|
|
110
|
+
className: "pointer-events-none absolute z-10",
|
|
111
|
+
style: {
|
|
112
|
+
left: Math.max(96, Math.min(t.cx, Math.max(r - 96, 96))),
|
|
113
|
+
top: t.cy - 16
|
|
114
|
+
},
|
|
115
|
+
children: /* @__PURE__ */ g(
|
|
116
|
+
Ne.div,
|
|
117
|
+
{
|
|
118
|
+
variants: Ae,
|
|
119
|
+
initial: "hidden",
|
|
120
|
+
animate: "visible",
|
|
121
|
+
exit: "hidden",
|
|
122
|
+
className: "w-max max-w-60 -translate-x-1/2 -translate-y-full origin-bottom rounded-lg bg-elevated p-3 shadow-elevation",
|
|
123
|
+
children: [
|
|
124
|
+
/* @__PURE__ */ g("div", { className: "flex items-center gap-2", children: [
|
|
125
|
+
/* @__PURE__ */ e(
|
|
126
|
+
"span",
|
|
127
|
+
{
|
|
128
|
+
"aria-hidden": !0,
|
|
129
|
+
className: "flex size-4.5 shrink-0 items-center justify-center rounded-full text-xs font-bold text-brand-foreground",
|
|
130
|
+
style: { background: R[t.ann.color ?? "primary"].ref },
|
|
131
|
+
children: t.n
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
/* @__PURE__ */ e("span", { className: "text-xs font-medium text-foreground", children: t.ann.label })
|
|
135
|
+
] }),
|
|
136
|
+
t.ann.description && /* @__PURE__ */ e("p", { className: "mt-1.5 text-xs leading-relaxed text-secondary", children: t.ann.description }),
|
|
137
|
+
/* @__PURE__ */ g("div", { className: "mt-1.5 text-xs font-medium tracking-wide uppercase text-tertiary tabular-nums", children: [
|
|
138
|
+
t.ann.x,
|
|
139
|
+
" · ",
|
|
140
|
+
a(t.ann.y)
|
|
141
|
+
] })
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
}
|
|
146
|
+
) }) });
|
|
147
|
+
}
|
|
148
|
+
function Y(t) {
|
|
149
|
+
const [r, a] = N.useState(null), n = N.useCallback(() => a(null), []), { back: i, front: l } = N.useMemo(() => {
|
|
150
|
+
const o = [], s = [];
|
|
151
|
+
let f = 0;
|
|
152
|
+
return (t ?? []).forEach((d, v) => {
|
|
153
|
+
const c = d.color ?? "primary";
|
|
154
|
+
if (d.kind === "band") {
|
|
155
|
+
const h = d.axis ?? "y";
|
|
156
|
+
o.push(
|
|
157
|
+
/* @__PURE__ */ e(
|
|
158
|
+
xe,
|
|
159
|
+
{
|
|
160
|
+
...h === "y" ? { y1: d.from, y2: d.to } : { x1: d.from, x2: d.to },
|
|
161
|
+
fill: R[c].ref,
|
|
162
|
+
fillOpacity: 0.06,
|
|
163
|
+
stroke: "none",
|
|
164
|
+
ifOverflow: h === "y" ? "extendDomain" : "visible",
|
|
165
|
+
label: d.label ? /* @__PURE__ */ e(Ce, { label: d.label, color: c }) : void 0
|
|
166
|
+
},
|
|
167
|
+
`ann-${v}`
|
|
168
|
+
)
|
|
169
|
+
);
|
|
170
|
+
} else if (d.kind === "line") {
|
|
171
|
+
const h = d.axis ?? "y";
|
|
172
|
+
s.push(
|
|
173
|
+
/* @__PURE__ */ e(
|
|
174
|
+
ge,
|
|
175
|
+
{
|
|
176
|
+
...h === "y" ? { y: d.value } : { x: d.value },
|
|
177
|
+
stroke: R[c].ref,
|
|
178
|
+
strokeWidth: 1,
|
|
179
|
+
strokeDasharray: "4 4",
|
|
180
|
+
ifOverflow: h === "y" ? "extendDomain" : "visible",
|
|
181
|
+
label: d.label ? /* @__PURE__ */ e(ke, { label: d.label, color: c, axis: h }) : void 0
|
|
182
|
+
},
|
|
183
|
+
`ann-${v}`
|
|
184
|
+
)
|
|
185
|
+
);
|
|
186
|
+
} else {
|
|
187
|
+
f += 1;
|
|
188
|
+
const h = f;
|
|
189
|
+
s.push(
|
|
190
|
+
/* @__PURE__ */ e(
|
|
191
|
+
ve,
|
|
192
|
+
{
|
|
193
|
+
x: d.x,
|
|
194
|
+
y: d.y,
|
|
195
|
+
ifOverflow: "visible",
|
|
196
|
+
shape: (x) => /* @__PURE__ */ e(we, { cx: x.cx, cy: x.cy, n: h, ann: d, onEnter: a, onLeave: n })
|
|
197
|
+
},
|
|
198
|
+
`ann-${v}`
|
|
199
|
+
)
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
}), { back: o, front: s };
|
|
203
|
+
}, [t, n]);
|
|
204
|
+
return { back: i, front: l, hovered: r };
|
|
205
|
+
}
|
|
206
|
+
function $({
|
|
207
|
+
items: t,
|
|
208
|
+
align: r = "end",
|
|
209
|
+
className: a
|
|
210
|
+
}) {
|
|
211
|
+
const n = {
|
|
212
|
+
start: "justify-start",
|
|
213
|
+
center: "justify-center",
|
|
214
|
+
end: "justify-end"
|
|
215
|
+
}[r];
|
|
216
|
+
return /* @__PURE__ */ e("div", { className: k("mb-3 flex flex-wrap items-center gap-x-4 gap-y-1", n, a), children: t.map((i) => /* @__PURE__ */ g("span", { className: "inline-flex items-center gap-1.5 text-xs text-secondary", children: [
|
|
217
|
+
/* @__PURE__ */ e("span", { "aria-hidden": !0, className: "size-2 rounded-dot", style: { background: i.color } }),
|
|
218
|
+
i.label
|
|
219
|
+
] }, i.label)) });
|
|
220
|
+
}
|
|
221
|
+
const S = N.forwardRef(
|
|
222
|
+
({ className: t, height: r, legendItems: a, hovered: n, format: i, children: l, ...o }, s) => {
|
|
223
|
+
var v;
|
|
224
|
+
const f = N.useRef(null);
|
|
225
|
+
return /* @__PURE__ */ g("div", { ref: (c) => {
|
|
226
|
+
f.current = c, typeof s == "function" ? s(c) : s && (s.current = c);
|
|
227
|
+
}, className: k("relative w-full font-sans", t), ...o, children: [
|
|
228
|
+
a && /* @__PURE__ */ e($, { items: a }),
|
|
229
|
+
/* @__PURE__ */ e(F, { width: "100%", height: r, children: l }),
|
|
230
|
+
/* @__PURE__ */ e(ye, { hovered: n, frameWidth: ((v = f.current) == null ? void 0 : v.clientWidth) ?? 0, format: i })
|
|
231
|
+
] });
|
|
232
|
+
}
|
|
233
|
+
);
|
|
234
|
+
S.displayName = "ChartFrame";
|
|
235
|
+
function I(t) {
|
|
236
|
+
const { data: r, categoryKey: a, series: n, seriesLabels: i, highlight: l, annotations: o, grid: s = !0, legend: f, showYAxis: d = !0, formatValue: v } = t, c = N.useMemo(() => n ?? X(r, a), [n, r, a]), h = v ?? w, x = Y(o), p = (A, T) => l && c.includes(l) ? A === l ? "var(--color-chart-1)" : P : V(T), m = (A) => (i == null ? void 0 : i[A]) ?? A, u = f ?? c.length > 1 ? c.map((A, T) => ({ label: m(A), color: p(A, T) })) : null;
|
|
237
|
+
return { names: c, format: h, layers: x, legendItems: u, furniture: [
|
|
238
|
+
s ? /* @__PURE__ */ e(E, { vertical: !1, stroke: "var(--border)" }, "grid") : null,
|
|
239
|
+
/* @__PURE__ */ e(
|
|
240
|
+
_,
|
|
241
|
+
{
|
|
242
|
+
dataKey: a,
|
|
243
|
+
axisLine: !1,
|
|
244
|
+
tickLine: !1,
|
|
245
|
+
minTickGap: 28,
|
|
246
|
+
tickMargin: 10,
|
|
247
|
+
tick: /* @__PURE__ */ e(L, { anchor: "middle", dy: 0 })
|
|
248
|
+
},
|
|
249
|
+
"x"
|
|
250
|
+
),
|
|
251
|
+
d ? /* @__PURE__ */ e(
|
|
252
|
+
D,
|
|
253
|
+
{
|
|
254
|
+
width: 44,
|
|
255
|
+
axisLine: !1,
|
|
256
|
+
tickLine: !1,
|
|
257
|
+
tickMargin: 6,
|
|
258
|
+
tick: /* @__PURE__ */ e(L, { anchor: "end", dy: "0.32em", format: h })
|
|
259
|
+
},
|
|
260
|
+
"y"
|
|
261
|
+
) : null
|
|
262
|
+
], colorFor: p, labelFor: m };
|
|
263
|
+
}
|
|
264
|
+
const O = { top: 20, right: 12, bottom: 4, left: 0 }, Re = N.forwardRef(
|
|
265
|
+
({ height: t = 280, curve: r = "natural", forecastKeys: a, className: n, ...i }, l) => {
|
|
266
|
+
const { names: o, format: s, layers: f, legendItems: d, furniture: v, colorFor: c, labelFor: h } = I(i);
|
|
267
|
+
return /* @__PURE__ */ e(S, { ref: l, className: n, height: t, legendItems: d, hovered: f.hovered, format: s, children: /* @__PURE__ */ g(q, { data: i.data, margin: O, children: [
|
|
268
|
+
v,
|
|
269
|
+
/* @__PURE__ */ e(
|
|
270
|
+
C,
|
|
271
|
+
{
|
|
272
|
+
content: /* @__PURE__ */ e(y, { format: s }),
|
|
273
|
+
cursor: { stroke: "var(--border-strong)" },
|
|
274
|
+
isAnimationActive: !1
|
|
275
|
+
}
|
|
276
|
+
),
|
|
277
|
+
f.back,
|
|
278
|
+
o.map((x, p) => /* @__PURE__ */ e(
|
|
279
|
+
z,
|
|
280
|
+
{
|
|
281
|
+
dataKey: x,
|
|
282
|
+
name: h(x),
|
|
283
|
+
type: r,
|
|
284
|
+
stroke: c(x, p),
|
|
285
|
+
strokeWidth: 2,
|
|
286
|
+
strokeDasharray: a != null && a.includes(x) ? "6 4" : void 0,
|
|
287
|
+
dot: !1,
|
|
288
|
+
activeDot: { r: 4, strokeWidth: 2, stroke: "var(--background)" },
|
|
289
|
+
isAnimationActive: !1
|
|
290
|
+
},
|
|
291
|
+
x
|
|
292
|
+
)),
|
|
293
|
+
f.front
|
|
294
|
+
] }) });
|
|
295
|
+
}
|
|
296
|
+
);
|
|
297
|
+
Re.displayName = "LineChart";
|
|
298
|
+
const Me = N.forwardRef(
|
|
299
|
+
({ height: t = 280, curve: r = "natural", stacked: a = !1, forecastKeys: n, className: i, ...l }, o) => {
|
|
300
|
+
const { names: s, format: f, layers: d, legendItems: v, furniture: c, colorFor: h, labelFor: x } = I(l), p = N.useId().replace(/[^a-zA-Z0-9]/g, "");
|
|
301
|
+
return /* @__PURE__ */ e(S, { ref: o, className: i, height: t, legendItems: v, hovered: d.hovered, format: f, children: /* @__PURE__ */ g(J, { data: l.data, margin: O, children: [
|
|
302
|
+
/* @__PURE__ */ e("defs", { children: s.map((m, u) => /* @__PURE__ */ g("linearGradient", { id: `${p}-${u}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
303
|
+
/* @__PURE__ */ e("stop", { offset: "0%", stopColor: h(m, u), stopOpacity: 0.18 }),
|
|
304
|
+
/* @__PURE__ */ e("stop", { offset: "100%", stopColor: h(m, u), stopOpacity: 0.02 })
|
|
305
|
+
] }, m)) }),
|
|
306
|
+
c,
|
|
307
|
+
/* @__PURE__ */ e(
|
|
308
|
+
C,
|
|
309
|
+
{
|
|
310
|
+
content: /* @__PURE__ */ e(y, { format: f }),
|
|
311
|
+
cursor: { stroke: "var(--border-strong)" },
|
|
312
|
+
isAnimationActive: !1
|
|
313
|
+
}
|
|
314
|
+
),
|
|
315
|
+
d.back,
|
|
316
|
+
s.map((m, u) => /* @__PURE__ */ e(
|
|
317
|
+
Q,
|
|
318
|
+
{
|
|
319
|
+
dataKey: m,
|
|
320
|
+
name: x(m),
|
|
321
|
+
type: r,
|
|
322
|
+
stackId: a ? "stack" : void 0,
|
|
323
|
+
stroke: h(m, u),
|
|
324
|
+
strokeWidth: 2,
|
|
325
|
+
strokeDasharray: n != null && n.includes(m) ? "6 4" : void 0,
|
|
326
|
+
fill: `url(#${p}-${u})`,
|
|
327
|
+
activeDot: { r: 4, strokeWidth: 2, stroke: "var(--background)" },
|
|
328
|
+
isAnimationActive: !1
|
|
329
|
+
},
|
|
330
|
+
m
|
|
331
|
+
)),
|
|
332
|
+
d.front
|
|
333
|
+
] }) });
|
|
334
|
+
}
|
|
335
|
+
);
|
|
336
|
+
Me.displayName = "AreaChart";
|
|
337
|
+
const Fe = N.forwardRef(
|
|
338
|
+
({ height: t = 280, stacked: r = !1, className: a, ...n }, i) => {
|
|
339
|
+
const { names: l, format: o, layers: s, legendItems: f, furniture: d, colorFor: v, labelFor: c } = I(n), h = n.highlight && l.length === 1 && !l.includes(n.highlight) ? n.highlight : null;
|
|
340
|
+
return /* @__PURE__ */ e(S, { ref: i, className: a, height: t, legendItems: f, hovered: s.hovered, format: o, children: /* @__PURE__ */ g(K, { data: n.data, margin: O, barCategoryGap: "24%", children: [
|
|
341
|
+
d,
|
|
342
|
+
/* @__PURE__ */ e(
|
|
343
|
+
C,
|
|
344
|
+
{
|
|
345
|
+
content: /* @__PURE__ */ e(y, { format: o }),
|
|
346
|
+
cursor: { fill: "var(--muted)" },
|
|
347
|
+
isAnimationActive: !1
|
|
348
|
+
}
|
|
349
|
+
),
|
|
350
|
+
s.back,
|
|
351
|
+
l.map((x, p) => {
|
|
352
|
+
const m = r ? p === l.length - 1 : !0;
|
|
353
|
+
return /* @__PURE__ */ e(
|
|
354
|
+
G,
|
|
355
|
+
{
|
|
356
|
+
dataKey: x,
|
|
357
|
+
name: c(x),
|
|
358
|
+
stackId: r ? "stack" : void 0,
|
|
359
|
+
fill: v(x, p),
|
|
360
|
+
radius: m ? [4, 4, 0, 0] : 0,
|
|
361
|
+
maxBarSize: 48,
|
|
362
|
+
isAnimationActive: !1,
|
|
363
|
+
children: h && n.data.map((u) => /* @__PURE__ */ e(
|
|
364
|
+
W,
|
|
365
|
+
{
|
|
366
|
+
fill: u[n.categoryKey] === h ? "var(--color-chart-1)" : P
|
|
367
|
+
},
|
|
368
|
+
String(u[n.categoryKey])
|
|
369
|
+
))
|
|
370
|
+
},
|
|
371
|
+
x
|
|
372
|
+
);
|
|
373
|
+
}),
|
|
374
|
+
s.front
|
|
375
|
+
] }) });
|
|
376
|
+
}
|
|
377
|
+
);
|
|
378
|
+
Fe.displayName = "BarChart";
|
|
379
|
+
const U = N.forwardRef(
|
|
380
|
+
({ height: t = 280, lineKeys: r, dualAxis: a = !1, stacked: n = !1, forecastKeys: i, className: l, ...o }, s) => {
|
|
381
|
+
const { names: f, format: d, layers: v, legendItems: c, furniture: h, colorFor: x, labelFor: p } = I(o), m = f.filter((u) => !r.includes(u));
|
|
382
|
+
return /* @__PURE__ */ e(S, { ref: s, className: l, height: t, legendItems: c, hovered: v.hovered, format: d, children: /* @__PURE__ */ g(ee, { data: o.data, margin: O, barCategoryGap: "24%", children: [
|
|
383
|
+
h,
|
|
384
|
+
a && /* @__PURE__ */ e(
|
|
385
|
+
D,
|
|
386
|
+
{
|
|
387
|
+
yAxisId: "right",
|
|
388
|
+
orientation: "right",
|
|
389
|
+
width: 44,
|
|
390
|
+
axisLine: !1,
|
|
391
|
+
tickLine: !1,
|
|
392
|
+
tickMargin: 6,
|
|
393
|
+
tick: /* @__PURE__ */ e(L, { anchor: "start", dy: "0.32em", format: d })
|
|
394
|
+
}
|
|
395
|
+
),
|
|
396
|
+
/* @__PURE__ */ e(
|
|
397
|
+
C,
|
|
398
|
+
{
|
|
399
|
+
content: /* @__PURE__ */ e(y, { format: d }),
|
|
400
|
+
cursor: { fill: "var(--muted)" },
|
|
401
|
+
isAnimationActive: !1
|
|
402
|
+
}
|
|
403
|
+
),
|
|
404
|
+
v.back,
|
|
405
|
+
m.map((u) => {
|
|
406
|
+
const b = f.indexOf(u), A = n ? u === m[m.length - 1] : !0;
|
|
407
|
+
return /* @__PURE__ */ e(
|
|
408
|
+
G,
|
|
409
|
+
{
|
|
410
|
+
dataKey: u,
|
|
411
|
+
name: p(u),
|
|
412
|
+
stackId: n ? "stack" : void 0,
|
|
413
|
+
fill: x(u, b),
|
|
414
|
+
radius: A ? [4, 4, 0, 0] : 0,
|
|
415
|
+
maxBarSize: 48,
|
|
416
|
+
isAnimationActive: !1
|
|
417
|
+
},
|
|
418
|
+
u
|
|
419
|
+
);
|
|
420
|
+
}),
|
|
421
|
+
r.map((u) => {
|
|
422
|
+
const b = f.indexOf(u);
|
|
423
|
+
return /* @__PURE__ */ e(
|
|
424
|
+
z,
|
|
425
|
+
{
|
|
426
|
+
dataKey: u,
|
|
427
|
+
name: p(u),
|
|
428
|
+
yAxisId: a ? "right" : void 0,
|
|
429
|
+
type: "natural",
|
|
430
|
+
stroke: x(u, b),
|
|
431
|
+
strokeWidth: 2,
|
|
432
|
+
strokeDasharray: i != null && i.includes(u) ? "6 4" : void 0,
|
|
433
|
+
dot: !1,
|
|
434
|
+
activeDot: { r: 4, strokeWidth: 2, stroke: "var(--background)" },
|
|
435
|
+
isAnimationActive: !1
|
|
436
|
+
},
|
|
437
|
+
u
|
|
438
|
+
);
|
|
439
|
+
}),
|
|
440
|
+
v.front
|
|
441
|
+
] }) });
|
|
442
|
+
}
|
|
443
|
+
);
|
|
444
|
+
U.displayName = "ComboChart";
|
|
445
|
+
const Se = N.forwardRef(
|
|
446
|
+
(t, r) => /* @__PURE__ */ e(U, { ref: r, ...t })
|
|
447
|
+
);
|
|
448
|
+
Se.displayName = "ComposedChart";
|
|
449
|
+
function Le({
|
|
450
|
+
active: t,
|
|
451
|
+
payload: r,
|
|
452
|
+
labelKey: a,
|
|
453
|
+
format: n
|
|
454
|
+
}) {
|
|
455
|
+
var o;
|
|
456
|
+
if (!t || !(r != null && r.length)) return null;
|
|
457
|
+
const i = (o = r[0]) == null ? void 0 : o.payload, l = a && i ? i[a] : void 0;
|
|
458
|
+
return /* @__PURE__ */ g("div", { className: "rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background", children: [
|
|
459
|
+
l != null && /* @__PURE__ */ e("div", { className: "mb-1 text-xs font-medium tracking-wide uppercase text-background/60", children: l }),
|
|
460
|
+
r.map((s, f) => /* @__PURE__ */ g("div", { className: "flex items-center gap-1.5", children: [
|
|
461
|
+
/* @__PURE__ */ e("span", { className: "text-background/70", children: s.name }),
|
|
462
|
+
/* @__PURE__ */ e("span", { className: "ml-auto pl-3 font-medium tabular-nums", children: typeof s.value == "number" ? n(s.value) : String(s.value ?? "") })
|
|
463
|
+
] }, f))
|
|
464
|
+
] });
|
|
465
|
+
}
|
|
466
|
+
const Oe = N.forwardRef(
|
|
467
|
+
({ data: t, xKey: r, yKey: a, labelKey: n, annotations: i, height: l = 280, grid: o = !0, showYAxis: s = !0, formatValue: f, className: d }, v) => {
|
|
468
|
+
const c = f ?? w, h = Y(i);
|
|
469
|
+
return /* @__PURE__ */ e(S, { ref: v, className: d, height: l, legendItems: null, hovered: h.hovered, format: c, children: /* @__PURE__ */ g(te, { margin: O, children: [
|
|
470
|
+
o && /* @__PURE__ */ e(E, { vertical: !1, stroke: "var(--border)" }),
|
|
471
|
+
/* @__PURE__ */ e(
|
|
472
|
+
_,
|
|
473
|
+
{
|
|
474
|
+
type: "number",
|
|
475
|
+
dataKey: r,
|
|
476
|
+
domain: ["auto", "auto"],
|
|
477
|
+
axisLine: !1,
|
|
478
|
+
tickLine: !1,
|
|
479
|
+
minTickGap: 28,
|
|
480
|
+
tickMargin: 10,
|
|
481
|
+
tick: /* @__PURE__ */ e(L, { anchor: "middle", dy: 0, format: w })
|
|
482
|
+
}
|
|
483
|
+
),
|
|
484
|
+
s && /* @__PURE__ */ e(
|
|
485
|
+
D,
|
|
486
|
+
{
|
|
487
|
+
type: "number",
|
|
488
|
+
dataKey: a,
|
|
489
|
+
width: 44,
|
|
490
|
+
axisLine: !1,
|
|
491
|
+
tickLine: !1,
|
|
492
|
+
tickMargin: 6,
|
|
493
|
+
tick: /* @__PURE__ */ e(L, { anchor: "end", dy: "0.32em", format: c })
|
|
494
|
+
}
|
|
495
|
+
),
|
|
496
|
+
/* @__PURE__ */ e(
|
|
497
|
+
C,
|
|
498
|
+
{
|
|
499
|
+
content: /* @__PURE__ */ e(Le, { labelKey: n, format: c }),
|
|
500
|
+
cursor: { stroke: "var(--border-strong)", strokeDasharray: "4 4" },
|
|
501
|
+
isAnimationActive: !1
|
|
502
|
+
}
|
|
503
|
+
),
|
|
504
|
+
h.back,
|
|
505
|
+
/* @__PURE__ */ e(
|
|
506
|
+
re,
|
|
507
|
+
{
|
|
508
|
+
data: t,
|
|
509
|
+
fill: "var(--color-chart-1)",
|
|
510
|
+
shape: (x) => /* @__PURE__ */ e("circle", { cx: x.cx, cy: x.cy, r: 4.5, fill: "var(--color-chart-1)", fillOpacity: 0.75 }),
|
|
511
|
+
isAnimationActive: !1
|
|
512
|
+
}
|
|
513
|
+
),
|
|
514
|
+
h.front
|
|
515
|
+
] }) });
|
|
516
|
+
}
|
|
517
|
+
);
|
|
518
|
+
Oe.displayName = "ScatterChart";
|
|
519
|
+
const $e = N.forwardRef(
|
|
520
|
+
({ data: t, nameKey: r, valueKey: a, donut: n = !0, centerLabel: i, highlight: l, height: o = 260, legend: s = !0, formatValue: f, className: d }, v) => {
|
|
521
|
+
const c = f ?? w, h = t.reduce((m, u) => m + (typeof u[a] == "number" ? u[a] : 0), 0), x = (m, u) => l ? m === l ? "var(--color-chart-1)" : M(Math.min(u + 3, j.length - 1)) : M(u), p = s ? t.map((m, u) => ({
|
|
522
|
+
label: `${m[r]} · ${h ? Math.round(Number(m[a]) / h * 100) : 0}%`,
|
|
523
|
+
color: x(String(m[r]), u)
|
|
524
|
+
})) : null;
|
|
525
|
+
return /* @__PURE__ */ g("div", { ref: v, className: k("relative w-full font-sans", d), children: [
|
|
526
|
+
p && /* @__PURE__ */ e($, { items: p }),
|
|
527
|
+
/* @__PURE__ */ g("div", { className: "relative", children: [
|
|
528
|
+
/* @__PURE__ */ e(F, { width: "100%", height: o, children: /* @__PURE__ */ g(ae, { margin: { top: 8, right: 8, bottom: 8, left: 8 }, children: [
|
|
529
|
+
/* @__PURE__ */ e(C, { content: /* @__PURE__ */ e(y, { format: c }), isAnimationActive: !1 }),
|
|
530
|
+
/* @__PURE__ */ e(
|
|
531
|
+
ne,
|
|
532
|
+
{
|
|
533
|
+
data: t,
|
|
534
|
+
dataKey: a,
|
|
535
|
+
nameKey: r,
|
|
536
|
+
innerRadius: n ? "62%" : 0,
|
|
537
|
+
outerRadius: "88%",
|
|
538
|
+
paddingAngle: n ? 2 : 1,
|
|
539
|
+
cornerRadius: n ? 4 : 2,
|
|
540
|
+
stroke: "none",
|
|
541
|
+
isAnimationActive: !1,
|
|
542
|
+
children: t.map((m, u) => /* @__PURE__ */ e(W, { fill: x(String(m[r]), u) }, String(m[r])))
|
|
543
|
+
}
|
|
544
|
+
)
|
|
545
|
+
] }) }),
|
|
546
|
+
n && /* @__PURE__ */ g("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-center justify-center", children: [
|
|
547
|
+
/* @__PURE__ */ e("div", { className: "text-xl font-bold text-foreground tabular-nums", children: c(h) }),
|
|
548
|
+
i && /* @__PURE__ */ e("div", { className: "mt-0.5 text-xs font-medium tracking-wide uppercase text-tertiary", children: i })
|
|
549
|
+
] })
|
|
550
|
+
] })
|
|
551
|
+
] });
|
|
552
|
+
}
|
|
553
|
+
);
|
|
554
|
+
$e.displayName = "PieChart";
|
|
555
|
+
const Ie = N.forwardRef(
|
|
556
|
+
({
|
|
557
|
+
data: t,
|
|
558
|
+
categoryKey: r,
|
|
559
|
+
series: a,
|
|
560
|
+
seriesLabels: n,
|
|
561
|
+
highlight: i,
|
|
562
|
+
maxValue: l,
|
|
563
|
+
height: o = 300,
|
|
564
|
+
legend: s,
|
|
565
|
+
formatValue: f,
|
|
566
|
+
className: d
|
|
567
|
+
}, v) => {
|
|
568
|
+
const c = N.useMemo(
|
|
569
|
+
() => a ?? X(t, r),
|
|
570
|
+
[r, t, a]
|
|
571
|
+
), h = f ?? w, x = l ?? Math.max(
|
|
572
|
+
1,
|
|
573
|
+
...t.flatMap(
|
|
574
|
+
(b) => c.map(
|
|
575
|
+
(A) => typeof b[A] == "number" ? b[A] : 0
|
|
576
|
+
)
|
|
577
|
+
)
|
|
578
|
+
), p = (b) => (n == null ? void 0 : n[b]) ?? b, m = (b, A) => i && c.includes(i) ? b === i ? "var(--color-chart-1)" : P : V(A), u = s ?? c.length > 1 ? c.map((b, A) => ({ label: p(b), color: m(b, A) })) : null;
|
|
579
|
+
return /* @__PURE__ */ g("div", { ref: v, className: k("relative w-full font-sans", d), children: [
|
|
580
|
+
u && /* @__PURE__ */ e($, { items: u, align: "center" }),
|
|
581
|
+
/* @__PURE__ */ e("div", { className: "mx-auto w-full max-w-[520px]", children: /* @__PURE__ */ e(F, { width: "100%", height: o, children: /* @__PURE__ */ g(
|
|
582
|
+
ie,
|
|
583
|
+
{
|
|
584
|
+
data: t,
|
|
585
|
+
cx: "50%",
|
|
586
|
+
cy: "52%",
|
|
587
|
+
outerRadius: "68%",
|
|
588
|
+
margin: { top: 10, right: 56, bottom: 16, left: 56 },
|
|
589
|
+
children: [
|
|
590
|
+
/* @__PURE__ */ e(le, { stroke: "var(--border)", radialLines: !0 }),
|
|
591
|
+
/* @__PURE__ */ e(
|
|
592
|
+
H,
|
|
593
|
+
{
|
|
594
|
+
dataKey: r,
|
|
595
|
+
tick: { fill: "var(--text-secondary)", fontSize: 11, fontWeight: 500 }
|
|
596
|
+
}
|
|
597
|
+
),
|
|
598
|
+
/* @__PURE__ */ e(
|
|
599
|
+
oe,
|
|
600
|
+
{
|
|
601
|
+
angle: 90,
|
|
602
|
+
domain: [0, x],
|
|
603
|
+
tick: !1,
|
|
604
|
+
axisLine: !1,
|
|
605
|
+
tickLine: !1
|
|
606
|
+
}
|
|
607
|
+
),
|
|
608
|
+
/* @__PURE__ */ e(C, { content: /* @__PURE__ */ e(y, { format: h }), isAnimationActive: !1 }),
|
|
609
|
+
c.map((b, A) => /* @__PURE__ */ e(
|
|
610
|
+
se,
|
|
611
|
+
{
|
|
612
|
+
dataKey: b,
|
|
613
|
+
name: p(b),
|
|
614
|
+
stroke: m(b, A),
|
|
615
|
+
fill: m(b, A),
|
|
616
|
+
fillOpacity: i ? b === i ? 0.16 : 0.05 : 0.1,
|
|
617
|
+
strokeWidth: 2,
|
|
618
|
+
dot: { r: 2.5, fill: m(b, A), strokeWidth: 0 },
|
|
619
|
+
isAnimationActive: !1
|
|
620
|
+
},
|
|
621
|
+
b
|
|
622
|
+
))
|
|
623
|
+
]
|
|
624
|
+
}
|
|
625
|
+
) }) })
|
|
626
|
+
] });
|
|
627
|
+
}
|
|
628
|
+
);
|
|
629
|
+
Ie.displayName = "RadarChart";
|
|
630
|
+
const Te = N.forwardRef(
|
|
631
|
+
({
|
|
632
|
+
data: t,
|
|
633
|
+
nameKey: r,
|
|
634
|
+
valueKey: a,
|
|
635
|
+
maxValue: n = 100,
|
|
636
|
+
centerLabel: i,
|
|
637
|
+
height: l = 280,
|
|
638
|
+
legend: o = !0,
|
|
639
|
+
formatValue: s,
|
|
640
|
+
className: f
|
|
641
|
+
}, d) => {
|
|
642
|
+
const v = s ?? w, c = t.map((p, m) => ({
|
|
643
|
+
...p,
|
|
644
|
+
name: String(p[r]),
|
|
645
|
+
fill: M(m)
|
|
646
|
+
})), h = c.length ? c.reduce(
|
|
647
|
+
(p, m) => p + (typeof m[a] == "number" ? m[a] : 0),
|
|
648
|
+
0
|
|
649
|
+
) / c.length : 0, x = o ? c.map((p, m) => ({
|
|
650
|
+
label: String(p[r]),
|
|
651
|
+
color: M(m)
|
|
652
|
+
})) : null;
|
|
653
|
+
return /* @__PURE__ */ g("div", { ref: d, className: k("relative w-full font-sans", f), children: [
|
|
654
|
+
/* @__PURE__ */ g("div", { className: "relative mx-auto w-full max-w-[420px]", children: [
|
|
655
|
+
/* @__PURE__ */ e(F, { width: "100%", height: l, children: /* @__PURE__ */ g(
|
|
656
|
+
ce,
|
|
657
|
+
{
|
|
658
|
+
data: c,
|
|
659
|
+
innerRadius: "48%",
|
|
660
|
+
outerRadius: "82%",
|
|
661
|
+
startAngle: 90,
|
|
662
|
+
endAngle: -270,
|
|
663
|
+
margin: { top: 6, right: 6, bottom: 6, left: 6 },
|
|
664
|
+
children: [
|
|
665
|
+
/* @__PURE__ */ e(H, { type: "number", domain: [0, n], tick: !1 }),
|
|
666
|
+
/* @__PURE__ */ e(C, { content: /* @__PURE__ */ e(y, { format: v }), isAnimationActive: !1 }),
|
|
667
|
+
/* @__PURE__ */ e(
|
|
668
|
+
de,
|
|
669
|
+
{
|
|
670
|
+
dataKey: a,
|
|
671
|
+
background: { fill: "var(--muted)" },
|
|
672
|
+
cornerRadius: 999,
|
|
673
|
+
maxBarSize: 18,
|
|
674
|
+
isAnimationActive: !1
|
|
675
|
+
}
|
|
676
|
+
)
|
|
677
|
+
]
|
|
678
|
+
}
|
|
679
|
+
) }),
|
|
680
|
+
/* @__PURE__ */ g("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-center justify-center", children: [
|
|
681
|
+
/* @__PURE__ */ e("div", { className: "text-xl font-bold text-foreground tabular-nums", children: v(Math.round(h)) }),
|
|
682
|
+
i && /* @__PURE__ */ e("div", { className: "mt-0.5 text-xs font-medium tracking-wide uppercase text-tertiary", children: i })
|
|
683
|
+
] })
|
|
684
|
+
] }),
|
|
685
|
+
x && /* @__PURE__ */ e($, { items: x, align: "center", className: "mb-0 mt-3" })
|
|
686
|
+
] });
|
|
687
|
+
}
|
|
688
|
+
);
|
|
689
|
+
Te.displayName = "RadialBarChart";
|
|
690
|
+
function je({
|
|
691
|
+
x: t = 0,
|
|
692
|
+
y: r = 0,
|
|
693
|
+
width: a = 0,
|
|
694
|
+
height: n = 0,
|
|
695
|
+
depth: i = 0,
|
|
696
|
+
index: l = 0,
|
|
697
|
+
name: o,
|
|
698
|
+
value: s,
|
|
699
|
+
format: f = w
|
|
700
|
+
}) {
|
|
701
|
+
if (i === 0) return /* @__PURE__ */ e("g", {});
|
|
702
|
+
const d = i === 0 ? "transparent" : M(l), v = i > 0 && l < 4, c = a > 72 && n > 38;
|
|
703
|
+
return /* @__PURE__ */ g("g", { children: [
|
|
704
|
+
/* @__PURE__ */ e(
|
|
705
|
+
"rect",
|
|
706
|
+
{
|
|
707
|
+
x: t,
|
|
708
|
+
y: r,
|
|
709
|
+
width: a,
|
|
710
|
+
height: n,
|
|
711
|
+
rx: 6,
|
|
712
|
+
ry: 6,
|
|
713
|
+
fill: d,
|
|
714
|
+
stroke: "var(--background)",
|
|
715
|
+
strokeWidth: 4
|
|
716
|
+
}
|
|
717
|
+
),
|
|
718
|
+
c && /* @__PURE__ */ e(
|
|
719
|
+
"foreignObject",
|
|
720
|
+
{
|
|
721
|
+
x: t + 8,
|
|
722
|
+
y: r + 8,
|
|
723
|
+
width: Math.max(0, a - 16),
|
|
724
|
+
height: Math.max(0, n - 16),
|
|
725
|
+
className: "pointer-events-none overflow-hidden",
|
|
726
|
+
children: /* @__PURE__ */ g("div", { className: "flex h-full flex-col justify-between", children: [
|
|
727
|
+
/* @__PURE__ */ e(
|
|
728
|
+
"p",
|
|
729
|
+
{
|
|
730
|
+
className: k(
|
|
731
|
+
"truncate text-xs font-semibold",
|
|
732
|
+
v ? "text-background" : "text-foreground"
|
|
733
|
+
),
|
|
734
|
+
children: o
|
|
735
|
+
}
|
|
736
|
+
),
|
|
737
|
+
typeof s == "number" && n > 58 && /* @__PURE__ */ e(
|
|
738
|
+
"p",
|
|
739
|
+
{
|
|
740
|
+
className: k(
|
|
741
|
+
"text-xs tabular-nums",
|
|
742
|
+
v ? "text-background/70" : "text-tertiary"
|
|
743
|
+
),
|
|
744
|
+
children: f(s)
|
|
745
|
+
}
|
|
746
|
+
)
|
|
747
|
+
] })
|
|
748
|
+
}
|
|
749
|
+
)
|
|
750
|
+
] });
|
|
751
|
+
}
|
|
752
|
+
function Be(t, r, a) {
|
|
753
|
+
const n = [], i = (l) => {
|
|
754
|
+
const o = Array.isArray(l.children) ? l.children : void 0;
|
|
755
|
+
if (o != null && o.length) {
|
|
756
|
+
o.forEach(i);
|
|
757
|
+
return;
|
|
758
|
+
}
|
|
759
|
+
typeof l[a] == "number" && n.push({
|
|
760
|
+
...l,
|
|
761
|
+
name: String(l[r] ?? ""),
|
|
762
|
+
value: l[a]
|
|
763
|
+
});
|
|
764
|
+
};
|
|
765
|
+
return t.forEach(i), n.length ? n : t;
|
|
766
|
+
}
|
|
767
|
+
const We = N.forwardRef(
|
|
768
|
+
({ data: t, nameKey: r, valueKey: a, height: n = 280, formatValue: i, className: l }, o) => {
|
|
769
|
+
const s = i ?? w, f = N.useMemo(
|
|
770
|
+
() => Be(t, r, a),
|
|
771
|
+
[t, r, a]
|
|
772
|
+
);
|
|
773
|
+
return /* @__PURE__ */ e("div", { ref: o, className: k("relative w-full font-sans", l), children: /* @__PURE__ */ e(F, { width: "100%", height: n, children: /* @__PURE__ */ e(
|
|
774
|
+
me,
|
|
775
|
+
{
|
|
776
|
+
data: f,
|
|
777
|
+
nameKey: r,
|
|
778
|
+
dataKey: a,
|
|
779
|
+
type: "flat",
|
|
780
|
+
aspectRatio: 1.6,
|
|
781
|
+
content: /* @__PURE__ */ e(je, { format: s }),
|
|
782
|
+
isAnimationActive: !1,
|
|
783
|
+
children: /* @__PURE__ */ e(C, { content: /* @__PURE__ */ e(y, { format: s }), isAnimationActive: !1 })
|
|
784
|
+
}
|
|
785
|
+
) }) });
|
|
786
|
+
}
|
|
787
|
+
);
|
|
788
|
+
We.displayName = "TreemapChart";
|
|
789
|
+
const De = N.forwardRef(
|
|
790
|
+
({ data: t, nameKey: r, valueKey: a, height: n = 280, formatValue: i, className: l }, o) => {
|
|
791
|
+
var v;
|
|
792
|
+
const s = i ?? w, f = Number(((v = t[0]) == null ? void 0 : v[a]) ?? 0), d = (c) => {
|
|
793
|
+
const h = c.index ?? 0, x = t[h];
|
|
794
|
+
if (!x) return /* @__PURE__ */ e("g", {});
|
|
795
|
+
const p = Number(x[a]), m = f ? Math.round(p / f * 100) : 0;
|
|
796
|
+
return /* @__PURE__ */ g(
|
|
797
|
+
"text",
|
|
798
|
+
{
|
|
799
|
+
x: Number(c.x ?? 0) + Number(c.width ?? 0) + 12,
|
|
800
|
+
y: Number(c.y ?? 0) + Number(c.height ?? 0) / 2,
|
|
801
|
+
dy: "0.32em",
|
|
802
|
+
textAnchor: "start",
|
|
803
|
+
className: "text-xs",
|
|
804
|
+
children: [
|
|
805
|
+
/* @__PURE__ */ e("tspan", { className: "fill-primary font-medium", children: String(x[r]) }),
|
|
806
|
+
/* @__PURE__ */ g("tspan", { className: "fill-secondary", children: [
|
|
807
|
+
" · ",
|
|
808
|
+
s(p)
|
|
809
|
+
] }),
|
|
810
|
+
/* @__PURE__ */ g("tspan", { className: "fill-tertiary", children: [
|
|
811
|
+
" · ",
|
|
812
|
+
m,
|
|
813
|
+
"%"
|
|
814
|
+
] })
|
|
815
|
+
]
|
|
816
|
+
}
|
|
817
|
+
);
|
|
818
|
+
};
|
|
819
|
+
return /* @__PURE__ */ e("div", { ref: o, className: k("relative w-full font-sans", l), children: /* @__PURE__ */ e(F, { width: "100%", height: n, children: /* @__PURE__ */ g(fe, { margin: { top: 8, right: 176, bottom: 8, left: 8 }, children: [
|
|
820
|
+
/* @__PURE__ */ e(C, { content: /* @__PURE__ */ e(y, { format: s }), isAnimationActive: !1 }),
|
|
821
|
+
/* @__PURE__ */ g(ue, { data: t, dataKey: a, nameKey: r, isAnimationActive: !1, children: [
|
|
822
|
+
t.map((c, h) => /* @__PURE__ */ e(W, { fill: M(h) }, String(c[r]))),
|
|
823
|
+
/* @__PURE__ */ e(he, { position: "right", content: d })
|
|
824
|
+
] })
|
|
825
|
+
] }) }) });
|
|
826
|
+
}
|
|
827
|
+
);
|
|
828
|
+
De.displayName = "FunnelChart";
|
|
829
|
+
export {
|
|
830
|
+
Me as AreaChart,
|
|
831
|
+
Fe as BarChart,
|
|
832
|
+
U as ComboChart,
|
|
833
|
+
Se as ComposedChart,
|
|
834
|
+
De as FunnelChart,
|
|
835
|
+
Re as LineChart,
|
|
836
|
+
$e as PieChart,
|
|
837
|
+
Ie as RadarChart,
|
|
838
|
+
Te as RadialBarChart,
|
|
839
|
+
Oe as ScatterChart,
|
|
840
|
+
We as TreemapChart
|
|
841
|
+
};
|