@instructure/ui-overlays 11.7.3-snapshot-7 → 11.7.3-snapshot-26
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 +5 -2
- package/es/Mask/v1/index.js +29 -28
- package/es/Mask/v1/styles.js +4 -2
- package/es/Mask/v1/theme.js +9 -8
- package/es/Mask/v2/index.js +29 -28
- package/es/Mask/v2/styles.js +4 -2
- package/es/Overlay/v1/index.js +38 -38
- package/lib/Mask/v1/index.js +29 -28
- package/lib/Mask/v1/styles.js +4 -2
- package/lib/Mask/v1/theme.js +9 -8
- package/lib/Mask/v2/index.js +29 -28
- package/lib/Mask/v2/styles.js +4 -2
- package/lib/Overlay/v1/index.js +38 -38
- package/package.json +21 -21
- package/tsconfig.build.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,9 +3,12 @@
|
|
|
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.7.3-snapshot-
|
|
6
|
+
## [11.7.3-snapshot-26](https://github.com/instructure/instructure-ui/compare/v11.7.2...v11.7.3-snapshot-26) (2026-05-05)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **many:** update dependencies, remove lots of Babel plugins, remove Webpack 4 support ([f916fca](https://github.com/instructure/instructure-ui/commit/f916fcafdddcb2d7de401f93e8ff92cfdfa47bba))
|
|
9
12
|
|
|
10
13
|
|
|
11
14
|
|
package/es/Mask/v1/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _dec, _class
|
|
1
|
+
var _dec, _class;
|
|
2
2
|
/*
|
|
3
3
|
* The MIT License (MIT)
|
|
4
4
|
*
|
|
@@ -37,34 +37,23 @@ category: components/utilities
|
|
|
37
37
|
---
|
|
38
38
|
**/
|
|
39
39
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
40
|
-
let Mask = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
elementRef(el);
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
// It can be a ref for any type of child
|
|
52
|
-
this._content = void 0;
|
|
53
|
-
this.contentRef = el => {
|
|
54
|
-
this._content = el;
|
|
55
|
-
};
|
|
56
|
-
}
|
|
40
|
+
let Mask = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class Mask extends Component {
|
|
41
|
+
static displayName = "Mask";
|
|
42
|
+
static componentId = 'Mask';
|
|
43
|
+
static allowedProps = allowedProps;
|
|
44
|
+
static defaultProps = {
|
|
45
|
+
placement: 'center',
|
|
46
|
+
fullscreen: false
|
|
47
|
+
};
|
|
57
48
|
componentDidMount() {
|
|
58
|
-
|
|
59
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
49
|
+
this.props.makeStyles?.();
|
|
60
50
|
if (this.props.fullscreen) {
|
|
61
51
|
noScroll.on();
|
|
62
52
|
MaskCounter.incrementCounter();
|
|
63
53
|
}
|
|
64
54
|
}
|
|
65
55
|
componentDidUpdate() {
|
|
66
|
-
|
|
67
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
56
|
+
this.props.makeStyles?.();
|
|
68
57
|
}
|
|
69
58
|
componentWillUnmount() {
|
|
70
59
|
if (this.props.fullscreen) {
|
|
@@ -74,14 +63,29 @@ let Mask = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class
|
|
|
74
63
|
}
|
|
75
64
|
}
|
|
76
65
|
}
|
|
66
|
+
ref = null;
|
|
67
|
+
handleElementRef = el => {
|
|
68
|
+
const {
|
|
69
|
+
elementRef
|
|
70
|
+
} = this.props;
|
|
71
|
+
this.ref = el;
|
|
72
|
+
if (typeof elementRef === 'function') {
|
|
73
|
+
elementRef(el);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
// It can be a ref for any type of child
|
|
78
|
+
_content;
|
|
79
|
+
contentRef = el => {
|
|
80
|
+
this._content = el;
|
|
81
|
+
};
|
|
77
82
|
render() {
|
|
78
|
-
var _this$props$styles;
|
|
79
83
|
const content = ensureSingleChild(this.props.children, {
|
|
80
84
|
ref: this.contentRef
|
|
81
85
|
});
|
|
82
86
|
const props = {
|
|
83
87
|
...omitProps(this.props, Mask.allowedProps),
|
|
84
|
-
css:
|
|
88
|
+
css: this.props.styles?.mask,
|
|
85
89
|
ref: this.handleElementRef
|
|
86
90
|
};
|
|
87
91
|
if (typeof this.props.onClick === 'function') {
|
|
@@ -93,9 +97,6 @@ let Mask = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class
|
|
|
93
97
|
children: content
|
|
94
98
|
});
|
|
95
99
|
}
|
|
96
|
-
}
|
|
97
|
-
placement: 'center',
|
|
98
|
-
fullscreen: false
|
|
99
|
-
}, _Mask)) || _class);
|
|
100
|
+
}) || _class);
|
|
100
101
|
export default Mask;
|
|
101
102
|
export { Mask };
|
package/es/Mask/v1/styles.js
CHANGED
|
@@ -33,8 +33,10 @@
|
|
|
33
33
|
* @return {Object} The final style object, which will be used in the component
|
|
34
34
|
*/
|
|
35
35
|
const generateStyle = (componentTheme, props) => {
|
|
36
|
-
const
|
|
37
|
-
|
|
36
|
+
const {
|
|
37
|
+
placement,
|
|
38
|
+
fullscreen
|
|
39
|
+
} = props;
|
|
38
40
|
const positionStyles = fullscreen ? {
|
|
39
41
|
position: 'fixed'
|
|
40
42
|
} : {
|
package/es/Mask/v1/theme.js
CHANGED
|
@@ -28,11 +28,12 @@
|
|
|
28
28
|
* @return {Object} The final theme object with the overrides and component variables
|
|
29
29
|
*/
|
|
30
30
|
const generateComponentTheme = theme => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
borders
|
|
34
|
-
stacking
|
|
35
|
-
themeName
|
|
31
|
+
const {
|
|
32
|
+
colors,
|
|
33
|
+
borders,
|
|
34
|
+
stacking,
|
|
35
|
+
key: themeName
|
|
36
|
+
} = theme;
|
|
36
37
|
const themeSpecificStyle = {
|
|
37
38
|
canvas: {
|
|
38
39
|
focusBorderColor: theme['ic-brand-primary']
|
|
@@ -42,9 +43,9 @@ const generateComponentTheme = theme => {
|
|
|
42
43
|
zIndex: stacking.topmost,
|
|
43
44
|
background: 'rgba(255, 255, 255, 0.75)',
|
|
44
45
|
borderColor: 'transparent',
|
|
45
|
-
focusBorderColor: colors
|
|
46
|
-
borderRadius: borders
|
|
47
|
-
borderWidth: borders
|
|
46
|
+
focusBorderColor: colors?.contrasts?.blue4570,
|
|
47
|
+
borderRadius: borders?.radiusMedium,
|
|
48
|
+
borderWidth: borders?.widthSmall
|
|
48
49
|
};
|
|
49
50
|
return {
|
|
50
51
|
...componentVariables,
|
package/es/Mask/v2/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _dec, _class
|
|
1
|
+
var _dec, _class;
|
|
2
2
|
/*
|
|
3
3
|
* The MIT License (MIT)
|
|
4
4
|
*
|
|
@@ -36,34 +36,23 @@ category: components/utilities
|
|
|
36
36
|
---
|
|
37
37
|
**/
|
|
38
38
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
39
|
-
let Mask = (_dec = withStyle(generateStyle), _dec(_class =
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
elementRef(el);
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
// It can be a ref for any type of child
|
|
51
|
-
this._content = void 0;
|
|
52
|
-
this.contentRef = el => {
|
|
53
|
-
this._content = el;
|
|
54
|
-
};
|
|
55
|
-
}
|
|
39
|
+
let Mask = (_dec = withStyle(generateStyle), _dec(_class = class Mask extends Component {
|
|
40
|
+
static displayName = "Mask";
|
|
41
|
+
static componentId = 'Mask';
|
|
42
|
+
static allowedProps = allowedProps;
|
|
43
|
+
static defaultProps = {
|
|
44
|
+
placement: 'center',
|
|
45
|
+
fullscreen: false
|
|
46
|
+
};
|
|
56
47
|
componentDidMount() {
|
|
57
|
-
|
|
58
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
48
|
+
this.props.makeStyles?.();
|
|
59
49
|
if (this.props.fullscreen) {
|
|
60
50
|
noScroll.on();
|
|
61
51
|
MaskCounter.incrementCounter();
|
|
62
52
|
}
|
|
63
53
|
}
|
|
64
54
|
componentDidUpdate() {
|
|
65
|
-
|
|
66
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
55
|
+
this.props.makeStyles?.();
|
|
67
56
|
}
|
|
68
57
|
componentWillUnmount() {
|
|
69
58
|
if (this.props.fullscreen) {
|
|
@@ -73,14 +62,29 @@ let Mask = (_dec = withStyle(generateStyle), _dec(_class = (_Mask = class Mask e
|
|
|
73
62
|
}
|
|
74
63
|
}
|
|
75
64
|
}
|
|
65
|
+
ref = null;
|
|
66
|
+
handleElementRef = el => {
|
|
67
|
+
const {
|
|
68
|
+
elementRef
|
|
69
|
+
} = this.props;
|
|
70
|
+
this.ref = el;
|
|
71
|
+
if (typeof elementRef === 'function') {
|
|
72
|
+
elementRef(el);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
// It can be a ref for any type of child
|
|
77
|
+
_content;
|
|
78
|
+
contentRef = el => {
|
|
79
|
+
this._content = el;
|
|
80
|
+
};
|
|
76
81
|
render() {
|
|
77
|
-
var _this$props$styles;
|
|
78
82
|
const content = ensureSingleChild(this.props.children, {
|
|
79
83
|
ref: this.contentRef
|
|
80
84
|
});
|
|
81
85
|
const props = {
|
|
82
86
|
...omitProps(this.props, Mask.allowedProps),
|
|
83
|
-
css:
|
|
87
|
+
css: this.props.styles?.mask,
|
|
84
88
|
ref: this.handleElementRef
|
|
85
89
|
};
|
|
86
90
|
if (typeof this.props.onClick === 'function') {
|
|
@@ -92,9 +96,6 @@ let Mask = (_dec = withStyle(generateStyle), _dec(_class = (_Mask = class Mask e
|
|
|
92
96
|
children: content
|
|
93
97
|
});
|
|
94
98
|
}
|
|
95
|
-
}
|
|
96
|
-
placement: 'center',
|
|
97
|
-
fullscreen: false
|
|
98
|
-
}, _Mask)) || _class);
|
|
99
|
+
}) || _class);
|
|
99
100
|
export default Mask;
|
|
100
101
|
export { Mask };
|
package/es/Mask/v2/styles.js
CHANGED
|
@@ -34,8 +34,10 @@
|
|
|
34
34
|
* @return {Object} The final style object, which will be used in the component
|
|
35
35
|
*/
|
|
36
36
|
const generateStyle = (componentTheme, props) => {
|
|
37
|
-
const
|
|
38
|
-
|
|
37
|
+
const {
|
|
38
|
+
placement,
|
|
39
|
+
fullscreen
|
|
40
|
+
} = props;
|
|
39
41
|
const positionStyles = fullscreen ? {
|
|
40
42
|
position: 'fixed'
|
|
41
43
|
} : {
|
package/es/Overlay/v1/index.js
CHANGED
|
@@ -36,36 +36,35 @@ category: components
|
|
|
36
36
|
**/
|
|
37
37
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
38
38
|
class Overlay extends Component {
|
|
39
|
+
static displayName = "Overlay";
|
|
40
|
+
static allowedProps = allowedProps;
|
|
41
|
+
static defaultProps = {
|
|
42
|
+
open: false,
|
|
43
|
+
insertAt: 'bottom',
|
|
44
|
+
shouldContainFocus: false,
|
|
45
|
+
shouldReturnFocus: false,
|
|
46
|
+
shouldCloseOnDocumentClick: false,
|
|
47
|
+
shouldCloseOnEscape: true,
|
|
48
|
+
in: false,
|
|
49
|
+
unmountOnExit: false,
|
|
50
|
+
transitionOnMount: false,
|
|
51
|
+
transitionEnter: true,
|
|
52
|
+
transitionExit: true
|
|
53
|
+
};
|
|
39
54
|
constructor(props) {
|
|
40
55
|
super(props);
|
|
41
|
-
this._timeouts = [];
|
|
42
|
-
this._DOMNode = null;
|
|
43
|
-
this._isMounted = false;
|
|
44
|
-
this.ref = null;
|
|
45
|
-
this.handleRef = el => {
|
|
46
|
-
this.ref = el;
|
|
47
|
-
};
|
|
48
|
-
this.handlePortalOpen = DOMNode => {
|
|
49
|
-
this.DOMNode = DOMNode;
|
|
50
|
-
this._timeouts.push(setTimeout(() => {
|
|
51
|
-
if (this._isMounted) {
|
|
52
|
-
this.setState({
|
|
53
|
-
open: true
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}));
|
|
57
|
-
};
|
|
58
|
-
this.handleTransitionExited = _type => {
|
|
59
|
-
this.setState({
|
|
60
|
-
open: false,
|
|
61
|
-
transitioning: false
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
56
|
this.state = {
|
|
65
57
|
open: props.open,
|
|
66
58
|
transitioning: false
|
|
67
59
|
};
|
|
68
60
|
}
|
|
61
|
+
_timeouts = [];
|
|
62
|
+
_DOMNode = null;
|
|
63
|
+
_isMounted = false;
|
|
64
|
+
ref = null;
|
|
65
|
+
handleRef = el => {
|
|
66
|
+
this.ref = el;
|
|
67
|
+
};
|
|
69
68
|
componentDidMount() {
|
|
70
69
|
this._isMounted = true;
|
|
71
70
|
}
|
|
@@ -87,6 +86,22 @@ class Overlay extends Component {
|
|
|
87
86
|
set DOMNode(el) {
|
|
88
87
|
this._DOMNode = el;
|
|
89
88
|
}
|
|
89
|
+
handlePortalOpen = DOMNode => {
|
|
90
|
+
this.DOMNode = DOMNode;
|
|
91
|
+
this._timeouts.push(setTimeout(() => {
|
|
92
|
+
if (this._isMounted) {
|
|
93
|
+
this.setState({
|
|
94
|
+
open: true
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}));
|
|
98
|
+
};
|
|
99
|
+
handleTransitionExited = _type => {
|
|
100
|
+
this.setState({
|
|
101
|
+
open: false,
|
|
102
|
+
transitioning: false
|
|
103
|
+
});
|
|
104
|
+
};
|
|
90
105
|
renderTransition(content) {
|
|
91
106
|
return _jsx(Transition, {
|
|
92
107
|
...pickProps(this.props, Transition.allowedProps),
|
|
@@ -121,20 +136,5 @@ class Overlay extends Component {
|
|
|
121
136
|
});
|
|
122
137
|
}
|
|
123
138
|
}
|
|
124
|
-
Overlay.displayName = "Overlay";
|
|
125
|
-
Overlay.allowedProps = allowedProps;
|
|
126
|
-
Overlay.defaultProps = {
|
|
127
|
-
open: false,
|
|
128
|
-
insertAt: 'bottom',
|
|
129
|
-
shouldContainFocus: false,
|
|
130
|
-
shouldReturnFocus: false,
|
|
131
|
-
shouldCloseOnDocumentClick: false,
|
|
132
|
-
shouldCloseOnEscape: true,
|
|
133
|
-
in: false,
|
|
134
|
-
unmountOnExit: false,
|
|
135
|
-
transitionOnMount: false,
|
|
136
|
-
transitionEnter: true,
|
|
137
|
-
transitionExit: true
|
|
138
|
-
};
|
|
139
139
|
export default Overlay;
|
|
140
140
|
export { Overlay };
|
package/lib/Mask/v1/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var _theme = _interopRequireDefault(require("./theme"));
|
|
|
15
15
|
var _props = require("./props");
|
|
16
16
|
var _MaskCounter = _interopRequireDefault(require("./MaskCounter"));
|
|
17
17
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
18
|
-
var _dec, _class
|
|
18
|
+
var _dec, _class;
|
|
19
19
|
/*
|
|
20
20
|
* The MIT License (MIT)
|
|
21
21
|
*
|
|
@@ -44,34 +44,23 @@ var _dec, _class, _Mask;
|
|
|
44
44
|
category: components/utilities
|
|
45
45
|
---
|
|
46
46
|
**/
|
|
47
|
-
let Mask = exports.Mask = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class =
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
elementRef(el);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
// It can be a ref for any type of child
|
|
59
|
-
this._content = void 0;
|
|
60
|
-
this.contentRef = el => {
|
|
61
|
-
this._content = el;
|
|
62
|
-
};
|
|
63
|
-
}
|
|
47
|
+
let Mask = exports.Mask = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = class Mask extends _react.Component {
|
|
48
|
+
static displayName = "Mask";
|
|
49
|
+
static componentId = 'Mask';
|
|
50
|
+
static allowedProps = _props.allowedProps;
|
|
51
|
+
static defaultProps = {
|
|
52
|
+
placement: 'center',
|
|
53
|
+
fullscreen: false
|
|
54
|
+
};
|
|
64
55
|
componentDidMount() {
|
|
65
|
-
|
|
66
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
56
|
+
this.props.makeStyles?.();
|
|
67
57
|
if (this.props.fullscreen) {
|
|
68
58
|
_noScroll.default.on();
|
|
69
59
|
_MaskCounter.default.incrementCounter();
|
|
70
60
|
}
|
|
71
61
|
}
|
|
72
62
|
componentDidUpdate() {
|
|
73
|
-
|
|
74
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
63
|
+
this.props.makeStyles?.();
|
|
75
64
|
}
|
|
76
65
|
componentWillUnmount() {
|
|
77
66
|
if (this.props.fullscreen) {
|
|
@@ -81,14 +70,29 @@ let Mask = exports.Mask = (_dec = (0, _emotion.withStyleLegacy)(_styles.default,
|
|
|
81
70
|
}
|
|
82
71
|
}
|
|
83
72
|
}
|
|
73
|
+
ref = null;
|
|
74
|
+
handleElementRef = el => {
|
|
75
|
+
const {
|
|
76
|
+
elementRef
|
|
77
|
+
} = this.props;
|
|
78
|
+
this.ref = el;
|
|
79
|
+
if (typeof elementRef === 'function') {
|
|
80
|
+
elementRef(el);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// It can be a ref for any type of child
|
|
85
|
+
_content;
|
|
86
|
+
contentRef = el => {
|
|
87
|
+
this._content = el;
|
|
88
|
+
};
|
|
84
89
|
render() {
|
|
85
|
-
var _this$props$styles;
|
|
86
90
|
const content = (0, _ensureSingleChild.ensureSingleChild)(this.props.children, {
|
|
87
91
|
ref: this.contentRef
|
|
88
92
|
});
|
|
89
93
|
const props = {
|
|
90
94
|
...(0, _omitProps.omitProps)(this.props, Mask.allowedProps),
|
|
91
|
-
css:
|
|
95
|
+
css: this.props.styles?.mask,
|
|
92
96
|
ref: this.handleElementRef
|
|
93
97
|
};
|
|
94
98
|
if (typeof this.props.onClick === 'function') {
|
|
@@ -100,8 +104,5 @@ let Mask = exports.Mask = (_dec = (0, _emotion.withStyleLegacy)(_styles.default,
|
|
|
100
104
|
children: content
|
|
101
105
|
});
|
|
102
106
|
}
|
|
103
|
-
}
|
|
104
|
-
placement: 'center',
|
|
105
|
-
fullscreen: false
|
|
106
|
-
}, _Mask)) || _class);
|
|
107
|
+
}) || _class);
|
|
107
108
|
var _default = exports.default = Mask;
|
package/lib/Mask/v1/styles.js
CHANGED
|
@@ -39,8 +39,10 @@ exports.default = void 0;
|
|
|
39
39
|
* @return {Object} The final style object, which will be used in the component
|
|
40
40
|
*/
|
|
41
41
|
const generateStyle = (componentTheme, props) => {
|
|
42
|
-
const
|
|
43
|
-
|
|
42
|
+
const {
|
|
43
|
+
placement,
|
|
44
|
+
fullscreen
|
|
45
|
+
} = props;
|
|
44
46
|
const positionStyles = fullscreen ? {
|
|
45
47
|
position: 'fixed'
|
|
46
48
|
} : {
|
package/lib/Mask/v1/theme.js
CHANGED
|
@@ -34,11 +34,12 @@ exports.default = void 0;
|
|
|
34
34
|
* @return {Object} The final theme object with the overrides and component variables
|
|
35
35
|
*/
|
|
36
36
|
const generateComponentTheme = theme => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
borders
|
|
40
|
-
stacking
|
|
41
|
-
themeName
|
|
37
|
+
const {
|
|
38
|
+
colors,
|
|
39
|
+
borders,
|
|
40
|
+
stacking,
|
|
41
|
+
key: themeName
|
|
42
|
+
} = theme;
|
|
42
43
|
const themeSpecificStyle = {
|
|
43
44
|
canvas: {
|
|
44
45
|
focusBorderColor: theme['ic-brand-primary']
|
|
@@ -48,9 +49,9 @@ const generateComponentTheme = theme => {
|
|
|
48
49
|
zIndex: stacking.topmost,
|
|
49
50
|
background: 'rgba(255, 255, 255, 0.75)',
|
|
50
51
|
borderColor: 'transparent',
|
|
51
|
-
focusBorderColor: colors
|
|
52
|
-
borderRadius: borders
|
|
53
|
-
borderWidth: borders
|
|
52
|
+
focusBorderColor: colors?.contrasts?.blue4570,
|
|
53
|
+
borderRadius: borders?.radiusMedium,
|
|
54
|
+
borderWidth: borders?.widthSmall
|
|
54
55
|
};
|
|
55
56
|
return {
|
|
56
57
|
...componentVariables,
|
package/lib/Mask/v2/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var _styles = _interopRequireDefault(require("./styles"));
|
|
|
14
14
|
var _props = require("./props");
|
|
15
15
|
var _MaskCounter = _interopRequireDefault(require("./MaskCounter"));
|
|
16
16
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
17
|
-
var _dec, _class
|
|
17
|
+
var _dec, _class;
|
|
18
18
|
/*
|
|
19
19
|
* The MIT License (MIT)
|
|
20
20
|
*
|
|
@@ -43,34 +43,23 @@ var _dec, _class, _Mask;
|
|
|
43
43
|
category: components/utilities
|
|
44
44
|
---
|
|
45
45
|
**/
|
|
46
|
-
let Mask = exports.Mask = (_dec = (0, _emotion.withStyle)(_styles.default), _dec(_class =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
elementRef(el);
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
// It can be a ref for any type of child
|
|
58
|
-
this._content = void 0;
|
|
59
|
-
this.contentRef = el => {
|
|
60
|
-
this._content = el;
|
|
61
|
-
};
|
|
62
|
-
}
|
|
46
|
+
let Mask = exports.Mask = (_dec = (0, _emotion.withStyle)(_styles.default), _dec(_class = class Mask extends _react.Component {
|
|
47
|
+
static displayName = "Mask";
|
|
48
|
+
static componentId = 'Mask';
|
|
49
|
+
static allowedProps = _props.allowedProps;
|
|
50
|
+
static defaultProps = {
|
|
51
|
+
placement: 'center',
|
|
52
|
+
fullscreen: false
|
|
53
|
+
};
|
|
63
54
|
componentDidMount() {
|
|
64
|
-
|
|
65
|
-
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
55
|
+
this.props.makeStyles?.();
|
|
66
56
|
if (this.props.fullscreen) {
|
|
67
57
|
_noScroll.default.on();
|
|
68
58
|
_MaskCounter.default.incrementCounter();
|
|
69
59
|
}
|
|
70
60
|
}
|
|
71
61
|
componentDidUpdate() {
|
|
72
|
-
|
|
73
|
-
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
62
|
+
this.props.makeStyles?.();
|
|
74
63
|
}
|
|
75
64
|
componentWillUnmount() {
|
|
76
65
|
if (this.props.fullscreen) {
|
|
@@ -80,14 +69,29 @@ let Mask = exports.Mask = (_dec = (0, _emotion.withStyle)(_styles.default), _dec
|
|
|
80
69
|
}
|
|
81
70
|
}
|
|
82
71
|
}
|
|
72
|
+
ref = null;
|
|
73
|
+
handleElementRef = el => {
|
|
74
|
+
const {
|
|
75
|
+
elementRef
|
|
76
|
+
} = this.props;
|
|
77
|
+
this.ref = el;
|
|
78
|
+
if (typeof elementRef === 'function') {
|
|
79
|
+
elementRef(el);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
// It can be a ref for any type of child
|
|
84
|
+
_content;
|
|
85
|
+
contentRef = el => {
|
|
86
|
+
this._content = el;
|
|
87
|
+
};
|
|
83
88
|
render() {
|
|
84
|
-
var _this$props$styles;
|
|
85
89
|
const content = (0, _ensureSingleChild.ensureSingleChild)(this.props.children, {
|
|
86
90
|
ref: this.contentRef
|
|
87
91
|
});
|
|
88
92
|
const props = {
|
|
89
93
|
...(0, _omitProps.omitProps)(this.props, Mask.allowedProps),
|
|
90
|
-
css:
|
|
94
|
+
css: this.props.styles?.mask,
|
|
91
95
|
ref: this.handleElementRef
|
|
92
96
|
};
|
|
93
97
|
if (typeof this.props.onClick === 'function') {
|
|
@@ -99,8 +103,5 @@ let Mask = exports.Mask = (_dec = (0, _emotion.withStyle)(_styles.default), _dec
|
|
|
99
103
|
children: content
|
|
100
104
|
});
|
|
101
105
|
}
|
|
102
|
-
}
|
|
103
|
-
placement: 'center',
|
|
104
|
-
fullscreen: false
|
|
105
|
-
}, _Mask)) || _class);
|
|
106
|
+
}) || _class);
|
|
106
107
|
var _default = exports.default = Mask;
|
package/lib/Mask/v2/styles.js
CHANGED
|
@@ -40,8 +40,10 @@ exports.default = void 0;
|
|
|
40
40
|
* @return {Object} The final style object, which will be used in the component
|
|
41
41
|
*/
|
|
42
42
|
const generateStyle = (componentTheme, props) => {
|
|
43
|
-
const
|
|
44
|
-
|
|
43
|
+
const {
|
|
44
|
+
placement,
|
|
45
|
+
fullscreen
|
|
46
|
+
} = props;
|
|
45
47
|
const positionStyles = fullscreen ? {
|
|
46
48
|
position: 'fixed'
|
|
47
49
|
} : {
|