Commit Graph

29 Commits

Author SHA1 Message Date
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
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
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
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
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
Material Web Team
556e6f95e4 chore: fix closure compiler issues
PiperOrigin-RevId: 564867173
2023-09-12 16:30:19 -07:00
Elliott Marquez
368991ce30 fix(menu): fix submenus on mobile
PiperOrigin-RevId: 563531654
2023-09-07 13:39:19 -07:00
Elizabeth Mitchell
ca2cd56bd1 fix(list): remove font shorthand tokens
BREAKING CHANGE: replace `*-type` font tokens with `-font`, `-size`, `-line-height`, and `-weight`

PiperOrigin-RevId: 563162539
2023-09-06 11:22:42 -07:00
Elliott Marquez
b85b57fa79 fix(menu,list,select): do not stopPropagation on native events when handled only prevent default
Fixes #4817

We need to communicate between components when an event has been handled (e.g. keyboard navigation or clicking). This CL focuses on listening to `defaultPrevented` in order to communicate that something was handled. We also have to patch ripple on submenu to make sure that the ripple isn't triggered.

PiperOrigin-RevId: 561748634
2023-08-31 13:48:20 -07:00
Andrew Jakubowicz
32a8c4410e fix(list,menu): restrict type to only supported aria roles
## Why?

Because currently `md-list` and `md-menu` can accept any aria role as a `type` property. However this can result in invalid roles being added, e.g. `progressbar` is allowed as a valid `type`.

Instead this change scopes the `type` to the following:
 - `<md-list>` `type` can be any of: `'menu'|'menubar'|'listbox'|'list'|''`.
 - `<md-menu>` `type` can be any of: `'menu'|'menubar'|'listbox'|'list'`.

PiperOrigin-RevId: 560180446
2023-08-25 13:27:21 -07:00
Andrew Jakubowicz
641142dff0 fix(list): remove internal md3-* class prefix
PiperOrigin-RevId: 559909180
2023-08-24 16:47:21 -07:00
Copybara-Service
449a11b3b7 Merge pull request #4671 from davidurco:main
PiperOrigin-RevId: 559592182
2023-08-23 17:33:18 -07:00
Dávid Ďurčo
1169347c9c fix(list): list item body min-width: 0 instead of max-width: 100% 2023-08-21 21:15:31 +02:00
Elliott Marquez
aa3fe3d1ec feat(list): change default host display to flex so max-width can be set without user setting display
PiperOrigin-RevId: 558234104
2023-08-18 13:36:33 -07:00
Elliott Marquez
1530aca17d fix(list): use margin over padding on slotted content and fix extraneous spacing
trailing text had an extra 16px added to its inline margin. Also use margin over padding because padding was messing with shape tokens applying to the padding whitespace.

PiperOrigin-RevId: 557581151
2023-08-16 13:16:04 -07:00
Elliott Marquez
2d9352e3f4 refactor(list-item)!: remove duplicate list-item menu-item from custom prop names
BREAKING: renames custom props from this:

`--md-list-item-list-item-...`
`--md-menu-item-list-item-...`

to:
`--md-list-item-...`
`--md-menu-item-...`
PiperOrigin-RevId: 557337871
2023-08-15 20:48:25 -07:00
Elizabeth Mitchell
0e492ade43 chore: remove sass theme utilities
PiperOrigin-RevId: 556915539
2023-08-14 14:39:19 -07:00
Elizabeth Mitchell
0510496e60 chore: avoid this in static context
PiperOrigin-RevId: 554933524
2023-08-08 14:00:25 -07:00
Dávid Ďurčo
327737d345 fix(list): list item body overflow issue 2023-08-07 22:45:50 +02:00
Elliott Marquez
65d04a3cf3 feat(list,menu): add css shadow parts to sub components
PiperOrigin-RevId: 553896396
2023-08-04 13:25:32 -07:00
Elliott Marquez
09cb6da8fb refactor(list,menu)!: add href to (list|menu)-item and remove (menu|list)-item-link
BREAKING CHANGE: list-item-link and menu-item-link have been removed and their functionality has been added to menu-item and list-item respectively.

PiperOrigin-RevId: 553894393
2023-08-04 13:18:38 -07:00
Elliott Marquez
ff60a88843 refactor(icon)!: remove css custom props from icon and apply values directly on host
BREAKING CHANGE: Remove css custom properties from icon and prefer applying normal css properties on host except for font-family.

PiperOrigin-RevId: 553577562
2023-08-03 13:43:59 -07:00
Elliott Marquez
fa63178238 refactor(menu): remove :has selectors
PiperOrigin-RevId: 552615347
2023-07-31 15:54:20 -07:00
Elizabeth Mitchell
b1259ae1ae chore(list): make listRoot and handleKeydown private
PiperOrigin-RevId: 551700277
2023-07-27 18:36:44 -07:00
Elizabeth Mitchell
d49f9b89e4 fix(focus)!: rename import to md-focus-ring.ts
BREAKING CHANGE: Change `@material/web/focus/focus-ring.js` to `@material/web/focus/md-focus-ring.js`.

PiperOrigin-RevId: 550608428
2023-07-24 10:43:31 -07:00
Andrew Jakubowicz
c6e6f65445 fix(list)!: rename "lib" directory to "internal"
BREAKING CHANGE: Rename `@material/web/list/lib` to `@material/web/list/internal`. Prefer not using internal files.

PiperOrigin-RevId: 550585246
2023-07-24 09:29:15 -07:00