import * as react from 'react'; import { ReactNode } from 'react'; import * as tailwind_variants from 'tailwind-variants'; import * as _heroui_system from '@heroui/system'; import { HTMLHeroUIProps, PropGetter } from '@heroui/system'; import { SlotsToClasses, ModalSlots, ModalVariantProps } from '@heroui/theme'; import { HTMLMotionProps } from 'framer-motion'; import { AriaModalOverlayProps } from '@react-aria/overlays'; import { ReactRef } from '@heroui/react-utils'; import { OverlayTriggerProps } from '@react-stately/overlays'; interface Props extends HTMLHeroUIProps<"section"> { /** * Ref to the DOM node. */ ref?: ReactRef; /** * The props to modify the framer motion animation. Use the `variants` API to create your own animation. */ motionProps?: Omit, "ref">; /** * Determines whether to hide the modal close button. * @default false */ hideCloseButton?: boolean; /** * Custom modal close button element. */ closeButton?: ReactNode; /** * Whether the animation should be disabled. * @default false */ disableAnimation?: boolean; /** * The container element in which the overlay portal will be placed. * @default document.body */ portalContainer?: Element; /** * Whether the scroll should be blocked when the modal is open. * @default true */ shouldBlockScroll?: boolean; /** * Callback fired when the modal is closed. */ onClose?: () => void; /** * Classname or List of classes to change the classNames of the element. * if `className` is passed, it will be added to the base slot. * * @example * ```ts * * ``` */ classNames?: SlotsToClasses; /** * Whether to close the overlay when the user interacts outside it. * @default true */ isDismissable?: boolean; } type UseModalProps = Props & OverlayTriggerProps & Omit & ModalVariantProps; declare function useModal(originalProps: UseModalProps): { Component: _heroui_system.As; slots: { wrapper: (slotProps?: ({ shadow?: "none" | "md" | "sm" | "lg" | undefined; size?: "md" | "full" | "sm" | "lg" | "xs" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | undefined; radius?: "none" | "md" | "sm" | "lg" | undefined; disableAnimation?: boolean | undefined; backdrop?: "transparent" | "blur" | "opaque" | undefined; placement?: "auto" | "bottom" | "top" | "center" | "top-center" | "bottom-center" | undefined; scrollBehavior?: "inside" | "outside" | "normal" | undefined; } & tailwind_variants.ClassProp) | undefined) => string; base: (slotProps?: ({ shadow?: "none" | "md" | "sm" | "lg" | undefined; size?: "md" | "full" | "sm" | "lg" | "xs" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | undefined; radius?: "none" | "md" | "sm" | "lg" | undefined; disableAnimation?: boolean | undefined; backdrop?: "transparent" | "blur" | "opaque" | undefined; placement?: "auto" | "bottom" | "top" | "center" | "top-center" | "bottom-center" | undefined; scrollBehavior?: "inside" | "outside" | "normal" | undefined; } & tailwind_variants.ClassProp) | undefined) => string; backdrop: (slotProps?: ({ shadow?: "none" | "md" | "sm" | "lg" | undefined; size?: "md" | "full" | "sm" | "lg" | "xs" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | undefined; radius?: "none" | "md" | "sm" | "lg" | undefined; disableAnimation?: boolean | undefined; backdrop?: "transparent" | "blur" | "opaque" | undefined; placement?: "auto" | "bottom" | "top" | "center" | "top-center" | "bottom-center" | undefined; scrollBehavior?: "inside" | "outside" | "normal" | undefined; } & tailwind_variants.ClassProp) | undefined) => string; header: (slotProps?: ({ shadow?: "none" | "md" | "sm" | "lg" | undefined; size?: "md" | "full" | "sm" | "lg" | "xs" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | undefined; radius?: "none" | "md" | "sm" | "lg" | undefined; disableAnimation?: boolean | undefined; backdrop?: "transparent" | "blur" | "opaque" | undefined; placement?: "auto" | "bottom" | "top" | "center" | "top-center" | "bottom-center" | undefined; scrollBehavior?: "inside" | "outside" | "normal" | undefined; } & tailwind_variants.ClassProp) | undefined) => string; body: (slotProps?: ({ shadow?: "none" | "md" | "sm" | "lg" | undefined; size?: "md" | "full" | "sm" | "lg" | "xs" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | undefined; radius?: "none" | "md" | "sm" | "lg" | undefined; disableAnimation?: boolean | undefined; backdrop?: "transparent" | "blur" | "opaque" | undefined; placement?: "auto" | "bottom" | "top" | "center" | "top-center" | "bottom-center" | undefined; scrollBehavior?: "inside" | "outside" | "normal" | undefined; } & tailwind_variants.ClassProp) | undefined) => string; footer: (slotProps?: ({ shadow?: "none" | "md" | "sm" | "lg" | undefined; size?: "md" | "full" | "sm" | "lg" | "xs" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | undefined; radius?: "none" | "md" | "sm" | "lg" | undefined; disableAnimation?: boolean | undefined; backdrop?: "transparent" | "blur" | "opaque" | undefined; placement?: "auto" | "bottom" | "top" | "center" | "top-center" | "bottom-center" | undefined; scrollBehavior?: "inside" | "outside" | "normal" | undefined; } & tailwind_variants.ClassProp) | undefined) => string; closeButton: (slotProps?: ({ shadow?: "none" | "md" | "sm" | "lg" | undefined; size?: "md" | "full" | "sm" | "lg" | "xs" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | undefined; radius?: "none" | "md" | "sm" | "lg" | undefined; disableAnimation?: boolean | undefined; backdrop?: "transparent" | "blur" | "opaque" | undefined; placement?: "auto" | "bottom" | "top" | "center" | "top-center" | "bottom-center" | undefined; scrollBehavior?: "inside" | "outside" | "normal" | undefined; } & tailwind_variants.ClassProp) | undefined) => string; } & { wrapper: (slotProps?: ({ shadow?: "none" | "md" | "sm" | "lg" | undefined; size?: "md" | "full" | "sm" | "lg" | "xs" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | undefined; radius?: "none" | "md" | "sm" | "lg" | undefined; disableAnimation?: boolean | undefined; backdrop?: "transparent" | "blur" | "opaque" | undefined; placement?: "auto" | "bottom" | "top" | "center" | "top-center" | "bottom-center" | undefined; scrollBehavior?: "inside" | "outside" | "normal" | undefined; } & tailwind_variants.ClassProp) | undefined) => string; base: (slotProps?: ({ shadow?: "none" | "md" | "sm" | "lg" | undefined; size?: "md" | "full" | "sm" | "lg" | "xs" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | undefined; radius?: "none" | "md" | "sm" | "lg" | undefined; disableAnimation?: boolean | undefined; backdrop?: "transparent" | "blur" | "opaque" | undefined; placement?: "auto" | "bottom" | "top" | "center" | "top-center" | "bottom-center" | undefined; scrollBehavior?: "inside" | "outside" | "normal" | undefined; } & tailwind_variants.ClassProp) | undefined) => string; backdrop: (slotProps?: ({ shadow?: "none" | "md" | "sm" | "lg" | undefined; size?: "md" | "full" | "sm" | "lg" | "xs" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | undefined; radius?: "none" | "md" | "sm" | "lg" | undefined; disableAnimation?: boolean | undefined; backdrop?: "transparent" | "blur" | "opaque" | undefined; placement?: "auto" | "bottom" | "top" | "center" | "top-center" | "bottom-center" | undefined; scrollBehavior?: "inside" | "outside" | "normal" | undefined; } & tailwind_variants.ClassProp) | undefined) => string; header: (slotProps?: ({ shadow?: "none" | "md" | "sm" | "lg" | undefined; size?: "md" | "full" | "sm" | "lg" | "xs" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | undefined; radius?: "none" | "md" | "sm" | "lg" | undefined; disableAnimation?: boolean | undefined; backdrop?: "transparent" | "blur" | "opaque" | undefined; placement?: "auto" | "bottom" | "top" | "center" | "top-center" | "bottom-center" | undefined; scrollBehavior?: "inside" | "outside" | "normal" | undefined; } & tailwind_variants.ClassProp) | undefined) => string; body: (slotProps?: ({ shadow?: "none" | "md" | "sm" | "lg" | undefined; size?: "md" | "full" | "sm" | "lg" | "xs" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | undefined; radius?: "none" | "md" | "sm" | "lg" | undefined; disableAnimation?: boolean | undefined; backdrop?: "transparent" | "blur" | "opaque" | undefined; placement?: "auto" | "bottom" | "top" | "center" | "top-center" | "bottom-center" | undefined; scrollBehavior?: "inside" | "outside" | "normal" | undefined; } & tailwind_variants.ClassProp) | undefined) => string; footer: (slotProps?: ({ shadow?: "none" | "md" | "sm" | "lg" | undefined; size?: "md" | "full" | "sm" | "lg" | "xs" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | undefined; radius?: "none" | "md" | "sm" | "lg" | undefined; disableAnimation?: boolean | undefined; backdrop?: "transparent" | "blur" | "opaque" | undefined; placement?: "auto" | "bottom" | "top" | "center" | "top-center" | "bottom-center" | undefined; scrollBehavior?: "inside" | "outside" | "normal" | undefined; } & tailwind_variants.ClassProp) | undefined) => string; closeButton: (slotProps?: ({ shadow?: "none" | "md" | "sm" | "lg" | undefined; size?: "md" | "full" | "sm" | "lg" | "xs" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | undefined; radius?: "none" | "md" | "sm" | "lg" | undefined; disableAnimation?: boolean | undefined; backdrop?: "transparent" | "blur" | "opaque" | undefined; placement?: "auto" | "bottom" | "top" | "center" | "top-center" | "bottom-center" | undefined; scrollBehavior?: "inside" | "outside" | "normal" | undefined; } & tailwind_variants.ClassProp) | undefined) => string; } & {}; domRef: react.RefObject; headerId: string; bodyId: string; motionProps: Omit, "ref"> | undefined; classNames: SlotsToClasses<"base" | "header" | "body" | "footer" | "wrapper" | "backdrop" | "closeButton"> | undefined; isDismissable: boolean; closeButton: ReactNode; hideCloseButton: boolean; portalContainer: Element | undefined; shouldBlockScroll: boolean; backdrop: "transparent" | "blur" | "opaque"; isOpen: boolean; onClose: () => void; disableAnimation: boolean; setBodyMounted: react.Dispatch>; setHeaderMounted: react.Dispatch>; getDialogProps: PropGetter; getBackdropProps: PropGetter; getCloseButtonProps: PropGetter; }; type UseModalReturn = ReturnType; export { type UseModalProps, type UseModalReturn, useModal };