-
Notifications
You must be signed in to change notification settings - Fork 646
PageLayout: Update divider prop responsive API
#2198
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d6298c2
Deprecate dividerWhenNarrow in favor of responsive values
colebemis ff34a35
Update PageLayout docs
colebemis e7c1512
Create spotty-parents-cheat.md
colebemis 31ba88c
Update spotty-parents-cheat.md
colebemis 205788d
Update snapshots
colebemis 4b6a267
Merge branch 'main' into update-divider-prop
colebemis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| --- | ||
| "@primer/react": minor | ||
| --- | ||
|
|
||
| * Updated the `divider` prop in `PageLayout.Header`, `PageLayout.Pane`, and `PageLayout.Footer` to use the new responsive prop API introduced in https://github.com/primer/react/pull/2174. | ||
| * Deprecated the `dividerWhenNarrow` prop in favor of the new responsive prop API | ||
|
|
||
| **Before** | ||
|
|
||
| ``` | ||
| divider="line" | ||
| dividerWhenNarrow="filled" | ||
| ``` | ||
|
|
||
| **After** | ||
|
|
||
| ``` | ||
| divider={{regular: 'line', narrow: 'filled'}} | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,7 +48,8 @@ See [storybook](https://primer.style/react/storybook?path=/story/layout-pagelayo | |
| <PageLayout.Content> | ||
| <Placeholder label="Content" height={240} /> | ||
| </PageLayout.Content> | ||
| <PageLayout.Pane divider="line"> | ||
| {/* You can change the divider based on the viewport width */} | ||
| <PageLayout.Pane divider={{narrow: 'line'}}> | ||
| <Placeholder label="Pane" height={120} /> | ||
| </PageLayout.Pane> | ||
| <PageLayout.Footer divider="line"> | ||
|
|
@@ -172,25 +173,39 @@ See [storybook](https://primer.style/react/storybook?path=/story/layout-pagelayo | |
| <PropsTableRow | ||
| name="divider" | ||
| type={`| 'none' | ||
| | 'line'`} | ||
| | 'line' | ||
| | { | ||
| narrow?: | ||
| | 'none' | ||
| | 'line' | ||
| | 'filled' | ||
| regular?: | ||
| | 'none' | ||
| | 'line' | ||
| wide?: | ||
| | 'none' | ||
| | 'line' | ||
| }`} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed! Open to ideas here. |
||
| defaultValue="'none'" | ||
| /> | ||
| <PropsTableRow | ||
| name="dividerWhenNarrow" | ||
| deprecated | ||
| type={`| 'inherit' | ||
| | 'none' | ||
| | 'line' | ||
| | 'filled'`} | ||
| defaultValue="'inherit'" | ||
| description="Use the divider prop with a responsive value instead." | ||
| /> | ||
| <PropsTableRow | ||
| name="hidden" | ||
| type={`| boolean | ||
| | { | ||
| narrow?: boolean | ||
| regular?: boolean | ||
| wide?: boolean | ||
| }`} | ||
| narrow?: boolean | ||
| regular?: boolean | ||
| wide?: boolean | ||
| }`} | ||
| defaultValue="false" | ||
| description="Whether the header is hidden." | ||
| /> | ||
|
|
@@ -213,10 +228,10 @@ See [storybook](https://primer.style/react/storybook?path=/story/layout-pagelayo | |
| name="hidden" | ||
| type={`| boolean | ||
| | { | ||
| narrow?: boolean | ||
| regular?: boolean | ||
| wide?: boolean | ||
| }`} | ||
| narrow?: boolean | ||
| regular?: boolean | ||
| wide?: boolean | ||
| }`} | ||
| defaultValue="false" | ||
| description="Whether the content is hidden." | ||
| /> | ||
|
|
@@ -250,25 +265,39 @@ See [storybook](https://primer.style/react/storybook?path=/story/layout-pagelayo | |
| <PropsTableRow | ||
| name="divider" | ||
| type={`| 'none' | ||
| | 'line'`} | ||
| | 'line' | ||
| | { | ||
| narrow?: | ||
| | 'none' | ||
| | 'line' | ||
| | 'filled' | ||
| regular?: | ||
| | 'none' | ||
| | 'line' | ||
| wide?: | ||
| | 'none' | ||
| | 'line' | ||
| }`} | ||
| defaultValue="'none'" | ||
| /> | ||
| <PropsTableRow | ||
| name="dividerWhenNarrow" | ||
| deprecated | ||
| type={`| 'inherit' | ||
| | 'none' | ||
| | 'line' | ||
| | 'filled'`} | ||
| defaultValue="'inherit'" | ||
| description="Use the divider prop with a responsive value instead." | ||
| /> | ||
| <PropsTableRow | ||
| name="hidden" | ||
| type={`| boolean | ||
| | { | ||
| narrow?: boolean | ||
| regular?: boolean | ||
| wide?: boolean | ||
| }`} | ||
| narrow?: boolean | ||
| regular?: boolean | ||
| wide?: boolean | ||
| }`} | ||
| defaultValue="false" | ||
| description="Whether the pane is hidden." | ||
| /> | ||
|
|
@@ -281,25 +310,39 @@ See [storybook](https://primer.style/react/storybook?path=/story/layout-pagelayo | |
| <PropsTableRow | ||
| name="divider" | ||
| type={`| 'none' | ||
| | 'line'`} | ||
| | 'line' | ||
| | { | ||
| narrow?: | ||
| | 'none' | ||
| | 'line' | ||
| | 'filled' | ||
| regular?: | ||
| | 'none' | ||
| | 'line' | ||
| wide?: | ||
| | 'none' | ||
| | 'line' | ||
| }`} | ||
| defaultValue="'none'" | ||
| /> | ||
| <PropsTableRow | ||
| name="dividerWhenNarrow" | ||
| deprecated | ||
| type={`| 'inherit' | ||
| | 'none' | ||
| | 'line' | ||
| | 'filled'`} | ||
| defaultValue="'inherit'" | ||
| description="Use the divider prop with a responsive value instead." | ||
| /> | ||
| <PropsTableRow | ||
| name="hidden" | ||
| type={`| boolean | ||
| | { | ||
| narrow?: boolean | ||
| regular?: boolean | ||
| wide?: boolean | ||
| }`} | ||
| narrow?: boolean | ||
| regular?: boolean | ||
| wide?: boolean | ||
| }`} | ||
| defaultValue="false" | ||
| description="Whether the footer is hidden." | ||
| /> | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

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.
this will be really helpful for next major changelog 🏆