import _extends from "@babel/runtime/helpers/extends";

/* eslint-disable max-len */
import React from "react";
import PropTypes from "prop-types";
import classnames from "classnames";
import makeStyles from "../styles/makeStyles";
import { getShades } from "../styles/colors";

var deprecationWarning = function deprecationWarning(message) {
  if (process.env.NODE_ENV === "development") {
    // eslint-disable-next-line no-console
    console.warn("[Clever-react]: ".concat(message));
  }
};

var getClasses = makeStyles(function (_ref) {
  var colors = _ref.cleverUI.colors;
  return {
    root: function root(_ref2) {
      var rotation = _ref2.rotation,
          padding = _ref2.padding,
          size = _ref2.size,
          color = _ref2.color,
          shade = _ref2.shade;
      var res = {
        color: colors[color] ? colors[color][shade] : color
      };

      if (rotation > 0) {
        res.transform = "rotate(".concat(rotation, "deg)");
      }

      if (padding > 0) {
        res.padding = "".concat(size * padding / 200, "px");
      }

      return res;
    }
  };
});
var shadesList = getShades();

function Compress(props) {
  var classes = getClasses(props);
  var size = props.size,
      padding = props.padding,
      className = props.className,
      onMouseEnter = props.onMouseEnter,
      onMouseLeave = props.onMouseLeave;
  var sizeIcon = size;
  var otherProps = {
    className: classnames(className, classes.root),
    onMouseEnter: onMouseEnter,
    onMouseLeave: onMouseLeave
  };

  if (padding) {
    deprecationWarning("The padding prop is deprecated, use a className for customization");
    sizeIcon = sizeIcon * (100 - padding) / 100;
  }

  return /*#__PURE__*/React.createElement("svg", _extends({
    viewBox: "0 0 16 16",
    fill: "none",
    height: sizeIcon,
    width: sizeIcon
  }, otherProps), /*#__PURE__*/React.createElement("path", {
    d: "M2 6C2 5.63181 2.29848 5.33333 2.66667 5.33333H5.33333V2.66667C5.33333 2.29848 5.63181 2 6 2C6.36819 2 6.66667 2.29848 6.66667 2.66667V6C6.66667 6.36819 6.36819 6.66667 6 6.66667H2.66667C2.29848 6.66667 2 6.36819 2 6Z",
    fill: "currentColor"
  }), /*#__PURE__*/React.createElement("path", {
    d: "M13.3333 5.33333C13.7015 5.33333 14 5.63181 14 6C14 6.36819 13.7015 6.66667 13.3333 6.66667H10C9.63181 6.66667 9.33334 6.36819 9.33334 6V2.66667C9.33334 2.29848 9.63181 2 10 2C10.3682 2 10.6667 2.29848 10.6667 2.66667V5.33333H13.3333Z",
    fill: "currentColor"
  }), /*#__PURE__*/React.createElement("path", {
    d: "M13.3333 10.6667C13.7015 10.6667 14 10.3682 14 10C14 9.6318 13.7015 9.33333 13.3333 9.33333H10C9.63181 9.33333 9.33334 9.6318 9.33334 10V13.3333C9.33334 13.7015 9.63181 14 10 14C10.3682 14 10.6667 13.7015 10.6667 13.3333V10.6667H13.3333Z",
    fill: "currentColor"
  }), /*#__PURE__*/React.createElement("path", {
    d: "M2.66667 10.6667C2.29848 10.6667 2 10.3682 2 10C2 9.6318 2.29848 9.33333 2.66667 9.33333H6C6.36819 9.33333 6.66667 9.6318 6.66667 10V13.3333C6.66667 13.7015 6.36819 14 6 14C5.63181 14 5.33333 13.7015 5.33333 13.3333V10.6667H2.66667Z",
    fill: "currentColor"
  }));
}

Compress.propTypes = {
  color: PropTypes.string,
  className: PropTypes.string,
  size: PropTypes.number,
  onMouseEnter: PropTypes.func,
  onMouseLeave: PropTypes.func,
  rotation: PropTypes.number,
  shade: PropTypes.oneOf(shadesList),
  padding: PropTypes.number
};
Compress.defaultProps = {
  color: "neutral",
  size: 24,
  className: "",
  rotation: 0,
  shade: 500,
  padding: 0,
  onMouseEnter: function onMouseEnter() {},
  onMouseLeave: function onMouseLeave() {}
};
export default Compress;