import { type EventEmitter } from '../../stencil-public-runtime'; import type { CheckboxState } from './types'; import type { Theme } from '../../utils/styles'; /** * @component diwa-checkbox * * A fully accessible checkbox control with label, validation state, * and indeterminate support. Mirrors the PDS p-checkbox API. * * Semi-controlled: the `checked` prop is mutable — the component * updates it internally AND emits an `update` event. The consumer can * either listen to `update` to manage state externally, or use it * standalone without any event wiring. * * Accessibility: * - Native `` inside Shadow DOM with delegatesFocus * - `aria-checked="mixed"` set automatically when `indeterminate` is true * - `aria-describedby` wires the message element when state is error/success * - `role` is implicit from native input — no extra ARIA needed * * Usage: * setAccepted(e.detail.checked)} /> * * Note (V1): The inner is inside Shadow DOM and is therefore * not visible to ancestor
elements for native form submission. * Use ElementInternals (V2) or submit via JavaScript instead. */ export declare class DiwaCheckbox { host: HTMLDiwaCheckboxElement; /** Per-component theme override (`light` / `dark`). */ theme: Theme; /** Visible label text rendered next to the checkbox. */ label: string; /** Native name attribute (identifies the field in JS / form data). */ name: string; /** Value submitted/emitted when the checkbox is checked. */ value: string; /** * Whether the checkbox is checked. * * Semi-controlled: mutates internally on user interaction and * also emits an `update` event so the consumer can sync their state. */ checked: boolean; /** * Indeterminate state — renders a dash icon and sets `aria-checked="mixed"`. * Setting this to `true` takes visual precedence over `checked`. * The consumer is responsible for clearing it once the user toggles. */ indeterminate: boolean; /** Puts the checkbox in a disabled state. Blocks interaction. */ disabled: boolean; /** Marks the field as required. Shows a visual asterisk in the label. */ required: boolean; /** Validation state: `'none'` (default), `'error'`, or `'success'`. */ state: CheckboxState; /** Helper / validation message shown below the checkbox. Only shown when state ≠ 'none'. */ message: string; /** Reduces the checkbox size from 20 px to 14 px for denser layouts. */ compact: boolean; /** Hides the label visually while keeping it accessible to screen readers. */ hideLabel: boolean; /** * Emitted when the user toggles the checkbox. * `event.detail.checked` is the new checked state. * * React consumers: use the lowercase `onupdate` prop: * ```jsx * setChecked(e.detail.checked)} /> * ``` */ update: EventEmitter<{ checked: boolean; name: string; value: string; }>; private checkboxEl?; /** Keep the native input's non-reflected .indeterminate property in sync. */ watchIndeterminate(value: boolean): void; private handleChange; private setCheckboxRef; render(): any; } //# sourceMappingURL=diwa-checkbox.d.ts.map