in the latest set of tokens there was a mismatch betwee color in menu container and list-item container. In this PR we:
- Refactor menu and list token value function to have supported and unsupported token lists
- Apply menu-container-color to list-item-container-color
- Do some appropriate token renames to reflect this
- Move menu elevation layer below the list items
- We do this because the new v172 tokens fix the colors here by flattening elevation
PiperOrigin-RevId: 523531521
Changes:
- Elevation is now `inset:0;position:absolute;` by default
- Separated surface styles into a temporary `<md-elevation-surface>` element (this will be removed after tonal surface update)
PiperOrigin-RevId: 521934300
Before, I set the focused, actively-keyboard-interacted, or pressed element as visual selected state. That doesn't seem to be how GMDC handles it and created problems down the line with md-select where we could not show the currently-selected item + keyboard navigation at the same time.
This CL brings the behavior in line with GMDC and fixes this problem down the line for select.
Also in this CL I add the selected state to sub-menu-item when it's open
PiperOrigin-RevId: 519166067
Prepare menu to support md-select by doing the following:
- Export default values for typeahead configs
- Allow setting the role of the menu
- Support spaces in typeahead
- Make the typeahead controller public so that one can bind it to another node
- Listen to keydown events on capture rather than bubble
- Allow disabling typeahead with events to prevent submenu typeahead clashes
- Fire opening and closing events synchronously on quick = true
- Fix focus restoration timing as it would fight with setting custom focus on items
- Fix bug with `onWindowClick` not cleaning up
- Add `focus()` as mart of the menuitem api
- Prevent typeahead from messing with focus and leave that to the menu/list
PiperOrigin-RevId: 516640007
Expose the field container element to allow anchoring directly to it. This is necessary because if there is supporting text below the field, anchoring a menu to the md-field will cause the menu to anchor below the supporting text which would require some manual pixel-offsets to align correctly.
PiperOrigin-RevId: 516636675
In this PR:
- Added spacing tokens to list-item
- Made list inherit min-width from host
- Propagated that min-width from menu to list
- Small fix to single-line list item pushing the icon out of the list item if the supporting text was too long
PiperOrigin-RevId: 515750933
In this PR:
- Remove unnecessary list-item variants
- `md-list-item-icon` -> md-icon[data-variant=icon]
- `md-list-item-video` -> video[data-variant=video]
- `md-list-item-avatar` -> :is(img,div)[data-variant=avatar]
- `md-list-item-avatar` -> img[data-variant=avatar]
- also upgrade menu tokens to maximize token sharing in list-item and menu-item
- testing menu and list for unused & undefined tokens
- fixed some small things in list to align with spec more
PiperOrigin-RevId: 513932810
In particular, this allows external build tools like Rollup and @web/dev-server to understand imports of Lit, which is configured to require the ".js" extension via its export conditions (so that Lit import maps can remain minimal).
PiperOrigin-RevId: 469772992