import { a as IconSize, n as AnalyticsId } from "../../constants2.js";
import { t as usePseudoClasses } from "../../usePseudoClasses.js";
import { t as palette } from "../../palette.js";
import { t as Icon_default } from "../../Icon.js";
import { t as Undo_default } from "../../Undo.js";
import { t as X_default } from "../../X.js";
import React from "react";
import classNames from "classnames";
import { jsx, jsxs } from "react/jsx-runtime";
import styles from "./styles.module.scss";
let ChipSize = /* @__PURE__ */ function(ChipSize$1) {
	ChipSize$1["medium"] = "medium";
	ChipSize$1["large"] = "large";
	return ChipSize$1;
}({});
let ChipAction = /* @__PURE__ */ function(ChipAction$1) {
	ChipAction$1["remove"] = "remove";
	ChipAction$1["undo"] = "undo";
	return ChipAction$1;
}({});
let ChipVariant = /* @__PURE__ */ function(ChipVariant$1) {
	ChipVariant$1["normal"] = "normal";
	ChipVariant$1["oncolor"] = "oncolor";
	ChipVariant$1["emphasised"] = "emphasised";
	return ChipVariant$1;
}({});
var Chip = (props) => {
	const { children, size = ChipSize.medium, color = "blueberry", variant = "normal", action, onClick, testId } = props;
	const { refObject, isHovered } = usePseudoClasses();
	const chipClasses = classNames(styles.chip, styles[`chip--${size}`], styles[`chip--${color}`], styles[`chip--${variant}`], { [styles[`chip--undo`]]: action === "undo" });
	const getActionIcon = () => {
		switch (action) {
			case "undo": return Undo_default;
			case "remove": return X_default;
		}
	};
	return /* @__PURE__ */ jsxs("button", {
		className: chipClasses,
		onClick,
		ref: refObject,
		type: "button",
		"data-testid": testId,
		"data-analyticsid": AnalyticsId.Tag,
		children: [children, /* @__PURE__ */ jsx(Icon_default, {
			svgIcon: getActionIcon(),
			size: IconSize.XXSmall,
			color: palette[`${color}800`],
			isHovered
		})]
	});
};
var Chip_default = Chip;
export { ChipAction, ChipSize, ChipVariant, Chip_default as default };

//# sourceMappingURL=index.js.map