@codeplex-sac/utils 0.0.2 → 0.0.4
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 +90 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,93 @@
|
|
|
1
|
-
# utils
|
|
1
|
+
# @codeplex-sac/utils
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Utilidades de bajo nivel y componentes auxiliares para la construcción de interfaces complejas.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 📦 Instalación
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @mui/material @codeplex-sac/utils
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 🛠️ Utilidades de Comportamiento
|
|
14
|
+
|
|
15
|
+
### `<CodeplexDetectorClickFuera />` (Click Away Listener)
|
|
16
|
+
Detecta clics fuera del elemento hijo. Ideal para cerrar menús o dropdowns customizados.
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
<CodeplexDetectorClickFuera alHacerClickFuera={() => setAbierto(false)}>
|
|
20
|
+
<div className="menu-dropdown">
|
|
21
|
+
...
|
|
22
|
+
</div>
|
|
23
|
+
</CodeplexDetectorClickFuera>
|
|
24
|
+
```
|
|
25
|
+
| Propiedad | Descripción |
|
|
26
|
+
| :--- | :--- |
|
|
27
|
+
| `alHacerClickFuera` | Callback ejecutado al detectar clic fuera. |
|
|
28
|
+
|
|
29
|
+
### `<CodeplexPortal />`
|
|
30
|
+
Renderiza hijos en un nodo DOM diferente (react portals).
|
|
31
|
+
|
|
32
|
+
| Propiedad | Descripción |
|
|
33
|
+
| :--- | :--- |
|
|
34
|
+
| `containerId` | ID del elemento DOM destino. |
|
|
35
|
+
| `container` | Referencia directa al nodo DOM (opcional). |
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 🪟 Ventanas y Capas
|
|
40
|
+
|
|
41
|
+
### `<CodeplexModal />`
|
|
42
|
+
Wrapper simplificado para Modales.
|
|
43
|
+
| Propiedad | Descripción |
|
|
44
|
+
| :--- | :--- |
|
|
45
|
+
| `titulo` | Título pre-estilizado en la cabecera. |
|
|
46
|
+
| `descripcion` | Texto descriptivo (`aria-describedby`). |
|
|
47
|
+
| `ancho` | Ancho del modal (default: 400). |
|
|
48
|
+
| `mostrarIconoCierre` | `boolean`. Botón "X" en la esquina. |
|
|
49
|
+
|
|
50
|
+
### `<CodeplexPopover />`
|
|
51
|
+
Popups anclados a elementos.
|
|
52
|
+
| Propiedad | Descripción |
|
|
53
|
+
| :--- | :--- |
|
|
54
|
+
| `title` | Título del popover. |
|
|
55
|
+
| `showCloseIcon` | Muestra botón de cierre. |
|
|
56
|
+
| `anchorEl` | Elemento al que se ancla. |
|
|
57
|
+
|
|
58
|
+
### `<CodeplexPopper />`
|
|
59
|
+
Posicionamiento avanzado (base de Tooltips/Popovers) usando Popper.js.
|
|
60
|
+
| Propiedad | Descripción |
|
|
61
|
+
| :--- | :--- |
|
|
62
|
+
| `withPaper` | `boolean`. Envuelve el contenido en un Paper elevado. |
|
|
63
|
+
| `closeOnClickAway` | `boolean`. Cierra al hacer clic fuera. |
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 📝 Entradas Especiales
|
|
68
|
+
|
|
69
|
+
### `<CodeplexTextareaAutosize />`
|
|
70
|
+
Textarea que crece con el contenido pero mantiene el estilo visual de los Inputs de Material UI.
|
|
71
|
+
| Propiedad | Descripción |
|
|
72
|
+
| :--- | :--- |
|
|
73
|
+
| `variant` | `'outlined' \| 'filled' \| 'standard'`. |
|
|
74
|
+
| `minRows` | Filas mínimas iniciales. |
|
|
75
|
+
| `error` | Estado visual de error (borde rojo). |
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## 🎞️ Transiciones
|
|
80
|
+
|
|
81
|
+
Wrappers con timeouts por defecto suavizados para animaciones consistentes. Use las props estándar de MUI como `in`, `mountOnEnter`, `unmountOnExit`.
|
|
82
|
+
|
|
83
|
+
* `CodeplexColapso` (Collapse)
|
|
84
|
+
* `CodeplexDesvanecimiento` (Fade)
|
|
85
|
+
* `CodeplexCrecimiento` (Grow)
|
|
86
|
+
* `CodeplexZoom`
|
|
87
|
+
* `CodeplexDeslizamiento` (Slide) - Prop extra: `direction` ('up', 'down', 'left', 'right').
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
<CodeplexDesvanecimiento in={visible}>
|
|
91
|
+
<div>Contenido animado</div>
|
|
92
|
+
</CodeplexDesvanecimiento>
|
|
93
|
+
```
|