///
///
///
import React from 'react';
/**
* `ModalAnimatedWrapper` is an exported component that we export for developers that want access to
* `Modal` without padding and a close button. We export it as a named export instead of
* creating a `hasNoPadding` prop partly to discourage the use of `Modal` without padding.
*
* This component uses `ModalCurtain` and includes the backdrop, transition, and white modal
* wrapper that is available at a few widths.
*/
declare const ModalAnimatedWrapper: ({ children, isOpen, onCloseClick, onCloseFinish, onOpenFinish, shouldCloseOnCurtainClick, width, heightAboveSmall, shouldPageScrollAboveSmall, }: ModalAnimatedWrapperProps) => JSX.Element;
export interface ModalAnimatedWrapperProps {
/**
* Content that appears within the modal.
*/
children?: React.ReactNode;
/**
* Function that fires to close the modal.
*/
onCloseClick: () => void;
/**
* Function that fires once the modal has opened and transitions have ended.
*/
onOpenFinish?: () => void;
/**
* Function that fires once the modal has closed and transitions have ended.
*/
onCloseFinish?: () => void;
/**
* Determines if the modal should close when clicking on the curtain, outside of the `children`.
*/
shouldCloseOnCurtainClick?: boolean;
/**
* Allows the page to scroll vertically at viewports larger than the small breakpoint. If
* `false`, the modal will always be equal to or smaller than the viewport and the contents
* of the modal will scroll, not the page itself.
*/
shouldPageScrollAboveSmall?: boolean;
/**
* Should the modal appear open.
*/
isOpen?: boolean;
/**
* Sets the max-width of the modal container.
*/
width?: 'narrow' | 'medium' | 'wide';
/**
* Sets height of the modal container above small viewport.
* If `auto` (default), the modal height will be determined by its content.
* Otherwise, the modal height will be fixed at some constant px.
*/
heightAboveSmall?: 'auto' | 'medium' | 'tall';
}
export interface ModalHeaderProps {
/**
* Content (usually a `ModalTitle` and `ModalDescription`) that appears at the top of the
* modal.
*/
children: React.ReactNode;
}
export interface ModalTitleProps {
/**
* Text that describes the modal contents. It is intended for use within the `ModalHeader`.
*/
children: string;
}
export interface ModalDescriptionProps {
/**
* Text intended for use below a `ModalTitle` and within a `ModalHeader`.
*/
children: React.ReactNode;
}
export interface ModalContentProps {
/**
* Content (usually a form) that makes up the main part of the modal.
*/
children: React.ReactNode;
}
export interface ModalContentFullBleedProps {
/**
* Content (usually a form) that makes up the main part of the modal.
*/
children: React.ReactNode;
/**
* Allows the React `className` prop to be passed through to the rendered element.
*/
className?: string;
/**
* Allows the React `style` prop to be passed through to the rendered element.
*/
style?: React.CSSProperties;
}
export interface ModalFooterProps {
/**
* Content (ususally buttons) to render within the footer.
*/
children: React.ReactNode;
/**
* Attaches the footer to the bottom of the modal below the small breakpoint.
*/
isSticky?: boolean;
}
export interface ModalProps {
/**
* Content that appears within the modal.
*/
children?: React.ReactNode;
/**
* Function that fires to close the modal.
*/
onCloseClick: () => void;
/**
* Function that fires once the modal has opened and transitions have ended.
*/
onOpenFinish?: () => void;
/**
* Function that fires once the modal has closed and transitions have ended.
*/
onCloseFinish?: () => void;
/**
* Determines if the close button should be rendered. This is generally discouraged and should
* be used carefully. If used, the contents passed into the modal must contain a focusable
* element such as a link or button.
*/
shouldHideCloseButton?: boolean;
/**
* Determines if the modal should close when clicking on the curtain, outside of the `children`.
*/
shouldCloseOnCurtainClick?: boolean;
/**
* Should the modal appear open.
*/
isOpen?: boolean;
/**
* Sets the max-width of the modal container.
*/
width?: 'narrow' | 'medium' | 'wide';
/**
* Sets height of the modal container above small viewport.
* If `auto` (default), the modal height will be determined by its content.
* Otherwise, the modal height will be fixed at some constant px.
*/
heightAboveSmall?: 'auto' | 'medium' | 'tall';
}
declare const ModalHeader: ({ children }: ModalHeaderProps) => JSX.Element;
declare const ModalTitle: ({ children }: ModalTitleProps) => JSX.Element;
declare const ModalDescription: ({ children }: ModalDescriptionProps) => JSX.Element;
declare const ModalContent: ({ children }: ModalContentProps) => JSX.Element;
declare const ModalContentFullBleed: ({ children, className, style, }: ModalContentFullBleedProps) => JSX.Element;
declare class ModalFooter extends React.Component {
constructor(props: ModalFooterProps);
componentDidMount(): void;
render(): JSX.Element | null;
}
interface ModalStateTypes {
hasStickyFooter: boolean;
stickyFooterContainerRef: React.RefObject | null;
}
declare class Modal extends React.Component {
constructor(props: ModalProps);
setSticky(newVal: boolean): void;
render(): JSX.Element;
}
export default Modal;
export { ModalHeader, ModalTitle, ModalDescription, ModalContent, ModalContentFullBleed, ModalFooter, ModalAnimatedWrapper, };
//# sourceMappingURL=index.d.ts.map