import { type Accessor } from "solid-js"; import type { FieldRootState } from "../internals/field-constants.js"; /** * The full state shape exposed by `` to its children. Mirrors * React's `RadioRootState` (see * `packages/react/src/radio/root/RadioRoot.tsx` — the inline `RadioRootState` * interface extends `FieldRootState`). * * `checked`, `disabled`, `readOnly` and `required` are the radio-specific * slots. The remainder (`valid`, `touched`, `dirty`, `filled`, `focused`) are * inherited from the surrounding `` when one exists — they flow * through `data-*` projection and the `render` / `class` / `style` callbacks. */ export interface RadioRootState extends FieldRootState { /** Whether the radio button is currently selected. */ checked: boolean; /** Whether the component should ignore user interaction. */ disabled: boolean; /** Whether the user should be unable to select the radio button. */ readOnly: boolean; /** Whether the user must choose a value before submitting a form. */ required: boolean; } /** * The context value consumed by ``. Every reactive slot is * exposed as an `Accessor` so descendants pull the latest value on demand * and don't trip the top-level reactive read rule (RFC 01). * * Shape diverges from the React port: React stores a plain object + dispatches * via re-render. Solid's no-top-level-reactive-reads rule means we need a * live accessor for each field so ``'s render body (which * reads `checked` inside JSX to decide whether to emit the span) stays * reactive without a memo ping-pong. */ export interface RadioRootContextValue { /** Accessor for the full state object (used for `data-*` projection). */ state: Accessor; /** Direct accessor for `checked` — convenience for the indicator's gate. */ checked: Accessor; } /** * Radio 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 RadioRootContext: import("solid-js").Context; /** * Read the `` context. Throws a descriptive error if the caller * forgot to wrap their subtree in `` — matches Base UI React's * `useRadioRootContext`. */ export declare function useRadioRootContext(): RadioRootContextValue; //# sourceMappingURL=radio-root-context.d.ts.map