UNPKG

@atlaskit/modal-dialog

Version:

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

33 lines (32 loc) 890 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.width = exports.dialogWidth = exports.dialogHeight = void 0; var width = exports.width = { values: ['small', 'medium', 'large', 'x-large'], widths: { small: 400, medium: 600, large: 800, 'x-large': 968 }, defaultValue: 'medium' }; var dialogWidth = exports.dialogWidth = function dialogWidth(input) { if (!input) { return 'auto'; } var isWidthName = width.values.indexOf(input.toString()) !== -1; var widthName = isWidthName && input; if (widthName) { return "".concat(width.widths[widthName], "px"); } return typeof input === 'number' ? "".concat(input, "px") : input; }; var dialogHeight = exports.dialogHeight = function dialogHeight(input) { if (!input) { return 'auto'; } return typeof input === 'number' ? "".concat(input, "px") : input; };