@adamosuiteservices/ui 1.2.5 → 1.4.5
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/accordion-rounded.cjs +1 -1
- package/dist/accordion-rounded.js +1 -1
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.js +1 -1
- package/dist/avatar.cjs +1 -1
- package/dist/avatar.js +1 -1
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +1 -1
- package/dist/breadcrumb.cjs +1 -0
- package/dist/breadcrumb.js +105 -0
- package/dist/{button-C1n6snOY.js → button-2GdKenQI.js} +1 -1
- package/dist/{button-BV-_FVKZ.cjs → button-DEQVHMrX.cjs} +1 -1
- package/dist/button-group.cjs +1 -1
- package/dist/button-group.js +2 -2
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.js +1 -1
- package/dist/{checkbox-BrmXPKTn.js → checkbox-Dr487kAg.js} +3 -3
- package/dist/{checkbox-Lq-HvSgc.cjs → checkbox-YWAnswaW.cjs} +1 -1
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/collapsible.cjs +1 -1
- package/dist/collapsible.js +1 -1
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.js +6 -6
- package/dist/components/layout/sidebar/sidebar.d.ts +7 -3
- package/dist/components/ui/badge/badge.d.ts +1 -1
- package/dist/components/ui/breadcrumb/breadcrumb.d.ts +11 -0
- package/dist/components/ui/breadcrumb/breadcrumb.stories.d.ts +26 -0
- package/dist/components/ui/breadcrumb/index.d.ts +1 -0
- package/dist/components/ui/button/button.d.ts +2 -2
- package/dist/components/ui/dialog/dialog.d.ts +2 -1
- package/dist/components/ui/input-group/input-group.d.ts +1 -1
- package/dist/components/ui/toggle/toggle.d.ts +1 -1
- package/dist/components/ui/typography/typography.d.ts +1 -1
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.js +2 -2
- package/dist/custom-layered-styles.css +1 -1
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +33 -19
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.js +3 -3
- package/dist/ellipsis-CryjZKZn.js +15 -0
- package/dist/ellipsis-Ct9VTDOG.cjs +6 -0
- package/dist/field.cjs +1 -1
- package/dist/field.js +2 -2
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.js +6 -6
- package/dist/{index-CAOY367Y.js → index-B0M7VOwp.js} +2 -2
- package/dist/{index-B-ZRqW0J.js → index-BBoIAjAs.js} +3 -3
- package/dist/{index-gO_QEiaK.cjs → index-BDs8lUfq.cjs} +1 -1
- package/dist/index-BFyr34mw.cjs +5 -0
- package/dist/index-BMWt1NBG.js +79 -0
- package/dist/{index-yR-v1A4G.js → index-BX9hz-JD.js} +1 -1
- package/dist/{index-BGiGvaq8.cjs → index-BcGMAmWE.cjs} +1 -1
- package/dist/{index-IKJMQref.cjs → index-Bd0gQB0k.cjs} +1 -1
- package/dist/{index-VIUqZjyP.cjs → index-BeWgla7c.cjs} +1 -1
- package/dist/{index-EUea2gfp.js → index-BpWB3aFK.js} +1 -1
- package/dist/index-BvLQnI56.js +59 -0
- package/dist/{index-CwUFT-GQ.js → index-C0YiLSjW.js} +4 -4
- package/dist/{index-o0sNTcKe.js → index-CBjZooac.js} +2 -2
- package/dist/{index-DnS_sBBe.cjs → index-COuvjZLM.cjs} +1 -1
- package/dist/index-CTjlbbt9.cjs +1 -0
- package/dist/index-CUWMxxKG.js +97 -0
- package/dist/{index-C329e3yQ.js → index-CZZ3llmi.js} +2 -2
- package/dist/index-CjyiloO7.cjs +1 -0
- package/dist/{index-D3wSWKST.cjs → index-Cmx9M9cZ.cjs} +1 -1
- package/dist/index-CocSS1YK.cjs +1 -0
- package/dist/index-CzRiuk60.cjs +1 -0
- package/dist/index-DFPDUUq7.js +658 -0
- package/dist/{index-D3S7dBDI.cjs → index-DIwmXz1u.cjs} +1 -1
- package/dist/index-DLcqcWxM.js +29 -0
- package/dist/index-DMLQL2aG.js +286 -0
- package/dist/{index-DXQ-7kNJ.cjs → index-DMs8RL3E.cjs} +1 -1
- package/dist/{index-Ce3QBKyj.cjs → index-Dbj9vHNq.cjs} +1 -1
- package/dist/{index-BRLtxFFr.cjs → index-DmGzwG2z.cjs} +1 -1
- package/dist/{index-P1sVIHE3.js → index-PYkEXTqJ.js} +1 -1
- package/dist/{index-DulPG3F9.js → index-Se4vRnIO.js} +3 -3
- package/dist/index-_XxjJPRD.cjs +1 -0
- package/dist/{index-B-cHTKrs.js → index-yWvyIlmA.js} +4 -4
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.js +1 -1
- package/dist/{label-Cne2J57f.cjs → label-BjXORCBM.cjs} +1 -1
- package/dist/{label-Ky8qBEC3.js → label-CmwGvhy1.js} +1 -1
- package/dist/label.cjs +1 -1
- package/dist/label.js +1 -1
- package/dist/pagination.cjs +1 -6
- package/dist/pagination.js +58 -69
- package/dist/popover-3rIoNCXs.js +306 -0
- package/dist/popover-FCKBtFo-.cjs +1 -0
- package/dist/popover.cjs +1 -1
- package/dist/popover.js +1 -1
- package/dist/progress.cjs +1 -1
- package/dist/progress.js +1 -1
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +5 -5
- package/dist/select.cjs +2 -2
- package/dist/select.js +585 -542
- package/dist/{separator-CGnu_jIu.cjs → separator-BaZqZZ9R.cjs} +1 -1
- package/dist/{separator-BH73A90k.js → separator-DR7lQjv9.js} +1 -1
- package/dist/separator.cjs +1 -1
- package/dist/separator.js +1 -1
- package/dist/{sheet-CcxnJ6LH.cjs → sheet-CU-sFSaJ.cjs} +1 -1
- package/dist/{sheet-_DVpQIVF.js → sheet-UZWAbdXr.js} +1 -1
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.js +1 -1
- package/dist/sidebar.cjs +2 -2
- package/dist/sidebar.js +89 -78
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +3 -3
- package/dist/styles.css +1 -1
- package/dist/switch.cjs +1 -1
- package/dist/switch.js +2 -2
- package/dist/tabs-underline.cjs +1 -1
- package/dist/tabs-underline.js +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/toaster.cjs +1 -1
- package/dist/toaster.js +1 -1
- package/dist/toggle.cjs +1 -1
- package/dist/toggle.js +1 -1
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.js +114 -108
- package/dist/typography.cjs +1 -1
- package/dist/typography.js +1 -1
- package/docs/AI-GUIDE.md +321 -0
- package/docs/components/layout/sidebar.md +404 -0
- package/docs/components/layout/toaster.md +436 -0
- package/docs/components/ui/accordion-rounded.md +583 -0
- package/docs/components/ui/accordion.md +267 -0
- package/docs/components/ui/alert.md +671 -0
- package/docs/components/ui/avatar.md +588 -0
- package/docs/components/ui/badge.md +1024 -0
- package/docs/components/ui/breadcrumb.md +614 -0
- package/docs/components/ui/button-group.md +1002 -0
- package/docs/components/ui/button.md +1078 -0
- package/docs/components/ui/calendar.md +1159 -0
- package/docs/components/ui/card.md +1265 -0
- package/docs/components/ui/checkbox.md +292 -0
- package/docs/components/ui/collapsible.md +320 -0
- package/docs/components/ui/combobox.md +328 -0
- package/docs/components/ui/command.md +454 -0
- package/docs/components/ui/context-menu.md +540 -0
- package/docs/components/ui/dialog.md +628 -0
- package/docs/components/ui/dropdown-menu.md +731 -0
- package/docs/components/ui/field.md +706 -0
- package/docs/components/ui/hover-card.md +446 -0
- package/docs/components/ui/input-group.md +509 -0
- package/docs/components/ui/input.md +362 -0
- package/docs/components/ui/kbd.md +434 -0
- package/docs/components/ui/label.md +359 -0
- package/docs/components/ui/pagination.md +650 -0
- package/docs/components/ui/popover.md +536 -0
- package/docs/components/ui/progress.md +182 -0
- package/docs/components/ui/radio-group.md +311 -0
- package/docs/components/ui/select.md +352 -0
- package/docs/components/ui/separator.md +214 -0
- package/docs/components/ui/sheet.md +142 -0
- package/docs/components/ui/skeleton.md +140 -0
- package/docs/components/ui/slider.md +341 -0
- package/docs/components/ui/spinner.md +170 -0
- package/docs/components/ui/switch.md +402 -0
- package/docs/components/ui/table.md +183 -0
- package/docs/components/ui/tabs-underline.md +106 -0
- package/docs/components/ui/tabs.md +122 -0
- package/docs/components/ui/textarea.md +243 -0
- package/docs/components/ui/toggle.md +243 -0
- package/docs/components/ui/tooltip.md +320 -0
- package/docs/components/ui/typography.md +191 -0
- package/package.json +11 -5
- package/dist/index-6oTEokEx.js +0 -82
- package/dist/index-B-NyefE0.js +0 -243
- package/dist/index-BKbK2GzY.cjs +0 -1
- package/dist/index-BMitW9UR.cjs +0 -1
- package/dist/index-BpvjJ_T6.cjs +0 -5
- package/dist/index-C5wjudc-.js +0 -36
- package/dist/index-CezwiPd_.js +0 -615
- package/dist/index-D02K8KOB.js +0 -54
- package/dist/index-D7hQvndv.cjs +0 -1
- package/dist/index-DQvx1rG_.cjs +0 -1
- package/dist/popover-BjdTqaB8.cjs +0 -1
- package/dist/popover-EnVfE0YA.js +0 -263
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
# Tooltip
|
|
2
|
+
|
|
3
|
+
Mensaje flotante informativo en hover/focus. Basado en Radix UI con arrow.
|
|
4
|
+
|
|
5
|
+
## Descripción
|
|
6
|
+
|
|
7
|
+
El componente `Tooltip` muestra información adicional al hacer hover sobre un elemento.
|
|
8
|
+
|
|
9
|
+
## Importación
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
import {
|
|
13
|
+
Tooltip,
|
|
14
|
+
TooltipContent,
|
|
15
|
+
TooltipProvider,
|
|
16
|
+
TooltipTrigger,
|
|
17
|
+
} from "@adamosuiteservices/ui/tooltip";
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Anatomía
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
<Tooltip>
|
|
24
|
+
<TooltipTrigger>Hover me</TooltipTrigger>
|
|
25
|
+
<TooltipContent>
|
|
26
|
+
<p>Tooltip content</p>
|
|
27
|
+
</TooltipContent>
|
|
28
|
+
</Tooltip>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Componentes**: 4 (TooltipProvider, Tooltip, TooltipTrigger, TooltipContent)
|
|
32
|
+
|
|
33
|
+
## Props
|
|
34
|
+
|
|
35
|
+
### Tooltip (Root)
|
|
36
|
+
|
|
37
|
+
| Prop | Tipo | Descripción |
|
|
38
|
+
| --------------- | ------------------------- | --------------------------------------- |
|
|
39
|
+
| `open` | `boolean` | Estado controlado |
|
|
40
|
+
| `defaultOpen` | `boolean` | Estado inicial |
|
|
41
|
+
| `onOpenChange` | `(open: boolean) => void` | Callback al cambiar |
|
|
42
|
+
| `delayDuration` | `number` | Delay antes de mostrar (ms, default: 0) |
|
|
43
|
+
|
|
44
|
+
### TooltipTrigger
|
|
45
|
+
|
|
46
|
+
| Prop | Tipo | Descripción |
|
|
47
|
+
| --------- | --------- | ---------------------------- |
|
|
48
|
+
| `asChild` | `boolean` | Renderiza como child element |
|
|
49
|
+
|
|
50
|
+
### TooltipContent
|
|
51
|
+
|
|
52
|
+
| Prop | Tipo | Descripción |
|
|
53
|
+
| ------------ | ---------------------------------------- | ------------------------------------- |
|
|
54
|
+
| `side` | `"top" \| "right" \| "bottom" \| "left"` | Posición del tooltip |
|
|
55
|
+
| `sideOffset` | `number` | Offset desde trigger (px, default: 0) |
|
|
56
|
+
| `align` | `"start" \| "center" \| "end"` | Alineación |
|
|
57
|
+
| `className` | `string` | Clases CSS adicionales |
|
|
58
|
+
|
|
59
|
+
### TooltipProvider
|
|
60
|
+
|
|
61
|
+
| Prop | Tipo | Descripción |
|
|
62
|
+
| --------------- | -------- | ----------------------------- |
|
|
63
|
+
| `delayDuration` | `number` | Delay global (ms, default: 0) |
|
|
64
|
+
|
|
65
|
+
## Patrones de Uso
|
|
66
|
+
|
|
67
|
+
### Básico
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
import {
|
|
71
|
+
Tooltip,
|
|
72
|
+
TooltipContent,
|
|
73
|
+
TooltipTrigger,
|
|
74
|
+
} from "@adamosuiteservices/ui/tooltip";
|
|
75
|
+
import { Button } from "@adamosuiteservices/ui/button";
|
|
76
|
+
|
|
77
|
+
<Tooltip>
|
|
78
|
+
<TooltipTrigger asChild>
|
|
79
|
+
<Button variant="outline">Hover</Button>
|
|
80
|
+
</TooltipTrigger>
|
|
81
|
+
<TooltipContent>
|
|
82
|
+
<p>Add to library</p>
|
|
83
|
+
</TooltipContent>
|
|
84
|
+
</Tooltip>;
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Con Icono
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
import { InfoIcon } from "lucide-react";
|
|
91
|
+
|
|
92
|
+
<Tooltip>
|
|
93
|
+
<TooltipTrigger asChild>
|
|
94
|
+
<Button variant="outline" size="icon">
|
|
95
|
+
<InfoIcon className="h-4 w-4" />
|
|
96
|
+
</Button>
|
|
97
|
+
</TooltipTrigger>
|
|
98
|
+
<TooltipContent>
|
|
99
|
+
<p>More information</p>
|
|
100
|
+
</TooltipContent>
|
|
101
|
+
</Tooltip>;
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Posiciones
|
|
105
|
+
|
|
106
|
+
```tsx
|
|
107
|
+
// Top (default)
|
|
108
|
+
<Tooltip>
|
|
109
|
+
<TooltipTrigger asChild>
|
|
110
|
+
<Button>Top</Button>
|
|
111
|
+
</TooltipTrigger>
|
|
112
|
+
<TooltipContent side="top">
|
|
113
|
+
<p>Tooltip on top</p>
|
|
114
|
+
</TooltipContent>
|
|
115
|
+
</Tooltip>
|
|
116
|
+
|
|
117
|
+
// Right
|
|
118
|
+
<TooltipContent side="right"><p>Tooltip on right</p></TooltipContent>
|
|
119
|
+
|
|
120
|
+
// Bottom
|
|
121
|
+
<TooltipContent side="bottom"><p>Tooltip on bottom</p></TooltipContent>
|
|
122
|
+
|
|
123
|
+
// Left
|
|
124
|
+
<TooltipContent side="left"><p>Tooltip on left</p></TooltipContent>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Con Offset
|
|
128
|
+
|
|
129
|
+
```tsx
|
|
130
|
+
<Tooltip>
|
|
131
|
+
<TooltipTrigger asChild>
|
|
132
|
+
<Button>With Offset</Button>
|
|
133
|
+
</TooltipTrigger>
|
|
134
|
+
<TooltipContent sideOffset={10}>
|
|
135
|
+
<p>10px offset from trigger</p>
|
|
136
|
+
</TooltipContent>
|
|
137
|
+
</Tooltip>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Con Delay
|
|
141
|
+
|
|
142
|
+
```tsx
|
|
143
|
+
<TooltipProvider delayDuration={800}>
|
|
144
|
+
<Tooltip>
|
|
145
|
+
<TooltipTrigger asChild>
|
|
146
|
+
<Button>Slow Tooltip</Button>
|
|
147
|
+
</TooltipTrigger>
|
|
148
|
+
<TooltipContent>
|
|
149
|
+
<p>Appears after 800ms</p>
|
|
150
|
+
</TooltipContent>
|
|
151
|
+
</Tooltip>
|
|
152
|
+
</TooltipProvider>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Con Provider Global
|
|
156
|
+
|
|
157
|
+
Para múltiples tooltips, usa TooltipProvider:
|
|
158
|
+
|
|
159
|
+
```tsx
|
|
160
|
+
<TooltipProvider delayDuration={300}>
|
|
161
|
+
<Tooltip>...</Tooltip>
|
|
162
|
+
<Tooltip>...</Tooltip>
|
|
163
|
+
</TooltipProvider>
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Action Buttons
|
|
167
|
+
|
|
168
|
+
```tsx
|
|
169
|
+
import { CopyIcon, EditIcon, ShareIcon, TrashIcon } from "lucide-react";
|
|
170
|
+
|
|
171
|
+
<div className="flex gap-2">
|
|
172
|
+
<Tooltip>
|
|
173
|
+
<TooltipTrigger asChild>
|
|
174
|
+
<Button size="icon" variant="outline">
|
|
175
|
+
<CopyIcon className="h-4 w-4" />
|
|
176
|
+
</Button>
|
|
177
|
+
</TooltipTrigger>
|
|
178
|
+
<TooltipContent>
|
|
179
|
+
<p>Copy to clipboard</p>
|
|
180
|
+
</TooltipContent>
|
|
181
|
+
</Tooltip>
|
|
182
|
+
|
|
183
|
+
<Tooltip>
|
|
184
|
+
<TooltipTrigger asChild>
|
|
185
|
+
<Button size="icon" variant="outline">
|
|
186
|
+
<EditIcon className="h-4 w-4" />
|
|
187
|
+
</Button>
|
|
188
|
+
</TooltipTrigger>
|
|
189
|
+
<TooltipContent>
|
|
190
|
+
<p>Edit document</p>
|
|
191
|
+
</TooltipContent>
|
|
192
|
+
</Tooltip>
|
|
193
|
+
|
|
194
|
+
<Tooltip>
|
|
195
|
+
<TooltipTrigger asChild>
|
|
196
|
+
<Button size="icon" variant="outline">
|
|
197
|
+
<ShareIcon className="h-4 w-4" />
|
|
198
|
+
</Button>
|
|
199
|
+
</TooltipTrigger>
|
|
200
|
+
<TooltipContent>
|
|
201
|
+
<p>Share with others</p>
|
|
202
|
+
</TooltipContent>
|
|
203
|
+
</Tooltip>
|
|
204
|
+
|
|
205
|
+
<Tooltip>
|
|
206
|
+
<TooltipTrigger asChild>
|
|
207
|
+
<Button size="icon" variant="destructive">
|
|
208
|
+
<TrashIcon className="h-4 w-4" />
|
|
209
|
+
</Button>
|
|
210
|
+
</TooltipTrigger>
|
|
211
|
+
<TooltipContent>
|
|
212
|
+
<p>Delete permanently</p>
|
|
213
|
+
</TooltipContent>
|
|
214
|
+
</Tooltip>
|
|
215
|
+
</div>;
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Form Help Icons
|
|
219
|
+
|
|
220
|
+
```tsx
|
|
221
|
+
import { HelpCircleIcon, InfoIcon } from "lucide-react";
|
|
222
|
+
import { Label } from "@adamosuiteservices/ui/label";
|
|
223
|
+
import { Input } from "@adamosuiteservices/ui/input";
|
|
224
|
+
|
|
225
|
+
<div className="space-y-2">
|
|
226
|
+
<div className="flex items-center gap-2">
|
|
227
|
+
<Label htmlFor="username">Username</Label>
|
|
228
|
+
<Tooltip>
|
|
229
|
+
<TooltipTrigger asChild>
|
|
230
|
+
<HelpCircleIcon className="h-4 w-4 text-muted-foreground cursor-help" />
|
|
231
|
+
</TooltipTrigger>
|
|
232
|
+
<TooltipContent>
|
|
233
|
+
<p>
|
|
234
|
+
Must be 3-20 characters long and contain only letters, numbers, and
|
|
235
|
+
underscores
|
|
236
|
+
</p>
|
|
237
|
+
</TooltipContent>
|
|
238
|
+
</Tooltip>
|
|
239
|
+
</div>
|
|
240
|
+
<Input id="username" placeholder="Enter username" />
|
|
241
|
+
</div>;
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Controlled
|
|
245
|
+
|
|
246
|
+
```tsx
|
|
247
|
+
import { useState } from "react";
|
|
248
|
+
|
|
249
|
+
function App() {
|
|
250
|
+
const [open, setOpen] = useState(false);
|
|
251
|
+
|
|
252
|
+
return (
|
|
253
|
+
<div className="flex items-center gap-4">
|
|
254
|
+
<Tooltip open={open} onOpenChange={setOpen}>
|
|
255
|
+
<TooltipTrigger asChild>
|
|
256
|
+
<Button>Controlled</Button>
|
|
257
|
+
</TooltipTrigger>
|
|
258
|
+
<TooltipContent>
|
|
259
|
+
<p>Controlled programmatically</p>
|
|
260
|
+
</TooltipContent>
|
|
261
|
+
</Tooltip>
|
|
262
|
+
|
|
263
|
+
<Button size="sm" onClick={() => setOpen(true)}>
|
|
264
|
+
Show
|
|
265
|
+
</Button>
|
|
266
|
+
<Button size="sm" variant="outline" onClick={() => setOpen(false)}>
|
|
267
|
+
Hide
|
|
268
|
+
</Button>
|
|
269
|
+
</div>
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
## Casos de Uso
|
|
275
|
+
|
|
276
|
+
**Icon buttons**: Descripción de acciones
|
|
277
|
+
**Form help**: Explicar campos de formulario
|
|
278
|
+
**Status indicators**: Detalles de estados
|
|
279
|
+
**Truncated text**: Mostrar texto completo
|
|
280
|
+
**Disabled elements**: Explicar por qué está deshabilitado
|
|
281
|
+
|
|
282
|
+
## Estilos Base
|
|
283
|
+
|
|
284
|
+
- **Background**: `bg-neutrals-800`
|
|
285
|
+
- **Text**: `text-white text-xs`
|
|
286
|
+
- **Padding**: `px-3 py-1.5`
|
|
287
|
+
- **Border radius**: `rounded-md`
|
|
288
|
+
- **Arrow**: `size-2.5` con `bg-neutrals-800`
|
|
289
|
+
- **Z-index**: `z-50`
|
|
290
|
+
- **Animation**: Fade + zoom in/out
|
|
291
|
+
|
|
292
|
+
## Accesibilidad
|
|
293
|
+
|
|
294
|
+
- ✅ **ARIA**: `aria-describedby` automático
|
|
295
|
+
- ✅ **Keyboard**: Visible en focus del trigger
|
|
296
|
+
- ✅ **Hover**: Aparece en hover
|
|
297
|
+
- ✅ **Focus**: Aparece en focus del trigger
|
|
298
|
+
- ✅ **Escape**: Cierra con Escape key
|
|
299
|
+
|
|
300
|
+
## Notas de Implementación
|
|
301
|
+
|
|
302
|
+
- **Radix UI**: Basado en `@radix-ui/react-tooltip`
|
|
303
|
+
- **Portal**: Content se renderiza en portal (fuera del DOM tree)
|
|
304
|
+
- **Arrow**: Incluido automáticamente en TooltipContent
|
|
305
|
+
- **Provider**: Tooltip individual ya incluye TooltipProvider interno
|
|
306
|
+
- **Global Provider**: Usa TooltipProvider para delay global
|
|
307
|
+
|
|
308
|
+
## Troubleshooting
|
|
309
|
+
|
|
310
|
+
**Tooltip no aparece**: Verifica que TooltipTrigger tenga `asChild` si es Button/componente
|
|
311
|
+
**Posición incorrecta**: Usa `side` prop en TooltipContent
|
|
312
|
+
**Delay muy largo**: Ajusta `delayDuration` en Tooltip o TooltipProvider
|
|
313
|
+
**Z-index issues**: Tooltip usa `z-50`, puede necesitar ajuste si hay overlays
|
|
314
|
+
**Arrow no visible**: Arrow incluido por default, verifica estilos no sobrescritos
|
|
315
|
+
**No se cierra**: Usa Escape key o mouseleave del trigger
|
|
316
|
+
|
|
317
|
+
## Referencias
|
|
318
|
+
|
|
319
|
+
- **Radix UI Tooltip**: <https://www.radix-ui.com/primitives/docs/components/tooltip>
|
|
320
|
+
- **shadcn/ui Tooltip**: <https://ui.shadcn.com/docs/components/tooltip>
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# Typography
|
|
2
|
+
|
|
3
|
+
Sistema de estilos de texto con variantes de tamaño. Wrapper flexible con soporte `asChild`.
|
|
4
|
+
|
|
5
|
+
## Importación
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { Typography } from "@adamosuiteservices/ui/typography";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Anatomía
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
<Typography variant="md">Default paragraph text.</Typography>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
**Componentes**: 1 (Typography)
|
|
18
|
+
|
|
19
|
+
## Props
|
|
20
|
+
|
|
21
|
+
| Prop | Tipo | Descripción |
|
|
22
|
+
| ----------- | ------------------------------------------- | --------------------------------------- |
|
|
23
|
+
| `variant` | `"lg" \| "md" \| "sm" \| "xs" \| "caption"` | Tamaño del texto |
|
|
24
|
+
| `asChild` | `boolean` | Renderiza como child element (usa Slot) |
|
|
25
|
+
| `className` | `string` | Clases CSS adicionales |
|
|
26
|
+
|
|
27
|
+
**Nota**: Acepta todas las props de `<p>` cuando `asChild=false`
|
|
28
|
+
|
|
29
|
+
## Variantes
|
|
30
|
+
|
|
31
|
+
| Variante | Font Size | Line Height | Uso |
|
|
32
|
+
| --------- | ------------- | ---------------- | -------------------------- |
|
|
33
|
+
| `lg` | `text-lg` | `leading-1` | Headings, texto enfatizado |
|
|
34
|
+
| `md` | `text-base` | `leading-0.5` | Body text default |
|
|
35
|
+
| `sm` | `text-sm` | `leading` | Secondary text, labels |
|
|
36
|
+
| `xs` | `text-xs` | `leading-[20px]` | Fine print, detalles |
|
|
37
|
+
| `caption` | `text-[11px]` | `leading-[18px]` | Captions, metadata |
|
|
38
|
+
|
|
39
|
+
## Patrones de Uso
|
|
40
|
+
|
|
41
|
+
### Básico
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
import { Typography } from "@adamosuiteservices/ui/typography";
|
|
45
|
+
|
|
46
|
+
<Typography>Default paragraph with no variant.</Typography>
|
|
47
|
+
<Typography variant="lg">Large text for emphasis.</Typography>
|
|
48
|
+
<Typography variant="sm">Small secondary text.</Typography>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Como Headings
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
// H1
|
|
55
|
+
<Typography asChild variant="lg">
|
|
56
|
+
<h1 className="scroll-m-20 text-4xl font-extrabold tracking-tight">
|
|
57
|
+
Main Page Heading
|
|
58
|
+
</h1>
|
|
59
|
+
</Typography>
|
|
60
|
+
|
|
61
|
+
// H2
|
|
62
|
+
<Typography asChild variant="lg">
|
|
63
|
+
<h2 className="scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight">
|
|
64
|
+
Section Heading
|
|
65
|
+
</h2>
|
|
66
|
+
</Typography>
|
|
67
|
+
|
|
68
|
+
// H3
|
|
69
|
+
<Typography asChild variant="md">
|
|
70
|
+
<h3 className="scroll-m-20 text-2xl font-semibold tracking-tight">
|
|
71
|
+
Subsection
|
|
72
|
+
</h3>
|
|
73
|
+
</Typography>
|
|
74
|
+
|
|
75
|
+
// H4
|
|
76
|
+
<Typography asChild variant="md">
|
|
77
|
+
<h4 className="scroll-m-20 text-xl font-semibold tracking-tight">
|
|
78
|
+
Small Heading
|
|
79
|
+
</h4>
|
|
80
|
+
</Typography>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Paragraph
|
|
84
|
+
|
|
85
|
+
```tsx
|
|
86
|
+
<Typography asChild variant="md">
|
|
87
|
+
<p className="leading-7 [&:not(:first-child)]:mt-6">
|
|
88
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
89
|
+
</p>
|
|
90
|
+
</Typography>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Blockquote
|
|
94
|
+
|
|
95
|
+
```tsx
|
|
96
|
+
<Typography asChild variant="md">
|
|
97
|
+
<blockquote className="mt-6 border-l-2 pl-6 italic">
|
|
98
|
+
"This is a quote with proper styling and emphasis."
|
|
99
|
+
</blockquote>
|
|
100
|
+
</Typography>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Inline Code
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
<Typography asChild variant="sm">
|
|
107
|
+
<code className="bg-muted relative rounded px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold">
|
|
108
|
+
@radix-ui/react-alert-dialog
|
|
109
|
+
</code>
|
|
110
|
+
</Typography>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Lead Text
|
|
114
|
+
|
|
115
|
+
```tsx
|
|
116
|
+
<Typography asChild variant="lg">
|
|
117
|
+
<p className="text-xl text-muted-foreground">
|
|
118
|
+
An introductory paragraph that stands out from regular body text.
|
|
119
|
+
</p>
|
|
120
|
+
</Typography>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Small / Fine Print
|
|
124
|
+
|
|
125
|
+
```tsx
|
|
126
|
+
<Typography asChild variant="sm">
|
|
127
|
+
<small className="text-sm font-medium leading-none">Email address</small>
|
|
128
|
+
</Typography>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Muted Text
|
|
132
|
+
|
|
133
|
+
```tsx
|
|
134
|
+
<Typography asChild variant="sm">
|
|
135
|
+
<p className="text-sm text-muted-foreground">
|
|
136
|
+
Secondary information with reduced emphasis.
|
|
137
|
+
</p>
|
|
138
|
+
</Typography>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Caption
|
|
142
|
+
|
|
143
|
+
```tsx
|
|
144
|
+
<Typography variant="caption">
|
|
145
|
+
Image caption or metadata · Published 2 hours ago
|
|
146
|
+
</Typography>
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Casos de Uso
|
|
150
|
+
|
|
151
|
+
**Headings**: H1-H6 con tamaños consistentes
|
|
152
|
+
**Body text**: Párrafos y contenido principal
|
|
153
|
+
**Labels**: Etiquetas de formularios
|
|
154
|
+
**Captions**: Descripciones de imágenes, metadata
|
|
155
|
+
**Fine print**: Términos, condiciones, notas
|
|
156
|
+
**Quotes**: Citas y testimonios
|
|
157
|
+
|
|
158
|
+
## Estilos Base
|
|
159
|
+
|
|
160
|
+
- **lg**: 18px, line-height: leading-1
|
|
161
|
+
- **md**: 16px, line-height: leading-0.5 (default)
|
|
162
|
+
- **sm**: 14px, line-height: leading
|
|
163
|
+
- **xs**: 12px, line-height: 20px
|
|
164
|
+
- **caption**: 11px, line-height: 18px
|
|
165
|
+
|
|
166
|
+
## Accesibilidad
|
|
167
|
+
|
|
168
|
+
- ✅ **Semantic HTML**: Usa `asChild` con elementos semánticos apropiados
|
|
169
|
+
- ✅ **Heading hierarchy**: Mantén orden lógico de headings (H1 → H2 → H3)
|
|
170
|
+
- ✅ **Contrast**: Asegura contraste suficiente con backgrounds
|
|
171
|
+
- ⚠️ **No usar solo para estilo**: Usa elementos semánticos apropiados
|
|
172
|
+
|
|
173
|
+
## Notas de Implementación
|
|
174
|
+
|
|
175
|
+
- **CVA**: Variantes con class-variance-authority
|
|
176
|
+
- **Slot**: Usa `@radix-ui/react-slot` para `asChild`
|
|
177
|
+
- **Default element**: `<p>` cuando `asChild=false`
|
|
178
|
+
- **Data attribute**: `data-slot="typography"` para identificación
|
|
179
|
+
- **No estilos de color**: Typography solo define tamaño/line-height, combina con utility classes para color/weight
|
|
180
|
+
|
|
181
|
+
## Troubleshooting
|
|
182
|
+
|
|
183
|
+
**Variant no aplica**: Verifica que variant esté entre las opciones válidas
|
|
184
|
+
**asChild no funciona**: Asegura que child sea un elemento válido, no texto plano
|
|
185
|
+
**Line height incorrecto**: Typography define line-heights base, pueden ser sobrescritos con className
|
|
186
|
+
**No semantic HTML**: Usa `asChild` con elementos apropiados (h1, h2, p, etc.)
|
|
187
|
+
|
|
188
|
+
## Referencias
|
|
189
|
+
|
|
190
|
+
- **shadcn/ui Typography**: <https://ui.shadcn.com/docs/components/typography>
|
|
191
|
+
- **Tailwind Typography**: <https://tailwindcss.com/docs/typography-plugin>
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adamosuiteservices/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.js",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
|
+
"./docs/*": "./docs/*",
|
|
10
11
|
"./styles.css": "./dist/styles.css",
|
|
11
12
|
"./custom-layered-styles.css": "./dist/custom-layered-styles.css",
|
|
12
13
|
"./colors.css": "./dist/colors.css",
|
|
@@ -56,6 +57,10 @@
|
|
|
56
57
|
"types": "./dist/components/ui/badge/badge.d.ts",
|
|
57
58
|
"import": "./dist/badge.js"
|
|
58
59
|
},
|
|
60
|
+
"./breadcrumb": {
|
|
61
|
+
"types": "./dist/components/ui/breadcrumb/breadcrumb.d.ts",
|
|
62
|
+
"import": "./dist/breadcrumb.js"
|
|
63
|
+
},
|
|
59
64
|
"./button": {
|
|
60
65
|
"types": "./dist/components/ui/button/button.d.ts",
|
|
61
66
|
"import": "./dist/button.js"
|
|
@@ -194,7 +199,8 @@
|
|
|
194
199
|
}
|
|
195
200
|
},
|
|
196
201
|
"files": [
|
|
197
|
-
"dist"
|
|
202
|
+
"dist",
|
|
203
|
+
"docs"
|
|
198
204
|
],
|
|
199
205
|
"scripts": {
|
|
200
206
|
"dev": "cross-env vite",
|
|
@@ -213,11 +219,11 @@
|
|
|
213
219
|
]
|
|
214
220
|
},
|
|
215
221
|
"peerDependencies": {
|
|
222
|
+
"cmdk": "^1.1.1",
|
|
216
223
|
"date-fns": "^4.1.0",
|
|
217
224
|
"react": "^19.1.1",
|
|
218
225
|
"react-day-picker": "^9.11.1",
|
|
219
|
-
"react-dom": "^19.1.1"
|
|
220
|
-
"cmdk": "^1.1.1"
|
|
226
|
+
"react-dom": "^19.1.1"
|
|
221
227
|
},
|
|
222
228
|
"dependencies": {
|
|
223
229
|
"@radix-ui/react-accordion": "^1.2.12",
|
|
@@ -236,7 +242,7 @@
|
|
|
236
242
|
"@radix-ui/react-select": "^2.2.6",
|
|
237
243
|
"@radix-ui/react-separator": "^1.1.7",
|
|
238
244
|
"@radix-ui/react-slider": "^1.3.6",
|
|
239
|
-
"@radix-ui/react-slot": "^1.2.
|
|
245
|
+
"@radix-ui/react-slot": "^1.2.4",
|
|
240
246
|
"@radix-ui/react-switch": "^1.2.6",
|
|
241
247
|
"@radix-ui/react-tabs": "^1.1.13",
|
|
242
248
|
"@radix-ui/react-toggle": "^1.1.10",
|
package/dist/index-6oTEokEx.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import * as i from "react";
|
|
2
|
-
import { j as f } from "./jsx-runtime-BzflLqGi.js";
|
|
3
|
-
function d(e, t) {
|
|
4
|
-
if (typeof e == "function")
|
|
5
|
-
return e(t);
|
|
6
|
-
e != null && (e.current = t);
|
|
7
|
-
}
|
|
8
|
-
function m(...e) {
|
|
9
|
-
return (t) => {
|
|
10
|
-
let r = !1;
|
|
11
|
-
const o = e.map((n) => {
|
|
12
|
-
const l = d(n, t);
|
|
13
|
-
return !r && typeof l == "function" && (r = !0), l;
|
|
14
|
-
});
|
|
15
|
-
if (r)
|
|
16
|
-
return () => {
|
|
17
|
-
for (let n = 0; n < o.length; n++) {
|
|
18
|
-
const l = o[n];
|
|
19
|
-
typeof l == "function" ? l() : d(e[n], null);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
function x(...e) {
|
|
25
|
-
return i.useCallback(m(...e), e);
|
|
26
|
-
}
|
|
27
|
-
// @__NO_SIDE_EFFECTS__
|
|
28
|
-
function g(e) {
|
|
29
|
-
const t = /* @__PURE__ */ C(e), r = i.forwardRef((o, n) => {
|
|
30
|
-
const { children: l, ...a } = o, s = i.Children.toArray(l), c = s.find(E);
|
|
31
|
-
if (c) {
|
|
32
|
-
const u = c.props.children, S = s.map((p) => p === c ? i.Children.count(u) > 1 ? i.Children.only(null) : i.isValidElement(u) ? u.props.children : null : p);
|
|
33
|
-
return /* @__PURE__ */ f.jsx(t, { ...a, ref: n, children: i.isValidElement(u) ? i.cloneElement(u, void 0, S) : null });
|
|
34
|
-
}
|
|
35
|
-
return /* @__PURE__ */ f.jsx(t, { ...a, ref: n, children: l });
|
|
36
|
-
});
|
|
37
|
-
return r.displayName = `${e}.Slot`, r;
|
|
38
|
-
}
|
|
39
|
-
var j = /* @__PURE__ */ g("Slot");
|
|
40
|
-
// @__NO_SIDE_EFFECTS__
|
|
41
|
-
function C(e) {
|
|
42
|
-
const t = i.forwardRef((r, o) => {
|
|
43
|
-
const { children: n, ...l } = r;
|
|
44
|
-
if (i.isValidElement(n)) {
|
|
45
|
-
const a = b(n), s = R(l, n.props);
|
|
46
|
-
return n.type !== i.Fragment && (s.ref = o ? m(o, a) : a), i.cloneElement(n, s);
|
|
47
|
-
}
|
|
48
|
-
return i.Children.count(n) > 1 ? i.Children.only(null) : null;
|
|
49
|
-
});
|
|
50
|
-
return t.displayName = `${e}.SlotClone`, t;
|
|
51
|
-
}
|
|
52
|
-
var y = Symbol("radix.slottable");
|
|
53
|
-
// @__NO_SIDE_EFFECTS__
|
|
54
|
-
function _(e) {
|
|
55
|
-
const t = ({ children: r }) => /* @__PURE__ */ f.jsx(f.Fragment, { children: r });
|
|
56
|
-
return t.displayName = `${e}.Slottable`, t.__radixId = y, t;
|
|
57
|
-
}
|
|
58
|
-
function E(e) {
|
|
59
|
-
return i.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === y;
|
|
60
|
-
}
|
|
61
|
-
function R(e, t) {
|
|
62
|
-
const r = { ...t };
|
|
63
|
-
for (const o in t) {
|
|
64
|
-
const n = e[o], l = t[o];
|
|
65
|
-
/^on[A-Z]/.test(o) ? n && l ? r[o] = (...s) => {
|
|
66
|
-
const c = l(...s);
|
|
67
|
-
return n(...s), c;
|
|
68
|
-
} : n && (r[o] = n) : o === "style" ? r[o] = { ...n, ...l } : o === "className" && (r[o] = [n, l].filter(Boolean).join(" "));
|
|
69
|
-
}
|
|
70
|
-
return { ...e, ...r };
|
|
71
|
-
}
|
|
72
|
-
function b(e) {
|
|
73
|
-
let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, r = t && "isReactWarning" in t && t.isReactWarning;
|
|
74
|
-
return r ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, r = t && "isReactWarning" in t && t.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
|
|
75
|
-
}
|
|
76
|
-
export {
|
|
77
|
-
j as S,
|
|
78
|
-
g as a,
|
|
79
|
-
_ as b,
|
|
80
|
-
m as c,
|
|
81
|
-
x as u
|
|
82
|
-
};
|