"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.MenuContext = exports.ItemContext = void 0;
exports.useMenuContext = useMenuContext;
exports.useMenuItemContext = useMenuItemContext;
var _react = require("react");
const MenuContext = exports.MenuContext = /*#__PURE__*/(0, _react.createContext)(null);
MenuContext.displayName = 'BloomMenuContext';
const ItemContext = exports.ItemContext = /*#__PURE__*/(0, _react.createContext)(null);
ItemContext.displayName = 'BloomMenuItemContext';
function useMenuContext() {
  const context = (0, _react.useContext)(MenuContext);
  if (!context) {
    throw new Error('useMenuContext must be used within a Menu.Root');
  }
  return context;
}
function useMenuItemContext() {
  const context = (0, _react.useContext)(ItemContext);
  if (!context) {
    throw new Error('useMenuItemContext must be used within a Menu.Item');
  }
  return context;
}
//# sourceMappingURL=context.js.map