import { CommonProps, type Styleable } from "@trackunit/react-components"; import { MouseEventHandler, ReactNode } from "react"; interface ModalFooterBuiltInProps extends CommonProps, Styleable { children?: null | undefined; /** * Click handler for the Cancel button. */ onCancel: () => void; /** * Text for the Primary action button. * When omitted, the Primary button is not rendered. */ primaryLabel?: string | null; /** * Visual variant for the Primary button. * Defaults to "primary". */ primaryVariant?: "primary" | "primary-danger"; /** * Click handler for the Primary action button. */ primaryAction?: MouseEventHandler; /** * Loading state for the Primary button. * Defaults to false. */ primaryLoading?: boolean; /** * Disabled state for the Primary button. * Defaults to false. * Note: the Primary button is also disabled while `secondaryLoading` is true. */ primaryDisabled?: boolean; /** Optional form id to bind the Primary button to an external form */ primaryFormId?: string; /** * Text for the Secondary action button. * The Secondary button is rendered only if both secondaryLabel and secondaryAction are provided. */ secondaryLabel?: string | null; /** * Click handler for the Secondary action button. */ secondaryAction?: () => void; /** * Visual variant for the Secondary button. * Defaults to "secondary". */ secondaryVariant?: "secondary" | "secondary-danger"; /** * Loading state for the Secondary button. * Defaults to false. */ secondaryLoading?: boolean; /** * Disabled state for the Secondary button. * Defaults to false. * Note: the Secondary button is also disabled while `primaryLoading` is true. */ secondaryDisabled?: boolean; /** * Text for the Cancel button. */ cancelLabel: string; primaryName?: string; secondaryName?: string; cancelName?: string; } interface ModalFooterCustomProps extends CommonProps, Styleable { children: ReactNode; onCancel?: never; cancelLabel?: never; primaryLabel?: never; primaryVariant?: never; primaryAction?: never; primaryLoading?: never; primaryDisabled?: never; primaryFormId?: never; secondaryLabel?: never; secondaryAction?: never; secondaryVariant?: never; secondaryLoading?: never; secondaryDisabled?: never; primaryName?: never; secondaryName?: never; cancelName?: never; } export type ModalFooterProps = ModalFooterBuiltInProps | ModalFooterCustomProps; /** * Modal footer with action buttons. * * Provides a consistent footer layout with cancel, secondary, and primary action buttons. * Supports loading states and automatic button disabling during async operations. * * @example Standard modal footer with actions * ```tsx * import { Modal, ModalHeader, ModalBody, ModalFooter, useModal } from "@trackunit/react-modal"; * * const ConfirmModal = () => { * const modal = useModal(); * const [isLoading, setIsLoading] = useState(false); * * return ( * * * Are you sure you want to delete this asset? * { * setIsLoading(true); * // handle delete * }} * /> * * ); * }; * ``` * @example Custom footer with children * ```tsx * import { Modal, ModalFooter, useModal } from "@trackunit/react-modal"; * import { Button } from "@trackunit/react-components"; * * const CustomFooterModal = () => { * const modal = useModal(); * * return ( * * * * * * * * ); * }; * ``` * @param props Component props. * @param props.cancelLabel Text for the Cancel button. * @param props.onCancel Optional handler invoked when the Cancel button is clicked (alias to onClose, if provided). * @param props.secondaryLabel Text for the optional Secondary action button. * @param props.secondaryAction Click handler for the optional Secondary action button. * @param props.primaryLabel Text for the Primary action button. * @param props.primaryAction Click handler for the Primary action button. * @param props.primaryVariant Visual variant for the Primary button ("primary" | "primary-danger"). * @param props.primaryLoading Optional loading state for the Primary button. * @returns {ReactElement} Modal footer container element. */ export declare const ModalFooter: import("react").ForwardRefExoticComponent>; export {};