@trackunit/react-modal 1.18.26 → 1.20.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
@@ -495,11 +495,7 @@ const useModalStack = (isOpen) => {
495
495
  const depthFromFront = localDepthFromFront + hostModalCount;
496
496
  // Get the total stack size when this modal opened (stable once set)
497
497
  const stackSizeAtOpen = modalOpenState.get(modalId) ?? 0;
498
- return {
499
- depthFromFront,
500
- stackSize: totalStackSize,
501
- stackSizeAtOpen,
502
- };
498
+ return react.useMemo(() => ({ depthFromFront, stackSize: totalStackSize, stackSizeAtOpen }), [depthFromFront, totalStackSize, stackSizeAtOpen]);
503
499
  };
504
500
 
505
501
  /** Scale factor per modal depth level (5% smaller per level back) */
package/index.esm.js CHANGED
@@ -2,7 +2,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { registerTranslations } from '@trackunit/i18n-library-translation';
3
3
  import { useMergeRefs, FloatingOverlay, FloatingFocusManager, useFloating, shift, autoUpdate, useDismiss, useInteractions } from '@floating-ui/react';
4
4
  import { Portal, Card, Button, Heading, Text, IconButton, Icon, useWatch } from '@trackunit/react-components';
5
- import { useLayoutEffect, useId, useSyncExternalStore, useRef, forwardRef, useState, useContext, useEffect, useCallback, useMemo } from 'react';
5
+ import { useLayoutEffect, useId, useSyncExternalStore, useMemo, useRef, forwardRef, useState, useContext, useEffect, useCallback } from 'react';
6
6
  import { cvaMerge } from '@trackunit/css-class-variance-utilities';
7
7
  import { ModalDialogContext } from '@trackunit/react-core-contexts-api';
8
8
 
@@ -493,11 +493,7 @@ const useModalStack = (isOpen) => {
493
493
  const depthFromFront = localDepthFromFront + hostModalCount;
494
494
  // Get the total stack size when this modal opened (stable once set)
495
495
  const stackSizeAtOpen = modalOpenState.get(modalId) ?? 0;
496
- return {
497
- depthFromFront,
498
- stackSize: totalStackSize,
499
- stackSizeAtOpen,
500
- };
496
+ return useMemo(() => ({ depthFromFront, stackSize: totalStackSize, stackSizeAtOpen }), [depthFromFront, totalStackSize, stackSizeAtOpen]);
501
497
  };
502
498
 
503
499
  /** Scale factor per modal depth level (5% smaller per level back) */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-modal",
3
- "version": "1.18.26",
3
+ "version": "1.20.6",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -8,12 +8,12 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "@floating-ui/react": "^0.26.25",
11
- "@trackunit/react-components": "1.20.20",
12
- "@trackunit/css-class-variance-utilities": "1.11.89",
13
- "@trackunit/shared-utils": "1.13.89",
11
+ "@trackunit/react-components": "1.21.4",
12
+ "@trackunit/css-class-variance-utilities": "1.11.91",
13
+ "@trackunit/shared-utils": "1.13.91",
14
14
  "@floating-ui/react-dom": "2.1.2",
15
- "@trackunit/react-core-contexts-api": "1.14.15",
16
- "@trackunit/i18n-library-translation": "1.15.20"
15
+ "@trackunit/react-core-contexts-api": "1.15.3",
16
+ "@trackunit/i18n-library-translation": "1.17.4"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "react": "^19.0.0"