All Projects → A11yance → Aria Query

A11yance / Aria Query

Licence: apache-2.0
Programmatic access to the ARIA specification

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Aria Query

Skin
Pure CSS framework designed & developed by eBay for a branded, e-commerce marketplace.
Stars: ✭ 126 (-2.33%)
Mutual labels:  accessibility, aria
Js Offcanvas
A lightweight, flexible jQuery off-canvas navigation plugin which lets you create fully accessible sidebar or top/bottom sliding (or push) panels with keyboard interactions and ARIA attributes.
Stars: ✭ 272 (+110.85%)
Mutual labels:  accessibility, aria
a11y tab widget
Accessible Tab Widget built with ARIA
Stars: ✭ 25 (-80.62%)
Mutual labels:  accessibility, aria
jquery-accessible-carrousel-aria
jQuery Accessible Carrousel System, using ARIA
Stars: ✭ 40 (-68.99%)
Mutual labels:  accessibility, aria
Accessibility Checklist
Stars: ✭ 41 (-68.22%)
Mutual labels:  accessibility, aria
alfa
♿ Suite of open and standards-based tools for performing reliable accessibility conformance testing at scale
Stars: ✭ 75 (-41.86%)
Mutual labels:  accessibility, aria
van11y-accessible-hide-show-aria
ES2015 accessible hide-show system (collapsible regions), using ARIA
Stars: ✭ 34 (-73.64%)
Mutual labels:  accessibility, aria
aria-devtools
Easily spot missing ARIA labels, misused ARIA roles, and incomplete keyboard support in your web applications.
Stars: ✭ 69 (-46.51%)
Mutual labels:  accessibility, aria
A11y tooltips
Accessible Tooltip Component
Stars: ✭ 35 (-72.87%)
Mutual labels:  accessibility, aria
Accessible components
Listing of accessible components & patterns
Stars: ✭ 393 (+204.65%)
Mutual labels:  accessibility, aria
jquery-accessible-dialog-tooltip-aria
jQuery simple and accessible dialog tooltip window, using ARIA
Stars: ✭ 17 (-86.82%)
Mutual labels:  accessibility, aria
Accessible Html Content Patterns
♿️ The full HTML5 Doctor Element Index as well as common markup patterns for quick reference.
Stars: ✭ 93 (-27.91%)
Mutual labels:  accessibility, aria
a11y-accordion-tabs
A script for an accessible accordion tabs component
Stars: ✭ 50 (-61.24%)
Mutual labels:  accessibility, aria
jquery-accessible-modal-window-aria
jQuery simple and accessible modal window, using ARIA
Stars: ✭ 61 (-52.71%)
Mutual labels:  accessibility, aria
stucco
An experimental adaptive UI toolkit.
Stars: ✭ 31 (-75.97%)
Mutual labels:  accessibility, aria
enabler
✋ Accessibility analyzer for your frontend.
Stars: ✭ 19 (-85.27%)
Mutual labels:  accessibility, aria
van11y-accessible-simple-tooltip-aria
ES2015 accessible simple tooltip, using ARIA
Stars: ✭ 22 (-82.95%)
Mutual labels:  accessibility, aria
aria-collapsible
A lightweight, dependency-free JavaScript module for generating progressively-enhanced collapsible regions using ARIA States and Properties.
Stars: ✭ 25 (-80.62%)
Mutual labels:  accessibility, aria
Vue Simple Suggest
Feature-rich autocomplete component for Vue.js
Stars: ✭ 324 (+151.16%)
Mutual labels:  accessibility, aria
Van11y Accessible Tab Panel Aria
ES2015 accessible tabs panel system, using ARIA
Stars: ✭ 58 (-55.04%)
Mutual labels:  accessibility, aria

ARIA Query

CI

Programmatic access to the WAI-ARIA 1.2 Roles Model. This package tracks the stable editor's draft (last update: 21 July 2020).

CDN URL: https://unpkg.com/aria-query

Building the src/etc files

The files under src/etc are generated by the breakUpAriaJSON script.

To change them, edit the file scripts/roles.json then run:

node ./scripts/breakUpAriaJSON.js
git add scripts/roles.json src/etc

It should work with Node version 6.11.2 or later.

Utilities

Roles

import { roles } from 'aria-query';

A Map of role names to the role definition. For example:

let alertRole = roles.get('alert');
/**
 * Value of alertRole
 * {
 *   "requiredProps": {},
 *   "props": {
 *     "aria-atomic": "true",
 *     "aria-busy": null,
 *     "aria-controls": null,
 *     "aria-current": null,
 *     "aria-describedby": null,
 *     "aria-details": null,
 *     "aria-disabled": null,
 *     "aria-dropeffect": null,
 *     "aria-errormessage": null,
 *     "aria-expanded": null,
 *     "aria-flowto": null,
 *     "aria-grabbed": null,
 *     "aria-haspopup": null,
 *     "aria-hidden": null,
 *     "aria-invalid": null,
 *     "aria-keyshortcuts": null,
 *     "aria-label": null,
 *     "aria-labelledby": null,
 *     "aria-live": "assertive",
 *     "aria-owns": null,
 *     "aria-relevant": null,
 *     "aria-roledescription": null
 *   },
 *   "abstract": false,
 *   "childrenPresentational": false,
 *   "baseConcepts": [],
 *   "relatedConcepts": [ {
 *     "module": "XForms",
 *     "concept": {
 *       "name": "alert"
 *     }
 *   }],
 *   "superClass": [["roletype", "structure", "section"]]
 * }

Elements to Roles

import { elementRoles } from 'aria-query';

HTML Elements with inherent roles are mapped to those roles. In the case of an element like <input>, the element often requires a type attribute to map to an ARIA role.

Map {
  '{"name": "article"}' => Set { 'article' },
  '{"name": "button"}' => Set { 'button' },
  '{"name": "td"}' => Set { 'cell', 'gridcell' },
  '{"name": "input", "attributes": [ {"name": "type", "value": "checkbox"}] }' => Set { 'checkbox' },
  '{"name": "th"}' => Set { 'columnheader' },
  '{"name": "select"}' => Set { 'combobox', 'listbox' },
  '{"name": "menuitem"}' => Set { 'command', 'menuitem' },
  '{"name": "dd"}' => Set { 'definition' },
  '{"name": "figure"}' => Set { 'figure' },
  '{"name": "form"}' => Set { 'form' },
  '{"name": "table"}' => Set { 'grid', 'table' },
  '{"name": "fieldset"}' => Set { 'group' },
  '{"name": "h1"}' => Set { 'heading' },
  '{"name": "h2"}' => Set { 'heading' },
  '{"name": "h3"}' => Set { 'heading' },
  '{"name": "h4"}' => Set { 'heading' },
  '{"name": "h5"}' => Set { 'heading' },
  '{"name": "h6"}' => Set { 'heading' },
  '{"name": "img"}' => Set { 'img' },
  '{"name": "a"}' => Set { 'link' },
  '{"name": "link"}' => Set { 'link' },
  '{"name": "ol"}' => Set { 'list' },
  '{"name": "ul"}' => Set { 'list' },
  '{"name": "li"}' => Set { 'listitem' },
  '{"name": "nav"}' => Set { 'navigation' },
  '{"name": "option"}' => Set { 'option' },
  '{"name": "input", "attributes": [ {"name": "type", "value": "radio"}] }' => Set { 'radio' },
  '{"name": "frame"}' => Set { 'region' },
  '{"name": "rel"}' => Set { 'roletype' },
  '{"name": "tr"}' => Set { 'row' },
  '{"name": "tbody"}' => Set { 'rowgroup' },
  '{"name": "tfoot"}' => Set { 'rowgroup' },
  '{"name": "thead"}' => Set { 'rowgroup' },
  '{"name": "th", "attributes": [ {"name": "scope", "value": "row"}] }' => Set { 'rowheader' },
  '{"name": "input", "attributes": [ {"name": "type", "value": "search"}] }' => Set { 'searchbox' },
  '{"name": "hr"}' => Set { 'separator' },
  '{"name": "dt"}' => Set { 'term' },
  '{"name": "dfn"}' => Set { 'term' },
  '{"name": "textarea"}' => Set { 'textbox' },
  '{"name": "input", "attributes": [ {"name": "type", "value": "text"}] }' => Set { 'textbox' }
}

The map of elements to roles is keyed by an HTML concept. An HTML concept corresponds to the baseConcepts and relatedConcepts of an ARIA role. Concepts exist in the context of a module: HTML, XForms, Dublin Core, for example. The concept representation is an object literal with a name property (the element name) and an optional attributes array.

The roles are provided in a Set.

Role to element

import { roleElements } from 'aria-query';

ARIA roles are mapped to the HTML Elements with the same inherent role. Some roles, such as columnheader are only mapped to an HTML element that expresses specific attributes. In the case of <input>, the element often requires a type attribute to map to an ARIA role.

Map {
  'article' => Set { '{"name": "article"}' },
  'button' => Set { '{"name": "button"}' },
  'cell' => Set { '{"name": "td"}' },
  'checkbox' => Set { '{"name": "input", "attributes": [ {"name": "type", "value": "checkbox"}] }' },
  'columnheader' => Set { '{"name": "th"}' },
  'combobox' => Set { '{"name": "select"}' },
  'command' => Set { '{"name": "menuitem"}' },
  'definition' => Set { '{"name": "dd"}', '{"name": "dfn"}' },
  'figure' => Set { '{"name": "figure"}' },
  'form' => Set { '{"name": "form"}' },
  'grid' => Set { '{"name": "table"}' },
  'gridcell' => Set { '{"name": "td"}' },
  'group' => Set { '{"name": "fieldset"}' },
  'heading' => Set { '{"name": "h1"}', '{"name": "h2"}', '{"name": "h3"}', '{"name": "h4"}',  '{"name": "h5"}', '{"name": "h6"}' },
  'img' => Set { '{"name": "img"}' },
  'link' => Set { '{"name": "a"}', '{"name": "link"}' },
  'list' => Set { '{"name": "ol"}', '{"name": "ul"}' },
  'listbox' => Set { '{"name": "select"}' },
  'listitem' => Set { '{"name": "li"}' },
  'menuitem' => Set { '{"name": "menuitem"}' },
  'navigation' => Set { '{"name": "nav"}' },
  'option' => Set { '{"name": "option"}' },
  'radio' => Set { '{"name": "input", "attributes": [ {"name": "type", "value": "radio"}] }' },
  'region' => Set { '{"name": "frame"}' },
  'roletype' => Set { '{"name": "rel"}' },
  'row' => Set { '{"name": "tr"}' },
  'rowgroup' => Set { '{"name": "tbody"}', '{"name": "tfoot"}', '{"name": "thead"}' },
  'rowheader' => Set { '{"name": "th", "attributes": [ {"name": "scope", "value": "row"}] }' },
  'searchbox' => Set { '{"name": "input", "attributes": [ {"name": "type", "value": "search"}] }' },
  'separator' => Set { '{"name": "hr"}' },
  'table' => Set { '{"name": "table"}' },
  'term' => Set { '{"name": "dt"}' },
  'textbox' => Set { '{"name": "textarea"}', '{"name": "input", "attributes": [ {"name": "type", "value": "text"}] }' }
}

The HTML concept values are provided in a Set.

License

Copyright (c) 2020 A11yance

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].