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, { forwardRef } from "react";
import { XMarkIcon } from "@navikt/aksel-icons";
import { cl, composeEventHandlers } from "../../utils/helpers/index.js";
import { useI18n } from "../../utils/i18n/i18n.hooks.js";
export const ChipsRemovable = forwardRef((_a, ref) => {
    var { children, variant, onDelete, className, onClick, type = "button", "data-color": color } = _a, rest = __rest(_a, ["children", "variant", "onDelete", "className", "onClick", "type", "data-color"]);
    const translate = useI18n("Chips");
    return (React.createElement("button", Object.assign({ "data-color": color !== null && color !== void 0 ? color : variantToColor(variant) }, rest, { ref: ref, type: type, className: cl("aksel-chips__chip aksel-chips__removable aksel-chips--icon-right", className), "aria-label": `${children} ${translate("Removable.labelSuffix")}`, onClick: composeEventHandlers(onClick, onDelete) }),
        React.createElement("span", { className: "aksel-chips__chip-text" }, children),
        React.createElement("span", { className: "aksel-chips__removable-icon" },
            React.createElement(XMarkIcon, { "aria-hidden": true }))));
});
function variantToColor(variant) {
    switch (variant) {
        case "action":
            return "accent";
        case "neutral":
            return "neutral";
        default:
            return undefined;
    }
}
export default ChipsRemovable;
//# sourceMappingURL=ChipsRemovable.js.map