@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,130 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import ITTimePicker from "./timePicker";
3
- import { useState } from "react";
4
-
5
- const meta: Meta<typeof ITTimePicker> = {
6
- title: "Components/Form Elements/ITTimePicker",
7
- component: ITTimePicker,
8
- parameters: {
9
- layout: "centered",
10
- },
11
- argTypes: {
12
- color: {
13
- control: "select",
14
- options: ["primary", "secondary", "success", "danger", "warning", "info", "purple"],
15
- },
16
- size: {
17
- control: "select",
18
- options: ["small", "medium", "large"],
19
- },
20
- variant: {
21
- control: "select",
22
- options: ["primary", "secondary"],
23
- },
24
- disabled: {
25
- control: "boolean",
26
- },
27
- required: {
28
- control: "boolean",
29
- },
30
- error: {
31
- control: "text",
32
- },
33
- },
34
- decorators: [
35
- (Story) => (
36
- <div className="w-[300px]">
37
- <Story />
38
- </div>
39
- ),
40
- ],
41
- };
42
-
43
- export default meta;
44
- type Story = StoryObj<typeof ITTimePicker>;
45
-
46
- // Helper to wrap uncontrolled behavior
47
- const TimePickerWrapper = (args: any) => {
48
- const [value, setValue] = useState(args.value || "");
49
- const [touched, setTouched] = useState(false);
50
-
51
- return (
52
- <ITTimePicker
53
- {...args}
54
- value={value}
55
- touched={touched}
56
- onChange={(e) => {
57
- setValue(e.target.value);
58
- if (args.onChange) args.onChange(e);
59
- }}
60
- onBlur={(e) => {
61
- setTouched(true);
62
- if (args.onBlur) args.onBlur(e);
63
- }}
64
- />
65
- );
66
- };
67
-
68
- export const Default: Story = {
69
- render: (args) => <TimePickerWrapper {...args} />,
70
- args: {
71
- name: "default_time",
72
- label: "Select Time",
73
- placeholder: "HH:MM",
74
- color: "primary",
75
- },
76
- };
77
-
78
- export const WithPredefinedValue: Story = {
79
- render: (args) => <TimePickerWrapper {...args} />,
80
- args: {
81
- name: "predefined_time",
82
- label: "Meeting Time",
83
- value: "14:30",
84
- color: "success",
85
- },
86
- };
87
-
88
- export const Disabled: Story = {
89
- render: (args) => <TimePickerWrapper {...args} />,
90
- args: {
91
- name: "disabled_time",
92
- label: "Unavailable Time",
93
- value: "09:00",
94
- disabled: true,
95
- },
96
- };
97
-
98
- export const Validation: Story = {
99
- render: (args) => <TimePickerWrapper {...args} />,
100
- args: {
101
- name: "validation_time",
102
- label: "End Time",
103
- value: "25:99", // Invalid time string to trigger intrinsic validation
104
- touched: true, // Force validation display
105
- error: "Custom error message if passed explicitly",
106
- },
107
- };
108
-
109
- export const Sizes: Story = {
110
- render: (args) => (
111
- <div className="flex flex-col gap-6">
112
- <TimePickerWrapper {...args} size="sm" label="Small TimePicker" name="sm" />
113
- <TimePickerWrapper {...args} size="md" label="Medium TimePicker" name="md" />
114
- <TimePickerWrapper {...args} size="lg" label="Large TimePicker" name="lg" />
115
- </div>
116
- ),
117
- args: {
118
- value: "10:15",
119
- },
120
- };
121
-
122
- export const Colors: Story = {
123
- render: (args) => (
124
- <div className="flex flex-col gap-6">
125
- <TimePickerWrapper {...args} color="primary" label="Primary Theme Highlight" name="c1" value="12:00" />
126
- <TimePickerWrapper {...args} color="danger" label="Danger Theme Highlight" name="c2" value="13:15" />
127
- <TimePickerWrapper {...args} color="purple" label="Purple Theme Highlight" name="c3" value="14:45" />
128
- </div>
129
- ),
130
- };
@@ -1,95 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { useState } from 'react';
3
- import ITWysiwyg from '@/components/molecules/wysiwyg/wysiwyg';
4
-
5
- const meta = {
6
- title: 'Components/Form/ITWysiwyg',
7
- component: ITWysiwyg,
8
- parameters: {
9
- layout: 'centered',
10
- },
11
- argTypes: {
12
- size: {
13
- control: 'select',
14
- options: ['sm', 'md', 'lg'],
15
- },
16
- toolbar: {
17
- control: 'select',
18
- options: [
19
- ['bold', 'italic', 'underline', 'highlight', 'ul', 'ol', 'clear'],
20
- ['bold', 'italic', 'underline'],
21
- ['ul', 'ol'],
22
- ],
23
- },
24
- },
25
- } satisfies Meta<typeof ITWysiwyg>;
26
-
27
- export default meta;
28
- type Story = StoryObj<typeof meta>;
29
-
30
- export const Default: Story = {
31
- args: {
32
- placeholder: 'Escribe algo...',
33
- minHeight: 140,
34
- },
35
- };
36
-
37
- export const WithLabel: Story = {
38
- args: {
39
- label: 'Descripción',
40
- placeholder: 'Texto libre...',
41
- },
42
- };
43
-
44
- export const WithValue: Story = {
45
- args: {
46
- value: '<div>Texto con <strong>negrita</strong>, <em>itálica</em> y <u>subrayado</u>.</div><div><mark style="background-color:#fde68a">Con marcador</mark> y:</div><ul><li>Elemento uno</li><li>Elemento dos</li></ul>',
47
- },
48
- };
49
-
50
- export const Disabled: Story = {
51
- args: {
52
- disabled: true,
53
- value: '<div>Contenido bloqueado para edición.</div>',
54
- },
55
- };
56
-
57
- export const ReadOnly: Story = {
58
- args: {
59
- readOnly: true,
60
- label: 'Vista previa',
61
- value: '<div>Solo lectura, sin toolbar activo.</div>',
62
- },
63
- };
64
-
65
- export const WithError: Story = {
66
- args: {
67
- label: 'Descripción',
68
- error: 'Este campo es obligatorio.',
69
- value: '',
70
- },
71
- };
72
-
73
- export const CustomHighlight: Story = {
74
- args: {
75
- highlightColor: '#a7f3d0',
76
- label: 'Marcador verde',
77
- },
78
- };
79
-
80
- export const LiveValue: Story = {
81
- render: (args) => {
82
- const [html, setHtml] = useState<string>(
83
- '<div>Edita aquí y mira el HTML generado abajo.</div>'
84
- );
85
- return (
86
- <div className="w-96 space-y-4">
87
- <ITWysiwyg {...args} value={html} onChange={setHtml} />
88
- <pre className="max-h-40 overflow-auto rounded-lg bg-slate-950 p-3 text-[10px] text-emerald-300">
89
- <code>{html}</code>
90
- </pre>
91
- </div>
92
- );
93
- },
94
- args: {},
95
- };
@@ -1,60 +0,0 @@
1
- import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
2
- import * as StoriesData from './confirm-dialog.stories';
3
-
4
- <Meta of={StoriesData} />
5
-
6
- # ITConfirmDialog
7
-
8
- Confirmation modal dialog for destructive or critical actions. Renders a centered overlay with a warning icon, title, message body, and confirm/cancel buttons. Supports loading state and configurable button colors.
9
-
10
- ## Props
11
-
12
- | Prop | Type | Default | Description |
13
- |------|------|---------|-------------|
14
- | `isOpen` | `boolean` | — | Controls whether the confirmation dialog is visible. |
15
- | `onClose` | `() => void` | — | Callback fired when the user cancels or closes the dialog (overlay click or cancel button). |
16
- | `onConfirm` | `() => void` | — | Callback fired when the user confirms the action. |
17
- | `title` | `string` | `"Confirmar acción"` | Heading text displayed at the top of the dialog. |
18
- | `message` | `ReactNode` | `"¿Estás seguro de que deseas continuar?"` | Body content — accepts plain strings or React nodes. |
19
- | `confirmLabel` | `string` | `"Confirmar"` | Label for the confirm button. |
20
- | `cancelLabel` | `string` | `"Cancelar"` | Label for the cancel button. |
21
- | `variant` | `ColorsTypes` | `"primary"` | Color variant applied to the confirm button. Accepts `primary`, `danger`, `warning`, `info`, etc. |
22
- | `loading` | `boolean` | `false` | Disables all buttons and signals a loading state. |
23
-
24
- ## Usage
25
-
26
- ```tsx
27
- import { ITConfirmDialog } from '@axzydev/axzy_ui_system';
28
- import { useState } from 'react';
29
-
30
- const [open, setOpen] = useState(false);
31
-
32
- <ITButton label="Eliminar" color="danger" onClick={() => setOpen(true)} />
33
-
34
- <ITConfirmDialog
35
- isOpen={open}
36
- onClose={() => setOpen(false)}
37
- onConfirm={() => { handleDelete(); setOpen(false); }}
38
- title="Eliminar usuario"
39
- message="Esta acción no se puede deshacer. ¿Deseas eliminar este usuario?"
40
- confirmLabel="Eliminar"
41
- variant="danger"
42
- loading={isDeleting}
43
- />
44
- ```
45
-
46
- ## Notes
47
-
48
- - The dialog renders `null` when `isOpen` is `false`, so it does not remain in the DOM.
49
- - A semi-transparent **backdrop** (`bg-black/40 backdrop-blur-sm`) covers the screen; clicking it triggers `onClose`.
50
- - The dialog card has rounded corners (`rounded-2xl`), a light border, and a subtle shadow.
51
- - A warning icon (`FaExclamationTriangle` in amber) is always displayed alongside the title and message.
52
- - **variant** controls the confirm button color via the `color` prop on `ITButton`; the cancel button always uses the `outlined` variant.
53
- - **loading** disables both buttons to prevent double-submission during async operations.
54
- - By default, spans and text use dark mode–aware colors (`dark:text-white`, `dark:text-slate-400`).
55
-
56
- ## Stories
57
-
58
- <Primary />
59
- <Controls />
60
- <Stories />
@@ -1,32 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { useState } from "react";
3
- import ITConfirmDialog from "@/components/organisms/confirm-dialog/confirm-dialog";
4
- import ITButton from "@/components/atoms/button/button";
5
-
6
- const meta: Meta<typeof ITConfirmDialog> = {
7
- title: "Components/Overlay/ITConfirmDialog",
8
- component: ITConfirmDialog,
9
- };
10
-
11
- export default meta;
12
- type Story = StoryObj<typeof ITConfirmDialog>;
13
-
14
- export const Default: Story = {
15
- render: () => {
16
- const [open, setOpen] = useState(false);
17
- return (
18
- <>
19
- <ITButton label="Eliminar" color="danger" onClick={() => setOpen(true)} />
20
- <ITConfirmDialog
21
- isOpen={open}
22
- onClose={() => setOpen(false)}
23
- onConfirm={() => { alert("Confirmado"); setOpen(false); }}
24
- title="Eliminar usuario"
25
- message="Esta acción no se puede deshacer. ¿Deseas eliminar este usuario?"
26
- confirmLabel="Eliminar"
27
- variant="danger"
28
- />
29
- </>
30
- );
31
- },
32
- };
@@ -1,115 +0,0 @@
1
- import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
2
- import * as StoriesData from './ITDataTable.stories';
3
-
4
- <Meta of={StoriesData} />
5
-
6
- # ITDataTable
7
-
8
- Advanced server-side data table with automatic pagination, column sorting, and filtering. Communicates via a `fetchData` callback that receives page, limit, filters, and sort parameters, and returns paginated data with a total count. Built on top of the internal table hooks for cohesive state management.
9
-
10
- ## Props
11
-
12
- | Prop | Type | Default | Description |
13
- |------|------|---------|-------------|
14
- | `columns` | `Column<T>[]` | — | Column definitions with key, label, type, sortable, filter, render, plus layout fields: `width` (`number` px or CSS `string`), `minWidth` (px), `align` (`"left" \| "center" \| "right"`), `truncate` (ellipsis + native `title`), and `pinned` (`"left" \| "right"`). |
15
- | `fetchData` | `(params: ITDataTableFetchParams) => Promise<ITDataTableResponse<T>>` | — | Async callback triggered on pagination, filter, or sort change. Must return `{ data, total }`. |
16
- | `debounceMs` | `number` | `500` | Delay in ms before firing fetch after filter state changes. |
17
- | `externalFilters` | `ColumnFilters` | `{}` | Filters managed outside the table (e.g., date pickers) merged with internal column filters. Values may be scalars, a `Date`, or a `[start, end]` tuple. |
18
- | `loadingIndicator` | `ReactNode` | `<FaSpinner />` | Custom element shown while loading. |
19
- | `fetchOnMount` | `boolean` | `true` | Whether to fetch data on initial mount. |
20
- | `reloadTrigger` | `number \| string \| boolean` | — | Changing this value forces a re-fetch. Use after mutations. |
21
- | `containerClassName` | `string` | — | CSS classes for the outer wrapper. |
22
- | `className` | `string` | — | CSS classes applied to the `<table>` element. |
23
- | `variant` | `"default" \| "striped" \| "bordered" \| "minimal"` | `"default"` | Visual style variant. `"minimal"` is accepted by the type but has no styles (renders like `"default"`). |
24
- | `size` | `"sm" \| "md" \| "lg"` | `"md"` | Font-size preset (does not change padding; use `density` for that). |
25
- | `itemsPerPageOptions` | `number[]` | `[5, 10, 20]` | Selectable page-size options. |
26
- | `defaultItemsPerPage` | `number` | `10` | Initial rows per page. |
27
- | `title` | `string \| ReactNode` | — | Heading displayed above the table. |
28
- | `renderCard` | `(row: T) => ReactNode` | — | Custom card renderer for the cards view. |
29
- | `defaultView` | `"table" \| "cards"` | `"table"` | Initial view mode. |
30
- | `showVerticalBorder` | `boolean` | `true` | Show vertical borders between columns. |
31
- | `verticalBorderClassname` | `string` | — | Custom class for the vertical borders. |
32
- | `onRowClick` | `(row: T, event: MouseEvent<HTMLElement> \| KeyboardEvent<HTMLElement>) => void` | — | Row/card activation. `MouseEvent` for pointer, `KeyboardEvent` for Enter/Space. Skipped when the interaction starts inside an interactive child. |
33
- | `layout` | `"auto" \| "fixed"` | `"auto"` | Table layout algorithm. `"fixed"` honors column `width` values and drops the `min-w-max` / `min-w-[150px]` floors so content no longer forces horizontal scrolling. |
34
- | `density` | `"compact" \| "normal" \| "comfortable"` | `"normal"` | Cell padding / row-height preset. Independent of `size`, which only controls font-size. |
35
- | `autoCardBreakpoint` | `number` | `0` | Container width (px) below which the table automatically falls back to the cards view. `0` disables the fallback. |
36
- | `virtualized` | `boolean` | `false` | Renders only the visible row window with spacer rows preserving scroll height. Table view only; cards view is never virtualized. |
37
- | `virtualizedMaxHeight` | `number` | `400` | Max height (px) of the virtualized scroll container. Only used when `virtualized` is true. |
38
- | `rowHeight` | `number` | `getRowHeight(size, density)` | Assumed uniform row height (px). Size-aware: `size="md"` baseline is 33 / 45 / 53 for compact / normal / comfortable; `size` shifts it by the font-size line box (sm 16px / md 20px / lg 28px). |
39
- | `overscan` | `number` | `5` | Extra rows rendered above and below the viewport to avoid blank gaps. |
40
- | `stickyHeader` | `boolean` | `false` | Keeps header cells sticky while the virtualized body scrolls. Only effective when `virtualized` is true. |
41
-
42
- ## Usage
43
-
44
- ```tsx
45
- import { ITDataTable } from '@axzydev/axzy_ui_system';
46
-
47
- <ITDataTable
48
- title="Users"
49
- columns={[
50
- { key: 'id', label: 'ID', type: 'number', sortable: true },
51
- { key: 'name', label: 'Name', type: 'string', sortable: true, filter: true },
52
- { key: 'role', label: 'Role', type: 'string', filter: 'catalog', catalogOptions: { data: roles } },
53
- { key: 'active', label: 'Status', type: 'boolean', filter: true, sortable: true },
54
- ]}
55
- fetchData={async (params) => api.fetchItems(params)}
56
- variant="bordered"
57
- />
58
-
59
- // Search + date filters (values arrive in params.filters)
60
- <ITDataTable
61
- columns={[
62
- { key: 'role', label: 'Role', type: 'string', filter: 'search', catalogOptions: { data: roles, onSearch: (q) => api.searchRoles(q) } },
63
- { key: 'hiredAt', label: 'Hired', type: 'date', filter: 'date-range', dateFilterOptions: { maxDate: new Date() } },
64
- ]}
65
- fetchData={async (params) => api.fetchItems(params)}
66
- />
67
-
68
- // No horizontal scroll: fixed layout + per-column widths + truncation
69
- <ITDataTable
70
- columns={[
71
- { key: 'name', label: 'Name', type: 'string', width: '30%', truncate: true },
72
- { key: 'email', label: 'Email', type: 'string', width: 220, truncate: true },
73
- { key: 'role', label: 'Role', type: 'string', width: 140, align: 'center' },
74
- ]}
75
- fetchData={async (params) => api.fetchItems(params)}
76
- layout="fixed"
77
- density="compact"
78
- />
79
-
80
- // Pinned columns: freeze ID left and the last column right during horizontal scroll
81
- <ITDataTable
82
- columns={[
83
- { key: 'id', label: 'ID', type: 'number', width: 72, pinned: 'left' },
84
- { key: 'name', label: 'Name', type: 'string', width: 240, truncate: true },
85
- { key: 'active', label: 'Active', type: 'boolean', width: 120, pinned: 'right' },
86
- ]}
87
- fetchData={async (params) => api.fetchItems(params)}
88
- layout="fixed"
89
- density="compact"
90
- />
91
- ```
92
-
93
- ## Notes
94
-
95
- - Column filters support `true` (text/number input, or boolean tri-state toggle for `type: "boolean"`), `"catalog"` (`ITSelect`), `"search"` (`ITSearchSelect` typeahead; add `catalogOptions.onSearch` for server-side search), and `"date"` / `"date-range"` (`ITDatePicker`, bounded by `dateFilterOptions`). In `fetchData(params)`, `params.filters[key]` is a `Date` for `"date"`, a `[start, end]` tuple for `"date-range"`, and the scalar/id otherwise.
96
- - The `externalFilters` prop allows integrating external filter controls like date pickers without building filter UI into the table itself.
97
- - Debounce prevents excessive API calls while the user types in filter inputs.
98
- - A loading skeleton overlay covers the table body while fetching, keeping the header visible.
99
- - Empty state is shown automatically when no results match the current filters.
100
- - `onRowClick` fires in **both** the table and cards views. The event is a `MouseEvent` for pointer interaction and a `KeyboardEvent` for Enter/Space activation. It is not fired while `isLoading`, and interactions that start inside an interactive child (button, link, input, or `[data-row-click-ignore]`) are ignored.
101
- - `density` controls padding/row height (`compact` 33px / `normal` 45px / `comfortable` 53px at `size="md"`); `size` changes font-size and shifts the row height by the line box (sm 16px / md 20px / lg 28px).
102
- - **Anti horizontal scroll recipe:** `layout="fixed"` + a `width` on every column + `truncate` on long text + `density="compact"`. `width` accepts a `number` (px) or any CSS length string (`"20%"`, `"12rem"`). A `<colgroup>` is only emitted when at least one column defines a `width`.
103
- - **Pinned columns:** set `columns[].pinned: "left" | "right"` to freeze a column to that edge during horizontal scroll (`position: sticky`; the wrapper needs no `relative`). Omitting `pinned` renders exactly as before. Sticky offsets accumulate from each preceding pinned column's pixel `width` / `minWidth`; a non-px width contributes `minWidth ?? 0`, so give every pinned column of a side a pixel `width`. The pinned cell gets an opaque background (`--color-table-rowBg`, row hover `--color-table-rowHover`) and a 1px separator shadow on its frozen edge. Z-layering: pinned body cell `z-[1]` < sticky header `z-10` < pinned header `z-[15]` < the loading overlay `z-20`; it composes with `stickyHeader` and `virtualized`. One pinned column per side is the supported contract. Known limitation: with `variant="striped"` the opaque pinned background covers that column's stripe tint.
104
- - With the default `layout="auto"`, `min-w-max` stays active so column widths can still reflow as different cell content enters the window during vertical scroll. Use `layout="fixed"` + column `width` for stable widths.
105
- - `autoCardBreakpoint` swaps to the cards view when the container (not the viewport) is narrower than the given px value; the Table toggle is disabled while forced, the Cards toggle stays enabled.
106
- - **Virtualization** applies to the **table view only** — the cards view is never virtualized. It only pays off with a large page size: raise `defaultItemsPerPage` and `itemsPerPageOptions` (defaults are `10` and `[5, 10, 20]`). Rows are assumed to have a uniform `rowHeight`; use `truncate` + `layout="fixed"` for predictable heights.
107
- - Scroll resets to the top on page or items-per-page change, but **not** on filter change (known limitation). `aria-rowcount` reflects the current page (+1), not the whole dataset, because pagination is independent.
108
- - `virtualizedMaxHeight`, `rowHeight`, `overscan`, and `stickyHeader` only take effect when `virtualized` is true. `stickyHeader` makes each `<th>` sticky using the `--color-table-headerBg` token (fallback `#f8fafc`).
109
- - `TableDensity` is exported from the package. `ITSearchTable` does **not** support `layout`, `density`, `autoCardBreakpoint`, `virtualized`, or per-column `width` — do not assume parity.
110
-
111
- ## Stories
112
-
113
- <Primary />
114
- <Controls />
115
- <Stories />