Skip to content

chore(ActionMenu): Add fullscreen capabilities #6108

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

Merged
merged 33 commits into from
Jun 18, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
fe6ed7d
chore(ActionMenu): Add fullscreen sample story
francinelucca May 21, 2025
2596f3c
Create pink-trees-work.md
francinelucca May 21, 2025
51b85aa
Merge branch 'main' of github.com:primer/react into chore/add-action-…
francinelucca May 29, 2025
0877e5c
refactor: bubble up close button to AnchoredOverlay
francinelucca Jun 10, 2025
5e5eb27
Merge branch 'main' into chore/add-action-menu-full-screen-story
francinelucca Jun 10, 2025
83280ee
format
francinelucca Jun 11, 2025
5513948
lint fixes
francinelucca Jun 11, 2025
8e958b6
test(vrt): update snapshots
francinelucca Jun 11, 2025
056ca3b
Revert "test(vrt): update snapshots"
francinelucca Jun 11, 2025
a4f6994
Merge branch 'main' into chore/add-action-menu-full-screen-story
francinelucca Jun 11, 2025
205b625
Merge branch 'main' into chore/add-action-menu-full-screen-story
francinelucca Jun 11, 2025
40fb418
test(vrt): update snapshots
francinelucca Jun 11, 2025
dbf78fc
Merge branch 'main' into chore/add-action-menu-full-screen-story
francinelucca Jun 11, 2025
ae40b39
Update packages/react/src/AnchoredOverlay/AnchoredOverlay.tsx
francinelucca Jun 13, 2025
2831be5
Update packages/react/src/ActionMenu/ActionMenu.module.css
francinelucca Jun 13, 2025
4853135
Merge branch 'main' into chore/add-action-menu-full-screen-story
francinelucca Jun 13, 2025
658a986
Merge branch 'main' of github.com:primer/react into chore/add-action-…
francinelucca Jun 16, 2025
fc2bc41
add displayCloseButton, closeButtonProps to AnchoredOverlay, fix visu…
francinelucca Jun 16, 2025
c367bc7
fix double close button
francinelucca Jun 16, 2025
d01faca
format
francinelucca Jun 16, 2025
7c858e1
test(vrt): update snapshots
francinelucca Jun 16, 2025
1cc101a
visual reg fix
francinelucca Jun 16, 2025
6a5b157
Merge branch 'chore/add-action-menu-full-screen-story' of github.com:…
francinelucca Jun 16, 2025
d42108e
lint fix
francinelucca Jun 16, 2025
8c24cf1
test(vrt): update snapshots
francinelucca Jun 16, 2025
b0c0f1a
Merge branch 'main' into chore/add-action-menu-full-screen-story
francinelucca Jun 17, 2025
92cb54c
add min-height to fullscreen mode
francinelucca Jun 17, 2025
078fc96
Merge branch 'main' into chore/add-action-menu-full-screen-story
francinelucca Jun 17, 2025
b389e1b
test(vrt): update snapshots
francinelucca Jun 17, 2025
95ef218
Revert "test(vrt): update snapshots"
francinelucca Jun 17, 2025
182ea67
Revert "test(vrt): update snapshots"
francinelucca Jun 17, 2025
53e37b8
Revert "test(vrt): update snapshots"
francinelucca Jun 17, 2025
2746d78
Revert "test(vrt): update snapshots"
francinelucca Jun 17, 2025
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/pink-trees-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

chore(ActionMenu): Add fullscreen sample story and variant prop
29 changes: 29 additions & 0 deletions packages/react/src/ActionMenu/ActionMenu.examples.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,35 @@ export const CustomOverlayProps = () => {
)
}

export const FullScreen = () => {
const [open, setOpen] = React.useState(false)

return (
<Box sx={{display: 'flex', justifyContent: 'center'}}>
<ActionMenu open={open} onOpenChange={setOpen}>
<ActionMenu.Button>Menu</ActionMenu.Button>
<ActionMenu.Overlay
width="large"
align="center"
preventOverflow={false}
variant={{regular: 'anchored', narrow: 'fullscreen'}}
>
<ActionList>
<ActionList.Item>Option 1</ActionList.Item>
<ActionList.Item>Option 2</ActionList.Item>
<ActionList.Item>Option 2</ActionList.Item>
<ActionList.Item>Option 2</ActionList.Item>
<ActionList.Item>Option 2</ActionList.Item>
<ActionList.Item>Option 2</ActionList.Item>
<ActionList.Item>Option 2</ActionList.Item>
<ActionList.Item>Option 2</ActionList.Item>
</ActionList>
</ActionMenu.Overlay>
</ActionMenu>
</Box>
)
}

export const ControlledMenu = () => {
const [actionFired, fireAction] = React.useState('')
const onSelect = (name: string) => fireAction(name)
Expand Down
4 changes: 3 additions & 1 deletion packages/react/src/ActionMenu/ActionMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ const MenuButton = React.forwardRef(({...props}, anchorRef) => {
}) as PolymorphicForwardRefComponent<'button', ActionMenuButtonProps>

type MenuOverlayProps = Partial<OverlayProps> &
Pick<AnchoredOverlayProps, 'align' | 'side'> & {
Pick<AnchoredOverlayProps, 'align' | 'side' | 'variant'> & {
/**
* Recommended: `ActionList`
*/
Expand All @@ -242,6 +242,7 @@ const Overlay: React.FC<React.PropsWithChildren<MenuOverlayProps>> = ({
side,
onPositionChange,
'aria-labelledby': ariaLabelledby,
variant = {regular: 'anchored', narrow: 'anchored'},
...overlayProps
}) => {
// we typecast anchorRef as required instead of optional
Expand Down Expand Up @@ -285,6 +286,7 @@ const Overlay: React.FC<React.PropsWithChildren<MenuOverlayProps>> = ({
overlayProps={overlayProps}
focusZoneSettings={{focusOutBehavior: 'wrap'}}
onPositionChange={onPositionChange}
variant={variant}
>
<div ref={containerRef}>
<ActionListContainerContext.Provider
Expand Down
Loading