@cm-sigoo-temp/ui 0.2.21 → 0.2.23

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 CHANGED
@@ -1,20 +1,102 @@
1
- # Introduction
2
- TODO: Give a short introduction of your project. Let this section explain the objectives or the motivation behind this project.
3
-
4
- # Getting Started
5
- TODO: Guide users through getting your code up and running on their own system. In this section you can talk about:
6
- 1. Installation process
7
- 2. Software dependencies
8
- 3. Latest releases
9
- 4. API references
10
-
11
- # Build and Test
12
- TODO: Describe and show how to build your code and run the tests.
13
-
14
- # Contribute
15
- TODO: Explain how other users and developers can contribute to make your code better.
16
-
17
- If you want to learn more about creating good readme files then refer the following [guidelines](https://docs.microsoft.com/en-us/azure/devops/repos/git/create-a-readme?view=azure-devops). You can also seek inspiration from the below readme files:
18
- - [ASP.NET Core](https://github.com/aspnet/Home)
19
- - [Visual Studio Code](https://github.com/Microsoft/vscode)
20
- - [Chakra Core](https://github.com/Microsoft/ChakraCore)
1
+ # Documentación
2
+
3
+ ## Instalación
4
+
5
+ ```
6
+ npm i @cm-sigoo-temp/ui
7
+ yarn add @cm-sigoo-temp/ui
8
+ ```
9
+
10
+ ## Sistema de Iconos con Material Symbols
11
+
12
+ Los iconos como string deben usar los nombres de
13
+ [Material Symbols](https://fonts.google.com/icons):
14
+
15
+ ```typescript
16
+ // Ejemplos válidos:
17
+ icono: 'home'; // Icono simple
18
+ icono: 'home_outlined'; // Variante outlined
19
+ icono: 'settings_suggest'; // Icono compuesto
20
+ icono: 'cancel_presentation'; // Equivalente a CancelPresentationIcon
21
+ ```
22
+
23
+ Los iconos como elemento deben usar los nombres de
24
+ [Material icons](https://mui.com/material-ui/material-icons):
25
+
26
+ ```typescript
27
+ // Ejemplos válidos:
28
+ import AcUnitIcon from '@mui/icons-material/AcUnit';
29
+ import AcUnitOutlinedIcon from '@mui/icons-material/AcUnitOutlined';
30
+
31
+ icono: AcUnitIcon; // Icono simple
32
+ icono: AcUnitOutlinedIcon; // Variante outlined
33
+ ```
34
+
35
+ ## Estructura de Menús con Permisos
36
+
37
+ ```typescript
38
+ import { TMenuDrawer } from '@cm-sigoo-temp/ui';
39
+ import { DashboardIcon } from '@mui/icons-material';
40
+ import HomeOutlinedIcon from '@mui/icons-material/HomeOutlined';
41
+
42
+ export const menus: TMenuDrawer[] = [
43
+ {
44
+ id: 'principal',
45
+ nombre: 'Principal',
46
+ icono: HomeOutlinedIcon,
47
+ to: '/',
48
+ },
49
+ {
50
+ id: 'dashboard',
51
+ nombre: 'Dashboard',
52
+ icono: DashboardIcon,
53
+ to: '/dashboard',
54
+ },
55
+ {
56
+ id: 'admin',
57
+ nombre: 'Administración',
58
+ subMenus: [
59
+ {
60
+ id: 'users',
61
+ nombre: 'Usuarios',
62
+ icono: 'group',
63
+ to: '/admin/users',
64
+ },
65
+ ],
66
+ },
67
+ ];
68
+ ```
69
+
70
+ ## Sistema de Permisos y Autorización
71
+
72
+ El componente se integra con el servicio de autorización en:
73
+ `https://autorizacionv2-dev.coordinadora.com/`
74
+
75
+ ### Flujo de autorización:
76
+
77
+ 1. **Autenticación**: Vía Keycloak
78
+ 2. **Obtención de permisos**: Consulta al endpoint de autorización
79
+ 3. **Filtrado de menús**: Los menús se muestran según permisos
80
+
81
+ ## Implementación
82
+
83
+ ```jsx
84
+ import { AuthLayout } from '@cm-sigoo-temp/ui';
85
+ import { Link } from 'react-router';
86
+ import { menus } from './constantes';
87
+
88
+ function App() {
89
+ return (
90
+ <AuthLayout.Keycloak
91
+ idApp="ejemplo-plantilla-front"
92
+ nombreApp="Ejemplo Plantilla Front"
93
+ menus={menus}
94
+ LinkComponent={Link}
95
+ >
96
+ {/* Contenido */}
97
+ </AuthLayout.Keycloak>
98
+ );
99
+ }
100
+
101
+ export default App;
102
+ ```