@geneui/components 3.0.0-next-253ae89-07032025 → 3.0.0-next-d82ed4a-12032025

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.js CHANGED
@@ -7,7 +7,7 @@ export { default as Divider } from './Divider.js';
7
7
  export { default as Info } from './Info.js';
8
8
  export { default as Button } from './Button.js';
9
9
  export { default as Text } from './Text.js';
10
- export { P as Popover, a as PopoverBody, b as PopoverFooter, c as PopoverFooterActions, u as useScrollLock } from './index-24d8893c.js';
10
+ export { P as Popover, a as PopoverBody, b as PopoverFooter, c as PopoverFooterActions, u as useScrollLock } from './index-633639a4.js';
11
11
  export { default as Badge } from './Badge.js';
12
12
  export { default as Scrollbar } from './Scrollbar.js';
13
13
  export { Col, Grid, Row } from './Grid.js';
@@ -16,10 +16,10 @@ export { default as ProgressBar } from './ProgressBar.js';
16
16
  export { Step, Steps } from './Steps.js';
17
17
  export { default as Tag } from './Tag.js';
18
18
  export { Key, KeyValue, Value } from './KeyValue.js';
19
- export { GeneUIDesignSystemContext, default as GeneUIProvider } from './GeneUIProvider.js';
19
+ export { a as GeneUIDesignSystemContext, G as GeneUIProvider, u as useWindowSize } from './index-9d92561b.js';
20
20
  export { u as useDebounce } from './useDebounceCallback-999deae7.js';
21
- export { u as useEllipsisDetection } from './useEllipsisDetection-e545ae62.js';
22
- import { useState, useEffect, useMemo } from 'react';
21
+ export { u as useEllipsisDetection } from './useEllipsisDetection-5eab9668.js';
22
+ import { useMemo } from 'react';
23
23
  import './index-ce02421b.js';
24
24
  import './ArrowLeft-b88e2ba8.js';
25
25
  import './style-inject.es-746bb8ed.js';
@@ -31,22 +31,6 @@ import 'react-dom';
31
31
  import './Close-e8302008.js';
32
32
  import 'prop-types';
33
33
 
34
- const useWindowSize = () => {
35
- const [windowSize, setWindowSize] = useState({ width: 0, height: 0 });
36
- const handleSize = () => {
37
- setWindowSize({
38
- width: window.innerWidth,
39
- height: window.innerHeight
40
- });
41
- };
42
- useEffect(() => {
43
- handleSize();
44
- window.addEventListener("resize", handleSize);
45
- return () => window.removeEventListener("resize", handleSize);
46
- }, []);
47
- return windowSize;
48
- };
49
-
50
34
  // Map of OS detection patterns
51
35
  const osPatterns = [
52
36
  ["Windows", /\b(windows nt|win)\b/i],
@@ -62,6 +46,7 @@ const useDeviceInfo = () => {
62
46
  return {
63
47
  isMobile: false,
64
48
  isDesktop: false,
49
+ isTouch: false,
65
50
  os: "Unknown",
66
51
  isWindows: false,
67
52
  isMacOS: false,
@@ -80,9 +65,15 @@ const useDeviceInfo = () => {
80
65
  const isIOS = detectedOS === "iOS";
81
66
  const isMobile = isAndroid || isIOS;
82
67
  const isDesktop = isWindows || isMacOS || isLinux;
68
+ // Detect touch device
69
+ const isTouch = "ontouchstart" in window ||
70
+ navigator.maxTouchPoints > 0 ||
71
+ (window.matchMedia && window.matchMedia("(pointer: coarse)").matches) ||
72
+ false;
83
73
  return {
84
74
  isMobile,
85
75
  isDesktop,
76
+ isTouch,
86
77
  os: detectedOS,
87
78
  isWindows,
88
79
  isMacOS,
@@ -93,4 +84,4 @@ const useDeviceInfo = () => {
93
84
  }, []);
94
85
  };
95
86
 
96
- export { useDeviceInfo, useWindowSize };
87
+ export { useDeviceInfo };
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-253ae89-07032025",
4
+ "version": "3.0.0-next-d82ed4a-12032025",
5
5
  "author": "SoftConstruct",
6
6
  "homepage": "https://github.com/softconstruct/gene-ui-components#readme",
7
7
  "repository": {
package/types/index.d.ts CHANGED
@@ -1 +1,4 @@
1
- export type OS = "iOS" | "Android" | "Windows" | "macOS" | "Linux" | "Unknown";
1
+ export type OSTypes = "iOS" | "Android" | "Windows" | "macOS" | "Linux" | "Unknown";
2
+ export type DeviceTypes = "mobile" | "tablet" | "desktop";
3
+ export type ThemesTypes = "light" | "dark";
4
+ export type BreakpointsTypes = Record<DeviceTypes, number>;
@@ -0,0 +1,28 @@
1
+ import { useState, useEffect } from 'react';
2
+ import { u as useWindowSize } from './index-9d92561b.js';
3
+
4
+ const EQUAL_HEIGHT_DIFF = 3;
5
+ const useEllipsisDetection = (ref, externalDependencies = []) => {
6
+ var _a, _b, _c, _d;
7
+ const [isTruncated, setIsTruncated] = useState(false);
8
+ const { width } = useWindowSize();
9
+ const handleResize = () => {
10
+ if (!ref.current)
11
+ return;
12
+ const { scrollWidth, clientWidth, scrollHeight, clientHeight } = ref.current;
13
+ setIsTruncated(scrollWidth > clientWidth || scrollHeight > clientHeight + EQUAL_HEIGHT_DIFF);
14
+ };
15
+ useEffect(() => {
16
+ handleResize();
17
+ }, [
18
+ width,
19
+ ...externalDependencies,
20
+ (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.scrollWidth,
21
+ (_b = ref === null || ref === void 0 ? void 0 : ref.current) === null || _b === void 0 ? void 0 : _b.clientWidth,
22
+ (_c = ref === null || ref === void 0 ? void 0 : ref.current) === null || _c === void 0 ? void 0 : _c.scrollHeight,
23
+ (_d = ref === null || ref === void 0 ? void 0 : ref.current) === null || _d === void 0 ? void 0 : _d.clientHeight
24
+ ]);
25
+ return isTruncated;
26
+ };
27
+
28
+ export { useEllipsisDetection as u };
@@ -1,23 +0,0 @@
1
- import { useState, useEffect } from 'react';
2
- import { u as useDebouncedCallback } from './useDebounceCallback-999deae7.js';
3
-
4
- const EQUAL_HEIGHT_DIFF = 3;
5
- const useEllipsisDetection = (ref, externalDependencies = []) => {
6
- var _a, _b, _c, _d;
7
- const [isTruncated, setIsTruncated] = useState(false);
8
- const handleResize = () => {
9
- if (!ref.current)
10
- return;
11
- const { scrollWidth, clientWidth, scrollHeight, clientHeight } = ref.current;
12
- setIsTruncated(scrollWidth > clientWidth || scrollHeight > clientHeight + EQUAL_HEIGHT_DIFF);
13
- };
14
- useEffect(() => handleResize(), [...externalDependencies]);
15
- const { debouncedCallback } = useDebouncedCallback(handleResize, 100);
16
- useEffect(() => {
17
- window.addEventListener("resize", debouncedCallback);
18
- return () => window.removeEventListener("resize", debouncedCallback);
19
- }, [(_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.scrollWidth, (_b = ref === null || ref === void 0 ? void 0 : ref.current) === null || _b === void 0 ? void 0 : _b.clientWidth, (_c = ref === null || ref === void 0 ? void 0 : ref.current) === null || _c === void 0 ? void 0 : _c.scrollHeight, (_d = ref === null || ref === void 0 ? void 0 : ref.current) === null || _d === void 0 ? void 0 : _d.clientHeight]);
20
- return isTruncated;
21
- };
22
-
23
- export { useEllipsisDetection as u };