@mirai/ui 1.0.99 → 1.0.100
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.
|
@@ -30,11 +30,12 @@ exports[`component:<Modal> Mobile environment prop:onClose 1`] = `
|
|
|
30
30
|
xmlns="http://www.w3.org/2000/svg"
|
|
31
31
|
>
|
|
32
32
|
<path
|
|
33
|
-
d="
|
|
33
|
+
d="M24 24H0V0h24v24z"
|
|
34
34
|
fill="none"
|
|
35
|
+
opacity=".87"
|
|
35
36
|
/>
|
|
36
37
|
<path
|
|
37
|
-
d="
|
|
38
|
+
d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6-1.41-1.41z"
|
|
38
39
|
/>
|
|
39
40
|
</svg>
|
|
40
41
|
</span>
|
|
@@ -172,11 +173,12 @@ exports[`component:<Modal> prop:onClose 1`] = `
|
|
|
172
173
|
xmlns="http://www.w3.org/2000/svg"
|
|
173
174
|
>
|
|
174
175
|
<path
|
|
175
|
-
d="
|
|
176
|
+
d="M24 24H0V0h24v24z"
|
|
176
177
|
fill="none"
|
|
178
|
+
opacity=".87"
|
|
177
179
|
/>
|
|
178
180
|
<path
|
|
179
|
-
d="
|
|
181
|
+
d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6-1.41-1.41z"
|
|
180
182
|
/>
|
|
181
183
|
</svg>
|
|
182
184
|
</span>
|
package/build/hooks/useDevice.js
CHANGED
|
@@ -35,8 +35,10 @@ var useDevice = function useDevice() {
|
|
|
35
35
|
}, []);
|
|
36
36
|
return (0, _react.useMemo)(function () {
|
|
37
37
|
var _Theme$get = _theme.Theme.get(),
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
_Theme$get$breakpoint = _Theme$get.breakpointS,
|
|
39
|
+
breakpointS = _Theme$get$breakpoint === void 0 ? '430px' : _Theme$get$breakpoint,
|
|
40
|
+
_Theme$get$breakpoint2 = _Theme$get.breakpointM,
|
|
41
|
+
breakpointM = _Theme$get$breakpoint2 === void 0 ? '768px' : _Theme$get$breakpoint2;
|
|
40
42
|
var isLandscape = resolution.width >= resolution.height;
|
|
41
43
|
var isMobile = resolution.width <= (0, _helpers.sanitizePx)(breakpointS);
|
|
42
44
|
var isTablet = !isMobile && resolution.width <= (0, _helpers.sanitizePx)(breakpointM);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDevice.js","names":["useDevice","useState","getResolution","resolution","setResolution","useEffect","handleResize","window","addEventListener","removeEventListener","useMemo","Theme","get","breakpointS","breakpointM","isLandscape","width","height","isMobile","sanitizePx","isTablet","navigator","getNavigator","isPortrait","isDesktop"],"sources":["../../src/hooks/useDevice.js"],"sourcesContent":["import { useEffect, useMemo, useState } from 'react';\n\nimport { Theme } from '../theme';\nimport { getResolution, getNavigator, sanitizePx } from './helpers';\n\nexport const useDevice = () => {\n const [resolution, setResolution] = useState(getResolution());\n\n useEffect(() => {\n const handleResize = () => setResolution(getResolution());\n\n window.addEventListener('resize', handleResize);\n\n return () => window.removeEventListener('resize', handleResize);\n }, []);\n\n return useMemo(() => {\n const { breakpointS, breakpointM } = Theme.get();\n const isLandscape = resolution.width >= resolution.height;\n const isMobile = resolution.width <= sanitizePx(breakpointS);\n const isTablet = !isMobile && resolution.width <= sanitizePx(breakpointM);\n const navigator = getNavigator();\n\n return {\n ...resolution,\n ...navigator,\n isLandscape,\n isPortrait: !isLandscape,\n isMobile,\n isTablet,\n isDesktop: !isMobile && !isTablet,\n };\n }, [resolution]);\n};\n"],"mappings":";;;;;;;AAAA;AAEA;AACA;AAAoE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAE7D,IAAMA,SAAS,GAAG,SAAZA,SAAS,GAAS;EAC7B,gBAAoC,IAAAC,eAAQ,EAAC,IAAAC,sBAAa,GAAE,CAAC;IAAA;IAAtDC,UAAU;IAAEC,aAAa;EAEhC,IAAAC,gBAAS,EAAC,YAAM;IACd,IAAMC,YAAY,GAAG,SAAfA,YAAY;MAAA,OAASF,aAAa,CAAC,IAAAF,sBAAa,GAAE,CAAC;IAAA;IAEzDK,MAAM,CAACC,gBAAgB,CAAC,QAAQ,EAAEF,YAAY,CAAC;IAE/C,OAAO;MAAA,OAAMC,MAAM,CAACE,mBAAmB,CAAC,QAAQ,EAAEH,YAAY,CAAC;IAAA;EACjE,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO,IAAAI,cAAO,EAAC,YAAM;IACnB,
|
|
1
|
+
{"version":3,"file":"useDevice.js","names":["useDevice","useState","getResolution","resolution","setResolution","useEffect","handleResize","window","addEventListener","removeEventListener","useMemo","Theme","get","breakpointS","breakpointM","isLandscape","width","height","isMobile","sanitizePx","isTablet","navigator","getNavigator","isPortrait","isDesktop"],"sources":["../../src/hooks/useDevice.js"],"sourcesContent":["import { useEffect, useMemo, useState } from 'react';\n\nimport { Theme } from '../theme';\nimport { getResolution, getNavigator, sanitizePx } from './helpers';\n\nexport const useDevice = () => {\n const [resolution, setResolution] = useState(getResolution());\n\n useEffect(() => {\n const handleResize = () => setResolution(getResolution());\n\n window.addEventListener('resize', handleResize);\n\n return () => window.removeEventListener('resize', handleResize);\n }, []);\n\n return useMemo(() => {\n const { breakpointS = '430px', breakpointM = '768px' } = Theme.get();\n const isLandscape = resolution.width >= resolution.height;\n const isMobile = resolution.width <= sanitizePx(breakpointS);\n const isTablet = !isMobile && resolution.width <= sanitizePx(breakpointM);\n const navigator = getNavigator();\n\n return {\n ...resolution,\n ...navigator,\n isLandscape,\n isPortrait: !isLandscape,\n isMobile,\n isTablet,\n isDesktop: !isMobile && !isTablet,\n };\n }, [resolution]);\n};\n"],"mappings":";;;;;;;AAAA;AAEA;AACA;AAAoE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAE7D,IAAMA,SAAS,GAAG,SAAZA,SAAS,GAAS;EAC7B,gBAAoC,IAAAC,eAAQ,EAAC,IAAAC,sBAAa,GAAE,CAAC;I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