import { createContext, useContext } from "solid-js";

/**
 * Context value handed down by `<Field.Item>` so nested controls can inherit
 * the item-level `disabled` override without walking back to the root.
 *
 * Mirrors Base UI React's `FieldItemContext` — a narrow per-item scope used
 * when a single `<Field.Root>` contains multiple logical sub-controls (e.g.
 * a `<CheckboxGroup>` with per-checkbox labels + descriptions).
 */

export const NOOP_FIELD_ITEM_CONTEXT = {
  disabled: () => false,
  present: false
};
export const FieldItemContext = createContext(NOOP_FIELD_ITEM_CONTEXT);

/**
 * Read the nearest `<Field.Item>` context. Returns the noop context when no
 * item is above — callers can branch on `.present` if they need to detect
 * the "not in an item" case.
 */
export function useFieldItemContext() {
  return useContext(FieldItemContext);
}
//# sourceMappingURL=field-item-context.jsx.map
