@dipusevilla/componentes-iu 1.0.8

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.
Files changed (45) hide show
  1. package/README.md +93 -0
  2. package/dist/index.cjs.js +54 -0
  3. package/dist/index.css +1 -0
  4. package/dist/index.es.js +6148 -0
  5. package/dist/index.umd.js +55 -0
  6. package/dist/types/components/Button.d.ts +15 -0
  7. package/dist/types/components/Checkbox.d.ts +18 -0
  8. package/dist/types/components/CollapsibleSection.d.ts +8 -0
  9. package/dist/types/components/DateInput.d.ts +22 -0
  10. package/dist/types/components/DropdownMenu.d.ts +14 -0
  11. package/dist/types/components/FileUploader.d.ts +20 -0
  12. package/dist/types/components/FormFieldInput.d.ts +22 -0
  13. package/dist/types/components/FormPageLayout.d.ts +13 -0
  14. package/dist/types/components/FormRenderer.d.ts +5 -0
  15. package/dist/types/components/Header.d.ts +21 -0
  16. package/dist/types/components/Icon.d.ts +11 -0
  17. package/dist/types/components/IconButton.d.ts +18 -0
  18. package/dist/types/components/InfoButton.d.ts +12 -0
  19. package/dist/types/components/Input.d.ts +30 -0
  20. package/dist/types/components/InputGroup.d.ts +21 -0
  21. package/dist/types/components/LoadingScreen.d.ts +8 -0
  22. package/dist/types/components/Modal.d.ts +10 -0
  23. package/dist/types/components/OptionGroup.d.ts +26 -0
  24. package/dist/types/components/PageLayout.d.ts +13 -0
  25. package/dist/types/components/Select.d.ts +33 -0
  26. package/dist/types/components/Sidebar.d.ts +23 -0
  27. package/dist/types/components/SidebarNav.d.ts +15 -0
  28. package/dist/types/components/SkeletonLoader.d.ts +28 -0
  29. package/dist/types/components/Table.d.ts +29 -0
  30. package/dist/types/components/Tabs.d.ts +12 -0
  31. package/dist/types/components/TextArea.d.ts +20 -0
  32. package/dist/types/components/ThemeToggle.d.ts +7 -0
  33. package/dist/types/components/Toast.d.ts +10 -0
  34. package/dist/types/components/ToastContainer.d.ts +10 -0
  35. package/dist/types/components/ToggleSwitch.d.ts +18 -0
  36. package/dist/types/hooks/useAsyncSelectOptions.d.ts +6 -0
  37. package/dist/types/hooks/useDisabledMap.d.ts +10 -0
  38. package/dist/types/hooks/useDynamicYupSchema.d.ts +16 -0
  39. package/dist/types/hooks/useFieldsMap.d.ts +2 -0
  40. package/dist/types/index.d.ts +58 -0
  41. package/dist/types/theme/ThemeProvider.d.ts +11 -0
  42. package/dist/types/types/FormTypes.d.ts +187 -0
  43. package/dist/types/utils/scrollToFirstError.d.ts +1 -0
  44. package/dist/vite.svg +1 -0
  45. package/package.json +94 -0
@@ -0,0 +1,20 @@
1
+ import type { Control } from 'react-hook-form';
2
+ type Size = 'sm' | 'md' | 'lg';
3
+ export interface FileUploaderProps {
4
+ control?: Control<any>;
5
+ name?: string;
6
+ rules?: any;
7
+ defaultValue?: FileList | File[];
8
+ maxFiles?: number;
9
+ accept?: string;
10
+ size?: Size;
11
+ width?: string;
12
+ label?: string;
13
+ labelHidden?: boolean;
14
+ disabled?: boolean;
15
+ hasError?: boolean;
16
+ errorMessage?: string;
17
+ className?: string;
18
+ }
19
+ export declare function FileUploader(props: FileUploaderProps): import("react/jsx-runtime").JSX.Element;
20
+ export {};
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ import { type FieldValues, type RegisterOptions } from "react-hook-form";
3
+ import type { InputType } from "./Input";
4
+ export interface FormFieldInputProps {
5
+ name: string;
6
+ label?: string;
7
+ type?: InputType;
8
+ size?: "sm" | "md" | "lg";
9
+ width?: string;
10
+ placeholder?: string;
11
+ validation?: RegisterOptions<FieldValues, string>;
12
+ loadingDefaults: boolean;
13
+ disabled: boolean;
14
+ info?: React.ReactNode;
15
+ showTime?: boolean;
16
+ suffixButton?: React.ReactNode;
17
+ hasError?: boolean;
18
+ errorMessage?: string;
19
+ }
20
+ declare function FormFieldInputComponent({ name, label, type, size, width, placeholder, validation, loadingDefaults, disabled, info }: FormFieldInputProps): import("react/jsx-runtime").JSX.Element;
21
+ export declare const FormFieldInput: React.MemoExoticComponent<typeof FormFieldInputComponent>;
22
+ export {};
@@ -0,0 +1,13 @@
1
+ import { type ReactNode } from 'react';
2
+ export interface FormPageLayoutProps {
3
+ title: string;
4
+ /** Botones a la derecha del header */
5
+ headerButtons?: ReactNode;
6
+ /** Contenido principal (formulario) */
7
+ children: ReactNode;
8
+ /** Botones del footer, centrados */
9
+ footerButtons?: ReactNode;
10
+ /** Clase extra para el wrapper */
11
+ className?: string;
12
+ }
13
+ export declare function FormPageLayout({ title, headerButtons, children, className, }: FormPageLayoutProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import type { FieldSchema, FormSchema } from "../types/FormTypes";
2
+ export declare function FormRenderer({ schema }: {
3
+ schema: FormSchema;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ export { FieldSchema };
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import type { Option } from './Select';
3
+ export interface PinnedPage {
4
+ id: string;
5
+ label?: string;
6
+ href: string;
7
+ }
8
+ export interface HeaderProps {
9
+ pinnedPages: PinnedPage[];
10
+ onRemovePinned: (id: string) => void;
11
+ onBack: () => void;
12
+ dark: boolean;
13
+ locale: string;
14
+ languageOptions: Option[];
15
+ onChangeLocale: (value: string) => void;
16
+ profile: string;
17
+ profileOptions: Option[];
18
+ onChangeProfile: (value: string) => void;
19
+ }
20
+ export declare const Header: React.FC<HeaderProps>;
21
+ export default Header;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ export type IconSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';
3
+ export interface IconProps extends React.SVGProps<SVGSVGElement> {
4
+ /** Componente SVG (p.ej. un HeroIcon) */
5
+ component: React.FC<React.SVGProps<SVGSVGElement>>;
6
+ /** Tamaño del icono */
7
+ size?: IconSize;
8
+ /** Clases extra de Tailwind para color, margin, etc. */
9
+ className?: string;
10
+ }
11
+ export declare function Icon({ component: Component, size, className, ...svgProps }: IconProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import React, { type ButtonHTMLAttributes } from 'react';
2
+ /**
3
+ * Botón solo con icono, circular, sin padding interno, con margen y pulso en hover.
4
+ * Usa una variante ghost (fondo transparente).
5
+ */
6
+ export interface IconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
7
+ /** Componente SVG a renderizar */
8
+ icon: React.FC<React.SVGProps<SVGSVGElement>>;
9
+ /** Tamaño del botón: sm (2rem), md (2.5rem), lg (3rem) */
10
+ size?: 'sm' | 'md' | 'lg';
11
+ /** Margen externo (reemplaza padding interno) */
12
+ margin?: string;
13
+ /** Etiqueta accesible para el botón */
14
+ ariaLabel: string;
15
+ disabled?: boolean;
16
+ onClick?: () => void;
17
+ }
18
+ export declare function IconButton({ icon: IconComponent, size, ariaLabel, disabled, onClick, ...rest }: IconButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { type FC, type ReactNode } from 'react';
2
+ export interface InfoButtonProps {
3
+ /** Contenido que se muestra en el tooltip. Puede ser texto plano, JSX o cadena HTML */
4
+ children: ReactNode;
5
+ /** Tamaño del icono: sm, md, lg */
6
+ size?: 'sm' | 'md' | 'lg';
7
+ /** Posición del tooltip */
8
+ position?: 'top' | 'right' | 'bottom' | 'left';
9
+ /** Clases extra para el contenedor padre */
10
+ className?: string;
11
+ }
12
+ export declare const InfoButton: FC<InfoButtonProps>;
@@ -0,0 +1,30 @@
1
+ import React, { type InputHTMLAttributes } from "react";
2
+ import type { Control, FieldValues, RegisterOptions, FieldPath } from "react-hook-form";
3
+ export type InputType = "text" | "number" | "email" | "password" | "tel" | "url";
4
+ type Size = "sm" | "md" | "lg";
5
+ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "name" | "defaultValue"> {
6
+ /** Props de estilo y funcionalidad */
7
+ type?: InputType;
8
+ size?: Size;
9
+ width?: string;
10
+ label?: string;
11
+ labelHidden?: boolean;
12
+ hasError?: boolean;
13
+ errorMessage?: string;
14
+ prefixIcon?: React.FC<React.SVGProps<SVGSVGElement>>;
15
+ suffixIcon?: React.FC<React.SVGProps<SVGSVGElement>>;
16
+ separator?: React.ReactNode;
17
+ suffixButton?: React.ReactNode;
18
+ disabled?: boolean;
19
+ /** Props de React Hook Form */
20
+ control?: Control<any>;
21
+ name?: FieldPath<FieldValues>;
22
+ rules?: RegisterOptions<FieldValues, FieldPath<FieldValues>>;
23
+ defaultValue?: unknown;
24
+ }
25
+ export declare function Input({ id, type, size, width, label, labelHidden, hasError, errorMessage, prefixIcon, suffixIcon, separator, suffixButton, disabled,
26
+ /** Props RHF */
27
+ control, name, rules, defaultValue, loading, className, ...props }: InputProps & {
28
+ loading?: boolean;
29
+ }): import("react/jsx-runtime").JSX.Element;
30
+ export {};
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import type { InputProps } from './Input';
3
+ export interface InputGroupProps {
4
+ /** Título accesible para todo el grupo (se renderiza con sr-only) */
5
+ groupLabel: string;
6
+ /** Array de props para cada <Input> (incluye su label original) */
7
+ inputs: Array<InputProps & {
8
+ width?: string;
9
+ }>;
10
+ /** Separador (por defecto “/”) */
11
+ separator?: React.ReactNode;
12
+ /** Si no quieres separadores, pásalo a false */
13
+ useSeparator?: boolean;
14
+ /** Clase extra para el contenedor flex */
15
+ className?: string;
16
+ /** Si quieres que el label sea visible, pásalo a true */
17
+ showVisibleLabel?: boolean;
18
+ size?: Size;
19
+ }
20
+ export type Size = "sm" | "md" | "lg";
21
+ export declare function InputGroup({ groupLabel, inputs, separator, useSeparator, className, showVisibleLabel, size, }: InputGroupProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export interface LoadingScreenProps {
3
+ /** Controla la visibilidad del overlay */
4
+ loading?: boolean;
5
+ /** Texto alternativo para lectores de pantalla */
6
+ ariaLabel?: string;
7
+ }
8
+ export declare const LoadingScreen: React.FC<LoadingScreenProps>;
@@ -0,0 +1,10 @@
1
+ import React, { type ReactNode } from 'react';
2
+ export interface ModalProps {
3
+ isOpen: boolean;
4
+ onClose: () => void;
5
+ title?: string;
6
+ children: ReactNode;
7
+ footer?: ReactNode;
8
+ }
9
+ export declare const Modal: React.FC<ModalProps>;
10
+ export default Modal;
@@ -0,0 +1,26 @@
1
+ import type { Control } from 'react-hook-form';
2
+ export type Option = {
3
+ label?: string;
4
+ value: string | number;
5
+ };
6
+ type Size = 'sm' | 'md' | 'lg';
7
+ export interface OptionGroupProps {
8
+ /** Etiqueta accesible y/o visible para todo el grupo */
9
+ groupLabel?: string;
10
+ /** Array de opciones a renderizar */
11
+ options: Option[];
12
+ control: Control<any>;
13
+ name: string;
14
+ rules?: any;
15
+ defaultValue?: any;
16
+ /** Múltiple (checkbox) o simple (radio) */
17
+ multiple?: boolean;
18
+ size?: Size;
19
+ /** Disposición vertical (columna) u horizontal (fila) */
20
+ vertical?: boolean;
21
+ className?: string;
22
+ /** Mostrar la etiqueta en pantalla (además de sr-only) */
23
+ showVisibleLabel?: boolean;
24
+ }
25
+ export declare function OptionGroup({ groupLabel, options, control, name, rules, defaultValue, multiple, size, vertical, className, showVisibleLabel, }: OptionGroupProps): import("react/jsx-runtime").JSX.Element;
26
+ export {};
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { type SidebarProps } from './Sidebar';
3
+ import { type HeaderProps } from './Header';
4
+ export interface PageLayoutProps {
5
+ /** Props para el Sidebar */
6
+ sidebar: Pick<SidebarProps, 'appName' | 'orgName' | 'username' | 'footerText' | 'navItems' | 'selectedNav' | 'onSelectNav' | 'width'>;
7
+ /** Props para el Header */
8
+ header: Pick<HeaderProps, 'pinnedPages' | 'onRemovePinned' | 'onBack' | 'dark' | 'locale' | 'languageOptions' | 'onChangeLocale' | 'profile' | 'profileOptions' | 'onChangeProfile'>;
9
+ /** Contenido principal (renderizado por tu router o componentes hijos) */
10
+ children: React.ReactNode;
11
+ }
12
+ export declare function PageLayout({ sidebar, header, children }: PageLayoutProps): import("react/jsx-runtime").JSX.Element;
13
+ export default PageLayout;
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import type { Control } from 'react-hook-form';
3
+ export type Option = {
4
+ label: string;
5
+ value: string | number;
6
+ };
7
+ type Size = 'sm' | 'md' | 'lg';
8
+ export interface SelectProps {
9
+ control?: Control<any>;
10
+ name?: string;
11
+ rules?: any;
12
+ defaultValue?: any;
13
+ /** Opciones sincrónicas */
14
+ options?: Option[];
15
+ /** Función asíncrona para cargar opciones */
16
+ loadOptions?: () => Promise<Option[]>;
17
+ value?: string | number;
18
+ onChange?: (value: any) => void;
19
+ size?: Size;
20
+ width?: string;
21
+ label?: string;
22
+ labelHidden?: boolean;
23
+ hasError?: boolean;
24
+ errorMessage?: string;
25
+ /** Si true, no reserva espacio para el placeholder de error */
26
+ disableErrorPlaceholder?: boolean;
27
+ disabled?: boolean;
28
+ className?: string;
29
+ /** Botón que se renderiza al final del select */
30
+ suffixButton?: React.ReactNode;
31
+ }
32
+ export declare function Select(props: SelectProps): import("react/jsx-runtime").JSX.Element;
33
+ export {};
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import type { NavItem } from './SidebarNav';
3
+ export type { NavItem };
4
+ export interface SidebarProps {
5
+ /** Nombre de la aplicación */
6
+ appName: string;
7
+ /** Nombre del organismo */
8
+ orgName: string;
9
+ /** Nombre del usuario (parte superior) */
10
+ username: string;
11
+ /** Texto del footer (p. ej. email) */
12
+ footerText: string;
13
+ /** Items de navegación (hasta 3 niveles) */
14
+ navItems: NavItem[];
15
+ /** Valor seleccionado actualmente */
16
+ selectedNav?: string;
17
+ /** Callback al seleccionar un item */
18
+ onSelectNav: (value: string) => void;
19
+ /** Ancho de la sidebar */
20
+ width?: string;
21
+ }
22
+ export declare const Sidebar: React.FC<SidebarProps>;
23
+ export default Sidebar;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ export interface NavItem {
3
+ label?: string;
4
+ value: string;
5
+ icon?: React.FC<React.SVGProps<SVGSVGElement>>;
6
+ children?: NavItem[];
7
+ }
8
+ export interface SidebarNavProps {
9
+ items: NavItem[];
10
+ selected?: string;
11
+ onSelect: (value: string) => void;
12
+ level?: number;
13
+ }
14
+ export declare const SidebarNav: React.FC<SidebarNavProps>;
15
+ export default SidebarNav;
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ export interface SkeletonProps {
3
+ /** Número de bloques animados */
4
+ count?: number;
5
+ /** Ancho CSS del placeholder (p.ej. "4ch", "200px"). Por defecto auto. */
6
+ width?: string;
7
+ /** Alto CSS del placeholder (p.ej. "1em", "1.5rem") */
8
+ height?: string;
9
+ /** Forma: "rect" = rectángulo, "circle" = círculo */
10
+ variant?: 'rect' | 'circle';
11
+ /** Clases extra de Tailwind */
12
+ className?: string;
13
+ }
14
+ /**
15
+ * SkeletonLoader genera uno o varios bloques animados tipo “pulse” como placeholder.
16
+ *
17
+ * - Por defecto ocupa sólo lo que necesite (auto width).
18
+ * - Si quieres que ocupe más, pásale `width="100%"`, `width="8ch"`, etc.
19
+ *
20
+ * Ejemplos:
21
+ * ```tsx
22
+ * <SkeletonLoader /> // un bloque auto width, height 1em
23
+ * <SkeletonLoader count={3} width="4ch" height="1em" />
24
+ * <SkeletonLoader width="100%" height="1.5rem" />
25
+ * <SkeletonLoader variant="circle" width="2rem" height="2rem" />
26
+ * ```
27
+ */
28
+ export declare const SkeletonLoader: React.FC<SkeletonProps>;
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ export type Column<T> = {
3
+ header: string;
4
+ accessor: keyof T | ((row: T) => React.ReactNode);
5
+ sortable?: boolean;
6
+ sortKey?: keyof T;
7
+ render?: (row: T) => React.ReactNode;
8
+ width?: string;
9
+ };
10
+ export interface TableProps<T extends {
11
+ [key: string]: any;
12
+ }> {
13
+ columns: Column<T>[];
14
+ data?: T[];
15
+ loadData?: () => Promise<T[]>;
16
+ idAccessor: keyof T;
17
+ multiSelect?: boolean;
18
+ onSelectionChange?: (rows: T[]) => void;
19
+ pageSize?: number;
20
+ initialSort?: {
21
+ sortBy: keyof T;
22
+ sortDir: 'asc' | 'desc';
23
+ };
24
+ onSort?: (sortBy: keyof T, sortDir: 'asc' | 'desc') => void;
25
+ className?: string;
26
+ }
27
+ export declare function Table<T extends {
28
+ [key: string]: any;
29
+ }>({ columns, data, loadData, idAccessor, multiSelect, onSelectionChange, pageSize, initialSort, onSort, className, }: TableProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { type ReactNode } from 'react';
2
+ export type TabOption<T extends string | number> = {
3
+ label?: string;
4
+ value: T;
5
+ };
6
+ export interface TabsProps<T extends string | number> {
7
+ options: TabOption<T>[];
8
+ value: T;
9
+ onChange: (value: T) => void;
10
+ children: Record<T, ReactNode>;
11
+ }
12
+ export declare function Tabs<T extends string | number>({ options, value, onChange, children, }: TabsProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { type TextareaHTMLAttributes } from 'react';
2
+ import type { Control } from 'react-hook-form';
3
+ type Size = 'sm' | 'md' | 'lg';
4
+ export interface TextAreaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'size' | 'name' | 'defaultValue'> {
5
+ control?: Control<any>;
6
+ name?: string;
7
+ rules?: any;
8
+ defaultValue?: string;
9
+ size?: Size;
10
+ width?: string;
11
+ label?: string;
12
+ labelHidden?: boolean;
13
+ hasError?: boolean;
14
+ errorMessage?: string;
15
+ maxLength?: number;
16
+ showCounter?: boolean;
17
+ className?: string;
18
+ }
19
+ export declare function TextArea({ control, name, rules, defaultValue, size, width, label, labelHidden, hasError, errorMessage, maxLength, showCounter, className, ...props }: TextAreaProps): import("react/jsx-runtime").JSX.Element;
20
+ export {};
@@ -0,0 +1,7 @@
1
+ export type ThemeToggleProps = {
2
+ /** `true` = dark mode, `false` = light mode */
3
+ dark: boolean;
4
+ /** Toggle handler */
5
+ onToggle: () => void;
6
+ };
7
+ export declare function ThemeToggle({ dark, onToggle }: ThemeToggleProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ export type ToastVariant = 'success' | 'error' | 'info' | 'warning';
3
+ export interface ToastProps {
4
+ id: string;
5
+ message: string;
6
+ variant?: ToastVariant;
7
+ duration?: number;
8
+ onClose: (id: string) => void;
9
+ }
10
+ export declare const Toast: React.FC<ToastProps>;
@@ -0,0 +1,10 @@
1
+ import React, { type ReactNode } from 'react';
2
+ import type { ToastVariant } from './Toast';
3
+ interface ToastContextValue {
4
+ show: (message: string, variant?: ToastVariant, duration?: number) => void;
5
+ }
6
+ export declare const useToast: () => ToastContextValue;
7
+ export declare const ToastProvider: React.FC<{
8
+ children: ReactNode;
9
+ }>;
10
+ export {};
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import type { Control } from 'react-hook-form';
3
+ export interface ToggleSwitchProps {
4
+ control?: Control<any>;
5
+ name?: string;
6
+ rules?: any;
7
+ defaultValue?: boolean;
8
+ checked?: boolean;
9
+ onChange?: (val: boolean) => void;
10
+ disabled?: boolean;
11
+ /** Texto de la label */
12
+ label?: React.ReactNode;
13
+ /** Posición de la label: 'left' o 'right' */
14
+ labelPosition?: 'left' | 'right';
15
+ errorMessage?: string;
16
+ className?: string;
17
+ }
18
+ export declare function ToggleSwitch({ control, name, rules, defaultValue, checked, onChange, disabled, label, labelPosition, errorMessage, className, }: ToggleSwitchProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { FieldSchema } from "../components/FormRenderer";
2
+ import type { Option } from "../components/Select";
3
+ export declare function useAsyncSelectOptions(fields: FieldSchema[]): {
4
+ loadingCount: number;
5
+ optionsMap: Record<string, Option[]>;
6
+ };
@@ -0,0 +1,10 @@
1
+ import { type Control, type FieldValues } from "react-hook-form";
2
+ import type { FieldSchema } from "../components/FormRenderer";
3
+ type DisabledMap = Record<string, boolean>;
4
+ /**
5
+ * Para cada FieldSchema que tenga `disabledWhen`, comprueba con useWatch
6
+ * el valor actual del campo `watchField`, y si coincide con `watchValue`,
7
+ * marca ese campo como deshabilitado (true). Devuelve un map { [fieldName]: boolean }.
8
+ */
9
+ export declare function useDisabledMap(fields: FieldSchema[], control: Control<FieldValues>): DisabledMap;
10
+ export {};
@@ -0,0 +1,16 @@
1
+ import type { ObjectSchema } from "yup";
2
+ import type { FieldSchema } from "../components/FormRenderer";
3
+ interface UseDynamicParams {
4
+ fields: FieldSchema[];
5
+ explicitSchema?: ObjectSchema<any>;
6
+ }
7
+ /**
8
+ * Si explicitSchema está definido, lo usa directamente.
9
+ * Si no, construye dinámicamente un esquema Yup a partir de `fields`.
10
+ */
11
+ export declare function useDynamicYupSchema({ fields, explicitSchema, }: UseDynamicParams): import("react-hook-form").Resolver<any, unknown, any> | import("react-hook-form").Resolver<{
12
+ [x: string]: any;
13
+ }, unknown, {
14
+ [x: string]: any;
15
+ }>;
16
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { FieldSchema } from "../components/FormRenderer";
2
+ export declare function useFieldsMap(fields: FieldSchema[]): Record<string, FieldSchema>;
@@ -0,0 +1,58 @@
1
+ export { Button } from './components/Button';
2
+ export type { ButtonProps } from './components/Button';
3
+ export { CollapsibleSection } from './components/CollapsibleSection';
4
+ export type { CollapsibleSectionProps } from './components/CollapsibleSection';
5
+ export { DateInput } from './components/DateInput';
6
+ export type { DateInputProps } from './components/DateInput';
7
+ export { DropdownMenu } from './components/DropdownMenu';
8
+ export type { DropdownMenuProps, DropdownItem } from './components/DropdownMenu';
9
+ export { FileUploader } from './components/FileUploader';
10
+ export type { FileUploaderProps } from './components/FileUploader';
11
+ export { FormFieldInput } from './components/FormFieldInput';
12
+ export type { FormFieldInputProps } from './components/FormFieldInput';
13
+ export { FormPageLayout } from './components/FormPageLayout';
14
+ export type { FormPageLayoutProps } from './components/FormPageLayout';
15
+ export { FormRenderer } from './components/FormRenderer';
16
+ export { Header } from './components/Header';
17
+ export type { HeaderProps } from './components/Header';
18
+ export { Icon } from './components/Icon';
19
+ export type { IconProps, IconSize } from './components/Icon';
20
+ export { IconButton } from './components/IconButton';
21
+ export type { IconButtonProps } from './components/IconButton';
22
+ export { InfoButton } from './components/InfoButton';
23
+ export type { InfoButtonProps } from './components/InfoButton';
24
+ export { Input } from './components/Input';
25
+ export type { InputProps, InputType } from './components/Input';
26
+ export { InputGroup } from './components/InputGroup';
27
+ export type { InputGroupProps } from './components/InputGroup';
28
+ export { LoadingScreen } from './components/LoadingScreen';
29
+ export type { LoadingScreenProps } from './components/LoadingScreen';
30
+ export { Modal } from './components/Modal';
31
+ export type { ModalProps } from './components/Modal';
32
+ export { OptionGroup } from './components/OptionGroup';
33
+ export type { OptionGroupProps } from './components/OptionGroup';
34
+ export { PageLayout } from './components/PageLayout';
35
+ export type { PageLayoutProps } from './components/PageLayout';
36
+ export { Select } from './components/Select';
37
+ export type { Option, SelectProps } from './components/Select';
38
+ export { Sidebar } from './components/Sidebar';
39
+ export type { SidebarProps } from './components/Sidebar';
40
+ export { SidebarNav } from './components/SidebarNav';
41
+ export type { NavItem, SidebarNavProps } from './components/SidebarNav';
42
+ export { SkeletonLoader } from './components/SkeletonLoader';
43
+ export type { SkeletonProps } from './components/SkeletonLoader';
44
+ export { Table } from './components/Table';
45
+ export type { Column, TableProps } from './components/Table';
46
+ export { Tabs } from './components/Tabs';
47
+ export type { TabOption, TabsProps } from './components/Tabs';
48
+ export { TextArea } from './components/TextArea';
49
+ export type { TextAreaProps } from './components/TextArea';
50
+ export { ThemeToggle } from './components/ThemeToggle';
51
+ export type { ThemeToggleProps } from './components/ThemeToggle';
52
+ export { ThemeProvider } from './theme/ThemeProvider';
53
+ export { Toast } from './components/Toast';
54
+ export type { ToastProps, ToastVariant } from './components/Toast';
55
+ export { ToastProvider, useToast } from './components/ToastContainer';
56
+ export { ToggleSwitch } from './components/ToggleSwitch';
57
+ export type { ToggleSwitchProps } from './components/ToggleSwitch';
58
+ import './styles/index.css';
@@ -0,0 +1,11 @@
1
+ import { ReactNode } from 'react';
2
+ type Theme = 'light' | 'dark';
3
+ interface ThemeContextValue {
4
+ theme: Theme;
5
+ toggle: () => void;
6
+ }
7
+ export declare function ThemeProvider({ children }: {
8
+ children: ReactNode;
9
+ }): import("react/jsx-runtime").JSX.Element | null;
10
+ export declare const useTheme: () => ThemeContextValue;
11
+ export {};