@kadconsulting/dry
Version:
KAD Reusable Component Library
67 lines (66 loc) • 1.86 kB
TypeScript
import { HTMLAttributes } from 'react';
export declare enum AvatarSize {
XS = "xs",
SM = "sm",
MED = "med",
LG = "lg",
XL = "xl",
XXL = "2xl"
}
export declare enum AvatarState {
DEFAULT = "default",
HOVER = "hover",
FOCUSED = "focused",
DISABLED = "disabled"
}
export declare enum StatusIcon {
NONE = "none",
ONLINE = "online",
COMPANY = "company",
VERIFIED = "verified"
}
export declare enum ImageType {
SQUARE = "square",
PORTRAIT = "portrait"
}
export interface BaseAvatarProps extends HTMLAttributes<HTMLElement> {
id?: string;
size?: AvatarSize;
state?: AvatarState;
'data-testid'?: string;
imageUrl?: string;
}
export interface AvatarImageProps extends BaseAvatarProps {
variant: 'image';
imageUrl?: string;
type?: ImageType;
}
export interface AvatarOnlineProps extends BaseAvatarProps {
variant: 'online';
isOnline: boolean;
}
export interface AvatarCompanyProps extends BaseAvatarProps {
variant: 'company';
}
export interface AvatarVerifiedProps extends BaseAvatarProps {
variant: 'verified';
}
export interface AvatarAddButtonProps extends BaseAvatarProps {
variant: 'addButton';
}
export interface AvatarGroupProps extends BaseAvatarProps {
variant: 'group';
moreUsers?: boolean;
addMoreButton?: boolean;
}
export interface AvatarLabelGroupProps extends BaseAvatarProps {
variant: 'labelGroup';
statusIcon?: StatusIcon;
}
export interface AvatarProfilePhotoProps extends Omit<BaseAvatarProps, 'placeholder'> {
variant: 'profilePhoto';
placeholder?: boolean;
text?: boolean;
verified?: boolean;
}
export type AvatarProps = AvatarImageProps | AvatarOnlineProps | AvatarCompanyProps | AvatarVerifiedProps | AvatarAddButtonProps | AvatarGroupProps | AvatarLabelGroupProps | AvatarProfilePhotoProps;