var _excluded = ["color"],
  _excluded2 = ["color", "onClear"];
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
import React from 'react';
import { useI18nContext } from '../_hooks/I18n';
import { StyledPill, StyledRemove } from './Pill.styles';
var Remove = /*#__PURE__*/React.forwardRef(function TokenRemove(_ref, ref) {
  var _ref$color = _ref.color,
    color = _ref$color === void 0 ? 'gray' : _ref$color,
    props = _objectWithoutProperties(_ref, _excluded);
  var i18n = useI18nContext();
  return /*#__PURE__*/React.createElement(StyledRemove, _extends({
    ref: ref,
    "aria-hidden": "false",
    "aria-label": i18n.t('core.token.remove'),
    size: "sm",
    $color: color
  }, props));
});

/**

 Pills are used to highlight important information in a list or form such as
 a status.

 @since 10.19.0

 @see [Storybook](https://stories.core.procore.com/?path=/story/core-react_demos-pill--demo)

 @see [Design Guidelines](https://design.procore.com/pill)

 */
export var Pill = /*#__PURE__*/React.forwardRef(function Pill(_ref2, ref) {
  var _ref2$color = _ref2.color,
    color = _ref2$color === void 0 ? 'gray' : _ref2$color,
    onClear = _ref2.onClear,
    props = _objectWithoutProperties(_ref2, _excluded2);
  return /*#__PURE__*/React.createElement(StyledPill, _extends({
    $color: color
  }, props, {
    ref: ref
  }), props.children, onClear && /*#__PURE__*/React.createElement(Remove, {
    color: color,
    onClick: onClear,
    tabIndex: 0
  }));
});
//# sourceMappingURL=Pill.js.map