-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat: generalize menu component #8169
Merged
kodiakhq
merged 17 commits into
carbon-design-system:main
from
janhassel:menu-component
May 19, 2021
Merged
feat: generalize menu component #8169
kodiakhq
merged 17 commits into
carbon-design-system:main
from
janhassel:menu-component
May 19, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Deploy Preview for carbon-elements ready! Built with commit 528f525 |
Deploy Preview for carbon-components-react ready! Built without sensitive environment variables with commit 528f525 https://deploy-preview-8169--carbon-components-react.netlify.app |
joshblack
approved these changes
Apr 23, 2021
tw15egan
requested review from
a team and
jeanservaas
and removed request for
a team
April 26, 2021 20:45
andreancardona
approved these changes
May 13, 2021
joshblack
added
status: ready to merge 🎉
and removed
status: ready for review 👀
status: visual review 🔍
labels
May 18, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR refactors the currently experimental
ContextMenu
component and generalizes it to theMenu
component which in turn is used to create context menus as well as a more advancedOverflowMenu
(to support single- and multi-select as well as nesting).The context menu is simply a hook now (
useContextMenu
).This PR adds a new OverflowMenu implementation which is nothing more than the trigger icon and logic to open the menu. All additional logic such as keyboard navigation, edge detection and accessibility markup is handled by the
Menu
component.Intended children for the new OverflowMenu are the same
MenuItem
,SelectableMenuItem
,MenuGroup
,MenuRadioGroup
andMenuDivider
that are used to build context menus.The new OverflowMenu sits behind a feature flag since the underlying menu component is still considered experimental and there is no feature parity between the old/current OverflowMenu and this one.
Right now, it just uses the
enable-2021-release
flag. Should it instead use a separate flag?With the menu being a more general component, teams could use it for more menu-related areas (like an app menu bar or the entries in the UI shell) while keeping a consistent (and accessible) experience with other Carbon menus.
Changelog
New
OverflowMenu
component under feature flag (enable-2021-release
).Changed
ContextMenu
intoMenu
unstable_Menu
storiesMore information
Both, the context menu and the new
OverflowMenu
stories are grouped under the "unstable_Menu" entry in the storybook.