responsive-system 1.6.1 → 1.7.1
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/components/layout/Sidebar.d.ts +4 -1
- package/dist/responsive-system.cjs +5 -4
- package/dist/responsive-system.cjs.map +1 -1
- package/dist/responsive-system.mjs +228 -179
- package/dist/responsive-system.mjs.map +1 -1
- package/package.json +1 -1
- package/scripts/postinstall.js +181 -113
- package/src/App.tsx +6 -20
- package/src/components/LayoutSwitcher.tsx +21 -13
- package/src/components/layout/Footer.tsx +3 -3
- package/src/components/layout/Navigation.tsx +10 -6
- package/src/components/layout/Sidebar.tsx +53 -26
- package/src/layouts/DashboardLayout.tsx +6 -11
- package/src/layouts/DefaultLayout.tsx +3 -8
- package/src/layouts/MinimalLayout.tsx +1 -1
- package/src/layouts/SidebarLayout.tsx +3 -6
- package/src/pages/ExamplePage.tsx +82 -0
- package/src/pages/ResponsiveTestPage.tsx +0 -400
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as t, Fragment as
|
|
2
|
-
import { useState as C, useCallback as d, useMemo as
|
|
3
|
-
const
|
|
1
|
+
import { jsx as t, Fragment as O, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { useState as C, useCallback as d, useMemo as D, useEffect as ie, createContext as P, useContext as j } from "react";
|
|
3
|
+
const le = ({
|
|
4
4
|
children: e,
|
|
5
5
|
debug: s = !1
|
|
6
|
-
}) => /* @__PURE__ */ t(
|
|
6
|
+
}) => /* @__PURE__ */ t(O, { children: e }), u = {
|
|
7
7
|
xs: 475,
|
|
8
8
|
sm: 640,
|
|
9
9
|
md: 768,
|
|
@@ -13,105 +13,105 @@ const oe = ({
|
|
|
13
13
|
"3xl": 1920,
|
|
14
14
|
"4xl": 2560,
|
|
15
15
|
"5xl": 3840
|
|
16
|
-
},
|
|
17
|
-
function
|
|
18
|
-
let
|
|
19
|
-
return (...
|
|
20
|
-
|
|
16
|
+
}, ce = (e) => e >= u["5xl"] ? "5xl" : e >= u["4xl"] ? "4xl" : e >= u["3xl"] ? "3xl" : e >= u["2xl"] ? "2xl" : e >= u.xl ? "xl" : e >= u.lg ? "lg" : e >= u.md ? "md" : e >= u.sm ? "sm" : "xs", p = (e) => ["xs", "sm", "md", "lg", "xl", "2xl", "3xl", "4xl", "5xl"].indexOf(e), Ce = (e) => u[e];
|
|
17
|
+
function de(e, s) {
|
|
18
|
+
let a = null;
|
|
19
|
+
return (...i) => {
|
|
20
|
+
a && clearTimeout(a), a = setTimeout(() => e(...i), s);
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function ue(e, s) {
|
|
24
24
|
return e >= s ? "landscape" : "portrait";
|
|
25
25
|
}
|
|
26
|
-
const
|
|
26
|
+
const me = () => {
|
|
27
27
|
const [e, s] = C({
|
|
28
28
|
width: typeof window < "u" ? window.innerWidth : 1024,
|
|
29
29
|
height: typeof window < "u" ? window.innerHeight : 768
|
|
30
|
-
}),
|
|
30
|
+
}), a = d(() => {
|
|
31
31
|
s({
|
|
32
32
|
width: window.innerWidth,
|
|
33
33
|
height: window.innerHeight
|
|
34
34
|
});
|
|
35
|
-
}, []),
|
|
36
|
-
() =>
|
|
37
|
-
[
|
|
35
|
+
}, []), i = D(
|
|
36
|
+
() => de(a, 100),
|
|
37
|
+
[a]
|
|
38
38
|
);
|
|
39
39
|
ie(() => {
|
|
40
40
|
if (!(typeof window > "u"))
|
|
41
|
-
return window.addEventListener("resize",
|
|
42
|
-
window.removeEventListener("resize",
|
|
41
|
+
return window.addEventListener("resize", i), () => {
|
|
42
|
+
window.removeEventListener("resize", i);
|
|
43
43
|
};
|
|
44
|
-
}, [
|
|
45
|
-
const { width: r, height:
|
|
46
|
-
const
|
|
47
|
-
return
|
|
48
|
-
}, [n]),
|
|
44
|
+
}, [i]);
|
|
45
|
+
const { width: r, height: o } = e, n = D(() => ce(r), [r]), x = D(() => ue(r, o), [r, o]), m = n === "xs", w = n === "sm", g = n === "md", h = n === "lg", S = n === "xl", M = n === "2xl", L = n === "3xl", v = n === "4xl", f = n === "5xl", W = m || w, I = g, X = h || S || M || L || v || f, Y = m || w || g, _ = h || S || M || L || v || f, K = L || v || f, V = v || f, q = f, G = x === "portrait", J = x === "landscape", Q = d((c) => p(n) >= p(c), [n]), Z = d((c) => p(n) <= p(c), [n]), ee = d((c, y) => {
|
|
46
|
+
const A = p(n);
|
|
47
|
+
return A >= p(c) && A <= p(y);
|
|
48
|
+
}, [n]), te = d((c) => r >= c, [r]), ne = d((c) => r <= c, [r]), se = d((c, y) => r >= c && r <= y, [r]), re = d((c) => o >= c, [o]), ae = d((c) => o <= c, [o]), oe = d((c, y) => o >= c && o <= y, [o]);
|
|
49
49
|
return {
|
|
50
50
|
// Estado básico
|
|
51
51
|
breakpoint: n,
|
|
52
52
|
width: r,
|
|
53
|
-
height:
|
|
53
|
+
height: o,
|
|
54
54
|
orientation: x,
|
|
55
55
|
// Helpers booleanos específicos
|
|
56
56
|
isXs: m,
|
|
57
57
|
isSm: w,
|
|
58
|
-
isMd:
|
|
59
|
-
isLg:
|
|
58
|
+
isMd: g,
|
|
59
|
+
isLg: h,
|
|
60
60
|
isXl: S,
|
|
61
|
-
is2Xl:
|
|
61
|
+
is2Xl: M,
|
|
62
62
|
is3Xl: L,
|
|
63
|
-
is4Xl:
|
|
64
|
-
is5Xl:
|
|
63
|
+
is4Xl: v,
|
|
64
|
+
is5Xl: f,
|
|
65
65
|
// Helpers booleanos agrupados
|
|
66
|
-
isMobile:
|
|
67
|
-
isTablet:
|
|
68
|
-
isDesktop:
|
|
69
|
-
isSmall:
|
|
66
|
+
isMobile: W,
|
|
67
|
+
isTablet: I,
|
|
68
|
+
isDesktop: X,
|
|
69
|
+
isSmall: Y,
|
|
70
70
|
isLarge: _,
|
|
71
|
-
isUltraWide:
|
|
72
|
-
is4K:
|
|
73
|
-
is5K:
|
|
71
|
+
isUltraWide: K,
|
|
72
|
+
is4K: V,
|
|
73
|
+
is5K: q,
|
|
74
74
|
// Helpers de orientación
|
|
75
|
-
isPortrait:
|
|
76
|
-
isLandscape:
|
|
75
|
+
isPortrait: G,
|
|
76
|
+
isLandscape: J,
|
|
77
77
|
// Funciones de comparación
|
|
78
|
-
isBreakpointUp:
|
|
79
|
-
isBreakpointDown:
|
|
80
|
-
isBreakpointBetween:
|
|
81
|
-
isWidthUp:
|
|
82
|
-
isWidthDown:
|
|
83
|
-
isWidthBetween:
|
|
84
|
-
isHeightUp:
|
|
85
|
-
isHeightDown:
|
|
86
|
-
isHeightBetween:
|
|
78
|
+
isBreakpointUp: Q,
|
|
79
|
+
isBreakpointDown: Z,
|
|
80
|
+
isBreakpointBetween: ee,
|
|
81
|
+
isWidthUp: te,
|
|
82
|
+
isWidthDown: ne,
|
|
83
|
+
isWidthBetween: se,
|
|
84
|
+
isHeightUp: re,
|
|
85
|
+
isHeightDown: ae,
|
|
86
|
+
isHeightBetween: oe,
|
|
87
87
|
// Debug
|
|
88
88
|
debug: !1
|
|
89
89
|
};
|
|
90
|
-
},
|
|
91
|
-
const e =
|
|
90
|
+
}, U = P(void 0), pe = () => {
|
|
91
|
+
const e = j(U);
|
|
92
92
|
if (!e)
|
|
93
93
|
throw new Error("useResponsiveLayoutContext must be used within a ResponsiveLayoutProvider");
|
|
94
94
|
return e;
|
|
95
|
-
},
|
|
96
|
-
const [s,
|
|
97
|
-
return /* @__PURE__ */ t(
|
|
95
|
+
}, B = P(void 0), T = ({ children: e }) => {
|
|
96
|
+
const [s, a] = C(!1);
|
|
97
|
+
return /* @__PURE__ */ t(B.Provider, { value: { sidebarOpen: s, setSidebarOpen: a }, children: e });
|
|
98
98
|
}, $ = () => {
|
|
99
|
-
const e =
|
|
99
|
+
const e = j(B);
|
|
100
100
|
if (!e)
|
|
101
101
|
throw new Error("useSidebar must be used within a SidebarProvider");
|
|
102
102
|
return e;
|
|
103
|
-
},
|
|
103
|
+
}, F = P({
|
|
104
104
|
currentPage: "test",
|
|
105
105
|
setCurrentPage: () => {
|
|
106
106
|
}
|
|
107
|
-
}), be = () =>
|
|
107
|
+
}), be = () => j(F), Se = ({
|
|
108
108
|
children: e,
|
|
109
109
|
defaultPage: s = "test"
|
|
110
110
|
}) => {
|
|
111
|
-
const [
|
|
112
|
-
return /* @__PURE__ */ t(
|
|
111
|
+
const [a, i] = C(s);
|
|
112
|
+
return /* @__PURE__ */ t(F.Provider, { value: { currentPage: a, setCurrentPage: i }, children: e });
|
|
113
113
|
}, N = () => {
|
|
114
|
-
const e =
|
|
114
|
+
const e = pe();
|
|
115
115
|
return {
|
|
116
116
|
// Todo el sistema responsivo original
|
|
117
117
|
...e.responsive,
|
|
@@ -132,10 +132,10 @@ const ue = () => {
|
|
|
132
132
|
grid: {
|
|
133
133
|
auto: (s = "md") => `grid-cols-auto-${s}`,
|
|
134
134
|
responsive: (s) => {
|
|
135
|
-
const
|
|
136
|
-
return Object.entries(s).forEach(([
|
|
137
|
-
|
|
138
|
-
}),
|
|
135
|
+
const a = [];
|
|
136
|
+
return Object.entries(s).forEach(([i, r]) => {
|
|
137
|
+
i === "base" ? a.push(`grid-cols-${r}`) : a.push(`${i}:grid-cols-${r}`);
|
|
138
|
+
}), a.join(" ");
|
|
139
139
|
},
|
|
140
140
|
fixed: (s) => `grid-cols-${s}`
|
|
141
141
|
},
|
|
@@ -166,7 +166,7 @@ const ue = () => {
|
|
|
166
166
|
// Spacing helpers
|
|
167
167
|
spacing: e.spacing
|
|
168
168
|
};
|
|
169
|
-
},
|
|
169
|
+
}, b = {
|
|
170
170
|
default: {
|
|
171
171
|
name: "Default",
|
|
172
172
|
description: "Navbar arriba, body central, footer abajo",
|
|
@@ -211,23 +211,23 @@ const ue = () => {
|
|
|
211
211
|
desktop: "p-6"
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
}, k = "default",
|
|
214
|
+
}, k = "default", Me = Object.keys(b), fe = ({
|
|
215
215
|
children: e,
|
|
216
216
|
defaultLayout: s,
|
|
217
|
-
useResponsiveHook:
|
|
217
|
+
useResponsiveHook: a
|
|
218
218
|
}) => {
|
|
219
|
-
const
|
|
220
|
-
responsive:
|
|
219
|
+
const i = me(), o = a?.() || i, [n, x] = C(() => s && typeof s == "string" && b[s] ? s : k), m = b[n] || b[k], g = {
|
|
220
|
+
responsive: o,
|
|
221
221
|
layout: {
|
|
222
222
|
current: n,
|
|
223
223
|
config: m,
|
|
224
224
|
setLayout: x
|
|
225
225
|
},
|
|
226
226
|
layoutUtils: {
|
|
227
|
-
getContainerClass: () =>
|
|
227
|
+
getContainerClass: () => o.isMobile ? m.responsive.mobile : o.isTablet ? m.responsive.tablet : m.responsive.desktop,
|
|
228
228
|
getMainClass: () => {
|
|
229
|
-
const
|
|
230
|
-
return n === "sidebar" || n === "dashboard" ? `${
|
|
229
|
+
const h = "min-h-screen bg-black";
|
|
230
|
+
return n === "sidebar" || n === "dashboard" ? `${h} flex` : h;
|
|
231
231
|
},
|
|
232
232
|
hasSidebar: () => n === "sidebar" || n === "dashboard",
|
|
233
233
|
hasHeader: () => n === "dashboard",
|
|
@@ -235,31 +235,31 @@ const ue = () => {
|
|
|
235
235
|
hasNavigation: () => n === "default"
|
|
236
236
|
}
|
|
237
237
|
};
|
|
238
|
-
return /* @__PURE__ */ t(
|
|
239
|
-
},
|
|
238
|
+
return /* @__PURE__ */ t(U.Provider, { value: g, children: e });
|
|
239
|
+
}, De = ({
|
|
240
240
|
children: e,
|
|
241
241
|
defaultLayout: s = k,
|
|
242
|
-
useResponsiveHook:
|
|
242
|
+
useResponsiveHook: a
|
|
243
243
|
}) => {
|
|
244
|
-
const
|
|
245
|
-
return /* @__PURE__ */ t(
|
|
246
|
-
|
|
244
|
+
const i = s && typeof s == "string" && b[s] ? s : k;
|
|
245
|
+
return /* @__PURE__ */ t(le, { children: /* @__PURE__ */ t(
|
|
246
|
+
fe,
|
|
247
247
|
{
|
|
248
|
-
defaultLayout:
|
|
249
|
-
useResponsiveHook:
|
|
248
|
+
defaultLayout: i,
|
|
249
|
+
useResponsiveHook: a,
|
|
250
250
|
children: e
|
|
251
251
|
}
|
|
252
252
|
) });
|
|
253
253
|
}, Oe = ({ children: e, layout: s }) => {
|
|
254
|
-
const { layout:
|
|
255
|
-
default:
|
|
256
|
-
sidebar:
|
|
257
|
-
dashboard:
|
|
254
|
+
const { layout: a } = N(), i = {
|
|
255
|
+
default: R,
|
|
256
|
+
sidebar: ge,
|
|
257
|
+
dashboard: ye,
|
|
258
258
|
minimal: Ne
|
|
259
|
-
}, r = s ||
|
|
259
|
+
}, r = s || a.current || "default", o = i[r] ? r : "default", n = i[o] || R;
|
|
260
260
|
return /* @__PURE__ */ t(n, { children: e });
|
|
261
261
|
}, Pe = () => {
|
|
262
|
-
const { isMobile: e } = N(), { currentPage: s, setCurrentPage:
|
|
262
|
+
const { isMobile: e } = N(), { currentPage: s, setCurrentPage: a } = be(), { sidebarOpen: i, setSidebarOpen: r } = $(), o = [
|
|
263
263
|
{ id: "test", label: "Suite de Test" },
|
|
264
264
|
{ id: "demo", label: "Demo" }
|
|
265
265
|
];
|
|
@@ -280,26 +280,26 @@ const ue = () => {
|
|
|
280
280
|
] }),
|
|
281
281
|
/* @__PURE__ */ t("div", { className: "px-2 py-0.5 text-cyan-400 font-mono bg-black/50 border border-cyan-500/30 rounded text-xs font-bold tracking-widest", children: "DASHBOARD" })
|
|
282
282
|
] }),
|
|
283
|
-
/* @__PURE__ */ t("div", { className: "flex items-center space-x-2", children: !e &&
|
|
283
|
+
/* @__PURE__ */ t("div", { className: "flex items-center space-x-2", children: !e && o.map((n) => /* @__PURE__ */ t(
|
|
284
284
|
"button",
|
|
285
285
|
{
|
|
286
|
-
onClick: () =>
|
|
286
|
+
onClick: () => a(n.id),
|
|
287
287
|
className: `px-3 py-1.5 rounded-lg transition-all font-bold text-xs tracking-wide border ${s === n.id ? "bg-cyan-500/20 text-cyan-400 border-cyan-500/50" : "bg-black/50 text-gray-400 hover:text-gray-300 border-gray-700 hover:border-gray-600"}`,
|
|
288
288
|
children: n.label
|
|
289
289
|
},
|
|
290
290
|
n.id
|
|
291
291
|
)) })
|
|
292
292
|
] }) }) }) }),
|
|
293
|
-
e &&
|
|
293
|
+
e && i && /* @__PURE__ */ t("div", { className: "fixed inset-0 z-40 bg-black/50", onClick: () => r(!1), children: /* @__PURE__ */ t("div", { className: "fixed top-0 left-0 w-64 h-full bg-gradient-to-b from-gray-900 to-black border-r border-cyan-500/20", children: /* @__PURE__ */ l("div", { className: "p-6 flex flex-col h-full pt-20", children: [
|
|
294
294
|
/* @__PURE__ */ l("div", { className: "flex items-center space-x-3 mb-8", children: [
|
|
295
295
|
/* @__PURE__ */ t("div", { className: "w-8 h-8 bg-cyan-500 rounded-lg flex items-center justify-center", children: /* @__PURE__ */ t("span", { className: "text-white font-bold text-sm", children: "RS" }) }),
|
|
296
296
|
/* @__PURE__ */ t("span", { className: "text-white font-bold text-lg", children: "Sistema Responsivo" })
|
|
297
297
|
] }),
|
|
298
|
-
/* @__PURE__ */ t("nav", { className: "space-y-2", children:
|
|
298
|
+
/* @__PURE__ */ t("nav", { className: "space-y-2", children: o.map((n) => /* @__PURE__ */ t(
|
|
299
299
|
"button",
|
|
300
300
|
{
|
|
301
301
|
onClick: () => {
|
|
302
|
-
|
|
302
|
+
a(n.id), r(!1);
|
|
303
303
|
},
|
|
304
304
|
className: `w-full flex items-center px-4 py-3 rounded-lg transition-all group text-left ${s === n.id ? "bg-cyan-500/20 text-cyan-400 border border-cyan-500/50" : "text-gray-300 hover:text-cyan-400 hover:bg-cyan-500/10"}`,
|
|
305
305
|
children: /* @__PURE__ */ t("span", { className: "font-medium", children: n.label })
|
|
@@ -308,141 +308,190 @@ const ue = () => {
|
|
|
308
308
|
)) })
|
|
309
309
|
] }) }) })
|
|
310
310
|
] });
|
|
311
|
-
},
|
|
312
|
-
const { isMobile:
|
|
313
|
-
{ id: "home", label: "
|
|
314
|
-
{ id: "about", label: "
|
|
315
|
-
{ id: "contact", label: "
|
|
311
|
+
}, H = ({ showLogo: e = !0 }) => {
|
|
312
|
+
const { isMobile: s, isTablet: a } = N(), { sidebarOpen: i, setSidebarOpen: r } = $(), o = [
|
|
313
|
+
{ id: "home", label: "Home" },
|
|
314
|
+
{ id: "about", label: "About" },
|
|
315
|
+
{ id: "contact", label: "Contact" }
|
|
316
316
|
];
|
|
317
|
-
return /* @__PURE__ */ l(
|
|
318
|
-
|
|
317
|
+
return /* @__PURE__ */ l(O, { children: [
|
|
318
|
+
s && /* @__PURE__ */ t(
|
|
319
319
|
"button",
|
|
320
320
|
{
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
321
|
+
type: "button",
|
|
322
|
+
onClick: () => r(!0),
|
|
323
|
+
"aria-label": "Open sidebar",
|
|
324
|
+
className: "fixed top-4 left-4 z-50 p-2 rounded border transition-opacity hover:opacity-75 focus:outline-none focus:ring-2 focus:ring-offset-2",
|
|
325
|
+
children: /* @__PURE__ */ t("svg", { className: "w-6 h-6", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 6h16M4 12h16M4 18h16" }) })
|
|
324
326
|
}
|
|
325
327
|
),
|
|
326
|
-
/* @__PURE__ */ t(
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
328
|
+
/* @__PURE__ */ t(
|
|
329
|
+
"aside",
|
|
330
|
+
{
|
|
331
|
+
className: `border-r h-full ${s ? "hidden" : "w-64 flex-shrink-0"} ${a ? "w-56" : "w-64"}`,
|
|
332
|
+
"aria-label": "Sidebar navigation",
|
|
333
|
+
children: /* @__PURE__ */ l("div", { className: "p-6 flex flex-col h-full overflow-y-auto", children: [
|
|
334
|
+
e && /* @__PURE__ */ l("div", { className: "flex items-center space-x-3 mb-8 flex-shrink-0", children: [
|
|
335
|
+
/* @__PURE__ */ t("div", { className: "w-8 h-8 border rounded flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ t("span", { className: "text-sm", children: "Logo" }) }),
|
|
336
|
+
/* @__PURE__ */ t("span", { className: "font-bold text-lg truncate", children: "App Name" })
|
|
337
|
+
] }),
|
|
338
|
+
/* @__PURE__ */ t("nav", { className: `space-y-2 flex-1 ${e ? "" : "pt-0"}`, role: "navigation", "aria-label": "Main navigation", children: o.map((n) => /* @__PURE__ */ t(
|
|
339
|
+
"button",
|
|
340
|
+
{
|
|
341
|
+
type: "button",
|
|
342
|
+
className: "w-full flex items-center px-4 py-3 rounded transition-all text-left hover:bg-opacity-10 focus:outline-none focus:ring-2 focus:ring-offset-2",
|
|
343
|
+
"aria-label": n.label,
|
|
344
|
+
children: /* @__PURE__ */ t("span", { className: "font-medium", children: n.label })
|
|
345
|
+
},
|
|
346
|
+
n.id
|
|
347
|
+
)) })
|
|
348
|
+
] })
|
|
349
|
+
}
|
|
350
|
+
),
|
|
351
|
+
s && i && /* @__PURE__ */ l(O, { children: [
|
|
352
|
+
/* @__PURE__ */ t(
|
|
353
|
+
"div",
|
|
333
354
|
{
|
|
334
|
-
className: "
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
)
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
/* @__PURE__ */ l("div", { className: "flex items-center space-x-3 mb-8", children: [
|
|
342
|
-
/* @__PURE__ */ t("div", { className: "w-8 h-8 bg-gray-700 rounded-lg flex items-center justify-center", children: /* @__PURE__ */ t("span", { className: "text-white font-bold text-sm", children: "LO" }) }),
|
|
343
|
-
/* @__PURE__ */ t("span", { className: "text-white font-bold text-lg", children: "Tu Aplicación" })
|
|
344
|
-
] }),
|
|
345
|
-
/* @__PURE__ */ t("nav", { className: "space-y-2", children: r.map((a) => /* @__PURE__ */ t(
|
|
346
|
-
"button",
|
|
355
|
+
className: "fixed inset-0 z-40 bg-black bg-opacity-50 transition-opacity",
|
|
356
|
+
onClick: () => r(!1),
|
|
357
|
+
"aria-hidden": "true"
|
|
358
|
+
}
|
|
359
|
+
),
|
|
360
|
+
/* @__PURE__ */ t(
|
|
361
|
+
"aside",
|
|
347
362
|
{
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
363
|
+
className: "fixed top-0 left-0 w-64 h-full border-r z-50 overflow-y-auto",
|
|
364
|
+
"aria-label": "Mobile sidebar navigation",
|
|
365
|
+
role: "dialog",
|
|
366
|
+
"aria-modal": "true",
|
|
367
|
+
children: /* @__PURE__ */ l("div", { className: "p-6 flex flex-col h-full pt-20", children: [
|
|
368
|
+
e && /* @__PURE__ */ l("div", { className: "flex items-center space-x-3 mb-8 flex-shrink-0", children: [
|
|
369
|
+
/* @__PURE__ */ t("div", { className: "w-8 h-8 border rounded flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ t("span", { className: "text-sm", children: "Logo" }) }),
|
|
370
|
+
/* @__PURE__ */ t("span", { className: "font-bold text-lg truncate", children: "App Name" })
|
|
371
|
+
] }),
|
|
372
|
+
/* @__PURE__ */ t("nav", { className: `space-y-2 flex-1 ${e ? "" : "pt-0"}`, role: "navigation", "aria-label": "Main navigation", children: o.map((n) => /* @__PURE__ */ t(
|
|
373
|
+
"button",
|
|
374
|
+
{
|
|
375
|
+
type: "button",
|
|
376
|
+
onClick: () => r(!1),
|
|
377
|
+
className: "w-full flex items-center px-4 py-3 rounded transition-all text-left hover:bg-opacity-10 focus:outline-none focus:ring-2 focus:ring-offset-2",
|
|
378
|
+
"aria-label": n.label,
|
|
379
|
+
children: /* @__PURE__ */ t("span", { className: "font-medium", children: n.label })
|
|
380
|
+
},
|
|
381
|
+
n.id
|
|
382
|
+
)) })
|
|
383
|
+
] })
|
|
384
|
+
}
|
|
385
|
+
)
|
|
386
|
+
] })
|
|
355
387
|
] });
|
|
356
|
-
},
|
|
388
|
+
}, z = () => /* @__PURE__ */ t("footer", { className: "border-t flex-shrink-0", role: "contentinfo", children: /* @__PURE__ */ t("div", { className: "px-4 py-6", children: /* @__PURE__ */ t("div", { className: "max-w-7xl mx-auto text-center", children: /* @__PURE__ */ l("p", { className: "text-sm", children: [
|
|
357
389
|
"© ",
|
|
358
390
|
(/* @__PURE__ */ new Date()).getFullYear(),
|
|
359
|
-
"
|
|
360
|
-
] }) }) }) }),
|
|
391
|
+
" Your App. All rights reserved."
|
|
392
|
+
] }) }) }) }), E = () => {
|
|
361
393
|
const { isMobile: e } = N();
|
|
362
|
-
return /* @__PURE__ */ t("nav", { className: "sticky top-0 z-50
|
|
394
|
+
return /* @__PURE__ */ t("nav", { className: "sticky top-0 z-50 border-b bg-white", children: /* @__PURE__ */ t("div", { className: "px-4 py-4", children: /* @__PURE__ */ l("div", { className: "flex items-center justify-between", children: [
|
|
363
395
|
/* @__PURE__ */ l("div", { className: "flex items-center space-x-3", children: [
|
|
364
|
-
/* @__PURE__ */ t("div", { className: "w-8 h-8
|
|
365
|
-
/* @__PURE__ */ t("h1", { className: "
|
|
396
|
+
/* @__PURE__ */ t("div", { className: "w-8 h-8 border rounded flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ t("span", { className: "text-sm", children: "Logo" }) }),
|
|
397
|
+
/* @__PURE__ */ t("h1", { className: "font-semibold text-lg truncate", children: "App Name" })
|
|
366
398
|
] }),
|
|
367
|
-
e && /* @__PURE__ */ t(
|
|
399
|
+
e && /* @__PURE__ */ t(
|
|
400
|
+
"button",
|
|
401
|
+
{
|
|
402
|
+
type: "button",
|
|
403
|
+
"aria-label": "Toggle menu",
|
|
404
|
+
className: "p-2 rounded transition-opacity hover:opacity-75 focus:outline-none focus:ring-2 focus:ring-offset-2",
|
|
405
|
+
children: /* @__PURE__ */ t("svg", { className: "w-6 h-6", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 6h16M4 12h16M4 18h16" }) })
|
|
406
|
+
}
|
|
407
|
+
)
|
|
368
408
|
] }) }) });
|
|
369
|
-
},
|
|
370
|
-
/* @__PURE__ */ t(
|
|
371
|
-
/* @__PURE__ */ t("main", { className: "flex-1", children: e }),
|
|
372
|
-
/* @__PURE__ */ t(
|
|
373
|
-
] }), xe = ({ children: e }) => /* @__PURE__ */ l("div", { className: "min-h-screen
|
|
374
|
-
/* @__PURE__ */ t(
|
|
375
|
-
/* @__PURE__ */ t("main", { className: "flex-1 overflow-auto", children: e })
|
|
376
|
-
] }),
|
|
377
|
-
/* @__PURE__ */ t(
|
|
378
|
-
/* @__PURE__ */ l("
|
|
379
|
-
/* @__PURE__ */ t(
|
|
380
|
-
/* @__PURE__ */
|
|
409
|
+
}, R = ({ children: e }) => /* @__PURE__ */ l("div", { className: "min-h-screen flex flex-col", children: [
|
|
410
|
+
/* @__PURE__ */ t(E, {}),
|
|
411
|
+
/* @__PURE__ */ t("main", { className: "flex-1 overflow-x-hidden", children: e }),
|
|
412
|
+
/* @__PURE__ */ t(z, {})
|
|
413
|
+
] }), xe = ({ children: e }) => /* @__PURE__ */ l("div", { className: "min-h-screen flex h-screen", children: [
|
|
414
|
+
/* @__PURE__ */ t(H, {}),
|
|
415
|
+
/* @__PURE__ */ t("main", { className: "flex-1 overflow-y-auto overflow-x-hidden", children: e })
|
|
416
|
+
] }), ge = ({ children: e }) => /* @__PURE__ */ t(T, { children: /* @__PURE__ */ t(xe, { children: e }) }), ve = ({ children: e }) => /* @__PURE__ */ l("div", { className: "min-h-screen flex flex-col h-screen", children: [
|
|
417
|
+
/* @__PURE__ */ t(E, {}),
|
|
418
|
+
/* @__PURE__ */ l("div", { className: "flex flex-1 overflow-hidden", children: [
|
|
419
|
+
/* @__PURE__ */ t(H, { showLogo: !1 }),
|
|
420
|
+
/* @__PURE__ */ l("main", { className: "flex-1 overflow-y-auto overflow-x-hidden flex flex-col", children: [
|
|
421
|
+
/* @__PURE__ */ t("div", { className: "flex-1", children: e }),
|
|
422
|
+
/* @__PURE__ */ t(z, {})
|
|
423
|
+
] })
|
|
381
424
|
] })
|
|
382
|
-
] })
|
|
383
|
-
const { current: s, setLayout:
|
|
384
|
-
return e ? /* @__PURE__ */ l("div", { className: "
|
|
385
|
-
/* @__PURE__ */ t("
|
|
425
|
+
] }), ye = ({ children: e }) => /* @__PURE__ */ t(T, { children: /* @__PURE__ */ t(ve, { children: e }) }), Ne = ({ children: e }) => /* @__PURE__ */ t("div", { className: "min-h-screen", children: /* @__PURE__ */ t("main", { children: e }) }), je = ({ compact: e = !1 }) => {
|
|
426
|
+
const { current: s, setLayout: a, config: i } = he();
|
|
427
|
+
return e ? /* @__PURE__ */ l("div", { className: "p-3 border rounded", children: [
|
|
428
|
+
/* @__PURE__ */ t("label", { htmlFor: "layout-select", className: "text-xs mb-2 block", children: "Layout:" }),
|
|
386
429
|
/* @__PURE__ */ t(
|
|
387
430
|
"select",
|
|
388
431
|
{
|
|
432
|
+
id: "layout-select",
|
|
389
433
|
value: s,
|
|
390
|
-
onChange: (r) =>
|
|
391
|
-
className: "w-full
|
|
392
|
-
|
|
434
|
+
onChange: (r) => a(r.target.value),
|
|
435
|
+
className: "w-full text-sm p-2 rounded border focus:outline-none focus:ring-2 focus:ring-offset-2 transition-all",
|
|
436
|
+
"aria-label": "Select layout",
|
|
437
|
+
children: Object.entries(b).map(([r, o]) => /* @__PURE__ */ t("option", { value: r, children: o.name }, r))
|
|
393
438
|
}
|
|
394
439
|
)
|
|
395
|
-
] }) : /* @__PURE__ */ l("div", { className: "
|
|
396
|
-
/* @__PURE__ */ t("h3", { className: "
|
|
397
|
-
/* @__PURE__ */ t("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3", children: Object.entries(
|
|
440
|
+
] }) : /* @__PURE__ */ l("div", { className: "p-4 border rounded", role: "region", "aria-label": "Layout switcher", children: [
|
|
441
|
+
/* @__PURE__ */ t("h3", { className: "font-semibold mb-3", children: "Change Layout" }),
|
|
442
|
+
/* @__PURE__ */ t("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3", role: "group", "aria-label": "Layout options", children: Object.entries(b).map(([r, o]) => /* @__PURE__ */ l(
|
|
398
443
|
"button",
|
|
399
444
|
{
|
|
400
|
-
|
|
445
|
+
type: "button",
|
|
446
|
+
onClick: () => a(r),
|
|
447
|
+
"aria-pressed": s === r,
|
|
448
|
+
"aria-label": `Switch to ${o.name} layout`,
|
|
401
449
|
className: `
|
|
402
|
-
p-4 rounded
|
|
403
|
-
|
|
450
|
+
p-4 rounded border transition-all text-left
|
|
451
|
+
focus:outline-none focus:ring-2 focus:ring-offset-2
|
|
452
|
+
${s === r ? "border-2" : "border hover:border-opacity-50"}
|
|
404
453
|
`,
|
|
405
454
|
children: [
|
|
406
|
-
/* @__PURE__ */ t("div", { className: "font-semibold mb-1", children:
|
|
407
|
-
/* @__PURE__ */ t("div", { className: "text-xs opacity-75", children:
|
|
455
|
+
/* @__PURE__ */ t("div", { className: "font-semibold mb-1", children: o.name }),
|
|
456
|
+
/* @__PURE__ */ t("div", { className: "text-xs opacity-75", children: o.description })
|
|
408
457
|
]
|
|
409
458
|
},
|
|
410
459
|
r
|
|
411
460
|
)) }),
|
|
412
|
-
/* @__PURE__ */ l("div", { className: "mt-4 p-3
|
|
413
|
-
/* @__PURE__ */ t("div", { className: "text-xs
|
|
414
|
-
/* @__PURE__ */ t("div", { className: "text-sm
|
|
415
|
-
/* @__PURE__ */ t("div", { className: "text-xs
|
|
461
|
+
/* @__PURE__ */ l("div", { className: "mt-4 p-3 border rounded", role: "status", "aria-live": "polite", children: [
|
|
462
|
+
/* @__PURE__ */ t("div", { className: "text-xs mb-1", children: "Current Layout:" }),
|
|
463
|
+
/* @__PURE__ */ t("div", { className: "text-sm font-medium", children: i.name }),
|
|
464
|
+
/* @__PURE__ */ t("div", { className: "text-xs opacity-75", children: i.description })
|
|
416
465
|
] })
|
|
417
466
|
] });
|
|
418
467
|
};
|
|
419
468
|
export {
|
|
420
|
-
|
|
469
|
+
Me as AVAILABLE_LAYOUTS,
|
|
421
470
|
u as DEFAULT_BREAKPOINTS,
|
|
422
471
|
k as DEFAULT_LAYOUT,
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
472
|
+
ye as DashboardLayout,
|
|
473
|
+
R as DefaultLayout,
|
|
474
|
+
z as Footer,
|
|
426
475
|
Pe as Header,
|
|
427
|
-
|
|
428
|
-
|
|
476
|
+
b as LAYOUT_CONFIG,
|
|
477
|
+
je as LayoutSwitcher,
|
|
429
478
|
Oe as MainLayout,
|
|
430
479
|
Ne as MinimalLayout,
|
|
431
|
-
|
|
480
|
+
E as Navigation,
|
|
432
481
|
Se as NavigationProvider,
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
482
|
+
De as ResponsiveLayoutProvider,
|
|
483
|
+
le as ResponsiveProvider,
|
|
484
|
+
H as Sidebar,
|
|
485
|
+
ge as SidebarLayout,
|
|
486
|
+
T as SidebarProvider,
|
|
487
|
+
p as getBreakpointIndex,
|
|
439
488
|
Ce as getBreakpointValue,
|
|
440
|
-
|
|
489
|
+
ce as getCurrentBreakpoint,
|
|
441
490
|
he as useLayout,
|
|
442
491
|
be as useNavigation,
|
|
443
|
-
|
|
492
|
+
me as useResponsive,
|
|
444
493
|
N as useResponsiveLayout,
|
|
445
|
-
|
|
494
|
+
pe as useResponsiveLayoutContext,
|
|
446
495
|
$ as useSidebar
|
|
447
496
|
};
|
|
448
497
|
//# sourceMappingURL=responsive-system.mjs.map
|