Component design
Background/Goal
The MenuItem component needs to be designed and specified before its implementation as part of the TypeaheadSearch component.
Previous exploration: T166560
| This Figma file contains the design specifications for the menu item component. |
User stories
As a designer and developer, I need to be able to reuse a system-compliant MenuItem component, in order to present users with a list of selectable options (e.g. inside the DropdownMenu component).
Considerations
- MenuItem features a label (bold or regular) and, optionally, a description
- The MenuItem component may also contain a thumbnail or an icon
- MenuItem present default, hover, active, selected, selected hover and disabled states
Acceptance criteria (or Done)
- All the variants and interactive states of the MenuItem component are documented
- All the visual properties of each one of the states of the MenuItem are fully specified
Component implementation
Background
There are two components that have already been built in Codex that relate to MenuItem:
- ListTile, which represents the content and styling of the component
- Option, which represents the behavior of the component within the context of a menu
We may be able to combine these two existing components into a single component, MenuItem, that fulfills all of these needs and allows library users to add custom content via the default slot (as is currently possible with the Option component)
Acceptance criteria
- CdxMenuItem component is built and combines the UI of the ListTile component with the functionality of the Option component, if possible (if not, ListTIle will be updated to MenuItem and will continue to be UI-only)
- CdxMenuItem is properly documented on the Codex docs site
- CdxMenuItem follows the design spec
Design Review
- The box-shadow applied to the MenuItem's thumbnail should be replaced by a 1px border (@border-width-base) with the color #C8CCD1, @border-color-base--disabled in codex-base.json
- I think a specificity issue is causing the thumbnail placeholder color to be inherited instead of @color-placeholder (#72777d)
Notes:
- Responsiveness is out of the scope of this task and captured by this separate ticket: T302884



