carbon-react 110.0.2 → 110.0.3
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.
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
2
|
export interface ModalContextProps {
|
|
4
3
|
isInModal?: boolean;
|
|
5
4
|
isAnimationComplete?: boolean;
|
|
@@ -24,23 +23,5 @@ export interface ModalProps {
|
|
|
24
23
|
/** Transition time */
|
|
25
24
|
timeout?: number;
|
|
26
25
|
}
|
|
27
|
-
declare const Modal: {
|
|
28
|
-
({ children, open, onCancel, disableEscKey, disableClose, enableBackgroundUI, timeout, ...rest }: ModalProps): JSX.Element;
|
|
29
|
-
propTypes: {
|
|
30
|
-
/** Modal content */
|
|
31
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
32
|
-
/** A custom close event handler */
|
|
33
|
-
onCancel: PropTypes.Requireable<(...args: any[]) => any>;
|
|
34
|
-
/** Controls the open state of the modal */
|
|
35
|
-
open: PropTypes.Validator<boolean>;
|
|
36
|
-
/** Determines if the background is disabled when the modal is open */
|
|
37
|
-
enableBackgroundUI: PropTypes.Requireable<boolean>;
|
|
38
|
-
/** Determines if the Esc Key closes the modal */
|
|
39
|
-
disableEscKey: PropTypes.Requireable<boolean>;
|
|
40
|
-
/** Determines if the Dialog can be closed */
|
|
41
|
-
disableClose: PropTypes.Requireable<boolean>;
|
|
42
|
-
/** Transition time */
|
|
43
|
-
timeout: PropTypes.Requireable<number>;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
26
|
+
declare const Modal: ({ children, open, onCancel, disableEscKey, disableClose, enableBackgroundUI, timeout, ...rest }: ModalProps) => JSX.Element;
|
|
46
27
|
export default Modal;
|
|
@@ -2,7 +2,6 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
2
2
|
|
|
3
3
|
import React, { useEffect, useRef, useCallback, useState } from "react";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
|
-
import PropTypes from "prop-types";
|
|
6
5
|
import { TransitionGroup, CSSTransition } from "react-transition-group";
|
|
7
6
|
import useScrollBlock from "../../hooks/__internal__/useScrollBlock";
|
|
8
7
|
import Portal from "../portal";
|
|
@@ -98,25 +97,13 @@ const Modal = ({
|
|
|
98
97
|
};
|
|
99
98
|
|
|
100
99
|
Modal.propTypes = {
|
|
101
|
-
|
|
102
|
-
children: PropTypes.node,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
/** Determines if the background is disabled when the modal is open */
|
|
111
|
-
enableBackgroundUI: PropTypes.bool,
|
|
112
|
-
|
|
113
|
-
/** Determines if the Esc Key closes the modal */
|
|
114
|
-
disableEscKey: PropTypes.bool,
|
|
115
|
-
|
|
116
|
-
/** Determines if the Dialog can be closed */
|
|
117
|
-
disableClose: PropTypes.bool,
|
|
118
|
-
|
|
119
|
-
/** Transition time */
|
|
120
|
-
timeout: PropTypes.number
|
|
100
|
+
"ariaRole": PropTypes.string,
|
|
101
|
+
"children": PropTypes.node,
|
|
102
|
+
"disableClose": PropTypes.bool,
|
|
103
|
+
"disableEscKey": PropTypes.bool,
|
|
104
|
+
"enableBackgroundUI": PropTypes.bool,
|
|
105
|
+
"onCancel": PropTypes.func,
|
|
106
|
+
"open": PropTypes.bool.isRequired,
|
|
107
|
+
"timeout": PropTypes.number
|
|
121
108
|
};
|
|
122
109
|
export default Modal;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
2
|
export interface ModalContextProps {
|
|
4
3
|
isInModal?: boolean;
|
|
5
4
|
isAnimationComplete?: boolean;
|
|
@@ -24,23 +23,5 @@ export interface ModalProps {
|
|
|
24
23
|
/** Transition time */
|
|
25
24
|
timeout?: number;
|
|
26
25
|
}
|
|
27
|
-
declare const Modal: {
|
|
28
|
-
({ children, open, onCancel, disableEscKey, disableClose, enableBackgroundUI, timeout, ...rest }: ModalProps): JSX.Element;
|
|
29
|
-
propTypes: {
|
|
30
|
-
/** Modal content */
|
|
31
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
32
|
-
/** A custom close event handler */
|
|
33
|
-
onCancel: PropTypes.Requireable<(...args: any[]) => any>;
|
|
34
|
-
/** Controls the open state of the modal */
|
|
35
|
-
open: PropTypes.Validator<boolean>;
|
|
36
|
-
/** Determines if the background is disabled when the modal is open */
|
|
37
|
-
enableBackgroundUI: PropTypes.Requireable<boolean>;
|
|
38
|
-
/** Determines if the Esc Key closes the modal */
|
|
39
|
-
disableEscKey: PropTypes.Requireable<boolean>;
|
|
40
|
-
/** Determines if the Dialog can be closed */
|
|
41
|
-
disableClose: PropTypes.Requireable<boolean>;
|
|
42
|
-
/** Transition time */
|
|
43
|
-
timeout: PropTypes.Requireable<number>;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
26
|
+
declare const Modal: ({ children, open, onCancel, disableEscKey, disableClose, enableBackgroundUI, timeout, ...rest }: ModalProps) => JSX.Element;
|
|
46
27
|
export default Modal;
|
|
@@ -120,26 +120,14 @@ const Modal = ({
|
|
|
120
120
|
};
|
|
121
121
|
|
|
122
122
|
Modal.propTypes = {
|
|
123
|
-
|
|
124
|
-
children: _propTypes.default.node,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
/** Determines if the background is disabled when the modal is open */
|
|
133
|
-
enableBackgroundUI: _propTypes.default.bool,
|
|
134
|
-
|
|
135
|
-
/** Determines if the Esc Key closes the modal */
|
|
136
|
-
disableEscKey: _propTypes.default.bool,
|
|
137
|
-
|
|
138
|
-
/** Determines if the Dialog can be closed */
|
|
139
|
-
disableClose: _propTypes.default.bool,
|
|
140
|
-
|
|
141
|
-
/** Transition time */
|
|
142
|
-
timeout: _propTypes.default.number
|
|
123
|
+
"ariaRole": _propTypes.default.string,
|
|
124
|
+
"children": _propTypes.default.node,
|
|
125
|
+
"disableClose": _propTypes.default.bool,
|
|
126
|
+
"disableEscKey": _propTypes.default.bool,
|
|
127
|
+
"enableBackgroundUI": _propTypes.default.bool,
|
|
128
|
+
"onCancel": _propTypes.default.func,
|
|
129
|
+
"open": _propTypes.default.bool.isRequired,
|
|
130
|
+
"timeout": _propTypes.default.number
|
|
143
131
|
};
|
|
144
132
|
var _default = Modal;
|
|
145
133
|
exports.default = _default;
|