@react-spectrum/provider 3.3.1 → 3.3.4
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 +70 -70
- package/dist/main.js.map +1 -1
- package/dist/module.js +70 -70
- package/dist/module.js.map +1 -1
- package/package.json +8 -8
package/dist/main.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
require("./main.css");
|
|
2
|
-
var $
|
|
3
|
-
var $
|
|
4
|
-
var $
|
|
5
|
-
var $
|
|
6
|
-
var $
|
|
7
|
-
var $
|
|
2
|
+
var $kmRpa$reactspectrumutils = require("@react-spectrum/utils");
|
|
3
|
+
var $kmRpa$clsx = require("clsx");
|
|
4
|
+
var $kmRpa$reactariautils = require("@react-aria/utils");
|
|
5
|
+
var $kmRpa$reactariai18n = require("@react-aria/i18n");
|
|
6
|
+
var $kmRpa$reactariaoverlays = require("@react-aria/overlays");
|
|
7
|
+
var $kmRpa$react = require("react");
|
|
8
8
|
|
|
9
9
|
function $parcel$exportWildcard(dest, source) {
|
|
10
10
|
Object.keys(source).forEach(function(key) {
|
|
@@ -28,41 +28,41 @@ function $parcel$interopDefault(a) {
|
|
|
28
28
|
function $parcel$export(e, n, v, s) {
|
|
29
29
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
30
30
|
}
|
|
31
|
-
var $
|
|
31
|
+
var $96cabdf5b0aed55b$exports = {};
|
|
32
32
|
|
|
33
|
-
$parcel$export($
|
|
34
|
-
$parcel$export($
|
|
35
|
-
$parcel$export($
|
|
33
|
+
$parcel$export($96cabdf5b0aed55b$exports, "useProvider", () => $96cabdf5b0aed55b$export$693cdb10cec23617);
|
|
34
|
+
$parcel$export($96cabdf5b0aed55b$exports, "Provider", () => $96cabdf5b0aed55b$export$2881499e37b75b9a);
|
|
35
|
+
$parcel$export($96cabdf5b0aed55b$exports, "useProviderProps", () => $96cabdf5b0aed55b$export$521c373ccc32c300);
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
var $
|
|
42
|
+
var $22365f0f5f2dcdd5$exports = {};
|
|
43
43
|
|
|
44
|
-
$parcel$export($
|
|
45
|
-
var $
|
|
46
|
-
$
|
|
44
|
+
$parcel$export($22365f0f5f2dcdd5$exports, "spectrum", () => $22365f0f5f2dcdd5$export$3311ab3a441bc141, (v) => $22365f0f5f2dcdd5$export$3311ab3a441bc141 = v);
|
|
45
|
+
var $22365f0f5f2dcdd5$export$3311ab3a441bc141;
|
|
46
|
+
$22365f0f5f2dcdd5$export$3311ab3a441bc141 = "spectrum_b37d53";
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
var $
|
|
49
|
+
var $19fbfce217006b12$exports = {};
|
|
50
50
|
|
|
51
|
-
$parcel$export($
|
|
52
|
-
$parcel$export($
|
|
53
|
-
$parcel$export($
|
|
54
|
-
var $
|
|
55
|
-
var $
|
|
56
|
-
var $
|
|
57
|
-
$
|
|
58
|
-
$
|
|
59
|
-
$
|
|
51
|
+
$parcel$export($19fbfce217006b12$exports, "spectrum", () => $19fbfce217006b12$export$3311ab3a441bc141, (v) => $19fbfce217006b12$export$3311ab3a441bc141 = v);
|
|
52
|
+
$parcel$export($19fbfce217006b12$exports, "spectrum-Body", () => $19fbfce217006b12$export$a30bf7810c8453d1, (v) => $19fbfce217006b12$export$a30bf7810c8453d1 = v);
|
|
53
|
+
$parcel$export($19fbfce217006b12$exports, "spectrum-Body--italic", () => $19fbfce217006b12$export$7b2dac1166f6ec4c, (v) => $19fbfce217006b12$export$7b2dac1166f6ec4c = v);
|
|
54
|
+
var $19fbfce217006b12$export$3311ab3a441bc141;
|
|
55
|
+
var $19fbfce217006b12$export$a30bf7810c8453d1;
|
|
56
|
+
var $19fbfce217006b12$export$7b2dac1166f6ec4c;
|
|
57
|
+
$19fbfce217006b12$export$3311ab3a441bc141 = "spectrum_2a241c";
|
|
58
|
+
$19fbfce217006b12$export$a30bf7810c8453d1 = "spectrum-Body_2a241c";
|
|
59
|
+
$19fbfce217006b12$export$7b2dac1166f6ec4c = "spectrum-Body--italic_2a241c";
|
|
60
60
|
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
function $
|
|
64
|
-
let matchesDark = $
|
|
65
|
-
let matchesLight = $
|
|
63
|
+
function $a6e2b5f4621e4690$export$6343629ee1b29116(theme, defaultColorScheme) {
|
|
64
|
+
let matchesDark = $kmRpa$reactspectrumutils.useMediaQuery('(prefers-color-scheme: dark)');
|
|
65
|
+
let matchesLight = $kmRpa$reactspectrumutils.useMediaQuery('(prefers-color-scheme: light)');
|
|
66
66
|
// importance OS > default > omitted
|
|
67
67
|
if (theme.dark && matchesDark) return 'dark';
|
|
68
68
|
if (theme.light && matchesLight) return 'light';
|
|
@@ -72,43 +72,43 @@ function $6aece5ef0da74ae8$export$6343629ee1b29116(theme, defaultColorScheme) {
|
|
|
72
72
|
if (!theme.light) return 'dark';
|
|
73
73
|
return 'light';
|
|
74
74
|
}
|
|
75
|
-
function $
|
|
76
|
-
let matchesFine = $
|
|
75
|
+
function $a6e2b5f4621e4690$export$a8d2043b2d807f4d(theme) {
|
|
76
|
+
let matchesFine = $kmRpa$reactspectrumutils.useMediaQuery('(any-pointer: fine)');
|
|
77
77
|
if (matchesFine && theme.medium) return 'medium';
|
|
78
78
|
if (theme.large) return 'large';
|
|
79
79
|
return 'medium';
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
|
|
83
|
-
var $
|
|
84
|
-
$
|
|
83
|
+
var $4db360e38265184f$exports = {};
|
|
84
|
+
$4db360e38265184f$exports = JSON.parse("{\"name\":\"@react-spectrum/provider\",\"version\":\"3.3.4\",\"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\":{\"@babel/runtime\":\"^7.6.2\",\"@react-aria/i18n\":\"^3.3.9\",\"@react-aria/overlays\":\"^3.8.2\",\"@react-aria/utils\":\"^3.12.0\",\"@react-spectrum/utils\":\"^3.6.8\",\"@react-types/provider\":\"^3.4.3\",\"@react-types/shared\":\"^3.12.0\",\"clsx\":\"^1.1.1\"},\"devDependencies\":{\"@adobe/spectrum-css-temp\":\"3.0.0-alpha.1\"},\"peerDependencies\":{\"react\":\"^16.8.0 || ^17.0.0-rc.1\",\"react-dom\":\"^16.8.0 || ^17.0.0-rc.1\"},\"publishConfig\":{\"access\":\"public\"}}");
|
|
85
85
|
|
|
86
86
|
|
|
87
|
-
const $
|
|
88
|
-
$
|
|
89
|
-
const $
|
|
87
|
+
const $96cabdf5b0aed55b$var$Context = /*#__PURE__*/ ($parcel$interopDefault($kmRpa$react)).createContext(null);
|
|
88
|
+
$96cabdf5b0aed55b$var$Context.displayName = 'ProviderContext';
|
|
89
|
+
const $96cabdf5b0aed55b$var$DEFAULT_BREAKPOINTS = {
|
|
90
90
|
S: 640,
|
|
91
91
|
M: 768,
|
|
92
92
|
L: 1024,
|
|
93
93
|
XL: 1280,
|
|
94
94
|
XXL: 1536
|
|
95
95
|
};
|
|
96
|
-
function $
|
|
97
|
-
let prevContext = $
|
|
96
|
+
function $96cabdf5b0aed55b$var$Provider(props, ref) {
|
|
97
|
+
let prevContext = $96cabdf5b0aed55b$export$693cdb10cec23617();
|
|
98
98
|
let prevColorScheme = prevContext && prevContext.colorScheme;
|
|
99
99
|
let prevBreakpoints = prevContext && prevContext.breakpoints;
|
|
100
100
|
let { theme: theme = prevContext && prevContext.theme , defaultColorScheme: defaultColorScheme } = props;
|
|
101
101
|
// Hooks must always be called.
|
|
102
|
-
let autoColorScheme = $
|
|
103
|
-
let autoScale = $
|
|
104
|
-
let { locale: prevLocale } = $
|
|
102
|
+
let autoColorScheme = $a6e2b5f4621e4690$export$6343629ee1b29116(theme, defaultColorScheme);
|
|
103
|
+
let autoScale = $a6e2b5f4621e4690$export$a8d2043b2d807f4d(theme);
|
|
104
|
+
let { locale: prevLocale } = $kmRpa$reactariai18n.useLocale();
|
|
105
105
|
// if the new theme doesn't support the prevColorScheme, we must resort to the auto
|
|
106
106
|
let usePrevColorScheme = !!theme[prevColorScheme];
|
|
107
107
|
// importance of color scheme props > parent > auto:(OS > default > omitted)
|
|
108
|
-
let { colorScheme: colorScheme = usePrevColorScheme ? prevColorScheme : autoColorScheme , scale: scale = prevContext ? prevContext.scale : autoScale , locale: locale = prevContext ? prevLocale : null , breakpoints: breakpoints = prevContext ? prevBreakpoints : $
|
|
108
|
+
let { colorScheme: colorScheme = usePrevColorScheme ? prevColorScheme : autoColorScheme , scale: scale = prevContext ? prevContext.scale : autoScale , locale: locale = prevContext ? prevLocale : null , breakpoints: breakpoints = prevContext ? prevBreakpoints : $96cabdf5b0aed55b$var$DEFAULT_BREAKPOINTS , children: children , isQuiet: isQuiet , isEmphasized: isEmphasized , isDisabled: isDisabled , isRequired: isRequired , isReadOnly: isReadOnly , validationState: validationState , ...otherProps } = props;
|
|
109
109
|
// select only the props with values so undefined props don't overwrite prevContext values
|
|
110
110
|
let currentProps = {
|
|
111
|
-
version: $
|
|
111
|
+
version: $4db360e38265184f$exports.version,
|
|
112
112
|
theme: theme,
|
|
113
113
|
breakpoints: breakpoints,
|
|
114
114
|
colorScheme: colorScheme,
|
|
@@ -120,7 +120,7 @@ function $462ab2d1d29a0dad$var$Provider(props, ref) {
|
|
|
120
120
|
isReadOnly: isReadOnly,
|
|
121
121
|
validationState: validationState
|
|
122
122
|
};
|
|
123
|
-
let matchedBreakpoints = $
|
|
123
|
+
let matchedBreakpoints = $kmRpa$reactspectrumutils.useMatchedBreakpoints(breakpoints);
|
|
124
124
|
let filteredProps = {
|
|
125
125
|
};
|
|
126
126
|
Object.entries(currentProps).forEach(([key, value])=>value !== undefined && (filteredProps[key] = value)
|
|
@@ -130,11 +130,11 @@ function $462ab2d1d29a0dad$var$Provider(props, ref) {
|
|
|
130
130
|
}, prevContext, filteredProps);
|
|
131
131
|
// Only wrap in a DOM node if the theme, colorScheme, or scale changed
|
|
132
132
|
let contents = children;
|
|
133
|
-
let domProps = $
|
|
134
|
-
let { styleProps: styleProps } = $
|
|
133
|
+
let domProps = $kmRpa$reactariautils.filterDOMProps(otherProps);
|
|
134
|
+
let { styleProps: styleProps } = $kmRpa$reactspectrumutils.useStyleProps(otherProps, undefined, {
|
|
135
135
|
matchedBreakpoints: matchedBreakpoints
|
|
136
136
|
});
|
|
137
|
-
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($
|
|
137
|
+
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, {
|
|
138
138
|
...props,
|
|
139
139
|
UNSAFE_style: {
|
|
140
140
|
isolation: !prevContext ? 'isolate' : undefined,
|
|
@@ -142,33 +142,33 @@ function $462ab2d1d29a0dad$var$Provider(props, ref) {
|
|
|
142
142
|
},
|
|
143
143
|
ref: ref
|
|
144
144
|
}, contents);
|
|
145
|
-
return(/*#__PURE__*/ ($parcel$interopDefault($
|
|
145
|
+
return(/*#__PURE__*/ ($parcel$interopDefault($kmRpa$react)).createElement($96cabdf5b0aed55b$var$Context.Provider, {
|
|
146
146
|
value: context
|
|
147
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($
|
|
147
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($kmRpa$react)).createElement($kmRpa$reactariai18n.I18nProvider, {
|
|
148
148
|
locale: locale
|
|
149
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($
|
|
149
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($kmRpa$react)).createElement($kmRpa$reactspectrumutils.BreakpointProvider, {
|
|
150
150
|
matchedBreakpoints: matchedBreakpoints
|
|
151
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($
|
|
151
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($kmRpa$react)).createElement($kmRpa$reactariaoverlays.ModalProvider, null, contents)))));
|
|
152
152
|
}
|
|
153
153
|
/**
|
|
154
154
|
* Provider is the container for all React Spectrum applications.
|
|
155
155
|
* It defines the theme, locale, and other application level settings,
|
|
156
156
|
* and can also be used to provide common properties to a group of components.
|
|
157
|
-
*/ let $
|
|
158
|
-
const $
|
|
157
|
+
*/ let $96cabdf5b0aed55b$export$2881499e37b75b9a = /*#__PURE__*/ ($parcel$interopDefault($kmRpa$react)).forwardRef($96cabdf5b0aed55b$var$Provider);
|
|
158
|
+
const $96cabdf5b0aed55b$var$ProviderWrapper = /*#__PURE__*/ ($parcel$interopDefault($kmRpa$react)).forwardRef(function ProviderWrapper(props, ref) {
|
|
159
159
|
let { children: children , ...otherProps } = props;
|
|
160
|
-
let { locale: locale , direction: direction } = $
|
|
161
|
-
let { theme: theme , colorScheme: colorScheme , scale: scale } = $
|
|
162
|
-
let { modalProviderProps: modalProviderProps } = $
|
|
163
|
-
let { styleProps: styleProps } = $
|
|
164
|
-
let domRef = $
|
|
160
|
+
let { locale: locale , direction: direction } = $kmRpa$reactariai18n.useLocale();
|
|
161
|
+
let { theme: theme , colorScheme: colorScheme , scale: scale } = $96cabdf5b0aed55b$export$693cdb10cec23617();
|
|
162
|
+
let { modalProviderProps: modalProviderProps } = $kmRpa$reactariaoverlays.useModalProvider();
|
|
163
|
+
let { styleProps: styleProps } = $kmRpa$reactspectrumutils.useStyleProps(otherProps);
|
|
164
|
+
let domRef = $kmRpa$reactspectrumutils.useDOMRef(ref);
|
|
165
165
|
let themeKey = Object.keys(theme[colorScheme])[0];
|
|
166
166
|
let scaleKey = Object.keys(theme[scale])[0];
|
|
167
|
-
let className = ($parcel$interopDefault($
|
|
168
|
-
'react-spectrum-provider': $
|
|
169
|
-
spectrum: $
|
|
170
|
-
[themeKey]: $
|
|
171
|
-
[scaleKey]: $
|
|
167
|
+
let className = ($parcel$interopDefault($kmRpa$clsx))(styleProps.className, (/*@__PURE__*/$parcel$interopDefault($22365f0f5f2dcdd5$exports))['spectrum'], (/*@__PURE__*/$parcel$interopDefault($19fbfce217006b12$exports))['spectrum'], theme[colorScheme][themeKey], theme[scale][scaleKey], theme.global ? Object.values(theme.global) : null, {
|
|
168
|
+
'react-spectrum-provider': $kmRpa$reactspectrumutils.shouldKeepSpectrumClassNames,
|
|
169
|
+
spectrum: $kmRpa$reactspectrumutils.shouldKeepSpectrumClassNames,
|
|
170
|
+
[themeKey]: $kmRpa$reactspectrumutils.shouldKeepSpectrumClassNames,
|
|
171
|
+
[scaleKey]: $kmRpa$reactspectrumutils.shouldKeepSpectrumClassNames
|
|
172
172
|
});
|
|
173
173
|
var _colorScheme, ref1;
|
|
174
174
|
let style = {
|
|
@@ -178,8 +178,8 @@ const $462ab2d1d29a0dad$var$ProviderWrapper = /*#__PURE__*/ ($parcel$interopDefa
|
|
|
178
178
|
colorScheme: (ref1 = (_colorScheme = props.colorScheme) !== null && _colorScheme !== void 0 ? _colorScheme : colorScheme) !== null && ref1 !== void 0 ? ref1 : Object.keys(theme).filter((k)=>k === 'light' || k === 'dark'
|
|
179
179
|
).join(' ')
|
|
180
180
|
};
|
|
181
|
-
let hasWarned = $
|
|
182
|
-
$
|
|
181
|
+
let hasWarned = $kmRpa$react.useRef(false);
|
|
182
|
+
$kmRpa$react.useEffect(()=>{
|
|
183
183
|
if (direction && domRef.current) {
|
|
184
184
|
let closestDir = domRef.current.parentElement.closest('[dir]');
|
|
185
185
|
let dir = closestDir && closestDir.getAttribute('dir');
|
|
@@ -193,8 +193,8 @@ const $462ab2d1d29a0dad$var$ProviderWrapper = /*#__PURE__*/ ($parcel$interopDefa
|
|
|
193
193
|
domRef,
|
|
194
194
|
hasWarned
|
|
195
195
|
]);
|
|
196
|
-
return(/*#__PURE__*/ ($parcel$interopDefault($
|
|
197
|
-
...$
|
|
196
|
+
return(/*#__PURE__*/ ($parcel$interopDefault($kmRpa$react)).createElement("div", {
|
|
197
|
+
...$kmRpa$reactariautils.filterDOMProps(otherProps),
|
|
198
198
|
...styleProps,
|
|
199
199
|
...modalProviderProps,
|
|
200
200
|
className: className,
|
|
@@ -204,11 +204,11 @@ const $462ab2d1d29a0dad$var$ProviderWrapper = /*#__PURE__*/ ($parcel$interopDefa
|
|
|
204
204
|
ref: domRef
|
|
205
205
|
}, children));
|
|
206
206
|
});
|
|
207
|
-
function $
|
|
208
|
-
return $
|
|
207
|
+
function $96cabdf5b0aed55b$export$693cdb10cec23617() {
|
|
208
|
+
return $kmRpa$react.useContext($96cabdf5b0aed55b$var$Context);
|
|
209
209
|
}
|
|
210
|
-
function $
|
|
211
|
-
let context = $
|
|
210
|
+
function $96cabdf5b0aed55b$export$521c373ccc32c300(props) {
|
|
211
|
+
let context = $96cabdf5b0aed55b$export$693cdb10cec23617();
|
|
212
212
|
if (!context) return props;
|
|
213
213
|
return Object.assign({
|
|
214
214
|
}, {
|
|
@@ -222,7 +222,7 @@ function $462ab2d1d29a0dad$export$521c373ccc32c300(props) {
|
|
|
222
222
|
}
|
|
223
223
|
|
|
224
224
|
|
|
225
|
-
$parcel$exportWildcard(module.exports, $
|
|
225
|
+
$parcel$exportWildcard(module.exports, $96cabdf5b0aed55b$exports);
|
|
226
226
|
|
|
227
227
|
|
|
228
228
|
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;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,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 * from './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 // 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.3.0\",\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.3.5\",\n \"@react-aria/overlays\": \"^3.7.4\",\n \"@react-aria/utils\": \"^3.11.1\",\n \"@react-spectrum/utils\": \"^3.6.4\",\n \"@react-types/provider\": \"^3.4.0\",\n \"@react-types/shared\": \"^3.11.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\",\n \"react-dom\": \"^16.8.0 || ^17.0.0-rc.1\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n }\n}\n"],"names":[],"version":3,"file":"main.js.map"}
|
|
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,uCAAa,CAAC,CAA8B;IAC9D,GAAG,CAAC,YAAY,GAAG,uCAAa,CAAC,CAA+B;IAEhE,EAAoC,AAApC,kC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I,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 * from './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 // 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.3.4\",\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.3.9\",\n \"@react-aria/overlays\": \"^3.8.2\",\n \"@react-aria/utils\": \"^3.12.0\",\n \"@react-spectrum/utils\": \"^3.6.8\",\n \"@react-types/provider\": \"^3.4.3\",\n \"@react-types/shared\": \"^3.12.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\",\n \"react-dom\": \"^16.8.0 || ^17.0.0-rc.1\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n }\n}\n"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "./main.css";
|
|
2
|
-
import {useMatchedBreakpoints as $
|
|
3
|
-
import $
|
|
4
|
-
import {filterDOMProps as $
|
|
5
|
-
import {useLocale as $
|
|
6
|
-
import {ModalProvider as $
|
|
7
|
-
import $
|
|
2
|
+
import {useMatchedBreakpoints as $b6ncI$useMatchedBreakpoints, useStyleProps as $b6ncI$useStyleProps, BreakpointProvider as $b6ncI$BreakpointProvider, useDOMRef as $b6ncI$useDOMRef, shouldKeepSpectrumClassNames as $b6ncI$shouldKeepSpectrumClassNames, useMediaQuery as $b6ncI$useMediaQuery} from "@react-spectrum/utils";
|
|
3
|
+
import $b6ncI$clsx from "clsx";
|
|
4
|
+
import {filterDOMProps as $b6ncI$filterDOMProps} from "@react-aria/utils";
|
|
5
|
+
import {useLocale as $b6ncI$useLocale, I18nProvider as $b6ncI$I18nProvider} from "@react-aria/i18n";
|
|
6
|
+
import {ModalProvider as $b6ncI$ModalProvider, useModalProvider as $b6ncI$useModalProvider} from "@react-aria/overlays";
|
|
7
|
+
import $b6ncI$react, {useRef as $b6ncI$useRef, useEffect as $b6ncI$useEffect, useContext as $b6ncI$useContext} from "react";
|
|
8
8
|
|
|
9
9
|
function $parcel$interopDefault(a) {
|
|
10
10
|
return a && a.__esModule ? a.default : a;
|
|
@@ -12,41 +12,41 @@ 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
|
-
var $
|
|
15
|
+
var $7167f8da3cce35e4$exports = {};
|
|
16
16
|
|
|
17
|
-
$parcel$export($
|
|
18
|
-
$parcel$export($
|
|
19
|
-
$parcel$export($
|
|
17
|
+
$parcel$export($7167f8da3cce35e4$exports, "useProvider", () => $7167f8da3cce35e4$export$693cdb10cec23617);
|
|
18
|
+
$parcel$export($7167f8da3cce35e4$exports, "Provider", () => $7167f8da3cce35e4$export$2881499e37b75b9a);
|
|
19
|
+
$parcel$export($7167f8da3cce35e4$exports, "useProviderProps", () => $7167f8da3cce35e4$export$521c373ccc32c300);
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var $
|
|
26
|
+
var $698974e9dd92c2ec$exports = {};
|
|
27
27
|
|
|
28
|
-
$parcel$export($
|
|
29
|
-
var $
|
|
30
|
-
$
|
|
28
|
+
$parcel$export($698974e9dd92c2ec$exports, "spectrum", () => $698974e9dd92c2ec$export$3311ab3a441bc141, (v) => $698974e9dd92c2ec$export$3311ab3a441bc141 = v);
|
|
29
|
+
var $698974e9dd92c2ec$export$3311ab3a441bc141;
|
|
30
|
+
$698974e9dd92c2ec$export$3311ab3a441bc141 = "spectrum_b37d53";
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
var $
|
|
33
|
+
var $5cac98e4c80e6707$exports = {};
|
|
34
34
|
|
|
35
|
-
$parcel$export($
|
|
36
|
-
$parcel$export($
|
|
37
|
-
$parcel$export($
|
|
38
|
-
var $
|
|
39
|
-
var $
|
|
40
|
-
var $
|
|
41
|
-
$
|
|
42
|
-
$
|
|
43
|
-
$
|
|
35
|
+
$parcel$export($5cac98e4c80e6707$exports, "spectrum", () => $5cac98e4c80e6707$export$3311ab3a441bc141, (v) => $5cac98e4c80e6707$export$3311ab3a441bc141 = v);
|
|
36
|
+
$parcel$export($5cac98e4c80e6707$exports, "spectrum-Body", () => $5cac98e4c80e6707$export$a30bf7810c8453d1, (v) => $5cac98e4c80e6707$export$a30bf7810c8453d1 = v);
|
|
37
|
+
$parcel$export($5cac98e4c80e6707$exports, "spectrum-Body--italic", () => $5cac98e4c80e6707$export$7b2dac1166f6ec4c, (v) => $5cac98e4c80e6707$export$7b2dac1166f6ec4c = v);
|
|
38
|
+
var $5cac98e4c80e6707$export$3311ab3a441bc141;
|
|
39
|
+
var $5cac98e4c80e6707$export$a30bf7810c8453d1;
|
|
40
|
+
var $5cac98e4c80e6707$export$7b2dac1166f6ec4c;
|
|
41
|
+
$5cac98e4c80e6707$export$3311ab3a441bc141 = "spectrum_2a241c";
|
|
42
|
+
$5cac98e4c80e6707$export$a30bf7810c8453d1 = "spectrum-Body_2a241c";
|
|
43
|
+
$5cac98e4c80e6707$export$7b2dac1166f6ec4c = "spectrum-Body--italic_2a241c";
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
|
|
47
|
-
function $
|
|
48
|
-
let matchesDark = $
|
|
49
|
-
let matchesLight = $
|
|
47
|
+
function $d8453c5ae7fac713$export$6343629ee1b29116(theme, defaultColorScheme) {
|
|
48
|
+
let matchesDark = $b6ncI$useMediaQuery('(prefers-color-scheme: dark)');
|
|
49
|
+
let matchesLight = $b6ncI$useMediaQuery('(prefers-color-scheme: light)');
|
|
50
50
|
// importance OS > default > omitted
|
|
51
51
|
if (theme.dark && matchesDark) return 'dark';
|
|
52
52
|
if (theme.light && matchesLight) return 'light';
|
|
@@ -56,43 +56,43 @@ function $c52cb170dc97a87d$export$6343629ee1b29116(theme, defaultColorScheme) {
|
|
|
56
56
|
if (!theme.light) return 'dark';
|
|
57
57
|
return 'light';
|
|
58
58
|
}
|
|
59
|
-
function $
|
|
60
|
-
let matchesFine = $
|
|
59
|
+
function $d8453c5ae7fac713$export$a8d2043b2d807f4d(theme) {
|
|
60
|
+
let matchesFine = $b6ncI$useMediaQuery('(any-pointer: fine)');
|
|
61
61
|
if (matchesFine && theme.medium) return 'medium';
|
|
62
62
|
if (theme.large) return 'large';
|
|
63
63
|
return 'medium';
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
|
|
67
|
-
var $
|
|
68
|
-
$
|
|
67
|
+
var $7b22e09dddddd7da$exports = {};
|
|
68
|
+
$7b22e09dddddd7da$exports = JSON.parse("{\"name\":\"@react-spectrum/provider\",\"version\":\"3.3.4\",\"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\":{\"@babel/runtime\":\"^7.6.2\",\"@react-aria/i18n\":\"^3.3.9\",\"@react-aria/overlays\":\"^3.8.2\",\"@react-aria/utils\":\"^3.12.0\",\"@react-spectrum/utils\":\"^3.6.8\",\"@react-types/provider\":\"^3.4.3\",\"@react-types/shared\":\"^3.12.0\",\"clsx\":\"^1.1.1\"},\"devDependencies\":{\"@adobe/spectrum-css-temp\":\"3.0.0-alpha.1\"},\"peerDependencies\":{\"react\":\"^16.8.0 || ^17.0.0-rc.1\",\"react-dom\":\"^16.8.0 || ^17.0.0-rc.1\"},\"publishConfig\":{\"access\":\"public\"}}");
|
|
69
69
|
|
|
70
70
|
|
|
71
|
-
const $
|
|
72
|
-
$
|
|
73
|
-
const $
|
|
71
|
+
const $7167f8da3cce35e4$var$Context = /*#__PURE__*/ $b6ncI$react.createContext(null);
|
|
72
|
+
$7167f8da3cce35e4$var$Context.displayName = 'ProviderContext';
|
|
73
|
+
const $7167f8da3cce35e4$var$DEFAULT_BREAKPOINTS = {
|
|
74
74
|
S: 640,
|
|
75
75
|
M: 768,
|
|
76
76
|
L: 1024,
|
|
77
77
|
XL: 1280,
|
|
78
78
|
XXL: 1536
|
|
79
79
|
};
|
|
80
|
-
function $
|
|
81
|
-
let prevContext = $
|
|
80
|
+
function $7167f8da3cce35e4$var$Provider(props, ref) {
|
|
81
|
+
let prevContext = $7167f8da3cce35e4$export$693cdb10cec23617();
|
|
82
82
|
let prevColorScheme = prevContext && prevContext.colorScheme;
|
|
83
83
|
let prevBreakpoints = prevContext && prevContext.breakpoints;
|
|
84
84
|
let { theme: theme = prevContext && prevContext.theme , defaultColorScheme: defaultColorScheme } = props;
|
|
85
85
|
// Hooks must always be called.
|
|
86
|
-
let autoColorScheme = $
|
|
87
|
-
let autoScale = $
|
|
88
|
-
let { locale: prevLocale } = $
|
|
86
|
+
let autoColorScheme = $d8453c5ae7fac713$export$6343629ee1b29116(theme, defaultColorScheme);
|
|
87
|
+
let autoScale = $d8453c5ae7fac713$export$a8d2043b2d807f4d(theme);
|
|
88
|
+
let { locale: prevLocale } = $b6ncI$useLocale();
|
|
89
89
|
// if the new theme doesn't support the prevColorScheme, we must resort to the auto
|
|
90
90
|
let usePrevColorScheme = !!theme[prevColorScheme];
|
|
91
91
|
// importance of color scheme props > parent > auto:(OS > default > omitted)
|
|
92
|
-
let { colorScheme: colorScheme = usePrevColorScheme ? prevColorScheme : autoColorScheme , scale: scale = prevContext ? prevContext.scale : autoScale , locale: locale = prevContext ? prevLocale : null , breakpoints: breakpoints = prevContext ? prevBreakpoints : $
|
|
92
|
+
let { colorScheme: colorScheme = usePrevColorScheme ? prevColorScheme : autoColorScheme , scale: scale = prevContext ? prevContext.scale : autoScale , locale: locale = prevContext ? prevLocale : null , breakpoints: breakpoints = prevContext ? prevBreakpoints : $7167f8da3cce35e4$var$DEFAULT_BREAKPOINTS , children: children , isQuiet: isQuiet , isEmphasized: isEmphasized , isDisabled: isDisabled , isRequired: isRequired , isReadOnly: isReadOnly , validationState: validationState , ...otherProps } = props;
|
|
93
93
|
// select only the props with values so undefined props don't overwrite prevContext values
|
|
94
94
|
let currentProps = {
|
|
95
|
-
version: $
|
|
95
|
+
version: $7b22e09dddddd7da$exports.version,
|
|
96
96
|
theme: theme,
|
|
97
97
|
breakpoints: breakpoints,
|
|
98
98
|
colorScheme: colorScheme,
|
|
@@ -104,7 +104,7 @@ function $58cbe3eb1d813e08$var$Provider(props, ref) {
|
|
|
104
104
|
isReadOnly: isReadOnly,
|
|
105
105
|
validationState: validationState
|
|
106
106
|
};
|
|
107
|
-
let matchedBreakpoints = $
|
|
107
|
+
let matchedBreakpoints = $b6ncI$useMatchedBreakpoints(breakpoints);
|
|
108
108
|
let filteredProps = {
|
|
109
109
|
};
|
|
110
110
|
Object.entries(currentProps).forEach(([key, value])=>value !== undefined && (filteredProps[key] = value)
|
|
@@ -114,11 +114,11 @@ function $58cbe3eb1d813e08$var$Provider(props, ref) {
|
|
|
114
114
|
}, prevContext, filteredProps);
|
|
115
115
|
// Only wrap in a DOM node if the theme, colorScheme, or scale changed
|
|
116
116
|
let contents = children;
|
|
117
|
-
let domProps = $
|
|
118
|
-
let { styleProps: styleProps } = $
|
|
117
|
+
let domProps = $b6ncI$filterDOMProps(otherProps);
|
|
118
|
+
let { styleProps: styleProps } = $b6ncI$useStyleProps(otherProps, undefined, {
|
|
119
119
|
matchedBreakpoints: matchedBreakpoints
|
|
120
120
|
});
|
|
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__*/ $
|
|
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__*/ $b6ncI$react.createElement($7167f8da3cce35e4$var$ProviderWrapper, {
|
|
122
122
|
...props,
|
|
123
123
|
UNSAFE_style: {
|
|
124
124
|
isolation: !prevContext ? 'isolate' : undefined,
|
|
@@ -126,33 +126,33 @@ function $58cbe3eb1d813e08$var$Provider(props, ref) {
|
|
|
126
126
|
},
|
|
127
127
|
ref: ref
|
|
128
128
|
}, contents);
|
|
129
|
-
return(/*#__PURE__*/ $
|
|
129
|
+
return(/*#__PURE__*/ $b6ncI$react.createElement($7167f8da3cce35e4$var$Context.Provider, {
|
|
130
130
|
value: context
|
|
131
|
-
}, /*#__PURE__*/ $
|
|
131
|
+
}, /*#__PURE__*/ $b6ncI$react.createElement($b6ncI$I18nProvider, {
|
|
132
132
|
locale: locale
|
|
133
|
-
}, /*#__PURE__*/ $
|
|
133
|
+
}, /*#__PURE__*/ $b6ncI$react.createElement($b6ncI$BreakpointProvider, {
|
|
134
134
|
matchedBreakpoints: matchedBreakpoints
|
|
135
|
-
}, /*#__PURE__*/ $
|
|
135
|
+
}, /*#__PURE__*/ $b6ncI$react.createElement($b6ncI$ModalProvider, null, contents)))));
|
|
136
136
|
}
|
|
137
137
|
/**
|
|
138
138
|
* Provider is the container for all React Spectrum applications.
|
|
139
139
|
* It defines the theme, locale, and other application level settings,
|
|
140
140
|
* and can also be used to provide common properties to a group of components.
|
|
141
|
-
*/ let $
|
|
142
|
-
const $
|
|
141
|
+
*/ let $7167f8da3cce35e4$export$2881499e37b75b9a = /*#__PURE__*/ $b6ncI$react.forwardRef($7167f8da3cce35e4$var$Provider);
|
|
142
|
+
const $7167f8da3cce35e4$var$ProviderWrapper = /*#__PURE__*/ $b6ncI$react.forwardRef(function ProviderWrapper(props, ref) {
|
|
143
143
|
let { children: children , ...otherProps } = props;
|
|
144
|
-
let { locale: locale , direction: direction } = $
|
|
145
|
-
let { theme: theme , colorScheme: colorScheme , scale: scale } = $
|
|
146
|
-
let { modalProviderProps: modalProviderProps } = $
|
|
147
|
-
let { styleProps: styleProps } = $
|
|
148
|
-
let domRef = $
|
|
144
|
+
let { locale: locale , direction: direction } = $b6ncI$useLocale();
|
|
145
|
+
let { theme: theme , colorScheme: colorScheme , scale: scale } = $7167f8da3cce35e4$export$693cdb10cec23617();
|
|
146
|
+
let { modalProviderProps: modalProviderProps } = $b6ncI$useModalProvider();
|
|
147
|
+
let { styleProps: styleProps } = $b6ncI$useStyleProps(otherProps);
|
|
148
|
+
let domRef = $b6ncI$useDOMRef(ref);
|
|
149
149
|
let themeKey = Object.keys(theme[colorScheme])[0];
|
|
150
150
|
let scaleKey = Object.keys(theme[scale])[0];
|
|
151
|
-
let className = $
|
|
152
|
-
'react-spectrum-provider': $
|
|
153
|
-
spectrum: $
|
|
154
|
-
[themeKey]: $
|
|
155
|
-
[scaleKey]: $
|
|
151
|
+
let className = $b6ncI$clsx(styleProps.className, (/*@__PURE__*/$parcel$interopDefault($698974e9dd92c2ec$exports))['spectrum'], (/*@__PURE__*/$parcel$interopDefault($5cac98e4c80e6707$exports))['spectrum'], theme[colorScheme][themeKey], theme[scale][scaleKey], theme.global ? Object.values(theme.global) : null, {
|
|
152
|
+
'react-spectrum-provider': $b6ncI$shouldKeepSpectrumClassNames,
|
|
153
|
+
spectrum: $b6ncI$shouldKeepSpectrumClassNames,
|
|
154
|
+
[themeKey]: $b6ncI$shouldKeepSpectrumClassNames,
|
|
155
|
+
[scaleKey]: $b6ncI$shouldKeepSpectrumClassNames
|
|
156
156
|
});
|
|
157
157
|
var _colorScheme, ref1;
|
|
158
158
|
let style = {
|
|
@@ -162,8 +162,8 @@ const $58cbe3eb1d813e08$var$ProviderWrapper = /*#__PURE__*/ $g69uj$react.forward
|
|
|
162
162
|
colorScheme: (ref1 = (_colorScheme = props.colorScheme) !== null && _colorScheme !== void 0 ? _colorScheme : colorScheme) !== null && ref1 !== void 0 ? ref1 : Object.keys(theme).filter((k)=>k === 'light' || k === 'dark'
|
|
163
163
|
).join(' ')
|
|
164
164
|
};
|
|
165
|
-
let hasWarned = $
|
|
166
|
-
$
|
|
165
|
+
let hasWarned = $b6ncI$useRef(false);
|
|
166
|
+
$b6ncI$useEffect(()=>{
|
|
167
167
|
if (direction && domRef.current) {
|
|
168
168
|
let closestDir = domRef.current.parentElement.closest('[dir]');
|
|
169
169
|
let dir = closestDir && closestDir.getAttribute('dir');
|
|
@@ -177,8 +177,8 @@ const $58cbe3eb1d813e08$var$ProviderWrapper = /*#__PURE__*/ $g69uj$react.forward
|
|
|
177
177
|
domRef,
|
|
178
178
|
hasWarned
|
|
179
179
|
]);
|
|
180
|
-
return(/*#__PURE__*/ $
|
|
181
|
-
...$
|
|
180
|
+
return(/*#__PURE__*/ $b6ncI$react.createElement("div", {
|
|
181
|
+
...$b6ncI$filterDOMProps(otherProps),
|
|
182
182
|
...styleProps,
|
|
183
183
|
...modalProviderProps,
|
|
184
184
|
className: className,
|
|
@@ -188,11 +188,11 @@ const $58cbe3eb1d813e08$var$ProviderWrapper = /*#__PURE__*/ $g69uj$react.forward
|
|
|
188
188
|
ref: domRef
|
|
189
189
|
}, children));
|
|
190
190
|
});
|
|
191
|
-
function $
|
|
192
|
-
return $
|
|
191
|
+
function $7167f8da3cce35e4$export$693cdb10cec23617() {
|
|
192
|
+
return $b6ncI$useContext($7167f8da3cce35e4$var$Context);
|
|
193
193
|
}
|
|
194
|
-
function $
|
|
195
|
-
let context = $
|
|
194
|
+
function $7167f8da3cce35e4$export$521c373ccc32c300(props) {
|
|
195
|
+
let context = $7167f8da3cce35e4$export$693cdb10cec23617();
|
|
196
196
|
if (!context) return props;
|
|
197
197
|
return Object.assign({
|
|
198
198
|
}, {
|
|
@@ -208,5 +208,5 @@ function $58cbe3eb1d813e08$export$521c373ccc32c300(props) {
|
|
|
208
208
|
|
|
209
209
|
|
|
210
210
|
|
|
211
|
-
export {$
|
|
211
|
+
export {$7167f8da3cce35e4$export$693cdb10cec23617 as useProvider, $7167f8da3cce35e4$export$2881499e37b75b9a as Provider, $7167f8da3cce35e4$export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,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,0CACH,CAAG;WACE,qBAAc,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,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 * from './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 // 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.3.0\",\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.3.5\",\n \"@react-aria/overlays\": \"^3.7.4\",\n \"@react-aria/utils\": \"^3.11.1\",\n \"@react-spectrum/utils\": \"^3.6.4\",\n \"@react-types/provider\": \"^3.4.0\",\n \"@react-types/shared\": \"^3.11.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\",\n \"react-dom\": \"^16.8.0 || ^17.0.0-rc.1\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n }\n}\n"],"names":[],"version":3,"file":"module.js.map"}
|
|
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,CAA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,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 * from './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 // 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.3.4\",\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.3.9\",\n \"@react-aria/overlays\": \"^3.8.2\",\n \"@react-aria/utils\": \"^3.12.0\",\n \"@react-spectrum/utils\": \"^3.6.8\",\n \"@react-types/provider\": \"^3.4.3\",\n \"@react-types/shared\": \"^3.12.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\",\n \"react-dom\": \"^16.8.0 || ^17.0.0-rc.1\"\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.
|
|
3
|
+
"version": "3.3.4",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.6.2",
|
|
35
|
-
"@react-aria/i18n": "^3.3.
|
|
36
|
-
"@react-aria/overlays": "^3.
|
|
37
|
-
"@react-aria/utils": "^3.
|
|
38
|
-
"@react-spectrum/utils": "^3.6.
|
|
39
|
-
"@react-types/provider": "^3.4.
|
|
40
|
-
"@react-types/shared": "^3.
|
|
35
|
+
"@react-aria/i18n": "^3.3.9",
|
|
36
|
+
"@react-aria/overlays": "^3.8.2",
|
|
37
|
+
"@react-aria/utils": "^3.12.0",
|
|
38
|
+
"@react-spectrum/utils": "^3.6.8",
|
|
39
|
+
"@react-types/provider": "^3.4.3",
|
|
40
|
+
"@react-types/shared": "^3.12.0",
|
|
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": "6a503b715e0dbbf92038cd7f08b1bcdde4c78e82"
|
|
54
54
|
}
|