@activecollab/components 2.0.526 → 2.0.528
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/Dialog/Dialog.js +32 -187
- package/dist/cjs/components/Dialog/Dialog.js.map +1 -1
- package/dist/cjs/components/Dialog/DialogFrame.js +209 -0
- package/dist/cjs/components/Dialog/DialogFrame.js.map +1 -0
- package/dist/cjs/components/GlobalPortal/GlobalPortal.js +2 -16
- package/dist/cjs/components/GlobalPortal/GlobalPortal.js.map +1 -1
- package/dist/cjs/components/Modal/Modal.js +17 -108
- package/dist/cjs/components/Modal/Modal.js.map +1 -1
- package/dist/cjs/components/Modal/ModalBase.js +125 -0
- package/dist/cjs/components/Modal/ModalBase.js.map +1 -0
- package/dist/cjs/components/ModalRoot/ModalRoot.js +21 -1
- package/dist/cjs/components/ModalRoot/ModalRoot.js.map +1 -1
- package/dist/cjs/components/ModalRoot/modalRootStack.js +16 -1
- package/dist/cjs/components/ModalRoot/modalRootStack.js.map +1 -1
- package/dist/cjs/components/ModalRoot/useModalStackHost.js +47 -0
- package/dist/cjs/components/ModalRoot/useModalStackHost.js.map +1 -0
- package/dist/cjs/components/ObjectFormModal/ObjectFormModal.js +41 -64
- package/dist/cjs/components/ObjectFormModal/ObjectFormModal.js.map +1 -1
- package/dist/cjs/components/Sheet/Sheet.js +19 -5
- package/dist/cjs/components/Sheet/Sheet.js.map +1 -1
- package/dist/cjs/components/Sheet/useHostAboveOpenModal.js +56 -0
- package/dist/cjs/components/Sheet/useHostAboveOpenModal.js.map +1 -0
- package/dist/esm/components/Dialog/Dialog.d.ts +3 -3
- package/dist/esm/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/esm/components/Dialog/Dialog.js +34 -175
- package/dist/esm/components/Dialog/Dialog.js.map +1 -1
- package/dist/esm/components/Dialog/DialogFrame.d.ts +14 -0
- package/dist/esm/components/Dialog/DialogFrame.d.ts.map +1 -0
- package/dist/esm/components/Dialog/DialogFrame.js +180 -0
- package/dist/esm/components/Dialog/DialogFrame.js.map +1 -0
- package/dist/esm/components/GlobalPortal/GlobalPortal.d.ts.map +1 -1
- package/dist/esm/components/GlobalPortal/GlobalPortal.js +3 -17
- package/dist/esm/components/GlobalPortal/GlobalPortal.js.map +1 -1
- package/dist/esm/components/Modal/Modal.d.ts +8 -17
- package/dist/esm/components/Modal/Modal.d.ts.map +1 -1
- package/dist/esm/components/Modal/Modal.js +18 -99
- package/dist/esm/components/Modal/Modal.js.map +1 -1
- package/dist/esm/components/Modal/ModalBase.d.ts +19 -0
- package/dist/esm/components/Modal/ModalBase.d.ts.map +1 -0
- package/dist/esm/components/Modal/ModalBase.js +108 -0
- package/dist/esm/components/Modal/ModalBase.js.map +1 -0
- package/dist/esm/components/ModalRoot/ModalRoot.d.ts.map +1 -1
- package/dist/esm/components/ModalRoot/ModalRoot.js +21 -1
- package/dist/esm/components/ModalRoot/ModalRoot.js.map +1 -1
- package/dist/esm/components/ModalRoot/modalRootStack.d.ts +4 -0
- package/dist/esm/components/ModalRoot/modalRootStack.d.ts.map +1 -1
- package/dist/esm/components/ModalRoot/modalRootStack.js +13 -0
- package/dist/esm/components/ModalRoot/modalRootStack.js.map +1 -1
- package/dist/esm/components/ModalRoot/useModalStackHost.d.ts +8 -0
- package/dist/esm/components/ModalRoot/useModalStackHost.d.ts.map +1 -0
- package/dist/esm/components/ModalRoot/useModalStackHost.js +35 -0
- package/dist/esm/components/ModalRoot/useModalStackHost.js.map +1 -0
- package/dist/esm/components/ObjectFormModal/ObjectFormModal.d.ts.map +1 -1
- package/dist/esm/components/ObjectFormModal/ObjectFormModal.js +42 -65
- package/dist/esm/components/ObjectFormModal/ObjectFormModal.js.map +1 -1
- package/dist/esm/components/Sheet/Sheet.d.ts.map +1 -1
- package/dist/esm/components/Sheet/Sheet.js +19 -5
- package/dist/esm/components/Sheet/Sheet.js.map +1 -1
- package/dist/esm/components/Sheet/useHostAboveOpenModal.d.ts +13 -0
- package/dist/esm/components/Sheet/useHostAboveOpenModal.d.ts.map +1 -0
- package/dist/esm/components/Sheet/useHostAboveOpenModal.js +42 -0
- package/dist/esm/components/Sheet/useHostAboveOpenModal.js.map +1 -0
- package/dist/index.js +1115 -972
- 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
- package/dist/cjs/hooks/useDeprecation.js +0 -15
- package/dist/cjs/hooks/useDeprecation.js.map +0 -1
- package/dist/esm/hooks/useDeprecation.d.ts +0 -2
- package/dist/esm/hooks/useDeprecation.d.ts.map +0 -1
- package/dist/esm/hooks/useDeprecation.js +0 -9
- package/dist/esm/hooks/useDeprecation.js.map +0 -1
|
@@ -6,55 +6,37 @@ import classnames from "classnames";
|
|
|
6
6
|
import { StyledObjectFormModal, StyledObjectFormModalClose } from "./Styles";
|
|
7
7
|
import { LayerContextProvider } from "../../helpers";
|
|
8
8
|
import { layers } from "../../utils";
|
|
9
|
-
import {
|
|
9
|
+
import { DialogFrame } from "../Dialog/DialogFrame";
|
|
10
|
+
import { dialogSizes } from "../Dialog/Styles";
|
|
10
11
|
import { useFluidHeightAnimation } from "../Dialog/useFluidHeightAnimation";
|
|
11
12
|
import { CancelCrossIcon } from "../Icons";
|
|
12
|
-
import { Modal } from "../Modal";
|
|
13
|
-
import { SlideFromTop, SLIDE_FROM_TOP_ENTER, SLIDE_FROM_TOP_EXIT } from "../Transitions/SlideFromTop";
|
|
14
13
|
// A sheet puts its content on a lower layer. The form modal always covers the page, the menu and the sheet.
|
|
15
14
|
const MODAL_LAYER = {
|
|
16
15
|
zIndex: layers.skyscraper
|
|
17
16
|
};
|
|
18
|
-
|
|
19
|
-
// Modal only treats a child as a transition when its props already carry `in`.
|
|
20
|
-
const ObjectFormModalSurface = _ref => {
|
|
21
|
-
let _ref$in = _ref.in,
|
|
22
|
-
inProp = _ref$in === void 0 ? false : _ref$in,
|
|
23
|
-
onEnter = _ref.onEnter,
|
|
24
|
-
onExited = _ref.onExited,
|
|
25
|
-
children = _ref.children;
|
|
26
|
-
return /*#__PURE__*/React.createElement(StyledDialogViewport, {
|
|
27
|
-
className: "c-object-form-modal-viewport"
|
|
28
|
-
}, /*#__PURE__*/React.createElement(SlideFromTop, {
|
|
29
|
-
in: inProp,
|
|
30
|
-
onEnter: onEnter,
|
|
31
|
-
onExited: onExited
|
|
32
|
-
}, children));
|
|
33
|
-
};
|
|
34
|
-
ObjectFormModalSurface.displayName = "ObjectFormModalSurface";
|
|
35
|
-
export const ObjectFormModal = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
17
|
+
export const ObjectFormModal = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
36
18
|
var _dialogSizes$size;
|
|
37
|
-
let children =
|
|
38
|
-
|
|
39
|
-
open =
|
|
40
|
-
onClose =
|
|
41
|
-
label =
|
|
42
|
-
|
|
43
|
-
size =
|
|
44
|
-
|
|
45
|
-
enableBackgroundClick =
|
|
46
|
-
|
|
47
|
-
disableCloseOnEsc =
|
|
48
|
-
|
|
49
|
-
disableFocusLock =
|
|
50
|
-
|
|
51
|
-
fill =
|
|
52
|
-
|
|
53
|
-
closeButton =
|
|
54
|
-
|
|
55
|
-
closeLabel =
|
|
56
|
-
className =
|
|
57
|
-
rest = _objectWithoutPropertiesLoose(
|
|
19
|
+
let children = _ref.children,
|
|
20
|
+
_ref$open = _ref.open,
|
|
21
|
+
open = _ref$open === void 0 ? false : _ref$open,
|
|
22
|
+
onClose = _ref.onClose,
|
|
23
|
+
label = _ref.label,
|
|
24
|
+
_ref$size = _ref.size,
|
|
25
|
+
size = _ref$size === void 0 ? "s" : _ref$size,
|
|
26
|
+
_ref$enableBackground = _ref.enableBackgroundClick,
|
|
27
|
+
enableBackgroundClick = _ref$enableBackground === void 0 ? false : _ref$enableBackground,
|
|
28
|
+
_ref$disableCloseOnEs = _ref.disableCloseOnEsc,
|
|
29
|
+
disableCloseOnEsc = _ref$disableCloseOnEs === void 0 ? false : _ref$disableCloseOnEs,
|
|
30
|
+
_ref$disableFocusLock = _ref.disableFocusLock,
|
|
31
|
+
disableFocusLock = _ref$disableFocusLock === void 0 ? false : _ref$disableFocusLock,
|
|
32
|
+
_ref$fill = _ref.fill,
|
|
33
|
+
fill = _ref$fill === void 0 ? false : _ref$fill,
|
|
34
|
+
_ref$closeButton = _ref.closeButton,
|
|
35
|
+
closeButton = _ref$closeButton === void 0 ? false : _ref$closeButton,
|
|
36
|
+
_ref$closeLabel = _ref.closeLabel,
|
|
37
|
+
closeLabel = _ref$closeLabel === void 0 ? "Close" : _ref$closeLabel,
|
|
38
|
+
className = _ref.className,
|
|
39
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
58
40
|
const _useState = useState(null),
|
|
59
41
|
surfaceNode = _useState[0],
|
|
60
42
|
setSurfaceNode = _useState[1];
|
|
@@ -69,33 +51,28 @@ export const ObjectFormModal = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
69
51
|
useFluidHeightAnimation(surfaceNode, true);
|
|
70
52
|
return /*#__PURE__*/React.createElement(LayerContextProvider, {
|
|
71
53
|
value: MODAL_LAYER
|
|
72
|
-
}, /*#__PURE__*/React.createElement(
|
|
54
|
+
}, /*#__PURE__*/React.createElement(DialogFrame, {
|
|
73
55
|
open: open,
|
|
74
56
|
onClose: onClose,
|
|
75
|
-
|
|
57
|
+
enableBackgroundClick: enableBackgroundClick,
|
|
76
58
|
disableCloseOnEsc: disableCloseOnEsc,
|
|
77
59
|
disableFocusLock: disableFocusLock,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
})
|
|
94
|
-
type: "button",
|
|
95
|
-
className: "c-object-form-modal-close",
|
|
96
|
-
"aria-label": closeLabel,
|
|
97
|
-
onClick: onClose
|
|
98
|
-
}, /*#__PURE__*/React.createElement(CancelCrossIcon, null)) : null, children))));
|
|
60
|
+
surface: /*#__PURE__*/React.createElement(StyledObjectFormModal, _extends({}, rest, {
|
|
61
|
+
ref: setSurface,
|
|
62
|
+
role: "dialog",
|
|
63
|
+
"aria-modal": "true",
|
|
64
|
+
"aria-label": label,
|
|
65
|
+
$maxWidth: (_dialogSizes$size = dialogSizes[size]) != null ? _dialogSizes$size : dialogSizes.s,
|
|
66
|
+
$fill: fill || closeButton,
|
|
67
|
+
$closeButton: closeButton,
|
|
68
|
+
className: classnames("c-object-form-modal", className)
|
|
69
|
+
}), closeButton ? /*#__PURE__*/React.createElement(StyledObjectFormModalClose, {
|
|
70
|
+
type: "button",
|
|
71
|
+
className: "c-object-form-modal-close",
|
|
72
|
+
"aria-label": closeLabel,
|
|
73
|
+
onClick: onClose
|
|
74
|
+
}, /*#__PURE__*/React.createElement(CancelCrossIcon, null)) : null, children)
|
|
75
|
+
}));
|
|
99
76
|
});
|
|
100
77
|
ObjectFormModal.displayName = "ObjectFormModal";
|
|
101
78
|
//# sourceMappingURL=ObjectFormModal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectFormModal.js","names":["React","forwardRef","useCallback","useState","classnames","StyledObjectFormModal","StyledObjectFormModalClose","LayerContextProvider","layers","
|
|
1
|
+
{"version":3,"file":"ObjectFormModal.js","names":["React","forwardRef","useCallback","useState","classnames","StyledObjectFormModal","StyledObjectFormModalClose","LayerContextProvider","layers","DialogFrame","dialogSizes","useFluidHeightAnimation","CancelCrossIcon","MODAL_LAYER","zIndex","skyscraper","ObjectFormModal","_ref","ref","_dialogSizes$size","children","_ref$open","open","onClose","label","_ref$size","size","_ref$enableBackground","enableBackgroundClick","_ref$disableCloseOnEs","disableCloseOnEsc","_ref$disableFocusLock","disableFocusLock","_ref$fill","fill","_ref$closeButton","closeButton","_ref$closeLabel","closeLabel","className","rest","_objectWithoutPropertiesLoose","_excluded","_useState","surfaceNode","setSurfaceNode","setSurface","node","current","createElement","value","surface","_extends","role","$maxWidth","s","$fill","$closeButton","type","onClick","displayName"],"sources":["../../../../src/components/ObjectFormModal/ObjectFormModal.tsx"],"sourcesContent":["import React, {\n forwardRef,\n HTMLAttributes,\n PropsWithChildren,\n useCallback,\n useState,\n} from \"react\";\n\nimport classnames from \"classnames\";\n\nimport { StyledObjectFormModal, StyledObjectFormModalClose } from \"./Styles\";\nimport { LayerContextProvider } from \"../../helpers\";\nimport { layers } from \"../../utils\";\nimport { DialogFrame } from \"../Dialog/DialogFrame\";\nimport { DialogSize, dialogSizes } from \"../Dialog/Styles\";\nimport { useFluidHeightAnimation } from \"../Dialog/useFluidHeightAnimation\";\nimport { CancelCrossIcon } from \"../Icons\";\n\nexport interface ObjectFormModalProps extends HTMLAttributes<HTMLDivElement> {\n open?: boolean;\n onClose?: () => void;\n /** Accessible name of the modal, for example \"New Event\". The modal draws no title. */\n label: string;\n /** Width step, the same scale as Dialog. Every step is a max-width. */\n size?: DialogSize;\n /** A click outside keeps the modal open by default, so a form with text in it never closes by accident. */\n enableBackgroundClick?: boolean;\n disableCloseOnEsc?: boolean;\n disableFocusLock?: boolean;\n /** The surface becomes a column, so one part of the content can scroll in place of the modal. */\n fill?: boolean;\n /** A close button beside the top right corner. It turns `fill` on. */\n closeButton?: boolean;\n closeLabel?: string;\n className?: string;\n}\n\n// A sheet puts its content on a lower layer. The form modal always covers the page, the menu and the sheet.\nconst MODAL_LAYER = { zIndex: layers.skyscraper };\n\nexport const ObjectFormModal = forwardRef<\n HTMLDivElement,\n PropsWithChildren<ObjectFormModalProps>\n>(\n (\n {\n children,\n open = false,\n onClose,\n label,\n size = \"s\",\n enableBackgroundClick = false,\n disableCloseOnEsc = false,\n disableFocusLock = false,\n fill = false,\n closeButton = false,\n closeLabel = \"Close\",\n className,\n ...rest\n },\n ref\n ) => {\n const [surfaceNode, setSurfaceNode] = useState<HTMLDivElement | null>(null);\n\n const setSurface = useCallback(\n (node: HTMLDivElement | null) => {\n setSurfaceNode(node);\n\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n },\n [ref]\n );\n\n useFluidHeightAnimation(surfaceNode, true);\n\n return (\n <LayerContextProvider value={MODAL_LAYER}>\n <DialogFrame\n open={open}\n onClose={onClose}\n enableBackgroundClick={enableBackgroundClick}\n disableCloseOnEsc={disableCloseOnEsc}\n disableFocusLock={disableFocusLock}\n surface={\n <StyledObjectFormModal\n {...rest}\n ref={setSurface}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={label}\n $maxWidth={dialogSizes[size] ?? dialogSizes.s}\n $fill={fill || closeButton}\n $closeButton={closeButton}\n className={classnames(\"c-object-form-modal\", className)}\n >\n {closeButton ? (\n <StyledObjectFormModalClose\n type=\"button\"\n className=\"c-object-form-modal-close\"\n aria-label={closeLabel}\n onClick={onClose}\n >\n <CancelCrossIcon />\n </StyledObjectFormModalClose>\n ) : null}\n {children}\n </StyledObjectFormModal>\n }\n />\n </LayerContextProvider>\n );\n }\n);\n\nObjectFormModal.displayName = \"ObjectFormModal\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IACVC,UAAU,EAGVC,WAAW,EACXC,QAAQ,QACH,OAAO;AAEd,OAAOC,UAAU,MAAM,YAAY;AAEnC,SAASC,qBAAqB,EAAEC,0BAA0B,QAAQ,UAAU;AAC5E,SAASC,oBAAoB,QAAQ,eAAe;AACpD,SAASC,MAAM,QAAQ,aAAa;AACpC,SAASC,WAAW,QAAQ,uBAAuB;AACnD,SAAqBC,WAAW,QAAQ,kBAAkB;AAC1D,SAASC,uBAAuB,QAAQ,mCAAmC;AAC3E,SAASC,eAAe,QAAQ,UAAU;AAqB1C;AACA,MAAMC,WAAW,GAAG;EAAEC,MAAM,EAAEN,MAAM,CAACO;AAAW,CAAC;AAEjD,OAAO,MAAMC,eAAe,gBAAGf,UAAU,CAIvC,CAAAgB,IAAA,EAgBEC,GAAG,KACA;EAAA,IAAAC,iBA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B","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sheet.d.ts","sourceRoot":"","sources":["../../../../src/components/Sheet/Sheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAMZ,aAAa,EAId,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Sheet.d.ts","sourceRoot":"","sources":["../../../../src/components/Sheet/Sheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAMZ,aAAa,EAId,MAAM,OAAO,CAAC;AA8Ff,UAAU,YAAY;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,MAAM;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAChD,QAAQ,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IACvC,IAAI,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC5B,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,uEAAuE;IACvE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAID,eAAO,MAAM,KAAK,oHA+MjB,CAAC"}
|
|
@@ -4,11 +4,13 @@ const _excluded = ["children", "onClose", "controls", "open", "animation", "posi
|
|
|
4
4
|
import React, { useCallback, useEffect, forwardRef, useState, useImperativeHandle, useRef } from "react";
|
|
5
5
|
import classnames from "classnames";
|
|
6
6
|
import { StyledAnimatedSpan, StyledCssTransition, StyledHeader, StyledIconsWrapperSmall, StyledListSeparator, StyledSheetIcons, StyledSheetWrapper, SHEET_ENTER_MS, SHEET_EXIT_MS, StyledSheetSurface, StyledSheetWrapperPaper } from "./Styles";
|
|
7
|
+
import { PortalContainerProvider, usePortalContainer } from "../../helpers";
|
|
7
8
|
import { IconButton } from "../IconButton";
|
|
8
9
|
import { Overlay } from "../Overlay";
|
|
9
10
|
import { Tooltip } from "../Tooltip";
|
|
10
11
|
import { Fade } from "../Transitions";
|
|
11
12
|
import { Window } from "../Window";
|
|
13
|
+
import { useHostAboveOpenModal } from "./useHostAboveOpenModal";
|
|
12
14
|
const INSET_VAR = "--c-sheet-inset-right";
|
|
13
15
|
const INSET_DURATION_VAR = "--c-sheet-inset-duration";
|
|
14
16
|
// The controls column stands 48px left of the sheet. With less room it is not there.
|
|
@@ -100,12 +102,12 @@ export const Sheet = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
100
102
|
const _useState2 = useState(true),
|
|
101
103
|
exited = _useState2[0],
|
|
102
104
|
setExited = _useState2[1];
|
|
103
|
-
// Clicks pass through the overlay until it has faded in, and again from the first moment it fades out.
|
|
105
|
+
// Clicks pass through the overlay until it has faded in, and again from the first moment it fades out. Over a
|
|
106
|
+
// native dialog it takes them all the time, since a click through it would hit the dialog's backdrop.
|
|
104
107
|
const _useState3 = useState(false),
|
|
105
108
|
overlayEntered = _useState3[0],
|
|
106
109
|
setOverlayEntered = _useState3[1];
|
|
107
110
|
const wrapperRef = useRef(null);
|
|
108
|
-
useSheetInset(wrapperRef, open && position === "right");
|
|
109
111
|
useEffect(() => {
|
|
110
112
|
setOpen(defaultOpen);
|
|
111
113
|
}, [defaultOpen]);
|
|
@@ -134,10 +136,17 @@ export const Sheet = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
134
136
|
useImperativeHandle(ref, () => ({
|
|
135
137
|
close: handleClose
|
|
136
138
|
}));
|
|
137
|
-
|
|
139
|
+
const portalContainer = usePortalContainer();
|
|
140
|
+
const _useHostAboveOpenModa = useHostAboveOpenModal(open || !exited, portalContainer === undefined),
|
|
141
|
+
modalHost = _useHostAboveOpenModa.host,
|
|
142
|
+
modalHostPending = _useHostAboveOpenModa.pending;
|
|
143
|
+
|
|
144
|
+
// A pending sheet renders no wrapper yet, so the inset starts once it does.
|
|
145
|
+
useSheetInset(wrapperRef, open && position === "right" && !modalHostPending);
|
|
146
|
+
if (!open && exited || modalHostPending) {
|
|
138
147
|
return null;
|
|
139
148
|
}
|
|
140
|
-
|
|
149
|
+
const sheetWindow = /*#__PURE__*/React.createElement(Window, _extends({}, rest, {
|
|
141
150
|
// The overlay and the sheet take the clicks, so the window lets them through where the overlay does.
|
|
142
151
|
style: _extends({}, rest.style, {
|
|
143
152
|
pointerEvents: "none"
|
|
@@ -154,7 +163,7 @@ export const Sheet = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
154
163
|
onClick: handleBackgroundClick,
|
|
155
164
|
disableBackgroundColor: disableBackgroundColor,
|
|
156
165
|
style: {
|
|
157
|
-
pointerEvents: open && overlayEntered ? "auto" : "none"
|
|
166
|
+
pointerEvents: modalHost || open && overlayEntered ? "auto" : "none"
|
|
158
167
|
}
|
|
159
168
|
})), /*#__PURE__*/React.createElement(StyledSheetWrapper, {
|
|
160
169
|
ref: wrapperRef,
|
|
@@ -206,6 +215,11 @@ export const Sheet = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
206
215
|
variant: "text gray"
|
|
207
216
|
}, IconComponent));
|
|
208
217
|
})), /*#__PURE__*/React.createElement(StyledListSeparator, null)), children)))));
|
|
218
|
+
|
|
219
|
+
// The provider is always there, so the Window keeps its place in the tree when the sheet gets a host.
|
|
220
|
+
return /*#__PURE__*/React.createElement(PortalContainerProvider, {
|
|
221
|
+
value: modalHost != null ? modalHost : portalContainer
|
|
222
|
+
}, sheetWindow);
|
|
209
223
|
});
|
|
210
224
|
Sheet.displayName = "Sheet";
|
|
211
225
|
//# sourceMappingURL=Sheet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sheet.js","names":["React","useCallback","useEffect","forwardRef","useState","useImperativeHandle","useRef","classnames","StyledAnimatedSpan","StyledCssTransition","StyledHeader","StyledIconsWrapperSmall","StyledListSeparator","StyledSheetIcons","StyledSheetWrapper","SHEET_ENTER_MS","SHEET_EXIT_MS","StyledSheetSurface","StyledSheetWrapperPaper","IconButton","Overlay","Tooltip","Fade","Window","INSET_VAR","INSET_DURATION_VAR","CONTROLS_ROOM","useSheetInset","wrapperRef","isOn","wrapper","current","undefined","root","document","documentElement","update","_wrapper$getBoundingC","getBoundingClientRect","left","style","setProperty","clientWidth","removeProperty","observer","ResizeObserver","isWidth","event","propertyName","startWidth","target","endWidth","observe","window","addEventListener","disconnect","removeEventListener","Sheet","_ref","ref","children","onClose","_ref$controls","controls","_ref$open","open","defaultOpen","_ref$animation","animation","_ref$position","position","_ref$mode","mode","maxWidth","_ref$surface","surface","_ref$disableFocusLock","disableFocusLock","_ref$disableScrollLoc","disableScrollLock","_ref$disableBackgroun","disableBackgroundColor","bodyStyle","bodyClassName","_ref$disableBackgroun2","disableBackgroundClick","rest","_objectWithoutPropertiesLoose","_excluded","_useState","setOpen","_useState2","exited","setExited","_useState3","overlayEntered","setOverlayEntered","handleEnter","handleExited","handleClose","handleOverlayEntered","handleOverlayExit","handleBackgroundClick","preventDefault","close","createElement","_extends","pointerEvents","in","timeout","onEntered","onExit","onClick","className","$position","$mode","$maxWidth","appear","classNames","$direction","onEnter","onExited","length","map","_ref2","index","IconComponent","icon","tooltip","disabled","title","disable","key","$disabled","paperClass","$surface","_ref3","variant","displayName"],"sources":["../../../../src/components/Sheet/Sheet.tsx"],"sourcesContent":["import React, {\n useCallback,\n useEffect,\n forwardRef,\n HTMLAttributes,\n useState,\n CSSProperties,\n MouseEvent,\n useImperativeHandle,\n useRef,\n} from \"react\";\n\nimport classnames from \"classnames\";\n\nimport {\n StyledAnimatedSpan,\n StyledCssTransition,\n StyledHeader,\n StyledIconsWrapperSmall,\n StyledListSeparator,\n StyledSheetIcons,\n StyledSheetWrapper,\n SHEET_ENTER_MS,\n SHEET_EXIT_MS,\n StyledSheetSurface,\n StyledSheetWrapperPaper,\n} from \"./Styles\";\nimport { IconButton } from \"../IconButton\";\nimport { Overlay } from \"../Overlay\";\nimport { Tooltip } from \"../Tooltip\";\nimport { Fade } from \"../Transitions\";\nimport { Window } from \"../Window\";\n\nconst INSET_VAR = \"--c-sheet-inset-right\";\nconst INSET_DURATION_VAR = \"--c-sheet-inset-duration\";\n// The controls column stands 48px left of the sheet. With less room it is not there.\nconst CONTROLS_ROOM = 64;\n\n// A right sheet tells the page, on the root, how far from the right edge it starts, so a floating part of the page\n// can move out of its way with the same timing.\nconst useSheetInset = (\n wrapperRef: React.RefObject<HTMLDivElement>,\n isOn: boolean\n) => {\n useEffect(() => {\n const wrapper = wrapperRef.current;\n\n if (!isOn || !wrapper) {\n return undefined;\n }\n\n const root = document.documentElement;\n const update = () => {\n const { left } = wrapper.getBoundingClientRect();\n\n if (left >= CONTROLS_ROOM) {\n root.style.setProperty(INSET_VAR, `${root.clientWidth - left}px`);\n } else {\n root.style.removeProperty(INSET_VAR);\n }\n };\n const observer =\n typeof ResizeObserver === \"undefined\"\n ? undefined\n : // eslint-disable-next-line compat/compat\n new ResizeObserver(update);\n\n // While the width moves, the edge moves on every frame, so the parts follow it with no timing of their own.\n const isWidth = (event: Event) =>\n (event as TransitionEvent).propertyName === \"max-width\";\n const startWidth = (event: Event) => {\n if (event.target === wrapper && isWidth(event)) {\n root.style.setProperty(INSET_DURATION_VAR, \"0ms\");\n }\n };\n const endWidth = (event: Event) => {\n if (event.target === wrapper && isWidth(event)) {\n root.style.setProperty(INSET_DURATION_VAR, `${SHEET_ENTER_MS}ms`);\n update();\n }\n };\n\n root.style.setProperty(INSET_DURATION_VAR, `${SHEET_ENTER_MS}ms`);\n update();\n observer?.observe(wrapper);\n window.addEventListener(\"resize\", update);\n wrapper.addEventListener(\"transitionrun\", startWidth);\n wrapper.addEventListener(\"transitionend\", endWidth);\n wrapper.addEventListener(\"transitioncancel\", endWidth);\n\n return () => {\n observer?.disconnect();\n window.removeEventListener(\"resize\", update);\n wrapper.removeEventListener(\"transitionrun\", startWidth);\n wrapper.removeEventListener(\"transitionend\", endWidth);\n wrapper.removeEventListener(\"transitioncancel\", endWidth);\n root.style.setProperty(INSET_DURATION_VAR, `${SHEET_EXIT_MS}ms`);\n root.style.removeProperty(INSET_VAR);\n };\n }, [wrapperRef, isOn]);\n};\n\ninterface ControlProps {\n onClick: () => void;\n icon: React.ReactElement;\n tooltip: string;\n disabled: boolean;\n className: string;\n}\n\ninterface ISheet {\n onClose?: () => void;\n controls?: ControlProps[];\n open?: boolean;\n animation?: \"top\" | \"bottom\" | \"left\" | \"right\";\n position?: \"center\" | \"left\" | \"right\";\n mode?: \"normal\" | \"stretch\";\n /** The widest the sheet gets in stretch mode. A number is in pixels. */\n maxWidth?: number | string;\n /** \"sheet\" draws the paper on the sheet surface with large corners. */\n surface?: \"paper\" | \"sheet\";\n disableFocusLock?: boolean;\n disableScrollLock?: boolean;\n disableBackgroundColor?: boolean;\n bodyStyle?: CSSProperties;\n bodyClassName?: string;\n disableBackgroundClick?: boolean;\n}\n\nexport interface SheetMethods {\n close: () => void;\n}\n\ntype SheetProps = ISheet & HTMLAttributes<HTMLDivElement>;\n\nexport const Sheet = forwardRef<SheetMethods, SheetProps>(\n (\n {\n children,\n onClose,\n controls = [],\n open: defaultOpen = false,\n animation = \"top\",\n position = \"center\",\n mode = \"normal\",\n maxWidth,\n surface = \"paper\",\n disableFocusLock = false,\n disableScrollLock = false,\n disableBackgroundColor = false,\n bodyStyle,\n bodyClassName,\n disableBackgroundClick = false,\n ...rest\n },\n ref\n ) => {\n const [open, setOpen] = useState(defaultOpen);\n const [exited, setExited] = useState(true);\n // Clicks pass through the overlay until it has faded in, and again from the first moment it fades out.\n const [overlayEntered, setOverlayEntered] = useState(false);\n const wrapperRef = useRef<HTMLDivElement>(null);\n\n useSheetInset(wrapperRef, open && position === \"right\");\n\n useEffect(() => {\n setOpen(defaultOpen);\n }, [defaultOpen]);\n\n const handleEnter = useCallback(() => {\n setExited(false);\n }, []);\n\n const handleExited = useCallback(() => {\n setExited(true);\n onClose?.();\n }, [onClose]);\n\n const handleClose = useCallback(() => {\n setOpen(false);\n }, []);\n\n const handleOverlayEntered = useCallback(() => {\n setOverlayEntered(true);\n }, []);\n\n const handleOverlayExit = useCallback(() => {\n setOverlayEntered(false);\n }, []);\n\n const handleBackgroundClick = useCallback(\n (event: MouseEvent<HTMLDivElement>) => {\n if (!disableBackgroundClick) {\n event.preventDefault();\n handleClose();\n }\n },\n [disableBackgroundClick, handleClose]\n );\n\n useImperativeHandle(ref, () => ({\n close: handleClose,\n }));\n\n if (!open && exited) {\n return null;\n }\n\n return (\n <Window\n {...rest}\n // The overlay and the sheet take the clicks, so the window lets them through where the overlay does.\n style={{ ...rest.style, pointerEvents: \"none\" }}\n onClose={handleClose}\n disableFocusLock={disableFocusLock}\n disableScrollLock={disableScrollLock}\n >\n <Fade\n in={open}\n timeout={open ? SHEET_ENTER_MS : SHEET_EXIT_MS}\n onEntered={handleOverlayEntered}\n onExit={handleOverlayExit}\n >\n <Overlay\n onClick={handleBackgroundClick}\n disableBackgroundColor={disableBackgroundColor}\n style={{\n pointerEvents: open && overlayEntered ? \"auto\" : \"none\",\n }}\n />\n </Fade>\n <StyledSheetWrapper\n ref={wrapperRef}\n className={classnames(\"c-sheet__wrapper\", bodyClassName)}\n style={bodyStyle}\n $position={position}\n $mode={mode}\n $maxWidth={maxWidth}\n >\n <StyledCssTransition\n appear\n in={open}\n timeout={SHEET_ENTER_MS}\n classNames=\"c-sheet__animation\"\n $direction={animation}\n onEnter={handleEnter}\n onExited={handleExited}\n >\n <StyledSheetSurface>\n {controls.length > 0 && (\n <StyledSheetIcons>\n {controls.map(\n (\n {\n icon: IconComponent,\n tooltip,\n onClick,\n disabled,\n className,\n },\n index\n ) => (\n <Tooltip\n title={tooltip}\n disable={!tooltip || disabled}\n key={`c-sheet-control-${index}`}\n >\n <StyledAnimatedSpan\n onClick={onClick}\n $disabled={disabled}\n className={className}\n >\n {IconComponent}\n </StyledAnimatedSpan>\n </Tooltip>\n )\n )}\n </StyledSheetIcons>\n )}\n <StyledSheetWrapperPaper\n paperClass=\"c-sheet__wrapper__paper\"\n $surface={surface}\n >\n {controls.length > 0 && (\n <StyledHeader>\n <StyledIconsWrapperSmall>\n {controls.map(\n (\n {\n icon: IconComponent,\n tooltip,\n onClick,\n disabled,\n className,\n },\n index\n ) => (\n <Tooltip\n title={tooltip}\n disable={!tooltip || disabled}\n key={index}\n >\n <IconButton\n onClick={onClick}\n disabled={disabled}\n className={className}\n variant=\"text gray\"\n >\n {IconComponent}\n </IconButton>\n </Tooltip>\n )\n )}\n </StyledIconsWrapperSmall>\n <StyledListSeparator />\n </StyledHeader>\n )}\n {children}\n </StyledSheetWrapperPaper>\n </StyledSheetSurface>\n </StyledCssTransition>\n </StyledSheetWrapper>\n </Window>\n );\n }\n);\n\nSheet.displayName = \"Sheet\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IACVC,WAAW,EACXC,SAAS,EACTC,UAAU,EAEVC,QAAQ,EAGRC,mBAAmB,EACnBC,MAAM,QACD,OAAO;AAEd,OAAOC,UAAU,MAAM,YAAY;AAEnC,SACEC,kBAAkB,EAClBC,mBAAmB,EACnBC,YAAY,EACZC,uBAAuB,EACvBC,mBAAmB,EACnBC,gBAAgB,EAChBC,k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AAyB;IACpCC,QAAQ,EAAE5D;EAAQ,GAEjBZ,QAAQ,CAAC2D,MAAM,GAAG,CAAC,iBAClB1H,KAAA,CAAAyG,aAAA,CAAC/F,YAAY,qBACXV,KAAA,CAAAyG,aAAA,CAAC9F,uBAAuB,QACrBoD,QAAQ,CAAC4D,GAAG,CACX,CAAAa,KAAA,EAQEX,KAAK;IAAA,IANGC,aAAa,GAAAU,KAAA,CAAnBT,IAAI;MACJC,OAAO,GAAAQ,KAAA,CAAPR,OAAO;MACPhB,OAAO,GAAAwB,KAAA,CAAPxB,OAAO;MACPiB,QAAQ,GAAAO,KAAA,CAARP,QAAQ;MACRhB,SAAS,GAAAuB,KAAA,CAATvB,SAAS;IAAA,oBAIXjH,KAAA,CAAAyG,aAAA,CAACpF,OAAO;MACN6G,KAAK,EAAEF,OAAQ;MACfG,OAAO,EAAE,CAACH,OAAO,IAAIC,QAAS;MAC9BG,GAAG,EAAEP;IAAM,gBAEX7H,KAAA,CAAAyG,aAAA,CAACtF,UAAU;MACT6F,OAAO,EAAEA,OAAQ;MACjBiB,QAAQ,EAAEA,QAAS;MACnBhB,SAAS,EAAEA,SAAU;MACrBwB,OAAO,EAAC;IAAW,GAElBX,aACS,CACL,CAAC;EAAA,CAEd,CACuB,CAAC,eAC1B9H,KAAA,CAAAyG,aAAA,CAAC7F,mBAAmB,MAAE,CACV,CACf,EACAgD,QACsB,CACP,CACD,CACH,CACd,CAAC;AAEb,CACF,CAAC;AAEDH,KAAK,CAACiF,WAAW,GAAG,OAAO","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Sheet.js","names":["React","useCallback","useEffect","forwardRef","useState","useImperativeHandle","useRef","classnames","StyledAnimatedSpan","StyledCssTransition","StyledHeader","StyledIconsWrapperSmall","StyledListSeparator","StyledSheetIcons","StyledSheetWrapper","SHEET_ENTER_MS","SHEET_EXIT_MS","StyledSheetSurface","StyledSheetWrapperPaper","PortalContainerProvider","usePortalContainer","IconButton","Overlay","Tooltip","Fade","Window","useHostAboveOpenModal","INSET_VAR","INSET_DURATION_VAR","CONTROLS_ROOM","useSheetInset","wrapperRef","isOn","wrapper","current","undefined","root","document","documentElement","update","_wrapper$getBoundingC","getBoundingClientRect","left","style","setProperty","clientWidth","removeProperty","observer","ResizeObserver","isWidth","event","propertyName","startWidth","target","endWidth","observe","window","addEventListener","disconnect","removeEventListener","Sheet","_ref","ref","children","onClose","_ref$controls","controls","_ref$open","open","defaultOpen","_ref$animation","animation","_ref$position","position","_ref$mode","mode","maxWidth","_ref$surface","surface","_ref$disableFocusLock","disableFocusLock","_ref$disableScrollLoc","disableScrollLock","_ref$disableBackgroun","disableBackgroundColor","bodyStyle","bodyClassName","_ref$disableBackgroun2","disableBackgroundClick","rest","_objectWithoutPropertiesLoose","_excluded","_useState","setOpen","_useState2","exited","setExited","_useState3","overlayEntered","setOverlayEntered","handleEnter","handleExited","handleClose","handleOverlayEntered","handleOverlayExit","handleBackgroundClick","preventDefault","close","portalContainer","_useHostAboveOpenModa","modalHost","host","modalHostPending","pending","sheetWindow","createElement","_extends","pointerEvents","in","timeout","onEntered","onExit","onClick","className","$position","$mode","$maxWidth","appear","classNames","$direction","onEnter","onExited","length","map","_ref2","index","IconComponent","icon","tooltip","disabled","title","disable","key","$disabled","paperClass","$surface","_ref3","variant","value","displayName"],"sources":["../../../../src/components/Sheet/Sheet.tsx"],"sourcesContent":["import React, {\n useCallback,\n useEffect,\n forwardRef,\n HTMLAttributes,\n useState,\n CSSProperties,\n MouseEvent,\n useImperativeHandle,\n useRef,\n} from \"react\";\n\nimport classnames from \"classnames\";\n\nimport {\n StyledAnimatedSpan,\n StyledCssTransition,\n StyledHeader,\n StyledIconsWrapperSmall,\n StyledListSeparator,\n StyledSheetIcons,\n StyledSheetWrapper,\n SHEET_ENTER_MS,\n SHEET_EXIT_MS,\n StyledSheetSurface,\n StyledSheetWrapperPaper,\n} from \"./Styles\";\nimport { PortalContainerProvider, usePortalContainer } from \"../../helpers\";\nimport { IconButton } from \"../IconButton\";\nimport { Overlay } from \"../Overlay\";\nimport { Tooltip } from \"../Tooltip\";\nimport { Fade } from \"../Transitions\";\nimport { Window } from \"../Window\";\nimport { useHostAboveOpenModal } from \"./useHostAboveOpenModal\";\n\nconst INSET_VAR = \"--c-sheet-inset-right\";\nconst INSET_DURATION_VAR = \"--c-sheet-inset-duration\";\n// The controls column stands 48px left of the sheet. With less room it is not there.\nconst CONTROLS_ROOM = 64;\n\n// A right sheet tells the page, on the root, how far from the right edge it starts, so a floating part of the page\n// can move out of its way with the same timing.\nconst useSheetInset = (\n wrapperRef: React.RefObject<HTMLDivElement>,\n isOn: boolean\n) => {\n useEffect(() => {\n const wrapper = wrapperRef.current;\n\n if (!isOn || !wrapper) {\n return undefined;\n }\n\n const root = document.documentElement;\n const update = () => {\n const { left } = wrapper.getBoundingClientRect();\n\n if (left >= CONTROLS_ROOM) {\n root.style.setProperty(INSET_VAR, `${root.clientWidth - left}px`);\n } else {\n root.style.removeProperty(INSET_VAR);\n }\n };\n const observer =\n typeof ResizeObserver === \"undefined\"\n ? undefined\n : // eslint-disable-next-line compat/compat\n new ResizeObserver(update);\n\n // While the width moves, the edge moves on every frame, so the parts follow it with no timing of their own.\n const isWidth = (event: Event) =>\n (event as TransitionEvent).propertyName === \"max-width\";\n const startWidth = (event: Event) => {\n if (event.target === wrapper && isWidth(event)) {\n root.style.setProperty(INSET_DURATION_VAR, \"0ms\");\n }\n };\n const endWidth = (event: Event) => {\n if (event.target === wrapper && isWidth(event)) {\n root.style.setProperty(INSET_DURATION_VAR, `${SHEET_ENTER_MS}ms`);\n update();\n }\n };\n\n root.style.setProperty(INSET_DURATION_VAR, `${SHEET_ENTER_MS}ms`);\n update();\n observer?.observe(wrapper);\n window.addEventListener(\"resize\", update);\n wrapper.addEventListener(\"transitionrun\", startWidth);\n wrapper.addEventListener(\"transitionend\", endWidth);\n wrapper.addEventListener(\"transitioncancel\", endWidth);\n\n return () => {\n observer?.disconnect();\n window.removeEventListener(\"resize\", update);\n wrapper.removeEventListener(\"transitionrun\", startWidth);\n wrapper.removeEventListener(\"transitionend\", endWidth);\n wrapper.removeEventListener(\"transitioncancel\", endWidth);\n root.style.setProperty(INSET_DURATION_VAR, `${SHEET_EXIT_MS}ms`);\n root.style.removeProperty(INSET_VAR);\n };\n }, [wrapperRef, isOn]);\n};\n\ninterface ControlProps {\n onClick: () => void;\n icon: React.ReactElement;\n tooltip: string;\n disabled: boolean;\n className: string;\n}\n\ninterface ISheet {\n onClose?: () => void;\n controls?: ControlProps[];\n open?: boolean;\n animation?: \"top\" | \"bottom\" | \"left\" | \"right\";\n position?: \"center\" | \"left\" | \"right\";\n mode?: \"normal\" | \"stretch\";\n /** The widest the sheet gets in stretch mode. A number is in pixels. */\n maxWidth?: number | string;\n /** \"sheet\" draws the paper on the sheet surface with large corners. */\n surface?: \"paper\" | \"sheet\";\n disableFocusLock?: boolean;\n disableScrollLock?: boolean;\n disableBackgroundColor?: boolean;\n bodyStyle?: CSSProperties;\n bodyClassName?: string;\n disableBackgroundClick?: boolean;\n}\n\nexport interface SheetMethods {\n close: () => void;\n}\n\ntype SheetProps = ISheet & HTMLAttributes<HTMLDivElement>;\n\nexport const Sheet = forwardRef<SheetMethods, SheetProps>(\n (\n {\n children,\n onClose,\n controls = [],\n open: defaultOpen = false,\n animation = \"top\",\n position = \"center\",\n mode = \"normal\",\n maxWidth,\n surface = \"paper\",\n disableFocusLock = false,\n disableScrollLock = false,\n disableBackgroundColor = false,\n bodyStyle,\n bodyClassName,\n disableBackgroundClick = false,\n ...rest\n },\n ref\n ) => {\n const [open, setOpen] = useState(defaultOpen);\n const [exited, setExited] = useState(true);\n // Clicks pass through the overlay until it has faded in, and again from the first moment it fades out. Over a\n // native dialog it takes them all the time, since a click through it would hit the dialog's backdrop.\n const [overlayEntered, setOverlayEntered] = useState(false);\n const wrapperRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n setOpen(defaultOpen);\n }, [defaultOpen]);\n\n const handleEnter = useCallback(() => {\n setExited(false);\n }, []);\n\n const handleExited = useCallback(() => {\n setExited(true);\n onClose?.();\n }, [onClose]);\n\n const handleClose = useCallback(() => {\n setOpen(false);\n }, []);\n\n const handleOverlayEntered = useCallback(() => {\n setOverlayEntered(true);\n }, []);\n\n const handleOverlayExit = useCallback(() => {\n setOverlayEntered(false);\n }, []);\n\n const handleBackgroundClick = useCallback(\n (event: MouseEvent<HTMLDivElement>) => {\n if (!disableBackgroundClick) {\n event.preventDefault();\n handleClose();\n }\n },\n [disableBackgroundClick, handleClose]\n );\n\n useImperativeHandle(ref, () => ({\n close: handleClose,\n }));\n\n const portalContainer = usePortalContainer();\n const { host: modalHost, pending: modalHostPending } =\n useHostAboveOpenModal(open || !exited, portalContainer === undefined);\n\n // A pending sheet renders no wrapper yet, so the inset starts once it does.\n useSheetInset(\n wrapperRef,\n open && position === \"right\" && !modalHostPending\n );\n\n if ((!open && exited) || modalHostPending) {\n return null;\n }\n\n const sheetWindow = (\n <Window\n {...rest}\n // The overlay and the sheet take the clicks, so the window lets them through where the overlay does.\n style={{ ...rest.style, pointerEvents: \"none\" }}\n onClose={handleClose}\n disableFocusLock={disableFocusLock}\n disableScrollLock={disableScrollLock}\n >\n <Fade\n in={open}\n timeout={open ? SHEET_ENTER_MS : SHEET_EXIT_MS}\n onEntered={handleOverlayEntered}\n onExit={handleOverlayExit}\n >\n <Overlay\n onClick={handleBackgroundClick}\n disableBackgroundColor={disableBackgroundColor}\n style={{\n pointerEvents:\n modalHost || (open && overlayEntered) ? \"auto\" : \"none\",\n }}\n />\n </Fade>\n <StyledSheetWrapper\n ref={wrapperRef}\n className={classnames(\"c-sheet__wrapper\", bodyClassName)}\n style={bodyStyle}\n $position={position}\n $mode={mode}\n $maxWidth={maxWidth}\n >\n <StyledCssTransition\n appear\n in={open}\n timeout={SHEET_ENTER_MS}\n classNames=\"c-sheet__animation\"\n $direction={animation}\n onEnter={handleEnter}\n onExited={handleExited}\n >\n <StyledSheetSurface>\n {controls.length > 0 && (\n <StyledSheetIcons>\n {controls.map(\n (\n {\n icon: IconComponent,\n tooltip,\n onClick,\n disabled,\n className,\n },\n index\n ) => (\n <Tooltip\n title={tooltip}\n disable={!tooltip || disabled}\n key={`c-sheet-control-${index}`}\n >\n <StyledAnimatedSpan\n onClick={onClick}\n $disabled={disabled}\n className={className}\n >\n {IconComponent}\n </StyledAnimatedSpan>\n </Tooltip>\n )\n )}\n </StyledSheetIcons>\n )}\n <StyledSheetWrapperPaper\n paperClass=\"c-sheet__wrapper__paper\"\n $surface={surface}\n >\n {controls.length > 0 && (\n <StyledHeader>\n <StyledIconsWrapperSmall>\n {controls.map(\n (\n {\n icon: IconComponent,\n tooltip,\n onClick,\n disabled,\n className,\n },\n index\n ) => (\n <Tooltip\n title={tooltip}\n disable={!tooltip || disabled}\n key={index}\n >\n <IconButton\n onClick={onClick}\n disabled={disabled}\n className={className}\n variant=\"text gray\"\n >\n {IconComponent}\n </IconButton>\n </Tooltip>\n )\n )}\n </StyledIconsWrapperSmall>\n <StyledListSeparator />\n </StyledHeader>\n )}\n {children}\n </StyledSheetWrapperPaper>\n </StyledSheetSurface>\n </StyledCssTransition>\n </StyledSheetWrapper>\n </Window>\n );\n\n // The provider is always there, so the Window keeps its place in the tree when the sheet gets a host.\n return (\n <PortalContainerProvider value={modalHost ?? portalContainer}>\n {sheetWindow}\n </PortalContainerProvider>\n );\n }\n);\n\nSheet.displayName = \"Sheet\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IACVC,WAAW,EACXC,SAAS,EACTC,UAAU,EAEVC,QAAQ,EAGRC,mBAAmB,EACnBC,MAAM,QACD,OAAO;AAEd,OAAOC,UAAU,MAAM,YAAY;AAEnC,SACEC,kBAAkB,EAClBC,mBAAmB,EACnBC,YAAY,EACZC,uBAAuB,EACvBC,mBAAmB,EACnBC,gBAAgB,EAChBC,kBAAkB,EAClBC,cAAc,EACdC,aAAa,EACbC,kBAAkB,EAClBC,uBAAuB,QAClB,UAAU;AACjB,SAASC,uBAA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,CAAChG,uBAAuB;IAACiI,KAAK,EAAEtC,SAAS,WAATA,SAAS,GAAIF;EAAgB,GAC1DM,WACsB,CAAC;AAE9B,CACF,CAAC;AAEDtD,KAAK,CAACyF,WAAW,GAAG,OAAO","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A sheet that opens while a native modal is open renders into that modal's overlay root, since everything outside
|
|
3
|
+
* the modal is inert. The modal is the one on top as the sheet opens: a modal opened later, such as a confirmation
|
|
4
|
+
* the sheet opens itself, stays above the sheet, also when the sheet renders again while it is open. When that modal
|
|
5
|
+
* closes underneath, the host moves down to the next one opened before the sheet, or to document.body, without
|
|
6
|
+
* remounting the sheet. The host is null when no modal was open, so the sheet renders as it always has, and the
|
|
7
|
+
* sheet waits while pending, until the host is in the page, so its content mounts in the modal and can take focus.
|
|
8
|
+
*/
|
|
9
|
+
export declare const useHostAboveOpenModal: (visible: boolean, enabled: boolean) => {
|
|
10
|
+
host: HTMLElement | null;
|
|
11
|
+
pending: boolean;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=useHostAboveOpenModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHostAboveOpenModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Sheet/useHostAboveOpenModal.ts"],"names":[],"mappings":"AAiBA;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,GAChC,SAAS,OAAO,EAChB,SAAS,OAAO,KACf;IAAE,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAwB9C,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { getTopModalRootId } from "../ModalRoot/modalRootStack";
|
|
3
|
+
import { useModalStackHost } from "../ModalRoot/useModalStackHost";
|
|
4
|
+
const createHost = () => {
|
|
5
|
+
const host = document.createElement("div");
|
|
6
|
+
host.className = "c-sheet-modal-host";
|
|
7
|
+
return host;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A sheet that opens while a native modal is open renders into that modal's overlay root, since everything outside
|
|
12
|
+
* the modal is inert. The modal is the one on top as the sheet opens: a modal opened later, such as a confirmation
|
|
13
|
+
* the sheet opens itself, stays above the sheet, also when the sheet renders again while it is open. When that modal
|
|
14
|
+
* closes underneath, the host moves down to the next one opened before the sheet, or to document.body, without
|
|
15
|
+
* remounting the sheet. The host is null when no modal was open, so the sheet renders as it always has, and the
|
|
16
|
+
* sheet waits while pending, until the host is in the page, so its content mounts in the modal and can take focus.
|
|
17
|
+
*/
|
|
18
|
+
export const useHostAboveOpenModal = (visible, enabled) => {
|
|
19
|
+
var _captured$host, _captured$host2;
|
|
20
|
+
const _useState = useState(false),
|
|
21
|
+
wasVisible = _useState[0],
|
|
22
|
+
setWasVisible = _useState[1];
|
|
23
|
+
const _useState2 = useState(null),
|
|
24
|
+
captured = _useState2[0],
|
|
25
|
+
setCaptured = _useState2[1];
|
|
26
|
+
|
|
27
|
+
// The modal is picked only as the sheet opens, never on a later render while it stays open.
|
|
28
|
+
if (visible !== wasVisible) {
|
|
29
|
+
setWasVisible(visible);
|
|
30
|
+
const modalRootId = visible && enabled ? getTopModalRootId() : undefined;
|
|
31
|
+
setCaptured(modalRootId === undefined ? null : {
|
|
32
|
+
modalRootId,
|
|
33
|
+
host: createHost()
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
const placed = useModalStackHost((_captured$host = captured == null ? void 0 : captured.host) != null ? _captured$host : null, captured == null ? void 0 : captured.modalRootId);
|
|
37
|
+
return {
|
|
38
|
+
host: (_captured$host2 = captured == null ? void 0 : captured.host) != null ? _captured$host2 : null,
|
|
39
|
+
pending: captured !== null && !placed
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=useHostAboveOpenModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHostAboveOpenModal.js","names":["useState","getTopModalRootId","useModalStackHost","createHost","host","document","createElement","className","useHostAboveOpenModal","visible","enabled","_captured$host","_captured$host2","_useState","wasVisible","setWasVisible","_useState2","captured","setCaptured","modalRootId","undefined","placed","pending"],"sources":["../../../../src/components/Sheet/useHostAboveOpenModal.ts"],"sourcesContent":["import { useState } from \"react\";\n\nimport { getTopModalRootId } from \"../ModalRoot/modalRootStack\";\nimport { useModalStackHost } from \"../ModalRoot/useModalStackHost\";\n\ninterface Captured {\n modalRootId: number;\n host: HTMLElement;\n}\n\nconst createHost = () => {\n const host = document.createElement(\"div\");\n host.className = \"c-sheet-modal-host\";\n\n return host;\n};\n\n/**\n * A sheet that opens while a native modal is open renders into that modal's overlay root, since everything outside\n * the modal is inert. The modal is the one on top as the sheet opens: a modal opened later, such as a confirmation\n * the sheet opens itself, stays above the sheet, also when the sheet renders again while it is open. When that modal\n * closes underneath, the host moves down to the next one opened before the sheet, or to document.body, without\n * remounting the sheet. The host is null when no modal was open, so the sheet renders as it always has, and the\n * sheet waits while pending, until the host is in the page, so its content mounts in the modal and can take focus.\n */\nexport const useHostAboveOpenModal = (\n visible: boolean,\n enabled: boolean\n): { host: HTMLElement | null; pending: boolean } => {\n const [wasVisible, setWasVisible] = useState(false);\n const [captured, setCaptured] = useState<Captured | null>(null);\n\n // The modal is picked only as the sheet opens, never on a later render while it stays open.\n if (visible !== wasVisible) {\n setWasVisible(visible);\n\n const modalRootId = visible && enabled ? getTopModalRootId() : undefined;\n\n setCaptured(\n modalRootId === undefined ? null : { modalRootId, host: createHost() }\n );\n }\n\n const placed = useModalStackHost(\n captured?.host ?? null,\n captured?.modalRootId\n );\n\n return {\n host: captured?.host ?? null,\n pending: captured !== null && !placed,\n };\n};\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,OAAO;AAEhC,SAASC,iBAAiB,QAAQ,6BAA6B;AAC/D,SAASC,iBAAiB,QAAQ,gCAAgC;AAOlE,MAAMC,UAAU,GAAG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