@krosoft/react 0.0.238 → 0.0.240
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AppActions-C_0YI75w.js +60 -0
- package/dist/AppSubTitle-tqqV9nuT.js +19 -0
- package/dist/AppTitle-BR4JFZfp.js +19 -0
- package/dist/ErrorAlert-BDqDHUUc.js +27 -0
- package/dist/GenericForm-CWXT5wiv.js +310 -0
- package/dist/ImageInput-CN2ozjpc.js +80 -0
- package/dist/MultiSelect-BF0zL0B0.js +134 -0
- package/dist/SearchInput-BJPT0SbB.js +255 -0
- package/dist/alert-REQGK9bR.js +32 -0
- package/dist/behavior-BR_V9Rpe.js +76 -0
- package/dist/cards-Cta6x49J.js +126 -0
- package/dist/chart-Dq3AIrue.js +166 -0
- package/dist/charts-CXhVUqLH.js +328 -0
- package/dist/components/core/cards/index.js +2 -10
- package/dist/components/core/charts/index.js +2 -11
- package/dist/components/core/dialogs/index.js +4 -19
- package/dist/components/core/filters/index.js +426 -7
- package/dist/components/core/forms/index.js +2 -4
- package/dist/components/core/index.js +24 -97
- package/dist/components/core/inputs/index.js +4 -11
- package/dist/components/core/language/index.js +2 -4
- package/dist/components/core/layouts/index.js +50 -11
- package/dist/components/core/navbar/index.js +2 -9
- package/dist/components/core/states/index.js +3 -8
- package/dist/components/core/table/index.js +2 -15
- package/dist/components/core/tabs/index.js +188 -6
- package/dist/components/core/theme/index.js +2 -4
- package/dist/components/index.js +28 -322
- package/dist/components/ui/index.js +8 -240
- package/dist/contexts/index.js +2 -5
- package/dist/dialogs-BGHSClsq.js +208 -0
- package/dist/helpers/index.js +39 -46
- package/dist/hooks/behavior/index.js +2 -10
- package/dist/hooks/index.js +11 -30
- package/dist/hooks/ui/index.js +10 -22
- package/dist/i18n/index.js +2 -10
- package/dist/i18n-Dw99bRmg.js +190 -0
- package/dist/language-DxHhlpgN.js +58 -0
- package/dist/navbar-Bc5OQWRI.js +385 -0
- package/dist/providers/index.js +42 -49
- package/dist/pwa/index.js +32 -34
- package/dist/select-ULiTPOr5.js +81 -0
- package/dist/sheet-CRrYTZrl.js +226 -0
- package/dist/sidebar.context-BahtU6hE.js +5 -0
- package/dist/skeleton-D6Ga4BLw.js +11 -0
- package/dist/states-N8-LjFng.js +26 -0
- package/dist/table-muUyiaK6.js +571 -0
- package/dist/tailwind/index.js +126 -156
- package/dist/tailwind.helper-CJaRYBmL.js +8 -0
- package/dist/theme-B_n0F6R4.js +57 -0
- package/dist/tokens/index.js +37 -46
- package/dist/tooltip-B2dzyfs9.js +50 -0
- package/dist/types/forms/index.js +0 -1
- package/dist/types/index.js +1 -1
- package/dist/ui-CiX0E_bn.js +1165 -0
- package/dist/ui-DSVBO3iM.js +46 -0
- package/dist/useDocumentTitle-D7MywIeB.js +19 -0
- package/dist/useFixedColumns-DfAX30tT.js +147 -0
- package/dist/useLanguage-DN3CuBv5.js +19 -0
- package/dist/useMobile-pTQ8lWvt.js +16 -0
- package/dist/useNotifications-CyhTruIG.js +20 -0
- package/dist/useScrollFade-D9kqJBDh.js +27 -0
- package/dist/useTheme-DVfcJ-Qd.js +25 -0
- package/dist/useToast-UeDRLovh.js +103 -0
- package/package.json +3 -3
- package/dist/AppActions-BFwztl-1.js +0 -76
- package/dist/AppSubTitle-BTN0YAc7.js +0 -13
- package/dist/AppTitle-D15YXeMx.js +0 -13
- package/dist/AppVerticalTabs-B7XXtAVj.js +0 -103
- package/dist/ConfirmationDialog-Dj4WdnHg.js +0 -188
- package/dist/DataTable-CjrR27Di.js +0 -638
- package/dist/ErrorAlert-B99Xb_Hg.js +0 -23
- package/dist/ErrorState-CkeS_IBT.js +0 -14
- package/dist/GenericForm-CydibLHU.js +0 -343
- package/dist/ImageInput-DoOOvvth.js +0 -70
- package/dist/KpiCardsLayout-Bq4xQ3i8.js +0 -43
- package/dist/LanguageSelector-C7E51rCQ.js +0 -47
- package/dist/LoadingState-BN0YaPSs.js +0 -9
- package/dist/MetricCard-B0xnFyim.js +0 -53
- package/dist/MultiSelect-DbH7LrsD.js +0 -149
- package/dist/PieChart-uozNJtEx.js +0 -295
- package/dist/SearchInput-DIZ5Yt6L.js +0 -246
- package/dist/SkeletonCards-B9C4cNMr.js +0 -75
- package/dist/TableFilter-CmEVF5Bo.js +0 -422
- package/dist/ThemeSelector-CLi4_epH.js +0 -52
- package/dist/Topbar-Clby5_uj.js +0 -431
- package/dist/alert-B9F1N9Qk.js +0 -30
- package/dist/chart-DntJZGxB.js +0 -181
- package/dist/select-BpjFWqAY.js +0 -96
- package/dist/sheet-XYI-ezvY.js +0 -292
- package/dist/sidebar.context-D5nywlmP.js +0 -6
- package/dist/skeleton-BX4RcsiK.js +0 -8
- package/dist/tailwind.helper-B6yFEsav.js +0 -8
- package/dist/toaster-CyzB1m5z.js +0 -75
- package/dist/toggle-group-iZqnrTj7.js +0 -1276
- package/dist/tooltip-DVeqVwqV.js +0 -61
- package/dist/useDateFnsLocale-D6VExZ8U.js +0 -11
- package/dist/useDocumentTitle-WNwdPz-I.js +0 -14
- package/dist/useFixedColumns-CKZyu4PD.js +0 -161
- package/dist/useKrosoftTranslation-BTp46G94.js +0 -47
- package/dist/useLanguage-C9jI2nwn.js +0 -19
- package/dist/useMobile-DN1_OMDB.js +0 -16
- package/dist/useNotifications-zbUhCvF_.js +0 -12
- package/dist/usePage-BQm6tdJD.js +0 -84
- package/dist/useScrollFade-BA4KqJYp.js +0 -23
- package/dist/useServerTable-UvTY6L1N.js +0 -38
- package/dist/useSidebar-BJuALHqQ.js +0 -11
- package/dist/useTheme-DS6ZjdzM.js +0 -27
- package/dist/useToast-BFTk4lWz.js +0 -100
package/dist/Topbar-Clby5_uj.js
DELETED
|
@@ -1,431 +0,0 @@
|
|
|
1
|
-
import { jsxs as s, Fragment as G, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import "date-fns/locale";
|
|
3
|
-
import "react-i18next";
|
|
4
|
-
import { u as B } from "./useKrosoftTranslation-BTp46G94.js";
|
|
5
|
-
import * as $ from "react";
|
|
6
|
-
import { SearchIcon as _, LoaderCircleIcon as M, BellIcon as Q, Trash2Icon as R, ChevronDownIcon as q, MenuIcon as H } from "lucide-react";
|
|
7
|
-
import { c as l } from "./tailwind.helper-B6yFEsav.js";
|
|
8
|
-
import { B as E, T as P, c as V, a as X, b as J } from "./tooltip-DVeqVwqV.js";
|
|
9
|
-
import { j as Y, m as Z, o as I, k as ee, l as te, n as re, P as ae, s as se, r as ie, S as ne, I as le, u as oe, w as ce, E as de, x as me } from "./sheet-XYI-ezvY.js";
|
|
10
|
-
import "./sidebar.context-D5nywlmP.js";
|
|
11
|
-
import { u as F } from "./useSidebar-BJuALHqQ.js";
|
|
12
|
-
import "next-themes";
|
|
13
|
-
import { S as W } from "./skeleton-BX4RcsiK.js";
|
|
14
|
-
const Se = ({
|
|
15
|
-
groups: i,
|
|
16
|
-
search: d,
|
|
17
|
-
onSearch: h,
|
|
18
|
-
onSelect: o,
|
|
19
|
-
loading: r = !1,
|
|
20
|
-
open: c,
|
|
21
|
-
onOpenChange: m,
|
|
22
|
-
trigger: x = !0,
|
|
23
|
-
triggerLabel: g,
|
|
24
|
-
shortcut: N = !0,
|
|
25
|
-
shortcutLabel: w = "Ctrl+K",
|
|
26
|
-
placeholder: S,
|
|
27
|
-
emptyLabel: j,
|
|
28
|
-
loadingLabel: k,
|
|
29
|
-
title: T,
|
|
30
|
-
description: A,
|
|
31
|
-
hint: K,
|
|
32
|
-
className: u
|
|
33
|
-
}) => {
|
|
34
|
-
const { t: b } = B(), [D, t] = $.useState(!1), z = c !== void 0, v = z ? c : D, a = $.useCallback(
|
|
35
|
-
(n) => {
|
|
36
|
-
z || t(n), m == null || m(n);
|
|
37
|
-
},
|
|
38
|
-
[z, m]
|
|
39
|
-
);
|
|
40
|
-
$.useEffect(() => {
|
|
41
|
-
if (!N) return;
|
|
42
|
-
const n = (p) => {
|
|
43
|
-
p.key.toLowerCase() !== "k" || !(p.metaKey || p.ctrlKey) || (p.preventDefault(), a(!v));
|
|
44
|
-
};
|
|
45
|
-
return window.addEventListener("keydown", n), () => {
|
|
46
|
-
window.removeEventListener("keydown", n);
|
|
47
|
-
};
|
|
48
|
-
}, [N, v, a]);
|
|
49
|
-
const y = (n) => {
|
|
50
|
-
a(!1), h(""), o(n);
|
|
51
|
-
}, C = i.some((n) => n.items.length > 0);
|
|
52
|
-
return /* @__PURE__ */ s(G, { children: [
|
|
53
|
-
x && /* @__PURE__ */ e(
|
|
54
|
-
E,
|
|
55
|
-
{
|
|
56
|
-
variant: "ghost",
|
|
57
|
-
size: "icon",
|
|
58
|
-
"aria-label": g ?? b("search.trigger"),
|
|
59
|
-
title: N ? `${g ?? b("search.trigger")} (${w})` : g ?? b("search.trigger"),
|
|
60
|
-
className: "rounded-full",
|
|
61
|
-
onClick: () => {
|
|
62
|
-
a(!0);
|
|
63
|
-
},
|
|
64
|
-
children: /* @__PURE__ */ e(_, { className: "size-4" })
|
|
65
|
-
}
|
|
66
|
-
),
|
|
67
|
-
/* @__PURE__ */ s(
|
|
68
|
-
Y,
|
|
69
|
-
{
|
|
70
|
-
open: v,
|
|
71
|
-
onOpenChange: a,
|
|
72
|
-
title: T ?? b("search.globalTitle"),
|
|
73
|
-
description: A ?? b("search.globalDescription"),
|
|
74
|
-
shouldFilter: !1,
|
|
75
|
-
className: u,
|
|
76
|
-
children: [
|
|
77
|
-
/* @__PURE__ */ e(Z, { value: d, onValueChange: h, placeholder: S ?? b("search.placeholder") }),
|
|
78
|
-
/* @__PURE__ */ s(I, { children: [
|
|
79
|
-
r && /* @__PURE__ */ s("div", { className: "flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground", children: [
|
|
80
|
-
/* @__PURE__ */ e(M, { className: "size-4 animate-spin" }),
|
|
81
|
-
k ?? b("search.loading")
|
|
82
|
-
] }),
|
|
83
|
-
!C && !r && /* @__PURE__ */ e(ee, { children: j ?? b("states.noResultDot") }),
|
|
84
|
-
i.map(
|
|
85
|
-
(n) => n.items.length === 0 ? null : /* @__PURE__ */ e(te, { heading: n.heading, children: n.items.map((p) => {
|
|
86
|
-
const O = p.icon;
|
|
87
|
-
return /* @__PURE__ */ s(
|
|
88
|
-
re,
|
|
89
|
-
{
|
|
90
|
-
value: p.key,
|
|
91
|
-
className: "gap-3 px-2 py-2",
|
|
92
|
-
onSelect: () => {
|
|
93
|
-
y(p);
|
|
94
|
-
},
|
|
95
|
-
children: [
|
|
96
|
-
O && /* @__PURE__ */ e("span", { className: l("flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground", p.iconClassName), children: /* @__PURE__ */ e(O, { className: "size-4" }) }),
|
|
97
|
-
/* @__PURE__ */ s("span", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
98
|
-
/* @__PURE__ */ e("span", { className: "truncate font-medium", children: p.label }),
|
|
99
|
-
p.description !== void 0 && p.description !== "" && /* @__PURE__ */ e("span", { className: "truncate text-xs text-muted-foreground", children: p.description })
|
|
100
|
-
] })
|
|
101
|
-
]
|
|
102
|
-
},
|
|
103
|
-
p.key
|
|
104
|
-
);
|
|
105
|
-
}) }, n.heading)
|
|
106
|
-
)
|
|
107
|
-
] }),
|
|
108
|
-
K !== void 0 && C && !r && /* @__PURE__ */ e("div", { className: "border-t border-border p-2 text-center text-xs text-muted-foreground", children: K })
|
|
109
|
-
]
|
|
110
|
-
}
|
|
111
|
-
)
|
|
112
|
-
] });
|
|
113
|
-
}, fe = 9, je = ({
|
|
114
|
-
items: i,
|
|
115
|
-
onSelect: d,
|
|
116
|
-
onMarkAllAsRead: h,
|
|
117
|
-
onRemove: o,
|
|
118
|
-
loading: r = !1,
|
|
119
|
-
unreadCount: c,
|
|
120
|
-
maxBadgeCount: m = fe,
|
|
121
|
-
open: x,
|
|
122
|
-
onOpenChange: g,
|
|
123
|
-
triggerLabel: N,
|
|
124
|
-
title: w,
|
|
125
|
-
emptyLabel: S,
|
|
126
|
-
loadingLabel: j,
|
|
127
|
-
markAllAsReadLabel: k,
|
|
128
|
-
removeLabel: T,
|
|
129
|
-
className: A,
|
|
130
|
-
contentClassName: K,
|
|
131
|
-
badgeClassName: u,
|
|
132
|
-
itemClassName: b,
|
|
133
|
-
unreadItemClassName: D
|
|
134
|
-
}) => {
|
|
135
|
-
const { t } = B(), [z, v] = $.useState(!1), a = x !== void 0, y = a ? x : z, C = (f) => {
|
|
136
|
-
a || v(f), g == null || g(f);
|
|
137
|
-
}, n = c ?? i.filter((f) => !f.read).length, p = N ?? t("notifications.trigger"), O = (f) => {
|
|
138
|
-
C(!1), d == null || d(f);
|
|
139
|
-
};
|
|
140
|
-
return /* @__PURE__ */ s(ae, { open: y, onOpenChange: C, children: [
|
|
141
|
-
/* @__PURE__ */ e(se, { asChild: !0, children: /* @__PURE__ */ s(
|
|
142
|
-
E,
|
|
143
|
-
{
|
|
144
|
-
type: "button",
|
|
145
|
-
variant: "ghost",
|
|
146
|
-
size: "icon",
|
|
147
|
-
className: l("relative rounded-full", A),
|
|
148
|
-
"aria-label": n > 0 ? `${p} (${String(n)})` : p,
|
|
149
|
-
title: p,
|
|
150
|
-
children: [
|
|
151
|
-
/* @__PURE__ */ e(Q, { className: "size-4" }),
|
|
152
|
-
n > 0 && /* @__PURE__ */ e(
|
|
153
|
-
"span",
|
|
154
|
-
{
|
|
155
|
-
className: l(
|
|
156
|
-
"absolute right-1 top-1 flex size-4 items-center justify-center rounded-full bg-primary text-[10px] font-bold leading-none text-primary-foreground",
|
|
157
|
-
u
|
|
158
|
-
),
|
|
159
|
-
children: n > m ? `${String(m)}+` : n
|
|
160
|
-
}
|
|
161
|
-
)
|
|
162
|
-
]
|
|
163
|
-
}
|
|
164
|
-
) }),
|
|
165
|
-
/* @__PURE__ */ s(ie, { align: "end", className: l("w-80 p-0", K), children: [
|
|
166
|
-
/* @__PURE__ */ s("div", { className: "flex items-center justify-between gap-2 border-b px-3 py-2", children: [
|
|
167
|
-
/* @__PURE__ */ e("span", { className: "text-sm font-medium", children: w ?? t("notifications.title") }),
|
|
168
|
-
h && n > 0 && /* @__PURE__ */ e(E, { type: "button", variant: "ghost", size: "sm", className: "h-7 text-xs", onClick: h, children: k ?? t("notifications.markAllAsRead") })
|
|
169
|
-
] }),
|
|
170
|
-
r && /* @__PURE__ */ e("p", { className: "px-3 py-6 text-center text-sm text-muted-foreground", children: j ?? t("states.loading") }),
|
|
171
|
-
!r && i.length === 0 && /* @__PURE__ */ e("p", { className: "px-3 py-6 text-center text-sm text-muted-foreground", children: S ?? t("notifications.empty") }),
|
|
172
|
-
!r && i.length > 0 && /* @__PURE__ */ e(ne, { className: "max-h-96", children: /* @__PURE__ */ e("ul", { className: "divide-y", children: i.map((f) => {
|
|
173
|
-
const U = f.icon;
|
|
174
|
-
return /* @__PURE__ */ s("li", { className: l("flex items-start gap-2 px-3 py-2", !f.read && (D ?? "bg-accent/40"), b), children: [
|
|
175
|
-
/* @__PURE__ */ s(
|
|
176
|
-
"button",
|
|
177
|
-
{
|
|
178
|
-
type: "button",
|
|
179
|
-
className: "flex min-w-0 flex-1 items-start gap-2 rounded-sm text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
180
|
-
onClick: () => {
|
|
181
|
-
O(f);
|
|
182
|
-
},
|
|
183
|
-
children: [
|
|
184
|
-
U && /* @__PURE__ */ e(
|
|
185
|
-
"span",
|
|
186
|
-
{
|
|
187
|
-
className: l(
|
|
188
|
-
"mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground",
|
|
189
|
-
f.iconClassName
|
|
190
|
-
),
|
|
191
|
-
children: /* @__PURE__ */ e(U, { className: "size-3.5" })
|
|
192
|
-
}
|
|
193
|
-
),
|
|
194
|
-
/* @__PURE__ */ s("span", { className: "min-w-0 flex-1 space-y-0.5", children: [
|
|
195
|
-
/* @__PURE__ */ s("span", { className: "flex items-center gap-2", children: [
|
|
196
|
-
!f.read && /* @__PURE__ */ e("span", { className: "size-1.5 shrink-0 rounded-full bg-primary", "aria-hidden": !0 }),
|
|
197
|
-
/* @__PURE__ */ e("span", { className: l("truncate text-sm", !f.read && "font-medium"), children: f.title })
|
|
198
|
-
] }),
|
|
199
|
-
f.description && /* @__PURE__ */ e("span", { className: "block text-xs text-muted-foreground", children: f.description }),
|
|
200
|
-
f.date && /* @__PURE__ */ e("span", { className: "block text-xs text-muted-foreground/60", children: f.date })
|
|
201
|
-
] })
|
|
202
|
-
]
|
|
203
|
-
}
|
|
204
|
-
),
|
|
205
|
-
o && /* @__PURE__ */ e(
|
|
206
|
-
E,
|
|
207
|
-
{
|
|
208
|
-
type: "button",
|
|
209
|
-
variant: "ghost",
|
|
210
|
-
size: "icon",
|
|
211
|
-
className: "size-7 shrink-0 text-muted-foreground hover:text-destructive",
|
|
212
|
-
onClick: () => {
|
|
213
|
-
o(f);
|
|
214
|
-
},
|
|
215
|
-
"aria-label": T ?? t("notifications.remove"),
|
|
216
|
-
title: T ?? t("notifications.remove"),
|
|
217
|
-
children: /* @__PURE__ */ e(R, { className: "size-3.5" })
|
|
218
|
-
}
|
|
219
|
-
)
|
|
220
|
-
] }, f.key);
|
|
221
|
-
}) }) })
|
|
222
|
-
] })
|
|
223
|
-
] });
|
|
224
|
-
}, L = (i, d, h) => d === i ? !0 : i === "/" || !d.startsWith(`${i}/`) ? !1 : !h.some(
|
|
225
|
-
(o) => o !== i && o.startsWith(`${i}/`) && (d === o || d.startsWith(`${o}/`))
|
|
226
|
-
), pe = ({
|
|
227
|
-
path: i,
|
|
228
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
229
|
-
icon: d,
|
|
230
|
-
label: h,
|
|
231
|
-
badge: o,
|
|
232
|
-
subItems: r,
|
|
233
|
-
currentPath: c,
|
|
234
|
-
collapsed: m,
|
|
235
|
-
dense: x = !1,
|
|
236
|
-
onItemClick: g
|
|
237
|
-
}) => {
|
|
238
|
-
const N = (r == null ? void 0 : r.map((t) => t.path)) ?? [], [w, S] = $.useState((r == null ? void 0 : r.some((t) => L(t.path, c, N))) ?? !1), j = i ? c === i || i !== "/" && c.startsWith(`${i}/`) : !1, k = r == null ? void 0 : r.some((t) => L(t.path, c, N)), D = /* @__PURE__ */ s(
|
|
239
|
-
"a",
|
|
240
|
-
{
|
|
241
|
-
href: i ?? "#",
|
|
242
|
-
onClick: (t) => {
|
|
243
|
-
t.ctrlKey || t.metaKey || t.button === 1 || (t.preventDefault(), r && r.length > 0 ? m || S(!w) : i && g(i));
|
|
244
|
-
},
|
|
245
|
-
className: l(
|
|
246
|
-
"flex items-center cursor-pointer transition-all duration-200 group rounded-control",
|
|
247
|
-
x ? "gap-2.5 mb-0.5" : "gap-3 mb-1",
|
|
248
|
-
m ? x ? "justify-center p-2 h-9 w-9 mx-auto" : "justify-center p-3 h-12 w-12 mx-auto" : x ? "px-3 py-1.5 h-9" : "px-4 py-3 h-12",
|
|
249
|
-
j || !m && k ? x ? "bg-sidebar-primary text-sidebar-primary-foreground" : "bg-sidebar-primary text-sidebar-primary-foreground shadow-lg" : "hover:bg-sidebar-accent text-sidebar-foreground hover:text-sidebar-accent-foreground"
|
|
250
|
-
),
|
|
251
|
-
children: [
|
|
252
|
-
/* @__PURE__ */ e("div", { className: l("flex-shrink-0 transition-transform group-hover:scale-110", m ? "flex items-center justify-center" : ""), children: /* @__PURE__ */ e(d, { className: "size-4" }) }),
|
|
253
|
-
!m && /* @__PURE__ */ s(G, { children: [
|
|
254
|
-
/* @__PURE__ */ e("span", { className: l("flex-grow transition-opacity duration-150 font-medium", x ? "text-sm" : ""), children: h }),
|
|
255
|
-
o !== void 0 && /* @__PURE__ */ e("span", { className: "bg-red-500 text-white text-xs rounded-full py-1 min-w-[20px] text-center px-2 font-semibold", children: o }),
|
|
256
|
-
r && r.length > 0 && /* @__PURE__ */ e(q, { className: l("size-4 transition-transform duration-200", w ? "rotate-180" : "") })
|
|
257
|
-
] })
|
|
258
|
-
]
|
|
259
|
-
}
|
|
260
|
-
);
|
|
261
|
-
return /* @__PURE__ */ s(G, { children: [
|
|
262
|
-
m ? /* @__PURE__ */ s(P, { children: [
|
|
263
|
-
/* @__PURE__ */ e(V, { asChild: !0, children: D }),
|
|
264
|
-
/* @__PURE__ */ e(
|
|
265
|
-
X,
|
|
266
|
-
{
|
|
267
|
-
side: "right",
|
|
268
|
-
sideOffset: 6,
|
|
269
|
-
className: "rounded-surface z-[99999] flex gap-2 bg-sidebar text-sidebar-foreground border border-sidebar-border py-2 text-sm shadow-lg",
|
|
270
|
-
children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
271
|
-
/* @__PURE__ */ e("p", { className: "font-semibold", children: h }),
|
|
272
|
-
o !== void 0 && /* @__PURE__ */ s("span", { className: "ml-1 text-xs", children: [
|
|
273
|
-
"(",
|
|
274
|
-
o,
|
|
275
|
-
")"
|
|
276
|
-
] })
|
|
277
|
-
] }) })
|
|
278
|
-
}
|
|
279
|
-
)
|
|
280
|
-
] }) : D,
|
|
281
|
-
!m && r && r.length > 0 && w && /* @__PURE__ */ e(
|
|
282
|
-
"div",
|
|
283
|
-
{
|
|
284
|
-
className: l(
|
|
285
|
-
"flex flex-col ml-4 pl-4 border-l-2 border-sidebar-border/50 animate-in slide-in-from-top-2 fade-in duration-200",
|
|
286
|
-
x ? "gap-0.5 mb-0.5" : "gap-1 mb-2"
|
|
287
|
-
),
|
|
288
|
-
children: r.map((t, z) => {
|
|
289
|
-
const v = L(t.path, c, N);
|
|
290
|
-
return /* @__PURE__ */ s(
|
|
291
|
-
"a",
|
|
292
|
-
{
|
|
293
|
-
href: t.path,
|
|
294
|
-
onClick: (a) => {
|
|
295
|
-
a.ctrlKey || a.metaKey || a.button === 1 || (a.preventDefault(), g(t.path));
|
|
296
|
-
},
|
|
297
|
-
className: l(
|
|
298
|
-
"flex items-center justify-between rounded-control text-sm transition-all duration-200",
|
|
299
|
-
x ? "px-3 py-1" : "px-4 py-2",
|
|
300
|
-
v ? "bg-sidebar-accent/50 text-sidebar-primary font-semibold" : "text-sidebar-muted hover:bg-sidebar-accent hover:text-sidebar-foreground"
|
|
301
|
-
),
|
|
302
|
-
children: [
|
|
303
|
-
/* @__PURE__ */ e("span", { children: t.label }),
|
|
304
|
-
t.badge !== void 0 && /* @__PURE__ */ e("span", { className: "bg-sidebar-primary/20 text-sidebar-primary text-[10px] rounded-full py-0.5 px-2 font-semibold", children: t.badge })
|
|
305
|
-
]
|
|
306
|
-
},
|
|
307
|
-
z
|
|
308
|
-
);
|
|
309
|
-
})
|
|
310
|
-
}
|
|
311
|
-
)
|
|
312
|
-
] });
|
|
313
|
-
}, Te = ({ groups: i, currentPath: d, onItemClick: h, slots: o, search: r, dense: c = !1, loading: m = !1 }) => {
|
|
314
|
-
const { t: x } = B(), { enabled: g = !1, placeholder: N } = r ?? {}, { header: w, footer: S } = o ?? {}, { collapsed: j, isMobile: k, setCollapsed: T } = F(), [A, K] = $.useState(""), u = k ? !1 : j, b = !j, D = (a) => {
|
|
315
|
-
h(a), k && T(!0);
|
|
316
|
-
}, t = A.trim().toLowerCase(), z = t === "" ? i : i.map((a) => ({
|
|
317
|
-
...a,
|
|
318
|
-
items: a.items.filter(
|
|
319
|
-
(y) => {
|
|
320
|
-
var C;
|
|
321
|
-
return y.label.toLowerCase().includes(t) || (((C = y.subItems) == null ? void 0 : C.some((n) => n.label.toLowerCase().includes(t))) ?? !1);
|
|
322
|
-
}
|
|
323
|
-
)
|
|
324
|
-
})).filter((a) => a.items.length > 0), v = /* @__PURE__ */ s("div", { className: "flex flex-col h-full bg-sidebar text-sidebar-foreground", children: [
|
|
325
|
-
w,
|
|
326
|
-
g && !u && /* @__PURE__ */ e("div", { className: l("px-4", c ? "pt-2" : "pt-4"), children: /* @__PURE__ */ s("div", { className: "relative", children: [
|
|
327
|
-
/* @__PURE__ */ e(_, { className: "absolute left-3 top-1/2 size-4 -translate-y-1/2 text-sidebar-muted" }),
|
|
328
|
-
/* @__PURE__ */ e(
|
|
329
|
-
le,
|
|
330
|
-
{
|
|
331
|
-
type: "search",
|
|
332
|
-
value: A,
|
|
333
|
-
onChange: (a) => {
|
|
334
|
-
K(a.target.value);
|
|
335
|
-
},
|
|
336
|
-
placeholder: N ?? x("search.placeholder"),
|
|
337
|
-
className: l(
|
|
338
|
-
"bg-sidebar-accent/40 border-sidebar-border pl-9 text-sidebar-foreground placeholder:text-sidebar-muted",
|
|
339
|
-
c ? "h-8 text-sm" : "h-9"
|
|
340
|
-
)
|
|
341
|
-
}
|
|
342
|
-
)
|
|
343
|
-
] }) }),
|
|
344
|
-
/* @__PURE__ */ e("div", { className: l("flex-1 overflow-y-auto scrollbar-modern", u ? "px-0" : "px-2", c ? "py-2" : "py-4"), children: m ? Array.from({ length: 5 }).map((a, y) => /* @__PURE__ */ s("div", { className: l("flex items-center gap-3", c ? "mb-1 h-9" : "mb-2 h-12", u ? "justify-center px-3" : "px-4"), children: [
|
|
345
|
-
/* @__PURE__ */ e(W, { className: "size-5 flex-shrink-0 rounded-control" }),
|
|
346
|
-
!u && /* @__PURE__ */ e(W, { className: "h-4 flex-1" })
|
|
347
|
-
] }, y)) : z.map((a, y) => /* @__PURE__ */ s("div", { className: c ? "mb-3" : "mb-6", children: [
|
|
348
|
-
!u && a.title !== void 0 && a.title !== "" && /* @__PURE__ */ e("h3", { className: l("px-4 text-xs uppercase tracking-wider font-semibold text-sidebar-muted", c ? "mb-1" : "mb-2"), children: a.title }),
|
|
349
|
-
/* @__PURE__ */ e("nav", { className: l("flex flex-col", c ? "gap-0.5" : "gap-1"), children: a.items.map((C, n) => /* @__PURE__ */ e(pe, { ...C, currentPath: d, collapsed: u, dense: c, onItemClick: D }, n)) })
|
|
350
|
-
] }, y)) }),
|
|
351
|
-
S && /* @__PURE__ */ e("div", { className: l("border-t border-sidebar-border", c ? "p-2" : "p-4", u ? "flex justify-center" : ""), children: S })
|
|
352
|
-
] });
|
|
353
|
-
return k ? /* @__PURE__ */ e(
|
|
354
|
-
oe,
|
|
355
|
-
{
|
|
356
|
-
open: b,
|
|
357
|
-
onOpenChange: (a) => {
|
|
358
|
-
T(!a);
|
|
359
|
-
},
|
|
360
|
-
children: /* @__PURE__ */ s(ce, { side: "left", className: "w-[16rem] p-0 bg-sidebar border-r border-sidebar-border overflow-hidden [&>button]:text-sidebar-foreground", children: [
|
|
361
|
-
/* @__PURE__ */ e(de, { className: "sr-only", children: x("sidebar.menu") }),
|
|
362
|
-
/* @__PURE__ */ e(me, { className: "sr-only", children: x("sidebar.description") }),
|
|
363
|
-
v
|
|
364
|
-
] })
|
|
365
|
-
}
|
|
366
|
-
) : /* @__PURE__ */ e(J, { delayDuration: 0, children: /* @__PURE__ */ e(
|
|
367
|
-
"aside",
|
|
368
|
-
{
|
|
369
|
-
className: l(
|
|
370
|
-
"flex flex-col bg-sidebar h-screen border-r border-sidebar-border transition-all duration-300",
|
|
371
|
-
u ? "w-[--navbar-width-icon]" : "w-[--navbar-width]",
|
|
372
|
-
"flex"
|
|
373
|
-
),
|
|
374
|
-
style: {
|
|
375
|
-
"--navbar-width": "16rem",
|
|
376
|
-
"--navbar-width-icon": "4rem"
|
|
377
|
-
},
|
|
378
|
-
children: v
|
|
379
|
-
}
|
|
380
|
-
) });
|
|
381
|
-
}, De = ({
|
|
382
|
-
name: i = "appname",
|
|
383
|
-
subName: d = "appsubname",
|
|
384
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
385
|
-
icon: h,
|
|
386
|
-
dense: o = !1
|
|
387
|
-
}) => {
|
|
388
|
-
const { collapsed: r, isMobile: c } = F(), m = c ? !1 : r;
|
|
389
|
-
return /* @__PURE__ */ s("div", { className: l("flex items-center flex-shrink-0 gap-3 px-4", o ? "h-14" : "h-16 md:h-20", m ? "justify-center" : ""), children: [
|
|
390
|
-
h !== void 0 && /* @__PURE__ */ e("div", { className: "flex-shrink-0 text-sidebar-foreground", children: /* @__PURE__ */ e(h, { className: o ? "size-5" : "size-6" }) }),
|
|
391
|
-
!m && /* @__PURE__ */ s("div", { className: "flex flex-col", children: [
|
|
392
|
-
/* @__PURE__ */ e("h1", { className: l("font-bold text-sidebar-foreground leading-tight", o ? "text-base" : "text-lg"), children: i }),
|
|
393
|
-
/* @__PURE__ */ e("span", { className: l("text-sidebar-muted font-medium", o ? "text-[11px]" : "text-xs"), children: d })
|
|
394
|
-
] })
|
|
395
|
-
] });
|
|
396
|
-
}, Ae = ({ collapsed: i, isMobile: d, onToggleSidebar: h, actionsNode: o, userMenuNode: r }) => /* @__PURE__ */ s(
|
|
397
|
-
"header",
|
|
398
|
-
{
|
|
399
|
-
className: l(
|
|
400
|
-
"fixed top-0 right-0 z-[60] h-16 md:h-20 bg-topbar text-topbar-foreground flex items-center justify-between px-4 transition-all duration-300",
|
|
401
|
-
d && "left-0",
|
|
402
|
-
!d && i && "left-[5rem]",
|
|
403
|
-
!d && !i && "left-[16rem]"
|
|
404
|
-
),
|
|
405
|
-
tabIndex: -1,
|
|
406
|
-
children: [
|
|
407
|
-
/* @__PURE__ */ e("div", { className: "flex items-center min-w-0 flex-1", children: /* @__PURE__ */ e(
|
|
408
|
-
E,
|
|
409
|
-
{
|
|
410
|
-
variant: "ghost",
|
|
411
|
-
size: "icon",
|
|
412
|
-
onClick: h,
|
|
413
|
-
className: "text-topbar-foreground hover:bg-topbar-accent hover:text-topbar-accent-foreground",
|
|
414
|
-
children: /* @__PURE__ */ e(H, { className: "size-4" })
|
|
415
|
-
}
|
|
416
|
-
) }),
|
|
417
|
-
/* @__PURE__ */ s("div", { className: "flex items-center gap-2 md:gap-4 flex-shrink-0", children: [
|
|
418
|
-
o,
|
|
419
|
-
r
|
|
420
|
-
] })
|
|
421
|
-
]
|
|
422
|
-
}
|
|
423
|
-
);
|
|
424
|
-
export {
|
|
425
|
-
Se as G,
|
|
426
|
-
je as N,
|
|
427
|
-
Te as S,
|
|
428
|
-
Ae as T,
|
|
429
|
-
De as a,
|
|
430
|
-
pe as b
|
|
431
|
-
};
|
package/dist/alert-B9F1N9Qk.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import * as s from "react";
|
|
3
|
-
import { cva as d } from "class-variance-authority";
|
|
4
|
-
import { c as i } from "./tailwind.helper-B6yFEsav.js";
|
|
5
|
-
const l = d(
|
|
6
|
-
"relative w-full rounded-surface border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
|
|
7
|
-
{
|
|
8
|
-
variants: {
|
|
9
|
-
variant: {
|
|
10
|
-
default: "bg-background text-foreground",
|
|
11
|
-
destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
defaultVariants: {
|
|
15
|
-
variant: "default"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
), n = s.forwardRef(
|
|
19
|
-
({ className: e, variant: t, ...r }, o) => /* @__PURE__ */ a("div", { ref: o, role: "alert", className: i(l({ variant: t }), e), ...r })
|
|
20
|
-
);
|
|
21
|
-
n.displayName = "Alert";
|
|
22
|
-
const c = s.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ a("h5", { ref: r, className: i("mb-1 font-medium leading-none tracking-tight", e), ...t }));
|
|
23
|
-
c.displayName = "AlertTitle";
|
|
24
|
-
const v = s.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ a("div", { ref: r, className: i("text-sm [&_p]:leading-relaxed", e), ...t }));
|
|
25
|
-
v.displayName = "AlertDescription";
|
|
26
|
-
export {
|
|
27
|
-
n as A,
|
|
28
|
-
v as a,
|
|
29
|
-
c as b
|
|
30
|
-
};
|
package/dist/chart-DntJZGxB.js
DELETED
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import { jsx as n, jsxs as g, Fragment as T } from "react/jsx-runtime";
|
|
2
|
-
import * as l from "react";
|
|
3
|
-
import { c } from "./tailwind.helper-B6yFEsav.js";
|
|
4
|
-
import * as _ from "recharts";
|
|
5
|
-
const P = l.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ n("div", { ref: r, className: c("rounded-surface border bg-card text-card-foreground shadow-sm", t), ...e }));
|
|
6
|
-
P.displayName = "Card";
|
|
7
|
-
const A = l.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ n("div", { ref: r, className: c("flex flex-col space-y-1.5 p-6", t), ...e }));
|
|
8
|
-
A.displayName = "CardHeader";
|
|
9
|
-
const H = l.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ n("h3", { ref: r, className: c("text-2xl font-semibold leading-none tracking-tight", t), ...e }));
|
|
10
|
-
H.displayName = "CardTitle";
|
|
11
|
-
const I = l.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ n("p", { ref: r, className: c("text-sm text-muted-foreground", t), ...e }));
|
|
12
|
-
I.displayName = "CardDescription";
|
|
13
|
-
const S = l.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ n("div", { ref: r, className: c("p-6 pt-0", t), ...e }));
|
|
14
|
-
S.displayName = "CardContent";
|
|
15
|
-
const E = l.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ n("div", { ref: r, className: c("flex items-center p-6 pt-0", t), ...e }));
|
|
16
|
-
E.displayName = "CardFooter";
|
|
17
|
-
const K = { light: "", dark: ".dark" }, y = l.createContext(null);
|
|
18
|
-
function j() {
|
|
19
|
-
const t = l.useContext(y);
|
|
20
|
-
if (!t)
|
|
21
|
-
throw new Error("useChart must be used within a <ChartContainer />");
|
|
22
|
-
return t;
|
|
23
|
-
}
|
|
24
|
-
const M = l.forwardRef(({ id: t, className: e, children: r, config: o, ...a }, m) => {
|
|
25
|
-
const i = l.useId(), d = `chart-${t || i.replace(/:/g, "")}`;
|
|
26
|
-
return /* @__PURE__ */ n(y.Provider, { value: { config: o }, children: /* @__PURE__ */ g(
|
|
27
|
-
"div",
|
|
28
|
-
{
|
|
29
|
-
"data-chart": d,
|
|
30
|
-
ref: m,
|
|
31
|
-
className: c(
|
|
32
|
-
"flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",
|
|
33
|
-
e
|
|
34
|
-
),
|
|
35
|
-
...a,
|
|
36
|
-
children: [
|
|
37
|
-
/* @__PURE__ */ n(D, { id: d, config: o }),
|
|
38
|
-
/* @__PURE__ */ n(_.ResponsiveContainer, { children: r })
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
) });
|
|
42
|
-
});
|
|
43
|
-
M.displayName = "Chart";
|
|
44
|
-
const D = ({ id: t, config: e }) => {
|
|
45
|
-
const r = Object.entries(e).filter(([o, a]) => a.theme || a.color);
|
|
46
|
-
return r.length ? /* @__PURE__ */ n(
|
|
47
|
-
"style",
|
|
48
|
-
{
|
|
49
|
-
dangerouslySetInnerHTML: {
|
|
50
|
-
__html: Object.entries(K).map(
|
|
51
|
-
([o, a]) => `
|
|
52
|
-
${a} [data-chart=${t}] {
|
|
53
|
-
${r.map(([m, i]) => {
|
|
54
|
-
var h;
|
|
55
|
-
const d = ((h = i.theme) == null ? void 0 : h[o]) || i.color;
|
|
56
|
-
return d ? ` --color-${m}: ${d};` : null;
|
|
57
|
-
}).join(`
|
|
58
|
-
`)}
|
|
59
|
-
}
|
|
60
|
-
`
|
|
61
|
-
).join(`
|
|
62
|
-
`)
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
) : null;
|
|
66
|
-
}, B = _.Tooltip, F = l.forwardRef(
|
|
67
|
-
({
|
|
68
|
-
active: t,
|
|
69
|
-
payload: e = [],
|
|
70
|
-
className: r,
|
|
71
|
-
indicator: o = "dot",
|
|
72
|
-
hideLabel: a = !1,
|
|
73
|
-
hideIndicator: m = !1,
|
|
74
|
-
label: i = "",
|
|
75
|
-
labelFormatter: d,
|
|
76
|
-
labelClassName: h,
|
|
77
|
-
formatter: f,
|
|
78
|
-
color: R,
|
|
79
|
-
nameKey: $,
|
|
80
|
-
labelKey: C
|
|
81
|
-
}, L) => {
|
|
82
|
-
const { config: x } = j(), k = l.useMemo(() => {
|
|
83
|
-
var v;
|
|
84
|
-
if (a || !(e != null && e.length))
|
|
85
|
-
return null;
|
|
86
|
-
const [s] = e, N = `${C || s.dataKey || s.name || "value"}`, p = w(x, s, N), u = !C && typeof i == "string" ? ((v = x[i]) == null ? void 0 : v.label) || i : p == null ? void 0 : p.label;
|
|
87
|
-
return d ? /* @__PURE__ */ n("div", { className: c("font-medium", h), children: d(u, e) }) : u ? /* @__PURE__ */ n("div", { className: c("font-medium", h), children: u }) : null;
|
|
88
|
-
}, [i, d, e, a, h, x, C]);
|
|
89
|
-
if (!t || !(e != null && e.length))
|
|
90
|
-
return null;
|
|
91
|
-
const b = e.length === 1 && o !== "dot";
|
|
92
|
-
return /* @__PURE__ */ g(
|
|
93
|
-
"div",
|
|
94
|
-
{
|
|
95
|
-
ref: L,
|
|
96
|
-
className: c("grid min-w-[8rem] items-start gap-1.5 rounded-surface border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl", r),
|
|
97
|
-
children: [
|
|
98
|
-
b ? null : k,
|
|
99
|
-
/* @__PURE__ */ n("div", { className: "grid gap-1.5", children: e.map((s, N) => {
|
|
100
|
-
const p = `${$ || s.name || s.dataKey || "value"}`, u = w(x, s, p), v = R || s.payload.fill || s.color;
|
|
101
|
-
return /* @__PURE__ */ n(
|
|
102
|
-
"div",
|
|
103
|
-
{
|
|
104
|
-
className: c(
|
|
105
|
-
"flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",
|
|
106
|
-
o === "dot" && "items-center"
|
|
107
|
-
),
|
|
108
|
-
children: f && (s == null ? void 0 : s.value) !== void 0 && s.name ? f(s.value, s.name, s, N, s.payload) : /* @__PURE__ */ g(T, { children: [
|
|
109
|
-
u != null && u.icon ? /* @__PURE__ */ n(u.icon, {}) : !m && /* @__PURE__ */ n(
|
|
110
|
-
"div",
|
|
111
|
-
{
|
|
112
|
-
className: c("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]", {
|
|
113
|
-
"h-2.5 w-2.5": o === "dot",
|
|
114
|
-
"w-1": o === "line",
|
|
115
|
-
"w-0 border-[1.5px] border-dashed bg-transparent": o === "dashed",
|
|
116
|
-
"my-0.5": b && o === "dashed"
|
|
117
|
-
}),
|
|
118
|
-
style: {
|
|
119
|
-
"--color-bg": v,
|
|
120
|
-
"--color-border": v
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
),
|
|
124
|
-
/* @__PURE__ */ g("div", { className: c("flex flex-1 justify-between leading-none", b ? "items-end" : "items-center"), children: [
|
|
125
|
-
/* @__PURE__ */ g("div", { className: "grid gap-1.5", children: [
|
|
126
|
-
b ? k : null,
|
|
127
|
-
/* @__PURE__ */ n("span", { className: "text-muted-foreground", children: (u == null ? void 0 : u.label) || s.name })
|
|
128
|
-
] }),
|
|
129
|
-
s.value && /* @__PURE__ */ n("span", { className: "font-mono font-medium tabular-nums text-foreground", children: s.value.toLocaleString() })
|
|
130
|
-
] })
|
|
131
|
-
] })
|
|
132
|
-
},
|
|
133
|
-
s.dataKey
|
|
134
|
-
);
|
|
135
|
-
}) })
|
|
136
|
-
]
|
|
137
|
-
}
|
|
138
|
-
);
|
|
139
|
-
}
|
|
140
|
-
);
|
|
141
|
-
F.displayName = "ChartTooltip";
|
|
142
|
-
const G = _.Legend, O = l.forwardRef(({ className: t, hideIcon: e = !1, payload: r, verticalAlign: o = "bottom", nameKey: a }, m) => {
|
|
143
|
-
const { config: i } = j();
|
|
144
|
-
return !r || !Array.isArray(r) || !r.length ? null : /* @__PURE__ */ n("div", { ref: m, className: c("flex items-center justify-center gap-4", o === "top" ? "pb-3" : "pt-3", t), children: Array.isArray(r) && r.map((d) => {
|
|
145
|
-
const h = `${a || d.dataKey || "value"}`, f = w(i, d, h);
|
|
146
|
-
return /* @__PURE__ */ g("div", { className: c("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"), children: [
|
|
147
|
-
f != null && f.icon && !e ? /* @__PURE__ */ n(f.icon, {}) : /* @__PURE__ */ n(
|
|
148
|
-
"div",
|
|
149
|
-
{
|
|
150
|
-
className: "h-2 w-2 shrink-0 rounded-[2px]",
|
|
151
|
-
style: {
|
|
152
|
-
backgroundColor: d.color
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
),
|
|
156
|
-
f == null ? void 0 : f.label
|
|
157
|
-
] }, d.value);
|
|
158
|
-
}) });
|
|
159
|
-
});
|
|
160
|
-
O.displayName = "ChartLegend";
|
|
161
|
-
function w(t, e, r) {
|
|
162
|
-
if (typeof e != "object" || e === null)
|
|
163
|
-
return;
|
|
164
|
-
const o = "payload" in e && typeof e.payload == "object" && e.payload !== null ? e.payload : void 0;
|
|
165
|
-
let a = r;
|
|
166
|
-
return r in e && typeof e[r] == "string" ? a = e[r] : o && r in o && typeof o[r] == "string" && (a = o[r]), a in t ? t[a] : t[r];
|
|
167
|
-
}
|
|
168
|
-
export {
|
|
169
|
-
P as C,
|
|
170
|
-
S as a,
|
|
171
|
-
I as b,
|
|
172
|
-
E as c,
|
|
173
|
-
A as d,
|
|
174
|
-
H as e,
|
|
175
|
-
M as f,
|
|
176
|
-
G as g,
|
|
177
|
-
O as h,
|
|
178
|
-
D as i,
|
|
179
|
-
B as j,
|
|
180
|
-
F as k
|
|
181
|
-
};
|