@acvl/frontend-components 0.0.66 → 0.0.68

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/dist/index.d.ts CHANGED
@@ -1,14 +1,14 @@
1
1
  import * as _mui_material from '@mui/material';
2
2
  import { ButtonProps, ButtonGroupProps, IconButtonProps, MenuItemProps, AlertProps, BoxProps, AutocompleteProps, SliderProps, SwitchProps, GridProps, DrawerProps, SxProps, Theme, StackProps, TypographyProps, MenuProps, PaletteColorOptions, TextFieldProps as TextFieldProps$1, InputBaseProps, DialogProps, DialogContentProps } from '@mui/material';
3
3
  import * as React from 'react';
4
- import React__default, { ReactNode, Dispatch, SetStateAction, JSX, RefObject, FC, BaseSyntheticEvent, JSXElementConstructor, ElementType } from 'react';
4
+ import React__default, { ReactNode, Dispatch, SetStateAction, JSX, RefObject, ReactElement, FC, BaseSyntheticEvent, JSXElementConstructor, ElementType } from 'react';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { GridRowId, GridRowSelectionModel, GridSortModel, GridFilterModel, GridRowModesModel, GridRenderEditCellParams, GridToolbarProps, DataGridProps as DataGridProps$1, GridApi, GridPaginationModel, GridColumnVisibilityModel, useGridApiRef, GridColDef } from '@mui/x-data-grid';
7
7
  import { DataGridProps, GridBaseColDef } from '@mui/x-data-grid/internals';
8
8
  import { NavigateOptions } from 'react-router-dom';
9
9
  import * as zod_v4_core from 'zod/v4/core';
10
10
  import * as zod from 'zod';
11
- import { coerce } from 'zod';
11
+ import { coerce, z } from 'zod';
12
12
  import { NumericFormatProps } from 'react-number-format';
13
13
  import { TextFieldProps } from '@mui/material/TextField';
14
14
  export { default as dayjs } from 'dayjs';
@@ -16,11 +16,11 @@ import * as redux from 'redux';
16
16
  import * as _reduxjs_toolkit from '@reduxjs/toolkit';
17
17
  import * as _emotion_styled from '@emotion/styled';
18
18
  import * as _mui_system from '@mui/system';
19
+ import { Theme as Theme$1, CssVarsTheme, CSSObject } from '@mui/material/styles';
19
20
  import { DebouncedFunc } from 'lodash';
20
21
  import { UseFormReturn } from 'react-hook-form';
21
22
  import { Breadcrumb, PageHeaderProps, Navigation, Branding, Session, Authentication, DashboardHeaderProps } from '@toolpad/core';
22
23
  import { SidebarFooterProps } from '@toolpad/core/DashboardLayout';
23
- import { Theme as Theme$1, CSSObject } from '@mui/material/styles';
24
24
 
25
25
  interface NormalOrIconProps {
26
26
  buttonProps: ButtonProps;
@@ -396,6 +396,14 @@ declare const ExportCSV: React__default.FC<ExportCSVButtonProps>;
396
396
 
397
397
  declare const CustomNoRows: () => react_jsx_runtime.JSX.Element;
398
398
 
399
+ interface BaseControlledFieldProps {
400
+ name: string;
401
+ label?: string;
402
+ control: any;
403
+ }
404
+
405
+ declare const TrueFalse: React__default.FC<BaseControlledFieldProps>;
406
+
399
407
  interface ExtraActions {
400
408
  label: string;
401
409
  onClick: (rowSelectionModel: GridRowSelectionModel) => void;
@@ -445,12 +453,6 @@ interface ActiveIconProps {
445
453
  }
446
454
  declare const ActiveIcon: React__default.FC<ActiveIconProps>;
447
455
 
448
- interface BaseControlledFieldProps {
449
- name: string;
450
- label?: string;
451
- control: any;
452
- }
453
-
454
456
  interface ControlledDateProps extends BaseControlledFieldProps {
455
457
  fieldProps?: any;
456
458
  extraProps: {
@@ -626,6 +628,11 @@ interface FieldProps$1 {
626
628
  detail_name?: string;
627
629
  label: string;
628
630
  type: any;
631
+ /**
632
+ * Sus breakpoints resuelven contra el viewport. La v1 solo se renderiza a página completa,
633
+ * así que alcanza; si algún día gana un shell angosto, ver
634
+ * `@v2/layout/pages/DetailPage/formLayout` para resolverlos contra el contenedor.
635
+ */
629
636
  gridProps?: GridProps;
630
637
  fieldProps?: object;
631
638
  extraProps?: any;
@@ -665,6 +672,28 @@ interface MainDrawerV2Props {
665
672
  width?: number | string;
666
673
  /** Lado desde el que entra el panel. Por defecto `"right"`. */
667
674
  anchor?: DrawerProps["anchor"];
675
+ /**
676
+ * `"temporary"` (por defecto) flota sobre la página con backdrop, y se cierra con
677
+ * Escape o al hacer clic fuera.
678
+ *
679
+ * `"docked"` se queda acoplado en el flujo: no hay backdrop ni modal, y el panel
680
+ * ocupa su propio hueco encogiendo a lo que tenga al lado, de modo que se puede
681
+ * seguir trabajando en la página con el panel abierto.
682
+ *
683
+ * Se pinta en el hueco que reserva `MainLayout` —al costado de la pantalla— sin
684
+ * importar desde dónde se declare: viaja hasta ahí por portal (ver
685
+ * `SidePanelHostContext`), así que una grilla enterrada en el contenido abre un panel
686
+ * de pantalla completa igual que el `sidePanel` del layout. Sin `MainLayout` arriba se
687
+ * queda donde esté declarado.
688
+ *
689
+ * El hueco es uno solo y se turnan: abrir un panel encoge al que estuviera puesto, y
690
+ * cerrarlo le devuelve el turno. Nunca se reparten el ancho entre varios.
691
+ *
692
+ * En acoplado el ancho se anima al abrir y cerrar, y `anchor` sólo decide de qué
693
+ * lado va el tirador de arrastre: la posición la fija el contenedor. `slotProps.drawer`
694
+ * y `slotProps.paper` no aplican —no hay `Drawer` ni `Paper` que configurar.
695
+ */
696
+ variant?: "temporary" | "docked";
668
697
  /**
669
698
  * Añade un tirador en el borde interior del panel para arrastrar su tamaño. Mientras el
670
699
  * usuario no lo arrastre, `width` manda; en cuanto lo hace, el tamaño arrastrado la pisa
@@ -674,7 +703,10 @@ interface MainDrawerV2Props {
674
703
  resizable?: boolean;
675
704
  /** Tamaño mínimo en px al que se puede arrastrar. Por defecto `320`. */
676
705
  minWidth?: number;
677
- /** Tamaño máximo en px. Por defecto, el viewport menos un margen para el backdrop. */
706
+ /**
707
+ * Tamaño máximo en px. Por defecto, el viewport menos un margen: lo justo para dejar
708
+ * backdrop que clicar en el flotante, y un hueco de trabajo de verdad en el acoplado.
709
+ */
678
710
  maxWidth?: number;
679
711
  /**
680
712
  * Recuerda el tamaño arrastrado bajo esta clave en `localStorage`, de modo que sobreviva a
@@ -696,7 +728,7 @@ interface MainDrawerV2Props {
696
728
  hideCloseButton?: boolean;
697
729
  /** Quita el padding interno del panel de contenido, para contenido a sangre. */
698
730
  disableGutters?: boolean;
699
- /** Color de fondo del panel de contenido. Por defecto `#f7f7f7`. */
731
+ /** Color de fondo del panel de contenido. Por defecto el fondo del tema. */
700
732
  pageBackgroundColor?: string;
701
733
  /** Color del contorno: encabezado, pie y el marco alrededor del contenido. */
702
734
  chromeBackgroundColor?: string;
@@ -743,8 +775,52 @@ interface MainDrawerV2Props {
743
775
  * Con `resizable`, el borde interior lleva un tirador: se arrastra con el puntero, se ajusta
744
776
  * con las flechas cuando tiene el foco y vuelve a `width` con doble clic. Con
745
777
  * `widthStorageKey`, además, el tamaño se recuerda entre visitas.
778
+ *
779
+ * Con `variant="docked"` el mismo panel se acopla en el flujo en vez de flotar: sin backdrop,
780
+ * encogiendo a lo que tenga al lado en lugar de taparlo, de modo que la página de atrás sigue
781
+ * usable con el panel abierto. Ver el `sidePanel` de `MainLayout`.
746
782
  */
747
- declare function MainDrawer$1({ open, onClose, title, subtitle, children, width, anchor, resizable, minWidth, maxWidth, widthStorageKey, onWidthChange, disableBackdropClose, hideCloseButton, disableGutters, pageBackgroundColor, chromeBackgroundColor, contentGap, contentBorderRadius, slots, slotProps, }: MainDrawerV2Props): react_jsx_runtime.JSX.Element;
783
+ declare function MainDrawer$1({ open, onClose, title, subtitle, children, width, anchor, variant, resizable, minWidth, maxWidth, widthStorageKey, onWidthChange, disableBackdropClose, hideCloseButton, disableGutters, pageBackgroundColor, chromeBackgroundColor, contentGap, contentBorderRadius, slots, slotProps, }: MainDrawerV2Props): react_jsx_runtime.JSX.Element;
784
+
785
+ interface SidePanelHost {
786
+ /**
787
+ * El nodo donde `MainLayout` reserva sitio para los paneles acoplados, o `null` si no
788
+ * hay a dónde viajar —porque ya se está dentro del hueco, que es el caso de lo que se
789
+ * pasa por `sidePanel`—.
790
+ */
791
+ element: HTMLElement | null;
792
+ /**
793
+ * Anuncia si este panel está abierto. Sólo se muestra uno a la vez, y el último en
794
+ * anunciarse es el que manda: hay un único hueco y repartirlo entre varios los deja a
795
+ * todos angostos, además de empujar la página fuera de la pantalla.
796
+ *
797
+ * La identidad la pone el propio panel (un `useId`). Hay que soltar el turno al
798
+ * desmontar, o el hueco se queda esperando a un panel que ya no existe.
799
+ */
800
+ registrar: (id: string, abierto: boolean) => void;
801
+ /**
802
+ * Los paneles abiertos, en el orden en que pidieron el hueco. El último lo tiene; los
803
+ * demás esperan encogidos su turno.
804
+ *
805
+ * Es la pila entera y no sólo el de encima porque un panel también necesita saber si
806
+ * hay algo debajo: es lo que convierte su botón de cerrar en un "volver".
807
+ */
808
+ pila: string[];
809
+ }
810
+ /**
811
+ * Cómo llega un panel acoplado al costado de la pantalla, y cómo se turnan entre ellos.
812
+ *
813
+ * Un panel acoplado tiene que salir al costado, y quien lo abre casi nunca está ahí: una
814
+ * grilla vive dentro del contenido, varios niveles abajo. Dejarlo donde se declara lo
815
+ * pintaría dentro de la página, que es justo lo que no se quiere; así que un
816
+ * `MainDrawer_v2` con `variant="docked"` se teletransporta (portal) hasta `element`.
817
+ *
818
+ * Fuera de un `MainLayout` el contexto es `null`: el panel se pinta donde esté declarado y
819
+ * no se turna con nadie.
820
+ */
821
+ declare const SidePanelHostContext: React.Context<SidePanelHost | null>;
822
+ /** El hueco de paneles acoplados del layout, o `null` si no hay ninguno arriba. */
823
+ declare const useSidePanelHost: () => SidePanelHost | null;
748
824
 
749
825
  declare module "@mui/x-data-grid" {
750
826
  interface ToolbarPropsOverrides {
@@ -763,6 +839,14 @@ interface ArrayFieldProps {
763
839
  pageType?: PageType;
764
840
  parser?: JSONParserProps;
765
841
  fields: FieldProps$1[];
842
+ /**
843
+ * What the edit panel's fields resolve their `size` breakpoints against. Defaults to
844
+ * `"container"`: that panel is a drawer, narrow by construction. It needs its own setting
845
+ * because `MainDrawer_v2` portals to `document.body`, so the panel is not a DOM descendant
846
+ * of the surrounding form and cannot inherit its container.
847
+ * @see DetailFormProps.responsiveTo
848
+ */
849
+ responsiveTo?: "viewport" | "container";
766
850
  slotProps?: {
767
851
  /**
768
852
  * Se aplica sobre el panel de edición. `open` y `onClose` los gobierna este
@@ -868,8 +952,22 @@ declare const LoadingComponent: React__default.FC<LoadingComponentProps>;
868
952
 
869
953
  /**
870
954
  * Muestra el logo de la empresa
955
+ *
956
+ * El archivo de marca es un JPG con fondo blanco, bola roja y letras negras: tal
957
+ * cual, en modo oscuro se ve un recuadro blanco. Como no hay versión clara del
958
+ * archivo, en oscuro se recolorea por CSS a blanco sobre transparente.
871
959
  **/
872
- declare const Logo: () => react_jsx_runtime.JSX.Element;
960
+ interface LogoProps {
961
+ /** Altura máxima en px. */
962
+ maxHeight?: number;
963
+ /**
964
+ * Logo alternativo para modo oscuro. Lo suyo es un SVG o PNG blanco con fondo
965
+ * transparente: en cuanto exista, pasarlo aquí sustituye el recoloreado por
966
+ * el archivo de verdad sin tocar nada más.
967
+ */
968
+ darkSrc?: string;
969
+ }
970
+ declare const Logo: ({ maxHeight, darkSrc }?: LogoProps) => react_jsx_runtime.JSX.Element;
873
971
 
874
972
  interface MyTab {
875
973
  value: string;
@@ -1105,9 +1203,30 @@ interface _HistorialDrawerProps {
1105
1203
  open: boolean;
1106
1204
  handleDrawer: () => void;
1107
1205
  endpoint?: string;
1206
+ /**
1207
+ * Cómo se coloca el panel. Por defecto `"docked"`: se acopla al costado de la pantalla y
1208
+ * encoge la página en vez de taparla, que es lo que pide el historial —se abre justo para
1209
+ * cotejar lo que dice contra el registro que se está mirando, y con el panel encima había
1210
+ * que cerrarlo entre campo y campo—.
1211
+ *
1212
+ * `"temporary"` lo devuelve a flotar sobre la página, con backdrop y modal. Hace falta
1213
+ * donde no haya un `MainLayout_v2` arriba que le reserve el hueco: sin él, el acoplado se
1214
+ * pinta donde esté declarado, o sea dentro de la propia página.
1215
+ */
1216
+ variant?: MainDrawerV2Props["variant"];
1217
+ /** Ancho del panel en px. Por defecto el de `MainDrawer_v2` (600). */
1218
+ width?: number | string;
1219
+ /**
1220
+ * Permite arrastrar el borde interior para cambiar el ancho. Activo por defecto: acoplado,
1221
+ * el panel le quita sitio a la página, así que cuánto se lleva tiene que poder decidirlo
1222
+ * quien lo está usando. El ancho arrastrado se recuerda entre visitas.
1223
+ */
1224
+ resizable?: boolean;
1225
+ /** Dónde se recuerda el ancho arrastrado. Cadena vacía para no recordarlo. */
1226
+ widthStorageKey?: string;
1108
1227
  }
1109
1228
 
1110
- interface HistorialDrawerProps extends Pick<_HistorialDrawerProps, "endpoint"> {
1229
+ interface HistorialDrawerProps extends Pick<_HistorialDrawerProps, "endpoint" | "variant" | "width"> {
1111
1230
  iconButtonProps?: IconButtonProps;
1112
1231
  }
1113
1232
  declare const HistorialDrawer: React__default.FC<HistorialDrawerProps>;
@@ -1115,6 +1234,10 @@ declare const HistorialDrawer: React__default.FC<HistorialDrawerProps>;
1115
1234
  /**
1116
1235
  * Personaliza la temática de la página
1117
1236
  * Declara colores, tipo de letra, etc
1237
+ *
1238
+ * El tema publica dos esquemas de color (claro y oscuro) como variables CSS, así
1239
+ * que cambiar de modo no reconstruye el tema: solo cambia el atributo del `<html>`
1240
+ * y el navegador resuelve las variables. Ver `useColorMode` para el interruptor.
1118
1241
  **/
1119
1242
  declare module '@mui/material/styles' {
1120
1243
  interface PaletteColor {
@@ -1150,7 +1273,24 @@ declare module '@mui/material/styles' {
1150
1273
  largeAvatar?: any;
1151
1274
  }
1152
1275
  }
1153
- declare const theme: () => _mui_material.Theme;
1276
+ /**
1277
+ * Atributo que MUI escribe en `<html>` con el esquema activo (`light`/`dark`).
1278
+ *
1279
+ * Hace falta declararlo: con dos esquemas y sin selector, MUI usa `media`, es
1280
+ * decir el tema sigue a la preferencia del sistema operativo y el interruptor no
1281
+ * puede cambiarlo. Con un atributo manda el usuario.
1282
+ */
1283
+ declare const COLOR_SCHEME_SELECTOR = "data-color-scheme";
1284
+ /**
1285
+ * El tema de la librería, con lo que aporta trabajar por variables CSS: `vars`
1286
+ * (los colores como `var(--mui-…)`, que siguen al esquema activo) y
1287
+ * `colorSchemes`.
1288
+ *
1289
+ * Hace falta nombrarlo porque `responsiveFontSizes` declara devolver `Theme` a
1290
+ * secas: el objeto que sale sí trae las dos cosas, pero la firma las esconde.
1291
+ */
1292
+ type AppTheme = Theme$1 & CssVarsTheme;
1293
+ declare const theme: () => AppTheme;
1154
1294
 
1155
1295
  interface KpiCardProps {
1156
1296
  icon: ReactNode;
@@ -1198,6 +1338,42 @@ interface PollingCountdownChipProps {
1198
1338
  * fetch reinicia el conteo; opcionalmente refresca al hacer clic. */
1199
1339
  declare function PollingCountdownChip({ pollingInterval, isFetching, onRefresh, }: PollingCountdownChipProps): react_jsx_runtime.JSX.Element;
1200
1340
 
1341
+ interface FilterInput {
1342
+ /** The column this input filters on — used only as a React key. */
1343
+ field: string;
1344
+ /**
1345
+ * The query keys this input writes. Usually one, but a range input owns two
1346
+ * (`_min`/`_max`, `_after`/`_before`), which is why this isn't just `field`.
1347
+ */
1348
+ keys: string[];
1349
+ label: string;
1350
+ type: string;
1351
+ element: ReactElement;
1352
+ }
1353
+ /**
1354
+ * A filter the page adds itself, for something no column represents — a scope toggle, a flag
1355
+ * the backend computes, anything whose value isn't a column's value.
1356
+ *
1357
+ * The element is read fresh on every render rather than captured with the schema, so an input
1358
+ * that closes over page state stays current.
1359
+ */
1360
+ interface CustomFilterDef {
1361
+ /**
1362
+ * The query key sent to the backend, and the form field name the element must bind to.
1363
+ *
1364
+ * Wins over a column that would generate the same key: the column's input is dropped from
1365
+ * the panel, so one key never gets two inputs writing to it.
1366
+ */
1367
+ field: string;
1368
+ label: string;
1369
+ /** Any controlled input. The panel clones `control` in, exactly as it does for columns. */
1370
+ element: ReactElement;
1371
+ /** Defaults to `z.any().optional()` — enough for a value the backend validates anyway. */
1372
+ schema?: z.ZodType<any, any>;
1373
+ /** What the panel resets to, and what "Limpiar" restores. Defaults to `""`. */
1374
+ defaultValue?: any;
1375
+ }
1376
+
1201
1377
  /**
1202
1378
  * What the grid hands its RTK lazy query — the corrected `GridArgs`.
1203
1379
  *
@@ -1314,6 +1490,16 @@ interface ServerGridProps {
1314
1490
  tab?: string;
1315
1491
  /** Scopes the filter panel's option lookups to the current detail record. */
1316
1492
  columnsFilter?: string;
1493
+ /**
1494
+ * Filters the page adds to the panel itself, for things no column represents — a
1495
+ * scope toggle, a flag the backend computes. They render above the column-derived
1496
+ * inputs and behave like any other filter from there on: counted by the badge,
1497
+ * cleared by "Limpiar", persisted, and sent as query args.
1498
+ *
1499
+ * Gate them at the call site — build the array only for the users who should see the
1500
+ * filter. The grid has no notion of who is looking at it.
1501
+ */
1502
+ customFilters?: CustomFilterDef[];
1317
1503
  /** Skip session persistence entirely. */
1318
1504
  dontSaveState?: boolean;
1319
1505
  /**
@@ -1730,6 +1916,12 @@ interface SubsectionProps {
1730
1916
  description?: string;
1731
1917
  first?: boolean;
1732
1918
  slotProps?: {
1919
+ /**
1920
+ * Grid raíz de la subsección. Su `size`/`offset` —por defecto `12`— resuelve igual que el
1921
+ * de un campo: contra el ancho del formulario cuando este corre en modo contenedor, así
1922
+ * que un `{ xs: 12, md: 6 }` parte el formulario en dos columnas cuando *el formulario*
1923
+ * es ancho, no cuando lo es la pantalla.
1924
+ */
1733
1925
  parentGrid?: Partial<GridProps>;
1734
1926
  };
1735
1927
  fields?: FieldProps[];
@@ -1825,6 +2017,225 @@ interface DetailFormController {
1825
2017
  */
1826
2018
  declare function useDetailForm(config: DetailFormConfig): DetailFormController;
1827
2019
 
2020
+ /**
2021
+ * Layout de campos relativo al **contenedor** en vez de al viewport.
2022
+ *
2023
+ * MUI resuelve los breakpoints de `size` contra media queries del viewport. Eso es correcto en
2024
+ * una página completa, pero el mismo formulario también se renderiza dentro de un drawer de
2025
+ * 460px o de un diálogo `maxWidth="sm"`: ahí la pantalla es ancha, gana el valor de `lg` y los
2026
+ * campos quedan apretados.
2027
+ *
2028
+ * Estas utilidades traducen el mismo objeto `size` a reglas `@container`, de modo que una sola
2029
+ * definición de secciones sirve para página, diálogo y drawer — y se re-acomoda en vivo al
2030
+ * arrastrar el borde del drawer, sin re-render.
2031
+ */
2032
+ type FormBreakpoint = "xs" | "sm" | "md" | "lg" | "xl";
2033
+ /**
2034
+ * `container-name` que declara todo formulario en modo contenedor. Es público a propósito: un
2035
+ * consumidor puede apuntarle desde su propio `sx` con la sintaxis corta de MUI —
2036
+ * `sx={{ p: { "@700/acvform": 3 } }}`. Usar siempre la forma **numérica**: `@md/acvform`
2037
+ * resolvería contra `theme.breakpoints.values` (900), no contra esta escalera (700).
2038
+ */
2039
+ declare const FORM_CONTAINER_NAME = "acvform";
2040
+ /**
2041
+ * Ancho del *formulario* (px) a partir del cual aplica cada clave. Escalera pensada para
2042
+ * paneles, no una copia de `theme.breakpoints.values`: esos son umbrales de viewport y un
2043
+ * formulario de 552px (un drawer de 600) caería en `xs`, o sea un campo por renglón — peor que
2044
+ * el problema que esto resuelve. Derivada de una columna útil de ~190–230px con gutter de 16px.
2045
+ */
2046
+ declare const DEFAULT_FORM_BREAKPOINTS: Record<FormBreakpoint, number>;
2047
+ interface FormGridSxOptions {
2048
+ /** @default FORM_CONTAINER_NAME */
2049
+ containerName?: string;
2050
+ /** Se mezcla encima de {@link DEFAULT_FORM_BREAKPOINTS}. */
2051
+ breakpoints?: Partial<Record<FormBreakpoint, number>>;
2052
+ }
2053
+ /**
2054
+ * Traduce el `size`/`offset` de un Grid a reglas `@container` que reproducen, contra el ancho
2055
+ * del formulario, exactamente lo que MUI deriva de ellos contra el viewport.
2056
+ *
2057
+ * **Todos** los escalones se emiten como container query —`xs` incluido, en `min-width:0px`—;
2058
+ * nunca hay regla base. Por eso un campo renderizado fuera de un contenedor de formulario no
2059
+ * empata con ninguna de estas reglas y conserva intacto el comportamiento por viewport de MUI:
2060
+ * ahí está toda la compatibilidad hacia atrás.
2061
+ *
2062
+ * El resultado va en `sx`, que se serializa *después* de los estilos propios del Grid y con la
2063
+ * misma especificidad, así que gana donde aplica.
2064
+ */
2065
+ declare const formGridSx: (size: GridProps["size"], offset?: GridProps["offset"], options?: FormGridSxOptions) => CSSObject | undefined;
2066
+ /**
2067
+ * Convierte un elemento en el contenedor contra el que resuelven los campos que contiene.
2068
+ *
2069
+ * `inline-size`, nunca `size`: el `Collapse` de `Subsection` anima midiendo `clientHeight`, y
2070
+ * contener el eje de bloque lo rompería.
2071
+ *
2072
+ * Se puede anidar reusando el mismo nombre: un elemento nunca resuelve sus propias
2073
+ * `@container` contra sí mismo, sino contra el contenedor ancestro más cercano. Así una
2074
+ * subsección con `size` responsivo mide contra el formulario mientras sus campos miden contra
2075
+ * ella.
2076
+ */
2077
+ declare const formContainerSx: (containerName?: string) => CSSObject;
2078
+
2079
+ interface DetailFormProps {
2080
+ /** Result of `useDetailForm`. */
2081
+ controller: DetailFormController;
2082
+ /**
2083
+ * `id` of the `<form>` element. External submit buttons (e.g. inside a dialog footer,
2084
+ * which live outside the form tree) submit via `<button form={formId} type="submit">`.
2085
+ * Defaults to `"formulario"` for parity with `SaveCancelButton`.
2086
+ */
2087
+ formId?: string;
2088
+ /** Persist-tab key for multi-section forms. Defaults to `formId`. */
2089
+ storageKey?: string;
2090
+ /** Height factor passed to the loading spinner. Defaults to `0.7`. */
2091
+ loadingHeight?: number;
2092
+ /**
2093
+ * What the `size` breakpoints inside the form resolve against — each field's, and each
2094
+ * subsection's own (`slotProps.parentGrid.size`).
2095
+ *
2096
+ * `"viewport"` is MUI's own behaviour. `"container"` resolves them against the width of
2097
+ * *this form*, so one section definition serves a full page, a `maxWidth="sm"` dialog and a
2098
+ * 460px drawer without a hand-picked size per shell — and re-flows live as the drawer is
2099
+ * dragged. Note that it makes the `<form>` a CSS containment context, so a `slotProps.form`
2100
+ * that overrides `width` with a content-dependent value would no longer resolve. A
2101
+ * subsection that asks for a width of its own becomes, in turn, the container its own fields
2102
+ * resolve against.
2103
+ * @default "viewport"
2104
+ */
2105
+ responsiveTo?: "viewport" | "container";
2106
+ /**
2107
+ * Form widths (px) at which each breakpoint key starts applying. Shallow-merged over
2108
+ * {@link DEFAULT_FORM_BREAKPOINTS}; only read in `"container"` mode.
2109
+ */
2110
+ containerBreakpoints?: Partial<Record<FormBreakpoint, number>>;
2111
+ slotProps?: {
2112
+ form?: Partial<BoxProps>;
2113
+ };
2114
+ }
2115
+ /**
2116
+ * Presentational, chrome-less body of a record form: the `FormProvider`, the `<form>`
2117
+ * element and the section/tab render tree — no page layout, no header buttons. Compose it
2118
+ * inside a page, dialog or drawer shell that supplies the surrounding chrome.
2119
+ */
2120
+ declare function DetailForm({ controller, formId, storageKey, loadingHeight, responsiveTo, containerBreakpoints, slotProps, }: DetailFormProps): react_jsx_runtime.JSX.Element;
2121
+
2122
+ interface DetailFormDrawerNavigation {
2123
+ /** Open the previous record of the list the drawer is walking. */
2124
+ onPrev: () => void;
2125
+ onNext: () => void;
2126
+ /** Whether a previous/next record exists. The arrows are disabled when it doesn't. */
2127
+ hasPrev: boolean;
2128
+ hasNext: boolean;
2129
+ /** 1-based position of the current record, shown between the arrows. */
2130
+ position?: number;
2131
+ /** Size of the list; shown as `position / count`. */
2132
+ count?: number;
2133
+ /** Blocks both arrows for a caller-side reason (e.g. while the next batch loads). */
2134
+ disabled?: boolean;
2135
+ }
2136
+ interface DetailFormDrawerProps {
2137
+ open: boolean;
2138
+ /** Close the drawer. Also invoked after a successful save and on cancel. */
2139
+ onClose: () => void;
2140
+ title?: ReactNode;
2141
+ api: DetailFormApi;
2142
+ form: DetailFormConfig["form"];
2143
+ sections: DetailFormConfig["sections"];
2144
+ /** Defaults to `"create"`. */
2145
+ pageType?: PageType;
2146
+ /**
2147
+ * Open a `"detail"` drawer straight in edit mode, as if the user had hit the Editar
2148
+ * button. Ignored for the other page types, and for records the user may not edit.
2149
+ */
2150
+ startInEdit?: boolean;
2151
+ /**
2152
+ * Identity of the record on show. Swapping it (as the navigator does, without remounting
2153
+ * the drawer) re-derives the per-record chrome — the in-place edit toggle drops back to
2154
+ * read-only and `startInEdit` is re-applied against the new record's own permissions.
2155
+ */
2156
+ recordKey?: string | number;
2157
+ permissionsPath?: string;
2158
+ /** Runs after a successful mutation, before the drawer closes. Receives the response. */
2159
+ onSuccess?: (response: any) => void;
2160
+ /**
2161
+ * Footer record navigator: prev/next arrows (Alt+↑ / Alt+↓) that step through a list of
2162
+ * sibling records — e.g. the rows of the grid the drawer was opened from — without
2163
+ * closing the drawer. Omit it and no navigator renders.
2164
+ */
2165
+ navigation?: DetailFormDrawerNavigation;
2166
+ /** Panel width. Defaults to `600`. */
2167
+ width?: number | string;
2168
+ /** Side the drawer slides in from. Defaults to `"right"`. */
2169
+ anchor?: DrawerProps["anchor"];
2170
+ /**
2171
+ * `"temporary"` (the default) floats over the page. `"docked"` takes its own space at
2172
+ * the side of the screen and shrinks the app instead of covering it, so the page behind
2173
+ * stays usable — see `MainDrawer_v2`.
2174
+ *
2175
+ * Docked drops the modal: nothing stops the user from touching the page while the form
2176
+ * is open, so a drawer that guards unsaved edits behind the backdrop no longer does.
2177
+ */
2178
+ variant?: MainDrawerV2Props["variant"];
2179
+ /**
2180
+ * Let the user drag the drawer's inner edge to resize it. Forwarded to `MainDrawer_v2`
2181
+ * along with the four props below — see it for the full behaviour.
2182
+ */
2183
+ resizable?: boolean;
2184
+ /** Smallest width the drag allows, in px. Defaults to `320`. */
2185
+ minWidth?: number;
2186
+ /** Largest width the drag allows, in px. Defaults to the viewport minus a margin. */
2187
+ maxWidth?: number;
2188
+ /**
2189
+ * Remember the dragged width under this `localStorage` key. Worth setting whenever the
2190
+ * drawer is remounted per record — a fresh mount otherwise forgets the drag.
2191
+ */
2192
+ widthStorageKey?: string;
2193
+ /** Fires with the final dragged width in px, or `null` when a double click resets it. */
2194
+ onWidthChange?: (width: number | null) => void;
2195
+ /**
2196
+ * What the `size` breakpoints of the fields — and of the subsections themselves — resolve
2197
+ * against. Defaults to `"container"`: a drawer is narrow by construction, so viewport
2198
+ * breakpoints would pick the wide-screen value and cram the fields — and they would not
2199
+ * react to a drag either.
2200
+ * @see DetailFormProps.responsiveTo
2201
+ */
2202
+ responsiveTo?: DetailFormProps["responsiveTo"];
2203
+ /** @see DetailFormProps.containerBreakpoints */
2204
+ containerBreakpoints?: DetailFormProps["containerBreakpoints"];
2205
+ labels?: {
2206
+ save?: string;
2207
+ cancel?: string;
2208
+ /**
2209
+ * Rótulo del guardar-y-seguir. Por defecto `"Guardar ↓"`, corto porque va junto al
2210
+ * Guardar de siempre y el tooltip ya dice qué hace; pásale un texto propio donde el
2211
+ * paso al siguiente registro merezca nombrarse ("Guardar y siguiente bulto").
2212
+ */
2213
+ saveAndNext?: string;
2214
+ };
2215
+ slots?: {
2216
+ /** Extra actions rendered in the header, left of the close button (e.g. "open full page"). */
2217
+ headerActions?: ReactNode;
2218
+ };
2219
+ slotProps?: {
2220
+ drawer?: Partial<DrawerProps>;
2221
+ saveButton?: Partial<ButtonProps>;
2222
+ cancelButton?: Partial<ButtonProps>;
2223
+ saveAndNextButton?: Partial<ButtonProps>;
2224
+ };
2225
+ }
2226
+ /**
2227
+ * A record form inside a side drawer. Reuses the same `useDetailForm` engine and
2228
+ * `DetailForm` body as `DetailPage_v2`, and `MainDrawer_v2` for the chrome — so it frames
2229
+ * the form exactly like every other v2 drawer. What it adds on top is the per-record
2230
+ * furniture: edit/delete in the header, and a footer holding the form actions and, when
2231
+ * `navigation` is given, a prev/next record navigator (Alt+↑ / Alt+↓) plus "Guardar ↓"
2232
+ * (Alt+Shift+↓) — a save that steps to the next record instead of closing, so a column can be
2233
+ * captured down a list in one pass without the hands leaving the keyboard. Rename it with
2234
+ * `labels.saveAndNext`. Guardar sits outside the `<form>` and submits via the native
2235
+ * `form={formId}` attribute; Guardar ↓ submits by hand, so the implicit Enter stays Guardar.
2236
+ */
2237
+ declare function DetailFormDrawer({ open, onClose, title, api, form, sections, pageType, startInEdit, recordKey, permissionsPath, onSuccess, navigation, width, anchor, variant, resizable, minWidth, maxWidth, widthStorageKey, onWidthChange, responsiveTo, containerBreakpoints, labels, slots, slotProps, }: DetailFormDrawerProps): react_jsx_runtime.JSX.Element;
2238
+
1828
2239
  interface DrawerGridDrawerConfig {
1829
2240
  /** Shared field layout, used by every mode. Same shape as `DetailPage_v2`'s `form`/`sections`. */
1830
2241
  form: DetailFormConfig["form"];
@@ -1832,6 +2243,21 @@ interface DrawerGridDrawerConfig {
1832
2243
  permissionsPath?: string;
1833
2244
  /** Panel width. Defaults to the drawer's own default (600). */
1834
2245
  width?: number | string;
2246
+ /**
2247
+ * How the panel sits on the screen. Defaults to `"temporary"`: it floats over the page,
2248
+ * modal, the way it always has.
2249
+ *
2250
+ * `"docked"` gives it its own space at the side and shrinks the app instead of covering
2251
+ * it, so the grid stays visible next to the record. Worth it where the row and the list
2252
+ * are read together; it costs two things, both from dropping the modal:
2253
+ *
2254
+ * - Nothing stops the user from re-sorting, filtering or paging the grid while the
2255
+ * drawer is open, and the footer navigator walks the rows it sampled when the record
2256
+ * opened. It stays on the list the user was reading, which is usually what's wanted,
2257
+ * but it can no longer claim to match what's on screen.
2258
+ * - Unsaved edits are no longer fenced off by the backdrop.
2259
+ */
2260
+ variant?: DetailFormDrawerProps["variant"];
1835
2261
  /**
1836
2262
  * Let the user drag the drawer's inner edge to resize it. The dragged width is remembered
1837
2263
  * across openings under a key derived from the grid's own storage key — override it with
@@ -1844,6 +2270,14 @@ interface DrawerGridDrawerConfig {
1844
2270
  maxWidth?: number;
1845
2271
  /** Where the dragged width is remembered. Defaults to the grid's storage key + `_DW`. */
1846
2272
  widthStorageKey?: string;
2273
+ /**
2274
+ * What the fields' `size` breakpoints resolve against. Defaults to `"container"` — the
2275
+ * width of the panel, not of the screen.
2276
+ * @see DetailFormDrawerProps.responsiveTo
2277
+ */
2278
+ responsiveTo?: DetailFormDrawerProps["responsiveTo"];
2279
+ /** @see DetailFormDrawerProps.containerBreakpoints */
2280
+ containerBreakpoints?: DetailFormDrawerProps["containerBreakpoints"];
1847
2281
  title?: {
1848
2282
  create?: ReactNode;
1849
2283
  record?: ReactNode | ((id: GridRowId) => ReactNode);
@@ -1927,8 +2361,13 @@ interface DrawerGridProps {
1927
2361
  }
1928
2362
  /**
1929
2363
  * A `ServerGrid_v2` whose rows and create button open a `DetailFormDrawer_v2` instead of
1930
- * navigating to a full page — without giving up the full-page routes. A row click and the
1931
- * create menu's "Manual" option both open the drawer; Ctrl/Cmd+click still opens the full
2364
+ * navigating to a full page — without giving up the full-page routes.
2365
+ *
2366
+ * The panel floats over the page by default. `drawer.variant: "docked"` gives it its own
2367
+ * space at the side instead, shrinking the app so the grid stays visible next to the
2368
+ * record; read that prop before switching, the two differ in more than looks.
2369
+ *
2370
+ * A row click and the create menu's "Manual" option both open the drawer; Ctrl/Cmd+click still opens the full
1932
2371
  * page in a new tab, Alt+click opens it in the same tab, and the record drawer carries an
1933
2372
  * "open full page" button — so the routes stay reachable either way. Grids whose rows have
1934
2373
  * no route of their own turn all three off with `drawer.showOpenFullPage: false`.
@@ -1978,11 +2417,45 @@ interface ConfirmDialogProps {
1978
2417
  * confirmar puede mostrar estado de carga mientras se resuelve la acción. */
1979
2418
  declare function ConfirmDialog({ open, titulo, mensaje, confirmLabel, cancelLabel, confirmColor, confirmIcon, isLoading, onConfirm, onClose, }: ConfirmDialogProps): react_jsx_runtime.JSX.Element;
1980
2419
 
2420
+ interface ActionsMenuProps {
2421
+ delete?: {
2422
+ mutation: any;
2423
+ disableNavBack?: boolean;
2424
+ };
2425
+ historial?: {
2426
+ endpoint?: string;
2427
+ /** Defaults to `"docked"` — the panel takes its own space beside the page. */
2428
+ variant?: _HistorialDrawerProps["variant"];
2429
+ /** Panel width in px. Defaults to 600. */
2430
+ width?: number | string;
2431
+ };
2432
+ extraButtons?: {
2433
+ title: string;
2434
+ icon: ReactNode;
2435
+ onClick: () => void;
2436
+ }[];
2437
+ }
2438
+
1981
2439
  interface DetailPageV2Props {
1982
2440
  api: DetailFormApi;
1983
2441
  form: DetailFormConfig["form"];
1984
2442
  sections: DetailFormConfig["sections"];
1985
2443
  pageType: PageType;
2444
+ /**
2445
+ * What the `size` breakpoints of the fields — and of the subsections themselves — resolve
2446
+ * against. Defaults to `"container"`: the width of the form, not of the screen.
2447
+ *
2448
+ * A full page is no longer the whole viewport minus the sidebar — a docked side panel
2449
+ * takes its share of it — so the screen stopped being a good proxy for how much room
2450
+ * the fields actually have. Against the form they re-flow as that room changes, with
2451
+ * no re-render: the breakpoint ladder is CSS.
2452
+ *
2453
+ * `"viewport"` restores MUI's own behaviour for a page that needs it.
2454
+ * @see DetailFormProps.responsiveTo
2455
+ */
2456
+ responsiveTo?: DetailFormProps["responsiveTo"];
2457
+ /** @see DetailFormProps.containerBreakpoints */
2458
+ containerBreakpoints?: DetailFormProps["containerBreakpoints"];
1986
2459
  slots?: {
1987
2460
  button?: ReactNode;
1988
2461
  extraButtons?: {
@@ -2003,9 +2476,12 @@ interface DetailPageV2Props {
2003
2476
  };
2004
2477
  cancel?: Partial<ButtonProps>;
2005
2478
  };
2006
- historial?: {
2007
- endpoint?: string;
2008
- };
2479
+ /**
2480
+ * The history panel opened from the actions menu. It docks beside the page rather
2481
+ * than floating over it, so the record stays readable next to what the history says
2482
+ * about it — see `ActionsMenuProps.historial` for how to change that.
2483
+ */
2484
+ historial?: ActionsMenuProps["historial"];
2009
2485
  permissionsPath?: string;
2010
2486
  deleteButton?: {
2011
2487
  disableNavBack?: boolean;
@@ -2014,30 +2490,6 @@ interface DetailPageV2Props {
2014
2490
  }
2015
2491
  declare function DetailPage(props: DetailPageV2Props): react_jsx_runtime.JSX.Element;
2016
2492
 
2017
- interface DetailFormProps {
2018
- /** Result of `useDetailForm`. */
2019
- controller: DetailFormController;
2020
- /**
2021
- * `id` of the `<form>` element. External submit buttons (e.g. inside a dialog footer,
2022
- * which live outside the form tree) submit via `<button form={formId} type="submit">`.
2023
- * Defaults to `"formulario"` for parity with `SaveCancelButton`.
2024
- */
2025
- formId?: string;
2026
- /** Persist-tab key for multi-section forms. Defaults to `formId`. */
2027
- storageKey?: string;
2028
- /** Height factor passed to the loading spinner. Defaults to `0.7`. */
2029
- loadingHeight?: number;
2030
- slotProps?: {
2031
- form?: Partial<BoxProps>;
2032
- };
2033
- }
2034
- /**
2035
- * Presentational, chrome-less body of a record form: the `FormProvider`, the `<form>`
2036
- * element and the section/tab render tree — no page layout, no header buttons. Compose it
2037
- * inside a page, dialog or drawer shell that supplies the surrounding chrome.
2038
- */
2039
- declare function DetailForm({ controller, formId, storageKey, loadingHeight, slotProps, }: DetailFormProps): react_jsx_runtime.JSX.Element;
2040
-
2041
2493
  interface DetailFormDialogProps {
2042
2494
  open: boolean;
2043
2495
  /** Close the dialog. Also invoked after a successful save and on cancel. */
@@ -2051,6 +2503,15 @@ interface DetailFormDialogProps {
2051
2503
  permissionsPath?: string;
2052
2504
  /** Runs after a successful mutation, before the dialog closes. Receives the response. */
2053
2505
  onSuccess?: (response: any) => void;
2506
+ /**
2507
+ * What the `size` breakpoints of the fields — and of the subsections themselves — resolve
2508
+ * against. Defaults to `"container"`: a `maxWidth="sm"` dialog is narrow by construction, so
2509
+ * viewport breakpoints would pick the wide-screen value and cram the fields.
2510
+ * @see DetailFormProps.responsiveTo
2511
+ */
2512
+ responsiveTo?: DetailFormProps["responsiveTo"];
2513
+ /** @see DetailFormProps.containerBreakpoints */
2514
+ containerBreakpoints?: DetailFormProps["containerBreakpoints"];
2054
2515
  labels?: {
2055
2516
  save?: string;
2056
2517
  cancel?: string;
@@ -2068,105 +2529,7 @@ interface DetailFormDialogProps {
2068
2529
  * becomes a `DialogTitle` and the buttons move into `DialogActions`. The save button lives
2069
2530
  * outside the `<form>` tree, so it submits via the native `form={formId}` attribute.
2070
2531
  */
2071
- declare function DetailFormDialog({ open, onClose, title, api, form, sections, pageType, permissionsPath, onSuccess, labels, slotProps, }: DetailFormDialogProps): react_jsx_runtime.JSX.Element;
2072
-
2073
- interface DetailFormDrawerNavigation {
2074
- /** Open the previous record of the list the drawer is walking. */
2075
- onPrev: () => void;
2076
- onNext: () => void;
2077
- /** Whether a previous/next record exists. The arrows are disabled when it doesn't. */
2078
- hasPrev: boolean;
2079
- hasNext: boolean;
2080
- /** 1-based position of the current record, shown between the arrows. */
2081
- position?: number;
2082
- /** Size of the list; shown as `position / count`. */
2083
- count?: number;
2084
- /** Blocks both arrows for a caller-side reason (e.g. while the next batch loads). */
2085
- disabled?: boolean;
2086
- }
2087
- interface DetailFormDrawerProps {
2088
- open: boolean;
2089
- /** Close the drawer. Also invoked after a successful save and on cancel. */
2090
- onClose: () => void;
2091
- title?: ReactNode;
2092
- api: DetailFormApi;
2093
- form: DetailFormConfig["form"];
2094
- sections: DetailFormConfig["sections"];
2095
- /** Defaults to `"create"`. */
2096
- pageType?: PageType;
2097
- /**
2098
- * Open a `"detail"` drawer straight in edit mode, as if the user had hit the Editar
2099
- * button. Ignored for the other page types, and for records the user may not edit.
2100
- */
2101
- startInEdit?: boolean;
2102
- /**
2103
- * Identity of the record on show. Swapping it (as the navigator does, without remounting
2104
- * the drawer) re-derives the per-record chrome — the in-place edit toggle drops back to
2105
- * read-only and `startInEdit` is re-applied against the new record's own permissions.
2106
- */
2107
- recordKey?: string | number;
2108
- permissionsPath?: string;
2109
- /** Runs after a successful mutation, before the drawer closes. Receives the response. */
2110
- onSuccess?: (response: any) => void;
2111
- /**
2112
- * Footer record navigator: prev/next arrows (Alt+↑ / Alt+↓) that step through a list of
2113
- * sibling records — e.g. the rows of the grid the drawer was opened from — without
2114
- * closing the drawer. Omit it and no navigator renders.
2115
- */
2116
- navigation?: DetailFormDrawerNavigation;
2117
- /** Panel width. Defaults to `600`. */
2118
- width?: number | string;
2119
- /** Side the drawer slides in from. Defaults to `"right"`. */
2120
- anchor?: DrawerProps["anchor"];
2121
- /**
2122
- * Let the user drag the drawer's inner edge to resize it. Forwarded to `MainDrawer_v2`
2123
- * along with the four props below — see it for the full behaviour.
2124
- */
2125
- resizable?: boolean;
2126
- /** Smallest width the drag allows, in px. Defaults to `320`. */
2127
- minWidth?: number;
2128
- /** Largest width the drag allows, in px. Defaults to the viewport minus a margin. */
2129
- maxWidth?: number;
2130
- /**
2131
- * Remember the dragged width under this `localStorage` key. Worth setting whenever the
2132
- * drawer is remounted per record — a fresh mount otherwise forgets the drag.
2133
- */
2134
- widthStorageKey?: string;
2135
- /** Fires with the final dragged width in px, or `null` when a double click resets it. */
2136
- onWidthChange?: (width: number | null) => void;
2137
- labels?: {
2138
- save?: string;
2139
- cancel?: string;
2140
- /**
2141
- * Rótulo del guardar-y-seguir. Por defecto `"Guardar ↓"`, corto porque va junto al
2142
- * Guardar de siempre y el tooltip ya dice qué hace; pásale un texto propio donde el
2143
- * paso al siguiente registro merezca nombrarse ("Guardar y siguiente bulto").
2144
- */
2145
- saveAndNext?: string;
2146
- };
2147
- slots?: {
2148
- /** Extra actions rendered in the header, left of the close button (e.g. "open full page"). */
2149
- headerActions?: ReactNode;
2150
- };
2151
- slotProps?: {
2152
- drawer?: Partial<DrawerProps>;
2153
- saveButton?: Partial<ButtonProps>;
2154
- cancelButton?: Partial<ButtonProps>;
2155
- saveAndNextButton?: Partial<ButtonProps>;
2156
- };
2157
- }
2158
- /**
2159
- * A record form inside a side drawer. Reuses the same `useDetailForm` engine and
2160
- * `DetailForm` body as `DetailPage_v2`, and `MainDrawer_v2` for the chrome — so it frames
2161
- * the form exactly like every other v2 drawer. What it adds on top is the per-record
2162
- * furniture: edit/delete in the header, and a footer holding the form actions and, when
2163
- * `navigation` is given, a prev/next record navigator (Alt+↑ / Alt+↓) plus "Guardar ↓"
2164
- * (Alt+Shift+↓) — a save that steps to the next record instead of closing, so a column can be
2165
- * captured down a list in one pass without the hands leaving the keyboard. Rename it with
2166
- * `labels.saveAndNext`. Guardar sits outside the `<form>` and submits via the native
2167
- * `form={formId}` attribute; Guardar ↓ submits by hand, so the implicit Enter stays Guardar.
2168
- */
2169
- declare function DetailFormDrawer({ open, onClose, title, api, form, sections, pageType, startInEdit, recordKey, permissionsPath, onSuccess, navigation, width, anchor, resizable, minWidth, maxWidth, widthStorageKey, onWidthChange, labels, slots, slotProps, }: DetailFormDrawerProps): react_jsx_runtime.JSX.Element;
2532
+ declare function DetailFormDialog({ open, onClose, title, api, form, sections, pageType, permissionsPath, onSuccess, responsiveTo, containerBreakpoints, labels, slotProps, }: DetailFormDialogProps): react_jsx_runtime.JSX.Element;
2170
2533
 
2171
2534
  /**
2172
2535
  * Encabezado por defecto del `PageContainer`: resuelve título y breadcrumbs a
@@ -2202,6 +2565,9 @@ interface MainLayoutPageHeaderProps extends PageHeaderProps {
2202
2565
  *
2203
2566
  * Atajo Shift+F: alterna pantalla completa (oculta navegación y encabezados).
2204
2567
  *
2568
+ * Con `sidePanel` el cascarón deja de ocupar el viewport entero y comparte la fila
2569
+ * con un panel acoplado a la derecha (ver esa prop).
2570
+ *
2205
2571
  * El estado plegado/expandido del sidebar de escritorio se guarda en
2206
2572
  * `localStorage` y se restaura al recargar (ver `sidebarStorageKey`).
2207
2573
  **/
@@ -2250,11 +2616,15 @@ interface MainLayoutProps {
2250
2616
  * Color de fondo del área de contenido. Se aplica al scroll container
2251
2617
  * (`<main>`) para que cubra toda la altura scrolleable y no se corte cuando
2252
2618
  * la página es más larga que el viewport.
2619
+ *
2620
+ * Por defecto el fondo del tema, escrito como variable CSS para que siga al
2621
+ * esquema de color activo; un valor fijo lo deja igual en claro y en oscuro.
2253
2622
  */
2254
2623
  pageBackgroundColor?: string;
2255
2624
  /**
2256
2625
  * Color del contorno: el marco continuo que forman el header y el sidebar
2257
- * alrededor del panel de contenido.
2626
+ * alrededor del panel de contenido. Por defecto el color de superficie del
2627
+ * tema, con la misma salvedad que `pageBackgroundColor`.
2258
2628
  */
2259
2629
  chromeBackgroundColor?: string;
2260
2630
  /**
@@ -2291,6 +2661,13 @@ interface MainLayoutProps {
2291
2661
  slots?: {
2292
2662
  /** Barra superior del dashboard. Por defecto la de Toolpad. */
2293
2663
  header?: JSXElementConstructor<DashboardHeaderProps>;
2664
+ /**
2665
+ * Acciones de la derecha de la barra superior. Por defecto Toolpad pinta
2666
+ * ahí el interruptor de claro/oscuro y el menú de cuenta; reemplazarlo es
2667
+ * la forma de mover ese interruptor (`useColorMode`) a otro sitio, o de
2668
+ * añadir acciones propias, sin rehacer el header entero.
2669
+ */
2670
+ toolbarActions?: JSXElementConstructor<{}>;
2294
2671
  /** Pie del sidebar. Por defecto muestra versión y copyright. */
2295
2672
  sidebarFooter?: ElementType<SidebarFooterProps>;
2296
2673
  /** Encabezado de página. Por defecto resuelve título/breadcrumbs. */
@@ -2298,9 +2675,38 @@ interface MainLayoutProps {
2298
2675
  /** Contenido de cada snack de progreso. Por defecto una barra de progreso. */
2299
2676
  progressStatus?: (data: any) => ReactNode;
2300
2677
  };
2678
+ /**
2679
+ * Panel acoplado a la derecha del cascarón, a lo alto del viewport: al lado del
2680
+ * header, del sidebar y del contenido, no encima. Mientras esté abierto el
2681
+ * dashboard entero se encoge para dejarle sitio, así que la página de atrás sigue
2682
+ * usable —es la diferencia con un drawer, que la tapa—.
2683
+ *
2684
+ * Aquí sólo se le reserva el hueco; el panel maneja su propio ancho, su animación y
2685
+ * si está abierto o cerrado. Lo natural es un `MainDrawer_v2` con `variant="docked"`,
2686
+ * que además queda con el encabezado a la misma altura que la barra superior.
2687
+ *
2688
+ * El ancho que ocupe se publica en `SIDE_PANEL_WIDTH_VAR`, para que lo que esté fijo
2689
+ * al viewport pueda apartarse.
2690
+ */
2691
+ sidePanel?: ReactNode;
2301
2692
  /** Contenido a renderizar; por defecto el `<Outlet />` del router. */
2302
2693
  children?: ReactNode;
2303
2694
  }
2695
+ /**
2696
+ * Variable CSS con el ancho que ocupa ahora mismo el `sidePanel`, publicada en la raíz
2697
+ * del documento.
2698
+ *
2699
+ * El panel encoge el cascarón, pero no lo que está fijo al viewport —un FAB, los snacks
2700
+ * de progreso—, que quedaría debajo. Leyendo esta variable esos elementos se apartan
2701
+ * solos, y siguen el ancho aunque el panel se anime o el usuario lo arrastre:
2702
+ *
2703
+ * right: `calc(${theme.spacing(4)} + var(--acv-side-panel-width, 0px))`
2704
+ *
2705
+ * Va en `documentElement` porque buena parte de esos elementos se pintan en portales,
2706
+ * fuera del árbol del layout. Sin panel abierto vale `0px`, y fuera de este layout no
2707
+ * existe: de ahí que se lea siempre con un fallback.
2708
+ */
2709
+ declare const SIDE_PANEL_WIDTH_VAR = "--acv-side-panel-width";
2304
2710
  declare const MainLayout: (props: MainLayoutProps) => react_jsx_runtime.JSX.Element;
2305
2711
 
2306
2712
  /**
@@ -2345,6 +2751,56 @@ declare const useMutationHandler: ({ mutationFn, form, onSuccess, onValidationEr
2345
2751
 
2346
2752
  declare const useHasPermission_v2: (path?: string) => boolean;
2347
2753
 
2754
+ /**
2755
+ * Lee y cambia el esquema de color de la aplicación.
2756
+ *
2757
+ * Es la pieza que la librería expone para que cada proyecto ponga el interruptor
2758
+ * donde quiera (cabecera, menú de usuario, ajustes…): la librería no dibuja
2759
+ * ningún control, solo da el estado y las acciones.
2760
+ *
2761
+ * Funciona dentro del proveedor de tema que monta `MainLayout`, y el modo
2762
+ * elegido se guarda en `localStorage`, así que sobrevive a recargas sin que el
2763
+ * proyecto tenga que persistir nada.
2764
+ *
2765
+ * @example
2766
+ * const { isDark, toggle } = useColorMode();
2767
+ * <IconButton onClick={toggle}>{isDark ? <LightModeIcon /> : <DarkModeIcon />}</IconButton>
2768
+ *
2769
+ * @example
2770
+ * // Con las tres opciones, incluida "seguir al sistema"
2771
+ * const { mode, setMode } = useColorMode();
2772
+ * <ToggleButtonGroup value={mode} exclusive onChange={(_, v) => v && setMode(v)}>
2773
+ * <ToggleButton value={"light"}>Claro</ToggleButton>
2774
+ * <ToggleButton value={"dark"}>Oscuro</ToggleButton>
2775
+ * <ToggleButton value={"system"}>Sistema</ToggleButton>
2776
+ * </ToggleButtonGroup>
2777
+ */
2778
+ /** Preferencia del usuario. `system` sigue a la configuración del dispositivo. */
2779
+ type ColorMode = "light" | "dark" | "system";
2780
+ interface UseColorModeResult {
2781
+ /**
2782
+ * Preferencia elegida, incluida `system`. Es el valor que debe marcar un
2783
+ * selector de tres posiciones. En el primer render puede ser `undefined`,
2784
+ * antes de que se lea lo guardado.
2785
+ */
2786
+ mode: ColorMode | undefined;
2787
+ /** Esquema realmente aplicado, con `system` ya resuelto. */
2788
+ resolvedMode: "light" | "dark";
2789
+ /** Atajo de `resolvedMode === "dark"`, para elegir icono o texto. */
2790
+ isDark: boolean;
2791
+ /** Fija la preferencia y la guarda. */
2792
+ setMode: (mode: ColorMode) => void;
2793
+ /** Alterna entre claro y oscuro partiendo del esquema aplicado. */
2794
+ toggle: () => void;
2795
+ /**
2796
+ * `false` si el tema en uso solo declara un esquema — un proyecto que pasa a
2797
+ * `MainLayout` un tema propio construido sin `colorSchemes`. Sirve para
2798
+ * esconder el interruptor en vez de dejar uno que no hace nada.
2799
+ */
2800
+ isSupported: boolean;
2801
+ }
2802
+ declare function useColorMode(): UseColorModeResult;
2803
+
2348
2804
  interface PulseDotProps {
2349
2805
  /** Cuando es `true`, el punto es verde y parpadea; si no, usa `inactiveColor`. */
2350
2806
  active: boolean;
@@ -2359,5 +2815,5 @@ interface PulseDotProps {
2359
2815
  * contrario un color fijo. Se usa para indicar conexión/actividad en vivo. */
2360
2816
  declare function PulseDot({ active, inactiveColor, size, title }: PulseDotProps): react_jsx_runtime.JSX.Element;
2361
2817
 
2362
- export { APIContext, APIProvider, ActiveCell, ActiveIcon, Base, ButtonWithDrawer, CSVUpload, ConfirmDialog, ContentLayout, ControlledAddressAutocomplete, ControlledAmountWithCurrency, ControlledDate$1 as ControlledDate, ControlledDate as ControlledDate_v2, ControlledDropdown, ControlledFileField$1 as ControlledFileField, ControlledFileField as ControlledFileField_v2, FileUploadBox as ControlledFileUploadBox, ControlledNumber, ControlledPhoneNumber, ControlledSelect$1 as ControlledSelect, ControlledSelect as ControlledSelect_v2, ControlledSlider as ControlledSimpleSlider, ControlledSlider$1 as ControlledSlider, ControlledSwitch, ControlledText, ControlledTimePicker, ControlledToggleButtons, CoverPage, CreateButtonBase, CreateButtonWithMenuOptions, CrudDropdown, CustomNoRows, DEFAULT_PAGINATION, DeleteButton, DeleteConfirmationDialog, DetailFormDialog as DetailFormDialog_v2, DetailFormDrawer as DetailFormDrawer_v2, DetailForm as DetailForm_v2, DetailPage$1 as DetailPage, DetailPage as DetailPage_v2, DrawerGrid as DrawerGrid_v2, EditButton, ExportCSV, ExtraButtons, HistorialDrawer, KpiCard, LAYER_ORDER, ListPage, Loadable, LoadingComponent, Logo, MainDrawer, MainDrawer$1 as MainDrawer_v2, MainLayout, MenuItemWithLoading, ModuleCard, MoreOptions, MyGridEditSingleSelect, NavigationContext, NavigationProvider, NormalOrIcon, NotAllowed, NotFound, ObjectProgressStack, PAGE_SIZE_OPTIONS, Panel, PollingCountdownChip, PulseDot, SaveCancelButton, ServerGrid as ServerGrid_v2, StatusBadge, StyledMenu, Tabs, Transitions, UncontrolledText, changeTitle, closeProgressSnack, composeGridProps, deleteColumn$1 as deleteColumn, deleteColumn as deleteColumn_v2, editColumn, filterQuery, formParser, _default as headerReducer, manualCacheRefresh, mergeSettings, openProgressSnack, query, renderEditCellWithErrorTooltip, resolveInitialState, setErrors, _default$1 as snackProgressReducer, tags, theme, togglableFields, updateProgressSnackData, useAPI, useDetailForm, useHasPermission, useHasPermission_v2, useKeyboardShortcut, useMutationHandler, useNavigation, useServerGrid, valueLabel };
2363
- export type { APIcontextProps, AddressValue, ComoOpcionesProps, ConfirmDialogProps, ControlledInput, CustomToolbarProps, DeleteGridColumnsProps$1 as DeleteGridColumnsProps, DetachedPage, DetailFormApi, DetailFormConfig, DetailFormController, DetailFormDialogProps, DetailFormDrawerNavigation, DetailFormDrawerProps, DetailFormProps, DetailFormStatus, DetailPageV2Props, DetailRenderProps, DrawerGridDrawerConfig, DrawerGridEditConfig, DrawerGridProps, EditGridColumnsProps, EditReadOnlyFields, FieldFilter, FieldProps$1 as FieldProps, FieldValidationProps, GridArgs, GridColDefPropsOverrides, GridLayerContribution, GridLayerId, GridLayerMap, JSONFormProps, JSONParserProps, KeyboardShortcut, KpiCardProps, MainDrawerV2Props, MainLayoutPageHeaderProps, MainLayoutProps, MainLayoutSidebarFooterProps, MyDataGridProps, MyGridFilterModel, MyTab, MyTabProps, PageType, PanelProps, PollingCountdownChipProps, ProgressStatusProps, PulseDotProps, RowsSnapshot, ServerGridArgs, ServerGridCreateApi, ServerGridDataApi, ServerGridDeleteApi, ServerGridEditApi, ServerGridEditToggleApi, ServerGridHandle, ServerGridProps, ServerGridSnapshot, ServerGridState, UseServerGridOptions };
2818
+ export { APIContext, APIProvider, ActiveCell, ActiveIcon, Base, ButtonWithDrawer, COLOR_SCHEME_SELECTOR, CSVUpload, ConfirmDialog, ContentLayout, ControlledAddressAutocomplete, ControlledAmountWithCurrency, ControlledDate$1 as ControlledDate, ControlledDate as ControlledDate_v2, ControlledDropdown, ControlledFileField$1 as ControlledFileField, ControlledFileField as ControlledFileField_v2, FileUploadBox as ControlledFileUploadBox, ControlledNumber, ControlledPhoneNumber, ControlledSelect$1 as ControlledSelect, ControlledSelect as ControlledSelect_v2, ControlledSlider as ControlledSimpleSlider, ControlledSlider$1 as ControlledSlider, ControlledSwitch, ControlledText, ControlledTimePicker, ControlledToggleButtons, CoverPage, CreateButtonBase, CreateButtonWithMenuOptions, CrudDropdown, CustomNoRows, DEFAULT_FORM_BREAKPOINTS, DEFAULT_PAGINATION, DeleteButton, DeleteConfirmationDialog, DetailFormDialog as DetailFormDialog_v2, DetailFormDrawer as DetailFormDrawer_v2, DetailForm as DetailForm_v2, DetailPage$1 as DetailPage, DetailPage as DetailPage_v2, DrawerGrid as DrawerGrid_v2, EditButton, ExportCSV, ExtraButtons, FORM_CONTAINER_NAME, HistorialDrawer, KpiCard, LAYER_ORDER, ListPage, Loadable, LoadingComponent, Logo, MainDrawer, MainDrawer$1 as MainDrawer_v2, MainLayout, MenuItemWithLoading, ModuleCard, MoreOptions, MyGridEditSingleSelect, NavigationContext, NavigationProvider, NormalOrIcon, NotAllowed, NotFound, ObjectProgressStack, PAGE_SIZE_OPTIONS, Panel, PollingCountdownChip, PulseDot, SIDE_PANEL_WIDTH_VAR, SaveCancelButton, ServerGrid as ServerGrid_v2, SidePanelHostContext, StatusBadge, StyledMenu, Tabs, Transitions, TrueFalse, UncontrolledText, changeTitle, closeProgressSnack, composeGridProps, deleteColumn$1 as deleteColumn, deleteColumn as deleteColumn_v2, editColumn, filterQuery, formContainerSx, formGridSx, formParser, _default as headerReducer, manualCacheRefresh, mergeSettings, openProgressSnack, query, renderEditCellWithErrorTooltip, resolveInitialState, setErrors, _default$1 as snackProgressReducer, tags, theme, togglableFields, updateProgressSnackData, useAPI, useColorMode, useDetailForm, useHasPermission, useHasPermission_v2, useKeyboardShortcut, useMutationHandler, useNavigation, useServerGrid, useSidePanelHost, valueLabel };
2819
+ export type { APIcontextProps, AddressValue, AppTheme, ColorMode, ComoOpcionesProps, ConfirmDialogProps, ControlledInput, CustomFilterDef, CustomToolbarProps, DeleteGridColumnsProps$1 as DeleteGridColumnsProps, DetachedPage, DetailFormApi, DetailFormConfig, DetailFormController, DetailFormDialogProps, DetailFormDrawerNavigation, DetailFormDrawerProps, DetailFormProps, DetailFormStatus, DetailPageV2Props, DetailRenderProps, DrawerGridDrawerConfig, DrawerGridEditConfig, DrawerGridProps, EditGridColumnsProps, EditReadOnlyFields, FieldFilter, FieldProps$1 as FieldProps, FieldValidationProps, FilterInput, FormBreakpoint, FormGridSxOptions, GridArgs, GridColDefPropsOverrides, GridLayerContribution, GridLayerId, GridLayerMap, JSONFormProps, JSONParserProps, KeyboardShortcut, KpiCardProps, MainDrawerV2Props, MainLayoutPageHeaderProps, MainLayoutProps, MainLayoutSidebarFooterProps, MyDataGridProps, MyGridFilterModel, MyTab, MyTabProps, PageType, PanelProps, PollingCountdownChipProps, ProgressStatusProps, PulseDotProps, RowsSnapshot, ServerGridArgs, ServerGridCreateApi, ServerGridDataApi, ServerGridDeleteApi, ServerGridEditApi, ServerGridEditToggleApi, ServerGridHandle, ServerGridProps, ServerGridSnapshot, ServerGridState, SidePanelHost, UseColorModeResult, UseServerGridOptions };