quickit-ui 0.1.14 → 0.1.17
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/README.md +110 -0
- package/dist/quickit-ui.css +1 -1
- package/dist/quickit-ui.d.ts +41 -0
- package/dist/quickit-ui.js +2267 -1980
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -49,6 +49,74 @@ export default function App() {
|
|
|
49
49
|
}
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
+
También puedes controlar el focus ring globalmente desde el provider:
|
|
53
|
+
|
|
54
|
+
```jsx
|
|
55
|
+
<QuickitProvider
|
|
56
|
+
theme="dark"
|
|
57
|
+
focusRing={{ disabledComponents: ["input", "textarea"] }}
|
|
58
|
+
>
|
|
59
|
+
<App />
|
|
60
|
+
</QuickitProvider>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Reglas:
|
|
64
|
+
|
|
65
|
+
- por defecto Quickit mantiene focus visible accesible en componentes interactivos
|
|
66
|
+
- `focusRing={false}` lo desactiva en toda la librería
|
|
67
|
+
- `focusRing={{ disabledComponents: [...] }}` lo desactiva solo en componentes específicos
|
|
68
|
+
|
|
69
|
+
Si necesitas leer esa decisión desde tu app o desde wrappers propios:
|
|
70
|
+
|
|
71
|
+
```jsx
|
|
72
|
+
import { useQuickitFocusRing } from "quickit-ui";
|
|
73
|
+
|
|
74
|
+
function Toolbar() {
|
|
75
|
+
const buttonFocusRing = useQuickitFocusRing("button");
|
|
76
|
+
const linkFocusRing = useQuickitFocusRing("link");
|
|
77
|
+
const checkboxFocusRing = useQuickitFocusRing("checkbox");
|
|
78
|
+
const radioFocusRing = useQuickitFocusRing("radio");
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<div>
|
|
82
|
+
<span>button focus: {String(buttonFocusRing)}</span>
|
|
83
|
+
<span>link focus: {String(linkFocusRing)}</span>
|
|
84
|
+
<span>checkbox focus: {String(checkboxFocusRing)}</span>
|
|
85
|
+
<span>radio focus: {String(radioFocusRing)}</span>
|
|
86
|
+
</div>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Caso real:
|
|
92
|
+
|
|
93
|
+
```jsx
|
|
94
|
+
import {
|
|
95
|
+
Button,
|
|
96
|
+
Checkbox,
|
|
97
|
+
Link,
|
|
98
|
+
QuickitProvider,
|
|
99
|
+
Radio,
|
|
100
|
+
} from "quickit-ui";
|
|
101
|
+
|
|
102
|
+
export function LoginOptions() {
|
|
103
|
+
return (
|
|
104
|
+
<QuickitProvider
|
|
105
|
+
focusRing={{ disabledComponents: ["link", "checkbox", "radio"] }}
|
|
106
|
+
>
|
|
107
|
+
<div className="flex flex-wrap items-center gap-4">
|
|
108
|
+
<Link href="#">Ver términos</Link>
|
|
109
|
+
<Checkbox label="Recordarme" defaultChecked />
|
|
110
|
+
<Radio name="login-mode" label="Modo manual" defaultChecked />
|
|
111
|
+
<Button color="neutral" variant="outline">
|
|
112
|
+
Continuar
|
|
113
|
+
</Button>
|
|
114
|
+
</div>
|
|
115
|
+
</QuickitProvider>
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
52
120
|
## Colores semánticos
|
|
53
121
|
|
|
54
122
|
La API pública soporta:
|
|
@@ -140,6 +208,28 @@ export function Actions() {
|
|
|
140
208
|
}
|
|
141
209
|
```
|
|
142
210
|
|
|
211
|
+
Notas rápidas de `Button`:
|
|
212
|
+
|
|
213
|
+
- `shape="square"` y `shape="circle"` están pensados para icon buttons.
|
|
214
|
+
- `shape="square"` y `shape="circle"` salen con `activeMotion` desactivado por defecto.
|
|
215
|
+
- Si quieres esa animación en un icon button, usa `activeMotion={true}`.
|
|
216
|
+
|
|
217
|
+
```jsx
|
|
218
|
+
<Button shape="square" variant="outline" color="neutral" aria-label="Buscar">
|
|
219
|
+
<SearchIcon />
|
|
220
|
+
</Button>
|
|
221
|
+
|
|
222
|
+
<Button
|
|
223
|
+
shape="square"
|
|
224
|
+
variant="outline"
|
|
225
|
+
color="neutral"
|
|
226
|
+
activeMotion
|
|
227
|
+
aria-label="Buscar con motion"
|
|
228
|
+
>
|
|
229
|
+
<SearchIcon />
|
|
230
|
+
</Button>
|
|
231
|
+
```
|
|
232
|
+
|
|
143
233
|
### Formularios
|
|
144
234
|
|
|
145
235
|
```jsx
|
|
@@ -175,6 +265,26 @@ export function ContactForm() {
|
|
|
175
265
|
<FormDescription>Selecciona el motivo de tu consulta.</FormDescription>
|
|
176
266
|
</FormControl>
|
|
177
267
|
|
|
268
|
+
<FormControl>
|
|
269
|
+
<Label htmlFor="password">Contraseña</Label>
|
|
270
|
+
<Input
|
|
271
|
+
id="password"
|
|
272
|
+
type="password"
|
|
273
|
+
color="brand"
|
|
274
|
+
placeholder="••••••••"
|
|
275
|
+
/>
|
|
276
|
+
</FormControl>
|
|
277
|
+
|
|
278
|
+
<FormControl>
|
|
279
|
+
<Label htmlFor="search">Buscar componente</Label>
|
|
280
|
+
<Input
|
|
281
|
+
id="search"
|
|
282
|
+
type="search"
|
|
283
|
+
color="neutral"
|
|
284
|
+
defaultValue="Modal"
|
|
285
|
+
/>
|
|
286
|
+
</FormControl>
|
|
287
|
+
|
|
178
288
|
<FormControl invalid>
|
|
179
289
|
<Label htmlFor="message">Mensaje</Label>
|
|
180
290
|
<Textarea id="message" color="danger" placeholder="Escribe tu mensaje" />
|