@acvl/mobile-components 0.0.0-stage → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +146 -2
- package/assets/fonts/Inter_400Regular.ttf +0 -0
- package/assets/fonts/Inter_500Medium.ttf +0 -0
- package/assets/fonts/Inter_600SemiBold.ttf +0 -0
- package/assets/fonts/Inter_700Bold.ttf +0 -0
- package/assets/fonts/Inter_800ExtraBold.ttf +0 -0
- package/assets/fonts/Inter_900Black.ttf +0 -0
- package/assets/fonts/OFL.txt +93 -0
- package/lib/module/componentes/AccionesDelEncabezado.js +212 -0
- package/lib/module/componentes/AccionesDelEncabezado.js.map +1 -0
- package/lib/module/componentes/BotonDeAvatar.js +55 -0
- package/lib/module/componentes/BotonDeAvatar.js.map +1 -0
- package/lib/module/componentes/BotonGrande.js +105 -0
- package/lib/module/componentes/BotonGrande.js.map +1 -0
- package/lib/module/componentes/CabeceraEmpujada.js +101 -0
- package/lib/module/componentes/CabeceraEmpujada.js.map +1 -0
- package/lib/module/componentes/Chip.js +77 -0
- package/lib/module/componentes/Chip.js.map +1 -0
- package/lib/module/componentes/ContenidoDePantalla.js +56 -0
- package/lib/module/componentes/ContenidoDePantalla.js.map +1 -0
- package/lib/module/componentes/EstadoVacio.js +65 -0
- package/lib/module/componentes/EstadoVacio.js.map +1 -0
- package/lib/module/componentes/Foto.js +106 -0
- package/lib/module/componentes/Foto.js.map +1 -0
- package/lib/module/componentes/IconoDeRenglon.js +44 -0
- package/lib/module/componentes/IconoDeRenglon.js.map +1 -0
- package/lib/module/componentes/Logo.js +44 -0
- package/lib/module/componentes/Logo.js.map +1 -0
- package/lib/module/componentes/Nota.js +51 -0
- package/lib/module/componentes/Nota.js.map +1 -0
- package/lib/module/componentes/OpcionesExcluyentes.js +69 -0
- package/lib/module/componentes/OpcionesExcluyentes.js.map +1 -0
- package/lib/module/componentes/PantallaDeError.js +84 -0
- package/lib/module/componentes/PantallaDeError.js.map +1 -0
- package/lib/module/componentes/Pestanas.js +87 -0
- package/lib/module/componentes/Pestanas.js.map +1 -0
- package/lib/module/componentes/Rotulo.js +28 -0
- package/lib/module/componentes/Rotulo.js.map +1 -0
- package/lib/module/componentes/RotuloDeSeccion.js +87 -0
- package/lib/module/componentes/RotuloDeSeccion.js.map +1 -0
- package/lib/module/componentes/Tarjeta.js +47 -0
- package/lib/module/componentes/Tarjeta.js.map +1 -0
- package/lib/module/componentes/TarjetaDeDatos.js +79 -0
- package/lib/module/componentes/TarjetaDeDatos.js.map +1 -0
- package/lib/module/componentes/TiraDeFotos.js +184 -0
- package/lib/module/componentes/TiraDeFotos.js.map +1 -0
- package/lib/module/componentes/VisorDeFoto.js +171 -0
- package/lib/module/componentes/VisorDeFoto.js.map +1 -0
- package/lib/module/componentes/logos/bola-blanca.png +0 -0
- package/lib/module/componentes/logos/bola.png +0 -0
- package/lib/module/componentes/logos/logo-blanco.png +0 -0
- package/lib/module/componentes/logos/logo.png +0 -0
- package/lib/module/dialogos/HostDeDialogos.js +170 -0
- package/lib/module/dialogos/HostDeDialogos.js.map +1 -0
- package/lib/module/dialogos/dialogos.js +112 -0
- package/lib/module/dialogos/dialogos.js.map +1 -0
- package/lib/module/formularios/CampoDeSeleccion.js +47 -0
- package/lib/module/formularios/CampoDeSeleccion.js.map +1 -0
- package/lib/module/formularios/SelectorDeOpcion.js +406 -0
- package/lib/module/formularios/SelectorDeOpcion.js.map +1 -0
- package/lib/module/formularios/TextoDeAccesoControlado.js +73 -0
- package/lib/module/formularios/TextoDeAccesoControlado.js.map +1 -0
- package/lib/module/formularios/campos.js +493 -0
- package/lib/module/formularios/campos.js.map +1 -0
- package/lib/module/formularios/controlados.js +197 -0
- package/lib/module/formularios/controlados.js.map +1 -0
- package/lib/module/formularios/errores.js +91 -0
- package/lib/module/formularios/errores.js.map +1 -0
- package/lib/module/formularios/guardado.js +78 -0
- package/lib/module/formularios/guardado.js.map +1 -0
- package/lib/module/formularios/useBusqueda.js +22 -0
- package/lib/module/formularios/useBusqueda.js.map +1 -0
- package/lib/module/fotos/elegir.js +178 -0
- package/lib/module/fotos/elegir.js.map +1 -0
- package/lib/module/fotos/index.js +8 -0
- package/lib/module/fotos/index.js.map +1 -0
- package/lib/module/fotos/reducir.js +93 -0
- package/lib/module/fotos/reducir.js.map +1 -0
- package/lib/module/hoja/HojaInferior.js +108 -0
- package/lib/module/hoja/HojaInferior.js.map +1 -0
- package/lib/module/hoja/index.js +7 -0
- package/lib/module/hoja/index.js.map +1 -0
- package/lib/module/hoja/useMasDeLaFicha.js +48 -0
- package/lib/module/hoja/useMasDeLaFicha.js.map +1 -0
- package/lib/module/index.js +66 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/listas/HojaDeFiltros.js +260 -0
- package/lib/module/listas/HojaDeFiltros.js.map +1 -0
- package/lib/module/listas/ListaPaginada.js +103 -0
- package/lib/module/listas/ListaPaginada.js.map +1 -0
- package/lib/module/listas/TarjetaDeslizable.js +118 -0
- package/lib/module/listas/TarjetaDeslizable.js.map +1 -0
- package/lib/module/listas/paginado.js +11 -0
- package/lib/module/listas/paginado.js.map +1 -0
- package/lib/module/listas/piezas.js +603 -0
- package/lib/module/listas/piezas.js.map +1 -0
- package/lib/module/navegacion/BarraDePestanas.js +162 -0
- package/lib/module/navegacion/BarraDePestanas.js.map +1 -0
- package/lib/module/navegacion/BotonDeBarra.js +58 -0
- package/lib/module/navegacion/BotonDeBarra.js.map +1 -0
- package/lib/module/navegacion/encabezado.js +103 -0
- package/lib/module/navegacion/encabezado.js.map +1 -0
- package/lib/module/pantallas/PantallaDeAcceso.js +195 -0
- package/lib/module/pantallas/PantallaDeAcceso.js.map +1 -0
- package/lib/module/pantallas/PantallaDeEdicion.js +121 -0
- package/lib/module/pantallas/PantallaDeEdicion.js.map +1 -0
- package/lib/module/pantallas/PantallaDeFicha.js +94 -0
- package/lib/module/pantallas/PantallaDeFicha.js.map +1 -0
- package/lib/module/pantallas/PantallaDePerfil.js +137 -0
- package/lib/module/pantallas/PantallaDePerfil.js.map +1 -0
- package/lib/module/tema/ProveedorDeTema.js +122 -0
- package/lib/module/tema/ProveedorDeTema.js.map +1 -0
- package/lib/module/tema/estilos.js +54 -0
- package/lib/module/tema/estilos.js.map +1 -0
- package/lib/module/tema/fuentes.js +28 -0
- package/lib/module/tema/fuentes.js.map +1 -0
- package/lib/module/tema/index.js +8 -0
- package/lib/module/tema/index.js.map +1 -0
- package/lib/module/tema/paleta.js +107 -0
- package/lib/module/tema/paleta.js.map +1 -0
- package/lib/module/tema/tipografia.js +32 -0
- package/lib/module/tema/tipografia.js.map +1 -0
- package/lib/module/texto.js +48 -0
- package/lib/module/texto.js.map +1 -0
- package/lib/typescript/src/componentes/AccionesDelEncabezado.d.ts +34 -0
- package/lib/typescript/src/componentes/AccionesDelEncabezado.d.ts.map +1 -0
- package/lib/typescript/src/componentes/BotonDeAvatar.d.ts +17 -0
- package/lib/typescript/src/componentes/BotonDeAvatar.d.ts.map +1 -0
- package/lib/typescript/src/componentes/BotonGrande.d.ts +26 -0
- package/lib/typescript/src/componentes/BotonGrande.d.ts.map +1 -0
- package/lib/typescript/src/componentes/CabeceraEmpujada.d.ts +18 -0
- package/lib/typescript/src/componentes/CabeceraEmpujada.d.ts.map +1 -0
- package/lib/typescript/src/componentes/Chip.d.ts +14 -0
- package/lib/typescript/src/componentes/Chip.d.ts.map +1 -0
- package/lib/typescript/src/componentes/ContenidoDePantalla.d.ts +17 -0
- package/lib/typescript/src/componentes/ContenidoDePantalla.d.ts.map +1 -0
- package/lib/typescript/src/componentes/EstadoVacio.d.ts +17 -0
- package/lib/typescript/src/componentes/EstadoVacio.d.ts.map +1 -0
- package/lib/typescript/src/componentes/Foto.d.ts +41 -0
- package/lib/typescript/src/componentes/Foto.d.ts.map +1 -0
- package/lib/typescript/src/componentes/IconoDeRenglon.d.ts +25 -0
- package/lib/typescript/src/componentes/IconoDeRenglon.d.ts.map +1 -0
- package/lib/typescript/src/componentes/Logo.d.ts +13 -0
- package/lib/typescript/src/componentes/Logo.d.ts.map +1 -0
- package/lib/typescript/src/componentes/Nota.d.ts +7 -0
- package/lib/typescript/src/componentes/Nota.d.ts.map +1 -0
- package/lib/typescript/src/componentes/OpcionesExcluyentes.d.ts +14 -0
- package/lib/typescript/src/componentes/OpcionesExcluyentes.d.ts.map +1 -0
- package/lib/typescript/src/componentes/PantallaDeError.d.ts +23 -0
- package/lib/typescript/src/componentes/PantallaDeError.d.ts.map +1 -0
- package/lib/typescript/src/componentes/Pestanas.d.ts +28 -0
- package/lib/typescript/src/componentes/Pestanas.d.ts.map +1 -0
- package/lib/typescript/src/componentes/Rotulo.d.ts +6 -0
- package/lib/typescript/src/componentes/Rotulo.d.ts.map +1 -0
- package/lib/typescript/src/componentes/RotuloDeSeccion.d.ts +20 -0
- package/lib/typescript/src/componentes/RotuloDeSeccion.d.ts.map +1 -0
- package/lib/typescript/src/componentes/Tarjeta.d.ts +15 -0
- package/lib/typescript/src/componentes/Tarjeta.d.ts.map +1 -0
- package/lib/typescript/src/componentes/TarjetaDeDatos.d.ts +13 -0
- package/lib/typescript/src/componentes/TarjetaDeDatos.d.ts.map +1 -0
- package/lib/typescript/src/componentes/TiraDeFotos.d.ts +36 -0
- package/lib/typescript/src/componentes/TiraDeFotos.d.ts.map +1 -0
- package/lib/typescript/src/componentes/VisorDeFoto.d.ts +23 -0
- package/lib/typescript/src/componentes/VisorDeFoto.d.ts.map +1 -0
- package/lib/typescript/src/dialogos/HostDeDialogos.d.ts +14 -0
- package/lib/typescript/src/dialogos/HostDeDialogos.d.ts.map +1 -0
- package/lib/typescript/src/dialogos/dialogos.d.ts +65 -0
- package/lib/typescript/src/dialogos/dialogos.d.ts.map +1 -0
- package/lib/typescript/src/formularios/CampoDeSeleccion.d.ts +22 -0
- package/lib/typescript/src/formularios/CampoDeSeleccion.d.ts.map +1 -0
- package/lib/typescript/src/formularios/SelectorDeOpcion.d.ts +59 -0
- package/lib/typescript/src/formularios/SelectorDeOpcion.d.ts.map +1 -0
- package/lib/typescript/src/formularios/TextoDeAccesoControlado.d.ts +18 -0
- package/lib/typescript/src/formularios/TextoDeAccesoControlado.d.ts.map +1 -0
- package/lib/typescript/src/formularios/campos.d.ts +107 -0
- package/lib/typescript/src/formularios/campos.d.ts.map +1 -0
- package/lib/typescript/src/formularios/controlados.d.ts +29 -0
- package/lib/typescript/src/formularios/controlados.d.ts.map +1 -0
- package/lib/typescript/src/formularios/errores.d.ts +36 -0
- package/lib/typescript/src/formularios/errores.d.ts.map +1 -0
- package/lib/typescript/src/formularios/guardado.d.ts +36 -0
- package/lib/typescript/src/formularios/guardado.d.ts.map +1 -0
- package/lib/typescript/src/formularios/useBusqueda.d.ts +7 -0
- package/lib/typescript/src/formularios/useBusqueda.d.ts.map +1 -0
- package/lib/typescript/src/fotos/elegir.d.ts +58 -0
- package/lib/typescript/src/fotos/elegir.d.ts.map +1 -0
- package/lib/typescript/src/fotos/index.d.ts +3 -0
- package/lib/typescript/src/fotos/index.d.ts.map +1 -0
- package/lib/typescript/src/fotos/reducir.d.ts +32 -0
- package/lib/typescript/src/fotos/reducir.d.ts.map +1 -0
- package/lib/typescript/src/hoja/HojaInferior.d.ts +21 -0
- package/lib/typescript/src/hoja/HojaInferior.d.ts.map +1 -0
- package/lib/typescript/src/hoja/index.d.ts +3 -0
- package/lib/typescript/src/hoja/index.d.ts.map +1 -0
- package/lib/typescript/src/hoja/useMasDeLaFicha.d.ts +27 -0
- package/lib/typescript/src/hoja/useMasDeLaFicha.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +45 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/listas/HojaDeFiltros.d.ts +60 -0
- package/lib/typescript/src/listas/HojaDeFiltros.d.ts.map +1 -0
- package/lib/typescript/src/listas/ListaPaginada.d.ts +39 -0
- package/lib/typescript/src/listas/ListaPaginada.d.ts.map +1 -0
- package/lib/typescript/src/listas/TarjetaDeslizable.d.ts +33 -0
- package/lib/typescript/src/listas/TarjetaDeslizable.d.ts.map +1 -0
- package/lib/typescript/src/listas/paginado.d.ts +16 -0
- package/lib/typescript/src/listas/paginado.d.ts.map +1 -0
- package/lib/typescript/src/listas/piezas.d.ts +135 -0
- package/lib/typescript/src/listas/piezas.d.ts.map +1 -0
- package/lib/typescript/src/navegacion/BarraDePestanas.d.ts +57 -0
- package/lib/typescript/src/navegacion/BarraDePestanas.d.ts.map +1 -0
- package/lib/typescript/src/navegacion/BotonDeBarra.d.ts +15 -0
- package/lib/typescript/src/navegacion/BotonDeBarra.d.ts.map +1 -0
- package/lib/typescript/src/navegacion/encabezado.d.ts +44 -0
- package/lib/typescript/src/navegacion/encabezado.d.ts.map +1 -0
- package/lib/typescript/src/pantallas/PantallaDeAcceso.d.ts +32 -0
- package/lib/typescript/src/pantallas/PantallaDeAcceso.d.ts.map +1 -0
- package/lib/typescript/src/pantallas/PantallaDeEdicion.d.ts +38 -0
- package/lib/typescript/src/pantallas/PantallaDeEdicion.d.ts.map +1 -0
- package/lib/typescript/src/pantallas/PantallaDeFicha.d.ts +35 -0
- package/lib/typescript/src/pantallas/PantallaDeFicha.d.ts.map +1 -0
- package/lib/typescript/src/pantallas/PantallaDePerfil.d.ts +19 -0
- package/lib/typescript/src/pantallas/PantallaDePerfil.d.ts.map +1 -0
- package/lib/typescript/src/tema/ProveedorDeTema.d.ts +32 -0
- package/lib/typescript/src/tema/ProveedorDeTema.d.ts.map +1 -0
- package/lib/typescript/src/tema/estilos.d.ts +31 -0
- package/lib/typescript/src/tema/estilos.d.ts.map +1 -0
- package/lib/typescript/src/tema/fuentes.d.ts +20 -0
- package/lib/typescript/src/tema/fuentes.d.ts.map +1 -0
- package/lib/typescript/src/tema/index.d.ts +6 -0
- package/lib/typescript/src/tema/index.d.ts.map +1 -0
- package/lib/typescript/src/tema/paleta.d.ts +86 -0
- package/lib/typescript/src/tema/paleta.d.ts.map +1 -0
- package/lib/typescript/src/tema/tipografia.d.ts +29 -0
- package/lib/typescript/src/tema/tipografia.d.ts.map +1 -0
- package/lib/typescript/src/texto.d.ts +16 -0
- package/lib/typescript/src/texto.d.ts.map +1 -0
- package/package.json +135 -5
- package/src/componentes/AccionesDelEncabezado.tsx +247 -0
- package/src/componentes/BotonDeAvatar.tsx +59 -0
- package/src/componentes/BotonGrande.tsx +100 -0
- package/src/componentes/CabeceraEmpujada.tsx +69 -0
- package/src/componentes/Chip.tsx +60 -0
- package/src/componentes/ContenidoDePantalla.tsx +53 -0
- package/src/componentes/EstadoVacio.tsx +45 -0
- package/src/componentes/Foto.tsx +92 -0
- package/src/componentes/IconoDeRenglon.tsx +42 -0
- package/src/componentes/Logo.tsx +34 -0
- package/src/componentes/Nota.tsx +37 -0
- package/src/componentes/OpcionesExcluyentes.tsx +62 -0
- package/src/componentes/PantallaDeError.tsx +76 -0
- package/src/componentes/Pestanas.tsx +86 -0
- package/src/componentes/Rotulo.tsx +21 -0
- package/src/componentes/RotuloDeSeccion.tsx +71 -0
- package/src/componentes/Tarjeta.tsx +44 -0
- package/src/componentes/TarjetaDeDatos.tsx +62 -0
- package/src/componentes/TiraDeFotos.tsx +189 -0
- package/src/componentes/VisorDeFoto.tsx +181 -0
- package/src/componentes/logos/bola-blanca.png +0 -0
- package/src/componentes/logos/bola.png +0 -0
- package/src/componentes/logos/logo-blanco.png +0 -0
- package/src/componentes/logos/logo.png +0 -0
- package/src/dialogos/HostDeDialogos.tsx +172 -0
- package/src/dialogos/dialogos.ts +148 -0
- package/src/formularios/CampoDeSeleccion.tsx +46 -0
- package/src/formularios/SelectorDeOpcion.tsx +407 -0
- package/src/formularios/TextoDeAccesoControlado.tsx +72 -0
- package/src/formularios/campos.tsx +483 -0
- package/src/formularios/controlados.tsx +198 -0
- package/src/formularios/errores.ts +105 -0
- package/src/formularios/guardado.ts +76 -0
- package/src/formularios/useBusqueda.ts +19 -0
- package/src/fotos/elegir.ts +194 -0
- package/src/fotos/index.ts +15 -0
- package/src/fotos/reducir.ts +87 -0
- package/src/hoja/HojaInferior.tsx +102 -0
- package/src/hoja/index.ts +4 -0
- package/src/hoja/useMasDeLaFicha.tsx +63 -0
- package/src/index.ts +143 -0
- package/src/listas/HojaDeFiltros.tsx +261 -0
- package/src/listas/ListaPaginada.tsx +117 -0
- package/src/listas/TarjetaDeslizable.tsx +126 -0
- package/src/listas/paginado.ts +15 -0
- package/src/listas/piezas.tsx +594 -0
- package/src/navegacion/BarraDePestanas.tsx +198 -0
- package/src/navegacion/BotonDeBarra.tsx +61 -0
- package/src/navegacion/encabezado.tsx +88 -0
- package/src/pantallas/PantallaDeAcceso.tsx +184 -0
- package/src/pantallas/PantallaDeEdicion.tsx +116 -0
- package/src/pantallas/PantallaDeFicha.tsx +115 -0
- package/src/pantallas/PantallaDePerfil.tsx +126 -0
- package/src/tema/ProveedorDeTema.tsx +150 -0
- package/src/tema/estilos.ts +51 -0
- package/src/tema/fuentes.ts +20 -0
- package/src/tema/index.ts +10 -0
- package/src/tema/paleta.ts +147 -0
- package/src/tema/tipografia.ts +29 -0
- package/src/texto.tsx +44 -0
package/README.md
CHANGED
|
@@ -1,3 +1,147 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @acvl/mobile-components
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
La librería de componentes de las apps móviles de ACV (Expo / React Native): tms, wms y suma. Es el
|
|
4
|
+
equivalente de [`@acvl/frontend-components`](https://github.com/ACV-Logistics/acv-frontend-components)
|
|
5
|
+
para las apps: lo que se ve igual en todas vive aquí, y cada app pone sólo lo suyo (su API, su
|
|
6
|
+
dominio).
|
|
7
|
+
|
|
8
|
+
El punto de partida es la app de tms, la más reciente. Su diseño es para quien usa la app de pie y
|
|
9
|
+
con prisa: **letra grande** (nada por debajo de `tipografia.etiqueta`), nada importante recortado a
|
|
10
|
+
un renglón, y todo listo para la letra del teléfono al 180%.
|
|
11
|
+
|
|
12
|
+
## Qué trae
|
|
13
|
+
|
|
14
|
+
| Área | Qué |
|
|
15
|
+
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
16
|
+
| **Tema** | `ProveedorDeTema`, `usePreferenciaDeTema`, `PALETA_CLARA`/`PALETA_OSCURA`, `usePaleta`, `crearEstilos`, `useEsOscuro`, `tipografia`, `renglon`, `Text`, `TextInput` |
|
|
17
|
+
| **Componentes** | `BotonGrande`, `Chip` (con su tono `morado`), `EstadoVacio`, `IconoDeRenglon`, `Nota`, `OpcionesExcluyentes`, `Pestanas`, `Rotulo`, `RotuloDeSeccion` (con su `accion`), `Tarjeta`, `TarjetaDeDatos`, `Logo`, `LogoCompleto`, `ContenidoDePantalla` |
|
|
18
|
+
| **Navegación** | `useOpcionesDelEncabezado` (el header de las pestañas), `BarraDePestanas`, `CabeceraEmpujada`, `AccionesDelEncabezado` (con `insignia`), `BotonDeAvatar` |
|
|
19
|
+
| **Diálogos** | `mostrarDialogo`, `confirmar`, `avisar` y su `HostDeDialogos` |
|
|
20
|
+
| **Formularios** | `CampoDeTexto`, `CampoDeFecha`, `CampoDeFechaHora`, `CampoInterruptor`, `CampoDeOpciones`, `CampoDeTelefono`, `CampoDeSeleccion` (del servidor o de una lista fija), `CampoDeVarias`, `SelectorDeOpcion`, `SelectorDeVarias`, `Campo` (el marco de un campo propio), sus `…Controlado` de react-hook-form, `TextoDeAccesoControlado` (el login), `useGuardado`, `soloLoQueCambio`, `mensajeDeError`, `setErrors`, `useBusqueda` |
|
|
21
|
+
| **Listas y fichas** | `ListaPaginada` (con `Pagina` y `renglonesDe`), `CabeceraDeLista`, `Buscador`, `TarjetaDeLista`, `TarjetaDeslizable`, `HojaDeFiltros` y sus opciones, `SeccionDeFicha`, `RenglonDeLiga`, `FilaConContador`, `RenglonDeContacto`, `RenglonDeHoja`, `EstadoDeHoja` |
|
|
22
|
+
| **Fotos** | `Foto`, `ProveedorDeFotos`, `TiraDeFotos`, `VisorDeFoto` |
|
|
23
|
+
| **Pantallas** | `PantallaDeAcceso` (el login), `PantallaDeFicha`, `EsperaDeEdicion`/`FormularioDeEdicion`, `PantallaDePerfil`, `PantallaDeError` |
|
|
24
|
+
|
|
25
|
+
Y dos entradas aparte, para no obligar a cada app a instalar lo que no usa:
|
|
26
|
+
|
|
27
|
+
| Entrada | Qué | Pide |
|
|
28
|
+
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------- |
|
|
29
|
+
| `@acvl/mobile-components/fotos` | `tomarFoto`, `elegirDeGaleria`, `elegirDocumentos`, `elegirAdjunto`, `pedirPermisoDeCamara`, `reducirFoto` (a 1920 px, como el servidor) | `expo-image-picker`, `expo-image-manipulator`, `expo-document-picker`, `expo-file-system` |
|
|
30
|
+
| `@acvl/mobile-components/hoja` | `HojaInferior`, `useMasDeLaFicha` (la sección «Más» de una ficha: renglones con contador que abren su hoja) | `@gorhom/bottom-sheet` |
|
|
31
|
+
|
|
32
|
+
Cada componente lleva su documentación en el código: por qué es como es, y qué se probó antes.
|
|
33
|
+
|
|
34
|
+
## Instalar
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
npm install @acvl/mobile-components
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Lo que la librería usa lo pone la app (`peerDependencies`): `react-native-paper`, `expo-router`,
|
|
41
|
+
`react-native-reanimated`, `react-native-safe-area-context`, `react-native-keyboard-controller`,
|
|
42
|
+
`react-native-gesture-handler`, `@expo/vector-icons`, `@react-native-community/datetimepicker`,
|
|
43
|
+
`react-hook-form`, `dayjs`, `expo-haptics`, `expo-status-bar` y `expo-system-ui`. Sirve desde el
|
|
44
|
+
SDK 54 de Expo.
|
|
45
|
+
|
|
46
|
+
### Las fotos del servidor
|
|
47
|
+
|
|
48
|
+
Si las fotos del servidor piden la sesión, la app dice cómo bajarlas en el layout raíz: en Android
|
|
49
|
+
el `Image` no manda las `headers`, así que se bajan con `fetch` y se pinta el archivo.
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
<ProveedorDeFotos bajar={(ruta) => bajarConMiToken(ruta) /* → la uri local */}>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Sin proveedor, la `ruta` de una foto se pinta tal cual, como URL pública.
|
|
56
|
+
|
|
57
|
+
### La tipografía de Android
|
|
58
|
+
|
|
59
|
+
Android va con Inter (iOS se queda con San Francisco; ver `src/tema/fuentes.ts`). Los archivos
|
|
60
|
+
vienen en el paquete y cada app los registra en su `app.json`:
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
["expo-font", {
|
|
64
|
+
"android": {
|
|
65
|
+
"fonts": [{
|
|
66
|
+
"fontFamily": "Inter",
|
|
67
|
+
"fontDefinitions": [
|
|
68
|
+
{ "path": "./node_modules/@acvl/mobile-components/assets/fonts/Inter_400Regular.ttf", "weight": 400 },
|
|
69
|
+
{ "path": "./node_modules/@acvl/mobile-components/assets/fonts/Inter_500Medium.ttf", "weight": 500 },
|
|
70
|
+
{ "path": "./node_modules/@acvl/mobile-components/assets/fonts/Inter_600SemiBold.ttf", "weight": 600 },
|
|
71
|
+
{ "path": "./node_modules/@acvl/mobile-components/assets/fonts/Inter_700Bold.ttf", "weight": 700 },
|
|
72
|
+
{ "path": "./node_modules/@acvl/mobile-components/assets/fonts/Inter_800ExtraBold.ttf", "weight": 800 },
|
|
73
|
+
{ "path": "./node_modules/@acvl/mobile-components/assets/fonts/Inter_900Black.ttf", "weight": 900 }
|
|
74
|
+
]
|
|
75
|
+
}]
|
|
76
|
+
}
|
|
77
|
+
}]
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Cambiar esa lista obliga a reconstruir el binario.
|
|
81
|
+
|
|
82
|
+
## Armar una app
|
|
83
|
+
|
|
84
|
+
El layout raíz monta el tema y los diálogos, y exporta la pantalla de error:
|
|
85
|
+
|
|
86
|
+
```tsx
|
|
87
|
+
import { HostDeDialogos, PantallaDeError, ProveedorDeTema } from "@acvl/mobile-components";
|
|
88
|
+
import * as SecureStore from "expo-secure-store";
|
|
89
|
+
|
|
90
|
+
const almacenDelTema = {
|
|
91
|
+
leer: () => SecureStore.getItemAsync("TEMA"),
|
|
92
|
+
guardar: (tema) => SecureStore.setItemAsync("TEMA", tema),
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export const ErrorBoundary = (props) => (
|
|
96
|
+
<PantallaDeError {...props} onError={(error) => Sentry.captureException(error)} />
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
export default function RootLayout() {
|
|
100
|
+
return (
|
|
101
|
+
<ProveedorDeTema almacen={almacenDelTema}>
|
|
102
|
+
<Stack screenOptions={{ headerShown: false }} />
|
|
103
|
+
<HostDeDialogos />
|
|
104
|
+
</ProveedorDeTema>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Las pestañas toman el header y la barra de la casa:
|
|
110
|
+
|
|
111
|
+
```tsx
|
|
112
|
+
const encabezado = useOpcionesDelEncabezado({
|
|
113
|
+
eyebrow: "Operador",
|
|
114
|
+
derecha: <BotonDeAvatar iniciales="JP" onPress={() => router.push("/perfil")} />,
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
<Tabs screenOptions={encabezado} tabBar={(props) => <BarraDePestanas {...props} iconos={{ index: "assignment" }} />}>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Y una pantalla toma sus colores de la paleta, nunca hexadecimales:
|
|
121
|
+
|
|
122
|
+
```tsx
|
|
123
|
+
const useStyles = crearEstilos((c) => ({
|
|
124
|
+
tarjeta: { backgroundColor: c.superficie, borderRadius: 14, padding: 14 },
|
|
125
|
+
titulo: { ...renglon(tipografia.subtitulo), fontWeight: "800", color: c.texto },
|
|
126
|
+
}));
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Desarrollar
|
|
130
|
+
|
|
131
|
+
```sh
|
|
132
|
+
npm install
|
|
133
|
+
npm run typecheck
|
|
134
|
+
npm test # la lógica pura: diálogos, errores del servidor
|
|
135
|
+
npm run build # bob: lib/module y lib/typescript
|
|
136
|
+
npm run format
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Para ver un cambio en una app sin publicar, la app de tms tiene `npm run start:lib`: Metro sirve
|
|
140
|
+
`src/` de este checkout (`../../acv-mobile-components`) en lugar del paquete de `node_modules`.
|
|
141
|
+
Tiene que estar junto a la app, en la misma carpeta que `acv-tms`.
|
|
142
|
+
|
|
143
|
+
## Publicar
|
|
144
|
+
|
|
145
|
+
Igual que la del portal: cada push a `main` corre el typecheck y las pruebas, sube el _patch_ si la
|
|
146
|
+
versión ya está en npm, publica y hace commit y tag del bump. Un bump a mano (un _minor_) se respeta.
|
|
147
|
+
Necesita el secret `NPM_TOKEN` en el repo.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2020 The Inter Project Authors (https://github.com/rsms/inter)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
https://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Text } from "../texto";
|
|
4
|
+
import { crearEstilos, renglon, tipografia, usePaleta } from "../tema";
|
|
5
|
+
import MaterialCommunityIcons from "@expo/vector-icons/MaterialCommunityIcons";
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { ActivityIndicator, BackHandler, Pressable, useWindowDimensions, View } from "react-native";
|
|
8
|
+
import { Menu } from "react-native-paper";
|
|
9
|
+
|
|
10
|
+
/** Lo que mide un botón y lo que se separan: con eso se cuenta cuántos caben. */
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
12
|
+
const LADO = 40;
|
|
13
|
+
const ENTRE = 8;
|
|
14
|
+
/** Los que se ven a lo más, aunque quepan más: más botones ya no se distinguen de un vistazo. */
|
|
15
|
+
const MAXIMO_A_LA_VISTA = 3;
|
|
16
|
+
/**
|
|
17
|
+
* La cifra sobre un botón: «9+» de diez para arriba, que más dígitos no caben en el círculo. Con la
|
|
18
|
+
* letra de la casa (`etiqueta`) y el círculo crece con la del sistema, como el de `RotuloDeSeccion`.
|
|
19
|
+
*/
|
|
20
|
+
const Insignia = ({
|
|
21
|
+
cuantas
|
|
22
|
+
}) => {
|
|
23
|
+
const styles = useStyles();
|
|
24
|
+
const {
|
|
25
|
+
fontScale
|
|
26
|
+
} = useWindowDimensions();
|
|
27
|
+
const alto = renglon(tipografia.etiqueta).lineHeight * fontScale;
|
|
28
|
+
return /*#__PURE__*/_jsx(View, {
|
|
29
|
+
style: [styles.insignia, {
|
|
30
|
+
minWidth: alto,
|
|
31
|
+
height: alto,
|
|
32
|
+
borderRadius: alto / 2
|
|
33
|
+
}],
|
|
34
|
+
pointerEvents: "none",
|
|
35
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
36
|
+
style: styles.insigniaTexto,
|
|
37
|
+
children: cuantas > 9 ? "9+" : cuantas
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
const Boton = ({
|
|
42
|
+
accion,
|
|
43
|
+
onPress
|
|
44
|
+
}) => {
|
|
45
|
+
const c = usePaleta();
|
|
46
|
+
const styles = useStyles();
|
|
47
|
+
return /*#__PURE__*/_jsxs(Pressable, {
|
|
48
|
+
onPress: onPress,
|
|
49
|
+
disabled: accion.disabled || accion.cargando,
|
|
50
|
+
accessibilityRole: "button",
|
|
51
|
+
accessibilityLabel: accion.etiqueta,
|
|
52
|
+
hitSlop: 4,
|
|
53
|
+
style: ({
|
|
54
|
+
pressed
|
|
55
|
+
}) => [styles.boton, accion.disabled && styles.apagado, pressed && styles.presionado],
|
|
56
|
+
children: [accion.cargando ? /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
57
|
+
size: "small",
|
|
58
|
+
color: c.primary
|
|
59
|
+
}) : /*#__PURE__*/_jsx(MaterialCommunityIcons, {
|
|
60
|
+
name: accion.icono,
|
|
61
|
+
size: 22,
|
|
62
|
+
color: accion.destructiva ? c.primary : c.secondaryDark
|
|
63
|
+
}), accion.insignia ? /*#__PURE__*/_jsx(Insignia, {
|
|
64
|
+
cuantas: accion.insignia
|
|
65
|
+
}) : null]
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Las acciones de una ficha en su encabezado: **las que quepan como botones y las demás en el menú
|
|
71
|
+
* de los tres puntos**. Es el `ResponsiveActions` de la app de acv-wms con la paleta de la casa.
|
|
72
|
+
*
|
|
73
|
+
* No mide los botones: mide el hueco que le deja el título (`onLayout`) y cuenta cuántos de
|
|
74
|
+
* `LADO` caben. Si caben todas, van todas; si no, una menos y el menú. Las `fijadas` son las
|
|
75
|
+
* últimas en irse, sin cambiar el orden en que se ven. Quien la pone le da al título
|
|
76
|
+
* `flexShrink: 1` y no `flex: 1`, para que le deje espacio.
|
|
77
|
+
*/
|
|
78
|
+
export default function AccionesDelEncabezado({
|
|
79
|
+
acciones
|
|
80
|
+
}) {
|
|
81
|
+
const c = usePaleta();
|
|
82
|
+
const styles = useStyles();
|
|
83
|
+
const [hueco, setHueco] = React.useState(null);
|
|
84
|
+
const [menuAbierto, setMenuAbierto] = React.useState(false);
|
|
85
|
+
|
|
86
|
+
// Atrás con el menú abierto sólo lo cierra: si no, salía de la pantalla con el menú encima.
|
|
87
|
+
React.useEffect(() => {
|
|
88
|
+
if (!menuAbierto) return;
|
|
89
|
+
const sub = BackHandler.addEventListener("hardwareBackPress", () => {
|
|
90
|
+
setMenuAbierto(false);
|
|
91
|
+
return true;
|
|
92
|
+
});
|
|
93
|
+
return () => sub.remove();
|
|
94
|
+
}, [menuAbierto]);
|
|
95
|
+
const medir = e => {
|
|
96
|
+
const ancho = e.nativeEvent.layout.width;
|
|
97
|
+
if (ancho === hueco) return;
|
|
98
|
+
setHueco(ancho);
|
|
99
|
+
setMenuAbierto(false);
|
|
100
|
+
};
|
|
101
|
+
if (!acciones.length) return null;
|
|
102
|
+
const caben = hueco === null ? 0 : Math.floor((hueco + ENTRE) / (LADO + ENTRE));
|
|
103
|
+
const todas = acciones.length <= Math.min(caben, MAXIMO_A_LA_VISTA);
|
|
104
|
+
const botones = todas ? acciones.length : Math.max(Math.min(caben - 1, MAXIMO_A_LA_VISTA), 0);
|
|
105
|
+
const aLaVista = new Set([...acciones].sort((a, b) => Number(Boolean(b.fijada)) - Number(Boolean(a.fijada))).slice(0, botones));
|
|
106
|
+
const visibles = acciones.filter(a => aLaVista.has(a));
|
|
107
|
+
const enElMenu = acciones.filter(a => !aLaVista.has(a));
|
|
108
|
+
const escondidas = enElMenu.reduce((suma, a) => suma + (a.insignia ?? 0), 0);
|
|
109
|
+
const cerrar = () => setMenuAbierto(false);
|
|
110
|
+
return /*#__PURE__*/_jsx(View, {
|
|
111
|
+
style: styles.barra,
|
|
112
|
+
onLayout: medir,
|
|
113
|
+
children: hueco !== null ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
114
|
+
children: [visibles.map(a => /*#__PURE__*/_jsx(Boton, {
|
|
115
|
+
accion: a,
|
|
116
|
+
onPress: a.onPress
|
|
117
|
+
}, a.etiqueta)), enElMenu.length ? /*#__PURE__*/_jsx(Menu, {
|
|
118
|
+
visible: menuAbierto,
|
|
119
|
+
onDismiss: cerrar,
|
|
120
|
+
anchorPosition: "bottom"
|
|
121
|
+
// Edge-to-edge: sin esto Paper cuenta dos veces la barra de estado.
|
|
122
|
+
,
|
|
123
|
+
statusBarHeight: 0,
|
|
124
|
+
contentStyle: styles.menu,
|
|
125
|
+
anchor: /*#__PURE__*/_jsx(Boton, {
|
|
126
|
+
accion: {
|
|
127
|
+
etiqueta: "Más acciones",
|
|
128
|
+
icono: "dots-vertical",
|
|
129
|
+
insignia: escondidas
|
|
130
|
+
},
|
|
131
|
+
onPress: () => setMenuAbierto(true)
|
|
132
|
+
}),
|
|
133
|
+
children: enElMenu.map(a => /*#__PURE__*/_jsx(Menu.Item, {
|
|
134
|
+
title: /*#__PURE__*/_jsxs(Text, {
|
|
135
|
+
style: [styles.menuTexto, a.destructiva && styles.rojo],
|
|
136
|
+
children: [a.etiqueta, a.insignia ? ` (${a.insignia})` : ""]
|
|
137
|
+
}),
|
|
138
|
+
disabled: a.disabled || a.cargando,
|
|
139
|
+
leadingIcon: () => a.cargando ? /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
140
|
+
size: "small",
|
|
141
|
+
color: c.primary
|
|
142
|
+
}) : /*#__PURE__*/_jsx(MaterialCommunityIcons, {
|
|
143
|
+
name: a.icono,
|
|
144
|
+
size: 22,
|
|
145
|
+
color: a.destructiva ? c.primary : c.secondaryDark
|
|
146
|
+
}),
|
|
147
|
+
onPress: () => {
|
|
148
|
+
cerrar();
|
|
149
|
+
a.onPress();
|
|
150
|
+
}
|
|
151
|
+
}, a.etiqueta))
|
|
152
|
+
}) : null]
|
|
153
|
+
}) : null
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
const useStyles = crearEstilos(c => ({
|
|
157
|
+
barra: {
|
|
158
|
+
flexGrow: 1,
|
|
159
|
+
flexBasis: 0,
|
|
160
|
+
minWidth: LADO,
|
|
161
|
+
flexDirection: "row",
|
|
162
|
+
justifyContent: "flex-end",
|
|
163
|
+
gap: ENTRE,
|
|
164
|
+
alignSelf: "center"
|
|
165
|
+
},
|
|
166
|
+
boton: {
|
|
167
|
+
width: LADO,
|
|
168
|
+
height: LADO,
|
|
169
|
+
borderRadius: LADO / 2,
|
|
170
|
+
borderWidth: 1.5,
|
|
171
|
+
borderColor: c.secondaryLighter,
|
|
172
|
+
backgroundColor: c.superficieTenue,
|
|
173
|
+
alignItems: "center",
|
|
174
|
+
justifyContent: "center"
|
|
175
|
+
},
|
|
176
|
+
apagado: {
|
|
177
|
+
opacity: 0.45
|
|
178
|
+
},
|
|
179
|
+
presionado: {
|
|
180
|
+
opacity: 0.7
|
|
181
|
+
},
|
|
182
|
+
menu: {
|
|
183
|
+
backgroundColor: c.superficie,
|
|
184
|
+
borderRadius: 12
|
|
185
|
+
},
|
|
186
|
+
insignia: {
|
|
187
|
+
position: "absolute",
|
|
188
|
+
// Dentro del círculo y no colgada de su esquina: en Android lo que se sale del padre se
|
|
189
|
+
// recorta, y la cifra quedaba a medias.
|
|
190
|
+
top: 0,
|
|
191
|
+
right: 0,
|
|
192
|
+
paddingHorizontal: 4,
|
|
193
|
+
alignItems: "center",
|
|
194
|
+
justifyContent: "center",
|
|
195
|
+
backgroundColor: c.primary,
|
|
196
|
+
borderWidth: 2,
|
|
197
|
+
borderColor: c.superficie
|
|
198
|
+
},
|
|
199
|
+
insigniaTexto: {
|
|
200
|
+
...renglon(tipografia.etiqueta),
|
|
201
|
+
fontWeight: "800",
|
|
202
|
+
color: c.sobrePrimario
|
|
203
|
+
},
|
|
204
|
+
menuTexto: {
|
|
205
|
+
fontSize: 17,
|
|
206
|
+
fontWeight: "600"
|
|
207
|
+
},
|
|
208
|
+
rojo: {
|
|
209
|
+
color: c.primary
|
|
210
|
+
}
|
|
211
|
+
}));
|
|
212
|
+
//# sourceMappingURL=AccionesDelEncabezado.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Text","crearEstilos","renglon","tipografia","usePaleta","MaterialCommunityIcons","React","ActivityIndicator","BackHandler","Pressable","useWindowDimensions","View","Menu","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","LADO","ENTRE","MAXIMO_A_LA_VISTA","Insignia","cuantas","styles","useStyles","fontScale","alto","etiqueta","lineHeight","style","insignia","minWidth","height","borderRadius","pointerEvents","children","insigniaTexto","Boton","accion","onPress","c","disabled","cargando","accessibilityRole","accessibilityLabel","hitSlop","pressed","boton","apagado","presionado","size","color","primary","name","icono","destructiva","secondaryDark","AccionesDelEncabezado","acciones","hueco","setHueco","useState","menuAbierto","setMenuAbierto","useEffect","sub","addEventListener","remove","medir","e","ancho","nativeEvent","layout","width","length","caben","Math","floor","todas","min","botones","max","aLaVista","Set","sort","a","b","Number","Boolean","fijada","slice","visibles","filter","has","enElMenu","escondidas","reduce","suma","cerrar","barra","onLayout","map","visible","onDismiss","anchorPosition","statusBarHeight","contentStyle","menu","anchor","Item","title","menuTexto","rojo","leadingIcon","flexGrow","flexBasis","flexDirection","justifyContent","gap","alignSelf","borderWidth","borderColor","secondaryLighter","backgroundColor","superficieTenue","alignItems","opacity","superficie","position","top","right","paddingHorizontal","fontWeight","sobrePrimario","fontSize"],"sourceRoot":"../../../src","sources":["componentes/AccionesDelEncabezado.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,UAAU;AAC/B,SAASC,YAAY,EAAEC,OAAO,EAAEC,UAAU,EAAEC,SAAS,QAAQ,SAAS;AACtE,OAAOC,sBAAsB,MAAM,2CAA2C;AAC9E,OAAOC,KAAK,MAAM,OAAO;AACzB,SACIC,iBAAiB,EACjBC,WAAW,EACXC,SAAS,EACTC,mBAAmB,EACnBC,IAAI,QAED,cAAc;AACrB,SAASC,IAAI,QAAQ,oBAAoB;;AAEzC;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AACA,MAAMC,IAAI,GAAG,EAAE;AACf,MAAMC,KAAK,GAAG,CA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AAC;IACtBsG,WAAW,EAAE,GAAG;IAChBC,WAAW,EAAEjF,CAAC,CAACkF,gBAAgB;IAC/BC,eAAe,EAAEnF,CAAC,CAACoF,eAAe;IAClCC,UAAU,EAAE,QAAQ;IACpBR,cAAc,EAAE;EACpB,CAAC;EACDrE,OAAO,EAAE;IAAE8E,OAAO,EAAE;EAAK,CAAC;EAC1B7E,UAAU,EAAE;IAAE6E,OAAO,EAAE;EAAI,CAAC;EAC5BnB,IAAI,EAAE;IAAEgB,eAAe,EAAEnF,CAAC,CAACuF,UAAU;IAAE9F,YAAY,EAAE;EAAG,CAAC;EACzDH,QAAQ,EAAE;IACNkG,QAAQ,EAAE,UAAU;IACpB;IACA;IACAC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,iBAAiB,EAAE,CAAC;IACpBN,UAAU,EAAE,QAAQ;IACpBR,cAAc,EAAE,QAAQ;IACxBM,eAAe,EAAEnF,CAAC,CAACY,OAAO;IAC1BoE,WAAW,EAAE,CAAC;IACdC,WAAW,EAAEjF,CAAC,CAACuF;EACnB,CAAC;EACD3F,aAAa,EAAE;IAAE,GAAGnC,OAAO,CAACC,UAAU,CAACyB,QAAQ,CAAC;IAAEyG,UAAU,EAAE,KAAK;IAAEjF,KAAK,EAAEX,CAAC,CAAC6F;EAAc,CAAC;EAC7FtB,SAAS,EAAE;IAAEuB,QAAQ,EAAE,EAAE;IAAEF,UAAU,EAAE;EAAM,CAAC;EAC9CpB,IAAI,EAAE;IAAE7D,KAAK,EAAEX,CAAC,CAACY;EAAQ;AAC7B,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Pressable, StyleSheet } from "react-native";
|
|
4
|
+
import { Avatar } from "react-native-paper";
|
|
5
|
+
import { tipografia } from "../tema";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* La inicial de cada parte, hasta dos: `inicialesDe(nombre, apellidos)` da «JP»; con sólo el nombre
|
|
9
|
+
* de la cuenta, su primera letra; sin nada, una inicial neutra.
|
|
10
|
+
*/
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
export const inicialesDe = (...partes) => (partes.map(p => (p ?? "").trim().charAt(0)).filter(Boolean).slice(0, 2).join("") || "?").toUpperCase();
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* El avatar de quien entró, en el header de las pestañas: el acceso al perfil (y a cerrar sesión).
|
|
16
|
+
* Quien lo pone decide las iniciales y a dónde lleva.
|
|
17
|
+
*/
|
|
18
|
+
const BotonDeAvatar = ({
|
|
19
|
+
iniciales,
|
|
20
|
+
onPress,
|
|
21
|
+
etiqueta = "Perfil"
|
|
22
|
+
}) => /*#__PURE__*/_jsx(Pressable, {
|
|
23
|
+
onPress: onPress,
|
|
24
|
+
hitSlop: 8,
|
|
25
|
+
accessibilityRole: "button",
|
|
26
|
+
accessibilityLabel: etiqueta,
|
|
27
|
+
style: ({
|
|
28
|
+
pressed
|
|
29
|
+
}) => [styles.btn, pressed && {
|
|
30
|
+
opacity: 0.6
|
|
31
|
+
}],
|
|
32
|
+
children: /*#__PURE__*/_jsx(Avatar.Text, {
|
|
33
|
+
size: 36,
|
|
34
|
+
label: iniciales.slice(0, 2).toUpperCase()
|
|
35
|
+
// Blanca sobre el rojo en los dos modos: el tema oscuro de Paper la ponía oscura.
|
|
36
|
+
,
|
|
37
|
+
color: "#ffffff",
|
|
38
|
+
labelStyle: styles.initial
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
const styles = StyleSheet.create({
|
|
42
|
+
btn: {
|
|
43
|
+
width: 40,
|
|
44
|
+
height: 40,
|
|
45
|
+
alignItems: "center",
|
|
46
|
+
justifyContent: "center"
|
|
47
|
+
},
|
|
48
|
+
initial: {
|
|
49
|
+
fontSize: tipografia.etiqueta,
|
|
50
|
+
fontWeight: "700",
|
|
51
|
+
lineHeight: 20
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
export default BotonDeAvatar;
|
|
55
|
+
//# sourceMappingURL=BotonDeAvatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Pressable","StyleSheet","Avatar","tipografia","jsx","_jsx","inicialesDe","partes","map","p","trim","charAt","filter","Boolean","slice","join","toUpperCase","BotonDeAvatar","iniciales","onPress","etiqueta","hitSlop","accessibilityRole","accessibilityLabel","style","pressed","styles","btn","opacity","children","Text","size","label","color","labelStyle","initial","create","width","height","alignItems","justifyContent","fontSize","fontWeight","lineHeight"],"sourceRoot":"../../../src","sources":["componentes/BotonDeAvatar.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,UAAU,QAAQ,cAAc;AACpD,SAASC,MAAM,QAAQ,oBAAoB;AAC3C,SAASC,UAAU,QAAQ,SAAS;;AAEpC;AACA;AACA;AACA;AAHA,SAAAC,GAAA,IAAAC,IAAA;AAIA,OAAO,MAAMC,WAAW,GAAGA,CAAC,GAAGC,MAAqC,KAChE,CACIA,MAAM,CACDC,GAAG,CAAEC,CAAC,IAAK,CAACA,CAAC,IAAI,EAAE,EAAEC,IAAI,CAAC,CAAC,CAACC,MAAM,CAAC,CAAC,CAAC,CAAC,CACtCC,MAAM,CAACC,OAAO,CAAC,CACfC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CACXC,IAAI,CAAC,EAAE,CAAC,IAAI,GAAG,EACtBC,WAAW,CAAC,CAAC;;AAEnB;AACA;AACA;AACA;AACA,MAAMC,aAAa,GAAGA,CAAC;EACnBC,SAAS;EACTC,OAAO;EACPC,QAAQ,GAAG;AAMf,CAAC,kBACGf,IAAA,CAACL,SAAS;EACNmB,OAAO,EAAEA,OAAQ;EACjBE,OAAO,EAAE,CAAE;EACXC,iBAAiB,EAAC,QAAQ;EAC1BC,kBAAkB,EAAEH,QAAS;EAC7BI,KAAK,EAAEA,CAAC;IAAEC;EAAQ,CAAC,KAAK,CAACC,MAAM,CAACC,GAAG,EAAEF,OAAO,IAAI;IAAEG,OAAO,EAAE;EAAI,CAAC,CAAE;EAAAC,QAAA,eAElExB,IAAA,CAACH,MAAM,CAAC4B,IAAI;IACRC,IAAI,EAAE,EAAG;IACTC,KAAK,EAAEd,SAAS,CAACJ,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAACE,WAAW,CAAC;IACzC;IAAA;IACAiB,KAAK,EAAC,SAAS;IACfC,UAAU,EAAER,MAAM,CAACS;EAAQ,CAC9B;AAAC,CACK,CACd;AAED,MAAMT,MAAM,GAAGzB,UAAU,CAACmC,MAAM,CAAC;EAC7BT,GAAG,EAAE;IACDU,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EACpB,CAAC;EACDL,OAAO,EAAE;IAAEM,QAAQ,EAAEtC,UAAU,CAACiB,QAAQ;IAAEsB,UAAU,EAAE,KAAK;IAAEC,UAAU,EAAE;EAAG;AAChF,CAAC,CAAC;AAEF,eAAe1B,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { crearEstilos, renglon, tipografia, usePaleta } from "../tema";
|
|
4
|
+
import IconoDeRenglon from "../componentes/IconoDeRenglon";
|
|
5
|
+
import { Text } from "../texto";
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { ActivityIndicator, Pressable, View } from "react-native";
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
/**
|
|
10
|
+
* El botón de una acción del flujo (Iniciar, Completar, Reintentar): ancho completo, alto
|
|
11
|
+
* generoso y letra de subtítulo, para atinarle de pie y con la letra del teléfono al 180%.
|
|
12
|
+
*
|
|
13
|
+
* Es propio y no el `Button` de Paper porque ése corta su texto a un renglón: con la letra grande
|
|
14
|
+
* «Iniciar asignación desde donde estás» quedaba en «Iniciar asignac…». Aquí el texto parte en los
|
|
15
|
+
* renglones que haga falta y el botón crece con él.
|
|
16
|
+
*/
|
|
17
|
+
const BotonGrande = ({
|
|
18
|
+
children,
|
|
19
|
+
icono,
|
|
20
|
+
onPress,
|
|
21
|
+
disabled,
|
|
22
|
+
cargando,
|
|
23
|
+
modo = "relleno"
|
|
24
|
+
}) => {
|
|
25
|
+
const c = usePaleta();
|
|
26
|
+
const styles = useStyles();
|
|
27
|
+
const inactivo = disabled || cargando;
|
|
28
|
+
// El destructivo es un relleno de otro color: misma tinta blanca, mismo apagado.
|
|
29
|
+
const relleno = modo !== "contorno";
|
|
30
|
+
const tinta = relleno ? c.sobrePrimario : c.primary;
|
|
31
|
+
return /*#__PURE__*/_jsx(Pressable, {
|
|
32
|
+
onPress: onPress,
|
|
33
|
+
disabled: inactivo,
|
|
34
|
+
accessibilityRole: "button",
|
|
35
|
+
accessibilityState: {
|
|
36
|
+
disabled: !!inactivo,
|
|
37
|
+
busy: !!cargando
|
|
38
|
+
},
|
|
39
|
+
style: ({
|
|
40
|
+
pressed
|
|
41
|
+
}) => [styles.boton, relleno ? modo === "destructivo" ? styles.destructivo : modo === "listo" ? styles.listo : styles.relleno : styles.contorno, inactivo && (relleno ? styles.rellenoInactivo : styles.contornoInactivo), pressed && {
|
|
42
|
+
opacity: 0.85
|
|
43
|
+
}],
|
|
44
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
45
|
+
style: styles.fila,
|
|
46
|
+
children: [cargando ? /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
47
|
+
color: tinta
|
|
48
|
+
}) : icono ? /*#__PURE__*/_jsx(IconoDeRenglon, {
|
|
49
|
+
name: icono,
|
|
50
|
+
fontSize: tipografia.subtitulo,
|
|
51
|
+
size: 26,
|
|
52
|
+
color: inactivo ? c.secondaryLight : tinta
|
|
53
|
+
}) : null, /*#__PURE__*/_jsx(Text, {
|
|
54
|
+
style: [styles.texto, {
|
|
55
|
+
color: inactivo ? c.secondaryLight : tinta
|
|
56
|
+
}],
|
|
57
|
+
children: children
|
|
58
|
+
})]
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
const useStyles = crearEstilos(c => ({
|
|
63
|
+
boton: {
|
|
64
|
+
minHeight: 64,
|
|
65
|
+
borderRadius: 14,
|
|
66
|
+
paddingVertical: 14,
|
|
67
|
+
paddingHorizontal: 18,
|
|
68
|
+
justifyContent: "center"
|
|
69
|
+
},
|
|
70
|
+
relleno: {
|
|
71
|
+
backgroundColor: c.primary
|
|
72
|
+
},
|
|
73
|
+
destructivo: {
|
|
74
|
+
backgroundColor: c.primaryDark
|
|
75
|
+
},
|
|
76
|
+
// Un relleno con letra blanca: el verde oscuro se lee igual en los dos modos.
|
|
77
|
+
listo: {
|
|
78
|
+
backgroundColor: "#2e7d32"
|
|
79
|
+
},
|
|
80
|
+
rellenoInactivo: {
|
|
81
|
+
backgroundColor: c.secondaryLighter
|
|
82
|
+
},
|
|
83
|
+
contorno: {
|
|
84
|
+
borderWidth: 2,
|
|
85
|
+
borderColor: c.primary,
|
|
86
|
+
backgroundColor: c.superficie
|
|
87
|
+
},
|
|
88
|
+
contornoInactivo: {
|
|
89
|
+
borderColor: c.secondaryLighter
|
|
90
|
+
},
|
|
91
|
+
fila: {
|
|
92
|
+
flexDirection: "row",
|
|
93
|
+
alignItems: "flex-start",
|
|
94
|
+
justifyContent: "center",
|
|
95
|
+
gap: 10
|
|
96
|
+
},
|
|
97
|
+
texto: {
|
|
98
|
+
flexShrink: 1,
|
|
99
|
+
...renglon(tipografia.subtitulo),
|
|
100
|
+
fontWeight: "800",
|
|
101
|
+
textAlign: "center"
|
|
102
|
+
}
|
|
103
|
+
}));
|
|
104
|
+
export default BotonGrande;
|
|
105
|
+
//# sourceMappingURL=BotonGrande.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["crearEstilos","renglon","tipografia","usePaleta","IconoDeRenglon","Text","React","ActivityIndicator","Pressable","View","jsx","_jsx","jsxs","_jsxs","BotonGrande","children","icono","onPress","disabled","cargando","modo","c","styles","useStyles","inactivo","relleno","tinta","sobrePrimario","primary","accessibilityRole","accessibilityState","busy","style","pressed","boton","destructivo","listo","contorno","rellenoInactivo","contornoInactivo","opacity","fila","color","name","fontSize","subtitulo","size","secondaryLight","texto","minHeight","borderRadius","paddingVertical","paddingHorizontal","justifyContent","backgroundColor","primaryDark","secondaryLighter","borderWidth","borderColor","superficie","flexDirection","alignItems","gap","flexShrink","fontWeight","textAlign"],"sourceRoot":"../../../src","sources":["componentes/BotonGrande.tsx"],"mappings":";;AAAA,SAASA,YAAY,EAAEC,OAAO,EAAEC,UAAU,EAAEC,SAAS,QAAQ,SAAS;AACtE,OAAOC,cAAc,MAAM,+BAA+B;AAC1D,SAASC,IAAI,QAAQ,UAAU;AAE/B,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,iBAAiB,EAAEC,SAAS,EAAEC,IAAI,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAgBlE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,WAAW,GAAGA,CAAC;EAAEC,QAAQ;EAAEC,KAAK;EAAEC,OAAO;EAAEC,QAAQ;EAAEC,QAAQ;EAAEC,IAAI,GAAG;AAAiB,CAAC,KAAK;EAC/F,MAAMC,CAAC,GAAGlB,SAAS,CAAC,CAAC;EACrB,MAAMmB,MAAM,GAAGC,SAAS,CAAC,CAAC;EAC1B,MAAMC,QAAQ,GAAGN,QAAQ,IAAIC,QAAQ;EACrC;EACA,MAAMM,OAAO,GAAGL,IAAI,KAAK,UAAU;EACnC,MAAMM,KAAK,GAAGD,OAAO,GAAGJ,CAAC,CAACM,aAAa,GAAGN,CAAC,CAACO,OAAO;EAEnD,oBACIjB,IAAA,CAACH,SAAS;IACNS,OAAO,EAAEA,OAAQ;IACjBC,QAAQ,EAAEM,QAAS;IACnBK,iBAAiB,EAAC,QAAQ;IAC1BC,kBAAkB,EA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