UNPKG

cometchat-react-ui-kit2

Version:

CometChat UI Kit for React App

142 lines (141 loc) 7.42 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.dialogWrapperStyle = exports.dialogTitleStyle = exports.dialogMessageStyle = exports.dialogLoadingWrapperStyle = exports.dialogLoadingStyle = exports.dialogFormStyle = exports.dialogErrorStyle = exports.dialogButtonStyle = exports.buttonConfirmStyle = exports.buttonCancelStyle = void 0; var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } var dialogLoadingWrapperStyle = function dialogLoadingWrapperStyle(props, state) { var _props$style, _props$style2; var display = state === "loading" ? { display: "flex" } : { display: "none" }; return _objectSpread({ justifyContent: "center", alignItems: "center", height: props === null || props === void 0 ? void 0 : (_props$style = props.style) === null || _props$style === void 0 ? void 0 : _props$style.height, width: props === null || props === void 0 ? void 0 : (_props$style2 = props.style) === null || _props$style2 === void 0 ? void 0 : _props$style2.width }, display); }; exports.dialogLoadingWrapperStyle = dialogLoadingWrapperStyle; var dialogLoadingStyle = function dialogLoadingStyle(loadingIcon) { return { background: "url(".concat(loadingIcon, ") center center"), width: "24px", height: "24px" }; }; exports.dialogLoadingStyle = dialogLoadingStyle; var dialogTitleStyle = function dialogTitleStyle(props) { var _props$style3, _props$style4, _props$style5; return { width: props === null || props === void 0 ? void 0 : (_props$style3 = props.style) === null || _props$style3 === void 0 ? void 0 : _props$style3.width, font: props === null || props === void 0 ? void 0 : (_props$style4 = props.style) === null || _props$style4 === void 0 ? void 0 : _props$style4.titleTextFont, color: props === null || props === void 0 ? void 0 : (_props$style5 = props.style) === null || _props$style5 === void 0 ? void 0 : _props$style5.titleTextColor, textAlign: "center", padding: "10px", boxSizing: "border-box" }; }; exports.dialogTitleStyle = dialogTitleStyle; var dialogWrapperStyle = function dialogWrapperStyle(props) { var _props$style6; var display = props !== null && props !== void 0 && props.isOpen ? { display: "block" } : { display: "none" }; return _objectSpread(_objectSpread({ background: props === null || props === void 0 ? void 0 : (_props$style6 = props.style) === null || _props$style6 === void 0 ? void 0 : _props$style6.background, fontSize: "13px", zIndex: "4" }, display), props === null || props === void 0 ? void 0 : props.styles); }; exports.dialogWrapperStyle = dialogWrapperStyle; var dialogFormStyle = function dialogFormStyle(props, state) { var _props$style7; var display = state === "initial" || state === "done" ? { display: "block" } : { display: "none" }; return _objectSpread({ width: props === null || props === void 0 ? void 0 : (_props$style7 = props.style) === null || _props$style7 === void 0 ? void 0 : _props$style7.width, height: "auto", display: "flex", justifyContent: "center", alignItems: "center" }, display); }; exports.dialogFormStyle = dialogFormStyle; var dialogErrorStyle = function dialogErrorStyle(props, state) { var display = state === "error" ? { display: "block" } : { display: "none" }; return _objectSpread({ font: "11px Inter", color: "red", textAlign: "center" }, display); }; exports.dialogErrorStyle = dialogErrorStyle; var dialogMessageStyle = function dialogMessageStyle(props) { return { textAlign: "center", margin: "10px 35px", font: "500 11px Inter,sans-serif", color: "rgba(20,20,20, 0.6)", boxSizing: "border-box", wordSpacing: "1px" }; }; exports.dialogMessageStyle = dialogMessageStyle; var dialogButtonStyle = function dialogButtonStyle(props) { var _props$style8; return { width: props === null || props === void 0 ? void 0 : (_props$style8 = props.style) === null || _props$style8 === void 0 ? void 0 : _props$style8.width, justifyContent: "center", alignItems: "center", margin: "15px 0 0 0", textAlign: "center", display: "flex", flexDirection: "column" }; }; exports.dialogButtonStyle = dialogButtonStyle; var buttonConfirmStyle = function buttonConfirmStyle(props) { var _props$style9, _props$style10, _props$style11, _props$style12, _props$style13; return { width: "90%", height: "46px", marginBottom: "5px", cursor: "pointer", borderRadius: props === null || props === void 0 ? void 0 : (_props$style9 = props.style) === null || _props$style9 === void 0 ? void 0 : _props$style9.borderRadius, font: props === null || props === void 0 ? void 0 : (_props$style10 = props.style) === null || _props$style10 === void 0 ? void 0 : _props$style10.confirmButtonTextFont, border: props === null || props === void 0 ? void 0 : (_props$style11 = props.style) === null || _props$style11 === void 0 ? void 0 : _props$style11.border, background: props === null || props === void 0 ? void 0 : (_props$style12 = props.style) === null || _props$style12 === void 0 ? void 0 : _props$style12.confirmBackground, color: props === null || props === void 0 ? void 0 : (_props$style13 = props.style) === null || _props$style13 === void 0 ? void 0 : _props$style13.confirmButtonTextColor }; }; exports.buttonConfirmStyle = buttonConfirmStyle; var buttonCancelStyle = function buttonCancelStyle(props) { var _props$style14, _props$style15, _props$style16, _props$style17; return { width: "90%", height: "46px", border: "none", marginBottom: "5px", cursor: "pointer", borderRadius: props === null || props === void 0 ? void 0 : (_props$style14 = props.style) === null || _props$style14 === void 0 ? void 0 : _props$style14.borderRadius, font: props === null || props === void 0 ? void 0 : (_props$style15 = props.style) === null || _props$style15 === void 0 ? void 0 : _props$style15.cancelButtonTextFont, background: props === null || props === void 0 ? void 0 : (_props$style16 = props.style) === null || _props$style16 === void 0 ? void 0 : _props$style16.cancelBackground, color: props === null || props === void 0 ? void 0 : (_props$style17 = props.style) === null || _props$style17 === void 0 ? void 0 : _props$style17.cancelButtonTextColor }; }; exports.buttonCancelStyle = buttonCancelStyle;