@noxickon/onyx 1.0.3 → 1.0.5
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/chunks/hooks-B6Ov6Z0O.js +6487 -0
- package/dist/chunks/hooks-BGvU5VHk.js +27 -0
- package/dist/chunks/{query-BhvXa-m6.js → query-CIsrxNi-.js} +1 -1
- package/dist/chunks/{query-iDn3qBGF.js → query-D2S9cFBP.js} +1 -1
- package/dist/chunks/ui-CZGrB58H.js +20 -0
- package/dist/chunks/ui-Dmzl3_Y3.js +20368 -0
- package/dist/contexts/contexts.cjs.js +2 -2
- package/dist/contexts/contexts.es.js +88 -86
- package/dist/hooks/hooks.cjs.js +1 -1
- package/dist/hooks/hooks.es.js +1 -1
- package/dist/layouts/layouts.cjs.js +1 -1
- package/dist/layouts/layouts.es.js +250 -249
- package/dist/onyx.cjs.js +1 -1
- package/dist/onyx.es.js +1 -1
- package/dist/pages/pages.cjs.js +2 -2
- package/dist/pages/pages.es.js +58 -56
- package/dist/routes/routes.cjs.js +1 -1
- package/dist/routes/routes.es.js +2 -2
- package/dist/utils/utils.cjs.js +1 -1
- package/dist/utils/utils.es.js +1 -1
- package/package.json +11 -5
- package/dist/chunks/hooks-DiKvsNs-.js +0 -48
- package/dist/chunks/hooks-bJFfbTks.js +0 -8624
- package/dist/chunks/ui-BgyYCO2P.js +0 -20648
- package/dist/chunks/ui-WTrU_DUw.js +0 -41
|
@@ -1,90 +1,91 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { _ as n, e as h, a0 as N, i as v, l as O, a1 as $, c as G, u as P, t as R } from "../chunks/ui-Dmzl3_Y3.js";
|
|
2
|
+
import { jsx as o, jsxs as m } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as M, useState as y, useMemo as W, useEffect as E, useContext as C, useCallback as w } from "react";
|
|
4
|
+
const ke = ({
|
|
4
5
|
brand: e,
|
|
5
6
|
children: a,
|
|
6
7
|
className: t,
|
|
7
|
-
hasSidebar:
|
|
8
|
-
navClassName:
|
|
8
|
+
hasSidebar: r = !1,
|
|
9
|
+
navClassName: s,
|
|
9
10
|
toggleSidebar: i,
|
|
10
11
|
...l
|
|
11
|
-
}) => /* @__PURE__ */
|
|
12
|
+
}) => /* @__PURE__ */ o(
|
|
12
13
|
"header",
|
|
13
14
|
{
|
|
14
|
-
className:
|
|
15
|
+
className: n("max-h-15 min-h-15 sticky top-0 z-10 bg-gray-100", t),
|
|
15
16
|
"data-ox-slot": "header",
|
|
16
17
|
...l,
|
|
17
|
-
children: /* @__PURE__ */
|
|
18
|
+
children: /* @__PURE__ */ m(
|
|
18
19
|
"nav",
|
|
19
20
|
{
|
|
20
|
-
className:
|
|
21
|
+
className: n(
|
|
21
22
|
"max-w-10xl mx-auto flex items-center justify-between px-4 py-2.5",
|
|
22
|
-
|
|
23
|
+
s
|
|
23
24
|
),
|
|
24
25
|
children: [
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
/* @__PURE__ */ m("div", { className: "flex items-center gap-[17px]", children: [
|
|
27
|
+
r ? /* @__PURE__ */ o(
|
|
28
|
+
h,
|
|
28
29
|
{
|
|
29
30
|
"aria-label": "Open menu",
|
|
30
31
|
"data-ox-slot": "header-toggle",
|
|
31
32
|
size: "md",
|
|
32
33
|
variant: "ghost",
|
|
33
34
|
onClick: i,
|
|
34
|
-
children: /* @__PURE__ */
|
|
35
|
+
children: /* @__PURE__ */ o(h.Icon, { path: "mdiMenu" })
|
|
35
36
|
}
|
|
36
37
|
) : null,
|
|
37
|
-
e ? /* @__PURE__ */
|
|
38
|
+
e ? /* @__PURE__ */ o("div", { children: e }) : null
|
|
38
39
|
] }),
|
|
39
40
|
a
|
|
40
41
|
]
|
|
41
42
|
}
|
|
42
43
|
)
|
|
43
44
|
}
|
|
44
|
-
),
|
|
45
|
+
), _ = "group ox-gray-inset-focus items-center rounded-lg text-sm transition-colors text-left col-span-2 grid grid-cols-subgrid", L = "size-10 justify-center", B = "h-10 w-full px-2", T = "bg-gray-300 text-gray-1200", Y = "h-15", z = M(void 0), F = ({
|
|
45
46
|
children: e,
|
|
46
47
|
className: a,
|
|
47
48
|
desktopCollapsed: t = !1,
|
|
48
|
-
hasHeader:
|
|
49
|
-
mobileCollapsed:
|
|
49
|
+
hasHeader: r = !1,
|
|
50
|
+
mobileCollapsed: s = !0,
|
|
50
51
|
onClose: i,
|
|
51
52
|
...l
|
|
52
53
|
}) => {
|
|
53
|
-
const [d,
|
|
54
|
-
() => ({ collapsed:
|
|
55
|
-
[
|
|
54
|
+
const [d, c] = y(window.innerWidth < N), x = d ? s : t, S = W(
|
|
55
|
+
() => ({ collapsed: x, isMobile: d }),
|
|
56
|
+
[x, d]
|
|
56
57
|
);
|
|
57
|
-
return
|
|
58
|
-
const
|
|
59
|
-
|
|
58
|
+
return E(() => {
|
|
59
|
+
const u = () => {
|
|
60
|
+
c(window.innerWidth < N);
|
|
60
61
|
};
|
|
61
|
-
return
|
|
62
|
-
window.removeEventListener("resize",
|
|
62
|
+
return u(), window.addEventListener("resize", u), () => {
|
|
63
|
+
window.removeEventListener("resize", u);
|
|
63
64
|
};
|
|
64
|
-
}, []), /* @__PURE__ */
|
|
65
|
+
}, []), /* @__PURE__ */ o(z.Provider, { value: S, children: d ? /* @__PURE__ */ o(v, { open: !x, onOpenChange: (u) => !u && i?.(), children: /* @__PURE__ */ o(v.Content, { closeOnOutsideClick: !!i, side: "left", ...l, children: /* @__PURE__ */ m(
|
|
65
66
|
"nav",
|
|
66
67
|
{
|
|
67
68
|
"aria-label": "Mobile navigation",
|
|
68
|
-
className:
|
|
69
|
+
className: n("flex h-screen w-full flex-col bg-gray-100", a),
|
|
69
70
|
"data-ox-slot": "sidebar",
|
|
70
71
|
role: "navigation",
|
|
71
72
|
...l,
|
|
72
73
|
children: [
|
|
73
|
-
i ? /* @__PURE__ */
|
|
74
|
+
i ? /* @__PURE__ */ o("div", { className: n("h-15 flex items-center gap-[17px] px-4", Y), children: /* @__PURE__ */ o(h, { "aria-label": "Close sidebar", size: "md", variant: "ghost", onClick: i, children: /* @__PURE__ */ o(h.Icon, { path: "mdiClose" }) }) }) : null,
|
|
74
75
|
e
|
|
75
76
|
]
|
|
76
77
|
}
|
|
77
|
-
) }) }) : /* @__PURE__ */
|
|
78
|
+
) }) }) : /* @__PURE__ */ o(
|
|
78
79
|
"nav",
|
|
79
80
|
{
|
|
80
81
|
"aria-label": "Desktop navigation",
|
|
81
|
-
className:
|
|
82
|
+
className: n(
|
|
82
83
|
"sticky box-content flex flex-col overflow-y-auto bg-gray-100",
|
|
83
84
|
{
|
|
84
|
-
"top-0 h-screen": !
|
|
85
|
-
"viewport-minus-header top-15":
|
|
86
|
-
'max-w-18 min-w-18 [&_[data-ox-slot="sidebar-label"]]:hidden':
|
|
87
|
-
"min-w-64 max-w-64": !
|
|
85
|
+
"top-0 h-screen": !r,
|
|
86
|
+
"viewport-minus-header top-15": r,
|
|
87
|
+
'max-w-18 min-w-18 [&_[data-ox-slot="sidebar-label"]]:hidden': x,
|
|
88
|
+
"min-w-64 max-w-64": !x
|
|
88
89
|
},
|
|
89
90
|
a
|
|
90
91
|
),
|
|
@@ -94,21 +95,21 @@ const Ne = ({
|
|
|
94
95
|
children: e
|
|
95
96
|
}
|
|
96
97
|
) });
|
|
97
|
-
},
|
|
98
|
-
const e =
|
|
98
|
+
}, p = () => {
|
|
99
|
+
const e = C(z);
|
|
99
100
|
if (!e)
|
|
100
101
|
throw new Error("useSidebar must be used within a SidebarProvider");
|
|
101
102
|
return e;
|
|
102
|
-
},
|
|
103
|
-
const { collapsed:
|
|
104
|
-
return /* @__PURE__ */
|
|
103
|
+
}, V = ({ children: e, className: a, ...t }) => {
|
|
104
|
+
const { collapsed: r, isMobile: s } = p();
|
|
105
|
+
return /* @__PURE__ */ o(
|
|
105
106
|
"div",
|
|
106
107
|
{
|
|
107
|
-
className:
|
|
108
|
+
className: n(
|
|
108
109
|
"grid flex-1 content-start gap-y-1 overflow-y-auto p-4",
|
|
109
110
|
{
|
|
110
|
-
"grid-cols-1 place-items-center":
|
|
111
|
-
"grid-cols-[auto_1fr]": !
|
|
111
|
+
"grid-cols-1 place-items-center": r && !s,
|
|
112
|
+
"grid-cols-[auto_1fr]": !r || s
|
|
112
113
|
},
|
|
113
114
|
'[&_[data-ox-slot="sidebar-link"]]:col-span-2 [&_[data-ox-slot="sidebar-link"]]:grid [&_[data-ox-slot="sidebar-link"]]:grid-cols-subgrid',
|
|
114
115
|
'[&_[data-ox-slot="sidebar-button"]]:col-span-2 [&_[data-ox-slot="sidebar-button"]]:grid [&_[data-ox-slot="sidebar-button"]]:grid-cols-subgrid',
|
|
@@ -121,146 +122,146 @@ const Ne = ({
|
|
|
121
122
|
children: e
|
|
122
123
|
}
|
|
123
124
|
);
|
|
124
|
-
},
|
|
125
|
+
}, K = ({
|
|
125
126
|
active: e = !1,
|
|
126
127
|
children: a,
|
|
127
128
|
className: t,
|
|
128
|
-
disabled:
|
|
129
|
-
...
|
|
129
|
+
disabled: r = !1,
|
|
130
|
+
...s
|
|
130
131
|
}) => {
|
|
131
|
-
const { collapsed: i } =
|
|
132
|
-
return /* @__PURE__ */
|
|
132
|
+
const { collapsed: i } = p();
|
|
133
|
+
return /* @__PURE__ */ o(
|
|
133
134
|
"button",
|
|
134
135
|
{
|
|
135
|
-
className:
|
|
136
|
+
className: n(
|
|
136
137
|
"enabled:text-gray-1000 enabled:hover:text-gray-1200 enabled:cursor-pointer enabled:hover:bg-gray-300",
|
|
137
|
-
|
|
138
|
+
_,
|
|
138
139
|
{
|
|
139
|
-
[
|
|
140
|
-
[
|
|
141
|
-
[
|
|
142
|
-
"disabled:ox-default-disabled":
|
|
140
|
+
[L]: i,
|
|
141
|
+
[B]: !i,
|
|
142
|
+
[T]: e && !r,
|
|
143
|
+
"disabled:ox-default-disabled": r
|
|
143
144
|
},
|
|
144
145
|
t
|
|
145
146
|
),
|
|
146
147
|
"data-ox-slot": "sidebar-button",
|
|
147
|
-
disabled:
|
|
148
|
+
disabled: r,
|
|
148
149
|
type: "button",
|
|
149
|
-
...
|
|
150
|
+
...s,
|
|
150
151
|
"data-ox-state": e ? "active" : "inactive",
|
|
151
152
|
children: a
|
|
152
153
|
}
|
|
153
154
|
);
|
|
154
|
-
},
|
|
155
|
+
}, q = ({ children: e, className: a, ...t }) => /* @__PURE__ */ o("div", { className: n("p-4", a), "data-ox-slot": "sidebar-footer", ...t, children: e }), J = ({
|
|
155
156
|
children: e,
|
|
156
157
|
className: a,
|
|
157
158
|
headline: t,
|
|
158
|
-
...
|
|
159
|
+
...r
|
|
159
160
|
}) => {
|
|
160
|
-
const { collapsed:
|
|
161
|
-
return /* @__PURE__ */
|
|
162
|
-
/* @__PURE__ */
|
|
161
|
+
const { collapsed: s, isMobile: i } = p();
|
|
162
|
+
return /* @__PURE__ */ m("div", { className: n("contents", a), "data-ox-slot": "sidebar-group", ...r, children: [
|
|
163
|
+
/* @__PURE__ */ o(
|
|
163
164
|
"h3",
|
|
164
165
|
{
|
|
165
|
-
className:
|
|
166
|
-
invisible:
|
|
166
|
+
className: n("text-gray-1000 col-span-full mb-2 mt-4 block cursor-default text-xs", {
|
|
167
|
+
invisible: s && !i
|
|
167
168
|
}),
|
|
168
169
|
children: t
|
|
169
170
|
}
|
|
170
171
|
),
|
|
171
172
|
e
|
|
172
173
|
] });
|
|
173
|
-
},
|
|
174
|
+
}, Q = ({ children: e, className: a, ...t }) => /* @__PURE__ */ o(
|
|
174
175
|
"div",
|
|
175
176
|
{
|
|
176
|
-
className:
|
|
177
|
+
className: n("h-15 flex items-center px-4", a),
|
|
177
178
|
"data-ox-slot": "sidebar-header",
|
|
178
179
|
...t,
|
|
179
180
|
children: e
|
|
180
181
|
}
|
|
181
|
-
),
|
|
182
|
-
const { collapsed:
|
|
183
|
-
return /* @__PURE__ */
|
|
184
|
-
|
|
182
|
+
), U = ({ className: e, size: a = 0.8, ...t }) => {
|
|
183
|
+
const { collapsed: r } = p();
|
|
184
|
+
return /* @__PURE__ */ o(
|
|
185
|
+
O,
|
|
185
186
|
{
|
|
186
|
-
className:
|
|
187
|
+
className: n("shrink-0 text-current", { "mr-2": !r }, e),
|
|
187
188
|
"data-ox-slot": "sidebar-icon",
|
|
188
189
|
size: a,
|
|
189
190
|
...t
|
|
190
191
|
}
|
|
191
192
|
);
|
|
192
|
-
},
|
|
193
|
+
}, X = ({ children: e, className: a, ...t }) => /* @__PURE__ */ o(
|
|
193
194
|
"span",
|
|
194
195
|
{
|
|
195
|
-
className:
|
|
196
|
+
className: n("overflow-hidden text-ellipsis", a),
|
|
196
197
|
"data-ox-slot": "sidebar-label",
|
|
197
198
|
...t,
|
|
198
199
|
children: e
|
|
199
200
|
}
|
|
200
|
-
),
|
|
201
|
+
), Z = ({
|
|
201
202
|
active: e = !1,
|
|
202
203
|
children: a,
|
|
203
204
|
className: t,
|
|
204
|
-
disabled:
|
|
205
|
-
href:
|
|
205
|
+
disabled: r = !1,
|
|
206
|
+
href: s,
|
|
206
207
|
...i
|
|
207
208
|
}) => {
|
|
208
|
-
const { collapsed: l } =
|
|
209
|
-
return /* @__PURE__ */
|
|
209
|
+
const { collapsed: l } = p();
|
|
210
|
+
return /* @__PURE__ */ o(
|
|
210
211
|
"a",
|
|
211
212
|
{
|
|
212
213
|
"aria-current": e ? "page" : void 0,
|
|
213
|
-
className:
|
|
214
|
-
|
|
214
|
+
className: n(
|
|
215
|
+
_,
|
|
215
216
|
{
|
|
216
|
-
[
|
|
217
|
-
[
|
|
218
|
-
[
|
|
219
|
-
"text-gray-1000 hover:text-gray-1200 cursor-pointer hover:bg-gray-300": !e && !
|
|
220
|
-
"ox-default-disabled":
|
|
217
|
+
[L]: l,
|
|
218
|
+
[B]: !l,
|
|
219
|
+
[T]: e && !r,
|
|
220
|
+
"text-gray-1000 hover:text-gray-1200 cursor-pointer hover:bg-gray-300": !e && !r,
|
|
221
|
+
"ox-default-disabled": r
|
|
221
222
|
},
|
|
222
223
|
t
|
|
223
224
|
),
|
|
224
225
|
"data-ox-slot": "sidebar-link",
|
|
225
|
-
href:
|
|
226
|
+
href: r ? void 0 : s,
|
|
226
227
|
role: "link",
|
|
227
|
-
onClick:
|
|
228
|
+
onClick: r ? (d) => d.preventDefault() : void 0,
|
|
228
229
|
...i,
|
|
229
230
|
"data-ox-state": e ? "active" : "inactive",
|
|
230
231
|
children: a
|
|
231
232
|
}
|
|
232
233
|
);
|
|
233
|
-
},
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
const
|
|
234
|
+
}, g = F;
|
|
235
|
+
g.Body = V;
|
|
236
|
+
g.Button = K;
|
|
237
|
+
g.Footer = q;
|
|
238
|
+
g.Group = J;
|
|
239
|
+
g.Header = Q;
|
|
240
|
+
g.Icon = U;
|
|
241
|
+
g.Label = X;
|
|
242
|
+
g.Link = Z;
|
|
243
|
+
const Ie = ({
|
|
243
244
|
children: e,
|
|
244
245
|
className: a,
|
|
245
246
|
color: t = "purple",
|
|
246
|
-
icon:
|
|
247
|
-
subtitle:
|
|
247
|
+
icon: r,
|
|
248
|
+
subtitle: s,
|
|
248
249
|
title: i,
|
|
249
250
|
...l
|
|
250
251
|
}) => {
|
|
251
|
-
const d = i ||
|
|
252
|
-
return /* @__PURE__ */
|
|
252
|
+
const d = i || s || r, c = $[t];
|
|
253
|
+
return /* @__PURE__ */ m(
|
|
253
254
|
"main",
|
|
254
255
|
{
|
|
255
256
|
"aria-labelledby": d ? "main-headline" : void 0,
|
|
256
|
-
className:
|
|
257
|
+
className: n("w-full p-6", a),
|
|
257
258
|
"data-ox-slot": "main-content",
|
|
258
259
|
...l,
|
|
259
260
|
children: [
|
|
260
|
-
d ? /* @__PURE__ */
|
|
261
|
-
|
|
262
|
-
/* @__PURE__ */
|
|
263
|
-
i ? /* @__PURE__ */
|
|
261
|
+
d ? /* @__PURE__ */ o("div", { className: "mb-8 border-b border-gray-400 pb-6", children: /* @__PURE__ */ m("div", { className: "flex items-center gap-4", children: [
|
|
262
|
+
r ? /* @__PURE__ */ o("div", { className: n("rounded-lg border p-3", c.border, c.background), children: /* @__PURE__ */ o(O, { className: c.text, path: r, size: 1.41 }) }) : null,
|
|
263
|
+
/* @__PURE__ */ m("div", { children: [
|
|
264
|
+
i ? /* @__PURE__ */ o(
|
|
264
265
|
"h2",
|
|
265
266
|
{
|
|
266
267
|
id: "main-headline",
|
|
@@ -269,21 +270,21 @@ const Me = ({
|
|
|
269
270
|
children: i
|
|
270
271
|
}
|
|
271
272
|
) : null,
|
|
272
|
-
|
|
273
|
+
s && /* @__PURE__ */ o("p", { className: "mt-1 text-sm", children: s })
|
|
273
274
|
] })
|
|
274
275
|
] }) }) : null,
|
|
275
276
|
e
|
|
276
277
|
]
|
|
277
278
|
}
|
|
278
279
|
);
|
|
279
|
-
},
|
|
280
|
-
const { isMobile:
|
|
281
|
-
return /* @__PURE__ */
|
|
280
|
+
}, Ee = ({ children: e, className: a, ...t }) => {
|
|
281
|
+
const { isMobile: r } = k();
|
|
282
|
+
return /* @__PURE__ */ o(
|
|
282
283
|
"div",
|
|
283
284
|
{
|
|
284
|
-
className:
|
|
285
|
+
className: n(
|
|
285
286
|
"max-w-10xl mx-auto grid min-h-screen bg-transparent",
|
|
286
|
-
|
|
287
|
+
r ? "grid-cols-1" : "grid-cols-[auto_1fr]",
|
|
287
288
|
a
|
|
288
289
|
),
|
|
289
290
|
"data-ox-slot": "app-layout",
|
|
@@ -291,84 +292,84 @@ const Me = ({
|
|
|
291
292
|
children: e
|
|
292
293
|
}
|
|
293
294
|
);
|
|
294
|
-
},
|
|
295
|
+
}, ee = ({ children: e, className: a, ...t }) => /* @__PURE__ */ o(
|
|
295
296
|
"main",
|
|
296
297
|
{
|
|
297
|
-
className:
|
|
298
|
+
className: n("flex flex-col overflow-y-auto", a),
|
|
298
299
|
"data-ox-slot": "main-content",
|
|
299
300
|
...t,
|
|
300
301
|
children: e
|
|
301
302
|
}
|
|
302
|
-
),
|
|
303
|
+
), te = ({ children: e, className: a, ...t }) => /* @__PURE__ */ o(
|
|
303
304
|
"div",
|
|
304
305
|
{
|
|
305
|
-
className:
|
|
306
|
+
className: n("flex-1 overflow-y-auto px-6 py-6", a),
|
|
306
307
|
"data-ox-slot": "main-content-body",
|
|
307
308
|
...t,
|
|
308
309
|
children: e
|
|
309
310
|
}
|
|
310
|
-
),
|
|
311
|
+
), ae = ({
|
|
311
312
|
children: e,
|
|
312
313
|
className: a,
|
|
313
314
|
...t
|
|
314
|
-
}) => /* @__PURE__ */
|
|
315
|
+
}) => /* @__PURE__ */ o(
|
|
315
316
|
"div",
|
|
316
317
|
{
|
|
317
|
-
className:
|
|
318
|
+
className: n("flex-shrink-0 border-b border-gray-400 bg-gray-100 px-6 py-4", a),
|
|
318
319
|
"data-ox-slot": "main-content-header",
|
|
319
320
|
...t,
|
|
320
321
|
children: e
|
|
321
322
|
}
|
|
322
|
-
),
|
|
323
|
-
Header:
|
|
324
|
-
Body:
|
|
325
|
-
}),
|
|
326
|
-
function
|
|
327
|
-
const e =
|
|
323
|
+
), _e = Object.assign(ee, {
|
|
324
|
+
Header: ae,
|
|
325
|
+
Body: te
|
|
326
|
+
}), A = M(void 0);
|
|
327
|
+
function k() {
|
|
328
|
+
const e = C(A);
|
|
328
329
|
if (!e)
|
|
329
330
|
throw new Error("useOxSidebar must be used within a SidebarProvider");
|
|
330
331
|
return e;
|
|
331
332
|
}
|
|
332
|
-
const
|
|
333
|
-
const { isMobile:
|
|
334
|
-
return
|
|
333
|
+
const oe = 256, re = ({ children: e, className: a, ...t }) => {
|
|
334
|
+
const { isMobile: r, mobileOpen: s, toggleSidebar: i } = k();
|
|
335
|
+
return r ? /* @__PURE__ */ o(v, { open: s, onOpenChange: i, children: /* @__PURE__ */ o(v.Content, { closeOnOutsideClick: !0, side: "left", children: /* @__PURE__ */ o(
|
|
335
336
|
"aside",
|
|
336
337
|
{
|
|
337
|
-
className:
|
|
338
|
+
className: n("bg-gray-150 flex h-full flex-col", a),
|
|
338
339
|
"data-ox-slot": "sidebar",
|
|
339
340
|
...t,
|
|
340
341
|
children: e
|
|
341
342
|
}
|
|
342
|
-
) }) }) : /* @__PURE__ */
|
|
343
|
+
) }) }) : /* @__PURE__ */ o(
|
|
343
344
|
"aside",
|
|
344
345
|
{
|
|
345
|
-
className:
|
|
346
|
+
className: n("bg-gray-150 sticky top-0 flex h-screen flex-col overflow-y-auto", a),
|
|
346
347
|
"data-ox-slot": "sidebar",
|
|
347
|
-
style: { width:
|
|
348
|
+
style: { width: oe },
|
|
348
349
|
...t,
|
|
349
350
|
children: e
|
|
350
351
|
}
|
|
351
352
|
);
|
|
352
|
-
},
|
|
353
|
+
}, ne = ({ children: e, className: a, ...t }) => /* @__PURE__ */ o(
|
|
353
354
|
"div",
|
|
354
355
|
{
|
|
355
|
-
className:
|
|
356
|
+
className: n("flex-1 overflow-y-auto p-2", a),
|
|
356
357
|
"data-ox-slot": "sidebar-content",
|
|
357
358
|
...t,
|
|
358
359
|
children: e
|
|
359
360
|
}
|
|
360
|
-
),
|
|
361
|
+
), se = ({ children: e, className: a, ...t }) => /* @__PURE__ */ o(
|
|
361
362
|
"div",
|
|
362
363
|
{
|
|
363
|
-
className:
|
|
364
|
+
className: n("flex shrink-0 flex-col p-2", a),
|
|
364
365
|
"data-ox-slot": "sidebar-footer",
|
|
365
366
|
...t,
|
|
366
367
|
children: e
|
|
367
368
|
}
|
|
368
|
-
),
|
|
369
|
+
), ie = ({ children: e, className: a, ...t }) => /* @__PURE__ */ o(
|
|
369
370
|
"div",
|
|
370
371
|
{
|
|
371
|
-
className:
|
|
372
|
+
className: n(
|
|
372
373
|
"flex flex-wrap items-center gap-2",
|
|
373
374
|
'[&_[data-ox-slot="sidebar-group-content"]]:w-full',
|
|
374
375
|
a
|
|
@@ -377,14 +378,14 @@ const ae = 256, se = ({ children: e, className: a, ...t }) => {
|
|
|
377
378
|
...t,
|
|
378
379
|
children: e
|
|
379
380
|
}
|
|
380
|
-
),
|
|
381
|
+
), le = ({
|
|
381
382
|
children: e,
|
|
382
383
|
className: a,
|
|
383
384
|
...t
|
|
384
|
-
}) => /* @__PURE__ */
|
|
385
|
+
}) => /* @__PURE__ */ o(
|
|
385
386
|
"button",
|
|
386
387
|
{
|
|
387
|
-
className:
|
|
388
|
+
className: n(
|
|
388
389
|
"mr-1.5 inline-flex size-6 shrink-0 items-center justify-center rounded-md",
|
|
389
390
|
"enabled:hover:text-gray-1200 enabled:cursor-pointer enabled:text-gray-900 enabled:hover:bg-gray-300",
|
|
390
391
|
"ox-gray-outset-focus disabled:ox-default-disabled",
|
|
@@ -395,46 +396,46 @@ const ae = 256, se = ({ children: e, className: a, ...t }) => {
|
|
|
395
396
|
...t,
|
|
396
397
|
children: e
|
|
397
398
|
}
|
|
398
|
-
),
|
|
399
|
+
), de = ({
|
|
399
400
|
children: e,
|
|
400
401
|
className: a,
|
|
401
402
|
...t
|
|
402
|
-
}) => /* @__PURE__ */
|
|
403
|
+
}) => /* @__PURE__ */ o("div", { className: n(a), "data-ox-slot": "sidebar-group-content", ...t, children: e }), ce = ({
|
|
403
404
|
children: e,
|
|
404
405
|
className: a,
|
|
405
406
|
...t
|
|
406
|
-
}) => /* @__PURE__ */
|
|
407
|
+
}) => /* @__PURE__ */ o(
|
|
407
408
|
"div",
|
|
408
409
|
{
|
|
409
|
-
className:
|
|
410
|
+
className: n("flex flex-1 items-center pl-2 text-xs font-medium text-gray-900", a),
|
|
410
411
|
"data-ox-slot": "sidebar-group-label",
|
|
411
412
|
...t,
|
|
412
413
|
children: e
|
|
413
414
|
}
|
|
414
|
-
),
|
|
415
|
+
), ue = ({ children: e, className: a, ...t }) => /* @__PURE__ */ o(
|
|
415
416
|
"div",
|
|
416
417
|
{
|
|
417
|
-
className:
|
|
418
|
+
className: n("flex shrink-0 flex-col p-2", a),
|
|
418
419
|
"data-ox-slot": "sidebar-header",
|
|
419
420
|
...t,
|
|
420
421
|
children: e
|
|
421
422
|
}
|
|
422
|
-
),
|
|
423
|
+
), be = ({ children: e, className: a, ...t }) => /* @__PURE__ */ o(
|
|
423
424
|
"ul",
|
|
424
425
|
{
|
|
425
|
-
className:
|
|
426
|
+
className: n("flex flex-col items-stretch gap-1", a),
|
|
426
427
|
"data-ox-slot": "sidebar-menu",
|
|
427
428
|
...t,
|
|
428
429
|
children: e
|
|
429
430
|
}
|
|
430
|
-
),
|
|
431
|
+
), xe = ({
|
|
431
432
|
children: e,
|
|
432
433
|
className: a,
|
|
433
434
|
...t
|
|
434
|
-
}) => /* @__PURE__ */
|
|
435
|
+
}) => /* @__PURE__ */ o(
|
|
435
436
|
"button",
|
|
436
437
|
{
|
|
437
|
-
className:
|
|
438
|
+
className: n(
|
|
438
439
|
"inline-flex size-9 shrink-0 items-center justify-center rounded-lg border border-transparent",
|
|
439
440
|
"enabled:text-gray-1200 enabled:cursor-pointer enabled:bg-transparent enabled:hover:bg-gray-300",
|
|
440
441
|
"ox-gray-outset-focus disabled:ox-default-disabled",
|
|
@@ -445,71 +446,71 @@ const ae = 256, se = ({ children: e, className: a, ...t }) => {
|
|
|
445
446
|
...t,
|
|
446
447
|
children: e
|
|
447
448
|
}
|
|
448
|
-
),
|
|
449
|
-
const e =
|
|
449
|
+
), me = ({ children: e, className: a }) => /* @__PURE__ */ o(G, { className: n("ml-auto", a), "data-ox-slot": "sidebar-menu-badge", size: "sm", children: e }), H = M(void 0), D = () => {
|
|
450
|
+
const e = C(H);
|
|
450
451
|
if (!e)
|
|
451
452
|
throw new Error("useMenuItemContext must be used within MenuItemProvider");
|
|
452
453
|
return e;
|
|
453
|
-
},
|
|
454
|
-
|
|
454
|
+
}, j = ({ className: e, path: a, placeholder: t }) => /* @__PURE__ */ o(
|
|
455
|
+
O,
|
|
455
456
|
{
|
|
456
|
-
className:
|
|
457
|
+
className: n("shrink-0", e),
|
|
457
458
|
"data-ox-slot": "sidebar-menu-icon",
|
|
458
459
|
path: a,
|
|
459
460
|
placeholder: t,
|
|
460
461
|
size: 0.8
|
|
461
462
|
}
|
|
462
|
-
),
|
|
463
|
+
), ge = ({
|
|
463
464
|
children: e,
|
|
464
465
|
className: a,
|
|
465
466
|
disabled: t = !1,
|
|
466
|
-
href:
|
|
467
|
-
onClick:
|
|
467
|
+
href: r,
|
|
468
|
+
onClick: s,
|
|
468
469
|
...i
|
|
469
470
|
}) => {
|
|
470
|
-
const { hasSub: l, isOpen: d, toggleOpen:
|
|
471
|
+
const { hasSub: l, isOpen: d, toggleOpen: c } = D(), x = n(
|
|
471
472
|
"flex h-9 flex-1 items-center gap-2 rounded-lg border border-transparent bg-transparent px-2 text-left text-sm",
|
|
472
473
|
"ox-gray-outset-focus",
|
|
473
474
|
a
|
|
474
475
|
);
|
|
475
|
-
if (
|
|
476
|
-
return /* @__PURE__ */
|
|
476
|
+
if (r)
|
|
477
|
+
return /* @__PURE__ */ o(
|
|
477
478
|
"a",
|
|
478
479
|
{
|
|
479
480
|
"aria-disabled": t ? "true" : void 0,
|
|
480
|
-
className:
|
|
481
|
+
className: n(x, {
|
|
481
482
|
"text-gray-1200 cursor-pointer hover:bg-gray-300": !t,
|
|
482
483
|
"ox-default-disabled": t
|
|
483
484
|
}),
|
|
484
485
|
"data-ox-slot": "sidebar-menu-button",
|
|
485
|
-
href: t ? void 0 :
|
|
486
|
-
onClick: t ? (
|
|
486
|
+
href: t ? void 0 : r,
|
|
487
|
+
onClick: t ? (u) => u.preventDefault() : void 0,
|
|
487
488
|
...i,
|
|
488
489
|
children: e
|
|
489
490
|
}
|
|
490
491
|
);
|
|
491
|
-
const
|
|
492
|
-
l &&
|
|
492
|
+
const S = (u) => {
|
|
493
|
+
l && c(), s && s(u);
|
|
493
494
|
};
|
|
494
|
-
return /* @__PURE__ */
|
|
495
|
+
return /* @__PURE__ */ m(
|
|
495
496
|
"button",
|
|
496
497
|
{
|
|
497
|
-
className:
|
|
498
|
-
|
|
498
|
+
className: n(
|
|
499
|
+
x,
|
|
499
500
|
"enabled:text-gray-1200 enabled:cursor-pointer enabled:hover:bg-gray-300",
|
|
500
501
|
"disabled:ox-default-disabled"
|
|
501
502
|
),
|
|
502
503
|
"data-ox-slot": "sidebar-menu-button",
|
|
503
504
|
disabled: t,
|
|
504
505
|
type: "button",
|
|
505
|
-
onClick:
|
|
506
|
+
onClick: S,
|
|
506
507
|
...i,
|
|
507
508
|
children: [
|
|
508
509
|
e,
|
|
509
|
-
l ? /* @__PURE__ */
|
|
510
|
-
|
|
510
|
+
l ? /* @__PURE__ */ o(
|
|
511
|
+
j,
|
|
511
512
|
{
|
|
512
|
-
className:
|
|
513
|
+
className: n("ml-auto transition-transform duration-200", { "rotate-180": d }),
|
|
513
514
|
path: "mdiChevronDown"
|
|
514
515
|
}
|
|
515
516
|
) : null
|
|
@@ -517,40 +518,40 @@ const ae = 256, se = ({ children: e, className: a, ...t }) => {
|
|
|
517
518
|
}
|
|
518
519
|
);
|
|
519
520
|
};
|
|
520
|
-
function
|
|
521
|
+
function pe({
|
|
521
522
|
children: e,
|
|
522
523
|
defaultOpen: a = !1,
|
|
523
524
|
hasSub: t = !1
|
|
524
525
|
}) {
|
|
525
|
-
const [
|
|
526
|
-
return /* @__PURE__ */
|
|
526
|
+
const [r, s] = y(a), i = () => s((l) => !l);
|
|
527
|
+
return /* @__PURE__ */ o(H.Provider, { value: { hasSub: t, isOpen: r, setIsOpen: s, toggleOpen: i }, children: e });
|
|
527
528
|
}
|
|
528
|
-
const
|
|
529
|
+
const fe = ({
|
|
529
530
|
children: e,
|
|
530
531
|
className: a,
|
|
531
532
|
defaultOpen: t = !1,
|
|
532
|
-
hasSub:
|
|
533
|
-
...
|
|
534
|
-
}) => /* @__PURE__ */
|
|
533
|
+
hasSub: r = !1,
|
|
534
|
+
...s
|
|
535
|
+
}) => /* @__PURE__ */ o(pe, { defaultOpen: t, hasSub: r, children: /* @__PURE__ */ o(
|
|
535
536
|
"li",
|
|
536
537
|
{
|
|
537
|
-
className:
|
|
538
|
+
className: n("group flex flex-wrap items-center gap-x-2", a),
|
|
538
539
|
"data-ox-slot": "sidebar-menu-item",
|
|
539
|
-
...
|
|
540
|
+
...s,
|
|
540
541
|
children: e
|
|
541
542
|
}
|
|
542
|
-
) }),
|
|
543
|
-
const { isOpen:
|
|
544
|
-
return /* @__PURE__ */
|
|
543
|
+
) }), he = ({ className: e }) => /* @__PURE__ */ o(P, { className: e, "data-ox-slot": "sidebar-menu-skeleton", fullWidth: !0, height: 36 }), ve = ({ children: e, className: a, ...t }) => {
|
|
544
|
+
const { isOpen: r } = D();
|
|
545
|
+
return /* @__PURE__ */ o(
|
|
545
546
|
"div",
|
|
546
547
|
{
|
|
547
548
|
className: "ox-sidebar-submenu w-content grid w-full",
|
|
548
549
|
"data-ox-slot": "sidebar-menu-sub-wrapper",
|
|
549
|
-
"data-ox-state":
|
|
550
|
-
children: /* @__PURE__ */
|
|
550
|
+
"data-ox-state": r ? "open" : "closed",
|
|
551
|
+
children: /* @__PURE__ */ o(
|
|
551
552
|
"ul",
|
|
552
553
|
{
|
|
553
|
-
className:
|
|
554
|
+
className: n(
|
|
554
555
|
"ml-4.5 flex flex-col gap-1 border-l border-gray-400 py-0.5 pl-2.5",
|
|
555
556
|
a
|
|
556
557
|
),
|
|
@@ -561,57 +562,57 @@ const pe = ({
|
|
|
561
562
|
)
|
|
562
563
|
}
|
|
563
564
|
);
|
|
564
|
-
},
|
|
565
|
+
}, ye = ({
|
|
565
566
|
children: e,
|
|
566
567
|
className: a,
|
|
567
568
|
href: t,
|
|
568
|
-
...
|
|
569
|
+
...r
|
|
569
570
|
}) => {
|
|
570
|
-
const
|
|
571
|
+
const s = n(
|
|
571
572
|
"text-gray-1200 flex h-8 flex-1 cursor-pointer items-center gap-2 rounded-lg border border-transparent bg-transparent px-2 text-left text-sm hover:bg-gray-300",
|
|
572
573
|
"ox-gray-outset-focus",
|
|
573
574
|
a
|
|
574
575
|
);
|
|
575
|
-
return t ? /* @__PURE__ */
|
|
576
|
+
return t ? /* @__PURE__ */ o(
|
|
576
577
|
"a",
|
|
577
578
|
{
|
|
578
|
-
className:
|
|
579
|
+
className: s,
|
|
579
580
|
"data-ox-slot": "sidebar-menu-sub-button",
|
|
580
581
|
href: t,
|
|
581
|
-
...
|
|
582
|
+
...r,
|
|
582
583
|
children: e
|
|
583
584
|
}
|
|
584
|
-
) : /* @__PURE__ */
|
|
585
|
+
) : /* @__PURE__ */ o(
|
|
585
586
|
"button",
|
|
586
587
|
{
|
|
587
|
-
className:
|
|
588
|
+
className: s,
|
|
588
589
|
"data-ox-slot": "sidebar-menu-sub-button",
|
|
589
590
|
type: "button",
|
|
590
|
-
...
|
|
591
|
+
...r,
|
|
591
592
|
children: e
|
|
592
593
|
}
|
|
593
594
|
);
|
|
594
|
-
},
|
|
595
|
+
}, Oe = ({
|
|
595
596
|
children: e,
|
|
596
597
|
className: a,
|
|
597
598
|
...t
|
|
598
|
-
}) => /* @__PURE__ */
|
|
599
|
+
}) => /* @__PURE__ */ o(
|
|
599
600
|
"li",
|
|
600
601
|
{
|
|
601
|
-
className:
|
|
602
|
+
className: n("flex items-center gap-2", a),
|
|
602
603
|
"data-ox-slot": "sidebar-menu-sub-item",
|
|
603
604
|
...t,
|
|
604
605
|
children: e
|
|
605
606
|
}
|
|
606
|
-
),
|
|
607
|
-
const { isMobile: t, toggleSidebar:
|
|
608
|
-
t ?
|
|
607
|
+
), Se = ({ className: e, ...a }) => /* @__PURE__ */ o(R, { className: e, "data-ox-slot": "sidebar-separator", ...a }), we = ({ className: e, onClick: a }) => {
|
|
608
|
+
const { isMobile: t, toggleSidebar: r } = k(), s = () => {
|
|
609
|
+
t ? r() : a && a();
|
|
609
610
|
}, i = t || a;
|
|
610
|
-
return /* @__PURE__ */
|
|
611
|
+
return /* @__PURE__ */ o(
|
|
611
612
|
"button",
|
|
612
613
|
{
|
|
613
614
|
"aria-label": "Toggle sidebar",
|
|
614
|
-
className:
|
|
615
|
+
className: n(
|
|
615
616
|
"inline-flex size-8 items-center justify-center rounded-lg",
|
|
616
617
|
"text-gray-1200 border border-transparent bg-transparent",
|
|
617
618
|
{
|
|
@@ -622,32 +623,32 @@ const pe = ({
|
|
|
622
623
|
"data-ox-slot": "sidebar-trigger",
|
|
623
624
|
disabled: !i,
|
|
624
625
|
type: "button",
|
|
625
|
-
onClick:
|
|
626
|
-
children: /* @__PURE__ */
|
|
626
|
+
onClick: s,
|
|
627
|
+
children: /* @__PURE__ */ o(O, { path: "mdiDockLeft", size: 0.8 })
|
|
627
628
|
}
|
|
628
629
|
);
|
|
629
630
|
};
|
|
630
|
-
function
|
|
631
|
-
const [a, t] =
|
|
632
|
-
|
|
633
|
-
const
|
|
634
|
-
|
|
631
|
+
function Le({ children: e }) {
|
|
632
|
+
const [a, t] = y(!1), [r, s] = y(!1);
|
|
633
|
+
E(() => {
|
|
634
|
+
const c = () => {
|
|
635
|
+
s(window.innerWidth < N);
|
|
635
636
|
};
|
|
636
|
-
return
|
|
637
|
+
return c(), window.addEventListener("resize", c), () => window.removeEventListener("resize", c);
|
|
637
638
|
}, []);
|
|
638
|
-
const i =
|
|
639
|
+
const i = w(() => {
|
|
639
640
|
t(!0);
|
|
640
|
-
}, []), l =
|
|
641
|
+
}, []), l = w(() => {
|
|
641
642
|
t(!1);
|
|
642
|
-
}, []), d =
|
|
643
|
-
t((
|
|
643
|
+
}, []), d = w(() => {
|
|
644
|
+
t((c) => !c);
|
|
644
645
|
}, []);
|
|
645
|
-
return /* @__PURE__ */
|
|
646
|
-
|
|
646
|
+
return /* @__PURE__ */ o(
|
|
647
|
+
A.Provider,
|
|
647
648
|
{
|
|
648
649
|
value: {
|
|
649
650
|
closeSidebar: l,
|
|
650
|
-
isMobile:
|
|
651
|
+
isMobile: r,
|
|
651
652
|
mobileOpen: a,
|
|
652
653
|
openSidebar: i,
|
|
653
654
|
toggleSidebar: d
|
|
@@ -656,33 +657,33 @@ function Ie({ children: e }) {
|
|
|
656
657
|
}
|
|
657
658
|
);
|
|
658
659
|
}
|
|
659
|
-
const
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
660
|
+
const f = re, b = be, I = ie;
|
|
661
|
+
f.Header = ue;
|
|
662
|
+
f.Content = ne;
|
|
663
|
+
f.Footer = se;
|
|
664
|
+
f.Separator = Se;
|
|
665
|
+
f.Trigger = we;
|
|
666
|
+
b.Item = fe;
|
|
667
|
+
b.Button = ge;
|
|
668
|
+
b.Icon = j;
|
|
669
|
+
b.Badge = me;
|
|
670
|
+
b.Action = xe;
|
|
671
|
+
b.Skeleton = he;
|
|
672
|
+
b.Sub = ve;
|
|
673
|
+
b.SubItem = Oe;
|
|
674
|
+
b.SubButton = ye;
|
|
675
|
+
I.Label = ce;
|
|
676
|
+
I.Action = le;
|
|
677
|
+
I.Content = de;
|
|
677
678
|
export {
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
679
|
+
Ee as OxAppLayout,
|
|
680
|
+
ke as OxLegacyHeader,
|
|
681
|
+
Ie as OxLegacyMainContent,
|
|
682
|
+
g as OxLegacySidebar,
|
|
683
|
+
_e as OxMainContent,
|
|
684
|
+
f as OxSidebar,
|
|
685
|
+
I as OxSidebarGroup,
|
|
686
|
+
b as OxSidebarMenu,
|
|
687
|
+
Le as OxSidebarProvider,
|
|
688
|
+
k as useOxSidebar
|
|
688
689
|
};
|