@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.
- package/README.md +2 -11
- package/dist/index.cjs +1826 -1351
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +115 -14
- package/dist/index.d.ts +115 -14
- package/dist/index.js +1481 -1010
- package/dist/index.js.map +1 -1
- package/dist/layered.css +1 -1
- package/package.json +3 -16
- package/src/App.tsx +90 -73
- package/src/components/atoms/badget/badget.tsx +23 -5
- package/src/components/atoms/chip/chip.tsx +3 -1
- package/src/components/atoms/image/image.tsx +3 -1
- package/src/components/atoms/input/input.tsx +8 -5
- package/src/components/atoms/loader/loader.tsx +3 -1
- package/src/components/atoms/slide/slide.props.ts +12 -0
- package/src/components/atoms/slide/slide.tsx +3 -0
- package/src/components/molecules/alert/alert.tsx +3 -1
- package/src/components/molecules/breadcrumbs/breadcrumbs.tsx +3 -1
- package/src/components/molecules/calendar/calendar.tsx +9 -6
- package/src/components/molecules/card/card.tsx +5 -2
- package/src/components/molecules/chip-input/chip-input.tsx +9 -7
- package/src/components/molecules/date-picker/datePicker.tsx +9 -9
- package/src/components/molecules/dropdown-menu/dropdown-menu.props.ts +1 -1
- package/src/components/molecules/dropdown-menu/dropdown-menu.tsx +6 -3
- package/src/components/molecules/field/field.tsx +3 -1
- package/src/components/molecules/form-header/form-header.tsx +3 -1
- package/src/components/molecules/line-bar-chart/line-bar-chart.props.ts +2 -2
- package/src/components/molecules/line-bar-chart/line-bar-chart.tsx +20 -15
- package/src/components/molecules/masked-input/masked-input.tsx +3 -1
- package/src/components/molecules/multi-select/multi-select.tsx +12 -9
- package/src/components/molecules/pagination/pagination.tsx +11 -5
- package/src/components/molecules/search-select/search-select.tsx +11 -9
- package/src/components/molecules/select/select.tsx +6 -4
- package/src/components/molecules/stepper/stepper.tsx +6 -4
- package/src/components/molecules/table/table.tsx +30 -28
- package/src/components/molecules/time-picker/timePicker.tsx +8 -6
- package/src/components/molecules/wysiwyg/wysiwyg.tsx +23 -12
- package/src/components/organisms/confirm-dialog/confirm-dialog.props.ts +4 -4
- package/src/components/organisms/confirm-dialog/confirm-dialog.tsx +16 -8
- package/src/components/organisms/data-table/dataTable.tsx +31 -25
- package/src/components/organisms/dialog/dialog.tsx +3 -0
- package/src/components/organisms/drawer/drawer.tsx +3 -0
- package/src/components/organisms/dropfile/dropfile.tsx +19 -17
- package/src/components/organisms/form-builder/fieldRenderer.tsx +4 -2
- package/src/components/organisms/navbar/navbar.tsx +4 -2
- package/src/components/organisms/page-header/page-header.tsx +3 -1
- package/src/components/organisms/searchTable/components/PaginationControls.tsx +8 -6
- package/src/components/organisms/searchTable/components/PaginationInfo.tsx +3 -1
- package/src/components/organisms/searchTable/components/SearchAndSortBar.tsx +7 -5
- package/src/components/organisms/searchTable/components/SearchInput.tsx +4 -2
- package/src/components/organisms/searchTable/components/SortButton.tsx +13 -11
- package/src/components/organisms/searchTable/components/TableEmptyState.tsx +4 -2
- package/src/components/organisms/searchTable/components/TableRow.tsx +6 -4
- package/src/components/organisms/searchTable/searchTable.tsx +4 -2
- package/src/components/organisms/sidebar/sidebar.props.ts +1 -1
- package/src/components/organisms/sidebar/sidebar.tsx +9 -4
- package/src/components/organisms/toast/toast.tsx +3 -1
- package/src/components/organisms/topbar/topbar.tsx +4 -2
- package/src/components/templates/page/page.props.ts +4 -4
- package/src/components/templates/page/page.tsx +6 -4
- package/src/components/theme-provider/themeProvider.tsx +28 -17
- package/src/dev.css +61 -2
- package/src/global.d.ts +10 -0
- package/src/i18n/context.ts +9 -0
- package/src/i18n/index.ts +22 -0
- package/src/i18n/locales/en.ts +163 -0
- package/src/i18n/locales/es.ts +165 -0
- package/src/i18n/provider.tsx +44 -0
- package/src/i18n/translator.ts +82 -0
- package/src/i18n/types.ts +54 -0
- package/src/i18n/useITTranslation.ts +20 -0
- package/src/index.css +0 -1
- package/src/index.ts +7 -1
- package/src/sandbox/LandingShowcase.tsx +224 -580
- package/src/sandbox/NotFoundShowcase.tsx +51 -36
- package/src/sandbox/TopbarSearch.tsx +6 -4
- package/src/sandbox/controls.tsx +180 -0
- package/src/sandbox/i18n.ts +1939 -0
- package/src/sandbox/icons.tsx +25 -0
- package/src/sandbox/locale.tsx +72 -0
- package/src/sandbox/ui.tsx +474 -0
- package/src/sandbox/useHashRoute.ts +46 -10
- package/src/showcases/DataShowcases.tsx +103 -87
- package/src/showcases/FeedbackShowcases.tsx +37 -30
- package/src/showcases/FormShowcases.tsx +303 -215
- package/src/showcases/GettingStartedShowcase.tsx +151 -145
- package/src/showcases/HelpShowcase.tsx +126 -128
- package/src/showcases/HomeShowcase.tsx +678 -482
- package/src/showcases/LayoutPrimitivesShowcases.tsx +129 -114
- package/src/showcases/NavigationShowcases.tsx +45 -37
- package/src/showcases/PageShowcases.tsx +171 -152
- package/src/showcases/ProductoDetalle.tsx +272 -129
- package/src/showcases/ShowcaseLayout.tsx +256 -219
- package/src/showcases/SizesShowcase.tsx +123 -64
- package/src/showcases/StructureShowcases.tsx +203 -138
- package/src/showcases/portfolioUi.tsx +153 -0
- package/src/showcases/techIcons.ts +3 -0
- package/src/utils/table.utils.ts +10 -2
- package/src/components/atoms/avatar/avatar.doc.mdx +0 -48
- package/src/components/atoms/avatar/avatar.stories.tsx +0 -64
- package/src/components/atoms/badget/badget.doc.mdx +0 -46
- package/src/components/atoms/badget/badget.stories.tsx +0 -75
- package/src/components/atoms/button/button.doc.mdx +0 -59
- package/src/components/atoms/button/button.stories.tsx +0 -173
- package/src/components/atoms/checkbox/checkbox.doc.mdx +0 -54
- package/src/components/atoms/checkbox/checkbox.stories.tsx +0 -53
- package/src/components/atoms/chip/chip.doc.mdx +0 -47
- package/src/components/atoms/chip/chip.stories.tsx +0 -64
- package/src/components/atoms/divider/divider.doc.mdx +0 -42
- package/src/components/atoms/divider/divider.stories.tsx +0 -33
- package/src/components/atoms/flex/flex.doc.mdx +0 -59
- package/src/components/atoms/flex/flex.stories.tsx +0 -70
- package/src/components/atoms/grid/grid.doc.mdx +0 -54
- package/src/components/atoms/grid/grid.stories.tsx +0 -71
- package/src/components/atoms/image/image.doc.mdx +0 -44
- package/src/components/atoms/image/image.stories.tsx +0 -48
- package/src/components/atoms/input/input.doc.mdx +0 -70
- package/src/components/atoms/input/input.stories.tsx +0 -113
- package/src/components/atoms/input-number/input-number.doc.mdx +0 -74
- package/src/components/atoms/input-number/input-number.stories.tsx +0 -111
- package/src/components/atoms/loader/loader.doc.mdx +0 -43
- package/src/components/atoms/loader/loader.stories.tsx +0 -104
- package/src/components/atoms/popover/popover.doc.mdx +0 -53
- package/src/components/atoms/popover/popover.stories.tsx +0 -24
- package/src/components/atoms/progress/progress.doc.mdx +0 -48
- package/src/components/atoms/progress/progress.stories.tsx +0 -39
- package/src/components/atoms/radio/radio.doc.mdx +0 -62
- package/src/components/atoms/radio/radio.stories.tsx +0 -48
- package/src/components/atoms/segmented-control/segmented-control.doc.mdx +0 -60
- package/src/components/atoms/segmented-control/segmented-control.stories.tsx +0 -62
- package/src/components/atoms/skeleton/skeleton.doc.mdx +0 -43
- package/src/components/atoms/skeleton/skeleton.stories.tsx +0 -29
- package/src/components/atoms/slide/slide.doc.mdx +0 -46
- package/src/components/atoms/slide/slide.stories.tsx +0 -120
- package/src/components/atoms/slider/slider.doc.mdx +0 -49
- package/src/components/atoms/slider/slider.stories.tsx +0 -29
- package/src/components/atoms/stack/stack.doc.mdx +0 -126
- package/src/components/atoms/stack/stack.stories.tsx +0 -283
- package/src/components/atoms/text/text.doc.mdx +0 -41
- package/src/components/atoms/text/text.stories.tsx +0 -66
- package/src/components/atoms/textarea/textarea.doc.mdx +0 -64
- package/src/components/atoms/textarea/textarea.stories.tsx +0 -26
- package/src/components/atoms/tooltip/tooltip.doc.mdx +0 -47
- package/src/components/atoms/tooltip/tooltip.stories.tsx +0 -19
- package/src/components/isolation/isolation.stories.tsx +0 -202
- package/src/components/molecules/accordion/accordion.doc.mdx +0 -47
- package/src/components/molecules/accordion/accordion.stories.tsx +0 -68
- package/src/components/molecules/alert/alert.doc.mdx +0 -48
- package/src/components/molecules/alert/alert.stories.tsx +0 -40
- package/src/components/molecules/breadcrumbs/breadcrumbs.doc.mdx +0 -57
- package/src/components/molecules/breadcrumbs/breadcrumbs.stories.tsx +0 -20
- package/src/components/molecules/calendar/calendar.doc.mdx +0 -76
- package/src/components/molecules/calendar/calendar.stories.tsx +0 -90
- package/src/components/molecules/card/card.doc.mdx +0 -54
- package/src/components/molecules/card/card.stories.tsx +0 -57
- package/src/components/molecules/chip-input/chip-input.doc.mdx +0 -44
- package/src/components/molecules/chip-input/chip-input.stories.tsx +0 -52
- package/src/components/molecules/date-picker/date-picker.doc.mdx +0 -65
- package/src/components/molecules/date-picker/date-picker.stories.tsx +0 -88
- package/src/components/molecules/dropdown-menu/dropdown-menu.doc.mdx +0 -46
- package/src/components/molecules/dropdown-menu/dropdown-menu.stories.tsx +0 -41
- package/src/components/molecules/empty-state/empty-state.doc.mdx +0 -50
- package/src/components/molecules/empty-state/empty-state.stories.tsx +0 -19
- package/src/components/molecules/field/field.doc.mdx +0 -43
- package/src/components/molecules/field/field.stories.tsx +0 -42
- package/src/components/molecules/form-header/form-header.doc.mdx +0 -38
- package/src/components/molecules/form-header/form-header.stories.tsx +0 -52
- package/src/components/molecules/masked-input/masked-input.doc.mdx +0 -78
- package/src/components/molecules/masked-input/masked-input.stories.tsx +0 -126
- package/src/components/molecules/multi-select/multi-select.doc.mdx +0 -55
- package/src/components/molecules/multi-select/multi-select.stories.tsx +0 -59
- package/src/components/molecules/pagination/pagination.doc.mdx +0 -62
- package/src/components/molecules/pagination/pagination.stories.tsx +0 -110
- package/src/components/molecules/search-select/search-select.doc.mdx +0 -77
- package/src/components/molecules/search-select/search-select.stories.tsx +0 -146
- package/src/components/molecules/select/select.doc.mdx +0 -75
- package/src/components/molecules/select/select.stories.tsx +0 -85
- package/src/components/molecules/stat-card/stat-card.doc.mdx +0 -48
- package/src/components/molecules/stat-card/stat-card.stories.tsx +0 -40
- package/src/components/molecules/stepper/stepper.doc.mdx +0 -54
- package/src/components/molecules/stepper/stepper.stories.tsx +0 -154
- package/src/components/molecules/table/table.doc.mdx +0 -140
- package/src/components/molecules/table/table.stories.tsx +0 -402
- package/src/components/molecules/tabs/tabs.doc.mdx +0 -52
- package/src/components/molecules/tabs/tabs.stories.tsx +0 -31
- package/src/components/molecules/time-picker/timePicker.doc.mdx +0 -68
- package/src/components/molecules/time-picker/timePicker.stories.tsx +0 -130
- package/src/components/molecules/wysiwyg/wysiwyg.stories.tsx +0 -95
- package/src/components/organisms/confirm-dialog/confirm-dialog.doc.mdx +0 -60
- package/src/components/organisms/confirm-dialog/confirm-dialog.stories.tsx +0 -32
- package/src/components/organisms/data-table/ITDataTable.doc.mdx +0 -132
- package/src/components/organisms/data-table/ITDataTable.stories.tsx +0 -353
- package/src/components/organisms/dialog/dialog.doc.mdx +0 -54
- package/src/components/organisms/dialog/dialog.stories.tsx +0 -126
- package/src/components/organisms/drawer/drawer.doc.mdx +0 -59
- package/src/components/organisms/drawer/drawer.stories.tsx +0 -40
- package/src/components/organisms/dropfile/dropfile.doc.mdx +0 -74
- package/src/components/organisms/dropfile/dropfile.stories.tsx +0 -93
- package/src/components/organisms/form-builder/formBuilder.doc.mdx +0 -251
- package/src/components/organisms/form-builder/formBuilder.stories.tsx +0 -914
- package/src/components/organisms/navbar/navbar.doc.mdx +0 -77
- package/src/components/organisms/navbar/navbar.stories.tsx +0 -83
- package/src/components/organisms/page-header/page-header.doc.mdx +0 -54
- package/src/components/organisms/page-header/page-header.stories.tsx +0 -74
- package/src/components/organisms/searchTable/searchTable.doc.mdx +0 -79
- package/src/components/organisms/searchTable/searchTable.stories.tsx +0 -73
- package/src/components/organisms/sidebar/sidebar.doc.mdx +0 -176
- package/src/components/organisms/sidebar/sidebar.stories.tsx +0 -234
- package/src/components/organisms/toast/toast.doc.mdx +0 -50
- package/src/components/organisms/toast/toast.stories.tsx +0 -137
- package/src/components/organisms/topbar/topbar.doc.mdx +0 -72
- package/src/components/organisms/topbar/topbar.stories.tsx +0 -79
- package/src/components/organisms/triple-filter/tripleFilter.doc.mdx +0 -62
- package/src/components/organisms/triple-filter/tripleFilter.stories.tsx +0 -31
- package/src/components/templates/layout/layout.doc.mdx +0 -53
- package/src/components/templates/layout/layout.stories.tsx +0 -113
- package/src/components/templates/page/page.doc.mdx +0 -86
- package/src/components/templates/page/page.stories.tsx +0 -97
- package/src/components/theme-provider/themeProvider.doc.mdx +0 -85
- 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
|
-
};
|