import * as React from 'react'; import { ValuesOf } from '../utils/typeUtils'; import { AVATAR_COLORS, AVATAR_SHAPES } from './Avatar.constants'; export type AvatarShape = ValuesOf; export type AvatarColor = (typeof AVATAR_COLORS)[number]; export type AvatarPresence = 'online' | 'offline' | 'busy'; export type AvatarSize = 'size90' | 'size72' | 'size60' | 'size48' | 'size36' | 'size30' | 'size24' | 'size18'; export interface AvatarProps { /** Controls the shape of the image. * @default 'circle' */ shape?: AvatarShape; /** Controls the size of an avatar. * @default 'size48' */ size?: AvatarSize; /** Specifies a CSS class name to be appended to the component's root element. * @internal */ className?: string; /** Sets the presence status of an avatar. */ presence?: AvatarPresence; /** Accept any content to render as an indication item. */ indication?: React.ReactNode; /** * Accept any content to render as a custom indication item. This indication element won't be wrapped by an IconButton. * It could be rendered in other shapes (such as square). * */ customIndication?: React.ReactNode; /** Shows indication element on hover. * @default false */ showIndicationOnHover?: boolean; /** Defines a callback function which is called every time indication element is clicked. */ onIndicationClick?(): void; /** Shows a loader on top of an avatar. */ loading?: boolean; /** Defines a string that labels the current element in case where text label isn't visible on the screen. */ ariaLabel?: string; /** * Controls the background color of the avatar. If not provided, * color is determined by the provided text or name so that each name receives a different color. */ color?: AvatarColor; /** Accept all common `` tag properties. */ imgProps?: React.ImgHTMLAttributes; /** * Defines a name of the avatar user. Text initials are generated from the name. * The name value is used as the default value for HTML title and `aria-label` attributes. * And also as default value for the image's alt attribute if `imgProps` is provided. */ name?: string; /** Defines a text to render as a content instead of a given `name`. */ text?: string; /** Defines a click event handler. When defined, component will be clickable and will have a pointer cursor on hover. */ onClick?(): void; /** * Accept any content to render as a content placeholder. This placeholder is displayed if no text, name or imgProps are provided.
* By default use a generic avatar user icon. */ placeholder?: React.ReactNode; /** Defines a standard HTML title attribute value. Applies it to the root element. */ title?: string; /** Applies a data-hook HTML attribute that can be used in the tests. */ dataHook?: string; } //# sourceMappingURL=Avatar.types.d.ts.map