@fluentui/react-avatar 9.4.9 → 9.5.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 (89) hide show
  1. package/CHANGELOG.json +161 -1
  2. package/CHANGELOG.md +43 -2
  3. package/dist/index.d.ts +7 -1
  4. package/lib/components/Avatar/Avatar.js +3 -6
  5. package/lib/components/Avatar/Avatar.js.map +1 -1
  6. package/lib/components/Avatar/Avatar.types.js.map +1 -1
  7. package/lib/components/Avatar/index.js +1 -1
  8. package/lib/components/Avatar/index.js.map +1 -1
  9. package/lib/components/Avatar/renderAvatar.js +4 -4
  10. package/lib/components/Avatar/renderAvatar.js.map +1 -1
  11. package/lib/components/Avatar/useAvatar.js +2 -1
  12. package/lib/components/Avatar/useAvatar.js.map +1 -1
  13. package/lib/components/Avatar/useAvatarStyles.styles.js +584 -0
  14. package/lib/components/Avatar/useAvatarStyles.styles.js.map +1 -0
  15. package/lib/components/AvatarGroup/AvatarGroup.js +3 -6
  16. package/lib/components/AvatarGroup/AvatarGroup.js.map +1 -1
  17. package/lib/components/AvatarGroup/index.js +1 -1
  18. package/lib/components/AvatarGroup/index.js.map +1 -1
  19. package/lib/components/AvatarGroup/renderAvatarGroup.js +5 -5
  20. package/lib/components/AvatarGroup/renderAvatarGroup.js.map +1 -1
  21. package/lib/components/AvatarGroup/{useAvatarGroupStyles.js → useAvatarGroupStyles.styles.js} +2 -2
  22. package/lib/components/AvatarGroup/useAvatarGroupStyles.styles.js.map +1 -0
  23. package/lib/components/AvatarGroupItem/AvatarGroupItem.js +3 -6
  24. package/lib/components/AvatarGroupItem/AvatarGroupItem.js.map +1 -1
  25. package/lib/components/AvatarGroupItem/index.js +1 -1
  26. package/lib/components/AvatarGroupItem/index.js.map +1 -1
  27. package/lib/components/AvatarGroupItem/renderAvatarGroupItem.js +4 -4
  28. package/lib/components/AvatarGroupItem/renderAvatarGroupItem.js.map +1 -1
  29. package/lib/components/AvatarGroupItem/{useAvatarGroupItemStyles.js → useAvatarGroupItemStyles.styles.js} +1 -1
  30. package/lib/components/AvatarGroupItem/useAvatarGroupItemStyles.styles.js.map +1 -0
  31. package/lib/components/AvatarGroupPopover/AvatarGroupPopover.js +3 -6
  32. package/lib/components/AvatarGroupPopover/AvatarGroupPopover.js.map +1 -1
  33. package/lib/components/AvatarGroupPopover/index.js +1 -1
  34. package/lib/components/AvatarGroupPopover/index.js.map +1 -1
  35. package/lib/components/AvatarGroupPopover/renderAvatarGroupPopover.js +6 -6
  36. package/lib/components/AvatarGroupPopover/renderAvatarGroupPopover.js.map +1 -1
  37. package/lib/components/AvatarGroupPopover/{useAvatarGroupPopoverStyles.js → useAvatarGroupPopoverStyles.styles.js} +10 -11
  38. package/lib/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.styles.js.map +1 -0
  39. package/lib/contexts/AvatarContext.js.map +1 -1
  40. package/lib/index.js.map +1 -1
  41. package/lib/utils/getInitials.js +1 -1
  42. package/lib/utils/getInitials.js.map +1 -1
  43. package/lib-commonjs/components/Avatar/Avatar.js +3 -4
  44. package/lib-commonjs/components/Avatar/Avatar.js.map +1 -1
  45. package/lib-commonjs/components/Avatar/index.js +1 -1
  46. package/lib-commonjs/components/Avatar/index.js.map +1 -1
  47. package/lib-commonjs/components/Avatar/renderAvatar.js +4 -5
  48. package/lib-commonjs/components/Avatar/renderAvatar.js.map +1 -1
  49. package/lib-commonjs/components/Avatar/useAvatar.js +2 -2
  50. package/lib-commonjs/components/Avatar/useAvatar.js.map +1 -1
  51. package/lib-commonjs/components/Avatar/{useAvatarStyles.js → useAvatarStyles.styles.js} +295 -285
  52. package/lib-commonjs/components/Avatar/useAvatarStyles.styles.js.map +1 -0
  53. package/lib-commonjs/components/AvatarGroup/AvatarGroup.js +3 -4
  54. package/lib-commonjs/components/AvatarGroup/AvatarGroup.js.map +1 -1
  55. package/lib-commonjs/components/AvatarGroup/index.js +1 -1
  56. package/lib-commonjs/components/AvatarGroup/index.js.map +1 -1
  57. package/lib-commonjs/components/AvatarGroup/renderAvatarGroup.js +5 -6
  58. package/lib-commonjs/components/AvatarGroup/renderAvatarGroup.js.map +1 -1
  59. package/lib-commonjs/components/AvatarGroup/{useAvatarGroupStyles.js → useAvatarGroupStyles.styles.js} +4 -4
  60. package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.styles.js.map +1 -0
  61. package/lib-commonjs/components/AvatarGroupItem/AvatarGroupItem.js +3 -4
  62. package/lib-commonjs/components/AvatarGroupItem/AvatarGroupItem.js.map +1 -1
  63. package/lib-commonjs/components/AvatarGroupItem/index.js +1 -1
  64. package/lib-commonjs/components/AvatarGroupItem/index.js.map +1 -1
  65. package/lib-commonjs/components/AvatarGroupItem/renderAvatarGroupItem.js +4 -5
  66. package/lib-commonjs/components/AvatarGroupItem/renderAvatarGroupItem.js.map +1 -1
  67. package/lib-commonjs/components/AvatarGroupItem/{useAvatarGroupItemStyles.js → useAvatarGroupItemStyles.styles.js} +2 -2
  68. package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItemStyles.styles.js.map +1 -0
  69. package/lib-commonjs/components/AvatarGroupPopover/AvatarGroupPopover.js +3 -4
  70. package/lib-commonjs/components/AvatarGroupPopover/AvatarGroupPopover.js.map +1 -1
  71. package/lib-commonjs/components/AvatarGroupPopover/index.js +1 -1
  72. package/lib-commonjs/components/AvatarGroupPopover/index.js.map +1 -1
  73. package/lib-commonjs/components/AvatarGroupPopover/renderAvatarGroupPopover.js +6 -7
  74. package/lib-commonjs/components/AvatarGroupPopover/renderAvatarGroupPopover.js.map +1 -1
  75. package/lib-commonjs/components/AvatarGroupPopover/{useAvatarGroupPopoverStyles.js → useAvatarGroupPopoverStyles.styles.js} +15 -17
  76. package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.styles.js.map +1 -0
  77. package/lib-commonjs/utils/getInitials.js +1 -2
  78. package/lib-commonjs/utils/getInitials.js.map +1 -1
  79. package/package.json +11 -10
  80. package/.swcrc +0 -30
  81. package/lib/components/Avatar/useAvatarStyles.js +0 -493
  82. package/lib/components/Avatar/useAvatarStyles.js.map +0 -1
  83. package/lib/components/AvatarGroup/useAvatarGroupStyles.js.map +0 -1
  84. package/lib/components/AvatarGroupItem/useAvatarGroupItemStyles.js.map +0 -1
  85. package/lib/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.js.map +0 -1
  86. package/lib-commonjs/components/Avatar/useAvatarStyles.js.map +0 -1
  87. package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.js.map +0 -1
  88. package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItemStyles.js.map +0 -1
  89. package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.js.map +0 -1
package/CHANGELOG.json CHANGED
@@ -2,7 +2,167 @@
2
2
  "name": "@fluentui/react-avatar",
3
3
  "entries": [
4
4
  {
5
- "date": "Mon, 17 Apr 2023 17:49:56 GMT",
5
+ "date": "Fri, 12 May 2023 20:22:42 GMT",
6
+ "tag": "@fluentui/react-avatar_v9.5.0",
7
+ "version": "9.5.0",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "gcox@microsoft.com",
12
+ "package": "@fluentui/react-avatar",
13
+ "commit": "ee977e20d359922798949a4f18af7a036ca36ca3",
14
+ "comment": "Update to use single hook selector"
15
+ },
16
+ {
17
+ "author": "olfedias@microsoft.com",
18
+ "package": "@fluentui/react-avatar",
19
+ "commit": "871192b67e1bc8a68da1b4c55b4e0ee2aed0b604",
20
+ "comment": "chore: move makeStyles() calls to .styles.ts files"
21
+ },
22
+ {
23
+ "author": "esteban.230@hotmail.com",
24
+ "package": "@fluentui/react-avatar",
25
+ "commit": "eb1387fb3f564a01f56c788c4ae139e59100fc16",
26
+ "comment": "fix: Make AvatarGroup's content direction column."
27
+ },
28
+ {
29
+ "author": "sarah.higley@microsoft.com",
30
+ "package": "@fluentui/react-avatar",
31
+ "commit": "81b87f41557964f9c9f5601a3eec84434eb74f35",
32
+ "comment": "fix: update createCustomFocusIndicator usage to specify outline: none"
33
+ },
34
+ {
35
+ "author": "olfedias@microsoft.com",
36
+ "package": "@fluentui/react-avatar",
37
+ "commit": "c28decb23d191a0daaaf6d5d1832429715102129",
38
+ "comment": "chore: exclude .swcrc from being published"
39
+ },
40
+ {
41
+ "author": "behowell@microsoft.com",
42
+ "package": "@fluentui/react-avatar",
43
+ "commit": "c7424d14422bb8b1f5282f7c64ec6cc9de3640be",
44
+ "comment": "fix: Make border around badge transparent, not a solid color"
45
+ }
46
+ ],
47
+ "none": [
48
+ {
49
+ "author": "martinhochel@microsoft.com",
50
+ "package": "@fluentui/react-avatar",
51
+ "commit": "dbda7fa69e3000aaf8dd4a061e254ebd35198b8e",
52
+ "comment": "fix: update npmignore files to fix npm8/node16 regression how npm publish works"
53
+ }
54
+ ],
55
+ "minor": [
56
+ {
57
+ "author": "yuanboxue@microsoft.com",
58
+ "package": "@fluentui/react-avatar",
59
+ "commit": "6d0848597a7c07883a93b13f67f6727fd791f3dd",
60
+ "comment": "feat: add `shape` to AvatarContext"
61
+ },
62
+ {
63
+ "author": "beachball",
64
+ "package": "@fluentui/react-avatar",
65
+ "comment": "Bump @fluentui/react-badge to v9.1.11",
66
+ "commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
67
+ },
68
+ {
69
+ "author": "beachball",
70
+ "package": "@fluentui/react-avatar",
71
+ "comment": "Bump @fluentui/react-context-selector to v9.1.19",
72
+ "commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
73
+ },
74
+ {
75
+ "author": "beachball",
76
+ "package": "@fluentui/react-avatar",
77
+ "comment": "Bump @fluentui/react-popover to v9.5.11",
78
+ "commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
79
+ },
80
+ {
81
+ "author": "beachball",
82
+ "package": "@fluentui/react-avatar",
83
+ "comment": "Bump @fluentui/react-shared-contexts to v9.4.0",
84
+ "commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
85
+ },
86
+ {
87
+ "author": "beachball",
88
+ "package": "@fluentui/react-avatar",
89
+ "comment": "Bump @fluentui/react-tabster to v9.7.0",
90
+ "commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
91
+ },
92
+ {
93
+ "author": "beachball",
94
+ "package": "@fluentui/react-avatar",
95
+ "comment": "Bump @fluentui/react-theme to v9.1.8",
96
+ "commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
97
+ },
98
+ {
99
+ "author": "beachball",
100
+ "package": "@fluentui/react-avatar",
101
+ "comment": "Bump @fluentui/react-tooltip to v9.2.11",
102
+ "commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
103
+ },
104
+ {
105
+ "author": "beachball",
106
+ "package": "@fluentui/react-avatar",
107
+ "comment": "Bump @fluentui/react-utilities to v9.8.1",
108
+ "commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
109
+ },
110
+ {
111
+ "author": "beachball",
112
+ "package": "@fluentui/react-avatar",
113
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.3",
114
+ "commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
115
+ },
116
+ {
117
+ "author": "beachball",
118
+ "package": "@fluentui/react-avatar",
119
+ "comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.21",
120
+ "commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
121
+ }
122
+ ]
123
+ }
124
+ },
125
+ {
126
+ "date": "Mon, 24 Apr 2023 08:12:31 GMT",
127
+ "tag": "@fluentui/react-avatar_v9.4.10",
128
+ "version": "9.4.10",
129
+ "comments": {
130
+ "patch": [
131
+ {
132
+ "author": "bernardo.sunderhus@gmail.com",
133
+ "package": "@fluentui/react-avatar",
134
+ "commit": "d340ff4b1c3aa7e1818780ec4d41f46c86e451c9",
135
+ "comment": "chore: adopt custom JSX pragma"
136
+ },
137
+ {
138
+ "author": "beachball",
139
+ "package": "@fluentui/react-avatar",
140
+ "comment": "Bump @fluentui/react-badge to v9.1.10",
141
+ "commit": "505433ac64f144c9cca456097413d6af4582e5ee"
142
+ },
143
+ {
144
+ "author": "beachball",
145
+ "package": "@fluentui/react-avatar",
146
+ "comment": "Bump @fluentui/react-popover to v9.5.10",
147
+ "commit": "505433ac64f144c9cca456097413d6af4582e5ee"
148
+ },
149
+ {
150
+ "author": "beachball",
151
+ "package": "@fluentui/react-avatar",
152
+ "comment": "Bump @fluentui/react-tooltip to v9.2.10",
153
+ "commit": "505433ac64f144c9cca456097413d6af4582e5ee"
154
+ },
155
+ {
156
+ "author": "beachball",
157
+ "package": "@fluentui/react-avatar",
158
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.2",
159
+ "commit": "505433ac64f144c9cca456097413d6af4582e5ee"
160
+ }
161
+ ]
162
+ }
163
+ },
164
+ {
165
+ "date": "Mon, 17 Apr 2023 17:53:45 GMT",
6
166
  "tag": "@fluentui/react-avatar_v9.4.9",
7
167
  "version": "9.4.9",
8
168
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,53 @@
1
1
  # Change Log - @fluentui/react-avatar
2
2
 
3
- This log was last generated on Mon, 17 Apr 2023 17:49:56 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 12 May 2023 20:22:42 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.5.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-avatar_v9.5.0)
8
+
9
+ Fri, 12 May 2023 20:22:42 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-avatar_v9.4.10..@fluentui/react-avatar_v9.5.0)
11
+
12
+ ### Minor changes
13
+
14
+ - feat: add `shape` to AvatarContext ([PR #27738](https://github.com/microsoft/fluentui/pull/27738) by yuanboxue@microsoft.com)
15
+ - Bump @fluentui/react-badge to v9.1.11 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
16
+ - Bump @fluentui/react-context-selector to v9.1.19 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
17
+ - Bump @fluentui/react-popover to v9.5.11 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
18
+ - Bump @fluentui/react-shared-contexts to v9.4.0 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
19
+ - Bump @fluentui/react-tabster to v9.7.0 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
20
+ - Bump @fluentui/react-theme to v9.1.8 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
21
+ - Bump @fluentui/react-tooltip to v9.2.11 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
22
+ - Bump @fluentui/react-utilities to v9.8.1 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
23
+ - Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.3 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
24
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.21 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
25
+
26
+ ### Patches
27
+
28
+ - Update to use single hook selector ([PR #27491](https://github.com/microsoft/fluentui/pull/27491) by gcox@microsoft.com)
29
+ - chore: move makeStyles() calls to .styles.ts files ([PR #27710](https://github.com/microsoft/fluentui/pull/27710) by olfedias@microsoft.com)
30
+ - fix: Make AvatarGroup's content direction column. ([PR #27743](https://github.com/microsoft/fluentui/pull/27743) by esteban.230@hotmail.com)
31
+ - fix: update createCustomFocusIndicator usage to specify outline: none ([PR #26089](https://github.com/microsoft/fluentui/pull/26089) by sarah.higley@microsoft.com)
32
+ - chore: exclude .swcrc from being published ([PR #27740](https://github.com/microsoft/fluentui/pull/27740) by olfedias@microsoft.com)
33
+ - fix: Make border around badge transparent, not a solid color ([PR #27527](https://github.com/microsoft/fluentui/pull/27527) by behowell@microsoft.com)
34
+
35
+ ## [9.4.10](https://github.com/microsoft/fluentui/tree/@fluentui/react-avatar_v9.4.10)
36
+
37
+ Mon, 24 Apr 2023 08:12:31 GMT
38
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-avatar_v9.4.9..@fluentui/react-avatar_v9.4.10)
39
+
40
+ ### Patches
41
+
42
+ - chore: adopt custom JSX pragma ([PR #27602](https://github.com/microsoft/fluentui/pull/27602) by bernardo.sunderhus@gmail.com)
43
+ - Bump @fluentui/react-badge to v9.1.10 ([commit](https://github.com/microsoft/fluentui/commit/505433ac64f144c9cca456097413d6af4582e5ee) by beachball)
44
+ - Bump @fluentui/react-popover to v9.5.10 ([commit](https://github.com/microsoft/fluentui/commit/505433ac64f144c9cca456097413d6af4582e5ee) by beachball)
45
+ - Bump @fluentui/react-tooltip to v9.2.10 ([commit](https://github.com/microsoft/fluentui/commit/505433ac64f144c9cca456097413d6af4582e5ee) by beachball)
46
+ - Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.2 ([commit](https://github.com/microsoft/fluentui/commit/505433ac64f144c9cca456097413d6af4582e5ee) by beachball)
47
+
7
48
  ## [9.4.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-avatar_v9.4.9)
8
49
 
9
- Mon, 17 Apr 2023 17:49:56 GMT
50
+ Mon, 17 Apr 2023 17:53:45 GMT
10
51
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-avatar_v9.4.8..@fluentui/react-avatar_v9.4.9)
11
52
 
12
53
  ### Patches
package/dist/index.d.ts CHANGED
@@ -28,6 +28,7 @@ export declare const AvatarContextProvider: React_2.Provider<AvatarContextValue
28
28
  * @internal
29
29
  */
30
30
  export declare interface AvatarContextValue {
31
+ shape?: AvatarShape;
31
32
  size?: AvatarSize;
32
33
  }
33
34
 
@@ -220,7 +221,7 @@ export declare type AvatarProps = Omit<ComponentProps<AvatarSlots>, 'color'> & {
220
221
  * The avatar can have a circular or square shape.
221
222
  * @default circular
222
223
  */
223
- shape?: 'circular' | 'square';
224
+ shape?: AvatarShape;
224
225
  /**
225
226
  * Size of the avatar in pixels.
226
227
  *
@@ -240,6 +241,11 @@ export declare type AvatarProps = Omit<ComponentProps<AvatarSlots>, 'color'> & {
240
241
  size?: AvatarSize;
241
242
  };
242
243
 
244
+ /**
245
+ * Shape of the avatar
246
+ */
247
+ export declare type AvatarShape = 'circular' | 'square';
248
+
243
249
  /**
244
250
  * Sizes for the avatar
245
251
  */
@@ -1,15 +1,12 @@
1
1
  import * as React from 'react';
2
2
  import { renderAvatar_unstable } from './renderAvatar';
3
3
  import { useAvatar_unstable } from './useAvatar';
4
- import { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';
5
- import { useAvatarStyles_unstable } from './useAvatarStyles';
4
+ import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
5
+ import { useAvatarStyles_unstable } from './useAvatarStyles.styles';
6
6
  export const Avatar = /*#__PURE__*/React.forwardRef((props, ref) => {
7
7
  const state = useAvatar_unstable(props, ref);
8
8
  useAvatarStyles_unstable(state);
9
- const {
10
- useAvatarStyles_unstable: useCustomStyles
11
- } = useCustomStyleHooks_unstable();
12
- useCustomStyles(state);
9
+ useCustomStyleHook_unstable('useAvatarStyles_unstable')(state);
13
10
  return renderAvatar_unstable(state);
14
11
  });
15
12
  Avatar.displayName = 'Avatar';
@@ -1 +1 @@
1
- {"version":3,"names":["React","renderAvatar_unstable","useAvatar_unstable","useCustomStyleHooks_unstable","useAvatarStyles_unstable","Avatar","forwardRef","props","ref","state","useCustomStyles","displayName"],"sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { renderAvatar_unstable } from './renderAvatar';\nimport { useAvatar_unstable } from './useAvatar';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\nimport { useAvatarStyles_unstable } from './useAvatarStyles';\nimport type { AvatarProps } from './Avatar.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\nexport const Avatar: ForwardRefComponent<AvatarProps> = React.forwardRef((props, ref) => {\n const state = useAvatar_unstable(props, ref);\n\n useAvatarStyles_unstable(state);\n\n const { useAvatarStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderAvatar_unstable(state);\n});\n\nAvatar.displayName = 'Avatar';\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,qBAAqB,QAAQ;AACtC,SAASC,kBAAkB,QAAQ;AACnC,SAASC,4BAA4B,QAAQ;AAC7C,SAASC,wBAAwB,QAAQ;AAIzC,OAAO,MAAMC,MAAA,gBAA2CL,KAAA,CAAMM,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EACvF,MAAMC,KAAA,GAAQP,kBAAA,CAAmBK,KAAA,EAAOC,GAAA;EAExCJ,wBAAA,CAAyBK,KAAA;EAEzB,MAAM;IAAEL,wBAAA,EAA0BM;EAAe,CAAE,GAAGP,4BAAA;EACtDO,eAAA,CAAgBD,KAAA;EAEhB,OAAOR,qBAAA,CAAsBQ,KAAA;AAC/B;AAEAJ,MAAA,CAAOM,WAAW,GAAG"}
1
+ {"version":3,"names":["React","renderAvatar_unstable","useAvatar_unstable","useCustomStyleHook_unstable","useAvatarStyles_unstable","Avatar","forwardRef","props","ref","state","displayName"],"sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { renderAvatar_unstable } from './renderAvatar';\nimport { useAvatar_unstable } from './useAvatar';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport { useAvatarStyles_unstable } from './useAvatarStyles.styles';\nimport type { AvatarProps } from './Avatar.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\nexport const Avatar: ForwardRefComponent<AvatarProps> = React.forwardRef((props, ref) => {\n const state = useAvatar_unstable(props, ref);\n\n useAvatarStyles_unstable(state);\n\n useCustomStyleHook_unstable('useAvatarStyles_unstable')(state);\n\n return renderAvatar_unstable(state);\n});\n\nAvatar.displayName = 'Avatar';\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,qBAAqB,QAAQ;AACtC,SAASC,kBAAkB,QAAQ;AACnC,SAASC,2BAA2B,QAAQ;AAC5C,SAASC,wBAAwB,QAAQ;AAIzC,OAAO,MAAMC,MAAA,gBAA2CL,KAAA,CAAMM,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EACvF,MAAMC,KAAA,GAAQP,kBAAA,CAAmBK,KAAA,EAAOC,GAAA;EAExCJ,wBAAA,CAAyBK,KAAA;EAEzBN,2BAAA,CAA4B,4BAA4BM,KAAA;EAExD,OAAOR,qBAAA,CAAsBQ,KAAA;AAC/B;AAEAJ,MAAA,CAAOK,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../src/components/Avatar/Avatar.types.ts"],"sourcesContent":["import { PresenceBadge } from '@fluentui/react-badge';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\n/**\n * Sizes for the avatar\n * @deprecated use AvatarSize instead\n */\nexport type AvatarSizes = AvatarSize;\n/**\n * Sizes for the avatar\n */\nexport type AvatarSize = 16 | 20 | 24 | 28 | 32 | 36 | 40 | 48 | 56 | 64 | 72 | 96 | 120 | 128;\n\nexport type AvatarSlots = {\n root: Slot<'span'>;\n\n /**\n * The Avatar's image.\n *\n * Usage e.g.: `image={{ src: '...' }}`\n */\n image?: Slot<'img'>;\n\n /**\n * (optional) Custom initials.\n *\n * It is usually not necessary to specify custom initials; by default they will be derived from the `name` prop,\n * using the `getInitials` function.\n *\n * The initials are displayed when there is no image (including while the image is loading).\n */\n initials?: Slot<'span'>;\n\n /**\n * Icon to be displayed when the avatar doesn't have an image or initials.\n *\n * @default `PersonRegular` (the default icon's size depends on the Avatar's size)\n */\n icon?: Slot<'span'>;\n\n /**\n * Badge to show the avatar's presence status.\n */\n badge?: Slot<typeof PresenceBadge>;\n};\n\n/**\n * A specific named color for the Avatar\n */\nexport type AvatarNamedColor =\n | 'dark-red'\n | 'cranberry'\n | 'red'\n | 'pumpkin'\n | 'peach'\n | 'marigold'\n | 'gold'\n | 'brass'\n | 'brown'\n | 'forest'\n | 'seafoam'\n | 'dark-green'\n | 'light-teal'\n | 'teal'\n | 'steel'\n | 'blue'\n | 'royal-blue'\n | 'cornflower'\n | 'navy'\n | 'lavender'\n | 'purple'\n | 'grape'\n | 'lilac'\n | 'pink'\n | 'magenta'\n | 'plum'\n | 'beige'\n | 'mink'\n | 'platinum'\n | 'anchor';\n\n/**\n * Properties for Avatar\n */\nexport type AvatarProps = Omit<ComponentProps<AvatarSlots>, 'color'> & {\n /**\n * Optional activity indicator\n * * active: the avatar will be decorated according to activeAppearance\n * * inactive: the avatar will be reduced in size and partially transparent\n * * unset: normal display\n *\n * @default unset\n */\n active?: 'active' | 'inactive' | 'unset';\n\n /**\n * The appearance when `active=\"active\"`\n *\n * @default ring\n */\n activeAppearance?: 'ring' | 'shadow' | 'ring-shadow';\n\n /**\n * The color when displaying either an icon or initials.\n * * neutral (default): gray\n * * brand: color from the brand palette\n * * colorful: picks a color from a set of pre-defined colors, based on a hash of the name (or idForColor if provided)\n * * [AvatarNamedColor]: a specific color from the theme\n *\n * @default neutral\n */\n color?: 'neutral' | 'brand' | 'colorful' | AvatarNamedColor;\n\n /**\n * Specify a string to be used instead of the name, to determine which color to use when color=\"colorful\".\n * Use this when a name is not available, but there is another unique identifier that can be used instead.\n */\n idForColor?: string | undefined;\n\n /**\n * The name of the person or entity represented by this Avatar. This should always be provided if it is available.\n *\n * The name is used to determine the initials displayed when there is no image. It is also provided to\n * accessibility tools.\n */\n name?: string;\n\n /**\n * The avatar can have a circular or square shape.\n * @default circular\n */\n shape?: 'circular' | 'square';\n\n /**\n * Size of the avatar in pixels.\n *\n * Size is restricted to a limited set of supported values recommended for most uses (see `AvatarSizeValue`) and\n * based on design guidelines for the Avatar control.\n *\n * Note: At size 16, if initials are displayed, only the first initial will be rendered.\n *\n * If a non-supported size is neeeded, set `size` to the next-smaller supported size, and set `width` and `height`\n * to override the rendered size.\n *\n * For example, to set the avatar to 45px in size:\n * `<Avatar size={40} style={{ width: '45px', height: '45px' }} />`\n *\n * @default 32\n */\n size?: AvatarSize;\n};\n\n/**\n * State used in rendering Avatar\n */\nexport type AvatarState = ComponentState<AvatarSlots> &\n Required<Pick<AvatarProps, 'active' | 'activeAppearance' | 'shape' | 'size'>> & {\n /**\n * The Avatar's color, it matches props.color but with `'colorful'` resolved to a named color\n */\n color: NonNullable<Exclude<AvatarProps['color'], 'colorful'>>;\n\n /**\n * Hidden span to render the active state label for the purposes of including in the aria-labelledby, if needed.\n */\n activeAriaLabelElement?: JSX.Element;\n };\n"],"mappings":"AAAA"}
1
+ {"version":3,"names":[],"sources":["../../../src/components/Avatar/Avatar.types.ts"],"sourcesContent":["import { PresenceBadge } from '@fluentui/react-badge';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\n/**\n * Sizes for the avatar\n * @deprecated use AvatarSize instead\n */\nexport type AvatarSizes = AvatarSize;\n/**\n * Sizes for the avatar\n */\nexport type AvatarSize = 16 | 20 | 24 | 28 | 32 | 36 | 40 | 48 | 56 | 64 | 72 | 96 | 120 | 128;\n\n/**\n * Shape of the avatar\n */\nexport type AvatarShape = 'circular' | 'square';\n\nexport type AvatarSlots = {\n root: Slot<'span'>;\n\n /**\n * The Avatar's image.\n *\n * Usage e.g.: `image={{ src: '...' }}`\n */\n image?: Slot<'img'>;\n\n /**\n * (optional) Custom initials.\n *\n * It is usually not necessary to specify custom initials; by default they will be derived from the `name` prop,\n * using the `getInitials` function.\n *\n * The initials are displayed when there is no image (including while the image is loading).\n */\n initials?: Slot<'span'>;\n\n /**\n * Icon to be displayed when the avatar doesn't have an image or initials.\n *\n * @default `PersonRegular` (the default icon's size depends on the Avatar's size)\n */\n icon?: Slot<'span'>;\n\n /**\n * Badge to show the avatar's presence status.\n */\n badge?: Slot<typeof PresenceBadge>;\n};\n\n/**\n * A specific named color for the Avatar\n */\nexport type AvatarNamedColor =\n | 'dark-red'\n | 'cranberry'\n | 'red'\n | 'pumpkin'\n | 'peach'\n | 'marigold'\n | 'gold'\n | 'brass'\n | 'brown'\n | 'forest'\n | 'seafoam'\n | 'dark-green'\n | 'light-teal'\n | 'teal'\n | 'steel'\n | 'blue'\n | 'royal-blue'\n | 'cornflower'\n | 'navy'\n | 'lavender'\n | 'purple'\n | 'grape'\n | 'lilac'\n | 'pink'\n | 'magenta'\n | 'plum'\n | 'beige'\n | 'mink'\n | 'platinum'\n | 'anchor';\n\n/**\n * Properties for Avatar\n */\nexport type AvatarProps = Omit<ComponentProps<AvatarSlots>, 'color'> & {\n /**\n * Optional activity indicator\n * * active: the avatar will be decorated according to activeAppearance\n * * inactive: the avatar will be reduced in size and partially transparent\n * * unset: normal display\n *\n * @default unset\n */\n active?: 'active' | 'inactive' | 'unset';\n\n /**\n * The appearance when `active=\"active\"`\n *\n * @default ring\n */\n activeAppearance?: 'ring' | 'shadow' | 'ring-shadow';\n\n /**\n * The color when displaying either an icon or initials.\n * * neutral (default): gray\n * * brand: color from the brand palette\n * * colorful: picks a color from a set of pre-defined colors, based on a hash of the name (or idForColor if provided)\n * * [AvatarNamedColor]: a specific color from the theme\n *\n * @default neutral\n */\n color?: 'neutral' | 'brand' | 'colorful' | AvatarNamedColor;\n\n /**\n * Specify a string to be used instead of the name, to determine which color to use when color=\"colorful\".\n * Use this when a name is not available, but there is another unique identifier that can be used instead.\n */\n idForColor?: string | undefined;\n\n /**\n * The name of the person or entity represented by this Avatar. This should always be provided if it is available.\n *\n * The name is used to determine the initials displayed when there is no image. It is also provided to\n * accessibility tools.\n */\n name?: string;\n\n /**\n * The avatar can have a circular or square shape.\n * @default circular\n */\n shape?: AvatarShape;\n\n /**\n * Size of the avatar in pixels.\n *\n * Size is restricted to a limited set of supported values recommended for most uses (see `AvatarSizeValue`) and\n * based on design guidelines for the Avatar control.\n *\n * Note: At size 16, if initials are displayed, only the first initial will be rendered.\n *\n * If a non-supported size is neeeded, set `size` to the next-smaller supported size, and set `width` and `height`\n * to override the rendered size.\n *\n * For example, to set the avatar to 45px in size:\n * `<Avatar size={40} style={{ width: '45px', height: '45px' }} />`\n *\n * @default 32\n */\n size?: AvatarSize;\n};\n\n/**\n * State used in rendering Avatar\n */\nexport type AvatarState = ComponentState<AvatarSlots> &\n Required<Pick<AvatarProps, 'active' | 'activeAppearance' | 'shape' | 'size'>> & {\n /**\n * The Avatar's color, it matches props.color but with `'colorful'` resolved to a named color\n */\n color: NonNullable<Exclude<AvatarProps['color'], 'colorful'>>;\n\n /**\n * Hidden span to render the active state label for the purposes of including in the aria-labelledby, if needed.\n */\n activeAriaLabelElement?: JSX.Element;\n };\n"],"mappings":"AAAA"}
@@ -2,5 +2,5 @@ export * from './Avatar.types';
2
2
  export * from './Avatar';
3
3
  export * from './renderAvatar';
4
4
  export * from './useAvatar';
5
- export * from './useAvatarStyles';
5
+ export * from './useAvatarStyles.styles';
6
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../src/components/Avatar/index.ts"],"sourcesContent":["export * from './Avatar.types';\nexport * from './Avatar';\nexport * from './renderAvatar';\nexport * from './useAvatar';\nexport * from './useAvatarStyles';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
1
+ {"version":3,"names":[],"sources":["../../../src/components/Avatar/index.ts"],"sourcesContent":["export * from './Avatar.types';\nexport * from './Avatar';\nexport * from './renderAvatar';\nexport * from './useAvatar';\nexport * from './useAvatarStyles.styles';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
@@ -1,10 +1,10 @@
1
- import * as React from 'react';
2
- import { getSlots } from '@fluentui/react-utilities';
1
+ /** @jsxRuntime classic */ /** @jsx createElement */import { createElement } from '@fluentui/react-jsx-runtime';
2
+ import { getSlotsNext } from '@fluentui/react-utilities';
3
3
  export const renderAvatar_unstable = state => {
4
4
  const {
5
5
  slots,
6
6
  slotProps
7
- } = getSlots(state);
8
- return /*#__PURE__*/React.createElement(slots.root, slotProps.root, slots.initials && /*#__PURE__*/React.createElement(slots.initials, slotProps.initials), slots.icon && /*#__PURE__*/React.createElement(slots.icon, slotProps.icon), slots.image && /*#__PURE__*/React.createElement(slots.image, slotProps.image), slots.badge && /*#__PURE__*/React.createElement(slots.badge, slotProps.badge), state.activeAriaLabelElement);
7
+ } = getSlotsNext(state);
8
+ return /*#__PURE__*/createElement(slots.root, slotProps.root, slots.initials && /*#__PURE__*/createElement(slots.initials, slotProps.initials), slots.icon && /*#__PURE__*/createElement(slots.icon, slotProps.icon), slots.image && /*#__PURE__*/createElement(slots.image, slotProps.image), slots.badge && /*#__PURE__*/createElement(slots.badge, slotProps.badge), state.activeAriaLabelElement);
9
9
  };
10
10
  //# sourceMappingURL=renderAvatar.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","getSlots","renderAvatar_unstable","state","slots","slotProps","createElement","root","initials","icon","image","badge","activeAriaLabelElement"],"sources":["../../../src/components/Avatar/renderAvatar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { AvatarSlots, AvatarState } from './Avatar.types';\n\nexport const renderAvatar_unstable = (state: AvatarState) => {\n const { slots, slotProps } = getSlots<AvatarSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {slots.initials && <slots.initials {...slotProps.initials} />}\n {slots.icon && <slots.icon {...slotProps.icon} />}\n {slots.image && <slots.image {...slotProps.image} />}\n {slots.badge && <slots.badge {...slotProps.badge} />}\n {state.activeAriaLabelElement}\n </slots.root>\n );\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,QAAQ,QAAQ;AAGzB,OAAO,MAAMC,qBAAA,GAAyBC,KAAA,IAAuB;EAC3D,MAAM;IAAEC,KAAA;IAAOC;EAAS,CAAE,GAAGJ,QAAA,CAAsBE,KAAA;EAEnD,oBACEH,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMG,IAAI,EAAKF,SAAA,CAAUE,IAAI,EAC3BH,KAAA,CAAMI,QAAQ,iBAAIR,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMI,QAAQ,EAAKH,SAAA,CAAUG,QAAQ,GACxDJ,KAAA,CAAMK,IAAI,iBAAIT,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMK,IAAI,EAAKJ,SAAA,CAAUI,IAAI,GAC5CL,KAAA,CAAMM,KAAK,iBAAIV,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMM,KAAK,EAAKL,SAAA,CAAUK,KAAK,GAC/CN,KAAA,CAAMO,KAAK,iBAAIX,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMO,KAAK,EAAKN,SAAA,CAAUM,KAAK,GAC/CR,KAAA,CAAMS,sBAAsB;AAGnC"}
1
+ {"version":3,"names":["createElement","getSlotsNext","renderAvatar_unstable","state","slots","slotProps","root","initials","icon","image","badge","activeAriaLabelElement"],"sources":["../../../src/components/Avatar/renderAvatar.tsx"],"sourcesContent":["/** @jsxRuntime classic */\n/** @jsx createElement */\n\nimport { createElement } from '@fluentui/react-jsx-runtime';\n\nimport { getSlotsNext } from '@fluentui/react-utilities';\nimport type { AvatarSlots, AvatarState } from './Avatar.types';\n\nexport const renderAvatar_unstable = (state: AvatarState) => {\n const { slots, slotProps } = getSlotsNext<AvatarSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {slots.initials && <slots.initials {...slotProps.initials} />}\n {slots.icon && <slots.icon {...slotProps.icon} />}\n {slots.image && <slots.image {...slotProps.image} />}\n {slots.badge && <slots.badge {...slotProps.badge} />}\n {state.activeAriaLabelElement}\n </slots.root>\n );\n};\n"],"mappings":"AAAA,2BACA,yBAEA,SAASA,aAAa,QAAQ;AAE9B,SAASC,YAAY,QAAQ;AAG7B,OAAO,MAAMC,qBAAA,GAAyBC,KAAA,IAAuB;EAC3D,MAAM;IAAEC,KAAA;IAAOC;EAAS,CAAE,GAAGJ,YAAA,CAA0BE,KAAA;EAEvD,oBACEH,aAXJ,CAWKI,KAAA,CAAME,IAAI,EAAKD,SAAA,CAAUC,IAAI,EAC3BF,KAAA,CAAMG,QAAQ,iBAAIP,aAZzB,CAY0BI,KAAA,CAAMG,QAAQ,EAAKF,SAAA,CAAUE,QAAQ,GACxDH,KAAA,CAAMI,IAAI,iBAAIR,aAbrB,CAasBI,KAAA,CAAMI,IAAI,EAAKH,SAAA,CAAUG,IAAI,GAC5CJ,KAAA,CAAMK,KAAK,iBAAIT,aAdtB,CAcuBI,KAAA,CAAMK,KAAK,EAAKJ,SAAA,CAAUI,KAAK,GAC/CL,KAAA,CAAMM,KAAK,iBAAIV,aAftB,CAeuBI,KAAA,CAAMM,KAAK,EAAKL,SAAA,CAAUK,KAAK,GAC/CP,KAAA,CAAMQ,sBAAsB;AAGnC"}
@@ -14,12 +14,13 @@ export const useAvatar_unstable = (props, ref) => {
14
14
  dir
15
15
  } = useFluent();
16
16
  const {
17
+ shape: contextShape,
17
18
  size: contextSize
18
19
  } = useAvatarContext();
19
20
  const {
20
21
  name,
21
22
  size = contextSize !== null && contextSize !== void 0 ? contextSize : 32,
22
- shape = 'circular',
23
+ shape = contextShape !== null && contextShape !== void 0 ? contextShape : 'circular',
23
24
  active = 'unset',
24
25
  activeAppearance = 'ring',
25
26
  idForColor
@@ -1 +1 @@
1
- {"version":3,"names":["React","getNativeElementProps","mergeCallbacks","resolveShorthand","useId","getInitials","PersonRegular","PresenceBadge","useFluent_unstable","useFluent","useAvatarContext","DEFAULT_STRINGS","active","inactive","useAvatar_unstable","props","ref","dir","size","contextSize","name","shape","activeAppearance","idForColor","color","_ref","avatarColors","getHashCode","length","baseId","root","role","id","imageHidden","setImageHidden","useState","undefined","image","defaultProps","alt","hidden","onError","onLoad","initials","required","children","firstInitialOnly","icon","createElement","badge","getBadgeSize","activeAriaLabelElement","activeText","activeId","components","str","hashCode","len","ch","charCodeAt","shift"],"sources":["../../../src/components/Avatar/useAvatar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, mergeCallbacks, resolveShorthand, useId } from '@fluentui/react-utilities';\nimport { getInitials } from '../../utils/index';\nimport type { AvatarNamedColor, AvatarProps, AvatarState } from './Avatar.types';\nimport { PersonRegular } from '@fluentui/react-icons';\nimport { PresenceBadge } from '@fluentui/react-badge';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useAvatarContext } from '../../contexts/AvatarContext';\n\nexport const DEFAULT_STRINGS = {\n active: 'active',\n inactive: 'inactive',\n};\n\nexport const useAvatar_unstable = (props: AvatarProps, ref: React.Ref<HTMLElement>): AvatarState => {\n const { dir } = useFluent();\n const { size: contextSize } = useAvatarContext();\n const {\n name,\n size = contextSize ?? (32 as const),\n shape = 'circular',\n active = 'unset',\n activeAppearance = 'ring',\n idForColor,\n } = props;\n let { color = 'neutral' } = props;\n\n // Resolve 'colorful' to a specific color name\n if (color === 'colorful') {\n color = avatarColors[getHashCode(idForColor ?? name ?? '') % avatarColors.length];\n }\n\n const baseId = useId('avatar-');\n\n const root: AvatarState['root'] = getNativeElementProps(\n 'span',\n {\n role: 'img',\n id: baseId,\n // aria-label and/or aria-labelledby are resolved below\n ...props,\n ref,\n },\n /* excludedPropNames: */ ['name'],\n );\n\n const [imageHidden, setImageHidden] = React.useState<true | undefined>(undefined);\n const image: AvatarState['image'] = resolveShorthand(props.image, {\n defaultProps: {\n alt: '',\n role: 'presentation',\n 'aria-hidden': true,\n hidden: imageHidden,\n },\n });\n\n // Hide the image if it fails to load and restore it on a successful load\n if (image) {\n image.onError = mergeCallbacks(image.onError, () => setImageHidden(true));\n image.onLoad = mergeCallbacks(image.onLoad, () => setImageHidden(undefined));\n }\n\n // Resolve the initials slot, defaulted to getInitials.\n let initials: AvatarState['initials'] = resolveShorthand(props.initials, {\n required: true,\n defaultProps: {\n children: getInitials(name, dir === 'rtl', { firstInitialOnly: size <= 16 }),\n id: baseId + '__initials',\n },\n });\n\n // Don't render the initials slot if it's empty\n if (!initials?.children) {\n initials = undefined;\n }\n\n // Render the icon slot *only if* there aren't any initials or image to display\n let icon: AvatarState['icon'] = undefined;\n if (!initials && (!image || imageHidden)) {\n icon = resolveShorthand(props.icon, {\n required: true,\n defaultProps: {\n children: <PersonRegular />,\n 'aria-hidden': true,\n },\n });\n }\n\n const badge: AvatarState['badge'] = resolveShorthand(props.badge, {\n defaultProps: {\n size: getBadgeSize(size),\n id: baseId + '__badge',\n },\n });\n\n let activeAriaLabelElement: AvatarState['activeAriaLabelElement'];\n\n // Resolve aria-label and/or aria-labelledby if not provided by the user\n if (!root['aria-label'] && !root['aria-labelledby']) {\n if (name) {\n root['aria-label'] = name;\n\n // Include the badge in labelledby if it exists\n if (badge) {\n root['aria-labelledby'] = root.id + ' ' + badge.id;\n }\n } else if (initials) {\n // root's aria-label should be the name, but fall back to being labelledby the initials if name is missing\n root['aria-labelledby'] = initials.id + (badge ? ' ' + badge.id : '');\n }\n\n // Add the active state to the aria label\n if (active === 'active' || active === 'inactive') {\n const activeText = DEFAULT_STRINGS[active];\n if (root['aria-labelledby']) {\n // If using aria-labelledby, render a hidden span and append it to the labelledby\n const activeId = baseId + '__active';\n root['aria-labelledby'] += ' ' + activeId;\n activeAriaLabelElement = (\n <span hidden id={activeId}>\n {activeText}\n </span>\n );\n } else if (root['aria-label']) {\n // Otherwise, just append it to the aria-label\n root['aria-label'] += ' ' + activeText;\n }\n }\n }\n\n return {\n size,\n shape,\n active,\n activeAppearance,\n activeAriaLabelElement,\n color,\n\n components: {\n root: 'span',\n initials: 'span',\n icon: 'span',\n image: 'img',\n badge: PresenceBadge,\n },\n\n root,\n initials,\n icon,\n image,\n badge,\n };\n};\n\nconst getBadgeSize = (size: AvatarState['size']) => {\n if (size >= 96) {\n return 'extra-large';\n } else if (size >= 64) {\n return 'large';\n } else if (size >= 56) {\n return 'medium';\n } else if (size >= 40) {\n return 'small';\n } else if (size >= 28) {\n return 'extra-small';\n } else {\n return 'tiny';\n }\n};\n\nconst avatarColors: AvatarNamedColor[] = [\n 'dark-red',\n 'cranberry',\n 'red',\n 'pumpkin',\n 'peach',\n 'marigold',\n 'gold',\n 'brass',\n 'brown',\n 'forest',\n 'seafoam',\n 'dark-green',\n 'light-teal',\n 'teal',\n 'steel',\n 'blue',\n 'royal-blue',\n 'cornflower',\n 'navy',\n 'lavender',\n 'purple',\n 'grape',\n 'lilac',\n 'pink',\n 'magenta',\n 'plum',\n 'beige',\n 'mink',\n 'platinum',\n 'anchor',\n];\n\nconst getHashCode = (str: string): number => {\n let hashCode = 0;\n for (let len: number = str.length - 1; len >= 0; len--) {\n const ch = str.charCodeAt(len);\n const shift = len % 8;\n hashCode ^= (ch << shift) + (ch >> (8 - shift)); // eslint-disable-line no-bitwise\n }\n\n return hashCode;\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,qBAAqB,EAAEC,cAAc,EAAEC,gBAAgB,EAAEC,KAAK,QAAQ;AAC/E,SAASC,WAAW,QAAQ;AAE5B,SAASC,aAAa,QAAQ;AAC9B,SAASC,aAAa,QAAQ;AAC9B,SAASC,kBAAA,IAAsBC,SAAS,QAAQ;AAChD,SAASC,gBAAgB,QAAQ;AAEjC,OAAO,MAAMC,eAAA,GAAkB;EAC7BC,MAAA,EAAQ;EACRC,QAAA,EAAU;AACZ;AAEA,OAAO,MAAMC,kBAAA,GAAqBA,CAACC,KAAA,EAAoBC,GAAA,KAA6C;EAClG,MAAM;IAAEC;EAAG,CAAE,GAAGR,SAAA;EAChB,MAAM;IAAES,IAAA,EAAMC;EAAW,CAAE,GAAGT,gBAAA;EAC9B,MAAM;IACJU,IAAA;IACAF,IAAA,GAAOC,WAAA,aAAAA,WAAA,cAAAA,WAAA,GAAgB,EAAY;IACnCE,KAAA,GAAQ;IACRT,MAAA,GAAS;IACTU,gBAAA,GAAmB;IACnBC;EAAU,CACX,GAAGR,KAAA;EACJ,IAAI;IAAES,KAAA,GAAQ;EAAS,CAAE,GAA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B,MAAMG,KAAA,GAAQH,GAAA,GAAM;IACpBD,QAAA,IAAY,CAACE,EAAA,IAAME,KAAI,KAAMF,EAAA,IAAO,IAAIE,KAAK,GAAI;EACnD;;EAEA,OAAOJ,QAAA;AACT"}
1
+ {"version":3,"names":["React","getNativeElementProps","mergeCallbacks","resolveShorthand","useId","getInitials","PersonRegular","PresenceBadge","useFluent_unstable","useFluent","useAvatarContext","DEFAULT_STRINGS","active","inactive","useAvatar_unstable","props","ref","dir","shape","contextShape","size","contextSize","name","activeAppearance","idForColor","color","_ref","avatarColors","getHashCode","length","baseId","root","role","id","imageHidden","setImageHidden","useState","undefined","image","defaultProps","alt","hidden","onError","onLoad","initials","required","children","firstInitialOnly","icon","createElement","badge","getBadgeSize","activeAriaLabelElement","activeText","activeId","components","str","hashCode","len","ch","charCodeAt","shift"],"sources":["../../../src/components/Avatar/useAvatar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, mergeCallbacks, resolveShorthand, useId } from '@fluentui/react-utilities';\nimport { getInitials } from '../../utils/index';\nimport type { AvatarNamedColor, AvatarProps, AvatarState } from './Avatar.types';\nimport { PersonRegular } from '@fluentui/react-icons';\nimport { PresenceBadge } from '@fluentui/react-badge';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useAvatarContext } from '../../contexts/AvatarContext';\n\nexport const DEFAULT_STRINGS = {\n active: 'active',\n inactive: 'inactive',\n};\n\nexport const useAvatar_unstable = (props: AvatarProps, ref: React.Ref<HTMLElement>): AvatarState => {\n const { dir } = useFluent();\n const { shape: contextShape, size: contextSize } = useAvatarContext();\n const {\n name,\n size = contextSize ?? (32 as const),\n shape = contextShape ?? 'circular',\n active = 'unset',\n activeAppearance = 'ring',\n idForColor,\n } = props;\n let { color = 'neutral' } = props;\n\n // Resolve 'colorful' to a specific color name\n if (color === 'colorful') {\n color = avatarColors[getHashCode(idForColor ?? name ?? '') % avatarColors.length];\n }\n\n const baseId = useId('avatar-');\n\n const root: AvatarState['root'] = getNativeElementProps(\n 'span',\n {\n role: 'img',\n id: baseId,\n // aria-label and/or aria-labelledby are resolved below\n ...props,\n ref,\n },\n /* excludedPropNames: */ ['name'],\n );\n\n const [imageHidden, setImageHidden] = React.useState<true | undefined>(undefined);\n const image: AvatarState['image'] = resolveShorthand(props.image, {\n defaultProps: {\n alt: '',\n role: 'presentation',\n 'aria-hidden': true,\n hidden: imageHidden,\n },\n });\n\n // Hide the image if it fails to load and restore it on a successful load\n if (image) {\n image.onError = mergeCallbacks(image.onError, () => setImageHidden(true));\n image.onLoad = mergeCallbacks(image.onLoad, () => setImageHidden(undefined));\n }\n\n // Resolve the initials slot, defaulted to getInitials.\n let initials: AvatarState['initials'] = resolveShorthand(props.initials, {\n required: true,\n defaultProps: {\n children: getInitials(name, dir === 'rtl', { firstInitialOnly: size <= 16 }),\n id: baseId + '__initials',\n },\n });\n\n // Don't render the initials slot if it's empty\n if (!initials?.children) {\n initials = undefined;\n }\n\n // Render the icon slot *only if* there aren't any initials or image to display\n let icon: AvatarState['icon'] = undefined;\n if (!initials && (!image || imageHidden)) {\n icon = resolveShorthand(props.icon, {\n required: true,\n defaultProps: {\n children: <PersonRegular />,\n 'aria-hidden': true,\n },\n });\n }\n\n const badge: AvatarState['badge'] = resolveShorthand(props.badge, {\n defaultProps: {\n size: getBadgeSize(size),\n id: baseId + '__badge',\n },\n });\n\n let activeAriaLabelElement: AvatarState['activeAriaLabelElement'];\n\n // Resolve aria-label and/or aria-labelledby if not provided by the user\n if (!root['aria-label'] && !root['aria-labelledby']) {\n if (name) {\n root['aria-label'] = name;\n\n // Include the badge in labelledby if it exists\n if (badge) {\n root['aria-labelledby'] = root.id + ' ' + badge.id;\n }\n } else if (initials) {\n // root's aria-label should be the name, but fall back to being labelledby the initials if name is missing\n root['aria-labelledby'] = initials.id + (badge ? ' ' + badge.id : '');\n }\n\n // Add the active state to the aria label\n if (active === 'active' || active === 'inactive') {\n const activeText = DEFAULT_STRINGS[active];\n if (root['aria-labelledby']) {\n // If using aria-labelledby, render a hidden span and append it to the labelledby\n const activeId = baseId + '__active';\n root['aria-labelledby'] += ' ' + activeId;\n activeAriaLabelElement = (\n <span hidden id={activeId}>\n {activeText}\n </span>\n );\n } else if (root['aria-label']) {\n // Otherwise, just append it to the aria-label\n root['aria-label'] += ' ' + activeText;\n }\n }\n }\n\n return {\n size,\n shape,\n active,\n activeAppearance,\n activeAriaLabelElement,\n color,\n\n components: {\n root: 'span',\n initials: 'span',\n icon: 'span',\n image: 'img',\n badge: PresenceBadge,\n },\n\n root,\n initials,\n icon,\n image,\n badge,\n };\n};\n\nconst getBadgeSize = (size: AvatarState['size']) => {\n if (size >= 96) {\n return 'extra-large';\n } else if (size >= 64) {\n return 'large';\n } else if (size >= 56) {\n return 'medium';\n } else if (size >= 40) {\n return 'small';\n } else if (size >= 28) {\n return 'extra-small';\n } else {\n return 'tiny';\n }\n};\n\nconst avatarColors: AvatarNamedColor[] = [\n 'dark-red',\n 'cranberry',\n 'red',\n 'pumpkin',\n 'peach',\n 'marigold',\n 'gold',\n 'brass',\n 'brown',\n 'forest',\n 'seafoam',\n 'dark-green',\n 'light-teal',\n 'teal',\n 'steel',\n 'blue',\n 'royal-blue',\n 'cornflower',\n 'navy',\n 'lavender',\n 'purple',\n 'grape',\n 'lilac',\n 'pink',\n 'magenta',\n 'plum',\n 'beige',\n 'mink',\n 'platinum',\n 'anchor',\n];\n\nconst getHashCode = (str: string): number => {\n let hashCode = 0;\n for (let len: number = str.length - 1; len >= 0; len--) {\n const ch = str.charCodeAt(len);\n const shift = len % 8;\n hashCode ^= (ch << shift) + (ch >> (8 - shift)); // eslint-disable-line no-bitwise\n }\n\n return hashCode;\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,qBAAqB,EAAEC,cAAc,EAAEC,gBAAgB,EAAEC,KAAK,QAAQ;AAC/E,SAASC,WAAW,QAAQ;AAE5B,SAASC,aAAa,QAAQ;AAC9B,SAASC,aAAa,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