UNPKG

@atlaskit/avatar

Version:

An avatar is a visual representation of a user or entity.

52 lines (51 loc) 1.69 kB
import { type ForwardedRef, type MouseEventHandler, type ReactNode } from 'react'; import { type AppearanceType, type SizeType } from './types'; export type AvatarContextProps = { size: SizeType; }; /** * __Avatar context__ * * This allows setting the size of all avatars under a context provider. * * ```tsx * <AvatarContext.Provider value={{ size: 'small' }}> * <Avatar * // ...props * /> * </AvatarContext.Provider> * ``` */ export declare const AvatarContext: import("react").Context<AvatarContextProps | undefined>; export declare const useAvatarContext: () => AvatarContextProps | undefined; type AvatarContentContextProps = { as: 'a' | 'button' | 'span'; appearance: AppearanceType; avatarImage: ReactNode; borderColor?: string; href?: string; isDisabled?: boolean; label?: string; onClick?: MouseEventHandler; ref: ForwardedRef<HTMLElement>; tabIndex?: number; target?: '_blank' | '_self' | '_top' | '_parent'; testId?: string; size: SizeType; stackIndex?: number; }; /** * __Avatar content context__ * * This context provides the props for the AvatarContent component, enabling * consumers to compose the AvatarContent with the Avatar component. */ export declare const AvatarContentContext: import("react").Context<AvatarContentContextProps>; export declare const useAvatarContent: () => AvatarContentContextProps; /** * Used to ensure Avatar sub-components are used within a Avatar component, * and provide a useful error message if not. */ export declare const EnsureIsInsideAvatarContext: import("react").Context<boolean>; export declare const useEnsureIsInsideAvatar: () => void; export {};