UNPKG

cometchat-react-ui-kit2

Version:

CometChat UI Kit for React App

176 lines (175 loc) 11.2 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.sendButtonStyle = exports.questionInputStyle = exports.iconWrapperStyle = exports.helperTextStyle = exports.createPollWrapperStyle = exports.createPollWarnMessageStyle = exports.createPollTitleStyle = exports.createPollQuestionAnsStyle = exports.createPollBodyStyle = exports.closeIconStyle = exports.buttonStyle = exports.answerInputStyle = exports.addOptionIconStyle = exports.addItemStyle = exports.addAnswerInutFieldStyle = void 0; var _Shared = require("../../Shared"); var createPollWrapperStyle = function createPollWrapperStyle(props, theme) { var _props$style, _props$style2, _props$style3, _props$style4, _props$style5; return { width: props === null || props === void 0 ? void 0 : (_props$style = props.style) === null || _props$style === void 0 ? void 0 : _props$style.width, height: props === null || props === void 0 ? void 0 : (_props$style2 = props.style) === null || _props$style2 === void 0 ? void 0 : _props$style2.height, border: (props === null || props === void 0 ? void 0 : (_props$style3 = props.style) === null || _props$style3 === void 0 ? void 0 : _props$style3.border) || "1px solid ".concat(theme.palette.accent50[theme.palette.mode]), boxShadow: (props === null || props === void 0 ? void 0 : props.style.boxShadow) || "".concat(theme.palette.accent50[theme.palette.mode], " 0 16px 32px, ").concat(theme.palette.accent50[theme.palette.mode], " 0 0 0 1px"), background: (props === null || props === void 0 ? void 0 : (_props$style4 = props.style) === null || _props$style4 === void 0 ? void 0 : _props$style4.background) || theme.palette.background[theme.palette.mode], borderRadius: props === null || props === void 0 ? void 0 : (_props$style5 = props.style) === null || _props$style5 === void 0 ? void 0 : _props$style5.borderRadius, overflow: "hidden", position: "fixed", margin: "0 auto", cursor: "default" }; }; exports.createPollWrapperStyle = createPollWrapperStyle; var createPollBodyStyle = function createPollBodyStyle() { return { overflow: "hidden auto", padding: "16px" }; }; exports.createPollBodyStyle = createPollBodyStyle; var questionInputStyle = function questionInputStyle(props, theme) { var _props$style6, _props$style7, _props$style8, _props$style9, _theme$palette, _props$style10, _props$style11; return { width: "100%", height: "46px", padding: "6px 12px", outline: "none", border: (props === null || props === void 0 ? void 0 : (_props$style6 = props.style) === null || _props$style6 === void 0 ? void 0 : _props$style6.questionInputBorder) || "1px solid ".concat(theme.palette.accent50[theme.palette.mode]), borderRadius: (props === null || props === void 0 ? void 0 : (_props$style7 = props.style) === null || _props$style7 === void 0 ? void 0 : _props$style7.questionInputBorderRadius) || "8px", font: (props === null || props === void 0 ? void 0 : (_props$style8 = props.style) === null || _props$style8 === void 0 ? void 0 : _props$style8.questionInputTextFont) || (0, _Shared.fontHelper)(theme.typography.subtitle1), color: (props === null || props === void 0 ? void 0 : (_props$style9 = props.style) === null || _props$style9 === void 0 ? void 0 : _props$style9.questionInputTextColor) || (theme === null || theme === void 0 ? void 0 : (_theme$palette = theme.palette) === null || _theme$palette === void 0 ? void 0 : _theme$palette.getAccent()), boxShadow: (props === null || props === void 0 ? void 0 : (_props$style10 = props.style) === null || _props$style10 === void 0 ? void 0 : _props$style10.questionInputBoxShadow) || "".concat(theme.palette.accent50[theme.palette.mode], " 0 0 0 1px"), background: (props === null || props === void 0 ? void 0 : (_props$style11 = props.style) === null || _props$style11 === void 0 ? void 0 : _props$style11.questionInputBackground) || theme.palette.accent50[theme.palette.mode] }; }; exports.questionInputStyle = questionInputStyle; var answerInputStyle = function answerInputStyle(props, theme) { var _theme$palette2; return { width: "100%", height: "46px", padding: "6px 12px", outline: "none", border: props.style.answerInputBorder || "1px solid ".concat(theme.palette.accent50[theme.palette.mode]), borderRadius: props.style.answerInputBorderRadius || "8px", font: props.style.answerInputTextFont || (0, _Shared.fontHelper)(theme.typography.subtitle1), color: props.style.answerInputTextColor || (theme === null || theme === void 0 ? void 0 : (_theme$palette2 = theme.palette) === null || _theme$palette2 === void 0 ? void 0 : _theme$palette2.getAccent()), boxShadow: props.style.answerInputBoxShadow || "".concat(theme.palette.accent50[theme.palette.mode], " 0 0 0 1px"), background: props.style.answerInputBackground || theme.palette.accent50[theme.palette.mode] }; }; exports.answerInputStyle = answerInputStyle; var closeIconStyle = function closeIconStyle(props, img, theme) { var _theme$palette3; return { position: "absolute", width: "32px", height: "32px", top: "3%", right: "3%", WebkitMask: "url(".concat(img, ") center center no-repeat"), background: props.style.closeIconTint || (theme === null || theme === void 0 ? void 0 : (_theme$palette3 = theme.palette) === null || _theme$palette3 === void 0 ? void 0 : _theme$palette3.getPrimary()), cursor: "pointer" }; }; exports.closeIconStyle = closeIconStyle; var createPollWarnMessageStyle = function createPollWarnMessageStyle(props, theme) { var _props$style12, _props$style13; return { font: (props === null || props === void 0 ? void 0 : (_props$style12 = props.style) === null || _props$style12 === void 0 ? void 0 : _props$style12.errorTextFont) || (0, _Shared.fontHelper)(theme.typography.subtitle2), color: (props === null || props === void 0 ? void 0 : (_props$style13 = props.style) === null || _props$style13 === void 0 ? void 0 : _props$style13.errorTextColor) || theme.palette.error[theme.palette.mode], textAlign: "center" }; }; exports.createPollWarnMessageStyle = createPollWarnMessageStyle; var createPollQuestionAnsStyle = function createPollQuestionAnsStyle() { return { width: "100%", marginBottom: "10px" }; }; exports.createPollQuestionAnsStyle = createPollQuestionAnsStyle; var createPollTitleStyle = function createPollTitleStyle(props, theme) { var _theme$palette4; return { font: props.style.titleFont || (0, _Shared.fontHelper)(theme.typography.heading), color: props.style.titleColor || (theme === null || theme === void 0 ? void 0 : (_theme$palette4 = theme.palette) === null || _theme$palette4 === void 0 ? void 0 : _theme$palette4.getAccent()), marginBottom: "15px", textAlign: "center" }; }; exports.createPollTitleStyle = createPollTitleStyle; var buttonStyle = function buttonStyle(props, theme) { var _props$style14, _theme$palette5, _props$style15, _props$style16, _props$style17, _props$style18, _theme$palette6; return { width: "100%", height: "46px", outline: "0", cursor: "pointer", border: (props === null || props === void 0 ? void 0 : (_props$style14 = props.style) === null || _props$style14 === void 0 ? void 0 : _props$style14.createPollButtonBorder) || "1px solid ".concat(theme === null || theme === void 0 ? void 0 : (_theme$palette5 = theme.palette) === null || _theme$palette5 === void 0 ? void 0 : _theme$palette5.getPrimary()), borderRadius: (props === null || props === void 0 ? void 0 : (_props$style15 = props.style) === null || _props$style15 === void 0 ? void 0 : _props$style15.createPollButtonBorderRadius) || "8px", font: (props === null || props === void 0 ? void 0 : (_props$style16 = props.style) === null || _props$style16 === void 0 ? void 0 : _props$style16.createPollButtonTextFont) || (0, _Shared.fontHelper)(theme.typography.subtitle1), color: (props === null || props === void 0 ? void 0 : (_props$style17 = props.style) === null || _props$style17 === void 0 ? void 0 : _props$style17.createPollButtonTextColor) || theme.palette.background[theme.palette.mode], background: (props === null || props === void 0 ? void 0 : (_props$style18 = props.style) === null || _props$style18 === void 0 ? void 0 : _props$style18.createPollButtonBackground) || (theme === null || theme === void 0 ? void 0 : (_theme$palette6 = theme.palette) === null || _theme$palette6 === void 0 ? void 0 : _theme$palette6.getPrimary()) }; }; exports.buttonStyle = buttonStyle; var sendButtonStyle = function sendButtonStyle() { return { display: "inline-block", width: "calc(100% - 30px)", position: "absolute", bottom: "5%" }; }; exports.sendButtonStyle = sendButtonStyle; var iconWrapperStyle = function iconWrapperStyle() { return { width: "30px" }; }; exports.iconWrapperStyle = iconWrapperStyle; var addOptionIconStyle = function addOptionIconStyle(props, img, theme) { var _theme$palette7; return { backgroundSize: "28px 28px", cursor: "pointer", display: "block", height: "24px", width: "24px", WebkitMask: "url(".concat(img, ") center center no-repeat"), background: props.style.addAnswerIconTint || (theme === null || theme === void 0 ? void 0 : (_theme$palette7 = theme.palette) === null || _theme$palette7 === void 0 ? void 0 : _theme$palette7.getPrimary()) }; }; exports.addOptionIconStyle = addOptionIconStyle; var helperTextStyle = function helperTextStyle(props, theme) { var _props$style19, _props$style20; return { width: "100%", height: "auto", font: (props === null || props === void 0 ? void 0 : (_props$style19 = props.style) === null || _props$style19 === void 0 ? void 0 : _props$style19.answerHelpTextFont) || (0, _Shared.fontHelper)(theme.typography.caption1), color: (props === null || props === void 0 ? void 0 : (_props$style20 = props.style) === null || _props$style20 === void 0 ? void 0 : _props$style20.answerHelpTextColor) || theme.palette.accent500[theme.palette.mode], padding: "16px 0 5px 0" }; }; exports.helperTextStyle = helperTextStyle; var addItemStyle = function addItemStyle(props, theme) { var _props$style21, _props$style22, _theme$palette8; return { width: "24px", height: "24px", font: (props === null || props === void 0 ? void 0 : (_props$style21 = props.style) === null || _props$style21 === void 0 ? void 0 : _props$style21.addAnswerButtonTextFont) || (0, _Shared.fontHelper)(theme.typography.text1), color: (props === null || props === void 0 ? void 0 : (_props$style22 = props.style) === null || _props$style22 === void 0 ? void 0 : _props$style22.addAnswerButtonTextColor) || (theme === null || theme === void 0 ? void 0 : (_theme$palette8 = theme.palette) === null || _theme$palette8 === void 0 ? void 0 : _theme$palette8.getPrimary()) }; }; exports.addItemStyle = addItemStyle; var addAnswerInutFieldStyle = function addAnswerInutFieldStyle() { return { display: "flex", width: "auto", justifyContent: "flex-start", alignItems: "center", marginTop: "20px" }; }; exports.addAnswerInutFieldStyle = addAnswerInutFieldStyle;