{"mappings":";;AAAA;;;;;;;;;;CAUC;AA4BM,MAAM,4CAAc,CAAA,GAAA,YAAI,EAAE,aAAa,CAAmB,CAAC;AAE3D,SAAS;IACd,OAAO,CAAA,GAAA,iBAAS,EAAE;AACpB;AAgBO,MAAM,4CAAwB,CAAA,GAAA,YAAI,EAAE,aAAa,CACtD;AAGK,SAAS;IACd,OAAO,CAAA,GAAA,iBAAS,EAAE;AACpB;AAWO,MAAM,4CAAmB,CAAA,GAAA,YAAI,EAAE,aAAa,CACjD;AAGK,SAAS;IACd,OAAO,CAAA,GAAA,iBAAS,EAAE;AACpB","sources":["packages/@adobe/react-spectrum/src/menu/context.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n  DOMProps,\n  FocusStrategy,\n  HoverEvents,\n  KeyboardEvents,\n  PressEvents,\n  RefObject\n} from '@react-types/shared';\nimport React, {HTMLAttributes, useContext} from 'react';\nimport {RootMenuTriggerState} from 'react-stately/useMenuTriggerState';\nimport {TreeState} from 'react-stately/useTreeState';\n\nexport interface MenuContextValue\n  extends\n    Omit<HTMLAttributes<HTMLElement>, 'autoFocus' | 'onKeyDown'>,\n    Pick<KeyboardEvents, 'onKeyDown'> {\n  onClose?: () => void;\n  closeOnSelect?: boolean;\n  shouldFocusWrap?: boolean;\n  autoFocus?: boolean | FocusStrategy;\n  ref?: RefObject<HTMLDivElement | null>;\n  state?: RootMenuTriggerState;\n  onBackButtonPress?: () => void;\n  submenuLevel?: number;\n}\n\nexport const MenuContext = React.createContext<MenuContextValue>({});\n\nexport function useMenuContext(): MenuContextValue {\n  return useContext(MenuContext);\n}\n\nexport interface SubmenuTriggerContextValue\n  extends\n    DOMProps,\n    Pick<PressEvents, 'onPressStart' | 'onPress'>,\n    Pick<HoverEvents, 'onHoverChange'>,\n    Pick<KeyboardEvents, 'onKeyDown'> {\n  isUnavailable?: boolean;\n  triggerRef?: RefObject<HTMLElement | null>;\n  'aria-expanded'?: boolean | 'true' | 'false';\n  'aria-controls'?: string;\n  'aria-haspopup'?: 'dialog' | 'menu';\n  isOpen?: boolean;\n}\n\nexport const SubmenuTriggerContext = React.createContext<SubmenuTriggerContextValue | undefined>(\n  undefined\n);\n\nexport function useSubmenuTriggerContext(): SubmenuTriggerContextValue | undefined {\n  return useContext(SubmenuTriggerContext);\n}\n\nexport interface MenuStateContextValue<T> {\n  state: TreeState<T>;\n  popoverContainer: HTMLElement | null;\n  trayContainerRef: RefObject<HTMLElement | null>;\n  menu: RefObject<HTMLDivElement | null>;\n  submenu: RefObject<HTMLDivElement | null>;\n  rootMenuTriggerState?: RootMenuTriggerState;\n}\n\nexport const MenuStateContext = React.createContext<MenuStateContextValue<any> | undefined>(\n  undefined\n);\n\nexport function useMenuStateContext(): MenuStateContextValue<any> | undefined {\n  return useContext(MenuStateContext);\n}\n"],"names":[],"version":3,"file":"context.mjs.map"}