@instructure/ui-modal 8.8.1-snapshot.8 → 8.9.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/CHANGELOG.md +6 -0
- package/es/Modal/ModalBody/index.js +7 -18
- package/{src/Modal/ModalBody/types.ts → es/Modal/ModalBody/props.js} +12 -13
- package/es/Modal/ModalFooter/index.js +5 -10
- package/{src/Modal/ModalFooter/types.ts → es/Modal/ModalFooter/props.js} +7 -6
- package/es/Modal/ModalHeader/index.js +5 -10
- package/{src/Modal/ModalHeader/types.ts → es/Modal/ModalHeader/props.js} +7 -10
- package/es/Modal/index.js +6 -134
- package/es/Modal/props.js +157 -0
- package/lib/Modal/ModalBody/index.js +7 -18
- package/lib/Modal/ModalBody/props.js +47 -0
- package/lib/Modal/ModalFooter/index.js +6 -11
- package/lib/Modal/ModalFooter/props.js +41 -0
- package/lib/Modal/ModalHeader/index.js +6 -11
- package/lib/Modal/ModalHeader/props.js +41 -0
- package/lib/Modal/index.js +7 -138
- package/lib/Modal/props.js +175 -0
- package/package.json +21 -22
- package/src/Modal/ModalBody/index.tsx +8 -21
- package/src/Modal/{types.ts → ModalBody/props.ts} +38 -31
- package/src/Modal/ModalBody/styles.ts +1 -1
- package/src/Modal/ModalFooter/index.tsx +6 -13
- package/src/Modal/ModalFooter/props.ts +50 -0
- package/src/Modal/ModalFooter/styles.ts +1 -1
- package/src/Modal/ModalHeader/index.tsx +6 -13
- package/src/Modal/ModalHeader/props.ts +54 -0
- package/src/Modal/ModalHeader/styles.ts +1 -1
- package/src/Modal/index.tsx +7 -145
- package/src/Modal/props.ts +238 -0
- package/src/Modal/styles.ts +1 -1
- package/src/index.ts +4 -4
- package/types/Modal/ModalBody/index.d.ts +27 -14
- package/types/Modal/ModalBody/index.d.ts.map +1 -1
- package/types/Modal/ModalBody/props.d.ts +19 -0
- package/types/Modal/ModalBody/props.d.ts.map +1 -0
- package/types/Modal/ModalBody/styles.d.ts +1 -1
- package/types/Modal/ModalFooter/index.d.ts +9 -8
- package/types/Modal/ModalFooter/index.d.ts.map +1 -1
- package/types/Modal/ModalFooter/props.d.ts +15 -0
- package/types/Modal/ModalFooter/props.d.ts.map +1 -0
- package/types/Modal/ModalFooter/styles.d.ts +1 -1
- package/types/Modal/ModalHeader/index.d.ts +10 -9
- package/types/Modal/ModalHeader/index.d.ts.map +1 -1
- package/types/Modal/ModalHeader/props.d.ts +18 -0
- package/types/Modal/ModalHeader/props.d.ts.map +1 -0
- package/types/Modal/ModalHeader/styles.d.ts +1 -1
- package/types/Modal/index.d.ts +55 -110
- package/types/Modal/index.d.ts.map +1 -1
- package/types/Modal/{types.d.ts → props.d.ts} +13 -6
- package/types/Modal/{types.d.ts.map → props.d.ts.map} +1 -1
- package/types/Modal/styles.d.ts +1 -1
- package/types/index.d.ts +4 -4
- package/LICENSE.md +0 -27
- package/es/Modal/ModalBody/types.js +0 -1
- package/es/Modal/ModalFooter/types.js +0 -1
- package/es/Modal/ModalHeader/types.js +0 -1
- package/es/Modal/types.js +0 -1
- package/lib/Modal/ModalBody/types.js +0 -1
- package/lib/Modal/ModalFooter/types.js +0 -1
- package/lib/Modal/ModalHeader/types.js +0 -1
- package/lib/Modal/types.js +0 -1
- package/types/Modal/ModalBody/types.d.ts +0 -12
- package/types/Modal/ModalBody/types.d.ts.map +0 -1
- package/types/Modal/ModalFooter/types.d.ts +0 -6
- package/types/Modal/ModalFooter/types.d.ts.map +0 -1
- package/types/Modal/ModalHeader/types.d.ts +0 -9
- package/types/Modal/ModalHeader/types.d.ts.map +0 -1
|
@@ -11,8 +11,6 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
11
11
|
|
|
12
12
|
var _react = require("react");
|
|
13
13
|
|
|
14
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
-
|
|
16
14
|
var _View = require("@instructure/ui-view/lib/View");
|
|
17
15
|
|
|
18
16
|
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
@@ -25,6 +23,8 @@ var _styles = _interopRequireDefault(require("./styles"));
|
|
|
25
23
|
|
|
26
24
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
27
25
|
|
|
26
|
+
var _props = require("./props");
|
|
27
|
+
|
|
28
28
|
const _excluded = ["as", "elementRef", "overflow", "variant", "padding", "children"];
|
|
29
29
|
|
|
30
30
|
var _dec, _dec2, _class, _class2, _temp;
|
|
@@ -45,6 +45,8 @@ let ModalBody = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
render() {
|
|
48
|
+
var _this$props$styles;
|
|
49
|
+
|
|
48
50
|
const _this$props = this.props,
|
|
49
51
|
as = _this$props.as,
|
|
50
52
|
elementRef = _this$props.elementRef,
|
|
@@ -63,31 +65,18 @@ let ModalBody = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
|
|
|
63
65
|
height: isFit ? '100%' : void 0,
|
|
64
66
|
elementRef: elementRef,
|
|
65
67
|
as: as,
|
|
66
|
-
css: this.props.styles.modalBody,
|
|
68
|
+
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.modalBody,
|
|
67
69
|
padding: padding,
|
|
68
70
|
tabIndex: -1 // prevent FF from focusing view when scrollable
|
|
69
71
|
|
|
70
72
|
}), children);
|
|
71
73
|
}
|
|
72
74
|
|
|
73
|
-
}, _class2.displayName = "ModalBody", _class2.componentId = 'Modal.Body', _class2.propTypes = {
|
|
74
|
-
children: _propTypes.default.node,
|
|
75
|
-
padding: _emotion.ThemeablePropTypes.spacing,
|
|
76
|
-
elementRef: _propTypes.default.func,
|
|
77
|
-
as: _propTypes.default.elementType,
|
|
78
|
-
variant: _propTypes.default.oneOf(['default', 'inverse']),
|
|
79
|
-
overflow: _propTypes.default.oneOf(['scroll', 'fit']),
|
|
80
|
-
// eslint-disable-next-line react/require-default-props
|
|
81
|
-
makeStyles: _propTypes.default.func,
|
|
82
|
-
// eslint-disable-next-line react/require-default-props
|
|
83
|
-
styles: _propTypes.default.object
|
|
84
|
-
}, _class2.defaultProps = {
|
|
75
|
+
}, _class2.displayName = "ModalBody", _class2.componentId = 'Modal.Body', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {
|
|
85
76
|
padding: 'medium',
|
|
86
77
|
as: 'div',
|
|
87
78
|
variant: 'default',
|
|
88
|
-
children: null
|
|
89
|
-
elementRef: void 0,
|
|
90
|
-
overflow: void 0
|
|
79
|
+
children: null
|
|
91
80
|
}, _temp)) || _class) || _class);
|
|
92
81
|
exports.ModalBody = ModalBody;
|
|
93
82
|
var _default = ModalBody;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.allowedProps = exports.propTypes = void 0;
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _emotion = require("@instructure/emotion");
|
|
13
|
+
|
|
14
|
+
/*
|
|
15
|
+
* The MIT License (MIT)
|
|
16
|
+
*
|
|
17
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
18
|
+
*
|
|
19
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
20
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
21
|
+
* in the Software without restriction, including without limitation the rights
|
|
22
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
23
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
24
|
+
* furnished to do so, subject to the following conditions:
|
|
25
|
+
*
|
|
26
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
27
|
+
* copies or substantial portions of the Software.
|
|
28
|
+
*
|
|
29
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
30
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
31
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
32
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
33
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
34
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
35
|
+
* SOFTWARE.
|
|
36
|
+
*/
|
|
37
|
+
const propTypes = {
|
|
38
|
+
children: _propTypes.default.node,
|
|
39
|
+
padding: _emotion.ThemeablePropTypes.spacing,
|
|
40
|
+
elementRef: _propTypes.default.func,
|
|
41
|
+
as: _propTypes.default.elementType,
|
|
42
|
+
variant: _propTypes.default.oneOf(['default', 'inverse']),
|
|
43
|
+
overflow: _propTypes.default.oneOf(['scroll', 'fit'])
|
|
44
|
+
};
|
|
45
|
+
exports.propTypes = propTypes;
|
|
46
|
+
const allowedProps = ['children', 'padding', 'elementRef', 'as', 'variant', 'overflow'];
|
|
47
|
+
exports.allowedProps = allowedProps;
|
|
@@ -11,8 +11,6 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
11
11
|
|
|
12
12
|
var _react = require("react");
|
|
13
13
|
|
|
14
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
-
|
|
16
14
|
var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
|
|
17
15
|
|
|
18
16
|
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
@@ -23,6 +21,8 @@ var _styles = _interopRequireDefault(require("./styles"));
|
|
|
23
21
|
|
|
24
22
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
25
23
|
|
|
24
|
+
var _props = require("./props");
|
|
25
|
+
|
|
26
26
|
const _excluded = ["children"];
|
|
27
27
|
|
|
28
28
|
var _dec, _dec2, _class, _class2, _temp;
|
|
@@ -43,22 +43,17 @@ let ModalFooter = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
render() {
|
|
46
|
+
var _this$props$styles;
|
|
47
|
+
|
|
46
48
|
const _this$props = this.props,
|
|
47
49
|
children = _this$props.children,
|
|
48
50
|
rest = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
|
|
49
51
|
return (0, _emotion.jsx)("div", Object.assign({
|
|
50
|
-
css: this.props.styles.modalFooter
|
|
52
|
+
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.modalFooter
|
|
51
53
|
}, (0, _passthroughProps.passthroughProps)(rest)), children);
|
|
52
54
|
}
|
|
53
55
|
|
|
54
|
-
}, _class2.displayName = "ModalFooter", _class2.componentId = 'Modal.Footer', _class2.propTypes = {
|
|
55
|
-
children: _propTypes.default.node,
|
|
56
|
-
variant: _propTypes.default.oneOf(['default', 'inverse']),
|
|
57
|
-
// eslint-disable-next-line react/require-default-props
|
|
58
|
-
makeStyles: _propTypes.default.func,
|
|
59
|
-
// eslint-disable-next-line react/require-default-props
|
|
60
|
-
styles: _propTypes.default.object
|
|
61
|
-
}, _class2.defaultProps = {
|
|
56
|
+
}, _class2.displayName = "ModalFooter", _class2.componentId = 'Modal.Footer', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {
|
|
62
57
|
variant: 'default',
|
|
63
58
|
children: null
|
|
64
59
|
}, _temp)) || _class) || _class);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.allowedProps = exports.propTypes = void 0;
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* The MIT License (MIT)
|
|
14
|
+
*
|
|
15
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
16
|
+
*
|
|
17
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
18
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
19
|
+
* in the Software without restriction, including without limitation the rights
|
|
20
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
21
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
22
|
+
* furnished to do so, subject to the following conditions:
|
|
23
|
+
*
|
|
24
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
25
|
+
* copies or substantial portions of the Software.
|
|
26
|
+
*
|
|
27
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
28
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
29
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
30
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
31
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
32
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
33
|
+
* SOFTWARE.
|
|
34
|
+
*/
|
|
35
|
+
const propTypes = {
|
|
36
|
+
children: _propTypes.default.node,
|
|
37
|
+
variant: _propTypes.default.oneOf(['default', 'inverse'])
|
|
38
|
+
};
|
|
39
|
+
exports.propTypes = propTypes;
|
|
40
|
+
const allowedProps = ['children', 'variant'];
|
|
41
|
+
exports.allowedProps = allowedProps;
|
|
@@ -13,8 +13,6 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
13
13
|
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
15
|
|
|
16
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
-
|
|
18
16
|
var _matchComponentTypes = require("@instructure/ui-react-utils/lib/matchComponentTypes.js");
|
|
19
17
|
|
|
20
18
|
var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
|
|
@@ -29,6 +27,8 @@ var _styles = _interopRequireDefault(require("./styles"));
|
|
|
29
27
|
|
|
30
28
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
31
29
|
|
|
30
|
+
var _props = require("./props");
|
|
31
|
+
|
|
32
32
|
const _excluded = ["children"];
|
|
33
33
|
|
|
34
34
|
var _dec, _dec2, _class, _class2, _temp;
|
|
@@ -69,22 +69,17 @@ let ModalHeader = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
render() {
|
|
72
|
+
var _this$props$styles;
|
|
73
|
+
|
|
72
74
|
const _this$props = this.props,
|
|
73
75
|
children = _this$props.children,
|
|
74
76
|
rest = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
|
|
75
77
|
return (0, _emotion.jsx)("div", Object.assign({
|
|
76
|
-
css: this.props.styles.modalHeader
|
|
78
|
+
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.modalHeader
|
|
77
79
|
}, (0, _passthroughProps.passthroughProps)(rest)), children);
|
|
78
80
|
}
|
|
79
81
|
|
|
80
|
-
}, _class2.displayName = "ModalHeader", _class2.componentId = 'Modal.Header', _class2.propTypes = {
|
|
81
|
-
children: _propTypes.default.node,
|
|
82
|
-
variant: _propTypes.default.oneOf(['default', 'inverse']),
|
|
83
|
-
// eslint-disable-next-line react/require-default-props
|
|
84
|
-
makeStyles: _propTypes.default.func,
|
|
85
|
-
// eslint-disable-next-line react/require-default-props
|
|
86
|
-
styles: _propTypes.default.object
|
|
87
|
-
}, _class2.defaultProps = {
|
|
82
|
+
}, _class2.displayName = "ModalHeader", _class2.componentId = 'Modal.Header', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {
|
|
88
83
|
children: null,
|
|
89
84
|
variant: 'default'
|
|
90
85
|
}, _temp)) || _class) || _class);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.allowedProps = exports.propTypes = void 0;
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* The MIT License (MIT)
|
|
14
|
+
*
|
|
15
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
16
|
+
*
|
|
17
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
18
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
19
|
+
* in the Software without restriction, including without limitation the rights
|
|
20
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
21
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
22
|
+
* furnished to do so, subject to the following conditions:
|
|
23
|
+
*
|
|
24
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
25
|
+
* copies or substantial portions of the Software.
|
|
26
|
+
*
|
|
27
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
28
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
29
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
30
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
31
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
32
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
33
|
+
* SOFTWARE.
|
|
34
|
+
*/
|
|
35
|
+
const propTypes = {
|
|
36
|
+
children: _propTypes.default.node,
|
|
37
|
+
variant: _propTypes.default.oneOf(['default', 'inverse'])
|
|
38
|
+
};
|
|
39
|
+
exports.propTypes = propTypes;
|
|
40
|
+
const allowedProps = ['children', 'variant'];
|
|
41
|
+
exports.allowedProps = allowedProps;
|
package/lib/Modal/index.js
CHANGED
|
@@ -29,14 +29,8 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
29
29
|
|
|
30
30
|
var _react = require("react");
|
|
31
31
|
|
|
32
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
33
|
-
|
|
34
32
|
var _Dialog = require("@instructure/ui-dialog/lib/Dialog");
|
|
35
33
|
|
|
36
|
-
var _element = require("@instructure/ui-prop-types/lib/element.js");
|
|
37
|
-
|
|
38
|
-
var _Children = require("@instructure/ui-prop-types/lib/Children.js");
|
|
39
|
-
|
|
40
34
|
var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
|
|
41
35
|
|
|
42
36
|
var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElement.js");
|
|
@@ -65,6 +59,8 @@ var _styles = _interopRequireDefault(require("./styles"));
|
|
|
65
59
|
|
|
66
60
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
67
61
|
|
|
62
|
+
var _props = require("./props");
|
|
63
|
+
|
|
68
64
|
const _excluded = ["open", "onOpen", "onClose", "mountNode", "insertAt", "transition", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "constrain", "overflow"];
|
|
69
65
|
|
|
70
66
|
var _dec, _dec2, _class, _class2, _temp;
|
|
@@ -182,7 +178,7 @@ let Modal = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
182
178
|
shouldReturnFocus: shouldReturnFocus,
|
|
183
179
|
liveRegion: liveRegion,
|
|
184
180
|
onDismiss: onDismiss,
|
|
185
|
-
css: styles.modal,
|
|
181
|
+
css: styles === null || styles === void 0 ? void 0 : styles.modal,
|
|
186
182
|
ref: this.contentRef // aria-modal="true" see VO bug https://bugs.webkit.org/show_bug.cgi?id=174667
|
|
187
183
|
|
|
188
184
|
}), this.renderChildren());
|
|
@@ -197,6 +193,8 @@ let Modal = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
197
193
|
}
|
|
198
194
|
|
|
199
195
|
render() {
|
|
196
|
+
var _this$props$styles;
|
|
197
|
+
|
|
200
198
|
const _this$props3 = this.props,
|
|
201
199
|
open = _this$props3.open,
|
|
202
200
|
onOpen = _this$props3.onOpen,
|
|
@@ -232,140 +230,11 @@ let Modal = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
232
230
|
onExiting: onExiting,
|
|
233
231
|
onExited: (0, _createChainedFunction.createChainedFunction)(this.handleTransitionExited, onExited)
|
|
234
232
|
}, constrain === 'parent' ? (0, _emotion.jsx)("span", {
|
|
235
|
-
css: this.props.styles.constrainContext
|
|
233
|
+
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.constrainContext
|
|
236
234
|
}, this.renderDialog(passthroughProps)) : this.renderDialog(passthroughProps)));
|
|
237
235
|
}
|
|
238
236
|
|
|
239
|
-
}, _class2.displayName = "Modal", _class2.componentId = 'Modal', _class2.propTypes = {
|
|
240
|
-
/**
|
|
241
|
-
* An accessible label for the `<Modal />` content
|
|
242
|
-
*/
|
|
243
|
-
label: _propTypes.default.string.isRequired,
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* The children to be rendered within the `<Modal />`
|
|
247
|
-
*/
|
|
248
|
-
children: _Children.Children.enforceOrder([_ModalHeader.ModalHeader, _ModalBody.ModalBody, _ModalFooter.ModalFooter], [_ModalHeader.ModalHeader, _ModalBody.ModalBody], [_ModalBody.ModalBody, _ModalFooter.ModalFooter], [_ModalBody.ModalBody]),
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
* The element to render the dialog as, `span` by default
|
|
252
|
-
*/
|
|
253
|
-
as: _propTypes.default.elementType,
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* The size of the `<Modal />` content
|
|
257
|
-
*/
|
|
258
|
-
size: _propTypes.default.oneOf(['auto', 'small', 'medium', 'large', 'fullscreen']),
|
|
259
|
-
|
|
260
|
-
/**
|
|
261
|
-
* Designates the background style of the `<Modal />`
|
|
262
|
-
*/
|
|
263
|
-
variant: _propTypes.default.oneOf(['default', 'inverse']),
|
|
264
|
-
|
|
265
|
-
/**
|
|
266
|
-
* Whether or not the `<Modal />` is open
|
|
267
|
-
*/
|
|
268
|
-
open: _propTypes.default.bool,
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* An element or a function returning an element to focus by default
|
|
272
|
-
*/
|
|
273
|
-
defaultFocusElement: _propTypes.default.oneOfType([_propTypes.default.element, _propTypes.default.func]),
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* Whether focus should be returned to the trigger when the `<Modal/>` is closed
|
|
277
|
-
*/
|
|
278
|
-
shouldReturnFocus: _propTypes.default.bool,
|
|
279
|
-
|
|
280
|
-
/**
|
|
281
|
-
* Whether the `<Modal/>` should request close when the document is clicked
|
|
282
|
-
*/
|
|
283
|
-
shouldCloseOnDocumentClick: _propTypes.default.bool,
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* Callback fired when `<Modal />` content has been mounted in the DOM
|
|
287
|
-
*/
|
|
288
|
-
onOpen: _propTypes.default.func,
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
* Callback fired when `<Modal />` has been unmounted from the DOM
|
|
292
|
-
*/
|
|
293
|
-
onClose: _propTypes.default.func,
|
|
294
|
-
|
|
295
|
-
/**
|
|
296
|
-
* Callback fired when the `<Modal />` is requesting to be closed
|
|
297
|
-
*/
|
|
298
|
-
onDismiss: _propTypes.default.func,
|
|
299
|
-
|
|
300
|
-
/**
|
|
301
|
-
*
|
|
302
|
-
* A function that returns a reference to the content element
|
|
303
|
-
*/
|
|
304
|
-
contentRef: _propTypes.default.func,
|
|
305
|
-
|
|
306
|
-
/**
|
|
307
|
-
* An element or a function returning an element to use as the mount node
|
|
308
|
-
* for the `<Modal />` (defaults to `document.body`)
|
|
309
|
-
*/
|
|
310
|
-
mountNode: _propTypes.default.oneOfType([_element.element, _propTypes.default.func]),
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
* Insert the element at the 'top' of the mountNode or at the 'bottom'
|
|
314
|
-
*/
|
|
315
|
-
insertAt: _propTypes.default.oneOf(['bottom', 'top']),
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* An element, function returning an element, or array of elements that will not be hidden from
|
|
319
|
-
* the screen reader when the `<Modal />` is open
|
|
320
|
-
*/
|
|
321
|
-
liveRegion: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.element), _propTypes.default.element, _propTypes.default.func]),
|
|
322
|
-
transition: _Transition.Transition.propTypes.type,
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
* Callback fired before the <Modal /> transitions in
|
|
326
|
-
*/
|
|
327
|
-
onEnter: _propTypes.default.func,
|
|
328
|
-
|
|
329
|
-
/**
|
|
330
|
-
* Callback fired as the <Modal /> begins to transition in
|
|
331
|
-
*/
|
|
332
|
-
onEntering: _propTypes.default.func,
|
|
333
|
-
|
|
334
|
-
/**
|
|
335
|
-
* Callback fired after the <Modal /> finishes transitioning in
|
|
336
|
-
*/
|
|
337
|
-
onEntered: _propTypes.default.func,
|
|
338
|
-
|
|
339
|
-
/**
|
|
340
|
-
* Callback fired right before the <Modal /> transitions out
|
|
341
|
-
*/
|
|
342
|
-
onExit: _propTypes.default.func,
|
|
343
|
-
|
|
344
|
-
/**
|
|
345
|
-
* Callback fired as the <Modal /> begins to transition out
|
|
346
|
-
*/
|
|
347
|
-
onExiting: _propTypes.default.func,
|
|
348
|
-
|
|
349
|
-
/**
|
|
350
|
-
* Callback fired after the <Modal /> finishes transitioning out
|
|
351
|
-
*/
|
|
352
|
-
onExited: _propTypes.default.func,
|
|
353
|
-
|
|
354
|
-
/**
|
|
355
|
-
* Constrain the Modal to the document window or its closest positioned parent
|
|
356
|
-
*/
|
|
357
|
-
constrain: _propTypes.default.oneOf(['window', 'parent']),
|
|
358
|
-
|
|
359
|
-
/**
|
|
360
|
-
* Should ModalBody handle overflow with scrollbars, or fit its
|
|
361
|
-
* content within its own height?
|
|
362
|
-
*/
|
|
363
|
-
overflow: _propTypes.default.oneOf(['scroll', 'fit']),
|
|
364
|
-
// eslint-disable-next-line react/require-default-props
|
|
365
|
-
makeStyles: _propTypes.default.func,
|
|
366
|
-
// eslint-disable-next-line react/require-default-props
|
|
367
|
-
styles: _propTypes.default.object
|
|
368
|
-
}, _class2.defaultProps = {
|
|
237
|
+
}, _class2.displayName = "Modal", _class2.componentId = 'Modal', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {
|
|
369
238
|
open: false,
|
|
370
239
|
size: 'auto',
|
|
371
240
|
variant: 'default',
|