index.mjs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. import $67UHm$babelruntimehelpersesmextends from "@babel/runtime/helpers/esm/extends";
  2. import {useRef as $67UHm$useRef, createElement as $67UHm$createElement, useCallback as $67UHm$useCallback, forwardRef as $67UHm$forwardRef, Children as $67UHm$Children, useEffect as $67UHm$useEffect, Fragment as $67UHm$Fragment} from "react";
  3. import {composeEventHandlers as $67UHm$composeEventHandlers} from "@radix-ui/primitive";
  4. import {useComposedRefs as $67UHm$useComposedRefs} from "@radix-ui/react-compose-refs";
  5. import {createContextScope as $67UHm$createContextScope, createContext as $67UHm$createContext} from "@radix-ui/react-context";
  6. import {useId as $67UHm$useId} from "@radix-ui/react-id";
  7. import {useControllableState as $67UHm$useControllableState} from "@radix-ui/react-use-controllable-state";
  8. import {DismissableLayer as $67UHm$DismissableLayer} from "@radix-ui/react-dismissable-layer";
  9. import {FocusScope as $67UHm$FocusScope} from "@radix-ui/react-focus-scope";
  10. import {Portal as $67UHm$Portal} from "@radix-ui/react-portal";
  11. import {Presence as $67UHm$Presence} from "@radix-ui/react-presence";
  12. import {Primitive as $67UHm$Primitive} from "@radix-ui/react-primitive";
  13. import {useFocusGuards as $67UHm$useFocusGuards} from "@radix-ui/react-focus-guards";
  14. import {RemoveScroll as $67UHm$RemoveScroll} from "react-remove-scroll";
  15. import {hideOthers as $67UHm$hideOthers} from "aria-hidden";
  16. import {Slot as $67UHm$Slot} from "@radix-ui/react-slot";
  17. /* -------------------------------------------------------------------------------------------------
  18. * Dialog
  19. * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DIALOG_NAME = 'Dialog';
  20. const [$5d3850c4d0b4e6c7$var$createDialogContext, $5d3850c4d0b4e6c7$export$cc702773b8ea3e41] = $67UHm$createContextScope($5d3850c4d0b4e6c7$var$DIALOG_NAME);
  21. const [$5d3850c4d0b4e6c7$var$DialogProvider, $5d3850c4d0b4e6c7$var$useDialogContext] = $5d3850c4d0b4e6c7$var$createDialogContext($5d3850c4d0b4e6c7$var$DIALOG_NAME);
  22. const $5d3850c4d0b4e6c7$export$3ddf2d174ce01153 = (props)=>{
  23. const { __scopeDialog: __scopeDialog , children: children , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , modal: modal = true } = props;
  24. const triggerRef = $67UHm$useRef(null);
  25. const contentRef = $67UHm$useRef(null);
  26. const [open = false, setOpen] = $67UHm$useControllableState({
  27. prop: openProp,
  28. defaultProp: defaultOpen,
  29. onChange: onOpenChange
  30. });
  31. return /*#__PURE__*/ $67UHm$createElement($5d3850c4d0b4e6c7$var$DialogProvider, {
  32. scope: __scopeDialog,
  33. triggerRef: triggerRef,
  34. contentRef: contentRef,
  35. contentId: $67UHm$useId(),
  36. titleId: $67UHm$useId(),
  37. descriptionId: $67UHm$useId(),
  38. open: open,
  39. onOpenChange: setOpen,
  40. onOpenToggle: $67UHm$useCallback(()=>setOpen((prevOpen)=>!prevOpen
  41. )
  42. , [
  43. setOpen
  44. ]),
  45. modal: modal
  46. }, children);
  47. };
  48. /*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$3ddf2d174ce01153, {
  49. displayName: $5d3850c4d0b4e6c7$var$DIALOG_NAME
  50. });
  51. /* -------------------------------------------------------------------------------------------------
  52. * DialogTrigger
  53. * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$TRIGGER_NAME = 'DialogTrigger';
  54. const $5d3850c4d0b4e6c7$export$2e1e1122cf0cba88 = /*#__PURE__*/ $67UHm$forwardRef((props, forwardedRef)=>{
  55. const { __scopeDialog: __scopeDialog , ...triggerProps } = props;
  56. const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$TRIGGER_NAME, __scopeDialog);
  57. const composedTriggerRef = $67UHm$useComposedRefs(forwardedRef, context.triggerRef);
  58. return /*#__PURE__*/ $67UHm$createElement($67UHm$Primitive.button, $67UHm$babelruntimehelpersesmextends({
  59. type: "button",
  60. "aria-haspopup": "dialog",
  61. "aria-expanded": context.open,
  62. "aria-controls": context.contentId,
  63. "data-state": $5d3850c4d0b4e6c7$var$getState(context.open)
  64. }, triggerProps, {
  65. ref: composedTriggerRef,
  66. onClick: $67UHm$composeEventHandlers(props.onClick, context.onOpenToggle)
  67. }));
  68. });
  69. /*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$2e1e1122cf0cba88, {
  70. displayName: $5d3850c4d0b4e6c7$var$TRIGGER_NAME
  71. });
  72. /* -------------------------------------------------------------------------------------------------
  73. * DialogPortal
  74. * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$PORTAL_NAME = 'DialogPortal';
  75. const [$5d3850c4d0b4e6c7$var$PortalProvider, $5d3850c4d0b4e6c7$var$usePortalContext] = $5d3850c4d0b4e6c7$var$createDialogContext($5d3850c4d0b4e6c7$var$PORTAL_NAME, {
  76. forceMount: undefined
  77. });
  78. const $5d3850c4d0b4e6c7$export$dad7c95542bacce0 = (props)=>{
  79. const { __scopeDialog: __scopeDialog , forceMount: forceMount , children: children , container: container } = props;
  80. const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$PORTAL_NAME, __scopeDialog);
  81. return /*#__PURE__*/ $67UHm$createElement($5d3850c4d0b4e6c7$var$PortalProvider, {
  82. scope: __scopeDialog,
  83. forceMount: forceMount
  84. }, $67UHm$Children.map(children, (child)=>/*#__PURE__*/ $67UHm$createElement($67UHm$Presence, {
  85. present: forceMount || context.open
  86. }, /*#__PURE__*/ $67UHm$createElement($67UHm$Portal, {
  87. asChild: true,
  88. container: container
  89. }, child))
  90. ));
  91. };
  92. /*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$dad7c95542bacce0, {
  93. displayName: $5d3850c4d0b4e6c7$var$PORTAL_NAME
  94. });
  95. /* -------------------------------------------------------------------------------------------------
  96. * DialogOverlay
  97. * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$OVERLAY_NAME = 'DialogOverlay';
  98. const $5d3850c4d0b4e6c7$export$bd1d06c79be19e17 = /*#__PURE__*/ $67UHm$forwardRef((props, forwardedRef)=>{
  99. const portalContext = $5d3850c4d0b4e6c7$var$usePortalContext($5d3850c4d0b4e6c7$var$OVERLAY_NAME, props.__scopeDialog);
  100. const { forceMount: forceMount = portalContext.forceMount , ...overlayProps } = props;
  101. const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$OVERLAY_NAME, props.__scopeDialog);
  102. return context.modal ? /*#__PURE__*/ $67UHm$createElement($67UHm$Presence, {
  103. present: forceMount || context.open
  104. }, /*#__PURE__*/ $67UHm$createElement($5d3850c4d0b4e6c7$var$DialogOverlayImpl, $67UHm$babelruntimehelpersesmextends({}, overlayProps, {
  105. ref: forwardedRef
  106. }))) : null;
  107. });
  108. /*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$bd1d06c79be19e17, {
  109. displayName: $5d3850c4d0b4e6c7$var$OVERLAY_NAME
  110. });
  111. const $5d3850c4d0b4e6c7$var$DialogOverlayImpl = /*#__PURE__*/ $67UHm$forwardRef((props, forwardedRef)=>{
  112. const { __scopeDialog: __scopeDialog , ...overlayProps } = props;
  113. const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$OVERLAY_NAME, __scopeDialog);
  114. return(/*#__PURE__*/ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
  115. // ie. when `Overlay` and `Content` are siblings
  116. $67UHm$createElement($67UHm$RemoveScroll, {
  117. as: $67UHm$Slot,
  118. allowPinchZoom: true,
  119. shards: [
  120. context.contentRef
  121. ]
  122. }, /*#__PURE__*/ $67UHm$createElement($67UHm$Primitive.div, $67UHm$babelruntimehelpersesmextends({
  123. "data-state": $5d3850c4d0b4e6c7$var$getState(context.open)
  124. }, overlayProps, {
  125. ref: forwardedRef // We re-enable pointer-events prevented by `Dialog.Content` to allow scrolling the overlay.
  126. ,
  127. style: {
  128. pointerEvents: 'auto',
  129. ...overlayProps.style
  130. }
  131. }))));
  132. });
  133. /* -------------------------------------------------------------------------------------------------
  134. * DialogContent
  135. * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$CONTENT_NAME = 'DialogContent';
  136. const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ $67UHm$forwardRef((props, forwardedRef)=>{
  137. const portalContext = $5d3850c4d0b4e6c7$var$usePortalContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
  138. const { forceMount: forceMount = portalContext.forceMount , ...contentProps } = props;
  139. const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
  140. return /*#__PURE__*/ $67UHm$createElement($67UHm$Presence, {
  141. present: forceMount || context.open
  142. }, context.modal ? /*#__PURE__*/ $67UHm$createElement($5d3850c4d0b4e6c7$var$DialogContentModal, $67UHm$babelruntimehelpersesmextends({}, contentProps, {
  143. ref: forwardedRef
  144. })) : /*#__PURE__*/ $67UHm$createElement($5d3850c4d0b4e6c7$var$DialogContentNonModal, $67UHm$babelruntimehelpersesmextends({}, contentProps, {
  145. ref: forwardedRef
  146. })));
  147. });
  148. /*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$b6d9565de1e068cf, {
  149. displayName: $5d3850c4d0b4e6c7$var$CONTENT_NAME
  150. });
  151. /* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentModal = /*#__PURE__*/ $67UHm$forwardRef((props, forwardedRef)=>{
  152. const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
  153. const contentRef = $67UHm$useRef(null);
  154. const composedRefs = $67UHm$useComposedRefs(forwardedRef, context.contentRef, contentRef); // aria-hide everything except the content (better supported equivalent to setting aria-modal)
  155. $67UHm$useEffect(()=>{
  156. const content = contentRef.current;
  157. if (content) return $67UHm$hideOthers(content);
  158. }, []);
  159. return /*#__PURE__*/ $67UHm$createElement($5d3850c4d0b4e6c7$var$DialogContentImpl, $67UHm$babelruntimehelpersesmextends({}, props, {
  160. ref: composedRefs // we make sure focus isn't trapped once `DialogContent` has been closed
  161. ,
  162. trapFocus: context.open,
  163. disableOutsidePointerEvents: true,
  164. onCloseAutoFocus: $67UHm$composeEventHandlers(props.onCloseAutoFocus, (event)=>{
  165. var _context$triggerRef$c;
  166. event.preventDefault();
  167. (_context$triggerRef$c = context.triggerRef.current) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c.focus();
  168. }),
  169. onPointerDownOutside: $67UHm$composeEventHandlers(props.onPointerDownOutside, (event)=>{
  170. const originalEvent = event.detail.originalEvent;
  171. const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
  172. const isRightClick = originalEvent.button === 2 || ctrlLeftClick; // If the event is a right-click, we shouldn't close because
  173. // it is effectively as if we right-clicked the `Overlay`.
  174. if (isRightClick) event.preventDefault();
  175. }) // When focus is trapped, a `focusout` event may still happen.
  176. ,
  177. onFocusOutside: $67UHm$composeEventHandlers(props.onFocusOutside, (event)=>event.preventDefault()
  178. )
  179. }));
  180. });
  181. /* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentNonModal = /*#__PURE__*/ $67UHm$forwardRef((props, forwardedRef)=>{
  182. const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
  183. const hasInteractedOutsideRef = $67UHm$useRef(false);
  184. const hasPointerDownOutsideRef = $67UHm$useRef(false);
  185. return /*#__PURE__*/ $67UHm$createElement($5d3850c4d0b4e6c7$var$DialogContentImpl, $67UHm$babelruntimehelpersesmextends({}, props, {
  186. ref: forwardedRef,
  187. trapFocus: false,
  188. disableOutsidePointerEvents: false,
  189. onCloseAutoFocus: (event)=>{
  190. var _props$onCloseAutoFoc;
  191. (_props$onCloseAutoFoc = props.onCloseAutoFocus) === null || _props$onCloseAutoFoc === void 0 || _props$onCloseAutoFoc.call(props, event);
  192. if (!event.defaultPrevented) {
  193. var _context$triggerRef$c2;
  194. if (!hasInteractedOutsideRef.current) (_context$triggerRef$c2 = context.triggerRef.current) === null || _context$triggerRef$c2 === void 0 || _context$triggerRef$c2.focus(); // Always prevent auto focus because we either focus manually or want user agent focus
  195. event.preventDefault();
  196. }
  197. hasInteractedOutsideRef.current = false;
  198. hasPointerDownOutsideRef.current = false;
  199. },
  200. onInteractOutside: (event)=>{
  201. var _props$onInteractOuts, _context$triggerRef$c3;
  202. (_props$onInteractOuts = props.onInteractOutside) === null || _props$onInteractOuts === void 0 || _props$onInteractOuts.call(props, event);
  203. if (!event.defaultPrevented) {
  204. hasInteractedOutsideRef.current = true;
  205. if (event.detail.originalEvent.type === 'pointerdown') hasPointerDownOutsideRef.current = true;
  206. } // Prevent dismissing when clicking the trigger.
  207. // As the trigger is already setup to close, without doing so would
  208. // cause it to close and immediately open.
  209. const target = event.target;
  210. const targetIsTrigger = (_context$triggerRef$c3 = context.triggerRef.current) === null || _context$triggerRef$c3 === void 0 ? void 0 : _context$triggerRef$c3.contains(target);
  211. if (targetIsTrigger) event.preventDefault(); // On Safari if the trigger is inside a container with tabIndex={0}, when clicked
  212. // we will get the pointer down outside event on the trigger, but then a subsequent
  213. // focus outside event on the container, we ignore any focus outside event when we've
  214. // already had a pointer down outside event.
  215. if (event.detail.originalEvent.type === 'focusin' && hasPointerDownOutsideRef.current) event.preventDefault();
  216. }
  217. }));
  218. });
  219. /* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentImpl = /*#__PURE__*/ $67UHm$forwardRef((props, forwardedRef)=>{
  220. const { __scopeDialog: __scopeDialog , trapFocus: trapFocus , onOpenAutoFocus: onOpenAutoFocus , onCloseAutoFocus: onCloseAutoFocus , ...contentProps } = props;
  221. const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, __scopeDialog);
  222. const contentRef = $67UHm$useRef(null);
  223. const composedRefs = $67UHm$useComposedRefs(forwardedRef, contentRef); // Make sure the whole tree has focus guards as our `Dialog` will be
  224. // the last element in the DOM (beacuse of the `Portal`)
  225. $67UHm$useFocusGuards();
  226. return /*#__PURE__*/ $67UHm$createElement($67UHm$Fragment, null, /*#__PURE__*/ $67UHm$createElement($67UHm$FocusScope, {
  227. asChild: true,
  228. loop: true,
  229. trapped: trapFocus,
  230. onMountAutoFocus: onOpenAutoFocus,
  231. onUnmountAutoFocus: onCloseAutoFocus
  232. }, /*#__PURE__*/ $67UHm$createElement($67UHm$DismissableLayer, $67UHm$babelruntimehelpersesmextends({
  233. role: "dialog",
  234. id: context.contentId,
  235. "aria-describedby": context.descriptionId,
  236. "aria-labelledby": context.titleId,
  237. "data-state": $5d3850c4d0b4e6c7$var$getState(context.open)
  238. }, contentProps, {
  239. ref: composedRefs,
  240. onDismiss: ()=>context.onOpenChange(false)
  241. }))), false);
  242. });
  243. /* -------------------------------------------------------------------------------------------------
  244. * DialogTitle
  245. * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$TITLE_NAME = 'DialogTitle';
  246. const $5d3850c4d0b4e6c7$export$16f7638e4a34b909 = /*#__PURE__*/ $67UHm$forwardRef((props, forwardedRef)=>{
  247. const { __scopeDialog: __scopeDialog , ...titleProps } = props;
  248. const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$TITLE_NAME, __scopeDialog);
  249. return /*#__PURE__*/ $67UHm$createElement($67UHm$Primitive.h2, $67UHm$babelruntimehelpersesmextends({
  250. id: context.titleId
  251. }, titleProps, {
  252. ref: forwardedRef
  253. }));
  254. });
  255. /*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$16f7638e4a34b909, {
  256. displayName: $5d3850c4d0b4e6c7$var$TITLE_NAME
  257. });
  258. /* -------------------------------------------------------------------------------------------------
  259. * DialogDescription
  260. * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DESCRIPTION_NAME = 'DialogDescription';
  261. const $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5 = /*#__PURE__*/ $67UHm$forwardRef((props, forwardedRef)=>{
  262. const { __scopeDialog: __scopeDialog , ...descriptionProps } = props;
  263. const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$DESCRIPTION_NAME, __scopeDialog);
  264. return /*#__PURE__*/ $67UHm$createElement($67UHm$Primitive.p, $67UHm$babelruntimehelpersesmextends({
  265. id: context.descriptionId
  266. }, descriptionProps, {
  267. ref: forwardedRef
  268. }));
  269. });
  270. /*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$94e94c2ec2c954d5, {
  271. displayName: $5d3850c4d0b4e6c7$var$DESCRIPTION_NAME
  272. });
  273. /* -------------------------------------------------------------------------------------------------
  274. * DialogClose
  275. * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$CLOSE_NAME = 'DialogClose';
  276. const $5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac = /*#__PURE__*/ $67UHm$forwardRef((props, forwardedRef)=>{
  277. const { __scopeDialog: __scopeDialog , ...closeProps } = props;
  278. const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CLOSE_NAME, __scopeDialog);
  279. return /*#__PURE__*/ $67UHm$createElement($67UHm$Primitive.button, $67UHm$babelruntimehelpersesmextends({
  280. type: "button"
  281. }, closeProps, {
  282. ref: forwardedRef,
  283. onClick: $67UHm$composeEventHandlers(props.onClick, ()=>context.onOpenChange(false)
  284. )
  285. }));
  286. });
  287. /*#__PURE__*/ Object.assign($5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac, {
  288. displayName: $5d3850c4d0b4e6c7$var$CLOSE_NAME
  289. });
  290. /* -----------------------------------------------------------------------------------------------*/ function $5d3850c4d0b4e6c7$var$getState(open) {
  291. return open ? 'open' : 'closed';
  292. }
  293. const $5d3850c4d0b4e6c7$var$TITLE_WARNING_NAME = 'DialogTitleWarning';
  294. const [$5d3850c4d0b4e6c7$export$69b62a49393917d6, $5d3850c4d0b4e6c7$var$useWarningContext] = $67UHm$createContext($5d3850c4d0b4e6c7$var$TITLE_WARNING_NAME, {
  295. contentName: $5d3850c4d0b4e6c7$var$CONTENT_NAME,
  296. titleName: $5d3850c4d0b4e6c7$var$TITLE_NAME,
  297. docsSlug: 'dialog'
  298. });
  299. const $5d3850c4d0b4e6c7$var$TitleWarning = ({ titleId: titleId })=>{
  300. const titleWarningContext = $5d3850c4d0b4e6c7$var$useWarningContext($5d3850c4d0b4e6c7$var$TITLE_WARNING_NAME);
  301. const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
  302. If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
  303. For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
  304. $67UHm$useEffect(()=>{
  305. if (titleId) {
  306. const hasTitle = document.getElementById(titleId);
  307. if (!hasTitle) throw new Error(MESSAGE);
  308. }
  309. }, [
  310. MESSAGE,
  311. titleId
  312. ]);
  313. return null;
  314. };
  315. const $5d3850c4d0b4e6c7$var$DESCRIPTION_WARNING_NAME = 'DialogDescriptionWarning';
  316. const $5d3850c4d0b4e6c7$var$DescriptionWarning = ({ contentRef: contentRef , descriptionId: descriptionId })=>{
  317. const descriptionWarningContext = $5d3850c4d0b4e6c7$var$useWarningContext($5d3850c4d0b4e6c7$var$DESCRIPTION_WARNING_NAME);
  318. const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
  319. $67UHm$useEffect(()=>{
  320. var _contentRef$current;
  321. const describedById = (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.getAttribute('aria-describedby'); // if we have an id and the user hasn't set aria-describedby={undefined}
  322. if (descriptionId && describedById) {
  323. const hasDescription = document.getElementById(descriptionId);
  324. if (!hasDescription) console.warn(MESSAGE);
  325. }
  326. }, [
  327. MESSAGE,
  328. contentRef,
  329. descriptionId
  330. ]);
  331. return null;
  332. };
  333. const $5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9 = $5d3850c4d0b4e6c7$export$3ddf2d174ce01153;
  334. const $5d3850c4d0b4e6c7$export$41fb9f06171c75f4 = $5d3850c4d0b4e6c7$export$2e1e1122cf0cba88;
  335. const $5d3850c4d0b4e6c7$export$602eac185826482c = $5d3850c4d0b4e6c7$export$dad7c95542bacce0;
  336. const $5d3850c4d0b4e6c7$export$c6fdb837b070b4ff = $5d3850c4d0b4e6c7$export$bd1d06c79be19e17;
  337. const $5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2 = $5d3850c4d0b4e6c7$export$b6d9565de1e068cf;
  338. const $5d3850c4d0b4e6c7$export$f99233281efd08a0 = $5d3850c4d0b4e6c7$export$16f7638e4a34b909;
  339. const $5d3850c4d0b4e6c7$export$393edc798c47379d = $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5;
  340. const $5d3850c4d0b4e6c7$export$f39c2d165cd861fe = $5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac;
  341. export {$5d3850c4d0b4e6c7$export$cc702773b8ea3e41 as createDialogScope, $5d3850c4d0b4e6c7$export$3ddf2d174ce01153 as Dialog, $5d3850c4d0b4e6c7$export$2e1e1122cf0cba88 as DialogTrigger, $5d3850c4d0b4e6c7$export$dad7c95542bacce0 as DialogPortal, $5d3850c4d0b4e6c7$export$bd1d06c79be19e17 as DialogOverlay, $5d3850c4d0b4e6c7$export$b6d9565de1e068cf as DialogContent, $5d3850c4d0b4e6c7$export$16f7638e4a34b909 as DialogTitle, $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5 as DialogDescription, $5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac as DialogClose, $5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9 as Root, $5d3850c4d0b4e6c7$export$41fb9f06171c75f4 as Trigger, $5d3850c4d0b4e6c7$export$602eac185826482c as Portal, $5d3850c4d0b4e6c7$export$c6fdb837b070b4ff as Overlay, $5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2 as Content, $5d3850c4d0b4e6c7$export$f99233281efd08a0 as Title, $5d3850c4d0b4e6c7$export$393edc798c47379d as Description, $5d3850c4d0b4e6c7$export$f39c2d165cd861fe as Close, $5d3850c4d0b4e6c7$export$69b62a49393917d6 as WarningProvider};
  342. //# sourceMappingURL=index.mjs.map