flysoft-react-ui 1.3.1 → 1.3.3
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/AI_CONTEXT.md +1575 -1533
- package/AI_INTEGRATION_GUIDE.md +359 -358
- package/README.md +45 -0
- package/dist/components/layout/AppLayout.d.ts +8 -0
- package/dist/components/layout/AppLayout.d.ts.map +1 -1
- package/dist/contexts/AppLayoutContext.d.ts +4 -0
- package/dist/contexts/AppLayoutContext.d.ts.map +1 -1
- package/dist/contexts/LeftDrawerContext.d.ts +44 -0
- package/dist/contexts/LeftDrawerContext.d.ts.map +1 -0
- package/dist/contexts/index.d.ts +3 -1
- package/dist/contexts/index.d.ts.map +1 -1
- package/dist/index.js +3244 -3182
- package/dist/index.js.map +1 -1
- package/dist/services/apiClient.d.ts +9 -0
- package/dist/services/apiClient.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -211,6 +211,51 @@ function MyComponent() {
|
|
|
211
211
|
}
|
|
212
212
|
```
|
|
213
213
|
|
|
214
|
+
## Control del Drawer Izquierdo (AppLayout)
|
|
215
|
+
|
|
216
|
+
En resoluciones grandes el drawer izquierdo del `AppLayout` está siempre visible;
|
|
217
|
+
en móvil/tablet se abre desde el botón de hamburguesa como panel flotante con
|
|
218
|
+
overlay. Cualquier componente renderizado dentro del `AppLayout` (contenido del
|
|
219
|
+
drawer, nodos del navbar, footer o `children`) puede controlarlo con
|
|
220
|
+
`useLeftDrawer()`:
|
|
221
|
+
|
|
222
|
+
```tsx
|
|
223
|
+
import { useLeftDrawer, LinkButton } from "flysoft-react-ui";
|
|
224
|
+
|
|
225
|
+
function AppMenu() {
|
|
226
|
+
const { closeLeftDrawer } = useLeftDrawer();
|
|
227
|
+
|
|
228
|
+
// Al tocar un link se cierra el panel en móvil.
|
|
229
|
+
// En desktop no produce ningún cambio: el drawer siempre está visible.
|
|
230
|
+
return (
|
|
231
|
+
<nav>
|
|
232
|
+
<LinkButton to="/inicio" onClick={closeLeftDrawer}>
|
|
233
|
+
Inicio
|
|
234
|
+
</LinkButton>
|
|
235
|
+
<LinkButton to="/clientes" onClick={closeLeftDrawer}>
|
|
236
|
+
Clientes
|
|
237
|
+
</LinkButton>
|
|
238
|
+
</nav>
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
El hook devuelve:
|
|
244
|
+
|
|
245
|
+
| Propiedad | Tipo | Descripción |
|
|
246
|
+
| --------- | ---- | ----------- |
|
|
247
|
+
| `isLeftDrawerOpen` | `boolean` | Si el drawer móvil está abierto |
|
|
248
|
+
| `isLeftDrawerCollapsible` | `boolean` | `true` en móvil/tablet con contenido en el drawer |
|
|
249
|
+
| `openLeftDrawer` | `() => void` | Abre el drawer |
|
|
250
|
+
| `closeLeftDrawer` | `() => void` | Cierra el drawer |
|
|
251
|
+
| `toggleLeftDrawer` | `() => void` | Alterna el estado |
|
|
252
|
+
|
|
253
|
+
Los mismos comandos están disponibles desde `useAppLayout()` cuando se usa
|
|
254
|
+
`AppLayoutProvider`. Para componentes que también se renderizan fuera del
|
|
255
|
+
`AppLayout`, `useOptionalLeftDrawer()` devuelve `undefined` en lugar de lanzar
|
|
256
|
+
error. Si preferís manejar el estado por tu cuenta, `AppLayout` acepta las props
|
|
257
|
+
controladas `isLeftDrawerOpen` y `onLeftDrawerOpenChange`.
|
|
258
|
+
|
|
214
259
|
### Variables CSS Disponibles
|
|
215
260
|
|
|
216
261
|
El sistema proporciona variables CSS con prefijo `--flysoft-`:
|
|
@@ -6,6 +6,14 @@ export interface AppLayoutProps {
|
|
|
6
6
|
contentFooter?: React.ReactNode;
|
|
7
7
|
children: React.ReactNode;
|
|
8
8
|
className?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Estado controlado del drawer móvil. Si se define, el AppLayout deja de
|
|
11
|
+
* manejar el estado internamente y hay que actualizarlo desde
|
|
12
|
+
* `onLeftDrawerOpenChange`.
|
|
13
|
+
*/
|
|
14
|
+
isLeftDrawerOpen?: boolean;
|
|
15
|
+
/** Se dispara cada vez que el drawer móvil debe abrirse o cerrarse */
|
|
16
|
+
onLeftDrawerOpenChange?: (isOpen: boolean) => void;
|
|
9
17
|
}
|
|
10
18
|
export declare const AppLayout: React.FC<AppLayoutProps>;
|
|
11
19
|
//# sourceMappingURL=AppLayout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppLayout.d.ts","sourceRoot":"","sources":["../../../src/components/layout/AppLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"AppLayout.d.ts","sourceRoot":"","sources":["../../../src/components/layout/AppLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAItE,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AAMzC,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,sEAAsE;IACtE,sBAAsB,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CACpD;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAsiB9C,CAAC"}
|
|
@@ -25,6 +25,10 @@ export interface AppLayoutContextType extends ThemeContextType {
|
|
|
25
25
|
setClassName: (className: string) => void;
|
|
26
26
|
setNavBarLeftNode: (node: string | ReactNode | undefined) => void;
|
|
27
27
|
setNavbarRightNode: (node: string | ReactNode | undefined) => void;
|
|
28
|
+
isLeftDrawerOpen: boolean;
|
|
29
|
+
openLeftDrawer: () => void;
|
|
30
|
+
closeLeftDrawer: () => void;
|
|
31
|
+
toggleLeftDrawer: () => void;
|
|
28
32
|
}
|
|
29
33
|
interface AppLayoutProviderProps {
|
|
30
34
|
children: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppLayoutContext.d.ts","sourceRoot":"","sources":["../../src/contexts/AppLayoutContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAIZ,KAAK,SAAS,EAEd,KAAK,QAAQ,EACb,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAKhE,MAAM,WAAW,eAAe;IAC9B,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,eAAe,EAAE,OAAO,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAE5D,MAAM,EAAE,eAAe,GAAG,SAAS,CAAC;IACpC,UAAU,EAAE,mBAAmB,GAAG,SAAS,CAAC;IAC5C,aAAa,EAAE,SAAS,GAAG,SAAS,CAAC;IACrC,SAAS,EAAE,MAAM,CAAC;IAGlB,SAAS,EAAE,QAAQ,CAAC,cAAc,CAAC,eAAe,GAAG,SAAS,CAAC,CAAC,CAAC;IACjE,aAAa,EAAE,QAAQ,CAAC,cAAc,CAAC,mBAAmB,GAAG,SAAS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sB,CAqC9D,CAAC;AAIF,eAAO,MAAM,YAAY,QAAO,oBAM/B,CAAC;AAIF,eAAO,MAAM,mBAAmB,eAG/B,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Comandos para controlar el drawer izquierdo del AppLayout.
|
|
3
|
+
*
|
|
4
|
+
* En resoluciones grandes el drawer está siempre visible, por lo que
|
|
5
|
+
* `closeLeftDrawer()` no produce ningún cambio visual. En móvil/tablet el
|
|
6
|
+
* drawer se muestra como panel flotante con overlay y estos comandos lo
|
|
7
|
+
* abren o cierran.
|
|
8
|
+
*/
|
|
9
|
+
export interface LeftDrawerContextType {
|
|
10
|
+
/** Indica si el drawer móvil está abierto */
|
|
11
|
+
isLeftDrawerOpen: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Indica si el drawer se está mostrando como panel colapsable con overlay
|
|
14
|
+
* (móvil/tablet con contenido en el drawer). En desktop es `false`.
|
|
15
|
+
*/
|
|
16
|
+
isLeftDrawerCollapsible: boolean;
|
|
17
|
+
/** Abre el drawer */
|
|
18
|
+
openLeftDrawer: () => void;
|
|
19
|
+
/** Cierra el drawer */
|
|
20
|
+
closeLeftDrawer: () => void;
|
|
21
|
+
/** Alterna el estado del drawer */
|
|
22
|
+
toggleLeftDrawer: () => void;
|
|
23
|
+
}
|
|
24
|
+
export declare const LeftDrawerContext: import("react").Context<LeftDrawerContextType | undefined>;
|
|
25
|
+
/**
|
|
26
|
+
* Hook para controlar el drawer izquierdo desde cualquier componente
|
|
27
|
+
* renderizado dentro de `AppLayout` (contenido del drawer, navbar, footer o
|
|
28
|
+
* children).
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* const { closeLeftDrawer } = useLeftDrawer();
|
|
33
|
+
*
|
|
34
|
+
* <LinkButton to="/inicio" onClick={closeLeftDrawer}>Inicio</LinkButton>
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare const useLeftDrawer: () => LeftDrawerContextType;
|
|
38
|
+
/**
|
|
39
|
+
* Igual que `useLeftDrawer` pero devuelve `undefined` en lugar de lanzar error
|
|
40
|
+
* cuando el componente se usa fuera de un `AppLayout`. Útil para componentes
|
|
41
|
+
* reutilizables que pueden renderizarse dentro o fuera del layout.
|
|
42
|
+
*/
|
|
43
|
+
export declare const useOptionalLeftDrawer: () => LeftDrawerContextType | undefined;
|
|
44
|
+
//# sourceMappingURL=LeftDrawerContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LeftDrawerContext.d.ts","sourceRoot":"","sources":["../../src/contexts/LeftDrawerContext.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAqB;IACpC,6CAA6C;IAC7C,gBAAgB,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,uBAAuB,EAAE,OAAO,CAAC;IACjC,qBAAqB;IACrB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,uBAAuB;IACvB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,mCAAmC;IACnC,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED,eAAO,MAAM,iBAAiB,4DAElB,CAAC;AAEb;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,QAAO,qBAMhC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,QAAO,qBAAqB,GAAG,SAClC,CAAC"}
|
package/dist/contexts/index.d.ts
CHANGED
|
@@ -6,8 +6,10 @@ export { AuthProvider, AuthContext } from "./AuthContext";
|
|
|
6
6
|
export type { AuthContextType, AuthContextUserInterface, AuthTokenInterface, } from "./AuthContext";
|
|
7
7
|
export { CrudProvider, CrudContext, useCrud } from "./CrudContext";
|
|
8
8
|
export type { CrudContextType } from "./CrudContext";
|
|
9
|
-
export { AppLayoutProvider, useAppLayout, useAppLayoutContext } from "./AppLayoutContext";
|
|
9
|
+
export { AppLayoutProvider, useAppLayout, useAppLayoutContext, } from "./AppLayoutContext";
|
|
10
10
|
export type { AppLayoutContextType, NavbarInterface, LeftDrawerInterface, } from "./AppLayoutContext";
|
|
11
|
+
export { LeftDrawerContext, useLeftDrawer, useOptionalLeftDrawer, } from "./LeftDrawerContext";
|
|
12
|
+
export type { LeftDrawerContextType } from "./LeftDrawerContext";
|
|
11
13
|
export { SnackbarProvider, useSnackbar, useSnackbarState, } from "./SnackbarContext";
|
|
12
14
|
export type { SnackbarContextType, SnackbarActionsType, SnackbarMessage, SnackbarVariant, } from "./SnackbarContext";
|
|
13
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contexts/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EACL,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,2BAA2B,CAAC;AAGnC,YAAY,EACV,KAAK,EACL,gBAAgB,EAChB,aAAa,EACb,OAAO,EACP,aAAa,GACd,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,UAAU,EACV,SAAS,EACT,SAAS,EACT,UAAU,EACV,YAAY,EACZ,MAAM,EACN,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,cAAc,GACf,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC1D,YAAY,EACV,eAAe,EACf,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACnE,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGrD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contexts/index.ts"],"names":[],"mappings":"AAC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