@instructure/ui-avatar 8.10.3-snapshot.22 → 8.10.3-snapshot.23

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.
@@ -52,10 +52,12 @@ let Avatar = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = t
52
52
  this.ref = null;
53
53
 
54
54
  this.handleRef = el => {
55
- var _this$props$elementRe, _this$props;
56
-
55
+ const elementRef = this.props.elementRef;
57
56
  this.ref = el;
58
- (_this$props$elementRe = (_this$props = this.props).elementRef) === null || _this$props$elementRe === void 0 ? void 0 : _this$props$elementRe.call(_this$props, el);
57
+
58
+ if (typeof elementRef === 'function') {
59
+ elementRef(el);
60
+ }
59
61
  };
60
62
 
61
63
  this.handleImageLoaded = event => {
@@ -109,10 +111,10 @@ let Avatar = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = t
109
111
  render() {
110
112
  var _this$props$styles2;
111
113
 
112
- const _this$props2 = this.props,
113
- onImageLoaded = _this$props2.onImageLoaded,
114
- styles = _this$props2.styles,
115
- props = _objectWithoutProperties(_this$props2, _excluded);
114
+ const _this$props = this.props,
115
+ onImageLoaded = _this$props.onImageLoaded,
116
+ styles = _this$props.styles,
117
+ props = _objectWithoutProperties(_this$props, _excluded);
116
118
 
117
119
  return jsx(View, Object.assign({}, passthroughProps(props), {
118
120
  "aria-label": this.props.alt ? this.props.alt : void 0,
@@ -44,10 +44,12 @@ let Avatar = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _
44
44
  this.ref = null;
45
45
 
46
46
  this.handleRef = el => {
47
- var _this$props$elementRe, _this$props;
48
-
47
+ const elementRef = this.props.elementRef;
49
48
  this.ref = el;
50
- (_this$props$elementRe = (_this$props = this.props).elementRef) === null || _this$props$elementRe === void 0 ? void 0 : _this$props$elementRe.call(_this$props, el);
49
+
50
+ if (typeof elementRef === 'function') {
51
+ elementRef(el);
52
+ }
51
53
  };
52
54
 
53
55
  this.handleImageLoaded = event => {
@@ -101,10 +103,10 @@ let Avatar = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _
101
103
  render() {
102
104
  var _this$props$styles2;
103
105
 
104
- const _this$props2 = this.props,
105
- onImageLoaded = _this$props2.onImageLoaded,
106
- styles = _this$props2.styles,
107
- props = (0, _objectWithoutProperties2.default)(_this$props2, _excluded);
106
+ const _this$props = this.props,
107
+ onImageLoaded = _this$props.onImageLoaded,
108
+ styles = _this$props.styles,
109
+ props = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
108
110
  return (0, _emotion.jsx)(_View.View, Object.assign({}, (0, _passthroughProps.passthroughProps)(props), {
109
111
  "aria-label": this.props.alt ? this.props.alt : void 0,
110
112
  role: this.props.alt ? 'img' : void 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-avatar",
3
- "version": "8.10.3-snapshot.22+f96f8c48e",
3
+ "version": "8.10.3-snapshot.23+5aaa29662",
4
4
  "description": "An image or letters that represents a user.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "type": "commonjs",
@@ -25,20 +25,20 @@
25
25
  "license": "MIT",
26
26
  "dependencies": {
27
27
  "@babel/runtime": "^7.13.10",
28
- "@instructure/console": "8.10.3-snapshot.22+f96f8c48e",
29
- "@instructure/emotion": "8.10.3-snapshot.22+f96f8c48e",
30
- "@instructure/shared-types": "8.10.3-snapshot.22+f96f8c48e",
31
- "@instructure/ui-react-utils": "8.10.3-snapshot.22+f96f8c48e",
32
- "@instructure/ui-testable": "8.10.3-snapshot.22+f96f8c48e",
33
- "@instructure/ui-view": "8.10.3-snapshot.22+f96f8c48e",
28
+ "@instructure/console": "8.10.3-snapshot.23+5aaa29662",
29
+ "@instructure/emotion": "8.10.3-snapshot.23+5aaa29662",
30
+ "@instructure/shared-types": "8.10.3-snapshot.23+5aaa29662",
31
+ "@instructure/ui-react-utils": "8.10.3-snapshot.23+5aaa29662",
32
+ "@instructure/ui-testable": "8.10.3-snapshot.23+5aaa29662",
33
+ "@instructure/ui-view": "8.10.3-snapshot.23+5aaa29662",
34
34
  "prop-types": "^15"
35
35
  },
36
36
  "devDependencies": {
37
- "@instructure/ui-babel-preset": "8.10.3-snapshot.22+f96f8c48e",
38
- "@instructure/ui-color-utils": "8.10.3-snapshot.22+f96f8c48e",
39
- "@instructure/ui-test-locator": "8.10.3-snapshot.22+f96f8c48e",
40
- "@instructure/ui-test-utils": "8.10.3-snapshot.22+f96f8c48e",
41
- "@instructure/ui-themes": "8.10.3-snapshot.22+f96f8c48e"
37
+ "@instructure/ui-babel-preset": "8.10.3-snapshot.23+5aaa29662",
38
+ "@instructure/ui-color-utils": "8.10.3-snapshot.23+5aaa29662",
39
+ "@instructure/ui-test-locator": "8.10.3-snapshot.23+5aaa29662",
40
+ "@instructure/ui-test-utils": "8.10.3-snapshot.23+5aaa29662",
41
+ "@instructure/ui-themes": "8.10.3-snapshot.23+5aaa29662"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "react": ">=16.8 <=17"
@@ -47,5 +47,5 @@
47
47
  "access": "public"
48
48
  },
49
49
  "sideEffects": false,
50
- "gitHead": "f96f8c48efab7806609098e1f00a6953b2884601"
50
+ "gitHead": "5aaa296621d72faebe1a809a8895a8185587008d"
51
51
  }
@@ -63,8 +63,13 @@ class Avatar extends Component<AvatarProps, AvatarState> {
63
63
  ref: Element | null = null
64
64
 
65
65
  handleRef = (el: Element | null) => {
66
+ const { elementRef } = this.props
67
+
66
68
  this.ref = el
67
- this.props.elementRef?.(el)
69
+
70
+ if (typeof elementRef === 'function') {
71
+ elementRef(el)
72
+ }
68
73
  }
69
74
 
70
75
  componentDidMount() {
@@ -86,7 +86,7 @@ type AvatarOwnProps = {
86
86
  */
87
87
  as?: AsElementType
88
88
  /**
89
- * Provides a reference to the underlying html element
89
+ * provides a reference to the underlying html root element
90
90
  */
91
91
  elementRef?: (element: Element | null) => void
92
92
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":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;;;WAKG;;;;;;;;;;;OAM2B;IAC5B,MAAM,CAAC,YAAY;;QAZrB;;;;;WAKG;;;;;;;;;;;SAOiC;IAClC,MAAM,CAAC,YAAY;;;;;yCAKO,cAAc;MAC9B;IAEV,KAAK;;MAAoB;IAEzB,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAQ9B;IAED,iBAAiB;IAKjB,kBAAkB;IAKlB,oBAAoB;IAmBpB,iBAAiB,UAAW,cAAc,UAGzC;IAED,cAAc;IAQd,MAAM;CAyBP;AAED,eAAe,MAAM,CAAA;AACrB,OAAO,EAAE,MAAM,EAAE,CAAA"}
@@ -33,7 +33,7 @@ declare type AvatarOwnProps = {
33
33
  */
34
34
  as?: AsElementType;
35
35
  /**
36
- * Provides a reference to the underlying html element
36
+ * provides a reference to the underlying html root element
37
37
  */
38
38
  elementRef?: (element: Element | null) => void;
39
39
  };