@fluentui/react-avatar 9.0.0-rc.1 → 9.0.0-rc.12

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 (117) hide show
  1. package/CHANGELOG.json +595 -1
  2. package/CHANGELOG.md +282 -125
  3. package/MIGRATION.md +71 -66
  4. package/SPEC-AvatarGroup.md +185 -0
  5. package/SPEC.md +160 -135
  6. package/dist/index.d.ts +284 -0
  7. package/{lib → dist}/tsdoc-metadata.json +0 -0
  8. package/lib/Avatar.js.map +1 -1
  9. package/lib/AvatarGroup.js +2 -0
  10. package/lib/AvatarGroup.js.map +1 -0
  11. package/lib/AvatarGroupItem.js +2 -0
  12. package/lib/AvatarGroupItem.js.map +1 -0
  13. package/lib/components/Avatar/Avatar.js.map +1 -1
  14. package/lib/components/Avatar/Avatar.types.js.map +1 -1
  15. package/lib/components/Avatar/index.js.map +1 -1
  16. package/lib/components/Avatar/renderAvatar.js.map +1 -1
  17. package/lib/components/Avatar/useAvatar.js +21 -10
  18. package/lib/components/Avatar/useAvatar.js.map +1 -1
  19. package/lib/components/Avatar/useAvatarStyles.js +31 -16
  20. package/lib/components/Avatar/useAvatarStyles.js.map +1 -1
  21. package/lib/components/AvatarGroup/AvatarGroup.js +15 -0
  22. package/lib/components/AvatarGroup/AvatarGroup.js.map +1 -0
  23. package/lib/components/AvatarGroup/AvatarGroup.strings.js +4 -0
  24. package/lib/components/AvatarGroup/AvatarGroup.strings.js.map +1 -0
  25. package/lib/components/AvatarGroup/AvatarGroup.types.js +2 -0
  26. package/lib/components/AvatarGroup/AvatarGroup.types.js.map +1 -0
  27. package/lib/components/AvatarGroup/index.js +6 -0
  28. package/lib/components/AvatarGroup/index.js.map +1 -0
  29. package/lib/components/AvatarGroup/renderAvatarGroup.js +16 -0
  30. package/lib/components/AvatarGroup/renderAvatarGroup.js.map +1 -0
  31. package/lib/components/AvatarGroup/useAvatarGroup.js +51 -0
  32. package/lib/components/AvatarGroup/useAvatarGroup.js.map +1 -0
  33. package/lib/components/AvatarGroup/useAvatarGroupStyles.js +37 -0
  34. package/lib/components/AvatarGroup/useAvatarGroupStyles.js.map +1 -0
  35. package/lib/components/AvatarGroupItem/AvatarGroupItem.js +15 -0
  36. package/lib/components/AvatarGroupItem/AvatarGroupItem.js.map +1 -0
  37. package/lib/components/AvatarGroupItem/AvatarGroupItem.types.js +2 -0
  38. package/lib/components/AvatarGroupItem/AvatarGroupItem.types.js.map +1 -0
  39. package/lib/components/AvatarGroupItem/index.js +6 -0
  40. package/lib/components/AvatarGroupItem/index.js.map +1 -0
  41. package/lib/components/AvatarGroupItem/renderAvatarGroupItem.js +16 -0
  42. package/lib/components/AvatarGroupItem/renderAvatarGroupItem.js.map +1 -0
  43. package/lib/components/AvatarGroupItem/useAvatarGroupItem.js +27 -0
  44. package/lib/components/AvatarGroupItem/useAvatarGroupItem.js.map +1 -0
  45. package/lib/components/AvatarGroupItem/useAvatarGroupItemStyles.js +26 -0
  46. package/lib/components/AvatarGroupItem/useAvatarGroupItemStyles.js.map +1 -0
  47. package/lib/index.js +4 -2
  48. package/lib/index.js.map +1 -1
  49. package/lib/utils/getInitials.js +14 -12
  50. package/lib/utils/getInitials.js.map +1 -1
  51. package/lib/utils/index.js.map +1 -1
  52. package/lib-commonjs/Avatar.js.map +1 -1
  53. package/lib-commonjs/AvatarGroup.js +10 -0
  54. package/lib-commonjs/AvatarGroup.js.map +1 -0
  55. package/lib-commonjs/AvatarGroupItem.js +10 -0
  56. package/lib-commonjs/AvatarGroupItem.js.map +1 -0
  57. package/lib-commonjs/components/Avatar/Avatar.js.map +1 -1
  58. package/lib-commonjs/components/Avatar/Avatar.types.js.map +1 -1
  59. package/lib-commonjs/components/Avatar/index.js.map +1 -1
  60. package/lib-commonjs/components/Avatar/renderAvatar.js.map +1 -1
  61. package/lib-commonjs/components/Avatar/useAvatar.js +22 -10
  62. package/lib-commonjs/components/Avatar/useAvatar.js.map +1 -1
  63. package/lib-commonjs/components/Avatar/useAvatarStyles.js +32 -17
  64. package/lib-commonjs/components/Avatar/useAvatarStyles.js.map +1 -1
  65. package/lib-commonjs/components/AvatarGroup/AvatarGroup.js +26 -0
  66. package/lib-commonjs/components/AvatarGroup/AvatarGroup.js.map +1 -0
  67. package/lib-commonjs/components/AvatarGroup/AvatarGroup.strings.js +10 -0
  68. package/lib-commonjs/components/AvatarGroup/AvatarGroup.strings.js.map +1 -0
  69. package/lib-commonjs/components/AvatarGroup/AvatarGroup.types.js +6 -0
  70. package/lib-commonjs/components/AvatarGroup/AvatarGroup.types.js.map +1 -0
  71. package/lib-commonjs/components/AvatarGroup/index.js +18 -0
  72. package/lib-commonjs/components/AvatarGroup/index.js.map +1 -0
  73. package/lib-commonjs/components/AvatarGroup/renderAvatarGroup.js +27 -0
  74. package/lib-commonjs/components/AvatarGroup/renderAvatarGroup.js.map +1 -0
  75. package/lib-commonjs/components/AvatarGroup/useAvatarGroup.js +64 -0
  76. package/lib-commonjs/components/AvatarGroup/useAvatarGroup.js.map +1 -0
  77. package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.js +47 -0
  78. package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.js.map +1 -0
  79. package/lib-commonjs/components/AvatarGroupItem/AvatarGroupItem.js +26 -0
  80. package/lib-commonjs/components/AvatarGroupItem/AvatarGroupItem.js.map +1 -0
  81. package/lib-commonjs/components/AvatarGroupItem/AvatarGroupItem.types.js +6 -0
  82. package/lib-commonjs/components/AvatarGroupItem/AvatarGroupItem.types.js.map +1 -0
  83. package/lib-commonjs/components/AvatarGroupItem/index.js +18 -0
  84. package/lib-commonjs/components/AvatarGroupItem/index.js.map +1 -0
  85. package/lib-commonjs/components/AvatarGroupItem/renderAvatarGroupItem.js +27 -0
  86. package/lib-commonjs/components/AvatarGroupItem/renderAvatarGroupItem.js.map +1 -0
  87. package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItem.js +37 -0
  88. package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItem.js.map +1 -0
  89. package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItemStyles.js +36 -0
  90. package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItemStyles.js.map +1 -0
  91. package/lib-commonjs/index.js +106 -3
  92. package/lib-commonjs/index.js.map +1 -1
  93. package/lib-commonjs/utils/getInitials.js +14 -12
  94. package/lib-commonjs/utils/getInitials.js.map +1 -1
  95. package/lib-commonjs/utils/index.js.map +1 -1
  96. package/package.json +22 -21
  97. package/dist/react-avatar.d.ts +0 -142
  98. package/lib/Avatar.d.ts +0 -1
  99. package/lib/components/Avatar/Avatar.d.ts +0 -3
  100. package/lib/components/Avatar/Avatar.types.d.ts +0 -107
  101. package/lib/components/Avatar/index.d.ts +0 -5
  102. package/lib/components/Avatar/renderAvatar.d.ts +0 -2
  103. package/lib/components/Avatar/useAvatar.d.ts +0 -3
  104. package/lib/components/Avatar/useAvatarStyles.d.ts +0 -3
  105. package/lib/index.d.ts +0 -2
  106. package/lib/utils/getInitials.d.ts +0 -14
  107. package/lib/utils/index.d.ts +0 -1
  108. package/lib-commonjs/Avatar.d.ts +0 -1
  109. package/lib-commonjs/components/Avatar/Avatar.d.ts +0 -3
  110. package/lib-commonjs/components/Avatar/Avatar.types.d.ts +0 -107
  111. package/lib-commonjs/components/Avatar/index.d.ts +0 -5
  112. package/lib-commonjs/components/Avatar/renderAvatar.d.ts +0 -2
  113. package/lib-commonjs/components/Avatar/useAvatar.d.ts +0 -3
  114. package/lib-commonjs/components/Avatar/useAvatarStyles.d.ts +0 -3
  115. package/lib-commonjs/index.d.ts +0 -2
  116. package/lib-commonjs/utils/getInitials.d.ts +0 -14
  117. package/lib-commonjs/utils/index.d.ts +0 -1
@@ -40,20 +40,22 @@ const MULTIPLE_WHITESPACES_REGEX = /\s+/g;
40
40
 
41
41
  const UNSUPPORTED_TEXT_REGEX = /[\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][\uDC00-\uDED6]/;
42
42
 
43
- function getInitialsLatin(displayName, isRtl) {
43
+ function getInitialsLatin(displayName, isRtl, firstInitialOnly) {
44
44
  let initials = '';
45
45
  const splits = displayName.split(' ');
46
46
 
47
- if (splits.length === 2) {
48
- initials += splits[0].charAt(0).toUpperCase();
49
- initials += splits[1].charAt(0).toUpperCase();
50
- } else if (splits.length === 3) {
51
- initials += splits[0].charAt(0).toUpperCase();
52
- initials += splits[2].charAt(0).toUpperCase();
53
- } else if (splits.length !== 0) {
47
+ if (splits.length !== 0) {
54
48
  initials += splits[0].charAt(0).toUpperCase();
55
49
  }
56
50
 
51
+ if (!firstInitialOnly) {
52
+ if (splits.length === 2) {
53
+ initials += splits[1].charAt(0).toUpperCase();
54
+ } else if (splits.length === 3) {
55
+ initials += splits[2].charAt(0).toUpperCase();
56
+ }
57
+ }
58
+
57
59
  if (isRtl && initials.length > 1) {
58
60
  return initials.charAt(1) + initials.charAt(0);
59
61
  }
@@ -73,25 +75,25 @@ function cleanupDisplayName(displayName) {
73
75
  *
74
76
  * @param displayName - The full name of the person or entity
75
77
  * @param isRtl - Whether the display is in RTL
76
- * @param allowPhoneInitials - Should initials be generated from phone numbers (default false)
78
+ * @param options - Extra options to control the behavior of getInitials
77
79
  *
78
80
  * @returns The 1 or 2 character initials based on the name. Or an empty string if no initials
79
81
  * could be derived from the name.
80
82
  */
81
83
 
82
84
 
83
- function getInitials(displayName, isRtl, allowPhoneInitials) {
85
+ function getInitials(displayName, isRtl, options) {
84
86
  if (!displayName) {
85
87
  return '';
86
88
  }
87
89
 
88
90
  displayName = cleanupDisplayName(displayName); // For names containing CJK characters, and phone numbers, we don't display initials
89
91
 
90
- if (UNSUPPORTED_TEXT_REGEX.test(displayName) || !allowPhoneInitials && PHONENUMBER_REGEX.test(displayName)) {
92
+ if (UNSUPPORTED_TEXT_REGEX.test(displayName) || !(options === null || options === void 0 ? void 0 : options.allowPhoneInitials) && PHONENUMBER_REGEX.test(displayName)) {
91
93
  return '';
92
94
  }
93
95
 
94
- return getInitialsLatin(displayName, isRtl);
96
+ return getInitialsLatin(displayName, isRtl, options === null || options === void 0 ? void 0 : options.firstInitialOnly);
95
97
  }
96
98
 
97
99
  exports.getInitials = getInitials;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/getInitials.ts"],"names":[],"mappings":";AAAA;;AAEG;;;;;;AAEH;;;AAGG;;AACH,MAAM,yBAAyB,GAAW,6BAA1C;AAEA;;;AAGG;;AACH,MAAM,oBAAoB,GAAW,4DAArC;AAEA;;;AAGG;;AACH,MAAM,iBAAiB,GAAW,+BAAlC;AAEA;;AACA,MAAM,0BAA0B,GAAW,MAA3C;AAEA;;;;;;;AAOG;AACH;;AACA,MAAM,sBAAsB,GAAW,4MAAvC;;AAEA,SAAS,gBAAT,CAA0B,WAA1B,EAA+C,KAA/C,EAA6D;AAC3D,MAAI,QAAQ,GAAG,EAAf;AAEA,QAAM,MAAM,GAAa,WAAW,CAAC,KAAZ,CAAkB,GAAlB,CAAzB;;AAEA,MAAI,MAAM,CAAC,MAAP,KAAkB,CAAtB,EAAyB;AACvB,IAAA,QAAQ,IAAI,MAAM,CAAC,CAAD,CAAN,CAAU,MAAV,CAAiB,CAAjB,EAAoB,WAApB,EAAZ;AACA,IAAA,QAAQ,IAAI,MAAM,CAAC,CAAD,CAAN,CAAU,MAAV,CAAiB,CAAjB,EAAoB,WAApB,EAAZ;AACD,GAHD,MAGO,IAAI,MAAM,CAAC,MAAP,KAAkB,CAAtB,EAAyB;AAC9B,IAAA,QAAQ,IAAI,MAAM,CAAC,CAAD,CAAN,CAAU,MAAV,CAAiB,CAAjB,EAAoB,WAApB,EAAZ;AACA,IAAA,QAAQ,IAAI,MAAM,CAAC,CAAD,CAAN,CAAU,MAAV,CAAiB,CAAjB,EAAoB,WAApB,EAAZ;AACD,GAHM,MAGA,IAAI,MAAM,CAAC,MAAP,KAAkB,CAAtB,EAAyB;AAC9B,IAAA,QAAQ,IAAI,MAAM,CAAC,CAAD,CAAN,CAAU,MAAV,CAAiB,CAAjB,EAAoB,WAApB,EAAZ;AACD;;AAED,MAAI,KAAK,IAAI,QAAQ,CAAC,MAAT,GAAkB,CAA/B,EAAkC;AAChC,WAAO,QAAQ,CAAC,MAAT,CAAgB,CAAhB,IAAqB,QAAQ,CAAC,MAAT,CAAgB,CAAhB,CAA5B;AACD;;AAED,SAAO,QAAP;AACD;;AAED,SAAS,kBAAT,CAA4B,WAA5B,EAA+C;AAC7C,EAAA,WAAW,GAAG,WAAW,CAAC,OAAZ,CAAoB,yBAApB,EAA+C,EAA/C,CAAd;AACA,EAAA,WAAW,GAAG,WAAW,CAAC,OAAZ,CAAoB,oBAApB,EAA0C,EAA1C,CAAd;AACA,EAAA,WAAW,GAAG,WAAW,CAAC,OAAZ,CAAoB,0BAApB,EAAgD,GAAhD,CAAd;AACA,EAAA,WAAW,GAAG,WAAW,CAAC,IAAZ,EAAd;AAEA,SAAO,WAAP;AACD;AAED;;;;;;;;;AASG;;;AACH,SAAgB,WAAhB,CACE,WADF,EAEE,KAFF,EAGE,kBAHF,EAG8B;AAE5B,MAAI,CAAC,WAAL,EAAkB;AAChB,WAAO,EAAP;AACD;;AAED,EAAA,WAAW,GAAG,kBAAkB,CAAC,WAAD,CAAhC,CAN4B,CAQ5B;;AACA,MAAI,sBAAsB,CAAC,IAAvB,CAA4B,WAA5B,KAA6C,CAAC,kBAAD,IAAuB,iBAAiB,CAAC,IAAlB,CAAuB,WAAvB,CAAxE,EAA8G;AAC5G,WAAO,EAAP;AACD;;AAED,SAAO,gBAAgB,CAAC,WAAD,EAAc,KAAd,CAAvB;AACD;;AAjBD,OAAA,CAAA,WAAA,GAAA,WAAA","sourceRoot":""}
1
+ {"version":3,"sources":["utils/getInitials.ts"],"names":[],"mappings":";AAAA;;AAEG;;;;;;AAEH;;;AAGG;;AACH,MAAM,yBAAyB,GAAW,6BAA1C;AAEA;;;AAGG;;AACH,MAAM,oBAAoB,GAAW,4DAArC;AAEA;;;AAGG;;AACH,MAAM,iBAAiB,GAAW,+BAAlC;AAEA;;AACA,MAAM,0BAA0B,GAAW,MAA3C;AAEA;;;;;;;AAOG;AACH;;AACA,MAAM,sBAAsB,GAAW,4MAAvC;;AAEA,SAAS,gBAAT,CAA0B,WAA1B,EAA+C,KAA/C,EAA+D,gBAA/D,EAAyF;AACvF,MAAI,QAAQ,GAAG,EAAf;AAEA,QAAM,MAAM,GAAa,WAAW,CAAC,KAAZ,CAAkB,GAAlB,CAAzB;;AACA,MAAI,MAAM,CAAC,MAAP,KAAkB,CAAtB,EAAyB;AACvB,IAAA,QAAQ,IAAI,MAAM,CAAC,CAAD,CAAN,CAAU,MAAV,CAAiB,CAAjB,EAAoB,WAApB,EAAZ;AACD;;AAED,MAAI,CAAC,gBAAL,EAAuB;AACrB,QAAI,MAAM,CAAC,MAAP,KAAkB,CAAtB,EAAyB;AACvB,MAAA,QAAQ,IAAI,MAAM,CAAC,CAAD,CAAN,CAAU,MAAV,CAAiB,CAAjB,EAAoB,WAApB,EAAZ;AACD,KAFD,MAEO,IAAI,MAAM,CAAC,MAAP,KAAkB,CAAtB,EAAyB;AAC9B,MAAA,QAAQ,IAAI,MAAM,CAAC,CAAD,CAAN,CAAU,MAAV,CAAiB,CAAjB,EAAoB,WAApB,EAAZ;AACD;AACF;;AAED,MAAI,KAAK,IAAI,QAAQ,CAAC,MAAT,GAAkB,CAA/B,EAAkC;AAChC,WAAO,QAAQ,CAAC,MAAT,CAAgB,CAAhB,IAAqB,QAAQ,CAAC,MAAT,CAAgB,CAAhB,CAA5B;AACD;;AAED,SAAO,QAAP;AACD;;AAED,SAAS,kBAAT,CAA4B,WAA5B,EAA+C;AAC7C,EAAA,WAAW,GAAG,WAAW,CAAC,OAAZ,CAAoB,yBAApB,EAA+C,EAA/C,CAAd;AACA,EAAA,WAAW,GAAG,WAAW,CAAC,OAAZ,CAAoB,oBAApB,EAA0C,EAA1C,CAAd;AACA,EAAA,WAAW,GAAG,WAAW,CAAC,OAAZ,CAAoB,0BAApB,EAAgD,GAAhD,CAAd;AACA,EAAA,WAAW,GAAG,WAAW,CAAC,IAAZ,EAAd;AAEA,SAAO,WAAP;AACD;AAED;;;;;;;;;AASG;;;AACH,SAAgB,WAAhB,CACE,WADF,EAEE,KAFF,EAGE,OAHF,EASG;AAED,MAAI,CAAC,WAAL,EAAkB;AAChB,WAAO,EAAP;AACD;;AAED,EAAA,WAAW,GAAG,kBAAkB,CAAC,WAAD,CAAhC,CANC,CAQD;;AACA,MACE,sBAAsB,CAAC,IAAvB,CAA4B,WAA5B,KACC,EAAC,OAAO,KAAA,IAAP,IAAA,OAAO,KAAA,KAAA,CAAP,GAAO,KAAA,CAAP,GAAA,OAAO,CAAE,kBAAV,KAAgC,iBAAiB,CAAC,IAAlB,CAAuB,WAAvB,CAFnC,EAGE;AACA,WAAO,EAAP;AACD;;AAED,SAAO,gBAAgB,CAAC,WAAD,EAAc,KAAd,EAAqB,OAAO,KAAA,IAAP,IAAA,OAAO,KAAA,KAAA,CAAP,GAAO,KAAA,CAAP,GAAA,OAAO,CAAE,gBAA9B,CAAvB;AACD;;AA1BD,OAAA,CAAA,WAAA,GAAA,WAAA","sourcesContent":["/**\n * Regular expressions matching characters to ignore when calculating the initials.\n */\n\n/**\n * Regular expression matching characters within various types of enclosures, including the enclosures themselves\n * so for example, (xyz) [xyz] {xyz} all would be ignored\n */\nconst UNWANTED_ENCLOSURES_REGEX: RegExp = /[\\(\\[\\{][^\\)\\]\\}]*[\\)\\]\\}]/g;\n\n/**\n * Regular expression matching special ASCII characters except space, plus some unicode special characters.\n * Applies after unwanted enclosures have been removed\n */\nconst UNWANTED_CHARS_REGEX: RegExp = /[\\0-\\u001F\\!-/:-@\\[-`\\{-\\u00BF\\u0250-\\u036F\\uD800-\\uFFFF]/g;\n\n/**\n * Regular expression matching phone numbers. Applied after chars matching UNWANTED_CHARS_REGEX have been removed\n * and number has been trimmed for whitespaces\n */\nconst PHONENUMBER_REGEX: RegExp = /^\\d+[\\d\\s]*(:?ext|x|)\\s*\\d+$/i;\n\n/** Regular expression matching one or more spaces. */\nconst MULTIPLE_WHITESPACES_REGEX: RegExp = /\\s+/g;\n\n/**\n * Regular expression matching languages for which we currently don't support initials.\n * Arabic: Arabic, Arabic Supplement, Arabic Extended-A.\n * Korean: Hangul Jamo, Hangul Compatibility Jamo, Hangul Jamo Extended-A, Hangul Syllables, Hangul Jamo Extended-B.\n * Japanese: Hiragana, Katakana.\n * CJK: CJK Unified Ideographs Extension A, CJK Unified Ideographs, CJK Compatibility Ideographs,\n * CJK Unified Ideographs Extension B\n */\n// eslint-disable-next-line @fluentui/max-len\nconst UNSUPPORTED_TEXT_REGEX: 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][\\uDC00-\\uDED6]/;\n\nfunction getInitialsLatin(displayName: string, isRtl: boolean, firstInitialOnly?: boolean): string {\n let initials = '';\n\n const splits: string[] = displayName.split(' ');\n if (splits.length !== 0) {\n initials += splits[0].charAt(0).toUpperCase();\n }\n\n if (!firstInitialOnly) {\n if (splits.length === 2) {\n initials += splits[1].charAt(0).toUpperCase();\n } else if (splits.length === 3) {\n initials += splits[2].charAt(0).toUpperCase();\n }\n }\n\n if (isRtl && initials.length > 1) {\n return initials.charAt(1) + initials.charAt(0);\n }\n\n return initials;\n}\n\nfunction cleanupDisplayName(displayName: string): string {\n displayName = displayName.replace(UNWANTED_ENCLOSURES_REGEX, '');\n displayName = displayName.replace(UNWANTED_CHARS_REGEX, '');\n displayName = displayName.replace(MULTIPLE_WHITESPACES_REGEX, ' ');\n displayName = displayName.trim();\n\n return displayName;\n}\n\n/**\n * Get (up to 2 characters) initials based on display name of the persona.\n *\n * @param displayName - The full name of the person or entity\n * @param isRtl - Whether the display is in RTL\n * @param options - Extra options to control the behavior of getInitials\n *\n * @returns The 1 or 2 character initials based on the name. Or an empty string if no initials\n * could be derived from the name.\n */\nexport function getInitials(\n displayName: string | undefined | null,\n isRtl: boolean,\n options?: {\n /** Should initials be generated from phone numbers (default false) */\n allowPhoneInitials?: boolean;\n\n /** Returns only the first initial */\n firstInitialOnly?: boolean;\n },\n): string {\n if (!displayName) {\n return '';\n }\n\n displayName = cleanupDisplayName(displayName);\n\n // For names containing CJK characters, and phone numbers, we don't display initials\n if (\n UNSUPPORTED_TEXT_REGEX.test(displayName) ||\n (!options?.allowPhoneInitials && PHONENUMBER_REGEX.test(displayName))\n ) {\n return '';\n }\n\n return getInitialsLatin(displayName, isRtl, options?.firstInitialOnly);\n}\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,aAAA,gBAAA,OAAA,CAAA,eAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,aAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,aAAA,CAAA,WAAA;AAAW;AAAX,CAAA","sourceRoot":""}
1
+ {"version":3,"sources":["utils/index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,aAAA,gBAAA,OAAA,CAAA,eAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,aAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,aAAA,CAAA,WAAA;AAAW;AAAX,CAAA","sourcesContent":["export { getInitials } from './getInitials';\n"],"sourceRoot":"../src/"}
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@fluentui/react-avatar",
3
- "version": "9.0.0-rc.1",
3
+ "version": "9.0.0-rc.12",
4
4
  "description": "React components for building Microsoft web experiences.",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
7
- "typings": "lib/index.d.ts",
7
+ "typings": "dist/index.d.ts",
8
8
  "sideEffects": false,
9
9
  "repository": {
10
10
  "type": "git",
@@ -21,33 +21,27 @@
21
21
  "start": "yarn storybook",
22
22
  "test": "jest --passWithNoTests",
23
23
  "docs": "api-extractor run --config=config/api-extractor.local.json --local",
24
- "build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output ./dist/packages/react-avatar/src && yarn docs",
25
- "storybook": "node ../../scripts/storybook/runner",
24
+ "build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../../scripts/typescript/normalize-import --output ./dist/types/packages/react-components/react-avatar/src && yarn docs",
25
+ "storybook": "node ../../../scripts/storybook/runner",
26
26
  "type-check": "tsc -b tsconfig.json"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@fluentui/eslint-plugin": "*",
30
30
  "@fluentui/react-conformance": "*",
31
- "@fluentui/react-conformance-griffel": "9.0.0-beta.1",
31
+ "@fluentui/react-conformance-griffel": "9.0.0-beta.8",
32
32
  "@fluentui/scripts": "^1.0.0",
33
- "@types/enzyme": "3.10.3",
34
- "@types/enzyme-adapter-react-16": "1.0.3",
35
- "@types/react": "16.9.42",
36
- "@types/react-dom": "16.9.10",
37
- "@types/react-test-renderer": "^16.0.0",
38
- "enzyme": "~3.10.0",
39
- "enzyme-adapter-react-16": "^1.15.0",
40
- "es6-weak-map": "^2.0.2",
41
- "react": "16.8.6",
42
- "react-dom": "16.8.6",
43
- "react-test-renderer": "^16.3.0"
33
+ "es6-weak-map": "^2.0.2"
44
34
  },
45
35
  "dependencies": {
46
- "@fluentui/react-badge": "9.0.0-rc.1",
47
- "@fluentui/react-icons": "^2.0.159-beta.10",
48
- "@fluentui/react-theme": "9.0.0-rc.1",
49
- "@fluentui/react-utilities": "9.0.0-rc.1",
50
- "@griffel/react": "1.0.0",
36
+ "@fluentui/react-badge": "9.0.0-rc.12",
37
+ "@fluentui/react-button": "9.0.0-rc.13",
38
+ "@fluentui/react-icons": "^2.0.166-rc.3",
39
+ "@fluentui/react-popover": "9.0.0-rc.13",
40
+ "@fluentui/react-tooltip": "9.0.0-rc.13",
41
+ "@fluentui/react-theme": "9.0.0-rc.9",
42
+ "@fluentui/react-shared-contexts": "9.0.0-rc.10",
43
+ "@fluentui/react-utilities": "9.0.0-rc.10",
44
+ "@griffel/react": "1.1.0",
51
45
  "tslib": "^2.1.0"
52
46
  },
53
47
  "peerDependencies": {
@@ -62,5 +56,12 @@
62
56
  "minor",
63
57
  "patch"
64
58
  ]
59
+ },
60
+ "exports": {
61
+ ".": {
62
+ "types": "./lib/index.d.ts",
63
+ "import": "./lib/index.js",
64
+ "require": "./lib-commonjs/index.js"
65
+ }
65
66
  }
66
67
  }
@@ -1,142 +0,0 @@
1
- import type { ComponentProps } from '@fluentui/react-utilities';
2
- import type { ComponentState } from '@fluentui/react-utilities';
3
- import type { ForwardRefComponent } from '@fluentui/react-utilities';
4
- import { PresenceBadge } from '@fluentui/react-badge';
5
- import * as React_2 from 'react';
6
- import type { Slot } from '@fluentui/react-utilities';
7
-
8
- export declare const Avatar: ForwardRefComponent<AvatarProps>;
9
-
10
- export declare const avatarClassName = "fui-Avatar";
11
-
12
- declare type AvatarCommons = {
13
- /**
14
- * The name of the person or entity represented by this Avatar. This should always be provided if it is available.
15
- *
16
- * The name will be used to determine the initials displayed when there is no icon, as well as provided to
17
- * accessibility tools.
18
- */
19
- name?: string;
20
- /**
21
- * Size of the avatar in pixels.
22
- *
23
- * Size is restricted to a limited set of supported values recommended for most uses (see `AvatarSizeValue`) and
24
- * based on design guidelines for the Avatar control.
25
- *
26
- * If a non-supported size is neeeded, set `size` to the next-smaller supported size, and set `width` and `height`
27
- * to override the rendered size.
28
- *
29
- * For example, to set the avatar to 45px in size:
30
- * `<Avatar size={40} style={{ width: '45px', height: '45px' }} />`
31
- *
32
- * @defaultvalue 32
33
- */
34
- size: 20 | 24 | 28 | 32 | 36 | 40 | 48 | 56 | 64 | 72 | 96 | 120 | 128;
35
- /**
36
- * The avatar can have a circular or square shape.
37
- * @defaultvalue circular
38
- */
39
- shape: 'circular' | 'square';
40
- /**
41
- * Optional activity indicator
42
- * * active: the avatar will be decorated according to activeAppearance
43
- * * inactive: the avatar will be reduced in size and partially transparent
44
- * * unset: normal display
45
- *
46
- * @defaultvalue unset
47
- */
48
- active: 'active' | 'inactive' | 'unset';
49
- /**
50
- * The appearance when `active="active"`
51
- *
52
- * @defaultvalue ring
53
- */
54
- activeAppearance: 'ring' | 'shadow' | 'ring-shadow';
55
- /**
56
- * The color when displaying either an icon or initials.
57
- * * neutral (default): gray
58
- * * brand: color from the brand palette
59
- * * colorful: picks a color from a set of pre-defined colors, based on a hash of the name (or idForColor if provided)
60
- * * [AvatarNamedColor]: a specific color from the theme
61
- *
62
- * @defaultvalue neutral
63
- */
64
- color: 'neutral' | 'brand' | 'colorful' | AvatarNamedColor;
65
- /**
66
- * Specify a string to be used instead of the name, to determine which color to use when color="colorful".
67
- * Use this when a name is not available, but there is another unique identifier that can be used instead.
68
- */
69
- idForColor: string | undefined;
70
- };
71
-
72
- /**
73
- * A specific named color for the Avatar
74
- */
75
- export declare type AvatarNamedColor = 'darkRed' | 'cranberry' | 'red' | 'pumpkin' | 'peach' | 'marigold' | 'gold' | 'brass' | 'brown' | 'forest' | 'seafoam' | 'darkGreen' | 'lightTeal' | 'teal' | 'steel' | 'blue' | 'royalBlue' | 'cornflower' | 'navy' | 'lavender' | 'purple' | 'grape' | 'lilac' | 'pink' | 'magenta' | 'plum' | 'beige' | 'mink' | 'platinum' | 'anchor';
76
-
77
- /**
78
- * Properties for Avatar
79
- */
80
- export declare type AvatarProps = Omit<ComponentProps<AvatarSlots>, 'color'> & Partial<AvatarCommons>;
81
-
82
- export declare type AvatarSlots = {
83
- root: Slot<'span'>;
84
- /**
85
- * The Avatar's image.
86
- *
87
- * Usage e.g.: `image={{ src: '...' }}`
88
- */
89
- image?: Slot<'img'>;
90
- /**
91
- * (optional) Custom initials.
92
- *
93
- * It is usually not necessary to specify custom initials; by default they will be derived from the `name` prop,
94
- * using the `getInitials` function.
95
- *
96
- * The initials are displayed when there is no image (including while the image is loading).
97
- */
98
- initials?: Slot<'span'>;
99
- /**
100
- * Icon to be displayed when the avatar doesn't have an image or initials.
101
- *
102
- * @defaultvalue `PersonRegular` (the default icon's size depends on the Avatar's size)
103
- */
104
- icon?: Slot<'span'>;
105
- /**
106
- * Badge to show the avatar's presence status.
107
- */
108
- badge?: Slot<typeof PresenceBadge>;
109
- };
110
-
111
- /**
112
- * State used in rendering Avatar
113
- */
114
- export declare type AvatarState = ComponentState<AvatarSlots> & AvatarCommons & {
115
- /**
116
- * The Avatar's color, with `'colorful'` resolved to a named color
117
- */
118
- color: Exclude<AvatarCommons['color'], 'colorful'>;
119
- };
120
-
121
- /**
122
- * Regular expressions matching characters to ignore when calculating the initials.
123
- */
124
- /**
125
- * Get (up to 2 characters) initials based on display name of the persona.
126
- *
127
- * @param displayName - The full name of the person or entity
128
- * @param isRtl - Whether the display is in RTL
129
- * @param allowPhoneInitials - Should initials be generated from phone numbers (default false)
130
- *
131
- * @returns The 1 or 2 character initials based on the name. Or an empty string if no initials
132
- * could be derived from the name.
133
- */
134
- export declare function getInitials(displayName: string | undefined | null, isRtl: boolean, allowPhoneInitials?: boolean): string;
135
-
136
- export declare const renderAvatar_unstable: (state: AvatarState) => JSX.Element;
137
-
138
- export declare const useAvatar_unstable: (props: AvatarProps, ref: React_2.Ref<HTMLElement>) => AvatarState;
139
-
140
- export declare const useAvatarStyles_unstable: (state: AvatarState) => AvatarState;
141
-
142
- export { }
package/lib/Avatar.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './components/Avatar/index';
@@ -1,3 +0,0 @@
1
- import type { AvatarProps } from './Avatar.types';
2
- import type { ForwardRefComponent } from '@fluentui/react-utilities';
3
- export declare const Avatar: ForwardRefComponent<AvatarProps>;
@@ -1,107 +0,0 @@
1
- import { PresenceBadge } from '@fluentui/react-badge';
2
- import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
3
- export declare type AvatarSlots = {
4
- root: Slot<'span'>;
5
- /**
6
- * The Avatar's image.
7
- *
8
- * Usage e.g.: `image={{ src: '...' }}`
9
- */
10
- image?: Slot<'img'>;
11
- /**
12
- * (optional) Custom initials.
13
- *
14
- * It is usually not necessary to specify custom initials; by default they will be derived from the `name` prop,
15
- * using the `getInitials` function.
16
- *
17
- * The initials are displayed when there is no image (including while the image is loading).
18
- */
19
- initials?: Slot<'span'>;
20
- /**
21
- * Icon to be displayed when the avatar doesn't have an image or initials.
22
- *
23
- * @defaultvalue `PersonRegular` (the default icon's size depends on the Avatar's size)
24
- */
25
- icon?: Slot<'span'>;
26
- /**
27
- * Badge to show the avatar's presence status.
28
- */
29
- badge?: Slot<typeof PresenceBadge>;
30
- };
31
- declare type AvatarCommons = {
32
- /**
33
- * The name of the person or entity represented by this Avatar. This should always be provided if it is available.
34
- *
35
- * The name will be used to determine the initials displayed when there is no icon, as well as provided to
36
- * accessibility tools.
37
- */
38
- name?: string;
39
- /**
40
- * Size of the avatar in pixels.
41
- *
42
- * Size is restricted to a limited set of supported values recommended for most uses (see `AvatarSizeValue`) and
43
- * based on design guidelines for the Avatar control.
44
- *
45
- * If a non-supported size is neeeded, set `size` to the next-smaller supported size, and set `width` and `height`
46
- * to override the rendered size.
47
- *
48
- * For example, to set the avatar to 45px in size:
49
- * `<Avatar size={40} style={{ width: '45px', height: '45px' }} />`
50
- *
51
- * @defaultvalue 32
52
- */
53
- size: 20 | 24 | 28 | 32 | 36 | 40 | 48 | 56 | 64 | 72 | 96 | 120 | 128;
54
- /**
55
- * The avatar can have a circular or square shape.
56
- * @defaultvalue circular
57
- */
58
- shape: 'circular' | 'square';
59
- /**
60
- * Optional activity indicator
61
- * * active: the avatar will be decorated according to activeAppearance
62
- * * inactive: the avatar will be reduced in size and partially transparent
63
- * * unset: normal display
64
- *
65
- * @defaultvalue unset
66
- */
67
- active: 'active' | 'inactive' | 'unset';
68
- /**
69
- * The appearance when `active="active"`
70
- *
71
- * @defaultvalue ring
72
- */
73
- activeAppearance: 'ring' | 'shadow' | 'ring-shadow';
74
- /**
75
- * The color when displaying either an icon or initials.
76
- * * neutral (default): gray
77
- * * brand: color from the brand palette
78
- * * colorful: picks a color from a set of pre-defined colors, based on a hash of the name (or idForColor if provided)
79
- * * [AvatarNamedColor]: a specific color from the theme
80
- *
81
- * @defaultvalue neutral
82
- */
83
- color: 'neutral' | 'brand' | 'colorful' | AvatarNamedColor;
84
- /**
85
- * Specify a string to be used instead of the name, to determine which color to use when color="colorful".
86
- * Use this when a name is not available, but there is another unique identifier that can be used instead.
87
- */
88
- idForColor: string | undefined;
89
- };
90
- /**
91
- * A specific named color for the Avatar
92
- */
93
- export declare type AvatarNamedColor = 'darkRed' | 'cranberry' | 'red' | 'pumpkin' | 'peach' | 'marigold' | 'gold' | 'brass' | 'brown' | 'forest' | 'seafoam' | 'darkGreen' | 'lightTeal' | 'teal' | 'steel' | 'blue' | 'royalBlue' | 'cornflower' | 'navy' | 'lavender' | 'purple' | 'grape' | 'lilac' | 'pink' | 'magenta' | 'plum' | 'beige' | 'mink' | 'platinum' | 'anchor';
94
- /**
95
- * Properties for Avatar
96
- */
97
- export declare type AvatarProps = Omit<ComponentProps<AvatarSlots>, 'color'> & Partial<AvatarCommons>;
98
- /**
99
- * State used in rendering Avatar
100
- */
101
- export declare type AvatarState = ComponentState<AvatarSlots> & AvatarCommons & {
102
- /**
103
- * The Avatar's color, with `'colorful'` resolved to a named color
104
- */
105
- color: Exclude<AvatarCommons['color'], 'colorful'>;
106
- };
107
- export {};
@@ -1,5 +0,0 @@
1
- export * from './Avatar.types';
2
- export * from './Avatar';
3
- export * from './renderAvatar';
4
- export * from './useAvatar';
5
- export * from './useAvatarStyles';
@@ -1,2 +0,0 @@
1
- import type { AvatarState } from './Avatar.types';
2
- export declare const renderAvatar_unstable: (state: AvatarState) => JSX.Element;
@@ -1,3 +0,0 @@
1
- import * as React from 'react';
2
- import type { AvatarProps, AvatarState } from './Avatar.types';
3
- export declare const useAvatar_unstable: (props: AvatarProps, ref: React.Ref<HTMLElement>) => AvatarState;
@@ -1,3 +0,0 @@
1
- import type { AvatarState } from './Avatar.types';
2
- export declare const avatarClassName = "fui-Avatar";
3
- export declare const useAvatarStyles_unstable: (state: AvatarState) => AvatarState;
package/lib/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './Avatar';
2
- export * from './utils/index';
@@ -1,14 +0,0 @@
1
- /**
2
- * Regular expressions matching characters to ignore when calculating the initials.
3
- */
4
- /**
5
- * Get (up to 2 characters) initials based on display name of the persona.
6
- *
7
- * @param displayName - The full name of the person or entity
8
- * @param isRtl - Whether the display is in RTL
9
- * @param allowPhoneInitials - Should initials be generated from phone numbers (default false)
10
- *
11
- * @returns The 1 or 2 character initials based on the name. Or an empty string if no initials
12
- * could be derived from the name.
13
- */
14
- export declare function getInitials(displayName: string | undefined | null, isRtl: boolean, allowPhoneInitials?: boolean): string;
@@ -1 +0,0 @@
1
- export { getInitials } from './getInitials';
@@ -1 +0,0 @@
1
- export * from './components/Avatar/index';
@@ -1,3 +0,0 @@
1
- import type { AvatarProps } from './Avatar.types';
2
- import type { ForwardRefComponent } from '@fluentui/react-utilities';
3
- export declare const Avatar: ForwardRefComponent<AvatarProps>;
@@ -1,107 +0,0 @@
1
- import { PresenceBadge } from '@fluentui/react-badge';
2
- import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
3
- export declare type AvatarSlots = {
4
- root: Slot<'span'>;
5
- /**
6
- * The Avatar's image.
7
- *
8
- * Usage e.g.: `image={{ src: '...' }}`
9
- */
10
- image?: Slot<'img'>;
11
- /**
12
- * (optional) Custom initials.
13
- *
14
- * It is usually not necessary to specify custom initials; by default they will be derived from the `name` prop,
15
- * using the `getInitials` function.
16
- *
17
- * The initials are displayed when there is no image (including while the image is loading).
18
- */
19
- initials?: Slot<'span'>;
20
- /**
21
- * Icon to be displayed when the avatar doesn't have an image or initials.
22
- *
23
- * @defaultvalue `PersonRegular` (the default icon's size depends on the Avatar's size)
24
- */
25
- icon?: Slot<'span'>;
26
- /**
27
- * Badge to show the avatar's presence status.
28
- */
29
- badge?: Slot<typeof PresenceBadge>;
30
- };
31
- declare type AvatarCommons = {
32
- /**
33
- * The name of the person or entity represented by this Avatar. This should always be provided if it is available.
34
- *
35
- * The name will be used to determine the initials displayed when there is no icon, as well as provided to
36
- * accessibility tools.
37
- */
38
- name?: string;
39
- /**
40
- * Size of the avatar in pixels.
41
- *
42
- * Size is restricted to a limited set of supported values recommended for most uses (see `AvatarSizeValue`) and
43
- * based on design guidelines for the Avatar control.
44
- *
45
- * If a non-supported size is neeeded, set `size` to the next-smaller supported size, and set `width` and `height`
46
- * to override the rendered size.
47
- *
48
- * For example, to set the avatar to 45px in size:
49
- * `<Avatar size={40} style={{ width: '45px', height: '45px' }} />`
50
- *
51
- * @defaultvalue 32
52
- */
53
- size: 20 | 24 | 28 | 32 | 36 | 40 | 48 | 56 | 64 | 72 | 96 | 120 | 128;
54
- /**
55
- * The avatar can have a circular or square shape.
56
- * @defaultvalue circular
57
- */
58
- shape: 'circular' | 'square';
59
- /**
60
- * Optional activity indicator
61
- * * active: the avatar will be decorated according to activeAppearance
62
- * * inactive: the avatar will be reduced in size and partially transparent
63
- * * unset: normal display
64
- *
65
- * @defaultvalue unset
66
- */
67
- active: 'active' | 'inactive' | 'unset';
68
- /**
69
- * The appearance when `active="active"`
70
- *
71
- * @defaultvalue ring
72
- */
73
- activeAppearance: 'ring' | 'shadow' | 'ring-shadow';
74
- /**
75
- * The color when displaying either an icon or initials.
76
- * * neutral (default): gray
77
- * * brand: color from the brand palette
78
- * * colorful: picks a color from a set of pre-defined colors, based on a hash of the name (or idForColor if provided)
79
- * * [AvatarNamedColor]: a specific color from the theme
80
- *
81
- * @defaultvalue neutral
82
- */
83
- color: 'neutral' | 'brand' | 'colorful' | AvatarNamedColor;
84
- /**
85
- * Specify a string to be used instead of the name, to determine which color to use when color="colorful".
86
- * Use this when a name is not available, but there is another unique identifier that can be used instead.
87
- */
88
- idForColor: string | undefined;
89
- };
90
- /**
91
- * A specific named color for the Avatar
92
- */
93
- export declare type AvatarNamedColor = 'darkRed' | 'cranberry' | 'red' | 'pumpkin' | 'peach' | 'marigold' | 'gold' | 'brass' | 'brown' | 'forest' | 'seafoam' | 'darkGreen' | 'lightTeal' | 'teal' | 'steel' | 'blue' | 'royalBlue' | 'cornflower' | 'navy' | 'lavender' | 'purple' | 'grape' | 'lilac' | 'pink' | 'magenta' | 'plum' | 'beige' | 'mink' | 'platinum' | 'anchor';
94
- /**
95
- * Properties for Avatar
96
- */
97
- export declare type AvatarProps = Omit<ComponentProps<AvatarSlots>, 'color'> & Partial<AvatarCommons>;
98
- /**
99
- * State used in rendering Avatar
100
- */
101
- export declare type AvatarState = ComponentState<AvatarSlots> & AvatarCommons & {
102
- /**
103
- * The Avatar's color, with `'colorful'` resolved to a named color
104
- */
105
- color: Exclude<AvatarCommons['color'], 'colorful'>;
106
- };
107
- export {};
@@ -1,5 +0,0 @@
1
- export * from './Avatar.types';
2
- export * from './Avatar';
3
- export * from './renderAvatar';
4
- export * from './useAvatar';
5
- export * from './useAvatarStyles';
@@ -1,2 +0,0 @@
1
- import type { AvatarState } from './Avatar.types';
2
- export declare const renderAvatar_unstable: (state: AvatarState) => JSX.Element;
@@ -1,3 +0,0 @@
1
- import * as React from 'react';
2
- import type { AvatarProps, AvatarState } from './Avatar.types';
3
- export declare const useAvatar_unstable: (props: AvatarProps, ref: React.Ref<HTMLElement>) => AvatarState;
@@ -1,3 +0,0 @@
1
- import type { AvatarState } from './Avatar.types';
2
- export declare const avatarClassName = "fui-Avatar";
3
- export declare const useAvatarStyles_unstable: (state: AvatarState) => AvatarState;
@@ -1,2 +0,0 @@
1
- export * from './Avatar';
2
- export * from './utils/index';
@@ -1,14 +0,0 @@
1
- /**
2
- * Regular expressions matching characters to ignore when calculating the initials.
3
- */
4
- /**
5
- * Get (up to 2 characters) initials based on display name of the persona.
6
- *
7
- * @param displayName - The full name of the person or entity
8
- * @param isRtl - Whether the display is in RTL
9
- * @param allowPhoneInitials - Should initials be generated from phone numbers (default false)
10
- *
11
- * @returns The 1 or 2 character initials based on the name. Or an empty string if no initials
12
- * could be derived from the name.
13
- */
14
- export declare function getInitials(displayName: string | undefined | null, isRtl: boolean, allowPhoneInitials?: boolean): string;
@@ -1 +0,0 @@
1
- export { getInitials } from './getInitials';