import { FormControlBase, FormState } from "../helper/internals/form-control-base"; export interface CheckboxProperties { label: string; checked: boolean; disabled: boolean; indeterminate: boolean; id: string; value: string; color: string; required: boolean; validationErrors: string[]; validationActive: boolean; defaultChecked: boolean; requiredMessage: string; showErrors: boolean; prefix: string; suffix: string; prefixColor: string; suffixColor: string; } /** `checked` is always the boolean model; `value` keeps form/legacy semantics (see `handleChange`). */ export type SkyCheckboxValueChangedDetail = { checked: boolean; value: string | boolean | undefined; }; export type SkyCheckboxValidationErrorDetail = { errors: string[]; }; export type SkyCheckboxValueClearedDetail = { value: string; checked: boolean; }; /** * @element sky-checkbox * * @summary Form-associated checkbox with validation, indeterminate state, and customizable label/prefix/suffix rendering. * * @status stable * @since 1.0.0 * * @documentation https://sky-ui.com/components/checkbox * * @uiVModel checked value-changed detail=checked * * @slot - Default slot for the checkbox label or other content. * @slot prefix - Optional prefix content that can be placed before the label. * @slot suffix - Optional suffix content that can be placed after the label. * * @csspart wrapper - The wrapper element for the checkbox. * @csspart input - The native input element used for the checkbox. * @csspart label - The label element for the checkbox, used for styling. * @csspart box - The visual box for the checkbox, which includes the checkmark and indeterminate state. * @csspart checkmark - The checkmark icon that appears when the checkbox is checked. * @csspart indeterminate-line - The line representing the indeterminate state of the checkbox. * @csspart error-message - The error message displayed if the checkbox is invalid. * * @property {string} label - The label for the checkbox. Default: `""`. * @property {boolean} checked - Whether the checkbox is checked. Default: `false`. * @property {boolean} indeterminate - Whether the checkbox is in the indeterminate state. Default: `false`. * @property {string} color - The color used for the checkbox and its checkmark. Default: `"primary"`. * @property {string} value - The value of the checkbox, which gets submitted with the form. Default: `""`. * @property {boolean} showErrors - Whether to display validation error messages. Default: `false`. * @property {string} prefix - Optional prefix text or content before the label. Default: `""`. * @property {string} suffix - Optional suffix text or content after the label. Default: `""`. * @property {string} prefixColor - The color for the prefix text. Default: `""`. * @property {string} suffixColor - The color for the suffix text. Default: `""`. * @property {boolean} defaultChecked - Default checked state for reset operations. Default: `false`. * @property {string} preset - Named prop preset from nearest `sky-config-provider`. Default: `""`. * @method check Sets checked state to `true`. * @method uncheck Sets checked state to `false`. * @method toggle Toggles checked state. * @method reset Resets checkbox state to defaults and clears UI validation state. * * @fires {CustomEvent} value-changed - Fired when checked state changes; `detail.checked` is always boolean (use for v-model). `detail.value` is the form token when the `value` prop is set, else mirrors `checked`. * @fires {CustomEvent} validation-error - Fired when validation errors are updated. * @fires {CustomEvent} value-cleared - Fired when checkbox is reset programmatically. * * @example * ```html * * ``` * ```vue * * ``` * ```jsx * export default function Demo() { * return ; * } * ``` */ export declare class SkyCheckbox extends FormControlBase { static shadowRootOptions: { clonable?: boolean; customElementRegistry?: CustomElementRegistry | null; mode: ShadowRootMode; serializable?: boolean; slotAssignment?: SlotAssignmentMode; delegatesFocus: boolean; }; label: string; id: string; value: string; color: string; defaultChecked: boolean; showErrors: boolean; prefix: string; suffix: string; prefixColor: string; suffixColor: string; validationActive: boolean; invalid: boolean; private _checked; private _indeterminate; private validationErrors; private _hasMeaningfulSlot; private _inputElement?; private _inputId; get checked(): boolean; set checked(v: boolean); get indeterminate(): boolean; set indeterminate(v: boolean); /** Named prop preset from nearest `sky-config-provider`. */ preset: string; private _presets; static styles: import("lit").CSSResult[]; protected getFormValue(): FormState; protected setValueFromFormState(state: FormState): void; protected getValidityAnchor(): HTMLElement | undefined; protected isEmpty(): boolean; protected getNativeControl(): HTMLElement | null; protected onFormReset(): void; updated(changed: Map): void; private handleChange; private validateInput; /** * Sets checked state to `true`. * * @returns {void} */ check(): void; /** * Sets checked state to `false`. * * @returns {void} */ uncheck(): void; /** * Toggles checked state. * * @returns {void} */ toggle(): void; /** * Resets checkbox state to defaults and clears UI validation state. * * @returns {void} */ reset(): void; private _updateVisualState; private _slotHasMeaningfulContent; private _onSlotChange; private get _hasTextContent(); private handleBlur; private _onKeyDown; render(): import("lit-html").TemplateResult<1>; }