siesa-ui-kit 1.0.5 → 1.0.6

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 (198) hide show
  1. package/dist/index.cjs +1479 -0
  2. package/dist/index.cjs.map +1 -0
  3. package/dist/index.js +1479 -0
  4. package/dist/index.js.map +1 -0
  5. package/package.json +23 -14
  6. package/claude/agents/siesa-ui-kit-specialist.md +0 -2401
  7. package/claude/prompts/component-template.md +0 -121
  8. package/claude/settings.local.json +0 -61
  9. package/docs/border-radius.md +0 -1261
  10. package/docs/colors.md +0 -832
  11. package/docs/dark-mode-guide.md +0 -1426
  12. package/docs/filters.md +0 -1243
  13. package/docs/icons.md +0 -1283
  14. package/docs/shadows.md +0 -1377
  15. package/docs/spacing.md +0 -1684
  16. package/docs/typography.md +0 -1268
  17. package/postcss.config.cjs +0 -6
  18. package/src/App.css +0 -42
  19. package/src/App.tsx +0 -8
  20. package/src/ButtonTest.tsx +0 -147
  21. package/src/assets/fonts/README.md +0 -261
  22. package/src/assets/fonts/SiesaBT/SiesaBT-Bold.otf +0 -0
  23. package/src/assets/fonts/SiesaBT/SiesaBT-Light.otf +0 -0
  24. package/src/assets/fonts/SiesaBT/SiesaBT-Regular.otf +0 -0
  25. package/src/assets/react.svg +0 -1
  26. package/src/components/Alert/Alert.stories.tsx +0 -332
  27. package/src/components/Alert/Alert.tsx +0 -106
  28. package/src/components/Alert/Alert.types.ts +0 -54
  29. package/src/components/Avatar/Avatar.stories.tsx +0 -494
  30. package/src/components/Avatar/Avatar.tsx +0 -143
  31. package/src/components/Avatar/Avatar.types.ts +0 -53
  32. package/src/components/Badge/Badge.stories.tsx +0 -339
  33. package/src/components/Badge/Badge.tsx +0 -278
  34. package/src/components/Badge/Badge.types.ts +0 -58
  35. package/src/components/Button/Button.stories.tsx +0 -950
  36. package/src/components/Button/Button.tsx +0 -337
  37. package/src/components/Button/Button.types.ts +0 -180
  38. package/src/components/Button/icons.tsx +0 -87
  39. package/src/components/Button/index.ts +0 -3
  40. package/src/components/Checkbox/Checkbox.stories.tsx +0 -453
  41. package/src/components/Checkbox/Checkbox.tsx +0 -208
  42. package/src/components/Checkbox/Checkbox.types.ts +0 -61
  43. package/src/components/DescriptionList/DescriptionList.stories.tsx +0 -250
  44. package/src/components/DescriptionList/DescriptionList.tsx +0 -96
  45. package/src/components/DescriptionList/DescriptionList.types.ts +0 -29
  46. package/src/components/Divider/Divider.stories.tsx +0 -263
  47. package/src/components/Divider/Divider.tsx +0 -80
  48. package/src/components/Divider/Divider.types.ts +0 -24
  49. package/src/components/Dropdown/Dropdown.stories.tsx +0 -552
  50. package/src/components/Dropdown/Dropdown.tsx +0 -422
  51. package/src/components/Dropdown/Dropdown.types.ts +0 -146
  52. package/src/components/Dropdown/README.md +0 -266
  53. package/src/components/Dropdown/icons.tsx +0 -72
  54. package/src/components/Dropdown/index.ts +0 -8
  55. package/src/components/Input/Input.stories.tsx +0 -583
  56. package/src/components/Input/Input.tsx +0 -204
  57. package/src/components/Input/Input.types.ts +0 -80
  58. package/src/components/Input/icons.tsx +0 -145
  59. package/src/components/Input/index.ts +0 -2
  60. package/src/components/LoginView/LoginView.stories.tsx +0 -148
  61. package/src/components/LoginView/LoginView.tsx +0 -426
  62. package/src/components/LoginView/LoginView.types.ts +0 -52
  63. package/src/components/LoginView/README.md +0 -396
  64. package/src/components/LoginView/icons.tsx +0 -85
  65. package/src/components/LoginView/index.ts +0 -3
  66. package/src/components/Navbar/Navbar.stories.tsx +0 -810
  67. package/src/components/Navbar/Navbar.tsx +0 -755
  68. package/src/components/Navbar/Navbar.types.ts +0 -219
  69. package/src/components/Navbar/README.md +0 -279
  70. package/src/components/Navbar/icons.tsx +0 -102
  71. package/src/components/Navbar/index.ts +0 -8
  72. package/src/components/NavigationBar/NavigationBar.stories.tsx +0 -406
  73. package/src/components/NavigationBar/NavigationBar.tsx +0 -246
  74. package/src/components/NavigationBar/NavigationBar.types.ts +0 -74
  75. package/src/components/NavigationBar/README.md +0 -469
  76. package/src/components/NavigationBar/index.ts +0 -2
  77. package/src/components/NavigationRail/NavigationRail.stories.tsx +0 -417
  78. package/src/components/NavigationRail/NavigationRail.tsx +0 -418
  79. package/src/components/NavigationRail/NavigationRail.types.ts +0 -109
  80. package/src/components/NavigationRail/README.md +0 -224
  81. package/src/components/NavigationRail/index.ts +0 -2
  82. package/src/components/Notification/Notification.stories.tsx +0 -513
  83. package/src/components/Notification/Notification.tsx +0 -145
  84. package/src/components/Notification/Notification.types.ts +0 -142
  85. package/src/components/Notification/README.md +0 -409
  86. package/src/components/Notification/index.ts +0 -3
  87. package/src/components/POSConvention/POSConvention.stories.tsx +0 -235
  88. package/src/components/POSConvention/POSConvention.tsx +0 -129
  89. package/src/components/POSConvention/POSConvention.types.ts +0 -38
  90. package/src/components/POSConvention/README.md +0 -123
  91. package/src/components/POSConvention/icons.tsx +0 -45
  92. package/src/components/POSConvention/index.ts +0 -3
  93. package/src/components/POSLocationButton/POSLocationButton.stories.tsx +0 -531
  94. package/src/components/POSLocationButton/POSLocationButton.tsx +0 -247
  95. package/src/components/POSLocationButton/POSLocationButton.types.ts +0 -87
  96. package/src/components/POSLocationButton/README.md +0 -253
  97. package/src/components/POSLocationButton/icons.tsx +0 -120
  98. package/src/components/POSLocationButton/index.ts +0 -14
  99. package/src/components/POSNumberButton/POSNumberButton.stories.tsx +0 -415
  100. package/src/components/POSNumberButton/POSNumberButton.tsx +0 -179
  101. package/src/components/POSNumberButton/POSNumberButton.types.ts +0 -51
  102. package/src/components/POSNumberButton/README.md +0 -321
  103. package/src/components/POSNumberButton/index.ts +0 -3
  104. package/src/components/POSProductButton/POSProductButton.stories.tsx +0 -318
  105. package/src/components/POSProductButton/POSProductButton.tsx +0 -152
  106. package/src/components/POSProductButton/POSProductButton.types.ts +0 -46
  107. package/src/components/POSProductButton/README.md +0 -269
  108. package/src/components/POSProductButton/index.ts +0 -2
  109. package/src/components/POSProductCard/POSProductCard.stories.tsx +0 -642
  110. package/src/components/POSProductCard/POSProductCard.tsx +0 -208
  111. package/src/components/POSProductCard/POSProductCard.types.ts +0 -76
  112. package/src/components/POSProductCard/README.md +0 -179
  113. package/src/components/POSProductCard/icons.tsx +0 -26
  114. package/src/components/POSProductCard/index.ts +0 -2
  115. package/src/components/POSProductSidebarItems/POSProductSidebarItems.stories.tsx +0 -753
  116. package/src/components/POSProductSidebarItems/POSProductSidebarItems.tsx +0 -332
  117. package/src/components/POSProductSidebarItems/POSProductSidebarItems.types.ts +0 -119
  118. package/src/components/POSProductSidebarItems/README.md +0 -198
  119. package/src/components/POSProductSidebarItems/icons.tsx +0 -21
  120. package/src/components/POSProductSidebarItems/index.ts +0 -3
  121. package/src/components/POSTable/POSTable.stories.tsx +0 -737
  122. package/src/components/POSTable/POSTable.tsx +0 -401
  123. package/src/components/POSTable/POSTable.types.ts +0 -83
  124. package/src/components/POSTable/README.md +0 -286
  125. package/src/components/POSTable/index.ts +0 -7
  126. package/src/components/Pagination/Pagination.stories.tsx +0 -555
  127. package/src/components/Pagination/Pagination.tsx +0 -286
  128. package/src/components/Pagination/Pagination.types.ts +0 -93
  129. package/src/components/Pagination/README.md +0 -298
  130. package/src/components/Pagination/icons.tsx +0 -47
  131. package/src/components/Pagination/index.ts +0 -3
  132. package/src/components/Quantity/Quantity.stories.tsx +0 -457
  133. package/src/components/Quantity/Quantity.tsx +0 -289
  134. package/src/components/Quantity/Quantity.types.ts +0 -70
  135. package/src/components/Radio/Radio.stories.tsx +0 -523
  136. package/src/components/Radio/Radio.tsx +0 -170
  137. package/src/components/Radio/Radio.types.ts +0 -122
  138. package/src/components/Select/README.md +0 -299
  139. package/src/components/Select/Select.stories.tsx +0 -673
  140. package/src/components/Select/Select.tsx +0 -454
  141. package/src/components/Select/Select.types.ts +0 -148
  142. package/src/components/Select/icons.tsx +0 -50
  143. package/src/components/Select/index.ts +0 -3
  144. package/src/components/SignUpView/SignUpView.stories.tsx +0 -129
  145. package/src/components/SignUpView/SignUpView.tsx +0 -503
  146. package/src/components/SignUpView/SignUpView.types.ts +0 -58
  147. package/src/components/SignUpView/icons.tsx +0 -71
  148. package/src/components/SignUpView/index.ts +0 -3
  149. package/src/components/Switch/README.md +0 -112
  150. package/src/components/Switch/Switch.stories.tsx +0 -550
  151. package/src/components/Switch/Switch.tsx +0 -246
  152. package/src/components/Switch/Switch.types.ts +0 -67
  153. package/src/components/Table/README.md +0 -369
  154. package/src/components/Table/Table.stories.tsx +0 -805
  155. package/src/components/Table/Table.tsx +0 -688
  156. package/src/components/Table/Table.types.ts +0 -204
  157. package/src/components/Table/index.ts +0 -9
  158. package/src/components/Tabs/README.md +0 -201
  159. package/src/components/Tabs/Tabs.stories.tsx +0 -580
  160. package/src/components/Tabs/Tabs.tsx +0 -356
  161. package/src/components/Tabs/Tabs.types.ts +0 -127
  162. package/src/components/Tabs/icons.tsx +0 -129
  163. package/src/components/Tabs/index.ts +0 -11
  164. package/src/components/Textarea/Textarea.stories.tsx +0 -535
  165. package/src/components/Textarea/Textarea.tsx +0 -188
  166. package/src/components/Textarea/Textarea.types.ts +0 -54
  167. package/src/context/ThemeContext.tsx +0 -99
  168. package/src/context/index.ts +0 -1
  169. package/src/index.css +0 -29
  170. package/src/index.ts +0 -39
  171. package/src/main.tsx +0 -10
  172. package/src/views/ProductsView/ProductsView.stories.tsx +0 -344
  173. package/src/views/ProductsView/ProductsView.tsx +0 -480
  174. package/src/views/ProductsView/ProductsView.types.ts +0 -238
  175. package/src/views/ProductsView/README.md +0 -312
  176. package/src/views/ProductsView/icons.tsx +0 -38
  177. package/src/views/ProductsView/index.ts +0 -8
  178. package/src/views/RecoverPasswordView/README.md +0 -269
  179. package/src/views/RecoverPasswordView/RecoverPasswordView.stories.tsx +0 -131
  180. package/src/views/RecoverPasswordView/RecoverPasswordView.tsx +0 -376
  181. package/src/views/RecoverPasswordView/RecoverPasswordView.types.ts +0 -56
  182. package/src/views/RecoverPasswordView/icons.tsx +0 -17
  183. package/src/views/RecoverPasswordView/index.ts +0 -2
  184. package/src/views/TableLayoutView/README.md +0 -268
  185. package/src/views/TableLayoutView/TableLayoutView.stories.tsx +0 -235
  186. package/src/views/TableLayoutView/TableLayoutView.tsx +0 -461
  187. package/src/views/TableLayoutView/TableLayoutView.types.ts +0 -209
  188. package/src/views/TableLayoutView/icons.tsx +0 -113
  189. package/src/views/TableLayoutView/index.ts +0 -6
  190. package/storybook/main.ts +0 -20
  191. package/storybook/preview.tsx +0 -84
  192. package/storybook/vitest.setup.ts +0 -7
  193. package/tailwind.config.js +0 -128
  194. /package/{public → dist}/,Business Logo.png +0 -0
  195. /package/{public → dist}/.Siesa Logo.png +0 -0
  196. /package/{public → dist}/bg_siesa.png +0 -0
  197. /package/{public → dist}/siesa_logo_mobile.png +0 -0
  198. /package/{public → dist}/vite.svg +0 -0
package/docs/filters.md DELETED
@@ -1,1243 +0,0 @@
1
- # Sistema de Filtros - Siesa UI Kit
2
-
3
- ## 📋 Tabla de Contenidos
4
-
5
- 1. [Introducción](#introducción)
6
- 2. [Blur (Desenfoque)](#blur-desenfoque)
7
- 3. [Backdrop Blur](#backdrop-blur)
8
- 4. [Guía de Uso](#guía-de-uso)
9
- 5. [Ejemplos de Código](#ejemplos-de-código)
10
- 6. [Mejores Prácticas](#mejores-prácticas)
11
- 7. [Dark Mode](#dark-mode)
12
- 8. [Referencia Rápida](#referencia-rápida)
13
-
14
- ---
15
-
16
- ## Introducción
17
-
18
- El sistema de filtros de Siesa UI Kit proporciona efectos de desenfoque (blur) para crear profundidad visual y enfatizar contenido. Los filtros son especialmente útiles para overlays, modales y efectos glassmorphism modernos.
19
-
20
- ### Objetivos del Sistema
21
-
22
- - **Enfoque Visual**: Dirigir la atención del usuario desenfocando contenido secundario
23
- - **Efectos Modernos**: Crear interfaces con glassmorphism y efectos de vidrio esmerilado
24
- - **Jerarquía**: Establecer capas visuales claras
25
- - **Performance**: Valores optimizados para rendimiento en navegadores modernos
26
-
27
- ### Principios de Diseño
28
-
29
- 1. **Usar con Moderación**: El blur es costoso en performance, usar solo cuando aporte valor
30
- 2. **Progresión Suave**: Escalas progresivas desde desenfoque sutil hasta intenso
31
- 3. **Backdrop para Overlays**: Usar backdrop-blur para modales y overlays semi-transparentes
32
- 4. **Blur para Efectos**: Usar blur regular para desenfocar contenido completo
33
-
34
- ---
35
-
36
- ## Blur (Desenfoque)
37
-
38
- El filtro `blur` aplica desenfoque a todo el elemento, incluyendo su contenido y bordes.
39
-
40
- ### Escala de Blur
41
-
42
- | Clase Tailwind | Valor CSS | Blur Radius | Uso Principal |
43
- |----------------|-----------|-------------|---------------|
44
- | `blur-none` | `filter: blur(0px)` | 0px | Sin desenfoque |
45
- | `blur-sm` | `filter: blur(2px)` | 2px | Desenfoque mínimo |
46
- | `blur` o `blur-base` | `filter: blur(4px)` | 4px | **Desenfoque sutil** |
47
- | `blur-md` | `filter: blur(6px)` | 6px | Desenfoque medio-bajo |
48
- | `blur-lg` | `filter: blur(8px)` | 8px | **Desenfoque medio** |
49
- | `blur-xl` | `filter: blur(12px)` | 12px | Desenfoque alto |
50
- | `blur-2xl` | `filter: blur(20px)` | 20px | Desenfoque muy alto |
51
- | `blur-3xl` | `filter: blur(32px)` | 32px | Desenfoque máximo |
52
-
53
- ### Cuándo Usar Blur
54
-
55
- ```tsx
56
- // ✅ Imágenes de fondo
57
- <div className="blur-lg">
58
- <img src="/background.jpg" alt="Background" />
59
- </div>
60
-
61
- // ✅ Placeholders de carga
62
- <div className="blur-md animate-pulse">
63
- Loading content...
64
- </div>
65
-
66
- // ✅ Contenido spoiler
67
- <div className={revealed ? 'blur-none' : 'blur-xl'}>
68
- Spoiler content
69
- </div>
70
- ```
71
-
72
- ### Valores Más Comunes
73
-
74
- - **`blur` (4px)**: Desenfoque sutil para fondos
75
- - **`blur-lg` (8px)**: Desenfoque medio para overlays
76
- - **`blur-xl` (12px)**: Desenfoque alto para efectos dramáticos
77
-
78
- ---
79
-
80
- ## Backdrop Blur
81
-
82
- El filtro `backdrop-blur` aplica desenfoque **solo al fondo** detrás del elemento, no al contenido del elemento. Es ideal para overlays semi-transparentes.
83
-
84
- ### Escala de Backdrop Blur
85
-
86
- | Clase Tailwind | Valor CSS | Blur Radius | Uso Principal |
87
- |----------------|-----------|-------------|---------------|
88
- | `backdrop-blur-none` | `backdrop-filter: blur(0px)` | 0px | Sin desenfoque de fondo |
89
- | `backdrop-blur-sm` | `backdrop-filter: blur(2px)` | 2px | Glassmorphism sutil |
90
- | `backdrop-blur` o `backdrop-blur-base` | `backdrop-filter: blur(4px)` | 4px | **Glassmorphism estándar** |
91
- | `backdrop-blur-md` | `backdrop-filter: blur(6px)` | 6px | Overlay medio |
92
- | `backdrop-blur-lg` | `backdrop-filter: blur(8px)` | 8px | **Overlay modal** |
93
- | `backdrop-blur-xl` | `backdrop-filter: blur(12px)` | 12px | Overlay intenso |
94
- | `backdrop-blur-2xl` | `backdrop-filter: blur(20px)` | 20px | Efecto de vidrio esmerilado |
95
- | `backdrop-blur-3xl` | `backdrop-filter: blur(32px)` | 32px | Efecto máximo |
96
-
97
- ### Cuándo Usar Backdrop Blur
98
-
99
- ```tsx
100
- // ✅ Modal overlays
101
- <div className="backdrop-blur-lg bg-black/50">
102
- <div className="modal-content">...</div>
103
- </div>
104
-
105
- // ✅ Glassmorphism cards
106
- <div className="backdrop-blur-md bg-white/30 rounded-2xl">
107
- Card content visible, background blurred
108
- </div>
109
-
110
- // ✅ Navigation bars semi-transparentes
111
- <nav className="backdrop-blur-sm bg-white/80 sticky top-0">
112
- Navigation items
113
- </nav>
114
- ```
115
-
116
- ### Valores Más Comunes
117
-
118
- - **`backdrop-blur` (4px)**: Glassmorphism sutil
119
- - **`backdrop-blur-lg` (8px)**: Overlays de modales
120
- - **`backdrop-blur-xl` (12px)**: Efectos de vidrio intensos
121
-
122
- ### Diferencia entre Blur y Backdrop Blur
123
-
124
- ```tsx
125
- // blur - Desenfoca TODO el elemento
126
- <div className="blur-lg bg-white/50">
127
- <p>Este texto está desenfocado ❌</p>
128
- </div>
129
-
130
- // backdrop-blur - Solo desenfoca el FONDO
131
- <div className="backdrop-blur-lg bg-white/50">
132
- <p>Este texto está nítido ✅</p>
133
- </div>
134
- ```
135
-
136
- ---
137
-
138
- ## Guía de Uso
139
-
140
- ### Por Caso de Uso
141
-
142
- #### 1. Overlays de Modales
143
-
144
- ```tsx
145
- // Overlay con backdrop-blur
146
- <div className="fixed inset-0 backdrop-blur-lg bg-black/50 flex items-center justify-center">
147
- {/* Modal content */}
148
- <div className="rounded-3xl bg-white shadow-xl p-8">
149
- <h2>Modal Title</h2>
150
- <p>Modal content is clear, background is blurred</p>
151
- </div>
152
- </div>
153
- ```
154
-
155
- **Recomendación**: `backdrop-blur-lg` + `bg-black/50` para overlays oscuros
156
-
157
- #### 2. Glassmorphism Cards
158
-
159
- ```tsx
160
- // Card con efecto de vidrio
161
- <div className="backdrop-blur-md bg-white/30 border border-white/50 rounded-2xl p-6 shadow-xl">
162
- <h3 className="font-bold text-lg">Glassmorphism Card</h3>
163
- <p>Content is visible, background behind card is blurred</p>
164
- </div>
165
- ```
166
-
167
- **Recomendación**: `backdrop-blur-md` + `bg-white/30` para efecto de vidrio
168
-
169
- #### 3. Navigation Bar Flotante
170
-
171
- ```tsx
172
- // Navbar que desenfoca el fondo mientras se desplaza
173
- <nav className="sticky top-0 z-50 backdrop-blur-sm bg-white/80 border-b border-border-primary">
174
- <div className="container mx-auto px-6 py-4">
175
- <ul className="flex gap-6">
176
- <li>Home</li>
177
- <li>About</li>
178
- <li>Contact</li>
179
- </ul>
180
- </div>
181
- </nav>
182
- ```
183
-
184
- **Recomendación**: `backdrop-blur-sm` + `bg-white/80` para navbars
185
-
186
- #### 4. Loading States
187
-
188
- ```tsx
189
- // Skeleton con blur mientras carga
190
- <div className={isLoading ? 'blur-md animate-pulse' : 'blur-none'}>
191
- <img src={imageSrc} alt="Content" />
192
- <p>Content description</p>
193
- </div>
194
- ```
195
-
196
- **Recomendación**: `blur-md` para estados de carga
197
-
198
- #### 5. Spoiler/Hidden Content
199
-
200
- ```tsx
201
- // Contenido que se revela al hacer click
202
- const [revealed, setRevealed] = useState(false);
203
-
204
- <div
205
- onClick={() => setRevealed(true)}
206
- className={`cursor-pointer transition-all duration-300 ${
207
- revealed ? 'blur-none' : 'blur-xl'
208
- }`}
209
- >
210
- <p>Click to reveal spoiler content!</p>
211
- </div>
212
- ```
213
-
214
- **Recomendación**: `blur-xl` para contenido oculto, transición a `blur-none`
215
-
216
- #### 6. Imágenes de Fondo
217
-
218
- ```tsx
219
- // Hero section con imagen de fondo desenfocada
220
- <div className="relative h-screen">
221
- <div className="absolute inset-0 blur-2xl opacity-50">
222
- <img src="/hero-bg.jpg" alt="" className="w-full h-full object-cover" />
223
- </div>
224
- <div className="relative z-10 flex items-center justify-center h-full">
225
- <h1 className="text-6xl font-bold text-white">
226
- Hero Title
227
- </h1>
228
- </div>
229
- </div>
230
- ```
231
-
232
- **Recomendación**: `blur-2xl` + `opacity-50` para fondos decorativos
233
-
234
- ---
235
-
236
- ## Ejemplos de Código
237
-
238
- ### Ejemplo 1: Modal con Backdrop Blur
239
-
240
- ```tsx
241
- export const GlassModal = ({ isOpen, onClose, children }) => {
242
- if (!isOpen) return null;
243
-
244
- return (
245
- <div className="fixed inset-0 z-50 flex items-center justify-center p-4">
246
- {/* Overlay con backdrop-blur */}
247
- <div
248
- className="absolute inset-0 backdrop-blur-lg bg-black/50 transition-all"
249
- onClick={onClose}
250
- />
251
-
252
- {/* Modal content - nítido */}
253
- <div className="relative z-10 rounded-3xl bg-white shadow-2xl max-w-2xl w-full">
254
- {/* Header */}
255
- <div className="flex items-center justify-between p-6 border-b border-border-primary">
256
- <h2 className="text-2xl font-bold">Modal con Backdrop Blur</h2>
257
- <button
258
- onClick={onClose}
259
- className="rounded-full hover:bg-gray-100 p-2"
260
- >
261
- <XIcon />
262
- </button>
263
- </div>
264
-
265
- {/* Body */}
266
- <div className="p-6">
267
- {children}
268
- </div>
269
-
270
- {/* Footer */}
271
- <div className="flex gap-3 justify-end p-6 border-t border-border-primary">
272
- <button
273
- onClick={onClose}
274
- className="rounded-md border border-border-primary px-4 py-2 font-bold"
275
- >
276
- Cancelar
277
- </button>
278
- <button className="rounded-md bg-primary-custom-600 text-white px-4 py-2 font-bold">
279
- Confirmar
280
- </button>
281
- </div>
282
- </div>
283
- </div>
284
- );
285
- };
286
- ```
287
-
288
- ### Ejemplo 2: Glassmorphism Card Grid
289
-
290
- ```tsx
291
- export const GlassCardGrid = () => {
292
- const cards = [
293
- { title: 'Analytics', value: '1,234', icon: <ChartIcon /> },
294
- { title: 'Users', value: '5,678', icon: <UserIcon /> },
295
- { title: 'Revenue', value: '$12.5k', icon: <DollarIcon /> },
296
- ];
297
-
298
- return (
299
- <div
300
- className="min-h-screen p-8"
301
- style={{
302
- backgroundImage: 'url(/gradient-bg.jpg)',
303
- backgroundSize: 'cover',
304
- }}
305
- >
306
- <div className="grid grid-cols-3 gap-6">
307
- {cards.map((card) => (
308
- <div
309
- key={card.title}
310
- className="backdrop-blur-md bg-white/30 border border-white/50 rounded-2xl p-6 shadow-xl hover:bg-white/40 transition-all"
311
- >
312
- <div className="flex items-center gap-4 mb-4">
313
- <div className="w-12 h-12 rounded-full bg-primary-custom-600/20 flex items-center justify-center">
314
- {card.icon}
315
- </div>
316
- <h3 className="font-bold text-lg">{card.title}</h3>
317
- </div>
318
- <p className="text-4xl font-bold">{card.value}</p>
319
- </div>
320
- ))}
321
- </div>
322
- </div>
323
- );
324
- };
325
- ```
326
-
327
- ### Ejemplo 3: Floating Navigation Bar
328
-
329
- ```tsx
330
- export const FloatingNav = () => {
331
- const [scrolled, setScrolled] = useState(false);
332
-
333
- useEffect(() => {
334
- const handleScroll = () => {
335
- setScrolled(window.scrollY > 50);
336
- };
337
-
338
- window.addEventListener('scroll', handleScroll);
339
- return () => window.removeEventListener('scroll', handleScroll);
340
- }, []);
341
-
342
- return (
343
- <nav
344
- className={`sticky top-0 z-50 transition-all duration-300 ${
345
- scrolled
346
- ? 'backdrop-blur-md bg-white/80 shadow-md'
347
- : 'bg-transparent'
348
- }`}
349
- >
350
- <div className="container mx-auto px-6 py-4">
351
- <div className="flex items-center justify-between">
352
- <div className="font-bold text-xl">Logo</div>
353
- <ul className="flex gap-6 font-bold">
354
- <li>
355
- <a href="#home" className="hover:text-primary-custom-600">
356
- Home
357
- </a>
358
- </li>
359
- <li>
360
- <a href="#about" className="hover:text-primary-custom-600">
361
- About
362
- </a>
363
- </li>
364
- <li>
365
- <a href="#contact" className="hover:text-primary-custom-600">
366
- Contact
367
- </a>
368
- </li>
369
- </ul>
370
- </div>
371
- </div>
372
- </nav>
373
- );
374
- };
375
- ```
376
-
377
- ### Ejemplo 4: Image Gallery con Blur Hover
378
-
379
- ```tsx
380
- export const BlurImageGallery = ({ images }) => {
381
- return (
382
- <div className="grid grid-cols-4 gap-4 p-8">
383
- {images.map((image, index) => (
384
- <div
385
- key={index}
386
- className="group relative aspect-square overflow-hidden rounded-xl cursor-pointer"
387
- >
388
- {/* Imagen */}
389
- <img
390
- src={image.src}
391
- alt={image.alt}
392
- className="w-full h-full object-cover transition-all duration-300 group-hover:blur-sm group-hover:scale-110"
393
- />
394
-
395
- {/* Overlay que aparece en hover */}
396
- <div className="absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity bg-black/30 backdrop-blur-none">
397
- <button className="rounded-md bg-white px-4 py-2 font-bold shadow-lg">
398
- Ver Detalles
399
- </button>
400
- </div>
401
- </div>
402
- ))}
403
- </div>
404
- );
405
- };
406
- ```
407
-
408
- ### Ejemplo 5: Loading Skeleton con Blur
409
-
410
- ```tsx
411
- export const ContentLoader = ({ isLoading, children }) => {
412
- return (
413
- <div className="relative">
414
- {/* Contenido real */}
415
- <div
416
- className={`transition-all duration-500 ${
417
- isLoading ? 'blur-md opacity-50' : 'blur-none opacity-100'
418
- }`}
419
- >
420
- {children}
421
- </div>
422
-
423
- {/* Indicador de carga */}
424
- {isLoading && (
425
- <div className="absolute inset-0 flex items-center justify-center">
426
- <div className="rounded-full bg-white p-4 shadow-lg">
427
- <div className="animate-spin w-8 h-8 border-4 border-primary-custom-600 border-t-transparent rounded-full" />
428
- </div>
429
- </div>
430
- )}
431
- </div>
432
- );
433
- };
434
-
435
- // Uso
436
- <ContentLoader isLoading={isLoading}>
437
- <div className="space-y-4">
438
- <h2 className="text-2xl font-bold">Article Title</h2>
439
- <p>Article content...</p>
440
- </div>
441
- </ContentLoader>
442
- ```
443
-
444
- ---
445
-
446
- ## Mejores Prácticas
447
-
448
- ### ✅ Hacer
449
-
450
- 1. **Usar backdrop-blur para overlays**
451
- ```tsx
452
- // ✅ CORRECTO - backdrop-blur mantiene el contenido nítido
453
- <div className="backdrop-blur-lg bg-black/50">
454
- <p className="text-white">Texto nítido</p>
455
- </div>
456
- ```
457
-
458
- 2. **Combinar con opacidad para mejores efectos**
459
- ```tsx
460
- // ✅ CORRECTO - backdrop-blur + opacidad
461
- <div className="backdrop-blur-md bg-white/30 border border-white/50">
462
- Glassmorphism effect
463
- </div>
464
- ```
465
-
466
- 3. **Usar transiciones para cambios suaves**
467
- ```tsx
468
- // ✅ CORRECTO - transición suave
469
- <div className={`transition-all duration-300 ${blur ? 'blur-xl' : 'blur-none'}`}>
470
- Content
471
- </div>
472
- ```
473
-
474
- 4. **Optimizar performance con will-change**
475
- ```tsx
476
- // ✅ CORRECTO - optimización para animaciones
477
- <div className="backdrop-blur-lg" style={{ willChange: 'backdrop-filter' }}>
478
- Optimized blur
479
- </div>
480
- ```
481
-
482
- 5. **Usar valores moderados por defecto**
483
- ```tsx
484
- // ✅ CORRECTO - blur moderado
485
- <div className="backdrop-blur-md">Modal overlay</div>
486
- ```
487
-
488
- ### ❌ Evitar
489
-
490
- 1. **No usar blur regular para overlays**
491
- ```tsx
492
- // ❌ INCORRECTO - blur desenfoca el contenido también
493
- <div className="blur-lg bg-black/50">
494
- <p>Texto desenfocado (no legible) ❌</p>
495
- </div>
496
-
497
- // ✅ CORRECTO - backdrop-blur solo desenfoca el fondo
498
- <div className="backdrop-blur-lg bg-black/50">
499
- <p>Texto nítido (legible) ✅</p>
500
- </div>
501
- ```
502
-
503
- 2. **No aplicar blur muy alto a elementos interactivos**
504
- ```tsx
505
- // ❌ INCORRECTO - botón ilegible
506
- <button className="blur-2xl">Click me</button>
507
-
508
- // ✅ CORRECTO - botón nítido
509
- <button className="backdrop-blur-md bg-white/30">Click me</button>
510
- ```
511
-
512
- 3. **No apilar múltiples blurs innecesariamente**
513
- ```tsx
514
- // ❌ INCORRECTO - performance cost alto
515
- <div className="backdrop-blur-lg">
516
- <div className="backdrop-blur-lg">
517
- <div className="backdrop-blur-lg">Content</div>
518
- </div>
519
- </div>
520
-
521
- // ✅ CORRECTO - un solo blur en el nivel apropiado
522
- <div className="backdrop-blur-lg">
523
- <div>
524
- <div>Content</div>
525
- </div>
526
- </div>
527
- ```
528
-
529
- 4. **No usar blur sin opacidad en fondos**
530
- ```tsx
531
- // ❌ INCORRECTO - blur sin ver el fondo
532
- <div className="backdrop-blur-lg bg-white">
533
- No se ve el efecto de blur
534
- </div>
535
-
536
- // ✅ CORRECTO - blur con transparencia
537
- <div className="backdrop-blur-lg bg-white/30">
538
- Se ve el efecto de blur
539
- </div>
540
- ```
541
-
542
- 5. **No olvidar fallbacks para navegadores antiguos**
543
- ```tsx
544
- // ❌ INCORRECTO - sin fallback
545
- <div className="backdrop-blur-lg bg-white/30">
546
- Content
547
- </div>
548
-
549
- // ✅ CORRECTO - con fallback
550
- <div className="backdrop-blur-lg bg-white/30 supports-[backdrop-filter]:bg-white/30 supports-[not_backdrop-filter]:bg-white/80">
551
- Content
552
- </div>
553
- ```
554
-
555
- ### Performance
556
-
557
- 1. **Backdrop-filter es costoso**: Usar con moderación
558
- 2. **Evitar blur en scroll**: Puede causar lag en móviles
559
- 3. **Usar will-change para animaciones**: Optimiza rendering
560
- 4. **Limitar áreas con blur**: No aplicar a toda la página
561
-
562
- ```tsx
563
- // ✅ BUENA PRÁCTICA - will-change para performance
564
- <div
565
- className="backdrop-blur-lg transition-all"
566
- style={{ willChange: 'backdrop-filter' }}
567
- >
568
- Animated blur
569
- </div>
570
- ```
571
-
572
- ### Accesibilidad
573
-
574
- 1. **No depender solo de blur para ocultar contenido sensible**
575
- - Usar blur + técnicas adicionales de ocultamiento
576
-
577
- 2. **Asegurar contraste suficiente**
578
- - El blur puede reducir el contraste del texto
579
-
580
- 3. **Proveer alternativas sin blur**
581
- - Algunos usuarios pueden tener problemas con efectos visuales
582
-
583
- ```tsx
584
- // ✅ CORRECTO - modo reducido de movimiento
585
- <div className={`
586
- ${prefersReducedMotion ? 'bg-black/80' : 'backdrop-blur-lg bg-black/50'}
587
- `}>
588
- Content
589
- </div>
590
- ```
591
-
592
- ---
593
-
594
- ## Dark Mode
595
-
596
- Los filtros de blur y backdrop-blur funcionan de la misma manera en light y dark mode, pero es crucial combinarlos con colores y opacidades apropiadas para cada modo para mantener la legibilidad y la estética.
597
-
598
- ### Configuración de Tailwind CSS
599
-
600
- El modo oscuro en Siesa UI Kit se basa en la estrategia de clases de Tailwind CSS:
601
-
602
- ```javascript
603
- // tailwind.config.js
604
- module.exports = {
605
- darkMode: 'class', // ✅ Estrategia basada en clases (NO 'media')
606
- // ...resto de la configuración
607
- }
608
- ```
609
-
610
- Con esta configuración, el modo oscuro se activa añadiendo la clase `.dark` al elemento `<html>`:
611
-
612
- ```html
613
- <!-- Modo claro -->
614
- <html>
615
- <body>
616
- <!-- Contenido en modo claro -->
617
- </body>
618
- </html>
619
-
620
- <!-- Modo oscuro -->
621
- <html class="dark">
622
- <body>
623
- <!-- Contenido en modo oscuro -->
624
- </body>
625
- </html>
626
- ```
627
-
628
- ### El Modificador `dark:`
629
-
630
- El modificador `dark:` de Tailwind funciona como un **prefijo condicional** que aplica estilos solo cuando la clase `.dark` está presente en un elemento padre (típicamente `<html>`).
631
-
632
- #### Sintaxis Básica para Filtros
633
-
634
- ```tsx
635
- // Patrón básico - Backdrop blur con colores adaptativos
636
- <div className="backdrop-blur-lg bg-white/50 dark:bg-black/50 p-6">
637
- Glassmorphism adaptado a dark mode
638
- </div>
639
-
640
- // Los valores de blur NO cambian, pero los colores SÍ:
641
- // - bg-white/50 en modo claro → bg-black/50 en modo oscuro
642
- ```
643
-
644
- ### Principios de Filtros en Dark Mode
645
-
646
- **Regla de Oro**: Los valores de blur y backdrop-blur permanecen iguales, pero los colores de fondo y las opacidades deben adaptarse:
647
-
648
- ```tsx
649
- // ✅ CORRECTO - Backdrop blur con colores adaptativos
650
- <div className="backdrop-blur-lg bg-white/50 dark:bg-black/50">
651
- Glassmorphism adaptado a dark mode
652
- </div>
653
-
654
- // ✅ CORRECTO - Modal overlay con mayor opacidad en dark
655
- <div className="backdrop-blur-lg bg-black/50 dark:bg-black/70">
656
- Overlay con mayor opacidad en dark mode para mejor contraste
657
- </div>
658
-
659
- // ❌ INCORRECTO - Cambiar valor de blur en dark mode
660
- <div className="backdrop-blur-lg dark:backdrop-blur-sm">
661
- NO hacer esto - mantener blur consistente
662
- </div>
663
- ```
664
-
665
- ### Combinando Filtros con Estados Interactivos
666
-
667
- El modificador `dark:` se puede combinar con hover y otros estados:
668
-
669
- ```tsx
670
- // Dark mode + Hover
671
- <button className="
672
- backdrop-blur-md
673
- bg-white/30 dark:bg-white/10
674
- hover:bg-white/40 dark:hover:bg-white/20
675
- border border-white/50 dark:border-white/20
676
- rounded-md
677
- px-4 py-2
678
- ">
679
- Glass button con hover
680
- </button>
681
-
682
- // Dark mode + Focus
683
- <input className="
684
- backdrop-blur-sm
685
- bg-white/80 dark:bg-dark-bg-primary/80
686
- focus:backdrop-blur-md
687
- border border-border-primary dark:border-dark-border-primary
688
- rounded-md
689
- " />
690
- ```
691
-
692
- ### Orden de Modificadores
693
-
694
- Tailwind CSS recomienda un orden específico:
695
-
696
- **Formato**: `{responsive}:{dark}:{state}:{utility}`
697
-
698
- ```tsx
699
- // ✅ CORRECTO - Orden: responsive → dark → state → utility
700
- <div className="
701
- backdrop-blur-md
702
- md:backdrop-blur-lg
703
- bg-white/30
704
- md:dark:bg-white/10
705
- md:dark:hover:bg-white/20
706
- ">
707
- Card con orden correcto
708
- </div>
709
-
710
- // ❌ INCORRECTO - Orden equivocado
711
- <div className="
712
- dark:md:hover:bg-white/20
713
- backdrop-blur-md
714
- ">
715
- Orden confuso
716
- </div>
717
- ```
718
-
719
- ### Glassmorphism en Dark Mode
720
-
721
- El efecto glassmorphism necesita ajustes especiales para dark mode:
722
-
723
- ```tsx
724
- // Glassmorphism Card - Light Mode
725
- <div className="backdrop-blur-md bg-white/30 border border-white/50 rounded-2xl p-6">
726
- <h3 className="text-content-primary font-bold">Light Mode Glass</h3>
727
- <p className="text-content-secondary">Contenido con efecto de vidrio</p>
728
- </div>
729
-
730
- // Glassmorphism Card - Dark Mode adaptado
731
- <div className="backdrop-blur-md bg-white/30 dark:bg-white/10 border border-white/50 dark:border-white/20 rounded-2xl p-6">
732
- <h3 className="text-content-primary dark:text-dark-content-primary font-bold">
733
- Adaptive Glass
734
- </h3>
735
- <p className="text-content-secondary dark:text-content-secondary">
736
- Efecto de vidrio que se adapta
737
- </p>
738
- </div>
739
- ```
740
-
741
- ### Ejemplos de Componentes con Filtros en Dark Mode
742
-
743
- #### 1. Modal con Backdrop Blur Adaptado
744
-
745
- ```tsx
746
- export const ModalDarkModeBlur = ({ isOpen, onClose, children }) => {
747
- if (!isOpen) return null;
748
-
749
- return (
750
- <div className="fixed inset-0 z-50 flex items-center justify-center p-4">
751
- {/* Overlay adaptado - más opaco en dark mode */}
752
- <div
753
- className="absolute inset-0 backdrop-blur-lg bg-black/50 dark:bg-black/70 transition-all"
754
- onClick={onClose}
755
- />
756
-
757
- {/* Modal content */}
758
- <div className="relative z-10 rounded-3xl bg-white dark:bg-dark-bg-primary shadow-2xl max-w-2xl w-full">
759
- <div className="flex items-center justify-between p-6 border-b border-border-primary dark:border-dark-border-primary">
760
- <h2 className="text-content-primary dark:text-dark-content-primary text-2xl font-bold">
761
- Modal Title
762
- </h2>
763
- <button
764
- onClick={onClose}
765
- className="rounded-full hover:bg-background-secondary dark:hover:bg-dark-bg-primary p-2"
766
- >
767
- <XIcon />
768
- </button>
769
- </div>
770
-
771
- <div className="p-6">
772
- <div className="text-content-primary dark:text-dark-content-primary">
773
- {children}
774
- </div>
775
- </div>
776
-
777
- <div className="flex gap-3 justify-end p-6 border-t border-border-primary dark:border-dark-border-primary">
778
- <button
779
- onClick={onClose}
780
- className="rounded-md border border-border-primary dark:border-dark-border-custom px-4 py-2 font-bold text-content-primary dark:text-dark-content-primary"
781
- >
782
- Cancelar
783
- </button>
784
- <button className="rounded-md bg-primary-custom-600 dark:bg-dark-bg-inverse text-primary-inverse-content dark:text-dark-content-inverse px-4 py-2 font-bold">
785
- Confirmar
786
- </button>
787
- </div>
788
- </div>
789
- </div>
790
- );
791
- };
792
- ```
793
-
794
- #### 2. Glassmorphism Navigation Bar
795
-
796
- ```tsx
797
- export const GlassNavDarkMode = () => {
798
- const [scrolled, setScrolled] = useState(false);
799
-
800
- useEffect(() => {
801
- const handleScroll = () => {
802
- setScrolled(window.scrollY > 50);
803
- };
804
-
805
- window.addEventListener('scroll', handleScroll);
806
- return () => window.removeEventListener('scroll', handleScroll);
807
- }, []);
808
-
809
- return (
810
- <nav
811
- className={`sticky top-0 z-50 transition-all duration-300 ${
812
- scrolled
813
- ? 'backdrop-blur-md bg-white/80 dark:bg-dark-bg-primary/80 shadow-md'
814
- : 'bg-transparent'
815
- }`}
816
- >
817
- <div className="container mx-auto px-6 py-4">
818
- <div className="flex items-center justify-between">
819
- <div className="font-bold text-xl text-content-primary dark:text-dark-content-primary">
820
- Logo
821
- </div>
822
- <ul className="flex gap-6 font-bold text-content-primary dark:text-dark-content-primary">
823
- <li>
824
- <a href="#home" className="hover:text-primary-custom-600 dark:hover:text-dark-content-primary">
825
- Home
826
- </a>
827
- </li>
828
- <li>
829
- <a href="#about" className="hover:text-primary-custom-600 dark:hover:text-dark-content-primary">
830
- About
831
- </a>
832
- </li>
833
- <li>
834
- <a href="#contact" className="hover:text-primary-custom-600 dark:hover:text-dark-content-primary">
835
- Contact
836
- </a>
837
- </li>
838
- </ul>
839
- </div>
840
- </div>
841
- </nav>
842
- );
843
- };
844
- ```
845
-
846
- #### 3. Glassmorphism Card Grid
847
-
848
- ```tsx
849
- export const GlassCardGridDarkMode = () => {
850
- const cards = [
851
- { id: 1, title: 'Analytics', value: '1,234', icon: '📊' },
852
- { id: 2, title: 'Users', value: '5,678', icon: '👥' },
853
- { id: 3, title: 'Revenue', value: '$12.5k', icon: '💰' },
854
- ];
855
-
856
- return (
857
- <div
858
- className="min-h-screen p-8 bg-gradient-to-br from-primary-custom-600 to-purple-600 dark:from-dark-bg-primary dark:to-gray-900"
859
- style={{
860
- backgroundImage: 'url(/gradient-bg.jpg)',
861
- backgroundSize: 'cover',
862
- }}
863
- >
864
- <div className="grid grid-cols-3 gap-6">
865
- {cards.map((card) => (
866
- <div
867
- key={card.id}
868
- className="backdrop-blur-md bg-white/30 dark:bg-white/10 border border-white/50 dark:border-white/20 rounded-2xl p-6 shadow-xl hover:bg-white/40 dark:hover:bg-white/15 transition-all"
869
- >
870
- <div className="flex items-center gap-4 mb-4">
871
- <div className="w-12 h-12 rounded-full bg-primary-custom-600/20 dark:bg-white/10 flex items-center justify-center text-2xl">
872
- {card.icon}
873
- </div>
874
- <h3 className="font-bold text-lg text-content-primary dark:text-white">
875
- {card.title}
876
- </h3>
877
- </div>
878
- <p className="text-4xl font-bold text-content-primary dark:text-white">
879
- {card.value}
880
- </p>
881
- </div>
882
- ))}
883
- </div>
884
- </div>
885
- );
886
- };
887
- ```
888
-
889
- #### 4. Loading State con Blur
890
-
891
- ```tsx
892
- export const ContentLoaderDarkMode = ({ isLoading, children }) => {
893
- return (
894
- <div className="relative">
895
- {/* Contenido real */}
896
- <div
897
- className={`transition-all duration-500 ${
898
- isLoading
899
- ? 'blur-md opacity-50'
900
- : 'blur-none opacity-100'
901
- }`}
902
- >
903
- <div className="text-content-primary dark:text-dark-content-primary">
904
- {children}
905
- </div>
906
- </div>
907
-
908
- {/* Indicador de carga */}
909
- {isLoading && (
910
- <div className="absolute inset-0 flex items-center justify-center">
911
- <div className="rounded-full bg-white dark:bg-dark-bg-primary border border-border-primary dark:border-dark-border-primary p-4 shadow-lg">
912
- <div className="animate-spin w-8 h-8 border-4 border-primary-custom-600 dark:border-dark-content-primary border-t-transparent rounded-full" />
913
- </div>
914
- </div>
915
- )}
916
- </div>
917
- );
918
- };
919
- ```
920
-
921
- ### Mejores Prácticas para Filtros en Dark Mode
922
-
923
- #### 1. Ajustar Opacidades para Mejor Contraste
924
-
925
- ```tsx
926
- // ✅ CORRECTO - Opacidad mayor en dark mode para mantener contraste
927
- <div className="backdrop-blur-lg bg-white/50 dark:bg-black/70">
928
- Overlay con buen contraste en ambos modos
929
- </div>
930
-
931
- // ❌ INCORRECTO - Misma opacidad en ambos modos
932
- <div className="backdrop-blur-lg bg-black/50">
933
- Puede verse mal en dark mode
934
- </div>
935
- ```
936
-
937
- #### 2. Glassmorphism Adaptativo
938
-
939
- ```tsx
940
- // ✅ CORRECTO - Glassmorphism adaptado
941
- <div className="backdrop-blur-md bg-white/30 dark:bg-white/10 border border-white/50 dark:border-white/20">
942
- <h3 className="text-content-primary dark:text-white">Title</h3>
943
- </div>
944
-
945
- // ❌ INCORRECTO - No se adapta a dark mode
946
- <div className="backdrop-blur-md bg-white/30 border border-white/50">
947
- <h3 className="text-gray-900">Title</h3>
948
- </div>
949
- ```
950
-
951
- #### 3. Combinar con Colores de Texto Apropiados
952
-
953
- ```tsx
954
- // ✅ CORRECTO - Texto adaptado para mantener legibilidad sobre blur
955
- <div className="backdrop-blur-lg bg-black/50 dark:bg-black/70 rounded-2xl p-6">
956
- <h2 className="text-white font-bold text-2xl mb-2">
957
- Texto claramente legible
958
- </h2>
959
- <p className="text-white/80">
960
- Contenido secundario también legible
961
- </p>
962
- </div>
963
-
964
- // ✅ CORRECTO - Para glassmorphism, usar colores del sistema
965
- <div className="backdrop-blur-md bg-white/30 dark:bg-white/10 rounded-2xl p-6">
966
- <h3 className="text-content-primary dark:text-white font-bold">
967
- Título
968
- </h3>
969
- <p className="text-content-secondary dark:text-white/70">
970
- Descripción
971
- </p>
972
- </div>
973
- ```
974
-
975
- #### 4. Modal Overlays con Backdrop Blur
976
-
977
- ```tsx
978
- // ✅ CORRECTO - Overlay más oscuro en dark mode
979
- <div className="backdrop-blur-lg bg-black/50 dark:bg-black/70">
980
- Modal overlay adaptado
981
- </div>
982
-
983
- // Para overlays claros (menos común)
984
- <div className="backdrop-blur-lg bg-white/50 dark:bg-black/50">
985
- Overlay que cambia completamente en dark mode
986
- </div>
987
- ```
988
-
989
- ### Ejemplo Completo: Hero con Glassmorphism Adaptado
990
-
991
- ```tsx
992
- export const GlassHeroDarkMode = () => {
993
- return (
994
- <div
995
- className="relative min-h-screen flex items-center justify-center p-8 bg-gradient-to-br from-blue-500 to-purple-600 dark:from-gray-900 dark:to-black"
996
- style={{
997
- backgroundImage: 'url(/hero-bg.jpg)',
998
- backgroundSize: 'cover',
999
- backgroundPosition: 'center',
1000
- }}
1001
- >
1002
- {/* Glassmorphism card con contenido */}
1003
- <div className="backdrop-blur-xl bg-white/30 dark:bg-black/30 border border-white/50 dark:border-white/10 rounded-3xl p-12 max-w-3xl shadow-2xl">
1004
- {/* Title */}
1005
- <h1 className="text-white font-bold text-6xl tracking-tighter mb-6 text-center">
1006
- Bienvenido a Siesa UI Kit
1007
- </h1>
1008
-
1009
- {/* Description */}
1010
- <p className="text-white/90 text-xl mb-8 text-center max-w-2xl mx-auto">
1011
- Sistema de diseño moderno con soporte completo para glassmorphism
1012
- y dark mode. Crea interfaces hermosas que funcionan perfectamente
1013
- en cualquier entorno.
1014
- </p>
1015
-
1016
- {/* CTA buttons */}
1017
- <div className="flex gap-4 justify-center mb-8">
1018
- <button className="backdrop-blur-md bg-white/20 dark:bg-white/10 hover:bg-white/30 dark:hover:bg-white/20 border border-white/50 dark:border-white/30 text-white px-6 py-3 rounded-xl font-bold transition-all">
1019
- Comenzar
1020
- </button>
1021
- <button className="bg-white dark:bg-dark-bg-inverse text-primary-custom-600 dark:text-dark-content-inverse px-6 py-3 rounded-xl font-bold hover:bg-white/90 transition-all">
1022
- Documentación
1023
- </button>
1024
- </div>
1025
-
1026
- {/* Stats */}
1027
- <div className="grid grid-cols-3 gap-4 pt-8 border-t border-white/30 dark:border-white/10">
1028
- {[
1029
- { label: 'Components', value: '50+' },
1030
- { label: 'Themes', value: '2' },
1031
- { label: 'Icons', value: '1000+' },
1032
- ].map((stat) => (
1033
- <div key={stat.label} className="text-center">
1034
- <p className="text-white font-bold text-3xl mb-1">{stat.value}</p>
1035
- <p className="text-white/70 text-sm">{stat.label}</p>
1036
- </div>
1037
- ))}
1038
- </div>
1039
- </div>
1040
- </div>
1041
- );
1042
- };
1043
- ```
1044
-
1045
- ### Guía de Opacidades para Dark Mode
1046
-
1047
- Opacidades recomendadas para diferentes casos:
1048
-
1049
- | Caso de Uso | Light Mode | Dark Mode | Razón |
1050
- |-------------|------------|-----------|-------|
1051
- | **Modal Overlay** | `bg-black/50` | `bg-black/70` | Mayor opacidad para mejor contraste |
1052
- | **Glassmorphism Card** | `bg-white/30` | `bg-white/10` | Menos opacidad para evitar brillantez |
1053
- | **Glass Navigation** | `bg-white/80` | `bg-black/80` | Alta opacidad para legibilidad |
1054
- | **Glass Border** | `border-white/50` | `border-white/20` | Bordes más sutiles en dark mode |
1055
- | **Hover State** | `bg-white/40` | `bg-white/15` | Progresión proporcional |
1056
-
1057
- ### Recursos Adicionales sobre Dark Mode
1058
-
1059
- Para más información sobre el modo oscuro:
1060
- - Ver `docs/dark-mode-guide.md` - Guía completa de Dark Mode en Tailwind CSS
1061
- - Ver `docs/colors.md` - Sistema de colores completo con tokens dark mode
1062
- - Ver `docs/border-radius.md` - Border radius con ejemplos de dark mode
1063
- - Ver `docs/shadows.md` - Sombras adaptadas a dark mode
1064
- - Ver `docs/typography.md` - Sistema tipográfico adaptado a dark mode
1065
- - [Documentación oficial de Tailwind Dark Mode](https://tailwindcss.com/docs/dark-mode)
1066
-
1067
- ---
1068
-
1069
- ## Referencia Rápida
1070
-
1071
- ### Cheat Sheet: Por Caso de Uso
1072
-
1073
- ```tsx
1074
- // ===== OVERLAYS DE MODALES =====
1075
- <div className="backdrop-blur-lg bg-black/50">Modal</div>
1076
-
1077
- // ===== GLASSMORPHISM CARDS =====
1078
- <div className="backdrop-blur-md bg-white/30 border border-white/50">Glass Card</div>
1079
-
1080
- // ===== NAVIGATION BARS =====
1081
- <nav className="backdrop-blur-sm bg-white/80 sticky top-0">Nav</nav>
1082
-
1083
- // ===== LOADING STATES =====
1084
- <div className="blur-md animate-pulse">Loading...</div>
1085
-
1086
- // ===== SPOILER CONTENT =====
1087
- <div className={revealed ? 'blur-none' : 'blur-xl'}>Spoiler</div>
1088
-
1089
- // ===== BACKGROUND IMAGES =====
1090
- <div className="blur-2xl opacity-50">
1091
- <img src="/bg.jpg" />
1092
- </div>
1093
- ```
1094
-
1095
- ### Cheat Sheet: Todas las Escalas
1096
-
1097
- **Blur (desenfoca elemento completo)**
1098
- ```css
1099
- blur-none → blur(0px)
1100
- blur-sm → blur(2px)
1101
- blur → blur(4px) /* blur-base */
1102
- blur-md → blur(6px)
1103
- blur-lg → blur(8px)
1104
- blur-xl → blur(12px)
1105
- blur-2xl → blur(20px)
1106
- blur-3xl → blur(32px)
1107
- ```
1108
-
1109
- **Backdrop Blur (desenfoca solo el fondo)**
1110
- ```css
1111
- backdrop-blur-none → backdrop-filter: blur(0px)
1112
- backdrop-blur-sm → backdrop-filter: blur(2px)
1113
- backdrop-blur → backdrop-filter: blur(4px) /* backdrop-blur-base */
1114
- backdrop-blur-md → backdrop-filter: blur(6px)
1115
- backdrop-blur-lg → backdrop-filter: blur(8px)
1116
- backdrop-blur-xl → backdrop-filter: blur(12px)
1117
- backdrop-blur-2xl → backdrop-filter: blur(20px)
1118
- backdrop-blur-3xl → backdrop-filter: blur(32px)
1119
- ```
1120
-
1121
- ### Cheat Sheet: Combinaciones Comunes
1122
-
1123
- ```tsx
1124
- // Modal overlay oscuro
1125
- className="backdrop-blur-lg bg-black/50"
1126
-
1127
- // Modal overlay claro
1128
- className="backdrop-blur-lg bg-white/50"
1129
-
1130
- // Glass card oscuro
1131
- className="backdrop-blur-md bg-black/30 border border-white/20"
1132
-
1133
- // Glass card claro
1134
- className="backdrop-blur-md bg-white/30 border border-white/50"
1135
-
1136
- // Navbar flotante
1137
- className="backdrop-blur-sm bg-white/80"
1138
-
1139
- // Hero background
1140
- className="blur-2xl opacity-50"
1141
-
1142
- // Loading state
1143
- className="blur-md animate-pulse"
1144
-
1145
- // Spoiler hide
1146
- className="blur-xl"
1147
- ```
1148
-
1149
- ### Cheat Sheet: Transiciones
1150
-
1151
- ```tsx
1152
- // Transición básica de blur
1153
- <div className="blur-none hover:blur-md transition-all">...</div>
1154
-
1155
- // Transición con duración
1156
- <div className="blur-none hover:blur-lg transition-all duration-500">...</div>
1157
-
1158
- // Toggle blur con estado
1159
- <div className={`transition-all duration-300 ${isBlurred ? 'blur-xl' : 'blur-none'}`}>...</div>
1160
-
1161
- // Backdrop blur animado
1162
- <div className={`transition-all ${show ? 'backdrop-blur-lg' : 'backdrop-blur-none'}`}>...</div>
1163
- ```
1164
-
1165
- ---
1166
-
1167
- ## Recursos Adicionales
1168
-
1169
- ### Soporte de Navegadores
1170
-
1171
- **backdrop-filter** (Backdrop Blur):
1172
- - ✅ Chrome/Edge: 76+
1173
- - ✅ Firefox: 103+
1174
- - ✅ Safari: 9+ (con -webkit-prefix hasta v14)
1175
- - ❌ IE: No soportado
1176
-
1177
- **filter: blur** (Blur regular):
1178
- - ✅ Excelente soporte en todos los navegadores modernos
1179
- - ✅ IE: 10+ (con limitaciones)
1180
-
1181
- ### Fallbacks para Navegadores Antiguos
1182
-
1183
- ```tsx
1184
- // Con fallback para navegadores sin backdrop-filter
1185
- <div className="
1186
- backdrop-blur-lg
1187
- bg-white/30
1188
- [@supports(backdrop-filter:blur(0))]:bg-white/30
1189
- [@supports(not(backdrop-filter:blur(0)))]:bg-white/80
1190
- ">
1191
- Content con fallback
1192
- </div>
1193
- ```
1194
-
1195
- ### Enlaces Útiles
1196
-
1197
- - **CSS backdrop-filter**: https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter
1198
- - **CSS filter**: https://developer.mozilla.org/en-US/docs/Web/CSS/filter
1199
- - **Tailwind Blur**: https://tailwindcss.com/docs/blur
1200
- - **Tailwind Backdrop Blur**: https://tailwindcss.com/docs/backdrop-blur
1201
- - **Can I Use backdrop-filter**: https://caniuse.com/css-backdrop-filter
1202
-
1203
- ### Archivos Relacionados
1204
-
1205
- - `docs/shadows.md` - Sistema de sombras (se combina bien con blur)
1206
- - `docs/colors.md` - Sistema de colores (para fondos con opacidad)
1207
- - `docs/border-radius.md` - Border radius (para glassmorphism cards)
1208
-
1209
- ### Performance Tips
1210
-
1211
- ```tsx
1212
- // ✅ Optimizar con will-change
1213
- <div
1214
- className="backdrop-blur-lg"
1215
- style={{ willChange: 'backdrop-filter' }}
1216
- >
1217
- Optimized
1218
- </div>
1219
-
1220
- // ✅ Usar transform: translateZ para hardware acceleration
1221
- <div
1222
- className="backdrop-blur-lg"
1223
- style={{ transform: 'translateZ(0)' }}
1224
- >
1225
- Hardware accelerated
1226
- </div>
1227
-
1228
- // ✅ Limitar el área con blur
1229
- <div className="backdrop-blur-lg max-w-2xl">
1230
- Limited area
1231
- </div>
1232
-
1233
- // ❌ Evitar blur en toda la página
1234
- <body className="backdrop-blur-lg"> {/* No recomendado */}
1235
- ...
1236
- </body>
1237
- ```
1238
-
1239
- ---
1240
-
1241
- **Última actualización**: 2025-11-11
1242
- **Versión**: 1.0.0
1243
- **Mantenedor**: Siesa UI Kit Team