@sector.siit/mlz-components 1.0.0-rc.202508072114

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 ADDED
@@ -0,0 +1,176 @@
1
+ # MLZ Components
2
+
3
+ Una librería moderna de componentes React con Tailwind CSS y variables CSS customizables.
4
+
5
+ ## 🚀 Características
6
+
7
+ - ⚛️ **React 18** - Componentes modernos con TypeScript
8
+ - 🎨 **Tailwind CSS** - Sistema de diseño utility-first
9
+ - 🎯 **Variables CSS** - Personalización completa desde tu proyecto
10
+ - 📚 **Storybook** - Documentación interactiva
11
+ - 📦 **Tree-shakeable** - Importa solo lo que necesitas
12
+ - 🔧 **TypeScript** - Tipado completo
13
+ - ✅ **Probado** - Tests unitarios incluidos
14
+
15
+ ## 📦 Instalación
16
+
17
+ ```bash
18
+ npm install @sector.siit/mlz-components
19
+ # o
20
+ yarn add @sector.siit/mlz-components
21
+ # o
22
+ bun add @sector.siit/mlz-components
23
+ ```
24
+
25
+ ## 🎯 Uso Básico
26
+
27
+ ```tsx
28
+ import { Button } from '@sector.siit/mlz-components';
29
+
30
+ function App() {
31
+ return (
32
+ <Button variant="primary" size="md">
33
+ ¡Hola Mundo!
34
+ </Button>
35
+ );
36
+ }
37
+ ```
38
+
39
+ ## 🎨 Personalización con Variables CSS
40
+
41
+ La librería utiliza variables CSS que puedes sobrescribir en tu proyecto:
42
+
43
+ ```css
44
+ /* En tu archivo CSS global */
45
+ :root {
46
+ /* Colores primarios */
47
+ --mlz-primary-500: #10b981;
48
+ --mlz-primary-600: #059669;
49
+ --mlz-primary-700: #047857;
50
+
51
+ /* Espaciado */
52
+ --mlz-spacing-sm: 0.75rem;
53
+ --mlz-spacing-md: 1.25rem;
54
+ --mlz-spacing-lg: 2rem;
55
+
56
+ /* Border radius */
57
+ --mlz-border-radius-md: 0.5rem;
58
+
59
+ /* Tamaños de fuente */
60
+ --mlz-font-size-base: 1.125rem;
61
+ }
62
+ ```
63
+
64
+ ### Variables Disponibles
65
+
66
+ #### Colores
67
+ - `--mlz-primary-[50-950]`: Paleta de colores primarios
68
+ - `--mlz-secondary-[50-950]`: Paleta de colores secundarios
69
+
70
+ #### Espaciado
71
+ - `--mlz-spacing-xs`: 0.25rem (por defecto)
72
+ - `--mlz-spacing-sm`: 0.5rem (por defecto)
73
+ - `--mlz-spacing-md`: 1rem (por defecto)
74
+ - `--mlz-spacing-lg`: 1.5rem (por defecto)
75
+ - `--mlz-spacing-xl`: 2rem (por defecto)
76
+ - `--mlz-spacing-2xl`: 3rem (por defecto)
77
+
78
+ #### Border Radius
79
+ - `--mlz-border-radius-sm`: 0.25rem (por defecto)
80
+ - `--mlz-border-radius-md`: 0.375rem (por defecto)
81
+ - `--mlz-border-radius-lg`: 0.5rem (por defecto)
82
+ - `--mlz-border-radius-xl`: 0.75rem (por defecto)
83
+
84
+ #### Tamaños de Fuente
85
+ - `--mlz-font-size-xs`: 0.75rem (por defecto)
86
+ - `--mlz-font-size-sm`: 0.875rem (por defecto)
87
+ - `--mlz-font-size-base`: 1rem (por defecto)
88
+ - `--mlz-font-size-lg`: 1.125rem (por defecto)
89
+ - `--mlz-font-size-xl`: 1.25rem (por defecto)
90
+
91
+ ## 📚 Componentes
92
+
93
+ ### Button
94
+
95
+ Un componente de botón versatil con múltiples variantes y tamaños.
96
+
97
+ #### Props
98
+
99
+ | Prop | Tipo | Default | Descripción |
100
+ |------|------|---------|-------------|
101
+ | `variant` | `'primary' \| 'secondary' \| 'outline' \| 'ghost'` | `'primary'` | Variante visual del botón |
102
+ | `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Tamaño del botón |
103
+ | `children` | `React.ReactNode` | - | Contenido del botón |
104
+ | `disabled` | `boolean` | `false` | Estado deshabilitado |
105
+ | `onClick` | `(event: MouseEvent) => void` | - | Función de click |
106
+
107
+ #### Ejemplos
108
+
109
+ ```tsx
110
+ // Variantes
111
+ <Button variant="primary">Primario</Button>
112
+ <Button variant="secondary">Secundario</Button>
113
+ <Button variant="outline">Outline</Button>
114
+ <Button variant="ghost">Ghost</Button>
115
+
116
+ // Tamaños
117
+ <Button size="sm">Pequeño</Button>
118
+ <Button size="md">Mediano</Button>
119
+ <Button size="lg">Grande</Button>
120
+
121
+ // Estados
122
+ <Button disabled>Deshabilitado</Button>
123
+ ```
124
+
125
+ ## 🛠️ Desarrollo
126
+
127
+ ```bash
128
+ # Instalar dependencias
129
+ npm install
130
+
131
+ # Desarrollo con Storybook
132
+ npm run storybook
133
+
134
+ # Build de la librería
135
+ npm run build
136
+
137
+ # Lint
138
+ npm run lint
139
+
140
+ # Type check
141
+ npm run typecheck
142
+ ```
143
+
144
+ ## 🚀 Despliegue
145
+
146
+ El proyecto incluye GitHub Actions para:
147
+
148
+ 1. **Despliegue automático a NPM** cuando cambia la versión en `package.json`
149
+ 2. **Despliegue de Storybook a GitHub Pages** en cada push a main
150
+
151
+ ### Configuración necesaria:
152
+
153
+ 1. **NPM Token**: Añade `NPM_TOKEN` a los secrets de GitHub
154
+ 2. **GitHub Pages**: Habilita GitHub Pages en la configuración del repositorio
155
+
156
+ ## 📄 Licencia
157
+
158
+ MIT
159
+
160
+ ## 🤝 Contribuir
161
+
162
+ 1. Fork el proyecto
163
+ 2. Crea una rama para tu feature (`git checkout -b feature/AmazingFeature`)
164
+ 3. Commit tus cambios (`git commit -m 'Add some AmazingFeature'`)
165
+ 4. Push a la rama (`git push origin feature/AmazingFeature`)
166
+ 5. Abre un Pull Request
167
+
168
+ ## 📈 Roadmap
169
+
170
+ - [ ] Componente Input
171
+ - [ ] Componente Card
172
+ - [ ] Componente Modal
173
+ - [ ] Componente Dropdown
174
+ - [ ] Sistema de themes predefenidos
175
+ - [ ] Componentes de formulario
176
+ - [ ] Componentes de navegación
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
3
+ /**
4
+ * Contenido del botón
5
+ */
6
+ children: React.ReactNode;
7
+ /**
8
+ * Variante del botón
9
+ */
10
+ variant?: 'primary' | 'secondary' | 'outline' | 'ghost';
11
+ /**
12
+ * Tamaño del botón
13
+ */
14
+ size?: 'sm' | 'md' | 'lg';
15
+ }
16
+ export declare const Button: React.FC<ButtonProps>;
17
+ export default Button;
18
+ //# sourceMappingURL=Button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IAChF;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC;IACxD;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B;AAeD,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA4BxC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { Button } from './Button';
3
+ declare const meta: Meta<typeof Button>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof meta>;
6
+ export declare const Primary: Story;
7
+ export declare const Secondary: Story;
8
+ export declare const Outline: Story;
9
+ export declare const Ghost: Story;
10
+ export declare const Small: Story;
11
+ export declare const Medium: Story;
12
+ export declare const Large: Story;
13
+ export declare const Disabled: Story;
14
+ export declare const AllVariants: Story;
15
+ export declare const CustomColors: Story;
16
+ //# sourceMappingURL=Button.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CAgC7B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAKvB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAKnB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAKnB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAKpB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAKnB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAKtB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAmBzB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAgC1B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { Button } from './Button';
2
+ export type { ButtonProps } from './Button';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
3
+ /** Variante visual del input */
4
+ variant?: 'default' | 'error' | 'success';
5
+ /** Tamaño del input */
6
+ size?: 'sm' | 'md' | 'lg';
7
+ /** Si el input tiene un label */
8
+ label?: string;
9
+ /** Texto de ayuda debajo del input */
10
+ helperText?: string;
11
+ /** Texto de error */
12
+ errorText?: string;
13
+ /** Si el input es de ancho completo */
14
+ fullWidth?: boolean;
15
+ }
16
+ /**
17
+ * Componente Input básico con diferentes variantes y tamaños
18
+ */
19
+ export declare const Input: React.FC<InputProps>;
20
+ export default Input;
21
+ //# sourceMappingURL=Input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC3F,gCAAgC;IAChC,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;IAC1C,uBAAuB;IACvB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CA4HtC,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -0,0 +1,84 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ declare const meta: {
3
+ title: string;
4
+ component: import("react").FC<import("./Input").InputProps>;
5
+ parameters: {
6
+ layout: string;
7
+ docs: {
8
+ description: {
9
+ component: string;
10
+ };
11
+ };
12
+ };
13
+ tags: string[];
14
+ argTypes: {
15
+ variant: {
16
+ control: {
17
+ type: string;
18
+ };
19
+ options: string[];
20
+ description: string;
21
+ };
22
+ size: {
23
+ control: {
24
+ type: string;
25
+ };
26
+ options: string[];
27
+ description: string;
28
+ };
29
+ label: {
30
+ control: {
31
+ type: string;
32
+ };
33
+ description: string;
34
+ };
35
+ placeholder: {
36
+ control: {
37
+ type: string;
38
+ };
39
+ description: string;
40
+ };
41
+ helperText: {
42
+ control: {
43
+ type: string;
44
+ };
45
+ description: string;
46
+ };
47
+ errorText: {
48
+ control: {
49
+ type: string;
50
+ };
51
+ description: string;
52
+ };
53
+ fullWidth: {
54
+ control: {
55
+ type: string;
56
+ };
57
+ description: string;
58
+ };
59
+ disabled: {
60
+ control: {
61
+ type: string;
62
+ };
63
+ description: string;
64
+ };
65
+ };
66
+ };
67
+ export default meta;
68
+ type Story = StoryObj<typeof meta>;
69
+ export declare const Default: Story;
70
+ export declare const WithLabel: Story;
71
+ export declare const WithHelperText: Story;
72
+ export declare const WithError: Story;
73
+ export declare const Success: Story;
74
+ export declare const Small: Story;
75
+ export declare const Medium: Story;
76
+ export declare const Large: Story;
77
+ export declare const Disabled: Story;
78
+ export declare const FullWidth: Story;
79
+ export declare const Password: Story;
80
+ export declare const Email: Story;
81
+ export declare const Number: Story;
82
+ export declare const AllVariants: Story;
83
+ export declare const AllSizes: Story;
84
+ //# sourceMappingURL=Input.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Input.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGvD,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDoB,CAAC;AAE/B,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAGnC,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC;AAGF,eAAO,MAAM,SAAS,EAAE,KAKvB,CAAC;AAGF,eAAO,MAAM,cAAc,EAAE,KAM5B,CAAC;AAGF,eAAO,MAAM,SAAS,EAAE,KAOvB,CAAC;AAGF,eAAO,MAAM,OAAO,EAAE,KAQrB,CAAC;AAGF,eAAO,MAAM,KAAK,EAAE,KAMnB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAMpB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAMnB,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,KAOtB,CAAC;AAGF,eAAO,MAAM,SAAS,EAAE,KAUvB,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,KAOtB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAMnB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAQpB,CAAC;AAGF,eAAO,MAAM,WAAW,EAAE,KAyBzB,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,KAuBtB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { Input, type InputProps } from './Input';
2
+ export { default } from './Input';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+
3
+ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
4
+ /**
5
+ * Contenido del botón
6
+ */
7
+ children: React.ReactNode;
8
+ /**
9
+ * Variante del botón
10
+ */
11
+ variant?: 'primary' | 'secondary' | 'outline' | 'ghost';
12
+ /**
13
+ * Tamaño del botón
14
+ */
15
+ size?: 'sm' | 'md' | 'lg';
16
+ }
17
+ declare const Button: React.FC<ButtonProps>;
18
+
19
+ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
20
+ /** Variante visual del input */
21
+ variant?: 'default' | 'error' | 'success';
22
+ /** Tamaño del input */
23
+ size?: 'sm' | 'md' | 'lg';
24
+ /** Si el input tiene un label */
25
+ label?: string;
26
+ /** Texto de ayuda debajo del input */
27
+ helperText?: string;
28
+ /** Texto de error */
29
+ errorText?: string;
30
+ /** Si el input es de ancho completo */
31
+ fullWidth?: boolean;
32
+ }
33
+ /**
34
+ * Componente Input básico con diferentes variantes y tamaños
35
+ */
36
+ declare const Input: React.FC<InputProps>;
37
+
38
+ export { Button, Input };
39
+ export type { ButtonProps, InputProps };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,cAAc,CAAC;AAGtB,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC"}