/**
 * `<avatar-ui>` — User-portrait primitive with an image → initials → icon fallback
chain. Resolves the leading [src] image; on load failure falls back
to [text]-derived initials; on missing text falls back to a slotted
or default <icon-ui>. Use for user identity in chat surfaces,
member tables, statusbar account chips, comment threads. Pair via
<avatar-group-ui> for stacked / overflowed sets.

 *
 * @see https://ui-kit.exe.xyz/site/components/avatar
 *
 * Type declarations generated by scripts/build/dts-codegen.mjs from
 * the component's `.a2ui.json` sidecar(s). Edit the source `.yaml`,
 * run `npm run build:components`, then `npm run codegen:dts` to
 * regenerate; or hand-author this file fully if rich event types are
 * needed beyond what the yaml `events:` block can express.
 */

import { UIElement } from '../../core/element.js';

export class UIAvatar extends UIElement {
  /** Phosphor icon name shown instead of initials when `src`/`text` are empty. */
  icon: string;
  /** Avatar shape */
  shape: 'circle' | 'square';
  /** Avatar size — canonical scale. */
  size: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
  /** Image source URL. Falls back to initials on error. */
  src: string;
  /** Display string (full name or initials). Initials derive from spaces — first letter of each word, max 2. */
  text: string;
}

export class UIAvatarGroup extends UIElement {
  /** Maximum avatars to show before the +N overflow indicator. */
  max: number;
  /** Forwards to each child <avatar-ui> (xs|sm|md|lg|xl). Empty uses the per-avatar size. */
  size: string;
}
