@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
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Piezas propias del portafolio (`HomeShowcase` / `ProductoDetalle`).
|
|
3
|
+
*
|
|
4
|
+
* El kit base (tipografía de metadatos, superficies, CTA, etiquetas y controles
|
|
5
|
+
* de cabecera) vive en `src/sandbox/ui.tsx` y `src/sandbox/controls.tsx`, porque
|
|
6
|
+
* lo comparten el sandbox y el portafolio; aquí solo queda lo que es chrome de la
|
|
7
|
+
* hoja: progreso de lectura, salto al contenido y volver arriba.
|
|
8
|
+
*
|
|
9
|
+
* Vive en `src/showcases/` a propósito: es dev-only, nunca entra en `dist/`.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { useEffect, useState } from "react";
|
|
13
|
+
import { FaArrowUp } from "react-icons/fa";
|
|
14
|
+
import { useITTranslation } from "@/i18n";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Se reexporta el kit compartido para que las páginas del portafolio tengan un
|
|
18
|
+
* único punto de importación (`./portfolioUi`).
|
|
19
|
+
*/
|
|
20
|
+
export {
|
|
21
|
+
BotonAccion,
|
|
22
|
+
CARD,
|
|
23
|
+
CARD_HOVER,
|
|
24
|
+
CHIP,
|
|
25
|
+
EnlaceBoton,
|
|
26
|
+
Etiqueta,
|
|
27
|
+
EYEBROW,
|
|
28
|
+
FILETE,
|
|
29
|
+
SectionHeading,
|
|
30
|
+
VARIANTE_CTA,
|
|
31
|
+
} from "@/sandbox/ui";
|
|
32
|
+
export type {
|
|
33
|
+
BotonAccionProps,
|
|
34
|
+
EnlaceBotonProps,
|
|
35
|
+
EtiquetaProps,
|
|
36
|
+
TamanoCta,
|
|
37
|
+
VarianteCta,
|
|
38
|
+
} from "@/sandbox/ui";
|
|
39
|
+
export { ControlesPortafolio, ControlSegmentado } from "@/sandbox/controls";
|
|
40
|
+
|
|
41
|
+
/** Nombres antiguos del tamaño/variante de CTA, por compatibilidad. */
|
|
42
|
+
export type { TamanoCta as TamanoEnlace, VarianteCta as VarianteEnlace } from "@/sandbox/ui";
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Línea de progreso de lectura: 2px de acento al pie de la cabecera sticky.
|
|
46
|
+
* Es chrome del portafolio, no un componente de la librería: `ITProgress` mide
|
|
47
|
+
* 4px y redondea, demasiado grueso para una regla de cabecera.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```tsx
|
|
51
|
+
* <header className="relative sticky top-0 …">
|
|
52
|
+
* <PortfolioNav />
|
|
53
|
+
* <BarraProgreso />
|
|
54
|
+
* </header>
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export const BarraProgreso = () => {
|
|
58
|
+
const [pct, setPct] = useState(0);
|
|
59
|
+
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
const onScroll = () => {
|
|
62
|
+
const max = document.documentElement.scrollHeight - window.innerHeight;
|
|
63
|
+
setPct(max > 0 ? Math.min(100, Math.max(0, (window.scrollY / max) * 100)) : 0);
|
|
64
|
+
};
|
|
65
|
+
onScroll();
|
|
66
|
+
window.addEventListener("scroll", onScroll, { passive: true });
|
|
67
|
+
window.addEventListener("resize", onScroll);
|
|
68
|
+
return () => {
|
|
69
|
+
window.removeEventListener("scroll", onScroll);
|
|
70
|
+
window.removeEventListener("resize", onScroll);
|
|
71
|
+
};
|
|
72
|
+
}, []);
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<div aria-hidden className="absolute inset-x-0 bottom-0 h-[2px] overflow-hidden">
|
|
76
|
+
<div
|
|
77
|
+
className="h-full bg-primary-700 transition-[width] duration-150 ease-out dark:bg-primary-500"
|
|
78
|
+
style={{ width: `${pct}%` }}
|
|
79
|
+
/>
|
|
80
|
+
</div>
|
|
81
|
+
);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/** Props de `SaltarContenido`. */
|
|
85
|
+
export interface SaltarContenidoProps {
|
|
86
|
+
/** Id (con `#`) del bloque principal. @default "#contenido" */
|
|
87
|
+
destino?: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Enlace de salto para teclado (WCAG 2.4.1): invisible hasta que recibe foco y
|
|
92
|
+
* entonces aparece sobre la cabecera sticky.
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```tsx
|
|
96
|
+
* <SaltarContenido />
|
|
97
|
+
* <main id="contenido">…</main>
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
export const SaltarContenido = ({ destino = "#contenido" }: SaltarContenidoProps) => {
|
|
101
|
+
const { t } = useITTranslation();
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<a
|
|
105
|
+
href={destino}
|
|
106
|
+
className="sr-only focus:not-sr-only focus:fixed focus:left-4 focus:top-4 focus:z-[300] focus:rounded-[10px] focus:bg-primary-700 focus:px-4 focus:py-2 focus:text-sm focus:font-semibold focus:text-white focus:shadow-lg"
|
|
107
|
+
>
|
|
108
|
+
{t("showcase.home.skipToContent")}
|
|
109
|
+
</a>
|
|
110
|
+
);
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Botón flotante «volver arriba»: aparece tras desplazarse una pantalla y sube
|
|
115
|
+
* con scroll suave (o instantáneo si el sistema pide movimiento reducido).
|
|
116
|
+
* Mono y con borde de 1px, como el resto de los metadatos del portafolio.
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```tsx
|
|
120
|
+
* <VolverArriba />
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
export const VolverArriba = () => {
|
|
124
|
+
const { t } = useITTranslation();
|
|
125
|
+
const [visible, setVisible] = useState(false);
|
|
126
|
+
|
|
127
|
+
useEffect(() => {
|
|
128
|
+
const onScroll = () => setVisible(window.scrollY > 560);
|
|
129
|
+
onScroll();
|
|
130
|
+
window.addEventListener("scroll", onScroll, { passive: true });
|
|
131
|
+
return () => window.removeEventListener("scroll", onScroll);
|
|
132
|
+
}, []);
|
|
133
|
+
|
|
134
|
+
const subir = () => {
|
|
135
|
+
const reducido = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
136
|
+
window.scrollTo({ top: 0, behavior: reducido ? "auto" : "smooth" });
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
return (
|
|
140
|
+
<button
|
|
141
|
+
type="button"
|
|
142
|
+
onClick={subir}
|
|
143
|
+
tabIndex={visible ? 0 : -1}
|
|
144
|
+
aria-hidden={visible ? undefined : true}
|
|
145
|
+
className={`fixed bottom-6 right-6 z-[200] inline-flex items-center gap-2 rounded-[10px] border border-slate-200 bg-white/90 px-3.5 py-2 font-mono text-[11px] font-medium uppercase tracking-[0.12em] text-slate-600 backdrop-blur-md transition-all duration-200 hover:-translate-y-0.5 hover:border-primary-400 hover:text-primary-700 dark:border-slate-800 dark:bg-slate-900/90 dark:text-slate-300 dark:hover:border-primary-500 dark:hover:text-primary-500 ${
|
|
146
|
+
visible ? "opacity-100" : "pointer-events-none translate-y-2 opacity-0"
|
|
147
|
+
}`}
|
|
148
|
+
>
|
|
149
|
+
<FaArrowUp size={11} aria-hidden />
|
|
150
|
+
{t("showcase.home.backToTop")}
|
|
151
|
+
</button>
|
|
152
|
+
);
|
|
153
|
+
};
|
|
@@ -40,6 +40,7 @@ const ICONS = {
|
|
|
40
40
|
nodejs: { src: "/tech-icons/nodejs.svg" },
|
|
41
41
|
flutter: { src: "/tech-icons/flutter.svg" },
|
|
42
42
|
express: { src: "/tech-icons/express.svg", mono: true },
|
|
43
|
+
springboot: { src: "/tech-icons/springboot.svg" },
|
|
43
44
|
electron: { src: "/tech-icons/electron.svg" },
|
|
44
45
|
redux: { src: "/tech-icons/redux.svg" },
|
|
45
46
|
// Markup, styles & data
|
|
@@ -48,8 +49,10 @@ const ICONS = {
|
|
|
48
49
|
sass: { src: "/tech-icons/sass.svg" },
|
|
49
50
|
mongodb: { src: "/tech-icons/mongodb.svg" },
|
|
50
51
|
mysql: { src: "/tech-icons/mysql.svg" },
|
|
52
|
+
postgresql: { src: "/tech-icons/postgresql.svg" },
|
|
51
53
|
// Mobile & platform
|
|
52
54
|
android: { src: "/tech-icons/android.svg" },
|
|
55
|
+
appium: { src: "/tech-icons/appium.svg" },
|
|
53
56
|
// Tooling & DevOps
|
|
54
57
|
docker: { src: "/tech-icons/docker.svg" },
|
|
55
58
|
git: { src: "/tech-icons/git.svg" },
|
package/src/utils/table.utils.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Formatea un número como moneda MXN.
|
|
3
|
+
*
|
|
4
|
+
* @param value - Importe a formatear.
|
|
5
|
+
* @param locale - Locale BCP-47 para `Intl.NumberFormat`. Por defecto `"es-MX"`
|
|
6
|
+
* para mantener el comportamiento histórico; los componentes pasan la locale
|
|
7
|
+
* activa del provider (`toIntlLocale(locale)`).
|
|
8
|
+
*/
|
|
9
|
+
export const formatCurrencyMX = (value: number, locale: string = "es-MX") => {
|
|
10
|
+
return value.toLocaleString(locale, {
|
|
3
11
|
style: "currency",
|
|
4
12
|
currency: "MXN",
|
|
5
13
|
});
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
-
import * as StoriesData from './avatar.stories';
|
|
3
|
-
|
|
4
|
-
<Meta of={StoriesData} />
|
|
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 />
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import ITAvatar from "@/components/atoms/avatar/avatar";
|
|
3
|
-
import { FaCircle } from "react-icons/fa";
|
|
4
|
-
|
|
5
|
-
const meta: Meta<typeof ITAvatar> = {
|
|
6
|
-
title: "Components/Data Display/ITAvatar",
|
|
7
|
-
component: ITAvatar,
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export default meta;
|
|
11
|
-
type Story = StoryObj<typeof ITAvatar>;
|
|
12
|
-
|
|
13
|
-
export const WithImage: Story = {
|
|
14
|
-
args: {
|
|
15
|
-
src: "https://i.pravatar.cc/150?u=test",
|
|
16
|
-
alt: "User",
|
|
17
|
-
size: "md",
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const WithInitials: Story = {
|
|
22
|
-
args: {
|
|
23
|
-
initials: "JD",
|
|
24
|
-
size: "md",
|
|
25
|
-
color: "bg-primary-500",
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const WithBadge: Story = {
|
|
30
|
-
args: {
|
|
31
|
-
initials: "AG",
|
|
32
|
-
size: "lg",
|
|
33
|
-
badge: <FaCircle className="text-emerald-500 text-[10px]" />,
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export const Sizes: Story = {
|
|
38
|
-
render: () => (
|
|
39
|
-
<div className="flex items-end gap-4">
|
|
40
|
-
{(["xs", "sm", "md", "lg", "xl"] as const).map((s) => (
|
|
41
|
-
<ITAvatar key={s} initials="A" size={s} />
|
|
42
|
-
))}
|
|
43
|
-
</div>
|
|
44
|
-
),
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export const WithRawColor: Story = {
|
|
48
|
-
name: "Con color calculado en runtime",
|
|
49
|
-
parameters: {
|
|
50
|
-
docs: {
|
|
51
|
-
description: {
|
|
52
|
-
story:
|
|
53
|
-
"Cuando el color se calcula dinámicamente (por ejemplo, un hash por usuario o etiqueta), pasa un valor de color real en vez de una clase de Tailwind. Una clase de Tailwind arbitraria solo se ve si ya existe en el CSS pre-compilado de esta librería; un color inline siempre se aplica.",
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
render: () => (
|
|
58
|
-
<div className="flex items-center gap-4">
|
|
59
|
-
{["#3b82f6", "#a855f7", "#059669", "#f59e0b", "#ec4899"].map((hex) => (
|
|
60
|
-
<ITAvatar key={hex} initials="JD" size="md" color={hex} />
|
|
61
|
-
))}
|
|
62
|
-
</div>
|
|
63
|
-
),
|
|
64
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
-
import * as StoriesData from './badget.stories';
|
|
3
|
-
|
|
4
|
-
<Meta of={StoriesData} />
|
|
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` | `"md"` | Badge size (`"sm"`, `"md"`, `"lg"`). |
|
|
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="sm">
|
|
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 />
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import ITBadget from '@/components/atoms/badget/badget';
|
|
3
|
-
|
|
4
|
-
const meta = {
|
|
5
|
-
title: 'Components/Data Display/ITBadge',
|
|
6
|
-
component: ITBadget,
|
|
7
|
-
parameters: {
|
|
8
|
-
layout: 'centered',
|
|
9
|
-
},
|
|
10
|
-
argTypes: {
|
|
11
|
-
color: {
|
|
12
|
-
control: 'select',
|
|
13
|
-
options: ['primary', 'secondary', 'success', 'danger', 'warning', 'purple', 'info'],
|
|
14
|
-
},
|
|
15
|
-
variant: {
|
|
16
|
-
control: 'select',
|
|
17
|
-
options: ['filled', 'outlined'],
|
|
18
|
-
},
|
|
19
|
-
size: {
|
|
20
|
-
control: 'select',
|
|
21
|
-
options: ['small', 'medium', 'large'],
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
} satisfies Meta<typeof ITBadget>;
|
|
25
|
-
|
|
26
|
-
export default meta;
|
|
27
|
-
type Story = StoryObj<typeof meta>;
|
|
28
|
-
|
|
29
|
-
// 1. Filled (Default)
|
|
30
|
-
export const Filled: Story = {
|
|
31
|
-
args: {
|
|
32
|
-
label: 'Filled Badge',
|
|
33
|
-
color: 'primary',
|
|
34
|
-
variant: 'filled',
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
// 2. Outlined
|
|
39
|
-
export const Outlined: Story = {
|
|
40
|
-
args: {
|
|
41
|
-
label: 'Outlined Badge',
|
|
42
|
-
color: 'primary',
|
|
43
|
-
variant: 'outlined',
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
// 3. All Combinations (Matrix)
|
|
48
|
-
export const AllCombinations: Story = {
|
|
49
|
-
render: (args) => {
|
|
50
|
-
const colors = ['primary', 'secondary', 'success', 'danger', 'warning', 'purple', 'info'];
|
|
51
|
-
const variants = ['filled', 'outlined'];
|
|
52
|
-
|
|
53
|
-
return (
|
|
54
|
-
<div className="flex flex-col gap-8">
|
|
55
|
-
{variants.map((variant) => (
|
|
56
|
-
<div key={variant} className="flex flex-col gap-2">
|
|
57
|
-
<h3 className="text-sm font-bold uppercase text-gray-400">{variant}</h3>
|
|
58
|
-
<div className="flex flex-wrap gap-4 items-center">
|
|
59
|
-
{colors.map((color) => (
|
|
60
|
-
<ITBadget
|
|
61
|
-
key={`${variant}-${color}`}
|
|
62
|
-
{...args}
|
|
63
|
-
color={color as any}
|
|
64
|
-
variant={variant as any}
|
|
65
|
-
label={color.charAt(0).toUpperCase() + color.slice(1)}
|
|
66
|
-
/>
|
|
67
|
-
))}
|
|
68
|
-
</div>
|
|
69
|
-
</div>
|
|
70
|
-
))}
|
|
71
|
-
</div>
|
|
72
|
-
);
|
|
73
|
-
},
|
|
74
|
-
args: {},
|
|
75
|
-
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { Meta, Title, Description, Primary, Controls, Stories } from '@storybook/blocks';
|
|
2
|
-
import * as StoriesData from './button.stories';
|
|
3
|
-
|
|
4
|
-
<Meta of={StoriesData} />
|
|
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` | `"md"` | Button size (`"sm"`, `"md"`, `"lg"`). |
|
|
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 />
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import ITButton from '@/components/atoms/button/button';
|
|
3
|
-
|
|
4
|
-
const meta = {
|
|
5
|
-
title: 'Components/Actions/ITButton',
|
|
6
|
-
component: ITButton,
|
|
7
|
-
parameters: {
|
|
8
|
-
layout: 'centered',
|
|
9
|
-
},
|
|
10
|
-
argTypes: {
|
|
11
|
-
color: {
|
|
12
|
-
control: 'select',
|
|
13
|
-
options: ['primary', 'secondary', 'success', 'danger', 'warning', 'purple', 'info'],
|
|
14
|
-
description: 'The semantic color of the button',
|
|
15
|
-
},
|
|
16
|
-
variant: {
|
|
17
|
-
control: 'select',
|
|
18
|
-
options: ['filled', 'outlined', 'raised', 'rounded', 'text', 'raised-text', 'icon-only', 'link'],
|
|
19
|
-
description: 'The visual style variant',
|
|
20
|
-
},
|
|
21
|
-
size: {
|
|
22
|
-
control: 'select',
|
|
23
|
-
options: ['small', 'medium', 'large'],
|
|
24
|
-
description: 'Button size (padding/font)',
|
|
25
|
-
},
|
|
26
|
-
label: { control: 'text' },
|
|
27
|
-
disabled: { control: 'boolean' },
|
|
28
|
-
},
|
|
29
|
-
} satisfies Meta<typeof ITButton>;
|
|
30
|
-
|
|
31
|
-
export default meta;
|
|
32
|
-
type Story = StoryObj<typeof meta>;
|
|
33
|
-
|
|
34
|
-
// 1. Filled (Default)
|
|
35
|
-
export const Filled: Story = {
|
|
36
|
-
args: {
|
|
37
|
-
label: 'Filled Button',
|
|
38
|
-
color: 'primary',
|
|
39
|
-
variant: 'filled',
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
// 2. Outlined
|
|
44
|
-
export const Outlined: Story = {
|
|
45
|
-
args: {
|
|
46
|
-
label: 'Outlined Button',
|
|
47
|
-
color: 'primary',
|
|
48
|
-
variant: 'outlined',
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
// 3. Raised (Shadow)
|
|
53
|
-
export const Raised: Story = {
|
|
54
|
-
args: {
|
|
55
|
-
label: 'Raised Button',
|
|
56
|
-
color: 'primary',
|
|
57
|
-
variant: 'raised',
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
// 4. Rounded (Pill)
|
|
62
|
-
export const Rounded: Story = {
|
|
63
|
-
args: {
|
|
64
|
-
label: 'Rounded Button',
|
|
65
|
-
color: 'success',
|
|
66
|
-
variant: 'rounded',
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
// 5. Text (Ghost)
|
|
71
|
-
export const Text: Story = {
|
|
72
|
-
args: {
|
|
73
|
-
label: 'Text Button',
|
|
74
|
-
color: 'info',
|
|
75
|
-
variant: 'text',
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
// 6. Raised Text (Elevated White)
|
|
80
|
-
export const RaisedText: Story = {
|
|
81
|
-
args: {
|
|
82
|
-
label: 'Raised Text',
|
|
83
|
-
color: 'warning',
|
|
84
|
-
variant: 'raised-text',
|
|
85
|
-
},
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
// 7. With Icon (icon prop + label)
|
|
89
|
-
export const WithIcon: Story = {
|
|
90
|
-
args: {
|
|
91
|
-
label: 'Guardar',
|
|
92
|
-
color: 'primary',
|
|
93
|
-
variant: 'filled',
|
|
94
|
-
icon: <span style={{ fontSize: '1em' }}>💾</span>,
|
|
95
|
-
},
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
// 8. Icon Only
|
|
99
|
-
export const IconOnly: Story = {
|
|
100
|
-
args: {
|
|
101
|
-
color: 'danger',
|
|
102
|
-
variant: 'icon-only',
|
|
103
|
-
children: <span style={{ fontSize: '1.2em' }}>★</span>,
|
|
104
|
-
ariaLabel: 'Favorite',
|
|
105
|
-
},
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
// 8. Link
|
|
109
|
-
export const Link: Story = {
|
|
110
|
-
args: {
|
|
111
|
-
label: 'Link Button',
|
|
112
|
-
color: 'primary',
|
|
113
|
-
variant: 'link',
|
|
114
|
-
},
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
// 9. All Colors Showcase (Kitchen Sink for colors)
|
|
118
|
-
export const AllColors: Story = {
|
|
119
|
-
render: (args) => (
|
|
120
|
-
<div className="flex flex-wrap gap-4">
|
|
121
|
-
{['primary', 'secondary', 'success', 'danger', 'warning', 'purple', 'info'].map((color) => (
|
|
122
|
-
<ITButton key={color} {...args} color={color as any} label={color.charAt(0).toUpperCase() + color.slice(1)} />
|
|
123
|
-
))}
|
|
124
|
-
</div>
|
|
125
|
-
),
|
|
126
|
-
args: {
|
|
127
|
-
variant: 'filled',
|
|
128
|
-
},
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
// 9. Disabled
|
|
132
|
-
export const Disabled: Story = {
|
|
133
|
-
args: {
|
|
134
|
-
label: 'Disabled Button',
|
|
135
|
-
disabled: true,
|
|
136
|
-
color: 'primary',
|
|
137
|
-
variant: 'filled',
|
|
138
|
-
},
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
// 10. All Combinations (Matrix)
|
|
142
|
-
export const AllCombinations: Story = {
|
|
143
|
-
render: (args) => {
|
|
144
|
-
const colors = ['primary', 'secondary', 'success', 'danger', 'warning', 'purple', 'info'];
|
|
145
|
-
const variants = ['filled', 'outlined', 'raised', 'rounded', 'text', 'raised-text', 'icon-only', 'link'];
|
|
146
|
-
|
|
147
|
-
return (
|
|
148
|
-
<div className="flex flex-col gap-8">
|
|
149
|
-
{variants.map((variant) => (
|
|
150
|
-
<div key={variant} className="flex flex-col gap-2">
|
|
151
|
-
<h3 className="text-sm font-bold uppercase text-gray-400">{variant}</h3>
|
|
152
|
-
<div className="flex flex-wrap gap-4 items-center">
|
|
153
|
-
{colors.map((color) => (
|
|
154
|
-
<ITButton
|
|
155
|
-
key={`${variant}-${color}`}
|
|
156
|
-
{...args}
|
|
157
|
-
color={color as any}
|
|
158
|
-
variant={variant as any}
|
|
159
|
-
label={variant === 'icon-only' ? undefined : (color.charAt(0).toUpperCase() + color.slice(1))}
|
|
160
|
-
ariaLabel={variant === 'icon-only' ? color : undefined}
|
|
161
|
-
>
|
|
162
|
-
{variant === 'icon-only' ? <span style={{ fontSize: '1.2em' }}>★</span> : undefined}
|
|
163
|
-
</ITButton>
|
|
164
|
-
))}
|
|
165
|
-
</div>
|
|
166
|
-
</div>
|
|
167
|
-
))}
|
|
168
|
-
</div>
|
|
169
|
-
);
|
|
170
|
-
},
|
|
171
|
-
args: {},
|
|
172
|
-
};
|
|
173
|
-
|