@react-spectrum/utils 3.11.5 → 3.11.7

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