var _excluded = ["focused"],
  _excluded2 = ["children", "disabled"];
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
import { Clear } from '@procore/core-icons';
import React from 'react';
import { useI18nContext } from '../_hooks/I18n';
import { addSubcomponents } from '../_utils/addSubcomponents';
import { StyledContent, StyledContentLabel, StyledFilterRemoveButton, StyledFilterToken, StyledLabel } from './FilterToken.styles';
var Parent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
  var _ref$focused = _ref.focused,
    focused = _ref$focused === void 0 ? false : _ref$focused,
    props = _objectWithoutProperties(_ref, _excluded);
  return /*#__PURE__*/React.createElement(StyledFilterToken, _extends({
    $focused: focused,
    ref: ref
  }, props));
});
var Remove = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
  var children = _ref2.children,
    disabled = _ref2.disabled,
    props = _objectWithoutProperties(_ref2, _excluded2);
  var i18n = useI18nContext();
  return /*#__PURE__*/React.createElement(StyledFilterRemoveButton, _extends({
    $disabled: disabled !== null && disabled !== void 0 ? disabled : false,
    "aria-label": i18n.t('core.token.remove'),
    tabIndex: 0,
    type: "button",
    ref: ref
  }, props), /*#__PURE__*/React.createElement(StyledContent, null, /*#__PURE__*/React.createElement(Clear, {
    "data-icon-prop": "true"
  }), React.Children.map(children, function (child) {
    return /*#__PURE__*/React.createElement(StyledContentLabel, null, child);
  })));
});
var Label = /*#__PURE__*/React.forwardRef(function (props, ref) {
  return /*#__PURE__*/React.createElement(StyledLabel, _extends({
    ref: ref
  }, props));
});
Parent.displayName = 'FilterToken';
Remove.displayName = 'FilterToken.Remove';
Label.displayName = 'FilterToken.Label';
export var FilterToken = addSubcomponents({
  Label: Label,
  Remove: Remove
}, Parent);
//# sourceMappingURL=FilterToken.js.map