@axzydev/axzy_ui_system 1.4.8 → 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 (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 +77 -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 +1929 -0
  82. package/src/sandbox/icons.tsx +25 -0
  83. package/src/sandbox/locale.tsx +72 -0
  84. package/src/sandbox/ui.tsx +377 -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 +302 -214
  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 +270 -216
  97. package/src/showcases/SizesShowcase.tsx +123 -64
  98. package/src/showcases/StructureShowcases.tsx +157 -131
  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,53 +0,0 @@
1
- import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
2
- import * as StoriesData from './layout.stories';
3
-
4
- <Meta of={StoriesData} />
5
-
6
- # ITLayout
7
-
8
- The application shell layout component that combines a topbar, sidebar, and main content area into a full-page interface. The sidebar supports collapse/expand via hover, and all visual styles are driven by ITThemeProvider CSS variables.
9
-
10
- ## Props
11
-
12
- | Prop | Type | Default | Description |
13
- |------|------|---------|-------------|
14
- | `topBar` | `ITTopBarProps` | required | Top bar configuration including logo, nav items, and user menu. |
15
- | `sidebar` | `ITSidebarProps` | required | Sidebar configuration including navigation items. |
16
- | `children` | `ReactNode` | required | Main content rendered in the center area. |
17
- | `className` | `string` | `undefined` | Additional CSS classes for the outermost wrapper. |
18
- | `contentClassName` | `string` | `undefined` | Additional CSS classes for the content container. |
19
-
20
- ## Usage
21
-
22
- ```tsx
23
- import { ITLayout } from '@axzydev/axzy_ui_system';
24
-
25
- <ITLayout
26
- topBar={{
27
- logoText: 'AXZY',
28
- userMenu: { userName: 'Jane', userEmail: 'jane@axzy.io', menuItems: [...] },
29
- navItems: [...]
30
- }}
31
- sidebar={{
32
- navigationItems: [...]
33
- }}
34
- >
35
- <div>Your page content here</div>
36
- </ITLayout>
37
- ```
38
-
39
- ## Notes
40
-
41
- - The topbar spans the full viewport width at the top of the page.
42
- - The sidebar sits under the topbar on the left and floats over content when expanded via hover.
43
- - Reserved desktop width follows `sidebar.isCollapsed`: omitted/uncontrolled or `true` reserves the 88px rail (hover expands over content); controlled-expanded (`sidebar.isCollapsed={false}`) reserves the full 280px so it never overlays content.
44
- - Sidebar in collapsed state shows only icons; expanding reveals labels.
45
- - The collapsed rail expands automatically on hover. Keep global search in `topBar.centerContent` (always visible, `lg` and up) rather than `sidebar.header`, which is expanded-only and disappears in the 88px rail.
46
- - Themed entirely through CSS custom properties from ITThemeProvider.
47
- - Includes mobile responsive behavior with a hamburger-style toggle.
48
-
49
- ## Stories
50
-
51
- <Primary />
52
- <Controls />
53
- <Stories />
@@ -1,113 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import ITLayout from '@/components/templates/layout/layout';
3
- import { FaHome, FaUsers, FaChartBar, FaCog, FaShieldAlt } from 'react-icons/fa';
4
-
5
- const meta: Meta<typeof ITLayout> = {
6
- title: 'Components/Layout & Navigation/ITLayout',
7
- component: ITLayout,
8
- parameters: {
9
- layout: 'fullscreen', // Ver en fullscreen por defecto
10
- docs: {
11
- story: {
12
- inline: false, // Forzar iframe para ver responsividad
13
- iframeHeight: 700,
14
- },
15
- description: {
16
- component: 'El contenedor principal ("Shell") de la interfaz. El Topbar abarca el ancho completo en la parte superior. El Sidebar está debajo del Topbar a la izquierda, y flota sobre el contenido cuando se expande (por hover) para no desplazar el diseño principal.',
17
- },
18
- },
19
- },
20
- };
21
-
22
- export default meta;
23
- type Story = StoryObj<typeof ITLayout>;
24
-
25
- const mockUserMenu = {
26
- userName: 'Alejandro G.',
27
- userEmail: 'alejandro@axzy.io',
28
- userImage: 'https://i.pravatar.cc/150?u=a042581f4e29026024d',
29
- menuItems: [
30
- { label: 'Mi Perfil', onClick: () => console.log('Perfil clicked') },
31
- { label: 'Cerrar Sesión', onClick: () => console.log('Logout clicked') },
32
- ],
33
- };
34
-
35
- const mockNavigationItems = [
36
- { id: 'dashboard', label: 'Dashboard', icon: <FaHome />, action: () => {}, isActive: true },
37
- {
38
- id: 'users',
39
- label: 'Usuarios',
40
- icon: <FaUsers />,
41
- subitems: [
42
- { id: 'list', label: 'Listado', action: () => {} },
43
- { id: 'roles', label: 'Roles', action: () => {} }
44
- ]
45
- },
46
- { id: 'analytics', label: 'Reportes', icon: <FaChartBar />, action: () => {} },
47
- { id: 'settings', label: 'Ajustes', icon: <FaCog />, action: () => {} },
48
- ];
49
-
50
- export const DefaultShell: Story = {
51
- args: {
52
- sidebar: {
53
- navigationItems: mockNavigationItems,
54
- },
55
- topBar: {
56
- logoText: 'AXZY SYSTEM',
57
- userMenu: mockUserMenu,
58
- navItems: [
59
- { id: 'sec', label: 'Seguridad', icon: <FaShieldAlt />, action: () => {} }
60
- ]
61
- },
62
- },
63
- render: (args) => (
64
- <div className="h-[700px] w-full border border-gray-200 overflow-hidden rounded-xl shadow-lg my-8 mx-auto xl:max-w-6xl">
65
- <ITLayout {...args}>
66
- {/* Mocked Page Content */}
67
- <div className="max-w-4xl mx-auto space-y-6 pb-20">
68
- <header className="mb-8">
69
- <h1 className="text-3xl font-bold tracking-tight text-slate-900">Bienvenido de vuelta, Alejandro</h1>
70
- <p className="mt-2 text-slate-500 text-sm">A continuación un resumen de la actividad de tu plataforma.</p>
71
- </header>
72
-
73
- {/* Metric Cards Mock */}
74
- <div className="grid grid-cols-1 md:grid-cols-3 gap-6">
75
- {[
76
- { title: 'Usuarios Activos', value: '1,245', trend: '+12% este mes' },
77
- { title: 'Reportes Hoy', value: '45', trend: '-2% este mes' },
78
- { title: 'Ventas USD', value: '$12,400', trend: '+5.4% este mes' }
79
- ].map((stat, i) => (
80
- <div key={i} className="bg-white p-6 rounded-2xl shadow-sm border border-slate-100 flex flex-col hover:shadow-md transition-shadow">
81
- <span className="text-sm font-medium text-slate-500">{stat.title}</span>
82
- <span className="text-3xl font-bold text-slate-800 mt-2">{stat.value}</span>
83
- <span className="text-xs font-semibold text-emerald-500 mt-4 bg-emerald-50 w-fit px-2 py-1 rounded-md">{stat.trend}</span>
84
- </div>
85
- ))}
86
- </div>
87
-
88
- {/* Table Mock */}
89
- <div className="bg-white rounded-2xl border border-slate-200 shadow-sm mt-8 overflow-hidden hover:shadow-md transition-shadow">
90
- <div className="p-6 border-b border-slate-100 flex justify-between items-center bg-slate-50/50">
91
- <h3 className="text-base font-semibold text-slate-800">Actividad Reciente</h3>
92
- <button className="text-sm font-medium text-emerald-600 hover:text-emerald-700">Ver todo →</button>
93
- </div>
94
- <div className="p-6">
95
- <div className="animate-pulse space-y-4">
96
- {[1,2,3,4].map(i => (
97
- <div key={i} className="flex gap-4 items-center">
98
- <div className="w-10 h-10 rounded-full bg-slate-100"></div>
99
- <div className="flex-1 space-y-2">
100
- <div className="h-3 bg-slate-100 rounded-full w-1/4"></div>
101
- <div className="h-2 bg-slate-50 rounded-full w-1/3"></div>
102
- </div>
103
- <div className="w-20 h-6 bg-slate-100 rounded-full"></div>
104
- </div>
105
- ))}
106
- </div>
107
- </div>
108
- </div>
109
- </div>
110
- </ITLayout>
111
- </div>
112
- )
113
- };
@@ -1,86 +0,0 @@
1
- import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
2
- import * as StoriesData from './page.stories';
3
-
4
- <Meta of={StoriesData} />
5
-
6
- # ITPage
7
-
8
- A page template component that wraps an ITPageHeader with content area and built-in state handling for loading, error, and empty states. Provides automatic skeleton placeholders during loading, an error boundary with retry action, and a customizable empty state with action.
9
-
10
- ## Props
11
-
12
- | Prop | Type | Default | Description |
13
- |------|------|---------|-------------|
14
- | `title` | `string` | `undefined` | Page title passed to the header. |
15
- | `description` | `string` | `undefined` | Description text shown below the title. |
16
- | `breadcrumbs` | `ITBreadcrumbItem[]` | `undefined` | Breadcrumb navigation items. |
17
- | `actions` | `ReactNode` | `undefined` | Action buttons rendered in the header. |
18
- | `backAction` | `() => void` | `undefined` | Callback for the back button. |
19
- | `icon` | `ReactNode` | `undefined` | Icon displayed next to the title. |
20
- | `iconColor` | `string` | `undefined` | Custom color for the icon. |
21
- | `loading` | `boolean` | `false` | When true, shows skeleton placeholders instead of content. |
22
- | `error` | `string \| null` | `null` | Error message. When provided, shows an error state with retry button. |
23
- | `errorTitle` | `string` | `'Error'` | Custom title for the error state. |
24
- | `errorActionLabel` | `string` | `'Reintentar'` | Label for the retry button in the error state. |
25
- | `onRetry` | `() => void` | `undefined` | Callback when the retry button is clicked. |
26
- | `empty` | `boolean` | `false` | When true, shows an empty state placeholder. |
27
- | `emptyTitle` | `string` | `'Sin datos'` | Custom title for the empty state. |
28
- | `emptyDescription` | `string` | `undefined` | Custom description for the empty state. |
29
- | `emptyAction` | `ReactNode` | `undefined` | Custom action element for the empty state. |
30
- | `children` | `ReactNode` | required | Content rendered when no special state (loading/error/empty) is active. |
31
- | `maxWidth` | `'2xl' \| '3xl' \| '4xl' \| '5xl' \| '6xl' \| '7xl'` | `'7xl'` | Maximum width of the page content container. |
32
- | `noPadding` | `boolean` | `false` | When true, removes default padding from the page wrapper. Overrides `horizontalPadding`. |
33
- | `horizontalPadding` | `string` | `'px-4 sm:px-6 lg:px-8'` | Tailwind classes for the wrapper's horizontal padding. Use `'px-0'` for edge-to-edge content. Must be a literal — Tailwind scans source, so runtime-assembled values are not generated. |
34
- | `className` | `string` | `undefined` | Additional CSS classes for the page wrapper. |
35
-
36
- ## Usage
37
-
38
- ```tsx
39
- import { ITPage } from '@axzydev/axzy_ui_system';
40
-
41
- <ITPage title="Users" description="Manage system users" actions={<ITButton label="Add" />}>
42
- <p>Your page content</p>
43
- </ITPage>
44
-
45
- <ITPage title="Dashboard" loading>
46
- <p>Content not shown while loading</p>
47
- </ITPage>
48
-
49
- <ITPage
50
- title="Orders"
51
- error="Failed to load orders"
52
- onRetry={() => refetch()}
53
- >
54
- <p>Content not shown while error</p>
55
- </ITPage>
56
-
57
- <ITPage
58
- title="Notifications"
59
- empty
60
- emptyTitle="No notifications"
61
- emptyAction={<ITButton label="Refresh" />}
62
- >
63
- <p>Content not shown while empty</p>
64
- </ITPage>
65
- ```
66
-
67
- ## Notes
68
-
69
- - State priority: `error` > `loading` > `empty` > `children`.
70
- - The loading state renders animated skeleton blocks matching common page patterns.
71
- - The error state renders a centered error icon, message, and a retry button.
72
- - The empty state renders a centered placeholder with optional title, description, and action.
73
- - All header props (`title`, `description`, `breadcrumbs`, `actions`, `backAction`, `icon`) are forwarded to ITPageHeader.
74
- - Content maximum width is controlled by Tailwind max-width classes via `maxWidth`.
75
- - `noPadding` is useful for full-bleed layouts like dashboards. It removes both axes and wins over `horizontalPadding`.
76
- - `horizontalPadding` tunes only the horizontal gutter, so you can keep the vertical rhythm while going edge-to-edge:
77
- ```tsx
78
- <ITPage title="Reportes" horizontalPadding="px-0">...</ITPage>
79
- ```
80
- Because Tailwind scans your source files, write the value as a literal. A value built at runtime (`"px-" + n`) will silently produce no padding.
81
-
82
- ## Stories
83
-
84
- <Primary />
85
- <Controls />
86
- <Stories />
@@ -1,97 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react-vite";
2
- import ITPage from "@/components/templates/page/page";
3
- import ITButton from "@/components/atoms/button/button";
4
- import ITCard from "@/components/molecules/card/card";
5
-
6
- const meta: Meta<typeof ITPage> = {
7
- title: "Components/Layout/ITPage",
8
- component: ITPage,
9
- };
10
-
11
- export default meta;
12
- type Story = StoryObj<typeof ITPage>;
13
-
14
- export const Default: Story = {
15
- args: {
16
- title: "Usuarios",
17
- description: "Gestión de usuarios del sistema",
18
- children: (
19
- <ITCard title="Contenido">
20
- <p className="text-sm text-slate-600 dark:text-slate-400">
21
- Aquí va el contenido de la página.
22
- </p>
23
- </ITCard>
24
- ),
25
- },
26
- };
27
-
28
- export const WithBreadcrumbsAndActions: Story = {
29
- args: {
30
- title: "Editar Producto",
31
- description: "Modifica los datos del producto",
32
- breadcrumbs: [
33
- { label: "Productos", href: "#" },
34
- { label: "Editar Producto" },
35
- ],
36
- actions: (
37
- <>
38
- <ITButton label="Cancelar" variant="outlined" size="sm" />
39
- <ITButton label="Guardar" size="sm" />
40
- </>
41
- ),
42
- children: (
43
- <ITCard title="Información General">
44
- <p className="text-sm text-slate-600 dark:text-slate-400">
45
- Contenido del formulario aquí.
46
- </p>
47
- </ITCard>
48
- ),
49
- },
50
- };
51
-
52
- export const Loading: Story = {
53
- args: {
54
- title: "Dashboard",
55
- loading: true,
56
- children: null,
57
- },
58
- };
59
-
60
- export const WithError: Story = {
61
- args: {
62
- title: "Órdenes",
63
- error: "No se pudieron cargar las órdenes. Verifica tu conexión.",
64
- onRetry: () => alert("Retry clicked"),
65
- children: null,
66
- },
67
- };
68
-
69
- export const Empty: Story = {
70
- args: {
71
- title: "Notificaciones",
72
- empty: true,
73
- emptyTitle: "Sin notificaciones",
74
- emptyDescription: "No tienes notificaciones pendientes.",
75
- emptyAction: <ITButton label="Recargar" size="sm" onClick={() => alert("Refresh")} />,
76
- children: null,
77
- },
78
- };
79
-
80
- export const WithBackAction: Story = {
81
- args: {
82
- title: "Detalle del Usuario",
83
- description: "Información completa del usuario",
84
- backAction: () => alert("Back"),
85
- breadcrumbs: [
86
- { label: "Usuarios", href: "#" },
87
- { label: "Detalle" },
88
- ],
89
- children: (
90
- <ITCard title="Perfil">
91
- <p className="text-sm text-slate-600 dark:text-slate-400">
92
- Contenido del detalle aquí.
93
- </p>
94
- </ITCard>
95
- ),
96
- },
97
- };
@@ -1,85 +0,0 @@
1
- import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
2
- import * as StoriesData from './themeProvider.stories';
3
-
4
- <Meta of={StoriesData} />
5
-
6
- # ITThemeProvider
7
-
8
- Root theme context that injects CSS custom properties into the entire component tree. Provides a centralized color palette with semantic tokens (primary, secondary, ternary, danger, success, info, alert, warning) plus overridable layout and table sections. Includes a floating action button that opens an in-app real-time theme designer drawer for live palette editing, dark/light/system mode switching, and preset themes.
9
-
10
- ## Props
11
-
12
- | Prop | Type | Default | Description |
13
- |------|------|---------|-------------|
14
- | `theme` | `Partial<ITThemePalette>` | — | Partial palette overrides merged with the default theme. Supports primary, secondary, ternary, danger, success, info, alert, warning, layout, and table colors. |
15
- | `children` | `React.ReactNode` | — | The subtree that receives the theme context and CSS variables. |
16
- | `showFab` | `boolean` | `false` | Whether to show the floating action button for opening the theme designer drawer. |
17
- | `density` | `number` | `1` | Global density/compactness factor: values below `1` shrink base sizes (fonts, paddings, gaps), above `1` grow them. Applies by scaling the root font-size so every `rem`-based token compacts together while the layout stays fluid. Clamped to `0.5`–`1.5`. |
18
- | `radius` | `number` | — | Global border radius in **px** applied to the whole rounding scale. `2` ⇒ 2px corners (near-square), `8` ⇒ 8px, `0` ⇒ square. No override when omitted (Tailwind defaults). |
19
- | `shadow` | `number` | `2` | Global shadow strength level: `0` ⇒ none, `1` ⇒ subtle, `2` ⇒ default current look, `3` ⇒ pronounced. No override when omitted (keeps defaults). |
20
- | `appearance` | `"soft" \| "flat"` | `"soft"` | Visual language. `"flat"` switches `ITCard`, `ITSidebar`, `ITTopBar` and `ITPageHeader` to flat surfaces (hairline borders, no shadows, no header icon tile) and sets `data-it-appearance` on `<html>`. Read it in your own components with `useITFlatAppearance()`. |
21
-
22
- ### ITThemePalette Shape
23
-
24
- | Key | Type | Description |
25
- |-----|------|-------------|
26
- | `primary` | `string` | Primary color for buttons, links, active states. |
27
- | `secondary` | `string` | Secondary/muted color. |
28
- | `ternary` | `string` | Tertiary accent color. |
29
- | `danger` | `string` | Destructive action color. |
30
- | `success` | `string` | Positive/success color. |
31
- | `info` | `string` | Informational color. |
32
- | `alert` | `string` | Alert/warning highlight color. |
33
- | `warning` | `string` | Cautionary yellow color. |
34
- | `layout.sidebarBg` | `string` | Sidebar background color. |
35
- | `layout.sidebarText` | `string` | Sidebar text color. |
36
- | `layout.navbarBg` | `string` | Navbar background color. |
37
- | `layout.navbarText` | `string` | Navbar text color. |
38
- | `table.headerBg` | `string` | Table header background color. |
39
- | `table.headerText` | `string` | Table header text color. |
40
- | `table.rowBg` | `string` | Table row background color. |
41
- | `table.rowText` | `string` | Table row text color. |
42
- | `table.rowHover` | `string` | Table row background color while hovering a row. |
43
-
44
- ## Usage
45
-
46
- ```tsx
47
- import { ITThemeProvider } from '@axzydev/axzy_ui_system';
48
-
49
- <ITThemeProvider
50
- theme={{
51
- primary: '#8b5cf6',
52
- success: '#22c55e',
53
- layout: {
54
- sidebarBg: '#0b1120',
55
- sidebarText: '#94a3b8',
56
- },
57
- }}
58
- >
59
- <App />
60
- </ITThemeProvider>
61
-
62
- <ITThemeProvider showFab>
63
- <App />
64
- </ITThemeProvider>
65
-
66
- {/* Cuadrado en todos lados y sombras nivel 2 */}
67
- <ITThemeProvider radius={2} shadow={2}>
68
- <App />
69
- </ITThemeProvider>
70
- ```
71
-
72
- ## Notes
73
-
74
- - Wrap your entire application in `ITThemeProvider` once at the root level.
75
- - The default palette uses cyan (`#06b6d4`) as primary and supports all semantic color tokens.
76
- - **showFab** renders a floating palette icon. Clicking it opens a drawer with color pickers for each token, dark/light/system mode toggle, preset theme cards, live preview, and persistent localStorage save.
77
- - Theme preferences are persisted to localStorage under the `it-theme-palette` key.
78
- - All child components consume theme colors via CSS custom properties (e.g., `var(--it-primary)`) injected by the provider.
79
- - Custom palettes can override any subset of tokens; unset keys fall back to the default palette.
80
-
81
- ## Stories
82
-
83
- <Primary />
84
- <Controls />
85
- <Stories />
@@ -1,58 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import ITThemeProvider from './themeProvider';
3
- import ITCard from '@/components/molecules/card/card';
4
- import ITButton from '@/components/atoms/button/button';
5
- import ITText from '@/components/atoms/text/text';
6
-
7
- const meta = {
8
- title: 'Components/System/ITThemeProvider',
9
- component: ITThemeProvider,
10
- parameters: { layout: 'centered' },
11
- argTypes: {
12
- theme: { control: false, description: 'Custom theme palette to override defaults' },
13
- children: { control: false, description: 'App content wrapped by the theme context' },
14
- showFab: { control: 'boolean', description: 'Show the floating action button to open the theme designer' },
15
- },
16
- } satisfies Meta<typeof ITThemeProvider>;
17
-
18
- export default meta;
19
- type Story = StoryObj<typeof meta>;
20
-
21
- const ThemedContent = () => (
22
- <div className="p-8 space-y-4">
23
- <ITCard title="Theme Demo" className="max-w-sm">
24
- <div className="space-y-3">
25
- <ITText as="p" className="text-sm text-slate-600 dark:text-slate-300">
26
- This content is wrapped in ITThemeProvider and uses the current theme.
27
- </ITText>
28
- <div className="flex gap-2">
29
- <ITButton label="Primary" color="primary" />
30
- <ITButton label="Success" color="success" />
31
- <ITButton label="Danger" color="danger" />
32
- </div>
33
- </div>
34
- </ITCard>
35
- </div>
36
- );
37
-
38
- export const Default: Story = {
39
- args: {
40
- children: <ThemedContent />,
41
- showFab: false,
42
- },
43
- };
44
-
45
- export const CustomPrimaryColor: Story = {
46
- args: {
47
- theme: { primary: '#8b5cf6', success: '#22c55e' },
48
- children: <ThemedContent />,
49
- showFab: false,
50
- },
51
- };
52
-
53
- export const WithThemeFab: Story = {
54
- args: {
55
- children: <ThemedContent />,
56
- showFab: true,
57
- },
58
- };