@trackunit/react-drawer 2.16.1 → 2.17.5
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/index.cjs.js +3 -1
- package/index.esm.js +5 -3
- package/package.json +4 -4
package/index.cjs.js
CHANGED
|
@@ -470,7 +470,9 @@ const Drawer = ({ isOpen, variant, trapFocus, position, floatingUi, children, "d
|
|
|
470
470
|
...getDrawerMotionStyle({ mode: drawerState.mode, position }),
|
|
471
471
|
}, children: jsxRuntime.jsx("div", { className: cvaDrawerContent({ position }), children: children }) }));
|
|
472
472
|
const content = (jsxRuntime.jsxs("div", { className: cvaDrawerViewport({ portaled: shouldUsePortal, className: containerClassName }), "data-testid": "drawer-viewport", children: [isModal ? jsxRuntime.jsx(Overlay, { open: isOpen ? drawerState.mode === "open" : false }) : null, showFocusManager ? (jsxRuntime.jsx(react$1.FloatingFocusManager, { context: floatingUi.context, initialFocus: -1, returnFocus: true, children: panel })) : (panel)] }));
|
|
473
|
-
|
|
473
|
+
// An explicit root stops FloatingPortal from nesting inside a parent portal (e.g. a Sheet with
|
|
474
|
+
// `pointer-events: none`), so the drawer always escapes to the body.
|
|
475
|
+
return shouldUsePortal ? jsxRuntime.jsx(react$1.FloatingPortal, { root: document.body, children: content }) : content;
|
|
474
476
|
};
|
|
475
477
|
Drawer.displayName = "Drawer";
|
|
476
478
|
|
package/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { registerTranslations, useNamespaceTranslation } from '@trackunit/i18n-library-translation';
|
|
3
|
-
import { useMergeRefs, FloatingFocusManager, useFloating, useDismiss, useInteractions } from '@floating-ui/react';
|
|
4
|
-
import { useViewportBreakpoints,
|
|
3
|
+
import { useMergeRefs, FloatingFocusManager, FloatingPortal, useFloating, useDismiss, useInteractions } from '@floating-ui/react';
|
|
4
|
+
import { useViewportBreakpoints, IconButton, Icon, MoreMenu } from '@trackunit/react-components';
|
|
5
5
|
import { useRef, useState, useReducer, useEffect, useCallback, useLayoutEffect, useMemo } from 'react';
|
|
6
6
|
import { cva } from '@trackunit/css-class-variance-utilities';
|
|
7
7
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -468,7 +468,9 @@ const Drawer = ({ isOpen, variant, trapFocus, position, floatingUi, children, "d
|
|
|
468
468
|
...getDrawerMotionStyle({ mode: drawerState.mode, position }),
|
|
469
469
|
}, children: jsx("div", { className: cvaDrawerContent({ position }), children: children }) }));
|
|
470
470
|
const content = (jsxs("div", { className: cvaDrawerViewport({ portaled: shouldUsePortal, className: containerClassName }), "data-testid": "drawer-viewport", children: [isModal ? jsx(Overlay, { open: isOpen ? drawerState.mode === "open" : false }) : null, showFocusManager ? (jsx(FloatingFocusManager, { context: floatingUi.context, initialFocus: -1, returnFocus: true, children: panel })) : (panel)] }));
|
|
471
|
-
|
|
471
|
+
// An explicit root stops FloatingPortal from nesting inside a parent portal (e.g. a Sheet with
|
|
472
|
+
// `pointer-events: none`), so the drawer always escapes to the body.
|
|
473
|
+
return shouldUsePortal ? jsx(FloatingPortal, { root: document.body, children: content }) : content;
|
|
472
474
|
};
|
|
473
475
|
Drawer.displayName = "Drawer";
|
|
474
476
|
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-drawer",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.17.5",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=24.x"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@trackunit/react-components": "
|
|
11
|
-
"@trackunit/css-class-variance-utilities": "2.6.
|
|
12
|
-
"@trackunit/i18n-library-translation": "2.
|
|
10
|
+
"@trackunit/react-components": "6.0.4",
|
|
11
|
+
"@trackunit/css-class-variance-utilities": "2.6.14",
|
|
12
|
+
"@trackunit/i18n-library-translation": "2.14.4",
|
|
13
13
|
"@floating-ui/react": "^0.26.25",
|
|
14
14
|
"tailwind-merge": "^3.7.0"
|
|
15
15
|
},
|