@react-spectrum/overlays 4.0.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.js CHANGED
@@ -2,7 +2,7 @@ import "./main.css";
2
2
  import {Provider as $fQOb3$Provider} from "@react-spectrum/provider";
3
3
  import $fQOb3$react, {useState as $fQOb3$useState, useCallback as $fQOb3$useCallback, forwardRef as $fQOb3$forwardRef, useRef as $fQOb3$useRef} from "react";
4
4
  import {Overlay as $fQOb3$Overlay, usePopover as $fQOb3$usePopover, DismissButton as $fQOb3$DismissButton, useModalOverlay as $fQOb3$useModalOverlay} from "@react-aria/overlays";
5
- import $fQOb3$reacttransitiongroupTransition from "react-transition-group/Transition";
5
+ import {Transition as $fQOb3$Transition} from "react-transition-group";
6
6
  import {useDOMRef as $fQOb3$useDOMRef, useStyleProps as $fQOb3$useStyleProps, classNames as $fQOb3$classNames} from "@react-spectrum/utils";
7
7
  import {useLayoutEffect as $fQOb3$useLayoutEffect, useViewportSize as $fQOb3$useViewportSize} from "@react-aria/utils";
8
8
 
@@ -12,25 +12,54 @@ function $parcel$interopDefault(a) {
12
12
  function $parcel$export(e, n, v, s) {
13
13
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
14
14
  }
15
-
15
+ /*
16
+ * Copyright 2020 Adobe. All rights reserved.
17
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
18
+ * you may not use this file except in compliance with the License. You may obtain a copy
19
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
20
+ *
21
+ * Unless required by applicable law or agreed to in writing, software distributed under
22
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
23
+ * OF ANY KIND, either express or implied. See the License for the specific language
24
+ * governing permissions and limitations under the License.
25
+ */ /// <reference types="css-module-types" />
26
+ /*
27
+ * Copyright 2020 Adobe. All rights reserved.
28
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
29
+ * you may not use this file except in compliance with the License. You may obtain a copy
30
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
31
+ *
32
+ * Unless required by applicable law or agreed to in writing, software distributed under
33
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
34
+ * OF ANY KIND, either express or implied. See the License for the specific language
35
+ * governing permissions and limitations under the License.
36
+ */ /*
37
+ * Copyright 2020 Adobe. All rights reserved.
38
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
39
+ * you may not use this file except in compliance with the License. You may obtain a copy
40
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
41
+ *
42
+ * Unless required by applicable law or agreed to in writing, software distributed under
43
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
44
+ * OF ANY KIND, either express or implied. See the License for the specific language
45
+ * governing permissions and limitations under the License.
46
+ */
16
47
 
17
48
  const $bc765a7a041310da$var$OPEN_STATES = {
18
49
  entering: false,
19
50
  entered: true
20
51
  };
21
52
  function $bc765a7a041310da$export$b847a40ee92eff38(props) {
22
- var child1;
23
- return(/*#__PURE__*/ $fQOb3$react.createElement($fQOb3$reacttransitiongroupTransition, {
53
+ var child;
54
+ return /*#__PURE__*/ (0, $fQOb3$react).createElement((0, $fQOb3$Transition), {
24
55
  timeout: {
25
56
  enter: 0,
26
57
  exit: 350
27
58
  },
28
59
  ...props
29
- }, (state)=>$fQOb3$react.Children.map(props.children, (child)=>child && /*#__PURE__*/ $fQOb3$react.cloneElement(child, {
60
+ }, (state)=>(0, $fQOb3$react).Children.map(props.children, (child)=>child && /*#__PURE__*/ (0, $fQOb3$react).cloneElement(child, {
30
61
  isOpen: !!$bc765a7a041310da$var$OPEN_STATES[state]
31
- })
32
- )
33
- ));
62
+ })));
34
63
  }
35
64
 
36
65
 
@@ -39,14 +68,14 @@ function $bc765a7a041310da$export$b847a40ee92eff38(props) {
39
68
 
40
69
  function $70305dc5fb729c3b$var$Overlay(props, ref) {
41
70
  let { children: children , isOpen: isOpen , container: container , onEnter: onEnter , onEntering: onEntering , onEntered: onEntered , onExit: onExit , onExiting: onExiting , onExited: onExited } = props;
42
- let [exited, setExited] = $fQOb3$useState(!isOpen);
43
- let handleEntered = $fQOb3$useCallback(()=>{
71
+ let [exited, setExited] = (0, $fQOb3$useState)(!isOpen);
72
+ let handleEntered = (0, $fQOb3$useCallback)(()=>{
44
73
  setExited(false);
45
74
  if (onEntered) onEntered();
46
75
  }, [
47
76
  onEntered
48
77
  ]);
49
- let handleExited = $fQOb3$useCallback(()=>{
78
+ let handleExited = (0, $fQOb3$useCallback)(()=>{
50
79
  setExited(true);
51
80
  if (onExited) onExited();
52
81
  }, [
@@ -56,16 +85,16 @@ function $70305dc5fb729c3b$var$Overlay(props, ref) {
56
85
  let mountOverlay = isOpen || !exited;
57
86
  if (!mountOverlay) // Don't bother showing anything if we don't have to.
58
87
  return null;
59
- return(/*#__PURE__*/ $fQOb3$react.createElement($fQOb3$Overlay, {
88
+ return /*#__PURE__*/ (0, $fQOb3$react).createElement((0, $fQOb3$Overlay), {
60
89
  portalContainer: container
61
- }, /*#__PURE__*/ $fQOb3$react.createElement($fQOb3$Provider, {
90
+ }, /*#__PURE__*/ (0, $fQOb3$react).createElement((0, $fQOb3$Provider), {
62
91
  ref: ref,
63
92
  UNSAFE_style: {
64
- background: 'transparent',
65
- isolation: 'isolate'
93
+ background: "transparent",
94
+ isolation: "isolate"
66
95
  },
67
96
  isDisabled: false
68
- }, /*#__PURE__*/ $fQOb3$react.createElement($bc765a7a041310da$export$b847a40ee92eff38, {
97
+ }, /*#__PURE__*/ (0, $fQOb3$react).createElement((0, $bc765a7a041310da$export$b847a40ee92eff38), {
69
98
  in: isOpen,
70
99
  appear: true,
71
100
  onExit: onExit,
@@ -74,12 +103,22 @@ function $70305dc5fb729c3b$var$Overlay(props, ref) {
74
103
  onEnter: onEnter,
75
104
  onEntering: onEntering,
76
105
  onEntered: handleEntered
77
- }, children))));
106
+ }, children)));
78
107
  }
79
- let $70305dc5fb729c3b$export$c6fdb837b070b4ff = /*#__PURE__*/ $fQOb3$react.forwardRef($70305dc5fb729c3b$var$Overlay);
80
-
108
+ let $70305dc5fb729c3b$export$c6fdb837b070b4ff = /*#__PURE__*/ (0, $fQOb3$react).forwardRef($70305dc5fb729c3b$var$Overlay);
81
109
 
82
110
 
111
+ /*
112
+ * Copyright 2020 Adobe. All rights reserved.
113
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
114
+ * you may not use this file except in compliance with the License. You may obtain a copy
115
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
116
+ *
117
+ * Unless required by applicable law or agreed to in writing, software distributed under
118
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
119
+ * OF ANY KIND, either express or implied. See the License for the specific language
120
+ * governing permissions and limitations under the License.
121
+ */
83
122
 
84
123
 
85
124
  var $853e19557ad8790f$exports = {};
@@ -148,7 +187,17 @@ $645594d913f34a2a$export$cf634262e726cd19 = "spectrum-Popover--dialog_6115b8";
148
187
  $645594d913f34a2a$export$d8b16c5377728262 = "spectrum-Popover--withTip_6115b8";
149
188
 
150
189
 
151
-
190
+ /*
191
+ * Copyright 2020 Adobe. All rights reserved.
192
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
193
+ * you may not use this file except in compliance with the License. You may obtain a copy
194
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
195
+ *
196
+ * Unless required by applicable law or agreed to in writing, software distributed under
197
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
198
+ * OF ANY KIND, either express or implied. See the License for the specific language
199
+ * governing permissions and limitations under the License.
200
+ */
152
201
 
153
202
  var $c77d7b73b2bbd0fb$exports = {};
154
203
 
@@ -164,12 +213,12 @@ $c77d7b73b2bbd0fb$export$8eb3860104039b44 = "spectrum-Underlay--transparent_eb76
164
213
 
165
214
 
166
215
  function $76a452f4e3df11be$export$f360afc887607b02({ isOpen: isOpen , isTransparent: isTransparent }) {
167
- return(/*#__PURE__*/ $fQOb3$react.createElement("div", {
168
- className: $fQOb3$classNames((/*@__PURE__*/$parcel$interopDefault($c77d7b73b2bbd0fb$exports)), 'spectrum-Underlay', {
169
- 'is-open': isOpen,
170
- 'spectrum-Underlay--transparent': isTransparent
216
+ return /*#__PURE__*/ (0, $fQOb3$react).createElement("div", {
217
+ className: (0, $fQOb3$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($c77d7b73b2bbd0fb$exports))), "spectrum-Underlay", {
218
+ "is-open": isOpen,
219
+ "spectrum-Underlay--transparent": isTransparent
171
220
  })
172
- }));
221
+ });
173
222
  }
174
223
 
175
224
 
@@ -181,35 +230,35 @@ function $76a452f4e3df11be$export$f360afc887607b02({ isOpen: isOpen , isTranspar
181
230
  * the path always starts at 0 so that it perfectly overlaps the popover's border.
182
231
  * See bottom of file for more explanation.
183
232
  */ let $17b503f7de08fecc$var$arrowPlacement = {
184
- left: 'right',
185
- right: 'right',
186
- top: 'bottom',
187
- bottom: 'bottom'
233
+ left: "right",
234
+ right: "right",
235
+ top: "bottom",
236
+ bottom: "bottom"
188
237
  };
189
238
  function $17b503f7de08fecc$var$Popover(props, ref) {
190
239
  let { children: children , state: state , ...otherProps } = props;
191
- let domRef = $fQOb3$useDOMRef(ref);
192
- return(/*#__PURE__*/ $fQOb3$react.createElement($70305dc5fb729c3b$export$c6fdb837b070b4ff, {
240
+ let domRef = (0, $fQOb3$useDOMRef)(ref);
241
+ return /*#__PURE__*/ (0, $fQOb3$react).createElement((0, $70305dc5fb729c3b$export$c6fdb837b070b4ff), {
193
242
  ...otherProps,
194
243
  isOpen: state.isOpen
195
- }, /*#__PURE__*/ $fQOb3$react.createElement($17b503f7de08fecc$var$PopoverWrapper, {
244
+ }, /*#__PURE__*/ (0, $fQOb3$react).createElement($17b503f7de08fecc$var$PopoverWrapper, {
196
245
  ref: domRef,
197
246
  ...props
198
- }, children)));
247
+ }, children));
199
248
  }
200
- const $17b503f7de08fecc$var$PopoverWrapper = /*#__PURE__*/ $fQOb3$forwardRef((props, ref)=>{
249
+ const $17b503f7de08fecc$var$PopoverWrapper = /*#__PURE__*/ (0, $fQOb3$forwardRef)((props, ref)=>{
201
250
  let { children: children , isOpen: isOpen , hideArrow: hideArrow , isNonModal: isNonModal , state: state } = props;
202
- let { styleProps: styleProps } = $fQOb3$useStyleProps(props);
203
- let { popoverProps: popoverProps , arrowProps: arrowProps , underlayProps: underlayProps , placement: placement } = $fQOb3$usePopover({
251
+ let { styleProps: styleProps } = (0, $fQOb3$useStyleProps)(props);
252
+ let { popoverProps: popoverProps , arrowProps: arrowProps , underlayProps: underlayProps , placement: placement } = (0, $fQOb3$usePopover)({
204
253
  ...props,
205
254
  popoverRef: ref,
206
255
  maxHeight: null
207
256
  }, state);
208
- return(/*#__PURE__*/ $fQOb3$react.createElement($fQOb3$react.Fragment, null, !isNonModal && /*#__PURE__*/ $fQOb3$react.createElement($76a452f4e3df11be$export$f360afc887607b02, {
257
+ return /*#__PURE__*/ (0, $fQOb3$react).createElement((0, $fQOb3$react).Fragment, null, !isNonModal && /*#__PURE__*/ (0, $fQOb3$react).createElement((0, $76a452f4e3df11be$export$f360afc887607b02), {
209
258
  isTransparent: true,
210
259
  ...underlayProps,
211
260
  isOpen: isOpen
212
- }), /*#__PURE__*/ $fQOb3$react.createElement("div", {
261
+ }), /*#__PURE__*/ (0, $fQOb3$react).createElement("div", {
213
262
  ...styleProps,
214
263
  ...popoverProps,
215
264
  style: {
@@ -217,39 +266,39 @@ const $17b503f7de08fecc$var$PopoverWrapper = /*#__PURE__*/ $fQOb3$forwardRef((pr
217
266
  ...popoverProps.style
218
267
  },
219
268
  ref: ref,
220
- className: $fQOb3$classNames((/*@__PURE__*/$parcel$interopDefault($645594d913f34a2a$exports)), 'spectrum-Popover', `spectrum-Popover--${placement}`, {
221
- 'spectrum-Popover--withTip': !hideArrow,
222
- 'is-open': isOpen
223
- }, $fQOb3$classNames((/*@__PURE__*/$parcel$interopDefault($853e19557ad8790f$exports)), 'spectrum-Popover', 'react-spectrum-Popover'), styleProps.className),
269
+ className: (0, $fQOb3$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($645594d913f34a2a$exports))), "spectrum-Popover", `spectrum-Popover--${placement}`, {
270
+ "spectrum-Popover--withTip": !hideArrow,
271
+ "is-open": isOpen
272
+ }, (0, $fQOb3$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($853e19557ad8790f$exports))), "spectrum-Popover", "react-spectrum-Popover"), styleProps.className),
224
273
  role: "presentation",
225
274
  "data-testid": "popover"
226
- }, !isNonModal && /*#__PURE__*/ $fQOb3$react.createElement($fQOb3$DismissButton, {
275
+ }, !isNonModal && /*#__PURE__*/ (0, $fQOb3$react).createElement((0, $fQOb3$DismissButton), {
227
276
  onDismiss: state.close
228
- }), children, hideArrow ? null : /*#__PURE__*/ $fQOb3$react.createElement($17b503f7de08fecc$var$Arrow, {
277
+ }), children, hideArrow ? null : /*#__PURE__*/ (0, $fQOb3$react).createElement($17b503f7de08fecc$var$Arrow, {
229
278
  arrowProps: arrowProps,
230
279
  direction: $17b503f7de08fecc$var$arrowPlacement[placement]
231
- }), /*#__PURE__*/ $fQOb3$react.createElement($fQOb3$DismissButton, {
280
+ }), /*#__PURE__*/ (0, $fQOb3$react).createElement((0, $fQOb3$DismissButton), {
232
281
  onDismiss: state.close
233
- }))));
282
+ })));
234
283
  });
235
284
  let $17b503f7de08fecc$var$ROOT_2 = Math.sqrt(2);
236
285
  function $17b503f7de08fecc$var$Arrow(props) {
237
- let [size, setSize] = $fQOb3$useState(20);
238
- let [borderWidth, setBorderWidth] = $fQOb3$useState(1);
239
- let ref = $fQOb3$useRef();
286
+ let [size, setSize] = (0, $fQOb3$useState)(20);
287
+ let [borderWidth, setBorderWidth] = (0, $fQOb3$useState)(1);
288
+ let ref = (0, $fQOb3$useRef)();
240
289
  // get the css value for the tip size and divide it by 2 for this arrow implementation
241
- $fQOb3$useLayoutEffect(()=>{
290
+ (0, $fQOb3$useLayoutEffect)(()=>{
242
291
  if (ref.current) {
243
- let spectrumTipWidth = window.getComputedStyle(ref.current).getPropertyValue('--spectrum-popover-tip-size');
244
- if (spectrumTipWidth !== '') setSize(parseInt(spectrumTipWidth, 10) / 2);
245
- let spectrumBorderWidth = window.getComputedStyle(ref.current).getPropertyValue('--spectrum-popover-tip-borderWidth');
246
- if (spectrumBorderWidth !== '') setBorderWidth(parseInt(spectrumBorderWidth, 10));
292
+ let spectrumTipWidth = window.getComputedStyle(ref.current).getPropertyValue("--spectrum-popover-tip-size");
293
+ if (spectrumTipWidth !== "") setSize(parseInt(spectrumTipWidth, 10) / 2);
294
+ let spectrumBorderWidth = window.getComputedStyle(ref.current).getPropertyValue("--spectrum-popover-tip-borderWidth");
295
+ if (spectrumBorderWidth !== "") setBorderWidth(parseInt(spectrumBorderWidth, 10));
247
296
  }
248
297
  }, [
249
298
  ref
250
299
  ]);
251
- let landscape = props.direction === 'top' || props.direction === 'bottom';
252
- let mirror = props.direction === 'left' || props.direction === 'top';
300
+ let landscape = props.direction === "top" || props.direction === "bottom";
301
+ let mirror = props.direction === "left" || props.direction === "top";
253
302
  let borderDiagonal = borderWidth * $17b503f7de08fecc$var$ROOT_2;
254
303
  let halfBorderDiagonal = borderDiagonal / 2;
255
304
  let secondary = 2 * size + 2 * borderDiagonal;
@@ -260,44 +309,66 @@ function $17b503f7de08fecc$var$Arrow(props) {
260
309
  let secondaryMiddle = secondary / 2;
261
310
  let secondaryEnd = secondary - halfBorderDiagonal;
262
311
  let pathData = landscape ? [
263
- 'M',
312
+ "M",
264
313
  secondaryStart,
265
314
  primaryStart,
266
- 'L',
315
+ "L",
267
316
  secondaryMiddle,
268
317
  primaryEnd,
269
- 'L',
318
+ "L",
270
319
  secondaryEnd,
271
320
  primaryStart
272
321
  ] : [
273
- 'M',
322
+ "M",
274
323
  primaryStart,
275
324
  secondaryStart,
276
- 'L',
325
+ "L",
277
326
  primaryEnd,
278
327
  secondaryMiddle,
279
- 'L',
328
+ "L",
280
329
  primaryStart,
281
330
  secondaryEnd
282
331
  ];
283
332
  let arrowProps = props.arrowProps;
284
- /* use ceil because the svg needs to always accomodate the path inside it */ return(/*#__PURE__*/ $fQOb3$react.createElement("svg", {
333
+ /* use ceil because the svg needs to always accomodate the path inside it */ return /*#__PURE__*/ (0, $fQOb3$react).createElement("svg", {
285
334
  xmlns: "http://www.w3.org/svg/2000",
286
335
  width: Math.ceil(landscape ? secondary : primary),
287
336
  height: Math.ceil(landscape ? primary : secondary),
288
337
  style: props.style,
289
- className: $fQOb3$classNames((/*@__PURE__*/$parcel$interopDefault($645594d913f34a2a$exports)), 'spectrum-Popover-tip'),
338
+ className: (0, $fQOb3$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($645594d913f34a2a$exports))), "spectrum-Popover-tip"),
290
339
  ref: ref,
291
340
  ...arrowProps
292
- }, /*#__PURE__*/ $fQOb3$react.createElement("path", {
293
- className: $fQOb3$classNames((/*@__PURE__*/$parcel$interopDefault($645594d913f34a2a$exports)), 'spectrum-Popover-tip-triangle'),
294
- d: pathData.join(' ')
295
- })));
341
+ }, /*#__PURE__*/ (0, $fQOb3$react).createElement("path", {
342
+ className: (0, $fQOb3$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($645594d913f34a2a$exports))), "spectrum-Popover-tip-triangle"),
343
+ d: pathData.join(" ")
344
+ }));
296
345
  }
297
- let $17b503f7de08fecc$export$5b6b19405a83ff9d = /*#__PURE__*/ $fQOb3$forwardRef($17b503f7de08fecc$var$Popover);
298
-
299
-
300
-
346
+ let $17b503f7de08fecc$export$5b6b19405a83ff9d = /*#__PURE__*/ (0, $fQOb3$forwardRef)($17b503f7de08fecc$var$Popover);
347
+ /**
348
+ * More explanation on popover tips.
349
+ * - I tried changing the calculation of the popover placement in an effort to get it squarely onto the pixel grid.
350
+ * This did not work because the problem was in the svg partial pixel end of the path in the popover right and popover bottom.
351
+ * - I tried creating an extra 'bandaid' path that matched the background color and would overlap the popover border.
352
+ * This didn't work because the border on the svg triangle didn't extend all the way to match nicely with the popover border.
353
+ * - I tried getting the client bounding box and setting the svg to that partial pixel value
354
+ * This didn't work because again the issue was inside the svg
355
+ * - I didn't try drawing the svg backwards
356
+ * This could still be tried
357
+ * - I tried changing the calculation of the popover placement AND the svg height/width so that they were all rounded
358
+ * This seems to have done the trick.
359
+ */
360
+
361
+ /*
362
+ * Copyright 2020 Adobe. All rights reserved.
363
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
364
+ * you may not use this file except in compliance with the License. You may obtain a copy
365
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
366
+ *
367
+ * Unless required by applicable law or agreed to in writing, software distributed under
368
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
369
+ * OF ANY KIND, either express or implied. See the License for the specific language
370
+ * governing permissions and limitations under the License.
371
+ */
301
372
 
302
373
  var $f7ed9f5201273840$exports = {};
303
374
 
@@ -328,52 +399,62 @@ $f7ed9f5201273840$export$175dd699720b5fb7 = "spectrum-Modal--fullscreenTakeover_
328
399
 
329
400
  function $842084dfa182af65$var$Modal(props, ref) {
330
401
  let { children: children , state: state , ...otherProps } = props;
331
- let domRef = $fQOb3$useDOMRef(ref);
332
- return(/*#__PURE__*/ $fQOb3$react.createElement($70305dc5fb729c3b$export$c6fdb837b070b4ff, {
402
+ let domRef = (0, $fQOb3$useDOMRef)(ref);
403
+ return /*#__PURE__*/ (0, $fQOb3$react).createElement((0, $70305dc5fb729c3b$export$c6fdb837b070b4ff), {
333
404
  ...otherProps,
334
405
  isOpen: state.isOpen
335
- }, /*#__PURE__*/ $fQOb3$react.createElement($842084dfa182af65$var$ModalWrapper, {
406
+ }, /*#__PURE__*/ (0, $fQOb3$react).createElement($842084dfa182af65$var$ModalWrapper, {
336
407
  ...props,
337
408
  ref: domRef
338
- }, children)));
409
+ }, children));
339
410
  }
340
411
  let $842084dfa182af65$var$typeMap = {
341
- fullscreen: 'fullscreen',
342
- fullscreenTakeover: 'fullscreenTakeover'
412
+ fullscreen: "fullscreen",
413
+ fullscreenTakeover: "fullscreenTakeover"
343
414
  };
344
- let $842084dfa182af65$var$ModalWrapper = /*#__PURE__*/ $fQOb3$forwardRef(function(props, ref) {
415
+ let $842084dfa182af65$var$ModalWrapper = /*#__PURE__*/ (0, $fQOb3$forwardRef)(function(props, ref) {
345
416
  let { type: type , children: children , state: state , isOpen: isOpen } = props;
346
417
  let typeVariant = $842084dfa182af65$var$typeMap[type];
347
- let { styleProps: styleProps } = $fQOb3$useStyleProps(props);
348
- let { modalProps: modalProps , underlayProps: underlayProps } = $fQOb3$useModalOverlay(props, state, ref);
349
- let wrapperClassName = $fQOb3$classNames((/*@__PURE__*/$parcel$interopDefault($f7ed9f5201273840$exports)), 'spectrum-Modal-wrapper', $fQOb3$classNames((/*@__PURE__*/$parcel$interopDefault($853e19557ad8790f$exports)), 'spectrum-Modal-wrapper', 'react-spectrum-Modal-wrapper'));
350
- let modalClassName = $fQOb3$classNames((/*@__PURE__*/$parcel$interopDefault($f7ed9f5201273840$exports)), 'spectrum-Modal', {
351
- 'is-open': isOpen
352
- }, $fQOb3$classNames((/*@__PURE__*/$parcel$interopDefault($853e19557ad8790f$exports)), 'spectrum-Modal', 'react-spectrum-Modal'), {
418
+ let { styleProps: styleProps } = (0, $fQOb3$useStyleProps)(props);
419
+ let { modalProps: modalProps , underlayProps: underlayProps } = (0, $fQOb3$useModalOverlay)(props, state, ref);
420
+ let wrapperClassName = (0, $fQOb3$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($f7ed9f5201273840$exports))), "spectrum-Modal-wrapper", (0, $fQOb3$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($853e19557ad8790f$exports))), "spectrum-Modal-wrapper", "react-spectrum-Modal-wrapper"));
421
+ let modalClassName = (0, $fQOb3$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($f7ed9f5201273840$exports))), "spectrum-Modal", {
422
+ "is-open": isOpen
423
+ }, (0, $fQOb3$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($853e19557ad8790f$exports))), "spectrum-Modal", "react-spectrum-Modal"), {
353
424
  [`spectrum-Modal--${typeVariant}`]: typeVariant
354
425
  }, styleProps.className);
355
- let viewport = $fQOb3$useViewportSize();
426
+ let viewport = (0, $fQOb3$useViewportSize)();
356
427
  let style = {
357
- '--spectrum-visual-viewport-height': viewport.height + 'px'
428
+ "--spectrum-visual-viewport-height": viewport.height + "px"
358
429
  };
359
- return(/*#__PURE__*/ $fQOb3$react.createElement($fQOb3$react.Fragment, null, /*#__PURE__*/ $fQOb3$react.createElement($76a452f4e3df11be$export$f360afc887607b02, {
430
+ return /*#__PURE__*/ (0, $fQOb3$react).createElement((0, $fQOb3$react).Fragment, null, /*#__PURE__*/ (0, $fQOb3$react).createElement((0, $76a452f4e3df11be$export$f360afc887607b02), {
360
431
  ...underlayProps,
361
432
  isOpen: isOpen
362
- }), /*#__PURE__*/ $fQOb3$react.createElement("div", {
433
+ }), /*#__PURE__*/ (0, $fQOb3$react).createElement("div", {
363
434
  className: wrapperClassName,
364
435
  style: style
365
- }, /*#__PURE__*/ $fQOb3$react.createElement("div", {
436
+ }, /*#__PURE__*/ (0, $fQOb3$react).createElement("div", {
366
437
  ...styleProps,
367
438
  ...modalProps,
368
439
  ref: ref,
369
440
  className: modalClassName,
370
441
  "data-testid": "modal"
371
- }, children))));
442
+ }, children)));
372
443
  });
373
- let $842084dfa182af65$export$2b77a92f1a5ad772 = /*#__PURE__*/ $fQOb3$forwardRef($842084dfa182af65$var$Modal);
374
-
444
+ let $842084dfa182af65$export$2b77a92f1a5ad772 = /*#__PURE__*/ (0, $fQOb3$forwardRef)($842084dfa182af65$var$Modal);
375
445
 
376
446
 
447
+ /*
448
+ * Copyright 2020 Adobe. All rights reserved.
449
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
450
+ * you may not use this file except in compliance with the License. You may obtain a copy
451
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
452
+ *
453
+ * Unless required by applicable law or agreed to in writing, software distributed under
454
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
455
+ * OF ANY KIND, either express or implied. See the License for the specific language
456
+ * governing permissions and limitations under the License.
457
+ */
377
458
 
378
459
 
379
460
 
@@ -398,19 +479,19 @@ $930b2f4095bb11d1$export$79bfb05e59a300b = "spectrum-Tray--fixedHeight_23bf66";
398
479
 
399
480
  function $1afc87f3d16a5a1c$var$Tray(props, ref) {
400
481
  let { children: children , state: state , ...otherProps } = props;
401
- let domRef = $fQOb3$useDOMRef(ref);
402
- return(/*#__PURE__*/ $fQOb3$react.createElement($70305dc5fb729c3b$export$c6fdb837b070b4ff, {
482
+ let domRef = (0, $fQOb3$useDOMRef)(ref);
483
+ return /*#__PURE__*/ (0, $fQOb3$react).createElement((0, $70305dc5fb729c3b$export$c6fdb837b070b4ff), {
403
484
  ...otherProps,
404
485
  isOpen: state.isOpen
405
- }, /*#__PURE__*/ $fQOb3$react.createElement($1afc87f3d16a5a1c$var$TrayWrapper, {
486
+ }, /*#__PURE__*/ (0, $fQOb3$react).createElement($1afc87f3d16a5a1c$var$TrayWrapper, {
406
487
  ...props,
407
488
  ref: domRef
408
- }, children)));
489
+ }, children));
409
490
  }
410
- let $1afc87f3d16a5a1c$var$TrayWrapper = /*#__PURE__*/ $fQOb3$forwardRef(function(props, ref) {
491
+ let $1afc87f3d16a5a1c$var$TrayWrapper = /*#__PURE__*/ (0, $fQOb3$forwardRef)(function(props, ref) {
411
492
  let { children: children , isOpen: isOpen , isFixedHeight: isFixedHeight , state: state } = props;
412
- let { styleProps: styleProps } = $fQOb3$useStyleProps(props);
413
- let { modalProps: modalProps , underlayProps: underlayProps } = $fQOb3$useModalOverlay({
493
+ let { styleProps: styleProps } = (0, $fQOb3$useStyleProps)(props);
494
+ let { modalProps: modalProps , underlayProps: underlayProps } = (0, $fQOb3$useModalOverlay)({
414
495
  ...props,
415
496
  isDismissable: true
416
497
  }, state, ref);
@@ -421,34 +502,34 @@ let $1afc87f3d16a5a1c$var$TrayWrapper = /*#__PURE__*/ $fQOb3$forwardRef(function
421
502
  // when the address bar/bottom toolbars show and hide on scroll and vh units are fixed.
422
503
  // Also, the visual viewport is smaller than the layout viewport when the virtual keyboard
423
504
  // is up, so use the VisualViewport API to ensure the tray is displayed above the keyboard.
424
- let viewport = $fQOb3$useViewportSize();
505
+ let viewport = (0, $fQOb3$useViewportSize)();
425
506
  let wrapperStyle = {
426
- '--spectrum-visual-viewport-height': viewport.height + 'px'
507
+ "--spectrum-visual-viewport-height": viewport.height + "px"
427
508
  };
428
- let wrapperClassName = $fQOb3$classNames((/*@__PURE__*/$parcel$interopDefault($930b2f4095bb11d1$exports)), 'spectrum-Tray-wrapper');
429
- let className = $fQOb3$classNames((/*@__PURE__*/$parcel$interopDefault($930b2f4095bb11d1$exports)), 'spectrum-Tray', {
430
- 'is-open': isOpen,
431
- 'spectrum-Tray--fixedHeight': isFixedHeight
432
- }, $fQOb3$classNames((/*@__PURE__*/$parcel$interopDefault($853e19557ad8790f$exports)), 'spectrum-Tray', 'react-spectrum-Tray'), styleProps.className);
433
- return(/*#__PURE__*/ $fQOb3$react.createElement($fQOb3$react.Fragment, null, /*#__PURE__*/ $fQOb3$react.createElement($76a452f4e3df11be$export$f360afc887607b02, {
509
+ let wrapperClassName = (0, $fQOb3$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($930b2f4095bb11d1$exports))), "spectrum-Tray-wrapper");
510
+ let className = (0, $fQOb3$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($930b2f4095bb11d1$exports))), "spectrum-Tray", {
511
+ "is-open": isOpen,
512
+ "spectrum-Tray--fixedHeight": isFixedHeight
513
+ }, (0, $fQOb3$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($853e19557ad8790f$exports))), "spectrum-Tray", "react-spectrum-Tray"), styleProps.className);
514
+ return /*#__PURE__*/ (0, $fQOb3$react).createElement((0, $fQOb3$react).Fragment, null, /*#__PURE__*/ (0, $fQOb3$react).createElement((0, $76a452f4e3df11be$export$f360afc887607b02), {
434
515
  ...underlayProps,
435
516
  isOpen: isOpen
436
- }), /*#__PURE__*/ $fQOb3$react.createElement("div", {
517
+ }), /*#__PURE__*/ (0, $fQOb3$react).createElement("div", {
437
518
  className: wrapperClassName,
438
519
  style: wrapperStyle
439
- }, /*#__PURE__*/ $fQOb3$react.createElement("div", {
520
+ }, /*#__PURE__*/ (0, $fQOb3$react).createElement("div", {
440
521
  ...styleProps,
441
522
  ...modalProps,
442
523
  className: className,
443
524
  ref: ref,
444
525
  "data-testid": "tray"
445
- }, /*#__PURE__*/ $fQOb3$react.createElement($fQOb3$DismissButton, {
526
+ }, /*#__PURE__*/ (0, $fQOb3$react).createElement((0, $fQOb3$DismissButton), {
446
527
  onDismiss: state.close
447
- }), children, /*#__PURE__*/ $fQOb3$react.createElement($fQOb3$DismissButton, {
528
+ }), children, /*#__PURE__*/ (0, $fQOb3$react).createElement((0, $fQOb3$DismissButton), {
448
529
  onDismiss: state.close
449
- })))));
530
+ }))));
450
531
  });
451
- let $1afc87f3d16a5a1c$export$4589ed81930b555c = /*#__PURE__*/ $fQOb3$forwardRef($1afc87f3d16a5a1c$var$Tray);
532
+ let $1afc87f3d16a5a1c$export$4589ed81930b555c = /*#__PURE__*/ (0, $fQOb3$forwardRef)($1afc87f3d16a5a1c$var$Tray);
452
533
 
453
534
 
454
535