@activecollab/components 2.0.525 → 2.0.527
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/GlobalPortal/GlobalPortal.js +2 -16
- package/dist/cjs/components/GlobalPortal/GlobalPortal.js.map +1 -1
- package/dist/cjs/components/Menu/Menu.js +13 -2
- package/dist/cjs/components/Menu/Menu.js.map +1 -1
- package/dist/cjs/components/Menu/MenuBehavior.js +15 -0
- package/dist/cjs/components/Menu/MenuBehavior.js.map +1 -0
- package/dist/cjs/components/Menu/index.js +12 -0
- package/dist/cjs/components/Menu/index.js.map +1 -1
- 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/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/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/Menu/Menu.d.ts.map +1 -1
- package/dist/esm/components/Menu/Menu.js +13 -2
- package/dist/esm/components/Menu/Menu.js.map +1 -1
- package/dist/esm/components/Menu/MenuBehavior.d.ts +7 -0
- package/dist/esm/components/Menu/MenuBehavior.d.ts.map +1 -0
- package/dist/esm/components/Menu/MenuBehavior.js +7 -0
- package/dist/esm/components/Menu/MenuBehavior.js.map +1 -0
- package/dist/esm/components/Menu/index.d.ts +1 -0
- package/dist/esm/components/Menu/index.d.ts.map +1 -1
- package/dist/esm/components/Menu/index.js +1 -0
- package/dist/esm/components/Menu/index.js.map +1 -1
- 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/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 +149 -23
- 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
|
@@ -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,kBAAkB,EAClBC,cAAc,EACdC,aAAa,EACbC,kBAAkB,EAClBC,uBAAuB,QAClB,UAAU;AACjB,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,OAAO,QAAQ,YAAY;AACpC,SAASC,OAAO,QAAQ,YAAY;AACpC,SAASC,IAAI,QAAQ,gBAAgB;AACrC,SAASC,MAAM,QAAQ,WAAW;AAElC,MAAMC,SAAS,GAAG,uBAAuB;AACzC,MAAMC,kBAAkB,GAAG,0BAA0B;AACrD;AACA,MAAMC,aAAa,GAAG,EAAE;;AAExB;AACA;AACA,MAAMC,aAAa,GAAGA,CACpBC,UAA2C,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AAQ;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,uBAAuB,EAAEC,kBAAkB,QAAQ,eAAe;AAC3E,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,OAAO,QAAQ,YAAY;AACpC,SAASC,OAAO,QAAQ,YAAY;AACpC,SAASC,IAAI,QAAQ,gBAAgB;AACrC,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,qBAAqB,QAAQ,yBAAyB;AAE/D,MAAMC,SAAS,GAAG,uBAAuB;AACzC,MAAMC,kBAAkB,GAAG,0BAA0B;AACrD;AACA,MAAMC,aAAa,GAAG,EAAE;;AAExB;AACA;AACA,MAAMC,aAAa,GAAGA,CACpBC,UAA2C,EAC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BpI,KAAA,CAAAmH,aAAA,CAACzG,YAAY,qBACXV,KAAA,CAAAmH,aAAA,CAACxG,uBAAuB,QACrBuD,QAAQ,CAACmE,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,oBAIX3H,KAAA,CAAAmH,aAAA,CAAC5F,OAAO;MACNqH,KAAK,EAAEF,OAAQ;MACfG,OAAO,EAAE,CAACH,OAAO,IAAIC,QAAS;MAC9BG,GAAG,EAAEP;IAAM,gBAEXvI,KAAA,CAAAmH,aAAA,CAAC9F,UAAU;MACTqG,OAAO,EAAEA,OAAQ;MACjBiB,QAAQ,EAAEA,QAAS;MACnBhB,SAAS,EAAEA,SAAU;MACrBwB,OAAO,EAAC;IAAW,GAElBX,aACS,CACL,CAAC;EAAA,CAEd,CACuB,CAAC,eAC1BxI,KAAA,CAAAmH,aAAA,CAACvG,mBAAmB,MAAE,CACV,CACf,EACAmD,QACsB,CACP,CACD,CACH,CACd,CACT;;EAED;EACA,oBACE/D,KAAA,CAAAmH,aAAA,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,GAAGA,CAAA,KAAM;EACvB,MAAMC,IAAI,GAAGC,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EAC1CF,IAAI,CAACG,SAAS,GAAG,oBAAoB;EAErC,OAAOH,IAAI;AACb,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMI,qBAAqB,GAAGA,CACnCC,OAAgB,EAChBC,OAAgB,KACmC;EAAA,IAAAC,cAAA,EAAAC,eAAA;EACnD,MAAAC,SAAA,GAAoCb,QAAQ,CAAC,KAAK,CAAC;IAA5Cc,UAAU,GAAAD,SAAA;IAAEE,aAAa,GAAAF,SAAA;EAChC,MAAAG,UAAA,GAAgChB,QAAQ,CAAkB,IAAI,CAAC;IAAxDiB,QAAQ,GAAAD,UAAA;IAAEE,WAAW,GAAAF,UAAA;;EAE5B;EACA,IAAIP,OAAO,KAAKK,UAAU,EAAE;IAC1BC,aAAa,CAACN,OAAO,CAAC;IAEtB,MAAMU,WAAW,GAAGV,OAAO,IAAIC,OAAO,GAAGT,iBAAiB,CAAC,CAAC,GAAGmB,SAAS;IAExEF,WAAW,CACTC,WAAW,KAAKC,SAAS,GAAG,IAAI,GAAG;MAAED,WAAW;MAAEf,IAAI,EAAED,UAAU,CAAC;IAAE,CACvE,CAAC;EACH;EAEA,MAAMkB,MAAM,GAAGnB,iBAAiB,EAAAS,cAAA,GAC9BM,QAAQ,oBAARA,QAAQ,CAAEb,IAAI,YAAAO,cAAA,GAAI,IAAI,EACtBM,QAAQ,oBAARA,QAAQ,CAAEE,WACZ,CAAC;EAED,OAAO;IACLf,IAAI,GAAAQ,eAAA,GAAEK,QAAQ,oBAARA,QAAQ,CAAEb,IAAI,YAAAQ,eAAA,GAAI,IAAI;IAC5BU,OAAO,EAAEL,QAAQ,KAAK,IAAI,IAAI,CAACI;EACjC,CAAC;AACH,CAAC","ignoreList":[]}
|
package/dist/index.js
CHANGED
|
@@ -16278,6 +16278,14 @@
|
|
|
16278
16278
|
return React.useContext(MenuContext);
|
|
16279
16279
|
};
|
|
16280
16280
|
|
|
16281
|
+
var MenuBehaviorContext = /*#__PURE__*/React.createContext({
|
|
16282
|
+
outsideClickOnlyCloses: false
|
|
16283
|
+
});
|
|
16284
|
+
var MenuBehaviorProvider = MenuBehaviorContext.Provider;
|
|
16285
|
+
var useMenuBehavior = function useMenuBehavior() {
|
|
16286
|
+
return React.useContext(MenuBehaviorContext);
|
|
16287
|
+
};
|
|
16288
|
+
|
|
16281
16289
|
var StyledBubble = styled__default["default"].div.withConfig({
|
|
16282
16290
|
displayName: "Styles__StyledBubble",
|
|
16283
16291
|
componentId: "sc-tloccl-0"
|
|
@@ -17383,6 +17391,8 @@
|
|
|
17383
17391
|
var returnFocusTo = React.useRef(null);
|
|
17384
17392
|
var popperRef = React.useRef(null);
|
|
17385
17393
|
var windowRef = React.useRef(null);
|
|
17394
|
+
var _useMenuBehavior = useMenuBehavior(),
|
|
17395
|
+
outsideClickOnlyCloses = _useMenuBehavior.outsideClickOnlyCloses;
|
|
17386
17396
|
var tabOut = React.useRef(0);
|
|
17387
17397
|
|
|
17388
17398
|
// Read on the render that opens the menu, before the focus lock moves the focus inside it.
|
|
@@ -17619,10 +17629,17 @@
|
|
|
17619
17629
|
position: windowAbsolutelyPositioned ? "absolute" : "fixed",
|
|
17620
17630
|
pointerEvents: "none"
|
|
17621
17631
|
}
|
|
17622
|
-
}, open ? /*#__PURE__*/React__default["default"].createElement(Overlay, {
|
|
17632
|
+
}, open ? /*#__PURE__*/React__default["default"].createElement(Overlay, _extends({
|
|
17623
17633
|
className: backgroundElementClass,
|
|
17624
17634
|
disableBackgroundColor: true
|
|
17625
|
-
|
|
17635
|
+
// Closing on the click, not the press, keeps the whole click on the overlay.
|
|
17636
|
+
}, outsideClickOnlyCloses && {
|
|
17637
|
+
onClick: handleClose,
|
|
17638
|
+
tabIndex: -1,
|
|
17639
|
+
style: {
|
|
17640
|
+
pointerEvents: "auto"
|
|
17641
|
+
}
|
|
17642
|
+
})) : null, /*#__PURE__*/React__default["default"].createElement(Popper, {
|
|
17626
17643
|
ref: popperRef,
|
|
17627
17644
|
anchorEl: childNode,
|
|
17628
17645
|
open: childNode ? open : false,
|
|
@@ -19248,6 +19265,21 @@
|
|
|
19248
19265
|
var _stack$overlayRoot, _stack2;
|
|
19249
19266
|
return (_stack$overlayRoot = (_stack2 = stack[stack.length - 1]) === null || _stack2 === void 0 ? void 0 : _stack2.overlayRoot) !== null && _stack$overlayRoot !== void 0 ? _stack$overlayRoot : null;
|
|
19250
19267
|
};
|
|
19268
|
+
|
|
19269
|
+
/** The id of the top open modal root, or undefined when none is open. */
|
|
19270
|
+
var getTopModalRootId = function getTopModalRootId() {
|
|
19271
|
+
var _stack3;
|
|
19272
|
+
return (_stack3 = stack[stack.length - 1]) === null || _stack3 === void 0 ? void 0 : _stack3.id;
|
|
19273
|
+
};
|
|
19274
|
+
|
|
19275
|
+
/** The overlay root of the top modal root among those opened no later than the given one. */
|
|
19276
|
+
var getModalOverlayRootUpTo = function getModalOverlayRootUpTo(id) {
|
|
19277
|
+
var _entries$overlayRoot, _entries;
|
|
19278
|
+
var entries = stack.filter(function (entry) {
|
|
19279
|
+
return entry.id <= id;
|
|
19280
|
+
});
|
|
19281
|
+
return (_entries$overlayRoot = (_entries = entries[entries.length - 1]) === null || _entries === void 0 ? void 0 : _entries.overlayRoot) !== null && _entries$overlayRoot !== void 0 ? _entries$overlayRoot : null;
|
|
19282
|
+
};
|
|
19251
19283
|
var subscribeToModalRoots = function subscribeToModalRoots(listener) {
|
|
19252
19284
|
listeners.add(listener);
|
|
19253
19285
|
return function () {
|
|
@@ -19367,7 +19399,7 @@
|
|
|
19367
19399
|
return undefined;
|
|
19368
19400
|
}
|
|
19369
19401
|
var handleKeyDown = function handleKeyDown(event) {
|
|
19370
|
-
var _overlayRootRef$curre;
|
|
19402
|
+
var _overlayRootRef$curre, _overlayRootRef$curre2;
|
|
19371
19403
|
var stackId = stackIdRef.current;
|
|
19372
19404
|
if (stackId === undefined || !isTopModalRoot(stackId) || event.defaultPrevented || event.key !== "Escape" && event.key !== "Esc") {
|
|
19373
19405
|
return;
|
|
@@ -19378,6 +19410,12 @@
|
|
|
19378
19410
|
return;
|
|
19379
19411
|
}
|
|
19380
19412
|
event.preventDefault();
|
|
19413
|
+
|
|
19414
|
+
// A sheet, a menu or the chat in the overlay root is a layer above the dialog. An Escape it did not take
|
|
19415
|
+
// still belongs to it, so the dialog only stops the browser from closing itself.
|
|
19416
|
+
if ((_overlayRootRef$curre2 = overlayRootRef.current) !== null && _overlayRootRef$curre2 !== void 0 && _overlayRootRef$curre2.contains(event.target)) {
|
|
19417
|
+
return;
|
|
19418
|
+
}
|
|
19381
19419
|
if (openRef.current) {
|
|
19382
19420
|
var _dismissRef$current;
|
|
19383
19421
|
(_dismissRef$current = dismissRef.current) === null || _dismissRef$current === void 0 || _dismissRef$current.call(dismissRef, "escape");
|
|
@@ -19393,7 +19431,14 @@
|
|
|
19393
19431
|
return undefined;
|
|
19394
19432
|
}
|
|
19395
19433
|
var handleCancel = function handleCancel(event) {
|
|
19434
|
+
var _overlayRootRef$curre3;
|
|
19396
19435
|
event.preventDefault();
|
|
19436
|
+
|
|
19437
|
+
// A layer in the overlay root may stop its Escape before the document sees it, so the cancel that follows
|
|
19438
|
+
// would close the dialog under the layer. While the focus is in that layer, the close request is its own.
|
|
19439
|
+
if ((_overlayRootRef$curre3 = overlayRootRef.current) !== null && _overlayRootRef$curre3 !== void 0 && _overlayRootRef$curre3.contains(document.activeElement)) {
|
|
19440
|
+
return;
|
|
19441
|
+
}
|
|
19397
19442
|
if (openRef.current) {
|
|
19398
19443
|
var _dismissRef$current2;
|
|
19399
19444
|
(_dismissRef$current2 = dismissRef.current) === null || _dismissRef$current2 === void 0 || _dismissRef$current2.call(dismissRef, "escape");
|
|
@@ -19430,12 +19475,19 @@
|
|
|
19430
19475
|
// React events from a portal bubble through the React tree, so an Escape from the content would reach an
|
|
19431
19476
|
// ancestor's handler, like an older Sheet's, before the document listener. The dialog takes it here first.
|
|
19432
19477
|
var handleKeyDown = React.useCallback(function (event) {
|
|
19478
|
+
var _overlayRootRef$curre4;
|
|
19433
19479
|
onKeyDown === null || onKeyDown === void 0 || onKeyDown(event);
|
|
19434
19480
|
if (event.defaultPrevented || event.key !== "Escape" && event.key !== "Esc" || stackIdRef.current === undefined || !isTopModalRoot(stackIdRef.current)) {
|
|
19435
19481
|
return;
|
|
19436
19482
|
}
|
|
19437
19483
|
event.preventDefault();
|
|
19438
19484
|
event.stopPropagation();
|
|
19485
|
+
|
|
19486
|
+
// An Escape a layer in the overlay root did not take stops here too, so it does not close the sheet that
|
|
19487
|
+
// opened this dialog, but it leaves the dialog open.
|
|
19488
|
+
if ((_overlayRootRef$curre4 = overlayRootRef.current) !== null && _overlayRootRef$curre4 !== void 0 && _overlayRootRef$curre4.contains(event.target)) {
|
|
19489
|
+
return;
|
|
19490
|
+
}
|
|
19439
19491
|
if (openRef.current) {
|
|
19440
19492
|
var _dismissRef$current4;
|
|
19441
19493
|
(_dismissRef$current4 = dismissRef.current) === null || _dismissRef$current4 === void 0 || _dismissRef$current4.call(dismissRef, "escape");
|
|
@@ -28476,6 +28528,80 @@
|
|
|
28476
28528
|
})(["@media (min-width:640px){display:none;}"]);
|
|
28477
28529
|
StyledHeader$2.displayName = "StyledHeader";
|
|
28478
28530
|
|
|
28531
|
+
/**
|
|
28532
|
+
* Keeps a host node in the overlay root of the top open modal, or of the top one opened no later than
|
|
28533
|
+
* upToModalRootId, and in document.body while there is none. The node moves as modals open and close, so content
|
|
28534
|
+
* portalled into it never remounts, and it leaves the page on unmount or when the host changes. Returns whether the
|
|
28535
|
+
* host is in the page, which it is from a layout effect after the first render with it.
|
|
28536
|
+
*/
|
|
28537
|
+
var useModalStackHost = function useModalStackHost(host, upToModalRootId) {
|
|
28538
|
+
var _useState = React.useState(null),
|
|
28539
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
28540
|
+
placedHost = _useState2[0],
|
|
28541
|
+
setPlacedHost = _useState2[1];
|
|
28542
|
+
React.useLayoutEffect(function () {
|
|
28543
|
+
if (!host) {
|
|
28544
|
+
return undefined;
|
|
28545
|
+
}
|
|
28546
|
+
var place = function place() {
|
|
28547
|
+
var _ref;
|
|
28548
|
+
var target = (_ref = upToModalRootId === undefined ? getTopModalOverlayRoot() : getModalOverlayRootUpTo(upToModalRootId)) !== null && _ref !== void 0 ? _ref : document.body;
|
|
28549
|
+
if (host.parentElement !== target) {
|
|
28550
|
+
target.appendChild(host);
|
|
28551
|
+
}
|
|
28552
|
+
};
|
|
28553
|
+
place();
|
|
28554
|
+
setPlacedHost(host);
|
|
28555
|
+
var unsubscribe = subscribeToModalRoots(place);
|
|
28556
|
+
return function () {
|
|
28557
|
+
unsubscribe();
|
|
28558
|
+
host.remove();
|
|
28559
|
+
};
|
|
28560
|
+
}, [host, upToModalRootId]);
|
|
28561
|
+
return host !== null && placedHost === host;
|
|
28562
|
+
};
|
|
28563
|
+
|
|
28564
|
+
var createHost$1 = function createHost() {
|
|
28565
|
+
var host = document.createElement("div");
|
|
28566
|
+
host.className = "c-sheet-modal-host";
|
|
28567
|
+
return host;
|
|
28568
|
+
};
|
|
28569
|
+
|
|
28570
|
+
/**
|
|
28571
|
+
* A sheet that opens while a native modal is open renders into that modal's overlay root, since everything outside
|
|
28572
|
+
* the modal is inert. The modal is the one on top as the sheet opens: a modal opened later, such as a confirmation
|
|
28573
|
+
* the sheet opens itself, stays above the sheet, also when the sheet renders again while it is open. When that modal
|
|
28574
|
+
* closes underneath, the host moves down to the next one opened before the sheet, or to document.body, without
|
|
28575
|
+
* remounting the sheet. The host is null when no modal was open, so the sheet renders as it always has, and the
|
|
28576
|
+
* sheet waits while pending, until the host is in the page, so its content mounts in the modal and can take focus.
|
|
28577
|
+
*/
|
|
28578
|
+
var useHostAboveOpenModal = function useHostAboveOpenModal(visible, enabled) {
|
|
28579
|
+
var _captured$host, _captured$host2;
|
|
28580
|
+
var _useState = React.useState(false),
|
|
28581
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
28582
|
+
wasVisible = _useState2[0],
|
|
28583
|
+
setWasVisible = _useState2[1];
|
|
28584
|
+
var _useState3 = React.useState(null),
|
|
28585
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
28586
|
+
captured = _useState4[0],
|
|
28587
|
+
setCaptured = _useState4[1];
|
|
28588
|
+
|
|
28589
|
+
// The modal is picked only as the sheet opens, never on a later render while it stays open.
|
|
28590
|
+
if (visible !== wasVisible) {
|
|
28591
|
+
setWasVisible(visible);
|
|
28592
|
+
var modalRootId = visible && enabled ? getTopModalRootId() : undefined;
|
|
28593
|
+
setCaptured(modalRootId === undefined ? null : {
|
|
28594
|
+
modalRootId,
|
|
28595
|
+
host: createHost$1()
|
|
28596
|
+
});
|
|
28597
|
+
}
|
|
28598
|
+
var placed = useModalStackHost((_captured$host = captured === null || captured === void 0 ? void 0 : captured.host) !== null && _captured$host !== void 0 ? _captured$host : null, captured === null || captured === void 0 ? void 0 : captured.modalRootId);
|
|
28599
|
+
return {
|
|
28600
|
+
host: (_captured$host2 = captured === null || captured === void 0 ? void 0 : captured.host) !== null && _captured$host2 !== void 0 ? _captured$host2 : null,
|
|
28601
|
+
pending: captured !== null && !placed
|
|
28602
|
+
};
|
|
28603
|
+
};
|
|
28604
|
+
|
|
28479
28605
|
var _excluded$Y = ["children", "onClose", "controls", "open", "animation", "position", "mode", "maxWidth", "surface", "disableFocusLock", "disableScrollLock", "disableBackgroundColor", "bodyStyle", "bodyClassName", "disableBackgroundClick"];
|
|
28480
28606
|
var INSET_VAR = "--c-sheet-inset-right";
|
|
28481
28607
|
var INSET_DURATION_VAR = "--c-sheet-inset-duration";
|
|
@@ -28572,13 +28698,13 @@
|
|
|
28572
28698
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
28573
28699
|
exited = _useState4[0],
|
|
28574
28700
|
setExited = _useState4[1];
|
|
28575
|
-
// Clicks pass through the overlay until it has faded in, and again from the first moment it fades out.
|
|
28701
|
+
// Clicks pass through the overlay until it has faded in, and again from the first moment it fades out. Over a
|
|
28702
|
+
// native dialog it takes them all the time, since a click through it would hit the dialog's backdrop.
|
|
28576
28703
|
var _useState5 = React.useState(false),
|
|
28577
28704
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
28578
28705
|
overlayEntered = _useState6[0],
|
|
28579
28706
|
setOverlayEntered = _useState6[1];
|
|
28580
28707
|
var wrapperRef = React.useRef(null);
|
|
28581
|
-
useSheetInset(wrapperRef, open && position === "right");
|
|
28582
28708
|
React.useEffect(function () {
|
|
28583
28709
|
setOpen(defaultOpen);
|
|
28584
28710
|
}, [defaultOpen]);
|
|
@@ -28609,10 +28735,17 @@
|
|
|
28609
28735
|
close: handleClose
|
|
28610
28736
|
};
|
|
28611
28737
|
});
|
|
28612
|
-
|
|
28738
|
+
var portalContainer = usePortalContainer();
|
|
28739
|
+
var _useHostAboveOpenModa = useHostAboveOpenModal(open || !exited, portalContainer === undefined),
|
|
28740
|
+
modalHost = _useHostAboveOpenModa.host,
|
|
28741
|
+
modalHostPending = _useHostAboveOpenModa.pending;
|
|
28742
|
+
|
|
28743
|
+
// A pending sheet renders no wrapper yet, so the inset starts once it does.
|
|
28744
|
+
useSheetInset(wrapperRef, open && position === "right" && !modalHostPending);
|
|
28745
|
+
if (!open && exited || modalHostPending) {
|
|
28613
28746
|
return null;
|
|
28614
28747
|
}
|
|
28615
|
-
|
|
28748
|
+
var sheetWindow = /*#__PURE__*/React__default["default"].createElement(Window, _extends({}, rest, {
|
|
28616
28749
|
// The overlay and the sheet take the clicks, so the window lets them through where the overlay does.
|
|
28617
28750
|
style: _objectSpread2(_objectSpread2({}, rest.style), {}, {
|
|
28618
28751
|
pointerEvents: "none"
|
|
@@ -28629,7 +28762,7 @@
|
|
|
28629
28762
|
onClick: handleBackgroundClick,
|
|
28630
28763
|
disableBackgroundColor: disableBackgroundColor,
|
|
28631
28764
|
style: {
|
|
28632
|
-
pointerEvents: open && overlayEntered ? "auto" : "none"
|
|
28765
|
+
pointerEvents: modalHost || open && overlayEntered ? "auto" : "none"
|
|
28633
28766
|
}
|
|
28634
28767
|
})), /*#__PURE__*/React__default["default"].createElement(StyledSheetWrapper, {
|
|
28635
28768
|
ref: wrapperRef,
|
|
@@ -28681,6 +28814,11 @@
|
|
|
28681
28814
|
variant: "text gray"
|
|
28682
28815
|
}, IconComponent));
|
|
28683
28816
|
})), /*#__PURE__*/React__default["default"].createElement(StyledListSeparator, null)), children)))));
|
|
28817
|
+
|
|
28818
|
+
// The provider is always there, so the Window keeps its place in the tree when the sheet gets a host.
|
|
28819
|
+
return /*#__PURE__*/React__default["default"].createElement(PortalContainerProvider, {
|
|
28820
|
+
value: modalHost !== null && modalHost !== void 0 ? modalHost : portalContainer
|
|
28821
|
+
}, sheetWindow);
|
|
28684
28822
|
});
|
|
28685
28823
|
Sheet.displayName = "Sheet";
|
|
28686
28824
|
|
|
@@ -32133,21 +32271,7 @@
|
|
|
32133
32271
|
var _useState = React.useState(createHost),
|
|
32134
32272
|
_useState2 = _slicedToArray(_useState, 1),
|
|
32135
32273
|
host = _useState2[0];
|
|
32136
|
-
|
|
32137
|
-
var place = function place() {
|
|
32138
|
-
var _getTopModalOverlayRo;
|
|
32139
|
-
var target = (_getTopModalOverlayRo = getTopModalOverlayRoot()) !== null && _getTopModalOverlayRo !== void 0 ? _getTopModalOverlayRo : document.body;
|
|
32140
|
-
if (host.parentElement !== target) {
|
|
32141
|
-
target.appendChild(host);
|
|
32142
|
-
}
|
|
32143
|
-
};
|
|
32144
|
-
place();
|
|
32145
|
-
var unsubscribe = subscribeToModalRoots(place);
|
|
32146
|
-
return function () {
|
|
32147
|
-
unsubscribe();
|
|
32148
|
-
host.remove();
|
|
32149
|
-
};
|
|
32150
|
-
}, [host]);
|
|
32274
|
+
useModalStackHost(host);
|
|
32151
32275
|
return /*#__PURE__*/ReactDOM__default["default"].createPortal(children, host);
|
|
32152
32276
|
};
|
|
32153
32277
|
GlobalPortal.displayName = "GlobalPortal";
|
|
@@ -38347,6 +38471,7 @@
|
|
|
38347
38471
|
exports.MeasuredPane = MeasuredPane;
|
|
38348
38472
|
exports.Media = Media;
|
|
38349
38473
|
exports.Menu = Menu;
|
|
38474
|
+
exports.MenuBehaviorProvider = MenuBehaviorProvider;
|
|
38350
38475
|
exports.MenuFooter = MenuFooter;
|
|
38351
38476
|
exports.MenuHeader = MenuHeader;
|
|
38352
38477
|
exports.MenuSelector = MenuSelector;
|
|
@@ -38654,6 +38779,7 @@
|
|
|
38654
38779
|
exports.useInputNumber = useInputNumber;
|
|
38655
38780
|
exports.useLayerContext = useLayerContext;
|
|
38656
38781
|
exports.useLongPress = useLongPress;
|
|
38782
|
+
exports.useMenuBehavior = useMenuBehavior;
|
|
38657
38783
|
exports.useMenuContext = useMenuContext;
|
|
38658
38784
|
exports.usePortalContainer = usePortalContainer;
|
|
38659
38785
|
exports.usePropertyListDensity = usePropertyListDensity;
|