@adamosuiteservices/ui 1.9.15 → 2.9.16

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.
@@ -33,7 +33,7 @@ import { Combobox } from "@adamosuiteservices/ui/combobox";
33
33
  | `searchable` | `boolean` | `false` | Habilita input de búsqueda |
34
34
  | `multiple` | `boolean` | `false` | Permite selección múltiple |
35
35
  | `selectedFeedback` | `"checkbox" \| "check"` | `"checkbox"` | Tipo de indicador visual |
36
- | `icon` | `ComponentType<{ className?: string }>` | - | Componente de icono opcional para mostrar en el trigger |
36
+ | `icon` | `string` | - | Icono Material Symbol opcional para mostrar en el trigger |
37
37
  | `alwaysShowPlaceholder` | `boolean` | `false` | Mantiene el placeholder visible junto al valor seleccionado |
38
38
  | `valuePosition` | `"left" \| "right"` | `"right"` | Posición del valor cuando alwaysShowPlaceholder es true |
39
39
  | `labels` | `ComboboxLabels` | - | Textos personalizables (ver tabla abajo) |
@@ -100,16 +100,16 @@ const frameworks = [
100
100
  ### Con Icono
101
101
 
102
102
  ```tsx
103
- import { CalendarIcon } from "lucide-react";
104
-
105
103
  <Combobox
106
104
  searchable
107
- icon={CalendarIcon}
105
+ icon="event"
108
106
  options={frameworks}
109
107
  labels={{ placeholder: "Select framework..." }}
110
- />;
108
+ />
111
109
  ```
112
110
 
111
+ **Nota**: El prop `icon` acepta nombres de Material Symbols (ej: "event", "search", "person"). Ver [Material Icons](https://fonts.google.com/icons) para la lista completa.
112
+
113
113
  ### Placeholder Persistente
114
114
 
115
115
  Útil para usar el placeholder como etiqueta que permanece visible.
@@ -163,7 +163,7 @@ Cuando `alwaysShowPlaceholder` es true, puedes controlar dónde aparece el valor
163
163
  <Combobox
164
164
  searchable
165
165
  alwaysShowPlaceholder
166
- icon={CalendarIcon}
166
+ icon="event"
167
167
  options={frameworks}
168
168
  value={value}
169
169
  onValueChange={setValue}
@@ -2,18 +2,18 @@
2
2
 
3
3
  ## Descripción
4
4
 
5
- Componente para mostrar **iconos Material Symbols Outlined** con configuración avanzada de tipografía variable. Ofrece control granular sobre peso, relleno, grado óptico y tamaño, utilizando fuentes locales para mejor rendimiento. Ideal para interfaces modernas con iconografía consistente y personalizable.
5
+ Componente para mostrar **iconos Material Symbols Outlined** con configuración avanzada de tipografía variable. Ofrece control granular sobre peso, relleno, grado óptico y tamaño usando **clases de texto Tailwind**, utilizando fuentes locales para mejor rendimiento. Ideal para interfaces modernas con iconografía consistente y personalizable.
6
6
 
7
7
  ## Características
8
8
 
9
9
  - ✅ Material Symbols Outlined con fuente local para mejor rendimiento
10
- - ✅ 4 tamaños predefinidos: 18px, 24px (default), 36px, 48px
10
+ - ✅ Tamaños controlados por clases Tailwind: `text-lg`, `text-2xl`, `text-4xl`, `text-5xl`
11
11
  - ✅ 7 pesos tipográficos: 100-700 (default: 200)
12
12
  - ✅ Fill modes: outlined (0) y filled (1)
13
13
  - ✅ 3 grados ópticos: -25, 0 (default), 200
14
14
  - ✅ 4 tamaños ópticos: 20, 24 (default), 40, 48
15
15
  - ✅ Configuración via CSS font-variation-settings
16
- - ✅ Tipos exportados: IconSize, IconProps para extensibilidad
16
+ - ✅ Tipos exportados: IconProps para extensibilidad
17
17
  - ✅ Extensión de ComponentProps<"span"> para máxima flexibilidad
18
18
  - ✅ Soporte completo para className y style customizados
19
19
  - ✅ Optimización automática con font-display: swap
@@ -23,7 +23,6 @@ Componente para mostrar **iconos Material Symbols Outlined** con configuración
23
23
  ```typescript
24
24
  import {
25
25
  Icon,
26
- type IconSize,
27
26
  type IconProps,
28
27
  } from "@adamosuiteservices/ui/icon";
29
28
  ```
@@ -31,15 +30,12 @@ import {
31
30
  ### Usando Types Exportados
32
31
 
33
32
  ```tsx
34
- import { type IconSize, type IconProps } from "@adamosuiteservices/ui/icon";
33
+ import { type IconProps } from "@adamosuiteservices/ui/icon";
35
34
 
36
35
  // Para crear componentes custom
37
36
  function CustomIcon(props: IconProps) {
38
37
  return <Icon {...props} className="custom-icon-styles" />;
39
38
  }
40
-
41
- // Para validar tamaños
42
- const iconSizes: IconSize[] = ["18", "24", "36", "48"];
43
39
  ```
44
40
 
45
41
  ## Uso Básico
@@ -50,10 +46,10 @@ const iconSizes: IconSize[] = ["18", "24", "36", "48"];
50
46
  <Icon symbol="home" />
51
47
  ```
52
48
 
53
- ### Con Tamaño Personalizado
49
+ ### Con Tamaño Personalizado usando Tailwind
54
50
 
55
51
  ```tsx
56
- <Icon symbol="settings" size="36" />
52
+ <Icon symbol="settings" className="adm:text-4xl" />
57
53
  ```
58
54
 
59
55
  ### Icono Relleno
@@ -77,19 +73,20 @@ El nombre del icono Material Symbol. Consulta [Google Fonts](https://fonts.googl
77
73
  <Icon symbol="close" />
78
74
  ```
79
75
 
80
- ### size
76
+ ### className
81
77
 
82
- Tamaño del icono en píxeles. Valores predefinidos para consistencia.
78
+ Usa clases de texto Tailwind para controlar el tamaño del icono. Se pueden combinar con otras clases.
83
79
 
84
80
  ```tsx
85
- // Tamaños disponibles
86
- <Icon symbol="star" size="18" /> {/* Pequeño */}
87
- <Icon symbol="star" size="24" /> {/* Default */}
88
- <Icon symbol="star" size="36" /> {/* Mediano */}
89
- <Icon symbol="star" size="48" /> {/* Grande */}
90
- ```
81
+ // Tamaños comunes usando Tailwind
82
+ <Icon symbol="star" className="adm:text-lg" /> {/* ~18px */}
83
+ <Icon symbol="star" className="adm:text-2xl" /> {/* ~24px */}
84
+ <Icon symbol="star" className="adm:text-4xl" /> {/* ~36px */}
85
+ <Icon symbol="star" className="adm:text-5xl" /> {/* ~48px */}
91
86
 
92
- **Default**: `"24"`
87
+ // Combinando tamaño con color
88
+ <Icon symbol="star" className="adm:text-2xl adm:text-yellow-500" />
89
+ ```
93
90
 
94
91
  ### fill
95
92
 
@@ -151,13 +148,13 @@ Optimización de legibilidad para diferentes tamaños de pantalla.
151
148
  ```tsx
152
149
  <div className="adm:flex adm:gap-1">
153
150
  <Button variant="ghost" size="icon">
154
- <Icon symbol="arrow_back" size="24" />
151
+ <Icon symbol="arrow_back" className="adm:text-2xl" />
155
152
  </Button>
156
153
  <Button variant="ghost" size="icon">
157
- <Icon symbol="home" size="24" />
154
+ <Icon symbol="home" className="adm:text-2xl" />
158
155
  </Button>
159
156
  <Button variant="ghost" size="icon">
160
- <Icon symbol="search" size="24" />
157
+ <Icon symbol="search" className="adm:text-2xl" />
161
158
  </Button>
162
159
  </div>
163
160
  ```
@@ -167,15 +164,15 @@ Optimización de legibilidad para diferentes tamaños de pantalla.
167
164
  ```tsx
168
165
  <div className="adm:flex adm:gap-2">
169
166
  <Button>
170
- <Icon symbol="save" size="18" />
167
+ <Icon symbol="save" className="adm:text-lg" />
171
168
  Save
172
169
  </Button>
173
170
  <Button variant="outline">
174
- <Icon symbol="edit" size="18" />
171
+ <Icon symbol="edit" className="adm:text-lg" />
175
172
  Edit
176
173
  </Button>
177
174
  <Button variant="destructive">
178
- <Icon symbol="delete" size="18" />
175
+ <Icon symbol="delete" className="adm:text-lg" />
179
176
  Delete
180
177
  </Button>
181
178
  </div>
@@ -192,7 +189,10 @@ function FavoriteButton() {
192
189
  <Icon
193
190
  symbol="favorite"
194
191
  fill={isFavorite ? 1 : 0}
195
- className={isFavorite ? "adm:text-red-500" : "adm:text-gray-400"}
192
+ className={cn(
193
+ "adm:text-lg",
194
+ isFavorite ? "adm:text-red-500" : "adm:text-gray-400"
195
+ )}
196
196
  />
197
197
  {isFavorite ? "Liked" : "Like"}
198
198
  </Button>
@@ -204,10 +204,21 @@ function FavoriteButton() {
204
204
 
205
205
  ```tsx
206
206
  <div className="adm:flex adm:items-center adm:gap-4">
207
- <Icon symbol="favorite" weight={100} /> {/* Delgado */}
208
- <Icon symbol="favorite" weight={200} /> {/* Default */}
209
- <Icon symbol="favorite" weight={500} /> {/* Medio */}
210
- <Icon symbol="favorite" weight={700} /> {/* Grueso */}
207
+ <Icon symbol="favorite" weight={100} className="adm:text-2xl" /> {/* Delgado */}
208
+ <Icon symbol="favorite" weight={200} className="adm:text-2xl" /> {/* Default */}
209
+ <Icon symbol="favorite" weight={500} className="adm:text-2xl" /> {/* Medio */}
210
+ <Icon symbol="favorite" weight={700} className="adm:text-2xl" /> {/* Grueso */}
211
+ </div>
212
+ ```
213
+
214
+ ### Diferentes Tamaños con Tailwind
215
+
216
+ ```tsx
217
+ <div className="adm:flex adm:items-center adm:gap-4">
218
+ <Icon symbol="favorite" className="adm:text-lg" /> {/* ~18px */}
219
+ <Icon symbol="favorite" className="adm:text-2xl" /> {/* ~24px */}
220
+ <Icon symbol="favorite" className="adm:text-4xl" /> {/* ~36px */}
221
+ <Icon symbol="favorite" className="adm:text-5xl" /> {/* ~48px */}
211
222
  </div>
212
223
  ```
213
224
 
@@ -235,7 +246,7 @@ const commonIcons = [
235
246
  <div className="adm:grid adm:grid-cols-5 adm:gap-4">
236
247
  {commonIcons.map((icon) => (
237
248
  <div key={icon} className="adm:text-center">
238
- <Icon symbol={icon} size="24" />
249
+ <Icon symbol={icon} className="adm:text-2xl" />
239
250
  <p className="adm:text-xs adm:mt-1">{icon}</p>
240
251
  </div>
241
252
  ))}
@@ -249,9 +260,8 @@ const commonIcons = [
249
260
  ```tsx
250
261
  <Icon
251
262
  symbol="notification"
252
- size="24"
253
263
  weight={400}
254
- className="adm:text-blue-500 adm:drop-shadow-sm"
264
+ className="adm:text-2xl adm:text-blue-500 adm:drop-shadow-sm"
255
265
  />
256
266
  ```
257
267
 
@@ -260,8 +270,7 @@ const commonIcons = [
260
270
  ```tsx
261
271
  <Icon
262
272
  symbol="refresh"
263
- size="24"
264
- className="adm:animate-spin adm:text-blue-500"
273
+ className="adm:text-2xl adm:animate-spin adm:text-blue-500"
265
274
  />
266
275
  ```
267
276
 
@@ -270,8 +279,7 @@ const commonIcons = [
270
279
  ```tsx
271
280
  <Icon
272
281
  symbol="menu"
273
- size="24"
274
- className="adm:text-gray-600 hover:adm:text-gray-900 adm:transition-colors"
282
+ className="adm:text-2xl adm:text-gray-600 hover:adm:text-gray-900 adm:transition-colors"
275
283
  />
276
284
  ```
277
285
 
@@ -283,7 +291,7 @@ const commonIcons = [
283
291
  <Card>
284
292
  <CardHeader>
285
293
  <div className="adm:flex adm:items-center adm:gap-2">
286
- <Icon symbol="folder" size="24" className="adm:text-blue-500" />
294
+ <Icon symbol="folder" className="adm:text-2xl adm:text-blue-500" />
287
295
  <CardTitle>Documents</CardTitle>
288
296
  </div>
289
297
  </CardHeader>
@@ -294,7 +302,7 @@ const commonIcons = [
294
302
 
295
303
  ```tsx
296
304
  <Button disabled>
297
- <Icon symbol="sync" className="adm:animate-spin" size="18" />
305
+ <Icon symbol="sync" className="adm:text-lg adm:animate-spin" />
298
306
  Loading...
299
307
  </Button>
300
308
  ```
@@ -323,43 +331,60 @@ const commonIcons = [
323
331
  ```tsx
324
332
  <div className="adm:flex adm:gap-1 adm:p-2 adm:border adm:rounded-md">
325
333
  <Button variant="ghost" size="icon">
326
- <Icon symbol="undo" size="20" />
334
+ <Icon symbol="undo" className="adm:text-xl" />
327
335
  </Button>
328
336
  <Button variant="ghost" size="icon">
329
- <Icon symbol="redo" size="20" />
337
+ <Icon symbol="redo" className="adm:text-xl" />
330
338
  </Button>
331
339
  <Separator orientation="vertical" className="adm:h-6" />
332
340
  <Button variant="ghost" size="icon">
333
- <Icon symbol="content_copy" size="20" />
341
+ <Icon symbol="content_copy" className="adm:text-xl" />
334
342
  </Button>
335
343
  <Button variant="ghost" size="icon">
336
- <Icon symbol="content_paste" size="20" />
344
+ <Icon symbol="content_paste" className="adm:text-xl" />
337
345
  </Button>
338
346
  </div>
339
347
  ```
340
348
 
341
349
  ## Mejores Prácticas
342
350
 
343
- ### Tamaños Consistentes
351
+ ### Tamaños Consistentes con Tailwind
344
352
 
345
353
  ```tsx
346
- {/* ✅ Correcto - Tamaños consistentes por contexto */}
354
+ {/* ✅ Correcto - Tamaños consistentes por contexto usando Tailwind */}
347
355
  <Button>
348
- <Icon symbol="save" size="18" /> {/* 18px para botones */}
356
+ <Icon symbol="save" className="adm:text-lg" /> {/* text-lg para botones con texto */}
349
357
  Save
350
358
  </Button>
351
359
 
352
360
  <Button size="icon">
353
- <Icon symbol="settings" size="24" /> {/* 24px para botones icon */}
361
+ <Icon symbol="settings" className="adm:text-2xl" /> {/* text-2xl para botones icon */}
354
362
  </Button>
355
363
 
356
364
  {/* ❌ Incorrecto - Tamaños inconsistentes */}
357
365
  <Button>
358
- <Icon symbol="save" size="24" /> {/* Muy grande para botón con texto */}
366
+ <Icon symbol="save" className="adm:text-4xl" /> {/* Muy grande para botón con texto */}
359
367
  Save
360
368
  </Button>
361
369
  ```
362
370
 
371
+ ### Clases Tailwind Recomendadas por Contexto
372
+
373
+ ```tsx
374
+ {/* ✅ Correcto - Tamaños apropiados */}
375
+ // Botones con texto
376
+ <Icon symbol="save" className="adm:text-lg" /> {/* ~18px */}
377
+
378
+ // Botones icon solamente
379
+ <Icon symbol="menu" className="adm:text-2xl" /> {/* ~24px */}
380
+
381
+ // Títulos y encabezados
382
+ <Icon symbol="folder" className="adm:text-4xl" /> {/* ~36px */}
383
+
384
+ // Hero sections o elementos grandes
385
+ <Icon symbol="star" className="adm:text-5xl" /> {/* ~48px */}
386
+ ```
387
+
363
388
  ### Peso Apropiado por Contexto
364
389
 
365
390
  ```tsx
@@ -394,27 +419,23 @@ const commonIcons = [
394
419
  ### Accesibilidad
395
420
 
396
421
  ```tsx
397
- {
398
- /* ✅ Correcto - Botones con labels */
399
- }
422
+ {/* ✅ Correcto - Botones con labels */}
400
423
  <Button variant="ghost" size="icon" aria-label="Close dialog">
401
- <Icon symbol="close" size="24" />
402
- </Button>;
424
+ <Icon symbol="close" className="adm:text-2xl" />
425
+ </Button>
403
426
 
404
- {
405
- /* ✅ Correcto - Iconos decorativos */
406
- }
427
+ {/* ✅ Correcto - Iconos decorativos */}
407
428
  <div className="adm:flex adm:items-center adm:gap-2">
408
- <Icon symbol="folder" size="20" aria-hidden="true" />
429
+ <Icon symbol="folder" className="adm:text-xl" aria-hidden="true" />
409
430
  <span>Documents</span>
410
- </div>;
431
+ </div>
411
432
  ```
412
433
 
413
434
  ### Performance
414
435
 
415
436
  ```tsx
416
437
  {/* ✅ Correcto - Reutilizar configuraciones comunes */}
417
- const iconProps = { size: "24", weight: 200 } as const;
438
+ const iconProps = { weight: 200, className: "adm:text-2xl" } as const;
418
439
 
419
440
  <Icon symbol="home" {...iconProps} />
420
441
  <Icon symbol="search" {...iconProps} />
@@ -466,11 +487,8 @@ La fuente se carga localmente desde `assets/icons/`:
466
487
  ### TypeScript Interface
467
488
 
468
489
  ```typescript
469
- export type IconSize = "18" | "24" | "36" | "48";
470
-
471
490
  export type IconProps = ComponentProps<"span"> & {
472
491
  symbol: string;
473
- size?: IconSize;
474
492
  fill?: 0 | 1;
475
493
  weight?: 100 | 200 | 300 | 400 | 500 | 600 | 700;
476
494
  grade?: -25 | 0 | 200;
@@ -478,7 +496,7 @@ export type IconProps = ComponentProps<"span"> & {
478
496
  };
479
497
  ```
480
498
 
481
- **Tipos Exportados**: Usa `IconSize` e `IconProps` para crear componentes custom o validar props.
499
+ **Tipos Exportados**: Usa `IconProps` para crear componentes custom. Los tamaños ahora se controlan via `className` con clases Tailwind.
482
500
 
483
501
  ## Recursos
484
502
 
@@ -503,20 +521,30 @@ export type IconProps = ComponentProps<"span"> & {
503
521
  Si migras desde Font Awesome o Heroicons:
504
522
 
505
523
  ```tsx
506
- {
507
- /* Font Awesome */
508
- }
509
- <i className="fas fa-heart"></i>;
524
+ {/* Font Awesome */}
525
+ <i className="fas fa-heart"></i>
510
526
 
511
- {
512
- /* Material Icons (anterior) */
513
- }
514
- <span className="material-icons">favorite</span>;
527
+ {/* Material Icons (anterior) */}
528
+ <span className="material-icons">favorite</span>
515
529
 
516
- {
517
- /* Icon Component (nuevo) ✅ */
518
- }
519
- <Icon symbol="favorite" />;
530
+ {/* Icon Component (nuevo) ✅ */}
531
+ <Icon symbol="favorite" className="adm:text-2xl" />
532
+ ```
533
+
534
+ ### Migración desde versión anterior del Icon Component
535
+
536
+ Si ya usabas el Icon component con la prop `size`:
537
+
538
+ ```tsx
539
+ {/* Versión anterior */}
540
+ <Icon symbol="home" size="24" />
541
+ <Icon symbol="star" size="18" />
542
+ <Icon symbol="settings" size="36" />
543
+
544
+ {/* Nueva versión ✅ */}
545
+ <Icon symbol="home" className="adm:text-2xl" /> {/* 24px */}
546
+ <Icon symbol="star" className="adm:text-lg" /> {/* 18px */}
547
+ <Icon symbol="settings" className="adm:text-4xl" /> {/* 36px */}
520
548
  ```
521
549
 
522
550
  ## Solución de Problemas
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adamosuiteservices/ui",
3
- "version": "1.9.15",
3
+ "version": "2.9.16",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",