@fluentui/react-avatar 9.4.4 → 9.4.5

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 (202) hide show
  1. package/.swcrc +30 -0
  2. package/CHANGELOG.json +82 -1
  3. package/CHANGELOG.md +22 -2
  4. package/lib/Avatar.js.map +1 -1
  5. package/lib/AvatarGroup.js.map +1 -1
  6. package/lib/AvatarGroupItem.js.map +1 -1
  7. package/lib/AvatarGroupPopover.js.map +1 -1
  8. package/lib/components/Avatar/Avatar.js.map +1 -1
  9. package/lib/components/Avatar/Avatar.types.js.map +1 -1
  10. package/lib/components/Avatar/index.js.map +1 -1
  11. package/lib/components/Avatar/renderAvatar.js +1 -11
  12. package/lib/components/Avatar/renderAvatar.js.map +1 -1
  13. package/lib/components/Avatar/useAvatar.js +2 -2
  14. package/lib/components/Avatar/useAvatar.js.map +1 -1
  15. package/lib/components/Avatar/useAvatarStyles.js.map +1 -1
  16. package/lib/components/AvatarGroup/AvatarGroup.js.map +1 -1
  17. package/lib/components/AvatarGroup/AvatarGroup.types.js.map +1 -1
  18. package/lib/components/AvatarGroup/index.js.map +1 -1
  19. package/lib/components/AvatarGroup/renderAvatarGroup.js +1 -3
  20. package/lib/components/AvatarGroup/renderAvatarGroup.js.map +1 -1
  21. package/lib/components/AvatarGroup/useAvatarGroup.js +1 -0
  22. package/lib/components/AvatarGroup/useAvatarGroup.js.map +1 -1
  23. package/lib/components/AvatarGroup/useAvatarGroupContextValues.js.map +1 -1
  24. package/lib/components/AvatarGroup/useAvatarGroupStyles.js.map +1 -1
  25. package/lib/components/AvatarGroupItem/AvatarGroupItem.js.map +1 -1
  26. package/lib/components/AvatarGroupItem/AvatarGroupItem.types.js.map +1 -1
  27. package/lib/components/AvatarGroupItem/index.js.map +1 -1
  28. package/lib/components/AvatarGroupItem/renderAvatarGroupItem.js +1 -7
  29. package/lib/components/AvatarGroupItem/renderAvatarGroupItem.js.map +1 -1
  30. package/lib/components/AvatarGroupItem/useAvatarGroupItem.js +1 -0
  31. package/lib/components/AvatarGroupItem/useAvatarGroupItem.js.map +1 -1
  32. package/lib/components/AvatarGroupItem/useAvatarGroupItemStyles.js.map +1 -1
  33. package/lib/components/AvatarGroupPopover/AvatarGroupPopover.js +1 -0
  34. package/lib/components/AvatarGroupPopover/AvatarGroupPopover.js.map +1 -1
  35. package/lib/components/AvatarGroupPopover/AvatarGroupPopover.types.js +1 -1
  36. package/lib/components/AvatarGroupPopover/AvatarGroupPopover.types.js.map +1 -1
  37. package/lib/components/AvatarGroupPopover/index.js.map +1 -1
  38. package/lib/components/AvatarGroupPopover/renderAvatarGroupPopover.js +3 -13
  39. package/lib/components/AvatarGroupPopover/renderAvatarGroupPopover.js.map +1 -1
  40. package/lib/components/AvatarGroupPopover/useAvatarGroupPopover.js +4 -4
  41. package/lib/components/AvatarGroupPopover/useAvatarGroupPopover.js.map +1 -1
  42. package/lib/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js.map +1 -1
  43. package/lib/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.js.map +1 -1
  44. package/lib/contexts/AvatarContext.js +2 -4
  45. package/lib/contexts/AvatarContext.js.map +1 -1
  46. package/lib/contexts/AvatarGroupContext.js.map +1 -1
  47. package/lib/contexts/index.js.map +1 -1
  48. package/lib/index.js.map +1 -1
  49. package/lib/utils/getInitials.js +5 -8
  50. package/lib/utils/getInitials.js.map +1 -1
  51. package/lib/utils/index.js.map +1 -1
  52. package/lib/utils/partitionAvatarGroupItems.js +3 -4
  53. package/lib/utils/partitionAvatarGroupItems.js.map +1 -1
  54. package/lib-commonjs/Avatar.js +5 -4
  55. package/lib-commonjs/Avatar.js.map +1 -1
  56. package/lib-commonjs/AvatarGroup.js +5 -4
  57. package/lib-commonjs/AvatarGroup.js.map +1 -1
  58. package/lib-commonjs/AvatarGroupItem.js +5 -4
  59. package/lib-commonjs/AvatarGroupItem.js.map +1 -1
  60. package/lib-commonjs/AvatarGroupPopover.js +5 -4
  61. package/lib-commonjs/AvatarGroupPopover.js.map +1 -1
  62. package/lib-commonjs/components/Avatar/Avatar.js +19 -17
  63. package/lib-commonjs/components/Avatar/Avatar.js.map +1 -1
  64. package/lib-commonjs/components/Avatar/Avatar.types.js +3 -2
  65. package/lib-commonjs/components/Avatar/Avatar.types.js.map +1 -1
  66. package/lib-commonjs/components/Avatar/index.js +9 -8
  67. package/lib-commonjs/components/Avatar/index.js.map +1 -1
  68. package/lib-commonjs/components/Avatar/renderAvatar.js +13 -23
  69. package/lib-commonjs/components/Avatar/renderAvatar.js.map +1 -1
  70. package/lib-commonjs/components/Avatar/useAvatar.js +186 -158
  71. package/lib-commonjs/components/Avatar/useAvatar.js.map +1 -1
  72. package/lib-commonjs/components/Avatar/useAvatarStyles.js +889 -510
  73. package/lib-commonjs/components/Avatar/useAvatarStyles.js.map +1 -1
  74. package/lib-commonjs/components/AvatarGroup/AvatarGroup.js +21 -23
  75. package/lib-commonjs/components/AvatarGroup/AvatarGroup.js.map +1 -1
  76. package/lib-commonjs/components/AvatarGroup/AvatarGroup.types.js +3 -2
  77. package/lib-commonjs/components/AvatarGroup/AvatarGroup.types.js.map +1 -1
  78. package/lib-commonjs/components/AvatarGroup/index.js +10 -9
  79. package/lib-commonjs/components/AvatarGroup/index.js.map +1 -1
  80. package/lib-commonjs/components/AvatarGroup/renderAvatarGroup.js +16 -21
  81. package/lib-commonjs/components/AvatarGroup/renderAvatarGroup.js.map +1 -1
  82. package/lib-commonjs/components/AvatarGroup/useAvatarGroup.js +33 -33
  83. package/lib-commonjs/components/AvatarGroup/useAvatarGroup.js.map +1 -1
  84. package/lib-commonjs/components/AvatarGroup/useAvatarGroupContextValues.js +16 -17
  85. package/lib-commonjs/components/AvatarGroup/useAvatarGroupContextValues.js.map +1 -1
  86. package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.js +47 -37
  87. package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.js.map +1 -1
  88. package/lib-commonjs/components/AvatarGroupItem/AvatarGroupItem.js +19 -21
  89. package/lib-commonjs/components/AvatarGroupItem/AvatarGroupItem.js.map +1 -1
  90. package/lib-commonjs/components/AvatarGroupItem/AvatarGroupItem.types.js +3 -2
  91. package/lib-commonjs/components/AvatarGroupItem/AvatarGroupItem.types.js.map +1 -1
  92. package/lib-commonjs/components/AvatarGroupItem/index.js +9 -8
  93. package/lib-commonjs/components/AvatarGroupItem/index.js.map +1 -1
  94. package/lib-commonjs/components/AvatarGroupItem/renderAvatarGroupItem.js +13 -22
  95. package/lib-commonjs/components/AvatarGroupItem/renderAvatarGroupItem.js.map +1 -1
  96. package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItem.js +59 -68
  97. package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItem.js.map +1 -1
  98. package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItemStyles.js +379 -224
  99. package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItemStyles.js.map +1 -1
  100. package/lib-commonjs/components/AvatarGroupPopover/AvatarGroupPopover.js +21 -22
  101. package/lib-commonjs/components/AvatarGroupPopover/AvatarGroupPopover.js.map +1 -1
  102. package/lib-commonjs/components/AvatarGroupPopover/AvatarGroupPopover.types.js +5 -2
  103. package/lib-commonjs/components/AvatarGroupPopover/AvatarGroupPopover.types.js.map +1 -1
  104. package/lib-commonjs/components/AvatarGroupPopover/index.js +9 -8
  105. package/lib-commonjs/components/AvatarGroupPopover/index.js.map +1 -1
  106. package/lib-commonjs/components/AvatarGroupPopover/renderAvatarGroupPopover.js +19 -32
  107. package/lib-commonjs/components/AvatarGroupPopover/renderAvatarGroupPopover.js.map +1 -1
  108. package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopover.js +89 -99
  109. package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopover.js.map +1 -1
  110. package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js +15 -13
  111. package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js.map +1 -1
  112. package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.js +527 -272
  113. package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.js.map +1 -1
  114. package/lib-commonjs/contexts/AvatarContext.js +18 -17
  115. package/lib-commonjs/contexts/AvatarContext.js.map +1 -1
  116. package/lib-commonjs/contexts/AvatarGroupContext.js +17 -12
  117. package/lib-commonjs/contexts/AvatarGroupContext.js.map +1 -1
  118. package/lib-commonjs/contexts/index.js +6 -5
  119. package/lib-commonjs/contexts/index.js.map +1 -1
  120. package/lib-commonjs/index.js +45 -172
  121. package/lib-commonjs/index.js.map +1 -1
  122. package/lib-commonjs/utils/getInitials.js +44 -60
  123. package/lib-commonjs/utils/getInitials.js.map +1 -1
  124. package/lib-commonjs/utils/index.js +14 -16
  125. package/lib-commonjs/utils/index.js.map +1 -1
  126. package/lib-commonjs/utils/partitionAvatarGroupItems.js +25 -26
  127. package/lib-commonjs/utils/partitionAvatarGroupItems.js.map +1 -1
  128. package/package.json +14 -13
  129. package/lib-amd/Avatar.js +0 -6
  130. package/lib-amd/Avatar.js.map +0 -1
  131. package/lib-amd/AvatarGroup.js +0 -6
  132. package/lib-amd/AvatarGroup.js.map +0 -1
  133. package/lib-amd/AvatarGroupItem.js +0 -6
  134. package/lib-amd/AvatarGroupItem.js.map +0 -1
  135. package/lib-amd/AvatarGroupPopover.js +0 -6
  136. package/lib-amd/AvatarGroupPopover.js.map +0 -1
  137. package/lib-amd/components/Avatar/Avatar.js +0 -14
  138. package/lib-amd/components/Avatar/Avatar.js.map +0 -1
  139. package/lib-amd/components/Avatar/Avatar.types.js +0 -5
  140. package/lib-amd/components/Avatar/Avatar.types.js.map +0 -1
  141. package/lib-amd/components/Avatar/index.js +0 -10
  142. package/lib-amd/components/Avatar/index.js.map +0 -1
  143. package/lib-amd/components/Avatar/renderAvatar.js +0 -16
  144. package/lib-amd/components/Avatar/renderAvatar.js.map +0 -1
  145. package/lib-amd/components/Avatar/useAvatar.js +0 -178
  146. package/lib-amd/components/Avatar/useAvatar.js.map +0 -1
  147. package/lib-amd/components/Avatar/useAvatarStyles.js +0 -425
  148. package/lib-amd/components/Avatar/useAvatarStyles.js.map +0 -1
  149. package/lib-amd/components/AvatarGroup/AvatarGroup.js +0 -19
  150. package/lib-amd/components/AvatarGroup/AvatarGroup.js.map +0 -1
  151. package/lib-amd/components/AvatarGroup/AvatarGroup.types.js +0 -5
  152. package/lib-amd/components/AvatarGroup/AvatarGroup.types.js.map +0 -1
  153. package/lib-amd/components/AvatarGroup/index.js +0 -11
  154. package/lib-amd/components/AvatarGroup/index.js.map +0 -1
  155. package/lib-amd/components/AvatarGroup/renderAvatarGroup.js +0 -15
  156. package/lib-amd/components/AvatarGroup/renderAvatarGroup.js.map +0 -1
  157. package/lib-amd/components/AvatarGroup/useAvatarGroup.js +0 -29
  158. package/lib-amd/components/AvatarGroup/useAvatarGroup.js.map +0 -1
  159. package/lib-amd/components/AvatarGroup/useAvatarGroupContextValues.js +0 -15
  160. package/lib-amd/components/AvatarGroup/useAvatarGroupContextValues.js.map +0 -1
  161. package/lib-amd/components/AvatarGroup/useAvatarGroupStyles.js +0 -36
  162. package/lib-amd/components/AvatarGroup/useAvatarGroupStyles.js.map +0 -1
  163. package/lib-amd/components/AvatarGroupItem/AvatarGroupItem.js +0 -18
  164. package/lib-amd/components/AvatarGroupItem/AvatarGroupItem.js.map +0 -1
  165. package/lib-amd/components/AvatarGroupItem/AvatarGroupItem.types.js +0 -5
  166. package/lib-amd/components/AvatarGroupItem/AvatarGroupItem.types.js.map +0 -1
  167. package/lib-amd/components/AvatarGroupItem/index.js +0 -10
  168. package/lib-amd/components/AvatarGroupItem/index.js.map +0 -1
  169. package/lib-amd/components/AvatarGroupItem/renderAvatarGroupItem.js +0 -16
  170. package/lib-amd/components/AvatarGroupItem/renderAvatarGroupItem.js.map +0 -1
  171. package/lib-amd/components/AvatarGroupItem/useAvatarGroupItem.js +0 -58
  172. package/lib-amd/components/AvatarGroupItem/useAvatarGroupItem.js.map +0 -1
  173. package/lib-amd/components/AvatarGroupItem/useAvatarGroupItemStyles.js +0 -236
  174. package/lib-amd/components/AvatarGroupItem/useAvatarGroupItemStyles.js.map +0 -1
  175. package/lib-amd/components/AvatarGroupPopover/AvatarGroupPopover.js +0 -19
  176. package/lib-amd/components/AvatarGroupPopover/AvatarGroupPopover.js.map +0 -1
  177. package/lib-amd/components/AvatarGroupPopover/AvatarGroupPopover.types.js +0 -5
  178. package/lib-amd/components/AvatarGroupPopover/AvatarGroupPopover.types.js.map +0 -1
  179. package/lib-amd/components/AvatarGroupPopover/index.js +0 -10
  180. package/lib-amd/components/AvatarGroupPopover/index.js.map +0 -1
  181. package/lib-amd/components/AvatarGroupPopover/renderAvatarGroupPopover.js +0 -20
  182. package/lib-amd/components/AvatarGroupPopover/renderAvatarGroupPopover.js.map +0 -1
  183. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopover.js +0 -86
  184. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopover.js.map +0 -1
  185. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js +0 -14
  186. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js.map +0 -1
  187. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.js +0 -136
  188. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.js.map +0 -1
  189. package/lib-amd/contexts/AvatarContext.js +0 -17
  190. package/lib-amd/contexts/AvatarContext.js.map +0 -1
  191. package/lib-amd/contexts/AvatarGroupContext.js +0 -20
  192. package/lib-amd/contexts/AvatarGroupContext.js.map +0 -1
  193. package/lib-amd/contexts/index.js +0 -7
  194. package/lib-amd/contexts/index.js.map +0 -1
  195. package/lib-amd/index.js +0 -33
  196. package/lib-amd/index.js.map +0 -1
  197. package/lib-amd/utils/getInitials.js +0 -87
  198. package/lib-amd/utils/getInitials.js.map +0 -1
  199. package/lib-amd/utils/index.js +0 -8
  200. package/lib-amd/utils/index.js.map +0 -1
  201. package/lib-amd/utils/partitionAvatarGroupItems.js +0 -32
  202. package/lib-amd/utils/partitionAvatarGroupItems.js.map +0 -1
@@ -1,36 +0,0 @@
1
- define(["require", "exports", "@griffel/react", "@fluentui/react-theme", "../Avatar/useAvatarStyles"], function (require, exports, react_1, react_theme_1, useAvatarStyles_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.useAvatarGroupStyles_unstable = exports.avatarGroupClassNames = void 0;
5
- exports.avatarGroupClassNames = {
6
- root: 'fui-AvatarGroup',
7
- };
8
- /**
9
- * Styles for the root slot.
10
- */
11
- var useStyles = react_1.makeStyles({
12
- base: {
13
- display: 'inline-flex',
14
- position: 'relative',
15
- },
16
- pie: {
17
- clipPath: 'circle(50%)',
18
- backgroundColor: react_theme_1.tokens.colorTransparentStroke,
19
- '@media (forced-colors: active)': {
20
- backgroundColor: 'CanvasText',
21
- },
22
- },
23
- });
24
- /**
25
- * Apply styling to the AvatarGroup slots based on the state
26
- */
27
- var useAvatarGroupStyles_unstable = function (state) {
28
- var layout = state.layout, size = state.size;
29
- var styles = useStyles();
30
- var sizeStyles = useAvatarStyles_1.useSizeStyles();
31
- state.root.className = react_1.mergeClasses(exports.avatarGroupClassNames.root, styles.base, layout === 'pie' && sizeStyles[size], layout === 'pie' && styles.pie, state.root.className);
32
- return state;
33
- };
34
- exports.useAvatarGroupStyles_unstable = useAvatarGroupStyles_unstable;
35
- });
36
- //# sourceMappingURL=useAvatarGroupStyles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAvatarGroupStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-avatar/src/components/AvatarGroup/useAvatarGroupStyles.ts"],"names":[],"mappings":";;;;IAMa,QAAA,qBAAqB,GAAqC;QACrE,IAAI,EAAE,iBAAiB;KACxB,CAAC;IAEF;;OAEG;IACH,IAAM,SAAS,GAAG,kBAAU,CAAC;QAC3B,IAAI,EAAE;YACJ,OAAO,EAAE,aAAa;YACtB,QAAQ,EAAE,UAAU;SACrB;QACD,GAAG,EAAE;YACH,QAAQ,EAAE,aAAa;YACvB,eAAe,EAAE,oBAAM,CAAC,sBAAsB;YAC9C,gCAAgC,EAAE;gBAChC,eAAe,EAAE,YAAY;aAC9B;SACF;KACF,CAAC,CAAC;IAEH;;OAEG;IACI,IAAM,6BAA6B,GAAG,UAAC,KAAuB;QAC3D,IAAA,MAAM,GAAW,KAAK,OAAhB,EAAE,IAAI,GAAK,KAAK,KAAV,CAAW;QAC/B,IAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,IAAM,UAAU,GAAG,+BAAa,EAAE,CAAC;QAEnC,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,oBAAY,CACjC,6BAAqB,CAAC,IAAI,EAC1B,MAAM,CAAC,IAAI,EACX,MAAM,KAAK,KAAK,IAAI,UAAU,CAAC,IAAI,CAAC,EACpC,MAAM,KAAK,KAAK,IAAI,MAAM,CAAC,GAAG,EAC9B,KAAK,CAAC,IAAI,CAAC,SAAS,CACrB,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAdW,QAAA,6BAA6B,iCAcxC","sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { useSizeStyles } from '../Avatar/useAvatarStyles';\nimport type { AvatarGroupSlots, AvatarGroupState } from './AvatarGroup.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const avatarGroupClassNames: SlotClassNames<AvatarGroupSlots> = {\n root: 'fui-AvatarGroup',\n};\n\n/**\n * Styles for the root slot.\n */\nconst useStyles = makeStyles({\n base: {\n display: 'inline-flex',\n position: 'relative',\n },\n pie: {\n clipPath: 'circle(50%)',\n backgroundColor: tokens.colorTransparentStroke,\n '@media (forced-colors: active)': {\n backgroundColor: 'CanvasText',\n },\n },\n});\n\n/**\n * Apply styling to the AvatarGroup slots based on the state\n */\nexport const useAvatarGroupStyles_unstable = (state: AvatarGroupState): AvatarGroupState => {\n const { layout, size } = state;\n const styles = useStyles();\n const sizeStyles = useSizeStyles();\n\n state.root.className = mergeClasses(\n avatarGroupClassNames.root,\n styles.base,\n layout === 'pie' && sizeStyles[size],\n layout === 'pie' && styles.pie,\n state.root.className,\n );\n\n return state;\n};\n"]}
@@ -1,18 +0,0 @@
1
- define(["require", "exports", "react", "./renderAvatarGroupItem", "./useAvatarGroupItem", "@fluentui/react-shared-contexts", "./useAvatarGroupItemStyles"], function (require, exports, React, renderAvatarGroupItem_1, useAvatarGroupItem_1, react_shared_contexts_1, useAvatarGroupItemStyles_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.AvatarGroupItem = void 0;
5
- /**
6
- * The AvatarGroupItem component represents a single person or entity.
7
- * AvatarGroupItem should only be used in an AvatarGroup component.
8
- */
9
- exports.AvatarGroupItem = React.forwardRef(function (props, ref) {
10
- var state = useAvatarGroupItem_1.useAvatarGroupItem_unstable(props, ref);
11
- useAvatarGroupItemStyles_1.useAvatarGroupItemStyles_unstable(state);
12
- var useCustomStyles = react_shared_contexts_1.useCustomStyleHooks_unstable().useAvatarGroupItemStyles_unstable;
13
- useCustomStyles(state);
14
- return renderAvatarGroupItem_1.renderAvatarGroupItem_unstable(state);
15
- });
16
- exports.AvatarGroupItem.displayName = 'AvatarGroupItem';
17
- });
18
- //# sourceMappingURL=AvatarGroupItem.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AvatarGroupItem.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-avatar/src/components/AvatarGroupItem/AvatarGroupItem.tsx"],"names":[],"mappings":";;;;IAQA;;;OAGG;IACU,QAAA,eAAe,GAA8C,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QACpG,IAAM,KAAK,GAAG,gDAA2B,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAEtD,4DAAiC,CAAC,KAAK,CAAC,CAAC;QAEjC,IAAmC,eAAe,GAAK,oDAA4B,EAAE,kCAAnC,CAAoC;QAC9F,eAAe,CAAC,KAAK,CAAC,CAAC;QAEvB,OAAO,sDAA8B,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,uBAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC","sourcesContent":["import * as React from 'react';\nimport { renderAvatarGroupItem_unstable } from './renderAvatarGroupItem';\nimport { useAvatarGroupItem_unstable } from './useAvatarGroupItem';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\nimport { useAvatarGroupItemStyles_unstable } from './useAvatarGroupItemStyles';\nimport type { AvatarGroupItemProps } from './AvatarGroupItem.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * The AvatarGroupItem component represents a single person or entity.\n * AvatarGroupItem should only be used in an AvatarGroup component.\n */\nexport const AvatarGroupItem: ForwardRefComponent<AvatarGroupItemProps> = React.forwardRef((props, ref) => {\n const state = useAvatarGroupItem_unstable(props, ref);\n\n useAvatarGroupItemStyles_unstable(state);\n\n const { useAvatarGroupItemStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderAvatarGroupItem_unstable(state);\n});\n\nAvatarGroupItem.displayName = 'AvatarGroupItem';\n"]}
@@ -1,5 +0,0 @@
1
- define(["require", "exports"], function (require, exports) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- });
5
- //# sourceMappingURL=AvatarGroupItem.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AvatarGroupItem.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-avatar/src/components/AvatarGroupItem/AvatarGroupItem.types.ts"],"names":[],"mappings":"","sourcesContent":["import { AvatarGroupProps } from '../AvatarGroup/AvatarGroup.types';\nimport type { Avatar, AvatarSize } from '../../Avatar';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type AvatarGroupItemSlots = {\n root: NonNullable<Slot<'div', 'li'>>;\n\n /**\n * Avatar that represents a person or entity.\n */\n avatar: NonNullable<Slot<typeof Avatar>>;\n\n /**\n * Label used for the name of the AvatarGroupItem when rendered as an overflow item.\n * The content of the label, by default, is the `name` prop from the `avatar` slot.\n */\n overflowLabel: NonNullable<Slot<'span'>>;\n};\n\n/**\n * AvatarGroupItem Props\n */\nexport type AvatarGroupItemProps = Omit<ComponentProps<Partial<AvatarGroupItemSlots>, 'avatar'>, 'size' | 'shape'>;\n\n/**\n * State used in rendering AvatarGroupItem\n */\nexport type AvatarGroupItemState = ComponentState<AvatarGroupItemSlots> & {\n /**\n * Whether the Avatar is an overflow item.\n *\n * @default false\n */\n isOverflowItem?: boolean;\n\n layout: AvatarGroupProps['layout'];\n size: AvatarSize;\n};\n"]}
@@ -1,10 +0,0 @@
1
- define(["require", "exports", "tslib", "./AvatarGroupItem", "./AvatarGroupItem.types", "./renderAvatarGroupItem", "./useAvatarGroupItem", "./useAvatarGroupItemStyles"], function (require, exports, tslib_1, AvatarGroupItem_1, AvatarGroupItem_types_1, renderAvatarGroupItem_1, useAvatarGroupItem_1, useAvatarGroupItemStyles_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- tslib_1.__exportStar(AvatarGroupItem_1, exports);
5
- tslib_1.__exportStar(AvatarGroupItem_types_1, exports);
6
- tslib_1.__exportStar(renderAvatarGroupItem_1, exports);
7
- tslib_1.__exportStar(useAvatarGroupItem_1, exports);
8
- tslib_1.__exportStar(useAvatarGroupItemStyles_1, exports);
9
- });
10
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-avatar/src/components/AvatarGroupItem/index.ts"],"names":[],"mappings":";;;IAAA,iDAAkC;IAClC,uDAAwC;IACxC,uDAAwC;IACxC,oDAAqC;IACrC,0DAA2C","sourcesContent":["export * from './AvatarGroupItem';\nexport * from './AvatarGroupItem.types';\nexport * from './renderAvatarGroupItem';\nexport * from './useAvatarGroupItem';\nexport * from './useAvatarGroupItemStyles';\n"]}
@@ -1,16 +0,0 @@
1
- define(["require", "exports", "tslib", "react", "@fluentui/react-utilities"], function (require, exports, tslib_1, React, react_utilities_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.renderAvatarGroupItem_unstable = void 0;
5
- /**
6
- * Render the final JSX of AvatarGroupItem
7
- */
8
- var renderAvatarGroupItem_unstable = function (state) {
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(slots.avatar, tslib_1.__assign({}, slotProps.avatar)),
12
- state.isOverflowItem && React.createElement(slots.overflowLabel, tslib_1.__assign({}, slotProps.overflowLabel))));
13
- };
14
- exports.renderAvatarGroupItem_unstable = renderAvatarGroupItem_unstable;
15
- });
16
- //# sourceMappingURL=renderAvatarGroupItem.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderAvatarGroupItem.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-avatar/src/components/AvatarGroupItem/renderAvatarGroupItem.tsx"],"names":[],"mappings":";;;;IAIA;;OAEG;IACI,IAAM,8BAA8B,GAAG,UAAC,KAA2B;QAClE,IAAA,KAAuB,0BAAQ,CAAuB,KAAK,CAAC,EAA1D,KAAK,WAAA,EAAE,SAAS,eAA0C,CAAC;QAEnE,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;YAC5B,oBAAC,KAAK,CAAC,MAAM,uBAAK,SAAS,CAAC,MAAM,EAAI;YACrC,KAAK,CAAC,cAAc,IAAI,oBAAC,KAAK,CAAC,aAAa,uBAAK,SAAS,CAAC,aAAa,EAAI,CAClE,CACd,CAAC;IACJ,CAAC,CAAC;IATW,QAAA,8BAA8B,kCASzC","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { AvatarGroupItemState, AvatarGroupItemSlots } from './AvatarGroupItem.types';\n\n/**\n * Render the final JSX of AvatarGroupItem\n */\nexport const renderAvatarGroupItem_unstable = (state: AvatarGroupItemState) => {\n const { slots, slotProps } = getSlots<AvatarGroupItemSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n <slots.avatar {...slotProps.avatar} />\n {state.isOverflowItem && <slots.overflowLabel {...slotProps.overflowLabel} />}\n </slots.root>\n );\n};\n"]}
@@ -1,58 +0,0 @@
1
- define(["require", "exports", "tslib", "../Avatar/Avatar", "../../contexts/AvatarGroupContext", "../AvatarGroup/useAvatarGroup", "@fluentui/react-utilities", "@fluentui/react-context-selector"], function (require, exports, tslib_1, Avatar_1, AvatarGroupContext_1, useAvatarGroup_1, react_utilities_1, react_context_selector_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.useAvatarGroupItem_unstable = void 0;
5
- /**
6
- * Create the state required to render AvatarGroupItem.
7
- *
8
- * The returned state can be modified with hooks such as useAvatarGroupItemStyles_unstable,
9
- * before being passed to renderAvatarGroupItem_unstable.
10
- *
11
- * @param props - props from this instance of AvatarGroupItem
12
- * @param ref - reference to root HTMLElement of AvatarGroupItem
13
- */
14
- var useAvatarGroupItem_unstable = function (props, ref) {
15
- var groupIsOverflow = AvatarGroupContext_1.useAvatarGroupContext_unstable(function (ctx) { return ctx.isOverflow; });
16
- var groupSize = AvatarGroupContext_1.useAvatarGroupContext_unstable(function (ctx) { return ctx.size; });
17
- var layout = AvatarGroupContext_1.useAvatarGroupContext_unstable(function (ctx) { return ctx.layout; });
18
- // Since the primary slot is not an intrinsic element, getPartitionedNativeProps cannot be used here.
19
- var style = props.style, className = props.className, avatarSlotProps = tslib_1.__rest(props, ["style", "className"]);
20
- var size = groupSize !== null && groupSize !== void 0 ? groupSize : useAvatarGroup_1.defaultAvatarGroupSize;
21
- var hasAvatarGroupContext = react_context_selector_1.useHasParentContext(AvatarGroupContext_1.AvatarGroupContext);
22
- if (process.env.NODE_ENV !== 'production' && !hasAvatarGroupContext) {
23
- // eslint-disable-next-line no-console
24
- console.warn('AvatarGroupItem must only be used inside an AvatarGroup component.');
25
- }
26
- return {
27
- isOverflowItem: groupIsOverflow,
28
- layout: layout,
29
- size: size,
30
- components: {
31
- root: groupIsOverflow ? 'li' : 'div',
32
- avatar: Avatar_1.Avatar,
33
- overflowLabel: 'span',
34
- },
35
- root: react_utilities_1.resolveShorthand(props.root, {
36
- required: true,
37
- defaultProps: {
38
- style: style,
39
- className: className,
40
- },
41
- }),
42
- avatar: react_utilities_1.resolveShorthand(props.avatar, {
43
- required: true,
44
- defaultProps: tslib_1.__assign({ ref: ref, size: size, color: 'colorful' }, avatarSlotProps),
45
- }),
46
- overflowLabel: react_utilities_1.resolveShorthand(props.overflowLabel, {
47
- required: true,
48
- defaultProps: {
49
- // Avatar already has its aria-label set to the name, this will prevent the name to be read twice.
50
- 'aria-hidden': true,
51
- children: props.name,
52
- },
53
- }),
54
- };
55
- };
56
- exports.useAvatarGroupItem_unstable = useAvatarGroupItem_unstable;
57
- });
58
- //# sourceMappingURL=useAvatarGroupItem.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAvatarGroupItem.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-avatar/src/components/AvatarGroupItem/useAvatarGroupItem.ts"],"names":[],"mappings":";;;;IAQA;;;;;;;;OAQG;IACI,IAAM,2BAA2B,GAAG,UACzC,KAA2B,EAC3B,GAA2B;QAE3B,IAAM,eAAe,GAAG,mDAA8B,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,UAAU,EAAd,CAAc,CAAC,CAAC;QAC9E,IAAM,SAAS,GAAG,mDAA8B,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,IAAI,EAAR,CAAQ,CAAC,CAAC;QAClE,IAAM,MAAM,GAAG,mDAA8B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iBACrB;aACF,CAAC;SACH,CAAC;IACJ,CAAC,CAAC;IAnDW,QAAA,2BAA2B,+BAmDtC","sourcesContent":["import * as React from 'react';\nimport { Avatar } from '../Avatar/Avatar';\nimport { AvatarGroupContext, useAvatarGroupContext_unstable } from '../../contexts/AvatarGroupContext';\nimport { defaultAvatarGroupSize } from '../AvatarGroup/useAvatarGroup';\nimport { resolveShorthand } from '@fluentui/react-utilities';\nimport { useHasParentContext } from '@fluentui/react-context-selector';\nimport type { AvatarGroupItemProps, AvatarGroupItemState } from './AvatarGroupItem.types';\n\n/**\n * Create the state required to render AvatarGroupItem.\n *\n * The returned state can be modified with hooks such as useAvatarGroupItemStyles_unstable,\n * before being passed to renderAvatarGroupItem_unstable.\n *\n * @param props - props from this instance of AvatarGroupItem\n * @param ref - reference to root HTMLElement of AvatarGroupItem\n */\nexport const useAvatarGroupItem_unstable = (\n props: AvatarGroupItemProps,\n ref: React.Ref<HTMLElement>,\n): AvatarGroupItemState => {\n const groupIsOverflow = useAvatarGroupContext_unstable(ctx => ctx.isOverflow);\n const groupSize = useAvatarGroupContext_unstable(ctx => ctx.size);\n const layout = useAvatarGroupContext_unstable(ctx => ctx.layout);\n // Since the primary slot is not an intrinsic element, getPartitionedNativeProps cannot be used here.\n const { style, className, ...avatarSlotProps } = props;\n const size = groupSize ?? defaultAvatarGroupSize;\n const hasAvatarGroupContext = useHasParentContext(AvatarGroupContext);\n\n if (process.env.NODE_ENV !== 'production' && !hasAvatarGroupContext) {\n // eslint-disable-next-line no-console\n console.warn('AvatarGroupItem must only be used inside an AvatarGroup component.');\n }\n\n return {\n isOverflowItem: groupIsOverflow,\n layout,\n size,\n components: {\n root: groupIsOverflow ? 'li' : 'div',\n avatar: Avatar,\n overflowLabel: 'span',\n },\n root: resolveShorthand(props.root, {\n required: true,\n defaultProps: {\n style,\n className,\n },\n }),\n avatar: resolveShorthand(props.avatar, {\n required: true,\n defaultProps: {\n ref,\n size,\n color: 'colorful',\n ...avatarSlotProps,\n },\n }),\n overflowLabel: resolveShorthand(props.overflowLabel, {\n required: true,\n defaultProps: {\n // Avatar already has its aria-label set to the name, this will prevent the name to be read twice.\n 'aria-hidden': true,\n children: props.name,\n },\n }),\n };\n};\n"]}
@@ -1,236 +0,0 @@
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
@@ -1 +0,0 @@
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,uBAAyB;SAChF;QACD,OAAO,EAAE;YACP,SAAS,EAAE,WAAS,oB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,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 { AvatarSize } 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: AvatarSize): 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"]}
@@ -1,19 +0,0 @@
1
- define(["require", "exports", "./renderAvatarGroupPopover", "./useAvatarGroupPopoverContextValues", "@fluentui/react-shared-contexts", "./useAvatarGroupPopover", "./useAvatarGroupPopoverStyles"], function (require, exports, renderAvatarGroupPopover_1, useAvatarGroupPopoverContextValues_1, react_shared_contexts_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
- var useCustomStyles = react_shared_contexts_1.useCustomStyleHooks_unstable().useAvatarGroupPopoverStyles_unstable;
13
- useCustomStyles(state);
14
- return renderAvatarGroupPopover_1.renderAvatarGroupPopover_unstable(state, contextValues);
15
- };
16
- exports.AvatarGroupPopover = AvatarGroupPopover;
17
- exports.AvatarGroupPopover.displayName = 'AvatarGroupPopover';
18
- });
19
- //# sourceMappingURL=AvatarGroupPopover.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AvatarGroupPopover.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-avatar/src/components/AvatarGroupPopover/AvatarGroupPopover.tsx"],"names":[],"mappings":";;;;IAQA;;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;QAEpC,IAAsC,eAAe,GAAK,oDAA4B,EAAE,qCAAnC,CAAoC;QACjG,eAAe,CAAC,KAAK,CAAC,CAAC;QAEvB,OAAO,4DAAiC,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IACjE,CAAC,CAAC;IAVW,QAAA,kBAAkB,sBAU7B;IAEF,0BAAkB,CAAC,WAAW,GAAG,oBAAoB,CAAC","sourcesContent":["import * as React from 'react';\nimport { renderAvatarGroupPopover_unstable } from './renderAvatarGroupPopover';\nimport { useAvatarGroupPopoverContextValues } from './useAvatarGroupPopoverContextValues';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\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\n const { useAvatarGroupPopoverStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderAvatarGroupPopover_unstable(state, contextValues);\n};\n\nAvatarGroupPopover.displayName = 'AvatarGroupPopover';\n"]}
@@ -1,5 +0,0 @@
1
- define(["require", "exports"], function (require, exports) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- });
5
- //# sourceMappingURL=AvatarGroupPopover.types.js.map
@@ -1 +0,0 @@
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 { AvatarSize } 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: AvatarSize;\n };\n"]}
@@ -1,10 +0,0 @@
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
@@ -1 +0,0 @@
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"]}
@@ -1,20 +0,0 @@
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
@@ -1 +0,0 @@
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"]}