@adamosuiteservices/ui 2.14.2 → 2.15.0

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 (41) hide show
  1. package/dist/combobox-DGuQtXjP.js +608 -0
  2. package/dist/combobox-hTCtPMUL.cjs +40 -0
  3. package/dist/combobox.cjs +1 -1
  4. package/dist/combobox.js +1 -1
  5. package/dist/components/ui/combobox/combobox.d.ts +5 -1
  6. package/dist/components/ui/date-picker-selector/date-picker-selector.d.ts +5 -1
  7. package/dist/components/ui/file-upload/file-upload.d.ts +3 -1
  8. package/dist/components/ui/slider/slider.d.ts +1 -1
  9. package/dist/components/ui/switch/switch.d.ts +1 -1
  10. package/dist/date-picker-selector.cjs +1 -1
  11. package/dist/date-picker-selector.js +38 -28
  12. package/dist/field.cjs +2 -2
  13. package/dist/field.js +2 -2
  14. package/dist/file-upload.cjs +5 -3
  15. package/dist/file-upload.js +178 -149
  16. package/dist/slider.cjs +5 -5
  17. package/dist/slider.js +196 -177
  18. package/dist/styles.css +1 -1
  19. package/dist/switch.cjs +3 -3
  20. package/dist/switch.js +105 -85
  21. package/docs/components/ui/accordion-rounded.md +2 -6
  22. package/docs/components/ui/avatar.md +3 -1
  23. package/docs/components/ui/button.md +22 -16
  24. package/docs/components/ui/card.md +49 -31
  25. package/docs/components/ui/checkbox.md +44 -8
  26. package/docs/components/ui/combobox.md +62 -4
  27. package/docs/components/ui/date-picker-selector.md +90 -26
  28. package/docs/components/ui/file-upload.md +241 -94
  29. package/docs/components/ui/icon.md +1 -1
  30. package/docs/components/ui/input.md +4 -1
  31. package/docs/components/ui/radio-group.md +1 -1
  32. package/docs/components/ui/select.md +51 -34
  33. package/docs/components/ui/sheet.md +3 -9
  34. package/docs/components/ui/slider.md +120 -99
  35. package/docs/components/ui/switch.md +408 -408
  36. package/docs/components/ui/textarea.md +37 -22
  37. package/docs/components/ui/tooltip.md +5 -2
  38. package/docs/components/ui/typography.md +63 -39
  39. package/package.json +1 -1
  40. package/dist/combobox-CCJGIMFQ.cjs +0 -40
  41. package/dist/combobox-Cj-GEp-T.js +0 -604
@@ -137,21 +137,30 @@ function App() {
137
137
  ### Con Label
138
138
 
139
139
  ```tsx
140
- import { Label } from "@adamosuiteservices/ui/label";
141
-
142
- <div className="grid w-full max-w-sm items-center gap-2">
143
- <Label htmlFor="email-provider">Email provider</Label>
144
- <Select>
145
- <SelectTrigger id="email-provider">
146
- <SelectValue placeholder="Select a provider" />
147
- </SelectTrigger>
148
- <SelectContent>
149
- <SelectItem value="gmail">Gmail</SelectItem>
150
- <SelectItem value="outlook">Outlook</SelectItem>
151
- <SelectItem value="yahoo">Yahoo</SelectItem>
152
- </SelectContent>
153
- </Select>
154
- </div>;
140
+ import {
141
+ Field,
142
+ FieldContent,
143
+ FieldGroup,
144
+ FieldLabel,
145
+ } from "@adamosuiteservices/ui/field";
146
+
147
+ <FieldGroup className="max-w-sm">
148
+ <Field>
149
+ <FieldLabel htmlFor="email-provider">Email provider</FieldLabel>
150
+ <FieldContent>
151
+ <Select>
152
+ <SelectTrigger id="email-provider">
153
+ <SelectValue placeholder="Select a provider" />
154
+ </SelectTrigger>
155
+ <SelectContent>
156
+ <SelectItem value="gmail">Gmail</SelectItem>
157
+ <SelectItem value="outlook">Outlook</SelectItem>
158
+ <SelectItem value="yahoo">Yahoo</SelectItem>
159
+ </SelectContent>
160
+ </Select>
161
+ </FieldContent>
162
+ </Field>
163
+ </FieldGroup>;
155
164
  ```
156
165
 
157
166
  ### Con Grupos
@@ -244,6 +253,13 @@ import { Icon } from "@adamosuiteservices/ui/icon";
244
253
 
245
254
  ```tsx
246
255
  import { Button } from "@adamosuiteservices/ui/button";
256
+ import {
257
+ Field,
258
+ FieldContent,
259
+ FieldError,
260
+ FieldGroup,
261
+ FieldLabel,
262
+ } from "@adamosuiteservices/ui/field";
247
263
 
248
264
  function App() {
249
265
  const [value, setValue] = useState("");
@@ -259,25 +275,26 @@ function App() {
259
275
 
260
276
  return (
261
277
  <div className="space-y-4">
262
- <div className="grid w-full max-w-sm items-center gap-2">
263
- <Label htmlFor="priority">
264
- Priority level <span className="text-destructive">*</span>
265
- </Label>
266
- <Select value={value} onValueChange={setValue}>
267
- <SelectTrigger
268
- id="priority"
269
- className={error ? "border-destructive" : ""}
270
- >
271
- <SelectValue placeholder="Select priority" />
272
- </SelectTrigger>
273
- <SelectContent>
274
- <SelectItem value="low">Low</SelectItem>
275
- <SelectItem value="medium">Medium</SelectItem>
276
- <SelectItem value="high">High</SelectItem>
277
- </SelectContent>
278
- </Select>
279
- {error && <p className="text-destructive text-sm">{error}</p>}
280
- </div>
278
+ <FieldGroup className="max-w-sm">
279
+ <Field>
280
+ <FieldLabel htmlFor="priority">
281
+ Priority level <span className="text-destructive">*</span>
282
+ </FieldLabel>
283
+ <FieldContent>
284
+ <Select value={value} onValueChange={setValue}>
285
+ <SelectTrigger id="priority" aria-invalid={!!error}>
286
+ <SelectValue placeholder="Select priority" />
287
+ </SelectTrigger>
288
+ <SelectContent>
289
+ <SelectItem value="low">Low</SelectItem>
290
+ <SelectItem value="medium">Medium</SelectItem>
291
+ <SelectItem value="high">High</SelectItem>
292
+ </SelectContent>
293
+ </Select>
294
+ </FieldContent>
295
+ {error && <FieldError>{error}</FieldError>}
296
+ </Field>
297
+ </FieldGroup>
281
298
  <Button onClick={handleValidate} variant="outline">
282
299
  Validate Selection
283
300
  </Button>
@@ -32,9 +32,7 @@ import {
32
32
  <SheetTitle>Are you sure?</SheetTitle>
33
33
  <SheetDescription>This action cannot be undone.</SheetDescription>
34
34
  </SheetHeader>
35
- <SheetBody>
36
- {/* Content */}
37
- </SheetBody>
35
+ <SheetBody>{/* Content */}</SheetBody>
38
36
  </SheetContent>
39
37
  </Sheet>
40
38
  ```
@@ -74,9 +72,7 @@ Ancho: `w-11/12` en móvil, `max-w-sm` en desktop. Border radius: `rounded-2xl`.
74
72
  <SheetTitle>Settings</SheetTitle>
75
73
  <SheetDescription>Configure your preferences</SheetDescription>
76
74
  </SheetHeader>
77
- <SheetBody>
78
- {/* Content with horizontal padding */}
79
- </SheetBody>
75
+ <SheetBody>{/* Content with horizontal padding */}</SheetBody>
80
76
  </SheetContent>
81
77
  </Sheet>
82
78
  ```
@@ -126,9 +122,7 @@ Ancho: `w-11/12` en móvil, `max-w-sm` en desktop. Border radius: `rounded-2xl`.
126
122
  <SheetTitle>Edit profile</SheetTitle>
127
123
  <SheetDescription>Make changes to your profile here.</SheetDescription>
128
124
  </SheetHeader>
129
- <SheetBody>
130
- {/* Form fields */}
131
- </SheetBody>
125
+ <SheetBody>{/* Form fields */}</SheetBody>
132
126
  <SheetFooter>
133
127
  <SheetClose asChild>
134
128
  <Button variant="outline">Cancel</Button>
@@ -22,19 +22,19 @@ import { Slider } from "@adamosuiteservices/ui/slider";
22
22
 
23
23
  ## Props
24
24
 
25
- | Prop | Tipo | Descripción |
26
- | --------------- | ----------------------------------- | ----------------------------------- |
27
- | `defaultValue` | `number[]` | Valor inicial (uncontrolled) |
28
- | `value` | `number[]` | Valor controlado (array de números) |
29
- | `onValueChange` | `(value: number[]) => void` | Callback al cambiar valor |
30
- | `min` | `number` | Valor mínimo (default: 0) |
31
- | `max` | `number` | Valor máximo (default: 100) |
32
- | `step` | `number` | Incremento (default: 1) |
33
- | `disabled` | `boolean` | Deshabilita el slider |
34
- | `orientation` | `"horizontal" \| "vertical"` | Orientación (default: horizontal) |
35
- | `colorSlide` | `"full" \| [string, string]` | Gradiente de colores personalizado |
36
- | `theme` | `Theme` | Tema personalizado |
37
- | `className` | `string` | Clases CSS adicionales |
25
+ | Prop | Tipo | Descripción |
26
+ | --------------- | ---------------------------- | ----------------------------------- |
27
+ | `defaultValue` | `number[]` | Valor inicial (uncontrolled) |
28
+ | `value` | `number[]` | Valor controlado (array de números) |
29
+ | `onValueChange` | `(value: number[]) => void` | Callback al cambiar valor |
30
+ | `min` | `number` | Valor mínimo (default: 0) |
31
+ | `max` | `number` | Valor máximo (default: 100) |
32
+ | `step` | `number` | Incremento (default: 1) |
33
+ | `disabled` | `boolean` | Deshabilita el slider |
34
+ | `orientation` | `"horizontal" \| "vertical"` | Orientación (default: horizontal) |
35
+ | `colorSlide` | `"full" \| [string, string]` | Gradiente de colores personalizado |
36
+ | `theme` | `Theme` | Tema personalizado |
37
+ | `className` | `string` | Clases CSS adicionales |
38
38
 
39
39
  **Nota**: `value` y `defaultValue` siempre son arrays. Single value = `[50]`, range = `[20, 80]`
40
40
 
@@ -51,24 +51,33 @@ import { Slider } from "@adamosuiteservices/ui/slider";
51
51
  ### Con Label
52
52
 
53
53
  ```tsx
54
- import { Label } from "@adamosuiteservices/ui/label";
54
+ import {
55
+ Field,
56
+ FieldContent,
57
+ FieldGroup,
58
+ FieldLabel,
59
+ } from "@adamosuiteservices/ui/field";
55
60
  import { useState } from "react";
56
61
 
57
62
  function App() {
58
63
  const [value, setValue] = useState([50]);
59
64
 
60
65
  return (
61
- <div className="grid w-full max-w-sm items-center gap-2">
62
- <Label htmlFor="volume">Volume: {value[0]}%</Label>
63
- <Slider
64
- id="volume"
65
- max={100}
66
- step={1}
67
- value={value}
68
- onValueChange={setValue}
69
- className="w-full"
70
- />
71
- </div>
66
+ <FieldGroup className="max-w-sm">
67
+ <Field>
68
+ <FieldLabel htmlFor="volume">Volume: {value[0]}%</FieldLabel>
69
+ <FieldContent>
70
+ <Slider
71
+ id="volume"
72
+ max={100}
73
+ step={1}
74
+ value={value}
75
+ onValueChange={setValue}
76
+ className="w-full"
77
+ />
78
+ </FieldContent>
79
+ </Field>
80
+ </FieldGroup>
72
81
  );
73
82
  }
74
83
  ```
@@ -80,18 +89,22 @@ function App() {
80
89
  const [value, setValue] = useState([20, 80]);
81
90
 
82
91
  return (
83
- <div className="grid w-full max-w-sm items-center gap-2">
84
- <Label>
85
- Price Range: ${value[0]} - ${value[1]}
86
- </Label>
87
- <Slider
88
- max={100}
89
- step={1}
90
- value={value}
91
- onValueChange={setValue}
92
- className="w-full"
93
- />
94
- </div>
92
+ <FieldGroup className="max-w-sm">
93
+ <Field>
94
+ <FieldLabel>
95
+ Price Range: ${value[0]} - ${value[1]}
96
+ </FieldLabel>
97
+ <FieldContent>
98
+ <Slider
99
+ max={100}
100
+ step={1}
101
+ value={value}
102
+ onValueChange={setValue}
103
+ className="w-full"
104
+ />
105
+ </FieldContent>
106
+ </Field>
107
+ </FieldGroup>
95
108
  );
96
109
  }
97
110
  ```
@@ -104,20 +117,24 @@ function App() {
104
117
  const stepSize = 25;
105
118
 
106
119
  return (
107
- <div className="grid w-full max-w-sm items-center gap-2">
108
- <Label>Progress: {value[0]}%</Label>
109
- <Slider
110
- max={100}
111
- step={stepSize}
112
- value={value}
113
- onValueChange={setValue}
114
- className="w-full"
115
- />
116
- <div className="flex justify-between text-xs text-muted-foreground">
117
- <span>0%</span>
118
- <span>25%</span>
119
- <span>50%</span>
120
- <span>75%</span>
120
+ <FieldGroup className="max-w-sm">
121
+ <Field>
122
+ <FieldLabel>Progress: {value[0]}%</FieldLabel>
123
+ <FieldContent>
124
+ <Slider
125
+ max={100}
126
+ step={stepSize}
127
+ value={value}
128
+ onValueChange={setValue}
129
+ className="w-full"
130
+ />
131
+ </FieldContent>
132
+ <FieldDescription>
133
+ <div className="flex justify-between text-xs">
134
+ <span>0%</span>
135
+ <span>25%</span>
136
+ <span>50%</span>
137
+ <span>75%</span>
121
138
  <span>100%</span>
122
139
  </div>
123
140
  </div>
@@ -134,7 +151,7 @@ function App() {
134
151
  return (
135
152
  <div className="flex h-64 items-center space-x-6">
136
153
  <div className="flex flex-col items-center space-y-2">
137
- <Label>Volume</Label>
154
+ <FieldLabel>Volume</FieldLabel>
138
155
  <Slider
139
156
  orientation="vertical"
140
157
  max={100}
@@ -162,34 +179,38 @@ function App() {
162
179
  const increase = () => setValue([Math.min(100, value[0] + 10)]);
163
180
 
164
181
  return (
165
- <div className="grid w-full max-w-sm items-center gap-4">
166
- <Label>Volume: {value[0]}%</Label>
167
- <div className="flex items-center space-x-2">
168
- <Button
169
- variant="outline"
170
- size="sm"
171
- onClick={decrease}
172
- disabled={value[0] === 0}
173
- >
174
- -
175
- </Button>
176
- <Slider
177
- value={value}
178
- onValueChange={setValue}
179
- max={100}
180
- step={1}
181
- className="flex-1"
182
- />
183
- <Button
184
- variant="outline"
185
- size="sm"
186
- onClick={increase}
187
- disabled={value[0] === 100}
188
- >
189
- +
190
- </Button>
191
- </div>
192
- </div>
182
+ <FieldGroup className="max-w-sm">
183
+ <Field>
184
+ <FieldLabel>Volume: {value[0]}%</FieldLabel>
185
+ <FieldContent>
186
+ <div className="flex items-center space-x-2">
187
+ <Button
188
+ variant="outline"
189
+ size="sm"
190
+ onClick={decrease}
191
+ disabled={value[0] === 0}
192
+ >
193
+ -
194
+ </Button>
195
+ <Slider
196
+ value={value}
197
+ onValueChange={setValue}
198
+ max={100}
199
+ step={1}
200
+ className="flex-1"
201
+ />
202
+ <Button
203
+ variant="outline"
204
+ size="sm"
205
+ onClick={increase}
206
+ disabled={value[0] === 100}
207
+ >
208
+ +
209
+ </Button>
210
+ </div>
211
+ </FieldContent>
212
+ </Field>
213
+ </FieldGroup>
193
214
  );
194
215
  }
195
216
  ```
@@ -215,7 +236,7 @@ function PriceFilter() {
215
236
  </CardHeader>
216
237
  <CardContent className="space-y-4">
217
238
  <div className="space-y-2">
218
- <Label>Price Range</Label>
239
+ <FieldLabel>Price Range</FieldLabel>
219
240
  <Slider
220
241
  value={priceRange}
221
242
  onValueChange={setPriceRange}
@@ -259,7 +280,7 @@ function ColorPicker() {
259
280
  <div className="space-y-4">
260
281
  <div className="space-y-2">
261
282
  <div className="flex justify-between">
262
- <Label>Red</Label>
283
+ <FieldLabel>Red</FieldLabel>
263
284
  <span className="text-sm text-muted-foreground">{red[0]}</span>
264
285
  </div>
265
286
  <Slider value={red} onValueChange={setRed} max={255} step={1} />
@@ -267,7 +288,7 @@ function ColorPicker() {
267
288
 
268
289
  <div className="space-y-2">
269
290
  <div className="flex justify-between">
270
- <Label>Green</Label>
291
+ <FieldLabel>Green</FieldLabel>
271
292
  <span className="text-sm text-muted-foreground">{green[0]}</span>
272
293
  </div>
273
294
  <Slider value={green} onValueChange={setGreen} max={255} step={1} />
@@ -275,7 +296,7 @@ function ColorPicker() {
275
296
 
276
297
  <div className="space-y-2">
277
298
  <div className="flex justify-between">
278
- <Label>Blue</Label>
299
+ <FieldLabel>Blue</FieldLabel>
279
300
  <span className="text-sm text-muted-foreground">{blue[0]}</span>
280
301
  </div>
281
302
  <Slider value={blue} onValueChange={setBlue} max={255} step={1} />
@@ -289,18 +310,18 @@ function ColorPicker() {
289
310
 
290
311
  ### Con Gradiente Arcoíris
291
312
 
292
- ```tsx
313
+ ````tsx
293
314
  function RainbowSlider() {
294
315
  const [value, setValue] = useState([50]);
295
316
 
296
317
  ## Casos de Uso
297
318
 
298
- **Volume control**: Audio, música, efectos de sonido
299
- **Price filters**: Rango de precios en e-commerce
300
- **Color pickers**: RGB, HSL sliders con gradientes personalizados
301
- **Brightness/Contrast**: Ajustes de imagen
302
- **Temperature**: Termostatos, controles de clima con gradientes frío-calor
303
- **Range selection**: Filtros de fecha, edad, tamaño
319
+ **Volume control**: Audio, música, efectos de sonido
320
+ **Price filters**: Rango de precios en e-commerce
321
+ **Color pickers**: RGB, HSL sliders con gradientes personalizados
322
+ **Brightness/Contrast**: Ajustes de imagen
323
+ **Temperature**: Termostatos, controles de clima con gradientes frío-calor
324
+ **Range selection**: Filtros de fecha, edad, tamaño
304
325
  **Hue selection**: Selectores de tono con gradiente arcoíris
305
326
  ## Estilos Base
306
327
 
@@ -329,13 +350,13 @@ function CustomColorSlider() {
329
350
  onValueChange={setValue}
330
351
  ## Troubleshooting
331
352
 
332
- **Thumb no se mueve**: Verifica `max`, `min` y `step` son números válidos
333
- **Value no actualiza**: En modo controlado usa `value` + `onValueChange`, no `defaultValue`
334
- **Range invertido**: Asegura `value[0] < value[1]` en ranges
335
- **Vertical no funciona**: Agrega `className="h-[Xpx]"` para altura explícita
336
- **Step no funciona**: `step` debe ser divisor válido del rango (max - min)
337
- **Multiple thumbs**: `value={[10, 50, 90]}` crea 3 thumbs
338
- **Color no se aplica**: Prop `colorSlide` acepta `"full"` o array de 2 strings `["#color1", "#color2"]`
353
+ **Thumb no se mueve**: Verifica `max`, `min` y `step` son números válidos
354
+ **Value no actualiza**: En modo controlado usa `value` + `onValueChange`, no `defaultValue`
355
+ **Range invertido**: Asegura `value[0] < value[1]` en ranges
356
+ **Vertical no funciona**: Agrega `className="h-[Xpx]"` para altura explícita
357
+ **Step no funciona**: `step` debe ser divisor válido del rango (max - min)
358
+ **Multiple thumbs**: `value={[10, 50, 90]}` crea 3 thumbs
359
+ **Color no se aplica**: Prop `colorSlide` acepta `"full"` o array de 2 strings `["#color1", "#color2"]`
339
360
  **Gradiente no visible**: Asegura que los colores sean válidos (hex, rgb, hsl, etc.)
340
361
  <Label>Blue to Green</Label>
341
362
  <Slider
@@ -361,7 +382,7 @@ function CustomColorSlider() {
361
382
  </div>
362
383
  );
363
384
  }
364
- ```
385
+ ````
365
386
 
366
387
  ### Control de Temperatura con Colores
367
388