@fluentui/react-avatar 9.2.5 → 9.2.7

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 (90) hide show
  1. package/CHANGELOG.json +155 -1
  2. package/CHANGELOG.md +38 -2
  3. package/README-AvatarGroup.md +0 -10
  4. package/dist/index.d.ts +35 -4
  5. package/lib/components/Avatar/useAvatarStyles.js +83 -87
  6. package/lib/components/Avatar/useAvatarStyles.js.map +1 -1
  7. package/lib/index.js +1 -1
  8. package/lib/index.js.map +1 -1
  9. package/lib-amd/Avatar.js +6 -0
  10. package/lib-amd/Avatar.js.map +1 -0
  11. package/lib-amd/AvatarGroup.js +6 -0
  12. package/lib-amd/AvatarGroup.js.map +1 -0
  13. package/lib-amd/AvatarGroupItem.js +6 -0
  14. package/lib-amd/AvatarGroupItem.js.map +1 -0
  15. package/lib-amd/AvatarGroupPopover.js +6 -0
  16. package/lib-amd/AvatarGroupPopover.js.map +1 -0
  17. package/lib-amd/components/Avatar/Avatar.js +12 -0
  18. package/lib-amd/components/Avatar/Avatar.js.map +1 -0
  19. package/lib-amd/components/Avatar/Avatar.types.js +5 -0
  20. package/lib-amd/components/Avatar/Avatar.types.js.map +1 -0
  21. package/lib-amd/components/Avatar/index.js +10 -0
  22. package/lib-amd/components/Avatar/index.js.map +1 -0
  23. package/lib-amd/components/Avatar/renderAvatar.js +16 -0
  24. package/lib-amd/components/Avatar/renderAvatar.js.map +1 -0
  25. package/lib-amd/components/Avatar/useAvatar.js +175 -0
  26. package/lib-amd/components/Avatar/useAvatar.js.map +1 -0
  27. package/lib-amd/components/Avatar/useAvatarStyles.js +390 -0
  28. package/lib-amd/components/Avatar/useAvatarStyles.js.map +1 -0
  29. package/lib-amd/components/AvatarGroup/AvatarGroup.js +17 -0
  30. package/lib-amd/components/AvatarGroup/AvatarGroup.js.map +1 -0
  31. package/lib-amd/components/AvatarGroup/AvatarGroup.types.js +5 -0
  32. package/lib-amd/components/AvatarGroup/AvatarGroup.types.js.map +1 -0
  33. package/lib-amd/components/AvatarGroup/index.js +11 -0
  34. package/lib-amd/components/AvatarGroup/index.js.map +1 -0
  35. package/lib-amd/components/AvatarGroup/renderAvatarGroup.js +15 -0
  36. package/lib-amd/components/AvatarGroup/renderAvatarGroup.js.map +1 -0
  37. package/lib-amd/components/AvatarGroup/useAvatarGroup.js +29 -0
  38. package/lib-amd/components/AvatarGroup/useAvatarGroup.js.map +1 -0
  39. package/lib-amd/components/AvatarGroup/useAvatarGroupContextValues.js +15 -0
  40. package/lib-amd/components/AvatarGroup/useAvatarGroupContextValues.js.map +1 -0
  41. package/lib-amd/components/AvatarGroup/useAvatarGroupStyles.js +36 -0
  42. package/lib-amd/components/AvatarGroup/useAvatarGroupStyles.js.map +1 -0
  43. package/lib-amd/components/AvatarGroupItem/AvatarGroupItem.js +16 -0
  44. package/lib-amd/components/AvatarGroupItem/AvatarGroupItem.js.map +1 -0
  45. package/lib-amd/components/AvatarGroupItem/AvatarGroupItem.types.js +5 -0
  46. package/lib-amd/components/AvatarGroupItem/AvatarGroupItem.types.js.map +1 -0
  47. package/lib-amd/components/AvatarGroupItem/index.js +10 -0
  48. package/lib-amd/components/AvatarGroupItem/index.js.map +1 -0
  49. package/lib-amd/components/AvatarGroupItem/renderAvatarGroupItem.js +16 -0
  50. package/lib-amd/components/AvatarGroupItem/renderAvatarGroupItem.js.map +1 -0
  51. package/lib-amd/components/AvatarGroupItem/useAvatarGroupItem.js +58 -0
  52. package/lib-amd/components/AvatarGroupItem/useAvatarGroupItem.js.map +1 -0
  53. package/lib-amd/components/AvatarGroupItem/useAvatarGroupItemStyles.js +206 -0
  54. package/lib-amd/components/AvatarGroupItem/useAvatarGroupItemStyles.js.map +1 -0
  55. package/lib-amd/components/AvatarGroupPopover/AvatarGroupPopover.js +17 -0
  56. package/lib-amd/components/AvatarGroupPopover/AvatarGroupPopover.js.map +1 -0
  57. package/lib-amd/components/AvatarGroupPopover/AvatarGroupPopover.types.js +5 -0
  58. package/lib-amd/components/AvatarGroupPopover/AvatarGroupPopover.types.js.map +1 -0
  59. package/lib-amd/components/AvatarGroupPopover/index.js +10 -0
  60. package/lib-amd/components/AvatarGroupPopover/index.js.map +1 -0
  61. package/lib-amd/components/AvatarGroupPopover/renderAvatarGroupPopover.js +20 -0
  62. package/lib-amd/components/AvatarGroupPopover/renderAvatarGroupPopover.js.map +1 -0
  63. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopover.js +86 -0
  64. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopover.js.map +1 -0
  65. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js +14 -0
  66. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js.map +1 -0
  67. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.js +136 -0
  68. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.js.map +1 -0
  69. package/lib-amd/contexts/AvatarContext.js +17 -0
  70. package/lib-amd/contexts/AvatarContext.js.map +1 -0
  71. package/lib-amd/contexts/AvatarGroupContext.js +20 -0
  72. package/lib-amd/contexts/AvatarGroupContext.js.map +1 -0
  73. package/lib-amd/contexts/index.js +7 -0
  74. package/lib-amd/contexts/index.js.map +1 -0
  75. package/lib-amd/index.js +33 -0
  76. package/lib-amd/index.js.map +1 -0
  77. package/lib-amd/utils/getInitials.js +87 -0
  78. package/lib-amd/utils/getInitials.js.map +1 -0
  79. package/lib-amd/utils/index.js +8 -0
  80. package/lib-amd/utils/index.js.map +1 -0
  81. package/lib-amd/utils/partitionAvatarGroupItems.js +32 -0
  82. package/lib-amd/utils/partitionAvatarGroupItems.js.map +1 -0
  83. package/lib-commonjs/components/Avatar/useAvatarStyles.js +83 -87
  84. package/lib-commonjs/components/Avatar/useAvatarStyles.js.map +1 -1
  85. package/lib-commonjs/index.js +9 -9
  86. package/lib-commonjs/index.js.map +1 -1
  87. package/package.json +14 -13
  88. package/MIGRATION.md +0 -106
  89. package/SPEC-AvatarGroup.md +0 -203
  90. package/SPEC.md +0 -172
package/CHANGELOG.json CHANGED
@@ -2,7 +2,161 @@
2
2
  "name": "@fluentui/react-avatar",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 02 Nov 2022 11:54:48 GMT",
5
+ "date": "Thu, 17 Nov 2022 23:02:31 GMT",
6
+ "tag": "@fluentui/react-avatar_v9.2.7",
7
+ "version": "9.2.7",
8
+ "comments": {
9
+ "none": [
10
+ {
11
+ "author": "martinhochel@microsoft.com",
12
+ "package": "@fluentui/react-avatar",
13
+ "commit": "ea768501802d65d63ddc63fff3816fb6b5008ae4",
14
+ "comment": "chore: update package scaffold"
15
+ }
16
+ ],
17
+ "patch": [
18
+ {
19
+ "author": "beachball",
20
+ "package": "@fluentui/react-avatar",
21
+ "comment": "Bump @fluentui/react-badge to v9.0.13",
22
+ "commit": "94e156be5d3b5790d82dccf08c32672733fb9335"
23
+ },
24
+ {
25
+ "author": "beachball",
26
+ "package": "@fluentui/react-avatar",
27
+ "comment": "Bump @fluentui/react-context-selector to v9.1.2",
28
+ "commit": "94e156be5d3b5790d82dccf08c32672733fb9335"
29
+ },
30
+ {
31
+ "author": "beachball",
32
+ "package": "@fluentui/react-avatar",
33
+ "comment": "Bump @fluentui/react-popover to v9.3.2",
34
+ "commit": "94e156be5d3b5790d82dccf08c32672733fb9335"
35
+ },
36
+ {
37
+ "author": "beachball",
38
+ "package": "@fluentui/react-avatar",
39
+ "comment": "Bump @fluentui/react-tabster to v9.3.1",
40
+ "commit": "94e156be5d3b5790d82dccf08c32672733fb9335"
41
+ },
42
+ {
43
+ "author": "beachball",
44
+ "package": "@fluentui/react-avatar",
45
+ "comment": "Bump @fluentui/react-tooltip to v9.1.2",
46
+ "commit": "94e156be5d3b5790d82dccf08c32672733fb9335"
47
+ },
48
+ {
49
+ "author": "beachball",
50
+ "package": "@fluentui/react-avatar",
51
+ "comment": "Bump @fluentui/react-utilities to v9.2.2",
52
+ "commit": "94e156be5d3b5790d82dccf08c32672733fb9335"
53
+ }
54
+ ]
55
+ }
56
+ },
57
+ {
58
+ "date": "Fri, 11 Nov 2022 14:57:52 GMT",
59
+ "tag": "@fluentui/react-avatar_v9.2.6",
60
+ "version": "9.2.6",
61
+ "comments": {
62
+ "none": [
63
+ {
64
+ "author": "martinhochel@microsoft.com",
65
+ "package": "@fluentui/react-avatar",
66
+ "commit": "87859b052155ca206ef3540a2a9623803f6e2b93",
67
+ "comment": "test: replace deprecated module.parent with require.main within isConformance"
68
+ }
69
+ ],
70
+ "patch": [
71
+ {
72
+ "author": "humberto_makoto@hotmail.com",
73
+ "package": "@fluentui/react-avatar",
74
+ "commit": "81a3171e14fcaead04c6cf3fbf8eda962178b442",
75
+ "comment": "chore: Replacing use of hard-coded constants with curve and duration tokens from theme."
76
+ },
77
+ {
78
+ "author": "behowell@microsoft.com",
79
+ "package": "@fluentui/react-avatar",
80
+ "commit": "19c8608a71aa59113bea131bbbd1922125303ced",
81
+ "comment": "fix: Update Avatar active ring color to match base color"
82
+ },
83
+ {
84
+ "author": "martinhochel@microsoft.com",
85
+ "package": "@fluentui/react-avatar",
86
+ "commit": "b3907043bd8d7b650c55e8e7c3119b14f2606c38",
87
+ "comment": "fix: create valid export maps"
88
+ },
89
+ {
90
+ "author": "esteban.230@hotmail.com",
91
+ "package": "@fluentui/react-avatar",
92
+ "commit": "b932f8ce3676d1fd82a6bdc79364007c9d3b2def",
93
+ "comment": "chore: Remove AvatarGroup unstable warnings."
94
+ },
95
+ {
96
+ "author": "tristan.watanabe@gmail.com",
97
+ "package": "@fluentui/react-avatar",
98
+ "commit": "50d5f2ef0d6a06851e78f736055fcc313d61029b",
99
+ "comment": "chore: Migrate to new package structure."
100
+ },
101
+ {
102
+ "author": "beachball",
103
+ "package": "@fluentui/react-avatar",
104
+ "comment": "Bump @fluentui/react-badge to v9.0.12",
105
+ "commit": "b4c9a0ae8d7444bf746f1307ab01e2dc16310720"
106
+ },
107
+ {
108
+ "author": "beachball",
109
+ "package": "@fluentui/react-avatar",
110
+ "comment": "Bump @fluentui/react-context-selector to v9.1.1",
111
+ "commit": "b4c9a0ae8d7444bf746f1307ab01e2dc16310720"
112
+ },
113
+ {
114
+ "author": "beachball",
115
+ "package": "@fluentui/react-avatar",
116
+ "comment": "Bump @fluentui/react-popover to v9.3.1",
117
+ "commit": "b4c9a0ae8d7444bf746f1307ab01e2dc16310720"
118
+ },
119
+ {
120
+ "author": "beachball",
121
+ "package": "@fluentui/react-avatar",
122
+ "comment": "Bump @fluentui/react-shared-contexts to v9.1.1",
123
+ "commit": "b4c9a0ae8d7444bf746f1307ab01e2dc16310720"
124
+ },
125
+ {
126
+ "author": "beachball",
127
+ "package": "@fluentui/react-avatar",
128
+ "comment": "Bump @fluentui/react-tabster to v9.3.0",
129
+ "commit": "b4c9a0ae8d7444bf746f1307ab01e2dc16310720"
130
+ },
131
+ {
132
+ "author": "beachball",
133
+ "package": "@fluentui/react-avatar",
134
+ "comment": "Bump @fluentui/react-theme to v9.1.2",
135
+ "commit": "b4c9a0ae8d7444bf746f1307ab01e2dc16310720"
136
+ },
137
+ {
138
+ "author": "beachball",
139
+ "package": "@fluentui/react-avatar",
140
+ "comment": "Bump @fluentui/react-tooltip to v9.1.1",
141
+ "commit": "b4c9a0ae8d7444bf746f1307ab01e2dc16310720"
142
+ },
143
+ {
144
+ "author": "beachball",
145
+ "package": "@fluentui/react-avatar",
146
+ "comment": "Bump @fluentui/react-utilities to v9.2.1",
147
+ "commit": "b4c9a0ae8d7444bf746f1307ab01e2dc16310720"
148
+ },
149
+ {
150
+ "author": "beachball",
151
+ "package": "@fluentui/react-avatar",
152
+ "comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.18",
153
+ "commit": "b4c9a0ae8d7444bf746f1307ab01e2dc16310720"
154
+ }
155
+ ]
156
+ }
157
+ },
158
+ {
159
+ "date": "Wed, 02 Nov 2022 11:57:47 GMT",
6
160
  "tag": "@fluentui/react-avatar_v9.2.5",
7
161
  "version": "9.2.5",
8
162
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,48 @@
1
1
  # Change Log - @fluentui/react-avatar
2
2
 
3
- This log was last generated on Wed, 02 Nov 2022 11:54:48 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 17 Nov 2022 23:02:31 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.2.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-avatar_v9.2.7)
8
+
9
+ Thu, 17 Nov 2022 23:02:31 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-avatar_v9.2.6..@fluentui/react-avatar_v9.2.7)
11
+
12
+ ### Patches
13
+
14
+ - Bump @fluentui/react-badge to v9.0.13 ([PR #25683](https://github.com/microsoft/fluentui/pull/25683) by beachball)
15
+ - Bump @fluentui/react-context-selector to v9.1.2 ([PR #25683](https://github.com/microsoft/fluentui/pull/25683) by beachball)
16
+ - Bump @fluentui/react-popover to v9.3.2 ([PR #25683](https://github.com/microsoft/fluentui/pull/25683) by beachball)
17
+ - Bump @fluentui/react-tabster to v9.3.1 ([PR #25683](https://github.com/microsoft/fluentui/pull/25683) by beachball)
18
+ - Bump @fluentui/react-tooltip to v9.1.2 ([PR #25683](https://github.com/microsoft/fluentui/pull/25683) by beachball)
19
+ - Bump @fluentui/react-utilities to v9.2.2 ([PR #25683](https://github.com/microsoft/fluentui/pull/25683) by beachball)
20
+
21
+ ## [9.2.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-avatar_v9.2.6)
22
+
23
+ Fri, 11 Nov 2022 14:57:52 GMT
24
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-avatar_v9.2.5..@fluentui/react-avatar_v9.2.6)
25
+
26
+ ### Patches
27
+
28
+ - chore: Replacing use of hard-coded constants with curve and duration tokens from theme. ([PR #25522](https://github.com/microsoft/fluentui/pull/25522) by humberto_makoto@hotmail.com)
29
+ - fix: Update Avatar active ring color to match base color ([PR #25497](https://github.com/microsoft/fluentui/pull/25497) by behowell@microsoft.com)
30
+ - fix: create valid export maps ([PR #25558](https://github.com/microsoft/fluentui/pull/25558) by martinhochel@microsoft.com)
31
+ - chore: Remove AvatarGroup unstable warnings. ([PR #25005](https://github.com/microsoft/fluentui/pull/25005) by esteban.230@hotmail.com)
32
+ - chore: Migrate to new package structure. ([PR #25473](https://github.com/microsoft/fluentui/pull/25473) by tristan.watanabe@gmail.com)
33
+ - Bump @fluentui/react-badge to v9.0.12 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
34
+ - Bump @fluentui/react-context-selector to v9.1.1 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
35
+ - Bump @fluentui/react-popover to v9.3.1 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
36
+ - Bump @fluentui/react-shared-contexts to v9.1.1 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
37
+ - Bump @fluentui/react-tabster to v9.3.0 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
38
+ - Bump @fluentui/react-theme to v9.1.2 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
39
+ - Bump @fluentui/react-tooltip to v9.1.1 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
40
+ - Bump @fluentui/react-utilities to v9.2.1 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
41
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.18 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
42
+
7
43
  ## [9.2.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-avatar_v9.2.5)
8
44
 
9
- Wed, 02 Nov 2022 11:54:48 GMT
45
+ Wed, 02 Nov 2022 11:57:47 GMT
10
46
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-avatar_v9.2.4..@fluentui/react-avatar_v9.2.5)
11
47
 
12
48
  ### Patches
@@ -4,20 +4,10 @@
4
4
 
5
5
  The AvatarGroup component represents a group of multiple people or entities by taking care of the arrangement of individual Avatars in a spread, stack, or pie layout.
6
6
 
7
- ## STATUS: WIP 🚧
8
-
9
- These are not production-ready components and **should never be used in product**. This space is useful for testing new components whose APIs might change before final release.
10
-
11
7
  ## Usage
12
8
 
13
9
  To import AvatarGroup, AvatarGroupItem, AvatarGroupPopover, and partitionAvatarGroupItems:
14
10
 
15
- ```js
16
- import { AvatarGroup, AvatarGroupItem, AvatarGroupPopover, partitionAvatarGroupItems } from '@fluentui/react-avatar';
17
- ```
18
-
19
- Once the AvatarGroup component graduates to a production release, the component will be available at:
20
-
21
11
  ```js
22
12
  import {
23
13
  AvatarGroup,
package/dist/index.d.ts CHANGED
@@ -19,9 +19,17 @@ export declare const Avatar: ForwardRefComponent<AvatarProps>;
19
19
 
20
20
  export declare const avatarClassNames: SlotClassNames<AvatarSlots>;
21
21
 
22
- /* Excluded from this release type: AvatarContextProvider */
22
+ /**
23
+ * @internal
24
+ */
25
+ export declare const AvatarContextProvider: React_2.Provider<AvatarContextValue | undefined>;
23
26
 
24
- /* Excluded from this release type: AvatarContextValue */
27
+ /**
28
+ * @internal
29
+ */
30
+ export declare interface AvatarContextValue {
31
+ size?: AvatarSizes;
32
+ }
25
33
 
26
34
  /**
27
35
  * The AvatarGroup component represents a group of multiple people or entities by taking care of the arrangement
@@ -280,7 +288,27 @@ export declare type AvatarState = ComponentState<AvatarSlots> & Required<Pick<Av
280
288
  activeAriaLabelElement?: JSX.Element;
281
289
  };
282
290
 
283
- /* Excluded from this release type: getInitials */
291
+ /**
292
+ * Regular expressions matching characters to ignore when calculating the initials.
293
+ */
294
+ /**
295
+ * Get (up to 2 characters) initials based on display name of the persona.
296
+ *
297
+ * @param displayName - The full name of the person or entity
298
+ * @param isRtl - Whether the display is in RTL
299
+ * @param options - Extra options to control the behavior of getInitials
300
+ *
301
+ * @returns The 1 or 2 character initials based on the name. Or an empty string if no initials
302
+ * could be derived from the name.
303
+ *
304
+ * @internal
305
+ */
306
+ export declare function getInitials(displayName: string | undefined | null, isRtl: boolean, options?: {
307
+ /** Should initials be generated from phone numbers (default false) */
308
+ allowPhoneInitials?: boolean;
309
+ /** Returns only the first initial */
310
+ firstInitialOnly?: boolean;
311
+ }): string;
284
312
 
285
313
  export declare type PartitionAvatarGroupItems<T> = {
286
314
  inlineItems: readonly T[];
@@ -321,7 +349,10 @@ export declare const renderAvatarGroupPopover_unstable: (state: AvatarGroupPopov
321
349
 
322
350
  export declare const useAvatar_unstable: (props: AvatarProps, ref: React_2.Ref<HTMLElement>) => AvatarState;
323
351
 
324
- /* Excluded from this release type: useAvatarContext */
352
+ /**
353
+ * @internal
354
+ */
355
+ export declare const useAvatarContext: () => AvatarContextValue;
325
356
 
326
357
  /**
327
358
  * Create the state required to render AvatarGroup.