@instructure/ui-avatar 10.26.1-snapshot-2 → 10.26.2
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 +5 -18
- package/es/Avatar/index.js +0 -3
- package/es/Avatar/props.js +18 -1
- package/lib/Avatar/index.js +0 -3
- package/lib/Avatar/props.js +19 -1
- package/package.json +14 -12
- package/src/Avatar/index.tsx +0 -3
- package/src/Avatar/props.ts +40 -2
- package/tsconfig.build.json +3 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Avatar/index.d.ts.map +1 -1
- package/types/Avatar/props.d.ts +3 -2
- package/types/Avatar/props.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,30 +3,17 @@
|
|
|
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
|
-
## [10.26.
|
|
6
|
+
## [10.26.2](https://github.com/instructure/instructure-ui/compare/v10.26.1...v10.26.2) (2025-10-13)
|
|
7
7
|
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-avatar
|
|
8
9
|
|
|
9
|
-
### Features
|
|
10
10
|
|
|
11
|
-
* **many:** instUI v11 release ([36f5438](https://github.com/instructure/instructure-ui/commit/36f54382669186227ba24798bbf7201ef2f5cd4c))
|
|
12
11
|
|
|
13
12
|
|
|
14
|
-
### BREAKING CHANGES
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- remove `CodeEditor` component
|
|
20
|
-
- remove `@instui/theme-registry` package
|
|
21
|
-
- remove `@testable`, `@experimental`, `@hack` decorators
|
|
22
|
-
- InstUISettingsProvider's `as` prop is removed
|
|
23
|
-
- `canvas.use()`, `canvasHighContrast.use()` functions are removed
|
|
24
|
-
- `canvasThemeLocal`, `canvasHighContrastThemeLocal` are removed
|
|
25
|
-
- `variables` field on theme objects are removed
|
|
26
|
-
- remove deprecated props from Table: Row's `isStacked`, Body's
|
|
27
|
-
`isStacked`, `hover`, and `headers`
|
|
28
|
-
- `Table`'s `caption` prop is now required
|
|
29
|
-
- `ui-dom-utils`'s `getComputedStyle` can now return `undefined`
|
|
14
|
+
## [10.26.1](https://github.com/instructure/instructure-ui/compare/v10.26.0...v10.26.1) (2025-10-06)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @instructure/ui-avatar
|
|
30
17
|
|
|
31
18
|
|
|
32
19
|
|
package/es/Avatar/index.js
CHANGED
package/es/Avatar/props.js
CHANGED
|
@@ -22,5 +22,22 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
+
import PropTypes from 'prop-types';
|
|
26
|
+
const propTypes = {
|
|
27
|
+
name: PropTypes.string.isRequired,
|
|
28
|
+
src: PropTypes.string,
|
|
29
|
+
alt: PropTypes.string,
|
|
30
|
+
size: PropTypes.oneOf(['auto', 'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large']),
|
|
31
|
+
color: PropTypes.oneOf(['default', 'shamrock', 'barney', 'crimson', 'fire', 'licorice', 'ash', 'ai']),
|
|
32
|
+
hasInverseColor: PropTypes.bool,
|
|
33
|
+
showBorder: PropTypes.oneOf(['auto', 'always', 'never']),
|
|
34
|
+
shape: PropTypes.oneOf(['circle', 'rectangle']),
|
|
35
|
+
margin: PropTypes.string,
|
|
36
|
+
display: PropTypes.oneOf(['inline-block', 'block']),
|
|
37
|
+
onImageLoaded: PropTypes.func,
|
|
38
|
+
as: PropTypes.elementType,
|
|
39
|
+
elementRef: PropTypes.func,
|
|
40
|
+
renderIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func])
|
|
41
|
+
};
|
|
25
42
|
const allowedProps = ['name', 'src', 'alt', 'size', 'color', 'hasInverseColor', 'shape', 'margin', 'display', 'onImageLoaded', 'as', 'elementRef', 'renderIcon', 'showBorder'];
|
|
26
|
-
export { allowedProps };
|
|
43
|
+
export { propTypes, allowedProps };
|
package/lib/Avatar/index.js
CHANGED
package/lib/Avatar/props.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
exports.allowedProps = void 0;
|
|
7
|
+
exports.propTypes = exports.allowedProps = void 0;
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
7
9
|
/*
|
|
8
10
|
* The MIT License (MIT)
|
|
9
11
|
*
|
|
@@ -28,4 +30,20 @@ exports.allowedProps = void 0;
|
|
|
28
30
|
* SOFTWARE.
|
|
29
31
|
*/
|
|
30
32
|
|
|
33
|
+
const propTypes = exports.propTypes = {
|
|
34
|
+
name: _propTypes.default.string.isRequired,
|
|
35
|
+
src: _propTypes.default.string,
|
|
36
|
+
alt: _propTypes.default.string,
|
|
37
|
+
size: _propTypes.default.oneOf(['auto', 'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large']),
|
|
38
|
+
color: _propTypes.default.oneOf(['default', 'shamrock', 'barney', 'crimson', 'fire', 'licorice', 'ash', 'ai']),
|
|
39
|
+
hasInverseColor: _propTypes.default.bool,
|
|
40
|
+
showBorder: _propTypes.default.oneOf(['auto', 'always', 'never']),
|
|
41
|
+
shape: _propTypes.default.oneOf(['circle', 'rectangle']),
|
|
42
|
+
margin: _propTypes.default.string,
|
|
43
|
+
display: _propTypes.default.oneOf(['inline-block', 'block']),
|
|
44
|
+
onImageLoaded: _propTypes.default.func,
|
|
45
|
+
as: _propTypes.default.elementType,
|
|
46
|
+
elementRef: _propTypes.default.func,
|
|
47
|
+
renderIcon: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func])
|
|
48
|
+
};
|
|
31
49
|
const allowedProps = exports.allowedProps = ['name', 'src', 'alt', 'size', 'color', 'hasInverseColor', 'shape', 'margin', 'display', 'onImageLoaded', 'as', 'elementRef', 'renderIcon', 'showBorder'];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-avatar",
|
|
3
|
-
"version": "10.26.
|
|
3
|
+
"version": "10.26.2",
|
|
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,23 +24,25 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime": "^7.27.6",
|
|
27
|
-
"@instructure/emotion": "10.26.
|
|
28
|
-
"@instructure/shared-types": "10.26.
|
|
29
|
-
"@instructure/ui-icons": "10.26.
|
|
30
|
-
"@instructure/ui-react-utils": "10.26.
|
|
31
|
-
"@instructure/ui-
|
|
27
|
+
"@instructure/emotion": "10.26.2",
|
|
28
|
+
"@instructure/shared-types": "10.26.2",
|
|
29
|
+
"@instructure/ui-icons": "10.26.2",
|
|
30
|
+
"@instructure/ui-react-utils": "10.26.2",
|
|
31
|
+
"@instructure/ui-testable": "10.26.2",
|
|
32
|
+
"@instructure/ui-view": "10.26.2",
|
|
33
|
+
"prop-types": "^15.8.1"
|
|
32
34
|
},
|
|
33
35
|
"devDependencies": {
|
|
34
|
-
"@instructure/ui-axe-check": "10.26.
|
|
35
|
-
"@instructure/ui-babel-preset": "10.26.
|
|
36
|
-
"@instructure/ui-color-utils": "10.26.
|
|
37
|
-
"@instructure/ui-themes": "10.26.
|
|
36
|
+
"@instructure/ui-axe-check": "10.26.2",
|
|
37
|
+
"@instructure/ui-babel-preset": "10.26.2",
|
|
38
|
+
"@instructure/ui-color-utils": "10.26.2",
|
|
39
|
+
"@instructure/ui-themes": "10.26.2",
|
|
38
40
|
"@testing-library/jest-dom": "^6.6.3",
|
|
39
|
-
"@testing-library/react": "
|
|
41
|
+
"@testing-library/react": "^16.0.1",
|
|
40
42
|
"vitest": "^3.2.2"
|
|
41
43
|
},
|
|
42
44
|
"peerDependencies": {
|
|
43
|
-
"react": ">=
|
|
45
|
+
"react": ">=16.14 <=18"
|
|
44
46
|
},
|
|
45
47
|
"publishConfig": {
|
|
46
48
|
"access": "public"
|
package/src/Avatar/index.tsx
CHANGED
package/src/Avatar/props.ts
CHANGED
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import { SyntheticEvent } from 'react'
|
|
26
|
+
import PropTypes from 'prop-types'
|
|
26
27
|
|
|
27
28
|
import type {
|
|
28
29
|
Spacing,
|
|
@@ -32,7 +33,8 @@ import type {
|
|
|
32
33
|
import type {
|
|
33
34
|
AsElementType,
|
|
34
35
|
AvatarTheme,
|
|
35
|
-
OtherHTMLAttributes
|
|
36
|
+
OtherHTMLAttributes,
|
|
37
|
+
PropValidators
|
|
36
38
|
} from '@instructure/shared-types'
|
|
37
39
|
import { Renderable } from '@instructure/shared-types'
|
|
38
40
|
|
|
@@ -118,6 +120,42 @@ type AvatarProps = AvatarOwnProps &
|
|
|
118
120
|
type AvatarStyle = ComponentStyle<
|
|
119
121
|
'avatar' | 'initials' | 'loadImage' | 'iconSVG'
|
|
120
122
|
>
|
|
123
|
+
|
|
124
|
+
const propTypes: PropValidators<PropKeys> = {
|
|
125
|
+
name: PropTypes.string.isRequired,
|
|
126
|
+
src: PropTypes.string,
|
|
127
|
+
alt: PropTypes.string,
|
|
128
|
+
size: PropTypes.oneOf([
|
|
129
|
+
'auto',
|
|
130
|
+
'xx-small',
|
|
131
|
+
'x-small',
|
|
132
|
+
'small',
|
|
133
|
+
'medium',
|
|
134
|
+
'large',
|
|
135
|
+
'x-large',
|
|
136
|
+
'xx-large'
|
|
137
|
+
]),
|
|
138
|
+
color: PropTypes.oneOf([
|
|
139
|
+
'default',
|
|
140
|
+
'shamrock',
|
|
141
|
+
'barney',
|
|
142
|
+
'crimson',
|
|
143
|
+
'fire',
|
|
144
|
+
'licorice',
|
|
145
|
+
'ash',
|
|
146
|
+
'ai'
|
|
147
|
+
]),
|
|
148
|
+
hasInverseColor: PropTypes.bool,
|
|
149
|
+
showBorder: PropTypes.oneOf(['auto', 'always', 'never']),
|
|
150
|
+
shape: PropTypes.oneOf(['circle', 'rectangle']),
|
|
151
|
+
margin: PropTypes.string,
|
|
152
|
+
display: PropTypes.oneOf(['inline-block', 'block']),
|
|
153
|
+
onImageLoaded: PropTypes.func,
|
|
154
|
+
as: PropTypes.elementType,
|
|
155
|
+
elementRef: PropTypes.func,
|
|
156
|
+
renderIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func])
|
|
157
|
+
}
|
|
158
|
+
|
|
121
159
|
const allowedProps: AllowedPropKeys = [
|
|
122
160
|
'name',
|
|
123
161
|
'src',
|
|
@@ -136,4 +174,4 @@ const allowedProps: AllowedPropKeys = [
|
|
|
136
174
|
]
|
|
137
175
|
|
|
138
176
|
export type { AvatarProps, AvatarStyle }
|
|
139
|
-
export { allowedProps }
|
|
177
|
+
export { propTypes, allowedProps }
|