4432 Commits

Author SHA1 Message Date
Elliott Marquez
dbf930a946 docs(catalog): import all ssr definitions to the server
PiperOrigin-RevId: 567733162
2023-09-22 15:34:44 -07:00
Elizabeth Mitchell
753677489b refactor(list)!: refactor list using md-item
BREAKING CHANGE: `<md-list-item>` now uses slots instead of properties and has removed many prescriptive items (such as avatar, image, and video items). The default slot can be used for any custom content.
```html
<md-list-item>
  <div slot="overline">OVERLINE</div>
  <div slot="headline">First line</div>
  <div slot="supporting-text">Second+ lines</div>
  <div slot="trailing-supporting-text">Trailing</div>
  <md-icon slot="start">star</md-icon>
  <md-icon slot="end">star</md-icon>
</md-list-item>
```
Add `type="button"` or `type="link"` for interactive list items.

PiperOrigin-RevId: 567732201
2023-09-22 15:30:06 -07:00
Elliott Marquez
5fad4f088f feat(menu): create a Menu interface for easier md-menu wrapping
PiperOrigin-RevId: 567728911
2023-09-22 15:15:41 -07:00
Elliott Marquez
1217b62ef2 refactor(menu)!: pull logic out of menuitem into a controller & change enum vals
BREAKING CHANGE: Several enums in menu had their values changed from SCREAM_CASE to kebab-case to follow style guide. They are NAVIGABLE_KEYS -> NavigableKey, SELECTION_KEY -> SelectionKey, CLOSE_REASON -> CloseReason, KEYDOWN_CLOSE_KEY -> KeydownCloseKey

PiperOrigin-RevId: 567727434
2023-09-22 15:09:41 -07:00
Elliott Marquez
63b01425e7 refactor(menu,select)!: rename fixed to positioning
This will enable forwards compatibility for `positioning="top-layer"` with popover.

BREAKING CHANGE: refactor `fixed` property to `positioning="fixed"` in Menu and `menuFixed` to `menuPositioning="fixed"`

PiperOrigin-RevId: 567723646
2023-09-22 14:54:57 -07:00
Elliott Marquez
2a1d8776a7 refactor(menu)!: refactor menu-item to use md-item and not rely on md-list-item
BREAKING CHANGE: This change refactors menu-item to no longer subclass or import from list-item. It also refactors it to use md-item directly which means that the API of menu item has moved from properties to slots. `start-*` and `end-*` slots are now just `start` and `end`, many tokens are now gone in favor of slotting. `headline` property is now a `slot="headline"` slot. Typeahead search text can now be set via `typeaheadText` which defaults to the slotted headline `textContent`. `select-option` now has the `displayText` which is used to display text in the `md-select` when the option is selected; defaults to the slotted headline `textContent`.

PiperOrigin-RevId: 567719483
2023-09-22 14:35:46 -07:00
Copybara-Service
61b382a9df Merge pull request #4968 from material-components:issue-template
PiperOrigin-RevId: 567706687
2023-09-22 13:43:12 -07:00
Elliott Marquez
d6cbf74137 refactor(menu)!: remove sub-menu-item in favor of sub-menu
BREAKING CHANGE: We have deleted `md-sub-menu-item`. Instead it is recommended to use `md-sub-menu` which can have `md-menu-item[slot=item]` and `md-menu[slot=menu]` slotted into it. This makes `sub-menu-item` accessible for screen readers using linear navigation

PiperOrigin-RevId: 567706398
2023-09-22 13:41:43 -07:00
Elliott Marquez
0384507447 refactor(menu)!: update menu to use host-aria
BREAKING CHANGE: Menu no longer uses md-list internally which means the list-related properties such as `list-tabindex` and `type` should now be on the host of md-menu. The new attributes should be `tabindex` and `role` respectively.

PiperOrigin-RevId: 567702229
2023-09-22 13:24:21 -07:00
Andrew Jakubowicz
1b0b072b65 code review feedback 2023-09-22 13:16:48 -07:00
Andrew Jakubowicz
e6925b267a add documentation specific bug 2023-09-21 17:19:26 -07:00
Andrew Jakubowicz
eb7ad966dd Add GitHub issue templates for bugs & links to docs and community 2023-09-21 17:13:08 -07:00
Elizabeth Mitchell
375b7664ef fix(dialog): not delegating focus in closure
PiperOrigin-RevId: 567363579
2023-09-21 11:17:12 -07:00
Andrew Jakubowicz
448fcddfa2 chore: decouple field component from interface imported from menu
PiperOrigin-RevId: 567361278
2023-09-21 11:09:34 -07:00
Elliott Marquez
c7c276fdfa feat(menu): do not close menu if anchor is clicked
PiperOrigin-RevId: 567096832
2023-09-20 15:25:03 -07:00
Elizabeth Mitchell
ffe4f79b5d feat(item): add <md-item> layout component
PiperOrigin-RevId: 567095805
2023-09-20 15:23:19 -07:00
Elliott Marquez
54fbb2ed5e feat(menu): implement md-sub-menu
md-sub-menu will succeed md-sub-menu-item. It allows for screen reader linear navigation

PiperOrigin-RevId: 567057310
2023-09-20 13:09:44 -07:00
Copybara-Service
dc75fbc639 Merge pull request #4956 from material-components:auto-update-docs
PiperOrigin-RevId: 566993280
2023-09-20 09:46:09 -07:00
lit-robot
621192bc12 docs: update API docs 2023-09-20 06:58:11 +00:00
Elliott Marquez
f576b60aec fix(textfield,focus,ripple): fix textfield SSR
PiperOrigin-RevId: 566863561
2023-09-19 23:57:20 -07:00
Copybara-Service
e1a04a158a Merge pull request #4952 from material-components:auto-pr-docs-action
PiperOrigin-RevId: 566852780
2023-09-19 23:02:36 -07:00
Elliott Marquez
a8f20c76e5 docs: bot to trigger update-docs on merge to main 2023-09-19 21:25:17 -07:00
Elliott Marquez
9f3e55d79a docs: auto-generate API docs
Updates API docs in our markdown files with Lit Analyzer by manually running `npm run update-docs`

COPYBARA_INTEGRATE_REVIEW=https://github.com/material-components/material-web/pull/4946 from material-components:api-docs 1322ca962041a4b1f30ef7ad3ef2c7eb9087f42b
PiperOrigin-RevId: 566834596
2023-09-19 21:05:47 -07:00
Elizabeth Mitchell
6132f1ed5c chore(tokens): remove v0.172
PiperOrigin-RevId: 566811842
2023-09-19 18:43:52 -07:00
Elizabeth Mitchell
e8b5b29d1e feat(iconbutton): update tokens to v0.192
BREAKING CHANGE: Replace `container-size` tokens with `container-width` and `container-height`.

PiperOrigin-RevId: 566801178
2023-09-19 17:52:12 -07:00
Elizabeth Mitchell
05957992e8 docs: add support doc for browser support and FAQ
PiperOrigin-RevId: 566777068
2023-09-19 16:20:38 -07:00
Elliott Marquez
80c53d3a8b docs(textfield): textfield images and figures
PiperOrigin-RevId: 566773604
2023-09-19 16:09:25 -07:00
Andrew Jakubowicz
3b5cbc4ede fix(list)!: list items are now noninteractive by default
BREAKING CHANGE: the `noninteractive` property has been replaced by the `interactive` property, and by default, a list-item will no longer show a ripple or focus ring.
What to change:
- To preserve prior default behavior, add the `interactive` attribute explicitly.
- Any setting of a truthy `noninteractive` attribute or property can be removed as it's the new default behavior.

PiperOrigin-RevId: 566696782
2023-09-19 11:43:59 -07:00
Andrew Jakubowicz
e3b3d86fa9 docs(select): add select documentation
PiperOrigin-RevId: 566674810
2023-09-19 10:34:58 -07:00
Elliott Marquez
6e54048f1e refactor(menu)!: rename corner and focus state values lowercase with dashes
BREAKING: for style guide enum consistency, we have renamed the corner values START_START etc. to be lowercase with dashes. e.g. start-start. The same has been done with MdMenu.defaultFocus' values.
PiperOrigin-RevId: 566454879
2023-09-18 17:09:17 -07:00
Copybara-Service
ff3073a280 Merge pull request #4944 from datvm:patch-1
PiperOrigin-RevId: 566394877
2023-09-18 13:19:40 -07:00
Elizabeth Mitchell
16bfac1343 feat(chips): swap to toolbar a11y pattern
BREAKING CHANGE: chips now follow the [aria toolbar pattern](https://www.w3.org/WAI/ARIA/apg/patterns/toolbar/examples/toolbar/). Chip sets are toolbars and chips are buttons or links. Filter chips are toggle buttons.
What to change:
- Remove `type` attribute from `<md-chip-set>` (you can mix and match chip types!)
- Remove `single-select` from `<md-chip-set>`. Use JS to control filter chips if single selection is required. Radio filter chips will come in a future update.
- Disabled chips CAN be focused with the keyboard if `always-focusable` is set.
- Filter chips no longer dispatch a `"selected"` event. Listen to `"click"` and use `event.target.selected` instead.
- ArrowUp and ArrowDown no longer navigate between chips. These are reserved for chip actions, like dropdown menu chips.

PiperOrigin-RevId: 566352830
2023-09-18 10:57:56 -07:00
Elliott Marquez
1f31df818b refactor(list,menu,select)!: remove data-variant slotted variant selectors
BREAKING CHANGE: the data-variant=".." selectors in list-item and all variants have been removed in favor of their respective slots. e.g. a slotted icon of the form `md-icon[slot=end][data-variant=icon]` should now be `md-icon[slot=end-icon]`.

PiperOrigin-RevId: 566258893
2023-09-18 04:11:38 -07:00
Elizabeth Mitchell
94b5c8125e feat(menu): update tokens to v0.192
- Adds `--md-menu-item-selected-label-text-color` token

BREAKING CHANGE: menu selected container color changed to secondary-container

PiperOrigin-RevId: 565807703
2023-09-15 16:35:25 -07:00
Elizabeth Mitchell
58539b1569 fix(list): update tokens to 0.192
BREAKING CHANGE:
- Leading icon size increased from 18px to 24px
- Trailing space decreased from 24px to 16px

PiperOrigin-RevId: 565769173
2023-09-15 13:50:51 -07:00
Elliott Marquez
9447ec7d72 refactor(list)!: move list aria to host
BREAKING CHANGE: Aria and roles on List have been moved to the host element. list-tabindex attribute should be migrated to tabindex attribute. type attribute should be migrated to role attribute.

PiperOrigin-RevId: 565767899
2023-09-15 13:45:32 -07:00
Luke Vo
2a6b689a0d
Corrected button trailing-icon 2023-09-15 14:44:03 -05:00
Elizabeth Mitchell
cfd053c397 fix(tokens): update components to v0.192
PiperOrigin-RevId: 565714251
2023-09-15 10:27:07 -07:00
Elliott Marquez
8aa4faf14a fix: aria polyfill overrides user values and user values override internals values
PiperOrigin-RevId: 565570035
2023-09-14 22:11:40 -07:00
Elliott Marquez
af171df086 fix(list,menu): clicking items in a list followed by keyboard nav functions as expected
PiperOrigin-RevId: 565539367
2023-09-14 18:59:35 -07:00
Elliott Marquez
ed689952dd feat(list,menu,select): add slots for specific slotted variants
PiperOrigin-RevId: 565536994
2023-09-14 18:42:43 -07:00
Elliott Marquez
d4463154cc refactor(list,menu,select)!: remove active concept and now parent controls tabIndex and focus
Note: tests have changed significantly because there is no longer a concept of "nothing activated" in the list.

BREAKING CHANGE: removed `active` from list-item, menu-item, and select-option. Instead, List uses tabindex to track whether something is focusable.

PiperOrigin-RevId: 565531998
2023-09-14 18:14:59 -07:00
Elliott Marquez
fad6104391 fix(list,menu): list items left right keyboard navigation
PiperOrigin-RevId: 565526741
2023-09-14 17:47:55 -07:00
Elizabeth Mitchell
e444de3c02 fix(radio): dispatches input event on select
PiperOrigin-RevId: 565522665
2023-09-14 17:25:54 -07:00
Elizabeth Mitchell
116b448639 fix(tokens): generate tokens v0.192
PiperOrigin-RevId: 565500229
2023-09-14 15:53:34 -07:00
Andrew Jakubowicz
af27ff8374 fix(catalog): remove TODO from home page
PiperOrigin-RevId: 565459571
2023-09-14 13:25:04 -07:00
Elizabeth Mitchell
4ad2336b87 feat(select): add required and form association
Fixes #4903

PiperOrigin-RevId: 565260839
2023-09-13 22:45:10 -07:00
Elliott Marquez
df52d92724 fix(menu): apply padding to dividers per spec
PiperOrigin-RevId: 565245411
2023-09-13 21:09:00 -07:00
Elliott Marquez
2927245114 fix(menu): menu's default focus behavior follows google accessibility practices
default focus is now FIRST_ITEM and instead of LIST_ROOT and the menu / list itself has tabindex -1 by default as our a11y model recommends

PiperOrigin-RevId: 565244488
2023-09-13 21:02:33 -07:00
Elizabeth Mitchell
573caaee1b fix(select)!: don't reflect selected attribute
Why? This is needed for selects in forms, which uses the `selected` attribute to indicate default selected values when resetting.

BREAKING CHANGE: `option.selected` no longer reflects. Set the attribute instead if relying on the attribute for styles/queries.

PiperOrigin-RevId: 565212026
2023-09-13 17:51:17 -07:00