siesa-ui-kit 1.0.3 → 1.0.4

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 (290) hide show
  1. package/README.md +115 -115
  2. package/bin/install.cjs +502 -502
  3. package/bin/prepare-publish.cjs +28 -28
  4. package/bin/restore-folders.cjs +28 -28
  5. package/claude/agents/siesa-ui-kit-specialist.md +2445 -0
  6. package/claude/prompts/component-template.md +121 -0
  7. package/claude/prompts/siesa-ui-kit.md +28 -0
  8. package/claude/settings.local.json +72 -0
  9. package/dist/components/Button/icons.d.ts +6 -5
  10. package/dist/components/Button/icons.d.ts.map +1 -1
  11. package/dist/components/DropdownItemCollapsible/DropdownItemCollapsible.d.ts.map +1 -1
  12. package/dist/components/DropdownItemCollapsible/DropdownItemCollapsible.types.d.ts +21 -0
  13. package/dist/components/DropdownItemCollapsible/DropdownItemCollapsible.types.d.ts.map +1 -1
  14. package/dist/components/NavigationRailCommercial/NavigationRailCommercial.d.ts +122 -0
  15. package/dist/components/NavigationRailCommercial/NavigationRailCommercial.d.ts.map +1 -0
  16. package/dist/components/NavigationRailCommercial/NavigationRailCommercial.types.d.ts +139 -0
  17. package/dist/components/NavigationRailCommercial/NavigationRailCommercial.types.d.ts.map +1 -0
  18. package/dist/components/NavigationRailCommercial/icons.d.ts +33 -0
  19. package/dist/components/NavigationRailCommercial/icons.d.ts.map +1 -0
  20. package/dist/components/NavigationRailCommercial/index.d.ts +4 -0
  21. package/dist/components/NavigationRailCommercial/index.d.ts.map +1 -0
  22. package/dist/components/NavigationRailItem/NavigationRailItem.d.ts.map +1 -1
  23. package/dist/components/NavigationRailItem/NavigationRailItem.types.d.ts +7 -0
  24. package/dist/components/NavigationRailItem/NavigationRailItem.types.d.ts.map +1 -1
  25. package/dist/components/NavigationRailTypes/NavigationRailTypes.d.ts.map +1 -1
  26. package/dist/components/NavigationRailTypes/NavigationRailTypes.types.d.ts +41 -0
  27. package/dist/components/NavigationRailTypes/NavigationRailTypes.types.d.ts.map +1 -1
  28. package/dist/components/NavigationRailTypes/icons.d.ts +15 -29
  29. package/dist/components/NavigationRailTypes/icons.d.ts.map +1 -1
  30. package/dist/components/Select/Select.d.ts.map +1 -1
  31. package/dist/components/Select/icons.d.ts +6 -2
  32. package/dist/components/Select/icons.d.ts.map +1 -1
  33. package/dist/index.d.ts +32 -0
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/siesa-ui-kit.cjs +404 -190
  36. package/dist/siesa-ui-kit.cjs.map +1 -1
  37. package/dist/siesa-ui-kit.mjs +6590 -1506
  38. package/dist/siesa-ui-kit.mjs.map +1 -1
  39. package/dist/views/LayoutCommercial/LayoutCommercial.d.ts +48 -0
  40. package/dist/views/LayoutCommercial/LayoutCommercial.d.ts.map +1 -0
  41. package/dist/views/LayoutCommercial/LayoutCommercial.types.d.ts +49 -0
  42. package/dist/views/LayoutCommercial/LayoutCommercial.types.d.ts.map +1 -0
  43. package/dist/views/LayoutCommercial/index.d.ts +3 -0
  44. package/dist/views/LayoutCommercial/index.d.ts.map +1 -0
  45. package/docs/border-radius.md +1261 -0
  46. package/docs/colors.md +832 -0
  47. package/docs/dark-mode-guide.md +1426 -0
  48. package/docs/filters.md +1243 -0
  49. package/docs/icons.md +1264 -0
  50. package/docs/shadows.md +1377 -0
  51. package/docs/spacing.md +1684 -0
  52. package/docs/typography.md +1268 -0
  53. package/package.json +111 -103
  54. package/postcss.config.cjs +6 -0
  55. package/public/,Business Logo.png +0 -0
  56. package/public/.Siesa Logo.png +0 -0
  57. package/public/bg_siesa.png +0 -0
  58. package/public/siesa_logo_mobile.png +0 -0
  59. package/public/vite.svg +1 -0
  60. package/src/App.css +42 -0
  61. package/src/App.tsx +8 -0
  62. package/src/ButtonTest.tsx +147 -0
  63. package/src/assets/fonts/README.md +261 -0
  64. package/src/assets/fonts/SiesaBT/SiesaBT-Bold.otf +0 -0
  65. package/src/assets/fonts/SiesaBT/SiesaBT-Light.otf +0 -0
  66. package/src/assets/fonts/SiesaBT/SiesaBT-Regular.otf +0 -0
  67. package/src/assets/react.svg +1 -0
  68. package/src/components/Alert/Alert.stories.tsx +332 -0
  69. package/src/components/Alert/Alert.tsx +106 -0
  70. package/src/components/Alert/Alert.types.ts +54 -0
  71. package/src/components/Avatar/Avatar.stories.tsx +494 -0
  72. package/src/components/Avatar/Avatar.tsx +143 -0
  73. package/src/components/Avatar/Avatar.types.ts +53 -0
  74. package/src/components/Badge/Badge.stories.tsx +339 -0
  75. package/src/components/Badge/Badge.tsx +278 -0
  76. package/src/components/Badge/Badge.types.ts +58 -0
  77. package/src/components/Button/Button.stories.tsx +950 -0
  78. package/src/components/Button/Button.tsx +337 -0
  79. package/src/components/Button/Button.types.ts +180 -0
  80. package/src/components/Button/icons.tsx +48 -0
  81. package/src/components/Button/index.ts +3 -0
  82. package/src/components/Checkbox/Checkbox.stories.tsx +453 -0
  83. package/src/components/Checkbox/Checkbox.tsx +208 -0
  84. package/src/components/Checkbox/Checkbox.types.ts +61 -0
  85. package/src/components/DescriptionList/DescriptionList.stories.tsx +250 -0
  86. package/src/components/DescriptionList/DescriptionList.tsx +96 -0
  87. package/src/components/DescriptionList/DescriptionList.types.ts +29 -0
  88. package/src/components/Divider/Divider.stories.tsx +263 -0
  89. package/src/components/Divider/Divider.tsx +80 -0
  90. package/src/components/Divider/Divider.types.ts +24 -0
  91. package/src/components/Dropdown/Dropdown.stories.tsx +552 -0
  92. package/src/components/Dropdown/Dropdown.tsx +422 -0
  93. package/src/components/Dropdown/Dropdown.types.ts +146 -0
  94. package/src/components/Dropdown/README.md +266 -0
  95. package/src/components/Dropdown/icons.tsx +72 -0
  96. package/src/components/Dropdown/index.ts +8 -0
  97. package/src/components/DropdownItemCollapsible/DropdownItemCollapsible.stories.tsx +317 -0
  98. package/src/components/DropdownItemCollapsible/DropdownItemCollapsible.tsx +307 -0
  99. package/src/components/DropdownItemCollapsible/DropdownItemCollapsible.types.ts +136 -0
  100. package/src/components/DropdownItemCollapsible/README.md +264 -0
  101. package/src/components/DropdownItemCollapsible/icons.tsx +57 -0
  102. package/src/components/DropdownItemCollapsible/index.ts +12 -0
  103. package/src/components/DropdownItemHeading/DropdownItemHeading.stories.tsx +386 -0
  104. package/src/components/DropdownItemHeading/DropdownItemHeading.tsx +216 -0
  105. package/src/components/DropdownItemHeading/DropdownItemHeading.types.ts +93 -0
  106. package/src/components/DropdownItemHeading/README.md +573 -0
  107. package/src/components/DropdownItemHeading/icons.tsx +125 -0
  108. package/src/components/DropdownItemHeading/index.ts +3 -0
  109. package/src/components/Input/Input.stories.tsx +583 -0
  110. package/src/components/Input/Input.tsx +204 -0
  111. package/src/components/Input/Input.types.ts +80 -0
  112. package/src/components/Input/icons.tsx +145 -0
  113. package/src/components/Input/index.ts +2 -0
  114. package/src/components/LoginView/LoginView.stories.tsx +148 -0
  115. package/src/components/LoginView/LoginView.tsx +426 -0
  116. package/src/components/LoginView/LoginView.types.ts +52 -0
  117. package/src/components/LoginView/README.md +396 -0
  118. package/src/components/LoginView/icons.tsx +85 -0
  119. package/src/components/LoginView/index.ts +3 -0
  120. package/src/components/Navbar/Navbar.stories.tsx +810 -0
  121. package/src/components/Navbar/Navbar.tsx +755 -0
  122. package/src/components/Navbar/Navbar.types.ts +219 -0
  123. package/src/components/Navbar/README.md +279 -0
  124. package/src/components/Navbar/icons.tsx +102 -0
  125. package/src/components/Navbar/index.ts +8 -0
  126. package/src/components/NavigationBar/NavigationBar.stories.tsx +406 -0
  127. package/src/components/NavigationBar/NavigationBar.tsx +246 -0
  128. package/src/components/NavigationBar/NavigationBar.types.ts +74 -0
  129. package/src/components/NavigationBar/README.md +469 -0
  130. package/src/components/NavigationBar/index.ts +2 -0
  131. package/src/components/NavigationRail/NavigationRail.stories.tsx +417 -0
  132. package/src/components/NavigationRail/NavigationRail.tsx +418 -0
  133. package/src/components/NavigationRail/NavigationRail.types.ts +109 -0
  134. package/src/components/NavigationRail/README.md +224 -0
  135. package/src/components/NavigationRail/index.ts +2 -0
  136. package/src/components/NavigationRailCommercial/NavigationRailCommercial.stories.tsx +464 -0
  137. package/src/components/NavigationRailCommercial/NavigationRailCommercial.tsx +301 -0
  138. package/src/components/NavigationRailCommercial/NavigationRailCommercial.types.ts +162 -0
  139. package/src/components/NavigationRailCommercial/README.md +251 -0
  140. package/src/components/NavigationRailCommercial/icons.tsx +54 -0
  141. package/src/components/NavigationRailCommercial/index.ts +6 -0
  142. package/src/components/NavigationRailItem/NavigationRailItem.stories.tsx +667 -0
  143. package/src/components/NavigationRailItem/NavigationRailItem.tsx +314 -0
  144. package/src/components/NavigationRailItem/NavigationRailItem.types.ts +175 -0
  145. package/src/components/NavigationRailItem/README.md +476 -0
  146. package/src/components/NavigationRailItem/index.ts +2 -0
  147. package/src/components/NavigationRailPanel/NavigationRailPanel.stories.tsx +462 -0
  148. package/src/components/NavigationRailPanel/NavigationRailPanel.tsx +332 -0
  149. package/src/components/NavigationRailPanel/NavigationRailPanel.types.ts +178 -0
  150. package/src/components/NavigationRailPanel/README.md +461 -0
  151. package/src/components/NavigationRailPanel/index.ts +6 -0
  152. package/src/components/NavigationRailTypes/NavigationRailTypes.stories.tsx +682 -0
  153. package/src/components/NavigationRailTypes/NavigationRailTypes.tsx +363 -0
  154. package/src/components/NavigationRailTypes/NavigationRailTypes.types.ts +178 -0
  155. package/src/components/NavigationRailTypes/README.md +573 -0
  156. package/src/components/NavigationRailTypes/icons.tsx +76 -0
  157. package/src/components/NavigationRailTypes/index.ts +7 -0
  158. package/src/components/Notification/Notification.stories.tsx +513 -0
  159. package/src/components/Notification/Notification.tsx +145 -0
  160. package/src/components/Notification/Notification.types.ts +142 -0
  161. package/src/components/Notification/README.md +409 -0
  162. package/src/components/Notification/index.ts +3 -0
  163. package/src/components/POSConvention/POSConvention.stories.tsx +235 -0
  164. package/src/components/POSConvention/POSConvention.tsx +129 -0
  165. package/src/components/POSConvention/POSConvention.types.ts +38 -0
  166. package/src/components/POSConvention/README.md +123 -0
  167. package/src/components/POSConvention/icons.tsx +45 -0
  168. package/src/components/POSConvention/index.ts +3 -0
  169. package/src/components/POSLocationButton/POSLocationButton.stories.tsx +531 -0
  170. package/src/components/POSLocationButton/POSLocationButton.tsx +247 -0
  171. package/src/components/POSLocationButton/POSLocationButton.types.ts +87 -0
  172. package/src/components/POSLocationButton/README.md +253 -0
  173. package/src/components/POSLocationButton/icons.tsx +120 -0
  174. package/src/components/POSLocationButton/index.ts +14 -0
  175. package/src/components/POSNumberButton/POSNumberButton.stories.tsx +415 -0
  176. package/src/components/POSNumberButton/POSNumberButton.tsx +179 -0
  177. package/src/components/POSNumberButton/POSNumberButton.types.ts +51 -0
  178. package/src/components/POSNumberButton/README.md +321 -0
  179. package/src/components/POSNumberButton/index.ts +3 -0
  180. package/src/components/POSProductButton/POSProductButton.stories.tsx +318 -0
  181. package/src/components/POSProductButton/POSProductButton.tsx +152 -0
  182. package/src/components/POSProductButton/POSProductButton.types.ts +46 -0
  183. package/src/components/POSProductButton/README.md +269 -0
  184. package/src/components/POSProductButton/index.ts +2 -0
  185. package/src/components/POSProductCard/POSProductCard.stories.tsx +642 -0
  186. package/src/components/POSProductCard/POSProductCard.tsx +208 -0
  187. package/src/components/POSProductCard/POSProductCard.types.ts +76 -0
  188. package/src/components/POSProductCard/README.md +179 -0
  189. package/src/components/POSProductCard/icons.tsx +26 -0
  190. package/src/components/POSProductCard/index.ts +2 -0
  191. package/src/components/POSProductSidebarItems/POSProductSidebarItems.stories.tsx +753 -0
  192. package/src/components/POSProductSidebarItems/POSProductSidebarItems.tsx +332 -0
  193. package/src/components/POSProductSidebarItems/POSProductSidebarItems.types.ts +119 -0
  194. package/src/components/POSProductSidebarItems/README.md +198 -0
  195. package/src/components/POSProductSidebarItems/icons.tsx +21 -0
  196. package/src/components/POSProductSidebarItems/index.ts +3 -0
  197. package/src/components/POSTable/POSTable.stories.tsx +737 -0
  198. package/src/components/POSTable/POSTable.tsx +401 -0
  199. package/src/components/POSTable/POSTable.types.ts +83 -0
  200. package/src/components/POSTable/README.md +286 -0
  201. package/src/components/POSTable/index.ts +7 -0
  202. package/src/components/Pagination/Pagination.stories.tsx +555 -0
  203. package/src/components/Pagination/Pagination.tsx +286 -0
  204. package/src/components/Pagination/Pagination.types.ts +93 -0
  205. package/src/components/Pagination/README.md +298 -0
  206. package/src/components/Pagination/icons.tsx +47 -0
  207. package/src/components/Pagination/index.ts +3 -0
  208. package/src/components/Quantity/Quantity.stories.tsx +457 -0
  209. package/src/components/Quantity/Quantity.tsx +289 -0
  210. package/src/components/Quantity/Quantity.types.ts +70 -0
  211. package/src/components/Radio/Radio.stories.tsx +523 -0
  212. package/src/components/Radio/Radio.tsx +170 -0
  213. package/src/components/Radio/Radio.types.ts +122 -0
  214. package/src/components/Select/README.md +299 -0
  215. package/src/components/Select/Select.stories.tsx +705 -0
  216. package/src/components/Select/Select.tsx +457 -0
  217. package/src/components/Select/Select.types.ts +148 -0
  218. package/src/components/Select/icons.tsx +25 -0
  219. package/src/components/Select/index.ts +3 -0
  220. package/src/components/SignUpView/SignUpView.stories.tsx +129 -0
  221. package/src/components/SignUpView/SignUpView.tsx +503 -0
  222. package/src/components/SignUpView/SignUpView.types.ts +58 -0
  223. package/src/components/SignUpView/icons.tsx +71 -0
  224. package/src/components/SignUpView/index.ts +3 -0
  225. package/src/components/Switch/README.md +112 -0
  226. package/src/components/Switch/Switch.stories.tsx +550 -0
  227. package/src/components/Switch/Switch.tsx +246 -0
  228. package/src/components/Switch/Switch.types.ts +67 -0
  229. package/src/components/Table/README.md +369 -0
  230. package/src/components/Table/Table.stories.tsx +805 -0
  231. package/src/components/Table/Table.tsx +688 -0
  232. package/src/components/Table/Table.types.ts +204 -0
  233. package/src/components/Table/index.ts +9 -0
  234. package/src/components/Tabs/README.md +201 -0
  235. package/src/components/Tabs/Tabs.stories.tsx +580 -0
  236. package/src/components/Tabs/Tabs.tsx +356 -0
  237. package/src/components/Tabs/Tabs.types.ts +127 -0
  238. package/src/components/Tabs/icons.tsx +129 -0
  239. package/src/components/Tabs/index.ts +11 -0
  240. package/src/components/Textarea/Textarea.stories.tsx +535 -0
  241. package/src/components/Textarea/Textarea.tsx +188 -0
  242. package/src/components/Textarea/Textarea.types.ts +54 -0
  243. package/src/context/ThemeContext.tsx +99 -0
  244. package/src/context/index.ts +1 -0
  245. package/src/index.css +29 -0
  246. package/src/index.ts +133 -0
  247. package/src/main.tsx +10 -0
  248. package/src/views/LayoutCommercial/LayoutCommercial.stories.tsx +374 -0
  249. package/src/views/LayoutCommercial/LayoutCommercial.tsx +125 -0
  250. package/src/views/LayoutCommercial/LayoutCommercial.types.ts +54 -0
  251. package/src/views/LayoutCommercial/README.md +286 -0
  252. package/src/views/LayoutCommercial/index.ts +2 -0
  253. package/src/views/ListView/ListView.stories.tsx +329 -0
  254. package/src/views/ListView/ListView.tsx +570 -0
  255. package/src/views/ListView/ListView.types.ts +211 -0
  256. package/src/views/ListView/icons.tsx +282 -0
  257. package/src/views/ListView/index.ts +11 -0
  258. package/src/views/LoginView/LoginView.stories.tsx +148 -0
  259. package/src/views/LoginView/LoginView.tsx +426 -0
  260. package/src/views/LoginView/LoginView.types.ts +52 -0
  261. package/src/views/LoginView/README.md +396 -0
  262. package/src/views/LoginView/icons.tsx +85 -0
  263. package/src/views/LoginView/index.ts +3 -0
  264. package/src/views/ProductsView/ProductsView.stories.tsx +344 -0
  265. package/src/views/ProductsView/ProductsView.tsx +480 -0
  266. package/src/views/ProductsView/ProductsView.types.ts +238 -0
  267. package/src/views/ProductsView/README.md +312 -0
  268. package/src/views/ProductsView/icons.tsx +38 -0
  269. package/src/views/ProductsView/index.ts +8 -0
  270. package/src/views/RecoverPasswordView/README.md +269 -0
  271. package/src/views/RecoverPasswordView/RecoverPasswordView.stories.tsx +131 -0
  272. package/src/views/RecoverPasswordView/RecoverPasswordView.tsx +376 -0
  273. package/src/views/RecoverPasswordView/RecoverPasswordView.types.ts +56 -0
  274. package/src/views/RecoverPasswordView/icons.tsx +17 -0
  275. package/src/views/RecoverPasswordView/index.ts +2 -0
  276. package/src/views/SignUpView/SignUpView.stories.tsx +129 -0
  277. package/src/views/SignUpView/SignUpView.tsx +503 -0
  278. package/src/views/SignUpView/SignUpView.types.ts +58 -0
  279. package/src/views/SignUpView/icons.tsx +71 -0
  280. package/src/views/SignUpView/index.ts +3 -0
  281. package/src/views/TableLayoutView/README.md +268 -0
  282. package/src/views/TableLayoutView/TableLayoutView.stories.tsx +235 -0
  283. package/src/views/TableLayoutView/TableLayoutView.tsx +461 -0
  284. package/src/views/TableLayoutView/TableLayoutView.types.ts +209 -0
  285. package/src/views/TableLayoutView/icons.tsx +113 -0
  286. package/src/views/TableLayoutView/index.ts +6 -0
  287. package/storybook/main.ts +20 -0
  288. package/storybook/preview.tsx +84 -0
  289. package/storybook/vitest.setup.ts +7 -0
  290. package/tailwind.config.js +128 -0
@@ -0,0 +1,705 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { Select } from './Select';
3
+ import { useState } from 'react';
4
+
5
+ const meta = {
6
+ title: 'Siesa UI Kit/Select',
7
+ component: Select,
8
+ parameters: {
9
+ layout: 'centered',
10
+ docs: {
11
+ description: {
12
+ component:
13
+ 'Componente Select personalizado con menú desplegable para seleccionar opciones de una lista. Incluye navegación por teclado, click outside y dark mode completo.',
14
+ },
15
+ },
16
+ },
17
+ tags: ['autodocs'],
18
+ argTypes: {
19
+ options: {
20
+ control: 'object',
21
+ description: 'Array de opciones disponibles para seleccionar',
22
+ },
23
+ value: {
24
+ control: 'text',
25
+ description: 'Valor seleccionado actual (controlado)',
26
+ },
27
+ defaultValue: {
28
+ control: 'text',
29
+ description: 'Valor inicial por defecto (no controlado)',
30
+ },
31
+ placeholder: {
32
+ control: 'text',
33
+ description: 'Texto del placeholder cuando no hay selección',
34
+ },
35
+ disabled: {
36
+ control: 'boolean',
37
+ description: 'Si el select está deshabilitado',
38
+ },
39
+ error: {
40
+ control: 'boolean',
41
+ description: 'Si el select muestra un error',
42
+ },
43
+ label: {
44
+ control: 'text',
45
+ description: 'Label del select',
46
+ },
47
+ description: {
48
+ control: 'text',
49
+ description: 'Texto descriptivo que aparece debajo del label (antes del trigger)',
50
+ },
51
+ showLabel: {
52
+ control: 'boolean',
53
+ description: 'Muestra el label',
54
+ },
55
+ showDescription: {
56
+ control: 'boolean',
57
+ description: 'Muestra la descripción',
58
+ },
59
+ menuHeader: {
60
+ control: 'text',
61
+ description: 'Header opcional al inicio del menú',
62
+ },
63
+ fullWidth: {
64
+ control: 'boolean',
65
+ description: 'Si el select ocupa el ancho completo',
66
+ },
67
+ required: {
68
+ control: 'boolean',
69
+ description: 'Si el campo es requerido',
70
+ },
71
+ menuPosition: {
72
+ control: 'select',
73
+ options: ['top', 'bottom'],
74
+ description: 'Posición del menú desplegable',
75
+ },
76
+ },
77
+ } satisfies Meta<typeof Select>;
78
+
79
+ export default meta;
80
+ type Story = StoryObj<typeof meta>;
81
+
82
+ // ============================================
83
+ // Opciones de ejemplo
84
+ // ============================================
85
+ const fruitOptions = [
86
+ { value: 'apple', label: 'Manzana' },
87
+ { value: 'banana', label: 'Banana' },
88
+ { value: 'cherry', label: 'Cereza' },
89
+ { value: 'date', label: 'Dátil' },
90
+ { value: 'elderberry', label: 'Saúco' },
91
+ { value: 'fig', label: 'Higo' },
92
+ ];
93
+
94
+ const countryOptions = [
95
+ { value: 'us', label: 'Estados Unidos' },
96
+ { value: 'uk', label: 'Reino Unido' },
97
+ { value: 'ca', label: 'Canadá' },
98
+ { value: 'au', label: 'Australia' },
99
+ { value: 'de', label: 'Alemania' },
100
+ { value: 'fr', label: 'Francia' },
101
+ { value: 'jp', label: 'Japón' },
102
+ { value: 'cn', label: 'China' },
103
+ ];
104
+
105
+ const statusOptions = [
106
+ { value: 'active', label: 'Activo' },
107
+ { value: 'pending', label: 'Pendiente' },
108
+ { value: 'inactive', label: 'Inactivo', disabled: true },
109
+ { value: 'archived', label: 'Archivado' },
110
+ ];
111
+
112
+ // ============================================
113
+ // 1. PLAYGROUND INTERACTIVO
114
+ // ============================================
115
+ export const Playground: Story = {
116
+ name: 'Playground',
117
+ args: { options: [] },
118
+ render: () => {
119
+ const [value, setValue] = useState<string | number>('');
120
+
121
+ return (
122
+ <div className="w-[400px]">
123
+ <Select
124
+ options={fruitOptions}
125
+ value={value}
126
+ onChange={setValue}
127
+ placeholder="Selecciona una fruta"
128
+ label="Label"
129
+ description="Esto será visible para los clientes en el proyecto."
130
+ menuHeader="Encabezado ..."
131
+ />
132
+
133
+ <div className="mt-4 p-4 bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg">
134
+ <p className="text-xs text-gray-600 dark:text-gray-300">
135
+ <strong>Valor seleccionado:</strong> {value || '(ninguno)'}
136
+ </p>
137
+ </div>
138
+ </div>
139
+ );
140
+ },
141
+ };
142
+
143
+ // ============================================
144
+ // 2. ESTADOS BÁSICOS
145
+ // ============================================
146
+ export const EstadosBasicos: Story = {
147
+ name: 'Estados Básicos',
148
+ args: { options: [] },
149
+ render: () => {
150
+ const [value1, setValue1] = useState<string | number>('');
151
+ const [value2, setValue2] = useState<string | number>('banana');
152
+
153
+ return (
154
+ <div className="space-y-8 p-6 w-[500px]">
155
+ {/* Default sin selección */}
156
+ <div>
157
+ <h3 className="text-sm font-bold mb-4 text-gray-700 dark:text-white">
158
+ Sin selección (Placeholder)
159
+ </h3>
160
+ <Select
161
+ options={fruitOptions}
162
+ value={value1}
163
+ onChange={setValue1}
164
+ placeholder="Selecciona una fruta"
165
+ label="Fruta"
166
+ />
167
+ <p className="text-xs text-gray-500 dark:text-gray-300 mt-2">
168
+ Muestra el marcador de posición cuando no hay valor seleccionado
169
+ </p>
170
+ </div>
171
+
172
+ {/* Con valor seleccionado */}
173
+ <div>
174
+ <h3 className="text-sm font-bold mb-4 text-gray-700 dark:text-white">
175
+ Con valor seleccionado
176
+ </h3>
177
+ <Select
178
+ options={fruitOptions}
179
+ value={value2}
180
+ onChange={setValue2}
181
+ placeholder="Selecciona una fruta"
182
+ label="Fruta"
183
+ />
184
+ <p className="text-xs text-gray-500 dark:text-gray-300 mt-2">
185
+ Muestra la etiqueta de la opción seleccionada
186
+ </p>
187
+ </div>
188
+
189
+ {/* Hover y Focus */}
190
+ <div>
191
+ <h3 className="text-sm font-bold mb-4 text-gray-700 dark:text-white">
192
+ Estados Interactivos
193
+ </h3>
194
+ <Select
195
+ options={fruitOptions}
196
+ value={value1}
197
+ onChange={setValue1}
198
+ placeholder="Pasa el mouse o haz click para ver estados"
199
+ label="Fruta"
200
+ />
201
+ <p className="text-xs text-gray-500 dark:text-gray-300 mt-2">
202
+ • Hover: Border más claro (#f9f9f9)
203
+ <br />• Focus: Border azul de 2px (#329cff)
204
+ <br />• Click: Abre menú con opciones
205
+ </p>
206
+ </div>
207
+
208
+ {/* Disabled */}
209
+ <div>
210
+ <h3 className="text-sm font-bold mb-4 text-gray-700 dark:text-white">
211
+ Deshabilitado
212
+ </h3>
213
+ <Select
214
+ options={fruitOptions}
215
+ value="apple"
216
+ disabled
217
+ placeholder="Selecciona una fruta"
218
+ label="Fruta (Deshabilitada)"
219
+ />
220
+ <p className="text-xs text-gray-500 dark:text-gray-300 mt-2">
221
+ Estado deshabilitado con opacidad reducida
222
+ </p>
223
+ </div>
224
+
225
+ {/* Error */}
226
+ <div>
227
+ <h3 className="text-sm font-bold mb-4 text-gray-700 dark:text-white">
228
+ Error
229
+ </h3>
230
+ <Select
231
+ options={fruitOptions}
232
+ value={value1}
233
+ onChange={setValue1}
234
+ error
235
+ description="Por favor selecciona una fruta"
236
+ placeholder="Selecciona una fruta"
237
+ label="Fruta (Requerido)"
238
+ required
239
+ />
240
+ <p className="text-xs text-gray-500 dark:text-gray-300 mt-2">
241
+ Estado de error con mensaje de validación
242
+ </p>
243
+ </div>
244
+
245
+ {/* Caja de consejos */}
246
+ <div className="mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg">
247
+ <p className="text-xs text-gray-600 dark:text-gray-300">
248
+ <strong>💡 Guía de Estados:</strong>
249
+ <br />• <strong>Default</strong>: Border estándar con placeholder gris
250
+ <br />• <strong>Hover</strong>: Border más claro para indicar interactividad
251
+ <br />• <strong>Focus</strong>: Border azul grueso (2px) para accesibilidad
252
+ <br />• <strong>Selected</strong>: Muestra el label de la opción seleccionada
253
+ <br />• <strong>Disabled</strong>: Opacidad 50% sin interactividad
254
+ <br />• <strong>Error</strong>: Border rojo con mensaje de error
255
+ </p>
256
+ </div>
257
+ </div>
258
+ );
259
+ },
260
+ };
261
+
262
+ // ============================================
263
+ // 3. CON HELPER TEXT
264
+ // ============================================
265
+ export const ConTextoDeAyuda: Story = {
266
+ name: 'Con Texto de Ayuda',
267
+ args: { options: [] },
268
+ render: () => {
269
+ const [value1, setValue1] = useState<string | number>('');
270
+ const [value2, setValue2] = useState<string | number>('');
271
+
272
+ return (
273
+ <div className="space-y-8 p-6 w-[500px]">
274
+ {/* Con helper text */}
275
+ <div>
276
+ <h3 className="text-sm font-bold mb-4 text-gray-700 dark:text-white">
277
+ Con texto de ayuda
278
+ </h3>
279
+ <Select
280
+ options={countryOptions}
281
+ value={value1}
282
+ onChange={setValue1}
283
+ placeholder="Selecciona un país"
284
+ label="País"
285
+ description="Selecciona tu país de residencia"
286
+ />
287
+ </div>
288
+
289
+ {/* Con error message */}
290
+ <div>
291
+ <h3 className="text-sm font-bold mb-4 text-gray-700 dark:text-white">
292
+ Con mensaje de error
293
+ </h3>
294
+ <Select
295
+ options={countryOptions}
296
+ value={value2}
297
+ onChange={setValue2}
298
+ placeholder="Selecciona un país"
299
+ label="País"
300
+ error
301
+ description="El país es requerido"
302
+ required
303
+ />
304
+ </div>
305
+ </div>
306
+ );
307
+ },
308
+ };
309
+
310
+ // ============================================
311
+ // 4. OPCIONES DESHABILITADAS
312
+ // ============================================
313
+ export const OpcionesDeshabilitadas: Story = {
314
+ name: 'Opciones Deshabilitadas',
315
+ args: { options: [] },
316
+ render: () => {
317
+ const [value, setValue] = useState<string | number>('');
318
+
319
+ return (
320
+ <div className="p-6 w-[400px]">
321
+ <Select
322
+ options={statusOptions}
323
+ value={value}
324
+ onChange={setValue}
325
+ placeholder="Selecciona un estado"
326
+ label="Estado"
327
+ description="Nota: El estado Inactivo está deshabilitado"
328
+ />
329
+
330
+ <div className="mt-4 p-4 bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg">
331
+ <p className="text-xs text-gray-600 dark:text-gray-300">
332
+ <strong>💡 Tip:</strong> Algunas opciones pueden estar deshabilitadas y no se pueden seleccionar
333
+ </p>
334
+ </div>
335
+ </div>
336
+ );
337
+ },
338
+ };
339
+
340
+ // ============================================
341
+ // 5. FULL WIDTH
342
+ // ============================================
343
+ export const AnchoCompleto: Story = {
344
+ name: 'Ancho Completo',
345
+ args: { options: [] },
346
+ render: () => {
347
+ const [value, setValue] = useState<string | number>('');
348
+
349
+ return (
350
+ <div className="p-6 w-full max-w-2xl">
351
+ <Select
352
+ options={countryOptions}
353
+ value={value}
354
+ onChange={setValue}
355
+ placeholder="Selecciona un país"
356
+ label="País"
357
+ description="El select de ancho completo se adapta al contenedor"
358
+ fullWidth
359
+ />
360
+ </div>
361
+ );
362
+ },
363
+ };
364
+
365
+ // ============================================
366
+ // 6. FORMULARIO COMPLETO
367
+ // ============================================
368
+ export const EjemploDeFormulario: Story = {
369
+ name: 'Ejemplo de Formulario',
370
+ args: { options: [] },
371
+ render: () => {
372
+ const [firstName, setFirstName] = useState('');
373
+ const [lastName, setLastName] = useState('');
374
+ const [country, setCountry] = useState<string | number>('');
375
+ const [status, setStatus] = useState<string | number>('');
376
+
377
+ const handleSubmit = (e: React.FormEvent) => {
378
+ e.preventDefault();
379
+ console.log({ firstName, lastName, country, status });
380
+ alert(`Form submitted!\nCountry: ${country}\nStatus: ${status}`);
381
+ };
382
+
383
+ return (
384
+ <div className="p-6 max-w-md">
385
+ <form onSubmit={handleSubmit} className="space-y-6">
386
+ <h2 className="text-2xl font-bold text-gray-700 dark:text-white mb-6">
387
+ Información de Usuario
388
+ </h2>
389
+
390
+ {/* Text inputs */}
391
+ <div className="space-y-2">
392
+ <label className="block text-sm font-bold text-content-primary dark:text-dark-content-primary">
393
+ Nombre <span className="text-error-content">*</span>
394
+ </label>
395
+ <input
396
+ type="text"
397
+ value={firstName}
398
+ onChange={(e) => setFirstName(e.target.value)}
399
+ className="w-full px-3 py-2 border border-border-primary dark:border-dark-border-primary bg-bg-primary dark:bg-dark-bg-primary text-content-primary dark:text-dark-content-primary rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-custom-400 dark:focus:ring-dark-border-custom"
400
+ placeholder="Juan"
401
+ required
402
+ />
403
+ </div>
404
+
405
+ <div className="space-y-2">
406
+ <label className="block text-sm font-bold text-content-primary dark:text-dark-content-primary">
407
+ Apellido <span className="text-error-content">*</span>
408
+ </label>
409
+ <input
410
+ type="text"
411
+ value={lastName}
412
+ onChange={(e) => setLastName(e.target.value)}
413
+ className="w-full px-3 py-2 border border-border-primary dark:border-dark-border-primary bg-bg-primary dark:bg-dark-bg-primary text-content-primary dark:text-dark-content-primary rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-primary-custom-400 dark:focus:ring-dark-border-custom"
414
+ placeholder="Pérez"
415
+ required
416
+ />
417
+ </div>
418
+
419
+ {/* Select fields */}
420
+ <Select
421
+ options={countryOptions}
422
+ value={country}
423
+ onChange={setCountry}
424
+ placeholder="Selecciona un país"
425
+ label="País"
426
+ description="Selecciona tu país de residencia"
427
+ required
428
+ fullWidth
429
+ />
430
+
431
+ <Select
432
+ options={statusOptions}
433
+ value={status}
434
+ onChange={setStatus}
435
+ placeholder="Selecciona un estado"
436
+ label="Estado de la Cuenta"
437
+ description="Selecciona el estado actual de tu cuenta"
438
+ required
439
+ fullWidth
440
+ />
441
+
442
+ <button
443
+ type="submit"
444
+ className="w-full px-4 py-2 bg-primary-custom-600 dark:bg-dark-bg-inverse text-primary-inverse-content dark:text-dark-content-inverse rounded-md font-bold text-sm hover:bg-primary-custom-500 dark:hover:bg-dark-bg-inverse/90 transition-all"
445
+ >
446
+ Enviar
447
+ </button>
448
+ </form>
449
+ </div>
450
+ );
451
+ },
452
+ };
453
+
454
+ // ============================================
455
+ // 7. MENU POSITION
456
+ // ============================================
457
+ export const PosicionDelMenu: Story = {
458
+ name: 'Posición del Menú',
459
+ args: { options: [] },
460
+ render: () => {
461
+ const [value1, setValue1] = useState<string | number>('');
462
+ const [value2, setValue2] = useState<string | number>('');
463
+
464
+ return (
465
+ <div className="space-y-32 p-6 w-[500px]">
466
+ {/* Bottom (default) */}
467
+ <div>
468
+ <h3 className="text-sm font-bold mb-4 text-gray-700 dark:text-white">
469
+ Menu abre hacia abajo (default)
470
+ </h3>
471
+ <Select
472
+ options={fruitOptions}
473
+ value={value1}
474
+ onChange={setValue1}
475
+ placeholder="Selecciona una fruta"
476
+ label="Fruta"
477
+ menuPosition="bottom"
478
+ />
479
+ </div>
480
+
481
+ {/* Top */}
482
+ <div>
483
+ <h3 className="text-sm font-bold mb-4 text-gray-700 dark:text-white">
484
+ Menu abre hacia arriba
485
+ </h3>
486
+ <Select
487
+ options={fruitOptions}
488
+ value={value2}
489
+ onChange={setValue2}
490
+ placeholder="Selecciona una fruta"
491
+ label="Fruta"
492
+ menuPosition="top"
493
+ />
494
+ <p className="text-xs text-gray-500 dark:text-gray-300 mt-2">
495
+ Útil cuando el select está cerca del borde inferior de la pantalla
496
+ </p>
497
+ </div>
498
+ </div>
499
+ );
500
+ },
501
+ };
502
+
503
+ // ============================================
504
+ // 8. CASOS DE USO
505
+ // ============================================
506
+
507
+ /**
508
+ * Casos de Uso Reales
509
+ *
510
+ * Ejemplos prácticos de cómo usar los selects en situaciones reales:
511
+ * formularios, filtros, configuración, etc.
512
+ */
513
+ export const UseCases: Story = {
514
+ name: 'Casos de Uso Reales',
515
+ args: { options: [] },
516
+ render: () => {
517
+ const [country, setCountry] = useState<string | number>('');
518
+ const [language, setLanguage] = useState<string | number>('');
519
+ const [category, setCategory] = useState<string | number>('');
520
+ const [status, setStatus] = useState<string | number>('');
521
+ const [priority, setPriority] = useState<string | number>('');
522
+ const [timezone, setTimezone] = useState<string | number>('');
523
+
524
+ return (
525
+ <div className="space-y-6">
526
+ {/* Formulario de Preferencias */}
527
+ <div>
528
+ <h3 className="text-sm font-bold mb-4 text-gray-700 dark:text-white">Formulario de Preferencias de Usuario</h3>
529
+ <div className="p-6 bg-bg-primary dark:bg-dark-bg-primary border border-border-primary dark:border-dark-border-primary rounded-lg max-w-md">
530
+ <div className="space-y-4">
531
+ <Select
532
+ options={countryOptions}
533
+ value={country}
534
+ onChange={setCountry}
535
+ placeholder="Selecciona un país"
536
+ label="País"
537
+ description="Selecciona tu país de residencia"
538
+ fullWidth
539
+ />
540
+ <Select
541
+ options={[
542
+ { value: 'en', label: 'English' },
543
+ { value: 'es', label: 'Español' },
544
+ { value: 'fr', label: 'Français' },
545
+ { value: 'de', label: 'Deutsch' },
546
+ ]}
547
+ value={language}
548
+ onChange={setLanguage}
549
+ placeholder="Selecciona un idioma"
550
+ label="Idioma"
551
+ description="Elige tu idioma preferido"
552
+ fullWidth
553
+ />
554
+ <Select
555
+ options={[
556
+ { value: 'utc-5', label: 'UTC-5 (Eastern Time)' },
557
+ { value: 'utc-6', label: 'UTC-6 (Central Time)' },
558
+ { value: 'utc-7', label: 'UTC-7 (Mountain Time)' },
559
+ { value: 'utc-8', label: 'UTC-8 (Pacific Time)' },
560
+ ]}
561
+ value={timezone}
562
+ onChange={setTimezone}
563
+ placeholder="Selecciona zona horaria"
564
+ label="Zona Horaria"
565
+ description="Tu zona horaria local"
566
+ fullWidth
567
+ />
568
+ </div>
569
+ </div>
570
+ </div>
571
+
572
+ {/* Filtros de Búsqueda */}
573
+ <div>
574
+ <h3 className="text-sm font-bold mb-4 text-gray-700 dark:text-white">Filtros de Búsqueda</h3>
575
+ <div className="p-6 bg-bg-primary dark:bg-dark-bg-primary border border-border-primary dark:border-dark-border-primary rounded-lg max-w-md">
576
+ <div className="space-y-4">
577
+ <Select
578
+ options={[
579
+ { value: 'all', label: 'Todas las Categorías' },
580
+ { value: 'electronics', label: 'Electrónica' },
581
+ { value: 'clothing', label: 'Ropa' },
582
+ { value: 'books', label: 'Libros' },
583
+ { value: 'home', label: 'Hogar y Jardín' },
584
+ ]}
585
+ value={category}
586
+ onChange={setCategory}
587
+ placeholder="Todas las Categorías"
588
+ label="Categoría"
589
+ fullWidth
590
+ />
591
+ <Select
592
+ options={statusOptions}
593
+ value={status}
594
+ onChange={setStatus}
595
+ placeholder="Selecciona un estado"
596
+ label="Estado"
597
+ description="Filtrar por estado del elemento"
598
+ fullWidth
599
+ />
600
+ <Select
601
+ options={[
602
+ { value: 'low', label: 'Baja' },
603
+ { value: 'medium', label: 'Media' },
604
+ { value: 'high', label: 'Alta' },
605
+ { value: 'urgent', label: 'Urgente' },
606
+ ]}
607
+ value={priority}
608
+ onChange={setPriority}
609
+ placeholder="Cualquier prioridad"
610
+ label="Prioridad"
611
+ fullWidth
612
+ />
613
+ </div>
614
+ </div>
615
+ </div>
616
+
617
+ {/* Formulario de Contacto */}
618
+ <div>
619
+ <h3 className="text-sm font-bold mb-4 text-gray-700 dark:text-white">Formulario de Contacto</h3>
620
+ <div className="p-6 bg-bg-primary dark:bg-dark-bg-primary border border-border-primary dark:border-dark-border-primary rounded-lg max-w-md">
621
+ <div className="space-y-4">
622
+ <Select
623
+ options={[
624
+ { value: 'general', label: 'Consulta General' },
625
+ { value: 'support', label: 'Soporte Técnico' },
626
+ { value: 'sales', label: 'Ventas' },
627
+ { value: 'billing', label: 'Facturación' },
628
+ ]}
629
+ value={category}
630
+ onChange={setCategory}
631
+ placeholder="Selecciona un tema"
632
+ label="Asunto"
633
+ description="¿Cómo podemos ayudarte?"
634
+ required
635
+ fullWidth
636
+ />
637
+ <Select
638
+ options={[
639
+ { value: 'low', label: 'Baja - Pregunta general' },
640
+ { value: 'medium', label: 'Media - Necesito asistencia' },
641
+ { value: 'high', label: 'Alta - Problema urgente' },
642
+ ]}
643
+ value={priority}
644
+ onChange={setPriority}
645
+ placeholder="Selecciona prioridad"
646
+ label="Prioridad"
647
+ description="¿Qué tan urgente es tu solicitud?"
648
+ fullWidth
649
+ />
650
+ </div>
651
+ </div>
652
+ </div>
653
+
654
+ {/* Formulario con Validación */}
655
+ <div>
656
+ <h3 className="text-sm font-bold mb-4 text-gray-700 dark:text-white">
657
+ Formulario con Validación de Errores
658
+ </h3>
659
+ <div className="p-6 bg-bg-primary dark:bg-dark-bg-primary border border-border-primary dark:border-dark-border-primary rounded-lg max-w-md">
660
+ <div className="space-y-4">
661
+ <Select
662
+ options={countryOptions}
663
+ value=""
664
+ onChange={() => {}}
665
+ placeholder="Selecciona un país"
666
+ label="País"
667
+ error
668
+ description="El país es requerido"
669
+ required
670
+ fullWidth
671
+ />
672
+ <Select
673
+ options={[
674
+ { value: 'card', label: 'Tarjeta de Crédito' },
675
+ { value: 'paypal', label: 'PayPal' },
676
+ { value: 'bank', label: 'Transferencia Bancaria' },
677
+ ]}
678
+ value=""
679
+ onChange={() => {}}
680
+ placeholder="Selecciona método de pago"
681
+ label="Método de Pago"
682
+ error
683
+ description="Por favor selecciona un método de pago"
684
+ required
685
+ fullWidth
686
+ />
687
+ <Select
688
+ options={[
689
+ { value: 'subscribe', label: 'Suscribirse al boletín' },
690
+ { value: 'unsubscribe', label: 'Cancelar suscripción' },
691
+ ]}
692
+ value={status}
693
+ onChange={setStatus}
694
+ placeholder="Selecciona preferencia"
695
+ label="Preferencia de Boletín"
696
+ description="Este campo es opcional"
697
+ fullWidth
698
+ />
699
+ </div>
700
+ </div>
701
+ </div>
702
+ </div>
703
+ );
704
+ },
705
+ };