@instructure/ui-avatar 8.25.1-snapshot-7 → 8.25.1-snapshot-10
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 +1 -1
- package/es/Avatar/index.js +34 -33
- package/lib/Avatar/index.js +34 -33
- package/package.json +13 -13
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Avatar/AvatarLocator.d.ts +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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.25.1-snapshot-
|
|
6
|
+
## [8.25.1-snapshot-10](https://github.com/instructure/instructure-ui/compare/v8.25.0...v8.25.1-snapshot-10) (2022-06-20)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-avatar
|
|
9
9
|
|
package/es/Avatar/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
const _excluded = ["onImageLoaded", "styles"];
|
|
3
3
|
|
|
4
|
-
var _dec, _dec2, _class
|
|
4
|
+
var _dec, _dec2, _class;
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* The MIT License (MIT)
|
|
@@ -43,30 +43,31 @@ category: components
|
|
|
43
43
|
---
|
|
44
44
|
@tsProps
|
|
45
45
|
**/
|
|
46
|
-
let Avatar = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
46
|
+
let Avatar = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = class Avatar extends Component {
|
|
47
|
+
static displayName = "Avatar";
|
|
48
|
+
static componentId = 'Avatar';
|
|
49
|
+
static propTypes = propTypes;
|
|
50
|
+
static allowedProps = allowedProps;
|
|
51
|
+
static defaultProps = {
|
|
52
|
+
size: 'medium',
|
|
53
|
+
color: 'default',
|
|
54
|
+
hasInverseColor: false,
|
|
55
|
+
shape: 'circle',
|
|
56
|
+
display: 'inline-block',
|
|
57
|
+
onImageLoaded: _event => {}
|
|
58
|
+
};
|
|
59
|
+
state = {
|
|
60
|
+
loaded: false
|
|
61
|
+
};
|
|
62
|
+
ref = null;
|
|
63
|
+
handleRef = el => {
|
|
64
|
+
const elementRef = this.props.elementRef;
|
|
65
|
+
this.ref = el;
|
|
66
|
+
|
|
67
|
+
if (typeof elementRef === 'function') {
|
|
68
|
+
elementRef(el);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
70
71
|
|
|
71
72
|
componentDidMount() {
|
|
72
73
|
var _this$props$makeStyle, _this$props;
|
|
@@ -107,6 +108,13 @@ let Avatar = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = t
|
|
|
107
108
|
}
|
|
108
109
|
}
|
|
109
110
|
|
|
111
|
+
handleImageLoaded = event => {
|
|
112
|
+
this.setState({
|
|
113
|
+
loaded: true
|
|
114
|
+
});
|
|
115
|
+
this.props.onImageLoaded(event);
|
|
116
|
+
};
|
|
117
|
+
|
|
110
118
|
renderInitials() {
|
|
111
119
|
var _this$props$styles;
|
|
112
120
|
|
|
@@ -156,13 +164,6 @@ let Avatar = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = t
|
|
|
156
164
|
}), !this.state.loaded && this.renderContent());
|
|
157
165
|
}
|
|
158
166
|
|
|
159
|
-
}
|
|
160
|
-
size: 'medium',
|
|
161
|
-
color: 'default',
|
|
162
|
-
hasInverseColor: false,
|
|
163
|
-
shape: 'circle',
|
|
164
|
-
display: 'inline-block',
|
|
165
|
-
onImageLoaded: _event => {}
|
|
166
|
-
}, _class2)) || _class) || _class);
|
|
167
|
+
}) || _class) || _class);
|
|
167
168
|
export default Avatar;
|
|
168
169
|
export { Avatar };
|
package/lib/Avatar/index.js
CHANGED
|
@@ -29,7 +29,7 @@ var _props = require("./props");
|
|
|
29
29
|
|
|
30
30
|
const _excluded = ["onImageLoaded", "styles"];
|
|
31
31
|
|
|
32
|
-
var _dec, _dec2, _class
|
|
32
|
+
var _dec, _dec2, _class;
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
---
|
|
@@ -37,30 +37,31 @@ category: components
|
|
|
37
37
|
---
|
|
38
38
|
@tsProps
|
|
39
39
|
**/
|
|
40
|
-
let Avatar = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
40
|
+
let Avatar = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = class Avatar extends _react.Component {
|
|
41
|
+
static displayName = "Avatar";
|
|
42
|
+
static componentId = 'Avatar';
|
|
43
|
+
static propTypes = _props.propTypes;
|
|
44
|
+
static allowedProps = _props.allowedProps;
|
|
45
|
+
static defaultProps = {
|
|
46
|
+
size: 'medium',
|
|
47
|
+
color: 'default',
|
|
48
|
+
hasInverseColor: false,
|
|
49
|
+
shape: 'circle',
|
|
50
|
+
display: 'inline-block',
|
|
51
|
+
onImageLoaded: _event => {}
|
|
52
|
+
};
|
|
53
|
+
state = {
|
|
54
|
+
loaded: false
|
|
55
|
+
};
|
|
56
|
+
ref = null;
|
|
57
|
+
handleRef = el => {
|
|
58
|
+
const elementRef = this.props.elementRef;
|
|
59
|
+
this.ref = el;
|
|
60
|
+
|
|
61
|
+
if (typeof elementRef === 'function') {
|
|
62
|
+
elementRef(el);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
64
65
|
|
|
65
66
|
componentDidMount() {
|
|
66
67
|
var _this$props$makeStyle, _this$props;
|
|
@@ -101,6 +102,13 @@ let Avatar = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _
|
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
104
|
|
|
105
|
+
handleImageLoaded = event => {
|
|
106
|
+
this.setState({
|
|
107
|
+
loaded: true
|
|
108
|
+
});
|
|
109
|
+
this.props.onImageLoaded(event);
|
|
110
|
+
};
|
|
111
|
+
|
|
104
112
|
renderInitials() {
|
|
105
113
|
var _this$props$styles;
|
|
106
114
|
|
|
@@ -149,14 +157,7 @@ let Avatar = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _
|
|
|
149
157
|
}), !this.state.loaded && this.renderContent());
|
|
150
158
|
}
|
|
151
159
|
|
|
152
|
-
}
|
|
153
|
-
size: 'medium',
|
|
154
|
-
color: 'default',
|
|
155
|
-
hasInverseColor: false,
|
|
156
|
-
shape: 'circle',
|
|
157
|
-
display: 'inline-block',
|
|
158
|
-
onImageLoaded: _event => {}
|
|
159
|
-
}, _class2)) || _class) || _class);
|
|
160
|
+
}) || _class) || _class);
|
|
160
161
|
exports.Avatar = Avatar;
|
|
161
162
|
var _default = Avatar;
|
|
162
163
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-avatar",
|
|
3
|
-
"version": "8.25.1-snapshot-
|
|
3
|
+
"version": "8.25.1-snapshot-10",
|
|
4
4
|
"description": "An image or letters that represents a user.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -24,21 +24,21 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime": "^7.13.10",
|
|
27
|
-
"@instructure/console": "8.25.1-snapshot-
|
|
28
|
-
"@instructure/emotion": "8.25.1-snapshot-
|
|
29
|
-
"@instructure/shared-types": "8.25.1-snapshot-
|
|
30
|
-
"@instructure/ui-icons": "8.25.1-snapshot-
|
|
31
|
-
"@instructure/ui-react-utils": "8.25.1-snapshot-
|
|
32
|
-
"@instructure/ui-testable": "8.25.1-snapshot-
|
|
33
|
-
"@instructure/ui-view": "8.25.1-snapshot-
|
|
27
|
+
"@instructure/console": "8.25.1-snapshot-10",
|
|
28
|
+
"@instructure/emotion": "8.25.1-snapshot-10",
|
|
29
|
+
"@instructure/shared-types": "8.25.1-snapshot-10",
|
|
30
|
+
"@instructure/ui-icons": "8.25.1-snapshot-10",
|
|
31
|
+
"@instructure/ui-react-utils": "8.25.1-snapshot-10",
|
|
32
|
+
"@instructure/ui-testable": "8.25.1-snapshot-10",
|
|
33
|
+
"@instructure/ui-view": "8.25.1-snapshot-10",
|
|
34
34
|
"prop-types": "^15"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@instructure/ui-babel-preset": "8.25.1-snapshot-
|
|
38
|
-
"@instructure/ui-color-utils": "8.25.1-snapshot-
|
|
39
|
-
"@instructure/ui-test-locator": "8.25.1-snapshot-
|
|
40
|
-
"@instructure/ui-test-utils": "8.25.1-snapshot-
|
|
41
|
-
"@instructure/ui-themes": "8.25.1-snapshot-
|
|
37
|
+
"@instructure/ui-babel-preset": "8.25.1-snapshot-10",
|
|
38
|
+
"@instructure/ui-color-utils": "8.25.1-snapshot-10",
|
|
39
|
+
"@instructure/ui-test-locator": "8.25.1-snapshot-10",
|
|
40
|
+
"@instructure/ui-test-utils": "8.25.1-snapshot-10",
|
|
41
|
+
"@instructure/ui-themes": "8.25.1-snapshot-10"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"react": ">=16.8 <=17"
|