h2o-library 2.1.0 → 2.1.1
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/CHANGELOG.md +8 -0
- package/dist/charts/hooks/src/use-click-outside.d.ts +1 -1
- package/dist/charts/hooks/src/use-dropdown-position.d.ts +1 -1
- package/dist/esm/hooks/src/use-click-outside.d.ts +1 -1
- package/dist/esm/hooks/src/use-dropdown-position.d.ts +1 -1
- package/dist/hooks/hooks/src/use-click-outside.d.ts +1 -1
- package/dist/hooks/hooks/src/use-dropdown-position.d.ts +1 -1
- package/dist/hooks/src/use-click-outside.d.ts +1 -1
- package/dist/hooks/src/use-dropdown-position.d.ts +1 -1
- package/dist/types/hooks/src/use-click-outside.d.ts +1 -1
- package/dist/types/hooks/src/use-dropdown-position.d.ts +1 -1
- package/dist/utils/hooks/src/use-click-outside.d.ts +1 -1
- package/dist/utils/hooks/src/use-dropdown-position.d.ts +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -20,6 +20,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
|
20
20
|
|
|
21
21
|
---
|
|
22
22
|
|
|
23
|
+
## [2.1.1] — 2026-06-23
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- **React 19 compatibility** — Hooks that accept an element ref now type the argument as `RefObject<T | null>` to match React 19, where `useRef<T>(null)` returns `RefObject<T | null>`. Updated `useClickOutside` and `useDropdownPosition`; `useFocusTrap` and `useEventListener` already used the nullable form. Type-only change — no runtime behavior difference, and existing React 18 callers remain compatible.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
23
31
|
## [2.1.0] — 2026-06-22
|
|
24
32
|
|
|
25
33
|
### Added
|
|
@@ -9,5 +9,5 @@ type Handler = (event: MouseEvent | TouchEvent) => void;
|
|
|
9
9
|
* @param handler - Called when an outside interaction happens.
|
|
10
10
|
* @param mouseEvent - Which mouse event to listen for (defaults to `"mousedown"`).
|
|
11
11
|
*/
|
|
12
|
-
export declare function useClickOutside<T extends HTMLElement = HTMLElement>(ref: RefObject<T>, handler: Handler, mouseEvent?: "mousedown" | "mouseup"): void;
|
|
12
|
+
export declare function useClickOutside<T extends HTMLElement = HTMLElement>(ref: RefObject<T | null>, handler: Handler, mouseEvent?: "mousedown" | "mouseup"): void;
|
|
13
13
|
export {};
|
|
@@ -7,4 +7,4 @@ import type { RefObject } from "react";
|
|
|
7
7
|
* @param direction - Force `"top"`/`"bottom"` or let it auto-detect.
|
|
8
8
|
* @param menuHeight - Expected menu height (px) used for the calculation.
|
|
9
9
|
*/
|
|
10
|
-
export declare function useDropdownPosition(containerRef: RefObject<HTMLElement>, isOpen: boolean, direction?: "top" | "bottom" | "auto", menuHeight?: number): "top" | "bottom";
|
|
10
|
+
export declare function useDropdownPosition(containerRef: RefObject<HTMLElement | null>, isOpen: boolean, direction?: "top" | "bottom" | "auto", menuHeight?: number): "top" | "bottom";
|
|
@@ -9,5 +9,5 @@ type Handler = (event: MouseEvent | TouchEvent) => void;
|
|
|
9
9
|
* @param handler - Called when an outside interaction happens.
|
|
10
10
|
* @param mouseEvent - Which mouse event to listen for (defaults to `"mousedown"`).
|
|
11
11
|
*/
|
|
12
|
-
export declare function useClickOutside<T extends HTMLElement = HTMLElement>(ref: RefObject<T>, handler: Handler, mouseEvent?: "mousedown" | "mouseup"): void;
|
|
12
|
+
export declare function useClickOutside<T extends HTMLElement = HTMLElement>(ref: RefObject<T | null>, handler: Handler, mouseEvent?: "mousedown" | "mouseup"): void;
|
|
13
13
|
export {};
|
|
@@ -7,4 +7,4 @@ import type { RefObject } from "react";
|
|
|
7
7
|
* @param direction - Force `"top"`/`"bottom"` or let it auto-detect.
|
|
8
8
|
* @param menuHeight - Expected menu height (px) used for the calculation.
|
|
9
9
|
*/
|
|
10
|
-
export declare function useDropdownPosition(containerRef: RefObject<HTMLElement>, isOpen: boolean, direction?: "top" | "bottom" | "auto", menuHeight?: number): "top" | "bottom";
|
|
10
|
+
export declare function useDropdownPosition(containerRef: RefObject<HTMLElement | null>, isOpen: boolean, direction?: "top" | "bottom" | "auto", menuHeight?: number): "top" | "bottom";
|
|
@@ -9,5 +9,5 @@ type Handler = (event: MouseEvent | TouchEvent) => void;
|
|
|
9
9
|
* @param handler - Called when an outside interaction happens.
|
|
10
10
|
* @param mouseEvent - Which mouse event to listen for (defaults to `"mousedown"`).
|
|
11
11
|
*/
|
|
12
|
-
export declare function useClickOutside<T extends HTMLElement = HTMLElement>(ref: RefObject<T>, handler: Handler, mouseEvent?: "mousedown" | "mouseup"): void;
|
|
12
|
+
export declare function useClickOutside<T extends HTMLElement = HTMLElement>(ref: RefObject<T | null>, handler: Handler, mouseEvent?: "mousedown" | "mouseup"): void;
|
|
13
13
|
export {};
|
|
@@ -7,4 +7,4 @@ import type { RefObject } from "react";
|
|
|
7
7
|
* @param direction - Force `"top"`/`"bottom"` or let it auto-detect.
|
|
8
8
|
* @param menuHeight - Expected menu height (px) used for the calculation.
|
|
9
9
|
*/
|
|
10
|
-
export declare function useDropdownPosition(containerRef: RefObject<HTMLElement>, isOpen: boolean, direction?: "top" | "bottom" | "auto", menuHeight?: number): "top" | "bottom";
|
|
10
|
+
export declare function useDropdownPosition(containerRef: RefObject<HTMLElement | null>, isOpen: boolean, direction?: "top" | "bottom" | "auto", menuHeight?: number): "top" | "bottom";
|
|
@@ -9,5 +9,5 @@ type Handler = (event: MouseEvent | TouchEvent) => void;
|
|
|
9
9
|
* @param handler - Called when an outside interaction happens.
|
|
10
10
|
* @param mouseEvent - Which mouse event to listen for (defaults to `"mousedown"`).
|
|
11
11
|
*/
|
|
12
|
-
export declare function useClickOutside<T extends HTMLElement = HTMLElement>(ref: RefObject<T>, handler: Handler, mouseEvent?: "mousedown" | "mouseup"): void;
|
|
12
|
+
export declare function useClickOutside<T extends HTMLElement = HTMLElement>(ref: RefObject<T | null>, handler: Handler, mouseEvent?: "mousedown" | "mouseup"): void;
|
|
13
13
|
export {};
|
|
@@ -7,4 +7,4 @@ import type { RefObject } from "react";
|
|
|
7
7
|
* @param direction - Force `"top"`/`"bottom"` or let it auto-detect.
|
|
8
8
|
* @param menuHeight - Expected menu height (px) used for the calculation.
|
|
9
9
|
*/
|
|
10
|
-
export declare function useDropdownPosition(containerRef: RefObject<HTMLElement>, isOpen: boolean, direction?: "top" | "bottom" | "auto", menuHeight?: number): "top" | "bottom";
|
|
10
|
+
export declare function useDropdownPosition(containerRef: RefObject<HTMLElement | null>, isOpen: boolean, direction?: "top" | "bottom" | "auto", menuHeight?: number): "top" | "bottom";
|
|
@@ -9,5 +9,5 @@ type Handler = (event: MouseEvent | TouchEvent) => void;
|
|
|
9
9
|
* @param handler - Called when an outside interaction happens.
|
|
10
10
|
* @param mouseEvent - Which mouse event to listen for (defaults to `"mousedown"`).
|
|
11
11
|
*/
|
|
12
|
-
export declare function useClickOutside<T extends HTMLElement = HTMLElement>(ref: RefObject<T>, handler: Handler, mouseEvent?: "mousedown" | "mouseup"): void;
|
|
12
|
+
export declare function useClickOutside<T extends HTMLElement = HTMLElement>(ref: RefObject<T | null>, handler: Handler, mouseEvent?: "mousedown" | "mouseup"): void;
|
|
13
13
|
export {};
|
|
@@ -7,4 +7,4 @@ import type { RefObject } from "react";
|
|
|
7
7
|
* @param direction - Force `"top"`/`"bottom"` or let it auto-detect.
|
|
8
8
|
* @param menuHeight - Expected menu height (px) used for the calculation.
|
|
9
9
|
*/
|
|
10
|
-
export declare function useDropdownPosition(containerRef: RefObject<HTMLElement>, isOpen: boolean, direction?: "top" | "bottom" | "auto", menuHeight?: number): "top" | "bottom";
|
|
10
|
+
export declare function useDropdownPosition(containerRef: RefObject<HTMLElement | null>, isOpen: boolean, direction?: "top" | "bottom" | "auto", menuHeight?: number): "top" | "bottom";
|
|
@@ -9,5 +9,5 @@ type Handler = (event: MouseEvent | TouchEvent) => void;
|
|
|
9
9
|
* @param handler - Called when an outside interaction happens.
|
|
10
10
|
* @param mouseEvent - Which mouse event to listen for (defaults to `"mousedown"`).
|
|
11
11
|
*/
|
|
12
|
-
export declare function useClickOutside<T extends HTMLElement = HTMLElement>(ref: RefObject<T>, handler: Handler, mouseEvent?: "mousedown" | "mouseup"): void;
|
|
12
|
+
export declare function useClickOutside<T extends HTMLElement = HTMLElement>(ref: RefObject<T | null>, handler: Handler, mouseEvent?: "mousedown" | "mouseup"): void;
|
|
13
13
|
export {};
|
|
@@ -7,4 +7,4 @@ import type { RefObject } from "react";
|
|
|
7
7
|
* @param direction - Force `"top"`/`"bottom"` or let it auto-detect.
|
|
8
8
|
* @param menuHeight - Expected menu height (px) used for the calculation.
|
|
9
9
|
*/
|
|
10
|
-
export declare function useDropdownPosition(containerRef: RefObject<HTMLElement>, isOpen: boolean, direction?: "top" | "bottom" | "auto", menuHeight?: number): "top" | "bottom";
|
|
10
|
+
export declare function useDropdownPosition(containerRef: RefObject<HTMLElement | null>, isOpen: boolean, direction?: "top" | "bottom" | "auto", menuHeight?: number): "top" | "bottom";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "h2o-library",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "A set of components for H2O Apps development",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"build-storybook": "storybook build"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
|
-
"react": "^18",
|
|
63
|
-
"react-dom": "^18"
|
|
62
|
+
"react": "^18 || ^19",
|
|
63
|
+
"react-dom": "^18 || ^19"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@rollup/plugin-commonjs": "^22.0.0",
|