UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

42 lines (41 loc) 1.21 kB
import React from 'react'; import { ModalContentProps, ReactChildType } from './types'; declare global { interface Window { __modalRoot: HTMLElement; } } export interface ModalRootProps extends ModalContentProps { /** * The id used internal in the modal/drawer root element. Defaults to `root`, so the element id will be `dnb-modal-root`. */ id?: string; root_id?: string; direct_dom_return?: boolean; /** * The content which will appear when triggering the modal/drawer. */ children?: ReactChildType; /** For internal use only */ modalContentCloseRef?: React.RefObject<any>; } interface ModalRootState { isMounted: boolean; } export default class ModalRoot extends React.PureComponent<ModalRootProps, ModalRootState> { portalElem: HTMLDivElement | null; static defaultProps: { id: any; root_id: string; direct_dom_return: boolean; children: any; }; state: { isMounted: boolean; }; static insertModalRoot(id: any): false | HTMLElement; componentDidMount(): void; componentWillUnmount(): void; render(): import("react/jsx-runtime").JSX.Element; } export {};