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

fix(PageHeader): add role prop and aria-label in top-level element #4956

Conversation

francinelucca
Copy link
Contributor

@francinelucca francinelucca commented Sep 12, 2024

Closes https://github.com/github/primer/issues/3466

Changelog

New

  • Adds role prop in PageHeader
  • Adds PageHeader tests to assert added functionality

Changed

  • Adds role="banner" and aria-label to applicable instances of PageHeader in Storybook and tests
  • Sets aria-label attribute in PageHeader's "root" element mapped to the supplied aria-label
  • Adjusts PageHeader's aria-label docs description to reference "landmark" instead of inaccurate "main landmark"
  • Includes aria-label prop in PageHeader Playground story

Removed

N/A

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Integration Test: https://github.com/github/github/pull/341930

  • Check preview Playground story:
    • Notice in the DOM the "banner" role in the top-level Box element and the aria-label that maps to the title prop
    • Change title prop in playground and notice the aria-label change in the DOM as well
  • Check preview Default story:
    • Notice in the DOM the "banner" role in the top-level Box element and the aria-label

Merge checklist

Copy link

changeset-bot bot commented Sep 12, 2024

🦋 Changeset detected

Latest commit: 863c1e1

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

This PR includes changesets to release 1 package
Name Type
@primer/react 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

github-actions bot commented Sep 12, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 97.42 KB (-0.07% 🔽)
packages/react/dist/browser.umd.js 97.71 KB (-0.01% 🔽)

francinelucca and others added 3 commits September 13, 2024 17:10
…6-prcpageheader-best-practice-container-lacks-a-role
…r-lacks-a-role' of github.com:primer/react into francinelucca/3466-prcpageheader-best-practice-container-lacks-a-role
@primer-integration
Copy link

👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/341930

@francinelucca francinelucca marked this pull request as ready for review September 17, 2024 19:52
@francinelucca francinelucca requested a review from a team as a code owner September 17, 2024 19:52
@francinelucca francinelucca added status: review needed staff Author is a staff member labels Sep 17, 2024
Copy link
Collaborator

@camertron camertron left a comment

Choose a reason for hiding this comment

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

LGTM 🫡

@francinelucca francinelucca added this pull request to the merge queue Sep 25, 2024
Merged via the queue into main with commit 15cb90f Sep 25, 2024
43 checks passed
@francinelucca francinelucca deleted the francinelucca/3466-prcpageheader-best-practice-container-lacks-a-role branch September 25, 2024 19:55
@primer primer bot mentioned this pull request Sep 25, 2024
@primer primer bot mentioned this pull request Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants