import "./avatar.css"; import type * as React from "react"; import type { AvatarRootProps } from "@base-ui/react/avatar"; import { type TextSize } from "./text"; import { type StyleProps } from "./style_props"; /** * ONE scale for every avatar in the product — `Avatar` and `MemberChip`. A closed * scale keeps one person the same size on every screen, and lets the initials rule * below key off a rung rather than a pixel count. */ export type AvatarSize = "sm" | "md" | "lg" | "xl"; /** * THE RUNGS. `md` IS `CONTROL_CONTENT_HEIGHT`: an avatar is the tallest thing in * any row that holds one, so a rung that overshoots does not look slightly big — it * RESIZES the container. `lg` is `CONTROL_HEIGHT`, because an avatar standing on * its own in a band IS a control. Only `sm` (too small for two letters) and `xl` * are free. */ export declare const AVATAR_PX: Record; /** * The initials' type size, so a large avatar does not wear tiny letters. The * two-letter rungs sit within 4 points of each other; `sm` runs richer by design, * because one letter in a small circle needs the weight. */ export declare const AVATAR_TEXT: Record; /** * THE GLYPH A MARK DRAWS WHERE THERE ARE NO LETTERS. A glyph is read against the * type beside it, so it takes the icon ladder (`constitution.md` §9); `xl` takes * §9's proportional escape. */ export declare const AVATAR_GLYPH: Record; /** * The initials shown when a member has no photo. * * TWO LETTERS, AND THEY ARE THE FIRST AND **LAST** WORDS — not the first two. A * Vietnamese name is họ + đệm + tên, so the first two words are the family name * and a middle name shared by half the office: "Vũ Thị Lan" and "Vũ Thị Ngọc" both * reduce to "VT". * * `sm` gets ONE letter: two do not fit legibly at 24px. */ export declare function avatarInitials(name: string, size: AvatarSize): string; /** What an `Avatar` draws — a URI, or nothing (initials then). */ export interface AvatarSource { uri?: string; } /** * WHOSE MARK THIS IS, and the only axis in the family. A register of companies * drawn with the same disc as a register of people asserts they are the same kind * of entity; the circle/square split is the convention every product carrying both * uses. One component rather than three, per the kit's mode-is-a-variant rule. */ export type AvatarSubject = "person" | "organization" | "agent"; export interface AvatarProps extends StyleProps { /** A rung on the shared avatar scale — never a pixel count. */ size?: AvatarSize; /** * A `person` (the default) or an `organization` — a company, a team, a group * — which takes the rounded square; an `agent` takes the kit's agent glyph on * the product's own hue. */ subject?: AvatarSubject; source?: AvatarSource; /** * WHO THIS IS, as the caller has them — pass the name you were given and let a * missing one be missing. An entry that substitutes the word for "nobody" hands * the hash a locale string, so one unnamed subject wears two families. */ name?: string | null; /** * What this person SIGNS IN AS. Read only where there is no `name`, and then it * is what the mark is keyed and lettered from. Pass it beside `name` rather than * resolving the pair yourself: `identityKey` is the kit's one reading. */ identity?: string | null; /** `cover` (the default) crops to fill; `contain` fits the whole image in. */ contentFit?: "cover" | "contain"; /** * When true, the avatar announces its `name` to assistive tech. Default false * because avatars almost always appear adjacent to the name text — announcing * the image as well would double-read. */ announce?: boolean; testID?: string; ref?: React.Ref; render?: AvatarRootProps["render"]; } /** * A person, an organization or the agent, as an identity MARK — an image when * there is one, otherwise the mark its `subject` draws. The initials are the mark * until the bytes arrive: Base UI keeps the fallback mounted until the image * reports `loaded`, so a broken source shows a named disc rather than a torn box. */ export declare function Avatar(props: AvatarProps): React.JSX.Element;