{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAUM,SAAS;IACd,IAAI,UAAU,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,uCAAY;IACrC,IAAI,CAAC,SACH,MAAM,IAAI,MAAM;IAGlB,OAAO;QACL,MAAM,QAAQ,IAAI;QAClB;YACE,SAAS;QACX;IACF;AACF","sources":["packages/@adobe/react-spectrum/src/dialog/useDialogContainer.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 {DialogContext} from './context';\nimport {useContext} from 'react';\n\nexport interface DialogContainerValue {\n  type: 'modal' | 'popover' | 'tray' | 'fullscreen' | 'fullscreenTakeover',\n  dismiss(): void\n}\n\nexport function useDialogContainer(): DialogContainerValue {\n  let context = useContext(DialogContext);\n  if (!context) {\n    throw new Error('Cannot call useDialogContext outside a <DialogTrigger> or <DialogContainer>.');\n  }\n\n  return {\n    type: context.type,\n    dismiss() {\n      context?.onClose();\n    }\n  };\n}\n"],"names":[],"version":3,"file":"useDialogContainer.cjs.map"}