@rqdhw3n/react-admin-layout 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +283 -5
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +327 -0
- package/dist/index.d.ts +71 -2
- package/dist/index.js +677 -475
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +35 -8
package/dist/index.js
CHANGED
|
@@ -1,138 +1,264 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { useLocation as
|
|
4
|
-
import { ChevronDown as
|
|
5
|
-
function
|
|
1
|
+
import { jsx as a, Fragment as $, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as Y, createContext as _, useCallback as A, useSyncExternalStore as le, useState as C, useEffect as E, useMemo as I, useRef as H } from "react";
|
|
3
|
+
import { useLocation as ce, NavLink as ue } from "react-router-dom";
|
|
4
|
+
import { ChevronDown as Z, X as me, Home as fe, ChevronRight as be, Search as he, Bell as pe, Sun as xe, Moon as ve, Settings as ye, User as ge, LogOut as we, Menu as Ne, PanelLeftOpen as ee, PanelLeftClose as re } from "lucide-react";
|
|
5
|
+
function G(e) {
|
|
6
6
|
if (typeof window > "u") return {};
|
|
7
7
|
try {
|
|
8
|
-
const
|
|
9
|
-
|
|
8
|
+
const r = localStorage.getItem(e), n = r ? JSON.parse(r) : null;
|
|
9
|
+
if (!n || typeof n != "object") return {};
|
|
10
|
+
const t = n;
|
|
11
|
+
return {
|
|
12
|
+
sidebarCollapsed: typeof t.sidebarCollapsed == "boolean" ? t.sidebarCollapsed : void 0,
|
|
13
|
+
darkMode: typeof t.darkMode == "boolean" ? t.darkMode : void 0,
|
|
14
|
+
mode: t.mode === "light" || t.mode === "dark" || t.mode === "system" ? t.mode : void 0
|
|
15
|
+
};
|
|
10
16
|
} catch {
|
|
11
17
|
return {};
|
|
12
18
|
}
|
|
13
19
|
}
|
|
14
|
-
function
|
|
20
|
+
function ke(e, r) {
|
|
15
21
|
if (!(typeof window > "u"))
|
|
16
22
|
try {
|
|
17
|
-
localStorage.setItem(e, JSON.stringify(
|
|
23
|
+
localStorage.setItem(e, JSON.stringify(r));
|
|
18
24
|
} catch {
|
|
19
25
|
}
|
|
20
26
|
}
|
|
21
|
-
const
|
|
22
|
-
|
|
27
|
+
const te = Object.freeze({
|
|
28
|
+
primary: "#2563eb",
|
|
29
|
+
secondary: "#7c3aed",
|
|
30
|
+
background: "#f8fafc",
|
|
31
|
+
surface: "#ffffff",
|
|
32
|
+
text: "#0f172a",
|
|
33
|
+
textSecondary: "#64748b",
|
|
34
|
+
sidebarBackground: "#ffffff",
|
|
35
|
+
sidebarText: "#64748b",
|
|
36
|
+
headerBackground: "#ffffff",
|
|
37
|
+
headerText: "#0f172a",
|
|
38
|
+
hoverBackground: "#f1f5f9",
|
|
39
|
+
hoverText: "#0f172a",
|
|
40
|
+
activeBackground: "#2563eb",
|
|
41
|
+
activeText: "#ffffff",
|
|
42
|
+
border: "#e2e8f0",
|
|
43
|
+
onPrimary: "#ffffff",
|
|
44
|
+
danger: "#dc2626",
|
|
45
|
+
onDanger: "#ffffff",
|
|
46
|
+
overlay: "rgb(15 23 42 / 0.5)"
|
|
47
|
+
}), Se = Object.freeze({
|
|
48
|
+
...te,
|
|
49
|
+
primary: "#3b82f6",
|
|
50
|
+
secondary: "#a78bfa",
|
|
51
|
+
background: "#0b1220",
|
|
52
|
+
surface: "#111827",
|
|
53
|
+
text: "#f1f5f9",
|
|
54
|
+
textSecondary: "#94a3b8",
|
|
55
|
+
sidebarBackground: "#111827",
|
|
56
|
+
sidebarText: "#cbd5e1",
|
|
57
|
+
headerBackground: "#111827",
|
|
58
|
+
headerText: "#f1f5f9",
|
|
59
|
+
hoverBackground: "#1e293b",
|
|
60
|
+
hoverText: "#ffffff",
|
|
61
|
+
activeBackground: "#3b82f6",
|
|
62
|
+
activeText: "#020617",
|
|
63
|
+
onPrimary: "#020617",
|
|
64
|
+
border: "#334155",
|
|
65
|
+
danger: "#f87171",
|
|
66
|
+
onDanger: "#020617",
|
|
67
|
+
overlay: "rgb(2 6 23 / 0.7)"
|
|
68
|
+
}), Xe = Object.freeze({
|
|
69
|
+
modern: Object.freeze({ style: "modern" }),
|
|
70
|
+
minimal: Object.freeze({ style: "minimal" }),
|
|
71
|
+
compact: Object.freeze({ style: "compact" })
|
|
72
|
+
}), Q = {
|
|
73
|
+
primary: "--ral-primary",
|
|
74
|
+
secondary: "--ral-secondary",
|
|
75
|
+
background: "--ral-background",
|
|
76
|
+
surface: "--ral-surface",
|
|
77
|
+
text: "--ral-text",
|
|
78
|
+
textSecondary: "--ral-text-secondary",
|
|
79
|
+
sidebarBackground: "--ral-sidebar-bg",
|
|
80
|
+
sidebarText: "--ral-sidebar-text",
|
|
81
|
+
headerBackground: "--ral-header-bg",
|
|
82
|
+
headerText: "--ral-header-text",
|
|
83
|
+
hoverBackground: "--ral-hover-bg",
|
|
84
|
+
hoverText: "--ral-hover-text",
|
|
85
|
+
activeBackground: "--ral-active-bg",
|
|
86
|
+
activeText: "--ral-active-text",
|
|
87
|
+
border: "--ral-border",
|
|
88
|
+
onPrimary: "--ral-on-primary",
|
|
89
|
+
danger: "--ral-danger",
|
|
90
|
+
onDanger: "--ral-on-danger",
|
|
91
|
+
overlay: "--ral-overlay"
|
|
92
|
+
};
|
|
93
|
+
function Me(e = {}, r = "light") {
|
|
94
|
+
const n = e.mode === "system" ? r : e.mode ?? "light", t = { ...n === "dark" ? Se : te }, o = {};
|
|
95
|
+
for (const s of [e.colors, e[n]])
|
|
96
|
+
if (s)
|
|
97
|
+
for (const i of Object.keys(t)) {
|
|
98
|
+
const d = s[i];
|
|
99
|
+
typeof d == "string" && d.trim() && (o[i] = d);
|
|
100
|
+
}
|
|
101
|
+
return Object.assign(t, o), o.primary && !o.activeBackground && (t.activeBackground = o.primary), { mode: n, style: e.style ?? "modern", colors: t };
|
|
102
|
+
}
|
|
103
|
+
function Ce(e) {
|
|
104
|
+
return Object.fromEntries(
|
|
105
|
+
Object.keys(Q).map(
|
|
106
|
+
(r) => [Q[r], e.colors[r]]
|
|
107
|
+
)
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
const ae = _(null);
|
|
111
|
+
function Le() {
|
|
112
|
+
const e = Y(ae);
|
|
113
|
+
if (!e) throw new Error("useAdminLayoutTheme must be used within LayoutProvider / AdminLayout");
|
|
114
|
+
return {
|
|
115
|
+
mode: e.requestedMode,
|
|
116
|
+
resolvedMode: e.mode,
|
|
117
|
+
style: e.style,
|
|
118
|
+
colors: e.colors,
|
|
119
|
+
setMode: e.setMode
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
const W = "(prefers-color-scheme: dark)", Be = () => "light";
|
|
123
|
+
function je(e) {
|
|
124
|
+
const r = A((t) => {
|
|
125
|
+
if (!e || typeof window > "u" || !window.matchMedia) return () => {
|
|
126
|
+
};
|
|
127
|
+
const o = window.matchMedia(W);
|
|
128
|
+
return o.addEventListener ? (o.addEventListener("change", t), () => o.removeEventListener("change", t)) : (o.addListener(t), () => o.removeListener(t));
|
|
129
|
+
}, [e]), n = A(
|
|
130
|
+
() => {
|
|
131
|
+
var t;
|
|
132
|
+
return e && typeof window < "u" && ((t = window.matchMedia) != null && t.call(window, W).matches) ? "dark" : "light";
|
|
133
|
+
},
|
|
134
|
+
[e]
|
|
135
|
+
);
|
|
136
|
+
return le(r, n, Be);
|
|
137
|
+
}
|
|
138
|
+
const ne = _(null);
|
|
139
|
+
function Ae({
|
|
23
140
|
children: e,
|
|
24
|
-
storageKey:
|
|
25
|
-
defaultCollapsed:
|
|
26
|
-
permissions:
|
|
27
|
-
initialBreadcrumbs:
|
|
28
|
-
initialActivePath:
|
|
29
|
-
initialDarkMode: i
|
|
141
|
+
storageKey: r = "rqdhw3n-admin-layout",
|
|
142
|
+
defaultCollapsed: n = !1,
|
|
143
|
+
permissions: t = {},
|
|
144
|
+
initialBreadcrumbs: o = [],
|
|
145
|
+
initialActivePath: s = "/",
|
|
146
|
+
initialDarkMode: i,
|
|
147
|
+
theme: d,
|
|
148
|
+
onThemeModeChange: l
|
|
30
149
|
}) {
|
|
31
|
-
const
|
|
32
|
-
d.
|
|
33
|
-
), [
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
}, [
|
|
42
|
-
|
|
150
|
+
const [c, x] = C(n), [w, y] = C(!1), [m, p] = C(i ? "dark" : "light"), [N, S] = C(null), v = (d == null ? void 0 : d.mode) ?? m, f = je(v === "system"), D = Me({ ...d, mode: v }, f), k = D.mode === "dark", P = A((h) => {
|
|
151
|
+
(d == null ? void 0 : d.mode) === void 0 && p(h), l == null || l(h);
|
|
152
|
+
}, [d == null ? void 0 : d.mode, l]), L = A((h) => P(h ? "dark" : "light"), [P]), [T, g] = C(o), [M, B] = C(s);
|
|
153
|
+
E(() => {
|
|
154
|
+
const h = G(r);
|
|
155
|
+
x(h.sidebarCollapsed ?? n), p(h.mode ?? (h.darkMode ?? i ? "dark" : "light")), S(r);
|
|
156
|
+
}, [r]), E(() => {
|
|
157
|
+
if (N !== r) return;
|
|
158
|
+
const h = G(r);
|
|
159
|
+
ke(r, (d == null ? void 0 : d.mode) === void 0 ? { sidebarCollapsed: c, darkMode: k, mode: v } : { ...h, sidebarCollapsed: c });
|
|
160
|
+
}, [r, c, k, v, d == null ? void 0 : d.mode, N]), E(() => {
|
|
161
|
+
if (d !== void 0) return;
|
|
162
|
+
const h = document.documentElement, z = h.classList.contains("dark");
|
|
163
|
+
return k ? h.classList.add("dark") : h.classList.remove("dark"), () => {
|
|
164
|
+
h.classList.toggle("dark", z);
|
|
165
|
+
};
|
|
166
|
+
}, [k, d]);
|
|
167
|
+
const j = A(() => x((h) => !h), []), R = A(() => y((h) => !h), []), q = A(() => L(!k), [L, k]), U = I(
|
|
43
168
|
() => ({
|
|
44
169
|
sidebarCollapsed: c,
|
|
45
|
-
mobileOpen:
|
|
46
|
-
darkMode:
|
|
47
|
-
toggleSidebar:
|
|
48
|
-
setSidebarCollapsed:
|
|
49
|
-
toggleMobile:
|
|
50
|
-
setMobileOpen:
|
|
51
|
-
toggleDarkMode:
|
|
52
|
-
setDarkMode:
|
|
53
|
-
permissions:
|
|
54
|
-
breadcrumbs:
|
|
55
|
-
setBreadcrumbs:
|
|
56
|
-
activePath:
|
|
57
|
-
setActivePath:
|
|
170
|
+
mobileOpen: w,
|
|
171
|
+
darkMode: k,
|
|
172
|
+
toggleSidebar: j,
|
|
173
|
+
setSidebarCollapsed: x,
|
|
174
|
+
toggleMobile: R,
|
|
175
|
+
setMobileOpen: y,
|
|
176
|
+
toggleDarkMode: q,
|
|
177
|
+
setDarkMode: L,
|
|
178
|
+
permissions: t,
|
|
179
|
+
breadcrumbs: T,
|
|
180
|
+
setBreadcrumbs: g,
|
|
181
|
+
activePath: M,
|
|
182
|
+
setActivePath: B
|
|
58
183
|
}),
|
|
59
184
|
[
|
|
60
185
|
c,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
186
|
+
w,
|
|
187
|
+
k,
|
|
188
|
+
j,
|
|
189
|
+
R,
|
|
190
|
+
q,
|
|
191
|
+
L,
|
|
192
|
+
t,
|
|
193
|
+
T,
|
|
194
|
+
M
|
|
69
195
|
]
|
|
70
196
|
);
|
|
71
|
-
return /* @__PURE__ */
|
|
197
|
+
return /* @__PURE__ */ a(ne.Provider, { value: U, children: /* @__PURE__ */ a(ae.Provider, { value: { ...D, requestedMode: v, setMode: P }, children: e }) });
|
|
72
198
|
}
|
|
73
|
-
function
|
|
74
|
-
const e =
|
|
199
|
+
function O() {
|
|
200
|
+
const e = Y(ne);
|
|
75
201
|
if (!e)
|
|
76
202
|
throw new Error("useLayoutContext must be used within LayoutProvider / AdminLayout");
|
|
77
203
|
return e;
|
|
78
204
|
}
|
|
79
|
-
function
|
|
205
|
+
function F() {
|
|
80
206
|
const {
|
|
81
207
|
sidebarCollapsed: e,
|
|
82
|
-
mobileOpen:
|
|
83
|
-
toggleSidebar:
|
|
84
|
-
setSidebarCollapsed:
|
|
85
|
-
toggleMobile:
|
|
86
|
-
setMobileOpen:
|
|
87
|
-
} =
|
|
208
|
+
mobileOpen: r,
|
|
209
|
+
toggleSidebar: n,
|
|
210
|
+
setSidebarCollapsed: t,
|
|
211
|
+
toggleMobile: o,
|
|
212
|
+
setMobileOpen: s
|
|
213
|
+
} = O(), i = A(() => s(!1), [s]);
|
|
88
214
|
return {
|
|
89
215
|
collapsed: e,
|
|
90
|
-
mobileOpen:
|
|
91
|
-
toggle:
|
|
92
|
-
setCollapsed:
|
|
93
|
-
toggleMobile:
|
|
94
|
-
setMobileOpen:
|
|
95
|
-
closeMobile:
|
|
216
|
+
mobileOpen: r,
|
|
217
|
+
toggle: n,
|
|
218
|
+
setCollapsed: t,
|
|
219
|
+
toggleMobile: o,
|
|
220
|
+
setMobileOpen: s,
|
|
221
|
+
closeMobile: i
|
|
96
222
|
};
|
|
97
223
|
}
|
|
98
|
-
function
|
|
99
|
-
const
|
|
100
|
-
return
|
|
101
|
-
const
|
|
102
|
-
return { label:
|
|
224
|
+
function J(e) {
|
|
225
|
+
const r = e.split("/").filter(Boolean);
|
|
226
|
+
return r.length ? r.map((n, t) => {
|
|
227
|
+
const o = "/" + r.slice(0, t + 1).join("/");
|
|
228
|
+
return { label: n.replace(/-/g, " ").replace(/\b\w/g, (i) => i.toUpperCase()), path: t < r.length - 1 ? o : void 0 };
|
|
103
229
|
}) : [{ label: "Home", path: "/" }];
|
|
104
230
|
}
|
|
105
|
-
function
|
|
106
|
-
var
|
|
107
|
-
if (typeof e == "string" || typeof e == "number")
|
|
231
|
+
function ie(e) {
|
|
232
|
+
var r, n, t = "";
|
|
233
|
+
if (typeof e == "string" || typeof e == "number") t += e;
|
|
108
234
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
109
|
-
var
|
|
110
|
-
for (
|
|
111
|
-
} else for (
|
|
112
|
-
return
|
|
113
|
-
}
|
|
114
|
-
function
|
|
115
|
-
for (var e,
|
|
116
|
-
return
|
|
117
|
-
}
|
|
118
|
-
function
|
|
119
|
-
return
|
|
120
|
-
}
|
|
121
|
-
function
|
|
122
|
-
const { pathname:
|
|
123
|
-
return
|
|
124
|
-
|
|
125
|
-
}, [
|
|
126
|
-
}
|
|
127
|
-
function
|
|
128
|
-
return /* @__PURE__ */
|
|
235
|
+
var o = e.length;
|
|
236
|
+
for (r = 0; r < o; r++) e[r] && (n = ie(e[r])) && (t && (t += " "), t += n);
|
|
237
|
+
} else for (n in e) e[n] && (t && (t += " "), t += n);
|
|
238
|
+
return t;
|
|
239
|
+
}
|
|
240
|
+
function Ee() {
|
|
241
|
+
for (var e, r, n = 0, t = "", o = arguments.length; n < o; n++) (e = arguments[n]) && (r = ie(e)) && (t && (t += " "), t += r);
|
|
242
|
+
return t;
|
|
243
|
+
}
|
|
244
|
+
function b(...e) {
|
|
245
|
+
return Ee(e);
|
|
246
|
+
}
|
|
247
|
+
function Pe({ children: e }) {
|
|
248
|
+
const { pathname: r } = ce(), { setActivePath: n, setBreadcrumbs: t, breadcrumbs: o } = O();
|
|
249
|
+
return E(() => {
|
|
250
|
+
n(r), o.length || t(J(r));
|
|
251
|
+
}, [r, n, t, o.length]), /* @__PURE__ */ a($, { children: e });
|
|
252
|
+
}
|
|
253
|
+
function Oe({ children: e, className: r }) {
|
|
254
|
+
return /* @__PURE__ */ a(
|
|
129
255
|
"footer",
|
|
130
256
|
{
|
|
131
|
-
className:
|
|
257
|
+
className: b(
|
|
132
258
|
"mt-auto border-t border-admin-border bg-admin-surface px-6 py-4 text-sm text-admin-muted",
|
|
133
|
-
|
|
259
|
+
r
|
|
134
260
|
),
|
|
135
|
-
children: e ?? /* @__PURE__ */
|
|
261
|
+
children: e ?? /* @__PURE__ */ u("p", { className: "text-center", children: [
|
|
136
262
|
"© ",
|
|
137
263
|
(/* @__PURE__ */ new Date()).getFullYear(),
|
|
138
264
|
" Admin Layout · Built with @rqdhw3n/react-admin-layout"
|
|
@@ -140,281 +266,322 @@ function xe({ children: e, className: t }) {
|
|
|
140
266
|
}
|
|
141
267
|
);
|
|
142
268
|
}
|
|
143
|
-
function
|
|
144
|
-
const
|
|
145
|
-
return
|
|
146
|
-
resource: e.slice(0,
|
|
147
|
-
action: e.slice(
|
|
269
|
+
function De(e) {
|
|
270
|
+
const r = e.indexOf(".");
|
|
271
|
+
return r === -1 ? { resource: e, action: "view" } : {
|
|
272
|
+
resource: e.slice(0, r),
|
|
273
|
+
action: e.slice(r + 1)
|
|
148
274
|
};
|
|
149
275
|
}
|
|
150
|
-
function
|
|
151
|
-
if (!
|
|
152
|
-
const { resource:
|
|
153
|
-
return
|
|
154
|
-
}
|
|
155
|
-
function
|
|
156
|
-
return e.filter((
|
|
157
|
-
...
|
|
158
|
-
children:
|
|
159
|
-
})).filter((
|
|
160
|
-
var
|
|
161
|
-
return !((
|
|
276
|
+
function Te(e, r) {
|
|
277
|
+
if (!r) return !0;
|
|
278
|
+
const { resource: n, action: t } = De(r), o = e[n];
|
|
279
|
+
return o != null && o.length ? o.includes(t) || o.includes("*") : !1;
|
|
280
|
+
}
|
|
281
|
+
function K(e, r) {
|
|
282
|
+
return e.filter((n) => Te(r, n.permission)).map((n) => ({
|
|
283
|
+
...n,
|
|
284
|
+
children: n.children ? K(n.children, r) : void 0
|
|
285
|
+
})).filter((n) => {
|
|
286
|
+
var t;
|
|
287
|
+
return !((t = n.children) != null && t.length) || n.children.length > 0 || n.path;
|
|
162
288
|
});
|
|
163
289
|
}
|
|
164
|
-
function
|
|
165
|
-
return /* @__PURE__ */
|
|
166
|
-
e && !
|
|
167
|
-
/* @__PURE__ */
|
|
290
|
+
function oe({ label: e, children: r, collapsed: n, className: t }) {
|
|
291
|
+
return /* @__PURE__ */ u("div", { className: b("ral-sidebar-group mb-4", t), children: [
|
|
292
|
+
e && !n && /* @__PURE__ */ a("p", { className: "ral-sidebar-brand mb-2 px-3 text-[11px] font-semibold uppercase tracking-wider", children: e }),
|
|
293
|
+
/* @__PURE__ */ a("ul", { className: "space-y-0.5", children: r })
|
|
168
294
|
] });
|
|
169
295
|
}
|
|
170
|
-
function
|
|
171
|
-
return e ?
|
|
296
|
+
function de(e, r) {
|
|
297
|
+
return e ? r === e || r.startsWith(`${e}/`) : !1;
|
|
298
|
+
}
|
|
299
|
+
function se(e, r) {
|
|
300
|
+
var n;
|
|
301
|
+
return !!((n = e.children) != null && n.some((t) => de(t.path, r) || se(t, r)));
|
|
172
302
|
}
|
|
173
|
-
function
|
|
303
|
+
function V({
|
|
174
304
|
item: e,
|
|
175
|
-
collapsed:
|
|
176
|
-
depth:
|
|
177
|
-
activePath:
|
|
178
|
-
onNavigate:
|
|
179
|
-
LinkComponent:
|
|
305
|
+
collapsed: r = !1,
|
|
306
|
+
depth: n = 0,
|
|
307
|
+
activePath: t = "/",
|
|
308
|
+
onNavigate: o,
|
|
309
|
+
LinkComponent: s,
|
|
180
310
|
onItemClick: i
|
|
181
311
|
}) {
|
|
182
|
-
var
|
|
183
|
-
const d = !!((
|
|
184
|
-
|
|
312
|
+
var v;
|
|
313
|
+
const d = !!((v = e.children) != null && v.length), l = e.path ? de(e.path, t) : !1, c = se(e, t), [x, w] = C(l || c);
|
|
314
|
+
E(() => {
|
|
315
|
+
c && w(!0);
|
|
316
|
+
}, [t, c]);
|
|
317
|
+
const y = e.icon, m = b(
|
|
318
|
+
"ral-nav-item group flex w-full items-center gap-3 px-3 text-sm font-medium",
|
|
185
319
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-admin-primary",
|
|
186
|
-
c || b ? "bg-admin-primary text-white shadow-sm" : "text-admin-muted hover:bg-admin-bg hover:text-admin-text",
|
|
187
320
|
e.disabled && "pointer-events-none opacity-50",
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
321
|
+
n > 0 && "text-[13px]",
|
|
322
|
+
r && "justify-center",
|
|
323
|
+
(l || c) && "ral-nav-active"
|
|
324
|
+
), p = /* @__PURE__ */ u($, { children: [
|
|
325
|
+
y && /* @__PURE__ */ a(
|
|
326
|
+
y,
|
|
192
327
|
{
|
|
193
|
-
className:
|
|
328
|
+
className: "h-[18px] w-[18px] shrink-0",
|
|
194
329
|
"aria-hidden": !0
|
|
195
330
|
}
|
|
196
331
|
),
|
|
197
|
-
!
|
|
198
|
-
|
|
199
|
-
|
|
332
|
+
r && !y && /* @__PURE__ */ a("span", { "aria-hidden": !0, children: e.label.charAt(0) }),
|
|
333
|
+
r && /* @__PURE__ */ a("span", { className: "sr-only", children: e.label }),
|
|
334
|
+
!r && /* @__PURE__ */ u($, { children: [
|
|
335
|
+
/* @__PURE__ */ a("span", { className: "flex-1 truncate text-left", children: e.label }),
|
|
336
|
+
e.badge != null && /* @__PURE__ */ a(
|
|
200
337
|
"span",
|
|
201
338
|
{
|
|
202
|
-
className:
|
|
203
|
-
"rounded-full px-2 py-0.5 text-[11px] font-semibold"
|
|
204
|
-
c ? "bg-white/20 text-white" : "bg-admin-primary/10 text-admin-primary"
|
|
339
|
+
className: b(
|
|
340
|
+
"ral-nav-badge rounded-full px-2 py-0.5 text-[11px] font-semibold"
|
|
205
341
|
),
|
|
206
342
|
children: e.badge
|
|
207
343
|
}
|
|
208
344
|
),
|
|
209
|
-
d && /* @__PURE__ */
|
|
210
|
-
|
|
345
|
+
d && /* @__PURE__ */ a(
|
|
346
|
+
Z,
|
|
211
347
|
{
|
|
212
|
-
className:
|
|
348
|
+
className: b("h-4 w-4 shrink-0 transition-transform", x && "rotate-180"),
|
|
213
349
|
"aria-hidden": !0
|
|
214
350
|
}
|
|
215
351
|
)
|
|
216
352
|
] })
|
|
217
353
|
] }), N = () => {
|
|
218
|
-
if (
|
|
219
|
-
|
|
220
|
-
|
|
354
|
+
if (!e.disabled) {
|
|
355
|
+
if (d) {
|
|
356
|
+
w((f) => !f);
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
e.path && (o == null || o(e.path), i == null || i());
|
|
221
360
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
l,
|
|
361
|
+
}, S = e.path && !d && s && !e.disabled ? /* @__PURE__ */ a(
|
|
362
|
+
s,
|
|
225
363
|
{
|
|
226
364
|
to: e.path,
|
|
227
365
|
className: m,
|
|
228
|
-
onClick:
|
|
229
|
-
i == null || i();
|
|
230
|
-
},
|
|
366
|
+
onClick: N,
|
|
231
367
|
children: p
|
|
232
368
|
}
|
|
233
|
-
) : /* @__PURE__ */
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
369
|
+
) : /* @__PURE__ */ a(
|
|
370
|
+
"button",
|
|
371
|
+
{
|
|
372
|
+
type: "button",
|
|
373
|
+
className: m,
|
|
374
|
+
onClick: N,
|
|
375
|
+
disabled: e.disabled,
|
|
376
|
+
"data-active": l || c,
|
|
377
|
+
"aria-label": r ? e.label : void 0,
|
|
378
|
+
title: r ? e.label : void 0,
|
|
379
|
+
"aria-expanded": d ? !!x : void 0,
|
|
380
|
+
"aria-current": l && !d ? "page" : void 0,
|
|
381
|
+
children: p
|
|
382
|
+
}
|
|
383
|
+
);
|
|
384
|
+
return /* @__PURE__ */ u("li", { "data-active": l || c, "aria-label": r ? e.label : void 0, children: [
|
|
385
|
+
S,
|
|
386
|
+
d && x && /* @__PURE__ */ a("ul", { className: b("mt-1 space-y-0.5", !r && "border-l border-admin-border ml-5 pl-2"), children: e.children.map((f) => /* @__PURE__ */ a(
|
|
387
|
+
V,
|
|
238
388
|
{
|
|
239
|
-
item:
|
|
240
|
-
collapsed:
|
|
241
|
-
depth:
|
|
242
|
-
activePath:
|
|
243
|
-
onNavigate:
|
|
244
|
-
LinkComponent:
|
|
389
|
+
item: f,
|
|
390
|
+
collapsed: r,
|
|
391
|
+
depth: n + 1,
|
|
392
|
+
activePath: t,
|
|
393
|
+
onNavigate: o,
|
|
394
|
+
LinkComponent: s,
|
|
245
395
|
onItemClick: i
|
|
246
396
|
},
|
|
247
|
-
|
|
397
|
+
f.label + (f.path ?? "")
|
|
248
398
|
)) })
|
|
249
399
|
] });
|
|
250
400
|
}
|
|
251
|
-
function
|
|
401
|
+
function qe({
|
|
252
402
|
items: e,
|
|
253
|
-
appName:
|
|
254
|
-
appLogo:
|
|
255
|
-
onNavigate:
|
|
256
|
-
activePath:
|
|
257
|
-
LinkComponent:
|
|
403
|
+
appName: r = "Admin",
|
|
404
|
+
appLogo: n,
|
|
405
|
+
onNavigate: t,
|
|
406
|
+
activePath: o,
|
|
407
|
+
LinkComponent: s
|
|
258
408
|
}) {
|
|
259
|
-
const { mobileOpen: i, closeMobile: d } =
|
|
260
|
-
if (
|
|
409
|
+
const { mobileOpen: i, closeMobile: d } = F(), { permissions: l, activePath: c } = O(), x = o ?? c, w = K(e, l), y = H(null);
|
|
410
|
+
if (E(() => {
|
|
411
|
+
var k, P, L, T;
|
|
261
412
|
if (!i) return;
|
|
262
|
-
const
|
|
263
|
-
|
|
413
|
+
const p = document.activeElement, N = document.body.style.overflow, S = () => {
|
|
414
|
+
var g;
|
|
415
|
+
return Array.from(((g = y.current) == null ? void 0 : g.querySelectorAll(
|
|
416
|
+
'button:not(:disabled), a[href], input, [tabindex="0"]'
|
|
417
|
+
)) ?? []).filter((M) => M.getClientRects().length > 0);
|
|
418
|
+
};
|
|
419
|
+
(P = (k = y.current) == null ? void 0 : k.querySelector('[aria-label="Close sidebar"]')) == null || P.focus();
|
|
420
|
+
const v = (g) => {
|
|
421
|
+
if (g.key === "Escape" && d(), g.key === "Tab") {
|
|
422
|
+
const M = S(), B = M[0], j = M[M.length - 1];
|
|
423
|
+
g.shiftKey && document.activeElement === B ? (g.preventDefault(), j == null || j.focus()) : !g.shiftKey && document.activeElement === j && (g.preventDefault(), B == null || B.focus());
|
|
424
|
+
}
|
|
425
|
+
}, f = (L = window.matchMedia) == null ? void 0 : L.call(window, "(min-width: 1024px)"), D = () => {
|
|
426
|
+
f != null && f.matches && d();
|
|
264
427
|
};
|
|
265
|
-
return document.addEventListener("keydown",
|
|
266
|
-
|
|
428
|
+
return (T = f == null ? void 0 : f.addEventListener) == null || T.call(f, "change", D), document.addEventListener("keydown", v), document.body.style.overflow = "hidden", () => {
|
|
429
|
+
var g;
|
|
430
|
+
document.removeEventListener("keydown", v), (g = f == null ? void 0 : f.removeEventListener) == null || g.call(f, "change", D), document.body.style.overflow = N, p == null || p.focus();
|
|
267
431
|
};
|
|
268
432
|
}, [i, d]), !i) return null;
|
|
269
|
-
const
|
|
270
|
-
|
|
433
|
+
const m = (p) => {
|
|
434
|
+
t == null || t(p), d();
|
|
271
435
|
};
|
|
272
|
-
return /* @__PURE__ */
|
|
273
|
-
/* @__PURE__ */
|
|
436
|
+
return /* @__PURE__ */ u("div", { ref: y, className: "fixed inset-0 z-50 lg:hidden", role: "dialog", "aria-modal": "true", "aria-label": "Navigation menu", children: [
|
|
437
|
+
/* @__PURE__ */ a(
|
|
274
438
|
"button",
|
|
275
439
|
{
|
|
276
440
|
type: "button",
|
|
277
|
-
className: "absolute inset-0
|
|
441
|
+
className: "ral-overlay absolute inset-0 backdrop-blur-sm animate-fade-in",
|
|
278
442
|
"aria-label": "Close menu",
|
|
279
443
|
onClick: d
|
|
280
444
|
}
|
|
281
445
|
),
|
|
282
|
-
/* @__PURE__ */
|
|
446
|
+
/* @__PURE__ */ u(
|
|
283
447
|
"aside",
|
|
284
448
|
{
|
|
285
|
-
className:
|
|
286
|
-
"absolute left-0 top-0 flex h-full w-[min(
|
|
287
|
-
"border-r border-admin-border
|
|
449
|
+
className: b(
|
|
450
|
+
"ral-sidebar absolute left-0 top-0 flex h-full w-[min(var(--ral-sidebar-width),85vw)] flex-col",
|
|
451
|
+
"border-r border-admin-border shadow-admin-lg animate-slide-in"
|
|
288
452
|
),
|
|
289
453
|
children: [
|
|
290
|
-
/* @__PURE__ */
|
|
291
|
-
/* @__PURE__ */
|
|
292
|
-
|
|
293
|
-
/* @__PURE__ */
|
|
454
|
+
/* @__PURE__ */ u("div", { className: "ral-sidebar-top flex items-center justify-between border-b border-admin-border px-4", children: [
|
|
455
|
+
/* @__PURE__ */ u("div", { className: "flex items-center gap-3", children: [
|
|
456
|
+
n ?? /* @__PURE__ */ a("div", { className: "flex h-9 w-9 items-center justify-center rounded-admin bg-admin-primary text-sm font-bold text-admin-on-primary", children: r.charAt(0) }),
|
|
457
|
+
/* @__PURE__ */ a("span", { className: "ral-sidebar-brand font-semibold", children: r })
|
|
294
458
|
] }),
|
|
295
|
-
/* @__PURE__ */
|
|
459
|
+
/* @__PURE__ */ a(
|
|
296
460
|
"button",
|
|
297
461
|
{
|
|
298
462
|
type: "button",
|
|
299
463
|
onClick: d,
|
|
300
|
-
className: "rounded-
|
|
464
|
+
className: "rounded-admin p-2 text-admin-muted hover:bg-admin-hover",
|
|
301
465
|
"aria-label": "Close sidebar",
|
|
302
|
-
children: /* @__PURE__ */
|
|
466
|
+
children: /* @__PURE__ */ a(me, { className: "h-5 w-5" })
|
|
303
467
|
}
|
|
304
468
|
)
|
|
305
469
|
] }),
|
|
306
|
-
/* @__PURE__ */
|
|
307
|
-
|
|
470
|
+
/* @__PURE__ */ a("nav", { className: "flex-1 overflow-y-auto p-3", children: /* @__PURE__ */ a(oe, { children: w.map((p) => /* @__PURE__ */ a(
|
|
471
|
+
V,
|
|
308
472
|
{
|
|
309
|
-
item:
|
|
310
|
-
activePath:
|
|
311
|
-
onNavigate:
|
|
312
|
-
LinkComponent:
|
|
473
|
+
item: p,
|
|
474
|
+
activePath: x,
|
|
475
|
+
onNavigate: m,
|
|
476
|
+
LinkComponent: s,
|
|
313
477
|
onItemClick: d
|
|
314
478
|
},
|
|
315
|
-
|
|
479
|
+
p.label + (p.path ?? "")
|
|
316
480
|
)) }) })
|
|
317
481
|
]
|
|
318
482
|
}
|
|
319
483
|
)
|
|
320
484
|
] });
|
|
321
485
|
}
|
|
322
|
-
function
|
|
486
|
+
function ze({
|
|
323
487
|
items: e,
|
|
324
|
-
className:
|
|
325
|
-
LinkComponent:
|
|
326
|
-
onNavigate:
|
|
488
|
+
className: r,
|
|
489
|
+
LinkComponent: n,
|
|
490
|
+
onNavigate: t
|
|
327
491
|
}) {
|
|
328
492
|
if (!e.length) return null;
|
|
329
|
-
const
|
|
330
|
-
const d =
|
|
493
|
+
const o = (s, i) => {
|
|
494
|
+
const d = b(
|
|
331
495
|
"text-sm transition-colors",
|
|
332
|
-
i ? "font-medium text-admin-text" : "text-admin-muted hover:text-admin-text"
|
|
496
|
+
i ? "font-medium text-admin-text" : "text-admin-muted hover:text-admin-hover-text"
|
|
333
497
|
);
|
|
334
|
-
return !
|
|
498
|
+
return !s.path || i ? /* @__PURE__ */ a("span", { className: d, children: s.label }) : n ? /* @__PURE__ */ a(n, { to: s.path, className: d, children: s.label }) : /* @__PURE__ */ a("button", { type: "button", className: d, onClick: () => t == null ? void 0 : t(s.path), children: s.label });
|
|
335
499
|
};
|
|
336
|
-
return /* @__PURE__ */
|
|
337
|
-
/* @__PURE__ */
|
|
338
|
-
e.map((
|
|
500
|
+
return /* @__PURE__ */ u("nav", { "aria-label": "Breadcrumb", className: b("flex items-center gap-1.5", r), children: [
|
|
501
|
+
/* @__PURE__ */ a(fe, { className: "h-4 w-4 text-admin-muted shrink-0", "aria-hidden": !0 }),
|
|
502
|
+
e.map((s, i) => {
|
|
339
503
|
const d = i === e.length - 1;
|
|
340
|
-
return /* @__PURE__ */
|
|
341
|
-
/* @__PURE__ */
|
|
342
|
-
s
|
|
343
|
-
] }, `${
|
|
504
|
+
return /* @__PURE__ */ u("span", { className: "flex items-center gap-1.5", children: [
|
|
505
|
+
/* @__PURE__ */ a(be, { className: "h-3.5 w-3.5 text-admin-muted", "aria-hidden": !0 }),
|
|
506
|
+
o(s, d)
|
|
507
|
+
] }, `${s.label}-${i}`);
|
|
344
508
|
})
|
|
345
509
|
] });
|
|
346
510
|
}
|
|
347
|
-
function
|
|
511
|
+
function Re({
|
|
348
512
|
placeholder: e = "Search...",
|
|
349
|
-
onSearch:
|
|
350
|
-
className:
|
|
513
|
+
onSearch: r,
|
|
514
|
+
className: n
|
|
351
515
|
}) {
|
|
352
|
-
const [
|
|
353
|
-
return /* @__PURE__ */
|
|
354
|
-
i.preventDefault(),
|
|
355
|
-
}, className:
|
|
356
|
-
/* @__PURE__ */
|
|
357
|
-
|
|
516
|
+
const [t, o] = C("");
|
|
517
|
+
return /* @__PURE__ */ u("form", { onSubmit: (i) => {
|
|
518
|
+
i.preventDefault(), r == null || r(t.trim());
|
|
519
|
+
}, className: b("relative w-full max-w-md", n), children: [
|
|
520
|
+
/* @__PURE__ */ a(
|
|
521
|
+
he,
|
|
358
522
|
{
|
|
359
523
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-admin-muted",
|
|
360
524
|
"aria-hidden": !0
|
|
361
525
|
}
|
|
362
526
|
),
|
|
363
|
-
/* @__PURE__ */
|
|
527
|
+
/* @__PURE__ */ a(
|
|
364
528
|
"input",
|
|
365
529
|
{
|
|
366
530
|
type: "search",
|
|
367
|
-
value:
|
|
368
|
-
onChange: (i) =>
|
|
531
|
+
value: t,
|
|
532
|
+
onChange: (i) => o(i.target.value),
|
|
369
533
|
placeholder: e,
|
|
370
|
-
className:
|
|
371
|
-
"h-10 w-full rounded-
|
|
372
|
-
"placeholder:text-admin-muted focus:border-admin-primary focus:outline-none focus:ring-2 focus:ring-admin-primary
|
|
534
|
+
className: b(
|
|
535
|
+
"h-10 w-full rounded-admin border border-admin-border bg-admin-bg pl-10 pr-4 text-sm text-admin-text",
|
|
536
|
+
"placeholder:text-admin-muted focus:border-admin-primary focus:outline-none focus:ring-2 focus:ring-admin-primary"
|
|
373
537
|
),
|
|
374
538
|
"aria-label": "Search"
|
|
375
539
|
}
|
|
376
540
|
)
|
|
377
541
|
] });
|
|
378
542
|
}
|
|
379
|
-
function
|
|
380
|
-
const [
|
|
381
|
-
return
|
|
543
|
+
function Ue({ notifications: e = [], className: r }) {
|
|
544
|
+
const [n, t] = C(!1), o = H(null), s = e.filter((i) => !i.read).length;
|
|
545
|
+
return E(() => {
|
|
382
546
|
const i = (d) => {
|
|
383
|
-
|
|
547
|
+
o.current && !o.current.contains(d.target) && t(!1);
|
|
384
548
|
};
|
|
385
549
|
return document.addEventListener("mousedown", i), () => document.removeEventListener("mousedown", i);
|
|
386
|
-
}, []), /* @__PURE__ */
|
|
387
|
-
|
|
550
|
+
}, []), /* @__PURE__ */ u("div", { ref: o, className: b("relative", r), onKeyDown: (i) => {
|
|
551
|
+
var d, l;
|
|
552
|
+
i.key === "Escape" && (t(!1), (l = (d = o.current) == null ? void 0 : d.querySelector("button")) == null || l.focus());
|
|
553
|
+
}, children: [
|
|
554
|
+
/* @__PURE__ */ u(
|
|
388
555
|
"button",
|
|
389
556
|
{
|
|
390
557
|
type: "button",
|
|
391
|
-
onClick: () =>
|
|
392
|
-
className:
|
|
393
|
-
"relative inline-flex h-9 w-9 items-center justify-center rounded-
|
|
394
|
-
"bg-admin-surface text-admin-muted transition-colors hover:bg-admin-
|
|
558
|
+
onClick: () => t((i) => !i),
|
|
559
|
+
className: b(
|
|
560
|
+
"relative inline-flex h-9 w-9 items-center justify-center rounded-admin border border-admin-border",
|
|
561
|
+
"bg-admin-surface text-admin-muted transition-colors hover:bg-admin-hover hover:text-admin-hover-text",
|
|
395
562
|
"focus-visible:ring-2 focus-visible:ring-admin-primary"
|
|
396
563
|
),
|
|
397
|
-
"aria-label": `Notifications${
|
|
398
|
-
"aria-expanded":
|
|
564
|
+
"aria-label": `Notifications${s ? `, ${s} unread` : ""}`,
|
|
565
|
+
"aria-expanded": n,
|
|
399
566
|
children: [
|
|
400
|
-
/* @__PURE__ */
|
|
401
|
-
|
|
567
|
+
/* @__PURE__ */ a(pe, { className: "h-4 w-4", "aria-hidden": !0 }),
|
|
568
|
+
s > 0 && /* @__PURE__ */ a("span", { className: "absolute -right-0.5 -top-0.5 flex h-4 min-w-4 items-center justify-center rounded-full bg-admin-danger px-1 text-[10px] font-bold text-admin-on-danger", children: s > 9 ? "9+" : s })
|
|
402
569
|
]
|
|
403
570
|
}
|
|
404
571
|
),
|
|
405
|
-
|
|
406
|
-
/* @__PURE__ */
|
|
407
|
-
/* @__PURE__ */
|
|
572
|
+
n && /* @__PURE__ */ u("div", { className: "absolute right-0 top-full z-50 mt-2 w-80 max-w-[calc(100vw-6rem)] rounded-admin border border-admin-border bg-admin-surface shadow-admin-lg animate-fade-in", children: [
|
|
573
|
+
/* @__PURE__ */ a("div", { className: "border-b border-admin-border px-4 py-3", children: /* @__PURE__ */ a("p", { className: "text-sm font-semibold text-admin-text", children: "Notifications" }) }),
|
|
574
|
+
/* @__PURE__ */ a("ul", { className: "max-h-72 overflow-y-auto p-2", children: e.length === 0 ? /* @__PURE__ */ a("li", { className: "px-3 py-6 text-center text-sm text-admin-muted", children: "No notifications" }) : e.map((i) => /* @__PURE__ */ u(
|
|
408
575
|
"li",
|
|
409
576
|
{
|
|
410
|
-
className:
|
|
411
|
-
"rounded-
|
|
412
|
-
!i.read && "
|
|
577
|
+
className: b(
|
|
578
|
+
"rounded-admin px-3 py-2.5 transition-colors hover:bg-admin-hover",
|
|
579
|
+
!i.read && "ral-unread"
|
|
413
580
|
),
|
|
414
581
|
children: [
|
|
415
|
-
/* @__PURE__ */
|
|
416
|
-
i.description && /* @__PURE__ */
|
|
417
|
-
i.time && /* @__PURE__ */
|
|
582
|
+
/* @__PURE__ */ a("p", { className: "text-sm font-medium text-admin-text", children: i.title }),
|
|
583
|
+
i.description && /* @__PURE__ */ a("p", { className: "mt-0.5 text-xs text-admin-muted line-clamp-2", children: i.description }),
|
|
584
|
+
i.time && /* @__PURE__ */ a("p", { className: "mt-1 text-[11px] text-admin-muted", children: i.time })
|
|
418
585
|
]
|
|
419
586
|
},
|
|
420
587
|
i.id
|
|
@@ -422,108 +589,123 @@ function ke({ notifications: e = [], className: t }) {
|
|
|
422
589
|
] })
|
|
423
590
|
] });
|
|
424
591
|
}
|
|
425
|
-
function
|
|
426
|
-
const { darkMode: e, toggleDarkMode:
|
|
592
|
+
function $e() {
|
|
593
|
+
const { darkMode: e, toggleDarkMode: r, setDarkMode: n } = O();
|
|
427
594
|
return {
|
|
428
595
|
isDark: e,
|
|
429
|
-
toggle:
|
|
430
|
-
setDarkMode:
|
|
596
|
+
toggle: r,
|
|
597
|
+
setDarkMode: n
|
|
431
598
|
};
|
|
432
599
|
}
|
|
433
|
-
function
|
|
434
|
-
const { isDark:
|
|
435
|
-
return /* @__PURE__ */
|
|
600
|
+
function He({ className: e }) {
|
|
601
|
+
const { isDark: r, toggle: n } = $e();
|
|
602
|
+
return /* @__PURE__ */ a(
|
|
436
603
|
"button",
|
|
437
604
|
{
|
|
438
605
|
type: "button",
|
|
439
|
-
onClick:
|
|
440
|
-
className:
|
|
441
|
-
"inline-flex h-9 w-9 items-center justify-center rounded-
|
|
442
|
-
"bg-admin-surface text-admin-muted transition-colors hover:bg-admin-
|
|
606
|
+
onClick: n,
|
|
607
|
+
className: b(
|
|
608
|
+
"inline-flex h-9 w-9 items-center justify-center rounded-admin border border-admin-border",
|
|
609
|
+
"bg-admin-surface text-admin-muted transition-colors hover:bg-admin-hover hover:text-admin-hover-text",
|
|
443
610
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-admin-primary focus-visible:ring-offset-2",
|
|
444
611
|
e
|
|
445
612
|
),
|
|
446
|
-
"aria-label":
|
|
447
|
-
children:
|
|
613
|
+
"aria-label": r ? "Switch to light mode" : "Switch to dark mode",
|
|
614
|
+
children: r ? /* @__PURE__ */ a(xe, { className: "h-4 w-4", "aria-hidden": !0 }) : /* @__PURE__ */ a(ve, { className: "h-4 w-4", "aria-hidden": !0 })
|
|
448
615
|
}
|
|
449
616
|
);
|
|
450
617
|
}
|
|
451
|
-
function
|
|
452
|
-
const [
|
|
453
|
-
|
|
454
|
-
const
|
|
455
|
-
i.current && !i.current.contains(
|
|
618
|
+
function Fe({ user: e, onLogout: r, onSettings: n, className: t }) {
|
|
619
|
+
const [o, s] = C(!1), i = H(null);
|
|
620
|
+
E(() => {
|
|
621
|
+
const l = (c) => {
|
|
622
|
+
i.current && !i.current.contains(c.target) && s(!1);
|
|
456
623
|
};
|
|
457
|
-
return document.addEventListener("mousedown",
|
|
458
|
-
}, [])
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
624
|
+
return document.addEventListener("mousedown", l), () => document.removeEventListener("mousedown", l);
|
|
625
|
+
}, []), E(() => {
|
|
626
|
+
var l, c;
|
|
627
|
+
o && ((c = (l = i.current) == null ? void 0 : l.querySelector('[role="menuitem"]')) == null || c.focus());
|
|
628
|
+
}, [o]);
|
|
629
|
+
const d = e.name.split(" ").map((l) => l[0]).join("").slice(0, 2).toUpperCase();
|
|
630
|
+
return /* @__PURE__ */ u("div", { ref: i, className: b("relative", t), onKeyDown: (l) => {
|
|
631
|
+
var x, w, y;
|
|
632
|
+
const c = (x = i.current) == null ? void 0 : x.querySelector("[aria-haspopup]");
|
|
633
|
+
if (l.key === "Escape" && o && (l.preventDefault(), s(!1), c == null || c.focus()), l.key === "Tab" && s(!1), ["ArrowDown", "ArrowUp", "Home", "End"].includes(l.key)) {
|
|
634
|
+
if (l.preventDefault(), !o) {
|
|
635
|
+
s(!0);
|
|
636
|
+
return;
|
|
637
|
+
}
|
|
638
|
+
const m = Array.from(((w = i.current) == null ? void 0 : w.querySelectorAll('[role="menuitem"]')) ?? []), p = m.indexOf(document.activeElement), N = l.key === "Home" ? 0 : l.key === "End" ? m.length - 1 : (p + (l.key === "ArrowDown" ? 1 : -1) + m.length) % m.length;
|
|
639
|
+
(y = m[N]) == null || y.focus();
|
|
640
|
+
}
|
|
641
|
+
}, children: [
|
|
642
|
+
/* @__PURE__ */ u(
|
|
462
643
|
"button",
|
|
463
644
|
{
|
|
464
645
|
type: "button",
|
|
465
|
-
onClick: () =>
|
|
466
|
-
className:
|
|
467
|
-
"flex items-center gap-2 rounded-
|
|
468
|
-
"transition-colors hover:bg-admin-
|
|
646
|
+
onClick: () => s((l) => !l),
|
|
647
|
+
className: b(
|
|
648
|
+
"flex items-center gap-2 rounded-admin border border-admin-border bg-admin-surface px-2 py-1.5",
|
|
649
|
+
"transition-colors hover:bg-admin-hover focus-visible:ring-2 focus-visible:ring-admin-primary"
|
|
469
650
|
),
|
|
470
|
-
"aria-expanded":
|
|
651
|
+
"aria-expanded": o,
|
|
471
652
|
"aria-haspopup": "menu",
|
|
653
|
+
"aria-label": `User menu for ${e.name}`,
|
|
472
654
|
children: [
|
|
473
|
-
e.avatar ? /* @__PURE__ */
|
|
474
|
-
/* @__PURE__ */
|
|
475
|
-
/* @__PURE__ */
|
|
476
|
-
/* @__PURE__ */
|
|
655
|
+
e.avatar ? /* @__PURE__ */ a("img", { src: e.avatar, alt: "", className: "h-8 w-8 rounded-admin object-cover" }) : /* @__PURE__ */ a("div", { className: "flex h-8 w-8 items-center justify-center rounded-admin bg-admin-primary text-xs font-semibold text-admin-on-primary", children: d }),
|
|
656
|
+
/* @__PURE__ */ u("div", { className: "hidden text-left sm:block", children: [
|
|
657
|
+
/* @__PURE__ */ a("p", { className: "text-sm font-medium text-admin-text leading-tight", children: e.name }),
|
|
658
|
+
/* @__PURE__ */ a("p", { className: "text-xs text-admin-muted leading-tight", children: e.email })
|
|
477
659
|
] }),
|
|
478
|
-
/* @__PURE__ */
|
|
660
|
+
/* @__PURE__ */ a(Z, { className: "hidden h-4 w-4 text-admin-muted sm:block", "aria-hidden": !0 })
|
|
479
661
|
]
|
|
480
662
|
}
|
|
481
663
|
),
|
|
482
|
-
|
|
664
|
+
o && /* @__PURE__ */ u(
|
|
483
665
|
"div",
|
|
484
666
|
{
|
|
485
667
|
role: "menu",
|
|
486
|
-
className: "absolute right-0 top-full z-50 mt-2 w-56 rounded-
|
|
668
|
+
className: "absolute right-0 top-full z-50 mt-2 w-56 rounded-admin border border-admin-border bg-admin-surface p-1.5 shadow-admin-lg animate-fade-in",
|
|
487
669
|
children: [
|
|
488
|
-
/* @__PURE__ */
|
|
670
|
+
/* @__PURE__ */ u(
|
|
489
671
|
"button",
|
|
490
672
|
{
|
|
491
673
|
type: "button",
|
|
492
674
|
role: "menuitem",
|
|
493
|
-
className: "flex w-full items-center gap-2 rounded-
|
|
675
|
+
className: "flex w-full items-center gap-2 rounded-admin px-3 py-2 text-sm text-admin-text hover:bg-admin-hover",
|
|
494
676
|
onClick: () => {
|
|
495
|
-
|
|
677
|
+
n == null || n(), s(!1);
|
|
496
678
|
},
|
|
497
679
|
children: [
|
|
498
|
-
/* @__PURE__ */
|
|
680
|
+
/* @__PURE__ */ a(ye, { className: "h-4 w-4 text-admin-muted" }),
|
|
499
681
|
"Settings"
|
|
500
682
|
]
|
|
501
683
|
}
|
|
502
684
|
),
|
|
503
|
-
/* @__PURE__ */
|
|
685
|
+
/* @__PURE__ */ u(
|
|
504
686
|
"button",
|
|
505
687
|
{
|
|
506
688
|
type: "button",
|
|
507
689
|
role: "menuitem",
|
|
508
|
-
className: "flex w-full items-center gap-2 rounded-
|
|
690
|
+
className: "flex w-full items-center gap-2 rounded-admin px-3 py-2 text-sm text-admin-text hover:bg-admin-hover",
|
|
509
691
|
children: [
|
|
510
|
-
/* @__PURE__ */
|
|
692
|
+
/* @__PURE__ */ a(ge, { className: "h-4 w-4 text-admin-muted" }),
|
|
511
693
|
"Profile"
|
|
512
694
|
]
|
|
513
695
|
}
|
|
514
696
|
),
|
|
515
|
-
/* @__PURE__ */
|
|
516
|
-
/* @__PURE__ */
|
|
697
|
+
/* @__PURE__ */ a("hr", { className: "my-1 border-admin-border" }),
|
|
698
|
+
/* @__PURE__ */ u(
|
|
517
699
|
"button",
|
|
518
700
|
{
|
|
519
701
|
type: "button",
|
|
520
702
|
role: "menuitem",
|
|
521
|
-
className: "flex w-full items-center gap-2 rounded-
|
|
703
|
+
className: "flex w-full items-center gap-2 rounded-admin px-3 py-2 text-sm ral-danger",
|
|
522
704
|
onClick: () => {
|
|
523
|
-
|
|
705
|
+
r == null || r(), s(!1);
|
|
524
706
|
},
|
|
525
707
|
children: [
|
|
526
|
-
/* @__PURE__ */
|
|
708
|
+
/* @__PURE__ */ a(we, { className: "h-4 w-4" }),
|
|
527
709
|
"Log out"
|
|
528
710
|
]
|
|
529
711
|
}
|
|
@@ -533,272 +715,292 @@ function Me({ user: e, onLogout: t, onSettings: a, className: r }) {
|
|
|
533
715
|
)
|
|
534
716
|
] });
|
|
535
717
|
}
|
|
536
|
-
function
|
|
718
|
+
function Je({
|
|
537
719
|
user: e,
|
|
538
|
-
notifications:
|
|
539
|
-
onSearch:
|
|
540
|
-
searchPlaceholder:
|
|
541
|
-
showSearch:
|
|
542
|
-
className:
|
|
720
|
+
notifications: r = [],
|
|
721
|
+
onSearch: n,
|
|
722
|
+
searchPlaceholder: t = "Search...",
|
|
723
|
+
showSearch: o = !0,
|
|
724
|
+
className: s,
|
|
543
725
|
breadcrumbs: i = [],
|
|
544
726
|
onMenuClick: d,
|
|
545
|
-
sidebarCollapsed:
|
|
546
|
-
onToggleSidebar:
|
|
727
|
+
sidebarCollapsed: l,
|
|
728
|
+
onToggleSidebar: c
|
|
547
729
|
}) {
|
|
548
|
-
return /* @__PURE__ */
|
|
730
|
+
return /* @__PURE__ */ u(
|
|
549
731
|
"header",
|
|
550
732
|
{
|
|
551
|
-
className:
|
|
552
|
-
"sticky top-0 z-40 flex
|
|
553
|
-
|
|
554
|
-
l
|
|
733
|
+
className: b(
|
|
734
|
+
"ral-header sticky top-0 z-40 flex shrink-0 items-center gap-4 border-b border-admin-border",
|
|
735
|
+
s
|
|
555
736
|
),
|
|
556
737
|
children: [
|
|
557
|
-
/* @__PURE__ */
|
|
738
|
+
/* @__PURE__ */ a(
|
|
558
739
|
"button",
|
|
559
740
|
{
|
|
560
741
|
type: "button",
|
|
561
|
-
className: "rounded-
|
|
742
|
+
className: "rounded-admin p-2 text-admin-muted hover:bg-admin-hover lg:hidden",
|
|
562
743
|
onClick: d,
|
|
563
744
|
"aria-label": "Open menu",
|
|
564
|
-
children: /* @__PURE__ */
|
|
745
|
+
children: /* @__PURE__ */ a(Ne, { className: "h-5 w-5" })
|
|
565
746
|
}
|
|
566
747
|
),
|
|
567
|
-
/* @__PURE__ */
|
|
748
|
+
/* @__PURE__ */ a(
|
|
568
749
|
"button",
|
|
569
750
|
{
|
|
570
751
|
type: "button",
|
|
571
|
-
className: "hidden rounded-
|
|
572
|
-
onClick:
|
|
573
|
-
"aria-label":
|
|
574
|
-
children:
|
|
752
|
+
className: "hidden rounded-admin p-2 text-admin-muted hover:bg-admin-hover lg:inline-flex",
|
|
753
|
+
onClick: c,
|
|
754
|
+
"aria-label": l ? "Expand sidebar" : "Collapse sidebar",
|
|
755
|
+
children: l ? /* @__PURE__ */ a(ee, { className: "h-5 w-5" }) : /* @__PURE__ */ a(re, { className: "h-5 w-5" })
|
|
575
756
|
}
|
|
576
757
|
),
|
|
577
|
-
/* @__PURE__ */
|
|
578
|
-
/* @__PURE__ */
|
|
579
|
-
|
|
580
|
-
/* @__PURE__ */
|
|
581
|
-
/* @__PURE__ */
|
|
582
|
-
e && /* @__PURE__ */
|
|
758
|
+
/* @__PURE__ */ a("div", { className: "hidden min-w-0 flex-1 md:block", children: /* @__PURE__ */ a(ze, { items: i }) }),
|
|
759
|
+
/* @__PURE__ */ u("div", { className: "flex flex-1 items-center justify-end gap-2 sm:gap-3", children: [
|
|
760
|
+
o && /* @__PURE__ */ a("div", { className: "hidden flex-1 sm:flex sm:max-w-md", children: /* @__PURE__ */ a(Re, { placeholder: t, onSearch: n }) }),
|
|
761
|
+
/* @__PURE__ */ a(He, {}),
|
|
762
|
+
/* @__PURE__ */ a(Ue, { notifications: r }),
|
|
763
|
+
e && /* @__PURE__ */ a(Fe, { user: e })
|
|
583
764
|
] })
|
|
584
765
|
]
|
|
585
766
|
}
|
|
586
767
|
);
|
|
587
768
|
}
|
|
588
|
-
function
|
|
769
|
+
function Ke({
|
|
589
770
|
items: e,
|
|
590
|
-
collapsed:
|
|
591
|
-
appName:
|
|
592
|
-
appLogo:
|
|
593
|
-
className:
|
|
594
|
-
onNavigate:
|
|
771
|
+
collapsed: r,
|
|
772
|
+
appName: n = "Admin",
|
|
773
|
+
appLogo: t,
|
|
774
|
+
className: o,
|
|
775
|
+
onNavigate: s,
|
|
595
776
|
activePath: i,
|
|
596
777
|
LinkComponent: d
|
|
597
778
|
}) {
|
|
598
|
-
const { collapsed:
|
|
599
|
-
|
|
779
|
+
const { collapsed: l, toggle: c, closeMobile: x } = F(), { permissions: w, activePath: y } = O(), m = r ?? l, p = i ?? y, N = K(e, w), S = (v) => {
|
|
780
|
+
s == null || s(v), x();
|
|
600
781
|
};
|
|
601
|
-
return /* @__PURE__ */
|
|
782
|
+
return /* @__PURE__ */ u(
|
|
602
783
|
"aside",
|
|
603
784
|
{
|
|
604
|
-
className:
|
|
605
|
-
"hidden lg:flex flex-col border-r border-admin-border
|
|
785
|
+
className: b(
|
|
786
|
+
"ral-sidebar hidden lg:flex shrink-0 flex-col border-r border-admin-border",
|
|
787
|
+
"h-screen sticky top-0 transition-[width] duration-300 ease-in-out",
|
|
606
788
|
m ? "w-[var(--admin-sidebar-collapsed)]" : "w-[var(--admin-sidebar-width)]",
|
|
607
|
-
|
|
789
|
+
o
|
|
608
790
|
),
|
|
609
791
|
"aria-label": "Sidebar navigation",
|
|
610
792
|
children: [
|
|
611
|
-
/* @__PURE__ */
|
|
793
|
+
/* @__PURE__ */ u(
|
|
612
794
|
"div",
|
|
613
795
|
{
|
|
614
|
-
className:
|
|
615
|
-
"flex
|
|
796
|
+
className: b(
|
|
797
|
+
"ral-sidebar-top flex items-center border-b border-admin-border px-4",
|
|
616
798
|
m ? "justify-center" : "justify-between gap-2"
|
|
617
799
|
),
|
|
618
800
|
children: [
|
|
619
|
-
/* @__PURE__ */
|
|
620
|
-
|
|
621
|
-
!m && /* @__PURE__ */
|
|
801
|
+
/* @__PURE__ */ u("div", { className: b("flex items-center gap-3 min-w-0", m && "justify-center"), children: [
|
|
802
|
+
t ?? /* @__PURE__ */ a("div", { className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-admin bg-admin-primary text-sm font-bold text-admin-on-primary shadow-admin", children: n.charAt(0) }),
|
|
803
|
+
!m && /* @__PURE__ */ a("span", { className: "ral-sidebar-brand truncate text-base font-semibold", children: n })
|
|
622
804
|
] }),
|
|
623
|
-
!m && /* @__PURE__ */
|
|
805
|
+
!m && /* @__PURE__ */ a(
|
|
624
806
|
"button",
|
|
625
807
|
{
|
|
626
808
|
type: "button",
|
|
627
|
-
onClick:
|
|
628
|
-
className: "rounded-
|
|
809
|
+
onClick: c,
|
|
810
|
+
className: "rounded-admin p-2 text-admin-muted hover:bg-admin-hover hover:text-admin-hover-text focus-visible:ring-2 focus-visible:ring-admin-primary",
|
|
629
811
|
"aria-label": "Collapse sidebar",
|
|
630
|
-
children: /* @__PURE__ */
|
|
812
|
+
children: /* @__PURE__ */ a(re, { className: "h-4 w-4" })
|
|
631
813
|
}
|
|
632
814
|
)
|
|
633
815
|
]
|
|
634
816
|
}
|
|
635
817
|
),
|
|
636
|
-
m && /* @__PURE__ */
|
|
818
|
+
m && /* @__PURE__ */ a("div", { className: "flex justify-center py-2 border-b border-admin-border", children: /* @__PURE__ */ a(
|
|
637
819
|
"button",
|
|
638
820
|
{
|
|
639
821
|
type: "button",
|
|
640
|
-
onClick:
|
|
641
|
-
className: "rounded-
|
|
822
|
+
onClick: c,
|
|
823
|
+
className: "rounded-admin p-2 text-admin-muted hover:bg-admin-hover",
|
|
642
824
|
"aria-label": "Expand sidebar",
|
|
643
|
-
children: /* @__PURE__ */
|
|
825
|
+
children: /* @__PURE__ */ a(ee, { className: "h-4 w-4" })
|
|
644
826
|
}
|
|
645
827
|
) }),
|
|
646
|
-
/* @__PURE__ */
|
|
647
|
-
|
|
828
|
+
/* @__PURE__ */ a("nav", { className: "flex-1 overflow-y-auto p-3", children: /* @__PURE__ */ a(oe, { collapsed: m, children: N.map((v) => /* @__PURE__ */ a(
|
|
829
|
+
V,
|
|
648
830
|
{
|
|
649
|
-
item:
|
|
831
|
+
item: v,
|
|
650
832
|
collapsed: m,
|
|
651
833
|
activePath: p,
|
|
652
|
-
onNavigate:
|
|
834
|
+
onNavigate: S,
|
|
653
835
|
LinkComponent: d
|
|
654
836
|
},
|
|
655
|
-
|
|
837
|
+
v.label + (v.path ?? "")
|
|
656
838
|
)) }) })
|
|
657
839
|
]
|
|
658
840
|
}
|
|
659
841
|
);
|
|
660
842
|
}
|
|
661
|
-
function
|
|
843
|
+
function X({
|
|
662
844
|
children: e,
|
|
663
|
-
sidebarItems:
|
|
664
|
-
appName:
|
|
665
|
-
appLogo:
|
|
666
|
-
user:
|
|
667
|
-
notifications:
|
|
845
|
+
sidebarItems: r,
|
|
846
|
+
appName: n = "Admin",
|
|
847
|
+
appLogo: t,
|
|
848
|
+
user: o,
|
|
849
|
+
notifications: s = [],
|
|
668
850
|
footer: i,
|
|
669
851
|
showFooter: d = !0,
|
|
670
|
-
showSearch:
|
|
671
|
-
searchPlaceholder:
|
|
672
|
-
onSearch:
|
|
673
|
-
breadcrumbs:
|
|
674
|
-
contentClassName:
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
852
|
+
showSearch: l = !0,
|
|
853
|
+
searchPlaceholder: c,
|
|
854
|
+
onSearch: x,
|
|
855
|
+
breadcrumbs: w,
|
|
856
|
+
contentClassName: y,
|
|
857
|
+
className: m,
|
|
858
|
+
activePath: p,
|
|
859
|
+
onNavigate: N,
|
|
860
|
+
LinkComponent: S,
|
|
861
|
+
enableRouter: v = !1
|
|
679
862
|
}) {
|
|
680
863
|
const {
|
|
681
|
-
sidebarCollapsed:
|
|
682
|
-
toggleSidebar:
|
|
683
|
-
toggleMobile:
|
|
864
|
+
sidebarCollapsed: f,
|
|
865
|
+
toggleSidebar: D,
|
|
866
|
+
toggleMobile: k,
|
|
684
867
|
breadcrumbs: P,
|
|
685
|
-
setBreadcrumbs:
|
|
686
|
-
activePath:
|
|
687
|
-
setActivePath:
|
|
688
|
-
} =
|
|
689
|
-
|
|
868
|
+
setBreadcrumbs: L,
|
|
869
|
+
activePath: T,
|
|
870
|
+
setActivePath: g
|
|
871
|
+
} = O(), { closeMobile: M } = F(), { resolvedMode: B, style: j, colors: R } = Le(), q = p ?? T, U = w ?? P, h = (z) => {
|
|
872
|
+
g(z), w || L(J(z)), N == null || N(z), M();
|
|
690
873
|
};
|
|
691
|
-
return /* @__PURE__ */
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
874
|
+
return /* @__PURE__ */ u(
|
|
875
|
+
"div",
|
|
876
|
+
{
|
|
877
|
+
className: b("ral-layout admin-layout-root min-h-screen bg-admin-bg text-admin-text", B === "dark" && "dark", m),
|
|
878
|
+
"data-theme": B,
|
|
879
|
+
"data-style": j,
|
|
880
|
+
style: Ce({ colors: R }),
|
|
881
|
+
children: [
|
|
882
|
+
/* @__PURE__ */ a(
|
|
883
|
+
qe,
|
|
884
|
+
{
|
|
885
|
+
items: r,
|
|
886
|
+
appName: n,
|
|
887
|
+
appLogo: t,
|
|
888
|
+
activePath: q,
|
|
889
|
+
onNavigate: h,
|
|
890
|
+
LinkComponent: S
|
|
891
|
+
}
|
|
892
|
+
),
|
|
893
|
+
/* @__PURE__ */ u("div", { className: "flex min-h-screen w-full", children: [
|
|
894
|
+
/* @__PURE__ */ a(
|
|
895
|
+
Ke,
|
|
896
|
+
{
|
|
897
|
+
items: r,
|
|
898
|
+
appName: n,
|
|
899
|
+
appLogo: t,
|
|
900
|
+
activePath: q,
|
|
901
|
+
onNavigate: h,
|
|
902
|
+
LinkComponent: S
|
|
903
|
+
}
|
|
904
|
+
),
|
|
905
|
+
/* @__PURE__ */ u("div", { className: "flex min-h-screen min-w-0 flex-1 flex-col", children: [
|
|
906
|
+
/* @__PURE__ */ a(
|
|
907
|
+
Je,
|
|
908
|
+
{
|
|
909
|
+
user: o,
|
|
910
|
+
notifications: s,
|
|
911
|
+
onSearch: x,
|
|
912
|
+
searchPlaceholder: c,
|
|
913
|
+
showSearch: l,
|
|
914
|
+
breadcrumbs: U,
|
|
915
|
+
onMenuClick: k,
|
|
916
|
+
sidebarCollapsed: f,
|
|
917
|
+
onToggleSidebar: D
|
|
918
|
+
}
|
|
919
|
+
),
|
|
920
|
+
/* @__PURE__ */ a("main", { className: b("ral-content flex-1", y), children: e }),
|
|
921
|
+
d && /* @__PURE__ */ a(Oe, { children: i })
|
|
922
|
+
] })
|
|
923
|
+
] })
|
|
924
|
+
]
|
|
925
|
+
}
|
|
926
|
+
);
|
|
733
927
|
}
|
|
734
|
-
function
|
|
928
|
+
function Ye(e) {
|
|
735
929
|
const {
|
|
736
|
-
storageKey:
|
|
737
|
-
defaultCollapsed:
|
|
738
|
-
initialDarkMode:
|
|
739
|
-
permissions:
|
|
740
|
-
breadcrumbs:
|
|
930
|
+
storageKey: r = "rqdhw3n-admin-layout",
|
|
931
|
+
defaultCollapsed: n = !1,
|
|
932
|
+
initialDarkMode: t = !1,
|
|
933
|
+
permissions: o = {},
|
|
934
|
+
breadcrumbs: s = [],
|
|
741
935
|
activePath: i = "/",
|
|
742
936
|
enableRouter: d = !1,
|
|
743
|
-
children:
|
|
744
|
-
...
|
|
745
|
-
} = e,
|
|
746
|
-
() =>
|
|
747
|
-
[
|
|
937
|
+
children: l,
|
|
938
|
+
...c
|
|
939
|
+
} = e, x = I(
|
|
940
|
+
() => s.length ? s : J(i),
|
|
941
|
+
[s, i]
|
|
748
942
|
);
|
|
749
|
-
return /* @__PURE__ */
|
|
750
|
-
|
|
943
|
+
return /* @__PURE__ */ a(
|
|
944
|
+
Ae,
|
|
751
945
|
{
|
|
752
|
-
storageKey:
|
|
753
|
-
defaultCollapsed:
|
|
754
|
-
permissions:
|
|
755
|
-
initialBreadcrumbs:
|
|
946
|
+
storageKey: r,
|
|
947
|
+
defaultCollapsed: n,
|
|
948
|
+
permissions: o,
|
|
949
|
+
initialBreadcrumbs: x,
|
|
756
950
|
initialActivePath: i,
|
|
757
|
-
initialDarkMode:
|
|
758
|
-
|
|
951
|
+
initialDarkMode: t,
|
|
952
|
+
theme: e.theme,
|
|
953
|
+
onThemeModeChange: e.onThemeModeChange,
|
|
954
|
+
children: d ? /* @__PURE__ */ a(Pe, { children: /* @__PURE__ */ a(X, { ...c, enableRouter: d, children: l }) }) : /* @__PURE__ */ a(X, { ...c, enableRouter: d, children: l })
|
|
759
955
|
}
|
|
760
956
|
);
|
|
761
957
|
}
|
|
762
|
-
function
|
|
763
|
-
return /* @__PURE__ */
|
|
958
|
+
function _e({ to: e, className: r, children: n, onClick: t }) {
|
|
959
|
+
return /* @__PURE__ */ a(ue, { to: e, className: r, onClick: t, children: n });
|
|
764
960
|
}
|
|
765
|
-
function
|
|
766
|
-
return
|
|
961
|
+
function Ie() {
|
|
962
|
+
return O();
|
|
767
963
|
}
|
|
768
|
-
function
|
|
769
|
-
const { breadcrumbs: e, setBreadcrumbs:
|
|
770
|
-
(
|
|
771
|
-
[
|
|
964
|
+
function Ze() {
|
|
965
|
+
const { breadcrumbs: e, setBreadcrumbs: r } = O(), n = A(
|
|
966
|
+
(t) => r(t),
|
|
967
|
+
[r]
|
|
772
968
|
);
|
|
773
969
|
return {
|
|
774
970
|
items: e,
|
|
775
|
-
setBreadcrumbs:
|
|
971
|
+
setBreadcrumbs: n
|
|
776
972
|
};
|
|
777
973
|
}
|
|
778
974
|
export {
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
975
|
+
Ye as AdminLayout,
|
|
976
|
+
Pe as AdminLayoutRouterSync,
|
|
977
|
+
ze as Breadcrumbs,
|
|
978
|
+
Oe as Footer,
|
|
979
|
+
Ae as LayoutProvider,
|
|
980
|
+
qe as MobileSidebar,
|
|
981
|
+
Je as Navbar,
|
|
982
|
+
Re as NavbarSearch,
|
|
983
|
+
Ue as NotificationMenu,
|
|
984
|
+
_e as RouterLink,
|
|
985
|
+
Ke as Sidebar,
|
|
986
|
+
oe as SidebarGroup,
|
|
987
|
+
V as SidebarItem,
|
|
988
|
+
He as ThemeToggle,
|
|
989
|
+
Fe as UserMenu,
|
|
990
|
+
Xe as adminLayoutPresets,
|
|
991
|
+
b as cn,
|
|
992
|
+
Se as darkThemeColors,
|
|
993
|
+
K as filterSidebarByPermissions,
|
|
994
|
+
J as generateBreadcrumbsFromPath,
|
|
995
|
+
Te as hasPermission,
|
|
996
|
+
te as lightThemeColors,
|
|
997
|
+
Me as resolveTheme,
|
|
998
|
+
Ce as themeToCSSVariables,
|
|
999
|
+
Le as useAdminLayoutTheme,
|
|
1000
|
+
Ze as useBreadcrumbs,
|
|
1001
|
+
$e as useDarkMode,
|
|
1002
|
+
O as useLayoutContext,
|
|
1003
|
+
Ie as useLayoutState,
|
|
1004
|
+
F as useSidebar
|
|
803
1005
|
};
|
|
804
1006
|
//# sourceMappingURL=index.js.map
|