@react-spectrum/provider 3.9.6 → 3.9.7
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/Provider.main.js +7 -7
- package/dist/Provider.mjs +8 -8
- package/dist/Provider.module.js +7 -7
- package/dist/context.main.js +1 -1
- package/dist/context.mjs +2 -2
- package/dist/context.module.js +1 -1
- package/dist/mediaQueries.main.js +13 -13
- package/dist/mediaQueries.mjs +14 -14
- package/dist/mediaQueries.module.js +13 -13
- package/dist/package.main.js +1 -1
- package/dist/package.mjs +2 -2
- package/dist/package.module.js +1 -1
- package/dist/page_vars_css.mjs +1 -1
- package/dist/typography_index_css.mjs +1 -1
- package/package.json +8 -8
package/dist/Provider.main.js
CHANGED
|
@@ -57,7 +57,7 @@ function $96cabdf5b0aed55b$var$Provider(props, ref) {
|
|
|
57
57
|
let prevColorScheme = prevContext && prevContext.colorScheme;
|
|
58
58
|
let prevBreakpoints = prevContext && prevContext.breakpoints;
|
|
59
59
|
let { theme: theme = prevContext && prevContext.theme, defaultColorScheme: defaultColorScheme } = props;
|
|
60
|
-
if (!theme) throw new Error(
|
|
60
|
+
if (!theme) throw new Error('theme not found, the parent provider must have a theme provided');
|
|
61
61
|
// Hooks must always be called.
|
|
62
62
|
let autoColorScheme = (0, $a6e2b5f4621e4690$exports.useColorScheme)(theme, defaultColorScheme);
|
|
63
63
|
let autoScale = (0, $a6e2b5f4621e4690$exports.useScale)(theme);
|
|
@@ -94,7 +94,7 @@ function $96cabdf5b0aed55b$var$Provider(props, ref) {
|
|
|
94
94
|
if (!prevContext || props.locale || theme !== prevContext.theme || colorScheme !== prevContext.colorScheme || scale !== prevContext.scale || Object.keys(domProps).length > 0 || otherProps.UNSAFE_className || Object.keys(styleProps.style).length > 0) contents = /*#__PURE__*/ (0, ($parcel$interopDefault($dbjUM$react))).createElement($96cabdf5b0aed55b$var$ProviderWrapper, {
|
|
95
95
|
...props,
|
|
96
96
|
UNSAFE_style: {
|
|
97
|
-
isolation: !prevContext ?
|
|
97
|
+
isolation: !prevContext ? 'isolate' : undefined,
|
|
98
98
|
...styleProps.style
|
|
99
99
|
},
|
|
100
100
|
ref: ref
|
|
@@ -122,8 +122,8 @@ const $96cabdf5b0aed55b$var$ProviderWrapper = /*#__PURE__*/ (0, ($parcel$interop
|
|
|
122
122
|
let domRef = (0, $dbjUM$reactspectrumutils.useDOMRef)(ref);
|
|
123
123
|
let themeKey = Object.keys(theme[colorScheme])[0];
|
|
124
124
|
let scaleKey = Object.keys(theme[scale])[0];
|
|
125
|
-
let className = (0, ($parcel$interopDefault($dbjUM$clsx)))(styleProps.className, (0, ($parcel$interopDefault($22365f0f5f2dcdd5$exports)))[
|
|
126
|
-
|
|
125
|
+
let className = (0, ($parcel$interopDefault($dbjUM$clsx)))(styleProps.className, (0, ($parcel$interopDefault($22365f0f5f2dcdd5$exports)))['spectrum'], (0, ($parcel$interopDefault($19fbfce217006b12$exports)))['spectrum'], Object.values(theme[colorScheme]), Object.values(theme[scale]), theme.global ? Object.values(theme.global) : null, {
|
|
126
|
+
'react-spectrum-provider': (0, $dbjUM$reactspectrumutils.shouldKeepSpectrumClassNames),
|
|
127
127
|
spectrum: (0, $dbjUM$reactspectrumutils.shouldKeepSpectrumClassNames),
|
|
128
128
|
[themeKey]: (0, $dbjUM$reactspectrumutils.shouldKeepSpectrumClassNames),
|
|
129
129
|
[scaleKey]: (0, $dbjUM$reactspectrumutils.shouldKeepSpectrumClassNames)
|
|
@@ -133,13 +133,13 @@ const $96cabdf5b0aed55b$var$ProviderWrapper = /*#__PURE__*/ (0, ($parcel$interop
|
|
|
133
133
|
...styleProps.style,
|
|
134
134
|
// This ensures that browser native UI like scrollbars are rendered in the right color scheme.
|
|
135
135
|
// See https://web.dev/color-scheme/.
|
|
136
|
-
colorScheme: (_ref = (_props_colorScheme = props.colorScheme) !== null && _props_colorScheme !== void 0 ? _props_colorScheme : colorScheme) !== null && _ref !== void 0 ? _ref : Object.keys(theme).filter((k)=>k ===
|
|
136
|
+
colorScheme: (_ref = (_props_colorScheme = props.colorScheme) !== null && _props_colorScheme !== void 0 ? _props_colorScheme : colorScheme) !== null && _ref !== void 0 ? _ref : Object.keys(theme).filter((k)=>k === 'light' || k === 'dark').join(' ')
|
|
137
137
|
};
|
|
138
138
|
let hasWarned = (0, $dbjUM$react.useRef)(false);
|
|
139
139
|
(0, $dbjUM$react.useEffect)(()=>{
|
|
140
140
|
if (direction && domRef.current) {
|
|
141
|
-
let closestDir = domRef.current.parentElement.closest(
|
|
142
|
-
let dir = closestDir && closestDir.getAttribute(
|
|
141
|
+
let closestDir = domRef.current.parentElement.closest('[dir]');
|
|
142
|
+
let dir = closestDir && closestDir.getAttribute('dir');
|
|
143
143
|
if (dir && dir !== direction && !hasWarned.current) {
|
|
144
144
|
console.warn(`Language directions cannot be nested. ${direction} inside ${dir}.`);
|
|
145
145
|
hasWarned.current = true;
|
package/dist/Provider.mjs
CHANGED
|
@@ -49,7 +49,7 @@ function $7167f8da3cce35e4$var$Provider(props, ref) {
|
|
|
49
49
|
let prevColorScheme = prevContext && prevContext.colorScheme;
|
|
50
50
|
let prevBreakpoints = prevContext && prevContext.breakpoints;
|
|
51
51
|
let { theme: theme = prevContext && prevContext.theme, defaultColorScheme: defaultColorScheme } = props;
|
|
52
|
-
if (!theme) throw new Error(
|
|
52
|
+
if (!theme) throw new Error('theme not found, the parent provider must have a theme provided');
|
|
53
53
|
// Hooks must always be called.
|
|
54
54
|
let autoColorScheme = (0, $d8453c5ae7fac713$export$6343629ee1b29116)(theme, defaultColorScheme);
|
|
55
55
|
let autoScale = (0, $d8453c5ae7fac713$export$a8d2043b2d807f4d)(theme);
|
|
@@ -86,7 +86,7 @@ function $7167f8da3cce35e4$var$Provider(props, ref) {
|
|
|
86
86
|
if (!prevContext || props.locale || theme !== prevContext.theme || colorScheme !== prevContext.colorScheme || scale !== prevContext.scale || Object.keys(domProps).length > 0 || otherProps.UNSAFE_className || Object.keys(styleProps.style).length > 0) contents = /*#__PURE__*/ (0, $dyW1v$react).createElement($7167f8da3cce35e4$var$ProviderWrapper, {
|
|
87
87
|
...props,
|
|
88
88
|
UNSAFE_style: {
|
|
89
|
-
isolation: !prevContext ?
|
|
89
|
+
isolation: !prevContext ? 'isolate' : undefined,
|
|
90
90
|
...styleProps.style
|
|
91
91
|
},
|
|
92
92
|
ref: ref
|
|
@@ -114,8 +114,8 @@ const $7167f8da3cce35e4$var$ProviderWrapper = /*#__PURE__*/ (0, $dyW1v$react).fo
|
|
|
114
114
|
let domRef = (0, $dyW1v$useDOMRef)(ref);
|
|
115
115
|
let themeKey = Object.keys(theme[colorScheme])[0];
|
|
116
116
|
let scaleKey = Object.keys(theme[scale])[0];
|
|
117
|
-
let className = (0, $dyW1v$clsx)(styleProps.className, (0, ($parcel$interopDefault($dyW1v$page_vars_cssmodulejs)))[
|
|
118
|
-
|
|
117
|
+
let className = (0, $dyW1v$clsx)(styleProps.className, (0, ($parcel$interopDefault($dyW1v$page_vars_cssmodulejs)))['spectrum'], (0, ($parcel$interopDefault($dyW1v$typography_index_cssmodulejs)))['spectrum'], Object.values(theme[colorScheme]), Object.values(theme[scale]), theme.global ? Object.values(theme.global) : null, {
|
|
118
|
+
'react-spectrum-provider': (0, $dyW1v$shouldKeepSpectrumClassNames),
|
|
119
119
|
spectrum: (0, $dyW1v$shouldKeepSpectrumClassNames),
|
|
120
120
|
[themeKey]: (0, $dyW1v$shouldKeepSpectrumClassNames),
|
|
121
121
|
[scaleKey]: (0, $dyW1v$shouldKeepSpectrumClassNames)
|
|
@@ -125,13 +125,13 @@ const $7167f8da3cce35e4$var$ProviderWrapper = /*#__PURE__*/ (0, $dyW1v$react).fo
|
|
|
125
125
|
...styleProps.style,
|
|
126
126
|
// This ensures that browser native UI like scrollbars are rendered in the right color scheme.
|
|
127
127
|
// See https://web.dev/color-scheme/.
|
|
128
|
-
colorScheme: (_ref = (_props_colorScheme = props.colorScheme) !== null && _props_colorScheme !== void 0 ? _props_colorScheme : colorScheme) !== null && _ref !== void 0 ? _ref : Object.keys(theme).filter((k)=>k ===
|
|
128
|
+
colorScheme: (_ref = (_props_colorScheme = props.colorScheme) !== null && _props_colorScheme !== void 0 ? _props_colorScheme : colorScheme) !== null && _ref !== void 0 ? _ref : Object.keys(theme).filter((k)=>k === 'light' || k === 'dark').join(' ')
|
|
129
129
|
};
|
|
130
130
|
let hasWarned = (0, $dyW1v$useRef)(false);
|
|
131
131
|
(0, $dyW1v$useEffect)(()=>{
|
|
132
132
|
if (direction && domRef.current) {
|
|
133
|
-
let closestDir = domRef.current.parentElement.closest(
|
|
134
|
-
let dir = closestDir && closestDir.getAttribute(
|
|
133
|
+
let closestDir = domRef.current.parentElement.closest('[dir]');
|
|
134
|
+
let dir = closestDir && closestDir.getAttribute('dir');
|
|
135
135
|
if (dir && dir !== direction && !hasWarned.current) {
|
|
136
136
|
console.warn(`Language directions cannot be nested. ${direction} inside ${dir}.`);
|
|
137
137
|
hasWarned.current = true;
|
|
@@ -171,4 +171,4 @@ function $7167f8da3cce35e4$export$521c373ccc32c300(props) {
|
|
|
171
171
|
|
|
172
172
|
|
|
173
173
|
export {$7167f8da3cce35e4$export$693cdb10cec23617 as useProvider, $7167f8da3cce35e4$export$2881499e37b75b9a as Provider, $7167f8da3cce35e4$export$521c373ccc32c300 as useProviderProps};
|
|
174
|
-
//# sourceMappingURL=Provider.
|
|
174
|
+
//# sourceMappingURL=Provider.module.js.map
|
package/dist/Provider.module.js
CHANGED
|
@@ -49,7 +49,7 @@ function $7167f8da3cce35e4$var$Provider(props, ref) {
|
|
|
49
49
|
let prevColorScheme = prevContext && prevContext.colorScheme;
|
|
50
50
|
let prevBreakpoints = prevContext && prevContext.breakpoints;
|
|
51
51
|
let { theme: theme = prevContext && prevContext.theme, defaultColorScheme: defaultColorScheme } = props;
|
|
52
|
-
if (!theme) throw new Error(
|
|
52
|
+
if (!theme) throw new Error('theme not found, the parent provider must have a theme provided');
|
|
53
53
|
// Hooks must always be called.
|
|
54
54
|
let autoColorScheme = (0, $d8453c5ae7fac713$export$6343629ee1b29116)(theme, defaultColorScheme);
|
|
55
55
|
let autoScale = (0, $d8453c5ae7fac713$export$a8d2043b2d807f4d)(theme);
|
|
@@ -86,7 +86,7 @@ function $7167f8da3cce35e4$var$Provider(props, ref) {
|
|
|
86
86
|
if (!prevContext || props.locale || theme !== prevContext.theme || colorScheme !== prevContext.colorScheme || scale !== prevContext.scale || Object.keys(domProps).length > 0 || otherProps.UNSAFE_className || Object.keys(styleProps.style).length > 0) contents = /*#__PURE__*/ (0, $dyW1v$react).createElement($7167f8da3cce35e4$var$ProviderWrapper, {
|
|
87
87
|
...props,
|
|
88
88
|
UNSAFE_style: {
|
|
89
|
-
isolation: !prevContext ?
|
|
89
|
+
isolation: !prevContext ? 'isolate' : undefined,
|
|
90
90
|
...styleProps.style
|
|
91
91
|
},
|
|
92
92
|
ref: ref
|
|
@@ -114,8 +114,8 @@ const $7167f8da3cce35e4$var$ProviderWrapper = /*#__PURE__*/ (0, $dyW1v$react).fo
|
|
|
114
114
|
let domRef = (0, $dyW1v$useDOMRef)(ref);
|
|
115
115
|
let themeKey = Object.keys(theme[colorScheme])[0];
|
|
116
116
|
let scaleKey = Object.keys(theme[scale])[0];
|
|
117
|
-
let className = (0, $dyW1v$clsx)(styleProps.className, (0, ($parcel$interopDefault($dyW1v$page_vars_cssmodulejs)))[
|
|
118
|
-
|
|
117
|
+
let className = (0, $dyW1v$clsx)(styleProps.className, (0, ($parcel$interopDefault($dyW1v$page_vars_cssmodulejs)))['spectrum'], (0, ($parcel$interopDefault($dyW1v$typography_index_cssmodulejs)))['spectrum'], Object.values(theme[colorScheme]), Object.values(theme[scale]), theme.global ? Object.values(theme.global) : null, {
|
|
118
|
+
'react-spectrum-provider': (0, $dyW1v$shouldKeepSpectrumClassNames),
|
|
119
119
|
spectrum: (0, $dyW1v$shouldKeepSpectrumClassNames),
|
|
120
120
|
[themeKey]: (0, $dyW1v$shouldKeepSpectrumClassNames),
|
|
121
121
|
[scaleKey]: (0, $dyW1v$shouldKeepSpectrumClassNames)
|
|
@@ -125,13 +125,13 @@ const $7167f8da3cce35e4$var$ProviderWrapper = /*#__PURE__*/ (0, $dyW1v$react).fo
|
|
|
125
125
|
...styleProps.style,
|
|
126
126
|
// This ensures that browser native UI like scrollbars are rendered in the right color scheme.
|
|
127
127
|
// See https://web.dev/color-scheme/.
|
|
128
|
-
colorScheme: (_ref = (_props_colorScheme = props.colorScheme) !== null && _props_colorScheme !== void 0 ? _props_colorScheme : colorScheme) !== null && _ref !== void 0 ? _ref : Object.keys(theme).filter((k)=>k ===
|
|
128
|
+
colorScheme: (_ref = (_props_colorScheme = props.colorScheme) !== null && _props_colorScheme !== void 0 ? _props_colorScheme : colorScheme) !== null && _ref !== void 0 ? _ref : Object.keys(theme).filter((k)=>k === 'light' || k === 'dark').join(' ')
|
|
129
129
|
};
|
|
130
130
|
let hasWarned = (0, $dyW1v$useRef)(false);
|
|
131
131
|
(0, $dyW1v$useEffect)(()=>{
|
|
132
132
|
if (direction && domRef.current) {
|
|
133
|
-
let closestDir = domRef.current.parentElement.closest(
|
|
134
|
-
let dir = closestDir && closestDir.getAttribute(
|
|
133
|
+
let closestDir = domRef.current.parentElement.closest('[dir]');
|
|
134
|
+
let dir = closestDir && closestDir.getAttribute('dir');
|
|
135
135
|
if (dir && dir !== direction && !hasWarned.current) {
|
|
136
136
|
console.warn(`Language directions cannot be nested. ${direction} inside ${dir}.`);
|
|
137
137
|
hasWarned.current = true;
|
package/dist/context.main.js
CHANGED
|
@@ -22,7 +22,7 @@ $parcel$export(module.exports, "Context", () => $a5b4f4e252b5a021$export$841858b
|
|
|
22
22
|
* governing permissions and limitations under the License.
|
|
23
23
|
*/
|
|
24
24
|
const $a5b4f4e252b5a021$export$841858b892ce1f4c = (0, ($parcel$interopDefault($3n4Xf$react))).createContext(null);
|
|
25
|
-
$a5b4f4e252b5a021$export$841858b892ce1f4c.displayName =
|
|
25
|
+
$a5b4f4e252b5a021$export$841858b892ce1f4c.displayName = 'ProviderContext';
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
//# sourceMappingURL=context.main.js.map
|
package/dist/context.mjs
CHANGED
|
@@ -12,8 +12,8 @@ import $hscZN$react from "react";
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
const $a8430f637b4ccbce$export$841858b892ce1f4c = (0, $hscZN$react).createContext(null);
|
|
15
|
-
$a8430f637b4ccbce$export$841858b892ce1f4c.displayName =
|
|
15
|
+
$a8430f637b4ccbce$export$841858b892ce1f4c.displayName = 'ProviderContext';
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
export {$a8430f637b4ccbce$export$841858b892ce1f4c as Context};
|
|
19
|
-
//# sourceMappingURL=context.
|
|
19
|
+
//# sourceMappingURL=context.module.js.map
|
package/dist/context.module.js
CHANGED
|
@@ -12,7 +12,7 @@ import $hscZN$react from "react";
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
const $a8430f637b4ccbce$export$841858b892ce1f4c = (0, $hscZN$react).createContext(null);
|
|
15
|
-
$a8430f637b4ccbce$export$841858b892ce1f4c.displayName =
|
|
15
|
+
$a8430f637b4ccbce$export$841858b892ce1f4c.displayName = 'ProviderContext';
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
export {$a8430f637b4ccbce$export$841858b892ce1f4c as Context};
|
|
@@ -19,22 +19,22 @@ $parcel$export(module.exports, "useScale", () => $a6e2b5f4621e4690$export$a8d204
|
|
|
19
19
|
* governing permissions and limitations under the License.
|
|
20
20
|
*/
|
|
21
21
|
function $a6e2b5f4621e4690$export$6343629ee1b29116(theme, defaultColorScheme) {
|
|
22
|
-
let matchesDark = (0, $hitAW$reactspectrumutils.useMediaQuery)(
|
|
23
|
-
let matchesLight = (0, $hitAW$reactspectrumutils.useMediaQuery)(
|
|
22
|
+
let matchesDark = (0, $hitAW$reactspectrumutils.useMediaQuery)('(prefers-color-scheme: dark)');
|
|
23
|
+
let matchesLight = (0, $hitAW$reactspectrumutils.useMediaQuery)('(prefers-color-scheme: light)');
|
|
24
24
|
// importance OS > default > omitted
|
|
25
|
-
if (theme.dark && matchesDark) return
|
|
26
|
-
if (theme.light && matchesLight) return
|
|
27
|
-
if (theme.dark && defaultColorScheme ===
|
|
28
|
-
if (theme.light && defaultColorScheme ===
|
|
29
|
-
if (!theme.dark) return
|
|
30
|
-
if (!theme.light) return
|
|
31
|
-
return
|
|
25
|
+
if (theme.dark && matchesDark) return 'dark';
|
|
26
|
+
if (theme.light && matchesLight) return 'light';
|
|
27
|
+
if (theme.dark && defaultColorScheme === 'dark') return 'dark';
|
|
28
|
+
if (theme.light && defaultColorScheme === 'light') return 'light';
|
|
29
|
+
if (!theme.dark) return 'light';
|
|
30
|
+
if (!theme.light) return 'dark';
|
|
31
|
+
return 'light';
|
|
32
32
|
}
|
|
33
33
|
function $a6e2b5f4621e4690$export$a8d2043b2d807f4d(theme) {
|
|
34
|
-
let matchesFine = (0, $hitAW$reactspectrumutils.useMediaQuery)(
|
|
35
|
-
if (matchesFine && theme.medium) return
|
|
36
|
-
if (theme.large) return
|
|
37
|
-
return
|
|
34
|
+
let matchesFine = (0, $hitAW$reactspectrumutils.useMediaQuery)('(any-pointer: fine)');
|
|
35
|
+
if (matchesFine && theme.medium) return 'medium';
|
|
36
|
+
if (theme.large) return 'large';
|
|
37
|
+
return 'medium';
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
|
package/dist/mediaQueries.mjs
CHANGED
|
@@ -12,24 +12,24 @@ import {useMediaQuery as $9bAXg$useMediaQuery} from "@react-spectrum/utils";
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
function $d8453c5ae7fac713$export$6343629ee1b29116(theme, defaultColorScheme) {
|
|
15
|
-
let matchesDark = (0, $9bAXg$useMediaQuery)(
|
|
16
|
-
let matchesLight = (0, $9bAXg$useMediaQuery)(
|
|
15
|
+
let matchesDark = (0, $9bAXg$useMediaQuery)('(prefers-color-scheme: dark)');
|
|
16
|
+
let matchesLight = (0, $9bAXg$useMediaQuery)('(prefers-color-scheme: light)');
|
|
17
17
|
// importance OS > default > omitted
|
|
18
|
-
if (theme.dark && matchesDark) return
|
|
19
|
-
if (theme.light && matchesLight) return
|
|
20
|
-
if (theme.dark && defaultColorScheme ===
|
|
21
|
-
if (theme.light && defaultColorScheme ===
|
|
22
|
-
if (!theme.dark) return
|
|
23
|
-
if (!theme.light) return
|
|
24
|
-
return
|
|
18
|
+
if (theme.dark && matchesDark) return 'dark';
|
|
19
|
+
if (theme.light && matchesLight) return 'light';
|
|
20
|
+
if (theme.dark && defaultColorScheme === 'dark') return 'dark';
|
|
21
|
+
if (theme.light && defaultColorScheme === 'light') return 'light';
|
|
22
|
+
if (!theme.dark) return 'light';
|
|
23
|
+
if (!theme.light) return 'dark';
|
|
24
|
+
return 'light';
|
|
25
25
|
}
|
|
26
26
|
function $d8453c5ae7fac713$export$a8d2043b2d807f4d(theme) {
|
|
27
|
-
let matchesFine = (0, $9bAXg$useMediaQuery)(
|
|
28
|
-
if (matchesFine && theme.medium) return
|
|
29
|
-
if (theme.large) return
|
|
30
|
-
return
|
|
27
|
+
let matchesFine = (0, $9bAXg$useMediaQuery)('(any-pointer: fine)');
|
|
28
|
+
if (matchesFine && theme.medium) return 'medium';
|
|
29
|
+
if (theme.large) return 'large';
|
|
30
|
+
return 'medium';
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
export {$d8453c5ae7fac713$export$6343629ee1b29116 as useColorScheme, $d8453c5ae7fac713$export$a8d2043b2d807f4d as useScale};
|
|
35
|
-
//# sourceMappingURL=mediaQueries.
|
|
35
|
+
//# sourceMappingURL=mediaQueries.module.js.map
|
|
@@ -12,22 +12,22 @@ import {useMediaQuery as $9bAXg$useMediaQuery} from "@react-spectrum/utils";
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
function $d8453c5ae7fac713$export$6343629ee1b29116(theme, defaultColorScheme) {
|
|
15
|
-
let matchesDark = (0, $9bAXg$useMediaQuery)(
|
|
16
|
-
let matchesLight = (0, $9bAXg$useMediaQuery)(
|
|
15
|
+
let matchesDark = (0, $9bAXg$useMediaQuery)('(prefers-color-scheme: dark)');
|
|
16
|
+
let matchesLight = (0, $9bAXg$useMediaQuery)('(prefers-color-scheme: light)');
|
|
17
17
|
// importance OS > default > omitted
|
|
18
|
-
if (theme.dark && matchesDark) return
|
|
19
|
-
if (theme.light && matchesLight) return
|
|
20
|
-
if (theme.dark && defaultColorScheme ===
|
|
21
|
-
if (theme.light && defaultColorScheme ===
|
|
22
|
-
if (!theme.dark) return
|
|
23
|
-
if (!theme.light) return
|
|
24
|
-
return
|
|
18
|
+
if (theme.dark && matchesDark) return 'dark';
|
|
19
|
+
if (theme.light && matchesLight) return 'light';
|
|
20
|
+
if (theme.dark && defaultColorScheme === 'dark') return 'dark';
|
|
21
|
+
if (theme.light && defaultColorScheme === 'light') return 'light';
|
|
22
|
+
if (!theme.dark) return 'light';
|
|
23
|
+
if (!theme.light) return 'dark';
|
|
24
|
+
return 'light';
|
|
25
25
|
}
|
|
26
26
|
function $d8453c5ae7fac713$export$a8d2043b2d807f4d(theme) {
|
|
27
|
-
let matchesFine = (0, $9bAXg$useMediaQuery)(
|
|
28
|
-
if (matchesFine && theme.medium) return
|
|
29
|
-
if (theme.large) return
|
|
30
|
-
return
|
|
27
|
+
let matchesFine = (0, $9bAXg$useMediaQuery)('(any-pointer: fine)');
|
|
28
|
+
if (matchesFine && theme.medium) return 'medium';
|
|
29
|
+
if (theme.large) return 'large';
|
|
30
|
+
return 'medium';
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
|
package/dist/package.main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module.exports = JSON.parse(
|
|
1
|
+
module.exports = JSON.parse("{\"name\":\"@react-spectrum/provider\",\"version\":\"3.9.6\",\"description\":\"Spectrum UI components in React\",\"license\":\"Apache-2.0\",\"main\":\"dist/main.js\",\"module\":\"dist/module.js\",\"exports\":{\"types\":\"./dist/types.d.ts\",\"import\":\"./dist/import.mjs\",\"require\":\"./dist/main.js\"},\"types\":\"dist/types.d.ts\",\"source\":\"src/index.ts\",\"files\":[\"dist\",\"src\"],\"sideEffects\":[\"*.css\"],\"targets\":{\"main\":{\"includeNodeModules\":[\"@adobe/spectrum-css-temp\"]},\"module\":{\"includeNodeModules\":[\"@adobe/spectrum-css-temp\"]}},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/adobe/react-spectrum\"},\"dependencies\":{\"@react-aria/i18n\":\"^3.11.0\",\"@react-aria/overlays\":\"^3.22.0\",\"@react-aria/utils\":\"^3.24.0\",\"@react-spectrum/utils\":\"^3.11.6\",\"@react-types/provider\":\"^3.8.0\",\"@react-types/shared\":\"^3.23.0\",\"@swc/helpers\":\"^0.5.0\",\"clsx\":\"^2.0.0\"},\"devDependencies\":{\"@adobe/spectrum-css-temp\":\"3.0.0-alpha.1\"},\"peerDependencies\":{\"react\":\"^16.8.0 || ^17.0.0-rc.1 || ^18.0.0\",\"react-dom\":\"^16.8.0 || ^17.0.0-rc.1 || ^18.0.0\"},\"publishConfig\":{\"access\":\"public\"}}");
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
//# sourceMappingURL=package.main.js.map
|
package/dist/package.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var $7b22e09dddddd7da$exports = {};
|
|
2
|
-
$7b22e09dddddd7da$exports = JSON.parse(
|
|
2
|
+
$7b22e09dddddd7da$exports = JSON.parse("{\"name\":\"@react-spectrum/provider\",\"version\":\"3.9.6\",\"description\":\"Spectrum UI components in React\",\"license\":\"Apache-2.0\",\"main\":\"dist/main.js\",\"module\":\"dist/module.js\",\"exports\":{\"types\":\"./dist/types.d.ts\",\"import\":\"./dist/import.mjs\",\"require\":\"./dist/main.js\"},\"types\":\"dist/types.d.ts\",\"source\":\"src/index.ts\",\"files\":[\"dist\",\"src\"],\"sideEffects\":[\"*.css\"],\"targets\":{\"main\":{\"includeNodeModules\":[\"@adobe/spectrum-css-temp\"]},\"module\":{\"includeNodeModules\":[\"@adobe/spectrum-css-temp\"]}},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/adobe/react-spectrum\"},\"dependencies\":{\"@react-aria/i18n\":\"^3.11.0\",\"@react-aria/overlays\":\"^3.22.0\",\"@react-aria/utils\":\"^3.24.0\",\"@react-spectrum/utils\":\"^3.11.6\",\"@react-types/provider\":\"^3.8.0\",\"@react-types/shared\":\"^3.23.0\",\"@swc/helpers\":\"^0.5.0\",\"clsx\":\"^2.0.0\"},\"devDependencies\":{\"@adobe/spectrum-css-temp\":\"3.0.0-alpha.1\"},\"peerDependencies\":{\"react\":\"^16.8.0 || ^17.0.0-rc.1 || ^18.0.0\",\"react-dom\":\"^16.8.0 || ^17.0.0-rc.1 || ^18.0.0\"},\"publishConfig\":{\"access\":\"public\"}}");
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
export {$7b22e09dddddd7da$exports as default};
|
|
6
|
-
//# sourceMappingURL=package.
|
|
6
|
+
//# sourceMappingURL=package.module.js.map
|
package/dist/package.module.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var $7b22e09dddddd7da$exports = {};
|
|
2
|
-
$7b22e09dddddd7da$exports = JSON.parse(
|
|
2
|
+
$7b22e09dddddd7da$exports = JSON.parse("{\"name\":\"@react-spectrum/provider\",\"version\":\"3.9.6\",\"description\":\"Spectrum UI components in React\",\"license\":\"Apache-2.0\",\"main\":\"dist/main.js\",\"module\":\"dist/module.js\",\"exports\":{\"types\":\"./dist/types.d.ts\",\"import\":\"./dist/import.mjs\",\"require\":\"./dist/main.js\"},\"types\":\"dist/types.d.ts\",\"source\":\"src/index.ts\",\"files\":[\"dist\",\"src\"],\"sideEffects\":[\"*.css\"],\"targets\":{\"main\":{\"includeNodeModules\":[\"@adobe/spectrum-css-temp\"]},\"module\":{\"includeNodeModules\":[\"@adobe/spectrum-css-temp\"]}},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/adobe/react-spectrum\"},\"dependencies\":{\"@react-aria/i18n\":\"^3.11.0\",\"@react-aria/overlays\":\"^3.22.0\",\"@react-aria/utils\":\"^3.24.0\",\"@react-spectrum/utils\":\"^3.11.6\",\"@react-types/provider\":\"^3.8.0\",\"@react-types/shared\":\"^3.23.0\",\"@swc/helpers\":\"^0.5.0\",\"clsx\":\"^2.0.0\"},\"devDependencies\":{\"@adobe/spectrum-css-temp\":\"3.0.0-alpha.1\"},\"peerDependencies\":{\"react\":\"^16.8.0 || ^17.0.0-rc.1 || ^18.0.0\",\"react-dom\":\"^16.8.0 || ^17.0.0-rc.1 || ^18.0.0\"},\"publishConfig\":{\"access\":\"public\"}}");
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
export {$7b22e09dddddd7da$exports as default};
|
package/dist/page_vars_css.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/provider",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.7",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
"url": "https://github.com/adobe/react-spectrum"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@react-aria/i18n": "^3.11.
|
|
40
|
-
"@react-aria/overlays": "^3.22.
|
|
41
|
-
"@react-aria/utils": "^3.24.
|
|
42
|
-
"@react-spectrum/utils": "^3.11.
|
|
43
|
-
"@react-types/provider": "^3.8.
|
|
44
|
-
"@react-types/shared": "^3.23.
|
|
39
|
+
"@react-aria/i18n": "^3.11.1",
|
|
40
|
+
"@react-aria/overlays": "^3.22.1",
|
|
41
|
+
"@react-aria/utils": "^3.24.1",
|
|
42
|
+
"@react-spectrum/utils": "^3.11.7",
|
|
43
|
+
"@react-types/provider": "^3.8.1",
|
|
44
|
+
"@react-types/shared": "^3.23.1",
|
|
45
45
|
"@swc/helpers": "^0.5.0",
|
|
46
46
|
"clsx": "^2.0.0"
|
|
47
47
|
},
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433"
|
|
59
59
|
}
|