import "./checkbox.css"; import type * as React from "react"; import { useRender } from "@base-ui/react/use-render"; import { type StyleProps } from "./style_props"; import { type InkColor } from "./text_ink"; /** The kit's own, in both modes. */ export type CheckboxState = { checked: boolean; indeterminate: boolean | undefined; filled: boolean; disabled: boolean | undefined; }; interface CheckboxBase extends StyleProps { checked: boolean; /** * On a box, a select-all's mixed state; on a ring a half-fill, since an empty ring says * untouched. */ indeterminate?: boolean; /** * The ring marks a task (pair it with a title that strikes on the same state); the box is a pick. * Both 24px, so one leading gutter fits either. */ shape?: "box" | "ring"; /** Defaults to `--primary`; a run with its own colour (a `Stepper`'s) passes it. */ color?: InkColor; disabled?: boolean; testID?: string; ref?: React.Ref; /** * The kit's own state, since this is a Base UI control in one mode and a drawn mark in the other. */ render?: useRender.RenderProp; } /** For a row or select-all cell that already names the state. */ export interface CheckboxMarkProps extends CheckboxBase { onChange?: undefined; /** * Give it where nothing around names the state (a register's done column); leave it off inside a * row that does, keeping the mark out of the tree. */ accessibilityLabel?: string; } export interface CheckboxControlProps extends CheckboxBase { onChange: (checked: boolean) => void; /** * Required outside a `FormField`, and absent there it throws: an unlabelled checkbox announces * only its state. Inside a field the visible label names it (WCAG 2.5.3). Same rule as `Switch`. */ accessibilityLabel?: string; } export type CheckboxProps = CheckboxMarkProps | CheckboxControlProps; /** * With no `onChange`, a drawn mark with no tab stop, for rows that already name the state. With * one, `role="checkbox"` with `aria-checked` (`mixed` included) and Space, stopping the press * inside a pressable row. Inside a `FormField` it takes the field's name and id. */ export declare function Checkbox(props: CheckboxProps): React.JSX.Element; export {};