This makes it easier to add classes in a render method. Also updates the TemplateBuilder type to not require a Harness (ex: card does not need one)
PiperOrigin-RevId: 588110635
Cards often have content that extends to the bounds of the card. Instead of adding default padding that must be removed, cards' content should add their own padding as needed.
This makes adding full-width media and dividers easier.
Also moved background z-indices to -1 since the slot doesn't have a display and the z-index wasn't doing anything.
PiperOrigin-RevId: 587883362
Ensure pressing escape while on a closed submenu anchor, closes the parent menu
Previously we were not letting a user close a menu when they were focused on any item with keepOpen = true. This included submenu anchors.
This change adds an escape (hehe) hatch to ensure that even on items with keepOpen = true, escape closes the menu. This is what most users expect and is what is the standard on menus around the web.
PiperOrigin-RevId: 587874713
fixes#5112fixes#5133
upon opening the select, the menu with calculate the width of the select and set the min-width of the corresponding menu to match. If the user has an item with a really long headline, then clap-menu-width will clamp the max-width of the menu to that of the select.
PiperOrigin-RevId: 587862332
On construction, setting `tabIndex = 0` should hydrate a tabindex attribute. This behavior was lost since we overrode `Element.prototype.tabIndex`. This change keeps the platform getter/setter behavior and calls requestUpdate another way.
PiperOrigin-RevId: 586738747
This is needed specifically for text fields. There appears to be an odd Chrome/Safari issue where an element that `delegatesFocus: true` to an inner `<input>` MUST provide that input as the validity anchor. Otherwise, when a form submits or calls `form.reportValidity()`, an error will be thrown.
See https://lit.dev/playground/#gist=6c26e418e0010f7a5aac15005cde8bde for a reproduction.
Unfortunately I couldn't programmatically trigger this behavior in a jasmine test.
PiperOrigin-RevId: 586723140
This reduces the copy/paste of validation code. Constraint validation must be synchronous, so a `Validator` helps compute the validity and cache it since the validity must be checked when properties change.
Implemented in checkbox-like controls.
PiperOrigin-RevId: 584380464
Part of adding constraint validation mixins. Each component that participates in constraint validation has different rules and error messages for validating. The `Validator` gives `mixinConstraintValidation()` a way to compute and cache validation.
Other validators will be added later, such as `SelectValidator` and `RadioValidator`
PiperOrigin-RevId: 583508468