import type { LocaleProp } from '../../utils/locale'; import type { IconName } from '../mud-icon/mud-icon.types'; import type { AvatarSize, AvatarType } from './mud-avatar.types'; /** * Avatar — represents a user via a photo, initials, or a generic person icon. * * Pattern A (atom-display): wraps a single piece of slottable content (an * optional notification badge) and otherwise renders its own internal DOM. * * The component picks its visual mode from the `type` prop: * - `photo` — renders `` from `src`; if the image fails to load, falls * back to initials (when `name`/`initials` is set) or the person icon. * - `initials` — renders 1–2 uppercase letters derived from `initials` or * `name`. If neither is set, the icon fallback kicks in. * - `icon` — renders a `mud-icon` (default `person`). * * @element mud-avatar * * @slot badge - Optional notification badge composed on the top-right edge * (e.g. ``), sized to the * avatar's rung. */ export declare class MudAvatar { /** * Visual mode. `photo` renders `src`, `initials` renders 1–2 letters, * `icon` renders the person glyph. * @default 'initials' */ type: AvatarType; /** * Visual size rung. Matches the Figma scale (xs=24, sm=32, md=40, * lg=48, xl=72). * @default 'md' */ size: AvatarSize; /** * Source URL for `type="photo"`. Ignored otherwise. */ src?: string; /** * Alt text for the underlying `` when `type="photo"`. Falls back to * `name` so screen readers always get a description; pass an empty string * to mark the photo as purely decorative. */ alt?: string; /** * Pre-computed initials. When omitted, `name` is used to derive them. * Trimmed to two characters and uppercased before rendering. */ initials?: string; /** * Full name of the represented person. Used to (a) derive `initials` when * none are provided and (b) seed `alt` for the photo so the avatar is * always announced. */ name?: string; /** * Icon glyph for `type="icon"`. Defaults to the generic `person` symbol. * @default 'person' */ iconName: IconName; /** * Language of the built-in copy. Unset, the component follows the closest ancestor `lang` * (`` included), else `ro-MD`. */ locale?: LocaleProp; /** * Accessible-name fallback when only initials (no `name`) are set. Carries a `{initials}` * placeholder. Overrides the `locale`'s copy when set to a non-empty string. * @default 'Avatar pentru {initials}' (ro-MD) */ initialsLabel?: string; /** * Accessible-name fallback when neither `name` nor initials are set. Overrides the * `locale`'s copy when set to a non-empty string. * @default 'Avatar utilizator' (ro-MD) */ fallbackLabel?: string; private imageFailed; host: HTMLMudAvatarElement; /** * Names the host: keeps the consumer's native `aria-label` attribute when * set (the avatar is then exposed to AT as a single labelled element), * otherwise applies the computed fallback — `name`, then the initials, then * the locale's `fallbackLabelText`. See `nameHostWithFallback`. */ private hostLabel?; private stopLang?; onSrcChange(): void; connectedCallback(): void; disconnectedCallback(): void; componentWillRender(): void; /** Built-in strings in the resolved locale, with the override props on top. */ private messages; private handleImageError; private get resolvedInitials(); private get resolvedType(); private computeFallbackLabel; render(): any; }