@instructure/ui-modal 11.6.0 → 11.6.1-pr-snapshot-1779894247159
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 +8 -0
- package/{lib/Modal/ModalBody/props.js → babel.config.cjs} +13 -7
- package/package.json +19 -21
- package/lib/Modal/ModalBody/index.js +0 -137
- package/lib/Modal/ModalBody/styles.js +0 -62
- package/lib/Modal/ModalBody/theme.js +0 -43
- package/lib/Modal/ModalContext.js +0 -39
- package/lib/Modal/ModalFooter/index.js +0 -79
- package/lib/Modal/ModalFooter/props.js +0 -31
- package/lib/Modal/ModalFooter/styles.js +0 -64
- package/lib/Modal/ModalFooter/theme.js +0 -54
- package/lib/Modal/ModalHeader/index.js +0 -119
- package/lib/Modal/ModalHeader/props.js +0 -31
- package/lib/Modal/ModalHeader/styles.js +0 -81
- package/lib/Modal/ModalHeader/theme.js +0 -52
- package/lib/Modal/index.js +0 -285
- package/lib/Modal/props.js +0 -31
- package/lib/Modal/styles.js +0 -122
- package/lib/Modal/theme.js +0 -61
- package/lib/index.js +0 -30
- package/lib/package.json +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [11.6.1-pr-snapshot-1779894247159](https://github.com/instructure/instructure-ui/compare/v11.6.0...v11.6.1-pr-snapshot-1779894247159) (2026-05-27)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-modal
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [11.6.0](https://github.com/instructure/instructure-ui/compare/v11.5.0...v11.6.0) (2026-02-18)
|
|
7
15
|
|
|
8
16
|
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.allowedProps = void 0;
|
|
7
1
|
/*
|
|
8
2
|
* The MIT License (MIT)
|
|
9
3
|
*
|
|
@@ -28,4 +22,16 @@ exports.allowedProps = void 0;
|
|
|
28
22
|
* SOFTWARE.
|
|
29
23
|
*/
|
|
30
24
|
|
|
31
|
-
|
|
25
|
+
module.exports = {
|
|
26
|
+
presets: [
|
|
27
|
+
[
|
|
28
|
+
require('@instructure/ui-babel-preset'),
|
|
29
|
+
{
|
|
30
|
+
coverage: Boolean(process.env.COVERAGE),
|
|
31
|
+
esModules: Boolean(process.env.ES_MODULES),
|
|
32
|
+
removeConsole: process.env.NODE_ENV === 'production',
|
|
33
|
+
transformImports: Boolean(process.env.TRANSFORM_IMPORTS)
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
]
|
|
37
|
+
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-modal",
|
|
3
|
-
"version": "11.6.
|
|
3
|
+
"version": "11.6.1-pr-snapshot-1779894247159",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"description": "A component for displaying content in a dialog overlay",
|
|
5
6
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
7
|
"module": "./es/index.js",
|
|
7
|
-
"main": "./lib/index.js",
|
|
8
8
|
"types": "./types/index.d.ts",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -15,28 +15,28 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@babel/runtime": "^7.27.6",
|
|
18
|
-
"@instructure/
|
|
19
|
-
"@instructure/emotion": "11.6.
|
|
20
|
-
"@instructure/
|
|
21
|
-
"@instructure/ui-buttons": "11.6.
|
|
22
|
-
"@instructure/ui-dialog": "11.6.
|
|
23
|
-
"@instructure/ui-
|
|
24
|
-
"@instructure/ui-
|
|
25
|
-
"@instructure/ui-
|
|
26
|
-
"@instructure/ui-
|
|
27
|
-
"@instructure/ui-
|
|
28
|
-
"@instructure/ui-utils": "11.6.
|
|
29
|
-
"@instructure/ui-view": "11.6.
|
|
18
|
+
"@instructure/console": "11.6.1-pr-snapshot-1779894247159",
|
|
19
|
+
"@instructure/emotion": "11.6.1-pr-snapshot-1779894247159",
|
|
20
|
+
"@instructure/shared-types": "11.6.1-pr-snapshot-1779894247159",
|
|
21
|
+
"@instructure/ui-buttons": "11.6.1-pr-snapshot-1779894247159",
|
|
22
|
+
"@instructure/ui-dialog": "11.6.1-pr-snapshot-1779894247159",
|
|
23
|
+
"@instructure/ui-dom-utils": "11.6.1-pr-snapshot-1779894247159",
|
|
24
|
+
"@instructure/ui-motion": "11.6.1-pr-snapshot-1779894247159",
|
|
25
|
+
"@instructure/ui-overlays": "11.6.1-pr-snapshot-1779894247159",
|
|
26
|
+
"@instructure/ui-react-utils": "11.6.1-pr-snapshot-1779894247159",
|
|
27
|
+
"@instructure/ui-portal": "11.6.1-pr-snapshot-1779894247159",
|
|
28
|
+
"@instructure/ui-utils": "11.6.1-pr-snapshot-1779894247159",
|
|
29
|
+
"@instructure/ui-view": "11.6.1-pr-snapshot-1779894247159"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@testing-library/jest-dom": "^6.6.3",
|
|
33
33
|
"@testing-library/react": "15.0.7",
|
|
34
34
|
"@testing-library/user-event": "^14.6.1",
|
|
35
35
|
"vitest": "^3.2.2",
|
|
36
|
-
"@instructure/ui-babel-preset": "11.6.
|
|
37
|
-
"@instructure/ui-color-utils": "11.6.
|
|
38
|
-
"@instructure/ui-position": "11.6.
|
|
39
|
-
"@instructure/ui-themes": "11.6.
|
|
36
|
+
"@instructure/ui-babel-preset": "11.6.1-pr-snapshot-1779894247159",
|
|
37
|
+
"@instructure/ui-color-utils": "11.6.1-pr-snapshot-1779894247159",
|
|
38
|
+
"@instructure/ui-position": "11.6.1-pr-snapshot-1779894247159",
|
|
39
|
+
"@instructure/ui-themes": "11.6.1-pr-snapshot-1779894247159"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"react": ">=18 <=19"
|
|
@@ -49,10 +49,8 @@
|
|
|
49
49
|
".": {
|
|
50
50
|
"types": "./types/index.d.ts",
|
|
51
51
|
"import": "./es/index.js",
|
|
52
|
-
"require": "./lib/index.js",
|
|
53
52
|
"default": "./es/index.js"
|
|
54
53
|
},
|
|
55
|
-
"./lib/*": "./lib/*",
|
|
56
54
|
"./es/*": "./es/*",
|
|
57
55
|
"./types/*": "./types/*",
|
|
58
56
|
"./package.json": "./package.json",
|
|
@@ -62,7 +60,7 @@
|
|
|
62
60
|
"lint": "ui-scripts lint",
|
|
63
61
|
"lint:fix": "ui-scripts lint --fix",
|
|
64
62
|
"clean": "ui-scripts clean",
|
|
65
|
-
"build": "ui-scripts build
|
|
63
|
+
"build": "ui-scripts build",
|
|
66
64
|
"build:watch": "pnpm run ts:check -- --watch & ui-scripts build --watch",
|
|
67
65
|
"build:types": "tsc -p tsconfig.build.json",
|
|
68
66
|
"ts:check": "tsc -p tsconfig.build.json --noEmit --emitDeclarationOnly false"
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = exports.ModalBody = void 0;
|
|
8
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
|
-
var _react = require("react");
|
|
10
|
-
var _View = require("@instructure/ui-view/lib/View");
|
|
11
|
-
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
12
|
-
var _getCSSStyleDeclaration = require("@instructure/ui-dom-utils/lib/getCSSStyleDeclaration.js");
|
|
13
|
-
var _emotion = require("@instructure/emotion");
|
|
14
|
-
var _styles = _interopRequireDefault(require("./styles"));
|
|
15
|
-
var _theme = _interopRequireDefault(require("./theme"));
|
|
16
|
-
var _props = require("./props");
|
|
17
|
-
var _ModalContext = _interopRequireDefault(require("../ModalContext"));
|
|
18
|
-
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
19
|
-
const _excluded = ["as", "elementRef", "overflow", "variant", "padding", "children"];
|
|
20
|
-
var _dec, _class, _ModalBody;
|
|
21
|
-
/*
|
|
22
|
-
* The MIT License (MIT)
|
|
23
|
-
*
|
|
24
|
-
* Copyright (c) 2015 - present Instructure, Inc.
|
|
25
|
-
*
|
|
26
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
27
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
28
|
-
* in the Software without restriction, including without limitation the rights
|
|
29
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
30
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
31
|
-
* furnished to do so, subject to the following conditions:
|
|
32
|
-
*
|
|
33
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
34
|
-
* copies or substantial portions of the Software.
|
|
35
|
-
*
|
|
36
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
37
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
38
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
39
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
40
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
41
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
42
|
-
* SOFTWARE.
|
|
43
|
-
*/
|
|
44
|
-
/**
|
|
45
|
-
---
|
|
46
|
-
parent: Modal
|
|
47
|
-
id: Modal.Body
|
|
48
|
-
---
|
|
49
|
-
**/
|
|
50
|
-
let ModalBody = exports.ModalBody = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_ModalBody = class ModalBody extends _react.Component {
|
|
51
|
-
constructor(props) {
|
|
52
|
-
super(props);
|
|
53
|
-
this.ref = null;
|
|
54
|
-
this.handleRef = el => {
|
|
55
|
-
const elementRef = this.props.elementRef;
|
|
56
|
-
this.ref = el;
|
|
57
|
-
if (typeof elementRef === 'function') {
|
|
58
|
-
elementRef(el);
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
componentDidMount() {
|
|
63
|
-
var _this$props$makeStyle, _this$props;
|
|
64
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
65
|
-
|
|
66
|
-
// We detect if -moz- prefixed style is present to identify whether we are in Firefox browser
|
|
67
|
-
const style = this.ref && (0, _getCSSStyleDeclaration.getCSSStyleDeclaration)(this.ref);
|
|
68
|
-
const isFirefox = !!(style && Array.prototype.slice.call(style).join('').match(/(?:-moz-)/));
|
|
69
|
-
if (isFirefox) {
|
|
70
|
-
this.setState({
|
|
71
|
-
isFirefox
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
componentDidUpdate() {
|
|
76
|
-
var _this$props$makeStyle2, _this$props2;
|
|
77
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
78
|
-
}
|
|
79
|
-
getFinalRef(el) {
|
|
80
|
-
if (!el) {
|
|
81
|
-
return void 0;
|
|
82
|
-
}
|
|
83
|
-
if (el instanceof Element) {
|
|
84
|
-
return el;
|
|
85
|
-
}
|
|
86
|
-
if (el.ref) {
|
|
87
|
-
return this.getFinalRef(el.ref);
|
|
88
|
-
}
|
|
89
|
-
return void 0;
|
|
90
|
-
}
|
|
91
|
-
render() {
|
|
92
|
-
var _finalRef$scrollHeigh, _finalRef$getBounding, _finalRef$getBounding2;
|
|
93
|
-
const _this$props3 = this.props,
|
|
94
|
-
as = _this$props3.as,
|
|
95
|
-
elementRef = _this$props3.elementRef,
|
|
96
|
-
overflow = _this$props3.overflow,
|
|
97
|
-
variant = _this$props3.variant,
|
|
98
|
-
padding = _this$props3.padding,
|
|
99
|
-
children = _this$props3.children,
|
|
100
|
-
rest = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
|
|
101
|
-
const passthroughProps = _View.View.omitViewProps((0, _omitProps.omitProps)(rest, ModalBody.allowedProps), ModalBody);
|
|
102
|
-
const isFit = overflow === 'fit';
|
|
103
|
-
// this recursive function is needed because `ref` can be a React component.
|
|
104
|
-
// TODO rethink, the 'as' prop, likely its not a good idea to allow React
|
|
105
|
-
// components. See INSTUI-4674
|
|
106
|
-
const finalRef = this.getFinalRef(this.ref);
|
|
107
|
-
const hasScrollbar = finalRef && Math.abs(((_finalRef$scrollHeigh = finalRef.scrollHeight) !== null && _finalRef$scrollHeigh !== void 0 ? _finalRef$scrollHeigh : 0) - ((_finalRef$getBounding = (_finalRef$getBounding2 = finalRef.getBoundingClientRect()) === null || _finalRef$getBounding2 === void 0 ? void 0 : _finalRef$getBounding2.height) !== null && _finalRef$getBounding !== void 0 ? _finalRef$getBounding : 0)) > 1;
|
|
108
|
-
return (0, _jsxRuntime.jsx)(_ModalContext.default.Consumer, {
|
|
109
|
-
children: value => {
|
|
110
|
-
var _this$props$styles;
|
|
111
|
-
return (0, _jsxRuntime.jsx)(_View.View, {
|
|
112
|
-
...passthroughProps,
|
|
113
|
-
display: "block",
|
|
114
|
-
"data-cid": "ModalBody",
|
|
115
|
-
width: isFit ? '100%' : void 0,
|
|
116
|
-
height: isFit ? '100%' : void 0,
|
|
117
|
-
elementRef: this.handleRef,
|
|
118
|
-
as: as,
|
|
119
|
-
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.modalBody,
|
|
120
|
-
padding: padding
|
|
121
|
-
// check if there is a scrollbar, if so, the element has to be tabbable
|
|
122
|
-
,
|
|
123
|
-
...(hasScrollbar ? {
|
|
124
|
-
tabIndex: 0,
|
|
125
|
-
'aria-label': value.bodyScrollAriaLabel
|
|
126
|
-
} : {}),
|
|
127
|
-
children: children
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
}, _ModalBody.displayName = "ModalBody", _ModalBody.componentId = 'Modal.Body', _ModalBody.allowedProps = _props.allowedProps, _ModalBody.defaultProps = {
|
|
133
|
-
padding: 'medium',
|
|
134
|
-
as: 'div',
|
|
135
|
-
variant: 'default'
|
|
136
|
-
}, _ModalBody)) || _class);
|
|
137
|
-
var _default = exports.default = ModalBody;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
/*
|
|
8
|
-
* The MIT License (MIT)
|
|
9
|
-
*
|
|
10
|
-
* Copyright (c) 2015 - present Instructure, Inc.
|
|
11
|
-
*
|
|
12
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
14
|
-
* in the Software without restriction, including without limitation the rights
|
|
15
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
17
|
-
* furnished to do so, subject to the following conditions:
|
|
18
|
-
*
|
|
19
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
20
|
-
* copies or substantial portions of the Software.
|
|
21
|
-
*
|
|
22
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
-
* SOFTWARE.
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* ---
|
|
33
|
-
* private: true
|
|
34
|
-
* ---
|
|
35
|
-
* Generates the style object from the theme and provided additional information
|
|
36
|
-
* @param {Object} componentTheme The theme variable object.
|
|
37
|
-
* @param {Object} props the props of the component, the style is applied to
|
|
38
|
-
* @param {Object} state the state of the component, the style is applied to
|
|
39
|
-
* @return {Object} The final style object, which will be used in the component
|
|
40
|
-
*/
|
|
41
|
-
const generateStyle = (componentTheme, props) => {
|
|
42
|
-
const variant = props.variant;
|
|
43
|
-
const backgroundStyle = variant === 'inverse' ? {
|
|
44
|
-
background: componentTheme.inverseBackground
|
|
45
|
-
} : {};
|
|
46
|
-
return {
|
|
47
|
-
modalBody: {
|
|
48
|
-
label: 'modalBody',
|
|
49
|
-
boxSizing: 'border-box',
|
|
50
|
-
flex: '1 1 auto',
|
|
51
|
-
'&:focus': {
|
|
52
|
-
outline: 'none'
|
|
53
|
-
},
|
|
54
|
-
// ModalBody is set to scrollable above 20rem height
|
|
55
|
-
'@media (min-height: 20rem)': {
|
|
56
|
-
overflowY: 'auto'
|
|
57
|
-
},
|
|
58
|
-
...backgroundStyle
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
var _default = exports.default = generateStyle;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
/*
|
|
8
|
-
* The MIT License (MIT)
|
|
9
|
-
*
|
|
10
|
-
* Copyright (c) 2015 - present Instructure, Inc.
|
|
11
|
-
*
|
|
12
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
14
|
-
* in the Software without restriction, including without limitation the rights
|
|
15
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
17
|
-
* furnished to do so, subject to the following conditions:
|
|
18
|
-
*
|
|
19
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
20
|
-
* copies or substantial portions of the Software.
|
|
21
|
-
*
|
|
22
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
-
* SOFTWARE.
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Generates the theme object for the component from the theme and provided additional information
|
|
33
|
-
* @param {Object} theme The actual theme object.
|
|
34
|
-
* @return {Object} The final theme object with the overrides and component variables
|
|
35
|
-
*/
|
|
36
|
-
const generateComponentTheme = theme => {
|
|
37
|
-
var _colors$contrasts;
|
|
38
|
-
const colors = theme.colors;
|
|
39
|
-
return {
|
|
40
|
-
inverseBackground: colors === null || colors === void 0 ? void 0 : (_colors$contrasts = colors.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.grey100100
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
var _default = exports.default = generateComponentTheme;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.ModalContext = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
/*
|
|
9
|
-
* The MIT License (MIT)
|
|
10
|
-
*
|
|
11
|
-
* Copyright (c) 2015 - present Instructure, Inc.
|
|
12
|
-
*
|
|
13
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
15
|
-
* in the Software without restriction, including without limitation the rights
|
|
16
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
17
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
18
|
-
* furnished to do so, subject to the following conditions:
|
|
19
|
-
*
|
|
20
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
21
|
-
* copies or substantial portions of the Software.
|
|
22
|
-
*
|
|
23
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
24
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
25
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
26
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
27
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
28
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
29
|
-
* SOFTWARE.
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* React context created by the `Modal` component
|
|
34
|
-
* @private
|
|
35
|
-
*/
|
|
36
|
-
const ModalContext = exports.ModalContext = /*#__PURE__*/(0, _react.createContext)({
|
|
37
|
-
bodyScrollAriaLabel: void 0
|
|
38
|
-
});
|
|
39
|
-
var _default = exports.default = ModalContext;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = exports.ModalFooter = void 0;
|
|
8
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
|
-
var _react = require("react");
|
|
10
|
-
var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
|
|
11
|
-
var _emotion = require("@instructure/emotion");
|
|
12
|
-
var _styles = _interopRequireDefault(require("./styles"));
|
|
13
|
-
var _theme = _interopRequireDefault(require("./theme"));
|
|
14
|
-
var _props = require("./props");
|
|
15
|
-
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
16
|
-
const _excluded = ["children"];
|
|
17
|
-
var _dec, _class, _ModalFooter;
|
|
18
|
-
/*
|
|
19
|
-
* The MIT License (MIT)
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) 2015 - present Instructure, Inc.
|
|
22
|
-
*
|
|
23
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
24
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
25
|
-
* in the Software without restriction, including without limitation the rights
|
|
26
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
27
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
28
|
-
* furnished to do so, subject to the following conditions:
|
|
29
|
-
*
|
|
30
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
31
|
-
* copies or substantial portions of the Software.
|
|
32
|
-
*
|
|
33
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
34
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
35
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
36
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
37
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
38
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
39
|
-
* SOFTWARE.
|
|
40
|
-
*/
|
|
41
|
-
/**
|
|
42
|
-
---
|
|
43
|
-
parent: Modal
|
|
44
|
-
id: Modal.Footer
|
|
45
|
-
---
|
|
46
|
-
**/
|
|
47
|
-
let ModalFooter = exports.ModalFooter = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_ModalFooter = class ModalFooter extends _react.Component {
|
|
48
|
-
constructor(...args) {
|
|
49
|
-
super(...args);
|
|
50
|
-
this.ref = null;
|
|
51
|
-
this.handleRef = el => {
|
|
52
|
-
this.ref = el;
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
componentDidMount() {
|
|
56
|
-
var _this$props$makeStyle, _this$props;
|
|
57
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
58
|
-
}
|
|
59
|
-
componentDidUpdate() {
|
|
60
|
-
var _this$props$makeStyle2, _this$props2;
|
|
61
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
62
|
-
}
|
|
63
|
-
render() {
|
|
64
|
-
var _this$props$styles;
|
|
65
|
-
const _this$props3 = this.props,
|
|
66
|
-
children = _this$props3.children,
|
|
67
|
-
rest = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
|
|
68
|
-
return (0, _jsxRuntime.jsx)("div", {
|
|
69
|
-
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.modalFooter,
|
|
70
|
-
...(0, _passthroughProps.passthroughProps)(rest),
|
|
71
|
-
ref: this.handleRef,
|
|
72
|
-
"data-cid": "ModalFooter",
|
|
73
|
-
children: children
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
}, _ModalFooter.displayName = "ModalFooter", _ModalFooter.componentId = 'Modal.Footer', _ModalFooter.allowedProps = _props.allowedProps, _ModalFooter.defaultProps = {
|
|
77
|
-
variant: 'default'
|
|
78
|
-
}, _ModalFooter)) || _class);
|
|
79
|
-
var _default = exports.default = ModalFooter;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.allowedProps = void 0;
|
|
7
|
-
/*
|
|
8
|
-
* The MIT License (MIT)
|
|
9
|
-
*
|
|
10
|
-
* Copyright (c) 2015 - present Instructure, Inc.
|
|
11
|
-
*
|
|
12
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
14
|
-
* in the Software without restriction, including without limitation the rights
|
|
15
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
17
|
-
* furnished to do so, subject to the following conditions:
|
|
18
|
-
*
|
|
19
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
20
|
-
* copies or substantial portions of the Software.
|
|
21
|
-
*
|
|
22
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
-
* SOFTWARE.
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
const allowedProps = exports.allowedProps = ['children', 'variant'];
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
/*
|
|
8
|
-
* The MIT License (MIT)
|
|
9
|
-
*
|
|
10
|
-
* Copyright (c) 2015 - present Instructure, Inc.
|
|
11
|
-
*
|
|
12
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
14
|
-
* in the Software without restriction, including without limitation the rights
|
|
15
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
17
|
-
* furnished to do so, subject to the following conditions:
|
|
18
|
-
*
|
|
19
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
20
|
-
* copies or substantial portions of the Software.
|
|
21
|
-
*
|
|
22
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
-
* SOFTWARE.
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* ---
|
|
33
|
-
* private: true
|
|
34
|
-
* ---
|
|
35
|
-
* Generates the style object from the theme and provided additional information
|
|
36
|
-
* @param {Object} componentTheme The theme variable object.
|
|
37
|
-
* @param {Object} props the props of the component, the style is applied to
|
|
38
|
-
* @param {Object} state the state of the component, the style is applied to
|
|
39
|
-
* @return {Object} The final style object, which will be used in the component
|
|
40
|
-
*/
|
|
41
|
-
const generateStyle = (componentTheme, props) => {
|
|
42
|
-
const variant = props.variant;
|
|
43
|
-
const backgroundStyle = variant === 'inverse' ? {
|
|
44
|
-
background: componentTheme.inverseBackground,
|
|
45
|
-
borderTop: `${componentTheme.borderWidth} solid ${componentTheme.inverseBorderColor}`
|
|
46
|
-
} : {
|
|
47
|
-
background: componentTheme.background,
|
|
48
|
-
borderTop: `${componentTheme.borderWidth} solid ${componentTheme.borderColor}`
|
|
49
|
-
};
|
|
50
|
-
return {
|
|
51
|
-
modalFooter: {
|
|
52
|
-
label: 'modalFooter',
|
|
53
|
-
flex: '0 0 auto',
|
|
54
|
-
boxSizing: 'border-box',
|
|
55
|
-
padding: componentTheme.padding,
|
|
56
|
-
borderBottomRightRadius: componentTheme.borderRadius,
|
|
57
|
-
borderBottomLeftRadius: componentTheme.borderRadius,
|
|
58
|
-
display: 'flex',
|
|
59
|
-
justifyContent: 'flex-end',
|
|
60
|
-
...backgroundStyle
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
var _default = exports.default = generateStyle;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
/*
|
|
8
|
-
* The MIT License (MIT)
|
|
9
|
-
*
|
|
10
|
-
* Copyright (c) 2015 - present Instructure, Inc.
|
|
11
|
-
*
|
|
12
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
14
|
-
* in the Software without restriction, including without limitation the rights
|
|
15
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
17
|
-
* furnished to do so, subject to the following conditions:
|
|
18
|
-
*
|
|
19
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
20
|
-
* copies or substantial portions of the Software.
|
|
21
|
-
*
|
|
22
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
-
* SOFTWARE.
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Generates the theme object for the component from the theme and provided additional information
|
|
33
|
-
* @param {Object} theme The actual theme object.
|
|
34
|
-
* @return {Object} The final theme object with the overrides and component variables
|
|
35
|
-
*/
|
|
36
|
-
const generateComponentTheme = theme => {
|
|
37
|
-
var _colors$contrasts, _colors$contrasts2, _colors$contrasts3, _colors$contrasts4;
|
|
38
|
-
const colors = theme.colors,
|
|
39
|
-
spacing = theme.spacing,
|
|
40
|
-
borders = theme.borders;
|
|
41
|
-
const componentVariables = {
|
|
42
|
-
background: colors === null || colors === void 0 ? void 0 : (_colors$contrasts = colors.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.grey1111,
|
|
43
|
-
borderColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts2 = colors.contrasts) === null || _colors$contrasts2 === void 0 ? void 0 : _colors$contrasts2.grey1424,
|
|
44
|
-
borderWidth: borders === null || borders === void 0 ? void 0 : borders.widthSmall,
|
|
45
|
-
borderRadius: borders === null || borders === void 0 ? void 0 : borders.radiusMedium,
|
|
46
|
-
padding: spacing === null || spacing === void 0 ? void 0 : spacing.small,
|
|
47
|
-
inverseBackground: colors === null || colors === void 0 ? void 0 : (_colors$contrasts3 = colors.contrasts) === null || _colors$contrasts3 === void 0 ? void 0 : _colors$contrasts3.grey100100,
|
|
48
|
-
inverseBorderColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts4 = colors.contrasts) === null || _colors$contrasts4 === void 0 ? void 0 : _colors$contrasts4.grey100100
|
|
49
|
-
};
|
|
50
|
-
return {
|
|
51
|
-
...componentVariables
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
var _default = exports.default = generateComponentTheme;
|