@adamosuiteservices/ui 1.8.13 → 1.9.14

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.
Files changed (144) hide show
  1. package/dist/components/ui/icon/icon.d.ts +11 -0
  2. package/dist/components/ui/icon/icon.stories.d.ts +55 -0
  3. package/dist/components/ui/icon/index.d.ts +1 -0
  4. package/dist/components/ui/input-group/input-group.d.ts +1 -1
  5. package/dist/custom-layered-styles.css +1 -1
  6. package/dist/icon.cjs +6 -0
  7. package/dist/icon.js +36 -0
  8. package/dist/icons.css +1 -0
  9. package/dist/styles.css +1 -1
  10. package/docs/AI-GUIDE.md +321 -321
  11. package/docs/components/layout/sidebar.md +404 -404
  12. package/docs/components/layout/toaster.md +436 -436
  13. package/docs/components/ui/accordion-rounded.md +583 -583
  14. package/docs/components/ui/accordion.md +267 -267
  15. package/docs/components/ui/alert.md +671 -671
  16. package/docs/components/ui/avatar.md +588 -588
  17. package/docs/components/ui/badge.md +1024 -1024
  18. package/docs/components/ui/button-group.md +1002 -1002
  19. package/docs/components/ui/button.md +1078 -1078
  20. package/docs/components/ui/calendar.md +1159 -1159
  21. package/docs/components/ui/card.md +1265 -1265
  22. package/docs/components/ui/checkbox.md +292 -292
  23. package/docs/components/ui/collapsible.md +320 -320
  24. package/docs/components/ui/command.md +454 -454
  25. package/docs/components/ui/context-menu.md +540 -540
  26. package/docs/components/ui/dialog.md +628 -628
  27. package/docs/components/ui/dropdown-menu.md +731 -731
  28. package/docs/components/ui/field.md +706 -706
  29. package/docs/components/ui/hover-card.md +446 -446
  30. package/docs/components/ui/icon.md +502 -0
  31. package/docs/components/ui/input-group.md +509 -509
  32. package/docs/components/ui/input.md +362 -362
  33. package/docs/components/ui/kbd.md +434 -434
  34. package/docs/components/ui/label.md +359 -359
  35. package/docs/components/ui/pagination.md +650 -650
  36. package/docs/components/ui/popover.md +536 -536
  37. package/docs/components/ui/progress.md +182 -182
  38. package/docs/components/ui/radio-group.md +311 -311
  39. package/docs/components/ui/select.md +352 -352
  40. package/docs/components/ui/separator.md +214 -214
  41. package/docs/components/ui/sheet.md +142 -142
  42. package/docs/components/ui/skeleton.md +140 -140
  43. package/docs/components/ui/slider.md +341 -341
  44. package/docs/components/ui/spinner.md +170 -170
  45. package/docs/components/ui/switch.md +402 -402
  46. package/docs/components/ui/table.md +183 -183
  47. package/docs/components/ui/tabs-underline.md +106 -106
  48. package/docs/components/ui/tabs.md +122 -122
  49. package/docs/components/ui/textarea.md +243 -243
  50. package/docs/components/ui/toggle.md +243 -243
  51. package/docs/components/ui/tooltip.md +320 -320
  52. package/docs/components/ui/typography.md +191 -191
  53. package/package.json +6 -5
  54. package/dist/components/icons/account-balance-icon.d.ts +0 -3
  55. package/dist/components/icons/account-icon.d.ts +0 -3
  56. package/dist/components/icons/add-circle-icon.d.ts +0 -3
  57. package/dist/components/icons/alarm-icon.d.ts +0 -3
  58. package/dist/components/icons/archive-icon.d.ts +0 -3
  59. package/dist/components/icons/arrow-back-icon.d.ts +0 -3
  60. package/dist/components/icons/arrow-circle-up-icon.d.ts +0 -3
  61. package/dist/components/icons/arrow-forward-icon.d.ts +0 -3
  62. package/dist/components/icons/arrow-outward-icon.d.ts +0 -3
  63. package/dist/components/icons/article-icon.d.ts +0 -3
  64. package/dist/components/icons/attach-file-icon.d.ts +0 -3
  65. package/dist/components/icons/autorenew-icon.d.ts +0 -3
  66. package/dist/components/icons/bookmark-icon.d.ts +0 -3
  67. package/dist/components/icons/calculate-icon.d.ts +0 -3
  68. package/dist/components/icons/calendar-today-icon.d.ts +0 -3
  69. package/dist/components/icons/call-split-icon.d.ts +0 -3
  70. package/dist/components/icons/cancel-filled-icon.d.ts +0 -3
  71. package/dist/components/icons/cancel-icon.d.ts +0 -3
  72. package/dist/components/icons/check-circle-icon.d.ts +0 -3
  73. package/dist/components/icons/check-icon.d.ts +0 -3
  74. package/dist/components/icons/chevron-back-icon.d.ts +0 -3
  75. package/dist/components/icons/chevron-down-icon.d.ts +0 -3
  76. package/dist/components/icons/chevron-forward-icon.d.ts +0 -3
  77. package/dist/components/icons/chevron-up-icon.d.ts +0 -3
  78. package/dist/components/icons/clarify-icon.d.ts +0 -3
  79. package/dist/components/icons/clock-icon.d.ts +0 -3
  80. package/dist/components/icons/close-icon.d.ts +0 -3
  81. package/dist/components/icons/confirmation-number-icon.d.ts +0 -3
  82. package/dist/components/icons/contacts-icon.d.ts +0 -3
  83. package/dist/components/icons/contract-delete-icon.d.ts +0 -3
  84. package/dist/components/icons/copy-icon.d.ts +0 -3
  85. package/dist/components/icons/do-not-touch-icon.d.ts +0 -3
  86. package/dist/components/icons/download-icon.d.ts +0 -3
  87. package/dist/components/icons/dragger-icon.d.ts +0 -3
  88. package/dist/components/icons/edit-icon.d.ts +0 -3
  89. package/dist/components/icons/edit-square-icon.d.ts +0 -3
  90. package/dist/components/icons/exclamation-icon.d.ts +0 -3
  91. package/dist/components/icons/expand-circle-right-icon.d.ts +0 -3
  92. package/dist/components/icons/feature-search-icon.d.ts +0 -3
  93. package/dist/components/icons/filter-icon.d.ts +0 -3
  94. package/dist/components/icons/folder-icon.d.ts +0 -3
  95. package/dist/components/icons/folder-open-icon.d.ts +0 -3
  96. package/dist/components/icons/format-list-bulleted-icon.d.ts +0 -3
  97. package/dist/components/icons/hamburger-menu-icon.d.ts +0 -3
  98. package/dist/components/icons/help-icon.d.ts +0 -3
  99. package/dist/components/icons/hide-pass-icon.d.ts +0 -3
  100. package/dist/components/icons/home-icon.d.ts +0 -3
  101. package/dist/components/icons/id-card-icon.d.ts +0 -3
  102. package/dist/components/icons/index.d.ts +0 -88
  103. package/dist/components/icons/info-icon.d.ts +0 -3
  104. package/dist/components/icons/kid-star-icon.d.ts +0 -3
  105. package/dist/components/icons/language-icon.d.ts +0 -3
  106. package/dist/components/icons/last-page-icon.d.ts +0 -3
  107. package/dist/components/icons/layers-icon.d.ts +0 -3
  108. package/dist/components/icons/location-icon.d.ts +0 -3
  109. package/dist/components/icons/mail-icon.d.ts +0 -3
  110. package/dist/components/icons/manage-search-icon.d.ts +0 -3
  111. package/dist/components/icons/menu-icon.d.ts +0 -3
  112. package/dist/components/icons/message-icon.d.ts +0 -3
  113. package/dist/components/icons/metrics-icon.d.ts +0 -3
  114. package/dist/components/icons/mic-icon.d.ts +0 -3
  115. package/dist/components/icons/minus-icon.d.ts +0 -3
  116. package/dist/components/icons/mode-comment-icon.d.ts +0 -3
  117. package/dist/components/icons/money-icon.d.ts +0 -3
  118. package/dist/components/icons/monitoring-icon.d.ts +0 -3
  119. package/dist/components/icons/more-icon.d.ts +0 -3
  120. package/dist/components/icons/notifications-icon.d.ts +0 -3
  121. package/dist/components/icons/open-in-new-icon.d.ts +0 -3
  122. package/dist/components/icons/palette-icon.d.ts +0 -3
  123. package/dist/components/icons/password-icon.d.ts +0 -3
  124. package/dist/components/icons/pending-icon.d.ts +0 -3
  125. package/dist/components/icons/person-add-icon.d.ts +0 -3
  126. package/dist/components/icons/person-search-icon.d.ts +0 -3
  127. package/dist/components/icons/photo-icon.d.ts +0 -3
  128. package/dist/components/icons/plus-icon.d.ts +0 -3
  129. package/dist/components/icons/policy-icon.d.ts +0 -3
  130. package/dist/components/icons/publish-icon.d.ts +0 -3
  131. package/dist/components/icons/ready-icon.d.ts +0 -3
  132. package/dist/components/icons/receipt-icon.d.ts +0 -3
  133. package/dist/components/icons/receive-icon.d.ts +0 -3
  134. package/dist/components/icons/refresh-icon.d.ts +0 -3
  135. package/dist/components/icons/search-icon.d.ts +0 -3
  136. package/dist/components/icons/see-icon.d.ts +0 -3
  137. package/dist/components/icons/send-icon.d.ts +0 -3
  138. package/dist/components/icons/settings-icon.d.ts +0 -3
  139. package/dist/components/icons/shield-icon.d.ts +0 -3
  140. package/dist/components/icons/swap-horiz-icon.d.ts +0 -3
  141. package/dist/components/icons/tag-icon.d.ts +0 -3
  142. package/dist/components/icons/trash-icon.d.ts +0 -3
  143. package/dist/icons.cjs +0 -1
  144. package/dist/icons.js +0 -1507
@@ -1,359 +1,359 @@
1
- # Label
2
-
3
- Etiqueta accesible asociada con controles de formulario. Basado en Radix UI Label para accesibilidad mejorada.
4
-
5
- ## Descripción
6
-
7
- El componente `Label` renderiza una etiqueta accesible asociada con controles de formulario.
8
-
9
- ## Importación
10
-
11
- ```typescript
12
- import { Label } from "@adamosuiteservices/ui/label";
13
- ```
14
-
15
- ## Anatomía
16
-
17
- ```tsx
18
- <Label htmlFor="email">Email</Label>
19
- <Input id="email" type="email" />
20
- ```
21
-
22
- **Componentes**: 1 (Label)
23
-
24
- ## Props
25
-
26
- | Prop | Tipo | Descripción |
27
- | ----------- | -------- | ------------------------------------------------- |
28
- | `htmlFor` | `string` | ID del control asociado (conecta label con input) |
29
- | `className` | `string` | Clases CSS adicionales |
30
- | ...props | - | Todas las props de Radix UI Label |
31
-
32
- ## Patrones de Uso
33
-
34
- ### Básico con Input
35
-
36
- ```tsx
37
- import { Input } from "@adamosuiteservices/ui/input";
38
-
39
- <div className="space-y-2">
40
- <Label htmlFor="email">Email</Label>
41
- <Input id="email" type="email" placeholder="Enter your email" />
42
- </div>;
43
- ```
44
-
45
- ### Con Checkbox
46
-
47
- ```tsx
48
- import { Checkbox } from "@adamosuiteservices/ui/checkbox";
49
-
50
- <div className="flex items-center gap-2">
51
- <Checkbox id="terms" />
52
- <Label htmlFor="terms">Accept terms and conditions</Label>
53
- </div>
54
-
55
- <div className="flex items-center gap-2">
56
-
57
- <Checkbox id="newsletter" />
58
- <Label htmlFor="newsletter">Subscribe to our newsletter</Label>
59
- </div>
60
- ```
61
-
62
- ### Con Radio Group
63
-
64
- ```tsx
65
- import { RadioGroup, RadioGroupItem } from "@adamosuiteservices/ui/radio-group";
66
-
67
- <div className="space-y-4">
68
- <Label>Choose your preferred theme</Label>
69
- <RadioGroup defaultValue="light" className="space-y-2">
70
- <div className="flex items-center gap-2">
71
- <RadioGroupItem value="light" id="light" />
72
- <Label htmlFor="light">Light</Label>
73
- </div>
74
- <div className="flex items-center gap-2">
75
- <RadioGroupItem value="dark" id="dark" />
76
- <Label htmlFor="dark">Dark</Label>
77
- </div>
78
- <div className="flex items-center gap-2">
79
- <RadioGroupItem value="system" id="system" />
80
- <Label htmlFor="system">System</Label>
81
- </div>
82
- </RadioGroup>
83
- </div>;
84
- ```
85
-
86
- ### Con Switch
87
-
88
- ```tsx
89
- import { Switch } from "@adamosuiteservices/ui/switch";
90
-
91
- <div className="flex items-center gap-2">
92
- <Switch id="notifications" />
93
- <Label htmlFor="notifications">Enable notifications</Label>
94
- </div>
95
-
96
- <div className="flex items-center gap-2">
97
- <Switch id="analytics" />
98
- <Label htmlFor="analytics">Allow analytics tracking</Label>
99
- </div>
100
- ```
101
-
102
- ### Con Iconos
103
-
104
- ```tsx
105
- import { Mail, User, Lock, Calendar } from "lucide-react";
106
- import { Input } from "@adamosuiteservices/ui/input";
107
-
108
- <div className="space-y-6">
109
- <div className="space-y-2">
110
- <Label htmlFor="username" className="flex items-center gap-2">
111
- <User className="size-4" />
112
- Username
113
- </Label>
114
- <Input id="username" placeholder="Enter your username" />
115
- </div>
116
-
117
- <div className="space-y-2">
118
- <Label htmlFor="email" className="flex items-center gap-2">
119
- <Mail className="size-4" />
120
- Email Address
121
- </Label>
122
- <Input id="email" type="email" placeholder="Enter your email" />
123
- </div>
124
-
125
- <div className="space-y-2">
126
- <Label htmlFor="password" className="flex items-center gap-2">
127
- <Lock className="size-4" />
128
- Password
129
- </Label>
130
- <Input id="password" type="password" />
131
- </div>
132
-
133
- <div className="space-y-2">
134
- <Label htmlFor="birthday" className="flex items-center gap-2">
135
- <Calendar className="size-4" />
136
- Date of Birth
137
- </Label>
138
- <Input id="birthday" type="date" />
139
- </div>
140
- </div>;
141
- ```
142
-
143
- ### Con Textarea
144
-
145
- ```tsx
146
- import { Textarea } from "@adamosuiteservices/ui/textarea";
147
-
148
- <div className="space-y-2">
149
- <Label htmlFor="message">Message</Label>
150
- <Textarea id="message" placeholder="Type your message here." />
151
- </div>
152
-
153
- <div className="space-y-2">
154
- <Label htmlFor="feedback">Feedback</Label>
155
- <Textarea
156
- id="feedback"
157
- placeholder="Please share your feedback..."
158
- className="min-h-[100px]"
159
- />
160
- </div>
161
- ```
162
-
163
- ### Con Select
164
-
165
- ```tsx
166
- import {
167
- Select,
168
- SelectContent,
169
- SelectItem,
170
- SelectTrigger,
171
- SelectValue,
172
- } from "@adamosuiteservices/ui/select";
173
-
174
- <div className="space-y-2">
175
- <Label htmlFor="country">Country</Label>
176
- <Select>
177
- <SelectTrigger id="country">
178
- <SelectValue placeholder="Select a country" />
179
- </SelectTrigger>
180
- <SelectContent>
181
- <SelectItem value="us">United States</SelectItem>
182
- <SelectItem value="uk">United Kingdom</SelectItem>
183
- <SelectItem value="ca">Canada</SelectItem>
184
- </SelectContent>
185
- </Select>
186
- </div>;
187
- ```
188
-
189
- ### Campos Requeridos
190
-
191
- ```tsx
192
- import { Input } from "@adamosuiteservices/ui/input";
193
-
194
- <div className="space-y-2">
195
- <Label htmlFor="required-email">
196
- Email Address <span className="text-destructive">*</span>
197
- </Label>
198
- <Input id="required-email" type="email" placeholder="Enter your email" required />
199
- </div>
200
-
201
- <div className="space-y-2">
202
- <Label htmlFor="required-name">
203
- Full Name <span className="text-destructive">*</span>
204
- </Label>
205
- <Input id="required-name" placeholder="Enter your full name" required />
206
- </div>
207
-
208
- <div className="space-y-2">
209
- <Label htmlFor="optional-phone">
210
- Phone Number <span className="text-muted-foreground text-xs">(optional)</span>
211
- </Label>
212
- <Input id="optional-phone" type="tel" placeholder="Enter your phone number" />
213
- </div>
214
- ```
215
-
216
- ### Con Descripción
217
-
218
- ```tsx
219
- import { Input } from "@adamosuiteservices/ui/input";
220
-
221
- <div className="space-y-2">
222
- <Label htmlFor="username">Username</Label>
223
- <Input id="username" placeholder="johndoe" />
224
- <p className="text-sm text-muted-foreground">
225
- This will be your public display name.
226
- </p>
227
- </div>;
228
- ```
229
-
230
- ### En Formulario Completo
231
-
232
- ```tsx
233
- import { Input } from "@adamosuiteservices/ui/input";
234
- import { Button } from "@adamosuiteservices/ui/button";
235
- import { Checkbox } from "@adamosuiteservices/ui/checkbox";
236
-
237
- <form className="space-y-6 max-w-md">
238
- <div className="space-y-2">
239
- <Label htmlFor="name">Name</Label>
240
- <Input id="name" placeholder="John Doe" />
241
- </div>
242
-
243
- <div className="space-y-2">
244
- <Label htmlFor="email">Email</Label>
245
- <Input id="email" type="email" placeholder="john@example.com" />
246
- </div>
247
-
248
- <div className="space-y-2">
249
- <Label htmlFor="password">Password</Label>
250
- <Input id="password" type="password" />
251
- </div>
252
-
253
- <div className="flex items-center gap-2">
254
- <Checkbox id="remember" />
255
- <Label htmlFor="remember">Remember me</Label>
256
- </div>
257
-
258
- <Button type="submit" className="w-full">
259
- Sign Up
260
- </Button>
261
- </form>;
262
- ```
263
-
264
- ## Casos de Uso Comunes
265
-
266
- **Forms**: Etiquetas para inputs, selects, textareas
267
- **Checkboxes**: Labels clickeables junto a checkboxes
268
- **Radio groups**: Labels para cada opción de radio
269
- **Switches**: Descripción de toggles
270
- **Required fields**: Marcar campos obligatorios con asterisco
271
- **Accessibility**: Asociación semántica label-input
272
-
273
- ## Estilos Base
274
-
275
- - **Display**: `flex items-center gap-2`
276
- - **Font**: `text-sm font-medium`
277
- - **Line height**: `leading-none`
278
- - **Select**: `select-none` (no seleccionable)
279
- - **Peer disabled**: `peer-disabled:cursor-not-allowed peer-disabled:opacity-50`
280
- - **Group disabled**: `group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50`
281
-
282
- ## Estados
283
-
284
- ### Disabled via Peer
285
-
286
- Cuando el input asociado (`peer`) está disabled:
287
-
288
- ```tsx
289
- <Input id="disabled" disabled className="peer" />
290
- <Label htmlFor="disabled">Disabled field</Label>
291
- ```
292
-
293
- → Label automáticamente `opacity-50` y `cursor-not-allowed`
294
-
295
- ### Disabled via Group
296
-
297
- Cuando el contenedor tiene `data-disabled`:
298
-
299
- ```tsx
300
- <div data-disabled="true">
301
- <Label htmlFor="field">Field</Label>
302
- <Input id="field" disabled />
303
- </div>
304
- ```
305
-
306
- → Label automáticamente `opacity-50` y `pointer-events-none`
307
-
308
- ## Accesibilidad
309
-
310
- - ✅ **Radix UI**: Basado en primitiva de Radix UI con accesibilidad completa
311
- - ✅ **htmlFor**: Asocia label con control usando `htmlFor` e `id`
312
- - ✅ **Click target**: Todo el label es clickeable, hace focus al input
313
- - ✅ **Screen readers**: Anuncia label cuando input recibe focus
314
- - ✅ **Required**: Marca campos requeridos con asterisco visible
315
- - ✅ **Disabled**: Estado disabled automático via peer o group
316
- - ⚠️ **Description**: Usa `aria-describedby` para textos de ayuda
317
-
318
- ## Notas de Implementación
319
-
320
- - **Radix UI**: Wrapper sobre `@radix-ui/react-label`
321
- - **Peer awareness**: Detecta input disabled via clase `peer`
322
- - **Group awareness**: Detecta container disabled via `data-disabled`
323
- - **Gap auto**: `gap-2` entre icono y texto si hay icono
324
- - **Clickeable**: Todo el label hace focus al control asociado
325
- - **Non-selectable**: `select-none` para evitar selección accidental
326
- - **Flex**: Display flex para alinear iconos fácilmente
327
-
328
- ## htmlFor vs Wrapping
329
-
330
- ```tsx
331
- {/* Recomendado: htmlFor */}
332
- <Label htmlFor="email">Email</Label>
333
- <Input id="email" />
334
-
335
- {/* No recomendado: wrapping */}
336
- <Label>
337
- Email
338
- <Input />
339
- </Label>
340
- ```
341
-
342
- **Usa htmlFor**: Mejor separación, más flexible con layouts, funciona con todos los componentes.
343
-
344
- ## Troubleshooting
345
-
346
- **Label no hace click**: Verifica que `htmlFor` e `id` coincidan exactamente
347
- **Disabled no funciona**: Asegúrate de usar `peer` className en el input o `data-disabled` en container
348
- **Gap no se ve**: Label tiene `gap-2` por defecto, verifica que haya múltiples children
349
- **Icono desalineado**: Label tiene `items-center`, verifica que el icono tenga tamaño adecuado
350
- **Required asterisco no se ve**: Usa `<span className="text-destructive">*</span>`
351
- **Texto muy grande**: Label es `text-sm`, ajusta con className si necesario
352
- **No seleccionable**: Label tiene `select-none`, normal behavior
353
- **Peer disabled no aplica**: El input debe tener `className="peer"` además de `disabled`
354
-
355
- ## Referencias
356
-
357
- - **Radix UI Label**: <https://www.radix-ui.com/primitives/docs/components/label>
358
- - **shadcn/ui Label**: <https://ui.shadcn.com/docs/components/label>
359
- - **WAI-ARIA Label**: <https://www.w3.org/WAI/ARIA/apg/patterns/label/>
1
+ # Label
2
+
3
+ Etiqueta accesible asociada con controles de formulario. Basado en Radix UI Label para accesibilidad mejorada.
4
+
5
+ ## Descripción
6
+
7
+ El componente `Label` renderiza una etiqueta accesible asociada con controles de formulario.
8
+
9
+ ## Importación
10
+
11
+ ```typescript
12
+ import { Label } from "@adamosuiteservices/ui/label";
13
+ ```
14
+
15
+ ## Anatomía
16
+
17
+ ```tsx
18
+ <Label htmlFor="email">Email</Label>
19
+ <Input id="email" type="email" />
20
+ ```
21
+
22
+ **Componentes**: 1 (Label)
23
+
24
+ ## Props
25
+
26
+ | Prop | Tipo | Descripción |
27
+ | ----------- | -------- | ------------------------------------------------- |
28
+ | `htmlFor` | `string` | ID del control asociado (conecta label con input) |
29
+ | `className` | `string` | Clases CSS adicionales |
30
+ | ...props | - | Todas las props de Radix UI Label |
31
+
32
+ ## Patrones de Uso
33
+
34
+ ### Básico con Input
35
+
36
+ ```tsx
37
+ import { Input } from "@adamosuiteservices/ui/input";
38
+
39
+ <div className="space-y-2">
40
+ <Label htmlFor="email">Email</Label>
41
+ <Input id="email" type="email" placeholder="Enter your email" />
42
+ </div>;
43
+ ```
44
+
45
+ ### Con Checkbox
46
+
47
+ ```tsx
48
+ import { Checkbox } from "@adamosuiteservices/ui/checkbox";
49
+
50
+ <div className="flex items-center gap-2">
51
+ <Checkbox id="terms" />
52
+ <Label htmlFor="terms">Accept terms and conditions</Label>
53
+ </div>
54
+
55
+ <div className="flex items-center gap-2">
56
+
57
+ <Checkbox id="newsletter" />
58
+ <Label htmlFor="newsletter">Subscribe to our newsletter</Label>
59
+ </div>
60
+ ```
61
+
62
+ ### Con Radio Group
63
+
64
+ ```tsx
65
+ import { RadioGroup, RadioGroupItem } from "@adamosuiteservices/ui/radio-group";
66
+
67
+ <div className="space-y-4">
68
+ <Label>Choose your preferred theme</Label>
69
+ <RadioGroup defaultValue="light" className="space-y-2">
70
+ <div className="flex items-center gap-2">
71
+ <RadioGroupItem value="light" id="light" />
72
+ <Label htmlFor="light">Light</Label>
73
+ </div>
74
+ <div className="flex items-center gap-2">
75
+ <RadioGroupItem value="dark" id="dark" />
76
+ <Label htmlFor="dark">Dark</Label>
77
+ </div>
78
+ <div className="flex items-center gap-2">
79
+ <RadioGroupItem value="system" id="system" />
80
+ <Label htmlFor="system">System</Label>
81
+ </div>
82
+ </RadioGroup>
83
+ </div>;
84
+ ```
85
+
86
+ ### Con Switch
87
+
88
+ ```tsx
89
+ import { Switch } from "@adamosuiteservices/ui/switch";
90
+
91
+ <div className="flex items-center gap-2">
92
+ <Switch id="notifications" />
93
+ <Label htmlFor="notifications">Enable notifications</Label>
94
+ </div>
95
+
96
+ <div className="flex items-center gap-2">
97
+ <Switch id="analytics" />
98
+ <Label htmlFor="analytics">Allow analytics tracking</Label>
99
+ </div>
100
+ ```
101
+
102
+ ### Con Iconos
103
+
104
+ ```tsx
105
+ import { Mail, User, Lock, Calendar } from "lucide-react";
106
+ import { Input } from "@adamosuiteservices/ui/input";
107
+
108
+ <div className="space-y-6">
109
+ <div className="space-y-2">
110
+ <Label htmlFor="username" className="flex items-center gap-2">
111
+ <User className="size-4" />
112
+ Username
113
+ </Label>
114
+ <Input id="username" placeholder="Enter your username" />
115
+ </div>
116
+
117
+ <div className="space-y-2">
118
+ <Label htmlFor="email" className="flex items-center gap-2">
119
+ <Mail className="size-4" />
120
+ Email Address
121
+ </Label>
122
+ <Input id="email" type="email" placeholder="Enter your email" />
123
+ </div>
124
+
125
+ <div className="space-y-2">
126
+ <Label htmlFor="password" className="flex items-center gap-2">
127
+ <Lock className="size-4" />
128
+ Password
129
+ </Label>
130
+ <Input id="password" type="password" />
131
+ </div>
132
+
133
+ <div className="space-y-2">
134
+ <Label htmlFor="birthday" className="flex items-center gap-2">
135
+ <Calendar className="size-4" />
136
+ Date of Birth
137
+ </Label>
138
+ <Input id="birthday" type="date" />
139
+ </div>
140
+ </div>;
141
+ ```
142
+
143
+ ### Con Textarea
144
+
145
+ ```tsx
146
+ import { Textarea } from "@adamosuiteservices/ui/textarea";
147
+
148
+ <div className="space-y-2">
149
+ <Label htmlFor="message">Message</Label>
150
+ <Textarea id="message" placeholder="Type your message here." />
151
+ </div>
152
+
153
+ <div className="space-y-2">
154
+ <Label htmlFor="feedback">Feedback</Label>
155
+ <Textarea
156
+ id="feedback"
157
+ placeholder="Please share your feedback..."
158
+ className="min-h-[100px]"
159
+ />
160
+ </div>
161
+ ```
162
+
163
+ ### Con Select
164
+
165
+ ```tsx
166
+ import {
167
+ Select,
168
+ SelectContent,
169
+ SelectItem,
170
+ SelectTrigger,
171
+ SelectValue,
172
+ } from "@adamosuiteservices/ui/select";
173
+
174
+ <div className="space-y-2">
175
+ <Label htmlFor="country">Country</Label>
176
+ <Select>
177
+ <SelectTrigger id="country">
178
+ <SelectValue placeholder="Select a country" />
179
+ </SelectTrigger>
180
+ <SelectContent>
181
+ <SelectItem value="us">United States</SelectItem>
182
+ <SelectItem value="uk">United Kingdom</SelectItem>
183
+ <SelectItem value="ca">Canada</SelectItem>
184
+ </SelectContent>
185
+ </Select>
186
+ </div>;
187
+ ```
188
+
189
+ ### Campos Requeridos
190
+
191
+ ```tsx
192
+ import { Input } from "@adamosuiteservices/ui/input";
193
+
194
+ <div className="space-y-2">
195
+ <Label htmlFor="required-email">
196
+ Email Address <span className="text-destructive">*</span>
197
+ </Label>
198
+ <Input id="required-email" type="email" placeholder="Enter your email" required />
199
+ </div>
200
+
201
+ <div className="space-y-2">
202
+ <Label htmlFor="required-name">
203
+ Full Name <span className="text-destructive">*</span>
204
+ </Label>
205
+ <Input id="required-name" placeholder="Enter your full name" required />
206
+ </div>
207
+
208
+ <div className="space-y-2">
209
+ <Label htmlFor="optional-phone">
210
+ Phone Number <span className="text-muted-foreground text-xs">(optional)</span>
211
+ </Label>
212
+ <Input id="optional-phone" type="tel" placeholder="Enter your phone number" />
213
+ </div>
214
+ ```
215
+
216
+ ### Con Descripción
217
+
218
+ ```tsx
219
+ import { Input } from "@adamosuiteservices/ui/input";
220
+
221
+ <div className="space-y-2">
222
+ <Label htmlFor="username">Username</Label>
223
+ <Input id="username" placeholder="johndoe" />
224
+ <p className="text-sm text-muted-foreground">
225
+ This will be your public display name.
226
+ </p>
227
+ </div>;
228
+ ```
229
+
230
+ ### En Formulario Completo
231
+
232
+ ```tsx
233
+ import { Input } from "@adamosuiteservices/ui/input";
234
+ import { Button } from "@adamosuiteservices/ui/button";
235
+ import { Checkbox } from "@adamosuiteservices/ui/checkbox";
236
+
237
+ <form className="space-y-6 max-w-md">
238
+ <div className="space-y-2">
239
+ <Label htmlFor="name">Name</Label>
240
+ <Input id="name" placeholder="John Doe" />
241
+ </div>
242
+
243
+ <div className="space-y-2">
244
+ <Label htmlFor="email">Email</Label>
245
+ <Input id="email" type="email" placeholder="john@example.com" />
246
+ </div>
247
+
248
+ <div className="space-y-2">
249
+ <Label htmlFor="password">Password</Label>
250
+ <Input id="password" type="password" />
251
+ </div>
252
+
253
+ <div className="flex items-center gap-2">
254
+ <Checkbox id="remember" />
255
+ <Label htmlFor="remember">Remember me</Label>
256
+ </div>
257
+
258
+ <Button type="submit" className="w-full">
259
+ Sign Up
260
+ </Button>
261
+ </form>;
262
+ ```
263
+
264
+ ## Casos de Uso Comunes
265
+
266
+ **Forms**: Etiquetas para inputs, selects, textareas
267
+ **Checkboxes**: Labels clickeables junto a checkboxes
268
+ **Radio groups**: Labels para cada opción de radio
269
+ **Switches**: Descripción de toggles
270
+ **Required fields**: Marcar campos obligatorios con asterisco
271
+ **Accessibility**: Asociación semántica label-input
272
+
273
+ ## Estilos Base
274
+
275
+ - **Display**: `flex items-center gap-2`
276
+ - **Font**: `text-sm font-medium`
277
+ - **Line height**: `leading-none`
278
+ - **Select**: `select-none` (no seleccionable)
279
+ - **Peer disabled**: `peer-disabled:cursor-not-allowed peer-disabled:opacity-50`
280
+ - **Group disabled**: `group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50`
281
+
282
+ ## Estados
283
+
284
+ ### Disabled via Peer
285
+
286
+ Cuando el input asociado (`peer`) está disabled:
287
+
288
+ ```tsx
289
+ <Input id="disabled" disabled className="peer" />
290
+ <Label htmlFor="disabled">Disabled field</Label>
291
+ ```
292
+
293
+ → Label automáticamente `opacity-50` y `cursor-not-allowed`
294
+
295
+ ### Disabled via Group
296
+
297
+ Cuando el contenedor tiene `data-disabled`:
298
+
299
+ ```tsx
300
+ <div data-disabled="true">
301
+ <Label htmlFor="field">Field</Label>
302
+ <Input id="field" disabled />
303
+ </div>
304
+ ```
305
+
306
+ → Label automáticamente `opacity-50` y `pointer-events-none`
307
+
308
+ ## Accesibilidad
309
+
310
+ - ✅ **Radix UI**: Basado en primitiva de Radix UI con accesibilidad completa
311
+ - ✅ **htmlFor**: Asocia label con control usando `htmlFor` e `id`
312
+ - ✅ **Click target**: Todo el label es clickeable, hace focus al input
313
+ - ✅ **Screen readers**: Anuncia label cuando input recibe focus
314
+ - ✅ **Required**: Marca campos requeridos con asterisco visible
315
+ - ✅ **Disabled**: Estado disabled automático via peer o group
316
+ - ⚠️ **Description**: Usa `aria-describedby` para textos de ayuda
317
+
318
+ ## Notas de Implementación
319
+
320
+ - **Radix UI**: Wrapper sobre `@radix-ui/react-label`
321
+ - **Peer awareness**: Detecta input disabled via clase `peer`
322
+ - **Group awareness**: Detecta container disabled via `data-disabled`
323
+ - **Gap auto**: `gap-2` entre icono y texto si hay icono
324
+ - **Clickeable**: Todo el label hace focus al control asociado
325
+ - **Non-selectable**: `select-none` para evitar selección accidental
326
+ - **Flex**: Display flex para alinear iconos fácilmente
327
+
328
+ ## htmlFor vs Wrapping
329
+
330
+ ```tsx
331
+ {/* Recomendado: htmlFor */}
332
+ <Label htmlFor="email">Email</Label>
333
+ <Input id="email" />
334
+
335
+ {/* No recomendado: wrapping */}
336
+ <Label>
337
+ Email
338
+ <Input />
339
+ </Label>
340
+ ```
341
+
342
+ **Usa htmlFor**: Mejor separación, más flexible con layouts, funciona con todos los componentes.
343
+
344
+ ## Troubleshooting
345
+
346
+ **Label no hace click**: Verifica que `htmlFor` e `id` coincidan exactamente
347
+ **Disabled no funciona**: Asegúrate de usar `peer` className en el input o `data-disabled` en container
348
+ **Gap no se ve**: Label tiene `gap-2` por defecto, verifica que haya múltiples children
349
+ **Icono desalineado**: Label tiene `items-center`, verifica que el icono tenga tamaño adecuado
350
+ **Required asterisco no se ve**: Usa `<span className="text-destructive">*</span>`
351
+ **Texto muy grande**: Label es `text-sm`, ajusta con className si necesario
352
+ **No seleccionable**: Label tiene `select-none`, normal behavior
353
+ **Peer disabled no aplica**: El input debe tener `className="peer"` además de `disabled`
354
+
355
+ ## Referencias
356
+
357
+ - **Radix UI Label**: <https://www.radix-ui.com/primitives/docs/components/label>
358
+ - **shadcn/ui Label**: <https://ui.shadcn.com/docs/components/label>
359
+ - **WAI-ARIA Label**: <https://www.w3.org/WAI/ARIA/apg/patterns/label/>