"use strict";

exports.__esModule = true;
exports.StyledIcon = void 0;
var _styledComponents = _interopRequireDefault(require("styled-components"));
var _theme = require("../../theme");
var _margin = _interopRequireDefault(require("../../mixins/margin"));
var _alignSelf = _interopRequireDefault(require("../../mixins/alignSelf"));
var _cursor = _interopRequireDefault(require("../../mixins/cursor"));
var _css = _interopRequireDefault(require("@styled-system/css"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
var SIZES = {
  small: "14px",
  medium: "16px",
  large: "24px"
};
var styledColor = function styledColor(_ref) {
  var theme = _ref.theme,
    color = _ref.color;
  return color && "fill: " + (0, _theme.getColor)(color)({
    theme: theme
  }) + ";";
};
var styledHoverColor = function styledHoverColor(_ref2) {
  var theme = _ref2.theme,
    hoverColor = _ref2.hoverColor;
  return hoverColor && "&:hover { fill: " + (0, _theme.getColor)(hoverColor)({
    theme: theme
  }) + "; }";
};
var styledRotate = function styledRotate(_ref3) {
  var rotate = _ref3.rotate;
  return !isNaN(rotate) && "transform: rotate(" + rotate * 90 + "deg);";
};
var sx = function sx(props) {
  return (0, _css["default"])(props.sx)(props);
};
var StyledIcon = exports.StyledIcon = _styledComponents["default"].svg.withConfig({
  displayName: "styled__StyledIcon",
  componentId: "sc-1wxz4b1-0"
})(["height:", ";width:", ";opacity:", ";pointer-events:", ";", " ", " ", " ", " ", " ", " ", ""], function (_ref4) {
  var size = _ref4.size,
    height = _ref4.height;
  return height || SIZES[size];
}, function (_ref5) {
  var size = _ref5.size,
    width = _ref5.width;
  return width || SIZES[size];
}, function (_ref6) {
  var disabled = _ref6.disabled;
  return disabled ? 0.4 : 1;
}, function (_ref7) {
  var disabled = _ref7.disabled;
  return disabled ? "none" : "unset";
}, styledRotate, styledColor, styledHoverColor, _margin["default"], _alignSelf["default"], _cursor["default"], sx);