@adamosuiteservices/ui 2.11.15 → 2.11.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.
- package/dist/colors.css +1 -1
- package/dist/styles.css +1 -1
- package/docs/AI-GUIDE.md +321 -321
- package/docs/components/layout/sidebar.md +399 -399
- package/docs/components/layout/toaster.md +436 -436
- package/docs/components/ui/accordion-rounded.md +584 -584
- package/docs/components/ui/accordion.md +269 -269
- package/docs/components/ui/button-group.md +984 -984
- package/docs/components/ui/button.md +1137 -1137
- package/docs/components/ui/calendar.md +1159 -1159
- package/docs/components/ui/card.md +1455 -1455
- package/docs/components/ui/checkbox.md +292 -292
- package/docs/components/ui/collapsible.md +323 -323
- package/docs/components/ui/command.md +454 -454
- package/docs/components/ui/context-menu.md +540 -540
- package/docs/components/ui/dialog.md +628 -628
- package/docs/components/ui/dropdown-menu.md +709 -709
- package/docs/components/ui/field.md +706 -706
- package/docs/components/ui/hover-card.md +446 -446
- package/docs/components/ui/input.md +362 -362
- package/docs/components/ui/kbd.md +434 -434
- package/docs/components/ui/label.md +359 -359
- package/docs/components/ui/pagination.md +650 -650
- package/docs/components/ui/popover.md +536 -536
- package/docs/components/ui/progress.md +182 -182
- package/docs/components/ui/radio-group.md +311 -311
- package/docs/components/ui/select.md +352 -352
- package/docs/components/ui/separator.md +214 -214
- package/docs/components/ui/sheet.md +142 -142
- package/docs/components/ui/skeleton.md +140 -140
- package/docs/components/ui/slider.md +341 -341
- package/docs/components/ui/spinner.md +170 -170
- package/docs/components/ui/switch.md +408 -408
- package/docs/components/ui/tabs-underline.md +106 -106
- package/docs/components/ui/tabs.md +122 -122
- package/docs/components/ui/textarea.md +243 -243
- package/docs/components/ui/toggle.md +237 -237
- package/docs/components/ui/tooltip.md +317 -317
- package/docs/components/ui/typography.md +280 -280
- package/package.json +1 -1
|
@@ -1,142 +1,142 @@
|
|
|
1
|
-
# Sheet
|
|
2
|
-
|
|
3
|
-
Panel lateral deslizable (drawer). Basado en Radix UI Dialog con 4 direcciones.
|
|
4
|
-
|
|
5
|
-
## Descripción
|
|
6
|
-
|
|
7
|
-
El componente `Sheet` muestra un panel lateral deslizante, similar a un drawer.
|
|
8
|
-
|
|
9
|
-
## Importación
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
import {
|
|
13
|
-
Sheet,
|
|
14
|
-
SheetContent,
|
|
15
|
-
SheetDescription,
|
|
16
|
-
SheetHeader,
|
|
17
|
-
SheetTitle,
|
|
18
|
-
SheetTrigger,
|
|
19
|
-
SheetFooter,
|
|
20
|
-
SheetClose,
|
|
21
|
-
} from "@adamosuiteservices/ui/sheet";
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Anatomía
|
|
25
|
-
|
|
26
|
-
```tsx
|
|
27
|
-
<Sheet>
|
|
28
|
-
<SheetTrigger>Open</SheetTrigger>
|
|
29
|
-
<SheetContent>
|
|
30
|
-
<SheetHeader>
|
|
31
|
-
<SheetTitle>Are you sure?</SheetTitle>
|
|
32
|
-
<SheetDescription>This action cannot be undone.</SheetDescription>
|
|
33
|
-
</SheetHeader>
|
|
34
|
-
</SheetContent>
|
|
35
|
-
</Sheet>
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
**Componentes**: 8 (Sheet, SheetTrigger, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, SheetClose)
|
|
39
|
-
|
|
40
|
-
## Props
|
|
41
|
-
|
|
42
|
-
### Sheet (Root)
|
|
43
|
-
|
|
44
|
-
| Prop | Tipo | Descripción |
|
|
45
|
-
| -------------- | ------------------------- | ------------------- |
|
|
46
|
-
| `open` | `boolean` | Estado controlado |
|
|
47
|
-
| `defaultOpen` | `boolean` | Estado inicial |
|
|
48
|
-
| `onOpenChange` | `(open: boolean) => void` | Callback al cambiar |
|
|
49
|
-
|
|
50
|
-
### SheetContent
|
|
51
|
-
|
|
52
|
-
| Prop | Tipo | Descripción |
|
|
53
|
-
| ----------------- | ---------------------------------------- | -------------------------------- |
|
|
54
|
-
| `side` | `"top" \| "right" \| "bottom" \| "left"` | Dirección (default: "right") |
|
|
55
|
-
| `showCloseButton` | `boolean` | Mostrar X button (default: true) |
|
|
56
|
-
|
|
57
|
-
## Patrones de Uso
|
|
58
|
-
|
|
59
|
-
### Desde Derecha (Default)
|
|
60
|
-
|
|
61
|
-
```tsx
|
|
62
|
-
<Sheet>
|
|
63
|
-
<SheetTrigger asChild>
|
|
64
|
-
<Button>Open Sheet</Button>
|
|
65
|
-
</SheetTrigger>
|
|
66
|
-
<SheetContent>
|
|
67
|
-
<SheetHeader>
|
|
68
|
-
<SheetTitle>Settings</SheetTitle>
|
|
69
|
-
<SheetDescription>Configure your preferences</SheetDescription>
|
|
70
|
-
</SheetHeader>
|
|
71
|
-
</SheetContent>
|
|
72
|
-
</Sheet>
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### Desde Izquierda
|
|
76
|
-
|
|
77
|
-
```tsx
|
|
78
|
-
<Sheet>
|
|
79
|
-
<SheetTrigger>Open Left</SheetTrigger>
|
|
80
|
-
<SheetContent side="left">
|
|
81
|
-
<SheetHeader>
|
|
82
|
-
<SheetTitle>Navigation</SheetTitle>
|
|
83
|
-
</SheetHeader>
|
|
84
|
-
</SheetContent>
|
|
85
|
-
</Sheet>
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
### Desde Arriba/Abajo
|
|
89
|
-
|
|
90
|
-
```tsx
|
|
91
|
-
<Sheet>
|
|
92
|
-
<SheetTrigger>Open Top</SheetTrigger>
|
|
93
|
-
<SheetContent side="top">
|
|
94
|
-
<SheetHeader>
|
|
95
|
-
<SheetTitle>Top Sheet</SheetTitle>
|
|
96
|
-
</SheetHeader>
|
|
97
|
-
</SheetContent>
|
|
98
|
-
</Sheet>
|
|
99
|
-
|
|
100
|
-
<Sheet>
|
|
101
|
-
<SheetTrigger>Open Bottom</SheetTrigger>
|
|
102
|
-
<SheetContent side="bottom">
|
|
103
|
-
<SheetHeader>
|
|
104
|
-
<SheetTitle>Bottom Sheet</SheetTitle>
|
|
105
|
-
</SheetHeader>
|
|
106
|
-
</SheetContent>
|
|
107
|
-
</Sheet>
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### Con Footer
|
|
111
|
-
|
|
112
|
-
```tsx
|
|
113
|
-
<Sheet>
|
|
114
|
-
<SheetTrigger>Edit Profile</SheetTrigger>
|
|
115
|
-
<SheetContent>
|
|
116
|
-
<SheetHeader>
|
|
117
|
-
<SheetTitle>Edit profile</SheetTitle>
|
|
118
|
-
<SheetDescription>Make changes to your profile here.</SheetDescription>
|
|
119
|
-
</SheetHeader>
|
|
120
|
-
{/* Form fields */}
|
|
121
|
-
<SheetFooter>
|
|
122
|
-
<SheetClose asChild>
|
|
123
|
-
<Button variant="outline">Cancel</Button>
|
|
124
|
-
</SheetClose>
|
|
125
|
-
<Button type="submit">Save changes</Button>
|
|
126
|
-
</SheetFooter>
|
|
127
|
-
</SheetContent>
|
|
128
|
-
</Sheet>
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
## Casos de Uso
|
|
132
|
-
|
|
133
|
-
**Navigation menu**: Menú móvil
|
|
134
|
-
**Filters**: Panel de filtros
|
|
135
|
-
**Details**: Vista de detalles
|
|
136
|
-
**Forms**: Formularios laterales
|
|
137
|
-
**Settings**: Panel de configuración
|
|
138
|
-
|
|
139
|
-
## Referencias
|
|
140
|
-
|
|
141
|
-
- **Radix UI Dialog**: <https://www.radix-ui.com/primitives/docs/components/dialog>
|
|
142
|
-
- **shadcn/ui Sheet**: <https://ui.shadcn.com/docs/components/sheet>
|
|
1
|
+
# Sheet
|
|
2
|
+
|
|
3
|
+
Panel lateral deslizable (drawer). Basado en Radix UI Dialog con 4 direcciones.
|
|
4
|
+
|
|
5
|
+
## Descripción
|
|
6
|
+
|
|
7
|
+
El componente `Sheet` muestra un panel lateral deslizante, similar a un drawer.
|
|
8
|
+
|
|
9
|
+
## Importación
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
import {
|
|
13
|
+
Sheet,
|
|
14
|
+
SheetContent,
|
|
15
|
+
SheetDescription,
|
|
16
|
+
SheetHeader,
|
|
17
|
+
SheetTitle,
|
|
18
|
+
SheetTrigger,
|
|
19
|
+
SheetFooter,
|
|
20
|
+
SheetClose,
|
|
21
|
+
} from "@adamosuiteservices/ui/sheet";
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Anatomía
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
<Sheet>
|
|
28
|
+
<SheetTrigger>Open</SheetTrigger>
|
|
29
|
+
<SheetContent>
|
|
30
|
+
<SheetHeader>
|
|
31
|
+
<SheetTitle>Are you sure?</SheetTitle>
|
|
32
|
+
<SheetDescription>This action cannot be undone.</SheetDescription>
|
|
33
|
+
</SheetHeader>
|
|
34
|
+
</SheetContent>
|
|
35
|
+
</Sheet>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Componentes**: 8 (Sheet, SheetTrigger, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, SheetClose)
|
|
39
|
+
|
|
40
|
+
## Props
|
|
41
|
+
|
|
42
|
+
### Sheet (Root)
|
|
43
|
+
|
|
44
|
+
| Prop | Tipo | Descripción |
|
|
45
|
+
| -------------- | ------------------------- | ------------------- |
|
|
46
|
+
| `open` | `boolean` | Estado controlado |
|
|
47
|
+
| `defaultOpen` | `boolean` | Estado inicial |
|
|
48
|
+
| `onOpenChange` | `(open: boolean) => void` | Callback al cambiar |
|
|
49
|
+
|
|
50
|
+
### SheetContent
|
|
51
|
+
|
|
52
|
+
| Prop | Tipo | Descripción |
|
|
53
|
+
| ----------------- | ---------------------------------------- | -------------------------------- |
|
|
54
|
+
| `side` | `"top" \| "right" \| "bottom" \| "left"` | Dirección (default: "right") |
|
|
55
|
+
| `showCloseButton` | `boolean` | Mostrar X button (default: true) |
|
|
56
|
+
|
|
57
|
+
## Patrones de Uso
|
|
58
|
+
|
|
59
|
+
### Desde Derecha (Default)
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
<Sheet>
|
|
63
|
+
<SheetTrigger asChild>
|
|
64
|
+
<Button>Open Sheet</Button>
|
|
65
|
+
</SheetTrigger>
|
|
66
|
+
<SheetContent>
|
|
67
|
+
<SheetHeader>
|
|
68
|
+
<SheetTitle>Settings</SheetTitle>
|
|
69
|
+
<SheetDescription>Configure your preferences</SheetDescription>
|
|
70
|
+
</SheetHeader>
|
|
71
|
+
</SheetContent>
|
|
72
|
+
</Sheet>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Desde Izquierda
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
<Sheet>
|
|
79
|
+
<SheetTrigger>Open Left</SheetTrigger>
|
|
80
|
+
<SheetContent side="left">
|
|
81
|
+
<SheetHeader>
|
|
82
|
+
<SheetTitle>Navigation</SheetTitle>
|
|
83
|
+
</SheetHeader>
|
|
84
|
+
</SheetContent>
|
|
85
|
+
</Sheet>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Desde Arriba/Abajo
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
<Sheet>
|
|
92
|
+
<SheetTrigger>Open Top</SheetTrigger>
|
|
93
|
+
<SheetContent side="top">
|
|
94
|
+
<SheetHeader>
|
|
95
|
+
<SheetTitle>Top Sheet</SheetTitle>
|
|
96
|
+
</SheetHeader>
|
|
97
|
+
</SheetContent>
|
|
98
|
+
</Sheet>
|
|
99
|
+
|
|
100
|
+
<Sheet>
|
|
101
|
+
<SheetTrigger>Open Bottom</SheetTrigger>
|
|
102
|
+
<SheetContent side="bottom">
|
|
103
|
+
<SheetHeader>
|
|
104
|
+
<SheetTitle>Bottom Sheet</SheetTitle>
|
|
105
|
+
</SheetHeader>
|
|
106
|
+
</SheetContent>
|
|
107
|
+
</Sheet>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Con Footer
|
|
111
|
+
|
|
112
|
+
```tsx
|
|
113
|
+
<Sheet>
|
|
114
|
+
<SheetTrigger>Edit Profile</SheetTrigger>
|
|
115
|
+
<SheetContent>
|
|
116
|
+
<SheetHeader>
|
|
117
|
+
<SheetTitle>Edit profile</SheetTitle>
|
|
118
|
+
<SheetDescription>Make changes to your profile here.</SheetDescription>
|
|
119
|
+
</SheetHeader>
|
|
120
|
+
{/* Form fields */}
|
|
121
|
+
<SheetFooter>
|
|
122
|
+
<SheetClose asChild>
|
|
123
|
+
<Button variant="outline">Cancel</Button>
|
|
124
|
+
</SheetClose>
|
|
125
|
+
<Button type="submit">Save changes</Button>
|
|
126
|
+
</SheetFooter>
|
|
127
|
+
</SheetContent>
|
|
128
|
+
</Sheet>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Casos de Uso
|
|
132
|
+
|
|
133
|
+
**Navigation menu**: Menú móvil
|
|
134
|
+
**Filters**: Panel de filtros
|
|
135
|
+
**Details**: Vista de detalles
|
|
136
|
+
**Forms**: Formularios laterales
|
|
137
|
+
**Settings**: Panel de configuración
|
|
138
|
+
|
|
139
|
+
## Referencias
|
|
140
|
+
|
|
141
|
+
- **Radix UI Dialog**: <https://www.radix-ui.com/primitives/docs/components/dialog>
|
|
142
|
+
- **shadcn/ui Sheet**: <https://ui.shadcn.com/docs/components/sheet>
|
|
@@ -1,140 +1,140 @@
|
|
|
1
|
-
# Skeleton
|
|
2
|
-
|
|
3
|
-
Placeholder animado para contenido en carga. Simula la estructura del contenido final con bloques pulsantes.
|
|
4
|
-
|
|
5
|
-
## Descripción
|
|
6
|
-
|
|
7
|
-
El componente `Skeleton` muestra placeholders de carga para contenido que está siendo cargado.
|
|
8
|
-
|
|
9
|
-
## Importación
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
import { Skeleton } from "@adamosuiteservices/ui/skeleton";
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Anatomía
|
|
16
|
-
|
|
17
|
-
```tsx
|
|
18
|
-
<Skeleton className="w-full h-12" />
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
**Componentes**: 1 (Skeleton)
|
|
22
|
-
|
|
23
|
-
## Props
|
|
24
|
-
|
|
25
|
-
| Prop | Tipo | Descripción |
|
|
26
|
-
| ----------- | -------- | ------------------------------ |
|
|
27
|
-
| `className` | `string` | Clases CSS para tamaño y forma |
|
|
28
|
-
|
|
29
|
-
**Nota**: Acepta todas las props de `<div>`
|
|
30
|
-
|
|
31
|
-
## Patrones de Uso
|
|
32
|
-
|
|
33
|
-
### Básico
|
|
34
|
-
|
|
35
|
-
```tsx
|
|
36
|
-
<Skeleton className="h-4 w-[250px]" />
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### Avatar + Text
|
|
40
|
-
|
|
41
|
-
```tsx
|
|
42
|
-
<div className="flex items-center space-x-4">
|
|
43
|
-
<Skeleton className="h-12 w-12 rounded-full" />
|
|
44
|
-
<div className="space-y-2">
|
|
45
|
-
<Skeleton className="h-4 w-[250px]" />
|
|
46
|
-
<Skeleton className="h-4 w-[200px]" />
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### Card
|
|
52
|
-
|
|
53
|
-
```tsx
|
|
54
|
-
<div className="flex flex-col space-y-3">
|
|
55
|
-
<Skeleton className="h-[125px] w-[250px] rounded-xl" />
|
|
56
|
-
<div className="space-y-2">
|
|
57
|
-
<Skeleton className="h-4 w-[250px]" />
|
|
58
|
-
<Skeleton className="h-4 w-[200px]" />
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
### Text Lines
|
|
64
|
-
|
|
65
|
-
```tsx
|
|
66
|
-
<div className="space-y-2">
|
|
67
|
-
<Skeleton className="h-4 w-full" />
|
|
68
|
-
<Skeleton className="h-4 w-[90%]" />
|
|
69
|
-
<Skeleton className="h-4 w-[80%]" />
|
|
70
|
-
</div>
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### Form
|
|
74
|
-
|
|
75
|
-
```tsx
|
|
76
|
-
<div className="space-y-4 max-w-md">
|
|
77
|
-
<div className="space-y-2">
|
|
78
|
-
<Skeleton className="h-4 w-16" />
|
|
79
|
-
<Skeleton className="h-10 w-full rounded-md" />
|
|
80
|
-
</div>
|
|
81
|
-
<div className="space-y-2">
|
|
82
|
-
<Skeleton className="h-4 w-20" />
|
|
83
|
-
<Skeleton className="h-10 w-full rounded-md" />
|
|
84
|
-
</div>
|
|
85
|
-
<Skeleton className="h-10 w-24 rounded-md" />
|
|
86
|
-
</div>
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### List Items
|
|
90
|
-
|
|
91
|
-
```tsx
|
|
92
|
-
<div className="space-y-4">
|
|
93
|
-
{Array.from({ length: 4 }).map((_, i) => (
|
|
94
|
-
<div key={i} className="flex items-center space-x-4">
|
|
95
|
-
<Skeleton className="h-10 w-10 rounded-full" />
|
|
96
|
-
<div className="space-y-2 flex-1">
|
|
97
|
-
<Skeleton className="h-4 w-[200px]" />
|
|
98
|
-
<Skeleton className="h-3 w-[150px]" />
|
|
99
|
-
</div>
|
|
100
|
-
<Skeleton className="h-8 w-16 rounded-md" />
|
|
101
|
-
</div>
|
|
102
|
-
))}
|
|
103
|
-
</div>
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
## Casos de Uso
|
|
107
|
-
|
|
108
|
-
**Loading states**: Placeholder mientras carga contenido
|
|
109
|
-
**Lazy loading**: Imágenes/contenido que carga progresivamente
|
|
110
|
-
**Optimistic UI**: Simular contenido antes de respuesta
|
|
111
|
-
**Infinite scroll**: Items mientras cargan más
|
|
112
|
-
|
|
113
|
-
## Estilos Base
|
|
114
|
-
|
|
115
|
-
- **Background**: `bg-accent`
|
|
116
|
-
- **Animation**: `animate-pulse`
|
|
117
|
-
- **Border radius**: `rounded-md` default
|
|
118
|
-
|
|
119
|
-
## Accesibilidad
|
|
120
|
-
|
|
121
|
-
- ✅ **ARIA**: Usa `aria-busy="true"` en contenedor padre
|
|
122
|
-
- ✅ **Screen readers**: Anuncia estado de carga en contenedor
|
|
123
|
-
- ⚠️ **Replace**: Reemplaza skeleton con contenido real al cargar
|
|
124
|
-
|
|
125
|
-
## Notas de Implementación
|
|
126
|
-
|
|
127
|
-
- **HTML nativo**: Simple `<div>` con estilos
|
|
128
|
-
- **Pulse animation**: Tailwind `animate-pulse`
|
|
129
|
-
- **Customizable**: Totalmente personalizable con className
|
|
130
|
-
- **No state**: Stateless, solo visual
|
|
131
|
-
|
|
132
|
-
## Troubleshooting
|
|
133
|
-
|
|
134
|
-
**No pulsa**: Verifica que `animate-pulse` esté aplicado
|
|
135
|
-
**Tamaño inconsistente**: Usa height/width específicos con className
|
|
136
|
-
**Forma incorrecta**: Ajusta `rounded-*` para avatars, cards, etc.
|
|
137
|
-
|
|
138
|
-
## Referencias
|
|
139
|
-
|
|
140
|
-
- **shadcn/ui Skeleton**: <https://ui.shadcn.com/docs/components/skeleton>
|
|
1
|
+
# Skeleton
|
|
2
|
+
|
|
3
|
+
Placeholder animado para contenido en carga. Simula la estructura del contenido final con bloques pulsantes.
|
|
4
|
+
|
|
5
|
+
## Descripción
|
|
6
|
+
|
|
7
|
+
El componente `Skeleton` muestra placeholders de carga para contenido que está siendo cargado.
|
|
8
|
+
|
|
9
|
+
## Importación
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
import { Skeleton } from "@adamosuiteservices/ui/skeleton";
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Anatomía
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
<Skeleton className="w-full h-12" />
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**Componentes**: 1 (Skeleton)
|
|
22
|
+
|
|
23
|
+
## Props
|
|
24
|
+
|
|
25
|
+
| Prop | Tipo | Descripción |
|
|
26
|
+
| ----------- | -------- | ------------------------------ |
|
|
27
|
+
| `className` | `string` | Clases CSS para tamaño y forma |
|
|
28
|
+
|
|
29
|
+
**Nota**: Acepta todas las props de `<div>`
|
|
30
|
+
|
|
31
|
+
## Patrones de Uso
|
|
32
|
+
|
|
33
|
+
### Básico
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
<Skeleton className="h-4 w-[250px]" />
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Avatar + Text
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
<div className="flex items-center space-x-4">
|
|
43
|
+
<Skeleton className="h-12 w-12 rounded-full" />
|
|
44
|
+
<div className="space-y-2">
|
|
45
|
+
<Skeleton className="h-4 w-[250px]" />
|
|
46
|
+
<Skeleton className="h-4 w-[200px]" />
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Card
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
<div className="flex flex-col space-y-3">
|
|
55
|
+
<Skeleton className="h-[125px] w-[250px] rounded-xl" />
|
|
56
|
+
<div className="space-y-2">
|
|
57
|
+
<Skeleton className="h-4 w-[250px]" />
|
|
58
|
+
<Skeleton className="h-4 w-[200px]" />
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Text Lines
|
|
64
|
+
|
|
65
|
+
```tsx
|
|
66
|
+
<div className="space-y-2">
|
|
67
|
+
<Skeleton className="h-4 w-full" />
|
|
68
|
+
<Skeleton className="h-4 w-[90%]" />
|
|
69
|
+
<Skeleton className="h-4 w-[80%]" />
|
|
70
|
+
</div>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Form
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
<div className="space-y-4 max-w-md">
|
|
77
|
+
<div className="space-y-2">
|
|
78
|
+
<Skeleton className="h-4 w-16" />
|
|
79
|
+
<Skeleton className="h-10 w-full rounded-md" />
|
|
80
|
+
</div>
|
|
81
|
+
<div className="space-y-2">
|
|
82
|
+
<Skeleton className="h-4 w-20" />
|
|
83
|
+
<Skeleton className="h-10 w-full rounded-md" />
|
|
84
|
+
</div>
|
|
85
|
+
<Skeleton className="h-10 w-24 rounded-md" />
|
|
86
|
+
</div>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### List Items
|
|
90
|
+
|
|
91
|
+
```tsx
|
|
92
|
+
<div className="space-y-4">
|
|
93
|
+
{Array.from({ length: 4 }).map((_, i) => (
|
|
94
|
+
<div key={i} className="flex items-center space-x-4">
|
|
95
|
+
<Skeleton className="h-10 w-10 rounded-full" />
|
|
96
|
+
<div className="space-y-2 flex-1">
|
|
97
|
+
<Skeleton className="h-4 w-[200px]" />
|
|
98
|
+
<Skeleton className="h-3 w-[150px]" />
|
|
99
|
+
</div>
|
|
100
|
+
<Skeleton className="h-8 w-16 rounded-md" />
|
|
101
|
+
</div>
|
|
102
|
+
))}
|
|
103
|
+
</div>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Casos de Uso
|
|
107
|
+
|
|
108
|
+
**Loading states**: Placeholder mientras carga contenido
|
|
109
|
+
**Lazy loading**: Imágenes/contenido que carga progresivamente
|
|
110
|
+
**Optimistic UI**: Simular contenido antes de respuesta
|
|
111
|
+
**Infinite scroll**: Items mientras cargan más
|
|
112
|
+
|
|
113
|
+
## Estilos Base
|
|
114
|
+
|
|
115
|
+
- **Background**: `bg-accent`
|
|
116
|
+
- **Animation**: `animate-pulse`
|
|
117
|
+
- **Border radius**: `rounded-md` default
|
|
118
|
+
|
|
119
|
+
## Accesibilidad
|
|
120
|
+
|
|
121
|
+
- ✅ **ARIA**: Usa `aria-busy="true"` en contenedor padre
|
|
122
|
+
- ✅ **Screen readers**: Anuncia estado de carga en contenedor
|
|
123
|
+
- ⚠️ **Replace**: Reemplaza skeleton con contenido real al cargar
|
|
124
|
+
|
|
125
|
+
## Notas de Implementación
|
|
126
|
+
|
|
127
|
+
- **HTML nativo**: Simple `<div>` con estilos
|
|
128
|
+
- **Pulse animation**: Tailwind `animate-pulse`
|
|
129
|
+
- **Customizable**: Totalmente personalizable con className
|
|
130
|
+
- **No state**: Stateless, solo visual
|
|
131
|
+
|
|
132
|
+
## Troubleshooting
|
|
133
|
+
|
|
134
|
+
**No pulsa**: Verifica que `animate-pulse` esté aplicado
|
|
135
|
+
**Tamaño inconsistente**: Usa height/width específicos con className
|
|
136
|
+
**Forma incorrecta**: Ajusta `rounded-*` para avatars, cards, etc.
|
|
137
|
+
|
|
138
|
+
## Referencias
|
|
139
|
+
|
|
140
|
+
- **shadcn/ui Skeleton**: <https://ui.shadcn.com/docs/components/skeleton>
|