Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .changeset/spotty-parents-cheat.md
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'}}
```
Copy link
Member

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 🏆

83 changes: 63 additions & 20 deletions docs/content/PageLayout.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down Expand Up @@ -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'
}`}
Copy link
Member

Choose a reason for hiding this comment

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

(not blocker) we should think about how we want to show "type" in the docs, showing the typescript type isn't the most readable 😅

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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."
/>
Expand All @@ -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."
/>
Expand Down Expand Up @@ -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."
/>
Expand All @@ -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."
/>
Expand Down
Loading