-
Notifications
You must be signed in to change notification settings - Fork 640
1885 bug splitpagelayoutpane needs to be able to consume heading 1 #3143
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
1885 bug splitpagelayoutpane needs to be able to consume heading 1 #3143
Conversation
🦋 Changeset detectedLatest commit: 7c2cf79 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
size-limit report 📦
|
…e-to-consume-heading-1
…e-heading-1' of github.com:primer/react into 1885-bug-splitpagelayoutpane-needs-to-be-able-to-consume-heading-1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requesting some changes about component interface and tests.
I have another question that betrays my ignorance: does this repo contain documentation for these components as well? I'd like to review the documentation to make sure it adequately communicates how to include headings with this component.
docs/content/SplitPageLayout.mdx
Outdated
| <Box sx={{height: 320, overflowY: 'auto', border: '1px solid', borderColor: 'border.default'}}> | ||
| <SplitPageLayout> | ||
| <SplitPageLayout.Pane> | ||
| <Placeholder label="Pane" height={120} heading="Pane Heading" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The component interface should support accepting a heading level, and in my opinion should make it a required argument.
In this case I believe we were wanting the heading to be a level 2, for instance, but I could imagine circumstances it might be a level 1 or a level 3.
I can see by the tests that it is a level 2, but I'm thinking here in terms of component design.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I can tell this is still choosing h2 by default, and I propose we require user to provide heading level.
Ah, the answer is yes. Let me propose the change... It looks like we need to add an item for the heading here as well? IIUC react/src/SplitPageLayout/SplitPageLayout.docs.json Lines 69 to 130 in a19b721
|
|
github/accessibility-audits#3506 |
| const {getByText} = render( | ||
| <ThemeProvider> | ||
| <SplitPageLayout> | ||
| <SplitPageLayout.Pane heading="Custom heading" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious if it makes more sense to make the heading a component itself rather then passing it in as a prop:
<SplitPageLayout.Pane.heading as='h3'>Custom heading"</SplitPageLayout.Pane.heading >
^ this would make it easier for people to add attributes in the future.
|
@andrialexandrou, @kendallgassner - I would love to get y'alls opinion on the additions to this PR. I think I covered all of the comments left on this PR, but want to make sure I've captured all of the criteria needed to close the main issue out. |
src/PageLayout/PageLayout.tsx
Outdated
| import React from 'react' | ||
| import {createGlobalStyle} from 'styled-components' | ||
| import Box from '../Box' | ||
| import Heading from '../Heading' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| import Heading from '../Heading' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nit to remove an unused dependency but other-wise this looks great!
Describe your changes here.
Closes #1885
Screenshots
Please provide before/after screenshots for any visual changes

(View in Storybook)
Merge checklist
Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.