/** * Conditional validation message custom element (``). * * Slotted as `slot="validity"` inside a form-associated element such as * ``, ``, or ``, it becomes visible * only when the specific `ValidityState` flag named by `state` is `true` on * its parent (e.g. shows only for a `valueMissing` error, not for any other * validity failure). * * @example * ```html * * * This field is required. * * * Enter a valid email address. * * * ``` */ export default class KUBAValidityElement extends HTMLElement { /** Aborted when the element is disconnected; used to unregister listeners registered on the parent element. */ readonly controller: AbortController /** The `ElementInternals` instance backing this element's `:state(invalid)` reflection. */ readonly internals: ElementInternals /** * The name of the `ValidityState` key to watch on the parent element * (e.g. `'valueMissing'`, `'patternMismatch'`, `'tooShort'`). * Reflects the `state` attribute. */ state: string } declare global { interface HTMLElementTagNameMap { 'kb-validity': KUBAValidityElement } }