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

Update NavList to use the new GroupHeading API and add an as prop to specify the heading level (h3 to match with the default) #4593

Merged
merged 3 commits into from
May 16, 2024

Conversation

broccolinisoup
Copy link
Member

@broccolinisoup broccolinisoup commented May 15, 2024

While fixing tests on the eslint upgrade PR #4592, I realised that <NavList.Group title="title"> is uses <ActionList.Group title="title"> under the hood and with eslint upgrade updating that usage to use the new ActionList.GroupHeading API, it throws an error as it requires an as prop to specify the heading level.

This PR, updates the old API to the new one on Navlist and specifies the heading level as h3 as per the default value. There shouldn't be any changes in the rendered HTML since we render the same HTML both for old and the new API for backward compatibility

Changelog

New

Changed

  1. On NavList, removed the title prop from the ActionList.Group title={title} and used <ActionList.GroupHeading>{title}</ActionList.GroupHeading>
  2. Add an explicit as prop to the <ActionList.GroupHeading>{title}</ActionList.GroupHeading> since we require it for pure lists, meaning lists that are not in the context of menu or listbox. The value it the default value, h3.

Removed

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

Make sure there is no snapshot changes in the rendered HTML.

Merge checklist

Copy link

changeset-bot bot commented May 15, 2024

🦋 Changeset detected

Latest commit: 19a4b77

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 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

@github-actions github-actions bot temporarily deployed to storybook-preview-4593 May 15, 2024 00:30 Inactive
Copy link
Contributor

github-actions bot commented May 15, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 88.35 KB (+0.01% 🔺)
packages/react/dist/browser.umd.js 88.61 KB (-0.04% 🔽)

@broccolinisoup broccolinisoup changed the title Add the default heading level with the as prop for NAvlist.Group Update NavList to use the new GroupHeading API and add an as prop to specify the heading level (h3 to match with the default) May 15, 2024
@broccolinisoup broccolinisoup marked this pull request as ready for review May 15, 2024 00:42
@broccolinisoup broccolinisoup requested a review from a team as a code owner May 15, 2024 00:42
@broccolinisoup broccolinisoup added this pull request to the merge queue May 16, 2024
Merged via the queue into main with commit d4e234f May 16, 2024
30 checks passed
@broccolinisoup broccolinisoup deleted the navlist-as-prop branch May 16, 2024 04:00
@primer primer bot mentioned this pull request May 16, 2024
JelloBagel pushed a commit that referenced this pull request May 16, 2024
…o specify the heading level (h3 to match with the default) (#4593)

* Add the default heading level with the as prop for NAvlist.Group

* Create calm-insects-boil.md

* update the comment
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.

2 participants