@react-spectrum/provider 3.5.2 → 3.6.1
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/main.js +87 -61
- package/dist/main.js.map +1 -1
- package/dist/module.js +87 -61
- package/dist/module.js.map +1 -1
- package/package.json +9 -9
- package/src/Provider.tsx +2 -2
package/dist/main.js
CHANGED
|
@@ -16,7 +16,28 @@ function $parcel$interopDefault(a) {
|
|
|
16
16
|
$parcel$export(module.exports, "Provider", () => $96cabdf5b0aed55b$export$2881499e37b75b9a);
|
|
17
17
|
$parcel$export(module.exports, "useProvider", () => $96cabdf5b0aed55b$export$693cdb10cec23617);
|
|
18
18
|
$parcel$export(module.exports, "useProviderProps", () => $96cabdf5b0aed55b$export$521c373ccc32c300);
|
|
19
|
-
|
|
19
|
+
/*
|
|
20
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
21
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
22
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
23
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
24
|
+
*
|
|
25
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
26
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
27
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
28
|
+
* governing permissions and limitations under the License.
|
|
29
|
+
*/ /// <reference types="css-module-types" />
|
|
30
|
+
/*
|
|
31
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
32
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
33
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
34
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
35
|
+
*
|
|
36
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
37
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
38
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
39
|
+
* governing permissions and limitations under the License.
|
|
40
|
+
*/
|
|
20
41
|
|
|
21
42
|
|
|
22
43
|
|
|
@@ -42,33 +63,43 @@ $19fbfce217006b12$export$a30bf7810c8453d1 = "spectrum-Body_2a241c";
|
|
|
42
63
|
$19fbfce217006b12$export$7b2dac1166f6ec4c = "spectrum-Body--italic_2a241c";
|
|
43
64
|
|
|
44
65
|
|
|
45
|
-
|
|
66
|
+
/*
|
|
67
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
68
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
69
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
70
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
71
|
+
*
|
|
72
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
73
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
74
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
75
|
+
* governing permissions and limitations under the License.
|
|
76
|
+
*/
|
|
46
77
|
function $a6e2b5f4621e4690$export$6343629ee1b29116(theme, defaultColorScheme) {
|
|
47
|
-
let matchesDark = $kmRpa$reactspectrumutils.useMediaQuery(
|
|
48
|
-
let matchesLight = $kmRpa$reactspectrumutils.useMediaQuery(
|
|
78
|
+
let matchesDark = (0, $kmRpa$reactspectrumutils.useMediaQuery)("(prefers-color-scheme: dark)");
|
|
79
|
+
let matchesLight = (0, $kmRpa$reactspectrumutils.useMediaQuery)("(prefers-color-scheme: light)");
|
|
49
80
|
// importance OS > default > omitted
|
|
50
|
-
if (theme.dark && matchesDark) return
|
|
51
|
-
if (theme.light && matchesLight) return
|
|
52
|
-
if (theme.dark && defaultColorScheme ===
|
|
53
|
-
if (theme.light && defaultColorScheme ===
|
|
54
|
-
if (!theme.dark) return
|
|
55
|
-
if (!theme.light) return
|
|
56
|
-
return
|
|
81
|
+
if (theme.dark && matchesDark) return "dark";
|
|
82
|
+
if (theme.light && matchesLight) return "light";
|
|
83
|
+
if (theme.dark && defaultColorScheme === "dark") return "dark";
|
|
84
|
+
if (theme.light && defaultColorScheme === "light") return "light";
|
|
85
|
+
if (!theme.dark) return "light";
|
|
86
|
+
if (!theme.light) return "dark";
|
|
87
|
+
return "light";
|
|
57
88
|
}
|
|
58
89
|
function $a6e2b5f4621e4690$export$a8d2043b2d807f4d(theme) {
|
|
59
|
-
let matchesFine = $kmRpa$reactspectrumutils.useMediaQuery(
|
|
60
|
-
if (matchesFine && theme.medium) return
|
|
61
|
-
if (theme.large) return
|
|
62
|
-
return
|
|
90
|
+
let matchesFine = (0, $kmRpa$reactspectrumutils.useMediaQuery)("(any-pointer: fine)");
|
|
91
|
+
if (matchesFine && theme.medium) return "medium";
|
|
92
|
+
if (theme.large) return "large";
|
|
93
|
+
return "medium";
|
|
63
94
|
}
|
|
64
95
|
|
|
65
96
|
|
|
66
97
|
var $4db360e38265184f$exports = {};
|
|
67
|
-
$4db360e38265184f$exports = JSON.parse(
|
|
98
|
+
$4db360e38265184f$exports = JSON.parse('{"name":"@react-spectrum/provider","version":"3.6.1","description":"Spectrum UI components in React","license":"Apache-2.0","main":"dist/main.js","module":"dist/module.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.6.3","@react-aria/overlays":"^3.12.1","@react-aria/utils":"^3.14.2","@react-spectrum/utils":"^3.8.1","@react-types/provider":"^3.5.5","@react-types/shared":"^3.16.0","@swc/helpers":"^0.4.14","clsx":"^1.1.1"},"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"}}');
|
|
68
99
|
|
|
69
100
|
|
|
70
|
-
const $96cabdf5b0aed55b$var$Context = /*#__PURE__*/ ($parcel$interopDefault($kmRpa$react)).createContext(null);
|
|
71
|
-
$96cabdf5b0aed55b$var$Context.displayName =
|
|
101
|
+
const $96cabdf5b0aed55b$var$Context = /*#__PURE__*/ (0, ($parcel$interopDefault($kmRpa$react))).createContext(null);
|
|
102
|
+
$96cabdf5b0aed55b$var$Context.displayName = "ProviderContext";
|
|
72
103
|
const $96cabdf5b0aed55b$var$DEFAULT_BREAKPOINTS = {
|
|
73
104
|
S: 640,
|
|
74
105
|
M: 768,
|
|
@@ -81,11 +112,11 @@ function $96cabdf5b0aed55b$var$Provider(props, ref) {
|
|
|
81
112
|
let prevColorScheme = prevContext && prevContext.colorScheme;
|
|
82
113
|
let prevBreakpoints = prevContext && prevContext.breakpoints;
|
|
83
114
|
let { theme: theme = prevContext && prevContext.theme , defaultColorScheme: defaultColorScheme } = props;
|
|
84
|
-
if (!theme) throw new Error(
|
|
115
|
+
if (!theme) throw new Error("theme not found, the parent provider must have a theme provided");
|
|
85
116
|
// Hooks must always be called.
|
|
86
|
-
let autoColorScheme = $a6e2b5f4621e4690$export$6343629ee1b29116(theme, defaultColorScheme);
|
|
87
|
-
let autoScale = $a6e2b5f4621e4690$export$a8d2043b2d807f4d(theme);
|
|
88
|
-
let { locale: prevLocale } = $kmRpa$reactariai18n.useLocale();
|
|
117
|
+
let autoColorScheme = (0, $a6e2b5f4621e4690$export$6343629ee1b29116)(theme, defaultColorScheme);
|
|
118
|
+
let autoScale = (0, $a6e2b5f4621e4690$export$a8d2043b2d807f4d)(theme);
|
|
119
|
+
let { locale: prevLocale } = (0, $kmRpa$reactariai18n.useLocale)();
|
|
89
120
|
// if the new theme doesn't support the prevColorScheme, we must resort to the auto
|
|
90
121
|
let usePrevColorScheme = !!theme[prevColorScheme];
|
|
91
122
|
// importance of color scheme props > parent > auto:(OS > default > omitted)
|
|
@@ -104,69 +135,65 @@ function $96cabdf5b0aed55b$var$Provider(props, ref) {
|
|
|
104
135
|
isReadOnly: isReadOnly,
|
|
105
136
|
validationState: validationState
|
|
106
137
|
};
|
|
107
|
-
let matchedBreakpoints = $kmRpa$reactspectrumutils.useMatchedBreakpoints(breakpoints);
|
|
108
|
-
let filteredProps = {
|
|
109
|
-
|
|
110
|
-
Object.entries(currentProps).forEach(([key, value])=>value !== undefined && (filteredProps[key] = value)
|
|
111
|
-
);
|
|
138
|
+
let matchedBreakpoints = (0, $kmRpa$reactspectrumutils.useMatchedBreakpoints)(breakpoints);
|
|
139
|
+
let filteredProps = {};
|
|
140
|
+
Object.entries(currentProps).forEach(([key, value])=>value !== undefined && (filteredProps[key] = value));
|
|
112
141
|
// Merge options with parent provider
|
|
113
|
-
let context = Object.assign({
|
|
114
|
-
}, prevContext, filteredProps);
|
|
142
|
+
let context = Object.assign({}, prevContext, filteredProps);
|
|
115
143
|
// Only wrap in a DOM node if the theme, colorScheme, or scale changed
|
|
116
144
|
let contents = children;
|
|
117
|
-
let domProps = $kmRpa$reactariautils.filterDOMProps(otherProps);
|
|
118
|
-
let { styleProps: styleProps } = $kmRpa$reactspectrumutils.useStyleProps(otherProps, undefined, {
|
|
145
|
+
let domProps = (0, $kmRpa$reactariautils.filterDOMProps)(otherProps);
|
|
146
|
+
let { styleProps: styleProps } = (0, $kmRpa$reactspectrumutils.useStyleProps)(otherProps, undefined, {
|
|
119
147
|
matchedBreakpoints: matchedBreakpoints
|
|
120
148
|
});
|
|
121
|
-
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__*/ ($parcel$interopDefault($kmRpa$react)).createElement($96cabdf5b0aed55b$var$ProviderWrapper, {
|
|
149
|
+
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($kmRpa$react))).createElement($96cabdf5b0aed55b$var$ProviderWrapper, {
|
|
122
150
|
...props,
|
|
123
151
|
UNSAFE_style: {
|
|
124
|
-
isolation: !prevContext ?
|
|
152
|
+
isolation: !prevContext ? "isolate" : undefined,
|
|
125
153
|
...styleProps.style
|
|
126
154
|
},
|
|
127
155
|
ref: ref
|
|
128
156
|
}, contents);
|
|
129
|
-
return
|
|
157
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($kmRpa$react))).createElement($96cabdf5b0aed55b$var$Context.Provider, {
|
|
130
158
|
value: context
|
|
131
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($kmRpa$react)).createElement($kmRpa$reactariai18n.I18nProvider, {
|
|
159
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($kmRpa$react))).createElement((0, $kmRpa$reactariai18n.I18nProvider), {
|
|
132
160
|
locale: locale
|
|
133
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($kmRpa$react)).createElement($kmRpa$reactspectrumutils.BreakpointProvider, {
|
|
161
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($kmRpa$react))).createElement((0, $kmRpa$reactspectrumutils.BreakpointProvider), {
|
|
134
162
|
matchedBreakpoints: matchedBreakpoints
|
|
135
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($kmRpa$react)).createElement($kmRpa$reactariaoverlays.ModalProvider, null, contents))))
|
|
163
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($kmRpa$react))).createElement((0, $kmRpa$reactariaoverlays.ModalProvider), null, contents))));
|
|
136
164
|
}
|
|
137
165
|
/**
|
|
138
166
|
* Provider is the container for all React Spectrum applications.
|
|
139
167
|
* It defines the theme, locale, and other application level settings,
|
|
140
168
|
* and can also be used to provide common properties to a group of components.
|
|
141
|
-
*/ let $96cabdf5b0aed55b$export$2881499e37b75b9a = /*#__PURE__*/ ($parcel$interopDefault($kmRpa$react)).forwardRef($96cabdf5b0aed55b$var$Provider);
|
|
142
|
-
const $96cabdf5b0aed55b$var$ProviderWrapper = /*#__PURE__*/ ($parcel$interopDefault($kmRpa$react)).forwardRef(function ProviderWrapper(props, ref) {
|
|
169
|
+
*/ let $96cabdf5b0aed55b$export$2881499e37b75b9a = /*#__PURE__*/ (0, ($parcel$interopDefault($kmRpa$react))).forwardRef($96cabdf5b0aed55b$var$Provider);
|
|
170
|
+
const $96cabdf5b0aed55b$var$ProviderWrapper = /*#__PURE__*/ (0, ($parcel$interopDefault($kmRpa$react))).forwardRef(function ProviderWrapper(props, ref) {
|
|
143
171
|
let { children: children , ...otherProps } = props;
|
|
144
|
-
let { locale: locale , direction: direction } = $kmRpa$reactariai18n.useLocale();
|
|
172
|
+
let { locale: locale , direction: direction } = (0, $kmRpa$reactariai18n.useLocale)();
|
|
145
173
|
let { theme: theme , colorScheme: colorScheme , scale: scale } = $96cabdf5b0aed55b$export$693cdb10cec23617();
|
|
146
|
-
let { modalProviderProps: modalProviderProps } = $kmRpa$reactariaoverlays.useModalProvider();
|
|
147
|
-
let { styleProps: styleProps } = $kmRpa$reactspectrumutils.useStyleProps(otherProps);
|
|
148
|
-
let domRef = $kmRpa$reactspectrumutils.useDOMRef(ref);
|
|
174
|
+
let { modalProviderProps: modalProviderProps } = (0, $kmRpa$reactariaoverlays.useModalProvider)();
|
|
175
|
+
let { styleProps: styleProps } = (0, $kmRpa$reactspectrumutils.useStyleProps)(otherProps);
|
|
176
|
+
let domRef = (0, $kmRpa$reactspectrumutils.useDOMRef)(ref);
|
|
149
177
|
let themeKey = Object.keys(theme[colorScheme])[0];
|
|
150
178
|
let scaleKey = Object.keys(theme[scale])[0];
|
|
151
|
-
let className = ($parcel$interopDefault($kmRpa$clsx))(styleProps.className, (/*@__PURE__*/$parcel$interopDefault($22365f0f5f2dcdd5$exports))[
|
|
152
|
-
|
|
153
|
-
spectrum: $kmRpa$reactspectrumutils.shouldKeepSpectrumClassNames,
|
|
154
|
-
[themeKey]: $kmRpa$reactspectrumutils.shouldKeepSpectrumClassNames,
|
|
155
|
-
[scaleKey]: $kmRpa$reactspectrumutils.shouldKeepSpectrumClassNames
|
|
179
|
+
let className = (0, ($parcel$interopDefault($kmRpa$clsx)))(styleProps.className, (0, (/*@__PURE__*/$parcel$interopDefault($22365f0f5f2dcdd5$exports)))["spectrum"], (0, (/*@__PURE__*/$parcel$interopDefault($19fbfce217006b12$exports)))["spectrum"], Object.values(theme[colorScheme]), Object.values(theme[scale]), theme.global ? Object.values(theme.global) : null, {
|
|
180
|
+
"react-spectrum-provider": (0, $kmRpa$reactspectrumutils.shouldKeepSpectrumClassNames),
|
|
181
|
+
spectrum: (0, $kmRpa$reactspectrumutils.shouldKeepSpectrumClassNames),
|
|
182
|
+
[themeKey]: (0, $kmRpa$reactspectrumutils.shouldKeepSpectrumClassNames),
|
|
183
|
+
[scaleKey]: (0, $kmRpa$reactspectrumutils.shouldKeepSpectrumClassNames)
|
|
156
184
|
});
|
|
157
|
-
var
|
|
185
|
+
var _props_colorScheme, _ref;
|
|
158
186
|
let style = {
|
|
159
187
|
...styleProps.style,
|
|
160
188
|
// This ensures that browser native UI like scrollbars are rendered in the right color scheme.
|
|
161
189
|
// See https://web.dev/color-scheme/.
|
|
162
|
-
colorScheme: (
|
|
163
|
-
).join(' ')
|
|
190
|
+
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(" ")
|
|
164
191
|
};
|
|
165
|
-
let hasWarned = $kmRpa$react.useRef(false);
|
|
166
|
-
$kmRpa$react.useEffect(()=>{
|
|
192
|
+
let hasWarned = (0, $kmRpa$react.useRef)(false);
|
|
193
|
+
(0, $kmRpa$react.useEffect)(()=>{
|
|
167
194
|
if (direction && domRef.current) {
|
|
168
|
-
let closestDir = domRef.current.parentElement.closest(
|
|
169
|
-
let dir = closestDir && closestDir.getAttribute(
|
|
195
|
+
let closestDir = domRef.current.parentElement.closest("[dir]");
|
|
196
|
+
let dir = closestDir && closestDir.getAttribute("dir");
|
|
170
197
|
if (dir && dir !== direction && !hasWarned.current) {
|
|
171
198
|
console.warn(`Language directions cannot be nested. ${direction} inside ${dir}.`);
|
|
172
199
|
hasWarned.current = true;
|
|
@@ -177,8 +204,8 @@ const $96cabdf5b0aed55b$var$ProviderWrapper = /*#__PURE__*/ ($parcel$interopDefa
|
|
|
177
204
|
domRef,
|
|
178
205
|
hasWarned
|
|
179
206
|
]);
|
|
180
|
-
return
|
|
181
|
-
|
|
207
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($kmRpa$react))).createElement("div", {
|
|
208
|
+
...(0, $kmRpa$reactariautils.filterDOMProps)(otherProps),
|
|
182
209
|
...styleProps,
|
|
183
210
|
...modalProviderProps,
|
|
184
211
|
className: className,
|
|
@@ -186,16 +213,15 @@ const $96cabdf5b0aed55b$var$ProviderWrapper = /*#__PURE__*/ ($parcel$interopDefa
|
|
|
186
213
|
lang: locale,
|
|
187
214
|
dir: direction,
|
|
188
215
|
ref: domRef
|
|
189
|
-
}, children)
|
|
216
|
+
}, children);
|
|
190
217
|
});
|
|
191
218
|
function $96cabdf5b0aed55b$export$693cdb10cec23617() {
|
|
192
|
-
return $kmRpa$react.useContext($96cabdf5b0aed55b$var$Context);
|
|
219
|
+
return (0, $kmRpa$react.useContext)($96cabdf5b0aed55b$var$Context);
|
|
193
220
|
}
|
|
194
221
|
function $96cabdf5b0aed55b$export$521c373ccc32c300(props) {
|
|
195
222
|
let context = $96cabdf5b0aed55b$export$693cdb10cec23617();
|
|
196
223
|
if (!context) return props;
|
|
197
|
-
return Object.assign({
|
|
198
|
-
}, {
|
|
224
|
+
return Object.assign({}, {
|
|
199
225
|
isQuiet: context.isQu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IAAI,GAAG,KAAK,SAAS,KAAK,SAAS,CAAC,OAAO,EAAE,CAAC;gBACnD,OAAO,CAAC,IAAI,EAAE,sCAAsC,EAAE,SAAS,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;gBAC/E,SAAS,CAAC,OAAO,GAAG,IAAI;YAC1B,CAAC;QACH,CAAC;IACH,CAAC,EAAE,CAAC;QAAA,SAAS;QAAE,MAAM;QAAE,SAAS;IAAA,CAAC;IAGjC,MAAM,oEACH,CAAG;WACE,oCAAc,CAAC,UAAU;WACzB,UAAU;WACV,kBAAkB;QACtB,SAAS,EAAE,SAAS;QACpB,KAAK,EAAE,KAAK;QACZ,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,SAAS;QACd,GAAG,EAAE,MAAM;OACV,QAAQ;AAGf,CAAC;SAMe,yCAAW,GAAoB,CAAC;IAC9C,MAAM,CAAC,uBAAU,CAAC,6BAAO;AAC3B,CAAC;SAEe,yCAAgB,CAAI,KAAQ,EAAM,CAAC;IACjD,GAAG,CAAC,OAAO,GAAG,yCAAW;IACzB,EAAE,GAAG,OAAO,EACV,MAAM,CAAC,KAAK;IAEd,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAAA,CAAC,EAAE,CAAC;QACxB,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,YAAY,EAAE,OAAO,CAAC,YAAY;QAClC,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,eAAe,EAAE,OAAO,CAAC,eAAe;IAC1C,CAAC,EAAE,KAAK;AACV,CAAC","sources":["packages/@react-spectrum/provider/src/index.ts","packages/@react-spectrum/provider/src/Provider.tsx","packages/@adobe/spectrum-css-temp/components/page/vars.css","packages/@adobe/spectrum-css-temp/components/typography/index.css","packages/@react-spectrum/provider/src/mediaQueries.ts","packages/@react-spectrum/provider/package.json"],"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\n/// <reference types=\"css-module-types\" />\n\nexport {Provider, useProvider, useProviderProps} from './Provider';\nexport type {ProviderContext} from '@react-types/provider';\nexport type {ProviderProps} from '@react-types/provider';\n","/*\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 {\n BreakpointProvider,\n shouldKeepSpectrumClassNames,\n useDOMRef,\n useMatchedBreakpoints,\n useStyleProps\n} from '@react-spectrum/utils';\nimport clsx from 'clsx';\nimport {DOMRef} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {I18nProvider, useLocale} from '@react-aria/i18n';\nimport {ModalProvider, useModalProvider} from '@react-aria/overlays';\nimport {ProviderContext, ProviderProps} from '@react-types/provider';\nimport React, {useContext, useEffect, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/page/vars.css';\nimport typographyStyles from '@adobe/spectrum-css-temp/components/typography/index.css';\nimport {useColorScheme, useScale} from './mediaQueries';\n// @ts-ignore\nimport {version} from '../package.json';\n\nconst Context = React.createContext<ProviderContext | null>(null);\nContext.displayName = 'ProviderContext';\n\nconst DEFAULT_BREAKPOINTS = {S: 640, M: 768, L: 1024, XL: 1280, XXL: 1536};\n\nfunction Provider(props: ProviderProps, ref: DOMRef<HTMLDivElement>) {\n let prevContext = useProvider();\n let prevColorScheme = prevContext && prevContext.colorScheme;\n let prevBreakpoints = prevContext && prevContext.breakpoints;\n let {\n theme = prevContext && prevContext.theme,\n defaultColorScheme\n } = props;\n if (!theme) {\n throw new Error('theme not found, the parent provider must have a theme provided');\n }\n // Hooks must always be called.\n let autoColorScheme = useColorScheme(theme, defaultColorScheme);\n let autoScale = useScale(theme);\n let {locale: prevLocale} = useLocale();\n // if the new theme doesn't support the prevColorScheme, we must resort to the auto\n let usePrevColorScheme = !!theme[prevColorScheme];\n\n // importance of color scheme props > parent > auto:(OS > default > omitted)\n let {\n colorScheme = usePrevColorScheme ? prevColorScheme : autoColorScheme,\n scale = prevContext ? prevContext.scale : autoScale,\n locale = prevContext ? prevLocale : null,\n breakpoints = prevContext ? prevBreakpoints : DEFAULT_BREAKPOINTS,\n children,\n isQuiet,\n isEmphasized,\n isDisabled,\n isRequired,\n isReadOnly,\n validationState,\n ...otherProps\n } = props;\n\n // select only the props with values so undefined props don't overwrite prevContext values\n let currentProps = {\n version,\n theme,\n breakpoints,\n colorScheme,\n scale,\n isQuiet,\n isEmphasized,\n isDisabled,\n isRequired,\n isReadOnly,\n validationState\n };\n\n let matchedBreakpoints = useMatchedBreakpoints(breakpoints);\n let filteredProps = {};\n Object.entries(currentProps).forEach(([key, value]) => value !== undefined && (filteredProps[key] = value));\n\n // Merge options with parent provider\n let context = Object.assign({}, prevContext, filteredProps);\n\n // Only wrap in a DOM node if the theme, colorScheme, or scale changed\n let contents = children;\n let domProps = filterDOMProps(otherProps);\n let {styleProps} = useStyleProps(otherProps, undefined, {matchedBreakpoints});\n 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) {\n contents = (\n <ProviderWrapper {...props} UNSAFE_style={{isolation: !prevContext ? 'isolate' : undefined, ...styleProps.style}} ref={ref}>\n {contents}\n </ProviderWrapper>\n );\n }\n\n return (\n <Context.Provider value={context}>\n <I18nProvider locale={locale}>\n <BreakpointProvider matchedBreakpoints={matchedBreakpoints}>\n <ModalProvider>\n {contents}\n </ModalProvider>\n </BreakpointProvider>\n </I18nProvider>\n </Context.Provider>\n );\n}\n\n/**\n * Provider is the container for all React Spectrum applications.\n * It defines the theme, locale, and other application level settings,\n * and can also be used to provide common properties to a group of components.\n */\nlet _Provider = React.forwardRef(Provider);\nexport {_Provider as Provider};\n\nconst ProviderWrapper = React.forwardRef(function ProviderWrapper(props: ProviderProps, ref: DOMRef<HTMLDivElement>) {\n let {\n children,\n ...otherProps\n } = props;\n let {locale, direction} = useLocale();\n let {theme, colorScheme, scale} = useProvider();\n let {modalProviderProps} = useModalProvider();\n let {styleProps} = useStyleProps(otherProps);\n let domRef = useDOMRef(ref);\n\n let themeKey = Object.keys(theme[colorScheme])[0];\n let scaleKey = Object.keys(theme[scale])[0];\n\n let className = clsx(\n styleProps.className,\n styles['spectrum'],\n typographyStyles['spectrum'],\n theme[colorScheme][themeKey],\n theme[scale][scaleKey],\n theme.global ? Object.values(theme.global) : null,\n {\n 'react-spectrum-provider': shouldKeepSpectrumClassNames,\n spectrum: shouldKeepSpectrumClassNames,\n [themeKey]: shouldKeepSpectrumClassNames,\n [scaleKey]: shouldKeepSpectrumClassNames\n }\n );\n\n let style = {\n ...styleProps.style,\n // This ensures that browser native UI like scrollbars are rendered in the right color scheme.\n // See https://web.dev/color-scheme/.\n colorScheme: props.colorScheme ?? colorScheme ?? Object.keys(theme).filter(k => k === 'light' || k === 'dark').join(' ')\n };\n\n let hasWarned = useRef(false);\n useEffect(() => {\n if (direction && domRef.current) {\n let closestDir = domRef.current.parentElement.closest('[dir]');\n let dir = closestDir && closestDir.getAttribute('dir');\n if (dir && dir !== direction && !hasWarned.current) {\n console.warn(`Language directions cannot be nested. ${direction} inside ${dir}.`);\n hasWarned.current = true;\n }\n }\n }, [direction, domRef, hasWarned]);\n\n\n return (\n <div\n {...filterDOMProps(otherProps)}\n {...styleProps}\n {...modalProviderProps}\n className={className}\n style={style}\n lang={locale}\n dir={direction}\n ref={domRef}>\n {children}\n </div>\n );\n});\n\n/**\n * Returns the various settings and styles applied by the nearest parent Provider.\n * Properties explicitly set by the nearest parent Provider override those provided by preceeding Providers.\n */\nexport function useProvider(): ProviderContext {\n return useContext(Context);\n}\n\nexport function useProviderProps<T>(props: T) : T {\n let context = useProvider();\n if (!context) {\n return props;\n }\n return Object.assign({}, {\n isQuiet: context.isQuiet,\n isEmphasized: context.isEmphasized,\n isDisabled: context.isDisabled,\n isRequired: context.isRequired,\n isReadOnly: context.isReadOnly,\n validationState: context.validationState\n }, props);\n}\n","/*\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\n@import './index.css';\n@import './skin.css';\n","/*\nCopyright 2019 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\n@import '../commons/index.css';\n@import 'font.css';\n\n/*@mixin typography .spectrum-Body1 {}\n@mixin typography .spectrum-Body2 {}\n@mixin typography .spectrum-Body3 {}\n@mixin typography .spectrum-Body4 {}\n@mixin typography .spectrum-Body5 {}\n@mixin typography .spectrum-Heading1 {}\n@mixin typography .spectrum-Heading2 {}\n@mixin typography .spectrum-Heading3 {}\n@mixin typography .spectrum-Heading4 {}\n@mixin typography .spectrum-Heading5 {}\n@mixin typography .spectrum-Heading6 {}\n@mixin typography .spectrum-Subheading {}\n@mixin typography .spectrum-Detail {}\n@mixin typography .spectrum-Heading1--quiet, heading-quiet-1 {}\n@mixin typography .spectrum-Heading2--quiet, heading-quiet-2 {}\n@mixin typography .spectrum-Heading1--strong, heading-strong-1 {}\n@mixin typography .spectrum-Heading2--strong, heading-strong-2 {}\n@mixin typography .spectrum-Heading1--display, display-1 {}\n@mixin typography .spectrum-Heading2--display, display-2 {}\n@mixin typography .spectrum-Heading1--display.spectrum-Heading1--strong, display-strong-1 {}\n@mixin typography .spectrum-Heading2--display.spectrum-Heading2--strong, display-strong-2 {}\n@mixin typography .spectrum-Heading1--display.spectrum-Heading1--quiet, display-quiet-1 {}\n@mixin typography .spectrum-Heading2--display.spectrum-Heading2--quiet, display-quiet-2 {}\n\n.spectrum-Typography {\n @mixin typographyMargins .spectrum-Body1 {}\n @mixin typographyMargins .spectrum-Body2 {}\n @mixin typographyMargins .spectrum-Body3 {}\n @mixin typographyMargins .spectrum-Body4 {}\n @mixin typographyMargins .spectrum-Body5 {}\n @mixin typographyMargins .spectrum-Heading1 {}\n @mixin typographyMargins .spectrum-Heading2 {}\n @mixin typographyMargins .spectrum-Heading3 {}\n @mixin typographyMargins .spectrum-Heading4 {}\n @mixin typographyMargins .spectrum-Heading5 {}\n @mixin typographyMargins .spectrum-Heading6 {}\n @mixin typographyMargins .spectrum-Subheading {}\n @mixin typographyMargins .spectrum-Detail {}\n @mixin typographyMargins .spectrum-Heading1--quiet, heading-quiet-1 {}\n @mixin typographyMargins .spectrum-Heading2--quiet, heading-quiet-2 {}\n @mixin typographyMargins .spectrum-Heading1--strong, heading-strong-1 {}\n @mixin typographyMargins .spectrum-Heading2--strong, heading-strong-2 {}\n @mixin typographyMargins .spectrum-Heading1--display, display-1 {}\n @mixin typographyMargins .spectrum-Heading2--display, display-2 {}\n @mixin typographyMargins .spectrum-Heading1--display.spectrum-Heading1--strong, display-strong-1 {}\n @mixin typographyMargins .spectrum-Heading2--display.spectrum-Heading2--strong, display-strong-2 {}\n @mixin typographyMargins .spectrum-Heading1--display.spectrum-Heading1--quiet, display-quiet-1 {}\n @mixin typographyMargins .spectrum-Heading2--display.spectrum-Heading2--quiet, display-quiet-2 {}\n}\n\n.spectrum-Article {\n font-family: var(--spectrum-body-article-1-text-font-family);\n @mixin typography .spectrum-Body1, body-article-1 {}\n @mixin typography .spectrum-Body2, body-article-2 {}\n @mixin typography .spectrum-Body3, body-article-3 {}\n @mixin typography .spectrum-Body4, body-article-4 {}\n @mixin typography .spectrum-Body5, body-article-5 {}\n @mixin typography .spectrum-Heading1, heading-article-1 {}\n @mixin typography .spectrum-Heading2, heading-article-2 {}\n @mixin typography .spectrum-Heading3, heading-article-3 {}\n @mixin typography .spectrum-Heading4, heading-article-4 {}\n @mixin typography .spectrum-Heading5, heading-article-5 {}\n @mixin typography .spectrum-Heading6, heading-article-6 {}\n @mixin typography .spectrum-Subheading, subheading-article {}\n @mixin typography .spectrum-Detail, detail-article {}\n @mixin typography .spectrum-Heading1--quiet, heading-quiet-article-1 {}\n @mixin typography .spectrum-Heading2--quiet, heading-quiet-article-2 {}\n @mixin typography .spectrum-Heading1--display, display-article-1 {}\n @mixin typography .spectrum-Heading2--display, display-article-2 {}\n @mixin typography .spectrum-Heading1--display.spectrum-Heading1--quiet, display-quiet-article-1 {}\n @mixin typography .spectrum-Heading2--display.spectrum-Heading2--quiet, display-quiet-article-2 {}\n}\n.spectrum {\n &:lang(ja),\n &:lang(ko),\n &:lang(zh) {\n @mixin typography .spectrum-Body1, body-han-1 {}\n @mixin typography .spectrum-Body2, body-han-2 {}\n @mixin typography .spectrum-Body3, body-han-3 {}\n @mixin typography .spectrum-Body4, body-han-4 {}\n @mixin typography .spectrum-Body5, body-han-5 {}\n @mixin typography .spectrum-Heading1, heading-han-1 {}\n @mixin typography .spectrum-Heading2, heading-han-2 {}\n @mixin typography .spectrum-Heading3, heading-han-3 {}\n @mixin typography .spectrum-Heading4, heading-han-4 {}\n @mixin typography .spectrum-Heading5, heading-han-5 {}\n @mixin typography .spectrum-Heading6, heading-han-6 {}\n @mixin typography .spectrum-Subheading, subheading-han {}\n @mixin typography .spectrum-Detail, detail-han {}\n @mixin typography .spectrum-Heading1--quiet, heading-quiet-han-1 {}\n @mixin typography .spectrum-Heading2--quiet, heading-quiet-han-2 {}\n @mixin typography .spectrum-Heading1--strong, heading-strong-han-1 {}\n @mixin typography .spectrum-Heading2--strong, heading-strong-han-2 {}\n @mixin typography .spectrum-Heading1--display, display-han-1 {}\n @mixin typography .spectrum-Heading2--display, display-han-2 {}\n @mixin typography .spectrum-Heading1--display.spectrum-Heading1--strong, display-strong-han-1 {}\n @mixin typography .spectrum-Heading2--display.spectrum-Heading2--strong, display-strong-han-2 {}\n @mixin typography .spectrum-Heading1--display.spectrum-Heading1--quiet, display-quiet-han-1 {}\n @mixin typography .spectrum-Heading2--display.spectrum-Heading2--quiet, display-quiet-han-2 {}\n }\n}\n@mixin typography .spectrum-Code1, body-code-1, true {\n font-family: var(--spectrum-body-code-1-text-font-family);\n}\n@mixin typography .spectrum-Code2, body-code-2, true {\n font-family: var(--spectrum-body-code-2-text-font-family);\n}\n@mixin typography .spectrum-Code3, body-code-3, true {\n font-family: var(--spectrum-body-code-3-text-font-family);\n}\n@mixin typography .spectrum-Code4, body-code-4, true {\n font-family: var(--spectrum-body-code-4-text-font-family);\n}\n@mixin typography .spectrum-Code5, body-code-5, true {\n font-family: var(--spectrum-body-code-5-text-font-family);\n}*/\n\n/*\n The &.spectrum makes it so users can do <div class=\"spectrum spectrum--large\"> and still get the right font sizes\n Without this, they would have to do <div class=\"spectrum--large\"><div class=\"spectrum\">, which makes no sense\n*/\n&.spectrum,\n&.spectrum-Body,\n.spectrum,\n.spectrum-Body {\n font-size: var(--spectrum-body-4-text-size);\n font-weight: var(--spectrum-body-4-text-font-weight);\n line-height: var(--spectrum-body-4-text-line-height);\n font-style: var(--spectrum-body-4-text-font-style);\n}\n\n.spectrum-Body--italic {\n font-style: var(--spectrum-body-4-emphasis-text-font-style);\n}\n\n/*\n.spectrum-Body--large {\n @extend .spectrum-Body2;\n}\n\n.spectrum-Body--small {\n @extend .spectrum-Body5;\n}\n\n.spectrum-Body--secondary {\n @extend .spectrum-Body4;\n}\n\n.spectrum-Heading--display {\n @extend .spectrum-Heading2--display.spectrum-Heading2--quiet;\n}\n\n.spectrum-Heading--pageTitle {\n @extend .spectrum-Heading2--quiet;\n}\n\n.spectrum-Heading--subtitle1 {\n @extend .spectrum-Heading4;\n}\n\n.spectrum-Heading--subtitle2 {\n @extend .spectrum-Heading6;\n}\n\n.spectrum-Heading--subtitle3 {\n @extend .spectrum-Subheading;\n}*/\n","/*\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 {ColorScheme, Scale} from '@react-types/provider';\nimport {Theme} from '@react-types/provider';\nimport {useMediaQuery} from '@react-spectrum/utils';\n\nexport function useColorScheme(theme: Theme, defaultColorScheme: ColorScheme): ColorScheme {\n let matchesDark = useMediaQuery('(prefers-color-scheme: dark)');\n let matchesLight = useMediaQuery('(prefers-color-scheme: light)');\n\n // importance OS > default > omitted\n\n if (theme.dark && matchesDark) {\n return 'dark';\n }\n\n if (theme.light && matchesLight) {\n return 'light';\n }\n\n if (theme.dark && defaultColorScheme === 'dark') {\n return 'dark';\n }\n\n if (theme.light && defaultColorScheme === 'light') {\n return 'light';\n }\n\n if (!theme.dark) {\n return 'light';\n }\n\n if (!theme.light) {\n return 'dark';\n }\n\n return 'light';\n}\n\nexport function useScale(theme: Theme): Scale {\n let matchesFine = useMediaQuery('(any-pointer: fine)');\n if (matchesFine && theme.medium) {\n return 'medium';\n }\n\n if (theme.large) {\n return 'large';\n }\n\n return 'medium';\n}\n","{\n \"name\": \"@react-spectrum/provider\",\n \"version\": \"3.5.2\",\n \"description\": \"Spectrum UI components in React\",\n \"license\": \"Apache-2.0\",\n \"main\": \"dist/main.js\",\n \"module\": \"dist/module.js\",\n \"types\": \"dist/types.d.ts\",\n \"source\": \"src/index.ts\",\n \"files\": [\n \"dist\",\n \"src\"\n ],\n \"sideEffects\": [\n \"*.css\"\n ],\n \"targets\": {\n \"main\": {\n \"includeNodeModules\": [\n \"@adobe/spectrum-css-temp\"\n ]\n },\n \"module\": {\n \"includeNodeModules\": [\n \"@adobe/spectrum-css-temp\"\n ]\n }\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/adobe/react-spectrum\"\n },\n \"dependencies\": {\n \"@babel/runtime\": \"^7.6.2\",\n \"@react-aria/i18n\": \"^3.6.1\",\n \"@react-aria/overlays\": \"^3.11.0\",\n \"@react-aria/utils\": \"^3.14.0\",\n \"@react-spectrum/utils\": \"^3.7.4\",\n \"@react-types/provider\": \"^3.5.4\",\n \"@react-types/shared\": \"^3.15.0\",\n \"clsx\": \"^1.1.1\"\n },\n \"devDependencies\": {\n \"@adobe/spectrum-css-temp\": \"3.0.0-alpha.1\"\n },\n \"peerDependencies\": {\n \"react\": \"^16.8.0 || ^17.0.0-rc.1 || ^18.0.0\",\n \"react-dom\": \"^16.8.0 || ^17.0.0-rc.1 || ^18.0.0\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n }\n}\n"],"names":[],"version":3,"file":"main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CA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ACL,KAAK;OACJ;AAGP;AAMO,SAAS,4CAA+B;IAC7C,OAAO,CAAA,GAAA,uBAAS,EAAE;AACpB;AAEO,SAAS,0CAAoB,KAAQ,EAAM;IAChD,IAAI,UAAU;IACd,IAAI,CAAC,SACH,OAAO;IAET,OAAO,OAAO,MAAM,CAAC,CAAC,GAAG;QACvB,SAAS,QAAQ,OAAO;QACxB,cAAc,QAAQ,YAAY;QAClC,YAAY,QAAQ,UAAU;QAC9B,YAAY,QAAQ,UAAU;QAC9B,YAAY,QAAQ,UAAU;QAC9B,iBAAiB,QAAQ,eAAe;IAC1C,GAAG;AACL;;ADrMA","sources":["packages/@react-spectrum/provider/src/index.ts","packages/@react-spectrum/provider/src/Provider.tsx","packages/@adobe/spectrum-css-temp/components/page/vars.css","packages/@adobe/spectrum-css-temp/components/typography/index.css","packages/@react-spectrum/provider/src/mediaQueries.ts","packages/@react-spectrum/provider/package.json"],"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\n/// <reference types=\"css-module-types\" />\n\nexport {Provider, useProvider, useProviderProps} from './Provider';\nexport type {ProviderContext} from '@react-types/provider';\nexport type {ProviderProps} from '@react-types/provider';\n","/*\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 {\n BreakpointProvider,\n shouldKeepSpectrumClassNames,\n useDOMRef,\n useMatchedBreakpoints,\n useStyleProps\n} from '@react-spectrum/utils';\nimport clsx from 'clsx';\nimport {DOMRef} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {I18nProvider, useLocale} from '@react-aria/i18n';\nimport {ModalProvider, useModalProvider} from '@react-aria/overlays';\nimport {ProviderContext, ProviderProps} from '@react-types/provider';\nimport React, {useContext, useEffect, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/page/vars.css';\nimport typographyStyles from '@adobe/spectrum-css-temp/components/typography/index.css';\nimport {useColorScheme, useScale} from './mediaQueries';\n// @ts-ignore\nimport {version} from '../package.json';\n\nconst Context = React.createContext<ProviderContext | null>(null);\nContext.displayName = 'ProviderContext';\n\nconst DEFAULT_BREAKPOINTS = {S: 640, M: 768, L: 1024, XL: 1280, XXL: 1536};\n\nfunction Provider(props: ProviderProps, ref: DOMRef<HTMLDivElement>) {\n let prevContext = useProvider();\n let prevColorScheme = prevContext && prevContext.colorScheme;\n let prevBreakpoints = prevContext && prevContext.breakpoints;\n let {\n theme = prevContext && prevContext.theme,\n defaultColorScheme\n } = props;\n if (!theme) {\n throw new Error('theme not found, the parent provider must have a theme provided');\n }\n // Hooks must always be called.\n let autoColorScheme = useColorScheme(theme, defaultColorScheme);\n let autoScale = useScale(theme);\n let {locale: prevLocale} = useLocale();\n // if the new theme doesn't support the prevColorScheme, we must resort to the auto\n let usePrevColorScheme = !!theme[prevColorScheme];\n\n // importance of color scheme props > parent > auto:(OS > default > omitted)\n let {\n colorScheme = usePrevColorScheme ? prevColorScheme : autoColorScheme,\n scale = prevContext ? prevContext.scale : autoScale,\n locale = prevContext ? prevLocale : null,\n breakpoints = prevContext ? prevBreakpoints : DEFAULT_BREAKPOINTS,\n children,\n isQuiet,\n isEmphasized,\n isDisabled,\n isRequired,\n isReadOnly,\n validationState,\n ...otherProps\n } = props;\n\n // select only the props with values so undefined props don't overwrite prevContext values\n let currentProps = {\n version,\n theme,\n breakpoints,\n colorScheme,\n scale,\n isQuiet,\n isEmphasized,\n isDisabled,\n isRequired,\n isReadOnly,\n validationState\n };\n\n let matchedBreakpoints = useMatchedBreakpoints(breakpoints);\n let filteredProps = {};\n Object.entries(currentProps).forEach(([key, value]) => value !== undefined && (filteredProps[key] = value));\n\n // Merge options with parent provider\n let context = Object.assign({}, prevContext, filteredProps);\n\n // Only wrap in a DOM node if the theme, colorScheme, or scale changed\n let contents = children;\n let domProps = filterDOMProps(otherProps);\n let {styleProps} = useStyleProps(otherProps, undefined, {matchedBreakpoints});\n 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) {\n contents = (\n <ProviderWrapper {...props} UNSAFE_style={{isolation: !prevContext ? 'isolate' : undefined, ...styleProps.style}} ref={ref}>\n {contents}\n </ProviderWrapper>\n );\n }\n\n return (\n <Context.Provider value={context}>\n <I18nProvider locale={locale}>\n <BreakpointProvider matchedBreakpoints={matchedBreakpoints}>\n <ModalProvider>\n {contents}\n </ModalProvider>\n </BreakpointProvider>\n </I18nProvider>\n </Context.Provider>\n );\n}\n\n/**\n * Provider is the container for all React Spectrum applications.\n * It defines the theme, locale, and other application level settings,\n * and can also be used to provide common properties to a group of components.\n */\nlet _Provider = React.forwardRef(Provider);\nexport {_Provider as Provider};\n\nconst ProviderWrapper = React.forwardRef(function ProviderWrapper(props: ProviderProps, ref: DOMRef<HTMLDivElement>) {\n let {\n children,\n ...otherProps\n } = props;\n let {locale, direction} = useLocale();\n let {theme, colorScheme, scale} = useProvider();\n let {modalProviderProps} = useModalProvider();\n let {styleProps} = useStyleProps(otherProps);\n let domRef = useDOMRef(ref);\n\n let themeKey = Object.keys(theme[colorScheme])[0];\n let scaleKey = Object.keys(theme[scale])[0];\n\n let className = clsx(\n styleProps.className,\n styles['spectrum'],\n typographyStyles['spectrum'],\n Object.values(theme[colorScheme]),\n Object.values(theme[scale]),\n theme.global ? Object.values(theme.global) : null,\n {\n 'react-spectrum-provider': shouldKeepSpectrumClassNames,\n spectrum: shouldKeepSpectrumClassNames,\n [themeKey]: shouldKeepSpectrumClassNames,\n [scaleKey]: shouldKeepSpectrumClassNames\n }\n );\n\n let style = {\n ...styleProps.style,\n // This ensures that browser native UI like scrollbars are rendered in the right color scheme.\n // See https://web.dev/color-scheme/.\n colorScheme: props.colorScheme ?? colorScheme ?? Object.keys(theme).filter(k => k === 'light' || k === 'dark').join(' ')\n };\n\n let hasWarned = useRef(false);\n useEffect(() => {\n if (direction && domRef.current) {\n let closestDir = domRef.current.parentElement.closest('[dir]');\n let dir = closestDir && closestDir.getAttribute('dir');\n if (dir && dir !== direction && !hasWarned.current) {\n console.warn(`Language directions cannot be nested. ${direction} inside ${dir}.`);\n hasWarned.current = true;\n }\n }\n }, [direction, domRef, hasWarned]);\n\n\n return (\n <div\n {...filterDOMProps(otherProps)}\n {...styleProps}\n {...modalProviderProps}\n className={className}\n style={style}\n lang={locale}\n dir={direction}\n ref={domRef}>\n {children}\n </div>\n );\n});\n\n/**\n * Returns the various settings and styles applied by the nearest parent Provider.\n * Properties explicitly set by the nearest parent Provider override those provided by preceeding Providers.\n */\nexport function useProvider(): ProviderContext {\n return useContext(Context);\n}\n\nexport function useProviderProps<T>(props: T) : T {\n let context = useProvider();\n if (!context) {\n return props;\n }\n return Object.assign({}, {\n isQuiet: context.isQuiet,\n isEmphasized: context.isEmphasized,\n isDisabled: context.isDisabled,\n isRequired: context.isRequired,\n isReadOnly: context.isReadOnly,\n validationState: context.validationState\n }, props);\n}\n","/*\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\n@import './index.css';\n@import './skin.css';\n","/*\nCopyright 2019 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\n@import '../commons/index.css';\n@import 'font.css';\n\n/*@mixin typography .spectrum-Body1 {}\n@mixin typography .spectrum-Body2 {}\n@mixin typography .spectrum-Body3 {}\n@mixin typography .spectrum-Body4 {}\n@mixin typography .spectrum-Body5 {}\n@mixin typography .spectrum-Heading1 {}\n@mixin typography .spectrum-Heading2 {}\n@mixin typography .spectrum-Heading3 {}\n@mixin typography .spectrum-Heading4 {}\n@mixin typography .spectrum-Heading5 {}\n@mixin typography .spectrum-Heading6 {}\n@mixin typography .spectrum-Subheading {}\n@mixin typography .spectrum-Detail {}\n@mixin typography .spectrum-Heading1--quiet, heading-quiet-1 {}\n@mixin typography .spectrum-Heading2--quiet, heading-quiet-2 {}\n@mixin typography .spectrum-Heading1--strong, heading-strong-1 {}\n@mixin typography .spectrum-Heading2--strong, heading-strong-2 {}\n@mixin typography .spectrum-Heading1--display, display-1 {}\n@mixin typography .spectrum-Heading2--display, display-2 {}\n@mixin typography .spectrum-Heading1--display.spectrum-Heading1--strong, display-strong-1 {}\n@mixin typography .spectrum-Heading2--display.spectrum-Heading2--strong, display-strong-2 {}\n@mixin typography .spectrum-Heading1--display.spectrum-Heading1--quiet, display-quiet-1 {}\n@mixin typography .spectrum-Heading2--display.spectrum-Heading2--quiet, display-quiet-2 {}\n\n.spectrum-Typography {\n @mixin typographyMargins .spectrum-Body1 {}\n @mixin typographyMargins .spectrum-Body2 {}\n @mixin typographyMargins .spectrum-Body3 {}\n @mixin typographyMargins .spectrum-Body4 {}\n @mixin typographyMargins .spectrum-Body5 {}\n @mixin typographyMargins .spectrum-Heading1 {}\n @mixin typographyMargins .spectrum-Heading2 {}\n @mixin typographyMargins .spectrum-Heading3 {}\n @mixin typographyMargins .spectrum-Heading4 {}\n @mixin typographyMargins .spectrum-Heading5 {}\n @mixin typographyMargins .spectrum-Heading6 {}\n @mixin typographyMargins .spectrum-Subheading {}\n @mixin typographyMargins .spectrum-Detail {}\n @mixin typographyMargins .spectrum-Heading1--quiet, heading-quiet-1 {}\n @mixin typographyMargins .spectrum-Heading2--quiet, heading-quiet-2 {}\n @mixin typographyMargins .spectrum-Heading1--strong, heading-strong-1 {}\n @mixin typographyMargins .spectrum-Heading2--strong, heading-strong-2 {}\n @mixin typographyMargins .spectrum-Heading1--display, display-1 {}\n @mixin typographyMargins .spectrum-Heading2--display, display-2 {}\n @mixin typographyMargins .spectrum-Heading1--display.spectrum-Heading1--strong, display-strong-1 {}\n @mixin typographyMargins .spectrum-Heading2--display.spectrum-Heading2--strong, display-strong-2 {}\n @mixin typographyMargins .spectrum-Heading1--display.spectrum-Heading1--quiet, display-quiet-1 {}\n @mixin typographyMargins .spectrum-Heading2--display.spectrum-Heading2--quiet, display-quiet-2 {}\n}\n\n.spectrum-Article {\n font-family: var(--spectrum-body-article-1-text-font-family);\n @mixin typography .spectrum-Body1, body-article-1 {}\n @mixin typography .spectrum-Body2, body-article-2 {}\n @mixin typography .spectrum-Body3, body-article-3 {}\n @mixin typography .spectrum-Body4, body-article-4 {}\n @mixin typography .spectrum-Body5, body-article-5 {}\n @mixin typography .spectrum-Heading1, heading-article-1 {}\n @mixin typography .spectrum-Heading2, heading-article-2 {}\n @mixin typography .spectrum-Heading3, heading-article-3 {}\n @mixin typography .spectrum-Heading4, heading-article-4 {}\n @mixin typography .spectrum-Heading5, heading-article-5 {}\n @mixin typography .spectrum-Heading6, heading-article-6 {}\n @mixin typography .spectrum-Subheading, subheading-article {}\n @mixin typography .spectrum-Detail, detail-article {}\n @mixin typography .spectrum-Heading1--quiet, heading-quiet-article-1 {}\n @mixin typography .spectrum-Heading2--quiet, heading-quiet-article-2 {}\n @mixin typography .spectrum-Heading1--display, display-article-1 {}\n @mixin typography .spectrum-Heading2--display, display-article-2 {}\n @mixin typography .spectrum-Heading1--display.spectrum-Heading1--quiet, display-quiet-article-1 {}\n @mixin typography .spectrum-Heading2--display.spectrum-Heading2--quiet, display-quiet-article-2 {}\n}\n.spectrum {\n &:lang(ja),\n &:lang(ko),\n &:lang(zh) {\n @mixin typography .spectrum-Body1, body-han-1 {}\n @mixin typography .spectrum-Body2, body-han-2 {}\n @mixin typography .spectrum-Body3, body-han-3 {}\n @mixin typography .spectrum-Body4, body-han-4 {}\n @mixin typography .spectrum-Body5, body-han-5 {}\n @mixin typography .spectrum-Heading1, heading-han-1 {}\n @mixin typography .spectrum-Heading2, heading-han-2 {}\n @mixin typography .spectrum-Heading3, heading-han-3 {}\n @mixin typography .spectrum-Heading4, heading-han-4 {}\n @mixin typography .spectrum-Heading5, heading-han-5 {}\n @mixin typography .spectrum-Heading6, heading-han-6 {}\n @mixin typography .spectrum-Subheading, subheading-han {}\n @mixin typography .spectrum-Detail, detail-han {}\n @mixin typography .spectrum-Heading1--quiet, heading-quiet-han-1 {}\n @mixin typography .spectrum-Heading2--quiet, heading-quiet-han-2 {}\n @mixin typography .spectrum-Heading1--strong, heading-strong-han-1 {}\n @mixin typography .spectrum-Heading2--strong, heading-strong-han-2 {}\n @mixin typography .spectrum-Heading1--display, display-han-1 {}\n @mixin typography .spectrum-Heading2--display, display-han-2 {}\n @mixin typography .spectrum-Heading1--display.spectrum-Heading1--strong, display-strong-han-1 {}\n @mixin typography .spectrum-Heading2--display.spectrum-Heading2--strong, display-strong-han-2 {}\n @mixin typography .spectrum-Heading1--display.spectrum-Heading1--quiet, display-quiet-han-1 {}\n @mixin typography .spectrum-Heading2--display.spectrum-Heading2--quiet, display-quiet-han-2 {}\n }\n}\n@mixin typography .spectrum-Code1, body-code-1, true {\n font-family: var(--spectrum-body-code-1-text-font-family);\n}\n@mixin typography .spectrum-Code2, body-code-2, true {\n font-family: var(--spectrum-body-code-2-text-font-family);\n}\n@mixin typography .spectrum-Code3, body-code-3, true {\n font-family: var(--spectrum-body-code-3-text-font-family);\n}\n@mixin typography .spectrum-Code4, body-code-4, true {\n font-family: var(--spectrum-body-code-4-text-font-family);\n}\n@mixin typography .spectrum-Code5, body-code-5, true {\n font-family: var(--spectrum-body-code-5-text-font-family);\n}*/\n\n/*\n The &.spectrum makes it so users can do <div class=\"spectrum spectrum--large\"> and still get the right font sizes\n Without this, they would have to do <div class=\"spectrum--large\"><div class=\"spectrum\">, which makes no sense\n*/\n&.spectrum,\n&.spectrum-Body,\n.spectrum,\n.spectrum-Body {\n font-size: var(--spectrum-body-4-text-size);\n font-weight: var(--spectrum-body-4-text-font-weight);\n line-height: var(--spectrum-body-4-text-line-height);\n font-style: var(--spectrum-body-4-text-font-style);\n}\n\n.spectrum-Body--italic {\n font-style: var(--spectrum-body-4-emphasis-text-font-style);\n}\n\n/*\n.spectrum-Body--large {\n @extend .spectrum-Body2;\n}\n\n.spectrum-Body--small {\n @extend .spectrum-Body5;\n}\n\n.spectrum-Body--secondary {\n @extend .spectrum-Body4;\n}\n\n.spectrum-Heading--display {\n @extend .spectrum-Heading2--display.spectrum-Heading2--quiet;\n}\n\n.spectrum-Heading--pageTitle {\n @extend .spectrum-Heading2--quiet;\n}\n\n.spectrum-Heading--subtitle1 {\n @extend .spectrum-Heading4;\n}\n\n.spectrum-Heading--subtitle2 {\n @extend .spectrum-Heading6;\n}\n\n.spectrum-Heading--subtitle3 {\n @extend .spectrum-Subheading;\n}*/\n","/*\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 {ColorScheme, Scale} from '@react-types/provider';\nimport {Theme} from '@react-types/provider';\nimport {useMediaQuery} from '@react-spectrum/utils';\n\nexport function useColorScheme(theme: Theme, defaultColorScheme: ColorScheme): ColorScheme {\n let matchesDark = useMediaQuery('(prefers-color-scheme: dark)');\n let matchesLight = useMediaQuery('(prefers-color-scheme: light)');\n\n // importance OS > default > omitted\n\n if (theme.dark && matchesDark) {\n return 'dark';\n }\n\n if (theme.light && matchesLight) {\n return 'light';\n }\n\n if (theme.dark && defaultColorScheme === 'dark') {\n return 'dark';\n }\n\n if (theme.light && defaultColorScheme === 'light') {\n return 'light';\n }\n\n if (!theme.dark) {\n return 'light';\n }\n\n if (!theme.light) {\n return 'dark';\n }\n\n return 'light';\n}\n\nexport function useScale(theme: Theme): Scale {\n let matchesFine = useMediaQuery('(any-pointer: fine)');\n if (matchesFine && theme.medium) {\n return 'medium';\n }\n\n if (theme.large) {\n return 'large';\n }\n\n return 'medium';\n}\n","{\n \"name\": \"@react-spectrum/provider\",\n \"version\": \"3.6.1\",\n \"description\": \"Spectrum UI components in React\",\n \"license\": \"Apache-2.0\",\n \"main\": \"dist/main.js\",\n \"module\": \"dist/module.js\",\n \"types\": \"dist/types.d.ts\",\n \"source\": \"src/index.ts\",\n \"files\": [\n \"dist\",\n \"src\"\n ],\n \"sideEffects\": [\n \"*.css\"\n ],\n \"targets\": {\n \"main\": {\n \"includeNodeModules\": [\n \"@adobe/spectrum-css-temp\"\n ]\n },\n \"module\": {\n \"includeNodeModules\": [\n \"@adobe/spectrum-css-temp\"\n ]\n }\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/adobe/react-spectrum\"\n },\n \"dependencies\": {\n \"@react-aria/i18n\": \"^3.6.3\",\n \"@react-aria/overlays\": \"^3.12.1\",\n \"@react-aria/utils\": \"^3.14.2\",\n \"@react-spectrum/utils\": \"^3.8.1\",\n \"@react-types/provider\": \"^3.5.5\",\n \"@react-types/shared\": \"^3.16.0\",\n \"@swc/helpers\": \"^0.4.14\",\n \"clsx\": \"^1.1.1\"\n },\n \"devDependencies\": {\n \"@adobe/spectrum-css-temp\": \"3.0.0-alpha.1\"\n },\n \"peerDependencies\": {\n \"react\": \"^16.8.0 || ^17.0.0-rc.1 || ^18.0.0\",\n \"react-dom\": \"^16.8.0 || ^17.0.0-rc.1 || ^18.0.0\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n }\n}\n"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -12,7 +12,28 @@ function $parcel$interopDefault(a) {
|
|
|
12
12
|
function $parcel$export(e, n, v, s) {
|
|
13
13
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
/*
|
|
16
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
17
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
18
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
19
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
20
|
+
*
|
|
21
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
22
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
23
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
24
|
+
* governing permissions and limitations under the License.
|
|
25
|
+
*/ /// <reference types="css-module-types" />
|
|
26
|
+
/*
|
|
27
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
28
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
29
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
30
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
31
|
+
*
|
|
32
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
33
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
34
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
35
|
+
* governing permissions and limitations under the License.
|
|
36
|
+
*/
|
|
16
37
|
|
|
17
38
|
|
|
18
39
|
|
|
@@ -38,33 +59,43 @@ $5cac98e4c80e6707$export$a30bf7810c8453d1 = "spectrum-Body_2a241c";
|
|
|
38
59
|
$5cac98e4c80e6707$export$7b2dac1166f6ec4c = "spectrum-Body--italic_2a241c";
|
|
39
60
|
|
|
40
61
|
|
|
41
|
-
|
|
62
|
+
/*
|
|
63
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
64
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
65
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
66
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
67
|
+
*
|
|
68
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
69
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
70
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
71
|
+
* governing permissions and limitations under the License.
|
|
72
|
+
*/
|
|
42
73
|
function $d8453c5ae7fac713$export$6343629ee1b29116(theme, defaultColorScheme) {
|
|
43
|
-
let matchesDark = $b6ncI$useMediaQuery(
|
|
44
|
-
let matchesLight = $b6ncI$useMediaQuery(
|
|
74
|
+
let matchesDark = (0, $b6ncI$useMediaQuery)("(prefers-color-scheme: dark)");
|
|
75
|
+
let matchesLight = (0, $b6ncI$useMediaQuery)("(prefers-color-scheme: light)");
|
|
45
76
|
// importance OS > default > omitted
|
|
46
|
-
if (theme.dark && matchesDark) return
|
|
47
|
-
if (theme.light && matchesLight) return
|
|
48
|
-
if (theme.dark && defaultColorScheme ===
|
|
49
|
-
if (theme.light && defaultColorScheme ===
|
|
50
|
-
if (!theme.dark) return
|
|
51
|
-
if (!theme.light) return
|
|
52
|
-
return
|
|
77
|
+
if (theme.dark && matchesDark) return "dark";
|
|
78
|
+
if (theme.light && matchesLight) return "light";
|
|
79
|
+
if (theme.dark && defaultColorScheme === "dark") return "dark";
|
|
80
|
+
if (theme.light && defaultColorScheme === "light") return "light";
|
|
81
|
+
if (!theme.dark) return "light";
|
|
82
|
+
if (!theme.light) return "dark";
|
|
83
|
+
return "light";
|
|
53
84
|
}
|
|
54
85
|
function $d8453c5ae7fac713$export$a8d2043b2d807f4d(theme) {
|
|
55
|
-
let matchesFine = $b6ncI$useMediaQuery(
|
|
56
|
-
if (matchesFine && theme.medium) return
|
|
57
|
-
if (theme.large) return
|
|
58
|
-
return
|
|
86
|
+
let matchesFine = (0, $b6ncI$useMediaQuery)("(any-pointer: fine)");
|
|
87
|
+
if (matchesFine && theme.medium) return "medium";
|
|
88
|
+
if (theme.large) return "large";
|
|
89
|
+
return "medium";
|
|
59
90
|
}
|
|
60
91
|
|
|
61
92
|
|
|
62
93
|
var $7b22e09dddddd7da$exports = {};
|
|
63
|
-
$7b22e09dddddd7da$exports = JSON.parse(
|
|
94
|
+
$7b22e09dddddd7da$exports = JSON.parse('{"name":"@react-spectrum/provider","version":"3.6.1","description":"Spectrum UI components in React","license":"Apache-2.0","main":"dist/main.js","module":"dist/module.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.6.3","@react-aria/overlays":"^3.12.1","@react-aria/utils":"^3.14.2","@react-spectrum/utils":"^3.8.1","@react-types/provider":"^3.5.5","@react-types/shared":"^3.16.0","@swc/helpers":"^0.4.14","clsx":"^1.1.1"},"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"}}');
|
|
64
95
|
|
|
65
96
|
|
|
66
|
-
const $7167f8da3cce35e4$var$Context = /*#__PURE__*/ $b6ncI$react.createContext(null);
|
|
67
|
-
$7167f8da3cce35e4$var$Context.displayName =
|
|
97
|
+
const $7167f8da3cce35e4$var$Context = /*#__PURE__*/ (0, $b6ncI$react).createContext(null);
|
|
98
|
+
$7167f8da3cce35e4$var$Context.displayName = "ProviderContext";
|
|
68
99
|
const $7167f8da3cce35e4$var$DEFAULT_BREAKPOINTS = {
|
|
69
100
|
S: 640,
|
|
70
101
|
M: 768,
|
|
@@ -77,11 +108,11 @@ function $7167f8da3cce35e4$var$Provider(props, ref) {
|
|
|
77
108
|
let prevColorScheme = prevContext && prevContext.colorScheme;
|
|
78
109
|
let prevBreakpoints = prevContext && prevContext.breakpoints;
|
|
79
110
|
let { theme: theme = prevContext && prevContext.theme , defaultColorScheme: defaultColorScheme } = props;
|
|
80
|
-
if (!theme) throw new Error(
|
|
111
|
+
if (!theme) throw new Error("theme not found, the parent provider must have a theme provided");
|
|
81
112
|
// Hooks must always be called.
|
|
82
|
-
let autoColorScheme = $d8453c5ae7fac713$export$6343629ee1b29116(theme, defaultColorScheme);
|
|
83
|
-
let autoScale = $d8453c5ae7fac713$export$a8d2043b2d807f4d(theme);
|
|
84
|
-
let { locale: prevLocale } = $b6ncI$useLocale();
|
|
113
|
+
let autoColorScheme = (0, $d8453c5ae7fac713$export$6343629ee1b29116)(theme, defaultColorScheme);
|
|
114
|
+
let autoScale = (0, $d8453c5ae7fac713$export$a8d2043b2d807f4d)(theme);
|
|
115
|
+
let { locale: prevLocale } = (0, $b6ncI$useLocale)();
|
|
85
116
|
// if the new theme doesn't support the prevColorScheme, we must resort to the auto
|
|
86
117
|
let usePrevColorScheme = !!theme[prevColorScheme];
|
|
87
118
|
// importance of color scheme props > parent > auto:(OS > default > omitted)
|
|
@@ -100,69 +131,65 @@ function $7167f8da3cce35e4$var$Provider(props, ref) {
|
|
|
100
131
|
isReadOnly: isReadOnly,
|
|
101
132
|
validationState: validationState
|
|
102
133
|
};
|
|
103
|
-
let matchedBreakpoints = $b6ncI$useMatchedBreakpoints(breakpoints);
|
|
104
|
-
let filteredProps = {
|
|
105
|
-
|
|
106
|
-
Object.entries(currentProps).forEach(([key, value])=>value !== undefined && (filteredProps[key] = value)
|
|
107
|
-
);
|
|
134
|
+
let matchedBreakpoints = (0, $b6ncI$useMatchedBreakpoints)(breakpoints);
|
|
135
|
+
let filteredProps = {};
|
|
136
|
+
Object.entries(currentProps).forEach(([key, value])=>value !== undefined && (filteredProps[key] = value));
|
|
108
137
|
// Merge options with parent provider
|
|
109
|
-
let context = Object.assign({
|
|
110
|
-
}, prevContext, filteredProps);
|
|
138
|
+
let context = Object.assign({}, prevContext, filteredProps);
|
|
111
139
|
// Only wrap in a DOM node if the theme, colorScheme, or scale changed
|
|
112
140
|
let contents = children;
|
|
113
|
-
let domProps = $b6ncI$filterDOMProps(otherProps);
|
|
114
|
-
let { styleProps: styleProps } = $b6ncI$useStyleProps(otherProps, undefined, {
|
|
141
|
+
let domProps = (0, $b6ncI$filterDOMProps)(otherProps);
|
|
142
|
+
let { styleProps: styleProps } = (0, $b6ncI$useStyleProps)(otherProps, undefined, {
|
|
115
143
|
matchedBreakpoints: matchedBreakpoints
|
|
116
144
|
});
|
|
117
|
-
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__*/ $b6ncI$react.createElement($7167f8da3cce35e4$var$ProviderWrapper, {
|
|
145
|
+
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, $b6ncI$react).createElement($7167f8da3cce35e4$var$ProviderWrapper, {
|
|
118
146
|
...props,
|
|
119
147
|
UNSAFE_style: {
|
|
120
|
-
isolation: !prevContext ?
|
|
148
|
+
isolation: !prevContext ? "isolate" : undefined,
|
|
121
149
|
...styleProps.style
|
|
122
150
|
},
|
|
123
151
|
ref: ref
|
|
124
152
|
}, contents);
|
|
125
|
-
return
|
|
153
|
+
return /*#__PURE__*/ (0, $b6ncI$react).createElement($7167f8da3cce35e4$var$Context.Provider, {
|
|
126
154
|
value: context
|
|
127
|
-
}, /*#__PURE__*/ $b6ncI$react.createElement($b6ncI$I18nProvider, {
|
|
155
|
+
}, /*#__PURE__*/ (0, $b6ncI$react).createElement((0, $b6ncI$I18nProvider), {
|
|
128
156
|
locale: locale
|
|
129
|
-
}, /*#__PURE__*/ $b6ncI$react.createElement($b6ncI$BreakpointProvider, {
|
|
157
|
+
}, /*#__PURE__*/ (0, $b6ncI$react).createElement((0, $b6ncI$BreakpointProvider), {
|
|
130
158
|
matchedBreakpoints: matchedBreakpoints
|
|
131
|
-
}, /*#__PURE__*/ $b6ncI$react.createElement($b6ncI$ModalProvider, null, contents))))
|
|
159
|
+
}, /*#__PURE__*/ (0, $b6ncI$react).createElement((0, $b6ncI$ModalProvider), null, contents))));
|
|
132
160
|
}
|
|
133
161
|
/**
|
|
134
162
|
* Provider is the container for all React Spectrum applications.
|
|
135
163
|
* It defines the theme, locale, and other application level settings,
|
|
136
164
|
* and can also be used to provide common properties to a group of components.
|
|
137
|
-
*/ let $7167f8da3cce35e4$export$2881499e37b75b9a = /*#__PURE__*/ $b6ncI$react.forwardRef($7167f8da3cce35e4$var$Provider);
|
|
138
|
-
const $7167f8da3cce35e4$var$ProviderWrapper = /*#__PURE__*/ $b6ncI$react.forwardRef(function ProviderWrapper(props, ref) {
|
|
165
|
+
*/ let $7167f8da3cce35e4$export$2881499e37b75b9a = /*#__PURE__*/ (0, $b6ncI$react).forwardRef($7167f8da3cce35e4$var$Provider);
|
|
166
|
+
const $7167f8da3cce35e4$var$ProviderWrapper = /*#__PURE__*/ (0, $b6ncI$react).forwardRef(function ProviderWrapper(props, ref) {
|
|
139
167
|
let { children: children , ...otherProps } = props;
|
|
140
|
-
let { locale: locale , direction: direction } = $b6ncI$useLocale();
|
|
168
|
+
let { locale: locale , direction: direction } = (0, $b6ncI$useLocale)();
|
|
141
169
|
let { theme: theme , colorScheme: colorScheme , scale: scale } = $7167f8da3cce35e4$export$693cdb10cec23617();
|
|
142
|
-
let { modalProviderProps: modalProviderProps } = $b6ncI$useModalProvider();
|
|
143
|
-
let { styleProps: styleProps } = $b6ncI$useStyleProps(otherProps);
|
|
144
|
-
let domRef = $b6ncI$useDOMRef(ref);
|
|
170
|
+
let { modalProviderProps: modalProviderProps } = (0, $b6ncI$useModalProvider)();
|
|
171
|
+
let { styleProps: styleProps } = (0, $b6ncI$useStyleProps)(otherProps);
|
|
172
|
+
let domRef = (0, $b6ncI$useDOMRef)(ref);
|
|
145
173
|
let themeKey = Object.keys(theme[colorScheme])[0];
|
|
146
174
|
let scaleKey = Object.keys(theme[scale])[0];
|
|
147
|
-
let className = $b6ncI$clsx(styleProps.className, (/*@__PURE__*/$parcel$interopDefault($698974e9dd92c2ec$exports))[
|
|
148
|
-
|
|
149
|
-
spectrum: $b6ncI$shouldKeepSpectrumClassNames,
|
|
150
|
-
[themeKey]: $b6ncI$shouldKeepSpectrumClassNames,
|
|
151
|
-
[scaleKey]: $b6ncI$shouldKeepSpectrumClassNames
|
|
175
|
+
let className = (0, $b6ncI$clsx)(styleProps.className, (0, (/*@__PURE__*/$parcel$interopDefault($698974e9dd92c2ec$exports)))["spectrum"], (0, (/*@__PURE__*/$parcel$interopDefault($5cac98e4c80e6707$exports)))["spectrum"], Object.values(theme[colorScheme]), Object.values(theme[scale]), theme.global ? Object.values(theme.global) : null, {
|
|
176
|
+
"react-spectrum-provider": (0, $b6ncI$shouldKeepSpectrumClassNames),
|
|
177
|
+
spectrum: (0, $b6ncI$shouldKeepSpectrumClassNames),
|
|
178
|
+
[themeKey]: (0, $b6ncI$shouldKeepSpectrumClassNames),
|
|
179
|
+
[scaleKey]: (0, $b6ncI$shouldKeepSpectrumClassNames)
|
|
152
180
|
});
|
|
153
|
-
var
|
|
181
|
+
var _props_colorScheme, _ref;
|
|
154
182
|
let style = {
|
|
155
183
|
...styleProps.style,
|
|
156
184
|
// This ensures that browser native UI like scrollbars are rendered in the right color scheme.
|
|
157
185
|
// See https://web.dev/color-scheme/.
|
|
158
|
-
colorScheme: (
|
|
159
|
-
).join(' ')
|
|
186
|
+
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(" ")
|
|
160
187
|
};
|
|
161
|
-
let hasWarned = $b6ncI$useRef(false);
|
|
162
|
-
$b6ncI$useEffect(()=>{
|
|
188
|
+
let hasWarned = (0, $b6ncI$useRef)(false);
|
|
189
|
+
(0, $b6ncI$useEffect)(()=>{
|
|
163
190
|
if (direction && domRef.current) {
|
|
164
|
-
let closestDir = domRef.current.parentElement.closest(
|
|
165
|
-
let dir = closestDir && closestDir.getAttribute(
|
|
191
|
+
let closestDir = domRef.current.parentElement.closest("[dir]");
|
|
192
|
+
let dir = closestDir && closestDir.getAttribute("dir");
|
|
166
193
|
if (dir && dir !== direction && !hasWarned.current) {
|
|
167
194
|
console.warn(`Language directions cannot be nested. ${direction} inside ${dir}.`);
|
|
168
195
|
hasWarned.current = true;
|
|
@@ -173,8 +200,8 @@ const $7167f8da3cce35e4$var$ProviderWrapper = /*#__PURE__*/ $b6ncI$react.forward
|
|
|
173
200
|
domRef,
|
|
174
201
|
hasWarned
|
|
175
202
|
]);
|
|
176
|
-
return
|
|
177
|
-
|
|
203
|
+
return /*#__PURE__*/ (0, $b6ncI$react).createElement("div", {
|
|
204
|
+
...(0, $b6ncI$filterDOMProps)(otherProps),
|
|
178
205
|
...styleProps,
|
|
179
206
|
...modalProviderProps,
|
|
180
207
|
className: className,
|
|
@@ -182,16 +209,15 @@ const $7167f8da3cce35e4$var$ProviderWrapper = /*#__PURE__*/ $b6ncI$react.forward
|
|
|
182
209
|
lang: locale,
|
|
183
210
|
dir: direction,
|
|
184
211
|
ref: domRef
|
|
185
|
-
}, children)
|
|
212
|
+
}, children);
|
|
186
213
|
});
|
|
187
214
|
function $7167f8da3cce35e4$export$693cdb10cec23617() {
|
|
188
|
-
return $b6ncI$useContext($7167f8da3cce35e4$var$Context);
|
|
215
|
+
return (0, $b6ncI$useContext)($7167f8da3cce35e4$var$Context);
|
|
189
216
|
}
|
|
190
217
|
function $7167f8da3cce35e4$export$521c373ccc32c300(props) {
|
|
191
218
|
let context = $7167f8da3cce35e4$export$693cdb10cec23617();
|
|
192
219
|
if (!context) return props;
|
|
193
|
-
return Object.assign({
|
|
194
|
-
}, {
|
|
220
|
+
return Object.assign({}, {
|
|
195
221
|
isQuiet: context.isQuiet,
|
|
196
222
|
isEmphasized: context.isEmphasized,
|
|
197
223
|
isDisabled: context.isDisabled,
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;AEAA,GAA0B;AAA1B,yCAA0B,GAAG,CAAiB;;;;;;;;ACA9C,GAA0B;AAC1B,GAA+B;AAC/B,GAAuC;AAFvC,yCAA0B,GAAG,CAAiB;AAC9C,yCAA+B,GAAG,CAAsB;AACxD,yCAAuC,GAAG,CAA8B;;;;SCcxD,yCAAc,CAAC,KAAY,EAAE,kBAA+B,EAAe,CAAC;IAC1F,GAAG,CAAC,WAAW,GAAG,oBAAa,CAAC,CAA8B;IAC9D,GAAG,CAAC,YAAY,GAAG,oBAAa,CAAC,CAA+B;I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CAAW,GAAoB,CAAC;IAC9C,MAAM,CAAC,iBAAU,CAAC,6BAAO;AAC3B,CAAC;SAEe,yCAAgB,CAAI,KAAQ,EAAM,CAAC;IACjD,GAAG,CAAC,OAAO,GAAG,yCAAW;IACzB,EAAE,GAAG,OAAO,EACV,MAAM,CAAC,KAAK;IAEd,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAAA,CAAC,EAAE,CAAC;QACxB,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,YAAY,EAAE,OAAO,CAAC,YAAY;QAClC,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,eAAe,EAAE,OAAO,CAAC,eAAe;IAC1C,CAAC,EAAE,KAAK;AACV,CAAC","sources":["packages/@react-spectrum/provider/src/index.ts","packages/@react-spectrum/provider/src/Provider.tsx","packages/@adobe/spectrum-css-temp/components/page/vars.css","packages/@adobe/spectrum-css-temp/components/typography/index.css","packages/@react-spectrum/provider/src/mediaQueries.ts","packages/@react-spectrum/provider/package.json"],"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\n/// <reference types=\"css-module-types\" />\n\nexport {Provider, useProvider, useProviderProps} from './Provider';\nexport type {ProviderContext} from '@react-types/provider';\nexport type {ProviderProps} from '@react-types/provider';\n","/*\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 {\n BreakpointProvider,\n shouldKeepSpectrumClassNames,\n useDOMRef,\n useMatchedBreakpoints,\n useStyleProps\n} from '@react-spectrum/utils';\nimport clsx from 'clsx';\nimport {DOMRef} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {I18nProvider, useLocale} from '@react-aria/i18n';\nimport {ModalProvider, useModalProvider} from '@react-aria/overlays';\nimport {ProviderContext, ProviderProps} from '@react-types/provider';\nimport React, {useContext, useEffect, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/page/vars.css';\nimport typographyStyles from '@adobe/spectrum-css-temp/components/typography/index.css';\nimport {useColorScheme, useScale} from './mediaQueries';\n// @ts-ignore\nimport {version} from '../package.json';\n\nconst Context = React.createContext<ProviderContext | null>(null);\nContext.displayName = 'ProviderContext';\n\nconst DEFAULT_BREAKPOINTS = {S: 640, M: 768, L: 1024, XL: 1280, XXL: 1536};\n\nfunction Provider(props: ProviderProps, ref: DOMRef<HTMLDivElement>) {\n let prevContext = useProvider();\n let prevColorScheme = prevContext && prevContext.colorScheme;\n let prevBreakpoints = prevContext && prevContext.breakpoints;\n let {\n theme = prevContext && prevContext.theme,\n defaultColorScheme\n } = props;\n if (!theme) {\n throw new Error('theme not found, the parent provider must have a theme provided');\n }\n // Hooks must always be called.\n let autoColorScheme = useColorScheme(theme, defaultColorScheme);\n let autoScale = useScale(theme);\n let {locale: prevLocale} = useLocale();\n // if the new theme doesn't support the prevColorScheme, we must resort to the auto\n let usePrevColorScheme = !!theme[prevColorScheme];\n\n // importance of color scheme props > parent > auto:(OS > default > omitted)\n let {\n colorScheme = usePrevColorScheme ? prevColorScheme : autoColorScheme,\n scale = prevContext ? prevContext.scale : autoScale,\n locale = prevContext ? prevLocale : null,\n breakpoints = prevContext ? prevBreakpoints : DEFAULT_BREAKPOINTS,\n children,\n isQuiet,\n isEmphasized,\n isDisabled,\n isRequired,\n isReadOnly,\n validationState,\n ...otherProps\n } = props;\n\n // select only the props with values so undefined props don't overwrite prevContext values\n let currentProps = {\n version,\n theme,\n breakpoints,\n colorScheme,\n scale,\n isQuiet,\n isEmphasized,\n isDisabled,\n isRequired,\n isReadOnly,\n validationState\n };\n\n let matchedBreakpoints = useMatchedBreakpoints(breakpoints);\n let filteredProps = {};\n Object.entries(currentProps).forEach(([key, value]) => value !== undefined && (filteredProps[key] = value));\n\n // Merge options with parent provider\n let context = Object.assign({}, prevContext, filteredProps);\n\n // Only wrap in a DOM node if the theme, colorScheme, or scale changed\n let contents = children;\n let domProps = filterDOMProps(otherProps);\n let {styleProps} = useStyleProps(otherProps, undefined, {matchedBreakpoints});\n 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) {\n contents = (\n <ProviderWrapper {...props} UNSAFE_style={{isolation: !prevContext ? 'isolate' : undefined, ...styleProps.style}} ref={ref}>\n {contents}\n </ProviderWrapper>\n );\n }\n\n return (\n <Context.Provider value={context}>\n <I18nProvider locale={locale}>\n <BreakpointProvider matchedBreakpoints={matchedBreakpoints}>\n <ModalProvider>\n {contents}\n </ModalProvider>\n </BreakpointProvider>\n </I18nProvider>\n </Context.Provider>\n );\n}\n\n/**\n * Provider is the container for all React Spectrum applications.\n * It defines the theme, locale, and other application level settings,\n * and can also be used to provide common properties to a group of components.\n */\nlet _Provider = React.forwardRef(Provider);\nexport {_Provider as Provider};\n\nconst ProviderWrapper = React.forwardRef(function ProviderWrapper(props: ProviderProps, ref: DOMRef<HTMLDivElement>) {\n let {\n children,\n ...otherProps\n } = props;\n let {locale, direction} = useLocale();\n let {theme, colorScheme, scale} = useProvider();\n let {modalProviderProps} = useModalProvider();\n let {styleProps} = useStyleProps(otherProps);\n let domRef = useDOMRef(ref);\n\n let themeKey = Object.keys(theme[colorScheme])[0];\n let scaleKey = Object.keys(theme[scale])[0];\n\n let className = clsx(\n styleProps.className,\n styles['spectrum'],\n typographyStyles['spectrum'],\n theme[colorScheme][themeKey],\n theme[scale][scaleKey],\n theme.global ? Object.values(theme.global) : null,\n {\n 'react-spectrum-provider': shouldKeepSpectrumClassNames,\n spectrum: shouldKeepSpectrumClassNames,\n [themeKey]: shouldKeepSpectrumClassNames,\n [scaleKey]: shouldKeepSpectrumClassNames\n }\n );\n\n let style = {\n ...styleProps.style,\n // This ensures that browser native UI like scrollbars are rendered in the right color scheme.\n // See https://web.dev/color-scheme/.\n colorScheme: props.colorScheme ?? colorScheme ?? Object.keys(theme).filter(k => k === 'light' || k === 'dark').join(' ')\n };\n\n let hasWarned = useRef(false);\n useEffect(() => {\n if (direction && domRef.current) {\n let closestDir = domRef.current.parentElement.closest('[dir]');\n let dir = closestDir && closestDir.getAttribute('dir');\n if (dir && dir !== direction && !hasWarned.current) {\n console.warn(`Language directions cannot be nested. ${direction} inside ${dir}.`);\n hasWarned.current = true;\n }\n }\n }, [direction, domRef, hasWarned]);\n\n\n return (\n <div\n {...filterDOMProps(otherProps)}\n {...styleProps}\n {...modalProviderProps}\n className={className}\n style={style}\n lang={locale}\n dir={direction}\n ref={domRef}>\n {children}\n </div>\n );\n});\n\n/**\n * Returns the various settings and styles applied by the nearest parent Provider.\n * Properties explicitly set by the nearest parent Provider override those provided by preceeding Providers.\n */\nexport function useProvider(): ProviderContext {\n return useContext(Context);\n}\n\nexport function useProviderProps<T>(props: T) : T {\n let context = useProvider();\n if (!context) {\n return props;\n }\n return Object.assign({}, {\n isQuiet: context.isQuiet,\n isEmphasized: context.isEmphasized,\n isDisabled: context.isDisabled,\n isRequired: context.isRequired,\n isReadOnly: context.isReadOnly,\n validationState: context.validationState\n }, props);\n}\n","/*\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\n@import './index.css';\n@import './skin.css';\n","/*\nCopyright 2019 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\n@import '../commons/index.css';\n@import 'font.css';\n\n/*@mixin typography .spectrum-Body1 {}\n@mixin typography .spectrum-Body2 {}\n@mixin typography .spectrum-Body3 {}\n@mixin typography .spectrum-Body4 {}\n@mixin typography .spectrum-Body5 {}\n@mixin typography .spectrum-Heading1 {}\n@mixin typography .spectrum-Heading2 {}\n@mixin typography .spectrum-Heading3 {}\n@mixin typography .spectrum-Heading4 {}\n@mixin typography .spectrum-Heading5 {}\n@mixin typography .spectrum-Heading6 {}\n@mixin typography .spectrum-Subheading {}\n@mixin typography .spectrum-Detail {}\n@mixin typography .spectrum-Heading1--quiet, heading-quiet-1 {}\n@mixin typography .spectrum-Heading2--quiet, heading-quiet-2 {}\n@mixin typography .spectrum-Heading1--strong, heading-strong-1 {}\n@mixin typography .spectrum-Heading2--strong, heading-strong-2 {}\n@mixin typography .spectrum-Heading1--display, display-1 {}\n@mixin typography .spectrum-Heading2--display, display-2 {}\n@mixin typography .spectrum-Heading1--display.spectrum-Heading1--strong, display-strong-1 {}\n@mixin typography .spectrum-Heading2--display.spectrum-Heading2--strong, display-strong-2 {}\n@mixin typography .spectrum-Heading1--display.spectrum-Heading1--quiet, display-quiet-1 {}\n@mixin typography .spectrum-Heading2--display.spectrum-Heading2--quiet, display-quiet-2 {}\n\n.spectrum-Typography {\n @mixin typographyMargins .spectrum-Body1 {}\n @mixin typographyMargins .spectrum-Body2 {}\n @mixin typographyMargins .spectrum-Body3 {}\n @mixin typographyMargins .spectrum-Body4 {}\n @mixin typographyMargins .spectrum-Body5 {}\n @mixin typographyMargins .spectrum-Heading1 {}\n @mixin typographyMargins .spectrum-Heading2 {}\n @mixin typographyMargins .spectrum-Heading3 {}\n @mixin typographyMargins .spectrum-Heading4 {}\n @mixin typographyMargins .spectrum-Heading5 {}\n @mixin typographyMargins .spectrum-Heading6 {}\n @mixin typographyMargins .spectrum-Subheading {}\n @mixin typographyMargins .spectrum-Detail {}\n @mixin typographyMargins .spectrum-Heading1--quiet, heading-quiet-1 {}\n @mixin typographyMargins .spectrum-Heading2--quiet, heading-quiet-2 {}\n @mixin typographyMargins .spectrum-Heading1--strong, heading-strong-1 {}\n @mixin typographyMargins .spectrum-Heading2--strong, heading-strong-2 {}\n @mixin typographyMargins .spectrum-Heading1--display, display-1 {}\n @mixin typographyMargins .spectrum-Heading2--display, display-2 {}\n @mixin typographyMargins .spectrum-Heading1--display.spectrum-Heading1--strong, display-strong-1 {}\n @mixin typographyMargins .spectrum-Heading2--display.spectrum-Heading2--strong, display-strong-2 {}\n @mixin typographyMargins .spectrum-Heading1--display.spectrum-Heading1--quiet, display-quiet-1 {}\n @mixin typographyMargins .spectrum-Heading2--display.spectrum-Heading2--quiet, display-quiet-2 {}\n}\n\n.spectrum-Article {\n font-family: var(--spectrum-body-article-1-text-font-family);\n @mixin typography .spectrum-Body1, body-article-1 {}\n @mixin typography .spectrum-Body2, body-article-2 {}\n @mixin typography .spectrum-Body3, body-article-3 {}\n @mixin typography .spectrum-Body4, body-article-4 {}\n @mixin typography .spectrum-Body5, body-article-5 {}\n @mixin typography .spectrum-Heading1, heading-article-1 {}\n @mixin typography .spectrum-Heading2, heading-article-2 {}\n @mixin typography .spectrum-Heading3, heading-article-3 {}\n @mixin typography .spectrum-Heading4, heading-article-4 {}\n @mixin typography .spectrum-Heading5, heading-article-5 {}\n @mixin typography .spectrum-Heading6, heading-article-6 {}\n @mixin typography .spectrum-Subheading, subheading-article {}\n @mixin typography .spectrum-Detail, detail-article {}\n @mixin typography .spectrum-Heading1--quiet, heading-quiet-article-1 {}\n @mixin typography .spectrum-Heading2--quiet, heading-quiet-article-2 {}\n @mixin typography .spectrum-Heading1--display, display-article-1 {}\n @mixin typography .spectrum-Heading2--display, display-article-2 {}\n @mixin typography .spectrum-Heading1--display.spectrum-Heading1--quiet, display-quiet-article-1 {}\n @mixin typography .spectrum-Heading2--display.spectrum-Heading2--quiet, display-quiet-article-2 {}\n}\n.spectrum {\n &:lang(ja),\n &:lang(ko),\n &:lang(zh) {\n @mixin typography .spectrum-Body1, body-han-1 {}\n @mixin typography .spectrum-Body2, body-han-2 {}\n @mixin typography .spectrum-Body3, body-han-3 {}\n @mixin typography .spectrum-Body4, body-han-4 {}\n @mixin typography .spectrum-Body5, body-han-5 {}\n @mixin typography .spectrum-Heading1, heading-han-1 {}\n @mixin typography .spectrum-Heading2, heading-han-2 {}\n @mixin typography .spectrum-Heading3, heading-han-3 {}\n @mixin typography .spectrum-Heading4, heading-han-4 {}\n @mixin typography .spectrum-Heading5, heading-han-5 {}\n @mixin typography .spectrum-Heading6, heading-han-6 {}\n @mixin typography .spectrum-Subheading, subheading-han {}\n @mixin typography .spectrum-Detail, detail-han {}\n @mixin typography .spectrum-Heading1--quiet, heading-quiet-han-1 {}\n @mixin typography .spectrum-Heading2--quiet, heading-quiet-han-2 {}\n @mixin typography .spectrum-Heading1--strong, heading-strong-han-1 {}\n @mixin typography .spectrum-Heading2--strong, heading-strong-han-2 {}\n @mixin typography .spectrum-Heading1--display, display-han-1 {}\n @mixin typography .spectrum-Heading2--display, display-han-2 {}\n @mixin typography .spectrum-Heading1--display.spectrum-Heading1--strong, display-strong-han-1 {}\n @mixin typography .spectrum-Heading2--display.spectrum-Heading2--strong, display-strong-han-2 {}\n @mixin typography .spectrum-Heading1--display.spectrum-Heading1--quiet, display-quiet-han-1 {}\n @mixin typography .spectrum-Heading2--display.spectrum-Heading2--quiet, display-quiet-han-2 {}\n }\n}\n@mixin typography .spectrum-Code1, body-code-1, true {\n font-family: var(--spectrum-body-code-1-text-font-family);\n}\n@mixin typography .spectrum-Code2, body-code-2, true {\n font-family: var(--spectrum-body-code-2-text-font-family);\n}\n@mixin typography .spectrum-Code3, body-code-3, true {\n font-family: var(--spectrum-body-code-3-text-font-family);\n}\n@mixin typography .spectrum-Code4, body-code-4, true {\n font-family: var(--spectrum-body-code-4-text-font-family);\n}\n@mixin typography .spectrum-Code5, body-code-5, true {\n font-family: var(--spectrum-body-code-5-text-font-family);\n}*/\n\n/*\n The &.spectrum makes it so users can do <div class=\"spectrum spectrum--large\"> and still get the right font sizes\n Without this, they would have to do <div class=\"spectrum--large\"><div class=\"spectrum\">, which makes no sense\n*/\n&.spectrum,\n&.spectrum-Body,\n.spectrum,\n.spectrum-Body {\n font-size: var(--spectrum-body-4-text-size);\n font-weight: var(--spectrum-body-4-text-font-weight);\n line-height: var(--spectrum-body-4-text-line-height);\n font-style: var(--spectrum-body-4-text-font-style);\n}\n\n.spectrum-Body--italic {\n font-style: var(--spectrum-body-4-emphasis-text-font-style);\n}\n\n/*\n.spectrum-Body--large {\n @extend .spectrum-Body2;\n}\n\n.spectrum-Body--small {\n @extend .spectrum-Body5;\n}\n\n.spectrum-Body--secondary {\n @extend .spectrum-Body4;\n}\n\n.spectrum-Heading--display {\n @extend .spectrum-Heading2--display.spectrum-Heading2--quiet;\n}\n\n.spectrum-Heading--pageTitle {\n @extend .spectrum-Heading2--quiet;\n}\n\n.spectrum-Heading--subtitle1 {\n @extend .spectrum-Heading4;\n}\n\n.spectrum-Heading--subtitle2 {\n @extend .spectrum-Heading6;\n}\n\n.spectrum-Heading--subtitle3 {\n @extend .spectrum-Subheading;\n}*/\n","/*\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 {ColorScheme, Scale} from '@react-types/provider';\nimport {Theme} from '@react-types/provider';\nimport {useMediaQuery} from '@react-spectrum/utils';\n\nexport function useColorScheme(theme: Theme, defaultColorScheme: ColorScheme): ColorScheme {\n let matchesDark = useMediaQuery('(prefers-color-scheme: dark)');\n let matchesLight = useMediaQuery('(prefers-color-scheme: light)');\n\n // importance OS > default > omitted\n\n if (theme.dark && matchesDark) {\n return 'dark';\n }\n\n if (theme.light && matchesLight) {\n return 'light';\n }\n\n if (theme.dark && defaultColorScheme === 'dark') {\n return 'dark';\n }\n\n if (theme.light && defaultColorScheme === 'light') {\n return 'light';\n }\n\n if (!theme.dark) {\n return 'light';\n }\n\n if (!theme.light) {\n return 'dark';\n }\n\n return 'light';\n}\n\nexport function useScale(theme: Theme): Scale {\n let matchesFine = useMediaQuery('(any-pointer: fine)');\n if (matchesFine && theme.medium) {\n return 'medium';\n }\n\n if (theme.large) {\n return 'large';\n }\n\n return 'medium';\n}\n","{\n \"name\": \"@react-spectrum/provider\",\n \"version\": \"3.5.2\",\n \"description\": \"Spectrum UI components in React\",\n \"license\": \"Apache-2.0\",\n \"main\": \"dist/main.js\",\n \"module\": \"dist/module.js\",\n \"types\": \"dist/types.d.ts\",\n \"source\": \"src/index.ts\",\n \"files\": [\n \"dist\",\n \"src\"\n ],\n \"sideEffects\": [\n \"*.css\"\n ],\n \"targets\": {\n \"main\": {\n \"includeNodeModules\": [\n \"@adobe/spectrum-css-temp\"\n ]\n },\n \"module\": {\n \"includeNodeModules\": [\n \"@adobe/spectrum-css-temp\"\n ]\n }\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/adobe/react-spectrum\"\n },\n \"dependencies\": {\n \"@babel/runtime\": \"^7.6.2\",\n \"@react-aria/i18n\": \"^3.6.1\",\n \"@react-aria/overlays\": \"^3.11.0\",\n \"@react-aria/utils\": \"^3.14.0\",\n \"@react-spectrum/utils\": \"^3.7.4\",\n \"@react-types/provider\": \"^3.5.4\",\n \"@react-types/shared\": \"^3.15.0\",\n \"clsx\": \"^1.1.1\"\n },\n \"devDependencies\": {\n \"@adobe/spectrum-css-temp\": \"3.0.0-alpha.1\"\n },\n \"peerDependencies\": {\n \"react\": \"^16.8.0 || ^17.0.0-rc.1 || ^18.0.0\",\n \"react-dom\": \"^16.8.0 || ^17.0.0-rc.1 || ^18.0.0\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n }\n}\n"],"names":[],"version":3,"file":"module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC,GAED;;;;;;;;;ACZA,IAAA;AAAA,4CAA6B;;;;;;;;ACA7B,IAAA;AACA,IAAA;AACA,IAAA;AAFA,4CAA6B;AAC7B,4CAAkC;AAClC,4CAA0C;;;ACF1C;;;;;;;;;;CAUC,GAED;AAIO,SAAS,0CAAe,KAAY,EAAE,kBAA+B,EAAe;IACzF,IAAI,cAAc,CAAA,GAAA,oBAAY,EAAE;IAChC,IAAI,eAAe,CAAA,GAAA,oBAAY,EAAE;IAEjC,oCAAoC;IAEpC,IAAI,MAAM,IAAI,IAAI,aAChB,OAAO;IAGT,IAAI,MAAM,KAAK,IAAI,cACjB,OAAO;IAGT,IAAI,MAAM,IAAI,IAAI,uBAAuB,QACvC,OAAO;IAGT,IAAI,MAAM,KAAK,IAAI,uBAAuB,SACxC,OAAO;IAGT,IAAI,CA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OAAO,IAAI,CAAC,OAAO,MAAM,CAAC,CAAA,IAAK,MAAM,WAAW,MAAM,QAAQ,IAAI,CAAC,IAAI;IAC1H;IAEA,IAAI,YAAY,CAAA,GAAA,aAAK,EAAE,KAAK;IAC5B,CAAA,GAAA,gBAAS,AAAD,EAAE,IAAM;QACd,IAAI,aAAa,OAAO,OAAO,EAAE;YAC/B,IAAI,aAAa,OAAO,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC;YACtD,IAAI,MAAM,cAAc,WAAW,YAAY,CAAC;YAChD,IAAI,OAAO,QAAQ,aAAa,CAAC,UAAU,OAAO,EAAE;gBAClD,QAAQ,IAAI,CAAC,CAAC,sCAAsC,EAAE,UAAU,QAAQ,EAAE,IAAI,CAAC,CAAC;gBAChF,UAAU,OAAO,GAAG,IAAI;YAC1B,CAAC;QACH,CAAC;IACH,GAAG;QAAC;QAAW;QAAQ;KAAU;IAGjC,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,qBAAc,AAAD,EAAE,WAAW;QAC7B,GAAG,UAAU;QACb,GAAG,kBAAkB;QACtB,WAAW;QACX,OAAO;QACP,MAAM;QACN,KAAK;QACL,KAAK;OACJ;AAGP;AAMO,SAAS,4CAA+B;IAC7C,OAAO,CAAA,GAAA,iBAAS,EAAE;AACpB;AAEO,SAAS,0CAAoB,KAAQ,EAAM;IAChD,IAAI,UAAU;IACd,IAAI,CAAC,SACH,OAAO;IAET,OAAO,OAAO,MAAM,CAAC,CAAC,GAAG;QACvB,SAAS,QAAQ,OAAO;QACxB,cAAc,QAAQ,YAAY;QAClC,YAAY,QAAQ,UAAU;QAC9B,YAAY,QAAQ,UAAU;QAC9B,YAAY,QAAQ,UAAU;QAC9B,iBAAiB,QAAQ,eAAe;IAC1C,GAAG;AACL;;ADrMA","sources":["packages/@react-spectrum/provider/src/index.ts","packages/@react-spectrum/provider/src/Provider.tsx","packages/@adobe/spectrum-css-temp/components/page/vars.css","packages/@adobe/spectrum-css-temp/components/typography/index.css","packages/@react-spectrum/provider/src/mediaQueries.ts","packages/@react-spectrum/provider/package.json"],"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\n/// <reference types=\"css-module-types\" />\n\nexport {Provider, useProvider, useProviderProps} from './Provider';\nexport type {ProviderContext} from '@react-types/provider';\nexport type {ProviderProps} from '@react-types/provider';\n","/*\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 {\n BreakpointProvider,\n shouldKeepSpectrumClassNames,\n useDOMRef,\n useMatchedBreakpoints,\n useStyleProps\n} from '@react-spectrum/utils';\nimport clsx from 'clsx';\nimport {DOMRef} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {I18nProvider, useLocale} from '@react-aria/i18n';\nimport {ModalProvider, useModalProvider} from '@react-aria/overlays';\nimport {ProviderContext, ProviderProps} from '@react-types/provider';\nimport React, {useContext, useEffect, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/page/vars.css';\nimport typographyStyles from '@adobe/spectrum-css-temp/components/typography/index.css';\nimport {useColorScheme, useScale} from './mediaQueries';\n// @ts-ignore\nimport {version} from '../package.json';\n\nconst Context = React.createContext<ProviderContext | null>(null);\nContext.displayName = 'ProviderContext';\n\nconst DEFAULT_BREAKPOINTS = {S: 640, M: 768, L: 1024, XL: 1280, XXL: 1536};\n\nfunction Provider(props: ProviderProps, ref: DOMRef<HTMLDivElement>) {\n let prevContext = useProvider();\n let prevColorScheme = prevContext && prevContext.colorScheme;\n let prevBreakpoints = prevContext && prevContext.breakpoints;\n let {\n theme = prevContext && prevContext.theme,\n defaultColorScheme\n } = props;\n if (!theme) {\n throw new Error('theme not found, the parent provider must have a theme provided');\n }\n // Hooks must always be called.\n let autoColorScheme = useColorScheme(theme, defaultColorScheme);\n let autoScale = useScale(theme);\n let {locale: prevLocale} = useLocale();\n // if the new theme doesn't support the prevColorScheme, we must resort to the auto\n let usePrevColorScheme = !!theme[prevColorScheme];\n\n // importance of color scheme props > parent > auto:(OS > default > omitted)\n let {\n colorScheme = usePrevColorScheme ? prevColorScheme : autoColorScheme,\n scale = prevContext ? prevContext.scale : autoScale,\n locale = prevContext ? prevLocale : null,\n breakpoints = prevContext ? prevBreakpoints : DEFAULT_BREAKPOINTS,\n children,\n isQuiet,\n isEmphasized,\n isDisabled,\n isRequired,\n isReadOnly,\n validationState,\n ...otherProps\n } = props;\n\n // select only the props with values so undefined props don't overwrite prevContext values\n let currentProps = {\n version,\n theme,\n breakpoints,\n colorScheme,\n scale,\n isQuiet,\n isEmphasized,\n isDisabled,\n isRequired,\n isReadOnly,\n validationState\n };\n\n let matchedBreakpoints = useMatchedBreakpoints(breakpoints);\n let filteredProps = {};\n Object.entries(currentProps).forEach(([key, value]) => value !== undefined && (filteredProps[key] = value));\n\n // Merge options with parent provider\n let context = Object.assign({}, prevContext, filteredProps);\n\n // Only wrap in a DOM node if the theme, colorScheme, or scale changed\n let contents = children;\n let domProps = filterDOMProps(otherProps);\n let {styleProps} = useStyleProps(otherProps, undefined, {matchedBreakpoints});\n 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) {\n contents = (\n <ProviderWrapper {...props} UNSAFE_style={{isolation: !prevContext ? 'isolate' : undefined, ...styleProps.style}} ref={ref}>\n {contents}\n </ProviderWrapper>\n );\n }\n\n return (\n <Context.Provider value={context}>\n <I18nProvider locale={locale}>\n <BreakpointProvider matchedBreakpoints={matchedBreakpoints}>\n <ModalProvider>\n {contents}\n </ModalProvider>\n </BreakpointProvider>\n </I18nProvider>\n </Context.Provider>\n );\n}\n\n/**\n * Provider is the container for all React Spectrum applications.\n * It defines the theme, locale, and other application level settings,\n * and can also be used to provide common properties to a group of components.\n */\nlet _Provider = React.forwardRef(Provider);\nexport {_Provider as Provider};\n\nconst ProviderWrapper = React.forwardRef(function ProviderWrapper(props: ProviderProps, ref: DOMRef<HTMLDivElement>) {\n let {\n children,\n ...otherProps\n } = props;\n let {locale, direction} = useLocale();\n let {theme, colorScheme, scale} = useProvider();\n let {modalProviderProps} = useModalProvider();\n let {styleProps} = useStyleProps(otherProps);\n let domRef = useDOMRef(ref);\n\n let themeKey = Object.keys(theme[colorScheme])[0];\n let scaleKey = Object.keys(theme[scale])[0];\n\n let className = clsx(\n styleProps.className,\n styles['spectrum'],\n typographyStyles['spectrum'],\n Object.values(theme[colorScheme]),\n Object.values(theme[scale]),\n theme.global ? Object.values(theme.global) : null,\n {\n 'react-spectrum-provider': shouldKeepSpectrumClassNames,\n spectrum: shouldKeepSpectrumClassNames,\n [themeKey]: shouldKeepSpectrumClassNames,\n [scaleKey]: shouldKeepSpectrumClassNames\n }\n );\n\n let style = {\n ...styleProps.style,\n // This ensures that browser native UI like scrollbars are rendered in the right color scheme.\n // See https://web.dev/color-scheme/.\n colorScheme: props.colorScheme ?? colorScheme ?? Object.keys(theme).filter(k => k === 'light' || k === 'dark').join(' ')\n };\n\n let hasWarned = useRef(false);\n useEffect(() => {\n if (direction && domRef.current) {\n let closestDir = domRef.current.parentElement.closest('[dir]');\n let dir = closestDir && closestDir.getAttribute('dir');\n if (dir && dir !== direction && !hasWarned.current) {\n console.warn(`Language directions cannot be nested. ${direction} inside ${dir}.`);\n hasWarned.current = true;\n }\n }\n }, [direction, domRef, hasWarned]);\n\n\n return (\n <div\n {...filterDOMProps(otherProps)}\n {...styleProps}\n {...modalProviderProps}\n className={className}\n style={style}\n lang={locale}\n dir={direction}\n ref={domRef}>\n {children}\n </div>\n );\n});\n\n/**\n * Returns the various settings and styles applied by the nearest parent Provider.\n * Properties explicitly set by the nearest parent Provider override those provided by preceeding Providers.\n */\nexport function useProvider(): ProviderContext {\n return useContext(Context);\n}\n\nexport function useProviderProps<T>(props: T) : T {\n let context = useProvider();\n if (!context) {\n return props;\n }\n return Object.assign({}, {\n isQuiet: context.isQuiet,\n isEmphasized: context.isEmphasized,\n isDisabled: context.isDisabled,\n isRequired: context.isRequired,\n isReadOnly: context.isReadOnly,\n validationState: context.validationState\n }, props);\n}\n","/*\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\n@import './index.css';\n@import './skin.css';\n","/*\nCopyright 2019 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\n@import '../commons/index.css';\n@import 'font.css';\n\n/*@mixin typography .spectrum-Body1 {}\n@mixin typography .spectrum-Body2 {}\n@mixin typography .spectrum-Body3 {}\n@mixin typography .spectrum-Body4 {}\n@mixin typography .spectrum-Body5 {}\n@mixin typography .spectrum-Heading1 {}\n@mixin typography .spectrum-Heading2 {}\n@mixin typography .spectrum-Heading3 {}\n@mixin typography .spectrum-Heading4 {}\n@mixin typography .spectrum-Heading5 {}\n@mixin typography .spectrum-Heading6 {}\n@mixin typography .spectrum-Subheading {}\n@mixin typography .spectrum-Detail {}\n@mixin typography .spectrum-Heading1--quiet, heading-quiet-1 {}\n@mixin typography .spectrum-Heading2--quiet, heading-quiet-2 {}\n@mixin typography .spectrum-Heading1--strong, heading-strong-1 {}\n@mixin typography .spectrum-Heading2--strong, heading-strong-2 {}\n@mixin typography .spectrum-Heading1--display, display-1 {}\n@mixin typography .spectrum-Heading2--display, display-2 {}\n@mixin typography .spectrum-Heading1--display.spectrum-Heading1--strong, display-strong-1 {}\n@mixin typography .spectrum-Heading2--display.spectrum-Heading2--strong, display-strong-2 {}\n@mixin typography .spectrum-Heading1--display.spectrum-Heading1--quiet, display-quiet-1 {}\n@mixin typography .spectrum-Heading2--display.spectrum-Heading2--quiet, display-quiet-2 {}\n\n.spectrum-Typography {\n @mixin typographyMargins .spectrum-Body1 {}\n @mixin typographyMargins .spectrum-Body2 {}\n @mixin typographyMargins .spectrum-Body3 {}\n @mixin typographyMargins .spectrum-Body4 {}\n @mixin typographyMargins .spectrum-Body5 {}\n @mixin typographyMargins .spectrum-Heading1 {}\n @mixin typographyMargins .spectrum-Heading2 {}\n @mixin typographyMargins .spectrum-Heading3 {}\n @mixin typographyMargins .spectrum-Heading4 {}\n @mixin typographyMargins .spectrum-Heading5 {}\n @mixin typographyMargins .spectrum-Heading6 {}\n @mixin typographyMargins .spectrum-Subheading {}\n @mixin typographyMargins .spectrum-Detail {}\n @mixin typographyMargins .spectrum-Heading1--quiet, heading-quiet-1 {}\n @mixin typographyMargins .spectrum-Heading2--quiet, heading-quiet-2 {}\n @mixin typographyMargins .spectrum-Heading1--strong, heading-strong-1 {}\n @mixin typographyMargins .spectrum-Heading2--strong, heading-strong-2 {}\n @mixin typographyMargins .spectrum-Heading1--display, display-1 {}\n @mixin typographyMargins .spectrum-Heading2--display, display-2 {}\n @mixin typographyMargins .spectrum-Heading1--display.spectrum-Heading1--strong, display-strong-1 {}\n @mixin typographyMargins .spectrum-Heading2--display.spectrum-Heading2--strong, display-strong-2 {}\n @mixin typographyMargins .spectrum-Heading1--display.spectrum-Heading1--quiet, display-quiet-1 {}\n @mixin typographyMargins .spectrum-Heading2--display.spectrum-Heading2--quiet, display-quiet-2 {}\n}\n\n.spectrum-Article {\n font-family: var(--spectrum-body-article-1-text-font-family);\n @mixin typography .spectrum-Body1, body-article-1 {}\n @mixin typography .spectrum-Body2, body-article-2 {}\n @mixin typography .spectrum-Body3, body-article-3 {}\n @mixin typography .spectrum-Body4, body-article-4 {}\n @mixin typography .spectrum-Body5, body-article-5 {}\n @mixin typography .spectrum-Heading1, heading-article-1 {}\n @mixin typography .spectrum-Heading2, heading-article-2 {}\n @mixin typography .spectrum-Heading3, heading-article-3 {}\n @mixin typography .spectrum-Heading4, heading-article-4 {}\n @mixin typography .spectrum-Heading5, heading-article-5 {}\n @mixin typography .spectrum-Heading6, heading-article-6 {}\n @mixin typography .spectrum-Subheading, subheading-article {}\n @mixin typography .spectrum-Detail, detail-article {}\n @mixin typography .spectrum-Heading1--quiet, heading-quiet-article-1 {}\n @mixin typography .spectrum-Heading2--quiet, heading-quiet-article-2 {}\n @mixin typography .spectrum-Heading1--display, display-article-1 {}\n @mixin typography .spectrum-Heading2--display, display-article-2 {}\n @mixin typography .spectrum-Heading1--display.spectrum-Heading1--quiet, display-quiet-article-1 {}\n @mixin typography .spectrum-Heading2--display.spectrum-Heading2--quiet, display-quiet-article-2 {}\n}\n.spectrum {\n &:lang(ja),\n &:lang(ko),\n &:lang(zh) {\n @mixin typography .spectrum-Body1, body-han-1 {}\n @mixin typography .spectrum-Body2, body-han-2 {}\n @mixin typography .spectrum-Body3, body-han-3 {}\n @mixin typography .spectrum-Body4, body-han-4 {}\n @mixin typography .spectrum-Body5, body-han-5 {}\n @mixin typography .spectrum-Heading1, heading-han-1 {}\n @mixin typography .spectrum-Heading2, heading-han-2 {}\n @mixin typography .spectrum-Heading3, heading-han-3 {}\n @mixin typography .spectrum-Heading4, heading-han-4 {}\n @mixin typography .spectrum-Heading5, heading-han-5 {}\n @mixin typography .spectrum-Heading6, heading-han-6 {}\n @mixin typography .spectrum-Subheading, subheading-han {}\n @mixin typography .spectrum-Detail, detail-han {}\n @mixin typography .spectrum-Heading1--quiet, heading-quiet-han-1 {}\n @mixin typography .spectrum-Heading2--quiet, heading-quiet-han-2 {}\n @mixin typography .spectrum-Heading1--strong, heading-strong-han-1 {}\n @mixin typography .spectrum-Heading2--strong, heading-strong-han-2 {}\n @mixin typography .spectrum-Heading1--display, display-han-1 {}\n @mixin typography .spectrum-Heading2--display, display-han-2 {}\n @mixin typography .spectrum-Heading1--display.spectrum-Heading1--strong, display-strong-han-1 {}\n @mixin typography .spectrum-Heading2--display.spectrum-Heading2--strong, display-strong-han-2 {}\n @mixin typography .spectrum-Heading1--display.spectrum-Heading1--quiet, display-quiet-han-1 {}\n @mixin typography .spectrum-Heading2--display.spectrum-Heading2--quiet, display-quiet-han-2 {}\n }\n}\n@mixin typography .spectrum-Code1, body-code-1, true {\n font-family: var(--spectrum-body-code-1-text-font-family);\n}\n@mixin typography .spectrum-Code2, body-code-2, true {\n font-family: var(--spectrum-body-code-2-text-font-family);\n}\n@mixin typography .spectrum-Code3, body-code-3, true {\n font-family: var(--spectrum-body-code-3-text-font-family);\n}\n@mixin typography .spectrum-Code4, body-code-4, true {\n font-family: var(--spectrum-body-code-4-text-font-family);\n}\n@mixin typography .spectrum-Code5, body-code-5, true {\n font-family: var(--spectrum-body-code-5-text-font-family);\n}*/\n\n/*\n The &.spectrum makes it so users can do <div class=\"spectrum spectrum--large\"> and still get the right font sizes\n Without this, they would have to do <div class=\"spectrum--large\"><div class=\"spectrum\">, which makes no sense\n*/\n&.spectrum,\n&.spectrum-Body,\n.spectrum,\n.spectrum-Body {\n font-size: var(--spectrum-body-4-text-size);\n font-weight: var(--spectrum-body-4-text-font-weight);\n line-height: var(--spectrum-body-4-text-line-height);\n font-style: var(--spectrum-body-4-text-font-style);\n}\n\n.spectrum-Body--italic {\n font-style: var(--spectrum-body-4-emphasis-text-font-style);\n}\n\n/*\n.spectrum-Body--large {\n @extend .spectrum-Body2;\n}\n\n.spectrum-Body--small {\n @extend .spectrum-Body5;\n}\n\n.spectrum-Body--secondary {\n @extend .spectrum-Body4;\n}\n\n.spectrum-Heading--display {\n @extend .spectrum-Heading2--display.spectrum-Heading2--quiet;\n}\n\n.spectrum-Heading--pageTitle {\n @extend .spectrum-Heading2--quiet;\n}\n\n.spectrum-Heading--subtitle1 {\n @extend .spectrum-Heading4;\n}\n\n.spectrum-Heading--subtitle2 {\n @extend .spectrum-Heading6;\n}\n\n.spectrum-Heading--subtitle3 {\n @extend .spectrum-Subheading;\n}*/\n","/*\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 {ColorScheme, Scale} from '@react-types/provider';\nimport {Theme} from '@react-types/provider';\nimport {useMediaQuery} from '@react-spectrum/utils';\n\nexport function useColorScheme(theme: Theme, defaultColorScheme: ColorScheme): ColorScheme {\n let matchesDark = useMediaQuery('(prefers-color-scheme: dark)');\n let matchesLight = useMediaQuery('(prefers-color-scheme: light)');\n\n // importance OS > default > omitted\n\n if (theme.dark && matchesDark) {\n return 'dark';\n }\n\n if (theme.light && matchesLight) {\n return 'light';\n }\n\n if (theme.dark && defaultColorScheme === 'dark') {\n return 'dark';\n }\n\n if (theme.light && defaultColorScheme === 'light') {\n return 'light';\n }\n\n if (!theme.dark) {\n return 'light';\n }\n\n if (!theme.light) {\n return 'dark';\n }\n\n return 'light';\n}\n\nexport function useScale(theme: Theme): Scale {\n let matchesFine = useMediaQuery('(any-pointer: fine)');\n if (matchesFine && theme.medium) {\n return 'medium';\n }\n\n if (theme.large) {\n return 'large';\n }\n\n return 'medium';\n}\n","{\n \"name\": \"@react-spectrum/provider\",\n \"version\": \"3.6.1\",\n \"description\": \"Spectrum UI components in React\",\n \"license\": \"Apache-2.0\",\n \"main\": \"dist/main.js\",\n \"module\": \"dist/module.js\",\n \"types\": \"dist/types.d.ts\",\n \"source\": \"src/index.ts\",\n \"files\": [\n \"dist\",\n \"src\"\n ],\n \"sideEffects\": [\n \"*.css\"\n ],\n \"targets\": {\n \"main\": {\n \"includeNodeModules\": [\n \"@adobe/spectrum-css-temp\"\n ]\n },\n \"module\": {\n \"includeNodeModules\": [\n \"@adobe/spectrum-css-temp\"\n ]\n }\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/adobe/react-spectrum\"\n },\n \"dependencies\": {\n \"@react-aria/i18n\": \"^3.6.3\",\n \"@react-aria/overlays\": \"^3.12.1\",\n \"@react-aria/utils\": \"^3.14.2\",\n \"@react-spectrum/utils\": \"^3.8.1\",\n \"@react-types/provider\": \"^3.5.5\",\n \"@react-types/shared\": \"^3.16.0\",\n \"@swc/helpers\": \"^0.4.14\",\n \"clsx\": \"^1.1.1\"\n },\n \"devDependencies\": {\n \"@adobe/spectrum-css-temp\": \"3.0.0-alpha.1\"\n },\n \"peerDependencies\": {\n \"react\": \"^16.8.0 || ^17.0.0-rc.1 || ^18.0.0\",\n \"react-dom\": \"^16.8.0 || ^17.0.0-rc.1 || ^18.0.0\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n }\n}\n"],"names":[],"version":3,"file":"module.js.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/provider",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.1",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
"url": "https://github.com/adobe/react-spectrum"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@
|
|
35
|
-
"@react-aria/
|
|
36
|
-
"@react-aria/
|
|
37
|
-
"@react-
|
|
38
|
-
"@react-
|
|
39
|
-
"@react-types/
|
|
40
|
-
"@
|
|
34
|
+
"@react-aria/i18n": "^3.6.3",
|
|
35
|
+
"@react-aria/overlays": "^3.12.1",
|
|
36
|
+
"@react-aria/utils": "^3.14.2",
|
|
37
|
+
"@react-spectrum/utils": "^3.8.1",
|
|
38
|
+
"@react-types/provider": "^3.5.5",
|
|
39
|
+
"@react-types/shared": "^3.16.0",
|
|
40
|
+
"@swc/helpers": "^0.4.14",
|
|
41
41
|
"clsx": "^1.1.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "5480d76bd815e239366f92852c76b6831ad2a4fd"
|
|
54
54
|
}
|
package/src/Provider.tsx
CHANGED
|
@@ -142,8 +142,8 @@ const ProviderWrapper = React.forwardRef(function ProviderWrapper(props: Provide
|
|
|
142
142
|
styleProps.className,
|
|
143
143
|
styles['spectrum'],
|
|
144
144
|
typographyStyles['spectrum'],
|
|
145
|
-
theme[colorScheme]
|
|
146
|
-
theme[scale]
|
|
145
|
+
Object.values(theme[colorScheme]),
|
|
146
|
+
Object.values(theme[scale]),
|
|
147
147
|
theme.global ? Object.values(theme.global) : null,
|
|
148
148
|
{
|
|
149
149
|
'react-spectrum-provider': shouldKeepSpectrumClassNames,
|