@react-spectrum/utils 3.11.6 → 3.11.8

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.
@@ -15,384 +15,384 @@ import {useLocale as $9Di9g$useLocale} from "@react-aria/i18n";
15
15
 
16
16
  const $380ed8f3903c3931$export$fe9c6e915565b4e8 = {
17
17
  margin: [
18
- "margin",
18
+ 'margin',
19
19
  $380ed8f3903c3931$export$abc24f5b99744ea6
20
20
  ],
21
21
  marginStart: [
22
- $380ed8f3903c3931$var$rtl("marginLeft", "marginRight"),
22
+ $380ed8f3903c3931$var$rtl('marginLeft', 'marginRight'),
23
23
  $380ed8f3903c3931$export$abc24f5b99744ea6
24
24
  ],
25
25
  marginEnd: [
26
- $380ed8f3903c3931$var$rtl("marginRight", "marginLeft"),
26
+ $380ed8f3903c3931$var$rtl('marginRight', 'marginLeft'),
27
27
  $380ed8f3903c3931$export$abc24f5b99744ea6
28
28
  ],
29
29
  // marginLeft: ['marginLeft', dimensionValue],
30
30
  // marginRight: ['marginRight', dimensionValue],
31
31
  marginTop: [
32
- "marginTop",
32
+ 'marginTop',
33
33
  $380ed8f3903c3931$export$abc24f5b99744ea6
34
34
  ],
35
35
  marginBottom: [
36
- "marginBottom",
36
+ 'marginBottom',
37
37
  $380ed8f3903c3931$export$abc24f5b99744ea6
38
38
  ],
39
39
  marginX: [
40
40
  [
41
- "marginLeft",
42
- "marginRight"
41
+ 'marginLeft',
42
+ 'marginRight'
43
43
  ],
44
44
  $380ed8f3903c3931$export$abc24f5b99744ea6
45
45
  ],
46
46
  marginY: [
47
47
  [
48
- "marginTop",
49
- "marginBottom"
48
+ 'marginTop',
49
+ 'marginBottom'
50
50
  ],
51
51
  $380ed8f3903c3931$export$abc24f5b99744ea6
52
52
  ],
53
53
  width: [
54
- "width",
54
+ 'width',
55
55
  $380ed8f3903c3931$export$abc24f5b99744ea6
56
56
  ],
57
57
  height: [
58
- "height",
58
+ 'height',
59
59
  $380ed8f3903c3931$export$abc24f5b99744ea6
60
60
  ],
61
61
  minWidth: [
62
- "minWidth",
62
+ 'minWidth',
63
63
  $380ed8f3903c3931$export$abc24f5b99744ea6
64
64
  ],
65
65
  minHeight: [
66
- "minHeight",
66
+ 'minHeight',
67
67
  $380ed8f3903c3931$export$abc24f5b99744ea6
68
68
  ],
69
69
  maxWidth: [
70
- "maxWidth",
70
+ 'maxWidth',
71
71
  $380ed8f3903c3931$export$abc24f5b99744ea6
72
72
  ],
73
73
  maxHeight: [
74
- "maxHeight",
74
+ 'maxHeight',
75
75
  $380ed8f3903c3931$export$abc24f5b99744ea6
76
76
  ],
77
77
  isHidden: [
78
- "display",
78
+ 'display',
79
79
  $380ed8f3903c3931$var$hiddenValue
80
80
  ],
81
81
  alignSelf: [
82
- "alignSelf",
82
+ 'alignSelf',
83
83
  $380ed8f3903c3931$export$46b6c81d11d2c30a
84
84
  ],
85
85
  justifySelf: [
86
- "justifySelf",
86
+ 'justifySelf',
87
87
  $380ed8f3903c3931$export$46b6c81d11d2c30a
88
88
  ],
89
89
  position: [
90
- "position",
90
+ 'position',
91
91
  $380ed8f3903c3931$var$anyValue
92
92
  ],
93
93
  zIndex: [
94
- "zIndex",
94
+ 'zIndex',
95
95
  $380ed8f3903c3931$var$anyValue
96
96
  ],
97
97
  top: [
98
- "top",
98
+ 'top',
99
99
  $380ed8f3903c3931$export$abc24f5b99744ea6
100
100
  ],
101
101
  bottom: [
102
- "bottom",
102
+ 'bottom',
103
103
  $380ed8f3903c3931$export$abc24f5b99744ea6
104
104
  ],
105
105
  start: [
106
- $380ed8f3903c3931$var$rtl("left", "right"),
106
+ $380ed8f3903c3931$var$rtl('left', 'right'),
107
107
  $380ed8f3903c3931$export$abc24f5b99744ea6
108
108
  ],
109
109
  end: [
110
- $380ed8f3903c3931$var$rtl("right", "left"),
110
+ $380ed8f3903c3931$var$rtl('right', 'left'),
111
111
  $380ed8f3903c3931$export$abc24f5b99744ea6
112
112
  ],
113
113
  left: [
114
- "left",
114
+ 'left',
115
115
  $380ed8f3903c3931$export$abc24f5b99744ea6
116
116
  ],
117
117
  right: [
118
- "right",
118
+ 'right',
119
119
  $380ed8f3903c3931$export$abc24f5b99744ea6
120
120
  ],
121
121
  order: [
122
- "order",
122
+ 'order',
123
123
  $380ed8f3903c3931$var$anyValue
124
124
  ],
125
125
  flex: [
126
- "flex",
126
+ 'flex',
127
127
  $380ed8f3903c3931$var$flexValue
128
128
  ],
129
129
  flexGrow: [
130
- "flexGrow",
130
+ 'flexGrow',
131
131
  $380ed8f3903c3931$export$46b6c81d11d2c30a
132
132
  ],
133
133
  flexShrink: [
134
- "flexShrink",
134
+ 'flexShrink',
135
135
  $380ed8f3903c3931$export$46b6c81d11d2c30a
136
136
  ],
137
137
  flexBasis: [
138
- "flexBasis",
138
+ 'flexBasis',
139
139
  $380ed8f3903c3931$export$46b6c81d11d2c30a
140
140
  ],
141
141
  gridArea: [
142
- "gridArea",
142
+ 'gridArea',
143
143
  $380ed8f3903c3931$export$46b6c81d11d2c30a
144
144
  ],
145
145
  gridColumn: [
146
- "gridColumn",
146
+ 'gridColumn',
147
147
  $380ed8f3903c3931$export$46b6c81d11d2c30a
148
148
  ],
149
149
  gridColumnEnd: [
150
- "gridColumnEnd",
150
+ 'gridColumnEnd',
151
151
  $380ed8f3903c3931$export$46b6c81d11d2c30a
152
152
  ],
153
153
  gridColumnStart: [
154
- "gridColumnStart",
154
+ 'gridColumnStart',
155
155
  $380ed8f3903c3931$export$46b6c81d11d2c30a
156
156
  ],
157
157
  gridRow: [
158
- "gridRow",
158
+ 'gridRow',
159
159
  $380ed8f3903c3931$export$46b6c81d11d2c30a
160
160
  ],
161
161
  gridRowEnd: [
162
- "gridRowEnd",
162
+ 'gridRowEnd',
163
163
  $380ed8f3903c3931$export$46b6c81d11d2c30a
164
164
  ],
165
165
  gridRowStart: [
166
- "gridRowStart",
166
+ 'gridRowStart',
167
167
  $380ed8f3903c3931$export$46b6c81d11d2c30a
168
168
  ]
169
169
  };
170
170
  const $380ed8f3903c3931$export$e0705d1a55f297c = {
171
171
  ...$380ed8f3903c3931$export$fe9c6e915565b4e8,
172
172
  backgroundColor: [
173
- "backgroundColor",
173
+ 'backgroundColor',
174
174
  $380ed8f3903c3931$var$backgroundColorValue
175
175
  ],
176
176
  borderWidth: [
177
- "borderWidth",
177
+ 'borderWidth',
178
178
  $380ed8f3903c3931$var$borderSizeValue
179
179
  ],
180
180
  borderStartWidth: [
181
- $380ed8f3903c3931$var$rtl("borderLeftWidth", "borderRightWidth"),
181
+ $380ed8f3903c3931$var$rtl('borderLeftWidth', 'borderRightWidth'),
182
182
  $380ed8f3903c3931$var$borderSizeValue
183
183
  ],
184
184
  borderEndWidth: [
185
- $380ed8f3903c3931$var$rtl("borderRightWidth", "borderLeftWidth"),
185
+ $380ed8f3903c3931$var$rtl('borderRightWidth', 'borderLeftWidth'),
186
186
  $380ed8f3903c3931$var$borderSizeValue
187
187
  ],
188
188
  borderLeftWidth: [
189
- "borderLeftWidth",
189
+ 'borderLeftWidth',
190
190
  $380ed8f3903c3931$var$borderSizeValue
191
191
  ],
192
192
  borderRightWidth: [
193
- "borderRightWidth",
193
+ 'borderRightWidth',
194
194
  $380ed8f3903c3931$var$borderSizeValue
195
195
  ],
196
196
  borderTopWidth: [
197
- "borderTopWidth",
197
+ 'borderTopWidth',
198
198
  $380ed8f3903c3931$var$borderSizeValue
199
199
  ],
200
200
  borderBottomWidth: [
201
- "borderBottomWidth",
201
+ 'borderBottomWidth',
202
202
  $380ed8f3903c3931$var$borderSizeValue
203
203
  ],
204
204
  borderXWidth: [
205
205
  [
206
- "borderLeftWidth",
207
- "borderRightWidth"
206
+ 'borderLeftWidth',
207
+ 'borderRightWidth'
208
208
  ],
209
209
  $380ed8f3903c3931$var$borderSizeValue
210
210
  ],
211
211
  borderYWidth: [
212
212
  [
213
- "borderTopWidth",
214
- "borderBottomWidth"
213
+ 'borderTopWidth',
214
+ 'borderBottomWidth'
215
215
  ],
216
216
  $380ed8f3903c3931$var$borderSizeValue
217
217
  ],
218
218
  borderColor: [
219
- "borderColor",
219
+ 'borderColor',
220
220
  $380ed8f3903c3931$var$borderColorValue
221
221
  ],
222
222
  borderStartColor: [
223
- $380ed8f3903c3931$var$rtl("borderLeftColor", "borderRightColor"),
223
+ $380ed8f3903c3931$var$rtl('borderLeftColor', 'borderRightColor'),
224
224
  $380ed8f3903c3931$var$borderColorValue
225
225
  ],
226
226
  borderEndColor: [
227
- $380ed8f3903c3931$var$rtl("borderRightColor", "borderLeftColor"),
227
+ $380ed8f3903c3931$var$rtl('borderRightColor', 'borderLeftColor'),
228
228
  $380ed8f3903c3931$var$borderColorValue
229
229
  ],
230
230
  borderLeftColor: [
231
- "borderLeftColor",
231
+ 'borderLeftColor',
232
232
  $380ed8f3903c3931$var$borderColorValue
233
233
  ],
234
234
  borderRightColor: [
235
- "borderRightColor",
235
+ 'borderRightColor',
236
236
  $380ed8f3903c3931$var$borderColorValue
237
237
  ],
238
238
  borderTopColor: [
239
- "borderTopColor",
239
+ 'borderTopColor',
240
240
  $380ed8f3903c3931$var$borderColorValue
241
241
  ],
242
242
  borderBottomColor: [
243
- "borderBottomColor",
243
+ 'borderBottomColor',
244
244
  $380ed8f3903c3931$var$borderColorValue
245
245
  ],
246
246
  borderXColor: [
247
247
  [
248
- "borderLeftColor",
249
- "borderRightColor"
248
+ 'borderLeftColor',
249
+ 'borderRightColor'
250
250
  ],
251
251
  $380ed8f3903c3931$var$borderColorValue
252
252
  ],
253
253
  borderYColor: [
254
254
  [
255
- "borderTopColor",
256
- "borderBottomColor"
255
+ 'borderTopColor',
256
+ 'borderBottomColor'
257
257
  ],
258
258
  $380ed8f3903c3931$var$borderColorValue
259
259
  ],
260
260
  borderRadius: [
261
- "borderRadius",
261
+ 'borderRadius',
262
262
  $380ed8f3903c3931$var$borderRadiusValue
263
263
  ],
264
264
  borderTopStartRadius: [
265
- $380ed8f3903c3931$var$rtl("borderTopLeftRadius", "borderTopRightRadius"),
265
+ $380ed8f3903c3931$var$rtl('borderTopLeftRadius', 'borderTopRightRadius'),
266
266
  $380ed8f3903c3931$var$borderRadiusValue
267
267
  ],
268
268
  borderTopEndRadius: [
269
- $380ed8f3903c3931$var$rtl("borderTopRightRadius", "borderTopLeftRadius"),
269
+ $380ed8f3903c3931$var$rtl('borderTopRightRadius', 'borderTopLeftRadius'),
270
270
  $380ed8f3903c3931$var$borderRadiusValue
271
271
  ],
272
272
  borderBottomStartRadius: [
273
- $380ed8f3903c3931$var$rtl("borderBottomLeftRadius", "borderBottomRightRadius"),
273
+ $380ed8f3903c3931$var$rtl('borderBottomLeftRadius', 'borderBottomRightRadius'),
274
274
  $380ed8f3903c3931$var$borderRadiusValue
275
275
  ],
276
276
  borderBottomEndRadius: [
277
- $380ed8f3903c3931$var$rtl("borderBottomRightRadius", "borderBottomLeftRadius"),
277
+ $380ed8f3903c3931$var$rtl('borderBottomRightRadius', 'borderBottomLeftRadius'),
278
278
  $380ed8f3903c3931$var$borderRadiusValue
279
279
  ],
280
280
  borderTopLeftRadius: [
281
- "borderTopLeftRadius",
281
+ 'borderTopLeftRadius',
282
282
  $380ed8f3903c3931$var$borderRadiusValue
283
283
  ],
284
284
  borderTopRightRadius: [
285
- "borderTopRightRadius",
285
+ 'borderTopRightRadius',
286
286
  $380ed8f3903c3931$var$borderRadiusValue
287
287
  ],
288
288
  borderBottomLeftRadius: [
289
- "borderBottomLeftRadius",
289
+ 'borderBottomLeftRadius',
290
290
  $380ed8f3903c3931$var$borderRadiusValue
291
291
  ],
292
292
  borderBottomRightRadius: [
293
- "borderBottomRightRadius",
293
+ 'borderBottomRightRadius',
294
294
  $380ed8f3903c3931$var$borderRadiusValue
295
295
  ],
296
296
  padding: [
297
- "padding",
297
+ 'padding',
298
298
  $380ed8f3903c3931$export$abc24f5b99744ea6
299
299
  ],
300
300
  paddingStart: [
301
- $380ed8f3903c3931$var$rtl("paddingLeft", "paddingRight"),
301
+ $380ed8f3903c3931$var$rtl('paddingLeft', 'paddingRight'),
302
302
  $380ed8f3903c3931$export$abc24f5b99744ea6
303
303
  ],
304
304
  paddingEnd: [
305
- $380ed8f3903c3931$var$rtl("paddingRight", "paddingLeft"),
305
+ $380ed8f3903c3931$var$rtl('paddingRight', 'paddingLeft'),
306
306
  $380ed8f3903c3931$export$abc24f5b99744ea6
307
307
  ],
308
308
  paddingLeft: [
309
- "paddingLeft",
309
+ 'paddingLeft',
310
310
  $380ed8f3903c3931$export$abc24f5b99744ea6
311
311
  ],
312
312
  paddingRight: [
313
- "paddingRight",
313
+ 'paddingRight',
314
314
  $380ed8f3903c3931$export$abc24f5b99744ea6
315
315
  ],
316
316
  paddingTop: [
317
- "paddingTop",
317
+ 'paddingTop',
318
318
  $380ed8f3903c3931$export$abc24f5b99744ea6
319
319
  ],
320
320
  paddingBottom: [
321
- "paddingBottom",
321
+ 'paddingBottom',
322
322
  $380ed8f3903c3931$export$abc24f5b99744ea6
323
323
  ],
324
324
  paddingX: [
325
325
  [
326
- "paddingLeft",
327
- "paddingRight"
326
+ 'paddingLeft',
327
+ 'paddingRight'
328
328
  ],
329
329
  $380ed8f3903c3931$export$abc24f5b99744ea6
330
330
  ],
331
331
  paddingY: [
332
332
  [
333
- "paddingTop",
334
- "paddingBottom"
333
+ 'paddingTop',
334
+ 'paddingBottom'
335
335
  ],
336
336
  $380ed8f3903c3931$export$abc24f5b99744ea6
337
337
  ],
338
338
  overflow: [
339
- "overflow",
339
+ 'overflow',
340
340
  $380ed8f3903c3931$export$46b6c81d11d2c30a
341
341
  ]
342
342
  };
343
343
  const $380ed8f3903c3931$var$borderStyleProps = {
344
- borderWidth: "borderStyle",
345
- borderLeftWidth: "borderLeftStyle",
346
- borderRightWidth: "borderRightStyle",
347
- borderTopWidth: "borderTopStyle",
348
- borderBottomWidth: "borderBottomStyle"
344
+ borderWidth: 'borderStyle',
345
+ borderLeftWidth: 'borderLeftStyle',
346
+ borderRightWidth: 'borderRightStyle',
347
+ borderTopWidth: 'borderTopStyle',
348
+ borderBottomWidth: 'borderBottomStyle'
349
349
  };
350
350
  function $380ed8f3903c3931$var$rtl(ltr, rtl) {
351
- return (direction)=>direction === "rtl" ? rtl : ltr;
351
+ return (direction)=>direction === 'rtl' ? rtl : ltr;
352
352
  }
353
353
  const $380ed8f3903c3931$var$UNIT_RE = /(%|px|em|rem|vw|vh|auto|cm|mm|in|pt|pc|ex|ch|rem|vmin|vmax|fr)$/;
354
354
  const $380ed8f3903c3931$var$FUNC_RE = /^\s*\w+\(/;
355
355
  const $380ed8f3903c3931$var$SPECTRUM_VARIABLE_RE = /(static-)?size-\d+|single-line-(height|width)/g;
356
356
  function $380ed8f3903c3931$export$abc24f5b99744ea6(value) {
357
- if (typeof value === "number") return value + "px";
357
+ if (typeof value === 'number') return value + 'px';
358
358
  if (!value) return undefined;
359
359
  if ($380ed8f3903c3931$var$UNIT_RE.test(value)) return value;
360
- if ($380ed8f3903c3931$var$FUNC_RE.test(value)) return value.replace($380ed8f3903c3931$var$SPECTRUM_VARIABLE_RE, "var(--spectrum-global-dimension-$&, var(--spectrum-alias-$&))");
360
+ if ($380ed8f3903c3931$var$FUNC_RE.test(value)) return value.replace($380ed8f3903c3931$var$SPECTRUM_VARIABLE_RE, 'var(--spectrum-global-dimension-$&, var(--spectrum-alias-$&))');
361
361
  return `var(--spectrum-global-dimension-${value}, var(--spectrum-alias-${value}))`;
362
362
  }
363
363
  function $380ed8f3903c3931$export$f348bec194f2e6b5(value, matchedBreakpoints) {
364
364
  value = $380ed8f3903c3931$export$52dbfdbe1b2c3541(value, matchedBreakpoints);
365
365
  return $380ed8f3903c3931$export$abc24f5b99744ea6(value);
366
366
  }
367
- function $380ed8f3903c3931$var$colorValue(value, type = "default", version = 5) {
367
+ function $380ed8f3903c3931$var$colorValue(value, type = 'default', version = 5) {
368
368
  if (version > 5) return `var(--spectrum-${value}, var(--spectrum-semantic-${value}-color-${type}))`;
369
369
  return `var(--spectrum-legacy-color-${value}, var(--spectrum-global-color-${value}, var(--spectrum-semantic-${value}-color-${type})))`;
370
370
  }
371
371
  function $380ed8f3903c3931$var$backgroundColorValue(value, version = 5) {
372
372
  if (!value) return undefined;
373
- return `var(--spectrum-alias-background-color-${value}, ${$380ed8f3903c3931$var$colorValue(value, "background", version)})`;
373
+ return `var(--spectrum-alias-background-color-${value}, ${$380ed8f3903c3931$var$colorValue(value, 'background', version)})`;
374
374
  }
375
375
  function $380ed8f3903c3931$var$borderColorValue(value, version = 5) {
376
376
  if (!value) return undefined;
377
- if (value === "default") return "var(--spectrum-alias-border-color)";
378
- return `var(--spectrum-alias-border-color-${value}, ${$380ed8f3903c3931$var$colorValue(value, "border", version)})`;
377
+ if (value === 'default') return 'var(--spectrum-alias-border-color)';
378
+ return `var(--spectrum-alias-border-color-${value}, ${$380ed8f3903c3931$var$colorValue(value, 'border', version)})`;
379
379
  }
380
380
  function $380ed8f3903c3931$var$borderSizeValue(value) {
381
- return value && value !== "none" ? `var(--spectrum-alias-border-size-${value})` : "0";
381
+ return value && value !== 'none' ? `var(--spectrum-alias-border-size-${value})` : '0';
382
382
  }
383
383
  function $380ed8f3903c3931$var$borderRadiusValue(value) {
384
384
  if (!value) return undefined;
385
385
  return `var(--spectrum-alias-border-radius-${value})`;
386
386
  }
387
387
  function $380ed8f3903c3931$var$hiddenValue(value) {
388
- return value ? "none" : undefined;
388
+ return value ? 'none' : undefined;
389
389
  }
390
390
  function $380ed8f3903c3931$var$anyValue(value) {
391
391
  return value;
392
392
  }
393
393
  function $380ed8f3903c3931$var$flexValue(value) {
394
- if (typeof value === "boolean") return value ? "1" : undefined;
395
- return "" + value;
394
+ if (typeof value === 'boolean') return value ? '1' : undefined;
395
+ return '' + value;
396
396
  }
397
397
  function $380ed8f3903c3931$export$f3c39bb9534218d0(props, handlers, direction, matchedBreakpoints) {
398
398
  let style = {};
@@ -400,15 +400,15 @@ function $380ed8f3903c3931$export$f3c39bb9534218d0(props, handlers, direction, m
400
400
  let styleProp = handlers[key];
401
401
  if (!styleProp || props[key] == null) continue;
402
402
  let [name, convert] = styleProp;
403
- if (typeof name === "function") name = name(direction);
403
+ if (typeof name === 'function') name = name(direction);
404
404
  let prop = $380ed8f3903c3931$export$52dbfdbe1b2c3541(props[key], matchedBreakpoints);
405
405
  let value = convert(prop, props.colorVersion);
406
406
  if (Array.isArray(name)) for (let k of name)style[k] = value;
407
407
  else style[name] = value;
408
408
  }
409
409
  for(let prop in $380ed8f3903c3931$var$borderStyleProps)if (style[prop]) {
410
- style[$380ed8f3903c3931$var$borderStyleProps[prop]] = "solid";
411
- style.boxSizing = "border-box";
410
+ style[$380ed8f3903c3931$var$borderStyleProps[prop]] = 'solid';
411
+ style.boxSizing = 'border-box';
412
412
  }
413
413
  return style;
414
414
  }
@@ -417,7 +417,7 @@ function $380ed8f3903c3931$export$b8e6fb9d2dff3f41(props, handlers = $380ed8f390
417
417
  let breakpointProvider = (0, $1051245f87c5981d$export$199d6754bdf4e1e3)();
418
418
  let { direction: direction } = (0, $9Di9g$useLocale)();
419
419
  let { matchedBreakpoints: matchedBreakpoints = (breakpointProvider === null || breakpointProvider === void 0 ? void 0 : breakpointProvider.matchedBreakpoints) || [
420
- "base"
420
+ 'base'
421
421
  ] } = options;
422
422
  let styles = $380ed8f3903c3931$export$f3c39bb9534218d0(props, handlers, direction, matchedBreakpoints);
423
423
  let style = {
@@ -441,7 +441,7 @@ function $380ed8f3903c3931$export$46b6c81d11d2c30a(value) {
441
441
  return value;
442
442
  }
443
443
  function $380ed8f3903c3931$export$52dbfdbe1b2c3541(prop, matchedBreakpoints) {
444
- if (prop && typeof prop === "object" && !Array.isArray(prop)) {
444
+ if (prop && typeof prop === 'object' && !Array.isArray(prop)) {
445
445
  for(let i = 0; i < matchedBreakpoints.length; i++){
446
446
  let breakpoint = matchedBreakpoints[i];
447
447
  if (prop[breakpoint] != null) return prop[breakpoint];
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import React, { ReactNode, CSSProperties, HTMLAttributes, JSXElementConstructor, ReactElement, RefObject } from "react";
2
- import { ColorVersion, DimensionValue, Direction, Responsive, StyleProps, ViewStyleProps, DOMRef, DOMRefValue, FocusableElement, FocusableRef, FocusableRefValue } from "@react-types/shared";
1
+ import React, { ReactNode, CSSProperties, HTMLAttributes, JSXElementConstructor, ReactElement } from "react";
2
+ import { ColorVersion, DimensionValue, Direction, Responsive, StyleProps, ViewStyleProps, DOMRef, DOMRefValue, FocusableElement, FocusableRef, FocusableRefValue, RefObject } from "@react-types/shared";
3
3
  interface Breakpoints {
4
4
  S?: number;
5
5
  M?: number;
@@ -42,19 +42,19 @@ export function classNames(cssModule: {
42
42
  }, ...values: Array<string | Object | undefined>): string;
43
43
  export function getWrappedElement(children: string | ReactElement | ReactNode): ReactElement<any, JSXElementConstructor<any>>;
44
44
  export function useMediaQuery(query: string): boolean;
45
- export function createDOMRef<T extends HTMLElement = HTMLElement>(ref: RefObject<T>): DOMRefValue<T>;
46
- export function createFocusableRef<T extends HTMLElement = HTMLElement>(domRef: RefObject<T>, focusableRef?: RefObject<FocusableElement>): FocusableRefValue<T>;
47
- export function useDOMRef<T extends HTMLElement = HTMLElement>(ref: DOMRef<T>): RefObject<T>;
48
- export function useFocusableRef<T extends HTMLElement = HTMLElement>(ref: FocusableRef<T>, focusableRef?: RefObject<FocusableElement>): RefObject<T>;
49
- export function unwrapDOMRef<T extends HTMLElement>(ref: RefObject<DOMRefValue<T>>): RefObject<T>;
50
- export function useUnwrapDOMRef<T extends HTMLElement>(ref: RefObject<DOMRefValue<T>>): RefObject<T>;
45
+ export function createDOMRef<T extends HTMLElement = HTMLElement>(ref: RefObject<T | null>): DOMRefValue<T>;
46
+ export function createFocusableRef<T extends HTMLElement = HTMLElement>(domRef: RefObject<T | null>, focusableRef?: RefObject<FocusableElement | null>): FocusableRefValue<T>;
47
+ export function useDOMRef<T extends HTMLElement = HTMLElement>(ref: DOMRef<T>): RefObject<T | null>;
48
+ export function useFocusableRef<T extends HTMLElement = HTMLElement>(ref: FocusableRef<T>, focusableRef?: RefObject<FocusableElement | null>): RefObject<T | null>;
49
+ export function unwrapDOMRef<T extends HTMLElement>(ref: RefObject<DOMRefValue<T> | null>): RefObject<T | null>;
50
+ export function useUnwrapDOMRef<T extends HTMLElement>(ref: RefObject<DOMRefValue<T> | null>): RefObject<T | null>;
51
51
  export function useSlotProps<T>(props: T & {
52
52
  id?: string;
53
53
  }, defaultSlot?: string): T;
54
54
  export function cssModuleToSlots(cssModule: any): {};
55
55
  export function SlotProvider(props: any): React.JSX.Element;
56
56
  export function ClearSlots(props: any): React.JSX.Element;
57
- export function useHasChild(query: string, ref: RefObject<HTMLElement>): boolean;
57
+ export function useHasChild(query: string, ref: RefObject<HTMLElement | null>): boolean;
58
58
  export function useIsMobileDevice(): boolean;
59
59
  export { useValueEffect } from '@react-aria/utils';
60
60
  export { useResizeObserver } from '@react-aria/utils';
@@ -1 +1 @@
1
- {"mappings":";;AAGA;IACE,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;CACrC;AAED;IACE,kBAAkB,EAAE,MAAM,EAAE,CAAA;CAC7B;AAKD;IACE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,kBAAkB,EAAE,MAAM,EAAE,CAAA;CAC7B;AAED,mCAAmC,KAAK,EAAE,uBAAuB,qBAWhE;AAED,sCAAsC,WAAW,EAAE,WAAW,GAAG,MAAM,EAAE,CAoDxE;AAED,iCAAiC,iBAAiB,CAEjD;AC1ED,kBAAkB,MAAM,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,MAAM,CAAC;AACpD,iBAAiB,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE,SAAS,KAAK,MAAM,CAAC,CAAC;AAClE,oBAAoB,CAAC,KAAK,EAAE,GAAG,EAAE,YAAY,CAAC,EAAE,M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react-spectrum/utils/src/styleProps.ts","packages/@react-spectrum/utils/src/packages/@react-spectrum/utils/src/classNames.ts","packages/@react-spectrum/utils/src/packages/@react-spectrum/utils/src/getWrappedElement.tsx","packages/@react-spectrum/utils/src/packages/@react-spectrum/utils/src/useMediaQuery.ts","packages/@react-spectrum/utils/src/packages/@react-spectrum/utils/src/useDOMRef.ts","packages/@react-spectrum/utils/src/packages/@react-spectrum/utils/src/Slots.tsx","packages/@react-spectrum/utils/src/packages/@react-spectrum/utils/src/useHasChild.ts","packages/@react-spectrum/utils/src/packages/@react-spectrum/utils/src/useIsMobileDevice.ts","packages/@react-spectrum/utils/src/packages/@react-spectrum/utils/src/index.ts","packages/@react-spectrum/utils/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport type {StyleHandlers} from './styleProps';\nexport {shouldKeepSpectrumClassNames, keepSpectrumClassNames, classNames} from './classNames';\nexport {getWrappedElement} from './getWrappedElement';\nexport {useMediaQuery} from './useMediaQuery';\nexport {createDOMRef, createFocusableRef, useDOMRef, useFocusableRef, unwrapDOMRef, useUnwrapDOMRef} from './useDOMRef';\nexport {\n baseStyleProps,\n viewStyleProps,\n dimensionValue,\n responsiveDimensionValue,\n convertStyleProps,\n useStyleProps,\n passthroughStyle,\n getResponsiveProp\n} from './styleProps';\nexport {useSlotProps, cssModuleToSlots, SlotProvider, ClearSlots} from './Slots';\nexport {useHasChild} from './useHasChild';\nexport {useIsMobileDevice} from './useIsMobileDevice';\nexport {useValueEffect} from '@react-aria/utils';\nexport {BreakpointProvider, useMatchedBreakpoints, useBreakpoint} from './BreakpointProvider';\nexport {useResizeObserver} from '@react-aria/utils';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";;AAGA;IACE,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;CACrC;AAED;IACE,kBAAkB,EAAE,MAAM,EAAE,CAAA;CAC7B;AAKD;IACE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,kBAAkB,EAAE,MAAM,EAAE,CAAA;CAC7B;AAED,mCAAmC,KAAK,EAAE,uBAAuB,qBAWhE;AAED,sCAAsC,WAAW,EAAE,WAAW,GAAG,MAAM,EAAE,CAoDxE;AAED,iCAAiC,iBAAiB,CAEjD;AC1ED,kBAAkB,MAAM,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,MAAM,CAAC;AACpD,iBAAiB,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE,SAAS,KAAK,MAAM,CAAC,CAAC;AAClE,oBAAoB,CAAC,KAAK,EAAE,GAAG,EAAE,YAAY,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;AAClE;IACE,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,SAAS,EAAE,YAAY,CAAC,CAAA;CACzC;AAED,OAAO,MAAM,gBAAgB,aAuC5B,CAAC;AAEF,OAAO,MAAM,gBAAgB,aAwC5B,CAAC;AAoBF,+BAA+B,KAAK,EAAE,cAAc,UAkBnD;AAED,yCAAyC,KAAK,EAAE,WAAW,cAAc,CAAC,EAAE,kBAAkB,EAAE,UAAU,EAAE,UAG3G;AA6DD,kCAAkC,CAAC,SAAS,YAAY,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC,EAAE,QAAQ,E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W,GAAG,WAAW,EAAE,GAAG,EAAE,aAAa,CAAC,CAAC,EAAE,YAAY,CAAC,EAAE,UAAU,gBAAgB,GAAG,IAAI,CAAC,GAAG,UAAU,CAAC,GAAG,IAAI,CAAC,CAIjK;AAED,6BAA6B,CAAC,SAAS,WAAW,EAAE,GAAG,EAAE,UAAU,YAAY,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,UAAU,CAAC,GAAG,IAAI,CAAC,CAM9G;AAED,gCAAgC,CAAC,SAAS,WAAW,EAAE,GAAG,EAAE,UAAU,YAAY,CAAC,CAAC,GAAG,IAAI,CAAC,GAAI,UAAU,CAAC,GAAG,IAAI,CAAC,CAElH;ACnCD,6BAA6B,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAC,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,CAAC,CAKjF;AAED,iCAAiC,SAAS,KAAA,MAKzC;AAED,6BAA6B,KAAK,KAAA,qBAmBjC;AAED,2BAA2B,KAAK,KAAA,qBAa/B;ACrDD,4BAA4B,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,WAAW,GAAG,IAAI,CAAC,WAM5E;ACND,qCAAqC,OAAO,CAO3C;ACSD,OAAO,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAC,iBAAiB,EAAC,MAAM,mBAAmB,CAAC","sources":["packages/@react-spectrum/utils/src/packages/@react-spectrum/utils/src/BreakpointProvider.tsx","packages/@react-spectrum/utils/src/packages/@react-spectrum/utils/src/styleProps.ts","packages/@react-spectrum/utils/src/packages/@react-spectrum/utils/src/classNames.ts","packages/@react-spectrum/utils/src/packages/@react-spectrum/utils/src/getWrappedElement.tsx","packages/@react-spectrum/utils/src/packages/@react-spectrum/utils/src/useMediaQuery.ts","packages/@react-spectrum/utils/src/packages/@react-spectrum/utils/src/useDOMRef.ts","packages/@react-spectrum/utils/src/packages/@react-spectrum/utils/src/Slots.tsx","packages/@react-spectrum/utils/src/packages/@react-spectrum/utils/src/useHasChild.ts","packages/@react-spectrum/utils/src/packages/@react-spectrum/utils/src/useIsMobileDevice.ts","packages/@react-spectrum/utils/src/packages/@react-spectrum/utils/src/index.ts","packages/@react-spectrum/utils/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport type {StyleHandlers} from './styleProps';\nexport {shouldKeepSpectrumClassNames, keepSpectrumClassNames, classNames} from './classNames';\nexport {getWrappedElement} from './getWrappedElement';\nexport {useMediaQuery} from './useMediaQuery';\nexport {createDOMRef, createFocusableRef, useDOMRef, useFocusableRef, unwrapDOMRef, useUnwrapDOMRef} from './useDOMRef';\nexport {\n baseStyleProps,\n viewStyleProps,\n dimensionValue,\n responsiveDimensionValue,\n convertStyleProps,\n useStyleProps,\n passthroughStyle,\n getResponsiveProp\n} from './styleProps';\nexport {useSlotProps, cssModuleToSlots, SlotProvider, ClearSlots} from './Slots';\nexport {useHasChild} from './useHasChild';\nexport {useIsMobileDevice} from './useIsMobileDevice';\nexport {useValueEffect} from '@react-aria/utils';\nexport {BreakpointProvider, useMatchedBreakpoints, useBreakpoint} from './BreakpointProvider';\nexport {useResizeObserver} from '@react-aria/utils';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;AAKM,SAAS,0CAAkD,GAAiB;IACjF,OAAO;QACL;YACE,OAAO,IAAI,OAAO;QACpB;IACF;AACF;AAEO,SAAS,0CAAwD,MAAoB,EAAE,eAA4C,MAAM;IAC9I,OAAO;QACL,GAAG,0CAAa,OAAO;QACvB;YACE,IAAI,aAAa,OAAO,EACtB,aAAa,OAAO,CAAC,KAAK;QAE9B;IACF;AACF;AAEO,SAAS,0CAA+C,GAAc;IAC3E,IAAI,SAAS,CAAA,GAAA,mBAAK,EAAK;IACvB,CAAA,GAAA,gCAAkB,EAAE,KAAK,IAAM,0CAAa;IAC5C,OAAO;AACT;AAEO,SAAS,0CAAqD,GAAoB,EAAE,YAA0C;IACnI,IAAI,SAAS,CAAA,GAAA,mBAAK,EAAK;IACvB,CAAA,GAAA,gCAAkB,EAAE,KAAK,IAAM,0CAAmB,QAAQ;IAC1D,OAAO;AACT;AAEO,SAAS,0CAAoC,GAA8B;IAChF,OAAO;QACL,IAAI,WAAU;YACZ,OAAO,IAAI,OAAO,IAAI,IAAI,OAAO,CAAC,iBAAiB;QACrD;IACF;AACF;AAEO,SAAS,0CAAuC,GAA8B;IACnF,OAAO,CAAA,GAAA,oBAAM,EAAE,IAAM,0CAAa,MAAM;QAAC;KAAI;AAC/C","sources":["packages/@react-spectrum/utils/src/useDOMRef.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMRef, DOMRefValue, FocusableElement, FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {RefObject, useImperativeHandle, useMemo, useRef} from 'react';\n\nexport function createDOMRef<T extends HTMLElement = HTMLElement>(ref: RefObject<T>): DOMRefValue<T> {\n return {\n UNSAFE_getDOMNode() {\n return ref.current;\n }\n };\n}\n\nexport function createFocusableRef<T extends HTMLElement = HTMLElement>(domRef: RefObject<T>, focusableRef: RefObject<FocusableElement> = domRef): FocusableRefValue<T> {\n return {\n ...createDOMRef(domRef),\n focus() {\n if (focusableRef.current) {\n focusableRef.current.focus();\n }\n }\n };\n}\n\nexport function useDOMRef<T extends HTMLElement = HTMLElement>(ref: DOMRef<T>): RefObject<T> {\n let domRef = useRef<T>(null);\n useImperativeHandle(ref, () => createDOMRef(domRef));\n return domRef;\n}\n\nexport function useFocusableRef<T extends HTMLElement = HTMLElement>(ref: FocusableRef<T>, focusableRef?: RefObject<FocusableElement>): RefObject<T> {\n let domRef = useRef<T>(null);\n useImperativeHandle(ref, () => createFocusableRef(domRef, focusableRef));\n return domRef;\n}\n\nexport function unwrapDOMRef<T extends HTMLElement>(ref: RefObject<DOMRefValue<T>>): RefObject<T> {\n return {\n get current() {\n return ref.current && ref.current.UNSAFE_getDOMNode();\n }\n };\n}\n\nexport function useUnwrapDOMRef<T extends HTMLElement>(ref: RefObject<DOMRefValue<T>>) : RefObject<T> {\n return useMemo(() => unwrapDOMRef(ref), [ref]);\n}\n"],"names":[],"version":3,"file":"useDOMRef.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;AAKM,SAAS,0CAAkD,GAAwB;IACxF,OAAO;QACL;YACE,OAAO,IAAI,OAAO;QACpB;IACF;AACF;AAEO,SAAS,0CAAwD,MAA2B,EAAE,eAAmD,MAAM;IAC5J,OAAO;QACL,GAAG,0CAAa,OAAO;QACvB;YACE,IAAI,aAAa,OAAO,EACtB,aAAa,OAAO,CAAC,KAAK;QAE9B;IACF;AACF;AAEO,SAAS,0CAA+C,GAAc;IAC3E,IAAI,SAAS,CAAA,GAAA,mBAAK,EAAK;IACvB,CAAA,GAAA,gCAAkB,EAAE,KAAK,IAAM,0CAAa;IAC5C,OAAO;AACT;AAEO,SAAS,0CAAqD,GAAoB,EAAE,YAAiD;IAC1I,IAAI,SAAS,CAAA,GAAA,mBAAK,EAAK;IACvB,CAAA,GAAA,gCAAkB,EAAE,KAAK,IAAM,0CAAmB,QAAQ;IAC1D,OAAO;AACT;AAEO,SAAS,0CAAoC,GAAqC;IACvF,OAAO;QACL,IAAI,WAAU;YACZ,OAAO,IAAI,OAAO,IAAI,IAAI,OAAO,CAAC,iBAAiB;QACrD;IACF;AACF;AAEO,SAAS,0CAAuC,GAAqC;IAC1F,OAAO,CAAA,GAAA,oBAAM,EAAE,IAAM,0CAAa,MAAM;QAAC;KAAI;AAC/C","sources":["packages/@react-spectrum/utils/src/useDOMRef.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMRef, DOMRefValue, FocusableElement, FocusableRef, FocusableRefValue, RefObject} from '@react-types/shared';\nimport {useImperativeHandle, useMemo, useRef} from 'react';\n\nexport function createDOMRef<T extends HTMLElement = HTMLElement>(ref: RefObject<T | null>): DOMRefValue<T> {\n return {\n UNSAFE_getDOMNode() {\n return ref.current;\n }\n };\n}\n\nexport function createFocusableRef<T extends HTMLElement = HTMLElement>(domRef: RefObject<T | null>, focusableRef: RefObject<FocusableElement | null> = domRef): FocusableRefValue<T> {\n return {\n ...createDOMRef(domRef),\n focus() {\n if (focusableRef.current) {\n focusableRef.current.focus();\n }\n }\n };\n}\n\nexport function useDOMRef<T extends HTMLElement = HTMLElement>(ref: DOMRef<T>): RefObject<T | null> {\n let domRef = useRef<T>(null);\n useImperativeHandle(ref, () => createDOMRef(domRef));\n return domRef;\n}\n\nexport function useFocusableRef<T extends HTMLElement = HTMLElement>(ref: FocusableRef<T>, focusableRef?: RefObject<FocusableElement | null>): RefObject<T | null> {\n let domRef = useRef<T>(null);\n useImperativeHandle(ref, () => createFocusableRef(domRef, focusableRef));\n return domRef;\n}\n\nexport function unwrapDOMRef<T extends HTMLElement>(ref: RefObject<DOMRefValue<T> | null>): RefObject<T | null> {\n return {\n get current() {\n return ref.current && ref.current.UNSAFE_getDOMNode();\n }\n };\n}\n\nexport function useUnwrapDOMRef<T extends HTMLElement>(ref: RefObject<DOMRefValue<T> | null>) : RefObject<T | null> {\n return useMemo(() => unwrapDOMRef(ref), [ref]);\n}\n"],"names":[],"version":3,"file":"useDOMRef.main.js.map"}
@@ -51,4 +51,4 @@ function $98e5a8ae0e6415af$export$1d5cc31d9d8df817(ref) {
51
51
 
52
52
 
53
53
  export {$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};
54
- //# sourceMappingURL=useDOMRef.mjs.map
54
+ //# sourceMappingURL=useDOMRef.module.js.map
@@ -1 +1 @@
1
- {"mappings":";;AAAA;;;;;;;;;;CAUC;AAKM,SAAS,0CAAkD,GAAiB;IACjF,OAAO;QACL;YACE,OAAO,IAAI,OAAO;QACpB;IACF;AACF;AAEO,SAAS,0CAAwD,MAAoB,EAAE,eAA4C,MAAM;IAC9I,OAAO;QACL,GAAG,0CAAa,OAAO;QACvB;YACE,IAAI,aAAa,OAAO,EACtB,aAAa,OAAO,CAAC,KAAK;QAE9B;IACF;AACF;AAEO,SAAS,0CAA+C,GAAc;IAC3E,IAAI,SAAS,CAAA,GAAA,aAAK,EAAK;IACvB,CAAA,GAAA,0BAAkB,EAAE,KAAK,IAAM,0CAAa;IAC5C,OAAO;AACT;AAEO,SAAS,0CAAqD,GAAoB,EAAE,YAA0C;IACnI,IAAI,SAAS,CAAA,GAAA,aAAK,EAAK;IACvB,CAAA,GAAA,0BAAkB,EAAE,KAAK,IAAM,0CAAmB,QAAQ;IAC1D,OAAO;AACT;AAEO,SAAS,0CAAoC,GAA8B;IAChF,OAAO;QACL,IAAI,WAAU;YACZ,OAAO,IAAI,OAAO,IAAI,IAAI,OAAO,CAAC,iBAAiB;QACrD;IACF;AACF;AAEO,SAAS,0CAAuC,GAA8B;IACnF,OAAO,CAAA,GAAA,cAAM,EAAE,IAAM,0CAAa,MAAM;QAAC;KAAI;AAC/C","sources":["packages/@react-spectrum/utils/src/useDOMRef.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMRef, DOMRefValue, FocusableElement, FocusableRef, FocusableRefValue} from '@react-types/shared';\nimport {RefObject, useImperativeHandle, useMemo, useRef} from 'react';\n\nexport function createDOMRef<T extends HTMLElement = HTMLElement>(ref: RefObject<T>): DOMRefValue<T> {\n return {\n UNSAFE_getDOMNode() {\n return ref.current;\n }\n };\n}\n\nexport function createFocusableRef<T extends HTMLElement = HTMLElement>(domRef: RefObject<T>, focusableRef: RefObject<FocusableElement> = domRef): FocusableRefValue<T> {\n return {\n ...createDOMRef(domRef),\n focus() {\n if (focusableRef.current) {\n focusableRef.current.focus();\n }\n }\n };\n}\n\nexport function useDOMRef<T extends HTMLElement = HTMLElement>(ref: DOMRef<T>): RefObject<T> {\n let domRef = useRef<T>(null);\n useImperativeHandle(ref, () => createDOMRef(domRef));\n return domRef;\n}\n\nexport function useFocusableRef<T extends HTMLElement = HTMLElement>(ref: FocusableRef<T>, focusableRef?: RefObject<FocusableElement>): RefObject<T> {\n let domRef = useRef<T>(null);\n useImperativeHandle(ref, () => createFocusableRef(domRef, focusableRef));\n return domRef;\n}\n\nexport function unwrapDOMRef<T extends HTMLElement>(ref: RefObject<DOMRefValue<T>>): RefObject<T> {\n return {\n get current() {\n return ref.current && ref.current.UNSAFE_getDOMNode();\n }\n };\n}\n\nexport function useUnwrapDOMRef<T extends HTMLElement>(ref: RefObject<DOMRefValue<T>>) : RefObject<T> {\n return useMemo(() => unwrapDOMRef(ref), [ref]);\n}\n"],"names":[],"version":3,"file":"useDOMRef.module.js.map"}
1
+ {"mappings":";;AAAA;;;;;;;;;;CAUC;AAKM,SAAS,0CAAkD,GAAwB;IACxF,OAAO;QACL;YACE,OAAO,IAAI,OAAO;QACpB;IACF;AACF;AAEO,SAAS,0CAAwD,MAA2B,EAAE,eAAmD,MAAM;IAC5J,OAAO;QACL,GAAG,0CAAa,OAAO;QACvB;YACE,IAAI,aAAa,OAAO,EACtB,aAAa,OAAO,CAAC,KAAK;QAE9B;IACF;AACF;AAEO,SAAS,0CAA+C,GAAc;IAC3E,IAAI,SAAS,CAAA,GAAA,aAAK,EAAK;IACvB,CAAA,GAAA,0BAAkB,EAAE,KAAK,IAAM,0CAAa;IAC5C,OAAO;AACT;AAEO,SAAS,0CAAqD,GAAoB,EAAE,YAAiD;IAC1I,IAAI,SAAS,CAAA,GAAA,aAAK,EAAK;IACvB,CAAA,GAAA,0BAAkB,EAAE,KAAK,IAAM,0CAAmB,QAAQ;IAC1D,OAAO;AACT;AAEO,SAAS,0CAAoC,GAAqC;IACvF,OAAO;QACL,IAAI,WAAU;YACZ,OAAO,IAAI,OAAO,IAAI,IAAI,OAAO,CAAC,iBAAiB;QACrD;IACF;AACF;AAEO,SAAS,0CAAuC,GAAqC;IAC1F,OAAO,CAAA,GAAA,cAAM,EAAE,IAAM,0CAAa,MAAM;QAAC;KAAI;AAC/C","sources":["packages/@react-spectrum/utils/src/useDOMRef.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMRef, DOMRefValue, FocusableElement, FocusableRef, FocusableRefValue, RefObject} from '@react-types/shared';\nimport {useImperativeHandle, useMemo, useRef} from 'react';\n\nexport function createDOMRef<T extends HTMLElement = HTMLElement>(ref: RefObject<T | null>): DOMRefValue<T> {\n return {\n UNSAFE_getDOMNode() {\n return ref.current;\n }\n };\n}\n\nexport function createFocusableRef<T extends HTMLElement = HTMLElement>(domRef: RefObject<T | null>, focusableRef: RefObject<FocusableElement | null> = domRef): FocusableRefValue<T> {\n return {\n ...createDOMRef(domRef),\n focus() {\n if (focusableRef.current) {\n focusableRef.current.focus();\n }\n }\n };\n}\n\nexport function useDOMRef<T extends HTMLElement = HTMLElement>(ref: DOMRef<T>): RefObject<T | null> {\n let domRef = useRef<T>(null);\n useImperativeHandle(ref, () => createDOMRef(domRef));\n return domRef;\n}\n\nexport function useFocusableRef<T extends HTMLElement = HTMLElement>(ref: FocusableRef<T>, focusableRef?: RefObject<FocusableElement | null>): RefObject<T | null> {\n let domRef = useRef<T>(null);\n useImperativeHandle(ref, () => createFocusableRef(domRef, focusableRef));\n return domRef;\n}\n\nexport function unwrapDOMRef<T extends HTMLElement>(ref: RefObject<DOMRefValue<T> | null>): RefObject<T | null> {\n return {\n get current() {\n return ref.current && ref.current.UNSAFE_getDOMNode();\n }\n };\n}\n\nexport function useUnwrapDOMRef<T extends HTMLElement>(ref: RefObject<DOMRefValue<T> | null>) : RefObject<T | null> {\n return useMemo(() => unwrapDOMRef(ref), [ref]);\n}\n"],"names":[],"version":3,"file":"useDOMRef.module.js.map"}
@@ -1,5 +1,5 @@
1
- var $egdoP$react = require("react");
2
1
  var $egdoP$reactariautils = require("@react-aria/utils");
2
+ var $egdoP$react = require("react");
3
3
 
4
4
 
5
5
  function $parcel$export(e, n, v, s) {