{"id":17767300,"url":"https://github.com/jamiebuilds/aria-data","last_synced_at":"2025-03-15T13:31:15.546Z","repository":{"id":57183630,"uuid":"140881713","full_name":"jamiebuilds/aria-data","owner":"jamiebuilds","description":"Raw JSON data for WAI-ARIA 1.1 roles, attributes (states \u0026 properties), and value types","archived":false,"fork":false,"pushed_at":"2020-09-04T02:33:29.000Z","size":166,"stargazers_count":16,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-12T21:02:34.483Z","etag":null,"topics":["a11y","aria","dataset","json","spec","standards","w3c"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamiebuilds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-13T18:41:40.000Z","updated_at":"2024-06-12T11:16:23.000Z","dependencies_parsed_at":"2022-08-23T01:21:02.277Z","dependency_job_id":null,"html_url":"https://github.com/jamiebuilds/aria-data","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamiebuilds%2Faria-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamiebuilds%2Faria-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamiebuilds%2Faria-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamiebuilds%2Faria-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamiebuilds","download_url":"https://codeload.github.com/jamiebuilds/aria-data/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243735842,"owners_count":20339536,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["a11y","aria","dataset","json","spec","standards","w3c"],"created_at":"2024-10-26T20:45:56.846Z","updated_at":"2025-03-15T13:31:15.189Z","avatar_url":"https://github.com/jamiebuilds.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aria-data\n\n\u003e Raw JSON data for [WAI-ARIA 1.1](https://www.w3.org/TR/wai-aria-1.1/) roles, attributes (states \u0026 properties), and value types\n\n## Install\n\n```sh\nyarn add aria-data\n```\n\n## Usage\n\n```js\nconst ariaData = require('aria-data');\n// {\n//   roles: {...},\n//   valueTypes: {...},\n//   attributes: {...}\n// }\n```\n\n## Guide\n\n### References\n\nThis dataset uses URLs such as `https://www.w3.org/TR/wai-aria-1.1/#alert` as\nreference IDs for entities. For example:\n\n```json\n{\n  \"ref\": \"https://www.w3.org/TR/wai-aria-1.1/#aria-activedescendant\",\n  \"name\": \"aria-activedescendant\",\n  \"description\": \"Identifies the currently active element (...)\",\n  \"valueType\": \"https://www.w3.org/TR/wai-aria-1.1/#valuetype_idref\"\n}\n```\n\n### Interface\n\nThis dataset has the following interface:\n\n```ts\nexport default interface {\n  roles: {\n    [ref: string]: {\n      ref: string,\n      name: string,\n      description?: string,\n      abstract: boolean,\n      superClassRoles: Array\u003cRef\u003e,\n      attributes: Array\u003cRef\u003e,\n    },\n  },\n  valueTypes: {\n    [ref: string]: {\n      ref: string,\n      name: string,\n      description?: string,\n    },\n  },\n  attributes: {\n    [ref: string]: {\n      ref: string,\n      name: string,\n      description?: string,\n      valueType: Ref,\n      values?: Array\u003c{\n        value: string,\n        isDefault: boolean,\n        description?: string,\n      }\u003e\n    },\n  },\n}\n```\n\n## Example\n\n```js\nconst { roles, valueTypes, attributes } = require('aria-data');\nconst ROLES_ARR = Object.keys(roles).map(ref =\u003e roles[ref]);\n\nfunction findRole(roleName) {\n  return ROLES_ARR.find(role =\u003e role.name === roleName);\n}\n\nfunction getAttrs(role) {\n  function traverse(role) {\n    return role.superClassRoles.reduce((attrs, ref) =\u003e {\n      return attrs.concat(traverse(roles[ref]));\n    }, role.attributes);\n  }\n\n  return traverse(role).map(ref =\u003e attributes[ref].name);\n}\n\nlet alert = findRole('alert');\nlet alertAttrs = getAttrs(alert);\n// ['aria-expanded', 'aria-atomic', 'aria-busy', 'aria-controls', ...]\n// ['aria-atomic', 'aria-busy', ...]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamiebuilds%2Faria-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamiebuilds%2Faria-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamiebuilds%2Faria-data/lists"}