@react-spectrum/utils 3.11.6 → 3.11.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,384 +28,384 @@ $parcel$export(module.exports, "useStyleProps", () => $d3b73be57066120b$export$b
28
28
 
29
29
  const $d3b73be57066120b$export$fe9c6e915565b4e8 = {
30
30
  margin: [
31
- "margin",
31
+ 'margin',
32
32
  $d3b73be57066120b$export$abc24f5b99744ea6
33
33
  ],
34
34
  marginStart: [
35
- $d3b73be57066120b$var$rtl("marginLeft", "marginRight"),
35
+ $d3b73be57066120b$var$rtl('marginLeft', 'marginRight'),
36
36
  $d3b73be57066120b$export$abc24f5b99744ea6
37
37
  ],
38
38
  marginEnd: [
39
- $d3b73be57066120b$var$rtl("marginRight", "marginLeft"),
39
+ $d3b73be57066120b$var$rtl('marginRight', 'marginLeft'),
40
40
  $d3b73be57066120b$export$abc24f5b99744ea6
41
41
  ],
42
42
  // marginLeft: ['marginLeft', dimensionValue],
43
43
  // marginRight: ['marginRight', dimensionValue],
44
44
  marginTop: [
45
- "marginTop",
45
+ 'marginTop',
46
46
  $d3b73be57066120b$export$abc24f5b99744ea6
47
47
  ],
48
48
  marginBottom: [
49
- "marginBottom",
49
+ 'marginBottom',
50
50
  $d3b73be57066120b$export$abc24f5b99744ea6
51
51
  ],
52
52
  marginX: [
53
53
  [
54
- "marginLeft",
55
- "marginRight"
54
+ 'marginLeft',
55
+ 'marginRight'
56
56
  ],
57
57
  $d3b73be57066120b$export$abc24f5b99744ea6
58
58
  ],
59
59
  marginY: [
60
60
  [
61
- "marginTop",
62
- "marginBottom"
61
+ 'marginTop',
62
+ 'marginBottom'
63
63
  ],
64
64
  $d3b73be57066120b$export$abc24f5b99744ea6
65
65
  ],
66
66
  width: [
67
- "width",
67
+ 'width',
68
68
  $d3b73be57066120b$export$abc24f5b99744ea6
69
69
  ],
70
70
  height: [
71
- "height",
71
+ 'height',
72
72
  $d3b73be57066120b$export$abc24f5b99744ea6
73
73
  ],
74
74
  minWidth: [
75
- "minWidth",
75
+ 'minWidth',
76
76
  $d3b73be57066120b$export$abc24f5b99744ea6
77
77
  ],
78
78
  minHeight: [
79
- "minHeight",
79
+ 'minHeight',
80
80
  $d3b73be57066120b$export$abc24f5b99744ea6
81
81
  ],
82
82
  maxWidth: [
83
- "maxWidth",
83
+ 'maxWidth',
84
84
  $d3b73be57066120b$export$abc24f5b99744ea6
85
85
  ],
86
86
  maxHeight: [
87
- "maxHeight",
87
+ 'maxHeight',
88
88
  $d3b73be57066120b$export$abc24f5b99744ea6
89
89
  ],
90
90
  isHidden: [
91
- "display",
91
+ 'display',
92
92
  $d3b73be57066120b$var$hiddenValue
93
93
  ],
94
94
  alignSelf: [
95
- "alignSelf",
95
+ 'alignSelf',
96
96
  $d3b73be57066120b$export$46b6c81d11d2c30a
97
97
  ],
98
98
  justifySelf: [
99
- "justifySelf",
99
+ 'justifySelf',
100
100
  $d3b73be57066120b$export$46b6c81d11d2c30a
101
101
  ],
102
102
  position: [
103
- "position",
103
+ 'position',
104
104
  $d3b73be57066120b$var$anyValue
105
105
  ],
106
106
  zIndex: [
107
- "zIndex",
107
+ 'zIndex',
108
108
  $d3b73be57066120b$var$anyValue
109
109
  ],
110
110
  top: [
111
- "top",
111
+ 'top',
112
112
  $d3b73be57066120b$export$abc24f5b99744ea6
113
113
  ],
114
114
  bottom: [
115
- "bottom",
115
+ 'bottom',
116
116
  $d3b73be57066120b$export$abc24f5b99744ea6
117
117
  ],
118
118
  start: [
119
- $d3b73be57066120b$var$rtl("left", "right"),
119
+ $d3b73be57066120b$var$rtl('left', 'right'),
120
120
  $d3b73be57066120b$export$abc24f5b99744ea6
121
121
  ],
122
122
  end: [
123
- $d3b73be57066120b$var$rtl("right", "left"),
123
+ $d3b73be57066120b$var$rtl('right', 'left'),
124
124
  $d3b73be57066120b$export$abc24f5b99744ea6
125
125
  ],
126
126
  left: [
127
- "left",
127
+ 'left',
128
128
  $d3b73be57066120b$export$abc24f5b99744ea6
129
129
  ],
130
130
  right: [
131
- "right",
131
+ 'right',
132
132
  $d3b73be57066120b$export$abc24f5b99744ea6
133
133
  ],
134
134
  order: [
135
- "order",
135
+ 'order',
136
136
  $d3b73be57066120b$var$anyValue
137
137
  ],
138
138
  flex: [
139
- "flex",
139
+ 'flex',
140
140
  $d3b73be57066120b$var$flexValue
141
141
  ],
142
142
  flexGrow: [
143
- "flexGrow",
143
+ 'flexGrow',
144
144
  $d3b73be57066120b$export$46b6c81d11d2c30a
145
145
  ],
146
146
  flexShrink: [
147
- "flexShrink",
147
+ 'flexShrink',
148
148
  $d3b73be57066120b$export$46b6c81d11d2c30a
149
149
  ],
150
150
  flexBasis: [
151
- "flexBasis",
151
+ 'flexBasis',
152
152
  $d3b73be57066120b$export$46b6c81d11d2c30a
153
153
  ],
154
154
  gridArea: [
155
- "gridArea",
155
+ 'gridArea',
156
156
  $d3b73be57066120b$export$46b6c81d11d2c30a
157
157
  ],
158
158
  gridColumn: [
159
- "gridColumn",
159
+ 'gridColumn',
160
160
  $d3b73be57066120b$export$46b6c81d11d2c30a
161
161
  ],
162
162
  gridColumnEnd: [
163
- "gridColumnEnd",
163
+ 'gridColumnEnd',
164
164
  $d3b73be57066120b$export$46b6c81d11d2c30a
165
165
  ],
166
166
  gridColumnStart: [
167
- "gridColumnStart",
167
+ 'gridColumnStart',
168
168
  $d3b73be57066120b$export$46b6c81d11d2c30a
169
169
  ],
170
170
  gridRow: [
171
- "gridRow",
171
+ 'gridRow',
172
172
  $d3b73be57066120b$export$46b6c81d11d2c30a
173
173
  ],
174
174
  gridRowEnd: [
175
- "gridRowEnd",
175
+ 'gridRowEnd',
176
176
  $d3b73be57066120b$export$46b6c81d11d2c30a
177
177
  ],
178
178
  gridRowStart: [
179
- "gridRowStart",
179
+ 'gridRowStart',
180
180
  $d3b73be57066120b$export$46b6c81d11d2c30a
181
181
  ]
182
182
  };
183
183
  const $d3b73be57066120b$export$e0705d1a55f297c = {
184
184
  ...$d3b73be57066120b$export$fe9c6e915565b4e8,
185
185
  backgroundColor: [
186
- "backgroundColor",
186
+ 'backgroundColor',
187
187
  $d3b73be57066120b$var$backgroundColorValue
188
188
  ],
189
189
  borderWidth: [
190
- "borderWidth",
190
+ 'borderWidth',
191
191
  $d3b73be57066120b$var$borderSizeValue
192
192
  ],
193
193
  borderStartWidth: [
194
- $d3b73be57066120b$var$rtl("borderLeftWidth", "borderRightWidth"),
194
+ $d3b73be57066120b$var$rtl('borderLeftWidth', 'borderRightWidth'),
195
195
  $d3b73be57066120b$var$borderSizeValue
196
196
  ],
197
197
  borderEndWidth: [
198
- $d3b73be57066120b$var$rtl("borderRightWidth", "borderLeftWidth"),
198
+ $d3b73be57066120b$var$rtl('borderRightWidth', 'borderLeftWidth'),
199
199
  $d3b73be57066120b$var$borderSizeValue
200
200
  ],
201
201
  borderLeftWidth: [
202
- "borderLeftWidth",
202
+ 'borderLeftWidth',
203
203
  $d3b73be57066120b$var$borderSizeValue
204
204
  ],
205
205
  borderRightWidth: [
206
- "borderRightWidth",
206
+ 'borderRightWidth',
207
207
  $d3b73be57066120b$var$borderSizeValue
208
208
  ],
209
209
  borderTopWidth: [
210
- "borderTopWidth",
210
+ 'borderTopWidth',
211
211
  $d3b73be57066120b$var$borderSizeValue
212
212
  ],
213
213
  borderBottomWidth: [
214
- "borderBottomWidth",
214
+ 'borderBottomWidth',
215
215
  $d3b73be57066120b$var$borderSizeValue
216
216
  ],
217
217
  borderXWidth: [
218
218
  [
219
- "borderLeftWidth",
220
- "borderRightWidth"
219
+ 'borderLeftWidth',
220
+ 'borderRightWidth'
221
221
  ],
222
222
  $d3b73be57066120b$var$borderSizeValue
223
223
  ],
224
224
  borderYWidth: [
225
225
  [
226
- "borderTopWidth",
227
- "borderBottomWidth"
226
+ 'borderTopWidth',
227
+ 'borderBottomWidth'
228
228
  ],
229
229
  $d3b73be57066120b$var$borderSizeValue
230
230
  ],
231
231
  borderColor: [
232
- "borderColor",
232
+ 'borderColor',
233
233
  $d3b73be57066120b$var$borderColorValue
234
234
  ],
235
235
  borderStartColor: [
236
- $d3b73be57066120b$var$rtl("borderLeftColor", "borderRightColor"),
236
+ $d3b73be57066120b$var$rtl('borderLeftColor', 'borderRightColor'),
237
237
  $d3b73be57066120b$var$borderColorValue
238
238
  ],
239
239
  borderEndColor: [
240
- $d3b73be57066120b$var$rtl("borderRightColor", "borderLeftColor"),
240
+ $d3b73be57066120b$var$rtl('borderRightColor', 'borderLeftColor'),
241
241
  $d3b73be57066120b$var$borderColorValue
242
242
  ],
243
243
  borderLeftColor: [
244
- "borderLeftColor",
244
+ 'borderLeftColor',
245
245
  $d3b73be57066120b$var$borderColorValue
246
246
  ],
247
247
  borderRightColor: [
248
- "borderRightColor",
248
+ 'borderRightColor',
249
249
  $d3b73be57066120b$var$borderColorValue
250
250
  ],
251
251
  borderTopColor: [
252
- "borderTopColor",
252
+ 'borderTopColor',
253
253
  $d3b73be57066120b$var$borderColorValue
254
254
  ],
255
255
  borderBottomColor: [
256
- "borderBottomColor",
256
+ 'borderBottomColor',
257
257
  $d3b73be57066120b$var$borderColorValue
258
258
  ],
259
259
  borderXColor: [
260
260
  [
261
- "borderLeftColor",
262
- "borderRightColor"
261
+ 'borderLeftColor',
262
+ 'borderRightColor'
263
263
  ],
264
264
  $d3b73be57066120b$var$borderColorValue
265
265
  ],
266
266
  borderYColor: [
267
267
  [
268
- "borderTopColor",
269
- "borderBottomColor"
268
+ 'borderTopColor',
269
+ 'borderBottomColor'
270
270
  ],
271
271
  $d3b73be57066120b$var$borderColorValue
272
272
  ],
273
273
  borderRadius: [
274
- "borderRadius",
274
+ 'borderRadius',
275
275
  $d3b73be57066120b$var$borderRadiusValue
276
276
  ],
277
277
  borderTopStartRadius: [
278
- $d3b73be57066120b$var$rtl("borderTopLeftRadius", "borderTopRightRadius"),
278
+ $d3b73be57066120b$var$rtl('borderTopLeftRadius', 'borderTopRightRadius'),
279
279
  $d3b73be57066120b$var$borderRadiusValue
280
280
  ],
281
281
  borderTopEndRadius: [
282
- $d3b73be57066120b$var$rtl("borderTopRightRadius", "borderTopLeftRadius"),
282
+ $d3b73be57066120b$var$rtl('borderTopRightRadius', 'borderTopLeftRadius'),
283
283
  $d3b73be57066120b$var$borderRadiusValue
284
284
  ],
285
285
  borderBottomStartRadius: [
286
- $d3b73be57066120b$var$rtl("borderBottomLeftRadius", "borderBottomRightRadius"),
286
+ $d3b73be57066120b$var$rtl('borderBottomLeftRadius', 'borderBottomRightRadius'),
287
287
  $d3b73be57066120b$var$borderRadiusValue
288
288
  ],
289
289
  borderBottomEndRadius: [
290
- $d3b73be57066120b$var$rtl("borderBottomRightRadius", "borderBottomLeftRadius"),
290
+ $d3b73be57066120b$var$rtl('borderBottomRightRadius', 'borderBottomLeftRadius'),
291
291
  $d3b73be57066120b$var$borderRadiusValue
292
292
  ],
293
293
  borderTopLeftRadius: [
294
- "borderTopLeftRadius",
294
+ 'borderTopLeftRadius',
295
295
  $d3b73be57066120b$var$borderRadiusValue
296
296
  ],
297
297
  borderTopRightRadius: [
298
- "borderTopRightRadius",
298
+ 'borderTopRightRadius',
299
299
  $d3b73be57066120b$var$borderRadiusValue
300
300
  ],
301
301
  borderBottomLeftRadius: [
302
- "borderBottomLeftRadius",
302
+ 'borderBottomLeftRadius',
303
303
  $d3b73be57066120b$var$borderRadiusValue
304
304
  ],
305
305
  borderBottomRightRadius: [
306
- "borderBottomRightRadius",
306
+ 'borderBottomRightRadius',
307
307
  $d3b73be57066120b$var$borderRadiusValue
308
308
  ],
309
309
  padding: [
310
- "padding",
310
+ 'padding',
311
311
  $d3b73be57066120b$export$abc24f5b99744ea6
312
312
  ],
313
313
  paddingStart: [
314
- $d3b73be57066120b$var$rtl("paddingLeft", "paddingRight"),
314
+ $d3b73be57066120b$var$rtl('paddingLeft', 'paddingRight'),
315
315
  $d3b73be57066120b$export$abc24f5b99744ea6
316
316
  ],
317
317
  paddingEnd: [
318
- $d3b73be57066120b$var$rtl("paddingRight", "paddingLeft"),
318
+ $d3b73be57066120b$var$rtl('paddingRight', 'paddingLeft'),
319
319
  $d3b73be57066120b$export$abc24f5b99744ea6
320
320
  ],
321
321
  paddingLeft: [
322
- "paddingLeft",
322
+ 'paddingLeft',
323
323
  $d3b73be57066120b$export$abc24f5b99744ea6
324
324
  ],
325
325
  paddingRight: [
326
- "paddingRight",
326
+ 'paddingRight',
327
327
  $d3b73be57066120b$export$abc24f5b99744ea6
328
328
  ],
329
329
  paddingTop: [
330
- "paddingTop",
330
+ 'paddingTop',
331
331
  $d3b73be57066120b$export$abc24f5b99744ea6
332
332
  ],
333
333
  paddingBottom: [
334
- "paddingBottom",
334
+ 'paddingBottom',
335
335
  $d3b73be57066120b$export$abc24f5b99744ea6
336
336
  ],
337
337
  paddingX: [
338
338
  [
339
- "paddingLeft",
340
- "paddingRight"
339
+ 'paddingLeft',
340
+ 'paddingRight'
341
341
  ],
342
342
  $d3b73be57066120b$export$abc24f5b99744ea6
343
343
  ],
344
344
  paddingY: [
345
345
  [
346
- "paddingTop",
347
- "paddingBottom"
346
+ 'paddingTop',
347
+ 'paddingBottom'
348
348
  ],
349
349
  $d3b73be57066120b$export$abc24f5b99744ea6
350
350
  ],
351
351
  overflow: [
352
- "overflow",
352
+ 'overflow',
353
353
  $d3b73be57066120b$export$46b6c81d11d2c30a
354
354
  ]
355
355
  };
356
356
  const $d3b73be57066120b$var$borderStyleProps = {
357
- borderWidth: "borderStyle",
358
- borderLeftWidth: "borderLeftStyle",
359
- borderRightWidth: "borderRightStyle",
360
- borderTopWidth: "borderTopStyle",
361
- borderBottomWidth: "borderBottomStyle"
357
+ borderWidth: 'borderStyle',
358
+ borderLeftWidth: 'borderLeftStyle',
359
+ borderRightWidth: 'borderRightStyle',
360
+ borderTopWidth: 'borderTopStyle',
361
+ borderBottomWidth: 'borderBottomStyle'
362
362
  };
363
363
  function $d3b73be57066120b$var$rtl(ltr, rtl) {
364
- return (direction)=>direction === "rtl" ? rtl : ltr;
364
+ return (direction)=>direction === 'rtl' ? rtl : ltr;
365
365
  }
366
366
  const $d3b73be57066120b$var$UNIT_RE = /(%|px|em|rem|vw|vh|auto|cm|mm|in|pt|pc|ex|ch|rem|vmin|vmax|fr)$/;
367
367
  const $d3b73be57066120b$var$FUNC_RE = /^\s*\w+\(/;
368
368
  const $d3b73be57066120b$var$SPECTRUM_VARIABLE_RE = /(static-)?size-\d+|single-line-(height|width)/g;
369
369
  function $d3b73be57066120b$export$abc24f5b99744ea6(value) {
370
- if (typeof value === "number") return value + "px";
370
+ if (typeof value === 'number') return value + 'px';
371
371
  if (!value) return undefined;
372
372
  if ($d3b73be57066120b$var$UNIT_RE.test(value)) return value;
373
- if ($d3b73be57066120b$var$FUNC_RE.test(value)) return value.replace($d3b73be57066120b$var$SPECTRUM_VARIABLE_RE, "var(--spectrum-global-dimension-$&, var(--spectrum-alias-$&))");
373
+ if ($d3b73be57066120b$var$FUNC_RE.test(value)) return value.replace($d3b73be57066120b$var$SPECTRUM_VARIABLE_RE, 'var(--spectrum-global-dimension-$&, var(--spectrum-alias-$&))');
374
374
  return `var(--spectrum-global-dimension-${value}, var(--spectrum-alias-${value}))`;
375
375
  }
376
376
  function $d3b73be57066120b$export$f348bec194f2e6b5(value, matchedBreakpoints) {
377
377
  value = $d3b73be57066120b$export$52dbfdbe1b2c3541(value, matchedBreakpoints);
378
378
  return $d3b73be57066120b$export$abc24f5b99744ea6(value);
379
379
  }
380
- function $d3b73be57066120b$var$colorValue(value, type = "default", version = 5) {
380
+ function $d3b73be57066120b$var$colorValue(value, type = 'default', version = 5) {
381
381
  if (version > 5) return `var(--spectrum-${value}, var(--spectrum-semantic-${value}-color-${type}))`;
382
382
  return `var(--spectrum-legacy-color-${value}, var(--spectrum-global-color-${value}, var(--spectrum-semantic-${value}-color-${type})))`;
383
383
  }
384
384
  function $d3b73be57066120b$var$backgroundColorValue(value, version = 5) {
385
385
  if (!value) return undefined;
386
- return `var(--spectrum-alias-background-color-${value}, ${$d3b73be57066120b$var$colorValue(value, "background", version)})`;
386
+ return `var(--spectrum-alias-background-color-${value}, ${$d3b73be57066120b$var$colorValue(value, 'background', version)})`;
387
387
  }
388
388
  function $d3b73be57066120b$var$borderColorValue(value, version = 5) {
389
389
  if (!value) return undefined;
390
- if (value === "default") return "var(--spectrum-alias-border-color)";
391
- return `var(--spectrum-alias-border-color-${value}, ${$d3b73be57066120b$var$colorValue(value, "border", version)})`;
390
+ if (value === 'default') return 'var(--spectrum-alias-border-color)';
391
+ return `var(--spectrum-alias-border-color-${value}, ${$d3b73be57066120b$var$colorValue(value, 'border', version)})`;
392
392
  }
393
393
  function $d3b73be57066120b$var$borderSizeValue(value) {
394
- return value && value !== "none" ? `var(--spectrum-alias-border-size-${value})` : "0";
394
+ return value && value !== 'none' ? `var(--spectrum-alias-border-size-${value})` : '0';
395
395
  }
396
396
  function $d3b73be57066120b$var$borderRadiusValue(value) {
397
397
  if (!value) return undefined;
398
398
  return `var(--spectrum-alias-border-radius-${value})`;
399
399
  }
400
400
  function $d3b73be57066120b$var$hiddenValue(value) {
401
- return value ? "none" : undefined;
401
+ return value ? 'none' : undefined;
402
402
  }
403
403
  function $d3b73be57066120b$var$anyValue(value) {
404
404
  return value;
405
405
  }
406
406
  function $d3b73be57066120b$var$flexValue(value) {
407
- if (typeof value === "boolean") return value ? "1" : undefined;
408
- return "" + value;
407
+ if (typeof value === 'boolean') return value ? '1' : undefined;
408
+ return '' + value;
409
409
  }
410
410
  function $d3b73be57066120b$export$f3c39bb9534218d0(props, handlers, direction, matchedBreakpoints) {
411
411
  let style = {};
@@ -413,15 +413,15 @@ function $d3b73be57066120b$export$f3c39bb9534218d0(props, handlers, direction, m
413
413
  let styleProp = handlers[key];
414
414
  if (!styleProp || props[key] == null) continue;
415
415
  let [name, convert] = styleProp;
416
- if (typeof name === "function") name = name(direction);
416
+ if (typeof name === 'function') name = name(direction);
417
417
  let prop = $d3b73be57066120b$export$52dbfdbe1b2c3541(props[key], matchedBreakpoints);
418
418
  let value = convert(prop, props.colorVersion);
419
419
  if (Array.isArray(name)) for (let k of name)style[k] = value;
420
420
  else style[name] = value;
421
421
  }
422
422
  for(let prop in $d3b73be57066120b$var$borderStyleProps)if (style[prop]) {
423
- style[$d3b73be57066120b$var$borderStyleProps[prop]] = "solid";
424
- style.boxSizing = "border-box";
423
+ style[$d3b73be57066120b$var$borderStyleProps[prop]] = 'solid';
424
+ style.boxSizing = 'border-box';
425
425
  }
426
426
  return style;
427
427
  }
@@ -430,7 +430,7 @@ function $d3b73be57066120b$export$b8e6fb9d2dff3f41(props, handlers = $d3b73be570
430
430
  let breakpointProvider = (0, $893a66ba513f4a66$exports.useBreakpoint)();
431
431
  let { direction: direction } = (0, $5XTxG$reactariai18n.useLocale)();
432
432
  let { matchedBreakpoints: matchedBreakpoints = (breakpointProvider === null || breakpointProvider === void 0 ? void 0 : breakpointProvider.matchedBreakpoints) || [
433
- "base"
433
+ 'base'
434
434
  ] } = options;
435
435
  let styles = $d3b73be57066120b$export$f3c39bb9534218d0(props, handlers, direction, matchedBreakpoints);
436
436
  let style = {
@@ -454,7 +454,7 @@ function $d3b73be57066120b$export$46b6c81d11d2c30a(value) {
454
454
  return value;
455
455
  }
456
456
  function $d3b73be57066120b$export$52dbfdbe1b2c3541(prop, matchedBreakpoints) {
457
- if (prop && typeof prop === "object" && !Array.isArray(prop)) {
457
+ if (prop && typeof prop === 'object' && !Array.isArray(prop)) {
458
458
  for(let i = 0; i < matchedBreakpoints.length; i++){
459
459
  let breakpoint = matchedBreakpoints[i];
460
460
  if (prop[breakpoint] != null) return prop[breakpoint];