@fluentui/react-avatar 9.2.6 → 9.2.8

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 (82) hide show
  1. package/CHANGELOG.json +105 -1
  2. package/CHANGELOG.md +31 -2
  3. package/dist/index.d.ts +35 -4
  4. package/lib/components/AvatarGroupItem/useAvatarGroupItemStyles.js +18 -1
  5. package/lib/components/AvatarGroupItem/useAvatarGroupItemStyles.js.map +1 -1
  6. package/lib-amd/Avatar.js +6 -0
  7. package/lib-amd/Avatar.js.map +1 -0
  8. package/lib-amd/AvatarGroup.js +6 -0
  9. package/lib-amd/AvatarGroup.js.map +1 -0
  10. package/lib-amd/AvatarGroupItem.js +6 -0
  11. package/lib-amd/AvatarGroupItem.js.map +1 -0
  12. package/lib-amd/AvatarGroupPopover.js +6 -0
  13. package/lib-amd/AvatarGroupPopover.js.map +1 -0
  14. package/lib-amd/components/Avatar/Avatar.js +12 -0
  15. package/lib-amd/components/Avatar/Avatar.js.map +1 -0
  16. package/lib-amd/components/Avatar/Avatar.types.js +5 -0
  17. package/lib-amd/components/Avatar/Avatar.types.js.map +1 -0
  18. package/lib-amd/components/Avatar/index.js +10 -0
  19. package/lib-amd/components/Avatar/index.js.map +1 -0
  20. package/lib-amd/components/Avatar/renderAvatar.js +16 -0
  21. package/lib-amd/components/Avatar/renderAvatar.js.map +1 -0
  22. package/lib-amd/components/Avatar/useAvatar.js +175 -0
  23. package/lib-amd/components/Avatar/useAvatar.js.map +1 -0
  24. package/lib-amd/components/Avatar/useAvatarStyles.js +390 -0
  25. package/lib-amd/components/Avatar/useAvatarStyles.js.map +1 -0
  26. package/lib-amd/components/AvatarGroup/AvatarGroup.js +17 -0
  27. package/lib-amd/components/AvatarGroup/AvatarGroup.js.map +1 -0
  28. package/lib-amd/components/AvatarGroup/AvatarGroup.types.js +5 -0
  29. package/lib-amd/components/AvatarGroup/AvatarGroup.types.js.map +1 -0
  30. package/lib-amd/components/AvatarGroup/index.js +11 -0
  31. package/lib-amd/components/AvatarGroup/index.js.map +1 -0
  32. package/lib-amd/components/AvatarGroup/renderAvatarGroup.js +15 -0
  33. package/lib-amd/components/AvatarGroup/renderAvatarGroup.js.map +1 -0
  34. package/lib-amd/components/AvatarGroup/useAvatarGroup.js +29 -0
  35. package/lib-amd/components/AvatarGroup/useAvatarGroup.js.map +1 -0
  36. package/lib-amd/components/AvatarGroup/useAvatarGroupContextValues.js +15 -0
  37. package/lib-amd/components/AvatarGroup/useAvatarGroupContextValues.js.map +1 -0
  38. package/lib-amd/components/AvatarGroup/useAvatarGroupStyles.js +36 -0
  39. package/lib-amd/components/AvatarGroup/useAvatarGroupStyles.js.map +1 -0
  40. package/lib-amd/components/AvatarGroupItem/AvatarGroupItem.js +16 -0
  41. package/lib-amd/components/AvatarGroupItem/AvatarGroupItem.js.map +1 -0
  42. package/lib-amd/components/AvatarGroupItem/AvatarGroupItem.types.js +5 -0
  43. package/lib-amd/components/AvatarGroupItem/AvatarGroupItem.types.js.map +1 -0
  44. package/lib-amd/components/AvatarGroupItem/index.js +10 -0
  45. package/lib-amd/components/AvatarGroupItem/index.js.map +1 -0
  46. package/lib-amd/components/AvatarGroupItem/renderAvatarGroupItem.js +16 -0
  47. package/lib-amd/components/AvatarGroupItem/renderAvatarGroupItem.js.map +1 -0
  48. package/lib-amd/components/AvatarGroupItem/useAvatarGroupItem.js +58 -0
  49. package/lib-amd/components/AvatarGroupItem/useAvatarGroupItem.js.map +1 -0
  50. package/lib-amd/components/AvatarGroupItem/useAvatarGroupItemStyles.js +236 -0
  51. package/lib-amd/components/AvatarGroupItem/useAvatarGroupItemStyles.js.map +1 -0
  52. package/lib-amd/components/AvatarGroupPopover/AvatarGroupPopover.js +17 -0
  53. package/lib-amd/components/AvatarGroupPopover/AvatarGroupPopover.js.map +1 -0
  54. package/lib-amd/components/AvatarGroupPopover/AvatarGroupPopover.types.js +5 -0
  55. package/lib-amd/components/AvatarGroupPopover/AvatarGroupPopover.types.js.map +1 -0
  56. package/lib-amd/components/AvatarGroupPopover/index.js +10 -0
  57. package/lib-amd/components/AvatarGroupPopover/index.js.map +1 -0
  58. package/lib-amd/components/AvatarGroupPopover/renderAvatarGroupPopover.js +20 -0
  59. package/lib-amd/components/AvatarGroupPopover/renderAvatarGroupPopover.js.map +1 -0
  60. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopover.js +86 -0
  61. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopover.js.map +1 -0
  62. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js +14 -0
  63. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js.map +1 -0
  64. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.js +136 -0
  65. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.js.map +1 -0
  66. package/lib-amd/contexts/AvatarContext.js +17 -0
  67. package/lib-amd/contexts/AvatarContext.js.map +1 -0
  68. package/lib-amd/contexts/AvatarGroupContext.js +20 -0
  69. package/lib-amd/contexts/AvatarGroupContext.js.map +1 -0
  70. package/lib-amd/contexts/index.js +7 -0
  71. package/lib-amd/contexts/index.js.map +1 -0
  72. package/lib-amd/index.js +33 -0
  73. package/lib-amd/index.js.map +1 -0
  74. package/lib-amd/utils/getInitials.js +87 -0
  75. package/lib-amd/utils/getInitials.js.map +1 -0
  76. package/lib-amd/utils/index.js +8 -0
  77. package/lib-amd/utils/index.js.map +1 -0
  78. package/lib-amd/utils/partitionAvatarGroupItems.js +32 -0
  79. package/lib-amd/utils/partitionAvatarGroupItems.js.map +1 -0
  80. package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItemStyles.js +19 -1
  81. package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItemStyles.js.map +1 -1
  82. package/package.json +9 -9
@@ -0,0 +1,236 @@
1
+ define(["require", "exports", "tslib", "@griffel/react", "@fluentui/react-theme", "../../Avatar", "@fluentui/react-shared-contexts"], function (require, exports, tslib_1, react_1, react_theme_1, Avatar_1, react_shared_contexts_1) {
2
+ "use strict";
3
+ var _a, _b, _c;
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.useGroupChildClassName = exports.useAvatarGroupItemStyles_unstable = exports.avatarGroupItemClassNames = void 0;
6
+ exports.avatarGroupItemClassNames = {
7
+ root: 'fui-AvatarGroupItem',
8
+ avatar: 'fui-AvatarGroupItem__avatar',
9
+ overflowLabel: 'fui-AvatarGroupItem__overflowLabel',
10
+ };
11
+ var avatarGroupItemDividerWidthVar = '--fuiAvatarGroupItem__divider--width';
12
+ /**
13
+ * Styles for the root slot
14
+ */
15
+ var useRootStyles = react_1.makeStyles({
16
+ base: {
17
+ alignItems: 'center',
18
+ display: 'inline-flex',
19
+ flexShrink: 0,
20
+ position: 'relative',
21
+ },
22
+ overflowItem: tslib_1.__assign({}, react_1.shorthands.padding(react_theme_1.tokens.spacingVerticalXS, react_theme_1.tokens.spacingHorizontalXS)),
23
+ nonOverflowItem: tslib_1.__assign({}, react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusCircular)),
24
+ });
25
+ /**
26
+ * Styles for the avatar slot
27
+ */
28
+ var useAvatarStyles = react_1.makeStyles({
29
+ nonOverflowItem: {
30
+ position: 'absolute',
31
+ },
32
+ pie: tslib_1.__assign({}, react_1.shorthands.borderRadius(0)),
33
+ });
34
+ /**
35
+ * Styles for the label slot
36
+ */
37
+ var useOverflowLabelStyles = react_1.makeStyles({
38
+ base: tslib_1.__assign({ marginLeft: react_theme_1.tokens.spacingHorizontalS, color: react_theme_1.tokens.colorNeutralForeground1 }, react_theme_1.typographyStyles.body1),
39
+ });
40
+ /**
41
+ * Styles for the stack layout
42
+ */
43
+ var useStackStyles = react_1.makeStyles({
44
+ thick: {
45
+ boxShadow: "0 0 0 " + react_theme_1.tokens.strokeWidthThick + " " + react_theme_1.tokens.colorNeutralBackground2,
46
+ },
47
+ thicker: {
48
+ boxShadow: "0 0 0 " + react_theme_1.tokens.strokeWidthThicker + " " + react_theme_1.tokens.colorNeutralBackground2,
49
+ },
50
+ thickest: {
51
+ boxShadow: "0 0 0 " + react_theme_1.tokens.strokeWidthThickest + " " + react_theme_1.tokens.colorNeutralBackground2,
52
+ },
53
+ xxs: { '&:not(:first-child)': { marginLeft: "calc(-1 * " + react_theme_1.tokens.spacingHorizontalXXS + ")" } },
54
+ xs: { '&:not(:first-child)': { marginLeft: "calc(-1 * " + react_theme_1.tokens.spacingHorizontalXS + ")" } },
55
+ s: { '&:not(:first-child)': { marginLeft: "calc(-1 * " + react_theme_1.tokens.spacingHorizontalS + ")" } },
56
+ l: { '&:not(:first-child)': { marginLeft: "calc(-1 * " + react_theme_1.tokens.spacingHorizontalL + ")" } },
57
+ });
58
+ /**
59
+ * Styles for the spread layout
60
+ */
61
+ var useSpreadStyles = react_1.makeStyles({
62
+ s: { '&:not(:first-child)': { marginLeft: react_theme_1.tokens.spacingHorizontalS } },
63
+ mNudge: { '&:not(:first-child)': { marginLeft: react_theme_1.tokens.spacingHorizontalMNudge } },
64
+ m: { '&:not(:first-child)': { marginLeft: react_theme_1.tokens.spacingHorizontalM } },
65
+ l: { '&:not(:first-child)': { marginLeft: react_theme_1.tokens.spacingHorizontalL } },
66
+ xl: { '&:not(:first-child)': { marginLeft: react_theme_1.tokens.spacingHorizontalXL } },
67
+ });
68
+ /**
69
+ * Styles for the pie layout
70
+ */
71
+ var usePieStyles = react_1.makeStyles({
72
+ base: {
73
+ position: 'absolute',
74
+ },
75
+ slices: {
76
+ // Two slices
77
+ // 1st of 2 items
78
+ '&:nth-of-type(1):nth-last-of-type(2)': {
79
+ clipPath: "inset(0 calc(25% + (var(" + avatarGroupItemDividerWidthVar + ") / 2)) 0 25%)",
80
+ left: '-25%',
81
+ },
82
+ // 2nd of 2 items
83
+ '&:nth-of-type(2):nth-last-of-type(1)': {
84
+ clipPath: "inset(0 25% 0 calc(25% + (var(" + avatarGroupItemDividerWidthVar + ") / 2)))",
85
+ left: '25%',
86
+ },
87
+ // Three slices
88
+ // 1st of 3 items
89
+ '&:nth-of-type(1):nth-last-of-type(3)': {
90
+ clipPath: "inset(0 calc(25% + (var(" + avatarGroupItemDividerWidthVar + ") / 2)) 0 25%)",
91
+ left: '-25%',
92
+ },
93
+ // 2nd of 3 items
94
+ '&:nth-of-type(2):nth-last-of-type(2)': {
95
+ // Since the two AvatarGroupItems on the right are scaled by 0.5, the divider width should not be halved.
96
+ clipPath: "inset(0 0 var(" + avatarGroupItemDividerWidthVar + ") var(" + avatarGroupItemDividerWidthVar + "))",
97
+ left: '50%',
98
+ transform: 'scale(0.5)',
99
+ transformOrigin: '0 0',
100
+ },
101
+ // 3rd of 3 items
102
+ '&:nth-of-type(3):nth-last-of-type(1)': {
103
+ clipPath: "inset(var(" + avatarGroupItemDividerWidthVar + ") 0 0 var(" + avatarGroupItemDividerWidthVar + "))",
104
+ left: '50%',
105
+ top: '50%',
106
+ transform: 'scale(0.5)',
107
+ transformOrigin: '0 0',
108
+ },
109
+ },
110
+ rtlSlices: {
111
+ // Two slices
112
+ // 1st of 2 items
113
+ '&:nth-of-type(1):nth-last-of-type(2)': {
114
+ clipPath: "inset(0 25% 0 calc(25% + (var(" + avatarGroupItemDividerWidthVar + ") / 2)))",
115
+ },
116
+ // 2nd of 2 items
117
+ '&:nth-of-type(2):nth-last-of-type(1)': {
118
+ clipPath: "inset(0 calc(25% + (var(" + avatarGroupItemDividerWidthVar + ") / 2)) 0 25%)",
119
+ },
120
+ // Three slices
121
+ // 1st of 3 items
122
+ '&:nth-of-type(1):nth-last-of-type(3)': {
123
+ clipPath: "inset(0 25% 0 calc(25% + (var(" + avatarGroupItemDividerWidthVar + ") / 2)))",
124
+ },
125
+ // 2nd of 3 items
126
+ '&:nth-of-type(2):nth-last-of-type(2)': {
127
+ clipPath: "inset(0 var(" + avatarGroupItemDividerWidthVar + ") var(" + avatarGroupItemDividerWidthVar + ") 0)",
128
+ left: '0',
129
+ },
130
+ // 3rd of 3 items
131
+ '&:nth-of-type(3):nth-last-of-type(1)': {
132
+ clipPath: "inset(var(" + avatarGroupItemDividerWidthVar + ") var(" + avatarGroupItemDividerWidthVar + ") 0 0)",
133
+ left: '0',
134
+ },
135
+ },
136
+ thick: (_a = {}, _a[avatarGroupItemDividerWidthVar] = react_theme_1.tokens.strokeWidthThick, _a),
137
+ thicker: (_b = {}, _b[avatarGroupItemDividerWidthVar] = react_theme_1.tokens.strokeWidthThicker, _b),
138
+ thickest: (_c = {}, _c[avatarGroupItemDividerWidthVar] = react_theme_1.tokens.strokeWidthThickest, _c),
139
+ });
140
+ /**
141
+ * Apply styling to the AvatarGroupItem slots based on the state
142
+ */
143
+ var useAvatarGroupItemStyles_unstable = function (state) {
144
+ var isOverflowItem = state.isOverflowItem, layout = state.layout, size = state.size;
145
+ var dir = react_shared_contexts_1.useFluent_unstable().dir;
146
+ var avatarStyles = useAvatarStyles();
147
+ var overflowLabelStyles = useOverflowLabelStyles();
148
+ var pieStyles = usePieStyles();
149
+ var rootStyles = useRootStyles();
150
+ var sizeStyles = Avatar_1.useSizeStyles();
151
+ var groupChildClassName = exports.useGroupChildClassName(layout, size);
152
+ var rootClasses = [rootStyles.base];
153
+ if (!isOverflowItem) {
154
+ rootClasses.push(rootStyles.nonOverflowItem);
155
+ rootClasses.push(groupChildClassName);
156
+ rootClasses.push(sizeStyles[size]);
157
+ if (layout === 'pie') {
158
+ rootClasses.push(pieStyles.base);
159
+ if (size < 56) {
160
+ rootClasses.push(pieStyles.thick);
161
+ }
162
+ else if (size < 72) {
163
+ rootClasses.push(pieStyles.thicker);
164
+ }
165
+ else {
166
+ rootClasses.push(pieStyles.thickest);
167
+ }
168
+ rootClasses.push(pieStyles.slices);
169
+ if (dir === 'rtl') {
170
+ rootClasses.push(pieStyles.rtlSlices);
171
+ }
172
+ }
173
+ }
174
+ else {
175
+ rootClasses.push(rootStyles.overflowItem);
176
+ }
177
+ state.root.className = react_1.mergeClasses.apply(void 0, tslib_1.__spreadArray(tslib_1.__spreadArray([exports.avatarGroupItemClassNames.root], rootClasses), [state.root.className]));
178
+ state.avatar.className = react_1.mergeClasses(exports.avatarGroupItemClassNames.avatar, !isOverflowItem && avatarStyles.nonOverflowItem, layout === 'pie' && avatarStyles.pie, state.avatar.className);
179
+ if (state.overflowLabel) {
180
+ state.overflowLabel.className = react_1.mergeClasses(exports.avatarGroupItemClassNames.overflowLabel, overflowLabelStyles.base, state.overflowLabel.className);
181
+ }
182
+ return state;
183
+ };
184
+ exports.useAvatarGroupItemStyles_unstable = useAvatarGroupItemStyles_unstable;
185
+ /**
186
+ * Hook for getting the className for the children of AvatarGroup. This hook will provide the spacing and outlines
187
+ * needed for each layout.
188
+ */
189
+ var useGroupChildClassName = function (layout, size) {
190
+ var stackStyles = useStackStyles();
191
+ var spreadStyles = useSpreadStyles();
192
+ var layoutClasses = [];
193
+ if (size) {
194
+ if (layout === 'stack') {
195
+ if (size < 56) {
196
+ layoutClasses.push(stackStyles.thick);
197
+ }
198
+ else if (size < 72) {
199
+ layoutClasses.push(stackStyles.thicker);
200
+ }
201
+ else {
202
+ layoutClasses.push(stackStyles.thickest);
203
+ }
204
+ if (size < 24) {
205
+ layoutClasses.push(stackStyles.xxs);
206
+ }
207
+ else if (size < 48) {
208
+ layoutClasses.push(stackStyles.xs);
209
+ }
210
+ else if (size < 96) {
211
+ layoutClasses.push(stackStyles.s);
212
+ }
213
+ else {
214
+ layoutClasses.push(stackStyles.l);
215
+ }
216
+ }
217
+ else if (layout === 'spread') {
218
+ if (size < 20) {
219
+ layoutClasses.push(spreadStyles.s);
220
+ }
221
+ else if (size < 32) {
222
+ layoutClasses.push(spreadStyles.mNudge);
223
+ }
224
+ else if (size < 64) {
225
+ layoutClasses.push(spreadStyles.l);
226
+ }
227
+ else {
228
+ layoutClasses.push(spreadStyles.xl);
229
+ }
230
+ }
231
+ }
232
+ return react_1.mergeClasses.apply(void 0, layoutClasses);
233
+ };
234
+ exports.useGroupChildClassName = useGroupChildClassName;
235
+ });
236
+ //# sourceMappingURL=useAvatarGroupItemStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAvatarGroupItemStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-avatar/src/components/AvatarGroupItem/useAvatarGroupItemStyles.ts"],"names":[],"mappings":";;;;;IASa,QAAA,yBAAyB,GAAyC;QAC7E,IAAI,EAAE,qBAAqB;QAC3B,MAAM,EAAE,6BAA6B;QACrC,aAAa,EAAE,oCAAoC;KACpD,CAAC;IAEF,IAAM,8BAA8B,GAAG,sCAAsC,CAAC;IAE9E;;OAEG;IACH,IAAM,aAAa,GAAG,kBAAU,CAAC;QAC/B,IAAI,EAAE;YACJ,UAAU,EAAE,QAAQ;YACpB,OAAO,EAAE,aAAa;YACtB,UAAU,EAAE,CAAC;YACb,QAAQ,EAAE,UAAU;SACrB;QACD,YAAY,uBACP,kBAAU,CAAC,OAAO,CAAC,oBAAM,CAAC,iBAAiB,EAAE,oBAAM,CAAC,mBAAmB,CAAC,CAC5E;QACD,eAAe,uBACV,kBAAU,CAAC,YAAY,CAAC,oBAAM,CAAC,oBAAoB,CAAC,CACxD;KACF,CAAC,CAAC;IAEH;;OAEG;IACH,IAAM,eAAe,GAAG,kBAAU,CAAC;QACjC,eAAe,EAAE;YACf,QAAQ,EAAE,UAAU;SACrB;QACD,GAAG,uBACE,kBAAU,CAAC,YAAY,CAAC,CAAC,CAAC,CAC9B;KACF,CAAC,CAAC;IAEH;;OAEG;IACH,IAAM,sBAAsB,GAAG,kBAAU,CAAC;QACxC,IAAI,qBACF,UAAU,EAAE,oBAAM,CAAC,kBAAkB,EACrC,KAAK,EAAE,oBAAM,CAAC,uBAAuB,IAClC,8BAAgB,CAAC,KAAK,CAC1B;KACF,CAAC,CAAC;IAEH;;OAEG;IACH,IAAM,cAAc,GAAG,kBAAU,CAAC;QAChC,KAAK,EAAE;YACL,SAAS,EAAE,WAAS,oBAAM,CAAC,gBAAgB,SAAI,oBAAM,CAAC,uBAAy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AY,eAAI,aAAa,EAAE;IACxC,CAAC,CAAC;IAtCW,QAAA,sBAAsB,0BAsCjC","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { useSizeStyles } from '../../Avatar';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport type { AvatarGroupItemSlots, AvatarGroupItemState } from './AvatarGroupItem.types';\nimport type { AvatarGroupProps } from '../../AvatarGroup';\nimport type { AvatarSizes } from '../../Avatar';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const avatarGroupItemClassNames: SlotClassNames<AvatarGroupItemSlots> = {\n root: 'fui-AvatarGroupItem',\n avatar: 'fui-AvatarGroupItem__avatar',\n overflowLabel: 'fui-AvatarGroupItem__overflowLabel',\n};\n\nconst avatarGroupItemDividerWidthVar = '--fuiAvatarGroupItem__divider--width';\n\n/**\n * Styles for the root slot\n */\nconst useRootStyles = makeStyles({\n base: {\n alignItems: 'center',\n display: 'inline-flex',\n flexShrink: 0,\n position: 'relative',\n },\n overflowItem: {\n ...shorthands.padding(tokens.spacingVerticalXS, tokens.spacingHorizontalXS),\n },\n nonOverflowItem: {\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n },\n});\n\n/**\n * Styles for the avatar slot\n */\nconst useAvatarStyles = makeStyles({\n nonOverflowItem: {\n position: 'absolute',\n },\n pie: {\n ...shorthands.borderRadius(0),\n },\n});\n\n/**\n * Styles for the label slot\n */\nconst useOverflowLabelStyles = makeStyles({\n base: {\n marginLeft: tokens.spacingHorizontalS,\n color: tokens.colorNeutralForeground1,\n ...typographyStyles.body1,\n },\n});\n\n/**\n * Styles for the stack layout\n */\nconst useStackStyles = makeStyles({\n thick: {\n boxShadow: `0 0 0 ${tokens.strokeWidthThick} ${tokens.colorNeutralBackground2}`,\n },\n thicker: {\n boxShadow: `0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorNeutralBackground2}`,\n },\n thickest: {\n boxShadow: `0 0 0 ${tokens.strokeWidthThickest} ${tokens.colorNeutralBackground2}`,\n },\n xxs: { '&:not(:first-child)': { marginLeft: `calc(-1 * ${tokens.spacingHorizontalXXS})` } },\n xs: { '&:not(:first-child)': { marginLeft: `calc(-1 * ${tokens.spacingHorizontalXS})` } },\n s: { '&:not(:first-child)': { marginLeft: `calc(-1 * ${tokens.spacingHorizontalS})` } },\n l: { '&:not(:first-child)': { marginLeft: `calc(-1 * ${tokens.spacingHorizontalL})` } },\n});\n\n/**\n * Styles for the spread layout\n */\nconst useSpreadStyles = makeStyles({\n s: { '&:not(:first-child)': { marginLeft: tokens.spacingHorizontalS } },\n mNudge: { '&:not(:first-child)': { marginLeft: tokens.spacingHorizontalMNudge } },\n m: { '&:not(:first-child)': { marginLeft: tokens.spacingHorizontalM } },\n l: { '&:not(:first-child)': { marginLeft: tokens.spacingHorizontalL } },\n xl: { '&:not(:first-child)': { marginLeft: tokens.spacingHorizontalXL } },\n});\n\n/**\n * Styles for the pie layout\n */\nconst usePieStyles = makeStyles({\n base: {\n position: 'absolute',\n },\n slices: {\n // Two slices\n // 1st of 2 items\n '&:nth-of-type(1):nth-last-of-type(2)': {\n clipPath: `inset(0 calc(25% + (var(${avatarGroupItemDividerWidthVar}) / 2)) 0 25%)`,\n left: '-25%',\n },\n // 2nd of 2 items\n '&:nth-of-type(2):nth-last-of-type(1)': {\n clipPath: `inset(0 25% 0 calc(25% + (var(${avatarGroupItemDividerWidthVar}) / 2)))`,\n left: '25%',\n },\n\n // Three slices\n // 1st of 3 items\n '&:nth-of-type(1):nth-last-of-type(3)': {\n clipPath: `inset(0 calc(25% + (var(${avatarGroupItemDividerWidthVar}) / 2)) 0 25%)`,\n left: '-25%',\n },\n // 2nd of 3 items\n '&:nth-of-type(2):nth-last-of-type(2)': {\n // Since the two AvatarGroupItems on the right are scaled by 0.5, the divider width should not be halved.\n clipPath: `inset(0 0 var(${avatarGroupItemDividerWidthVar}) var(${avatarGroupItemDividerWidthVar}))`,\n left: '50%',\n transform: 'scale(0.5)',\n transformOrigin: '0 0',\n },\n // 3rd of 3 items\n '&:nth-of-type(3):nth-last-of-type(1)': {\n clipPath: `inset(var(${avatarGroupItemDividerWidthVar}) 0 0 var(${avatarGroupItemDividerWidthVar}))`,\n left: '50%',\n top: '50%',\n transform: 'scale(0.5)',\n transformOrigin: '0 0',\n },\n },\n rtlSlices: {\n // Two slices\n // 1st of 2 items\n '&:nth-of-type(1):nth-last-of-type(2)': {\n clipPath: `inset(0 25% 0 calc(25% + (var(${avatarGroupItemDividerWidthVar}) / 2)))`,\n },\n // 2nd of 2 items\n '&:nth-of-type(2):nth-last-of-type(1)': {\n clipPath: `inset(0 calc(25% + (var(${avatarGroupItemDividerWidthVar}) / 2)) 0 25%)`,\n },\n\n // Three slices\n // 1st of 3 items\n '&:nth-of-type(1):nth-last-of-type(3)': {\n clipPath: `inset(0 25% 0 calc(25% + (var(${avatarGroupItemDividerWidthVar}) / 2)))`,\n },\n // 2nd of 3 items\n '&:nth-of-type(2):nth-last-of-type(2)': {\n clipPath: `inset(0 var(${avatarGroupItemDividerWidthVar}) var(${avatarGroupItemDividerWidthVar}) 0)`,\n left: '0',\n },\n // 3rd of 3 items\n '&:nth-of-type(3):nth-last-of-type(1)': {\n clipPath: `inset(var(${avatarGroupItemDividerWidthVar}) var(${avatarGroupItemDividerWidthVar}) 0 0)`,\n left: '0',\n },\n },\n thick: { [avatarGroupItemDividerWidthVar]: tokens.strokeWidthThick },\n thicker: { [avatarGroupItemDividerWidthVar]: tokens.strokeWidthThicker },\n thickest: { [avatarGroupItemDividerWidthVar]: tokens.strokeWidthThickest },\n});\n\n/**\n * Apply styling to the AvatarGroupItem slots based on the state\n */\nexport const useAvatarGroupItemStyles_unstable = (state: AvatarGroupItemState): AvatarGroupItemState => {\n const { isOverflowItem, layout, size } = state;\n const { dir } = useFluent();\n\n const avatarStyles = useAvatarStyles();\n const overflowLabelStyles = useOverflowLabelStyles();\n const pieStyles = usePieStyles();\n const rootStyles = useRootStyles();\n const sizeStyles = useSizeStyles();\n\n const groupChildClassName = useGroupChildClassName(layout, size);\n\n const rootClasses = [rootStyles.base];\n\n if (!isOverflowItem) {\n rootClasses.push(rootStyles.nonOverflowItem);\n rootClasses.push(groupChildClassName);\n rootClasses.push(sizeStyles[size]);\n\n if (layout === 'pie') {\n rootClasses.push(pieStyles.base);\n\n if (size < 56) {\n rootClasses.push(pieStyles.thick);\n } else if (size < 72) {\n rootClasses.push(pieStyles.thicker);\n } else {\n rootClasses.push(pieStyles.thickest);\n }\n\n rootClasses.push(pieStyles.slices);\n\n if (dir === 'rtl') {\n rootClasses.push(pieStyles.rtlSlices);\n }\n }\n } else {\n rootClasses.push(rootStyles.overflowItem);\n }\n\n state.root.className = mergeClasses(avatarGroupItemClassNames.root, ...rootClasses, state.root.className);\n\n state.avatar.className = mergeClasses(\n avatarGroupItemClassNames.avatar,\n !isOverflowItem && avatarStyles.nonOverflowItem,\n layout === 'pie' && avatarStyles.pie,\n state.avatar.className,\n );\n\n if (state.overflowLabel) {\n state.overflowLabel.className = mergeClasses(\n avatarGroupItemClassNames.overflowLabel,\n overflowLabelStyles.base,\n state.overflowLabel.className,\n );\n }\n\n return state;\n};\n\n/**\n * Hook for getting the className for the children of AvatarGroup. This hook will provide the spacing and outlines\n * needed for each layout.\n */\nexport const useGroupChildClassName = (layout: AvatarGroupProps['layout'], size: AvatarSizes): string => {\n const stackStyles = useStackStyles();\n const spreadStyles = useSpreadStyles();\n const layoutClasses = [];\n\n if (size) {\n if (layout === 'stack') {\n if (size < 56) {\n layoutClasses.push(stackStyles.thick);\n } else if (size < 72) {\n layoutClasses.push(stackStyles.thicker);\n } else {\n layoutClasses.push(stackStyles.thickest);\n }\n\n if (size < 24) {\n layoutClasses.push(stackStyles.xxs);\n } else if (size < 48) {\n layoutClasses.push(stackStyles.xs);\n } else if (size < 96) {\n layoutClasses.push(stackStyles.s);\n } else {\n layoutClasses.push(stackStyles.l);\n }\n } else if (layout === 'spread') {\n if (size < 20) {\n layoutClasses.push(spreadStyles.s);\n } else if (size < 32) {\n layoutClasses.push(spreadStyles.mNudge);\n } else if (size < 64) {\n layoutClasses.push(spreadStyles.l);\n } else {\n layoutClasses.push(spreadStyles.xl);\n }\n }\n }\n\n return mergeClasses(...layoutClasses);\n};\n"]}
@@ -0,0 +1,17 @@
1
+ define(["require", "exports", "./renderAvatarGroupPopover", "./useAvatarGroupPopoverContextValues", "./useAvatarGroupPopover", "./useAvatarGroupPopoverStyles"], function (require, exports, renderAvatarGroupPopover_1, useAvatarGroupPopoverContextValues_1, useAvatarGroupPopover_1, useAvatarGroupPopoverStyles_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.AvatarGroupPopover = void 0;
5
+ /**
6
+ * The AvatarGroupPopover component provides a button with a Popover containing the children provided.
7
+ */
8
+ var AvatarGroupPopover = function (props) {
9
+ var state = useAvatarGroupPopover_1.useAvatarGroupPopover_unstable(props);
10
+ var contextValues = useAvatarGroupPopoverContextValues_1.useAvatarGroupPopoverContextValues(state);
11
+ useAvatarGroupPopoverStyles_1.useAvatarGroupPopoverStyles_unstable(state);
12
+ return renderAvatarGroupPopover_1.renderAvatarGroupPopover_unstable(state, contextValues);
13
+ };
14
+ exports.AvatarGroupPopover = AvatarGroupPopover;
15
+ exports.AvatarGroupPopover.displayName = 'AvatarGroupPopover';
16
+ });
17
+ //# sourceMappingURL=AvatarGroupPopover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AvatarGroupPopover.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-avatar/src/components/AvatarGroupPopover/AvatarGroupPopover.tsx"],"names":[],"mappings":";;;;IAOA;;OAEG;IACI,IAAM,kBAAkB,GAAsC,UAAA,KAAK;QACxE,IAAM,KAAK,GAAG,sDAA8B,CAAC,KAAK,CAAC,CAAC;QACpD,IAAM,aAAa,GAAG,uEAAkC,CAAC,KAAK,CAAC,CAAC;QAEhE,kEAAoC,CAAC,KAAK,CAAC,CAAC;QAC5C,OAAO,4DAAiC,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IACjE,CAAC,CAAC;IANW,QAAA,kBAAkB,sBAM7B;IAEF,0BAAkB,CAAC,WAAW,GAAG,oBAAoB,CAAC","sourcesContent":["import * as React from 'react';\nimport { renderAvatarGroupPopover_unstable } from './renderAvatarGroupPopover';\nimport { useAvatarGroupPopoverContextValues } from './useAvatarGroupPopoverContextValues';\nimport { useAvatarGroupPopover_unstable } from './useAvatarGroupPopover';\nimport { useAvatarGroupPopoverStyles_unstable } from './useAvatarGroupPopoverStyles';\nimport type { AvatarGroupPopoverProps } from './AvatarGroupPopover.types';\n\n/**\n * The AvatarGroupPopover component provides a button with a Popover containing the children provided.\n */\nexport const AvatarGroupPopover: React.FC<AvatarGroupPopoverProps> = props => {\n const state = useAvatarGroupPopover_unstable(props);\n const contextValues = useAvatarGroupPopoverContextValues(state);\n\n useAvatarGroupPopoverStyles_unstable(state);\n return renderAvatarGroupPopover_unstable(state, contextValues);\n};\n\nAvatarGroupPopover.displayName = 'AvatarGroupPopover';\n"]}
@@ -0,0 +1,5 @@
1
+ define(["require", "exports"], function (require, exports) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ });
5
+ //# sourceMappingURL=AvatarGroupPopover.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AvatarGroupPopover.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-avatar/src/components/AvatarGroupPopover/AvatarGroupPopover.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { AvatarSizes } from '../Avatar/Avatar.types';\nimport type { AvatarGroupProps } from '../AvatarGroup/AvatarGroup.types';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { PopoverProps, PopoverSurface } from '@fluentui/react-popover';\nimport type { TooltipProps } from '@fluentui/react-tooltip';\n\nexport type AvatarGroupPopoverSlots = {\n root: NonNullable<Slot<PopoverProps>>;\n\n /**\n * Button that triggers the Popover.\n */\n triggerButton: NonNullable<Slot<'button'>>;\n\n /**\n * List that contains the overflowed AvatarGroupItems.\n */\n content: NonNullable<Slot<'ul'>>;\n\n /**\n * PopoverSurface that contains the content.\n */\n popoverSurface: NonNullable<Slot<typeof PopoverSurface>>;\n\n /**\n * Tooltip shown when triggerButton is hovered.\n */\n tooltip: NonNullable<Slot<TooltipProps>>;\n};\n\n/**\n * AvatarGroupPopover Props\n */\nexport type AvatarGroupPopoverProps = Omit<ComponentProps<Partial<AvatarGroupPopoverSlots>>, 'children'> & {\n /**\n * Whether the triggerButton should render an icon instead of the number of overflowed AvatarGroupItems.\n * Note: The indicator will default to `icon` when the size is less than 24.\n * @default count\n */\n indicator?: 'count' | 'icon';\n\n /**\n * Number of AvatarGroupItems that will be rendered.\n *\n * Note: AvatarGroupPopover handles counting the number of children, but when using a react fragment to wrap the\n * children, this is not possible and therefore it has do be added manually.\n */\n count?: number;\n\n children: React.ReactNode;\n};\n\n/**\n * State used in rendering AvatarGroupPopover\n */\nexport type AvatarGroupPopoverState = ComponentState<AvatarGroupPopoverSlots> &\n Required<Pick<AvatarGroupPopoverProps, 'count' | 'indicator'>> & {\n popoverOpen: boolean;\n layout: AvatarGroupProps['layout'];\n size: AvatarSizes;\n };\n"]}
@@ -0,0 +1,10 @@
1
+ define(["require", "exports", "tslib", "./AvatarGroupPopover", "./AvatarGroupPopover.types", "./renderAvatarGroupPopover", "./useAvatarGroupPopover", "./useAvatarGroupPopoverStyles"], function (require, exports, tslib_1, AvatarGroupPopover_1, AvatarGroupPopover_types_1, renderAvatarGroupPopover_1, useAvatarGroupPopover_1, useAvatarGroupPopoverStyles_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ tslib_1.__exportStar(AvatarGroupPopover_1, exports);
5
+ tslib_1.__exportStar(AvatarGroupPopover_types_1, exports);
6
+ tslib_1.__exportStar(renderAvatarGroupPopover_1, exports);
7
+ tslib_1.__exportStar(useAvatarGroupPopover_1, exports);
8
+ tslib_1.__exportStar(useAvatarGroupPopoverStyles_1, exports);
9
+ });
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-avatar/src/components/AvatarGroupPopover/index.ts"],"names":[],"mappings":";;;IAAA,oDAAqC;IACrC,0DAA2C;IAC3C,0DAA2C;IAC3C,uDAAwC;IACxC,6DAA8C","sourcesContent":["export * from './AvatarGroupPopover';\nexport * from './AvatarGroupPopover.types';\nexport * from './renderAvatarGroupPopover';\nexport * from './useAvatarGroupPopover';\nexport * from './useAvatarGroupPopoverStyles';\n"]}
@@ -0,0 +1,20 @@
1
+ define(["require", "exports", "tslib", "react", "../../contexts/AvatarGroupContext", "@fluentui/react-utilities", "@fluentui/react-popover"], function (require, exports, tslib_1, React, AvatarGroupContext_1, react_utilities_1, react_popover_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.renderAvatarGroupPopover_unstable = void 0;
5
+ /**
6
+ * Render the final JSX of AvatarGroupPopover
7
+ */
8
+ var renderAvatarGroupPopover_unstable = function (state, contextValues) {
9
+ var _a = react_utilities_1.getSlots(state), slots = _a.slots, slotProps = _a.slotProps;
10
+ return (React.createElement(slots.root, tslib_1.__assign({}, slotProps.root),
11
+ React.createElement(react_popover_1.PopoverTrigger, { disableButtonEnhancement: true },
12
+ React.createElement(slots.tooltip, tslib_1.__assign({}, slotProps.tooltip),
13
+ React.createElement(slots.triggerButton, tslib_1.__assign({}, slotProps.triggerButton)))),
14
+ React.createElement(slots.popoverSurface, tslib_1.__assign({}, slotProps.popoverSurface),
15
+ React.createElement(AvatarGroupContext_1.AvatarGroupProvider, { value: contextValues.avatarGroup },
16
+ React.createElement(slots.content, tslib_1.__assign({}, slotProps.content))))));
17
+ };
18
+ exports.renderAvatarGroupPopover_unstable = renderAvatarGroupPopover_unstable;
19
+ });
20
+ //# sourceMappingURL=renderAvatarGroupPopover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderAvatarGroupPopover.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-avatar/src/components/AvatarGroupPopover/renderAvatarGroupPopover.tsx"],"names":[],"mappings":";;;;IAQA;;OAEG;IACI,IAAM,iCAAiC,GAAG,UAC/C,KAA8B,EAC9B,aAAuC;QAEjC,IAAA,KAAuB,0BAAQ,CAA0B,KAAK,CAAC,EAA7D,KAAK,WAAA,EAAE,SAAS,eAA6C,CAAC;QAEtE,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAM,SAAS,CAAC,IAAqB;YAC9C,oBAAC,8BAAc,IAAC,wBAAwB;gBACtC,oBAAC,KAAK,CAAC,OAAO,uBAAM,SAAS,CAAC,OAAwB;oBACpD,oBAAC,KAAK,CAAC,aAAa,uBAAK,SAAS,CAAC,aAAa,EAAI,CACtC,CACD;YACjB,oBAAC,KAAK,CAAC,cAAc,uBAAK,SAAS,CAAC,cAAc;gBAChD,oBAAC,wCAAmB,IAAC,KAAK,EAAE,aAAa,CAAC,WAAW;oBACnD,oBAAC,KAAK,CAAC,OAAO,uBAAK,SAAS,CAAC,OAAO,EAAI,CACpB,CACD,CACZ,CACd,CAAC;IACJ,CAAC,CAAC;IApBW,QAAA,iCAAiC,qCAoB5C","sourcesContent":["import * as React from 'react';\nimport { AvatarGroupProvider } from '../../contexts/AvatarGroupContext';\nimport { AvatarGroupContextValues } from '../AvatarGroup/AvatarGroup.types';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { PopoverProps, PopoverTrigger } from '@fluentui/react-popover';\nimport { TooltipProps } from '@fluentui/react-tooltip';\nimport type { AvatarGroupPopoverState, AvatarGroupPopoverSlots } from './AvatarGroupPopover.types';\n\n/**\n * Render the final JSX of AvatarGroupPopover\n */\nexport const renderAvatarGroupPopover_unstable = (\n state: AvatarGroupPopoverState,\n contextValues: AvatarGroupContextValues,\n) => {\n const { slots, slotProps } = getSlots<AvatarGroupPopoverSlots>(state);\n\n return (\n <slots.root {...(slotProps.root as PopoverProps)}>\n <PopoverTrigger disableButtonEnhancement>\n <slots.tooltip {...(slotProps.tooltip as TooltipProps)}>\n <slots.triggerButton {...slotProps.triggerButton} />\n </slots.tooltip>\n </PopoverTrigger>\n <slots.popoverSurface {...slotProps.popoverSurface}>\n <AvatarGroupProvider value={contextValues.avatarGroup}>\n <slots.content {...slotProps.content} />\n </AvatarGroupProvider>\n </slots.popoverSurface>\n </slots.root>\n );\n};\n"]}
@@ -0,0 +1,86 @@
1
+ define(["require", "exports", "tslib", "react", "../../contexts/AvatarGroupContext", "../AvatarGroup/useAvatarGroup", "@fluentui/react-utilities", "@fluentui/react-icons", "@fluentui/react-popover", "@fluentui/react-tooltip"], function (require, exports, tslib_1, React, AvatarGroupContext_1, useAvatarGroup_1, react_utilities_1, react_icons_1, react_popover_1, react_tooltip_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useAvatarGroupPopover_unstable = void 0;
5
+ /**
6
+ * Create the state required to render AvatarGroupPopover.
7
+ *
8
+ * The returned state can be modified with hooks such as useAvatarGroupPopoverStyles_unstable,
9
+ * before being passed to renderAvatarGroupPopover_unstable.
10
+ *
11
+ * @param props - props from this instance of AvatarGroupPopover
12
+ */
13
+ var useAvatarGroupPopover_unstable = function (props) {
14
+ var _a;
15
+ var size = (_a = AvatarGroupContext_1.useAvatarGroupContext_unstable(function (ctx) { return ctx.size; })) !== null && _a !== void 0 ? _a : useAvatarGroup_1.defaultAvatarGroupSize;
16
+ var layout = AvatarGroupContext_1.useAvatarGroupContext_unstable(function (ctx) { return ctx.layout; });
17
+ var _b = props.indicator, indicator = _b === void 0 ? size < 24 ? 'icon' : 'count' : _b, _c = props.count, count = _c === void 0 ? React.Children.count(props.children) : _c, children = props.children, restOfProps = tslib_1.__rest(props, ["indicator", "count", "children"]);
18
+ var _d = react_utilities_1.useControllableState({
19
+ state: props.open,
20
+ defaultState: props.defaultOpen,
21
+ initialState: false,
22
+ }), popoverOpen = _d[0], setPopoverOpen = _d[1];
23
+ var handleOnPopoverChange = function (e, data) {
24
+ var _a;
25
+ (_a = restOfProps.onOpenChange) === null || _a === void 0 ? void 0 : _a.call(restOfProps, e, data);
26
+ setPopoverOpen(data.open);
27
+ };
28
+ var triggerButtonChildren;
29
+ if (layout === 'pie') {
30
+ triggerButtonChildren = null;
31
+ }
32
+ else if (indicator === 'icon') {
33
+ triggerButtonChildren = React.createElement(react_icons_1.MoreHorizontalRegular, null);
34
+ }
35
+ else {
36
+ triggerButtonChildren = count > 99 ? '99+' : "+" + count;
37
+ }
38
+ return {
39
+ count: count,
40
+ indicator: indicator,
41
+ layout: layout,
42
+ popoverOpen: popoverOpen,
43
+ size: size,
44
+ components: {
45
+ root: react_popover_1.Popover,
46
+ triggerButton: 'button',
47
+ content: 'ul',
48
+ popoverSurface: react_popover_1.PopoverSurface,
49
+ tooltip: react_tooltip_1.Tooltip,
50
+ },
51
+ root: tslib_1.__assign(tslib_1.__assign({
52
+ // Popover expects a child for its children. The children are added in the renderAvatarGroupPopover.
53
+ children: React.createElement(React.Fragment, null), size: 'small', trapFocus: true }, restOfProps), { open: popoverOpen, onOpenChange: handleOnPopoverChange }),
54
+ triggerButton: react_utilities_1.resolveShorthand(props.triggerButton, {
55
+ required: true,
56
+ defaultProps: {
57
+ children: triggerButtonChildren,
58
+ type: 'button',
59
+ },
60
+ }),
61
+ content: react_utilities_1.resolveShorthand(props.content, {
62
+ required: true,
63
+ defaultProps: {
64
+ children: children,
65
+ role: 'list',
66
+ },
67
+ }),
68
+ popoverSurface: react_utilities_1.resolveShorthand(props.popoverSurface, {
69
+ required: true,
70
+ defaultProps: {
71
+ 'aria-label': 'Overflow',
72
+ tabIndex: 0,
73
+ },
74
+ }),
75
+ tooltip: react_utilities_1.resolveShorthand(props.tooltip, {
76
+ required: true,
77
+ defaultProps: {
78
+ content: 'View more people.',
79
+ relationship: 'label',
80
+ },
81
+ }),
82
+ };
83
+ };
84
+ exports.useAvatarGroupPopover_unstable = useAvatarGroupPopover_unstable;
85
+ });
86
+ //# sourceMappingURL=useAvatarGroupPopover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAvatarGroupPopover.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-avatar/src/components/AvatarGroupPopover/useAvatarGroupPopover.tsx"],"names":[],"mappings":";;;;IASA;;;;;;;OAOG;IACI,IAAM,8BAA8B,GAAG,UAAC,KAA8B;;QAC3E,IAAM,IAAI,GAAG,MAAA,mDAA8B,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,IAAI,EAAR,CAAQ,CAAC,mCAAI,uCAAsB,CAAC;QACvF,IAAM,MAAM,GAAG,mDAA8B,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,MAAM,EAAV,CAAU,CAAC,CAAC;QAE/D,IAAA,KAIE,KAAK,UAJiC,EAAxC,SAAS,mBAAG,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,KAAA,EACxC,KAGE,KAAK,MAHqC,EAA5C,KAAK,mBAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAA,EAC5C,QAAQ,GAEN,KAAK,SAFC,EACL,WAAW,kBACZ,KAAK,EALH,kCAKL,CADe,CACN;QAEJ,IAAA,KAAgC,sCAAoB,CAAC;YACzD,KAAK,EAAE,KAAK,CAAC,IAAI;YACjB,YAAY,EAAE,KAAK,CAAC,WAAW;YAC/B,YAAY,EAAE,KAAK;SACpB,CAAC,EAJK,WAAW,QAAA,EAAE,cAAc,QAIhC,CAAC;QAEH,IAAM,qBAAqB,GAAG,UAAC,CAAoB,EAAE,IAAsB;;YACzE,MAAA,WAAW,CAAC,YAAY,+CAAxB,WAAW,EAAgB,CAAC,EAAE,IAAI,CAAC,CAAC;YACpC,cAAc,CAAC,IA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B,QAAQ,EAAE,CAAC;iBACZ;aACF,CAAC;YACF,OAAO,EAAE,kCAAgB,CAAC,KAAK,CAAC,OAAO,EAAE;gBACvC,QAAQ,EAAE,IAAI;gBACd,YAAY,EAAE;oBACZ,OAAO,EAAE,mBAAmB;oBAC5B,YAAY,EAAE,OAAO;iBACtB;aACF,CAAC;SACH,CAAC;IACJ,CAAC,CAAC;IAlFW,QAAA,8BAA8B,kCAkFzC","sourcesContent":["import * as React from 'react';\nimport { useAvatarGroupContext_unstable } from '../../contexts/AvatarGroupContext';\nimport { defaultAvatarGroupSize } from '../AvatarGroup/useAvatarGroup';\nimport { resolveShorthand, useControllableState } from '@fluentui/react-utilities';\nimport { MoreHorizontalRegular } from '@fluentui/react-icons';\nimport { OnOpenChangeData, OpenPopoverEvents, Popover, PopoverSurface } from '@fluentui/react-popover';\nimport type { AvatarGroupPopoverProps, AvatarGroupPopoverState } from './AvatarGroupPopover.types';\nimport { Tooltip } from '@fluentui/react-tooltip';\n\n/**\n * Create the state required to render AvatarGroupPopover.\n *\n * The returned state can be modified with hooks such as useAvatarGroupPopoverStyles_unstable,\n * before being passed to renderAvatarGroupPopover_unstable.\n *\n * @param props - props from this instance of AvatarGroupPopover\n */\nexport const useAvatarGroupPopover_unstable = (props: AvatarGroupPopoverProps): AvatarGroupPopoverState => {\n const size = useAvatarGroupContext_unstable(ctx => ctx.size) ?? defaultAvatarGroupSize;\n const layout = useAvatarGroupContext_unstable(ctx => ctx.layout);\n const {\n indicator = size < 24 ? 'icon' : 'count',\n count = React.Children.count(props.children),\n children,\n ...restOfProps\n } = props;\n\n const [popoverOpen, setPopoverOpen] = useControllableState({\n state: props.open,\n defaultState: props.defaultOpen,\n initialState: false,\n });\n\n const handleOnPopoverChange = (e: OpenPopoverEvents, data: OnOpenChangeData) => {\n restOfProps.onOpenChange?.(e, data);\n setPopoverOpen(data.open);\n };\n\n let triggerButtonChildren;\n if (layout === 'pie') {\n triggerButtonChildren = null;\n } else if (indicator === 'icon') {\n triggerButtonChildren = <MoreHorizontalRegular />;\n } else {\n triggerButtonChildren = count > 99 ? '99+' : `+${count}`;\n }\n\n return {\n count,\n indicator,\n layout,\n popoverOpen,\n size,\n\n components: {\n root: Popover,\n triggerButton: 'button',\n content: 'ul',\n popoverSurface: PopoverSurface,\n tooltip: Tooltip,\n },\n root: {\n // Popover expects a child for its children. The children are added in the renderAvatarGroupPopover.\n children: <></>,\n size: 'small',\n trapFocus: true,\n ...restOfProps,\n open: popoverOpen,\n onOpenChange: handleOnPopoverChange,\n },\n triggerButton: resolveShorthand(props.triggerButton, {\n required: true,\n defaultProps: {\n children: triggerButtonChildren,\n type: 'button',\n },\n }),\n content: resolveShorthand(props.content, {\n required: true,\n defaultProps: {\n children,\n role: 'list',\n },\n }),\n popoverSurface: resolveShorthand(props.popoverSurface, {\n required: true,\n defaultProps: {\n 'aria-label': 'Overflow',\n tabIndex: 0,\n },\n }),\n tooltip: resolveShorthand(props.tooltip, {\n required: true,\n defaultProps: {\n content: 'View more people.',\n relationship: 'label',\n },\n }),\n };\n};\n"]}
@@ -0,0 +1,14 @@
1
+ define(["require", "exports"], function (require, exports) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useAvatarGroupPopoverContextValues = void 0;
5
+ var useAvatarGroupPopoverContextValues = function (state) {
6
+ var avatarGroup = {
7
+ isOverflow: true,
8
+ size: 24,
9
+ };
10
+ return { avatarGroup: avatarGroup };
11
+ };
12
+ exports.useAvatarGroupPopoverContextValues = useAvatarGroupPopoverContextValues;
13
+ });
14
+ //# sourceMappingURL=useAvatarGroupPopoverContextValues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAvatarGroupPopoverContextValues.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-avatar/src/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.ts"],"names":[],"mappings":";;;;IAGO,IAAM,kCAAkC,GAAG,UAAC,KAA8B;QAC/E,IAAM,WAAW,GAA4B;YAC3C,UAAU,EAAE,IAAI;YAChB,IAAI,EAAE,EAAE;SACT,CAAC;QAEF,OAAO,EAAE,WAAW,aAAA,EAAE,CAAC;IACzB,CAAC,CAAC;IAPW,QAAA,kCAAkC,sCAO7C","sourcesContent":["import { AvatarGroupContextValue, AvatarGroupContextValues } from '../AvatarGroup/AvatarGroup.types';\nimport { AvatarGroupPopoverState } from './AvatarGroupPopover.types';\n\nexport const useAvatarGroupPopoverContextValues = (state: AvatarGroupPopoverState): AvatarGroupContextValues => {\n const avatarGroup: AvatarGroupContextValue = {\n isOverflow: true,\n size: 24,\n };\n\n return { avatarGroup };\n};\n"]}
@@ -0,0 +1,136 @@
1
+ define(["require", "exports", "tslib", "@fluentui/react-tabster", "@griffel/react", "@fluentui/react-theme", "../AvatarGroupItem/useAvatarGroupItemStyles", "../Avatar/useAvatarStyles"], function (require, exports, tslib_1, react_tabster_1, react_1, react_theme_1, useAvatarGroupItemStyles_1, useAvatarStyles_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useAvatarGroupPopoverStyles_unstable = exports.avatarGroupPopoverClassNames = void 0;
5
+ exports.avatarGroupPopoverClassNames = {
6
+ root: 'fui-AvatarGroupPopover',
7
+ content: 'fui-AvatarGroupPopover__content',
8
+ popoverSurface: 'fui-AvatarGroupPopover__popoverSurface',
9
+ tooltip: 'fui-AvatarGroupPopover__tooltip',
10
+ triggerButton: 'fui-AvatarGroupPopover__triggerButton',
11
+ };
12
+ /**
13
+ * Styles for the content slot.
14
+ */
15
+ var useContentStyles = react_1.makeStyles({
16
+ base: tslib_1.__assign(tslib_1.__assign({ listStyleType: 'none' }, react_1.shorthands.margin('0')), react_1.shorthands.padding('0')),
17
+ });
18
+ /**
19
+ * Styles for the popoverSurface slot.
20
+ */
21
+ var usePopoverSurfaceStyles = react_1.makeStyles({
22
+ base: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ maxHeight: '220px', minHeight: '80px' }, react_1.shorthands.overflow('hidden', 'scroll')), react_1.shorthands.padding(react_theme_1.tokens.spacingVerticalS, react_theme_1.tokens.spacingHorizontalS)), { width: '220px' }),
23
+ });
24
+ /**
25
+ * Styles for the triggerButton slot.
26
+ */
27
+ var useTriggerButtonStyles = react_1.makeStyles({
28
+ base: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ display: 'inline-flex', position: 'relative', flexShrink: 0, justifyContent: 'center', alignItems: 'center', color: react_theme_1.tokens.colorNeutralForeground1, backgroundColor: react_theme_1.tokens.colorNeutralBackground1 }, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStroke1)), react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusCircular)), react_1.shorthands.borderStyle('solid')), react_1.shorthands.padding(0)), {
29
+ // Match color to Avatar's outline color.
30
+ '@media (forced-colors: active)': tslib_1.__assign({}, react_1.shorthands.borderColor('CanvasText')) }),
31
+ pie: tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorTransparentBackground }, react_1.shorthands.borderColor(react_theme_1.tokens.colorTransparentStroke)), { color: 'transparent' }),
32
+ focusIndicator: react_tabster_1.createCustomFocusIndicatorStyle(tslib_1.__assign({}, react_1.shorthands.border(react_theme_1.tokens.strokeWidthThick, 'solid', react_theme_1.tokens.colorStrokeFocus2))),
33
+ states: {
34
+ '&:hover': tslib_1.__assign({ color: react_theme_1.tokens.colorNeutralForeground1Hover, backgroundColor: react_theme_1.tokens.colorNeutralBackground1Hover }, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStroke1Hover)),
35
+ '&:active': tslib_1.__assign({ color: react_theme_1.tokens.colorNeutralForeground1Pressed, backgroundColor: react_theme_1.tokens.colorNeutralBackground1Pressed }, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStroke1Pressed)),
36
+ },
37
+ selected: tslib_1.__assign({ color: react_theme_1.tokens.colorNeutralForeground1Selected, backgroundColor: react_theme_1.tokens.colorNeutralBackground1Selected }, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStroke1Selected)),
38
+ icon12: { fontSize: '12px' },
39
+ icon16: { fontSize: '16px' },
40
+ icon20: { fontSize: '20px' },
41
+ icon24: { fontSize: '24px' },
42
+ icon28: { fontSize: '28px' },
43
+ icon32: { fontSize: '32px' },
44
+ icon48: { fontSize: '48px' },
45
+ caption2Strong: tslib_1.__assign({}, react_theme_1.typographyStyles.caption2Strong),
46
+ caption1Strong: tslib_1.__assign({}, react_theme_1.typographyStyles.caption1Strong),
47
+ body1Strong: tslib_1.__assign({}, react_theme_1.typographyStyles.body1Strong),
48
+ subtitle2: tslib_1.__assign({}, react_theme_1.typographyStyles.subtitle2),
49
+ subtitle1: tslib_1.__assign({}, react_theme_1.typographyStyles.subtitle1),
50
+ title3: tslib_1.__assign({}, react_theme_1.typographyStyles.title3),
51
+ borderThin: tslib_1.__assign({}, react_1.shorthands.borderWidth(react_theme_1.tokens.strokeWidthThin)),
52
+ borderThick: tslib_1.__assign({}, react_1.shorthands.borderWidth(react_theme_1.tokens.strokeWidthThick)),
53
+ borderThicker: tslib_1.__assign({}, react_1.shorthands.borderWidth(react_theme_1.tokens.strokeWidthThicker)),
54
+ borderThickest: tslib_1.__assign({}, react_1.shorthands.borderWidth(react_theme_1.tokens.strokeWidthThickest)),
55
+ });
56
+ /**
57
+ * Apply styling to the AvatarGroupPopover slots based on the state
58
+ */
59
+ var useAvatarGroupPopoverStyles_unstable = function (state) {
60
+ var indicator = state.indicator, size = state.size, layout = state.layout, popoverOpen = state.popoverOpen;
61
+ var sizeStyles = useAvatarStyles_1.useSizeStyles();
62
+ var triggerButtonStyles = useTriggerButtonStyles();
63
+ var contentStyles = useContentStyles();
64
+ var popoverSurfaceStyles = usePopoverSurfaceStyles();
65
+ var groupChildClassName = useAvatarGroupItemStyles_1.useGroupChildClassName(layout, size);
66
+ var triggerButtonClasses = [];
67
+ if (size < 36) {
68
+ triggerButtonClasses.push(triggerButtonStyles.borderThin);
69
+ }
70
+ else if (size < 56) {
71
+ triggerButtonClasses.push(triggerButtonStyles.borderThick);
72
+ }
73
+ else if (size < 72) {
74
+ triggerButtonClasses.push(triggerButtonStyles.borderThicker);
75
+ }
76
+ else {
77
+ triggerButtonClasses.push(triggerButtonStyles.borderThickest);
78
+ }
79
+ if (indicator === 'count') {
80
+ if (size <= 24) {
81
+ triggerButtonClasses.push(triggerButtonStyles.caption2Strong);
82
+ }
83
+ else if (size <= 28) {
84
+ triggerButtonClasses.push(triggerButtonStyles.caption1Strong);
85
+ }
86
+ else if (size <= 40) {
87
+ triggerButtonClasses.push(triggerButtonStyles.body1Strong);
88
+ }
89
+ else if (size <= 56) {
90
+ triggerButtonClasses.push(triggerButtonStyles.subtitle2);
91
+ }
92
+ else if (size <= 96) {
93
+ triggerButtonClasses.push(triggerButtonStyles.subtitle1);
94
+ }
95
+ else {
96
+ triggerButtonClasses.push(triggerButtonStyles.title3);
97
+ }
98
+ }
99
+ else {
100
+ if (size <= 16) {
101
+ triggerButtonClasses.push(triggerButtonStyles.icon12);
102
+ }
103
+ else if (size <= 24) {
104
+ triggerButtonClasses.push(triggerButtonStyles.icon16);
105
+ }
106
+ else if (size <= 40) {
107
+ triggerButtonClasses.push(triggerButtonStyles.icon20);
108
+ }
109
+ else if (size <= 48) {
110
+ triggerButtonClasses.push(triggerButtonStyles.icon24);
111
+ }
112
+ else if (size <= 56) {
113
+ triggerButtonClasses.push(triggerButtonStyles.icon28);
114
+ }
115
+ else if (size <= 72) {
116
+ triggerButtonClasses.push(triggerButtonStyles.icon32);
117
+ }
118
+ else {
119
+ triggerButtonClasses.push(triggerButtonStyles.icon48);
120
+ }
121
+ }
122
+ state.triggerButton.className = react_1.mergeClasses.apply(void 0, tslib_1.__spreadArray(tslib_1.__spreadArray([exports.avatarGroupPopoverClassNames.triggerButton,
123
+ groupChildClassName,
124
+ sizeStyles[size],
125
+ triggerButtonStyles.base,
126
+ layout === 'pie' && triggerButtonStyles.pie,
127
+ triggerButtonStyles.focusIndicator,
128
+ layout !== 'pie' && triggerButtonStyles.states,
129
+ layout !== 'pie' && popoverOpen && triggerButtonStyles.selected], triggerButtonClasses), [state.triggerButton.className]));
130
+ state.content.className = react_1.mergeClasses(exports.avatarGroupPopoverClassNames.content, contentStyles.base, state.content.className);
131
+ state.popoverSurface.className = react_1.mergeClasses(exports.avatarGroupPopoverClassNames.popoverSurface, popoverSurfaceStyles.base, state.popoverSurface.className);
132
+ return state;
133
+ };
134
+ exports.useAvatarGroupPopoverStyles_unstable = useAvatarGroupPopoverStyles_unstable;
135
+ });
136
+ //# sourceMappingURL=useAvatarGroupPopoverStyles.js.map