@instructure/ui-alerts 8.18.0 → 8.18.1-snapshot.0

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/LICENSE.md ADDED
@@ -0,0 +1,27 @@
1
+ ---
2
+ title: The MIT License (MIT)
3
+ category: Getting Started
4
+ order: 9
5
+ ---
6
+
7
+ # The MIT License (MIT)
8
+
9
+ Copyright (c) 2015 Instructure, Inc.
10
+
11
+ **Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions.**
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
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?.parentNode?.removeChild(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
- this.props.makeStyles?.();
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
- this.props.makeStyles?.();
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?.icon
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?.closeButton,
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?.alert,
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?.content
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?.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
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]
@@ -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?.parentNode?.removeChild(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
- this.props.makeStyles?.();
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
- this.props.makeStyles?.();
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?.icon
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?.closeButton,
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?.alert,
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?.content
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
 
@@ -47,29 +47,29 @@ const generateComponentTheme = theme => {
47
47
  }
48
48
  };
49
49
  const componentVariables = {
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
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.18.0",
3
+ "version": "8.18.1-snapshot.0+435c9ae79",
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.18.0",
27
- "@instructure/ui-color-utils": "8.18.0",
28
- "@instructure/ui-test-utils": "8.18.0"
26
+ "@instructure/ui-babel-preset": "8.18.1-snapshot.0+435c9ae79",
27
+ "@instructure/ui-color-utils": "8.18.1-snapshot.0+435c9ae79",
28
+ "@instructure/ui-test-utils": "8.18.1-snapshot.0+435c9ae79"
29
29
  },
30
30
  "dependencies": {
31
31
  "@babel/runtime": "^7.13.10",
32
- "@instructure/console": "8.18.0",
33
- "@instructure/emotion": "8.18.0",
34
- "@instructure/shared-types": "8.18.0",
35
- "@instructure/ui-a11y-content": "8.18.0",
36
- "@instructure/ui-buttons": "8.18.0",
37
- "@instructure/ui-icons": "8.18.0",
38
- "@instructure/ui-motion": "8.18.0",
39
- "@instructure/ui-react-utils": "8.18.0",
40
- "@instructure/ui-themes": "8.18.0",
41
- "@instructure/ui-utils": "8.18.0",
42
- "@instructure/ui-view": "8.18.0",
43
- "@instructure/uid": "8.18.0",
32
+ "@instructure/console": "8.18.1-snapshot.0+435c9ae79",
33
+ "@instructure/emotion": "8.18.1-snapshot.0+435c9ae79",
34
+ "@instructure/shared-types": "8.18.1-snapshot.0+435c9ae79",
35
+ "@instructure/ui-a11y-content": "8.18.1-snapshot.0+435c9ae79",
36
+ "@instructure/ui-buttons": "8.18.1-snapshot.0+435c9ae79",
37
+ "@instructure/ui-icons": "8.18.1-snapshot.0+435c9ae79",
38
+ "@instructure/ui-motion": "8.18.1-snapshot.0+435c9ae79",
39
+ "@instructure/ui-react-utils": "8.18.1-snapshot.0+435c9ae79",
40
+ "@instructure/ui-themes": "8.18.1-snapshot.0+435c9ae79",
41
+ "@instructure/ui-utils": "8.18.1-snapshot.0+435c9ae79",
42
+ "@instructure/ui-view": "8.18.1-snapshot.0+435c9ae79",
43
+ "@instructure/uid": "8.18.1-snapshot.0+435c9ae79",
44
44
  "keycode": "^2",
45
45
  "prop-types": "^15"
46
46
  },
@@ -51,5 +51,6 @@
51
51
  "publishConfig": {
52
52
  "access": "public"
53
53
  },
54
- "sideEffects": false
54
+ "sideEffects": false,
55
+ "gitHead": "435c9ae794c15e2bd103f700f8c4e946d91c1b59"
55
56
  }