-
Notifications
You must be signed in to change notification settings - Fork 614
chore(ActionMenu): Add fullscreen sample story #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
base: main
Are you sure you want to change the base?
Changes from 2 commits
fe6ed7d
2596f3c
51b85aa
0877e5c
5e5eb27
83280ee
5513948
8e958b6
056ca3b
a4f6994
205b625
40fb418
dbf78fc
ae40b39
2831be5
4853135
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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` | ||
*/ | ||
|
@@ -242,6 +242,7 @@ const Overlay: React.FC<React.PropsWithChildren<MenuOverlayProps>> = ({ | |
side, | ||
onPositionChange, | ||
'aria-labelledby': ariaLabelledby, | ||
variant = {regular: 'anchored', narrow: 'anchored'}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Defining the default Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||
...overlayProps | ||
}) => { | ||
// we typecast anchorRef as required instead of optional | ||
|
@@ -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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The newly added
variant
prop should be documented (e.g., in JSDoc or PropTypes) to clarify the allowed shapes and describe its behavior for maintainers and consumers.Copilot uses AI. Check for mistakes.