@zendeskgarden/react-modals 9.11.3 → 9.12.1
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/esm/elements/TooltipDialog/TooltipDialog.js +12 -3
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +12 -0
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/construct.js +18 -0
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/extends.js +17 -0
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js +13 -0
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +13 -0
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/isNativeFunction.js +15 -0
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js +16 -0
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +13 -0
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js +35 -0
- package/dist/esm/node_modules/polished/dist/polished.esm.js +694 -0
- package/dist/esm/styled/StyledBackdrop.js +1 -1
- package/dist/esm/styled/StyledBody.js +1 -1
- package/dist/esm/styled/StyledClose.js +1 -1
- package/dist/esm/styled/StyledDrawer.js +1 -1
- package/dist/esm/styled/StyledDrawerBody.js +1 -1
- package/dist/esm/styled/StyledDrawerClose.js +1 -1
- package/dist/esm/styled/StyledDrawerFooter.js +1 -1
- package/dist/esm/styled/StyledDrawerFooterItem.js +1 -1
- package/dist/esm/styled/StyledDrawerHeader.js +1 -1
- package/dist/esm/styled/StyledFooter.js +1 -1
- package/dist/esm/styled/StyledFooterItem.js +1 -1
- package/dist/esm/styled/StyledHeader.js +1 -1
- package/dist/esm/styled/StyledModal.js +1 -1
- package/dist/esm/styled/StyledTooltipDialog.js +1 -1
- package/dist/esm/styled/StyledTooltipDialogBackdrop.js +3 -2
- package/dist/esm/styled/StyledTooltipDialogBody.js +1 -1
- package/dist/esm/styled/StyledTooltipDialogClose.js +1 -1
- package/dist/esm/styled/StyledTooltipDialogFooter.js +1 -1
- package/dist/esm/styled/StyledTooltipDialogFooterItem.js +1 -1
- package/dist/esm/styled/StyledTooltipDialogTitle.js +1 -1
- package/dist/index.cjs.js +796 -26
- package/dist/typings/elements/TooltipDialog/TooltipDialog.d.ts +6 -0
- package/dist/typings/types/index.d.ts +4 -0
- package/package.json +4 -4
|
@@ -53,6 +53,7 @@ const TooltipDialogComponent = React__default.forwardRef((_ref, ref) => {
|
|
|
53
53
|
offset: _offset,
|
|
54
54
|
onClose,
|
|
55
55
|
hasArrow = true,
|
|
56
|
+
keepMounted,
|
|
56
57
|
isAnimated,
|
|
57
58
|
zIndex,
|
|
58
59
|
backdropProps,
|
|
@@ -139,16 +140,23 @@ const TooltipDialogComponent = React__default.forwardRef((_ref, ref) => {
|
|
|
139
140
|
getCloseProps
|
|
140
141
|
};
|
|
141
142
|
const Node = React__default.createElement(CSSTransition, {
|
|
142
|
-
unmountOnExit:
|
|
143
|
+
unmountOnExit: !keepMounted,
|
|
143
144
|
timeout: isAnimated ? 200 : 0,
|
|
144
145
|
in: Boolean(referenceElement),
|
|
145
146
|
classNames: isAnimated ? 'garden-tooltip-modal-transition' : '',
|
|
146
|
-
nodeRef: transitionRef
|
|
147
|
+
nodeRef: transitionRef,
|
|
148
|
+
onEntered: () => {
|
|
149
|
+
if (keepMounted && focusOnMount && modalRef.current) {
|
|
150
|
+
modalRef.current.focus();
|
|
151
|
+
}
|
|
152
|
+
}
|
|
147
153
|
}, transitionState => {
|
|
154
|
+
const isHidden = keepMounted && transitionState === 'exited';
|
|
148
155
|
return React__default.createElement(TooltipDialogContext.Provider, {
|
|
149
156
|
value: value
|
|
150
157
|
}, React__default.createElement(StyledTooltipDialogBackdrop, Object.assign({}, getBackdropProps(), backdropProps, {
|
|
151
|
-
ref: transitionRef
|
|
158
|
+
ref: transitionRef,
|
|
159
|
+
"aria-hidden": isHidden ? true : undefined
|
|
152
160
|
}), React__default.createElement(StyledTooltipWrapper, {
|
|
153
161
|
ref: setFloatingElement,
|
|
154
162
|
style: {
|
|
@@ -176,6 +184,7 @@ TooltipDialogComponent.propTypes = {
|
|
|
176
184
|
fallbackPlacements: PropTypes.arrayOf(PropTypes.oneOf(PLACEMENT.filter(placement => placement !== 'auto'))),
|
|
177
185
|
isAnimated: PropTypes.bool,
|
|
178
186
|
hasArrow: PropTypes.bool,
|
|
187
|
+
keepMounted: PropTypes.bool,
|
|
179
188
|
zIndex: PropTypes.number,
|
|
180
189
|
onClose: PropTypes.func,
|
|
181
190
|
backdropProps: PropTypes.any,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
function _assertThisInitialized(e) {
|
|
8
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
9
|
+
return e;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { _assertThisInitialized as default };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import _isNativeReflectConstruct from './isNativeReflectConstruct.js';
|
|
8
|
+
import _setPrototypeOf from './setPrototypeOf.js';
|
|
9
|
+
|
|
10
|
+
function _construct(t, e, r) {
|
|
11
|
+
if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
|
|
12
|
+
var o = [null];
|
|
13
|
+
o.push.apply(o, e);
|
|
14
|
+
var p = new (t.bind.apply(t, o))();
|
|
15
|
+
return r && _setPrototypeOf(p, r.prototype), p;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { _construct as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
function _extends() {
|
|
8
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
9
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
10
|
+
var t = arguments[e];
|
|
11
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
12
|
+
}
|
|
13
|
+
return n;
|
|
14
|
+
}, _extends.apply(null, arguments);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { _extends as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
function _getPrototypeOf(t) {
|
|
8
|
+
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
9
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
10
|
+
}, _getPrototypeOf(t);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { _getPrototypeOf as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import _setPrototypeOf from './setPrototypeOf.js';
|
|
8
|
+
|
|
9
|
+
function _inheritsLoose(t, o) {
|
|
10
|
+
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { _inheritsLoose as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
function _isNativeFunction(t) {
|
|
8
|
+
try {
|
|
9
|
+
return -1 !== Function.toString.call(t).indexOf("[native code]");
|
|
10
|
+
} catch (n) {
|
|
11
|
+
return "function" == typeof t;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { _isNativeFunction as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
function _isNativeReflectConstruct() {
|
|
8
|
+
try {
|
|
9
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
10
|
+
} catch (t) {}
|
|
11
|
+
return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
|
|
12
|
+
return !!t;
|
|
13
|
+
})();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { _isNativeReflectConstruct as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
function _setPrototypeOf(t, e) {
|
|
8
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
9
|
+
return t.__proto__ = e, t;
|
|
10
|
+
}, _setPrototypeOf(t, e);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { _setPrototypeOf as default };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Zendesk, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
|
+
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
*/
|
|
7
|
+
import _getPrototypeOf from './getPrototypeOf.js';
|
|
8
|
+
import _setPrototypeOf from './setPrototypeOf.js';
|
|
9
|
+
import _isNativeFunction from './isNativeFunction.js';
|
|
10
|
+
import _construct from './construct.js';
|
|
11
|
+
|
|
12
|
+
function _wrapNativeSuper(t) {
|
|
13
|
+
var r = "function" == typeof Map ? new Map() : void 0;
|
|
14
|
+
return _wrapNativeSuper = function _wrapNativeSuper(t) {
|
|
15
|
+
if (null === t || !_isNativeFunction(t)) return t;
|
|
16
|
+
if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
|
|
17
|
+
if (void 0 !== r) {
|
|
18
|
+
if (r.has(t)) return r.get(t);
|
|
19
|
+
r.set(t, Wrapper);
|
|
20
|
+
}
|
|
21
|
+
function Wrapper() {
|
|
22
|
+
return _construct(t, arguments, _getPrototypeOf(this).constructor);
|
|
23
|
+
}
|
|
24
|
+
return Wrapper.prototype = Object.create(t.prototype, {
|
|
25
|
+
constructor: {
|
|
26
|
+
value: Wrapper,
|
|
27
|
+
enumerable: !1,
|
|
28
|
+
writable: !0,
|
|
29
|
+
configurable: !0
|
|
30
|
+
}
|
|
31
|
+
}), _setPrototypeOf(Wrapper, t);
|
|
32
|
+
}, _wrapNativeSuper(t);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { _wrapNativeSuper as default };
|