feat(menu): deprecate props.mode / always support full capabilities + icons #18153
+147
−218
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.
Closes #18148, #15875, #17725
Related #18084, https://ibm-analytics.slack.com/archives/C0M053VPT/p1715933314490569
Deprecates
props.mode
forMenu
and always support the full list of capabilities:The original concern of having a checkmark icon and a custom icon on the same visual level is being addressed by placing them in separate columns. The original concern was that users wouldn't be able to distinguish quickly what's a decorative icon and what is a status icon. The design was discussed with @thyhmdo and @ariellalgilmore.
Changelog
Changed
aria-checked
Removed
props.mode
@thyhmdo Side note: even if technically selectable items inside of menu and combo buttons would be allowed with this approach, we should probably add some details in the design guidance discouraging this. Also, here's our related discussion: https://ibm-analytics.slack.com/archives/C07HHD0CNR4/p1725459515044009
General side note: this adds support for icons for
MenuItemSelectable
. We should probably add support forMenuItemRadioGroup
as well but it's not compatible with the current structure. My long-term thought is to replace theprops.items
with something like aMenuItemRadioOption
component that should be used as children ofMenuItemRadioGroup
. But that's probably better discussed in a separate issue.Opening as draft as an issue occurs with the nested
MenuButton
. For some reason, theoverflow-y: auto
causes the nested menu to be clipped inMenuButton
but notMenu
. I'll need to investigate further.