@adamosuiteservices/ui 2.14.1 → 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.
- package/dist/combobox-DGuQtXjP.js +608 -0
- package/dist/combobox-hTCtPMUL.cjs +40 -0
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.js +1 -1
- package/dist/components/ui/combobox/combobox.d.ts +7 -1
- package/dist/components/ui/date-picker-selector/date-picker-selector.d.ts +75 -1
- package/dist/components/ui/file-upload/file-upload.d.ts +3 -1
- package/dist/components/ui/slider/slider.d.ts +1 -1
- package/dist/components/ui/switch/switch.d.ts +1 -1
- package/dist/date-picker-selector.cjs +1 -1
- package/dist/date-picker-selector.js +81 -78
- package/dist/field.cjs +2 -2
- package/dist/field.js +2 -2
- package/dist/file-upload.cjs +5 -3
- package/dist/file-upload.js +178 -149
- package/dist/slider.cjs +5 -5
- package/dist/slider.js +196 -177
- package/dist/styles.css +1 -1
- package/dist/switch.cjs +3 -3
- package/dist/switch.js +105 -85
- package/docs/components/ui/accordion-rounded.md +2 -6
- package/docs/components/ui/avatar.md +3 -1
- package/docs/components/ui/button.md +22 -16
- package/docs/components/ui/card.md +49 -31
- package/docs/components/ui/checkbox.md +44 -8
- package/docs/components/ui/combobox.md +100 -0
- package/docs/components/ui/date-picker-selector.md +147 -28
- package/docs/components/ui/file-upload.md +241 -94
- package/docs/components/ui/icon.md +1 -1
- package/docs/components/ui/input.md +4 -1
- package/docs/components/ui/radio-group.md +1 -1
- package/docs/components/ui/select.md +51 -34
- package/docs/components/ui/sheet.md +3 -9
- package/docs/components/ui/slider.md +120 -99
- package/docs/components/ui/switch.md +408 -408
- package/docs/components/ui/textarea.md +37 -22
- package/docs/components/ui/tooltip.md +5 -2
- package/docs/components/ui/typography.md +63 -39
- package/package.json +1 -1
- package/dist/combobox-B8HMlZy6.js +0 -601
- package/dist/combobox-Btj-hiBy.cjs +0 -40
|
@@ -50,12 +50,21 @@ import { Textarea } from "@adamosuiteservices/ui/textarea";
|
|
|
50
50
|
### Con Label
|
|
51
51
|
|
|
52
52
|
```tsx
|
|
53
|
-
import {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
import {
|
|
54
|
+
Field,
|
|
55
|
+
FieldContent,
|
|
56
|
+
FieldGroup,
|
|
57
|
+
FieldLabel,
|
|
58
|
+
} from "@adamosuiteservices/ui/field";
|
|
59
|
+
|
|
60
|
+
<FieldGroup className="max-w-sm">
|
|
61
|
+
<Field>
|
|
62
|
+
<FieldLabel htmlFor="message">Your message</FieldLabel>
|
|
63
|
+
<FieldContent>
|
|
64
|
+
<Textarea placeholder="Type your message here." id="message" />
|
|
65
|
+
</FieldContent>
|
|
66
|
+
</Field>
|
|
67
|
+
</FieldGroup>;
|
|
59
68
|
```
|
|
60
69
|
|
|
61
70
|
### Controlado con Contador
|
|
@@ -67,22 +76,28 @@ function App() {
|
|
|
67
76
|
const [value, setValue] = useState("");
|
|
68
77
|
|
|
69
78
|
return (
|
|
70
|
-
<
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
79
|
+
<FieldGroup className="max-w-sm">
|
|
80
|
+
<Field>
|
|
81
|
+
<FieldLabel htmlFor="feedback">
|
|
82
|
+
Your feedback ({value.length}/500 characters)
|
|
83
|
+
</FieldLabel>
|
|
84
|
+
<FieldContent>
|
|
85
|
+
<Textarea
|
|
86
|
+
id="feedback"
|
|
87
|
+
placeholder="Share your thoughts..."
|
|
88
|
+
value={value}
|
|
89
|
+
onChange={(e) => setValue(e.target.value)}
|
|
90
|
+
maxLength={500}
|
|
91
|
+
/>
|
|
92
|
+
</FieldContent>
|
|
93
|
+
<FieldDescription>
|
|
94
|
+
<div className="flex justify-between text-xs">
|
|
95
|
+
<span>{value.length} characters</span>
|
|
96
|
+
<span>{500 - value.length} remaining</span>
|
|
97
|
+
</div>
|
|
98
|
+
</FieldDescription>
|
|
99
|
+
</Field>
|
|
100
|
+
</FieldGroup>
|
|
86
101
|
);
|
|
87
102
|
}
|
|
88
103
|
```
|
|
@@ -210,7 +210,7 @@ Para múltiples tooltips, usa TooltipProvider:
|
|
|
210
210
|
<p>Delete permanently</p>
|
|
211
211
|
</TooltipContent>
|
|
212
212
|
</Tooltip>
|
|
213
|
-
</div
|
|
213
|
+
</div>
|
|
214
214
|
```
|
|
215
215
|
|
|
216
216
|
### Form Help Icons
|
|
@@ -224,7 +224,10 @@ import { Input } from "@adamosuiteservices/ui/input";
|
|
|
224
224
|
<Label htmlFor="username">Username</Label>
|
|
225
225
|
<Tooltip>
|
|
226
226
|
<TooltipTrigger asChild>
|
|
227
|
-
<Icon
|
|
227
|
+
<Icon
|
|
228
|
+
symbol="help"
|
|
229
|
+
className="cursor-help text-lg text-muted-foreground"
|
|
230
|
+
/>
|
|
228
231
|
</TooltipTrigger>
|
|
229
232
|
<TooltipContent>
|
|
230
233
|
<p>
|
|
@@ -18,12 +18,12 @@ import { Typography } from "@adamosuiteservices/ui/typography";
|
|
|
18
18
|
|
|
19
19
|
## Props
|
|
20
20
|
|
|
21
|
-
| Prop | Tipo
|
|
22
|
-
| ----------- |
|
|
23
|
-
| `variant` | `"lg" \| "md" \| "sm" \| "xs" \| "caption"`
|
|
21
|
+
| Prop | Tipo | Default | Descripción |
|
|
22
|
+
| ----------- | ---------------------------------------------------------------------------------------------------------- | ----------- | --------------------------------------- |
|
|
23
|
+
| `variant` | `"lg" \| "md" \| "sm" \| "xs" \| "caption"` | `"sm"` | Tamaño del texto |
|
|
24
24
|
| `color` | `"default" \| "muted" \| "primary" \| "success" \| "warning" \| "destructive" \| "waiting" \| "secondary"` | `"default"` | Color del texto |
|
|
25
|
-
| `asChild` | `boolean`
|
|
26
|
-
| `className` | `string`
|
|
25
|
+
| `asChild` | `boolean` | `false` | Renderiza como child element (usa Slot) |
|
|
26
|
+
| `className` | `string` | - | Clases CSS adicionales |
|
|
27
27
|
|
|
28
28
|
**Nota**: Acepta todas las props de `<p>` cuando `asChild=false`
|
|
29
29
|
|
|
@@ -31,26 +31,26 @@ import { Typography } from "@adamosuiteservices/ui/typography";
|
|
|
31
31
|
|
|
32
32
|
### Tamaños
|
|
33
33
|
|
|
34
|
-
| Variante | Font Size | Uso
|
|
35
|
-
| --------- | ------------- |
|
|
36
|
-
| `lg` | `text-lg` | Headings, texto enfatizado
|
|
37
|
-
| `md` | `text-base` | Body text
|
|
34
|
+
| Variante | Font Size | Uso |
|
|
35
|
+
| --------- | ------------- | -------------------------------- |
|
|
36
|
+
| `lg` | `text-lg` | Headings, texto enfatizado |
|
|
37
|
+
| `md` | `text-base` | Body text |
|
|
38
38
|
| `sm` | `text-sm` | Secondary text, labels (default) |
|
|
39
|
-
| `xs` | `text-xs` | Fine print, detalles
|
|
40
|
-
| `caption` | `text-[11px]` | Captions, metadata
|
|
39
|
+
| `xs` | `text-xs` | Fine print, detalles |
|
|
40
|
+
| `caption` | `text-[11px]` | Captions, metadata |
|
|
41
41
|
|
|
42
42
|
### Colores
|
|
43
43
|
|
|
44
|
-
| Color | Clase CSS
|
|
45
|
-
| ------------- |
|
|
46
|
-
| `default` | `text-foreground`
|
|
47
|
-
| `muted` | `text-muted-foreground`
|
|
48
|
-
| `primary` | `text-primary`
|
|
49
|
-
| `success` | `text-success`
|
|
50
|
-
| `warning` | `text-warning`
|
|
51
|
-
| `destructive` | `text-destructive`
|
|
52
|
-
| `waiting` | `text-waiting`
|
|
53
|
-
| `secondary` | `text-secondary-foreground` | Texto secundario alternativo
|
|
44
|
+
| Color | Clase CSS | Uso |
|
|
45
|
+
| ------------- | --------------------------- | --------------------------------- |
|
|
46
|
+
| `default` | `text-foreground` | Texto principal (default) |
|
|
47
|
+
| `muted` | `text-muted-foreground` | Texto secundario |
|
|
48
|
+
| `primary` | `text-primary` | Texto con color de marca |
|
|
49
|
+
| `success` | `text-success` | Mensajes de éxito, confirmaciones |
|
|
50
|
+
| `warning` | `text-warning` | Advertencias, precauciones |
|
|
51
|
+
| `destructive` | `text-destructive` | Errores, acciones destructivas |
|
|
52
|
+
| `waiting` | `text-waiting` | Estados pendientes, en progreso |
|
|
53
|
+
| `secondary` | `text-secondary-foreground` | Texto secundario alternativo |
|
|
54
54
|
|
|
55
55
|
## Patrones de Uso
|
|
56
56
|
|
|
@@ -225,45 +225,69 @@ import { Typography } from "@adamosuiteservices/ui/typography";
|
|
|
225
225
|
### Uso de Colores
|
|
226
226
|
|
|
227
227
|
```tsx
|
|
228
|
-
{
|
|
228
|
+
{
|
|
229
|
+
/* ✅ Correcto - Color default para contenido principal */
|
|
230
|
+
}
|
|
229
231
|
<Typography variant="md" color="default">
|
|
230
232
|
This is the main content that users should read.
|
|
231
|
-
</Typography
|
|
233
|
+
</Typography>;
|
|
232
234
|
|
|
233
|
-
{
|
|
235
|
+
{
|
|
236
|
+
/* ✅ Correcto - Color muted para información secundaria */
|
|
237
|
+
}
|
|
234
238
|
<Typography variant="sm" color="muted">
|
|
235
239
|
Optional description or helper text.
|
|
236
|
-
</Typography
|
|
240
|
+
</Typography>;
|
|
237
241
|
|
|
238
|
-
{
|
|
242
|
+
{
|
|
243
|
+
/* ✅ Correcto - Combinar tamaño y color apropiadamente */
|
|
244
|
+
}
|
|
239
245
|
<div>
|
|
240
|
-
<Typography variant="lg" color="default">
|
|
241
|
-
|
|
242
|
-
</
|
|
246
|
+
<Typography variant="lg" color="default">
|
|
247
|
+
Main Heading
|
|
248
|
+
</Typography>
|
|
249
|
+
<Typography variant="sm" color="muted">
|
|
250
|
+
Subtitle or description
|
|
251
|
+
</Typography>
|
|
252
|
+
</div>;
|
|
243
253
|
|
|
244
|
-
{
|
|
254
|
+
{
|
|
255
|
+
/* ⚠️ Evitar - Color muted en contenido principal */
|
|
256
|
+
}
|
|
245
257
|
<Typography variant="md" color="muted">
|
|
246
258
|
Important information that should be easily readable
|
|
247
|
-
</Typography
|
|
259
|
+
</Typography>;
|
|
248
260
|
```
|
|
249
261
|
|
|
250
262
|
### Jerarquía Visual
|
|
251
263
|
|
|
252
264
|
```tsx
|
|
253
|
-
{
|
|
265
|
+
{
|
|
266
|
+
/* ✅ Correcto - Jerarquía clara con tamaño y color */
|
|
267
|
+
}
|
|
254
268
|
<article>
|
|
255
|
-
<Typography variant="lg" color="default">
|
|
256
|
-
|
|
269
|
+
<Typography variant="lg" color="default">
|
|
270
|
+
Article Title
|
|
271
|
+
</Typography>
|
|
272
|
+
<Typography variant="sm" color="muted">
|
|
273
|
+
Published 2 hours ago
|
|
274
|
+
</Typography>
|
|
257
275
|
<Typography variant="md" color="default">
|
|
258
276
|
Article content goes here with proper emphasis.
|
|
259
277
|
</Typography>
|
|
260
|
-
</article
|
|
278
|
+
</article>;
|
|
261
279
|
|
|
262
|
-
{
|
|
280
|
+
{
|
|
281
|
+
/* ✅ Correcto - Lista con estados */
|
|
282
|
+
}
|
|
263
283
|
<div>
|
|
264
|
-
<Typography variant="md" color="default">
|
|
265
|
-
|
|
266
|
-
</
|
|
284
|
+
<Typography variant="md" color="default">
|
|
285
|
+
Active item
|
|
286
|
+
</Typography>
|
|
287
|
+
<Typography variant="md" color="muted">
|
|
288
|
+
Inactive item
|
|
289
|
+
</Typography>
|
|
290
|
+
</div>;
|
|
267
291
|
```
|
|
268
292
|
|
|
269
293
|
## Estilos Base
|