lucid-ui
Version:
A UI component library from AppNexus.
95 lines (94 loc) • 2.83 kB
TypeScript
import React from 'react';
import { IOverlayProps } from '../Overlay/Overlay';
import { StandardProps } from '../../util/component-types';
import { IButtonProps } from '../Button/Button';
declare enum EnumSize {
small = "small",
medium = "medium",
large = "large"
}
declare type Size = keyof typeof EnumSize;
interface IDialogHeaderProps extends StandardProps {
description?: string;
}
interface IDialogFooterProps extends StandardProps {
description?: string;
}
export interface IDialogProps extends IOverlayProps {
/** Size variations that only affect the width of the dialog. All the sizes
will grow in height until they get too big, at which point they will
scroll inside. */
size: Size;
/** If this is truthy (if a function is provided). the close button will show.
The function that is called when the close button is triggered. */
handleClose?: ({ event, props, }: {
event: React.MouseEvent;
props: IButtonProps;
}) => void;
/** Provides a more segregated design to organize more content in the Dialog.
* @default = false */
isComplex: boolean;
/** A true or false value that dictates whether or not the Body has padding. */
hasGutters: boolean;
/** *Child Element* - Header contents. Only one \`Header\` is used. */
Header?: string | React.ReactNode & {
props: IDialogHeaderProps;
};
/** *Child Element* - Footer contents. Only one \`Footer\` is used. */
Footer?: string | React.ReactNode & {
props: IDialogFooterProps;
};
}
export declare const Dialog: {
(props: IDialogProps): React.ReactElement;
displayName: string;
defaultProps: {
size: EnumSize;
isComplex: boolean;
hasGutters: boolean;
isShown: boolean;
isModal: boolean;
onEscape: (...args: any[]) => void;
onBackgroundClick: (...args: any[]) => void;
isAnimated: boolean;
};
peek: {
description: string;
categories: string[];
extend: string;
madeFrom: string[];
};
propTypes: {
size: any;
handleClose: any;
isComplex: any;
hasGutters: any;
Header: any;
Footer: any;
className: any;
children: any;
isShown: any;
isAnimated: any;
isModal: any;
portalId: any;
onEscape: any;
onBackgroundClick: any;
};
Header: {
(_props: IDialogHeaderProps): null;
displayName: string;
peek: {
description: string;
};
propName: string;
};
Footer: {
(_props: IDialogFooterProps): null;
displayName: string;
peek: {
description: string;
};
propName: string;
};
};
export default Dialog;