Background
Currently, the MenuButton component only supports a quiet ToggleButton to display the menu. In some cases, this quiet MenuButton could not be visible enough, and we may want to use a normal button (or a progressive button).
To enable this, MenuButton should use a regular Button instead of a ToggleButton. This will allow us to support the full range of weights (normal, quiet, primary) and actions (progressive, destructive). The behavior when the menu is expanded wouldn't quite match the mockup above, because we wouldn't be showing the toggled-on state of the ToggleButton, but that's fine: we don't need a visual indication on the button that it's toggled on, since you already know that from the menu being expanded.
Ideally this change should also fix T379075: MenuButton: selecting an item with Enter doesn't close the menu and T399905: MenuButton: Pressing Enter when a menu item is highlighted should select that item as a side effect.
Acceptance criteria
Design
- Update the component in the Figma library
Code
- Change MenuButton to use a Button instead of a ToggleButton
- But preserve the current behavior where clicking the button opens the menu if it's closed, or closes it if it's open, and clicking away closes the menu
- Add action and weight props that are passed through to Button
- But make the default weight quiet, to preserve compatibility with the current behavior
