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
@@ -1,1268 +0,0 @@
1
- # Sistema de Tipografía - Siesa UI Kit
2
-
3
- ## 📋 Tabla de Contenidos
4
-
5
- 1. [Introducción](#introducción)
6
- 2. [Familia Tipográfica](#familia-tipográfica)
7
- 3. [Escala Tipográfica](#escala-tipográfica)
8
- 4. [Display](#display)
9
- 5. [Heading](#heading)
10
- 6. [Label](#label)
11
- 7. [Paragraph](#paragraph)
12
- 8. [Guía de Uso](#guía-de-uso)
13
- 9. [Pesos Tipográficos](#pesos-tipográficos)
14
- 10. [Ejemplos de Código](#ejemplos-de-código)
15
- 11. [Mejores Prácticas](#mejores-prácticas)
16
- 12. [Dark Mode](#dark-mode)
17
- 13. [Referencia Rápida](#referencia-rápida)
18
-
19
- ---
20
-
21
- ## Introducción
22
-
23
- El sistema tipográfico de Siesa UI Kit está diseñado para proporcionar una jerarquía visual clara y consistente en todas las interfaces. Utilizamos la familia tipográfica personalizada **SiesaBT** con un sistema de escalas bien definido que abarca desde títulos grandes hasta textos pequeños.
24
-
25
- ### Objetivos del Sistema Tipográfico
26
-
27
- - **Jerarquía Clara**: Escalas bien definidas para organizar la información
28
- - **Legibilidad**: Tamaños y alturas de línea optimizados para lectura
29
- - **Consistencia**: Uso uniforme de pesos y estilos en todo el sistema
30
- - **Flexibilidad**: Escalas adaptables para diferentes contextos
31
- - **Accesibilidad**: Cumplimiento de estándares WCAG para contraste y tamaño
32
-
33
- ### Principios de Diseño
34
-
35
- 1. **Escalas Semánticas**: Cada escala tiene un propósito claro (Display, Heading, Label, Paragraph)
36
- 2. **Proporciones Armónicas**: Progresión coherente entre tamaños
37
- 3. **Espaciado Vertical**: Line-height optimizado para cada tamaño
38
- 4. **Peso Apropiado**: Bold para títulos y labels, Regular para párrafos
39
-
40
- ---
41
-
42
- ## Familia Tipográfica
43
-
44
- ### SiesaBT
45
-
46
- **SiesaBT** es la familia tipográfica corporativa de Siesa, diseñada específicamente para reflejar la identidad de marca.
47
-
48
- #### Pesos Disponibles
49
-
50
- | Peso | Font-Weight | Archivo | Uso Principal |
51
- |------|-------------|---------|---------------|
52
- | **Light** | 300 | SiesaBT-Light.otf | Textos decorativos, énfasis suave |
53
- | **Regular** | 400 | SiesaBT-Regular.otf | **Párrafos, contenido principal** |
54
- | **Bold** | 700 | SiesaBT-Bold.otf | **Títulos, labels, botones** |
55
-
56
- #### Configuración
57
-
58
- ```css
59
- /* src/index.css */
60
- @font-face {
61
- font-family: 'SiesaBT';
62
- src: url('./assets/fonts/SiesaBT/SiesaBT-Regular.otf') format('opentype');
63
- font-weight: 400;
64
- font-style: normal;
65
- font-display: swap;
66
- }
67
-
68
- @font-face {
69
- font-family: 'SiesaBT';
70
- src: url('./assets/fonts/SiesaBT/SiesaBT-Light.otf') format('opentype');
71
- font-weight: 300;
72
- font-style: normal;
73
- font-display: swap;
74
- }
75
-
76
- @font-face {
77
- font-family: 'SiesaBT';
78
- src: url('./assets/fonts/SiesaBT/SiesaBT-Bold.otf') format('opentype');
79
- font-weight: 700;
80
- font-style: normal;
81
- font-display: swap;
82
- }
83
- ```
84
-
85
- ```javascript
86
- // tailwind.config.js
87
- fontFamily: {
88
- sans: ['SiesaBT', 'Inter', 'sans-serif'],
89
- }
90
- ```
91
-
92
- #### Fallbacks
93
-
94
- - **Primario**: SiesaBT
95
- - **Secundario**: Inter (sans-serif moderna)
96
- - **Terciario**: sans-serif (sistema)
97
-
98
- ---
99
-
100
- ## Escala Tipográfica
101
-
102
- El sistema tipográfico se organiza en **4 categorías semánticas** con **17 escalas totales**:
103
-
104
- | Categoría | Escalas | Peso | Letter Spacing | Uso |
105
- |-----------|---------|------|----------------|-----|
106
- | **Display** | 5 tamaños | Bold (700) | -2.5% | Heros, títulos muy grandes |
107
- | **Heading** | 4 tamaños | Bold (700) | -2.5% | Títulos de secciones |
108
- | **Label** | 4 tamaños | Bold (700) | 0% | Labels, botones, badges |
109
- | **Paragraph** | 4 tamaños | Regular (400) | 0% | Contenido, textos largos |
110
-
111
- ---
112
-
113
- ## Display
114
-
115
- **Uso**: Títulos hero, landing pages, banners principales, presentaciones impactantes.
116
-
117
- **Características**:
118
- - Font-weight: 700 (Bold)
119
- - Letter-spacing: -2.5% (tracking más cerrado)
120
- - Line-height: Igual al font-size (leading compacto)
121
-
122
- ### Escalas Display
123
-
124
- | Nombre | Tailwind Class | Font Size | Line Height | Tracking | Uso |
125
- |--------|---------------|-----------|-------------|----------|-----|
126
- | **Extra Large** | `text-9xl` | 128px (8rem) | 128px (8rem) | -2.5% | Máximo impacto |
127
- | **Large** | `text-8xl` | 96px (6rem) | 96px (6rem) | -2.5% | Hero sections |
128
- | **Medium** | `text-7xl` | 72px (4.5rem) | 72px (4.5rem) | -2.5% | Títulos grandes |
129
- | **Small** | `text-6xl` | 60px (3.75rem) | 60px (3.75rem) | -2.5% | Sub-heros |
130
- | **Tiny** | `text-5xl` | 48px (3rem) | 48px (3rem) | -2.5% | Títulos medianos |
131
-
132
- ### Código Display
133
-
134
- ```tsx
135
- // Extra Large Display
136
- <h1 className="text-9xl font-bold tracking-tighter">
137
- Bienvenido a Siesa
138
- </h1>
139
-
140
- // Large Display
141
- <h1 className="text-8xl font-bold tracking-tighter">
142
- Soluciones Empresariales
143
- </h1>
144
-
145
- // Medium Display
146
- <h2 className="text-7xl font-bold tracking-tighter">
147
- Innovación Digital
148
- </h2>
149
-
150
- // Small Display
151
- <h2 className="text-6xl font-bold tracking-tighter">
152
- Transformación
153
- </h2>
154
-
155
- // Tiny Display
156
- <h3 className="text-5xl font-bold tracking-tighter">
157
- Nuevas Funcionalidades
158
- </h3>
159
- ```
160
-
161
- ---
162
-
163
- ## Heading
164
-
165
- **Uso**: Títulos de secciones, encabezados de páginas, títulos de cards, subtítulos importantes.
166
-
167
- **Características**:
168
- - Font-weight: 700 (Bold)
169
- - Letter-spacing: -2.5% (tracking más cerrado)
170
- - Line-height: Mayor que font-size (mejor legibilidad)
171
-
172
- ### Escalas Heading
173
-
174
- | Nombre | Tailwind Class | Font Size | Line Height | Tracking | Uso |
175
- |--------|---------------|-----------|-------------|----------|-----|
176
- | **Large** | `text-4xl` | 36px (2.25rem) | 40px (2.5rem) | -2.5% | Títulos principales |
177
- | **Medium** | `text-3xl` | 30px (1.875rem) | 36px (2.25rem) | -2.5% | Títulos secundarios |
178
- | **Small** | `text-2xl` | 24px (1.5rem) | 32px (2rem) | -2.5% | Subtítulos |
179
- | **Tiny** | `text-xl` | 20px (1.25rem) | 28px (1.75rem) | -2.5% | Títulos pequeños |
180
-
181
- ### Código Heading
182
-
183
- ```tsx
184
- // Large Heading - Título de página
185
- <h1 className="text-4xl font-bold tracking-tighter">
186
- Panel de Control
187
- </h1>
188
-
189
- // Medium Heading - Título de sección
190
- <h2 className="text-3xl font-bold tracking-tighter">
191
- Estadísticas del Mes
192
- </h2>
193
-
194
- // Small Heading - Título de card
195
- <h3 className="text-2xl font-bold tracking-tighter">
196
- Ventas Totales
197
- </h3>
198
-
199
- // Tiny Heading - Subtítulo
200
- <h4 className="text-xl font-bold tracking-tighter">
201
- Resumen Semanal
202
- </h4>
203
- ```
204
-
205
- ---
206
-
207
- ## Label
208
-
209
- **Uso**: Labels de formularios, texto de botones, badges, tabs, tooltips, texto enfatizado.
210
-
211
- **Características**:
212
- - Font-weight: 700 (Bold)
213
- - Letter-spacing: 0% (tracking normal)
214
- - Line-height: Proporcionado para buena legibilidad
215
-
216
- ### Escalas Label
217
-
218
- | Nombre | Tailwind Class | Font Size | Line Height | Tracking | Uso |
219
- |--------|---------------|-----------|-------------|----------|-----|
220
- | **Large** | `text-lg font-bold` | 18px (1.125rem) | 28px (1.75rem) | 0% | Labels grandes |
221
- | **Base** | `text-base font-bold` | 16px (1rem) | 24px (1.5rem) | 0% | Labels estándar |
222
- | **Small** | `text-sm font-bold` | 14px (0.875rem) | 20px (1.25rem) | 0% | **Labels comunes, botones** |
223
- | **Tiny** | `text-xs font-bold` | 12px (0.75rem) | 16px (1rem) | 0% | Badges, tags |
224
-
225
- ### Código Label
226
-
227
- ```tsx
228
- // Large Label
229
- <label className="text-lg font-bold text-content-primary">
230
- Nombre del Proyecto
231
- </label>
232
-
233
- // Base Label
234
- <label className="text-base font-bold text-content-primary">
235
- Correo Electrónico
236
- </label>
237
-
238
- // Small Label - MÁS COMÚN en formularios y botones
239
- <label className="text-sm font-bold text-content-primary">
240
- Usuario
241
- </label>
242
-
243
- // Tiny Label - Badges
244
- <span className="text-xs font-bold text-primary-custom-600">
245
- NUEVO
246
- </span>
247
- ```
248
-
249
- ---
250
-
251
- ## Paragraph
252
-
253
- **Uso**: Contenido principal, textos descriptivos, párrafos largos, ayudas contextuales.
254
-
255
- **Características**:
256
- - Font-weight: 400 (Regular)
257
- - Letter-spacing: 0% (tracking normal)
258
- - Line-height: Generoso para facilitar lectura
259
-
260
- ### Escalas Paragraph
261
-
262
- | Nombre | Tailwind Class | Font Size | Line Height | Tracking | Uso |
263
- |--------|---------------|-----------|-------------|----------|-----|
264
- | **Large** | `text-lg` | 18px (1.125rem) | 28px (1.75rem) | 0% | Contenido destacado |
265
- | **Base** | `text-base` | 16px (1rem) | 24px (1.5rem) | 0% | **Párrafos estándar** |
266
- | **Small** | `text-sm` | 14px (0.875rem) | 20px (1.25rem) | 0% | Textos secundarios |
267
- | **Tiny** | `text-xs` | 12px (0.75rem) | 16px (1rem) | 0% | Notas, disclaimers |
268
-
269
- ### Código Paragraph
270
-
271
- ```tsx
272
- // Large Paragraph - Intro destacada
273
- <p className="text-lg text-content-primary">
274
- Bienvenido al sistema de gestión empresarial.
275
- Esta plataforma te permite administrar todos los aspectos de tu negocio.
276
- </p>
277
-
278
- // Base Paragraph - Contenido estándar
279
- <p className="text-base text-content-primary">
280
- El panel de control muestra un resumen de las métricas más importantes
281
- de tu organización en tiempo real.
282
- </p>
283
-
284
- // Small Paragraph - Descripción secundaria
285
- <p className="text-sm text-content-secondary">
286
- Última actualización: hace 5 minutos
287
- </p>
288
-
289
- // Tiny Paragraph - Nota al pie
290
- <p className="text-xs text-content-tertiary">
291
- * Los datos se actualizan cada 15 minutos
292
- </p>
293
- ```
294
-
295
- ---
296
-
297
- ## Guía de Uso
298
-
299
- ### Cuándo Usar Cada Categoría
300
-
301
- #### Display
302
- - ✅ Landing pages principales
303
- - ✅ Páginas de marketing
304
- - ✅ Secciones hero
305
- - ✅ Presentaciones impactantes
306
- - ❌ Interfaces de aplicación (demasiado grande)
307
- - ❌ Dashboards (poco práctico)
308
-
309
- #### Heading
310
- - ✅ Títulos de páginas (text-4xl)
311
- - ✅ Títulos de secciones (text-3xl)
312
- - ✅ Títulos de cards (text-2xl)
313
- - ✅ Subtítulos (text-xl)
314
- - ✅ **Uso más común en aplicaciones**
315
-
316
- #### Label
317
- - ✅ Labels de formularios (text-sm o text-base)
318
- - ✅ Texto de botones (text-sm)
319
- - ✅ Tabs y navegación
320
- - ✅ Badges y tags (text-xs)
321
- - ✅ Tooltips (text-xs o text-sm)
322
- - ✅ **Siempre usar font-bold**
323
-
324
- #### Paragraph
325
- - ✅ Contenido principal (text-base)
326
- - ✅ Descripciones largas
327
- - ✅ Textos de ayuda (text-sm)
328
- - ✅ Notas al pie (text-xs)
329
- - ✅ **Siempre usar font-normal (Regular)**
330
-
331
- ### Jerarquía Visual Recomendada
332
-
333
- ```tsx
334
- // Página de Dashboard
335
- <div className="space-y-6">
336
- {/* Título Principal - Heading Large */}
337
- <h1 className="text-4xl font-bold tracking-tighter">
338
- Dashboard Ejecutivo
339
- </h1>
340
-
341
- {/* Sección */}
342
- <section className="space-y-4">
343
- {/* Título de Sección - Heading Medium */}
344
- <h2 className="text-3xl font-bold tracking-tighter">
345
- Métricas de Ventas
346
- </h2>
347
-
348
- {/* Párrafo Descriptivo - Paragraph Base */}
349
- <p className="text-base text-content-secondary">
350
- Resumen de las ventas del último mes comparado con el período anterior.
351
- </p>
352
-
353
- {/* Card */}
354
- <div className="border rounded-lg p-4">
355
- {/* Título de Card - Heading Small */}
356
- <h3 className="text-2xl font-bold tracking-tighter mb-2">
357
- Total de Ventas
358
- </h3>
359
-
360
- {/* Contenido - Paragraph Small */}
361
- <p className="text-sm text-content-tertiary">
362
- Comparado con el mes anterior
363
- </p>
364
- </div>
365
- </section>
366
- </div>
367
- ```
368
-
369
- ---
370
-
371
- ## Pesos Tipográficos
372
-
373
- ### Mapa de Clases de Peso
374
-
375
- ```tsx
376
- // Light (300) - Uso limitado
377
- <p className="font-light">Texto decorativo</p>
378
-
379
- // Regular (400) - Default para párrafos
380
- <p className="font-normal">Contenido principal</p>
381
-
382
- // Bold (700) - Títulos y labels
383
- <h1 className="font-bold">Título Principal</h1>
384
- ```
385
-
386
- ### Uso Semántico de Pesos
387
-
388
- | Peso | Clase | Cuándo Usar | Ejemplos |
389
- |------|-------|-------------|----------|
390
- | **300** | `font-light` | Decorativo, énfasis suave | Citas, texto hero decorativo |
391
- | **400** | `font-normal` | **Párrafos, contenido** | Todo el contenido de lectura |
392
- | **700** | `font-bold` | **Títulos, labels, botones** | H1-H6, labels, botones, badges |
393
-
394
- ### Reglas de Oro
395
-
396
- 1. **Párrafos**: Siempre `font-normal` (Regular 400)
397
- 2. **Títulos**: Siempre `font-bold` (Bold 700)
398
- 3. **Labels**: Siempre `font-bold` (Bold 700)
399
- 4. **Botones**: Siempre `font-bold` (Bold 700)
400
- 5. **Badges/Tags**: Siempre `font-bold` (Bold 700)
401
-
402
- ---
403
-
404
- ## Ejemplos de Código
405
-
406
- ### Ejemplo 1: Formulario Completo
407
-
408
- ```tsx
409
- import { Input } from '@/components/Input';
410
- import { Button } from '@/components/Button';
411
-
412
- export const RegistrationForm = () => {
413
- return (
414
- <form className="space-y-6 max-w-md">
415
- {/* Título - Heading Large */}
416
- <h1 className="text-4xl font-bold tracking-tighter text-content-primary">
417
- Crear Cuenta
418
- </h1>
419
-
420
- {/* Descripción - Paragraph Base */}
421
- <p className="text-base text-content-secondary">
422
- Completa el formulario para registrarte en la plataforma.
423
- </p>
424
-
425
- {/* Campo con Label Small */}
426
- <div className="space-y-2">
427
- <label className="text-sm font-bold text-content-primary">
428
- Nombre Completo
429
- </label>
430
- <Input placeholder="Juan Pérez" />
431
- <p className="text-xs text-content-tertiary">
432
- Ingresa tu nombre como aparece en tu documento
433
- </p>
434
- </div>
435
-
436
- {/* Campo con Label Base */}
437
- <div className="space-y-2">
438
- <label className="text-base font-bold text-content-primary">
439
- Correo Electrónico
440
- </label>
441
- <Input type="email" placeholder="correo@ejemplo.com" />
442
- </div>
443
-
444
- {/* Botón - Label Small (interno) */}
445
- <Button type="default" size="base" fullWidth>
446
- Registrarse
447
- </Button>
448
-
449
- {/* Nota al pie - Paragraph Tiny */}
450
- <p className="text-xs text-content-tertiary">
451
- Al registrarte, aceptas nuestros términos y condiciones.
452
- </p>
453
- </form>
454
- );
455
- };
456
- ```
457
-
458
- ### Ejemplo 2: Card de Estadística
459
-
460
- ```tsx
461
- export const StatCard = ({ title, value, description, trend }) => {
462
- return (
463
- <div className="border border-border-primary rounded-lg p-6 space-y-3">
464
- {/* Título - Heading Small */}
465
- <h3 className="text-2xl font-bold tracking-tighter text-content-primary">
466
- {title}
467
- </h3>
468
-
469
- {/* Valor Principal - Display Tiny */}
470
- <p className="text-5xl font-bold tracking-tighter text-primary-custom-600">
471
- {value}
472
- </p>
473
-
474
- {/* Descripción - Paragraph Small */}
475
- <p className="text-sm text-content-secondary">
476
- {description}
477
- </p>
478
-
479
- {/* Badge - Label Tiny */}
480
- <span className="inline-flex items-center px-2 py-1 rounded text-xs font-bold bg-green-100 text-green-800">
481
- {trend}
482
- </span>
483
- </div>
484
- );
485
- };
486
-
487
- // Uso
488
- <StatCard
489
- title="Ventas Totales"
490
- value="$125,430"
491
- description="Este mes"
492
- trend="+12.5%"
493
- />
494
- ```
495
-
496
- ### Ejemplo 3: Hero Section
497
-
498
- ```tsx
499
- export const HeroSection = () => {
500
- return (
501
- <section className="py-20 px-6 text-center space-y-6">
502
- {/* Título Hero - Display Large */}
503
- <h1 className="text-8xl font-bold tracking-tighter text-content-primary">
504
- Siesa Cloud
505
- </h1>
506
-
507
- {/* Subtítulo - Heading Large */}
508
- <h2 className="text-4xl font-bold tracking-tighter text-content-secondary">
509
- Gestión Empresarial Inteligente
510
- </h2>
511
-
512
- {/* Descripción - Paragraph Large */}
513
- <p className="text-lg text-content-tertiary max-w-2xl mx-auto">
514
- La plataforma todo-en-uno para administrar tu empresa de manera
515
- eficiente, con herramientas diseñadas para impulsar tu crecimiento.
516
- </p>
517
-
518
- {/* CTAs */}
519
- <div className="flex gap-4 justify-center">
520
- <Button type="default" size="l">
521
- Comenzar Ahora
522
- </Button>
523
- <Button type="outline" size="l">
524
- Ver Demo
525
- </Button>
526
- </div>
527
-
528
- {/* Nota - Paragraph Tiny */}
529
- <p className="text-xs text-content-tertiary">
530
- Prueba gratuita de 30 días • No requiere tarjeta de crédito
531
- </p>
532
- </section>
533
- );
534
- };
535
- ```
536
-
537
- ### Ejemplo 4: Lista de Artículos
538
-
539
- ```tsx
540
- export const ArticleList = ({ articles }) => {
541
- return (
542
- <div className="space-y-8">
543
- {/* Título de Sección - Heading Large */}
544
- <h2 className="text-4xl font-bold tracking-tighter text-content-primary">
545
- Últimas Noticias
546
- </h2>
547
-
548
- {articles.map((article) => (
549
- <article key={article.id} className="border-b pb-6 space-y-3">
550
- {/* Título del Artículo - Heading Medium */}
551
- <h3 className="text-3xl font-bold tracking-tighter text-content-primary">
552
- {article.title}
553
- </h3>
554
-
555
- {/* Meta información - Label Tiny */}
556
- <div className="flex gap-4 text-xs font-bold text-content-tertiary">
557
- <span>{article.author}</span>
558
- <span>•</span>
559
- <span>{article.date}</span>
560
- <span>•</span>
561
- <span>{article.readTime} min lectura</span>
562
- </div>
563
-
564
- {/* Extracto - Paragraph Base */}
565
- <p className="text-base text-content-secondary">
566
- {article.excerpt}
567
- </p>
568
-
569
- {/* Categoría - Label Small */}
570
- <span className="inline-block px-3 py-1 text-sm font-bold text-primary-custom-600 bg-primary-custom-100 rounded">
571
- {article.category}
572
- </span>
573
- </article>
574
- ))}
575
- </div>
576
- );
577
- };
578
- ```
579
-
580
- ---
581
-
582
- ## Mejores Prácticas
583
-
584
- ### ✅ Hacer
585
-
586
- 1. **Usar la escala apropiada para cada contexto**
587
- ```tsx
588
- // ✅ CORRECTO - Título de página
589
- <h1 className="text-4xl font-bold tracking-tighter">Dashboard</h1>
590
-
591
- // ✅ CORRECTO - Contenido
592
- <p className="text-base text-content-primary">Contenido...</p>
593
- ```
594
-
595
- 2. **Mantener jerarquía visual clara**
596
- ```tsx
597
- // ✅ CORRECTO - Jerarquía clara
598
- <h1 className="text-4xl">Título Principal</h1>
599
- <h2 className="text-3xl">Subtítulo</h2>
600
- <p className="text-base">Contenido</p>
601
- ```
602
-
603
- 3. **Usar tracking apropiado**
604
- ```tsx
605
- // ✅ CORRECTO - Display/Heading con tracking-tighter
606
- <h1 className="text-5xl font-bold tracking-tighter">Hero</h1>
607
-
608
- // ✅ CORRECTO - Label/Paragraph sin tracking
609
- <p className="text-base">Contenido normal</p>
610
- ```
611
-
612
- 4. **Combinar con pesos semánticos**
613
- ```tsx
614
- // ✅ CORRECTO - Bold para títulos
615
- <h2 className="text-3xl font-bold">Título</h2>
616
-
617
- // ✅ CORRECTO - Regular para párrafos
618
- <p className="text-base font-normal">Párrafo</p>
619
- ```
620
-
621
- 5. **Usar colores apropiados**
622
- ```tsx
623
- // ✅ CORRECTO - Jerarquía de colores
624
- <h1 className="text-4xl font-bold text-content-primary">Principal</h1>
625
- <p className="text-base text-content-secondary">Secundario</p>
626
- <span className="text-sm text-content-tertiary">Terciario</span>
627
- ```
628
-
629
- ### ❌ Evitar
630
-
631
- 1. **No mezclar categorías sin propósito**
632
- ```tsx
633
- // ❌ INCORRECTO - Display para contenido normal
634
- <p className="text-7xl">Texto normal</p>
635
-
636
- // ✅ CORRECTO
637
- <p className="text-base">Texto normal</p>
638
- ```
639
-
640
- 2. **No omitir font-bold en títulos**
641
- ```tsx
642
- // ❌ INCORRECTO - Título sin bold
643
- <h1 className="text-4xl">Título</h1>
644
-
645
- // ✅ CORRECTO
646
- <h1 className="text-4xl font-bold">Título</h1>
647
- ```
648
-
649
- 3. **No usar bold en párrafos largos**
650
- ```tsx
651
- // ❌ INCORRECTO - Párrafo en bold
652
- <p className="text-base font-bold">
653
- Este es un párrafo muy largo que se vuelve
654
- difícil de leer cuando está en negrita...
655
- </p>
656
-
657
- // ✅ CORRECTO
658
- <p className="text-base">Contenido legible...</p>
659
- ```
660
-
661
- 4. **No saltar demasiados niveles de jerarquía**
662
- ```tsx
663
- // ❌ INCORRECTO - Salto abrupto
664
- <h1 className="text-8xl">Hero</h1>
665
- <p className="text-xs">Texto diminuto</p>
666
-
667
- // ✅ CORRECTO - Transición gradual
668
- <h1 className="text-8xl">Hero</h1>
669
- <h2 className="text-4xl">Subtítulo</h2>
670
- <p className="text-base">Contenido</p>
671
- ```
672
-
673
- 5. **No usar Display en UI de aplicación**
674
- ```tsx
675
- // ❌ INCORRECTO - Display en dashboard
676
- <h1 className="text-9xl">Dashboard</h1>
677
-
678
- // ✅ CORRECTO - Heading en dashboard
679
- <h1 className="text-4xl font-bold tracking-tighter">Dashboard</h1>
680
- ```
681
-
682
- ### Accesibilidad
683
-
684
- 1. **Tamaño mínimo para contenido**: text-sm (14px) o mayor
685
- 2. **Contraste**: Usar colores con contraste WCAG AA mínimo (4.5:1)
686
- 3. **Jerarquía HTML**: Usar etiquetas semánticas (h1-h6, p, etc.)
687
- 4. **Responsive**: Ajustar tamaños en móviles
688
-
689
- ```tsx
690
- // ✅ CORRECTO - Responsive
691
- <h1 className="text-3xl md:text-4xl lg:text-5xl font-bold">
692
- Título Adaptable
693
- </h1>
694
-
695
- // ✅ CORRECTO - Contraste
696
- <p className="text-base text-content-primary"> {/* #18181b - buen contraste */}
697
- Contenido legible
698
- </p>
699
- ```
700
-
701
- ### Performance
702
-
703
- 1. **Font-display: swap**: Ya configurado en @font-face
704
- 2. **Preload fonts**: Considerar para fonts críticos
705
- 3. **Subset fonts**: Solo caracteres necesarios (español)
706
-
707
- ```html
708
- <!-- Preload font crítico -->
709
- <link
710
- rel="preload"
711
- href="/src/assets/fonts/SiesaBT/SiesaBT-Bold.otf"
712
- as="font"
713
- type="font/otf"
714
- crossorigin
715
- />
716
- ```
717
-
718
- ---
719
-
720
- ## Dark Mode
721
-
722
- La tipografía en dark mode mantiene las mismas escalas y pesos, pero es importante ajustar el contraste visual para garantizar la legibilidad en fondos oscuros.
723
-
724
- ### Configuración de Tailwind CSS
725
-
726
- El modo oscuro en Siesa UI Kit se basa en la estrategia de clases de Tailwind CSS:
727
-
728
- ```javascript
729
- // tailwind.config.js
730
- module.exports = {
731
- darkMode: 'class', // ✅ Estrategia basada en clases (NO 'media')
732
- // ...resto de la configuración
733
- }
734
- ```
735
-
736
- Con esta configuración, el modo oscuro se activa añadiendo la clase `.dark` al elemento `<html>`:
737
-
738
- ```html
739
- <!-- Modo claro -->
740
- <html>
741
- <body>
742
- <!-- Contenido en modo claro -->
743
- </body>
744
- </html>
745
-
746
- <!-- Modo oscuro -->
747
- <html class="dark">
748
- <body>
749
- <!-- Contenido en modo oscuro -->
750
- </body>
751
- </html>
752
- ```
753
-
754
- ### El Modificador `dark:`
755
-
756
- 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>`).
757
-
758
- #### Sintaxis Básica
759
-
760
- ```tsx
761
- // Patrón básico para texto
762
- <h1 className="text-content-primary dark:text-dark-content-primary">
763
- Título adaptable
764
- </h1>
765
-
766
- // El título usa:
767
- // - text-content-primary (#18181b - casi negro) en modo claro
768
- // - text-dark-content-primary (#ffffff - blanco) en modo oscuro
769
- ```
770
-
771
- ### Colores de Texto en Dark Mode
772
-
773
- ```tsx
774
- // Texto principal en dark mode
775
- <p className="text-content-primary dark:text-dark-content-primary">
776
- Texto que se adapta automáticamente
777
- </p>
778
-
779
- // Usando colores personalizados para dark mode
780
- <h1 className="text-content-primary dark:text-dark-content-primary">
781
- #18181b en light → #93d1fd en dark
782
- </h1>
783
-
784
- // Texto secundario
785
- <p className="text-content-secondary dark:text-content-secondary">
786
- Texto secundario adaptable (#a1a1aa en ambos modos)
787
- </p>
788
-
789
- // Texto terciario
790
- <span className="text-content-tertiary dark:text-content-tertiary">
791
- Placeholders y hints (#71717a en ambos modos)
792
- </span>
793
- ```
794
-
795
- ### Combinando con Otros Modificadores
796
-
797
- El modificador `dark:` se puede combinar con hover, focus, y responsive:
798
-
799
- ```tsx
800
- // Dark mode + Hover
801
- <a className="
802
- text-primary-custom-600 hover:text-primary-custom-500
803
- dark:text-blue-400 dark:hover:text-blue-300
804
- ">
805
- Enlace con hover
806
- </a>
807
-
808
- // Dark mode + Focus
809
- <button className="
810
- text-content-primary focus:text-primary-custom-600
811
- dark:text-dark-content-primary dark:focus:text-blue-400
812
- ">
813
- Botón con focus
814
- </button>
815
-
816
- // Dark mode + Responsive
817
- <h1 className="
818
- text-3xl md:text-4xl lg:text-5xl
819
- text-content-primary
820
- dark:text-dark-content-primary
821
- ">
822
- Título responsive y adaptable
823
- </h1>
824
-
825
- // Dark mode + Group hover
826
- <div className="group">
827
- <h3 className="
828
- text-content-primary
829
- group-hover:text-primary-custom-600
830
- dark:text-dark-content-primary
831
- dark:group-hover:text-blue-400
832
- ">
833
- Título que cambia al hover del grupo
834
- </h3>
835
- </div>
836
- ```
837
-
838
- ### Orden de Modificadores
839
-
840
- Tailwind CSS recomienda un orden específico para los modificadores:
841
-
842
- **Formato**: `{responsive}:{dark}:{state}:{utility}`
843
-
844
- ```tsx
845
- // ✅ CORRECTO - Orden: responsive → dark → state → utility
846
- <h1 className="
847
- text-3xl
848
- md:text-4xl
849
- md:dark:text-dark-content-primary
850
- md:dark:hover:text-blue-400
851
- ">
852
- Título con orden correcto
853
- </h1>
854
-
855
- // ❌ INCORRECTO - Orden equivocado
856
- <h1 className="
857
- dark:md:hover:text-blue-400
858
- ">
859
- Orden confuso
860
- </h1>
861
- ```
862
-
863
- ### Tabla de Colores de Texto por Estado
864
-
865
- | Estado | Light Mode | Dark Mode | Descripción |
866
- |--------|------------|-----------|-------------|
867
- | **Texto Principal** | `text-content-primary` (#18181b) | `dark:text-dark-content-primary` (#ffffff) | Títulos y contenido principal |
868
- | **Texto Secundario** | `text-content-secondary` (#a1a1aa) | `dark:text-content-secondary` (#a1a1aa) | Descripciones, metadata |
869
- | **Texto Terciario** | `text-content-tertiary` (#71717a) | `dark:text-content-tertiary` (#71717a) | Placeholders, hints |
870
- | **Enlaces** | `text-primary-custom-600` (#0e79fd) | `dark:text-blue-400` | Enlaces y CTAs |
871
- | **Enlaces Hover** | `hover:text-primary-custom-500` | `dark:hover:text-blue-300` | Estado hover de enlaces |
872
- | **Texto Deshabilitado** | `text-content-tertiary opacity-50` | `dark:text-dark-content-tertiary opacity-50` | Elementos inactivos |
873
-
874
- ### Implementación del Toggle Dark Mode
875
-
876
- #### Script de Inicialización (Prevenir FOUC)
877
-
878
- ```html
879
- <!-- index.html - En el <head> antes de cargar React -->
880
- <head>
881
- <script>
882
- // Aplicar tema inmediatamente antes del render
883
- (function() {
884
- const theme = localStorage.getItem('theme');
885
- const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
886
-
887
- if (theme === 'dark' || (!theme && prefersDark)) {
888
- document.documentElement.classList.add('dark');
889
- }
890
- })();
891
- </script>
892
- </head>
893
- ```
894
-
895
- #### Toggle Component
896
-
897
- ```tsx
898
- import { useState, useEffect } from 'react';
899
-
900
- export const DarkModeToggle = () => {
901
- const [darkMode, setDarkMode] = useState(false);
902
-
903
- useEffect(() => {
904
- // Leer preferencia del usuario
905
- const isDark = localStorage.getItem('theme') === 'dark';
906
- setDarkMode(isDark);
907
-
908
- if (isDark) {
909
- document.documentElement.classList.add('dark');
910
- }
911
- }, []);
912
-
913
- const toggleDarkMode = () => {
914
- const newDarkMode = !darkMode;
915
- setDarkMode(newDarkMode);
916
-
917
- // Guardar preferencia
918
- localStorage.setItem('theme', newDarkMode ? 'dark' : 'light');
919
-
920
- // Aplicar clase
921
- if (newDarkMode) {
922
- document.documentElement.classList.add('dark');
923
- } else {
924
- document.documentElement.classList.remove('dark');
925
- }
926
- };
927
-
928
- return (
929
- <button
930
- onClick={toggleDarkMode}
931
- className="
932
- p-2 rounded-md
933
- border border-border-primary dark:border-dark-border-primary
934
- hover:bg-background-secondary dark:hover:bg-dark-bg-primary
935
- text-sm font-bold
936
- "
937
- aria-label="Toggle dark mode"
938
- >
939
- {darkMode ? '☀️ Light' : '🌙 Dark'}
940
- </button>
941
- );
942
- };
943
- ```
944
-
945
- ### Mejores Prácticas para Dark Mode
946
-
947
- #### 1. Contraste Adecuado
948
-
949
- ```tsx
950
- // ✅ CORRECTO - Buen contraste en ambos modos
951
- <div className="bg-white dark:bg-dark-bg-primary">
952
- <h1 className="text-content-primary dark:text-dark-content-primary font-bold text-4xl">
953
- Título legible
954
- </h1>
955
- <p className="text-content-secondary dark:text-content-secondary">
956
- Contenido secundario con buen contraste
957
- </p>
958
- </div>
959
-
960
- // ❌ INCORRECTO - Mismo color en ambos modos
961
- <h1 className="text-gray-900 font-bold">
962
- Difícil de leer en dark mode
963
- </h1>
964
- ```
965
-
966
- #### 2. Uso de Tokens de Color
967
-
968
- ```tsx
969
- // ✅ CORRECTO - Usar tokens del sistema que se adaptan
970
- <article>
971
- <h2 className="text-content-primary dark:text-dark-content-primary font-bold text-2xl mb-4">
972
- Título del Artículo
973
- </h2>
974
- <p className="text-content-primary dark:text-dark-content-primary mb-4">
975
- Contenido principal que se adapta automáticamente al modo oscuro.
976
- </p>
977
- <p className="text-content-secondary dark:text-content-secondary text-sm">
978
- Metadata o texto secundario
979
- </p>
980
- </article>
981
-
982
- // ❌ INCORRECTO - Colores hardcodeados
983
- <article>
984
- <h2 className="text-black font-bold text-2xl">Título</h2>
985
- <p className="text-gray-900">Contenido</p>
986
- </article>
987
- ```
988
-
989
- #### 3. Fondos con Texto
990
-
991
- ```tsx
992
- // ✅ CORRECTO - Fondo y texto se adaptan
993
- <div className="bg-bg-primary dark:bg-dark-bg-primary p-6 rounded-2xl">
994
- <h3 className="text-content-primary dark:text-dark-content-primary font-bold">
995
- Card Title
996
- </h3>
997
- <p className="text-content-secondary dark:text-content-secondary">
998
- Card description
999
- </p>
1000
- </div>
1001
-
1002
- // Para botones primarios con fondo custom
1003
- <button className="bg-primary-custom-600 dark:bg-dark-bg-inverse text-primary-inverse-content dark:text-dark-content-inverse px-4 py-2 rounded-md font-bold text-sm">
1004
- Primary Button
1005
- </button>
1006
- ```
1007
-
1008
- #### 4. Consistencia en Componentes
1009
-
1010
- ```tsx
1011
- // ✅ CORRECTO - Componente que funciona en ambos modos
1012
- export const Card = ({ title, description }) => {
1013
- return (
1014
- <div className="bg-white dark:bg-dark-bg-primary border border-border-primary dark:border-dark-border-primary rounded-2xl p-6">
1015
- <h3 className="text-content-primary dark:text-dark-content-primary font-bold text-xl mb-2">
1016
- {title}
1017
- </h3>
1018
- <p className="text-content-secondary dark:text-content-secondary">
1019
- {description}
1020
- </p>
1021
- </div>
1022
- );
1023
- };
1024
- ```
1025
-
1026
- ### Ejemplo Completo: Hero Section con Dark Mode
1027
-
1028
- ```tsx
1029
- export const HeroWithDarkMode = () => {
1030
- return (
1031
- <section className="bg-bg-primary dark:bg-dark-bg-primary px-6 py-16 md:py-24">
1032
- <div className="max-w-4xl mx-auto text-center">
1033
- {/* Hero title */}
1034
- <h1 className="text-content-primary dark:text-dark-content-primary font-bold text-5xl md:text-7xl tracking-tighter mb-6">
1035
- Bienvenido a Siesa UI Kit
1036
- </h1>
1037
-
1038
- {/* Hero description */}
1039
- <p className="text-content-secondary dark:text-content-secondary text-lg md:text-xl mb-8 max-w-2xl mx-auto">
1040
- Un sistema de diseño moderno y completo con soporte nativo para
1041
- dark mode. Crea interfaces hermosas que funcionan en cualquier modo.
1042
- </p>
1043
-
1044
- {/* CTA buttons */}
1045
- <div className="flex gap-4 justify-center">
1046
- <button className="bg-primary-custom-600 dark:bg-dark-bg-inverse text-primary-inverse-content dark:text-dark-content-inverse px-6 py-3 rounded-md font-bold">
1047
- Comenzar
1048
- </button>
1049
- <button className="border border-border-primary dark:border-dark-border-custom text-content-primary dark:text-dark-content-primary px-6 py-3 rounded-md font-bold hover:bg-background-secondary dark:hover:bg-dark-bg-primary">
1050
- Documentación
1051
- </button>
1052
- </div>
1053
-
1054
- {/* Feature list */}
1055
- <div className="mt-16 grid grid-cols-1 md:grid-cols-3 gap-6">
1056
- {[
1057
- { title: 'Tipografía Escalable', desc: '17 escalas de texto' },
1058
- { title: 'Dark Mode Nativo', desc: 'Soporte completo' },
1059
- { title: 'Accessible', desc: 'WCAG 2.1 AAA' },
1060
- ].map((feature) => (
1061
- <div key={feature.title} className="p-6 border border-border-primary dark:border-dark-border-primary rounded-2xl bg-white dark:bg-dark-bg-primary">
1062
- <h3 className="text-content-primary dark:text-dark-content-primary font-bold text-lg mb-2">
1063
- {feature.title}
1064
- </h3>
1065
- <p className="text-content-secondary dark:text-content-secondary text-sm">
1066
- {feature.desc}
1067
- </p>
1068
- </div>
1069
- ))}
1070
- </div>
1071
- </div>
1072
- </section>
1073
- );
1074
- };
1075
- ```
1076
-
1077
- ### Toggle de Dark Mode
1078
-
1079
- ```tsx
1080
- import { useState, useEffect } from 'react';
1081
-
1082
- export const DarkModeToggle = () => {
1083
- const [darkMode, setDarkMode] = useState(false);
1084
-
1085
- useEffect(() => {
1086
- // Leer preferencia del usuario
1087
- const isDark = localStorage.getItem('darkMode') === 'true';
1088
- setDarkMode(isDark);
1089
-
1090
- if (isDark) {
1091
- document.documentElement.classList.add('dark');
1092
- }
1093
- }, []);
1094
-
1095
- const toggleDarkMode = () => {
1096
- const newDarkMode = !darkMode;
1097
- setDarkMode(newDarkMode);
1098
-
1099
- // Guardar preferencia
1100
- localStorage.setItem('darkMode', String(newDarkMode));
1101
-
1102
- // Aplicar clase
1103
- if (newDarkMode) {
1104
- document.documentElement.classList.add('dark');
1105
- } else {
1106
- document.documentElement.classList.remove('dark');
1107
- }
1108
- };
1109
-
1110
- return (
1111
- <button
1112
- onClick={toggleDarkMode}
1113
- className="p-2 rounded-md border border-border-primary dark:border-dark-border-primary hover:bg-background-secondary dark:hover:bg-dark-bg-primary"
1114
- aria-label="Toggle dark mode"
1115
- >
1116
- {darkMode ? '☀️' : '🌙'}
1117
- </button>
1118
- );
1119
- };
1120
- ```
1121
-
1122
- ### Tokens de Color para Tipografía
1123
-
1124
- Referencia rápida de colores de texto para dark mode:
1125
-
1126
- | Token Light | Hex Light | Token Dark | Hex Dark | Uso |
1127
- |-------------|-----------|------------|----------|-----|
1128
- | `text-content-primary` | `#18181b` | `dark:text-dark-content-primary` | `#93d1fd` | Texto principal |
1129
- | `text-content-secondary` | `#a1a1aa` | `dark:text-content-secondary` | `#a1a1aa` | Texto secundario |
1130
- | `text-content-tertiary` | `#71717a` | `dark:text-content-tertiary` | `#71717a` | Placeholders, hints |
1131
- | `text-primary-custom-600` | `#0e79fd` | `dark:text-dark-content-primary` | `#93d1fd` | Enlaces, CTA text |
1132
-
1133
- ### Recursos Adicionales sobre Dark Mode
1134
-
1135
- Para más información sobre el modo oscuro:
1136
- - Ver `docs/dark-mode-guide.md` - Guía completa de Dark Mode en Tailwind CSS
1137
- - Ver `docs/colors.md` - Sistema de colores completo con tokens dark mode
1138
- - Ver `docs/icons.md` - Sistema de iconos con ejemplos de dark mode
1139
- - [Documentación oficial de Tailwind Dark Mode](https://tailwindcss.com/docs/dark-mode)
1140
-
1141
- ---
1142
-
1143
- ## Referencia Rápida
1144
-
1145
- ### Cheat Sheet: Escalas por Contexto
1146
-
1147
- | Contexto | Clase Recomendada | Font-Weight |
1148
- |----------|-------------------|-------------|
1149
- | **Hero principal** | `text-8xl font-bold tracking-tighter` | 700 |
1150
- | **Título de página** | `text-4xl font-bold tracking-tighter` | 700 |
1151
- | **Título de sección** | `text-3xl font-bold tracking-tighter` | 700 |
1152
- | **Título de card** | `text-2xl font-bold tracking-tighter` | 700 |
1153
- | **Subtítulo** | `text-xl font-bold tracking-tighter` | 700 |
1154
- | **Label de formulario** | `text-sm font-bold` o `text-base font-bold` | 700 |
1155
- | **Texto de botón** | `text-sm font-bold` | 700 |
1156
- | **Badge/Tag** | `text-xs font-bold` | 700 |
1157
- | **Contenido principal** | `text-base` | 400 |
1158
- | **Contenido destacado** | `text-lg` | 400 |
1159
- | **Texto secundario** | `text-sm text-content-secondary` | 400 |
1160
- | **Nota al pie** | `text-xs text-content-tertiary` | 400 |
1161
-
1162
- ### Cheat Sheet: Todas las Escalas
1163
-
1164
- ```tsx
1165
- // ===== DISPLAY (Bold + tracking-tighter) =====
1166
- <h1 className="text-9xl font-bold tracking-tighter">128px</h1>
1167
- <h1 className="text-8xl font-bold tracking-tighter">96px</h1>
1168
- <h1 className="text-7xl font-bold tracking-tighter">72px</h1>
1169
- <h1 className="text-6xl font-bold tracking-tighter">60px</h1>
1170
- <h1 className="text-5xl font-bold tracking-tighter">48px</h1>
1171
-
1172
- // ===== HEADING (Bold + tracking-tighter) =====
1173
- <h1 className="text-4xl font-bold tracking-tighter">36px</h1>
1174
- <h2 className="text-3xl font-bold tracking-tighter">30px</h2>
1175
- <h3 className="text-2xl font-bold tracking-tighter">24px</h3>
1176
- <h4 className="text-xl font-bold tracking-tighter">20px</h4>
1177
-
1178
- // ===== LABEL (Bold) =====
1179
- <label className="text-lg font-bold">18px</label>
1180
- <label className="text-base font-bold">16px</label>
1181
- <label className="text-sm font-bold">14px</label> {/* MÁS COMÚN */}
1182
- <span className="text-xs font-bold">12px</span>
1183
-
1184
- // ===== PARAGRAPH (Regular) =====
1185
- <p className="text-lg">18px</p>
1186
- <p className="text-base">16px</p> {/* MÁS COMÚN */}
1187
- <p className="text-sm">14px</p>
1188
- <p className="text-xs">12px</p>
1189
- ```
1190
-
1191
- ### Cheat Sheet: Configuración Tailwind
1192
-
1193
- ```javascript
1194
- // tailwind.config.js - fontSize
1195
- fontSize: {
1196
- // Display
1197
- '9xl': ['8rem', { lineHeight: '8rem', letterSpacing: '-0.025em', fontWeight: '700' }],
1198
- '8xl': ['6rem', { lineHeight: '6rem', letterSpacing: '-0.025em', fontWeight: '700' }],
1199
- '7xl': ['4.5rem', { lineHeight: '4.5rem', letterSpacing: '-0.025em', fontWeight: '700' }],
1200
- '6xl': ['3.75rem', { lineHeight: '3.75rem', letterSpacing: '-0.025em', fontWeight: '700' }],
1201
- '5xl': ['3rem', { lineHeight: '3rem', letterSpacing: '-0.025em', fontWeight: '700' }],
1202
-
1203
- // Heading
1204
- '4xl': ['2.25rem', { lineHeight: '2.5rem', letterSpacing: '-0.025em', fontWeight: '700' }],
1205
- '3xl': ['1.875rem', { lineHeight: '2.25rem', letterSpacing: '-0.025em', fontWeight: '700' }],
1206
- '2xl': ['1.5rem', { lineHeight: '2rem', letterSpacing: '-0.025em', fontWeight: '700' }],
1207
- 'xl': ['1.25rem', { lineHeight: '1.75rem', letterSpacing: '-0.025em', fontWeight: '700' }],
1208
-
1209
- // Label & Paragraph
1210
- 'lg': ['1.125rem', { lineHeight: '1.75rem' }],
1211
- 'base': ['1rem', { lineHeight: '1.5rem' }],
1212
- 'sm': ['0.875rem', { lineHeight: '1.25rem' }],
1213
- 'xs': ['0.75rem', { lineHeight: '1rem' }],
1214
- },
1215
-
1216
- letterSpacing: {
1217
- 'tighter': '-0.025em', // -2.5%
1218
- },
1219
- ```
1220
-
1221
- ### Cheat Sheet: Componentes del Sistema
1222
-
1223
- | Componente | Tipografía Usada | Ubicación |
1224
- |------------|------------------|-----------|
1225
- | **Button** | Label Small (14px Bold) | Button.tsx:52-58 |
1226
- | **Input Label** | Label Small/Base (14-16px Bold) | - |
1227
- | **Input Placeholder** | Paragraph Small (14px Regular) | - |
1228
- | **Card Title** | Heading Small (24px Bold) | - |
1229
- | **Badge** | Label Tiny (12px Bold) | - |
1230
- | **Tooltip** | Paragraph Tiny (12px Regular) | - |
1231
-
1232
- ---
1233
-
1234
- ## Recursos Adicionales
1235
-
1236
- ### Enlaces Útiles
1237
-
1238
- - **Tailwind Typography**: https://tailwindcss.com/docs/font-size
1239
- - **WCAG Guidelines**: https://www.w3.org/WAI/WCAG21/quickref/#text-spacing
1240
- - **Type Scale Calculator**: https://type-scale.com
1241
- - **Modular Scale**: https://www.modularscale.com
1242
-
1243
- ### Archivos Relacionados
1244
-
1245
- - `src/index.css` - Declaraciones @font-face (líneas 1-24)
1246
- - `tailwind.config.js` - Configuración de fontSize (líneas 74-94)
1247
- - `src/components/Button/Button.tsx` - Ejemplo de uso de Label Small
1248
- - `docs/colors.md` - Sistema de colores para tipografía
1249
- - `docs/icons.md` - Sistema de iconos
1250
-
1251
- ### Herramientas de Testing
1252
-
1253
- ```bash
1254
- # Verificar que las fuentes estén cargando correctamente
1255
- # En DevTools > Network > Filter: Font
1256
-
1257
- # Verificar contraste de texto
1258
- # https://webaim.org/resources/contrastchecker/
1259
-
1260
- # Verificar legibilidad
1261
- # https://www.webfx.com/tools/read-able/
1262
- ```
1263
-
1264
- ---
1265
-
1266
- **Última actualización**: 2025-11-11
1267
- **Versión**: 1.0.0
1268
- **Mantenedor**: Siesa UI Kit Team