@instructure/ui-alerts 8.25.1-snapshot-10 → 8.25.1-snapshot-13

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 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-10](https://github.com/instructure/instructure-ui/compare/v8.25.0...v8.25.1-snapshot-10) (2022-06-20)
6
+ ## [8.25.1-snapshot-13](https://github.com/instructure/instructure-ui/compare/v8.25.0...v8.25.1-snapshot-13) (2022-06-22)
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, _class2;
2
2
 
3
3
  /*
4
4
  * The MIT License (MIT)
@@ -47,74 +47,67 @@ category: components
47
47
  ---
48
48
  @tsProps
49
49
  **/
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
-
50
+ let Alert = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec(_class = _dec2(_class = (_class2 = class Alert extends Component {
68
51
  constructor(props) {
69
52
  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
+
70
99
  this.state = {
71
100
  open: true
72
101
  };
73
102
  }
74
103
 
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
-
95
104
  clearTimeouts() {
96
105
  this._timeouts.forEach(timeout => clearTimeout(timeout));
97
106
 
98
107
  this._timeouts = [];
99
108
  }
100
109
 
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
-
110
+ // duck type for a dom node
118
111
  isDOMNode(n) {
119
112
  return n && typeof n === 'object' && n.nodeType === 1;
120
113
  }
@@ -200,12 +193,6 @@ let Alert = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gene
200
193
  }
201
194
  }
202
195
 
203
- handleKeyUp = event => {
204
- if (this.props.renderCloseButtonLabel && event.keyCode === keycode.codes.esc) {
205
- this.close();
206
- }
207
- };
208
-
209
196
  componentDidMount() {
210
197
  var _this$props$makeStyle, _this$props;
211
198
 
@@ -298,6 +285,17 @@ let Alert = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gene
298
285
  }, this.renderAlert());
299
286
  }
300
287
 
301
- }) || _class) || _class);
288
+ }, _class2.displayName = "Alert", _class2.componentId = 'Alert', _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {
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);
302
300
  export default Alert;
303
301
  export { Alert };
@@ -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, _class2;
51
51
 
52
52
  /**
53
53
  ---
@@ -55,74 +55,67 @@ 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 = 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
-
58
+ let Alert = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = _dec2(_class = (_class2 = class Alert extends _react.Component {
76
59
  constructor(props) {
77
60
  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
+
78
107
  this.state = {
79
108
  open: true
80
109
  };
81
110
  }
82
111
 
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
-
103
112
  clearTimeouts() {
104
113
  this._timeouts.forEach(timeout => clearTimeout(timeout));
105
114
 
106
115
  this._timeouts = [];
107
116
  }
108
117
 
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
-
118
+ // duck type for a dom node
126
119
  isDOMNode(n) {
127
120
  return n && typeof n === 'object' && n.nodeType === 1;
128
121
  }
@@ -211,12 +204,6 @@ let Alert = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
211
204
  }
212
205
  }
213
206
 
214
- handleKeyUp = event => {
215
- if (this.props.renderCloseButtonLabel && event.keyCode === _keycode.default.codes.esc) {
216
- this.close();
217
- }
218
- };
219
-
220
207
  componentDidMount() {
221
208
  var _this$props$makeStyle, _this$props;
222
209
 
@@ -309,7 +296,18 @@ let Alert = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
309
296
  }, this.renderAlert());
310
297
  }
311
298
 
312
- }) || _class) || _class);
299
+ }, _class2.displayName = "Alert", _class2.componentId = 'Alert', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {
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);
313
311
  exports.Alert = Alert;
314
312
  var _default = Alert;
315
313
  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-10",
3
+ "version": "8.25.1-snapshot-13",
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-10",
27
- "@instructure/ui-color-utils": "8.25.1-snapshot-10",
28
- "@instructure/ui-test-utils": "8.25.1-snapshot-10"
26
+ "@instructure/ui-babel-preset": "8.25.1-snapshot-13",
27
+ "@instructure/ui-color-utils": "8.25.1-snapshot-13",
28
+ "@instructure/ui-test-utils": "8.25.1-snapshot-13"
29
29
  },
30
30
  "dependencies": {
31
31
  "@babel/runtime": "^7.13.10",
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",
32
+ "@instructure/console": "8.25.1-snapshot-13",
33
+ "@instructure/emotion": "8.25.1-snapshot-13",
34
+ "@instructure/shared-types": "8.25.1-snapshot-13",
35
+ "@instructure/ui-a11y-content": "8.25.1-snapshot-13",
36
+ "@instructure/ui-buttons": "8.25.1-snapshot-13",
37
+ "@instructure/ui-icons": "8.25.1-snapshot-13",
38
+ "@instructure/ui-motion": "8.25.1-snapshot-13",
39
+ "@instructure/ui-react-utils": "8.25.1-snapshot-13",
40
+ "@instructure/ui-themes": "8.25.1-snapshot-13",
41
+ "@instructure/ui-utils": "8.25.1-snapshot-13",
42
+ "@instructure/ui-view": "8.25.1-snapshot-13",
43
+ "@instructure/uid": "8.25.1-snapshot-13",
44
44
  "keycode": "^2",
45
45
  "prop-types": "^15"
46
46
  },