@instructure/ui-alerts 8.56.0 → 8.56.2-pr-snapshot-1721749364069
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 +16 -0
- package/lib/Alert/index.js +16 -20
- package/package.json +16 -16
- package/tsconfig.build.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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.56.2-pr-snapshot-1721749364069](https://github.com/instructure/instructure-ui/compare/v8.56.1...v8.56.2-pr-snapshot-1721749364069) (2024-07-23)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-alerts
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [8.56.1](https://github.com/instructure/instructure-ui/compare/v8.56.0...v8.56.1) (2024-06-13)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @instructure/ui-alerts
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
# [8.56.0](https://github.com/instructure/instructure-ui/compare/v8.55.1...v8.56.0) (2024-05-06)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @instructure/ui-alerts
|
package/lib/Alert/index.js
CHANGED
|
@@ -9,16 +9,12 @@ exports.default = exports.Alert = void 0;
|
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
11
11
|
var _keycode = _interopRequireDefault(require("keycode"));
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var _IconInfoBorderlessSolid = require("@instructure/ui-icons/lib/IconInfoBorderlessSolid.js");
|
|
19
|
-
var _IconWarningBorderlessSolid = require("@instructure/ui-icons/lib/IconWarningBorderlessSolid.js");
|
|
20
|
-
var _IconNoSolid = require("@instructure/ui-icons/lib/IconNoSolid.js");
|
|
21
|
-
var _Transition = require("@instructure/ui-motion/lib/Transition");
|
|
12
|
+
var _uiReactUtils = require("@instructure/ui-react-utils");
|
|
13
|
+
var _uiButtons = require("@instructure/ui-buttons");
|
|
14
|
+
var _uiView = require("@instructure/ui-view");
|
|
15
|
+
var _uiA11yContent = require("@instructure/ui-a11y-content");
|
|
16
|
+
var _uiIcons = require("@instructure/ui-icons");
|
|
17
|
+
var _uiMotion = require("@instructure/ui-motion");
|
|
22
18
|
var _console = require("@instructure/console");
|
|
23
19
|
var _emotion = require("@instructure/emotion");
|
|
24
20
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
@@ -54,16 +50,16 @@ var _dec, _dec2, _class, _class2;
|
|
|
54
50
|
category: components
|
|
55
51
|
---
|
|
56
52
|
**/
|
|
57
|
-
let Alert = exports.Alert = (_dec = (0,
|
|
53
|
+
let Alert = exports.Alert = (_dec = (0, _uiReactUtils.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = _dec2(_class = (_class2 = class Alert extends _react.Component {
|
|
58
54
|
constructor(props) {
|
|
59
55
|
super(props);
|
|
60
56
|
this._timeouts = [];
|
|
61
57
|
this.srid = void 0;
|
|
62
58
|
this.variantUI = {
|
|
63
|
-
error:
|
|
64
|
-
info:
|
|
65
|
-
success:
|
|
66
|
-
warning:
|
|
59
|
+
error: _uiIcons.IconNoSolid,
|
|
60
|
+
info: _uiIcons.IconInfoBorderlessSolid,
|
|
61
|
+
success: _uiIcons.IconCheckMarkSolid,
|
|
62
|
+
warning: _uiIcons.IconWarningBorderlessSolid
|
|
67
63
|
};
|
|
68
64
|
this.ref = null;
|
|
69
65
|
this.handleRef = el => {
|
|
@@ -126,7 +122,7 @@ let Alert = exports.Alert = (_dec = (0, _withDeterministicId.withDeterministicId
|
|
|
126
122
|
}
|
|
127
123
|
}
|
|
128
124
|
createScreenreaderContentNode() {
|
|
129
|
-
return (0, _emotion.jsx)(
|
|
125
|
+
return (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, this.props.children);
|
|
130
126
|
}
|
|
131
127
|
createScreenreaderAlert() {
|
|
132
128
|
const liveRegion = this.getLiveRegion();
|
|
@@ -182,11 +178,11 @@ let Alert = exports.Alert = (_dec = (0, _withDeterministicId.withDeterministicId
|
|
|
182
178
|
}
|
|
183
179
|
renderCloseButton() {
|
|
184
180
|
var _this$props$styles2;
|
|
185
|
-
const closeButtonLabel = this.props.renderCloseButtonLabel && (0,
|
|
181
|
+
const closeButtonLabel = this.props.renderCloseButtonLabel && (0, _uiReactUtils.callRenderProp)(this.props.renderCloseButtonLabel);
|
|
186
182
|
return closeButtonLabel ? (0, _emotion.jsx)("div", {
|
|
187
183
|
css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.closeButton,
|
|
188
184
|
key: "closeButton"
|
|
189
|
-
}, (0, _emotion.jsx)(
|
|
185
|
+
}, (0, _emotion.jsx)(_uiButtons.CloseButton, {
|
|
190
186
|
onClick: this.close,
|
|
191
187
|
size: "small",
|
|
192
188
|
screenReaderLabel: closeButtonLabel
|
|
@@ -194,7 +190,7 @@ let Alert = exports.Alert = (_dec = (0, _withDeterministicId.withDeterministicId
|
|
|
194
190
|
}
|
|
195
191
|
renderAlert() {
|
|
196
192
|
var _this$props$styles3, _this$props$styles4;
|
|
197
|
-
return (0, _emotion.jsx)(
|
|
193
|
+
return (0, _emotion.jsx)(_uiView.View, {
|
|
198
194
|
as: "div",
|
|
199
195
|
margin: this.props.margin,
|
|
200
196
|
css: (_this$props$styles3 = this.props.styles) === null || _this$props$styles3 === void 0 ? void 0 : _this$props$styles3.alert,
|
|
@@ -221,7 +217,7 @@ let Alert = exports.Alert = (_dec = (0, _withDeterministicId.withDeterministicId
|
|
|
221
217
|
if (this.props.transition === 'none') {
|
|
222
218
|
return this.state.open ? (0, _emotion.jsx)(_react.default.Fragment, null, screenReaderContent, this.renderAlert()) : null;
|
|
223
219
|
}
|
|
224
|
-
return (0, _emotion.jsx)(_react.default.Fragment, null, screenReaderContent, (0, _emotion.jsx)(
|
|
220
|
+
return (0, _emotion.jsx)(_react.default.Fragment, null, screenReaderContent, (0, _emotion.jsx)(_uiMotion.Transition, {
|
|
225
221
|
type: this.props.transition,
|
|
226
222
|
transitionOnMount: true,
|
|
227
223
|
in: this.state.open,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-alerts",
|
|
3
|
-
"version": "8.56.
|
|
3
|
+
"version": "8.56.2-pr-snapshot-1721749364069",
|
|
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.56.
|
|
27
|
-
"@instructure/ui-color-utils": "8.56.
|
|
28
|
-
"@instructure/ui-test-utils": "8.56.
|
|
26
|
+
"@instructure/ui-babel-preset": "8.56.2-pr-snapshot-1721749364069",
|
|
27
|
+
"@instructure/ui-color-utils": "8.56.2-pr-snapshot-1721749364069",
|
|
28
|
+
"@instructure/ui-test-utils": "8.56.2-pr-snapshot-1721749364069"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@babel/runtime": "^7.23.2",
|
|
32
|
-
"@instructure/console": "8.56.
|
|
33
|
-
"@instructure/emotion": "8.56.
|
|
34
|
-
"@instructure/shared-types": "8.56.
|
|
35
|
-
"@instructure/ui-a11y-content": "8.56.
|
|
36
|
-
"@instructure/ui-buttons": "8.56.
|
|
37
|
-
"@instructure/ui-icons": "8.56.
|
|
38
|
-
"@instructure/ui-motion": "8.56.
|
|
39
|
-
"@instructure/ui-react-utils": "8.56.
|
|
40
|
-
"@instructure/ui-themes": "8.56.
|
|
41
|
-
"@instructure/ui-utils": "8.56.
|
|
42
|
-
"@instructure/ui-view": "8.56.
|
|
43
|
-
"@instructure/uid": "8.56.
|
|
32
|
+
"@instructure/console": "8.56.2-pr-snapshot-1721749364069",
|
|
33
|
+
"@instructure/emotion": "8.56.2-pr-snapshot-1721749364069",
|
|
34
|
+
"@instructure/shared-types": "8.56.2-pr-snapshot-1721749364069",
|
|
35
|
+
"@instructure/ui-a11y-content": "8.56.2-pr-snapshot-1721749364069",
|
|
36
|
+
"@instructure/ui-buttons": "8.56.2-pr-snapshot-1721749364069",
|
|
37
|
+
"@instructure/ui-icons": "8.56.2-pr-snapshot-1721749364069",
|
|
38
|
+
"@instructure/ui-motion": "8.56.2-pr-snapshot-1721749364069",
|
|
39
|
+
"@instructure/ui-react-utils": "8.56.2-pr-snapshot-1721749364069",
|
|
40
|
+
"@instructure/ui-themes": "8.56.2-pr-snapshot-1721749364069",
|
|
41
|
+
"@instructure/ui-utils": "8.56.2-pr-snapshot-1721749364069",
|
|
42
|
+
"@instructure/ui-view": "8.56.2-pr-snapshot-1721749364069",
|
|
43
|
+
"@instructure/uid": "8.56.2-pr-snapshot-1721749364069",
|
|
44
44
|
"keycode": "^2.2.1",
|
|
45
45
|
"prop-types": "^15.8.1"
|
|
46
46
|
},
|