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,287 +0,0 @@
1
- import React, { useState } from 'react';
2
- import type {
3
- DropdownItemCollapsibleProps,
4
- DropdownItemCollapsibleChildProps,
5
- } from './DropdownItemCollapsible.types';
6
- import { ChevronDownIcon } from './icons';
7
-
8
- /**
9
- * Componente DropdownItemCollapsible del sistema de diseño Siesa
10
- *
11
- * Item colapsable para uso dentro de Dropdowns que permite agrupar
12
- * items relacionados en secciones expandibles.
13
- *
14
- * **Características:**
15
- * - Soporte completo para expandir/colapsar
16
- * - Iconos personalizables en header y children
17
- * - Items anidados indentados automáticamente
18
- * - Dark mode completo con inversión de colores
19
- * - Estados: default, hover, active, disabled
20
- * - Focus rings adaptativos
21
- * - Animación suave de rotación del chevron
22
- *
23
- * **Estados visuales:**
24
- * - `collapsed`: Muestra solo el header con chevron apuntando down
25
- * - `expanded`: Muestra header y lista de items anidados
26
- * - `disabled`: Opacidad 50%, sin interacción
27
- * - `hover`: Fondo de hover sutil, color primario del icono
28
- * - `active`: Item anidado seleccionado con fondo custom-primary
29
- *
30
- * **Espaciado según Figma:**
31
- * - Header padding: px-4 py-2 (16px horizontal, 8px vertical)
32
- * - Item anidado padding: pl-6 pr-4 py-2 (24px left, 16px right, 8px vertical)
33
- * - Gap entre elementos: gap-3 (12px)
34
- * - Gap interno (icon + text): gap-3 (12px)
35
- * - Indent entre niveles: 8px adicional por nivel
36
- * - Divisor: borde top de 1px con spacing-0.5 (2px) arriba
37
- * - Sección heading: pt-3 pb-1 px-0 (12px top, 4px bottom, sin horizontal)
38
- *
39
- * **Tipografía:**
40
- * - Header: Paragraph/Small (14px, Regular, line-height 20px) - text-content-primary
41
- * - Items anidados: Paragraph/Small (14px, Regular, line-height 20px) - text-content-primary
42
- * - Heading: Paragraph/Tiny (12px, Regular, line-height 16px) - text-content-tertiary
43
- *
44
- * **Colores (Light Mode):**
45
- * - Header text: content-primary (#18181b)
46
- * - Header icon: content-secondary (#a1a1aa)
47
- * - Header hover: bg-background-custom-primary (#dbeefe)
48
- * - Header text hover: content-custom-primary (#0e79fd)
49
- * - Item text: content-primary (#18181b)
50
- * - Item hover: bg-transparent (sin fondo)
51
- * - Divider: border-border-primary (#e4e4e7)
52
- * - Heading text: content-tertiary (#71717a)
53
- *
54
- * **Colores (Dark Mode):**
55
- * - Header text: content-primary/dark (#fafafa)
56
- * - Header icon: content-secondary/dark (#a1a1aa)
57
- * - Header hover: bg-background-custom-primary/dark (#0e5ab0)
58
- * - Header text hover: content-custom-primary/dark (#bfe2fe)
59
- * - Item text: content-primary/dark (#fafafa)
60
- * - Divider: border-border-primary/dark (#3f3f46)
61
- * - Heading text: content-tertiary/dark (#a1a1aa)
62
- *
63
- * **Border radius:**
64
- * - Todos los items: rounded-lg (8px)
65
- *
66
- * **Sombras:**
67
- * - Ninguna (usado dentro de dropdowns)
68
- *
69
- * @see docs/colors.md - Sistema de colores
70
- * @see docs/typography.md - Sistema tipográfico
71
- * @see docs/spacing.md - Sistema de espaciado
72
- * @see https://www.figma.com/design/5XNqf2YTxvwemxwo1LMQ6j/Siesa-UI-Kit?node-id=6135-34374
73
- *
74
- * @example
75
- * ```tsx
76
- * // Item colapsable simple
77
- * <DropdownItemCollapsible
78
- * label="Users"
79
- * icon={<UserIcon />}
80
- * children={[
81
- * { label: "Active Users", icon: <CheckIcon /> },
82
- * { label: "Inactive Users", icon: <CloseIcon /> },
83
- * ]}
84
- * />
85
- *
86
- * // Con encabezado de sección
87
- * <DropdownItemCollapsible
88
- * label="Customers"
89
- * icon={<BuildingIcon />}
90
- * showHeading={true}
91
- * headingLabel="SECTION 1"
92
- * children={[...]}
93
- * />
94
- *
95
- * // Item no colapsable (actúa como botón normal)
96
- * <DropdownItemCollapsible
97
- * label="Single Item"
98
- * icon={<StarIcon />}
99
- * isCollapsible={false}
100
- * onClick={() => console.log('clicked')}
101
- * />
102
- * ```
103
- */
104
- export const DropdownItemCollapsible: React.FC<DropdownItemCollapsibleProps> = ({
105
- label,
106
- icon,
107
- children = [],
108
- defaultOpen = false,
109
- disabled = false,
110
- onOpenChange,
111
- onClick,
112
- isCollapsible = children.length > 0,
113
- showHeading = false,
114
- headingLabel,
115
- showDivider = true,
116
- className = '',
117
- }) => {
118
- const [isOpen, setIsOpen] = useState(defaultOpen);
119
-
120
- const handleToggle = () => {
121
- if (disabled || !isCollapsible) return;
122
-
123
- const newOpen = !isOpen;
124
- setIsOpen(newOpen);
125
- onOpenChange?.(newOpen);
126
- };
127
-
128
- const handleHeaderClick = (e: React.MouseEvent<HTMLButtonElement>) => {
129
- if (disabled) return;
130
-
131
- if (isCollapsible) {
132
- handleToggle();
133
- } else {
134
- onClick?.(e);
135
- }
136
- };
137
-
138
- const handleChildClick = (child: DropdownItemCollapsibleChildProps) => (
139
- e: React.MouseEvent<HTMLDivElement>,
140
- ) => {
141
- if (child.disabled) return;
142
- child.onClick?.(e);
143
- };
144
-
145
- return (
146
- <div className={`flex flex-col gap-0.5 w-full ${className}`}>
147
- {/* Section Heading */}
148
- {showHeading && headingLabel && (
149
- <div className="flex flex-col gap-0 items-start pb-1 pt-3 px-0 w-full">
150
- <p className="font-['Inter:Regular',sans-serif] font-normal leading-4 not-italic text-xs text-content-tertiary dark:text-content-tertiary w-full">
151
- {headingLabel}
152
- </p>
153
- </div>
154
- )}
155
-
156
- {/* Header Button */}
157
- <button
158
- onClick={handleHeaderClick}
159
- disabled={disabled}
160
- className={[
161
- // Base
162
- 'flex items-center gap-3 px-4 py-2 w-full',
163
- 'rounded-lg cursor-pointer',
164
- 'transition-all duration-150',
165
-
166
- // Colores y estados (Light Mode)
167
- !disabled && 'text-content-primary',
168
- !disabled && 'hover:bg-primary-custom-100',
169
- !disabled && 'hover:text-primary-custom-600',
170
-
171
- // Dark Mode
172
- !disabled && 'dark:text-content-primary',
173
- !disabled && 'dark:hover:bg-dark-bg-custom',
174
- !disabled && 'dark:hover:text-dark-content-custom',
175
-
176
- // Focus ring
177
- !disabled && 'focus:outline-none',
178
- !disabled && 'focus:ring-2',
179
- !disabled && 'focus:ring-offset-2',
180
- !disabled && 'focus:ring-primary-custom-400',
181
- !disabled && 'focus:ring-offset-bg-primary',
182
- !disabled && 'dark:focus:ring-offset-dark-bg-primary',
183
-
184
- // Disabled
185
- disabled && 'opacity-50',
186
- disabled && 'cursor-not-allowed',
187
- ]
188
- .filter(Boolean)
189
- .join(' ')}
190
- aria-expanded={isOpen && isCollapsible}
191
- aria-disabled={disabled}
192
- >
193
- {/* Icon Wrapper */}
194
- {icon && (
195
- <div className="flex items-center justify-center w-4 h-4 shrink-0 text-content-secondary dark:text-content-secondary">
196
- {icon}
197
- </div>
198
- )}
199
-
200
- {/* Content Wrapper */}
201
- <div className="flex flex-1 flex-col items-start justify-center gap-0.5">
202
- <p className="font-['Inter:Regular',sans-serif] font-normal leading-5 not-italic text-sm text-left">
203
- {label}
204
- </p>
205
- </div>
206
-
207
- {/* Chevron (solo visible si es colapsable) */}
208
- {isCollapsible && (
209
- <div
210
- className={[
211
- 'flex items-center justify-center w-4 h-4 shrink-0',
212
- 'text-content-secondary dark:text-content-secondary',
213
- 'transition-transform duration-200',
214
- isOpen ? 'rotate-180' : 'rotate-0',
215
- ].join(' ')}
216
- >
217
- <ChevronDownIcon className="w-4 h-4" />
218
- </div>
219
- )}
220
- </button>
221
-
222
- {/* Divider */}
223
- {showDivider && <div className="w-full h-px bg-border-primary dark:bg-dark-border-primary" />}
224
-
225
- {/* Children Container (expanded) */}
226
- {isOpen && isCollapsible && children.length > 0 && (
227
- <div className="flex flex-col gap-0.5 w-full py-2 px-0">
228
- {children.map((child, index) => (
229
- <div
230
- key={index}
231
- onClick={handleChildClick(child)}
232
- className={[
233
- // Base
234
- 'flex gap-3 items-center pl-6 pr-4 py-2 w-full',
235
- 'rounded-lg cursor-pointer',
236
- 'transition-all duration-150',
237
-
238
- // Colores y estados (Light Mode)
239
- !child.disabled && 'text-content-primary',
240
- !child.disabled && 'hover:bg-primary-custom-100',
241
- !child.disabled && 'hover:text-primary-custom-600',
242
-
243
- // Dark Mode
244
- !child.disabled && 'dark:text-content-primary',
245
- !child.disabled && 'dark:hover:bg-dark-bg-custom',
246
- !child.disabled && 'dark:hover:text-dark-content-custom',
247
-
248
- // Focus ring
249
- !child.disabled && 'focus:outline-none',
250
- !child.disabled && 'focus:ring-2',
251
- !child.disabled && 'focus:ring-offset-2',
252
- !child.disabled && 'focus:ring-primary-custom-400',
253
- !child.disabled && 'focus:ring-offset-bg-primary',
254
- !child.disabled && 'dark:focus:ring-offset-dark-bg-primary',
255
-
256
- // Disabled
257
- child.disabled && 'opacity-50',
258
- child.disabled && 'cursor-not-allowed',
259
-
260
- // Custom classes
261
- child.className,
262
- ]
263
- .filter(Boolean)
264
- .join(' ')}
265
- >
266
- {/* Child Icon Wrapper */}
267
- {child.icon && (
268
- <div className="flex items-center justify-center w-4 h-4 shrink-0 text-content-secondary dark:text-content-secondary">
269
- {child.icon}
270
- </div>
271
- )}
272
-
273
- {/* Child Content Wrapper */}
274
- <div className="flex flex-1 flex-col items-start justify-center gap-0.5">
275
- <p className="font-['Inter:Regular',sans-serif] font-normal leading-5 not-italic text-sm text-left">
276
- {child.label}
277
- </p>
278
- </div>
279
- </div>
280
- ))}
281
- </div>
282
- )}
283
- </div>
284
- );
285
- };
286
-
287
- export default DropdownItemCollapsible;
@@ -1,111 +0,0 @@
1
- import type { ReactNode } from 'react';
2
-
3
- /**
4
- * Props del componente DropdownItemCollapsible
5
- *
6
- * @see https://www.figma.com/design/5XNqf2YTxvwemxwo1LMQ6j/Siesa-UI-Kit?node-id=6135-34374
7
- */
8
- export interface DropdownItemCollapsibleProps {
9
- /**
10
- * Texto o contenido principal del item
11
- * Ejemplo: "Users", "Customers", "Departments"
12
- */
13
- label: string;
14
-
15
- /**
16
- * Icono a mostrar antes del texto (izquierda)
17
- * Recomendado: 16x16px
18
- */
19
- icon?: ReactNode;
20
-
21
- /**
22
- * Items anidados que se muestran cuando el item está expandido
23
- * Cada item anidado tiene label e icono opcional
24
- */
25
- children?: DropdownItemCollapsibleChildProps[];
26
-
27
- /**
28
- * Si el item está expandido inicialmente
29
- * @default false
30
- */
31
- defaultOpen?: boolean;
32
-
33
- /**
34
- * Si el item está deshabilitado
35
- * @default false
36
- */
37
- disabled?: boolean;
38
-
39
- /**
40
- * Callback cuando el item se expande/contrae
41
- * @param open - nuevo estado de expansión
42
- */
43
- onOpenChange?: (open: boolean) => void;
44
-
45
- /**
46
- * Callback cuando se hace click en el item (sin expandir)
47
- * Útil para items que actúan como botones normales
48
- */
49
- onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
50
-
51
- /**
52
- * Si el item debería actuar como un botón normal sin colapsable
53
- * @default false
54
- */
55
- isCollapsible?: boolean;
56
-
57
- /**
58
- * Si mostrar un encabezado de sección antes del item
59
- * @default false
60
- */
61
- showHeading?: boolean;
62
-
63
- /**
64
- * Texto del encabezado de sección
65
- * Se usa cuando showHeading es true
66
- * Ejemplo: "Section Title"
67
- */
68
- headingLabel?: string;
69
-
70
- /**
71
- * Si mostrar divisor después del item/encabezado
72
- * @default true
73
- */
74
- showDivider?: boolean;
75
-
76
- /**
77
- * Clases CSS adicionales
78
- */
79
- className?: string;
80
- }
81
-
82
- /**
83
- * Props de items anidados dentro del colapsable
84
- */
85
- export interface DropdownItemCollapsibleChildProps {
86
- /**
87
- * Texto del item anidado
88
- */
89
- label: string;
90
-
91
- /**
92
- * Icono opcional del item anidado
93
- */
94
- icon?: ReactNode;
95
-
96
- /**
97
- * Si el item anidado está deshabilitado
98
- * @default false
99
- */
100
- disabled?: boolean;
101
-
102
- /**
103
- * Callback cuando se hace click en el item anidado
104
- */
105
- onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
106
-
107
- /**
108
- * Clases CSS adicionales
109
- */
110
- className?: string;
111
- }
@@ -1,264 +0,0 @@
1
- # DropdownItemCollapsible
2
-
3
- Item colapsable para uso dentro de Dropdowns que permite agrupar items relacionados en secciones expandibles.
4
-
5
- ## 🎯 Propósito
6
-
7
- El componente `DropdownItemCollapsible` es un item especializado de dropdown que:
8
-
9
- - Agrupa items relacionados en secciones expandibles
10
- - Muestra/oculta items anidados con animación suave
11
- - Mantiene jerarquía visual clara con indentación
12
- - Soporta iconos personalizables
13
- - Proporciona feedback visual completo (hover, focus, active, disabled)
14
- - Implementa dark mode completo
15
-
16
- ## 📋 Uso
17
-
18
- ### Básico
19
-
20
- ```tsx
21
- import { DropdownItemCollapsible } from '@/components/DropdownItemCollapsible';
22
- import { UserIcon } from '@/components/DropdownItemCollapsible/icons';
23
-
24
- <DropdownItemCollapsible
25
- label="Users"
26
- icon={<UserIcon />}
27
- children={[
28
- { label: 'Active Users' },
29
- { label: 'Inactive Users' },
30
- ]}
31
- />
32
- ```
33
-
34
- ### Con Encabezado de Sección
35
-
36
- ```tsx
37
- <DropdownItemCollapsible
38
- label="Customers"
39
- icon={<CustomerIcon />}
40
- showHeading={true}
41
- headingLabel="SECTION 1"
42
- children={[
43
- { label: 'Enterprise' },
44
- { label: 'SMB' },
45
- { label: 'Startup' },
46
- ]}
47
- showDivider={true}
48
- />
49
- ```
50
-
51
- ### Expandido por Defecto
52
-
53
- ```tsx
54
- <DropdownItemCollapsible
55
- label="Departments"
56
- icon={<DepartmentIcon />}
57
- defaultOpen={true}
58
- children={[
59
- { label: 'Sales' },
60
- { label: 'Marketing' },
61
- { label: 'Engineering' },
62
- ]}
63
- />
64
- ```
65
-
66
- ### Item Simple (No Colapsable)
67
-
68
- ```tsx
69
- <DropdownItemCollapsible
70
- label="Settings"
71
- icon={<SettingsIcon />}
72
- isCollapsible={false}
73
- onClick={() => console.log('Settings clicked')}
74
- />
75
- ```
76
-
77
- ### Con Callbacks
78
-
79
- ```tsx
80
- <DropdownItemCollapsible
81
- label="Actions"
82
- children={[
83
- {
84
- label: 'Edit',
85
- onClick: (e) => console.log('Edit clicked'),
86
- },
87
- {
88
- label: 'Delete',
89
- onClick: (e) => console.log('Delete clicked'),
90
- },
91
- ]}
92
- onOpenChange={(open) => console.log('Toggle:', open)}
93
- />
94
- ```
95
-
96
- ## 🎨 Props
97
-
98
- ### Interfaz `DropdownItemCollapsibleProps`
99
-
100
- | Prop | Tipo | Defecto | Descripción |
101
- |------|------|---------|-------------|
102
- | `label` | `string` | **Requerido** | Texto principal del item |
103
- | `icon` | `ReactNode` | `undefined` | Icono a mostrar antes del texto (16x16px recomendado) |
104
- | `children` | `DropdownItemCollapsibleChildProps[]` | `[]` | Items anidados cuando está expandido |
105
- | `defaultOpen` | `boolean` | `false` | Si el item está expandido inicialmente |
106
- | `disabled` | `boolean` | `false` | Si el item está deshabilitado |
107
- | `onOpenChange` | `(open: boolean) => void` | `undefined` | Callback cuando se expande/contrae |
108
- | `onClick` | `(e: React.MouseEvent) => void` | `undefined` | Callback cuando se hace click (para items no colapsables) |
109
- | `isCollapsible` | `boolean` | `true si children.length > 0` | Si el item puede expanderse/contraerse |
110
- | `showHeading` | `boolean` | `false` | Si mostrar encabezado de sección |
111
- | `headingLabel` | `string` | `undefined` | Texto del encabezado (se usa si showHeading es true) |
112
- | `showDivider` | `boolean` | `true` | Si mostrar divisor después del item |
113
- | `className` | `string` | `''` | Clases CSS adicionales |
114
-
115
- ### Interfaz `DropdownItemCollapsibleChildProps`
116
-
117
- | Prop | Tipo | Defecto | Descripción |
118
- |------|------|---------|-------------|
119
- | `label` | `string` | **Requerido** | Texto del item anidado |
120
- | `icon` | `ReactNode` | `undefined` | Icono opcional (16x16px recomendado) |
121
- | `disabled` | `boolean` | `false` | Si el item está deshabilitado |
122
- | `onClick` | `(e: React.MouseEvent) => void` | `undefined` | Callback cuando se hace click |
123
- | `className` | `string` | `''` | Clases CSS adicionales |
124
-
125
- ## 🎯 Estados
126
-
127
- ### Visual States
128
-
129
- - **Default**: Colores base del sistema
130
- - **Hover**: Fondo `background-custom-primary`, texto `content-custom-primary`
131
- - **Focus**: Ring de 2px con offset (adaptive dark mode)
132
- - **Active**: Animación scale-95 para feedback táctil
133
- - **Disabled**: Opacidad 50%, sin interacción
134
-
135
- ### Colapsable States
136
-
137
- - **Collapsed**: Solo muestra header, chevron apunta down
138
- - **Expanded**: Muestra header + lista de items anidados
139
- - **Chevron Animation**: Rotación suave de 180° al expandir/contraer
140
-
141
- ## 🌓 Dark Mode
142
-
143
- El componente soporta dark mode completo:
144
-
145
- | Elemento | Light | Dark |
146
- |----------|-------|------|
147
- | Header text | `content-primary` | `content-primary/dark` |
148
- | Header icon | `content-secondary` | `content-secondary/dark` |
149
- | Header hover | `bg-background-custom-primary` | `bg-background-custom-primary/dark` |
150
- | Item text | `content-primary` | `content-primary/dark` |
151
- | Divider | `border-border-primary` | `border-border-primary/dark` |
152
- | Heading | `content-tertiary` | `content-tertiary/dark` |
153
- | Focus ring offset | `background-primary` | `background-primary/dark` |
154
-
155
- ## 📐 Espaciado
156
-
157
- Basado en especificaciones de Figma:
158
-
159
- ```
160
- ┌─────────────────────────────────────┐
161
- │ Section Heading (pt-3 pb-1) │
162
- ├─────────────────────────────────────┤
163
- │ ┌───────────────────────────────┐ │
164
- │ │ 🎯 Header (px-4 py-2) │ │ gap-3
165
- │ └───────────────────────────────┘ │
166
- ├─────────────────────────────────────┤
167
- │ ┌───────────────────────────────┐ │
168
- │ │ ├─ Item 1 (pl-6 pr-4 py-2) │ │ gap-0.5
169
- │ │ ├─ Item 2 │ │
170
- │ │ └─ Item 3 │ │
171
- │ └───────────────────────────────┘ │
172
- ├─────────────────────────────────────┤
173
- │ Divider (h-px, color: border-primary)│
174
- └─────────────────────────────────────┘
175
- ```
176
-
177
- ## 🔧 Personalización
178
-
179
- ### Con Tailwind CSS
180
-
181
- ```tsx
182
- <DropdownItemCollapsible
183
- label="Custom Styled"
184
- className="my-custom-class"
185
- children={[
186
- {
187
- label: "Item",
188
- className: "custom-child-class"
189
- }
190
- ]}
191
- />
192
- ```
193
-
194
- ### Iconos Personalizados
195
-
196
- ```tsx
197
- import { MyCustomIcon } from '@/icons';
198
-
199
- <DropdownItemCollapsible
200
- label="Custom Icon"
201
- icon={<MyCustomIcon className="w-4 h-4" />}
202
- children={[
203
- {
204
- label: "Child",
205
- icon={<AnotherIcon className="w-4 h-4" />}
206
- }
207
- ]}
208
- />
209
- ```
210
-
211
- ## 🎬 Transiciones
212
-
213
- - **Chevron rotation**: 200ms ease-in-out
214
- - **Color hover**: 150ms ease-in-out
215
- - **Scale active**: Inmediato
216
-
217
- ## ♿ Accesibilidad
218
-
219
- - `aria-expanded`: Indica si el item está expandido
220
- - `aria-disabled`: Indica si el item está deshabilitado
221
- - Soporte completo para navegación por teclado
222
- - Focus rings visibles y adaptativos
223
- - Colores con suficiente contraste (WCAG AA)
224
-
225
- ## 📚 Integración con Dropdown
226
-
227
- Se diseñó para integrar perfectamente dentro del componente Dropdown:
228
-
229
- ```tsx
230
- <Dropdown
231
- items={[
232
- {
233
- children: (
234
- <DropdownItemCollapsible
235
- label="Users"
236
- children={[...]}
237
- />
238
- )
239
- }
240
- ]}
241
- />
242
- ```
243
-
244
- ## 🔗 Referencias
245
-
246
- - **Figma**: [node-id=6135-34374](https://www.figma.com/design/5XNqf2YTxvwemxwo1LMQ6j/Siesa-UI-Kit?node-id=6135-34374)
247
- - **Colors**: [docs/colors.md](../../docs/colors.md)
248
- - **Typography**: [docs/typography.md](../../docs/typography.md)
249
- - **Spacing**: [docs/spacing.md](../../docs/spacing.md)
250
- - **Shadows**: [docs/shadows.md](../../docs/shadows.md)
251
-
252
- ## 📝 Historial de Cambios
253
-
254
- ### v1.0.0 (2025-12-23)
255
-
256
- - ✅ Componente inicial creado
257
- - ✅ Soporte completo para expandir/contraer
258
- - ✅ Dark mode completo
259
- - ✅ States: hover, focus, active, disabled
260
- - ✅ Iconos personalizables
261
- - ✅ Items anidados con indentación
262
- - ✅ Animaciones suaves
263
- - ✅ Stories Storybook completas
264
- - ✅ Accesibilidad (ARIA labels)