import type { MdyFieldError } from "@modyra/core"; import type { MdyPartContract } from "../contract.js"; import type { MdyMultiselectFieldState } from "./multiselect-field-types.js"; export interface MdyMultiselectFieldA11yOptions { /** * Whether the supporting text is on the page. * * Named unconditionally, the description points at an element a renderer may not have drawn — the * reference resolves to nothing and the control is described by an id rather than by words. * Defaults to true, which is what every caller relied on before it could say otherwise. */ readonly descriptionVisible?: boolean; /** * Whether the error container is on the page, whether or not it holds a message. * * A renderer that keeps it under every field that can fail a rule passes this, and the control's * description then names one element that never changes — no moment at which the reference can * point at something not yet drawn, or already gone. * * Defaults to whether there are errors to show, so a renderer that draws the container only when it * has something to say is unaffected. */ readonly errorsReserved?: boolean; readonly widgetId: string; } /** Builds the static IDs used by a multiselect field widget view. */ export declare function multiselectFieldPartIds(widgetId: string): { readonly labelId: string; readonly groupId: string; readonly triggerId: string; readonly popupId: string; readonly searchId: string; readonly descriptionId: string; readonly errorId: string; }; /** Computes the public state classes for the multiselect field root. */ export declare function multiselectFieldRootClasses(state: MdyMultiselectFieldState): readonly string[]; /** * Projects ARIA attributes and classes for the multiselect field parts (per-option chip parts are * built by the controller, same split option-field-controller.ts uses). * * The options live in an overlay, like every other popup widget in the catalog: `trigger` is what * the user sees and operates, `popup` is the panel it controls, and `group` is the chip group * inside it. Laying the group out inline instead would reflow the page on every open. */ export declare function projectMultiselectFieldA11y(state: MdyMultiselectFieldState, errors: ReadonlyArray, options: MdyMultiselectFieldA11yOptions): { readonly root: MdyPartContract; readonly label: MdyPartContract; readonly trigger: MdyPartContract; readonly placeholder: MdyPartContract; readonly chips: MdyPartContract; /** The single row a grid structures its cells in. */ readonly chipRow: MdyPartContract; readonly popup: MdyPartContract; readonly search: MdyPartContract; readonly group: MdyPartContract; readonly description: MdyPartContract; readonly error: MdyPartContract; /** * What was chosen, said out loud, with the words to say it. * * A choice lands and the strip is the only confirmation — which is the one a screen reader user * does not get. The text is the whole selection rather than the last change, so it differs * whenever the selection does: a region written once announces the first choice and swallows * every one after it, which passes any check that makes only one. */ readonly announcement: MdyPartContract & { readonly text: string; }; /** * One chip in the strip: a value the person has chosen, as they see it. * * Projected rather than left to each renderer, because it is the element of this widget a person * looks at most and it was the one element no projection described. Three renderers each built it, * and they were brought into agreement one attribute at a time — the value class reached the last * of them a day after the other two, and a chip that said where it stood in the strip reached one * of them first. Agreement arrived at by correction diverges again on the next attribute nobody * has measured. * * `position` and `size` are the chip's place in the strip and how many there are. They are given * rather than derived because the strip decides what it draws — a strip that hides what does not * fit still has to say one of eight, not one of three. */ readonly chip: (key: string, appearance: { readonly label: string; readonly count: number; readonly position: number; readonly size: number; readonly active: boolean; readonly named: boolean; }) => MdyPartContract; };