import type { ReactElement, HTMLAttributes, Ref } from "react"; import type SlCheckboxElement from "@shoelace-style/shoelace/dist/components/checkbox/checkbox.js"; import { SlBlurEvent, SlChangeEvent, SlFocusEvent, SlInputEvent, SlInvalidEvent, } from "../events"; export type { SlCheckboxElement }; export type SlCheckboxBlurEvent = SlBlurEvent; export type SlCheckboxChangeEvent = SlChangeEvent; export type SlCheckboxFocusEvent = SlFocusEvent; export type SlCheckboxInputEvent = SlInputEvent; export type SlCheckboxInvalidEvent = SlInvalidEvent; export interface SlCheckboxProps extends HTMLAttributes { ref?: Ref; /** * */ 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?: "small" | "medium" | "large"; /** * 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; /** * By default, form controls are associated with the nearest containing `
` 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; /** * 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; /** * Emitted when the checkbox loses focus. */ onSlBlur?: (event: SlCheckboxBlurEvent) => void; /** * Emitted when the checkbox loses focus. */ onSlBlurCapture?: (event: SlCheckboxBlurEvent) => void; /** * Emitted when the checked state changes. */ onSlChange?: (event: SlCheckboxChangeEvent) => void; /** * Emitted when the checked state changes. */ onSlChangeCapture?: (event: SlCheckboxChangeEvent) => void; /** * Emitted when the checkbox gains focus. */ onSlFocus?: (event: SlCheckboxFocusEvent) => void; /** * Emitted when the checkbox gains focus. */ onSlFocusCapture?: (event: SlCheckboxFocusEvent) => void; /** * Emitted when the checkbox receives input. */ onSlInput?: (event: SlCheckboxInputEvent) => void; /** * Emitted when the checkbox receives input. */ onSlInputCapture?: (event: SlCheckboxInputEvent) => void; /** * Emitted when the form control has been checked for validity and its constraints aren't satisfied. */ onSlInvalid?: (event: SlCheckboxInvalidEvent) => void; /** * Emitted when the form control has been checked for validity and its constraints aren't satisfied. */ onSlInvalidCapture?: (event: SlCheckboxInvalidEvent) => void; } /** * Checkboxes allow the user to toggle an option on or off. */ export default function SlCheckbox( props: SlCheckboxProps, ): ReactElement;