Skip to content

Commit

Permalink
refactor(data-table): DataTable components to use aria-label instead …
Browse files Browse the repository at this point in the history
…of ariaLabel (#16332)

* refactor(data-table): data-table

Update to deprecate ariaLabel in favor of aria-label.

No breaking changes, aria-label will have priority if provided.

* refactor(data-table): data-table

add my user as contributor for code and a11y.

No changes in the logic compared to last commit

* Apply suggestions from code review

---------

Co-authored-by: Taylor Jones <[email protected]>
  • Loading branch information
digiacomo-a and tay1orjones authored Jun 13, 2024
1 parent 8d27f0e commit c35d1c7
Show file tree
Hide file tree
Showing 13 changed files with 2,731 additions and 4,250 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -1542,6 +1542,15 @@
"contributions": [
"code"
]
},
{
"login": "digiacomo-a",
"name": "Andrea DG",
"avatar_url": "https://avatars.githubusercontent.com/u/117646602?v=4",
"profile": "https://github.com/digiacomo-a",
"contributions": [
"code"
]
}
],
"commitConvention": "none"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ check out our [Contributing Guide](/.github/CONTRIBUTING.md) and our
<td align="center"><a href="https://github.com/aninaantony"><img src="https://avatars.githubusercontent.com/u/164350784?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Anina Antony</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=aninaantony" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/ahmedsemih"><img src="https://avatars.githubusercontent.com/u/102798814?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ahmed Semih Erkan</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=ahmedsemih" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/ychavoya"><img src="https://avatars.githubusercontent.com/u/7907338?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Yael Chavoya</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=ychavoya" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/digiacomo-a"><img src="https://avatars.githubusercontent.com/u/117646602?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Andrea DG</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=digiacomo-a" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/Kilian-Collender"><img src="https://avatars.githubusercontent.com/u/37899503?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Kilian Collender</b></sub></a><br /><a href="https://github.com/carbon-design-system/carbon/commits?author=Kilian-Collender" title="Code">💻</a></td>
</tr>
</table>
Expand Down
16 changes: 8 additions & 8 deletions packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2004,10 +2004,10 @@ Map {
},
"TableSelectAll": Object {
"propTypes": Object {
"ariaLabel": Object {
"isRequired": true,
"aria-label": Object {
"type": "string",
},
"ariaLabel": [Function],
"checked": Object {
"isRequired": true,
"type": "bool",
Expand Down Expand Up @@ -2037,10 +2037,10 @@ Map {
},
"TableSelectRow": Object {
"propTypes": Object {
"ariaLabel": Object {
"isRequired": true,
"aria-label": Object {
"type": "string",
},
"ariaLabel": [Function],
"checked": Object {
"isRequired": true,
"type": "bool",
Expand Down Expand Up @@ -8006,10 +8006,10 @@ Map {
},
"TableSelectAll" => Object {
"propTypes": Object {
"ariaLabel": Object {
"isRequired": true,
"aria-label": Object {
"type": "string",
},
"ariaLabel": [Function],
"checked": Object {
"isRequired": true,
"type": "bool",
Expand Down Expand Up @@ -8039,10 +8039,10 @@ Map {
},
"TableSelectRow" => Object {
"propTypes": Object {
"ariaLabel": Object {
"isRequired": true,
"aria-label": Object {
"type": "string",
},
"ariaLabel": [Function],
"checked": Object {
"isRequired": true,
"type": "bool",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"eslint": "^8.54.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.4",
"eslint-plugin-react-refresh": "^0.4.6",
"sass": "1.69.5",
"vite": "^5.0.13"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ const CustomDataTable = ({
indeterminate={
selectedRowsCountInFiltered > 0 && !selectedAllInFiltered
}
ariaLabel="Select all rows"
aria-label="Select all rows"
name={selectionAllName}
onSelect={handleChangeSelectionAll}
/>
Expand Down Expand Up @@ -247,7 +247,7 @@ const CustomDataTable = ({
id={`${elementId}--select-${rowId}`}
checked={Boolean(selected)}
name={selectionName}
ariaLabel="Select row"
aria-label="Select row"
onSelect={handleChangeSelection}
/>
)}
Expand Down
Loading

0 comments on commit c35d1c7

Please sign in to comment.