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