'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var _tslib = require('../../_virtual/_tslib.js');
var React = require('react');
var styles = require('./styles.js');
var utils = require('./utils.js');
var index = require('../../utils/index.js');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var React__default = /*#__PURE__*/_interopDefaultLegacy(React);

function Tag(_a) {
    var { label, variant = 'neutral', icon, size = 'large', isSubtle, className } = _a, props = _tslib.__rest(_a, ["label", "variant", "icon", "size", "isSubtle", "className"]);
    const TagComponent = utils.getTagComponent(variant);
    const appendTestId = index.getId(props['data-testid']);
    return (React__default['default'].createElement(TagComponent, { className: className, size: size, isSubtle: isSubtle, "data-testid": props['data-testid'], "data-trackid": props['data-trackid'], "aria-label": props['aria-label'] || label },
        icon && size === 'large' && (React__default['default'].createElement(styles.IconWrapper, { "data-testid": appendTestId('icon') }, icon)),
        label));
}

exports.Tag = Tag;
