@instructure/ui-alerts 8.25.1-snapshot-7 → 8.25.1-snapshot-10
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 +1 -1
- package/es/Alert/index.js +63 -61
- package/lib/Alert/index.js +63 -61
- package/package.json +16 -16
- package/tsconfig.build.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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
|
-
## [8.25.1-snapshot-
|
|
6
|
+
## [8.25.1-snapshot-10](https://github.com/instructure/instructure-ui/compare/v8.25.0...v8.25.1-snapshot-10) (2022-06-20)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-alerts
|
|
9
9
|
|
package/es/Alert/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _dec, _dec2, _class
|
|
1
|
+
var _dec, _dec2, _class;
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
* The MIT License (MIT)
|
|
@@ -47,67 +47,74 @@ category: components
|
|
|
47
47
|
---
|
|
48
48
|
@tsProps
|
|
49
49
|
**/
|
|
50
|
-
let Alert = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec(_class = _dec2(_class =
|
|
50
|
+
let Alert = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec(_class = _dec2(_class = class Alert extends Component {
|
|
51
|
+
static displayName = "Alert";
|
|
52
|
+
static componentId = 'Alert';
|
|
53
|
+
static propTypes = propTypes;
|
|
54
|
+
static allowedProps = allowedProps;
|
|
55
|
+
static defaultProps = {
|
|
56
|
+
variant: 'info',
|
|
57
|
+
margin: 'x-small 0',
|
|
58
|
+
timeout: 0,
|
|
59
|
+
transition: 'fade',
|
|
60
|
+
open: true,
|
|
61
|
+
screenReaderOnly: false,
|
|
62
|
+
liveRegionPoliteness: 'assertive',
|
|
63
|
+
isLiveRegionAtomic: false,
|
|
64
|
+
children: null,
|
|
65
|
+
hasShadow: true
|
|
66
|
+
};
|
|
67
|
+
|
|
51
68
|
constructor(props) {
|
|
52
69
|
super(props);
|
|
53
|
-
this._timeouts = [];
|
|
54
|
-
this.srid = void 0;
|
|
55
|
-
this.variantUI = {
|
|
56
|
-
error: IconNoSolid,
|
|
57
|
-
info: IconInfoBorderlessSolid,
|
|
58
|
-
success: IconCheckMarkSolid,
|
|
59
|
-
warning: IconWarningBorderlessSolid
|
|
60
|
-
};
|
|
61
|
-
this.ref = null;
|
|
62
|
-
|
|
63
|
-
this.handleRef = el => {
|
|
64
|
-
this.ref = el;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
this.handleTimeout = () => {
|
|
68
|
-
if (this.props.timeout > 0) {
|
|
69
|
-
this._timeouts.push(setTimeout(() => {
|
|
70
|
-
this.close();
|
|
71
|
-
}, this.props.timeout));
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
this.onExitTransition = () => {
|
|
76
|
-
if (this.props.onDismiss) {
|
|
77
|
-
this.props.onDismiss();
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
this.close = () => {
|
|
82
|
-
this.clearTimeouts();
|
|
83
|
-
this.removeScreenreaderAlert();
|
|
84
|
-
this.setState({
|
|
85
|
-
open: false
|
|
86
|
-
}, () => {
|
|
87
|
-
if (this.props.onDismiss && this.props.transition === 'none') {
|
|
88
|
-
this.props.onDismiss();
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
this.handleKeyUp = event => {
|
|
94
|
-
if (this.props.renderCloseButtonLabel && event.keyCode === keycode.codes.esc) {
|
|
95
|
-
this.close();
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
|
|
99
70
|
this.state = {
|
|
100
71
|
open: true
|
|
101
72
|
};
|
|
102
73
|
}
|
|
103
74
|
|
|
75
|
+
_timeouts = [];
|
|
76
|
+
srid;
|
|
77
|
+
variantUI = {
|
|
78
|
+
error: IconNoSolid,
|
|
79
|
+
info: IconInfoBorderlessSolid,
|
|
80
|
+
success: IconCheckMarkSolid,
|
|
81
|
+
warning: IconWarningBorderlessSolid
|
|
82
|
+
};
|
|
83
|
+
ref = null;
|
|
84
|
+
handleRef = el => {
|
|
85
|
+
this.ref = el;
|
|
86
|
+
};
|
|
87
|
+
handleTimeout = () => {
|
|
88
|
+
if (this.props.timeout > 0) {
|
|
89
|
+
this._timeouts.push(setTimeout(() => {
|
|
90
|
+
this.close();
|
|
91
|
+
}, this.props.timeout));
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
104
95
|
clearTimeouts() {
|
|
105
96
|
this._timeouts.forEach(timeout => clearTimeout(timeout));
|
|
106
97
|
|
|
107
98
|
this._timeouts = [];
|
|
108
99
|
}
|
|
109
100
|
|
|
110
|
-
|
|
101
|
+
onExitTransition = () => {
|
|
102
|
+
if (this.props.onDismiss) {
|
|
103
|
+
this.props.onDismiss();
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
close = () => {
|
|
107
|
+
this.clearTimeouts();
|
|
108
|
+
this.removeScreenreaderAlert();
|
|
109
|
+
this.setState({
|
|
110
|
+
open: false
|
|
111
|
+
}, () => {
|
|
112
|
+
if (this.props.onDismiss && this.props.transition === 'none') {
|
|
113
|
+
this.props.onDismiss();
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}; // duck type for a dom node
|
|
117
|
+
|
|
111
118
|
isDOMNode(n) {
|
|
112
119
|
return n && typeof n === 'object' && n.nodeType === 1;
|
|
113
120
|
}
|
|
@@ -193,6 +200,12 @@ let Alert = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gene
|
|
|
193
200
|
}
|
|
194
201
|
}
|
|
195
202
|
|
|
203
|
+
handleKeyUp = event => {
|
|
204
|
+
if (this.props.renderCloseButtonLabel && event.keyCode === keycode.codes.esc) {
|
|
205
|
+
this.close();
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
|
|
196
209
|
componentDidMount() {
|
|
197
210
|
var _this$props$makeStyle, _this$props;
|
|
198
211
|
|
|
@@ -285,17 +298,6 @@ let Alert = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gene
|
|
|
285
298
|
}, this.renderAlert());
|
|
286
299
|
}
|
|
287
300
|
|
|
288
|
-
}
|
|
289
|
-
variant: 'info',
|
|
290
|
-
margin: 'x-small 0',
|
|
291
|
-
timeout: 0,
|
|
292
|
-
transition: 'fade',
|
|
293
|
-
open: true,
|
|
294
|
-
screenReaderOnly: false,
|
|
295
|
-
liveRegionPoliteness: 'assertive',
|
|
296
|
-
isLiveRegionAtomic: false,
|
|
297
|
-
children: null,
|
|
298
|
-
hasShadow: true
|
|
299
|
-
}, _class2)) || _class) || _class);
|
|
301
|
+
}) || _class) || _class);
|
|
300
302
|
export default Alert;
|
|
301
303
|
export { Alert };
|
package/lib/Alert/index.js
CHANGED
|
@@ -47,7 +47,7 @@ var _theme = _interopRequireDefault(require("./theme"));
|
|
|
47
47
|
|
|
48
48
|
var _props = require("./props");
|
|
49
49
|
|
|
50
|
-
var _dec, _dec2, _class
|
|
50
|
+
var _dec, _dec2, _class;
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
---
|
|
@@ -55,67 +55,74 @@ category: components
|
|
|
55
55
|
---
|
|
56
56
|
@tsProps
|
|
57
57
|
**/
|
|
58
|
-
let Alert = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = _dec2(_class =
|
|
58
|
+
let Alert = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = _dec2(_class = class Alert extends _react.Component {
|
|
59
|
+
static displayName = "Alert";
|
|
60
|
+
static componentId = 'Alert';
|
|
61
|
+
static propTypes = _props.propTypes;
|
|
62
|
+
static allowedProps = _props.allowedProps;
|
|
63
|
+
static defaultProps = {
|
|
64
|
+
variant: 'info',
|
|
65
|
+
margin: 'x-small 0',
|
|
66
|
+
timeout: 0,
|
|
67
|
+
transition: 'fade',
|
|
68
|
+
open: true,
|
|
69
|
+
screenReaderOnly: false,
|
|
70
|
+
liveRegionPoliteness: 'assertive',
|
|
71
|
+
isLiveRegionAtomic: false,
|
|
72
|
+
children: null,
|
|
73
|
+
hasShadow: true
|
|
74
|
+
};
|
|
75
|
+
|
|
59
76
|
constructor(props) {
|
|
60
77
|
super(props);
|
|
61
|
-
this._timeouts = [];
|
|
62
|
-
this.srid = void 0;
|
|
63
|
-
this.variantUI = {
|
|
64
|
-
error: _IconNoSolid.IconNoSolid,
|
|
65
|
-
info: _IconInfoBorderlessSolid.IconInfoBorderlessSolid,
|
|
66
|
-
success: _IconCheckMarkSolid.IconCheckMarkSolid,
|
|
67
|
-
warning: _IconWarningBorderlessSolid.IconWarningBorderlessSolid
|
|
68
|
-
};
|
|
69
|
-
this.ref = null;
|
|
70
|
-
|
|
71
|
-
this.handleRef = el => {
|
|
72
|
-
this.ref = el;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
this.handleTimeout = () => {
|
|
76
|
-
if (this.props.timeout > 0) {
|
|
77
|
-
this._timeouts.push(setTimeout(() => {
|
|
78
|
-
this.close();
|
|
79
|
-
}, this.props.timeout));
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
this.onExitTransition = () => {
|
|
84
|
-
if (this.props.onDismiss) {
|
|
85
|
-
this.props.onDismiss();
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
this.close = () => {
|
|
90
|
-
this.clearTimeouts();
|
|
91
|
-
this.removeScreenreaderAlert();
|
|
92
|
-
this.setState({
|
|
93
|
-
open: false
|
|
94
|
-
}, () => {
|
|
95
|
-
if (this.props.onDismiss && this.props.transition === 'none') {
|
|
96
|
-
this.props.onDismiss();
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
this.handleKeyUp = event => {
|
|
102
|
-
if (this.props.renderCloseButtonLabel && event.keyCode === _keycode.default.codes.esc) {
|
|
103
|
-
this.close();
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
|
|
107
78
|
this.state = {
|
|
108
79
|
open: true
|
|
109
80
|
};
|
|
110
81
|
}
|
|
111
82
|
|
|
83
|
+
_timeouts = [];
|
|
84
|
+
srid;
|
|
85
|
+
variantUI = {
|
|
86
|
+
error: _IconNoSolid.IconNoSolid,
|
|
87
|
+
info: _IconInfoBorderlessSolid.IconInfoBorderlessSolid,
|
|
88
|
+
success: _IconCheckMarkSolid.IconCheckMarkSolid,
|
|
89
|
+
warning: _IconWarningBorderlessSolid.IconWarningBorderlessSolid
|
|
90
|
+
};
|
|
91
|
+
ref = null;
|
|
92
|
+
handleRef = el => {
|
|
93
|
+
this.ref = el;
|
|
94
|
+
};
|
|
95
|
+
handleTimeout = () => {
|
|
96
|
+
if (this.props.timeout > 0) {
|
|
97
|
+
this._timeouts.push(setTimeout(() => {
|
|
98
|
+
this.close();
|
|
99
|
+
}, this.props.timeout));
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
|
|
112
103
|
clearTimeouts() {
|
|
113
104
|
this._timeouts.forEach(timeout => clearTimeout(timeout));
|
|
114
105
|
|
|
115
106
|
this._timeouts = [];
|
|
116
107
|
}
|
|
117
108
|
|
|
118
|
-
|
|
109
|
+
onExitTransition = () => {
|
|
110
|
+
if (this.props.onDismiss) {
|
|
111
|
+
this.props.onDismiss();
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
close = () => {
|
|
115
|
+
this.clearTimeouts();
|
|
116
|
+
this.removeScreenreaderAlert();
|
|
117
|
+
this.setState({
|
|
118
|
+
open: false
|
|
119
|
+
}, () => {
|
|
120
|
+
if (this.props.onDismiss && this.props.transition === 'none') {
|
|
121
|
+
this.props.onDismiss();
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}; // duck type for a dom node
|
|
125
|
+
|
|
119
126
|
isDOMNode(n) {
|
|
120
127
|
return n && typeof n === 'object' && n.nodeType === 1;
|
|
121
128
|
}
|
|
@@ -204,6 +211,12 @@ let Alert = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
|
|
|
204
211
|
}
|
|
205
212
|
}
|
|
206
213
|
|
|
214
|
+
handleKeyUp = event => {
|
|
215
|
+
if (this.props.renderCloseButtonLabel && event.keyCode === _keycode.default.codes.esc) {
|
|
216
|
+
this.close();
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
|
|
207
220
|
componentDidMount() {
|
|
208
221
|
var _this$props$makeStyle, _this$props;
|
|
209
222
|
|
|
@@ -296,18 +309,7 @@ let Alert = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
|
|
|
296
309
|
}, this.renderAlert());
|
|
297
310
|
}
|
|
298
311
|
|
|
299
|
-
}
|
|
300
|
-
variant: 'info',
|
|
301
|
-
margin: 'x-small 0',
|
|
302
|
-
timeout: 0,
|
|
303
|
-
transition: 'fade',
|
|
304
|
-
open: true,
|
|
305
|
-
screenReaderOnly: false,
|
|
306
|
-
liveRegionPoliteness: 'assertive',
|
|
307
|
-
isLiveRegionAtomic: false,
|
|
308
|
-
children: null,
|
|
309
|
-
hasShadow: true
|
|
310
|
-
}, _class2)) || _class) || _class);
|
|
312
|
+
}) || _class) || _class);
|
|
311
313
|
exports.Alert = Alert;
|
|
312
314
|
var _default = Alert;
|
|
313
315
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-alerts",
|
|
3
|
-
"version": "8.25.1-snapshot-
|
|
3
|
+
"version": "8.25.1-snapshot-10",
|
|
4
4
|
"description": "An alert component",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -23,24 +23,24 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-babel-preset": "8.25.1-snapshot-
|
|
27
|
-
"@instructure/ui-color-utils": "8.25.1-snapshot-
|
|
28
|
-
"@instructure/ui-test-utils": "8.25.1-snapshot-
|
|
26
|
+
"@instructure/ui-babel-preset": "8.25.1-snapshot-10",
|
|
27
|
+
"@instructure/ui-color-utils": "8.25.1-snapshot-10",
|
|
28
|
+
"@instructure/ui-test-utils": "8.25.1-snapshot-10"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@babel/runtime": "^7.13.10",
|
|
32
|
-
"@instructure/console": "8.25.1-snapshot-
|
|
33
|
-
"@instructure/emotion": "8.25.1-snapshot-
|
|
34
|
-
"@instructure/shared-types": "8.25.1-snapshot-
|
|
35
|
-
"@instructure/ui-a11y-content": "8.25.1-snapshot-
|
|
36
|
-
"@instructure/ui-buttons": "8.25.1-snapshot-
|
|
37
|
-
"@instructure/ui-icons": "8.25.1-snapshot-
|
|
38
|
-
"@instructure/ui-motion": "8.25.1-snapshot-
|
|
39
|
-
"@instructure/ui-react-utils": "8.25.1-snapshot-
|
|
40
|
-
"@instructure/ui-themes": "8.25.1-snapshot-
|
|
41
|
-
"@instructure/ui-utils": "8.25.1-snapshot-
|
|
42
|
-
"@instructure/ui-view": "8.25.1-snapshot-
|
|
43
|
-
"@instructure/uid": "8.25.1-snapshot-
|
|
32
|
+
"@instructure/console": "8.25.1-snapshot-10",
|
|
33
|
+
"@instructure/emotion": "8.25.1-snapshot-10",
|
|
34
|
+
"@instructure/shared-types": "8.25.1-snapshot-10",
|
|
35
|
+
"@instructure/ui-a11y-content": "8.25.1-snapshot-10",
|
|
36
|
+
"@instructure/ui-buttons": "8.25.1-snapshot-10",
|
|
37
|
+
"@instructure/ui-icons": "8.25.1-snapshot-10",
|
|
38
|
+
"@instructure/ui-motion": "8.25.1-snapshot-10",
|
|
39
|
+
"@instructure/ui-react-utils": "8.25.1-snapshot-10",
|
|
40
|
+
"@instructure/ui-themes": "8.25.1-snapshot-10",
|
|
41
|
+
"@instructure/ui-utils": "8.25.1-snapshot-10",
|
|
42
|
+
"@instructure/ui-view": "8.25.1-snapshot-10",
|
|
43
|
+
"@instructure/uid": "8.25.1-snapshot-10",
|
|
44
44
|
"keycode": "^2",
|
|
45
45
|
"prop-types": "^15"
|
|
46
46
|
},
|