UNPKG

ladle-inject-custom-addons

Version:
63 lines (62 loc) 2.13 kB
/** * @see https://reach.tech/dialog#dialog-props */ interface DialogProps extends React.PropsWithChildren { isOpen?: boolean; allowPinchZoom?: boolean; onDismiss?: (event: React.MouseEvent | React.KeyboardEvent) => void; initialFocusRef?: React.RefObject<any>; unstable_lockFocusAcrossFrames?: boolean; } type PropsForHtmlDiv = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>; /** * @see https://reach.tech/dialog/#dialogoverlay-props */ interface DialogOverlayProps extends React.PropsWithChildren<PropsForHtmlDiv>, Pick<DialogProps, "isOpen" | "onDismiss" | "initialFocusRef" | "allowPinchZoom"> { dangerouslyBypassFocusLock?: boolean; dangerouslyBypassScrollLock?: boolean; } /** * @see https://reach.tech/dialog/#dialogcontent-props */ interface DialogContentProps extends React.PropsWithChildren<PropsForHtmlDiv> { } /** * DialogOverlay * * Low-level component if you need more control over the styles or rendering of * the dialog overlay. * * Note: You must render a `DialogContent` inside. * * @see Docs https://reach.tech/dialog#dialogoverlay */ declare const DialogOverlay: React.FC<DialogOverlayProps>; /** * DialogContent * * Low-level component if you need more control over the styles or rendering of * the dialog content. * * Note: Must be a child of `DialogOverlay`. * * Note: You only need to use this when you are also styling `DialogOverlay`, * otherwise you can use the high-level `Dialog` component and pass the props * to it. Any props passed to `Dialog` component (besides `isOpen` and * `onDismiss`) will be spread onto `DialogContent`. * * @see Docs https://reach.tech/dialog#dialogcontent */ declare const DialogContent: React.FC<DialogContentProps>; /** * Dialog * * High-level component to render a modal dialog window over the top of the page * (or another dialog). * * @see Docs https://reach.tech/dialog#dialog */ /** @type {any} */ declare const Dialog: React.FC<DialogProps>; export default Dialog; export { Dialog, DialogProps, DialogContent, DialogContentProps, DialogOverlay, DialogOverlayProps, };