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 Exclamation(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 4 16",
    fill: "none",
    height: sizeIcon,
    width: sizeIcon
  }, otherProps), /*#__PURE__*/React.createElement("path", {
    d: "M1.67 0C.75 0 .006.797.006 1.78v7.123c0 .983.745 1.78 1.664 1.78.919 0 1.663-.797 1.663-1.78V1.78C3.333.797 2.59 0 1.67 0Zm-.333 12.464c-.104.02-.205.056-.3.107a1.234 1.234 0 0 0-.299.16l-.25.214a1.94 1.94 0 0 0-.482 1.264 2.344 2.344 0 0 0 0 .338c.016.118.05.233.1.339.036.113.087.221.15.32.061.094.128.183.2.267a1.61 1.61 0 0 0 1.18.527c.444 0 .87-.19 1.182-.527l.2-.267c.062-.099.113-.207.149-.32.05-.106.084-.22.1-.339a2.343 2.343 0 0 0 0-.338 1.835 1.835 0 0 0-.598-1.404 1.584 1.584 0 0 0-1.399-.377l.067.036Z",
    fill: "currentColor"
  }));
}

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