import type { MdyFieldError } from "@modyra/core"; import type { MdyPartContract } from "../contract.js"; import type { MdyDaterangeFieldState } from "./daterange-field-types.js"; export interface MdyDaterangeFieldA11yOptions { /** * 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; /** How each end is named, for a host that translates. Defaults are English and deliberate. */ /** * The caption a document wrote, which names the pair rather than either box. * * The two ends together are the thing the author named; each box has a name of its own that says * its role in the pair. Given here, the group says the author's word once on entry. ADR 0175. */ readonly label?: string; readonly startLabel?: string; readonly endLabel?: string; /** * The field's path, from which each end takes the key it submits under. * * Two ends under one key would leave a receiving end unable to say which date is which — and * `FormData.get` takes the first and drops the other without an error, so the loss is silent. So * they are suffixed, and the contract declares the suffixes rather than each renderer inventing * them. */ readonly submitName?: string; } export declare function daterangeFieldPartIds(widgetId: string): { readonly labelId: string; readonly startId: string; readonly endId: string; readonly gridId: string; readonly descriptionId: string; readonly errorId: string; }; /** The root's classes, from the shared table every kind reads. */ export declare function daterangeFieldRootClasses(state: MdyDaterangeFieldState): readonly string[]; export declare function projectDaterangeFieldA11y(state: MdyDaterangeFieldState, errors: ReadonlyArray, options: MdyDaterangeFieldA11yOptions): { readonly root: MdyPartContract; readonly label: MdyPartContract; /** The box holding both ends, which is what the caption names. ADR 0175. */ readonly inputWrapper: MdyPartContract; readonly startControl: MdyPartContract; readonly endControl: MdyPartContract; readonly toggle: MdyPartContract; readonly grid: MdyPartContract; readonly description: MdyPartContract; readonly error: MdyPartContract; };