adverich-kun-ui 0.1.573 → 0.1.575
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/AGENTS.md +85 -2
- package/README.md +24 -1
- package/dist/AGENTS.md +517 -0
- package/dist/README.md +142 -0
- package/dist/adverich-kun-ui.css +1 -1
- package/dist/components/KunDatePicker/src/components/KunDatePicker.vue.js +163 -150
- package/dist/components/KunDatePicker/src/composables/kunDatePickerProps.js +2 -0
- package/dist/components/KunTable/src/composables/useFilter.js +32 -32
- package/package.json +2 -1
package/AGENTS.md
CHANGED
|
@@ -2,10 +2,39 @@
|
|
|
2
2
|
|
|
3
3
|
KunUI es una librería de componentes Vue.js 3 con Tailwind CSS.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## ⚠️ Importante para Agentes de IA
|
|
8
|
+
|
|
9
|
+
### Package Manager Requerido: **pnpm**
|
|
10
|
+
|
|
11
|
+
Este proyecto utiliza **pnpm** como gestor de paquetes. **No uses npm ni yarn** para instalar dependencias o ejecutar scripts.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# ❌ NO usar
|
|
15
|
+
npm install
|
|
16
|
+
npm run build
|
|
17
|
+
|
|
18
|
+
# ✅ USAR
|
|
19
|
+
pnpm install
|
|
20
|
+
pnpm run build
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Comandos disponibles
|
|
24
|
+
|
|
25
|
+
| Comando | Descripción |
|
|
26
|
+
|---------|-------------|
|
|
27
|
+
| `pnpm install` | Instala todas las dependencias |
|
|
28
|
+
| `pnpm run dev` | Inicia el servidor de desarrollo (Vite) |
|
|
29
|
+
| `pnpm run build` | Compila la librería para producción |
|
|
30
|
+
| `pnpm run preview` | Vista previa del build |
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Instalación (para usuarios de la librería)
|
|
6
35
|
|
|
7
36
|
```bash
|
|
8
|
-
|
|
37
|
+
pnpm add adverich-kun-ui
|
|
9
38
|
```
|
|
10
39
|
|
|
11
40
|
```javascript
|
|
@@ -432,3 +461,57 @@ kunConfig.configure({
|
|
|
432
461
|
- **Densidad**: 'default', 'comfortable', 'compact'
|
|
433
462
|
- **v-model**: La mayoría de inputs usan v-model para two-way binding
|
|
434
463
|
- **Slots**: Nombre de slot = nombre del prop sin "Icon" (prependIcon -> #prepend)
|
|
464
|
+
|
|
465
|
+
---
|
|
466
|
+
|
|
467
|
+
## Estructura del Proyecto
|
|
468
|
+
|
|
469
|
+
```
|
|
470
|
+
kun-ui/
|
|
471
|
+
├── src/
|
|
472
|
+
│ ├── components/ # Componentes Vue (KunBtn, KunTable, etc.)
|
|
473
|
+
│ │ └── KunBtn/
|
|
474
|
+
│ │ ├── src/
|
|
475
|
+
│ │ │ └── components/
|
|
476
|
+
│ │ │ └── KunBtn.vue
|
|
477
|
+
│ │ └── src/composables/
|
|
478
|
+
│ │ └── kunBtnProps.js
|
|
479
|
+
│ ├── config/ # Configuración global (kunConfig)
|
|
480
|
+
│ ├── directives/ # Directivas personalizadas
|
|
481
|
+
│ ├── icons/ # Íconos SVG
|
|
482
|
+
│ ├── plugins/ # Plugins de Vite
|
|
483
|
+
│ ├── styles/ # Estilos globales
|
|
484
|
+
│ ├── utils/ # Utilidades y helpers
|
|
485
|
+
│ └── index.js # Punto de entrada
|
|
486
|
+
├── dist/ # Build output (generado)
|
|
487
|
+
├── AGENTS.md # Esta documentación
|
|
488
|
+
├── README.md # README para usuarios
|
|
489
|
+
├── package.json
|
|
490
|
+
├── vite.config.js
|
|
491
|
+
└── tailwind.config.js
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
## Desarrollo
|
|
495
|
+
|
|
496
|
+
### Modificar un componente
|
|
497
|
+
|
|
498
|
+
1. Ubica el componente en `src/components/[NombreComponente]/`
|
|
499
|
+
2. Edita el archivo `.vue` en `src/components/[NombreComponente]/src/components/`
|
|
500
|
+
3. Si necesitas cambiar props, edita el composable en `src/components/[NombreComponente]/src/composables/`
|
|
501
|
+
4. Ejecuta `pnpm run dev` para ver los cambios en tiempo real
|
|
502
|
+
5. Ejecuta `pnpm run build` para generar el build de producción
|
|
503
|
+
|
|
504
|
+
### Agregar un nuevo componente
|
|
505
|
+
|
|
506
|
+
1. Crea la carpeta `src/components/KunNuevoComponente/`
|
|
507
|
+
2. Agrega la estructura:
|
|
508
|
+
```
|
|
509
|
+
KunNuevoComponente/
|
|
510
|
+
├── src/
|
|
511
|
+
│ ├── components/
|
|
512
|
+
│ │ └── KunNuevoComponente.vue
|
|
513
|
+
│ └── composables/
|
|
514
|
+
│ └── kunNuevoComponenteProps.js
|
|
515
|
+
```
|
|
516
|
+
3. El plugin `kunUiAutoExportsPlugin` registrará automáticamente el componente
|
|
517
|
+
4. Documenta el componente en este archivo (AGENTS.md)
|
package/README.md
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Una librería de componentes Vue.js 3 con Tailwind CSS, ligera y fácil de usar.
|
|
4
4
|
|
|
5
|
+
> **Para desarrolladores de la librería**: Consulta `AGENTS.md` para documentación interna y guías de desarrollo.
|
|
6
|
+
|
|
5
7
|
## Instalación
|
|
6
8
|
|
|
7
9
|
```bash
|
|
8
|
-
|
|
10
|
+
pnpm add adverich-kun-ui
|
|
9
11
|
```
|
|
10
12
|
|
|
11
13
|
## Uso
|
|
@@ -114,6 +116,27 @@ import 'adverich-kun-ui/dist/adverich-kun-ui.css'
|
|
|
114
116
|
- Vue 3.5+
|
|
115
117
|
- Tailwind CSS 4.0+
|
|
116
118
|
|
|
119
|
+
## Desarrollo (contribuir)
|
|
120
|
+
|
|
121
|
+
Si quieres contribuir al desarrollo de KunUI:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# Clonar el repositorio
|
|
125
|
+
git clone https://github.com/adverich/KunUi.git
|
|
126
|
+
cd KunUi
|
|
127
|
+
|
|
128
|
+
# Instalar dependencias (requiere pnpm)
|
|
129
|
+
pnpm install
|
|
130
|
+
|
|
131
|
+
# Iniciar servidor de desarrollo
|
|
132
|
+
pnpm run dev
|
|
133
|
+
|
|
134
|
+
# Build para producción
|
|
135
|
+
pnpm run build
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
> **Importante**: Este proyecto utiliza **pnpm** como gestor de paquetes. No uses npm ni yarn.
|
|
139
|
+
|
|
117
140
|
## Licencia
|
|
118
141
|
|
|
119
142
|
MIT
|
package/dist/AGENTS.md
ADDED
|
@@ -0,0 +1,517 @@
|
|
|
1
|
+
# KunUI - Documentación para Agentes de IA
|
|
2
|
+
|
|
3
|
+
KunUI es una librería de componentes Vue.js 3 con Tailwind CSS.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## ⚠️ Importante para Agentes de IA
|
|
8
|
+
|
|
9
|
+
### Package Manager Requerido: **pnpm**
|
|
10
|
+
|
|
11
|
+
Este proyecto utiliza **pnpm** como gestor de paquetes. **No uses npm ni yarn** para instalar dependencias o ejecutar scripts.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# ❌ NO usar
|
|
15
|
+
npm install
|
|
16
|
+
npm run build
|
|
17
|
+
|
|
18
|
+
# ✅ USAR
|
|
19
|
+
pnpm install
|
|
20
|
+
pnpm run build
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Comandos disponibles
|
|
24
|
+
|
|
25
|
+
| Comando | Descripción |
|
|
26
|
+
|---------|-------------|
|
|
27
|
+
| `pnpm install` | Instala todas las dependencias |
|
|
28
|
+
| `pnpm run dev` | Inicia el servidor de desarrollo (Vite) |
|
|
29
|
+
| `pnpm run build` | Compila la librería para producción |
|
|
30
|
+
| `pnpm run preview` | Vista previa del build |
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Instalación (para usuarios de la librería)
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pnpm add adverich-kun-ui
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
```javascript
|
|
41
|
+
import { createApp } from 'vue'
|
|
42
|
+
import KunUI from 'adverich-kun-ui'
|
|
43
|
+
import 'adverich-kun-ui/dist/adverich-kun-ui.css'
|
|
44
|
+
|
|
45
|
+
const app = createApp(App)
|
|
46
|
+
app.use(KunUI)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Componentes
|
|
52
|
+
|
|
53
|
+
### KunBtn
|
|
54
|
+
|
|
55
|
+
Botón con múltiples variantes y tamaños.
|
|
56
|
+
|
|
57
|
+
```vue
|
|
58
|
+
<KunBtn text="Click me" variant="default" size="md" @click="handleClick" />
|
|
59
|
+
<KunBtn icon="mdi-plus" variant="tonal" />
|
|
60
|
+
<KunBtn text="Link" to="/path" />
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
| Prop | Tipo | Default | Descripción |
|
|
64
|
+
|------|------|---------|-------------|
|
|
65
|
+
| text | String | - | Texto del botón |
|
|
66
|
+
| size | String | 'md' | Tamaño: 'xxs', 'xs', 'sm', 'md', 'lg', 'xl', 'xxl' |
|
|
67
|
+
| variant | String | 'default' | Variante: 'default', 'tonal', 'plain', 'outlined', 'soft', 'text' |
|
|
68
|
+
| disabled | Boolean | false | Deshabilita el botón |
|
|
69
|
+
| loading | Boolean | false | Muestra estado de carga |
|
|
70
|
+
| bgColor | String | 'bg-button' | Color de fondo (clase Tailwind) |
|
|
71
|
+
| textColor | String | 'text-slate-800 dark:text-slate-200' | Color de texto |
|
|
72
|
+
| icon | String/Object/Function/Array | - | Ícono del botón |
|
|
73
|
+
| prependIcon | String/Object/Function/Array | - | Ícono al inicio |
|
|
74
|
+
| appendIcon | String/Object/Function/Array | - | Ícono al final |
|
|
75
|
+
| to | String/Object | - | Ruta Vue Router (convierte a router-link) |
|
|
76
|
+
| href | String | - | URL externa (convierte a <a>) |
|
|
77
|
+
| target | String | - | Target del enlace |
|
|
78
|
+
| rounded | String | 'rounded-lg' | Clase de borde redondeado |
|
|
79
|
+
| ring | Boolean | false | Añade ring al focus |
|
|
80
|
+
|
|
81
|
+
**Eventos:** click, keydown, keyup, keypress
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
### KunTextField
|
|
86
|
+
|
|
87
|
+
Campo de texto con validación y decoradores.
|
|
88
|
+
|
|
89
|
+
```vue
|
|
90
|
+
<KunTextField v-model="value" label="Nombre" :rules="[v => !!v || 'Requerido']" />
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
| Prop | Tipo | Default | Descripción |
|
|
94
|
+
|------|------|---------|-------------|
|
|
95
|
+
| modelValue | String/Number | '' | Valor del campo |
|
|
96
|
+
| label | String | '' | Etiqueta flotante |
|
|
97
|
+
| placeholder | String | '' | Placeholder |
|
|
98
|
+
| type | String | 'text' | Tipo: text, password, email, etc. |
|
|
99
|
+
| disabled | Boolean | false | Deshabilita el campo |
|
|
100
|
+
| readonly | Boolean | false | Solo lectura |
|
|
101
|
+
| error | Boolean | false | Muestra estado de error |
|
|
102
|
+
| errorMessage | String | '' | Mensaje de error |
|
|
103
|
+
| rules | Array | [] | Array de funciones de validación |
|
|
104
|
+
| clearable | Boolean | false | Muestra botón de limpiar |
|
|
105
|
+
| hint | String | '' | Texto de ayuda |
|
|
106
|
+
| persistentHint | Boolean | false | Muestra hint siempre |
|
|
107
|
+
| hideDetails | Boolean | false | Oculta área de detalles |
|
|
108
|
+
| density | String | 'default' | Densidad: 'default', 'comfortable', 'compact' |
|
|
109
|
+
| prefix | String | '' | Prefijo |
|
|
110
|
+
| suffix | String | '' | Sufijo |
|
|
111
|
+
| prependIcon | String | - | Ícono al inicio |
|
|
112
|
+
| appendIcon | String | - | Ícono al final |
|
|
113
|
+
| maxlength | Number/String | null | Longitud máxima |
|
|
114
|
+
| counter | Boolean | false | Muestra contador |
|
|
115
|
+
| debounce | Number | 300 | Debounce en ms |
|
|
116
|
+
|
|
117
|
+
**Eventos:** update:modelValue, focus, blur, enter
|
|
118
|
+
|
|
119
|
+
**Métodos expuestos:** validate(), reset(), resetValidation(), focus()
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
### KunAutocomplete
|
|
124
|
+
|
|
125
|
+
Selector con autocompletado y búsqueda.
|
|
126
|
+
|
|
127
|
+
```vue
|
|
128
|
+
<KunAutocomplete
|
|
129
|
+
v-model="selected"
|
|
130
|
+
v-model:items="items"
|
|
131
|
+
label="Seleccionar"
|
|
132
|
+
item-value="id"
|
|
133
|
+
item-title="name"
|
|
134
|
+
:rules="[v => !!v || 'Requerido']"
|
|
135
|
+
/>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
| Prop | Tipo | Default | Descripción |
|
|
139
|
+
|------|------|---------|-------------|
|
|
140
|
+
| modelValue | Any | null | Valor seleccionado |
|
|
141
|
+
| items | Array | [] | Lista de items (v-model:items) |
|
|
142
|
+
| label | String | - | Etiqueta |
|
|
143
|
+
| itemValue | String | null | Campo para el valor |
|
|
144
|
+
| itemTitle | String/Array | null | Campo(s) para mostrar |
|
|
145
|
+
| itemSubtitle | String/Array | null | Campo(s) para subtítulo |
|
|
146
|
+
| returnObject | Boolean | false | Retorna objeto completo |
|
|
147
|
+
| multiple | Boolean | false | Selección múltiple |
|
|
148
|
+
| clearable | Boolean | false | Botón de limpiar |
|
|
149
|
+
| searchableKeys | Array | [] | Campos para búsqueda |
|
|
150
|
+
| hasCreateItem | Boolean | false | Muestra botón de crear |
|
|
151
|
+
| density | String | 'default' | Densidad |
|
|
152
|
+
| hideDetails | Boolean | true | Oculta detalles |
|
|
153
|
+
| zIndex | String | 'z-250' | Z-index del menú |
|
|
154
|
+
| rules | Array | [] | Reglas de validación |
|
|
155
|
+
|
|
156
|
+
**Eventos:** update:modelValue, selectedItem, createItem, search, notFound, cleared
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
### KunDialog
|
|
161
|
+
|
|
162
|
+
Diálogo modal con posicionamiento flexible.
|
|
163
|
+
|
|
164
|
+
```vue
|
|
165
|
+
<KunDialog v-model="show" persistent>
|
|
166
|
+
<template #default>
|
|
167
|
+
<p>Contenido del diálogo</p>
|
|
168
|
+
</template>
|
|
169
|
+
</KunDialog>
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
| Prop | Tipo | Default | Descripción |
|
|
173
|
+
|------|------|---------|-------------|
|
|
174
|
+
| modelValue | Boolean | - | Controla visibilidad |
|
|
175
|
+
| overlay | Boolean | true | Muestra overlay oscuro |
|
|
176
|
+
| fullscreen | Boolean | false | Pantalla completa |
|
|
177
|
+
| scrollable | Boolean | false | Contenido scrollable |
|
|
178
|
+
| persistent | Boolean | false | No cierra al clickear fuera |
|
|
179
|
+
| xPosition | String | 'center' | Posición X: 'start', 'center', 'end' |
|
|
180
|
+
| yPosition | String | 'center' | Posición Y: 'top', 'center', 'bottom' |
|
|
181
|
+
| bgColor | String | 'bg-surface-dark' | Color de fondo |
|
|
182
|
+
| width | String | 'w-full' | Ancho |
|
|
183
|
+
| maxWidth | String | 'max-w-full' | Ancho máximo |
|
|
184
|
+
| height | String | 'h-fit' | Alto |
|
|
185
|
+
| maxHeight | String | 'max-h-dvh' | Alto máximo |
|
|
186
|
+
|
|
187
|
+
**Eventos:** update:modelValue
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
### KunCheckbox
|
|
192
|
+
|
|
193
|
+
Checkbox con soporte para múltiples valores.
|
|
194
|
+
|
|
195
|
+
```vue
|
|
196
|
+
<KunCheckbox v-model="checked" label="Acepto términos" />
|
|
197
|
+
<KunCheckbox v-model="selected" value="option1" label="Opción 1" multiple />
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
| Prop | Tipo | Default | Descripción |
|
|
201
|
+
|------|------|---------|-------------|
|
|
202
|
+
| modelValue | Boolean/Array/String/Number/Object | - | Valor |
|
|
203
|
+
| trueValue | Any | true | Valor cuando está activo |
|
|
204
|
+
| falseValue | Any | false | Valor cuando está inactivo |
|
|
205
|
+
| value | Any | - | Valor del checkbox (para grupos) |
|
|
206
|
+
| label | String | - | Etiqueta |
|
|
207
|
+
| disabled | Boolean | false | Deshabilitado |
|
|
208
|
+
| readonly | Boolean | false | Solo lectura |
|
|
209
|
+
| indeterminate | Boolean | false | Estado indeterminado |
|
|
210
|
+
| color | String | - | Color |
|
|
211
|
+
| size | String | 'md' | Tamaño: 'sm', 'md', 'lg' |
|
|
212
|
+
| rules | Array | [] | Reglas de validación |
|
|
213
|
+
| hideDetails | Boolean/String | false | Oculta detalles |
|
|
214
|
+
|
|
215
|
+
**Eventos:** update:modelValue, update:focused
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
### KunSwitch
|
|
220
|
+
|
|
221
|
+
Switch/Toggle para valores booleanos.
|
|
222
|
+
|
|
223
|
+
```vue
|
|
224
|
+
<KunSwitch v-model="enabled" label="Activar" />
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
| Prop | Tipo | Default | Descripción |
|
|
228
|
+
|------|------|---------|-------------|
|
|
229
|
+
| modelValue | Boolean/String/Number | false | Valor |
|
|
230
|
+
| trueValue | Boolean/String/Number | true | Valor activo |
|
|
231
|
+
| falseValue | Boolean/String/Number | false | Valor inactivo |
|
|
232
|
+
| label | String | - | Etiqueta |
|
|
233
|
+
| labelPosition | String | 'right' | Posición: 'top', 'bottom', 'left', 'right' |
|
|
234
|
+
| disabled | Boolean | false | Deshabilitado |
|
|
235
|
+
| onColor | String | 'bg-green-600' | Color activo |
|
|
236
|
+
| offColor | String | 'bg-surface-light' | Color inactivo |
|
|
237
|
+
| size | String | 'md' | Tamaño: 'xxs', 'xs', 'sm', 'md', 'lg', 'xl', 'xxl' |
|
|
238
|
+
| hideDetails | Boolean | false | Oculta detalles |
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
### KunSelect
|
|
243
|
+
|
|
244
|
+
Selector desplegable.
|
|
245
|
+
|
|
246
|
+
```vue
|
|
247
|
+
<KunSelect v-model="selected" :items="options" label="Seleccionar" />
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
### KunRadio y KunRadioGroup
|
|
253
|
+
|
|
254
|
+
Botones de radio.
|
|
255
|
+
|
|
256
|
+
```vue
|
|
257
|
+
<KunRadioGroup v-model="selected" label="Opciones">
|
|
258
|
+
<KunRadio value="opt1" label="Opción 1" />
|
|
259
|
+
<KunRadio value="opt2" label="Opción 2" />
|
|
260
|
+
</KunRadioGroup>
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
### KunTable
|
|
266
|
+
|
|
267
|
+
Tabla con ordenamiento, paginación y selección.
|
|
268
|
+
|
|
269
|
+
```vue
|
|
270
|
+
<KunTable
|
|
271
|
+
:items="data"
|
|
272
|
+
:headers="headers"
|
|
273
|
+
:searchable="true"
|
|
274
|
+
:show-select="true"
|
|
275
|
+
v-model:selectedItems="selected"
|
|
276
|
+
/>
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
| Prop | Tipo | Default | Descripción |
|
|
280
|
+
|------|------|---------|-------------|
|
|
281
|
+
| items | Array | [] | Datos a mostrar |
|
|
282
|
+
| headers | Array | [] | Configuración de columnas |
|
|
283
|
+
| searchable | Boolean | false | Habilita búsqueda |
|
|
284
|
+
| showSelect | Boolean | false | Muestra checkboxes |
|
|
285
|
+
| showExpand | Boolean | false | Habilita expansión de filas |
|
|
286
|
+
| itemsPerPage | Number | 10 | Items por página |
|
|
287
|
+
| sortBy | Array/String | [] | Ordenamiento |
|
|
288
|
+
| hasActions | Boolean | false | Columna de acciones |
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
### KunList y KunListItem
|
|
293
|
+
|
|
294
|
+
Listas y items de lista.
|
|
295
|
+
|
|
296
|
+
```vue
|
|
297
|
+
<KunList selectable>
|
|
298
|
+
<KunListItem title="Item 1" subtitle="Descripción" prepend-icon="mdi-home" />
|
|
299
|
+
</KunList>
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
### KunTabs
|
|
305
|
+
|
|
306
|
+
Sistema de pestañas.
|
|
307
|
+
|
|
308
|
+
```vue
|
|
309
|
+
<KunTabs v-model="tab">
|
|
310
|
+
<KunTab value="tab1" text="Pestaña 1" />
|
|
311
|
+
<KunTab value="tab2" text="Pestaña 2" />
|
|
312
|
+
</KunTabs>
|
|
313
|
+
<KunTabWindow v-model="tab">
|
|
314
|
+
<template #item.tab1>Contenido 1</template>
|
|
315
|
+
<template #item.tab2>Contenido 2</template>
|
|
316
|
+
</KunTabWindow>
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
### KunTooltip
|
|
322
|
+
|
|
323
|
+
Tooltip informativo.
|
|
324
|
+
|
|
325
|
+
```vue
|
|
326
|
+
<KunTooltip text="Información adicional" location="top">
|
|
327
|
+
<template #activator>
|
|
328
|
+
<KunBtn icon="mdi-information" />
|
|
329
|
+
</template>
|
|
330
|
+
</KunTooltip>
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
### KunAlert
|
|
336
|
+
|
|
337
|
+
Alerta/notificación flotante.
|
|
338
|
+
|
|
339
|
+
```vue
|
|
340
|
+
<KunAlert v-model="show" title="Éxito" message="Operación completada" />
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
---
|
|
344
|
+
|
|
345
|
+
### KunDrawer
|
|
346
|
+
|
|
347
|
+
Panel lateral de navegación.
|
|
348
|
+
|
|
349
|
+
```vue
|
|
350
|
+
<KunDrawer v-model="open" location="start" :swipeable="true" />
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
### KunForm
|
|
356
|
+
|
|
357
|
+
Contenedor de formulario con validación.
|
|
358
|
+
|
|
359
|
+
```vue
|
|
360
|
+
<KunForm ref="formRef" v-model="isValid" @submit="handleSubmit">
|
|
361
|
+
<KunTextField v-model="data.name" :rules="[required]" />
|
|
362
|
+
</KunForm>
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
**Métodos expuestos:** validate(), reset(), resetValidation()
|
|
366
|
+
|
|
367
|
+
---
|
|
368
|
+
|
|
369
|
+
### KunFileInput
|
|
370
|
+
|
|
371
|
+
Input de archivos.
|
|
372
|
+
|
|
373
|
+
```vue
|
|
374
|
+
<KunFileInput v-model="files" label="Subir archivo" multiple clearable />
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
### KunDatePicker
|
|
380
|
+
|
|
381
|
+
Selector de fecha y hora.
|
|
382
|
+
|
|
383
|
+
```vue
|
|
384
|
+
<KunDatePicker v-model="date" label="Fecha" mode="date" />
|
|
385
|
+
<KunDatePicker v-model="datetime" mode="datetime" :enable-time="true" />
|
|
386
|
+
<KunDatePicker v-model="range" :range="true" />
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
---
|
|
390
|
+
|
|
391
|
+
### KunCard y subcomponentes
|
|
392
|
+
|
|
393
|
+
Sistema de tarjetas.
|
|
394
|
+
|
|
395
|
+
```vue
|
|
396
|
+
<KunCard>
|
|
397
|
+
<KunCardTitle>Título</KunCardTitle>
|
|
398
|
+
<KunCardSubtitle>Subtítulo</KunCardSubtitle>
|
|
399
|
+
<KunCardText>Contenido</KunCardText>
|
|
400
|
+
<KunCardActions>
|
|
401
|
+
<KunBtn text="Acción" />
|
|
402
|
+
</KunCardActions>
|
|
403
|
+
</KunCard>
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
---
|
|
407
|
+
|
|
408
|
+
### Otros componentes
|
|
409
|
+
|
|
410
|
+
| Componente | Descripción |
|
|
411
|
+
|------------|-------------|
|
|
412
|
+
| KunAvatar | Avatar con imagen, ícono o texto |
|
|
413
|
+
| KunBadge | Badge/insignia |
|
|
414
|
+
| KunChip | Chip/etiqueta |
|
|
415
|
+
| KunDivider | Divisor |
|
|
416
|
+
| KunIcon | Ícono |
|
|
417
|
+
| KunLoaderCircular | Loader circular |
|
|
418
|
+
| KunSkeleton | Skeleton loader |
|
|
419
|
+
| KunSpacer | Espaciador flexible |
|
|
420
|
+
| KunContainer, KunRow, KunCol | Sistema de grid |
|
|
421
|
+
| KunAppbar, KunAppbarTitle | Barra de aplicación |
|
|
422
|
+
| KunToolbar, KunToolbarTitle, KunToolbarItems | Barra de herramientas |
|
|
423
|
+
| KunMenu | Menú desplegable |
|
|
424
|
+
| KunVirtualScroller | Scroll virtualizado |
|
|
425
|
+
| KunInfiniteScroll | Scroll infinito |
|
|
426
|
+
| KunTextarea | Área de texto |
|
|
427
|
+
| KunNumberField | Campo numérico |
|
|
428
|
+
| KunCurrency | Campo de moneda |
|
|
429
|
+
| KunSlider | Slider/rango |
|
|
430
|
+
| KunClock | Reloj |
|
|
431
|
+
|
|
432
|
+
---
|
|
433
|
+
|
|
434
|
+
## Patrones comunes
|
|
435
|
+
|
|
436
|
+
### Validación de formularios
|
|
437
|
+
|
|
438
|
+
```javascript
|
|
439
|
+
const required = v => !!v || 'Este campo es requerido'
|
|
440
|
+
const email = v => /.+@.+\..+/.test(v) || 'Email inválido'
|
|
441
|
+
const min = min => v => v?.length >= min || `Mínimo ${min} caracteres`
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
### Configuración global
|
|
445
|
+
|
|
446
|
+
```javascript
|
|
447
|
+
import { kunConfig } from 'adverich-kun-ui'
|
|
448
|
+
|
|
449
|
+
kunConfig.configure({
|
|
450
|
+
locale: 'es-AR',
|
|
451
|
+
currency: { value: 'ARS', name: 'Pesos', symbol: '$' }
|
|
452
|
+
})
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
---
|
|
456
|
+
|
|
457
|
+
## Convenciones
|
|
458
|
+
|
|
459
|
+
- **Props de estilo**: Usan clases Tailwind (bg-color, text-color, rounded, etc.)
|
|
460
|
+
- **Tamaños**: 'xxs', 'xs', 'sm', 'md', 'lg', 'xl', 'xxl'
|
|
461
|
+
- **Densidad**: 'default', 'comfortable', 'compact'
|
|
462
|
+
- **v-model**: La mayoría de inputs usan v-model para two-way binding
|
|
463
|
+
- **Slots**: Nombre de slot = nombre del prop sin "Icon" (prependIcon -> #prepend)
|
|
464
|
+
|
|
465
|
+
---
|
|
466
|
+
|
|
467
|
+
## Estructura del Proyecto
|
|
468
|
+
|
|
469
|
+
```
|
|
470
|
+
kun-ui/
|
|
471
|
+
├── src/
|
|
472
|
+
│ ├── components/ # Componentes Vue (KunBtn, KunTable, etc.)
|
|
473
|
+
│ │ └── KunBtn/
|
|
474
|
+
│ │ ├── src/
|
|
475
|
+
│ │ │ └── components/
|
|
476
|
+
│ │ │ └── KunBtn.vue
|
|
477
|
+
│ │ └── src/composables/
|
|
478
|
+
│ │ └── kunBtnProps.js
|
|
479
|
+
│ ├── config/ # Configuración global (kunConfig)
|
|
480
|
+
│ ├── directives/ # Directivas personalizadas
|
|
481
|
+
│ ├── icons/ # Íconos SVG
|
|
482
|
+
│ ├── plugins/ # Plugins de Vite
|
|
483
|
+
│ ├── styles/ # Estilos globales
|
|
484
|
+
│ ├── utils/ # Utilidades y helpers
|
|
485
|
+
│ └── index.js # Punto de entrada
|
|
486
|
+
├── dist/ # Build output (generado)
|
|
487
|
+
├── AGENTS.md # Esta documentación
|
|
488
|
+
├── README.md # README para usuarios
|
|
489
|
+
├── package.json
|
|
490
|
+
├── vite.config.js
|
|
491
|
+
└── tailwind.config.js
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
## Desarrollo
|
|
495
|
+
|
|
496
|
+
### Modificar un componente
|
|
497
|
+
|
|
498
|
+
1. Ubica el componente en `src/components/[NombreComponente]/`
|
|
499
|
+
2. Edita el archivo `.vue` en `src/components/[NombreComponente]/src/components/`
|
|
500
|
+
3. Si necesitas cambiar props, edita el composable en `src/components/[NombreComponente]/src/composables/`
|
|
501
|
+
4. Ejecuta `pnpm run dev` para ver los cambios en tiempo real
|
|
502
|
+
5. Ejecuta `pnpm run build` para generar el build de producción
|
|
503
|
+
|
|
504
|
+
### Agregar un nuevo componente
|
|
505
|
+
|
|
506
|
+
1. Crea la carpeta `src/components/KunNuevoComponente/`
|
|
507
|
+
2. Agrega la estructura:
|
|
508
|
+
```
|
|
509
|
+
KunNuevoComponente/
|
|
510
|
+
├── src/
|
|
511
|
+
│ ├── components/
|
|
512
|
+
│ │ └── KunNuevoComponente.vue
|
|
513
|
+
│ └── composables/
|
|
514
|
+
│ └── kunNuevoComponenteProps.js
|
|
515
|
+
```
|
|
516
|
+
3. El plugin `kunUiAutoExportsPlugin` registrará automáticamente el componente
|
|
517
|
+
4. Documenta el componente en este archivo (AGENTS.md)
|