@react-spectrum/overlays 5.1.1 → 5.3.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 +15 -10
- package/dist/main.css +1 -1
- package/dist/main.js +14 -9
- package/dist/main.js.map +1 -1
- package/dist/module.js +15 -10
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +12 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +10 -9
- package/src/Overlay.tsx +14 -2
- package/src/Popover.tsx +25 -7
package/dist/import.mjs
CHANGED
|
@@ -4,7 +4,8 @@ import $fQOb3$react, {useState as $fQOb3$useState, useCallback as $fQOb3$useCall
|
|
|
4
4
|
import {Overlay as $fQOb3$Overlay, usePopover as $fQOb3$usePopover, DismissButton as $fQOb3$DismissButton, useModalOverlay as $fQOb3$useModalOverlay} from "@react-aria/overlays";
|
|
5
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
|
-
import {
|
|
7
|
+
import {useFocusWithin as $fQOb3$useFocusWithin} from "@react-aria/interactions";
|
|
8
|
+
import {mergeProps as $fQOb3$mergeProps, useLayoutEffect as $fQOb3$useLayoutEffect, useViewportSize as $fQOb3$useViewportSize} from "@react-aria/utils";
|
|
8
9
|
|
|
9
10
|
function $parcel$interopDefault(a) {
|
|
10
11
|
return a && a.__esModule ? a.default : a;
|
|
@@ -67,7 +68,7 @@ function $bc765a7a041310da$export$b847a40ee92eff38(props) {
|
|
|
67
68
|
|
|
68
69
|
|
|
69
70
|
function $70305dc5fb729c3b$var$Overlay(props, ref) {
|
|
70
|
-
let { children: children , isOpen: isOpen , container: container , onEnter: onEnter , onEntering: onEntering , onEntered: onEntered , onExit: onExit , onExiting: onExiting , onExited: onExited , nodeRef: nodeRef } = props;
|
|
71
|
+
let { children: children , isOpen: isOpen , disableFocusManagement: disableFocusManagement , container: container , onEnter: onEnter , onEntering: onEntering , onEntered: onEntered , onExit: onExit , onExiting: onExiting , onExited: onExited , nodeRef: nodeRef } = props;
|
|
71
72
|
let [exited, setExited] = (0, $fQOb3$useState)(!isOpen);
|
|
72
73
|
let handleEntered = (0, $fQOb3$useCallback)(()=>{
|
|
73
74
|
setExited(false);
|
|
@@ -86,7 +87,9 @@ function $70305dc5fb729c3b$var$Overlay(props, ref) {
|
|
|
86
87
|
if (!mountOverlay) // Don't bother showing anything if we don't have to.
|
|
87
88
|
return null;
|
|
88
89
|
return /*#__PURE__*/ (0, $fQOb3$react).createElement((0, $fQOb3$Overlay), {
|
|
89
|
-
portalContainer: container
|
|
90
|
+
portalContainer: container,
|
|
91
|
+
disableFocusManagement: disableFocusManagement,
|
|
92
|
+
isExiting: !isOpen
|
|
90
93
|
}, /*#__PURE__*/ (0, $fQOb3$react).createElement((0, $fQOb3$Provider), {
|
|
91
94
|
ref: ref,
|
|
92
95
|
UNSAFE_style: {
|
|
@@ -122,6 +125,8 @@ let $70305dc5fb729c3b$export$c6fdb837b070b4ff = /*#__PURE__*/ (0, $fQOb3$react).
|
|
|
122
125
|
*/
|
|
123
126
|
|
|
124
127
|
|
|
128
|
+
|
|
129
|
+
|
|
125
130
|
var $853e19557ad8790f$exports = {};
|
|
126
131
|
|
|
127
132
|
$parcel$export($853e19557ad8790f$exports, "spectrum-Popover", () => $853e19557ad8790f$export$a62dc1b6ab23a7bb, (v) => $853e19557ad8790f$export$a62dc1b6ab23a7bb = v);
|
|
@@ -162,30 +167,30 @@ $parcel$export($645594d913f34a2a$exports, "spectrum-Popover--bottom", () => $645
|
|
|
162
167
|
$parcel$export($645594d913f34a2a$exports, "spectrum-Popover--top", () => $645594d913f34a2a$export$f30becfb1df0cae4, (v) => $645594d913f34a2a$export$f30becfb1df0cae4 = v);
|
|
163
168
|
$parcel$export($645594d913f34a2a$exports, "spectrum-Popover--right", () => $645594d913f34a2a$export$5fc8b429396c9f58, (v) => $645594d913f34a2a$export$5fc8b429396c9f58 = v);
|
|
164
169
|
$parcel$export($645594d913f34a2a$exports, "spectrum-Popover--left", () => $645594d913f34a2a$export$79cc55906ac5b00, (v) => $645594d913f34a2a$export$79cc55906ac5b00 = v);
|
|
170
|
+
$parcel$export($645594d913f34a2a$exports, "spectrum-Popover--withTip", () => $645594d913f34a2a$export$d8b16c5377728262, (v) => $645594d913f34a2a$export$d8b16c5377728262 = v);
|
|
165
171
|
$parcel$export($645594d913f34a2a$exports, "spectrum-Popover-tip", () => $645594d913f34a2a$export$3100ec4dc1668df1, (v) => $645594d913f34a2a$export$3100ec4dc1668df1 = v);
|
|
166
172
|
$parcel$export($645594d913f34a2a$exports, "spectrum-Popover-tip-triangle", () => $645594d913f34a2a$export$ed733fa6cf19ab80, (v) => $645594d913f34a2a$export$ed733fa6cf19ab80 = v);
|
|
167
173
|
$parcel$export($645594d913f34a2a$exports, "spectrum-Popover--dialog", () => $645594d913f34a2a$export$cf634262e726cd19, (v) => $645594d913f34a2a$export$cf634262e726cd19 = v);
|
|
168
|
-
$parcel$export($645594d913f34a2a$exports, "spectrum-Popover--withTip", () => $645594d913f34a2a$export$d8b16c5377728262, (v) => $645594d913f34a2a$export$d8b16c5377728262 = v);
|
|
169
174
|
var $645594d913f34a2a$export$a62dc1b6ab23a7bb;
|
|
170
175
|
var $645594d913f34a2a$export$a9781837241c946d;
|
|
171
176
|
var $645594d913f34a2a$export$6a19b19b14780d4a;
|
|
172
177
|
var $645594d913f34a2a$export$f30becfb1df0cae4;
|
|
173
178
|
var $645594d913f34a2a$export$5fc8b429396c9f58;
|
|
174
179
|
var $645594d913f34a2a$export$79cc55906ac5b00;
|
|
180
|
+
var $645594d913f34a2a$export$d8b16c5377728262;
|
|
175
181
|
var $645594d913f34a2a$export$3100ec4dc1668df1;
|
|
176
182
|
var $645594d913f34a2a$export$ed733fa6cf19ab80;
|
|
177
183
|
var $645594d913f34a2a$export$cf634262e726cd19;
|
|
178
|
-
var $645594d913f34a2a$export$d8b16c5377728262;
|
|
179
184
|
$645594d913f34a2a$export$a62dc1b6ab23a7bb = "spectrum-Popover_6115b8";
|
|
180
185
|
$645594d913f34a2a$export$a9781837241c946d = "is-open_6115b8";
|
|
181
186
|
$645594d913f34a2a$export$6a19b19b14780d4a = "spectrum-Popover--bottom_6115b8";
|
|
182
187
|
$645594d913f34a2a$export$f30becfb1df0cae4 = "spectrum-Popover--top_6115b8";
|
|
183
188
|
$645594d913f34a2a$export$5fc8b429396c9f58 = "spectrum-Popover--right_6115b8";
|
|
184
189
|
$645594d913f34a2a$export$79cc55906ac5b00 = "spectrum-Popover--left_6115b8";
|
|
190
|
+
$645594d913f34a2a$export$d8b16c5377728262 = "spectrum-Popover--withTip_6115b8";
|
|
185
191
|
$645594d913f34a2a$export$3100ec4dc1668df1 = "spectrum-Popover-tip_6115b8";
|
|
186
192
|
$645594d913f34a2a$export$ed733fa6cf19ab80 = "spectrum-Popover-tip-triangle_6115b8";
|
|
187
193
|
$645594d913f34a2a$export$cf634262e726cd19 = "spectrum-Popover--dialog_6115b8";
|
|
188
|
-
$645594d913f34a2a$export$d8b16c5377728262 = "spectrum-Popover--withTip_6115b8";
|
|
189
194
|
|
|
190
195
|
|
|
191
196
|
/*
|
|
@@ -223,7 +228,6 @@ function $76a452f4e3df11be$export$f360afc887607b02({ isOpen: isOpen , isTranspar
|
|
|
223
228
|
}
|
|
224
229
|
|
|
225
230
|
|
|
226
|
-
|
|
227
231
|
/**
|
|
228
232
|
* Arrow placement can be done pointing right or down because those paths start at 0, x or y. Because the
|
|
229
233
|
* other two don't, they start at a fractional pixel value, it introduces rounding differences between browsers and
|
|
@@ -251,7 +255,7 @@ function $17b503f7de08fecc$var$Popover(props, ref) {
|
|
|
251
255
|
}, children));
|
|
252
256
|
}
|
|
253
257
|
const $17b503f7de08fecc$var$PopoverWrapper = /*#__PURE__*/ (0, $fQOb3$forwardRef)((props, ref)=>{
|
|
254
|
-
let { children: children , isOpen: isOpen , hideArrow: hideArrow , isNonModal: isNonModal , state: state , wrapperRef: wrapperRef } = props;
|
|
258
|
+
let { children: children , isOpen: isOpen , hideArrow: hideArrow , isNonModal: isNonModal , enableBothDismissButtons: enableBothDismissButtons , state: state , wrapperRef: wrapperRef } = props;
|
|
255
259
|
let { styleProps: styleProps } = (0, $fQOb3$useStyleProps)(props);
|
|
256
260
|
let { size: size , borderWidth: borderWidth , arrowRef: arrowRef } = $17b503f7de08fecc$var$useArrowSize();
|
|
257
261
|
const borderRadius = $17b503f7de08fecc$var$usePopoverBorderRadius(ref);
|
|
@@ -265,6 +269,7 @@ const $17b503f7de08fecc$var$PopoverWrapper = /*#__PURE__*/ (0, $fQOb3$forwardRef
|
|
|
265
269
|
arrowSize: hideArrow ? 0 : secondary,
|
|
266
270
|
arrowBoundaryOffset: borderRadius
|
|
267
271
|
}, state);
|
|
272
|
+
let { focusWithinProps: focusWithinProps } = (0, $fQOb3$useFocusWithin)(props);
|
|
268
273
|
// Attach Transition's nodeRef to outermost wrapper for node.reflow: https://github.com/reactjs/react-transition-group/blob/c89f807067b32eea6f68fd6c622190d88ced82e2/src/Transition.js#L231
|
|
269
274
|
return /*#__PURE__*/ (0, $fQOb3$react).createElement("div", {
|
|
270
275
|
ref: wrapperRef
|
|
@@ -274,7 +279,7 @@ const $17b503f7de08fecc$var$PopoverWrapper = /*#__PURE__*/ (0, $fQOb3$forwardRef
|
|
|
274
279
|
isOpen: isOpen
|
|
275
280
|
}), /*#__PURE__*/ (0, $fQOb3$react).createElement("div", {
|
|
276
281
|
...styleProps,
|
|
277
|
-
...popoverProps,
|
|
282
|
+
...(0, $fQOb3$mergeProps)(popoverProps, focusWithinProps),
|
|
278
283
|
style: {
|
|
279
284
|
...styleProps.style,
|
|
280
285
|
...popoverProps.style
|
|
@@ -286,7 +291,7 @@ const $17b503f7de08fecc$var$PopoverWrapper = /*#__PURE__*/ (0, $fQOb3$forwardRef
|
|
|
286
291
|
}, (0, $fQOb3$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($853e19557ad8790f$exports))), "spectrum-Popover", "react-spectrum-Popover"), styleProps.className),
|
|
287
292
|
role: "presentation",
|
|
288
293
|
"data-testid": "popover"
|
|
289
|
-
}, !isNonModal && /*#__PURE__*/ (0, $fQOb3$react).createElement((0, $fQOb3$DismissButton), {
|
|
294
|
+
}, (!isNonModal || enableBothDismissButtons) && /*#__PURE__*/ (0, $fQOb3$react).createElement((0, $fQOb3$DismissButton), {
|
|
290
295
|
onDismiss: state.close
|
|
291
296
|
}), children, hideArrow ? null : /*#__PURE__*/ (0, $fQOb3$react).createElement($17b503f7de08fecc$var$Arrow, {
|
|
292
297
|
arrowProps: arrowProps,
|
package/dist/main.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.spectrum-Popover_38efea.react-spectrum-Popover_38efea{visibility:visible}.spectrum-Popover_38efea .spectrum-Dialog-content_38efea{max-height:initial}.spectrum-Modal-wrapper_38efea.react-spectrum-Modal-wrapper_38efea,.spectrum-Modal_38efea.react-spectrum-Modal_38efea,.spectrum-Tray_38efea.react-spectrum-Tray_38efea{visibility:visible}:root{font-synthesis:weight}.spectrum-Tray_23bf66{visibility:hidden;opacity:0;transition:transform var(--spectrum-global-animation-duration-100,.13s)ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s)ease-in-out,visibility 0s linear var(--spectrum-global-animation-duration-100,.13s);pointer-events:none}.spectrum-Tray_23bf66.is-open_23bf66{visibility:visible;opacity:.9999;pointer-events:auto;transition-delay:0s}[dir=ltr] .spectrum-Tray-wrapper_23bf66{left:0}[dir=rtl] .spectrum-Tray-wrapper_23bf66{right:0}.spectrum-Tray-wrapper_23bf66{width:100%;height:100vh;pointer-events:none;z-index:2;justify-content:center;display:flex;position:fixed;top:0}.spectrum-Tray_23bf66{--spectrum-tray-margin-top:64px;--spectrum-tray-max-width:450px;width:var(--spectrum-tray-width,100%);max-width:var(--spectrum-tray-max-width,375px);min-height:var(--spectrum-tray-min-height,var(--spectrum-global-dimension-static-size-800));max-height:calc(var(--spectrum-visual-viewport-height) - var(--spectrum-tray-margin-top));padding-bottom:max(calc(100vh - var(--spectrum-visual-viewport-height)),env(safe-area-inset-bottom));border-radius:var(--spectrum-tray-full-width-border-radius,var(--spectrum-alias-border-radius-regular))var(--spectrum-tray-full-width-border-radius,var(--spectrum-alias-border-radius-regular))var(--spectrum-tray-border-radius,0px)var(--spectrum-tray-border-radius,0px);transition:opacity var(--spectrum-dialog-exit-animation-duration,var(--spectrum-global-animation-duration-100))cubic-bezier(.5,0,1,1)0s,transform var(--spectrum-dialog-exit-animation-duration,var(--spectrum-global-animation-duration-100))cubic-bezier(.5,0,1,1)0s;outline:none;flex-direction:column;display:flex;position:absolute;bottom:0;transform:translateY(100%)}.spectrum-Tray_23bf66.is-open_23bf66{transition:transform var(--spectrum-dialog-entry-animation-duration,var(--spectrum-global-animation-duration-500))cubic-bezier(0,0,.4,1)var(--spectrum-dialog-entry-animation-delay,var(--spectrum-global-animation-duration-200)),opacity var(--spectrum-dialog-entry-animation-duration,var(--spectrum-global-animation-duration-500))cubic-bezier(0,0,.4,1)var(--spectrum-dialog-entry-animation-delay,var(--spectrum-global-animation-duration-200));transform:translateY(0)}.spectrum-Tray--fixedHeight_23bf66{height:calc(var(--spectrum-visual-viewport-height) - var(--spectrum-tray-margin-top));top:var(--spectrum-tray-margin-top)}@media (max-width:450px){.spectrum-Tray_23bf66{border-radius:var(--spectrum-tray-border-radius,0px)}}.spectrum-Tray_23bf66{background-color:var(--spectrum-tray-background-color)}:root{font-synthesis:weight}.spectrum-Modal_f81956{visibility:hidden;opacity:0;transition:transform var(--spectrum-global-animation-duration-100,.13s)ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s)ease-in-out,visibility 0s linear var(--spectrum-global-animation-duration-100,.13s);pointer-events:none}.spectrum-Modal_f81956.is-open_f81956{visibility:visible;opacity:.9999;pointer-events:auto;transition-delay:0s}.spectrum-Modal-wrapper_f81956{box-sizing:border-box;width:100vw;height:var(--spectrum-visual-viewport-height);visibility:hidden;pointer-events:none;z-index:2;transition:visibility 0s linear var(--spectrum-global-animation-duration-100,.13s);justify-content:center;align-items:center;display:flex;position:fixed;top:0;left:0}.spectrum-Modal-wrapper_f81956.is-open_f81956{visibility:visible}.spectrum-Modal_f81956{transform:translateY(var(--spectrum-dialog-entry-animation-distance,var(--spectrum-global-dimension-size-250)));z-index:2;max-height:calc(var(--spectrum-visual-viewport-height)*.9);max-width:90vw;min-width:var(--spectrum-dialog-min-width,var(--spectrum-global-dimension-static-size-3600));border-radius:var(--spectrum-dialog-border-radius,var(--spectrum-global-dimension-size-50));pointer-events:auto;transition:opacity var(--spectrum-dialog-exit-animation-duration,var(--spectrum-global-animation-duration-100))cubic-bezier(.5,0,1,1)0s,visibility 0s linear calc(0s + var(--spectrum-dialog-exit-animation-duration,var(--spectrum-global-animation-duration-100))),transform 0s linear calc(0s + var(--spectrum-dialog-exit-animation-duration,var(--spectrum-global-animation-duration-100)));outline:none}.spectrum-Modal_f81956.is-open_f81956{transition:transform var(--spectrum-dialog-entry-animation-duration,var(--spectrum-global-animation-duration-500))cubic-bezier(0,0,.4,1)var(--spectrum-dialog-entry-animation-delay,var(--spectrum-global-animation-duration-200)),opacity var(--spectrum-dialog-entry-animation-duration,var(--spectrum-global-animation-duration-500))cubic-bezier(0,0,.4,1)var(--spectrum-dialog-entry-animation-delay,var(--spectrum-global-animation-duration-200));transform:translateY(0)}@media only screen and (max-device-width:400px),only screen and (max-device-height:350px){.spectrum-Modal--responsive_f81956{width:100%;height:100%;max-width:100%;max-height:100%;border-radius:0}.spectrum-Modal-wrapper_f81956 .spectrum-Modal--responsive_f81956{margin-top:0}}.spectrum-Modal--fullscreen_f81956{max-width:none;max-height:none;width:calc(100% - 80px);height:calc(100% - 80px);position:fixed;top:40px;bottom:40px;left:40px;right:40px}.spectrum-Modal--fullscreenTakeover_f81956{max-width:none;max-height:none;box-sizing:border-box;border:none;border-radius:0;position:fixed;top:0;bottom:0;left:0;right:0}.spectrum-Modal--fullscreenTakeover_f81956,.spectrum-Modal--fullscreenTakeover_f81956.is-open_f81956{transform:none}.spectrum-Modal_f81956{background:var(--spectrum-dialog-background-color,var(--spectrum-alias-background-color-default))}:root{font-synthesis:weight}.spectrum-Underlay_eb7615{visibility:hidden;opacity:0;transition:transform var(--spectrum-global-animation-duration-100,.13s)ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s)ease-in-out,visibility 0s linear var(--spectrum-global-animation-duration-100,.13s);pointer-events:none}.spectrum-Underlay_eb7615.is-open_eb7615{visibility:visible;opacity:.9999;pointer-events:auto;transition-delay:0s}.spectrum-Underlay_eb7615{z-index:1;transition:opacity var(--spectrum-dialog-background-exit-animation-duration,var(--spectrum-global-animation-duration-300))cubic-bezier(.5,0,1,1)var(--spectrum-dialog-background-exit-animation-delay,var(--spectrum-global-animation-duration-200)),visibility 0s linear calc(var(--spectrum-dialog-background-exit-animation-delay,var(--spectrum-global-animation-duration-200)) + var(--spectrum-dialog-background-exit-animation-duration,var(--spectrum-global-animation-duration-300)));position:fixed;top:0;bottom:0;left:0;right:0;overflow:hidden}.spectrum-Underlay_eb7615.spectrum-Underlay--transparent_eb7615{background:0 0;transition:none}.spectrum-Underlay_eb7615.is-open_eb7615{transition:opacity var(--spectrum-dialog-background-entry-animation-duration,var(--spectrum-global-animation-duration-600))cubic-bezier(0,0,.4,1)0s}.spectrum-Underlay_eb7615{background:var(--spectrum-dialog-underlay-background-color,var(--spectrum-alias-background-color-modal-overlay))}:root{font-synthesis:weight}.spectrum-Popover_6115b8{visibility:hidden;opacity:0;transition:transform var(--spectrum-global-animation-duration-100,.13s)ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s)ease-in-out,visibility 0s linear var(--spectrum-global-animation-duration-100,.13s);pointer-events:none}.spectrum-Popover_6115b8.is-open_6115b8{visibility:visible;opacity:.9999;pointer-events:auto;transition-delay:0s}.spectrum-Popover--bottom_6115b8.is-open_6115b8{transform:translateY(var(--spectrum-overlay-positive-transform-distance))}.spectrum-Popover--top_6115b8.is-open_6115b8{transform:translateY(var(--spectrum-overlay-negative-transform-distance))}.spectrum-Popover--right_6115b8.is-open_6115b8{transform:translateX(var(--spectrum-overlay-positive-transform-distance))}.spectrum-Popover--left_6115b8.is-open_6115b8{transform:translateX(var(--spectrum-overlay-negative-transform-distance))}.spectrum-Popover_6115b8{box-sizing:border-box;min-width:var(--spectrum-global-dimension-size-400);min-height:var(--spectrum-global-dimension-size-400);border-style:solid;border-width:var(--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin));border-radius:var(--spectrum-popover-border-radius,var(--spectrum-alias-border-radius-regular));outline:none;flex-direction:column;display:inline-flex;position:absolute}.spectrum-Popover-tip_6115b8{--spectrum-popover-tip-size:var(--spectrum-popover-tip-width,var(--spectrum-global-dimension-size-250));--spectrum-popover-tip-borderWidth:var(--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin));position:absolute;-webkit-transform:translate(0)}.spectrum-Popover-tip_6115b8 .spectrum-Popover-tip-triangle_6115b8{stroke-linecap:square;stroke-linejoin:miter;stroke-width:var(--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin))}.spectrum-Popover--dialog_6115b8{min-width:270px;padding:30px 29px}.spectrum-Popover--left_6115b8.spectrum-Popover--withTip_6115b8{margin-right:13px}.spectrum-Popover--left_6115b8 .spectrum-Popover-tip_6115b8{left:100%}.spectrum-Popover--right_6115b8.spectrum-Popover--withTip_6115b8{margin-left:13px}.spectrum-Popover--right_6115b8 .spectrum-Popover-tip_6115b8{right:100%;transform:scaleX(-1)}.spectrum-Popover--left_6115b8 .spectrum-Popover-tip_6115b8,.spectrum-Popover--right_6115b8 .spectrum-Popover-tip_6115b8{margin-top:calc(var(--spectrum-global-dimension-size-150)*-1);top:50%}.spectrum-Popover--bottom_6115b8.spectrum-Popover--withTip_6115b8{margin-top:13px}.spectrum-Popover--bottom_6115b8 .spectrum-Popover-tip_6115b8{bottom:100%;transform:scaleY(-1)}.spectrum-Popover--top_6115b8.spectrum-Popover--withTip_6115b8{margin-bottom:13px}.spectrum-Popover--top_6115b8 .spectrum-Popover-tip_6115b8{top:100%}.spectrum-Popover--bottom_6115b8 .spectrum-Popover-tip_6115b8,.spectrum-Popover--top_6115b8 .spectrum-Popover-tip_6115b8{margin-left:calc(var(--spectrum-global-dimension-size-150)*-1);left:50%}.spectrum-Popover_6115b8{background-color:var(--spectrum-popover-background-color,var(--spectrum-global-color-gray-50));border-color:var(--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark));filter:drop-shadow(0 var(--spectrum-popover-shadow-offset-y,var(--spectrum-alias-dropshadow-offset-y))var(--spectrum-popover-shadow-blur,var(--spectrum-alias-dropshadow-blur))var(--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)));-webkit-filter:drop-shadow(0 var(--spectrum-popover-shadow-offset-y,var(--spectrum-alias-dropshadow-offset-y))var(--spectrum-popover-shadow-blur,var(--spectrum-alias-dropshadow-blur))var(--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)));will-change:filter;clip-path:inset(-30px)}.spectrum-Popover_6115b8 .spectrum-Popover-tip_6115b8 .spectrum-Popover-tip-triangle_6115b8{fill:var(--spectrum-popover-background-color,var(--spectrum-global-color-gray-50));stroke:var(--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark))}
|
|
1
|
+
.spectrum-Popover_38efea.react-spectrum-Popover_38efea{visibility:visible}.spectrum-Popover_38efea .spectrum-Dialog-content_38efea{max-height:initial}.spectrum-Modal-wrapper_38efea.react-spectrum-Modal-wrapper_38efea,.spectrum-Modal_38efea.react-spectrum-Modal_38efea,.spectrum-Tray_38efea.react-spectrum-Tray_38efea{visibility:visible}:root{font-synthesis:weight}.spectrum-Popover_6115b8{visibility:hidden;opacity:0;transition:transform var(--spectrum-global-animation-duration-100,.13s)ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s)ease-in-out,visibility 0s linear var(--spectrum-global-animation-duration-100,.13s);pointer-events:none}.spectrum-Popover_6115b8.is-open_6115b8{visibility:visible;opacity:.9999;pointer-events:auto;transition-delay:0s}.spectrum-Popover--bottom_6115b8.is-open_6115b8{transform:translateY(var(--spectrum-overlay-positive-transform-distance))}.spectrum-Popover--top_6115b8.is-open_6115b8{transform:translateY(var(--spectrum-overlay-negative-transform-distance))}.spectrum-Popover--right_6115b8.is-open_6115b8{transform:translateX(var(--spectrum-overlay-positive-transform-distance))}.spectrum-Popover--left_6115b8.is-open_6115b8{transform:translateX(var(--spectrum-overlay-negative-transform-distance))}.spectrum-Popover_6115b8{box-sizing:border-box;min-width:var(--spectrum-global-dimension-size-400);min-height:var(--spectrum-global-dimension-size-400);border-style:solid;border-width:var(--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin));border-radius:var(--spectrum-popover-border-radius,var(--spectrum-alias-border-radius-regular));outline:none;flex-direction:column;display:inline-flex;position:absolute;overflow:hidden}.spectrum-Popover--withTip_6115b8{overflow:visible}.spectrum-Popover-tip_6115b8{--spectrum-popover-tip-size:var(--spectrum-popover-tip-width,var(--spectrum-global-dimension-size-250));--spectrum-popover-tip-borderWidth:var(--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin));position:absolute;-webkit-transform:translate(0)}.spectrum-Popover-tip_6115b8 .spectrum-Popover-tip-triangle_6115b8{stroke-linecap:square;stroke-linejoin:miter;stroke-width:var(--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin))}.spectrum-Popover--dialog_6115b8{min-width:270px;padding:30px 29px}.spectrum-Popover--left_6115b8.spectrum-Popover--withTip_6115b8{margin-right:13px}.spectrum-Popover--left_6115b8 .spectrum-Popover-tip_6115b8{left:100%}.spectrum-Popover--right_6115b8.spectrum-Popover--withTip_6115b8{margin-left:13px}.spectrum-Popover--right_6115b8 .spectrum-Popover-tip_6115b8{right:100%;transform:scaleX(-1)}.spectrum-Popover--left_6115b8 .spectrum-Popover-tip_6115b8,.spectrum-Popover--right_6115b8 .spectrum-Popover-tip_6115b8{margin-top:calc(var(--spectrum-global-dimension-size-150)*-1);top:50%}.spectrum-Popover--bottom_6115b8.spectrum-Popover--withTip_6115b8{margin-top:13px}.spectrum-Popover--bottom_6115b8 .spectrum-Popover-tip_6115b8{bottom:100%;transform:scaleY(-1)}.spectrum-Popover--top_6115b8.spectrum-Popover--withTip_6115b8{margin-bottom:13px}.spectrum-Popover--top_6115b8 .spectrum-Popover-tip_6115b8{top:100%}.spectrum-Popover--bottom_6115b8 .spectrum-Popover-tip_6115b8,.spectrum-Popover--top_6115b8 .spectrum-Popover-tip_6115b8{margin-left:calc(var(--spectrum-global-dimension-size-150)*-1);left:50%}.spectrum-Popover_6115b8{background-color:var(--spectrum-popover-background-color,var(--spectrum-global-color-gray-50));border-color:var(--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark));filter:drop-shadow(0 var(--spectrum-popover-shadow-offset-y,var(--spectrum-alias-dropshadow-offset-y))var(--spectrum-popover-shadow-blur,var(--spectrum-alias-dropshadow-blur))var(--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)));-webkit-filter:drop-shadow(0 var(--spectrum-popover-shadow-offset-y,var(--spectrum-alias-dropshadow-offset-y))var(--spectrum-popover-shadow-blur,var(--spectrum-alias-dropshadow-blur))var(--spectrum-popover-shadow-color,var(--spectrum-alias-dropshadow-color)));will-change:filter;clip-path:inset(-30px)}.spectrum-Popover_6115b8 .spectrum-Popover-tip_6115b8 .spectrum-Popover-tip-triangle_6115b8{fill:var(--spectrum-popover-background-color,var(--spectrum-global-color-gray-50));stroke:var(--spectrum-popover-border-color,var(--spectrum-alias-border-color-dark))}@media (forced-colors:active){.spectrum-Popover_6115b8{--spectrum-popover-background-color:Canvas;--spectrum-popover-border-color:CanvasText}}:root{font-synthesis:weight}.spectrum-Underlay_eb7615{visibility:hidden;opacity:0;transition:transform var(--spectrum-global-animation-duration-100,.13s)ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s)ease-in-out,visibility 0s linear var(--spectrum-global-animation-duration-100,.13s);pointer-events:none}.spectrum-Underlay_eb7615.is-open_eb7615{visibility:visible;opacity:.9999;pointer-events:auto;transition-delay:0s}.spectrum-Underlay_eb7615{z-index:1;transition:opacity var(--spectrum-dialog-background-exit-animation-duration,var(--spectrum-global-animation-duration-300))cubic-bezier(.5,0,1,1)var(--spectrum-dialog-background-exit-animation-delay,var(--spectrum-global-animation-duration-200)),visibility 0s linear calc(var(--spectrum-dialog-background-exit-animation-delay,var(--spectrum-global-animation-duration-200)) + var(--spectrum-dialog-background-exit-animation-duration,var(--spectrum-global-animation-duration-300)));position:fixed;top:0;bottom:0;left:0;right:0;overflow:hidden}.spectrum-Underlay_eb7615.spectrum-Underlay--transparent_eb7615{background:0 0;transition:none}.spectrum-Underlay_eb7615.is-open_eb7615{transition:opacity var(--spectrum-dialog-background-entry-animation-duration,var(--spectrum-global-animation-duration-600))cubic-bezier(0,0,.4,1)0s}.spectrum-Underlay_eb7615{background:var(--spectrum-dialog-underlay-background-color,var(--spectrum-alias-background-color-modal-overlay))}:root{font-synthesis:weight}.spectrum-Modal_f81956{visibility:hidden;opacity:0;transition:transform var(--spectrum-global-animation-duration-100,.13s)ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s)ease-in-out,visibility 0s linear var(--spectrum-global-animation-duration-100,.13s);pointer-events:none}.spectrum-Modal_f81956.is-open_f81956{visibility:visible;opacity:.9999;pointer-events:auto;transition-delay:0s}.spectrum-Modal-wrapper_f81956{box-sizing:border-box;width:100vw;height:var(--spectrum-visual-viewport-height);visibility:hidden;pointer-events:none;z-index:2;transition:visibility 0s linear var(--spectrum-global-animation-duration-100,.13s);justify-content:center;align-items:center;display:flex;position:fixed;top:0;left:0}.spectrum-Modal-wrapper_f81956.is-open_f81956{visibility:visible}.spectrum-Modal_f81956{transform:translateY(var(--spectrum-dialog-entry-animation-distance,var(--spectrum-global-dimension-size-250)));z-index:2;max-height:calc(var(--spectrum-visual-viewport-height)*.9);max-width:90vw;min-width:var(--spectrum-dialog-min-width,var(--spectrum-global-dimension-static-size-3600));border-radius:var(--spectrum-dialog-border-radius,var(--spectrum-global-dimension-size-50));border-width:var(--spectrum-popover-border-size,var(--spectrum-alias-border-size-thin));pointer-events:auto;transition:opacity var(--spectrum-dialog-exit-animation-duration,var(--spectrum-global-animation-duration-100))cubic-bezier(.5,0,1,1)0s,visibility 0s linear calc(0s + var(--spectrum-dialog-exit-animation-duration,var(--spectrum-global-animation-duration-100))),transform 0s linear calc(0s + var(--spectrum-dialog-exit-animation-duration,var(--spectrum-global-animation-duration-100)));outline:none}.spectrum-Modal_f81956.is-open_f81956{transition:transform var(--spectrum-dialog-entry-animation-duration,var(--spectrum-global-animation-duration-500))cubic-bezier(0,0,.4,1)var(--spectrum-dialog-entry-animation-delay,var(--spectrum-global-animation-duration-200)),opacity var(--spectrum-dialog-entry-animation-duration,var(--spectrum-global-animation-duration-500))cubic-bezier(0,0,.4,1)var(--spectrum-dialog-entry-animation-delay,var(--spectrum-global-animation-duration-200));transform:translateY(0)}@media only screen and (max-device-width:400px),only screen and (max-device-height:350px){.spectrum-Modal--responsive_f81956{width:100%;height:100%;max-width:100%;max-height:100%;border-radius:0}.spectrum-Modal-wrapper_f81956 .spectrum-Modal--responsive_f81956{margin-top:0}}.spectrum-Modal--fullscreen_f81956{max-width:none;max-height:none;width:calc(100% - 80px);height:calc(100% - 80px);position:fixed;top:40px;bottom:40px;left:40px;right:40px}.spectrum-Modal--fullscreenTakeover_f81956{max-width:none;max-height:none;box-sizing:border-box;border:none;border-radius:0;position:fixed;top:0;bottom:0;left:0;right:0}.spectrum-Modal--fullscreenTakeover_f81956,.spectrum-Modal--fullscreenTakeover_f81956.is-open_f81956{transform:none}@media (forced-colors:active){.spectrum-Modal_f81956:not(.spectrum-Modal--fullscreenTakeover_f81956){border-style:solid}}.spectrum-Modal_f81956{background:var(--spectrum-dialog-background-color,var(--spectrum-alias-background-color-default));border-color:var(--spectrum-alias-border-color-transparent,transparent)}:root{font-synthesis:weight}.spectrum-Tray_23bf66{visibility:hidden;opacity:0;transition:transform var(--spectrum-global-animation-duration-100,.13s)ease-in-out,opacity var(--spectrum-global-animation-duration-100,.13s)ease-in-out,visibility 0s linear var(--spectrum-global-animation-duration-100,.13s);pointer-events:none}.spectrum-Tray_23bf66.is-open_23bf66{visibility:visible;opacity:.9999;pointer-events:auto;transition-delay:0s}[dir=ltr] .spectrum-Tray-wrapper_23bf66{left:0}[dir=rtl] .spectrum-Tray-wrapper_23bf66{right:0}.spectrum-Tray-wrapper_23bf66{width:100%;height:100vh;pointer-events:none;z-index:2;justify-content:center;display:flex;position:fixed;top:0}.spectrum-Tray_23bf66{--spectrum-tray-margin-top:64px;--spectrum-tray-max-width:450px;width:var(--spectrum-tray-width,100%);max-width:var(--spectrum-tray-max-width,375px);min-height:var(--spectrum-tray-min-height,var(--spectrum-global-dimension-static-size-800));max-height:calc(var(--spectrum-visual-viewport-height) - var(--spectrum-tray-margin-top));padding-bottom:max(calc(100vh - var(--spectrum-visual-viewport-height)),env(safe-area-inset-bottom));border-radius:var(--spectrum-tray-full-width-border-radius,var(--spectrum-alias-border-radius-regular))var(--spectrum-tray-full-width-border-radius,var(--spectrum-alias-border-radius-regular))var(--spectrum-tray-border-radius,0px)var(--spectrum-tray-border-radius,0px);transition:opacity var(--spectrum-dialog-exit-animation-duration,var(--spectrum-global-animation-duration-100))cubic-bezier(.5,0,1,1)0s,transform var(--spectrum-dialog-exit-animation-duration,var(--spectrum-global-animation-duration-100))cubic-bezier(.5,0,1,1)0s;outline:none;flex-direction:column;display:flex;position:absolute;bottom:0;overflow-x:hidden;overflow-y:auto;transform:translateY(100%)}.spectrum-Tray_23bf66.is-open_23bf66{transition:transform var(--spectrum-dialog-entry-animation-duration,var(--spectrum-global-animation-duration-500))cubic-bezier(0,0,.4,1)var(--spectrum-dialog-entry-animation-delay,var(--spectrum-global-animation-duration-200)),opacity var(--spectrum-dialog-entry-animation-duration,var(--spectrum-global-animation-duration-500))cubic-bezier(0,0,.4,1)var(--spectrum-dialog-entry-animation-delay,var(--spectrum-global-animation-duration-200));transform:translateY(0)}.spectrum-Tray--fixedHeight_23bf66{height:calc(var(--spectrum-visual-viewport-height) - var(--spectrum-tray-margin-top));top:var(--spectrum-tray-margin-top)}@media (max-width:450px){.spectrum-Tray_23bf66{border-radius:var(--spectrum-tray-border-radius,0px)}}@media (forced-colors:active){.spectrum-Tray_23bf66{border-width:var(--spectrum-alias-border-size-thin,var(--spectrum-global-dimension-static-size-10));border-style:solid solid none}}.spectrum-Tray_23bf66{background-color:var(--spectrum-tray-background-color)}
|
package/dist/main.js
CHANGED
|
@@ -4,6 +4,7 @@ var $eLPAa$react = require("react");
|
|
|
4
4
|
var $eLPAa$reactariaoverlays = require("@react-aria/overlays");
|
|
5
5
|
var $eLPAa$reacttransitiongroup = require("react-transition-group");
|
|
6
6
|
var $eLPAa$reactspectrumutils = require("@react-spectrum/utils");
|
|
7
|
+
var $eLPAa$reactariainteractions = require("@react-aria/interactions");
|
|
7
8
|
var $eLPAa$reactariautils = require("@react-aria/utils");
|
|
8
9
|
|
|
9
10
|
function $parcel$export(e, n, v, s) {
|
|
@@ -73,7 +74,7 @@ function $13f51cdc44d228b9$export$b847a40ee92eff38(props) {
|
|
|
73
74
|
|
|
74
75
|
|
|
75
76
|
function $2aebdc186fd41e87$var$Overlay(props, ref) {
|
|
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 { children: children , isOpen: isOpen , disableFocusManagement: disableFocusManagement , container: container , onEnter: onEnter , onEntering: onEntering , onEntered: onEntered , onExit: onExit , onExiting: onExiting , onExited: onExited , nodeRef: nodeRef } = props;
|
|
77
78
|
let [exited, setExited] = (0, $eLPAa$react.useState)(!isOpen);
|
|
78
79
|
let handleEntered = (0, $eLPAa$react.useCallback)(()=>{
|
|
79
80
|
setExited(false);
|
|
@@ -92,7 +93,9 @@ function $2aebdc186fd41e87$var$Overlay(props, ref) {
|
|
|
92
93
|
if (!mountOverlay) // Don't bother showing anything if we don't have to.
|
|
93
94
|
return null;
|
|
94
95
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement((0, $eLPAa$reactariaoverlays.Overlay), {
|
|
95
|
-
portalContainer: container
|
|
96
|
+
portalContainer: container,
|
|
97
|
+
disableFocusManagement: disableFocusManagement,
|
|
98
|
+
isExiting: !isOpen
|
|
96
99
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement((0, $eLPAa$reactspectrumprovider.Provider), {
|
|
97
100
|
ref: ref,
|
|
98
101
|
UNSAFE_style: {
|
|
@@ -128,6 +131,8 @@ let $2aebdc186fd41e87$export$c6fdb837b070b4ff = /*#__PURE__*/ (0, ($parcel$inter
|
|
|
128
131
|
*/
|
|
129
132
|
|
|
130
133
|
|
|
134
|
+
|
|
135
|
+
|
|
131
136
|
var $e9a663ccb19ed1b0$exports = {};
|
|
132
137
|
|
|
133
138
|
$parcel$export($e9a663ccb19ed1b0$exports, "spectrum-Popover", () => $e9a663ccb19ed1b0$export$a62dc1b6ab23a7bb, (v) => $e9a663ccb19ed1b0$export$a62dc1b6ab23a7bb = v);
|
|
@@ -168,30 +173,30 @@ $parcel$export($16e1dca4664d0b1c$exports, "spectrum-Popover--bottom", () => $16e
|
|
|
168
173
|
$parcel$export($16e1dca4664d0b1c$exports, "spectrum-Popover--top", () => $16e1dca4664d0b1c$export$f30becfb1df0cae4, (v) => $16e1dca4664d0b1c$export$f30becfb1df0cae4 = v);
|
|
169
174
|
$parcel$export($16e1dca4664d0b1c$exports, "spectrum-Popover--right", () => $16e1dca4664d0b1c$export$5fc8b429396c9f58, (v) => $16e1dca4664d0b1c$export$5fc8b429396c9f58 = v);
|
|
170
175
|
$parcel$export($16e1dca4664d0b1c$exports, "spectrum-Popover--left", () => $16e1dca4664d0b1c$export$79cc55906ac5b00, (v) => $16e1dca4664d0b1c$export$79cc55906ac5b00 = v);
|
|
176
|
+
$parcel$export($16e1dca4664d0b1c$exports, "spectrum-Popover--withTip", () => $16e1dca4664d0b1c$export$d8b16c5377728262, (v) => $16e1dca4664d0b1c$export$d8b16c5377728262 = v);
|
|
171
177
|
$parcel$export($16e1dca4664d0b1c$exports, "spectrum-Popover-tip", () => $16e1dca4664d0b1c$export$3100ec4dc1668df1, (v) => $16e1dca4664d0b1c$export$3100ec4dc1668df1 = v);
|
|
172
178
|
$parcel$export($16e1dca4664d0b1c$exports, "spectrum-Popover-tip-triangle", () => $16e1dca4664d0b1c$export$ed733fa6cf19ab80, (v) => $16e1dca4664d0b1c$export$ed733fa6cf19ab80 = v);
|
|
173
179
|
$parcel$export($16e1dca4664d0b1c$exports, "spectrum-Popover--dialog", () => $16e1dca4664d0b1c$export$cf634262e726cd19, (v) => $16e1dca4664d0b1c$export$cf634262e726cd19 = v);
|
|
174
|
-
$parcel$export($16e1dca4664d0b1c$exports, "spectrum-Popover--withTip", () => $16e1dca4664d0b1c$export$d8b16c5377728262, (v) => $16e1dca4664d0b1c$export$d8b16c5377728262 = v);
|
|
175
180
|
var $16e1dca4664d0b1c$export$a62dc1b6ab23a7bb;
|
|
176
181
|
var $16e1dca4664d0b1c$export$a9781837241c946d;
|
|
177
182
|
var $16e1dca4664d0b1c$export$6a19b19b14780d4a;
|
|
178
183
|
var $16e1dca4664d0b1c$export$f30becfb1df0cae4;
|
|
179
184
|
var $16e1dca4664d0b1c$export$5fc8b429396c9f58;
|
|
180
185
|
var $16e1dca4664d0b1c$export$79cc55906ac5b00;
|
|
186
|
+
var $16e1dca4664d0b1c$export$d8b16c5377728262;
|
|
181
187
|
var $16e1dca4664d0b1c$export$3100ec4dc1668df1;
|
|
182
188
|
var $16e1dca4664d0b1c$export$ed733fa6cf19ab80;
|
|
183
189
|
var $16e1dca4664d0b1c$export$cf634262e726cd19;
|
|
184
|
-
var $16e1dca4664d0b1c$export$d8b16c5377728262;
|
|
185
190
|
$16e1dca4664d0b1c$export$a62dc1b6ab23a7bb = "spectrum-Popover_6115b8";
|
|
186
191
|
$16e1dca4664d0b1c$export$a9781837241c946d = "is-open_6115b8";
|
|
187
192
|
$16e1dca4664d0b1c$export$6a19b19b14780d4a = "spectrum-Popover--bottom_6115b8";
|
|
188
193
|
$16e1dca4664d0b1c$export$f30becfb1df0cae4 = "spectrum-Popover--top_6115b8";
|
|
189
194
|
$16e1dca4664d0b1c$export$5fc8b429396c9f58 = "spectrum-Popover--right_6115b8";
|
|
190
195
|
$16e1dca4664d0b1c$export$79cc55906ac5b00 = "spectrum-Popover--left_6115b8";
|
|
196
|
+
$16e1dca4664d0b1c$export$d8b16c5377728262 = "spectrum-Popover--withTip_6115b8";
|
|
191
197
|
$16e1dca4664d0b1c$export$3100ec4dc1668df1 = "spectrum-Popover-tip_6115b8";
|
|
192
198
|
$16e1dca4664d0b1c$export$ed733fa6cf19ab80 = "spectrum-Popover-tip-triangle_6115b8";
|
|
193
199
|
$16e1dca4664d0b1c$export$cf634262e726cd19 = "spectrum-Popover--dialog_6115b8";
|
|
194
|
-
$16e1dca4664d0b1c$export$d8b16c5377728262 = "spectrum-Popover--withTip_6115b8";
|
|
195
200
|
|
|
196
201
|
|
|
197
202
|
/*
|
|
@@ -229,7 +234,6 @@ function $b900e75089bdd9cd$export$f360afc887607b02({ isOpen: isOpen , isTranspar
|
|
|
229
234
|
}
|
|
230
235
|
|
|
231
236
|
|
|
232
|
-
|
|
233
237
|
/**
|
|
234
238
|
* Arrow placement can be done pointing right or down because those paths start at 0, x or y. Because the
|
|
235
239
|
* other two don't, they start at a fractional pixel value, it introduces rounding differences between browsers and
|
|
@@ -257,7 +261,7 @@ function $f02bba55a62f20dd$var$Popover(props, ref) {
|
|
|
257
261
|
}, children));
|
|
258
262
|
}
|
|
259
263
|
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;
|
|
264
|
+
let { children: children , isOpen: isOpen , hideArrow: hideArrow , isNonModal: isNonModal , enableBothDismissButtons: enableBothDismissButtons , state: state , wrapperRef: wrapperRef } = props;
|
|
261
265
|
let { styleProps: styleProps } = (0, $eLPAa$reactspectrumutils.useStyleProps)(props);
|
|
262
266
|
let { size: size , borderWidth: borderWidth , arrowRef: arrowRef } = $f02bba55a62f20dd$var$useArrowSize();
|
|
263
267
|
const borderRadius = $f02bba55a62f20dd$var$usePopoverBorderRadius(ref);
|
|
@@ -271,6 +275,7 @@ const $f02bba55a62f20dd$var$PopoverWrapper = /*#__PURE__*/ (0, $eLPAa$react.forw
|
|
|
271
275
|
arrowSize: hideArrow ? 0 : secondary,
|
|
272
276
|
arrowBoundaryOffset: borderRadius
|
|
273
277
|
}, state);
|
|
278
|
+
let { focusWithinProps: focusWithinProps } = (0, $eLPAa$reactariainteractions.useFocusWithin)(props);
|
|
274
279
|
// Attach Transition's nodeRef to outermost wrapper for node.reflow: https://github.com/reactjs/react-transition-group/blob/c89f807067b32eea6f68fd6c622190d88ced82e2/src/Transition.js#L231
|
|
275
280
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement("div", {
|
|
276
281
|
ref: wrapperRef
|
|
@@ -280,7 +285,7 @@ const $f02bba55a62f20dd$var$PopoverWrapper = /*#__PURE__*/ (0, $eLPAa$react.forw
|
|
|
280
285
|
isOpen: isOpen
|
|
281
286
|
}), /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement("div", {
|
|
282
287
|
...styleProps,
|
|
283
|
-
...popoverProps,
|
|
288
|
+
...(0, $eLPAa$reactariautils.mergeProps)(popoverProps, focusWithinProps),
|
|
284
289
|
style: {
|
|
285
290
|
...styleProps.style,
|
|
286
291
|
...popoverProps.style
|
|
@@ -292,7 +297,7 @@ const $f02bba55a62f20dd$var$PopoverWrapper = /*#__PURE__*/ (0, $eLPAa$react.forw
|
|
|
292
297
|
}, (0, $eLPAa$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($e9a663ccb19ed1b0$exports))), "spectrum-Popover", "react-spectrum-Popover"), styleProps.className),
|
|
293
298
|
role: "presentation",
|
|
294
299
|
"data-testid": "popover"
|
|
295
|
-
}, !isNonModal && /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement((0, $eLPAa$reactariaoverlays.DismissButton), {
|
|
300
|
+
}, (!isNonModal || enableBothDismissButtons) && /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement((0, $eLPAa$reactariaoverlays.DismissButton), {
|
|
296
301
|
onDismiss: state.close
|
|
297
302
|
}), children, hideArrow ? null : /*#__PURE__*/ (0, ($parcel$interopDefault($eLPAa$react))).createElement($f02bba55a62f20dd$var$Arrow, {
|
|
298
303
|
arrowProps: arrowProps,
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;ACAA;;;;;;;;;;CAUC,GAED;;AAGA,MAAM,oCAAc;IAClB,UAAU,KAAK;IACf,SAAS,IAAI;AACf;AAeO,SAAS,0CAAe,KAAK,EAAE;QAGQ;IAG5C,qBACE,0DAAC,CAAA,GAAA,sCAAU,AAAD;QAAE,SAAS;YAAC,OAAO;YAAG,MAAM;QAAG;QAAI,GAAG,KAAK;OAClD,CAAC,QAAU,CAAA,GAAA,sCAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,QAAQ,EAAE,CAAA,QAAS,uBAAS,CAAA,GAAA,sCAAK,AAAD,EAAE,YAAY,CAAC,OAAO;gBAAC,QAAQ,CAAC,CAAC,iCAAW,CAAC,MAAM;YAAA;AAG9H;;CDlCC,GAED;;;;AAOA,SAAS,8BAAQ,KAAmB,EAAE,GAA2B,EAAE;IACjE,IAAI,YAAC,SAAQ,UAAE,OA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,GACb,iBACA,wBAEF,WAAW,SAAS;IAGtB,4LAA4L;IAC5L,qBACE,0DAAC;QAAI,KAAK;qBACR,0DAAC,CAAA,GAAA,yCAAO;QAAG,GAAG,aAAa;QAAE,QAAQ;sBACrC,0DAAC;QAAI,WAAW;QAAkB,OAAO;qBACvC,0DAAC;QACE,GAAG,UAAU;QACb,GAAG,UAAU;QACd,WAAW;QACX,KAAK;QACL,eAAY;qBACZ,0DAAC,CAAA,GAAA,sCAAY;QAAE,WAAW,MAAM,KAAK;QACpC,wBACD,0DAAC,CAAA,GAAA,sCAAa,AAAD;QAAE,WAAW,MAAM,KAAK;;AAK/C;AAEA,IAAI,0DAAQ,CAAA,GAAA,uBAAS,EAAE;","sources":["packages/@react-spectrum/overlays/src/index.ts","packages/@react-spectrum/overlays/src/Overlay.tsx","packages/@react-spectrum/overlays/src/OpenTransition.tsx","packages/@react-spectrum/overlays/src/Popover.tsx","packages/@react-spectrum/overlays/src/overlays.css","packages/@adobe/spectrum-css-temp/components/popover/vars.css","packages/@react-spectrum/overlays/src/Underlay.tsx","packages/@adobe/spectrum-css-temp/components/underlay/vars.css","packages/@react-spectrum/overlays/src/Modal.tsx","packages/@adobe/spectrum-css-temp/components/modal/vars.css","packages/@react-spectrum/overlays/src/Tray.tsx","packages/@adobe/spectrum-css-temp/components/tray/vars.css"],"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\n/// <reference types=\"css-module-types\" />\n\nexport {Overlay} from './Overlay';\nexport {Popover} from './Popover';\nexport {Modal} from './Modal';\nexport {Tray} from './Tray';\nexport {OpenTransition} from './OpenTransition';\n","/*\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} from '@react-types/shared';\nimport {OpenTransition} from './OpenTransition';\nimport {OverlayProps} from '@react-types/overlays';\nimport {Provider} from '@react-spectrum/provider';\nimport React, {useCallback, useState} from 'react';\nimport {Overlay as ReactAriaOverlay} from '@react-aria/overlays';\n\nfunction Overlay(props: OverlayProps, ref: DOMRef<HTMLDivElement>) {\n let {children, isOpen, container, onEnter, onEntering, onEntered, onExit, onExiting, onExited, nodeRef} = props;\n let [exited, setExited] = useState(!isOpen);\n\n let handleEntered = useCallback(() => {\n setExited(false);\n if (onEntered) {\n onEntered();\n }\n }, [onEntered]);\n\n let handleExited = useCallback(() => {\n setExited(true);\n if (onExited) {\n onExited();\n }\n }, [onExited]);\n\n // Don't un-render the overlay while it's transitioning out.\n let mountOverlay = isOpen || !exited;\n if (!mountOverlay) {\n // Don't bother showing anything if we don't have to.\n return null;\n }\n\n return (\n <ReactAriaOverlay portalContainer={container}>\n <Provider ref={ref} UNSAFE_style={{background: 'transparent', isolation: 'isolate'}} isDisabled={false}>\n <OpenTransition\n in={isOpen}\n appear\n onExit={onExit}\n onExiting={onExiting}\n onExited={handleExited}\n onEnter={onEnter}\n onEntering={onEntering}\n onEntered={handleEntered}\n nodeRef={nodeRef}>\n {children}\n </OpenTransition>\n </Provider>\n </ReactAriaOverlay>\n );\n}\n\nlet _Overlay = React.forwardRef(Overlay);\nexport {_Overlay as Overlay};\n","/*\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 React from 'react';\nimport {Transition} from 'react-transition-group';\n\nconst OPEN_STATES = {\n entering: false,\n entered: true\n};\n\n/**\n * Timeout issues adding css animations to enter may be related to\n * https://github.com/reactjs/react-transition-group/issues/189 or\n * https://github.com/reactjs/react-transition-group/issues/22\n * my VM isn't good enough to debug accurately and get a better answer.\n *\n * As a result, use enter 0 so that is-open is applied once entered\n * it doesn't matter if we know when the css-animation is done on entering\n * for exiting though, give time for the css-animation to play\n * before removing from the DOM\n * **note** hitting esc bypasses exit animation for anyone testing.\n */\n\nexport function OpenTransition(props) {\n // Do not apply any transition if in chromatic.\n if (process.env.CHROMATIC) {\n return React.Children.map(props.children, child => child && React.cloneElement(child, {isOpen: props.in}));\n }\n\n return (\n <Transition timeout={{enter: 0, exit: 350}} {...props}>\n {(state) => React.Children.map(props.children, child => child && React.cloneElement(child, {isOpen: !!OPEN_STATES[state]}))}\n </Transition>\n );\n}\n","/*\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 {AriaPopoverProps, DismissButton, PopoverAria, usePopover} from '@react-aria/overlays';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef, StyleProps} from '@react-types/shared';\nimport {Overlay} from './Overlay';\nimport {OverlayTriggerState} from '@react-stately/overlays';\nimport overrideStyles from './overlays.css';\nimport React, {forwardRef, MutableRefObject, ReactNode, RefObject, useRef, useState} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/popover/vars.css';\nimport {Underlay} from './Underlay';\nimport {useLayoutEffect} from '@react-aria/utils';\n\ninterface PopoverProps extends Omit<AriaPopoverProps, 'popoverRef' | 'maxHeight'>, StyleProps {\n children: ReactNode,\n hideArrow?: boolean,\n state: OverlayTriggerState\n}\n\ninterface PopoverWrapperProps extends PopoverProps {\n isOpen?: boolean,\n wrapperRef: MutableRefObject<HTMLDivElement>\n}\n\ninterface ArrowProps {\n arrowProps: PopoverAria['arrowProps'],\n isLandscape: boolean,\n arrowRef?: RefObject<SVGSVGElement>,\n primary: number,\n secondary: number,\n borderDiagonal: number\n}\n\n/**\n * Arrow placement can be done pointing right or down because those paths start at 0, x or y. Because the\n * other two don't, they start at a fractional pixel value, it introduces rounding differences between browsers and\n * between display types (retina with subpixels vs not retina). By flipping them with CSS we can ensure that\n * the path always starts at 0 so that it perfectly overlaps the popover's border.\n * See bottom of file for more explanation.\n */\nlet arrowPlacement = {\n left: 'right',\n right: 'right',\n top: 'bottom',\n bottom: 'bottom'\n};\n\nfunction Popover(props: PopoverProps, ref: DOMRef<HTMLDivElement>) {\n let {\n children,\n state,\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n let wrapperRef = useRef<HTMLDivElement>(null);\n\n return (\n <Overlay {...otherProps} isOpen={state.isOpen} nodeRef={wrapperRef}>\n <PopoverWrapper ref={domRef} {...props} wrapperRef={wrapperRef}>\n {children}\n </PopoverWrapper>\n </Overlay>\n );\n}\n\nconst PopoverWrapper = forwardRef((props: PopoverWrapperProps, ref: RefObject<HTMLDivElement>) => {\n let {\n children,\n isOpen,\n hideArrow,\n isNonModal,\n state,\n wrapperRef\n } = props;\n let {styleProps} = useStyleProps(props);\n\n let {size, borderWidth, arrowRef} = useArrowSize();\n const borderRadius = usePopoverBorderRadius(ref);\n let borderDiagonal = borderWidth * Math.SQRT2;\n let primary = size + borderDiagonal;\n let secondary = primary * 2;\n let {popoverProps, arrowProps, underlayProps, placement} = usePopover({\n ...props,\n popoverRef: ref,\n maxHeight: null,\n arrowSize: hideArrow ? 0 : secondary,\n arrowBoundaryOffset: borderRadius\n }, state);\n\n // Attach Transition's nodeRef to outermost wrapper for node.reflow: https://github.com/reactjs/react-transition-group/blob/c89f807067b32eea6f68fd6c622190d88ced82e2/src/Transition.js#L231\n return (\n <div ref={wrapperRef}>\n {!isNonModal && <Underlay isTransparent {...underlayProps} isOpen={isOpen} /> }\n <div\n {...styleProps}\n {...popoverProps}\n style={{\n ...styleProps.style,\n ...popoverProps.style\n }}\n ref={ref}\n className={\n classNames(\n styles,\n 'spectrum-Popover',\n `spectrum-Popover--${placement}`,\n {\n 'spectrum-Popover--withTip': !hideArrow,\n 'is-open': isOpen\n },\n classNames(\n overrideStyles,\n 'spectrum-Popover',\n 'react-spectrum-Popover'\n ),\n styleProps.className\n )\n }\n role=\"presentation\"\n data-testid=\"popover\">\n {!isNonModal && <DismissButton onDismiss={state.close} />}\n {children}\n {hideArrow ? null : (\n <Arrow\n arrowProps={arrowProps}\n isLandscape={arrowPlacement[placement] === 'bottom'}\n arrowRef={arrowRef}\n primary={primary}\n secondary={secondary}\n borderDiagonal={borderDiagonal} />\n )}\n <DismissButton onDismiss={state.close} />\n </div>\n </div>\n );\n});\n\nfunction usePopoverBorderRadius(popoverRef: RefObject<HTMLDivElement>) {\n let [borderRadius, setBorderRadius] = useState(0);\n useLayoutEffect(() => {\n if (popoverRef.current) {\n let spectrumBorderRadius = window.getComputedStyle(popoverRef.current).borderRadius;\n if (spectrumBorderRadius !== '') {\n setBorderRadius(parseInt(spectrumBorderRadius, 10));\n }\n }\n }, [popoverRef]);\n return borderRadius;\n}\n\nfunction useArrowSize() {\n let [size, setSize] = useState(20);\n let [borderWidth, setBorderWidth] = useState(1);\n let arrowRef = useRef<SVGSVGElement>(null);\n // get the css value for the tip size and divide it by 2 for this arrow implementation\n useLayoutEffect(() => {\n if (arrowRef.current) {\n let spectrumTipWidth = window.getComputedStyle(arrowRef.current)\n .getPropertyValue('--spectrum-popover-tip-size');\n if (spectrumTipWidth !== '') {\n setSize(parseInt(spectrumTipWidth, 10) / 2);\n }\n\n let spectrumBorderWidth = window.getComputedStyle(arrowRef.current)\n .getPropertyValue('--spectrum-popover-tip-borderWidth');\n if (spectrumBorderWidth !== '') {\n setBorderWidth(parseInt(spectrumBorderWidth, 10));\n }\n }\n }, []);\n return {size, borderWidth, arrowRef};\n}\n\nfunction Arrow(props: ArrowProps) {\n let {primary, secondary, isLandscape, arrowProps, borderDiagonal, arrowRef} = props;\n let halfBorderDiagonal = borderDiagonal / 2;\n\n let primaryStart = 0;\n let primaryEnd = primary - halfBorderDiagonal;\n\n let secondaryStart = halfBorderDiagonal;\n let secondaryMiddle = secondary / 2;\n let secondaryEnd = secondary - halfBorderDiagonal;\n\n let pathData = isLandscape ? [\n 'M', secondaryStart, primaryStart,\n 'L', secondaryMiddle, primaryEnd,\n 'L', secondaryEnd, primaryStart\n ] : [\n 'M', primaryStart, secondaryStart,\n 'L', primaryEnd, secondaryMiddle,\n 'L', primaryStart, secondaryEnd\n ];\n\n /* use ceil because the svg needs to always accommodate the path inside it */\n return (\n <svg\n xmlns=\"http://www.w3.org/svg/2000\"\n width={Math.ceil(isLandscape ? secondary : primary)}\n height={Math.ceil(isLandscape ? primary : secondary)}\n className={classNames(styles, 'spectrum-Popover-tip')}\n ref={arrowRef}\n {...arrowProps}>\n <path className={classNames(styles, 'spectrum-Popover-tip-triangle')} d={pathData.join(' ')} />\n </svg>\n );\n}\n\nlet _Popover = forwardRef(Popover);\nexport {_Popover as Popover};\n\n/**\n * More explanation on popover tips.\n * - I tried changing the calculation of the popover placement in an effort to get it squarely onto the pixel grid.\n * This did not work because the problem was in the svg partial pixel end of the path in the popover right and popover bottom.\n * - I tried creating an extra 'bandaid' path that matched the background color and would overlap the popover border.\n * This didn't work because the border on the svg triangle didn't extend all the way to match nicely with the popover border.\n * - I tried getting the client bounding box and setting the svg to that partial pixel value\n * This didn't work because again the issue was inside the svg\n * - I didn't try drawing the svg backwards\n * This could still be tried\n * - I tried changing the calculation of the popover placement AND the svg height/width so that they were all rounded\n * This seems to have done the trick.\n */\n","/*\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.spectrum-Popover {\n /* This makes the contents of popovers focusable immediately, without waiting\n a frame for animations to start. */\n &.react-spectrum-Popover {\n visibility: visible;\n }\n\n .spectrum-Dialog-content {\n max-height: initial;\n }\n}\n\n.spectrum-Modal-wrapper.react-spectrum-Modal-wrapper,\n.spectrum-Modal.react-spectrum-Modal {\n visibility: visible;\n}\n\n.spectrum-Tray.react-spectrum-Tray {\n visibility: visible;\n}\n","/*\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@import './index.css';\n@import './skin.css';\n","/*\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 {classNames} from '@react-spectrum/utils';\nimport React from 'react';\nimport underlayStyles from '@adobe/spectrum-css-temp/components/underlay/vars.css';\n\ninterface UnderlayProps {\n isOpen?: boolean,\n isTransparent?: boolean\n}\n\nexport function Underlay({isOpen, isTransparent}: UnderlayProps) {\n return (\n <div className={classNames(underlayStyles, 'spectrum-Underlay', {'is-open': isOpen, 'spectrum-Underlay--transparent': isTransparent})} />\n );\n}\n","/*\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@import './index.css';\n@import './skin.css';\n","/*\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 {AriaModalOverlayProps, useModalOverlay} from '@react-aria/overlays';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef, StyleProps} from '@react-types/shared';\nimport modalStyles from '@adobe/spectrum-css-temp/components/modal/vars.css';\nimport {Overlay} from './Overlay';\nimport {OverlayProps} from '@react-types/overlays';\nimport {OverlayTriggerState} from '@react-stately/overlays';\nimport overrideStyles from './overlays.css';\nimport React, {forwardRef, MutableRefObject, ReactNode, RefObject, useRef} from 'react';\nimport {Underlay} from './Underlay';\nimport {useViewportSize} from '@react-aria/utils';\n\ninterface ModalProps extends AriaModalOverlayProps, StyleProps, Omit<OverlayProps, 'nodeRef' | 'shouldContainFocus'> {\n children: ReactNode,\n state: OverlayTriggerState,\n type?: 'modal' | 'fullscreen' | 'fullscreenTakeover'\n}\n\ninterface ModalWrapperProps extends ModalProps {\n isOpen?: boolean,\n wrapperRef: MutableRefObject<HTMLDivElement>\n}\n\nfunction Modal(props: ModalProps, ref: DOMRef<HTMLDivElement>) {\n let {children, state, ...otherProps} = props;\n let domRef = useDOMRef(ref);\n let wrapperRef = useRef<HTMLDivElement>(null);\n\n return (\n <Overlay {...otherProps} isOpen={state.isOpen} nodeRef={wrapperRef}>\n <ModalWrapper {...props} wrapperRef={wrapperRef} ref={domRef}>\n {children}\n </ModalWrapper>\n </Overlay>\n );\n}\n\nlet typeMap = {\n fullscreen: 'fullscreen',\n fullscreenTakeover: 'fullscreenTakeover'\n};\n\nlet ModalWrapper = forwardRef(function (props: ModalWrapperProps, ref: RefObject<HTMLDivElement>) {\n let {type, children, state, isOpen, wrapperRef} = props;\n let typeVariant = typeMap[type];\n let {styleProps} = useStyleProps(props);\n let {modalProps, underlayProps} = useModalOverlay(props, state, ref);\n\n let wrapperClassName = classNames(\n modalStyles,\n 'spectrum-Modal-wrapper',\n classNames(\n overrideStyles,\n 'spectrum-Modal-wrapper',\n 'react-spectrum-Modal-wrapper'\n )\n );\n\n let modalClassName = classNames(\n modalStyles,\n 'spectrum-Modal',\n {\n 'is-open': isOpen\n },\n classNames(\n overrideStyles,\n 'spectrum-Modal',\n 'react-spectrum-Modal'\n ),\n {[`spectrum-Modal--${typeVariant}`]: typeVariant},\n styleProps.className\n );\n\n let viewport = useViewportSize();\n let style: any = {\n '--spectrum-visual-viewport-height': viewport.height + 'px'\n };\n\n // Attach Transition's nodeRef to outer most wrapper for node.reflow: https://github.com/reactjs/react-transition-group/blob/c89f807067b32eea6f68fd6c622190d88ced82e2/src/Transition.js#L231\n return (\n <div ref={wrapperRef}>\n <Underlay {...underlayProps} isOpen={isOpen} />\n <div className={wrapperClassName} style={style}>\n <div\n {...styleProps}\n {...modalProps}\n ref={ref}\n className={modalClassName}\n data-testid=\"modal\">\n {children}\n </div>\n </div>\n </div>\n );\n});\n\nlet _Modal = forwardRef(Modal);\nexport {_Modal as Modal};\n","/*\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@import './index.css';\n@import './skin.css';\n","/*\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 {AriaModalOverlayProps, DismissButton, useModalOverlay} from '@react-aria/overlays';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef, StyleProps} from '@react-types/shared';\nimport {Overlay} from './Overlay';\nimport {OverlayProps} from '@react-types/overlays';\nimport {OverlayTriggerState} from '@react-stately/overlays';\nimport overrideStyles from './overlays.css';\nimport React, {forwardRef, MutableRefObject, ReactNode, RefObject, useRef} from 'react';\nimport trayStyles from '@adobe/spectrum-css-temp/components/tray/vars.css';\nimport {Underlay} from './Underlay';\nimport {useViewportSize} from '@react-aria/utils';\n\ninterface TrayProps extends AriaModalOverlayProps, StyleProps, Omit<OverlayProps, 'nodeRef' | 'shouldContainFocus'> {\n children: ReactNode,\n state: OverlayTriggerState,\n isFixedHeight?: boolean\n}\n\ninterface TrayWrapperProps extends TrayProps {\n isOpen?: boolean,\n wrapperRef: MutableRefObject<HTMLDivElement>\n}\n\nfunction Tray(props: TrayProps, ref: DOMRef<HTMLDivElement>) {\n let {children, state, ...otherProps} = props;\n let domRef = useDOMRef(ref);\n let wrapperRef = useRef<HTMLDivElement>(null);\n\n return (\n <Overlay {...otherProps} isOpen={state.isOpen} nodeRef={wrapperRef}>\n <TrayWrapper {...props} wrapperRef={wrapperRef} ref={domRef}>\n {children}\n </TrayWrapper>\n </Overlay>\n );\n}\n\nlet TrayWrapper = forwardRef(function (props: TrayWrapperProps, ref: RefObject<HTMLDivElement>) {\n let {\n children,\n isOpen,\n isFixedHeight,\n state,\n wrapperRef\n } = props;\n let {styleProps} = useStyleProps(props);\n\n let {modalProps, underlayProps} = useModalOverlay({\n ...props,\n isDismissable: true\n }, state, ref);\n\n // We need to measure the window's height in JS rather than using percentages in CSS\n // so that contents (e.g. menu) can inherit the max-height properly. Using percentages\n // does not work properly because there is nothing to base the percentage on.\n // We cannot use vh units because mobile browsers adjust the window height dynamically\n // when the address bar/bottom toolbars show and hide on scroll and vh units are fixed.\n // Also, the visual viewport is smaller than the layout viewport when the virtual keyboard\n // is up, so use the VisualViewport API to ensure the tray is displayed above the keyboard.\n let viewport = useViewportSize();\n let wrapperStyle: any = {\n '--spectrum-visual-viewport-height': viewport.height + 'px'\n };\n\n let wrapperClassName = classNames(\n trayStyles,\n 'spectrum-Tray-wrapper'\n );\n\n let className = classNames(\n trayStyles,\n 'spectrum-Tray',\n {\n 'is-open': isOpen,\n 'spectrum-Tray--fixedHeight': isFixedHeight\n },\n classNames(\n overrideStyles,\n 'spectrum-Tray',\n 'react-spectrum-Tray'\n ),\n styleProps.className\n );\n\n // Attach Transition's nodeRef to outer most wrapper for node.reflow: https://github.com/reactjs/react-transition-group/blob/c89f807067b32eea6f68fd6c622190d88ced82e2/src/Transition.js#L231\n return (\n <div ref={wrapperRef}>\n <Underlay {...underlayProps} isOpen={isOpen} />\n <div className={wrapperClassName} style={wrapperStyle}>\n <div\n {...styleProps}\n {...modalProps}\n className={className}\n ref={ref}\n data-testid=\"tray\">\n <DismissButton onDismiss={state.close} />\n {children}\n <DismissButton onDismiss={state.close} />\n </div>\n </div>\n </div>\n );\n});\n\nlet _Tray = forwardRef(Tray);\nexport {_Tray as Tray};\n","/*\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@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;ACAA;;;;;;;;;;CAUC;;AAKD,MAAM,oCAAc;IAClB,UAAU;IACV,SAAS;AACX;AAeO,SAAS,0CAAe,KAAK;QAGU;IAG5C,qBACE,0DAAC,CAAA,GAAA,sCAAS;QAAE,SAAS;YAAC,OAAO;YAAG,MAAM;QAAG;QAAI,GAAG,KAAK;OAClD,CAAC,QAAU,CAAA,GAAA,sCAAI,EAAE,SAAS,IAAI,MAAM,UAAU,CAAA,QAAS,uBAAS,CAAA,GAAA,sCAAI,EAAE,aAAa,OAAO;gBAAC,QAAQ,CAAC,CAAC,iCAAW,CAAC,MAAM;YAAA;AAG9H;;CDlCC;;;;AASD,SAAS,8BAAQ,KAAmB,EAAE,GA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CAAA,GAAA,uBAAS,EAAE;;","sources":["packages/@react-spectrum/overlays/src/index.ts","packages/@react-spectrum/overlays/src/Overlay.tsx","packages/@react-spectrum/overlays/src/OpenTransition.tsx","packages/@react-spectrum/overlays/src/Popover.tsx","packages/@react-spectrum/overlays/src/overlays.css","packages/@adobe/spectrum-css-temp/components/popover/vars.css","packages/@react-spectrum/overlays/src/Underlay.tsx","packages/@adobe/spectrum-css-temp/components/underlay/vars.css","packages/@react-spectrum/overlays/src/Modal.tsx","packages/@adobe/spectrum-css-temp/components/modal/vars.css","packages/@react-spectrum/overlays/src/Tray.tsx","packages/@adobe/spectrum-css-temp/components/tray/vars.css"],"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\n/// <reference types=\"css-module-types\" />\n\nexport {Overlay} from './Overlay';\nexport {Popover} from './Popover';\nexport {Modal} from './Modal';\nexport {Tray} from './Tray';\nexport {OpenTransition} from './OpenTransition';\n","/*\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} from '@react-types/shared';\nimport {OpenTransition} from './OpenTransition';\nimport {OverlayProps} from '@react-types/overlays';\nimport {Provider} from '@react-spectrum/provider';\nimport React, {useCallback, useState} from 'react';\nimport {Overlay as ReactAriaOverlay} from '@react-aria/overlays';\n\nfunction Overlay(props: OverlayProps, ref: DOMRef<HTMLDivElement>) {\n let {\n children,\n isOpen,\n disableFocusManagement,\n container,\n onEnter,\n onEntering,\n onEntered,\n onExit,\n onExiting,\n onExited,\n nodeRef\n } = props;\n let [exited, setExited] = useState(!isOpen);\n\n let handleEntered = useCallback(() => {\n setExited(false);\n if (onEntered) {\n onEntered();\n }\n }, [onEntered]);\n\n let handleExited = useCallback(() => {\n setExited(true);\n if (onExited) {\n onExited();\n }\n }, [onExited]);\n\n // Don't un-render the overlay while it's transitioning out.\n let mountOverlay = isOpen || !exited;\n if (!mountOverlay) {\n // Don't bother showing anything if we don't have to.\n return null;\n }\n\n return (\n <ReactAriaOverlay portalContainer={container} disableFocusManagement={disableFocusManagement} isExiting={!isOpen}>\n <Provider ref={ref} UNSAFE_style={{background: 'transparent', isolation: 'isolate'}} isDisabled={false}>\n <OpenTransition\n in={isOpen}\n appear\n onExit={onExit}\n onExiting={onExiting}\n onExited={handleExited}\n onEnter={onEnter}\n onEntering={onEntering}\n onEntered={handleEntered}\n nodeRef={nodeRef}>\n {children}\n </OpenTransition>\n </Provider>\n </ReactAriaOverlay>\n );\n}\n\nlet _Overlay = React.forwardRef(Overlay);\nexport {_Overlay as Overlay};\n","/*\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 React from 'react';\nimport {Transition} from 'react-transition-group';\n\nconst OPEN_STATES = {\n entering: false,\n entered: true\n};\n\n/**\n * Timeout issues adding css animations to enter may be related to\n * https://github.com/reactjs/react-transition-group/issues/189 or\n * https://github.com/reactjs/react-transition-group/issues/22\n * my VM isn't good enough to debug accurately and get a better answer.\n *\n * As a result, use enter 0 so that is-open is applied once entered\n * it doesn't matter if we know when the css-animation is done on entering\n * for exiting though, give time for the css-animation to play\n * before removing from the DOM\n * **note** hitting esc bypasses exit animation for anyone testing.\n */\n\nexport function OpenTransition(props) {\n // Do not apply any transition if in chromatic.\n if (process.env.CHROMATIC) {\n return React.Children.map(props.children, child => child && React.cloneElement(child, {isOpen: props.in}));\n }\n\n return (\n <Transition timeout={{enter: 0, exit: 350}} {...props}>\n {(state) => React.Children.map(props.children, child => child && React.cloneElement(child, {isOpen: !!OPEN_STATES[state]}))}\n </Transition>\n );\n}\n","/*\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 {AriaPopoverProps, DismissButton, PopoverAria, usePopover} from '@react-aria/overlays';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef, StyleProps} from '@react-types/shared';\nimport {FocusWithinProps, useFocusWithin} from '@react-aria/interactions';\nimport {mergeProps, useLayoutEffect} from '@react-aria/utils';\nimport {Overlay} from './Overlay';\nimport {OverlayTriggerState} from '@react-stately/overlays';\nimport overrideStyles from './overlays.css';\nimport React, {forwardRef, MutableRefObject, ReactNode, RefObject, useRef, useState} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/popover/vars.css';\nimport {Underlay} from './Underlay';\n\ninterface PopoverProps extends Omit<AriaPopoverProps, 'popoverRef' | 'maxHeight'>, FocusWithinProps, StyleProps {\n children: ReactNode,\n hideArrow?: boolean,\n state: OverlayTriggerState,\n shouldContainFocus?: boolean,\n onEntering?: () => void,\n onEnter?: () => void,\n onEntered?: () => void,\n onExiting?: () => void,\n onExited?: () => void,\n onExit?: () => void,\n container?: HTMLElement,\n disableFocusManagement?: boolean,\n enableBothDismissButtons?: boolean\n}\n\ninterface PopoverWrapperProps extends PopoverProps, FocusWithinProps {\n isOpen?: boolean,\n wrapperRef: MutableRefObject<HTMLDivElement>\n}\n\ninterface ArrowProps {\n arrowProps: PopoverAria['arrowProps'],\n isLandscape: boolean,\n arrowRef?: RefObject<SVGSVGElement>,\n primary: number,\n secondary: number,\n borderDiagonal: number\n}\n\n/**\n * Arrow placement can be done pointing right or down because those paths start at 0, x or y. Because the\n * other two don't, they start at a fractional pixel value, it introduces rounding differences between browsers and\n * between display types (retina with subpixels vs not retina). By flipping them with CSS we can ensure that\n * the path always starts at 0 so that it perfectly overlaps the popover's border.\n * See bottom of file for more explanation.\n */\nlet arrowPlacement = {\n left: 'right',\n right: 'right',\n top: 'bottom',\n bottom: 'bottom'\n};\n\nfunction Popover(props: PopoverProps, ref: DOMRef<HTMLDivElement>) {\n let {\n children,\n state,\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n let wrapperRef = useRef<HTMLDivElement>(null);\n\n return (\n <Overlay {...otherProps} isOpen={state.isOpen} nodeRef={wrapperRef}>\n <PopoverWrapper ref={domRef} {...props} wrapperRef={wrapperRef}>\n {children}\n </PopoverWrapper>\n </Overlay>\n );\n}\n\nconst PopoverWrapper = forwardRef((props: PopoverWrapperProps, ref: RefObject<HTMLDivElement>) => {\n let {\n children,\n isOpen,\n hideArrow,\n isNonModal,\n enableBothDismissButtons,\n state,\n wrapperRef\n } = props;\n let {styleProps} = useStyleProps(props);\n\n let {size, borderWidth, arrowRef} = useArrowSize();\n const borderRadius = usePopoverBorderRadius(ref);\n let borderDiagonal = borderWidth * Math.SQRT2;\n let primary = size + borderDiagonal;\n let secondary = primary * 2;\n let {\n popoverProps,\n arrowProps,\n underlayProps,\n placement\n } = usePopover({\n ...props,\n popoverRef: ref,\n maxHeight: null,\n arrowSize: hideArrow ? 0 : secondary,\n arrowBoundaryOffset: borderRadius\n }, state);\n let {focusWithinProps} = useFocusWithin(props);\n\n // Attach Transition's nodeRef to outermost wrapper for node.reflow: https://github.com/reactjs/react-transition-group/blob/c89f807067b32eea6f68fd6c622190d88ced82e2/src/Transition.js#L231\n return (\n <div ref={wrapperRef}>\n {!isNonModal && <Underlay isTransparent {...underlayProps} isOpen={isOpen} /> }\n <div\n {...styleProps}\n {...mergeProps(popoverProps, focusWithinProps)}\n style={{\n ...styleProps.style,\n ...popoverProps.style\n }}\n ref={ref}\n className={\n classNames(\n styles,\n 'spectrum-Popover',\n `spectrum-Popover--${placement}`,\n {\n 'spectrum-Popover--withTip': !hideArrow,\n 'is-open': isOpen\n },\n classNames(\n overrideStyles,\n 'spectrum-Popover',\n 'react-spectrum-Popover'\n ),\n styleProps.className\n )\n }\n role=\"presentation\"\n data-testid=\"popover\">\n {(!isNonModal || enableBothDismissButtons) && <DismissButton onDismiss={state.close} />}\n {children}\n {hideArrow ? null : (\n <Arrow\n arrowProps={arrowProps}\n isLandscape={arrowPlacement[placement] === 'bottom'}\n arrowRef={arrowRef}\n primary={primary}\n secondary={secondary}\n borderDiagonal={borderDiagonal} />\n )}\n <DismissButton onDismiss={state.close} />\n </div>\n </div>\n );\n});\n\nfunction usePopoverBorderRadius(popoverRef: RefObject<HTMLDivElement>) {\n let [borderRadius, setBorderRadius] = useState(0);\n useLayoutEffect(() => {\n if (popoverRef.current) {\n let spectrumBorderRadius = window.getComputedStyle(popoverRef.current).borderRadius;\n if (spectrumBorderRadius !== '') {\n setBorderRadius(parseInt(spectrumBorderRadius, 10));\n }\n }\n }, [popoverRef]);\n return borderRadius;\n}\n\nfunction useArrowSize() {\n let [size, setSize] = useState(20);\n let [borderWidth, setBorderWidth] = useState(1);\n let arrowRef = useRef<SVGSVGElement>(null);\n // get the css value for the tip size and divide it by 2 for this arrow implementation\n useLayoutEffect(() => {\n if (arrowRef.current) {\n let spectrumTipWidth = window.getComputedStyle(arrowRef.current)\n .getPropertyValue('--spectrum-popover-tip-size');\n if (spectrumTipWidth !== '') {\n setSize(parseInt(spectrumTipWidth, 10) / 2);\n }\n\n let spectrumBorderWidth = window.getComputedStyle(arrowRef.current)\n .getPropertyValue('--spectrum-popover-tip-borderWidth');\n if (spectrumBorderWidth !== '') {\n setBorderWidth(parseInt(spectrumBorderWidth, 10));\n }\n }\n }, []);\n return {size, borderWidth, arrowRef};\n}\n\nfunction Arrow(props: ArrowProps) {\n let {primary, secondary, isLandscape, arrowProps, borderDiagonal, arrowRef} = props;\n let halfBorderDiagonal = borderDiagonal / 2;\n\n let primaryStart = 0;\n let primaryEnd = primary - halfBorderDiagonal;\n\n let secondaryStart = halfBorderDiagonal;\n let secondaryMiddle = secondary / 2;\n let secondaryEnd = secondary - halfBorderDiagonal;\n\n let pathData = isLandscape ? [\n 'M', secondaryStart, primaryStart,\n 'L', secondaryMiddle, primaryEnd,\n 'L', secondaryEnd, primaryStart\n ] : [\n 'M', primaryStart, secondaryStart,\n 'L', primaryEnd, secondaryMiddle,\n 'L', primaryStart, secondaryEnd\n ];\n\n /* use ceil because the svg needs to always accommodate the path inside it */\n return (\n <svg\n xmlns=\"http://www.w3.org/svg/2000\"\n width={Math.ceil(isLandscape ? secondary : primary)}\n height={Math.ceil(isLandscape ? primary : secondary)}\n className={classNames(styles, 'spectrum-Popover-tip')}\n ref={arrowRef}\n {...arrowProps}>\n <path className={classNames(styles, 'spectrum-Popover-tip-triangle')} d={pathData.join(' ')} />\n </svg>\n );\n}\n\nlet _Popover = forwardRef(Popover);\nexport {_Popover as Popover};\n\n/**\n * More explanation on popover tips.\n * - I tried changing the calculation of the popover placement in an effort to get it squarely onto the pixel grid.\n * This did not work because the problem was in the svg partial pixel end of the path in the popover right and popover bottom.\n * - I tried creating an extra 'bandaid' path that matched the background color and would overlap the popover border.\n * This didn't work because the border on the svg triangle didn't extend all the way to match nicely with the popover border.\n * - I tried getting the client bounding box and setting the svg to that partial pixel value\n * This didn't work because again the issue was inside the svg\n * - I didn't try drawing the svg backwards\n * This could still be tried\n * - I tried changing the calculation of the popover placement AND the svg height/width so that they were all rounded\n * This seems to have done the trick.\n */\n","/*\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.spectrum-Popover {\n /* This makes the contents of popovers focusable immediately, without waiting\n a frame for animations to start. */\n &.react-spectrum-Popover {\n visibility: visible;\n }\n\n .spectrum-Dialog-content {\n max-height: initial;\n }\n}\n\n.spectrum-Modal-wrapper.react-spectrum-Modal-wrapper,\n.spectrum-Modal.react-spectrum-Modal {\n visibility: visible;\n}\n\n.spectrum-Tray.react-spectrum-Tray {\n visibility: visible;\n}\n","/*\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@import './index.css';\n@import './skin.css';\n","/*\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 {classNames} from '@react-spectrum/utils';\nimport React from 'react';\nimport underlayStyles from '@adobe/spectrum-css-temp/components/underlay/vars.css';\n\ninterface UnderlayProps {\n isOpen?: boolean,\n isTransparent?: boolean\n}\n\nexport function Underlay({isOpen, isTransparent}: UnderlayProps) {\n return (\n <div className={classNames(underlayStyles, 'spectrum-Underlay', {'is-open': isOpen, 'spectrum-Underlay--transparent': isTransparent})} />\n );\n}\n","/*\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@import './index.css';\n@import './skin.css';\n","/*\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 {AriaModalOverlayProps, useModalOverlay} from '@react-aria/overlays';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef, StyleProps} from '@react-types/shared';\nimport modalStyles from '@adobe/spectrum-css-temp/components/modal/vars.css';\nimport {Overlay} from './Overlay';\nimport {OverlayProps} from '@react-types/overlays';\nimport {OverlayTriggerState} from '@react-stately/overlays';\nimport overrideStyles from './overlays.css';\nimport React, {forwardRef, MutableRefObject, ReactNode, RefObject, useRef} from 'react';\nimport {Underlay} from './Underlay';\nimport {useViewportSize} from '@react-aria/utils';\n\ninterface ModalProps extends AriaModalOverlayProps, StyleProps, Omit<OverlayProps, 'nodeRef' | 'shouldContainFocus'> {\n children: ReactNode,\n state: OverlayTriggerState,\n type?: 'modal' | 'fullscreen' | 'fullscreenTakeover'\n}\n\ninterface ModalWrapperProps extends ModalProps {\n isOpen?: boolean,\n wrapperRef: MutableRefObject<HTMLDivElement>\n}\n\nfunction Modal(props: ModalProps, ref: DOMRef<HTMLDivElement>) {\n let {children, state, ...otherProps} = props;\n let domRef = useDOMRef(ref);\n let wrapperRef = useRef<HTMLDivElement>(null);\n\n return (\n <Overlay {...otherProps} isOpen={state.isOpen} nodeRef={wrapperRef}>\n <ModalWrapper {...props} wrapperRef={wrapperRef} ref={domRef}>\n {children}\n </ModalWrapper>\n </Overlay>\n );\n}\n\nlet typeMap = {\n fullscreen: 'fullscreen',\n fullscreenTakeover: 'fullscreenTakeover'\n};\n\nlet ModalWrapper = forwardRef(function (props: ModalWrapperProps, ref: RefObject<HTMLDivElement>) {\n let {type, children, state, isOpen, wrapperRef} = props;\n let typeVariant = typeMap[type];\n let {styleProps} = useStyleProps(props);\n let {modalProps, underlayProps} = useModalOverlay(props, state, ref);\n\n let wrapperClassName = classNames(\n modalStyles,\n 'spectrum-Modal-wrapper',\n classNames(\n overrideStyles,\n 'spectrum-Modal-wrapper',\n 'react-spectrum-Modal-wrapper'\n )\n );\n\n let modalClassName = classNames(\n modalStyles,\n 'spectrum-Modal',\n {\n 'is-open': isOpen\n },\n classNames(\n overrideStyles,\n 'spectrum-Modal',\n 'react-spectrum-Modal'\n ),\n {[`spectrum-Modal--${typeVariant}`]: typeVariant},\n styleProps.className\n );\n\n let viewport = useViewportSize();\n let style: any = {\n '--spectrum-visual-viewport-height': viewport.height + 'px'\n };\n\n // Attach Transition's nodeRef to outer most wrapper for node.reflow: https://github.com/reactjs/react-transition-group/blob/c89f807067b32eea6f68fd6c622190d88ced82e2/src/Transition.js#L231\n return (\n <div ref={wrapperRef}>\n <Underlay {...underlayProps} isOpen={isOpen} />\n <div className={wrapperClassName} style={style}>\n <div\n {...styleProps}\n {...modalProps}\n ref={ref}\n className={modalClassName}\n data-testid=\"modal\">\n {children}\n </div>\n </div>\n </div>\n );\n});\n\nlet _Modal = forwardRef(Modal);\nexport {_Modal as Modal};\n","/*\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@import './index.css';\n@import './skin.css';\n","/*\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 {AriaModalOverlayProps, DismissButton, useModalOverlay} from '@react-aria/overlays';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef, StyleProps} from '@react-types/shared';\nimport {Overlay} from './Overlay';\nimport {OverlayProps} from '@react-types/overlays';\nimport {OverlayTriggerState} from '@react-stately/overlays';\nimport overrideStyles from './overlays.css';\nimport React, {forwardRef, MutableRefObject, ReactNode, RefObject, useRef} from 'react';\nimport trayStyles from '@adobe/spectrum-css-temp/components/tray/vars.css';\nimport {Underlay} from './Underlay';\nimport {useViewportSize} from '@react-aria/utils';\n\ninterface TrayProps extends AriaModalOverlayProps, StyleProps, Omit<OverlayProps, 'nodeRef' | 'shouldContainFocus'> {\n children: ReactNode,\n state: OverlayTriggerState,\n isFixedHeight?: boolean\n}\n\ninterface TrayWrapperProps extends TrayProps {\n isOpen?: boolean,\n wrapperRef: MutableRefObject<HTMLDivElement>\n}\n\nfunction Tray(props: TrayProps, ref: DOMRef<HTMLDivElement>) {\n let {children, state, ...otherProps} = props;\n let domRef = useDOMRef(ref);\n let wrapperRef = useRef<HTMLDivElement>(null);\n\n return (\n <Overlay {...otherProps} isOpen={state.isOpen} nodeRef={wrapperRef}>\n <TrayWrapper {...props} wrapperRef={wrapperRef} ref={domRef}>\n {children}\n </TrayWrapper>\n </Overlay>\n );\n}\n\nlet TrayWrapper = forwardRef(function (props: TrayWrapperProps, ref: RefObject<HTMLDivElement>) {\n let {\n children,\n isOpen,\n isFixedHeight,\n state,\n wrapperRef\n } = props;\n let {styleProps} = useStyleProps(props);\n\n let {modalProps, underlayProps} = useModalOverlay({\n ...props,\n isDismissable: true\n }, state, ref);\n\n // We need to measure the window's height in JS rather than using percentages in CSS\n // so that contents (e.g. menu) can inherit the max-height properly. Using percentages\n // does not work properly because there is nothing to base the percentage on.\n // We cannot use vh units because mobile browsers adjust the window height dynamically\n // when the address bar/bottom toolbars show and hide on scroll and vh units are fixed.\n // Also, the visual viewport is smaller than the layout viewport when the virtual keyboard\n // is up, so use the VisualViewport API to ensure the tray is displayed above the keyboard.\n let viewport = useViewportSize();\n let wrapperStyle: any = {\n '--spectrum-visual-viewport-height': viewport.height + 'px'\n };\n\n let wrapperClassName = classNames(\n trayStyles,\n 'spectrum-Tray-wrapper'\n );\n\n let className = classNames(\n trayStyles,\n 'spectrum-Tray',\n {\n 'is-open': isOpen,\n 'spectrum-Tray--fixedHeight': isFixedHeight\n },\n classNames(\n overrideStyles,\n 'spectrum-Tray',\n 'react-spectrum-Tray'\n ),\n styleProps.className\n );\n\n // Attach Transition's nodeRef to outer most wrapper for node.reflow: https://github.com/reactjs/react-transition-group/blob/c89f807067b32eea6f68fd6c622190d88ced82e2/src/Transition.js#L231\n return (\n <div ref={wrapperRef}>\n <Underlay {...underlayProps} isOpen={isOpen} />\n <div className={wrapperClassName} style={wrapperStyle}>\n <div\n {...styleProps}\n {...modalProps}\n className={className}\n ref={ref}\n data-testid=\"tray\">\n <DismissButton onDismiss={state.close} />\n {children}\n <DismissButton onDismiss={state.close} />\n </div>\n </div>\n </div>\n );\n});\n\nlet _Tray = forwardRef(Tray);\nexport {_Tray as Tray};\n","/*\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@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -4,7 +4,8 @@ import $fQOb3$react, {useState as $fQOb3$useState, useCallback as $fQOb3$useCall
|
|
|
4
4
|
import {Overlay as $fQOb3$Overlay, usePopover as $fQOb3$usePopover, DismissButton as $fQOb3$DismissButton, useModalOverlay as $fQOb3$useModalOverlay} from "@react-aria/overlays";
|
|
5
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
|
-
import {
|
|
7
|
+
import {useFocusWithin as $fQOb3$useFocusWithin} from "@react-aria/interactions";
|
|
8
|
+
import {mergeProps as $fQOb3$mergeProps, useLayoutEffect as $fQOb3$useLayoutEffect, useViewportSize as $fQOb3$useViewportSize} from "@react-aria/utils";
|
|
8
9
|
|
|
9
10
|
function $parcel$interopDefault(a) {
|
|
10
11
|
return a && a.__esModule ? a.default : a;
|
|
@@ -67,7 +68,7 @@ function $bc765a7a041310da$export$b847a40ee92eff38(props) {
|
|
|
67
68
|
|
|
68
69
|
|
|
69
70
|
function $70305dc5fb729c3b$var$Overlay(props, ref) {
|
|
70
|
-
let { children: children , isOpen: isOpen , container: container , onEnter: onEnter , onEntering: onEntering , onEntered: onEntered , onExit: onExit , onExiting: onExiting , onExited: onExited , nodeRef: nodeRef } = props;
|
|
71
|
+
let { children: children , isOpen: isOpen , disableFocusManagement: disableFocusManagement , container: container , onEnter: onEnter , onEntering: onEntering , onEntered: onEntered , onExit: onExit , onExiting: onExiting , onExited: onExited , nodeRef: nodeRef } = props;
|
|
71
72
|
let [exited, setExited] = (0, $fQOb3$useState)(!isOpen);
|
|
72
73
|
let handleEntered = (0, $fQOb3$useCallback)(()=>{
|
|
73
74
|
setExited(false);
|
|
@@ -86,7 +87,9 @@ function $70305dc5fb729c3b$var$Overlay(props, ref) {
|
|
|
86
87
|
if (!mountOverlay) // Don't bother showing anything if we don't have to.
|
|
87
88
|
return null;
|
|
88
89
|
return /*#__PURE__*/ (0, $fQOb3$react).createElement((0, $fQOb3$Overlay), {
|
|
89
|
-
portalContainer: container
|
|
90
|
+
portalContainer: container,
|
|
91
|
+
disableFocusManagement: disableFocusManagement,
|
|
92
|
+
isExiting: !isOpen
|
|
90
93
|
}, /*#__PURE__*/ (0, $fQOb3$react).createElement((0, $fQOb3$Provider), {
|
|
91
94
|
ref: ref,
|
|
92
95
|
UNSAFE_style: {
|
|
@@ -122,6 +125,8 @@ let $70305dc5fb729c3b$export$c6fdb837b070b4ff = /*#__PURE__*/ (0, $fQOb3$react).
|
|
|
122
125
|
*/
|
|
123
126
|
|
|
124
127
|
|
|
128
|
+
|
|
129
|
+
|
|
125
130
|
var $853e19557ad8790f$exports = {};
|
|
126
131
|
|
|
127
132
|
$parcel$export($853e19557ad8790f$exports, "spectrum-Popover", () => $853e19557ad8790f$export$a62dc1b6ab23a7bb, (v) => $853e19557ad8790f$export$a62dc1b6ab23a7bb = v);
|
|
@@ -162,30 +167,30 @@ $parcel$export($645594d913f34a2a$exports, "spectrum-Popover--bottom", () => $645
|
|
|
162
167
|
$parcel$export($645594d913f34a2a$exports, "spectrum-Popover--top", () => $645594d913f34a2a$export$f30becfb1df0cae4, (v) => $645594d913f34a2a$export$f30becfb1df0cae4 = v);
|
|
163
168
|
$parcel$export($645594d913f34a2a$exports, "spectrum-Popover--right", () => $645594d913f34a2a$export$5fc8b429396c9f58, (v) => $645594d913f34a2a$export$5fc8b429396c9f58 = v);
|
|
164
169
|
$parcel$export($645594d913f34a2a$exports, "spectrum-Popover--left", () => $645594d913f34a2a$export$79cc55906ac5b00, (v) => $645594d913f34a2a$export$79cc55906ac5b00 = v);
|
|
170
|
+
$parcel$export($645594d913f34a2a$exports, "spectrum-Popover--withTip", () => $645594d913f34a2a$export$d8b16c5377728262, (v) => $645594d913f34a2a$export$d8b16c5377728262 = v);
|
|
165
171
|
$parcel$export($645594d913f34a2a$exports, "spectrum-Popover-tip", () => $645594d913f34a2a$export$3100ec4dc1668df1, (v) => $645594d913f34a2a$export$3100ec4dc1668df1 = v);
|
|
166
172
|
$parcel$export($645594d913f34a2a$exports, "spectrum-Popover-tip-triangle", () => $645594d913f34a2a$export$ed733fa6cf19ab80, (v) => $645594d913f34a2a$export$ed733fa6cf19ab80 = v);
|
|
167
173
|
$parcel$export($645594d913f34a2a$exports, "spectrum-Popover--dialog", () => $645594d913f34a2a$export$cf634262e726cd19, (v) => $645594d913f34a2a$export$cf634262e726cd19 = v);
|
|
168
|
-
$parcel$export($645594d913f34a2a$exports, "spectrum-Popover--withTip", () => $645594d913f34a2a$export$d8b16c5377728262, (v) => $645594d913f34a2a$export$d8b16c5377728262 = v);
|
|
169
174
|
var $645594d913f34a2a$export$a62dc1b6ab23a7bb;
|
|
170
175
|
var $645594d913f34a2a$export$a9781837241c946d;
|
|
171
176
|
var $645594d913f34a2a$export$6a19b19b14780d4a;
|
|
172
177
|
var $645594d913f34a2a$export$f30becfb1df0cae4;
|
|
173
178
|
var $645594d913f34a2a$export$5fc8b429396c9f58;
|
|
174
179
|
var $645594d913f34a2a$export$79cc55906ac5b00;
|
|
180
|
+
var $645594d913f34a2a$export$d8b16c5377728262;
|
|
175
181
|
var $645594d913f34a2a$export$3100ec4dc1668df1;
|
|
176
182
|
var $645594d913f34a2a$export$ed733fa6cf19ab80;
|
|
177
183
|
var $645594d913f34a2a$export$cf634262e726cd19;
|
|
178
|
-
var $645594d913f34a2a$export$d8b16c5377728262;
|
|
179
184
|
$645594d913f34a2a$export$a62dc1b6ab23a7bb = "spectrum-Popover_6115b8";
|
|
180
185
|
$645594d913f34a2a$export$a9781837241c946d = "is-open_6115b8";
|
|
181
186
|
$645594d913f34a2a$export$6a19b19b14780d4a = "spectrum-Popover--bottom_6115b8";
|
|
182
187
|
$645594d913f34a2a$export$f30becfb1df0cae4 = "spectrum-Popover--top_6115b8";
|
|
183
188
|
$645594d913f34a2a$export$5fc8b429396c9f58 = "spectrum-Popover--right_6115b8";
|
|
184
189
|
$645594d913f34a2a$export$79cc55906ac5b00 = "spectrum-Popover--left_6115b8";
|
|
190
|
+
$645594d913f34a2a$export$d8b16c5377728262 = "spectrum-Popover--withTip_6115b8";
|
|
185
191
|
$645594d913f34a2a$export$3100ec4dc1668df1 = "spectrum-Popover-tip_6115b8";
|
|
186
192
|
$645594d913f34a2a$export$ed733fa6cf19ab80 = "spectrum-Popover-tip-triangle_6115b8";
|
|
187
193
|
$645594d913f34a2a$export$cf634262e726cd19 = "spectrum-Popover--dialog_6115b8";
|
|
188
|
-
$645594d913f34a2a$export$d8b16c5377728262 = "spectrum-Popover--withTip_6115b8";
|
|
189
194
|
|
|
190
195
|
|
|
191
196
|
/*
|
|
@@ -223,7 +228,6 @@ function $76a452f4e3df11be$export$f360afc887607b02({ isOpen: isOpen , isTranspar
|
|
|
223
228
|
}
|
|
224
229
|
|
|
225
230
|
|
|
226
|
-
|
|
227
231
|
/**
|
|
228
232
|
* Arrow placement can be done pointing right or down because those paths start at 0, x or y. Because the
|
|
229
233
|
* other two don't, they start at a fractional pixel value, it introduces rounding differences between browsers and
|
|
@@ -251,7 +255,7 @@ function $17b503f7de08fecc$var$Popover(props, ref) {
|
|
|
251
255
|
}, children));
|
|
252
256
|
}
|
|
253
257
|
const $17b503f7de08fecc$var$PopoverWrapper = /*#__PURE__*/ (0, $fQOb3$forwardRef)((props, ref)=>{
|
|
254
|
-
let { children: children , isOpen: isOpen , hideArrow: hideArrow , isNonModal: isNonModal , state: state , wrapperRef: wrapperRef } = props;
|
|
258
|
+
let { children: children , isOpen: isOpen , hideArrow: hideArrow , isNonModal: isNonModal , enableBothDismissButtons: enableBothDismissButtons , state: state , wrapperRef: wrapperRef } = props;
|
|
255
259
|
let { styleProps: styleProps } = (0, $fQOb3$useStyleProps)(props);
|
|
256
260
|
let { size: size , borderWidth: borderWidth , arrowRef: arrowRef } = $17b503f7de08fecc$var$useArrowSize();
|
|
257
261
|
const borderRadius = $17b503f7de08fecc$var$usePopoverBorderRadius(ref);
|
|
@@ -265,6 +269,7 @@ const $17b503f7de08fecc$var$PopoverWrapper = /*#__PURE__*/ (0, $fQOb3$forwardRef
|
|
|
265
269
|
arrowSize: hideArrow ? 0 : secondary,
|
|
266
270
|
arrowBoundaryOffset: borderRadius
|
|
267
271
|
}, state);
|
|
272
|
+
let { focusWithinProps: focusWithinProps } = (0, $fQOb3$useFocusWithin)(props);
|
|
268
273
|
// Attach Transition's nodeRef to outermost wrapper for node.reflow: https://github.com/reactjs/react-transition-group/blob/c89f807067b32eea6f68fd6c622190d88ced82e2/src/Transition.js#L231
|
|
269
274
|
return /*#__PURE__*/ (0, $fQOb3$react).createElement("div", {
|
|
270
275
|
ref: wrapperRef
|
|
@@ -274,7 +279,7 @@ const $17b503f7de08fecc$var$PopoverWrapper = /*#__PURE__*/ (0, $fQOb3$forwardRef
|
|
|
274
279
|
isOpen: isOpen
|
|
275
280
|
}), /*#__PURE__*/ (0, $fQOb3$react).createElement("div", {
|
|
276
281
|
...styleProps,
|
|
277
|
-
...popoverProps,
|
|
282
|
+
...(0, $fQOb3$mergeProps)(popoverProps, focusWithinProps),
|
|
278
283
|
style: {
|
|
279
284
|
...styleProps.style,
|
|
280
285
|
...popoverProps.style
|
|
@@ -286,7 +291,7 @@ const $17b503f7de08fecc$var$PopoverWrapper = /*#__PURE__*/ (0, $fQOb3$forwardRef
|
|
|
286
291
|
}, (0, $fQOb3$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($853e19557ad8790f$exports))), "spectrum-Popover", "react-spectrum-Popover"), styleProps.className),
|
|
287
292
|
role: "presentation",
|
|
288
293
|
"data-testid": "popover"
|
|
289
|
-
}, !isNonModal && /*#__PURE__*/ (0, $fQOb3$react).createElement((0, $fQOb3$DismissButton), {
|
|
294
|
+
}, (!isNonModal || enableBothDismissButtons) && /*#__PURE__*/ (0, $fQOb3$react).createElement((0, $fQOb3$DismissButton), {
|
|
290
295
|
onDismiss: state.close
|
|
291
296
|
}), children, hideArrow ? null : /*#__PURE__*/ (0, $fQOb3$react).createElement($17b503f7de08fecc$var$Arrow, {
|
|
292
297
|
arrowProps: arrowProps,
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;ACAA;;;;;;;;;;CAUC,GAED;;AAGA,MAAM,oCAAc;IAClB,UAAU,KAAK;IACf,SAAS,IAAI;AACf;AAeO,SAAS,0CAAe,KAAK,EAAE;QAGQ;IAG5C,qBACE,gCAAC,CAAA,GAAA,iBAAU,AAAD;QAAE,SAAS;YAAC,OAAO;YAAG,MAAM;QAAG;QAAI,GAAG,KAAK;OAClD,CAAC,QAAU,CAAA,GAAA,YAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,QAAQ,EAAE,CAAA,QAA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A,GAAA,gEAAU,AAAD,GACT;IAGF,IAAI,YAAY,CAAA,GAAA,iBAAU,AAAD,EACvB,CAAA,GAAA,yDAAU,OAAD,GACT,iBACA;QACE,WAAW;QACX,8BAA8B;IAChC,GACA,CAAA,GAAA,iBAAU,AAAD,EACP,CAAA,GAAA,yDAAc,OAAD,GACb,iBACA,wBAEF,WAAW,SAAS;IAGtB,4LAA4L;IAC5L,qBACE,gCAAC;QAAI,KAAK;qBACR,gCAAC,CAAA,GAAA,yCAAO;QAAG,GAAG,aAAa;QAAE,QAAQ;sBACrC,gCAAC;QAAI,WAAW;QAAkB,OAAO;qBACvC,gCAAC;QACE,GAAG,UAAU;QACb,GAAG,UAAU;QACd,WAAW;QACX,KAAK;QACL,eAAY;qBACZ,gCAAC,CAAA,GAAA,oBAAY;QAAE,WAAW,MAAM,KAAK;QACpC,wBACD,gCAAC,CAAA,GAAA,oBAAa,AAAD;QAAE,WAAW,MAAM,KAAK;;AAK/C;AAEA,IAAI,0DAAQ,CAAA,GAAA,iBAAS,EAAE;","sources":["packages/@react-spectrum/overlays/src/index.ts","packages/@react-spectrum/overlays/src/Overlay.tsx","packages/@react-spectrum/overlays/src/OpenTransition.tsx","packages/@react-spectrum/overlays/src/Popover.tsx","packages/@react-spectrum/overlays/src/overlays.css","packages/@adobe/spectrum-css-temp/components/popover/vars.css","packages/@react-spectrum/overlays/src/Underlay.tsx","packages/@adobe/spectrum-css-temp/components/underlay/vars.css","packages/@react-spectrum/overlays/src/Modal.tsx","packages/@adobe/spectrum-css-temp/components/modal/vars.css","packages/@react-spectrum/overlays/src/Tray.tsx","packages/@adobe/spectrum-css-temp/components/tray/vars.css"],"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\n/// <reference types=\"css-module-types\" />\n\nexport {Overlay} from './Overlay';\nexport {Popover} from './Popover';\nexport {Modal} from './Modal';\nexport {Tray} from './Tray';\nexport {OpenTransition} from './OpenTransition';\n","/*\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} from '@react-types/shared';\nimport {OpenTransition} from './OpenTransition';\nimport {OverlayProps} from '@react-types/overlays';\nimport {Provider} from '@react-spectrum/provider';\nimport React, {useCallback, useState} from 'react';\nimport {Overlay as ReactAriaOverlay} from '@react-aria/overlays';\n\nfunction Overlay(props: OverlayProps, ref: DOMRef<HTMLDivElement>) {\n let {children, isOpen, container, onEnter, onEntering, onEntered, onExit, onExiting, onExited, nodeRef} = props;\n let [exited, setExited] = useState(!isOpen);\n\n let handleEntered = useCallback(() => {\n setExited(false);\n if (onEntered) {\n onEntered();\n }\n }, [onEntered]);\n\n let handleExited = useCallback(() => {\n setExited(true);\n if (onExited) {\n onExited();\n }\n }, [onExited]);\n\n // Don't un-render the overlay while it's transitioning out.\n let mountOverlay = isOpen || !exited;\n if (!mountOverlay) {\n // Don't bother showing anything if we don't have to.\n return null;\n }\n\n return (\n <ReactAriaOverlay portalContainer={container}>\n <Provider ref={ref} UNSAFE_style={{background: 'transparent', isolation: 'isolate'}} isDisabled={false}>\n <OpenTransition\n in={isOpen}\n appear\n onExit={onExit}\n onExiting={onExiting}\n onExited={handleExited}\n onEnter={onEnter}\n onEntering={onEntering}\n onEntered={handleEntered}\n nodeRef={nodeRef}>\n {children}\n </OpenTransition>\n </Provider>\n </ReactAriaOverlay>\n );\n}\n\nlet _Overlay = React.forwardRef(Overlay);\nexport {_Overlay as Overlay};\n","/*\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 React from 'react';\nimport {Transition} from 'react-transition-group';\n\nconst OPEN_STATES = {\n entering: false,\n entered: true\n};\n\n/**\n * Timeout issues adding css animations to enter may be related to\n * https://github.com/reactjs/react-transition-group/issues/189 or\n * https://github.com/reactjs/react-transition-group/issues/22\n * my VM isn't good enough to debug accurately and get a better answer.\n *\n * As a result, use enter 0 so that is-open is applied once entered\n * it doesn't matter if we know when the css-animation is done on entering\n * for exiting though, give time for the css-animation to play\n * before removing from the DOM\n * **note** hitting esc bypasses exit animation for anyone testing.\n */\n\nexport function OpenTransition(props) {\n // Do not apply any transition if in chromatic.\n if (process.env.CHROMATIC) {\n return React.Children.map(props.children, child => child && React.cloneElement(child, {isOpen: props.in}));\n }\n\n return (\n <Transition timeout={{enter: 0, exit: 350}} {...props}>\n {(state) => React.Children.map(props.children, child => child && React.cloneElement(child, {isOpen: !!OPEN_STATES[state]}))}\n </Transition>\n );\n}\n","/*\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 {AriaPopoverProps, DismissButton, PopoverAria, usePopover} from '@react-aria/overlays';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef, StyleProps} from '@react-types/shared';\nimport {Overlay} from './Overlay';\nimport {OverlayTriggerState} from '@react-stately/overlays';\nimport overrideStyles from './overlays.css';\nimport React, {forwardRef, MutableRefObject, ReactNode, RefObject, useRef, useState} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/popover/vars.css';\nimport {Underlay} from './Underlay';\nimport {useLayoutEffect} from '@react-aria/utils';\n\ninterface PopoverProps extends Omit<AriaPopoverProps, 'popoverRef' | 'maxHeight'>, StyleProps {\n children: ReactNode,\n hideArrow?: boolean,\n state: OverlayTriggerState\n}\n\ninterface PopoverWrapperProps extends PopoverProps {\n isOpen?: boolean,\n wrapperRef: MutableRefObject<HTMLDivElement>\n}\n\ninterface ArrowProps {\n arrowProps: PopoverAria['arrowProps'],\n isLandscape: boolean,\n arrowRef?: RefObject<SVGSVGElement>,\n primary: number,\n secondary: number,\n borderDiagonal: number\n}\n\n/**\n * Arrow placement can be done pointing right or down because those paths start at 0, x or y. Because the\n * other two don't, they start at a fractional pixel value, it introduces rounding differences between browsers and\n * between display types (retina with subpixels vs not retina). By flipping them with CSS we can ensure that\n * the path always starts at 0 so that it perfectly overlaps the popover's border.\n * See bottom of file for more explanation.\n */\nlet arrowPlacement = {\n left: 'right',\n right: 'right',\n top: 'bottom',\n bottom: 'bottom'\n};\n\nfunction Popover(props: PopoverProps, ref: DOMRef<HTMLDivElement>) {\n let {\n children,\n state,\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n let wrapperRef = useRef<HTMLDivElement>(null);\n\n return (\n <Overlay {...otherProps} isOpen={state.isOpen} nodeRef={wrapperRef}>\n <PopoverWrapper ref={domRef} {...props} wrapperRef={wrapperRef}>\n {children}\n </PopoverWrapper>\n </Overlay>\n );\n}\n\nconst PopoverWrapper = forwardRef((props: PopoverWrapperProps, ref: RefObject<HTMLDivElement>) => {\n let {\n children,\n isOpen,\n hideArrow,\n isNonModal,\n state,\n wrapperRef\n } = props;\n let {styleProps} = useStyleProps(props);\n\n let {size, borderWidth, arrowRef} = useArrowSize();\n const borderRadius = usePopoverBorderRadius(ref);\n let borderDiagonal = borderWidth * Math.SQRT2;\n let primary = size + borderDiagonal;\n let secondary = primary * 2;\n let {popoverProps, arrowProps, underlayProps, placement} = usePopover({\n ...props,\n popoverRef: ref,\n maxHeight: null,\n arrowSize: hideArrow ? 0 : secondary,\n arrowBoundaryOffset: borderRadius\n }, state);\n\n // Attach Transition's nodeRef to outermost wrapper for node.reflow: https://github.com/reactjs/react-transition-group/blob/c89f807067b32eea6f68fd6c622190d88ced82e2/src/Transition.js#L231\n return (\n <div ref={wrapperRef}>\n {!isNonModal && <Underlay isTransparent {...underlayProps} isOpen={isOpen} /> }\n <div\n {...styleProps}\n {...popoverProps}\n style={{\n ...styleProps.style,\n ...popoverProps.style\n }}\n ref={ref}\n className={\n classNames(\n styles,\n 'spectrum-Popover',\n `spectrum-Popover--${placement}`,\n {\n 'spectrum-Popover--withTip': !hideArrow,\n 'is-open': isOpen\n },\n classNames(\n overrideStyles,\n 'spectrum-Popover',\n 'react-spectrum-Popover'\n ),\n styleProps.className\n )\n }\n role=\"presentation\"\n data-testid=\"popover\">\n {!isNonModal && <DismissButton onDismiss={state.close} />}\n {children}\n {hideArrow ? null : (\n <Arrow\n arrowProps={arrowProps}\n isLandscape={arrowPlacement[placement] === 'bottom'}\n arrowRef={arrowRef}\n primary={primary}\n secondary={secondary}\n borderDiagonal={borderDiagonal} />\n )}\n <DismissButton onDismiss={state.close} />\n </div>\n </div>\n );\n});\n\nfunction usePopoverBorderRadius(popoverRef: RefObject<HTMLDivElement>) {\n let [borderRadius, setBorderRadius] = useState(0);\n useLayoutEffect(() => {\n if (popoverRef.current) {\n let spectrumBorderRadius = window.getComputedStyle(popoverRef.current).borderRadius;\n if (spectrumBorderRadius !== '') {\n setBorderRadius(parseInt(spectrumBorderRadius, 10));\n }\n }\n }, [popoverRef]);\n return borderRadius;\n}\n\nfunction useArrowSize() {\n let [size, setSize] = useState(20);\n let [borderWidth, setBorderWidth] = useState(1);\n let arrowRef = useRef<SVGSVGElement>(null);\n // get the css value for the tip size and divide it by 2 for this arrow implementation\n useLayoutEffect(() => {\n if (arrowRef.current) {\n let spectrumTipWidth = window.getComputedStyle(arrowRef.current)\n .getPropertyValue('--spectrum-popover-tip-size');\n if (spectrumTipWidth !== '') {\n setSize(parseInt(spectrumTipWidth, 10) / 2);\n }\n\n let spectrumBorderWidth = window.getComputedStyle(arrowRef.current)\n .getPropertyValue('--spectrum-popover-tip-borderWidth');\n if (spectrumBorderWidth !== '') {\n setBorderWidth(parseInt(spectrumBorderWidth, 10));\n }\n }\n }, []);\n return {size, borderWidth, arrowRef};\n}\n\nfunction Arrow(props: ArrowProps) {\n let {primary, secondary, isLandscape, arrowProps, borderDiagonal, arrowRef} = props;\n let halfBorderDiagonal = borderDiagonal / 2;\n\n let primaryStart = 0;\n let primaryEnd = primary - halfBorderDiagonal;\n\n let secondaryStart = halfBorderDiagonal;\n let secondaryMiddle = secondary / 2;\n let secondaryEnd = secondary - halfBorderDiagonal;\n\n let pathData = isLandscape ? [\n 'M', secondaryStart, primaryStart,\n 'L', secondaryMiddle, primaryEnd,\n 'L', secondaryEnd, primaryStart\n ] : [\n 'M', primaryStart, secondaryStart,\n 'L', primaryEnd, secondaryMiddle,\n 'L', primaryStart, secondaryEnd\n ];\n\n /* use ceil because the svg needs to always accommodate the path inside it */\n return (\n <svg\n xmlns=\"http://www.w3.org/svg/2000\"\n width={Math.ceil(isLandscape ? secondary : primary)}\n height={Math.ceil(isLandscape ? primary : secondary)}\n className={classNames(styles, 'spectrum-Popover-tip')}\n ref={arrowRef}\n {...arrowProps}>\n <path className={classNames(styles, 'spectrum-Popover-tip-triangle')} d={pathData.join(' ')} />\n </svg>\n );\n}\n\nlet _Popover = forwardRef(Popover);\nexport {_Popover as Popover};\n\n/**\n * More explanation on popover tips.\n * - I tried changing the calculation of the popover placement in an effort to get it squarely onto the pixel grid.\n * This did not work because the problem was in the svg partial pixel end of the path in the popover right and popover bottom.\n * - I tried creating an extra 'bandaid' path that matched the background color and would overlap the popover border.\n * This didn't work because the border on the svg triangle didn't extend all the way to match nicely with the popover border.\n * - I tried getting the client bounding box and setting the svg to that partial pixel value\n * This didn't work because again the issue was inside the svg\n * - I didn't try drawing the svg backwards\n * This could still be tried\n * - I tried changing the calculation of the popover placement AND the svg height/width so that they were all rounded\n * This seems to have done the trick.\n */\n","/*\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.spectrum-Popover {\n /* This makes the contents of popovers focusable immediately, without waiting\n a frame for animations to start. */\n &.react-spectrum-Popover {\n visibility: visible;\n }\n\n .spectrum-Dialog-content {\n max-height: initial;\n }\n}\n\n.spectrum-Modal-wrapper.react-spectrum-Modal-wrapper,\n.spectrum-Modal.react-spectrum-Modal {\n visibility: visible;\n}\n\n.spectrum-Tray.react-spectrum-Tray {\n visibility: visible;\n}\n","/*\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@import './index.css';\n@import './skin.css';\n","/*\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 {classNames} from '@react-spectrum/utils';\nimport React from 'react';\nimport underlayStyles from '@adobe/spectrum-css-temp/components/underlay/vars.css';\n\ninterface UnderlayProps {\n isOpen?: boolean,\n isTransparent?: boolean\n}\n\nexport function Underlay({isOpen, isTransparent}: UnderlayProps) {\n return (\n <div className={classNames(underlayStyles, 'spectrum-Underlay', {'is-open': isOpen, 'spectrum-Underlay--transparent': isTransparent})} />\n );\n}\n","/*\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@import './index.css';\n@import './skin.css';\n","/*\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 {AriaModalOverlayProps, useModalOverlay} from '@react-aria/overlays';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef, StyleProps} from '@react-types/shared';\nimport modalStyles from '@adobe/spectrum-css-temp/components/modal/vars.css';\nimport {Overlay} from './Overlay';\nimport {OverlayProps} from '@react-types/overlays';\nimport {OverlayTriggerState} from '@react-stately/overlays';\nimport overrideStyles from './overlays.css';\nimport React, {forwardRef, MutableRefObject, ReactNode, RefObject, useRef} from 'react';\nimport {Underlay} from './Underlay';\nimport {useViewportSize} from '@react-aria/utils';\n\ninterface ModalProps extends AriaModalOverlayProps, StyleProps, Omit<OverlayProps, 'nodeRef' | 'shouldContainFocus'> {\n children: ReactNode,\n state: OverlayTriggerState,\n type?: 'modal' | 'fullscreen' | 'fullscreenTakeover'\n}\n\ninterface ModalWrapperProps extends ModalProps {\n isOpen?: boolean,\n wrapperRef: MutableRefObject<HTMLDivElement>\n}\n\nfunction Modal(props: ModalProps, ref: DOMRef<HTMLDivElement>) {\n let {children, state, ...otherProps} = props;\n let domRef = useDOMRef(ref);\n let wrapperRef = useRef<HTMLDivElement>(null);\n\n return (\n <Overlay {...otherProps} isOpen={state.isOpen} nodeRef={wrapperRef}>\n <ModalWrapper {...props} wrapperRef={wrapperRef} ref={domRef}>\n {children}\n </ModalWrapper>\n </Overlay>\n );\n}\n\nlet typeMap = {\n fullscreen: 'fullscreen',\n fullscreenTakeover: 'fullscreenTakeover'\n};\n\nlet ModalWrapper = forwardRef(function (props: ModalWrapperProps, ref: RefObject<HTMLDivElement>) {\n let {type, children, state, isOpen, wrapperRef} = props;\n let typeVariant = typeMap[type];\n let {styleProps} = useStyleProps(props);\n let {modalProps, underlayProps} = useModalOverlay(props, state, ref);\n\n let wrapperClassName = classNames(\n modalStyles,\n 'spectrum-Modal-wrapper',\n classNames(\n overrideStyles,\n 'spectrum-Modal-wrapper',\n 'react-spectrum-Modal-wrapper'\n )\n );\n\n let modalClassName = classNames(\n modalStyles,\n 'spectrum-Modal',\n {\n 'is-open': isOpen\n },\n classNames(\n overrideStyles,\n 'spectrum-Modal',\n 'react-spectrum-Modal'\n ),\n {[`spectrum-Modal--${typeVariant}`]: typeVariant},\n styleProps.className\n );\n\n let viewport = useViewportSize();\n let style: any = {\n '--spectrum-visual-viewport-height': viewport.height + 'px'\n };\n\n // Attach Transition's nodeRef to outer most wrapper for node.reflow: https://github.com/reactjs/react-transition-group/blob/c89f807067b32eea6f68fd6c622190d88ced82e2/src/Transition.js#L231\n return (\n <div ref={wrapperRef}>\n <Underlay {...underlayProps} isOpen={isOpen} />\n <div className={wrapperClassName} style={style}>\n <div\n {...styleProps}\n {...modalProps}\n ref={ref}\n className={modalClassName}\n data-testid=\"modal\">\n {children}\n </div>\n </div>\n </div>\n );\n});\n\nlet _Modal = forwardRef(Modal);\nexport {_Modal as Modal};\n","/*\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@import './index.css';\n@import './skin.css';\n","/*\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 {AriaModalOverlayProps, DismissButton, useModalOverlay} from '@react-aria/overlays';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef, StyleProps} from '@react-types/shared';\nimport {Overlay} from './Overlay';\nimport {OverlayProps} from '@react-types/overlays';\nimport {OverlayTriggerState} from '@react-stately/overlays';\nimport overrideStyles from './overlays.css';\nimport React, {forwardRef, MutableRefObject, ReactNode, RefObject, useRef} from 'react';\nimport trayStyles from '@adobe/spectrum-css-temp/components/tray/vars.css';\nimport {Underlay} from './Underlay';\nimport {useViewportSize} from '@react-aria/utils';\n\ninterface TrayProps extends AriaModalOverlayProps, StyleProps, Omit<OverlayProps, 'nodeRef' | 'shouldContainFocus'> {\n children: ReactNode,\n state: OverlayTriggerState,\n isFixedHeight?: boolean\n}\n\ninterface TrayWrapperProps extends TrayProps {\n isOpen?: boolean,\n wrapperRef: MutableRefObject<HTMLDivElement>\n}\n\nfunction Tray(props: TrayProps, ref: DOMRef<HTMLDivElement>) {\n let {children, state, ...otherProps} = props;\n let domRef = useDOMRef(ref);\n let wrapperRef = useRef<HTMLDivElement>(null);\n\n return (\n <Overlay {...otherProps} isOpen={state.isOpen} nodeRef={wrapperRef}>\n <TrayWrapper {...props} wrapperRef={wrapperRef} ref={domRef}>\n {children}\n </TrayWrapper>\n </Overlay>\n );\n}\n\nlet TrayWrapper = forwardRef(function (props: TrayWrapperProps, ref: RefObject<HTMLDivElement>) {\n let {\n children,\n isOpen,\n isFixedHeight,\n state,\n wrapperRef\n } = props;\n let {styleProps} = useStyleProps(props);\n\n let {modalProps, underlayProps} = useModalOverlay({\n ...props,\n isDismissable: true\n }, state, ref);\n\n // We need to measure the window's height in JS rather than using percentages in CSS\n // so that contents (e.g. menu) can inherit the max-height properly. Using percentages\n // does not work properly because there is nothing to base the percentage on.\n // We cannot use vh units because mobile browsers adjust the window height dynamically\n // when the address bar/bottom toolbars show and hide on scroll and vh units are fixed.\n // Also, the visual viewport is smaller than the layout viewport when the virtual keyboard\n // is up, so use the VisualViewport API to ensure the tray is displayed above the keyboard.\n let viewport = useViewportSize();\n let wrapperStyle: any = {\n '--spectrum-visual-viewport-height': viewport.height + 'px'\n };\n\n let wrapperClassName = classNames(\n trayStyles,\n 'spectrum-Tray-wrapper'\n );\n\n let className = classNames(\n trayStyles,\n 'spectrum-Tray',\n {\n 'is-open': isOpen,\n 'spectrum-Tray--fixedHeight': isFixedHeight\n },\n classNames(\n overrideStyles,\n 'spectrum-Tray',\n 'react-spectrum-Tray'\n ),\n styleProps.className\n );\n\n // Attach Transition's nodeRef to outer most wrapper for node.reflow: https://github.com/reactjs/react-transition-group/blob/c89f807067b32eea6f68fd6c622190d88ced82e2/src/Transition.js#L231\n return (\n <div ref={wrapperRef}>\n <Underlay {...underlayProps} isOpen={isOpen} />\n <div className={wrapperClassName} style={wrapperStyle}>\n <div\n {...styleProps}\n {...modalProps}\n className={className}\n ref={ref}\n data-testid=\"tray\">\n <DismissButton onDismiss={state.close} />\n {children}\n <DismissButton onDismiss={state.close} />\n </div>\n </div>\n </div>\n );\n});\n\nlet _Tray = forwardRef(Tray);\nexport {_Tray as Tray};\n","/*\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@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;ACAA;;;;;;;;;;CAUC;;AAKD,MAAM,oCAAc;IAClB,UAAU;IACV,SAAS;AACX;AAeO,SAAS,0CAAe,KAAK;QAGU;IAG5C,qBACE,gCAAC,CAAA,GAAA,iBAAS;QAAE,SAAS;YAAC,OAAO;YAAG,MAAM;QAAG;QAAI,GAAG,KAAK;OAClD,CAAC,QAAU,CAAA,GAAA,YAAI,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,UAAU;QACd,WAAW;QACX,KAAK;QACL,eAAY;qBACZ,gCAAC,CAAA,GAAA,oBAAY;QAAE,WAAW,MAAM;QAC/B,wBACD,gCAAC,CAAA,GAAA,oBAAY;QAAE,WAAW,MAAM;;AAK1C;AAEA,IAAI,0DAAQ,CAAA,GAAA,iBAAS,EAAE;;","sources":["packages/@react-spectrum/overlays/src/index.ts","packages/@react-spectrum/overlays/src/Overlay.tsx","packages/@react-spectrum/overlays/src/OpenTransition.tsx","packages/@react-spectrum/overlays/src/Popover.tsx","packages/@react-spectrum/overlays/src/overlays.css","packages/@adobe/spectrum-css-temp/components/popover/vars.css","packages/@react-spectrum/overlays/src/Underlay.tsx","packages/@adobe/spectrum-css-temp/components/underlay/vars.css","packages/@react-spectrum/overlays/src/Modal.tsx","packages/@adobe/spectrum-css-temp/components/modal/vars.css","packages/@react-spectrum/overlays/src/Tray.tsx","packages/@adobe/spectrum-css-temp/components/tray/vars.css"],"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\n/// <reference types=\"css-module-types\" />\n\nexport {Overlay} from './Overlay';\nexport {Popover} from './Popover';\nexport {Modal} from './Modal';\nexport {Tray} from './Tray';\nexport {OpenTransition} from './OpenTransition';\n","/*\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} from '@react-types/shared';\nimport {OpenTransition} from './OpenTransition';\nimport {OverlayProps} from '@react-types/overlays';\nimport {Provider} from '@react-spectrum/provider';\nimport React, {useCallback, useState} from 'react';\nimport {Overlay as ReactAriaOverlay} from '@react-aria/overlays';\n\nfunction Overlay(props: OverlayProps, ref: DOMRef<HTMLDivElement>) {\n let {\n children,\n isOpen,\n disableFocusManagement,\n container,\n onEnter,\n onEntering,\n onEntered,\n onExit,\n onExiting,\n onExited,\n nodeRef\n } = props;\n let [exited, setExited] = useState(!isOpen);\n\n let handleEntered = useCallback(() => {\n setExited(false);\n if (onEntered) {\n onEntered();\n }\n }, [onEntered]);\n\n let handleExited = useCallback(() => {\n setExited(true);\n if (onExited) {\n onExited();\n }\n }, [onExited]);\n\n // Don't un-render the overlay while it's transitioning out.\n let mountOverlay = isOpen || !exited;\n if (!mountOverlay) {\n // Don't bother showing anything if we don't have to.\n return null;\n }\n\n return (\n <ReactAriaOverlay portalContainer={container} disableFocusManagement={disableFocusManagement} isExiting={!isOpen}>\n <Provider ref={ref} UNSAFE_style={{background: 'transparent', isolation: 'isolate'}} isDisabled={false}>\n <OpenTransition\n in={isOpen}\n appear\n onExit={onExit}\n onExiting={onExiting}\n onExited={handleExited}\n onEnter={onEnter}\n onEntering={onEntering}\n onEntered={handleEntered}\n nodeRef={nodeRef}>\n {children}\n </OpenTransition>\n </Provider>\n </ReactAriaOverlay>\n );\n}\n\nlet _Overlay = React.forwardRef(Overlay);\nexport {_Overlay as Overlay};\n","/*\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 React from 'react';\nimport {Transition} from 'react-transition-group';\n\nconst OPEN_STATES = {\n entering: false,\n entered: true\n};\n\n/**\n * Timeout issues adding css animations to enter may be related to\n * https://github.com/reactjs/react-transition-group/issues/189 or\n * https://github.com/reactjs/react-transition-group/issues/22\n * my VM isn't good enough to debug accurately and get a better answer.\n *\n * As a result, use enter 0 so that is-open is applied once entered\n * it doesn't matter if we know when the css-animation is done on entering\n * for exiting though, give time for the css-animation to play\n * before removing from the DOM\n * **note** hitting esc bypasses exit animation for anyone testing.\n */\n\nexport function OpenTransition(props) {\n // Do not apply any transition if in chromatic.\n if (process.env.CHROMATIC) {\n return React.Children.map(props.children, child => child && React.cloneElement(child, {isOpen: props.in}));\n }\n\n return (\n <Transition timeout={{enter: 0, exit: 350}} {...props}>\n {(state) => React.Children.map(props.children, child => child && React.cloneElement(child, {isOpen: !!OPEN_STATES[state]}))}\n </Transition>\n );\n}\n","/*\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 {AriaPopoverProps, DismissButton, PopoverAria, usePopover} from '@react-aria/overlays';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef, StyleProps} from '@react-types/shared';\nimport {FocusWithinProps, useFocusWithin} from '@react-aria/interactions';\nimport {mergeProps, useLayoutEffect} from '@react-aria/utils';\nimport {Overlay} from './Overlay';\nimport {OverlayTriggerState} from '@react-stately/overlays';\nimport overrideStyles from './overlays.css';\nimport React, {forwardRef, MutableRefObject, ReactNode, RefObject, useRef, useState} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/popover/vars.css';\nimport {Underlay} from './Underlay';\n\ninterface PopoverProps extends Omit<AriaPopoverProps, 'popoverRef' | 'maxHeight'>, FocusWithinProps, StyleProps {\n children: ReactNode,\n hideArrow?: boolean,\n state: OverlayTriggerState,\n shouldContainFocus?: boolean,\n onEntering?: () => void,\n onEnter?: () => void,\n onEntered?: () => void,\n onExiting?: () => void,\n onExited?: () => void,\n onExit?: () => void,\n container?: HTMLElement,\n disableFocusManagement?: boolean,\n enableBothDismissButtons?: boolean\n}\n\ninterface PopoverWrapperProps extends PopoverProps, FocusWithinProps {\n isOpen?: boolean,\n wrapperRef: MutableRefObject<HTMLDivElement>\n}\n\ninterface ArrowProps {\n arrowProps: PopoverAria['arrowProps'],\n isLandscape: boolean,\n arrowRef?: RefObject<SVGSVGElement>,\n primary: number,\n secondary: number,\n borderDiagonal: number\n}\n\n/**\n * Arrow placement can be done pointing right or down because those paths start at 0, x or y. Because the\n * other two don't, they start at a fractional pixel value, it introduces rounding differences between browsers and\n * between display types (retina with subpixels vs not retina). By flipping them with CSS we can ensure that\n * the path always starts at 0 so that it perfectly overlaps the popover's border.\n * See bottom of file for more explanation.\n */\nlet arrowPlacement = {\n left: 'right',\n right: 'right',\n top: 'bottom',\n bottom: 'bottom'\n};\n\nfunction Popover(props: PopoverProps, ref: DOMRef<HTMLDivElement>) {\n let {\n children,\n state,\n ...otherProps\n } = props;\n let domRef = useDOMRef(ref);\n let wrapperRef = useRef<HTMLDivElement>(null);\n\n return (\n <Overlay {...otherProps} isOpen={state.isOpen} nodeRef={wrapperRef}>\n <PopoverWrapper ref={domRef} {...props} wrapperRef={wrapperRef}>\n {children}\n </PopoverWrapper>\n </Overlay>\n );\n}\n\nconst PopoverWrapper = forwardRef((props: PopoverWrapperProps, ref: RefObject<HTMLDivElement>) => {\n let {\n children,\n isOpen,\n hideArrow,\n isNonModal,\n enableBothDismissButtons,\n state,\n wrapperRef\n } = props;\n let {styleProps} = useStyleProps(props);\n\n let {size, borderWidth, arrowRef} = useArrowSize();\n const borderRadius = usePopoverBorderRadius(ref);\n let borderDiagonal = borderWidth * Math.SQRT2;\n let primary = size + borderDiagonal;\n let secondary = primary * 2;\n let {\n popoverProps,\n arrowProps,\n underlayProps,\n placement\n } = usePopover({\n ...props,\n popoverRef: ref,\n maxHeight: null,\n arrowSize: hideArrow ? 0 : secondary,\n arrowBoundaryOffset: borderRadius\n }, state);\n let {focusWithinProps} = useFocusWithin(props);\n\n // Attach Transition's nodeRef to outermost wrapper for node.reflow: https://github.com/reactjs/react-transition-group/blob/c89f807067b32eea6f68fd6c622190d88ced82e2/src/Transition.js#L231\n return (\n <div ref={wrapperRef}>\n {!isNonModal && <Underlay isTransparent {...underlayProps} isOpen={isOpen} /> }\n <div\n {...styleProps}\n {...mergeProps(popoverProps, focusWithinProps)}\n style={{\n ...styleProps.style,\n ...popoverProps.style\n }}\n ref={ref}\n className={\n classNames(\n styles,\n 'spectrum-Popover',\n `spectrum-Popover--${placement}`,\n {\n 'spectrum-Popover--withTip': !hideArrow,\n 'is-open': isOpen\n },\n classNames(\n overrideStyles,\n 'spectrum-Popover',\n 'react-spectrum-Popover'\n ),\n styleProps.className\n )\n }\n role=\"presentation\"\n data-testid=\"popover\">\n {(!isNonModal || enableBothDismissButtons) && <DismissButton onDismiss={state.close} />}\n {children}\n {hideArrow ? null : (\n <Arrow\n arrowProps={arrowProps}\n isLandscape={arrowPlacement[placement] === 'bottom'}\n arrowRef={arrowRef}\n primary={primary}\n secondary={secondary}\n borderDiagonal={borderDiagonal} />\n )}\n <DismissButton onDismiss={state.close} />\n </div>\n </div>\n );\n});\n\nfunction usePopoverBorderRadius(popoverRef: RefObject<HTMLDivElement>) {\n let [borderRadius, setBorderRadius] = useState(0);\n useLayoutEffect(() => {\n if (popoverRef.current) {\n let spectrumBorderRadius = window.getComputedStyle(popoverRef.current).borderRadius;\n if (spectrumBorderRadius !== '') {\n setBorderRadius(parseInt(spectrumBorderRadius, 10));\n }\n }\n }, [popoverRef]);\n return borderRadius;\n}\n\nfunction useArrowSize() {\n let [size, setSize] = useState(20);\n let [borderWidth, setBorderWidth] = useState(1);\n let arrowRef = useRef<SVGSVGElement>(null);\n // get the css value for the tip size and divide it by 2 for this arrow implementation\n useLayoutEffect(() => {\n if (arrowRef.current) {\n let spectrumTipWidth = window.getComputedStyle(arrowRef.current)\n .getPropertyValue('--spectrum-popover-tip-size');\n if (spectrumTipWidth !== '') {\n setSize(parseInt(spectrumTipWidth, 10) / 2);\n }\n\n let spectrumBorderWidth = window.getComputedStyle(arrowRef.current)\n .getPropertyValue('--spectrum-popover-tip-borderWidth');\n if (spectrumBorderWidth !== '') {\n setBorderWidth(parseInt(spectrumBorderWidth, 10));\n }\n }\n }, []);\n return {size, borderWidth, arrowRef};\n}\n\nfunction Arrow(props: ArrowProps) {\n let {primary, secondary, isLandscape, arrowProps, borderDiagonal, arrowRef} = props;\n let halfBorderDiagonal = borderDiagonal / 2;\n\n let primaryStart = 0;\n let primaryEnd = primary - halfBorderDiagonal;\n\n let secondaryStart = halfBorderDiagonal;\n let secondaryMiddle = secondary / 2;\n let secondaryEnd = secondary - halfBorderDiagonal;\n\n let pathData = isLandscape ? [\n 'M', secondaryStart, primaryStart,\n 'L', secondaryMiddle, primaryEnd,\n 'L', secondaryEnd, primaryStart\n ] : [\n 'M', primaryStart, secondaryStart,\n 'L', primaryEnd, secondaryMiddle,\n 'L', primaryStart, secondaryEnd\n ];\n\n /* use ceil because the svg needs to always accommodate the path inside it */\n return (\n <svg\n xmlns=\"http://www.w3.org/svg/2000\"\n width={Math.ceil(isLandscape ? secondary : primary)}\n height={Math.ceil(isLandscape ? primary : secondary)}\n className={classNames(styles, 'spectrum-Popover-tip')}\n ref={arrowRef}\n {...arrowProps}>\n <path className={classNames(styles, 'spectrum-Popover-tip-triangle')} d={pathData.join(' ')} />\n </svg>\n );\n}\n\nlet _Popover = forwardRef(Popover);\nexport {_Popover as Popover};\n\n/**\n * More explanation on popover tips.\n * - I tried changing the calculation of the popover placement in an effort to get it squarely onto the pixel grid.\n * This did not work because the problem was in the svg partial pixel end of the path in the popover right and popover bottom.\n * - I tried creating an extra 'bandaid' path that matched the background color and would overlap the popover border.\n * This didn't work because the border on the svg triangle didn't extend all the way to match nicely with the popover border.\n * - I tried getting the client bounding box and setting the svg to that partial pixel value\n * This didn't work because again the issue was inside the svg\n * - I didn't try drawing the svg backwards\n * This could still be tried\n * - I tried changing the calculation of the popover placement AND the svg height/width so that they were all rounded\n * This seems to have done the trick.\n */\n","/*\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.spectrum-Popover {\n /* This makes the contents of popovers focusable immediately, without waiting\n a frame for animations to start. */\n &.react-spectrum-Popover {\n visibility: visible;\n }\n\n .spectrum-Dialog-content {\n max-height: initial;\n }\n}\n\n.spectrum-Modal-wrapper.react-spectrum-Modal-wrapper,\n.spectrum-Modal.react-spectrum-Modal {\n visibility: visible;\n}\n\n.spectrum-Tray.react-spectrum-Tray {\n visibility: visible;\n}\n","/*\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@import './index.css';\n@import './skin.css';\n","/*\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 {classNames} from '@react-spectrum/utils';\nimport React from 'react';\nimport underlayStyles from '@adobe/spectrum-css-temp/components/underlay/vars.css';\n\ninterface UnderlayProps {\n isOpen?: boolean,\n isTransparent?: boolean\n}\n\nexport function Underlay({isOpen, isTransparent}: UnderlayProps) {\n return (\n <div className={classNames(underlayStyles, 'spectrum-Underlay', {'is-open': isOpen, 'spectrum-Underlay--transparent': isTransparent})} />\n );\n}\n","/*\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@import './index.css';\n@import './skin.css';\n","/*\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 {AriaModalOverlayProps, useModalOverlay} from '@react-aria/overlays';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef, StyleProps} from '@react-types/shared';\nimport modalStyles from '@adobe/spectrum-css-temp/components/modal/vars.css';\nimport {Overlay} from './Overlay';\nimport {OverlayProps} from '@react-types/overlays';\nimport {OverlayTriggerState} from '@react-stately/overlays';\nimport overrideStyles from './overlays.css';\nimport React, {forwardRef, MutableRefObject, ReactNode, RefObject, useRef} from 'react';\nimport {Underlay} from './Underlay';\nimport {useViewportSize} from '@react-aria/utils';\n\ninterface ModalProps extends AriaModalOverlayProps, StyleProps, Omit<OverlayProps, 'nodeRef' | 'shouldContainFocus'> {\n children: ReactNode,\n state: OverlayTriggerState,\n type?: 'modal' | 'fullscreen' | 'fullscreenTakeover'\n}\n\ninterface ModalWrapperProps extends ModalProps {\n isOpen?: boolean,\n wrapperRef: MutableRefObject<HTMLDivElement>\n}\n\nfunction Modal(props: ModalProps, ref: DOMRef<HTMLDivElement>) {\n let {children, state, ...otherProps} = props;\n let domRef = useDOMRef(ref);\n let wrapperRef = useRef<HTMLDivElement>(null);\n\n return (\n <Overlay {...otherProps} isOpen={state.isOpen} nodeRef={wrapperRef}>\n <ModalWrapper {...props} wrapperRef={wrapperRef} ref={domRef}>\n {children}\n </ModalWrapper>\n </Overlay>\n );\n}\n\nlet typeMap = {\n fullscreen: 'fullscreen',\n fullscreenTakeover: 'fullscreenTakeover'\n};\n\nlet ModalWrapper = forwardRef(function (props: ModalWrapperProps, ref: RefObject<HTMLDivElement>) {\n let {type, children, state, isOpen, wrapperRef} = props;\n let typeVariant = typeMap[type];\n let {styleProps} = useStyleProps(props);\n let {modalProps, underlayProps} = useModalOverlay(props, state, ref);\n\n let wrapperClassName = classNames(\n modalStyles,\n 'spectrum-Modal-wrapper',\n classNames(\n overrideStyles,\n 'spectrum-Modal-wrapper',\n 'react-spectrum-Modal-wrapper'\n )\n );\n\n let modalClassName = classNames(\n modalStyles,\n 'spectrum-Modal',\n {\n 'is-open': isOpen\n },\n classNames(\n overrideStyles,\n 'spectrum-Modal',\n 'react-spectrum-Modal'\n ),\n {[`spectrum-Modal--${typeVariant}`]: typeVariant},\n styleProps.className\n );\n\n let viewport = useViewportSize();\n let style: any = {\n '--spectrum-visual-viewport-height': viewport.height + 'px'\n };\n\n // Attach Transition's nodeRef to outer most wrapper for node.reflow: https://github.com/reactjs/react-transition-group/blob/c89f807067b32eea6f68fd6c622190d88ced82e2/src/Transition.js#L231\n return (\n <div ref={wrapperRef}>\n <Underlay {...underlayProps} isOpen={isOpen} />\n <div className={wrapperClassName} style={style}>\n <div\n {...styleProps}\n {...modalProps}\n ref={ref}\n className={modalClassName}\n data-testid=\"modal\">\n {children}\n </div>\n </div>\n </div>\n );\n});\n\nlet _Modal = forwardRef(Modal);\nexport {_Modal as Modal};\n","/*\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@import './index.css';\n@import './skin.css';\n","/*\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 {AriaModalOverlayProps, DismissButton, useModalOverlay} from '@react-aria/overlays';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef, StyleProps} from '@react-types/shared';\nimport {Overlay} from './Overlay';\nimport {OverlayProps} from '@react-types/overlays';\nimport {OverlayTriggerState} from '@react-stately/overlays';\nimport overrideStyles from './overlays.css';\nimport React, {forwardRef, MutableRefObject, ReactNode, RefObject, useRef} from 'react';\nimport trayStyles from '@adobe/spectrum-css-temp/components/tray/vars.css';\nimport {Underlay} from './Underlay';\nimport {useViewportSize} from '@react-aria/utils';\n\ninterface TrayProps extends AriaModalOverlayProps, StyleProps, Omit<OverlayProps, 'nodeRef' | 'shouldContainFocus'> {\n children: ReactNode,\n state: OverlayTriggerState,\n isFixedHeight?: boolean\n}\n\ninterface TrayWrapperProps extends TrayProps {\n isOpen?: boolean,\n wrapperRef: MutableRefObject<HTMLDivElement>\n}\n\nfunction Tray(props: TrayProps, ref: DOMRef<HTMLDivElement>) {\n let {children, state, ...otherProps} = props;\n let domRef = useDOMRef(ref);\n let wrapperRef = useRef<HTMLDivElement>(null);\n\n return (\n <Overlay {...otherProps} isOpen={state.isOpen} nodeRef={wrapperRef}>\n <TrayWrapper {...props} wrapperRef={wrapperRef} ref={domRef}>\n {children}\n </TrayWrapper>\n </Overlay>\n );\n}\n\nlet TrayWrapper = forwardRef(function (props: TrayWrapperProps, ref: RefObject<HTMLDivElement>) {\n let {\n children,\n isOpen,\n isFixedHeight,\n state,\n wrapperRef\n } = props;\n let {styleProps} = useStyleProps(props);\n\n let {modalProps, underlayProps} = useModalOverlay({\n ...props,\n isDismissable: true\n }, state, ref);\n\n // We need to measure the window's height in JS rather than using percentages in CSS\n // so that contents (e.g. menu) can inherit the max-height properly. Using percentages\n // does not work properly because there is nothing to base the percentage on.\n // We cannot use vh units because mobile browsers adjust the window height dynamically\n // when the address bar/bottom toolbars show and hide on scroll and vh units are fixed.\n // Also, the visual viewport is smaller than the layout viewport when the virtual keyboard\n // is up, so use the VisualViewport API to ensure the tray is displayed above the keyboard.\n let viewport = useViewportSize();\n let wrapperStyle: any = {\n '--spectrum-visual-viewport-height': viewport.height + 'px'\n };\n\n let wrapperClassName = classNames(\n trayStyles,\n 'spectrum-Tray-wrapper'\n );\n\n let className = classNames(\n trayStyles,\n 'spectrum-Tray',\n {\n 'is-open': isOpen,\n 'spectrum-Tray--fixedHeight': isFixedHeight\n },\n classNames(\n overrideStyles,\n 'spectrum-Tray',\n 'react-spectrum-Tray'\n ),\n styleProps.className\n );\n\n // Attach Transition's nodeRef to outer most wrapper for node.reflow: https://github.com/reactjs/react-transition-group/blob/c89f807067b32eea6f68fd6c622190d88ced82e2/src/Transition.js#L231\n return (\n <div ref={wrapperRef}>\n <Underlay {...underlayProps} isOpen={isOpen} />\n <div className={wrapperClassName} style={wrapperStyle}>\n <div\n {...styleProps}\n {...modalProps}\n className={className}\n ref={ref}\n data-testid=\"tray\">\n <DismissButton onDismiss={state.close} />\n {children}\n <DismissButton onDismiss={state.close} />\n </div>\n </div>\n </div>\n );\n});\n\nlet _Tray = forwardRef(Tray);\nexport {_Tray as Tray};\n","/*\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@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"module.js.map"}
|
package/dist/types.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { OverlayProps } from "@react-types/overlays";
|
|
|
2
2
|
import React, { ReactNode } from "react";
|
|
3
3
|
import { AriaPopoverProps, AriaModalOverlayProps } from "@react-aria/overlays";
|
|
4
4
|
import { StyleProps } from "@react-types/shared";
|
|
5
|
+
import { FocusWithinProps } from "@react-aria/interactions";
|
|
5
6
|
import { OverlayTriggerState } from "@react-stately/overlays";
|
|
6
7
|
/**
|
|
7
8
|
* Timeout issues adding css animations to enter may be related to
|
|
@@ -17,10 +18,20 @@ import { OverlayTriggerState } from "@react-stately/overlays";
|
|
|
17
18
|
*/
|
|
18
19
|
export function OpenTransition(props: any): any;
|
|
19
20
|
export let Overlay: React.ForwardRefExoticComponent<OverlayProps & React.RefAttributes<import("@react-types/shared").DOMRefValue<HTMLDivElement>>>;
|
|
20
|
-
interface PopoverProps extends Omit<AriaPopoverProps, 'popoverRef' | 'maxHeight'>, StyleProps {
|
|
21
|
+
interface PopoverProps extends Omit<AriaPopoverProps, 'popoverRef' | 'maxHeight'>, FocusWithinProps, StyleProps {
|
|
21
22
|
children: ReactNode;
|
|
22
23
|
hideArrow?: boolean;
|
|
23
24
|
state: OverlayTriggerState;
|
|
25
|
+
shouldContainFocus?: boolean;
|
|
26
|
+
onEntering?: () => void;
|
|
27
|
+
onEnter?: () => void;
|
|
28
|
+
onEntered?: () => void;
|
|
29
|
+
onExiting?: () => void;
|
|
30
|
+
onExited?: () => void;
|
|
31
|
+
onExit?: () => void;
|
|
32
|
+
container?: HTMLElement;
|
|
33
|
+
disableFocusManagement?: boolean;
|
|
34
|
+
enableBothDismissButtons?: boolean;
|
|
24
35
|
}
|
|
25
36
|
export let Popover: React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<import("@react-types/shared").DOMRefValue<HTMLDivElement>>>;
|
|
26
37
|
interface ModalProps extends AriaModalOverlayProps, StyleProps, Omit<OverlayProps, 'nodeRef' | 'shouldContainFocus'> {
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;AAoBA;;;;;;;;;;;GAWG;AAEH,+BAA+B,KAAK,KAAA,OAWnC;ACgCD,OAAA,IAAI,uIAAoC,CAAC;AEpDzC,sBAAuB,SAAQ,IAAI,CAAC,gBAAgB,EAAE,YAAY,GAAG,WAAW,CAAC,EAAE,gBAAgB,EAAE,UAAU;IAC7G,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,mBAAmB,CAAC;IAC3B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,wBAAwB,CAAC,EAAE,OAAO,CAAA;CACnC;AAsMD,OAAA,IAAI,uIAA8B,CAAC;ACpNnC,oBAAqB,SAAQ,qBAAqB,EAAE,UAAU,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,oBAAoB,CAAC;IAClH,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,mBAAmB,CAAC;IAC3B,IAAI,CAAC,EAAE,OAAO,GAAG,YAAY,GAAG,oBAAoB,CAAA;CACrD;AAgFD,OAAA,IAAI,mIAA0B,CAAC;ACpF/B,mBAAoB,SAAQ,qBAAqB,EAAE,UAAU,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,oBAAoB,CAAC;IACjH,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,mBAAmB,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAwFD,OAAA,IAAI,iIAAwB,CAAC","sources":["packages/@react-spectrum/overlays/src/packages/@react-spectrum/overlays/src/OpenTransition.tsx","packages/@react-spectrum/overlays/src/packages/@react-spectrum/overlays/src/Overlay.tsx","packages/@react-spectrum/overlays/src/packages/@react-spectrum/overlays/src/Underlay.tsx","packages/@react-spectrum/overlays/src/packages/@react-spectrum/overlays/src/Popover.tsx","packages/@react-spectrum/overlays/src/packages/@react-spectrum/overlays/src/Modal.tsx","packages/@react-spectrum/overlays/src/packages/@react-spectrum/overlays/src/Tray.tsx","packages/@react-spectrum/overlays/src/packages/@react-spectrum/overlays/src/index.ts","packages/@react-spectrum/overlays/src/index.ts"],"sourcesContent":[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 {Overlay} from './Overlay';\nexport {Popover} from './Popover';\nexport {Modal} from './Modal';\nexport {Tray} from './Tray';\nexport {OpenTransition} from './OpenTransition';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/overlays",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -36,13 +36,14 @@
|
|
|
36
36
|
"url": "https://github.com/adobe/react-spectrum"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@react-aria/
|
|
40
|
-
"@react-aria/
|
|
41
|
-
"@react-
|
|
42
|
-
"@react-
|
|
43
|
-
"@react-
|
|
44
|
-
"@react-types/
|
|
45
|
-
"@
|
|
39
|
+
"@react-aria/interactions": "^3.17.0",
|
|
40
|
+
"@react-aria/overlays": "^3.16.0",
|
|
41
|
+
"@react-aria/utils": "^3.19.0",
|
|
42
|
+
"@react-spectrum/utils": "^3.10.1",
|
|
43
|
+
"@react-stately/overlays": "^3.6.1",
|
|
44
|
+
"@react-types/overlays": "^3.8.1",
|
|
45
|
+
"@react-types/shared": "^3.19.0",
|
|
46
|
+
"@swc/helpers": "^0.5.0",
|
|
46
47
|
"react-transition-group": "^4.4.5"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
@@ -56,5 +57,5 @@
|
|
|
56
57
|
"publishConfig": {
|
|
57
58
|
"access": "public"
|
|
58
59
|
},
|
|
59
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "d4dfe4bb842a914f10045ee63fc6b92f034c5b30"
|
|
60
61
|
}
|
package/src/Overlay.tsx
CHANGED
|
@@ -18,7 +18,19 @@ import React, {useCallback, useState} from 'react';
|
|
|
18
18
|
import {Overlay as ReactAriaOverlay} from '@react-aria/overlays';
|
|
19
19
|
|
|
20
20
|
function Overlay(props: OverlayProps, ref: DOMRef<HTMLDivElement>) {
|
|
21
|
-
let {
|
|
21
|
+
let {
|
|
22
|
+
children,
|
|
23
|
+
isOpen,
|
|
24
|
+
disableFocusManagement,
|
|
25
|
+
container,
|
|
26
|
+
onEnter,
|
|
27
|
+
onEntering,
|
|
28
|
+
onEntered,
|
|
29
|
+
onExit,
|
|
30
|
+
onExiting,
|
|
31
|
+
onExited,
|
|
32
|
+
nodeRef
|
|
33
|
+
} = props;
|
|
22
34
|
let [exited, setExited] = useState(!isOpen);
|
|
23
35
|
|
|
24
36
|
let handleEntered = useCallback(() => {
|
|
@@ -43,7 +55,7 @@ function Overlay(props: OverlayProps, ref: DOMRef<HTMLDivElement>) {
|
|
|
43
55
|
}
|
|
44
56
|
|
|
45
57
|
return (
|
|
46
|
-
<ReactAriaOverlay portalContainer={container}>
|
|
58
|
+
<ReactAriaOverlay portalContainer={container} disableFocusManagement={disableFocusManagement} isExiting={!isOpen}>
|
|
47
59
|
<Provider ref={ref} UNSAFE_style={{background: 'transparent', isolation: 'isolate'}} isDisabled={false}>
|
|
48
60
|
<OpenTransition
|
|
49
61
|
in={isOpen}
|
package/src/Popover.tsx
CHANGED
|
@@ -13,21 +13,32 @@
|
|
|
13
13
|
import {AriaPopoverProps, DismissButton, PopoverAria, usePopover} from '@react-aria/overlays';
|
|
14
14
|
import {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';
|
|
15
15
|
import {DOMRef, StyleProps} from '@react-types/shared';
|
|
16
|
+
import {FocusWithinProps, useFocusWithin} from '@react-aria/interactions';
|
|
17
|
+
import {mergeProps, useLayoutEffect} from '@react-aria/utils';
|
|
16
18
|
import {Overlay} from './Overlay';
|
|
17
19
|
import {OverlayTriggerState} from '@react-stately/overlays';
|
|
18
20
|
import overrideStyles from './overlays.css';
|
|
19
21
|
import React, {forwardRef, MutableRefObject, ReactNode, RefObject, useRef, useState} from 'react';
|
|
20
22
|
import styles from '@adobe/spectrum-css-temp/components/popover/vars.css';
|
|
21
23
|
import {Underlay} from './Underlay';
|
|
22
|
-
import {useLayoutEffect} from '@react-aria/utils';
|
|
23
24
|
|
|
24
|
-
interface PopoverProps extends Omit<AriaPopoverProps, 'popoverRef' | 'maxHeight'>, StyleProps {
|
|
25
|
+
interface PopoverProps extends Omit<AriaPopoverProps, 'popoverRef' | 'maxHeight'>, FocusWithinProps, StyleProps {
|
|
25
26
|
children: ReactNode,
|
|
26
27
|
hideArrow?: boolean,
|
|
27
|
-
state: OverlayTriggerState
|
|
28
|
+
state: OverlayTriggerState,
|
|
29
|
+
shouldContainFocus?: boolean,
|
|
30
|
+
onEntering?: () => void,
|
|
31
|
+
onEnter?: () => void,
|
|
32
|
+
onEntered?: () => void,
|
|
33
|
+
onExiting?: () => void,
|
|
34
|
+
onExited?: () => void,
|
|
35
|
+
onExit?: () => void,
|
|
36
|
+
container?: HTMLElement,
|
|
37
|
+
disableFocusManagement?: boolean,
|
|
38
|
+
enableBothDismissButtons?: boolean
|
|
28
39
|
}
|
|
29
40
|
|
|
30
|
-
interface PopoverWrapperProps extends PopoverProps {
|
|
41
|
+
interface PopoverWrapperProps extends PopoverProps, FocusWithinProps {
|
|
31
42
|
isOpen?: boolean,
|
|
32
43
|
wrapperRef: MutableRefObject<HTMLDivElement>
|
|
33
44
|
}
|
|
@@ -79,6 +90,7 @@ const PopoverWrapper = forwardRef((props: PopoverWrapperProps, ref: RefObject<HT
|
|
|
79
90
|
isOpen,
|
|
80
91
|
hideArrow,
|
|
81
92
|
isNonModal,
|
|
93
|
+
enableBothDismissButtons,
|
|
82
94
|
state,
|
|
83
95
|
wrapperRef
|
|
84
96
|
} = props;
|
|
@@ -89,13 +101,19 @@ const PopoverWrapper = forwardRef((props: PopoverWrapperProps, ref: RefObject<HT
|
|
|
89
101
|
let borderDiagonal = borderWidth * Math.SQRT2;
|
|
90
102
|
let primary = size + borderDiagonal;
|
|
91
103
|
let secondary = primary * 2;
|
|
92
|
-
let {
|
|
104
|
+
let {
|
|
105
|
+
popoverProps,
|
|
106
|
+
arrowProps,
|
|
107
|
+
underlayProps,
|
|
108
|
+
placement
|
|
109
|
+
} = usePopover({
|
|
93
110
|
...props,
|
|
94
111
|
popoverRef: ref,
|
|
95
112
|
maxHeight: null,
|
|
96
113
|
arrowSize: hideArrow ? 0 : secondary,
|
|
97
114
|
arrowBoundaryOffset: borderRadius
|
|
98
115
|
}, state);
|
|
116
|
+
let {focusWithinProps} = useFocusWithin(props);
|
|
99
117
|
|
|
100
118
|
// Attach Transition's nodeRef to outermost wrapper for node.reflow: https://github.com/reactjs/react-transition-group/blob/c89f807067b32eea6f68fd6c622190d88ced82e2/src/Transition.js#L231
|
|
101
119
|
return (
|
|
@@ -103,7 +121,7 @@ const PopoverWrapper = forwardRef((props: PopoverWrapperProps, ref: RefObject<HT
|
|
|
103
121
|
{!isNonModal && <Underlay isTransparent {...underlayProps} isOpen={isOpen} /> }
|
|
104
122
|
<div
|
|
105
123
|
{...styleProps}
|
|
106
|
-
{...popoverProps}
|
|
124
|
+
{...mergeProps(popoverProps, focusWithinProps)}
|
|
107
125
|
style={{
|
|
108
126
|
...styleProps.style,
|
|
109
127
|
...popoverProps.style
|
|
@@ -128,7 +146,7 @@ const PopoverWrapper = forwardRef((props: PopoverWrapperProps, ref: RefObject<HT
|
|
|
128
146
|
}
|
|
129
147
|
role="presentation"
|
|
130
148
|
data-testid="popover">
|
|
131
|
-
{!isNonModal && <DismissButton onDismiss={state.close} />}
|
|
149
|
+
{(!isNonModal || enableBothDismissButtons) && <DismissButton onDismiss={state.close} />}
|
|
132
150
|
{children}
|
|
133
151
|
{hideArrow ? null : (
|
|
134
152
|
<Arrow
|