@react-spectrum/utils 3.0.0-nightly.2911 → 3.0.0-nightly.2917
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 +7 -7
- package/dist/BreakpointProvider.mjs +7 -7
- package/dist/BreakpointProvider.module.js +7 -7
- package/dist/Slots.main.js +1 -1
- package/dist/Slots.mjs +1 -1
- package/dist/Slots.module.js +1 -1
- package/dist/classNames.main.js +2 -2
- package/dist/classNames.mjs +2 -2
- package/dist/classNames.module.js +2 -2
- package/dist/getWrappedElement.main.js +1 -1
- package/dist/getWrappedElement.mjs +1 -1
- package/dist/getWrappedElement.module.js +1 -1
- package/dist/styleProps.main.js +103 -103
- package/dist/styleProps.mjs +103 -103
- package/dist/styleProps.module.js +103 -103
- package/dist/useIsMobileDevice.main.js +1 -1
- package/dist/useIsMobileDevice.mjs +1 -1
- package/dist/useIsMobileDevice.module.js +1 -1
- package/dist/useMediaQuery.main.js +1 -1
- package/dist/useMediaQuery.mjs +1 -1
- package/dist/useMediaQuery.module.js +1 -1
- package/package.json +6 -6
|
@@ -16,7 +16,7 @@ $parcel$export(module.exports, "useBreakpoint", () => $893a66ba513f4a66$export$1
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
const $893a66ba513f4a66$var$Context = /*#__PURE__*/ (0, ($parcel$interopDefault($OaNl0$react))).createContext(null);
|
|
19
|
-
$893a66ba513f4a66$var$Context.displayName =
|
|
19
|
+
$893a66ba513f4a66$var$Context.displayName = 'BreakpointContext';
|
|
20
20
|
function $893a66ba513f4a66$export$8214320346cf5104(props) {
|
|
21
21
|
let { children: children, matchedBreakpoints: matchedBreakpoints } = props;
|
|
22
22
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($OaNl0$react))).createElement($893a66ba513f4a66$var$Context.Provider, {
|
|
@@ -28,18 +28,18 @@ function $893a66ba513f4a66$export$8214320346cf5104(props) {
|
|
|
28
28
|
function $893a66ba513f4a66$export$140ae7baa51cca23(breakpoints) {
|
|
29
29
|
let entries = Object.entries(breakpoints).sort(([, valueA], [, valueB])=>valueB - valueA);
|
|
30
30
|
let breakpointQueries = entries.map(([, value])=>`(min-width: ${value}px)`);
|
|
31
|
-
let supportsMatchMedia = typeof window !==
|
|
31
|
+
let supportsMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia === 'function';
|
|
32
32
|
let getBreakpointHandler = ()=>{
|
|
33
33
|
let matched = [];
|
|
34
34
|
for(let i in breakpointQueries){
|
|
35
35
|
let query = breakpointQueries[i];
|
|
36
36
|
if (window.matchMedia(query).matches) matched.push(entries[i][0]);
|
|
37
37
|
}
|
|
38
|
-
matched.push(
|
|
38
|
+
matched.push('base');
|
|
39
39
|
return matched;
|
|
40
40
|
};
|
|
41
41
|
let [breakpoint, setBreakpoint] = (0, $OaNl0$react.useState)(()=>supportsMatchMedia ? getBreakpointHandler() : [
|
|
42
|
-
|
|
42
|
+
'base'
|
|
43
43
|
]);
|
|
44
44
|
(0, $OaNl0$react.useEffect)(()=>{
|
|
45
45
|
if (!supportsMatchMedia) return;
|
|
@@ -52,9 +52,9 @@ function $893a66ba513f4a66$export$140ae7baa51cca23(breakpoints) {
|
|
|
52
52
|
return previousBreakpointHandler;
|
|
53
53
|
});
|
|
54
54
|
};
|
|
55
|
-
window.addEventListener(
|
|
55
|
+
window.addEventListener('resize', onResize);
|
|
56
56
|
return ()=>{
|
|
57
|
-
window.removeEventListener(
|
|
57
|
+
window.removeEventListener('resize', onResize);
|
|
58
58
|
};
|
|
59
59
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
60
60
|
}, [
|
|
@@ -64,7 +64,7 @@ function $893a66ba513f4a66$export$140ae7baa51cca23(breakpoints) {
|
|
|
64
64
|
// this will update and the real value will be returned.
|
|
65
65
|
let isSSR = (0, $OaNl0$reactariassr.useIsSSR)();
|
|
66
66
|
return isSSR ? [
|
|
67
|
-
|
|
67
|
+
'base'
|
|
68
68
|
] : breakpoint;
|
|
69
69
|
}
|
|
70
70
|
function $893a66ba513f4a66$export$199d6754bdf4e1e3() {
|
|
@@ -4,7 +4,7 @@ import {useIsSSR as $9wJsi$useIsSSR} from "@react-aria/ssr";
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
const $1051245f87c5981d$var$Context = /*#__PURE__*/ (0, $9wJsi$react).createContext(null);
|
|
7
|
-
$1051245f87c5981d$var$Context.displayName =
|
|
7
|
+
$1051245f87c5981d$var$Context.displayName = 'BreakpointContext';
|
|
8
8
|
function $1051245f87c5981d$export$8214320346cf5104(props) {
|
|
9
9
|
let { children: children, matchedBreakpoints: matchedBreakpoints } = props;
|
|
10
10
|
return /*#__PURE__*/ (0, $9wJsi$react).createElement($1051245f87c5981d$var$Context.Provider, {
|
|
@@ -16,18 +16,18 @@ function $1051245f87c5981d$export$8214320346cf5104(props) {
|
|
|
16
16
|
function $1051245f87c5981d$export$140ae7baa51cca23(breakpoints) {
|
|
17
17
|
let entries = Object.entries(breakpoints).sort(([, valueA], [, valueB])=>valueB - valueA);
|
|
18
18
|
let breakpointQueries = entries.map(([, value])=>`(min-width: ${value}px)`);
|
|
19
|
-
let supportsMatchMedia = typeof window !==
|
|
19
|
+
let supportsMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia === 'function';
|
|
20
20
|
let getBreakpointHandler = ()=>{
|
|
21
21
|
let matched = [];
|
|
22
22
|
for(let i in breakpointQueries){
|
|
23
23
|
let query = breakpointQueries[i];
|
|
24
24
|
if (window.matchMedia(query).matches) matched.push(entries[i][0]);
|
|
25
25
|
}
|
|
26
|
-
matched.push(
|
|
26
|
+
matched.push('base');
|
|
27
27
|
return matched;
|
|
28
28
|
};
|
|
29
29
|
let [breakpoint, setBreakpoint] = (0, $9wJsi$useState)(()=>supportsMatchMedia ? getBreakpointHandler() : [
|
|
30
|
-
|
|
30
|
+
'base'
|
|
31
31
|
]);
|
|
32
32
|
(0, $9wJsi$useEffect)(()=>{
|
|
33
33
|
if (!supportsMatchMedia) return;
|
|
@@ -40,9 +40,9 @@ function $1051245f87c5981d$export$140ae7baa51cca23(breakpoints) {
|
|
|
40
40
|
return previousBreakpointHandler;
|
|
41
41
|
});
|
|
42
42
|
};
|
|
43
|
-
window.addEventListener(
|
|
43
|
+
window.addEventListener('resize', onResize);
|
|
44
44
|
return ()=>{
|
|
45
|
-
window.removeEventListener(
|
|
45
|
+
window.removeEventListener('resize', onResize);
|
|
46
46
|
};
|
|
47
47
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
48
48
|
}, [
|
|
@@ -52,7 +52,7 @@ function $1051245f87c5981d$export$140ae7baa51cca23(breakpoints) {
|
|
|
52
52
|
// this will update and the real value will be returned.
|
|
53
53
|
let isSSR = (0, $9wJsi$useIsSSR)();
|
|
54
54
|
return isSSR ? [
|
|
55
|
-
|
|
55
|
+
'base'
|
|
56
56
|
] : breakpoint;
|
|
57
57
|
}
|
|
58
58
|
function $1051245f87c5981d$export$199d6754bdf4e1e3() {
|
|
@@ -4,7 +4,7 @@ import {useIsSSR as $9wJsi$useIsSSR} from "@react-aria/ssr";
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
const $1051245f87c5981d$var$Context = /*#__PURE__*/ (0, $9wJsi$react).createContext(null);
|
|
7
|
-
$1051245f87c5981d$var$Context.displayName =
|
|
7
|
+
$1051245f87c5981d$var$Context.displayName = 'BreakpointContext';
|
|
8
8
|
function $1051245f87c5981d$export$8214320346cf5104(props) {
|
|
9
9
|
let { children: children, matchedBreakpoints: matchedBreakpoints } = props;
|
|
10
10
|
return /*#__PURE__*/ (0, $9wJsi$react).createElement($1051245f87c5981d$var$Context.Provider, {
|
|
@@ -16,18 +16,18 @@ function $1051245f87c5981d$export$8214320346cf5104(props) {
|
|
|
16
16
|
function $1051245f87c5981d$export$140ae7baa51cca23(breakpoints) {
|
|
17
17
|
let entries = Object.entries(breakpoints).sort(([, valueA], [, valueB])=>valueB - valueA);
|
|
18
18
|
let breakpointQueries = entries.map(([, value])=>`(min-width: ${value}px)`);
|
|
19
|
-
let supportsMatchMedia = typeof window !==
|
|
19
|
+
let supportsMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia === 'function';
|
|
20
20
|
let getBreakpointHandler = ()=>{
|
|
21
21
|
let matched = [];
|
|
22
22
|
for(let i in breakpointQueries){
|
|
23
23
|
let query = breakpointQueries[i];
|
|
24
24
|
if (window.matchMedia(query).matches) matched.push(entries[i][0]);
|
|
25
25
|
}
|
|
26
|
-
matched.push(
|
|
26
|
+
matched.push('base');
|
|
27
27
|
return matched;
|
|
28
28
|
};
|
|
29
29
|
let [breakpoint, setBreakpoint] = (0, $9wJsi$useState)(()=>supportsMatchMedia ? getBreakpointHandler() : [
|
|
30
|
-
|
|
30
|
+
'base'
|
|
31
31
|
]);
|
|
32
32
|
(0, $9wJsi$useEffect)(()=>{
|
|
33
33
|
if (!supportsMatchMedia) return;
|
|
@@ -40,9 +40,9 @@ function $1051245f87c5981d$export$140ae7baa51cca23(breakpoints) {
|
|
|
40
40
|
return previousBreakpointHandler;
|
|
41
41
|
});
|
|
42
42
|
};
|
|
43
|
-
window.addEventListener(
|
|
43
|
+
window.addEventListener('resize', onResize);
|
|
44
44
|
return ()=>{
|
|
45
|
-
window.removeEventListener(
|
|
45
|
+
window.removeEventListener('resize', onResize);
|
|
46
46
|
};
|
|
47
47
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
48
48
|
}, [
|
|
@@ -52,7 +52,7 @@ function $1051245f87c5981d$export$140ae7baa51cca23(breakpoints) {
|
|
|
52
52
|
// this will update and the real value will be returned.
|
|
53
53
|
let isSSR = (0, $9wJsi$useIsSSR)();
|
|
54
54
|
return isSSR ? [
|
|
55
|
-
|
|
55
|
+
'base'
|
|
56
56
|
] : breakpoint;
|
|
57
57
|
}
|
|
58
58
|
function $1051245f87c5981d$export$199d6754bdf4e1e3() {
|
package/dist/Slots.main.js
CHANGED
|
@@ -62,7 +62,7 @@ function $e81916440cf6fd84$export$ceb145244332b7a2(props) {
|
|
|
62
62
|
let { children: children, ...otherProps } = props;
|
|
63
63
|
let content = children;
|
|
64
64
|
if ((0, ($parcel$interopDefault($iTRw5$react))).Children.toArray(children).length <= 1) {
|
|
65
|
-
if (typeof children ===
|
|
65
|
+
if (typeof children === 'function') content = /*#__PURE__*/ (0, ($parcel$interopDefault($iTRw5$react))).cloneElement((0, ($parcel$interopDefault($iTRw5$react))).Children.only(children), otherProps);
|
|
66
66
|
}
|
|
67
67
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($iTRw5$react))).createElement($e81916440cf6fd84$var$SlotContext.Provider, {
|
|
68
68
|
value: {}
|
package/dist/Slots.mjs
CHANGED
|
@@ -49,7 +49,7 @@ function $59d09bcc83651bf9$export$ceb145244332b7a2(props) {
|
|
|
49
49
|
let { children: children, ...otherProps } = props;
|
|
50
50
|
let content = children;
|
|
51
51
|
if ((0, $doF98$react).Children.toArray(children).length <= 1) {
|
|
52
|
-
if (typeof children ===
|
|
52
|
+
if (typeof children === 'function') content = /*#__PURE__*/ (0, $doF98$react).cloneElement((0, $doF98$react).Children.only(children), otherProps);
|
|
53
53
|
}
|
|
54
54
|
return /*#__PURE__*/ (0, $doF98$react).createElement($59d09bcc83651bf9$var$SlotContext.Provider, {
|
|
55
55
|
value: {}
|
package/dist/Slots.module.js
CHANGED
|
@@ -49,7 +49,7 @@ function $59d09bcc83651bf9$export$ceb145244332b7a2(props) {
|
|
|
49
49
|
let { children: children, ...otherProps } = props;
|
|
50
50
|
let content = children;
|
|
51
51
|
if ((0, $doF98$react).Children.toArray(children).length <= 1) {
|
|
52
|
-
if (typeof children ===
|
|
52
|
+
if (typeof children === 'function') content = /*#__PURE__*/ (0, $doF98$react).cloneElement((0, $doF98$react).Children.only(children), otherProps);
|
|
53
53
|
}
|
|
54
54
|
return /*#__PURE__*/ (0, $doF98$react).createElement($59d09bcc83651bf9$var$SlotContext.Provider, {
|
|
55
55
|
value: {}
|
package/dist/classNames.main.js
CHANGED
|
@@ -31,14 +31,14 @@ function $e720495fead531ee$export$f9d3bfd10703eb31() {
|
|
|
31
31
|
function $e720495fead531ee$export$ce4ab0c55987d1ff(cssModule, ...values) {
|
|
32
32
|
let classes = [];
|
|
33
33
|
for (let value of values){
|
|
34
|
-
if (typeof value ===
|
|
34
|
+
if (typeof value === 'object' && value) {
|
|
35
35
|
let mapped = {};
|
|
36
36
|
for(let key in value){
|
|
37
37
|
if (cssModule[key]) mapped[cssModule[key]] = value[key];
|
|
38
38
|
if ($e720495fead531ee$export$46d604dce8bf8724 || !cssModule[key]) mapped[key] = value[key];
|
|
39
39
|
}
|
|
40
40
|
classes.push(mapped);
|
|
41
|
-
} else if (typeof value ===
|
|
41
|
+
} else if (typeof value === 'string') {
|
|
42
42
|
if (cssModule[value]) classes.push(cssModule[value]);
|
|
43
43
|
if ($e720495fead531ee$export$46d604dce8bf8724 || !cssModule[value]) classes.push(value);
|
|
44
44
|
} else classes.push(value);
|
package/dist/classNames.mjs
CHANGED
|
@@ -19,14 +19,14 @@ function $fd933927dbac1f15$export$f9d3bfd10703eb31() {
|
|
|
19
19
|
function $fd933927dbac1f15$export$ce4ab0c55987d1ff(cssModule, ...values) {
|
|
20
20
|
let classes = [];
|
|
21
21
|
for (let value of values){
|
|
22
|
-
if (typeof value ===
|
|
22
|
+
if (typeof value === 'object' && value) {
|
|
23
23
|
let mapped = {};
|
|
24
24
|
for(let key in value){
|
|
25
25
|
if (cssModule[key]) mapped[cssModule[key]] = value[key];
|
|
26
26
|
if ($fd933927dbac1f15$export$46d604dce8bf8724 || !cssModule[key]) mapped[key] = value[key];
|
|
27
27
|
}
|
|
28
28
|
classes.push(mapped);
|
|
29
|
-
} else if (typeof value ===
|
|
29
|
+
} else if (typeof value === 'string') {
|
|
30
30
|
if (cssModule[value]) classes.push(cssModule[value]);
|
|
31
31
|
if ($fd933927dbac1f15$export$46d604dce8bf8724 || !cssModule[value]) classes.push(value);
|
|
32
32
|
} else classes.push(value);
|
|
@@ -19,14 +19,14 @@ function $fd933927dbac1f15$export$f9d3bfd10703eb31() {
|
|
|
19
19
|
function $fd933927dbac1f15$export$ce4ab0c55987d1ff(cssModule, ...values) {
|
|
20
20
|
let classes = [];
|
|
21
21
|
for (let value of values){
|
|
22
|
-
if (typeof value ===
|
|
22
|
+
if (typeof value === 'object' && value) {
|
|
23
23
|
let mapped = {};
|
|
24
24
|
for(let key in value){
|
|
25
25
|
if (cssModule[key]) mapped[cssModule[key]] = value[key];
|
|
26
26
|
if ($fd933927dbac1f15$export$46d604dce8bf8724 || !cssModule[key]) mapped[key] = value[key];
|
|
27
27
|
}
|
|
28
28
|
classes.push(mapped);
|
|
29
|
-
} else if (typeof value ===
|
|
29
|
+
} else if (typeof value === 'string') {
|
|
30
30
|
if (cssModule[value]) classes.push(cssModule[value]);
|
|
31
31
|
if ($fd933927dbac1f15$export$46d604dce8bf8724 || !cssModule[value]) classes.push(value);
|
|
32
32
|
} else classes.push(value);
|
|
@@ -23,7 +23,7 @@ $parcel$export(module.exports, "getWrappedElement", () => $c588c81c05dac184$expo
|
|
|
23
23
|
*/
|
|
24
24
|
function $c588c81c05dac184$export$a5f5a6912b18861c(children) {
|
|
25
25
|
let element;
|
|
26
|
-
if (typeof children ===
|
|
26
|
+
if (typeof children === 'string') element = /*#__PURE__*/ (0, ($parcel$interopDefault($8XE5P$react))).createElement("span", null, children);
|
|
27
27
|
else element = (0, ($parcel$interopDefault($8XE5P$react))).Children.only(children);
|
|
28
28
|
return element;
|
|
29
29
|
}
|
|
@@ -13,7 +13,7 @@ import $kaboj$react from "react";
|
|
|
13
13
|
*/
|
|
14
14
|
function $bde65b0159e7c06e$export$a5f5a6912b18861c(children) {
|
|
15
15
|
let element;
|
|
16
|
-
if (typeof children ===
|
|
16
|
+
if (typeof children === 'string') element = /*#__PURE__*/ (0, $kaboj$react).createElement("span", null, children);
|
|
17
17
|
else element = (0, $kaboj$react).Children.only(children);
|
|
18
18
|
return element;
|
|
19
19
|
}
|
|
@@ -13,7 +13,7 @@ import $kaboj$react from "react";
|
|
|
13
13
|
*/
|
|
14
14
|
function $bde65b0159e7c06e$export$a5f5a6912b18861c(children) {
|
|
15
15
|
let element;
|
|
16
|
-
if (typeof children ===
|
|
16
|
+
if (typeof children === 'string') element = /*#__PURE__*/ (0, $kaboj$react).createElement("span", null, children);
|
|
17
17
|
else element = (0, $kaboj$react).Children.only(children);
|
|
18
18
|
return element;
|
|
19
19
|
}
|