tembro 4.0.0 → 4.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/CHANGELOG.md +24 -0
- package/dist/components/charts/charts.d.ts +16 -5
- package/dist/components/display/chat.cjs +1 -0
- package/dist/components/display/chat.d.ts +94 -0
- package/dist/components/display/chat.js +1 -0
- package/dist/components/display/index.d.ts +1 -0
- package/dist/components/display/kanban.d.ts +33 -1
- package/dist/components/layout/sidebar.d.ts +24 -2
- package/dist/components/modern/rich-text-editor.d.ts +13 -1
- package/dist/components/theme-provider.d.ts +19 -6
- package/dist/components/ui/badge/index.d.ts +8 -2
- package/dist/src/components/charts/charts.cjs +1 -1
- package/dist/src/components/charts/charts.js +343 -252
- package/dist/src/components/display/activity-feed.cjs +1 -1
- package/dist/src/components/display/activity-feed.js +4 -1
- package/dist/src/components/display/chat.cjs +1 -0
- package/dist/src/components/display/chat.js +372 -0
- package/dist/src/components/display/index.cjs +1 -1
- package/dist/src/components/display/index.js +17 -16
- package/dist/src/components/display/kanban.cjs +1 -1
- package/dist/src/components/display/kanban.js +321 -176
- package/dist/src/components/display/timeline.cjs +1 -1
- package/dist/src/components/display/timeline.js +5 -5
- package/dist/src/components/inputs/tag-input.cjs +1 -1
- package/dist/src/components/inputs/tag-input.js +6 -2
- package/dist/src/components/layout/index.cjs +1 -1
- package/dist/src/components/layout/index.js +4 -4
- package/dist/src/components/layout/public.cjs +1 -1
- package/dist/src/components/layout/public.js +4 -4
- package/dist/src/components/layout/sidebar.cjs +1 -1
- package/dist/src/components/layout/sidebar.js +326 -228
- package/dist/src/components/layout/workspace-layout.cjs +1 -1
- package/dist/src/components/layout/workspace-layout.js +3 -3
- package/dist/src/components/modern/rich-text-editor.cjs +1 -1
- package/dist/src/components/modern/rich-text-editor.js +216 -89
- package/dist/src/components/theme-provider.cjs +1 -1
- package/dist/src/components/theme-provider.js +58 -36
- package/dist/src/components/ui/badge/index.cjs +1 -1
- package/dist/src/components/ui/badge/index.js +59 -47
- package/dist/src/components/ui/input/clearable.cjs +1 -1
- package/dist/src/components/ui/input/clearable.js +5 -2
- package/dist/src/components/ui/input/primitive.cjs +1 -1
- package/dist/src/components/ui/input/primitive.js +1 -1
- package/dist/src/index.cjs +1 -1
- package/dist/src/index.js +87 -86
- package/dist/src/public-component-surface.cjs +1 -1
- package/dist/src/public-component-surface.js +5 -0
- package/package.json +1 -1
- package/packages/cli/dist/index.cjs +3 -3
- package/packages/cli/vendor/src/components/charts/charts.tsx +55 -15
- package/packages/cli/vendor/src/components/display/activity-feed.tsx +1 -1
- package/packages/cli/vendor/src/components/display/chat.tsx +237 -0
- package/packages/cli/vendor/src/components/display/index.ts +1 -0
- package/packages/cli/vendor/src/components/display/kanban.tsx +219 -72
- package/packages/cli/vendor/src/components/display/timeline.tsx +10 -10
- package/packages/cli/vendor/src/components/inputs/tag-input.tsx +3 -2
- package/packages/cli/vendor/src/components/layout/sidebar.tsx +212 -51
- package/packages/cli/vendor/src/components/layout/workspace-layout.tsx +3 -3
- package/packages/cli/vendor/src/components/modern/rich-text-editor.tsx +115 -32
- package/packages/cli/vendor/src/components/theme-provider.tsx +82 -36
- package/packages/cli/vendor/src/components/ui/badge/index.tsx +29 -8
- package/packages/cli/vendor/src/components/ui/input/clearable.tsx +2 -2
- package/packages/cli/vendor/src/components/ui/input/primitive.tsx +1 -1
- package/packages/cli/vendor/src/public-component-surface.ts +1 -0
- package/packages/cli/vendor/templates/showcase/src/showcase/layout/HeroSection.tsx +2 -2
- package/packages/cli/vendor/templates/showcase/src/showcase/layout/WorkbenchSidebar.tsx +1 -1
- package/packages/cli/vendor/templates/styles/globals.css +136 -33
- package/registry.json +3 -1
|
@@ -2,32 +2,32 @@
|
|
|
2
2
|
import { cn as e } from "../../lib/utils.js";
|
|
3
3
|
import { Card as t, CardContent as n, CardDescription as r, CardHeader as i, CardTitle as a } from "../ui/card/index.js";
|
|
4
4
|
import { StateView as o } from "../feedback/state-view.js";
|
|
5
|
-
import "react";
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { Area as
|
|
5
|
+
import * as s from "react";
|
|
6
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
7
|
+
import { Area as u, AreaChart as d, Bar as f, BarChart as p, CartesianGrid as m, Cell as h, Line as g, LineChart as _, Pie as v, PieChart as y, ResponsiveContainer as b, Tooltip as x, XAxis as S, YAxis as C } from "recharts";
|
|
8
8
|
//#region src/components/charts/charts.tsx
|
|
9
|
-
var
|
|
9
|
+
var w = {
|
|
10
10
|
sm: 120,
|
|
11
11
|
md: 220,
|
|
12
12
|
lg: 320
|
|
13
13
|
};
|
|
14
|
-
function
|
|
14
|
+
function T(e, t) {
|
|
15
15
|
return t ?? `var(--color-chart-${e % 5 + 1}, var(--primary))`;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function E(e, t) {
|
|
18
18
|
return typeof e == "string" || typeof e == "number" ? String(e) : t;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function D(e, t) {
|
|
21
21
|
return t ? t(e) : e.toLocaleString();
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
return e === "loading" ? /* @__PURE__ */
|
|
23
|
+
function O({ state: e, emptyLabel: t, height: n }) {
|
|
24
|
+
return e === "loading" ? /* @__PURE__ */ c(o, {
|
|
25
25
|
status: "loading",
|
|
26
26
|
loadingVariant: "skeleton",
|
|
27
27
|
variant: "plain",
|
|
28
28
|
size: "compact",
|
|
29
29
|
style: { minHeight: n }
|
|
30
|
-
}) : e === "empty" ? /* @__PURE__ */
|
|
30
|
+
}) : e === "empty" ? /* @__PURE__ */ c(o, {
|
|
31
31
|
status: "empty",
|
|
32
32
|
title: t,
|
|
33
33
|
description: null,
|
|
@@ -36,61 +36,80 @@ function D({ state: e, emptyLabel: t, height: n }) {
|
|
|
36
36
|
style: { minHeight: n }
|
|
37
37
|
}) : null;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
return /* @__PURE__ */
|
|
39
|
+
function k({ data: e, valueFormatter: t, caption: n }) {
|
|
40
|
+
return /* @__PURE__ */ c("div", {
|
|
41
41
|
className: "sr-only",
|
|
42
|
-
children: /* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
42
|
+
children: /* @__PURE__ */ l("table", { children: [
|
|
43
|
+
/* @__PURE__ */ c("caption", { children: n }),
|
|
44
|
+
/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ l("tr", { children: [
|
|
45
|
+
/* @__PURE__ */ c("th", {
|
|
46
46
|
scope: "col",
|
|
47
47
|
children: "Label"
|
|
48
48
|
}),
|
|
49
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ c("th", {
|
|
50
50
|
scope: "col",
|
|
51
51
|
children: "Value"
|
|
52
52
|
}),
|
|
53
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ c("th", {
|
|
54
54
|
scope: "col",
|
|
55
55
|
children: "Description"
|
|
56
56
|
})
|
|
57
57
|
] }) }),
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ c("tbody", { children: e.map((e, n) => /* @__PURE__ */ l("tr", { children: [
|
|
59
|
+
/* @__PURE__ */ c("th", {
|
|
60
60
|
scope: "row",
|
|
61
61
|
children: e.label
|
|
62
62
|
}),
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ c("td", { children: D(e.value, t) }),
|
|
64
|
+
/* @__PURE__ */ c("td", { children: e.description })
|
|
65
65
|
] }, n)) })
|
|
66
66
|
] })
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
return
|
|
69
|
+
function A({ labels: e, series: t, valueFormatter: n, caption: r }) {
|
|
70
|
+
return /* @__PURE__ */ c("div", {
|
|
71
|
+
className: "sr-only",
|
|
72
|
+
children: /* @__PURE__ */ l("table", { children: [
|
|
73
|
+
/* @__PURE__ */ c("caption", { children: r }),
|
|
74
|
+
/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ l("tr", { children: [/* @__PURE__ */ c("th", {
|
|
75
|
+
scope: "col",
|
|
76
|
+
children: "Label"
|
|
77
|
+
}), t.map((e) => /* @__PURE__ */ c("th", {
|
|
78
|
+
scope: "col",
|
|
79
|
+
children: e.label
|
|
80
|
+
}, e.key))] }) }),
|
|
81
|
+
/* @__PURE__ */ c("tbody", { children: e.map((e, r) => /* @__PURE__ */ l("tr", { children: [/* @__PURE__ */ c("th", {
|
|
82
|
+
scope: "row",
|
|
83
|
+
children: e
|
|
84
|
+
}), t.map((e) => /* @__PURE__ */ c("td", { children: D(e.data[r] ?? 0, n) }, e.key))] }, r)) })
|
|
85
|
+
] })
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
function j({ active: e, label: t, payload: n, valueFormatter: r, labelFormatter: i }) {
|
|
89
|
+
return !e || !n?.length ? null : /* @__PURE__ */ l("div", {
|
|
71
90
|
"data-slot": "chart-tooltip",
|
|
72
91
|
className: "min-w-36 rounded-[var(--radius-md)] border border-border/75 bg-popover/98 p-3 text-popover-foreground shadow-lg backdrop-blur",
|
|
73
|
-
children: [t === void 0 ? null : /* @__PURE__ */
|
|
92
|
+
children: [t === void 0 ? null : /* @__PURE__ */ c("div", {
|
|
74
93
|
className: "mb-2 text-xs font-semibold text-muted-foreground",
|
|
75
94
|
children: i ? i(t) : t
|
|
76
|
-
}), /* @__PURE__ */
|
|
95
|
+
}), /* @__PURE__ */ c("div", {
|
|
77
96
|
className: "grid gap-1.5",
|
|
78
97
|
children: n.map((e, t) => {
|
|
79
98
|
let n = typeof e.value == "number" ? e.value : Number(e.value ?? 0);
|
|
80
|
-
return /* @__PURE__ */
|
|
99
|
+
return /* @__PURE__ */ l("div", {
|
|
81
100
|
className: "flex min-w-0 items-center gap-2 text-sm",
|
|
82
101
|
children: [
|
|
83
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ c("span", {
|
|
84
103
|
className: "size-2.5 shrink-0 rounded-sm",
|
|
85
104
|
style: { background: e.color }
|
|
86
105
|
}),
|
|
87
|
-
/* @__PURE__ */
|
|
106
|
+
/* @__PURE__ */ c("span", {
|
|
88
107
|
className: "min-w-0 flex-1 truncate",
|
|
89
108
|
children: e.name ?? "Value"
|
|
90
109
|
}),
|
|
91
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ c("span", {
|
|
92
111
|
className: "font-semibold tabular-nums",
|
|
93
|
-
children:
|
|
112
|
+
children: D(n, r)
|
|
94
113
|
})
|
|
95
114
|
]
|
|
96
115
|
}, `${e.name ?? "value"}-${t}`);
|
|
@@ -98,228 +117,300 @@ function k({ active: e, label: t, payload: n, valueFormatter: r, labelFormatter:
|
|
|
98
117
|
})]
|
|
99
118
|
});
|
|
100
119
|
}
|
|
101
|
-
function
|
|
102
|
-
return /* @__PURE__ */
|
|
120
|
+
function M({ title: o, description: s, action: u, state: d = "ready", emptyLabel: f = "No data available.", className: p, children: m, ...h }) {
|
|
121
|
+
return /* @__PURE__ */ l(t, {
|
|
103
122
|
"data-slot": "chart-frame",
|
|
104
123
|
"data-state": d,
|
|
105
124
|
className: e("min-w-0", p),
|
|
106
125
|
...h,
|
|
107
|
-
children: [o ||
|
|
126
|
+
children: [o || s || u ? /* @__PURE__ */ l(i, {
|
|
108
127
|
className: "flex-row items-start justify-between gap-3",
|
|
109
|
-
children: [/* @__PURE__ */
|
|
128
|
+
children: [/* @__PURE__ */ l("div", {
|
|
110
129
|
className: "min-w-0 space-y-1",
|
|
111
|
-
children: [o ? /* @__PURE__ */
|
|
112
|
-
}), u ? /* @__PURE__ */
|
|
130
|
+
children: [o ? /* @__PURE__ */ c(a, { children: o }) : null, s ? /* @__PURE__ */ c(r, { children: s }) : null]
|
|
131
|
+
}), u ? /* @__PURE__ */ c("div", {
|
|
113
132
|
className: "shrink-0",
|
|
114
133
|
children: u
|
|
115
134
|
}) : null]
|
|
116
|
-
}) : null, /* @__PURE__ */
|
|
135
|
+
}) : null, /* @__PURE__ */ c(n, { children: d === "ready" ? m : /* @__PURE__ */ c(O, {
|
|
117
136
|
state: d,
|
|
118
137
|
emptyLabel: f,
|
|
119
138
|
height: 180
|
|
120
139
|
}) })]
|
|
121
140
|
});
|
|
122
141
|
}
|
|
123
|
-
function
|
|
124
|
-
let
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
142
|
+
function N({ data: t = [], series: n, size: r = "md", max: i, showLabels: a = !0, showValues: o = !1, showGrid: s = !0, showTooltip: u = !0, valueFormatter: d, state: g = "ready", emptyLabel: _ = "No chart data.", barClassName: v, domain: y, ariaLabel: M = "Bar chart", stacked: N = !1, showLegend: P = !!n?.length, barRadius: F = 6, className: I, ...L }) {
|
|
143
|
+
let z = w[r], B = n?.length ? n : [{
|
|
144
|
+
key: "value",
|
|
145
|
+
label: "Value",
|
|
146
|
+
data: t.map((e) => e.value)
|
|
147
|
+
}], V = Math.max(t.length, ...B.map((e) => e.data.length)), H = g === "ready" && V === 0 ? "empty" : g;
|
|
148
|
+
if (H !== "ready") return /* @__PURE__ */ c(O, {
|
|
149
|
+
state: H,
|
|
150
|
+
emptyLabel: _,
|
|
151
|
+
height: z
|
|
129
152
|
});
|
|
130
|
-
let
|
|
131
|
-
name
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
})), I = v ?? (r === void 0 ? ["auto", "auto"] : ["auto", r]);
|
|
137
|
-
return /* @__PURE__ */ c("div", {
|
|
153
|
+
let U = Array.from({ length: V }, (e, n) => t[n]?.label ?? `Item ${n + 1}`), W = U.map((e, t) => Object.fromEntries([
|
|
154
|
+
["name", E(e, `Item ${t + 1}`)],
|
|
155
|
+
["originalLabel", e],
|
|
156
|
+
...B.map((e) => [e.key, e.data[t] ?? 0])
|
|
157
|
+
])), G = y ?? (i === void 0 ? ["auto", "auto"] : ["auto", i]);
|
|
158
|
+
return /* @__PURE__ */ l("div", {
|
|
138
159
|
"data-slot": "bar-chart",
|
|
139
160
|
role: "img",
|
|
140
|
-
"aria-label":
|
|
141
|
-
className: e("min-w-0",
|
|
142
|
-
...
|
|
143
|
-
children: [
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
161
|
+
"aria-label": M,
|
|
162
|
+
className: e("min-w-0", I),
|
|
163
|
+
...L,
|
|
164
|
+
children: [
|
|
165
|
+
/* @__PURE__ */ c("div", {
|
|
166
|
+
style: { height: z },
|
|
167
|
+
children: /* @__PURE__ */ c(b, {
|
|
168
|
+
width: "100%",
|
|
169
|
+
height: "100%",
|
|
170
|
+
minWidth: 1,
|
|
171
|
+
minHeight: 1,
|
|
172
|
+
children: /* @__PURE__ */ l(p, {
|
|
173
|
+
data: W,
|
|
174
|
+
margin: {
|
|
175
|
+
top: o ? 20 : 8,
|
|
176
|
+
right: 8,
|
|
177
|
+
bottom: a ? 8 : 0,
|
|
178
|
+
left: 0
|
|
179
|
+
},
|
|
180
|
+
children: [
|
|
181
|
+
s ? /* @__PURE__ */ c(m, {
|
|
182
|
+
vertical: !1,
|
|
183
|
+
stroke: "var(--border)",
|
|
184
|
+
strokeDasharray: "4 6"
|
|
185
|
+
}) : null,
|
|
186
|
+
/* @__PURE__ */ c(S, {
|
|
187
|
+
dataKey: "name",
|
|
188
|
+
hide: !a,
|
|
189
|
+
axisLine: !1,
|
|
190
|
+
tickLine: !1,
|
|
191
|
+
tick: {
|
|
192
|
+
fill: "var(--muted-foreground)",
|
|
193
|
+
fontSize: 12
|
|
194
|
+
},
|
|
195
|
+
interval: "preserveStartEnd"
|
|
196
|
+
}),
|
|
197
|
+
/* @__PURE__ */ c(C, {
|
|
198
|
+
hide: !0,
|
|
199
|
+
domain: G
|
|
200
|
+
}),
|
|
201
|
+
u ? /* @__PURE__ */ c(x, {
|
|
202
|
+
cursor: {
|
|
203
|
+
fill: "var(--muted)",
|
|
204
|
+
opacity: .35
|
|
205
|
+
},
|
|
206
|
+
content: /* @__PURE__ */ c(j, { valueFormatter: d })
|
|
207
|
+
}) : null,
|
|
208
|
+
B.map((e, r) => /* @__PURE__ */ c(f, {
|
|
209
|
+
dataKey: e.key,
|
|
210
|
+
name: E(e.label, e.key),
|
|
211
|
+
fill: T(r, e.color),
|
|
212
|
+
stackId: N ? "total" : void 0,
|
|
213
|
+
radius: [
|
|
214
|
+
F,
|
|
215
|
+
F,
|
|
216
|
+
2,
|
|
217
|
+
2
|
|
218
|
+
],
|
|
219
|
+
className: v,
|
|
220
|
+
isAnimationActive: !1,
|
|
221
|
+
label: o && (!N || r === B.length - 1) ? {
|
|
222
|
+
position: "top",
|
|
223
|
+
fill: "var(--muted-foreground)",
|
|
224
|
+
fontSize: 11,
|
|
225
|
+
formatter: (e) => String(D(Number(e), d))
|
|
226
|
+
} : !1,
|
|
227
|
+
children: n?.length ? null : t.map((e, t) => /* @__PURE__ */ c(h, { fill: T(t, e.color) }, t))
|
|
228
|
+
}, e.key))
|
|
229
|
+
]
|
|
230
|
+
})
|
|
206
231
|
})
|
|
232
|
+
}),
|
|
233
|
+
P && B.length > 1 ? /* @__PURE__ */ c(R, {
|
|
234
|
+
className: "mt-3",
|
|
235
|
+
data: B.map((e, t) => ({
|
|
236
|
+
label: e.label,
|
|
237
|
+
value: 0,
|
|
238
|
+
color: T(t, e.color)
|
|
239
|
+
}))
|
|
240
|
+
}) : null,
|
|
241
|
+
n?.length ? /* @__PURE__ */ c(A, {
|
|
242
|
+
labels: U,
|
|
243
|
+
series: B,
|
|
244
|
+
valueFormatter: d,
|
|
245
|
+
caption: M
|
|
246
|
+
}) : /* @__PURE__ */ c(k, {
|
|
247
|
+
data: t,
|
|
248
|
+
valueFormatter: d,
|
|
249
|
+
caption: M
|
|
207
250
|
})
|
|
208
|
-
|
|
209
|
-
data: t,
|
|
210
|
-
valueFormatter: u,
|
|
211
|
-
caption: A
|
|
212
|
-
})]
|
|
251
|
+
]
|
|
213
252
|
});
|
|
214
253
|
}
|
|
215
|
-
function
|
|
216
|
-
let
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
254
|
+
function P({ values: t = [], series: n, size: r = "md", width: i = 560, height: a, showArea: o = !1, showGrid: f = !0, showAxis: p = !1, showTooltip: h = !0, labels: v, valueFormatter: y, stroke: D = "var(--primary)", state: k = "ready", emptyLabel: M = "No line data.", domain: N = ["auto", "auto"], ariaLabel: P = o ? "Area chart" : "Line chart", curve: F = "monotone", showDots: I = !o, showLegend: L = !!n?.length, gradient: z = o, strokeWidth: B = 2.5, className: V, style: H, ...U }) {
|
|
255
|
+
let W = a ?? w[r], G = s.useId().replace(/:/g, ""), K = n?.length ? n : [{
|
|
256
|
+
key: "value",
|
|
257
|
+
label: "Value",
|
|
258
|
+
data: t,
|
|
259
|
+
color: D
|
|
260
|
+
}], q = Math.max(...K.map((e) => e.data.length), 0), J = k === "ready" && q === 0 ? "empty" : k;
|
|
261
|
+
if (J !== "ready") return /* @__PURE__ */ c(O, {
|
|
262
|
+
state: J,
|
|
263
|
+
emptyLabel: M,
|
|
264
|
+
height: W
|
|
221
265
|
});
|
|
222
|
-
let
|
|
223
|
-
name
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
return /* @__PURE__ */
|
|
228
|
-
"data-slot":
|
|
266
|
+
let Y = Array.from({ length: q }, (e, t) => v?.[t] ?? String(t + 1)), X = Y.map((e, t) => Object.fromEntries([
|
|
267
|
+
["name", E(e, String(t + 1))],
|
|
268
|
+
["originalLabel", e],
|
|
269
|
+
...K.map((e) => [e.key, e.data[t] ?? 0])
|
|
270
|
+
])), Z = o ? d : _;
|
|
271
|
+
return /* @__PURE__ */ l("div", {
|
|
272
|
+
"data-slot": o ? "area-chart" : "line-chart",
|
|
229
273
|
role: "img",
|
|
230
|
-
"aria-label":
|
|
231
|
-
"data-chart-width":
|
|
232
|
-
className: e("min-w-0",
|
|
233
|
-
style:
|
|
234
|
-
...
|
|
235
|
-
children: [
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
},
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
274
|
+
"aria-label": P,
|
|
275
|
+
"data-chart-width": i,
|
|
276
|
+
className: e("min-w-0", V),
|
|
277
|
+
style: H,
|
|
278
|
+
...U,
|
|
279
|
+
children: [
|
|
280
|
+
/* @__PURE__ */ c("div", {
|
|
281
|
+
style: { height: W },
|
|
282
|
+
children: /* @__PURE__ */ c(b, {
|
|
283
|
+
width: "100%",
|
|
284
|
+
height: "100%",
|
|
285
|
+
minWidth: 1,
|
|
286
|
+
minHeight: 1,
|
|
287
|
+
children: /* @__PURE__ */ l(Z, {
|
|
288
|
+
data: X,
|
|
289
|
+
margin: {
|
|
290
|
+
top: 10,
|
|
291
|
+
right: 10,
|
|
292
|
+
bottom: p ? 8 : 0,
|
|
293
|
+
left: p ? -12 : 0
|
|
294
|
+
},
|
|
295
|
+
children: [
|
|
296
|
+
o && z ? /* @__PURE__ */ c("defs", { children: K.map((e, t) => {
|
|
297
|
+
let n = T(t, e.color);
|
|
298
|
+
return /* @__PURE__ */ l("linearGradient", {
|
|
299
|
+
id: `${G}-${e.key}`,
|
|
300
|
+
x1: "0",
|
|
301
|
+
y1: "0",
|
|
302
|
+
x2: "0",
|
|
303
|
+
y2: "1",
|
|
304
|
+
children: [/* @__PURE__ */ c("stop", {
|
|
305
|
+
offset: "0%",
|
|
306
|
+
stopColor: n,
|
|
307
|
+
stopOpacity: .34
|
|
308
|
+
}), /* @__PURE__ */ c("stop", {
|
|
309
|
+
offset: "92%",
|
|
310
|
+
stopColor: n,
|
|
311
|
+
stopOpacity: .02
|
|
312
|
+
})]
|
|
313
|
+
}, e.key);
|
|
314
|
+
}) }) : null,
|
|
315
|
+
f ? /* @__PURE__ */ c(m, {
|
|
316
|
+
vertical: !1,
|
|
317
|
+
stroke: "var(--border)",
|
|
318
|
+
strokeDasharray: "4 6"
|
|
319
|
+
}) : null,
|
|
320
|
+
/* @__PURE__ */ c(S, {
|
|
321
|
+
dataKey: "name",
|
|
322
|
+
hide: !p,
|
|
323
|
+
axisLine: !1,
|
|
324
|
+
tickLine: !1,
|
|
325
|
+
tick: {
|
|
326
|
+
fill: "var(--muted-foreground)",
|
|
327
|
+
fontSize: 12
|
|
328
|
+
},
|
|
329
|
+
interval: "preserveStartEnd"
|
|
330
|
+
}),
|
|
331
|
+
/* @__PURE__ */ c(C, {
|
|
332
|
+
hide: !p,
|
|
333
|
+
domain: N,
|
|
334
|
+
axisLine: !1,
|
|
335
|
+
tickLine: !1,
|
|
336
|
+
width: 44,
|
|
337
|
+
tick: {
|
|
338
|
+
fill: "var(--muted-foreground)",
|
|
339
|
+
fontSize: 11
|
|
340
|
+
}
|
|
341
|
+
}),
|
|
342
|
+
h ? /* @__PURE__ */ c(x, { content: /* @__PURE__ */ c(j, { valueFormatter: y }) }) : null,
|
|
343
|
+
K.map((e, t) => {
|
|
344
|
+
let n = T(t, e.color);
|
|
345
|
+
return o ? /* @__PURE__ */ c(u, {
|
|
346
|
+
type: F,
|
|
347
|
+
dataKey: e.key,
|
|
348
|
+
name: E(e.label, e.key),
|
|
349
|
+
stroke: n,
|
|
350
|
+
strokeWidth: B,
|
|
351
|
+
fill: z ? `url(#${G}-${e.key})` : n,
|
|
352
|
+
fillOpacity: z ? 1 : .12,
|
|
353
|
+
dot: I ? {
|
|
354
|
+
r: 3,
|
|
355
|
+
fill: n,
|
|
356
|
+
strokeWidth: 2,
|
|
357
|
+
stroke: "var(--background)"
|
|
358
|
+
} : !1,
|
|
359
|
+
activeDot: {
|
|
360
|
+
r: 5,
|
|
361
|
+
strokeWidth: 2,
|
|
362
|
+
stroke: "var(--background)"
|
|
363
|
+
},
|
|
364
|
+
isAnimationActive: !1
|
|
365
|
+
}, e.key) : /* @__PURE__ */ c(g, {
|
|
366
|
+
type: F,
|
|
367
|
+
dataKey: e.key,
|
|
368
|
+
name: E(e.label, e.key),
|
|
369
|
+
stroke: n,
|
|
370
|
+
strokeWidth: B,
|
|
371
|
+
dot: I ? {
|
|
372
|
+
r: 3,
|
|
373
|
+
fill: n,
|
|
374
|
+
strokeWidth: 2,
|
|
375
|
+
stroke: "var(--background)"
|
|
376
|
+
} : !1,
|
|
377
|
+
activeDot: {
|
|
378
|
+
r: 5,
|
|
379
|
+
strokeWidth: 2,
|
|
380
|
+
stroke: "var(--background)"
|
|
381
|
+
},
|
|
382
|
+
isAnimationActive: !1
|
|
383
|
+
}, e.key);
|
|
384
|
+
})
|
|
385
|
+
]
|
|
386
|
+
})
|
|
303
387
|
})
|
|
388
|
+
}),
|
|
389
|
+
L && K.length > 1 ? /* @__PURE__ */ c(R, {
|
|
390
|
+
className: "mt-3",
|
|
391
|
+
data: K.map((e, t) => ({
|
|
392
|
+
label: e.label,
|
|
393
|
+
value: 0,
|
|
394
|
+
color: T(t, e.color)
|
|
395
|
+
}))
|
|
396
|
+
}) : null,
|
|
397
|
+
/* @__PURE__ */ c(A, {
|
|
398
|
+
labels: Y,
|
|
399
|
+
series: K,
|
|
400
|
+
valueFormatter: y,
|
|
401
|
+
caption: P
|
|
304
402
|
})
|
|
305
|
-
|
|
306
|
-
data: t.map((e, t) => ({
|
|
307
|
-
label: m?.[t] ?? t + 1,
|
|
308
|
-
value: e
|
|
309
|
-
})),
|
|
310
|
-
valueFormatter: _,
|
|
311
|
-
caption: j
|
|
312
|
-
})]
|
|
403
|
+
]
|
|
313
404
|
});
|
|
314
405
|
}
|
|
315
|
-
function
|
|
316
|
-
return /* @__PURE__ */
|
|
406
|
+
function F(e) {
|
|
407
|
+
return /* @__PURE__ */ c(P, {
|
|
317
408
|
showArea: !0,
|
|
318
409
|
...e
|
|
319
410
|
});
|
|
320
411
|
}
|
|
321
|
-
function
|
|
322
|
-
return /* @__PURE__ */
|
|
412
|
+
function I({ values: t, positive: n = !0, stroke: r, className: i, showTooltip: a = !1, ...o }) {
|
|
413
|
+
return /* @__PURE__ */ c(P, {
|
|
323
414
|
values: t,
|
|
324
415
|
size: "sm",
|
|
325
416
|
stroke: r ?? (n ? "var(--aui-success,var(--primary))" : "var(--destructive)"),
|
|
@@ -331,20 +422,20 @@ function P({ values: t, positive: n = !0, stroke: r, className: i, showTooltip:
|
|
|
331
422
|
...o
|
|
332
423
|
});
|
|
333
424
|
}
|
|
334
|
-
function
|
|
335
|
-
let
|
|
336
|
-
if (
|
|
337
|
-
state:
|
|
338
|
-
emptyLabel:
|
|
425
|
+
function L({ data: t, size: n = 180, strokeWidth: r = 18, centerLabel: i, centerValue: a, state: o = "ready", emptyLabel: s = "No distribution data.", showTooltip: u = !0, valueFormatter: d, ariaLabel: f = "Donut chart", className: p, style: m, ...g }) {
|
|
426
|
+
let _ = o === "ready" && t.length === 0 ? "empty" : o;
|
|
427
|
+
if (_ !== "ready") return /* @__PURE__ */ c(O, {
|
|
428
|
+
state: _,
|
|
429
|
+
emptyLabel: s,
|
|
339
430
|
height: n
|
|
340
431
|
});
|
|
341
432
|
let S = t.map((e, t) => ({
|
|
342
|
-
name:
|
|
433
|
+
name: E(e.label, `Item ${t + 1}`),
|
|
343
434
|
value: Math.max(0, e.value),
|
|
344
|
-
fill:
|
|
435
|
+
fill: T(t, e.color),
|
|
345
436
|
description: e.description
|
|
346
437
|
})), C = Math.max(8, n / 2 - 8);
|
|
347
|
-
return /* @__PURE__ */
|
|
438
|
+
return /* @__PURE__ */ l("div", {
|
|
348
439
|
"data-slot": "donut-chart",
|
|
349
440
|
role: "img",
|
|
350
441
|
"aria-label": f,
|
|
@@ -352,16 +443,16 @@ function F({ data: t, size: n = 180, strokeWidth: r = 18, centerLabel: i, center
|
|
|
352
443
|
style: {
|
|
353
444
|
width: n,
|
|
354
445
|
height: n,
|
|
355
|
-
...
|
|
446
|
+
...m
|
|
356
447
|
},
|
|
357
448
|
...g,
|
|
358
449
|
children: [
|
|
359
|
-
/* @__PURE__ */
|
|
450
|
+
/* @__PURE__ */ c(b, {
|
|
360
451
|
width: "100%",
|
|
361
452
|
height: "100%",
|
|
362
453
|
minWidth: 1,
|
|
363
454
|
minHeight: 1,
|
|
364
|
-
children: /* @__PURE__ */
|
|
455
|
+
children: /* @__PURE__ */ l(y, { children: [u ? /* @__PURE__ */ c(x, { content: /* @__PURE__ */ c(j, { valueFormatter: d }) }) : null, /* @__PURE__ */ c(v, {
|
|
365
456
|
data: S,
|
|
366
457
|
dataKey: "value",
|
|
367
458
|
nameKey: "name",
|
|
@@ -373,20 +464,20 @@ function F({ data: t, size: n = 180, strokeWidth: r = 18, centerLabel: i, center
|
|
|
373
464
|
stroke: "var(--background)",
|
|
374
465
|
strokeWidth: 2,
|
|
375
466
|
isAnimationActive: !1,
|
|
376
|
-
children: S.map((e) => /* @__PURE__ */
|
|
467
|
+
children: S.map((e) => /* @__PURE__ */ c(h, { fill: e.fill }, e.name))
|
|
377
468
|
})] })
|
|
378
469
|
}),
|
|
379
|
-
a || i ? /* @__PURE__ */
|
|
470
|
+
a || i ? /* @__PURE__ */ l("div", {
|
|
380
471
|
className: "pointer-events-none absolute inset-0 grid place-content-center text-center",
|
|
381
|
-
children: [/* @__PURE__ */
|
|
472
|
+
children: [/* @__PURE__ */ c("div", {
|
|
382
473
|
className: "text-xl font-semibold tabular-nums",
|
|
383
474
|
children: a
|
|
384
|
-
}), /* @__PURE__ */
|
|
475
|
+
}), /* @__PURE__ */ c("div", {
|
|
385
476
|
className: "text-xs text-muted-foreground",
|
|
386
477
|
children: i
|
|
387
478
|
})]
|
|
388
479
|
}) : null,
|
|
389
|
-
/* @__PURE__ */
|
|
480
|
+
/* @__PURE__ */ c(k, {
|
|
390
481
|
data: t,
|
|
391
482
|
valueFormatter: d,
|
|
392
483
|
caption: f
|
|
@@ -394,49 +485,49 @@ function F({ data: t, size: n = 180, strokeWidth: r = 18, centerLabel: i, center
|
|
|
394
485
|
]
|
|
395
486
|
});
|
|
396
487
|
}
|
|
397
|
-
function
|
|
398
|
-
return /* @__PURE__ */
|
|
488
|
+
function R({ data: t, className: n, ...r }) {
|
|
489
|
+
return /* @__PURE__ */ c("div", {
|
|
399
490
|
"data-slot": "chart-legend",
|
|
400
491
|
className: e("flex flex-wrap gap-x-4 gap-y-2 text-xs text-muted-foreground", n),
|
|
401
492
|
...r,
|
|
402
|
-
children: t.map((e, t) => /* @__PURE__ */
|
|
493
|
+
children: t.map((e, t) => /* @__PURE__ */ l("div", {
|
|
403
494
|
className: "inline-flex min-w-0 items-center gap-2",
|
|
404
|
-
children: [/* @__PURE__ */
|
|
495
|
+
children: [/* @__PURE__ */ c("span", {
|
|
405
496
|
className: "size-2.5 shrink-0 rounded-sm",
|
|
406
|
-
style: { background:
|
|
407
|
-
}), /* @__PURE__ */
|
|
497
|
+
style: { background: T(t, e.color) }
|
|
498
|
+
}), /* @__PURE__ */ c("span", {
|
|
408
499
|
className: "truncate",
|
|
409
500
|
children: e.label
|
|
410
501
|
})]
|
|
411
502
|
}, t))
|
|
412
503
|
});
|
|
413
504
|
}
|
|
414
|
-
function
|
|
415
|
-
return /* @__PURE__ */
|
|
505
|
+
function z({ label: t, value: n, change: r, positive: i = !0, values: a, className: o, ...s }) {
|
|
506
|
+
return /* @__PURE__ */ l("div", {
|
|
416
507
|
"data-slot": "metric-trend",
|
|
417
508
|
className: e("grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-end gap-4", o),
|
|
418
|
-
...
|
|
419
|
-
children: [/* @__PURE__ */
|
|
509
|
+
...s,
|
|
510
|
+
children: [/* @__PURE__ */ l("div", {
|
|
420
511
|
className: "min-w-0",
|
|
421
512
|
children: [
|
|
422
|
-
/* @__PURE__ */
|
|
513
|
+
/* @__PURE__ */ c("div", {
|
|
423
514
|
className: "text-sm text-muted-foreground",
|
|
424
515
|
children: t
|
|
425
516
|
}),
|
|
426
|
-
/* @__PURE__ */
|
|
517
|
+
/* @__PURE__ */ c("div", {
|
|
427
518
|
className: "mt-1 text-2xl font-semibold tracking-tight tabular-nums",
|
|
428
519
|
children: n
|
|
429
520
|
}),
|
|
430
|
-
r ? /* @__PURE__ */
|
|
521
|
+
r ? /* @__PURE__ */ c("div", {
|
|
431
522
|
className: e("mt-1 text-xs font-medium", i ? "text-[color:var(--aui-success,var(--primary))]" : "text-destructive"),
|
|
432
523
|
children: r
|
|
433
524
|
}) : null
|
|
434
525
|
]
|
|
435
|
-
}), a?.length ? /* @__PURE__ */
|
|
526
|
+
}), a?.length ? /* @__PURE__ */ c(I, {
|
|
436
527
|
values: a,
|
|
437
528
|
positive: i
|
|
438
529
|
}) : null]
|
|
439
530
|
});
|
|
440
531
|
}
|
|
441
532
|
//#endregion
|
|
442
|
-
export {
|
|
533
|
+
export { F as AreaChart, N as BarChart, M as ChartFrame, R as ChartLegend, j as ChartTooltipContent, L as DonutChart, P as LineChart, z as MetricTrend, I as Sparkline };
|