UNPKG

html-aria

Version:

Utilities for creating accessible HTML based on the latest ARIA 1.3 specs. Lightweight, performant, tree-shakeable, and 0 dependencies.

933 lines 196 kB
const widgetRoles = { /** An input that allows for user-triggered actions when clicked or pressed. See related link. */ button: { allowedChildRoles: [], childrenPresentational: true, defaultAttributeValues: {}, elements: [{ tagName: "button" }], name: "button", nameFrom: "authorAndContents", nameRequired: true, prohibited: [], required: [], requiredParentRoles: [], subclasses: [], superclasses: ["command"], supported: ["aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-expanded", "aria-flowto", "aria-grabbed", "aria-haspopup", "aria-hidden", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-pressed", "aria-relevant", "aria-roledescription"], // biome-ignore format: long list type: ["widget"] }, /** A checkable input that has three possible values: true, false, or mixed. */ checkbox: { allowedChildRoles: [], childrenPresentational: true, defaultAttributeValues: { "aria-checked": false }, elements: [{ tagName: "input", attributes: { type: "checkbox" } }], name: "checkbox", nameFrom: "authorAndContents", nameRequired: true, prohibited: [], required: ["aria-checked"], requiredParentRoles: [], subclasses: ["switch"], superclasses: ["input"], supported: ["aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-checked", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-errormessage", "aria-expanded", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-invalid", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-readonly", "aria-relevant", "aria-required", "aria-roledescription"], // biome-ignore format: long list type: ["widget"] }, /** An input that controls another element, such as a listbox or grid, that can dynamically pop up to help the user set the value of the input. */ combobox: { allowedChildRoles: [], childrenPresentational: false, defaultAttributeValues: { "aria-haspopup": "listbox", "aria-expanded": false }, elements: [{ tagName: "select" }], name: "combobox", nameFrom: "author", nameRequired: true, prohibited: [], // Note: aria-controls isn’t required by ARIA 1.3, but AAM requires aria-controls for most implementations of comboboxes // @see https://www.w3.org/TR/html-aam-1.0/#el-input-textetc-autocomplete required: ["aria-controls", "aria-expanded"], requiredParentRoles: [], subclasses: [], superclasses: ["input"], supported: ["aria-activedescendant", "aria-atomic", "aria-autocomplete", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-errormessage", "aria-expanded", "aria-flowto", "aria-grabbed", "aria-haspopup", "aria-hidden", "aria-invalid", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-readonly", "aria-relevant", "aria-required", "aria-roledescription"], // biome-ignore format: long list type: ["widget"] }, /** A composite widget containing a collection of one or more rows with one or more cells where some or all cells in the grid are focusable by using methods of two-dimensional navigation, such as directional arrow keys. */ grid: { allowedChildRoles: ["caption", "row", "rowgroup"], childrenPresentational: false, defaultAttributeValues: {}, elements: [{ tagName: "table", attributes: { role: "grid" } }], name: "grid", nameFrom: "author", nameRequired: true, prohibited: [], required: [], requiredParentRoles: [], subclasses: ["treegrid"], superclasses: ["composite", "table"], supported: ["aria-activedescendant", "aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-colcount", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-multiselectable", "aria-owns", "aria-readonly", "aria-relevant", "aria-roledescription", "aria-rowcount"], // biome-ignore format: long list type: ["widget"] }, /** A cell in a grid or treegrid. */ gridcell: { allowedChildRoles: [], childrenPresentational: false, defaultAttributeValues: {}, elements: [ { tagName: "td", attributes: { role: "gridcell" } }, { tagName: "th", attributes: { role: "gridcell" } } ], name: "gridcell", nameFrom: "authorAndContents", nameRequired: false, prohibited: [], required: [], requiredParentRoles: ["row"], subclasses: ["columnheader", "rowheader"], superclasses: ["cell", "widget"], supported: ["aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-colindex", "aria-colindextext", "aria-colspan", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-errormessage", "aria-expanded", "aria-flowto", "aria-grabbed", "aria-haspopup", "aria-hidden", "aria-invalid", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-readonly", "aria-relevant", "aria-required", "aria-roledescription", "aria-rowindex", "aria-rowindextext", "aria-rowspan", "aria-selected"], // biome-ignore format: long list type: ["widget"] }, /** An interactive reference to an internal or external resource that, when activated, causes the user agent to navigate to that resource. See related button. */ link: { allowedChildRoles: [], childrenPresentational: false, defaultAttributeValues: {}, elements: [{ tagName: "a" }, { tagName: "area" }], name: "link", nameFrom: "authorAndContents", nameRequired: true, prohibited: [], required: [], requiredParentRoles: [], subclasses: ["doc-backlink", "doc-biblioref", "doc-glossref", "doc-noteref"], superclasses: ["command"], supported: ["aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-expanded", "aria-flowto", "aria-grabbed", "aria-haspopup", "aria-hidden", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-relevant", "aria-roledescription"], // biome-ignore format: long list type: ["widget"] }, /** A widget that allows the user to select one or more items from a list of choices. See related combobox and list. */ listbox: { allowedChildRoles: ["group", "option"], childrenPresentational: false, defaultAttributeValues: { "aria-orientation": "vertical" }, elements: [{ tagName: "select", attributes: { multiple: true } }], name: "listbox", nameFrom: "author", nameRequired: true, prohibited: [], required: [], requiredParentRoles: [], subclasses: [], superclasses: ["select"], supported: ["aria-activedescendant", "aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-errormessage", "aria-expanded", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-invalid", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-multiselectable", "aria-orientation", "aria-owns", "aria-readonly", "aria-relevant", "aria-required", "aria-roledescription"], // biome-ignore format: long list type: ["widget"] }, /** A type of widget that offers a list of choices to the user. */ menu: { allowedChildRoles: ["group", "menuitem", "menuitemcheckbox", "menuitemradio", "separator"], childrenPresentational: false, defaultAttributeValues: { "aria-orientation": "vertical" }, elements: [], name: "menu", nameFrom: "author", nameRequired: false, prohibited: [], required: [], requiredParentRoles: [], subclasses: ["menubar"], superclasses: ["select"], supported: ["aria-activedescendant", "aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-orientation", "aria-owns", "aria-relevant", "aria-roledescription"], // biome-ignore format: long list type: ["widget"] }, /** A presentation of menu that usually remains visible and is usually presented horizontally. */ menubar: { allowedChildRoles: ["group", "menuitem", "menuitemcheckbox", "menuitemradio", "separator"], childrenPresentational: false, defaultAttributeValues: { "aria-orientation": "horizontal" }, elements: [], name: "menubar", nameFrom: "author", nameRequired: false, prohibited: [], required: [], requiredParentRoles: [], subclasses: [], superclasses: ["menu"], supported: ["aria-activedescendant", "aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-orientation", "aria-owns", "aria-relevant", "aria-roledescription"], // biome-ignore format: long list type: ["widget"] }, /** An option in a set of choices contained by a menu or menubar. */ menuitem: { allowedChildRoles: [], childrenPresentational: false, defaultAttributeValues: {}, elements: [], name: "menuitem", nameFrom: "authorAndContents", nameRequired: true, prohibited: [], required: [], requiredParentRoles: ["menu", "menubar", "group"], subclasses: ["menuitemcheckbox", "menuitemradio"], superclasses: ["command"], supported: ["aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-expanded", "aria-flowto", "aria-grabbed", "aria-haspopup", "aria-hidden", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-posinset", "aria-relevant", "aria-roledescription", "aria-setsize"], // biome-ignore format: long list type: ["widget"] }, /** A menuitem with a checkable state whose possible values are true, false, or mixed. */ menuitemcheckbox: { allowedChildRoles: [], childrenPresentational: true, defaultAttributeValues: { "aria-checked": false }, elements: [], name: "menuitemcheckbox", nameFrom: "authorAndContents", nameRequired: true, prohibited: [], required: ["aria-checked"], requiredParentRoles: ["menu", "menubar", "group"], subclasses: [], superclasses: ["menuitem"], supported: ["aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-checked", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-expanded", "aria-flowto", "aria-grabbed", "aria-haspopup", "aria-hidden", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-posinset", "aria-relevant", "aria-roledescription", "aria-setsize"], // biome-ignore format: long list type: ["widget"] }, /** A checkable menuitem in a set of elements with the same role, only one of which can be checked at a time. */ menuitemradio: { allowedChildRoles: [], childrenPresentational: true, defaultAttributeValues: { "aria-checked": false }, elements: [], name: "menuitemradio", nameFrom: "authorAndContents", nameRequired: true, prohibited: [], required: ["aria-checked"], requiredParentRoles: ["menu", "menubar", "group"], subclasses: [], superclasses: ["menuitem"], supported: ["aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-checked", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-expanded", "aria-flowto", "aria-grabbed", "aria-haspopup", "aria-hidden", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-posinset", "aria-relevant", "aria-roledescription", "aria-setsize"], // biome-ignore format: long list type: ["widget"] }, /** An item in a listbox. */ option: { allowedChildRoles: [], childrenPresentational: true, defaultAttributeValues: {}, elements: [{ tagName: "option" }], name: "option", nameFrom: "authorAndContents", nameRequired: true, prohibited: [], required: [], requiredParentRoles: ["listbox", "group"], subclasses: ["treeitem"], superclasses: ["input"], supported: ["aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-checked", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-posinset", "aria-relevant", "aria-roledescription", "aria-selected", "aria-setsize"], // biome-ignore format: long list type: ["widget"] }, /** An element that displays the progress status for tasks that take a long time. */ progressbar: { allowedChildRoles: [], childrenPresentational: true, defaultAttributeValues: { "aria-valuemax": 100, "aria-valuemin": 0 }, elements: [{ tagName: "progress" }], name: "progressbar", nameFrom: "author", nameRequired: true, prohibited: [], required: [], requiredParentRoles: [], subclasses: [], superclasses: ["range", "widget"], supported: ["aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-dropeffect", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-relevant", "aria-roledescription", "aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-valuetext"], // biome-ignore format: long list type: ["widget"] }, /** A checkable input in a group of elements with the same role, only one of which can be checked at a time. */ radio: { allowedChildRoles: [], childrenPresentational: true, defaultAttributeValues: { "aria-checked": false }, elements: [{ tagName: "input", attributes: { type: "radio" } }], name: "radio", nameFrom: "authorAndContents", nameRequired: true, prohibited: [], required: ["aria-checked"], requiredParentRoles: [], subclasses: [], superclasses: ["input"], supported: ["aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-checked", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-posinset", "aria-relevant", "aria-roledescription", "aria-setsize"], // biome-ignore format: long list type: ["widget"] }, /** A group of radio buttons. */ radiogroup: { allowedChildRoles: [], childrenPresentational: false, defaultAttributeValues: {}, elements: [], name: "radiogroup", nameFrom: "author", nameRequired: true, prohibited: [], required: [], requiredParentRoles: [], subclasses: [], superclasses: ["select"], supported: ["aria-activedescendant", "aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-errormessage", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-invalid", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-orientation", "aria-owns", "aria-readonly", "aria-relevant", "aria-required", "aria-roledescription"], // biome-ignore format: long list type: ["widget"] }, /** A row of cells in a tabular container. */ row: { allowedChildRoles: ["cell", "columnheader", "gridcell", "rowheader"], childrenPresentational: false, defaultAttributeValues: {}, elements: [{ tagName: "tr" }], name: "row", nameFrom: "authorAndContents", nameRequired: false, prohibited: [], required: [], requiredParentRoles: ["grid", "table", "treegrid", "rowgroup"], subclasses: [], superclasses: ["group", "widget"], supported: ["aria-activedescendant", "aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-colindex", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-expanded", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-level", "aria-live", "aria-owns", "aria-posinset", "aria-relevant", "aria-roledescription", "aria-rowindex", "aria-rowindextext", "aria-selected", "aria-setsize"], // biome-ignore format: long list type: ["document", "widget"] }, /** A graphical object that controls the scrolling of content within a viewing area, regardless of whether the content is fully displayed within the viewing area. */ scrollbar: { allowedChildRoles: [], childrenPresentational: true, defaultAttributeValues: { "aria-orientation": "vertical", "aria-valuemax": 100, "aria-valuemin": 0 // If missing or not a number,(aria-valuemax - aria-valuemin) / 2. If present but less than aria-valuemin, the value of aria-valuemin. If present but greater than aria-valuemax, the value of aria-valuemax. // 'aria-valuenow': TBD }, elements: [], name: "scrollbar", nameFrom: "author", nameRequired: false, prohibited: [], required: ["aria-controls", "aria-valuenow"], requiredParentRoles: [], subclasses: [], superclasses: ["range", "widget"], supported: ["aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-orientation", "aria-owns", "aria-relevant", "aria-roledescription", "aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-valuetext"], // biome-ignore format: long list type: ["widget"] }, /** A type of textbox intended for specifying search criteria. See related textbox and search. */ searchbox: { allowedChildRoles: [], childrenPresentational: false, defaultAttributeValues: {}, elements: [{ tagName: "input", attributes: { type: "search" } }], name: "searchbox", nameFrom: "author", nameRequired: true, prohibited: [], required: [], requiredParentRoles: [], subclasses: [], superclasses: ["textbox"], supported: ["aria-activedescendant", "aria-atomic", "aria-autocomplete", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-errormessage", "aria-flowto", "aria-grabbed", "aria-haspopup", "aria-hidden", "aria-invalid", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-multiline", "aria-owns", "aria-placeholder", "aria-readonly", "aria-relevant", "aria-required", "aria-roledescription"], // biome-ignore format: long list type: ["widget"] }, /** A divider that separates and distinguishes sections of content or groups of menuitems. */ separator: { allowedChildRoles: [], childrenPresentational: true, defaultAttributeValues: { "aria-orientation": "horizontal", "aria-valuemax": 100, "aria-valuemin": 0 // If missing or not a number,(aria-valuemax - aria-valuemin) / 2. If present but less than aria-valuemin, the value of aria-valuemin. If present but greater than aria-valuemax, the value of aria-valuemax. // 'aria-valuenow': TBD }, elements: [{ tagName: "hr" }], name: "separator", nameFrom: "author", nameRequired: false, prohibited: [], required: [], // aria-valuenow (if focusable) requiredParentRoles: [], subclasses: ["doc-pagebreak"], superclasses: ["structure", "widget"], supported: ["aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-orientation", "aria-owns", "aria-relevant", "aria-roledescription", "aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-valuetext"], // biome-ignore format: long list type: ["widget", "document"] }, /** An input where the user selects a value from within a given range. */ slider: { allowedChildRoles: [], childrenPresentational: true, defaultAttributeValues: { "aria-orientation": "horizontal", "aria-valuemax": 100, "aria-valuemin": 0 // If missing or not a number,(aria-valuemax - aria-valuemin) / 2. If present but less than aria-valuemin, the value of aria-valuemin. If present but greater than aria-valuemax, the value of aria-valuemax. // 'aria-valuenow': TBD }, elements: [{ tagName: "input", attributes: { type: "range" } }], name: "slider", nameFrom: "author", nameRequired: true, prohibited: [], required: ["aria-valuenow"], requiredParentRoles: [], subclasses: [], superclasses: ["input", "range"], supported: ["aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-errormessage", "aria-flowto", "aria-grabbed", "aria-haspopup", "aria-hidden", "aria-invalid", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-orientation", "aria-owns", "aria-readonly", "aria-relevant", "aria-roledescription", "aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-valuetext"], // biome-ignore format: long list type: ["widget"] }, /** A form of range that expects the user to select from among discrete choices. */ spinbutton: { allowedChildRoles: [], childrenPresentational: false, defaultAttributeValues: {}, elements: [{ tagName: "input", attributes: { type: "number" } }], name: "spinbutton", nameFrom: "author", nameRequired: true, prohibited: [], required: [], requiredParentRoles: [], subclasses: [], superclasses: ["composite", "input", "range"], supported: ["aria-activedescendant", "aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-errormessage", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-invalid", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-readonly", "aria-relevant", "aria-required", "aria-roledescription", "aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-valuetext"], // biome-ignore format: long list type: ["widget"] }, /** A type of checkbox that represents on/off values, as opposed to checked/unchecked values. See related checkbox. */ switch: { allowedChildRoles: [], childrenPresentational: true, defaultAttributeValues: { "aria-checked": false }, elements: [{ tagName: "input", attributes: { type: "checkbox", role: "switch" } }], name: "switch", nameFrom: "authorAndContents", nameRequired: true, prohibited: [], required: ["aria-checked"], requiredParentRoles: [], subclasses: [], superclasses: ["checkbox"], supported: ["aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-checked", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-errormessage", "aria-expanded", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-invalid", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-readonly", "aria-relevant", "aria-required", "aria-roledescription"], // biome-ignore format: long list type: ["widget"] }, /** A grouping label providing a mechanism for selecting the tab content that is to be rendered to the user. */ tab: { allowedChildRoles: [], childrenPresentational: true, defaultAttributeValues: { "aria-selected": false }, elements: [{ tagName: "button", attributes: { type: "button", role: "tab" } }], name: "tab", nameFrom: "authorAndContents", nameRequired: true, prohibited: [], required: [], requiredParentRoles: ["tablist"], subclasses: [], superclasses: ["sectionhead", "widget"], supported: ["aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-expanded", "aria-flowto", "aria-grabbed", "aria-haspopup", "aria-hidden", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-posinset", "aria-relevant", "aria-roledescription", "aria-selected", "aria-setsize"], // biome-ignore format: long list type: ["widget"] }, /** A list of tab elements, which are references to tabpanel elements. */ tablist: { allowedChildRoles: ["tab"], childrenPresentational: false, defaultAttributeValues: { "aria-orientation": "horizontal" }, elements: [ { tagName: "menu", attributes: { role: "tablist" } }, { tagName: "ol", attributes: { role: "tablist" } }, { tagName: "ul", attributes: { role: "tablist" } } ], name: "tablist", nameFrom: "author", nameRequired: false, prohibited: [], required: [], requiredParentRoles: [], subclasses: [], superclasses: ["composite"], supported: ["aria-activedescendant", "aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-multiselectable", "aria-orientation", "aria-owns", "aria-relevant", "aria-roledescription"], // biome-ignore format: long list type: ["widget"] }, /** A container for the resources associated with a tab, where each tab is contained in a tablist. */ tabpanel: { allowedChildRoles: [], childrenPresentational: false, defaultAttributeValues: {}, elements: [], name: "tabpanel", nameFrom: "author", nameRequired: true, prohibited: [], required: [], requiredParentRoles: [], subclasses: [], superclasses: ["section"], supported: ["aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-dropeffect", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-relevant", "aria-roledescription"], // biome-ignore format: long list type: ["widget"] }, /** A type of input that allows free-form text as its value. */ textbox: { allowedChildRoles: [], childrenPresentational: false, defaultAttributeValues: {}, elements: [{ tagName: "input", attributes: { type: "text" } }], name: "textbox", nameFrom: "author", nameRequired: true, prohibited: [], required: [], requiredParentRoles: [], subclasses: ["searchbox"], superclasses: ["input"], supported: ["aria-activedescendant", "aria-atomic", "aria-autocomplete", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-errormessage", "aria-flowto", "aria-grabbed", "aria-haspopup", "aria-hidden", "aria-invalid", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-multiline", "aria-owns", "aria-placeholder", "aria-readonly", "aria-relevant", "aria-required", "aria-roledescription"], // biome-ignore format: long list type: ["widget"] }, /** A widget that allows the user to select one or more items from a hierarchically organized collection. */ tree: { allowedChildRoles: ["group", "treeitem"], childrenPresentational: false, defaultAttributeValues: { "aria-orientation": "vertical" }, elements: [ { tagName: "menu", attributes: { role: "tree" } }, { tagName: "ol", attributes: { role: "tree" } }, { tagName: "ul", attributes: { role: "tree" } } ], name: "tree", nameFrom: "author", nameRequired: true, prohibited: [], required: [], requiredParentRoles: [], subclasses: ["treegrid"], superclasses: ["select"], supported: ["aria-activedescendant", "aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-errormessage", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-invalid", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-multiselectable", "aria-orientation", "aria-owns", "aria-relevant", "aria-required", "aria-roledescription"], // biome-ignore format: long list type: ["widget"] }, /** A grid whose rows can be expanded and collapsed in the same manner as for a tree. */ treegrid: { allowedChildRoles: ["caption", "row", "rowgroup"], childrenPresentational: false, defaultAttributeValues: {}, elements: [{ tagName: "table", attributes: { role: "treegrid" } }], name: "treegrid", nameFrom: "author", nameRequired: true, prohibited: [], required: [], requiredParentRoles: [], subclasses: [], superclasses: ["grid", "tree"], supported: ["aria-activedescendant", "aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-colcount", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-errormessage", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-invalid", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-multiselectable", "aria-orientation", "aria-owns", "aria-readonly", "aria-relevant", "aria-required", "aria-roledescription", "aria-rowcount"], // biome-ignore format: long list type: ["widget"] }, /** An item in a tree. */ treeitem: { allowedChildRoles: [], childrenPresentational: false, defaultAttributeValues: {}, elements: [], name: "treeitem", nameFrom: "authorAndContents", nameRequired: true, prohibited: [], required: [], requiredParentRoles: ["tree", "group"], subclasses: [], superclasses: ["listitem", "option"], supported: ["aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-checked", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-expanded", "aria-flowto", "aria-grabbed", "aria-haspopup", "aria-hidden", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-level", "aria-live", "aria-owns", "aria-posinset", "aria-relevant", "aria-roledescription", "aria-selected", "aria-setsize"], // biome-ignore format: long list type: ["widget"] } }; const documentRoles = { /** A structure containing one or more focusable elements requiring user input, such as keyboard or gesture events, that do not follow a standard interaction pattern supported by a widget role. */ application: { allowedChildRoles: [], childrenPresentational: false, defaultAttributeValues: {}, elements: [], name: "application", nameFrom: "author", nameRequired: true, prohibited: [], required: [], requiredParentRoles: [], subclasses: [], superclasses: ["structure"], supported: ["aria-activedescendant", "aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-errormessage", "aria-expanded", "aria-flowto", "aria-grabbed", "aria-haspopup", "aria-hidden", "aria-invalid", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-relevant", "aria-roledescription"], // biome-ignore format: long list type: ["document"] }, /** A section of a page that consists of a composition that forms an independent part of a document, page, or site. */ article: { allowedChildRoles: [], childrenPresentational: false, defaultAttributeValues: {}, elements: [{ tagName: "article" }], name: "article", nameFrom: "author", nameRequired: false, prohibited: [], required: [], requiredParentRoles: [], subclasses: ["comment"], superclasses: ["document"], supported: ["aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-dropeffect", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-posinset", "aria-relevant", "aria-roledescription", "aria-setsize"], // biome-ignore format: long list type: ["document"] }, /** A section of content that is quoted from another source. */ blockquote: { allowedChildRoles: [], childrenPresentational: false, defaultAttributeValues: {}, elements: [{ tagName: "blockquote" }], name: "blockquote", nameFrom: "author", nameRequired: false, prohibited: [], required: [], requiredParentRoles: [], subclasses: [], superclasses: ["section"], supported: ["aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-dropeffect", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-relevant", "aria-roledescription"], // biome-ignore format: long list type: ["document"] }, /** Visible content that names, or describes a figure, grid, group, radiogroup, table or treegrid. */ caption: { allowedChildRoles: [], childrenPresentational: false, defaultAttributeValues: {}, elements: [{ tagName: "caption" }, { tagName: "figcaption" }], name: "caption", nameFrom: "prohibited", nameRequired: false, prohibited: ["aria-braillelabel", "aria-label", "aria-labelledby"], required: [], requiredParentRoles: ["figure", "grid", "group", "radiogroup", "table", "treegrid"], subclasses: [], superclasses: ["section"], supported: ["aria-atomic", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-dropeffect", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-keyshortcuts", "aria-live", "aria-owns", "aria-relevant", "aria-roledescription"], // biome-ignore format: long list type: ["document"] }, /** A cell in a tabular container. See related gridcell. */ cell: { allowedChildRoles: [], childrenPresentational: false, defaultAttributeValues: {}, elements: [{ tagName: "td" }], name: "cell", nameFrom: "authorAndContents", nameRequired: false, prohibited: [], required: [], requiredParentRoles: ["row"], subclasses: ["columnheader", "gridcell", "rowheader"], superclasses: ["section"], supported: ["aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-colindex", "aria-colindextext", "aria-colspan", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-dropeffect", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-relevant", "aria-roledescription", "aria-rowindex", "aria-rowindextext", "aria-rowspan"], // biome-ignore format: long list type: ["document"] }, /** A section whose content represents a fragment of computer code. */ code: { allowedChildRoles: [], childrenPresentational: false, defaultAttributeValues: {}, elements: [{ tagName: "code" }], name: "code", nameFrom: "prohibited", nameRequired: false, prohibited: ["aria-braillelabel", "aria-label", "aria-labelledby"], required: [], requiredParentRoles: [], subclasses: [], superclasses: ["section"], supported: ["aria-atomic", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-dropeffect", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-keyshortcuts", "aria-live", "aria-owns", "aria-relevant", "aria-roledescription"], // biome-ignore format: long list type: ["document"] }, /** A cell containing header information for a column. */ columnheader: { allowedChildRoles: [], childrenPresentational: false, defaultAttributeValues: {}, elements: [{ tagName: "th", attributes: { scope: "col" } }], name: "columnheader", nameFrom: "authorAndContents", nameRequired: true, prohibited: [], required: [], requiredParentRoles: ["row"], subclasses: [], superclasses: ["cell", "gridcell", "sectionhead"], supported: ["aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-colindex", "aria-colindextext", "aria-colspan", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-errormessage", "aria-expanded", "aria-flowto", "aria-grabbed", "aria-haspopup", "aria-hidden", "aria-invalid", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-readonly", "aria-relevant", "aria-required", "aria-roledescription", "aria-rowindex", "aria-rowindextext", "aria-rowspan", "aria-selected", "aria-sort"], // biome-ignore format: long list type: ["document"] }, /** A comment contains content expressing reaction to other content. */ comment: { allowedChildRoles: [], childrenPresentational: false, defaultAttributeValues: {}, elements: [], name: "comment", nameFrom: "authorAndContents", nameRequired: false, prohibited: [], required: [], requiredParentRoles: [], subclasses: [], superclasses: ["article"], supported: ["aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-dropeffect", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-level", "aria-live", "aria-owns", "aria-posinset", "aria-relevant", "aria-roledescription", "aria-setsize"], // biome-ignore format: long list type: ["document"] }, /** A definition of a term or concept. See related term. */ definition: { allowedChildRoles: [], childrenPresentational: false, defaultAttributeValues: {}, elements: [], name: "definition", nameFrom: "prohibited", nameRequired: false, prohibited: ["aria-braillelabel", "aria-label", "aria-labelledby"], required: [], requiredParentRoles: [], subclasses: [], superclasses: ["section"], supported: ["aria-atomic", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-dropeffect", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-keyshortcuts", "aria-live", "aria-owns", "aria-relevant", "aria-roledescription"], // biome-ignore format: long list type: ["document"] }, /** A deletion represents content that is marked as removed, content that is being suggested for removal, or content that is no longer relevant in the context of its accompanying content. See related insertion. */ deletion: { allowedChildRoles: [], childrenPresentational: false, defaultAttributeValues: {}, elements: [{ tagName: "del" }], name: "deletion", nameFrom: "prohibited", nameRequired: false, prohibited: ["aria-braillelabel", "aria-label", "aria-labelledby"], required: [], requiredParentRoles: [], subclasses: [], superclasses: ["section"], supported: ["aria-atomic", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-dropeffect", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-keyshortcuts", "aria-live", "aria-owns", "aria-relevant", "aria-roledescription"], // biome-ignore format: long list type: ["document"] }, /** * A list of references to members of a group, such as a static table of contents. * @deprecated in ARIA 1.2 */ directory: { allowedChildRoles: [], childrenPresentational: false, defaultAttributeValues: {}, elements: [], name: "directory", nameFrom: "author", nameRequired: false, prohibited: [], required: [], requiredParentRoles: [], subclasses: [], superclasses: ["list"], supported: ["aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-dropeffect", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-relevant", "aria-roledescription"], // biome-ignore format: long list type: ["document"] }, /** An element containing content that assistive technology users might want to browse in a reading mode. */ document: { allowedChildRoles: [], childrenPresentational: false, defaultAttributeValues: {}, elements: [{ tagName: "html" }], name: "document", nameFrom: "author", nameRequired: false, prohibited: [], required: [], requiredParentRoles: [], subclasses: ["article", "graphics-document"], superclasses: ["structure"], supported: ["aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-dropeffect", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-relevant", "aria-roledescription"], // biome-ignore format: long list type: ["document"] }, /** One or more emphasized characters. See related strong. */ emphasis: { allowedChildRoles: [], childrenPresentational: false, defaultAttributeValues: {}, elements: [{ tagName: "em" }], name: "emphasis", nameFrom: "prohibited", nameRequired: false, prohibited: ["aria-braillelabel", "aria-label", "aria-labelledby"], required: [], requiredParentRoles: [], subclasses: [], superclasses: ["section"], supported: ["aria-atomic", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-dropeffect", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-keyshortcuts", "aria-live", "aria-owns", "aria-relevant", "aria-roledescription"], // biome-ignore format: long list type: ["document"] }, /** A scrollable list of articles where scrolling might cause articles to be added to or removed from either end of the list. */ feed: { allowedChildRoles: ["article"], childrenPresentational: false, defaultAttributeValues: {}, elements: [], name: "feed", nameFrom: "author", nameRequired: false, prohibited: [], required: [], requiredParentRoles: [], subclasses: [], superclasses: ["list"], supported: ["aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-dropeffect", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-relevant", "aria-roledescription"], // biome-ignore format: long list type: ["document"] }, /** A perceivable section of content that typically contains a graphical document, images, media player, code snippets, or example text. The parts of a figure MAY be user-navigable. */ figure: { allowedChildRoles: [], childrenPresentational: false, defaultAttributeValues: {}, elements: [{ tagName: "figure" }], name: "figure", nameFrom: "author", nameRequired: false, prohibited: [], required: [], requiredParentRoles: [], subclasses: ["doc-example"], superclasses: ["section"], supported: ["aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-dropeffect", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-relevant", "aria-roledescription"], // biome-ignore format: long list type: ["document"] }, /** A nameless container element that has no semantic meaning on its own. */ generic: { allowedChildRoles: [], childrenPresentational: false, defaultAttributeValues: {}, elements: [{ tagName: "b" }, { tagName: "div" }, { tagName: "i" }, { tagName: "pre" }, { tagName: "q" }, { tagName: "samp" }, { tagName: "small" }, { tagName: "span" }, { tagName: "u" }], // biome-ignore format: long list name: "generic", nameFrom: "prohibited", nameRequired: false, prohibited: ["aria-braillelabel", "aria-brailleroledescription", "aria-label", "aria-labelledby", "aria-roledescription"], // biome-ignore format: long list required: [], requiredParentRoles: [], subclasses: [], superclasses: ["structure"], supported: ["aria-atomic", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-dropeffect", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-keyshortcuts", "aria-live", "aria-owns", "aria-relevant"], // biome-ignore format: long list type: ["document"] }, /** A set of user interface objects that is not intended to be included in a page summary or table of contents by assistive technologies. */ group: { allowedChildRoles: [], childrenPresentational: false, defaultAttributeValues: {}, elements: [{ tagName: "fieldset" }, { tagName: "address" }, { tagName: "details" }, { tagName: "hgroup" }, { tagName: "optgroup" }], // biome-ignore format: long list name: "group", nameFrom: "author", nameRequired: false, prohibited: [], required: [], requiredParentRoles: [], subclasses: ["graphics-object", "row", "select", "toolbar"], superclasses: ["section"], supported: ["aria-activedescendant", "aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-flowto", "aria-grabbed", "aria-hidden", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-relevant", "aria-roledescription"], // biome-ignore format: long list type: ["document"] }, /** A heading for a section of the page. */ heading: { allowedChildRoles: [], childrenPresentational: false, defaultAttributeValues: { "aria-level": 2 }, elements: [{ tagName: "h1" }, { tagName: "h2" }, { tagName: "h3" }, { tagName: "h4" }, { tagName: "h5" }, { tagName: "h6" }], // biome-ignore format: long list name: "heading", nameFrom: "authorAndContents", nameRequired: true, prohibited: [], required: ["aria-level"], requiredParentRoles: [], subclasses: [], superclasses: ["sectionhead"], supported: ["aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", "aria-describedby", "aria-