@instructure/ui-alerts 8.17.1-snapshot.82 → 8.18.1-snapshot.1
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 +4 -0
- package/es/Alert/index.js +19 -7
- package/es/Alert/theme.js +23 -23
- package/lib/Alert/index.js +19 -7
- package/lib/Alert/theme.js +23 -23
- package/package.json +17 -17
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
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.18.0](https://github.com/instructure/instructure-ui/compare/v8.17.0...v8.18.0) (2022-02-23)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-alerts
|
|
9
|
+
|
|
6
10
|
# [8.17.0](https://github.com/instructure/instructure-ui/compare/v8.16.0...v8.17.0) (2022-02-07)
|
|
7
11
|
|
|
8
12
|
### Bug Fixes
|
package/es/Alert/index.js
CHANGED
|
@@ -177,6 +177,8 @@ let Alert = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gene
|
|
|
177
177
|
const div = document.getElementById(this.srid);
|
|
178
178
|
|
|
179
179
|
if (div) {
|
|
180
|
+
var _div$parentNode;
|
|
181
|
+
|
|
180
182
|
// Accessibility attributes must be removed for the deletion of the node
|
|
181
183
|
// and then reapplied because JAWS/IE will not respect the
|
|
182
184
|
// "aria-relevant" attribute and read when the node is deleted if
|
|
@@ -185,14 +187,16 @@ let Alert = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gene
|
|
|
185
187
|
liveRegion.removeAttribute('aria-relevant');
|
|
186
188
|
liveRegion.removeAttribute('aria-atomic');
|
|
187
189
|
ReactDOM.unmountComponentAtNode(div);
|
|
188
|
-
div
|
|
190
|
+
div === null || div === void 0 ? void 0 : (_div$parentNode = div.parentNode) === null || _div$parentNode === void 0 ? void 0 : _div$parentNode.removeChild(div);
|
|
189
191
|
this.initLiveRegion(liveRegion);
|
|
190
192
|
}
|
|
191
193
|
}
|
|
192
194
|
}
|
|
193
195
|
|
|
194
196
|
componentDidMount() {
|
|
195
|
-
|
|
197
|
+
var _this$props$makeStyle, _this$props;
|
|
198
|
+
|
|
199
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
196
200
|
const liveRegion = this.getLiveRegion();
|
|
197
201
|
|
|
198
202
|
if (liveRegion) {
|
|
@@ -204,7 +208,9 @@ let Alert = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gene
|
|
|
204
208
|
}
|
|
205
209
|
|
|
206
210
|
componentDidUpdate(prevProps) {
|
|
207
|
-
|
|
211
|
+
var _this$props$makeStyle2, _this$props2;
|
|
212
|
+
|
|
213
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
208
214
|
|
|
209
215
|
if (!!this.props.open === false && !!this.props.open !== !!prevProps.open) {
|
|
210
216
|
// this outside world is asking us to close the alert, which needs to
|
|
@@ -223,16 +229,20 @@ let Alert = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gene
|
|
|
223
229
|
}
|
|
224
230
|
|
|
225
231
|
renderIcon() {
|
|
232
|
+
var _this$props$styles;
|
|
233
|
+
|
|
226
234
|
const Icon = this.variantUI[this.props.variant];
|
|
227
235
|
return jsx("div", {
|
|
228
|
-
css: this.props.styles
|
|
236
|
+
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.icon
|
|
229
237
|
}, jsx(Icon, null));
|
|
230
238
|
}
|
|
231
239
|
|
|
232
240
|
renderCloseButton() {
|
|
241
|
+
var _this$props$styles2;
|
|
242
|
+
|
|
233
243
|
const closeButtonLabel = this.props.renderCloseButtonLabel && callRenderProp(this.props.renderCloseButtonLabel);
|
|
234
244
|
return closeButtonLabel ? jsx("div", {
|
|
235
|
-
css: this.props.styles
|
|
245
|
+
css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.closeButton,
|
|
236
246
|
key: "closeButton"
|
|
237
247
|
}, jsx(CloseButton, {
|
|
238
248
|
onClick: this.close,
|
|
@@ -242,14 +252,16 @@ let Alert = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gene
|
|
|
242
252
|
}
|
|
243
253
|
|
|
244
254
|
renderAlert() {
|
|
255
|
+
var _this$props$styles3, _this$props$styles4;
|
|
256
|
+
|
|
245
257
|
return jsx(View, {
|
|
246
258
|
as: "div",
|
|
247
259
|
margin: this.props.margin,
|
|
248
|
-
css: this.props.styles
|
|
260
|
+
css: (_this$props$styles3 = this.props.styles) === null || _this$props$styles3 === void 0 ? void 0 : _this$props$styles3.alert,
|
|
249
261
|
onKeyUp: this.handleKeyUp,
|
|
250
262
|
elementRef: this.handleRef
|
|
251
263
|
}, this.renderIcon(), jsx("div", {
|
|
252
|
-
css: this.props.styles
|
|
264
|
+
css: (_this$props$styles4 = this.props.styles) === null || _this$props$styles4 === void 0 ? void 0 : _this$props$styles4.content
|
|
253
265
|
}, this.props.children), this.renderCloseButton());
|
|
254
266
|
}
|
|
255
267
|
|
package/es/Alert/theme.js
CHANGED
|
@@ -40,29 +40,29 @@ const generateComponentTheme = theme => {
|
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
const componentVariables = {
|
|
43
|
-
background: colors
|
|
44
|
-
color: colors
|
|
45
|
-
marginTop: spacing
|
|
46
|
-
borderRadius: borders
|
|
47
|
-
borderWidth: borders
|
|
48
|
-
borderStyle: borders
|
|
49
|
-
contentPadding: `${spacing
|
|
50
|
-
contentFontSize: typography
|
|
51
|
-
contentFontFamily: typography
|
|
52
|
-
contentFontWeight: typography
|
|
53
|
-
contentLineHeight: typography
|
|
54
|
-
closeButtonMarginTop: spacing
|
|
55
|
-
closeButtonMarginRight: spacing
|
|
56
|
-
iconColor: colors
|
|
57
|
-
successBorderColor: colors
|
|
58
|
-
successIconBackground: colors
|
|
59
|
-
infoBorderColor: colors
|
|
60
|
-
infoIconBackground: colors
|
|
61
|
-
warningBorderColor: colors
|
|
62
|
-
warningIconBackground: colors
|
|
63
|
-
dangerBorderColor: colors
|
|
64
|
-
dangerIconBackground: colors
|
|
65
|
-
boxShadow: shadows
|
|
43
|
+
background: colors === null || colors === void 0 ? void 0 : colors.backgroundLightest,
|
|
44
|
+
color: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
|
|
45
|
+
marginTop: spacing === null || spacing === void 0 ? void 0 : spacing.small,
|
|
46
|
+
borderRadius: borders === null || borders === void 0 ? void 0 : borders.radiusMedium,
|
|
47
|
+
borderWidth: borders === null || borders === void 0 ? void 0 : borders.widthMedium,
|
|
48
|
+
borderStyle: borders === null || borders === void 0 ? void 0 : borders.style,
|
|
49
|
+
contentPadding: `${spacing === null || spacing === void 0 ? void 0 : spacing.small} ${spacing === null || spacing === void 0 ? void 0 : spacing.medium}`,
|
|
50
|
+
contentFontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
|
|
51
|
+
contentFontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
|
|
52
|
+
contentFontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
|
|
53
|
+
contentLineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeightCondensed,
|
|
54
|
+
closeButtonMarginTop: spacing === null || spacing === void 0 ? void 0 : spacing.xSmall,
|
|
55
|
+
closeButtonMarginRight: spacing === null || spacing === void 0 ? void 0 : spacing.xxSmall,
|
|
56
|
+
iconColor: colors === null || colors === void 0 ? void 0 : colors.textLightest,
|
|
57
|
+
successBorderColor: colors === null || colors === void 0 ? void 0 : colors.borderSuccess,
|
|
58
|
+
successIconBackground: colors === null || colors === void 0 ? void 0 : colors.backgroundSuccess,
|
|
59
|
+
infoBorderColor: colors === null || colors === void 0 ? void 0 : colors.borderInfo,
|
|
60
|
+
infoIconBackground: colors === null || colors === void 0 ? void 0 : colors.backgroundInfo,
|
|
61
|
+
warningBorderColor: colors === null || colors === void 0 ? void 0 : colors.borderWarning,
|
|
62
|
+
warningIconBackground: colors === null || colors === void 0 ? void 0 : colors.backgroundWarning,
|
|
63
|
+
dangerBorderColor: colors === null || colors === void 0 ? void 0 : colors.borderDanger,
|
|
64
|
+
dangerIconBackground: colors === null || colors === void 0 ? void 0 : colors.backgroundDanger,
|
|
65
|
+
boxShadow: shadows === null || shadows === void 0 ? void 0 : shadows.depth2
|
|
66
66
|
};
|
|
67
67
|
return { ...componentVariables,
|
|
68
68
|
...themeSpecificStyle[themeName]
|
package/lib/Alert/index.js
CHANGED
|
@@ -186,6 +186,8 @@ let Alert = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
|
|
|
186
186
|
const div = document.getElementById(this.srid);
|
|
187
187
|
|
|
188
188
|
if (div) {
|
|
189
|
+
var _div$parentNode;
|
|
190
|
+
|
|
189
191
|
// Accessibility attributes must be removed for the deletion of the node
|
|
190
192
|
// and then reapplied because JAWS/IE will not respect the
|
|
191
193
|
// "aria-relevant" attribute and read when the node is deleted if
|
|
@@ -196,14 +198,16 @@ let Alert = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
|
|
|
196
198
|
|
|
197
199
|
_reactDom.default.unmountComponentAtNode(div);
|
|
198
200
|
|
|
199
|
-
div
|
|
201
|
+
div === null || div === void 0 ? void 0 : (_div$parentNode = div.parentNode) === null || _div$parentNode === void 0 ? void 0 : _div$parentNode.removeChild(div);
|
|
200
202
|
this.initLiveRegion(liveRegion);
|
|
201
203
|
}
|
|
202
204
|
}
|
|
203
205
|
}
|
|
204
206
|
|
|
205
207
|
componentDidMount() {
|
|
206
|
-
|
|
208
|
+
var _this$props$makeStyle, _this$props;
|
|
209
|
+
|
|
210
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
207
211
|
const liveRegion = this.getLiveRegion();
|
|
208
212
|
|
|
209
213
|
if (liveRegion) {
|
|
@@ -215,7 +219,9 @@ let Alert = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
|
|
|
215
219
|
}
|
|
216
220
|
|
|
217
221
|
componentDidUpdate(prevProps) {
|
|
218
|
-
|
|
222
|
+
var _this$props$makeStyle2, _this$props2;
|
|
223
|
+
|
|
224
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
219
225
|
|
|
220
226
|
if (!!this.props.open === false && !!this.props.open !== !!prevProps.open) {
|
|
221
227
|
// this outside world is asking us to close the alert, which needs to
|
|
@@ -234,16 +240,20 @@ let Alert = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
|
|
|
234
240
|
}
|
|
235
241
|
|
|
236
242
|
renderIcon() {
|
|
243
|
+
var _this$props$styles;
|
|
244
|
+
|
|
237
245
|
const Icon = this.variantUI[this.props.variant];
|
|
238
246
|
return (0, _emotion.jsx)("div", {
|
|
239
|
-
css: this.props.styles
|
|
247
|
+
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.icon
|
|
240
248
|
}, (0, _emotion.jsx)(Icon, null));
|
|
241
249
|
}
|
|
242
250
|
|
|
243
251
|
renderCloseButton() {
|
|
252
|
+
var _this$props$styles2;
|
|
253
|
+
|
|
244
254
|
const closeButtonLabel = this.props.renderCloseButtonLabel && (0, _callRenderProp.callRenderProp)(this.props.renderCloseButtonLabel);
|
|
245
255
|
return closeButtonLabel ? (0, _emotion.jsx)("div", {
|
|
246
|
-
css: this.props.styles
|
|
256
|
+
css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.closeButton,
|
|
247
257
|
key: "closeButton"
|
|
248
258
|
}, (0, _emotion.jsx)(_CloseButton.CloseButton, {
|
|
249
259
|
onClick: this.close,
|
|
@@ -253,14 +263,16 @@ let Alert = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
|
|
|
253
263
|
}
|
|
254
264
|
|
|
255
265
|
renderAlert() {
|
|
266
|
+
var _this$props$styles3, _this$props$styles4;
|
|
267
|
+
|
|
256
268
|
return (0, _emotion.jsx)(_View.View, {
|
|
257
269
|
as: "div",
|
|
258
270
|
margin: this.props.margin,
|
|
259
|
-
css: this.props.styles
|
|
271
|
+
css: (_this$props$styles3 = this.props.styles) === null || _this$props$styles3 === void 0 ? void 0 : _this$props$styles3.alert,
|
|
260
272
|
onKeyUp: this.handleKeyUp,
|
|
261
273
|
elementRef: this.handleRef
|
|
262
274
|
}, this.renderIcon(), (0, _emotion.jsx)("div", {
|
|
263
|
-
css: this.props.styles
|
|
275
|
+
css: (_this$props$styles4 = this.props.styles) === null || _this$props$styles4 === void 0 ? void 0 : _this$props$styles4.content
|
|
264
276
|
}, this.props.children), this.renderCloseButton());
|
|
265
277
|
}
|
|
266
278
|
|
package/lib/Alert/theme.js
CHANGED
|
@@ -47,29 +47,29 @@ const generateComponentTheme = theme => {
|
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
const componentVariables = {
|
|
50
|
-
background: colors
|
|
51
|
-
color: colors
|
|
52
|
-
marginTop: spacing
|
|
53
|
-
borderRadius: borders
|
|
54
|
-
borderWidth: borders
|
|
55
|
-
borderStyle: borders
|
|
56
|
-
contentPadding: `${spacing
|
|
57
|
-
contentFontSize: typography
|
|
58
|
-
contentFontFamily: typography
|
|
59
|
-
contentFontWeight: typography
|
|
60
|
-
contentLineHeight: typography
|
|
61
|
-
closeButtonMarginTop: spacing
|
|
62
|
-
closeButtonMarginRight: spacing
|
|
63
|
-
iconColor: colors
|
|
64
|
-
successBorderColor: colors
|
|
65
|
-
successIconBackground: colors
|
|
66
|
-
infoBorderColor: colors
|
|
67
|
-
infoIconBackground: colors
|
|
68
|
-
warningBorderColor: colors
|
|
69
|
-
warningIconBackground: colors
|
|
70
|
-
dangerBorderColor: colors
|
|
71
|
-
dangerIconBackground: colors
|
|
72
|
-
boxShadow: shadows
|
|
50
|
+
background: colors === null || colors === void 0 ? void 0 : colors.backgroundLightest,
|
|
51
|
+
color: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
|
|
52
|
+
marginTop: spacing === null || spacing === void 0 ? void 0 : spacing.small,
|
|
53
|
+
borderRadius: borders === null || borders === void 0 ? void 0 : borders.radiusMedium,
|
|
54
|
+
borderWidth: borders === null || borders === void 0 ? void 0 : borders.widthMedium,
|
|
55
|
+
borderStyle: borders === null || borders === void 0 ? void 0 : borders.style,
|
|
56
|
+
contentPadding: `${spacing === null || spacing === void 0 ? void 0 : spacing.small} ${spacing === null || spacing === void 0 ? void 0 : spacing.medium}`,
|
|
57
|
+
contentFontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
|
|
58
|
+
contentFontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
|
|
59
|
+
contentFontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
|
|
60
|
+
contentLineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeightCondensed,
|
|
61
|
+
closeButtonMarginTop: spacing === null || spacing === void 0 ? void 0 : spacing.xSmall,
|
|
62
|
+
closeButtonMarginRight: spacing === null || spacing === void 0 ? void 0 : spacing.xxSmall,
|
|
63
|
+
iconColor: colors === null || colors === void 0 ? void 0 : colors.textLightest,
|
|
64
|
+
successBorderColor: colors === null || colors === void 0 ? void 0 : colors.borderSuccess,
|
|
65
|
+
successIconBackground: colors === null || colors === void 0 ? void 0 : colors.backgroundSuccess,
|
|
66
|
+
infoBorderColor: colors === null || colors === void 0 ? void 0 : colors.borderInfo,
|
|
67
|
+
infoIconBackground: colors === null || colors === void 0 ? void 0 : colors.backgroundInfo,
|
|
68
|
+
warningBorderColor: colors === null || colors === void 0 ? void 0 : colors.borderWarning,
|
|
69
|
+
warningIconBackground: colors === null || colors === void 0 ? void 0 : colors.backgroundWarning,
|
|
70
|
+
dangerBorderColor: colors === null || colors === void 0 ? void 0 : colors.borderDanger,
|
|
71
|
+
dangerIconBackground: colors === null || colors === void 0 ? void 0 : colors.backgroundDanger,
|
|
72
|
+
boxShadow: shadows === null || shadows === void 0 ? void 0 : shadows.depth2
|
|
73
73
|
};
|
|
74
74
|
return { ...componentVariables,
|
|
75
75
|
...themeSpecificStyle[themeName]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-alerts",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.18.1-snapshot.1+669aa5892",
|
|
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.
|
|
27
|
-
"@instructure/ui-color-utils": "8.
|
|
28
|
-
"@instructure/ui-test-utils": "8.
|
|
26
|
+
"@instructure/ui-babel-preset": "8.18.1-snapshot.1+669aa5892",
|
|
27
|
+
"@instructure/ui-color-utils": "8.18.1-snapshot.1+669aa5892",
|
|
28
|
+
"@instructure/ui-test-utils": "8.18.1-snapshot.1+669aa5892"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@babel/runtime": "^7.13.10",
|
|
32
|
-
"@instructure/console": "8.
|
|
33
|
-
"@instructure/emotion": "8.
|
|
34
|
-
"@instructure/shared-types": "8.
|
|
35
|
-
"@instructure/ui-a11y-content": "8.
|
|
36
|
-
"@instructure/ui-buttons": "8.
|
|
37
|
-
"@instructure/ui-icons": "8.
|
|
38
|
-
"@instructure/ui-motion": "8.
|
|
39
|
-
"@instructure/ui-react-utils": "8.
|
|
40
|
-
"@instructure/ui-themes": "8.
|
|
41
|
-
"@instructure/ui-utils": "8.
|
|
42
|
-
"@instructure/ui-view": "8.
|
|
43
|
-
"@instructure/uid": "8.
|
|
32
|
+
"@instructure/console": "8.18.1-snapshot.1+669aa5892",
|
|
33
|
+
"@instructure/emotion": "8.18.1-snapshot.1+669aa5892",
|
|
34
|
+
"@instructure/shared-types": "8.18.1-snapshot.1+669aa5892",
|
|
35
|
+
"@instructure/ui-a11y-content": "8.18.1-snapshot.1+669aa5892",
|
|
36
|
+
"@instructure/ui-buttons": "8.18.1-snapshot.1+669aa5892",
|
|
37
|
+
"@instructure/ui-icons": "8.18.1-snapshot.1+669aa5892",
|
|
38
|
+
"@instructure/ui-motion": "8.18.1-snapshot.1+669aa5892",
|
|
39
|
+
"@instructure/ui-react-utils": "8.18.1-snapshot.1+669aa5892",
|
|
40
|
+
"@instructure/ui-themes": "8.18.1-snapshot.1+669aa5892",
|
|
41
|
+
"@instructure/ui-utils": "8.18.1-snapshot.1+669aa5892",
|
|
42
|
+
"@instructure/ui-view": "8.18.1-snapshot.1+669aa5892",
|
|
43
|
+
"@instructure/uid": "8.18.1-snapshot.1+669aa5892",
|
|
44
44
|
"keycode": "^2",
|
|
45
45
|
"prop-types": "^15"
|
|
46
46
|
},
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
54
|
"sideEffects": false,
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "669aa58926b123028bcb9e39427d36910b78b0d1"
|
|
56
56
|
}
|