@activecollab/components 2.0.553 → 2.0.555
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.
- package/dist/cjs/components/ConfirmDialog/ConfirmDialog.js +1 -1
- package/dist/cjs/components/ConfirmDialog/ConfirmDialog.js.map +1 -1
- package/dist/cjs/components/ModalRoot/ModalRoot.js +125 -3
- package/dist/cjs/components/ModalRoot/ModalRoot.js.map +1 -1
- package/dist/cjs/components/ModalRoot/Styles.js +1 -1
- package/dist/cjs/components/ModalRoot/Styles.js.map +1 -1
- package/dist/esm/components/ConfirmDialog/ConfirmDialog.js +1 -1
- package/dist/esm/components/ConfirmDialog/ConfirmDialog.js.map +1 -1
- package/dist/esm/components/ModalRoot/ModalRoot.d.ts +4 -1
- package/dist/esm/components/ModalRoot/ModalRoot.d.ts.map +1 -1
- package/dist/esm/components/ModalRoot/ModalRoot.js +123 -5
- package/dist/esm/components/ModalRoot/ModalRoot.js.map +1 -1
- package/dist/esm/components/ModalRoot/Styles.js +1 -1
- package/dist/esm/components/ModalRoot/Styles.js.map +1 -1
- package/dist/index.js +127 -5
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -28,7 +28,7 @@ var ConfirmDialog = exports.ConfirmDialog = /*#__PURE__*/(0, _react.forwardRef)(
|
|
|
28
28
|
onConfirm = _ref.onConfirm,
|
|
29
29
|
className = _ref.className,
|
|
30
30
|
_ref$dialogTitle = _ref.dialogTitle,
|
|
31
|
-
dialogTitle = _ref$dialogTitle === void 0 ? "Discard
|
|
31
|
+
dialogTitle = _ref$dialogTitle === void 0 ? "Discard Changes" : _ref$dialogTitle,
|
|
32
32
|
_ref$dialogContent = _ref.dialogContent,
|
|
33
33
|
dialogContent = _ref$dialogContent === void 0 ? "All unsaved changes will be lost." : _ref$dialogContent,
|
|
34
34
|
_ref$confirmBtnText = _ref.confirmBtnText,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmDialog.js","names":["_react","_interopRequireWildcard","require","_classnames","_interopRequireDefault","_Button","_Checkbox","_Dialog","_Styles","_usePropWarning","_Body","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_slicedToArray","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","a","_arrayLikeToArray","toString","slice","constructor","name","Array","from","test","length","l","Symbol","iterator","u","next","done","push","value","return","isArray","CONFIRMATION_CHECKBOX_ID","ConfirmDialog","exports","forwardRef","_ref","ref","_ref$open","open","onCancel","onConfirm","className","_ref$dialogTitle","dialogTitle","_ref$dialogContent","dialogContent","_ref$confirmBtnText","confirmBtnText","_ref$cancelBtnText","cancelBtnText","_ref$shouldShowCancel","shouldShowCancelButton","_ref$isLoading","isLoading","confirmationLabel","_ref$initialFocus","initialFocus","size","height","native","_useState","useState","_useState2","confirmed","setConfirmed","usePropWarning","isConfirmBlocked","Boolean","handleToggleConfirmed","useCallback","event","target","checked","useEffect","createElement","Dialog","onClose","classnames","disableCloseOnEsc","role","Title","ContentDivider","Content","Body2","lineHeight","color","whitespace","StyledConfirmation","Checkbox","id","onChange","disabled","htmlFor","Actions","Button","variant","onClick","autoFocus","type","displayName"],"sources":["../../../../src/components/ConfirmDialog/ConfirmDialog.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useEffect, useState } from \"react\";\n\nimport classnames from \"classnames\";\n\nimport { Button } from \"../Button/Button\";\nimport { Checkbox } from \"../Checkbox\";\nimport { Dialog } from \"../Dialog\";\nimport { StyledConfirmation } from \"./Styles\";\nimport { DialogSize } from \"../Dialog/Styles\";\nimport { usePropWarning } from \"../Dialog/usePropWarning\";\nimport { Body2 } from \"../Typography/Variants/Body2\";\n\nconst CONFIRMATION_CHECKBOX_ID = \"confirm-dialog-confirmation\";\n\nexport interface ConfirmDialogProps {\n open?: boolean;\n onCancel?: () => void;\n onConfirm?: () => void;\n className?: string;\n dialogTitle?: string;\n dialogContent?: React.ReactNode;\n confirmBtnText?: string;\n cancelBtnText?: string;\n shouldShowCancelButton?: boolean;\n isLoading?: boolean;\n confirmationLabel?: string;\n /**\n * The button that has the focus when the confirmation opens. Cancel by default, so that a confirmation of a\n * destructive action is never one Enter away; a confirmation without Cancel focuses its confirm button.\n */\n initialFocus?: \"cancel\" | \"confirm\";\n size?: DialogSize;\n height?: string;\n /**\n * @deprecated Every confirmation is a native modal alert dialog now. The prop is ignored, with a warning in\n * development, and will be removed.\n */\n native?: boolean;\n}\n\nexport const ConfirmDialog = forwardRef<HTMLDialogElement, ConfirmDialogProps>(\n (\n {\n open = false,\n onCancel,\n onConfirm,\n className,\n dialogTitle = \"Discard changes?\",\n dialogContent = \"All unsaved changes will be lost.\",\n confirmBtnText = \"OK\",\n cancelBtnText = \"Cancel\",\n shouldShowCancelButton = true,\n isLoading = false,\n confirmationLabel,\n initialFocus = \"cancel\",\n size,\n height,\n native,\n },\n ref\n ) => {\n const [confirmed, setConfirmed] = useState(false);\n\n usePropWarning(\n \"ConfirmDialog\",\n \"native\",\n native,\n \"removed\",\n \"Every confirmation is a native modal now, so remove it.\"\n );\n const isConfirmBlocked = Boolean(confirmationLabel) && !confirmed;\n\n const handleToggleConfirmed = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) =>\n setConfirmed(event.target.checked),\n []\n );\n\n useEffect(() => {\n if (!open) {\n setConfirmed(false);\n }\n }, [open]);\n\n return (\n <Dialog\n ref={ref}\n open={open}\n onClose={onCancel}\n className={classnames(\"c-confirm-dialog\", className)}\n disableCloseOnEsc={isLoading}\n size={size}\n height={height}\n role=\"alertdialog\"\n >\n <Dialog.Title>{dialogTitle}</Dialog.Title>\n <Dialog.ContentDivider />\n <Dialog.Content>\n <Body2 lineHeight=\"loose\" color=\"secondary\" whitespace=\"pre-line\">\n {dialogContent}\n </Body2>\n {confirmationLabel ? (\n <StyledConfirmation className=\"c-confirm-dialog--confirmation\">\n <Checkbox\n id={CONFIRMATION_CHECKBOX_ID}\n checked={confirmed}\n onChange={handleToggleConfirmed}\n disabled={isLoading}\n />\n <label htmlFor={CONFIRMATION_CHECKBOX_ID}>\n <Body2 color=\"secondary\">{confirmationLabel}</Body2>\n </label>\n </StyledConfirmation>\n ) : null}\n </Dialog.Content>\n <Dialog.ContentDivider />\n <Dialog.Actions>\n <Button\n variant=\"primary\"\n onClick={onConfirm}\n disabled={isLoading || isConfirmBlocked}\n autoFocus={initialFocus === \"confirm\" || !shouldShowCancelButton}\n >\n {confirmBtnText}\n </Button>\n {shouldShowCancelButton ? (\n <Button\n variant=\"secondary\"\n data-action=\"cancel\"\n onClick={onCancel}\n type=\"button\"\n disabled={isLoading}\n autoFocus={initialFocus === \"cancel\"}\n >\n {cancelBtnText}\n </Button>\n ) : null}\n </Dialog.Actions>\n </Dialog>\n );\n }\n);\n\nConfirmDialog.displayName = \"ConfirmDialog\";\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAEA,IAAAO,eAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AAAqD,SAAAE,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAV,wBAAAU,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAd,uBAAA,YAAAA,wBAAAU,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAA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ACRI,sBAAsB,gBACrB7E,MAAA,CAAAa,OAAA,CAAAuF,aAAA,CAAC/F,OAAA,CAAAmH,MAAM;IACLC,OAAO,EAAC,WAAW;IACnB,eAAY,QAAQ;IACpBC,OAAO,EAAEzD,QAAS;IAClB2D,IAAI,EAAC,QAAQ;IACbP,QAAQ,EAAEtC,SAAU;IACpB4C,SAAS,EAAEzC,YAAY,KAAK;EAAS,GAEpCP,aACK,CAAC,GACP,IACU,CACV,CAAC;AAEb,CACF,CAAC;AAEDjB,aAAa,CAACmE,WAAW,GAAG,eAAe","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ConfirmDialog.js","names":["_react","_interopRequireWildcard","require","_classnames","_interopRequireDefault","_Button","_Checkbox","_Dialog","_Styles","_usePropWarning","_Body","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_slicedToArray","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","a","_arrayLikeToArray","toString","slice","constructor","name","Array","from","test","length","l","Symbol","iterator","u","next","done","push","value","return","isArray","CONFIRMATION_CHECKBOX_ID","ConfirmDialog","exports","forwardRef","_ref","ref","_ref$open","open","onCancel","onConfirm","className","_ref$dialogTitle","dialogTitle","_ref$dialogContent","dialogContent","_ref$confirmBtnText","confirmBtnText","_ref$cancelBtnText","cancelBtnText","_ref$shouldShowCancel","shouldShowCancelButton","_ref$isLoading","isLoading","confirmationLabel","_ref$initialFocus","initialFocus","size","height","native","_useState","useState","_useState2","confirmed","setConfirmed","usePropWarning","isConfirmBlocked","Boolean","handleToggleConfirmed","useCallback","event","target","checked","useEffect","createElement","Dialog","onClose","classnames","disableCloseOnEsc","role","Title","ContentDivider","Content","Body2","lineHeight","color","whitespace","StyledConfirmation","Checkbox","id","onChange","disabled","htmlFor","Actions","Button","variant","onClick","autoFocus","type","displayName"],"sources":["../../../../src/components/ConfirmDialog/ConfirmDialog.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useEffect, useState } from \"react\";\n\nimport classnames from \"classnames\";\n\nimport { Button } from \"../Button/Button\";\nimport { Checkbox } from \"../Checkbox\";\nimport { Dialog } from \"../Dialog\";\nimport { StyledConfirmation } from \"./Styles\";\nimport { DialogSize } from \"../Dialog/Styles\";\nimport { usePropWarning } from \"../Dialog/usePropWarning\";\nimport { Body2 } from \"../Typography/Variants/Body2\";\n\nconst CONFIRMATION_CHECKBOX_ID = \"confirm-dialog-confirmation\";\n\nexport interface ConfirmDialogProps {\n open?: boolean;\n onCancel?: () => void;\n onConfirm?: () => void;\n className?: string;\n dialogTitle?: string;\n dialogContent?: React.ReactNode;\n confirmBtnText?: string;\n cancelBtnText?: string;\n shouldShowCancelButton?: boolean;\n isLoading?: boolean;\n confirmationLabel?: string;\n /**\n * The button that has the focus when the confirmation opens. Cancel by default, so that a confirmation of a\n * destructive action is never one Enter away; a confirmation without Cancel focuses its confirm button.\n */\n initialFocus?: \"cancel\" | \"confirm\";\n size?: DialogSize;\n height?: string;\n /**\n * @deprecated Every confirmation is a native modal alert dialog now. The prop is ignored, with a warning in\n * development, and will be removed.\n */\n native?: boolean;\n}\n\nexport const ConfirmDialog = forwardRef<HTMLDialogElement, ConfirmDialogProps>(\n (\n {\n open = false,\n onCancel,\n onConfirm,\n className,\n dialogTitle = \"Discard Changes\",\n dialogContent = \"All unsaved changes will be lost.\",\n confirmBtnText = \"OK\",\n cancelBtnText = \"Cancel\",\n shouldShowCancelButton = true,\n isLoading = false,\n confirmationLabel,\n initialFocus = \"cancel\",\n size,\n height,\n native,\n },\n ref\n ) => {\n const [confirmed, setConfirmed] = useState(false);\n\n usePropWarning(\n \"ConfirmDialog\",\n \"native\",\n native,\n \"removed\",\n \"Every confirmation is a native modal now, so remove it.\"\n );\n const isConfirmBlocked = Boolean(confirmationLabel) && !confirmed;\n\n const handleToggleConfirmed = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) =>\n setConfirmed(event.target.checked),\n []\n );\n\n useEffect(() => {\n if (!open) {\n setConfirmed(false);\n }\n }, [open]);\n\n return (\n <Dialog\n ref={ref}\n open={open}\n onClose={onCancel}\n className={classnames(\"c-confirm-dialog\", className)}\n disableCloseOnEsc={isLoading}\n size={size}\n height={height}\n role=\"alertdialog\"\n >\n <Dialog.Title>{dialogTitle}</Dialog.Title>\n <Dialog.ContentDivider />\n <Dialog.Content>\n <Body2 lineHeight=\"loose\" color=\"secondary\" whitespace=\"pre-line\">\n {dialogContent}\n </Body2>\n {confirmationLabel ? (\n <StyledConfirmation className=\"c-confirm-dialog--confirmation\">\n <Checkbox\n id={CONFIRMATION_CHECKBOX_ID}\n checked={confirmed}\n onChange={handleToggleConfirmed}\n disabled={isLoading}\n />\n <label htmlFor={CONFIRMATION_CHECKBOX_ID}>\n <Body2 color=\"secondary\">{confirmationLabel}</Body2>\n </label>\n </StyledConfirmation>\n ) : null}\n </Dialog.Content>\n <Dialog.ContentDivider />\n <Dialog.Actions>\n <Button\n variant=\"primary\"\n onClick={onConfirm}\n disabled={isLoading || isConfirmBlocked}\n autoFocus={initialFocus === \"confirm\" || !shouldShowCancelButton}\n >\n {confirmBtnText}\n </Button>\n {shouldShowCancelButton ? (\n <Button\n variant=\"secondary\"\n data-action=\"cancel\"\n onClick={onCancel}\n type=\"button\"\n disabled={isLoading}\n autoFocus={initialFocus === \"cancel\"}\n >\n {cancelBtnText}\n </Button>\n ) : null}\n </Dialog.Actions>\n </Dialog>\n );\n }\n);\n\nConfirmDialog.displayName = \"ConfirmDialog\";\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAEA,IAAAO,eAAA,GAAAP,OAAA;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AACM,cAAc,MAAE,CAAC,eACzB3G,MAAA,CAAAa,OAAA,CAAAuF,aAAA,CAAC7F,OAAA,CAAA8F,MAAM,CAACkB,OAAO,qBACbvH,MAAA,CAAAa,OAAA,CAAAuF,aAAA,CAAC/F,OAAA,CAAAmH,MAAM;IACLC,OAAO,EAAC,SAAS;IACjBC,OAAO,EAAExD,SAAU;IACnBmD,QAAQ,EAAEtC,SAAS,IAAIa,gBAAiB;IACxC+B,SAAS,EAAEzC,YAAY,KAAK,SAAS,IAAI,CAACL;EAAuB,GAEhEJ,cACK,CAAC,EACRI,sBAAsB,gBACrB7E,MAAA,CAAAa,OAAA,CAAAuF,aAAA,CAAC/F,OAAA,CAAAmH,MAAM;IACLC,OAAO,EAAC,WAAW;IACnB,eAAY,QAAQ;IACpBC,OAAO,EAAEzD,QAAS;IAClB2D,IAAI,EAAC,QAAQ;IACbP,QAAQ,EAAEtC,SAAU;IACpB4C,SAAS,EAAEzC,YAAY,KAAK;EAAS,GAEpCP,aACK,CAAC,GACP,IACU,CACV,CAAC;AAEb,CACF,CAAC;AAEDjB,aAAa,CAACmE,WAAW,GAAG,eAAe","ignoreList":[]}
|
|
@@ -37,6 +37,34 @@ var focusFirstFocusable = function focusFirstFocusable(dialog, overlayRoot) {
|
|
|
37
37
|
return document.activeElement === candidate;
|
|
38
38
|
});
|
|
39
39
|
};
|
|
40
|
+
var FOCUS_HISTORY_SIZE = 5;
|
|
41
|
+
|
|
42
|
+
// Neither removed, disabled nor hidden, so the element could take the focus back.
|
|
43
|
+
var isFocusable = function isFocusable(element) {
|
|
44
|
+
return element.isConnected && element.matches(FOCUSABLE) && (
|
|
45
|
+
// eslint-disable-next-line compat/compat
|
|
46
|
+
typeof element.checkVisibility !== "function" || element.checkVisibility());
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// A focused element that a closed dialog hides keeps the focus until the browser renders again.
|
|
50
|
+
var isFocusLost = function isFocusLost() {
|
|
51
|
+
var focus = document.activeElement;
|
|
52
|
+
if (!focus || focus === document.body || !focus.isConnected) {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
var dialog = focus.closest("dialog");
|
|
56
|
+
return dialog !== null && !dialog.open;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// A sheet is a window, not a dialog, so once the last dialog is closed nothing else takes a lost focus back.
|
|
60
|
+
var focusTopWindowIfLost = function focusTopWindowIfLost() {
|
|
61
|
+
var topLayer = (0, _layers.getTopLayer)();
|
|
62
|
+
if ((0, _modalRootStack.getTopModalRootId)() === undefined && isFocusLost() && topLayer !== null && topLayer !== void 0 && topLayer.matches(".c-window")) {
|
|
63
|
+
topLayer.focus({
|
|
64
|
+
preventScroll: true
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
};
|
|
40
68
|
var ModalRoot = exports.ModalRoot = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
41
69
|
var open = _ref.open,
|
|
42
70
|
onRequestClose = _ref.onRequestClose,
|
|
@@ -96,13 +124,56 @@ var ModalRoot = exports.ModalRoot = /*#__PURE__*/(0, _react.forwardRef)(function
|
|
|
96
124
|
|
|
97
125
|
// close() gives the focus back to the element that had it before showModal when the focus is in the dialog, so
|
|
98
126
|
// a dialog that leaves it there takes it off again. A focus outside, as in a sheet that left the overlay root,
|
|
99
|
-
// stays where it is.
|
|
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.
|
|
100
129
|
var closeDialog = (0, _react.useCallback)(function (node) {
|
|
101
130
|
var focusInside = node.contains(document.activeElement);
|
|
102
131
|
node.close();
|
|
103
|
-
if (
|
|
132
|
+
if (!focusInside) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
if (disableReturnFocusRef.current) {
|
|
104
136
|
var _document$activeEleme;
|
|
105
137
|
(_document$activeEleme = document.activeElement) === null || _document$activeEleme === void 0 || _document$activeEleme.blur();
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
focusTopWindowIfLost();
|
|
141
|
+
requestAnimationFrame(focusTopWindowIfLost);
|
|
142
|
+
}, []);
|
|
143
|
+
var focusHistoryRef = (0, _react.useRef)([]);
|
|
144
|
+
var blurredRef = (0, _react.useRef)(null);
|
|
145
|
+
|
|
146
|
+
// The browser drops the focus to the body when the focused element goes, as a toast that closes or a button that
|
|
147
|
+
// another replaces, so the top dialog takes it back: on the newest element focused before that is still there, or
|
|
148
|
+
// on itself. A layer in front of it, such as a sheet in the overlay root, keeps its own focus. A field that blurs
|
|
149
|
+
// itself, as on Escape or Enter, can still take the focus, so it let it go on purpose and the dialog takes it.
|
|
150
|
+
var restoreLostFocus = (0, _react.useCallback)(function () {
|
|
151
|
+
var node = dialogRef.current;
|
|
152
|
+
var stackId = stackIdRef.current;
|
|
153
|
+
var blurred = blurredRef.current;
|
|
154
|
+
blurredRef.current = null;
|
|
155
|
+
if (!(node !== null && node !== void 0 && node.open) || stackId === undefined || !(0, _modalRootStack.isTopModalRoot)(stackId) || (0, _modalRootStack.areModalRootsSuspended)() || !isFocusLost() || (0, _layers.getTopLayer)() !== node) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
if (blurred && node.contains(blurred) && isFocusable(blurred)) {
|
|
159
|
+
node.focus({
|
|
160
|
+
preventScroll: true
|
|
161
|
+
});
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
var restored = focusHistoryRef.current.some(function (candidate) {
|
|
165
|
+
if (!candidate.isConnected || !node.contains(candidate)) {
|
|
166
|
+
return false;
|
|
167
|
+
}
|
|
168
|
+
candidate.focus({
|
|
169
|
+
preventScroll: true
|
|
170
|
+
});
|
|
171
|
+
return document.activeElement === candidate;
|
|
172
|
+
});
|
|
173
|
+
if (!restored) {
|
|
174
|
+
node.focus({
|
|
175
|
+
preventScroll: true
|
|
176
|
+
});
|
|
106
177
|
}
|
|
107
178
|
}, []);
|
|
108
179
|
if (open && !mounted) {
|
|
@@ -143,6 +214,7 @@ var ModalRoot = exports.ModalRoot = /*#__PURE__*/(0, _react.forwardRef)(function
|
|
|
143
214
|
preventScroll: true
|
|
144
215
|
});
|
|
145
216
|
}
|
|
217
|
+
restoreLostFocus();
|
|
146
218
|
}
|
|
147
219
|
});
|
|
148
220
|
var finishClose = (0, _react.useCallback)(function () {
|
|
@@ -289,6 +361,54 @@ var ModalRoot = exports.ModalRoot = /*#__PURE__*/(0, _react.forwardRef)(function
|
|
|
289
361
|
dialog.removeEventListener("close", handleNativeClose);
|
|
290
362
|
};
|
|
291
363
|
}, [dialog]);
|
|
364
|
+
|
|
365
|
+
// The check waits a frame, so a close() that gives the focus back to an opener runs first. A modal root above
|
|
366
|
+
// leaves the stack before its close(), and may sit outside this dialog, so the stack starts the check too.
|
|
367
|
+
(0, _react.useEffect)(function () {
|
|
368
|
+
if (!dialog) {
|
|
369
|
+
return undefined;
|
|
370
|
+
}
|
|
371
|
+
var frame;
|
|
372
|
+
var scheduleRestore = function scheduleRestore() {
|
|
373
|
+
if (frame === undefined) {
|
|
374
|
+
frame = requestAnimationFrame(function () {
|
|
375
|
+
frame = undefined;
|
|
376
|
+
restoreLostFocus();
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
var handleFocusIn = function handleFocusIn(event) {
|
|
381
|
+
var target = event.target;
|
|
382
|
+
if (target instanceof HTMLElement && target !== dialog) {
|
|
383
|
+
focusHistoryRef.current = [target, ...focusHistoryRef.current.filter(function (element) {
|
|
384
|
+
return element !== target;
|
|
385
|
+
})].slice(0, FOCUS_HISTORY_SIZE);
|
|
386
|
+
}
|
|
387
|
+
};
|
|
388
|
+
var handleFocusOut = function handleFocusOut(event) {
|
|
389
|
+
if (!event.relatedTarget) {
|
|
390
|
+
blurredRef.current = event.target instanceof HTMLElement ? event.target : null;
|
|
391
|
+
scheduleRestore();
|
|
392
|
+
}
|
|
393
|
+
};
|
|
394
|
+
var observer = new MutationObserver(scheduleRestore);
|
|
395
|
+
observer.observe(dialog, {
|
|
396
|
+
childList: true,
|
|
397
|
+
subtree: true
|
|
398
|
+
});
|
|
399
|
+
dialog.addEventListener("focusin", handleFocusIn);
|
|
400
|
+
dialog.addEventListener("focusout", handleFocusOut);
|
|
401
|
+
var unsubscribe = (0, _modalRootStack.subscribeToModalRoots)(scheduleRestore);
|
|
402
|
+
return function () {
|
|
403
|
+
unsubscribe();
|
|
404
|
+
observer.disconnect();
|
|
405
|
+
dialog.removeEventListener("focusin", handleFocusIn);
|
|
406
|
+
dialog.removeEventListener("focusout", handleFocusOut);
|
|
407
|
+
if (frame !== undefined) {
|
|
408
|
+
cancelAnimationFrame(frame);
|
|
409
|
+
}
|
|
410
|
+
};
|
|
411
|
+
}, [dialog, restoreLostFocus]);
|
|
292
412
|
var handlePointerDown = (0, _react.useCallback)(function (event) {
|
|
293
413
|
pressStartedOnBackdrop.current = event.target === event.currentTarget;
|
|
294
414
|
onPointerDown === null || onPointerDown === void 0 || onPointerDown(event);
|
|
@@ -350,7 +470,9 @@ var ModalRoot = exports.ModalRoot = /*#__PURE__*/(0, _react.forwardRef)(function
|
|
|
350
470
|
ref: handleRef,
|
|
351
471
|
enabled: !disableScrollLock,
|
|
352
472
|
noIsolation: true
|
|
353
|
-
}, /*#__PURE__*/_react.default.createElement(_Styles.StyledModalRoot, _extends({
|
|
473
|
+
}, /*#__PURE__*/_react.default.createElement(_Styles.StyledModalRoot, _extends({
|
|
474
|
+
tabIndex: -1
|
|
475
|
+
}, rest, {
|
|
354
476
|
className: (0, _classnames.default)("c-modal-root", className),
|
|
355
477
|
"data-state": open ? "open" : "closing",
|
|
356
478
|
onPointerDown: handlePointerDown,
|
|
@@ -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","ModalRoot","exports","forwardRef","_ref","ref","open","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","focusBeforeSuspendRef","suspensionRef","suspend","style","zIndex","String","layers","cloud","show","resume","showModal","HTMLElement","preventScroll","finishClose","undefined","popModalRoot","useLayoutEffect","pushModalRoot","areModalRootsSuspended","dismissRef","reason","event","blocked","useEffect","handleKeyDown","_overlayRootRef$curre","_overlayRootRef$curre2","stackId","isTopModalRoot","defaultPrevented","key","target","body","querySelector","preventDefault","_dismissRef$current","addEventListener","removeEventListener","handleCancel","_overlayRootRef$curre3","_dismissRef$current2","handleNativeClose","isConnected","handlePointerDown","currentTarget","handleClick","_dismissRef$current3","stopPropagation","_overlayRootRef$curre4","_dismissRef$current4","handleExited","content","in","onExited","createElement","Portal","RemoveScroll","forwardProps","enabled","noIsolation","StyledModalRoot","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 isTopModalRoot,\n ModalRootSuspension,\n popModalRoot,\n pushModalRoot,\n} from \"./modalRootStack\";\nimport { StyledModalRoot } from \"./Styles\";\nimport { Portal, PortalContainerProvider } from \"../../helpers\";\nimport { 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\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 /** Closing leaves the focus off the element that had it before the dialog opened, also when the owner unmounts it */\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.\n const closeDialog = useCallback((node: HTMLDialogElement) => {\n const focusInside = node.contains(document.activeElement);\n node.close();\n\n if (disableReturnFocusRef.current && focusInside) {\n (document.activeElement as HTMLElement | null)?.blur();\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 });\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 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 {...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;AAOA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAL,sBAAA,CAAAH,OAAA;AAAgD,IAAAS,SAAA;AAAA,SAAAN,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAX,wBAAAW,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAf,uBAAA,YAAAA,wBAAAW,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,OAAA,EAAAF,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAS,CAAA,MAAAF,CAAA,GAAAJ,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAE,CAAA,CAAAI,GAAA,CAAA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ACyH,WAAW,GAAG,WAAW","ignoreList":[]}
|
|
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,OAAA;AACA,IAAAQ,WAAA,GAAAL,sBAAA,CAAAH,OAAA;AAAgD,IAAAS,SAAA;AAAA,SAAAN,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAX,wBAAAW,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAf,uBAAA,YAAAA,wBAAAW,CAAA,EAAAG,CAAA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iN,aAAA,CAACvN,QAAA,CAAAwN,MAAM,qBACLhO,MAAA,CAAAc,OAAA,CAAAiN,aAAA,CAAC5N,kBAAA,CAAA8N,YAAY;IACXC,YAAY;IACZ/H,GAAG,EAAEkC,SAAU;IACf8F,OAAO,EAAE,CAACvH,iBAAkB;IAC5BwH,WAAW;EAAA,gBAEXpO,MAAA,CAAAc,OAAA,CAAAiN,aAAA,CAACxN,OAAA,CAAA8N,eAAe,EAAArM,QAAA;IACdsM,QAAQ,EAAE,CAAC;EAAE,GACThH,IAAI;IACRJ,SAAS,EAAE,IAAAqH,mBAAU,EAAC,cAAc,EAAErH,SAAS,CAAE;IACjD,cAAY1B,IAAI,GAAG,MAAM,GAAG,SAAU;IACtC2B,aAAa,EAAEiG,iBAAkB;IACjChG,OAAO,EAAEkG,WAAY;IACrBjG,SAAS,EAAEiE;EAAc,iBAEzBtL,MAAA,CAAAc,OAAA,CAAAiN,aAAA,CAACvN,QAAA,CAAAgO,uBAAuB;IAAC5K,KAAK,EAAEqF;EAAe,GAC5C2E,OACsB,CAAC,eAC1B5N,MAAA,CAAAc,OAAA,CAAAiN,aAAA;IAAK5H,GAAG,EAAE6C,cAAe;IAAC9B,SAAS,EAAC;EAAwB,CAAE,CAC/C,CACL,CACR,CAAC;AAEb,CACF,CAAC;AAEDnB,SAAS,CAAC0I,WAAW,GAAG,WAAW","ignoreList":[]}
|
|
@@ -13,6 +13,6 @@ var backdropIn = (0, _styledComponents.keyframes)(["from{background-color:transp
|
|
|
13
13
|
var StyledModalRoot = exports.StyledModalRoot = _styledComponents.default.dialog.withConfig({
|
|
14
14
|
displayName: "Styles__StyledModalRoot",
|
|
15
15
|
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
|
|
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
17
|
StyledModalRoot.displayName = "StyledModalRoot";
|
|
18
18
|
//# 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
|
|
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,OAAA,IAAAE,CAA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 @@ export const ConfirmDialog = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14
14
|
onConfirm = _ref.onConfirm,
|
|
15
15
|
className = _ref.className,
|
|
16
16
|
_ref$dialogTitle = _ref.dialogTitle,
|
|
17
|
-
dialogTitle = _ref$dialogTitle === void 0 ? "Discard
|
|
17
|
+
dialogTitle = _ref$dialogTitle === void 0 ? "Discard Changes" : _ref$dialogTitle,
|
|
18
18
|
_ref$dialogContent = _ref.dialogContent,
|
|
19
19
|
dialogContent = _ref$dialogContent === void 0 ? "All unsaved changes will be lost." : _ref$dialogContent,
|
|
20
20
|
_ref$confirmBtnText = _ref.confirmBtnText,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmDialog.js","names":["React","forwardRef","useCallback","useEffect","useState","classnames","Button","Checkbox","Dialog","StyledConfirmation","usePropWarning","Body2","CONFIRMATION_CHECKBOX_ID","ConfirmDialog","_ref","ref","_ref$open","open","onCancel","onConfirm","className","_ref$dialogTitle","dialogTitle","_ref$dialogContent","dialogContent","_ref$confirmBtnText","confirmBtnText","_ref$cancelBtnText","cancelBtnText","_ref$shouldShowCancel","shouldShowCancelButton","_ref$isLoading","isLoading","confirmationLabel","_ref$initialFocus","initialFocus","size","height","native","_useState","confirmed","setConfirmed","isConfirmBlocked","Boolean","handleToggleConfirmed","event","target","checked","createElement","onClose","disableCloseOnEsc","role","Title","ContentDivider","Content","lineHeight","color","whitespace","id","onChange","disabled","htmlFor","Actions","variant","onClick","autoFocus","type","displayName"],"sources":["../../../../src/components/ConfirmDialog/ConfirmDialog.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useEffect, useState } from \"react\";\n\nimport classnames from \"classnames\";\n\nimport { Button } from \"../Button/Button\";\nimport { Checkbox } from \"../Checkbox\";\nimport { Dialog } from \"../Dialog\";\nimport { StyledConfirmation } from \"./Styles\";\nimport { DialogSize } from \"../Dialog/Styles\";\nimport { usePropWarning } from \"../Dialog/usePropWarning\";\nimport { Body2 } from \"../Typography/Variants/Body2\";\n\nconst CONFIRMATION_CHECKBOX_ID = \"confirm-dialog-confirmation\";\n\nexport interface ConfirmDialogProps {\n open?: boolean;\n onCancel?: () => void;\n onConfirm?: () => void;\n className?: string;\n dialogTitle?: string;\n dialogContent?: React.ReactNode;\n confirmBtnText?: string;\n cancelBtnText?: string;\n shouldShowCancelButton?: boolean;\n isLoading?: boolean;\n confirmationLabel?: string;\n /**\n * The button that has the focus when the confirmation opens. Cancel by default, so that a confirmation of a\n * destructive action is never one Enter away; a confirmation without Cancel focuses its confirm button.\n */\n initialFocus?: \"cancel\" | \"confirm\";\n size?: DialogSize;\n height?: string;\n /**\n * @deprecated Every confirmation is a native modal alert dialog now. The prop is ignored, with a warning in\n * development, and will be removed.\n */\n native?: boolean;\n}\n\nexport const ConfirmDialog = forwardRef<HTMLDialogElement, ConfirmDialogProps>(\n (\n {\n open = false,\n onCancel,\n onConfirm,\n className,\n dialogTitle = \"Discard
|
|
1
|
+
{"version":3,"file":"ConfirmDialog.js","names":["React","forwardRef","useCallback","useEffect","useState","classnames","Button","Checkbox","Dialog","StyledConfirmation","usePropWarning","Body2","CONFIRMATION_CHECKBOX_ID","ConfirmDialog","_ref","ref","_ref$open","open","onCancel","onConfirm","className","_ref$dialogTitle","dialogTitle","_ref$dialogContent","dialogContent","_ref$confirmBtnText","confirmBtnText","_ref$cancelBtnText","cancelBtnText","_ref$shouldShowCancel","shouldShowCancelButton","_ref$isLoading","isLoading","confirmationLabel","_ref$initialFocus","initialFocus","size","height","native","_useState","confirmed","setConfirmed","isConfirmBlocked","Boolean","handleToggleConfirmed","event","target","checked","createElement","onClose","disableCloseOnEsc","role","Title","ContentDivider","Content","lineHeight","color","whitespace","id","onChange","disabled","htmlFor","Actions","variant","onClick","autoFocus","type","displayName"],"sources":["../../../../src/components/ConfirmDialog/ConfirmDialog.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useEffect, useState } from \"react\";\n\nimport classnames from \"classnames\";\n\nimport { Button } from \"../Button/Button\";\nimport { Checkbox } from \"../Checkbox\";\nimport { Dialog } from \"../Dialog\";\nimport { StyledConfirmation } from \"./Styles\";\nimport { DialogSize } from \"../Dialog/Styles\";\nimport { usePropWarning } from \"../Dialog/usePropWarning\";\nimport { Body2 } from \"../Typography/Variants/Body2\";\n\nconst CONFIRMATION_CHECKBOX_ID = \"confirm-dialog-confirmation\";\n\nexport interface ConfirmDialogProps {\n open?: boolean;\n onCancel?: () => void;\n onConfirm?: () => void;\n className?: string;\n dialogTitle?: string;\n dialogContent?: React.ReactNode;\n confirmBtnText?: string;\n cancelBtnText?: string;\n shouldShowCancelButton?: boolean;\n isLoading?: boolean;\n confirmationLabel?: string;\n /**\n * The button that has the focus when the confirmation opens. Cancel by default, so that a confirmation of a\n * destructive action is never one Enter away; a confirmation without Cancel focuses its confirm button.\n */\n initialFocus?: \"cancel\" | \"confirm\";\n size?: DialogSize;\n height?: string;\n /**\n * @deprecated Every confirmation is a native modal alert dialog now. The prop is ignored, with a warning in\n * development, and will be removed.\n */\n native?: boolean;\n}\n\nexport const ConfirmDialog = forwardRef<HTMLDialogElement, ConfirmDialogProps>(\n (\n {\n open = false,\n onCancel,\n onConfirm,\n className,\n dialogTitle = \"Discard Changes\",\n dialogContent = \"All unsaved changes will be lost.\",\n confirmBtnText = \"OK\",\n cancelBtnText = \"Cancel\",\n shouldShowCancelButton = true,\n isLoading = false,\n confirmationLabel,\n initialFocus = \"cancel\",\n size,\n height,\n native,\n },\n ref\n ) => {\n const [confirmed, setConfirmed] = useState(false);\n\n usePropWarning(\n \"ConfirmDialog\",\n \"native\",\n native,\n \"removed\",\n \"Every confirmation is a native modal now, so remove it.\"\n );\n const isConfirmBlocked = Boolean(confirmationLabel) && !confirmed;\n\n const handleToggleConfirmed = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) =>\n setConfirmed(event.target.checked),\n []\n );\n\n useEffect(() => {\n if (!open) {\n setConfirmed(false);\n }\n }, [open]);\n\n return (\n <Dialog\n ref={ref}\n open={open}\n onClose={onCancel}\n className={classnames(\"c-confirm-dialog\", className)}\n disableCloseOnEsc={isLoading}\n size={size}\n height={height}\n role=\"alertdialog\"\n >\n <Dialog.Title>{dialogTitle}</Dialog.Title>\n <Dialog.ContentDivider />\n <Dialog.Content>\n <Body2 lineHeight=\"loose\" color=\"secondary\" whitespace=\"pre-line\">\n {dialogContent}\n </Body2>\n {confirmationLabel ? (\n <StyledConfirmation className=\"c-confirm-dialog--confirmation\">\n <Checkbox\n id={CONFIRMATION_CHECKBOX_ID}\n checked={confirmed}\n onChange={handleToggleConfirmed}\n disabled={isLoading}\n />\n <label htmlFor={CONFIRMATION_CHECKBOX_ID}>\n <Body2 color=\"secondary\">{confirmationLabel}</Body2>\n </label>\n </StyledConfirmation>\n ) : null}\n </Dialog.Content>\n <Dialog.ContentDivider />\n <Dialog.Actions>\n <Button\n variant=\"primary\"\n onClick={onConfirm}\n disabled={isLoading || isConfirmBlocked}\n autoFocus={initialFocus === \"confirm\" || !shouldShowCancelButton}\n >\n {confirmBtnText}\n </Button>\n {shouldShowCancelButton ? (\n <Button\n variant=\"secondary\"\n data-action=\"cancel\"\n onClick={onCancel}\n type=\"button\"\n disabled={isLoading}\n autoFocus={initialFocus === \"cancel\"}\n >\n {cancelBtnText}\n </Button>\n ) : null}\n </Dialog.Actions>\n </Dialog>\n );\n }\n);\n\nConfirmDialog.displayName = \"ConfirmDialog\";\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAE3E,OAAOC,UAAU,MAAM,YAAY;AAEnC,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,QAAQ,QAAQ,aAAa;AACtC,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,kBAAkB,QAAQ,UAAU;AAE7C,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,KAAK,QAAQ,8BAA8B;AAEpD,MAAMC,wBAAwB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,EAAE9C,wBAAyB;IAC7BmC,OAAO,EAAEP,SAAU;IACnBmB,QAAQ,EAAEf,qBAAsB;IAChCgB,QAAQ,EAAE5B;EAAU,CACrB,CAAC,eACFhC,KAAA,CAAAgD,aAAA;IAAOa,OAAO,EAAEjD;EAAyB,gBACvCZ,KAAA,CAAAgD,aAAA,CAACrC,KAAK;IAAC6C,KAAK,EAAC;EAAW,GAAEvB,iBAAyB,CAC9C,CACW,CAAC,GACnB,IACU,CAAC,eACjBjC,KAAA,CAAAgD,aAAA,CAACxC,MAAM,CAAC6C,cAAc,MAAE,CAAC,eACzBrD,KAAA,CAAAgD,aAAA,CAACxC,MAAM,CAACsD,OAAO,qBACb9D,KAAA,CAAAgD,aAAA,CAAC1C,MAAM;IACLyD,OAAO,EAAC,SAAS;IACjBC,OAAO,EAAE7C,SAAU;IACnByC,QAAQ,EAAE5B,SAAS,IAAIU,gBAAiB;IACxCuB,SAAS,EAAE9B,YAAY,KAAK,SAAS,IAAI,CAACL;EAAuB,GAEhEJ,cACK,CAAC,EACRI,sBAAsB,gBACrB9B,KAAA,CAAAgD,aAAA,CAAC1C,MAAM;IACLyD,OAAO,EAAC,WAAW;IACnB,eAAY,QAAQ;IACpBC,OAAO,EAAE9C,QAAS;IAClBgD,IAAI,EAAC,QAAQ;IACbN,QAAQ,EAAE5B,SAAU;IACpBiC,SAAS,EAAE9B,YAAY,KAAK;EAAS,GAEpCP,aACK,CAAC,GACP,IACU,CACV,CAAC;AAEb,CACF,CAAC;AAEDf,aAAa,CAACsD,WAAW,GAAG,eAAe","ignoreList":[]}
|
|
@@ -15,7 +15,10 @@ export interface ModalRootProps extends Omit<HTMLAttributes<HTMLDialogElement>,
|
|
|
15
15
|
disableCloseOnEsc?: boolean;
|
|
16
16
|
disableBackgroundClick?: boolean;
|
|
17
17
|
disableScrollLock?: boolean;
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* Closing leaves the focus off the element that had it before the dialog opened, also when the owner unmounts it.
|
|
20
|
+
* An open dialog under it takes the focus itself.
|
|
21
|
+
*/
|
|
19
22
|
disableReturnFocus?: boolean;
|
|
20
23
|
/**
|
|
21
24
|
* The dialog counts as opened before the sheets that are open, so they move into its overlay root and stay above
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalRoot.d.ts","sourceRoot":"","sources":["../../../../src/components/ModalRoot/ModalRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAEZ,cAAc,EAEd,UAAU,EAEV,SAAS,EAMV,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ModalRoot.d.ts","sourceRoot":"","sources":["../../../../src/components/ModalRoot/ModalRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAEZ,cAAc,EAEd,UAAU,EAEV,SAAS,EAMV,MAAM,OAAO,CAAC;AAmBf,MAAM,MAAM,sBAAsB,GAAG,QAAQ,GAAG,UAAU,CAAC;AA2D3D,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,OAAO,CAAC;IACZ,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,cACf,SAAQ,IAAI,CACV,cAAc,CAAC,iBAAiB,CAAC,EACjC,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,CAC7C;IACD,IAAI,EAAE,OAAO,CAAC;IACd,qEAAqE;IACrE,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,sBAAsB,KAAK,IAAI,CAAC;IAC1D,6HAA6H;IAC7H,gBAAgB,CAAC,EAAE,CACjB,MAAM,EAAE,sBAAsB,EAC9B,KAAK,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAClC,IAAI,CAAC;IACV,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,iBAAiB,CAAC,EAAE,OA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