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
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',
Copy link
Member Author

Choose a reason for hiding this comment

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

Note for reviewer: Only present in props, not used in the body of the component or passed to another component

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": ""
},
Copy link
Member Author

@siddharthkp siddharthkp Oct 24, 2023

Choose a reason for hiding this comment

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

Note for reviewer: This is being passed down to PageLayout but PageLayout rejects it 😓

{
"name": "width",
"type": "| 'small' | 'medium' | 'large'",
Expand Down