@geneui/components 3.0.0-next-bc174f3-11022025 → 3.0.0-next-b458115-12022025
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/hooks/index.d.ts +1 -0
- package/hooks/useWindowSize/index.d.ts +1 -0
- package/hooks/useWindowSize/useWindowSize.d.ts +5 -0
- package/index.d.ts +1 -0
- package/index.js +19 -1
- package/package.json +1 -1
package/hooks/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./useWindowSize";
|
package/index.d.ts
CHANGED
|
@@ -15,3 +15,4 @@ export { default as Tag, ITagProps } from "./components/molecules/Tag";
|
|
|
15
15
|
export { default as GeneUIProvider, GeneUIDesignSystemContext, IGeneUIDesignSystemContext, IGeneUIProviderProps } from "./components/providers/GeneUIProvider";
|
|
16
16
|
export { default as useDebounce } from "./hooks/useDebounceCallback";
|
|
17
17
|
export { default as useEllipsisDetection } from "./hooks/useEllipsisDetection";
|
|
18
|
+
export { default as useWindowSize } from "./hooks/useWindowSize";
|
package/index.js
CHANGED
|
@@ -15,10 +15,28 @@ export { default as Tag } from './Tag.js';
|
|
|
15
15
|
export { GeneUIDesignSystemContext, default as GeneUIProvider } from './GeneUIProvider.js';
|
|
16
16
|
export { u as useDebounce } from './useDebounceCallback-999deae7.js';
|
|
17
17
|
export { u as useEllipsisDetection } from './useEllipsisDetection-e545ae62.js';
|
|
18
|
-
import 'react';
|
|
18
|
+
import { useState, useEffect } from 'react';
|
|
19
19
|
import './index-ce02421b.js';
|
|
20
20
|
import './ArrowLeft-b88e2ba8.js';
|
|
21
21
|
import './style-inject.es-746bb8ed.js';
|
|
22
22
|
import './WarningFill-fb50593e.js';
|
|
23
23
|
import 'prop-types';
|
|
24
24
|
import 'react-dom';
|
|
25
|
+
|
|
26
|
+
const useWindowSize = () => {
|
|
27
|
+
const [windowSize, setWindowSize] = useState({ width: 0, height: 0 });
|
|
28
|
+
const handleSize = () => {
|
|
29
|
+
setWindowSize({
|
|
30
|
+
width: window.innerWidth,
|
|
31
|
+
height: window.innerHeight
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
handleSize();
|
|
36
|
+
window.addEventListener("resize", handleSize);
|
|
37
|
+
return () => window.removeEventListener("resize", handleSize);
|
|
38
|
+
}, []);
|
|
39
|
+
return windowSize;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export { useWindowSize };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geneui/components",
|
|
3
3
|
"description": "The Gene UI components library designed for BI tools",
|
|
4
|
-
"version": "3.0.0-next-
|
|
4
|
+
"version": "3.0.0-next-b458115-12022025",
|
|
5
5
|
"author": "SoftConstruct",
|
|
6
6
|
"homepage": "https://github.com/softconstruct/gene-ui-components#readme",
|
|
7
7
|
"repository": {
|