import { j as jsxRuntimeExports } from '../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js';
import { Root as $cddcb0b647441e34$export$be92b6f5f03c0fe9, Image as $cddcb0b647441e34$export$3e431a229df88919, Fallback as $cddcb0b647441e34$export$fb8d7f40caaeea67 } from '../../node_modules/.pnpm/@radix-ui_react-avatar@1.0.3_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-avatar/dist/index.js';
import { cva } from '../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js';
import { clsx } from '../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js';
import { forwardRef } from 'react';
import { Box } from '../box/box.js';
import styles from './avatar.module.css.js';

const avatar = cva(styles.avatar, {
    variants: {
        radius: {
            small: styles["avatar-small"],
            full: styles["avatar-full"],
        },
        size: {
            1: styles["avatar-size-1"],
            2: styles["avatar-size-2"],
            3: styles["avatar-size-3"],
            4: styles["avatar-size-4"],
            5: styles["avatar-size-5"],
            6: styles["avatar-size-6"],
            7: styles["avatar-size-7"],
            8: styles["avatar-size-8"],
            9: styles["avatar-size-9"],
            10: styles["avatar-size-10"],
            11: styles["avatar-size-11"],
            12: styles["avatar-size-12"],
            13: styles["avatar-size-13"],
        },
        variant: {
            solid: styles["avatar-solid"],
            soft: styles["avatar-soft"],
        },
        disabled: {
            true: styles["avatar-disabled"],
        },
        color: {
            indigo: styles["avatar-color-indigo"],
            orange: styles["avatar-color-orange"],
            mint: styles["avatar-color-mint"],
            neutral: styles["avatar-color-neutral"],
            sky: styles["avatar-color-sky"],
            lime: styles["avatar-color-lime"],
            grass: styles["avatar-color-grass"],
            cyan: styles["avatar-color-cyan"],
            iris: styles["avatar-color-iris"],
            purple: styles["avatar-color-purple"],
            pink: styles["avatar-color-pink"],
            crimson: styles["avatar-color-crimson"],
            gold: styles["avatar-color-gold"],
        },
    },
    compoundVariants: [
        { variant: 'solid', color: 'indigo', className: styles['avatar-solid-indigo'] },
        { variant: 'solid', color: 'orange', className: styles['avatar-solid-orange'] },
        { variant: 'solid', color: 'mint', className: styles['avatar-solid-mint'] },
        { variant: 'solid', color: 'sky', className: styles['avatar-solid-sky'] },
        { variant: 'solid', color: 'lime', className: styles['avatar-solid-lime'] },
        { variant: 'solid', color: 'grass', className: styles['avatar-solid-grass'] },
        { variant: 'solid', color: 'cyan', className: styles['avatar-solid-cyan'] },
        { variant: 'solid', color: 'iris', className: styles['avatar-solid-iris'] },
        { variant: 'solid', color: 'purple', className: styles['avatar-solid-purple'] },
        { variant: 'solid', color: 'pink', className: styles['avatar-solid-pink'] },
        { variant: 'solid', color: 'crimson', className: styles['avatar-solid-crimson'] },
        { variant: 'solid', color: 'gold', className: styles['avatar-solid-gold'] },
        { variant: 'soft', color: 'indigo', className: styles['avatar-soft-indigo'] },
        { variant: 'soft', color: 'orange', className: styles['avatar-soft-orange'] },
        { variant: 'soft', color: 'mint', className: styles['avatar-soft-mint'] },
        { variant: 'soft', color: 'sky', className: styles['avatar-soft-sky'] },
        { variant: 'soft', color: 'lime', className: styles['avatar-soft-lime'] },
        { variant: 'soft', color: 'grass', className: styles['avatar-soft-grass'] },
        { variant: 'soft', color: 'cyan', className: styles['avatar-soft-cyan'] },
        { variant: 'soft', color: 'iris', className: styles['avatar-soft-iris'] },
        { variant: 'soft', color: 'purple', className: styles['avatar-soft-purple'] },
        { variant: 'soft', color: 'pink', className: styles['avatar-soft-pink'] },
        { variant: 'soft', color: 'crimson', className: styles['avatar-soft-crimson'] },
        { variant: 'soft', color: 'gold', className: styles['avatar-soft-gold'] },
    ],
    defaultVariants: {
        size: 3,
        radius: "small",
        variant: "soft",
        color: "indigo",
    },
});
const image = cva(styles.image);
const AvatarRoot = forwardRef(({ className, alt, src, fallback, size, radius, variant, color, style, asChild, ...props }, ref) => (jsxRuntimeExports.jsx(Box, { className: styles.imageWrapper, style: style, children: jsxRuntimeExports.jsxs($cddcb0b647441e34$export$be92b6f5f03c0fe9, { ref: ref, className: clsx(avatar({ size, radius, variant, color }), className), asChild: asChild, ...props, children: [jsxRuntimeExports.jsx($cddcb0b647441e34$export$3e431a229df88919, { className: image(), src: src, alt: alt }), jsxRuntimeExports.jsx($cddcb0b647441e34$export$fb8d7f40caaeea67, { className: styles.fallback, children: fallback })] }) })));
AvatarRoot.displayName = $cddcb0b647441e34$export$be92b6f5f03c0fe9.displayName;
const Avatar = AvatarRoot;
const AvatarGroup = forwardRef(({ children, max, className, ...props }, ref) => {
    const avatars = max ? children.slice(0, max) : children;
    const count = max && children.length > max ? children.length - max : 0;
    return (jsxRuntimeExports.jsxs("div", { ref: ref, className: clsx(styles.avatarGroup, className), ...props, children: [avatars.map((avatar, index) => (jsxRuntimeExports.jsx("div", { className: styles.avatarWrapper, children: avatar }, index))), count > 0 && (jsxRuntimeExports.jsx("div", { className: styles.avatarWrapper, children: jsxRuntimeExports.jsx(Avatar, { size: avatars[0].props.size, radius: avatars[0].props.radius, variant: avatars[0].props.variant, color: 'neutral', fallback: jsxRuntimeExports.jsxs("span", { children: ["+", count] }) }) }))] }));
});
AvatarGroup.displayName = 'AvatarGroup';

export { Avatar, AvatarGroup };
//# sourceMappingURL=avatar.js.map
