Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A11y revamp: Pharos buttons (non-breaking change) #628

Merged

Conversation

sirrah-tam
Copy link
Contributor

This change: (check at least one)

  • Adds a new feature
  • Fixes a bug
  • Improves maintainability
  • Improves documentation
  • Is a release activity

Is this a breaking change? (check one)

  • Yes
  • No

Is the: (complete all)

  • Title of this pull request clear, concise, and indicative of the issue number it addresses, if any?
  • Test suite(s) passing?
  • Code coverage maximal?
  • Changeset added?
  • Component status page up to date?

What does this change address?
This updates the Pharos Button to allow consumers to pass in attributes (listed below) following a specific naming convention (a11y-) that assign the appropriate ARIA attribute to the inner element. This addresses the issues with custom web components and the shadow DOM and use of ARIA not being properly being parsed by assistive technologies.

a11y-label = aria-label (String)
a11y-description = aria-description (String)
a11y-expanded = aria-expanded (true, false, undefined (default))
a11y-pressed = aria-pressed (true, false, mixed, undefined (default))
a11y-haspopup = aria-haspopup (true, menu, listbox, tree, grid, dialog, false (default))

How does this change work?
Consumers can add these attributes along with the proper value to the Pharos Button and the appropriate ARIA attribute will be added to the underlying

element.

Additional context
This is not a breaking change as consumers are still able to utilize the label attribute, but does add a browser warning about the deprecated label attribute. The major release (v14) will include PR #594 and will remove all backwards compatibility as we include additional breaking changes. Additionally, all uses of ARIA listed above currently on the Pharos button will need to be updated accordingly to work as expected.

@sirrah-tam sirrah-tam requested a review from a team as a code owner October 5, 2023 18:24
@sirrah-tam sirrah-tam requested review from SMQuazi, mtorres3 and shoupeva-ithaka and removed request for a team October 5, 2023 18:24
@changeset-bot
Copy link

changeset-bot bot commented Oct 5, 2023

🦋 Changeset detected

Latest commit: b1779ec

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@ithaka/pharos Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@mtorres3 mtorres3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@brentswisher brentswisher merged commit 9ef1e18 into ithaka:develop Dec 8, 2023
6 checks passed
sirrah-tam added a commit to sirrah-tam/pharos that referenced this pull request Dec 8, 2023
Squashed commit of the following:

commit 9ef1e18
Author: Mat Harris <[email protected]>
Date:   Fri Dec 8 12:06:10 2023 -0500

    A11y revamp: Pharos buttons (non-breaking change) (ithaka#628)

    * docs: add @sirrah-tam as a contributor

    * feat(button): add a11y naming convention for aria

    * feat(button): add aria-description support

    * chore: add changset

    * Update packages/pharos/src/components/button/pharos-button.ts

    Co-authored-by: Dane Hillard <[email protected]>

    * Update packages/pharos/src/components/button/pharos-button.ts

    Co-authored-by: Dane Hillard <[email protected]>

    * feat(button): move property deprecated flag

    * fix(button): remove ts-ignore after lit upgrade

    * feat(button): add a11y state typing

    * fix: add TODO for future reference

    Co-authored-by: Dane Hillard <[email protected]>

    * fix(a11y attributes): update AriaHiddenState name

    ---------

    Co-authored-by: Dane Hillard <[email protected]>
daneah added a commit that referenced this pull request Dec 19, 2023
* develop:
  A11y revamp: Pharos buttons (non-breaking change) (#628)
  Radio, Checkbox: Fix group label (#652)
  Add elevation tokens and documentation (#643)
  fix(sidenav-link): external link opens in new tab (#645)
  Upgrade to TypeScript 5 (#644)
  feat(cli): add newly created components created using pharos-cli to initComponents files (#630)
  chore: version packages (#640)
  Coach Mark: Fix react component positioning (#638)
  Coach Mark: Documentation fixes (#639)
  chore(deps): bump @babel/traverse from 7.20.0 to 7.23.2 (#637)
  chore: version packages (#636)
  Icon: Add Panorama icon (#631)
  chore: version packages (#629)
  Loading spinner: add small and on background variant (#627)
  chore: version packages (#626)
  Sheet: allow expansion with attribute (#625)
  fix(button): remove fill on subtle disabled button on background (#618)
  chore(deps-dev): bump postcss from 8.4.25 to 8.4.31 (#624)
  chore: version packages (#623)
  Sheet: Add more close options and transition timing function (#620)
@github-actions github-actions bot mentioned this pull request Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants