@trackunit/react-drawer 2.16.2 → 2.17.6

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 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
- return shouldUsePortal ? jsxRuntime.jsx(reactComponents.Portal, { children: content }) : content;
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, Portal, IconButton, Icon, MoreMenu } from '@trackunit/react-components';
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
- return shouldUsePortal ? jsx(Portal, { children: content }) : content;
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.16.2",
3
+ "version": "2.17.6",
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": "5.0.1",
11
- "@trackunit/css-class-variance-utilities": "2.6.10",
12
- "@trackunit/i18n-library-translation": "2.13.2",
10
+ "@trackunit/react-components": "6.0.5",
11
+ "@trackunit/css-class-variance-utilities": "2.6.15",
12
+ "@trackunit/i18n-library-translation": "2.14.5",
13
13
  "@floating-ui/react": "^0.26.25",
14
14
  "tailwind-merge": "^3.7.0"
15
15
  },