@rubenpazch/ui 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +37 -1
- package/dist/index.cjs.js +24 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.esm.js +3 -1
- package/dist/index.esm.js.map +1 -1
- package/docs/COMPONENTES.md +149 -29
- package/docs/catalogo.json +265 -2
- package/package.json +22 -20
package/AGENTS.md
CHANGED
|
@@ -98,7 +98,7 @@ rutas internas (`dist/…`).
|
|
|
98
98
|
| Elegir el mes de trabajo | `MonthNavigator` |
|
|
99
99
|
| Mostrar un estado | `Badge` |
|
|
100
100
|
| Agrupar información | `Card` + `CardHeader` / `CardBody` / `CardFooter` |
|
|
101
|
-
|
|
|
101
|
+
| Aviso fijo en la página / mensaje del servidor | `Alert` / `useToast()` (ver **Mensajes**) |
|
|
102
102
|
| Confirmar / editar en ventana | `ConfirmationDialog` / `Modal` |
|
|
103
103
|
| Acciones de una fila | `Menu` (⋮) |
|
|
104
104
|
| Cargando | `Skeleton` (contenido), `LoadingSpinner` (botón), `OverlayLoader` (pantalla), `ProgressBar` (avance) |
|
|
@@ -140,6 +140,42 @@ export default function PanelLayout({
|
|
|
140
140
|
}
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
+
## Mensajes (regla para todas las apps)
|
|
144
|
+
|
|
145
|
+
| Situación | Cómo se muestra |
|
|
146
|
+
| ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
|
|
147
|
+
| **Dentro de la app** (usuario con sesión): resultado de una acción o error del servidor ("Usuario guardado", "No se pudo eliminar") | **Toast**: `const toast = useToast(); toast.exito("…"); toast.error(err.message);` |
|
|
148
|
+
| **Fuera de la app** (sin sesión): login, registro, recuperar contraseña | **En el formulario**: un texto con `role="alert"` bajo el botón, o `Alert` dentro del formulario. **Nunca toast.** |
|
|
149
|
+
| Error de un campo concreto ("Correo inválido") | La prop `error` del campo (`TextInput`, `Select`…), en cualquier pantalla |
|
|
150
|
+
| Estado que describe la página y no una acción ("Esta instancia solo permite…", "Sin permisos") | `Alert` en la página (`role="note"` si no debe anunciarse) |
|
|
151
|
+
| Confirmar algo destructivo | `ConfirmationDialog`. Nunca `window.alert` ni `window.confirm` |
|
|
152
|
+
|
|
153
|
+
`AppShell` ya incluye `ToastProvider`, así que en un panel `useToast()` funciona sin configurar nada.
|
|
154
|
+
Fuera de `AppShell` (las pantallas públicas) `useToast()` lanza un error a propósito: ahí el mensaje
|
|
155
|
+
va en el formulario.
|
|
156
|
+
|
|
157
|
+
```tsx
|
|
158
|
+
function GuardarUsuario() {
|
|
159
|
+
const toast = useToast();
|
|
160
|
+
async function guardar() {
|
|
161
|
+
try {
|
|
162
|
+
await api.guardar(datos);
|
|
163
|
+
toast.exito("Usuario guardado.");
|
|
164
|
+
} catch (err) {
|
|
165
|
+
toast.error((err as Error).message);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Valores por defecto que conviene conocer
|
|
172
|
+
|
|
173
|
+
- `Button` es `variant="text"` (sin fondo) por defecto: el botón principal de una acción lleva
|
|
174
|
+
`variant="contained"`, el secundario `variant="outlined"`. Su `type` por defecto es `"button"`:
|
|
175
|
+
para enviar un formulario usa `type="submit"`.
|
|
176
|
+
- `TextInput` con `maxLength` muestra un contador de caracteres. Úsalo cuando el límite importa al
|
|
177
|
+
usuario, no como validación de seguridad (esa va en el servidor).
|
|
178
|
+
|
|
143
179
|
## Textos
|
|
144
180
|
|
|
145
181
|
La interfaz va en **español**. Varios componentes reciben un objeto `labels` con todos sus textos
|
package/dist/index.cjs.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
var alert = require('@rubenpazch/alert');
|
|
5
5
|
var appShell = require('@rubenpazch/app-shell');
|
|
6
|
+
var authGate = require('@rubenpazch/auth-gate');
|
|
6
7
|
var autocomplete = require('@rubenpazch/autocomplete');
|
|
7
8
|
var avatar = require('@rubenpazch/avatar');
|
|
8
9
|
var badge = require('@rubenpazch/badge');
|
|
@@ -52,11 +53,17 @@ var textarea = require('@rubenpazch/textarea');
|
|
|
52
53
|
var toast = require('@rubenpazch/toast');
|
|
53
54
|
var tokens = require('@rubenpazch/tokens');
|
|
54
55
|
var tooltip = require('@rubenpazch/tooltip');
|
|
56
|
+
var userCard = require('@rubenpazch/user-card');
|
|
55
57
|
|
|
56
58
|
|
|
57
59
|
|
|
58
60
|
exports.Alert = alert;
|
|
59
61
|
exports.AppShell = appShell;
|
|
62
|
+
exports.AuthGate = authGate;
|
|
63
|
+
Object.defineProperty(exports, "AuthScreen", {
|
|
64
|
+
enumerable: true,
|
|
65
|
+
get: function () { return authGate.AuthScreen; }
|
|
66
|
+
});
|
|
60
67
|
exports.Autocomplete = autocomplete;
|
|
61
68
|
Object.defineProperty(exports, "Avatar", {
|
|
62
69
|
enumerable: true,
|
|
@@ -697,6 +704,18 @@ Object.defineProperty(exports, "ToastBanner", {
|
|
|
697
704
|
enumerable: true,
|
|
698
705
|
get: function () { return toast.ToastBanner; }
|
|
699
706
|
});
|
|
707
|
+
Object.defineProperty(exports, "ToastProvider", {
|
|
708
|
+
enumerable: true,
|
|
709
|
+
get: function () { return toast.ToastProvider; }
|
|
710
|
+
});
|
|
711
|
+
Object.defineProperty(exports, "ToastRegion", {
|
|
712
|
+
enumerable: true,
|
|
713
|
+
get: function () { return toast.ToastRegion; }
|
|
714
|
+
});
|
|
715
|
+
Object.defineProperty(exports, "useToast", {
|
|
716
|
+
enumerable: true,
|
|
717
|
+
get: function () { return toast.useToast; }
|
|
718
|
+
});
|
|
700
719
|
Object.defineProperty(exports, "color", {
|
|
701
720
|
enumerable: true,
|
|
702
721
|
get: function () { return tokens.color; }
|
|
@@ -742,4 +761,9 @@ Object.defineProperty(exports, "tokens", {
|
|
|
742
761
|
get: function () { return tokens.tokens; }
|
|
743
762
|
});
|
|
744
763
|
exports.Tooltip = tooltip;
|
|
764
|
+
exports.UserCard = userCard;
|
|
765
|
+
Object.defineProperty(exports, "initials", {
|
|
766
|
+
enumerable: true,
|
|
767
|
+
get: function () { return userCard.initials; }
|
|
768
|
+
});
|
|
745
769
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as Alert, AlertProps, AlertVariant } from '@rubenpazch/alert';
|
|
2
2
|
export { default as AppShell, AppShellProps } from '@rubenpazch/app-shell';
|
|
3
|
+
export { default as AuthGate, AuthGateLabels, AuthGateProps, AuthScreen } from '@rubenpazch/auth-gate';
|
|
3
4
|
export { default as Autocomplete } from '@rubenpazch/autocomplete';
|
|
4
5
|
export { Avatar, AvatarGroup, AvatarGroupProps, AvatarGroupSpacing, AvatarProps, AvatarSize, AvatarVariant } from '@rubenpazch/avatar';
|
|
5
6
|
export { default as Badge, BadgeColor, BadgeProps, BadgeVariant } from '@rubenpazch/badge';
|
|
@@ -46,6 +47,7 @@ export { default as Switch, SwitchProps } from '@rubenpazch/switch';
|
|
|
46
47
|
export { default as Tabs } from '@rubenpazch/tabs';
|
|
47
48
|
export { default as TextInput, TextInputNativeProps, TextInputProps } from '@rubenpazch/text-input';
|
|
48
49
|
export { default as Textarea, TextareaProps } from '@rubenpazch/textarea';
|
|
49
|
-
export { ToastAction, ToastBanner, ToastBannerProps, ToastItem, ToastType } from '@rubenpazch/toast';
|
|
50
|
+
export { ToastAction, ToastApi, ToastBanner, ToastBannerProps, ToastItem, ToastOptions, ToastProvider, ToastProviderProps, ToastRegion, ToastType, useToast } from '@rubenpazch/toast';
|
|
50
51
|
export { Tokens, color, cssVar, fontFamily, fontSize, fontWeight, letterSpacing, lineHeight, radius, shadow, space, tokens } from '@rubenpazch/tokens';
|
|
51
52
|
export { default as Tooltip, TooltipProps } from '@rubenpazch/tooltip';
|
|
53
|
+
export { default as UserCard, UserCardProps, initials } from '@rubenpazch/user-card';
|
package/dist/index.esm.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
export { default as Alert } from '@rubenpazch/alert';
|
|
3
3
|
export { default as AppShell } from '@rubenpazch/app-shell';
|
|
4
|
+
export { default as AuthGate, AuthScreen } from '@rubenpazch/auth-gate';
|
|
4
5
|
export { default as Autocomplete } from '@rubenpazch/autocomplete';
|
|
5
6
|
export { Avatar, AvatarGroup } from '@rubenpazch/avatar';
|
|
6
7
|
export { default as Badge } from '@rubenpazch/badge';
|
|
@@ -47,7 +48,8 @@ export { default as Switch } from '@rubenpazch/switch';
|
|
|
47
48
|
export { default as Tabs } from '@rubenpazch/tabs';
|
|
48
49
|
export { default as TextInput } from '@rubenpazch/text-input';
|
|
49
50
|
export { default as Textarea } from '@rubenpazch/textarea';
|
|
50
|
-
export { ToastBanner } from '@rubenpazch/toast';
|
|
51
|
+
export { ToastBanner, ToastProvider, ToastRegion, useToast } from '@rubenpazch/toast';
|
|
51
52
|
export { color, cssVar, fontFamily, fontSize, fontWeight, letterSpacing, lineHeight, radius, shadow, space, tokens } from '@rubenpazch/tokens';
|
|
52
53
|
export { default as Tooltip } from '@rubenpazch/tooltip';
|
|
54
|
+
export { default as UserCard, initials } from '@rubenpazch/user-card';
|
|
53
55
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/docs/COMPONENTES.md
CHANGED
|
@@ -17,6 +17,7 @@ librería (ver AGENTS.md del repo lbyte-ui-library), no lo copies en la app.
|
|
|
17
17
|
| ----------------------------------------------------------------------- | -------------------------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
18
18
|
| [`@rubenpazch/alert`](#rubenpazchalert) | Retroalimentación | Alert | Aviso dentro de la página (info, success, warning, danger) con título, acción y cierre opcional. |
|
|
19
19
|
| [`@rubenpazch/app-shell`](#rubenpazchapp-shell) | Navegación | AppShell | Estructura completa de un panel: Sidebar colapsable, cabecera fija con botón ☰ en móvil, título y acciones, enlace "Saltar al contenido" y área principal con ancho máximo. |
|
|
20
|
+
| [`@rubenpazch/auth-gate`](#rubenpazchauth-gate) | Navegación | AuthGate, AuthScreen | Puerta de sesión: comprueba el token, confirma con el servidor (/me) y solo entonces pinta la app; mientras, una pantalla neutra. Sin sesión, va al login sin mostrar nada. |
|
|
20
21
|
| [`@rubenpazch/autocomplete`](#rubenpazchautocomplete) | Formularios | Autocomplete | Selector con búsqueda sobre una lista de opciones (con descripción, carga y opción de limpiar). |
|
|
21
22
|
| [`@rubenpazch/avatar`](#rubenpazchavatar) | Presentación de datos | Avatar, AvatarGroup | Avatar de persona (imagen, iniciales o icono) y AvatarGroup para varios. |
|
|
22
23
|
| [`@rubenpazch/badge`](#rubenpazchbadge) | Presentación de datos | Badge | Insignia de estado o categoría (Pagado, Vencido, Borrador) con colores semánticos, variantes soft/solid/outline y punto. |
|
|
@@ -63,9 +64,10 @@ librería (ver AGENTS.md del repo lbyte-ui-library), no lo copies en la app.
|
|
|
63
64
|
| [`@rubenpazch/tabs`](#rubenpazchtabs) | Navegación | Tabs | Pestañas para alternar entre secciones de una misma vista. |
|
|
64
65
|
| [`@rubenpazch/text-input`](#rubenpazchtext-input) | Formularios | TextInput | Campo de texto con etiqueta, ayuda, advertencia, error, iconos y variantes. |
|
|
65
66
|
| [`@rubenpazch/textarea`](#rubenpazchtextarea) | Formularios | Textarea | Área de texto con etiqueta, ayuda, advertencia, error, contador de caracteres y crecimiento automático. |
|
|
66
|
-
| [`@rubenpazch/toast`](#rubenpazchtoast) | Retroalimentación | ToastBanner
|
|
67
|
+
| [`@rubenpazch/toast`](#rubenpazchtoast) | Retroalimentación | ToastBanner, ToastProvider, ToastRegion, useToast | Notificaciones temporales (Toast) y avisos fijos (ToastBanner) con tipos y acciones. |
|
|
67
68
|
| [`@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. |
|
|
68
69
|
| [`@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. |
|
|
70
|
+
| [`@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ú ⋮. |
|
|
69
71
|
|
|
70
72
|
## Base (tokens y utilidades)
|
|
71
73
|
|
|
@@ -804,26 +806,76 @@ Es la base de todas las pantallas de administración.
|
|
|
804
806
|
import { AppShell } from "@rubenpazch/ui";
|
|
805
807
|
```
|
|
806
808
|
|
|
807
|
-
| Prop | Tipo | Req. | Por defecto | Descripción
|
|
808
|
-
| ------------------- | ------------------------------------------------------- | ---- | ----------- |
|
|
809
|
-
| `children` | `ReactNode` | sí | | Contenido de la página.
|
|
810
|
-
| `sections` | `SidebarSection[]` | sí | | Secciones del menú.
|
|
811
|
-
| `brand` | `ReactNode` | | | Logo o nombre de la app arriba.
|
|
812
|
-
| `brandCollapsed` | `ReactNode` | | | Versión compacta del logo para el modo colapsado (por defecto se oculta `brand`).
|
|
813
|
-
| `collapsed` | `boolean` | | | Colapsado (controlado).
|
|
814
|
-
| `currentPath` | `string` | | | Ruta actual (p. ej. usePathname() de Next) para marcar la opción activa.
|
|
815
|
-
| `defaultCollapsed` | `boolean` | | | Colapsado inicial (no controlado).
|
|
816
|
-
| `headerActions` | `ReactNode` | | | Acciones a la derecha de la cabecera: notificaciones, usuario.
|
|
817
|
-
| `labels` | `Partial<{ openMenu: string; skipToContent: string; }>` | | | Textos accesibles.
|
|
818
|
-
| `linkComponent` | `ElementType<any, keyof IntrinsicElements>` | | | Componente de enlace (Link de Next.js). Por defecto <a>.
|
|
819
|
-
| `
|
|
820
|
-
| `
|
|
821
|
-
| `
|
|
822
|
-
| `
|
|
823
|
-
| `
|
|
809
|
+
| Prop | Tipo | Req. | Por defecto | Descripción |
|
|
810
|
+
| ------------------- | ------------------------------------------------------- | ---- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
811
|
+
| `children` | `ReactNode` | sí | | Contenido de la página. |
|
|
812
|
+
| `sections` | `SidebarSection[]` | sí | | Secciones del menú. |
|
|
813
|
+
| `brand` | `ReactNode` | | | Logo o nombre de la app arriba. |
|
|
814
|
+
| `brandCollapsed` | `ReactNode` | | | Versión compacta del logo para el modo colapsado (por defecto se oculta `brand`). |
|
|
815
|
+
| `collapsed` | `boolean` | | | Colapsado (controlado). |
|
|
816
|
+
| `currentPath` | `string` | | | Ruta actual (p. ej. usePathname() de Next) para marcar la opción activa. |
|
|
817
|
+
| `defaultCollapsed` | `boolean` | | | Colapsado inicial (no controlado). |
|
|
818
|
+
| `headerActions` | `ReactNode` | | | Acciones a la derecha de la cabecera: notificaciones, usuario. |
|
|
819
|
+
| `labels` | `Partial<{ openMenu: string; skipToContent: string; }>` | | | Textos accesibles. |
|
|
820
|
+
| `linkComponent` | `ElementType<any, keyof IntrinsicElements>` | | | Componente de enlace (Link de Next.js). Por defecto <a>. |
|
|
821
|
+
| `loading` | `boolean` | | `false` | Carga del contenido al cambiar de pantalla: solo el área de contenido muestra el indicador (el menú y la cabecera no cambian). Los hijos siguen montados, atenuados y sin interacción. |
|
|
822
|
+
| `loadingLabel` | `string` | | `Cargando…` | Texto accesible de la carga. |
|
|
823
|
+
| `maxWidth` | `"none" \| "md" \| "lg"` | | `lg` | Ancho máximo del contenido: none, lg (72rem, por defecto) o md (56rem). |
|
|
824
|
+
| `onCollapsedChange` | `(collapsed: boolean) => void` | | | Al colapsar o expandir. |
|
|
825
|
+
| `sidebarFooter` | `ReactNode` | | | Contenido al pie de la barra lateral (usuario, "Cerrar sesión"). |
|
|
826
|
+
| `storageKey` | `string` | | | Clave de localStorage para recordar si estaba colapsado. |
|
|
827
|
+
| `title` | `ReactNode` | | | Título en la cabecera (en móvil se ve junto al botón ☰). |
|
|
828
|
+
| `toasts` | `boolean` | | `true` | Incluye `ToastProvider`: dentro del panel, `useToast()` muestra los mensajes del servidor como toast bajo la cabecera. Pon `false` solo si la app ya tiene su propio proveedor más arriba. |
|
|
824
829
|
|
|
825
830
|
Tipos: `AppShellProps`.
|
|
826
831
|
|
|
832
|
+
### @rubenpazch/auth-gate
|
|
833
|
+
|
|
834
|
+
Puerta de sesión: comprueba el token, confirma con el servidor (/me) y solo entonces pinta la app; mientras, una pantalla neutra. Sin sesión, va al login sin mostrar nada.
|
|
835
|
+
|
|
836
|
+
- **Usar cuando:** Raíz de toda app con sesión (paneles, módulos), envolviendo AppShell.
|
|
837
|
+
- **Evitar cuando:** Pantallas públicas (login, registro, landing).
|
|
838
|
+
|
|
839
|
+
#### AuthGate
|
|
840
|
+
|
|
841
|
+
Puerta de sesión para la raíz de toda app con sesión (decisión 0006 de lbyte-contexto):
|
|
842
|
+
|
|
843
|
+
1. sin token → al login sin pintar nada de la app;
|
|
844
|
+
2. con token → pantalla neutra mientras `verify()` (/me) confirma;
|
|
845
|
+
3. confirmada → pinta la app; rechazada → al login.
|
|
846
|
+
Un 401 posterior (`logoutEvent`) oculta la app y va al login.
|
|
847
|
+
|
|
848
|
+
Es experiencia de usuario, no seguridad: la API sigue respondiendo 401.
|
|
849
|
+
|
|
850
|
+
```tsx
|
|
851
|
+
import { AuthGate } from "@rubenpazch/ui";
|
|
852
|
+
```
|
|
853
|
+
|
|
854
|
+
| Prop | Tipo | Req. | Por defecto | Descripción |
|
|
855
|
+
| ------------------- | ------------------------- | ---- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
856
|
+
| `children` | `ReactNode` | sí | | La app; recibe lo que devolvió `verify` (usuario, permisos…). |
|
|
857
|
+
| `hasSession` | `() => boolean` | sí | | Comprobación local inmediata (sin red): ¿hay token o cookie de sesión y no está vencido? Si devuelve false se va al login sin pintar nada de la app. |
|
|
858
|
+
| `onUnauthenticated` | `() => void` | sí | | Ir al login (p. ej. `window.location.href = AUTH_URL`). |
|
|
859
|
+
| `verify` | `() => Promise<T>` | sí | | Confirma la sesión con el servidor (p. ej. `GET /me`). Si rechaza, se va al login. |
|
|
860
|
+
| `brand` | `ReactNode` | | | Marca de la organización sobre el texto (logo o nombre). |
|
|
861
|
+
| `labels` | `Partial<AuthGateLabels>` | | | Textos; por defecto en español. |
|
|
862
|
+
| `logoutEvent` | `string \| false` | | `auth:logout` | Evento global que indica que la sesión terminó (un 401 a mitad de uso). Al recibirlo se oculta la app tras la pantalla neutra y se va al login. Por defecto "auth:logout". |
|
|
863
|
+
|
|
864
|
+
#### AuthScreen
|
|
865
|
+
|
|
866
|
+
Pantalla neutra a pantalla completa: sin datos ni estructura de la app.
|
|
867
|
+
|
|
868
|
+
```tsx
|
|
869
|
+
import { AuthScreen } from "@rubenpazch/ui";
|
|
870
|
+
```
|
|
871
|
+
|
|
872
|
+
| Prop | Tipo | Req. | Por defecto | Descripción |
|
|
873
|
+
| ------- | ----------- | ---- | ----------- | ----------- |
|
|
874
|
+
| `label` | `string` | sí | | |
|
|
875
|
+
| `brand` | `ReactNode` | | | |
|
|
876
|
+
|
|
877
|
+
Tipos: `AuthGateProps`, `AuthGateLabels`.
|
|
878
|
+
|
|
827
879
|
### @rubenpazch/drawer
|
|
828
880
|
|
|
829
881
|
Panel lateral (izquierda/derecha/arriba/abajo) con animación y fondo.
|
|
@@ -1067,16 +1119,17 @@ Aviso dentro de la página (no flotante): información, éxito, advertencia o er
|
|
|
1067
1119
|
import { Alert } from "@rubenpazch/ui";
|
|
1068
1120
|
```
|
|
1069
1121
|
|
|
1070
|
-
| Prop | Tipo | Req. | Por defecto | Descripción
|
|
1071
|
-
| ------------ | ---------------------------------------------- | ---- | -------------- |
|
|
1072
|
-
| `action` | `ReactNode` | | | Acción a la derecha o abajo (p. ej. un Button "Reintentar").
|
|
1073
|
-
| `children` | `ReactNode` | | | Texto del aviso.
|
|
1074
|
-
| `className` | `string` | | | Clase extra.
|
|
1075
|
-
| `closeLabel` | `string` | | `Cerrar aviso` | Texto accesible del botón ×.
|
|
1076
|
-
| `icon` | `ReactNode` | | | Icono propio; `false` para ocultarlo. Por defecto uno según el tipo.
|
|
1077
|
-
| `onClose` | `() => void` | | | Si se pasa, muestra el botón × y se llama al cerrarlo.
|
|
1078
|
-
| `
|
|
1079
|
-
| `
|
|
1122
|
+
| Prop | Tipo | Req. | Por defecto | Descripción |
|
|
1123
|
+
| ------------ | ---------------------------------------------- | ---- | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1124
|
+
| `action` | `ReactNode` | | | Acción a la derecha o abajo (p. ej. un Button "Reintentar"). |
|
|
1125
|
+
| `children` | `ReactNode` | | | Texto del aviso. |
|
|
1126
|
+
| `className` | `string` | | | Clase extra. |
|
|
1127
|
+
| `closeLabel` | `string` | | `Cerrar aviso` | Texto accesible del botón ×. |
|
|
1128
|
+
| `icon` | `ReactNode` | | | Icono propio; `false` para ocultarlo. Por defecto uno según el tipo. |
|
|
1129
|
+
| `onClose` | `() => void` | | | Si se pasa, muestra el botón × y se llama al cerrarlo. |
|
|
1130
|
+
| `role` | `"alert" \| "status" \| "note"` | | | Rol ARIA. Por defecto `alert` (warning/danger) o `status` (info/success), que se anuncian al aparecer. Para un aviso fijo que ya está en la página al cargar, usa `"note"`. |
|
|
1131
|
+
| `title` | `ReactNode` | | | Título en negrita (opcional). |
|
|
1132
|
+
| `variant` | `"info" \| "success" \| "warning" \| "danger"` | | `info` | Tipo de mensaje: info (por defecto), success, warning o danger. |
|
|
1080
1133
|
|
|
1081
1134
|
Tipos: `AlertProps`, `AlertVariant`.
|
|
1082
1135
|
|
|
@@ -1317,7 +1370,39 @@ import { ToastBanner } from "@rubenpazch/ui";
|
|
|
1317
1370
|
| `className` | `string` | | | |
|
|
1318
1371
|
| `closeAriaLabel` | `string` | | `Cerrar notificación` | |
|
|
1319
1372
|
|
|
1320
|
-
|
|
1373
|
+
#### ToastProvider
|
|
1374
|
+
|
|
1375
|
+
Mensajes del servidor dentro de la app (usuario con sesión). `AppShell` ya lo incluye y los
|
|
1376
|
+
muestra bajo su cabecera; úsalo directamente solo en un layout propio.
|
|
1377
|
+
|
|
1378
|
+
En pantallas públicas (login, registro, recuperación) NO se usa: ahí el mensaje va junto al
|
|
1379
|
+
formulario. Por eso `useToast()` falla fuera de un proveedor.
|
|
1380
|
+
|
|
1381
|
+
```tsx
|
|
1382
|
+
import { ToastProvider } from "@rubenpazch/ui";
|
|
1383
|
+
```
|
|
1384
|
+
|
|
1385
|
+
| Prop | Tipo | Req. | Por defecto | Descripción |
|
|
1386
|
+
| ---------------- | ------------------------ | ---- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1387
|
+
| `closeAriaLabel` | `string` | | `Cerrar mensaje` | Texto accesible del botón ×. |
|
|
1388
|
+
| `offsetTop` | `string` | | | Distancia desde arriba en modo `floating`. |
|
|
1389
|
+
| `placement` | `"floating" \| "inline"` | | `floating` | `floating` (por defecto): flotan arriba a la derecha. `inline`: no se pintan aquí; el layout pone `<ToastRegion />` en su sitio (AppShell lo hace bajo su cabecera, sin tapar el menú ni el contenido). |
|
|
1390
|
+
|
|
1391
|
+
#### ToastRegion
|
|
1392
|
+
|
|
1393
|
+
Pinta los toasts de un `ToastProvider placement="inline"` en el lugar del layout donde se ponga.
|
|
1394
|
+
|
|
1395
|
+
```tsx
|
|
1396
|
+
import { ToastRegion } from "@rubenpazch/ui";
|
|
1397
|
+
```
|
|
1398
|
+
|
|
1399
|
+
| Prop | Tipo | Req. | Por defecto | Descripción |
|
|
1400
|
+
| ----------- | -------- | ---- | ----------- | ----------- |
|
|
1401
|
+
| `className` | `string` | | | |
|
|
1402
|
+
|
|
1403
|
+
Otras exportaciones: `useToast`.
|
|
1404
|
+
|
|
1405
|
+
Tipos: `ToastAction`, `ToastBannerProps`, `ToastItem`, `ToastType`, `ToastApi`, `ToastOptions`, `ToastProviderProps`.
|
|
1321
1406
|
|
|
1322
1407
|
## Presentación de datos
|
|
1323
1408
|
|
|
@@ -1535,6 +1620,41 @@ import { Tooltip } from "@rubenpazch/ui";
|
|
|
1535
1620
|
|
|
1536
1621
|
Tipos: `TooltipProps`.
|
|
1537
1622
|
|
|
1623
|
+
### @rubenpazch/user-card
|
|
1624
|
+
|
|
1625
|
+
Tarjeta de una persona (usuario, socio, cliente): avatar, nombre, correo u otro dato, etiquetas y acciones; las secundarias van en un menú ⋮.
|
|
1626
|
+
|
|
1627
|
+
- **Usar cuando:** Listas de personas en cuadrícula: usuarios de un panel, socios, clientes, pacientes.
|
|
1628
|
+
- **Evitar cuando:** Listas largas o con muchas columnas para comparar: usa DataTable.
|
|
1629
|
+
|
|
1630
|
+
#### UserCard
|
|
1631
|
+
|
|
1632
|
+
Tarjeta de una persona: avatar, nombre, dato secundario, etiquetas y acciones.
|
|
1633
|
+
Las acciones principales se ven en el pie; las secundarias van en un menú ⋮ para que la
|
|
1634
|
+
tarjeta no se llene de botones.
|
|
1635
|
+
|
|
1636
|
+
```tsx
|
|
1637
|
+
import { UserCard } from "@rubenpazch/ui";
|
|
1638
|
+
```
|
|
1639
|
+
|
|
1640
|
+
| Prop | Tipo | Req. | Por defecto | Descripción |
|
|
1641
|
+
| ----------- | ---------------------------- | ---- | ----------- | ---------------------------------------------------------------------- |
|
|
1642
|
+
| `name` | `string` | sí | | Nombre visible. |
|
|
1643
|
+
| `actions` | `ReactNode` | | | Acciones principales visibles en el pie (una o dos `Button`). |
|
|
1644
|
+
| `as` | `"article" \| "li" \| "div"` | | `article` | |
|
|
1645
|
+
| `avatarSrc` | `string` | | | Foto. Sin ella se muestran las iniciales del nombre. |
|
|
1646
|
+
| `badges` | `ReactNode` | | | Etiquetas (normalmente `Badge`): rol, estado, módulos… |
|
|
1647
|
+
| `children` | `ReactNode` | | | Contenido extra entre las etiquetas y el pie. |
|
|
1648
|
+
| `className` | `string` | | | |
|
|
1649
|
+
| `menuItems` | `MenuItem[]` | | | Acciones secundarias en el menú ⋮ (editar contraseña, eliminar…). |
|
|
1650
|
+
| `menuLabel` | `string` | | | Texto accesible del botón ⋮. Por defecto "Más acciones para <nombre>". |
|
|
1651
|
+
| `muted` | `boolean` | | `false` | Atenúa la tarjeta (p. ej. usuario inactivo). |
|
|
1652
|
+
| `subtitle` | `ReactNode` | | | Dato secundario bajo el nombre: correo, documento, cargo… |
|
|
1653
|
+
|
|
1654
|
+
Otras exportaciones: `initials`.
|
|
1655
|
+
|
|
1656
|
+
Tipos: `UserCardProps`.
|
|
1657
|
+
|
|
1538
1658
|
## Datos
|
|
1539
1659
|
|
|
1540
1660
|
### @rubenpazch/data-table
|
package/docs/catalogo.json
CHANGED
|
@@ -68,6 +68,13 @@
|
|
|
68
68
|
"porDefecto": null,
|
|
69
69
|
"descripcion": "Si se pasa, muestra el botón × y se llama al cerrarlo."
|
|
70
70
|
},
|
|
71
|
+
{
|
|
72
|
+
"nombre": "role",
|
|
73
|
+
"tipo": "\"alert\" | \"status\" | \"note\"",
|
|
74
|
+
"requerido": false,
|
|
75
|
+
"porDefecto": null,
|
|
76
|
+
"descripcion": "Rol ARIA. Por defecto `alert` (warning/danger) o `status` (info/success), que se anuncian al\naparecer. Para un aviso fijo que ya está en la página al cargar, usa `\"note\"`."
|
|
77
|
+
},
|
|
71
78
|
{
|
|
72
79
|
"nombre": "title",
|
|
73
80
|
"tipo": "ReactNode",
|
|
@@ -171,6 +178,20 @@
|
|
|
171
178
|
"porDefecto": null,
|
|
172
179
|
"descripcion": "Componente de enlace (Link de Next.js). Por defecto <a>."
|
|
173
180
|
},
|
|
181
|
+
{
|
|
182
|
+
"nombre": "loading",
|
|
183
|
+
"tipo": "boolean",
|
|
184
|
+
"requerido": false,
|
|
185
|
+
"porDefecto": "false",
|
|
186
|
+
"descripcion": "Carga del contenido al cambiar de pantalla: solo el área de contenido muestra el indicador\n(el menú y la cabecera no cambian). Los hijos siguen montados, atenuados y sin interacción."
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"nombre": "loadingLabel",
|
|
190
|
+
"tipo": "string",
|
|
191
|
+
"requerido": false,
|
|
192
|
+
"porDefecto": "Cargando…",
|
|
193
|
+
"descripcion": "Texto accesible de la carga."
|
|
194
|
+
},
|
|
174
195
|
{
|
|
175
196
|
"nombre": "maxWidth",
|
|
176
197
|
"tipo": "\"none\" | \"md\" | \"lg\"",
|
|
@@ -205,6 +226,13 @@
|
|
|
205
226
|
"requerido": false,
|
|
206
227
|
"porDefecto": null,
|
|
207
228
|
"descripcion": "Título en la cabecera (en móvil se ve junto al botón ☰)."
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"nombre": "toasts",
|
|
232
|
+
"tipo": "boolean",
|
|
233
|
+
"requerido": false,
|
|
234
|
+
"porDefecto": "true",
|
|
235
|
+
"descripcion": "Incluye `ToastProvider`: dentro del panel, `useToast()` muestra los mensajes del servidor como\ntoast bajo la cabecera. Pon `false` solo si la app ya tiene su propio proveedor más arriba."
|
|
208
236
|
}
|
|
209
237
|
]
|
|
210
238
|
}
|
|
@@ -212,6 +240,95 @@
|
|
|
212
240
|
"otrosValores": [],
|
|
213
241
|
"tipos": ["AppShellProps"]
|
|
214
242
|
},
|
|
243
|
+
{
|
|
244
|
+
"paquete": "@rubenpazch/auth-gate",
|
|
245
|
+
"carpeta": "packages/auth-gate",
|
|
246
|
+
"categoria": "navegacion",
|
|
247
|
+
"resumen": "Puerta de sesión: comprueba el token, confirma con el servidor (/me) y solo entonces pinta la app; mientras, una pantalla neutra. Sin sesión, va al login sin mostrar nada.",
|
|
248
|
+
"usarCuando": "Raíz de toda app con sesión (paneles, módulos), envolviendo AppShell.",
|
|
249
|
+
"evitarCuando": "Pantallas públicas (login, registro, landing).",
|
|
250
|
+
"componentes": [
|
|
251
|
+
{
|
|
252
|
+
"nombre": "AuthGate",
|
|
253
|
+
"importar": "import { AuthGate } from \"@rubenpazch/ui\";",
|
|
254
|
+
"descripcion": "Puerta de sesión para la raíz de toda app con sesión (decisión 0006 de lbyte-contexto):\n1. sin token → al login sin pintar nada de la app;\n2. con token → pantalla neutra mientras `verify()` (/me) confirma;\n3. confirmada → pinta la app; rechazada → al login.\nUn 401 posterior (`logoutEvent`) oculta la app y va al login.\n\nEs experiencia de usuario, no seguridad: la API sigue respondiendo 401.",
|
|
255
|
+
"props": [
|
|
256
|
+
{
|
|
257
|
+
"nombre": "children",
|
|
258
|
+
"tipo": "ReactNode",
|
|
259
|
+
"requerido": true,
|
|
260
|
+
"porDefecto": null,
|
|
261
|
+
"descripcion": "La app; recibe lo que devolvió `verify` (usuario, permisos…)."
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"nombre": "hasSession",
|
|
265
|
+
"tipo": "() => boolean",
|
|
266
|
+
"requerido": true,
|
|
267
|
+
"porDefecto": null,
|
|
268
|
+
"descripcion": "Comprobación local inmediata (sin red): ¿hay token o cookie de sesión y no está vencido?\nSi devuelve false se va al login sin pintar nada de la app."
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"nombre": "onUnauthenticated",
|
|
272
|
+
"tipo": "() => void",
|
|
273
|
+
"requerido": true,
|
|
274
|
+
"porDefecto": null,
|
|
275
|
+
"descripcion": "Ir al login (p. ej. `window.location.href = AUTH_URL`)."
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"nombre": "verify",
|
|
279
|
+
"tipo": "() => Promise<T>",
|
|
280
|
+
"requerido": true,
|
|
281
|
+
"porDefecto": null,
|
|
282
|
+
"descripcion": "Confirma la sesión con el servidor (p. ej. `GET /me`). Si rechaza, se va al login."
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"nombre": "brand",
|
|
286
|
+
"tipo": "ReactNode",
|
|
287
|
+
"requerido": false,
|
|
288
|
+
"porDefecto": null,
|
|
289
|
+
"descripcion": "Marca de la organización sobre el texto (logo o nombre)."
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"nombre": "labels",
|
|
293
|
+
"tipo": "Partial<AuthGateLabels>",
|
|
294
|
+
"requerido": false,
|
|
295
|
+
"porDefecto": null,
|
|
296
|
+
"descripcion": "Textos; por defecto en español."
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"nombre": "logoutEvent",
|
|
300
|
+
"tipo": "string | false",
|
|
301
|
+
"requerido": false,
|
|
302
|
+
"porDefecto": "auth:logout",
|
|
303
|
+
"descripcion": "Evento global que indica que la sesión terminó (un 401 a mitad de uso). Al recibirlo se oculta\nla app tras la pantalla neutra y se va al login. Por defecto \"auth:logout\"."
|
|
304
|
+
}
|
|
305
|
+
]
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"nombre": "AuthScreen",
|
|
309
|
+
"importar": "import { AuthScreen } from \"@rubenpazch/ui\";",
|
|
310
|
+
"descripcion": "Pantalla neutra a pantalla completa: sin datos ni estructura de la app.",
|
|
311
|
+
"props": [
|
|
312
|
+
{
|
|
313
|
+
"nombre": "label",
|
|
314
|
+
"tipo": "string",
|
|
315
|
+
"requerido": true,
|
|
316
|
+
"porDefecto": null,
|
|
317
|
+
"descripcion": ""
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"nombre": "brand",
|
|
321
|
+
"tipo": "ReactNode",
|
|
322
|
+
"requerido": false,
|
|
323
|
+
"porDefecto": null,
|
|
324
|
+
"descripcion": ""
|
|
325
|
+
}
|
|
326
|
+
]
|
|
327
|
+
}
|
|
328
|
+
],
|
|
329
|
+
"otrosValores": [],
|
|
330
|
+
"tipos": ["AuthGateProps", "AuthGateLabels"]
|
|
331
|
+
},
|
|
215
332
|
{
|
|
216
333
|
"paquete": "@rubenpazch/autocomplete",
|
|
217
334
|
"carpeta": "packages/autocomplete",
|
|
@@ -7990,10 +8107,60 @@
|
|
|
7990
8107
|
"descripcion": ""
|
|
7991
8108
|
}
|
|
7992
8109
|
]
|
|
8110
|
+
},
|
|
8111
|
+
{
|
|
8112
|
+
"nombre": "ToastProvider",
|
|
8113
|
+
"importar": "import { ToastProvider } from \"@rubenpazch/ui\";",
|
|
8114
|
+
"descripcion": "Mensajes del servidor dentro de la app (usuario con sesión). `AppShell` ya lo incluye y los\nmuestra bajo su cabecera; úsalo directamente solo en un layout propio.\n\nEn pantallas públicas (login, registro, recuperación) NO se usa: ahí el mensaje va junto al\nformulario. Por eso `useToast()` falla fuera de un proveedor.",
|
|
8115
|
+
"props": [
|
|
8116
|
+
{
|
|
8117
|
+
"nombre": "closeAriaLabel",
|
|
8118
|
+
"tipo": "string",
|
|
8119
|
+
"requerido": false,
|
|
8120
|
+
"porDefecto": "Cerrar mensaje",
|
|
8121
|
+
"descripcion": "Texto accesible del botón ×."
|
|
8122
|
+
},
|
|
8123
|
+
{
|
|
8124
|
+
"nombre": "offsetTop",
|
|
8125
|
+
"tipo": "string",
|
|
8126
|
+
"requerido": false,
|
|
8127
|
+
"porDefecto": null,
|
|
8128
|
+
"descripcion": "Distancia desde arriba en modo `floating`."
|
|
8129
|
+
},
|
|
8130
|
+
{
|
|
8131
|
+
"nombre": "placement",
|
|
8132
|
+
"tipo": "\"floating\" | \"inline\"",
|
|
8133
|
+
"requerido": false,
|
|
8134
|
+
"porDefecto": "floating",
|
|
8135
|
+
"descripcion": "`floating` (por defecto): flotan arriba a la derecha.\n`inline`: no se pintan aquí; el layout pone `<ToastRegion />` en su sitio\n(AppShell lo hace bajo su cabecera, sin tapar el menú ni el contenido)."
|
|
8136
|
+
}
|
|
8137
|
+
]
|
|
8138
|
+
},
|
|
8139
|
+
{
|
|
8140
|
+
"nombre": "ToastRegion",
|
|
8141
|
+
"importar": "import { ToastRegion } from \"@rubenpazch/ui\";",
|
|
8142
|
+
"descripcion": "Pinta los toasts de un `ToastProvider placement=\"inline\"` en el lugar del layout donde se ponga.",
|
|
8143
|
+
"props": [
|
|
8144
|
+
{
|
|
8145
|
+
"nombre": "className",
|
|
8146
|
+
"tipo": "string",
|
|
8147
|
+
"requerido": false,
|
|
8148
|
+
"porDefecto": null,
|
|
8149
|
+
"descripcion": ""
|
|
8150
|
+
}
|
|
8151
|
+
]
|
|
7993
8152
|
}
|
|
7994
8153
|
],
|
|
7995
|
-
"otrosValores": [],
|
|
7996
|
-
"tipos": [
|
|
8154
|
+
"otrosValores": ["useToast"],
|
|
8155
|
+
"tipos": [
|
|
8156
|
+
"ToastAction",
|
|
8157
|
+
"ToastBannerProps",
|
|
8158
|
+
"ToastItem",
|
|
8159
|
+
"ToastType",
|
|
8160
|
+
"ToastApi",
|
|
8161
|
+
"ToastOptions",
|
|
8162
|
+
"ToastProviderProps"
|
|
8163
|
+
]
|
|
7997
8164
|
},
|
|
7998
8165
|
{
|
|
7999
8166
|
"paquete": "@rubenpazch/tokens",
|
|
@@ -8064,6 +8231,102 @@
|
|
|
8064
8231
|
],
|
|
8065
8232
|
"otrosValores": [],
|
|
8066
8233
|
"tipos": ["TooltipProps"]
|
|
8234
|
+
},
|
|
8235
|
+
{
|
|
8236
|
+
"paquete": "@rubenpazch/user-card",
|
|
8237
|
+
"carpeta": "packages/user-card",
|
|
8238
|
+
"categoria": "presentacion",
|
|
8239
|
+
"resumen": "Tarjeta de una persona (usuario, socio, cliente): avatar, nombre, correo u otro dato, etiquetas y acciones; las secundarias van en un menú ⋮.",
|
|
8240
|
+
"usarCuando": "Listas de personas en cuadrícula: usuarios de un panel, socios, clientes, pacientes.",
|
|
8241
|
+
"evitarCuando": "Listas largas o con muchas columnas para comparar: usa DataTable.",
|
|
8242
|
+
"componentes": [
|
|
8243
|
+
{
|
|
8244
|
+
"nombre": "UserCard",
|
|
8245
|
+
"importar": "import { UserCard } from \"@rubenpazch/ui\";",
|
|
8246
|
+
"descripcion": "Tarjeta de una persona: avatar, nombre, dato secundario, etiquetas y acciones.\nLas acciones principales se ven en el pie; las secundarias van en un menú ⋮ para que la\ntarjeta no se llene de botones.",
|
|
8247
|
+
"props": [
|
|
8248
|
+
{
|
|
8249
|
+
"nombre": "name",
|
|
8250
|
+
"tipo": "string",
|
|
8251
|
+
"requerido": true,
|
|
8252
|
+
"porDefecto": null,
|
|
8253
|
+
"descripcion": "Nombre visible."
|
|
8254
|
+
},
|
|
8255
|
+
{
|
|
8256
|
+
"nombre": "actions",
|
|
8257
|
+
"tipo": "ReactNode",
|
|
8258
|
+
"requerido": false,
|
|
8259
|
+
"porDefecto": null,
|
|
8260
|
+
"descripcion": "Acciones principales visibles en el pie (una o dos `Button`)."
|
|
8261
|
+
},
|
|
8262
|
+
{
|
|
8263
|
+
"nombre": "as",
|
|
8264
|
+
"tipo": "\"article\" | \"li\" | \"div\"",
|
|
8265
|
+
"requerido": false,
|
|
8266
|
+
"porDefecto": "article",
|
|
8267
|
+
"descripcion": ""
|
|
8268
|
+
},
|
|
8269
|
+
{
|
|
8270
|
+
"nombre": "avatarSrc",
|
|
8271
|
+
"tipo": "string",
|
|
8272
|
+
"requerido": false,
|
|
8273
|
+
"porDefecto": null,
|
|
8274
|
+
"descripcion": "Foto. Sin ella se muestran las iniciales del nombre."
|
|
8275
|
+
},
|
|
8276
|
+
{
|
|
8277
|
+
"nombre": "badges",
|
|
8278
|
+
"tipo": "ReactNode",
|
|
8279
|
+
"requerido": false,
|
|
8280
|
+
"porDefecto": null,
|
|
8281
|
+
"descripcion": "Etiquetas (normalmente `Badge`): rol, estado, módulos…"
|
|
8282
|
+
},
|
|
8283
|
+
{
|
|
8284
|
+
"nombre": "children",
|
|
8285
|
+
"tipo": "ReactNode",
|
|
8286
|
+
"requerido": false,
|
|
8287
|
+
"porDefecto": null,
|
|
8288
|
+
"descripcion": "Contenido extra entre las etiquetas y el pie."
|
|
8289
|
+
},
|
|
8290
|
+
{
|
|
8291
|
+
"nombre": "className",
|
|
8292
|
+
"tipo": "string",
|
|
8293
|
+
"requerido": false,
|
|
8294
|
+
"porDefecto": null,
|
|
8295
|
+
"descripcion": ""
|
|
8296
|
+
},
|
|
8297
|
+
{
|
|
8298
|
+
"nombre": "menuItems",
|
|
8299
|
+
"tipo": "MenuItem[]",
|
|
8300
|
+
"requerido": false,
|
|
8301
|
+
"porDefecto": null,
|
|
8302
|
+
"descripcion": "Acciones secundarias en el menú ⋮ (editar contraseña, eliminar…)."
|
|
8303
|
+
},
|
|
8304
|
+
{
|
|
8305
|
+
"nombre": "menuLabel",
|
|
8306
|
+
"tipo": "string",
|
|
8307
|
+
"requerido": false,
|
|
8308
|
+
"porDefecto": null,
|
|
8309
|
+
"descripcion": "Texto accesible del botón ⋮. Por defecto \"Más acciones para <nombre>\"."
|
|
8310
|
+
},
|
|
8311
|
+
{
|
|
8312
|
+
"nombre": "muted",
|
|
8313
|
+
"tipo": "boolean",
|
|
8314
|
+
"requerido": false,
|
|
8315
|
+
"porDefecto": "false",
|
|
8316
|
+
"descripcion": "Atenúa la tarjeta (p. ej. usuario inactivo)."
|
|
8317
|
+
},
|
|
8318
|
+
{
|
|
8319
|
+
"nombre": "subtitle",
|
|
8320
|
+
"tipo": "ReactNode",
|
|
8321
|
+
"requerido": false,
|
|
8322
|
+
"porDefecto": null,
|
|
8323
|
+
"descripcion": "Dato secundario bajo el nombre: correo, documento, cargo…"
|
|
8324
|
+
}
|
|
8325
|
+
]
|
|
8326
|
+
}
|
|
8327
|
+
],
|
|
8328
|
+
"otrosValores": ["initials"],
|
|
8329
|
+
"tipos": ["UserCardProps"]
|
|
8067
8330
|
}
|
|
8068
8331
|
],
|
|
8069
8332
|
"iconos": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rubenpazch/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Todos los componentes de Lbyte UI en un solo paquete, con su documentación para personas y agentes de IA",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -37,32 +37,33 @@
|
|
|
37
37
|
"react-dom": "^19.2.3"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@rubenpazch/alert": "^0.
|
|
40
|
+
"@rubenpazch/alert": "^0.2.0",
|
|
41
|
+
"@rubenpazch/app-shell": "^0.3.0",
|
|
41
42
|
"@rubenpazch/autocomplete": "^5.1.3",
|
|
43
|
+
"@rubenpazch/auth-gate": "^0.1.0",
|
|
42
44
|
"@rubenpazch/avatar": "^3.1.3",
|
|
43
|
-
"@rubenpazch/app-shell": "^0.1.2",
|
|
44
45
|
"@rubenpazch/badge": "^0.1.1",
|
|
45
|
-
"@rubenpazch/button": "^6.2.1",
|
|
46
46
|
"@rubenpazch/card": "^0.1.1",
|
|
47
|
-
"@rubenpazch/
|
|
47
|
+
"@rubenpazch/button": "^6.2.2",
|
|
48
|
+
"@rubenpazch/checkbox-input": "^3.2.2",
|
|
48
49
|
"@rubenpazch/chip": "^4.0.5",
|
|
50
|
+
"@rubenpazch/confirmation-dialog": "^3.1.3",
|
|
51
|
+
"@rubenpazch/date-input": "^3.1.4",
|
|
52
|
+
"@rubenpazch/date-picker": "^3.1.4",
|
|
49
53
|
"@rubenpazch/data-table": "^0.1.1",
|
|
50
|
-
"@rubenpazch/date-input": "^3.1.3",
|
|
51
|
-
"@rubenpazch/confirmation-dialog": "^3.1.2",
|
|
52
|
-
"@rubenpazch/date-picker": "^3.1.3",
|
|
53
54
|
"@rubenpazch/draggable-list": "^3.0.3",
|
|
54
55
|
"@rubenpazch/drawer": "^4.2.3",
|
|
55
56
|
"@rubenpazch/empty-state": "^0.1.1",
|
|
56
|
-
"@rubenpazch/icons": "^6.4.0",
|
|
57
|
-
"@rubenpazch/icon-button": "^4.2.1",
|
|
58
57
|
"@rubenpazch/identification-input": "^2.1.0",
|
|
59
58
|
"@rubenpazch/image-upload": "^3.1.1",
|
|
60
59
|
"@rubenpazch/info-row": "^3.0.4",
|
|
60
|
+
"@rubenpazch/icon-button": "^4.2.1",
|
|
61
61
|
"@rubenpazch/loading-spinner": "^4.0.3",
|
|
62
|
-
"@rubenpazch/modal": "^0.1.2",
|
|
63
62
|
"@rubenpazch/menu": "^0.1.1",
|
|
63
|
+
"@rubenpazch/modal": "^0.1.2",
|
|
64
64
|
"@rubenpazch/form-field": "^0.1.1",
|
|
65
65
|
"@rubenpazch/money-input": "^0.1.1",
|
|
66
|
+
"@rubenpazch/icons": "^6.4.0",
|
|
66
67
|
"@rubenpazch/month-navigator": "^0.1.1",
|
|
67
68
|
"@rubenpazch/numeric-picker": "^5.1.1",
|
|
68
69
|
"@rubenpazch/numeric-up-picker": "^6.1.3",
|
|
@@ -70,24 +71,25 @@
|
|
|
70
71
|
"@rubenpazch/page-header": "^0.1.1",
|
|
71
72
|
"@rubenpazch/pagination": "^3.2.3",
|
|
72
73
|
"@rubenpazch/patient-details": "^3.1.3",
|
|
74
|
+
"@rubenpazch/prescription-eye-card": "^3.0.5",
|
|
75
|
+
"@rubenpazch/progress-bar": "^0.1.1",
|
|
73
76
|
"@rubenpazch/patient-search": "^3.0.5",
|
|
74
77
|
"@rubenpazch/prescription-card": "^3.0.5",
|
|
75
|
-
"@rubenpazch/prescription-eye-card": "^3.0.4",
|
|
76
|
-
"@rubenpazch/progress-bar": "^0.1.1",
|
|
77
|
-
"@rubenpazch/segmented-control": "^0.1.1",
|
|
78
78
|
"@rubenpazch/radio-button": "^4.2.1",
|
|
79
|
-
"@rubenpazch/shared": "^5.2.0",
|
|
80
79
|
"@rubenpazch/select": "^1.2.1",
|
|
80
|
+
"@rubenpazch/shared": "^5.2.0",
|
|
81
81
|
"@rubenpazch/sidebar": "^0.1.2",
|
|
82
82
|
"@rubenpazch/skeleton": "^0.1.1",
|
|
83
|
+
"@rubenpazch/segmented-control": "^0.1.1",
|
|
84
|
+
"@rubenpazch/stepper": "^4.1.1",
|
|
83
85
|
"@rubenpazch/switch": "^0.1.1",
|
|
86
|
+
"@rubenpazch/toast": "^4.1.0",
|
|
87
|
+
"@rubenpazch/text-input": "^6.3.0",
|
|
84
88
|
"@rubenpazch/tabs": "^3.1.1",
|
|
85
89
|
"@rubenpazch/textarea": "^0.1.1",
|
|
86
|
-
"@rubenpazch/
|
|
87
|
-
"@rubenpazch/
|
|
88
|
-
"@rubenpazch/
|
|
89
|
-
"@rubenpazch/tokens": "^0.5.0",
|
|
90
|
-
"@rubenpazch/tooltip": "^0.1.1"
|
|
90
|
+
"@rubenpazch/tooltip": "^0.1.1",
|
|
91
|
+
"@rubenpazch/user-card": "^0.1.0",
|
|
92
|
+
"@rubenpazch/tokens": "^0.5.0"
|
|
91
93
|
},
|
|
92
94
|
"devDependencies": {
|
|
93
95
|
"@rollup/plugin-typescript": "^12.3.0",
|