stone-kit 0.0.1068 → 0.0.1069

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.
@@ -1,4 +1,4 @@
1
- export declare const useClientWidth: () => {
1
+ type UseClientWidth = {
2
2
  currentClientWidth: number;
3
3
  isMobile: boolean;
4
4
  isTablet: boolean;
@@ -6,3 +6,5 @@ export declare const useClientWidth: () => {
6
6
  isMobileBorder: boolean;
7
7
  isFullTablet: boolean;
8
8
  };
9
+ export declare const useClientWidth: () => UseClientWidth;
10
+ export {};
@@ -1,13 +1,22 @@
1
- import { useState as u, useCallback as c, useEffect as i } from "react";
1
+ import { useState as l, useCallback as w, useEffect as i } from "react";
2
2
  const a = () => {
3
- const [e, n] = u(0), t = c(() => {
3
+ const [e, n] = l(
4
+ typeof window < "u" ? window.innerWidth : 0
5
+ ), t = w(() => {
4
6
  n(window.innerWidth);
5
7
  }, [n]);
6
8
  i(() => (window.addEventListener("resize", t), () => window.removeEventListener("resize", t)), []), i(() => {
7
9
  t();
8
10
  }, []);
9
- const s = e < 1024, o = typeof window < "u" ? window.innerWidth < 768 : !1, r = e >= 768 && e < 1440, d = e > 1023 && e < 1440, l = e >= 1440;
10
- return { currentClientWidth: e, isMobile: s, isTablet: d, isDesktop: l, isMobileBorder: o, isFullTablet: r };
11
+ const o = e !== 0 && e < 1024, s = typeof window < "u" ? e !== 0 && e < 768 : !1, r = e >= 768 && e < 1440, d = e > 1023 && e < 1440, u = e >= 1440;
12
+ return {
13
+ currentClientWidth: e,
14
+ isMobile: o,
15
+ isTablet: d,
16
+ isDesktop: u,
17
+ isMobileBorder: s,
18
+ isFullTablet: r
19
+ };
11
20
  };
12
21
  export {
13
22
  a as useClientWidth
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "stone-kit",
3
3
  "description": "uikit for redesign",
4
4
  "private": false,
5
- "version": "0.0.1068",
5
+ "version": "0.0.1069",
6
6
  "author": "Mollycodd1e",
7
7
  "license": "ISC",
8
8
  "type": "module",