"use client"; /* * Documentation: * Avatar Group — https://app.subframe.com/f023064a5ca0/library?component=Avatar+Group_6e7444ab-1d67-47f5-af23-1a2d3ecf1016 */ import React from "react"; import * as SubframeUtils from "../../utils"; export interface AvatarOverflowProps extends React.HTMLAttributes { border?: boolean; overflowLabel?: React.ReactNode; className?: string; } const AvatarOverflow = React.forwardRef( function AvatarOverflow( { border = false, overflowLabel, className, ...otherProps }: AvatarOverflowProps, ref ) { return (
{overflowLabel ? ( {overflowLabel} ) : null}
); } ); export interface AvatarGroupRootProps extends React.HTMLAttributes { hoverEffect?: "on" | "off"; border?: boolean; showOverflow?: boolean; children?: React.ReactNode; overflowLabel?: React.ReactNode; className?: string; } const AvatarGroupRoot = React.forwardRef( function AvatarGroupRoot( { hoverEffect = "off", border = false, showOverflow = false, children, overflowLabel, className, ...otherProps }: AvatarGroupRootProps, ref ) { return (
*:not(:first-child)]:-ml-2", className )} ref={ref} {...otherProps} > {children ? (
*:not(:first-child)]:-ml-2 [&>*]:relative relative [&>*]:z-0 z-0 [&>*:nth-child(1)]:z-[1] [&>*:nth-child(2)]:z-[2] [&>*:nth-child(3)]:z-[3] [&>*:nth-child(4)]:z-[4] [&>*:nth-child(5)]:z-[5]", { "[&>*]:border [&>*]:border-solid [&>*]:border-border-on-primary": border, "[&>*]:transition-transform [&>*]:duration-200 [&>*:hover]:scale-110 [&>*:hover]:rotate-6 [&>*:hover]:z-20": hoverEffect === "on", } )} > {children}
) : null}
); } ); export const AvatarGroup = Object.assign(AvatarGroupRoot, { AvatarOverflow, });