import { a as IconSize, n as AnalyticsId } from "./constants2.js";
import { t as palette } from "./palette.js";
import { t as Icon_default } from "./Icon.js";
import { t as Check_default } from "./Check.js";
import classNames from "classnames";
import { jsx } from "react/jsx-runtime";
import styles from "./components/Avatar/styles.module.scss";
let AvatarSize = /* @__PURE__ */ function(AvatarSize$1) {
	AvatarSize$1["xsmall"] = "xsmall";
	AvatarSize$1["small"] = "small";
	return AvatarSize$1;
}({});
var Avatar = (props) => {
	const { children, className = "", selected = false, color = "blueberry", variant = "square", size = AvatarSize.small, testId, ref } = props;
	const truncatedName = children.charAt(0).toLocaleUpperCase() + children.substring(1, 2);
	return /* @__PURE__ */ jsx("span", {
		className: classNames(styles.avatar, selected && styles["avatar--selected"], color === "black" && styles["avatar--black"], variant === "circle" && styles["avatar--circle"], size === AvatarSize.xsmall && styles["avatar--xsmall"], size === AvatarSize.small && styles["avatar--small"], className),
		ref,
		"data-testid": testId,
		"data-analyticsid": AnalyticsId.Avatar,
		children: selected ? /* @__PURE__ */ jsx(Icon_default, {
			svgIcon: Check_default,
			size: IconSize.Small,
			color: color === "black" ? palette.neutral900 : palette.blueberry600
		}) : truncatedName
	});
};
var Avatar_default$1 = Avatar;
export { AvatarSize as n, Avatar_default$1 as t };

//# sourceMappingURL=Avatar.js.map