@react-spectrum/provider 3.1.4 → 3.3.0

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.css CHANGED
@@ -1,2 +1 @@
1
- ._spectrum_d43d2{background-color:var(--spectrum-global-color-gray-100);-webkit-tap-highlight-color:rgba(0,0,0,0)}._spectrum_60105{font-family:adobe-clean-ux,adobe-clean,Source Sans Pro,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:var(--spectrum-global-dimension-font-size-100);color:var(--spectrum-global-color-gray-800)}._spectrum_60105:lang(ar){font-family:adobe-arabic,myriad-arabic,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}._spectrum_60105:lang(he){font-family:adobe-hebrew,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}._spectrum_60105:lang(zh),._spectrum_60105:lang(zh-Hans){font-family:adobe-clean-han-simplified-c,SimSun,Heiti SC Light,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}._spectrum_60105:lang(ko){font-family:adobe-clean-han-korean,Malgun Gothic,Apple Gothic,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}._spectrum_60105:lang(ja){font-family:adobe-clean-han-japanese,Yu Gothic,"\30E1 \30A4 \30EA \30AA","\30D2 \30E9 \30AE \30CE \89D2 \30B4 Pro W3",Hiragino Kaku Gothic Pro W3,Osaka,"\FF2D \FF33 \FF30 \30B4 \30B7 \30C3 \30AF",MS PGothic,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}._spectrum-Body_60105,._spectrum_60105,._spectrum_60105._spectrum-Body_60105{font-size:var(--spectrum-alias-font-size-default,var(--spectrum-global-dimension-font-size-100));font-weight:var(--spectrum-alias-body-text-font-weight,var(--spectrum-global-font-weight-regular));line-height:var(--spectrum-alias-body-text-line-height,var(--spectrum-global-font-line-height-medium));font-style:var(--spectrum-global-font-style-regular,normal)}._spectrum-Body--italic_60105{font-style:var(--spectrum-global-font-style-italic,italic)}
2
- /*# sourceMappingURL=main.css.map */
1
+ .spectrum_b37d53{background-color:var(--spectrum-alias-background-color-default,var(--spectrum-global-color-gray-100));-webkit-tap-highlight-color:#0000}.spectrum_2a241c{font-family:adobe-clean-ux,adobe-clean,Source Sans Pro,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.spectrum_2a241c:lang(ar){font-family:adobe-arabic,myriad-arabic,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.spectrum_2a241c:lang(he){font-family:adobe-hebrew,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.spectrum_2a241c:lang(zh-Hans),.spectrum_2a241c:lang(zh){font-family:adobe-clean-han-simplified-c,SimSun,Heiti SC Light,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.spectrum_2a241c:lang(ko){font-family:adobe-clean-han-korean,Malgun Gothic,Apple Gothic,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.spectrum_2a241c:lang(ja){font-family:adobe-clean-han-japanese,Yu Gothic,メイリオ,ヒラギノ角ゴ Pro W3,Hiragino Kaku Gothic Pro W3,Osaka,MSPゴシック,MS PGothic,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.spectrum_2a241c{font-size:var(--spectrum-alias-font-size-default,var(--spectrum-global-dimension-font-size-100));color:var(--spectrum-global-color-gray-800)}.spectrum_2a241c,.spectrum_2a241c.spectrum-Body_2a241c,.spectrum-Body_2a241c{font-size:var(--spectrum-body-4-text-size,var(--spectrum-alias-font-size-default));font-weight:var(--spectrum-body-4-text-font-weight,var(--spectrum-alias-body-text-font-weight));line-height:var(--spectrum-body-4-text-line-height,var(--spectrum-alias-body-text-line-height));font-style:var(--spectrum-body-4-text-font-style,var(--spectrum-global-font-style-regular))}.spectrum-Body--italic_2a241c{font-style:var(--spectrum-body-4-emphasis-text-font-style,var(--spectrum-global-font-style-italic))}
package/dist/main.js CHANGED
@@ -1,278 +1,227 @@
1
- var {
2
- shouldKeepSpectrumClassNames,
3
- useDOMRef,
4
- useStyleProps,
5
- useMediaQuery
6
- } = require("@react-spectrum/utils");
7
-
8
- var _react2 = require("react");
9
-
10
- var _react = $parcel$interopDefault(_react2);
1
+ require("./main.css");
2
+ var $br6yh$reactspectrumutils = require("@react-spectrum/utils");
3
+ var $br6yh$clsx = require("clsx");
4
+ var $br6yh$reactariautils = require("@react-aria/utils");
5
+ var $br6yh$reactariai18n = require("@react-aria/i18n");
6
+ var $br6yh$reactariaoverlays = require("@react-aria/overlays");
7
+ var $br6yh$react = require("react");
8
+
9
+ function $parcel$exportWildcard(dest, source) {
10
+ Object.keys(source).forEach(function(key) {
11
+ if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
12
+ return;
13
+ }
11
14
 
12
- var {
13
- useContext,
14
- useEffect,
15
- useRef
16
- } = _react2;
15
+ Object.defineProperty(dest, key, {
16
+ enumerable: true,
17
+ get: function get() {
18
+ return source[key];
19
+ }
20
+ });
21
+ });
17
22
 
18
- var {
19
- ModalProvider,
20
- useModalProvider
21
- } = require("@react-aria/overlays");
23
+ return dest;
24
+ }
25
+ function $parcel$interopDefault(a) {
26
+ return a && a.__esModule ? a.default : a;
27
+ }
28
+ function $parcel$export(e, n, v, s) {
29
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
30
+ }
31
+ var $12da041f6e43788e$exports = {};
22
32
 
23
- var {
24
- I18nProvider,
25
- useLocale
26
- } = require("@react-aria/i18n");
33
+ $parcel$export($12da041f6e43788e$exports, "useProvider", () => $12da041f6e43788e$export$693cdb10cec23617);
34
+ $parcel$export($12da041f6e43788e$exports, "Provider", () => $12da041f6e43788e$export$2881499e37b75b9a);
35
+ $parcel$export($12da041f6e43788e$exports, "useProviderProps", () => $12da041f6e43788e$export$521c373ccc32c300);
27
36
 
28
- var {
29
- filterDOMProps
30
- } = require("@react-aria/utils");
31
37
 
32
- var _clsx = $parcel$interopDefault(require("clsx"));
33
38
 
34
- var _babelRuntimeHelpersObjectWithoutPropertiesLoose = $parcel$interopDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
35
39
 
36
- var _babelRuntimeHelpersExtends = $parcel$interopDefault(require("@babel/runtime/helpers/extends"));
37
40
 
38
- require("./main.css");
39
41
 
40
- function $parcel$interopDefault(a) {
41
- return a && a.__esModule ? a.default : a;
42
- }
42
+ var $3d99ec54d13ba0b4$exports = {};
43
43
 
44
- // ASSET: /Users/govett/dev/react-spectrum-v3/node_modules/@adobe/spectrum-css-temp/components/page/vars.css
45
- var $bdf53da28d3991a48a6a4f1a69cf6748$exports = {};
46
- $bdf53da28d3991a48a6a4f1a69cf6748$exports = {
47
- "spectrum": "_spectrum_d43d2"
48
- };
49
- // ASSET: /Users/govett/dev/react-spectrum-v3/node_modules/@adobe/spectrum-css-temp/components/typography/index.css
50
- var $a4b6d91f224137a9e1821db979545594$exports = {};
51
- $a4b6d91f224137a9e1821db979545594$exports = {
52
- "spectrum": "_spectrum_60105",
53
- "spectrum-Body": "_spectrum-Body_60105",
54
- "spectrum-Body--italic": "_spectrum-Body--italic_60105"
55
- };
44
+ $parcel$export($3d99ec54d13ba0b4$exports, "spectrum", () => $3d99ec54d13ba0b4$export$3311ab3a441bc141, (v) => $3d99ec54d13ba0b4$export$3311ab3a441bc141 = v);
45
+ var $3d99ec54d13ba0b4$export$3311ab3a441bc141;
46
+ $3d99ec54d13ba0b4$export$3311ab3a441bc141 = "spectrum_b37d53";
56
47
 
57
- function $ae471163e3fb08c2a281b1d3e1120f94$export$useColorScheme(theme, defaultColorScheme) {
58
- let matchesDark = useMediaQuery('(prefers-color-scheme: dark)');
59
- let matchesLight = useMediaQuery('(prefers-color-scheme: light)'); // importance OS > default > omitted
60
48
 
61
- if (theme.dark && matchesDark) {
62
- return 'dark';
63
- }
49
+ var $99f8ec42b38a748b$exports = {};
64
50
 
65
- if (theme.light && matchesLight) {
66
- return 'light';
67
- }
51
+ $parcel$export($99f8ec42b38a748b$exports, "spectrum", () => $99f8ec42b38a748b$export$3311ab3a441bc141, (v) => $99f8ec42b38a748b$export$3311ab3a441bc141 = v);
52
+ $parcel$export($99f8ec42b38a748b$exports, "spectrum-Body", () => $99f8ec42b38a748b$export$a30bf7810c8453d1, (v) => $99f8ec42b38a748b$export$a30bf7810c8453d1 = v);
53
+ $parcel$export($99f8ec42b38a748b$exports, "spectrum-Body--italic", () => $99f8ec42b38a748b$export$7b2dac1166f6ec4c, (v) => $99f8ec42b38a748b$export$7b2dac1166f6ec4c = v);
54
+ var $99f8ec42b38a748b$export$3311ab3a441bc141;
55
+ var $99f8ec42b38a748b$export$a30bf7810c8453d1;
56
+ var $99f8ec42b38a748b$export$7b2dac1166f6ec4c;
57
+ $99f8ec42b38a748b$export$3311ab3a441bc141 = "spectrum_2a241c";
58
+ $99f8ec42b38a748b$export$a30bf7810c8453d1 = "spectrum-Body_2a241c";
59
+ $99f8ec42b38a748b$export$7b2dac1166f6ec4c = "spectrum-Body--italic_2a241c";
68
60
 
69
- if (theme.dark && defaultColorScheme === 'dark') {
70
- return 'dark';
71
- }
72
61
 
73
- if (theme.light && defaultColorScheme === 'light') {
74
- return 'light';
75
- }
76
62
 
77
- if (!theme.dark) {
63
+ function $b7de29dd46c07a43$export$6343629ee1b29116(theme, defaultColorScheme) {
64
+ let matchesDark = $br6yh$reactspectrumutils.useMediaQuery('(prefers-color-scheme: dark)');
65
+ let matchesLight = $br6yh$reactspectrumutils.useMediaQuery('(prefers-color-scheme: light)');
66
+ // importance OS > default > omitted
67
+ if (theme.dark && matchesDark) return 'dark';
68
+ if (theme.light && matchesLight) return 'light';
69
+ if (theme.dark && defaultColorScheme === 'dark') return 'dark';
70
+ if (theme.light && defaultColorScheme === 'light') return 'light';
71
+ if (!theme.dark) return 'light';
72
+ if (!theme.light) return 'dark';
78
73
  return 'light';
79
- }
80
-
81
- if (!theme.light) {
82
- return 'dark';
83
- }
84
-
85
- return 'light';
86
74
  }
87
-
88
- function $ae471163e3fb08c2a281b1d3e1120f94$export$useScale(theme) {
89
- let matchesFine = useMediaQuery('(any-pointer: fine)');
90
-
91
- if (matchesFine && theme.medium) {
75
+ function $b7de29dd46c07a43$export$a8d2043b2d807f4d(theme) {
76
+ let matchesFine = $br6yh$reactspectrumutils.useMediaQuery('(any-pointer: fine)');
77
+ if (matchesFine && theme.medium) return 'medium';
78
+ if (theme.large) return 'large';
92
79
  return 'medium';
93
- }
94
-
95
- if (theme.large) {
96
- return 'large';
97
- }
98
-
99
- return 'medium';
100
80
  }
101
81
 
102
- // ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/provider/package.json
103
- var $cb3a8279d5bbe24ad5b01eee2a870ec3$exports = {};
104
- $cb3a8279d5bbe24ad5b01eee2a870ec3$exports = JSON.parse("{\"name\":\"@react-spectrum/provider\",\"version\":\"3.1.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.1\",\"@react-aria/overlays\":\"^3.6.3\",\"@react-aria/utils\":\"^3.8.0\",\"@react-spectrum/utils\":\"^3.5.2\",\"@react-types/provider\":\"^3.1.1\",\"@react-types/shared\":\"^3.6.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\"},\"publishConfig\":{\"access\":\"public\"}}");
105
-
106
- const $f150a45acb1414cf0ebc786fd600e35$var$Context = /*#__PURE__*/_react.createContext(null);
107
82
 
108
- function $f150a45acb1414cf0ebc786fd600e35$var$Provider(props, ref) {
109
- let prevContext = useProvider();
110
- let prevColorScheme = prevContext && prevContext.colorScheme;
111
- let {
112
- theme = prevContext && prevContext.theme,
113
- defaultColorScheme
114
- } = props; // Hooks must always be called.
83
+ var $989921f5057064f5$exports = {};
84
+ $989921f5057064f5$exports = JSON.parse("{\"name\":\"@react-spectrum/provider\",\"version\":\"3.3.0\",\"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.5\",\"@react-aria/overlays\":\"^3.7.4\",\"@react-aria/utils\":\"^3.11.1\",\"@react-spectrum/utils\":\"^3.6.4\",\"@react-types/provider\":\"^3.4.0\",\"@react-types/shared\":\"^3.11.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\"}}");
115
85
 
116
- let autoColorScheme = $ae471163e3fb08c2a281b1d3e1120f94$export$useColorScheme(theme, defaultColorScheme);
117
- let autoScale = $ae471163e3fb08c2a281b1d3e1120f94$export$useScale(theme);
118
- let {
119
- locale: prevLocale
120
- } = useLocale(); // if the new theme doesn't support the prevColorScheme, we must resort to the auto
121
86
 
122
- let usePrevColorScheme = !!theme[prevColorScheme]; // importance of color scheme props > parent > auto:(OS > default > omitted)
123
-
124
- let {
125
- colorScheme = usePrevColorScheme ? prevColorScheme : autoColorScheme,
126
- scale = prevContext ? prevContext.scale : autoScale,
127
- locale = prevContext ? prevLocale : null,
128
- children,
129
- isQuiet,
130
- isEmphasized,
131
- isDisabled,
132
- isRequired,
133
- isReadOnly,
134
- validationState
135
- } = props,
136
- otherProps = _babelRuntimeHelpersObjectWithoutPropertiesLoose(props, ["colorScheme", "scale", "locale", "children", "isQuiet", "isEmphasized", "isDisabled", "isRequired", "isReadOnly", "validationState"]); // select only the props with values so undefined props don't overwrite prevContext values
137
-
138
-
139
- let currentProps = {
140
- version: $cb3a8279d5bbe24ad5b01eee2a870ec3$exports.version,
141
- theme,
142
- colorScheme,
143
- scale,
144
- isQuiet,
145
- isEmphasized,
146
- isDisabled,
147
- isRequired,
148
- isReadOnly,
149
- validationState
150
- };
151
- let filteredProps = {};
152
- Object.entries(currentProps).forEach((_ref) => {
153
- let [key, value] = _ref;
154
- return value !== undefined && (filteredProps[key] = value);
155
- }); // Merge options with parent provider
156
-
157
- let context = Object.assign({}, prevContext, filteredProps); // Only wrap in a DOM node if the theme, colorScheme, or scale changed
158
-
159
- let contents = children;
160
- let domProps = filterDOMProps(otherProps);
161
- let {
162
- styleProps
163
- } = useStyleProps(otherProps);
164
-
165
- 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) {
166
- contents = /*#__PURE__*/_react.createElement($f150a45acb1414cf0ebc786fd600e35$var$ProviderWrapper, _babelRuntimeHelpersExtends({}, props, {
167
- UNSAFE_style: _babelRuntimeHelpersExtends({
168
- isolation: !prevContext ? 'isolate' : undefined
169
- }, styleProps.style),
170
- ref: ref
171
- }), contents);
172
- }
173
-
174
- return /*#__PURE__*/_react.createElement($f150a45acb1414cf0ebc786fd600e35$var$Context.Provider, {
175
- value: context
176
- }, /*#__PURE__*/_react.createElement(I18nProvider, {
177
- locale: locale
178
- }, /*#__PURE__*/_react.createElement(ModalProvider, null, contents)));
87
+ const $12da041f6e43788e$var$Context = /*#__PURE__*/ ($parcel$interopDefault($br6yh$react)).createContext(null);
88
+ $12da041f6e43788e$var$Context.displayName = 'ProviderContext';
89
+ const $12da041f6e43788e$var$DEFAULT_BREAKPOINTS = {
90
+ S: 640,
91
+ M: 768,
92
+ L: 1024,
93
+ XL: 1280,
94
+ XXL: 1536
95
+ };
96
+ function $12da041f6e43788e$var$Provider(props, ref) {
97
+ let prevContext = $12da041f6e43788e$export$693cdb10cec23617();
98
+ let prevColorScheme = prevContext && prevContext.colorScheme;
99
+ let prevBreakpoints = prevContext && prevContext.breakpoints;
100
+ let { theme: theme = prevContext && prevContext.theme , defaultColorScheme: defaultColorScheme } = props;
101
+ // Hooks must always be called.
102
+ let autoColorScheme = $b7de29dd46c07a43$export$6343629ee1b29116(theme, defaultColorScheme);
103
+ let autoScale = $b7de29dd46c07a43$export$a8d2043b2d807f4d(theme);
104
+ let { locale: prevLocale } = $br6yh$reactariai18n.useLocale();
105
+ // if the new theme doesn't support the prevColorScheme, we must resort to the auto
106
+ let usePrevColorScheme = !!theme[prevColorScheme];
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 : $12da041f6e43788e$var$DEFAULT_BREAKPOINTS , children: children , isQuiet: isQuiet , isEmphasized: isEmphasized , isDisabled: isDisabled , isRequired: isRequired , isReadOnly: isReadOnly , validationState: validationState , ...otherProps } = props;
109
+ // select only the props with values so undefined props don't overwrite prevContext values
110
+ let currentProps = {
111
+ version: $989921f5057064f5$exports.version,
112
+ theme: theme,
113
+ breakpoints: breakpoints,
114
+ colorScheme: colorScheme,
115
+ scale: scale,
116
+ isQuiet: isQuiet,
117
+ isEmphasized: isEmphasized,
118
+ isDisabled: isDisabled,
119
+ isRequired: isRequired,
120
+ isReadOnly: isReadOnly,
121
+ validationState: validationState
122
+ };
123
+ let matchedBreakpoints = $br6yh$reactspectrumutils.useMatchedBreakpoints(breakpoints);
124
+ let filteredProps = {
125
+ };
126
+ Object.entries(currentProps).forEach(([key, value])=>value !== undefined && (filteredProps[key] = value)
127
+ );
128
+ // Merge options with parent provider
129
+ let context = Object.assign({
130
+ }, prevContext, filteredProps);
131
+ // Only wrap in a DOM node if the theme, colorScheme, or scale changed
132
+ let contents = children;
133
+ let domProps = $br6yh$reactariautils.filterDOMProps(otherProps);
134
+ let { styleProps: styleProps } = $br6yh$reactspectrumutils.useStyleProps(otherProps, undefined, {
135
+ matchedBreakpoints: matchedBreakpoints
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($br6yh$react)).createElement($12da041f6e43788e$var$ProviderWrapper, {
138
+ ...props,
139
+ UNSAFE_style: {
140
+ isolation: !prevContext ? 'isolate' : undefined,
141
+ ...styleProps.style
142
+ },
143
+ ref: ref
144
+ }, contents);
145
+ return(/*#__PURE__*/ ($parcel$interopDefault($br6yh$react)).createElement($12da041f6e43788e$var$Context.Provider, {
146
+ value: context
147
+ }, /*#__PURE__*/ ($parcel$interopDefault($br6yh$react)).createElement($br6yh$reactariai18n.I18nProvider, {
148
+ locale: locale
149
+ }, /*#__PURE__*/ ($parcel$interopDefault($br6yh$react)).createElement($br6yh$reactspectrumutils.BreakpointProvider, {
150
+ matchedBreakpoints: matchedBreakpoints
151
+ }, /*#__PURE__*/ ($parcel$interopDefault($br6yh$react)).createElement($br6yh$reactariaoverlays.ModalProvider, null, contents)))));
179
152
  }
180
153
  /**
181
154
  * Provider is the container for all React Spectrum applications.
182
155
  * It defines the theme, locale, and other application level settings,
183
156
  * and can also be used to provide common properties to a group of components.
184
- */
185
-
186
-
187
- let Provider = /*#__PURE__*/_react.forwardRef($f150a45acb1414cf0ebc786fd600e35$var$Provider);
188
-
189
- exports.Provider = Provider;
190
- var $bdf53da28d3991a48a6a4f1a69cf6748$$interop$default = $parcel$interopDefault($bdf53da28d3991a48a6a4f1a69cf6748$exports);
191
- var $a4b6d91f224137a9e1821db979545594$$interop$default = $parcel$interopDefault($a4b6d91f224137a9e1821db979545594$exports);
192
-
193
- const $f150a45acb1414cf0ebc786fd600e35$var$ProviderWrapper = /*#__PURE__*/_react.forwardRef(function ProviderWrapper(props, ref) {
194
- var _ref2, _props$colorScheme;
195
-
196
- let {
197
- children
198
- } = props,
199
- otherProps = _babelRuntimeHelpersObjectWithoutPropertiesLoose(props, ["children"]);
200
-
201
- let {
202
- locale,
203
- direction
204
- } = useLocale();
205
- let {
206
- theme,
207
- colorScheme,
208
- scale
209
- } = useProvider();
210
- let {
211
- modalProviderProps
212
- } = useModalProvider();
213
- let {
214
- styleProps
215
- } = useStyleProps(otherProps);
216
- let domRef = useDOMRef(ref);
217
- let themeKey = Object.keys(theme[colorScheme])[0];
218
- let scaleKey = Object.keys(theme[scale])[0];
219
-
220
- let className = _clsx(styleProps.className, $bdf53da28d3991a48a6a4f1a69cf6748$$interop$default['spectrum'], $a4b6d91f224137a9e1821db979545594$$interop$default['spectrum'], theme[colorScheme][themeKey], theme[scale][scaleKey], theme.global ? Object.values(theme.global) : null, {
221
- 'react-spectrum-provider': shouldKeepSpectrumClassNames,
222
- spectrum: shouldKeepSpectrumClassNames,
223
- [themeKey]: shouldKeepSpectrumClassNames,
224
- [scaleKey]: shouldKeepSpectrumClassNames
225
- });
226
-
227
- let style = _babelRuntimeHelpersExtends({}, styleProps.style, {
228
- // This ensures that browser native UI like scrollbars are rendered in the right color scheme.
229
- // See https://web.dev/color-scheme/.
230
- colorScheme: (_ref2 = (_props$colorScheme = props.colorScheme) != null ? _props$colorScheme : colorScheme) != null ? _ref2 : Object.keys(theme).filter(k => k === 'light' || k === 'dark').join(' ')
231
- });
232
-
233
- let hasWarned = useRef(false);
234
- useEffect(() => {
235
- if (direction && domRef.current) {
236
- let closestDir = domRef.current.parentElement.closest('[dir]');
237
- let dir = closestDir && closestDir.getAttribute('dir');
238
-
239
- if (dir && dir !== direction && !hasWarned.current) {
240
- console.warn("Language directions cannot be nested. " + direction + " inside " + dir + ".");
241
- hasWarned.current = true;
242
- }
243
- }
244
- }, [direction, domRef, hasWarned]);
245
- return /*#__PURE__*/_react.createElement("div", _babelRuntimeHelpersExtends({}, filterDOMProps(otherProps), styleProps, modalProviderProps, {
246
- className: className,
247
- style: style,
248
- lang: locale,
249
- dir: direction,
250
- ref: domRef
251
- }), children);
157
+ */ let $12da041f6e43788e$export$2881499e37b75b9a = /*#__PURE__*/ ($parcel$interopDefault($br6yh$react)).forwardRef($12da041f6e43788e$var$Provider);
158
+ const $12da041f6e43788e$var$ProviderWrapper = /*#__PURE__*/ ($parcel$interopDefault($br6yh$react)).forwardRef(function ProviderWrapper(props, ref) {
159
+ let { children: children , ...otherProps } = props;
160
+ let { locale: locale , direction: direction } = $br6yh$reactariai18n.useLocale();
161
+ let { theme: theme , colorScheme: colorScheme , scale: scale } = $12da041f6e43788e$export$693cdb10cec23617();
162
+ let { modalProviderProps: modalProviderProps } = $br6yh$reactariaoverlays.useModalProvider();
163
+ let { styleProps: styleProps } = $br6yh$reactspectrumutils.useStyleProps(otherProps);
164
+ let domRef = $br6yh$reactspectrumutils.useDOMRef(ref);
165
+ let themeKey = Object.keys(theme[colorScheme])[0];
166
+ let scaleKey = Object.keys(theme[scale])[0];
167
+ let className = ($parcel$interopDefault($br6yh$clsx))(styleProps.className, (/*@__PURE__*/$parcel$interopDefault($3d99ec54d13ba0b4$exports))['spectrum'], (/*@__PURE__*/$parcel$interopDefault($99f8ec42b38a748b$exports))['spectrum'], theme[colorScheme][themeKey], theme[scale][scaleKey], theme.global ? Object.values(theme.global) : null, {
168
+ 'react-spectrum-provider': $br6yh$reactspectrumutils.shouldKeepSpectrumClassNames,
169
+ spectrum: $br6yh$reactspectrumutils.shouldKeepSpectrumClassNames,
170
+ [themeKey]: $br6yh$reactspectrumutils.shouldKeepSpectrumClassNames,
171
+ [scaleKey]: $br6yh$reactspectrumutils.shouldKeepSpectrumClassNames
172
+ });
173
+ let style = {
174
+ ...styleProps.style,
175
+ // This ensures that browser native UI like scrollbars are rendered in the right color scheme.
176
+ // See https://web.dev/color-scheme/.
177
+ colorScheme: (props.colorScheme ?? colorScheme) ?? Object.keys(theme).filter((k)=>k === 'light' || k === 'dark'
178
+ ).join(' ')
179
+ };
180
+ let hasWarned = $br6yh$react.useRef(false);
181
+ $br6yh$react.useEffect(()=>{
182
+ if (direction && domRef.current) {
183
+ let closestDir = domRef.current.parentElement.closest('[dir]');
184
+ let dir = closestDir && closestDir.getAttribute('dir');
185
+ if (dir && dir !== direction && !hasWarned.current) {
186
+ console.warn(`Language directions cannot be nested. ${direction} inside ${dir}.`);
187
+ hasWarned.current = true;
188
+ }
189
+ }
190
+ }, [
191
+ direction,
192
+ domRef,
193
+ hasWarned
194
+ ]);
195
+ return(/*#__PURE__*/ ($parcel$interopDefault($br6yh$react)).createElement("div", {
196
+ ...$br6yh$reactariautils.filterDOMProps(otherProps),
197
+ ...styleProps,
198
+ ...modalProviderProps,
199
+ className: className,
200
+ style: style,
201
+ lang: locale,
202
+ dir: direction,
203
+ ref: domRef
204
+ }, children));
252
205
  });
253
-
254
- function useProvider() {
255
- return useContext($f150a45acb1414cf0ebc786fd600e35$var$Context);
206
+ function $12da041f6e43788e$export$693cdb10cec23617() {
207
+ return $br6yh$react.useContext($12da041f6e43788e$var$Context);
208
+ }
209
+ function $12da041f6e43788e$export$521c373ccc32c300(props) {
210
+ let context = $12da041f6e43788e$export$693cdb10cec23617();
211
+ if (!context) return props;
212
+ return Object.assign({
213
+ }, {
214
+ isQuiet: context.isQuiet,
215
+ isEmphasized: context.isEmphasized,
216
+ isDisabled: context.isDisabled,
217
+ isRequired: context.isRequired,
218
+ isReadOnly: context.isReadOnly,
219
+ validationState: context.validationState
220
+ }, props);
256
221
  }
257
222
 
258
- exports.useProvider = useProvider;
259
-
260
- function useProviderProps(props) {
261
- let context = useProvider();
262
223
 
263
- if (!context) {
264
- return props;
265
- }
224
+ $parcel$exportWildcard(module.exports, $12da041f6e43788e$exports);
266
225
 
267
- return Object.assign({}, {
268
- isQuiet: context.isQuiet,
269
- isEmphasized: context.isEmphasized,
270
- isDisabled: context.isDisabled,
271
- isRequired: context.isRequired,
272
- isReadOnly: context.isReadOnly,
273
- validationState: context.validationState
274
- }, props);
275
- }
276
226
 
277
- exports.useProviderProps = useProviderProps;
278
227
  //# sourceMappingURL=main.js.map
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAASA,sBAAT,CAAgCC,CAAhC,EAAmC;AACjC,SAAOA,CAAC,IAAIA,CAAC,CAACC,UAAP,GAAoBD,CAAC,CAACE,OAAtB,GAAgCF,CAAvC;AACD;;;;ACFD,4CAAiB;AACf,cAAY;AADG,CAAjB;;;ACAA,4CAAiB;AACf,cAAY,iBADG;AAEf,mBAAiB,sBAFF;AAGf,2BAAyB;AAHV,CAAjB;;ACgBO,SAASG,uDAAT,CAAwBC,KAAxB,EAAsCC,kBAAtC,EAAoF;AACzF,MAAIC,WAAW,GAAGC,aAAa,CAAC,8BAAD,CAA/B;AACA,MAAIC,YAAY,GAAGD,aAAa,CAAC,+BAAD,CAAhC,CAFyF,CAIzF;;AAEA,MAAIH,KAAK,CAACK,IAAN,IAAcH,WAAlB,EAA+B;AAC7B,WAAO,MAAP;AACD;;AAED,MAAIF,KAAK,CAACM,KAAN,IAAeF,YAAnB,EAAiC;AAC/B,WAAO,OAAP;AACD;;AAED,MAAIJ,KAAK,C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BC,IAAAA,UAAU,EAAEa,OAAO,CAACb,UAJG;AAKvBC,IAAAA,UAAU,EAAEY,OAAO,CAACZ,UALG;AAMvBC,IAAAA,eAAe,EAAEW,OAAO,CAACX;AANF,GAAlB,EAOJnB,KAPI,CAAP;AAQD","sources":["./node_modules/@parcel/scope-hoisting/lib/helpers.js","./node_modules/@adobe/spectrum-css-temp/components/page/vars.css","./node_modules/@adobe/spectrum-css-temp/components/typography/index.css","./packages/@react-spectrum/provider/src/mediaQueries.ts","./packages/@react-spectrum/provider/package.json","./packages/@react-spectrum/provider/src/Provider.tsx"],"sourcesContent":["function $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$defineInteropFlag(a) {\n Object.defineProperty(a, '__esModule', {value: true});\n}\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule') {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n },\n });\n });\n\n return dest;\n}\n\nfunction $parcel$missingModule(name) {\n var err = new Error(\"Cannot find module '\" + name + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n}\n\nvar $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\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.1.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.1\",\n \"@react-aria/overlays\": \"^3.6.3\",\n \"@react-aria/utils\": \"^3.8.0\",\n \"@react-spectrum/utils\": \"^3.5.2\",\n \"@react-types/provider\": \"^3.1.1\",\n \"@react-types/shared\": \"^3.6.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 },\n \"publishConfig\": {\n \"access\": \"public\"\n }\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 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 {\n shouldKeepSpectrumClassNames,\n useDOMRef,\n useStyleProps\n} from '@react-spectrum/utils';\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);\n\nfunction Provider(props: ProviderProps, ref: DOMRef<HTMLDivElement>) {\n let prevContext = useProvider();\n let prevColorScheme = prevContext && prevContext.colorScheme;\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 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 colorScheme,\n scale,\n isQuiet,\n isEmphasized,\n isDisabled,\n isRequired,\n isReadOnly,\n validationState\n };\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);\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 <ModalProvider>\n {contents}\n </ModalProvider>\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\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"],"names":["$parcel$interopDefault","a","__esModule","default","useColorScheme","theme","defaultColorScheme","matchesDark","useMediaQuery","matchesLight","dark","light","useScale","matchesFine","medium","large","JSON","parse","Context","React","createContext","Provider","props","ref","prevContext","useProvider","prevColorScheme","colorScheme","autoColorScheme","autoScale","locale","prevLocale","useLocale","usePrevColorScheme","scale","children","isQuiet","isEmphasized","isDisabled","isRequired","isReadOnly","validationState","otherProps","currentProps","version","filteredProps","Object","entries","forEach","key","value","undefined","context","assign","contents","domProps","filterDOMProps","styleProps","useStyleProps","keys","length","UNSAFE_className","style","isolation","_Provider","forwardRef","ProviderWrapper","direction","modalProviderProps","useModalProvider","domRef","useDOMRef","themeKey","scaleKey","className","clsx","global","values","shouldKeepSpectrumClassNames","spectrum","filter","k","join","hasWarned","useRef","useEffect","current","closestDir","parentElement","closest","dir","getAttribute","console","warn","useContext","useProviderProps"],"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,kCAAoC;IAEpC,EAAE,EAAE,KAAK,CAAC,IAAI,IAAI,WAAW,EAC3B,MAAM,CAAC,CAAM;IAGf,EAAE,EAAE,KAAK,CAAC,KAAK,IAAI,YAAY,EAC7B,MAAM,CAAC,CAAO;IAGhB,EAAE,EAAE,KAAK,CAAC,IAAI,IAAI,kBAAkB,KAAK,CAAM,OAC7C,MAAM,CAAC,CAAM;IAGf,EAAE,EAAE,KAAK,CAAC,KAAK,IAAI,kBAAkB,KAAK,CAAO,QAC/C,MAAM,CAAC,CAAO;IAGhB,EAAE,GAAG,KAAK,CAAC,IAAI,EACb,MAAM,CAAC,CAAO;IAGhB,EA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,OAAO,CAAC,CAAO;YAC7D,GAAG,CAAC,GAAG,GAAG,UAAU,IAAI,UAAU,CAAC,YAAY,CAAC,CAAK;YACrD,EAAE,EAAE,GAAG,IAAI,GAAG,KAAK,SAAS,KAAK,SAAS,CAAC,OAAO,EAAE,CAAC;gBACnD,OAAO,CAAC,IAAI,EAAE,sCAAsC,EAAE,SAAS,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;gBAC/E,SAAS,CAAC,OAAO,GAAG,IAAI;YAC1B,CAAC;QACH,CAAC;IACH,CAAC,EAAE,CAAC;QAAA,SAAS;QAAE,MAAM;QAAE,SAAS;IAAA,CAAC;IAGjC,MAAM,oEACH,CAAG;WACE,oCAAc,CAAC,UAAU;WACzB,UAAU;WACV,kBAAkB;QACtB,SAAS,EAAE,SAAS;QACpB,KAAK,EAAE,KAAK;QACZ,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,SAAS;QACd,GAAG,EAAE,MAAM;OACV,QAAQ;AAGf,CAAC;SAMe,yCAAW,GAAoB,CAAC;IAC9C,MAAM,CAAC,uBAAU,CAAC,6BAAO;AAC3B,CAAC;SAEe,yCAAgB,CAAI,KAAQ,EAAM,CAAC;IACjD,GAAG,CAAC,OAAO,GAAG,yCAAW;IACzB,EAAE,GAAG,OAAO,EACV,MAAM,CAAC,KAAK;IAEd,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAAA,CAAC,EAAE,CAAC;QACxB,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,YAAY,EAAE,OAAO,CAAC,YAAY;QAClC,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,eAAe,EAAE,OAAO,CAAC,eAAe;IAC1C,CAAC,EAAE,KAAK;AACV,CAAC","sources":["packages/@react-spectrum/provider/src/index.ts","packages/@react-spectrum/provider/src/Provider.tsx","packages/@adobe/spectrum-css-temp/components/page/vars.css","packages/@adobe/spectrum-css-temp/components/typography/index.css","packages/@react-spectrum/provider/src/mediaQueries.ts","packages/@react-spectrum/provider/package.json"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport * 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"}