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