var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import React from 'react';
import { addSubcomponents } from '../../utils/addSubcomponents';
import { Icon as IconBase } from '../Icon';
import { StyledIcon, StyledLabel, StyledToken } from './Token.styles';
var Parent = React.forwardRef(function Token(_a, ref) {
    var children = _a.children, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.focused, focused = _c === void 0 ? false : _c, _d = _a.error, error = _d === void 0 ? false : _d, variant = _a.variant, props = __rest(_a, ["children", "disabled", "focused", "error", "variant"]);
    return (React.createElement(StyledToken, __assign({}, props, { ref: ref, "$disabled": disabled || variant === 'disabled', "$focused": focused || variant === 'focused', "$error": error }), children));
});
// TODO - refactor this to not rely on the deprecated Icon component
var Icon = React.forwardRef(function TokenIcon(_a, ref) {
    var icon = _a.icon, props = __rest(_a, ["icon"]);
    return (React.createElement(StyledIcon, null,
        React.createElement(IconBase, __assign({ ref: ref, icon: icon }, props))));
});
var Label = React.forwardRef(function Label(_a, ref) {
    var children = _a.children, props = __rest(_a, ["children"]);
    return (React.createElement(StyledLabel, __assign({ ref: ref }, props), children));
});
Parent.displayName = 'Token';
Icon.displayName = 'Token.Icon';
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://procore.github.io/core/latest/?path=/story/demos-token--demo)

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

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