@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,71 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import ITGrid from "@/components/atoms/grid/grid";
3
-
4
- const meta: Meta<typeof ITGrid> = {
5
- title: "Layout/ITGrid",
6
- component: ITGrid,
7
- argTypes: {
8
- spacing: { control: { type: "range", min: 0, max: 8, step: 1 } },
9
- columns: { control: { type: "number", min: 1, max: 12 } },
10
- },
11
- };
12
-
13
- export default meta;
14
- type Story = StoryObj<typeof ITGrid>;
15
-
16
- const Cell = ({ children }: { children: string }) => (
17
- <div className="bg-primary-100 text-primary-800 rounded-lg p-4 text-center font-medium h-full flex items-center justify-center">
18
- {children}
19
- </div>
20
- );
21
-
22
- export const ThreeColumns: Story = {
23
- args: { container: true, spacing: 2 },
24
- render: (args) => (
25
- <ITGrid {...args}>
26
- <ITGrid item xs={4}>
27
- <Cell>1/3</Cell>
28
- </ITGrid>
29
- <ITGrid item xs={4}>
30
- <Cell>1/3</Cell>
31
- </ITGrid>
32
- <ITGrid item xs={4}>
33
- <Cell>1/3</Cell>
34
- </ITGrid>
35
- </ITGrid>
36
- ),
37
- };
38
-
39
- export const Responsive: Story = {
40
- args: { container: true, spacing: 3 },
41
- render: (args) => (
42
- <ITGrid {...args}>
43
- <ITGrid item xs={12} sm={6} md={4} lg={3}>
44
- <Cell>xs=12 sm=6 md=4 lg=3</Cell>
45
- </ITGrid>
46
- <ITGrid item xs={12} sm={6} md={4} lg={3}>
47
- <Cell>xs=12 sm=6 md=4 lg=3</Cell>
48
- </ITGrid>
49
- <ITGrid item xs={12} sm={6} md={4} lg={3}>
50
- <Cell>xs=12 sm=6 md=4 lg=3</Cell>
51
- </ITGrid>
52
- <ITGrid item xs={12} sm={6} md={4} lg={3}>
53
- <Cell>xs=12 sm=6 md=4 lg=3</Cell>
54
- </ITGrid>
55
- </ITGrid>
56
- ),
57
- };
58
-
59
- export const SidebarContent: Story = {
60
- args: { container: true, spacing: 4, columns: 12 },
61
- render: (args) => (
62
- <ITGrid {...args}>
63
- <ITGrid item xs={12} md={3}>
64
- <Cell>Sidebar (md: 3/12)</Cell>
65
- </ITGrid>
66
- <ITGrid item xs={12} md={9}>
67
- <Cell>Main Content (md: 9/12)</Cell>
68
- </ITGrid>
69
- </ITGrid>
70
- ),
71
- };
@@ -1,44 +0,0 @@
1
- import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
2
- import * as StoriesData from './image.stories';
3
-
4
- <Meta of={StoriesData} />
5
-
6
- # ITImage
7
-
8
- An image component with automatic fallback on load error. Uses a native `<img>` element with an error boundary that swaps the source to a fallback URL when the primary image fails to load.
9
-
10
- ## Props
11
-
12
- | Prop | Type | Default | Description |
13
- |------|------|---------|-------------|
14
- | `src` | `string` | required | Source URL of the image. |
15
- | `alt` | `string` | `undefined` | Alt text for accessibility. |
16
- | `className` | `string` | `undefined` | Additional CSS classes for the wrapper. |
17
- | `fallback` | `string` | `undefined` | Fallback image URL shown when `src` fails to load. |
18
- | `onClick` | `() => void` | `undefined` | Click handler on the image. |
19
-
20
- ## Usage
21
-
22
- ```tsx
23
- import { ITImage } from '@axzydev/axzy_ui_system';
24
-
25
- <ITImage
26
- src="https://example.com/photo.jpg"
27
- alt="Profile photo"
28
- fallback="https://example.com/default-avatar.jpg"
29
- />
30
- <ITImage src="https://example.com/logo.png" />
31
- ```
32
-
33
- ## Notes
34
-
35
- - Handles `onerror` internally to swap to the `fallback` URL.
36
- - The wrapper is an inline-block `div` with full width/height for responsive sizing within a sized parent.
37
- - If no `fallback` is provided and the image errors, the broken image icon is shown.
38
- - Uses `object-cover` to fill the container while maintaining aspect ratio.
39
-
40
- ## Stories
41
-
42
- <Primary />
43
- <Controls />
44
- <Stories />
@@ -1,48 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import ITImage from '@/components/atoms/image/image';
3
-
4
- const meta = {
5
- title: 'Components/Data Display/ITImage',
6
- component: ITImage,
7
- parameters: { layout: 'centered' },
8
- argTypes: {
9
- src: { control: 'text', description: 'Image source URL' },
10
- alt: { control: 'text', description: 'Alternative text for accessibility' },
11
- fallback: { control: 'text', description: 'Fallback image URL shown when the primary src fails to load' },
12
- className: { control: 'text', description: 'Additional CSS classes for the wrapper' },
13
- onClick: { control: false, description: 'Click handler' },
14
- },
15
- } satisfies Meta<typeof ITImage>;
16
-
17
- export default meta;
18
- type Story = StoryObj<typeof meta>;
19
-
20
- const containerStyle = { width: 256, height: 192 };
21
-
22
- export const Default: Story = {
23
- args: {
24
- src: 'https://picsum.photos/256/192',
25
- alt: 'Random image',
26
- className: 'rounded-lg overflow-hidden',
27
- },
28
- render: (args) => <div style={containerStyle}><ITImage {...args} /></div>,
29
- };
30
-
31
- export const WithFallbackError: Story = {
32
- args: {
33
- src: 'https://invalid-url/does-not-exist.jpg',
34
- alt: 'Broken image',
35
- fallback: 'https://picsum.photos/256/192?grayscale',
36
- className: 'rounded-lg overflow-hidden',
37
- },
38
- render: (args) => <div style={containerStyle}><ITImage {...args} /></div>,
39
- };
40
-
41
- export const SquareAspectRatio: Story = {
42
- args: {
43
- src: 'https://picsum.photos/200/200',
44
- alt: 'Square image',
45
- className: 'rounded-full overflow-hidden',
46
- },
47
- render: (args) => <div style={{ width: 128, height: 128 }}><ITImage {...args} /></div>,
48
- };
@@ -1,70 +0,0 @@
1
- import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
2
- import * as StoriesData from './input.stories';
3
-
4
- <Meta of={StoriesData} />
5
-
6
- # ITInput
7
-
8
- A versatile form input component supporting text, password, email, number, textarea, checkbox, and radio types. Features labels, validation errors, left/right icons, helper text with character count, currency formatting, and configurable sizes.
9
-
10
- ## Props
11
-
12
- | Prop | Type | Default | Description |
13
- |------|------|---------|-------------|
14
- | `name` | `string` | required | Field name used for form identification. |
15
- | `type` | `'text' \| 'password' \| 'number' \| 'email' \| 'checkbox' \| 'radio' \| 'textarea'` | `'text'` | Input type. |
16
- | `label` | `string` | `undefined` | Label displayed above the input. |
17
- | `placeholder` | `string` | `undefined` | Placeholder text. |
18
- | `value` | `any` | `undefined` | Current input value. |
19
- | `onChange` | `(event: any) => void` | required | Change event handler. |
20
- | `onBlur` | `(event) => void` | `undefined` | Blur event handler. |
21
- | `onKeyDown` | `(event) => void` | `undefined` | Keydown event handler. |
22
- | `error` | `string \| boolean` | `undefined` | Validation error message. Pass `true` for generic error styling. |
23
- | `touched` | `boolean` | `undefined` | Whether the field has been touched by the user. |
24
- | `required` | `boolean` | `false` | Mark the field as required (adds asterisk to label). |
25
- | `disabled` | `boolean` | `false` | Disable the input. |
26
- | `size` | `SizesTypes` | `'md'` | Size preset: `"sm"`, `"md"`, `"lg"`. |
27
- | `variant` | `ColorsTypes` | `undefined` | Color variant from the theme palette. |
28
- | `iconLeft` | `ReactNode` | `undefined` | Icon element rendered on the left side. |
29
- | `iconRight` | `ReactNode` | `undefined` | Icon element rendered on the right side. |
30
- | `maxLength` | `number` | `undefined` | Maximum allowed character length. |
31
- | `minLength` | `number` | `undefined` | Minimum allowed character length. |
32
- | `showHintLength` | `boolean` | `false` | Show character count hint below the input. |
33
- | `currencyFormat` | `boolean` | `false` | Enable currency formatting for number inputs (MX locale). |
34
- | `formatNumber` | `boolean` | `false` | Enable number formatting on blur. |
35
- | `autoFocus` | `boolean` | `false` | Auto-focus the input on mount. |
36
- | `focusContent` | `boolean` | `false` | Select all content on click/focus. |
37
- | `readOnly` | `boolean` | `false` | Render the input in read-only mode. |
38
- | `min` | `number` | `undefined` | Minimum numeric value for number inputs. |
39
- | `max` | `number` | `undefined` | Maximum numeric value for number inputs. |
40
- | `rows` | `number` | `undefined` | Number of visible rows for textarea. |
41
- | `checked` | `boolean` | `undefined` | Checked state for checkbox and radio types. |
42
- | `containerClassName` | `string` | `undefined` | Additional CSS classes for the outer container. |
43
- | `labelClassName` | `string` | `undefined` | Additional CSS classes for the label. |
44
- | `className` | `string` | `undefined` | Additional CSS classes for the input element. |
45
- | `onClick` | `() => void` | `undefined` | Click handler for the input. |
46
-
47
- ## Usage
48
-
49
- ```tsx
50
- import { ITInput } from '@axzydev/axzy_ui_system';
51
-
52
- <ITInput name="email" label="Email" type="email" placeholder="example@mail.com" />
53
- <ITInput name="password" label="Password" type="password" iconLeft={<FaLock />} />
54
- <ITInput name="bio" label="Bio" type="textarea" rows={4} />
55
- <ITInput name="qty" label="Quantity" type="number" min={0} max={100} />
56
- ```
57
-
58
- ## Notes
59
-
60
- - Error message only displays when both `error` and `touched` are truthy.
61
- - `showHintLength` with `maxLength` displays a counter (e.g. "45/200").
62
- - Currency formatting uses MX locale by default when `currencyFormat` is true.
63
- - Icons rendered via `iconLeft`/`iconRight` can be clickable React nodes (e.g. a toggle visibility button).
64
- - Checkbox and radio types render inline labels instead of stacked layout.
65
-
66
- ## Stories
67
-
68
- <Primary />
69
- <Controls />
70
- <Stories />
@@ -1,113 +0,0 @@
1
- import type { Meta } from '@storybook/react';
2
- import ITInput from '@/components/atoms/input/input';
3
- import { FaUser, FaLock, FaEnvelope } from 'react-icons/fa';
4
-
5
- const meta = {
6
- title: 'Components/Form Elements/ITInput',
7
- component: ITInput,
8
- parameters: {
9
- layout: 'centered',
10
- },
11
- argTypes: {
12
- type: {
13
- control: 'select',
14
- options: ['text', 'password', 'number', 'email', 'textarea'],
15
- },
16
- disabled: { control: 'boolean' },
17
- error: { control: 'text' },
18
- },
19
- } satisfies Meta<typeof ITInput>;
20
-
21
- export default meta;
22
-
23
- export const Default: any = {
24
- args: {
25
- name: 'default-input',
26
- placeholder: 'Type something...',
27
- },
28
- };
29
-
30
- export const WithLabel: any = {
31
- args: {
32
- name: 'labeled-input',
33
- label: 'Username',
34
- placeholder: 'Enter your username',
35
- },
36
- };
37
-
38
- export const WithIcons: any = {
39
- args: {
40
- name: 'icon-input',
41
- label: 'Email',
42
- type: 'email',
43
- placeholder: 'example@mail.com',
44
- iconLeft: <FaEnvelope className="text-gray-400" />,
45
- },
46
- };
47
-
48
- export const ClickableIcons: any = {
49
- args: {
50
- name: 'search-input',
51
- label: 'Search',
52
- placeholder: 'Search...',
53
- iconRight: (
54
- <button
55
- onClick={() => alert('Search clicked!')}
56
- className="text-gray-500 hover:text-blue-500 transition-colors"
57
- >
58
- <FaUser />
59
- </button>
60
- ),
61
- },
62
- };
63
-
64
- export const Password: any = {
65
- args: {
66
- name: 'password-input',
67
- label: 'Password',
68
- type: 'password',
69
- placeholder: '••••••••',
70
- iconLeft: <FaLock className="text-gray-400" />,
71
- },
72
- };
73
-
74
- export const WithError: any = {
75
- args: {
76
- name: 'error-input',
77
- label: 'Email',
78
- value: 'invalid-email',
79
- touched: true,
80
- error: 'Please enter a valid email address',
81
- iconLeft: <FaEnvelope className="text-gray-400" />,
82
- },
83
- };
84
-
85
- export const Disabled: any = {
86
- args: {
87
- name: 'disabled-input',
88
- label: 'Disabled Input',
89
- value: 'Cannot edit this',
90
- disabled: true,
91
- },
92
- };
93
-
94
- export const TextArea: any = {
95
- args: {
96
- name: 'textarea',
97
- label: 'Description',
98
- type: 'textarea',
99
- placeholder: 'Write a detailed description...',
100
- rows: 4,
101
- },
102
- };
103
-
104
- export const NumberInput: any = {
105
- args: {
106
- name: 'number-input',
107
- label: 'Quantity',
108
- type: 'number',
109
- placeholder: '0',
110
- min: 0,
111
- max: 100,
112
- },
113
- };
@@ -1,74 +0,0 @@
1
- import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
2
- import * as StoriesData from './input-number.stories';
3
-
4
- <Meta of={StoriesData} />
5
-
6
- # ITInputNumber
7
-
8
- Numeric field that always renders currency-style formatting (thousand separators + fixed decimals) and emits a real `number` through `onChange` / `onBlur`. Built on top of `ITInput`, so it inherits label, validation, sizes, icons and theming.
9
-
10
- ## Props
11
-
12
- | Prop | Type | Default | Description |
13
- |------|------|---------|-------------|
14
- | `name` | `string` | required | Field name used for form identification. |
15
- | `value` | `number \| null` | `undefined` | Current numeric value. |
16
- | `onChange` | `(value: number \| undefined, event) => void` | required | Called with the parsed value on every change. |
17
- | `onBlur` | `(value: number \| undefined, event) => void` | `undefined` | Called on blur with the parsed (and clamped) value. |
18
- | `decimals` | `number` | `2` | Decimal places allowed. `0` restricts to integers. |
19
- | `prefix` | `string` | `undefined` | Text prefix rendered inside the field (e.g. `"$"`). Ignored when `iconLeft` is set. |
20
- | `label` | `string` | `undefined` | Label displayed above the input. |
21
- | `placeholder` | `string` | `undefined` | Placeholder text. |
22
- | `min` | `number` | `undefined` | Minimum value; lower values are clamped on blur. |
23
- | `max` | `number` | `undefined` | Maximum value; higher values are clamped on blur. |
24
- | `size` | `"sm" \| "md" \| "lg"` | `"md"` | Size preset. |
25
- | `disabled` | `boolean` | `false` | Disable the input. |
26
- | `readOnly` | `boolean` | `false` | Render the input in read-only mode. |
27
- | `required` | `boolean` | `false` | Mark the field as required. |
28
- | `touched` | `boolean` | `undefined` | Whether the field has been touched by the user. |
29
- | `error` | `string \| boolean` | `undefined` | Validation error (`true` = generic message). |
30
- | `iconLeft` / `iconRight` | `ReactNode` | `undefined` | Icons rendered inside the field. |
31
- | `containerClassName` | `string` | `undefined` | Additional classes for the outer container. |
32
- | `labelClassName` | `string` | `undefined` | Additional classes for the label. |
33
- | `className` | `string` | `undefined` | Additional classes for the input element. |
34
- | `autoFocus` | `boolean` | `false` | Auto-focus on mount. |
35
- | `focusContent` | `boolean` | `false` | Select all content on click. |
36
- | `onKeyDown` | `(event) => void` | `undefined` | Keydown handler for the underlying input. |
37
-
38
- ## Usage
39
-
40
- ```tsx
41
- import { ITInputNumber } from '@axzydev/axzy_ui_system';
42
-
43
- <ITInputNumber
44
- name="amount"
45
- label="Monto"
46
- value={amount}
47
- prefix="$"
48
- onChange={(value) => setAmount(value)}
49
- />
50
-
51
- <ITInputNumber
52
- name="qty"
53
- label="Cantidad"
54
- decimals={0}
55
- min={1}
56
- max={99}
57
- value={qty}
58
- onChange={(value) => setQty(value)}
59
- />
60
- ```
61
-
62
- ## Notes
63
-
64
- - The emitted value is a `number` (or `undefined` when the field is empty) — no `parseFloat` needed by the consumer.
65
- - Formatting is always on: thousand separators while blurred, raw digits while typing.
66
- - Use `decimals={0}` for integers only.
67
- - Values are clamped to `min`/`max` on blur.
68
- - `prefix` is a convenience over `iconLeft`; pass `iconLeft` directly for any custom node.
69
-
70
- ## Stories
71
-
72
- <Primary />
73
- <Controls />
74
- <Stories />
@@ -1,111 +0,0 @@
1
- import { useState } from 'react';
2
- import type { Meta, StoryObj } from '@storybook/react';
3
- import { FaDollarSign } from 'react-icons/fa';
4
- import ITInputNumber from '@/components/atoms/input-number/input-number';
5
- import { ITInputNumberProps } from './input-number.props';
6
-
7
- const meta: Meta<typeof ITInputNumber> = {
8
- title: 'Components/Form Elements/ITInputNumber',
9
- component: ITInputNumber,
10
- parameters: {
11
- layout: 'centered',
12
- },
13
- argTypes: {
14
- decimals: { control: 'number' },
15
- disabled: { control: 'boolean' },
16
- error: { control: 'text' },
17
- min: { control: 'number' },
18
- max: { control: 'number' },
19
- },
20
- };
21
-
22
- export default meta;
23
-
24
- type Story = StoryObj<typeof ITInputNumber>;
25
-
26
- /** Wrapper that keeps the value in state so the story reflects real usage. */
27
- const Interactive = (props: Partial<ITInputNumberProps> & Pick<ITInputNumberProps, 'name'>) => {
28
- const [value, setValue] = useState<number | null>(null);
29
- return (
30
- <div className="w-80">
31
- <ITInputNumber
32
- label="Monto"
33
- placeholder="0.00"
34
- {...props}
35
- value={value}
36
- onChange={(next) => setValue(next ?? null)}
37
- />
38
- <p className="mt-2 text-xs font-mono text-slate-500">
39
- value: {value === null ? 'null' : `${value} (${typeof value})`}
40
- </p>
41
- </div>
42
- );
43
- };
44
-
45
- export const Default: Story = {
46
- render: () => <Interactive name="amount" />,
47
- };
48
-
49
- export const WithPrefix: Story = {
50
- render: () => <Interactive name="amount-prefix" prefix="$" />,
51
- };
52
-
53
- export const WithIcon: Story = {
54
- render: () => (
55
- <Interactive name="amount-icon" iconLeft={<FaDollarSign className="text-slate-400" />} />
56
- ),
57
- };
58
-
59
- export const InitialValue: Story = {
60
- render: () => {
61
- const [value, setValue] = useState<number | null>(1234.5);
62
- return (
63
- <div className="w-80">
64
- <ITInputNumber
65
- name="amount-initial"
66
- label="Monto inicial"
67
- prefix="$"
68
- value={value}
69
- onChange={(next) => setValue(next ?? null)}
70
- />
71
- <p className="mt-2 text-xs font-mono text-slate-500">value: {value === null ? 'null' : value}</p>
72
- </div>
73
- );
74
- },
75
- };
76
-
77
- export const IntegersOnly: Story = {
78
- render: () => <Interactive name="quantity" label="Cantidad" decimals={0} />,
79
- };
80
-
81
- export const WithBounds: Story = {
82
- render: () => <Interactive name="bounded" label="Entre 10 y 500" min={10} max={500} />,
83
- };
84
-
85
- export const WithError: Story = {
86
- render: () => (
87
- <Interactive
88
- name="amount-error"
89
- label="Monto"
90
- prefix="$"
91
- touched
92
- error="El monto es obligatorio"
93
- />
94
- ),
95
- };
96
-
97
- export const Disabled: Story = {
98
- render: () => (
99
- <div className="w-80">
100
- <ITInputNumber name="amount-disabled" label="Monto" value={1234.5} disabled onChange={() => {}} />
101
- </div>
102
- ),
103
- };
104
-
105
- export const ReadOnly: Story = {
106
- render: () => (
107
- <div className="w-80">
108
- <ITInputNumber name="amount-readonly" label="Monto" prefix="$" value={98765.43} readOnly onChange={() => {}} />
109
- </div>
110
- ),
111
- };
@@ -1,43 +0,0 @@
1
- import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
2
- import * as StoriesData from './loader.stories';
3
-
4
- <Meta of={StoriesData} />
5
-
6
- # ITLoader
7
-
8
- A loading indicator with four animation variants and customizable sizing and color. Useful for async operations, data fetching states, and any in-progress feedback.
9
-
10
- ## Props
11
-
12
- | Prop | Type | Default | Description |
13
- |------|------|---------|-------------|
14
- | `variant` | `'spinner' \| 'dots' \| 'bar' \| 'pulse'` | `'spinner'` | Animation style. |
15
- | `size` | `'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Size preset. |
16
- | `color` | `string` | `'primary'` | Color value. Accepts theme semantic keys (`primary`, `secondary`, `success`, `danger`, `warning`, `info`, `purple`), hex, rgb, or CSS class. |
17
- | `className` | `string` | `undefined` | Additional CSS classes. |
18
-
19
- ## Usage
20
-
21
- ```tsx
22
- import { ITLoader } from '@axzydev/axzy_ui_system';
23
-
24
- <ITLoader />
25
- <ITLoader variant="dots" color="secondary" size="lg" />
26
- <ITLoader variant="bar" color="success" />
27
- <ITLoader variant="pulse" color="danger" size="xl" />
28
- ```
29
-
30
- ## Notes
31
-
32
- - `spinner` — rotating circular indicator.
33
- - `dots` — bouncing dots sequence.
34
- - `pulse` — pulsing circle with scaling animation.
35
- - `bar` — horizontal indeterminate progress bar (intended for use in a container with explicit width).
36
- - Color mapping is handled through the theme system; semantic keys resolve to CSS custom properties.
37
- - All animations use CSS keyframes with GPU-accelerated transforms where possible.
38
-
39
- ## Stories
40
-
41
- <Primary />
42
- <Controls />
43
- <Stories />
@@ -1,104 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import ITLoader from "@/components/atoms/loader/loader";
3
-
4
- const meta: Meta<typeof ITLoader> = {
5
- title: "Components/Feedback/ITLoader",
6
- component: ITLoader,
7
- parameters: {
8
- layout: "centered",
9
- },
10
- argTypes: {
11
- size: {
12
- control: "select",
13
- options: ["sm", "md", "lg", "xl"],
14
- description: "Size of the loader",
15
- },
16
- variant: {
17
- control: "select",
18
- options: ["spinner", "dots", "bar", "pulse"],
19
- description: "Visual style of the loader",
20
- },
21
- color: {
22
- control: "select",
23
- options: ["primary", "secondary", "success", "danger", "warning", "info", "purple"],
24
- description: "Semantic color from theme",
25
- },
26
- },
27
- };
28
-
29
- export default meta;
30
- type Story = StoryObj<typeof ITLoader>;
31
-
32
- export const Spinner: Story = {
33
- args: {
34
- variant: "spinner",
35
- color: "primary",
36
- size: "md",
37
- },
38
- };
39
-
40
- export const Dots: Story = {
41
- args: {
42
- variant: "dots",
43
- color: "secondary",
44
- size: "md",
45
- },
46
- };
47
-
48
- export const Pulse: Story = {
49
- args: {
50
- variant: "pulse",
51
- color: "danger",
52
- size: "lg",
53
- },
54
- };
55
-
56
- export const Bar: Story = {
57
- render: (args) => (
58
- <div className="w-[300px]">
59
- <ITLoader {...args} />
60
- </div>
61
- ),
62
- args: {
63
- variant: "bar",
64
- color: "success",
65
- size: "md",
66
- },
67
- };
68
-
69
- export const AllColors: Story = {
70
- render: (args) => (
71
- <div className="flex gap-4 items-center">
72
- {(['primary', 'secondary', 'success', 'danger', 'warning', 'info', 'purple'] as const).map((color) => (
73
- <ITLoader key={color} {...args} color={color} />
74
- ))}
75
- </div>
76
- ),
77
- args: {
78
- variant: "spinner",
79
- size: "md",
80
- },
81
- };
82
-
83
- export const AllVariants: Story = {
84
- render: () => (
85
- <div className="flex flex-col gap-8 items-center">
86
- <div className="flex gap-4 items-center">
87
- <span className="w-20 text-sm font-bold text-gray-500">Spinner</span>
88
- <ITLoader variant="spinner" color="primary" />
89
- </div>
90
- <div className="flex gap-4 items-center">
91
- <span className="w-20 text-sm font-bold text-gray-500">Dots</span>
92
- <ITLoader variant="dots" color="primary" />
93
- </div>
94
- <div className="flex gap-4 items-center">
95
- <span className="w-20 text-sm font-bold text-gray-500">Pulse</span>
96
- <ITLoader variant="pulse" color="primary" />
97
- </div>
98
- <div className="flex gap-4 items-center w-[300px]">
99
- <span className="w-20 text-sm font-bold text-gray-500">Bar</span>
100
- <ITLoader variant="bar" color="primary" />
101
- </div>
102
- </div>
103
- ),
104
- };