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

/**
 * Shared state exposed through the root context. Accessors throughout so
 * consumers don't need to guard reactive reads.
 */

export const ComboboxRootContext = createContext(null);
export function useComboboxRootContext(optional) {
  const ctx = useContext(ComboboxRootContext);
  if (ctx == null && !optional) {
    throw new Error("Base UI: ComboboxRootContext is missing. Combobox parts must be placed within <Combobox.Root>.");
  }
  return ctx;
}
//# sourceMappingURL=combobox-root-context.jsx.map
