@heroelc/fsociety 0.0.10 → 0.0.12
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 +379 -34
- package/fesm2022/heroelc-fsociety.mjs +53 -56
- package/fesm2022/heroelc-fsociety.mjs.map +1 -1
- package/lib/badge/badge.component.d.ts +17 -10
- package/lib/experience-card/experience-card.component.d.ts +3 -0
- package/lib/profile-card/profile-card.component.d.ts +12 -27
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,63 +1,408 @@
|
|
|
1
|
-
#
|
|
1
|
+
# fsociety
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Angular component library · Design system con tokens, mixins y componentes UI
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@heroelc/fsociety)
|
|
6
|
+
[](https://angular.io)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
[](https://heroelc.github.io/fsociety)
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Instalación
|
|
8
13
|
|
|
9
14
|
```bash
|
|
10
|
-
|
|
15
|
+
npm install @heroelc/fsociety
|
|
11
16
|
```
|
|
12
17
|
|
|
13
|
-
|
|
18
|
+
### Prerrequisitos
|
|
14
19
|
|
|
15
|
-
|
|
16
|
-
|
|
20
|
+
- Angular 19+
|
|
21
|
+
- Node 18+
|
|
22
|
+
- SCSS habilitado en el proyecto
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Setup rápido
|
|
27
|
+
|
|
28
|
+
### 1. Cargar los tokens en `styles.scss`
|
|
29
|
+
|
|
30
|
+
```scss
|
|
31
|
+
// src/styles.scss de tu app Angular
|
|
32
|
+
@use '@heroelc/fsociety/styles/tokens';
|
|
33
|
+
@use '@heroelc/fsociety/styles/mixins'; // opcional — clases utilitarias
|
|
17
34
|
```
|
|
18
35
|
|
|
19
|
-
|
|
36
|
+
Esto emite todas las CSS custom properties (`--fs-primary-base`, `--fs-primary-hover`, etc.) en `:root`, disponibles globalmente en toda la app.
|
|
20
37
|
|
|
21
|
-
|
|
38
|
+
### 2. Importar componentes
|
|
22
39
|
|
|
23
|
-
|
|
24
|
-
|
|
40
|
+
Los componentes son **standalone** — se importan directo en el `imports` del componente o módulo:
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
import { FsButtonComponent } from '@heroelc/fsociety';
|
|
44
|
+
|
|
45
|
+
@Component({
|
|
46
|
+
standalone: true,
|
|
47
|
+
imports: [FsButtonComponent],
|
|
48
|
+
template: `<fs-button variant="primary">Guardar</fs-button>`
|
|
49
|
+
})
|
|
50
|
+
export class MyComponent {}
|
|
25
51
|
```
|
|
26
52
|
|
|
27
|
-
|
|
53
|
+
---
|
|
28
54
|
|
|
29
|
-
|
|
55
|
+
## Componentes
|
|
30
56
|
|
|
31
|
-
|
|
57
|
+
### `<fs-button>`
|
|
32
58
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
59
|
+
```html
|
|
60
|
+
<fs-button variant="primary" size="md">Guardar</fs-button>
|
|
61
|
+
<fs-button variant="secondary">Cancelar</fs-button>
|
|
62
|
+
<fs-button variant="outline" [disabled]="loading">Editar</fs-button>
|
|
63
|
+
<fs-button variant="ghost">Ver más →</fs-button>
|
|
64
|
+
<fs-button variant="danger">Eliminar</fs-button>
|
|
65
|
+
<fs-button [loading]="true">Guardando</fs-button>
|
|
66
|
+
```
|
|
37
67
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
68
|
+
| Input | Tipo | Default | Descripción |
|
|
69
|
+
|---|---|---|---|
|
|
70
|
+
| `variant` | `'primary' \| 'secondary' \| 'outline' \| 'ghost' \| 'danger'` | `'primary'` | Variante visual |
|
|
71
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Tamaño |
|
|
72
|
+
| `disabled` | `boolean` | `false` | Estado deshabilitado |
|
|
73
|
+
| `loading` | `boolean` | `false` | Muestra spinner y deshabilita |
|
|
74
|
+
| `fullWidth` | `boolean` | `false` | Ocupa el 100% del contenedor |
|
|
75
|
+
| `iconLeft` | `string` | — | SVG path del ícono izquierdo |
|
|
76
|
+
| `iconRight` | `string` | — | SVG path del ícono derecho |
|
|
77
|
+
| `type` | `'button' \| 'submit' \| 'reset'` | `'button'` | Tipo HTML nativo |
|
|
42
78
|
|
|
43
|
-
|
|
79
|
+
| Output | Tipo | Descripción |
|
|
80
|
+
|---|---|---|
|
|
81
|
+
| `fsClick` | `EventEmitter<MouseEvent>` | Click (no emite si disabled o loading) |
|
|
44
82
|
|
|
45
|
-
|
|
83
|
+
---
|
|
46
84
|
|
|
47
|
-
|
|
48
|
-
|
|
85
|
+
### `<fs-badge>`
|
|
86
|
+
|
|
87
|
+
```html
|
|
88
|
+
<fs-badge color="primary">TypeScript</fs-badge>
|
|
89
|
+
<fs-badge color="success" [dot]="true">Activo</fs-badge>
|
|
90
|
+
<fs-badge color="neutral" variant="outline">ESLint</fs-badge>
|
|
91
|
+
|
|
92
|
+
<!-- con imagen (simpleicons, assets, etc.) -->
|
|
93
|
+
<fs-badge color="danger"
|
|
94
|
+
imgLeft="https://cdn.simpleicons.org/angular/white"
|
|
95
|
+
imgLeftAlt="Angular">
|
|
96
|
+
Angular
|
|
97
|
+
</fs-badge>
|
|
98
|
+
|
|
99
|
+
<!-- con color hex personalizado -->
|
|
100
|
+
<fs-badge customColor="#7c3aed"
|
|
101
|
+
imgLeft="https://cdn.simpleicons.org/nestjs/white">
|
|
102
|
+
NestJS
|
|
103
|
+
</fs-badge>
|
|
104
|
+
|
|
105
|
+
<!-- removable -->
|
|
106
|
+
<fs-badge color="primary" [removable]="true" (removed)="onRemove()">TypeScript</fs-badge>
|
|
49
107
|
```
|
|
50
108
|
|
|
51
|
-
|
|
109
|
+
| Input | Tipo | Default | Descripción |
|
|
110
|
+
|---|---|---|---|
|
|
111
|
+
| `color` | `'primary' \| 'secondary' \| 'tertiary' \| 'success' \| 'warning' \| 'danger' \| 'neutral'` | `'neutral'` | Color semántico |
|
|
112
|
+
| `customColor` | `string` | — | Color hex personalizado — genera fondo, borde y texto automáticamente |
|
|
113
|
+
| `variant` | `'filled' \| 'outline'` | `'filled'` | Variante visual |
|
|
114
|
+
| `size` | `'sm' \| 'md'` | `'md'` | Tamaño |
|
|
115
|
+
| `dot` | `boolean` | `false` | Punto de estado |
|
|
116
|
+
| `iconLeft` | `string` | — | SVG path ícono izquierdo (viewBox 0 0 24 24) |
|
|
117
|
+
| `iconRight` | `string` | — | SVG path ícono derecho |
|
|
118
|
+
| `imgLeft` | `string` | — | URL o ruta imagen izquierda (prioridad sobre iconLeft) |
|
|
119
|
+
| `imgRight` | `string` | — | URL o ruta imagen derecha |
|
|
120
|
+
| `imgLeftAlt` | `string` | `''` | Alt text para imgLeft |
|
|
121
|
+
| `imgRightAlt` | `string` | `''` | Alt text para imgRight |
|
|
122
|
+
| `iconOnly` | `boolean` | `false` | Badge circular sin label |
|
|
123
|
+
| `removable` | `boolean` | `false` | Muestra botón X |
|
|
52
124
|
|
|
53
|
-
|
|
125
|
+
| Output | Tipo | Descripción |
|
|
126
|
+
|---|---|---|
|
|
127
|
+
| `removed` | `EventEmitter<void>` | Emite al clickear el X |
|
|
54
128
|
|
|
55
|
-
|
|
56
|
-
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
### `<fs-tabs>`
|
|
132
|
+
|
|
133
|
+
```html
|
|
134
|
+
<fs-tabs [tabs]="tabs" [(activeTab)]="activeTab">
|
|
135
|
+
<div *ngIf="activeTab === 'experiencia'">...</div>
|
|
136
|
+
<div *ngIf="activeTab === 'sobre-mi'">...</div>
|
|
137
|
+
</fs-tabs>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
```typescript
|
|
141
|
+
tabs = [
|
|
142
|
+
{ id: 'experiencia', label: 'Experiencia' },
|
|
143
|
+
{ id: 'sobre-mi', label: 'Sobre mí' },
|
|
144
|
+
{ id: 'formacion', label: 'Formación' },
|
|
145
|
+
];
|
|
146
|
+
activeTab = 'experiencia';
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
| Input | Tipo | Default | Descripción |
|
|
150
|
+
|---|---|---|---|
|
|
151
|
+
| `tabs` | `FsTab[]` | `[]` | Array de tabs `{ id, label, disabled? }` |
|
|
152
|
+
| `activeTab` | `string` | `''` | Id de la tab activa |
|
|
153
|
+
|
|
154
|
+
| Output | Tipo | Descripción |
|
|
155
|
+
|---|---|---|
|
|
156
|
+
| `activeTabChange` | `EventEmitter<string>` | Two-way binding |
|
|
157
|
+
| `tabChange` | `EventEmitter<FsTab>` | Emite el objeto FsTab completo |
|
|
158
|
+
|
|
159
|
+
**CSS custom properties configurables:**
|
|
160
|
+
|
|
161
|
+
```css
|
|
162
|
+
fs-tabs {
|
|
163
|
+
--fs-tab-bg: #0d1117;
|
|
164
|
+
--fs-tab-color: rgba(255,255,255,0.40);
|
|
165
|
+
--fs-tab-color-hover: rgba(255,255,255,0.70);
|
|
166
|
+
--fs-tab-color-active: #ffffff;
|
|
167
|
+
--fs-tab-border: rgba(255,255,255,0.08);
|
|
168
|
+
--fs-tab-hover-bg: rgba(255,255,255,0.03);
|
|
169
|
+
--fs-tab-indicator-from: var(--fs-primary-base);
|
|
170
|
+
--fs-tab-indicator-to: var(--fs-tertiary-base);
|
|
171
|
+
--fs-tab-indicator-glow: rgba(34,211,238,0.45);
|
|
172
|
+
}
|
|
57
173
|
```
|
|
58
174
|
|
|
59
|
-
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
### `<fs-alert>`
|
|
178
|
+
|
|
179
|
+
```html
|
|
180
|
+
<fs-alert type="info" title="Actualización disponible" [dismissible]="true">
|
|
181
|
+
Nueva versión disponible: v0.0.2
|
|
182
|
+
</fs-alert>
|
|
183
|
+
|
|
184
|
+
<fs-alert type="success" variant="accent" [autoDismiss]="3000">
|
|
185
|
+
Cambios guardados correctamente.
|
|
186
|
+
</fs-alert>
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
| Input | Tipo | Default | Descripción |
|
|
190
|
+
|---|---|---|---|
|
|
191
|
+
| `type` | `'info' \| 'success' \| 'warning' \| 'danger' \| 'neutral'` | `'info'` | Tipo semántico |
|
|
192
|
+
| `variant` | `'filled' \| 'accent'` | `'filled'` | filled = fondo · accent = borde izq. |
|
|
193
|
+
| `title` | `string` | — | Título en negrita |
|
|
194
|
+
| `dismissible` | `boolean` | `false` | Muestra botón X |
|
|
195
|
+
| `autoDismiss` | `number` | `0` | Auto-cierre en ms (0 = off) |
|
|
196
|
+
|
|
197
|
+
| Output | Tipo | Descripción |
|
|
198
|
+
|---|---|---|
|
|
199
|
+
| `dismissed` | `EventEmitter<void>` | Emite al cerrarse |
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
### `<fs-experience-card>`
|
|
204
|
+
|
|
205
|
+
```typescript
|
|
206
|
+
experience = {
|
|
207
|
+
company: 'Acme Corp',
|
|
208
|
+
role: 'Senior Frontend Developer',
|
|
209
|
+
startDate: 'mar 2022',
|
|
210
|
+
current: true,
|
|
211
|
+
logoText: 'ACME',
|
|
212
|
+
bullets: [
|
|
213
|
+
'Desarrollo de interfaces con Angular 17+, migraciones de versiones anteriores.',
|
|
214
|
+
'Configuración de pipelines CI/CD en AWS CodeBuild y ECS.',
|
|
215
|
+
'Implementación de design system con tokens SCSS y componentes standalone.',
|
|
216
|
+
],
|
|
217
|
+
bulletsPreview: 2,
|
|
218
|
+
badges: [
|
|
219
|
+
{
|
|
220
|
+
label: 'Angular',
|
|
221
|
+
color: 'danger',
|
|
222
|
+
imgLeft: 'https://cdn.simpleicons.org/angular/white',
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
label: 'TypeScript',
|
|
226
|
+
color: 'primary',
|
|
227
|
+
imgLeft: 'https://cdn.simpleicons.org/typescript/white',
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
label: 'AWS',
|
|
231
|
+
customColor: '#ea580c',
|
|
232
|
+
imgLeft: 'https://cdn.simpleicons.org/amazonaws/white',
|
|
233
|
+
},
|
|
234
|
+
{ label: 'ESLint', color: 'neutral' },
|
|
235
|
+
],
|
|
236
|
+
};
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
> `FsExperienceBadge` acepta los mismos campos que `FsProfileBadge`:
|
|
240
|
+
> `color`, `customColor`, `iconLeft`, `imgLeft`, `imgLeftAlt`.
|
|
241
|
+
|
|
242
|
+
```html
|
|
243
|
+
<fs-experience-card
|
|
244
|
+
[experience]="experience"
|
|
245
|
+
variant="full"
|
|
246
|
+
[timeline]="true"
|
|
247
|
+
[timelineLast]="false"
|
|
248
|
+
/>
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
| Input | Tipo | Default | Descripción |
|
|
252
|
+
|---|---|---|---|
|
|
253
|
+
| `experience` | `FsExperienceCard` | — | Datos de la experiencia |
|
|
254
|
+
| `variant` | `'full' \| 'compact'` | `'full'` | full = con bullets · compact = solo header |
|
|
255
|
+
| `timeline` | `boolean` | `false` | Línea y dot de timeline |
|
|
256
|
+
| `timelineLast` | `boolean` | `false` | Último item (oculta línea hacia abajo) |
|
|
257
|
+
|
|
258
|
+
**CSS custom properties configurables:**
|
|
259
|
+
|
|
260
|
+
```css
|
|
261
|
+
fs-experience-card {
|
|
262
|
+
--fs-exp-radius: 12px; /* 0 para layout full width sin redondeo */
|
|
263
|
+
}
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
### `<fs-profile-card>`
|
|
269
|
+
|
|
270
|
+
```html
|
|
271
|
+
<fs-profile-card
|
|
272
|
+
name="John Doe"
|
|
273
|
+
handle="johndoe"
|
|
274
|
+
role="Frontend Developer"
|
|
275
|
+
avatarUrl="https://i.pravatar.cc/150?img=8"
|
|
276
|
+
bannerUrl="https://picsum.photos/seed/fsociety/800/200"
|
|
277
|
+
[verified]="true"
|
|
278
|
+
[showActions]="false"
|
|
279
|
+
[links]="links"
|
|
280
|
+
[badges]="badges"
|
|
281
|
+
[stats]="stats"
|
|
282
|
+
/>
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
```typescript
|
|
286
|
+
links = [
|
|
287
|
+
{
|
|
288
|
+
label: 'linkedin.com/in/johndoe',
|
|
289
|
+
url: 'https://linkedin.com/in/johndoe',
|
|
290
|
+
imgUrl: 'https://cdn.simpleicons.org/linkedin/white',
|
|
291
|
+
imgAlt: 'LinkedIn',
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
label: 'github.com/johndoe',
|
|
295
|
+
url: 'https://github.com/johndoe',
|
|
296
|
+
imgUrl: 'https://cdn.simpleicons.org/github/white',
|
|
297
|
+
imgAlt: 'GitHub',
|
|
298
|
+
},
|
|
299
|
+
{ label: 'Buenos Aires, Argentina' },
|
|
300
|
+
];
|
|
301
|
+
badges = [
|
|
302
|
+
{
|
|
303
|
+
label: 'Angular',
|
|
304
|
+
color: 'danger',
|
|
305
|
+
imgLeft: 'https://cdn.simpleicons.org/angular/white',
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
label: 'TypeScript',
|
|
309
|
+
color: 'primary',
|
|
310
|
+
imgLeft: 'https://cdn.simpleicons.org/typescript/white',
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
label: 'NestJS',
|
|
314
|
+
customColor: '#7c3aed',
|
|
315
|
+
imgLeft: 'https://cdn.simpleicons.org/nestjs/white',
|
|
316
|
+
},
|
|
317
|
+
];
|
|
318
|
+
stats = [
|
|
319
|
+
{ value: '4+', label: 'años exp.' },
|
|
320
|
+
{ value: '12', label: 'proyectos' },
|
|
321
|
+
{ value: '985', label: 'seguidores' },
|
|
322
|
+
];
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
**CSS custom properties configurables:**
|
|
326
|
+
|
|
327
|
+
```css
|
|
328
|
+
fs-profile-card {
|
|
329
|
+
--fs-profile-radius: 14px; /* 0 para layout full width sin redondeo */
|
|
330
|
+
}
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
> **Obtener tu avatarUrl de GitHub:**
|
|
334
|
+
> Abrí `https://api.github.com/users/TU_USUARIO`, copiá el campo `id` y usá:
|
|
335
|
+
> `https://avatars.githubusercontent.com/u/TU_ID`
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
339
|
+
## Sistema de tokens
|
|
340
|
+
|
|
341
|
+
```scss
|
|
342
|
+
--fs-{color}-muted // 50 — badge bg, chip, alert sutil
|
|
343
|
+
--fs-{color}-subtle // 100 — ghost hover bg
|
|
344
|
+
--fs-{color}-tint // 200 — selected bg, focus fill
|
|
345
|
+
--fs-{color}-light // 300 — borders sobre fondos claros
|
|
346
|
+
--fs-{color}-soft // 400 — íconos, disabled
|
|
347
|
+
--fs-{color}-base // 500 — color principal
|
|
348
|
+
--fs-{color}-hover // 600 — hover en solid buttons
|
|
349
|
+
--fs-{color}-active // 700 — pressed
|
|
350
|
+
--fs-{color}-emphasis // 800 — texto sobre mismo color
|
|
351
|
+
--fs-{color}-contrast // 900 — texto dark sobre tint/muted
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
Colores disponibles: `primary · secondary · tertiary · neutral · success · warning · danger`
|
|
355
|
+
|
|
356
|
+
### Theming por app
|
|
357
|
+
|
|
358
|
+
```scss
|
|
359
|
+
@use '@heroelc/fsociety/styles/tokens' with (
|
|
360
|
+
$fs-primary-hex: #7c3aed,
|
|
361
|
+
$fs-secondary-hex: #0891b2,
|
|
362
|
+
$fs-tertiary-hex: #0d9488,
|
|
363
|
+
);
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
## Mixins y utilidades
|
|
369
|
+
|
|
370
|
+
```scss
|
|
371
|
+
@use '@heroelc/fsociety/styles/mixins' as m;
|
|
372
|
+
|
|
373
|
+
.mi-componente {
|
|
374
|
+
@include m.flex-center;
|
|
375
|
+
@include m.px(4); // padding-left + right: 16px
|
|
376
|
+
@include m.stack(16px); // flex-col + gap
|
|
377
|
+
@include m.truncate;
|
|
378
|
+
|
|
379
|
+
@include m.respond-to('md') {
|
|
380
|
+
@include m.flex-between;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
O con clases utilitarias directamente en el HTML:
|
|
386
|
+
|
|
387
|
+
```html
|
|
388
|
+
<div class="flex-between px-6 py-4 gap-4">
|
|
389
|
+
<span class="truncate-2 text-sm font-medium">...</span>
|
|
390
|
+
<span class="uppercase-label">Frontend Developer</span>
|
|
391
|
+
</div>
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
Breakpoints: `sm` 640px · `md` 768px · `lg` 1024px · `xl` 1280px · `xxl` 1536px
|
|
395
|
+
|
|
396
|
+
---
|
|
397
|
+
|
|
398
|
+
## Contribuir
|
|
399
|
+
|
|
400
|
+
Issues y PRs bienvenidos en [github.com/heroelc/fsociety](https://github.com/heroelc/fsociety).
|
|
401
|
+
|
|
402
|
+
Documentación visual en Storybook: [heroelc.github.io/fsociety](https://heroelc.github.io/fsociety)
|
|
403
|
+
|
|
404
|
+
---
|
|
60
405
|
|
|
61
|
-
##
|
|
406
|
+
## Licencia
|
|
62
407
|
|
|
63
|
-
|
|
408
|
+
[MIT](LICENSE) © heroelc
|