Skip to content

Commit

Permalink
next-major: Update docs and changeset for #3386 and #3367 (#3858)
Browse files Browse the repository at this point in the history
* Update pagelayout pane changeset

* Update docs for PageLayout.Pane

* Update SplitPageLayout.Pane docs

* Update yellow-windows-accept.md

* positionWhenNarrow is never actually used

* delete deprecated prop from test

* add components changed to changeset

* Update changeset for ConfirmationDialog
  • Loading branch information
siddharthkp committed Oct 25, 2023
1 parent 74b2d21 commit 4fffd72
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 45 deletions.
6 changes: 4 additions & 2 deletions .changeset/lucky-coins-guess.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
"@primer/react": patch
"@primer/react": major
---

Use createRoot instead of ReactDOM.render for React 18 compatibility.
ConfirmationDialog: Use createRoot instead of ReactDOM.render for React 18 compatibility.

<!-- Changed components: ConfirmationDialog -->
4 changes: 3 additions & 1 deletion .changeset/yellow-windows-accept.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
"@primer/react": major
---

Removes PageLayout.Pane position prop.
Removes PageLayout.Pane position prop. The layout is now decided by the order in which PageLayout.Pane and PageLayout.Content appear in the DOM.

<!-- Changed components: PageLayout, SplitPageLayout -->
13 changes: 0 additions & 13 deletions src/PageLayout/PageLayout.docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,6 @@
"type": "string | undefined",
"description": "Id of an element that acts as a label for the pane. Required if the pane overflows and doesn't have aria-label."
},
{
"name": "position",
"type": "| 'start' | 'end' | { narrow?: | 'start' | 'end' regular?: | 'start' | 'end' wide?: | 'start' | 'end' }",
"defaultValue": "'end'",
"description": ""
},
{
"name": "positionWhenNarrow",
"type": "| 'inherit' | 'start' | 'end'",
"defaultValue": "'inherit'",
"deprecated": true,
"description": "Use the position prop with a responsive value instead."
},
{
"name": "width",
"type": "| 'small' | 'medium' | 'large' | { min: string max: string default: string }",
Expand Down
2 changes: 1 addition & 1 deletion src/PageLayout/PageLayout.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('PageLayout', () => {
<PageLayout>
<PageLayout.Header>Header</PageLayout.Header>
<PageLayout.Content>Content</PageLayout.Content>
<PageLayout.Pane positionWhenNarrow="start">Pane</PageLayout.Pane>
<PageLayout.Pane>Pane</PageLayout.Pane>
<PageLayout.Footer>Footer</PageLayout.Footer>
</PageLayout>
</ThemeProvider>,
Expand Down
22 changes: 0 additions & 22 deletions src/PageLayout/PageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -493,21 +493,6 @@ const isPaneWidth = (width: PaneWidth | CustomWidthOptions): width is PaneWidth
}

export type PageLayoutPaneProps = {
/**
* @deprecated Use the `position` prop with a responsive value instead.
*
* Before:
* ```
* position="start"
* positionWhenNarrow="end"
* ```
*
* After:
* ```
* position={{regular: 'start', narrow: 'end'}}
* ```
*/
positionWhenNarrow?: 'inherit' | keyof typeof panePositions
'aria-labelledby'?: string
'aria-label'?: string
width?: PaneWidth | CustomWidthOptions
Expand Down Expand Up @@ -537,11 +522,6 @@ export type PageLayoutPaneProps = {
id?: string
} & SxProp

const panePositions = {
start: REGION_ORDER.paneStart,
end: REGION_ORDER.paneEnd,
}

const paneWidths = {
small: ['100%', null, '240px', '256px'],
medium: ['100%', null, '256px', '296px'],
Expand All @@ -555,8 +535,6 @@ const Pane = React.forwardRef<HTMLDivElement, React.PropsWithChildren<PageLayout
{
'aria-label': label,
'aria-labelledby': labelledBy,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
positionWhenNarrow = 'inherit',
width = 'medium',
minWidth = 256,
padding = 'none',
Expand Down
6 changes: 0 additions & 6 deletions src/SplitPageLayout/SplitPageLayout.docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,6 @@
{
"name": "SplitPageLayout.Pane",
"props": [
{
"name": "position",
"type": "| 'start' | 'end' | { narrow?: | 'start' | 'end' regular?: | 'start' | 'end' wide?: | 'start' | 'end' }",
"defaultValue": "'start'",
"description": ""
},
{
"name": "width",
"type": "| 'small' | 'medium' | 'large'",
Expand Down

0 comments on commit 4fffd72

Please sign in to comment.