@react-spectrum/overlays 4.0.0 → 5.0.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/import.mjs +558 -0
- package/dist/main.css +1 -1
- package/dist/main.js +223 -123
- package/dist/main.js.map +1 -1
- package/dist/module.js +224 -124
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +15 -10
- package/src/Modal.tsx +11 -9
- package/src/OpenTransition.tsx +1 -1
- package/src/Overlay.tsx +3 -2
- package/src/Popover.tsx +11 -7
- package/src/Tray.tsx +12 -8
package/dist/main.js
CHANGED
|
@@ -2,7 +2,7 @@ require("./main.css");
|
|
|
2
2
|
var $eLPAa$reactspectrumprovider = require("@react-spectrum/provider");
|
|
3
3
|
var $eLPAa$react = require("react");
|
|
4
4
|
var $eLPAa$reactariaoverlays = require("@react-aria/overlays");
|
|
5
|
-
var $eLPAa$
|
|
5
|
+
var $eLPAa$reacttransitiongroup = require("react-transition-group");
|
|
6
6
|
var $eLPAa$reactspectrumutils = require("@react-spectrum/utils");
|
|
7
7
|
var $eLPAa$reactariautils = require("@react-aria/utils");
|
|
8
8
|
|
|
@@ -18,25 +18,54 @@ $parcel$export(module.exports, "Popover", () => $f02bba55a62f20dd$export$5b6b194
|
|
|
18
18
|
$parcel$export(module.exports, "Modal", () => $fc75a6aa7a2b905b$export$2b77a92f1a5ad772);
|
|
19
19
|
$parcel$export(module.exports, "Tray", () => $6b386deda21be662$export$4589ed81930b555c);
|
|
20
20
|
$parcel$export(module.exports, "OpenTransition", () => $13f51cdc44d228b9$export$b847a40ee92eff38);
|
|
21
|
-
|
|
21
|
+
/*
|
|
22
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
23
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
24
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
25
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
26
|
+
*
|
|
27
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
28
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
29
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
30
|
+
* governing permissions and limitations under the License.
|
|
31
|
+
*/ /// <reference types="css-module-types" />
|
|
32
|
+
/*
|
|
33
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
34
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
35
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
36
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
37
|
+
*
|
|
38
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
39
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
40
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
41
|
+
* governing permissions and limitations under the License.
|
|
42
|
+
*/ /*
|
|
43
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
44
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
45
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
46
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
47
|
+
*
|
|
48
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
49
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
50
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
51
|
+
* governing permissions and limitations under the License.
|
|
52
|
+
*/
|
|
22
53
|
|
|
23
54
|
const $13f51cdc44d228b9$var$OPEN_STATES = {
|
|
24
55
|
entering: false,
|
|
25
56
|
entered: true
|
|
26
57
|
};
|
|
27
58
|
function $13f51cdc44d228b9$export$b847a40ee92eff38(props) {
|
|
28
|
-
var
|
|
29
|
-
return
|
|
59
|
+
var child;
|
|
60
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement((0, $eLPAa$reacttransitiongroup.Transition), {
|
|
30
61
|
timeout: {
|
|
31
62
|
enter: 0,
|
|
32
63
|
exit: 350
|
|
33
64
|
},
|
|
34
65
|
...props
|
|
35
|
-
}, (state)=>($parcel$interopDefault($eLPAa$react)).Children.map(props.children, (child)=>child && /*#__PURE__*/ ($parcel$interopDefault($eLPAa$react)).cloneElement(child, {
|
|
66
|
+
}, (state)=>(0, ($parcel$interopDefault($eLPAa$react))).Children.map(props.children, (child)=>child && /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).cloneElement(child, {
|
|
36
67
|
isOpen: !!$13f51cdc44d228b9$var$OPEN_STATES[state]
|
|
37
|
-
})
|
|
38
|
-
)
|
|
39
|
-
));
|
|
68
|
+
})));
|
|
40
69
|
}
|
|
41
70
|
|
|
42
71
|
|
|
@@ -44,15 +73,15 @@ function $13f51cdc44d228b9$export$b847a40ee92eff38(props) {
|
|
|
44
73
|
|
|
45
74
|
|
|
46
75
|
function $2aebdc186fd41e87$var$Overlay(props, ref) {
|
|
47
|
-
let { children: children , isOpen: isOpen , container: container , onEnter: onEnter , onEntering: onEntering , onEntered: onEntered , onExit: onExit , onExiting: onExiting , onExited: onExited } = props;
|
|
48
|
-
let [exited, setExited] = $eLPAa$react.useState(!isOpen);
|
|
49
|
-
let handleEntered = $eLPAa$react.useCallback(()=>{
|
|
76
|
+
let { children: children , isOpen: isOpen , container: container , onEnter: onEnter , onEntering: onEntering , onEntered: onEntered , onExit: onExit , onExiting: onExiting , onExited: onExited , nodeRef: nodeRef } = props;
|
|
77
|
+
let [exited, setExited] = (0, $eLPAa$react.useState)(!isOpen);
|
|
78
|
+
let handleEntered = (0, $eLPAa$react.useCallback)(()=>{
|
|
50
79
|
setExited(false);
|
|
51
80
|
if (onEntered) onEntered();
|
|
52
81
|
}, [
|
|
53
82
|
onEntered
|
|
54
83
|
]);
|
|
55
|
-
let handleExited = $eLPAa$react.useCallback(()=>{
|
|
84
|
+
let handleExited = (0, $eLPAa$react.useCallback)(()=>{
|
|
56
85
|
setExited(true);
|
|
57
86
|
if (onExited) onExited();
|
|
58
87
|
}, [
|
|
@@ -62,16 +91,16 @@ function $2aebdc186fd41e87$var$Overlay(props, ref) {
|
|
|
62
91
|
let mountOverlay = isOpen || !exited;
|
|
63
92
|
if (!mountOverlay) // Don't bother showing anything if we don't have to.
|
|
64
93
|
return null;
|
|
65
|
-
return
|
|
94
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement((0, $eLPAa$reactariaoverlays.Overlay), {
|
|
66
95
|
portalContainer: container
|
|
67
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($eLPAa$react)).createElement($eLPAa$reactspectrumprovider.Provider, {
|
|
96
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement((0, $eLPAa$reactspectrumprovider.Provider), {
|
|
68
97
|
ref: ref,
|
|
69
98
|
UNSAFE_style: {
|
|
70
|
-
background:
|
|
71
|
-
isolation:
|
|
99
|
+
background: "transparent",
|
|
100
|
+
isolation: "isolate"
|
|
72
101
|
},
|
|
73
102
|
isDisabled: false
|
|
74
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($eLPAa$react)).createElement($13f51cdc44d228b9$export$b847a40ee92eff38, {
|
|
103
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement((0, $13f51cdc44d228b9$export$b847a40ee92eff38), {
|
|
75
104
|
in: isOpen,
|
|
76
105
|
appear: true,
|
|
77
106
|
onExit: onExit,
|
|
@@ -79,13 +108,24 @@ function $2aebdc186fd41e87$var$Overlay(props, ref) {
|
|
|
79
108
|
onExited: handleExited,
|
|
80
109
|
onEnter: onEnter,
|
|
81
110
|
onEntering: onEntering,
|
|
82
|
-
onEntered: handleEntered
|
|
83
|
-
|
|
111
|
+
onEntered: handleEntered,
|
|
112
|
+
nodeRef: nodeRef
|
|
113
|
+
}, children)));
|
|
84
114
|
}
|
|
85
|
-
let $2aebdc186fd41e87$export$c6fdb837b070b4ff = /*#__PURE__*/ ($parcel$interopDefault($eLPAa$react)).forwardRef($2aebdc186fd41e87$var$Overlay);
|
|
86
|
-
|
|
115
|
+
let $2aebdc186fd41e87$export$c6fdb837b070b4ff = /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).forwardRef($2aebdc186fd41e87$var$Overlay);
|
|
87
116
|
|
|
88
117
|
|
|
118
|
+
/*
|
|
119
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
120
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
121
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
122
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
123
|
+
*
|
|
124
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
125
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
126
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
127
|
+
* governing permissions and limitations under the License.
|
|
128
|
+
*/
|
|
89
129
|
|
|
90
130
|
|
|
91
131
|
var $e9a663ccb19ed1b0$exports = {};
|
|
@@ -154,7 +194,17 @@ $16e1dca4664d0b1c$export$cf634262e726cd19 = "spectrum-Popover--dialog_6115b8";
|
|
|
154
194
|
$16e1dca4664d0b1c$export$d8b16c5377728262 = "spectrum-Popover--withTip_6115b8";
|
|
155
195
|
|
|
156
196
|
|
|
157
|
-
|
|
197
|
+
/*
|
|
198
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
199
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
200
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
201
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
202
|
+
*
|
|
203
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
204
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
205
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
206
|
+
* governing permissions and limitations under the License.
|
|
207
|
+
*/
|
|
158
208
|
|
|
159
209
|
var $42908e91b4c5f428$exports = {};
|
|
160
210
|
|
|
@@ -170,12 +220,12 @@ $42908e91b4c5f428$export$8eb3860104039b44 = "spectrum-Underlay--transparent_eb76
|
|
|
170
220
|
|
|
171
221
|
|
|
172
222
|
function $b900e75089bdd9cd$export$f360afc887607b02({ isOpen: isOpen , isTransparent: isTransparent }) {
|
|
173
|
-
return
|
|
174
|
-
className: $eLPAa$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($42908e91b4c5f428$exports)),
|
|
175
|
-
|
|
176
|
-
|
|
223
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement("div", {
|
|
224
|
+
className: (0, $eLPAa$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($42908e91b4c5f428$exports))), "spectrum-Underlay", {
|
|
225
|
+
"is-open": isOpen,
|
|
226
|
+
"spectrum-Underlay--transparent": isTransparent
|
|
177
227
|
})
|
|
178
|
-
})
|
|
228
|
+
});
|
|
179
229
|
}
|
|
180
230
|
|
|
181
231
|
|
|
@@ -187,35 +237,41 @@ function $b900e75089bdd9cd$export$f360afc887607b02({ isOpen: isOpen , isTranspar
|
|
|
187
237
|
* the path always starts at 0 so that it perfectly overlaps the popover's border.
|
|
188
238
|
* See bottom of file for more explanation.
|
|
189
239
|
*/ let $f02bba55a62f20dd$var$arrowPlacement = {
|
|
190
|
-
left:
|
|
191
|
-
right:
|
|
192
|
-
top:
|
|
193
|
-
bottom:
|
|
240
|
+
left: "right",
|
|
241
|
+
right: "right",
|
|
242
|
+
top: "bottom",
|
|
243
|
+
bottom: "bottom"
|
|
194
244
|
};
|
|
195
245
|
function $f02bba55a62f20dd$var$Popover(props, ref) {
|
|
196
246
|
let { children: children , state: state , ...otherProps } = props;
|
|
197
|
-
let domRef = $eLPAa$reactspectrumutils.useDOMRef(ref);
|
|
198
|
-
|
|
247
|
+
let domRef = (0, $eLPAa$reactspectrumutils.useDOMRef)(ref);
|
|
248
|
+
let wrapperRef = (0, $eLPAa$react.useRef)(null);
|
|
249
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement((0, $2aebdc186fd41e87$export$c6fdb837b070b4ff), {
|
|
199
250
|
...otherProps,
|
|
200
|
-
isOpen: state.isOpen
|
|
201
|
-
|
|
251
|
+
isOpen: state.isOpen,
|
|
252
|
+
nodeRef: wrapperRef
|
|
253
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement($f02bba55a62f20dd$var$PopoverWrapper, {
|
|
202
254
|
ref: domRef,
|
|
203
|
-
...props
|
|
204
|
-
|
|
255
|
+
...props,
|
|
256
|
+
wrapperRef: wrapperRef
|
|
257
|
+
}, children));
|
|
205
258
|
}
|
|
206
|
-
const $f02bba55a62f20dd$var$PopoverWrapper = /*#__PURE__*/ $eLPAa$react.forwardRef((props, ref)=>{
|
|
207
|
-
let { children: children , isOpen: isOpen , hideArrow: hideArrow , isNonModal: isNonModal , state: state } = props;
|
|
208
|
-
let { styleProps: styleProps } = $eLPAa$reactspectrumutils.useStyleProps(props);
|
|
209
|
-
let { popoverProps: popoverProps , arrowProps: arrowProps , underlayProps: underlayProps , placement: placement } = $eLPAa$reactariaoverlays.usePopover({
|
|
259
|
+
const $f02bba55a62f20dd$var$PopoverWrapper = /*#__PURE__*/ (0, $eLPAa$react.forwardRef)((props, ref)=>{
|
|
260
|
+
let { children: children , isOpen: isOpen , hideArrow: hideArrow , isNonModal: isNonModal , state: state , wrapperRef: wrapperRef } = props;
|
|
261
|
+
let { styleProps: styleProps } = (0, $eLPAa$reactspectrumutils.useStyleProps)(props);
|
|
262
|
+
let { popoverProps: popoverProps , arrowProps: arrowProps , underlayProps: underlayProps , placement: placement } = (0, $eLPAa$reactariaoverlays.usePopover)({
|
|
210
263
|
...props,
|
|
211
264
|
popoverRef: ref,
|
|
212
265
|
maxHeight: null
|
|
213
266
|
}, state);
|
|
214
|
-
|
|
267
|
+
// Attach Transition's nodeRef to outer most wrapper for node.reflow: https://github.com/reactjs/react-transition-group/blob/c89f807067b32eea6f68fd6c622190d88ced82e2/src/Transition.js#L231
|
|
268
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement("div", {
|
|
269
|
+
ref: wrapperRef
|
|
270
|
+
}, !isNonModal && /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement((0, $b900e75089bdd9cd$export$f360afc887607b02), {
|
|
215
271
|
isTransparent: true,
|
|
216
272
|
...underlayProps,
|
|
217
273
|
isOpen: isOpen
|
|
218
|
-
}), /*#__PURE__*/ ($parcel$interopDefault($eLPAa$react)).createElement("div", {
|
|
274
|
+
}), /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement("div", {
|
|
219
275
|
...styleProps,
|
|
220
276
|
...popoverProps,
|
|
221
277
|
style: {
|
|
@@ -223,39 +279,39 @@ const $f02bba55a62f20dd$var$PopoverWrapper = /*#__PURE__*/ $eLPAa$react.forwardR
|
|
|
223
279
|
...popoverProps.style
|
|
224
280
|
},
|
|
225
281
|
ref: ref,
|
|
226
|
-
className: $eLPAa$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($16e1dca4664d0b1c$exports)),
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
}, $eLPAa$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($e9a663ccb19ed1b0$exports)),
|
|
282
|
+
className: (0, $eLPAa$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($16e1dca4664d0b1c$exports))), "spectrum-Popover", `spectrum-Popover--${placement}`, {
|
|
283
|
+
"spectrum-Popover--withTip": !hideArrow,
|
|
284
|
+
"is-open": isOpen
|
|
285
|
+
}, (0, $eLPAa$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($e9a663ccb19ed1b0$exports))), "spectrum-Popover", "react-spectrum-Popover"), styleProps.className),
|
|
230
286
|
role: "presentation",
|
|
231
287
|
"data-testid": "popover"
|
|
232
|
-
}, !isNonModal && /*#__PURE__*/ ($parcel$interopDefault($eLPAa$react)).createElement($eLPAa$reactariaoverlays.DismissButton, {
|
|
288
|
+
}, !isNonModal && /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement((0, $eLPAa$reactariaoverlays.DismissButton), {
|
|
233
289
|
onDismiss: state.close
|
|
234
|
-
}), children, hideArrow ? null : /*#__PURE__*/ ($parcel$interopDefault($eLPAa$react)).createElement($f02bba55a62f20dd$var$Arrow, {
|
|
290
|
+
}), children, hideArrow ? null : /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement($f02bba55a62f20dd$var$Arrow, {
|
|
235
291
|
arrowProps: arrowProps,
|
|
236
292
|
direction: $f02bba55a62f20dd$var$arrowPlacement[placement]
|
|
237
|
-
}), /*#__PURE__*/ ($parcel$interopDefault($eLPAa$react)).createElement($eLPAa$reactariaoverlays.DismissButton, {
|
|
293
|
+
}), /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement((0, $eLPAa$reactariaoverlays.DismissButton), {
|
|
238
294
|
onDismiss: state.close
|
|
239
|
-
})))
|
|
295
|
+
})));
|
|
240
296
|
});
|
|
241
297
|
let $f02bba55a62f20dd$var$ROOT_2 = Math.sqrt(2);
|
|
242
298
|
function $f02bba55a62f20dd$var$Arrow(props) {
|
|
243
|
-
let [size, setSize] = $eLPAa$react.useState(20);
|
|
244
|
-
let [borderWidth, setBorderWidth] = $eLPAa$react.useState(1);
|
|
245
|
-
let ref = $eLPAa$react.useRef();
|
|
299
|
+
let [size, setSize] = (0, $eLPAa$react.useState)(20);
|
|
300
|
+
let [borderWidth, setBorderWidth] = (0, $eLPAa$react.useState)(1);
|
|
301
|
+
let ref = (0, $eLPAa$react.useRef)();
|
|
246
302
|
// get the css value for the tip size and divide it by 2 for this arrow implementation
|
|
247
|
-
$eLPAa$reactariautils.useLayoutEffect(()=>{
|
|
303
|
+
(0, $eLPAa$reactariautils.useLayoutEffect)(()=>{
|
|
248
304
|
if (ref.current) {
|
|
249
|
-
let spectrumTipWidth = window.getComputedStyle(ref.current).getPropertyValue(
|
|
250
|
-
if (spectrumTipWidth !==
|
|
251
|
-
let spectrumBorderWidth = window.getComputedStyle(ref.current).getPropertyValue(
|
|
252
|
-
if (spectrumBorderWidth !==
|
|
305
|
+
let spectrumTipWidth = window.getComputedStyle(ref.current).getPropertyValue("--spectrum-popover-tip-size");
|
|
306
|
+
if (spectrumTipWidth !== "") setSize(parseInt(spectrumTipWidth, 10) / 2);
|
|
307
|
+
let spectrumBorderWidth = window.getComputedStyle(ref.current).getPropertyValue("--spectrum-popover-tip-borderWidth");
|
|
308
|
+
if (spectrumBorderWidth !== "") setBorderWidth(parseInt(spectrumBorderWidth, 10));
|
|
253
309
|
}
|
|
254
310
|
}, [
|
|
255
311
|
ref
|
|
256
312
|
]);
|
|
257
|
-
let landscape = props.direction ===
|
|
258
|
-
let mirror = props.direction ===
|
|
313
|
+
let landscape = props.direction === "top" || props.direction === "bottom";
|
|
314
|
+
let mirror = props.direction === "left" || props.direction === "top";
|
|
259
315
|
let borderDiagonal = borderWidth * $f02bba55a62f20dd$var$ROOT_2;
|
|
260
316
|
let halfBorderDiagonal = borderDiagonal / 2;
|
|
261
317
|
let secondary = 2 * size + 2 * borderDiagonal;
|
|
@@ -266,44 +322,66 @@ function $f02bba55a62f20dd$var$Arrow(props) {
|
|
|
266
322
|
let secondaryMiddle = secondary / 2;
|
|
267
323
|
let secondaryEnd = secondary - halfBorderDiagonal;
|
|
268
324
|
let pathData = landscape ? [
|
|
269
|
-
|
|
325
|
+
"M",
|
|
270
326
|
secondaryStart,
|
|
271
327
|
primaryStart,
|
|
272
|
-
|
|
328
|
+
"L",
|
|
273
329
|
secondaryMiddle,
|
|
274
330
|
primaryEnd,
|
|
275
|
-
|
|
331
|
+
"L",
|
|
276
332
|
secondaryEnd,
|
|
277
333
|
primaryStart
|
|
278
334
|
] : [
|
|
279
|
-
|
|
335
|
+
"M",
|
|
280
336
|
primaryStart,
|
|
281
337
|
secondaryStart,
|
|
282
|
-
|
|
338
|
+
"L",
|
|
283
339
|
primaryEnd,
|
|
284
340
|
secondaryMiddle,
|
|
285
|
-
|
|
341
|
+
"L",
|
|
286
342
|
primaryStart,
|
|
287
343
|
secondaryEnd
|
|
288
344
|
];
|
|
289
345
|
let arrowProps = props.arrowProps;
|
|
290
|
-
/* use ceil because the svg needs to always accomodate the path inside it */ return
|
|
346
|
+
/* use ceil because the svg needs to always accomodate the path inside it */ return /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement("svg", {
|
|
291
347
|
xmlns: "http://www.w3.org/svg/2000",
|
|
292
348
|
width: Math.ceil(landscape ? secondary : primary),
|
|
293
349
|
height: Math.ceil(landscape ? primary : secondary),
|
|
294
350
|
style: props.style,
|
|
295
|
-
className: $eLPAa$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($16e1dca4664d0b1c$exports)),
|
|
351
|
+
className: (0, $eLPAa$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($16e1dca4664d0b1c$exports))), "spectrum-Popover-tip"),
|
|
296
352
|
ref: ref,
|
|
297
353
|
...arrowProps
|
|
298
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($eLPAa$react)).createElement("path", {
|
|
299
|
-
className: $eLPAa$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($16e1dca4664d0b1c$exports)),
|
|
300
|
-
d: pathData.join(
|
|
301
|
-
}))
|
|
354
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement("path", {
|
|
355
|
+
className: (0, $eLPAa$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($16e1dca4664d0b1c$exports))), "spectrum-Popover-tip-triangle"),
|
|
356
|
+
d: pathData.join(" ")
|
|
357
|
+
}));
|
|
302
358
|
}
|
|
303
|
-
let $f02bba55a62f20dd$export$5b6b19405a83ff9d = /*#__PURE__*/ $eLPAa$react.forwardRef($f02bba55a62f20dd$var$Popover);
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
359
|
+
let $f02bba55a62f20dd$export$5b6b19405a83ff9d = /*#__PURE__*/ (0, $eLPAa$react.forwardRef)($f02bba55a62f20dd$var$Popover);
|
|
360
|
+
/**
|
|
361
|
+
* More explanation on popover tips.
|
|
362
|
+
* - I tried changing the calculation of the popover placement in an effort to get it squarely onto the pixel grid.
|
|
363
|
+
* This did not work because the problem was in the svg partial pixel end of the path in the popover right and popover bottom.
|
|
364
|
+
* - I tried creating an extra 'bandaid' path that matched the background color and would overlap the popover border.
|
|
365
|
+
* This didn't work because the border on the svg triangle didn't extend all the way to match nicely with the popover border.
|
|
366
|
+
* - I tried getting the client bounding box and setting the svg to that partial pixel value
|
|
367
|
+
* This didn't work because again the issue was inside the svg
|
|
368
|
+
* - I didn't try drawing the svg backwards
|
|
369
|
+
* This could still be tried
|
|
370
|
+
* - I tried changing the calculation of the popover placement AND the svg height/width so that they were all rounded
|
|
371
|
+
* This seems to have done the trick.
|
|
372
|
+
*/
|
|
373
|
+
|
|
374
|
+
/*
|
|
375
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
376
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
377
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
378
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
379
|
+
*
|
|
380
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
381
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
382
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
383
|
+
* governing permissions and limitations under the License.
|
|
384
|
+
*/
|
|
307
385
|
|
|
308
386
|
var $86571b803f942ff3$exports = {};
|
|
309
387
|
|
|
@@ -334,52 +412,68 @@ $86571b803f942ff3$export$175dd699720b5fb7 = "spectrum-Modal--fullscreenTakeover_
|
|
|
334
412
|
|
|
335
413
|
function $fc75a6aa7a2b905b$var$Modal(props, ref) {
|
|
336
414
|
let { children: children , state: state , ...otherProps } = props;
|
|
337
|
-
let domRef = $eLPAa$reactspectrumutils.useDOMRef(ref);
|
|
338
|
-
|
|
415
|
+
let domRef = (0, $eLPAa$reactspectrumutils.useDOMRef)(ref);
|
|
416
|
+
let wrapperRef = (0, $eLPAa$react.useRef)(null);
|
|
417
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement((0, $2aebdc186fd41e87$export$c6fdb837b070b4ff), {
|
|
339
418
|
...otherProps,
|
|
340
|
-
isOpen: state.isOpen
|
|
341
|
-
|
|
419
|
+
isOpen: state.isOpen,
|
|
420
|
+
nodeRef: wrapperRef
|
|
421
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement($fc75a6aa7a2b905b$var$ModalWrapper, {
|
|
342
422
|
...props,
|
|
423
|
+
wrapperRef: wrapperRef,
|
|
343
424
|
ref: domRef
|
|
344
|
-
}, children))
|
|
425
|
+
}, children));
|
|
345
426
|
}
|
|
346
427
|
let $fc75a6aa7a2b905b$var$typeMap = {
|
|
347
|
-
fullscreen:
|
|
348
|
-
fullscreenTakeover:
|
|
428
|
+
fullscreen: "fullscreen",
|
|
429
|
+
fullscreenTakeover: "fullscreenTakeover"
|
|
349
430
|
};
|
|
350
|
-
let $fc75a6aa7a2b905b$var$ModalWrapper = /*#__PURE__*/ $eLPAa$react.forwardRef(function(props, ref) {
|
|
351
|
-
let { type: type , children: children , state: state , isOpen: isOpen } = props;
|
|
431
|
+
let $fc75a6aa7a2b905b$var$ModalWrapper = /*#__PURE__*/ (0, $eLPAa$react.forwardRef)(function(props, ref) {
|
|
432
|
+
let { type: type , children: children , state: state , isOpen: isOpen , wrapperRef: wrapperRef } = props;
|
|
352
433
|
let typeVariant = $fc75a6aa7a2b905b$var$typeMap[type];
|
|
353
|
-
let { styleProps: styleProps } = $eLPAa$reactspectrumutils.useStyleProps(props);
|
|
354
|
-
let { modalProps: modalProps , underlayProps: underlayProps } = $eLPAa$reactariaoverlays.useModalOverlay(props, state, ref);
|
|
355
|
-
let wrapperClassName = $eLPAa$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($86571b803f942ff3$exports)),
|
|
356
|
-
let modalClassName = $eLPAa$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($86571b803f942ff3$exports)),
|
|
357
|
-
|
|
358
|
-
}, $eLPAa$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($e9a663ccb19ed1b0$exports)),
|
|
434
|
+
let { styleProps: styleProps } = (0, $eLPAa$reactspectrumutils.useStyleProps)(props);
|
|
435
|
+
let { modalProps: modalProps , underlayProps: underlayProps } = (0, $eLPAa$reactariaoverlays.useModalOverlay)(props, state, ref);
|
|
436
|
+
let wrapperClassName = (0, $eLPAa$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($86571b803f942ff3$exports))), "spectrum-Modal-wrapper", (0, $eLPAa$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($e9a663ccb19ed1b0$exports))), "spectrum-Modal-wrapper", "react-spectrum-Modal-wrapper"));
|
|
437
|
+
let modalClassName = (0, $eLPAa$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($86571b803f942ff3$exports))), "spectrum-Modal", {
|
|
438
|
+
"is-open": isOpen
|
|
439
|
+
}, (0, $eLPAa$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($e9a663ccb19ed1b0$exports))), "spectrum-Modal", "react-spectrum-Modal"), {
|
|
359
440
|
[`spectrum-Modal--${typeVariant}`]: typeVariant
|
|
360
441
|
}, styleProps.className);
|
|
361
|
-
let viewport = $eLPAa$reactariautils.useViewportSize();
|
|
442
|
+
let viewport = (0, $eLPAa$reactariautils.useViewportSize)();
|
|
362
443
|
let style = {
|
|
363
|
-
|
|
444
|
+
"--spectrum-visual-viewport-height": viewport.height + "px"
|
|
364
445
|
};
|
|
365
|
-
|
|
446
|
+
// Attach Transition's nodeRef to outer most wrapper for node.reflow: https://github.com/reactjs/react-transition-group/blob/c89f807067b32eea6f68fd6c622190d88ced82e2/src/Transition.js#L231
|
|
447
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement("div", {
|
|
448
|
+
ref: wrapperRef
|
|
449
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement((0, $b900e75089bdd9cd$export$f360afc887607b02), {
|
|
366
450
|
...underlayProps,
|
|
367
451
|
isOpen: isOpen
|
|
368
|
-
}), /*#__PURE__*/ ($parcel$interopDefault($eLPAa$react)).createElement("div", {
|
|
452
|
+
}), /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement("div", {
|
|
369
453
|
className: wrapperClassName,
|
|
370
454
|
style: style
|
|
371
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($eLPAa$react)).createElement("div", {
|
|
455
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement("div", {
|
|
372
456
|
...styleProps,
|
|
373
457
|
...modalProps,
|
|
374
458
|
ref: ref,
|
|
375
459
|
className: modalClassName,
|
|
376
460
|
"data-testid": "modal"
|
|
377
|
-
}, children)))
|
|
461
|
+
}, children)));
|
|
378
462
|
});
|
|
379
|
-
let $fc75a6aa7a2b905b$export$2b77a92f1a5ad772 = /*#__PURE__*/ $eLPAa$react.forwardRef($fc75a6aa7a2b905b$var$Modal);
|
|
380
|
-
|
|
463
|
+
let $fc75a6aa7a2b905b$export$2b77a92f1a5ad772 = /*#__PURE__*/ (0, $eLPAa$react.forwardRef)($fc75a6aa7a2b905b$var$Modal);
|
|
381
464
|
|
|
382
465
|
|
|
466
|
+
/*
|
|
467
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
468
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
469
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
470
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
471
|
+
*
|
|
472
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
473
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
474
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
475
|
+
* governing permissions and limitations under the License.
|
|
476
|
+
*/
|
|
383
477
|
|
|
384
478
|
|
|
385
479
|
|
|
@@ -404,19 +498,22 @@ $3ba16c5c57f2a636$export$79bfb05e59a300b = "spectrum-Tray--fixedHeight_23bf66";
|
|
|
404
498
|
|
|
405
499
|
function $6b386deda21be662$var$Tray(props, ref) {
|
|
406
500
|
let { children: children , state: state , ...otherProps } = props;
|
|
407
|
-
let domRef = $eLPAa$reactspectrumutils.useDOMRef(ref);
|
|
408
|
-
|
|
501
|
+
let domRef = (0, $eLPAa$reactspectrumutils.useDOMRef)(ref);
|
|
502
|
+
let wrapperRef = (0, $eLPAa$react.useRef)(null);
|
|
503
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement((0, $2aebdc186fd41e87$export$c6fdb837b070b4ff), {
|
|
409
504
|
...otherProps,
|
|
410
|
-
isOpen: state.isOpen
|
|
411
|
-
|
|
505
|
+
isOpen: state.isOpen,
|
|
506
|
+
nodeRef: wrapperRef
|
|
507
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement($6b386deda21be662$var$TrayWrapper, {
|
|
412
508
|
...props,
|
|
509
|
+
wrapperRef: wrapperRef,
|
|
413
510
|
ref: domRef
|
|
414
|
-
}, children))
|
|
511
|
+
}, children));
|
|
415
512
|
}
|
|
416
|
-
let $6b386deda21be662$var$TrayWrapper = /*#__PURE__*/ $eLPAa$react.forwardRef(function(props, ref) {
|
|
417
|
-
let { children: children , isOpen: isOpen , isFixedHeight: isFixedHeight , state: state } = props;
|
|
418
|
-
let { styleProps: styleProps } = $eLPAa$reactspectrumutils.useStyleProps(props);
|
|
419
|
-
let { modalProps: modalProps , underlayProps: underlayProps } = $eLPAa$reactariaoverlays.useModalOverlay({
|
|
513
|
+
let $6b386deda21be662$var$TrayWrapper = /*#__PURE__*/ (0, $eLPAa$react.forwardRef)(function(props, ref) {
|
|
514
|
+
let { children: children , isOpen: isOpen , isFixedHeight: isFixedHeight , state: state , wrapperRef: wrapperRef } = props;
|
|
515
|
+
let { styleProps: styleProps } = (0, $eLPAa$reactspectrumutils.useStyleProps)(props);
|
|
516
|
+
let { modalProps: modalProps , underlayProps: underlayProps } = (0, $eLPAa$reactariaoverlays.useModalOverlay)({
|
|
420
517
|
...props,
|
|
421
518
|
isDismissable: true
|
|
422
519
|
}, state, ref);
|
|
@@ -427,34 +524,37 @@ let $6b386deda21be662$var$TrayWrapper = /*#__PURE__*/ $eLPAa$react.forwardRef(fu
|
|
|
427
524
|
// when the address bar/bottom toolbars show and hide on scroll and vh units are fixed.
|
|
428
525
|
// Also, the visual viewport is smaller than the layout viewport when the virtual keyboard
|
|
429
526
|
// is up, so use the VisualViewport API to ensure the tray is displayed above the keyboard.
|
|
430
|
-
let viewport = $eLPAa$reactariautils.useViewportSize();
|
|
527
|
+
let viewport = (0, $eLPAa$reactariautils.useViewportSize)();
|
|
431
528
|
let wrapperStyle = {
|
|
432
|
-
|
|
529
|
+
"--spectrum-visual-viewport-height": viewport.height + "px"
|
|
433
530
|
};
|
|
434
|
-
let wrapperClassName = $eLPAa$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($3ba16c5c57f2a636$exports)),
|
|
435
|
-
let className = $eLPAa$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($3ba16c5c57f2a636$exports)),
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
}, $eLPAa$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($e9a663ccb19ed1b0$exports)),
|
|
439
|
-
|
|
531
|
+
let wrapperClassName = (0, $eLPAa$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($3ba16c5c57f2a636$exports))), "spectrum-Tray-wrapper");
|
|
532
|
+
let className = (0, $eLPAa$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($3ba16c5c57f2a636$exports))), "spectrum-Tray", {
|
|
533
|
+
"is-open": isOpen,
|
|
534
|
+
"spectrum-Tray--fixedHeight": isFixedHeight
|
|
535
|
+
}, (0, $eLPAa$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($e9a663ccb19ed1b0$exports))), "spectrum-Tray", "react-spectrum-Tray"), styleProps.className);
|
|
536
|
+
// Attach Transition's nodeRef to outer most wrapper for node.reflow: https://github.com/reactjs/react-transition-group/blob/c89f807067b32eea6f68fd6c622190d88ced82e2/src/Transition.js#L231
|
|
537
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement("div", {
|
|
538
|
+
ref: wrapperRef
|
|
539
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement((0, $b900e75089bdd9cd$export$f360afc887607b02), {
|
|
440
540
|
...underlayProps,
|
|
441
541
|
isOpen: isOpen
|
|
442
|
-
}), /*#__PURE__*/ ($parcel$interopDefault($eLPAa$react)).createElement("div", {
|
|
542
|
+
}), /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement("div", {
|
|
443
543
|
className: wrapperClassName,
|
|
444
544
|
style: wrapperStyle
|
|
445
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($eLPAa$react)).createElement("div", {
|
|
545
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement("div", {
|
|
446
546
|
...styleProps,
|
|
447
547
|
...modalProps,
|
|
448
548
|
className: className,
|
|
449
549
|
ref: ref,
|
|
450
550
|
"data-testid": "tray"
|
|
451
|
-
}, /*#__PURE__*/ ($parcel$interopDefault($eLPAa$react)).createElement($eLPAa$reactariaoverlays.DismissButton, {
|
|
551
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement((0, $eLPAa$reactariaoverlays.DismissButton), {
|
|
452
552
|
onDismiss: state.close
|
|
453
|
-
}), children, /*#__PURE__*/ ($parcel$interopDefault($eLPAa$react)).createElement($eLPAa$reactariaoverlays.DismissButton, {
|
|
553
|
+
}), children, /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement((0, $eLPAa$reactariaoverlays.DismissButton), {
|
|
454
554
|
onDismiss: state.close
|
|
455
|
-
}))))
|
|
555
|
+
}))));
|
|
456
556
|
});
|
|
457
|
-
let $6b386deda21be662$export$4589ed81930b555c = /*#__PURE__*/ $eLPAa$react.forwardRef($6b386deda21be662$var$Tray);
|
|
557
|
+
let $6b386deda21be662$export$4589ed81930b555c = /*#__PURE__*/ (0, $eLPAa$react.forwardRef)($6b386deda21be662$var$Tray);
|
|
458
558
|
|
|
459
559
|
|
|
460
560
|
|