var _excluded = ["children", "disabled", "focused", "error", "variant"],
  _excluded2 = ["children"];
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
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 { addSubcomponents } from '../_utils/addSubcomponents';
import { StyledLabel, StyledRemove, StyledToken } from './Token.styles';
var Parent = /*#__PURE__*/React.forwardRef(function Token(_ref, ref) {
  var children = _ref.children,
    _ref$disabled = _ref.disabled,
    disabled = _ref$disabled === void 0 ? false : _ref$disabled,
    _ref$focused = _ref.focused,
    focused = _ref$focused === void 0 ? false : _ref$focused,
    _ref$error = _ref.error,
    error = _ref$error === void 0 ? false : _ref$error,
    variant = _ref.variant,
    props = _objectWithoutProperties(_ref, _excluded);
  return /*#__PURE__*/React.createElement(StyledToken, _extends({}, props, {
    ref: ref,
    $disabled: disabled || variant === 'disabled',
    $focused: focused || variant === 'focused',
    $error: error
  }), children);
});
var Remove = /*#__PURE__*/React.forwardRef(function TokenRemove(_ref2, ref) {
  var props = _extends({}, (_objectDestructuringEmpty(_ref2), _ref2));
  var i18n = useI18nContext();
  return /*#__PURE__*/React.createElement(StyledRemove, _extends({
    ref: ref,
    "aria-hidden": "false",
    "aria-label": i18n.t('core.token.remove')
  }, props));
});
var Label = /*#__PURE__*/React.forwardRef(function Label(_ref3, ref) {
  var children = _ref3.children,
    props = _objectWithoutProperties(_ref3, _excluded2);
  return /*#__PURE__*/React.createElement(StyledLabel, _extends({
    ref: ref
  }, props), children);
});
Parent.displayName = 'Token';
Remove.displayName = 'Token.Remove';
Label.displayName = 'Token.Label';

/**

 We use tokens in our multi select dropdowns and file attachers to indicate what
 has been selected or attached. Tokens in these components are removable.

 @since 10.19.0

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

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

 */
export var Token = addSubcomponents({
  Label: Label,
  Remove: Remove
}, Parent);
//# sourceMappingURL=Token.js.map