/** * Label derivation for `Chip purpose="picker"`. * * Kept out of the component so it can be tested in the node-only unit project, * and because the visible text and the accessible name have to be derived * together. They diverge on purpose -- the chip abbreviates to stay narrow in a * filter bar, while the accessible name spells the selection out -- and a * reader of one has to be able to see the other beside it, or they drift. */ /** * How the trigger summarises its selection. * * `value` names the first selection and counts the rest, which is what a user * wants for a short closed vocabulary: `Severity: Critical +1` still says which * severity. `count` names none of them, for values too long to sit in a chip -- * a datastore index called `classifyout-saviynt_subscriber-saviynt-v4` would * push the chip past the width of the bar and tell the user nothing more than * `Datasources: 3` does. */ export type PickerSummary = 'value' | 'count'; export interface PickerLabel { /** * The field's name. Always present, and rendered in the muted ink: it is the * constant, so it should not compete with the part that changes. */ field: string; /** * The selection as shown after the colon -- a value under `summary: 'value'`, * a number under `'count'`. Undefined when nothing is selected, which is what * suppresses the colon rather than leaving `Severity:` trailing into nothing. */ detail?: string; /** What the counter shows, or 0 when no counter is needed. */ overflow: number; /** The full selection, spoken. Always names what the visible text elides. */ accessibleName: string; } /** * Derives the visible text, the counter and the accessible name for a picker * chip. * * @param field The filter's name, e.g. `Severity`. Always visible, so an empty * picker still says what it filters. * @param values The selection, already resolved to the labels a user reads -- * not raw option values. A chip showing `sev_1` has failed. */ export declare function pickerLabel(field: string, values: string[], summary?: PickerSummary): PickerLabel;