import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["children", "className", "type"];
import PropTypes from 'prop-types';
import React from 'react';
import classNames from 'classnames';
import { settings } from '../../globals/js';
var prefix = settings.prefix;
var TYPES = {
  info: 'Info',
  error: 'error',
  success: 'Success',
  warning: 'Warning',
  custom: 'Custom'
};
/** Tag is used to label, categorize, or organize items using keywords that describe them. */

var Tag = function Tag(_ref) {
  var children = _ref.children,
      className = _ref.className,
      type = _ref.type,
      other = _objectWithoutProperties(_ref, _excluded);

  var tagClass = "".concat(prefix, "--tag--").concat(type);
  var tagClasses = classNames("".concat(prefix, "--tag"), tagClass, className);
  return /*#__PURE__*/React.createElement("span", _extends({
    className: tagClasses
  }, other), children || TYPES[type]);
};

Tag.propTypes = {
  /**
   * Provide content to be rendered inside of a <Tag>
   */
  children: PropTypes.node,

  /**
   * Provide a custom className that is applied to the containing <span>
   */
  className: PropTypes.string,

  /**
   * Specify the type of the <Tag>
   */
  type: PropTypes.oneOf(Object.keys(TYPES)).isRequired,

  /**
   * Wrap the line if too long.
   */
  wrap: PropTypes.bool
};
Tag.defaultProps = {
  type: 'info'
};
export var types = Object.keys(TYPES);
export default Tag;