UNPKG

cometchat-react-ui-kit2

Version:

CometChat UI Kit for React App

97 lines (96 loc) 4.37 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.toggleStyle = exports.menuWrapperStyle = exports.menuActionStyle = exports.listItemStyle = exports.actionWrapperStyle = 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 actionWrapperStyle = function actionWrapperStyle(props) { var _props$style; return _objectSpread({ listStyleType: "none", padding: "5px", margin: "0", background: props === null || props === void 0 ? void 0 : (_props$style = props.style) === null || _props$style === void 0 ? void 0 : _props$style.background, borderRadius: "10px", display: "flex" }, props.style); }; exports.actionWrapperStyle = actionWrapperStyle; var menuActionStyle = function menuActionStyle(props) { var _props$style2, _props$style3; return { border: "0", iconHeight: "24px", iconWidth: "24px", margin: "5px", borderRadius: "4px", alignItems: "center", display: "flex", justifyContent: "center", position: "relative", cursor: "pointer", iconTint: props === null || props === void 0 ? void 0 : (_props$style2 = props.style) === null || _props$style2 === void 0 ? void 0 : _props$style2.iconTint, iconBackground: props === null || props === void 0 ? void 0 : (_props$style3 = props.style) === null || _props$style3 === void 0 ? void 0 : _props$style3.iconBackground }; }; exports.menuActionStyle = menuActionStyle; var menuWrapperStyle = function menuWrapperStyle(props) { return _objectSpread({ position: "absolute", background: "#fff", top: "20px", left: "90%", listStyle: "none", padding: "1px" }, props.style); }; exports.menuWrapperStyle = menuWrapperStyle; var toggleStyle = function toggleStyle(props) { var position; if (props.style.left) { position = { left: "0px" }; } else { position = { right: "0px" }; } return _objectSpread(_objectSpread({ backgroundColor: props.style.background, display: "flex", padding: "5px", flexDirection: "column", position: "absolute", height: "max-content", width: "max-content", maxHeight: "192px", zIndex: "1", borderRadius: "8px", border: props.style.border, top: "38px" }, position), {}, { overflow: "visible", marginTop: "2px" }); }; exports.toggleStyle = toggleStyle; var listItemStyle = function listItemStyle(props) { var _props$style4, _props$style5, _props$style6, _props$style7; return { width: "100%", height: "100%", iconTint: props === null || props === void 0 ? void 0 : (_props$style4 = props.style) === null || _props$style4 === void 0 ? void 0 : _props$style4.iconTint, iconBackground: props === null || props === void 0 ? void 0 : (_props$style5 = props.style) === null || _props$style5 === void 0 ? void 0 : _props$style5.iconBackground, borderRadius: "", textColor: props === null || props === void 0 ? void 0 : (_props$style6 = props.style) === null || _props$style6 === void 0 ? void 0 : _props$style6.textColor, border: "0", background: "transparent", textFont: props === null || props === void 0 ? void 0 : (_props$style7 = props.style) === null || _props$style7 === void 0 ? void 0 : _props$style7.textFont // WebkitMask: `url(${props?.addReactionIconURL})`, }; }; exports.listItemStyle = listItemStyle;