@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.
- package/README.md +2 -11
- package/dist/index.cjs +2174 -1570
- 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 +232 -19
- package/dist/index.d.ts +232 -19
- package/dist/index.js +1838 -1238
- 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.props.ts +10 -2
- package/src/components/molecules/table/table.tsx +163 -114
- 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.props.ts +3 -2
- package/src/components/organisms/data-table/dataTable.tsx +149 -81
- 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 +77 -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 +9 -3
- 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 +1929 -0
- package/src/sandbox/icons.tsx +25 -0
- package/src/sandbox/locale.tsx +72 -0
- package/src/sandbox/ui.tsx +377 -0
- package/src/sandbox/useHashRoute.ts +46 -10
- package/src/showcases/DataShowcases.tsx +201 -80
- package/src/showcases/FeedbackShowcases.tsx +37 -30
- package/src/showcases/FormShowcases.tsx +302 -214
- 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 +270 -216
- package/src/showcases/SizesShowcase.tsx +123 -64
- package/src/showcases/StructureShowcases.tsx +157 -131
- package/src/showcases/portfolioUi.tsx +153 -0
- package/src/showcases/techIcons.ts +3 -0
- package/src/types/table.types.ts +110 -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 -123
- 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 -115
- 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,90 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import ITCalendar from '@/components/molecules/calendar/calendar';
|
|
3
|
-
import { addHours, format, startOfDay, addDays } from 'date-fns';
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'Components/Data Display/ITCalendar',
|
|
7
|
-
component: ITCalendar,
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: 'padded',
|
|
10
|
-
},
|
|
11
|
-
argTypes: {
|
|
12
|
-
mode: {
|
|
13
|
-
control: 'select',
|
|
14
|
-
options: ['month', 'week', 'day'],
|
|
15
|
-
description: 'View mode of the calendar'
|
|
16
|
-
},
|
|
17
|
-
value: { control: 'date' },
|
|
18
|
-
onEventClick: { action: 'event clicked' },
|
|
19
|
-
onSlotClick: { action: 'slot clicked' },
|
|
20
|
-
onSelectRange: { action: 'range selected' },
|
|
21
|
-
},
|
|
22
|
-
} satisfies Meta<typeof ITCalendar>;
|
|
23
|
-
|
|
24
|
-
export default meta;
|
|
25
|
-
type Story = StoryObj<typeof meta>;
|
|
26
|
-
|
|
27
|
-
const today = new Date();
|
|
28
|
-
const tomorrow = addDays(today, 1);
|
|
29
|
-
|
|
30
|
-
const sampleEvents = [
|
|
31
|
-
{
|
|
32
|
-
id: '1',
|
|
33
|
-
title: 'Team Meeting',
|
|
34
|
-
start: addHours(startOfDay(today), 9), // Today 9:00 AM
|
|
35
|
-
end: addHours(startOfDay(today), 10.5), // Today 10:30 AM
|
|
36
|
-
color: '#3b82f6', // Primary
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
id: '2',
|
|
40
|
-
title: 'Lunch Break',
|
|
41
|
-
start: addHours(startOfDay(today), 13),
|
|
42
|
-
end: addHours(startOfDay(today), 14),
|
|
43
|
-
color: '#f97316', // Warning
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
id: '3',
|
|
47
|
-
title: 'Project Review',
|
|
48
|
-
start: addHours(startOfDay(tomorrow), 11),
|
|
49
|
-
end: addHours(startOfDay(tomorrow), 12.5),
|
|
50
|
-
color: '#8b5cf6', // Purple
|
|
51
|
-
}
|
|
52
|
-
];
|
|
53
|
-
|
|
54
|
-
export const WeekView: Story = {
|
|
55
|
-
args: {
|
|
56
|
-
mode: 'week',
|
|
57
|
-
events: sampleEvents,
|
|
58
|
-
className: 'h-[600px]',
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export const DayView: Story = {
|
|
63
|
-
args: {
|
|
64
|
-
mode: 'day',
|
|
65
|
-
events: sampleEvents,
|
|
66
|
-
className: 'h-[600px]',
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export const MonthView: Story = {
|
|
71
|
-
args: {
|
|
72
|
-
mode: 'month',
|
|
73
|
-
value: today,
|
|
74
|
-
onChange: (date) => console.log('Date selected:', date),
|
|
75
|
-
className: 'h-[400px] max-w-md',
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export const WithInteractiveSelection: Story = {
|
|
80
|
-
render: (args) => {
|
|
81
|
-
// Mock interactivity could be complex in storybook args,
|
|
82
|
-
// but the component handles internal drag state for valid callbacks.
|
|
83
|
-
return <ITCalendar {...args} onSelectRange={(start, end) => alert(`Selected: ${format(start, 'HH:mm')} - ${format(end, 'HH:mm')}`)} />;
|
|
84
|
-
},
|
|
85
|
-
args: {
|
|
86
|
-
mode: 'week',
|
|
87
|
-
className: 'h-[600px]',
|
|
88
|
-
events: [],
|
|
89
|
-
}
|
|
90
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
-
import * as StoriesData from './card.stories';
|
|
3
|
-
|
|
4
|
-
<Meta of={StoriesData} />
|
|
5
|
-
|
|
6
|
-
# ITCard
|
|
7
|
-
|
|
8
|
-
A versatile container component for grouping related content and actions. Supports an optional header image, title, body content, and a footer action area. Cards become interactive with hover shadow animation when an `onClick` handler is provided.
|
|
9
|
-
|
|
10
|
-
## Props
|
|
11
|
-
|
|
12
|
-
| Prop | Type | Default | Description |
|
|
13
|
-
|------|------|---------|-------------|
|
|
14
|
-
| `onClick` | `() => void` | — | Click handler. When provided, the card becomes interactive with hover shadow effect. |
|
|
15
|
-
| `title` | `string` | — | Card title displayed in the header area. |
|
|
16
|
-
| `image` | `string` | — | Image source URL displayed at the top of the card. |
|
|
17
|
-
| `alt` | `string` | `"Card Image"` | Alt text for the card image. |
|
|
18
|
-
| `children` | `ReactNode` | — | Card body content, rendered below the title. |
|
|
19
|
-
| `actions` | `ReactNode` | — | Action elements rendered in a footer section separated by a border. |
|
|
20
|
-
| `className` | `string` | — | Additional CSS class names for the card container. |
|
|
21
|
-
| `imageClassName` | `string` | — | Additional CSS class names for the image element. |
|
|
22
|
-
| `titleClassName` | `string` | — | Additional CSS class names for the title element. |
|
|
23
|
-
| `contentClassName` | `string` | — | Additional CSS class names for the content wrapper. |
|
|
24
|
-
| `actionClassName` | `string` | — | Additional CSS class names for the actions footer. |
|
|
25
|
-
|
|
26
|
-
## Usage
|
|
27
|
-
|
|
28
|
-
```tsx
|
|
29
|
-
import { ITCard } from '@axzydev/axzy_ui_system';
|
|
30
|
-
|
|
31
|
-
<ITCard title="Bienvenido" image="/hero.jpg" actions={<ITButton label="Ver más" />}>
|
|
32
|
-
Contenido de la tarjeta.
|
|
33
|
-
</ITCard>
|
|
34
|
-
|
|
35
|
-
<ITCard onClick={() => navigate("/details")} className="max-w-sm">
|
|
36
|
-
Tarjeta interactiva con sombra al hover.
|
|
37
|
-
</ITCard>
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Variants / Notes
|
|
41
|
-
|
|
42
|
-
- **Default** — Clean container with theme-driven background, border, and border-radius via CSS custom properties.
|
|
43
|
-
- **Interactive** — When `onClick` is provided, the card gains a subtle base shadow, a stronger shadow on hover, a pointer cursor, and smooth transition animation.
|
|
44
|
-
- **With image** — The `image` prop renders a full-width image at the top with `object-cover` and a fixed height.
|
|
45
|
-
- **With actions** — The `actions` prop renders a footer section with a top border, perfect for button groups.
|
|
46
|
-
- Styling is driven by CSS custom properties (`--card-bg`, `--card-border`, `--card-radius`) for easy theming.
|
|
47
|
-
- All style class names are customizable via the dedicated `*ClassName` props.
|
|
48
|
-
- Card contents are wrapped with `ITText` for consistent typography.
|
|
49
|
-
|
|
50
|
-
## Stories
|
|
51
|
-
|
|
52
|
-
<Primary />
|
|
53
|
-
<Controls />
|
|
54
|
-
<Stories />
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import ITCard from '@/components/molecules/card/card';
|
|
3
|
-
import ITButton from '@/components/atoms/button/button';
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'Components/Layout & Navigation/ITCard',
|
|
7
|
-
component: ITCard,
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: 'centered',
|
|
10
|
-
},
|
|
11
|
-
argTypes: {
|
|
12
|
-
onClick: { action: 'clicked' },
|
|
13
|
-
},
|
|
14
|
-
} satisfies Meta<typeof ITCard>;
|
|
15
|
-
|
|
16
|
-
export default meta;
|
|
17
|
-
type Story = StoryObj<typeof meta>;
|
|
18
|
-
|
|
19
|
-
export const Default: Story = {
|
|
20
|
-
args: {
|
|
21
|
-
title: 'Card Title',
|
|
22
|
-
children: 'This is the body of the card. It has padding defined by the theme.',
|
|
23
|
-
onClick: undefined,
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export const WithImage: Story = {
|
|
28
|
-
args: {
|
|
29
|
-
title: 'Card with Image',
|
|
30
|
-
image: 'https://images.unsplash.com/photo-1579546929518-9e396f3cc809?ixlib=rb-1.2.1&auto=format&fit=crop&w=1000&q=80',
|
|
31
|
-
children: 'A nice gradient image above.',
|
|
32
|
-
onClick: undefined,
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export const WithActions: Story = {
|
|
37
|
-
args: {
|
|
38
|
-
title: 'Card with Actions',
|
|
39
|
-
children: 'This card has a button action at the bottom.',
|
|
40
|
-
actions: (
|
|
41
|
-
<div className="flex justify-end gap-2">
|
|
42
|
-
<ITButton variant="text" color="secondary" label="Cancel" />
|
|
43
|
-
<ITButton variant="filled" color="primary" label="Save" />
|
|
44
|
-
</div>
|
|
45
|
-
),
|
|
46
|
-
onClick: undefined,
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export const Clickable: Story = {
|
|
51
|
-
args: {
|
|
52
|
-
title: 'Clickable Card',
|
|
53
|
-
children: 'Hover over me! I should have a stronger shadow and a pointer cursor.',
|
|
54
|
-
onClick: () => alert('Card clicked!'),
|
|
55
|
-
image: 'https://images.unsplash.com/photo-1557683316-973673baf926?ixlib=rb-1.2.1&auto=format&fit=crop&w=1000&q=80',
|
|
56
|
-
},
|
|
57
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
-
import * as StoriesData from './chip-input.stories';
|
|
3
|
-
|
|
4
|
-
<Meta of={StoriesData} />
|
|
5
|
-
|
|
6
|
-
# ITChipInput
|
|
7
|
-
|
|
8
|
-
Free-text input that turns entered values into removable tags (chips).
|
|
9
|
-
|
|
10
|
-
## Props
|
|
11
|
-
|
|
12
|
-
| Prop | Type | Default | Description |
|
|
13
|
-
|------|------|---------|-------------|
|
|
14
|
-
| `value` | `string[]` | — | Current tags (controlled). |
|
|
15
|
-
| `onChange` | `(values: string[]) => void` | — | Fired with the next list of tags. |
|
|
16
|
-
| `label` | `string` | — | Label above the control. |
|
|
17
|
-
| `placeholder` | `string` | `"Escribe y presiona Enter"` | Input placeholder. |
|
|
18
|
-
| `delimiters` | `string[]` | `["Enter", ","]` | Keys that commit a tag. |
|
|
19
|
-
| `maxTags` | `number` | — | Maximum number of tags. |
|
|
20
|
-
| `allowDuplicates` | `boolean` | `false` | Allows repeated tags. |
|
|
21
|
-
| `validate` | `(value) => string \| undefined` | — | Rejects a tag with a message. |
|
|
22
|
-
| `color` | semantic color key | `"primary"` | Color of the tag chips. |
|
|
23
|
-
| `size` | `"sm" \| "md" \| "lg"` | `"md"` | Control size. |
|
|
24
|
-
| `disabled` / `required` / `touched` / `error` / `helpText` | — | — | Standard form states. |
|
|
25
|
-
|
|
26
|
-
## Usage
|
|
27
|
-
|
|
28
|
-
```tsx
|
|
29
|
-
import { ITChipInput } from '@axzydev/axzy_ui_system';
|
|
30
|
-
|
|
31
|
-
<ITChipInput label="Etiquetas" value={tags} onChange={setTags} />
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Notes
|
|
35
|
-
|
|
36
|
-
- Commits tags on `Enter`, `,`, blur, or when pasting delimited text.
|
|
37
|
-
- `Backspace` on an empty input removes the last tag.
|
|
38
|
-
- Local errors (duplicate, max reached, `validate`) are shown inline.
|
|
39
|
-
|
|
40
|
-
## Stories
|
|
41
|
-
|
|
42
|
-
<Primary />
|
|
43
|
-
<Controls />
|
|
44
|
-
<Stories />
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import ITChipInput from "@/components/molecules/chip-input/chip-input";
|
|
4
|
-
|
|
5
|
-
const meta: Meta<typeof ITChipInput> = {
|
|
6
|
-
title: "Components/Form Elements/ITChipInput",
|
|
7
|
-
component: ITChipInput,
|
|
8
|
-
parameters: { layout: "centered" },
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export default meta;
|
|
12
|
-
type Story = StoryObj<typeof ITChipInput>;
|
|
13
|
-
|
|
14
|
-
const Wrapper = (args: any) => {
|
|
15
|
-
const [value, setValue] = useState<string[]>(args.value ?? []);
|
|
16
|
-
return (
|
|
17
|
-
<div className="w-[420px]">
|
|
18
|
-
<ITChipInput {...args} value={value} onChange={setValue} />
|
|
19
|
-
</div>
|
|
20
|
-
);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const Default: Story = {
|
|
24
|
-
render: (args) => <Wrapper {...args} />,
|
|
25
|
-
args: { name: "tags", label: "Etiquetas", value: [] },
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export const WithValues: Story = {
|
|
29
|
-
render: (args) => <Wrapper {...args} />,
|
|
30
|
-
args: { name: "tags", label: "Etiquetas", value: ["react", "typescript", "tailwind"] },
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const MaxTags: Story = {
|
|
34
|
-
render: (args) => <Wrapper {...args} />,
|
|
35
|
-
args: { name: "tags", label: "Máximo 3", value: ["uno", "dos"], maxTags: 3, helpText: "Máximo 3 etiquetas." },
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export const WithValidation: Story = {
|
|
39
|
-
render: (args) => <Wrapper {...args} />,
|
|
40
|
-
args: {
|
|
41
|
-
name: "emails",
|
|
42
|
-
label: "Correos",
|
|
43
|
-
value: [],
|
|
44
|
-
placeholder: "correo@dominio.com",
|
|
45
|
-
validate: (v: string) => (/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(v) ? undefined : "Correo inválido"),
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export const WithError: Story = {
|
|
50
|
-
render: (args) => <Wrapper {...args} />,
|
|
51
|
-
args: { name: "tags", label: "Etiquetas", value: [], required: true, touched: true, error: true },
|
|
52
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
-
import * as StoriesData from './date-picker.stories';
|
|
3
|
-
|
|
4
|
-
<Meta of={StoriesData} />
|
|
5
|
-
|
|
6
|
-
# ITDatePicker
|
|
7
|
-
|
|
8
|
-
A date picker supporting single date and date range selection. Includes built-in validation error display, min/max date constraints, and placeholder formatting.
|
|
9
|
-
|
|
10
|
-
## Props
|
|
11
|
-
|
|
12
|
-
| Prop | Type | Default | Description |
|
|
13
|
-
|------|------|---------|-------------|
|
|
14
|
-
| `name` | `string` | — | Unique name attribute for the input. |
|
|
15
|
-
| `value` | `Date \| [Date \| null, Date \| null]` | — | Selected date or start–end tuple when `range` is true. |
|
|
16
|
-
| `onChange` | `(event) => void` | — | Callback with `{ target: { name, value } }` on date selection. |
|
|
17
|
-
| `onBlur` | `(event) => void` | — | Callback when the input loses focus. |
|
|
18
|
-
| `range` | `boolean` | `false` | Enable date-range selection mode. |
|
|
19
|
-
| `variant` | `ColorsTypes` | `"primary"` | Color variant from design system. |
|
|
20
|
-
| `size` | `SizesTypes` | `"md"` | Size preset: `"sm"`, `"md"`, `"lg"`. |
|
|
21
|
-
| `className` | `string` | — | CSS classes for the wrapper. |
|
|
22
|
-
| `calendarClassName` | `string` | — | CSS classes for the calendar popover. |
|
|
23
|
-
| `disabled` | `boolean` | `false` | Disables the date picker. |
|
|
24
|
-
| `placeholder` | `string` | — | Placeholder text when no date is selected. |
|
|
25
|
-
| `label` | `string` | — | Accessible label rendered above the input. |
|
|
26
|
-
| `required` | `boolean` | — | Marks the field as required. |
|
|
27
|
-
| `touched` | `boolean` | — | Visually indicates the field has been interacted with. |
|
|
28
|
-
| `error` | `string \| boolean` | — | Error message string or `true` for default error styling. |
|
|
29
|
-
| `minDate` | `Date` | — | Earliest selectable date. |
|
|
30
|
-
| `maxDate` | `Date` | — | Latest selectable date. |
|
|
31
|
-
|
|
32
|
-
## Usage
|
|
33
|
-
|
|
34
|
-
```tsx
|
|
35
|
-
import { ITDatePicker } from '@axzydev/axzy_ui_system';
|
|
36
|
-
|
|
37
|
-
<ITDatePicker
|
|
38
|
-
name="birthdate"
|
|
39
|
-
label="Birth Date"
|
|
40
|
-
placeholder="DD/MM/YYYY"
|
|
41
|
-
value={date}
|
|
42
|
-
onChange={(e) => setDate(e.target.value)}
|
|
43
|
-
/>
|
|
44
|
-
|
|
45
|
-
<ITDatePicker
|
|
46
|
-
range
|
|
47
|
-
name="audit_range"
|
|
48
|
-
label="Audit Range"
|
|
49
|
-
value={range}
|
|
50
|
-
onChange={(e) => setRange(e.target.value)}
|
|
51
|
-
/>
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## Notes
|
|
55
|
-
|
|
56
|
-
- When `range` is true, `value` must be a tuple `[startDate, endDate]` and the onChange target value will be the same shape.
|
|
57
|
-
- The component emits a synthetic event with `target.name` and `target.value`, compatible with Formik integration.
|
|
58
|
-
- Error state is shown when both `error` and `touched` are truthy.
|
|
59
|
-
- Date format follows the locale configuration; placeholder text like `DD/MM/YYYY` guides the user.
|
|
60
|
-
|
|
61
|
-
## Stories
|
|
62
|
-
|
|
63
|
-
<Primary />
|
|
64
|
-
<Controls />
|
|
65
|
-
<Stories />
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import type { Meta } from '@storybook/react';
|
|
2
|
-
import ITDatePicker from './datePicker';
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'Components/Form Elements/ITDatePicker',
|
|
7
|
-
component: ITDatePicker,
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: 'padded',
|
|
10
|
-
},
|
|
11
|
-
argTypes: {
|
|
12
|
-
value: { control: 'date' },
|
|
13
|
-
minDate: { control: 'date' },
|
|
14
|
-
maxDate: { control: 'date' },
|
|
15
|
-
onChange: { action: 'changed' },
|
|
16
|
-
onBlur: { action: 'blurred' },
|
|
17
|
-
disabled: { control: 'boolean' },
|
|
18
|
-
error: { control: 'text' },
|
|
19
|
-
},
|
|
20
|
-
} satisfies Meta<typeof ITDatePicker>;
|
|
21
|
-
|
|
22
|
-
export default meta;
|
|
23
|
-
|
|
24
|
-
// Wrapper for controlled component state
|
|
25
|
-
const DatePickerWrapper = (args: any) => {
|
|
26
|
-
const [date, setDate] = useState<Date>(args.value || new Date());
|
|
27
|
-
|
|
28
|
-
const handleChange = (e: any) => {
|
|
29
|
-
// Handle both event types the component might emit
|
|
30
|
-
if (e.target && e.target.value) {
|
|
31
|
-
setDate(e.target.value instanceof Date ? e.target.value : new Date(e.target.value));
|
|
32
|
-
}
|
|
33
|
-
args.onChange(e);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
return <ITDatePicker {...args} value={date} onChange={handleChange} />;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export const Default: any = {
|
|
40
|
-
render: (args) => <DatePickerWrapper {...args} />,
|
|
41
|
-
args: {
|
|
42
|
-
name: 'birthdate',
|
|
43
|
-
label: 'Select Date',
|
|
44
|
-
placeholder: 'DD/MM/YYYY',
|
|
45
|
-
} as any,
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export const WithError: any = {
|
|
49
|
-
render: (args) => <DatePickerWrapper {...args} />,
|
|
50
|
-
args: {
|
|
51
|
-
name: 'error_date',
|
|
52
|
-
label: 'Invalid Date',
|
|
53
|
-
error: 'This field is required',
|
|
54
|
-
touched: true,
|
|
55
|
-
} as any,
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export const Disabled: any = {
|
|
59
|
-
args: {
|
|
60
|
-
name: 'disabled_date',
|
|
61
|
-
label: 'Disabled Input',
|
|
62
|
-
value: new Date(),
|
|
63
|
-
disabled: true,
|
|
64
|
-
} as any,
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
// Wrapper for range state
|
|
68
|
-
const RangePickerWrapper = (args: any) => {
|
|
69
|
-
const [range, setRange] = useState<[Date | null, Date | null]>([null, null]);
|
|
70
|
-
|
|
71
|
-
return (
|
|
72
|
-
<ITDatePicker
|
|
73
|
-
{...args}
|
|
74
|
-
value={range}
|
|
75
|
-
onChange={(e: any) => setRange(e.target.value)}
|
|
76
|
-
/>
|
|
77
|
-
);
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export const Range: any = {
|
|
81
|
-
render: (args) => <RangePickerWrapper {...args} />,
|
|
82
|
-
args: {
|
|
83
|
-
range: true,
|
|
84
|
-
name: 'audit_range',
|
|
85
|
-
label: 'Select Date Range',
|
|
86
|
-
placeholder: 'DD/MM/YYYY - DD/MM/YYYY',
|
|
87
|
-
} as any,
|
|
88
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
-
import * as StoriesData from './dropdown-menu.stories';
|
|
3
|
-
|
|
4
|
-
<Meta of={StoriesData} />
|
|
5
|
-
|
|
6
|
-
# ITDropdownMenu
|
|
7
|
-
|
|
8
|
-
Action menu with keyboard navigation and ARIA menu semantics. Rendered through a portal, so it is not clipped by cards or `overflow: hidden` ancestors.
|
|
9
|
-
|
|
10
|
-
## Props
|
|
11
|
-
|
|
12
|
-
| Prop | Type | Default | Description |
|
|
13
|
-
|------|------|---------|-------------|
|
|
14
|
-
| `items` | `ITDropdownMenuItem[]` | — | Actions: `{ id, label, icon?, shortcut?, onClick?, disabled?, danger?, divider? }`. |
|
|
15
|
-
| `trigger` | `ReactNode` | ellipsis icon | Custom trigger content. |
|
|
16
|
-
| `triggerLabel` | `string` | `"Abrir menú"` | Accessible label for the trigger. |
|
|
17
|
-
| `placement` | `"bottom-start" \| "bottom-end" \| "top-start" \| "top-end"` | `"bottom-end"` | Menu placement. |
|
|
18
|
-
| `onSelect` | `(id, item) => void` | — | Fired after an item is activated. |
|
|
19
|
-
| `disabled` | `boolean` | `false` | Disables the trigger. |
|
|
20
|
-
| `className` | `string` | — | Extra CSS classes for the trigger. |
|
|
21
|
-
| `menuClassName` | `string` | — | Extra CSS classes for the menu. |
|
|
22
|
-
|
|
23
|
-
## Usage
|
|
24
|
-
|
|
25
|
-
```tsx
|
|
26
|
-
import { ITDropdownMenu } from '@axzydev/axzy_ui_system';
|
|
27
|
-
|
|
28
|
-
<ITDropdownMenu
|
|
29
|
-
items={[
|
|
30
|
-
{ id: "edit", label: "Editar", icon: <FaEdit />, onClick: edit },
|
|
31
|
-
{ id: "delete", label: "Eliminar", icon: <FaTrash />, danger: true, divider: true, onClick: remove },
|
|
32
|
-
]}
|
|
33
|
-
/>
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## Notes
|
|
37
|
-
|
|
38
|
-
- Keyboard: `ArrowUp`/`ArrowDown` navigate, `Enter`/`Space` activate, `Esc` closes, `Home`/`End` jump.
|
|
39
|
-
- Uses `role="menu"` / `role="menuitem"` and `aria-haspopup` / `aria-expanded` on the trigger.
|
|
40
|
-
- The panel flips above the trigger automatically when there is no room below.
|
|
41
|
-
|
|
42
|
-
## Stories
|
|
43
|
-
|
|
44
|
-
<Primary />
|
|
45
|
-
<Controls />
|
|
46
|
-
<Stories />
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { FaEdit, FaCopy, FaTrash, FaDownload } from "react-icons/fa";
|
|
3
|
-
import ITDropdownMenu from "@/components/molecules/dropdown-menu/dropdown-menu";
|
|
4
|
-
import ITButton from "@/components/atoms/button/button";
|
|
5
|
-
|
|
6
|
-
const meta: Meta<typeof ITDropdownMenu> = {
|
|
7
|
-
title: "Components/Navigation/ITDropdownMenu",
|
|
8
|
-
component: ITDropdownMenu,
|
|
9
|
-
parameters: { layout: "centered" },
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export default meta;
|
|
13
|
-
type Story = StoryObj<typeof ITDropdownMenu>;
|
|
14
|
-
|
|
15
|
-
const items = [
|
|
16
|
-
{ id: "edit", label: "Editar", icon: <FaEdit />, onClick: () => alert("Editar") },
|
|
17
|
-
{ id: "copy", label: "Duplicar", icon: <FaCopy />, shortcut: "⌘D", onClick: () => alert("Duplicar") },
|
|
18
|
-
{ id: "download", label: "Descargar", icon: <FaDownload />, disabled: true },
|
|
19
|
-
{ id: "delete", label: "Eliminar", icon: <FaTrash />, danger: true, divider: true, onClick: () => alert("Eliminar") },
|
|
20
|
-
];
|
|
21
|
-
|
|
22
|
-
export const Default: Story = {
|
|
23
|
-
args: { items },
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const CustomTrigger: Story = {
|
|
27
|
-
args: {
|
|
28
|
-
items,
|
|
29
|
-
trigger: <span className="text-sm font-semibold px-1">Acciones</span>,
|
|
30
|
-
triggerLabel: "Acciones",
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export const WithLabelButton: Story = {
|
|
35
|
-
render: () => (
|
|
36
|
-
<div className="flex items-center gap-4">
|
|
37
|
-
<ITButton label="Guardar" variant="filled" color="primary" size="sm" />
|
|
38
|
-
<ITDropdownMenu items={items} />
|
|
39
|
-
</div>
|
|
40
|
-
),
|
|
41
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
-
import * as StoriesData from './empty-state.stories';
|
|
3
|
-
|
|
4
|
-
<Meta of={StoriesData} />
|
|
5
|
-
|
|
6
|
-
# ITEmptyState
|
|
7
|
-
|
|
8
|
-
A placeholder component for displaying a message when no data is available. Configurable icon, title, description, and an action slot for contextual buttons.
|
|
9
|
-
|
|
10
|
-
## Props
|
|
11
|
-
|
|
12
|
-
| Prop | Type | Default | Description |
|
|
13
|
-
|------|------|---------|-------------|
|
|
14
|
-
| `icon` | `ReactNode` | `<FaInbox size={40} />` | Icon or illustration displayed above the title. |
|
|
15
|
-
| `title` | `string` | — | Primary heading text (required). |
|
|
16
|
-
| `description` | `string` | — | Secondary explanatory text. |
|
|
17
|
-
| `action` | `ReactNode` | — | Action element (typically a button) rendered below the description. |
|
|
18
|
-
| `className` | `string` | — | Additional CSS classes for the wrapper. |
|
|
19
|
-
|
|
20
|
-
## Usage
|
|
21
|
-
|
|
22
|
-
```tsx
|
|
23
|
-
import { ITEmptyState } from '@axzydev/axzy_ui_system';
|
|
24
|
-
|
|
25
|
-
<ITEmptyState
|
|
26
|
-
title="No results"
|
|
27
|
-
description="No data found for the selected filters."
|
|
28
|
-
action={<ITButton label="Clear filters" variant="outlined" size="sm" />}
|
|
29
|
-
/>
|
|
30
|
-
|
|
31
|
-
<ITEmptyState
|
|
32
|
-
icon={<FaDatabase size={48} />}
|
|
33
|
-
title="No records"
|
|
34
|
-
description="Create your first record to get started."
|
|
35
|
-
action={<ITButton label="Create Record" variant="primary" />}
|
|
36
|
-
/>
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## Notes
|
|
40
|
-
|
|
41
|
-
- Default icon is `FaInbox` from react-icons — override with any ReactNode for custom illustrations.
|
|
42
|
-
- The `action` slot accepts any ReactNode, most commonly an `ITButton` for navigation or reset actions.
|
|
43
|
-
- Centers all content vertically and horizontally within its container.
|
|
44
|
-
- Works well as a fallback inside tables, cards, and search result containers.
|
|
45
|
-
|
|
46
|
-
## Stories
|
|
47
|
-
|
|
48
|
-
<Primary />
|
|
49
|
-
<Controls />
|
|
50
|
-
<Stories />
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import ITEmptyState from "@/components/molecules/empty-state/empty-state";
|
|
3
|
-
import ITButton from "@/components/atoms/button/button";
|
|
4
|
-
|
|
5
|
-
const meta: Meta<typeof ITEmptyState> = {
|
|
6
|
-
title: "Components/Data Display/ITEmptyState",
|
|
7
|
-
component: ITEmptyState,
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export default meta;
|
|
11
|
-
type Story = StoryObj<typeof ITEmptyState>;
|
|
12
|
-
|
|
13
|
-
export const Default: Story = {
|
|
14
|
-
args: {
|
|
15
|
-
title: "Sin resultados",
|
|
16
|
-
description: "No se encontraron datos para los filtros seleccionados.",
|
|
17
|
-
action: <ITButton label="Limpiar filtros" variant="outlined" size="sm" />,
|
|
18
|
-
},
|
|
19
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
-
import * as StoriesData from './field.stories';
|
|
3
|
-
|
|
4
|
-
<Meta of={StoriesData} />
|
|
5
|
-
|
|
6
|
-
# ITField
|
|
7
|
-
|
|
8
|
-
Form-field wrapper that standardizes label, required marker, helper text, and error message around any control.
|
|
9
|
-
|
|
10
|
-
## Props
|
|
11
|
-
|
|
12
|
-
| Prop | Type | Default | Description |
|
|
13
|
-
|------|------|---------|-------------|
|
|
14
|
-
| `label` | `string` | — | Label above the control. |
|
|
15
|
-
| `htmlFor` | `string` | — | `id` the label points to. |
|
|
16
|
-
| `required` | `boolean` | `false` | Shows a red asterisk. |
|
|
17
|
-
| `error` | `string \| boolean` | — | Error message, or `true` for the generic message. |
|
|
18
|
-
| `helpText` | `string` | — | Helper text shown when there is no error. |
|
|
19
|
-
| `children` | `ReactNode` | — | The form control. |
|
|
20
|
-
| `className` | `string` | — | Extra CSS classes for the wrapper. |
|
|
21
|
-
| `labelClassName` | `string` | — | Extra CSS classes for the label. |
|
|
22
|
-
| `contentClassName` | `string` | — | Extra CSS classes for the control container. |
|
|
23
|
-
|
|
24
|
-
## Usage
|
|
25
|
-
|
|
26
|
-
```tsx
|
|
27
|
-
import { ITField, ITInput } from '@axzydev/axzy_ui_system';
|
|
28
|
-
|
|
29
|
-
<ITField label="Email" htmlFor="email" required error={errors.email} helpText="We never share it.">
|
|
30
|
-
<ITInput name="email" value={email} onChange={onChange} />
|
|
31
|
-
</ITField>
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Notes
|
|
35
|
-
|
|
36
|
-
- Error text takes precedence over `helpText`; only one is shown at a time.
|
|
37
|
-
- `error={true}` renders the generic "Este campo es requerido" message.
|
|
38
|
-
|
|
39
|
-
## Stories
|
|
40
|
-
|
|
41
|
-
<Primary />
|
|
42
|
-
<Controls />
|
|
43
|
-
<Stories />
|