adverich-kun-ui 0.1.573 → 0.1.574

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 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
- ## Instalación
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
- npm install adverich-kun-ui
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
- npm install adverich-kun-ui
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)
package/dist/README.md ADDED
@@ -0,0 +1,142 @@
1
+ # KunUI
2
+
3
+ Una librería de componentes Vue.js 3 con Tailwind CSS, ligera y fácil de usar.
4
+
5
+ > **Para desarrolladores de la librería**: Consulta `AGENTS.md` para documentación interna y guías de desarrollo.
6
+
7
+ ## Instalación
8
+
9
+ ```bash
10
+ pnpm add adverich-kun-ui
11
+ ```
12
+
13
+ ## Uso
14
+
15
+ ### Importación global
16
+
17
+ ```javascript
18
+ // main.js
19
+ import { createApp } from 'vue'
20
+ import KunUI from 'adverich-kun-ui'
21
+ import 'adverich-kun-ui/dist/adverich-kun-ui.css'
22
+
23
+ const app = createApp(App)
24
+ app.use(KunUI)
25
+ ```
26
+
27
+ ### Importación individual
28
+
29
+ ```javascript
30
+ import { KunBtn, KunTextField, KunDialog } from 'adverich-kun-ui'
31
+ import 'adverich-kun-ui/dist/adverich-kun-ui.css'
32
+ ```
33
+
34
+ ## Componentes disponibles
35
+
36
+ ### Formularios
37
+ - `KunBtn` - Botón con múltiples variantes
38
+ - `KunTextField` - Campo de texto
39
+ - `KunTextarea` - Área de texto
40
+ - `KunNumberField` - Campo numérico
41
+ - `KunCheckbox` - Checkbox
42
+ - `KunSwitch` - Switch/Toggle
43
+ - `KunRadio` - Radio button
44
+ - `KunRadioGroup` - Grupo de radio buttons
45
+ - `KunSelect` - Selector
46
+ - `KunAutocomplete` - Autocompletado
47
+ - `KunFileInput` - Input de archivos
48
+ - `KunCurrency` - Campo de moneda
49
+ - `KunDatePicker` - Selector de fecha
50
+ - `KunSlider` - Slider/Rango
51
+ - `KunForm` - Contenedor de formulario
52
+
53
+ ### Layout
54
+ - `KunContainer` - Contenedor
55
+ - `KunRow` - Fila (grid)
56
+ - `KunCol` - Columna (grid)
57
+ - `KunDivider` - Divisor
58
+ - `KunSpacer` - Espaciador
59
+
60
+ ### Navegación
61
+ - `KunAppbar` - Barra de aplicación
62
+ - `KunAppbarTitle` - Título de appbar
63
+ - `KunDrawer` - Drawer/Panel lateral
64
+ - `KunToolbar` - Barra de herramientas
65
+ - `KunToolbarTitle` - Título de toolbar
66
+ - `KunToolbarItems` - Items de toolbar
67
+ - `KunTabs` - Pestañas
68
+ - `KunTab` - Pestaña individual
69
+ - `KunTabWindow` - Ventana de pestaña
70
+ - `KunMenu` - Menú desplegable
71
+
72
+ ### Superposición
73
+ - `KunDialog` - Diálogo modal
74
+ - `KunTooltip` - Tooltip
75
+ - `KunAlert` - Alerta/Notificación
76
+
77
+ ### Datos
78
+ - `KunTable` - Tabla con funcionalidades avanzadas
79
+ - `KunVirtualScroller` - Scroll virtualizado
80
+ - `KunInfiniteScroll` - Scroll infinito
81
+ - `KunRelationMatrix` - Matriz de relaciones
82
+
83
+ ### Listas
84
+ - `KunList` - Lista
85
+ - `KunListItem` - Item de lista
86
+ - `KunListGroup` - Grupo de lista colapsable
87
+ - `KunListSubheader` - Subtítulo de lista
88
+ - `KunListImg` - Imagen de lista
89
+ - `KunListItemTitle` - Título de item
90
+ - `KunListItemText` - Texto de item
91
+ - `KunListItemSubtitle` - Subtítulo de item
92
+ - `KunListItemAvatar` - Avatar de item
93
+ - `KunListItemAction` - Acción de item
94
+
95
+ ### Visualización
96
+ - `KunCard` - Tarjeta
97
+ - `KunCardTitle` - Título de tarjeta
98
+ - `KunCardSubtitle` - Subtítulo de tarjeta
99
+ - `KunCardText` - Texto de tarjeta
100
+ - `KunCardActions` - Acciones de tarjeta
101
+ - `KunCardItem` - Item de tarjeta
102
+ - `KunAvatar` - Avatar
103
+ - `KunBadge` - Badge/Insignia
104
+ - `KunIcon` - Ícono
105
+ - `KunChip` - Chip/Etiqueta
106
+ - `KunClock` - Reloj
107
+ - `KunSkeleton` - Skeleton loader
108
+ - `KunLoaderCircular` - Loader circular
109
+
110
+ ### Utilidades
111
+ - `KunModalFooter` - Pie de modal
112
+ - `KunMultipleModalFooter` - Múltiples pies de modal
113
+
114
+ ## Requisitos
115
+
116
+ - Vue 3.5+
117
+ - Tailwind CSS 4.0+
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
+
140
+ ## Licencia
141
+
142
+ MIT
@@ -7,7 +7,7 @@ function U(F, E, L, l = !1) {
7
7
  // Búsqueda global
8
8
  byColumn: {}
9
9
  // Mapa columna -> valor
10
- }), { items: h, customFilter: j, searchableKeys: K, headers: J } = F, x = S(!1), m = (e) => {
10
+ }), { items: h, customFilter: j, searchableKeys: x, headers: J } = F, K = S(!1), m = (e) => {
11
11
  if (e == null) return "";
12
12
  if (typeof e == "string") return e;
13
13
  if (typeof e == "number" || typeof e == "boolean") return String(e);
@@ -28,71 +28,71 @@ function U(F, E, L, l = !1) {
28
28
  }
29
29
  }, g = (e, r) => {
30
30
  const n = m(e).toLowerCase(), t = m(r).toLowerCase();
31
- return t ? n ? n.includes(t) : !1 : !0;
31
+ return t ? n === t : !0;
32
32
  }, p = R(() => L.value ?? []), A = R(() => {
33
- const e = u(K);
33
+ const e = u(x);
34
34
  return Array.isArray(e) && e.length ? e : p.value.map((r) => r == null ? void 0 : r.value).filter(Boolean);
35
- }), d = S(/* @__PURE__ */ new Map());
36
- function C() {
37
- d.value.clear();
35
+ }), C = S(/* @__PURE__ */ new Map());
36
+ function d() {
37
+ C.value.clear();
38
38
  const e = u(h);
39
39
  Array.isArray(e) && (e.forEach((r) => {
40
40
  const n = {};
41
41
  A.value.forEach((t) => {
42
42
  const o = p.value.find((f) => f.value === t);
43
- let s, i;
43
+ let a, i;
44
44
  try {
45
- s = o ? O(o, r) : r[t];
45
+ a = o ? O(o, r) : r[t];
46
46
  } catch (f) {
47
- s = "", l && console.error("[useFilter] ERROR getValue", { item: r, key: t, err: f });
47
+ a = "", l && console.error("[useFilter] ERROR getValue", { item: r, key: t, err: f });
48
48
  }
49
49
  try {
50
- i = o ? H(o, s) : s;
50
+ i = o ? H(o, a) : a;
51
51
  } catch (f) {
52
- i = s, l && console.error("[useFilter] ERROR formatValue", { header: o, raw: s, err: f });
52
+ i = a, l && console.error("[useFilter] ERROR formatValue", { header: o, raw: a, err: f });
53
53
  }
54
54
  n[t] = m(i).toLowerCase();
55
- }), d.value.set(r, n);
56
- }), l && console.log("[useFilter] Cache reconstruida", d.value));
55
+ }), C.value.set(r, n);
56
+ }), l && console.log("[useFilter] Cache reconstruida", C.value));
57
57
  }
58
- V(() => u(h), () => C(), { immediate: !0 }), V(() => {
58
+ V(() => u(h), () => d(), { immediate: !0 }), V(() => {
59
59
  var e;
60
60
  return (e = u(h)) == null ? void 0 : e.length;
61
- }, () => C());
61
+ }, () => d());
62
62
  const b = (e, r, n) => {
63
63
  const t = z(e, r), o = u(j);
64
64
  if (typeof o == "function") {
65
- const a = p.value.find((y) => (y == null ? void 0 : y.value) === r);
65
+ const s = p.value.find((y) => (y == null ? void 0 : y.value) === r);
66
66
  try {
67
- return o(e, r, n, a);
67
+ return o(e, r, n, s);
68
68
  } catch (y) {
69
- return l && console.error("[matchesFilter] ERROR customFilter", { item: e, key: r, value: n, header: a, err: y }), !1;
69
+ return l && console.error("[matchesFilter] ERROR customFilter", { item: e, key: r, value: n, header: s, err: y }), !1;
70
70
  }
71
71
  }
72
- const s = u(F.filters) ?? F.filters, i = Array.isArray(s) ? s.find((a) => a.value === r) : void 0, f = (i == null ? void 0 : i["item-value"]) ?? "id", w = (a) => a != null && typeof a == "object" ? a[f] : a;
73
- return Array.isArray(n) ? n.some((a) => g(t, w(a))) : g(t, w(n));
72
+ const a = u(F.filters) ?? F.filters, i = Array.isArray(a) ? a.find((s) => s.value === r) : void 0, f = (i == null ? void 0 : i["item-value"]) ?? "id", w = (s) => s != null && typeof s == "object" ? s[f] : s;
73
+ return Array.isArray(n) ? n.some((s) => g(t, w(s))) : g(t, w(n));
74
74
  }, I = R(() => {
75
75
  const e = u(h);
76
76
  return Array.isArray(e) ? e.filter((r) => {
77
77
  const n = c.search;
78
78
  if (n) {
79
- const t = d.value.get(r);
79
+ const t = C.value.get(r);
80
80
  if (t) {
81
- if (!Object.values(t).some((s) => s.includes(n))) return !1;
81
+ if (!Object.values(t).some((a) => a.includes(n))) return !1;
82
82
  } else if (!A.value.some((i) => b(r, i, n))) return !1;
83
83
  }
84
84
  for (const t in c.byColumn) {
85
- const o = c.byColumn[t], s = Array.isArray(o) && o.length === 0;
86
- if (o != null && o !== "" && !s && !b(r, t, o)) return !1;
85
+ const o = c.byColumn[t], a = Array.isArray(o) && o.length === 0;
86
+ if (o != null && o !== "" && !a && !b(r, t, o)) return !1;
87
87
  }
88
88
  return !0;
89
89
  }) : [];
90
- }), q = G((e) => {
90
+ }), M = G((e) => {
91
91
  c.search = m(e).toLowerCase(), l && console.log("[setSearch]", c.search);
92
- }, u(E) ?? 150), B = (e, r) => {
92
+ }, u(E) ?? 150), q = (e, r) => {
93
93
  c.byColumn[e] = r, l && console.log("[setColumnFilter]", e, r);
94
- }, M = (e) => {
95
- for (const r in e) B(r, e[r]);
94
+ }, B = (e) => {
95
+ for (const r in e) q(r, e[r]);
96
96
  l && console.log("[applyColumnFilters]", e);
97
97
  }, P = () => {
98
98
  c.search = "", c.byColumn = {}, l && console.log("[clearFilters] filtros reseteados");
@@ -106,14 +106,14 @@ function U(F, E, L, l = !1) {
106
106
  }
107
107
  };
108
108
  return {
109
- modalFilter: x,
109
+ modalFilter: K,
110
110
  appliedFilters: c,
111
111
  filteredItems: I,
112
- setSearch: q,
113
- applyColumnFilters: M,
112
+ setSearch: M,
113
+ applyColumnFilters: B,
114
114
  clearFilters: P,
115
115
  // 👇 Exponemos también por si querés refrescar manualmente
116
- refreshCache: C
116
+ refreshCache: d
117
117
  };
118
118
  }
119
119
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.573",
3
+ "version": "0.1.574",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",
@@ -10,6 +10,7 @@
10
10
  "AGENTS.md",
11
11
  "README.md"
12
12
  ],
13
+ "packageManager": "pnpm@9.15.0",
13
14
  "scripts": {
14
15
  "dev": "vite",
15
16
  "build": "vite build",