Skip to content

Commit

Permalink
feat: update role states and properties
Browse files Browse the repository at this point in the history
* Addition of `aria-braillelabel`
* Addition of `aria-brailleroledescription`
* Addition of `aria-description`
* Fixes to some `prohibitedProps` and `nameFrom` fields
  • Loading branch information
jlp-craigmorten committed Jul 8, 2024
1 parent 18110d3 commit 2085d0f
Show file tree
Hide file tree
Showing 29 changed files with 549 additions and 79 deletions.
6 changes: 3 additions & 3 deletions __tests__/src/elementRoleMap-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ const entriesList = [
[{"name": "h4"}, ["heading"]],
[{"name": "h5"}, ["heading"]],
[{"name": "h6"}, ["heading"]],
[{"attributes": [{"constraints": ["set"], "name": "alt"}], "name": "img"}, ["img"]],
[{"attributes": [{"constraints": ["undefined"], "name": "alt"}], "name": "img"}, ["img"]],
[{"attributes": [{"constraints": ["set"], "name": "alt"}], "name": "img"}, ["image", "img"]],
[{"attributes": [{"constraints": ["undefined"], "name": "alt"}], "name": "img"}, ["image", "img"]],
[{"name": "ins"}, ["insertion"]],
[{"attributes": [{"constraints": ["set"], "name": "href"}], "name": "a"}, ["link"]],
[{"attributes": [{"constraints": ["set"], "name": "href"}], "name": "area"}, ["link"]],
Expand All @@ -84,9 +84,9 @@ const entriesList = [
[{"name": "math"}, ["math"]],
[{"name": "meter"}, ["meter"]],
[{"name": "nav"}, ["navigation"]],
[{"attributes": [{"name": "alt", "value": ""}], "name": "img"}, ["none", "presentation"]],
[{"name": "option"}, ["option"]],
[{"name": "p"}, ["paragraph"]],
[{"attributes": [{"name": "alt", "value": ""}], "name": "img"}, ["presentation"]],
[{"name": "progress"}, ["progressbar"]],
[{"attributes": [{"name": "aria-valuemax"}, {"name": "aria-valuemin", "value": 0}, {"name": "aria-valuenow"}], "constraints": ["the progress bar is determinate"],"name": "progress"}, ["progressbar"]],
[{"attributes": [{"name": "type", "value": "radio"}], "name": "input"}, ["radio"]],
Expand Down
4 changes: 3 additions & 1 deletion __tests__/src/roleElementMap-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const entriesList = [
["gridcell", [{"constraints": ["ancestor table element has grid role", "ancestor table element has treegrid role"], "name": "td"}]],
["group", [{"name": "details"}, {"name": "fieldset"}, {"name": "optgroup"}, {"name": "address"}]],
["heading", [{"name": "h1"}, {"name": "h2"}, {"name": "h3"}, {"name": "h4"}, {"name": "h5"}, {"name": "h6"}]],
["image", [{"attributes": [{"constraints": ["set"], "name": "alt"}], "name": "img"}, {"attributes": [{"constraints": ["undefined"], "name": "alt"}], "name": "img"}]],
["img", [{"attributes": [{"constraints": ["set"], "name": "alt"}], "name": "img"}, {"attributes": [{"constraints": ["undefined"], "name": "alt"}], "name": "img"}]],
["insertion", [{"name": "ins"}]],
["link", [{"attributes": [{"constraints": ["set"], "name": "href"}], "name": "a"}, {"attributes": [{"constraints": ["set"], "name": "href"}], "name": "area"}]],
Expand All @@ -37,6 +38,7 @@ const entriesList = [
["math", [{"name": "math"}]],
["meter", [{"name": "meter"}]],
["navigation", [{"name": "nav"}]],
["none", [{"attributes": [{"name": "alt", "value": ""}], "name": "img"}]],
["option", [{"name": "option"}]],
["paragraph", [{"name": "p"}]],
["presentation", [{"attributes": [{"name": "alt", "value": ""}], "name": "img"}]],
Expand Down Expand Up @@ -146,7 +148,7 @@ describe('roleElementMap', function () {
});
describe('spread operator', function () {
it('should have a specific length', function () {
expect([...roleElementMap].length).toEqual(55);
expect([...roleElementMap].length).toEqual(57);
});
test.each([...roleElementMap])('Testing element: %o', (obj, roles) => {
expect(entriesList).toEqual(
Expand Down
5 changes: 4 additions & 1 deletion __tests__/src/rolesMap-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const entriesList = [
["code", expect.any(Object)],
["columnheader", expect.any(Object)],
["combobox", expect.any(Object)],
["comment", expect.any(Object)],
["command", expect.any(Object)],
["complementary", expect.any(Object)],
["composite", expect.any(Object)],
Expand All @@ -34,6 +35,7 @@ const entriesList = [
["gridcell", expect.any(Object)],
["group", expect.any(Object)],
["heading", expect.any(Object)],
["image", expect.any(Object)],
["img", expect.any(Object)],
["input", expect.any(Object)],
["insertion", expect.any(Object)],
Expand Down Expand Up @@ -81,6 +83,7 @@ const entriesList = [
["strong", expect.any(Object)],
["structure", expect.any(Object)],
["subscript", expect.any(Object)],
["suggestion", expect.any(Object)],
["superscript", expect.any(Object)],
["switch", expect.any(Object)],
["tab", expect.any(Object)],
Expand Down Expand Up @@ -220,7 +223,7 @@ describe('rolesMap', function () {
});
describe('spread operator', function () {
it('should have a specific length', function () {
expect([...rolesMap].length).toEqual(139);
expect([...rolesMap].length).toEqual(142);
});
test.each([...rolesMap])('Testing element: %o', (obj, roles) => {
expect(entriesList).toEqual(
Expand Down
3 changes: 3 additions & 0 deletions flow/aria.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ type ARIADocumentStructureRole =
| 'blockquote'
| 'caption'
| 'cell'
| 'comment'
| 'columnheader'
| 'definition'
| 'deletion'
Expand All @@ -66,6 +67,7 @@ type ARIADocumentStructureRole =
| 'generic'
| 'group'
| 'heading'
| 'image'
| 'img'
| 'insertion'
| 'list'
Expand All @@ -83,6 +85,7 @@ type ARIADocumentStructureRole =
| 'separator'
| 'strong'
| 'subscript'
| 'suggestion'
| 'superscript'
| 'table'
| 'term'
Expand Down
Loading

0 comments on commit 2085d0f

Please sign in to comment.