@dnb/eufemia
Version:
DNB Eufemia Design System UI Library
40 lines (39 loc) • 1.26 kB
TypeScript
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;
/**
* The id used internal in the modal/drawer root element. Defaults to `root`, so the element id will be `dnb-modal-root`.
*/
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 contextType: React.Context<import("../../shared/Context").ContextProps>;
static defaultProps: {
id: any;
root_id: any;
direct_dom_return: boolean;
children: any;
};
render(): import("react/jsx-runtime").JSX.Element;
}
export {};