@fluentui/react-avatar 9.0.3 → 9.1.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 (104) hide show
  1. package/CHANGELOG.json +253 -7
  2. package/CHANGELOG.md +56 -8
  3. package/README-AvatarGroup.md +63 -39
  4. package/SPEC-AvatarGroup.md +103 -85
  5. package/dist/index.d.ts +117 -40
  6. package/lib/AvatarGroupPopover.js +2 -0
  7. package/lib/AvatarGroupPopover.js.map +1 -0
  8. package/lib/components/Avatar/useAvatar.js +3 -7
  9. package/lib/components/Avatar/useAvatar.js.map +1 -1
  10. package/lib/components/Avatar/useAvatarStyles.js +27 -5
  11. package/lib/components/Avatar/useAvatarStyles.js.map +1 -1
  12. package/lib/components/AvatarGroup/AvatarGroup.js +4 -2
  13. package/lib/components/AvatarGroup/AvatarGroup.js.map +1 -1
  14. package/lib/components/AvatarGroup/AvatarGroup.types.js.map +1 -1
  15. package/lib/components/AvatarGroup/index.js +1 -0
  16. package/lib/components/AvatarGroup/index.js.map +1 -1
  17. package/lib/components/AvatarGroup/renderAvatarGroup.js +5 -31
  18. package/lib/components/AvatarGroup/renderAvatarGroup.js.map +1 -1
  19. package/lib/components/AvatarGroup/useAvatarGroup.js +4 -62
  20. package/lib/components/AvatarGroup/useAvatarGroup.js.map +1 -1
  21. package/lib/components/AvatarGroup/useAvatarGroupContextValues.js +14 -0
  22. package/lib/components/AvatarGroup/useAvatarGroupContextValues.js.map +1 -0
  23. package/lib/components/AvatarGroup/useAvatarGroupStyles.js +5 -265
  24. package/lib/components/AvatarGroup/useAvatarGroupStyles.js.map +1 -1
  25. package/lib/components/AvatarGroupItem/AvatarGroupItem.js +1 -1
  26. package/lib/components/AvatarGroupItem/AvatarGroupItem.js.map +1 -1
  27. package/lib/components/AvatarGroupItem/AvatarGroupItem.types.js.map +1 -1
  28. package/lib/components/AvatarGroupItem/useAvatarGroupItem.js +10 -11
  29. package/lib/components/AvatarGroupItem/useAvatarGroupItem.js.map +1 -1
  30. package/lib/components/AvatarGroupItem/useAvatarGroupItemStyles.js +51 -59
  31. package/lib/components/AvatarGroupItem/useAvatarGroupItemStyles.js.map +1 -1
  32. package/lib/components/AvatarGroupPopover/AvatarGroupPopover.js +16 -0
  33. package/lib/components/AvatarGroupPopover/AvatarGroupPopover.js.map +1 -0
  34. package/lib/components/AvatarGroupPopover/AvatarGroupPopover.types.js +2 -0
  35. package/lib/components/AvatarGroupPopover/AvatarGroupPopover.types.js.map +1 -0
  36. package/lib/components/AvatarGroupPopover/index.js +6 -0
  37. package/lib/components/AvatarGroupPopover/index.js.map +1 -0
  38. package/lib/components/AvatarGroupPopover/renderAvatarGroupPopover.js +23 -0
  39. package/lib/components/AvatarGroupPopover/renderAvatarGroupPopover.js.map +1 -0
  40. package/lib/components/AvatarGroupPopover/useAvatarGroupPopover.js +102 -0
  41. package/lib/components/AvatarGroupPopover/useAvatarGroupPopover.js.map +1 -0
  42. package/lib/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js +10 -0
  43. package/lib/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js.map +1 -0
  44. package/lib/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.js +307 -0
  45. package/lib/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.js.map +1 -0
  46. package/lib/contexts/AvatarGroupContext.js +7 -3
  47. package/lib/contexts/AvatarGroupContext.js.map +1 -1
  48. package/lib/index.js +4 -2
  49. package/lib/index.js.map +1 -1
  50. package/lib/utils/index.js +1 -0
  51. package/lib/utils/index.js.map +1 -1
  52. package/lib/utils/partitionAvatarGroupItems.js +30 -0
  53. package/lib/utils/partitionAvatarGroupItems.js.map +1 -0
  54. package/lib-commonjs/AvatarGroupPopover.js +10 -0
  55. package/lib-commonjs/AvatarGroupPopover.js.map +1 -0
  56. package/lib-commonjs/components/Avatar/useAvatar.js +2 -7
  57. package/lib-commonjs/components/Avatar/useAvatar.js.map +1 -1
  58. package/lib-commonjs/components/Avatar/useAvatarStyles.js +27 -5
  59. package/lib-commonjs/components/Avatar/useAvatarStyles.js.map +1 -1
  60. package/lib-commonjs/components/AvatarGroup/AvatarGroup.js +5 -2
  61. package/lib-commonjs/components/AvatarGroup/AvatarGroup.js.map +1 -1
  62. package/lib-commonjs/components/AvatarGroup/index.js +2 -0
  63. package/lib-commonjs/components/AvatarGroup/index.js.map +1 -1
  64. package/lib-commonjs/components/AvatarGroup/renderAvatarGroup.js +4 -32
  65. package/lib-commonjs/components/AvatarGroup/renderAvatarGroup.js.map +1 -1
  66. package/lib-commonjs/components/AvatarGroup/useAvatarGroup.js +3 -64
  67. package/lib-commonjs/components/AvatarGroup/useAvatarGroup.js.map +1 -1
  68. package/lib-commonjs/components/AvatarGroup/useAvatarGroupContextValues.js +23 -0
  69. package/lib-commonjs/components/AvatarGroup/useAvatarGroupContextValues.js.map +1 -0
  70. package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.js +3 -265
  71. package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.js.map +1 -1
  72. package/lib-commonjs/components/AvatarGroupItem/AvatarGroupItem.js +2 -2
  73. package/lib-commonjs/components/AvatarGroupItem/AvatarGroupItem.js.map +1 -1
  74. package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItem.js +8 -9
  75. package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItem.js.map +1 -1
  76. package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItemStyles.js +52 -60
  77. package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItemStyles.js.map +1 -1
  78. package/lib-commonjs/components/AvatarGroupPopover/AvatarGroupPopover.js +29 -0
  79. package/lib-commonjs/components/AvatarGroupPopover/AvatarGroupPopover.js.map +1 -0
  80. package/lib-commonjs/{contexts/AvatarGroupContext.types.js → components/AvatarGroupPopover/AvatarGroupPopover.types.js} +1 -1
  81. package/lib-commonjs/{contexts/AvatarGroupContext.types.js.map → components/AvatarGroupPopover/AvatarGroupPopover.types.js.map} +0 -0
  82. package/lib-commonjs/components/AvatarGroupPopover/index.js +18 -0
  83. package/lib-commonjs/components/AvatarGroupPopover/index.js.map +1 -0
  84. package/lib-commonjs/components/AvatarGroupPopover/renderAvatarGroupPopover.js +36 -0
  85. package/lib-commonjs/components/AvatarGroupPopover/renderAvatarGroupPopover.js.map +1 -0
  86. package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopover.js +118 -0
  87. package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopover.js.map +1 -0
  88. package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js +19 -0
  89. package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js.map +1 -0
  90. package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.js +321 -0
  91. package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.js.map +1 -0
  92. package/lib-commonjs/contexts/AvatarGroupContext.js +10 -3
  93. package/lib-commonjs/contexts/AvatarGroupContext.js.map +1 -1
  94. package/lib-commonjs/index.js +61 -1
  95. package/lib-commonjs/index.js.map +1 -1
  96. package/lib-commonjs/utils/index.js +10 -1
  97. package/lib-commonjs/utils/index.js.map +1 -1
  98. package/lib-commonjs/utils/partitionAvatarGroupItems.js +39 -0
  99. package/lib-commonjs/utils/partitionAvatarGroupItems.js.map +1 -0
  100. package/package.json +16 -13
  101. package/MIGRATION-AvatarGroup.md +0 -35
  102. package/dist/tsdoc-metadata.json +0 -11
  103. package/lib/contexts/AvatarGroupContext.types.js +0 -2
  104. package/lib/contexts/AvatarGroupContext.types.js.map +0 -1
@@ -1,12 +1,12 @@
1
- import { useSizeStyles } from '../../Avatar';
2
1
  import { __styles, mergeClasses, shorthands } from '@griffel/react';
3
2
  import { tokens, typographyStyles } from '@fluentui/react-theme';
3
+ import { useSizeStyles } from '../../Avatar';
4
4
  export const avatarGroupItemClassNames = {
5
5
  root: 'fui-AvatarGroupItem',
6
6
  avatar: 'fui-AvatarGroupItem__avatar',
7
7
  overflowLabel: 'fui-AvatarGroupItem__overflowLabel'
8
8
  };
9
- const avatarGroupItemDividerWidthVar = '--fuiAvatarGroupItem__divier--width';
9
+ const avatarGroupItemDividerWidthVar = '--fuiAvatarGroupItem__divider--width';
10
10
  /**
11
11
  * Styles for the root slot
12
12
  */
@@ -69,43 +69,10 @@ const useOverflowLabelStyles = /*#__PURE__*/__styles({
69
69
  "d": [".foyynoy{margin-left:var(--spacingHorizontalS);}", ".f1vcna3q{margin-right:var(--spacingHorizontalS);}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}"]
70
70
  });
71
71
  /**
72
- * Styles for the pie layout
72
+ * Styles for the stack layout
73
73
  */
74
74
 
75
75
 
76
- const usePieStyles = /*#__PURE__*/__styles({
77
- "base": {
78
- "qhf8xq": "f1euv43f"
79
- },
80
- "twoSlices": {
81
- "way436": "f1mfxe7f",
82
- "Bqy7o86": ["f1c18q0d", "fojsu5g"],
83
- "Hjso5x": "f1oifxvu",
84
- "B73oaz0": ["fqdbg8w", "fzmpboy"]
85
- },
86
- "threeSlices": {
87
- "way436": "f1mfxe7f",
88
- "Bqy7o86": ["f1c18q0d", "fojsu5g"],
89
- "B4jwau3": "f1ifdbou",
90
- "d8ohzp": ["f137bn9p", "ffwkz12"],
91
- "B395mff": "fkr8g3j",
92
- "Bqzfac6": "f1l8nhah",
93
- "tv7yr1": "f7qglgr",
94
- "Bo30zgl": "flj7kkj"
95
- },
96
- "thick": {
97
- "Bw9cqsg": "f1hcqiyb"
98
- },
99
- "thicker": {
100
- "Bw9cqsg": "f3scl8u"
101
- },
102
- "thickest": {
103
- "Bw9cqsg": "f46m186"
104
- }
105
- }, {
106
- "d": [".f1euv43f{position:absolute;}", ".f1mfxe7f:first-child{-webkit-clip-path:inset(0 calc(25% + (var(--fuiAvatarGroupItem__divier--width) / 2)) 0 25%);clip-path:inset(0 calc(25% + (var(--fuiAvatarGroupItem__divier--width) / 2)) 0 25%);}", ".f1c18q0d:first-child{left:-25%;}", ".fojsu5g:first-child{right:-25%;}", ".f1oifxvu:nth-child(2){-webkit-clip-path:inset(0 25% 0 calc(25% + (var(--fuiAvatarGroupItem__divier--width) / 2)));clip-path:inset(0 25% 0 calc(25% + (var(--fuiAvatarGroupItem__divier--width) / 2)));}", ".fqdbg8w:nth-child(2){left:25%;}", ".fzmpboy:nth-child(2){right:25%;}", ".f1ifdbou:not(:first-child){-webkit-clip-path:inset(0 0 var(--fuiAvatarGroupItem__divier--width) var(--fuiAvatarGroupItem__divier--width));clip-path:inset(0 0 var(--fuiAvatarGroupItem__divier--width) var(--fuiAvatarGroupItem__divier--width));}", ".f137bn9p:not(:first-child){left:50%;}", ".ffwkz12:not(:first-child){right:50%;}", ".fkr8g3j:not(:first-child){-webkit-transform:scale(0.5);-moz-transform:scale(0.5);-ms-transform:scale(0.5);transform:scale(0.5);}", ".f1l8nhah:not(:first-child){transform-origin:0 0;}", ".f7qglgr:nth-child(3){-webkit-clip-path:inset(var(--fuiAvatarGroupItem__divier--width) 0 0 var(--fuiAvatarGroupItem__divier--width));clip-path:inset(var(--fuiAvatarGroupItem__divier--width) 0 0 var(--fuiAvatarGroupItem__divier--width));}", ".flj7kkj:nth-child(3){top:50%;}", ".f1hcqiyb{--fuiAvatarGroupItem__divier--width:var(--strokeWidthThick);}", ".f3scl8u{--fuiAvatarGroupItem__divier--width:var(--strokeWidthThicker);}", ".f46m186{--fuiAvatarGroupItem__divier--width:var(--strokeWidthThickest);}"]
107
- });
108
-
109
76
  const useStackStyles = /*#__PURE__*/__styles({
110
77
  "base": {
111
78
  "Bsft5z2": "f1iwjod4",
@@ -129,11 +96,7 @@ const useStackStyles = /*#__PURE__*/__styles({
129
96
  "Bc0dv0h": "f1o149bd",
130
97
  "Bt0nq95": ["f1xgvrhv", "f34pcxu"],
131
98
  "Bte176d": "f9nu0bd",
132
- "Buo7p3s": ["f34pcxu", "f1xgvrhv"],
133
- "Bjwas2f": "f14pvji2",
134
- "Bn1d65q": ["f1xeojaw", "f1hodmrf"],
135
- "Bxeuatn": "fcbbwn3",
136
- "n51gp8": ["f1hodmrf", "f1xeojaw"]
99
+ "Buo7p3s": ["f34pcxu", "f1xgvrhv"]
137
100
  },
138
101
  "thick": {
139
102
  "a2br6o": "fiy03ts",
@@ -205,17 +168,13 @@ const useStackStyles = /*#__PURE__*/__styles({
205
168
  "d": [".f1iwjod4::after{content:'';}", ".f1mdlcz9::after{position:absolute;}", ".f15zbnnk::after{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f1de97fc::after{border-top-color:var(--colorNeutralBackground2);}", ".fnkdar3::after{border-right-color:var(--colorNeutralBackground2);}", ".f1rue1y9::after{border-left-color:var(--colorNeutralBackground2);}", ".f6bjq4p::after{border-bottom-color:var(--colorNeutralBackground2);}", ".fprarqb::after{border-bottom-right-radius:var(--borderRadiusCircular);}", ".f14vs0nd::after{border-bottom-left-radius:var(--borderRadiusCircular);}", ".f1gtfqs9::after{border-top-right-radius:var(--borderRadiusCircular);}", ".f18zvfd9::after{border-top-left-radius:var(--borderRadiusCircular);}", ".f8rth92::after{border-top-style:solid;}", ".flthirb::after{border-right-style:solid;}", ".ftkbnf5::after{border-left-style:solid;}", ".f1lh990p::after{border-bottom-style:solid;}", ".fiy03ts::after{width:100%;}", ".f5o33kw::after{height:100%;}", ".f5kz84h::after{left:calc(-1 * var(--strokeWidthThick));}", ".f8jassg::after{right:calc(-1 * var(--strokeWidthThick));}", ".f1oigyhu::after{top:calc(-1 * var(--strokeWidthThick));}", ".fozawe0::after{border-top-width:var(--strokeWidthThick);}", ".f15gmigz::after{border-right-width:var(--strokeWidthThick);}", ".f11o3tup::after{border-left-width:var(--strokeWidthThick);}", ".f14pi962::after{border-bottom-width:var(--strokeWidthThick);}", ".f1f2c3j3::after{left:calc(-1 * var(--strokeWidthThicker));}", ".f1g5d141::after{right:calc(-1 * var(--strokeWidthThicker));}", ".f1vvl5ts::after{top:calc(-1 * var(--strokeWidthThicker));}", ".f1gbh4dy::after{border-top-width:var(--strokeWidthThicker);}", ".f1os6oqe::after{border-right-width:var(--strokeWidthThicker);}", ".f4y7ea8::after{border-left-width:var(--strokeWidthThicker);}", ".f1a3lyng::after{border-bottom-width:var(--strokeWidthThicker);}", ".fueot05::after{left:calc(-1 * var(--strokeWidthThickest));}", ".f1mir6xb::after{right:calc(-1 * var(--strokeWidthThickest));}", ".f1izs6vq::after{top:calc(-1 * var(--strokeWidthThickest));}", ".f15ae8rs::after{border-top-width:var(--strokeWidthThickest);}", ".f1c7xjog::after{border-right-width:var(--strokeWidthThickest);}", ".fn35eni::after{border-left-width:var(--strokeWidthThickest);}", ".f9v1pvc::after{border-bottom-width:var(--strokeWidthThickest);}", ".fe2wxzu::after{width:calc(100% + var(--strokeWidthThin) * 2);}", ".fcr18t3::after{height:calc(100% + var(--strokeWidthThin) * 2);}", ".fhjhgwu::after{left:calc(-1 * (var(--strokeWidthThick) + var(--strokeWidthThin)));}", ".fh9v7u1::after{right:calc(-1 * (var(--strokeWidthThick) + var(--strokeWidthThin)));}", ".f1mqssek::after{top:calc(-1 * (var(--strokeWidthThick) + var(--strokeWidthThin)));}", ".f19rfb2x::after{width:calc(100% + var(--strokeWidthThick) * 2);}", ".fk4cr37::after{height:calc(100% + var(--strokeWidthThick) * 2);}", ".foc71j7::after{left:calc(-1 * var(--strokeWidthThick) * 2);}", ".f1xoeo06::after{right:calc(-1 * var(--strokeWidthThick) * 2);}", ".fd6iyyb::after{top:calc(-1 * var(--strokeWidthThick) * 2);}", ".f1byqz6t::after{width:calc(100% + var(--strokeWidthThicker) * 2);}", ".fdqxnrd::after{height:calc(100% + var(--strokeWidthThicker) * 2);}", ".f1x8rm7i::after{left:calc(-1 * var(--strokeWidthThicker) * 2);}", ".ftx9300::after{right:calc(-1 * var(--strokeWidthThicker) * 2);}", ".f13zu3lb::after{top:calc(-1 * var(--strokeWidthThicker) * 2);}", ".f1i9snzy::after{width:calc(100% + var(--strokeWidthThickest) * 2);}", ".f19z50l7::after{height:calc(100% + var(--strokeWidthThickest) * 2);}", ".f1fgc9m6::after{left:calc(-1 * var(--strokeWidthThickest) * 2);}", ".f1d4bgoy::after{right:calc(-1 * var(--strokeWidthThickest) * 2);}", ".fkll7mr::after{top:calc(-1 * var(--strokeWidthThickest) * 2);}", ".f1cjco14:not(:first-child){margin-left:calc(-1 * var(--spacingHorizontalXXS));}", ".f13dxjc9:not(:first-child){margin-right:calc(-1 * var(--spacingHorizontalXXS));}", ".f15p6bln:not(:first-child){margin-left:calc(-1 * var(--spacingHorizontalXS));}", ".f1bab3ru:not(:first-child){margin-right:calc(-1 * var(--spacingHorizontalXS));}", ".f1v53ncc:not(:first-child){margin-left:calc(-1 * var(--spacingHorizontalS));}", ".f17pu8r8:not(:first-child){margin-right:calc(-1 * var(--spacingHorizontalS));}", ".flv48ch:not(:first-child){margin-left:calc(-1 * var(--spacingHorizontalL));}", ".fnh1ydj:not(:first-child){margin-right:calc(-1 * var(--spacingHorizontalL));}"],
206
169
  "m": [["@media (forced-colors: active){.f1dpauah::after{forced-color-adjust:none;}}", {
207
170
  "m": "(forced-colors: active)"
208
- }], ["@media (forced-colors: active){.f14pvji2{border-top-color:Canvas;}}", {
209
- "m": "(forced-colors: active)"
210
- }], ["@media (forced-colors: active){.f1xeojaw{border-right-color:Canvas;}.f1hodmrf{border-left-color:Canvas;}}", {
211
- "m": "(forced-colors: active)"
212
- }], ["@media (forced-colors: active){.fcbbwn3{border-bottom-color:Canvas;}}", {
213
- "m": "(forced-colors: active)"
214
- }], ["@media (forced-colors: active){.f1hodmrf{border-left-color:Canvas;}.f1xeojaw{border-right-color:Canvas;}}", {
215
- "m": "(forced-colors: active)"
216
171
  }]],
217
172
  "f": [".f1o149bd:focus::after{border-top-color:transparent;}", ".f1xgvrhv:focus::after{border-right-color:transparent;}", ".f34pcxu:focus::after{border-left-color:transparent;}", ".f9nu0bd:focus::after{border-bottom-color:transparent;}"]
218
173
  });
174
+ /**
175
+ * Styles for the spread layout
176
+ */
177
+
219
178
 
220
179
  const useSpreadStyles = /*#__PURE__*/__styles({
221
180
  "s": {
@@ -236,6 +195,44 @@ const useSpreadStyles = /*#__PURE__*/__styles({
236
195
  }, {
237
196
  "d": [".f7lhxv7:not(:first-child){margin-left:var(--spacingHorizontalS);}", ".f6ou2b0:not(:first-child){margin-right:var(--spacingHorizontalS);}", ".f1h0okno:not(:first-child){margin-left:var(--spacingHorizontalMNudge);}", ".fnnqava:not(:first-child){margin-right:var(--spacingHorizontalMNudge);}", ".f1wkt588:not(:first-child){margin-left:var(--spacingHorizontalM);}", ".f1maio5g:not(:first-child){margin-right:var(--spacingHorizontalM);}", ".f1l333zn:not(:first-child){margin-left:var(--spacingHorizontalL);}", ".f1r41m4c:not(:first-child){margin-right:var(--spacingHorizontalL);}", ".fahr13a:not(:first-child){margin-left:var(--spacingHorizontalXL);}", ".f2n7rbo:not(:first-child){margin-right:var(--spacingHorizontalXL);}"]
238
197
  });
198
+ /**
199
+ * Styles for the pie layout
200
+ */
201
+
202
+
203
+ const usePieStyles = /*#__PURE__*/__styles({
204
+ "base": {
205
+ "qhf8xq": "f1euv43f"
206
+ },
207
+ "slices": {
208
+ "B3gf25r": "f16m7w7k",
209
+ "Be2twx7": ["f1o4hhgz", "fb4gjrz"],
210
+ "Bvaow4n": "f1pgb5nx",
211
+ "Gpecfs": ["fugirid", "f4sk99m"],
212
+ "bhabj1": "fjreaf3",
213
+ "B7rc6i7": ["f1k4vw81", "f1w1xcy7"],
214
+ "Bwrfys5": "f1ef8vxk",
215
+ "Bwuzm9m": ["f1x2qbfv", "f1xwf4nz"],
216
+ "fflka": "ff6xuso",
217
+ "do7bja": "fzpvk6c",
218
+ "Be8zqhl": "f4onu7f",
219
+ "Bij0kh0": ["f1ydfez1", "fjensob"],
220
+ "Bwexnyt": "f1yv732j",
221
+ "Bhe5x6o": "fchq2fj",
222
+ "B3kv7bh": "ff5binh"
223
+ },
224
+ "thick": {
225
+ "uiicq7": "fnyfzln"
226
+ },
227
+ "thicker": {
228
+ "uiicq7": "f1xdzzot"
229
+ },
230
+ "thickest": {
231
+ "uiicq7": "f1auhru5"
232
+ }
233
+ }, {
234
+ "d": [".f1euv43f{position:absolute;}", ".f16m7w7k:nth-of-type(1):nth-last-of-type(2){-webkit-clip-path:inset(0 calc(25% + (var(--fuiAvatarGroupItem__divider--width) / 2)) 0 25%);clip-path:inset(0 calc(25% + (var(--fuiAvatarGroupItem__divider--width) / 2)) 0 25%);}", ".f1o4hhgz:nth-of-type(1):nth-last-of-type(2){left:-25%;}", ".fb4gjrz:nth-of-type(1):nth-last-of-type(2){right:-25%;}", ".f1pgb5nx:nth-of-type(2):nth-last-of-type(1){-webkit-clip-path:inset(0 25% 0 calc(25% + (var(--fuiAvatarGroupItem__divider--width) / 2)));clip-path:inset(0 25% 0 calc(25% + (var(--fuiAvatarGroupItem__divider--width) / 2)));}", ".fugirid:nth-of-type(2):nth-last-of-type(1){left:25%;}", ".f4sk99m:nth-of-type(2):nth-last-of-type(1){right:25%;}", ".fjreaf3:nth-of-type(1):nth-last-of-type(3){-webkit-clip-path:inset(0 calc(25% + (var(--fuiAvatarGroupItem__divider--width) / 2)) 0 25%);clip-path:inset(0 calc(25% + (var(--fuiAvatarGroupItem__divider--width) / 2)) 0 25%);}", ".f1k4vw81:nth-of-type(1):nth-last-of-type(3){left:-25%;}", ".f1w1xcy7:nth-of-type(1):nth-last-of-type(3){right:-25%;}", ".f1ef8vxk:nth-of-type(2):nth-last-of-type(2){-webkit-clip-path:inset(0 0 var(--fuiAvatarGroupItem__divider--width) var(--fuiAvatarGroupItem__divider--width));clip-path:inset(0 0 var(--fuiAvatarGroupItem__divider--width) var(--fuiAvatarGroupItem__divider--width));}", ".f1x2qbfv:nth-of-type(2):nth-last-of-type(2){left:50%;}", ".f1xwf4nz:nth-of-type(2):nth-last-of-type(2){right:50%;}", ".ff6xuso:nth-of-type(2):nth-last-of-type(2){-webkit-transform:scale(0.5);-moz-transform:scale(0.5);-ms-transform:scale(0.5);transform:scale(0.5);}", ".fzpvk6c:nth-of-type(2):nth-last-of-type(2){transform-origin:0 0;}", ".f4onu7f:nth-of-type(3):nth-last-of-type(1){-webkit-clip-path:inset(var(--fuiAvatarGroupItem__divider--width) 0 0 var(--fuiAvatarGroupItem__divider--width));clip-path:inset(var(--fuiAvatarGroupItem__divider--width) 0 0 var(--fuiAvatarGroupItem__divider--width));}", ".f1ydfez1:nth-of-type(3):nth-last-of-type(1){left:50%;}", ".fjensob:nth-of-type(3):nth-last-of-type(1){right:50%;}", ".f1yv732j:nth-of-type(3):nth-last-of-type(1){top:50%;}", ".fchq2fj:nth-of-type(3):nth-last-of-type(1){-webkit-transform:scale(0.5);-moz-transform:scale(0.5);-ms-transform:scale(0.5);transform:scale(0.5);}", ".ff5binh:nth-of-type(3):nth-last-of-type(1){transform-origin:0 0;}", ".fnyfzln{--fuiAvatarGroupItem__divider--width:var(--strokeWidthThick);}", ".f1xdzzot{--fuiAvatarGroupItem__divider--width:var(--strokeWidthThicker);}", ".f1auhru5{--fuiAvatarGroupItem__divider--width:var(--strokeWidthThickest);}"]
235
+ });
239
236
  /**
240
237
  * Apply styling to the AvatarGroupItem slots based on the state
241
238
  */
@@ -243,16 +240,15 @@ const useSpreadStyles = /*#__PURE__*/__styles({
243
240
 
244
241
  export const useAvatarGroupItemStyles_unstable = state => {
245
242
  const {
246
- nonOverflowAvatarsCount,
247
243
  isOverflowItem,
248
244
  layout,
249
245
  size
250
246
  } = state;
251
- const rootStyles = useRootStyles();
247
+ const avatarStyles = useAvatarStyles();
248
+ const overflowLabelStyles = useOverflowLabelStyles();
252
249
  const pieStyles = usePieStyles();
250
+ const rootStyles = useRootStyles();
253
251
  const sizeStyles = useSizeStyles();
254
- const overflowLabelStyles = useOverflowLabelStyles();
255
- const avatarStyles = useAvatarStyles();
256
252
  const groupChildClassName = useGroupChildClassName(layout, size);
257
253
  const rootClasses = [rootStyles.base];
258
254
 
@@ -272,18 +268,14 @@ export const useAvatarGroupItemStyles_unstable = state => {
272
268
  rootClasses.push(pieStyles.thickest);
273
269
  }
274
270
 
275
- if (nonOverflowAvatarsCount === 2) {
276
- rootClasses.push(pieStyles.twoSlices);
277
- } else if (nonOverflowAvatarsCount === 3) {
278
- rootClasses.push(pieStyles.threeSlices);
279
- }
271
+ rootClasses.push(pieStyles.slices);
280
272
  }
281
273
  } else {
282
274
  rootClasses.push(rootStyles.overflowItem);
283
275
  }
284
276
 
285
277
  state.root.className = mergeClasses(avatarGroupItemClassNames.root, ...rootClasses, state.root.className);
286
- state.avatar.className = mergeClasses(avatarGroupItemClassNames.avatar, !isOverflowItem && avatarStyles.nonOverflowItem, !isOverflowItem && layout === 'pie' && avatarStyles.pie, state.avatar.className);
278
+ state.avatar.className = mergeClasses(avatarGroupItemClassNames.avatar, !isOverflowItem && avatarStyles.nonOverflowItem, layout === 'pie' && avatarStyles.pie, state.avatar.className);
287
279
 
288
280
  if (state.overflowLabel) {
289
281
  state.overflowLabel.className = mergeClasses(avatarGroupItemClassNames.overflowLabel, overflowLabelStyles.base, state.overflowLabel.className);
@@ -1 +1 @@
1
- {"version":3,"sources":["components/AvatarGroupItem/useAvatarGroupItemStyles.ts"],"names":[],"mappings":"AAAA,SAAS,aAAT,QAA8B,cAA9B;AACA,mBAAqB,YAArB,EAAmC,UAAnC,QAAqD,gBAArD;AACA,SAAS,MAAT,EAAiB,gBAAjB,QAAyC,uBAAzC;AAMA,OAAO,MAAM,yBAAyB,GAAyC;EAC7E,IAAI,EAAE,qBADuE;EAE7E,MAAM,EAAE,6BAFqE;EAG7E,aAAa,EAAE;AAH8D,CAAxE;AAMP,MAAM,8BAA8B,GAAG,qCAAvC;AAEA;;AAEG;;AACH,MAAM,aAAa,gBAAG;EAAA;IAAA;IAAA;I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Ae;QACpB,aAAa,CAAC,IAAd,CAAmB,YAAY,CAAC,CAAhC;MACD,CAFM,MAEA;QACL,aAAa,CAAC,IAAd,CAAmB,YAAY,CAAC,EAAhC;MACD;IACF;EACF;;EAED,OAAO,YAAY,CAAC,GAAG,aAAJ,CAAnB;AACD,CA5DM","sourcesContent":["import { useSizeStyles } from '../../Avatar';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { AvatarSizes } from '../../Avatar';\nimport type { AvatarGroupProps } from '../../AvatarGroup';\nimport type { AvatarGroupItemSlots, AvatarGroupItemState } from './AvatarGroupItem.types';\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__divier--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 pie layout\n */\nconst usePieStyles = makeStyles({\n base: {\n position: 'absolute',\n },\n twoSlices: {\n '&:first-child': {\n clipPath: `inset(0 calc(25% + (var(${avatarGroupItemDividerWidthVar}) / 2)) 0 25%)`,\n left: '-25%',\n },\n '&:nth-child(2)': {\n clipPath: `inset(0 25% 0 calc(25% + (var(${avatarGroupItemDividerWidthVar}) / 2)))`,\n left: '25%',\n },\n },\n threeSlices: {\n '&:first-child': {\n clipPath: `inset(0 calc(25% + (var(${avatarGroupItemDividerWidthVar}) / 2)) 0 25%)`,\n left: '-25%',\n },\n '&:not(:first-child)': {\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 '&:nth-child(3)': {\n clipPath: `inset(var(${avatarGroupItemDividerWidthVar}) 0 0 var(${avatarGroupItemDividerWidthVar}))`,\n top: '50%',\n },\n },\n thick: { [avatarGroupItemDividerWidthVar]: tokens.strokeWidthThick },\n thicker: { [avatarGroupItemDividerWidthVar]: tokens.strokeWidthThicker },\n thickest: { [avatarGroupItemDividerWidthVar]: tokens.strokeWidthThickest },\n});\n\nconst useStackStyles = makeStyles({\n base: {\n '&::after': {\n content: \"''\",\n position: 'absolute',\n display: 'inline-flex',\n // Border is used instead of outline due to a bug in webkit browsers where border-radius is ignored in outline.\n ...shorthands.borderColor(tokens.colorNeutralBackground2),\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n ...shorthands.borderStyle('solid'),\n\n '@media (forced-colors: active)': {\n forcedColorAdjust: 'none',\n },\n },\n },\n overflowButton: {\n // border-color has to be set to transparent when there's focus due to the outline overlapping the focus ring.\n '&:focus': {\n '&::after': {\n ...shorthands.borderColor('transparent'),\n },\n },\n // hide inner border when using high contrast mode and use the outer (::after) to match Avatar's outline\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('Canvas'),\n },\n },\n thick: {\n '&::after': {\n width: '100%',\n height: '100%',\n left: `calc(-1 * ${tokens.strokeWidthThick})`,\n top: `calc(-1 * ${tokens.strokeWidthThick})`,\n ...shorthands.borderWidth(tokens.strokeWidthThick),\n },\n },\n thicker: {\n '&::after': {\n width: '100%',\n height: '100%',\n left: `calc(-1 * ${tokens.strokeWidthThicker})`,\n top: `calc(-1 * ${tokens.strokeWidthThicker})`,\n ...shorthands.borderWidth(tokens.strokeWidthThicker),\n },\n },\n thickest: {\n '&::after': {\n width: '100%',\n height: '100%',\n left: `calc(-1 * ${tokens.strokeWidthThickest})`,\n top: `calc(-1 * ${tokens.strokeWidthThickest})`,\n ...shorthands.borderWidth(tokens.strokeWidthThickest),\n },\n },\n borderThin: {\n '&::after': {\n width: `calc(100% + ${tokens.strokeWidthThin} * 2)`,\n height: `calc(100% + ${tokens.strokeWidthThin} * 2)`,\n left: `calc(-1 * (${tokens.strokeWidthThick} + ${tokens.strokeWidthThin}))`,\n top: `calc(-1 * (${tokens.strokeWidthThick} + ${tokens.strokeWidthThin}))`,\n },\n },\n borderThick: {\n '&::after': {\n width: `calc(100% + ${tokens.strokeWidthThick} * 2)`,\n height: `calc(100% + ${tokens.strokeWidthThick} * 2)`,\n left: `calc(-1 * ${tokens.strokeWidthThick} * 2)`,\n top: `calc(-1 * ${tokens.strokeWidthThick} * 2)`,\n },\n },\n borderThicker: {\n '&::after': {\n width: `calc(100% + ${tokens.strokeWidthThicker} * 2)`,\n height: `calc(100% + ${tokens.strokeWidthThicker} * 2)`,\n left: `calc(-1 * ${tokens.strokeWidthThicker} * 2)`,\n top: `calc(-1 * ${tokens.strokeWidthThicker} * 2)`,\n },\n },\n borderThickest: {\n '&::after': {\n width: `calc(100% + ${tokens.strokeWidthThickest} * 2)`,\n height: `calc(100% + ${tokens.strokeWidthThickest} * 2)`,\n left: `calc(-1 * ${tokens.strokeWidthThickest} * 2)`,\n top: `calc(-1 * ${tokens.strokeWidthThickest} * 2)`,\n },\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\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 * Apply styling to the AvatarGroupItem slots based on the state\n */\nexport const useAvatarGroupItemStyles_unstable = (state: AvatarGroupItemState): AvatarGroupItemState => {\n const { nonOverflowAvatarsCount, isOverflowItem, layout, size } = state;\n\n const rootStyles = useRootStyles();\n const pieStyles = usePieStyles();\n const sizeStyles = useSizeStyles();\n const overflowLabelStyles = useOverflowLabelStyles();\n const avatarStyles = useAvatarStyles();\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 if (nonOverflowAvatarsCount === 2) {\n rootClasses.push(pieStyles.twoSlices);\n } else if (nonOverflowAvatarsCount === 3) {\n rootClasses.push(pieStyles.threeSlices);\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 !isOverflowItem && 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 = (\n layout: AvatarGroupProps['layout'],\n size: AvatarSizes,\n isOverflowButton?: boolean,\n): string => {\n const stackStyles = useStackStyles();\n const spreadStyles = useSpreadStyles();\n const layoutClasses = [];\n\n if (size) {\n if (layout === 'stack') {\n layoutClasses.push(stackStyles.base);\n\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 // When the child is an overflowButton, we have to calculate the overflowButton's border + width + outline width\n // since the ::after pseudo-element doesn't take the overflowButton's border for its size.\n if (isOverflowButton) {\n layoutClasses.push(stackStyles.overflowButton);\n\n if (size < 36) {\n layoutClasses.push(stackStyles.borderThin);\n } else if (size < 56) {\n layoutClasses.push(stackStyles.borderThick);\n } else if (size < 72) {\n layoutClasses.push(stackStyles.borderThicker);\n } else {\n layoutClasses.push(stackStyles.borderThickest);\n }\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"],"sourceRoot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e;QACb,aAAa,CAAC,IAAd,CAAmB,YAAY,CAAC,CAAhC;MACD,CAFD,MAEO,IAAI,IAAI,GAAG,EAAX,EAAe;QACpB,aAAa,CAAC,IAAd,CAAmB,YAAY,CAAC,MAAhC;MACD,CAFM,MAEA,IAAI,IAAI,GAAG,EAAX,EAAe;QACpB,aAAa,CAAC,IAAd,CAAmB,YAAY,CAAC,CAAhC;MACD,CAFM,MAEA;QACL,aAAa,CAAC,IAAd,CAAmB,YAAY,CAAC,EAAhC;MACD;IACF;EACF;;EAED,OAAO,YAAY,CAAC,GAAG,aAAJ,CAAnB;AACD,CA5DM","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { useSizeStyles } from '../../Avatar';\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 base: {\n '&::after': {\n content: \"''\",\n position: 'absolute',\n display: 'inline-flex',\n // Border is used instead of outline due to a bug in webkit browsers where border-radius is ignored in outline.\n ...shorthands.borderColor(tokens.colorNeutralBackground2),\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n ...shorthands.borderStyle('solid'),\n\n '@media (forced-colors: active)': {\n forcedColorAdjust: 'none',\n },\n },\n },\n overflowButton: {\n '&:focus::after': {\n ...shorthands.borderColor('transparent'),\n },\n },\n thick: {\n '&::after': {\n width: '100%',\n height: '100%',\n left: `calc(-1 * ${tokens.strokeWidthThick})`,\n top: `calc(-1 * ${tokens.strokeWidthThick})`,\n ...shorthands.borderWidth(tokens.strokeWidthThick),\n },\n },\n thicker: {\n '&::after': {\n width: '100%',\n height: '100%',\n left: `calc(-1 * ${tokens.strokeWidthThicker})`,\n top: `calc(-1 * ${tokens.strokeWidthThicker})`,\n ...shorthands.borderWidth(tokens.strokeWidthThicker),\n },\n },\n thickest: {\n '&::after': {\n width: '100%',\n height: '100%',\n left: `calc(-1 * ${tokens.strokeWidthThickest})`,\n top: `calc(-1 * ${tokens.strokeWidthThickest})`,\n ...shorthands.borderWidth(tokens.strokeWidthThickest),\n },\n },\n borderThin: {\n '&::after': {\n width: `calc(100% + ${tokens.strokeWidthThin} * 2)`,\n height: `calc(100% + ${tokens.strokeWidthThin} * 2)`,\n left: `calc(-1 * (${tokens.strokeWidthThick} + ${tokens.strokeWidthThin}))`,\n top: `calc(-1 * (${tokens.strokeWidthThick} + ${tokens.strokeWidthThin}))`,\n },\n },\n borderThick: {\n '&::after': {\n width: `calc(100% + ${tokens.strokeWidthThick} * 2)`,\n height: `calc(100% + ${tokens.strokeWidthThick} * 2)`,\n left: `calc(-1 * ${tokens.strokeWidthThick} * 2)`,\n top: `calc(-1 * ${tokens.strokeWidthThick} * 2)`,\n },\n },\n borderThicker: {\n '&::after': {\n width: `calc(100% + ${tokens.strokeWidthThicker} * 2)`,\n height: `calc(100% + ${tokens.strokeWidthThicker} * 2)`,\n left: `calc(-1 * ${tokens.strokeWidthThicker} * 2)`,\n top: `calc(-1 * ${tokens.strokeWidthThicker} * 2)`,\n },\n },\n borderThickest: {\n '&::after': {\n width: `calc(100% + ${tokens.strokeWidthThickest} * 2)`,\n height: `calc(100% + ${tokens.strokeWidthThickest} * 2)`,\n left: `calc(-1 * ${tokens.strokeWidthThickest} * 2)`,\n top: `calc(-1 * ${tokens.strokeWidthThickest} * 2)`,\n },\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 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\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 } 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 = (\n layout: AvatarGroupProps['layout'],\n size: AvatarSizes,\n isOverflowButton?: boolean,\n): string => {\n const stackStyles = useStackStyles();\n const spreadStyles = useSpreadStyles();\n const layoutClasses = [];\n\n if (size) {\n if (layout === 'stack') {\n layoutClasses.push(stackStyles.base);\n\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 // When the child is an overflowButton, we have to calculate the overflowButton's border + width + outline width\n // since the ::after pseudo-element doesn't take the overflowButton's border for its size.\n if (isOverflowButton) {\n layoutClasses.push(stackStyles.overflowButton);\n\n if (size < 36) {\n layoutClasses.push(stackStyles.borderThin);\n } else if (size < 56) {\n layoutClasses.push(stackStyles.borderThick);\n } else if (size < 72) {\n layoutClasses.push(stackStyles.borderThicker);\n } else {\n layoutClasses.push(stackStyles.borderThickest);\n }\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"],"sourceRoot":"../src/"}
@@ -0,0 +1,16 @@
1
+ import { renderAvatarGroupPopover_unstable } from './renderAvatarGroupPopover';
2
+ import { useAvatarGroupPopoverContextValues } from './useAvatarGroupPopoverContextValues';
3
+ import { useAvatarGroupPopover_unstable } from './useAvatarGroupPopover';
4
+ import { useAvatarGroupPopoverStyles_unstable } from './useAvatarGroupPopoverStyles';
5
+ /**
6
+ * The AvatarGroupPopover component provides a button with a Popover containing the children provided.
7
+ */
8
+
9
+ export const AvatarGroupPopover = props => {
10
+ const state = useAvatarGroupPopover_unstable(props);
11
+ const contextValues = useAvatarGroupPopoverContextValues(state);
12
+ useAvatarGroupPopoverStyles_unstable(state);
13
+ return renderAvatarGroupPopover_unstable(state, contextValues);
14
+ };
15
+ AvatarGroupPopover.displayName = 'AvatarGroupPopover';
16
+ //# sourceMappingURL=AvatarGroupPopover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/AvatarGroupPopover/AvatarGroupPopover.tsx"],"names":[],"mappings":"AACA,SAAS,iCAAT,QAAkD,4BAAlD;AACA,SAAS,kCAAT,QAAmD,sCAAnD;AACA,SAAS,8BAAT,QAA+C,yBAA/C;AACA,SAAS,oCAAT,QAAqD,+BAArD;AAGA;;AAEG;;AACH,OAAO,MAAM,kBAAkB,GAAsC,KAAK,IAAG;EAC3E,MAAM,KAAK,GAAG,8BAA8B,CAAC,KAAD,CAA5C;EACA,MAAM,aAAa,GAAG,kCAAkC,CAAC,KAAD,CAAxD;EAEA,oCAAoC,CAAC,KAAD,CAApC;EACA,OAAO,iCAAiC,CAAC,KAAD,EAAQ,aAAR,CAAxC;AACD,CANM;AAQP,kBAAkB,CAAC,WAAnB,GAAiC,oBAAjC","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"],"sourceRoot":"../src/"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=AvatarGroupPopover.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AvatarGroupPopover.types.js","sourceRoot":"../src/","sources":["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, 'indicator'>> & {\n popoverOpen: boolean;\n layout: AvatarGroupProps['layout'];\n size: AvatarSizes;\n };\n"]}
@@ -0,0 +1,6 @@
1
+ export * from './AvatarGroupPopover';
2
+ export * from './AvatarGroupPopover.types';
3
+ export * from './renderAvatarGroupPopover';
4
+ export * from './useAvatarGroupPopover';
5
+ export * from './useAvatarGroupPopoverStyles';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/AvatarGroupPopover/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC","sourcesContent":["export * from './AvatarGroupPopover';\nexport * from './AvatarGroupPopover.types';\nexport * from './renderAvatarGroupPopover';\nexport * from './useAvatarGroupPopover';\nexport * from './useAvatarGroupPopoverStyles';\n"]}
@@ -0,0 +1,23 @@
1
+ import * as React from 'react';
2
+ import { AvatarGroupProvider } from '../../contexts/AvatarGroupContext';
3
+ import { getSlots } from '@fluentui/react-utilities';
4
+ import { PopoverTrigger } from '@fluentui/react-popover';
5
+ /**
6
+ * Render the final JSX of AvatarGroupPopover
7
+ */
8
+
9
+ export const renderAvatarGroupPopover_unstable = (state, contextValues) => {
10
+ const {
11
+ slots,
12
+ slotProps
13
+ } = getSlots(state);
14
+ return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
15
+ }, /*#__PURE__*/React.createElement(PopoverTrigger, null, /*#__PURE__*/React.createElement(slots.tooltip, { ...slotProps.tooltip
16
+ }, /*#__PURE__*/React.createElement(slots.triggerButton, { ...slotProps.triggerButton
17
+ }))), /*#__PURE__*/React.createElement(slots.popoverSurface, { ...slotProps.popoverSurface
18
+ }, /*#__PURE__*/React.createElement(AvatarGroupProvider, {
19
+ value: contextValues.avatarGroup
20
+ }, /*#__PURE__*/React.createElement(slots.content, { ...slotProps.content
21
+ }))));
22
+ };
23
+ //# sourceMappingURL=renderAvatarGroupPopover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/AvatarGroupPopover/renderAvatarGroupPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,mBAAT,QAAoC,mCAApC;AAEA,SAAS,QAAT,QAAyB,2BAAzB;AACA,SAAuB,cAAvB,QAA6C,yBAA7C;AAIA;;AAEG;;AACH,OAAO,MAAM,iCAAiC,GAAG,CAC/C,KAD+C,EAE/C,aAF+C,KAG7C;EACF,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAA0B,KAA1B,CAArC;EAEA,oBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAM,SAAS,CAAC;EAAhB,CAAX,eACE,KAAA,CAAA,aAAA,CAAC,cAAD,EAAe,IAAf,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,OAAP,EAAc,EAAA,GAAM,SAAS,CAAC;EAAhB,CAAd,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,aAAP,EAAoB,EAAA,GAAK,SAAS,CAAC;EAAf,CAApB,CADF,CADF,CADF,eAME,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,cAAP,EAAqB,EAAA,GAAK,SAAS,CAAC;EAAf,CAArB,eACE,KAAA,CAAA,aAAA,CAAC,mBAAD,EAAoB;IAAC,KAAK,EAAE,aAAa,CAAC;EAAtB,CAApB,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,OAAP,EAAc,EAAA,GAAK,SAAS,CAAC;EAAf,CAAd,CADF,CADF,CANF,CADF;AAcD,CApBM","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>\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"],"sourceRoot":"../src/"}
@@ -0,0 +1,102 @@
1
+ import * as React from 'react';
2
+ import { useAvatarGroupContext_unstable } from '../../contexts/AvatarGroupContext';
3
+ import { defaultAvatarGroupSize } from '../AvatarGroup/useAvatarGroup';
4
+ import { resolveShorthand, useControllableState } from '@fluentui/react-utilities';
5
+ import { MoreHorizontalRegular } from '@fluentui/react-icons';
6
+ import { Popover, PopoverSurface } from '@fluentui/react-popover';
7
+ import { Tooltip } from '@fluentui/react-tooltip';
8
+ /**
9
+ * Create the state required to render AvatarGroupPopover.
10
+ *
11
+ * The returned state can be modified with hooks such as useAvatarGroupPopoverStyles_unstable,
12
+ * before being passed to renderAvatarGroupPopover_unstable.
13
+ *
14
+ * @param props - props from this instance of AvatarGroupPopover
15
+ */
16
+
17
+ export const useAvatarGroupPopover_unstable = props => {
18
+ var _a;
19
+
20
+ const size = (_a = useAvatarGroupContext_unstable(ctx => ctx.size)) !== null && _a !== void 0 ? _a : defaultAvatarGroupSize;
21
+ const layout = useAvatarGroupContext_unstable(ctx => ctx.layout);
22
+ const {
23
+ indicator = size < 24 ? 'icon' : 'count',
24
+ count = React.Children.count(props.children),
25
+ children,
26
+ ...restOfProps
27
+ } = props;
28
+ const [popoverOpen, setPopoverOpen] = useControllableState({
29
+ state: props.open,
30
+ defaultState: props.defaultOpen,
31
+ initialState: false
32
+ });
33
+
34
+ const handleOnPopoverChange = (e, data) => {
35
+ var _a;
36
+
37
+ (_a = restOfProps.onOpenChange) === null || _a === void 0 ? void 0 : _a.call(restOfProps, e, data);
38
+ setPopoverOpen(data.open);
39
+ };
40
+
41
+ let triggerButtonChildren;
42
+
43
+ if (layout === 'pie') {
44
+ triggerButtonChildren = null;
45
+ } else if (indicator === 'icon') {
46
+ triggerButtonChildren = /*#__PURE__*/React.createElement(MoreHorizontalRegular, null);
47
+ } else {
48
+ triggerButtonChildren = count > 99 ? '99+' : `+${count}`;
49
+ }
50
+
51
+ return {
52
+ popoverOpen,
53
+ layout,
54
+ indicator,
55
+ size,
56
+ components: {
57
+ root: Popover,
58
+ triggerButton: 'button',
59
+ content: 'ul',
60
+ popoverSurface: PopoverSurface,
61
+ tooltip: Tooltip
62
+ },
63
+ root: {
64
+ // Popover expects a child for its children. The children are added in the renderAvatarGroupPopover.
65
+ children: /*#__PURE__*/React.createElement(React.Fragment, null),
66
+ size: 'small',
67
+ trapFocus: true,
68
+ ...restOfProps,
69
+ open: popoverOpen,
70
+ onOpenChange: handleOnPopoverChange
71
+ },
72
+ triggerButton: resolveShorthand(props.triggerButton, {
73
+ required: true,
74
+ defaultProps: {
75
+ children: triggerButtonChildren,
76
+ type: 'button'
77
+ }
78
+ }),
79
+ content: resolveShorthand(props.content, {
80
+ required: true,
81
+ defaultProps: {
82
+ children: children,
83
+ role: 'list'
84
+ }
85
+ }),
86
+ popoverSurface: resolveShorthand(props.popoverSurface, {
87
+ required: true,
88
+ defaultProps: {
89
+ 'aria-label': 'Overflow',
90
+ tabIndex: 0
91
+ }
92
+ }),
93
+ tooltip: resolveShorthand(props.tooltip, {
94
+ required: true,
95
+ defaultProps: {
96
+ content: 'View more people.',
97
+ relationship: 'label'
98
+ }
99
+ })
100
+ };
101
+ };
102
+ //# sourceMappingURL=useAvatarGroupPopover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/AvatarGroupPopover/useAvatarGroupPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,8BAAT,QAA+C,mCAA/C;AACA,SAAS,sBAAT,QAAuC,+BAAvC;AACA,SAAS,gBAAT,EAA2B,oBAA3B,QAAuD,2BAAvD;AACA,SAAS,qBAAT,QAAsC,uBAAtC;AACA,SAA8C,OAA9C,EAAuD,cAAvD,QAA6E,yBAA7E;AAEA,SAAS,OAAT,QAAwB,yBAAxB;AAEA;;;;;;;AAOG;;AACH,OAAO,MAAM,8BAA8B,GAAI,KAAD,IAA4D;;;EACxG,MAAM,IAAI,GAAG,CAAA,EAAA,GAAA,8BAA8B,CAAC,GAAG,IAAI,GAAG,CAAC,IAAZ,CAA9B,MAA+C,IAA/C,IAA+C,EAAA,KAAA,KAAA,CAA/C,GAA+C,EAA/C,GAAmD,sBAAhE;EACA,MAAM,MAAM,GAAG,8BAA8B,CAAC,GAAG,IAAI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ACA,QAAQ,eAAE,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,CAFN;MAGJ,IAAI,EAAE,OAHF;MAIJ,SAAS,EAAE,IAJP;MAKJ,GAAG,WALC;MAMJ,IAAI,EAAE,WANF;MAOJ,YAAY,EAAE;IAPV,CAbD;IAsBL,aAAa,EAAE,gBAAgB,CAAC,KAAK,CAAC,aAAP,EAAsB;MACnD,QAAQ,EAAE,IADyC;MAEnD,YAAY,EAAE;QACZ,QAAQ,EAAE,qBADE;QAEZ,IAAI,EAAE;MAFM;IAFqC,CAAtB,CAtB1B;IA6BL,OAAO,EAAE,gBAAgB,CAAC,KAAK,CAAC,OAAP,EAAgB;MACvC,QAAQ,EAAE,IAD6B;MAEvC,YAAY,EAAE;QACZ,QAAQ,EAAE,QADE;QAEZ,IAAI,EAAE;MAFM;IAFyB,CAAhB,CA7BpB;IAoCL,cAAc,EAAE,gBAAgB,CAAC,KAAK,CAAC,cAAP,EAAuB;MACrD,QAAQ,EAAE,IAD2C;MAErD,YAAY,EAAE;QACZ,cAAc,UADF;QAEZ,QAAQ,EAAE;MAFE;IAFuC,CAAvB,CApC3B;IA2CL,OAAO,EAAE,gBAAgB,CAAC,KAAK,CAAC,OAAP,EAAgB;MACvC,QAAQ,EAAE,IAD6B;MAEvC,YAAY,EAAE;QACZ,OAAO,EAAE,mBADG;QAEZ,YAAY,EAAE;MAFF;IAFyB,CAAhB;EA3CpB,CAAP;AAmDD,CAjFM","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 popoverOpen,\n layout,\n indicator,\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: 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"],"sourceRoot":"../src/"}
@@ -0,0 +1,10 @@
1
+ export const useAvatarGroupPopoverContextValues = state => {
2
+ const avatarGroup = {
3
+ isOverflow: true,
4
+ size: 24
5
+ };
6
+ return {
7
+ avatarGroup
8
+ };
9
+ };
10
+ //# sourceMappingURL=useAvatarGroupPopoverContextValues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.ts"],"names":[],"mappings":"AAGA,OAAO,MAAM,kCAAkC,GAAI,KAAD,IAA6D;EAC7G,MAAM,WAAW,GAA4B;IAC3C,UAAU,EAAE,IAD+B;IAE3C,IAAI,EAAE;EAFqC,CAA7C;EAKA,OAAO;IAAE;EAAF,CAAP;AACD,CAPM","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"],"sourceRoot":"../src/"}