@dronico/droni-kit 1.8.6 → 1.9.1
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/CHANGELOG.md +21 -0
- package/LICENSE +25 -0
- package/README.md +325 -6
- package/dist/stories/Elements/DuiAction.stories.d.ts +1 -1
- package/dist/stories/Elements/DuiAlert.stories.d.ts +1 -1
- package/dist/stories/Elements/DuiTable.stories.d.ts +1 -1
- package/dist/stories/Forms/DuiButton.stories.d.ts +1 -1
- package/dist/stories/Forms/DuiInput.stories.d.ts +1 -1
- package/dist/stories/Forms/DuiSelect.stories.d.ts +1 -1
- package/dist/stories/Forms/DuiTextarea.stories.d.ts +1 -1
- package/package.json +9 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
## [1.9.1](https://github.com/Droni-app/droni-kit/compare/v1.9.0...v1.9.1) (2025-09-30)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* security update ([b3d214f](https://github.com/Droni-app/droni-kit/commit/b3d214fcaa2366da82d653621ee8e4287f681746))
|
|
7
|
+
|
|
8
|
+
# [1.9.0](https://github.com/Droni-app/droni-kit/compare/v1.8.6...v1.9.0) (2025-09-30)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* darkmode with theme ([3629b11](https://github.com/Droni-app/droni-kit/commit/3629b11da330d31396adb2c46068a764014d2b71))
|
|
14
|
+
* preview content ([1340e0d](https://github.com/Droni-app/droni-kit/commit/1340e0dc28a09d32cbb1100ce402b7c6d1b246dc))
|
|
15
|
+
* readd preview ([398e6f7](https://github.com/Droni-app/droni-kit/commit/398e6f715c43b26eb9c541daf3a4dc802ac30917))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* upgrade storybook ([6be2a48](https://github.com/Droni-app/droni-kit/commit/6be2a487b6d77dca5fe03569c11d9815cf6c201a))
|
|
21
|
+
|
|
1
22
|
## [1.8.6](https://github.com/Droni-app/droni-kit/compare/v1.8.5...v1.8.6) (2025-09-29)
|
|
2
23
|
|
|
3
24
|
|
package/LICENSE
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Droni.co
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
DISCLAIMER: This project is provided without any support, maintenance, or warranty.
|
|
24
|
+
The authors and contributors are not responsible for any issues, bugs, or damages
|
|
25
|
+
that may arise from the use of this software. Use at your own risk.
|
package/README.md
CHANGED
|
@@ -1,10 +1,329 @@
|
|
|
1
|
-
# Droni-kit
|
|
1
|
+
# Droni-kit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://badge.fury.io/js/@dronico%2Fdroni-kit)
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
**Droni-kit** es una biblioteca de componentes de interfaz de usuario (UI) desarrollada específicamente para los proyectos asociados a **Droni.co**. Esta biblioteca está construida con Vue 3, TypeScript y Vite, proporcionando componentes modernos, accesibles y fáciles de usar para acelerar el desarrollo de aplicaciones web.
|
|
6
|
+
|
|
7
|
+
## 🚀 Características
|
|
8
|
+
|
|
9
|
+
- ✅ **Componentes Vue 3** con Composition API
|
|
10
|
+
- ✅ **TypeScript** para mejor experiencia de desarrollo
|
|
11
|
+
- ✅ **Tailwind CSS** para estilos consistentes
|
|
12
|
+
- ✅ **Soporte para Vue Router y Nuxt Router**
|
|
13
|
+
- ✅ **Documentación interactiva** con Storybook
|
|
14
|
+
- ✅ **Accessible** siguiendo estándares web
|
|
15
|
+
- ✅ **Tree-shaking** para bundles optimizados
|
|
16
|
+
|
|
17
|
+
## 📦 Instalación
|
|
18
|
+
|
|
19
|
+
Para instalar droni-kit, usa npm dentro de tu proyecto de Vue 3:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install @dronico/droni-kit
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Luego importa la hoja de estilos en tu archivo principal (`main.js` o `main.ts`):
|
|
26
|
+
|
|
27
|
+
```javascript
|
|
28
|
+
import '@dronico/droni-kit/dist/droni-kit.css';
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## 🎯 Uso Básico
|
|
32
|
+
|
|
33
|
+
Una vez instalado, puedes usar los componentes en tu aplicación Vue:
|
|
34
|
+
|
|
35
|
+
```vue
|
|
36
|
+
<template>
|
|
37
|
+
<div>
|
|
38
|
+
<DuiButton color="primary" @click="handleClick">
|
|
39
|
+
¡Hola Droni-kit!
|
|
40
|
+
</DuiButton>
|
|
41
|
+
</div>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<script setup lang="ts">
|
|
45
|
+
import { DuiButton } from '@dronico/droni-kit'
|
|
46
|
+
|
|
47
|
+
const handleClick = () => {
|
|
48
|
+
console.log('¡Botón presionado!')
|
|
49
|
+
}
|
|
50
|
+
</script>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## 📚 Componentes Disponibles
|
|
54
|
+
|
|
55
|
+
### 🎨 Elements
|
|
56
|
+
|
|
57
|
+
#### **DuiAlert**
|
|
58
|
+
Componente para mostrar alertas y notificaciones.
|
|
59
|
+
```vue
|
|
60
|
+
<DuiAlert variant="solid" color="success">
|
|
61
|
+
¡Operación completada exitosamente!
|
|
62
|
+
</DuiAlert>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
#### **DuiAction**
|
|
66
|
+
Componente de acción que soporta navegación con Vue Router y Nuxt Router.
|
|
67
|
+
```vue
|
|
68
|
+
<DuiAction to="/dashboard" variant="outline" color="primary">
|
|
69
|
+
Ir al Dashboard
|
|
70
|
+
</DuiAction>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
#### **DuiTable**
|
|
74
|
+
Tabla con soporte para slots personalizados por columna.
|
|
75
|
+
```vue
|
|
76
|
+
<DuiTable :columns="columns" :rows="data">
|
|
77
|
+
<template #age="{ age }">
|
|
78
|
+
<span class="font-bold">{{ age }} años</span>
|
|
79
|
+
</template>
|
|
80
|
+
</DuiTable>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### 📝 Forms
|
|
84
|
+
|
|
85
|
+
#### **DuiButton**
|
|
86
|
+
Botón versátil con soporte para navegación y estados de carga.
|
|
87
|
+
```vue
|
|
88
|
+
<DuiButton
|
|
89
|
+
variant="solid"
|
|
90
|
+
color="primary"
|
|
91
|
+
:loading="isLoading"
|
|
92
|
+
@click="submit"
|
|
93
|
+
>
|
|
94
|
+
Enviar
|
|
95
|
+
</DuiButton>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
#### **DuiInput**
|
|
99
|
+
Campo de entrada con validación y múltiples tipos.
|
|
100
|
+
```vue
|
|
101
|
+
<DuiInput
|
|
102
|
+
v-model="email"
|
|
103
|
+
type="email"
|
|
104
|
+
label="Correo electrónico"
|
|
105
|
+
placeholder="ejemplo@droni.co"
|
|
106
|
+
required
|
|
107
|
+
/>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
#### **DuiSelect**
|
|
111
|
+
Selector desplegable con opciones personalizables.
|
|
112
|
+
```vue
|
|
113
|
+
<DuiSelect
|
|
114
|
+
v-model="selectedCountry"
|
|
115
|
+
:options="countries"
|
|
116
|
+
item-label="name"
|
|
117
|
+
item-value="id"
|
|
118
|
+
label="Selecciona un país"
|
|
119
|
+
/>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
#### **DuiTextarea**
|
|
123
|
+
Área de texto con auto-redimensionamiento opcional.
|
|
124
|
+
```vue
|
|
125
|
+
<DuiTextarea
|
|
126
|
+
v-model="message"
|
|
127
|
+
label="Mensaje"
|
|
128
|
+
placeholder="Escribe tu mensaje aquí..."
|
|
129
|
+
:autoheight="true"
|
|
130
|
+
/>
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## 🎨 Sistema de Design
|
|
134
|
+
|
|
135
|
+
### Variantes
|
|
136
|
+
- `solid` - Estilo sólido (predeterminado)
|
|
137
|
+
- `outline` - Solo borde
|
|
138
|
+
- `ghost` - Estilo transparente
|
|
139
|
+
|
|
140
|
+
### Colores
|
|
141
|
+
- `neutral` - Gris (predeterminado)
|
|
142
|
+
- `primary` - Azul
|
|
143
|
+
- `secondary` - Rosa
|
|
144
|
+
- `success` - Verde
|
|
145
|
+
- `warning` - Amarillo
|
|
146
|
+
- `danger` - Rojo
|
|
147
|
+
|
|
148
|
+
### Tamaños
|
|
149
|
+
- `sm` - Pequeño
|
|
150
|
+
- `md` - Mediano (predeterminado)
|
|
151
|
+
- `lg` - Grande
|
|
152
|
+
|
|
153
|
+
### Esquinas redondeadas
|
|
154
|
+
- `all` - Todas las esquinas (predeterminado)
|
|
155
|
+
- `top` - Solo arriba
|
|
156
|
+
- `bottom` - Solo abajo
|
|
157
|
+
- `left` - Solo izquierda
|
|
158
|
+
- `right` - Solo derecha
|
|
159
|
+
- `none` - Sin redondeo
|
|
160
|
+
|
|
161
|
+
## 🧭 Navegación
|
|
162
|
+
|
|
163
|
+
Los componentes `DuiButton` y `DuiAction` detectan automáticamente si Vue Router o Nuxt Router están disponibles:
|
|
164
|
+
|
|
165
|
+
```vue
|
|
166
|
+
<!-- Con Vue Router -->
|
|
167
|
+
<DuiButton to="/users">Lista de usuarios</DuiButton>
|
|
168
|
+
|
|
169
|
+
<!-- Con objeto de ruta -->
|
|
170
|
+
<DuiButton :to="{ name: 'user', params: { id: 123 } }">
|
|
171
|
+
Ver perfil
|
|
172
|
+
</DuiButton>
|
|
173
|
+
|
|
174
|
+
<!-- Enlace externo -->
|
|
175
|
+
<DuiButton to="https://droni.co">
|
|
176
|
+
Ir a Droni.co
|
|
177
|
+
</DuiButton>
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## 📖 Documentación
|
|
181
|
+
|
|
182
|
+
Puedes explorar todos los componentes y sus variantes en nuestra documentación interactiva de Storybook:
|
|
7
183
|
|
|
8
184
|
```bash
|
|
9
|
-
|
|
10
|
-
```
|
|
185
|
+
npm run storybook
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## 🛠️ Desarrollo
|
|
189
|
+
|
|
190
|
+
### Prerequisitos
|
|
191
|
+
|
|
192
|
+
- Node.js 18+
|
|
193
|
+
- npm o yarn
|
|
194
|
+
|
|
195
|
+
### Configuración del entorno
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
# Clona el repositorio
|
|
199
|
+
git clone https://github.com/Droni-app/droni-kit.git
|
|
200
|
+
cd droni-kit
|
|
201
|
+
|
|
202
|
+
# Instala las dependencias
|
|
203
|
+
npm install
|
|
204
|
+
|
|
205
|
+
# Inicia el servidor de desarrollo
|
|
206
|
+
npm run dev
|
|
207
|
+
|
|
208
|
+
# Ejecuta Storybook
|
|
209
|
+
npm run storybook
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Scripts disponibles
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
npm run dev # Servidor de desarrollo
|
|
216
|
+
npm run build # Construir para producción
|
|
217
|
+
npm run preview # Vista previa de la build
|
|
218
|
+
npm run storybook # Ejecutar Storybook
|
|
219
|
+
npm run build-storybook # Construir Storybook estático
|
|
220
|
+
npm run test # Ejecutar tests (Vitest)
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## 🤝 Contributing
|
|
224
|
+
|
|
225
|
+
¡Contribuciones son bienvenidas! Por favor sigue estos pasos:
|
|
226
|
+
|
|
227
|
+
### 1. Fork y Clone
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
git clone https://github.com/tu-usuario/droni-kit.git
|
|
231
|
+
cd droni-kit
|
|
232
|
+
npm install
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### 2. Crear una rama
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
git checkout -b feature/nombre-de-tu-feature
|
|
239
|
+
# o
|
|
240
|
+
git checkout -b fix/descripcion-del-fix
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
### 3. Desarrollo
|
|
244
|
+
|
|
245
|
+
- Sigue las convenciones de código existentes
|
|
246
|
+
- Asegúrate de que tu código funcione con TypeScript
|
|
247
|
+
- Usa el prefijo `dk:` para las clases de Tailwind
|
|
248
|
+
- Agrega tests si es aplicable
|
|
249
|
+
- Documenta nuevos componentes en Storybook
|
|
250
|
+
|
|
251
|
+
### 4. Testing
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
# Ejecuta los tests
|
|
255
|
+
npm run test
|
|
256
|
+
|
|
257
|
+
# Verifica que Storybook funcione
|
|
258
|
+
npm run storybook
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### 5. Commit
|
|
262
|
+
|
|
263
|
+
Usamos [Conventional Commits](https://www.conventionalcommits.org/):
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
git commit -m "feat: agregar componente DuiModal"
|
|
267
|
+
git commit -m "fix: corregir padding en DuiButton"
|
|
268
|
+
git commit -m "docs: actualizar documentación de DuiInput"
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### 6. Pull Request
|
|
272
|
+
|
|
273
|
+
1. Push tu rama: `git push origin feature/nombre-de-tu-feature`
|
|
274
|
+
2. Abre un Pull Request en GitHub
|
|
275
|
+
3. Describe los cambios realizados
|
|
276
|
+
4. Asegúrate de que los checks pasen
|
|
277
|
+
|
|
278
|
+
### Directrices para componentes
|
|
279
|
+
|
|
280
|
+
#### Estructura de archivos
|
|
281
|
+
```
|
|
282
|
+
src/stories/
|
|
283
|
+
├── Elements/
|
|
284
|
+
│ ├── DuiAlert.vue
|
|
285
|
+
│ ├── DuiAlert.stories.ts
|
|
286
|
+
│ └── ...
|
|
287
|
+
├── Forms/
|
|
288
|
+
│ ├── DuiButton.vue
|
|
289
|
+
│ ├── DuiButton.stories.ts
|
|
290
|
+
│ └── ...
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
#### Props estándar
|
|
294
|
+
Todos los componentes deben incluir estas props cuando sea aplicable:
|
|
295
|
+
- `variant`: `'solid' | 'outline' | 'ghost'`
|
|
296
|
+
- `color`: `'neutral' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger'`
|
|
297
|
+
- `size`: `'sm' | 'md' | 'lg'`
|
|
298
|
+
- `rounded`: `'all' | 'top' | 'bottom' | 'left' | 'right' | 'none'`
|
|
299
|
+
- `disabled`: `boolean`
|
|
300
|
+
- `block`: `boolean`
|
|
301
|
+
|
|
302
|
+
#### TypeScript
|
|
303
|
+
- Define interfaces para las props
|
|
304
|
+
- Exporta los tipos para uso externo
|
|
305
|
+
- Usa `withDefaults` para valores predeterminados
|
|
306
|
+
|
|
307
|
+
```typescript
|
|
308
|
+
export interface DuiComponentProps {
|
|
309
|
+
variant?: 'solid' | 'outline' | 'ghost'
|
|
310
|
+
color?: 'neutral' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger'
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
const props = withDefaults(defineProps<DuiComponentProps>(), {
|
|
314
|
+
variant: 'solid',
|
|
315
|
+
color: 'neutral'
|
|
316
|
+
})
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
## 📄 Licencia
|
|
320
|
+
|
|
321
|
+
Este proyecto está bajo la licencia MIT. Ver el archivo `LICENSE` para más detalles.
|
|
322
|
+
|
|
323
|
+
## 🌟 Créditos
|
|
324
|
+
|
|
325
|
+
Desarrollado con ❤️ por el equipo de [Droni.co](https://droni.co)
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
**¿Necesitas ayuda?** Abre un [issue](https://github.com/Droni-app/droni-kit/issues) o contáctanos en [Droni.co](https://droni.co)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dronico/droni-kit",
|
|
3
3
|
"author": "Gustavo Barragan <dev@droni.co>",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.9.1",
|
|
5
5
|
"private": false,
|
|
6
6
|
"access": "public",
|
|
7
7
|
"publishConfig": {
|
|
@@ -39,18 +39,16 @@
|
|
|
39
39
|
"vue": "^3.5.13"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@chromatic-com/storybook": "^
|
|
42
|
+
"@chromatic-com/storybook": "^4.1.1",
|
|
43
43
|
"@semantic-release/changelog": "^6.0.3",
|
|
44
44
|
"@semantic-release/git": "^10.0.1",
|
|
45
45
|
"@semantic-release/github": "^11.0.1",
|
|
46
46
|
"@semantic-release/npm": "^12.0.1",
|
|
47
|
-
"@storybook/addon-
|
|
48
|
-
"@storybook/addon-onboarding": "^
|
|
49
|
-
"@storybook/
|
|
50
|
-
"@storybook/
|
|
51
|
-
"@storybook/
|
|
52
|
-
"@storybook/vue3": "^8.6.12",
|
|
53
|
-
"@storybook/vue3-vite": "^8.6.12",
|
|
47
|
+
"@storybook/addon-docs": "^9.1.8",
|
|
48
|
+
"@storybook/addon-onboarding": "^9.1.8",
|
|
49
|
+
"@storybook/addon-themes": "^9.1.8",
|
|
50
|
+
"@storybook/addon-vitest": "9.1.8",
|
|
51
|
+
"@storybook/vue3-vite": "^9.1.8",
|
|
54
52
|
"@types/node": "^22.14.1",
|
|
55
53
|
"@vitejs/plugin-vue": "^5.2.1",
|
|
56
54
|
"@vitest/browser": "^3.1.1",
|
|
@@ -58,10 +56,9 @@
|
|
|
58
56
|
"@vue/tsconfig": "^0.7.0",
|
|
59
57
|
"playwright": "^1.51.1",
|
|
60
58
|
"semantic-release": "^24.2.3",
|
|
61
|
-
"storybook": "^
|
|
62
|
-
"storybook-dark-mode": "^4.0.2",
|
|
59
|
+
"storybook": "^9.1.8",
|
|
63
60
|
"typescript": "~5.7.2",
|
|
64
|
-
"vite": "^6.3.
|
|
61
|
+
"vite": "^6.3.6",
|
|
65
62
|
"vite-plugin-dts": "^4.5.3",
|
|
66
63
|
"vitest": "^3.1.1",
|
|
67
64
|
"vue-tsc": "^2.2.4"
|