@axzydev/axzy_ui_system 1.2.7 → 1.2.8
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/dist/index.cjs +576 -398
- 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 +1463 -86
- package/dist/index.d.ts +1463 -86
- package/dist/index.js +597 -417
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/App.tsx +19 -54
- package/src/components/alert/alert.doc.mdx +48 -0
- package/src/components/alert/alert.props.ts +7 -0
- package/src/components/alert/alert.tsx +8 -0
- package/src/components/avatar/avatar.doc.mdx +48 -0
- package/src/components/avatar/avatar.props.ts +8 -0
- package/src/components/avatar/avatar.tsx +25 -5
- package/src/components/badget/badget.doc.mdx +46 -0
- package/src/components/badget/badget.props.ts +6 -0
- package/src/components/badget/badget.tsx +11 -0
- package/src/components/breadcrumbs/breadcrumbs.doc.mdx +57 -0
- package/src/components/breadcrumbs/breadcrumbs.props.ts +6 -0
- package/src/components/breadcrumbs/breadcrumbs.tsx +12 -0
- package/src/components/button/button.doc.mdx +59 -0
- package/src/components/button/button.props.ts +12 -0
- package/src/components/button/button.tsx +11 -0
- package/src/components/calendar/calendar.doc.mdx +75 -0
- package/src/components/calendar/calendar.props.ts +27 -7
- package/src/components/calendar/calendar.tsx +13 -0
- package/src/components/card/card.doc.mdx +54 -0
- package/src/components/card/card.props.ts +11 -0
- package/src/components/card/card.tsx +13 -0
- package/src/components/checkbox/checkbox.doc.mdx +54 -0
- package/src/components/checkbox/checkbox.props.ts +7 -0
- package/src/components/checkbox/checkbox.tsx +9 -0
- package/src/components/confirm-dialog/confirm-dialog.doc.mdx +60 -0
- package/src/components/confirm-dialog/confirm-dialog.props.ts +9 -0
- package/src/components/confirm-dialog/confirm-dialog.tsx +19 -0
- package/src/components/data-table/ITDataTable.doc.mdx +59 -0
- package/src/components/data-table/dataTable.props.ts +15 -0
- package/src/components/data-table/dataTable.tsx +178 -73
- package/src/components/date-picker/date-picker.doc.mdx +65 -0
- package/src/components/date-picker/date-picker.props.ts +17 -0
- package/src/components/date-picker/datePicker.tsx +31 -1
- package/src/components/dialog/dialog.doc.mdx +54 -0
- package/src/components/dialog/dialog.props.ts +7 -0
- package/src/components/dialog/dialog.tsx +26 -0
- package/src/components/divider/divider.doc.mdx +42 -0
- package/src/components/divider/divider.props.ts +5 -0
- package/src/components/divider/divider.tsx +16 -0
- package/src/components/drawer/drawer.doc.mdx +59 -0
- package/src/components/drawer/drawer.props.ts +9 -0
- package/src/components/drawer/drawer.tsx +20 -0
- package/src/components/dropfile/dropfile.doc.mdx +59 -0
- package/src/components/dropfile/dropfile.props.ts +41 -0
- package/src/components/dropfile/dropfile.tsx +21 -33
- package/src/components/empty-state/empty-state.doc.mdx +50 -0
- package/src/components/empty-state/empty-state.props.ts +5 -0
- package/src/components/empty-state/empty-state.tsx +16 -0
- package/src/components/flex/flex.doc.mdx +59 -0
- package/src/components/flex/flex.props.ts +13 -0
- package/src/components/flex/flex.tsx +15 -0
- package/src/components/form-builder/fieldRenderer.tsx +52 -2
- package/src/components/form-builder/formBuilder.doc.mdx +124 -0
- package/src/components/form-builder/formBuilder.props.ts +12 -2
- package/src/components/form-builder/formBuilder.tsx +31 -0
- package/src/components/form-header/form-header.doc.mdx +38 -0
- package/src/components/form-header/form-header.props.ts +3 -0
- package/src/components/form-header/form-header.stories.tsx +53 -0
- package/src/components/form-header/form-header.tsx +11 -0
- package/src/components/grid/grid.doc.mdx +54 -0
- package/src/components/grid/grid.props.ts +13 -0
- package/src/components/grid/grid.tsx +19 -0
- package/src/components/image/image.doc.mdx +44 -0
- package/src/components/image/image.props.ts +5 -0
- package/src/components/image/image.stories.tsx +49 -0
- package/src/components/image/image.tsx +19 -0
- package/src/components/input/input.doc.mdx +70 -0
- package/src/components/input/input.props.ts +34 -2
- package/src/components/input/input.tsx +29 -0
- package/src/components/layout/layout.doc.mdx +51 -0
- package/src/components/layout/layout.props.ts +5 -0
- package/src/components/layout/layout.tsx +29 -2
- package/src/components/loader/loader.doc.mdx +43 -0
- package/src/components/loader/loader.props.ts +4 -0
- package/src/components/loader/loader.tsx +17 -0
- package/src/components/navbar/navbar.doc.mdx +77 -0
- package/src/components/navbar/navbar.props.ts +37 -1
- package/src/components/navbar/navbar.stories.tsx +84 -0
- package/src/components/navbar/navbar.tsx +27 -0
- package/src/components/page/page.doc.mdx +80 -0
- package/src/components/page/page.props.ts +21 -0
- package/src/components/page/page.tsx +18 -0
- package/src/components/page-header/page-header.doc.mdx +54 -0
- package/src/components/page-header/page-header.props.ts +9 -0
- package/src/components/page-header/page-header.tsx +15 -0
- package/src/components/pagination/pagination.doc.mdx +62 -0
- package/src/components/pagination/pagination.props.ts +11 -32
- package/src/components/pagination/pagination.tsx +17 -0
- package/src/components/popover/popover.doc.mdx +53 -0
- package/src/components/popover/popover.props.ts +8 -0
- package/src/components/popover/popover.tsx +13 -0
- package/src/components/progress/progress.doc.mdx +48 -0
- package/src/components/progress/progress.props.ts +8 -0
- package/src/components/progress/progress.tsx +9 -0
- package/src/components/radio/radio.doc.mdx +62 -0
- package/src/components/radio/radio.props.ts +11 -0
- package/src/components/radio/radio.tsx +18 -0
- package/src/components/search-select/search-select.doc.mdx +72 -0
- package/src/components/search-select/search-select.props.ts +23 -18
- package/src/components/search-select/search-select.tsx +27 -2
- package/src/components/searchTable/searchTable.doc.mdx +79 -0
- package/src/components/searchTable/searchTable.props.ts +42 -3
- package/src/components/searchTable/searchTable.stories.tsx +74 -0
- package/src/components/searchTable/searchTable.tsx +23 -0
- package/src/components/segmented-control/segmented-control.doc.mdx +60 -0
- package/src/components/segmented-control/segmented-control.props.ts +12 -0
- package/src/components/segmented-control/segmented-control.tsx +15 -0
- package/src/components/select/select.doc.mdx +75 -0
- package/src/components/select/select.props.ts +22 -0
- package/src/components/select/select.tsx +2 -5
- package/src/components/sidebar/sidebar.doc.mdx +86 -0
- package/src/components/sidebar/sidebar.props.ts +22 -0
- package/src/components/sidebar/sidebar.tsx +22 -0
- package/src/components/skeleton/skeleton.doc.mdx +43 -0
- package/src/components/skeleton/skeleton.props.ts +8 -0
- package/src/components/skeleton/skeleton.tsx +10 -0
- package/src/components/slide/slide.doc.mdx +46 -0
- package/src/components/slide/slide.props.ts +11 -24
- package/src/components/slide/slide.tsx +10 -1
- package/src/components/slider/slider.doc.mdx +49 -0
- package/src/components/slider/slider.props.ts +9 -0
- package/src/components/slider/slider.tsx +15 -0
- package/src/components/stack/stack.doc.mdx +126 -0
- package/src/components/stack/stack.props.ts +18 -0
- package/src/components/stack/stack.stories.tsx +221 -16
- package/src/components/stack/stack.tsx +21 -0
- package/src/components/stat-card/stat-card.doc.mdx +48 -0
- package/src/components/stat-card/stat-card.props.ts +9 -0
- package/src/components/stat-card/stat-card.tsx +10 -0
- package/src/components/stepper/stepper.doc.mdx +54 -0
- package/src/components/stepper/stepper.props.ts +11 -1
- package/src/components/stepper/stepper.tsx +15 -0
- package/src/components/table/table.doc.mdx +58 -0
- package/src/components/table/table.props.ts +17 -0
- package/src/components/table/table.tsx +199 -84
- package/src/components/tabs/tabs.doc.mdx +52 -0
- package/src/components/tabs/tabs.props.ts +11 -0
- package/src/components/tabs/tabs.tsx +14 -0
- package/src/components/text/text.doc.mdx +41 -0
- package/src/components/text/text.props.ts +5 -0
- package/src/components/text/text.stories.tsx +67 -0
- package/src/components/text/text.tsx +10 -0
- package/src/components/textarea/textarea.doc.mdx +64 -0
- package/src/components/textarea/textarea.props.ts +11 -0
- package/src/components/textarea/textarea.tsx +16 -0
- package/src/components/theme-provider/themeProvider.doc.mdx +75 -0
- package/src/components/theme-provider/themeProvider.props.ts +3 -0
- package/src/components/theme-provider/themeProvider.stories.tsx +59 -0
- package/src/components/theme-provider/themeProvider.tsx +14 -0
- package/src/components/time-picker/timePicker.doc.mdx +68 -0
- package/src/components/time-picker/timePicker.props.ts +14 -0
- package/src/components/time-picker/timePicker.tsx +22 -1
- package/src/components/toast/toast.doc.mdx +50 -0
- package/src/components/toast/toast.props.ts +5 -0
- package/src/components/toast/toast.tsx +21 -0
- package/src/components/tooltip/tooltip.doc.mdx +47 -0
- package/src/components/tooltip/tooltip.props.ts +6 -0
- package/src/components/tooltip/tooltip.tsx +19 -0
- package/src/components/topbar/topbar.doc.mdx +69 -0
- package/src/components/topbar/topbar.props.ts +15 -0
- package/src/components/topbar/topbar.tsx +38 -0
- package/src/components/triple-filter/tripleFilter.doc.mdx +62 -0
- package/src/components/triple-filter/tripleFilter.props.ts +7 -0
- package/src/components/triple-filter/tripleFilter.tsx +32 -0
- package/src/index.css +2 -0
- package/src/showcases/DataShowcases.tsx +529 -45
- package/src/showcases/FormShowcases.tsx +399 -29
- package/src/showcases/HomeShowcase.tsx +252 -272
- package/src/showcases/LayoutPrimitivesShowcases.tsx +1224 -248
- package/src/showcases/PageShowcases.tsx +688 -391
- package/src/showcases/ShowcaseLayout.tsx +237 -73
- package/src/showcases/StructureShowcases.tsx +846 -73
- package/src/types/table.types.ts +1 -1
- package/src/utils/styles.ts +2 -1
|
@@ -1,25 +1,46 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { ITBreadcrumbItem } from "../breadcrumbs/breadcrumbs.props";
|
|
3
3
|
|
|
4
|
+
/** Props for the ITPage component. */
|
|
4
5
|
export interface ITPageProps {
|
|
6
|
+
/** Page title passed to the header. */
|
|
5
7
|
title?: string;
|
|
8
|
+
/** Description text shown below the title. */
|
|
6
9
|
description?: string;
|
|
10
|
+
/** Array of breadcrumb items for navigation context. */
|
|
7
11
|
breadcrumbs?: ITBreadcrumbItem[];
|
|
12
|
+
/** Action buttons rendered in the header. */
|
|
8
13
|
actions?: ReactNode;
|
|
14
|
+
/** Callback fired when the back button is clicked. */
|
|
9
15
|
backAction?: () => void;
|
|
16
|
+
/** Optional icon displayed next to the title. */
|
|
10
17
|
icon?: ReactNode;
|
|
18
|
+
/** Custom color for the icon. Accepts any valid CSS color value. */
|
|
11
19
|
iconColor?: string;
|
|
20
|
+
/** Whether the page is in a loading state. Shows skeleton placeholders when true. */
|
|
12
21
|
loading?: boolean;
|
|
22
|
+
/** Error message to display. Shows an error state with retry button when provided. */
|
|
13
23
|
error?: string | null;
|
|
24
|
+
/** Custom title for the error state. Default: "Error". */
|
|
14
25
|
errorTitle?: string;
|
|
26
|
+
/** Label for the retry button in the error state. Default: "Reintentar". */
|
|
15
27
|
errorActionLabel?: string;
|
|
28
|
+
/** Callback fired when the retry button is clicked in the error state. */
|
|
16
29
|
onRetry?: () => void;
|
|
30
|
+
/** Whether the page is in an empty state. Shows a placeholder when true. */
|
|
17
31
|
empty?: boolean;
|
|
32
|
+
/** Custom title for the empty state. Default: "Sin datos". */
|
|
18
33
|
emptyTitle?: string;
|
|
34
|
+
/** Custom description for the empty state. */
|
|
19
35
|
emptyDescription?: string;
|
|
36
|
+
/** Custom action element for the empty state. */
|
|
20
37
|
emptyAction?: ReactNode;
|
|
38
|
+
/** Additional CSS classes for the page wrapper. */
|
|
21
39
|
className?: string;
|
|
40
|
+
/** Content rendered inside the page wrapper. */
|
|
22
41
|
children: ReactNode;
|
|
42
|
+
/** Maximum width of the page content. Options: "2xl", "3xl", "4xl", "5xl", "6xl", "7xl". Default: "7xl". */
|
|
23
43
|
maxWidth?: "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl";
|
|
44
|
+
/** Whether to remove default padding from the page wrapper. */
|
|
24
45
|
noPadding?: boolean;
|
|
25
46
|
}
|
|
@@ -24,6 +24,24 @@ const renderHeader = (props: ITPageProps) => {
|
|
|
24
24
|
);
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Page template combining a page header and content area with built-in states for loading, error, and empty.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <ITPage
|
|
33
|
+
* title="Dashboard"
|
|
34
|
+
* description="Overview of your account"
|
|
35
|
+
* breadcrumbs={[{ label: 'Home' }, { label: 'Dashboard' }]}
|
|
36
|
+
* actions={<ITButton label="Refresh" />}
|
|
37
|
+
* loading={isLoading}
|
|
38
|
+
* error={errorMessage}
|
|
39
|
+
* onRetry={fetchData}
|
|
40
|
+
* >
|
|
41
|
+
* <ITCard>Dashboard content</ITCard>
|
|
42
|
+
* </ITPage>
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
27
45
|
export default function ITPage(props: ITPageProps) {
|
|
28
46
|
const {
|
|
29
47
|
loading = false,
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
+
import * as Stories from './page-header.stories';
|
|
3
|
+
|
|
4
|
+
<Meta of={Stories} />
|
|
5
|
+
|
|
6
|
+
# ITPageHeader
|
|
7
|
+
|
|
8
|
+
A page title bar component that displays a heading with optional breadcrumbs, description text, action buttons, and a back navigation button. Designed to sit at the top of page content for consistent page-level navigation.
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
|
|
12
|
+
| Prop | Type | Default | Description |
|
|
13
|
+
|------|------|---------|-------------|
|
|
14
|
+
| `title` | `string` | required | Page title displayed as the main heading. |
|
|
15
|
+
| `description` | `string` | `undefined` | Optional description text shown below the title. |
|
|
16
|
+
| `breadcrumbs` | `ITBreadcrumbItem[]` | `undefined` | Breadcrumb navigation items above the title. |
|
|
17
|
+
| `actions` | `ReactNode` | `undefined` | Action buttons or elements rendered on the right side. |
|
|
18
|
+
| `backAction` | `() => void` | `undefined` | Callback fired when the back button is clicked. |
|
|
19
|
+
| `icon` | `ReactNode` | `undefined` | Optional icon displayed next to the title. |
|
|
20
|
+
| `iconColor` | `string` | `undefined` | Custom CSS color value for the icon. |
|
|
21
|
+
| `className` | `string` | `undefined` | Additional CSS classes for the container. |
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import { ITPageHeader } from '@axzydev/axzy_ui_system';
|
|
27
|
+
import { FaUsers } from 'react-icons/fa';
|
|
28
|
+
|
|
29
|
+
<ITPageHeader
|
|
30
|
+
title="Users"
|
|
31
|
+
description="Manage system users"
|
|
32
|
+
breadcrumbs={[{ label: 'Dashboard', href: '#' }, { label: 'Users' }]}
|
|
33
|
+
actions={<ITButton label="Add User" />}
|
|
34
|
+
/>
|
|
35
|
+
<ITPageHeader
|
|
36
|
+
title="Edit User"
|
|
37
|
+
backAction={() => navigate(-1)}
|
|
38
|
+
breadcrumbs={[{ label: 'Users', href: '/users' }, { label: 'Edit' }]}
|
|
39
|
+
/>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Notes
|
|
43
|
+
|
|
44
|
+
- Breadcrumbs render above the title using the ITBreadcrumbs component.
|
|
45
|
+
- `backAction` renders a left-arrow button before the content; breadcrumbs shift to the right of the back button.
|
|
46
|
+
- The `icon` slot places an icon beside the title, colored by `iconColor` or the primary theme color.
|
|
47
|
+
- Actions area accepts any React nodes; typically ITButton components with `small` sizing.
|
|
48
|
+
- The component uses a flex layout: breadcrumbs + back button on the left, actions on the right.
|
|
49
|
+
|
|
50
|
+
## Stories
|
|
51
|
+
|
|
52
|
+
<Primary />
|
|
53
|
+
<Controls />
|
|
54
|
+
<Stories />
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { ITBreadcrumbItem } from "../breadcrumbs/breadcrumbs.props";
|
|
3
3
|
|
|
4
|
+
/** Props for the ITPageHeader component. */
|
|
4
5
|
export interface ITPageHeaderProps {
|
|
6
|
+
/** Page title displayed as the main heading. */
|
|
5
7
|
title: string;
|
|
8
|
+
/** Optional description text shown below the title. */
|
|
6
9
|
description?: string;
|
|
10
|
+
/** Array of breadcrumb items for navigation context. */
|
|
7
11
|
breadcrumbs?: ITBreadcrumbItem[];
|
|
12
|
+
/** Action buttons or elements rendered on the right side. */
|
|
8
13
|
actions?: ReactNode;
|
|
14
|
+
/** Callback fired when the back button is clicked. */
|
|
9
15
|
backAction?: () => void;
|
|
16
|
+
/** Optional icon displayed next to the title. */
|
|
10
17
|
icon?: ReactNode;
|
|
18
|
+
/** Custom color for the icon. Accepts any valid CSS color value. */
|
|
11
19
|
iconColor?: string;
|
|
20
|
+
/** Additional CSS classes for the container. */
|
|
12
21
|
className?: string;
|
|
13
22
|
}
|
|
@@ -3,6 +3,21 @@ import { ITPageHeaderProps } from "./page-header.props";
|
|
|
3
3
|
import ITBreadcrumbs from "../breadcrumbs/breadcrumbs";
|
|
4
4
|
import ITText from "@/components/text/text";
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Page title bar with breadcrumbs, description, back button, and action buttons.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <ITPageHeader
|
|
12
|
+
* title="Users"
|
|
13
|
+
* description="Manage all system users"
|
|
14
|
+
* breadcrumbs={[{ label: 'Admin', href: '/admin' }, { label: 'Users' }]}
|
|
15
|
+
* backAction={() => history.back()}
|
|
16
|
+
* actions={<ITButton label="Add User" />}
|
|
17
|
+
* icon={<FaUsers />}
|
|
18
|
+
* />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
6
21
|
export default function ITPageHeader({
|
|
7
22
|
title,
|
|
8
23
|
description,
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
+
import * as Stories from './pagination.stories';
|
|
3
|
+
|
|
4
|
+
<Meta of={Stories} />
|
|
5
|
+
|
|
6
|
+
# ITPagination
|
|
7
|
+
|
|
8
|
+
Page navigation with current/total pages display, first/last buttons, sibling page count control, and an optional items-per-page selector with summary text.
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
|
|
12
|
+
| Prop | Type | Default | Description |
|
|
13
|
+
|------|------|---------|-------------|
|
|
14
|
+
| `currentPage` | `number` | — | Current active page (1-indexed). |
|
|
15
|
+
| `totalPages` | `number` | — | Total number of pages available. |
|
|
16
|
+
| `onPageChange` | `(page: number) => void` | — | Callback fired when a page is clicked or prev/next is activated. |
|
|
17
|
+
| `siblingCount` | `number` | `1` | Number of visible page siblings before and after the current page. |
|
|
18
|
+
| `color` | `"primary" \| "secondary" \| "success" \| "danger" \| "warning" \| "info" \| "purple"` | `"primary"` | Semantic color for active page and buttons. |
|
|
19
|
+
| `className` | `string` | — | Additional CSS classes for the container. |
|
|
20
|
+
| `itemsPerPageOptions` | `number[]` | — | Available options for the items-per-page selector dropdown. |
|
|
21
|
+
| `itemsPerPage` | `number` | — | Current items per page value. Required if `itemsPerPageOptions` is provided. |
|
|
22
|
+
| `onItemsPerPageChange` | `(value: number) => void` | — | Callback fired when the items per page value is changed. |
|
|
23
|
+
| `totalItems` | `number` | — | Total number of items across all pages. Used for the "1-10 of 50" summary text. |
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
import { ITPagination } from '@axzydev/axzy_ui_system';
|
|
29
|
+
|
|
30
|
+
<ITPagination
|
|
31
|
+
currentPage={1}
|
|
32
|
+
totalPages={5}
|
|
33
|
+
onPageChange={(page) => setCurrentPage(page)}
|
|
34
|
+
/>
|
|
35
|
+
|
|
36
|
+
<ITPagination
|
|
37
|
+
currentPage={1}
|
|
38
|
+
totalPages={50}
|
|
39
|
+
siblingCount={2}
|
|
40
|
+
color="primary"
|
|
41
|
+
onPageChange={(page) => setCurrentPage(page)}
|
|
42
|
+
itemsPerPageOptions={[10, 20, 30, 50]}
|
|
43
|
+
itemsPerPage={10}
|
|
44
|
+
onItemsPerPageChange={(val) => setItemsPerPage(val)}
|
|
45
|
+
totalItems={500}
|
|
46
|
+
/>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Notes
|
|
50
|
+
|
|
51
|
+
- First and last page buttons are always visible for quick navigation.
|
|
52
|
+
- Ellipsis indicators appear when sibling gaps exceed the page range.
|
|
53
|
+
- The `siblingCount` prop controls how many page numbers appear around the current page.
|
|
54
|
+
- All seven semantic colors are supported for the active page highlight.
|
|
55
|
+
- When `itemsPerPageOptions` is provided, a dropdown and summary text render alongside pagination.
|
|
56
|
+
- Compatible with server-side pagination via the `currentPage` and `onPageChange` controlled pattern.
|
|
57
|
+
|
|
58
|
+
## Stories
|
|
59
|
+
|
|
60
|
+
<Primary />
|
|
61
|
+
<Controls />
|
|
62
|
+
<Stories />
|
|
@@ -1,53 +1,32 @@
|
|
|
1
|
+
/** Props for the ITPagination component. */
|
|
1
2
|
export interface ITPaginationProps {
|
|
2
|
-
/**
|
|
3
|
-
* Current active page (1-indexed).
|
|
4
|
-
*/
|
|
3
|
+
/** Current active page (1-indexed). */
|
|
5
4
|
currentPage: number;
|
|
6
5
|
|
|
7
|
-
/**
|
|
8
|
-
* Total number of pages available.
|
|
9
|
-
*/
|
|
6
|
+
/** Total number of pages available. */
|
|
10
7
|
totalPages: number;
|
|
11
8
|
|
|
12
|
-
/**
|
|
13
|
-
* Callback fired when a page is clicked or next/prev is activated.
|
|
14
|
-
*/
|
|
9
|
+
/** Callback fired when a page is clicked or prev/next is activated. Receives the new page number. */
|
|
15
10
|
onPageChange: (page: number) => void;
|
|
16
11
|
|
|
17
|
-
/**
|
|
18
|
-
* Number of visible pages before and after the current page.
|
|
19
|
-
* Default: 1
|
|
20
|
-
*/
|
|
12
|
+
/** Number of visible page siblings before and after the current page. Default: 1. */
|
|
21
13
|
siblingCount?: number;
|
|
22
14
|
|
|
23
|
-
/**
|
|
24
|
-
* Semantic color from the theme (primary, secondary, success, danger, warning, info, purple).
|
|
25
|
-
* Default: primary
|
|
26
|
-
*/
|
|
15
|
+
/** Semantic color from the theme. Options: primary, secondary, success, danger, warning, info, purple. Default: "primary". */
|
|
27
16
|
color?: string;
|
|
28
17
|
|
|
29
|
-
/**
|
|
30
|
-
* Additional CSS classes for the container.
|
|
31
|
-
*/
|
|
18
|
+
/** Additional CSS classes for the container. */
|
|
32
19
|
className?: string;
|
|
33
20
|
|
|
34
|
-
/**
|
|
35
|
-
* Options for items per page selector.
|
|
36
|
-
*/
|
|
21
|
+
/** Available options for the items-per-page selector dropdown. */
|
|
37
22
|
itemsPerPageOptions?: number[];
|
|
38
23
|
|
|
39
|
-
/**
|
|
40
|
-
* Current items per page value. Required if itemsPerPageOptions is provided.
|
|
41
|
-
*/
|
|
24
|
+
/** Current items per page value. Required if `itemsPerPageOptions` is provided. */
|
|
42
25
|
itemsPerPage?: number;
|
|
43
26
|
|
|
44
|
-
/**
|
|
45
|
-
* Callback fired when items per page is changed.
|
|
46
|
-
*/
|
|
27
|
+
/** Callback fired when the items per page value is changed. */
|
|
47
28
|
onItemsPerPageChange?: (value: number) => void;
|
|
48
29
|
|
|
49
|
-
/**
|
|
50
|
-
* Total number of items across all pages. Used to render "1-10 of 50" text.
|
|
51
|
-
*/
|
|
30
|
+
/** Total number of items across all pages. Used to render the "1-10 of 50" summary text. */
|
|
52
31
|
totalItems?: number;
|
|
53
32
|
}
|
|
@@ -74,6 +74,23 @@ const usePagination = ({
|
|
|
74
74
|
}, [totalPages, currentPage, siblingCount]);
|
|
75
75
|
};
|
|
76
76
|
|
|
77
|
+
/**
|
|
78
|
+
* Page navigation controls with previous/next buttons, page number display, and optional items-per-page selector.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```tsx
|
|
82
|
+
* <ITPagination
|
|
83
|
+
* currentPage={1}
|
|
84
|
+
* totalPages={10}
|
|
85
|
+
* onPageChange={(page) => setPage(page)}
|
|
86
|
+
* color="primary"
|
|
87
|
+
* itemsPerPageOptions={[10, 25, 50]}
|
|
88
|
+
* itemsPerPage={10}
|
|
89
|
+
* onItemsPerPageChange={(value) => setItemsPerPage(value)}
|
|
90
|
+
* totalItems={95}
|
|
91
|
+
* />
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
77
94
|
export default function ITPagination({
|
|
78
95
|
currentPage,
|
|
79
96
|
totalPages,
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
+
import * as Stories from './popover.stories';
|
|
3
|
+
|
|
4
|
+
<Meta of={Stories} />
|
|
5
|
+
|
|
6
|
+
# ITPopover
|
|
7
|
+
|
|
8
|
+
Floating content panel triggered by click on a trigger element. Supports four position placements and offers both uncontrolled (click toggle) and controlled (`isOpen`/`onClose`) modes.
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
|
|
12
|
+
| Prop | Type | Default | Description |
|
|
13
|
+
|------|------|---------|-------------|
|
|
14
|
+
| `trigger` | `ReactNode` | — | Element that triggers the popover when clicked. |
|
|
15
|
+
| `children` | `ReactNode` | — | Content rendered inside the popover panel. |
|
|
16
|
+
| `position` | `"top" \| "bottom" \| "left" \| "right"` | `"bottom"` | Position of the popover relative to the trigger element. |
|
|
17
|
+
| `isOpen` | `boolean` | — | Controlled open state. When provided, the component acts in controlled mode. |
|
|
18
|
+
| `onClose` | `() => void` | — | Callback fired when the popover is closed in controlled mode. |
|
|
19
|
+
| `className` | `string` | — | Additional CSS classes for the container. |
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { ITPopover } from '@axzydev/axzy_ui_system';
|
|
25
|
+
|
|
26
|
+
<ITPopover trigger={<ITButton label="Abrir" />}>
|
|
27
|
+
<button>Editar</button>
|
|
28
|
+
<button>Eliminar</button>
|
|
29
|
+
</ITPopover>
|
|
30
|
+
|
|
31
|
+
<ITPopover
|
|
32
|
+
trigger={<ITButton label="Controlled" />}
|
|
33
|
+
position="top"
|
|
34
|
+
isOpen={open}
|
|
35
|
+
onClose={() => setOpen(false)}
|
|
36
|
+
>
|
|
37
|
+
<p>Contenido controlado</p>
|
|
38
|
+
</ITPopover>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Notes
|
|
42
|
+
|
|
43
|
+
- Default mode is uncontrolled: clicking the trigger toggles the popover open/closed.
|
|
44
|
+
- Controlled mode via `isOpen` and `onClose` allows external state management.
|
|
45
|
+
- Four positions available: `top`, `bottom`, `left`, `right` relative to the trigger element.
|
|
46
|
+
- Popover is dismissed automatically when clicking outside the panel.
|
|
47
|
+
- Ideal for dropdown menus, action lists, and contextual tool panels.
|
|
48
|
+
|
|
49
|
+
## Stories
|
|
50
|
+
|
|
51
|
+
<Primary />
|
|
52
|
+
<Controls />
|
|
53
|
+
<Stories />
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
|
|
3
|
+
/** Available positions for the popover relative to the trigger element. */
|
|
3
4
|
export type PopoverPosition = "top" | "bottom" | "left" | "right";
|
|
4
5
|
|
|
6
|
+
/** Props for the ITPopover component. */
|
|
5
7
|
export interface ITPopoverProps {
|
|
8
|
+
/** Element that triggers the popover when clicked. */
|
|
6
9
|
trigger: ReactNode;
|
|
10
|
+
/** Content rendered inside the popover panel. */
|
|
7
11
|
children: ReactNode;
|
|
12
|
+
/** Position of the popover relative to the trigger. Options: "top", "bottom", "left", "right". Default: "bottom". */
|
|
8
13
|
position?: PopoverPosition;
|
|
14
|
+
/** Controlled open state. When provided, the component acts in controlled mode. */
|
|
9
15
|
isOpen?: boolean;
|
|
16
|
+
/** Callback fired when the popover is closed in controlled mode. */
|
|
10
17
|
onClose?: () => void;
|
|
18
|
+
/** Additional CSS classes for the container. */
|
|
11
19
|
className?: string;
|
|
12
20
|
}
|
|
@@ -10,6 +10,19 @@ const positionClasses: Record<PopoverPosition, string> = {
|
|
|
10
10
|
right: "left-full top-1/2 -translate-y-1/2 ml-2",
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Floating content panel triggered by click on a trigger element, with position control and click-outside dismissal.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <ITPopover trigger={<ITButton label="Options" />} position="bottom">
|
|
19
|
+
* <ul>
|
|
20
|
+
* <li><button onClick={handleEdit}>Edit</button></li>
|
|
21
|
+
* <li><button onClick={handleDelete}>Delete</button></li>
|
|
22
|
+
* </ul>
|
|
23
|
+
* </ITPopover>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
13
26
|
export default function ITPopover({
|
|
14
27
|
trigger,
|
|
15
28
|
children,
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
+
import * as Stories from './progress.stories';
|
|
3
|
+
|
|
4
|
+
<Meta of={Stories} />
|
|
5
|
+
|
|
6
|
+
# ITProgress
|
|
7
|
+
|
|
8
|
+
Progress indicator with determinate and indeterminate variants. Supports multiple semantic colors and three sizes for indicating completion or loading states.
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
|
|
12
|
+
| Prop | Type | Default | Description |
|
|
13
|
+
|------|------|---------|-------------|
|
|
14
|
+
| `value` | `number` | `0` | Current progress value. |
|
|
15
|
+
| `max` | `number` | `100` | Maximum progress value. |
|
|
16
|
+
| `variant` | `"determinate" \| "indeterminate"` | `"determinate"` | Progress variant. `"determinate"` shows a fixed-width fill, `"indeterminate"` shows an animated pulsing bar. |
|
|
17
|
+
| `color` | `"primary" \| "secondary" \| "success" \| "danger" \| "warning" \| "info" \| "purple" \| "error" \| "gray"` | `"primary"` | Semantic color for the progress fill. |
|
|
18
|
+
| `size` | `"sm" \| "md" \| "lg"` | `"md"` | Height and visual scale of the progress bar. |
|
|
19
|
+
| `className` | `string` | — | Additional CSS classes for the container. |
|
|
20
|
+
| `style` | `CSSProperties` | — | Inline styles applied to the container. |
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import { ITProgress } from '@axzydev/axzy_ui_system';
|
|
26
|
+
|
|
27
|
+
<ITProgress value={70} />
|
|
28
|
+
|
|
29
|
+
<ITProgress value={45} color="success" size="lg" />
|
|
30
|
+
|
|
31
|
+
<ITProgress variant="indeterminate" />
|
|
32
|
+
|
|
33
|
+
<ITProgress value={90} color="danger" size="sm" />
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Notes
|
|
37
|
+
|
|
38
|
+
- `determinate` mode shows a solid fill proportional to `value / max`.
|
|
39
|
+
- `indeterminate` mode renders a continuous animated bar for loading states where progress is unknown.
|
|
40
|
+
- All nine semantic colors are available for the fill.
|
|
41
|
+
- Sizes `sm`, `md`, and `lg` control bar height and overall scale.
|
|
42
|
+
- Use `style` for custom width or container-level overrides.
|
|
43
|
+
|
|
44
|
+
## Stories
|
|
45
|
+
|
|
46
|
+
<Primary />
|
|
47
|
+
<Controls />
|
|
48
|
+
<Stories />
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import { CSSProperties } from "react";
|
|
2
2
|
import { ColorsTypes } from "@/types/colors.types";
|
|
3
3
|
|
|
4
|
+
/** Props for the ITProgress component. */
|
|
4
5
|
export interface ITProgressProps {
|
|
6
|
+
/** Current progress value. Default: 0. */
|
|
5
7
|
value?: number;
|
|
8
|
+
/** Maximum progress value. Default: 100. */
|
|
6
9
|
max?: number;
|
|
10
|
+
/** Progress variant. "determinate" shows a fixed-width fill, "indeterminate" shows an animated pulsing bar. Default: "determinate". */
|
|
7
11
|
variant?: "determinate" | "indeterminate";
|
|
12
|
+
/** Semantic color from the theme. Options: primary, secondary, success, danger, warning, info, purple, error, gray. Default: "primary". */
|
|
8
13
|
color?: ColorsTypes;
|
|
14
|
+
/** Size of the progress bar. Options: "sm", "md", "lg". Default: "md". */
|
|
9
15
|
size?: "sm" | "md" | "lg";
|
|
16
|
+
/** Additional CSS classes for the container. */
|
|
10
17
|
className?: string;
|
|
18
|
+
/** Inline styles applied to the container. */
|
|
11
19
|
style?: CSSProperties;
|
|
12
20
|
}
|
|
@@ -20,6 +20,15 @@ const sizeMap = {
|
|
|
20
20
|
lg: "h-3",
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Progress bar indicator with support for determinate and indeterminate variants, themed colors, and multiple sizes.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* <ITProgress value={75} max={100} color="success" size="lg" />
|
|
29
|
+
* <ITProgress variant="indeterminate" color="primary" />
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
23
32
|
export default function ITProgress({
|
|
24
33
|
value = 0,
|
|
25
34
|
max = 100,
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
+
import * as Stories from './radio.stories';
|
|
3
|
+
|
|
4
|
+
<Meta of={Stories} />
|
|
5
|
+
|
|
6
|
+
# ITRadioGroup
|
|
7
|
+
|
|
8
|
+
Radio button group for selecting a single option from a set. Supports horizontal and vertical layouts, disabled state, and an options-array API for declarative rendering.
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
|
|
12
|
+
| Prop | Type | Default | Description |
|
|
13
|
+
|------|------|---------|-------------|
|
|
14
|
+
| `name` | `string` | — | Name attribute for the radio input group. Used for form accessibility. |
|
|
15
|
+
| `value` | `string` | — | Currently selected value (controlled). |
|
|
16
|
+
| `onChange` | `(value: string) => void` | — | Callback fired when a radio option is selected. |
|
|
17
|
+
| `options` | `ITRadioOption[]` | — | Array of radio options: `{ value: string, label: ReactNode }`. |
|
|
18
|
+
| `disabled` | `boolean` | `false` | Whether the entire radio group is disabled. |
|
|
19
|
+
| `direction` | `"row" \| "column"` | `"column"` | Layout direction of the radio options. |
|
|
20
|
+
| `className` | `string` | — | Additional CSS classes for the container. |
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import { ITRadioGroup } from '@axzydev/axzy_ui_system';
|
|
26
|
+
|
|
27
|
+
<ITRadioGroup
|
|
28
|
+
name="size"
|
|
29
|
+
value={selected}
|
|
30
|
+
onChange={setSelected}
|
|
31
|
+
options={[
|
|
32
|
+
{ value: "sm", label: "Small" },
|
|
33
|
+
{ value: "md", label: "Medium" },
|
|
34
|
+
{ value: "lg", label: "Large" },
|
|
35
|
+
]}
|
|
36
|
+
/>
|
|
37
|
+
|
|
38
|
+
<ITRadioGroup
|
|
39
|
+
name="layout"
|
|
40
|
+
value={selected}
|
|
41
|
+
onChange={setSelected}
|
|
42
|
+
direction="row"
|
|
43
|
+
options={[
|
|
44
|
+
{ value: "option1", label: "Option 1" },
|
|
45
|
+
{ value: "option2", label: "Option 2" },
|
|
46
|
+
]}
|
|
47
|
+
/>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Notes
|
|
51
|
+
|
|
52
|
+
- Fully controlled component: `value` and `onChange` must be provided.
|
|
53
|
+
- `direction="column"` stacks options vertically; `direction="row"` lays them out horizontally.
|
|
54
|
+
- `disabled` disables all radio inputs in the group at once.
|
|
55
|
+
- Label accepts `ReactNode`, allowing rich content like icons or custom markup.
|
|
56
|
+
- Group uses a shared `name` attribute, ensuring mutual exclusivity across options.
|
|
57
|
+
|
|
58
|
+
## Stories
|
|
59
|
+
|
|
60
|
+
<Primary />
|
|
61
|
+
<Controls />
|
|
62
|
+
<Stories />
|
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
|
|
3
|
+
/** Represents a single radio option within a group. */
|
|
3
4
|
export interface ITRadioOption {
|
|
5
|
+
/** Value of the radio option. */
|
|
4
6
|
value: string;
|
|
7
|
+
/** Display label for the radio option. */
|
|
5
8
|
label: ReactNode;
|
|
6
9
|
}
|
|
7
10
|
|
|
11
|
+
/** Props for the ITRadioGroup component. */
|
|
8
12
|
export interface ITRadioGroupProps {
|
|
13
|
+
/** Name attribute for the radio input group. Used for form accessibility. */
|
|
9
14
|
name: string;
|
|
15
|
+
/** Currently selected value. */
|
|
10
16
|
value: string;
|
|
17
|
+
/** Callback fired when a radio option is selected. Receives the selected value. */
|
|
11
18
|
onChange: (value: string) => void;
|
|
19
|
+
/** Array of radio options to render. */
|
|
12
20
|
options: ITRadioOption[];
|
|
21
|
+
/** Whether the entire radio group is disabled. */
|
|
13
22
|
disabled?: boolean;
|
|
23
|
+
/** Layout direction of the radio options. Options: "row", "column". Default: "column". */
|
|
14
24
|
direction?: "row" | "column";
|
|
25
|
+
/** Additional CSS classes for the container. */
|
|
15
26
|
className?: string;
|
|
16
27
|
}
|
|
@@ -2,6 +2,24 @@ import clsx from "clsx";
|
|
|
2
2
|
import { ITRadioGroupProps } from "./radio.props";
|
|
3
3
|
import ITText from "@/components/text/text";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Radio button group with configurable layout direction and themed selection styling.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <ITRadioGroup
|
|
11
|
+
* name="color"
|
|
12
|
+
* value={selectedColor}
|
|
13
|
+
* onChange={(value) => setSelectedColor(value)}
|
|
14
|
+
* options={[
|
|
15
|
+
* { value: 'red', label: 'Red' },
|
|
16
|
+
* { value: 'blue', label: 'Blue' },
|
|
17
|
+
* { value: 'green', label: 'Green' },
|
|
18
|
+
* ]}
|
|
19
|
+
* direction="row"
|
|
20
|
+
* />
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
5
23
|
export default function ITRadioGroup({
|
|
6
24
|
name,
|
|
7
25
|
value,
|