import React from 'react';
import type { Dispatch, RefObject, SetStateAction } from 'react';
import type { WithChildren } from '../../../utils/childTypes';
import type { Variant, Variants } from 'motion';
export interface ModalEnterExitAnimations extends Variants {
enter: Variant;
exit: Variant;
}
/**
* Interface for the props used by the `Modal` component.
* This component provides a customizable modal dialog, which can be resized and tested using a unique `testId`.
*/
export interface ModalProps {
/**
* Defines the animation variants for the modal's enter and exit transitions.
* This property is used to specify the animation behavior when the modal is opened or closed.
*/
modalEnterExitAnimation?: ModalEnterExitAnimations;
/**
* Defines the size of the modal. It can either be 'default' or 'small'.
* The 'default' size is used by default unless otherwise specified.
* This prop determines the visual size of the modal dialog on the screen.
*
* @default 'default'
*/
size?: 'default' | 'small';
/**
* The `testId` property represents a unique identifier, usually in the form of a string, assigned to a component for testing purposes.
* This property is crucial for uniquely identifying components during testing, allowing for more accurate and reliable tests.
*
* @default 'Modal'
*/
testId?: string;
}
/**
* The `modalFactory` function is a factory function that generates a `Modal` component.
* This modal can be customized with size and testId props, handles opening and closing actions,
* and provides a close button to dismiss the modal. It uses animation for enter and exit transitions.
*
* @param state The reference to the state that controls the visibility of the modal.
* @returns A `Modal` component that renders a modal window with customizable size and content.
*
* @example
* ```tsx
* const Modal = modalFactory(useState(false)[1]);
*
* Modal content
*
* ```
*/
declare const modalFactory: (state: RefObject> | null>) => {
({ children, modalEnterExitAnimation, size, testId }: WithChildren): React.JSX.Element;
displayName: string;
defaultProps: {
size: string;
testId: undefined;
};
};
export { modalFactory };