Skip to content

chore(components): update language switch accessible names and roles #5350

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

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

myrta2302
Copy link
Contributor

@myrta2302 myrta2302 commented Apr 26, 2025

📄 Description

This PR initial goal was to fix non conformity with the https://www.w3.org/WAI/WCAG22/Understanding/label-in-name accessibility guideline. Instead of modifying the aria-label content this PR replaces the aria-labels set on the contained button elements with descriptive visually hidden span texts. List variant 'role' attrs are modified to correctly recognize list items. An info box is added in the language switch page of the documentation to inform about proper usage of the name language option prop.

📝 Checklist

  • ✅ My code follows the style guidelines of this project
  • 🛠️ I have performed a self-review of my own code
  • 📄 I have made corresponding changes to the documentation
  • ⚠️ My changes generate no new warnings or errors
  • ✔️ New and existing unit tests pass locally with my changes

@myrta2302 myrta2302 linked an issue Apr 26, 2025 that may be closed by this pull request
3 tasks
Copy link

changeset-bot bot commented Apr 26, 2025

🦋 Changeset detected

Latest commit: 223a5ba

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

This PR includes changesets to release 12 packages
Name Type
@swisspost/design-system-documentation Patch
@swisspost/design-system-components Patch
@swisspost/design-system-components-angular-workspace Patch
@swisspost/design-system-components-react Patch
@swisspost/design-system-components-angular Patch
@swisspost/design-system-nextjs-integration Patch
@swisspost/design-system-styles Patch
@swisspost/design-system-tokens Patch
@swisspost/design-system-icons Patch
@swisspost/design-system-styles-primeng Patch
@swisspost/internet-header Patch
@swisspost/design-system-styles-primeng-workspace Patch

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

@swisspost-bot
Copy link
Contributor

swisspost-bot commented Apr 26, 2025

Related Previews

@myrta2302 myrta2302 marked this pull request as ready for review April 28, 2025 15:52
@myrta2302 myrta2302 requested review from a team as code owners April 28, 2025 15:52
@myrta2302 myrta2302 requested a review from leagrdv April 28, 2025 15:52
@leagrdv leagrdv requested a review from alionazherdetska May 12, 2025 14:36
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe you could split it into two changesets:

  1. '@swisspost/design-system-components': patch
    Enhanced accessibility of post-language-switch component by replacing aria-labels with visually-hidden spans and properly assigning semantic role attributes.

  2. '@swisspost/design-system-documentation': patch
    Added comprehensive accessibility guidance to post-language-switch documentation with practical examples showing how to correctly match visible text with the name prop to ensure speech recognition compatibility.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice idea! :)

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.

Language switch: label and accessible name don't match
3 participants