oddsgate-ds 1.0.88 → 1.0.91
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/.storybook/main.ts +2 -1
- package/build-storybook.log +2 -28
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -1
- package/package.json +3 -2
- package/src/components/atoms/Button/Button.theme.ts +1 -0
- package/src/components/organisms/CircularSlider/CircularSlider.theme.ts +1 -0
- package/src/helpers/isTouchDevice.tsx +30 -6
- package/src/styles/utilities.ts +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oddsgate-ds",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.91",
|
|
4
4
|
"description": "Miew theme component library",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@storybook/addon-essentials": "^8.1.5",
|
|
43
43
|
"@storybook/addon-interactions": "^8.1.5",
|
|
44
44
|
"@storybook/addon-links": "^8.1.5",
|
|
45
|
-
"@storybook/addon-styling": "^1.3.
|
|
45
|
+
"@storybook/addon-styling": "^1.3.7",
|
|
46
46
|
"@storybook/addon-webpack5-compiler-swc": "^1.0.3",
|
|
47
47
|
"@storybook/blocks": "^8.1.5",
|
|
48
48
|
"@storybook/react": "^8.1.5",
|
|
@@ -80,6 +80,7 @@
|
|
|
80
80
|
"dependencies": {
|
|
81
81
|
"@rollup/plugin-json": "^6.0.0",
|
|
82
82
|
"@rollup/plugin-url": "^8.0.1",
|
|
83
|
+
"@washingtonpost/storybook-addon-web-vitals": "^0.3.0",
|
|
83
84
|
"blaze-slider": "^1.9.3",
|
|
84
85
|
"classnames": "^2.3.2",
|
|
85
86
|
"formik": "^2.4.2",
|
|
@@ -1,11 +1,35 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from "react";
|
|
2
|
+
|
|
3
|
+
import { responsiveMedia } from "@/styles/variables";
|
|
4
|
+
|
|
1
5
|
const isTouchDevice = () => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const [dimensions, setDimensions] = useState({ width: 0, height: 0 });
|
|
7
|
+
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const observedElementRef = document.querySelector('body');
|
|
10
|
+
if (observedElementRef) {
|
|
11
|
+
const observer = new ResizeObserver((entries) => {
|
|
12
|
+
for (let entry of entries) {
|
|
13
|
+
setDimensions({
|
|
14
|
+
width: entry.contentRect.width,
|
|
15
|
+
height: entry.contentRect.height,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
observer.observe(observedElementRef);
|
|
21
|
+
|
|
22
|
+
// Cleanup function
|
|
23
|
+
return () => {
|
|
24
|
+
observer.disconnect();
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}, []);
|
|
28
|
+
|
|
29
|
+
console.log(dimensions);
|
|
30
|
+
return dimensions.width < parseInt(responsiveMedia);
|
|
8
31
|
}
|
|
9
32
|
|
|
10
33
|
|
|
34
|
+
|
|
11
35
|
export default isTouchDevice
|
package/src/styles/utilities.ts
CHANGED