@axzydev/axzy_ui_system 1.4.7 → 1.5.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 (226) hide show
  1. package/README.md +2 -11
  2. package/dist/index.cjs +2174 -1570
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.css +1 -1
  5. package/dist/index.css.map +1 -1
  6. package/dist/index.d.cts +232 -19
  7. package/dist/index.d.ts +232 -19
  8. package/dist/index.js +1838 -1238
  9. package/dist/index.js.map +1 -1
  10. package/dist/layered.css +1 -1
  11. package/package.json +3 -16
  12. package/src/App.tsx +90 -73
  13. package/src/components/atoms/badget/badget.tsx +23 -5
  14. package/src/components/atoms/chip/chip.tsx +3 -1
  15. package/src/components/atoms/image/image.tsx +3 -1
  16. package/src/components/atoms/input/input.tsx +8 -5
  17. package/src/components/atoms/loader/loader.tsx +3 -1
  18. package/src/components/atoms/slide/slide.props.ts +12 -0
  19. package/src/components/atoms/slide/slide.tsx +3 -0
  20. package/src/components/molecules/alert/alert.tsx +3 -1
  21. package/src/components/molecules/breadcrumbs/breadcrumbs.tsx +3 -1
  22. package/src/components/molecules/calendar/calendar.tsx +9 -6
  23. package/src/components/molecules/card/card.tsx +5 -2
  24. package/src/components/molecules/chip-input/chip-input.tsx +9 -7
  25. package/src/components/molecules/date-picker/datePicker.tsx +9 -9
  26. package/src/components/molecules/dropdown-menu/dropdown-menu.props.ts +1 -1
  27. package/src/components/molecules/dropdown-menu/dropdown-menu.tsx +6 -3
  28. package/src/components/molecules/field/field.tsx +3 -1
  29. package/src/components/molecules/form-header/form-header.tsx +3 -1
  30. package/src/components/molecules/line-bar-chart/line-bar-chart.props.ts +2 -2
  31. package/src/components/molecules/line-bar-chart/line-bar-chart.tsx +20 -15
  32. package/src/components/molecules/masked-input/masked-input.tsx +3 -1
  33. package/src/components/molecules/multi-select/multi-select.tsx +12 -9
  34. package/src/components/molecules/pagination/pagination.tsx +11 -5
  35. package/src/components/molecules/search-select/search-select.tsx +11 -9
  36. package/src/components/molecules/select/select.tsx +6 -4
  37. package/src/components/molecules/stepper/stepper.tsx +6 -4
  38. package/src/components/molecules/table/table.props.ts +10 -2
  39. package/src/components/molecules/table/table.tsx +163 -114
  40. package/src/components/molecules/time-picker/timePicker.tsx +8 -6
  41. package/src/components/molecules/wysiwyg/wysiwyg.tsx +23 -12
  42. package/src/components/organisms/confirm-dialog/confirm-dialog.props.ts +4 -4
  43. package/src/components/organisms/confirm-dialog/confirm-dialog.tsx +16 -8
  44. package/src/components/organisms/data-table/dataTable.props.ts +3 -2
  45. package/src/components/organisms/data-table/dataTable.tsx +149 -81
  46. package/src/components/organisms/dialog/dialog.tsx +3 -0
  47. package/src/components/organisms/drawer/drawer.tsx +3 -0
  48. package/src/components/organisms/dropfile/dropfile.tsx +19 -17
  49. package/src/components/organisms/form-builder/fieldRenderer.tsx +4 -2
  50. package/src/components/organisms/navbar/navbar.tsx +4 -2
  51. package/src/components/organisms/page-header/page-header.tsx +3 -1
  52. package/src/components/organisms/searchTable/components/PaginationControls.tsx +8 -6
  53. package/src/components/organisms/searchTable/components/PaginationInfo.tsx +3 -1
  54. package/src/components/organisms/searchTable/components/SearchAndSortBar.tsx +7 -5
  55. package/src/components/organisms/searchTable/components/SearchInput.tsx +4 -2
  56. package/src/components/organisms/searchTable/components/SortButton.tsx +13 -11
  57. package/src/components/organisms/searchTable/components/TableEmptyState.tsx +4 -2
  58. package/src/components/organisms/searchTable/components/TableRow.tsx +6 -4
  59. package/src/components/organisms/searchTable/searchTable.tsx +4 -2
  60. package/src/components/organisms/sidebar/sidebar.props.ts +1 -1
  61. package/src/components/organisms/sidebar/sidebar.tsx +9 -4
  62. package/src/components/organisms/toast/toast.tsx +3 -1
  63. package/src/components/organisms/topbar/topbar.tsx +4 -2
  64. package/src/components/templates/page/page.props.ts +4 -4
  65. package/src/components/templates/page/page.tsx +6 -4
  66. package/src/components/theme-provider/themeProvider.tsx +28 -17
  67. package/src/dev.css +77 -2
  68. package/src/global.d.ts +10 -0
  69. package/src/i18n/context.ts +9 -0
  70. package/src/i18n/index.ts +22 -0
  71. package/src/i18n/locales/en.ts +163 -0
  72. package/src/i18n/locales/es.ts +165 -0
  73. package/src/i18n/provider.tsx +44 -0
  74. package/src/i18n/translator.ts +82 -0
  75. package/src/i18n/types.ts +54 -0
  76. package/src/i18n/useITTranslation.ts +20 -0
  77. package/src/index.css +0 -1
  78. package/src/index.ts +9 -3
  79. package/src/sandbox/LandingShowcase.tsx +224 -580
  80. package/src/sandbox/NotFoundShowcase.tsx +51 -36
  81. package/src/sandbox/TopbarSearch.tsx +6 -4
  82. package/src/sandbox/controls.tsx +180 -0
  83. package/src/sandbox/i18n.ts +1929 -0
  84. package/src/sandbox/icons.tsx +25 -0
  85. package/src/sandbox/locale.tsx +72 -0
  86. package/src/sandbox/ui.tsx +377 -0
  87. package/src/sandbox/useHashRoute.ts +46 -10
  88. package/src/showcases/DataShowcases.tsx +201 -80
  89. package/src/showcases/FeedbackShowcases.tsx +37 -30
  90. package/src/showcases/FormShowcases.tsx +302 -214
  91. package/src/showcases/GettingStartedShowcase.tsx +151 -145
  92. package/src/showcases/HelpShowcase.tsx +126 -128
  93. package/src/showcases/HomeShowcase.tsx +678 -482
  94. package/src/showcases/LayoutPrimitivesShowcases.tsx +129 -114
  95. package/src/showcases/NavigationShowcases.tsx +45 -37
  96. package/src/showcases/PageShowcases.tsx +171 -152
  97. package/src/showcases/ProductoDetalle.tsx +272 -129
  98. package/src/showcases/ShowcaseLayout.tsx +270 -216
  99. package/src/showcases/SizesShowcase.tsx +123 -64
  100. package/src/showcases/StructureShowcases.tsx +157 -131
  101. package/src/showcases/portfolioUi.tsx +153 -0
  102. package/src/showcases/techIcons.ts +3 -0
  103. package/src/types/table.types.ts +110 -0
  104. package/src/utils/table.utils.ts +10 -2
  105. package/src/components/atoms/avatar/avatar.doc.mdx +0 -48
  106. package/src/components/atoms/avatar/avatar.stories.tsx +0 -64
  107. package/src/components/atoms/badget/badget.doc.mdx +0 -46
  108. package/src/components/atoms/badget/badget.stories.tsx +0 -75
  109. package/src/components/atoms/button/button.doc.mdx +0 -59
  110. package/src/components/atoms/button/button.stories.tsx +0 -173
  111. package/src/components/atoms/checkbox/checkbox.doc.mdx +0 -54
  112. package/src/components/atoms/checkbox/checkbox.stories.tsx +0 -53
  113. package/src/components/atoms/chip/chip.doc.mdx +0 -47
  114. package/src/components/atoms/chip/chip.stories.tsx +0 -64
  115. package/src/components/atoms/divider/divider.doc.mdx +0 -42
  116. package/src/components/atoms/divider/divider.stories.tsx +0 -33
  117. package/src/components/atoms/flex/flex.doc.mdx +0 -59
  118. package/src/components/atoms/flex/flex.stories.tsx +0 -70
  119. package/src/components/atoms/grid/grid.doc.mdx +0 -54
  120. package/src/components/atoms/grid/grid.stories.tsx +0 -71
  121. package/src/components/atoms/image/image.doc.mdx +0 -44
  122. package/src/components/atoms/image/image.stories.tsx +0 -48
  123. package/src/components/atoms/input/input.doc.mdx +0 -70
  124. package/src/components/atoms/input/input.stories.tsx +0 -113
  125. package/src/components/atoms/input-number/input-number.doc.mdx +0 -74
  126. package/src/components/atoms/input-number/input-number.stories.tsx +0 -111
  127. package/src/components/atoms/loader/loader.doc.mdx +0 -43
  128. package/src/components/atoms/loader/loader.stories.tsx +0 -104
  129. package/src/components/atoms/popover/popover.doc.mdx +0 -53
  130. package/src/components/atoms/popover/popover.stories.tsx +0 -24
  131. package/src/components/atoms/progress/progress.doc.mdx +0 -48
  132. package/src/components/atoms/progress/progress.stories.tsx +0 -39
  133. package/src/components/atoms/radio/radio.doc.mdx +0 -62
  134. package/src/components/atoms/radio/radio.stories.tsx +0 -48
  135. package/src/components/atoms/segmented-control/segmented-control.doc.mdx +0 -60
  136. package/src/components/atoms/segmented-control/segmented-control.stories.tsx +0 -62
  137. package/src/components/atoms/skeleton/skeleton.doc.mdx +0 -43
  138. package/src/components/atoms/skeleton/skeleton.stories.tsx +0 -29
  139. package/src/components/atoms/slide/slide.doc.mdx +0 -46
  140. package/src/components/atoms/slide/slide.stories.tsx +0 -120
  141. package/src/components/atoms/slider/slider.doc.mdx +0 -49
  142. package/src/components/atoms/slider/slider.stories.tsx +0 -29
  143. package/src/components/atoms/stack/stack.doc.mdx +0 -126
  144. package/src/components/atoms/stack/stack.stories.tsx +0 -283
  145. package/src/components/atoms/text/text.doc.mdx +0 -41
  146. package/src/components/atoms/text/text.stories.tsx +0 -66
  147. package/src/components/atoms/textarea/textarea.doc.mdx +0 -64
  148. package/src/components/atoms/textarea/textarea.stories.tsx +0 -26
  149. package/src/components/atoms/tooltip/tooltip.doc.mdx +0 -47
  150. package/src/components/atoms/tooltip/tooltip.stories.tsx +0 -19
  151. package/src/components/isolation/isolation.stories.tsx +0 -202
  152. package/src/components/molecules/accordion/accordion.doc.mdx +0 -47
  153. package/src/components/molecules/accordion/accordion.stories.tsx +0 -68
  154. package/src/components/molecules/alert/alert.doc.mdx +0 -48
  155. package/src/components/molecules/alert/alert.stories.tsx +0 -40
  156. package/src/components/molecules/breadcrumbs/breadcrumbs.doc.mdx +0 -57
  157. package/src/components/molecules/breadcrumbs/breadcrumbs.stories.tsx +0 -20
  158. package/src/components/molecules/calendar/calendar.doc.mdx +0 -76
  159. package/src/components/molecules/calendar/calendar.stories.tsx +0 -90
  160. package/src/components/molecules/card/card.doc.mdx +0 -54
  161. package/src/components/molecules/card/card.stories.tsx +0 -57
  162. package/src/components/molecules/chip-input/chip-input.doc.mdx +0 -44
  163. package/src/components/molecules/chip-input/chip-input.stories.tsx +0 -52
  164. package/src/components/molecules/date-picker/date-picker.doc.mdx +0 -65
  165. package/src/components/molecules/date-picker/date-picker.stories.tsx +0 -88
  166. package/src/components/molecules/dropdown-menu/dropdown-menu.doc.mdx +0 -46
  167. package/src/components/molecules/dropdown-menu/dropdown-menu.stories.tsx +0 -41
  168. package/src/components/molecules/empty-state/empty-state.doc.mdx +0 -50
  169. package/src/components/molecules/empty-state/empty-state.stories.tsx +0 -19
  170. package/src/components/molecules/field/field.doc.mdx +0 -43
  171. package/src/components/molecules/field/field.stories.tsx +0 -42
  172. package/src/components/molecules/form-header/form-header.doc.mdx +0 -38
  173. package/src/components/molecules/form-header/form-header.stories.tsx +0 -52
  174. package/src/components/molecules/masked-input/masked-input.doc.mdx +0 -78
  175. package/src/components/molecules/masked-input/masked-input.stories.tsx +0 -126
  176. package/src/components/molecules/multi-select/multi-select.doc.mdx +0 -55
  177. package/src/components/molecules/multi-select/multi-select.stories.tsx +0 -59
  178. package/src/components/molecules/pagination/pagination.doc.mdx +0 -62
  179. package/src/components/molecules/pagination/pagination.stories.tsx +0 -110
  180. package/src/components/molecules/search-select/search-select.doc.mdx +0 -77
  181. package/src/components/molecules/search-select/search-select.stories.tsx +0 -146
  182. package/src/components/molecules/select/select.doc.mdx +0 -75
  183. package/src/components/molecules/select/select.stories.tsx +0 -85
  184. package/src/components/molecules/stat-card/stat-card.doc.mdx +0 -48
  185. package/src/components/molecules/stat-card/stat-card.stories.tsx +0 -40
  186. package/src/components/molecules/stepper/stepper.doc.mdx +0 -54
  187. package/src/components/molecules/stepper/stepper.stories.tsx +0 -154
  188. package/src/components/molecules/table/table.doc.mdx +0 -123
  189. package/src/components/molecules/table/table.stories.tsx +0 -402
  190. package/src/components/molecules/tabs/tabs.doc.mdx +0 -52
  191. package/src/components/molecules/tabs/tabs.stories.tsx +0 -31
  192. package/src/components/molecules/time-picker/timePicker.doc.mdx +0 -68
  193. package/src/components/molecules/time-picker/timePicker.stories.tsx +0 -130
  194. package/src/components/molecules/wysiwyg/wysiwyg.stories.tsx +0 -95
  195. package/src/components/organisms/confirm-dialog/confirm-dialog.doc.mdx +0 -60
  196. package/src/components/organisms/confirm-dialog/confirm-dialog.stories.tsx +0 -32
  197. package/src/components/organisms/data-table/ITDataTable.doc.mdx +0 -115
  198. package/src/components/organisms/data-table/ITDataTable.stories.tsx +0 -353
  199. package/src/components/organisms/dialog/dialog.doc.mdx +0 -54
  200. package/src/components/organisms/dialog/dialog.stories.tsx +0 -126
  201. package/src/components/organisms/drawer/drawer.doc.mdx +0 -59
  202. package/src/components/organisms/drawer/drawer.stories.tsx +0 -40
  203. package/src/components/organisms/dropfile/dropfile.doc.mdx +0 -74
  204. package/src/components/organisms/dropfile/dropfile.stories.tsx +0 -93
  205. package/src/components/organisms/form-builder/formBuilder.doc.mdx +0 -251
  206. package/src/components/organisms/form-builder/formBuilder.stories.tsx +0 -914
  207. package/src/components/organisms/navbar/navbar.doc.mdx +0 -77
  208. package/src/components/organisms/navbar/navbar.stories.tsx +0 -83
  209. package/src/components/organisms/page-header/page-header.doc.mdx +0 -54
  210. package/src/components/organisms/page-header/page-header.stories.tsx +0 -74
  211. package/src/components/organisms/searchTable/searchTable.doc.mdx +0 -79
  212. package/src/components/organisms/searchTable/searchTable.stories.tsx +0 -73
  213. package/src/components/organisms/sidebar/sidebar.doc.mdx +0 -176
  214. package/src/components/organisms/sidebar/sidebar.stories.tsx +0 -234
  215. package/src/components/organisms/toast/toast.doc.mdx +0 -50
  216. package/src/components/organisms/toast/toast.stories.tsx +0 -137
  217. package/src/components/organisms/topbar/topbar.doc.mdx +0 -72
  218. package/src/components/organisms/topbar/topbar.stories.tsx +0 -79
  219. package/src/components/organisms/triple-filter/tripleFilter.doc.mdx +0 -62
  220. package/src/components/organisms/triple-filter/tripleFilter.stories.tsx +0 -31
  221. package/src/components/templates/layout/layout.doc.mdx +0 -53
  222. package/src/components/templates/layout/layout.stories.tsx +0 -113
  223. package/src/components/templates/page/page.doc.mdx +0 -86
  224. package/src/components/templates/page/page.stories.tsx +0 -97
  225. package/src/components/theme-provider/themeProvider.doc.mdx +0 -85
  226. package/src/components/theme-provider/themeProvider.stories.tsx +0 -58
@@ -1,77 +0,0 @@
1
- import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
2
- import * as StoriesData from './search-select.stories';
3
-
4
- <Meta of={StoriesData} />
5
-
6
- # ITSearchSelect
7
-
8
- Searchable dropdown select with support for local client-side filtering and remote API search. Includes validation error display, label support, and customizable field mapping.
9
-
10
- ## Props
11
-
12
- | Prop | Type | Default | Description |
13
- |------|------|---------|-------------|
14
- | `name` | `string` | — | Name attribute for form integrations. |
15
- | `label` | `string` | — | Label displayed above the select input. |
16
- | `placeholder` | `string` | — | Placeholder text shown when no value is selected. |
17
- | `value` | `string \| number` | — | Currently selected value (controlled). |
18
- | `options` | `ITSearchSelectOption[]` | — | Array of options for static or remote data. `{ label, value, ...custom }`. |
19
- | `valueField` | `string` | `"value"` | Field used as the option value. |
20
- | `labelField` | `string` | `"label"` | Field used as the option display label. |
21
- | `onChange` | `(value: string \| number, option?: ITSearchSelectOption) => void` | — | Callback fired when selection changes. |
22
- | `onBlur` | `(e: FocusEvent<any>) => void` | — | Callback fired when input loses focus. |
23
- | `disabled` | `boolean` | `false` | Whether the component is disabled. |
24
- | `className` | `string` | — | Additional CSS classes for the container. |
25
- | `touched` | `boolean` | — | Whether the field has been touched (for form validation). |
26
- | `required` | `boolean` | `false` | Whether the field is required. Shows a red asterisk. |
27
- | `error` | `string \| boolean` | — | Error message or boolean indicating an error state. |
28
- | `readOnly` | `boolean` | `false` | Whether the field is read-only. |
29
- | `onSearch` | `(query: string) => void` | — | Callback for server-side search. Receives the search query string. |
30
- | `isLoading` | `boolean` | `false` | Whether options are being loaded from an external API. |
31
- | `noResultsMessage` | `string` | `"No se encontraron resultados"` | Message displayed when no results match the search. |
32
- | `renderOption` | `(option, state: { isSelected, searchTerm }) => ReactNode` | — | Custom template for each dropdown option. |
33
- | `clearable` | `boolean` | `true` | Shows a clear (X) button inside the input. |
34
- | `onClear` | `() => void` | — | Callback fired when the clear button is pressed. |
35
-
36
- ## Usage
37
-
38
- ```tsx
39
- import { ITSearchSelect } from '@axzydev/axzy_ui_system';
40
-
41
- <ITSearchSelect
42
- name="user"
43
- label="Select User"
44
- placeholder="Search user..."
45
- options={users}
46
- value={selected}
47
- onChange={(val) => setSelected(val)}
48
- />
49
-
50
- <ITSearchSelect
51
- name="remote"
52
- label="API Search"
53
- placeholder="Type to search..."
54
- options={remoteOptions}
55
- isLoading={loading}
56
- onSearch={(query) => fetchResults(query)}
57
- value={selected}
58
- onChange={(val) => setSelected(val)}
59
- />
60
- ```
61
-
62
- ## Notes
63
-
64
- - **Static mode**: provide an `options` array and the component filters client-side as the user types.
65
- - **Remote mode**: provide an `onSearch` callback and manage `options`/`isLoading` externally for API-driven searches.
66
- - `valueField` and `labelField` allow custom option object structures beyond `{ value, label }`.
67
- - Validation states: `error` string displays inline, `touched` gates error visibility, `required` adds a red asterisk.
68
- - `readOnly` mode renders the selected value as non-interactive text.
69
- - Supports `className` for style overrides and width control.
70
- - **Custom options**: `renderOption` replaces the default option rendering and receives `{ isSelected, searchTerm }`.
71
- - **Clear button**: an (X) button appears inside the input when there is a search term or a selected value; `clearable={false}` disables it. Clearing resets the search and selection, and calls `onSearch("")` / `onClear()`.
72
-
73
- ## Stories
74
-
75
- <Primary />
76
- <Controls />
77
- <Stories />
@@ -1,146 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import ITSearchSelect from "@/components/molecules/search-select/search-select";
3
- import { useState } from "react";
4
- import { ITSearchSelectOption } from "./search-select.props";
5
-
6
- const meta: Meta<typeof ITSearchSelect> = {
7
- title: "Components/Form Elements/ITSearchSelect",
8
- component: ITSearchSelect,
9
- parameters: {
10
- layout: "centered",
11
- },
12
- argTypes: {
13
- disabled: { control: "boolean" },
14
- required: { control: "boolean" },
15
- error: { control: "text" },
16
- isLoading: { control: "boolean" },
17
- },
18
- };
19
-
20
- export default meta;
21
- type Story = StoryObj<typeof ITSearchSelect>;
22
-
23
- const options: ITSearchSelectOption[] = [
24
- { value: 1, label: "Juan Pérez" },
25
- { value: 2, label: "María García" },
26
- { value: 3, label: "Carlos Rodríguez" },
27
- { value: 4, label: "Ana Martínez" },
28
- { value: 5, label: "Luis López" },
29
- { value: 6, label: "Elena Sánchez" },
30
- { value: 7, label: "Roberto Díaz" },
31
- { value: 8, label: "Marta Castro" },
32
- ];
33
-
34
- const SearchSelectWrapper = (args: any) => {
35
- const [value, setValue] = useState(args.value || "");
36
- const [touched, setTouched] = useState(false);
37
-
38
- return (
39
- <div className="w-[400px]">
40
- <ITSearchSelect
41
- {...args}
42
- value={value}
43
- onChange={(val) => setValue(val)}
44
- onBlur={() => setTouched(true)}
45
- touched={touched}
46
- />
47
- </div>
48
- );
49
- };
50
-
51
- export const Default: Story = {
52
- render: (args) => <SearchSelectWrapper {...args} />,
53
- args: {
54
- name: "search-select",
55
- options: options,
56
- placeholder: "Busca un usuario...",
57
- },
58
- };
59
-
60
- export const WithLabel: Story = {
61
- render: (args) => <SearchSelectWrapper {...args} />,
62
- args: {
63
- name: "search-select",
64
- label: "Seleccionar Usuario",
65
- options: options,
66
- placeholder: "Busca un usuario...",
67
- required: true,
68
- },
69
- };
70
-
71
- export const RemoteAPI: Story = {
72
- render: (args) => {
73
- const [remoteOptions, setRemoteOptions] = useState<ITSearchSelectOption[]>([]);
74
- const [loading, setLoading] = useState(false);
75
- const [val, setVal] = useState<string | number>("");
76
-
77
- const handleSearch = (query: string) => {
78
- setLoading(true);
79
- // Simular llamada a API
80
- setTimeout(() => {
81
- const results = options.filter(o =>
82
- o.label.toLowerCase().includes(query.toLowerCase())
83
- );
84
- setRemoteOptions(results);
85
- setLoading(false);
86
- }, 1000);
87
- };
88
-
89
- return (
90
- <div className="w-[400px]">
91
- <ITSearchSelect
92
- {...args}
93
- value={val}
94
- options={remoteOptions}
95
- isLoading={loading}
96
- onSearch={handleSearch}
97
- onChange={(v) => setVal(v)}
98
- />
99
- </div>
100
- );
101
- },
102
- args: {
103
- name: "remote-search",
104
- label: "Búsqueda en API (Simulada)",
105
- placeholder: "Escribe para buscar...",
106
- },
107
- };
108
-
109
- export const CustomOptionTemplate: Story = {
110
- render: (args) => <SearchSelectWrapper {...args} />,
111
- args: {
112
- name: "search-select",
113
- label: "Usuario (template personalizado)",
114
- options: options,
115
- placeholder: "Busca un usuario...",
116
- renderOption: (option, { isSelected, searchTerm }) => (
117
- <div className="flex items-center justify-between gap-2">
118
- <span className={isSelected ? "font-semibold" : ""}>{option.label}</span>
119
- {searchTerm && (
120
- <span className="text-xs text-secondary-400">{option.label}</span>
121
- )}
122
- </div>
123
- ),
124
- },
125
- };
126
-
127
- export const WithError: Story = {
128
- render: (args) => <SearchSelectWrapper {...args} />,
129
- args: {
130
- name: "search-select",
131
- label: "Campo con Error",
132
- options: options,
133
- error: "Este campo es obligatorio",
134
- touched: true,
135
- },
136
- };
137
-
138
- export const Disabled: Story = {
139
- render: (args) => <SearchSelectWrapper {...args} />,
140
- args: {
141
- name: "search-select",
142
- label: "Campo Deshabilitado",
143
- options: options,
144
- disabled: true,
145
- },
146
- };
@@ -1,75 +0,0 @@
1
- import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
2
- import * as StoriesData from './select.stories';
3
-
4
- <Meta of={StoriesData} />
5
-
6
- # ITSelect
7
-
8
- Native-like dropdown select with validation error display, label support, and read-only mode. Styled consistently with ITInput for seamless form integration.
9
-
10
- ## Props
11
-
12
- | Prop | Type | Default | Description |
13
- |------|------|---------|-------------|
14
- | `name` | `string` | — | Name attribute for the underlying `<select>` element. |
15
- | `options` | `OptionType[]` | — | Array of option objects with value/label key-value pairs. `{ [key: string]: string }`. |
16
- | `valueField` | `string` | `"value"` | Key in each option object used as the option value. |
17
- | `labelField` | `string` | `"label"` | Key in each option object used as the display label. |
18
- | `label` | `string` | — | Label text rendered above the select. |
19
- | `placeholder` | `string` | — | Placeholder text for the default empty option. |
20
- | `value` | `string` | — | Currently selected value (controlled). |
21
- | `onChange` | `(event: ChangeEvent<HTMLSelectElement>) => void` | — | Callback fired on selection change. |
22
- | `onBlur` | `(event: FocusEvent<HTMLSelectElement>) => void` | — | Callback fired on blur. |
23
- | `variant` | `ColorsTypes` | — | Theme color variant for the select border and focus ring. |
24
- | `size` | `SizesTypes` | — | Control size: `"sm"`, `"md"`, or `"lg"`. |
25
- | `disabled` | `boolean` | `false` | Whether the select is disabled. |
26
- | `className` | `string` | — | Additional CSS classes on the `<select>` element. |
27
- | `touched` | `boolean` | — | Marks the field as touched (for validation error display). |
28
- | `error` | `string \| boolean` | — | Error message string, or `true` for a default required error message. |
29
- | `required` | `boolean` | `false` | Whether the field is required. Shows a red asterisk on the label. |
30
- | `autoFocus` | `boolean` | `false` | Autofocus the select on mount. |
31
- | `readOnly` | `boolean` | `false` | Read-only mode: shows the current value as a single disabled option. |
32
-
33
- ## Usage
34
-
35
- ```tsx
36
- import { ITSelect } from '@axzydev/axzy_ui_system';
37
-
38
- <ITSelect
39
- name="country"
40
- label="Country"
41
- placeholder="Select a country"
42
- options={[
43
- { value: "mx", label: "Mexico" },
44
- { value: "us", label: "United States" },
45
- ]}
46
- value={selected}
47
- onChange={(e) => setSelected(e.target.value)}
48
- />
49
-
50
- <ITSelect
51
- name="status"
52
- label="Status"
53
- options={statusOptions}
54
- value={status}
55
- onChange={(e) => setStatus(e.target.value)}
56
- required
57
- error={touched && !status ? "This field is required" : undefined}
58
- />
59
- ```
60
-
61
- ## Notes
62
-
63
- - Custom `valueField` and `labelField` support option objects with arbitrary key names.
64
- - Error state: provides a red border and inline error message when `touched` is true and `error` is set.
65
- - `required` adds a red asterisk on the label and shows a default required error if no custom error is given.
66
- - `readOnly` renders the selected value as a single non-interactive option.
67
- - Arrow-down icon rendered via `FaAngleDown` from react-icons.
68
- - Styles inherited from the theme's `input` configuration for visual consistency with ITInput.
69
- - The `variant` prop maps to theme color tokens for border and focus ring colors.
70
-
71
- ## Stories
72
-
73
- <Primary />
74
- <Controls />
75
- <Stories />
@@ -1,85 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import ITSelect from "@/components/molecules/select/select";
3
- import { useState } from "react";
4
-
5
- const meta: Meta<typeof ITSelect> = {
6
- title: "Components/Form Elements/ITSelect",
7
- component: ITSelect,
8
- parameters: {
9
- layout: "centered",
10
- },
11
- argTypes: {
12
- disabled: { control: "boolean" },
13
- required: { control: "boolean" },
14
- error: { control: "text" },
15
- },
16
- };
17
-
18
- export default meta;
19
- type Story = StoryObj<typeof ITSelect>;
20
-
21
- const options = [
22
- { value: "option1", label: "Option 1" },
23
- { value: "option2", label: "Option 2" },
24
- { value: "option3", label: "Option 3" },
25
- { value: "option4", label: "Option 4" },
26
- ];
27
-
28
- const SelectWrapper = (args: any) => {
29
- const [value, setValue] = useState(args.value || "");
30
- const [touched, setTouched] = useState(false);
31
-
32
- return (
33
- <div className="w-[300px]">
34
- <ITSelect
35
- {...args}
36
- value={value}
37
- onChange={(e) => setValue(e.target.value)}
38
- onBlur={() => setTouched(true)}
39
- touched={touched}
40
- />
41
- </div>
42
- );
43
- };
44
-
45
- export const Default: Story = {
46
- render: (args) => <SelectWrapper {...args} />,
47
- args: {
48
- name: "select",
49
- options: options,
50
- placeholder: "Select an option",
51
- },
52
- };
53
-
54
- export const WithLabel: Story = {
55
- render: (args) => <SelectWrapper {...args} />,
56
- args: {
57
- name: "select",
58
- label: "Select Label",
59
- options: options,
60
- placeholder: "Select an option",
61
- },
62
- };
63
-
64
- export const WithError: Story = {
65
- render: (args) => <SelectWrapper {...args} />,
66
- args: {
67
- name: "select",
68
- label: "Select with Error",
69
- options: options,
70
- placeholder: "Select an option",
71
- error: "This field is required",
72
- touched: true, // Force touched to show error immediately
73
- },
74
- };
75
-
76
- export const Disabled: Story = {
77
- render: (args) => <SelectWrapper {...args} />,
78
- args: {
79
- name: "select",
80
- label: "Disabled Select",
81
- options: options,
82
- placeholder: "Select an option",
83
- disabled: true,
84
- },
85
- };
@@ -1,48 +0,0 @@
1
- import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
2
- import * as StoriesData from './stat-card.stories';
3
-
4
- <Meta of={StoriesData} />
5
-
6
- # ITStatCard
7
-
8
- Metric card displaying a label, value, and optional trend indicator with color theme.
9
-
10
- ## Props
11
-
12
- | Prop | Type | Default | Description |
13
- |------|------|---------|-------------|
14
- | `label` | `string` | — | Card label |
15
- | `value` | `string \| number` | — | Primary metric value |
16
- | `trend` | `'up' \| 'down' \| 'neutral'` | — | Trend direction |
17
- | `trendValue` | `string \| number` | — | Trend percentage or value |
18
- | `icon` | `ReactNode` | — | Icon displayed on the card |
19
- | `color` | `string` | — | Color theme |
20
- | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Card size variant |
21
- | `subtitle` | `string` | — | Secondary descriptive text |
22
- | `loading` | `boolean` | `false` | Show loading skeleton |
23
- | `onClick` | `() => void` | — | Click handler |
24
-
25
- ## Usage
26
-
27
- ```tsx
28
- import { ITStatCard } from '@axzydev/axzy_ui_system';
29
-
30
- <ITStatCard label="Revenue" value="$12,430" trend="up" trendValue="12.5%" color="success" />
31
- <ITStatCard label="Users" value="1,024" icon={<UsersIcon />} size="lg" />
32
- <ITStatCard label="Bounce Rate" value="42%" trend="down" trendValue="3.1%" color="danger" subtitle="vs last week" />
33
- <ITStatCard label="Loading" loading />
34
- ```
35
-
36
- ## Notes
37
-
38
- - `trend` direction renders an arrow indicator with formatted `trendValue`
39
- - `loading` shows a skeleton placeholder for async data
40
- - Three sizes: sm, md, lg
41
- - Clickable via `onClick` for drill-down dashboards
42
- - `subtitle` provides supporting context below the value
43
-
44
- ## Stories
45
-
46
- <Primary />
47
- <Controls />
48
- <Stories />
@@ -1,40 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import ITStatCard from "@/components/molecules/stat-card/stat-card";
3
- import { FaArrowUp } from "react-icons/fa";
4
-
5
- const meta: Meta<typeof ITStatCard> = {
6
- title: "Components/Data Display/ITStatCard",
7
- component: ITStatCard,
8
- };
9
-
10
- export default meta;
11
- type Story = StoryObj<typeof ITStatCard>;
12
-
13
- export const Default: Story = {
14
- args: {
15
- label: "Usuarios Activos",
16
- value: "1,245",
17
- trend: "+12.5%",
18
- trendDirection: "up",
19
- },
20
- };
21
-
22
- export const Negative: Story = {
23
- args: {
24
- label: "Tickets Abiertos",
25
- value: "23",
26
- trend: "-8.2%",
27
- trendDirection: "down",
28
- color: "bg-rose-50 dark:bg-rose-950/20",
29
- },
30
- };
31
-
32
- export const WithIcon: Story = {
33
- args: {
34
- label: "Ventas Hoy",
35
- value: "$4,320",
36
- trend: "+5.4%",
37
- trendDirection: "up",
38
- icon: <FaArrowUp size={12} />,
39
- },
40
- };
@@ -1,54 +0,0 @@
1
- import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
2
- import * as StoriesData from './stepper.stories';
3
-
4
- <Meta of={StoriesData} />
5
-
6
- # ITStepper
7
-
8
- Step-by-step wizard indicator for multi-step workflows with configurable layout and icons.
9
-
10
- ## Props
11
-
12
- | Prop | Type | Default | Description |
13
- |------|------|---------|-------------|
14
- | `steps` | `{ label: string; description?: string; icon?: ReactNode }[]` | — | Step definitions |
15
- | `activeStep` | `number` | `0` | Zero-indexed active step |
16
- | `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | Layout orientation |
17
- | `variant` | `'default' \| 'dot' \| 'icon'` | `'default'` | Visual style variant |
18
- | `clickable` | `boolean` | `false` | Allow clicking steps to navigate |
19
- | `onStepClick` | `(index: number) => void` | — | Click handler for step navigation |
20
- | `color` | `string` | — | Color theme |
21
-
22
- ## Usage
23
-
24
- ```tsx
25
- import { ITStepper } from '@axzydev/axzy_ui_system';
26
-
27
- const steps = [
28
- { label: 'Details', description: 'Enter your info' },
29
- { label: 'Payment', description: 'Choose method' },
30
- { label: 'Confirm', description: 'Review and submit' },
31
- ];
32
-
33
- <ITStepper steps={steps} activeStep={0} />
34
- <ITStepper steps={steps} activeStep={1} variant="dot" orientation="vertical" />
35
- <ITStepper steps={[
36
- { label: 'Upload', icon: <UploadIcon /> },
37
- { label: 'Review', icon: <CheckIcon /> },
38
- ]} variant="icon" />
39
- <ITStepper steps={steps} clickable onStepClick={(i) => console.log(i)} />
40
- ```
41
-
42
- ## Notes
43
-
44
- - `variant="default"` shows numbered step circles
45
- - `variant="dot"` shows minimal dot indicators
46
- - `variant="icon"` uses custom icons per step instead of numbers
47
- - `clickable` + `onStepClick` enables step-based navigation
48
- - Optional `description` renders below each step label
49
-
50
- ## Stories
51
-
52
- <Primary />
53
- <Controls />
54
- <Stories />
@@ -1,154 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import ITStepper from "@/components/molecules/stepper/stepper";
3
- import { useState } from "react";
4
- import { FaUser, FaIdCard, FaCheckCircle } from "react-icons/fa";
5
-
6
- const meta: Meta<typeof ITStepper> = {
7
- title: "Components/Layout & Navigation/ITStepper",
8
- component: ITStepper,
9
- parameters: {
10
- layout: "padded", // Gives the stepper breathing room
11
- },
12
- argTypes: {
13
- color: {
14
- control: "select",
15
- options: ["primary", "secondary", "success", "danger", "warning", "info", "purple"],
16
- },
17
- currentStep: {
18
- control: { type: "number", min: 0, max: 2 },
19
- },
20
- allowClickToJump: {
21
- control: "boolean",
22
- },
23
- useIcons: {
24
- control: "boolean",
25
- },
26
- scrollableContent: {
27
- control: "boolean",
28
- },
29
- disableNext: {
30
- control: "boolean",
31
- },
32
- },
33
- };
34
-
35
- export default meta;
36
- type Story = StoryObj<typeof ITStepper>;
37
-
38
- // --- MOCK CONTENT ---
39
-
40
- const step1Content = (
41
- <div className="flex flex-col gap-4">
42
- <h3 className="text-lg font-bold">Personal Information</h3>
43
- <p className="text-gray-600">Please provide your basic details to get started.</p>
44
- <div className="grid grid-cols-2 gap-4 mt-4">
45
- <div className="bg-gray-100 h-10 rounded animate-pulse"></div>
46
- <div className="bg-gray-100 h-10 rounded animate-pulse"></div>
47
- <div className="bg-gray-100 h-10 rounded animate-pulse col-span-2"></div>
48
- </div>
49
- </div>
50
- );
51
-
52
- const step2Content = (
53
- <div className="flex flex-col gap-4">
54
- <h3 className="text-lg font-bold">Address Details</h3>
55
- <p className="text-gray-600">Where should we send your documents?</p>
56
- <div className="grid grid-cols-3 gap-4 mt-4">
57
- <div className="bg-gray-100 h-10 rounded animate-pulse col-span-3"></div>
58
- <div className="bg-gray-100 h-10 rounded animate-pulse col-span-2"></div>
59
- <div className="bg-gray-100 h-10 rounded animate-pulse"></div>
60
- </div>
61
- </div>
62
- );
63
-
64
- const step3Content = (
65
- <div className="flex flex-col gap-4 items-center justify-center h-full text-center py-8">
66
- <FaCheckCircle className="w-16 h-16 text-success-500 mb-4" />
67
- <h3 className="text-2xl font-bold">You're all set!</h3>
68
- <p className="text-gray-600 max-w-sm">Review your information before final submission. If everything looks good, click Finish.</p>
69
- </div>
70
- );
71
-
72
- const longScrollableContent = (
73
- <div className="flex flex-col gap-4">
74
- <h3 className="text-lg font-bold">Terms and Conditions</h3>
75
- {Array.from({ length: 15 }).map((_, i) => (
76
- <p key={i} className="text-gray-600">
77
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
78
- </p>
79
- ))}
80
- </div>
81
- );
82
-
83
- const basicSteps = [
84
- { label: "Personal Info", content: step1Content },
85
- { label: "Address", content: step2Content },
86
- { label: "Confirmation", content: step3Content },
87
- ];
88
-
89
- const iconSteps = [
90
- { label: "Account", icon: <FaUser />, content: step1Content },
91
- { label: "Identity", icon: <FaIdCard />, content: step2Content },
92
- { label: "Complete", icon: <FaCheckCircle />, content: step3Content },
93
- ];
94
-
95
- const scrollableSteps = [
96
- { label: "Terms", content: longScrollableContent },
97
- { label: "Privacy Policy", content: longScrollableContent },
98
- ];
99
-
100
-
101
- // --- INTERACTIVE WRAPPERS ---
102
-
103
- const StepperWrapper = (args: any) => {
104
- const [currentStep, setCurrentStep] = useState(0);
105
-
106
- return (
107
- <ITStepper
108
- {...args}
109
- currentStep={currentStep}
110
- onStepChange={setCurrentStep}
111
- onFinish={() => alert("Stepper Finished!")}
112
- />
113
- );
114
- };
115
-
116
-
117
- // --- STORIES ---
118
-
119
- export const Default: Story = {
120
- render: (args) => <StepperWrapper {...args} />,
121
- args: {
122
- steps: basicSteps,
123
- color: "primary",
124
- allowClickToJump: true,
125
- },
126
- };
127
-
128
- export const WithIcons: Story = {
129
- render: (args) => <StepperWrapper {...args} />,
130
- args: {
131
- steps: iconSteps,
132
- color: "purple",
133
- useIcons: true,
134
- },
135
- };
136
-
137
- export const StrictSequential: Story = {
138
- render: (args) => <StepperWrapper {...args} />,
139
- args: {
140
- steps: basicSteps,
141
- color: "danger",
142
- allowClickToJump: false, // User must use Next/Back buttons
143
- },
144
- };
145
-
146
- export const ScrollableContent: Story = {
147
- render: (args) => <StepperWrapper {...args} />,
148
- args: {
149
- steps: scrollableSteps,
150
- color: "info",
151
- scrollableContent: true,
152
- maxContentHeight: "300px", // Restricts height to demonstrate scrolling
153
- },
154
- };