import{type TemplateResult,type PropertyValues}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import type{LyraSize}from'../../../internal/variants.js';import{type FormOwnerValue}from'../../../internal/form-associated.js';import{type LyraFormValidator}from'../form-validator.js';export interface LyraCheckboxEventMap{input:Event;change:Event;'lr-input':CustomEvent<{checked:boolean;}>;'lr-change':CustomEvent<{checked:boolean;}>;focus:FocusEvent;blur:FocusEvent;'lr-invalid':CustomEvent;'lr-checkbox-toggle-request':CustomEvent<{checked:boolean;}>;} /** * `` — a boolean form control. Structurally the same idea as * `` (form-associated via `ElementInternals`, click and * Space both toggle) but with checkbox semantics: `role="checkbox"` + * an `aria-checked` that can also be `"mixed"`, and a visual box/checkmark * instead of a track/thumb. * * `checked` is not a plain string, so this attaches `ElementInternals` * directly and implements its own `updateValidity()` rather than using the * `FormAssociated` mixin — see `` for the same * direct-`ElementInternals` shape with a non-string value. * * Supporting text is optional through either Web Awesome's `hint` spelling or Shoelace's * `help-text` spelling. `errorText` and the `error` slot provide the matching owned error surface; * all rendered messages share an additive described-by relationship with external host ids. * Deliberately no separate top-of-field label property/slot/part: the default slot already is the * visible, clickable checkbox label, matching `lr-switch`'s form-control shape. * Default-slot presence follows flattened rendered assignment and updates when forwarded content * changes. Visual elements, including decorative `aria-hidden` icons, keep the label wrapper; * accessible naming remains the browser's slot semantics unless a host `aria-label` is present. * The public label and supporting/error text wrap at arbitrary boundaries in constrained rows; * the fixed checkbox square and shared interactive target never shrink to make that fit. * The internal checkbox role exposes explicit stateful `aria-invalid`: visible error chrome wins * immediately, while intrinsic/custom invalidity is exposed only after user interaction. * * Removing `error-text` safely omits the message while preserving native null property readback. * Explicit empty text stays empty; later supplied text renders normally. * * @customElement lr-checkbox * @slot - Label text, rendered next to the box. Clicking it toggles the * checkbox, the same as clicking a native checkbox's associated `