@axzydev/axzy_ui_system 1.2.7 → 1.2.9
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 +105 -53
- 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 +26 -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/GettingStartedShowcase.tsx +207 -0
- 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,15 +1,26 @@
|
|
|
1
1
|
import { InputHTMLAttributes } from "react";
|
|
2
2
|
|
|
3
3
|
export interface ITTextareaProps {
|
|
4
|
+
/** Controlled value of the textarea. */
|
|
4
5
|
value?: string;
|
|
6
|
+
/** Callback fired when the value changes, receiving the new string. */
|
|
5
7
|
onChange?: (value: string) => void;
|
|
8
|
+
/** Label text rendered above the textarea. */
|
|
6
9
|
label?: string;
|
|
10
|
+
/** Placeholder text shown when the textarea is empty. */
|
|
7
11
|
placeholder?: string;
|
|
12
|
+
/** Number of visible text rows (default 4). */
|
|
8
13
|
rows?: number;
|
|
14
|
+
/** Disables the textarea when true. */
|
|
9
15
|
disabled?: boolean;
|
|
16
|
+
/** Validation error message displayed below the textarea. */
|
|
10
17
|
error?: string;
|
|
18
|
+
/** Additional CSS classes for the wrapper. */
|
|
11
19
|
className?: string;
|
|
20
|
+
/** Name attribute for form submission and label association via `htmlFor`. */
|
|
12
21
|
name?: string;
|
|
22
|
+
/** Maximum number of characters allowed. */
|
|
13
23
|
maxLength?: number;
|
|
24
|
+
/** Resize behavior of the textarea: "none" | "vertical" | "horizontal" | "both". */
|
|
14
25
|
resize?: "none" | "vertical" | "horizontal" | "both";
|
|
15
26
|
}
|
|
@@ -10,6 +10,22 @@ const resizeMap = {
|
|
|
10
10
|
both: "resize",
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Multi-line text input with optional label, validation error display,
|
|
15
|
+
* character limit, and configurable resize behavior.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* <ITTextarea
|
|
19
|
+
* name="bio"
|
|
20
|
+
* label="Biography"
|
|
21
|
+
* value={bio}
|
|
22
|
+
* onChange={setBio}
|
|
23
|
+
* maxLength={500}
|
|
24
|
+
* rows={6}
|
|
25
|
+
* resize="vertical"
|
|
26
|
+
* error={bio.length > 500 ? "Max 500 characters" : undefined}
|
|
27
|
+
* />
|
|
28
|
+
*/
|
|
13
29
|
export default function ITTextarea({
|
|
14
30
|
value,
|
|
15
31
|
onChange,
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
+
import * as Stories from './themeProvider.stories';
|
|
3
|
+
|
|
4
|
+
<Meta of={Stories} />
|
|
5
|
+
|
|
6
|
+
# ITThemeProvider
|
|
7
|
+
|
|
8
|
+
Root theme context that injects CSS custom properties into the entire component tree. Provides a centralized color palette with semantic tokens (primary, secondary, ternary, danger, success, info, alert, warning) plus overridable layout and table sections. Includes a floating action button that opens an in-app real-time theme designer drawer for live palette editing, dark/light/system mode switching, and preset themes.
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
|
|
12
|
+
| Prop | Type | Default | Description |
|
|
13
|
+
|------|------|---------|-------------|
|
|
14
|
+
| `theme` | `Partial<ITThemePalette>` | — | Partial palette overrides merged with the default theme. Supports primary, secondary, ternary, danger, success, info, alert, warning, layout, and table colors. |
|
|
15
|
+
| `children` | `React.ReactNode` | — | The subtree that receives the theme context and CSS variables. |
|
|
16
|
+
| `showFab` | `boolean` | `false` | Whether to show the floating action button for opening the theme designer drawer. |
|
|
17
|
+
|
|
18
|
+
### ITThemePalette Shape
|
|
19
|
+
|
|
20
|
+
| Key | Type | Description |
|
|
21
|
+
|-----|------|-------------|
|
|
22
|
+
| `primary` | `string` | Primary color for buttons, links, active states. |
|
|
23
|
+
| `secondary` | `string` | Secondary/muted color. |
|
|
24
|
+
| `ternary` | `string` | Tertiary accent color. |
|
|
25
|
+
| `danger` | `string` | Destructive action color. |
|
|
26
|
+
| `success` | `string` | Positive/success color. |
|
|
27
|
+
| `info` | `string` | Informational color. |
|
|
28
|
+
| `alert` | `string` | Alert/warning highlight color. |
|
|
29
|
+
| `warning` | `string` | Cautionary yellow color. |
|
|
30
|
+
| `layout.sidebarBg` | `string` | Sidebar background color. |
|
|
31
|
+
| `layout.sidebarText` | `string` | Sidebar text color. |
|
|
32
|
+
| `layout.navbarBg` | `string` | Navbar background color. |
|
|
33
|
+
| `layout.navbarText` | `string` | Navbar text color. |
|
|
34
|
+
| `table.headerBg` | `string` | Table header background color. |
|
|
35
|
+
| `table.headerText` | `string` | Table header text color. |
|
|
36
|
+
| `table.rowBg` | `string` | Table row background color. |
|
|
37
|
+
| `table.rowText` | `string` | Table row text color. |
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import { ITThemeProvider } from '@axzydev/axzy_ui_system';
|
|
43
|
+
|
|
44
|
+
<ITThemeProvider
|
|
45
|
+
theme={{
|
|
46
|
+
primary: '#8b5cf6',
|
|
47
|
+
success: '#22c55e',
|
|
48
|
+
layout: {
|
|
49
|
+
sidebarBg: '#0b1120',
|
|
50
|
+
sidebarText: '#94a3b8',
|
|
51
|
+
},
|
|
52
|
+
}}
|
|
53
|
+
>
|
|
54
|
+
<App />
|
|
55
|
+
</ITThemeProvider>
|
|
56
|
+
|
|
57
|
+
<ITThemeProvider showFab>
|
|
58
|
+
<App />
|
|
59
|
+
</ITThemeProvider>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Notes
|
|
63
|
+
|
|
64
|
+
- Wrap your entire application in `ITThemeProvider` once at the root level.
|
|
65
|
+
- The default palette uses cyan (`#06b6d4`) as primary and supports all semantic color tokens.
|
|
66
|
+
- **showFab** renders a floating palette icon. Clicking it opens a drawer with color pickers for each token, dark/light/system mode toggle, preset theme cards, live preview, and persistent localStorage save.
|
|
67
|
+
- Theme preferences are persisted to localStorage under the `it-theme-palette` key.
|
|
68
|
+
- All child components consume theme colors via CSS custom properties (e.g., `var(--it-primary)`) injected by the provider.
|
|
69
|
+
- Custom palettes can override any subset of tokens; unset keys fall back to the default palette.
|
|
70
|
+
|
|
71
|
+
## Stories
|
|
72
|
+
|
|
73
|
+
<Primary />
|
|
74
|
+
<Controls />
|
|
75
|
+
<Stories />
|
|
@@ -22,7 +22,10 @@ export interface ITThemePalette {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export interface ITThemeProviderProps {
|
|
25
|
+
/** Partial palette overrides merged with the default theme. Supports primary, secondary, tertiary, danger, success, info, alert, warning, layout, and table colors. */
|
|
25
26
|
theme?: Partial<ITThemePalette>;
|
|
27
|
+
/** The subtree that receives the theme context and CSS variables. */
|
|
26
28
|
children: React.ReactNode;
|
|
29
|
+
/** Whether to show the floating action button for opening the theme designer drawer. */
|
|
27
30
|
showFab?: boolean;
|
|
28
31
|
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import ITThemeProvider from './themeProvider';
|
|
3
|
+
import ITCard from '../card/card';
|
|
4
|
+
import ITButton from '../button/button';
|
|
5
|
+
import ITText from '../text/text';
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Components/System/ITThemeProvider',
|
|
9
|
+
component: ITThemeProvider,
|
|
10
|
+
parameters: { layout: 'centered' },
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
argTypes: {
|
|
13
|
+
theme: { control: false, description: 'Custom theme palette to override defaults' },
|
|
14
|
+
children: { control: false, description: 'App content wrapped by the theme context' },
|
|
15
|
+
showFab: { control: 'boolean', description: 'Show the floating action button to open the theme designer' },
|
|
16
|
+
},
|
|
17
|
+
} satisfies Meta<typeof ITThemeProvider>;
|
|
18
|
+
|
|
19
|
+
export default meta;
|
|
20
|
+
type Story = StoryObj<typeof meta>;
|
|
21
|
+
|
|
22
|
+
const ThemedContent = () => (
|
|
23
|
+
<div className="p-8 space-y-4">
|
|
24
|
+
<ITCard title="Theme Demo" className="max-w-sm">
|
|
25
|
+
<div className="space-y-3">
|
|
26
|
+
<ITText as="p" className="text-sm text-slate-600 dark:text-slate-300">
|
|
27
|
+
This content is wrapped in ITThemeProvider and uses the current theme.
|
|
28
|
+
</ITText>
|
|
29
|
+
<div className="flex gap-2">
|
|
30
|
+
<ITButton label="Primary" color="primary" />
|
|
31
|
+
<ITButton label="Success" color="success" />
|
|
32
|
+
<ITButton label="Danger" color="danger" />
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</ITCard>
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
export const Default: Story = {
|
|
40
|
+
args: {
|
|
41
|
+
children: <ThemedContent />,
|
|
42
|
+
showFab: false,
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const CustomPrimaryColor: Story = {
|
|
47
|
+
args: {
|
|
48
|
+
theme: { primary: '#8b5cf6', success: '#22c55e' },
|
|
49
|
+
children: <ThemedContent />,
|
|
50
|
+
showFab: false,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const WithThemeFab: Story = {
|
|
55
|
+
args: {
|
|
56
|
+
children: <ThemedContent />,
|
|
57
|
+
showFab: true,
|
|
58
|
+
},
|
|
59
|
+
};
|
|
@@ -246,6 +246,20 @@ const isVeryDarkColor = (hex: string) => {
|
|
|
246
246
|
return brightness < 50;
|
|
247
247
|
};
|
|
248
248
|
|
|
249
|
+
/**
|
|
250
|
+
* Root theme context provider that injects CSS custom properties for all components,
|
|
251
|
+
* supports custom color palettes, dark/light mode, and an optional in-app theme designer FAB.
|
|
252
|
+
*
|
|
253
|
+
* @example
|
|
254
|
+
* <ITThemeProvider theme={{ primary: "#3b82f6", danger: "#ef4444" }}>
|
|
255
|
+
* <App />
|
|
256
|
+
* </ITThemeProvider>
|
|
257
|
+
*
|
|
258
|
+
* @example
|
|
259
|
+
* <ITThemeProvider showFab={false}>
|
|
260
|
+
* <Dashboard />
|
|
261
|
+
* </ITThemeProvider>
|
|
262
|
+
*/
|
|
249
263
|
export default function ITThemeProvider({
|
|
250
264
|
children,
|
|
251
265
|
theme,
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
+
import * as Stories from './timePicker.stories';
|
|
3
|
+
|
|
4
|
+
<Meta of={Stories} />
|
|
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` | `"small" \| "medium" \| "large"` | `"medium"` | Size preset controlling padding and font size. |
|
|
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,16 +1,30 @@
|
|
|
1
1
|
export interface ITTimePickerProps {
|
|
2
|
+
/** Form field name attribute and key for the change event. */
|
|
2
3
|
name: string;
|
|
4
|
+
/** Controlled time value in "HH:MM" format. */
|
|
3
5
|
value?: string;
|
|
6
|
+
/** Label text displayed above the input. */
|
|
4
7
|
label?: string;
|
|
8
|
+
/** Placeholder text when no value is set (default "HH:MM"). */
|
|
5
9
|
placeholder?: string;
|
|
10
|
+
/** Callback fired on valid time selection, receives event-like object with `target.name` and `target.value`. */
|
|
6
11
|
onChange: (e: any) => void;
|
|
12
|
+
/** Callback fired when the input loses focus. */
|
|
7
13
|
onBlur?: (e: any) => void;
|
|
14
|
+
/** Marks the field as required. */
|
|
8
15
|
required?: boolean;
|
|
16
|
+
/** Whether the input has been touched (interacted with). */
|
|
9
17
|
touched?: boolean;
|
|
18
|
+
/** Validation error message or boolean to show error state. */
|
|
10
19
|
error?: string | boolean;
|
|
20
|
+
/** Disables the time picker when true. */
|
|
11
21
|
disabled?: boolean;
|
|
22
|
+
/** Additional CSS classes for the wrapper. */
|
|
12
23
|
className?: string;
|
|
24
|
+
/** Size preset: "small" | "medium" | "large". */
|
|
13
25
|
size?: "small" | "medium" | "large";
|
|
26
|
+
/** Style variant for the input: "primary" | "secondary" | "danger" | "success" | "warning" | "info" | "purple". */
|
|
14
27
|
variant?: "primary" | "secondary" | "danger" | "success" | "warning" | "info" | "purple";
|
|
28
|
+
/** Theme color used for the dropdown highlight and confirm button. Accepts semantic keys or raw hex. */
|
|
15
29
|
color?: "primary" | "secondary" | "danger" | "success" | "warning" | "info" | "purple" | string;
|
|
16
30
|
}
|
|
@@ -8,6 +8,27 @@ import { theme } from "@/theme/theme";
|
|
|
8
8
|
import { ITTimePickerProps } from "./timePicker.props";
|
|
9
9
|
import ITText from "@/components/text/text";
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Time selection input with a dual-column dropdown (hours / minutes).
|
|
13
|
+
* Supports manual typing with auto-formatting, validation, and keyboard-friendly picker.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* <ITTimePicker
|
|
17
|
+
* name="startTime"
|
|
18
|
+
* label="Start Time"
|
|
19
|
+
* value={startTime}
|
|
20
|
+
* onChange={(e) => setStartTime(e.target.value)}
|
|
21
|
+
* color="primary"
|
|
22
|
+
* />
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* <ITTimePicker
|
|
26
|
+
* name="endTime"
|
|
27
|
+
* value={endTime}
|
|
28
|
+
* onChange={(e) => setEndTime(e.target.value)}
|
|
29
|
+
* error={isInvalid ? "Invalid time range" : undefined}
|
|
30
|
+
* />
|
|
31
|
+
*/
|
|
11
32
|
export default function ITTimePicker({
|
|
12
33
|
name,
|
|
13
34
|
value,
|
|
@@ -197,7 +218,7 @@ export default function ITTimePicker({
|
|
|
197
218
|
"cursor-pointer transition-colors",
|
|
198
219
|
disabled
|
|
199
220
|
? "text-slate-400 cursor-not-allowed"
|
|
200
|
-
: "text-slate-
|
|
221
|
+
: "text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200"
|
|
201
222
|
)}
|
|
202
223
|
/>
|
|
203
224
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
+
import * as Stories from './toast.stories';
|
|
3
|
+
|
|
4
|
+
<Meta of={Stories} />
|
|
5
|
+
|
|
6
|
+
# ITToast
|
|
7
|
+
|
|
8
|
+
Floating notification with automatic dismiss and severity-based styling. Renders a positioned alert with an icon, message, and optional action button. Supports six on-screen positions and four semantic types — success, error, warning, and info — plus primary and danger variants.
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
|
|
12
|
+
| Prop | Type | Default | Description |
|
|
13
|
+
|------|------|---------|-------------|
|
|
14
|
+
| `message` | `string` | — | Toast message text to display. |
|
|
15
|
+
| `type` | `"success" \| "error" \| "warning" \| "info" \| "primary" \| "danger" \| string` | `"info"` | Severity type determining icon and background color. |
|
|
16
|
+
| `duration` | `number` | `1500` | Auto-dismiss duration in milliseconds. |
|
|
17
|
+
| `position` | `"top-right" \| "top-center" \| "top-left" \| "bottom-right" \| "bottom-center" \| "bottom-left"` | `"top-right"` | On-screen placement of the toast. |
|
|
18
|
+
| `onClose` | `() => void` | — | Callback invoked after the toast finishes its dismiss transition animation. |
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import { ITToast } from '@axzydev/axzy_ui_system';
|
|
24
|
+
|
|
25
|
+
<ITToast message="Operation completed successfully!" type="success" />
|
|
26
|
+
|
|
27
|
+
<ITToast
|
|
28
|
+
message="There was a critical error processing your request."
|
|
29
|
+
type="error"
|
|
30
|
+
position="top-center"
|
|
31
|
+
duration={5000}
|
|
32
|
+
onClose={() => console.log("dismissed")}
|
|
33
|
+
/>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Notes
|
|
37
|
+
|
|
38
|
+
- **type** values map to icons: `success` → check circle, `error` → times circle, `warning` → exclamation triangle, `info` → info circle. Unknown types fall back to the info icon.
|
|
39
|
+
- **duration** starts counting after mount; the toast fades out with a 300ms transition after the timer expires.
|
|
40
|
+
- The toast renders with `position: fixed`, so it overlays all page content at the chosen screen edge.
|
|
41
|
+
- A close button (`×`) is always present for manual dismissal.
|
|
42
|
+
- **onClose** fires after the fade-out transition completes — useful for unmounting the toast from a list.
|
|
43
|
+
- For managing multiple toasts simultaneously, wrap with a toast provider context pattern outside `ITToast`.
|
|
44
|
+
- All types also accept raw hex color strings, which get applied as background behind the themed icon.
|
|
45
|
+
|
|
46
|
+
## Stories
|
|
47
|
+
|
|
48
|
+
<Primary />
|
|
49
|
+
<Controls />
|
|
50
|
+
<Stories />
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
export interface ITToastProps {
|
|
2
|
+
/** Toast message text to display. */
|
|
2
3
|
message: string;
|
|
4
|
+
/** Severity type determining icon and background color. One of "success", "error", "warning", "info", "primary", or "danger". @default "info" */
|
|
3
5
|
type?: "success" | "error" | "warning" | "info" | "primary" | "danger" | string;
|
|
6
|
+
/** Auto-dismiss duration in milliseconds. @default 1500 */
|
|
4
7
|
duration?: number;
|
|
8
|
+
/** On-screen placement. One of "top-right", "top-center", "top-left", "bottom-right", "bottom-center", "bottom-left". @default "top-right" */
|
|
5
9
|
position?:
|
|
6
10
|
| "top-right"
|
|
7
11
|
| "top-center"
|
|
@@ -9,5 +13,6 @@ export interface ITToastProps {
|
|
|
9
13
|
| "bottom-right"
|
|
10
14
|
| "bottom-center"
|
|
11
15
|
| "bottom-left";
|
|
16
|
+
/** Callback invoked after the toast finishes its dismiss transition animation. */
|
|
12
17
|
onClose?: () => void;
|
|
13
18
|
}
|
|
@@ -7,6 +7,27 @@ import { ITToastProps } from "./toast.props";
|
|
|
7
7
|
import { FaTimesCircle, FaCheckCircle, FaExclamationTriangle, FaInfoCircle, FaTimes } from "react-icons/fa";
|
|
8
8
|
import ITText from "@/components/text/text";
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* ITToast — floating notification with automatic dismiss and severity-based styling.
|
|
12
|
+
*
|
|
13
|
+
* Renders a positioned alert with an icon, message, and close button.
|
|
14
|
+
* Supports "success", "error", "warning", "info", "primary", and "danger" types.
|
|
15
|
+
* Auto-dismisses after the configured duration and calls `onClose` on completion.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* // Basic info toast
|
|
19
|
+
* <ITToast message="Item saved" type="success" />
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // Error toast with custom position and duration
|
|
23
|
+
* <ITToast
|
|
24
|
+
* message="Something went wrong"
|
|
25
|
+
* type="error"
|
|
26
|
+
* position="bottom-center"
|
|
27
|
+
* duration={5000}
|
|
28
|
+
* onClose={() => console.log("dismissed")}
|
|
29
|
+
* />
|
|
30
|
+
*/
|
|
10
31
|
export default function ITToast({
|
|
11
32
|
message,
|
|
12
33
|
type = "info",
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
+
import * as Stories from './tooltip.stories';
|
|
3
|
+
|
|
4
|
+
<Meta of={Stories} />
|
|
5
|
+
|
|
6
|
+
# ITTooltip
|
|
7
|
+
|
|
8
|
+
Hover and focus tooltip that wraps a trigger element and displays contextual information in a small popup. Supports four placement positions with a triangular arrow pointing toward the trigger, configurable show delay, and customizable max-width.
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
|
|
12
|
+
| Prop | Type | Default | Description |
|
|
13
|
+
|------|------|---------|-------------|
|
|
14
|
+
| `content` | `ReactNode` | — | The tooltip content to display on hover/focus. Accepts text or any ReactNode. |
|
|
15
|
+
| `children` | `ReactNode` | — | The trigger element that reveals the tooltip on interaction. |
|
|
16
|
+
| `position` | `"top" \| "bottom" \| "left" \| "right"` | `"top"` | Placement relative to children. |
|
|
17
|
+
| `delay` | `number` | `200` | Delay in milliseconds before the tooltip becomes visible. |
|
|
18
|
+
| `className` | `string` | — | Additional CSS classes applied to the wrapper element. |
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import { ITTooltip } from '@axzydev/axzy_ui_system';
|
|
24
|
+
|
|
25
|
+
<ITTooltip content="Click to save" position="bottom">
|
|
26
|
+
<button>Save</button>
|
|
27
|
+
</ITTooltip>
|
|
28
|
+
|
|
29
|
+
<ITTooltip content={<span>Delete this item?</span>} position="top" delay={500}>
|
|
30
|
+
<IconButton icon={TrashIcon} />
|
|
31
|
+
</ITTooltip>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Notes
|
|
35
|
+
|
|
36
|
+
- The tooltip appears after a **delay** (default 200ms) once the mouse enters the trigger, and disappears immediately on mouse leave.
|
|
37
|
+
- **position** controls both the popup placement and the arrow direction: `top` (tooltip above, arrow pointing down), `bottom` (below, arrow up), `left` (to the left, arrow right), `right` (to the right, arrow left).
|
|
38
|
+
- An optional triangular **arrow** is always rendered, styled with CSS borders pointing toward the trigger.
|
|
39
|
+
- Tooltip body uses dark slate (`slate-800`) background with white text and rounded corners.
|
|
40
|
+
- The wrapper is `inline-flex` by default, so it only takes as much width as the trigger — add `className` to constrain max-width on the tooltip content.
|
|
41
|
+
- Supports keyboard focus: the tooltip also appears when the trigger element receives focus.
|
|
42
|
+
|
|
43
|
+
## Stories
|
|
44
|
+
|
|
45
|
+
<Primary />
|
|
46
|
+
<Controls />
|
|
47
|
+
<Stories />
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
|
|
3
|
+
/** Available placement positions relative to the trigger element. */
|
|
3
4
|
export type TooltipPosition = "top" | "bottom" | "left" | "right";
|
|
4
5
|
|
|
5
6
|
export interface ITTooltipProps {
|
|
7
|
+
/** The tooltip content to display on hover / focus. Accepts text or any ReactNode. */
|
|
6
8
|
content: ReactNode;
|
|
9
|
+
/** The trigger element that reveals the tooltip on interaction. */
|
|
7
10
|
children: ReactNode;
|
|
11
|
+
/** Placement relative to children. One of "top", "bottom", "left", "right". @default "top" */
|
|
8
12
|
position?: TooltipPosition;
|
|
13
|
+
/** Delay in milliseconds before the tooltip becomes visible. @default 200 */
|
|
9
14
|
delay?: number;
|
|
15
|
+
/** Additional CSS classes applied to the wrapper element. */
|
|
10
16
|
className?: string;
|
|
11
17
|
}
|
|
@@ -17,6 +17,25 @@ const arrowClasses: Record<TooltipPosition, string> = {
|
|
|
17
17
|
right: "right-full top-1/2 -translate-y-1/2 border-t-4 border-b-4 border-r-4 border-transparent border-r-slate-800",
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* ITTooltip — hover / focus info tooltip with position control and optional arrow indicator.
|
|
22
|
+
*
|
|
23
|
+
* Wraps a trigger element and displays a small popup with explanatory text
|
|
24
|
+
* after a configurable delay. Supports "top", "bottom", "left", and "right" placement
|
|
25
|
+
* with a triangular arrow pointing toward the trigger.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Basic tooltip
|
|
29
|
+
* <ITTooltip content="Click to save" position="bottom">
|
|
30
|
+
* <button>Save</button>
|
|
31
|
+
* </ITTooltip>
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* // Tooltip with custom delay
|
|
35
|
+
* <ITTooltip content="Delete this item?" position="top" delay={500}>
|
|
36
|
+
* <IconButton icon={TrashIcon} />
|
|
37
|
+
* </ITTooltip>
|
|
38
|
+
*/
|
|
20
39
|
export default function ITTooltip({
|
|
21
40
|
content,
|
|
22
41
|
children,
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
+
import * as Stories from './topbar.stories';
|
|
3
|
+
|
|
4
|
+
<Meta of={Stories} />
|
|
5
|
+
|
|
6
|
+
# ITTopBar
|
|
7
|
+
|
|
8
|
+
Sticky top navigation bar with glassmorphism effect, logo, breadcrumb-style nav items, and a floating user avatar dropdown. Themed via CSS variables. Designed as a full-width header for dashboards and admin panels.
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
|
|
12
|
+
| Prop | Type | Default | Description |
|
|
13
|
+
|------|------|---------|-------------|
|
|
14
|
+
| `logo` | `ReactNode` | — | Optional logo element (e.g. an `<img>` or SVG component). |
|
|
15
|
+
| `logoText` | `string` | — | Text displayed next to the logo as the brand/title. |
|
|
16
|
+
| `userMenu` | `object` | — | User dropdown configuration with name, email, avatar, and menu items. |
|
|
17
|
+
| `userMenu.userName` | `string` | — | Display name shown in the trigger button and dropdown header. |
|
|
18
|
+
| `userMenu.userEmail` | `string` | — | User email shown in the trigger button and dropdown header. |
|
|
19
|
+
| `userMenu.userImage` | `string` | — | Optional avatar image URL. Falls back to a user-circle icon when omitted. |
|
|
20
|
+
| `userMenu.menuItems` | `{ label: string; onClick: () => void }[]` | — | Array of dropdown menu actions. Items containing "salir", "cerrar", or "logout" are styled as destructive. |
|
|
21
|
+
| `navItems` | `ITTopBarNavItem[]` | — | Desktop navigation items rendered beside the logo. Each has `id`, `label`, `icon`, and `action`. |
|
|
22
|
+
| `onNavItemClick` | `(id: string) => void` | — | Callback fired when a navigation item is clicked. Receives the item's `id`. |
|
|
23
|
+
| `showMobileMenuButton` | `boolean` | `false` | Whether to show the mobile hamburger menu toggle button. |
|
|
24
|
+
| `onToggleMobileMenu` | `() => void` | — | Callback fired when the mobile menu toggle button is clicked. |
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
import { ITTopBar } from '@axzydev/axzy_ui_system';
|
|
30
|
+
import { FaChartBar, FaUserCog } from 'react-icons/fa';
|
|
31
|
+
|
|
32
|
+
<ITTopBar
|
|
33
|
+
logoText="AXZY SYSTEM"
|
|
34
|
+
showMobileMenuButton
|
|
35
|
+
userMenu={{
|
|
36
|
+
userName: 'Alejandro G.',
|
|
37
|
+
userEmail: 'alejandro@axzy.io',
|
|
38
|
+
userImage: 'https://i.pravatar.cc/48',
|
|
39
|
+
menuItems: [
|
|
40
|
+
{ label: 'Mi Perfil', onClick: () => {} },
|
|
41
|
+
{ label: 'Configuración', onClick: () => {} },
|
|
42
|
+
{ label: 'Cerrar Sesión', onClick: () => {} },
|
|
43
|
+
],
|
|
44
|
+
}}
|
|
45
|
+
navItems={[
|
|
46
|
+
{ id: '1', label: 'Monitor', icon: <FaChartBar />, action: () => {} },
|
|
47
|
+
{ id: '2', label: 'Admin', icon: <FaUserCog />, action: () => {} },
|
|
48
|
+
]}
|
|
49
|
+
onNavItemClick={(id) => console.log('Nav:', id)}
|
|
50
|
+
onToggleMobileMenu={() => setSidebarOpen(v => !v)}
|
|
51
|
+
/>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Notes
|
|
55
|
+
|
|
56
|
+
- The bar uses a **glassmorphism** backdrop blur effect (`backdrop-blur-xl`), giving it a translucent appearance over scrolling content.
|
|
57
|
+
- Navigation items support **icons** and highlight the active item with the primary color and an underline indicator.
|
|
58
|
+
- The **user menu** dropdown opens on avatar click and closes on outside click (via `useClickOutside` hook).
|
|
59
|
+
- Menu items containing "salir", "cerrar", or "logout" (case-insensitive) are automatically styled red as destructive actions.
|
|
60
|
+
- When `userImage` is omitted, a `FaUserCircle` fallback icon is displayed.
|
|
61
|
+
- **showMobileMenuButton** renders a hamburger icon (`<FaBars />`) for toggling a sidebar — the actual sidebar is managed externally via `onToggleMobileMenu`.
|
|
62
|
+
- All color tokens are sourced from CSS custom properties set by `ITThemeProvider`.
|
|
63
|
+
- The bar is `sticky` by default and sits at `top: 0` with a high z-index.
|
|
64
|
+
|
|
65
|
+
## Stories
|
|
66
|
+
|
|
67
|
+
<Primary />
|
|
68
|
+
<Controls />
|
|
69
|
+
<Stories />
|
|
@@ -1,21 +1,36 @@
|
|
|
1
1
|
export interface ITTopBarNavItem {
|
|
2
|
+
/** Unique identifier for the navigation item. */
|
|
2
3
|
id: string;
|
|
4
|
+
/** Display label shown in the navigation bar. */
|
|
3
5
|
label: string;
|
|
6
|
+
/** Optional icon element rendered beside the label. */
|
|
4
7
|
icon?: any;
|
|
8
|
+
/** Click handler for this navigation item (legacy, prefer onNavItemClick). */
|
|
5
9
|
action: () => void;
|
|
6
10
|
}
|
|
7
11
|
|
|
8
12
|
export interface ITTopBarProps {
|
|
13
|
+
/** Optional logo element (e.g. an `<img>` or SVG component). */
|
|
9
14
|
logo?: any;
|
|
15
|
+
/** Text displayed next to the logo. */
|
|
10
16
|
logoText?: string;
|
|
17
|
+
/** User dropdown configuration including name, email, avatar, and menu items. */
|
|
11
18
|
userMenu?: {
|
|
19
|
+
/** Display name shown in the trigger button and dropdown header. */
|
|
12
20
|
userName: string;
|
|
21
|
+
/** User email shown in the trigger button and dropdown header. */
|
|
13
22
|
userEmail: string;
|
|
23
|
+
/** Optional avatar image URL. Falls back to a user-circle icon when omitted. */
|
|
14
24
|
userImage?: string;
|
|
25
|
+
/** Array of dropdown menu actions: `{ label: string, onClick: () => void }`. Items containing "salir", "cerrar", or "logout" are styled as destructive. */
|
|
15
26
|
menuItems: { label: string; onClick: () => void }[];
|
|
16
27
|
};
|
|
28
|
+
/** Desktop navigation items rendered beside the logo. */
|
|
17
29
|
navItems?: ITTopBarNavItem[];
|
|
30
|
+
/** Callback fired when a navigation item is clicked. Receives the item's `id`. */
|
|
18
31
|
onNavItemClick?: (id: string) => void;
|
|
32
|
+
/** Whether to show the mobile hamburger menu toggle button. @default false */
|
|
19
33
|
showMobileMenuButton?: boolean;
|
|
34
|
+
/** Callback fired when the mobile menu toggle button is clicked. */
|
|
20
35
|
onToggleMobileMenu?: () => void;
|
|
21
36
|
}
|