Heading update (new default level and updated docs)#716
Heading update (new default level and updated docs)#716BinaryMuse merged 4 commits intoprimer:majorfrom
Conversation
Change default heading level to `h2` and include prop type validation for styled-component `as` prop.
Updates the Heading component documentation to note the new default heading level (`h2`) and how to change the heading level by passing another heading value to the `as` prop.
|
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/primer/primer-components/78y77mxo0 |
emplums
left a comment
There was a problem hiding this comment.
This is great @taylorcjohnson thanks for picking this one up! Would you mind updating the TypeScript type definitions to only allow h1-h6 as valid as values? Other than that this is ready to go! 🙌
|
Thank you for taking a look @emplums! Apologies for missing the type definition 🤦♂️! I pushed an update, but would welcome extra review since I'm still new to TypeScript. Additionally, it seems like I should update src/__tests__/Heading.js as well. The first test There is also an invalid prop of Update (4/1/2020): I updated the tests for this component. It checks to see if an |
|
Tested manually and merged into release branch. Thanks again! |
|
Thank you! Happy to help! |
This draft pull request attempts to address the comments mentioned in issue #694:
The Heading component now defaults to using an h2 instead of h1. It also includes prop type validation for the
asprop. This may not be necessary, but it attempts to restrict the html elements to onlyh1-h6(please let me know if this is inappropriate). The docs page was also updated to make sure the user is aware that the default heading value ish2. It also updates the component props to include theasprop (similar to theTabNavcomponent).Finally, I wanted to verify that this is a major version change and that
package.jsonshould be updated accordingly (version 17.0.0 as of this pull request).Closes #694
Screenshots
Please provide before/after screenshots for any visual changes
Merge checklist
index.d.ts) if necessaryTake a look at the What we look for in reviews section of the contibuting guidelines for more infomation on how we review PRs.