responsive-system 1.1.5 → 1.2.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.
Files changed (36) hide show
  1. package/package.json +2 -1
  2. package/scripts/postinstall.js +2 -3
  3. package/src/App.css +42 -0
  4. package/src/App.tsx +29 -0
  5. package/src/assets/react.svg +1 -0
  6. package/src/components/LayoutSwitcher.tsx +62 -0
  7. package/src/components/ResponsiveDemo.tsx +282 -0
  8. package/src/components/layout/Footer.tsx +90 -0
  9. package/src/components/layout/Header.tsx +105 -0
  10. package/src/components/layout/Navigation.tsx +96 -0
  11. package/src/components/layout/Sidebar.tsx +108 -0
  12. package/src/components/layout/index.ts +4 -0
  13. package/src/config/layout.ts +61 -0
  14. package/src/constants/breakpoints.ts +48 -0
  15. package/src/context/NavigationContext.tsx +32 -0
  16. package/src/context/ResponsiveLayoutContext.tsx +37 -0
  17. package/src/context/SidebarContext.tsx +26 -0
  18. package/src/context/index.ts +4 -0
  19. package/src/hooks/index.ts +4 -0
  20. package/src/hooks/useLayout.ts +27 -0
  21. package/src/hooks/useResponsive.ts +189 -0
  22. package/src/hooks/useResponsiveLayout.ts +51 -0
  23. package/src/index.css +1 -0
  24. package/src/index.ts +100 -0
  25. package/src/layouts/DashboardLayout.tsx +76 -0
  26. package/src/layouts/DefaultLayout.tsx +30 -0
  27. package/src/layouts/MainLayout.tsx +38 -0
  28. package/src/layouts/MinimalLayout.tsx +20 -0
  29. package/src/layouts/SidebarLayout.tsx +36 -0
  30. package/src/layouts/index.ts +5 -0
  31. package/src/main.tsx +10 -0
  32. package/src/pages/ResponsiveTestPage.tsx +400 -0
  33. package/src/providers/ResponsiveLayoutProvider.tsx +92 -0
  34. package/src/providers/ResponsiveProvider.tsx +18 -0
  35. package/src/providers/index.ts +3 -0
  36. package/src/types/responsive.ts +64 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "responsive-system",
3
- "version": "1.1.5",
3
+ "version": "1.2.1",
4
4
  "description": "Sistema de layout responsivo con auto-scaling para Tailwind CSS",
5
5
  "type": "module",
6
6
  "main": "./dist/responsive-system.cjs",
@@ -31,6 +31,7 @@
31
31
  "dist/**/*.cjs",
32
32
  "dist/**/*.d.ts",
33
33
  "dist/**/*.map",
34
+ "src",
34
35
  "src/plugin",
35
36
  "scripts",
36
37
  "README.md",
@@ -312,9 +312,8 @@ ReactDOM.createRoot(document.getElementById('root')!).render(
312
312
  // Crear src/index.css
313
313
  const indexCssPath = path.join(projectRoot, 'src', 'index.css')
314
314
  if (!fs.existsSync(indexCssPath)) {
315
- const indexCss = `@tailwind base;
316
- @tailwind components;
317
- @tailwind utilities;
315
+ // Tailwind CSS v4 usa @import en lugar de @tailwind
316
+ const indexCss = `@import "tailwindcss";
318
317
  `
319
318
  fs.writeFileSync(indexCssPath, indexCss)
320
319
  console.log(' ✅ Creado: src/index.css')
package/src/App.css ADDED
@@ -0,0 +1,42 @@
1
+ #root {
2
+ max-width: 1280px;
3
+ margin: 0 auto;
4
+ padding: 2rem;
5
+ text-align: center;
6
+ }
7
+
8
+ .logo {
9
+ height: 6em;
10
+ padding: 1.5em;
11
+ will-change: filter;
12
+ transition: filter 300ms;
13
+ }
14
+ .logo:hover {
15
+ filter: drop-shadow(0 0 2em #646cffaa);
16
+ }
17
+ .logo.react:hover {
18
+ filter: drop-shadow(0 0 2em #61dafbaa);
19
+ }
20
+
21
+ @keyframes logo-spin {
22
+ from {
23
+ transform: rotate(0deg);
24
+ }
25
+ to {
26
+ transform: rotate(360deg);
27
+ }
28
+ }
29
+
30
+ @media (prefers-reduced-motion: no-preference) {
31
+ a:nth-of-type(2) .logo {
32
+ animation: logo-spin infinite 20s linear;
33
+ }
34
+ }
35
+
36
+ .card {
37
+ padding: 2em;
38
+ }
39
+
40
+ .read-the-docs {
41
+ color: #888;
42
+ }
package/src/App.tsx ADDED
@@ -0,0 +1,29 @@
1
+ import { ResponsiveLayoutProvider } from './providers'
2
+ import { MainLayout } from './layouts'
3
+ import { NavigationProvider, useNavigation } from './context'
4
+ import ResponsiveTestPage from './pages/ResponsiveTestPage'
5
+ import ResponsiveDemo from './components/ResponsiveDemo'
6
+
7
+ // Componente interno que usa el contexto
8
+ function AppContent() {
9
+ const { currentPage } = useNavigation()
10
+
11
+ return (
12
+ <MainLayout>
13
+ {currentPage === 'demo' ? <ResponsiveDemo /> : <ResponsiveTestPage />}
14
+ </MainLayout>
15
+ )
16
+ }
17
+
18
+ // App principal con providers
19
+ function App() {
20
+ return (
21
+ <NavigationProvider defaultPage="test">
22
+ <ResponsiveLayoutProvider defaultLayout="default">
23
+ <AppContent />
24
+ </ResponsiveLayoutProvider>
25
+ </NavigationProvider>
26
+ )
27
+ }
28
+
29
+ export default App
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>
@@ -0,0 +1,62 @@
1
+ import { useLayout } from '../hooks'
2
+ import { LAYOUT_CONFIG } from '../config/layout'
3
+
4
+ interface LayoutSwitcherProps {
5
+ compact?: boolean
6
+ }
7
+
8
+ const LayoutSwitcher = ({ compact = false }: LayoutSwitcherProps) => {
9
+ const { current, setLayout, config } = useLayout()
10
+
11
+ if (compact) {
12
+ return (
13
+ <div className="bg-black/50 rounded-lg p-3 border border-gray-700">
14
+ <div className="text-xs text-gray-500 mb-2">Layout:</div>
15
+ <select
16
+ value={current}
17
+ onChange={(e) => setLayout(e.target.value)}
18
+ 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"
19
+ >
20
+ {Object.entries(LAYOUT_CONFIG).map(([key, layoutConfig]) => (
21
+ <option key={key} value={key}>
22
+ {layoutConfig.name}
23
+ </option>
24
+ ))}
25
+ </select>
26
+ </div>
27
+ )
28
+ }
29
+
30
+ return (
31
+ <div className="bg-black/50 backdrop-blur-sm rounded-lg p-4 border border-cyan-500/30">
32
+ <h3 className="text-white font-semibold mb-3">Cambiar Layout</h3>
33
+
34
+ <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3">
35
+ {Object.entries(LAYOUT_CONFIG).map(([key, layoutConfig]) => (
36
+ <button
37
+ key={key}
38
+ onClick={() => setLayout(key)}
39
+ className={`
40
+ p-4 rounded-lg border transition-all text-left
41
+ ${current === key
42
+ ? 'border-cyan-500 bg-cyan-500/10 text-cyan-400'
43
+ : 'border-gray-700 bg-black/30 text-gray-300 hover:border-gray-600'
44
+ }
45
+ `}
46
+ >
47
+ <div className="font-semibold mb-1">{layoutConfig.name}</div>
48
+ <div className="text-xs opacity-75">{layoutConfig.description}</div>
49
+ </button>
50
+ ))}
51
+ </div>
52
+
53
+ <div className="mt-4 p-3 bg-gray-900/50 rounded-lg">
54
+ <div className="text-xs text-gray-500 mb-1">Layout Actual:</div>
55
+ <div className="text-sm text-cyan-400 font-medium">{config.name}</div>
56
+ <div className="text-xs text-gray-400">{config.description}</div>
57
+ </div>
58
+ </div>
59
+ )
60
+ }
61
+
62
+ export default LayoutSwitcher
@@ -0,0 +1,282 @@
1
+ import { useResponsiveLayout } from '../hooks'
2
+ import LayoutSwitcher from './LayoutSwitcher'
3
+
4
+ const ResponsiveDemo = () => {
5
+ const {
6
+ breakpoint,
7
+ width,
8
+ height,
9
+ isMobile,
10
+ isTablet,
11
+ isDesktop
12
+ } = useResponsiveLayout()
13
+
14
+ return (
15
+ <div className="w-full space-y-8">
16
+
17
+ {/* Header Principal */}
18
+ <div className="bg-gradient-to-br from-gray-900 to-black rounded-2xl shadow-2xl p-6 border border-cyan-500/20">
19
+ <div className="border-l-2 border-cyan-400 pl-4 mb-6">
20
+ <h1 className="text-4xl font-black text-white mb-3 tracking-tighter leading-none">
21
+ Sistema Responsivo
22
+ </h1>
23
+ <p className="text-base text-gray-400 leading-relaxed tracking-wide">
24
+ Sistema de auto-escalado para aplicaciones web modernas
25
+ </p>
26
+ </div>
27
+
28
+ {/* Estado actual - 3 cards en fila horizontal */}
29
+ <div className="grid grid-cols-1 sm:grid-cols-3 gap-4">
30
+ <div className="bg-black/50 backdrop-blur-sm rounded-xl p-4 border border-cyan-500/30 hover:border-cyan-400/50 transition-all shadow-lg shadow-cyan-500/10">
31
+ <p className="text-xs text-cyan-400 font-bold mb-2 tracking-widest uppercase">Breakpoint</p>
32
+ <p className="text-2xl font-black text-white tracking-tight">{breakpoint.toUpperCase()}</p>
33
+ </div>
34
+ <div className="bg-black/50 backdrop-blur-sm rounded-xl p-4 border border-gray-700 hover:border-gray-600 transition-all">
35
+ <p className="text-xs text-gray-500 font-bold mb-2 tracking-widest uppercase">Resolución</p>
36
+ <p className="text-xl font-bold text-gray-300 tracking-tight">{width} × {height}</p>
37
+ </div>
38
+ <div className="bg-black/50 backdrop-blur-sm rounded-xl p-4 border border-gray-700 hover:border-gray-600 transition-all">
39
+ <p className="text-xs text-gray-500 font-bold mb-2 tracking-widest uppercase">Dispositivo</p>
40
+ <p className="text-xl font-bold text-gray-300 tracking-tight">
41
+ {isMobile && 'Móvil'}
42
+ {isTablet && 'Tablet'}
43
+ {isDesktop && 'Desktop'}
44
+ </p>
45
+ </div>
46
+ </div>
47
+ </div>
48
+
49
+ {/* Features Grid - 2x3 layout */}
50
+ <div className="bg-gradient-to-br from-gray-900 to-black rounded-2xl shadow-2xl p-6 border border-cyan-500/20">
51
+ <div className="border-l-2 border-cyan-400 pl-4 mb-6">
52
+ <h2 className="text-3xl font-black text-white mb-2 tracking-tight">
53
+ Propiedades Auto-Escalables
54
+ </h2>
55
+ <p className="text-base text-gray-400 leading-relaxed">
56
+ Seis propiedades CSS que escalan automáticamente en todos los breakpoints
57
+ </p>
58
+ </div>
59
+
60
+ <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
61
+ <div className="group bg-black/50 backdrop-blur-sm rounded-xl p-6 border border-cyan-500/30 hover:border-cyan-400 hover:shadow-lg hover:shadow-cyan-500/20 transition-all">
62
+ <div className="flex items-center justify-between mb-3">
63
+ <h3 className="text-lg font-bold text-white tracking-tight">Tipografía</h3>
64
+ <div className="w-2 h-2 rounded-full bg-cyan-400 shadow-lg shadow-cyan-400/50"></div>
65
+ </div>
66
+ <p className="text-sm text-gray-400 leading-relaxed">
67
+ Font-size escala proporcionalmente para legibilidad óptima
68
+ </p>
69
+ </div>
70
+
71
+ <div className="group bg-black/50 backdrop-blur-sm rounded-xl p-6 border border-gray-700 hover:border-gray-600 transition-all">
72
+ <div className="flex items-center justify-between mb-3">
73
+ <h3 className="text-lg font-bold text-white tracking-tight">Espaciado</h3>
74
+ <div className="w-2 h-2 rounded-full bg-gray-600"></div>
75
+ </div>
76
+ <p className="text-sm text-gray-400 leading-relaxed">
77
+ Padding, margin y gap se adaptan automáticamente
78
+ </p>
79
+ </div>
80
+
81
+ <div className="group bg-black/50 backdrop-blur-sm rounded-xl p-6 border border-gray-700 hover:border-gray-600 transition-all">
82
+ <div className="flex items-center justify-between mb-3">
83
+ <h3 className="text-lg font-bold text-white tracking-tight">Alto de Línea</h3>
84
+ <div className="w-2 h-2 rounded-full bg-gray-600"></div>
85
+ </div>
86
+ <p className="text-sm text-gray-400 leading-relaxed">
87
+ Ritmo vertical se ajusta para mejor legibilidad
88
+ </p>
89
+ </div>
90
+
91
+ <div className="group bg-black/50 backdrop-blur-sm rounded-xl p-6 border border-gray-700 hover:border-gray-600 transition-all">
92
+ <div className="flex items-center justify-between mb-3">
93
+ <h3 className="text-lg font-bold text-white tracking-tight">Espaciado de Letras</h3>
94
+ <div className="w-2 h-2 rounded-full bg-gray-600"></div>
95
+ </div>
96
+ <p className="text-sm text-gray-400 leading-relaxed">
97
+ Espaciado entre caracteres se optimiza horizontalmente
98
+ </p>
99
+ </div>
100
+
101
+ <div className="group bg-black/50 backdrop-blur-sm rounded-xl p-6 border border-gray-700 hover:border-gray-600 transition-all">
102
+ <div className="flex items-center justify-between mb-3">
103
+ <h3 className="text-lg font-bold text-white tracking-tight">Sombras</h3>
104
+ <div className="w-2 h-2 rounded-full bg-gray-600"></div>
105
+ </div>
106
+ <p className="text-sm text-gray-400 leading-relaxed">
107
+ Intensidad aumenta en pantallas grandes
108
+ </p>
109
+ </div>
110
+
111
+ <div className="group bg-black/50 backdrop-blur-sm rounded-xl p-6 border border-cyan-500/30 hover:border-cyan-400 hover:shadow-lg hover:shadow-cyan-500/20 transition-all">
112
+ <div className="flex items-center justify-between mb-3">
113
+ <h3 className="text-lg font-bold text-white tracking-tight">Grids Automáticos</h3>
114
+ <div className="w-2 h-2 rounded-full bg-cyan-400 shadow-lg shadow-cyan-400/50"></div>
115
+ </div>
116
+ <p className="text-sm text-gray-400 leading-relaxed">
117
+ Columnas se calculan automáticamente según tamaño de pantalla
118
+ </p>
119
+ </div>
120
+ </div>
121
+ </div>
122
+
123
+ {/* Visual Demo - Layout horizontal */}
124
+ <div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
125
+
126
+ {/* Typography Showcase */}
127
+ <div className="bg-gradient-to-br from-gray-900 to-black rounded-2xl shadow-2xl p-6 border border-cyan-500/20">
128
+ <div className="border-l-2 border-cyan-400 pl-4 mb-6">
129
+ <h2 className="text-2xl font-black text-white mb-2 tracking-tight">
130
+ Escala Tipográfica
131
+ </h2>
132
+ <p className="text-sm text-gray-400 leading-relaxed">
133
+ Vista previa del comportamiento de escalado automático
134
+ </p>
135
+ </div>
136
+
137
+ <div className="bg-black/30 rounded-xl p-6 border border-gray-800">
138
+ <p className="text-xs text-gray-500 mb-4 tracking-widest uppercase font-bold">Escala Tipográfica</p>
139
+ <div className="space-y-3">
140
+ <h1 className="text-4xl font-black text-white tracking-tighter leading-none">Título Principal</h1>
141
+ <h2 className="text-3xl font-bold text-gray-300 tracking-tight">Título Primario</h2>
142
+ <h3 className="text-2xl font-bold text-gray-400 tracking-tight">Título Secundario</h3>
143
+ <p className="text-base text-gray-500 leading-relaxed tracking-wide">
144
+ El texto del cuerpo escala proporcionalmente en móvil, desktop, Full HD y pantallas 4K.
145
+ </p>
146
+ </div>
147
+ </div>
148
+ </div>
149
+
150
+ {/* Cards Grid */}
151
+ <div className="bg-gradient-to-br from-gray-900 to-black rounded-2xl shadow-2xl p-6 border border-gray-800">
152
+ <div className="border-l-2 border-gray-600 pl-4 mb-6">
153
+ <h2 className="text-2xl font-black text-white mb-2 tracking-tight">
154
+ Grid Automático
155
+ </h2>
156
+ <p className="text-sm text-gray-400 leading-relaxed">
157
+ Cards que se distribuyen automáticamente
158
+ </p>
159
+ </div>
160
+
161
+ <div className="grid grid-cols-2 lg:grid-cols-4 gap-3">
162
+ {[
163
+ { label: 'Rápido', accent: 'cyan' },
164
+ { label: 'Limpio', accent: 'gray' },
165
+ { label: 'Moderno', accent: 'gray' },
166
+ { label: 'Preciso', accent: 'gray' },
167
+ { label: 'Eficiente', accent: 'gray' },
168
+ { label: 'Confiable', accent: 'gray' },
169
+ { label: 'Escalable', accent: 'gray' },
170
+ { label: 'Robusto', accent: 'cyan' },
171
+ ].map((item, i) => (
172
+ <div
173
+ key={i}
174
+ className={`
175
+ bg-black/50 backdrop-blur-sm rounded-xl p-4 text-center
176
+ border transition-all
177
+ ${item.accent === 'cyan'
178
+ ? 'border-cyan-500/30 hover:border-cyan-400 hover:shadow-lg hover:shadow-cyan-500/20'
179
+ : 'border-gray-700 hover:border-gray-600'
180
+ }
181
+ `}
182
+ >
183
+ <p className={`text-base font-bold tracking-tight ${item.accent === 'cyan' ? 'text-cyan-400' : 'text-gray-300'}`}>
184
+ {item.label}
185
+ </p>
186
+ </div>
187
+ ))}
188
+ </div>
189
+ </div>
190
+ </div>
191
+
192
+ {/* Code Comparison - Layout horizontal */}
193
+ <div className="bg-gradient-to-br from-gray-900 to-black rounded-2xl shadow-2xl p-6 border border-cyan-500/20">
194
+ <div className="border-l-2 border-cyan-400 pl-4 mb-6">
195
+ <h2 className="text-3xl font-black text-white mb-2 tracking-tight">
196
+ Comparación de Código
197
+ </h2>
198
+ <p className="text-base text-gray-400 leading-relaxed">
199
+ Enfoque tradicional versus escalado automatizado
200
+ </p>
201
+ </div>
202
+
203
+ <div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
204
+ {/* Traditional */}
205
+ <div className="bg-black/30 rounded-xl p-6 border border-red-900/30">
206
+ <div className="flex items-center gap-3 mb-4">
207
+ <div className="w-3 h-3 rounded-full bg-red-500"></div>
208
+ <h3 className="text-xl font-bold text-red-400 tracking-tight">Tradicional</h3>
209
+ </div>
210
+ <pre className="bg-black/50 p-4 rounded-lg overflow-x-auto text-sm leading-relaxed text-gray-400 border border-gray-800">
211
+ {`<div className="
212
+ text-sm sm:text-base
213
+ md:text-lg lg:text-xl
214
+ xl:text-2xl 2xl:text-3xl
215
+ p-2 sm:p-3 md:p-4
216
+ lg:p-6">
217
+ Contenido
218
+ </div>`}
219
+ </pre>
220
+ <ul className="text-sm text-gray-500 mt-4 space-y-2 leading-relaxed">
221
+ <li>• Patrones repetitivos</li>
222
+ <li>• Difícil de mantener</li>
223
+ <li>• Propenso a errores</li>
224
+ </ul>
225
+ </div>
226
+
227
+ {/* Automated */}
228
+ <div className="bg-black/30 rounded-xl p-6 border border-cyan-500/30">
229
+ <div className="flex items-center gap-3 mb-4">
230
+ <div className="w-3 h-3 rounded-full bg-cyan-400 shadow-lg shadow-cyan-400/50"></div>
231
+ <h3 className="text-xl font-bold text-cyan-400 tracking-tight">Automatizado</h3>
232
+ </div>
233
+ <pre className="bg-black/50 p-4 rounded-lg overflow-x-auto text-sm leading-relaxed text-gray-400 border border-gray-800">
234
+ {`<div className="text-base p-4">
235
+ Contenido
236
+ </div>
237
+
238
+ /* Escala automático */
239
+ /* Sin media queries */
240
+ /* Código limpio */`}
241
+ </pre>
242
+ <ul className="text-sm text-gray-400 mt-4 space-y-2 leading-relaxed">
243
+ <li>• Código minimalista</li>
244
+ <li>• Fácil de mantener</li>
245
+ <li>• Listo para producción</li>
246
+ </ul>
247
+ </div>
248
+ </div>
249
+ </div>
250
+
251
+ {/* Footer CTA - Layout horizontal */}
252
+ <div className="bg-gradient-to-br from-gray-900 to-black rounded-2xl shadow-2xl p-8 border border-cyan-500/20">
253
+ <div className="text-center mb-6">
254
+ <h2 className="text-3xl font-black text-white mb-4 tracking-tighter leading-none">
255
+ Listo para Producción
256
+ </h2>
257
+ <p className="text-base text-gray-400 leading-relaxed">
258
+ Sistema completo de auto-escalado para aplicaciones React + Tailwind CSS
259
+ </p>
260
+ </div>
261
+ <div className="grid grid-cols-1 sm:grid-cols-3 gap-4">
262
+ <div className="bg-black/50 backdrop-blur-sm border border-cyan-500/30 rounded-lg px-6 py-4 text-center">
263
+ <p className="text-sm font-bold tracking-widest text-cyan-400 uppercase">6 Propiedades</p>
264
+ </div>
265
+ <div className="bg-black/50 backdrop-blur-sm border border-gray-700 rounded-lg px-6 py-4 text-center">
266
+ <p className="text-sm font-bold tracking-widest text-gray-400 uppercase">9 Breakpoints</p>
267
+ </div>
268
+ <div className="bg-black/50 backdrop-blur-sm border border-gray-700 rounded-lg px-6 py-4 text-center">
269
+ <p className="text-sm font-bold tracking-widest text-gray-400 uppercase">Auto-Grid</p>
270
+ </div>
271
+ </div>
272
+ </div>
273
+
274
+ {/* Layout Switcher */}
275
+ <div className="mt-8">
276
+ <LayoutSwitcher />
277
+ </div>
278
+ </div>
279
+ )
280
+ }
281
+
282
+ export default ResponsiveDemo
@@ -0,0 +1,90 @@
1
+ import { useResponsiveLayout } from '../../hooks'
2
+
3
+ const Footer = () => {
4
+ const { layout, breakpoint, width, height } = useResponsiveLayout()
5
+
6
+ return (
7
+ <footer className="bg-gradient-to-r from-gray-900 to-black border-t border-cyan-500/20">
8
+ <div className={`${layout.config.spacing} py-8`}>
9
+ <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
10
+
11
+ {/* Brand */}
12
+ <div>
13
+ <div className="flex items-center space-x-3 mb-4">
14
+ <div className="w-8 h-8 bg-cyan-500 rounded-lg flex items-center justify-center">
15
+ <span className="text-white font-bold text-sm">RS</span>
16
+ </div>
17
+ <span className="text-white font-bold text-lg">Responsive System</span>
18
+ </div>
19
+ <p className="text-gray-400 text-sm leading-relaxed">
20
+ Sistema completo de auto-escalado para aplicaciones React + Tailwind CSS
21
+ </p>
22
+ </div>
23
+
24
+ {/* Status */}
25
+ <div>
26
+ <h3 className="text-white font-semibold mb-4">Estado del Sistema</h3>
27
+ <div className="space-y-2">
28
+ <div className="flex items-center justify-between text-sm">
29
+ <span className="text-gray-400">Breakpoint:</span>
30
+ <span className="text-cyan-400 font-medium">{breakpoint.toUpperCase()}</span>
31
+ </div>
32
+ <div className="flex items-center justify-between text-sm">
33
+ <span className="text-gray-400">Layout:</span>
34
+ <span className="text-cyan-400 font-medium">{layout.config.name}</span>
35
+ </div>
36
+ <div className="flex items-center justify-between text-sm">
37
+ <span className="text-gray-400">Resolución:</span>
38
+ <span className="text-cyan-400 font-medium">{width} × {height}</span>
39
+ </div>
40
+ </div>
41
+ </div>
42
+
43
+ {/* Developer */}
44
+ <div>
45
+ <h3 className="text-white font-semibold mb-4">Desarrollador</h3>
46
+ <div className="space-y-3">
47
+ <div className="flex items-center space-x-3">
48
+ <div className="w-8 h-8 bg-gray-700 rounded-full flex items-center justify-center">
49
+ <svg className="w-4 h-4 text-gray-300" fill="currentColor" viewBox="0 0 24 24">
50
+ <path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/>
51
+ </svg>
52
+ </div>
53
+ <div>
54
+ <p className="text-white font-medium text-sm">Felipe Caroca</p>
55
+ <p className="text-gray-400 text-xs">Frontend Developer</p>
56
+ </div>
57
+ </div>
58
+ <a
59
+ href="https://github.com/FelipeCaroca1"
60
+ target="_blank"
61
+ rel="noopener noreferrer"
62
+ className="flex items-center space-x-2 text-gray-400 hover:text-cyan-400 transition-colors text-sm group"
63
+ >
64
+ <svg className="w-4 h-4 group-hover:text-cyan-400" fill="currentColor" viewBox="0 0 24 24">
65
+ <path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/>
66
+ </svg>
67
+ <span>Ver en GitHub</span>
68
+ </a>
69
+ </div>
70
+ </div>
71
+ </div>
72
+
73
+ {/* Bottom */}
74
+ <div className="border-t border-gray-800 mt-8 pt-6 flex flex-col items-center text-center">
75
+ <p className="text-gray-500 text-sm mb-4">
76
+ © 2025 Responsive System. Todos los derechos reservados.
77
+ </p>
78
+ <div className="flex items-center space-x-4">
79
+ <span className="text-gray-500 text-xs">
80
+ Auto-escalado activo
81
+ </span>
82
+ <div className="w-2 h-2 bg-cyan-400 rounded-full animate-pulse"></div>
83
+ </div>
84
+ </div>
85
+ </div>
86
+ </footer>
87
+ )
88
+ }
89
+
90
+ export default Footer
@@ -0,0 +1,105 @@
1
+ import { useResponsiveLayout } from '../../hooks'
2
+ import { useNavigation, useSidebar } from '../../context'
3
+
4
+ const Header = () => {
5
+ const { isMobile } = useResponsiveLayout()
6
+ const { currentPage, setCurrentPage } = useNavigation()
7
+ const { sidebarOpen, setSidebarOpen } = useSidebar()
8
+
9
+ const menuItems = [
10
+ { id: 'test', label: 'Suite de Test' },
11
+ { id: 'demo', label: 'Demo' },
12
+ ]
13
+
14
+ return (
15
+ <div className="sticky top-0 z-50">
16
+ <header className="bg-gradient-to-r from-gray-900 via-black to-gray-900 border-b border-cyan-500/20 shadow-2xl relative">
17
+ <div className="w-full">
18
+ <div className="px-4 py-4">
19
+ <div className="flex items-center justify-between">
20
+ <div className="flex items-center space-x-2">
21
+ {/* Hamburger button para móvil - A LA IZQUIERDA */}
22
+ {isMobile && (
23
+ <button
24
+ onClick={() => setSidebarOpen(true)}
25
+ className="p-2 rounded-lg text-gray-300 hover:text-cyan-400 hover:bg-cyan-500/10 transition-colors"
26
+ >
27
+ <svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
28
+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4 6h16M4 12h16M4 18h16" />
29
+ </svg>
30
+ </button>
31
+ )}
32
+
33
+ <div className="flex items-center space-x-2">
34
+ <div className="w-1.5 h-1.5 bg-cyan-400 rounded-full shadow-lg shadow-cyan-400/50 animate-pulse"></div>
35
+ <h3 className="text-base font-black text-white tracking-tight">
36
+ Sistema Responsivo
37
+ </h3>
38
+ </div>
39
+ <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">
40
+ DASHBOARD
41
+ </div>
42
+ </div>
43
+
44
+ <div className="flex items-center space-x-2">
45
+ {/* Botones visibles solo en desktop */}
46
+ {!isMobile && menuItems.map((page) => (
47
+ <button
48
+ key={page.id}
49
+ onClick={() => setCurrentPage(page.id as 'demo' | 'test')}
50
+ className={`px-3 py-1.5 rounded-lg transition-all font-bold text-xs tracking-wide border ${
51
+ currentPage === page.id
52
+ ? 'bg-cyan-500/20 text-cyan-400 border-cyan-500/50'
53
+ : 'bg-black/50 text-gray-400 hover:text-gray-300 border-gray-700 hover:border-gray-600'
54
+ }`}
55
+ >
56
+ {page.label}
57
+ </button>
58
+ ))}
59
+ </div>
60
+ </div>
61
+ </div>
62
+ </div>
63
+ </header>
64
+
65
+ {/* Sidebar móvil desplegable */}
66
+ {isMobile && sidebarOpen && (
67
+ <div className="fixed inset-0 z-40 bg-black/50" onClick={() => setSidebarOpen(false)}>
68
+ <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">
69
+ <div className="p-6 flex flex-col h-full pt-20">
70
+ {/* Logo */}
71
+ <div className="flex items-center space-x-3 mb-8">
72
+ <div className="w-8 h-8 bg-cyan-500 rounded-lg flex items-center justify-center">
73
+ <span className="text-white font-bold text-sm">RS</span>
74
+ </div>
75
+ <span className="text-white font-bold text-lg">Sistema Responsivo</span>
76
+ </div>
77
+
78
+ {/* Navigation */}
79
+ <nav className="space-y-2">
80
+ {menuItems.map((item) => (
81
+ <button
82
+ key={item.id}
83
+ onClick={() => {
84
+ setCurrentPage(item.id as 'demo' | 'test')
85
+ setSidebarOpen(false)
86
+ }}
87
+ className={`w-full flex items-center px-4 py-3 rounded-lg transition-all group text-left ${
88
+ currentPage === item.id
89
+ ? 'bg-cyan-500/20 text-cyan-400 border border-cyan-500/50'
90
+ : 'text-gray-300 hover:text-cyan-400 hover:bg-cyan-500/10'
91
+ }`}
92
+ >
93
+ <span className="font-medium">{item.label}</span>
94
+ </button>
95
+ ))}
96
+ </nav>
97
+ </div>
98
+ </div>
99
+ </div>
100
+ )}
101
+ </div>
102
+ )
103
+ }
104
+
105
+ export default Header