siesa-ui-kit 1.0.2 → 1.0.3

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 (236) hide show
  1. package/package.json +2 -9
  2. package/claude/settings.local.json +0 -7
  3. package/docs/border-radius.md +0 -1261
  4. package/docs/colors.md +0 -832
  5. package/docs/dark-mode-guide.md +0 -1426
  6. package/docs/filters.md +0 -1243
  7. package/docs/icons.md +0 -1283
  8. package/docs/shadows.md +0 -1377
  9. package/docs/spacing.md +0 -1684
  10. package/docs/typography.md +0 -1268
  11. package/postcss.config.cjs +0 -6
  12. package/public/,Business Logo.png +0 -0
  13. package/public/.Siesa Logo.png +0 -0
  14. package/public/bg_siesa.png +0 -0
  15. package/public/siesa_logo_mobile.png +0 -0
  16. package/public/vite.svg +0 -1
  17. package/src/App.css +0 -42
  18. package/src/App.tsx +0 -8
  19. package/src/ButtonTest.tsx +0 -147
  20. package/src/assets/fonts/README.md +0 -261
  21. package/src/assets/fonts/SiesaBT/SiesaBT-Bold.otf +0 -0
  22. package/src/assets/fonts/SiesaBT/SiesaBT-Light.otf +0 -0
  23. package/src/assets/fonts/SiesaBT/SiesaBT-Regular.otf +0 -0
  24. package/src/assets/react.svg +0 -1
  25. package/src/components/Alert/Alert.stories.tsx +0 -332
  26. package/src/components/Alert/Alert.tsx +0 -106
  27. package/src/components/Alert/Alert.types.ts +0 -54
  28. package/src/components/Avatar/Avatar.stories.tsx +0 -494
  29. package/src/components/Avatar/Avatar.tsx +0 -143
  30. package/src/components/Avatar/Avatar.types.ts +0 -53
  31. package/src/components/Badge/Badge.stories.tsx +0 -339
  32. package/src/components/Badge/Badge.tsx +0 -278
  33. package/src/components/Badge/Badge.types.ts +0 -58
  34. package/src/components/Button/Button.stories.tsx +0 -950
  35. package/src/components/Button/Button.tsx +0 -337
  36. package/src/components/Button/Button.types.ts +0 -180
  37. package/src/components/Button/icons.tsx +0 -87
  38. package/src/components/Button/index.ts +0 -3
  39. package/src/components/Checkbox/Checkbox.stories.tsx +0 -453
  40. package/src/components/Checkbox/Checkbox.tsx +0 -208
  41. package/src/components/Checkbox/Checkbox.types.ts +0 -61
  42. package/src/components/DescriptionList/DescriptionList.stories.tsx +0 -250
  43. package/src/components/DescriptionList/DescriptionList.tsx +0 -96
  44. package/src/components/DescriptionList/DescriptionList.types.ts +0 -29
  45. package/src/components/Divider/Divider.stories.tsx +0 -263
  46. package/src/components/Divider/Divider.tsx +0 -80
  47. package/src/components/Divider/Divider.types.ts +0 -24
  48. package/src/components/Dropdown/Dropdown.stories.tsx +0 -552
  49. package/src/components/Dropdown/Dropdown.tsx +0 -422
  50. package/src/components/Dropdown/Dropdown.types.ts +0 -146
  51. package/src/components/Dropdown/README.md +0 -266
  52. package/src/components/Dropdown/icons.tsx +0 -72
  53. package/src/components/Dropdown/index.ts +0 -8
  54. package/src/components/DropdownItemCollapsible/DropdownItemCollapsible.stories.tsx +0 -317
  55. package/src/components/DropdownItemCollapsible/DropdownItemCollapsible.tsx +0 -287
  56. package/src/components/DropdownItemCollapsible/DropdownItemCollapsible.types.ts +0 -111
  57. package/src/components/DropdownItemCollapsible/README.md +0 -264
  58. package/src/components/DropdownItemCollapsible/icons.tsx +0 -57
  59. package/src/components/DropdownItemCollapsible/index.ts +0 -12
  60. package/src/components/DropdownItemHeading/DropdownItemHeading.stories.tsx +0 -386
  61. package/src/components/DropdownItemHeading/DropdownItemHeading.tsx +0 -216
  62. package/src/components/DropdownItemHeading/DropdownItemHeading.types.ts +0 -93
  63. package/src/components/DropdownItemHeading/README.md +0 -573
  64. package/src/components/DropdownItemHeading/icons.tsx +0 -125
  65. package/src/components/DropdownItemHeading/index.ts +0 -3
  66. package/src/components/Input/Input.stories.tsx +0 -583
  67. package/src/components/Input/Input.tsx +0 -204
  68. package/src/components/Input/Input.types.ts +0 -80
  69. package/src/components/Input/icons.tsx +0 -145
  70. package/src/components/Input/index.ts +0 -2
  71. package/src/components/LoginView/LoginView.stories.tsx +0 -148
  72. package/src/components/LoginView/LoginView.tsx +0 -426
  73. package/src/components/LoginView/LoginView.types.ts +0 -52
  74. package/src/components/LoginView/README.md +0 -396
  75. package/src/components/LoginView/icons.tsx +0 -85
  76. package/src/components/LoginView/index.ts +0 -3
  77. package/src/components/Navbar/Navbar.stories.tsx +0 -810
  78. package/src/components/Navbar/Navbar.tsx +0 -755
  79. package/src/components/Navbar/Navbar.types.ts +0 -219
  80. package/src/components/Navbar/README.md +0 -279
  81. package/src/components/Navbar/icons.tsx +0 -102
  82. package/src/components/Navbar/index.ts +0 -8
  83. package/src/components/NavigationBar/NavigationBar.stories.tsx +0 -406
  84. package/src/components/NavigationBar/NavigationBar.tsx +0 -246
  85. package/src/components/NavigationBar/NavigationBar.types.ts +0 -74
  86. package/src/components/NavigationBar/README.md +0 -469
  87. package/src/components/NavigationBar/index.ts +0 -2
  88. package/src/components/NavigationRail/NavigationRail.stories.tsx +0 -417
  89. package/src/components/NavigationRail/NavigationRail.tsx +0 -418
  90. package/src/components/NavigationRail/NavigationRail.types.ts +0 -109
  91. package/src/components/NavigationRail/README.md +0 -224
  92. package/src/components/NavigationRail/index.ts +0 -2
  93. package/src/components/NavigationRailItem/NavigationRailItem.stories.tsx +0 -667
  94. package/src/components/NavigationRailItem/NavigationRailItem.tsx +0 -313
  95. package/src/components/NavigationRailItem/NavigationRailItem.types.ts +0 -167
  96. package/src/components/NavigationRailItem/README.md +0 -476
  97. package/src/components/NavigationRailItem/index.ts +0 -2
  98. package/src/components/NavigationRailPanel/NavigationRailPanel.stories.tsx +0 -462
  99. package/src/components/NavigationRailPanel/NavigationRailPanel.tsx +0 -332
  100. package/src/components/NavigationRailPanel/NavigationRailPanel.types.ts +0 -178
  101. package/src/components/NavigationRailPanel/README.md +0 -461
  102. package/src/components/NavigationRailPanel/index.ts +0 -6
  103. package/src/components/NavigationRailTypes/NavigationRailTypes.stories.tsx +0 -528
  104. package/src/components/NavigationRailTypes/NavigationRailTypes.tsx +0 -378
  105. package/src/components/NavigationRailTypes/NavigationRailTypes.types.ts +0 -130
  106. package/src/components/NavigationRailTypes/README.md +0 -573
  107. package/src/components/NavigationRailTypes/icons.tsx +0 -141
  108. package/src/components/NavigationRailTypes/index.ts +0 -7
  109. package/src/components/Notification/Notification.stories.tsx +0 -513
  110. package/src/components/Notification/Notification.tsx +0 -145
  111. package/src/components/Notification/Notification.types.ts +0 -142
  112. package/src/components/Notification/README.md +0 -409
  113. package/src/components/Notification/index.ts +0 -3
  114. package/src/components/POSConvention/POSConvention.stories.tsx +0 -235
  115. package/src/components/POSConvention/POSConvention.tsx +0 -129
  116. package/src/components/POSConvention/POSConvention.types.ts +0 -38
  117. package/src/components/POSConvention/README.md +0 -123
  118. package/src/components/POSConvention/icons.tsx +0 -45
  119. package/src/components/POSConvention/index.ts +0 -3
  120. package/src/components/POSLocationButton/POSLocationButton.stories.tsx +0 -531
  121. package/src/components/POSLocationButton/POSLocationButton.tsx +0 -247
  122. package/src/components/POSLocationButton/POSLocationButton.types.ts +0 -87
  123. package/src/components/POSLocationButton/README.md +0 -253
  124. package/src/components/POSLocationButton/icons.tsx +0 -120
  125. package/src/components/POSLocationButton/index.ts +0 -14
  126. package/src/components/POSNumberButton/POSNumberButton.stories.tsx +0 -415
  127. package/src/components/POSNumberButton/POSNumberButton.tsx +0 -179
  128. package/src/components/POSNumberButton/POSNumberButton.types.ts +0 -51
  129. package/src/components/POSNumberButton/README.md +0 -321
  130. package/src/components/POSNumberButton/index.ts +0 -3
  131. package/src/components/POSProductButton/POSProductButton.stories.tsx +0 -318
  132. package/src/components/POSProductButton/POSProductButton.tsx +0 -152
  133. package/src/components/POSProductButton/POSProductButton.types.ts +0 -46
  134. package/src/components/POSProductButton/README.md +0 -269
  135. package/src/components/POSProductButton/index.ts +0 -2
  136. package/src/components/POSProductCard/POSProductCard.stories.tsx +0 -642
  137. package/src/components/POSProductCard/POSProductCard.tsx +0 -208
  138. package/src/components/POSProductCard/POSProductCard.types.ts +0 -76
  139. package/src/components/POSProductCard/README.md +0 -179
  140. package/src/components/POSProductCard/icons.tsx +0 -26
  141. package/src/components/POSProductCard/index.ts +0 -2
  142. package/src/components/POSProductSidebarItems/POSProductSidebarItems.stories.tsx +0 -753
  143. package/src/components/POSProductSidebarItems/POSProductSidebarItems.tsx +0 -332
  144. package/src/components/POSProductSidebarItems/POSProductSidebarItems.types.ts +0 -119
  145. package/src/components/POSProductSidebarItems/README.md +0 -198
  146. package/src/components/POSProductSidebarItems/icons.tsx +0 -21
  147. package/src/components/POSProductSidebarItems/index.ts +0 -3
  148. package/src/components/POSTable/POSTable.stories.tsx +0 -737
  149. package/src/components/POSTable/POSTable.tsx +0 -401
  150. package/src/components/POSTable/POSTable.types.ts +0 -83
  151. package/src/components/POSTable/README.md +0 -286
  152. package/src/components/POSTable/index.ts +0 -7
  153. package/src/components/Pagination/Pagination.stories.tsx +0 -555
  154. package/src/components/Pagination/Pagination.tsx +0 -286
  155. package/src/components/Pagination/Pagination.types.ts +0 -93
  156. package/src/components/Pagination/README.md +0 -298
  157. package/src/components/Pagination/icons.tsx +0 -47
  158. package/src/components/Pagination/index.ts +0 -3
  159. package/src/components/Quantity/Quantity.stories.tsx +0 -457
  160. package/src/components/Quantity/Quantity.tsx +0 -289
  161. package/src/components/Quantity/Quantity.types.ts +0 -70
  162. package/src/components/Radio/Radio.stories.tsx +0 -523
  163. package/src/components/Radio/Radio.tsx +0 -170
  164. package/src/components/Radio/Radio.types.ts +0 -122
  165. package/src/components/Select/README.md +0 -299
  166. package/src/components/Select/Select.stories.tsx +0 -673
  167. package/src/components/Select/Select.tsx +0 -454
  168. package/src/components/Select/Select.types.ts +0 -148
  169. package/src/components/Select/icons.tsx +0 -50
  170. package/src/components/Select/index.ts +0 -3
  171. package/src/components/SignUpView/SignUpView.stories.tsx +0 -129
  172. package/src/components/SignUpView/SignUpView.tsx +0 -503
  173. package/src/components/SignUpView/SignUpView.types.ts +0 -58
  174. package/src/components/SignUpView/icons.tsx +0 -71
  175. package/src/components/SignUpView/index.ts +0 -3
  176. package/src/components/Switch/README.md +0 -112
  177. package/src/components/Switch/Switch.stories.tsx +0 -550
  178. package/src/components/Switch/Switch.tsx +0 -246
  179. package/src/components/Switch/Switch.types.ts +0 -67
  180. package/src/components/Table/README.md +0 -369
  181. package/src/components/Table/Table.stories.tsx +0 -805
  182. package/src/components/Table/Table.tsx +0 -688
  183. package/src/components/Table/Table.types.ts +0 -204
  184. package/src/components/Table/index.ts +0 -9
  185. package/src/components/Tabs/README.md +0 -201
  186. package/src/components/Tabs/Tabs.stories.tsx +0 -580
  187. package/src/components/Tabs/Tabs.tsx +0 -356
  188. package/src/components/Tabs/Tabs.types.ts +0 -127
  189. package/src/components/Tabs/icons.tsx +0 -129
  190. package/src/components/Tabs/index.ts +0 -11
  191. package/src/components/Textarea/Textarea.stories.tsx +0 -535
  192. package/src/components/Textarea/Textarea.tsx +0 -188
  193. package/src/components/Textarea/Textarea.types.ts +0 -54
  194. package/src/context/ThemeContext.tsx +0 -99
  195. package/src/context/index.ts +0 -1
  196. package/src/index.css +0 -29
  197. package/src/index.ts +0 -102
  198. package/src/main.tsx +0 -10
  199. package/src/views/ListView/ListView.stories.tsx +0 -329
  200. package/src/views/ListView/ListView.tsx +0 -570
  201. package/src/views/ListView/ListView.types.ts +0 -211
  202. package/src/views/ListView/icons.tsx +0 -282
  203. package/src/views/ListView/index.ts +0 -11
  204. package/src/views/LoginView/LoginView.stories.tsx +0 -148
  205. package/src/views/LoginView/LoginView.tsx +0 -426
  206. package/src/views/LoginView/LoginView.types.ts +0 -52
  207. package/src/views/LoginView/README.md +0 -396
  208. package/src/views/LoginView/icons.tsx +0 -85
  209. package/src/views/LoginView/index.ts +0 -3
  210. package/src/views/ProductsView/ProductsView.stories.tsx +0 -344
  211. package/src/views/ProductsView/ProductsView.tsx +0 -480
  212. package/src/views/ProductsView/ProductsView.types.ts +0 -238
  213. package/src/views/ProductsView/README.md +0 -312
  214. package/src/views/ProductsView/icons.tsx +0 -38
  215. package/src/views/ProductsView/index.ts +0 -8
  216. package/src/views/RecoverPasswordView/README.md +0 -269
  217. package/src/views/RecoverPasswordView/RecoverPasswordView.stories.tsx +0 -131
  218. package/src/views/RecoverPasswordView/RecoverPasswordView.tsx +0 -376
  219. package/src/views/RecoverPasswordView/RecoverPasswordView.types.ts +0 -56
  220. package/src/views/RecoverPasswordView/icons.tsx +0 -17
  221. package/src/views/RecoverPasswordView/index.ts +0 -2
  222. package/src/views/SignUpView/SignUpView.stories.tsx +0 -129
  223. package/src/views/SignUpView/SignUpView.tsx +0 -503
  224. package/src/views/SignUpView/SignUpView.types.ts +0 -58
  225. package/src/views/SignUpView/icons.tsx +0 -71
  226. package/src/views/SignUpView/index.ts +0 -3
  227. package/src/views/TableLayoutView/README.md +0 -268
  228. package/src/views/TableLayoutView/TableLayoutView.stories.tsx +0 -235
  229. package/src/views/TableLayoutView/TableLayoutView.tsx +0 -461
  230. package/src/views/TableLayoutView/TableLayoutView.types.ts +0 -209
  231. package/src/views/TableLayoutView/icons.tsx +0 -113
  232. package/src/views/TableLayoutView/index.ts +0 -6
  233. package/storybook/main.ts +0 -20
  234. package/storybook/preview.tsx +0 -84
  235. package/storybook/vitest.setup.ts +0 -7
  236. package/tailwind.config.js +0 -128
@@ -1,188 +0,0 @@
1
- import { forwardRef } from 'react';
2
- import type { TextareaProps } from './Textarea.types';
3
-
4
- /**
5
- * Textarea - Componente de área de texto del sistema de diseño Siesa
6
- * Basado en especificaciones de Figma con Tailwind CSS
7
- *
8
- * Mejores prácticas implementadas:
9
- * - Orden de modificadores: {responsive}:{dark}:{state}:{utility}
10
- * - Dark mode con estrategia 'class' (darkMode: 'class')
11
- * - Focus rings adaptativos para light y dark mode
12
- * - Tokens de color consistentes con la documentación
13
- * - Estados hover, focus, disabled y error completos
14
- * - Typography: Paragraph Base (16px) para texto
15
- *
16
- * Campo de entrada de texto multi-línea con soporte para:
17
- * - Estados: default, hover, focus, filled, disabled
18
- * - Validación con mensajes de error
19
- * - Label, description y helper text
20
- * - Resize vertical, horizontal, both o none
21
- * - Dark mode completo
22
- * - Accesibilidad completa
23
- *
24
- * @see docs/colors.md - Sistema de colores
25
- * @see docs/shadows.md - Sistema de sombras
26
- * @see docs/typography.md - Sistema tipográfico (Paragraph, Label)
27
- * @see docs/spacing.md - Sistema de espaciado
28
- *
29
- * @example
30
- * ```tsx
31
- * <Textarea
32
- * label="About"
33
- * description="Tell us about yourself"
34
- * placeholder="Write a few sentences..."
35
- * helperText="Minimum 50 characters"
36
- * />
37
- * ```
38
- */
39
- export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
40
- (
41
- {
42
- label,
43
- description,
44
- helperText,
45
- error = false,
46
- errorMessage,
47
- fullWidth = false,
48
- resize = 'vertical',
49
- className = '',
50
- disabled = false,
51
- id,
52
- rows = 4,
53
- ...props
54
- },
55
- ref
56
- ) => {
57
- // Generar ID único si no se proporciona
58
- const textareaId = id || `textarea-${Math.random().toString(36).substr(2, 9)}`;
59
-
60
- // ===== CLASES BASE DEL TEXTAREA =====
61
- // Usando el sistema tipográfico Paragraph Base (16px = text-base)
62
- // Border radius rounded-lg (8px) según especificaciones de Figma
63
- // Padding: px-3 (12px) izquierda, pr-1.5 (6px) derecha para el indicador de resize
64
- const baseTextareaClasses = `
65
- w-full
66
- px-3
67
- pr-1.5
68
- py-1.5
69
- text-base
70
- leading-6
71
- font-normal
72
- bg-bg-primary
73
- border
74
- border-border-primary
75
- rounded-lg
76
- outline-none
77
- transition-all
78
- duration-150
79
- placeholder:text-content-tertiary
80
- dark:bg-dark-bg-primary
81
- dark:border-dark-border-primary
82
- dark:text-dark-content-primary
83
- dark:placeholder:text-dark-content-tertiary
84
- `;
85
-
86
- // ===== CLASES PARA ESTADOS INTERACTIVOS =====
87
- // Orden de modificadores: {responsive}:{dark}:{state}:{utility}
88
- // Hover: borde más opaco (zinc-400) según especificaciones de Figma
89
- // Focus: solo border-2 sin ring, según especificaciones de Figma
90
- const interactiveClasses = !disabled
91
- ? `
92
- hover:border-zinc-400
93
- focus:border-2
94
- focus:border-primary-custom-600
95
- dark:hover:border-zinc-500
96
- dark:focus:border-2
97
- dark:focus:border-dark-border-custom
98
- `
99
- : `
100
- opacity-50
101
- cursor-not-allowed
102
- bg-bg-secondary
103
- dark:bg-dark-bg-secondary
104
- `;
105
-
106
- // ===== CLASES PARA ESTADO DE ERROR =====
107
- // Los colores de error son los mismos en light y dark mode
108
- // Focus en error: solo border-2 sin ring, según especificaciones de Figma
109
- const errorClasses = error
110
- ? `
111
- !border-error-border
112
- focus:!border-2
113
- focus:!border-error-border
114
- dark:!border-error-border
115
- dark:focus:!border-2
116
- dark:focus:!border-error-border
117
- `
118
- : '';
119
-
120
- // ===== CLASES DE RESIZE =====
121
- const resizeClasses =
122
- resize === 'none'
123
- ? 'resize-none'
124
- : resize === 'vertical'
125
- ? 'resize-y'
126
- : resize === 'horizontal'
127
- ? 'resize-x'
128
- : 'resize';
129
-
130
- // ===== CLASES DEL CONTENEDOR =====
131
- // Ancho por defecto: 312px (según especificaciones de Figma)
132
- const containerClasses = fullWidth ? 'w-full' : 'w-[312px]';
133
-
134
- return (
135
- <div className={`flex flex-col gap-2 ${containerClasses} ${className}`}>
136
- {/* Label and Description */}
137
- {(label || description) && (
138
- <div className="flex flex-col gap-1 w-full">
139
- {label && (
140
- <label
141
- htmlFor={textareaId}
142
- className="font-bold text-sm leading-5 text-content-primary dark:text-dark-content-primary"
143
- >
144
- {label}
145
- </label>
146
- )}
147
- {description && (
148
- <p className="text-sm leading-5 text-content-secondary dark:text-dark-content-secondary">
149
- {description}
150
- </p>
151
- )}
152
- </div>
153
- )}
154
-
155
- {/* Textarea Field */}
156
- <textarea
157
- ref={ref}
158
- id={textareaId}
159
- disabled={disabled}
160
- rows={rows}
161
- className={`
162
- ${baseTextareaClasses}
163
- ${interactiveClasses}
164
- ${errorClasses}
165
- ${resizeClasses}
166
- `.trim().replace(/\s+/g, ' ')}
167
- {...props}
168
- />
169
-
170
- {/* Helper Text or Error Message */}
171
- {(helperText || errorMessage) && (
172
- <p
173
- className={`
174
- text-sm
175
- leading-5
176
- text-content-tertiary
177
- dark:text-dark-content-tertiary
178
- `.trim().replace(/\s+/g, ' ')}
179
- >
180
- {error && errorMessage ? errorMessage : helperText}
181
- </p>
182
- )}
183
- </div>
184
- );
185
- }
186
- );
187
-
188
- Textarea.displayName = 'Textarea';
@@ -1,54 +0,0 @@
1
- import type { TextareaHTMLAttributes } from 'react';
2
-
3
- /**
4
- * Estados visuales del Textarea
5
- */
6
- export type TextareaState = 'default' | 'hover' | 'focus' | 'filled' | 'disabled';
7
-
8
- /**
9
- * Props del componente Textarea
10
- */
11
- export interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'> {
12
- /**
13
- * Etiqueta del campo de texto
14
- */
15
- label?: string;
16
-
17
- /**
18
- * Descripción debajo del label (texto secundario)
19
- */
20
- description?: string;
21
-
22
- /**
23
- * Texto de ayuda debajo del textarea
24
- */
25
- helperText?: string;
26
-
27
- /**
28
- * Indica si hay un error de validación
29
- * @default false
30
- */
31
- error?: boolean;
32
-
33
- /**
34
- * Mensaje de error a mostrar (reemplaza helperText cuando error=true)
35
- */
36
- errorMessage?: string;
37
-
38
- /**
39
- * Si el textarea ocupa todo el ancho del contenedor
40
- * @default false
41
- */
42
- fullWidth?: boolean;
43
-
44
- /**
45
- * Si el textarea puede redimensionarse
46
- * @default 'vertical'
47
- */
48
- resize?: 'none' | 'vertical' | 'horizontal' | 'both';
49
-
50
- /**
51
- * Clases CSS adicionales
52
- */
53
- className?: string;
54
- }
@@ -1,99 +0,0 @@
1
- import React, { createContext, useContext, useEffect, useState } from 'react';
2
-
3
- export type Theme = 'light' | 'dark';
4
-
5
- interface ThemeContextType {
6
- theme: Theme;
7
- toggleTheme: () => void;
8
- setTheme: (theme: Theme) => void;
9
- }
10
-
11
- const ThemeContext = createContext<ThemeContextType | undefined>(undefined);
12
-
13
- interface ThemeProviderProps {
14
- children: React.ReactNode;
15
- defaultTheme?: Theme;
16
- }
17
-
18
- /**
19
- * ThemeProvider - Proveedor de contexto para el tema de la aplicación
20
- *
21
- * Maneja el estado del tema (light/dark) y lo persiste en localStorage.
22
- * Aplica la clase 'dark' al elemento HTML root cuando el tema es dark.
23
- *
24
- * @example
25
- * ```tsx
26
- * <ThemeProvider defaultTheme="light">
27
- * <App />
28
- * </ThemeProvider>
29
- * ```
30
- */
31
- export const ThemeProvider: React.FC<ThemeProviderProps> = ({
32
- children,
33
- defaultTheme = 'light'
34
- }) => {
35
- const [theme, setThemeState] = useState<Theme>(() => {
36
- // Intenta obtener el tema del localStorage
37
- if (typeof window !== 'undefined') {
38
- const savedTheme = localStorage.getItem('siesa-ui-theme') as Theme;
39
- return savedTheme || defaultTheme;
40
- }
41
- return defaultTheme;
42
- });
43
-
44
- useEffect(() => {
45
- // Aplica o remueve la clase 'dark' del elemento root
46
- const root = window.document.documentElement;
47
-
48
- if (theme === 'dark') {
49
- root.classList.add('dark');
50
- } else {
51
- root.classList.remove('dark');
52
- }
53
-
54
- // Guarda el tema en localStorage
55
- localStorage.setItem('siesa-ui-theme', theme);
56
- }, [theme]);
57
-
58
- const toggleTheme = () => {
59
- setThemeState((prev) => (prev === 'light' ? 'dark' : 'light'));
60
- };
61
-
62
- const setTheme = (newTheme: Theme) => {
63
- setThemeState(newTheme);
64
- };
65
-
66
- return (
67
- <ThemeContext.Provider value={{ theme, toggleTheme, setTheme }}>
68
- {children}
69
- </ThemeContext.Provider>
70
- );
71
- };
72
-
73
- /**
74
- * useTheme - Hook para acceder al contexto del tema
75
- *
76
- * @returns {ThemeContextType} Objeto con el tema actual y funciones para modificarlo
77
- *
78
- * @example
79
- * ```tsx
80
- * function MyComponent() {
81
- * const { theme, toggleTheme } = useTheme();
82
- *
83
- * return (
84
- * <button onClick={toggleTheme}>
85
- * Tema actual: {theme}
86
- * </button>
87
- * );
88
- * }
89
- * ```
90
- */
91
- export const useTheme = (): ThemeContextType => {
92
- const context = useContext(ThemeContext);
93
-
94
- if (context === undefined) {
95
- throw new Error('useTheme debe ser usado dentro de un ThemeProvider');
96
- }
97
-
98
- return context;
99
- };
@@ -1 +0,0 @@
1
- export { ThemeProvider, useTheme, type Theme } from './ThemeContext';
package/src/index.css DELETED
@@ -1,29 +0,0 @@
1
- /* ===== FUENTES PERSONALIZADAS ===== */
2
- @font-face {
3
- font-family: 'SiesaBT';
4
- src: url('./assets/fonts/SiesaBT/SiesaBT-Regular.otf') format('opentype');
5
- font-weight: 400;
6
- font-style: normal;
7
- font-display: swap;
8
- }
9
-
10
- @font-face {
11
- font-family: 'SiesaBT';
12
- src: url('./assets/fonts/SiesaBT/SiesaBT-Light.otf') format('opentype');
13
- font-weight: 300;
14
- font-style: normal;
15
- font-display: swap;
16
- }
17
-
18
- @font-face {
19
- font-family: 'SiesaBT';
20
- src: url('./assets/fonts/SiesaBT/SiesaBT-Bold.otf') format('opentype');
21
- font-weight: 700;
22
- font-style: normal;
23
- font-display: swap;
24
- }
25
-
26
- /* ===== TAILWIND CSS ===== */
27
- @tailwind base;
28
- @tailwind components;
29
- @tailwind utilities;
package/src/index.ts DELETED
@@ -1,102 +0,0 @@
1
- // Componentes
2
- export { Button } from './components/Button/Button';
3
- export type { ButtonProps, ButtonType, ButtonSize, ButtonState } from './components/Button/Button.types';
4
-
5
- export { Input } from './components/Input/Input';
6
- export type { InputProps, InputState } from './components/Input/Input.types';
7
-
8
- export { Textarea } from './components/Textarea/Textarea';
9
- export type { TextareaProps, TextareaState } from './components/Textarea/Textarea.types';
10
-
11
- export { Checkbox } from './components/Checkbox/Checkbox';
12
- export type { CheckboxProps, CheckboxState } from './components/Checkbox/Checkbox.types';
13
-
14
- export { Radio } from './components/Radio/Radio';
15
- export type { RadioProps, RadioState } from './components/Radio/Radio.types';
16
-
17
- export { Switch } from './components/Switch/Switch';
18
- export type { SwitchProps, SwitchState } from './components/Switch/Switch.types';
19
-
20
- export { Avatar } from './components/Avatar/Avatar';
21
- export type { AvatarProps, AvatarSize, AvatarType } from './components/Avatar/Avatar.types';
22
-
23
- export { Divider } from './components/Divider/Divider';
24
- export type { DividerProps, DividerType } from './components/Divider/Divider.types';
25
-
26
- export { DescriptionList } from './components/DescriptionList/DescriptionList';
27
- export type { DescriptionListProps } from './components/DescriptionList/DescriptionList.types';
28
-
29
- export { Alert } from './components/Alert/Alert';
30
- export type { AlertProps } from './components/Alert/Alert.types';
31
-
32
- export { Badge } from './components/Badge/Badge';
33
- export type { BadgeProps, BadgeColor } from './components/Badge/Badge.types';
34
-
35
- export { Quantity } from './components/Quantity/Quantity';
36
- export type { QuantityProps } from './components/Quantity/Quantity.types';
37
-
38
- // export { NavigationRailItem } from './components/NavigationRailItem/NavigationRailItem';
39
- // export type { NavigationRailItemProps, NavigationRailItemState } from './components/NavigationRailItem/NavigationRailItem.types';
40
-
41
- export { Dropdown } from './components/Dropdown/Dropdown';
42
- export type { DropdownProps, DropdownItemProps } from './components/Dropdown/Dropdown.types';
43
-
44
- // export { DropdownItemCollapsible } from './components/DropdownItemCollapsible/DropdownItemCollapsible';
45
- // export type { DropdownItemCollapsibleProps, DropdownItemCollapsibleChildProps } from './components/DropdownItemCollapsible/DropdownItemCollapsible.types';
46
-
47
- // export { DropdownItemHeading } from './components/DropdownItemHeading/DropdownItemHeading';
48
- // export type { DropdownItemHeadingProps } from './components/DropdownItemHeading/DropdownItemHeading.types';
49
-
50
- export { Notification } from './components/Notification/Notification';
51
- export type { NotificationProps } from './components/Notification/Notification.types';
52
-
53
- export { Pagination } from './components/Pagination/Pagination';
54
- export type { PaginationProps } from './components/Pagination/Pagination.types';
55
-
56
- export { Select } from './components/Select/Select';
57
- export type { SelectProps, SelectOption } from './components/Select/Select.types';
58
-
59
- // export { NavigationRail } from './components/NavigationRail/NavigationRail';
60
- // export type { NavigationRailItemProps as NavigationRailProps } from './components/NavigationRail/NavigationRail.types';
61
-
62
- // export { NavigationRailPanel } from './components/NavigationRailPanel/NavigationRailPanel';
63
- // export type { NavigationRailPanelProps, NavigationRailPanelSectionProps, NavigationRailPanelItemProps } from './components/NavigationRailPanel/NavigationRailPanel.types';
64
-
65
- // export { NavigationRailTypes } from './components/NavigationRailTypes/NavigationRailTypes';
66
- // export type { NavigationRailTypesProps, NavigationRailItem as NavigationRailTypeItem } from './components/NavigationRailTypes/NavigationRailTypes.types';
67
-
68
- export { Table } from './components/Table/Table';
69
- export type { TableProps, TableColumn, SortDirection } from './components/Table/Table.types';
70
-
71
- export { Tabs } from './components/Tabs/Tabs';
72
- export type { TabsProps, TabItem } from './components/Tabs/Tabs.types';
73
-
74
- export { Navbar } from './components/Navbar/Navbar';
75
- export type { NavbarProps, NavbarVariant, UserDropdownProps } from './components/Navbar/Navbar.types';
76
-
77
- export { NavigationBar } from './components/NavigationBar/NavigationBar';
78
- export type { NavigationBarProps, NavigationBarItem } from './components/NavigationBar/NavigationBar.types';
79
-
80
- export { POSConvention } from './components/POSConvention/POSConvention';
81
- export type { POSConventionProps, ConventionStatus } from './components/POSConvention/POSConvention.types';
82
-
83
- export { POSLocationButton } from './components/POSLocationButton/POSLocationButton';
84
- export type { POSLocationButtonProps, POSLocationStatus, POSLocationState, POSLocationCapacity } from './components/POSLocationButton/POSLocationButton.types';
85
-
86
- export { POSNumberButton } from './components/POSNumberButton/POSNumberButton';
87
- export type { POSNumberButtonProps } from './components/POSNumberButton/POSNumberButton.types';
88
-
89
- export { POSProductButton } from './components/POSProductButton/POSProductButton';
90
- export type { POSProductButtonProps } from './components/POSProductButton/POSProductButton.types';
91
-
92
- export { POSProductCard } from './components/POSProductCard/POSProductCard';
93
- export type { POSProductCardProps } from './components/POSProductCard/POSProductCard.types';
94
-
95
- export { POSProductSidebarItems } from './components/POSProductSidebarItems/POSProductSidebarItems';
96
- export type { POSProductSidebarItemsProps, DescriptionItem } from './components/POSProductSidebarItems/POSProductSidebarItems.types';
97
-
98
- export { POSTable } from './components/POSTable/POSTable';
99
- export type { POSTableProps, TableStatus, TableShape, ChairCount } from './components/POSTable/POSTable.types';
100
-
101
- // Context y Hooks
102
- export { ThemeProvider, useTheme, type Theme } from './context';
package/src/main.tsx DELETED
@@ -1,10 +0,0 @@
1
- import { StrictMode } from 'react'
2
- import { createRoot } from 'react-dom/client'
3
- import './index.css'
4
- import App from './App.tsx'
5
-
6
- createRoot(document.getElementById('root')!).render(
7
- <StrictMode>
8
- <App />
9
- </StrictMode>,
10
- )