@sytechui/use-is-mobile 2.2.12

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Next UI Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # @sytechui/use-is-mobile
2
+
3
+ A Quick description of the component
4
+
5
+ > This is an internal utility, not intended for public usage.
6
+
7
+ ## Installation
8
+
9
+ ```sh
10
+ yarn add @sytechui/use-is-mobile
11
+ # or
12
+ npm i @sytechui/use-is-mobile
13
+ ```
14
+
15
+ ## Contribution
16
+
17
+ Yes please! See the
18
+ [contributing guidelines](https://github.com/heroui-inc/heroui/blob/master/CONTRIBUTING.md)
19
+ for details.
20
+
21
+ ## License
22
+
23
+ This project is licensed under the terms of the
24
+ [MIT license](https://github.com/heroui-inc/heroui/blob/master/LICENSE).
@@ -0,0 +1,3 @@
1
+ declare function useIsMobile(): boolean;
2
+
3
+ export { useIsMobile };
@@ -0,0 +1,3 @@
1
+ declare function useIsMobile(): boolean;
2
+
3
+ export { useIsMobile };
package/dist/index.js ADDED
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ useIsMobile: () => useIsMobile
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+ var import_ssr = require("@react-aria/ssr");
27
+ var MOBILE_SCREEN_WIDTH = 700;
28
+ function useIsMobile() {
29
+ let isSSR = (0, import_ssr.useIsSSR)();
30
+ if (isSSR || typeof window === "undefined") {
31
+ return false;
32
+ }
33
+ return window.screen.width <= MOBILE_SCREEN_WIDTH;
34
+ }
35
+ // Annotate the CommonJS export names for ESM import in node:
36
+ 0 && (module.exports = {
37
+ useIsMobile
38
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,13 @@
1
+ // src/index.ts
2
+ import { useIsSSR } from "@react-aria/ssr";
3
+ var MOBILE_SCREEN_WIDTH = 700;
4
+ function useIsMobile() {
5
+ let isSSR = useIsSSR();
6
+ if (isSSR || typeof window === "undefined") {
7
+ return false;
8
+ }
9
+ return window.screen.width <= MOBILE_SCREEN_WIDTH;
10
+ }
11
+ export {
12
+ useIsMobile
13
+ };
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@sytechui/use-is-mobile",
3
+ "version": "2.2.12",
4
+ "description": "A hook that returns whether the device is mobile or not",
5
+ "keywords": [
6
+ "use-is-mobile"
7
+ ],
8
+ "author": "HeroUI <support@heroui.com>",
9
+ "homepage": "https://heroui.com",
10
+ "license": "MIT",
11
+ "main": "dist/index.js",
12
+ "sideEffects": false,
13
+ "files": [
14
+ "dist"
15
+ ],
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/heroui-inc/heroui.git",
22
+ "directory": "packages/hooks/use-is-mobile"
23
+ },
24
+ "bugs": {
25
+ "url": "https://github.com/heroui-inc/heroui/issues"
26
+ },
27
+ "dependencies": {
28
+ "@react-aria/ssr": "3.9.10"
29
+ },
30
+ "peerDependencies": {
31
+ "react": ">=18 || >=19.0.0-rc.0"
32
+ },
33
+ "clean-package": "../../../clean-package.config.json",
34
+ "tsup": {
35
+ "clean": true,
36
+ "target": "es2019",
37
+ "format": [
38
+ "cjs",
39
+ "esm"
40
+ ]
41
+ },
42
+ "module": "dist/index.mjs",
43
+ "types": "dist/index.d.ts",
44
+ "exports": {
45
+ ".": {
46
+ "types": "./dist/index.d.ts",
47
+ "import": "./dist/index.mjs",
48
+ "require": "./dist/index.js"
49
+ },
50
+ "./package.json": "./package.json"
51
+ },
52
+ "scripts": {
53
+ "build": "tsup src --dts",
54
+ "build:fast": "tsup src",
55
+ "dev": "pnpm build:fast --watch",
56
+ "clean": "rimraf dist .turbo",
57
+ "typecheck": "tsc --noEmit"
58
+ }
59
+ }