@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
package/package.json
CHANGED
package/src/App.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useMemo, useState } from "react";
|
|
1
|
+
import React, { useEffect, useMemo, useState } from "react";
|
|
2
2
|
import {
|
|
3
3
|
FaCreditCard,
|
|
4
4
|
FaHome,
|
|
@@ -13,6 +13,7 @@ import "./index.css";
|
|
|
13
13
|
|
|
14
14
|
// Import Showcases
|
|
15
15
|
import { HomeShowcase } from "./showcases/HomeShowcase";
|
|
16
|
+
import { GettingStartedShowcase } from "./showcases/GettingStartedShowcase";
|
|
16
17
|
import {
|
|
17
18
|
CardShowcase,
|
|
18
19
|
LayoutShowcase,
|
|
@@ -24,7 +25,6 @@ import {
|
|
|
24
25
|
GridShowcase,
|
|
25
26
|
ScreenDashboardShowcase,
|
|
26
27
|
ScreenFormShowcase,
|
|
27
|
-
ScreenCardGridShowcase,
|
|
28
28
|
} from "./showcases/LayoutPrimitivesShowcases";
|
|
29
29
|
import {
|
|
30
30
|
PageHeaderShowcase,
|
|
@@ -62,18 +62,37 @@ import {
|
|
|
62
62
|
} from "./showcases/FeedbackShowcases";
|
|
63
63
|
|
|
64
64
|
function App() {
|
|
65
|
-
const [activeComponentId, setActiveComponentId] = useState(
|
|
65
|
+
const [activeComponentId, setActiveComponentId] = useState(
|
|
66
|
+
() => window.location.hash.replace("#", "") || "home"
|
|
67
|
+
);
|
|
66
68
|
const [searchTerm, setSearchTerm] = useState("");
|
|
67
69
|
const [subitemConnector, setSubitemConnector] = useState<
|
|
68
70
|
"dot" | "|" | "none"
|
|
69
71
|
>("dot");
|
|
70
72
|
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
const onHashChange = () => {
|
|
75
|
+
const id = window.location.hash.replace("#", "") || "home";
|
|
76
|
+
setActiveComponentId(id);
|
|
77
|
+
};
|
|
78
|
+
window.addEventListener("hashchange", onHashChange);
|
|
79
|
+
return () => window.removeEventListener("hashchange", onHashChange);
|
|
80
|
+
}, []);
|
|
81
|
+
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
window.location.hash = activeComponentId;
|
|
84
|
+
}, [activeComponentId]);
|
|
85
|
+
|
|
71
86
|
// Group definitions for the sidebar
|
|
72
87
|
const categories = [
|
|
73
88
|
{
|
|
74
89
|
id: "general",
|
|
75
90
|
label: "General",
|
|
76
91
|
icon: <FaHome />,
|
|
92
|
+
subitems: [
|
|
93
|
+
{ id: "home", label: "Home" },
|
|
94
|
+
{ id: "getting-started", label: "Getting Started" },
|
|
95
|
+
],
|
|
77
96
|
},
|
|
78
97
|
{
|
|
79
98
|
id: "struc",
|
|
@@ -90,7 +109,6 @@ function App() {
|
|
|
90
109
|
{ id: "page", label: "ITPage" },
|
|
91
110
|
{ id: "screen-dashboard", label: "Dashboard Ejemplo" },
|
|
92
111
|
{ id: "screen-form", label: "Formulario Ejemplo" },
|
|
93
|
-
{ id: "screen-cardgrid", label: "Grid Tarjetas Ejemplo" },
|
|
94
112
|
],
|
|
95
113
|
},
|
|
96
114
|
{
|
|
@@ -218,6 +236,8 @@ function App() {
|
|
|
218
236
|
switch (activeComponentId) {
|
|
219
237
|
case "home":
|
|
220
238
|
return <HomeShowcase />;
|
|
239
|
+
case "getting-started":
|
|
240
|
+
return <GettingStartedShowcase />;
|
|
221
241
|
// Structure
|
|
222
242
|
case "layout":
|
|
223
243
|
return <LayoutShowcase />;
|
|
@@ -239,8 +259,6 @@ function App() {
|
|
|
239
259
|
return <ScreenDashboardShowcase />;
|
|
240
260
|
case "screen-form":
|
|
241
261
|
return <ScreenFormShowcase />;
|
|
242
|
-
case "screen-cardgrid":
|
|
243
|
-
return <ScreenCardGridShowcase />;
|
|
244
262
|
// Forms
|
|
245
263
|
case "button":
|
|
246
264
|
return <ButtonShowcase />;
|
|
@@ -297,54 +315,8 @@ function App() {
|
|
|
297
315
|
return (
|
|
298
316
|
<ITThemeProvider showFab={true}>
|
|
299
317
|
<ITLayout sidebar={sidebarProps} topBar={topBarProps}>
|
|
300
|
-
<div className="max-w-7xl mx-auto
|
|
301
|
-
{
|
|
302
|
-
<div className="relative p-6 rounded-2xl bg-white/70 dark:bg-slate-900/60 border border-slate-100 dark:border-slate-800 backdrop-blur-md shadow-sm flex flex-col md:flex-row md:items-center justify-between gap-4">
|
|
303
|
-
<div>
|
|
304
|
-
<h2 className="text-xl font-bold text-slate-800 dark:text-white">
|
|
305
|
-
Explorador de Componentes
|
|
306
|
-
</h2>
|
|
307
|
-
<p className="text-xs text-slate-500">
|
|
308
|
-
Selecciona o filtra en la lista lateral para inspeccionar e
|
|
309
|
-
interactuar.
|
|
310
|
-
</p>
|
|
311
|
-
</div>
|
|
312
|
-
<div className="flex flex-wrap items-center gap-3">
|
|
313
|
-
{/* Connector selection */}
|
|
314
|
-
<div className="flex items-center gap-1 bg-slate-100/80 dark:bg-slate-950/40 p-1 rounded-xl border border-slate-200/50 dark:border-slate-800/80">
|
|
315
|
-
{(["dot", "|", "none"] as const).map((style) => (
|
|
316
|
-
<button
|
|
317
|
-
key={style}
|
|
318
|
-
onClick={() => setSubitemConnector(style)}
|
|
319
|
-
className={`px-3 py-1 text-xs font-semibold rounded-lg transition-all ${
|
|
320
|
-
subitemConnector === style
|
|
321
|
-
? "bg-white dark:bg-slate-800 text-indigo-600 dark:text-indigo-400 shadow-sm border border-slate-100 dark:border-slate-700/50"
|
|
322
|
-
: "text-slate-500 hover:text-slate-800 dark:hover:text-slate-200"
|
|
323
|
-
}`}
|
|
324
|
-
>
|
|
325
|
-
{style === "dot" ? "Punto" : style === "|" ? "Vertical" : "Normal"}
|
|
326
|
-
</button>
|
|
327
|
-
))}
|
|
328
|
-
</div>
|
|
329
|
-
|
|
330
|
-
<div className="relative w-full md:w-80">
|
|
331
|
-
<input
|
|
332
|
-
type="text"
|
|
333
|
-
placeholder="Buscar componente..."
|
|
334
|
-
value={searchTerm}
|
|
335
|
-
onChange={(e) => setSearchTerm(e.target.value)}
|
|
336
|
-
className="w-full bg-slate-100/80 dark:bg-slate-950/40 text-slate-800 dark:text-white pl-10 pr-4 py-2 text-sm rounded-xl outline-none focus:ring-2 focus:ring-primary-500 border border-transparent focus:border-transparent transition-all"
|
|
337
|
-
/>
|
|
338
|
-
<FaSearch
|
|
339
|
-
className="absolute left-3 top-3 text-slate-400"
|
|
340
|
-
size={14}
|
|
341
|
-
/>
|
|
342
|
-
</div>
|
|
343
|
-
</div>
|
|
344
|
-
</div>
|
|
345
|
-
<div className="bg-white/50 dark:bg-slate-950/10 border border-slate-100 dark:border-slate-900 rounded-3xl p-6 md:p-8 backdrop-blur-sm min-h-[500px]">
|
|
346
|
-
{renderShowcase()}
|
|
347
|
-
</div>
|
|
318
|
+
<div className="max-w-7xl mx-auto">
|
|
319
|
+
{renderShowcase()}
|
|
348
320
|
</div>
|
|
349
321
|
</ITLayout>
|
|
350
322
|
</ITThemeProvider>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
+
import * as Stories from './alert.stories';
|
|
3
|
+
|
|
4
|
+
<Meta of={Stories} />
|
|
5
|
+
|
|
6
|
+
# ITAlert
|
|
7
|
+
|
|
8
|
+
Dismissible alert banners that provide contextual feedback messages to users. Supports four semantic variants — info, success, warning, and error — each with a distinct icon and color scheme. Alerts can optionally include a bold title, a custom icon override, and a dismiss button for user-dismissible notifications.
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
|
|
12
|
+
| Prop | Type | Default | Description |
|
|
13
|
+
|------|------|---------|-------------|
|
|
14
|
+
| `variant` | `"info" \| "success" \| "warning" \| "error"` | `"info"` | Visual style with corresponding icon and color scheme. |
|
|
15
|
+
| `title` | `string` | — | Bold heading text displayed above the message. |
|
|
16
|
+
| `children` | `ReactNode` | — | Alert message content. |
|
|
17
|
+
| `dismissible` | `boolean` | `false` | Whether the alert can be dismissed by the user. |
|
|
18
|
+
| `onDismiss` | `() => void` | — | Callback fired when the dismiss button is clicked. |
|
|
19
|
+
| `icon` | `ReactNode` | — | Custom icon element that overrides the default variant icon. |
|
|
20
|
+
| `className` | `string` | — | Additional CSS class names for the alert container. |
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import { ITAlert } from '@axzydev/axzy_ui_system';
|
|
26
|
+
|
|
27
|
+
<ITAlert variant="success" title="Guardado" dismissible onDismiss={() => {}}>
|
|
28
|
+
Los cambios se guardaron correctamente.
|
|
29
|
+
</ITAlert>
|
|
30
|
+
|
|
31
|
+
<ITAlert variant="error">Ocurrió un error inesperado.</ITAlert>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Variants / Notes
|
|
35
|
+
|
|
36
|
+
- **info** — Neutral blue style for general informational messages.
|
|
37
|
+
- **success** — Green style for positive confirmation and completion messages.
|
|
38
|
+
- **warning** — Amber/yellow style for cautionary messages.
|
|
39
|
+
- **error** — Red style for critical errors and failures.
|
|
40
|
+
- All variants render with `role="alert"` for accessibility.
|
|
41
|
+
- Supports dark mode with appropriate color adjustments.
|
|
42
|
+
- The dismiss button only renders when both `dismissible` and `onDismiss` are set.
|
|
43
|
+
|
|
44
|
+
## Stories
|
|
45
|
+
|
|
46
|
+
<Primary />
|
|
47
|
+
<Controls />
|
|
48
|
+
<Stories />
|
|
@@ -3,11 +3,18 @@ import { ReactNode } from "react";
|
|
|
3
3
|
export type AlertVariant = "info" | "success" | "warning" | "error";
|
|
4
4
|
|
|
5
5
|
export interface ITAlertProps {
|
|
6
|
+
/** Alert visual style. Valid values: `"info"`, `"success"`, `"warning"`, `"error"`. @default "info" */
|
|
6
7
|
variant?: AlertVariant;
|
|
8
|
+
/** Optional bold title text displayed above the message. */
|
|
7
9
|
title?: string;
|
|
10
|
+
/** Alert message content. */
|
|
8
11
|
children?: ReactNode;
|
|
12
|
+
/** Whether the alert can be dismissed by the user. @default false */
|
|
9
13
|
dismissible?: boolean;
|
|
14
|
+
/** Callback fired when the dismiss button is clicked. */
|
|
10
15
|
onDismiss?: () => void;
|
|
16
|
+
/** Custom icon element. Overrides the default variant icon. */
|
|
11
17
|
icon?: ReactNode;
|
|
18
|
+
/** Additional CSS class names for the alert container. */
|
|
12
19
|
className?: string;
|
|
13
20
|
}
|
|
@@ -23,6 +23,14 @@ const config: Record<AlertVariant, { icon: React.ReactNode; classes: string }> =
|
|
|
23
23
|
},
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Dismissible alert banner with 4 visual variants and optional custom icon.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* <ITAlert variant="success" title="Success" dismissible onDismiss={() => {}}>
|
|
31
|
+
* Operation completed successfully.
|
|
32
|
+
* </ITAlert>
|
|
33
|
+
*/
|
|
26
34
|
export default function ITAlert({
|
|
27
35
|
variant = "info",
|
|
28
36
|
title,
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
+
import * as Stories from './avatar.stories';
|
|
3
|
+
|
|
4
|
+
<Meta of={Stories} />
|
|
5
|
+
|
|
6
|
+
# ITAvatar
|
|
7
|
+
|
|
8
|
+
Circular avatar component for displaying user profile pictures, initials, or generic placeholder content. Falls back to displaying initials when the image fails to load or is not provided. Supports five sizes and an optional badge overlay for status indicators.
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
|
|
12
|
+
| Prop | Type | Default | Description |
|
|
13
|
+
|------|------|---------|-------------|
|
|
14
|
+
| `src` | `string` | — | Image source URL for the avatar. |
|
|
15
|
+
| `alt` | `string` | — | Alt text for the image. Also used as fallback initial when no `initials` or `src` is provided. |
|
|
16
|
+
| `initials` | `string` | — | Initials to display when no image is available (max 2 characters recommended). |
|
|
17
|
+
| `size` | `"xs" \| "sm" \| "md" \| "lg" \| "xl"` | `"md"` | Avatar dimensions. |
|
|
18
|
+
| `color` | `string` | `"bg-primary-500"` | Background color class for the initials fallback. |
|
|
19
|
+
| `className` | `string` | — | Additional CSS class names for the avatar container. |
|
|
20
|
+
| `badge` | `ReactNode` | — | React node rendered as a badge overlay at the bottom-right corner. |
|
|
21
|
+
| `onClick` | `() => void` | — | Click handler. When provided, the avatar becomes interactive (`role="button"`). |
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import { ITAvatar } from '@axzydev/axzy_ui_system';
|
|
27
|
+
|
|
28
|
+
<ITAvatar src="https://i.pravatar.cc/150" alt="User" size="md" />
|
|
29
|
+
|
|
30
|
+
<ITAvatar initials="JD" size="lg" badge={<FaCircle className="text-emerald-500" />} />
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Variants / Notes
|
|
34
|
+
|
|
35
|
+
- **xs** — Extra small (ideal for inline lists or compact UIs).
|
|
36
|
+
- **sm** — Small (useful in table rows or sidebars).
|
|
37
|
+
- **md** — Medium, the default size suitable for most use cases.
|
|
38
|
+
- **lg** — Large (prominent display or profile pages).
|
|
39
|
+
- **xl** — Extra large (hero sections or standalone profile views).
|
|
40
|
+
- Shows initials text fallback when `src` is missing or the image fails (`onError`).
|
|
41
|
+
- Badge slot positioned at bottom-right using absolute positioning.
|
|
42
|
+
- Becomes interactive with click handler and hover cursor when `onClick` is provided.
|
|
43
|
+
|
|
44
|
+
## Stories
|
|
45
|
+
|
|
46
|
+
<Primary />
|
|
47
|
+
<Controls />
|
|
48
|
+
<Stories />
|
|
@@ -3,12 +3,20 @@ import { ReactNode } from "react";
|
|
|
3
3
|
export type AvatarSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
4
4
|
|
|
5
5
|
export interface ITAvatarProps {
|
|
6
|
+
/** Image source URL for the avatar. When provided, displays an `<img>` element. */
|
|
6
7
|
src?: string;
|
|
8
|
+
/** Alt text for the avatar image. Also used as fallback initial when no `initials` or `src` is provided. */
|
|
7
9
|
alt?: string;
|
|
10
|
+
/** Initials to display when no image is available (max 2 characters recommended). */
|
|
8
11
|
initials?: string;
|
|
12
|
+
/** Avatar dimensions. Valid values: `"xs"`, `"sm"`, `"md"`, `"lg"`, `"xl"`. @default "md" */
|
|
9
13
|
size?: AvatarSize;
|
|
14
|
+
/** Background color class for the initials fallback. @default "bg-primary-600" */
|
|
10
15
|
color?: string;
|
|
16
|
+
/** Additional CSS class names for the avatar container. */
|
|
11
17
|
className?: string;
|
|
18
|
+
/** React node rendered as a badge overlay at the bottom-right corner. */
|
|
12
19
|
badge?: ReactNode;
|
|
20
|
+
/** Click handler. When provided, the avatar becomes interactive (role="button"). */
|
|
13
21
|
onClick?: () => void;
|
|
14
22
|
}
|
|
@@ -10,21 +10,41 @@ const sizeMap: Record<AvatarSize, { container: string; text: string }> = {
|
|
|
10
10
|
xl: { container: "w-16 h-16", text: "text-xl" },
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
+
const DEFAULT_COLOR = "bg-primary-600";
|
|
14
|
+
const DEFAULT_BG = "var(--color-primary-600)";
|
|
15
|
+
const DEFAULT_SHADOW = "0 4px 14px 0 rgba(37, 99, 235, 0.35)";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Circular avatar component with image, initials fallback, and optional badge overlay.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* <ITAvatar src="/avatar.jpg" alt="John Doe" size="lg" badge={<span className="w-2.5 h-2.5 bg-success-500 rounded-full" />} />
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* <ITAvatar initials="JD" size="md" color="bg-purple-600" />
|
|
25
|
+
*/
|
|
13
26
|
export default function ITAvatar({
|
|
14
27
|
src,
|
|
15
28
|
alt = "",
|
|
16
29
|
initials,
|
|
17
30
|
size = "md",
|
|
18
|
-
color =
|
|
31
|
+
color = DEFAULT_COLOR,
|
|
19
32
|
className,
|
|
20
33
|
badge,
|
|
21
34
|
onClick,
|
|
22
35
|
}: ITAvatarProps) {
|
|
23
36
|
const { container, text } = sizeMap[size];
|
|
37
|
+
const useInlineStyle = !color || color === DEFAULT_COLOR;
|
|
24
38
|
|
|
25
39
|
return (
|
|
26
40
|
<div
|
|
27
|
-
className={clsx(
|
|
41
|
+
className={clsx(
|
|
42
|
+
"relative inline-flex items-center justify-center rounded-full flex-shrink-0 overflow-hidden text-white font-bold tracking-wide",
|
|
43
|
+
container,
|
|
44
|
+
!useInlineStyle && color,
|
|
45
|
+
className,
|
|
46
|
+
)}
|
|
47
|
+
style={useInlineStyle ? { backgroundColor: DEFAULT_BG, boxShadow: DEFAULT_SHADOW } : undefined}
|
|
28
48
|
onClick={onClick}
|
|
29
49
|
role={onClick ? "button" : undefined}
|
|
30
50
|
tabIndex={onClick ? 0 : undefined}
|
|
@@ -39,9 +59,9 @@ export default function ITAvatar({
|
|
|
39
59
|
}}
|
|
40
60
|
/>
|
|
41
61
|
) : (
|
|
42
|
-
<
|
|
43
|
-
<ITText as="span">{initials || alt.charAt(0).toUpperCase() || "?"}</ITText>
|
|
44
|
-
</
|
|
62
|
+
<span className={clsx("flex items-center justify-center w-full h-full", text)}>
|
|
63
|
+
<ITText as="span" className="text-white">{initials || alt.charAt(0).toUpperCase() || "?"}</ITText>
|
|
64
|
+
</span>
|
|
45
65
|
)}
|
|
46
66
|
{badge && (
|
|
47
67
|
<div className="absolute -bottom-0.5 -right-0.5">
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
+
import * as Stories from './badget.stories';
|
|
3
|
+
|
|
4
|
+
<Meta of={Stories} />
|
|
5
|
+
|
|
6
|
+
# ITBadget
|
|
7
|
+
|
|
8
|
+
Small status tags and labels for highlighting metadata, categories, or states. Offers filled and outlined visual variants across all semantic color themes. Accepts either a simple label string or custom React children for complex content.
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
|
|
12
|
+
| Prop | Type | Default | Description |
|
|
13
|
+
|------|------|---------|-------------|
|
|
14
|
+
| `label` | `string` | — | Text label displayed inside the badge. Overridden if `children` is provided. |
|
|
15
|
+
| `children` | `ReactNode` | — | Custom content rendered inside the badge. Takes precedence over `label`. |
|
|
16
|
+
| `color` | `ColorsTypes` | `"primary"` | Color theme key (`"primary"`, `"secondary"`, `"success"`, `"danger"`, `"warning"`, `"purple"`, `"info"`). |
|
|
17
|
+
| `size` | `SizesTypes` | `"medium"` | Badge size (`"small"`, `"medium"`, `"large"`). |
|
|
18
|
+
| `variant` | `"filled" \| "outlined"` | `"filled"` | Visual style — solid background or transparent with colored border. |
|
|
19
|
+
| `className` | `string` | — | Additional CSS class names for the badge element. |
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { ITBadget } from '@axzydev/axzy_ui_system';
|
|
25
|
+
|
|
26
|
+
<ITBadget label="Active" color="success" variant="filled" />
|
|
27
|
+
|
|
28
|
+
<ITBadget color="danger" variant="outlined" size="small">
|
|
29
|
+
<span className="flex items-center gap-1">3 new</span>
|
|
30
|
+
</ITBadget>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Variants / Notes
|
|
34
|
+
|
|
35
|
+
- **filled** — Solid background with contrasting text (default for most theme colors).
|
|
36
|
+
- **outlined** — Transparent background with a colored border and darker text.
|
|
37
|
+
- Colors include `primary`, `secondary`, `success`, `danger`, `warning`, `purple`, and `info`.
|
|
38
|
+
- Border radius defaults to fully rounded (`borderRadius: 9999px`), giving a pill shape.
|
|
39
|
+
- Styles are fully theme-driven via the centralized theme configuration.
|
|
40
|
+
- Custom children override the `label` prop entirely.
|
|
41
|
+
|
|
42
|
+
## Stories
|
|
43
|
+
|
|
44
|
+
<Primary />
|
|
45
|
+
<Controls />
|
|
46
|
+
<Stories />
|
|
@@ -3,10 +3,16 @@ import { ColorsTypes } from "@/types/colors.types";
|
|
|
3
3
|
import { SizesTypes } from "@/types/sizes.types";
|
|
4
4
|
|
|
5
5
|
export interface ITBadgetProps {
|
|
6
|
+
/** Text label displayed inside the badge. Overridden if `children` is provided. */
|
|
6
7
|
label?: string;
|
|
8
|
+
/** Custom content to render inside the badge. Takes precedence over `label`. */
|
|
7
9
|
children?: React.ReactNode;
|
|
10
|
+
/** Color theme key. Values come from the semantic color palette (e.g. `"primary"`, `"secondary"`, `"success"`, `"danger"`, `"warning"`, `"info"`, `"purple"`, `"error"`, `"gray"`). @default "primary" */
|
|
8
11
|
color?: ColorsTypes;
|
|
12
|
+
/** Badge size. Valid values: `"small"`, `"medium"`, `"large"`. @default "medium" */
|
|
9
13
|
size?: SizesTypes;
|
|
14
|
+
/** Badge visual style. Valid values: `"filled"`, `"outlined"`. @default "filled" */
|
|
10
15
|
variant?: keyof typeof badgeVariants;
|
|
16
|
+
/** Additional CSS class names for the badge element. */
|
|
11
17
|
className?: string;
|
|
12
18
|
}
|
|
@@ -7,6 +7,17 @@ import {
|
|
|
7
7
|
import { theme } from "@/theme/theme";
|
|
8
8
|
import ITText from "@/components/text/text";
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Small status tag or label with theme-based colors and filled/outlined variants.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <ITBadget label="Active" color="success" variant="filled" />
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* <ITBadget color="danger" variant="outlined" size="small">
|
|
18
|
+
* <span className="flex items-center gap-1">3 new</span>
|
|
19
|
+
* </ITBadget>
|
|
20
|
+
*/
|
|
10
21
|
export default function ITBadget({
|
|
11
22
|
children,
|
|
12
23
|
label,
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
+
import * as Stories from './breadcrumbs.stories';
|
|
3
|
+
|
|
4
|
+
<Meta of={Stories} />
|
|
5
|
+
|
|
6
|
+
# ITBreadcrumbs
|
|
7
|
+
|
|
8
|
+
Navigation breadcrumb trail component that displays the user's current location within a site hierarchy. Each item can be a link (`href`) or a button (`onClick`), with the last item automatically rendered as plain inactive text. Supports a custom separator between segments.
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
|
|
12
|
+
| Prop | Type | Default | Description |
|
|
13
|
+
|------|------|---------|-------------|
|
|
14
|
+
| `items` | `ITBreadcrumbItem[]` | required | Ordered array of breadcrumb segments. The last item is rendered as plain text. |
|
|
15
|
+
| `separator` | `ReactNode` | `<FaChevronRight size={10} />` | Custom separator element rendered between items. |
|
|
16
|
+
| `className` | `string` | — | Additional CSS class names for the `<nav>` container. |
|
|
17
|
+
|
|
18
|
+
### ITBreadcrumbItem
|
|
19
|
+
|
|
20
|
+
| Prop | Type | Default | Description |
|
|
21
|
+
|------|------|---------|-------------|
|
|
22
|
+
| `label` | `string` | required | Display text for the breadcrumb segment. |
|
|
23
|
+
| `href` | `string` | — | URL for the breadcrumb link. Renders an `<a>` tag. |
|
|
24
|
+
| `onClick` | `() => void` | — | Click handler. Renders a `<button>` when no `href` is set. |
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
import { ITBreadcrumbs } from '@axzydev/axzy_ui_system';
|
|
30
|
+
|
|
31
|
+
<ITBreadcrumbs
|
|
32
|
+
items={[
|
|
33
|
+
{ label: "Inicio", href: "#" },
|
|
34
|
+
{ label: "Usuarios", href: "#" },
|
|
35
|
+
{ label: "Editar Perfil" },
|
|
36
|
+
]}
|
|
37
|
+
/>
|
|
38
|
+
|
|
39
|
+
<ITBreadcrumbs
|
|
40
|
+
items={[...]}
|
|
41
|
+
separator={<FaArrowRight size={10} />}
|
|
42
|
+
/>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Variants / Notes
|
|
46
|
+
|
|
47
|
+
- The last item in the `items` array is always rendered as plain, non-interactive text representing the current page.
|
|
48
|
+
- Items with an `href` render as anchor tags (`<a>`), while items with only `onClick` render as buttons (`<button>`).
|
|
49
|
+
- Default separator is a chevron-right icon from FontAwesome (`FaChevronRight`).
|
|
50
|
+
- Wrapped in a semantic `<nav>` element for accessibility.
|
|
51
|
+
- The component is purely presentational — routing/navigation logic is handled by `href` or `onClick` props.
|
|
52
|
+
|
|
53
|
+
## Stories
|
|
54
|
+
|
|
55
|
+
<Primary />
|
|
56
|
+
<Controls />
|
|
57
|
+
<Stories />
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
|
|
3
3
|
export interface ITBreadcrumbItem {
|
|
4
|
+
/** Display text for the breadcrumb segment. */
|
|
4
5
|
label: string;
|
|
6
|
+
/** URL for the breadcrumb link. Renders an `<a>` tag. */
|
|
5
7
|
href?: string;
|
|
8
|
+
/** Click handler for the breadcrumb. Renders a `<button>` when no `href` is set. */
|
|
6
9
|
onClick?: () => void;
|
|
7
10
|
}
|
|
8
11
|
|
|
9
12
|
export interface ITBreadcrumbsProps {
|
|
13
|
+
/** Ordered array of breadcrumb items. The last item is rendered as plain text (current page). */
|
|
10
14
|
items: ITBreadcrumbItem[];
|
|
15
|
+
/** Custom separator element rendered between items. @default <FaChevronRight size={10} /> */
|
|
11
16
|
separator?: ReactNode;
|
|
17
|
+
/** Additional CSS class names for the `<nav>` container. */
|
|
12
18
|
className?: string;
|
|
13
19
|
}
|
|
@@ -3,6 +3,18 @@ import { ITBreadcrumbsProps } from "./breadcrumbs.props";
|
|
|
3
3
|
import { FaChevronRight } from "react-icons/fa";
|
|
4
4
|
import ITText from "@/components/text/text";
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Navigation breadcrumb trail with automatic link/button rendering and custom separator.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* <ITBreadcrumbs
|
|
11
|
+
* items={[
|
|
12
|
+
* { label: "Home", href: "/" },
|
|
13
|
+
* { label: "Products", href: "/products" },
|
|
14
|
+
* { label: "Details" },
|
|
15
|
+
* ]}
|
|
16
|
+
* />
|
|
17
|
+
*/
|
|
6
18
|
export default function ITBreadcrumbs({
|
|
7
19
|
items,
|
|
8
20
|
separator = <FaChevronRight size={10} />,
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
+
import * as Stories from './button.stories';
|
|
3
|
+
|
|
4
|
+
<Meta of={Stories} />
|
|
5
|
+
|
|
6
|
+
# ITButton
|
|
7
|
+
|
|
8
|
+
The primary action component for triggering user interactions. Supports 8 distinct visual variants, 7 semantic color themes, and 3 sizes. Can render with an icon alongside a label, as an icon-only control, as a text link, or with custom children for flexible content.
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
|
|
12
|
+
| Prop | Type | Default | Description |
|
|
13
|
+
|------|------|---------|-------------|
|
|
14
|
+
| `label` | `string` | — | Button text label. Overridden if `children` is provided. |
|
|
15
|
+
| `children` | `ReactNode` | — | Custom content rendered inside the button. Takes precedence over `label`. |
|
|
16
|
+
| `icon` | `ReactNode` | — | Icon element rendered before the label. |
|
|
17
|
+
| `onClick` | `() => void` | — | Click handler for the button. |
|
|
18
|
+
| `color` | `ColorsTypes` | `"primary"` | Color theme key (`"primary"`, `"secondary"`, `"success"`, `"danger"`, `"warning"`, `"purple"`, `"info"`). |
|
|
19
|
+
| `size` | `SizesTypes` | `"medium"` | Button size (`"small"`, `"medium"`, `"large"`). |
|
|
20
|
+
| `variant` | `"filled" \| "outlined" \| "raised" \| "rounded" \| "text" \| "raised-text" \| "icon-only" \| "link"` | `"filled"` | Visual style variant. |
|
|
21
|
+
| `disabled` | `boolean` | `false` | Disables interaction and applies reduced opacity. |
|
|
22
|
+
| `className` | `string` | — | Additional CSS class names for the button element. |
|
|
23
|
+
| `type` | `"submit" \| "reset" \| "button"` | `"button"` | HTML button type attribute. |
|
|
24
|
+
| `ariaLabel` | `string` | — | Accessible label for screen readers. Falls back to `label`. |
|
|
25
|
+
| `title` | `string` | — | HTML title attribute for native tooltip. |
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import { ITButton } from '@axzydev/axzy_ui_system';
|
|
31
|
+
|
|
32
|
+
<ITButton label="Guardar" color="primary" variant="filled" />
|
|
33
|
+
|
|
34
|
+
<ITButton label="Descargar" color="success" variant="outlined" icon={<FaDownload />} />
|
|
35
|
+
|
|
36
|
+
<ITButton color="danger" variant="icon-only" ariaLabel="Eliminar">
|
|
37
|
+
<FaTrash />
|
|
38
|
+
</ITButton>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Variants / Notes
|
|
42
|
+
|
|
43
|
+
- **filled** — Solid background with shadow, the default and most prominent variant.
|
|
44
|
+
- **outlined** — Transparent background with a colored border.
|
|
45
|
+
- **raised** — Solid background with a pronounced box shadow for depth.
|
|
46
|
+
- **rounded** — Like filled but with fully rounded (`rounded-full`) corners.
|
|
47
|
+
- **text** — Minimal transparent background with hover highlight, suitable for toolbars.
|
|
48
|
+
- **raised-text** — White background with subtle border and shadow, elevated appearance.
|
|
49
|
+
- **icon-only** — Square aspect ratio with centered icon, no text label.
|
|
50
|
+
- **link** — Renders as an inline text link with underline on hover.
|
|
51
|
+
- Seven color themes: `primary`, `secondary`, `success`, `danger`, `warning`, `purple`, `info`.
|
|
52
|
+
- When `disabled`, the button becomes non-interactive with reduced opacity.
|
|
53
|
+
- Set `type="submit"` for form submission behavior.
|
|
54
|
+
|
|
55
|
+
## Stories
|
|
56
|
+
|
|
57
|
+
<Primary />
|
|
58
|
+
<Controls />
|
|
59
|
+
<Stories />
|
|
@@ -3,16 +3,28 @@ import { ColorsTypes } from "@app/types/colors.types";
|
|
|
3
3
|
import { SizesTypes } from "@app/types/sizes.types";
|
|
4
4
|
|
|
5
5
|
export interface ITButtonProps {
|
|
6
|
+
/** Button text label. Overridden if `children` is provided. */
|
|
6
7
|
label?: string
|
|
8
|
+
/** Custom content to render inside the button. Takes precedence over `label`. */
|
|
7
9
|
children?: React.ReactNode;
|
|
10
|
+
/** Icon element rendered before the label. */
|
|
8
11
|
icon?: React.ReactNode;
|
|
12
|
+
/** Click handler for the button. */
|
|
9
13
|
onClick?: () => void;
|
|
14
|
+
/** Color theme key. Values come from the semantic color palette (e.g. `"primary"`, `"secondary"`, `"success"`, `"danger"`, `"warning"`, `"info"`, `"purple"`, `"error"`, `"gray"`). @default "primary" */
|
|
10
15
|
color?: ColorsTypes;
|
|
16
|
+
/** Button size. Valid values: `"small"`, `"medium"`, `"large"`. @default "medium" */
|
|
11
17
|
size?: SizesTypes;
|
|
18
|
+
/** Button visual style. Valid values: `"filled"`, `"outlined"`, `"raised"`, `"rounded"`, `"text"`, `"raised-text"`, `"icon-only"`, `"link"`. @default "filled" */
|
|
12
19
|
variant?: keyof typeof buttonVariants;
|
|
20
|
+
/** Disables the button interaction and applies reduced opacity. @default false */
|
|
13
21
|
disabled?: boolean;
|
|
22
|
+
/** Additional CSS class names for the button element. */
|
|
14
23
|
className?: string;
|
|
24
|
+
/** HTML button type attribute. Valid values: `"submit"`, `"reset"`, `"button"`. @default "button" */
|
|
15
25
|
type?: "submit" | "reset" | "button" | undefined;
|
|
26
|
+
/** Accessible label for screen readers. Falls back to `label` if not set. */
|
|
16
27
|
ariaLabel?: string;
|
|
28
|
+
/** HTML title attribute for native tooltip. Falls back to `ariaLabel` or `label`. */
|
|
17
29
|
title?: string;
|
|
18
30
|
}
|
|
@@ -8,6 +8,17 @@ import { theme } from "@/theme/theme";
|
|
|
8
8
|
import { ITButtonProps } from "./button.props";
|
|
9
9
|
import ITText from "@/components/text/text";
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Highly configurable action button supporting 8 visual variants, theme colors, 3 sizes, icons, and hover/focus states.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* <ITButton label="Submit" color="primary" variant="filled" onClick={() => {}} />
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* <ITButton color="danger" variant="outlined" size="small" icon={<FaTrash />}>
|
|
19
|
+
* Delete
|
|
20
|
+
* </ITButton>
|
|
21
|
+
*/
|
|
11
22
|
export default function ITButton({
|
|
12
23
|
children,
|
|
13
24
|
label,
|