import React from 'react'; import { type FieldsetOrientation } from './Fieldset.js'; import { type SelectionProps } from './resolve-selection.js'; export type CheckboxSize = 'sm' | 'md' | 'lg'; export type CheckboxIntent = 'brand' | 'neutral' | 'danger'; export interface CheckboxProps extends Omit, 'size' | 'type'>, SelectionProps { /** Matches the Figma `Size` variant: Small, Medium, Large. */ size?: CheckboxSize; /** Matches the Figma `Color` variant: Brand, Neutral, Danger. */ intent?: CheckboxIntent; /** * Figma's `Indeterminate` state. Not an HTML attribute — `indeterminate` is a * DOM property only, so it has to be assigned after render. */ isIndeterminate?: boolean; /** Whether the checkbox is disabled. */ isDisabled?: boolean; /** * @deprecated Use `isDisabled`. Accepted as an alias for one minor version. */ disabled?: boolean; /** Figma's `Show Label` + `Label`. Omit for a bare box. */ children?: React.ReactNode; } /** * Checkbox wraps a native `` and hides it. * * The native input is kept rather than replaced by a div with `role=checkbox` * because it brings form association, the indeterminate property, label * clicking, and correct announcement — none of which are free to reimplement, * and all of which are easy to get subtly wrong. * * `indeterminate` is the reason for the effect below: HTML has no * `indeterminate` attribute, only a DOM property, so React cannot set it * declaratively and it must be written after every render. */ export declare const Checkbox: React.ForwardRefExoticComponent>; export interface CheckboxGroupProps extends Omit, 'onChange' | 'defaultValue' | 'disabled'> { /** The question the options answer. Renders as the ``. */ label?: React.ReactNode; /** Help text beneath the options. Replaced by `errorMessage` while invalid. */ description?: React.ReactNode; /** Shown in the description's place while `isInvalid` is set. */ errorMessage?: React.ReactNode; /** Marks every box invalid and shows `errorMessage`. */ isInvalid?: boolean; /** At least one option must be selected — enforced by native validation. */ isRequired?: boolean; /** The selected values (controlled). */ value?: readonly string[]; /** The initially selected values (uncontrolled). */ defaultValue?: readonly string[]; /** Receives the whole new selection, in the order the options were ticked. */ onChange?: (value: string[]) => void; /** Shared input name, so a form submits every ticked value under it. */ name?: string; size?: CheckboxSize; intent?: CheckboxIntent; /** Whether every checkbox in the group is disabled. */ isDisabled?: boolean; orientation?: FieldsetOrientation; /** Checkboxes, each with a `value`. */ children?: React.ReactNode; } /** * A set of checkboxes that answers one question — "notify me when…", "which * regions". Owns the selected values, the group's label, help text and error, * and "select at least one". * * A row of loose Checkboxes can do none of that accessibly: the question is * not announced with the options, an error has nothing to attach to, and * "at least one" has no native expression at all. See the `required` note in * Checkbox for how that last one is done. */ export declare const CheckboxGroup: React.ForwardRefExoticComponent>; //# sourceMappingURL=Checkbox.d.ts.map