import { jsx as _jsx } from "react/jsx-runtime";
import { bem } from "../@utils/bem.js";
import { UiIcon } from "../UiIcon/UiIcon.js";
const { b } = bem("gd-ui-kit-avatar");
const DEFAULT_SIZE = 32;
const DEFAULT_BACKGROUND = "complementary-2";
const DEFAULT_ICON_COLOR = "complementary-5";
const ICON_TO_AVATAR_RATIO = 0.44;
/**
 * Circle avatar with a centered icon. Generic small "who" indicator
 * (grantees, presence, audit log, activity feed, ...). Wrap in a
 * domain-specific component to pick the right icon + label per kind.
 *
 * @internal
 */
export function UiAvatar({ icon, size = DEFAULT_SIZE, backgroundColor = DEFAULT_BACKGROUND, iconColor = DEFAULT_ICON_COLOR, iconSize, accessibilityConfig, dataTestId, }) {
    const resolvedIconSize = iconSize ?? Math.round(size * ICON_TO_AVATAR_RATIO);
    return (_jsx("span", { className: b({ background: backgroundColor }), "data-testid": dataTestId, style: { "--gd-avatar-size": `${size}px` }, children: _jsx(UiIcon, { type: icon, size: resolvedIconSize, color: iconColor, accessibilityConfig: accessibilityConfig }) }));
}
