/**
 * Context plumbing for `<Menubar>` → contained `<Menu.Root>`s. Mirrors
 * `packages/react/src/menubar/MenubarContext.ts` but threads reactive
 * accessors instead of React mutable objects.
 *
 * `createContext<T | null>(null)` + `== null` sentinel — a
 * `<Menu.Root>` may be used standalone (no menubar above), in which case
 * parent-from-context detection returns `null`.
 */
import { createContext, useContext } from "solid-js";
export const MenubarContext = createContext(null);
export function useMenubarContext(optional) {
  const ctx = useContext(MenubarContext);
  if (ctx == null && !optional) {
    throw new Error("Base UI: MenubarContext is missing. Menubar parts must be placed within <Menubar>.");
  }
  return ctx;
}
//# sourceMappingURL=menubar-context.jsx.map
