UNPKG

react-odyssey

Version:

React components for Odyssey design system

46 lines (45 loc) 1.66 kB
import React, { HTMLAttributes } from 'react'; import ReactModal from 'react-modal'; import PropTypes from 'prop-types'; import { Omit } from './util'; export declare type ModalType = 'primary' | 'secondary' | 'danger'; declare type ModalEvent = React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element> | React.SyntheticEvent<HTMLButtonElement>; export declare type ModalProps = Omit<HTMLAttributes<HTMLElement>, 'title'> & { cancellable?: boolean; disabled?: boolean; onCancel?: Function; submitBtnTxt?: React.ReactNode; submit: Function; title?: React.ReactNode; type?: ModalType; }; export declare class Modal extends React.Component<ModalProps> { static setAppElement: typeof ReactModal.setAppElement; static defaultProps: { children: string; submitBtnTxt: string; type: string; }; static propTypes: { cancellable: PropTypes.Requireable<boolean>; children: PropTypes.Requireable<PropTypes.ReactNodeLike>; disabled: PropTypes.Requireable<boolean>; onCancel: PropTypes.Requireable<(...args: any[]) => any>; submitBtnTxt: PropTypes.Requireable<PropTypes.ReactNodeLike>; submit: PropTypes.Validator<(...args: any[]) => any>; title: PropTypes.Requireable<PropTypes.ReactNodeLike>; type: PropTypes.Requireable<string>; }; style: { content: { display: string; }; overlay: { backgroundColor: string; }; }; close: (e?: ModalEvent) => void; submit: (e: React.SyntheticEvent<HTMLButtonElement, Event>) => void; render(): JSX.Element; } export {};