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