@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
@@ -4,8 +4,9 @@ const _excluded = ["open", "onRequestClose", "onDismissBlocked", "onClose", "dis
4
4
  import React, { forwardRef, useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
5
5
  import { RemoveScroll } from "react-remove-scroll";
6
6
  import classnames from "classnames";
7
- import { areModalRootsSuspended, getTopModalRootId, isTopModalRoot, popModalRoot, pushModalRoot, subscribeToModalRoots } from "./modalRootStack";
7
+ import { areModalRootsSuspended, getTopModalRootId, isTopModalRoot, popModalRoot, pushModalRoot, releaseModalRoot, reopenModalRoot, subscribeToModalRoots } from "./modalRootStack";
8
8
  import { StyledModalRoot } from "./Styles";
9
+ import { MODAL_STACK_HOST_ATTRIBUTE } from "./useModalStackHost";
9
10
  import { Portal, PortalContainerProvider } from "../../helpers";
10
11
  import { getTopLayer, layers } from "../../utils/layers";
11
12
  import useForkRef from "../../utils/useForkRef";
@@ -29,14 +30,14 @@ const isFocusable = element => element.isConnected && element.matches(FOCUSABLE)
29
30
  // eslint-disable-next-line compat/compat
30
31
  typeof element.checkVisibility !== "function" || element.checkVisibility());
31
32
 
32
- // A focused element that a closed dialog hides keeps the focus until the browser renders again.
33
+ // A focused element that a closed dialog hides, or that turned inert, keeps the focus until the browser renders again.
33
34
  const isFocusLost = () => {
34
35
  const focus = document.activeElement;
35
- if (!focus || focus === document.body || !focus.isConnected) {
36
+ if (!focus || focus === document.body || !focus.isConnected || focus.closest("[inert]")) {
36
37
  return true;
37
38
  }
38
- const dialog = focus.closest("dialog");
39
- return dialog !== null && !dialog.open;
39
+ const layer = focus.closest("dialog, .c-window");
40
+ return layer instanceof HTMLDialogElement && !layer.open;
40
41
  };
41
42
 
42
43
  // A sheet is a window, not a dialog, so once the last dialog is closed nothing else takes a lost focus back.
@@ -48,6 +49,54 @@ const focusTopWindowIfLost = () => {
48
49
  });
49
50
  }
50
51
  };
52
+ const keepFocusOn = element => {
53
+ if (element instanceof HTMLElement && element !== document.body && element.isConnected && document.activeElement !== element) {
54
+ element.focus({
55
+ preventScroll: true
56
+ });
57
+ }
58
+ };
59
+
60
+ // A closed dialog shown as a manual popover stays in the top layer without blocking the page. showPopover focuses a
61
+ // dialog, so the focus goes back to where close() left it.
62
+ const keepInTopLayer = node => {
63
+ if (typeof node.showPopover !== "function") {
64
+ return;
65
+ }
66
+ const focus = document.activeElement;
67
+ node.setAttribute("popover", "manual");
68
+ // eslint-disable-next-line compat/compat
69
+ node.showPopover();
70
+ keepFocusOn(focus);
71
+ if (document.activeElement !== focus && node.contains(document.activeElement)) {
72
+ document.activeElement.blur();
73
+ }
74
+ };
75
+ const leaveTopLayer = node => {
76
+ if (!node.hasAttribute("popover")) {
77
+ return;
78
+ }
79
+ if (node.matches(":popover-open")) {
80
+ // eslint-disable-next-line compat/compat
81
+ node.hidePopover();
82
+ }
83
+ node.removeAttribute("popover");
84
+ };
85
+ const isHeldStackHost = (element, overlayRoot) => {
86
+ var _element$closest;
87
+ return !!overlayRoot && (element == null || (_element$closest = element.closest("[" + MODAL_STACK_HOST_ATTRIBUTE + "]")) == null ? void 0 : _element$closest.parentElement) === overlayRoot;
88
+ };
89
+
90
+ // Popups of the content sit in the overlay root next to the stack hosts and leave with the content.
91
+ const setContentInert = (content, overlayRoot, inert) => {
92
+ var _overlayRoot$children;
93
+ content == null || content.toggleAttribute("inert", inert);
94
+ Array.from((_overlayRoot$children = overlayRoot == null ? void 0 : overlayRoot.children) != null ? _overlayRoot$children : []).forEach(child => {
95
+ if (!child.hasAttribute(MODAL_STACK_HOST_ATTRIBUTE)) {
96
+ child.toggleAttribute("inert", inert);
97
+ }
98
+ });
99
+ };
51
100
  export const ModalRoot = /*#__PURE__*/forwardRef((_ref, ref) => {
52
101
  let open = _ref.open,
53
102
  onRequestClose = _ref.onRequestClose,
@@ -93,6 +142,8 @@ export const ModalRoot = /*#__PURE__*/forwardRef((_ref, ref) => {
93
142
  const openRef = useRef(open);
94
143
  const pressStartedOnBackdrop = useRef(false);
95
144
  const stackIdRef = useRef();
145
+ const exitingRef = useRef(false);
146
+ const contentRef = useRef(null);
96
147
  const overlayRootRef = useRef(null);
97
148
  // Menus and pickers opened inside portal here, into the top layer with the dialog, not under it.
98
149
  const getOverlayRoot = useCallback(() => overlayRootRef.current, []);
@@ -100,14 +151,17 @@ export const ModalRoot = /*#__PURE__*/forwardRef((_ref, ref) => {
100
151
  const disableReturnFocusRef = useRef(disableReturnFocus);
101
152
  disableReturnFocusRef.current = disableReturnFocus;
102
153
 
103
- // close() gives the focus back to the element that had it before showModal when the focus is in the dialog, so
104
- // a dialog that leaves it there takes it off again. A focus outside, as in a sheet that left the overlay root,
105
- // stays where it is. When that element is gone, also when it goes with the same update right after, and the
106
- // last dialog closes over a sheet, the sheet takes it.
154
+ // close() of a modal gives the focus back to the element that had it before showModal, so a dialog that leaves it
155
+ // there takes it off again. A focus outside, as in a sheet that left the overlay root, stays where it is, and so
156
+ // does a focus in a sheet the overlay root holds for the exit transition. When that element is gone, also when it
157
+ // goes with the same update right after, and the last dialog closes over a sheet, the sheet takes it.
107
158
  const closeDialog = useCallback(node => {
108
- const focusInside = node.contains(document.activeElement);
159
+ const focus = document.activeElement;
160
+ const focusHeld = isHeldStackHost(focus, overlayRootRef.current);
161
+ const focusInside = node.contains(focus) && !focusHeld;
109
162
  node.close();
110
163
  if (!focusInside) {
164
+ keepFocusOn(focus);
111
165
  return;
112
166
  }
113
167
  if (disableReturnFocusRef.current) {
@@ -195,24 +249,53 @@ export const ModalRoot = /*#__PURE__*/forwardRef((_ref, ref) => {
195
249
  restoreLostFocus();
196
250
  }
197
251
  });
198
- const finishClose = useCallback(() => {
252
+ const leaveStack = useCallback(() => {
253
+ if (stackIdRef.current !== undefined) {
254
+ popModalRoot(stackIdRef.current);
255
+ stackIdRef.current = undefined;
256
+ }
257
+ }, []);
258
+
259
+ // The closed dialog stays shown for its exit transition, and its content takes no input until it unmounts.
260
+ // Sheets in its overlay root stay there until the transition is done.
261
+ const releaseForExit = useCallback(() => {
262
+ const node = dialogRef.current;
263
+ if (!node || exitingRef.current) {
264
+ return;
265
+ }
266
+ exitingRef.current = true;
199
267
  // A dialog that closes while suspended leaves the stack before the resume, so it drops its layer here.
200
- if (dialogRef.current) {
201
- dialogRef.current.style.zIndex = "";
268
+ node.style.zIndex = "";
269
+ if (stackIdRef.current !== undefined) {
270
+ releaseModalRoot(stackIdRef.current);
271
+ }
272
+
273
+ // Inert before close(), so a focus lock in a popup cannot take back the focus close() gives the opener.
274
+ setContentInert(contentRef.current, overlayRootRef.current, true);
275
+ if (node.open) {
276
+ closeDialog(node);
277
+ }
278
+ keepInTopLayer(node);
279
+ }, [closeDialog]);
280
+ const finishClose = useCallback(() => {
281
+ const node = dialogRef.current;
282
+ exitingRef.current = false;
283
+ if (node) {
284
+ node.style.zIndex = "";
202
285
  }
203
286
 
204
287
  // Content that sits in the overlay root moves out before the dialog hides it.
205
- if (stackIdRef.current !== undefined) {
206
- popModalRoot(stackIdRef.current);
207
- stackIdRef.current = undefined;
288
+ leaveStack();
289
+ if (node != null && node.open) {
290
+ closeDialog(node);
208
291
  }
209
- if (dialogRef.current) {
210
- closeDialog(dialogRef.current);
292
+ if (node) {
293
+ leaveTopLayer(node);
211
294
  }
212
295
  setMounted(false);
213
296
  setShownDialog(null);
214
297
  onClose == null || onClose();
215
- }, [closeDialog, onClose]);
298
+ }, [closeDialog, leaveStack, onClose]);
216
299
 
217
300
  // The entry joins the stack with every showModal, so an owner that opens the dialog again from onClose, on the
218
301
  // same node, gets it back. It joins after showModal, so content that moves into the overlay root lands where it
@@ -221,14 +304,26 @@ export const ModalRoot = /*#__PURE__*/forwardRef((_ref, ref) => {
221
304
  if (!open || !dialog) {
222
305
  return;
223
306
  }
307
+ const reopenedDuringExit = exitingRef.current;
308
+ if (reopenedDuringExit) {
309
+ exitingRef.current = false;
310
+ leaveTopLayer(dialog);
311
+ setContentInert(contentRef.current, overlayRootRef.current, false);
312
+ }
224
313
  if (!dialog.open) {
225
314
  dialog.showModal();
226
315
  }
316
+ if (reopenedDuringExit && stackIdRef.current !== undefined && !reopenModalRoot(stackIdRef.current)) {
317
+ leaveStack();
318
+ }
319
+ if (reopenedDuringExit && !areModalRootsSuspended() && !dialog.contains(document.activeElement)) {
320
+ focusFirstFocusable(dialog, overlayRootRef.current);
321
+ }
227
322
  if (stackIdRef.current === undefined) {
228
323
  stackIdRef.current = pushModalRoot(overlayRootRef.current, suspensionRef.current, belowOpenSheets);
229
324
  }
230
325
  setShownDialog(dialog);
231
- }, [open, dialog, belowOpenSheets]);
326
+ }, [open, dialog, belowOpenSheets, leaveStack]);
232
327
 
233
328
  // showModal found no content to focus, so the dialog moves the focus in once the content is there, unless an
234
329
  // autoFocus field took it. A dialog that opened suspended stays out of the way of the overlay above it.
@@ -247,19 +342,22 @@ export const ModalRoot = /*#__PURE__*/forwardRef((_ref, ref) => {
247
342
  // An owner that unmounts the dialog while it is open, as a form does on submit, gets the focus back on the
248
343
  // opener: a dialog removed while open would leave it on the body.
249
344
  useLayoutEffect(() => () => {
250
- if (stackIdRef.current !== undefined) {
251
- popModalRoot(stackIdRef.current);
252
- stackIdRef.current = undefined;
253
- }
345
+ exitingRef.current = false;
346
+ leaveStack();
254
347
  if (dialog != null && dialog.open) {
255
348
  closeDialog(dialog);
256
349
  }
257
- }, [dialog, closeDialog]);
350
+ }, [dialog, closeDialog, leaveStack]);
258
351
  useLayoutEffect(() => {
259
- if (!open && mounted && !hasTransition) {
352
+ if (open || !mounted) {
353
+ return;
354
+ }
355
+ if (hasTransition) {
356
+ releaseForExit();
357
+ } else {
260
358
  finishClose();
261
359
  }
262
- }, [open, mounted, hasTransition, finishClose]);
360
+ }, [open, mounted, hasTransition, releaseForExit, finishClose]);
263
361
  const dismissRef = useRef();
264
362
  dismissRef.current = (reason, event) => {
265
363
  if (areModalRootsSuspended()) {
@@ -446,9 +544,12 @@ export const ModalRoot = /*#__PURE__*/forwardRef((_ref, ref) => {
446
544
  onPointerDown: handlePointerDown,
447
545
  onClick: handleClick,
448
546
  onKeyDown: handleKeyDown
449
- }), /*#__PURE__*/React.createElement(PortalContainerProvider, {
547
+ }), /*#__PURE__*/React.createElement("div", {
548
+ ref: contentRef,
549
+ className: "c-modal-root__content"
550
+ }, /*#__PURE__*/React.createElement(PortalContainerProvider, {
450
551
  value: getOverlayRoot
451
- }, content), /*#__PURE__*/React.createElement("div", {
552
+ }, content)), /*#__PURE__*/React.createElement("div", {
452
553
  ref: overlayRootRef,
453
554
  className: "c-modal-root__overlays"
454
555
  }))));
@@ -1 +1 @@
1
- {"version":3,"file":"ModalRoot.js","names":["React","forwardRef","useCallback","useEffect","useLayoutEffect","useRef","useState","RemoveScroll","classnames","areModalRootsSuspended","getTopModalRootId","isTopModalRoot","popModalRoot","pushModalRoot","subscribeToModalRoots","StyledModalRoot","Portal","PortalContainerProvider","getTopLayer","layers","useForkRef","FOCUSABLE","focusFirstFocusable","dialog","overlayRoot","Array","from","querySelectorAll","some","candidate","contains","focus","document","activeElement","FOCUS_HISTORY_SIZE","isFocusable","element","isConnected","matches","checkVisibility","isFocusLost","body","closest","open","focusTopWindowIfLost","topLayer","undefined","preventScroll","ModalRoot","_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","_objectWithoutPropertiesLoose","_excluded","_useState","mounted","setMounted","_useState2","setDialog","dialogRef","setDialogNode","node","current","handleRef","_useState3","shownDialog","setShownDialog","contentShown","hasTransition","openRef","pressStartedOnBackdrop","stackIdRef","overlayRootRef","getOverlayRoot","disableReturnFocusRef","closeDialog","focusInside","close","_document$activeEleme","blur","requestAnimationFrame","focusHistoryRef","blurredRef","restoreLostFocus","stackId","blurred","restored","focusBeforeSuspendRef","suspensionRef","suspend","style","zIndex","String","cloud","show","resume","showModal","HTMLElement","finishClose","dismissRef","reason","event","blocked","handleKeyDown","_overlayRootRef$curre","_overlayRootRef$curre2","defaultPrevented","key","target","querySelector","preventDefault","addEventListener","removeEventListener","handleCancel","_overlayRootRef$curre3","handleNativeClose","frame","scheduleRestore","handleFocusIn","filter","slice","handleFocusOut","relatedTarget","observer","MutationObserver","observe","childList","subtree","unsubscribe","disconnect","cancelAnimationFrame","handlePointerDown","currentTarget","handleClick","stopPropagation","_overlayRootRef$curre4","handleExited","content","in","onExited","createElement","forwardProps","enabled","noIsolation","_extends","tabIndex","value","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,OAAOA,KAAK,IACVC,UAAU,EAMVC,WAAW,EACXC,SAAS,EACTC,eAAe,EACfC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,SAASC,YAAY,QAAQ,qBAAqB;AAElD,OAAOC,UAAU,MAAM,YAAY;AAEnC,SACEC,sBAAsB,EACtBC,iBAAiB,EACjBC,cAAc,EAEdC,YAAY,EACZC,aAAa,EACbC,qBAAqB,QAChB,kBAAkB;AACzB,SAASC,eAAe,QAAQ,UAAU;AAC1C,SAASC,MAAM,EAAEC,uBAAuB,QAAQ,eAAe;AAC/D,SAASC,WAAW,EAAEC,MAAM,QAAQ,oBAAoB;AACxD,OAAOC,UAAU,MAAM,wBAAwB;AAI/C,MAAMC,SAAS,GACb,0NAA0N;;AAE5N;AACA;AACA,MAAMC,mBAAmB,GAAGA,CAC1BC,MAAyB,EACzBC,WAA+B,KAC5B;EACHC,KAAK,CAACC,IAAI,CAACH,MAAM,CAACI,gBAAgB,CAAcN,SAAS,CAAC,CAAC,CAACO,IAAI,CAC7DC,SAAS,IAAK;IACb,IAAIL,WAAW,YAAXA,WAAW,CAAEM,QAAQ,CAACD,SAAS,CAAC,EAAE;MACpC,OAAO,KAAK;IACd;IAEAA,SAAS,CAACE,KAAK,CAAC,CAAC;IAEjB,OAAOC,QAAQ,CAACC,aAAa,KAAKJ,SAAS;EAC7C,CACF,CAAC;AACH,CAAC;AAED,MAAMK,kBAAkB,GAAG,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AAwB,CAAE,CAC/C,CACL,CACR,CAAC;AAEb,CACF,CAAC;AAEDjB,SAAS,CAACqH,WAAW,GAAG,WAAW","ignoreList":[]}
1
+ {"version":3,"file":"ModalRoot.js","names":["React","forwardRef","useCallback","useEffect","useLayoutEffect","useRef","useState","RemoveScroll","classnames","areModalRootsSuspended","getTopModalRootId","isTopModalRoot","popModalRoot","pushModalRoot","releaseModalRoot","reopenModalRoot","subscribeToModalRoots","StyledModalRoot","MODAL_STACK_HOST_ATTRIBUTE","Portal","PortalContainerProvider","getTopLayer","layers","useForkRef","FOCUSABLE","focusFirstFocusable","dialog","overlayRoot","Array","from","querySelectorAll","some","candidate","contains","focus","document","activeElement","FOCUS_HISTORY_SIZE","isFocusable","element","isConnected","matches","checkVisibility","isFocusLost","body","closest","layer","HTMLDialogElement","open","focusTopWindowIfLost","topLayer","undefined","preventScroll","keepFocusOn","HTMLElement","keepInTopLayer","node","showPopover","setAttribute","blur","leaveTopLayer","hasAttribute","hidePopover","removeAttribute","isHeldStackHost","_element$closest","parentElement","setContentInert","content","inert","_overlayRoot$children","toggleAttribute","children","forEach","child","ModalRoot","_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","_objectWithoutPropertiesLoose","_excluded","_useState","mounted","setMounted","_useState2","setDialog","dialogRef","setDialogNode","current","handleRef","_useState3","shownDialog","setShownDialog","contentShown","hasTransition","openRef","pressStartedOnBackdrop","stackIdRef","exitingRef","contentRef","overlayRootRef","getOverlayRoot","disableReturnFocusRef","closeDialog","focusHeld","focusInside","close","_document$activeEleme","requestAnimationFrame","focusHistoryRef","blurredRef","restoreLostFocus","stackId","blurred","restored","focusBeforeSuspendRef","suspensionRef","suspend","style","zIndex","String","cloud","show","resume","showModal","leaveStack","releaseForExit","finishClose","reopenedDuringExit","dismissRef","reason","event","blocked","handleKeyDown","_overlayRootRef$curre","_overlayRootRef$curre2","defaultPrevented","key","target","querySelector","preventDefault","addEventListener","removeEventListener","handleCancel","_overlayRootRef$curre3","handleNativeClose","frame","scheduleRestore","handleFocusIn","filter","slice","handleFocusOut","relatedTarget","observer","MutationObserver","observe","childList","subtree","unsubscribe","disconnect","cancelAnimationFrame","handlePointerDown","currentTarget","handleClick","stopPropagation","_overlayRootRef$curre4","handleExited","in","onExited","createElement","forwardProps","enabled","noIsolation","_extends","tabIndex","value","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,OAAOA,KAAK,IACVC,UAAU,EAMVC,WAAW,EACXC,SAAS,EACTC,eAAe,EACfC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,SAASC,YAAY,QAAQ,qBAAqB;AAElD,OAAOC,UAAU,MAAM,YAAY;AAEnC,SACEC,sBAAsB,EACtBC,iBAAiB,EACjBC,cAAc,EAEdC,YAAY,EACZC,aAAa,EACbC,gBAAgB,EAChBC,eAAe,EACfC,qBAAqB,QAChB,kBAAkB;AACzB,SAASC,eAAe,QAAQ,UAAU;AAC1C,SAASC,0BAA0B,QAAQ,qBAAqB;AAChE,SAASC,MAAM,EAAEC,uBAAuB,QAAQ,eAAe;AAC/D,SAASC,WAAW,EAAEC,MAAM,QAAQ,oBAAoB;AACxD,OAAOC,UAAU,MAAM,wBAAwB;AAI/C,MAAMC,SAAS,GACb,0NAA0N;;AAE5N;AACA;AACA,MAAMC,mBAAmB,GAAGA,CAC1BC,MAAyB,EACzBC,WAA+B,KAC5B;EACHC,KAAK,CAACC,IAAI,CAACH,MAAM,CAACI,gBAAgB,CAAcN,SAAS,CAAC,CAAC,CAACO,IAAI,CAC7DC,SAAS,IAAK;IACb,IAAIL,WAAW,YAAXA,WAAW,CAAEM,QAAQ,CAACD,SAAS,CAAC,EAAE;MACpC,OAAO,KAAK;IACd;IAEAA,SAAS,CAACE,KAAK,CAAC,CAAC;IAEjB,OAAOC,QAAQ,CAACC,aAAa,KAAKJ,SAAS;EAC7C,CACF,CAAC;AACH,CAAC;AAED,MAAMK,kBAAkB,GAAG,CAAC;;AAE5B;AACA,MAAMC,WAAW,GAAIC,OAAoB,IACvCA,OAAO,CAACC,WAAW,IACnBD,OAAO,CAACE,OAAO,CAACjB,SAAS,CAAC;AAC1B;AAC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components/ModalRoot/Styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAQ1C,eAAO,MAAM,eAAe,uEAgC3B,CAAC"}
1
+ {"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/ModalRoot/Styles.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAQ1C,eAAO,MAAM,eAAe,uEAoD3B,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import styled, { keyframes } from "styled-components";
2
+ import { layers } from "../../utils/layers";
2
3
  import { BoxSizingStyle } from "../BoxSizingStyle";
3
4
  import { FontStyle } from "../FontStyle";
4
5
  export const MODAL_ROOT_BACKDROP_MS = 200;
@@ -6,6 +7,6 @@ const backdropIn = keyframes(["from{background-color:transparent;}"]);
6
7
  export const StyledModalRoot = styled.dialog.withConfig({
7
8
  displayName: "Styles__StyledModalRoot",
8
9
  componentId: "sc-48b5xq-0"
9
- })(["", " ", " 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, BoxSizingStyle, backdropIn, MODAL_ROOT_BACKDROP_MS, MODAL_ROOT_BACKDROP_MS);
10
+ })(["", " ", " 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, BoxSizingStyle, backdropIn, MODAL_ROOT_BACKDROP_MS, MODAL_ROOT_BACKDROP_MS, layers.cloud - 1);
10
11
  StyledModalRoot.displayName = "StyledModalRoot";
11
12
  //# sourceMappingURL=Styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Styles.js","names":["styled","keyframes","BoxSizingStyle","FontStyle","MODAL_ROOT_BACKDROP_MS","backdropIn","StyledModalRoot","dialog","withConfig","displayName","componentId"],"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,OAAOA,MAAM,IAAIC,SAAS,QAAQ,mBAAmB;AAErD,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,SAAS,QAAQ,cAAc;AAExC,OAAO,MAAMC,sBAAsB,GAAG,GAAG;AAEzC,MAAMC,UAAU,GAAGJ,SAAS,yCAI3B;AAED,OAAO,MAAMK,eAAe,GAAGN,MAAM,CAACO,MAAM,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,mXACxCP,SAAS,EACTD,cAAc,EAgBHG,UAAU,EAAID,sBAAsB,EAClBA,sBAAsB,CAatD;AAEDE,eAAe,CAACG,WAAW,GAAG,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"Styles.js","names":["styled","keyframes","layers","BoxSizingStyle","FontStyle","MODAL_ROOT_BACKDROP_MS","backdropIn","StyledModalRoot","dialog","withConfig","displayName","componentId","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: transparent;\n }\n`;\n\nStyledModalRoot.displayName = \"StyledModalRoot\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,SAAS,QAAQ,mBAAmB;AAErD,SAASC,MAAM,QAAQ,oBAAoB;AAC3C,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,SAAS,QAAQ,cAAc;AAExC,OAAO,MAAMC,sBAAsB,GAAG,GAAG;AAEzC,MAAMC,UAAU,GAAGL,SAAS,yCAI3B;AAED,OAAO,MAAMM,eAAe,GAAGP,MAAM,CAACQ,MAAM,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,koBACxCP,SAAS,EACTD,cAAc,EAgBHG,UAAU,EAAID,sBAAsB,EAClBA,sBAAsB,EAUxCH,MAAM,CAACU,KAAK,GAAG,CAAC,CAuB9B;AAEDL,eAAe,CAACG,WAAW,GAAG,iBAAiB","ignoreList":[]}
@@ -5,6 +5,18 @@ export interface ModalRootSuspension {
5
5
  }
6
6
  export declare const pushModalRoot: (overlayRoot: HTMLElement | null, suspension?: ModalRootSuspension, belowOpenSheets?: boolean) => number;
7
7
  export declare const popModalRoot: (id: number) => void;
8
+ /**
9
+ * A modal root that plays its exit transition is no longer open: it leaves every query of the stack, and only keeps
10
+ * the hosts already in its overlay root until popModalRoot.
11
+ */
12
+ export declare const releaseModalRoot: (id: number) => void;
13
+ /** Reopened during its exit, a modal root keeps its id unless a newer one is in the stack; false then. */
14
+ export declare const reopenModalRoot: (id: number) => boolean;
15
+ /**
16
+ * True when the host sits in the overlay root of a modal root that plays its exit transition and stays active. An
17
+ * open modal root beside it would leave the host inert, so the host moves into that one at once.
18
+ */
19
+ export declare const isHeldByClosingModalRoot: (host: HTMLElement) => boolean;
8
20
  export declare const isTopModalRoot: (id: number) => boolean;
9
21
  /**
10
22
  * The overlay root of the top open modal root, where content that must stay above every modal goes. A modal root
@@ -1 +1 @@
1
- {"version":3,"file":"modalRootStack.d.ts","sourceRoot":"","sources":["../../../../src/components/ModalRoot/modalRootStack.ts"],"names":[],"mappings":"AAAA,KAAK,QAAQ,GAAG,MAAM,IAAI,CAAC;AAE3B,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAiBD,eAAO,MAAM,aAAa,GACxB,aAAa,WAAW,GAAG,IAAI,EAC/B,aAAa,mBAAmB,EAChC,yBAAuB,KACtB,MAYF,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,IAAI,MAAM,KAAG,IAOzC,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,IAAI,MAAM,KAAG,OACR,CAAC;AAKrC;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GAAI,UAAU,IAAI,KAAG,WAAW,GAAG,IACS,CAAC;AAEhF,yEAAyE;AACzE,eAAO,MAAM,iBAAiB,QAAO,MAAM,GAAG,SACjB,CAAC;AAE9B;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAClC,IAAI,MAAM,EACV,UAAU,IAAI,KACb,WAAW,GAAG,IAMc,CAAC;AAEhC,kGAAkG;AAClG,eAAO,MAAM,gCAAgC,QAAO,MAAM,GAAG,SACH,CAAC;AAE3D,eAAO,MAAM,qBAAqB,GAAI,UAAU,QAAQ,KAAG,CAAC,MAAM,IAAI,CAMrE,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,sBAAsB,QAAO,OAA0B,CAAC;AAErE;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,QAAO,CAAC,MAAM,IAAI,CAqB/C,CAAC"}
1
+ {"version":3,"file":"modalRootStack.d.ts","sourceRoot":"","sources":["../../../../src/components/ModalRoot/modalRootStack.ts"],"names":[],"mappings":"AAAA,KAAK,QAAQ,GAAG,MAAM,IAAI,CAAC;AAE3B,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;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