@trackunit/react-components 0.4.20 → 0.4.22

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
@@ -1162,8 +1162,9 @@ const useGeometry = (ref) => {
1162
1162
  y: 0,
1163
1163
  });
1164
1164
  const resizeObserver = React.useRef(null);
1165
+ const refCurrent = ref.current;
1165
1166
  React.useEffect(() => {
1166
- if (!ref.current) {
1167
+ if (!refCurrent) {
1167
1168
  return;
1168
1169
  }
1169
1170
  if (!resizeObserver.current) {
@@ -1183,13 +1184,13 @@ const useGeometry = (ref) => {
1183
1184
  }
1184
1185
  });
1185
1186
  }
1186
- resizeObserver.current.observe(ref.current);
1187
+ resizeObserver.current.observe(refCurrent);
1187
1188
  return () => {
1188
1189
  if (resizeObserver.current) {
1189
1190
  resizeObserver.current.disconnect();
1190
1191
  }
1191
1192
  };
1192
- }, [ref]);
1193
+ }, [refCurrent]);
1193
1194
  return geometry;
1194
1195
  };
1195
1196
 
package/index.esm.js CHANGED
@@ -1142,8 +1142,9 @@ const useGeometry = (ref) => {
1142
1142
  y: 0,
1143
1143
  });
1144
1144
  const resizeObserver = useRef(null);
1145
+ const refCurrent = ref.current;
1145
1146
  useEffect(() => {
1146
- if (!ref.current) {
1147
+ if (!refCurrent) {
1147
1148
  return;
1148
1149
  }
1149
1150
  if (!resizeObserver.current) {
@@ -1163,13 +1164,13 @@ const useGeometry = (ref) => {
1163
1164
  }
1164
1165
  });
1165
1166
  }
1166
- resizeObserver.current.observe(ref.current);
1167
+ resizeObserver.current.observe(refCurrent);
1167
1168
  return () => {
1168
1169
  if (resizeObserver.current) {
1169
1170
  resizeObserver.current.disconnect();
1170
1171
  }
1171
1172
  };
1172
- }, [ref]);
1173
+ }, [refCurrent]);
1173
1174
  return geometry;
1174
1175
  };
1175
1176
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-components",
3
- "version": "0.4.20",
3
+ "version": "0.4.22",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -2,7 +2,6 @@ import { Placement } from "@floating-ui/react";
2
2
  import * as React from "react";
3
3
  import { CommonProps } from "../../common";
4
4
  import { IconProps } from "../Icon/Icon";
5
- export type ToolTipVariant = "icon" | "none";
6
5
  export type TooltipPlacement = Placement | "auto";
7
6
  export interface TooltipProps extends CommonProps {
8
7
  /**
@@ -1,8 +1,9 @@
1
+ import { RefObject } from "react";
1
2
  /**
2
3
  * Custom hook to get the geometry of an element.
3
4
  * Size and position of the element relative to the viewport.
4
5
  */
5
- export declare const useGeometry: (ref: React.RefObject<HTMLElement>) => {
6
+ export declare const useGeometry: (ref: RefObject<HTMLElement>) => {
6
7
  width: number;
7
8
  height: number;
8
9
  top: number;