import { Checkbox as BaseCheckbox } from '@base-ui/react/checkbox' import { Field as BaseField } from '@base-ui/react/field' import { IconCheck } from '@tabler/icons-react' import type { ReactNode } from 'react' import { cn } from './cn' import { useFormBusy } from './formBusy' /** * A 16px square that fills with the accent when checked — Peek's Checkbox * (2026-09-01), verbatim; on Base UI Checkbox since stage 1 of the migration * (2026-09-06). * * Controlled only; parents own the state. Two renderings, one class list: * * - With `onChange` it is the control, as Base UI renders it: a * `` with a hidden `` beside it. Space * toggles, Enter does not, and its click never reaches the row around it. * - Without `onChange` it is a picture of the state, for a row that toggles * on its own click. It is hidden from assistive technology and takes no * focus, so the row is one control and says the state itself * (`aria-pressed`, or `aria-selected` on an option). Two focusable controls * nested in one another is what axe's `nested-interactive` rule rejects. * * The tick is always in the box, hidden when unchecked. A box that is empty * in one state and holds an icon in the other hangs on a line of text * differently in each, and moved 1px on every click (Katerina, 2026-09-07: * "it should be fixed"). With the tick always there, Base UI's `` and * the `