Skip to content

Commit efb1659

Browse files
authoredDec 30, 2024··
fix(PageLayout): Remove unused width value in PageLayout.Pane (#5484)
* fix(PageLayout): Remove unused width pabe value * remove unused value * css
1 parent 578a33d commit efb1659

File tree

5 files changed

+20
-8
lines changed

5 files changed

+20
-8
lines changed
 

Diff for: ‎.changeset/forty-doors-visit.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/react": minor
3+
---
4+
5+
Fix responsive width of PageLayout

Diff for: ‎packages/react/src/PageLayout/PageLayout.examples.stories.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export const ParentDetail: StoryFn = () => {
6161
regular: false,
6262
wide: false,
6363
}}
64+
aria-label="Side pane"
6465
>
6566
<NavList>
6667
<NavList.Item
@@ -175,6 +176,7 @@ export const ParentDetailBreadcrumb: StoryFn = () => {
175176
regular: false,
176177
wide: false,
177178
}}
179+
aria-label="Side pane"
178180
>
179181
<NavList>
180182
<NavList.Item
@@ -275,6 +277,7 @@ export const FilterBottomSheet: StoryFn = () => {
275277
regular: false,
276278
wide: false,
277279
}}
280+
aria-label="Side pane"
278281
>
279282
<NavList>
280283
<NavList.Item
@@ -364,6 +367,7 @@ export const FilterActionMenu: StoryFn = () => {
364367
regular: false,
365368
wide: false,
366369
}}
370+
aria-label="Side pane"
367371
>
368372
<NavList>
369373
<NavList.Item
@@ -627,6 +631,7 @@ export const FiltersBottomSheetTwoLevels: StoryFn = () => {
627631
regular: false,
628632
wide: false,
629633
}}
634+
aria-label="Side pane"
630635
>
631636
<NavList>
632637
<NavList.Item
@@ -1118,6 +1123,7 @@ export const ParentDetailPlusFilters: StoryFn = () => {
11181123
regular: false,
11191124
wide: false,
11201125
}}
1126+
aria-label="Side pane"
11211127
>
11221128
<NavList>
11231129
<NavList.Item

Diff for: ‎packages/react/src/PageLayout/PageLayout.features.stories.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const PullRequestPage = () => (
5858
this overflows, it should not break to overall page layout!
5959
</Box>
6060
</PageLayout.Content>
61-
<PageLayout.Pane>
61+
<PageLayout.Pane aria-label="Side pane">
6262
<Box sx={{display: 'flex', flexDirection: 'column', gap: 3}}>
6363
<Box>
6464
<Text sx={{fontSize: 0, fontWeight: 'bold', display: 'block', color: 'fg.muted'}}>Assignees</Text>
@@ -310,7 +310,7 @@ export const ResizablePane: StoryFn = () => (
310310
<PageLayout.Header>
311311
<Placeholder height={64} label="Header" />
312312
</PageLayout.Header>
313-
<PageLayout.Pane resizable position="start">
313+
<PageLayout.Pane resizable position="start" aria-label="Side pane">
314314
<Placeholder height={320} label="Pane" />
315315
</PageLayout.Pane>
316316
<PageLayout.Content>
@@ -329,7 +329,7 @@ export const ScrollContainerWithinPageLayoutPane: StoryFn = () => (
329329
<PageLayout rowGap="none" columnGap="none" padding="none" containerWidth="full">
330330
<PageLayout.Pane position="start" padding="normal" divider="line" sticky aria-label="Sticky pane">
331331
<Box sx={{overflow: 'auto'}}>
332-
<PageLayout.Pane padding="normal">
332+
<PageLayout.Pane padding="normal" aria-label="Side pane">
333333
<Placeholder label="Inner scroll container" height={800} />
334334
</PageLayout.Pane>
335335
</Box>
@@ -350,7 +350,7 @@ export const CustomPaneWidths: StoryFn = () => (
350350
<PageLayout.Header>
351351
<Placeholder height={64} label="Header" />
352352
</PageLayout.Header>
353-
<PageLayout.Pane resizable width={{min: '200px', default: '300px', max: '400px'}}>
353+
<PageLayout.Pane resizable width={{min: '200px', default: '300px', max: '400px'}} aria-label="Side pane">
354354
<Placeholder height={320} label="Pane" />
355355
</PageLayout.Pane>
356356
<PageLayout.Content>
@@ -367,7 +367,7 @@ export const WithCustomPaneHeading: StoryFn = () => (
367367
<PageLayout.Header>
368368
<Placeholder height={64} label="Header" />
369369
</PageLayout.Header>
370-
<PageLayout.Pane resizable position="start">
370+
<PageLayout.Pane resizable position="start" aria-label="Side pane">
371371
<Heading as="h2" sx={{fontSize: 3}} id="pane-heading">
372372
Pane Heading
373373
</Heading>

Diff for: ‎packages/react/src/PageLayout/PageLayout.module.css

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ body[data-page-layout-dragging='true'] * {
4646
}
4747

4848
@media screen and (min-width: 1280px) {
49-
--pane-width-large: 336px;
5049
--pane-max-width-diff: 959px;
5150
}
5251

Diff for: ‎packages/react/src/PageLayout/PageLayout.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -759,11 +759,13 @@ const panePositions = {
759759
const paneWidths = {
760760
small: ['100%', null, '240px', '256px'],
761761
medium: ['100%', null, '256px', '296px'],
762-
large: ['100%', null, '256px', '320px', '336px'],
762+
large: ['100%', null, '256px', '320px'],
763763
}
764764

765765
const defaultPaneWidth = {small: 256, medium: 296, large: 320}
766766

767+
const overflowProps = {tabIndex: 0, role: 'region'}
768+
767769
const Pane = React.forwardRef<HTMLDivElement, React.PropsWithChildren<PageLayoutPaneProps>>(
768770
(
769771
{
@@ -998,7 +1000,7 @@ const Pane = React.forwardRef<HTMLDivElement, React.PropsWithChildren<PageLayout
9981000
/>
9991001
<Box
10001002
ref={paneRef}
1001-
{...(hasOverflow && {tabIndex: 0, role: 'region'})}
1003+
{...(hasOverflow ? overflowProps : {})}
10021004
{...labelProp}
10031005
{...(id && {id: paneId})}
10041006
{...paneStylingProps}

0 commit comments

Comments
 (0)
Please sign in to comment.