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 Expand(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: "M14 6C14 6.36819 13.7015 6.66667 13.3333 6.66667C12.9651 6.66667 12.6667 6.36819 12.6667 6V3.33333H10C9.63181 3.33333 9.33334 3.03486 9.33334 2.66667C9.33334 2.29848 9.63181 2 10 2H13.3333C13.7015 2 14 2.29848 14 2.66667V6Z",
    fill: "currentColor"
  }), /*#__PURE__*/React.createElement("path", {
    d: "M3.33333 10C3.33333 9.6318 3.03486 9.33333 2.66667 9.33333C2.29848 9.33333 2 9.6318 2 10V13.3333C2 13.7015 2.29848 14 2.66667 14H6C6.36819 14 6.66667 13.7015 6.66667 13.3333C6.66667 12.9651 6.36819 12.6667 6 12.6667H3.33333V10Z",
    fill: "currentColor"
  }), /*#__PURE__*/React.createElement("path", {
    d: "M12.6667 10C12.6667 9.6318 12.9651 9.33333 13.3333 9.33333C13.7015 9.33333 14 9.6318 14 10V13.3333C14 13.7015 13.7015 14 13.3333 14H10C9.63181 14 9.33334 13.7015 9.33334 13.3333C9.33334 12.9651 9.63181 12.6667 10 12.6667H12.6667V10Z",
    fill: "currentColor"
  }), /*#__PURE__*/React.createElement("path", {
    d: "M2.66667 6.66667C3.03486 6.66667 3.33333 6.36819 3.33333 6V3.33333H6C6.36819 3.33333 6.66667 3.03486 6.66667 2.66667C6.66667 2.29848 6.36819 2 6 2H2.66667C2.29848 2 2 2.29848 2 2.66667V6C2 6.36819 2.29848 6.66667 2.66667 6.66667Z",
    fill: "currentColor"
  }));
}

Expand.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
};
Expand.defaultProps = {
  color: "neutral",
  size: 24,
  className: "",
  rotation: 0,
  shade: 500,
  padding: 0,
  onMouseEnter: function onMouseEnter() {},
  onMouseLeave: function onMouseLeave() {}
};
export default Expand;