import { CortexFormControl, default as CortexElement } from '../../../../base/src/cortex-element.ts';
import { CxCheckboxLabelPlacement, CxCheckboxSize } from '../../../../types/src/checkbox';
import { CSSResultGroup } from 'lit';
import { default as CxIcon } from '../icon/icon';

/**
 * @summary Checkboxes allow the user to toggle an option on or off.
 *
 * @slot (default) - The checkbox's label.
 * @slot checked-icon - The icon to display when the checkbox is checked.
 * @slot indeterminate-icon - The icon to display when the checkbox is indeterminate.
 * @slot help-text - Text that describes how to use the checkbox. Alternatively, you can use the `help-text` attribute.
 *
 * @event cx-blur - Emitted when the checkbox loses focus.
 * @event cx-change - Emitted when the checked state changes.
 * @event cx-focus - Emitted when the checkbox gains focus.
 * @event cx-input - Emitted when the checkbox receives input.
 * @event cx-invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied.
 *
 * @csspart base - The component's base wrapper.
 * @csspart control - The square container that wraps the checkbox's checked state.
 * @csspart control--checked - Matches the control part when the checkbox is checked.
 * @csspart control--indeterminate - Matches the control part when the checkbox is indeterminate.
 * @csspart checked-icon - The checked icon, an `<cx-icon>` element.
 * @csspart indeterminate-icon - The indeterminate icon, an `<cx-icon>` element.
 * @csspart label - The container that wraps the checkbox's label.
 * @csspart form-control-help-text - The help text's wrapper.
 */
export default class CxCheckbox extends CortexElement implements CortexFormControl {
    static readonly styles: CSSResultGroup;
    static readonly dependencies: {
        'cx-icon': typeof CxIcon;
    };
    private readonly formControlController;
    private readonly hasSlotController;
    input: HTMLInputElement;
    private hasFocus;
    title: string;
    /** The name of the checkbox, submitted as a name/value pair with form data. */
    name: string;
    /** The current value of the checkbox, submitted as a name/value pair with form data. */
    value: string;
    /** The checkbox's size. */
    size: CxCheckboxSize;
    /** Disables the checkbox. */
    disabled: boolean;
    /** Draws the checkbox in a checked state. */
    checked: boolean;
    /**
     * Draws the checkbox in an indeterminate state. This is usually applied to checkboxes that represents a "select
     * all/none" behavior when associated checkboxes have a mix of checked and unchecked states.
     */
    indeterminate: boolean;
    /** The default value of the form control. Primarily used for resetting the form control. */
    defaultChecked: boolean;
    /**
     * By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you
     * to place the form control outside of a form and associate it with the form that has this `id`. The form must be in
     * the same document or shadow root for this to work.
     */
    form: string | HTMLElement | undefined;
    /** Makes the checkbox a required field. */
    required: boolean;
    /** The checkbox's help text. If you need to display HTML, use the `help-text` slot instead. */
    helpText: string;
    /** Position of the label relative to the checkbox control. Use `--checkbox-label-gap` to control the distance. */
    labelPlacement: CxCheckboxLabelPlacement;
    /** The checkbox's aria-label text. */
    ariaLabel: string | null;
    /** Gets the validity state object */
    get validity(): ValidityState;
    /** Gets the validation message */
    get validationMessage(): string;
    runFirstUpdated(): void;
    connectedCallback(): void;
    private handleHostKeydown;
    private handleHostClick;
    private handleChange;
    private handleBlur;
    private handleInvalid;
    private handleFocus;
    handleDisabledChange(): void;
    handleStateChange(): void;
    /** Sets focus on the checkbox. */
    focus(options?: FocusOptions): void;
    /** Removes focus from the checkbox. */
    blur(): void;
    /** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */
    checkValidity(): boolean;
    /** Gets the associated form, if one exists. */
    getForm(): HTMLFormElement | null;
    /** Checks for validity and shows the browser's validation message if the control is invalid. */
    reportValidity(): boolean;
    /**
     * Sets a custom validation message. The value provided will be shown to the user when the form is submitted. To clear
     * the custom validation message, call this method with an empty string.
     */
    setCustomValidity(message: string): void;
    disconnectedCallback(): void;
    render(): import('lit').TemplateResult<1>;
}
declare global {
    interface HTMLElementTagNameMap {
        'cx-checkbox': CxCheckbox;
    }
}
