@flipdish/ui-library 0.44.0 → 0.45.0
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/components/organisms/SidePanel/components/SidePanelRegion.cjs +8 -0
- package/dist/components/organisms/SidePanel/components/SidePanelRegion.cjs.map +1 -1
- package/dist/components/organisms/SidePanel/components/SidePanelRegion.d.ts.map +1 -1
- package/dist/components/organisms/SidePanel/components/SidePanelRegion.js +8 -0
- package/dist/components/organisms/SidePanel/components/SidePanelRegion.js.map +1 -1
- package/dist/components/organisms/SlideoutMenu/components/SlideoutShell.cjs +23 -14
- package/dist/components/organisms/SlideoutMenu/components/SlideoutShell.cjs.map +1 -1
- package/dist/components/organisms/SlideoutMenu/components/SlideoutShell.d.ts +2 -3
- package/dist/components/organisms/SlideoutMenu/components/SlideoutShell.d.ts.map +1 -1
- package/dist/components/organisms/SlideoutMenu/components/SlideoutShell.js +23 -14
- package/dist/components/organisms/SlideoutMenu/components/SlideoutShell.js.map +1 -1
- package/dist/components/organisms/SlideoutMenu/hooks/useCloseWhenCovered.cjs +31 -0
- package/dist/components/organisms/SlideoutMenu/hooks/useCloseWhenCovered.cjs.map +1 -0
- package/dist/components/organisms/SlideoutMenu/hooks/useCloseWhenCovered.d.ts +15 -0
- package/dist/components/organisms/SlideoutMenu/hooks/useCloseWhenCovered.d.ts.map +1 -0
- package/dist/components/organisms/SlideoutMenu/hooks/useCloseWhenCovered.js +29 -0
- package/dist/components/organisms/SlideoutMenu/hooks/useCloseWhenCovered.js.map +1 -0
- package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.cjs +3 -2
- package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.cjs.map +1 -1
- package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.d.ts.map +1 -1
- package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.js +4 -3
- package/dist/components/organisms/SlideoutMenu/hooks/useSlideoutState.js.map +1 -1
- package/dist/components/organisms/SlideoutMenu/index.cjs +5 -0
- package/dist/components/organisms/SlideoutMenu/index.cjs.map +1 -1
- package/dist/components/organisms/SlideoutMenu/index.d.ts +16 -9
- package/dist/components/organisms/SlideoutMenu/index.d.ts.map +1 -1
- package/dist/components/organisms/SlideoutMenu/index.js +5 -0
- package/dist/components/organisms/SlideoutMenu/index.js.map +1 -1
- package/dist/components/organisms/SlideoutMenu/providers/PageArea.context.cjs +4 -4
- package/dist/components/organisms/SlideoutMenu/providers/PageArea.context.d.ts +4 -4
- package/dist/components/organisms/SlideoutMenu/providers/PageArea.context.js +4 -4
- package/dist/hooks/__internal__/usePanelFocus/usePanelFocus.cjs +24 -8
- package/dist/hooks/__internal__/usePanelFocus/usePanelFocus.cjs.map +1 -1
- package/dist/hooks/__internal__/usePanelFocus/usePanelFocus.d.ts +3 -2
- package/dist/hooks/__internal__/usePanelFocus/usePanelFocus.d.ts.map +1 -1
- package/dist/hooks/__internal__/usePanelFocus/usePanelFocus.js +25 -9
- package/dist/hooks/__internal__/usePanelFocus/usePanelFocus.js.map +1 -1
- package/dist/providers/ThemeProvider/Theme.context.cjs +17 -0
- package/dist/providers/ThemeProvider/Theme.context.cjs.map +1 -0
- package/dist/providers/ThemeProvider/Theme.context.d.ts +16 -0
- package/dist/providers/ThemeProvider/Theme.context.d.ts.map +1 -0
- package/dist/providers/ThemeProvider/Theme.context.js +14 -0
- package/dist/providers/ThemeProvider/Theme.context.js.map +1 -0
- package/dist/providers/ThemeProvider/index.cjs +3 -11
- package/dist/providers/ThemeProvider/index.cjs.map +1 -1
- package/dist/providers/ThemeProvider/index.d.ts +1 -14
- package/dist/providers/ThemeProvider/index.d.ts.map +1 -1
- package/dist/providers/ThemeProvider/index.js +3 -10
- package/dist/providers/ThemeProvider/index.js.map +1 -1
- package/dist/utilities/__internal__/pageCoverUtils/pageCover.utils.cjs +30 -0
- package/dist/utilities/__internal__/pageCoverUtils/pageCover.utils.cjs.map +1 -0
- package/dist/utilities/__internal__/pageCoverUtils/pageCover.utils.d.ts +19 -0
- package/dist/utilities/__internal__/pageCoverUtils/pageCover.utils.d.ts.map +1 -0
- package/dist/utilities/__internal__/pageCoverUtils/pageCover.utils.js +26 -0
- package/dist/utilities/__internal__/pageCoverUtils/pageCover.utils.js.map +1 -0
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ var cx = require('@flipdish/ui-library/utilities/cx');
|
|
|
5
5
|
var react = require('motion/react');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var usePanelFocus = require('../../../../hooks/__internal__/usePanelFocus/usePanelFocus.cjs');
|
|
8
|
+
var pageCover_utils = require('../../../../utilities/__internal__/pageCoverUtils/pageCover.utils.cjs');
|
|
8
9
|
|
|
9
10
|
/** Width of the panel from `lg` in pixels. Matches `w-100`. Below `lg` the panel is as wide as the page. */
|
|
10
11
|
const SIDE_PANEL_WIDTH = 400;
|
|
@@ -23,6 +24,13 @@ const SidePanelRegion = ({ 'aria-label': ariaLabel, children, className, content
|
|
|
23
24
|
const panelRef = React.useRef(null);
|
|
24
25
|
const isPresent = react.useIsPresent();
|
|
25
26
|
const shouldReduceMotion = react.useReducedMotion();
|
|
27
|
+
// Starting to cover the page, on open below `lg` or on narrowing, is announced so a slideout over the page can close. Declared
|
|
28
|
+
// before the focus hook, so a slideout lifts its cover before this panel's focus call, which the cover would refuse.
|
|
29
|
+
const isCovering = isPresent && !isDesktop;
|
|
30
|
+
React.useEffect(() => {
|
|
31
|
+
if (isCovering && panelRef.current)
|
|
32
|
+
pageCover_utils.dispatchPageCover(panelRef.current);
|
|
33
|
+
}, [isCovering]);
|
|
26
34
|
const { onFocusCapture } = usePanelFocus.usePanelFocus({ panelRef, isPresent, isDesktop, shouldFocusOnMount, contentKey });
|
|
27
35
|
// The first content arrives with the panel's own opening animation; only a later swap fades in.
|
|
28
36
|
const firstContentKey = React.useRef(contentKey);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidePanelRegion.cjs","sources":["../../../../../src/components/organisms/SidePanel/components/SidePanelRegion.tsx"],"sourcesContent":[null],"names":["useRef","useIsPresent","useReducedMotion","
|
|
1
|
+
{"version":3,"file":"SidePanelRegion.cjs","sources":["../../../../../src/components/organisms/SidePanel/components/SidePanelRegion.tsx"],"sourcesContent":[null],"names":["useRef","useIsPresent","useReducedMotion","useEffect","dispatchPageCover","usePanelFocus","_jsx","motion","cx"],"mappings":";;;;;;;;;AASA;AACO,MAAM,gBAAgB,GAAG;AAEhC;AACA,MAAM,MAAM,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,EAAW;AAEvE,MAAM,MAAM,GAAG;IACb,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;IAC1B,IAAI,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC,EAAE,CAAC,EAAE;CAC/B;AAEV,MAAM,SAAS,GAAG;IAChB,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE;IACpC,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE;CACrB;AAYV;MACa,eAAe,GAAG,CAAC,EAC9B,YAAY,EAAE,SAAS,EACvB,QAAQ,EACR,SAAS,EACT,UAAU,EACV,MAAM,EACN,SAAS,EACT,kBAAkB,GACG,KAAI;AACzB,IAAA,MAAM,QAAQ,GAAGA,YAAM,CAAc,IAAI,CAAC;AAC1C,IAAA,MAAM,SAAS,GAAGC,kBAAY,EAAE;AAChC,IAAA,MAAM,kBAAkB,GAAGC,sBAAgB,EAAE;;;AAI7C,IAAA,MAAM,UAAU,GAAG,SAAS,IAAI,CAAC,SAAS;IAC1CC,eAAS,CAAC,MAAK;AACb,QAAA,IAAI,UAAU,IAAI,QAAQ,CAAC,OAAO;AAAE,YAAAC,iCAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC;AACzE,IAAA,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,SAAS,GAAG,iCAAiC,GAAG,QAAQ,CAAC,EAAA,QAAA,EAE3GF,cAAA,CAAA,KAAA,EAAA,EAEE,SAAS,EAAEE,KAAE,CAAC,8BAA8B,EAAE,iBAAiB,CAAC,OAAO,IAAI,4DAA4D,CAAC,EAAA,QAAA,EAEvI,QAAQ,EAAA,EAHJ,UAAU,CAIX,EAAA,CACF,EAAA,CACO;AAEnB;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidePanelRegion.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/SidePanel/components/SidePanelRegion.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SidePanelRegion.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/SidePanel/components/SidePanelRegion.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,4GAA4G;AAC5G,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAepC,UAAU,oBAAoB;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED,2GAA2G;AAC3G,eAAO,MAAM,eAAe,GAAI,sGAQ7B,oBAAoB,gCA4DtB,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
|
3
3
|
import { useIsPresent, useReducedMotion, motion } from 'motion/react';
|
|
4
4
|
import { useRef, useEffect } from 'react';
|
|
5
5
|
import { usePanelFocus } from '../../../../hooks/__internal__/usePanelFocus/usePanelFocus.js';
|
|
6
|
+
import { dispatchPageCover } from '../../../../utilities/__internal__/pageCoverUtils/pageCover.utils.js';
|
|
6
7
|
|
|
7
8
|
/** Width of the panel from `lg` in pixels. Matches `w-100`. Below `lg` the panel is as wide as the page. */
|
|
8
9
|
const SIDE_PANEL_WIDTH = 400;
|
|
@@ -21,6 +22,13 @@ const SidePanelRegion = ({ 'aria-label': ariaLabel, children, className, content
|
|
|
21
22
|
const panelRef = useRef(null);
|
|
22
23
|
const isPresent = useIsPresent();
|
|
23
24
|
const shouldReduceMotion = useReducedMotion();
|
|
25
|
+
// Starting to cover the page, on open below `lg` or on narrowing, is announced so a slideout over the page can close. Declared
|
|
26
|
+
// before the focus hook, so a slideout lifts its cover before this panel's focus call, which the cover would refuse.
|
|
27
|
+
const isCovering = isPresent && !isDesktop;
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (isCovering && panelRef.current)
|
|
30
|
+
dispatchPageCover(panelRef.current);
|
|
31
|
+
}, [isCovering]);
|
|
24
32
|
const { onFocusCapture } = usePanelFocus({ panelRef, isPresent, isDesktop, shouldFocusOnMount, contentKey });
|
|
25
33
|
// The first content arrives with the panel's own opening animation; only a later swap fades in.
|
|
26
34
|
const firstContentKey = useRef(contentKey);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidePanelRegion.js","sources":["../../../../../src/components/organisms/SidePanel/components/SidePanelRegion.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SidePanelRegion.js","sources":["../../../../../src/components/organisms/SidePanel/components/SidePanelRegion.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;;;;AASA;AACO,MAAM,gBAAgB,GAAG;AAEhC;AACA,MAAM,MAAM,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,EAAW;AAEvE,MAAM,MAAM,GAAG;IACb,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EA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AS;IACpE,SAAS,CAAC,MAAK;AACb,QAAA,iBAAiB,CAAC,OAAO,GAAG,SAAS;AACvC,IAAA,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;IAEf,MAAM,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS;AAEnD,IAAA,QACEA,GAAA,CAAC,MAAM,CAAC,KAAK,EAAA,EACX,GAAG,EAAE,QAAQ,EAAA,YAAA,EACD,SAAS,EAAA,aAAA,EACR,MAAM;;AAEnB,QAAA,QAAQ,EAAE,EAAE,EACZ,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,YAAY,CAAC,MAAM,EAC5B,OAAO,EAAE,YAAY,CAAC,IAAI,EAC1B,IAAI,EAAE,YAAY,CAAC,MAAM,EACzB,UAAU,EAAE,kBAAkB,IAAI,oBAAoB,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,MAAM;;;QAGjF,SAAS,EAAE,EAAE,CACX,kJAAkJ,EAClJ,CAAC,SAAS,IAAI,iCAAiC,EAC/C,SAAS,CACV,YAGDA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,EAAE,CAAC,+BAA+B,EAAE,SAAS,GAAG,iCAAiC,GAAG,QAAQ,CAAC,EAAA,QAAA,EAE3GA,GAAA,CAAA,KAAA,EAAA,EAEE,SAAS,EAAE,EAAE,CAAC,8BAA8B,EAAE,iBAAiB,CAAC,OAAO,IAAI,4DAA4D,CAAC,EAAA,QAAA,EAEvI,QAAQ,EAAA,EAHJ,UAAU,CAIX,EAAA,CACF,EAAA,CACO;AAEnB;;"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var useBreakpoints = require('@flipdish/ui-library/hooks/useBreakpoints');
|
|
5
|
-
var ThemeProvider = require('@flipdish/ui-library/providers/ThemeProvider');
|
|
6
5
|
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
7
6
|
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
8
7
|
var react = require('motion/react');
|
|
@@ -12,6 +11,8 @@ var reactAriaComponents = require('react-aria-components');
|
|
|
12
11
|
var usePanelFocus = require('../../../../hooks/__internal__/usePanelFocus/usePanelFocus.cjs');
|
|
13
12
|
var focus_utils = require('../../../../utilities/__internal__/focusUtils/focus.utils.cjs');
|
|
14
13
|
var hotkeys_utils = require('../../../../utilities/__internal__/hotkeysUtils/hotkeys.utils.cjs');
|
|
14
|
+
var Theme_context = require('../../../../providers/ThemeProvider/Theme.context.cjs');
|
|
15
|
+
var useCloseWhenCovered = require('../hooks/useCloseWhenCovered.cjs');
|
|
15
16
|
var useSlideoutState = require('../hooks/useSlideoutState.cjs');
|
|
16
17
|
var OverlayBounds_context = require('../providers/OverlayBounds.context.cjs');
|
|
17
18
|
var PageArea_context = require('../providers/PageArea.context.cjs');
|
|
@@ -19,18 +20,19 @@ var SlideoutMenu_context = require('../providers/SlideoutMenu.context.cjs');
|
|
|
19
20
|
var slideoutMenu_utils = require('../utilities/slideoutMenu.utils.cjs');
|
|
20
21
|
|
|
21
22
|
const SLIDE = { type: 'tween', duration: 0.3, ease: 'easeOut' };
|
|
22
|
-
|
|
23
|
+
// Leaves faster than it arrives, as `Modal` and the navigation drawer do.
|
|
24
|
+
const SLIDE_OUT = { type: 'tween', duration: 0.2, ease: 'easeIn' };
|
|
23
25
|
/** The panel itself. A component of its own so it can tell, while animating out, that it is leaving. */
|
|
24
|
-
const SlideoutPanel = ({ openState, label, labelledBy, boundsStyle, rootTestId, isDesktop, isKeyboardDismissDisabled,
|
|
26
|
+
const SlideoutPanel = ({ openState, label, labelledBy, boundsStyle, rootTestId, isDesktop, isKeyboardDismissDisabled, children, className, dialogClassName, }) => {
|
|
25
27
|
const panelRef = React.useRef(null);
|
|
26
28
|
const dialogRef = React.useRef(null);
|
|
27
29
|
const isPresent = react.useIsPresent();
|
|
28
30
|
const shouldReduceMotion = react.useReducedMotion();
|
|
29
|
-
const
|
|
30
|
-
//
|
|
31
|
-
// chrome, and with `scopeId` overlays portal outside it. The hook leaves a root the panel sits
|
|
32
|
-
// portals into its root
|
|
33
|
-
const themeRoot =
|
|
31
|
+
const pageAreaRef = React.useContext(PageArea_context.PageAreaContext);
|
|
32
|
+
// Without `AppShell` or `SlideoutMenu.PageArea` the panel covers the app itself: in a micro-frontend the themed root is the
|
|
33
|
+
// page area under the host's chrome, and with `scopeId` overlays portal outside it. The hook leaves a root the panel sits
|
|
34
|
+
// inside alone, so an app that portals into its root names its page area instead.
|
|
35
|
+
const themeRoot = Theme_context.useThemeRoot();
|
|
34
36
|
const themeRootRef = React.useMemo(() => ({ current: themeRoot }), [themeRoot]);
|
|
35
37
|
// Escape inside the panel; nothing outside is listened to for clicks, so the page stays usable and a click there never closes it.
|
|
36
38
|
const { overlayProps } = reactAria.useOverlay({ isOpen: isPresent, onClose: openState.close, isDismissable: false, shouldCloseOnBlur: false, isKeyboardDismissDisabled }, panelRef);
|
|
@@ -56,15 +58,22 @@ const SlideoutPanel = ({ openState, label, labelledBy, boundsStyle, rootTestId,
|
|
|
56
58
|
}, [isPresent, isKeyboardDismissDisabled]);
|
|
57
59
|
// react-aria's `useDialog` already focuses the dialog on mount; this hook is here for the hand-back on close, the inert exit,
|
|
58
60
|
// and below `lg` the page area under the panel, which it takes out of reach: keyboard and screen reader skip what nobody can
|
|
59
|
-
// see.
|
|
60
|
-
|
|
61
|
-
const { onFocusCapture, setOpener } = usePanelFocus.usePanelFocus({
|
|
61
|
+
// see. A named page area wins over the app root. `shouldFocusOnMount` is what makes the hook record the opener.
|
|
62
|
+
const coveredRef = pageAreaRef ?? themeRootRef;
|
|
63
|
+
const { onFocusCapture, setOpener, liftCover } = usePanelFocus.usePanelFocus({
|
|
62
64
|
panelRef: dialogRef,
|
|
63
65
|
isPresent,
|
|
64
66
|
isDesktop,
|
|
65
|
-
coveredRef
|
|
67
|
+
coveredRef,
|
|
66
68
|
shouldFocusOnMount: true,
|
|
67
69
|
});
|
|
70
|
+
// A side panel starting to cover the page below `lg`, the shell's or a host's, closes the panel: it would otherwise sit over
|
|
71
|
+
// what the user just opened. The cover lifts at once, so that panel, mounting under it, can take focus in the same pass.
|
|
72
|
+
const closeForCoveringPanel = React.useCallback(() => {
|
|
73
|
+
liftCover();
|
|
74
|
+
openState.close();
|
|
75
|
+
}, [liftCover, openState.close]);
|
|
76
|
+
useCloseWhenCovered.useCloseWhenCovered({ isOpen: isPresent, onClose: closeForCoveringPanel });
|
|
68
77
|
// A row opened by mouse selects on pointerdown, so the panel focuses itself before the browser's own mousedown focus lands
|
|
69
78
|
// back on the row. Settle one frame later: if nothing inside holds focus by then, the dialog takes it. A new gesture before
|
|
70
79
|
// that frame means the user has moved on, such as to the next row, and the frame is dropped so focus is not pulled back.
|
|
@@ -120,7 +129,7 @@ const SlideoutPanel = ({ openState, label, labelledBy, boundsStyle, rootTestId,
|
|
|
120
129
|
* and shares the open state with a surrounding `SlideoutMenu.Trigger`. Nothing is dimmed or locked; from
|
|
121
130
|
* `lg` the page beside the panel stays usable, and below `lg` only the page area it covers goes inert.
|
|
122
131
|
*/
|
|
123
|
-
const SlideoutShell = ({ isOpen, defaultOpen, onOpenChange, isKeyboardDismissDisabled, bounds,
|
|
132
|
+
const SlideoutShell = ({ isOpen, defaultOpen, onOpenChange, isKeyboardDismissDisabled, bounds, 'aria-label': ariaLabel, 'aria-labelledby': labelledBy, children, className, dialogClassName, 'data-testid': dataTestId, }) => {
|
|
124
133
|
const rootTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'slideout-menu', rootName: 'slideout-menu' });
|
|
125
134
|
const triggerState = React.useContext(reactAriaComponents.OverlayTriggerStateContext);
|
|
126
135
|
const local = useSlideoutState.useSlideoutState({ isOpen, defaultOpen, onOpenChange });
|
|
@@ -131,7 +140,7 @@ const SlideoutShell = ({ isOpen, defaultOpen, onOpenChange, isKeyboardDismissDis
|
|
|
131
140
|
const isDesktop = useBreakpoints.useBreakpoints('lg');
|
|
132
141
|
// A heading named through `aria-labelledby` replaces the default name; an explicit `aria-label` still wins.
|
|
133
142
|
const label = ariaLabel ?? (labelledBy ? undefined : 'Slideout menu');
|
|
134
|
-
return (jsxRuntime.jsx(testIdUtils.TestIdProvider, { value: rootTestId, children: jsxRuntime.jsx(react.AnimatePresence, { children: openState.isOpen && (jsxRuntime.jsx(reactAria.Overlay, { disableFocusManagement: true, children: jsxRuntime.jsx(reactAriaComponents.OverlayTriggerStateContext.Provider, { value: openState, children: jsxRuntime.jsx(SlideoutPanel, { openState: openState, label: label, labelledBy: labelledBy, boundsStyle: boundsStyle, rootTestId: rootTestId, isDesktop: isDesktop, isKeyboardDismissDisabled: isKeyboardDismissDisabled,
|
|
143
|
+
return (jsxRuntime.jsx(testIdUtils.TestIdProvider, { value: rootTestId, children: jsxRuntime.jsx(react.AnimatePresence, { children: openState.isOpen && (jsxRuntime.jsx(reactAria.Overlay, { disableFocusManagement: true, children: jsxRuntime.jsx(reactAriaComponents.OverlayTriggerStateContext.Provider, { value: openState, children: jsxRuntime.jsx(SlideoutPanel, { openState: openState, label: label, labelledBy: labelledBy, boundsStyle: boundsStyle, rootTestId: rootTestId, isDesktop: isDesktop, isKeyboardDismissDisabled: isKeyboardDismissDisabled, className: className, dialogClassName: dialogClassName, children: children }) }) }, "slideout-menu")) }) }));
|
|
135
144
|
};
|
|
136
145
|
SlideoutShell.displayName = 'SlideoutShell';
|
|
137
146
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlideoutShell.cjs","sources":["../../../../../src/components/organisms/SlideoutMenu/components/SlideoutShell.tsx"],"sourcesContent":[null],"names":["useRef","useIsPresent","useReducedMotion","useContext","PageAreaContext","useThemeRoot","useMemo","useOverlay","useEffect","isTypingInField","usePanelFocus","
|
|
1
|
+
{"version":3,"file":"SlideoutShell.cjs","sources":["../../../../../src/components/organisms/SlideoutMenu/components/SlideoutShell.tsx"],"sourcesContent":[null],"names":["useRef","useIsPresent","useReducedMotion","useContext","PageAreaContext","useThemeRoot","useMemo","useOverlay","useEffect","isTypingInField","usePanelFocus","useCallback","useCloseWhenCovered","getFocusedElement","useState","_jsx","_jsxs","motion","cx","SlideoutMenuContext","FocusScope","AriaDialog","useResolvedTestId","OverlayTriggerStateContext","useSlideoutState","OverlayBoundsContext","resolveSlideoutBounds","useBreakpoints","TestIdProvider","AnimatePresence","Overlay"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA2CA,MAAM,KAAK,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAW;AACxE;AACA,MAAM,SAAS,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAW;AAY3E;AACA,MAAM,aAAa,GAAG,CAAC,EACrB,SAAS,EACT,KAAK,EACL,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACT,yBAAyB,EACzB,QAAQ,EACR,SAAS,EACT,eAAe,GACI,KAAI;AACvB,IAAA,MAAM,QAAQ,GAAGA,YAAM,CAAiB,IAAI,CAAC;AAC7C,IAAA,MAAM,SAAS,GAAGA,YAAM,CAAc,IAAI,CAAC;AAC3C,IAAA,MAAM,SAAS,GAAGC,kBAAY,EAAE;AAChC,IAAA,MAAM,kBAAkB,GAAGC,sBAAgB,EAAE;AAC7C,IAAA,MAAM,WAAW,GAAGC,gBAAU,CAACC,gCAAe,CAAC;;;;AAI/C,IAAA,MAAM,SAAS,GAAGC,0BAAY,EAAE;AAChC,IAAA,MAAM,YAAY,GAAGC,aAAO,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;;AAGzE,IAAA,MAAM,EAAE,YAAY,EAAE,GAAGC,oBAAU,CACjC,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,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M,SAAS,GAAGC,6BAAc,CAAC,IAAI,CAAC;;AAEtC,IAAA,MAAM,KAAK,GAAG,SAAS,KAAK,UAAU,GAAG,SAAS,GAAG,eAAe,CAAC;AAErE,IAAA,QACEZ,cAAA,CAACa,0BAAc,EAAA,EAAC,KAAK,EAAE,UAAU,EAAA,QAAA,EAC/Bb,cAAA,CAACc,qBAAe,cACb,SAAS,CAAC,MAAM,KACfd,cAAA,CAACe,iBAAO,EAAA,EAAqB,sBAAsB,kBACjDf,cAAA,CAACQ,8CAA0B,CAAC,QAAQ,IAAC,KAAK,EAAE,SAAS,EAAA,QAAA,EACnDR,eAAC,aAAa,EAAA,EACZ,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,yBAAyB,EAAE,yBAAyB,EACpD,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,eAAe,EAAA,QAAA,EAE/B,QAAQ,EAAA,CACK,EAAA,CACoB,IAf3B,eAAe,CAgBlB,CACX,EAAA,CACe,EAAA,CACH;AAErB;AACA,aAAa,CAAC,WAAW,GAAG,eAAe;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReactNode
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
2
|
import type { SlideoutBounds } from '../utilities/slideoutMenu.utils';
|
|
3
3
|
/** What the render-prop form of `children` receives. */
|
|
4
4
|
export interface SlideoutRenderProps {
|
|
@@ -11,7 +11,6 @@ export interface SlideoutShellProps {
|
|
|
11
11
|
onOpenChange?: (isOpen: boolean) => void;
|
|
12
12
|
isKeyboardDismissDisabled?: boolean;
|
|
13
13
|
bounds?: SlideoutBounds;
|
|
14
|
-
pageAreaRef?: RefObject<HTMLElement | null>;
|
|
15
14
|
'aria-label'?: string;
|
|
16
15
|
'aria-labelledby'?: string;
|
|
17
16
|
children: ReactNode | ((state: SlideoutRenderProps) => ReactNode);
|
|
@@ -25,7 +24,7 @@ export interface SlideoutShellProps {
|
|
|
25
24
|
* `lg` the page beside the panel stays usable, and below `lg` only the page area it covers goes inert.
|
|
26
25
|
*/
|
|
27
26
|
export declare const SlideoutShell: {
|
|
28
|
-
({ isOpen, defaultOpen, onOpenChange, isKeyboardDismissDisabled, bounds,
|
|
27
|
+
({ isOpen, defaultOpen, onOpenChange, isKeyboardDismissDisabled, bounds, "aria-label": ariaLabel, "aria-labelledby": labelledBy, children, className, dialogClassName, "data-testid": dataTestId, }: SlideoutShellProps): import("react").JSX.Element;
|
|
29
28
|
displayName: string;
|
|
30
29
|
};
|
|
31
30
|
//# sourceMappingURL=SlideoutShell.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlideoutShell.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/SlideoutMenu/components/SlideoutShell.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SlideoutShell.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/SlideoutMenu/components/SlideoutShell.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AActD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGtE,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IAClC,wBAAwB;IACxB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,mBAAmB,KAAK,SAAS,CAAC,CAAC;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAmKD;;;;GAIG;AACH,eAAO,MAAM,aAAa;yMAYvB,kBAAkB;;CAqCpB,CAAC"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { useBreakpoints } from '@flipdish/ui-library/hooks/useBreakpoints';
|
|
3
|
-
import { useThemeRoot } from '@flipdish/ui-library/providers/ThemeProvider';
|
|
4
3
|
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
5
4
|
import { useResolvedTestId, TestIdProvider } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
6
5
|
import { AnimatePresence, useIsPresent, useReducedMotion, motion } from 'motion/react';
|
|
7
|
-
import { useContext, useRef, useMemo, useEffect,
|
|
6
|
+
import { useContext, useRef, useMemo, useEffect, useCallback, useState } from 'react';
|
|
8
7
|
import { Overlay, useOverlay, FocusScope } from 'react-aria';
|
|
9
8
|
import { OverlayTriggerStateContext, Dialog } from 'react-aria-components';
|
|
10
9
|
import { usePanelFocus } from '../../../../hooks/__internal__/usePanelFocus/usePanelFocus.js';
|
|
11
10
|
import { getFocusedElement } from '../../../../utilities/__internal__/focusUtils/focus.utils.js';
|
|
12
11
|
import { isTypingInField } from '../../../../utilities/__internal__/hotkeysUtils/hotkeys.utils.js';
|
|
12
|
+
import { useThemeRoot } from '../../../../providers/ThemeProvider/Theme.context.js';
|
|
13
|
+
import { useCloseWhenCovered } from '../hooks/useCloseWhenCovered.js';
|
|
13
14
|
import { useSlideoutState } from '../hooks/useSlideoutState.js';
|
|
14
15
|
import { OverlayBoundsContext } from '../providers/OverlayBounds.context.js';
|
|
15
16
|
import { PageAreaContext } from '../providers/PageArea.context.js';
|
|
@@ -17,17 +18,18 @@ import { SlideoutMenuContext } from '../providers/SlideoutMenu.context.js';
|
|
|
17
18
|
import { resolveSlideoutBounds } from '../utilities/slideoutMenu.utils.js';
|
|
18
19
|
|
|
19
20
|
const SLIDE = { type: 'tween', duration: 0.3, ease: 'easeOut' };
|
|
20
|
-
|
|
21
|
+
// Leaves faster than it arrives, as `Modal` and the navigation drawer do.
|
|
22
|
+
const SLIDE_OUT = { type: 'tween', duration: 0.2, ease: 'easeIn' };
|
|
21
23
|
/** The panel itself. A component of its own so it can tell, while animating out, that it is leaving. */
|
|
22
|
-
const SlideoutPanel = ({ openState, label, labelledBy, boundsStyle, rootTestId, isDesktop, isKeyboardDismissDisabled,
|
|
24
|
+
const SlideoutPanel = ({ openState, label, labelledBy, boundsStyle, rootTestId, isDesktop, isKeyboardDismissDisabled, children, className, dialogClassName, }) => {
|
|
23
25
|
const panelRef = useRef(null);
|
|
24
26
|
const dialogRef = useRef(null);
|
|
25
27
|
const isPresent = useIsPresent();
|
|
26
28
|
const shouldReduceMotion = useReducedMotion();
|
|
27
|
-
const
|
|
28
|
-
//
|
|
29
|
-
// chrome, and with `scopeId` overlays portal outside it. The hook leaves a root the panel sits
|
|
30
|
-
// portals into its root
|
|
29
|
+
const pageAreaRef = useContext(PageAreaContext);
|
|
30
|
+
// Without `AppShell` or `SlideoutMenu.PageArea` the panel covers the app itself: in a micro-frontend the themed root is the
|
|
31
|
+
// page area under the host's chrome, and with `scopeId` overlays portal outside it. The hook leaves a root the panel sits
|
|
32
|
+
// inside alone, so an app that portals into its root names its page area instead.
|
|
31
33
|
const themeRoot = useThemeRoot();
|
|
32
34
|
const themeRootRef = useMemo(() => ({ current: themeRoot }), [themeRoot]);
|
|
33
35
|
// Escape inside the panel; nothing outside is listened to for clicks, so the page stays usable and a click there never closes it.
|
|
@@ -54,15 +56,22 @@ const SlideoutPanel = ({ openState, label, labelledBy, boundsStyle, rootTestId,
|
|
|
54
56
|
}, [isPresent, isKeyboardDismissDisabled]);
|
|
55
57
|
// react-aria's `useDialog` already focuses the dialog on mount; this hook is here for the hand-back on close, the inert exit,
|
|
56
58
|
// and below `lg` the page area under the panel, which it takes out of reach: keyboard and screen reader skip what nobody can
|
|
57
|
-
// see.
|
|
58
|
-
|
|
59
|
-
const { onFocusCapture, setOpener } = usePanelFocus({
|
|
59
|
+
// see. A named page area wins over the app root. `shouldFocusOnMount` is what makes the hook record the opener.
|
|
60
|
+
const coveredRef = pageAreaRef ?? themeRootRef;
|
|
61
|
+
const { onFocusCapture, setOpener, liftCover } = usePanelFocus({
|
|
60
62
|
panelRef: dialogRef,
|
|
61
63
|
isPresent,
|
|
62
64
|
isDesktop,
|
|
63
|
-
coveredRef
|
|
65
|
+
coveredRef,
|
|
64
66
|
shouldFocusOnMount: true,
|
|
65
67
|
});
|
|
68
|
+
// A side panel starting to cover the page below `lg`, the shell's or a host's, closes the panel: it would otherwise sit over
|
|
69
|
+
// what the user just opened. The cover lifts at once, so that panel, mounting under it, can take focus in the same pass.
|
|
70
|
+
const closeForCoveringPanel = useCallback(() => {
|
|
71
|
+
liftCover();
|
|
72
|
+
openState.close();
|
|
73
|
+
}, [liftCover, openState.close]);
|
|
74
|
+
useCloseWhenCovered({ isOpen: isPresent, onClose: closeForCoveringPanel });
|
|
66
75
|
// A row opened by mouse selects on pointerdown, so the panel focuses itself before the browser's own mousedown focus lands
|
|
67
76
|
// back on the row. Settle one frame later: if nothing inside holds focus by then, the dialog takes it. A new gesture before
|
|
68
77
|
// that frame means the user has moved on, such as to the next row, and the frame is dropped so focus is not pulled back.
|
|
@@ -118,7 +127,7 @@ const SlideoutPanel = ({ openState, label, labelledBy, boundsStyle, rootTestId,
|
|
|
118
127
|
* and shares the open state with a surrounding `SlideoutMenu.Trigger`. Nothing is dimmed or locked; from
|
|
119
128
|
* `lg` the page beside the panel stays usable, and below `lg` only the page area it covers goes inert.
|
|
120
129
|
*/
|
|
121
|
-
const SlideoutShell = ({ isOpen, defaultOpen, onOpenChange, isKeyboardDismissDisabled, bounds,
|
|
130
|
+
const SlideoutShell = ({ isOpen, defaultOpen, onOpenChange, isKeyboardDismissDisabled, bounds, 'aria-label': ariaLabel, 'aria-labelledby': labelledBy, children, className, dialogClassName, 'data-testid': dataTestId, }) => {
|
|
122
131
|
const rootTestId = useResolvedTestId({ testId: dataTestId, segment: 'slideout-menu', rootName: 'slideout-menu' });
|
|
123
132
|
const triggerState = useContext(OverlayTriggerStateContext);
|
|
124
133
|
const local = useSlideoutState({ isOpen, defaultOpen, onOpenChange });
|
|
@@ -129,7 +138,7 @@ const SlideoutShell = ({ isOpen, defaultOpen, onOpenChange, isKeyboardDismissDis
|
|
|
129
138
|
const isDesktop = useBreakpoints('lg');
|
|
130
139
|
// A heading named through `aria-labelledby` replaces the default name; an explicit `aria-label` still wins.
|
|
131
140
|
const label = ariaLabel ?? (labelledBy ? undefined : 'Slideout menu');
|
|
132
|
-
return (jsx(TestIdProvider, { value: rootTestId, children: jsx(AnimatePresence, { children: openState.isOpen && (jsx(Overlay, { disableFocusManagement: true, children: jsx(OverlayTriggerStateContext.Provider, { value: openState, children: jsx(SlideoutPanel, { openState: openState, label: label, labelledBy: labelledBy, boundsStyle: boundsStyle, rootTestId: rootTestId, isDesktop: isDesktop, isKeyboardDismissDisabled: isKeyboardDismissDisabled,
|
|
141
|
+
return (jsx(TestIdProvider, { value: rootTestId, children: jsx(AnimatePresence, { children: openState.isOpen && (jsx(Overlay, { disableFocusManagement: true, children: jsx(OverlayTriggerStateContext.Provider, { value: openState, children: jsx(SlideoutPanel, { openState: openState, label: label, labelledBy: labelledBy, boundsStyle: boundsStyle, rootTestId: rootTestId, isDesktop: isDesktop, isKeyboardDismissDisabled: isKeyboardDismissDisabled, className: className, dialogClassName: dialogClassName, children: children }) }) }, "slideout-menu")) }) }));
|
|
133
142
|
};
|
|
134
143
|
SlideoutShell.displayName = 'SlideoutShell';
|
|
135
144
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlideoutShell.js","sources":["../../../../../src/components/organisms/SlideoutMenu/components/SlideoutShell.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs","AriaDialog"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SlideoutShell.js","sources":["../../../../../src/components/organisms/SlideoutMenu/components/SlideoutShell.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs","AriaDialog"],"mappings":";;;;;;;;;;;;;;;;;;;AA2CA,MAAM,KAAK,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAW;AACxE;AACA,MAAM,SAAS,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAW;AAY3E;AACA,MAAM,aAAa,GAAG,CAAC,EACrB,SAAS,EACT,KAAK,EACL,UAAU,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACT,yBAAyB,EACzB,QAAQ,EACR,SAAS,EACT,eAAe,GACI,KAAI;AACvB,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAiB,IAAI,CAAC;AAC7C,IAAA,MAAM,SAAS,GAAG,MAAM,CAAc,IAAI,CAAC;AAC3C,IAAA,MAAM,SAAS,GAAG,YAAY,EAAE;AAChC,IAAA,MAAM,kBAAkB,GAAG,gBAAgB,EAAE;AAC7C,IAAA,MAAM,WAAW,GAAG,UAAU,CAAC,eAAe,CAAC;;;;AAI/C,IAAA,MAAM,SAAS,GAAG,YAAY,EAAE;AAChC,IAAA,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;;AAGzE,IAAA,MAAM,EAAE,YAAY,EAAE,GAAG,UAAU,CACjC,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,iBAAiB,EAAE,KAAK,E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K,GAAG,SAAS,KAAK,UAAU,GAAG,SAAS,GAAG,eAAe,CAAC;AAErE,IAAA,QACEA,GAAA,CAAC,cAAc,EAAA,EAAC,KAAK,EAAE,UAAU,EAAA,QAAA,EAC/BA,GAAA,CAAC,eAAe,cACb,SAAS,CAAC,MAAM,KACfA,GAAA,CAAC,OAAO,EAAA,EAAqB,sBAAsB,kBACjDA,GAAA,CAAC,0BAA0B,CAAC,QAAQ,IAAC,KAAK,EAAE,SAAS,EAAA,QAAA,EACnDA,IAAC,aAAa,EAAA,EACZ,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,yBAAyB,EAAE,yBAAyB,EACpD,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,eAAe,EAAA,QAAA,EAE/B,QAAQ,EAAA,CACK,EAAA,CACoB,IAf3B,eAAe,CAgBlB,CACX,EAAA,CACe,EAAA,CACH;AAErB;AACA,aAAa,CAAC,WAAW,GAAG,eAAe;;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var pageCover_utils = require('../../../../utilities/__internal__/pageCoverUtils/pageCover.utils.cjs');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Closes the panel when a side panel starts covering the page, in the shell or in a host such as the Portal. The panel is
|
|
8
|
+
* the transient thing the user opened, and left open it would sit over what they just asked for.
|
|
9
|
+
*
|
|
10
|
+
* @param options Whether the panel is open, and how to close it.
|
|
11
|
+
*/
|
|
12
|
+
const useCloseWhenCovered = ({ isOpen, onClose }) => {
|
|
13
|
+
// Written in an effect, so a render React discards never leaves the listener a callback from a state it threw away; a
|
|
14
|
+
// layout effect, declared first, so the listener below calls the committed one even in the commit that opened the panel.
|
|
15
|
+
const closeRef = React.useRef(onClose);
|
|
16
|
+
React.useLayoutEffect(() => {
|
|
17
|
+
closeRef.current = onClose;
|
|
18
|
+
});
|
|
19
|
+
// Listening for as long as the panel is open, not only once it covers the page itself: narrowing flips the side panel and
|
|
20
|
+
// this panel at once, and a host's panel in another React root may announce before this one has re-rendered. The event
|
|
21
|
+
// only fires below `lg`, where a side panel covers the page, so it never closes a panel docked beside one. A layout
|
|
22
|
+
// effect, so a listener mounting in the same commit as the announcement is in place before passive effects run.
|
|
23
|
+
React.useLayoutEffect(() => {
|
|
24
|
+
if (!isOpen)
|
|
25
|
+
return;
|
|
26
|
+
return pageCover_utils.subscribePageCover(() => closeRef.current());
|
|
27
|
+
}, [isOpen]);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
exports.useCloseWhenCovered = useCloseWhenCovered;
|
|
31
|
+
//# sourceMappingURL=useCloseWhenCovered.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCloseWhenCovered.cjs","sources":["../../../../../src/components/organisms/SlideoutMenu/hooks/useCloseWhenCovered.ts"],"sourcesContent":[null],"names":["useRef","useLayoutEffect","subscribePageCover"],"mappings":";;;;;AAYA;;;;;AAKG;AACI,MAAM,mBAAmB,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,EAA8B,KAAU;;;AAG3F,IAAA,MAAM,QAAQ,GAAGA,YAAM,CAAC,OAAO,CAAC;IAChCC,qBAAe,CAAC,MAAK;AACnB,QAAA,QAAQ,CAAC,OAAO,GAAG,OAAO;AAC5B,IAAA,CAAC,CAAC;;;;;IAMFA,qBAAe,CAAC,MAAK;AACnB,QAAA,IAAI,CAAC,MAAM;YAAE;QACb,OAAOC,kCAAkB,CAAC,MAAM,QAAQ,CAAC,OAAO,EAAE,CAAC;AACrD,IAAA,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;AACd;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface UseCloseWhenCoveredOptions {
|
|
2
|
+
/** True while the panel is open, until it starts to leave. */
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
/** Closes the panel. */
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Closes the panel when a side panel starts covering the page, in the shell or in a host such as the Portal. The panel is
|
|
9
|
+
* the transient thing the user opened, and left open it would sit over what they just asked for.
|
|
10
|
+
*
|
|
11
|
+
* @param options Whether the panel is open, and how to close it.
|
|
12
|
+
*/
|
|
13
|
+
export declare const useCloseWhenCovered: ({ isOpen, onClose }: UseCloseWhenCoveredOptions) => void;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=useCloseWhenCovered.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCloseWhenCovered.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/SlideoutMenu/hooks/useCloseWhenCovered.ts"],"names":[],"mappings":"AAKA,UAAU,0BAA0B;IAClC,8DAA8D;IAC9D,MAAM,EAAE,OAAO,CAAC;IAChB,wBAAwB;IACxB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,qBAAqB,0BAA0B,KAAG,IAgBrF,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useRef, useLayoutEffect } from 'react';
|
|
2
|
+
import { subscribePageCover } from '../../../../utilities/__internal__/pageCoverUtils/pageCover.utils.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Closes the panel when a side panel starts covering the page, in the shell or in a host such as the Portal. The panel is
|
|
6
|
+
* the transient thing the user opened, and left open it would sit over what they just asked for.
|
|
7
|
+
*
|
|
8
|
+
* @param options Whether the panel is open, and how to close it.
|
|
9
|
+
*/
|
|
10
|
+
const useCloseWhenCovered = ({ isOpen, onClose }) => {
|
|
11
|
+
// Written in an effect, so a render React discards never leaves the listener a callback from a state it threw away; a
|
|
12
|
+
// layout effect, declared first, so the listener below calls the committed one even in the commit that opened the panel.
|
|
13
|
+
const closeRef = useRef(onClose);
|
|
14
|
+
useLayoutEffect(() => {
|
|
15
|
+
closeRef.current = onClose;
|
|
16
|
+
});
|
|
17
|
+
// Listening for as long as the panel is open, not only once it covers the page itself: narrowing flips the side panel and
|
|
18
|
+
// this panel at once, and a host's panel in another React root may announce before this one has re-rendered. The event
|
|
19
|
+
// only fires below `lg`, where a side panel covers the page, so it never closes a panel docked beside one. A layout
|
|
20
|
+
// effect, so a listener mounting in the same commit as the announcement is in place before passive effects run.
|
|
21
|
+
useLayoutEffect(() => {
|
|
22
|
+
if (!isOpen)
|
|
23
|
+
return;
|
|
24
|
+
return subscribePageCover(() => closeRef.current());
|
|
25
|
+
}, [isOpen]);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export { useCloseWhenCovered };
|
|
29
|
+
//# sourceMappingURL=useCloseWhenCovered.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCloseWhenCovered.js","sources":["../../../../../src/components/organisms/SlideoutMenu/hooks/useCloseWhenCovered.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAYA;;;;;AAKG;AACI,MAAM,mBAAmB,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,EAA8B,KAAU;;;AAG3F,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC;IAChC,eAAe,CAAC,MAAK;AACnB,QAAA,QAAQ,CAAC,OAAO,GAAG,OAAO;AAC5B,IAAA,CAAC,CAAC;;;;;IAMF,eAAe,CAAC,MAAK;AACnB,QAAA,IAAI,CAAC,MAAM;YAAE;QACb,OAAO,kBAAkB,CAAC,MAAM,QAAQ,CAAC,OAAO,EAAE,CAAC;AACrD,IAAA,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;AACd;;"}
|
|
@@ -13,10 +13,11 @@ const useSlideoutState = ({ isOpen, defaultOpen, onOpenChange }) => {
|
|
|
13
13
|
const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen ?? false);
|
|
14
14
|
const isOpenControlled = isOpen !== undefined;
|
|
15
15
|
const resolvedOpen = isOpenControlled ? isOpen : uncontrolledOpen;
|
|
16
|
-
// The latest callback and value live in refs so the returned API keeps its identity across renders.
|
|
16
|
+
// The latest callback and value live in refs so the returned API keeps its identity across renders. Synced in a layout
|
|
17
|
+
// effect, so a close asked for from a passive effect in the same commit, such as a side panel's cover, sees the open state.
|
|
17
18
|
const onOpenChangeRef = React.useRef(onOpenChange);
|
|
18
19
|
const isOpenRef = React.useRef(resolvedOpen);
|
|
19
|
-
React.
|
|
20
|
+
React.useLayoutEffect(() => {
|
|
20
21
|
onOpenChangeRef.current = onOpenChange;
|
|
21
22
|
isOpenRef.current = resolvedOpen;
|
|
22
23
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSlideoutState.cjs","sources":["../../../../../src/components/organisms/SlideoutMenu/hooks/useSlideoutState.ts"],"sourcesContent":[null],"names":["useState","useRef","
|
|
1
|
+
{"version":3,"file":"useSlideoutState.cjs","sources":["../../../../../src/components/organisms/SlideoutMenu/hooks/useSlideoutState.ts"],"sourcesContent":[null],"names":["useState","useRef","useLayoutEffect","useCallback","useMemo"],"mappings":";;;;AAmBA;;;;;;AAMG;AACI,MAAM,gBAAgB,GAAG,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAA2B,KAAuB;AACpH,IAAA,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAGA,cAAQ,CAAC,WAAW,IAAI,KAAK,CAAC;AAC9E,IAAA,MAAM,gBAAgB,GAAG,MAAM,KAAK,SAAS;IAC7C,MAAM,YAAY,GAAG,gBAAgB,GAAG,MAAM,GAAG,gBAAgB;;;AAIjE,IAAA,MAAM,eAAe,GAAGC,YAAM,CAAC,YAAY,CAAC;AAC5C,IAAA,MAAM,SAAS,GAAGA,YAAM,CAAC,YAAY,CAAC;IACtCC,qBAAe,CAAC,MAAK;AACnB,QAAA,eAAe,CAAC,OAAO,GAAG,YAAY;AACtC,QAAA,SAAS,CAAC,OAAO,GAAG,YAAY;AAClC,IAAA,CAAC,CAAC;AAEF,IAAA,MAAM,OAAO,GAAGC,iBAAW,CACzB,CAAC,IAAa,KAAI;AAChB,QAAA,IAAI,CAAC,gBAAgB;YAAE,mBAAmB,CAAC,IAAI,CAAC;AAChD,QAAA,IAAI,IAAI,KAAK,SAAS,CAAC,OAAO;AAAE,YAAA,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC;AACjE,IAAA,CAAC,EACD,CAAC,gBAAgB,CAAC,CACnB;AAED,IAAA,OAAOC,aAAO,CACZ,OAAO;AACL,QAAA,MAAM,EAAE,YAAY;QACpB,OAAO;AACP,QAAA,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC;AACzB,QAAA,KAAK,EAAE,MAAM,OAAO,CAAC,KAAK,CAAC;QAC3B,MAAM,EAAE,MAAM,OAAO,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC;AAC1C,KAAA,CAAC,EACF,CAAC,YAAY,EAAE,OAAO,CAAC,CACxB;AACH;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSlideoutState.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/SlideoutMenu/hooks/useSlideoutState.ts"],"names":[],"mappings":"AAIA,UAAU,uBAAuB;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C;AAED,wHAAwH;AACxH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAAI,uCAAuC,uBAAuB,KAAG,
|
|
1
|
+
{"version":3,"file":"useSlideoutState.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/SlideoutMenu/hooks/useSlideoutState.ts"],"names":[],"mappings":"AAIA,UAAU,uBAAuB;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C;AAED,wHAAwH;AACxH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAAI,uCAAuC,uBAAuB,KAAG,iBAgCjG,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState, useRef,
|
|
1
|
+
import { useState, useRef, useLayoutEffect, useCallback, useMemo } from 'react';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Owns the panel's open state, controlled or uncontrolled by the usual pair of props, in the shape
|
|
@@ -11,10 +11,11 @@ const useSlideoutState = ({ isOpen, defaultOpen, onOpenChange }) => {
|
|
|
11
11
|
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen ?? false);
|
|
12
12
|
const isOpenControlled = isOpen !== undefined;
|
|
13
13
|
const resolvedOpen = isOpenControlled ? isOpen : uncontrolledOpen;
|
|
14
|
-
// The latest callback and value live in refs so the returned API keeps its identity across renders.
|
|
14
|
+
// The latest callback and value live in refs so the returned API keeps its identity across renders. Synced in a layout
|
|
15
|
+
// effect, so a close asked for from a passive effect in the same commit, such as a side panel's cover, sees the open state.
|
|
15
16
|
const onOpenChangeRef = useRef(onOpenChange);
|
|
16
17
|
const isOpenRef = useRef(resolvedOpen);
|
|
17
|
-
|
|
18
|
+
useLayoutEffect(() => {
|
|
18
19
|
onOpenChangeRef.current = onOpenChange;
|
|
19
20
|
isOpenRef.current = resolvedOpen;
|
|
20
21
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSlideoutState.js","sources":["../../../../../src/components/organisms/SlideoutMenu/hooks/useSlideoutState.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAmBA;;;;;;AAMG;AACI,MAAM,gBAAgB,GAAG,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAA2B,KAAuB;AACpH,IAAA,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAC,WAAW,IAAI,KAAK,CAAC;AAC9E,IAAA,MAAM,gBAAgB,GAAG,MAAM,KAAK,SAAS;IAC7C,MAAM,YAAY,GAAG,gBAAgB,GAAG,MAAM,GAAG,gBAAgB
|
|
1
|
+
{"version":3,"file":"useSlideoutState.js","sources":["../../../../../src/components/organisms/SlideoutMenu/hooks/useSlideoutState.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAmBA;;;;;;AAMG;AACI,MAAM,gBAAgB,GAAG,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAA2B,KAAuB;AACpH,IAAA,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAC,WAAW,IAAI,KAAK,CAAC;AAC9E,IAAA,MAAM,gBAAgB,GAAG,MAAM,KAAK,SAAS;IAC7C,MAAM,YAAY,GAAG,gBAAgB,GAAG,MAAM,GAAG,gBAAgB;;;AAIjE,IAAA,MAAM,eAAe,GAAG,MAAM,CAAC,YAAY,CAAC;AAC5C,IAAA,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC;IACtC,eAAe,CAAC,MAAK;AACnB,QAAA,eAAe,CAAC,OAAO,GAAG,YAAY;AACtC,QAAA,SAAS,CAAC,OAAO,GAAG,YAAY;AAClC,IAAA,CAAC,CAAC;AAEF,IAAA,MAAM,OAAO,GAAG,WAAW,CACzB,CAAC,IAAa,KAAI;AAChB,QAAA,IAAI,CAAC,gBAAgB;YAAE,mBAAmB,CAAC,IAAI,CAAC;AAChD,QAAA,IAAI,IAAI,KAAK,SAAS,CAAC,OAAO;AAAE,YAAA,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC;AACjE,IAAA,CAAC,EACD,CAAC,gBAAgB,CAAC,CACnB;AAED,IAAA,OAAO,OAAO,CACZ,OAAO;AACL,QAAA,MAAM,EAAE,YAAY;QACpB,OAAO;AACP,QAAA,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC;AACzB,QAAA,KAAK,EAAE,MAAM,OAAO,CAAC,KAAK,CAAC;QAC3B,MAAM,EAAE,MAAM,OAAO,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC;AAC1C,KAAA,CAAC,EACF,CAAC,YAAY,EAAE,OAAO,CAAC,CACxB;AACH;;"}
|
|
@@ -10,6 +10,7 @@ var utils = require('@react-aria/utils');
|
|
|
10
10
|
var React = require('react');
|
|
11
11
|
var reactAriaComponents = require('react-aria-components');
|
|
12
12
|
var SlideoutShell = require('./components/SlideoutShell.cjs');
|
|
13
|
+
var PageArea_context = require('./providers/PageArea.context.cjs');
|
|
13
14
|
var SlideoutMenu_context = require('./providers/SlideoutMenu.context.cjs');
|
|
14
15
|
var slideoutMenu_utils = require('./utilities/slideoutMenu.utils.cjs');
|
|
15
16
|
|
|
@@ -47,6 +48,9 @@ const Footer = ({ 'data-testid': dataTestId, ...props }) => {
|
|
|
47
48
|
return (jsxRuntime.jsx("div", { ...props, "data-testid": footerTestId, className: cx.cx('w-full p-4 shadow-[inset_0px_1px_0px_0px] shadow-border-secondary md:px-6', props.className) }));
|
|
48
49
|
};
|
|
49
50
|
Footer.displayName = 'SlideoutFooter';
|
|
51
|
+
/** Names what the slideouts below it cover below `lg`, for a layout of its own; `AppShell` does it for its page area. */
|
|
52
|
+
const PageArea = ({ areaRef, children }) => jsxRuntime.jsx(PageArea_context.PageAreaContext.Provider, { value: areaRef, children: children });
|
|
53
|
+
PageArea.displayName = 'SlideoutPageArea';
|
|
50
54
|
/**
|
|
51
55
|
* Panel that slides in from the right edge and floats over the page without dimming or blocking it,
|
|
52
56
|
* for the detail of the record the user just selected. It covers the page area only, never the header, the
|
|
@@ -61,6 +65,7 @@ SlideoutMenu.Trigger = reactAriaComponents.DialogTrigger;
|
|
|
61
65
|
SlideoutMenu.Content = Content;
|
|
62
66
|
SlideoutMenu.Header = Header;
|
|
63
67
|
SlideoutMenu.Footer = Footer;
|
|
68
|
+
SlideoutMenu.PageArea = PageArea;
|
|
64
69
|
|
|
65
70
|
exports.APP_HEADER_HEIGHT_VAR = slideoutMenu_utils.APP_HEADER_HEIGHT_VAR;
|
|
66
71
|
exports.APP_SIDEBAR_WIDTH_VAR = slideoutMenu_utils.APP_SIDEBAR_WIDTH_VAR;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../src/components/organisms/SlideoutMenu/index.tsx"],"sourcesContent":[null],"names":["_jsx","SlideoutShell","useTestIdPrefix","joinTestId","cx","useContext","SlideoutMenuContext","useRef","useObjectRef","useLayoutEffect","_jsxs","ButtonUtility","ArrowUpRight","CloseButton","AriaDialogTrigger"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/components/organisms/SlideoutMenu/index.tsx"],"sourcesContent":[null],"names":["_jsx","SlideoutShell","useTestIdPrefix","joinTestId","cx","useContext","SlideoutMenuContext","useRef","useObjectRef","useLayoutEffect","_jsxs","ButtonUtility","ArrowUpRight","CloseButton","PageAreaContext","AriaDialogTrigger"],"mappings":";;;;;;;;;;;;;;;;AAsDA,MAAM,IAAI,GAAG,CAAC,KAAwB,KAAKA,cAAA,CAACC,2BA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