@react-spectrum/utils 3.11.4 → 3.11.6

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.
Files changed (53) hide show
  1. package/dist/BreakpointProvider.main.js +75 -0
  2. package/dist/BreakpointProvider.main.js.map +1 -0
  3. package/dist/BreakpointProvider.mjs +64 -0
  4. package/dist/BreakpointProvider.module.js +64 -0
  5. package/dist/BreakpointProvider.module.js.map +1 -0
  6. package/dist/Slots.main.js +73 -0
  7. package/dist/Slots.main.js.map +1 -0
  8. package/dist/Slots.mjs +61 -0
  9. package/dist/Slots.module.js +61 -0
  10. package/dist/Slots.module.js.map +1 -0
  11. package/dist/classNames.main.js +50 -0
  12. package/dist/classNames.main.js.map +1 -0
  13. package/dist/classNames.mjs +39 -0
  14. package/dist/classNames.module.js +39 -0
  15. package/dist/classNames.module.js.map +1 -0
  16. package/dist/getWrappedElement.main.js +32 -0
  17. package/dist/getWrappedElement.main.js.map +1 -0
  18. package/dist/getWrappedElement.mjs +23 -0
  19. package/dist/getWrappedElement.module.js +23 -0
  20. package/dist/getWrappedElement.module.js.map +1 -0
  21. package/dist/import.mjs +10 -742
  22. package/dist/main.js +37 -773
  23. package/dist/main.js.map +1 -1
  24. package/dist/module.js +10 -742
  25. package/dist/module.js.map +1 -1
  26. package/dist/styleProps.main.js +468 -0
  27. package/dist/styleProps.main.js.map +1 -0
  28. package/dist/styleProps.mjs +456 -0
  29. package/dist/styleProps.module.js +456 -0
  30. package/dist/styleProps.module.js.map +1 -0
  31. package/dist/types.d.ts.map +1 -1
  32. package/dist/useDOMRef.main.js +64 -0
  33. package/dist/useDOMRef.main.js.map +1 -0
  34. package/dist/useDOMRef.mjs +54 -0
  35. package/dist/useDOMRef.module.js +54 -0
  36. package/dist/useDOMRef.module.js.map +1 -0
  37. package/dist/useHasChild.main.js +35 -0
  38. package/dist/useHasChild.main.js.map +1 -0
  39. package/dist/useHasChild.mjs +30 -0
  40. package/dist/useHasChild.module.js +30 -0
  41. package/dist/useHasChild.module.js.map +1 -0
  42. package/dist/useIsMobileDevice.main.js +28 -0
  43. package/dist/useIsMobileDevice.main.js.map +1 -0
  44. package/dist/useIsMobileDevice.mjs +23 -0
  45. package/dist/useIsMobileDevice.module.js +23 -0
  46. package/dist/useIsMobileDevice.module.js.map +1 -0
  47. package/dist/useMediaQuery.main.js +46 -0
  48. package/dist/useMediaQuery.main.js.map +1 -0
  49. package/dist/useMediaQuery.mjs +41 -0
  50. package/dist/useMediaQuery.module.js +41 -0
  51. package/dist/useMediaQuery.module.js.map +1 -0
  52. package/package.json +6 -6
  53. package/src/styleProps.ts +16 -0
package/dist/main.js CHANGED
@@ -1,47 +1,48 @@
1
+ var $e720495fead531ee$exports = require("./classNames.main.js");
2
+ var $c588c81c05dac184$exports = require("./getWrappedElement.main.js");
3
+ var $471052aafc9c8aac$exports = require("./useMediaQuery.main.js");
4
+ var $749a6c35064cd8c6$exports = require("./useDOMRef.main.js");
5
+ var $d3b73be57066120b$exports = require("./styleProps.main.js");
6
+ var $e81916440cf6fd84$exports = require("./Slots.main.js");
7
+ var $67043c48a01bef79$exports = require("./useHasChild.main.js");
8
+ var $e9c08f6fb6c823d1$exports = require("./useIsMobileDevice.main.js");
9
+ var $893a66ba513f4a66$exports = require("./BreakpointProvider.main.js");
1
10
  var $cRUfp$reactariautils = require("@react-aria/utils");
2
- var $cRUfp$clsx = require("clsx");
3
- var $cRUfp$react = require("react");
4
- var $cRUfp$reactariassr = require("@react-aria/ssr");
5
- var $cRUfp$reactariai18n = require("@react-aria/i18n");
6
11
 
7
12
 
8
13
  function $parcel$export(e, n, v, s) {
9
14
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
10
15
  }
11
16
 
12
- function $parcel$interopDefault(a) {
13
- return a && a.__esModule ? a.default : a;
14
- }
15
-
16
- $parcel$export(module.exports, "shouldKeepSpectrumClassNames", () => $e720495fead531ee$export$46d604dce8bf8724);
17
- $parcel$export(module.exports, "keepSpectrumClassNames", () => $e720495fead531ee$export$f9d3bfd10703eb31);
18
- $parcel$export(module.exports, "classNames", () => $e720495fead531ee$export$ce4ab0c55987d1ff);
19
- $parcel$export(module.exports, "getWrappedElement", () => $c588c81c05dac184$export$a5f5a6912b18861c);
20
- $parcel$export(module.exports, "useMediaQuery", () => $471052aafc9c8aac$export$32d5543ab307c01);
21
- $parcel$export(module.exports, "createDOMRef", () => $749a6c35064cd8c6$export$a5795cc979dfae80);
22
- $parcel$export(module.exports, "createFocusableRef", () => $749a6c35064cd8c6$export$79d69eee6ae4b329);
23
- $parcel$export(module.exports, "useDOMRef", () => $749a6c35064cd8c6$export$c2c55ef9111cafd8);
24
- $parcel$export(module.exports, "useFocusableRef", () => $749a6c35064cd8c6$export$96a734597687c040);
25
- $parcel$export(module.exports, "unwrapDOMRef", () => $749a6c35064cd8c6$export$c7e28c72a4823176);
26
- $parcel$export(module.exports, "useUnwrapDOMRef", () => $749a6c35064cd8c6$export$1d5cc31d9d8df817);
27
- $parcel$export(module.exports, "baseStyleProps", () => $d3b73be57066120b$export$fe9c6e915565b4e8);
28
- $parcel$export(module.exports, "viewStyleProps", () => $d3b73be57066120b$export$e0705d1a55f297c);
29
- $parcel$export(module.exports, "dimensionValue", () => $d3b73be57066120b$export$abc24f5b99744ea6);
30
- $parcel$export(module.exports, "responsiveDimensionValue", () => $d3b73be57066120b$export$f348bec194f2e6b5);
31
- $parcel$export(module.exports, "convertStyleProps", () => $d3b73be57066120b$export$f3c39bb9534218d0);
32
- $parcel$export(module.exports, "useStyleProps", () => $d3b73be57066120b$export$b8e6fb9d2dff3f41);
33
- $parcel$export(module.exports, "passthroughStyle", () => $d3b73be57066120b$export$46b6c81d11d2c30a);
34
- $parcel$export(module.exports, "getResponsiveProp", () => $d3b73be57066120b$export$52dbfdbe1b2c3541);
35
- $parcel$export(module.exports, "useSlotProps", () => $e81916440cf6fd84$export$1e5c9e6e4e15efe3);
36
- $parcel$export(module.exports, "cssModuleToSlots", () => $e81916440cf6fd84$export$365cf34cda9978e2);
37
- $parcel$export(module.exports, "SlotProvider", () => $e81916440cf6fd84$export$8107b24b91795686);
38
- $parcel$export(module.exports, "ClearSlots", () => $e81916440cf6fd84$export$ceb145244332b7a2);
39
- $parcel$export(module.exports, "useHasChild", () => $67043c48a01bef79$export$e52e2242b6d0f1d4);
40
- $parcel$export(module.exports, "useIsMobileDevice", () => $e9c08f6fb6c823d1$export$736bf165441b18c7);
17
+ $parcel$export(module.exports, "shouldKeepSpectrumClassNames", () => $e720495fead531ee$exports.shouldKeepSpectrumClassNames);
18
+ $parcel$export(module.exports, "keepSpectrumClassNames", () => $e720495fead531ee$exports.keepSpectrumClassNames);
19
+ $parcel$export(module.exports, "classNames", () => $e720495fead531ee$exports.classNames);
20
+ $parcel$export(module.exports, "getWrappedElement", () => $c588c81c05dac184$exports.getWrappedElement);
21
+ $parcel$export(module.exports, "useMediaQuery", () => $471052aafc9c8aac$exports.useMediaQuery);
22
+ $parcel$export(module.exports, "createDOMRef", () => $749a6c35064cd8c6$exports.createDOMRef);
23
+ $parcel$export(module.exports, "createFocusableRef", () => $749a6c35064cd8c6$exports.createFocusableRef);
24
+ $parcel$export(module.exports, "useDOMRef", () => $749a6c35064cd8c6$exports.useDOMRef);
25
+ $parcel$export(module.exports, "useFocusableRef", () => $749a6c35064cd8c6$exports.useFocusableRef);
26
+ $parcel$export(module.exports, "unwrapDOMRef", () => $749a6c35064cd8c6$exports.unwrapDOMRef);
27
+ $parcel$export(module.exports, "useUnwrapDOMRef", () => $749a6c35064cd8c6$exports.useUnwrapDOMRef);
28
+ $parcel$export(module.exports, "baseStyleProps", () => $d3b73be57066120b$exports.baseStyleProps);
29
+ $parcel$export(module.exports, "viewStyleProps", () => $d3b73be57066120b$exports.viewStyleProps);
30
+ $parcel$export(module.exports, "dimensionValue", () => $d3b73be57066120b$exports.dimensionValue);
31
+ $parcel$export(module.exports, "responsiveDimensionValue", () => $d3b73be57066120b$exports.responsiveDimensionValue);
32
+ $parcel$export(module.exports, "convertStyleProps", () => $d3b73be57066120b$exports.convertStyleProps);
33
+ $parcel$export(module.exports, "useStyleProps", () => $d3b73be57066120b$exports.useStyleProps);
34
+ $parcel$export(module.exports, "passthroughStyle", () => $d3b73be57066120b$exports.passthroughStyle);
35
+ $parcel$export(module.exports, "getResponsiveProp", () => $d3b73be57066120b$exports.getResponsiveProp);
36
+ $parcel$export(module.exports, "useSlotProps", () => $e81916440cf6fd84$exports.useSlotProps);
37
+ $parcel$export(module.exports, "cssModuleToSlots", () => $e81916440cf6fd84$exports.cssModuleToSlots);
38
+ $parcel$export(module.exports, "SlotProvider", () => $e81916440cf6fd84$exports.SlotProvider);
39
+ $parcel$export(module.exports, "ClearSlots", () => $e81916440cf6fd84$exports.ClearSlots);
40
+ $parcel$export(module.exports, "useHasChild", () => $67043c48a01bef79$exports.useHasChild);
41
+ $parcel$export(module.exports, "useIsMobileDevice", () => $e9c08f6fb6c823d1$exports.useIsMobileDevice);
41
42
  $parcel$export(module.exports, "useValueEffect", () => $cRUfp$reactariautils.useValueEffect);
42
- $parcel$export(module.exports, "BreakpointProvider", () => $893a66ba513f4a66$export$8214320346cf5104);
43
- $parcel$export(module.exports, "useMatchedBreakpoints", () => $893a66ba513f4a66$export$140ae7baa51cca23);
44
- $parcel$export(module.exports, "useBreakpoint", () => $893a66ba513f4a66$export$199d6754bdf4e1e3);
43
+ $parcel$export(module.exports, "BreakpointProvider", () => $893a66ba513f4a66$exports.BreakpointProvider);
44
+ $parcel$export(module.exports, "useMatchedBreakpoints", () => $893a66ba513f4a66$exports.useMatchedBreakpoints);
45
+ $parcel$export(module.exports, "useBreakpoint", () => $893a66ba513f4a66$exports.useBreakpoint);
45
46
  $parcel$export(module.exports, "useResizeObserver", () => $cRUfp$reactariautils.useResizeObserver);
46
47
  /*
47
48
  * Copyright 2020 Adobe. All rights reserved.
@@ -54,749 +55,12 @@ $parcel$export(module.exports, "useResizeObserver", () => $cRUfp$reactariautils.
54
55
  * OF ANY KIND, either express or implied. See the License for the specific language
55
56
  * governing permissions and limitations under the License.
56
57
  */ /// <reference types="css-module-types" />
57
- /*
58
- * Copyright 2020 Adobe. All rights reserved.
59
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
60
- * you may not use this file except in compliance with the License. You may obtain a copy
61
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
62
- *
63
- * Unless required by applicable law or agreed to in writing, software distributed under
64
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
65
- * OF ANY KIND, either express or implied. See the License for the specific language
66
- * governing permissions and limitations under the License.
67
- */
68
- let $e720495fead531ee$export$46d604dce8bf8724 = false;
69
- function $e720495fead531ee$export$f9d3bfd10703eb31() {
70
- $e720495fead531ee$export$46d604dce8bf8724 = true;
71
- console.warn("Legacy spectrum-prefixed class names enabled for backward compatibility. We recommend replacing instances of CSS overrides targeting spectrum selectors in your app with custom class names of your own, and disabling this flag.");
72
- }
73
- function $e720495fead531ee$export$ce4ab0c55987d1ff(cssModule, ...values) {
74
- let classes = [];
75
- for (let value of values){
76
- if (typeof value === "object" && value) {
77
- let mapped = {};
78
- for(let key in value){
79
- if (cssModule[key]) mapped[cssModule[key]] = value[key];
80
- if ($e720495fead531ee$export$46d604dce8bf8724 || !cssModule[key]) mapped[key] = value[key];
81
- }
82
- classes.push(mapped);
83
- } else if (typeof value === "string") {
84
- if (cssModule[value]) classes.push(cssModule[value]);
85
- if ($e720495fead531ee$export$46d604dce8bf8724 || !cssModule[value]) classes.push(value);
86
- } else classes.push(value);
87
- }
88
- return (0, ($parcel$interopDefault($cRUfp$clsx)))(...classes);
89
- }
90
-
91
-
92
- /*
93
- * Copyright 2020 Adobe. All rights reserved.
94
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
95
- * you may not use this file except in compliance with the License. You may obtain a copy
96
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
97
- *
98
- * Unless required by applicable law or agreed to in writing, software distributed under
99
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
100
- * OF ANY KIND, either express or implied. See the License for the specific language
101
- * governing permissions and limitations under the License.
102
- */
103
- function $c588c81c05dac184$export$a5f5a6912b18861c(children) {
104
- let element;
105
- if (typeof children === "string") element = /*#__PURE__*/ (0, ($parcel$interopDefault($cRUfp$react))).createElement("span", null, children);
106
- else element = (0, ($parcel$interopDefault($cRUfp$react))).Children.only(children);
107
- return element;
108
- }
109
-
110
-
111
- /*
112
- * Copyright 2020 Adobe. All rights reserved.
113
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
114
- * you may not use this file except in compliance with the License. You may obtain a copy
115
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
116
- *
117
- * Unless required by applicable law or agreed to in writing, software distributed under
118
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
119
- * OF ANY KIND, either express or implied. See the License for the specific language
120
- * governing permissions and limitations under the License.
121
- */
122
58
 
123
- function $471052aafc9c8aac$export$32d5543ab307c01(query) {
124
- let supportsMatchMedia = typeof window !== "undefined" && typeof window.matchMedia === "function";
125
- let [matches, setMatches] = (0, $cRUfp$react.useState)(()=>supportsMatchMedia ? window.matchMedia(query).matches : false);
126
- (0, $cRUfp$react.useEffect)(()=>{
127
- if (!supportsMatchMedia) return;
128
- let mq = window.matchMedia(query);
129
- let onChange = (evt)=>{
130
- setMatches(evt.matches);
131
- };
132
- mq.addListener(onChange);
133
- return ()=>{
134
- mq.removeListener(onChange);
135
- };
136
- }, [
137
- supportsMatchMedia,
138
- query
139
- ]);
140
- // If in SSR, the media query should never match. Once the page hydrates,
141
- // this will update and the real value will be returned.
142
- let isSSR = (0, $cRUfp$reactariassr.useIsSSR)();
143
- return isSSR ? false : matches;
144
- }
145
59
 
146
60
 
147
- /*
148
- * Copyright 2020 Adobe. All rights reserved.
149
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
150
- * you may not use this file except in compliance with the License. You may obtain a copy
151
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
152
- *
153
- * Unless required by applicable law or agreed to in writing, software distributed under
154
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
155
- * OF ANY KIND, either express or implied. See the License for the specific language
156
- * governing permissions and limitations under the License.
157
- */
158
- function $749a6c35064cd8c6$export$a5795cc979dfae80(ref) {
159
- return {
160
- UNSAFE_getDOMNode () {
161
- return ref.current;
162
- }
163
- };
164
- }
165
- function $749a6c35064cd8c6$export$79d69eee6ae4b329(domRef, focusableRef = domRef) {
166
- return {
167
- ...$749a6c35064cd8c6$export$a5795cc979dfae80(domRef),
168
- focus () {
169
- if (focusableRef.current) focusableRef.current.focus();
170
- }
171
- };
172
- }
173
- function $749a6c35064cd8c6$export$c2c55ef9111cafd8(ref) {
174
- let domRef = (0, $cRUfp$react.useRef)(null);
175
- (0, $cRUfp$react.useImperativeHandle)(ref, ()=>$749a6c35064cd8c6$export$a5795cc979dfae80(domRef));
176
- return domRef;
177
- }
178
- function $749a6c35064cd8c6$export$96a734597687c040(ref, focusableRef) {
179
- let domRef = (0, $cRUfp$react.useRef)(null);
180
- (0, $cRUfp$react.useImperativeHandle)(ref, ()=>$749a6c35064cd8c6$export$79d69eee6ae4b329(domRef, focusableRef));
181
- return domRef;
182
- }
183
- function $749a6c35064cd8c6$export$c7e28c72a4823176(ref) {
184
- return {
185
- get current () {
186
- return ref.current && ref.current.UNSAFE_getDOMNode();
187
- }
188
- };
189
- }
190
- function $749a6c35064cd8c6$export$1d5cc31d9d8df817(ref) {
191
- return (0, $cRUfp$react.useMemo)(()=>$749a6c35064cd8c6$export$c7e28c72a4823176(ref), [
192
- ref
193
- ]);
194
- }
195
61
 
196
62
 
197
- /*
198
- * Copyright 2020 Adobe. All rights reserved.
199
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
200
- * you may not use this file except in compliance with the License. You may obtain a copy
201
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
202
- *
203
- * Unless required by applicable law or agreed to in writing, software distributed under
204
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
205
- * OF ANY KIND, either express or implied. See the License for the specific language
206
- * governing permissions and limitations under the License.
207
- */
208
63
 
209
- const $893a66ba513f4a66$var$Context = /*#__PURE__*/ (0, ($parcel$interopDefault($cRUfp$react))).createContext(null);
210
- $893a66ba513f4a66$var$Context.displayName = "BreakpointContext";
211
- function $893a66ba513f4a66$export$8214320346cf5104(props) {
212
- let { children: children, matchedBreakpoints: matchedBreakpoints } = props;
213
- return /*#__PURE__*/ (0, ($parcel$interopDefault($cRUfp$react))).createElement($893a66ba513f4a66$var$Context.Provider, {
214
- value: {
215
- matchedBreakpoints: matchedBreakpoints
216
- }
217
- }, children);
218
- }
219
- function $893a66ba513f4a66$export$140ae7baa51cca23(breakpoints) {
220
- let entries = Object.entries(breakpoints).sort(([, valueA], [, valueB])=>valueB - valueA);
221
- let breakpointQueries = entries.map(([, value])=>`(min-width: ${value}px)`);
222
- let supportsMatchMedia = typeof window !== "undefined" && typeof window.matchMedia === "function";
223
- let getBreakpointHandler = ()=>{
224
- let matched = [];
225
- for(let i in breakpointQueries){
226
- let query = breakpointQueries[i];
227
- if (window.matchMedia(query).matches) matched.push(entries[i][0]);
228
- }
229
- matched.push("base");
230
- return matched;
231
- };
232
- let [breakpoint, setBreakpoint] = (0, $cRUfp$react.useState)(()=>supportsMatchMedia ? getBreakpointHandler() : [
233
- "base"
234
- ]);
235
- (0, $cRUfp$react.useEffect)(()=>{
236
- if (!supportsMatchMedia) return;
237
- let onResize = ()=>{
238
- const breakpointHandler = getBreakpointHandler();
239
- setBreakpoint((previousBreakpointHandler)=>{
240
- if (previousBreakpointHandler.length !== breakpointHandler.length || previousBreakpointHandler.some((breakpoint, idx)=>breakpoint !== breakpointHandler[idx])) return [
241
- ...breakpointHandler
242
- ]; // Return a new array to force state change
243
- return previousBreakpointHandler;
244
- });
245
- };
246
- window.addEventListener("resize", onResize);
247
- return ()=>{
248
- window.removeEventListener("resize", onResize);
249
- };
250
- // eslint-disable-next-line react-hooks/exhaustive-deps
251
- }, [
252
- supportsMatchMedia
253
- ]);
254
- // If in SSR, the media query should never match. Once the page hydrates,
255
- // this will update and the real value will be returned.
256
- let isSSR = (0, $cRUfp$reactariassr.useIsSSR)();
257
- return isSSR ? [
258
- "base"
259
- ] : breakpoint;
260
- }
261
- function $893a66ba513f4a66$export$199d6754bdf4e1e3() {
262
- return (0, $cRUfp$react.useContext)($893a66ba513f4a66$var$Context);
263
- }
264
-
265
-
266
-
267
- const $d3b73be57066120b$export$fe9c6e915565b4e8 = {
268
- margin: [
269
- "margin",
270
- $d3b73be57066120b$export$abc24f5b99744ea6
271
- ],
272
- marginStart: [
273
- $d3b73be57066120b$var$rtl("marginLeft", "marginRight"),
274
- $d3b73be57066120b$export$abc24f5b99744ea6
275
- ],
276
- marginEnd: [
277
- $d3b73be57066120b$var$rtl("marginRight", "marginLeft"),
278
- $d3b73be57066120b$export$abc24f5b99744ea6
279
- ],
280
- // marginLeft: ['marginLeft', dimensionValue],
281
- // marginRight: ['marginRight', dimensionValue],
282
- marginTop: [
283
- "marginTop",
284
- $d3b73be57066120b$export$abc24f5b99744ea6
285
- ],
286
- marginBottom: [
287
- "marginBottom",
288
- $d3b73be57066120b$export$abc24f5b99744ea6
289
- ],
290
- marginX: [
291
- [
292
- "marginLeft",
293
- "marginRight"
294
- ],
295
- $d3b73be57066120b$export$abc24f5b99744ea6
296
- ],
297
- marginY: [
298
- [
299
- "marginTop",
300
- "marginBottom"
301
- ],
302
- $d3b73be57066120b$export$abc24f5b99744ea6
303
- ],
304
- width: [
305
- "width",
306
- $d3b73be57066120b$export$abc24f5b99744ea6
307
- ],
308
- height: [
309
- "height",
310
- $d3b73be57066120b$export$abc24f5b99744ea6
311
- ],
312
- minWidth: [
313
- "minWidth",
314
- $d3b73be57066120b$export$abc24f5b99744ea6
315
- ],
316
- minHeight: [
317
- "minHeight",
318
- $d3b73be57066120b$export$abc24f5b99744ea6
319
- ],
320
- maxWidth: [
321
- "maxWidth",
322
- $d3b73be57066120b$export$abc24f5b99744ea6
323
- ],
324
- maxHeight: [
325
- "maxHeight",
326
- $d3b73be57066120b$export$abc24f5b99744ea6
327
- ],
328
- isHidden: [
329
- "display",
330
- $d3b73be57066120b$var$hiddenValue
331
- ],
332
- alignSelf: [
333
- "alignSelf",
334
- $d3b73be57066120b$export$46b6c81d11d2c30a
335
- ],
336
- justifySelf: [
337
- "justifySelf",
338
- $d3b73be57066120b$export$46b6c81d11d2c30a
339
- ],
340
- position: [
341
- "position",
342
- $d3b73be57066120b$var$anyValue
343
- ],
344
- zIndex: [
345
- "zIndex",
346
- $d3b73be57066120b$var$anyValue
347
- ],
348
- top: [
349
- "top",
350
- $d3b73be57066120b$export$abc24f5b99744ea6
351
- ],
352
- bottom: [
353
- "bottom",
354
- $d3b73be57066120b$export$abc24f5b99744ea6
355
- ],
356
- start: [
357
- $d3b73be57066120b$var$rtl("left", "right"),
358
- $d3b73be57066120b$export$abc24f5b99744ea6
359
- ],
360
- end: [
361
- $d3b73be57066120b$var$rtl("right", "left"),
362
- $d3b73be57066120b$export$abc24f5b99744ea6
363
- ],
364
- left: [
365
- "left",
366
- $d3b73be57066120b$export$abc24f5b99744ea6
367
- ],
368
- right: [
369
- "right",
370
- $d3b73be57066120b$export$abc24f5b99744ea6
371
- ],
372
- order: [
373
- "order",
374
- $d3b73be57066120b$var$anyValue
375
- ],
376
- flex: [
377
- "flex",
378
- $d3b73be57066120b$var$flexValue
379
- ],
380
- flexGrow: [
381
- "flexGrow",
382
- $d3b73be57066120b$export$46b6c81d11d2c30a
383
- ],
384
- flexShrink: [
385
- "flexShrink",
386
- $d3b73be57066120b$export$46b6c81d11d2c30a
387
- ],
388
- flexBasis: [
389
- "flexBasis",
390
- $d3b73be57066120b$export$46b6c81d11d2c30a
391
- ],
392
- gridArea: [
393
- "gridArea",
394
- $d3b73be57066120b$export$46b6c81d11d2c30a
395
- ],
396
- gridColumn: [
397
- "gridColumn",
398
- $d3b73be57066120b$export$46b6c81d11d2c30a
399
- ],
400
- gridColumnEnd: [
401
- "gridColumnEnd",
402
- $d3b73be57066120b$export$46b6c81d11d2c30a
403
- ],
404
- gridColumnStart: [
405
- "gridColumnStart",
406
- $d3b73be57066120b$export$46b6c81d11d2c30a
407
- ],
408
- gridRow: [
409
- "gridRow",
410
- $d3b73be57066120b$export$46b6c81d11d2c30a
411
- ],
412
- gridRowEnd: [
413
- "gridRowEnd",
414
- $d3b73be57066120b$export$46b6c81d11d2c30a
415
- ],
416
- gridRowStart: [
417
- "gridRowStart",
418
- $d3b73be57066120b$export$46b6c81d11d2c30a
419
- ]
420
- };
421
- const $d3b73be57066120b$export$e0705d1a55f297c = {
422
- ...$d3b73be57066120b$export$fe9c6e915565b4e8,
423
- backgroundColor: [
424
- "backgroundColor",
425
- $d3b73be57066120b$var$backgroundColorValue
426
- ],
427
- borderWidth: [
428
- "borderWidth",
429
- $d3b73be57066120b$var$borderSizeValue
430
- ],
431
- borderStartWidth: [
432
- $d3b73be57066120b$var$rtl("borderLeftWidth", "borderRightWidth"),
433
- $d3b73be57066120b$var$borderSizeValue
434
- ],
435
- borderEndWidth: [
436
- $d3b73be57066120b$var$rtl("borderRightWidth", "borderLeftWidth"),
437
- $d3b73be57066120b$var$borderSizeValue
438
- ],
439
- borderLeftWidth: [
440
- "borderLeftWidth",
441
- $d3b73be57066120b$var$borderSizeValue
442
- ],
443
- borderRightWidth: [
444
- "borderRightWidth",
445
- $d3b73be57066120b$var$borderSizeValue
446
- ],
447
- borderTopWidth: [
448
- "borderTopWidth",
449
- $d3b73be57066120b$var$borderSizeValue
450
- ],
451
- borderBottomWidth: [
452
- "borderBottomWidth",
453
- $d3b73be57066120b$var$borderSizeValue
454
- ],
455
- borderXWidth: [
456
- [
457
- "borderLeftWidth",
458
- "borderRightWidth"
459
- ],
460
- $d3b73be57066120b$var$borderSizeValue
461
- ],
462
- borderYWidth: [
463
- [
464
- "borderTopWidth",
465
- "borderBottomWidth"
466
- ],
467
- $d3b73be57066120b$var$borderSizeValue
468
- ],
469
- borderColor: [
470
- "borderColor",
471
- $d3b73be57066120b$var$borderColorValue
472
- ],
473
- borderStartColor: [
474
- $d3b73be57066120b$var$rtl("borderLeftColor", "borderRightColor"),
475
- $d3b73be57066120b$var$borderColorValue
476
- ],
477
- borderEndColor: [
478
- $d3b73be57066120b$var$rtl("borderRightColor", "borderLeftColor"),
479
- $d3b73be57066120b$var$borderColorValue
480
- ],
481
- borderLeftColor: [
482
- "borderLeftColor",
483
- $d3b73be57066120b$var$borderColorValue
484
- ],
485
- borderRightColor: [
486
- "borderRightColor",
487
- $d3b73be57066120b$var$borderColorValue
488
- ],
489
- borderTopColor: [
490
- "borderTopColor",
491
- $d3b73be57066120b$var$borderColorValue
492
- ],
493
- borderBottomColor: [
494
- "borderBottomColor",
495
- $d3b73be57066120b$var$borderColorValue
496
- ],
497
- borderXColor: [
498
- [
499
- "borderLeftColor",
500
- "borderRightColor"
501
- ],
502
- $d3b73be57066120b$var$borderColorValue
503
- ],
504
- borderYColor: [
505
- [
506
- "borderTopColor",
507
- "borderBottomColor"
508
- ],
509
- $d3b73be57066120b$var$borderColorValue
510
- ],
511
- borderRadius: [
512
- "borderRadius",
513
- $d3b73be57066120b$var$borderRadiusValue
514
- ],
515
- borderTopStartRadius: [
516
- $d3b73be57066120b$var$rtl("borderTopLeftRadius", "borderTopRightRadius"),
517
- $d3b73be57066120b$var$borderRadiusValue
518
- ],
519
- borderTopEndRadius: [
520
- $d3b73be57066120b$var$rtl("borderTopRightRadius", "borderTopLeftRadius"),
521
- $d3b73be57066120b$var$borderRadiusValue
522
- ],
523
- borderBottomStartRadius: [
524
- $d3b73be57066120b$var$rtl("borderBottomLeftRadius", "borderBottomRightRadius"),
525
- $d3b73be57066120b$var$borderRadiusValue
526
- ],
527
- borderBottomEndRadius: [
528
- $d3b73be57066120b$var$rtl("borderBottomRightRadius", "borderBottomLeftRadius"),
529
- $d3b73be57066120b$var$borderRadiusValue
530
- ],
531
- borderTopLeftRadius: [
532
- "borderTopLeftRadius",
533
- $d3b73be57066120b$var$borderRadiusValue
534
- ],
535
- borderTopRightRadius: [
536
- "borderTopRightRadius",
537
- $d3b73be57066120b$var$borderRadiusValue
538
- ],
539
- borderBottomLeftRadius: [
540
- "borderBottomLeftRadius",
541
- $d3b73be57066120b$var$borderRadiusValue
542
- ],
543
- borderBottomRightRadius: [
544
- "borderBottomRightRadius",
545
- $d3b73be57066120b$var$borderRadiusValue
546
- ],
547
- padding: [
548
- "padding",
549
- $d3b73be57066120b$export$abc24f5b99744ea6
550
- ],
551
- paddingStart: [
552
- $d3b73be57066120b$var$rtl("paddingLeft", "paddingRight"),
553
- $d3b73be57066120b$export$abc24f5b99744ea6
554
- ],
555
- paddingEnd: [
556
- $d3b73be57066120b$var$rtl("paddingRight", "paddingLeft"),
557
- $d3b73be57066120b$export$abc24f5b99744ea6
558
- ],
559
- paddingLeft: [
560
- "paddingLeft",
561
- $d3b73be57066120b$export$abc24f5b99744ea6
562
- ],
563
- paddingRight: [
564
- "paddingRight",
565
- $d3b73be57066120b$export$abc24f5b99744ea6
566
- ],
567
- paddingTop: [
568
- "paddingTop",
569
- $d3b73be57066120b$export$abc24f5b99744ea6
570
- ],
571
- paddingBottom: [
572
- "paddingBottom",
573
- $d3b73be57066120b$export$abc24f5b99744ea6
574
- ],
575
- paddingX: [
576
- [
577
- "paddingLeft",
578
- "paddingRight"
579
- ],
580
- $d3b73be57066120b$export$abc24f5b99744ea6
581
- ],
582
- paddingY: [
583
- [
584
- "paddingTop",
585
- "paddingBottom"
586
- ],
587
- $d3b73be57066120b$export$abc24f5b99744ea6
588
- ],
589
- overflow: [
590
- "overflow",
591
- $d3b73be57066120b$export$46b6c81d11d2c30a
592
- ]
593
- };
594
- const $d3b73be57066120b$var$borderStyleProps = {
595
- borderWidth: "borderStyle",
596
- borderLeftWidth: "borderLeftStyle",
597
- borderRightWidth: "borderRightStyle",
598
- borderTopWidth: "borderTopStyle",
599
- borderBottomWidth: "borderBottomStyle"
600
- };
601
- function $d3b73be57066120b$var$rtl(ltr, rtl) {
602
- return (direction)=>direction === "rtl" ? rtl : ltr;
603
- }
604
- const $d3b73be57066120b$var$UNIT_RE = /(%|px|em|rem|vw|vh|auto|cm|mm|in|pt|pc|ex|ch|rem|vmin|vmax|fr)$/;
605
- const $d3b73be57066120b$var$FUNC_RE = /^\s*\w+\(/;
606
- const $d3b73be57066120b$var$SPECTRUM_VARIABLE_RE = /(static-)?size-\d+|single-line-(height|width)/g;
607
- function $d3b73be57066120b$export$abc24f5b99744ea6(value) {
608
- if (typeof value === "number") return value + "px";
609
- if ($d3b73be57066120b$var$UNIT_RE.test(value)) return value;
610
- if ($d3b73be57066120b$var$FUNC_RE.test(value)) return value.replace($d3b73be57066120b$var$SPECTRUM_VARIABLE_RE, "var(--spectrum-global-dimension-$&, var(--spectrum-alias-$&))");
611
- return `var(--spectrum-global-dimension-${value}, var(--spectrum-alias-${value}))`;
612
- }
613
- function $d3b73be57066120b$export$f348bec194f2e6b5(value, matchedBreakpoints) {
614
- value = $d3b73be57066120b$export$52dbfdbe1b2c3541(value, matchedBreakpoints);
615
- return $d3b73be57066120b$export$abc24f5b99744ea6(value);
616
- }
617
- function $d3b73be57066120b$var$colorValue(value, type = "default", version = 5) {
618
- if (version > 5) return `var(--spectrum-${value}, var(--spectrum-semantic-${value}-color-${type}))`;
619
- return `var(--spectrum-legacy-color-${value}, var(--spectrum-global-color-${value}, var(--spectrum-semantic-${value}-color-${type})))`;
620
- }
621
- function $d3b73be57066120b$var$backgroundColorValue(value, version = 5) {
622
- return `var(--spectrum-alias-background-color-${value}, ${$d3b73be57066120b$var$colorValue(value, "background", version)})`;
623
- }
624
- function $d3b73be57066120b$var$borderColorValue(value, version = 5) {
625
- if (value === "default") return "var(--spectrum-alias-border-color)";
626
- return `var(--spectrum-alias-border-color-${value}, ${$d3b73be57066120b$var$colorValue(value, "border", version)})`;
627
- }
628
- function $d3b73be57066120b$var$borderSizeValue(value) {
629
- return value && value !== "none" ? `var(--spectrum-alias-border-size-${value})` : "0";
630
- }
631
- function $d3b73be57066120b$var$borderRadiusValue(value) {
632
- return `var(--spectrum-alias-border-radius-${value})`;
633
- }
634
- function $d3b73be57066120b$var$hiddenValue(value) {
635
- return value ? "none" : undefined;
636
- }
637
- function $d3b73be57066120b$var$anyValue(value) {
638
- return value;
639
- }
640
- function $d3b73be57066120b$var$flexValue(value) {
641
- if (typeof value === "boolean") return value ? "1" : undefined;
642
- return "" + value;
643
- }
644
- function $d3b73be57066120b$export$f3c39bb9534218d0(props, handlers, direction, matchedBreakpoints) {
645
- let style = {};
646
- for(let key in props){
647
- let styleProp = handlers[key];
648
- if (!styleProp || props[key] == null) continue;
649
- let [name, convert] = styleProp;
650
- if (typeof name === "function") name = name(direction);
651
- let prop = $d3b73be57066120b$export$52dbfdbe1b2c3541(props[key], matchedBreakpoints);
652
- let value = convert(prop, props.colorVersion);
653
- if (Array.isArray(name)) for (let k of name)style[k] = value;
654
- else style[name] = value;
655
- }
656
- for(let prop in $d3b73be57066120b$var$borderStyleProps)if (style[prop]) {
657
- style[$d3b73be57066120b$var$borderStyleProps[prop]] = "solid";
658
- style.boxSizing = "border-box";
659
- }
660
- return style;
661
- }
662
- function $d3b73be57066120b$export$b8e6fb9d2dff3f41(props, handlers = $d3b73be57066120b$export$fe9c6e915565b4e8, options = {}) {
663
- let { UNSAFE_className: UNSAFE_className, UNSAFE_style: UNSAFE_style, ...otherProps } = props;
664
- let breakpointProvider = (0, $893a66ba513f4a66$export$199d6754bdf4e1e3)();
665
- let { direction: direction } = (0, $cRUfp$reactariai18n.useLocale)();
666
- let { matchedBreakpoints: matchedBreakpoints = (breakpointProvider === null || breakpointProvider === void 0 ? void 0 : breakpointProvider.matchedBreakpoints) || [
667
- "base"
668
- ] } = options;
669
- let styles = $d3b73be57066120b$export$f3c39bb9534218d0(props, handlers, direction, matchedBreakpoints);
670
- let style = {
671
- ...UNSAFE_style,
672
- ...styles
673
- };
674
- // @ts-ignore
675
- if (otherProps.className) console.warn("The className prop is unsafe and is unsupported in React Spectrum v3. Please use style props with Spectrum variables, or UNSAFE_className if you absolutely must do something custom. Note that this may break in future versions due to DOM structure changes.");
676
- // @ts-ignore
677
- if (otherProps.style) console.warn("The style prop is unsafe and is unsupported in React Spectrum v3. Please use style props with Spectrum variables, or UNSAFE_style if you absolutely must do something custom. Note that this may break in future versions due to DOM structure changes.");
678
- let styleProps = {
679
- style: style,
680
- className: UNSAFE_className
681
- };
682
- if ($d3b73be57066120b$export$52dbfdbe1b2c3541(props.isHidden, matchedBreakpoints)) styleProps.hidden = true;
683
- return {
684
- styleProps: styleProps
685
- };
686
- }
687
- function $d3b73be57066120b$export$46b6c81d11d2c30a(value) {
688
- return value;
689
- }
690
- function $d3b73be57066120b$export$52dbfdbe1b2c3541(prop, matchedBreakpoints) {
691
- if (prop && typeof prop === "object" && !Array.isArray(prop)) {
692
- for(let i = 0; i < matchedBreakpoints.length; i++){
693
- let breakpoint = matchedBreakpoints[i];
694
- if (prop[breakpoint] != null) return prop[breakpoint];
695
- }
696
- return prop.base;
697
- }
698
- return prop;
699
- }
700
-
701
-
702
- /*
703
- * Copyright 2020 Adobe. All rights reserved.
704
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
705
- * you may not use this file except in compliance with the License. You may obtain a copy
706
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
707
- *
708
- * Unless required by applicable law or agreed to in writing, software distributed under
709
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
710
- * OF ANY KIND, either express or implied. See the License for the specific language
711
- * governing permissions and limitations under the License.
712
- */
713
-
714
- let $e81916440cf6fd84$var$SlotContext = /*#__PURE__*/ (0, ($parcel$interopDefault($cRUfp$react))).createContext(null);
715
- function $e81916440cf6fd84$export$1e5c9e6e4e15efe3(props, defaultSlot) {
716
- let slot = props.slot || defaultSlot;
717
- let { [slot]: slotProps = {} } = (0, $cRUfp$react.useContext)($e81916440cf6fd84$var$SlotContext) || {};
718
- return (0, $cRUfp$reactariautils.mergeProps)(props, (0, $cRUfp$reactariautils.mergeProps)(slotProps, {
719
- id: props.id
720
- }));
721
- }
722
- function $e81916440cf6fd84$export$365cf34cda9978e2(cssModule) {
723
- return Object.keys(cssModule).reduce((acc, slot)=>{
724
- acc[slot] = {
725
- UNSAFE_className: cssModule[slot]
726
- };
727
- return acc;
728
- }, {});
729
- }
730
- function $e81916440cf6fd84$export$8107b24b91795686(props) {
731
- // eslint-disable-next-line react-hooks/exhaustive-deps
732
- let parentSlots = (0, $cRUfp$react.useContext)($e81916440cf6fd84$var$SlotContext) || {};
733
- let { slots: slots = {}, children: children } = props;
734
- // Merge props for each slot from parent context and props
735
- let value = (0, $cRUfp$react.useMemo)(()=>Object.keys(parentSlots).concat(Object.keys(slots)).reduce((o, p)=>({
736
- ...o,
737
- [p]: (0, $cRUfp$reactariautils.mergeProps)(parentSlots[p] || {}, slots[p] || {})
738
- }), {}), [
739
- parentSlots,
740
- slots
741
- ]);
742
- return /*#__PURE__*/ (0, ($parcel$interopDefault($cRUfp$react))).createElement($e81916440cf6fd84$var$SlotContext.Provider, {
743
- value: value
744
- }, children);
745
- }
746
- function $e81916440cf6fd84$export$ceb145244332b7a2(props) {
747
- let { children: children, ...otherProps } = props;
748
- let content = children;
749
- if ((0, ($parcel$interopDefault($cRUfp$react))).Children.toArray(children).length <= 1) {
750
- if (typeof children === "function") content = /*#__PURE__*/ (0, ($parcel$interopDefault($cRUfp$react))).cloneElement((0, ($parcel$interopDefault($cRUfp$react))).Children.only(children), otherProps);
751
- }
752
- return /*#__PURE__*/ (0, ($parcel$interopDefault($cRUfp$react))).createElement($e81916440cf6fd84$var$SlotContext.Provider, {
753
- value: {}
754
- }, content);
755
- }
756
-
757
-
758
- /*
759
- * Copyright 2020 Adobe. All rights reserved.
760
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
761
- * you may not use this file except in compliance with the License. You may obtain a copy
762
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
763
- *
764
- * Unless required by applicable law or agreed to in writing, software distributed under
765
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
766
- * OF ANY KIND, either express or implied. See the License for the specific language
767
- * governing permissions and limitations under the License.
768
- */
769
-
770
- function $67043c48a01bef79$export$e52e2242b6d0f1d4(query, ref) {
771
- let [hasChild, setHasChild] = (0, $cRUfp$react.useState)(true);
772
- (0, $cRUfp$reactariautils.useLayoutEffect)(()=>{
773
- setHasChild(!!(ref.current && ref.current.querySelector(query)));
774
- }, [
775
- setHasChild,
776
- query,
777
- ref
778
- ]);
779
- return hasChild;
780
- }
781
-
782
-
783
- /*
784
- * Copyright 2020 Adobe. All rights reserved.
785
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
786
- * you may not use this file except in compliance with the License. You may obtain a copy
787
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
788
- *
789
- * Unless required by applicable law or agreed to in writing, software distributed under
790
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
791
- * OF ANY KIND, either express or implied. See the License for the specific language
792
- * governing permissions and limitations under the License.
793
- */
794
- const $e9c08f6fb6c823d1$var$MOBILE_SCREEN_WIDTH = 700;
795
- function $e9c08f6fb6c823d1$export$736bf165441b18c7() {
796
- let isSSR = (0, $cRUfp$reactariassr.useIsSSR)();
797
- if (isSSR || typeof window === "undefined") return false;
798
- return window.screen.width <= $e9c08f6fb6c823d1$var$MOBILE_SCREEN_WIDTH;
799
- }
800
64
 
801
65
 
802
66