"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.PillType = exports.PillVariant = void 0;
exports.default = Pill;
const classnames_1 = __importDefault(require("classnames"));
const react_1 = __importDefault(require("react"));
const Icon_1 = __importDefault(require("./Icon/Icon"));
var PillVariant;
(function (PillVariant) {
    PillVariant["Outlined"] = "--outlined";
})(PillVariant || (exports.PillVariant = PillVariant = {}));
var PillType;
(function (PillType) {
    PillType["Primary"] = "--accent";
    PillType["Secondary"] = "--accent-2";
    PillType["Warning"] = "--warning";
    PillType["Success"] = "--success";
    PillType["Default"] = "--default";
    PillType["Grey"] = "--grey";
    PillType["Danger"] = "--danger";
})(PillType || (exports.PillType = PillType = {}));
function Pill(props) {
    var _a;
    const { size = 'medium', variant, className } = props;
    const classes = (0, classnames_1.default)('c-pill', variant, className, {
        '--icon-right': props.iconPosition === 'right',
        '--small': size === 'small',
        [(_a = props.type) !== null && _a !== void 0 ? _a : PillType.Default]: true,
    });
    const icon = typeof props.icon === 'string' ? react_1.default.createElement(Icon_1.default, { icon: props.icon, onClick: props.onClickIcon }) : props.icon;
    return (react_1.default.createElement("span", { className: classes },
        (props.iconPosition === 'left' || !props.iconPosition) && icon,
        props.children,
        props.iconPosition === 'right' && icon));
}
//# sourceMappingURL=Pill.js.map