pdm-ui-kit 0.1.1 → 0.1.2
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 +99 -50
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,79 +1,128 @@
|
|
|
1
1
|
# PDM UI Kit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Librería de componentes UI para Angular (13, 14 y 15), construida sobre patrones visuales del **Figma de shadcn/ui** y adaptada para el ecosistema de Corelusa.
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
- Usar Tailwind CSS v3 y tokens CSS del proyecto consumidor.
|
|
5
|
+
## Base de diseño
|
|
6
|
+
|
|
7
|
+
Este kit está **basado en el Figma de shadcn/ui** y mantiene una estructura de estilos por tokens CSS (por ejemplo: `--background`, `--foreground`, `--primary`, `--border`, `--ring`, `--radius`).
|
|
9
8
|
|
|
10
9
|
## Compatibilidad
|
|
11
|
-
- Angular: 13, 14, 15 (NgModules, sin standalone).
|
|
12
|
-
- Tailwind: v3.
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
-
|
|
11
|
+
- Angular: 13, 14, 15
|
|
12
|
+
- Arquitectura: NgModules (no standalone)
|
|
13
|
+
- Estilos: Tailwind CSS v3 + variables CSS del proyecto consumidor
|
|
14
|
+
|
|
15
|
+
## Uso rápido
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
### 1) Importa el módulo
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
```ts
|
|
20
|
+
import { NgModule } from '@angular/core';
|
|
21
|
+
import { BrowserModule } from '@angular/platform-browser';
|
|
22
|
+
import { PdmUiKitModule } from 'pdm-ui-kit';
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
import { AppComponent } from './app.component';
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
]
|
|
32
|
-
};
|
|
26
|
+
@NgModule({
|
|
27
|
+
declarations: [AppComponent],
|
|
28
|
+
imports: [BrowserModule, PdmUiKitModule],
|
|
29
|
+
bootstrap: [AppComponent]
|
|
30
|
+
})
|
|
31
|
+
export class AppModule {}
|
|
33
32
|
```
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
- `src/public-api.ts`: exports públicos.
|
|
37
|
-
- `src/lib/pdm-ui-kit.module.ts`: módulo raíz.
|
|
38
|
-
- `src/lib/components/*`: componentes.
|
|
34
|
+
### 2) Usa componentes en tus templates
|
|
39
35
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
-
|
|
36
|
+
#### Botón
|
|
37
|
+
|
|
38
|
+
```html
|
|
39
|
+
<pdm-button variant="primary" size="default">Guardar</pdm-button>
|
|
40
|
+
<pdm-button variant="destructive" size="small">Eliminar</pdm-button>
|
|
41
|
+
<pdm-button variant="outline" size="large">Cancelar</pdm-button>
|
|
42
|
+
```
|
|
44
43
|
|
|
45
|
-
|
|
46
|
-
Este repo ya está configurado con `ng-packagr` para publicar el paquete generado en `dist/`.
|
|
44
|
+
#### Alert
|
|
47
45
|
|
|
48
|
-
|
|
46
|
+
```html
|
|
47
|
+
<pdm-alert
|
|
48
|
+
variant="default"
|
|
49
|
+
title="Cambios guardados"
|
|
50
|
+
description="La configuración fue actualizada correctamente.">
|
|
51
|
+
</pdm-alert>
|
|
49
52
|
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
<pdm-alert
|
|
54
|
+
variant="destructive"
|
|
55
|
+
title="Error al procesar"
|
|
56
|
+
description="Intenta nuevamente en unos minutos.">
|
|
57
|
+
</pdm-alert>
|
|
52
58
|
```
|
|
53
59
|
|
|
54
|
-
|
|
60
|
+
#### Tabs
|
|
55
61
|
|
|
56
|
-
```
|
|
57
|
-
|
|
62
|
+
```html
|
|
63
|
+
<pdm-tabs [items]="tabs" [(value)]="activeTab"></pdm-tabs>
|
|
64
|
+
<p>Tab activa: {{ activeTab }}</p>
|
|
58
65
|
```
|
|
59
66
|
|
|
60
|
-
|
|
67
|
+
```ts
|
|
68
|
+
tabs = [
|
|
69
|
+
{ label: 'General', value: 'general' },
|
|
70
|
+
{ label: 'Seguridad', value: 'security' },
|
|
71
|
+
{ label: 'Facturación', value: 'billing' }
|
|
72
|
+
];
|
|
61
73
|
|
|
62
|
-
|
|
74
|
+
activeTab = 'general';
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
#### Iconos
|
|
63
78
|
|
|
64
|
-
```
|
|
65
|
-
|
|
79
|
+
```html
|
|
80
|
+
<pdm-icon name="search" library="lucide" [size]="18"></pdm-icon>
|
|
81
|
+
<pdm-icon name="user" library="phosphor" [size]="20"></pdm-icon>
|
|
66
82
|
```
|
|
67
83
|
|
|
68
|
-
|
|
84
|
+
Si necesitas un asset exportado desde Figma MCP:
|
|
69
85
|
|
|
70
|
-
```
|
|
71
|
-
|
|
86
|
+
```html
|
|
87
|
+
<pdm-icon
|
|
88
|
+
[assetUrl]="'http://localhost:3845/assets/icon-alert.svg'"
|
|
89
|
+
ariaLabel="Alerta">
|
|
90
|
+
</pdm-icon>
|
|
72
91
|
```
|
|
73
92
|
|
|
74
|
-
|
|
93
|
+
#### Chart
|
|
94
|
+
|
|
95
|
+
```html
|
|
96
|
+
<pdm-chart
|
|
97
|
+
type="line"
|
|
98
|
+
title="Visitas"
|
|
99
|
+
description="Últimos 30 días"
|
|
100
|
+
[labels]="['Lun', 'Mar', 'Mie', 'Jue', 'Vie']"
|
|
101
|
+
[line]="[12, 18, 15, 22, 19]">
|
|
102
|
+
</pdm-chart>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Tipos soportados en `pdm-chart`:
|
|
106
|
+
|
|
107
|
+
- `area`
|
|
108
|
+
- `bar`
|
|
109
|
+
- `line`
|
|
110
|
+
- `pie`
|
|
111
|
+
- `radar`
|
|
112
|
+
- `radial`
|
|
113
|
+
- `tooltips`
|
|
114
|
+
|
|
115
|
+
## Theming
|
|
116
|
+
|
|
117
|
+
Los componentes leen los tokens CSS del proyecto consumidor. Define tus variables globales para aplicar tu tema (light/dark o custom branding) sin modificar el kit.
|
|
118
|
+
|
|
119
|
+
## Componentes disponibles
|
|
120
|
+
|
|
121
|
+
Incluye componentes como:
|
|
122
|
+
|
|
123
|
+
- `pdm-button`, `pdm-input`, `pdm-textarea`, `pdm-select`
|
|
124
|
+
- `pdm-alert`, `pdm-badge`, `pdm-card`, `pdm-dialog`
|
|
125
|
+
- `pdm-tabs`, `pdm-table`, `pdm-data-table`, `pdm-chart`
|
|
126
|
+
- `pdm-tooltip`, `pdm-popover`, `pdm-dropdown-menu`, `pdm-sidebar`
|
|
75
127
|
|
|
76
|
-
|
|
77
|
-
1. Convertir a librería Angular publicada (`ng-packagr` / Angular library).
|
|
78
|
-
2. Publicar en registry privado (`pdm-ui-kit`).
|
|
79
|
-
3. Mantener versionado semántico y changelog.
|
|
128
|
+
Y más, todos exportados desde `PdmUiKitModule`.
|