@react-spectrum/utils 3.0.0-nightly.2843 → 3.0.0-nightly.2848
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/dist/BreakpointProvider.main.js +75 -0
- package/dist/BreakpointProvider.main.js.map +1 -0
- package/dist/BreakpointProvider.mjs +64 -0
- package/dist/BreakpointProvider.module.js +64 -0
- package/dist/BreakpointProvider.module.js.map +1 -0
- package/dist/Slots.main.js +73 -0
- package/dist/Slots.main.js.map +1 -0
- package/dist/Slots.mjs +61 -0
- package/dist/Slots.module.js +61 -0
- package/dist/Slots.module.js.map +1 -0
- package/dist/classNames.main.js +50 -0
- package/dist/classNames.main.js.map +1 -0
- package/dist/classNames.mjs +39 -0
- package/dist/classNames.module.js +39 -0
- package/dist/classNames.module.js.map +1 -0
- package/dist/getWrappedElement.main.js +32 -0
- package/dist/getWrappedElement.main.js.map +1 -0
- package/dist/getWrappedElement.mjs +23 -0
- package/dist/getWrappedElement.module.js +23 -0
- package/dist/getWrappedElement.module.js.map +1 -0
- package/dist/import.mjs +10 -746
- package/dist/main.js +37 -777
- package/dist/main.js.map +1 -1
- package/dist/module.js +10 -746
- package/dist/module.js.map +1 -1
- package/dist/styleProps.main.js +468 -0
- package/dist/styleProps.main.js.map +1 -0
- package/dist/styleProps.mjs +456 -0
- package/dist/styleProps.module.js +456 -0
- package/dist/styleProps.module.js.map +1 -0
- package/dist/useDOMRef.main.js +64 -0
- package/dist/useDOMRef.main.js.map +1 -0
- package/dist/useDOMRef.mjs +54 -0
- package/dist/useDOMRef.module.js +54 -0
- package/dist/useDOMRef.module.js.map +1 -0
- package/dist/useHasChild.main.js +35 -0
- package/dist/useHasChild.main.js.map +1 -0
- package/dist/useHasChild.mjs +30 -0
- package/dist/useHasChild.module.js +30 -0
- package/dist/useHasChild.module.js.map +1 -0
- package/dist/useIsMobileDevice.main.js +28 -0
- package/dist/useIsMobileDevice.main.js.map +1 -0
- package/dist/useIsMobileDevice.mjs +23 -0
- package/dist/useIsMobileDevice.module.js +23 -0
- package/dist/useIsMobileDevice.module.js.map +1 -0
- package/dist/useMediaQuery.main.js +46 -0
- package/dist/useMediaQuery.main.js.map +1 -0
- package/dist/useMediaQuery.mjs +41 -0
- package/dist/useMediaQuery.module.js +41 -0
- package/dist/useMediaQuery.module.js.map +1 -0
- package/package.json +6 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAKM,SAAS,0CAAkD,GAAiB;IACjF,OAAO;QACL;YACE,OAAO,IAAI,OAAO;QACpB;IACF;AACF;AAEO,SAAS,0CAAwD,MAAoB,EAAE,eAA4C,MAAM;IAC9I,OAAO;QACL,GAAG,0CAAa,OAAO;QACvB;YACE,IAAI,aAAa,OAAO,EACtB,aAAa,OAAO,CAAC,KAAK;QAE9B;IACF;AACF;AAEO,SAAS,0CAA+C,GAAc;IAC3E,IAAI,SAAS,CAAA,GAAA,aAAK,EAAK;IACvB,CAAA,GAAA,0BAAkB,EAAE,KAAK,IAAM,0CAAa;IAC5C,OAAO;AACT;AAEO,SAAS,0CAAqD,GAAoB,EAAE,YAA0C;IACnI,IAAI,SAAS,CAAA,GAAA,aAAK,EAAK;IACvB,CAAA,GAAA,0BAAkB,EAAE,KAAK,IAAM,0CAAmB,QAAQ;IAC1D,OAAO;AACT;AAEO,SAAS,0CAAoC,GAA8B;IAChF,OAAO;QACL,IAAI,WAAU;YACZ,OAAO,IAAI,OAAO,IAAI,IAAI,OAAO,CAAC,iBAAiB;QACrD;IACF;AACF;AAEO,SAAS,0CAAuC,GAA8B;IACnF,OAAO,CAAA,GAAA,cAAM,EAAE,IAAM,0CAAa,MAAM;QAAC;KAAI;AAC/C","sources":["packages/@react-spectrum/utils/src/useDOMRef.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMRef, DOMRefValue, FocusableElement, FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {RefObject, useImperativeHandle, useMemo, useRef} from 'react';\n\nexport function createDOMRef<T extends HTMLElement = HTMLElement>(ref: RefObject<T>): DOMRefValue<T> {\n return {\n UNSAFE_getDOMNode() {\n return ref.current;\n }\n };\n}\n\nexport function createFocusableRef<T extends HTMLElement = HTMLElement>(domRef: RefObject<T>, focusableRef: RefObject<FocusableElement> = domRef): FocusableRefValue<T> {\n return {\n ...createDOMRef(domRef),\n focus() {\n if (focusableRef.current) {\n focusableRef.current.focus();\n }\n }\n };\n}\n\nexport function useDOMRef<T extends HTMLElement = HTMLElement>(ref: DOMRef<T>): RefObject<T> {\n let domRef = useRef<T>(null);\n useImperativeHandle(ref, () => createDOMRef(domRef));\n return domRef;\n}\n\nexport function useFocusableRef<T extends HTMLElement = HTMLElement>(ref: FocusableRef<T>, focusableRef?: RefObject<FocusableElement>): RefObject<T> {\n let domRef = useRef<T>(null);\n useImperativeHandle(ref, () => createFocusableRef(domRef, focusableRef));\n return domRef;\n}\n\nexport function unwrapDOMRef<T extends HTMLElement>(ref: RefObject<DOMRefValue<T>>): RefObject<T> {\n return {\n get current() {\n return ref.current && ref.current.UNSAFE_getDOMNode();\n }\n };\n}\n\nexport function useUnwrapDOMRef<T extends HTMLElement>(ref: RefObject<DOMRefValue<T>>) : RefObject<T> {\n return useMemo(() => unwrapDOMRef(ref), [ref]);\n}\n"],"names":[],"version":3,"file":"useDOMRef.module.js.map"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var $egdoP$react = require("react");
|
|
2
|
+
var $egdoP$reactariautils = require("@react-aria/utils");
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
function $parcel$export(e, n, v, s) {
|
|
6
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
$parcel$export(module.exports, "useHasChild", () => $67043c48a01bef79$export$e52e2242b6d0f1d4);
|
|
10
|
+
/*
|
|
11
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
12
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
13
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
14
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
*
|
|
16
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
17
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
18
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
19
|
+
* governing permissions and limitations under the License.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
function $67043c48a01bef79$export$e52e2242b6d0f1d4(query, ref) {
|
|
23
|
+
let [hasChild, setHasChild] = (0, $egdoP$react.useState)(true);
|
|
24
|
+
(0, $egdoP$reactariautils.useLayoutEffect)(()=>{
|
|
25
|
+
setHasChild(!!(ref.current && ref.current.querySelector(query)));
|
|
26
|
+
}, [
|
|
27
|
+
setHasChild,
|
|
28
|
+
query,
|
|
29
|
+
ref
|
|
30
|
+
]);
|
|
31
|
+
return hasChild;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=useHasChild.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAKM,SAAS,0CAAY,KAAa,EAAE,GAA2B;IACpE,IAAI,CAAC,UAAU,YAAY,GAAG,CAAA,GAAA,qBAAO,EAAE;IACvC,CAAA,GAAA,qCAAc,EAAE;QACd,YAAY,CAAC,CAAE,CAAA,IAAI,OAAO,IAAI,IAAI,OAAO,CAAC,aAAa,CAAC,MAAK;IAC/D,GAAG;QAAC;QAAa;QAAO;KAAI;IAC5B,OAAO;AACT","sources":["packages/@react-spectrum/utils/src/useHasChild.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {RefObject, useState} from 'react';\nimport {useLayoutEffect} from '@react-aria/utils';\n\nexport function useHasChild(query: string, ref: RefObject<HTMLElement>) {\n let [hasChild, setHasChild] = useState(true);\n useLayoutEffect(() => {\n setHasChild(!!(ref.current && ref.current.querySelector(query)));\n }, [setHasChild, query, ref]);\n return hasChild;\n}\n"],"names":[],"version":3,"file":"useHasChild.main.js.map"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {useState as $iRbeG$useState} from "react";
|
|
2
|
+
import {useLayoutEffect as $iRbeG$useLayoutEffect} from "@react-aria/utils";
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
6
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
8
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
+
* governing permissions and limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
function $54cda195bd4173fb$export$e52e2242b6d0f1d4(query, ref) {
|
|
17
|
+
let [hasChild, setHasChild] = (0, $iRbeG$useState)(true);
|
|
18
|
+
(0, $iRbeG$useLayoutEffect)(()=>{
|
|
19
|
+
setHasChild(!!(ref.current && ref.current.querySelector(query)));
|
|
20
|
+
}, [
|
|
21
|
+
setHasChild,
|
|
22
|
+
query,
|
|
23
|
+
ref
|
|
24
|
+
]);
|
|
25
|
+
return hasChild;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
export {$54cda195bd4173fb$export$e52e2242b6d0f1d4 as useHasChild};
|
|
30
|
+
//# sourceMappingURL=useHasChild.mjs.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {useState as $iRbeG$useState} from "react";
|
|
2
|
+
import {useLayoutEffect as $iRbeG$useLayoutEffect} from "@react-aria/utils";
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
6
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
8
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
+
* governing permissions and limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
function $54cda195bd4173fb$export$e52e2242b6d0f1d4(query, ref) {
|
|
17
|
+
let [hasChild, setHasChild] = (0, $iRbeG$useState)(true);
|
|
18
|
+
(0, $iRbeG$useLayoutEffect)(()=>{
|
|
19
|
+
setHasChild(!!(ref.current && ref.current.querySelector(query)));
|
|
20
|
+
}, [
|
|
21
|
+
setHasChild,
|
|
22
|
+
query,
|
|
23
|
+
ref
|
|
24
|
+
]);
|
|
25
|
+
return hasChild;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
export {$54cda195bd4173fb$export$e52e2242b6d0f1d4 as useHasChild};
|
|
30
|
+
//# sourceMappingURL=useHasChild.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAKM,SAAS,0CAAY,KAAa,EAAE,GAA2B;IACpE,IAAI,CAAC,UAAU,YAAY,GAAG,CAAA,GAAA,eAAO,EAAE;IACvC,CAAA,GAAA,sBAAc,EAAE;QACd,YAAY,CAAC,CAAE,CAAA,IAAI,OAAO,IAAI,IAAI,OAAO,CAAC,aAAa,CAAC,MAAK;IAC/D,GAAG;QAAC;QAAa;QAAO;KAAI;IAC5B,OAAO;AACT","sources":["packages/@react-spectrum/utils/src/useHasChild.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {RefObject, useState} from 'react';\nimport {useLayoutEffect} from '@react-aria/utils';\n\nexport function useHasChild(query: string, ref: RefObject<HTMLElement>) {\n let [hasChild, setHasChild] = useState(true);\n useLayoutEffect(() => {\n setHasChild(!!(ref.current && ref.current.querySelector(query)));\n }, [setHasChild, query, ref]);\n return hasChild;\n}\n"],"names":[],"version":3,"file":"useHasChild.module.js.map"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var $fkNaJ$reactariassr = require("@react-aria/ssr");
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
function $parcel$export(e, n, v, s) {
|
|
5
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
$parcel$export(module.exports, "useIsMobileDevice", () => $e9c08f6fb6c823d1$export$736bf165441b18c7);
|
|
9
|
+
/*
|
|
10
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
11
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
13
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
16
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
17
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
18
|
+
* governing permissions and limitations under the License.
|
|
19
|
+
*/
|
|
20
|
+
const $e9c08f6fb6c823d1$var$MOBILE_SCREEN_WIDTH = 700;
|
|
21
|
+
function $e9c08f6fb6c823d1$export$736bf165441b18c7() {
|
|
22
|
+
let isSSR = (0, $fkNaJ$reactariassr.useIsSSR)();
|
|
23
|
+
if (isSSR || typeof window === "undefined") return false;
|
|
24
|
+
return window.screen.width <= $e9c08f6fb6c823d1$var$MOBILE_SCREEN_WIDTH;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=useIsMobileDevice.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAID,MAAM,4CAAsB;AAErB,SAAS;IACd,IAAI,QAAQ,CAAA,GAAA,4BAAO;IACnB,IAAI,SAAS,OAAO,WAAW,aAC7B,OAAO;IAGT,OAAO,OAAO,MAAM,CAAC,KAAK,IAAI;AAChC","sources":["packages/@react-spectrum/utils/src/useIsMobileDevice.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useIsSSR} from '@react-aria/ssr';\n\nconst MOBILE_SCREEN_WIDTH = 700;\n\nexport function useIsMobileDevice(): boolean {\n let isSSR = useIsSSR();\n if (isSSR || typeof window === 'undefined') {\n return false;\n }\n\n return window.screen.width <= MOBILE_SCREEN_WIDTH;\n}\n"],"names":[],"version":3,"file":"useIsMobileDevice.main.js.map"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {useIsSSR as $hET1I$useIsSSR} from "@react-aria/ssr";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
5
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
7
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
10
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
11
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
12
|
+
* governing permissions and limitations under the License.
|
|
13
|
+
*/
|
|
14
|
+
const $fdbe26a36ce1c672$var$MOBILE_SCREEN_WIDTH = 700;
|
|
15
|
+
function $fdbe26a36ce1c672$export$736bf165441b18c7() {
|
|
16
|
+
let isSSR = (0, $hET1I$useIsSSR)();
|
|
17
|
+
if (isSSR || typeof window === "undefined") return false;
|
|
18
|
+
return window.screen.width <= $fdbe26a36ce1c672$var$MOBILE_SCREEN_WIDTH;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
export {$fdbe26a36ce1c672$export$736bf165441b18c7 as useIsMobileDevice};
|
|
23
|
+
//# sourceMappingURL=useIsMobileDevice.mjs.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {useIsSSR as $hET1I$useIsSSR} from "@react-aria/ssr";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
5
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
7
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
10
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
11
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
12
|
+
* governing permissions and limitations under the License.
|
|
13
|
+
*/
|
|
14
|
+
const $fdbe26a36ce1c672$var$MOBILE_SCREEN_WIDTH = 700;
|
|
15
|
+
function $fdbe26a36ce1c672$export$736bf165441b18c7() {
|
|
16
|
+
let isSSR = (0, $hET1I$useIsSSR)();
|
|
17
|
+
if (isSSR || typeof window === "undefined") return false;
|
|
18
|
+
return window.screen.width <= $fdbe26a36ce1c672$var$MOBILE_SCREEN_WIDTH;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
export {$fdbe26a36ce1c672$export$736bf165441b18c7 as useIsMobileDevice};
|
|
23
|
+
//# sourceMappingURL=useIsMobileDevice.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAID,MAAM,4CAAsB;AAErB,SAAS;IACd,IAAI,QAAQ,CAAA,GAAA,eAAO;IACnB,IAAI,SAAS,OAAO,WAAW,aAC7B,OAAO;IAGT,OAAO,OAAO,MAAM,CAAC,KAAK,IAAI;AAChC","sources":["packages/@react-spectrum/utils/src/useIsMobileDevice.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useIsSSR} from '@react-aria/ssr';\n\nconst MOBILE_SCREEN_WIDTH = 700;\n\nexport function useIsMobileDevice(): boolean {\n let isSSR = useIsSSR();\n if (isSSR || typeof window === 'undefined') {\n return false;\n }\n\n return window.screen.width <= MOBILE_SCREEN_WIDTH;\n}\n"],"names":[],"version":3,"file":"useIsMobileDevice.module.js.map"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var $6azN1$react = require("react");
|
|
2
|
+
var $6azN1$reactariassr = require("@react-aria/ssr");
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
function $parcel$export(e, n, v, s) {
|
|
6
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
$parcel$export(module.exports, "useMediaQuery", () => $471052aafc9c8aac$export$32d5543ab307c01);
|
|
10
|
+
/*
|
|
11
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
12
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
13
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
14
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
*
|
|
16
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
17
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
18
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
19
|
+
* governing permissions and limitations under the License.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
function $471052aafc9c8aac$export$32d5543ab307c01(query) {
|
|
23
|
+
let supportsMatchMedia = typeof window !== "undefined" && typeof window.matchMedia === "function";
|
|
24
|
+
let [matches, setMatches] = (0, $6azN1$react.useState)(()=>supportsMatchMedia ? window.matchMedia(query).matches : false);
|
|
25
|
+
(0, $6azN1$react.useEffect)(()=>{
|
|
26
|
+
if (!supportsMatchMedia) return;
|
|
27
|
+
let mq = window.matchMedia(query);
|
|
28
|
+
let onChange = (evt)=>{
|
|
29
|
+
setMatches(evt.matches);
|
|
30
|
+
};
|
|
31
|
+
mq.addListener(onChange);
|
|
32
|
+
return ()=>{
|
|
33
|
+
mq.removeListener(onChange);
|
|
34
|
+
};
|
|
35
|
+
}, [
|
|
36
|
+
supportsMatchMedia,
|
|
37
|
+
query
|
|
38
|
+
]);
|
|
39
|
+
// If in SSR, the media query should never match. Once the page hydrates,
|
|
40
|
+
// this will update and the real value will be returned.
|
|
41
|
+
let isSSR = (0, $6azN1$reactariassr.useIsSSR)();
|
|
42
|
+
return isSSR ? false : matches;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=useMediaQuery.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAKM,SAAS,yCAAc,KAAa;IACzC,IAAI,qBAAqB,OAAO,WAAW,eAAe,OAAO,OAAO,UAAU,KAAK;IACvF,IAAI,CAAC,SAAS,WAAW,GAAG,CAAA,GAAA,qBAAO,EAAE,IACnC,qBACI,OAAO,UAAU,CAAC,OAAO,OAAO,GAChC;IAGN,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,CAAC,oBACH;QAGF,IAAI,KAAK,OAAO,UAAU,CAAC;QAC3B,IAAI,WAAW,CAAC;YACd,WAAW,IAAI,OAAO;QACxB;QAEA,GAAG,WAAW,CAAC;QACf,OAAO;YACL,GAAG,cAAc,CAAC;QACpB;IACF,GAAG;QAAC;QAAoB;KAAM;IAE9B,yEAAyE;IACzE,wDAAwD;IACxD,IAAI,QAAQ,CAAA,GAAA,4BAAO;IACnB,OAAO,QAAQ,QAAQ;AACzB","sources":["packages/@react-spectrum/utils/src/useMediaQuery.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useEffect, useState} from 'react';\nimport {useIsSSR} from '@react-aria/ssr';\n\nexport function useMediaQuery(query: string) {\n let supportsMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia === 'function';\n let [matches, setMatches] = useState(() =>\n supportsMatchMedia\n ? window.matchMedia(query).matches\n : false\n );\n\n useEffect(() => {\n if (!supportsMatchMedia) {\n return;\n }\n\n let mq = window.matchMedia(query);\n let onChange = (evt) => {\n setMatches(evt.matches);\n };\n\n mq.addListener(onChange);\n return () => {\n mq.removeListener(onChange);\n };\n }, [supportsMatchMedia, query]);\n\n // If in SSR, the media query should never match. Once the page hydrates,\n // this will update and the real value will be returned.\n let isSSR = useIsSSR();\n return isSSR ? false : matches;\n}\n"],"names":[],"version":3,"file":"useMediaQuery.main.js.map"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {useState as $8zXGn$useState, useEffect as $8zXGn$useEffect} from "react";
|
|
2
|
+
import {useIsSSR as $8zXGn$useIsSSR} from "@react-aria/ssr";
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
6
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
8
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
+
* governing permissions and limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
function $3df547e395c4522f$export$32d5543ab307c01(query) {
|
|
17
|
+
let supportsMatchMedia = typeof window !== "undefined" && typeof window.matchMedia === "function";
|
|
18
|
+
let [matches, setMatches] = (0, $8zXGn$useState)(()=>supportsMatchMedia ? window.matchMedia(query).matches : false);
|
|
19
|
+
(0, $8zXGn$useEffect)(()=>{
|
|
20
|
+
if (!supportsMatchMedia) return;
|
|
21
|
+
let mq = window.matchMedia(query);
|
|
22
|
+
let onChange = (evt)=>{
|
|
23
|
+
setMatches(evt.matches);
|
|
24
|
+
};
|
|
25
|
+
mq.addListener(onChange);
|
|
26
|
+
return ()=>{
|
|
27
|
+
mq.removeListener(onChange);
|
|
28
|
+
};
|
|
29
|
+
}, [
|
|
30
|
+
supportsMatchMedia,
|
|
31
|
+
query
|
|
32
|
+
]);
|
|
33
|
+
// If in SSR, the media query should never match. Once the page hydrates,
|
|
34
|
+
// this will update and the real value will be returned.
|
|
35
|
+
let isSSR = (0, $8zXGn$useIsSSR)();
|
|
36
|
+
return isSSR ? false : matches;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
export {$3df547e395c4522f$export$32d5543ab307c01 as useMediaQuery};
|
|
41
|
+
//# sourceMappingURL=useMediaQuery.mjs.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {useState as $8zXGn$useState, useEffect as $8zXGn$useEffect} from "react";
|
|
2
|
+
import {useIsSSR as $8zXGn$useIsSSR} from "@react-aria/ssr";
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
6
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
8
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
11
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
12
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
|
+
* governing permissions and limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
function $3df547e395c4522f$export$32d5543ab307c01(query) {
|
|
17
|
+
let supportsMatchMedia = typeof window !== "undefined" && typeof window.matchMedia === "function";
|
|
18
|
+
let [matches, setMatches] = (0, $8zXGn$useState)(()=>supportsMatchMedia ? window.matchMedia(query).matches : false);
|
|
19
|
+
(0, $8zXGn$useEffect)(()=>{
|
|
20
|
+
if (!supportsMatchMedia) return;
|
|
21
|
+
let mq = window.matchMedia(query);
|
|
22
|
+
let onChange = (evt)=>{
|
|
23
|
+
setMatches(evt.matches);
|
|
24
|
+
};
|
|
25
|
+
mq.addListener(onChange);
|
|
26
|
+
return ()=>{
|
|
27
|
+
mq.removeListener(onChange);
|
|
28
|
+
};
|
|
29
|
+
}, [
|
|
30
|
+
supportsMatchMedia,
|
|
31
|
+
query
|
|
32
|
+
]);
|
|
33
|
+
// If in SSR, the media query should never match. Once the page hydrates,
|
|
34
|
+
// this will update and the real value will be returned.
|
|
35
|
+
let isSSR = (0, $8zXGn$useIsSSR)();
|
|
36
|
+
return isSSR ? false : matches;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
export {$3df547e395c4522f$export$32d5543ab307c01 as useMediaQuery};
|
|
41
|
+
//# sourceMappingURL=useMediaQuery.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAKM,SAAS,yCAAc,KAAa;IACzC,IAAI,qBAAqB,OAAO,WAAW,eAAe,OAAO,OAAO,UAAU,KAAK;IACvF,IAAI,CAAC,SAAS,WAAW,GAAG,CAAA,GAAA,eAAO,EAAE,IACnC,qBACI,OAAO,UAAU,CAAC,OAAO,OAAO,GAChC;IAGN,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,CAAC,oBACH;QAGF,IAAI,KAAK,OAAO,UAAU,CAAC;QAC3B,IAAI,WAAW,CAAC;YACd,WAAW,IAAI,OAAO;QACxB;QAEA,GAAG,WAAW,CAAC;QACf,OAAO;YACL,GAAG,cAAc,CAAC;QACpB;IACF,GAAG;QAAC;QAAoB;KAAM;IAE9B,yEAAyE;IACzE,wDAAwD;IACxD,IAAI,QAAQ,CAAA,GAAA,eAAO;IACnB,OAAO,QAAQ,QAAQ;AACzB","sources":["packages/@react-spectrum/utils/src/useMediaQuery.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useEffect, useState} from 'react';\nimport {useIsSSR} from '@react-aria/ssr';\n\nexport function useMediaQuery(query: string) {\n let supportsMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia === 'function';\n let [matches, setMatches] = useState(() =>\n supportsMatchMedia\n ? window.matchMedia(query).matches\n : false\n );\n\n useEffect(() => {\n if (!supportsMatchMedia) {\n return;\n }\n\n let mq = window.matchMedia(query);\n let onChange = (evt) => {\n setMatches(evt.matches);\n };\n\n mq.addListener(onChange);\n return () => {\n mq.removeListener(onChange);\n };\n }, [supportsMatchMedia, query]);\n\n // If in SSR, the media query should never match. Once the page hydrates,\n // this will update and the real value will be returned.\n let isSSR = useIsSSR();\n return isSSR ? false : matches;\n}\n"],"names":[],"version":3,"file":"useMediaQuery.module.js.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/utils",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.2848+72775d272",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"url": "https://github.com/adobe/react-spectrum"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@react-aria/i18n": "3.0.0-nightly.
|
|
28
|
-
"@react-aria/ssr": "3.9.3-nightly.
|
|
29
|
-
"@react-aria/utils": "3.0.0-nightly.
|
|
30
|
-
"@react-types/shared": "3.0.0-nightly.
|
|
27
|
+
"@react-aria/i18n": "3.0.0-nightly.2848+72775d272",
|
|
28
|
+
"@react-aria/ssr": "3.9.3-nightly.4560+72775d272",
|
|
29
|
+
"@react-aria/utils": "3.0.0-nightly.2848+72775d272",
|
|
30
|
+
"@react-types/shared": "3.0.0-nightly.2848+72775d272",
|
|
31
31
|
"@swc/helpers": "^0.5.0",
|
|
32
32
|
"clsx": "^2.0.0"
|
|
33
33
|
},
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "72775d272be04cfa32d26ec821bc68513d92a72b"
|
|
41
41
|
}
|