diff --git a/.changeset/forty-doors-visit.md b/.changeset/forty-doors-visit.md new file mode 100644 index 00000000000..c1c32d9ed46 --- /dev/null +++ b/.changeset/forty-doors-visit.md @@ -0,0 +1,5 @@ +--- +"@primer/react": minor +--- + +Fix responsive width of PageLayout diff --git a/packages/react/src/PageLayout/PageLayout.examples.stories.tsx b/packages/react/src/PageLayout/PageLayout.examples.stories.tsx index ddc160a543b..29f220c8548 100644 --- a/packages/react/src/PageLayout/PageLayout.examples.stories.tsx +++ b/packages/react/src/PageLayout/PageLayout.examples.stories.tsx @@ -61,6 +61,7 @@ export const ParentDetail: StoryFn = () => { regular: false, wide: false, }} + aria-label="Side pane" > { regular: false, wide: false, }} + aria-label="Side pane" > { regular: false, wide: false, }} + aria-label="Side pane" > { regular: false, wide: false, }} + aria-label="Side pane" > { regular: false, wide: false, }} + aria-label="Side pane" > { regular: false, wide: false, }} + aria-label="Side pane" > ( this overflows, it should not break to overall page layout! - + Assignees @@ -310,7 +310,7 @@ export const ResizablePane: StoryFn = () => ( - + @@ -329,7 +329,7 @@ export const ScrollContainerWithinPageLayoutPane: StoryFn = () => ( - + @@ -350,7 +350,7 @@ export const CustomPaneWidths: StoryFn = () => ( - + @@ -367,7 +367,7 @@ export const WithCustomPaneHeading: StoryFn = () => ( - + Pane Heading diff --git a/packages/react/src/PageLayout/PageLayout.module.css b/packages/react/src/PageLayout/PageLayout.module.css index ddc5400b2f3..b9987f015e9 100644 --- a/packages/react/src/PageLayout/PageLayout.module.css +++ b/packages/react/src/PageLayout/PageLayout.module.css @@ -46,7 +46,6 @@ body[data-page-layout-dragging='true'] * { } @media screen and (min-width: 1280px) { - --pane-width-large: 336px; --pane-max-width-diff: 959px; } diff --git a/packages/react/src/PageLayout/PageLayout.tsx b/packages/react/src/PageLayout/PageLayout.tsx index d4d3b18c30e..ee166fb5bce 100644 --- a/packages/react/src/PageLayout/PageLayout.tsx +++ b/packages/react/src/PageLayout/PageLayout.tsx @@ -759,11 +759,13 @@ const panePositions = { const paneWidths = { small: ['100%', null, '240px', '256px'], medium: ['100%', null, '256px', '296px'], - large: ['100%', null, '256px', '320px', '336px'], + large: ['100%', null, '256px', '320px'], } const defaultPaneWidth = {small: 256, medium: 296, large: 320} +const overflowProps = {tabIndex: 0, role: 'region'} + const Pane = React.forwardRef>( ( { @@ -998,7 +1000,7 @@ const Pane = React.forwardRef