@adamosuiteservices/ui 1.9.14 → 2.9.15

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}
@@ -8,11 +8,12 @@ Componente para mostrar **iconos Material Symbols Outlined** con configuración
8
8
 
9
9
  - ✅ Material Symbols Outlined con fuente local para mejor rendimiento
10
10
  - ✅ 4 tamaños predefinidos: 18px, 24px (default), 36px, 48px
11
- - ✅ 7 pesos tipográficos: 100-700 (default: 300)
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
17
  - ✅ Extensión de ComponentProps<"span"> para máxima flexibilidad
17
18
  - ✅ Soporte completo para className y style customizados
18
19
  - ✅ Optimización automática con font-display: swap
@@ -20,7 +21,25 @@ Componente para mostrar **iconos Material Symbols Outlined** con configuración
20
21
  ## Importación
21
22
 
22
23
  ```typescript
23
- import { Icon } from "@adamosuiteservices/ui/icon";
24
+ import {
25
+ Icon,
26
+ type IconSize,
27
+ type IconProps,
28
+ } from "@adamosuiteservices/ui/icon";
29
+ ```
30
+
31
+ ### Usando Types Exportados
32
+
33
+ ```tsx
34
+ import { type IconSize, type IconProps } from "@adamosuiteservices/ui/icon";
35
+
36
+ // Para crear componentes custom
37
+ function CustomIcon(props: IconProps) {
38
+ return <Icon {...props} className="custom-icon-styles" />;
39
+ }
40
+
41
+ // Para validar tamaños
42
+ const iconSizes: IconSize[] = ["18", "24", "36", "48"];
24
43
  ```
25
44
 
26
45
  ## Uso Básico
@@ -90,13 +109,13 @@ Grosor de las líneas del icono. Más bajo = más delgado, más alto = más grue
90
109
 
91
110
  ```tsx
92
111
  <Icon symbol="favorite" weight={100} /> {/* Muy delgado */}
93
- <Icon symbol="favorite" weight={300} /> {/* Default - Moderno */}
112
+ <Icon symbol="favorite" weight={200} /> {/* Default - Ligero */}
94
113
  <Icon symbol="favorite" weight={400} /> {/* Regular */}
95
114
  <Icon symbol="favorite" weight={700} /> {/* Grueso */}
96
115
  ```
97
116
 
98
117
  **Values**: `100` | `200` | `300` | `400` | `500` | `600` | `700`
99
- **Default**: `300` (más moderno y ligero que el estándar 400)
118
+ **Default**: `200` (ligero y moderno)
100
119
 
101
120
  ### grade
102
121
 
@@ -186,7 +205,7 @@ function FavoriteButton() {
186
205
  ```tsx
187
206
  <div className="adm:flex adm:items-center adm:gap-4">
188
207
  <Icon symbol="favorite" weight={100} /> {/* Delgado */}
189
- <Icon symbol="favorite" weight={300} /> {/* Default */}
208
+ <Icon symbol="favorite" weight={200} /> {/* Default */}
190
209
  <Icon symbol="favorite" weight={500} /> {/* Medio */}
191
210
  <Icon symbol="favorite" weight={700} /> {/* Grueso */}
192
211
  </div>
@@ -347,7 +366,7 @@ const commonIcons = [
347
366
  {
348
367
  /* ✅ Correcto - Peso ligero para interfaces modernas */
349
368
  }
350
- <Icon symbol="menu" weight={300} />;
369
+ <Icon symbol="menu" weight={200} />;
351
370
 
352
371
  {
353
372
  /* ✅ Correcto - Peso mayor para énfasis */
@@ -395,13 +414,27 @@ const commonIcons = [
395
414
 
396
415
  ```tsx
397
416
  {/* ✅ Correcto - Reutilizar configuraciones comunes */}
398
- const iconProps = { size: "24", weight: 300 } as const;
417
+ const iconProps = { size: "24", weight: 200 } as const;
399
418
 
400
419
  <Icon symbol="home" {...iconProps} />
401
420
  <Icon symbol="search" {...iconProps} />
402
421
  <Icon symbol="settings" {...iconProps} />
403
422
  ```
404
423
 
424
+ ### Consistencia CSS y Componente
425
+
426
+ Ahora tanto el CSS como el componente usan el mismo peso por defecto:
427
+
428
+ ```tsx
429
+ {/* ✅ Ambos usan peso 200 */}
430
+ <span className="material-symbols-outlined">home</span>
431
+ <Icon symbol="home" />
432
+
433
+ {/* ✅ Ambos se ven idénticos */}
434
+ <Icon symbol="star" weight={200} />
435
+ <Icon symbol="star" /> {/* Sin especificar peso = 200 */}
436
+ ```
437
+
405
438
  ## Configuración Técnica
406
439
 
407
440
  ### Font Face Declaration
@@ -423,25 +456,30 @@ La fuente se carga localmente desde `assets/icons/`:
423
456
 
424
457
  ```css
425
458
  .material-symbols-outlined {
426
- font-family: "Material Symbols Outlined";
427
- font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24;
459
+ font-variation-settings: "FILL" 0, "wght" 200, "GRAD" 0, "opsz" 24;
428
460
  /* ... otros estilos de optimización */
429
461
  }
430
462
  ```
431
463
 
464
+ **Nota**: Tanto el CSS como el componente React usan 200 como peso por defecto.
465
+
432
466
  ### TypeScript Interface
433
467
 
434
468
  ```typescript
435
- interface IconProps extends ComponentProps<"span"> {
469
+ export type IconSize = "18" | "24" | "36" | "48";
470
+
471
+ export type IconProps = ComponentProps<"span"> & {
436
472
  symbol: string;
437
- size?: "18" | "24" | "36" | "48";
473
+ size?: IconSize;
438
474
  fill?: 0 | 1;
439
475
  weight?: 100 | 200 | 300 | 400 | 500 | 600 | 700;
440
476
  grade?: -25 | 0 | 200;
441
477
  opticalSize?: 20 | 24 | 40 | 48;
442
- }
478
+ };
443
479
  ```
444
480
 
481
+ **Tipos Exportados**: Usa `IconSize` e `IconProps` para crear componentes custom o validar props.
482
+
445
483
  ## Recursos
446
484
 
447
485
  ### Material Symbols
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adamosuiteservices/ui",
3
- "version": "1.9.14",
3
+ "version": "2.9.15",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",