UNPKG

@atlaskit/modal-dialog

Version:

A modal dialog displays content that requires user interaction, in a layer above the page.

27 lines 642 B
export const width = { values: ['small', 'medium', 'large', 'x-large'], widths: { small: 400, medium: 600, large: 800, 'x-large': 968 }, defaultValue: 'medium' }; export const dialogWidth = input => { if (!input) { return 'auto'; } const isWidthName = width.values.indexOf(input.toString()) !== -1; const widthName = isWidthName && input; if (widthName) { return `${width.widths[widthName]}px`; } return typeof input === 'number' ? `${input}px` : input; }; export const dialogHeight = input => { if (!input) { return 'auto'; } return typeof input === 'number' ? `${input}px` : input; };