@react-spectrum/provider 3.2.2 → 3.3.2
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 +1 -2
- package/dist/main.js +192 -261
- package/dist/main.js.map +1 -1
- package/dist/module.js +179 -226
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +4 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/Provider.tsx +4 -0
- package/dist/main.css.map +0 -1
package/dist/main.css
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
.
|
|
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,297 +1,228 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
require("./main.css");
|
|
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
|
+
|
|
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
|
+
}
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
Object.defineProperty(dest, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function get() {
|
|
18
|
+
return source[key];
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
});
|
|
15
22
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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 $96cabdf5b0aed55b$exports = {};
|
|
20
32
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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);
|
|
24
36
|
|
|
25
|
-
var _clsx = $parcel$interopDefault(require("clsx"));
|
|
26
37
|
|
|
27
|
-
var {
|
|
28
|
-
BreakpointProvider,
|
|
29
|
-
shouldKeepSpectrumClassNames,
|
|
30
|
-
useDOMRef,
|
|
31
|
-
useMatchedBreakpoints,
|
|
32
|
-
useStyleProps,
|
|
33
|
-
useMediaQuery
|
|
34
|
-
} = require("@react-spectrum/utils");
|
|
35
38
|
|
|
36
|
-
var _babelRuntimeHelpersObjectWithoutPropertiesLoose = $parcel$interopDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
37
39
|
|
|
38
|
-
var _babelRuntimeHelpersExtends = $parcel$interopDefault(require("@babel/runtime/helpers/extends"));
|
|
39
40
|
|
|
40
|
-
require("./main.css");
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
return a && a.__esModule ? a.default : a;
|
|
44
|
-
}
|
|
42
|
+
var $22365f0f5f2dcdd5$exports = {};
|
|
45
43
|
|
|
46
|
-
|
|
47
|
-
var $
|
|
48
|
-
$
|
|
49
|
-
"spectrum": "_spectrum_d43d2"
|
|
50
|
-
};
|
|
51
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/node_modules/@adobe/spectrum-css-temp/components/typography/index.css
|
|
52
|
-
var $a4b6d91f224137a9e1821db979545594$exports = {};
|
|
53
|
-
$a4b6d91f224137a9e1821db979545594$exports = {
|
|
54
|
-
"spectrum": "_spectrum_60105",
|
|
55
|
-
"spectrum-Body": "_spectrum-Body_60105",
|
|
56
|
-
"spectrum-Body--italic": "_spectrum-Body--italic_60105"
|
|
57
|
-
};
|
|
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";
|
|
58
47
|
|
|
59
|
-
function $ae471163e3fb08c2a281b1d3e1120f94$export$useColorScheme(theme, defaultColorScheme) {
|
|
60
|
-
let matchesDark = useMediaQuery('(prefers-color-scheme: dark)');
|
|
61
|
-
let matchesLight = useMediaQuery('(prefers-color-scheme: light)'); // importance OS > default > omitted
|
|
62
48
|
|
|
63
|
-
|
|
64
|
-
return 'dark';
|
|
65
|
-
}
|
|
49
|
+
var $19fbfce217006b12$exports = {};
|
|
66
50
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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";
|
|
70
60
|
|
|
71
|
-
if (theme.dark && defaultColorScheme === 'dark') {
|
|
72
|
-
return 'dark';
|
|
73
|
-
}
|
|
74
61
|
|
|
75
|
-
if (theme.light && defaultColorScheme === 'light') {
|
|
76
|
-
return 'light';
|
|
77
|
-
}
|
|
78
62
|
|
|
79
|
-
|
|
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
|
+
// 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';
|
|
80
73
|
return 'light';
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if (!theme.light) {
|
|
84
|
-
return 'dark';
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
return 'light';
|
|
88
74
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
if (matchesFine && theme.medium) {
|
|
75
|
+
function $a6e2b5f4621e4690$export$a8d2043b2d807f4d(theme) {
|
|
76
|
+
let matchesFine = $kmRpa$reactspectrumutils.useMediaQuery('(any-pointer: fine)');
|
|
77
|
+
if (matchesFine && theme.medium) return 'medium';
|
|
78
|
+
if (theme.large) return 'large';
|
|
94
79
|
return 'medium';
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if (theme.large) {
|
|
98
|
-
return 'large';
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return 'medium';
|
|
102
80
|
}
|
|
103
81
|
|
|
104
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/provider/package.json
|
|
105
|
-
var $cb3a8279d5bbe24ad5b01eee2a870ec3$exports = {};
|
|
106
|
-
$cb3a8279d5bbe24ad5b01eee2a870ec3$exports = JSON.parse("{\"name\":\"@react-spectrum/provider\",\"version\":\"3.2.1\",\"description\":\"Spectrum UI components in React\",\"license\":\"Apache-2.0\",\"main\":\"dist/main.js\",\"module\":\"dist/module.js\",\"types\":\"dist/types.d.ts\",\"source\":\"src/index.ts\",\"files\":[\"dist\",\"src\"],\"sideEffects\":[\"*.css\"],\"targets\":{\"main\":{\"includeNodeModules\":[\"@adobe/spectrum-css-temp\"]},\"module\":{\"includeNodeModules\":[\"@adobe/spectrum-css-temp\"]}},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/adobe/react-spectrum\"},\"dependencies\":{\"@babel/runtime\":\"^7.6.2\",\"@react-aria/i18n\":\"^3.3.1\",\"@react-aria/overlays\":\"^3.7.0\",\"@react-aria/utils\":\"^3.8.1\",\"@react-spectrum/utils\":\"^3.6.0\",\"@react-types/provider\":\"^3.3.1\",\"@react-types/shared\":\"^3.7.1\",\"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\"}}");
|
|
107
|
-
|
|
108
|
-
const $f150a45acb1414cf0ebc786fd600e35$var$Context = /*#__PURE__*/_react.createContext(null);
|
|
109
|
-
|
|
110
|
-
$f150a45acb1414cf0ebc786fd600e35$var$Context.displayName = 'ProviderContext';
|
|
111
|
-
const $f150a45acb1414cf0ebc786fd600e35$var$DEFAULT_BREAKPOINTS = {
|
|
112
|
-
S: 640,
|
|
113
|
-
M: 768,
|
|
114
|
-
L: 1024,
|
|
115
|
-
XL: 1280,
|
|
116
|
-
XXL: 1536
|
|
117
|
-
};
|
|
118
82
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
let prevColorScheme = prevContext && prevContext.colorScheme;
|
|
122
|
-
let prevBreakpoints = prevContext && prevContext.breakpoints;
|
|
123
|
-
let {
|
|
124
|
-
theme = prevContext && prevContext.theme,
|
|
125
|
-
defaultColorScheme
|
|
126
|
-
} = props; // Hooks must always be called.
|
|
83
|
+
var $4db360e38265184f$exports = {};
|
|
84
|
+
$4db360e38265184f$exports = JSON.parse("{\"name\":\"@react-spectrum/provider\",\"version\":\"3.3.2\",\"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.7\",\"@react-aria/overlays\":\"^3.8.0\",\"@react-aria/utils\":\"^3.11.3\",\"@react-spectrum/utils\":\"^3.6.6\",\"@react-types/provider\":\"^3.4.2\",\"@react-types/shared\":\"^3.11.2\",\"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\"}}");
|
|
127
85
|
|
|
128
|
-
let autoColorScheme = $ae471163e3fb08c2a281b1d3e1120f94$export$useColorScheme(theme, defaultColorScheme);
|
|
129
|
-
let autoScale = $ae471163e3fb08c2a281b1d3e1120f94$export$useScale(theme);
|
|
130
|
-
let {
|
|
131
|
-
locale: prevLocale
|
|
132
|
-
} = useLocale(); // if the new theme doesn't support the prevColorScheme, we must resort to the auto
|
|
133
86
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
breakpoints,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
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
|
+
S: 640,
|
|
91
|
+
M: 768,
|
|
92
|
+
L: 1024,
|
|
93
|
+
XL: 1280,
|
|
94
|
+
XXL: 1536
|
|
95
|
+
};
|
|
96
|
+
function $96cabdf5b0aed55b$var$Provider(props, ref) {
|
|
97
|
+
let prevContext = $96cabdf5b0aed55b$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 = $a6e2b5f4621e4690$export$6343629ee1b29116(theme, defaultColorScheme);
|
|
103
|
+
let autoScale = $a6e2b5f4621e4690$export$a8d2043b2d807f4d(theme);
|
|
104
|
+
let { locale: prevLocale } = $kmRpa$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 : $96cabdf5b0aed55b$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: $4db360e38265184f$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 = $kmRpa$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 = $kmRpa$reactariautils.filterDOMProps(otherProps);
|
|
134
|
+
let { styleProps: styleProps } = $kmRpa$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($kmRpa$react)).createElement($96cabdf5b0aed55b$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($kmRpa$react)).createElement($96cabdf5b0aed55b$var$Context.Provider, {
|
|
146
|
+
value: context
|
|
147
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($kmRpa$react)).createElement($kmRpa$reactariai18n.I18nProvider, {
|
|
148
|
+
locale: locale
|
|
149
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($kmRpa$react)).createElement($kmRpa$reactspectrumutils.BreakpointProvider, {
|
|
150
|
+
matchedBreakpoints: matchedBreakpoints
|
|
151
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($kmRpa$react)).createElement($kmRpa$reactariaoverlays.ModalProvider, null, contents)))));
|
|
198
152
|
}
|
|
199
153
|
/**
|
|
200
154
|
* Provider is the container for all React Spectrum applications.
|
|
201
155
|
* It defines the theme, locale, and other application level settings,
|
|
202
156
|
* and can also be used to provide common properties to a group of components.
|
|
203
|
-
*/
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
let
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
let hasWarned = useRef(false);
|
|
253
|
-
useEffect(() => {
|
|
254
|
-
if (direction && domRef.current) {
|
|
255
|
-
let closestDir = domRef.current.parentElement.closest('[dir]');
|
|
256
|
-
let dir = closestDir && closestDir.getAttribute('dir');
|
|
257
|
-
|
|
258
|
-
if (dir && dir !== direction && !hasWarned.current) {
|
|
259
|
-
console.warn("Language directions cannot be nested. " + direction + " inside " + dir + ".");
|
|
260
|
-
hasWarned.current = true;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}, [direction, domRef, hasWarned]);
|
|
264
|
-
return /*#__PURE__*/_react.createElement("div", _babelRuntimeHelpersExtends({}, filterDOMProps(otherProps), styleProps, modalProviderProps, {
|
|
265
|
-
className: className,
|
|
266
|
-
style: style,
|
|
267
|
-
lang: locale,
|
|
268
|
-
dir: direction,
|
|
269
|
-
ref: domRef
|
|
270
|
-
}), children);
|
|
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
|
+
let { children: children , ...otherProps } = props;
|
|
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
|
+
let themeKey = Object.keys(theme[colorScheme])[0];
|
|
166
|
+
let scaleKey = Object.keys(theme[scale])[0];
|
|
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
|
+
});
|
|
173
|
+
var _colorScheme, ref1;
|
|
174
|
+
let style = {
|
|
175
|
+
...styleProps.style,
|
|
176
|
+
// This ensures that browser native UI like scrollbars are rendered in the right color scheme.
|
|
177
|
+
// See https://web.dev/color-scheme/.
|
|
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
|
+
).join(' ')
|
|
180
|
+
};
|
|
181
|
+
let hasWarned = $kmRpa$react.useRef(false);
|
|
182
|
+
$kmRpa$react.useEffect(()=>{
|
|
183
|
+
if (direction && domRef.current) {
|
|
184
|
+
let closestDir = domRef.current.parentElement.closest('[dir]');
|
|
185
|
+
let dir = closestDir && closestDir.getAttribute('dir');
|
|
186
|
+
if (dir && dir !== direction && !hasWarned.current) {
|
|
187
|
+
console.warn(`Language directions cannot be nested. ${direction} inside ${dir}.`);
|
|
188
|
+
hasWarned.current = true;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}, [
|
|
192
|
+
direction,
|
|
193
|
+
domRef,
|
|
194
|
+
hasWarned
|
|
195
|
+
]);
|
|
196
|
+
return(/*#__PURE__*/ ($parcel$interopDefault($kmRpa$react)).createElement("div", {
|
|
197
|
+
...$kmRpa$reactariautils.filterDOMProps(otherProps),
|
|
198
|
+
...styleProps,
|
|
199
|
+
...modalProviderProps,
|
|
200
|
+
className: className,
|
|
201
|
+
style: style,
|
|
202
|
+
lang: locale,
|
|
203
|
+
dir: direction,
|
|
204
|
+
ref: domRef
|
|
205
|
+
}, children));
|
|
271
206
|
});
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
207
|
+
function $96cabdf5b0aed55b$export$693cdb10cec23617() {
|
|
208
|
+
return $kmRpa$react.useContext($96cabdf5b0aed55b$var$Context);
|
|
209
|
+
}
|
|
210
|
+
function $96cabdf5b0aed55b$export$521c373ccc32c300(props) {
|
|
211
|
+
let context = $96cabdf5b0aed55b$export$693cdb10cec23617();
|
|
212
|
+
if (!context) return props;
|
|
213
|
+
return Object.assign({
|
|
214
|
+
}, {
|
|
215
|
+
isQuiet: context.isQuiet,
|
|
216
|
+
isEmphasized: context.isEmphasized,
|
|
217
|
+
isDisabled: context.isDisabled,
|
|
218
|
+
isRequired: context.isRequired,
|
|
219
|
+
isReadOnly: context.isReadOnly,
|
|
220
|
+
validationState: context.validationState
|
|
221
|
+
}, props);
|
|
275
222
|
}
|
|
276
223
|
|
|
277
|
-
exports.useProvider = useProvider;
|
|
278
|
-
|
|
279
|
-
function useProviderProps(props) {
|
|
280
|
-
let context = useProvider();
|
|
281
224
|
|
|
282
|
-
|
|
283
|
-
return props;
|
|
284
|
-
}
|
|
225
|
+
$parcel$exportWildcard(module.exports, $96cabdf5b0aed55b$exports);
|
|
285
226
|
|
|
286
|
-
return Object.assign({}, {
|
|
287
|
-
isQuiet: context.isQuiet,
|
|
288
|
-
isEmphasized: context.isEmphasized,
|
|
289
|
-
isDisabled: context.isDisabled,
|
|
290
|
-
isRequired: context.isRequired,
|
|
291
|
-
isReadOnly: context.isReadOnly,
|
|
292
|
-
validationState: context.validationState
|
|
293
|
-
}, props);
|
|
294
|
-
}
|
|
295
227
|
|
|
296
|
-
exports.useProviderProps = useProviderProps;
|
|
297
228
|
//# sourceMappingURL=main.js.map
|