Skip to content
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

next-major: Update docs and changeset for #3386 and #3367 #3858

Merged
merged 9 commits into from
Oct 25, 2023
2 changes: 1 addition & 1 deletion .changeset/yellow-windows-accept.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"@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.
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
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
Loading