@activecollab/components 2.0.555 → 2.0.557

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/cjs/components/Autocomplete/Autocomplete.js +9 -3
  2. package/dist/cjs/components/Autocomplete/Autocomplete.js.map +1 -1
  3. package/dist/cjs/components/Input/InputPhone.js +3 -1
  4. package/dist/cjs/components/Input/InputPhone.js.map +1 -1
  5. package/dist/cjs/components/ModalRoot/ModalRoot.js +129 -28
  6. package/dist/cjs/components/ModalRoot/ModalRoot.js.map +1 -1
  7. package/dist/cjs/components/ModalRoot/Styles.js +2 -1
  8. package/dist/cjs/components/ModalRoot/Styles.js.map +1 -1
  9. package/dist/cjs/components/ModalRoot/modalRootStack.js +92 -23
  10. package/dist/cjs/components/ModalRoot/modalRootStack.js.map +1 -1
  11. package/dist/cjs/components/ModalRoot/useModalStackHost.js +8 -2
  12. package/dist/cjs/components/ModalRoot/useModalStackHost.js.map +1 -1
  13. package/dist/cjs/components/RadioButton/Styles.js +2 -2
  14. package/dist/cjs/components/RadioButton/Styles.js.map +1 -1
  15. package/dist/cjs/components/Select/Option/Styles.js +1 -1
  16. package/dist/cjs/components/Select/Option/Styles.js.map +1 -1
  17. package/dist/cjs/utils/layers.js +8 -3
  18. package/dist/cjs/utils/layers.js.map +1 -1
  19. package/dist/cjs/utils/layers.test.js +15 -0
  20. package/dist/cjs/utils/layers.test.js.map +1 -1
  21. package/dist/esm/components/Autocomplete/Autocomplete.d.ts.map +1 -1
  22. package/dist/esm/components/Autocomplete/Autocomplete.js +9 -3
  23. package/dist/esm/components/Autocomplete/Autocomplete.js.map +1 -1
  24. package/dist/esm/components/Input/InputPhone.d.ts.map +1 -1
  25. package/dist/esm/components/Input/InputPhone.js +3 -1
  26. package/dist/esm/components/Input/InputPhone.js.map +1 -1
  27. package/dist/esm/components/ModalRoot/ModalRoot.d.ts +2 -1
  28. package/dist/esm/components/ModalRoot/ModalRoot.d.ts.map +1 -1
  29. package/dist/esm/components/ModalRoot/ModalRoot.js +130 -29
  30. package/dist/esm/components/ModalRoot/ModalRoot.js.map +1 -1
  31. package/dist/esm/components/ModalRoot/Styles.d.ts.map +1 -1
  32. package/dist/esm/components/ModalRoot/Styles.js +2 -1
  33. package/dist/esm/components/ModalRoot/Styles.js.map +1 -1
  34. package/dist/esm/components/ModalRoot/modalRootStack.d.ts +12 -0
  35. package/dist/esm/components/ModalRoot/modalRootStack.d.ts.map +1 -1
  36. package/dist/esm/components/ModalRoot/modalRootStack.js +66 -17
  37. package/dist/esm/components/ModalRoot/modalRootStack.js.map +1 -1
  38. package/dist/esm/components/ModalRoot/useModalStackHost.d.ts +3 -1
  39. package/dist/esm/components/ModalRoot/useModalStackHost.d.ts.map +1 -1
  40. package/dist/esm/components/ModalRoot/useModalStackHost.js +8 -2
  41. package/dist/esm/components/ModalRoot/useModalStackHost.js.map +1 -1
  42. package/dist/esm/components/RadioButton/Styles.d.ts.map +1 -1
  43. package/dist/esm/components/RadioButton/Styles.js +2 -2
  44. package/dist/esm/components/RadioButton/Styles.js.map +1 -1
  45. package/dist/esm/components/Select/Option/Styles.d.ts.map +1 -1
  46. package/dist/esm/components/Select/Option/Styles.js +1 -1
  47. package/dist/esm/components/Select/Option/Styles.js.map +1 -1
  48. package/dist/esm/utils/layers.d.ts +4 -1
  49. package/dist/esm/utils/layers.d.ts.map +1 -1
  50. package/dist/esm/utils/layers.js +6 -3
  51. package/dist/esm/utils/layers.js.map +1 -1
  52. package/dist/esm/utils/layers.test.js +15 -0
  53. package/dist/esm/utils/layers.test.js.map +1 -1
  54. package/dist/index.js +315 -132
  55. package/dist/index.js.map +1 -1
  56. package/dist/index.min.js +1 -1
  57. package/dist/index.min.js.map +1 -1
  58. package/package.json +1 -1
@@ -9,6 +9,7 @@ var _reactRemoveScroll = require("react-remove-scroll");
9
9
  var _classnames = _interopRequireDefault(require("classnames"));
10
10
  var _modalRootStack = require("./modalRootStack");
11
11
  var _Styles = require("./Styles");
12
+ var _useModalStackHost = require("./useModalStackHost");
12
13
  var _helpers = require("../../helpers");
13
14
  var _layers = require("../../utils/layers");
14
15
  var _useForkRef = _interopRequireDefault(require("../../utils/useForkRef"));
@@ -46,14 +47,14 @@ var isFocusable = function isFocusable(element) {
46
47
  typeof element.checkVisibility !== "function" || element.checkVisibility());
47
48
  };
48
49
 
49
- // A focused element that a closed dialog hides keeps the focus until the browser renders again.
50
+ // A focused element that a closed dialog hides, or that turned inert, keeps the focus until the browser renders again.
50
51
  var isFocusLost = function isFocusLost() {
51
52
  var focus = document.activeElement;
52
- if (!focus || focus === document.body || !focus.isConnected) {
53
+ if (!focus || focus === document.body || !focus.isConnected || focus.closest("[inert]")) {
53
54
  return true;
54
55
  }
55
- var dialog = focus.closest("dialog");
56
- return dialog !== null && !dialog.open;
56
+ var layer = focus.closest("dialog, .c-window");
57
+ return layer instanceof HTMLDialogElement && !layer.open;
57
58
  };
58
59
 
59
60
  // A sheet is a window, not a dialog, so once the last dialog is closed nothing else takes a lost focus back.
@@ -65,6 +66,54 @@ var focusTopWindowIfLost = function focusTopWindowIfLost() {
65
66
  });
66
67
  }
67
68
  };
69
+ var keepFocusOn = function keepFocusOn(element) {
70
+ if (element instanceof HTMLElement && element !== document.body && element.isConnected && document.activeElement !== element) {
71
+ element.focus({
72
+ preventScroll: true
73
+ });
74
+ }
75
+ };
76
+
77
+ // A closed dialog shown as a manual popover stays in the top layer without blocking the page. showPopover focuses a
78
+ // dialog, so the focus goes back to where close() left it.
79
+ var keepInTopLayer = function keepInTopLayer(node) {
80
+ if (typeof node.showPopover !== "function") {
81
+ return;
82
+ }
83
+ var focus = document.activeElement;
84
+ node.setAttribute("popover", "manual");
85
+ // eslint-disable-next-line compat/compat
86
+ node.showPopover();
87
+ keepFocusOn(focus);
88
+ if (document.activeElement !== focus && node.contains(document.activeElement)) {
89
+ document.activeElement.blur();
90
+ }
91
+ };
92
+ var leaveTopLayer = function leaveTopLayer(node) {
93
+ if (!node.hasAttribute("popover")) {
94
+ return;
95
+ }
96
+ if (node.matches(":popover-open")) {
97
+ // eslint-disable-next-line compat/compat
98
+ node.hidePopover();
99
+ }
100
+ node.removeAttribute("popover");
101
+ };
102
+ var isHeldStackHost = function isHeldStackHost(element, overlayRoot) {
103
+ var _element$closest;
104
+ return !!overlayRoot && (element === null || element === void 0 || (_element$closest = element.closest("[".concat(_useModalStackHost.MODAL_STACK_HOST_ATTRIBUTE, "]"))) === null || _element$closest === void 0 ? void 0 : _element$closest.parentElement) === overlayRoot;
105
+ };
106
+
107
+ // Popups of the content sit in the overlay root next to the stack hosts and leave with the content.
108
+ var setContentInert = function setContentInert(content, overlayRoot, inert) {
109
+ var _overlayRoot$children;
110
+ content === null || content === void 0 || content.toggleAttribute("inert", inert);
111
+ Array.from((_overlayRoot$children = overlayRoot === null || overlayRoot === void 0 ? void 0 : overlayRoot.children) !== null && _overlayRoot$children !== void 0 ? _overlayRoot$children : []).forEach(function (child) {
112
+ if (!child.hasAttribute(_useModalStackHost.MODAL_STACK_HOST_ATTRIBUTE)) {
113
+ child.toggleAttribute("inert", inert);
114
+ }
115
+ });
116
+ };
68
117
  var ModalRoot = exports.ModalRoot = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
69
118
  var open = _ref.open,
70
119
  onRequestClose = _ref.onRequestClose,
@@ -113,6 +162,8 @@ var ModalRoot = exports.ModalRoot = /*#__PURE__*/(0, _react.forwardRef)(function
113
162
  var openRef = (0, _react.useRef)(open);
114
163
  var pressStartedOnBackdrop = (0, _react.useRef)(false);
115
164
  var stackIdRef = (0, _react.useRef)();
165
+ var exitingRef = (0, _react.useRef)(false);
166
+ var contentRef = (0, _react.useRef)(null);
116
167
  var overlayRootRef = (0, _react.useRef)(null);
117
168
  // Menus and pickers opened inside portal here, into the top layer with the dialog, not under it.
118
169
  var getOverlayRoot = (0, _react.useCallback)(function () {
@@ -122,14 +173,17 @@ var ModalRoot = exports.ModalRoot = /*#__PURE__*/(0, _react.forwardRef)(function
122
173
  var disableReturnFocusRef = (0, _react.useRef)(disableReturnFocus);
123
174
  disableReturnFocusRef.current = disableReturnFocus;
124
175
 
125
- // close() gives the focus back to the element that had it before showModal when the focus is in the dialog, so
126
- // a dialog that leaves it there takes it off again. A focus outside, as in a sheet that left the overlay root,
127
- // stays where it is. When that element is gone, also when it goes with the same update right after, and the
128
- // last dialog closes over a sheet, the sheet takes it.
176
+ // close() of a modal gives the focus back to the element that had it before showModal, so a dialog that leaves it
177
+ // there takes it off again. A focus outside, as in a sheet that left the overlay root, stays where it is, and so
178
+ // does a focus in a sheet the overlay root holds for the exit transition. When that element is gone, also when it
179
+ // goes with the same update right after, and the last dialog closes over a sheet, the sheet takes it.
129
180
  var closeDialog = (0, _react.useCallback)(function (node) {
130
- var focusInside = node.contains(document.activeElement);
181
+ var focus = document.activeElement;
182
+ var focusHeld = isHeldStackHost(focus, overlayRootRef.current);
183
+ var focusInside = node.contains(focus) && !focusHeld;
131
184
  node.close();
132
185
  if (!focusInside) {
186
+ keepFocusOn(focus);
133
187
  return;
134
188
  }
135
189
  if (disableReturnFocusRef.current) {
@@ -217,24 +271,53 @@ var ModalRoot = exports.ModalRoot = /*#__PURE__*/(0, _react.forwardRef)(function
217
271
  restoreLostFocus();
218
272
  }
219
273
  });
220
- var finishClose = (0, _react.useCallback)(function () {
274
+ var leaveStack = (0, _react.useCallback)(function () {
275
+ if (stackIdRef.current !== undefined) {
276
+ (0, _modalRootStack.popModalRoot)(stackIdRef.current);
277
+ stackIdRef.current = undefined;
278
+ }
279
+ }, []);
280
+
281
+ // The closed dialog stays shown for its exit transition, and its content takes no input until it unmounts.
282
+ // Sheets in its overlay root stay there until the transition is done.
283
+ var releaseForExit = (0, _react.useCallback)(function () {
284
+ var node = dialogRef.current;
285
+ if (!node || exitingRef.current) {
286
+ return;
287
+ }
288
+ exitingRef.current = true;
221
289
  // A dialog that closes while suspended leaves the stack before the resume, so it drops its layer here.
222
- if (dialogRef.current) {
223
- dialogRef.current.style.zIndex = "";
290
+ node.style.zIndex = "";
291
+ if (stackIdRef.current !== undefined) {
292
+ (0, _modalRootStack.releaseModalRoot)(stackIdRef.current);
293
+ }
294
+
295
+ // Inert before close(), so a focus lock in a popup cannot take back the focus close() gives the opener.
296
+ setContentInert(contentRef.current, overlayRootRef.current, true);
297
+ if (node.open) {
298
+ closeDialog(node);
299
+ }
300
+ keepInTopLayer(node);
301
+ }, [closeDialog]);
302
+ var finishClose = (0, _react.useCallback)(function () {
303
+ var node = dialogRef.current;
304
+ exitingRef.current = false;
305
+ if (node) {
306
+ node.style.zIndex = "";
224
307
  }
225
308
 
226
309
  // Content that sits in the overlay root moves out before the dialog hides it.
227
- if (stackIdRef.current !== undefined) {
228
- (0, _modalRootStack.popModalRoot)(stackIdRef.current);
229
- stackIdRef.current = undefined;
310
+ leaveStack();
311
+ if (node !== null && node !== void 0 && node.open) {
312
+ closeDialog(node);
230
313
  }
231
- if (dialogRef.current) {
232
- closeDialog(dialogRef.current);
314
+ if (node) {
315
+ leaveTopLayer(node);
233
316
  }
234
317
  setMounted(false);
235
318
  setShownDialog(null);
236
319
  onClose === null || onClose === void 0 || onClose();
237
- }, [closeDialog, onClose]);
320
+ }, [closeDialog, leaveStack, onClose]);
238
321
 
239
322
  // The entry joins the stack with every showModal, so an owner that opens the dialog again from onClose, on the
240
323
  // same node, gets it back. It joins after showModal, so content that moves into the overlay root lands where it
@@ -243,14 +326,26 @@ var ModalRoot = exports.ModalRoot = /*#__PURE__*/(0, _react.forwardRef)(function
243
326
  if (!open || !dialog) {
244
327
  return;
245
328
  }
329
+ var reopenedDuringExit = exitingRef.current;
330
+ if (reopenedDuringExit) {
331
+ exitingRef.current = false;
332
+ leaveTopLayer(dialog);
333
+ setContentInert(contentRef.current, overlayRootRef.current, false);
334
+ }
246
335
  if (!dialog.open) {
247
336
  dialog.showModal();
248
337
  }
338
+ if (reopenedDuringExit && stackIdRef.current !== undefined && !(0, _modalRootStack.reopenModalRoot)(stackIdRef.current)) {
339
+ leaveStack();
340
+ }
341
+ if (reopenedDuringExit && !(0, _modalRootStack.areModalRootsSuspended)() && !dialog.contains(document.activeElement)) {
342
+ focusFirstFocusable(dialog, overlayRootRef.current);
343
+ }
249
344
  if (stackIdRef.current === undefined) {
250
345
  stackIdRef.current = (0, _modalRootStack.pushModalRoot)(overlayRootRef.current, suspensionRef.current, belowOpenSheets);
251
346
  }
252
347
  setShownDialog(dialog);
253
- }, [open, dialog, belowOpenSheets]);
348
+ }, [open, dialog, belowOpenSheets, leaveStack]);
254
349
 
255
350
  // showModal found no content to focus, so the dialog moves the focus in once the content is there, unless an
256
351
  // autoFocus field took it. A dialog that opened suspended stays out of the way of the overlay above it.
@@ -270,20 +365,23 @@ var ModalRoot = exports.ModalRoot = /*#__PURE__*/(0, _react.forwardRef)(function
270
365
  // opener: a dialog removed while open would leave it on the body.
271
366
  (0, _react.useLayoutEffect)(function () {
272
367
  return function () {
273
- if (stackIdRef.current !== undefined) {
274
- (0, _modalRootStack.popModalRoot)(stackIdRef.current);
275
- stackIdRef.current = undefined;
276
- }
368
+ exitingRef.current = false;
369
+ leaveStack();
277
370
  if (dialog !== null && dialog !== void 0 && dialog.open) {
278
371
  closeDialog(dialog);
279
372
  }
280
373
  };
281
- }, [dialog, closeDialog]);
374
+ }, [dialog, closeDialog, leaveStack]);
282
375
  (0, _react.useLayoutEffect)(function () {
283
- if (!open && mounted && !hasTransition) {
376
+ if (open || !mounted) {
377
+ return;
378
+ }
379
+ if (hasTransition) {
380
+ releaseForExit();
381
+ } else {
284
382
  finishClose();
285
383
  }
286
- }, [open, mounted, hasTransition, finishClose]);
384
+ }, [open, mounted, hasTransition, releaseForExit, finishClose]);
287
385
  var dismissRef = (0, _react.useRef)();
288
386
  dismissRef.current = function (reason, event) {
289
387
  if ((0, _modalRootStack.areModalRootsSuspended)()) {
@@ -478,9 +576,12 @@ var ModalRoot = exports.ModalRoot = /*#__PURE__*/(0, _react.forwardRef)(function
478
576
  onPointerDown: handlePointerDown,
479
577
  onClick: handleClick,
480
578
  onKeyDown: handleKeyDown
481
- }), /*#__PURE__*/_react.default.createElement(_helpers.PortalContainerProvider, {
579
+ }), /*#__PURE__*/_react.default.createElement("div", {
580
+ ref: contentRef,
581
+ className: "c-modal-root__content"
582
+ }, /*#__PURE__*/_react.default.createElement(_helpers.PortalContainerProvider, {
482
583
  value: getOverlayRoot
483
- }, content), /*#__PURE__*/_react.default.createElement("div", {
584
+ }, content)), /*#__PURE__*/_react.default.createElement("div", {
484
585
  ref: overlayRootRef,
485
586
  className: "c-modal-root__overlays"
486
587
  }))));
@@ -1 +1 @@
1
- {"version":3,"file":"ModalRoot.js","names":["_react","_interopRequireWildcard","require","_reactRemoveScroll","_classnames","_interopRequireDefault","_modalRootStack","_Styles","_helpers","_layers","_useForkRef","_excluded","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","_slicedToArray","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","a","_arrayLikeToArray","toString","slice","constructor","name","Array","from","test","l","Symbol","iterator","u","next","done","push","value","return","isArray","_objectWithoutProperties","_objectWithoutPropertiesLoose","getOwnPropertySymbols","indexOf","propertyIsEnumerable","FOCUSABLE","focusFirstFocusable","dialog","overlayRoot","querySelectorAll","some","candidate","contains","focus","document","activeElement","FOCUS_HISTORY_SIZE","isFocusable","element","isConnected","matches","checkVisibility","isFocusLost","body","closest","open","focusTopWindowIfLost","topLayer","getTopLayer","getTopModalRootId","undefined","preventScroll","ModalRoot","exports","forwardRef","_ref","ref","onRequestClose","onDismissBlocked","onClose","_ref$disableCloseOnEs","disableCloseOnEsc","_ref$disableBackgroun","disableBackgroundClick","_ref$disableScrollLoc","disableScrollLock","_ref$disableReturnFoc","disableReturnFocus","_ref$belowOpenSheets","belowOpenSheets","children","className","onPointerDown","onClick","onKeyDown","rest","_useState","useState","_useState2","mounted","setMounted","_useState3","_useState4","setDialog","dialogRef","useRef","setDialogNode","useCallback","node","current","handleRef","useForkRef","_useState5","_useState6","shownDialog","setShownDialog","contentShown","hasTransition","openRef","pressStartedOnBackdrop","stackIdRef","overlayRootRef","getOverlayRoot","disableReturnFocusRef","closeDialog","focusInside","close","_document$activeEleme","blur","requestAnimationFrame","focusHistoryRef","blurredRef","restoreLostFocus","stackId","blurred","isTopModalRoot","areModalRootsSuspended","restored","focusBeforeSuspendRef","suspensionRef","suspend","style","zIndex","String","layers","cloud","show","resume","showModal","HTMLElement","finishClose","popModalRoot","useLayoutEffect","pushModalRoot","dismissRef","reason","event","blocked","useEffect","handleKeyDown","_overlayRootRef$curre","_overlayRootRef$curre2","defaultPrevented","key","target","querySelector","preventDefault","_dismissRef$current","addEventListener","removeEventListener","handleCancel","_overlayRootRef$curre3","_dismissRef$current2","handleNativeClose","frame","scheduleRestore","handleFocusIn","filter","handleFocusOut","relatedTarget","observer","MutationObserver","observe","childList","subtree","unsubscribe","subscribeToModalRoots","disconnect","cancelAnimationFrame","handlePointerDown","currentTarget","handleClick","_dismissRef$current3","stopPropagation","_overlayRootRef$curre4","_dismissRef$current4","handleExited","content","in","onExited","createElement","Portal","RemoveScroll","forwardProps","enabled","noIsolation","StyledModalRoot","tabIndex","classnames","PortalContainerProvider","displayName"],"sources":["../../../../src/components/ModalRoot/ModalRoot.tsx"],"sourcesContent":["import React, {\n forwardRef,\n HTMLAttributes,\n KeyboardEvent as ReactKeyboardEvent,\n MouseEvent,\n PointerEvent,\n ReactNode,\n useCallback,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\";\nimport { RemoveScroll } from \"react-remove-scroll\";\n\nimport classnames from \"classnames\";\n\nimport {\n areModalRootsSuspended,\n getTopModalRootId,\n isTopModalRoot,\n ModalRootSuspension,\n popModalRoot,\n pushModalRoot,\n subscribeToModalRoots,\n} from \"./modalRootStack\";\nimport { StyledModalRoot } from \"./Styles\";\nimport { Portal, PortalContainerProvider } from \"../../helpers\";\nimport { getTopLayer, layers } from \"../../utils/layers\";\nimport useForkRef from \"../../utils/useForkRef\";\n\nexport type ModalRootDismissReason = \"escape\" | \"backdrop\";\n\nconst FOCUSABLE =\n \"button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), summary, iframe, audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), [tabindex]\";\n\n// What showModal does for content that was not there yet: the first node that takes the focus gets it, so a\n// disabled or hidden one is skipped as the browser skips it.\nconst focusFirstFocusable = (\n dialog: HTMLDialogElement,\n overlayRoot: HTMLElement | null\n) => {\n Array.from(dialog.querySelectorAll<HTMLElement>(FOCUSABLE)).some(\n (candidate) => {\n if (overlayRoot?.contains(candidate)) {\n return false;\n }\n\n candidate.focus();\n\n return document.activeElement === candidate;\n }\n );\n};\n\nconst FOCUS_HISTORY_SIZE = 5;\n\n// Neither removed, disabled nor hidden, so the element could take the focus back.\nconst isFocusable = (element: HTMLElement) =>\n element.isConnected &&\n element.matches(FOCUSABLE) &&\n // eslint-disable-next-line compat/compat\n (typeof element.checkVisibility !== \"function\" || element.checkVisibility());\n\n// A focused element that a closed dialog hides keeps the focus until the browser renders again.\nconst isFocusLost = () => {\n const focus = document.activeElement;\n\n if (!focus || focus === document.body || !focus.isConnected) {\n return true;\n }\n\n const dialog = focus.closest(\"dialog\");\n\n return dialog !== null && !dialog.open;\n};\n\n// A sheet is a window, not a dialog, so once the last dialog is closed nothing else takes a lost focus back.\nconst focusTopWindowIfLost = () => {\n const topLayer = getTopLayer();\n\n if (\n getTopModalRootId() === undefined &&\n isFocusLost() &&\n topLayer?.matches(\".c-window\")\n ) {\n topLayer.focus({ preventScroll: true });\n }\n};\n\nexport interface ModalRootTransition {\n in: boolean;\n onExited: () => void;\n}\n\nexport interface ModalRootProps\n extends Omit<\n HTMLAttributes<HTMLDialogElement>,\n \"children\" | \"open\" | \"onClose\" | \"onCancel\"\n > {\n open: boolean;\n /** Escape or a backdrop click asks the owner to set open to false */\n onRequestClose?: (reason: ModalRootDismissReason) => void;\n /** Escape or a backdrop click that disableCloseOnEsc or disableBackgroundClick blocked; a backdrop click passes its event */\n onDismissBlocked?: (\n reason: ModalRootDismissReason,\n event?: MouseEvent<HTMLDialogElement>\n ) => void;\n /** The exit transition is done and the dialog is closed */\n onClose?: () => void;\n disableCloseOnEsc?: boolean;\n disableBackgroundClick?: boolean;\n disableScrollLock?: boolean;\n /**\n * Closing leaves the focus off the element that had it before the dialog opened, also when the owner unmounts it.\n * An open dialog under it takes the focus itself.\n */\n disableReturnFocus?: boolean;\n /**\n * The dialog counts as opened before the sheets that are open, so they move into its overlay root and stay above\n * it. For a page dialog that a sheet covers, such as an archive that opens a task, also when the dialog mounts after\n * the sheet on a reload. A sheet that sits in the page mounts its content again in the overlay root; one that sits\n * in another modal moves without remounting, also above a modal opened in between from outside the sheet. Read when\n * the dialog opens; a later change does not move the stack entry.\n */\n belowOpenSheets?: boolean;\n /**\n * A function gets the transition state, and the dialog closes when it calls onExited. A node closes at once.\n * The content mounts once the dialog is open, a render after the dialog node, so an autoFocus field takes the focus;\n * an owner effect in the opening commit sees no content. It mounts again on every open, also when the owner reopens\n * the dialog from onClose, and loses its local state.\n */\n children: ReactNode | ((transition: ModalRootTransition) => ReactNode);\n}\n\nexport const ModalRoot = forwardRef<HTMLDialogElement, ModalRootProps>(\n (\n {\n open,\n onRequestClose,\n onDismissBlocked,\n onClose,\n disableCloseOnEsc = false,\n disableBackgroundClick = false,\n disableScrollLock = false,\n disableReturnFocus = false,\n belowOpenSheets = false,\n children,\n className,\n onPointerDown,\n onClick,\n onKeyDown,\n ...rest\n },\n ref\n ) => {\n const [mounted, setMounted] = useState(open);\n // Inside another root the dialog mounts a render after its first one, once the outer overlay root exists,\n // so opening, the stack and the listeners wait for the node instead of the first commit.\n const [dialog, setDialog] = useState<HTMLDialogElement | null>(null);\n const dialogRef = useRef<HTMLDialogElement | null>(null);\n const setDialogNode = useCallback((node: HTMLDialogElement | null) => {\n dialogRef.current = node;\n setDialog(node);\n }, []);\n const handleRef = useForkRef(setDialogNode, ref);\n // A closed dialog hides its content, and React focuses an autoFocus field while it mounts, so the content mounts\n // only once showModal ran on this node.\n const [shownDialog, setShownDialog] = useState<HTMLDialogElement | null>(\n null\n );\n const contentShown = dialog !== null && shownDialog === dialog;\n const hasTransition = typeof children === \"function\";\n const openRef = useRef(open);\n const pressStartedOnBackdrop = useRef(false);\n const stackIdRef = useRef<number>();\n const overlayRootRef = useRef<HTMLDivElement>(null);\n // Menus and pickers opened inside portal here, into the top layer with the dialog, not under it.\n const getOverlayRoot = useCallback(\n () => overlayRootRef.current as HTMLElement,\n []\n );\n\n openRef.current = open;\n const disableReturnFocusRef = useRef(disableReturnFocus);\n disableReturnFocusRef.current = disableReturnFocus;\n\n // close() gives the focus back to the element that had it before showModal when the focus is in the dialog, so\n // a dialog that leaves it there takes it off again. A focus outside, as in a sheet that left the overlay root,\n // stays where it is. When that element is gone, also when it goes with the same update right after, and the\n // last dialog closes over a sheet, the sheet takes it.\n const closeDialog = useCallback((node: HTMLDialogElement) => {\n const focusInside = node.contains(document.activeElement);\n node.close();\n\n if (!focusInside) {\n return;\n }\n\n if (disableReturnFocusRef.current) {\n (document.activeElement as HTMLElement | null)?.blur();\n\n return;\n }\n\n focusTopWindowIfLost();\n requestAnimationFrame(focusTopWindowIfLost);\n }, []);\n\n const focusHistoryRef = useRef<HTMLElement[]>([]);\n const blurredRef = useRef<HTMLElement | null>(null);\n\n // The browser drops the focus to the body when the focused element goes, as a toast that closes or a button that\n // another replaces, so the top dialog takes it back: on the newest element focused before that is still there, or\n // on itself. A layer in front of it, such as a sheet in the overlay root, keeps its own focus. A field that blurs\n // itself, as on Escape or Enter, can still take the focus, so it let it go on purpose and the dialog takes it.\n const restoreLostFocus = useCallback(() => {\n const node = dialogRef.current;\n const stackId = stackIdRef.current;\n const blurred = blurredRef.current;\n blurredRef.current = null;\n\n if (\n !node?.open ||\n stackId === undefined ||\n !isTopModalRoot(stackId) ||\n areModalRootsSuspended() ||\n !isFocusLost() ||\n getTopLayer() !== node\n ) {\n return;\n }\n\n if (blurred && node.contains(blurred) && isFocusable(blurred)) {\n node.focus({ preventScroll: true });\n\n return;\n }\n\n const restored = focusHistoryRef.current.some((candidate) => {\n if (!candidate.isConnected || !node.contains(candidate)) {\n return false;\n }\n\n candidate.focus({ preventScroll: true });\n\n return document.activeElement === candidate;\n });\n\n if (!restored) {\n node.focus({ preventScroll: true });\n }\n }, []);\n\n if (open && !mounted) {\n setMounted(true);\n }\n\n // While suspended the dialog is open without being modal, in the page instead of the top layer, so it keeps a\n // layer just under the overlay it was suspended for. A dismiss then would close it under that overlay.\n // The stack calls suspend once for an entry and resume at most once, so the suspension is the stack's state.\n const focusBeforeSuspendRef = useRef<Element | null>(null);\n const suspensionRef = useRef<ModalRootSuspension>({\n suspend: () => {\n const node = dialogRef.current;\n\n if (!node) {\n return;\n }\n\n focusBeforeSuspendRef.current = node.contains(document.activeElement)\n ? document.activeElement\n : null;\n node.style.zIndex = String(layers.cloud - 1);\n\n if (node.open) {\n node.close();\n node.show();\n }\n },\n resume: () => {\n const node = dialogRef.current;\n\n if (!node) {\n return;\n }\n\n node.style.zIndex = \"\";\n\n if (node.open) {\n node.close();\n node.showModal();\n }\n\n const focus = focusBeforeSuspendRef.current;\n focusBeforeSuspendRef.current = null;\n\n if (focus instanceof HTMLElement && node.contains(focus)) {\n focus.focus({ preventScroll: true });\n }\n\n restoreLostFocus();\n },\n });\n\n const finishClose = useCallback(() => {\n // A dialog that closes while suspended leaves the stack before the resume, so it drops its layer here.\n if (dialogRef.current) {\n dialogRef.current.style.zIndex = \"\";\n }\n\n // Content that sits in the overlay root moves out before the dialog hides it.\n if (stackIdRef.current !== undefined) {\n popModalRoot(stackIdRef.current);\n stackIdRef.current = undefined;\n }\n if (dialogRef.current) {\n closeDialog(dialogRef.current);\n }\n setMounted(false);\n setShownDialog(null);\n onClose?.();\n }, [closeDialog, onClose]);\n\n // The entry joins the stack with every showModal, so an owner that opens the dialog again from onClose, on the\n // same node, gets it back. It joins after showModal, so content that moves into the overlay root lands where it\n // is rendered and can get its scroll positions back.\n useLayoutEffect(() => {\n if (!open || !dialog) {\n return;\n }\n\n if (!dialog.open) {\n dialog.showModal();\n }\n\n if (stackIdRef.current === undefined) {\n stackIdRef.current = pushModalRoot(\n overlayRootRef.current,\n suspensionRef.current,\n belowOpenSheets\n );\n }\n\n setShownDialog(dialog);\n }, [open, dialog, belowOpenSheets]);\n\n // showModal found no content to focus, so the dialog moves the focus in once the content is there, unless an\n // autoFocus field took it. A dialog that opened suspended stays out of the way of the overlay above it.\n useLayoutEffect(() => {\n if (!contentShown || !dialog || areModalRootsSuspended()) {\n return;\n }\n\n const focus = document.activeElement;\n\n if (focus !== dialog && dialog.contains(focus)) {\n return;\n }\n\n focusFirstFocusable(dialog, overlayRootRef.current);\n }, [contentShown, dialog]);\n\n // A layout effect, so the entry leaves the stack before an unmount removes the dialog and its overlay root.\n // An owner that unmounts the dialog while it is open, as a form does on submit, gets the focus back on the\n // opener: a dialog removed while open would leave it on the body.\n useLayoutEffect(\n () => () => {\n if (stackIdRef.current !== undefined) {\n popModalRoot(stackIdRef.current);\n stackIdRef.current = undefined;\n }\n\n if (dialog?.open) {\n closeDialog(dialog);\n }\n },\n [dialog, closeDialog]\n );\n\n useLayoutEffect(() => {\n if (!open && mounted && !hasTransition) {\n finishClose();\n }\n }, [open, mounted, hasTransition, finishClose]);\n\n const dismissRef =\n useRef<\n (\n reason: ModalRootDismissReason,\n event?: MouseEvent<HTMLDialogElement>\n ) => void\n >();\n\n dismissRef.current = (reason, event) => {\n if (areModalRootsSuspended()) {\n return;\n }\n\n const blocked =\n reason === \"escape\" ? disableCloseOnEsc : disableBackgroundClick;\n\n if (blocked) {\n onDismissBlocked?.(reason, event);\n } else {\n onRequestClose?.(reason);\n }\n };\n\n // A prevented Escape keydown starts no close request, and the browser stops honouring a prevented cancel\n // after a while, so Escape is caught here and the cancel event only covers the other close requests.\n useEffect(() => {\n if (!dialog) {\n return undefined;\n }\n\n const handleKeyDown = (event: KeyboardEvent) => {\n const stackId = stackIdRef.current;\n\n if (\n stackId === undefined ||\n !isTopModalRoot(stackId) ||\n event.defaultPrevented ||\n (event.key !== \"Escape\" && event.key !== \"Esc\")\n ) {\n return;\n }\n\n // A menu inside closes on an Escape that reaches the body, from a listener that runs after this one.\n if (\n event.target === document.body &&\n overlayRootRef.current?.querySelector(\".c-window\")\n ) {\n return;\n }\n\n event.preventDefault();\n\n // A sheet, a menu or the chat in the overlay root is a layer above the dialog. An Escape it did not take\n // still belongs to it, so the dialog only stops the browser from closing itself.\n if (overlayRootRef.current?.contains(event.target as Node)) {\n return;\n }\n\n if (openRef.current) {\n dismissRef.current?.(\"escape\");\n }\n };\n\n document.addEventListener(\"keydown\", handleKeyDown);\n\n return () => document.removeEventListener(\"keydown\", handleKeyDown);\n }, [dialog]);\n\n useEffect(() => {\n if (!dialog) {\n return undefined;\n }\n\n const handleCancel = (event: Event) => {\n event.preventDefault();\n\n // A layer in the overlay root may stop its Escape before the document sees it, so the cancel that follows\n // would close the dialog under the layer. While the focus is in that layer, the close request is its own.\n if (overlayRootRef.current?.contains(document.activeElement)) {\n return;\n }\n\n if (openRef.current) {\n dismissRef.current?.(\"escape\");\n }\n };\n\n const handleNativeClose = () => {\n if (\n openRef.current &&\n dialog.isConnected &&\n !dialog.open &&\n !areModalRootsSuspended()\n ) {\n dialog.showModal();\n }\n };\n\n dialog.addEventListener(\"cancel\", handleCancel);\n dialog.addEventListener(\"close\", handleNativeClose);\n\n return () => {\n dialog.removeEventListener(\"cancel\", handleCancel);\n dialog.removeEventListener(\"close\", handleNativeClose);\n };\n }, [dialog]);\n\n // The check waits a frame, so a close() that gives the focus back to an opener runs first. A modal root above\n // leaves the stack before its close(), and may sit outside this dialog, so the stack starts the check too.\n useEffect(() => {\n if (!dialog) {\n return undefined;\n }\n\n let frame: number | undefined;\n\n const scheduleRestore = () => {\n if (frame === undefined) {\n frame = requestAnimationFrame(() => {\n frame = undefined;\n restoreLostFocus();\n });\n }\n };\n\n const handleFocusIn = (event: FocusEvent) => {\n const target = event.target;\n\n if (target instanceof HTMLElement && target !== dialog) {\n focusHistoryRef.current = [\n target,\n ...focusHistoryRef.current.filter((element) => element !== target),\n ].slice(0, FOCUS_HISTORY_SIZE);\n }\n };\n\n const handleFocusOut = (event: FocusEvent) => {\n if (!event.relatedTarget) {\n blurredRef.current =\n event.target instanceof HTMLElement ? event.target : null;\n scheduleRestore();\n }\n };\n\n const observer = new MutationObserver(scheduleRestore);\n\n observer.observe(dialog, { childList: true, subtree: true });\n dialog.addEventListener(\"focusin\", handleFocusIn);\n dialog.addEventListener(\"focusout\", handleFocusOut);\n const unsubscribe = subscribeToModalRoots(scheduleRestore);\n\n return () => {\n unsubscribe();\n observer.disconnect();\n dialog.removeEventListener(\"focusin\", handleFocusIn);\n dialog.removeEventListener(\"focusout\", handleFocusOut);\n\n if (frame !== undefined) {\n cancelAnimationFrame(frame);\n }\n };\n }, [dialog, restoreLostFocus]);\n\n const handlePointerDown = useCallback(\n (event: PointerEvent<HTMLDialogElement>) => {\n pressStartedOnBackdrop.current = event.target === event.currentTarget;\n onPointerDown?.(event);\n },\n [onPointerDown]\n );\n\n // The dialog covers the viewport and its content sits inside it, so a click on the dialog itself is a\n // click on the backdrop. A press that started on the content and ended outside it is a text selection.\n // A click does not bubble on through the React tree, as from a legacy window: a confirmation rendered in a\n // clickable row would otherwise click the row as well. React listens at the portal's container, so a click\n // listener on document or window does not see a click inside the dialog either, as with the window.\n const handleClick = useCallback(\n (event: MouseEvent<HTMLDialogElement>) => {\n if (\n event.target === event.currentTarget &&\n pressStartedOnBackdrop.current &&\n openRef.current\n ) {\n dismissRef.current?.(\"backdrop\", event);\n }\n pressStartedOnBackdrop.current = false;\n onClick?.(event);\n event.stopPropagation();\n },\n [onClick]\n );\n\n // React events from a portal bubble through the React tree, so an Escape from the content would reach an\n // ancestor's handler, like an older Sheet's, before the document listener. The dialog takes it here first.\n const handleKeyDown = useCallback(\n (event: ReactKeyboardEvent<HTMLDialogElement>) => {\n onKeyDown?.(event);\n\n if (\n event.defaultPrevented ||\n (event.key !== \"Escape\" && event.key !== \"Esc\") ||\n stackIdRef.current === undefined ||\n !isTopModalRoot(stackIdRef.current)\n ) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n // An Escape a layer in the overlay root did not take stops here too, so it does not close the sheet that\n // opened this dialog, but it leaves the dialog open.\n if (overlayRootRef.current?.contains(event.target as Node)) {\n return;\n }\n\n if (openRef.current) {\n dismissRef.current?.(\"escape\");\n }\n },\n [onKeyDown]\n );\n\n const handleExited = useCallback(() => {\n if (!open) {\n finishClose();\n }\n }, [open, finishClose]);\n\n if (!mounted) {\n return null;\n }\n\n let content: ReactNode = null;\n\n if (contentShown) {\n content =\n typeof children === \"function\"\n ? children({ in: open, onExited: handleExited })\n : children;\n }\n\n return (\n <Portal>\n <RemoveScroll\n forwardProps\n ref={handleRef}\n enabled={!disableScrollLock}\n noIsolation\n >\n <StyledModalRoot\n tabIndex={-1}\n {...rest}\n className={classnames(\"c-modal-root\", className)}\n data-state={open ? \"open\" : \"closing\"}\n onPointerDown={handlePointerDown}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n >\n <PortalContainerProvider value={getOverlayRoot}>\n {content}\n </PortalContainerProvider>\n <div ref={overlayRootRef} className=\"c-modal-root__overlays\" />\n </StyledModalRoot>\n </RemoveScroll>\n </Portal>\n );\n }\n);\n\nModalRoot.displayName = \"ModalRoot\";\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAaA,IAAAC,kBAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,eAAA,GAAAJ,OAAA;AASA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP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interopRequireWildcard","require","_reactRemoveScroll","_classnames","_interopRequireDefault","_modalRootStack","_Styles","_useModalStackHost","_helpers","_layers","_useForkRef","_excluded","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","_slicedToArray","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","a","_arrayLikeToArray","toString","slice","constructor","name","Array","from","test","l","Symbol","iterator","u","next","done","push","value","return","isArray","_objectWithoutProperties","_objectWithoutPropertiesLoose","getOwnPropertySymbols","indexOf","propertyIsEnumerable","FOCUSABLE","focusFirstFocusable","dialog","overlayRoot","querySelectorAll","some","candidate","contains","focus","document","activeElement","FOCUS_HISTORY_SIZE","isFocusable","element","isConnected","matches","checkVisibility","isFocusLost","body","closest","layer","HTMLDialogElement","open","focusTopWindowIfLost","topLayer","getTopLayer","getTopModalRootId","undefined","preventScroll","keepFocusOn","HTMLElement","keepInTopLayer","node","showPopover","setAttribute","blur","leaveTopLayer","hasAttribute","hidePopover","removeAttribute","isHeldStackHost","_element$closest","concat","MODAL_STACK_HOST_ATTRIBUTE","parentElement","setContentInert","content","inert","_overlayRoot$children","toggleAttribute","children","forEach","child","ModalRoot","exports","forwardRef","_ref","ref","onRequestClose","onDismissBlocked","onClose","_ref$disableCloseOnEs","disableCloseOnEsc","_ref$disableBackgroun","disableBackgroundClick","_ref$disableScrollLoc","disableScrollLock","_ref$disableReturnFoc","disableReturnFocus","_ref$belowOpenSheets","belowOpenSheets","className","onPointerDown","onClick","onKeyDown","rest","_useState","useState","_useState2","mounted","setMounted","_useState3","_useState4","setDialog","dialogRef","useRef","setDialogNode","useCallback","current","handleRef","useForkRef","_useState5","_useState6","shownDialog","setShownDialog","contentShown","hasTransition","openRef","pressStartedOnBackdrop","stackIdRef","exitingRef","contentRef","overlayRootRef","getOverlayRoot","disableReturnFocusRef","closeDialog","focusHeld","focusInside","close","_document$activeEleme","requestAnimationFrame","focusHistoryRef","blurredRef","restoreLostFocus","stackId","blurred","isTopModalRoot","areModalRootsSuspended","restored","focusBeforeSuspendRef","suspensionRef","suspend","style","zIndex","String","layers","cloud","show","resume","showModal","leaveStack","popModalRoot","releaseForExit","releaseModalRoot","finishClose","useLayoutEffect","reopenedDuringExit","reopenModalRoot","pushModalRoot","dismissRef","reason","event","blocked","useEffect","handleKeyDown","_overlayRootRef$curre","_overlayRootRef$curre2","defaultPrevented","key","target","querySelector","preventDefault","_dismissRef$current","addEventListener","removeEventListener","handleCancel","_overlayRootRef$curre3","_dismissRef$current2","handleNativeClose","frame","scheduleRestore","handleFocusIn","filter","handleFocusOut","relatedTarget","observer","MutationObserver","observe","childList","subtree","unsubscribe","subscribeToModalRoots","disconnect","cancelAnimationFrame","handlePointerDown","currentTarget","handleClick","_dismissRef$current3","stopPropagation","_overlayRootRef$curre4","_dismissRef$current4","handleExited","in","onExited","createElement","Portal","RemoveScroll","forwardProps","enabled","noIsolation","StyledModalRoot","tabIndex","classnames","PortalContainerProvider","displayName"],"sources":["../../../../src/components/ModalRoot/ModalRoot.tsx"],"sourcesContent":["import React, {\n forwardRef,\n HTMLAttributes,\n KeyboardEvent as ReactKeyboardEvent,\n MouseEvent,\n PointerEvent,\n ReactNode,\n useCallback,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\";\nimport { RemoveScroll } from \"react-remove-scroll\";\n\nimport classnames from \"classnames\";\n\nimport {\n areModalRootsSuspended,\n getTopModalRootId,\n isTopModalRoot,\n ModalRootSuspension,\n popModalRoot,\n pushModalRoot,\n releaseModalRoot,\n reopenModalRoot,\n subscribeToModalRoots,\n} from \"./modalRootStack\";\nimport { StyledModalRoot } from \"./Styles\";\nimport { MODAL_STACK_HOST_ATTRIBUTE } from \"./useModalStackHost\";\nimport { Portal, PortalContainerProvider } from \"../../helpers\";\nimport { getTopLayer, layers } from \"../../utils/layers\";\nimport useForkRef from \"../../utils/useForkRef\";\n\nexport type ModalRootDismissReason = \"escape\" | \"backdrop\";\n\nconst FOCUSABLE =\n \"button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), summary, iframe, audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), [tabindex]\";\n\n// What showModal does for content that was not there yet: the first node that takes the focus gets it, so a\n// disabled or hidden one is skipped as the browser skips it.\nconst focusFirstFocusable = (\n dialog: HTMLDialogElement,\n overlayRoot: HTMLElement | null\n) => {\n Array.from(dialog.querySelectorAll<HTMLElement>(FOCUSABLE)).some(\n (candidate) => {\n if (overlayRoot?.contains(candidate)) {\n return false;\n }\n\n candidate.focus();\n\n return document.activeElement === candidate;\n }\n );\n};\n\nconst FOCUS_HISTORY_SIZE = 5;\n\n// Neither removed, disabled nor hidden, so the element could take the focus back.\nconst isFocusable = (element: HTMLElement) =>\n element.isConnected &&\n element.matches(FOCUSABLE) &&\n // eslint-disable-next-line compat/compat\n (typeof element.checkVisibility !== \"function\" || element.checkVisibility());\n\n// A focused element that a closed dialog hides, or that turned inert, keeps the focus until the browser renders again.\nconst isFocusLost = () => {\n const focus = document.activeElement;\n\n if (\n !focus ||\n focus === document.body ||\n !focus.isConnected ||\n focus.closest(\"[inert]\")\n ) {\n return true;\n }\n\n const layer = focus.closest(\"dialog, .c-window\");\n\n return layer instanceof HTMLDialogElement && !layer.open;\n};\n\n// A sheet is a window, not a dialog, so once the last dialog is closed nothing else takes a lost focus back.\nconst focusTopWindowIfLost = () => {\n const topLayer = getTopLayer();\n\n if (\n getTopModalRootId() === undefined &&\n isFocusLost() &&\n topLayer?.matches(\".c-window\")\n ) {\n topLayer.focus({ preventScroll: true });\n }\n};\n\nconst keepFocusOn = (element: Element | null) => {\n if (\n element instanceof HTMLElement &&\n element !== document.body &&\n element.isConnected &&\n document.activeElement !== element\n ) {\n element.focus({ preventScroll: true });\n }\n};\n\n// A closed dialog shown as a manual popover stays in the top layer without blocking the page. showPopover focuses a\n// dialog, so the focus goes back to where close() left it.\nconst keepInTopLayer = (node: HTMLDialogElement) => {\n if (typeof node.showPopover !== \"function\") {\n return;\n }\n\n const focus = document.activeElement;\n node.setAttribute(\"popover\", \"manual\");\n // eslint-disable-next-line compat/compat\n node.showPopover();\n\n keepFocusOn(focus);\n\n if (\n document.activeElement !== focus &&\n node.contains(document.activeElement)\n ) {\n (document.activeElement as HTMLElement).blur();\n }\n};\n\nconst leaveTopLayer = (node: HTMLDialogElement) => {\n if (!node.hasAttribute(\"popover\")) {\n return;\n }\n\n if (node.matches(\":popover-open\")) {\n // eslint-disable-next-line compat/compat\n node.hidePopover();\n }\n node.removeAttribute(\"popover\");\n};\n\nconst isHeldStackHost = (\n element: Element | null,\n overlayRoot: Element | null\n) =>\n !!overlayRoot &&\n element?.closest(`[${MODAL_STACK_HOST_ATTRIBUTE}]`)?.parentElement ===\n overlayRoot;\n\n// Popups of the content sit in the overlay root next to the stack hosts and leave with the content.\nconst setContentInert = (\n content: Element | null,\n overlayRoot: Element | null,\n inert: boolean\n) => {\n content?.toggleAttribute(\"inert\", inert);\n Array.from(overlayRoot?.children ?? []).forEach((child) => {\n if (!child.hasAttribute(MODAL_STACK_HOST_ATTRIBUTE)) {\n child.toggleAttribute(\"inert\", inert);\n }\n });\n};\n\nexport interface ModalRootTransition {\n in: boolean;\n onExited: () => void;\n}\n\nexport interface ModalRootProps\n extends Omit<\n HTMLAttributes<HTMLDialogElement>,\n \"children\" | \"open\" | \"onClose\" | \"onCancel\"\n > {\n open: boolean;\n /** Escape or a backdrop click asks the owner to set open to false */\n onRequestClose?: (reason: ModalRootDismissReason) => void;\n /** Escape or a backdrop click that disableCloseOnEsc or disableBackgroundClick blocked; a backdrop click passes its event */\n onDismissBlocked?: (\n reason: ModalRootDismissReason,\n event?: MouseEvent<HTMLDialogElement>\n ) => void;\n /** The exit transition is done and the dialog is closed */\n onClose?: () => void;\n disableCloseOnEsc?: boolean;\n disableBackgroundClick?: boolean;\n disableScrollLock?: boolean;\n /**\n * Closing leaves the focus off the element that had it before the dialog opened, also when the owner unmounts it.\n * An open dialog under it takes the focus itself.\n */\n disableReturnFocus?: boolean;\n /**\n * The dialog counts as opened before the sheets that are open, so they move into its overlay root and stay above\n * it. For a page dialog that a sheet covers, such as an archive that opens a task, also when the dialog mounts after\n * the sheet on a reload. A sheet that sits in the page mounts its content again in the overlay root; one that sits\n * in another modal moves without remounting, also above a modal opened in between from outside the sheet. Read when\n * the dialog opens; a later change does not move the stack entry.\n */\n belowOpenSheets?: boolean;\n /**\n * A function gets the transition state. The dialog closes, gives the focus back and turns inert as the exit\n * starts, stays shown for the transition, and unmounts when it calls onExited. A node closes at once.\n * The content mounts once the dialog is open, a render after the dialog node, so an autoFocus field takes the focus;\n * an owner effect in the opening commit sees no content. It mounts again on every open, also when the owner reopens\n * the dialog from onClose, and loses its local state.\n */\n children: ReactNode | ((transition: ModalRootTransition) => ReactNode);\n}\n\nexport const ModalRoot = forwardRef<HTMLDialogElement, ModalRootProps>(\n (\n {\n open,\n onRequestClose,\n onDismissBlocked,\n onClose,\n disableCloseOnEsc = false,\n disableBackgroundClick = false,\n disableScrollLock = false,\n disableReturnFocus = false,\n belowOpenSheets = false,\n children,\n className,\n onPointerDown,\n onClick,\n onKeyDown,\n ...rest\n },\n ref\n ) => {\n const [mounted, setMounted] = useState(open);\n // Inside another root the dialog mounts a render after its first one, once the outer overlay root exists,\n // so opening, the stack and the listeners wait for the node instead of the first commit.\n const [dialog, setDialog] = useState<HTMLDialogElement | null>(null);\n const dialogRef = useRef<HTMLDialogElement | null>(null);\n const setDialogNode = useCallback((node: HTMLDialogElement | null) => {\n dialogRef.current = node;\n setDialog(node);\n }, []);\n const handleRef = useForkRef(setDialogNode, ref);\n // A closed dialog hides its content, and React focuses an autoFocus field while it mounts, so the content mounts\n // only once showModal ran on this node.\n const [shownDialog, setShownDialog] = useState<HTMLDialogElement | null>(\n null\n );\n const contentShown = dialog !== null && shownDialog === dialog;\n const hasTransition = typeof children === \"function\";\n const openRef = useRef(open);\n const pressStartedOnBackdrop = useRef(false);\n const stackIdRef = useRef<number>();\n const exitingRef = useRef(false);\n const contentRef = useRef<HTMLDivElement>(null);\n const overlayRootRef = useRef<HTMLDivElement>(null);\n // Menus and pickers opened inside portal here, into the top layer with the dialog, not under it.\n const getOverlayRoot = useCallback(\n () => overlayRootRef.current as HTMLElement,\n []\n );\n\n openRef.current = open;\n const disableReturnFocusRef = useRef(disableReturnFocus);\n disableReturnFocusRef.current = disableReturnFocus;\n\n // close() of a modal gives the focus back to the element that had it before showModal, so a dialog that leaves it\n // there takes it off again. A focus outside, as in a sheet that left the overlay root, stays where it is, and so\n // does a focus in a sheet the overlay root holds for the exit transition. When that element is gone, also when it\n // goes with the same update right after, and the last dialog closes over a sheet, the sheet takes it.\n const closeDialog = useCallback((node: HTMLDialogElement) => {\n const focus = document.activeElement;\n const focusHeld = isHeldStackHost(focus, overlayRootRef.current);\n const focusInside = node.contains(focus) && !focusHeld;\n node.close();\n\n if (!focusInside) {\n keepFocusOn(focus);\n\n return;\n }\n\n if (disableReturnFocusRef.current) {\n (document.activeElement as HTMLElement | null)?.blur();\n\n return;\n }\n\n focusTopWindowIfLost();\n requestAnimationFrame(focusTopWindowIfLost);\n }, []);\n\n const focusHistoryRef = useRef<HTMLElement[]>([]);\n const blurredRef = useRef<HTMLElement | null>(null);\n\n // The browser drops the focus to the body when the focused element goes, as a toast that closes or a button that\n // another replaces, so the top dialog takes it back: on the newest element focused before that is still there, or\n // on itself. A layer in front of it, such as a sheet in the overlay root, keeps its own focus. A field that blurs\n // itself, as on Escape or Enter, can still take the focus, so it let it go on purpose and the dialog takes it.\n const restoreLostFocus = useCallback(() => {\n const node = dialogRef.current;\n const stackId = stackIdRef.current;\n const blurred = blurredRef.current;\n blurredRef.current = null;\n\n if (\n !node?.open ||\n stackId === undefined ||\n !isTopModalRoot(stackId) ||\n areModalRootsSuspended() ||\n !isFocusLost() ||\n getTopLayer() !== node\n ) {\n return;\n }\n\n if (blurred && node.contains(blurred) && isFocusable(blurred)) {\n node.focus({ preventScroll: true });\n\n return;\n }\n\n const restored = focusHistoryRef.current.some((candidate) => {\n if (!candidate.isConnected || !node.contains(candidate)) {\n return false;\n }\n\n candidate.focus({ preventScroll: true });\n\n return document.activeElement === candidate;\n });\n\n if (!restored) {\n node.focus({ preventScroll: true });\n }\n }, []);\n\n if (open && !mounted) {\n setMounted(true);\n }\n\n // While suspended the dialog is open without being modal, in the page instead of the top layer, so it keeps a\n // layer just under the overlay it was suspended for. A dismiss then would close it under that overlay.\n // The stack calls suspend once for an entry and resume at most once, so the suspension is the stack's state.\n const focusBeforeSuspendRef = useRef<Element | null>(null);\n const suspensionRef = useRef<ModalRootSuspension>({\n suspend: () => {\n const node = dialogRef.current;\n\n if (!node) {\n return;\n }\n\n focusBeforeSuspendRef.current = node.contains(document.activeElement)\n ? document.activeElement\n : null;\n node.style.zIndex = String(layers.cloud - 1);\n\n if (node.open) {\n node.close();\n node.show();\n }\n },\n resume: () => {\n const node = dialogRef.current;\n\n if (!node) {\n return;\n }\n\n node.style.zIndex = \"\";\n\n if (node.open) {\n node.close();\n node.showModal();\n }\n\n const focus = focusBeforeSuspendRef.current;\n focusBeforeSuspendRef.current = null;\n\n if (focus instanceof HTMLElement && node.contains(focus)) {\n focus.focus({ preventScroll: true });\n }\n\n restoreLostFocus();\n },\n });\n\n const leaveStack = useCallback(() => {\n if (stackIdRef.current !== undefined) {\n popModalRoot(stackIdRef.current);\n stackIdRef.current = undefined;\n }\n }, []);\n\n // The closed dialog stays shown for its exit transition, and its content takes no input until it unmounts.\n // Sheets in its overlay root stay there until the transition is done.\n const releaseForExit = useCallback(() => {\n const node = dialogRef.current;\n\n if (!node || exitingRef.current) {\n return;\n }\n\n exitingRef.current = true;\n // A dialog that closes while suspended leaves the stack before the resume, so it drops its layer here.\n node.style.zIndex = \"\";\n\n if (stackIdRef.current !== undefined) {\n releaseModalRoot(stackIdRef.current);\n }\n\n // Inert before close(), so a focus lock in a popup cannot take back the focus close() gives the opener.\n setContentInert(contentRef.current, overlayRootRef.current, true);\n\n if (node.open) {\n closeDialog(node);\n }\n\n keepInTopLayer(node);\n }, [closeDialog]);\n\n const finishClose = useCallback(() => {\n const node = dialogRef.current;\n\n exitingRef.current = false;\n\n if (node) {\n node.style.zIndex = \"\";\n }\n\n // Content that sits in the overlay root moves out before the dialog hides it.\n leaveStack();\n\n if (node?.open) {\n closeDialog(node);\n }\n\n if (node) {\n leaveTopLayer(node);\n }\n setMounted(false);\n setShownDialog(null);\n onClose?.();\n }, [closeDialog, leaveStack, onClose]);\n\n // The entry joins the stack with every showModal, so an owner that opens the dialog again from onClose, on the\n // same node, gets it back. It joins after showModal, so content that moves into the overlay root lands where it\n // is rendered and can get its scroll positions back.\n useLayoutEffect(() => {\n if (!open || !dialog) {\n return;\n }\n\n const reopenedDuringExit = exitingRef.current;\n\n if (reopenedDuringExit) {\n exitingRef.current = false;\n leaveTopLayer(dialog);\n setContentInert(contentRef.current, overlayRootRef.current, false);\n }\n\n if (!dialog.open) {\n dialog.showModal();\n }\n\n if (\n reopenedDuringExit &&\n stackIdRef.current !== undefined &&\n !reopenModalRoot(stackIdRef.current)\n ) {\n leaveStack();\n }\n\n if (\n reopenedDuringExit &&\n !areModalRootsSuspended() &&\n !dialog.contains(document.activeElement)\n ) {\n focusFirstFocusable(dialog, overlayRootRef.current);\n }\n\n if (stackIdRef.current === undefined) {\n stackIdRef.current = pushModalRoot(\n overlayRootRef.current,\n suspensionRef.current,\n belowOpenSheets\n );\n }\n\n setShownDialog(dialog);\n }, [open, dialog, belowOpenSheets, leaveStack]);\n\n // showModal found no content to focus, so the dialog moves the focus in once the content is there, unless an\n // autoFocus field took it. A dialog that opened suspended stays out of the way of the overlay above it.\n useLayoutEffect(() => {\n if (!contentShown || !dialog || areModalRootsSuspended()) {\n return;\n }\n\n const focus = document.activeElement;\n\n if (focus !== dialog && dialog.contains(focus)) {\n return;\n }\n\n focusFirstFocusable(dialog, overlayRootRef.current);\n }, [contentShown, dialog]);\n\n // A layout effect, so the entry leaves the stack before an unmount removes the dialog and its overlay root.\n // An owner that unmounts the dialog while it is open, as a form does on submit, gets the focus back on the\n // opener: a dialog removed while open would leave it on the body.\n useLayoutEffect(\n () => () => {\n exitingRef.current = false;\n leaveStack();\n\n if (dialog?.open) {\n closeDialog(dialog);\n }\n },\n [dialog, closeDialog, leaveStack]\n );\n\n useLayoutEffect(() => {\n if (open || !mounted) {\n return;\n }\n\n if (hasTransition) {\n releaseForExit();\n } else {\n finishClose();\n }\n }, [open, mounted, hasTransition, releaseForExit, finishClose]);\n\n const dismissRef =\n useRef<\n (\n reason: ModalRootDismissReason,\n event?: MouseEvent<HTMLDialogElement>\n ) => void\n >();\n\n dismissRef.current = (reason, event) => {\n if (areModalRootsSuspended()) {\n return;\n }\n\n const blocked =\n reason === \"escape\" ? disableCloseOnEsc : disableBackgroundClick;\n\n if (blocked) {\n onDismissBlocked?.(reason, event);\n } else {\n onRequestClose?.(reason);\n }\n };\n\n // A prevented Escape keydown starts no close request, and the browser stops honouring a prevented cancel\n // after a while, so Escape is caught here and the cancel event only covers the other close requests.\n useEffect(() => {\n if (!dialog) {\n return undefined;\n }\n\n const handleKeyDown = (event: KeyboardEvent) => {\n const stackId = stackIdRef.current;\n\n if (\n stackId === undefined ||\n !isTopModalRoot(stackId) ||\n event.defaultPrevented ||\n (event.key !== \"Escape\" && event.key !== \"Esc\")\n ) {\n return;\n }\n\n // A menu inside closes on an Escape that reaches the body, from a listener that runs after this one.\n if (\n event.target === document.body &&\n overlayRootRef.current?.querySelector(\".c-window\")\n ) {\n return;\n }\n\n event.preventDefault();\n\n // A sheet, a menu or the chat in the overlay root is a layer above the dialog. An Escape it did not take\n // still belongs to it, so the dialog only stops the browser from closing itself.\n if (overlayRootRef.current?.contains(event.target as Node)) {\n return;\n }\n\n if (openRef.current) {\n dismissRef.current?.(\"escape\");\n }\n };\n\n document.addEventListener(\"keydown\", handleKeyDown);\n\n return () => document.removeEventListener(\"keydown\", handleKeyDown);\n }, [dialog]);\n\n useEffect(() => {\n if (!dialog) {\n return undefined;\n }\n\n const handleCancel = (event: Event) => {\n event.preventDefault();\n\n // A layer in the overlay root may stop its Escape before the document sees it, so the cancel that follows\n // would close the dialog under the layer. While the focus is in that layer, the close request is its own.\n if (overlayRootRef.current?.contains(document.activeElement)) {\n return;\n }\n\n if (openRef.current) {\n dismissRef.current?.(\"escape\");\n }\n };\n\n const handleNativeClose = () => {\n if (\n openRef.current &&\n dialog.isConnected &&\n !dialog.open &&\n !areModalRootsSuspended()\n ) {\n dialog.showModal();\n }\n };\n\n dialog.addEventListener(\"cancel\", handleCancel);\n dialog.addEventListener(\"close\", handleNativeClose);\n\n return () => {\n dialog.removeEventListener(\"cancel\", handleCancel);\n dialog.removeEventListener(\"close\", handleNativeClose);\n };\n }, [dialog]);\n\n // The check waits a frame, so a close() that gives the focus back to an opener runs first. A modal root above\n // leaves the stack before its close(), and may sit outside this dialog, so the stack starts the check too.\n useEffect(() => {\n if (!dialog) {\n return undefined;\n }\n\n let frame: number | undefined;\n\n const scheduleRestore = () => {\n if (frame === undefined) {\n frame = requestAnimationFrame(() => {\n frame = undefined;\n restoreLostFocus();\n });\n }\n };\n\n const handleFocusIn = (event: FocusEvent) => {\n const target = event.target;\n\n if (target instanceof HTMLElement && target !== dialog) {\n focusHistoryRef.current = [\n target,\n ...focusHistoryRef.current.filter((element) => element !== target),\n ].slice(0, FOCUS_HISTORY_SIZE);\n }\n };\n\n const handleFocusOut = (event: FocusEvent) => {\n if (!event.relatedTarget) {\n blurredRef.current =\n event.target instanceof HTMLElement ? event.target : null;\n scheduleRestore();\n }\n };\n\n const observer = new MutationObserver(scheduleRestore);\n\n observer.observe(dialog, { childList: true, subtree: true });\n dialog.addEventListener(\"focusin\", handleFocusIn);\n dialog.addEventListener(\"focusout\", handleFocusOut);\n const unsubscribe = subscribeToModalRoots(scheduleRestore);\n\n return () => {\n unsubscribe();\n observer.disconnect();\n dialog.removeEventListener(\"focusin\", handleFocusIn);\n dialog.removeEventListener(\"focusout\", handleFocusOut);\n\n if (frame !== undefined) {\n cancelAnimationFrame(frame);\n }\n };\n }, [dialog, restoreLostFocus]);\n\n const handlePointerDown = useCallback(\n (event: PointerEvent<HTMLDialogElement>) => {\n pressStartedOnBackdrop.current = event.target === event.currentTarget;\n onPointerDown?.(event);\n },\n [onPointerDown]\n );\n\n // The dialog covers the viewport and its content sits inside it, so a click on the dialog itself is a\n // click on the backdrop. A press that started on the content and ended outside it is a text selection.\n // A click does not bubble on through the React tree, as from a legacy window: a confirmation rendered in a\n // clickable row would otherwise click the row as well. React listens at the portal's container, so a click\n // listener on document or window does not see a click inside the dialog either, as with the window.\n const handleClick = useCallback(\n (event: MouseEvent<HTMLDialogElement>) => {\n if (\n event.target === event.currentTarget &&\n pressStartedOnBackdrop.current &&\n openRef.current\n ) {\n dismissRef.current?.(\"backdrop\", event);\n }\n pressStartedOnBackdrop.current = false;\n onClick?.(event);\n event.stopPropagation();\n },\n [onClick]\n );\n\n // React events from a portal bubble through the React tree, so an Escape from the content would reach an\n // ancestor's handler, like an older Sheet's, before the document listener. The dialog takes it here first.\n const handleKeyDown = useCallback(\n (event: ReactKeyboardEvent<HTMLDialogElement>) => {\n onKeyDown?.(event);\n\n if (\n event.defaultPrevented ||\n (event.key !== \"Escape\" && event.key !== \"Esc\") ||\n stackIdRef.current === undefined ||\n !isTopModalRoot(stackIdRef.current)\n ) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n // An Escape a layer in the overlay root did not take stops here too, so it does not close the sheet that\n // opened this dialog, but it leaves the dialog open.\n if (overlayRootRef.current?.contains(event.target as Node)) {\n return;\n }\n\n if (openRef.current) {\n dismissRef.current?.(\"escape\");\n }\n },\n [onKeyDown]\n );\n\n const handleExited = useCallback(() => {\n if (!open) {\n finishClose();\n }\n }, [open, finishClose]);\n\n if (!mounted) {\n return null;\n }\n\n let content: ReactNode = null;\n\n if (contentShown) {\n content =\n typeof children === \"function\"\n ? children({ in: open, onExited: handleExited })\n : children;\n }\n\n return (\n <Portal>\n <RemoveScroll\n forwardProps\n ref={handleRef}\n enabled={!disableScrollLock}\n noIsolation\n >\n <StyledModalRoot\n tabIndex={-1}\n {...rest}\n className={classnames(\"c-modal-root\", className)}\n data-state={open ? \"open\" : \"closing\"}\n onPointerDown={handlePointerDown}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n >\n <div ref={contentRef} className=\"c-modal-root__content\">\n <PortalContainerProvider value={getOverlayRoot}>\n {content}\n </PortalContainerProvider>\n </div>\n <div ref={overlayRootRef} className=\"c-modal-root__overlays\" />\n </StyledModalRoot>\n </RemoveScroll>\n </Portal>\n );\n }\n);\n\nModalRoot.displayName = \"ModalRoot\";\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAaA,IAAAC,kBAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,eAAA,GAAAJ,OAAA;AAWA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAN,sBAAA,CAAAH,OAAA;AAAgD,IAAAU,SAAA;AAAA,SAAAP,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAZ,wBAAAY,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAhB,uBAAA,YAAAA,wBAAAY,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,OAAA,EAAAF,C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M,qBACL9P,MAAA,CAAAe,OAAA,CAAA8O,aAAA,CAAC1P,kBAAA,CAAA4P,YAAY;IACXC,YAAY;IACZlI,GAAG,EAAEgC,SAAU;IACfmG,OAAO,EAAE,CAAC1H,iBAAkB;IAC5B2H,WAAW;EAAA,gBAEXlQ,MAAA,CAAAe,OAAA,CAAA8O,aAAA,CAACtP,OAAA,CAAA4P,eAAe,EAAAlO,QAAA;IACdmO,QAAQ,EAAE,CAAC;EAAE,GACTpH,IAAI;IACRJ,SAAS,EAAE,IAAAyH,mBAAU,EAAC,cAAc,EAAEzH,SAAS,CAAE;IACjD,cAAYjD,IAAI,GAAG,MAAM,GAAG,SAAU;IACtCkD,aAAa,EAAEsG,iBAAkB;IACjCrG,OAAO,EAAEuG,WAAY;IACrBtG,SAAS,EAAEsE;EAAc,iBAEzBrN,MAAA,CAAAe,OAAA,CAAA8O,aAAA;IAAK/H,GAAG,EAAE4C,UAAW;IAAC9B,SAAS,EAAC;EAAuB,gBACrD5I,MAAA,CAAAe,OAAA,CAAA8O,aAAA,CAACpP,QAAA,CAAA6P,uBAAuB;IAACzM,KAAK,EAAE+G;EAAe,GAC5CzD,OACsB,CACtB,CAAC,eACNnH,MAAA,CAAAe,OAAA,CAAA8O,aAAA;IAAK/H,GAAG,EAAE6C,cAAe;IAAC/B,SAAS,EAAC;EAAwB,CAAE,CAC/C,CACL,CACR,CAAC;AAEb,CACF,CAAC;AAEDlB,SAAS,CAAC6I,WAAW,GAAG,WAAW","ignoreList":[]}
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.StyledModalRoot = exports.MODAL_ROOT_BACKDROP_MS = void 0;
7
7
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
8
+ var _layers = require("../../utils/layers");
8
9
  var _BoxSizingStyle = require("../BoxSizingStyle");
9
10
  var _FontStyle = require("../FontStyle");
10
11
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
@@ -13,6 +14,6 @@ var backdropIn = (0, _styledComponents.keyframes)(["from{background-color:transp
13
14
  var StyledModalRoot = exports.StyledModalRoot = _styledComponents.default.dialog.withConfig({
14
15
  displayName: "Styles__StyledModalRoot",
15
16
  componentId: "sc-48b5xq-0"
16
- })(["", " ", " position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:0;background:var(--modal-background);color:inherit;overflow:visible;animation:", " ", "ms ease;transition:background-color ", "ms ease;&[data-state=\"closing\"]{background-color:transparent;}&:focus{outline:none;}&::backdrop{background:transparent;}"], _FontStyle.FontStyle, _BoxSizingStyle.BoxSizingStyle, backdropIn, MODAL_ROOT_BACKDROP_MS, MODAL_ROOT_BACKDROP_MS);
17
+ })(["", " ", " position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:0;background:var(--modal-background);color:inherit;overflow:visible;animation:", " ", "ms ease;transition:background-color ", "ms ease;&[data-state=\"closing\"]{background-color:transparent;}&[data-state=\"closing\"]:not([open]){display:block;z-index:", ";pointer-events:none;}&[data-state=\"closing\"]:not([open]) > .c-modal-root__overlays{pointer-events:auto;}&[data-state=\"closing\"]::backdrop{pointer-events:none;}> .c-modal-root__content{display:contents;}&:focus{outline:none;}&::backdrop{background:transparent;}"], _FontStyle.FontStyle, _BoxSizingStyle.BoxSizingStyle, backdropIn, MODAL_ROOT_BACKDROP_MS, MODAL_ROOT_BACKDROP_MS, _layers.layers.cloud - 1);
17
18
  StyledModalRoot.displayName = "StyledModalRoot";
18
19
  //# sourceMappingURL=Styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Styles.js","names":["_styledComponents","_interopRequireWildcard","require","_BoxSizingStyle","_FontStyle","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","MODAL_ROOT_BACKDROP_MS","exports","backdropIn","keyframes","StyledModalRoot","styled","dialog","withConfig","displayName","componentId","FontStyle","BoxSizingStyle"],"sources":["../../../../src/components/ModalRoot/Styles.ts"],"sourcesContent":["import styled, { keyframes } from \"styled-components\";\n\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\n\nexport const MODAL_ROOT_BACKDROP_MS = 200;\n\nconst backdropIn = keyframes`\n from {\n background-color: transparent;\n }\n`;\n\nexport const StyledModalRoot = styled.dialog`\n ${FontStyle}\n ${BoxSizingStyle}\n\n position: fixed;\n inset: 0;\n width: 100%;\n height: 100%;\n max-width: none;\n max-height: none;\n margin: 0;\n padding: 0;\n border: 0;\n // The dialog covers the viewport, so it carries the backdrop colour itself. ::backdrop only inherits the\n // custom properties from Chrome 122 and Safari 17.4 on, and would be transparent before that.\n background: var(--modal-background);\n color: inherit;\n overflow: visible;\n animation: ${backdropIn} ${MODAL_ROOT_BACKDROP_MS}ms ease;\n transition: background-color ${MODAL_ROOT_BACKDROP_MS}ms ease;\n\n &[data-state=\"closing\"] {\n background-color: transparent;\n }\n\n &:focus {\n outline: none;\n }\n\n &::backdrop {\n background: transparent;\n }\n`;\n\nStyledModalRoot.displayName = \"StyledModalRoot\";\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAAyC,SAAAD,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,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+ {"version":3,"file":"Styles.js","names":["_styledComponents","_interopRequireWildcard","require","_layers","_BoxSizingStyle","_FontStyle","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","MODAL_ROOT_BACKDROP_MS","exports","backdropIn","keyframes","StyledModalRoot","styled","dialog","withConfig","displayName","componentId","FontStyle","BoxSizingStyle","layers","cloud"],"sources":["../../../../src/components/ModalRoot/Styles.ts"],"sourcesContent":["import styled, { keyframes } from \"styled-components\";\n\nimport { layers } from \"../../utils/layers\";\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\n\nexport const MODAL_ROOT_BACKDROP_MS = 200;\n\nconst backdropIn = keyframes`\n from {\n background-color: transparent;\n }\n`;\n\nexport const StyledModalRoot = styled.dialog`\n ${FontStyle}\n ${BoxSizingStyle}\n\n position: fixed;\n inset: 0;\n width: 100%;\n height: 100%;\n max-width: none;\n max-height: none;\n margin: 0;\n padding: 0;\n border: 0;\n // The dialog covers the viewport, so it carries the backdrop colour itself. ::backdrop only inherits the\n // custom properties from Chrome 122 and Safari 17.4 on, and would be transparent before that.\n background: var(--modal-background);\n color: inherit;\n overflow: visible;\n animation: ${backdropIn} ${MODAL_ROOT_BACKDROP_MS}ms ease;\n transition: background-color ${MODAL_ROOT_BACKDROP_MS}ms ease;\n\n &[data-state=\"closing\"] {\n background-color: transparent;\n }\n\n // Closed as its exit starts, the dialog stays shown until it unmounts, and clicks pass through it to the page. Where\n // popovers are missing it leaves the top layer and stays above the page only.\n &[data-state=\"closing\"]:not([open]) {\n display: block;\n z-index: ${layers.cloud - 1};\n pointer-events: none;\n }\n\n &[data-state=\"closing\"]:not([open]) > .c-modal-root__overlays {\n pointer-events: auto;\n }\n\n &[data-state=\"closing\"]::backdrop {\n pointer-events: none;\n }\n\n > .c-modal-root__content {\n display: contents;\n }\n\n &:focus {\n outline: none;\n }\n\n &::backdrop {\n background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