@adamosuiteservices/ui 2.13.4 → 2.14.1

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 (63) hide show
  1. package/dist/{button-Bn4LFAa9.js → button-B0lWuG-D.js} +27 -18
  2. package/dist/{button-Day6_fbu.cjs → button-DVrteFz9.cjs} +2 -2
  3. package/dist/button.cjs +1 -1
  4. package/dist/button.js +1 -1
  5. package/dist/{calendar-B1_ybTg0.js → calendar-CfqtuOWv.js} +1 -1
  6. package/dist/{calendar-CZkzHgYi.cjs → calendar-CpUN6BGK.cjs} +1 -1
  7. package/dist/calendar.cjs +1 -1
  8. package/dist/calendar.js +1 -1
  9. package/dist/colors.css +1 -1
  10. package/dist/{combobox-BOi7QzmO.js → combobox-B8HMlZy6.js} +1 -1
  11. package/dist/{combobox-0ndFo07_.cjs → combobox-Btj-hiBy.cjs} +1 -1
  12. package/dist/combobox.cjs +1 -1
  13. package/dist/combobox.js +1 -1
  14. package/dist/components/ui/alert/alert.d.ts +1 -1
  15. package/dist/components/ui/button/button.d.ts +3 -2
  16. package/dist/components/ui/card/card.d.ts +2 -2
  17. package/dist/date-picker-selector.cjs +1 -1
  18. package/dist/date-picker-selector.js +3 -3
  19. package/dist/file-upload.cjs +1 -1
  20. package/dist/file-upload.js +1 -1
  21. package/dist/full-screen-loader.cjs +1 -1
  22. package/dist/full-screen-loader.js +1 -1
  23. package/dist/input-group.cjs +1 -1
  24. package/dist/input-group.js +1 -1
  25. package/dist/pagination.cjs +1 -1
  26. package/dist/pagination.js +1 -1
  27. package/dist/sidebar.cjs +1 -1
  28. package/dist/sidebar.js +1 -1
  29. package/dist/styles.css +1 -1
  30. package/dist/tabs.cjs +14 -16
  31. package/dist/tabs.js +17 -19
  32. package/docs/AI-GUIDE.md +321 -321
  33. package/docs/components/layout/full-screen-loader.md +2 -2
  34. package/docs/components/layout/sidebar.md +399 -399
  35. package/docs/components/layout/toaster.md +436 -436
  36. package/docs/components/ui/accordion-rounded.md +584 -584
  37. package/docs/components/ui/accordion.md +269 -269
  38. package/docs/components/ui/button.md +35 -23
  39. package/docs/components/ui/calendar.md +1159 -1159
  40. package/docs/components/ui/card.md +1455 -1455
  41. package/docs/components/ui/checkbox.md +292 -292
  42. package/docs/components/ui/collapsible.md +323 -323
  43. package/docs/components/ui/dialog.md +628 -628
  44. package/docs/components/ui/field.md +706 -706
  45. package/docs/components/ui/hover-card.md +446 -446
  46. package/docs/components/ui/kbd.md +434 -434
  47. package/docs/components/ui/label.md +359 -359
  48. package/docs/components/ui/pagination.md +650 -650
  49. package/docs/components/ui/popover.md +536 -536
  50. package/docs/components/ui/progress.md +182 -182
  51. package/docs/components/ui/radio-group.md +311 -311
  52. package/docs/components/ui/separator.md +214 -214
  53. package/docs/components/ui/sheet.md +174 -174
  54. package/docs/components/ui/skeleton.md +140 -140
  55. package/docs/components/ui/spinner.md +170 -170
  56. package/docs/components/ui/switch.md +408 -408
  57. package/docs/components/ui/tabs-underline.md +106 -106
  58. package/docs/components/ui/tabs.md +125 -122
  59. package/docs/components/ui/textarea.md +243 -243
  60. package/docs/components/ui/toggle.md +237 -237
  61. package/docs/components/ui/tooltip.md +317 -317
  62. package/docs/components/ui/typography.md +320 -320
  63. package/package.json +1 -1
@@ -1,243 +1,243 @@
1
- # Textarea
2
-
3
- Campo de texto multilínea con auto-resize. Wrapper nativo de `<textarea>` HTML.
4
-
5
- ## Descripción
6
-
7
- El componente `Textarea` proporciona un campo de entrada de texto multilínea.
8
-
9
- ## Importación
10
-
11
- ```typescript
12
- import { Textarea } from "@adamosuiteservices/ui/textarea";
13
- ```
14
-
15
- ## Anatomía
16
-
17
- ```tsx
18
- <Textarea placeholder="Type your message here." />
19
- ```
20
-
21
- **Componentes**: 1 (Textarea)
22
-
23
- ## Props
24
-
25
- | Prop | Tipo | Descripción |
26
- | -------------- | -------------------------- | ---------------------------- |
27
- | `placeholder` | `string` | Texto placeholder |
28
- | `value` | `string` | Valor controlado |
29
- | `defaultValue` | `string` | Valor inicial (uncontrolled) |
30
- | `onChange` | `(e: ChangeEvent) => void` | Callback al cambiar |
31
- | `disabled` | `boolean` | Deshabilita el textarea |
32
- | `readOnly` | `boolean` | Solo lectura |
33
- | `required` | `boolean` | Campo requerido |
34
- | `rows` | `number` | Número de filas |
35
- | `maxLength` | `number` | Longitud máxima |
36
- | `className` | `string` | Clases CSS adicionales |
37
-
38
- **Nota**: Acepta todas las props HTML de `<textarea>`
39
-
40
- ## Patrones de Uso
41
-
42
- ### Básico
43
-
44
- ```tsx
45
- import { Textarea } from "@adamosuiteservices/ui/textarea";
46
-
47
- <Textarea placeholder="Type your message here." />;
48
- ```
49
-
50
- ### Con Label
51
-
52
- ```tsx
53
- import { Label } from "@adamosuiteservices/ui/label";
54
-
55
- <div className="grid w-full gap-2">
56
- <Label htmlFor="message">Your message</Label>
57
- <Textarea placeholder="Type your message here." id="message" />
58
- </div>;
59
- ```
60
-
61
- ### Controlado con Contador
62
-
63
- ```tsx
64
- import { useState } from "react";
65
-
66
- function App() {
67
- const [value, setValue] = useState("");
68
-
69
- return (
70
- <div className="grid w-full gap-2">
71
- <Label htmlFor="feedback">
72
- Your feedback ({value.length}/500 characters)
73
- </Label>
74
- <Textarea
75
- id="feedback"
76
- placeholder="Share your thoughts..."
77
- value={value}
78
- onChange={(e) => setValue(e.target.value)}
79
- maxLength={500}
80
- />
81
- <div className="flex justify-between text-sm text-muted-foreground">
82
- <span>{value.length} characters</span>
83
- <span>{500 - value.length} remaining</span>
84
- </div>
85
- </div>
86
- );
87
- }
88
- ```
89
-
90
- ### Con Validación
91
-
92
- ```tsx
93
- import { Button } from "@adamosuiteservices/ui/button";
94
- import {
95
- Card,
96
- CardContent,
97
- CardFooter,
98
- CardHeader,
99
- CardTitle,
100
- } from "@adamosuiteservices/ui/card";
101
-
102
- function CommentForm() {
103
- const [comment, setComment] = useState("");
104
- const [error, setError] = useState("");
105
-
106
- const handleSubmit = () => {
107
- if (comment.trim().length < 10) {
108
- setError("Comment must be at least 10 characters long");
109
- return;
110
- }
111
- setError("");
112
- // Submit logic
113
- };
114
-
115
- return (
116
- <Card>
117
- <CardHeader>
118
- <CardTitle>Leave a Comment</CardTitle>
119
- </CardHeader>
120
- <CardContent className="space-y-2">
121
- <Textarea
122
- placeholder="What did you think?"
123
- value={comment}
124
- onChange={(e) => {
125
- setComment(e.target.value);
126
- if (error) setError("");
127
- }}
128
- aria-invalid={!!error}
129
- rows={4}
130
- />
131
- {error && <p className="text-destructive text-sm">{error}</p>}
132
- </CardContent>
133
- <CardFooter>
134
- <Button onClick={handleSubmit}>Submit Comment</Button>
135
- </CardFooter>
136
- </Card>
137
- );
138
- }
139
- ```
140
-
141
- ### Chat Input con Enter
142
-
143
- ```tsx
144
- function ChatInput() {
145
- const [message, setMessage] = useState("");
146
-
147
- const handleSend = () => {
148
- if (message.trim()) {
149
- // Send message logic
150
- setMessage("");
151
- }
152
- };
153
-
154
- const handleKeyDown = (e: React.KeyboardEvent) => {
155
- if (e.key === "Enter" && !e.shiftKey) {
156
- e.preventDefault();
157
- handleSend();
158
- }
159
- };
160
-
161
- return (
162
- <div className="relative">
163
- <Textarea
164
- placeholder="Type a message... (Enter to send, Shift+Enter for new line)"
165
- value={message}
166
- onChange={(e) => setMessage(e.target.value)}
167
- onKeyDown={handleKeyDown}
168
- rows={3}
169
- className="pr-12 resize-none"
170
- />
171
- <Button
172
- size="sm"
173
- className="absolute bottom-2 right-2"
174
- onClick={handleSend}
175
- >
176
- Send
177
- </Button>
178
- </div>
179
- );
180
- }
181
- ```
182
-
183
- ### Resize Options
184
-
185
- ```tsx
186
- // Auto-resize (default con field-sizing-content)
187
- <Textarea placeholder="Auto-resize..." className="min-h-[80px] resize-none" />
188
-
189
- // Manual resize (ambas direcciones)
190
- <Textarea placeholder="Drag corner to resize..." className="min-h-[80px] resize-both" />
191
-
192
- // Vertical resize only
193
- <Textarea placeholder="Resize vertically..." className="min-h-[80px] resize-y" />
194
-
195
- // No resize
196
- <Textarea placeholder="Fixed size..." rows={4} className="resize-none" />
197
- ```
198
-
199
- ## Casos de Uso
200
-
201
- **Comentarios**: Feedback, reviews, mensajes
202
- **Formularios**: Descripción, bio, notas
203
- **Chat**: Mensajes multilínea
204
- **Code editor**: Snippets de código
205
- **Feedback**: Formularios de opinión
206
-
207
- ## Estilos Base
208
-
209
- - **Min height**: `min-h-16` default
210
- - **Border**: `border-input` con `shadow-xs`
211
- - **Focus**: `ring-ring/50` con `ring-[3px]`
212
- - **Padding**: `px-3 py-2`
213
- - **Font**: `text-base` en móvil, `text-sm` en md+
214
- - **Field sizing**: `field-sizing-content` para auto-resize
215
- - **Invalid**: `border-destructive` con `ring-destructive/20`
216
-
217
- ## Accesibilidad
218
-
219
- - ✅ **Label**: Asociar con `htmlFor` e `id`
220
- - ✅ **ARIA**: `aria-invalid` para errores
221
- - ✅ **Placeholder**: No usar como label única
222
- - ✅ **Error messages**: Describir errores claramente
223
- - ✅ **Keyboard**: Enter, Tab, Shift+Enter funcionan nativamente
224
-
225
- ## Notas de Implementación
226
-
227
- - **HTML nativo**: Wrapper de `<textarea>` HTML nativo
228
- - **Field sizing**: `field-sizing-content` permite auto-resize basado en contenido
229
- - **No external library**: Sin dependencias de Radix UI
230
- - **Data attribute**: `data-slot="textarea"` para identificación
231
-
232
- ## Troubleshooting
233
-
234
- **No auto-resize**: Verifica `field-sizing-content` en className (Chrome 123+)
235
- **Resize manual no funciona**: Usa `resize-y`, `resize-both`, o remueve `resize-none`
236
- **Height fijo**: Usa prop `rows` para altura específica
237
- **Contador de caracteres**: Usa `value.length` y `maxLength`
238
- **Enter no funciona en chat**: Usa `onKeyDown` con `e.key === "Enter" && !e.shiftKey`
239
-
240
- ## Referencias
241
-
242
- - **MDN textarea**: <https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea>
243
- - **shadcn/ui Textarea**: <https://ui.shadcn.com/docs/components/textarea>
1
+ # Textarea
2
+
3
+ Campo de texto multilínea con auto-resize. Wrapper nativo de `<textarea>` HTML.
4
+
5
+ ## Descripción
6
+
7
+ El componente `Textarea` proporciona un campo de entrada de texto multilínea.
8
+
9
+ ## Importación
10
+
11
+ ```typescript
12
+ import { Textarea } from "@adamosuiteservices/ui/textarea";
13
+ ```
14
+
15
+ ## Anatomía
16
+
17
+ ```tsx
18
+ <Textarea placeholder="Type your message here." />
19
+ ```
20
+
21
+ **Componentes**: 1 (Textarea)
22
+
23
+ ## Props
24
+
25
+ | Prop | Tipo | Descripción |
26
+ | -------------- | -------------------------- | ---------------------------- |
27
+ | `placeholder` | `string` | Texto placeholder |
28
+ | `value` | `string` | Valor controlado |
29
+ | `defaultValue` | `string` | Valor inicial (uncontrolled) |
30
+ | `onChange` | `(e: ChangeEvent) => void` | Callback al cambiar |
31
+ | `disabled` | `boolean` | Deshabilita el textarea |
32
+ | `readOnly` | `boolean` | Solo lectura |
33
+ | `required` | `boolean` | Campo requerido |
34
+ | `rows` | `number` | Número de filas |
35
+ | `maxLength` | `number` | Longitud máxima |
36
+ | `className` | `string` | Clases CSS adicionales |
37
+
38
+ **Nota**: Acepta todas las props HTML de `<textarea>`
39
+
40
+ ## Patrones de Uso
41
+
42
+ ### Básico
43
+
44
+ ```tsx
45
+ import { Textarea } from "@adamosuiteservices/ui/textarea";
46
+
47
+ <Textarea placeholder="Type your message here." />;
48
+ ```
49
+
50
+ ### Con Label
51
+
52
+ ```tsx
53
+ import { Label } from "@adamosuiteservices/ui/label";
54
+
55
+ <div className="grid w-full gap-2">
56
+ <Label htmlFor="message">Your message</Label>
57
+ <Textarea placeholder="Type your message here." id="message" />
58
+ </div>;
59
+ ```
60
+
61
+ ### Controlado con Contador
62
+
63
+ ```tsx
64
+ import { useState } from "react";
65
+
66
+ function App() {
67
+ const [value, setValue] = useState("");
68
+
69
+ return (
70
+ <div className="grid w-full gap-2">
71
+ <Label htmlFor="feedback">
72
+ Your feedback ({value.length}/500 characters)
73
+ </Label>
74
+ <Textarea
75
+ id="feedback"
76
+ placeholder="Share your thoughts..."
77
+ value={value}
78
+ onChange={(e) => setValue(e.target.value)}
79
+ maxLength={500}
80
+ />
81
+ <div className="flex justify-between text-sm text-muted-foreground">
82
+ <span>{value.length} characters</span>
83
+ <span>{500 - value.length} remaining</span>
84
+ </div>
85
+ </div>
86
+ );
87
+ }
88
+ ```
89
+
90
+ ### Con Validación
91
+
92
+ ```tsx
93
+ import { Button } from "@adamosuiteservices/ui/button";
94
+ import {
95
+ Card,
96
+ CardContent,
97
+ CardFooter,
98
+ CardHeader,
99
+ CardTitle,
100
+ } from "@adamosuiteservices/ui/card";
101
+
102
+ function CommentForm() {
103
+ const [comment, setComment] = useState("");
104
+ const [error, setError] = useState("");
105
+
106
+ const handleSubmit = () => {
107
+ if (comment.trim().length < 10) {
108
+ setError("Comment must be at least 10 characters long");
109
+ return;
110
+ }
111
+ setError("");
112
+ // Submit logic
113
+ };
114
+
115
+ return (
116
+ <Card>
117
+ <CardHeader>
118
+ <CardTitle>Leave a Comment</CardTitle>
119
+ </CardHeader>
120
+ <CardContent className="space-y-2">
121
+ <Textarea
122
+ placeholder="What did you think?"
123
+ value={comment}
124
+ onChange={(e) => {
125
+ setComment(e.target.value);
126
+ if (error) setError("");
127
+ }}
128
+ aria-invalid={!!error}
129
+ rows={4}
130
+ />
131
+ {error && <p className="text-destructive text-sm">{error}</p>}
132
+ </CardContent>
133
+ <CardFooter>
134
+ <Button onClick={handleSubmit}>Submit Comment</Button>
135
+ </CardFooter>
136
+ </Card>
137
+ );
138
+ }
139
+ ```
140
+
141
+ ### Chat Input con Enter
142
+
143
+ ```tsx
144
+ function ChatInput() {
145
+ const [message, setMessage] = useState("");
146
+
147
+ const handleSend = () => {
148
+ if (message.trim()) {
149
+ // Send message logic
150
+ setMessage("");
151
+ }
152
+ };
153
+
154
+ const handleKeyDown = (e: React.KeyboardEvent) => {
155
+ if (e.key === "Enter" && !e.shiftKey) {
156
+ e.preventDefault();
157
+ handleSend();
158
+ }
159
+ };
160
+
161
+ return (
162
+ <div className="relative">
163
+ <Textarea
164
+ placeholder="Type a message... (Enter to send, Shift+Enter for new line)"
165
+ value={message}
166
+ onChange={(e) => setMessage(e.target.value)}
167
+ onKeyDown={handleKeyDown}
168
+ rows={3}
169
+ className="pr-12 resize-none"
170
+ />
171
+ <Button
172
+ size="sm"
173
+ className="absolute bottom-2 right-2"
174
+ onClick={handleSend}
175
+ >
176
+ Send
177
+ </Button>
178
+ </div>
179
+ );
180
+ }
181
+ ```
182
+
183
+ ### Resize Options
184
+
185
+ ```tsx
186
+ // Auto-resize (default con field-sizing-content)
187
+ <Textarea placeholder="Auto-resize..." className="min-h-[80px] resize-none" />
188
+
189
+ // Manual resize (ambas direcciones)
190
+ <Textarea placeholder="Drag corner to resize..." className="min-h-[80px] resize-both" />
191
+
192
+ // Vertical resize only
193
+ <Textarea placeholder="Resize vertically..." className="min-h-[80px] resize-y" />
194
+
195
+ // No resize
196
+ <Textarea placeholder="Fixed size..." rows={4} className="resize-none" />
197
+ ```
198
+
199
+ ## Casos de Uso
200
+
201
+ **Comentarios**: Feedback, reviews, mensajes
202
+ **Formularios**: Descripción, bio, notas
203
+ **Chat**: Mensajes multilínea
204
+ **Code editor**: Snippets de código
205
+ **Feedback**: Formularios de opinión
206
+
207
+ ## Estilos Base
208
+
209
+ - **Min height**: `min-h-16` default
210
+ - **Border**: `border-input` con `shadow-xs`
211
+ - **Focus**: `ring-ring/50` con `ring-[3px]`
212
+ - **Padding**: `px-3 py-2`
213
+ - **Font**: `text-base` en móvil, `text-sm` en md+
214
+ - **Field sizing**: `field-sizing-content` para auto-resize
215
+ - **Invalid**: `border-destructive` con `ring-destructive/20`
216
+
217
+ ## Accesibilidad
218
+
219
+ - ✅ **Label**: Asociar con `htmlFor` e `id`
220
+ - ✅ **ARIA**: `aria-invalid` para errores
221
+ - ✅ **Placeholder**: No usar como label única
222
+ - ✅ **Error messages**: Describir errores claramente
223
+ - ✅ **Keyboard**: Enter, Tab, Shift+Enter funcionan nativamente
224
+
225
+ ## Notas de Implementación
226
+
227
+ - **HTML nativo**: Wrapper de `<textarea>` HTML nativo
228
+ - **Field sizing**: `field-sizing-content` permite auto-resize basado en contenido
229
+ - **No external library**: Sin dependencias de Radix UI
230
+ - **Data attribute**: `data-slot="textarea"` para identificación
231
+
232
+ ## Troubleshooting
233
+
234
+ **No auto-resize**: Verifica `field-sizing-content` en className (Chrome 123+)
235
+ **Resize manual no funciona**: Usa `resize-y`, `resize-both`, o remueve `resize-none`
236
+ **Height fijo**: Usa prop `rows` para altura específica
237
+ **Contador de caracteres**: Usa `value.length` y `maxLength`
238
+ **Enter no funciona en chat**: Usa `onKeyDown` con `e.key === "Enter" && !e.shiftKey`
239
+
240
+ ## Referencias
241
+
242
+ - **MDN textarea**: <https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea>
243
+ - **shadcn/ui Textarea**: <https://ui.shadcn.com/docs/components/textarea>