import { type Accessor } from "solid-js"; import type { FieldRootState } from "../internals/field-constants.js"; /** * State accessible to `` (and any future checkbox parts). * * Mirrors React's `CheckboxRootState` but exposed as `Accessor` fields so * descendants can read each slot lazily — matches the tier-1 compound * convention used by `` / ``, and honours the * no-top-level-reactive-reads rule from Solid 2 RFC 01. * * `state` is a composite accessor handed to `renderElement` for the `data-*` * projection; individual accessors (`checked`, `indeterminate`, …) are the * read surface for `` so it doesn't need to destructure * `state()` at the top of its body. */ export interface CheckboxRootContextValue { /** Whether the checkbox is currently ticked. */ checked: Accessor; /** Whether the checkbox is in a mixed state (neither ticked nor unticked). */ indeterminate: Accessor; /** Whether the component ignores user interaction. */ disabled: Accessor; /** Whether user interaction is blocked without disabling the control. */ readOnly: Accessor; /** Whether the checkbox must be ticked before submitting a form. */ required: Accessor; /** Composite state accessor — fed directly to `renderElement`'s projection. */ state: Accessor; } /** * Full checkbox state: field-root state merged with checkbox-specific flags. * * The order of the extension matters only for clarity — `data-disabled` is * sourced from `disabled`, and `checked` / `indeterminate` drive the * checkbox-specific `data-checked` / `data-unchecked` / `data-indeterminate` * triplet via the custom state-attributes mapping. */ export interface CheckboxRootState extends FieldRootState { /** Whether the checkbox is currently ticked. */ checked: boolean; /** Whether the component ignores user interaction. */ disabled: boolean; /** Whether the user should be unable to tick/untick the checkbox. */ readOnly: boolean; /** Whether the checkbox must be ticked before submitting a form. */ required: boolean; /** Whether the checkbox is in a mixed state. */ indeterminate: boolean; } /** * Checkbox root context. `createContext(null)` + `== null` sentinel * — Solid 2's `useContext` throws `ContextNotFoundError` when * the default is `undefined`, which would shadow the intended Base UI error * message below. */ export declare const CheckboxRootContext: import("solid-js").Context; /** * Read the `` context. Throws a descriptive error if the * caller forgot to wrap their subtree in `` — matches Base UI * React. */ export declare function useCheckboxRootContext(): CheckboxRootContextValue; //# sourceMappingURL=checkbox-root-context.d.ts.map