siesa-ui-kit 1.0.0

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/README.md +89 -0
  2. package/bin/install.cjs +502 -0
  3. package/bin/prepare-publish.cjs +28 -0
  4. package/bin/restore-folders.cjs +28 -0
  5. package/claude/agents/siesa-ui-kit-specialist.md +2401 -0
  6. package/claude/prompts/component-template.md +121 -0
  7. package/claude/settings.local.json +61 -0
  8. package/docs/border-radius.md +1261 -0
  9. package/docs/colors.md +832 -0
  10. package/docs/dark-mode-guide.md +1426 -0
  11. package/docs/filters.md +1243 -0
  12. package/docs/icons.md +1283 -0
  13. package/docs/shadows.md +1377 -0
  14. package/docs/spacing.md +1684 -0
  15. package/docs/typography.md +1268 -0
  16. package/package.json +83 -0
  17. package/postcss.config.cjs +6 -0
  18. package/public/,Business Logo.png +0 -0
  19. package/public/.Siesa Logo.png +0 -0
  20. package/public/bg_siesa.png +0 -0
  21. package/public/siesa_logo_mobile.png +0 -0
  22. package/public/vite.svg +1 -0
  23. package/src/App.css +42 -0
  24. package/src/App.tsx +8 -0
  25. package/src/ButtonTest.tsx +147 -0
  26. package/src/assets/fonts/README.md +261 -0
  27. package/src/assets/fonts/SiesaBT/SiesaBT-Bold.otf +0 -0
  28. package/src/assets/fonts/SiesaBT/SiesaBT-Light.otf +0 -0
  29. package/src/assets/fonts/SiesaBT/SiesaBT-Regular.otf +0 -0
  30. package/src/assets/react.svg +1 -0
  31. package/src/components/Alert/Alert.stories.tsx +332 -0
  32. package/src/components/Alert/Alert.tsx +106 -0
  33. package/src/components/Alert/Alert.types.ts +54 -0
  34. package/src/components/Avatar/Avatar.stories.tsx +494 -0
  35. package/src/components/Avatar/Avatar.tsx +143 -0
  36. package/src/components/Avatar/Avatar.types.ts +53 -0
  37. package/src/components/Badge/Badge.stories.tsx +339 -0
  38. package/src/components/Badge/Badge.tsx +278 -0
  39. package/src/components/Badge/Badge.types.ts +58 -0
  40. package/src/components/Button/Button.stories.tsx +950 -0
  41. package/src/components/Button/Button.tsx +337 -0
  42. package/src/components/Button/Button.types.ts +180 -0
  43. package/src/components/Button/icons.tsx +87 -0
  44. package/src/components/Button/index.ts +3 -0
  45. package/src/components/Checkbox/Checkbox.stories.tsx +453 -0
  46. package/src/components/Checkbox/Checkbox.tsx +208 -0
  47. package/src/components/Checkbox/Checkbox.types.ts +61 -0
  48. package/src/components/DescriptionList/DescriptionList.stories.tsx +250 -0
  49. package/src/components/DescriptionList/DescriptionList.tsx +96 -0
  50. package/src/components/DescriptionList/DescriptionList.types.ts +29 -0
  51. package/src/components/Divider/Divider.stories.tsx +263 -0
  52. package/src/components/Divider/Divider.tsx +80 -0
  53. package/src/components/Divider/Divider.types.ts +24 -0
  54. package/src/components/Dropdown/Dropdown.stories.tsx +552 -0
  55. package/src/components/Dropdown/Dropdown.tsx +422 -0
  56. package/src/components/Dropdown/Dropdown.types.ts +146 -0
  57. package/src/components/Dropdown/README.md +266 -0
  58. package/src/components/Dropdown/icons.tsx +72 -0
  59. package/src/components/Dropdown/index.ts +8 -0
  60. package/src/components/Input/Input.stories.tsx +583 -0
  61. package/src/components/Input/Input.tsx +204 -0
  62. package/src/components/Input/Input.types.ts +80 -0
  63. package/src/components/Input/icons.tsx +145 -0
  64. package/src/components/Input/index.ts +2 -0
  65. package/src/components/LoginView/LoginView.stories.tsx +148 -0
  66. package/src/components/LoginView/LoginView.tsx +426 -0
  67. package/src/components/LoginView/LoginView.types.ts +52 -0
  68. package/src/components/LoginView/README.md +396 -0
  69. package/src/components/LoginView/icons.tsx +85 -0
  70. package/src/components/LoginView/index.ts +3 -0
  71. package/src/components/Navbar/Navbar.stories.tsx +810 -0
  72. package/src/components/Navbar/Navbar.tsx +755 -0
  73. package/src/components/Navbar/Navbar.types.ts +219 -0
  74. package/src/components/Navbar/README.md +279 -0
  75. package/src/components/Navbar/icons.tsx +102 -0
  76. package/src/components/Navbar/index.ts +8 -0
  77. package/src/components/NavigationBar/NavigationBar.stories.tsx +406 -0
  78. package/src/components/NavigationBar/NavigationBar.tsx +246 -0
  79. package/src/components/NavigationBar/NavigationBar.types.ts +74 -0
  80. package/src/components/NavigationBar/README.md +469 -0
  81. package/src/components/NavigationBar/index.ts +2 -0
  82. package/src/components/NavigationRail/NavigationRail.stories.tsx +417 -0
  83. package/src/components/NavigationRail/NavigationRail.tsx +418 -0
  84. package/src/components/NavigationRail/NavigationRail.types.ts +109 -0
  85. package/src/components/NavigationRail/README.md +224 -0
  86. package/src/components/NavigationRail/index.ts +2 -0
  87. package/src/components/Notification/Notification.stories.tsx +513 -0
  88. package/src/components/Notification/Notification.tsx +145 -0
  89. package/src/components/Notification/Notification.types.ts +142 -0
  90. package/src/components/Notification/README.md +409 -0
  91. package/src/components/Notification/index.ts +3 -0
  92. package/src/components/POSConvention/POSConvention.stories.tsx +235 -0
  93. package/src/components/POSConvention/POSConvention.tsx +129 -0
  94. package/src/components/POSConvention/POSConvention.types.ts +38 -0
  95. package/src/components/POSConvention/README.md +123 -0
  96. package/src/components/POSConvention/icons.tsx +45 -0
  97. package/src/components/POSConvention/index.ts +3 -0
  98. package/src/components/POSLocationButton/POSLocationButton.stories.tsx +531 -0
  99. package/src/components/POSLocationButton/POSLocationButton.tsx +247 -0
  100. package/src/components/POSLocationButton/POSLocationButton.types.ts +87 -0
  101. package/src/components/POSLocationButton/README.md +253 -0
  102. package/src/components/POSLocationButton/icons.tsx +120 -0
  103. package/src/components/POSLocationButton/index.ts +14 -0
  104. package/src/components/POSNumberButton/POSNumberButton.stories.tsx +415 -0
  105. package/src/components/POSNumberButton/POSNumberButton.tsx +179 -0
  106. package/src/components/POSNumberButton/POSNumberButton.types.ts +51 -0
  107. package/src/components/POSNumberButton/README.md +321 -0
  108. package/src/components/POSNumberButton/index.ts +3 -0
  109. package/src/components/POSProductButton/POSProductButton.stories.tsx +318 -0
  110. package/src/components/POSProductButton/POSProductButton.tsx +152 -0
  111. package/src/components/POSProductButton/POSProductButton.types.ts +46 -0
  112. package/src/components/POSProductButton/README.md +269 -0
  113. package/src/components/POSProductButton/index.ts +2 -0
  114. package/src/components/POSProductCard/POSProductCard.stories.tsx +642 -0
  115. package/src/components/POSProductCard/POSProductCard.tsx +208 -0
  116. package/src/components/POSProductCard/POSProductCard.types.ts +76 -0
  117. package/src/components/POSProductCard/README.md +179 -0
  118. package/src/components/POSProductCard/icons.tsx +26 -0
  119. package/src/components/POSProductCard/index.ts +2 -0
  120. package/src/components/POSProductSidebarItems/POSProductSidebarItems.stories.tsx +753 -0
  121. package/src/components/POSProductSidebarItems/POSProductSidebarItems.tsx +332 -0
  122. package/src/components/POSProductSidebarItems/POSProductSidebarItems.types.ts +119 -0
  123. package/src/components/POSProductSidebarItems/README.md +198 -0
  124. package/src/components/POSProductSidebarItems/icons.tsx +21 -0
  125. package/src/components/POSProductSidebarItems/index.ts +3 -0
  126. package/src/components/POSTable/POSTable.stories.tsx +737 -0
  127. package/src/components/POSTable/POSTable.tsx +401 -0
  128. package/src/components/POSTable/POSTable.types.ts +83 -0
  129. package/src/components/POSTable/README.md +286 -0
  130. package/src/components/POSTable/index.ts +7 -0
  131. package/src/components/Pagination/Pagination.stories.tsx +555 -0
  132. package/src/components/Pagination/Pagination.tsx +286 -0
  133. package/src/components/Pagination/Pagination.types.ts +93 -0
  134. package/src/components/Pagination/README.md +298 -0
  135. package/src/components/Pagination/icons.tsx +47 -0
  136. package/src/components/Pagination/index.ts +3 -0
  137. package/src/components/Quantity/Quantity.stories.tsx +457 -0
  138. package/src/components/Quantity/Quantity.tsx +289 -0
  139. package/src/components/Quantity/Quantity.types.ts +70 -0
  140. package/src/components/Radio/Radio.stories.tsx +523 -0
  141. package/src/components/Radio/Radio.tsx +170 -0
  142. package/src/components/Radio/Radio.types.ts +122 -0
  143. package/src/components/Select/README.md +299 -0
  144. package/src/components/Select/Select.stories.tsx +673 -0
  145. package/src/components/Select/Select.tsx +454 -0
  146. package/src/components/Select/Select.types.ts +148 -0
  147. package/src/components/Select/icons.tsx +50 -0
  148. package/src/components/Select/index.ts +3 -0
  149. package/src/components/SignUpView/SignUpView.stories.tsx +129 -0
  150. package/src/components/SignUpView/SignUpView.tsx +503 -0
  151. package/src/components/SignUpView/SignUpView.types.ts +58 -0
  152. package/src/components/SignUpView/icons.tsx +71 -0
  153. package/src/components/SignUpView/index.ts +3 -0
  154. package/src/components/Switch/README.md +112 -0
  155. package/src/components/Switch/Switch.stories.tsx +550 -0
  156. package/src/components/Switch/Switch.tsx +246 -0
  157. package/src/components/Switch/Switch.types.ts +67 -0
  158. package/src/components/Table/README.md +369 -0
  159. package/src/components/Table/Table.stories.tsx +805 -0
  160. package/src/components/Table/Table.tsx +688 -0
  161. package/src/components/Table/Table.types.ts +204 -0
  162. package/src/components/Table/index.ts +9 -0
  163. package/src/components/Tabs/README.md +201 -0
  164. package/src/components/Tabs/Tabs.stories.tsx +580 -0
  165. package/src/components/Tabs/Tabs.tsx +356 -0
  166. package/src/components/Tabs/Tabs.types.ts +127 -0
  167. package/src/components/Tabs/icons.tsx +129 -0
  168. package/src/components/Tabs/index.ts +11 -0
  169. package/src/components/Textarea/Textarea.stories.tsx +535 -0
  170. package/src/components/Textarea/Textarea.tsx +188 -0
  171. package/src/components/Textarea/Textarea.types.ts +54 -0
  172. package/src/context/ThemeContext.tsx +99 -0
  173. package/src/context/index.ts +1 -0
  174. package/src/index.css +29 -0
  175. package/src/index.ts +39 -0
  176. package/src/main.tsx +10 -0
  177. package/src/views/ProductsView/ProductsView.stories.tsx +344 -0
  178. package/src/views/ProductsView/ProductsView.tsx +480 -0
  179. package/src/views/ProductsView/ProductsView.types.ts +238 -0
  180. package/src/views/ProductsView/README.md +312 -0
  181. package/src/views/ProductsView/icons.tsx +38 -0
  182. package/src/views/ProductsView/index.ts +8 -0
  183. package/src/views/RecoverPasswordView/README.md +269 -0
  184. package/src/views/RecoverPasswordView/RecoverPasswordView.stories.tsx +131 -0
  185. package/src/views/RecoverPasswordView/RecoverPasswordView.tsx +376 -0
  186. package/src/views/RecoverPasswordView/RecoverPasswordView.types.ts +56 -0
  187. package/src/views/RecoverPasswordView/icons.tsx +17 -0
  188. package/src/views/RecoverPasswordView/index.ts +2 -0
  189. package/src/views/TableLayoutView/README.md +268 -0
  190. package/src/views/TableLayoutView/TableLayoutView.stories.tsx +235 -0
  191. package/src/views/TableLayoutView/TableLayoutView.tsx +461 -0
  192. package/src/views/TableLayoutView/TableLayoutView.types.ts +209 -0
  193. package/src/views/TableLayoutView/icons.tsx +113 -0
  194. package/src/views/TableLayoutView/index.ts +6 -0
  195. package/storybook/main.ts +20 -0
  196. package/storybook/preview.tsx +84 -0
  197. package/storybook/vitest.setup.ts +7 -0
  198. package/tailwind.config.js +128 -0
@@ -0,0 +1,188 @@
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';
@@ -0,0 +1,54 @@
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
+ }
@@ -0,0 +1,99 @@
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
+ };
@@ -0,0 +1 @@
1
+ export { ThemeProvider, useTheme, type Theme } from './ThemeContext';
package/src/index.css ADDED
@@ -0,0 +1,29 @@
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 ADDED
@@ -0,0 +1,39 @@
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
+ // Context y Hooks
39
+ export { ThemeProvider, useTheme, type Theme } from './context';
package/src/main.tsx ADDED
@@ -0,0 +1,10 @@
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
+ )