@fluentui-react-native/experimental-avatar 0.14.43 → 0.15.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/CHANGELOG.json +46 -1
- package/CHANGELOG.md +26 -2
- package/{lib-commonjs/Avatar.d.ts → lib/NativeAvatar.d.ts} +6 -6
- package/lib/NativeAvatar.d.ts.map +1 -0
- package/lib/{Avatar.js → NativeAvatar.js} +3 -3
- package/lib/NativeAvatar.js.map +1 -0
- package/lib/index.d.ts +1 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -3
- package/lib/index.js.map +1 -1
- package/{lib/Avatar.d.ts → lib-commonjs/NativeAvatar.d.ts} +6 -6
- package/lib-commonjs/NativeAvatar.d.ts.map +1 -0
- package/lib-commonjs/{Avatar.js → NativeAvatar.js} +4 -4
- package/lib-commonjs/NativeAvatar.js.map +1 -0
- package/lib-commonjs/index.d.ts +1 -3
- package/lib-commonjs/index.d.ts.map +1 -1
- package/lib-commonjs/index.js +1 -3
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +2 -10
- package/src/{Avatar.tsx → NativeAvatar.tsx} +11 -11
- package/src/__tests__/{JSAvatar.test.jsx → Avatar.test.jsx} +2 -2
- package/src/__tests__/__snapshots__/Avatar.test.jsx.snap +93 -0
- package/src/index.ts +1 -3
- package/MIGRATION.md +0 -158
- package/SPEC.md +0 -305
- package/jest.config.js +0 -2
- package/lib/Avatar.d.ts.map +0 -1
- package/lib/Avatar.js.map +0 -1
- package/lib/JSAvatar.d.ts +0 -12
- package/lib/JSAvatar.d.ts.map +0 -1
- package/lib/JSAvatar.helpers.d.ts +0 -7
- package/lib/JSAvatar.helpers.d.ts.map +0 -1
- package/lib/JSAvatar.helpers.js +0 -28
- package/lib/JSAvatar.helpers.js.map +0 -1
- package/lib/JSAvatar.js +0 -75
- package/lib/JSAvatar.js.map +0 -1
- package/lib/JSAvatar.styling.d.ts +0 -5
- package/lib/JSAvatar.styling.d.ts.map +0 -1
- package/lib/JSAvatar.styling.js +0 -114
- package/lib/JSAvatar.styling.js.map +0 -1
- package/lib/JSAvatar.types.d.ts +0 -192
- package/lib/JSAvatar.types.d.ts.map +0 -1
- package/lib/JSAvatar.types.js +0 -56
- package/lib/JSAvatar.types.js.map +0 -1
- package/lib/JSAvatarTokens.d.ts +0 -5
- package/lib/JSAvatarTokens.d.ts.map +0 -1
- package/lib/JSAvatarTokens.js +0 -200
- package/lib/JSAvatarTokens.js.map +0 -1
- package/lib/JSAvatarTokens.win32.d.ts +0 -5
- package/lib/JSAvatarTokens.win32.d.ts.map +0 -1
- package/lib/JSAvatarTokens.win32.js +0 -203
- package/lib/JSAvatarTokens.win32.js.map +0 -1
- package/lib/getHashCode.d.ts +0 -8
- package/lib/getHashCode.d.ts.map +0 -1
- package/lib/getHashCode.js +0 -16
- package/lib/getHashCode.js.map +0 -1
- package/lib/titles.d.ts +0 -2
- package/lib/titles.d.ts.map +0 -1
- package/lib/titles.js +0 -109
- package/lib/titles.js.map +0 -1
- package/lib/useAvatar.d.ts +0 -33
- package/lib/useAvatar.d.ts.map +0 -1
- package/lib/useAvatar.js +0 -105
- package/lib/useAvatar.js.map +0 -1
- package/lib-commonjs/Avatar.d.ts.map +0 -1
- package/lib-commonjs/Avatar.js.map +0 -1
- package/lib-commonjs/JSAvatar.d.ts +0 -12
- package/lib-commonjs/JSAvatar.d.ts.map +0 -1
- package/lib-commonjs/JSAvatar.helpers.d.ts +0 -7
- package/lib-commonjs/JSAvatar.helpers.d.ts.map +0 -1
- package/lib-commonjs/JSAvatar.helpers.js +0 -32
- package/lib-commonjs/JSAvatar.helpers.js.map +0 -1
- package/lib-commonjs/JSAvatar.js +0 -79
- package/lib-commonjs/JSAvatar.js.map +0 -1
- package/lib-commonjs/JSAvatar.styling.d.ts +0 -5
- package/lib-commonjs/JSAvatar.styling.d.ts.map +0 -1
- package/lib-commonjs/JSAvatar.styling.js +0 -117
- package/lib-commonjs/JSAvatar.styling.js.map +0 -1
- package/lib-commonjs/JSAvatar.types.d.ts +0 -192
- package/lib-commonjs/JSAvatar.types.d.ts.map +0 -1
- package/lib-commonjs/JSAvatar.types.js +0 -59
- package/lib-commonjs/JSAvatar.types.js.map +0 -1
- package/lib-commonjs/JSAvatarTokens.d.ts +0 -5
- package/lib-commonjs/JSAvatarTokens.d.ts.map +0 -1
- package/lib-commonjs/JSAvatarTokens.js +0 -204
- package/lib-commonjs/JSAvatarTokens.js.map +0 -1
- package/lib-commonjs/JSAvatarTokens.win32.d.ts +0 -5
- package/lib-commonjs/JSAvatarTokens.win32.d.ts.map +0 -1
- package/lib-commonjs/JSAvatarTokens.win32.js +0 -207
- package/lib-commonjs/JSAvatarTokens.win32.js.map +0 -1
- package/lib-commonjs/getHashCode.d.ts +0 -8
- package/lib-commonjs/getHashCode.d.ts.map +0 -1
- package/lib-commonjs/getHashCode.js +0 -20
- package/lib-commonjs/getHashCode.js.map +0 -1
- package/lib-commonjs/titles.d.ts +0 -2
- package/lib-commonjs/titles.d.ts.map +0 -1
- package/lib-commonjs/titles.js +0 -112
- package/lib-commonjs/titles.js.map +0 -1
- package/lib-commonjs/useAvatar.d.ts +0 -33
- package/lib-commonjs/useAvatar.d.ts.map +0 -1
- package/lib-commonjs/useAvatar.js +0 -112
- package/lib-commonjs/useAvatar.js.map +0 -1
- package/src/JSAvatar.helpers.ts +0 -35
- package/src/JSAvatar.styling.ts +0 -159
- package/src/JSAvatar.tsx +0 -80
- package/src/JSAvatar.types.ts +0 -259
- package/src/JSAvatarTokens.ts +0 -203
- package/src/JSAvatarTokens.win32.ts +0 -206
- package/src/__tests__/__snapshots__/JSAvatar.test.jsx.snap +0 -96
- package/src/getHashCode.ts +0 -16
- package/src/titles.ts +0 -108
- package/src/useAvatar.ts +0 -122
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,52 @@
|
|
|
2
2
|
"name": "@fluentui-react-native/experimental-avatar",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Tue, 21 Jun 2022 21:06:59 GMT",
|
|
6
|
+
"tag": "@fluentui-react-native/experimental-avatar_v0.15.0",
|
|
7
|
+
"version": "0.15.0",
|
|
8
|
+
"comments": {
|
|
9
|
+
"minor": [
|
|
10
|
+
{
|
|
11
|
+
"author": "v.kozova13@gmail.com",
|
|
12
|
+
"package": "@fluentui-react-native/experimental-avatar",
|
|
13
|
+
"commit": "2ad8751db36583b42e819bbf6667161d2687cf7a",
|
|
14
|
+
"comment": "Renamed Avatar to NativeAvatar, JSAvatar to Avatar"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Tue, 21 Jun 2022 20:05:26 GMT",
|
|
21
|
+
"tag": "@fluentui-react-native/experimental-avatar_v0.14.45",
|
|
22
|
+
"version": "0.14.45",
|
|
23
|
+
"comments": {
|
|
24
|
+
"patch": [
|
|
25
|
+
{
|
|
26
|
+
"author": "v.kozova13@gmail.com",
|
|
27
|
+
"package": "@fluentui-react-native/experimental-avatar",
|
|
28
|
+
"commit": "f93c1716455fb220897d993f4450f00b05f0bf0a",
|
|
29
|
+
"comment": "Rewrote tests using it.each method"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"date": "Thu, 16 Jun 2022 19:11:01 GMT",
|
|
36
|
+
"tag": "@fluentui-react-native/experimental-avatar_v0.14.44",
|
|
37
|
+
"version": "0.14.44",
|
|
38
|
+
"comments": {
|
|
39
|
+
"patch": [
|
|
40
|
+
{
|
|
41
|
+
"author": "v.kozova13@gmail.com",
|
|
42
|
+
"package": "@fluentui-react-native/experimental-avatar",
|
|
43
|
+
"commit": "531fc8d94b1452887b43073ea629838a72f0a7f5",
|
|
44
|
+
"comment": "Added ring configuration"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"date": "Thu, 16 Jun 2022 17:09:28 GMT",
|
|
6
51
|
"tag": "@fluentui-react-native/experimental-avatar_v0.14.43",
|
|
7
52
|
"version": "0.14.43",
|
|
8
53
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,36 @@
|
|
|
1
1
|
# Change Log - @fluentui-react-native/experimental-avatar
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 21 Jun 2022 21:06:59 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.15.0
|
|
8
|
+
|
|
9
|
+
Tue, 21 Jun 2022 21:06:59 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- Renamed Avatar to NativeAvatar, JSAvatar to Avatar (v.kozova13@gmail.com)
|
|
14
|
+
|
|
15
|
+
## 0.14.45
|
|
16
|
+
|
|
17
|
+
Tue, 21 Jun 2022 20:05:26 GMT
|
|
18
|
+
|
|
19
|
+
### Patches
|
|
20
|
+
|
|
21
|
+
- Rewrote tests using it.each method (v.kozova13@gmail.com)
|
|
22
|
+
|
|
23
|
+
## 0.14.44
|
|
24
|
+
|
|
25
|
+
Thu, 16 Jun 2022 19:11:01 GMT
|
|
26
|
+
|
|
27
|
+
### Patches
|
|
28
|
+
|
|
29
|
+
- Added ring configuration (v.kozova13@gmail.com)
|
|
30
|
+
|
|
7
31
|
## 0.14.43
|
|
8
32
|
|
|
9
|
-
Thu, 16 Jun 2022 17:
|
|
33
|
+
Thu, 16 Jun 2022 17:09:28 GMT
|
|
10
34
|
|
|
11
35
|
### Patches
|
|
12
36
|
|
|
@@ -2,7 +2,7 @@ import { ImageURISource, ViewProps, ColorValue } from 'react-native';
|
|
|
2
2
|
export declare type Size = 'xSmall' | 'small' | 'medium' | 'large' | 'xLarge' | 'xxLarge';
|
|
3
3
|
export declare type AvatarStyle = 'default' | 'accent' | 'group' | 'outlined' | 'outlinedPrimary' | 'overflow';
|
|
4
4
|
export declare type Presence = 'none' | 'available' | 'away' | 'blocked' | 'doNotDisturb' | 'offline' | 'unknown';
|
|
5
|
-
export declare type
|
|
5
|
+
export declare type NativeAvatarTokens = {
|
|
6
6
|
/**
|
|
7
7
|
* Supported Avatar sizes
|
|
8
8
|
*/
|
|
@@ -12,7 +12,7 @@ export declare type AvatarTokens = {
|
|
|
12
12
|
*/
|
|
13
13
|
avatarStyle?: AvatarStyle;
|
|
14
14
|
};
|
|
15
|
-
export declare type
|
|
15
|
+
export declare type NativeAvatarProps = NativeAvatarTokens & {
|
|
16
16
|
/**
|
|
17
17
|
* The image to be displayed
|
|
18
18
|
*/
|
|
@@ -63,8 +63,8 @@ export declare type AvatarProps = AvatarTokens & {
|
|
|
63
63
|
*/
|
|
64
64
|
customBorderImageSource?: ImageURISource;
|
|
65
65
|
};
|
|
66
|
-
export declare type NativeAvatarViewProps = ViewProps &
|
|
67
|
-
export declare const
|
|
66
|
+
export declare type NativeAvatarViewProps = ViewProps & NativeAvatarProps;
|
|
67
|
+
export declare const NativeAvatar: import("@fluentui-react-native/framework").ComposableComponent<NativeAvatarProps, {
|
|
68
68
|
root: NativeAvatarViewProps;
|
|
69
|
-
},
|
|
70
|
-
//# sourceMappingURL=
|
|
69
|
+
}, NativeAvatarTokens, object>;
|
|
70
|
+
//# sourceMappingURL=NativeAvatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeAvatar.d.ts","sourceRoot":"","sources":["../src/NativeAvatar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAiB,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAOpF,oBAAY,IAAI,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAElF,oBAAY,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,iBAAiB,GAAG,UAAU,CAAC;AAEvG,oBAAY,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,GAAG,SAAS,CAAC;AAQ1G,oBAAY,kBAAkB,GAAG;IAC/B;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF,oBAAY,iBAAiB,GAAG,kBAAkB,GAAG;IACnD;;OAEG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAE7B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;IAEvB;;OAEG;IACH,eAAe,CAAC,EAAE,UAAU,CAAC;IAE7B;;OAEG;IACH,eAAe,CAAC,EAAE,UAAU,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,uBAAuB,CAAC,EAAE,cAAc,CAAC;CAC1C,CAAC;AAIF,oBAAY,qBAAqB,GAAG,SAAS,GAAG,iBAAiB,CAAC;AAOlE,eAAO,MAAM,YAAY;UAJJ,qBAAqB;8BAgCxC,CAAC"}
|
|
@@ -13,11 +13,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
13
13
|
import { compose, buildProps, mergeProps, withSlots } from '@fluentui-react-native/framework';
|
|
14
14
|
import { NativeModules } from 'react-native';
|
|
15
15
|
import { ensureNativeComponent } from '@fluentui-react-native/component-cache';
|
|
16
|
-
var avatarName = '
|
|
16
|
+
var avatarName = 'NativeAvatar';
|
|
17
17
|
var NativeAvatarView = ensureNativeComponent('FRNAvatarView');
|
|
18
18
|
var ExportedNativeConstants = NativeModules.FRNAvatarViewManager;
|
|
19
19
|
var tokensThatAreAlsoProps = ['size', 'avatarStyle'];
|
|
20
|
-
export var
|
|
20
|
+
export var NativeAvatar = compose({
|
|
21
21
|
displayName: avatarName,
|
|
22
22
|
tokens: [
|
|
23
23
|
{
|
|
@@ -42,4 +42,4 @@ export var Avatar = compose({
|
|
|
42
42
|
return function (rest) { return withSlots(Root, __assign({}, mergeProps(props, rest))); };
|
|
43
43
|
},
|
|
44
44
|
});
|
|
45
|
-
//# sourceMappingURL=
|
|
45
|
+
//# sourceMappingURL=NativeAvatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeAvatar.js","sourceRoot":"","sources":["../src/NativeAvatar.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,qBAAqB;AACrB,OAAO,EAAE,OAAO,EAAY,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AACxG,OAAO,EAAkB,aAAa,EAAyB,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAE/E,IAAM,UAAU,GAAG,cAAc,CAAC;AAElC,IAAM,gBAAgB,GAAG,qBAAqB,CAAC,eAAe,CAAC,CAAC;AAYhE,IAAM,uBAAuB,GAAsB,aAAa,CAAC,oBAAoB,CAAC;AA6EtF,IAAM,sBAAsB,GAAiC,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AASrF,MAAM,CAAC,IAAM,YAAY,GAAG,OAAO,CAAa;IAC9C,WAAW,EAAE,UAAU;IACvB,MAAM,EAAE;QACN;YACE,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,SAAS;SACvB;QACD,UAAU;KACX;IACD,sBAAsB,wBAAA;IACtB,KAAK,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;IACjC,SAAS,EAAE;QACT,IAAI,EAAE,UAAU,CACd,UAAC,MAAM,IAAK,OAAA,CAAC;YACX,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,KAAK,EAAE;gBACL,MAAM,EAAE,uBAAuB,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;gBAClD,KAAK,EAAE,uBAAuB,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;aAClD;SACF,CAAC,EANU,CAMV,EACF,CAAC,MAAM,CAAC,CACT;KACF;IACD,SAAS,EAAE,UAAC,KAAwB,EAAE,QAA8B;QAClE,IAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;QAElC,OAAO,UAAC,IAAuB,IAAK,OAAA,UAAC,IAAI,eAAK,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,EAAI,EAArC,CAAqC,CAAC;IAC5E,CAAC;CACF,CAAC,CAAC"}
|
package/lib/index.d.ts
CHANGED
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
package/lib/index.js
CHANGED
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { ImageURISource, ViewProps, ColorValue } from 'react-native';
|
|
|
2
2
|
export declare type Size = 'xSmall' | 'small' | 'medium' | 'large' | 'xLarge' | 'xxLarge';
|
|
3
3
|
export declare type AvatarStyle = 'default' | 'accent' | 'group' | 'outlined' | 'outlinedPrimary' | 'overflow';
|
|
4
4
|
export declare type Presence = 'none' | 'available' | 'away' | 'blocked' | 'doNotDisturb' | 'offline' | 'unknown';
|
|
5
|
-
export declare type
|
|
5
|
+
export declare type NativeAvatarTokens = {
|
|
6
6
|
/**
|
|
7
7
|
* Supported Avatar sizes
|
|
8
8
|
*/
|
|
@@ -12,7 +12,7 @@ export declare type AvatarTokens = {
|
|
|
12
12
|
*/
|
|
13
13
|
avatarStyle?: AvatarStyle;
|
|
14
14
|
};
|
|
15
|
-
export declare type
|
|
15
|
+
export declare type NativeAvatarProps = NativeAvatarTokens & {
|
|
16
16
|
/**
|
|
17
17
|
* The image to be displayed
|
|
18
18
|
*/
|
|
@@ -63,8 +63,8 @@ export declare type AvatarProps = AvatarTokens & {
|
|
|
63
63
|
*/
|
|
64
64
|
customBorderImageSource?: ImageURISource;
|
|
65
65
|
};
|
|
66
|
-
export declare type NativeAvatarViewProps = ViewProps &
|
|
67
|
-
export declare const
|
|
66
|
+
export declare type NativeAvatarViewProps = ViewProps & NativeAvatarProps;
|
|
67
|
+
export declare const NativeAvatar: import("@fluentui-react-native/framework").ComposableComponent<NativeAvatarProps, {
|
|
68
68
|
root: NativeAvatarViewProps;
|
|
69
|
-
},
|
|
70
|
-
//# sourceMappingURL=
|
|
69
|
+
}, NativeAvatarTokens, object>;
|
|
70
|
+
//# sourceMappingURL=NativeAvatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeAvatar.d.ts","sourceRoot":"","sources":["../src/NativeAvatar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAiB,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAOpF,oBAAY,IAAI,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAElF,oBAAY,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,iBAAiB,GAAG,UAAU,CAAC;AAEvG,oBAAY,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,GAAG,SAAS,CAAC;AAQ1G,oBAAY,kBAAkB,GAAG;IAC/B;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF,oBAAY,iBAAiB,GAAG,kBAAkB,GAAG;IACnD;;OAEG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAE7B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;IAEvB;;OAEG;IACH,eAAe,CAAC,EAAE,UAAU,CAAC;IAE7B;;OAEG;IACH,eAAe,CAAC,EAAE,UAAU,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,uBAAuB,CAAC,EAAE,cAAc,CAAC;CAC1C,CAAC;AAIF,oBAAY,qBAAqB,GAAG,SAAS,GAAG,iBAAiB,CAAC;AAOlE,eAAO,MAAM,YAAY;UAJJ,qBAAqB;8BAgCxC,CAAC"}
|
|
@@ -11,16 +11,16 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.
|
|
14
|
+
exports.NativeAvatar = void 0;
|
|
15
15
|
/** @jsx withSlots */
|
|
16
16
|
var framework_1 = require("@fluentui-react-native/framework");
|
|
17
17
|
var react_native_1 = require("react-native");
|
|
18
18
|
var component_cache_1 = require("@fluentui-react-native/component-cache");
|
|
19
|
-
var avatarName = '
|
|
19
|
+
var avatarName = 'NativeAvatar';
|
|
20
20
|
var NativeAvatarView = (0, component_cache_1.ensureNativeComponent)('FRNAvatarView');
|
|
21
21
|
var ExportedNativeConstants = react_native_1.NativeModules.FRNAvatarViewManager;
|
|
22
22
|
var tokensThatAreAlsoProps = ['size', 'avatarStyle'];
|
|
23
|
-
exports.
|
|
23
|
+
exports.NativeAvatar = (0, framework_1.compose)({
|
|
24
24
|
displayName: avatarName,
|
|
25
25
|
tokens: [
|
|
26
26
|
{
|
|
@@ -45,4 +45,4 @@ exports.Avatar = (0, framework_1.compose)({
|
|
|
45
45
|
return function (rest) { return (0, framework_1.withSlots)(Root, __assign({}, (0, framework_1.mergeProps)(props, rest))); };
|
|
46
46
|
},
|
|
47
47
|
});
|
|
48
|
-
//# sourceMappingURL=
|
|
48
|
+
//# sourceMappingURL=NativeAvatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeAvatar.js","sourceRoot":"","sources":["../src/NativeAvatar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qBAAqB;AACrB,8DAAwG;AACxG,6CAAoF;AACpF,0EAA+E;AAE/E,IAAM,UAAU,GAAG,cAAc,CAAC;AAElC,IAAM,gBAAgB,GAAG,IAAA,uCAAqB,EAAC,eAAe,CAAC,CAAC;AAYhE,IAAM,uBAAuB,GAAsB,4BAAa,CAAC,oBAAoB,CAAC;AA6EtF,IAAM,sBAAsB,GAAiC,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AASxE,QAAA,YAAY,GAAG,IAAA,mBAAO,EAAa;IAC9C,WAAW,EAAE,UAAU;IACvB,MAAM,EAAE;QACN;YACE,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,SAAS;SACvB;QACD,UAAU;KACX;IACD,sBAAsB,wBAAA;IACtB,KAAK,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;IACjC,SAAS,EAAE;QACT,IAAI,EAAE,IAAA,sBAAU,EACd,UAAC,MAAM,IAAK,OAAA,CAAC;YACX,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,KAAK,EAAE;gBACL,MAAM,EAAE,uBAAuB,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;gBAClD,KAAK,EAAE,uBAAuB,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;aAClD;SACF,CAAC,EANU,CAMV,EACF,CAAC,MAAM,CAAC,CACT;KACF;IACD,SAAS,EAAE,UAAC,KAAwB,EAAE,QAA8B;QAClE,IAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;QAElC,OAAO,UAAC,IAAuB,IAAK,OAAA,2BAAC,IAAI,eAAK,IAAA,sBAAU,EAAC,KAAK,EAAE,IAAI,CAAC,EAAI,EAArC,CAAqC,CAAC;IAC5E,CAAC;CACF,CAAC,CAAC"}
|
package/lib-commonjs/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -10,7 +10,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./
|
|
14
|
-
__exportStar(require("./JSAvatar"), exports);
|
|
15
|
-
__exportStar(require("./JSAvatar.types"), exports);
|
|
13
|
+
__exportStar(require("./NativeAvatar"), exports);
|
|
16
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA+B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-react-native/experimental-avatar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "A cross-platform Avatar component using the Fluent Design System. Currently only implemented on iOS",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Microsoft <fluentuinativeowners@microsoft.com>",
|
|
@@ -25,16 +25,8 @@
|
|
|
25
25
|
"directory": "packages/experimental/Avatar"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@fluentui-react-native/adapters": "^0.8.5",
|
|
29
|
-
"@fluentui-react-native/badge": "^0.0.43",
|
|
30
28
|
"@fluentui-react-native/component-cache": "^1.3.2",
|
|
31
|
-
"@fluentui-react-native/framework": "0.7.30"
|
|
32
|
-
"@fluentui-react-native/icon": "^0.12.1",
|
|
33
|
-
"@fluentui-react-native/interactive-hooks": "^0.16.3",
|
|
34
|
-
"@fluentui-react-native/theme-tokens": "^0.18.0",
|
|
35
|
-
"@fluentui-react-native/tokens": "^0.14.0",
|
|
36
|
-
"@fluentui-react-native/use-styling": "^0.8.3",
|
|
37
|
-
"react-native-svg": "^12.3.0"
|
|
29
|
+
"@fluentui-react-native/framework": "0.7.30"
|
|
38
30
|
},
|
|
39
31
|
"devDependencies": {
|
|
40
32
|
"@fluentui-react-native/eslint-config-rules": "^0.1.1",
|
|
@@ -3,7 +3,7 @@ import { compose, UseSlots, buildProps, mergeProps, withSlots } from '@fluentui-
|
|
|
3
3
|
import { ImageURISource, NativeModules, ViewProps, ColorValue } from 'react-native';
|
|
4
4
|
import { ensureNativeComponent } from '@fluentui-react-native/component-cache';
|
|
5
5
|
|
|
6
|
-
const avatarName = '
|
|
6
|
+
const avatarName = 'NativeAvatar';
|
|
7
7
|
|
|
8
8
|
const NativeAvatarView = ensureNativeComponent('FRNAvatarView');
|
|
9
9
|
|
|
@@ -19,7 +19,7 @@ interface ExportedConstants {
|
|
|
19
19
|
|
|
20
20
|
const ExportedNativeConstants: ExportedConstants = NativeModules.FRNAvatarViewManager;
|
|
21
21
|
|
|
22
|
-
export type
|
|
22
|
+
export type NativeAvatarTokens = {
|
|
23
23
|
/**
|
|
24
24
|
* Supported Avatar sizes
|
|
25
25
|
*/
|
|
@@ -31,7 +31,7 @@ export type AvatarTokens = {
|
|
|
31
31
|
avatarStyle?: AvatarStyle;
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
export type
|
|
34
|
+
export type NativeAvatarProps = NativeAvatarTokens & {
|
|
35
35
|
/**
|
|
36
36
|
* The image to be displayed
|
|
37
37
|
*/
|
|
@@ -94,16 +94,16 @@ export type AvatarProps = AvatarTokens & {
|
|
|
94
94
|
customBorderImageSource?: ImageURISource;
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
-
const tokensThatAreAlsoProps: (keyof
|
|
97
|
+
const tokensThatAreAlsoProps: (keyof NativeAvatarTokens)[] = ['size', 'avatarStyle'];
|
|
98
98
|
|
|
99
|
-
export type NativeAvatarViewProps = ViewProps &
|
|
99
|
+
export type NativeAvatarViewProps = ViewProps & NativeAvatarProps;
|
|
100
100
|
interface AvatarType {
|
|
101
|
-
props:
|
|
101
|
+
props: NativeAvatarProps;
|
|
102
102
|
slotProps: { root: NativeAvatarViewProps };
|
|
103
|
-
tokens:
|
|
103
|
+
tokens: NativeAvatarTokens;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
export const
|
|
106
|
+
export const NativeAvatar = compose<AvatarType>({
|
|
107
107
|
displayName: avatarName,
|
|
108
108
|
tokens: [
|
|
109
109
|
{
|
|
@@ -115,7 +115,7 @@ export const Avatar = compose<AvatarType>({
|
|
|
115
115
|
tokensThatAreAlsoProps,
|
|
116
116
|
slots: { root: NativeAvatarView },
|
|
117
117
|
slotProps: {
|
|
118
|
-
root: buildProps<NativeAvatarViewProps,
|
|
118
|
+
root: buildProps<NativeAvatarViewProps, NativeAvatarTokens>(
|
|
119
119
|
(tokens) => ({
|
|
120
120
|
size: tokens.size,
|
|
121
121
|
style: {
|
|
@@ -126,9 +126,9 @@ export const Avatar = compose<AvatarType>({
|
|
|
126
126
|
['size'],
|
|
127
127
|
),
|
|
128
128
|
},
|
|
129
|
-
useRender: (props:
|
|
129
|
+
useRender: (props: NativeAvatarProps, useSlots: UseSlots<AvatarType>) => {
|
|
130
130
|
const Root = useSlots(props).root;
|
|
131
131
|
|
|
132
|
-
return (rest:
|
|
132
|
+
return (rest: NativeAvatarProps) => <Root {...mergeProps(props, rest)} />;
|
|
133
133
|
},
|
|
134
134
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Avatar } from '..';
|
|
3
3
|
import { getInitials } from '../useAvatar';
|
|
4
4
|
import * as renderer from 'react-test-renderer';
|
|
5
5
|
|
|
@@ -23,7 +23,7 @@ const initialsForNameWithTitles = ['F', 'RF'];
|
|
|
23
23
|
|
|
24
24
|
describe('Avatar rendering', () => {
|
|
25
25
|
it('renders Avatar', () => {
|
|
26
|
-
const tree = renderer.create(<
|
|
26
|
+
const tree = renderer.create(<Avatar />).toJSON();
|
|
27
27
|
expect(tree).toMatchSnapshot();
|
|
28
28
|
});
|
|
29
29
|
});
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Avatar rendering renders Avatar 1`] = `
|
|
4
|
+
<View
|
|
5
|
+
accessibilityLabel=""
|
|
6
|
+
accessibilityRole="image"
|
|
7
|
+
accessible={true}
|
|
8
|
+
icon={null}
|
|
9
|
+
initials=""
|
|
10
|
+
shape="circular"
|
|
11
|
+
style={
|
|
12
|
+
Object {
|
|
13
|
+
"alignItems": "center",
|
|
14
|
+
"height": 24,
|
|
15
|
+
"justifyContent": "center",
|
|
16
|
+
"opacity": 1,
|
|
17
|
+
"width": 24,
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
>
|
|
21
|
+
<View
|
|
22
|
+
accessible={false}
|
|
23
|
+
style={
|
|
24
|
+
Object {
|
|
25
|
+
"alignItems": "center",
|
|
26
|
+
"backgroundColor": "#e6e6e6",
|
|
27
|
+
"borderColor": "#ffffff",
|
|
28
|
+
"borderRadius": 9999,
|
|
29
|
+
"borderWidth": 0,
|
|
30
|
+
"height": 24,
|
|
31
|
+
"justifyContent": "center",
|
|
32
|
+
"marginLeft": 2,
|
|
33
|
+
"marginTop": 2,
|
|
34
|
+
"width": 24,
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
>
|
|
38
|
+
<View
|
|
39
|
+
accessibilityRole="image"
|
|
40
|
+
accessible={false}
|
|
41
|
+
style={
|
|
42
|
+
Object {
|
|
43
|
+
"fontSize": 16,
|
|
44
|
+
"height": 16,
|
|
45
|
+
"position": "absolute",
|
|
46
|
+
"width": 16,
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
>
|
|
50
|
+
<RNSVGSvgView
|
|
51
|
+
align="xMidYMid"
|
|
52
|
+
bbHeight="100%"
|
|
53
|
+
bbWidth="100%"
|
|
54
|
+
focusable={false}
|
|
55
|
+
meetOrSlice={0}
|
|
56
|
+
minX={0}
|
|
57
|
+
minY={0}
|
|
58
|
+
style={
|
|
59
|
+
Array [
|
|
60
|
+
Object {
|
|
61
|
+
"backgroundColor": "transparent",
|
|
62
|
+
"borderWidth": 0,
|
|
63
|
+
},
|
|
64
|
+
Object {
|
|
65
|
+
"flex": 0,
|
|
66
|
+
"height": "100%",
|
|
67
|
+
"width": "100%",
|
|
68
|
+
},
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
vbHeight={16}
|
|
72
|
+
vbWidth={14}
|
|
73
|
+
>
|
|
74
|
+
<RNSVGGroup>
|
|
75
|
+
<RNSVGPath
|
|
76
|
+
d="M7 0C4.79086 0 3 1.79086 3 4C3 6.20914 4.79086 8 7 8C9.20914 8 11 6.20914 11 4C11 1.79086 9.20914 0 7 0ZM4 4C4 2.34315 5.34315 1 7 1C8.65685 1 10 2.34315 10 4C10 5.65685 8.65685 7 7 7C5.34315 7 4 5.65685 4 4ZM2.00873 9C0.903151 9 0 9.88687 0 11C0 12.6912 0.83281 13.9663 2.13499 14.7966C3.41697 15.614 5.14526 16 7 16C8.85474 16 10.583 15.614 11.865 14.7966C13.1672 13.9663 14 12.6912 14 11C14 9.89557 13.1045 9.00001 12 9.00001L2.00873 9ZM1 11C1 10.4467 1.44786 10 2.00873 10L12 10C12.5522 10 13 10.4478 13 11C13 12.3088 12.3777 13.2837 11.3274 13.9534C10.2568 14.636 8.73511 15 7 15C5.26489 15 3.74318 14.636 2.67262 13.9534C1.62226 13.2837 1 12.3088 1 11Z"
|
|
77
|
+
fill={
|
|
78
|
+
Array [
|
|
79
|
+
2,
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
propList={
|
|
83
|
+
Array [
|
|
84
|
+
"fill",
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
/>
|
|
88
|
+
</RNSVGGroup>
|
|
89
|
+
</RNSVGSvgView>
|
|
90
|
+
</View>
|
|
91
|
+
</View>
|
|
92
|
+
</View>
|
|
93
|
+
`;
|
package/src/index.ts
CHANGED
package/MIGRATION.md
DELETED
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
# Avatar Migration
|
|
2
|
-
|
|
3
|
-
## Migration from PersonaCoin component
|
|
4
|
-
|
|
5
|
-
### Component renames
|
|
6
|
-
|
|
7
|
-
| `PersonaCoin` | `Avatar` |
|
|
8
|
-
| ------------------------------------------------------------ | ------------------------------------------------ |
|
|
9
|
-
| `<PersonaCoin size='size24' initials="SN" />` | `<Avatar size={24} initials="SN" />` |
|
|
10
|
-
| `<PersonaCoin presence='available' coinColorFluent="red" />` | `<Avatar size={24} initials="SN" />` |
|
|
11
|
-
| `<PersonaCoin imageUrl="./path/name.png" />` | `<Avatar image={{source: './path/name.png'}} />` |
|
|
12
|
-
| `<PersonaCoin imageDescription="Photo" />` | `<Avatar accessibilityLabel="Photo" />` |
|
|
13
|
-
|
|
14
|
-
### Props that remain as is
|
|
15
|
-
|
|
16
|
-
- `icon`
|
|
17
|
-
- `initials`
|
|
18
|
-
- `size`
|
|
19
|
-
- `imageUrl`
|
|
20
|
-
|
|
21
|
-
### Props no longer supported with an equivalent functionality in Avatar
|
|
22
|
-
|
|
23
|
-
- `coinColorFluent` => Use `avatarColor` instead.
|
|
24
|
-
- `imageDescription` => Use `accessibilityLabel` instead.
|
|
25
|
-
- `isOutOfOffice` => `outOfOffice` is part of `badge` slot. Use `badge={{ outOfOffice: true }} />`.
|
|
26
|
-
- `presence` => It's part of `badge` slot. Use `badge={{ presence: 'available' }} />`.
|
|
27
|
-
- `ring` => `ring` became part of `activeAppearance` prop. It's used together with `active='active'` prop.
|
|
28
|
-
|
|
29
|
-
### New props
|
|
30
|
-
|
|
31
|
-
- `active`
|
|
32
|
-
- `activeAppearance` - According to Web spec there should be `ring`, `shadow`, `glow`, `ring-shadow`, `ring-glow`.
|
|
33
|
-
Currently we support only `ring`. `activeAppearance` can be used when `active` prop set to `active`.
|
|
34
|
-
- `name` - is used for generation initials with `getInitials` method.
|
|
35
|
-
- `shape` - can be `circular` and `square`.
|
|
36
|
-
- `idForColor`
|
|
37
|
-
|
|
38
|
-
### Tokens that remain as is
|
|
39
|
-
|
|
40
|
-
- Any props that are part of `IBackgroundColorTokens`, `IForegroundColorTokens`
|
|
41
|
-
|
|
42
|
-
- `iconSize`
|
|
43
|
-
- `iconWeight`
|
|
44
|
-
- `horizontalIconAlignment`
|
|
45
|
-
- `verticalIconAlignment`
|
|
46
|
-
- `size`
|
|
47
|
-
|
|
48
|
-
### Tokens no longer supported with an equivalent functionality in Avatar
|
|
49
|
-
|
|
50
|
-
- `initialsSize` => Use `fontSize` token instead
|
|
51
|
-
- `coinColorFluent` => Use `avatarColor` token instead
|
|
52
|
-
- `coinSize` => Use size tokens instead.
|
|
53
|
-
- `ring` => Use `ringBackgroundColor`, `ringColor`, `ringThickness` and `ringInnerGap`
|
|
54
|
-
|
|
55
|
-
### Tokens no longer supported without an equivalent functionality in Avatar
|
|
56
|
-
|
|
57
|
-
- `iconStrokeWidth` and `iconStrokeColor` => This was for activity ring around the Avatar.
|
|
58
|
-
We support ring in `activeAppearance` prop. `borderColor` will be changed using `ringColor` token and `borderWidth` using ringThickness token.
|
|
59
|
-
|
|
60
|
-
### New tokens
|
|
61
|
-
|
|
62
|
-
- Any props that are part of `FontTokens` and `IBorderTokens`.
|
|
63
|
-
- `avatarOpacity`
|
|
64
|
-
- `badgeSize`
|
|
65
|
-
- `circular`
|
|
66
|
-
- `iconColor`
|
|
67
|
-
- `inactive`
|
|
68
|
-
- `square`
|
|
69
|
-
|
|
70
|
-
Size tokens:
|
|
71
|
-
|
|
72
|
-
- `size20`
|
|
73
|
-
- `size24`
|
|
74
|
-
- `size28`
|
|
75
|
-
- `size32`
|
|
76
|
-
- `size36`
|
|
77
|
-
- `size40`
|
|
78
|
-
- `size48`
|
|
79
|
-
- `size56`
|
|
80
|
-
- `size64`
|
|
81
|
-
- `size72`
|
|
82
|
-
- `size96`
|
|
83
|
-
- `size120`
|
|
84
|
-
|
|
85
|
-
Color tokens:
|
|
86
|
-
|
|
87
|
-
- `neutral`
|
|
88
|
-
- `brand`
|
|
89
|
-
- `darkRed`
|
|
90
|
-
- `cranberry`
|
|
91
|
-
- `red`
|
|
92
|
-
- `pumpkin`
|
|
93
|
-
- `peach`
|
|
94
|
-
- `marigold`
|
|
95
|
-
- `gold`
|
|
96
|
-
- `brass`
|
|
97
|
-
- `brown`
|
|
98
|
-
- `forest`
|
|
99
|
-
- `seafoam`
|
|
100
|
-
- `darkGreen`
|
|
101
|
-
- `lightTeal`
|
|
102
|
-
- `teal`
|
|
103
|
-
- `steel`
|
|
104
|
-
- `blue`
|
|
105
|
-
- `royalBlue`
|
|
106
|
-
- `cornflower`
|
|
107
|
-
- `navy`
|
|
108
|
-
- `lavender`
|
|
109
|
-
- `purple`
|
|
110
|
-
- `grape`
|
|
111
|
-
- `lilac`
|
|
112
|
-
- `pink`
|
|
113
|
-
- `magenta`
|
|
114
|
-
- `plum`
|
|
115
|
-
- `beige`
|
|
116
|
-
- `mink`
|
|
117
|
-
- `platinum`
|
|
118
|
-
- `anchor`
|
|
119
|
-
|
|
120
|
-
### Slots no longer supported with an equivalent functionality in v1 Avatar
|
|
121
|
-
|
|
122
|
-
- `photo` => Use `image` slot instead or `imageUrl` prop.
|
|
123
|
-
|
|
124
|
-
### Slots no longer supported without an equivalent functionality in v1 Avatar
|
|
125
|
-
|
|
126
|
-
- `glow` => is not suported in this version of Avatar
|
|
127
|
-
|
|
128
|
-
### New slots
|
|
129
|
-
|
|
130
|
-
- `badge`
|
|
131
|
-
|
|
132
|
-
### Prop differences due to technical differences and limitations
|
|
133
|
-
|
|
134
|
-
- Web uses `image` slot which is part of `react-image` component. They use syntax `image={{ src: './MonaKane.jpg' }}`. If we use similar syntax, our users will need to write `image={{ source: { uri: './MonaKane.jpg' } }} />`. In majority of cases users pass image URL that's why we still have opportunity to pass this parameter using `imageUrl` prop. But there's also a way to pass `image` object similar to Web.
|
|
135
|
-
|
|
136
|
-
### Other Prop differences
|
|
137
|
-
|
|
138
|
-
- `avatarColor` => Web uses `color` prop and omits it from `ComponentProps<AvatarSlots>`. Their users can style font color using CSS but our users can style the component via tokens. If we use the same prop name (color), we'll need to omit it from foregroundTokens and come up with a new name for the font color prop. That's why we use `avatarColor` prop instead of `color`.
|
|
139
|
-
|
|
140
|
-
## Property mapping
|
|
141
|
-
|
|
142
|
-
| `PersonaCoin` | `Avatar` |
|
|
143
|
-
| ------------------ | -------------------- |
|
|
144
|
-
| | `active` |
|
|
145
|
-
| | `activeAppearance` |
|
|
146
|
-
| | `badge` |
|
|
147
|
-
| `coinColorFluent` | `avatarColor` |
|
|
148
|
-
| `icon` | `icon` |
|
|
149
|
-
| | `idForColor` |
|
|
150
|
-
| `imageUrl` | `imageUrl` |
|
|
151
|
-
| `imageDescription` | `accessibilityLabel` |
|
|
152
|
-
| `isOutOfOffice` | |
|
|
153
|
-
| `initials` | `initials` |
|
|
154
|
-
| | `name` |
|
|
155
|
-
| `presence` | |
|
|
156
|
-
| `ring` | |
|
|
157
|
-
| | `shape` |
|
|
158
|
-
| `size` | `size` |
|