@react-spectrum/utils 3.6.0 → 3.6.4

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