@trackunit/react-components 0.0.193 → 0.0.194

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.
Files changed (2) hide show
  1. package/index.js +6 -0
  2. package/package.json +2 -1
package/index.js CHANGED
@@ -11,6 +11,7 @@ import { useFloating, offset, shift, flip, autoUpdate, useInteractions, useClick
11
11
  import { Link, UNSAFE_NavigationContext } from 'react-router-dom';
12
12
  import { DayPicker as DayPicker$1 } from 'react-day-picker';
13
13
  import { enGB, enUS, da, de, cs, nl, fr, fi, hu, it, nb, pl, pt, ru, ro, es, sv, ja, th } from 'date-fns/locale';
14
+ import { useClickOutside } from 'react-browser-hooks';
14
15
  import usePortal from 'react-useportal';
15
16
  import { Helmet } from 'react-helmet';
16
17
  import ReactSelect, { components } from 'react-select';
@@ -2760,7 +2761,12 @@ const MoreMenu = ({
2760
2761
  }) => {
2761
2762
  const [actionMenuIsOpen, setActionMenuIsOpen] = useState(false);
2762
2763
  const dotsName = dotsDirection === DotsDirection.horizontal ? "DotsHorizontalIcon" : "DotsVerticalIcon";
2764
+ const actionMenuRef = useRef(null);
2765
+ useClickOutside(actionMenuRef, () => {
2766
+ setActionMenuIsOpen(false);
2767
+ });
2763
2768
  return jsxs(Root$3, Object.assign({
2769
+ ref: actionMenuRef,
2764
2770
  className: className,
2765
2771
  "data-testid": dataTestId
2766
2772
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-components",
3
- "version": "0.0.193",
3
+ "version": "0.0.194",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "dependencies": {
@@ -15,6 +15,7 @@
15
15
  "date-fns": "^2.29.3",
16
16
  "react-day-picker": "^8.3.0",
17
17
  "@trackunit/ui-icons": "0.0.53",
18
+ "react-browser-hooks": "^2.2.4",
18
19
  "react-useportal": "1.0.17",
19
20
  "@floating-ui/react-dom-interactions": "^0.10.1",
20
21
  "react-router-dom": "6.4.1",