UNPKG

@makeen.io/material-ui-kit

Version:
82 lines (64 loc) 2.93 kB
import _extends from "@babel/runtime/helpers/extends";import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";function _templateObject2() {var data = _taggedTemplateLiteral(["\n ", ";\n img {\n width: ", ";\n height: ", ";\n }\n\n .icon {\n circle {\n fill: ", ";\n }\n\n path {\n &:nth-child(3) {\n fill: ", ";\n }\n\n fill: ", ";\n }\n }\n"]);_templateObject2 = function _templateObject2() {return data;};return data;}function _templateObject() {var data = _taggedTemplateLiteral(["\n width: ", "px;\n height: 100%;\n border-radius: 4px;\n font-size: ", "px;\n display: flex;\n"]);_templateObject = function _templateObject() {return data;};return data;}import React from "react"; import BadgeIcon from "../../../assets/icons/badge.svg"; import _ from "lodash"; import sample from "lodash/sample"; import styled, { css } from "styled-components"; var palettes = ["success", "warning", "infoLight", "tertiary"]; var commonStyle = css(_templateObject(), function (_ref) {var width = _ref.width;return width;}, function (props) {return props.width / 2.25;}); var ImageWrapper = styled.div(_templateObject2(), commonStyle, function (_ref2) {var width = _ref2.width;return _.isNumber(width) ? "".concat(width, "px") : width || "40px";}, function (_ref3) {var height = _ref3.height;return _.isNumber(height) ? "".concat(height, "px") : height || "40px";}, function (props) { if (props.theme === "orange") { return "#fff4e5"; } if (props.theme === "green") { return "#f3f9e7"; } if (props.theme === "blue") { return "#f0faff"; } if (props.theme === "yellow") { return "#fff8cc"; } }, function (props) { if (props.theme === "orange") { return "#ffd280"; } if (props.theme === "green") { return "#c8ee56"; } if (props.theme === "blue") { return "#97d8f7"; } if (props.theme === "yellow") { return "#ffe266"; } }, function (props) { if (props.theme === "orange") { return "#ffe4bc"; } if (props.theme === "green") { return "#daf678"; } if (props.theme === "blue") { return "#c0e8fb"; } if (props.theme === "yellow") { return "#ffee99"; } }); export default (function (_ref4) {var _ref4$width = _ref4.width,width = _ref4$width === void 0 ? 40 : _ref4$width,_ref4$height = _ref4.height,height = _ref4$height === void 0 ? 40 : _ref4$height,theme = _ref4.theme,rest = _objectWithoutProperties(_ref4, ["width", "height", "theme"]); return /*#__PURE__*/React.createElement(ImageWrapper, _extends({ theme: theme, width: width, height: height, palette: sample(palettes) }, rest), /*#__PURE__*/ React.createElement(BadgeIcon // theme={theme} , { // theme={theme} width: width, height: height, className: "icon" })); }); //# sourceMappingURL=index.js.map