flysoft-react-ui 1.4.0 → 1.4.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.
@@ -0,0 +1,374 @@
1
+ <!-- Generado desde los tipos de flysoft-react-ui@1.4.3. No editar a mano. -->
2
+ <!-- Regenerar con: npm run docs:skill -->
3
+
4
+ # Providers, hooks y context types
5
+
6
+ Los providers montan el contexto; los hooks lo leen. Para cada hook se incluye la forma de lo que devuelve, porque es la mitad de su API.
7
+
8
+ ## ThemeProvider
9
+
10
+ | Prop | Tipo | Req. | Default | Descripción |
11
+ |---|---|---|---|---|
12
+ | `children` | `ReactNode` | **sí** | — | |
13
+ | `initialTheme` | `string \| Theme` | | `"light"` | |
14
+ | `storageKey` | `string` | | `"flysoft-theme"` | |
15
+ | `forceInitialTheme` | `boolean` | | `false` | |
16
+ | `onThemeChange` | `(theme: Theme) => void` | | — | |
17
+ | `density` | `"comfortable" \| "compact" \| "dense" (Density)` | | — | Densidad global inicial. Controla padding, tipografía y altura de los controles de toda la librería sin necesidad de pasar `compact`/`size` por componente. |
18
+ | `densityStorageKey` | `string` | | `"flysoft-density"` | Clave separada para persistir la densidad en localStorage. |
19
+ | `forceInitialDensity` | `boolean` | | `false` | Si es true, ignora el valor guardado en localStorage y fuerza `density`. |
20
+ | `onDensityChange` | `(density: Density) => void` | | — | |
21
+
22
+ ## AppLayoutProvider
23
+
24
+ | Prop | Tipo | Req. | Default | Descripción |
25
+ |---|---|---|---|---|
26
+ | `children` | `ReactNode` | **sí** | — | |
27
+ | `initialTheme` | `string \| Theme` | | `"light"` | |
28
+ | `storageKey` | `string` | | `"flysoft-theme"` | |
29
+ | `forceInitialTheme` | `boolean` | | `false` | |
30
+ | `density` | `"comfortable" \| "compact" \| "dense" (Density)` | | — | |
31
+ | `densityStorageKey` | `string` | | — | |
32
+ | `forceInitialDensity` | `boolean` | | — | |
33
+ | `onDensityChange` | `(density: Density) => void` | | — | |
34
+ | `initialNavbar` | `NavbarInterface` | | — | |
35
+ | `initialLeftDrawer` | `LeftDrawerInterface` | | — | |
36
+ | `initialContentFooter` | `ReactNode` | | — | |
37
+ | `className` | `string` | | `""` | |
38
+
39
+ ## AuthProvider
40
+
41
+ | Prop | Tipo | Req. | Default | Descripción |
42
+ |---|---|---|---|---|
43
+ | `children` | `React.ReactNode` | **sí** | — | |
44
+ | `getToken` | `(username: string, password: string) => Promise<AuthTokenInterface>` | **sí** | — | |
45
+ | `getUserData` | `(auth: AuthTokenInterface) => Promise<AuthContextUserInterface>` | **sí** | — | |
46
+ | `refreshToken` | `(auth: AuthTokenInterface) => Promise<AuthTokenInterface>` | | — | |
47
+ | `removeToken` | `(auth: AuthTokenInterface) => Promise<void>` | | — | |
48
+ | `showLog` | `boolean` | | `false` | |
49
+
50
+ ## CrudProvider\<T\>
51
+
52
+ | Prop | Tipo | Req. | Default | Descripción |
53
+ |---|---|---|---|---|
54
+ | `children` | `ReactNode` | **sí** | — | |
55
+ | `getPromise` | `\| ((params?: Record<string, any>) => Promise<Array<T> \| PaginationInterface<T> \| undefined>) \| PromiseWithOptions< Array<T> \| PaginationInterface<T> \| undefined, [params?: Record<string, any>] >` | | — | |
56
+ | `getItemPromise` | `\| ((id: string \| number) => Promise<T \| undefined>) \| PromiseWithOptions<T \| undefined, [id: string \| number]>` | | — | |
57
+ | `postPromise` | `\| ((item: T) => Promise<T \| undefined \| null>) \| PromiseWithOptions<T \| undefined \| null, [item: T]>` | | — | |
58
+ | `putPromise` | `\| ((item: T) => Promise<T \| undefined \| null>) \| PromiseWithOptions<T \| undefined \| null, [item: T]>` | | — | |
59
+ | `deletePromise` | `\| ((item: T) => Promise<void>) \| PromiseWithOptions<void, [item: T]>` | | — | |
60
+ | `urlParams` | `Array<string>` | | `[]` | |
61
+ | `limit` | `number` | | `15` | |
62
+ | `pageParam` | `string` | | `"pagina"` | |
63
+ | `singleItemId` | `string \| number` | | — | |
64
+ | `extraData` | `Record<string, any>` | | — | |
65
+
66
+ ## SnackbarProvider
67
+
68
+ | Prop | Tipo | Req. | Default | Descripción |
69
+ |---|---|---|---|---|
70
+ | `children` | `ReactNode` | **sí** | — | |
71
+
72
+ ## Tipos auxiliares
73
+
74
+ ### `AppLayoutContextType`
75
+
76
+ Extiende `ThemeContextType`.
77
+
78
+ | Prop | Tipo | Req. | Default | Descripción |
79
+ |---|---|---|---|---|
80
+ | `navbar` | `NavbarInterface \| undefined` | **sí** | — | |
81
+ | `leftDrawer` | `LeftDrawerInterface \| undefined` | **sí** | — | |
82
+ | `contentFooter` | `ReactNode \| undefined` | **sí** | — | |
83
+ | `className` | `string` | **sí** | — | |
84
+ | `setNavbar` | `Dispatch<SetStateAction<NavbarInterface \| undefined>>` | **sí** | — | |
85
+ | `setLeftDrawer` | `Dispatch<SetStateAction<LeftDrawerInterface \| undefined>>` | **sí** | — | |
86
+ | `setContentFooter` | `(node: ReactNode \| undefined) => void` | **sí** | — | |
87
+ | `setClassName` | `(className: string) => void` | **sí** | — | |
88
+ | `setNavBarLeftNode` | `(node: string \| ReactNode \| undefined) => void` | **sí** | — | |
89
+ | `setNavbarRightNode` | `(node: string \| ReactNode \| undefined) => void` | **sí** | — | |
90
+ | `isLeftDrawerOpen` | `boolean` | **sí** | — | |
91
+ | `openLeftDrawer` | `() => void` | **sí** | — | |
92
+ | `closeLeftDrawer` | `() => void` | **sí** | — | |
93
+ | `toggleLeftDrawer` | `() => void` | **sí** | — | |
94
+
95
+ ### `AsyncRequestOptions`
96
+
97
+ | Prop | Tipo | Req. | Default | Descripción |
98
+ |---|---|---|---|---|
99
+ | `successMessage` | `string` | | — | |
100
+ | `errorMessage` | `string \| ((error: any) => string)` | | — | |
101
+ | `successVariant` | `\| "primary" \| "secondary" \| "success" \| "warning" \| "danger" \| "info" (SnackbarVariant)` | | — | |
102
+ | `errorVariant` | `\| "primary" \| "secondary" \| "success" \| "warning" \| "danger" \| "info" (SnackbarVariant)` | | — | |
103
+ | `onSuccess` | `(data: any) => void` | | — | |
104
+ | `onError` | `(error: any) => void` | | — | |
105
+ | `onFinally` | `() => void` | | — | |
106
+
107
+ ### `AuthContext`
108
+
109
+ ```ts
110
+ AuthContext: import("D:/development/flysoft-react-ui/node_modules/@types/react/index").Context<AuthContextType>
111
+ ```
112
+
113
+ ### `AuthContextType`
114
+
115
+ | Prop | Tipo | Req. | Default | Descripción |
116
+ |---|---|---|---|---|
117
+ | `user` | `AuthContextUserInterface \| null` | **sí** | — | |
118
+ | `login` | `(username: string, password: string) => Promise<void>` | **sí** | — | |
119
+ | `logout` | `() => void` | **sí** | — | |
120
+ | `isAuthenticated` | `boolean` | **sí** | — | |
121
+ | `isLoading` | `boolean` | **sí** | — | |
122
+
123
+ ### `AuthContextUserInterface`
124
+
125
+ | Prop | Tipo | Req. | Default | Descripción |
126
+ |---|---|---|---|---|
127
+ | `id` | `number \| string` | | — | |
128
+ | `name` | `string` | | — | |
129
+ | `aditionalData` | `any` | | — | |
130
+ | `token` | `AuthTokenInterface` | | — | |
131
+
132
+ ### `AuthTokenInterface`
133
+
134
+ | Prop | Tipo | Req. | Default | Descripción |
135
+ |---|---|---|---|---|
136
+ | `accessToken` | `string` | | — | |
137
+ | `expires` | `string` | | — | |
138
+ | `tokenType` | `string` | | — | |
139
+ | `refreshToken` | `string` | | — | |
140
+ | `aditionalData` | `any` | | — | |
141
+
142
+ ### `Breakpoint`
143
+
144
+ ```ts
145
+ type Breakpoint = "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
146
+ ```
147
+
148
+ ### `BreakpointInfo`
149
+
150
+ | Prop | Tipo | Req. | Default | Descripción |
151
+ |---|---|---|---|---|
152
+ | `breakpoint` | `"xs" \| "sm" \| "md" \| "lg" \| "xl" \| "2xl" (Breakpoint)` | **sí** | — | |
153
+ | `windowSize` | `WindowSize` | **sí** | — | |
154
+ | `isMobile` | `boolean` | **sí** | — | |
155
+ | `isTablet` | `boolean` | **sí** | — | |
156
+ | `isDesktop` | `boolean` | **sí** | — | |
157
+
158
+ ### `CrudContext`
159
+
160
+ ```ts
161
+ CrudContext: import("D:/development/flysoft-react-ui/node_modules/@types/react/index").Context<CrudContextType<any> | undefined>
162
+ ```
163
+
164
+ ### `CrudContextType`
165
+
166
+ | Prop | Tipo | Req. | Default | Descripción |
167
+ |---|---|---|---|---|
168
+ | `list` | `Array<T> \| undefined` | **sí** | — | |
169
+ | `item` | `T \| undefined` | **sí** | — | |
170
+ | `page` | `number` | **sí** | — | |
171
+ | `pages` | `number` | **sí** | — | |
172
+ | `total` | `number` | **sí** | — | |
173
+ | `limit` | `number` | **sí** | — | |
174
+ | `isLoading` | `boolean` | **sí** | — | |
175
+ | `pagination` | `ReactNode` | **sí** | — | |
176
+ | `params` | `Record<string, any>` | **sí** | — | |
177
+ | `extraData` | `Record<string, any>` | | — | |
178
+ | `setExtraData` | `Dispatch<SetStateAction<Record<string, any> \| undefined>>` | **sí** | — | |
179
+ | `fetchItems` | `{ execute: (params?: Record<string, any>) => Promise<void>; isLoading: boolean; }` | **sí** | — | |
180
+ | `fetchItem` | `{ execute: (params?: Record<string, any> \| string \| number) => Promise<T \| undefined>; isLoading: boolean; }` | **sí** | — | |
181
+ | `createItem` | `{ execute: (item: T) => Promise<T \| undefined \| null>; isLoading: boolean; }` | **sí** | — | |
182
+ | `updateItem` | `{ execute: (item: T) => Promise<T \| undefined \| null>; isLoading: boolean; }` | **sí** | — | |
183
+ | `deleteItem` | `{ execute: (item: T) => Promise<void>; isLoading: boolean; }` | **sí** | — | |
184
+
185
+ ### `LeftDrawerContext`
186
+
187
+ ```ts
188
+ LeftDrawerContext: import("D:/development/flysoft-react-ui/node_modules/@types/react/index").Context<LeftDrawerContextType | undefined>
189
+ ```
190
+
191
+ ### `LeftDrawerContextType`
192
+
193
+ Comandos para controlar el drawer izquierdo del AppLayout. En resoluciones grandes el drawer está siempre visible, por lo que `closeLeftDrawer()` no produce ningún cambio visual. En móvil/tablet el drawer se muestra como panel flotante con overlay y estos comandos lo abren o cierran.
194
+
195
+ | Prop | Tipo | Req. | Default | Descripción |
196
+ |---|---|---|---|---|
197
+ | `isLeftDrawerOpen` | `boolean` | **sí** | — | Indica si el drawer móvil está abierto |
198
+ | `isLeftDrawerCollapsible` | `boolean` | **sí** | — | Indica si el drawer se está mostrando como panel colapsable con overlay (móvil/tablet con contenido en el drawer). En desktop es `false`. |
199
+ | `openLeftDrawer` | `() => void` | **sí** | — | Abre el drawer |
200
+ | `closeLeftDrawer` | `() => void` | **sí** | — | Cierra el drawer |
201
+ | `toggleLeftDrawer` | `() => void` | **sí** | — | Alterna el estado del drawer |
202
+
203
+ ### `SnackbarActionsType`
204
+
205
+ | Prop | Tipo | Req. | Default | Descripción |
206
+ |---|---|---|---|---|
207
+ | `showSnackbar` | `(message: string, variant?: SnackbarVariant, options?: { duration?: number; icon?: string; iconLabel?: string; }) => void` | **sí** | — | |
208
+ | `removeSnackbar` | `(id: string) => void` | **sí** | — | |
209
+
210
+ ### `SnackbarContextType`
211
+
212
+ Extiende `SnackbarActionsType`.
213
+
214
+ | Prop | Tipo | Req. | Default | Descripción |
215
+ |---|---|---|---|---|
216
+ | `snackbars` | `SnackbarMessage[]` | **sí** | — | |
217
+
218
+ ### `SnackbarMessage`
219
+
220
+ | Prop | Tipo | Req. | Default | Descripción |
221
+ |---|---|---|---|---|
222
+ | `id` | `string` | **sí** | — | |
223
+ | `message` | `string` | **sí** | — | |
224
+ | `variant` | `\| "primary" \| "secondary" \| "success" \| "warning" \| "danger" \| "info" (SnackbarVariant)` | **sí** | — | |
225
+ | `duration` | `number` | | — | |
226
+ | `icon` | `string` | | — | |
227
+ | `iconLabel` | `string` | | — | |
228
+
229
+ ### `SnackbarVariant`
230
+
231
+ ```ts
232
+ type SnackbarVariant = | "primary" | "secondary" | "success" | "warning" | "danger" | "info"
233
+ ```
234
+
235
+ ### `ThemeContextType`
236
+
237
+ | Prop | Tipo | Req. | Default | Descripción |
238
+ |---|---|---|---|---|
239
+ | `theme` | `Theme` | **sí** | — | |
240
+ | `setTheme` | `(theme: Theme \| string) => void` | **sí** | — | |
241
+ | `updateTheme` | `(updates: Partial<Theme> \| ((prev: Theme) => Theme)) => void` | **sí** | — | |
242
+ | `currentThemeName` | `string` | **sí** | — | |
243
+ | `availableThemes` | `string[]` | **sí** | — | |
244
+ | `resetToDefault` | `() => void` | **sí** | — | |
245
+ | `isDark` | `boolean` | **sí** | — | |
246
+ | `density` | `"comfortable" \| "compact" \| "dense" (Density)` | **sí** | — | |
247
+ | `setDensity` | `(density: Density) => void` | **sí** | — | |
248
+
249
+ ### `useAppLayout`
250
+
251
+ ```ts
252
+ useAppLayout: () => AppLayoutContextType
253
+ ```
254
+
255
+ ### `useAppLayoutContext`
256
+
257
+ ```ts
258
+ useAppLayoutContext: () => boolean
259
+ ```
260
+
261
+ ### `useAsyncRequest`
262
+
263
+ ```ts
264
+ useAsyncRequest: (options?: AsyncRequestOptions) => UseAsyncRequestReturn
265
+ ```
266
+
267
+ ### `UseAsyncRequestReturn`
268
+
269
+ | Prop | Tipo | Req. | Default | Descripción |
270
+ |---|---|---|---|---|
271
+ | `isLoading` | `boolean` | **sí** | — | |
272
+ | `execute` | `<T>(requestFn: () => Promise<T>) => Promise<T \| undefined>` | **sí** | — | |
273
+ | `setLoading` | `(loading: boolean) => void` | **sí** | — | |
274
+
275
+ ### `useBreakpoint`
276
+
277
+ ```ts
278
+ useBreakpoint: () => BreakpointInfo
279
+ ```
280
+
281
+ ### `useCrud`
282
+
283
+ ```ts
284
+ useCrud: <T>() => CrudContextType<T>
285
+ ```
286
+
287
+ ### `useElementScroll`
288
+
289
+ ```ts
290
+ useElementScroll: (elementRef: React.RefObject<HTMLElement | null>) => { scrollY: number; scrollDirection: "up" | "down" | null; }
291
+ ```
292
+
293
+ ### `useEnum`
294
+
295
+ ```ts
296
+ useEnum: (baseEnum: any) => { getArray: () => NameValueInterface<number>[]; getInstance: (id: number) => NameValueInterface<number> | undefined; }
297
+ ```
298
+
299
+ ### `useGlobalThemeStyles`
300
+
301
+ Hook que aplica estilos globales del tema al body y html Útil para aplicaciones host que quieren que el tema afecte toda la página
302
+
303
+ ```ts
304
+ useGlobalThemeStyles: () => void
305
+ ```
306
+
307
+ ### `useLeftDrawer`
308
+
309
+ Hook para controlar el drawer izquierdo desde cualquier componente renderizado dentro de `AppLayout` (contenido del drawer, navbar, footer o children).
310
+
311
+ ```ts
312
+ useLeftDrawer: () => LeftDrawerContextType
313
+ ```
314
+
315
+ ```tsx
316
+ const { closeLeftDrawer } = useLeftDrawer();
317
+
318
+ <LinkButton to="/inicio" onClick={closeLeftDrawer}>Inicio</LinkButton>
319
+ ```
320
+
321
+ ### `useOptionalLeftDrawer`
322
+
323
+ Igual que `useLeftDrawer` pero devuelve `undefined` en lugar de lanzar error cuando el componente se usa fuera de un `AppLayout`. Útil para componentes reutilizables que pueden renderizarse dentro o fuera del layout.
324
+
325
+ ```ts
326
+ useOptionalLeftDrawer: () => LeftDrawerContextType | undefined
327
+ ```
328
+
329
+ ### `useSnackbar`
330
+
331
+ ```ts
332
+ useSnackbar: () => SnackbarActionsType
333
+ ```
334
+
335
+ ### `useSnackbarState`
336
+
337
+ ```ts
338
+ useSnackbarState: () => SnackbarMessage[]
339
+ ```
340
+
341
+ ### `useTemporaryOverride`
342
+
343
+ Hook para aplicar overrides temporales que se revierten automáticamente
344
+
345
+ ```ts
346
+ useTemporaryOverride: (overrides: ThemeOverride, duration?: number, options?: UseThemeOverrideOptions) => { applyTemporaryOverride: () => () => void; }
347
+ ```
348
+
349
+ ### `useTheme`
350
+
351
+ ```ts
352
+ useTheme: () => ThemeContextType
353
+ ```
354
+
355
+ ### `useThemeContext`
356
+
357
+ ```ts
358
+ useThemeContext: () => boolean
359
+ ```
360
+
361
+ ### `useThemeOverride`
362
+
363
+ Hook para aplicar overrides directos a variables CSS del tema Permite personalización granular sin cambiar el tema completo
364
+
365
+ ```ts
366
+ useThemeOverride: (options?: UseThemeOverrideOptions) => { applyOverride: (overrides: ThemeOverride) => void; revertOverride: (keys: string[]) => void; revertAllOverrides: () => void; getCSSVariable: (key: string) => string | null; isOverrideApplied: (key: string) => boolean; appliedOverridesCount: number; }
367
+ ```
368
+
369
+ ### `WindowSize`
370
+
371
+ | Prop | Tipo | Req. | Default | Descripción |
372
+ |---|---|---|---|---|
373
+ | `width` | `number` | **sí** | — | |
374
+ | `height` | `number` | **sí** | — | |
@@ -0,0 +1,260 @@
1
+ <!-- Generado desde los tipos de flysoft-react-ui@1.4.3. No editar a mano. -->
2
+ <!-- Regenerar con: npm run docs:skill -->
3
+
4
+ # Layout, overlay y navegación
5
+
6
+ Estructura de página, contenedores, modales, menús y filtros.
7
+
8
+ ## AppLayout
9
+
10
+ | Prop | Tipo | Req. | Default | Descripción |
11
+ |---|---|---|---|---|
12
+ | `navbar` | `NavbarInterface` | | — | |
13
+ | `leftDrawer` | `LeftDrawerInterface` | | — | |
14
+ | `contentFooter` | `React.ReactNode` | | — | |
15
+ | `children` | `React.ReactNode` | **sí** | — | |
16
+ | `className` | `string` | | `""` | |
17
+ | `isLeftDrawerOpen` | `boolean` | | — | Estado controlado del drawer móvil. Si se define, el AppLayout deja de manejar el estado internamente y hay que actualizarlo desde `onLeftDrawerOpenChange`. |
18
+ | `onLeftDrawerOpenChange` | `(isOpen: boolean) => void` | | — | Se dispara cada vez que el drawer móvil debe abrirse o cerrarse |
19
+
20
+ ## Card
21
+
22
+ | Prop | Tipo | Req. | Default | Descripción |
23
+ |---|---|---|---|---|
24
+ | `title` | `string \| React.ReactNode` | | — | |
25
+ | `subtitle` | `string \| React.ReactNode` | | — | |
26
+ | `children` | `React.ReactNode` | | — | |
27
+ | `className` | `string` | | `""` | |
28
+ | `headerActions` | `React.ReactNode` | | — | Acciones para el header de la tarjeta. Se muestra directamente el ReactNode proporcionado. |
29
+ | `footer` | `React.ReactNode` | | — | |
30
+ | `variant` | `"default" \| "elevated" \| "outlined"` | | `"default"` | |
31
+ | `alwaysDisplayHeaderActions` | `boolean` | | `false` | Si es true, las headerActions siempre se muestran. Si es false, solo se muestran al hacer hover (en pantallas grandes). En resoluciones md e inferiores, siempre se muestran sin importar este valor. |
32
+ | `headerClassName` | `string` | | `""` | |
33
+ | `contentClassName` | `string` | | `""` | |
34
+ | `footerClassName` | `string` | | `""` | |
35
+ | `compact` | `boolean` | | `false` | Override local de densidad: cuando es true, fuerza el preset "compact" para los paddings, gaps y tipografía DE ESTA CARD (y sus hijos que consuman las variables --flysoft-density-*), independientemente de la densidad global del ThemeProvider. |
36
+
37
+ ## Collection
38
+
39
+ | Prop | Tipo | Req. | Default | Descripción |
40
+ |---|---|---|---|---|
41
+ | `children` | `React.ReactNode` | **sí** | — | |
42
+ | `gap` | `"tight" \| "sm" \| "md" \| "lg" \| string (CollectionGap)` | | `"md"` | Tamaño del gap entre items. Acepta presets semánticos que respetan la densidad activa o cualquier valor CSS arbitrario (p. ej. "0.5rem", "8px"). - "tight" → 0 - "sm" → var(--flysoft-density-gap-sm) - "md" → var(--flysoft-density-gap-md) (default) - "lg" → var(--flysoft-density-gap-lg) |
43
+ | `direction` | `"column" \| "row"` | | `"column"` | |
44
+ | `wrap` | `boolean` | | `false` | |
45
+ | `className` | `string` | | `""` | |
46
+ | `density` | `"comfortable" \| "compact" \| "dense" (Density)` | | — | Override local de densidad: redefine las variables CSS --flysoft-density-* para esta Collection y sus descendientes. Útil para crear secciones densas dentro de un layout con densidad global "comfortable". |
47
+
48
+ ## Accordion
49
+
50
+ | Prop | Tipo | Req. | Default | Descripción |
51
+ |---|---|---|---|---|
52
+ | `title` | `string \| React.ReactNode` | **sí** | — | |
53
+ | `children` | `React.ReactNode` | **sí** | — | |
54
+ | `icon` | `string` | | — | |
55
+ | `rightNode` | `React.ReactNode` | | — | |
56
+ | `defaultOpen` | `boolean` | | `false` | |
57
+ | `className` | `string` | | `""` | |
58
+ | `headerClassName` | `string` | | `""` | Clases adicionales para el header (el botón que despliega/colapsa el acordeón). |
59
+ | `contentClassName` | `string` | | `""` | Clases adicionales para el contenedor del contenido (children). |
60
+ | `variant` | `"default" \| "elevated" \| "outlined"` | | `"default"` | |
61
+ | `onToggle` | `(isOpen: boolean) => void` | | — | |
62
+ | `compact` | `boolean` | | `false` | |
63
+
64
+ ## TabsGroup
65
+
66
+ | Prop | Tipo | Req. | Default | Descripción |
67
+ |---|---|---|---|---|
68
+ | `children` | `React.ReactNode` | | — | |
69
+ | `tabs` | `Tab[]` | **sí** | — | |
70
+ | `paramName` | `string` | | — | |
71
+ | `headerNode` | `React.ReactNode` | | — | |
72
+ | `onChangeTab` | `(selectedTab: string) => void` | | — | |
73
+ | `compact` | `boolean` | | `false` | |
74
+
75
+ ## TabPanel
76
+
77
+ | Prop | Tipo | Req. | Default | Descripción |
78
+ |---|---|---|---|---|
79
+ | `children` | `React.ReactNode` | | — | |
80
+ | `tabId` | `string \| number` | **sí** | — | |
81
+
82
+ ## Menu\<T\>
83
+
84
+ | Prop | Tipo | Req. | Default | Descripción |
85
+ |---|---|---|---|---|
86
+ | `options` | `T[]` | **sí** | — | |
87
+ | `onOptionSelected` | `(item: T) => void` | **sí** | — | |
88
+ | `getOptionLabel` | `(item: T) => string` | | — | Obtiene el label que se muestra para cada opción. Por defecto usa la propiedad "label". |
89
+ | `renderOption` | `(item: T) => React.ReactNode` | | — | Renderizado personalizado de cada opción. Si se define, se ignora el render por defecto. |
90
+ | `className` | `string` | | — | Clases adicionales para el contenedor del menú. Permite sobreescribir los estilos por defecto. |
91
+ | `style` | `React.CSSProperties` | | — | Estilos adicionales para el contenedor del menú. |
92
+ | `itemClassName` | `string` | | — | Clases adicionales para cada opción del menú. |
93
+ | `compact` | `boolean` | | `false` | |
94
+
95
+ ## DropdownMenu\<T\>
96
+
97
+ | Prop | Tipo | Req. | Default | Descripción |
98
+ |---|---|---|---|---|
99
+ | `options` | `T[]` | **sí** | — | |
100
+ | `onOptionSelected` | `(item: T) => void` | **sí** | — | |
101
+ | `renderNode` | `React.ReactNode` | | — | |
102
+ | `getOptionLabel` | `(item: T) => string` | | — | Obtiene el label que se muestra para cada opción. Por defecto usa la propiedad "label". |
103
+ | `renderOption` | `(item: T) => React.ReactNode` | | — | Renderizado personalizado de cada opción. Si se define, se ignora el render por defecto. |
104
+ | `replaceOnSingleOption` | `boolean` | | `false` | Si es true y hay una sola opción, muestra directamente la opción en lugar del trigger. Por defecto es false. |
105
+ | `openOnHover` | `boolean` | | `false` | Si es true, el menú se abre al pasar el mouse por encima. Por defecto es false. |
106
+ | `compact` | `boolean` | | `false` | |
107
+
108
+ ## DropdownPanel
109
+
110
+ | Prop | Tipo | Req. | Default | Descripción |
111
+ |---|---|---|---|---|
112
+ | `renderNode` | `React.ReactNode` | | — | |
113
+ | `children` | `React.ReactNode` | **sí** | — | |
114
+ | `openOnHover` | `boolean` | | `false` | Si es true, el panel se abre al pasar el mouse por encima. Por defecto es false. |
115
+ | `compact` | `boolean` | | `false` | |
116
+
117
+ ## Filter
118
+
119
+ **Props base** (comunes a todas las variantes):
120
+
121
+ | Prop | Tipo | Req. | Default | Descripción |
122
+ |---|---|---|---|---|
123
+ | `paramName` | `string` | | — | |
124
+ | `label` | `string` | | — | |
125
+ | `staticOptions` | `StaticOption[]` | | — | |
126
+ | `inputWidth` | `string` | | — | |
127
+ | `value` | `string` | | — | |
128
+ | `onChange` | `(value: string \| undefined) => void` | | — | |
129
+ | `hideEmpty` | `boolean` | | — | Si es true, el componente solo se renderiza si tiene un valor o existe el queryParam asociado con un valor. Por defecto es false. |
130
+ | `disabled` | `boolean` | | — | Si es true, el componente se muestra con opacidad y no permite interacciones. Si el panel está abierto, se cerrará automáticamente. |
131
+ | `compact` | `boolean` | | — | |
132
+ | `bgColor` | `string` | | — | Color de fondo del filtro (badge e input interno). Útil cuando el filtro se coloca sobre una superficie del mismo color que el fondo por defecto (por ej. dentro de una Card blanca). Acepta cualquier valor CSS de color o una variable del tema, p. ej. `"#f5f5f5"` o `"var(--color-bg-secondary)"`. El panel flotante mantiene el fondo por defecto (es un popover). |
133
+
134
+ Después, según `filterType` — la unión es discriminada, así que el tipo exige las props de su variante:
135
+
136
+ **`filterType: "text"`**
137
+
138
+ Sólo las props base.
139
+
140
+ **`filterType: "number"`**
141
+
142
+ | Prop | Tipo | Req. | Default | Descripción |
143
+ |---|---|---|---|---|
144
+ | `min` | `number` | | — | |
145
+ | `max` | `number` | | — | |
146
+
147
+ **`filterType: "date"`**
148
+
149
+ Sólo las props base.
150
+
151
+ **`filterType: "autocomplete"`**
152
+
153
+ | Prop | Tipo | Req. | Default | Descripción |
154
+ |---|---|---|---|---|
155
+ | `options` | `T[]` | **sí** | — | |
156
+ | `getOptionLabel` | `(item: T) => string` | | — | |
157
+ | `getOptionValue` | `(item: T) => K` | | — | |
158
+ | `renderOption` | `(item: T) => React.ReactNode` | | — | |
159
+ | `noResultsText` | `string` | | — | |
160
+ | `multiple` | `boolean` | | — | |
161
+
162
+ **`filterType: "search"`**
163
+
164
+ Sólo las props base.
165
+
166
+ **`filterType: "searchSelect"`**
167
+
168
+ | Prop | Tipo | Req. | Default | Descripción |
169
+ |---|---|---|---|---|
170
+ | `onSearchPromiseFn` | `(text: string) => Promise<Array<T> \| PaginationInterface<T>>` | **sí** | — | |
171
+ | `onSingleSearchPromiseFn` | `(value: K) => Promise<T \| undefined>` | **sí** | — | |
172
+ | `getOptionLabel` | `(item: T) => string` | | — | |
173
+ | `getOptionValue` | `(item: T) => K` | | — | |
174
+ | `renderOption` | `(item: T) => React.ReactNode` | | — | |
175
+ | `dialogTitle` | `string` | | — | |
176
+ | `noResultsText` | `string` | | — | |
177
+
178
+ ## FiltersDialog
179
+
180
+ | Prop | Tipo | Req. | Default | Descripción |
181
+ |---|---|---|---|---|
182
+ | `filters` | `FilterConfig[]` | **sí** | — | |
183
+
184
+ ## Dialog
185
+
186
+ | Prop | Tipo | Req. | Default | Descripción |
187
+ |---|---|---|---|---|
188
+ | `isOpen` | `boolean` | **sí** | — | |
189
+ | `title` | `React.ReactNode` | **sí** | — | |
190
+ | `children` | `React.ReactNode` | **sí** | — | |
191
+ | `footer` | `React.ReactNode` | | — | |
192
+ | `onClose` | `() => void` | | — | |
193
+ | `closeOnOverlayClick` | `boolean` | | `false` | |
194
+ | `compact` | `boolean` | | `false` | |
195
+ | `bodyWidth` | `string \| number` | | — | |
196
+
197
+ ## Snackbar
198
+
199
+ | Prop | Tipo | Req. | Default | Descripción |
200
+ |---|---|---|---|---|
201
+ | `id` | `string` | **sí** | — | |
202
+ | `message` | `string` | **sí** | — | |
203
+ | `variant` | `\| "primary" \| "secondary" \| "success" \| "warning" \| "danger" \| "info" (SnackbarVariant)` | **sí** | — | |
204
+ | `duration` | `number` | | `3000` | |
205
+ | `icon` | `string` | | — | |
206
+ | `iconLabel` | `string` | | — | |
207
+ | `onClose` | `(id: string) => void` | **sí** | — | |
208
+
209
+ ## SnackbarContainer
210
+
211
+ | Prop | Tipo | Req. | Default | Descripción |
212
+ |---|---|---|---|---|
213
+ | `position` | `\| "top-right" \| "top-left" \| "bottom-right" \| "bottom-left" \| "top-center" \| "bottom-center"` | | `"top-right"` | |
214
+ | `maxSnackbars` | `number` | | `5` | |
215
+
216
+ ## Tipos auxiliares
217
+
218
+ ### `FilterConfig`
219
+
220
+ | Prop | Tipo | Req. | Default | Descripción |
221
+ |---|---|---|---|---|
222
+ | `filterType` | `FilterProps["filterType"]` | **sí** | — | |
223
+ | `paramName` | `string` | **sí** | — | |
224
+ | `label` | `string` | | — | |
225
+ | `staticOptions` | `FilterProps["staticOptions"]` | | — | |
226
+ | `inputWidth` | `string` | | — | |
227
+ | `min` | `number` | | — | |
228
+ | `max` | `number` | | — | |
229
+ | `options` | `any[]` | | — | |
230
+ | `getOptionLabel` | `(item: any) => string` | | — | |
231
+ | `getOptionValue` | `(item: any) => any` | | — | |
232
+ | `renderOption` | `(item: any) => React.ReactNode` | | — | |
233
+ | `noResultsText` | `string` | | — | |
234
+
235
+ ### `LeftDrawerInterface`
236
+
237
+ | Prop | Tipo | Req. | Default | Descripción |
238
+ |---|---|---|---|---|
239
+ | `headerNode` | `ReactNode` | | — | |
240
+ | `contentNode` | `ReactNode` | | — | |
241
+ | `footerNode` | `ReactNode` | | — | |
242
+ | `className` | `string` | | — | Clases del contenedor del drawer (header, contenido y footer). |
243
+ | `width` | `string` | | `"16rem"` | Ancho del drawer. Pisa cualquier clase de ancho que venga en `className`. Si no se pasa, el drawer usa la clase `w-64`. |
244
+
245
+ ### `NavbarInterface`
246
+
247
+ | Prop | Tipo | Req. | Default | Descripción |
248
+ |---|---|---|---|---|
249
+ | `navBarLeftNode` | `string \| ReactNode` | | — | |
250
+ | `navBarRightNode` | `string \| ReactNode` | | — | |
251
+ | `fullWidthNavbar` | `boolean` | **sí** | — | |
252
+ | `height` | `string` | | `"64px"` | Altura del navbar. |
253
+ | `className` | `string` | | — | Clases del contenedor del navbar (incluye el botón). |
254
+
255
+ ### `Tab`
256
+
257
+ | Prop | Tipo | Req. | Default | Descripción |
258
+ |---|---|---|---|---|
259
+ | `id` | `string \| number` | **sí** | — | |
260
+ | `label` | `string` | **sí** | — | |