Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions packages/scripts/dist/a11y.d.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
export declare class A11y {
private logger;
private observer;
private liveRegionUpdateTimeout;
private shouldFocusFirstInvalidField;
constructor();
/**
* Apply the field-level accessibility tagging (error alert live regions,
* Apply the field-level accessibility tagging (error containers,
* aria-required, fallback aria-labels, radio group roles) to every field
* within `root`. Defaults to the whole document on initial load, but can be
* pointed at a freshly injected fragment (e.g. a Supporter Hub overlay) so
* dynamically added forms get the same treatment. All operations are
* idempotent, so re-scanning already tagged fields is safe.
*/
static scanFields(root?: ParentNode): void;
private static addErrorAlertArea;
private static addGlobalErrorLiveRegion;
private static addGroupRole;
private static addRequired;
private static addLabel;
private updateFrequencyLabel;
private setAutoGeneratedAltTags;
/**
* Observe #engrid for .en__field__error additions and removals, mirroring
* text into the per-field .en__field__error__alert live region and toggling
* aria-invalid / aria-describedby on the corresponding input. Runs for the
* lifetime of the page so async validators (NeverBounce, VGS, server
* re-renders) are caught without timing assumptions.
* Observe #engrid for .en__field__error additions and removals, relocating
* each error after its field's input so DOM order matches visual order. Also
* toggles aria-invalid / aria-describedby on the corresponding input (or radio
* group when the field has role="group") and updates a single, DOM-ordered
* global live region. Runs for the lifetime of the page so async validators
* (NeverBounce, VGS, server re-renders) are caught without timing assumptions.
*/
private observeErrorMessages;
private moveErrorMessage;
private clearErrorMessage;
private tagFieldError;
private clearFieldError;
/**
* Make everything on the page inert except the supplied overlay element and
* its ancestors. This hides background content from assistive technology and
Expand All @@ -40,5 +43,10 @@ export declare class A11y {
* `inert` is true; ignored when `inert` is false.
*/
static inertPage(inert: boolean, overlay?: HTMLElement): void;
private manageErrorListAlertRole;
private scheduleLiveRegionUpdate;
private updateGlobalErrorLiveRegion;
private formatErrorMessage;
private focusFirstInvalidField;
private getFieldLabel;
private normalizeLabel;
}
Loading
Loading