Skip to content
Draft
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
5 changes: 5 additions & 0 deletions .changeset/strange-steaks-burn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": major
---

Update PageLayout component to no longer support sx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.PageLayoutRedBorder {
border: var(--borderWidth-default) solid var(--borderColor-closed-emphasis);
}

.PageLayoutGreenText {
color: var(--fgColor-success);
}
12 changes: 7 additions & 5 deletions packages/react/src/PageLayout/PageLayout.dev.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import type {Meta, StoryFn} from '@storybook/react-vite'
import {Placeholder} from '../Placeholder'
import {PageLayout} from './PageLayout'
import {clsx} from 'clsx'

Check failure on line 4 in packages/react/src/PageLayout/PageLayout.dev.stories.tsx

View workflow job for this annotation

GitHub Actions / lint

'clsx' is defined but never used
import classes from './PageLayout.dev.stories.module.css'

const meta: Meta = {
title: 'Components/PageLayout/Dev',
Expand Down Expand Up @@ -346,11 +348,10 @@
padding={args.padding}
rowGap={args.rowGap}
columnGap={args.columnGap}
sx={{border: '1px solid red'}}
className={classes.PageLayoutRedBorder}
>
<PageLayout.Header
padding={args['Header.padding']}
sx={{color: 'var(--fgColor-success)'}}
divider={{
narrow: args['Header.divider.narrow'],
regular: args['Header.divider.regular'],
Expand All @@ -361,23 +362,23 @@
regular: args['Header.hidden.regular'],
wide: args['Header.hidden.wide'],
}}
className={classes.PageLayoutGreenText}
>
<Placeholder height={args['Header placeholder height']} label="Header" />
</PageLayout.Header>
<PageLayout.Content
sx={{color: 'var(--fgColor-success)'}}
width={args['Content.width']}
padding={args['Content.padding']}
hidden={{
narrow: args['Content.hidden.narrow'],
regular: args['Content.hidden.regular'],
wide: args['Content.hidden.wide'],
}}
className={classes.PageLayoutGreenText}
>
<Placeholder height={args['Content placeholder height']} label="Content" />
</PageLayout.Content>
<PageLayout.Pane
sx={{color: 'var(--fgColor-success)'}}
position={{
narrow: args['Pane.position.narrow'],
regular: args['Pane.position.regular'],
Expand All @@ -398,11 +399,11 @@
regular: args['Pane.hidden.regular'],
wide: args['Pane.hidden.wide'],
}}
className={classes.PageLayoutGreenText}
>
<Placeholder height={args['Pane placeholder height']} label="Pane" />
</PageLayout.Pane>
<PageLayout.Footer
sx={{color: 'var(--fgColor-success)'}}
padding={args['Footer.padding']}
divider={{
narrow: args['Footer.divider.narrow'],
Expand All @@ -414,6 +415,7 @@
regular: args['Footer.hidden.regular'],
wide: args['Footer.hidden.wide'],
}}
className={classes.PageLayoutGreenText}
>
<Placeholder height={args['Footer placeholder height']} label="Footer" />
</PageLayout.Footer>
Expand Down
25 changes: 0 additions & 25 deletions packages/react/src/PageLayout/PageLayout.docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@
"type": "| 'none' | 'condensed' | 'normal'",
"defaultValue": "'normal'",
"description": ""
},
{
"name": "sx",
"type": "SystemStyleObject",
"deprecated": true
}
],
"subcomponents": [
Expand Down Expand Up @@ -104,11 +99,6 @@
"type": "| boolean | { narrow?: boolean regular?: boolean wide?: boolean }",
"defaultValue": "false",
"description": "Whether the header is hidden."
},
{
"name": "sx",
"type": "SystemStyleObject",
"deprecated": true
}
]
},
Expand Down Expand Up @@ -144,11 +134,6 @@
"type": "| boolean | { narrow?: boolean regular?: boolean wide?: boolean }",
"defaultValue": "false",
"description": "Whether the content is hidden."
},
{
"name": "sx",
"type": "SystemStyleObject",
"deprecated": true
}
]
},
Expand Down Expand Up @@ -232,11 +217,6 @@
"description": "Which side of the page the pane should be on. Can be changed for different viewport widths.",
"defaultValue": ""
},
{
"name": "sx",
"type": "SystemStyleObject",
"deprecated": true
},
{
"name": "ref",
"type": "React.RefObject<HTMLDivElement>"
Expand Down Expand Up @@ -282,11 +262,6 @@
"type": "| boolean | { narrow?: boolean regular?: boolean wide?: boolean }",
"defaultValue": "false",
"description": "Whether the footer is hidden."
},
{
"name": "sx",
"type": "SystemStyleObject",
"deprecated": true
}
]
}
Expand Down
18 changes: 18 additions & 0 deletions packages/react/src/PageLayout/PageLayout.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,24 @@ body[data-page-layout-dragging='true'] * {
}
}

/* DRAG HANDLE STYLES */
.PageLayoutPaneDragHandle {
position: absolute;
inset: 0 -2px;
cursor: col-resize;
transition: background 0.2s;
background: transparent;
}

.PageLayoutPaneDragHandle:hover {
background: var(--bgColor-neutral-muted);
}

.PageLayoutPaneDragHandle.IsDragging,
.PageLayoutPaneDragHandle.IsDragging:hover {
background: var(--bgColor-accent-emphasis);
}

.Header {
width: 100%;
/* stylelint-disable-next-line primer/spacing */
Expand Down
1 change: 0 additions & 1 deletion packages/react/src/PageLayout/PageLayout.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@ export const Default: StoryFn = args => (
padding={args.padding}
rowGap={args.rowGap}
columnGap={args.columnGap}
sx={args.sx}
>
{args['Render header?'] ? (
<PageLayout.Header
Expand Down
Loading
Loading