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