@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.
@@ -1,90 +1,91 @@
1
- import { _ as s, $ as r, e as f, a1 as j, i as h, l as y, a2 as D, c as $, u as G, t as P } from "../chunks/ui-BgyYCO2P.js";
2
- import { createContext as w, useState as v, useMemo as R, useEffect as k, useContext as N, useCallback as S } from "react";
3
- const Ne = ({
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: o = !1,
8
- navClassName: n,
8
+ hasSidebar: r = !1,
9
+ navClassName: s,
9
10
  toggleSidebar: i,
10
11
  ...l
11
- }) => /* @__PURE__ */ s.jsx(
12
+ }) => /* @__PURE__ */ o(
12
13
  "header",
13
14
  {
14
- className: r("max-h-15 min-h-15 sticky top-0 z-10 bg-gray-100", t),
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__ */ s.jsxs(
18
+ children: /* @__PURE__ */ m(
18
19
  "nav",
19
20
  {
20
- className: r(
21
+ className: n(
21
22
  "max-w-10xl mx-auto flex items-center justify-between px-4 py-2.5",
22
- n
23
+ s
23
24
  ),
24
25
  children: [
25
- /* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-[17px]", children: [
26
- o ? /* @__PURE__ */ s.jsx(
27
- f,
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__ */ s.jsx(f.Icon, { path: "mdiMenu" })
35
+ children: /* @__PURE__ */ o(h.Icon, { path: "mdiMenu" })
35
36
  }
36
37
  ) : null,
37
- e ? /* @__PURE__ */ s.jsx("div", { children: e }) : null
38
+ e ? /* @__PURE__ */ o("div", { children: e }) : null
38
39
  ] }),
39
40
  a
40
41
  ]
41
42
  }
42
43
  )
43
44
  }
44
- ), I = "group ox-gray-inset-focus items-center rounded-lg text-sm transition-colors text-left col-span-2 grid grid-cols-subgrid", E = "size-10 justify-center", _ = "h-10 w-full px-2", L = "bg-gray-300 text-gray-1200", W = "h-15", B = w(void 0), Y = ({
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: o = !1,
49
- mobileCollapsed: n = !0,
49
+ hasHeader: r = !1,
50
+ mobileCollapsed: s = !0,
50
51
  onClose: i,
51
52
  ...l
52
53
  }) => {
53
- const [d, x] = v(window.innerWidth < j), b = d ? n : t, O = R(
54
- () => ({ collapsed: b, isMobile: d }),
55
- [b, d]
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 k(() => {
58
- const c = () => {
59
- x(window.innerWidth < j);
58
+ return E(() => {
59
+ const u = () => {
60
+ c(window.innerWidth < N);
60
61
  };
61
- return c(), window.addEventListener("resize", c), () => {
62
- window.removeEventListener("resize", c);
62
+ return u(), window.addEventListener("resize", u), () => {
63
+ window.removeEventListener("resize", u);
63
64
  };
64
- }, []), /* @__PURE__ */ s.jsx(B.Provider, { value: O, children: d ? /* @__PURE__ */ s.jsx(h, { open: !b, onOpenChange: (c) => !c && i?.(), children: /* @__PURE__ */ s.jsx(h.Content, { closeOnOutsideClick: !!i, side: "left", ...l, children: /* @__PURE__ */ s.jsxs(
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: r("flex h-screen w-full flex-col bg-gray-100", a),
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__ */ s.jsx("div", { className: r("h-15 flex items-center gap-[17px] px-4", W), children: /* @__PURE__ */ s.jsx(f, { "aria-label": "Close sidebar", size: "md", variant: "ghost", onClick: i, children: /* @__PURE__ */ s.jsx(f.Icon, { path: "mdiClose" }) }) }) : null,
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__ */ s.jsx(
78
+ ) }) }) : /* @__PURE__ */ o(
78
79
  "nav",
79
80
  {
80
81
  "aria-label": "Desktop navigation",
81
- className: r(
82
+ className: n(
82
83
  "sticky box-content flex flex-col overflow-y-auto bg-gray-100",
83
84
  {
84
- "top-0 h-screen": !o,
85
- "viewport-minus-header top-15": o,
86
- 'max-w-18 min-w-18 [&_[data-ox-slot="sidebar-label"]]:hidden': b,
87
- "min-w-64 max-w-64": !b
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
- }, g = () => {
98
- const e = N(B);
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
- }, F = ({ children: e, className: a, ...t }) => {
103
- const { collapsed: o, isMobile: n } = g();
104
- return /* @__PURE__ */ s.jsx(
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: r(
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": o && !n,
111
- "grid-cols-[auto_1fr]": !o || n
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
- }, V = ({
125
+ }, K = ({
125
126
  active: e = !1,
126
127
  children: a,
127
128
  className: t,
128
- disabled: o = !1,
129
- ...n
129
+ disabled: r = !1,
130
+ ...s
130
131
  }) => {
131
- const { collapsed: i } = g();
132
- return /* @__PURE__ */ s.jsx(
132
+ const { collapsed: i } = p();
133
+ return /* @__PURE__ */ o(
133
134
  "button",
134
135
  {
135
- className: r(
136
+ className: n(
136
137
  "enabled:text-gray-1000 enabled:hover:text-gray-1200 enabled:cursor-pointer enabled:hover:bg-gray-300",
137
- I,
138
+ _,
138
139
  {
139
- [E]: i,
140
- [_]: !i,
141
- [L]: e && !o,
142
- "disabled:ox-default-disabled": o
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: o,
148
+ disabled: r,
148
149
  type: "button",
149
- ...n,
150
+ ...s,
150
151
  "data-ox-state": e ? "active" : "inactive",
151
152
  children: a
152
153
  }
153
154
  );
154
- }, K = ({ children: e, className: a, ...t }) => /* @__PURE__ */ s.jsx("div", { className: r("p-4", a), "data-ox-slot": "sidebar-footer", ...t, children: e }), q = ({
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
- ...o
159
+ ...r
159
160
  }) => {
160
- const { collapsed: n, isMobile: i } = g();
161
- return /* @__PURE__ */ s.jsxs("div", { className: r("contents", a), "data-ox-slot": "sidebar-group", ...o, children: [
162
- /* @__PURE__ */ s.jsx(
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: r("text-gray-1000 col-span-full mb-2 mt-4 block cursor-default text-xs", {
166
- invisible: n && !i
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
- }, J = ({ children: e, className: a, ...t }) => /* @__PURE__ */ s.jsx(
174
+ }, Q = ({ children: e, className: a, ...t }) => /* @__PURE__ */ o(
174
175
  "div",
175
176
  {
176
- className: r("h-15 flex items-center px-4", a),
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
- ), Q = ({ className: e, size: a = 0.8, ...t }) => {
182
- const { collapsed: o } = g();
183
- return /* @__PURE__ */ s.jsx(
184
- y,
182
+ ), U = ({ className: e, size: a = 0.8, ...t }) => {
183
+ const { collapsed: r } = p();
184
+ return /* @__PURE__ */ o(
185
+ O,
185
186
  {
186
- className: r("shrink-0 text-current", { "mr-2": !o }, e),
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
- }, U = ({ children: e, className: a, ...t }) => /* @__PURE__ */ s.jsx(
193
+ }, X = ({ children: e, className: a, ...t }) => /* @__PURE__ */ o(
193
194
  "span",
194
195
  {
195
- className: r("overflow-hidden text-ellipsis", a),
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
- ), X = ({
201
+ ), Z = ({
201
202
  active: e = !1,
202
203
  children: a,
203
204
  className: t,
204
- disabled: o = !1,
205
- href: n,
205
+ disabled: r = !1,
206
+ href: s,
206
207
  ...i
207
208
  }) => {
208
- const { collapsed: l } = g();
209
- return /* @__PURE__ */ s.jsx(
209
+ const { collapsed: l } = p();
210
+ return /* @__PURE__ */ o(
210
211
  "a",
211
212
  {
212
213
  "aria-current": e ? "page" : void 0,
213
- className: r(
214
- I,
214
+ className: n(
215
+ _,
215
216
  {
216
- [E]: l,
217
- [_]: !l,
218
- [L]: e && !o,
219
- "text-gray-1000 hover:text-gray-1200 cursor-pointer hover:bg-gray-300": !e && !o,
220
- "ox-default-disabled": o
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: o ? void 0 : n,
226
+ href: r ? void 0 : s,
226
227
  role: "link",
227
- onClick: o ? (d) => d.preventDefault() : void 0,
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
- }, m = Y;
234
- m.Body = F;
235
- m.Button = V;
236
- m.Footer = K;
237
- m.Group = q;
238
- m.Header = J;
239
- m.Icon = Q;
240
- m.Label = U;
241
- m.Link = X;
242
- const Me = ({
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: o,
247
- subtitle: n,
247
+ icon: r,
248
+ subtitle: s,
248
249
  title: i,
249
250
  ...l
250
251
  }) => {
251
- const d = i || n || o, x = D[t];
252
- return /* @__PURE__ */ s.jsxs(
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: r("w-full p-6", a),
257
+ className: n("w-full p-6", a),
257
258
  "data-ox-slot": "main-content",
258
259
  ...l,
259
260
  children: [
260
- d ? /* @__PURE__ */ s.jsx("div", { className: "mb-8 border-b border-gray-400 pb-6", children: /* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-4", children: [
261
- o ? /* @__PURE__ */ s.jsx("div", { className: r("rounded-lg border p-3", x.border, x.background), children: /* @__PURE__ */ s.jsx(y, { className: x.text, path: o, size: 1.41 }) }) : null,
262
- /* @__PURE__ */ s.jsxs("div", { children: [
263
- i ? /* @__PURE__ */ s.jsx(
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
- n && /* @__PURE__ */ s.jsx("p", { className: "mt-1 text-sm", children: n })
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
- }, Ce = ({ children: e, className: a, ...t }) => {
280
- const { isMobile: o } = M();
281
- return /* @__PURE__ */ s.jsx(
280
+ }, Ee = ({ children: e, className: a, ...t }) => {
281
+ const { isMobile: r } = k();
282
+ return /* @__PURE__ */ o(
282
283
  "div",
283
284
  {
284
- className: r(
285
+ className: n(
285
286
  "max-w-10xl mx-auto grid min-h-screen bg-transparent",
286
- o ? "grid-cols-1" : "grid-cols-[auto_1fr]",
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
- }, Z = ({ children: e, className: a, ...t }) => /* @__PURE__ */ s.jsx(
295
+ }, ee = ({ children: e, className: a, ...t }) => /* @__PURE__ */ o(
295
296
  "main",
296
297
  {
297
- className: r("flex flex-col overflow-y-auto", a),
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
- ), ee = ({ children: e, className: a, ...t }) => /* @__PURE__ */ s.jsx(
303
+ ), te = ({ children: e, className: a, ...t }) => /* @__PURE__ */ o(
303
304
  "div",
304
305
  {
305
- className: r("flex-1 overflow-y-auto px-6 py-6", a),
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
- ), te = ({
311
+ ), ae = ({
311
312
  children: e,
312
313
  className: a,
313
314
  ...t
314
- }) => /* @__PURE__ */ s.jsx(
315
+ }) => /* @__PURE__ */ o(
315
316
  "div",
316
317
  {
317
- className: r("flex-shrink-0 border-b border-gray-400 bg-gray-100 px-6 py-4", a),
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
- ), ke = Object.assign(Z, {
323
- Header: te,
324
- Body: ee
325
- }), T = w(void 0);
326
- function M() {
327
- const e = N(T);
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 ae = 256, se = ({ children: e, className: a, ...t }) => {
333
- const { isMobile: o, mobileOpen: n, toggleSidebar: i } = M();
334
- return o ? /* @__PURE__ */ s.jsx(h, { open: n, onOpenChange: i, children: /* @__PURE__ */ s.jsx(h.Content, { closeOnOutsideClick: !0, side: "left", children: /* @__PURE__ */ s.jsx(
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: r("bg-gray-150 flex h-full flex-col", a),
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__ */ s.jsx(
343
+ ) }) }) : /* @__PURE__ */ o(
343
344
  "aside",
344
345
  {
345
- className: r("bg-gray-150 sticky top-0 flex h-screen flex-col overflow-y-auto", a),
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: ae },
348
+ style: { width: oe },
348
349
  ...t,
349
350
  children: e
350
351
  }
351
352
  );
352
- }, oe = ({ children: e, className: a, ...t }) => /* @__PURE__ */ s.jsx(
353
+ }, ne = ({ children: e, className: a, ...t }) => /* @__PURE__ */ o(
353
354
  "div",
354
355
  {
355
- className: r("flex-1 overflow-y-auto p-2", a),
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
- ), re = ({ children: e, className: a, ...t }) => /* @__PURE__ */ s.jsx(
361
+ ), se = ({ children: e, className: a, ...t }) => /* @__PURE__ */ o(
361
362
  "div",
362
363
  {
363
- className: r("flex shrink-0 flex-col p-2", a),
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
- ), ne = ({ children: e, className: a, ...t }) => /* @__PURE__ */ s.jsx(
369
+ ), ie = ({ children: e, className: a, ...t }) => /* @__PURE__ */ o(
369
370
  "div",
370
371
  {
371
- className: r(
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
- ), ie = ({
381
+ ), le = ({
381
382
  children: e,
382
383
  className: a,
383
384
  ...t
384
- }) => /* @__PURE__ */ s.jsx(
385
+ }) => /* @__PURE__ */ o(
385
386
  "button",
386
387
  {
387
- className: r(
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
- ), le = ({
399
+ ), de = ({
399
400
  children: e,
400
401
  className: a,
401
402
  ...t
402
- }) => /* @__PURE__ */ s.jsx("div", { className: r(a), "data-ox-slot": "sidebar-group-content", ...t, children: e }), de = ({
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__ */ s.jsx(
407
+ }) => /* @__PURE__ */ o(
407
408
  "div",
408
409
  {
409
- className: r("flex flex-1 items-center pl-2 text-xs font-medium text-gray-900", a),
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
- ), xe = ({ children: e, className: a, ...t }) => /* @__PURE__ */ s.jsx(
415
+ ), ue = ({ children: e, className: a, ...t }) => /* @__PURE__ */ o(
415
416
  "div",
416
417
  {
417
- className: r("flex shrink-0 flex-col p-2", a),
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
- ), ce = ({ children: e, className: a, ...t }) => /* @__PURE__ */ s.jsx(
423
+ ), be = ({ children: e, className: a, ...t }) => /* @__PURE__ */ o(
423
424
  "ul",
424
425
  {
425
- className: r("flex flex-col items-stretch gap-1", a),
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
- ), ue = ({
431
+ ), xe = ({
431
432
  children: e,
432
433
  className: a,
433
434
  ...t
434
- }) => /* @__PURE__ */ s.jsx(
435
+ }) => /* @__PURE__ */ o(
435
436
  "button",
436
437
  {
437
- className: r(
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
- ), be = ({ children: e, className: a }) => /* @__PURE__ */ s.jsx($, { className: r("ml-auto", a), "data-ox-slot": "sidebar-menu-badge", size: "sm", children: e }), z = w(void 0), A = () => {
449
- const e = N(z);
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
- }, H = ({ className: e, path: a, placeholder: t }) => /* @__PURE__ */ s.jsx(
454
- y,
454
+ }, j = ({ className: e, path: a, placeholder: t }) => /* @__PURE__ */ o(
455
+ O,
455
456
  {
456
- className: r("shrink-0", e),
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
- ), me = ({
463
+ ), ge = ({
463
464
  children: e,
464
465
  className: a,
465
466
  disabled: t = !1,
466
- href: o,
467
- onClick: n,
467
+ href: r,
468
+ onClick: s,
468
469
  ...i
469
470
  }) => {
470
- const { hasSub: l, isOpen: d, toggleOpen: x } = A(), b = r(
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 (o)
476
- return /* @__PURE__ */ s.jsx(
476
+ if (r)
477
+ return /* @__PURE__ */ o(
477
478
  "a",
478
479
  {
479
480
  "aria-disabled": t ? "true" : void 0,
480
- className: r(b, {
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 : o,
486
- onClick: t ? (c) => c.preventDefault() : void 0,
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 O = (c) => {
492
- l && x(), n && n(c);
492
+ const S = (u) => {
493
+ l && c(), s && s(u);
493
494
  };
494
- return /* @__PURE__ */ s.jsxs(
495
+ return /* @__PURE__ */ m(
495
496
  "button",
496
497
  {
497
- className: r(
498
- b,
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: O,
506
+ onClick: S,
506
507
  ...i,
507
508
  children: [
508
509
  e,
509
- l ? /* @__PURE__ */ s.jsx(
510
- H,
510
+ l ? /* @__PURE__ */ o(
511
+ j,
511
512
  {
512
- className: r("ml-auto transition-transform duration-200", { "rotate-180": d }),
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 ge({
521
+ function pe({
521
522
  children: e,
522
523
  defaultOpen: a = !1,
523
524
  hasSub: t = !1
524
525
  }) {
525
- const [o, n] = v(a), i = () => n((l) => !l);
526
- return /* @__PURE__ */ s.jsx(z.Provider, { value: { hasSub: t, isOpen: o, setIsOpen: n, toggleOpen: i }, children: e });
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 pe = ({
529
+ const fe = ({
529
530
  children: e,
530
531
  className: a,
531
532
  defaultOpen: t = !1,
532
- hasSub: o = !1,
533
- ...n
534
- }) => /* @__PURE__ */ s.jsx(ge, { defaultOpen: t, hasSub: o, children: /* @__PURE__ */ s.jsx(
533
+ hasSub: r = !1,
534
+ ...s
535
+ }) => /* @__PURE__ */ o(pe, { defaultOpen: t, hasSub: r, children: /* @__PURE__ */ o(
535
536
  "li",
536
537
  {
537
- className: r("group flex flex-wrap items-center gap-x-2", a),
538
+ className: n("group flex flex-wrap items-center gap-x-2", a),
538
539
  "data-ox-slot": "sidebar-menu-item",
539
- ...n,
540
+ ...s,
540
541
  children: e
541
542
  }
542
- ) }), fe = ({ className: e }) => /* @__PURE__ */ s.jsx(G, { className: e, "data-ox-slot": "sidebar-menu-skeleton", fullWidth: !0, height: 36 }), he = ({ children: e, className: a, ...t }) => {
543
- const { isOpen: o } = A();
544
- return /* @__PURE__ */ s.jsx(
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": o ? "open" : "closed",
550
- children: /* @__PURE__ */ s.jsx(
550
+ "data-ox-state": r ? "open" : "closed",
551
+ children: /* @__PURE__ */ o(
551
552
  "ul",
552
553
  {
553
- className: r(
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
- }, ve = ({
565
+ }, ye = ({
565
566
  children: e,
566
567
  className: a,
567
568
  href: t,
568
- ...o
569
+ ...r
569
570
  }) => {
570
- const n = r(
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__ */ s.jsx(
576
+ return t ? /* @__PURE__ */ o(
576
577
  "a",
577
578
  {
578
- className: n,
579
+ className: s,
579
580
  "data-ox-slot": "sidebar-menu-sub-button",
580
581
  href: t,
581
- ...o,
582
+ ...r,
582
583
  children: e
583
584
  }
584
- ) : /* @__PURE__ */ s.jsx(
585
+ ) : /* @__PURE__ */ o(
585
586
  "button",
586
587
  {
587
- className: n,
588
+ className: s,
588
589
  "data-ox-slot": "sidebar-menu-sub-button",
589
590
  type: "button",
590
- ...o,
591
+ ...r,
591
592
  children: e
592
593
  }
593
594
  );
594
- }, ye = ({
595
+ }, Oe = ({
595
596
  children: e,
596
597
  className: a,
597
598
  ...t
598
- }) => /* @__PURE__ */ s.jsx(
599
+ }) => /* @__PURE__ */ o(
599
600
  "li",
600
601
  {
601
- className: r("flex items-center gap-2", a),
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
- ), Oe = ({ className: e, ...a }) => /* @__PURE__ */ s.jsx(P, { className: e, "data-ox-slot": "sidebar-separator", ...a }), Se = ({ className: e, onClick: a }) => {
607
- const { isMobile: t, toggleSidebar: o } = M(), n = () => {
608
- t ? o() : a && a();
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__ */ s.jsx(
611
+ return /* @__PURE__ */ o(
611
612
  "button",
612
613
  {
613
614
  "aria-label": "Toggle sidebar",
614
- className: r(
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: n,
626
- children: /* @__PURE__ */ s.jsx(y, { path: "mdiDockLeft", size: 0.8 })
626
+ onClick: s,
627
+ children: /* @__PURE__ */ o(O, { path: "mdiDockLeft", size: 0.8 })
627
628
  }
628
629
  );
629
630
  };
630
- function Ie({ children: e }) {
631
- const [a, t] = v(!1), [o, n] = v(!1);
632
- k(() => {
633
- const x = () => {
634
- n(window.innerWidth < j);
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 x(), window.addEventListener("resize", x), () => window.removeEventListener("resize", x);
637
+ return c(), window.addEventListener("resize", c), () => window.removeEventListener("resize", c);
637
638
  }, []);
638
- const i = S(() => {
639
+ const i = w(() => {
639
640
  t(!0);
640
- }, []), l = S(() => {
641
+ }, []), l = w(() => {
641
642
  t(!1);
642
- }, []), d = S(() => {
643
- t((x) => !x);
643
+ }, []), d = w(() => {
644
+ t((c) => !c);
644
645
  }, []);
645
- return /* @__PURE__ */ s.jsx(
646
- T.Provider,
646
+ return /* @__PURE__ */ o(
647
+ A.Provider,
647
648
  {
648
649
  value: {
649
650
  closeSidebar: l,
650
- isMobile: o,
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 p = se, u = ce, C = ne;
660
- p.Header = xe;
661
- p.Content = oe;
662
- p.Footer = re;
663
- p.Separator = Oe;
664
- p.Trigger = Se;
665
- u.Item = pe;
666
- u.Button = me;
667
- u.Icon = H;
668
- u.Badge = be;
669
- u.Action = ue;
670
- u.Skeleton = fe;
671
- u.Sub = he;
672
- u.SubItem = ye;
673
- u.SubButton = ve;
674
- C.Label = de;
675
- C.Action = ie;
676
- C.Content = le;
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
- Ce as OxAppLayout,
679
- Ne as OxLegacyHeader,
680
- Me as OxLegacyMainContent,
681
- m as OxLegacySidebar,
682
- ke as OxMainContent,
683
- p as OxSidebar,
684
- C as OxSidebarGroup,
685
- u as OxSidebarMenu,
686
- Ie as OxSidebarProvider,
687
- M as useOxSidebar
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
  };