import { type ComponentType, type ReactNode, type RefAttributes } from "react"; import { View, type ColorTokens, type ViewStyle, type TextStyle, type LayoutStyle } from "../../style/index.js"; export interface CheckboxProps { /** Label text (the option's title) shown beside the box. */ children?: ReactNode; /** * Optional muted secondary line rendered under the label, for the common * title-plus-description option (a notification setting, a consent row). * Supplying it builds the stacked title/description layout inside the control, * so the caller never hand-composes a Row + Column + two Typography nodes and * the whole row stays tappable. */ description?: ReactNode; /** Controlled checked state; omit for uncontrolled use. */ checked?: boolean; /** Initial state for uncontrolled use (a bare is interactive). */ defaultChecked?: boolean; /** * Mixed state: some-but-not-all selected. Shown as a dash, not a tick. * Takes visual precedence over `checked`. Implies `selection`: a mixed state * belongs to a list's select-all, and a switch has none. */ indeterminate?: boolean; /** * A checkbox that selects an item in a list or a bulk selection (a table's rows, a * list in edit mode, a select-all), rather than one on/off setting. * * The web draws * the checkbox, iOS the edit-mode selection circle, Android the Material 3 checkbox. * Without it a Checkbox is one setting, which iOS and Android render as their * switch (role `switch`), so a settings row reads the way each platform writes it. * * * iOS draws the edit-mode selection circle. Without it a Checkbox is one setting, * which iOS renders as its switch (role `switch`), so a settings row reads the way the platform writes it. * * * Android draws the Material 3 checkbox. Without it a Checkbox is one setting, * which Android renders as its switch (role `switch`), so a settings row reads the way the platform writes it. * */ selection?: boolean; /** Fired with the next checked value when the row is pressed (both modes). Web keyboard activation supports Space on release and Enter. */ onChange?: (next: boolean) => void; /** Alias of onChange, for parity with RN's value-style callbacks. */ onValueChange?: (next: boolean) => void; /** * Accessible name for a LABEL-LESS checkbox (one with no `children`, e.g. a * row selector in a table). With a visible label the label itself is the name; * without one this is what a screen reader announces. */ accessibilityLabel?: string; /** E2E hook forwarded to the pressable row. */ testID?: string; small?: boolean; large?: boolean; disabled?: boolean; /** Composition within a parent only, never a restyle hook and never a width: the parent layout container provides the bounds. */ style?: LayoutStyle; } export type Size = "small" | "base" | "large"; export declare function sizeOf(p: CheckboxProps): Size; export interface CheckboxSkin { /** The square box. `filled` = checked or indeterminate. */ box: (tokens: ColorTokens, filled: boolean, size: Size) => ViewStyle; /** The box's look under a hovering pointer (the web's soft accent ring); omit for none. */ hover?: (tokens: ColorTokens) => ViewStyle; /** The check / minus glyph inside a filled box: its colour and its size in px. */ glyph: (tokens: ColorTokens, size: Size) => { color: string; size: number; }; /** The label text to the right of the box. */ label: (tokens: ColorTokens, size: Size) => TextStyle; /** The muted secondary description line, rendered under the label when present. */ description: (tokens: ColorTokens, size: Size) => TextStyle; /** Opacity applied to the row when disabled. */ disabledOpacity: number; /** iOS/web dim the row on press; Android uses a ripple instead (null). */ pressedOpacity: number | null; /** Android ripple over the box; null on iOS/web. */ ripple: ((tokens: ColorTokens) => { color: string; borderless: boolean; radius?: number; }) | null; } /** * The components a Checkbox draws with that differ per platform. `Standalone` is the * control a one-setting Checkbox renders instead of a checkbox (the iOS and Android * switch), taking the Checkbox's props less the list-selection ones; the web passes * none and keeps the checkbox. */ export interface CheckboxParts { Standalone?: ComponentType & RefAttributes>; } /** Build a Checkbox component from a platform skin and its platform parts. * @ref Ref to the interactive checkbox row, including its label. Typed as a React Native View. On web, React Native Web exposes its DOM host; focus() and blur() move browser focus. Native host behavior depends on the platform and React Native version. Calling focus() does not activate the control or call accessibility focus APIs. */ export declare function createCheckbox(skin: CheckboxSkin, parts?: CheckboxParts): import("react").ForwardRefExoticComponent>; //# sourceMappingURL=checkbox.shared.d.ts.map