import type * as React from "react"; import { type ReactNode } from "react"; import { useRender } from "@base-ui/react/use-render"; import type { Picture } from "./avatar"; import { type StyleProps } from "./style_props"; export interface LinkValueLabels { /** The removal's accessible name: the row is unlinked, never deleted. */ remove: (title: string) => string; } /** What a row is drawn by where it is named: someone's face, or a thing's picture. */ export interface LinkValueImage { /** An image's URL, or the file the picture is: a video draws its first frame, a document its badge's tile. */ src?: Picture; name: string; /** Someone — `person` a disc, `organization` a rounded square: their picture, else their initials. Absent, a * thing: its picture, else the dashed tile of the picture not held — a thing is never its initials. */ subject?: "person" | "organization"; } /** * How much of the row a place has room for. * - `option` — a picker's option, the value it chose, a read fact: the title over its line. * - `cell` — one line, for a child row's cell or a header's run: the mark, the title and the figure. * - `line` — a statement on a row's supporting line: its picture at the line's rung and its title at the * line's size, so the line never grows for it — as a person there is `MemberChip dense`. */ export type LinkValueDensity = "option" | "cell" | "line"; export interface LinkValueProps extends StyleProps { /** Someone's face or a thing's picture (`LinkValueImage`); a face without a picture is initials on a colour hashed * from `name`. */ image?: LinkValueImage; title: string; /** Read under the title as one line; two runs at most, since a third is never seen in a picker. */ subtitle?: readonly string[]; /** A deadline past or close, in its tone: first on the line, so an expired row never reads as good as * any other. */ due?: ReactNode; /** Where the row stands — its status, drawn as the register draws it — so a closed row reads closed * where it is picked. */ stage?: ReactNode; /** A number or a small meter, at the right edge. */ figure?: ReactNode; /** Default `option`. */ density?: LinkValueDensity; /** A link chip's removal, after the figure: the row is unlinked, never deleted. */ onRemove?: () => void; labels?: Partial; testID?: string; ref?: React.Ref; render?: useRender.RenderProp; } /** * A LINKED ROW, read the same wherever it is picked or chosen — a picker's option, the picker's field once * chosen, a link chip, a read fact, a child row's cell: its picture, its title, the line under it and its * one figure (a meter where the row is bounded), as the register reads the row. On one line (a cell, a * header's run) the title stands whole first: the figure stands beside it only where both fit, and drops * before the title is cut. */ export declare function LinkValue(props: LinkValueProps): React.JSX.Element;