import * as React from 'react'; import { Pressable } from 'react-native'; import type { ZestUIComponentProps } from '../../types'; import { type ZestChangeEventDetails } from '../../utils/createChangeEventDetails'; import { REASONS } from '../../utils/reasons'; /** * Represents the checkbox itself. * Renders a ``. * * Placed inside a `Field.Root`, it is labelled by `Field.Label`, described by * `Field.Description`/`Error`, inherits the field's `disabled`, and runs the * field's `validate` on change. */ export declare function CheckboxRoot(componentProps: CheckboxRoot.Props): React.JSX.Element; export interface CheckboxRootState { /** * Whether the checkbox is currently ticked. */ checked: boolean; /** * Whether the component should ignore user interaction. */ disabled: boolean; /** * Whether the user should be unable to tick or untick the checkbox. */ readOnly: boolean; /** * Whether the user must tick the checkbox before submitting a form. */ required: boolean; /** * Whether the checkbox is in a mixed state: neither ticked, nor unticked. */ indeterminate: boolean; } export interface CheckboxRootProps extends Omit, 'onPress' | 'value'> { /** * Whether the checkbox is currently ticked. * * To render an uncontrolled checkbox, use the `defaultChecked` prop instead. */ checked?: boolean | undefined; /** * The value identifying the checkbox within a ``. */ value?: string | undefined; /** * Whether the checkbox controls a parent checkbox in a ``. * A parent checkbox ticks or unticks all of the group's checkboxes at once, * and reports a mixed state while only some of them are ticked. * @default false */ parent?: boolean | undefined; /** * Whether the checkbox is initially ticked. * * To render a controlled checkbox, use the `checked` prop instead. * @default false */ defaultChecked?: boolean | undefined; /** * Whether the component should ignore user interaction. * @default false */ disabled?: boolean | undefined; /** * Whether the checkbox is in a mixed state: neither ticked, nor unticked. * @default false */ indeterminate?: boolean | undefined; /** * Event handler called when the checkbox is ticked or unticked. */ onCheckedChange?: ((checked: boolean, eventDetails: CheckboxRoot.ChangeEventDetails) => void) | undefined; /** * Whether the user should be unable to tick or untick the checkbox. * @default false */ readOnly?: boolean | undefined; /** * Whether the user must tick the checkbox before submitting a form. * @default false */ required?: boolean | undefined; } export type CheckboxRootChangeEventReason = typeof REASONS.none; export declare namespace CheckboxRoot { type State = CheckboxRootState; type Props = CheckboxRootProps; type ChangeEventReason = CheckboxRootChangeEventReason; type ChangeEventDetails = ZestChangeEventDetails; } //# sourceMappingURL=CheckboxRoot.d.ts.map