@rubenpazch/ui 0.7.0 → 0.9.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.
@@ -29,9 +29,12 @@ librería (ver AGENTS.md del repo lbyte-ui-library), no lo copies en la app.
29
29
  | [`@rubenpazch/data-table`](#rubenpazchdata-table) | Datos | DataTable | Tabla de datos accesible: columnas con render, orden (aria-sort) en el navegador o en el servidor, carga con Skeleton, estado vacío, filas clicables, encabezado fijo y scroll horizontal en móvil. |
30
30
  | [`@rubenpazch/date-input`](#rubenpazchdate-input) | Formularios | DateInput | Campo de fecha con formato local, mínimo/máximo, ayuda y error. |
31
31
  | [`@rubenpazch/date-picker`](#rubenpazchdate-picker) | Formularios | DatePicker | Selector de fecha con calendario desplegable. |
32
+ | [`@rubenpazch/date-range-picker`](#rubenpazchdate-range-picker) | Formularios | DateRangePicker, DEFAULT_DATE_RANGE_LABELS, DEFAULT_DATE_RANGE_PRESETS, rangoValido | Dos fechas (desde y hasta) con validación del orden y atajos (este mes, mes anterior, últimos 30 días…). Valores ISO AAAA-MM-DD. |
33
+ | [`@rubenpazch/description-list`](#rubenpazchdescription-list) | Presentación de datos | DescriptionList | Pares etiqueta/valor en columnas: resumen de un registro (datos de un trámite, de un cliente, de un pago). |
32
34
  | [`@rubenpazch/draggable-list`](#rubenpazchdraggable-list) | Datos | DraggableList | Lista reordenable arrastrando (también con teclado), basada en dnd-kit. |
33
35
  | [`@rubenpazch/drawer`](#rubenpazchdrawer) | Navegación | Drawer | Panel lateral (izquierda/derecha/arriba/abajo) con animación y fondo. |
34
36
  | [`@rubenpazch/empty-state`](#rubenpazchempty-state) | Retroalimentación | EmptyState | Estado vacío con icono, título, descripción y acciones ("No hay convocatorias · Crear"). |
37
+ | [`@rubenpazch/file-upload`](#rubenpazchfile-upload) | Formularios | FileUpload, DEFAULT_FILE_UPLOAD_LABELS, aceptaArchivo | Zona para subir uno o varios archivos (arrastrar y soltar o elegir), con validación de tipo, tamaño y cantidad, y lista para quitarlos. |
35
38
  | [`@rubenpazch/form-field`](#rubenpazchform-field) | Formularios | FormField, FormRow, FormActions | FormField (etiqueta, ayuda y error asociados a cualquier control), FormRow (columnas que se apilan en móvil) y FormActions (pie con botones). |
36
39
  | [`@rubenpazch/icon-button`](#rubenpazchicon-button) | Acciones | IconButton | Botón de solo icono con variantes, formas, tooltip y etiqueta accesible. |
37
40
  | [`@rubenpazch/icons`](#rubenpazchicons) | Iconos | ArrowDetailsIcon, ArchiveIcon, BrandingIcon, BusinessPlanIcon, CalendarIcon, CheckIcon, … | Más de 60 iconos SVG como componentes React (y MaterialIcon para Material Icons). |
@@ -64,9 +67,11 @@ librería (ver AGENTS.md del repo lbyte-ui-library), no lo copies en la app.
64
67
  | [`@rubenpazch/tabs`](#rubenpazchtabs) | Navegación | Tabs | Pestañas para alternar entre secciones de una misma vista. |
65
68
  | [`@rubenpazch/text-input`](#rubenpazchtext-input) | Formularios | TextInput | Campo de texto con etiqueta, ayuda, advertencia, error, iconos y variantes. |
66
69
  | [`@rubenpazch/textarea`](#rubenpazchtextarea) | Formularios | Textarea | Área de texto con etiqueta, ayuda, advertencia, error, contador de caracteres y crecimiento automático. |
70
+ | [`@rubenpazch/timeline`](#rubenpazchtimeline) | Presentación de datos | Timeline | Línea de tiempo vertical: historial de un trámite, pedido o expediente (eventos con estado, fecha y descripción). |
67
71
  | [`@rubenpazch/toast`](#rubenpazchtoast) | Retroalimentación | ToastBanner, ToastProvider, ToastRegion, useToast | Notificaciones temporales (Toast) y avisos fijos (ToastBanner) con tipos y acciones. |
68
72
  | [`@rubenpazch/tokens`](#rubenpazchtokens) | Base (tokens y utilidades) | cssVar, fontFamily, fontSize, fontWeight, lineHeight, letterSpacing, … | Tokens de diseño (colores, tipografía, espacios, radios, sombras) como variables CSS --lb-*, estilos base y puente para Tailwind 4. |
69
73
  | [`@rubenpazch/tooltip`](#rubenpazchtooltip) | Presentación de datos | Tooltip | Texto de ayuda breve al pasar el mouse o enfocar con teclado (role="tooltip", aria-describedby), se cierra con Escape. |
74
+ | [`@rubenpazch/turnstile`](#rubenpazchturnstile) | Formularios | Turnstile, TURNSTILE_SCRIPT, cargarTurnstile | Widget de Cloudflare Turnstile (anti-robots) para formularios públicos: carga el script una sola vez, entrega el token y se reinicia tras cada envío. |
70
75
  | [`@rubenpazch/user-card`](#rubenpazchuser-card) | Presentación de datos | UserCard, initials | Tarjeta de una persona (usuario, socio, cliente): avatar, nombre, correo u otro dato, etiquetas y acciones; las secundarias van en un menú ⋮. |
71
76
 
72
77
  ## Base (tokens y utilidades)
@@ -78,7 +83,7 @@ Utilidades (classList) y tipos comunes; la usan internamente los componentes.
78
83
  - **Usar cuando:** Solo si construyes un componente nuevo dentro de la librería.
79
84
  - **Evitar cuando:** En las apps: no hace falta importarla.
80
85
 
81
- Otras exportaciones: `classList`, `normalizeSize`, `toLegacySize`, `useFieldIds`, `useEscapeKey`, `useFocusTrap`, `useLockBodyScroll`, `useClickOutside`, `mergeRefs`, `parseISODate`, `toISODate`, `isDayFirst`, `datePlaceholder`, `parseLocalDate`, `formatLocalDate`, `formatMonthYear`, `isSameDay`.
86
+ Otras exportaciones: `classList`, `normalizeSize`, `toLegacySize`, `useFieldIds`, `useEscapeKey`, `useFocusTrap`, `useLockBodyScroll`, `useClickOutside`, `mergeRefs`, `useMediaQuery`, `MOBILE_QUERY`, `parseISODate`, `toISODate`, `isDayFirst`, `datePlaceholder`, `parseLocalDate`, `formatLocalDate`, `formatMonthYear`, `isSameDay`.
82
87
 
83
88
  Tipos: `Size`, `Color`, `Variant`, `ComponentSize`, `LegacySize`, `SizeProp`, `FieldProps`, `FieldIds`.
84
89
 
@@ -122,6 +127,8 @@ import { Button } from "@rubenpazch/ui";
122
127
  | `startIcon` | `ReactNode` | | | Icon to display before text |
123
128
  | `variant` | `"text" \| "contained" \| "outlined"` | | | Button variant style |
124
129
 
130
+ Tipos: `ButtonVariant`, `ButtonColor`, `ButtonSize`, `ButtonSizeProp`, `ButtonProps`.
131
+
125
132
  ### @rubenpazch/icon-button
126
133
 
127
134
  Botón de solo icono con variantes, formas, tooltip y etiqueta accesible.
@@ -197,41 +204,44 @@ Selector con búsqueda (combobox accesible): filtra mientras se escribe, teclado
197
204
  import { Autocomplete } from "@rubenpazch/ui";
198
205
  ```
199
206
 
200
- | Prop | Tipo | Req. | Por defecto | Descripción |
201
- | ----------------- | ------------------------------------------------------------------------------------- | ---- | ----------------------- | ------------------------------------------ |
202
- | `onChange` | `(value: string \| number \| null, option?: AutocompleteOption \| undefined) => void` | sí | | |
203
- | `value` | `null \| string \| number` | sí | | |
204
- | `className` | `string` | | `` | |
205
- | `clearable` | `boolean` | | `true` | |
206
- | `createLabel` | `string` | | `Crear` | |
207
- | `debounceMs` | `number` | | `300` | |
208
- | `disabled` | `boolean` | | `false` | |
209
- | `error` | `string` | | | |
210
- | `highlightMatch` | `boolean` | | `true` | |
211
- | `hint` | `string` | | | |
212
- | `icon` | `ReactNode` | | | |
213
- | `id` | `string` | | | id del input; si no se pasa se genera uno. |
214
- | `keepListOpen` | `boolean` | | `false` | |
215
- | `label` | `string` | | | |
216
- | `labels` | `Partial<{ clear: string; open: string; close: string; }>` | | | Textos accesibles de los botones. |
217
- | `loading` | `boolean` | | `false` | |
218
- | `loadingText` | `string` | | `Cargando…` | |
219
- | `maxHeight` | `string` | | `300px` | |
220
- | `minSearchLength` | `number` | | `0` | |
221
- | `name` | `string` | | | name del input. |
222
- | `noResultsText` | `string` | | `Sin resultados` | |
223
- | `onBlur` | `() => void` | | | |
224
- | `onCreate` | `(searchTerm: string) => void` | | | |
225
- | `onFocus` | `() => void` | | | |
226
- | `onSearch` | `(searchTerm: string) => void` | | | |
227
- | `options` | `AutocompleteOption[]` | | `[]` | |
228
- | `placeholder` | `string` | | `Buscar o seleccionar…` | |
229
- | `position` | `"bottom" \| "top"` | | `bottom` | |
230
- | `readOnly` | `boolean` | | `false` | |
231
- | `renderOption` | `(option: AutocompleteOption, isSelected: boolean) => ReactNode` | | | |
232
- | `required` | `boolean` | | `false` | |
233
- | `searchable` | `boolean` | | `true` | |
234
- | `warning` | `string` | | | |
207
+ | Prop | Tipo | Req. | Por defecto | Descripción |
208
+ | ----------------- | ------------------------------------------------------------------------------------- | ---- | ----------------------- | ------------------------------------------------------------------------------------------------------------ |
209
+ | `onChange` | `(value: string \| number \| null, option?: AutocompleteOption \| undefined) => void` | sí | | |
210
+ | `value` | `null \| string \| number` | sí | | |
211
+ | `className` | `string` | | `` | |
212
+ | `clearable` | `boolean` | | `true` | |
213
+ | `createLabel` | `string` | | `Crear` | |
214
+ | `debounceMs` | `number` | | `300` | |
215
+ | `disabled` | `boolean` | | `false` | |
216
+ | `error` | `string` | | | |
217
+ | `highlightMatch` | `boolean` | | `true` | |
218
+ | `hint` | `string` | | | |
219
+ | `icon` | `ReactNode` | | | |
220
+ | `id` | `string` | | | id del input; si no se pasa se genera uno. |
221
+ | `keepListOpen` | `boolean` | | `false` | |
222
+ | `label` | `string` | | | |
223
+ | `labelAction` | `ReactNode` | | | Contenido junto a la etiqueta, a la derecha: un botón de ayuda ("?"), un enlace… No va dentro del `<label>`. |
224
+ | `labels` | `Partial<{ clear: string; open: string; close: string; }>` | | | Textos accesibles de los botones. |
225
+ | `loading` | `boolean` | | `false` | |
226
+ | `loadingText` | `string` | | `Cargando…` | |
227
+ | `maxHeight` | `string` | | `300px` | |
228
+ | `minSearchLength` | `number` | | `0` | |
229
+ | `name` | `string` | | | name del input. |
230
+ | `noResultsText` | `string` | | `Sin resultados` | |
231
+ | `onBlur` | `() => void` | | | |
232
+ | `onCreate` | `(searchTerm: string) => void` | | | |
233
+ | `onFocus` | `() => void` | | | |
234
+ | `onSearch` | `(searchTerm: string) => void` | | | |
235
+ | `options` | `AutocompleteOption[]` | | `[]` | |
236
+ | `placeholder` | `string` | | `Buscar o seleccionar…` | |
237
+ | `position` | `"bottom" \| "top"` | | `bottom` | |
238
+ | `readOnly` | `boolean` | | `false` | |
239
+ | `renderOption` | `(option: AutocompleteOption, isSelected: boolean) => ReactNode` | | | |
240
+ | `required` | `boolean` | | `false` | |
241
+ | `searchable` | `boolean` | | `true` | |
242
+ | `warning` | `string` | | | |
243
+
244
+ Tipos: `AutocompleteOption`, `AutocompleteProps`.
235
245
 
236
246
  ### @rubenpazch/checkbox-input
237
247
 
@@ -265,6 +275,8 @@ import { CheckboxInput } from "@rubenpazch/ui";
265
275
  | `value` | `string` | | | Valor enviado con el formulario cuando está marcado. |
266
276
  | `variant` | `"default" \| "primary" \| "success" \| "warning" \| "danger"` | | `default` | |
267
277
 
278
+ Tipos: `CheckboxInputProps`.
279
+
268
280
  ### @rubenpazch/date-input
269
281
 
270
282
  Campo de fecha con formato local, mínimo/máximo, ayuda y error.
@@ -281,23 +293,26 @@ Campo de fecha con calendario desplegable. Se escribe en el formato del idioma
281
293
  import { DateInput } from "@rubenpazch/ui";
282
294
  ```
283
295
 
284
- | Prop | Tipo | Req. | Por defecto | Descripción |
285
- | ------------- | -------------------------- | ---- | ----------- | ----------------------------------------------------------------------- |
286
- | `onChange` | `(date: string) => void` | sí | | Recibe la fecha en ISO `AAAA-MM-DD` (o "" al limpiar). |
287
- | `value` | `string` | sí | | Fecha en formato ISO `AAAA-MM-DD`, o cadena vacía. |
288
- | `className` | `string` | | `` | Clase extra para el contenedor. |
289
- | `disabled` | `boolean` | | `false` | Campo deshabilitado. |
290
- | `error` | `string` | | | Mensaje de error; marca el campo como inválido. |
291
- | `hint` | `string` | | | Texto de ayuda. |
292
- | `id` | `string` | | | id del input; si no se pasa se genera uno (la etiqueta se asocia sola). |
293
- | `label` | `string` | | | Etiqueta visible. |
294
- | `labels` | `Partial<DateInputLabels>` | | | Textos del calendario; por defecto en el idioma de `locale`. |
295
- | `locale` | `string` | | `es` | Idioma: `es` (por defecto, día/mes) o `en` (mes/día). |
296
- | `maxDate` | `string` | | | Fecha máxima seleccionable (ISO). |
297
- | `minDate` | `string` | | | Fecha mínima seleccionable (ISO). |
298
- | `name` | `string` | | | name del input (formularios nativos, react-hook-form…). |
299
- | `placeholder` | `string` | | | Por defecto el formato del idioma: "DD/MM/AAAA" en español. |
300
- | `required` | `boolean` | | `false` | Campo obligatorio. |
296
+ | Prop | Tipo | Req. | Por defecto | Descripción |
297
+ | ------------------ | -------------------------- | ---- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------- |
298
+ | `onChange` | `(date: string) => void` | sí | | Recibe la fecha en ISO `AAAA-MM-DD` (o "" al limpiar). |
299
+ | `value` | `string` | sí | | Fecha en formato ISO `AAAA-MM-DD`, o cadena vacía. |
300
+ | `className` | `string` | | `` | Clase extra para el contenedor. |
301
+ | `disabled` | `boolean` | | `false` | Campo deshabilitado. |
302
+ | `error` | `string` | | | Mensaje de error; marca el campo como inválido. |
303
+ | `hint` | `string` | | | Texto de ayuda. |
304
+ | `id` | `string` | | | id del input; si no se pasa se genera uno (la etiqueta se asocia sola). |
305
+ | `label` | `string` | | | Etiqueta visible. |
306
+ | `labels` | `Partial<DateInputLabels>` | | | Textos del calendario; por defecto en el idioma de `locale`. |
307
+ | `locale` | `string` | | `es` | Idioma: `es` (por defecto, día/mes) o `en` (mes/día). |
308
+ | `maxDate` | `string` | | | Fecha máxima seleccionable (ISO). |
309
+ | `minDate` | `string` | | | Fecha mínima seleccionable (ISO). |
310
+ | `mobileFullScreen` | `boolean` | | `true` | En pantallas pequeñas (< 640 px) el calendario se abre a pantalla completa y vuelve al campo al elegir la fecha. Por defecto true. |
311
+ | `name` | `string` | | | name del input (formularios nativos, react-hook-form…). |
312
+ | `placeholder` | `string` | | | Por defecto el formato del idioma: "DD/MM/AAAA" en español. |
313
+ | `required` | `boolean` | | `false` | Campo obligatorio. |
314
+
315
+ Tipos: `DateInputLabels`, `DateInputProps`.
301
316
 
302
317
  ### @rubenpazch/date-picker
303
318
 
@@ -314,24 +329,130 @@ Selector de fecha con calendario (días, meses y años). Devuelve ISO `AAAA-MM-D
314
329
  import { DatePicker } from "@rubenpazch/ui";
315
330
  ```
316
331
 
317
- | Prop | Tipo | Req. | Por defecto | Descripción |
318
- | ------------------- | ------------------------ | ---- | ----------- | ----------------------------------------------------------------------- |
319
- | `onChange` | `(date: string) => void` | sí | | |
320
- | `value` | `string` | sí | | |
321
- | `className` | `string` | | `` | |
322
- | `disabled` | `boolean` | | `false` | |
323
- | `error` | `string` | | | |
324
- | `hint` | `string` | | | |
325
- | `id` | `string` | | | id del input; si no se pasa se genera uno (la etiqueta se asocia sola). |
326
- | `label` | `string` | | | |
327
- | `locale` | `string` | | `es` | |
328
- | `maxDate` | `string` | | | |
329
- | `minDate` | `string` | | | |
330
- | `name` | `string` | | | name del input. |
331
- | `openCalendarLabel` | `string` | | | Texto del botón que abre el calendario (accesibilidad). |
332
- | `placeholder` | `string` | | | |
333
- | `readOnly` | `boolean` | | `false` | |
334
- | `required` | `boolean` | | `false` | |
332
+ | Prop | Tipo | Req. | Por defecto | Descripción |
333
+ | ------------------- | ------------------------ | ---- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------- |
334
+ | `onChange` | `(date: string) => void` | sí | | |
335
+ | `value` | `string` | sí | | |
336
+ | `className` | `string` | | `` | |
337
+ | `disabled` | `boolean` | | `false` | |
338
+ | `error` | `string` | | | |
339
+ | `hint` | `string` | | | |
340
+ | `id` | `string` | | | id del input; si no se pasa se genera uno (la etiqueta se asocia sola). |
341
+ | `label` | `string` | | | |
342
+ | `locale` | `string` | | `es` | |
343
+ | `maxDate` | `string` | | | |
344
+ | `minDate` | `string` | | | |
345
+ | `mobileFullScreen` | `boolean` | | `true` | En pantallas pequeñas (< 640 px) el calendario se abre a pantalla completa y vuelve al campo al elegir la fecha. Por defecto true. |
346
+ | `name` | `string` | | | name del input. |
347
+ | `openCalendarLabel` | `string` | | | Texto del botón que abre el calendario (accesibilidad). |
348
+ | `placeholder` | `string` | | | |
349
+ | `readOnly` | `boolean` | | `false` | |
350
+ | `required` | `boolean` | | `false` | |
351
+
352
+ Tipos: `DatePickerProps`.
353
+
354
+ ### @rubenpazch/date-range-picker
355
+
356
+ Dos fechas (desde y hasta) con validación del orden y atajos (este mes, mes anterior, últimos 30 días…). Valores ISO AAAA-MM-DD.
357
+
358
+ - **Usar cuando:** Filtrar reportes, listados o libros por un periodo.
359
+ - **Evitar cuando:** Una sola fecha: usa DateInput. Navegar mes a mes: usa MonthNavigator.
360
+
361
+ #### DateRangePicker
362
+
363
+ Periodo desde/hasta con dos `DateInput` y atajos. Valida que "hasta" no sea anterior a "desde"
364
+ y limita cada calendario según la otra fecha.
365
+
366
+ ```tsx
367
+ import { DateRangePicker } from "@rubenpazch/ui";
368
+ ```
369
+
370
+ | Prop | Tipo | Req. | Por defecto | Descripción |
371
+ | ----------- | -------------------------------- | ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
372
+ | `onChange` | `(range: DateRange) => void` | sí | | |
373
+ | `value` | `DateRange` | sí | | |
374
+ | `className` | `string` | | | |
375
+ | `disabled` | `boolean` | | `false` | |
376
+ | `error` | `string` | | | Error externo; si no hay, se muestra el de orden cuando corresponde. |
377
+ | `hint` | `string` | | | |
378
+ | `label` | `string` | | | Título del grupo (se usa como `<legend>`). |
379
+ | `labels` | `Partial<DateRangePickerLabels>` | | | |
380
+ | `locale` | `string` | | | |
381
+ | `maxDate` | `string` | | | |
382
+ | `minDate` | `string` | | | |
383
+ | `presets` | `false \| DateRangePreset[]` | | `[ { label: "Hoy", range: (h) => rango(h, h) }, { label: "Últimos 7 días", range: (h) => rango(menos(h, 6), h) }, { label: "Últimos 30 días", range: (h) => rango(menos(h, 29), h) }, { label: "Este mes", range: (h) => rango( primerDia(h.getFullYear(), h.getMonth()), ultimoDia(h.getFullYear(), h.getMonth()), ), }, { label: "Mes anterior", range: (h) => rango( primerDia(h.getFullYear(), h.getMonth() - 1), ultimoDia(h.getFullYear(), h.getMonth() - 1), ), }, { label: "Este año", range: (h) => rango(new Date(h.getFullYear(), 0, 1), new Date(h.getFullYear(), 11, 31)), }, ]` | Atajos; `false` los oculta. Por defecto: hoy, 7/30 días, este mes, mes anterior, este año. |
384
+ | `required` | `boolean` | | `false` | |
385
+ | `today` | `Date` | | | Para pruebas: fecha que se toma como "hoy" en los atajos. |
386
+
387
+ #### DEFAULT_DATE_RANGE_LABELS
388
+
389
+ ```tsx
390
+ import { DEFAULT_DATE_RANGE_LABELS } from "@rubenpazch/ui";
391
+ ```
392
+
393
+ _Sin props documentadas._
394
+
395
+ #### DEFAULT_DATE_RANGE_PRESETS
396
+
397
+ Atajos habituales (fechas locales, sin corrimiento de zona horaria).
398
+
399
+ ```tsx
400
+ import { DEFAULT_DATE_RANGE_PRESETS } from "@rubenpazch/ui";
401
+ ```
402
+
403
+ _Sin props documentadas._
404
+
405
+ Otras exportaciones: `rangoValido`.
406
+
407
+ Tipos: `DateRange`, `DateRangePickerLabels`, `DateRangePickerProps`, `DateRangePreset`.
408
+
409
+ ### @rubenpazch/file-upload
410
+
411
+ Zona para subir uno o varios archivos (arrastrar y soltar o elegir), con validación de tipo, tamaño y cantidad, y lista para quitarlos.
412
+
413
+ - **Usar cuando:** Adjuntar documentos o archivos en un formulario.
414
+ - **Evitar cuando:** Una sola imagen con vista previa (logo, foto): usa ImageUpload.
415
+
416
+ #### FileUpload
417
+
418
+ Zona para subir uno o varios archivos: arrastrar y soltar o "Elegir archivos" (teclado).
419
+ Valida tipo, tamaño, cantidad y duplicados; los rechazados se informan en la zona y por `onReject`.
420
+ No sube nada: entrega los `File` a la app, que decide cuándo y cómo enviarlos.
421
+
422
+ ```tsx
423
+ import { FileUpload } from "@rubenpazch/ui";
424
+ ```
425
+
426
+ | Prop | Tipo | Req. | Por defecto | Descripción |
427
+ | ----------- | --------------------------------------- | ---- | ----------- | ------------------------------------------------------------------------------------- |
428
+ | `onChange` | `(files: File[]) => void` | sí | | Nueva lista de archivos (agregados o quitados). |
429
+ | `value` | `File[]` | sí | | Archivos elegidos (controlado). |
430
+ | `accept` | `string` | | | Tipos aceptados como en `<input accept>`: ".pdf,.docx", "image/*", "application/pdf". |
431
+ | `className` | `string` | | | |
432
+ | `disabled` | `boolean` | | `false` | |
433
+ | `error` | `string` | | | Error externo (validación del formulario). |
434
+ | `hint` | `string` | | | |
435
+ | `id` | `string` | | | |
436
+ | `label` | `string` | | | |
437
+ | `labels` | `Partial<FileUploadLabels>` | | | |
438
+ | `maxFiles` | `number` | | | Máximo de archivos (por defecto sin límite). |
439
+ | `maxSizeMB` | `number` | | | Tamaño máximo por archivo en MB. |
440
+ | `multiple` | `boolean` | | `true` | Permitir varios archivos (por defecto sí). |
441
+ | `name` | `string` | | | |
442
+ | `onReject` | `(rejections: FileRejection[]) => void` | | | Archivos que no se aceptaron y por qué (para avisar o registrar). |
443
+ | `required` | `boolean` | | `false` | |
444
+
445
+ #### DEFAULT_FILE_UPLOAD_LABELS
446
+
447
+ ```tsx
448
+ import { DEFAULT_FILE_UPLOAD_LABELS } from "@rubenpazch/ui";
449
+ ```
450
+
451
+ _Sin props documentadas._
452
+
453
+ Otras exportaciones: `aceptaArchivo`.
454
+
455
+ Tipos: `FileRejection`, `FileUploadLabels`, `FileUploadProps`.
335
456
 
336
457
  ### @rubenpazch/form-field
337
458
 
@@ -509,6 +630,8 @@ import { NumericPicker } from "@rubenpazch/ui";
509
630
  | `required` | `boolean` | | `false` | Campo obligatorio. |
510
631
  | `step` | `number` | | `1` | Paso de los botones + y −. |
511
632
 
633
+ Tipos: `NumericPickerProps`.
634
+
512
635
  ### @rubenpazch/numeric-up-picker
513
636
 
514
637
  Campo numérico con botones +/-, signo opcional, solo enteros, ayuda, advertencia y error.
@@ -655,20 +778,21 @@ Lista desplegable simple con etiqueta, placeholder y error.
655
778
  import { Select } from "@rubenpazch/ui";
656
779
  ```
657
780
 
658
- | Prop | Tipo | Req. | Por defecto | Descripción |
659
- | ------------- | ------------------------- | ---- | ----------- | ----------------------------- |
660
- | `onChange` | `(value: string) => void` | sí | | |
661
- | `options` | `SelectOption[]` | sí | | |
662
- | `value` | `string` | sí | | |
663
- | `className` | `string` | | | |
664
- | `disabled` | `boolean` | | `false` | |
665
- | `error` | `string` | | | |
666
- | `hint` | `string` | | | Texto de ayuda bajo el campo. |
667
- | `id` | `string` | | | |
668
- | `label` | `string` | | | |
669
- | `name` | `string` | | | |
670
- | `placeholder` | `string` | | | |
671
- | `required` | `boolean` | | `false` | |
781
+ | Prop | Tipo | Req. | Por defecto | Descripción |
782
+ | ------------- | ------------------------- | ---- | ----------- | ------------------------------------------------------------------------------------------------------------ |
783
+ | `onChange` | `(value: string) => void` | sí | | |
784
+ | `options` | `SelectOption[]` | sí | | |
785
+ | `value` | `string` | sí | | |
786
+ | `className` | `string` | | | |
787
+ | `disabled` | `boolean` | | `false` | |
788
+ | `error` | `string` | | | |
789
+ | `hint` | `string` | | | Texto de ayuda bajo el campo. |
790
+ | `id` | `string` | | | |
791
+ | `label` | `string` | | | |
792
+ | `labelAction` | `ReactNode` | | | Contenido junto a la etiqueta, a la derecha: un botón de ayuda ("?"), un enlace… No va dentro del `<label>`. |
793
+ | `name` | `string` | | | |
794
+ | `placeholder` | `string` | | | |
795
+ | `required` | `boolean` | | `false` | |
672
796
 
673
797
  Tipos: `SelectOption`, `SelectProps`.
674
798
 
@@ -714,42 +838,45 @@ Campo de texto con etiqueta, ayuda, advertencia, error, iconos y variantes.
714
838
  import { TextInput } from "@rubenpazch/ui";
715
839
  ```
716
840
 
717
- | Prop | Tipo | Req. | Por defecto | Descripción |
718
- | ------------------------ | --------------------------------------------------------------- | ---- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
719
- | `onChange` | `(value: string) => void` | sí | | |
720
- | `value` | `string` | sí | | |
721
- | `autoComplete` | `string` | | | |
722
- | `className` | `string` | | `` | |
723
- | `disabled` | `boolean` | | `false` | |
724
- | `emailInvalidMessage` | `string` | | | |
725
- | `emailSuggestionMessage` | `string` | | | |
726
- | `emailValidMessage` | `string` | | | |
727
- | `error` | `string` | | | |
728
- | `hint` | `string` | | | |
729
- | `icon` | `ReactNode` | | | |
730
- | `id` | `string` | | | id del input; si no se pasa se genera uno (la etiqueta se asocia sola). |
731
- | `label` | `string` | | | |
732
- | `max` | `number` | | | |
733
- | `maxLength` | `number` | | | |
734
- | `min` | `number` | | | |
735
- | `minLength` | `number` | | | |
736
- | `minLengthMessage` | `string` | | | Inline error shown when the value is non-empty but shorter than `minLength`. |
737
- | `name` | `string` | | | name del input (formularios nativos, react-hook-form…). |
738
- | `onBlur` | `() => void` | | | |
739
- | `onFocus` | `() => void` | | | |
740
- | `onValidityChange` | `(isValid: boolean) => void` | | | Fires whenever the field's overall validity changes (respecting `required`, `validateEmail`, `minLength`, `maxLength`, `pattern` and `error`). Lets the parent gate a submit button on the component's own validation, without duplicating the rules. |
741
- | `pattern` | `string` | | | |
742
- | `placeholder` | `string` | | | |
743
- | `required` | `boolean` | | `false` | |
744
- | `requiredMessage` | `string` | | | |
745
- | `requirementsLabels` | `Partial<PasswordRequirementsLabels>` | | | |
746
- | `showPasswordStrength` | `boolean` | | `false` | |
747
- | `step` | `number` | | | |
748
- | `strengthLabelPrefix` | `string` | | | |
749
- | `strengthLabels` | `Partial<Record<PasswordStrengthKey, string>>` | | | |
750
- | `type` | `"number" \| "text" \| "email" \| "tel" \| "password" \| "url"` | | `text` | |
751
- | `validateEmail` | `boolean` | | `false` | |
752
- | `warning` | `string` | | | |
841
+ | Prop | Tipo | Req. | Por defecto | Descripción |
842
+ | ------------------------ | --------------------------------------------------------------- | ---- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
843
+ | `onChange` | `(value: string) => void` | sí | | |
844
+ | `value` | `string` | sí | | |
845
+ | `autoComplete` | `string` | | | |
846
+ | `className` | `string` | | `` | |
847
+ | `disabled` | `boolean` | | `false` | |
848
+ | `emailInvalidMessage` | `string` | | | |
849
+ | `emailSuggestionMessage` | `string` | | | |
850
+ | `emailValidMessage` | `string` | | | |
851
+ | `error` | `string` | | | |
852
+ | `hint` | `string` | | | |
853
+ | `icon` | `ReactNode` | | | |
854
+ | `id` | `string` | | | id del input; si no se pasa se genera uno (la etiqueta se asocia sola). |
855
+ | `label` | `string` | | | |
856
+ | `labelAction` | `ReactNode` | | | Contenido junto a la etiqueta, a la derecha: un botón de ayuda ("?"), un enlace ("¿Olvidaste tu contraseña?")… No va dentro del `<label>`. |
857
+ | `max` | `number` | | | |
858
+ | `maxLength` | `number` | | | |
859
+ | `min` | `number` | | | |
860
+ | `minLength` | `number` | | | |
861
+ | `minLengthMessage` | `string` | | | Inline error shown when the value is non-empty but shorter than `minLength`. |
862
+ | `name` | `string` | | | name del input (formularios nativos, react-hook-form…). |
863
+ | `onBlur` | `() => void` | | | |
864
+ | `onFocus` | `() => void` | | | |
865
+ | `onValidityChange` | `(isValid: boolean) => void` | | | Fires whenever the field's overall validity changes (respecting `required`, `validateEmail`, `minLength`, `maxLength`, `pattern` and `error`). Lets the parent gate a submit button on the component's own validation, without duplicating the rules. |
866
+ | `passwordToggleLabels` | `{ show: string; hide: string; }` | | `{ show: "Mostrar contraseña", hide: "Ocultar contraseña", }` | Textos del botón de contraseña (accesibilidad). |
867
+ | `pattern` | `string` | | | |
868
+ | `placeholder` | `string` | | | |
869
+ | `required` | `boolean` | | `false` | |
870
+ | `requiredMessage` | `string` | | | |
871
+ | `requirementsLabels` | `Partial<PasswordRequirementsLabels>` | | | |
872
+ | `showPasswordStrength` | `boolean` | | `false` | |
873
+ | `showPasswordToggle` | `boolean` | | `true` | Con `type="password"`, botón para ver u ocultar lo escrito. Por defecto true. |
874
+ | `step` | `number` | | | |
875
+ | `strengthLabelPrefix` | `string` | | | |
876
+ | `strengthLabels` | `Partial<Record<PasswordStrengthKey, string>>` | | | |
877
+ | `type` | `"number" \| "text" \| "email" \| "tel" \| "password" \| "url"` | | `text` | |
878
+ | `validateEmail` | `boolean` | | `false` | |
879
+ | `warning` | `string` | | | |
753
880
 
754
881
  Tipos: `TextInputProps`, `TextInputNativeProps`.
755
882
 
@@ -788,6 +915,46 @@ import { Textarea } from "@rubenpazch/ui";
788
915
 
789
916
  Tipos: `TextareaProps`.
790
917
 
918
+ ### @rubenpazch/turnstile
919
+
920
+ Widget de Cloudflare Turnstile (anti-robots) para formularios públicos: carga el script una sola vez, entrega el token y se reinicia tras cada envío.
921
+
922
+ - **Usar cuando:** Login, registro, recuperación o cualquier formulario público que la API protege con Turnstile.
923
+ - **Evitar cuando:** Pantallas detrás de la sesión (el usuario ya está autenticado).
924
+
925
+ #### Turnstile
926
+
927
+ Verificación anti-robots de Cloudflare Turnstile para formularios públicos.
928
+ Requiere que la CSP permita `https://challenges.cloudflare.com` en script-src y frame-src.
929
+
930
+ ```tsx
931
+ import { Turnstile } from "@rubenpazch/ui";
932
+ ```
933
+
934
+ | Prop | Tipo | Req. | Por defecto | Descripción |
935
+ | ----------- | ------------------------------------- | ---- | ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
936
+ | `onToken` | `(token: string) => void` | sí | | Recibe el token, o "" cuando caduca o falla (deshabilita el envío mientras sea ""). El token se valida en el servidor y sirve una sola vez. |
937
+ | `siteKey` | `string` | sí | | Clave pública del sitio (NEXT_PUBLIC_TURNSTILE_SITE_KEY o la que entregue la API). |
938
+ | `action` | `string` | | | Acción del formulario ("login", "registro"…): el servidor puede exigir que coincida. |
939
+ | `className` | `string` | | | |
940
+ | `errorText` | `string` | | `No se pudo cargar la verificación anti-robots. Revisa tu conexión o desactiva bloqueadores y recarga la página.` | Mensaje si el widget no carga (red, bloqueadores). |
941
+ | `language` | `string` | | `es` | |
942
+ | `resetKey` | `number` | | `0` | Cambia este número después de cada envío para pedir un token nuevo. |
943
+ | `size` | `"normal" \| "flexible" \| "compact"` | | `flexible` | |
944
+ | `theme` | `"auto" \| "light" \| "dark"` | | `auto` | |
945
+
946
+ #### TURNSTILE_SCRIPT
947
+
948
+ ```tsx
949
+ import { TURNSTILE_SCRIPT } from "@rubenpazch/ui";
950
+ ```
951
+
952
+ _Sin props documentadas._
953
+
954
+ Otras exportaciones: `cargarTurnstile`.
955
+
956
+ Tipos: `TurnstileProps`.
957
+
791
958
  ## Navegación
792
959
 
793
960
  ### @rubenpazch/app-shell
@@ -907,6 +1074,8 @@ import { Drawer } from "@rubenpazch/ui";
907
1074
  | `size` | `"sm" \| "md" \| "lg" \| "xl" \| "full"` | | `md` | Size of the drawer |
908
1075
  | `title` | `string` | | | Title displayed in the drawer header |
909
1076
 
1077
+ Tipos: `DrawerPosition`, `DrawerSize`, `DrawerAlign`, `DrawerProps`.
1078
+
910
1079
  ### @rubenpazch/month-navigator
911
1080
 
912
1081
  Navegador de periodos ‹ noviembre de 2026 › con valor "AAAA-MM", mínimo, máximo y botón Hoy; incluye addMonths() y currentMonth().
@@ -1162,6 +1331,8 @@ import { ConfirmationDialog } from "@rubenpazch/ui";
1162
1331
  | `isDangerous` | `boolean` | | `false` | Acción destructiva: botón rojo. |
1163
1332
  | `isLoading` | `boolean` | | `false` | Muestra el botón de confirmar cargando y bloquea los botones. |
1164
1333
 
1334
+ Tipos: `ConfirmationDialogProps`.
1335
+
1165
1336
  ### @rubenpazch/empty-state
1166
1337
 
1167
1338
  Estado vacío con icono, título, descripción y acciones ("No hay convocatorias · Crear").
@@ -1205,14 +1376,14 @@ Displays a loading indicator with multiple style variants
1205
1376
  import { LoadingSpinner } from "@rubenpazch/ui";
1206
1377
  ```
1207
1378
 
1208
- | Prop | Tipo | Req. | Por defecto | Descripción |
1209
- | ----------- | ------------------------------------------ | ---- | ----------- | ----------- |
1210
- | `className` | `string` | | `` | |
1211
- | `color` | `"blue" \| "gray" \| "white"` | | `blue` | |
1212
- | `inline` | `boolean` | | `false` | |
1213
- | `message` | `string` | | | |
1214
- | `size` | `"sm" \| "md" \| "lg"` | | `md` | |
1215
- | `variant` | `"spinner" \| "dots" \| "pulse" \| "ring"` | | `spinner` | |
1379
+ | Prop | Tipo | Req. | Por defecto | Descripción |
1380
+ | ----------- | ------------------------------------------ | ---- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1381
+ | `className` | `string` | | `` | |
1382
+ | `color` | `"primary" \| "gray" \| "white" \| "blue"` | | `primary` | primary (por defecto): color de la marca (--lb-color-primary). gray: neutro. white: sobre fondos de color. "blue" es el nombre antiguo de "primary" (sigue funcionando). |
1383
+ | `inline` | `boolean` | | `false` | |
1384
+ | `message` | `string` | | | |
1385
+ | `size` | `"sm" \| "md" \| "lg"` | | `md` | |
1386
+ | `variant` | `"spinner" \| "dots" \| "pulse" \| "ring"` | | `spinner` | |
1216
1387
 
1217
1388
  ### @rubenpazch/modal
1218
1389
 
@@ -1565,6 +1736,33 @@ import { Chip } from "@rubenpazch/ui";
1565
1736
 
1566
1737
  Tipos: `ChipVariant`, `ChipColor`, `ChipSize`, `ChipProps`.
1567
1738
 
1739
+ ### @rubenpazch/description-list
1740
+
1741
+ Pares etiqueta/valor en columnas: resumen de un registro (datos de un trámite, de un cliente, de un pago).
1742
+
1743
+ - **Usar cuando:** Mostrar varios datos de solo lectura de un registro, con etiquetas.
1744
+ - **Evitar cuando:** Datos tabulares de muchos registros: usa DataTable. Una sola fila con icono: usa InfoRow.
1745
+
1746
+ #### DescriptionList
1747
+
1748
+ Pares etiqueta/valor de solo lectura (`<dl>`): resumen de un registro.
1749
+
1750
+ ```tsx
1751
+ import { DescriptionList } from "@rubenpazch/ui";
1752
+ ```
1753
+
1754
+ | Prop | Tipo | Req. | Por defecto | Descripción |
1755
+ | ------------ | ------------------- | ---- | ------------ | ----------------------------------------------------------------- |
1756
+ | `items` | `DescriptionItem[]` | sí | | |
1757
+ | `className` | `string` | | | |
1758
+ | `columns` | `1 \| 2 \| 3` | | `2` | Columnas en pantallas anchas (en móvil siempre 1). Por defecto 2. |
1759
+ | `emptyText` | `ReactNode` | | `Sin datos.` | Texto si no hay ningún dato. |
1760
+ | `emptyValue` | `ReactNode` | | `—` | Qué mostrar si un valor está vacío. |
1761
+ | `footnote` | `ReactNode` | | | Nota al pie (fuente de los datos, aclaraciones). |
1762
+ | `title` | `ReactNode` | | | Título opcional sobre la lista. |
1763
+
1764
+ Tipos: `DescriptionItem`, `DescriptionListProps`.
1765
+
1568
1766
  ### @rubenpazch/info-row
1569
1767
 
1570
1768
  Fila de dato con icono, etiqueta y valor (variantes de color, tamaños, acción opcional).
@@ -1595,6 +1793,34 @@ import { InfoRow } from "@rubenpazch/ui";
1595
1793
  | `size` | `"xs" \| "sm" \| "md" \| "lg"` | | `md` | |
1596
1794
  | `variant` | `"default" \| "blue" \| "yellow" \| "purple" \| "green" \| "red" \| "indigo" \| "gray"` | | `default` | |
1597
1795
 
1796
+ ### @rubenpazch/timeline
1797
+
1798
+ Línea de tiempo vertical: historial de un trámite, pedido o expediente (eventos con estado, fecha y descripción).
1799
+
1800
+ - **Usar cuando:** Mostrar el historial o seguimiento de algo en orden cronológico.
1801
+ - **Evitar cuando:** Pasos de un proceso que el usuario recorre ahora: usa Stepper.
1802
+
1803
+ #### Timeline
1804
+
1805
+ Línea de tiempo vertical: historial de un trámite, pedido o expediente, en orden.
1806
+ Genérica: el significado de cada estado lo decide la app (p. ej. un envoltorio local que
1807
+ convierte los estados del trámite en `items`).
1808
+
1809
+ ```tsx
1810
+ import { Timeline } from "@rubenpazch/ui";
1811
+ ```
1812
+
1813
+ | Prop | Tipo | Req. | Por defecto | Descripción |
1814
+ | --------------- | ---------------- | ---- | ---------------------- | ------------------------------------------------------------------- |
1815
+ | `items` | `TimelineItem[]` | sí | | |
1816
+ | `aria-label` | `string` | | | Nombre accesible de la lista, p. ej. "Historial del trámite". |
1817
+ | `className` | `string` | | | |
1818
+ | `dense` | `boolean` | | `false` | Más compacto (menos espacio entre eventos). |
1819
+ | `emptyText` | `ReactNode` | | `Sin eventos todavía.` | Texto cuando no hay eventos. |
1820
+ | `highlightLast` | `boolean` | | `false` | El último evento se marca como el estado actual (anillo y negrita). |
1821
+
1822
+ Tipos: `TimelineItem`, `TimelineProps`, `TimelineStatus`.
1823
+
1598
1824
  ### @rubenpazch/tooltip
1599
1825
 
1600
1826
  Texto de ayuda breve al pasar el mouse o enfocar con teclado (role="tooltip", aria-describedby), se cierra con Escape.
@@ -1719,6 +1945,8 @@ import { DraggableList } from "@rubenpazch/ui";
1719
1945
  | `size` | `"sm" \| "md" \| "lg"` | | `md` | |
1720
1946
  | `variant` | `"default" \| "outline" \| "subtle"` | | `default` | |
1721
1947
 
1948
+ Tipos: `DraggableListProps`.
1949
+
1722
1950
  ## Iconos
1723
1951
 
1724
1952
  ### @rubenpazch/icons
@@ -1871,3 +2099,5 @@ import { PrescriptionEyeCard } from "@rubenpazch/ui";
1871
2099
  | `eyeInfo` | `PrescriptionEyeInfo` | sí | | |
1872
2100
  | `labels` | `PrescriptionEyeCardLabels` | sí | | |
1873
2101
  | `prismBaseLookup` | `{ getNameByKey: (key: string) => string; }` | sí | | |
2102
+
2103
+ Tipos: `PrescriptionEyeInfo`, `PrescriptionEyeCardLabels`, `PrescriptionEyeCardProps`.