@fluentui-react-native/experimental-avatar 0.14.45 → 0.15.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.
Files changed (104) hide show
  1. package/CHANGELOG.json +61 -1
  2. package/CHANGELOG.md +26 -2
  3. package/FRNAvatar.podspec +2 -2
  4. package/{lib-commonjs/Avatar.d.ts → lib/NativeAvatar.d.ts} +6 -6
  5. package/lib/NativeAvatar.d.ts.map +1 -0
  6. package/lib/{Avatar.js → NativeAvatar.js} +3 -3
  7. package/lib/NativeAvatar.js.map +1 -0
  8. package/lib/index.d.ts +1 -3
  9. package/lib/index.d.ts.map +1 -1
  10. package/lib/index.js +1 -3
  11. package/lib/index.js.map +1 -1
  12. package/{lib/Avatar.d.ts → lib-commonjs/NativeAvatar.d.ts} +6 -6
  13. package/lib-commonjs/NativeAvatar.d.ts.map +1 -0
  14. package/lib-commonjs/{Avatar.js → NativeAvatar.js} +4 -4
  15. package/lib-commonjs/NativeAvatar.js.map +1 -0
  16. package/lib-commonjs/index.d.ts +1 -3
  17. package/lib-commonjs/index.d.ts.map +1 -1
  18. package/lib-commonjs/index.js +1 -3
  19. package/lib-commonjs/index.js.map +1 -1
  20. package/package.json +2 -10
  21. package/src/{Avatar.tsx → NativeAvatar.tsx} +11 -11
  22. package/src/__tests__/Avatar.test.jsx +129 -0
  23. package/src/__tests__/__snapshots__/{JSAvatar.test.jsx.snap → Avatar.test.jsx.snap} +0 -0
  24. package/src/index.ts +1 -3
  25. package/MIGRATION.md +0 -157
  26. package/SPEC.md +0 -295
  27. package/jest.config.js +0 -2
  28. package/lib/Avatar.d.ts.map +0 -1
  29. package/lib/Avatar.js.map +0 -1
  30. package/lib/JSAvatar.d.ts +0 -12
  31. package/lib/JSAvatar.d.ts.map +0 -1
  32. package/lib/JSAvatar.js +0 -84
  33. package/lib/JSAvatar.js.map +0 -1
  34. package/lib/JSAvatar.styling.d.ts +0 -5
  35. package/lib/JSAvatar.styling.d.ts.map +0 -1
  36. package/lib/JSAvatar.styling.js +0 -158
  37. package/lib/JSAvatar.styling.js.map +0 -1
  38. package/lib/JSAvatar.types.d.ts +0 -213
  39. package/lib/JSAvatar.types.d.ts.map +0 -1
  40. package/lib/JSAvatar.types.js +0 -56
  41. package/lib/JSAvatar.types.js.map +0 -1
  42. package/lib/JSAvatarTokens.d.ts +0 -5
  43. package/lib/JSAvatarTokens.d.ts.map +0 -1
  44. package/lib/JSAvatarTokens.js +0 -198
  45. package/lib/JSAvatarTokens.js.map +0 -1
  46. package/lib/JSAvatarTokens.win32.d.ts +0 -5
  47. package/lib/JSAvatarTokens.win32.d.ts.map +0 -1
  48. package/lib/JSAvatarTokens.win32.js +0 -201
  49. package/lib/JSAvatarTokens.win32.js.map +0 -1
  50. package/lib/getHashCode.d.ts +0 -8
  51. package/lib/getHashCode.d.ts.map +0 -1
  52. package/lib/getHashCode.js +0 -16
  53. package/lib/getHashCode.js.map +0 -1
  54. package/lib/titles.d.ts +0 -2
  55. package/lib/titles.d.ts.map +0 -1
  56. package/lib/titles.js +0 -109
  57. package/lib/titles.js.map +0 -1
  58. package/lib/useAvatar.d.ts +0 -33
  59. package/lib/useAvatar.d.ts.map +0 -1
  60. package/lib/useAvatar.js +0 -106
  61. package/lib/useAvatar.js.map +0 -1
  62. package/lib-commonjs/Avatar.d.ts.map +0 -1
  63. package/lib-commonjs/Avatar.js.map +0 -1
  64. package/lib-commonjs/JSAvatar.d.ts +0 -12
  65. package/lib-commonjs/JSAvatar.d.ts.map +0 -1
  66. package/lib-commonjs/JSAvatar.js +0 -88
  67. package/lib-commonjs/JSAvatar.js.map +0 -1
  68. package/lib-commonjs/JSAvatar.styling.d.ts +0 -5
  69. package/lib-commonjs/JSAvatar.styling.d.ts.map +0 -1
  70. package/lib-commonjs/JSAvatar.styling.js +0 -161
  71. package/lib-commonjs/JSAvatar.styling.js.map +0 -1
  72. package/lib-commonjs/JSAvatar.types.d.ts +0 -213
  73. package/lib-commonjs/JSAvatar.types.d.ts.map +0 -1
  74. package/lib-commonjs/JSAvatar.types.js +0 -59
  75. package/lib-commonjs/JSAvatar.types.js.map +0 -1
  76. package/lib-commonjs/JSAvatarTokens.d.ts +0 -5
  77. package/lib-commonjs/JSAvatarTokens.d.ts.map +0 -1
  78. package/lib-commonjs/JSAvatarTokens.js +0 -202
  79. package/lib-commonjs/JSAvatarTokens.js.map +0 -1
  80. package/lib-commonjs/JSAvatarTokens.win32.d.ts +0 -5
  81. package/lib-commonjs/JSAvatarTokens.win32.d.ts.map +0 -1
  82. package/lib-commonjs/JSAvatarTokens.win32.js +0 -205
  83. package/lib-commonjs/JSAvatarTokens.win32.js.map +0 -1
  84. package/lib-commonjs/getHashCode.d.ts +0 -8
  85. package/lib-commonjs/getHashCode.d.ts.map +0 -1
  86. package/lib-commonjs/getHashCode.js +0 -20
  87. package/lib-commonjs/getHashCode.js.map +0 -1
  88. package/lib-commonjs/titles.d.ts +0 -2
  89. package/lib-commonjs/titles.d.ts.map +0 -1
  90. package/lib-commonjs/titles.js +0 -112
  91. package/lib-commonjs/titles.js.map +0 -1
  92. package/lib-commonjs/useAvatar.d.ts +0 -33
  93. package/lib-commonjs/useAvatar.d.ts.map +0 -1
  94. package/lib-commonjs/useAvatar.js +0 -113
  95. package/lib-commonjs/useAvatar.js.map +0 -1
  96. package/src/JSAvatar.styling.ts +0 -201
  97. package/src/JSAvatar.tsx +0 -96
  98. package/src/JSAvatar.types.ts +0 -286
  99. package/src/JSAvatarTokens.ts +0 -201
  100. package/src/JSAvatarTokens.win32.ts +0 -204
  101. package/src/__tests__/JSAvatar.test.jsx +0 -96
  102. package/src/getHashCode.ts +0 -16
  103. package/src/titles.ts +0 -108
  104. package/src/useAvatar.ts +0 -126
@@ -1,5 +0,0 @@
1
- import { Theme } from '@fluentui-react-native/framework';
2
- import { TokenSettings } from '@fluentui-react-native/use-styling';
3
- import { JSAvatarTokens } from '.';
4
- export declare const defaultJSAvatarTokens: TokenSettings<JSAvatarTokens, Theme>;
5
- //# sourceMappingURL=JSAvatarTokens.win32.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"JSAvatarTokens.win32.d.ts","sourceRoot":"","sources":["../src/JSAvatarTokens.win32.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,CAAC;AAGnC,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,cAAc,EAAE,KAAK,CAkKjD,CAAC"}
@@ -1,201 +0,0 @@
1
- import { globalTokens } from '@fluentui-react-native/theme-tokens';
2
- export var defaultJSAvatarTokens = function (t) {
3
- return ({
4
- badgeSize: 'smallest',
5
- color: t.colors.neutralForeground3,
6
- backgroundColor: t.colors.neutralBackground6,
7
- avatarOpacity: 1,
8
- fontFamily: t.typography.families.primary,
9
- fontWeight: globalTokens.font.weight.semibold,
10
- fontSize: globalTokens.font.size[200],
11
- size: 24,
12
- iconSize: 16,
13
- iconColor: t.colors.neutralForeground3,
14
- ringColor: t.colors.transparentStroke,
15
- borderColor: globalTokens.color.white,
16
- borderWidth: t.name === 'HighContrast' ? 1 : 0,
17
- circular: {
18
- borderRadius: globalTokens.corner.radius.circle,
19
- },
20
- square: {
21
- borderRadius: globalTokens.corner.radius.medium,
22
- },
23
- inactive: {
24
- avatarOpacity: 0.8,
25
- },
26
- size20: {
27
- size: 20,
28
- badgeSize: 'smallest',
29
- iconSize: 16,
30
- fontSize: globalTokens.font.size[100],
31
- square: {
32
- borderRadius: globalTokens.corner.radius.small,
33
- },
34
- },
35
- size24: {
36
- size: 24,
37
- badgeSize: 'smallest',
38
- iconSize: 16,
39
- fontSize: globalTokens.font.size[100],
40
- square: {
41
- borderRadius: globalTokens.corner.radius.small,
42
- },
43
- },
44
- size28: {
45
- size: 28,
46
- badgeSize: 'smaller',
47
- iconSize: 20,
48
- fontWeight: globalTokens.font.weight.semibold,
49
- fontSize: globalTokens.font.size[100],
50
- },
51
- size32: {
52
- size: 32,
53
- badgeSize: 'smaller',
54
- iconSize: 20,
55
- fontSize: globalTokens.font.size[100],
56
- },
57
- size36: {
58
- size: 36,
59
- badgeSize: 'smaller',
60
- iconSize: 20,
61
- },
62
- size40: {
63
- size: 40,
64
- badgeSize: 'small',
65
- iconSize: 20,
66
- },
67
- size48: {
68
- size: 48,
69
- badgeSize: 'small',
70
- iconSize: 24,
71
- },
72
- size56: {
73
- size: 56,
74
- badgeSize: 'medium',
75
- iconSize: 28,
76
- fontSize: globalTokens.font.size[400],
77
- square: {
78
- borderRadius: globalTokens.corner.radius.large,
79
- },
80
- },
81
- size64: {
82
- size: 64,
83
- badgeSize: 'large',
84
- iconSize: 32,
85
- fontSize: globalTokens.font.size[500],
86
- square: {
87
- borderRadius: globalTokens.corner.radius.large,
88
- },
89
- },
90
- size72: {
91
- size: 72,
92
- badgeSize: 'large',
93
- iconSize: 32,
94
- fontSize: globalTokens.font.size[500],
95
- square: {
96
- borderRadius: globalTokens.corner.radius.large,
97
- },
98
- },
99
- size96: {
100
- size: 96,
101
- badgeSize: 'largest',
102
- iconSize: 48,
103
- fontWeight: globalTokens.font.weight.regular,
104
- fontSize: globalTokens.font.size[700],
105
- square: {
106
- borderRadius: globalTokens.corner.radius.extraLarge,
107
- },
108
- },
109
- size120: {
110
- size: 120,
111
- badgeSize: 'largest',
112
- iconSize: 48,
113
- fontWeight: globalTokens.font.weight.regular,
114
- fontSize: globalTokens.font.size[900],
115
- square: {
116
- borderRadius: globalTokens.corner.radius.extraLarge,
117
- },
118
- },
119
- neutral: {
120
- backgroundColor: t.colors.neutralBackground6,
121
- color: t.colors.neutralForeground3,
122
- iconColor: t.colors.neutralForeground3,
123
- ringColor: t.colors.transparentStroke,
124
- },
125
- brand: {
126
- backgroundColor: t.colors.brandBackgroundStatic,
127
- color: t.colors.neutralForegroundOnBrand,
128
- iconColor: t.colors.neutralForegroundOnBrand,
129
- ringColor: t.colors.transparentStroke,
130
- },
131
- darkRed: getColorProps('darkRed', t),
132
- cranberry: getColorProps('cranberry', t),
133
- red: getColorProps('red', t),
134
- pumpkin: getColorProps('pumpkin', t),
135
- peach: getColorProps('peach', t),
136
- marigold: getColorProps('marigold', t),
137
- gold: getColorProps('gold', t),
138
- brass: getColorProps('brass', t),
139
- brown: getColorProps('brown', t),
140
- forest: getColorProps('forest', t),
141
- seafoam: getColorProps('seafoam', t),
142
- darkGreen: getColorProps('darkGreen', t),
143
- lightTeal: getColorProps('lightTeal', t),
144
- teal: getColorProps('teal', t),
145
- steel: getColorProps('steel', t),
146
- blue: getColorProps('blue', t),
147
- royalBlue: getColorProps('royalBlue', t),
148
- cornflower: getColorProps('cornflower', t),
149
- navy: getColorProps('navy', t),
150
- lavender: getColorProps('lavender', t),
151
- purple: getColorProps('purple', t),
152
- grape: getColorProps('grape', t),
153
- lilac: getColorProps('lilac', t),
154
- pink: getColorProps('pink', t),
155
- magenta: getColorProps('magenta', t),
156
- plum: getColorProps('plum', t),
157
- beige: getColorProps('beige', t),
158
- mink: getColorProps('mink', t),
159
- platinum: getColorProps('platinum', t),
160
- anchor: getColorProps('anchor', t),
161
- burgundy: getColorProps('burgundy', t),
162
- hotPink: getColorProps('hotPink', t),
163
- orchid: getColorProps('orchid', t),
164
- });
165
- };
166
- /**
167
- * A function which returns object of props depending on color and theme.
168
- * @param color
169
- * @param theme
170
- * @returns object of props - backgroundColor, color and ringColor
171
- */
172
- function getColorProps(color, theme) {
173
- var themeAppearance = theme.name;
174
- switch (themeAppearance) {
175
- case 'White':
176
- case 'Colorful':
177
- default:
178
- return {
179
- backgroundColor: globalTokens.color[color].tint40,
180
- color: globalTokens.color[color].shade30,
181
- iconColor: globalTokens.color[color].shade30,
182
- ringColor: globalTokens.color[color].primary,
183
- };
184
- case 'DarkGray':
185
- case 'Black':
186
- return {
187
- backgroundColor: globalTokens.color[color].shade30,
188
- color: globalTokens.color[color].tint40,
189
- iconColor: globalTokens.color[color].tint40,
190
- ringColor: globalTokens.color[color].tint30,
191
- };
192
- case 'HighContrast':
193
- return {
194
- backgroundColor: theme.colors.neutralBackground6,
195
- color: theme.colors.neutralForeground3,
196
- iconColor: theme.colors.neutralForeground3,
197
- ringColor: theme.colors.transparentStroke,
198
- };
199
- }
200
- }
201
- //# sourceMappingURL=JSAvatarTokens.win32.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"JSAvatarTokens.win32.js","sourceRoot":"","sources":["../src/JSAvatarTokens.win32.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAEnE,MAAM,CAAC,IAAM,qBAAqB,GAAyC,UAAC,CAAQ;IAClF,OAAA,CAAC;QACC,SAAS,EAAE,UAAU;QACrB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,kBAAkB;QAClC,eAAe,EAAE,CAAC,CAAC,MAAM,CAAC,kBAAkB;QAC5C,aAAa,EAAE,CAAC;QAChB,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO;QACzC,UAAU,EAAE,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ;QAC7C,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;QACrC,IAAI,EAAE,EAAE;QACR,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,kBAAkB;QACtC,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,iBAAiB;QACrC,WAAW,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK;QACrC,WAAW,EAAE,CAAC,CAAC,IAAI,KAAK,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9C,QAAQ,EAAE;YACR,YAAY,EAAE,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM;SAChD;QACD,MAAM,EAAE;YACN,YAAY,EAAE,YAAY,CAAC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AE,KAAY;IAChD,IAAM,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC;IACnC,QAAQ,eAAe,EAAE;QACvB,KAAK,OAAO,CAAC;QACb,KAAK,UAAU,CAAC;QAChB;YACE,OAAO;gBACL,eAAe,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM;gBACjD,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,OAAO;gBACxC,SAAS,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,OAAO;gBAC5C,SAAS,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,OAAO;aAC7C,CAAC;QACJ,KAAK,UAAU,CAAC;QAChB,KAAK,OAAO;YACV,OAAO;gBACL,eAAe,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,OAAO;gBAClD,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM;gBACvC,SAAS,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM;gBAC3C,SAAS,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM;aAC5C,CAAC;QACJ,KAAK,cAAc;YACjB,OAAO;gBACL,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,kBAAkB;gBAChD,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,kBAAkB;gBACtC,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,kBAAkB;gBAC1C,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,iBAAiB;aAC1C,CAAC;KACL;AACH,CAAC"}
@@ -1,8 +0,0 @@
1
- /**
2
- * A function which returns hash code for the avatar color. Web implementation
3
- *
4
- * @param str is idForColor or name
5
- * @returns hash code of the color
6
- */
7
- export declare const getHashCodeWeb: (str: string) => number;
8
- //# sourceMappingURL=getHashCode.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getHashCode.d.ts","sourceRoot":"","sources":["../src/getHashCode.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,cAAc,QAAS,MAAM,KAAG,MAS5C,CAAC"}
@@ -1,16 +0,0 @@
1
- /**
2
- * A function which returns hash code for the avatar color. Web implementation
3
- *
4
- * @param str is idForColor or name
5
- * @returns hash code of the color
6
- */
7
- export var getHashCodeWeb = function (str) {
8
- var hashCode = 0;
9
- for (var len = str.length - 1; len >= 0; len--) {
10
- var ch = str.charCodeAt(len);
11
- var shift = len % 8;
12
- hashCode ^= (ch << shift) + (ch >> (8 - shift)); // eslint-disable-line no-bitwise
13
- }
14
- return hashCode;
15
- };
16
- //# sourceMappingURL=getHashCode.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getHashCode.js","sourceRoot":"","sources":["../src/getHashCode.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,IAAM,cAAc,GAAG,UAAC,GAAW;IACxC,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,KAAK,IAAI,GAAG,GAAW,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,GAAG,EAAE,EAAE;QACtD,IAAM,EAAE,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QAC/B,IAAM,KAAK,GAAG,GAAG,GAAG,CAAC,CAAC;QACtB,QAAQ,IAAI,CAAC,EAAE,IAAI,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,iCAAiC;KACnF;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC"}
package/lib/titles.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const titles: Set<string>;
2
- //# sourceMappingURL=titles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"titles.d.ts","sourceRoot":"","sources":["../src/titles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,aA2GjB,CAAC"}
package/lib/titles.js DELETED
@@ -1,109 +0,0 @@
1
- export var titles = new Set([
2
- 'Mr',
3
- 'Mrs',
4
- 'Miss',
5
- 'Ms',
6
- 'Dr',
7
- 'Admiral',
8
- 'Air Comm',
9
- 'Ambassador',
10
- 'Baron',
11
- 'Baroness',
12
- 'Brig & Mrs',
13
- 'Brig Gen',
14
- 'Brigadier',
15
- 'Brother',
16
- 'Canon',
17
- 'Capt',
18
- 'Chief',
19
- 'Cllr',
20
- 'Col',
21
- 'Commander',
22
- 'Commander & Mrs',
23
- 'Consul',
24
- 'Consul General',
25
- 'Count',
26
- 'Countess',
27
- 'Countess of',
28
- 'Cpl',
29
- 'Dame',
30
- 'Deputy',
31
- 'Dr & Mrs',
32
- 'Drs',
33
- 'Duchess',
34
- 'Duke',
35
- 'Earl',
36
- 'Father',
37
- 'General',
38
- 'Gräfin',
39
- 'HE',
40
- 'HMA',
41
- 'Her Grace',
42
- 'His Excellency',
43
- 'Jr',
44
- 'Judge',
45
- 'Justice',
46
- 'Lady',
47
- 'Lic',
48
- 'Llc',
49
- 'Lord',
50
- 'Lord & Lady',
51
- 'Lt',
52
- 'Lt Col',
53
- 'Lt Cpl',
54
- 'M',
55
- 'Madam',
56
- 'Madame',
57
- 'Major',
58
- 'Major General',
59
- 'Marchioness',
60
- 'Marquis',
61
- 'Minister',
62
- 'Mme',
63
- 'Mr & Dr',
64
- 'Mr & Mrs',
65
- 'Mr & Ms',
66
- 'Prince',
67
- 'Princess',
68
- 'Professor',
69
- 'Prof',
70
- 'Prof & Dr',
71
- 'Prof & Mrs',
72
- 'Prof & Rev',
73
- 'Prof Dame',
74
- 'Prof Dr',
75
- 'Pvt',
76
- 'Rabbi',
77
- 'Rear Admiral',
78
- 'Rev',
79
- 'Rev & Mrs',
80
- 'Rev Canon',
81
- 'Rev Dr',
82
- 'Senator',
83
- 'Sgt',
84
- 'Sheriff',
85
- 'Sir',
86
- 'Sir & Lady',
87
- 'Sister',
88
- 'Sr',
89
- 'Sqr. Leader',
90
- 'The Earl of',
91
- 'The Hon',
92
- 'The Hon Dr',
93
- 'The Hon Lady',
94
- 'The Hon Lord',
95
- 'The Hon Mrs',
96
- 'The Hon Sir',
97
- 'The Honourable',
98
- 'The Rt Hon',
99
- 'The Rt Hon Dr',
100
- 'The Rt Hon Lord',
101
- 'The Rt Hon Sir',
102
- 'The Rt Hon Visc',
103
- 'Viscount',
104
- 'van',
105
- 'I',
106
- 'II',
107
- 'III',
108
- ]);
109
- //# sourceMappingURL=titles.js.map
package/lib/titles.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"titles.js","sourceRoot":"","sources":["../src/titles.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,MAAM,GAAG,IAAI,GAAG,CAAS;IACpC,IAAI;IACJ,KAAK;IACL,MAAM;IACN,IAAI;IACJ,IAAI;IACJ,SAAS;IACT,UAAU;IACV,YAAY;IACZ,OAAO;IACP,UAAU;IACV,YAAY;IACZ,UAAU;IACV,WAAW;IACX,SAAS;IACT,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,KAAK;IACL,WAAW;IACX,iBAAiB;IACjB,QAAQ;IACR,gBAAgB;IAChB,OAAO;IACP,UAAU;IACV,aAAa;IACb,KAAK;IACL,MAAM;IACN,QAAQ;IACR,UAAU;IACV,KAAK;IACL,SAAS;IACT,MAAM;IACN,MAAM;IACN,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,IAAI;IACJ,KAAK;IACL,WAAW;IACX,gBAAgB;IAChB,IAAI;IACJ,OAAO;IACP,SAAS;IACT,MAAM;IACN,KAAK;IACL,KAAK;IACL,MAAM;IACN,aAAa;IACb,IAAI;IACJ,QAAQ;IACR,QAAQ;IACR,GAAG;IACH,OAAO;IACP,QAAQ;IACR,OAAO;IACP,eAAe;IACf,aAAa;IACb,SAAS;IACT,UAAU;IACV,KAAK;IACL,SAAS;IACT,UAAU;IACV,SAAS;IACT,QAAQ;IACR,UAAU;IACV,WAAW;IACX,MAAM;IACN,WAAW;IACX,YAAY;IACZ,YAAY;IACZ,WAAW;IACX,SAAS;IACT,KAAK;IACL,OAAO;IACP,cAAc;IACd,KAAK;IACL,WAAW;IACX,WAAW;IACX,QAAQ;IACR,SAAS;IACT,KAAK;IACL,SAAS;IACT,KAAK;IACL,YAAY;IACZ,QAAQ;IACR,IAAI;IACJ,aAAa;IACb,aAAa;IACb,SAAS;IACT,YAAY;IACZ,cAAc;IACd,cAAc;IACd,aAAa;IACb,aAAa;IACb,gBAAgB;IAChB,YAAY;IACZ,eAAe;IACf,iBAAiB;IACjB,gBAAgB;IAChB,iBAAiB;IACjB,UAAU;IACV,KAAK;IACL,GAAG;IACH,IAAI;IACJ,KAAK;CACN,CAAC,CAAC"}
@@ -1,33 +0,0 @@
1
- import { JSAvatarProps, AvatarInfo } from './JSAvatar.types';
2
- /**
3
- * Re-usable hook for FURN Avatar.
4
- * This hook configures Avatar props and state for FURN Avatar.
5
- *
6
- * @param props user props sent to FURN Avatar
7
- * @returns configured props and state for FURN Avatar
8
- */
9
- export declare const useAvatar: (props: JSAvatarProps) => AvatarInfo;
10
- /**
11
- * A function which takes a name and returns initials
12
- *
13
- * @param name
14
- * @returns initials. First letter of the word if only one word was provided.
15
- * First letters of the first and last words if more words were provided.
16
- * Words in braces, titles, special characters, parantheses and dashes should be ignored.
17
- */
18
- export declare const getInitials: (name: string) => string;
19
- /**
20
- * A function which takes a name and returns array of valid words
21
- *
22
- * @param name
23
- * @returns array of words without phone numbers and special characters.
24
- */
25
- export declare const removeRedundantCharacters: (name: string) => string[];
26
- /**
27
- * A function which verifies whether words array contains title
28
- *
29
- * @param words array of words in name
30
- * @returns array of words without titles
31
- */
32
- export declare const removeTitlesFromName: (words: string[]) => string[];
33
- //# sourceMappingURL=useAvatar.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAvatar.d.ts","sourceRoot":"","sources":["../src/useAvatar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAA+B,MAAM,kBAAkB,CAAC;AAK1F;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,UAAW,aAAa,KAAG,UAwDhD,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,SAAU,MAAM,KAAG,MAe1C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,SAAU,MAAM,KAAG,MAAM,EAc9D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,UAAW,MAAM,EAAE,KAAG,MAAM,EAE5D,CAAC"}
package/lib/useAvatar.js DELETED
@@ -1,106 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
- import { AvatarColors } from './JSAvatar.types';
24
- import { titles } from './titles';
25
- import { getHashCodeWeb } from './getHashCode';
26
- import { createIconProps } from '@fluentui-react-native/interactive-hooks';
27
- /**
28
- * Re-usable hook for FURN Avatar.
29
- * This hook configures Avatar props and state for FURN Avatar.
30
- *
31
- * @param props user props sent to FURN Avatar
32
- * @returns configured props and state for FURN Avatar
33
- */
34
- export var useAvatar = function (props) {
35
- var _a;
36
- var avatarColor = props.avatarColor, active = props.active, accessibilityLabel = props.accessibilityLabel, accessibilityRole = props.accessibilityRole, activeAppearance = props.activeAppearance, badge = props.badge, idForColor = props.idForColor, initials = props.initials, name = props.name, shape = props.shape, transparentRing = props.transparentRing, icon = props.icon, rest = __rest(props, ["avatarColor", "active", "accessibilityLabel", "accessibilityRole", "activeAppearance", "badge", "idForColor", "initials", "name", "shape", "transparentRing", "icon"]);
37
- var showRing = active === 'active' && activeAppearance === 'ring';
38
- var showBadge = (!active || active === 'unset') && !!badge && !!badge.status;
39
- var accessibilityText = "".concat(name || '').concat(showBadge ? ", ".concat(badge.status) : '');
40
- var badgeProps = __assign({ size: 'small' }, badge);
41
- var state = {
42
- showRing: showRing,
43
- transparentRing: !!transparentRing,
44
- showBadge: showBadge,
45
- };
46
- var _initials = initials || getInitials(name);
47
- var avatarColorsIdx = getHashCodeWeb((_a = idForColor !== null && idForColor !== void 0 ? idForColor : name) !== null && _a !== void 0 ? _a : '') % AvatarColors.length;
48
- var _avatarColor = avatarColor === 'colorful' ? AvatarColors[avatarColorsIdx] : avatarColor;
49
- var iconProps = createIconProps(icon);
50
- return {
51
- props: __assign(__assign({ accessible: true, accessibilityLabel: accessibilityLabel || accessibilityText, accessibilityRole: accessibilityRole !== null && accessibilityRole !== void 0 ? accessibilityRole : 'image', avatarColor: _avatarColor, shape: shape || 'circular' }, rest), { active: active, activeAppearance: activeAppearance, badge: badgeProps, initials: _initials, icon: iconProps }),
52
- state: __assign({}, state),
53
- };
54
- };
55
- /**
56
- * A function which takes a name and returns initials
57
- *
58
- * @param name
59
- * @returns initials. First letter of the word if only one word was provided.
60
- * First letters of the first and last words if more words were provided.
61
- * Words in braces, titles, special characters, parantheses and dashes should be ignored.
62
- */
63
- export var getInitials = function (name) {
64
- if (!name) {
65
- return '';
66
- }
67
- var ARABIC_ASIAN_REGEXP = new RegExp('[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\u1100-\u11FF\u3130-\u318F\uA960-\uA97F\uAC00-\uD7AF\uD7B0-\uD7FF\u3040-\u309F\u30A0-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFAFF\uD840-\uD869]', 'g');
68
- var words = removeRedundantCharacters(name);
69
- var wordsLength = words.length;
70
- var lastWordIdx = wordsLength - 1;
71
- var firstLetter = words[0].charAt(0).toUpperCase();
72
- var lastLetter = wordsLength > 1 ? words[lastWordIdx].charAt(0).toUpperCase() : '';
73
- var initials = "".concat(firstLetter).concat(ARABIC_ASIAN_REGEXP.test(name) ? '' : lastLetter);
74
- return initials;
75
- };
76
- /**
77
- * A function which takes a name and returns array of valid words
78
- *
79
- * @param name
80
- * @returns array of words without phone numbers and special characters.
81
- */
82
- export var removeRedundantCharacters = function (name) {
83
- if (!name) {
84
- return [];
85
- }
86
- var WORDS_IN_BRACES_REGEXP = new RegExp('[(\\[\\{][^\\)\\]\\}]*[\\)\\]\\}]', 'g');
87
- var PHONE_NUMBER_REGEXP = new RegExp('(\\+|(\\d|\\s))', 'g');
88
- var SPECIAL_CHARACTERS_REGEXP = new RegExp('[!"#\'$%&*+,-./:;>=<?@^_`|~¡¢£¤¥¦§¨©ª«¬®ˉ°±²¼½¾¿×÷]', 'g');
89
- var words = name
90
- .replace(WORDS_IN_BRACES_REGEXP, '')
91
- .replace(PHONE_NUMBER_REGEXP, ' ')
92
- .replace(SPECIAL_CHARACTERS_REGEXP, '')
93
- .trim()
94
- .split(' ');
95
- return removeTitlesFromName(words);
96
- };
97
- /**
98
- * A function which verifies whether words array contains title
99
- *
100
- * @param words array of words in name
101
- * @returns array of words without titles
102
- */
103
- export var removeTitlesFromName = function (words) {
104
- return words.filter(function (word) { return !titles.has(word); });
105
- };
106
- //# sourceMappingURL=useAvatar.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAvatar.js","sourceRoot":"","sources":["../src/useAvatar.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAA4C,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAE1F,OAAO,EAAE,MAA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"}
@@ -1,12 +0,0 @@
1
- import { JSAvatarProps, JSAvatarState, AvatarSlotProps } from './JSAvatar.types';
2
- /**
3
- * A function which determines if a set of styles should be applied to the compoent given the current state and props of the avatar.
4
- *
5
- * @param layer The name of the state that is being checked for
6
- * @param state The current state of the avatar
7
- * @param userProps The props that were passed into the avatar
8
- * @returns Whether the styles that are assigned to the layer should be applied to the avatar
9
- */
10
- export declare const avatarLookup: (layer: string, state: JSAvatarState, userProps: JSAvatarProps) => boolean;
11
- export declare const JSAvatar: import("@fluentui-react-native/framework").ComposableComponent<JSAvatarProps, AvatarSlotProps, import("./JSAvatar.types").JSAvatarTokens, object>;
12
- //# sourceMappingURL=JSAvatar.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"JSAvatar.d.ts","sourceRoot":"","sources":["../src/JSAvatar.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAA8B,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAS7G;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,UAAW,MAAM,SAAS,aAAa,aAAa,aAAa,KAAG,OAY5F,CAAC;AAEF,eAAO,MAAM,QAAQ,mJA8BnB,CAAC"}
@@ -1,88 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __rest = (this && this.__rest) || function (s, e) {
14
- var t = {};
15
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
- t[p] = s[p];
17
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
- t[p[i]] = s[p[i]];
21
- }
22
- return t;
23
- };
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.JSAvatar = exports.avatarLookup = void 0;
26
- /** @jsx withSlots */
27
- var react_native_1 = require("react-native");
28
- var react_1 = require("react");
29
- var JSAvatar_types_1 = require("./JSAvatar.types");
30
- var JSAvatar_styling_1 = require("./JSAvatar.styling");
31
- var framework_1 = require("@fluentui-react-native/framework");
32
- var useAvatar_1 = require("./useAvatar");
33
- var badge_1 = require("@fluentui-react-native/badge");
34
- var icon_1 = require("@fluentui-react-native/icon");
35
- var react_native_svg_1 = require("react-native-svg");
36
- /**
37
- * A function which determines if a set of styles should be applied to the compoent given the current state and props of the avatar.
38
- *
39
- * @param layer The name of the state that is being checked for
40
- * @param state The current state of the avatar
41
- * @param userProps The props that were passed into the avatar
42
- * @returns Whether the styles that are assigned to the layer should be applied to the avatar
43
- */
44
- var avatarLookup = function (layer, state, userProps) {
45
- var size = userProps.size;
46
- var avatarSize = size ? "size".concat(size) : '';
47
- return (state[layer] ||
48
- userProps[layer] ||
49
- layer === userProps['shape'] ||
50
- (!userProps['shape'] && layer === 'circular') ||
51
- layer === userProps['avatarColor'] ||
52
- layer === avatarSize ||
53
- (userProps.active === 'inactive' && layer === 'inactive'));
54
- };
55
- exports.avatarLookup = avatarLookup;
56
- exports.JSAvatar = (0, framework_1.compose)(__assign(__assign({ displayName: JSAvatar_types_1.JSAvatarName }, JSAvatar_styling_1.stylingSettings), { slots: {
57
- root: react_native_1.View,
58
- image: react_native_1.Image,
59
- initials: react_native_1.Text,
60
- initialsBackground: react_native_1.View,
61
- icon: icon_1.Icon,
62
- ring: react_native_1.View,
63
- badge: badge_1.PresenceBadge,
64
- }, useRender: function (userProps, useSlots) {
65
- var avatar = (0, useAvatar_1.useAvatar)(userProps);
66
- var Slots = useSlots(avatar.props, function (layer) { return (0, exports.avatarLookup)(layer, avatar.state, avatar.props); });
67
- return function (final) {
68
- var _a = avatar.state, showRing = _a.showRing, transparentRing = _a.transparentRing, showBadge = _a.showBadge;
69
- var _b = avatar.props, badge = _b.badge, mergedProps = __rest(_b, ["badge"]);
70
- var svgIconsEnabled = ['ios', 'macos', 'win32', 'android'].includes(react_native_1.Platform.OS);
71
- var RingComponent = showRing && !transparentRing ? Slots.ring : react_1.Fragment;
72
- return ((0, framework_1.withSlots)(Slots.root, __assign({}, mergedProps),
73
- (0, framework_1.withSlots)(RingComponent, null, renderAvatar(final, avatar.props, Slots, svgIconsEnabled)),
74
- svgIconsEnabled && showBadge && (0, framework_1.withSlots)(Slots.badge, __assign({}, badge))));
75
- };
76
- } }));
77
- function renderAvatar(final, avatarProps, Slots, svgIconsEnabled) {
78
- var _a = (0, framework_1.mergeProps)(avatarProps, final), icon = _a.icon, initials = _a.initials, imageUrl = _a.imageUrl;
79
- return imageUrl ? ((0, framework_1.withSlots)(Slots.image, { source: { uri: imageUrl } })) : ((0, framework_1.withSlots)(Slots.initialsBackground, { accessible: false }, initials ? ((0, framework_1.withSlots)(Slots.initials, { accessible: false }, initials)) : avatarProps.icon ? ((0, framework_1.withSlots)(Slots.icon, __assign({}, icon, { accessible: false }))) : (svgIconsEnabled && (0, framework_1.withSlots)(Slots.icon, { svgSource: svgProps, accessible: false }))));
80
- }
81
- var fallbackIconSvg = function () {
82
- return ((0, framework_1.withSlots)(react_native_svg_1.Svg, { viewBox: "0 0 14 16" },
83
- (0, framework_1.withSlots)(react_native_svg_1.Path, { fill: "currentColor", 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" })));
84
- };
85
- var svgProps = {
86
- src: fallbackIconSvg,
87
- };
88
- //# sourceMappingURL=JSAvatar.js.map