import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import React from 'react';
import classNames from 'classnames';
/**
 * The `Icon` is used to display a state template icon,
 * automatically prefixing all icons with the correct class names.
 * See http://template.webstandards.ca.gov/sample/icon-fonts.html
 * for the full list of avaiable icon names.
 */

var Icon = function Icon(props) {
  var name = props.name,
      className = props.className,
      Tag = props.tag,
      rest = _objectWithoutProperties(props, ["name", "className", "tag"]);

  var cn = classNames([className, "ca-gov-icon-".concat(name)]);
  return React.createElement(Tag, Object.assign({
    className: cn
  }, rest));
};

Icon.defaultProps = {
  className: null,
  tag: 'span'
};
export default Icon;