@axzydev/axzy_ui_system 1.4.8 → 1.5.1

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 (223) hide show
  1. package/README.md +2 -11
  2. package/dist/index.cjs +1826 -1351
  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 +115 -14
  7. package/dist/index.d.ts +115 -14
  8. package/dist/index.js +1481 -1010
  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.tsx +30 -28
  39. package/src/components/molecules/time-picker/timePicker.tsx +8 -6
  40. package/src/components/molecules/wysiwyg/wysiwyg.tsx +23 -12
  41. package/src/components/organisms/confirm-dialog/confirm-dialog.props.ts +4 -4
  42. package/src/components/organisms/confirm-dialog/confirm-dialog.tsx +16 -8
  43. package/src/components/organisms/data-table/dataTable.tsx +31 -25
  44. package/src/components/organisms/dialog/dialog.tsx +3 -0
  45. package/src/components/organisms/drawer/drawer.tsx +3 -0
  46. package/src/components/organisms/dropfile/dropfile.tsx +19 -17
  47. package/src/components/organisms/form-builder/fieldRenderer.tsx +4 -2
  48. package/src/components/organisms/navbar/navbar.tsx +4 -2
  49. package/src/components/organisms/page-header/page-header.tsx +3 -1
  50. package/src/components/organisms/searchTable/components/PaginationControls.tsx +8 -6
  51. package/src/components/organisms/searchTable/components/PaginationInfo.tsx +3 -1
  52. package/src/components/organisms/searchTable/components/SearchAndSortBar.tsx +7 -5
  53. package/src/components/organisms/searchTable/components/SearchInput.tsx +4 -2
  54. package/src/components/organisms/searchTable/components/SortButton.tsx +13 -11
  55. package/src/components/organisms/searchTable/components/TableEmptyState.tsx +4 -2
  56. package/src/components/organisms/searchTable/components/TableRow.tsx +6 -4
  57. package/src/components/organisms/searchTable/searchTable.tsx +4 -2
  58. package/src/components/organisms/sidebar/sidebar.props.ts +1 -1
  59. package/src/components/organisms/sidebar/sidebar.tsx +9 -4
  60. package/src/components/organisms/toast/toast.tsx +3 -1
  61. package/src/components/organisms/topbar/topbar.tsx +4 -2
  62. package/src/components/templates/page/page.props.ts +4 -4
  63. package/src/components/templates/page/page.tsx +6 -4
  64. package/src/components/theme-provider/themeProvider.tsx +28 -17
  65. package/src/dev.css +61 -2
  66. package/src/global.d.ts +10 -0
  67. package/src/i18n/context.ts +9 -0
  68. package/src/i18n/index.ts +22 -0
  69. package/src/i18n/locales/en.ts +163 -0
  70. package/src/i18n/locales/es.ts +165 -0
  71. package/src/i18n/provider.tsx +44 -0
  72. package/src/i18n/translator.ts +82 -0
  73. package/src/i18n/types.ts +54 -0
  74. package/src/i18n/useITTranslation.ts +20 -0
  75. package/src/index.css +0 -1
  76. package/src/index.ts +7 -1
  77. package/src/sandbox/LandingShowcase.tsx +224 -580
  78. package/src/sandbox/NotFoundShowcase.tsx +51 -36
  79. package/src/sandbox/TopbarSearch.tsx +6 -4
  80. package/src/sandbox/controls.tsx +180 -0
  81. package/src/sandbox/i18n.ts +1939 -0
  82. package/src/sandbox/icons.tsx +25 -0
  83. package/src/sandbox/locale.tsx +72 -0
  84. package/src/sandbox/ui.tsx +474 -0
  85. package/src/sandbox/useHashRoute.ts +46 -10
  86. package/src/showcases/DataShowcases.tsx +103 -87
  87. package/src/showcases/FeedbackShowcases.tsx +37 -30
  88. package/src/showcases/FormShowcases.tsx +303 -215
  89. package/src/showcases/GettingStartedShowcase.tsx +151 -145
  90. package/src/showcases/HelpShowcase.tsx +126 -128
  91. package/src/showcases/HomeShowcase.tsx +678 -482
  92. package/src/showcases/LayoutPrimitivesShowcases.tsx +129 -114
  93. package/src/showcases/NavigationShowcases.tsx +45 -37
  94. package/src/showcases/PageShowcases.tsx +171 -152
  95. package/src/showcases/ProductoDetalle.tsx +272 -129
  96. package/src/showcases/ShowcaseLayout.tsx +256 -219
  97. package/src/showcases/SizesShowcase.tsx +123 -64
  98. package/src/showcases/StructureShowcases.tsx +203 -138
  99. package/src/showcases/portfolioUi.tsx +153 -0
  100. package/src/showcases/techIcons.ts +3 -0
  101. package/src/utils/table.utils.ts +10 -2
  102. package/src/components/atoms/avatar/avatar.doc.mdx +0 -48
  103. package/src/components/atoms/avatar/avatar.stories.tsx +0 -64
  104. package/src/components/atoms/badget/badget.doc.mdx +0 -46
  105. package/src/components/atoms/badget/badget.stories.tsx +0 -75
  106. package/src/components/atoms/button/button.doc.mdx +0 -59
  107. package/src/components/atoms/button/button.stories.tsx +0 -173
  108. package/src/components/atoms/checkbox/checkbox.doc.mdx +0 -54
  109. package/src/components/atoms/checkbox/checkbox.stories.tsx +0 -53
  110. package/src/components/atoms/chip/chip.doc.mdx +0 -47
  111. package/src/components/atoms/chip/chip.stories.tsx +0 -64
  112. package/src/components/atoms/divider/divider.doc.mdx +0 -42
  113. package/src/components/atoms/divider/divider.stories.tsx +0 -33
  114. package/src/components/atoms/flex/flex.doc.mdx +0 -59
  115. package/src/components/atoms/flex/flex.stories.tsx +0 -70
  116. package/src/components/atoms/grid/grid.doc.mdx +0 -54
  117. package/src/components/atoms/grid/grid.stories.tsx +0 -71
  118. package/src/components/atoms/image/image.doc.mdx +0 -44
  119. package/src/components/atoms/image/image.stories.tsx +0 -48
  120. package/src/components/atoms/input/input.doc.mdx +0 -70
  121. package/src/components/atoms/input/input.stories.tsx +0 -113
  122. package/src/components/atoms/input-number/input-number.doc.mdx +0 -74
  123. package/src/components/atoms/input-number/input-number.stories.tsx +0 -111
  124. package/src/components/atoms/loader/loader.doc.mdx +0 -43
  125. package/src/components/atoms/loader/loader.stories.tsx +0 -104
  126. package/src/components/atoms/popover/popover.doc.mdx +0 -53
  127. package/src/components/atoms/popover/popover.stories.tsx +0 -24
  128. package/src/components/atoms/progress/progress.doc.mdx +0 -48
  129. package/src/components/atoms/progress/progress.stories.tsx +0 -39
  130. package/src/components/atoms/radio/radio.doc.mdx +0 -62
  131. package/src/components/atoms/radio/radio.stories.tsx +0 -48
  132. package/src/components/atoms/segmented-control/segmented-control.doc.mdx +0 -60
  133. package/src/components/atoms/segmented-control/segmented-control.stories.tsx +0 -62
  134. package/src/components/atoms/skeleton/skeleton.doc.mdx +0 -43
  135. package/src/components/atoms/skeleton/skeleton.stories.tsx +0 -29
  136. package/src/components/atoms/slide/slide.doc.mdx +0 -46
  137. package/src/components/atoms/slide/slide.stories.tsx +0 -120
  138. package/src/components/atoms/slider/slider.doc.mdx +0 -49
  139. package/src/components/atoms/slider/slider.stories.tsx +0 -29
  140. package/src/components/atoms/stack/stack.doc.mdx +0 -126
  141. package/src/components/atoms/stack/stack.stories.tsx +0 -283
  142. package/src/components/atoms/text/text.doc.mdx +0 -41
  143. package/src/components/atoms/text/text.stories.tsx +0 -66
  144. package/src/components/atoms/textarea/textarea.doc.mdx +0 -64
  145. package/src/components/atoms/textarea/textarea.stories.tsx +0 -26
  146. package/src/components/atoms/tooltip/tooltip.doc.mdx +0 -47
  147. package/src/components/atoms/tooltip/tooltip.stories.tsx +0 -19
  148. package/src/components/isolation/isolation.stories.tsx +0 -202
  149. package/src/components/molecules/accordion/accordion.doc.mdx +0 -47
  150. package/src/components/molecules/accordion/accordion.stories.tsx +0 -68
  151. package/src/components/molecules/alert/alert.doc.mdx +0 -48
  152. package/src/components/molecules/alert/alert.stories.tsx +0 -40
  153. package/src/components/molecules/breadcrumbs/breadcrumbs.doc.mdx +0 -57
  154. package/src/components/molecules/breadcrumbs/breadcrumbs.stories.tsx +0 -20
  155. package/src/components/molecules/calendar/calendar.doc.mdx +0 -76
  156. package/src/components/molecules/calendar/calendar.stories.tsx +0 -90
  157. package/src/components/molecules/card/card.doc.mdx +0 -54
  158. package/src/components/molecules/card/card.stories.tsx +0 -57
  159. package/src/components/molecules/chip-input/chip-input.doc.mdx +0 -44
  160. package/src/components/molecules/chip-input/chip-input.stories.tsx +0 -52
  161. package/src/components/molecules/date-picker/date-picker.doc.mdx +0 -65
  162. package/src/components/molecules/date-picker/date-picker.stories.tsx +0 -88
  163. package/src/components/molecules/dropdown-menu/dropdown-menu.doc.mdx +0 -46
  164. package/src/components/molecules/dropdown-menu/dropdown-menu.stories.tsx +0 -41
  165. package/src/components/molecules/empty-state/empty-state.doc.mdx +0 -50
  166. package/src/components/molecules/empty-state/empty-state.stories.tsx +0 -19
  167. package/src/components/molecules/field/field.doc.mdx +0 -43
  168. package/src/components/molecules/field/field.stories.tsx +0 -42
  169. package/src/components/molecules/form-header/form-header.doc.mdx +0 -38
  170. package/src/components/molecules/form-header/form-header.stories.tsx +0 -52
  171. package/src/components/molecules/masked-input/masked-input.doc.mdx +0 -78
  172. package/src/components/molecules/masked-input/masked-input.stories.tsx +0 -126
  173. package/src/components/molecules/multi-select/multi-select.doc.mdx +0 -55
  174. package/src/components/molecules/multi-select/multi-select.stories.tsx +0 -59
  175. package/src/components/molecules/pagination/pagination.doc.mdx +0 -62
  176. package/src/components/molecules/pagination/pagination.stories.tsx +0 -110
  177. package/src/components/molecules/search-select/search-select.doc.mdx +0 -77
  178. package/src/components/molecules/search-select/search-select.stories.tsx +0 -146
  179. package/src/components/molecules/select/select.doc.mdx +0 -75
  180. package/src/components/molecules/select/select.stories.tsx +0 -85
  181. package/src/components/molecules/stat-card/stat-card.doc.mdx +0 -48
  182. package/src/components/molecules/stat-card/stat-card.stories.tsx +0 -40
  183. package/src/components/molecules/stepper/stepper.doc.mdx +0 -54
  184. package/src/components/molecules/stepper/stepper.stories.tsx +0 -154
  185. package/src/components/molecules/table/table.doc.mdx +0 -140
  186. package/src/components/molecules/table/table.stories.tsx +0 -402
  187. package/src/components/molecules/tabs/tabs.doc.mdx +0 -52
  188. package/src/components/molecules/tabs/tabs.stories.tsx +0 -31
  189. package/src/components/molecules/time-picker/timePicker.doc.mdx +0 -68
  190. package/src/components/molecules/time-picker/timePicker.stories.tsx +0 -130
  191. package/src/components/molecules/wysiwyg/wysiwyg.stories.tsx +0 -95
  192. package/src/components/organisms/confirm-dialog/confirm-dialog.doc.mdx +0 -60
  193. package/src/components/organisms/confirm-dialog/confirm-dialog.stories.tsx +0 -32
  194. package/src/components/organisms/data-table/ITDataTable.doc.mdx +0 -132
  195. package/src/components/organisms/data-table/ITDataTable.stories.tsx +0 -353
  196. package/src/components/organisms/dialog/dialog.doc.mdx +0 -54
  197. package/src/components/organisms/dialog/dialog.stories.tsx +0 -126
  198. package/src/components/organisms/drawer/drawer.doc.mdx +0 -59
  199. package/src/components/organisms/drawer/drawer.stories.tsx +0 -40
  200. package/src/components/organisms/dropfile/dropfile.doc.mdx +0 -74
  201. package/src/components/organisms/dropfile/dropfile.stories.tsx +0 -93
  202. package/src/components/organisms/form-builder/formBuilder.doc.mdx +0 -251
  203. package/src/components/organisms/form-builder/formBuilder.stories.tsx +0 -914
  204. package/src/components/organisms/navbar/navbar.doc.mdx +0 -77
  205. package/src/components/organisms/navbar/navbar.stories.tsx +0 -83
  206. package/src/components/organisms/page-header/page-header.doc.mdx +0 -54
  207. package/src/components/organisms/page-header/page-header.stories.tsx +0 -74
  208. package/src/components/organisms/searchTable/searchTable.doc.mdx +0 -79
  209. package/src/components/organisms/searchTable/searchTable.stories.tsx +0 -73
  210. package/src/components/organisms/sidebar/sidebar.doc.mdx +0 -176
  211. package/src/components/organisms/sidebar/sidebar.stories.tsx +0 -234
  212. package/src/components/organisms/toast/toast.doc.mdx +0 -50
  213. package/src/components/organisms/toast/toast.stories.tsx +0 -137
  214. package/src/components/organisms/topbar/topbar.doc.mdx +0 -72
  215. package/src/components/organisms/topbar/topbar.stories.tsx +0 -79
  216. package/src/components/organisms/triple-filter/tripleFilter.doc.mdx +0 -62
  217. package/src/components/organisms/triple-filter/tripleFilter.stories.tsx +0 -31
  218. package/src/components/templates/layout/layout.doc.mdx +0 -53
  219. package/src/components/templates/layout/layout.stories.tsx +0 -113
  220. package/src/components/templates/page/page.doc.mdx +0 -86
  221. package/src/components/templates/page/page.stories.tsx +0 -97
  222. package/src/components/theme-provider/themeProvider.doc.mdx +0 -85
  223. package/src/components/theme-provider/themeProvider.stories.tsx +0 -58
@@ -1,54 +0,0 @@
1
- import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
2
- import * as StoriesData from './card.stories';
3
-
4
- <Meta of={StoriesData} />
5
-
6
- # ITCard
7
-
8
- A versatile container component for grouping related content and actions. Supports an optional header image, title, body content, and a footer action area. Cards become interactive with hover shadow animation when an `onClick` handler is provided.
9
-
10
- ## Props
11
-
12
- | Prop | Type | Default | Description |
13
- |------|------|---------|-------------|
14
- | `onClick` | `() => void` | — | Click handler. When provided, the card becomes interactive with hover shadow effect. |
15
- | `title` | `string` | — | Card title displayed in the header area. |
16
- | `image` | `string` | — | Image source URL displayed at the top of the card. |
17
- | `alt` | `string` | `"Card Image"` | Alt text for the card image. |
18
- | `children` | `ReactNode` | — | Card body content, rendered below the title. |
19
- | `actions` | `ReactNode` | — | Action elements rendered in a footer section separated by a border. |
20
- | `className` | `string` | — | Additional CSS class names for the card container. |
21
- | `imageClassName` | `string` | — | Additional CSS class names for the image element. |
22
- | `titleClassName` | `string` | — | Additional CSS class names for the title element. |
23
- | `contentClassName` | `string` | — | Additional CSS class names for the content wrapper. |
24
- | `actionClassName` | `string` | — | Additional CSS class names for the actions footer. |
25
-
26
- ## Usage
27
-
28
- ```tsx
29
- import { ITCard } from '@axzydev/axzy_ui_system';
30
-
31
- <ITCard title="Bienvenido" image="/hero.jpg" actions={<ITButton label="Ver más" />}>
32
- Contenido de la tarjeta.
33
- </ITCard>
34
-
35
- <ITCard onClick={() => navigate("/details")} className="max-w-sm">
36
- Tarjeta interactiva con sombra al hover.
37
- </ITCard>
38
- ```
39
-
40
- ## Variants / Notes
41
-
42
- - **Default** — Clean container with theme-driven background, border, and border-radius via CSS custom properties.
43
- - **Interactive** — When `onClick` is provided, the card gains a subtle base shadow, a stronger shadow on hover, a pointer cursor, and smooth transition animation.
44
- - **With image** — The `image` prop renders a full-width image at the top with `object-cover` and a fixed height.
45
- - **With actions** — The `actions` prop renders a footer section with a top border, perfect for button groups.
46
- - Styling is driven by CSS custom properties (`--card-bg`, `--card-border`, `--card-radius`) for easy theming.
47
- - All style class names are customizable via the dedicated `*ClassName` props.
48
- - Card contents are wrapped with `ITText` for consistent typography.
49
-
50
- ## Stories
51
-
52
- <Primary />
53
- <Controls />
54
- <Stories />
@@ -1,57 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import ITCard from '@/components/molecules/card/card';
3
- import ITButton from '@/components/atoms/button/button';
4
-
5
- const meta = {
6
- title: 'Components/Layout & Navigation/ITCard',
7
- component: ITCard,
8
- parameters: {
9
- layout: 'centered',
10
- },
11
- argTypes: {
12
- onClick: { action: 'clicked' },
13
- },
14
- } satisfies Meta<typeof ITCard>;
15
-
16
- export default meta;
17
- type Story = StoryObj<typeof meta>;
18
-
19
- export const Default: Story = {
20
- args: {
21
- title: 'Card Title',
22
- children: 'This is the body of the card. It has padding defined by the theme.',
23
- onClick: undefined,
24
- },
25
- };
26
-
27
- export const WithImage: Story = {
28
- args: {
29
- title: 'Card with Image',
30
- image: 'https://images.unsplash.com/photo-1579546929518-9e396f3cc809?ixlib=rb-1.2.1&auto=format&fit=crop&w=1000&q=80',
31
- children: 'A nice gradient image above.',
32
- onClick: undefined,
33
- },
34
- };
35
-
36
- export const WithActions: Story = {
37
- args: {
38
- title: 'Card with Actions',
39
- children: 'This card has a button action at the bottom.',
40
- actions: (
41
- <div className="flex justify-end gap-2">
42
- <ITButton variant="text" color="secondary" label="Cancel" />
43
- <ITButton variant="filled" color="primary" label="Save" />
44
- </div>
45
- ),
46
- onClick: undefined,
47
- },
48
- };
49
-
50
- export const Clickable: Story = {
51
- args: {
52
- title: 'Clickable Card',
53
- children: 'Hover over me! I should have a stronger shadow and a pointer cursor.',
54
- onClick: () => alert('Card clicked!'),
55
- image: 'https://images.unsplash.com/photo-1557683316-973673baf926?ixlib=rb-1.2.1&auto=format&fit=crop&w=1000&q=80',
56
- },
57
- };
@@ -1,44 +0,0 @@
1
- import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
2
- import * as StoriesData from './chip-input.stories';
3
-
4
- <Meta of={StoriesData} />
5
-
6
- # ITChipInput
7
-
8
- Free-text input that turns entered values into removable tags (chips).
9
-
10
- ## Props
11
-
12
- | Prop | Type | Default | Description |
13
- |------|------|---------|-------------|
14
- | `value` | `string[]` | — | Current tags (controlled). |
15
- | `onChange` | `(values: string[]) => void` | — | Fired with the next list of tags. |
16
- | `label` | `string` | — | Label above the control. |
17
- | `placeholder` | `string` | `"Escribe y presiona Enter"` | Input placeholder. |
18
- | `delimiters` | `string[]` | `["Enter", ","]` | Keys that commit a tag. |
19
- | `maxTags` | `number` | — | Maximum number of tags. |
20
- | `allowDuplicates` | `boolean` | `false` | Allows repeated tags. |
21
- | `validate` | `(value) => string \| undefined` | — | Rejects a tag with a message. |
22
- | `color` | semantic color key | `"primary"` | Color of the tag chips. |
23
- | `size` | `"sm" \| "md" \| "lg"` | `"md"` | Control size. |
24
- | `disabled` / `required` / `touched` / `error` / `helpText` | — | — | Standard form states. |
25
-
26
- ## Usage
27
-
28
- ```tsx
29
- import { ITChipInput } from '@axzydev/axzy_ui_system';
30
-
31
- <ITChipInput label="Etiquetas" value={tags} onChange={setTags} />
32
- ```
33
-
34
- ## Notes
35
-
36
- - Commits tags on `Enter`, `,`, blur, or when pasting delimited text.
37
- - `Backspace` on an empty input removes the last tag.
38
- - Local errors (duplicate, max reached, `validate`) are shown inline.
39
-
40
- ## Stories
41
-
42
- <Primary />
43
- <Controls />
44
- <Stories />
@@ -1,52 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { useState } from "react";
3
- import ITChipInput from "@/components/molecules/chip-input/chip-input";
4
-
5
- const meta: Meta<typeof ITChipInput> = {
6
- title: "Components/Form Elements/ITChipInput",
7
- component: ITChipInput,
8
- parameters: { layout: "centered" },
9
- };
10
-
11
- export default meta;
12
- type Story = StoryObj<typeof ITChipInput>;
13
-
14
- const Wrapper = (args: any) => {
15
- const [value, setValue] = useState<string[]>(args.value ?? []);
16
- return (
17
- <div className="w-[420px]">
18
- <ITChipInput {...args} value={value} onChange={setValue} />
19
- </div>
20
- );
21
- };
22
-
23
- export const Default: Story = {
24
- render: (args) => <Wrapper {...args} />,
25
- args: { name: "tags", label: "Etiquetas", value: [] },
26
- };
27
-
28
- export const WithValues: Story = {
29
- render: (args) => <Wrapper {...args} />,
30
- args: { name: "tags", label: "Etiquetas", value: ["react", "typescript", "tailwind"] },
31
- };
32
-
33
- export const MaxTags: Story = {
34
- render: (args) => <Wrapper {...args} />,
35
- args: { name: "tags", label: "Máximo 3", value: ["uno", "dos"], maxTags: 3, helpText: "Máximo 3 etiquetas." },
36
- };
37
-
38
- export const WithValidation: Story = {
39
- render: (args) => <Wrapper {...args} />,
40
- args: {
41
- name: "emails",
42
- label: "Correos",
43
- value: [],
44
- placeholder: "correo@dominio.com",
45
- validate: (v: string) => (/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(v) ? undefined : "Correo inválido"),
46
- },
47
- };
48
-
49
- export const WithError: Story = {
50
- render: (args) => <Wrapper {...args} />,
51
- args: { name: "tags", label: "Etiquetas", value: [], required: true, touched: true, error: true },
52
- };
@@ -1,65 +0,0 @@
1
- import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
2
- import * as StoriesData from './date-picker.stories';
3
-
4
- <Meta of={StoriesData} />
5
-
6
- # ITDatePicker
7
-
8
- A date picker supporting single date and date range selection. Includes built-in validation error display, min/max date constraints, and placeholder formatting.
9
-
10
- ## Props
11
-
12
- | Prop | Type | Default | Description |
13
- |------|------|---------|-------------|
14
- | `name` | `string` | — | Unique name attribute for the input. |
15
- | `value` | `Date \| [Date \| null, Date \| null]` | — | Selected date or start–end tuple when `range` is true. |
16
- | `onChange` | `(event) => void` | — | Callback with `{ target: { name, value } }` on date selection. |
17
- | `onBlur` | `(event) => void` | — | Callback when the input loses focus. |
18
- | `range` | `boolean` | `false` | Enable date-range selection mode. |
19
- | `variant` | `ColorsTypes` | `"primary"` | Color variant from design system. |
20
- | `size` | `SizesTypes` | `"md"` | Size preset: `"sm"`, `"md"`, `"lg"`. |
21
- | `className` | `string` | — | CSS classes for the wrapper. |
22
- | `calendarClassName` | `string` | — | CSS classes for the calendar popover. |
23
- | `disabled` | `boolean` | `false` | Disables the date picker. |
24
- | `placeholder` | `string` | — | Placeholder text when no date is selected. |
25
- | `label` | `string` | — | Accessible label rendered above the input. |
26
- | `required` | `boolean` | — | Marks the field as required. |
27
- | `touched` | `boolean` | — | Visually indicates the field has been interacted with. |
28
- | `error` | `string \| boolean` | — | Error message string or `true` for default error styling. |
29
- | `minDate` | `Date` | — | Earliest selectable date. |
30
- | `maxDate` | `Date` | — | Latest selectable date. |
31
-
32
- ## Usage
33
-
34
- ```tsx
35
- import { ITDatePicker } from '@axzydev/axzy_ui_system';
36
-
37
- <ITDatePicker
38
- name="birthdate"
39
- label="Birth Date"
40
- placeholder="DD/MM/YYYY"
41
- value={date}
42
- onChange={(e) => setDate(e.target.value)}
43
- />
44
-
45
- <ITDatePicker
46
- range
47
- name="audit_range"
48
- label="Audit Range"
49
- value={range}
50
- onChange={(e) => setRange(e.target.value)}
51
- />
52
- ```
53
-
54
- ## Notes
55
-
56
- - When `range` is true, `value` must be a tuple `[startDate, endDate]` and the onChange target value will be the same shape.
57
- - The component emits a synthetic event with `target.name` and `target.value`, compatible with Formik integration.
58
- - Error state is shown when both `error` and `touched` are truthy.
59
- - Date format follows the locale configuration; placeholder text like `DD/MM/YYYY` guides the user.
60
-
61
- ## Stories
62
-
63
- <Primary />
64
- <Controls />
65
- <Stories />
@@ -1,88 +0,0 @@
1
- import type { Meta } from '@storybook/react';
2
- import ITDatePicker from './datePicker';
3
- import { useState } from 'react';
4
-
5
- const meta = {
6
- title: 'Components/Form Elements/ITDatePicker',
7
- component: ITDatePicker,
8
- parameters: {
9
- layout: 'padded',
10
- },
11
- argTypes: {
12
- value: { control: 'date' },
13
- minDate: { control: 'date' },
14
- maxDate: { control: 'date' },
15
- onChange: { action: 'changed' },
16
- onBlur: { action: 'blurred' },
17
- disabled: { control: 'boolean' },
18
- error: { control: 'text' },
19
- },
20
- } satisfies Meta<typeof ITDatePicker>;
21
-
22
- export default meta;
23
-
24
- // Wrapper for controlled component state
25
- const DatePickerWrapper = (args: any) => {
26
- const [date, setDate] = useState<Date>(args.value || new Date());
27
-
28
- const handleChange = (e: any) => {
29
- // Handle both event types the component might emit
30
- if (e.target && e.target.value) {
31
- setDate(e.target.value instanceof Date ? e.target.value : new Date(e.target.value));
32
- }
33
- args.onChange(e);
34
- };
35
-
36
- return <ITDatePicker {...args} value={date} onChange={handleChange} />;
37
- };
38
-
39
- export const Default: any = {
40
- render: (args) => <DatePickerWrapper {...args} />,
41
- args: {
42
- name: 'birthdate',
43
- label: 'Select Date',
44
- placeholder: 'DD/MM/YYYY',
45
- } as any,
46
- };
47
-
48
- export const WithError: any = {
49
- render: (args) => <DatePickerWrapper {...args} />,
50
- args: {
51
- name: 'error_date',
52
- label: 'Invalid Date',
53
- error: 'This field is required',
54
- touched: true,
55
- } as any,
56
- };
57
-
58
- export const Disabled: any = {
59
- args: {
60
- name: 'disabled_date',
61
- label: 'Disabled Input',
62
- value: new Date(),
63
- disabled: true,
64
- } as any,
65
- };
66
-
67
- // Wrapper for range state
68
- const RangePickerWrapper = (args: any) => {
69
- const [range, setRange] = useState<[Date | null, Date | null]>([null, null]);
70
-
71
- return (
72
- <ITDatePicker
73
- {...args}
74
- value={range}
75
- onChange={(e: any) => setRange(e.target.value)}
76
- />
77
- );
78
- };
79
-
80
- export const Range: any = {
81
- render: (args) => <RangePickerWrapper {...args} />,
82
- args: {
83
- range: true,
84
- name: 'audit_range',
85
- label: 'Select Date Range',
86
- placeholder: 'DD/MM/YYYY - DD/MM/YYYY',
87
- } as any,
88
- };
@@ -1,46 +0,0 @@
1
- import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
2
- import * as StoriesData from './dropdown-menu.stories';
3
-
4
- <Meta of={StoriesData} />
5
-
6
- # ITDropdownMenu
7
-
8
- Action menu with keyboard navigation and ARIA menu semantics. Rendered through a portal, so it is not clipped by cards or `overflow: hidden` ancestors.
9
-
10
- ## Props
11
-
12
- | Prop | Type | Default | Description |
13
- |------|------|---------|-------------|
14
- | `items` | `ITDropdownMenuItem[]` | — | Actions: `{ id, label, icon?, shortcut?, onClick?, disabled?, danger?, divider? }`. |
15
- | `trigger` | `ReactNode` | ellipsis icon | Custom trigger content. |
16
- | `triggerLabel` | `string` | `"Abrir menú"` | Accessible label for the trigger. |
17
- | `placement` | `"bottom-start" \| "bottom-end" \| "top-start" \| "top-end"` | `"bottom-end"` | Menu placement. |
18
- | `onSelect` | `(id, item) => void` | — | Fired after an item is activated. |
19
- | `disabled` | `boolean` | `false` | Disables the trigger. |
20
- | `className` | `string` | — | Extra CSS classes for the trigger. |
21
- | `menuClassName` | `string` | — | Extra CSS classes for the menu. |
22
-
23
- ## Usage
24
-
25
- ```tsx
26
- import { ITDropdownMenu } from '@axzydev/axzy_ui_system';
27
-
28
- <ITDropdownMenu
29
- items={[
30
- { id: "edit", label: "Editar", icon: <FaEdit />, onClick: edit },
31
- { id: "delete", label: "Eliminar", icon: <FaTrash />, danger: true, divider: true, onClick: remove },
32
- ]}
33
- />
34
- ```
35
-
36
- ## Notes
37
-
38
- - Keyboard: `ArrowUp`/`ArrowDown` navigate, `Enter`/`Space` activate, `Esc` closes, `Home`/`End` jump.
39
- - Uses `role="menu"` / `role="menuitem"` and `aria-haspopup` / `aria-expanded` on the trigger.
40
- - The panel flips above the trigger automatically when there is no room below.
41
-
42
- ## Stories
43
-
44
- <Primary />
45
- <Controls />
46
- <Stories />
@@ -1,41 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { FaEdit, FaCopy, FaTrash, FaDownload } from "react-icons/fa";
3
- import ITDropdownMenu from "@/components/molecules/dropdown-menu/dropdown-menu";
4
- import ITButton from "@/components/atoms/button/button";
5
-
6
- const meta: Meta<typeof ITDropdownMenu> = {
7
- title: "Components/Navigation/ITDropdownMenu",
8
- component: ITDropdownMenu,
9
- parameters: { layout: "centered" },
10
- };
11
-
12
- export default meta;
13
- type Story = StoryObj<typeof ITDropdownMenu>;
14
-
15
- const items = [
16
- { id: "edit", label: "Editar", icon: <FaEdit />, onClick: () => alert("Editar") },
17
- { id: "copy", label: "Duplicar", icon: <FaCopy />, shortcut: "⌘D", onClick: () => alert("Duplicar") },
18
- { id: "download", label: "Descargar", icon: <FaDownload />, disabled: true },
19
- { id: "delete", label: "Eliminar", icon: <FaTrash />, danger: true, divider: true, onClick: () => alert("Eliminar") },
20
- ];
21
-
22
- export const Default: Story = {
23
- args: { items },
24
- };
25
-
26
- export const CustomTrigger: Story = {
27
- args: {
28
- items,
29
- trigger: <span className="text-sm font-semibold px-1">Acciones</span>,
30
- triggerLabel: "Acciones",
31
- },
32
- };
33
-
34
- export const WithLabelButton: Story = {
35
- render: () => (
36
- <div className="flex items-center gap-4">
37
- <ITButton label="Guardar" variant="filled" color="primary" size="sm" />
38
- <ITDropdownMenu items={items} />
39
- </div>
40
- ),
41
- };
@@ -1,50 +0,0 @@
1
- import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
2
- import * as StoriesData from './empty-state.stories';
3
-
4
- <Meta of={StoriesData} />
5
-
6
- # ITEmptyState
7
-
8
- A placeholder component for displaying a message when no data is available. Configurable icon, title, description, and an action slot for contextual buttons.
9
-
10
- ## Props
11
-
12
- | Prop | Type | Default | Description |
13
- |------|------|---------|-------------|
14
- | `icon` | `ReactNode` | `<FaInbox size={40} />` | Icon or illustration displayed above the title. |
15
- | `title` | `string` | — | Primary heading text (required). |
16
- | `description` | `string` | — | Secondary explanatory text. |
17
- | `action` | `ReactNode` | — | Action element (typically a button) rendered below the description. |
18
- | `className` | `string` | — | Additional CSS classes for the wrapper. |
19
-
20
- ## Usage
21
-
22
- ```tsx
23
- import { ITEmptyState } from '@axzydev/axzy_ui_system';
24
-
25
- <ITEmptyState
26
- title="No results"
27
- description="No data found for the selected filters."
28
- action={<ITButton label="Clear filters" variant="outlined" size="sm" />}
29
- />
30
-
31
- <ITEmptyState
32
- icon={<FaDatabase size={48} />}
33
- title="No records"
34
- description="Create your first record to get started."
35
- action={<ITButton label="Create Record" variant="primary" />}
36
- />
37
- ```
38
-
39
- ## Notes
40
-
41
- - Default icon is `FaInbox` from react-icons — override with any ReactNode for custom illustrations.
42
- - The `action` slot accepts any ReactNode, most commonly an `ITButton` for navigation or reset actions.
43
- - Centers all content vertically and horizontally within its container.
44
- - Works well as a fallback inside tables, cards, and search result containers.
45
-
46
- ## Stories
47
-
48
- <Primary />
49
- <Controls />
50
- <Stories />
@@ -1,19 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import ITEmptyState from "@/components/molecules/empty-state/empty-state";
3
- import ITButton from "@/components/atoms/button/button";
4
-
5
- const meta: Meta<typeof ITEmptyState> = {
6
- title: "Components/Data Display/ITEmptyState",
7
- component: ITEmptyState,
8
- };
9
-
10
- export default meta;
11
- type Story = StoryObj<typeof ITEmptyState>;
12
-
13
- export const Default: Story = {
14
- args: {
15
- title: "Sin resultados",
16
- description: "No se encontraron datos para los filtros seleccionados.",
17
- action: <ITButton label="Limpiar filtros" variant="outlined" size="sm" />,
18
- },
19
- };
@@ -1,43 +0,0 @@
1
- import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
2
- import * as StoriesData from './field.stories';
3
-
4
- <Meta of={StoriesData} />
5
-
6
- # ITField
7
-
8
- Form-field wrapper that standardizes label, required marker, helper text, and error message around any control.
9
-
10
- ## Props
11
-
12
- | Prop | Type | Default | Description |
13
- |------|------|---------|-------------|
14
- | `label` | `string` | — | Label above the control. |
15
- | `htmlFor` | `string` | — | `id` the label points to. |
16
- | `required` | `boolean` | `false` | Shows a red asterisk. |
17
- | `error` | `string \| boolean` | — | Error message, or `true` for the generic message. |
18
- | `helpText` | `string` | — | Helper text shown when there is no error. |
19
- | `children` | `ReactNode` | — | The form control. |
20
- | `className` | `string` | — | Extra CSS classes for the wrapper. |
21
- | `labelClassName` | `string` | — | Extra CSS classes for the label. |
22
- | `contentClassName` | `string` | — | Extra CSS classes for the control container. |
23
-
24
- ## Usage
25
-
26
- ```tsx
27
- import { ITField, ITInput } from '@axzydev/axzy_ui_system';
28
-
29
- <ITField label="Email" htmlFor="email" required error={errors.email} helpText="We never share it.">
30
- <ITInput name="email" value={email} onChange={onChange} />
31
- </ITField>
32
- ```
33
-
34
- ## Notes
35
-
36
- - Error text takes precedence over `helpText`; only one is shown at a time.
37
- - `error={true}` renders the generic "Este campo es requerido" message.
38
-
39
- ## Stories
40
-
41
- <Primary />
42
- <Controls />
43
- <Stories />
@@ -1,42 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import ITField from "@/components/molecules/field/field";
3
- import ITInput from "@/components/atoms/input/input";
4
-
5
- const meta: Meta<typeof ITField> = {
6
- title: "Components/Form Elements/ITField",
7
- component: ITField,
8
- parameters: { layout: "centered" },
9
- };
10
-
11
- export default meta;
12
- type Story = StoryObj<typeof ITField>;
13
-
14
- export const Default: Story = {
15
- render: () => (
16
- <div className="w-[360px]">
17
- <ITField label="Nombre completo" htmlFor="name" required helpText="Como aparece en tu identificación.">
18
- <ITInput name="name" value="" onChange={() => {}} onBlur={() => {}} />
19
- </ITField>
20
- </div>
21
- ),
22
- };
23
-
24
- export const WithError: Story = {
25
- render: () => (
26
- <div className="w-[360px]">
27
- <ITField label="Correo" htmlFor="email" required error="Ingresa un correo válido.">
28
- <ITInput name="email" value="correo-malo" onChange={() => {}} onBlur={() => {}} />
29
- </ITField>
30
- </div>
31
- ),
32
- };
33
-
34
- export const GenericError: Story = {
35
- render: () => (
36
- <div className="w-[360px]">
37
- <ITField label="RFC" htmlFor="rfc" required error>
38
- <ITInput name="rfc" value="" onChange={() => {}} onBlur={() => {}} />
39
- </ITField>
40
- </div>
41
- ),
42
- };
@@ -1,38 +0,0 @@
1
- import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
2
- import * as StoriesData from './form-header.stories';
3
-
4
- <Meta of={StoriesData} />
5
-
6
- # ITFormHeader
7
-
8
- A colored header bar for modal dialogs and form containers. Displays a title centered on a primary-colored background, with an optional close (X) button on the right side.
9
-
10
- ## Props
11
-
12
- | Prop | Type | Default | Description |
13
- |------|------|---------|-------------|
14
- | `title` | `string` | required | Header title text, centered in the bar. |
15
- | `onClose` | `() => void` | `undefined` | Optional close button handler. When provided, an X button renders. |
16
- | `className` | `string` | `undefined` | Additional CSS classes applied to the container. |
17
-
18
- ## Usage
19
-
20
- ```tsx
21
- import { ITFormHeader } from '@axzydev/axzy_ui_system';
22
-
23
- <ITFormHeader title="Edit Record" />
24
- <ITFormHeader title="Confirm" onClose={() => handleClose()} />
25
- ```
26
-
27
- ## Notes
28
-
29
- - Uses the theme primary color as the background.
30
- - The title truncates with ellipsis when it overflows the available width.
31
- - Close button is only rendered when `onClose` is provided.
32
- - Intended for use inside modals, drawers, or form panels.
33
-
34
- ## Stories
35
-
36
- <Primary />
37
- <Controls />
38
- <Stories />