@fluentui-react-native/experimental-avatar 0.14.45 → 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.
Files changed (103) hide show
  1. package/CHANGELOG.json +16 -1
  2. package/CHANGELOG.md +10 -2
  3. package/{lib-commonjs/Avatar.d.ts → lib/NativeAvatar.d.ts} +6 -6
  4. package/lib/NativeAvatar.d.ts.map +1 -0
  5. package/lib/{Avatar.js → NativeAvatar.js} +3 -3
  6. package/lib/NativeAvatar.js.map +1 -0
  7. package/lib/index.d.ts +1 -3
  8. package/lib/index.d.ts.map +1 -1
  9. package/lib/index.js +1 -3
  10. package/lib/index.js.map +1 -1
  11. package/{lib/Avatar.d.ts → lib-commonjs/NativeAvatar.d.ts} +6 -6
  12. package/lib-commonjs/NativeAvatar.d.ts.map +1 -0
  13. package/lib-commonjs/{Avatar.js → NativeAvatar.js} +4 -4
  14. package/lib-commonjs/NativeAvatar.js.map +1 -0
  15. package/lib-commonjs/index.d.ts +1 -3
  16. package/lib-commonjs/index.d.ts.map +1 -1
  17. package/lib-commonjs/index.js +1 -3
  18. package/lib-commonjs/index.js.map +1 -1
  19. package/package.json +2 -10
  20. package/src/{Avatar.tsx → NativeAvatar.tsx} +11 -11
  21. package/src/__tests__/Avatar.test.jsx +129 -0
  22. package/src/__tests__/__snapshots__/{JSAvatar.test.jsx.snap → Avatar.test.jsx.snap} +0 -0
  23. package/src/index.ts +1 -3
  24. package/MIGRATION.md +0 -157
  25. package/SPEC.md +0 -295
  26. package/jest.config.js +0 -2
  27. package/lib/Avatar.d.ts.map +0 -1
  28. package/lib/Avatar.js.map +0 -1
  29. package/lib/JSAvatar.d.ts +0 -12
  30. package/lib/JSAvatar.d.ts.map +0 -1
  31. package/lib/JSAvatar.js +0 -84
  32. package/lib/JSAvatar.js.map +0 -1
  33. package/lib/JSAvatar.styling.d.ts +0 -5
  34. package/lib/JSAvatar.styling.d.ts.map +0 -1
  35. package/lib/JSAvatar.styling.js +0 -158
  36. package/lib/JSAvatar.styling.js.map +0 -1
  37. package/lib/JSAvatar.types.d.ts +0 -213
  38. package/lib/JSAvatar.types.d.ts.map +0 -1
  39. package/lib/JSAvatar.types.js +0 -56
  40. package/lib/JSAvatar.types.js.map +0 -1
  41. package/lib/JSAvatarTokens.d.ts +0 -5
  42. package/lib/JSAvatarTokens.d.ts.map +0 -1
  43. package/lib/JSAvatarTokens.js +0 -198
  44. package/lib/JSAvatarTokens.js.map +0 -1
  45. package/lib/JSAvatarTokens.win32.d.ts +0 -5
  46. package/lib/JSAvatarTokens.win32.d.ts.map +0 -1
  47. package/lib/JSAvatarTokens.win32.js +0 -201
  48. package/lib/JSAvatarTokens.win32.js.map +0 -1
  49. package/lib/getHashCode.d.ts +0 -8
  50. package/lib/getHashCode.d.ts.map +0 -1
  51. package/lib/getHashCode.js +0 -16
  52. package/lib/getHashCode.js.map +0 -1
  53. package/lib/titles.d.ts +0 -2
  54. package/lib/titles.d.ts.map +0 -1
  55. package/lib/titles.js +0 -109
  56. package/lib/titles.js.map +0 -1
  57. package/lib/useAvatar.d.ts +0 -33
  58. package/lib/useAvatar.d.ts.map +0 -1
  59. package/lib/useAvatar.js +0 -106
  60. package/lib/useAvatar.js.map +0 -1
  61. package/lib-commonjs/Avatar.d.ts.map +0 -1
  62. package/lib-commonjs/Avatar.js.map +0 -1
  63. package/lib-commonjs/JSAvatar.d.ts +0 -12
  64. package/lib-commonjs/JSAvatar.d.ts.map +0 -1
  65. package/lib-commonjs/JSAvatar.js +0 -88
  66. package/lib-commonjs/JSAvatar.js.map +0 -1
  67. package/lib-commonjs/JSAvatar.styling.d.ts +0 -5
  68. package/lib-commonjs/JSAvatar.styling.d.ts.map +0 -1
  69. package/lib-commonjs/JSAvatar.styling.js +0 -161
  70. package/lib-commonjs/JSAvatar.styling.js.map +0 -1
  71. package/lib-commonjs/JSAvatar.types.d.ts +0 -213
  72. package/lib-commonjs/JSAvatar.types.d.ts.map +0 -1
  73. package/lib-commonjs/JSAvatar.types.js +0 -59
  74. package/lib-commonjs/JSAvatar.types.js.map +0 -1
  75. package/lib-commonjs/JSAvatarTokens.d.ts +0 -5
  76. package/lib-commonjs/JSAvatarTokens.d.ts.map +0 -1
  77. package/lib-commonjs/JSAvatarTokens.js +0 -202
  78. package/lib-commonjs/JSAvatarTokens.js.map +0 -1
  79. package/lib-commonjs/JSAvatarTokens.win32.d.ts +0 -5
  80. package/lib-commonjs/JSAvatarTokens.win32.d.ts.map +0 -1
  81. package/lib-commonjs/JSAvatarTokens.win32.js +0 -205
  82. package/lib-commonjs/JSAvatarTokens.win32.js.map +0 -1
  83. package/lib-commonjs/getHashCode.d.ts +0 -8
  84. package/lib-commonjs/getHashCode.d.ts.map +0 -1
  85. package/lib-commonjs/getHashCode.js +0 -20
  86. package/lib-commonjs/getHashCode.js.map +0 -1
  87. package/lib-commonjs/titles.d.ts +0 -2
  88. package/lib-commonjs/titles.d.ts.map +0 -1
  89. package/lib-commonjs/titles.js +0 -112
  90. package/lib-commonjs/titles.js.map +0 -1
  91. package/lib-commonjs/useAvatar.d.ts +0 -33
  92. package/lib-commonjs/useAvatar.d.ts.map +0 -1
  93. package/lib-commonjs/useAvatar.js +0 -113
  94. package/lib-commonjs/useAvatar.js.map +0 -1
  95. package/src/JSAvatar.styling.ts +0 -201
  96. package/src/JSAvatar.tsx +0 -96
  97. package/src/JSAvatar.types.ts +0 -286
  98. package/src/JSAvatarTokens.ts +0 -201
  99. package/src/JSAvatarTokens.win32.ts +0 -204
  100. package/src/__tests__/JSAvatar.test.jsx +0 -96
  101. package/src/getHashCode.ts +0 -16
  102. package/src/titles.ts +0 -108
  103. package/src/useAvatar.ts +0 -126
package/CHANGELOG.json CHANGED
@@ -2,7 +2,22 @@
2
2
  "name": "@fluentui-react-native/experimental-avatar",
3
3
  "entries": [
4
4
  {
5
- "date": "Tue, 21 Jun 2022 20:05:09 GMT",
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",
6
21
  "tag": "@fluentui-react-native/experimental-avatar_v0.14.45",
7
22
  "version": "0.14.45",
8
23
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,20 @@
1
1
  # Change Log - @fluentui-react-native/experimental-avatar
2
2
 
3
- This log was last generated on Tue, 21 Jun 2022 20:05:09 GMT and should not be manually modified.
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
+
7
15
  ## 0.14.45
8
16
 
9
- Tue, 21 Jun 2022 20:05:09 GMT
17
+ Tue, 21 Jun 2022 20:05:26 GMT
10
18
 
11
19
  ### Patches
12
20
 
@@ -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 AvatarTokens = {
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 AvatarProps = AvatarTokens & {
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 & AvatarProps;
67
- export declare const Avatar: import("@fluentui-react-native/framework").ComposableComponent<AvatarProps, {
66
+ export declare type NativeAvatarViewProps = ViewProps & NativeAvatarProps;
67
+ export declare const NativeAvatar: import("@fluentui-react-native/framework").ComposableComponent<NativeAvatarProps, {
68
68
  root: NativeAvatarViewProps;
69
- }, AvatarTokens, object>;
70
- //# sourceMappingURL=Avatar.d.ts.map
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 = 'Avatar';
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 Avatar = compose({
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=Avatar.js.map
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
@@ -1,4 +1,2 @@
1
- export * from './Avatar';
2
- export * from './JSAvatar';
3
- export * from './JSAvatar.types';
1
+ export * from './NativeAvatar';
4
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
package/lib/index.js CHANGED
@@ -1,4 +1,2 @@
1
- export * from './Avatar';
2
- export * from './JSAvatar';
3
- export * from './JSAvatar.types';
1
+ export * from './NativeAvatar';
4
2
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,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 AvatarTokens = {
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 AvatarProps = AvatarTokens & {
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 & AvatarProps;
67
- export declare const Avatar: import("@fluentui-react-native/framework").ComposableComponent<AvatarProps, {
66
+ export declare type NativeAvatarViewProps = ViewProps & NativeAvatarProps;
67
+ export declare const NativeAvatar: import("@fluentui-react-native/framework").ComposableComponent<NativeAvatarProps, {
68
68
  root: NativeAvatarViewProps;
69
- }, AvatarTokens, object>;
70
- //# sourceMappingURL=Avatar.d.ts.map
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.Avatar = void 0;
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 = 'Avatar';
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.Avatar = (0, framework_1.compose)({
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=Avatar.js.map
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"}
@@ -1,4 +1,2 @@
1
- export * from './Avatar';
2
- export * from './JSAvatar';
3
- export * from './JSAvatar.types';
1
+ export * from './NativeAvatar';
4
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
@@ -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("./Avatar"), exports);
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,2CAAyB;AACzB,6CAA2B;AAC3B,mDAAiC"}
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.14.45",
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 = 'Avatar';
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 AvatarTokens = {
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 AvatarProps = AvatarTokens & {
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 AvatarTokens)[] = ['size', 'avatarStyle'];
97
+ const tokensThatAreAlsoProps: (keyof NativeAvatarTokens)[] = ['size', 'avatarStyle'];
98
98
 
99
- export type NativeAvatarViewProps = ViewProps & AvatarProps;
99
+ export type NativeAvatarViewProps = ViewProps & NativeAvatarProps;
100
100
  interface AvatarType {
101
- props: AvatarProps;
101
+ props: NativeAvatarProps;
102
102
  slotProps: { root: NativeAvatarViewProps };
103
- tokens: AvatarTokens;
103
+ tokens: NativeAvatarTokens;
104
104
  }
105
105
 
106
- export const Avatar = compose<AvatarType>({
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, AvatarTokens>(
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: AvatarProps, useSlots: UseSlots<AvatarType>) => {
129
+ useRender: (props: NativeAvatarProps, useSlots: UseSlots<AvatarType>) => {
130
130
  const Root = useSlots(props).root;
131
131
 
132
- return (rest: AvatarProps) => <Root {...mergeProps(props, rest)} />;
132
+ return (rest: NativeAvatarProps) => <Root {...mergeProps(props, rest)} />;
133
133
  },
134
134
  });
@@ -0,0 +1,129 @@
1
+ import * as React from 'react';
2
+ import { Avatar } from '..';
3
+ import { getInitials } from '../useAvatar';
4
+ import * as renderer from 'react-test-renderer';
5
+
6
+ const alphabeticalTestNames = [
7
+ 'Marie',
8
+ 'Aadi KaPoor',
9
+ 'Marie Beaudouin',
10
+ 'Aadi Meni KaPoor',
11
+ 'Aadi Meni Ka Jr',
12
+ 'Will Little (Teams)',
13
+ 'Will Little-Tanaka',
14
+ '-Aadi Kapoor',
15
+ 'Richard 23 Feynman',
16
+ '* Richard *',
17
+ 'Richard Feynman [Teams]',
18
+ 'Richard Feynman {Teams}',
19
+ ];
20
+ const alphabeticalInitials = ['M', 'AK', 'MB', 'AK', 'AK', 'WL', 'WL', 'AK', 'RF', 'R', 'RF', 'RF'];
21
+ const namesWithTitles = ['Mr Feynman', 'Dr Richard Feynman'];
22
+ const initialsForNameWithTitles = ['F', 'RF'];
23
+
24
+ describe('Avatar rendering', () => {
25
+ it('renders Avatar', () => {
26
+ const tree = renderer.create(<Avatar />).toJSON();
27
+ expect(tree).toMatchSnapshot();
28
+ });
29
+ });
30
+
31
+ describe('getInitials - names with titles', () => {
32
+ it('returns initials without title', () => {
33
+ expect(getInitials('Mr Faynman')).toBe('F');
34
+ });
35
+ it('returns initials for names with multi-word titles', () => {
36
+ expect(getInitials('Consul General Richard Faynman')).toBe('RF');
37
+ expect(getInitials('Major General Victor')).toBe('V');
38
+ });
39
+ });
40
+
41
+ describe('getInitials method - language support', () => {
42
+ it('returns correct initials cyrillic language', () => {
43
+ const test = getInitials('Илон Маск');
44
+ expect(test).toBe('ИМ');
45
+ });
46
+ it('calculates correct initials for non-ASCII characters', () => {
47
+ const test = getInitials('Írissa Þórðardóttir');
48
+ expect(test).toBe('ÍÞ');
49
+ });
50
+ it('returns correct initials for non-ASCII characters', () => {
51
+ const test = getInitials('Øyvind Åsen');
52
+ expect(test).toBe('ØÅ');
53
+ });
54
+ });
55
+
56
+ describe('getInitials method', () => {
57
+ it('returns correct initials', () => {
58
+ const test = getInitials('-Test str with *spaces');
59
+ expect(test).toBe('TS');
60
+ });
61
+ it('returns an empty string if name is undefined', () => {
62
+ expect(getInitials(undefined)).toBe('');
63
+ });
64
+ it('return initials for alphabetical words', () => {
65
+ for (let i = 0; i < alphabeticalTestNames.length; i++) {
66
+ expect(getInitials(alphabeticalTestNames[i])).toBe(alphabeticalInitials[i]);
67
+ }
68
+ });
69
+ it('return initials for words with titles', () => {
70
+ for (let i = 0; i < namesWithTitles.length; i++) {
71
+ expect(getInitials(namesWithTitles[i])).toBe(initialsForNameWithTitles[i]);
72
+ }
73
+ });
74
+ it("returns initials when there's a coma", () => {
75
+ expect(getInitials('Second, First')).toEqual('SF');
76
+ });
77
+ // Unit tests from Web
78
+ it('handles null inputs', () => {
79
+ expect(getInitials(null)).toEqual('');
80
+ expect(getInitials(undefined)).toEqual('');
81
+ });
82
+ it('calculates an expected initials in LTR with a hypen', () => {
83
+ expect(getInitials('David Zearing-Goff')).toEqual('DZ');
84
+ });
85
+ it('calculates an expected initials in LTR with numbers', () => {
86
+ expect(getInitials('4lex 5loo')).toEqual('LL');
87
+ });
88
+ it('calculates an expected initials in LTR with multiple parentheses, extra spaces, and unwanted characters', () => {
89
+ const result = getInitials(' !@#$%^&*()=+ (Alpha) David (The man) `~<>,./?[]{}| Goff (Gamma) ');
90
+ expect(result).toEqual('DG');
91
+ });
92
+ it('calculates an expected initials in LTR with multiple types of unwanted text', () => {
93
+ const result = getInitials(" !@#$%^&*()=+ (Alpha) /David (The man) `~<>,./?[]{}| 'Goff (Gamma) [Beta] ");
94
+ expect(result).toEqual('DG');
95
+ });
96
+ it('calculates an expected initials for Arabic names', () => {
97
+ expect(getInitials('خسرو رحیمی')).toEqual('خ');
98
+ });
99
+ it('calculates an expected initials for Chinese names', () => {
100
+ expect(getInitials('桂英')).toEqual('桂');
101
+ expect(getInitials('佳')).toEqual('佳');
102
+ expect(getInitials('宋智洋')).toEqual('宋');
103
+ });
104
+ it('calculates an expected initials for Korean names', () => {
105
+ expect(getInitials('강현')).toEqual('강');
106
+ expect(getInitials('최종래')).toEqual('최');
107
+ expect(getInitials('남궁 성종')).toEqual('남');
108
+ });
109
+ it('calculates an expected initials for Japanese names', () => {
110
+ expect(getInitials('松田')).toEqual('松');
111
+ expect(getInitials('海野')).toEqual('海');
112
+ expect(getInitials('かり')).toEqual('か');
113
+ });
114
+ it('validates phone numbers', () => {
115
+ expect(getInitials('12345678')).toEqual('');
116
+ // expect(getInitials('+1 (555) 123-4567 ext.4567')).toEqual('');
117
+ expect(getInitials('+47 12 34 56 78 (X 5678)')).toEqual('');
118
+ expect(getInitials('47 12 34')).toEqual('');
119
+ expect(getInitials('47 12')).toEqual('');
120
+
121
+ expect(getInitials('James Ext 2')).toEqual('JE');
122
+ // expect(getInitials('1 Ext 2')).toEqual('');
123
+ // expect(getInitials('1x1')).toEqual('');
124
+ result = getInitials('1');
125
+ expect(result).toEqual('');
126
+ result = getInitials('A 2');
127
+ expect(result).toEqual('A');
128
+ });
129
+ });
package/src/index.ts CHANGED
@@ -1,3 +1 @@
1
- export * from './Avatar';
2
- export * from './JSAvatar';
3
- export * from './JSAvatar.types';
1
+ export * from './NativeAvatar';
package/MIGRATION.md DELETED
@@ -1,157 +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
- - `size`
45
-
46
- ### Tokens no longer supported with an equivalent functionality in Avatar
47
-
48
- - `initialsSize` => Use `fontSize` token instead
49
- - `coinColorFluent` => Use `avatarColor` token instead
50
- - `coinSize` => Use size tokens instead.
51
- - `ring` => Use `ringBackgroundColor`, `ringColor`, `ringThickness` and `ringInnerGap`
52
-
53
- ### Tokens no longer supported without an equivalent functionality in Avatar
54
-
55
- - `iconStrokeWidth` and `iconStrokeColor` => This was for activity ring around the Avatar.
56
- We support ring in `activeAppearance` prop. `borderColor` will be changed using `ringColor` token and `borderWidth` using ringThickness token.
57
- - `horizontalIconAlignment` and `verticalIconAlignment` => these props were responsible for presence badge position.
58
-
59
- ### New tokens
60
-
61
- - Any props that are part of `FontTokens` and `IBorderTokens`.
62
- - `avatarOpacity`
63
- - `badgeSize`
64
- - `circular`
65
- - `iconColor`
66
- - `inactive`
67
- - `square`
68
-
69
- Size tokens:
70
-
71
- - `size20`
72
- - `size24`
73
- - `size28`
74
- - `size32`
75
- - `size36`
76
- - `size40`
77
- - `size48`
78
- - `size56`
79
- - `size64`
80
- - `size72`
81
- - `size96`
82
- - `size120`
83
-
84
- Color tokens:
85
-
86
- - `neutral`
87
- - `brand`
88
- - `darkRed`
89
- - `cranberry`
90
- - `red`
91
- - `pumpkin`
92
- - `peach`
93
- - `marigold`
94
- - `gold`
95
- - `brass`
96
- - `brown`
97
- - `forest`
98
- - `seafoam`
99
- - `darkGreen`
100
- - `lightTeal`
101
- - `teal`
102
- - `steel`
103
- - `blue`
104
- - `royalBlue`
105
- - `cornflower`
106
- - `navy`
107
- - `lavender`
108
- - `purple`
109
- - `grape`
110
- - `lilac`
111
- - `pink`
112
- - `magenta`
113
- - `plum`
114
- - `beige`
115
- - `mink`
116
- - `platinum`
117
- - `anchor`
118
-
119
- ### Slots no longer supported with an equivalent functionality in v1 Avatar
120
-
121
- - `photo` => Use `image` slot instead or `imageUrl` prop.
122
-
123
- ### Slots no longer supported without an equivalent functionality in v1 Avatar
124
-
125
- - `glow` => is not suported in this version of Avatar
126
-
127
- ### New slots
128
-
129
- - `badge`
130
-
131
- ### Prop differences due to technical differences and limitations
132
-
133
- - 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.
134
-
135
- ### Other Prop differences
136
-
137
- - `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`.
138
-
139
- ## Property mapping
140
-
141
- | `PersonaCoin` | `Avatar` |
142
- | ------------------ | -------------------- |
143
- | | `active` |
144
- | | `activeAppearance` |
145
- | | `badge` |
146
- | `coinColorFluent` | `avatarColor` |
147
- | `icon` | `icon` |
148
- | | `idForColor` |
149
- | `imageUrl` | `imageUrl` |
150
- | `imageDescription` | `accessibilityLabel` |
151
- | `isOutOfOffice` | |
152
- | `initials` | `initials` |
153
- | | `name` |
154
- | `presence` | |
155
- | `ring` | |
156
- | | `shape` |
157
- | `size` | `size` |