Adds `@material/web/tokens/internal/shape` to take a shape token and create 4 logical tokens from its value.
All components' logical shape tokens are now generated by the token files themselves, rather than added in each component's styles.
PiperOrigin-RevId: 601783846
These are excluded by default, but will be enabled by default in 2.0.
Example: `tokens.md-comp-checkbox-values($exclude-custom-properties: false)`
PiperOrigin-RevId: 601596085
This change removes the leftover md-comp-menu-list-item token set, which doesn't have a corresponding component. If you're using it, the correct token set to use is md-comp-menu-item.
As a side effect of the merge, it also added the missing menu item container-color token.
PiperOrigin-RevId: 601168134
Elevation doesn't have variant styles, but it still uses shorter private custom properties to reduce its CSS size. I added a comment explaining why and moved the custom properties into the inner shadow dom so they can't be set on the host.
No size changes.
PiperOrigin-RevId: 601128500
Reduces the size by removing private (`--_*`) custom properties. These are not needed since the component does not share styles across variants.
Size before: 4568b / 1034b gzip
Size after: 3245b (-29%) / 907b gzip (-12%)
PiperOrigin-RevId: 600928780
Reduces the size by removing private (`--_*`) custom properties. These are not needed since the component does not share styles across variants.
Size before: 14,615b / 2,327b gzip
Size after: 10,802 (-26%) / 1,865b gzip (-20%)
PiperOrigin-RevId: 600918909
Reduces the size by removing private (`--_*`) custom properties. These are not needed since the component does not share styles across variants.
Size before: 1293b / 532b gzip
Size after: 1171b (-9%) / 502b gzip (-0.2%)
PiperOrigin-RevId: 600917333
Reduces the size by removing private (`--_*`) custom properties. These are not needed since the component does not share styles across variants.
Size before: 4597b / 1322b gzip
Size after: 4092b (-13%) / 1194b gzip (-10%)
PiperOrigin-RevId: 600905310
Reduces the size by removing private (`--_*`) custom properties. These are not needed since the component does not share styles across variants.
Size before: 523b / 308b gzip
Size after: 469b (-10%) / 292b gzip (-5%)
PiperOrigin-RevId: 600904594
The naming is a bit backwards. The file is about validation and the function is for the token values, not a file just for token values.
PiperOrigin-RevId: 599207580
Why? To help clarify that this isn't intended to be a public API, and to better organize future internal-only token files.
PiperOrigin-RevId: 599203361
Previously all text fields would focus themselves when the form reports validity, meaning the last one got focus. In reality, reportValidity is supposed to focus the first invalid control.
I added a "call" method wrapper around the `onReportValidity` callback that handles focusing logic.
PiperOrigin-RevId: 597904790
The bug: given a form with two required text fields,
1. Try to submit the form, both fields show error.
2. Add a value to the first field.
3. Try to submit the form, the first field does not remove its error.
This is fixed by listening to form submits and clearing the error state if the control is valid.
I refactored `injectFormReportValidityHooks()` into `addFormReportValidListener()` to keep the `OnReportValidity` class cleaner and better identify the problem we're trying to solve.
PiperOrigin-RevId: 597664564
Fix is pretty simple, we weren't clearing out the first pointerdown event, and subsequent ones were ignored since the `pointerId` changes with each touch.
Fixes#5349
PiperOrigin-RevId: 596668539
Previously selectItem would work with cached references to select-option elements which could become stale causing the deactivation logic to fail. This cl just ensures that selectItem always re-fetches the nodes to avoid the issue.
PiperOrigin-RevId: 595524158
Fixes#5199
This bug appeared when calling prevent default as well as changing the state of the chip in the same listener. Now calling preventDefault will always revert to the previous value.
PiperOrigin-RevId: 595199149