@fluentui/react-avatar 9.2.5 → 9.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/CHANGELOG.json +155 -1
  2. package/CHANGELOG.md +38 -2
  3. package/README-AvatarGroup.md +0 -10
  4. package/dist/index.d.ts +35 -4
  5. package/lib/components/Avatar/useAvatarStyles.js +83 -87
  6. package/lib/components/Avatar/useAvatarStyles.js.map +1 -1
  7. package/lib/index.js +1 -1
  8. package/lib/index.js.map +1 -1
  9. package/lib-amd/Avatar.js +6 -0
  10. package/lib-amd/Avatar.js.map +1 -0
  11. package/lib-amd/AvatarGroup.js +6 -0
  12. package/lib-amd/AvatarGroup.js.map +1 -0
  13. package/lib-amd/AvatarGroupItem.js +6 -0
  14. package/lib-amd/AvatarGroupItem.js.map +1 -0
  15. package/lib-amd/AvatarGroupPopover.js +6 -0
  16. package/lib-amd/AvatarGroupPopover.js.map +1 -0
  17. package/lib-amd/components/Avatar/Avatar.js +12 -0
  18. package/lib-amd/components/Avatar/Avatar.js.map +1 -0
  19. package/lib-amd/components/Avatar/Avatar.types.js +5 -0
  20. package/lib-amd/components/Avatar/Avatar.types.js.map +1 -0
  21. package/lib-amd/components/Avatar/index.js +10 -0
  22. package/lib-amd/components/Avatar/index.js.map +1 -0
  23. package/lib-amd/components/Avatar/renderAvatar.js +16 -0
  24. package/lib-amd/components/Avatar/renderAvatar.js.map +1 -0
  25. package/lib-amd/components/Avatar/useAvatar.js +175 -0
  26. package/lib-amd/components/Avatar/useAvatar.js.map +1 -0
  27. package/lib-amd/components/Avatar/useAvatarStyles.js +390 -0
  28. package/lib-amd/components/Avatar/useAvatarStyles.js.map +1 -0
  29. package/lib-amd/components/AvatarGroup/AvatarGroup.js +17 -0
  30. package/lib-amd/components/AvatarGroup/AvatarGroup.js.map +1 -0
  31. package/lib-amd/components/AvatarGroup/AvatarGroup.types.js +5 -0
  32. package/lib-amd/components/AvatarGroup/AvatarGroup.types.js.map +1 -0
  33. package/lib-amd/components/AvatarGroup/index.js +11 -0
  34. package/lib-amd/components/AvatarGroup/index.js.map +1 -0
  35. package/lib-amd/components/AvatarGroup/renderAvatarGroup.js +15 -0
  36. package/lib-amd/components/AvatarGroup/renderAvatarGroup.js.map +1 -0
  37. package/lib-amd/components/AvatarGroup/useAvatarGroup.js +29 -0
  38. package/lib-amd/components/AvatarGroup/useAvatarGroup.js.map +1 -0
  39. package/lib-amd/components/AvatarGroup/useAvatarGroupContextValues.js +15 -0
  40. package/lib-amd/components/AvatarGroup/useAvatarGroupContextValues.js.map +1 -0
  41. package/lib-amd/components/AvatarGroup/useAvatarGroupStyles.js +36 -0
  42. package/lib-amd/components/AvatarGroup/useAvatarGroupStyles.js.map +1 -0
  43. package/lib-amd/components/AvatarGroupItem/AvatarGroupItem.js +16 -0
  44. package/lib-amd/components/AvatarGroupItem/AvatarGroupItem.js.map +1 -0
  45. package/lib-amd/components/AvatarGroupItem/AvatarGroupItem.types.js +5 -0
  46. package/lib-amd/components/AvatarGroupItem/AvatarGroupItem.types.js.map +1 -0
  47. package/lib-amd/components/AvatarGroupItem/index.js +10 -0
  48. package/lib-amd/components/AvatarGroupItem/index.js.map +1 -0
  49. package/lib-amd/components/AvatarGroupItem/renderAvatarGroupItem.js +16 -0
  50. package/lib-amd/components/AvatarGroupItem/renderAvatarGroupItem.js.map +1 -0
  51. package/lib-amd/components/AvatarGroupItem/useAvatarGroupItem.js +58 -0
  52. package/lib-amd/components/AvatarGroupItem/useAvatarGroupItem.js.map +1 -0
  53. package/lib-amd/components/AvatarGroupItem/useAvatarGroupItemStyles.js +206 -0
  54. package/lib-amd/components/AvatarGroupItem/useAvatarGroupItemStyles.js.map +1 -0
  55. package/lib-amd/components/AvatarGroupPopover/AvatarGroupPopover.js +17 -0
  56. package/lib-amd/components/AvatarGroupPopover/AvatarGroupPopover.js.map +1 -0
  57. package/lib-amd/components/AvatarGroupPopover/AvatarGroupPopover.types.js +5 -0
  58. package/lib-amd/components/AvatarGroupPopover/AvatarGroupPopover.types.js.map +1 -0
  59. package/lib-amd/components/AvatarGroupPopover/index.js +10 -0
  60. package/lib-amd/components/AvatarGroupPopover/index.js.map +1 -0
  61. package/lib-amd/components/AvatarGroupPopover/renderAvatarGroupPopover.js +20 -0
  62. package/lib-amd/components/AvatarGroupPopover/renderAvatarGroupPopover.js.map +1 -0
  63. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopover.js +86 -0
  64. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopover.js.map +1 -0
  65. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js +14 -0
  66. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js.map +1 -0
  67. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.js +136 -0
  68. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.js.map +1 -0
  69. package/lib-amd/contexts/AvatarContext.js +17 -0
  70. package/lib-amd/contexts/AvatarContext.js.map +1 -0
  71. package/lib-amd/contexts/AvatarGroupContext.js +20 -0
  72. package/lib-amd/contexts/AvatarGroupContext.js.map +1 -0
  73. package/lib-amd/contexts/index.js +7 -0
  74. package/lib-amd/contexts/index.js.map +1 -0
  75. package/lib-amd/index.js +33 -0
  76. package/lib-amd/index.js.map +1 -0
  77. package/lib-amd/utils/getInitials.js +87 -0
  78. package/lib-amd/utils/getInitials.js.map +1 -0
  79. package/lib-amd/utils/index.js +8 -0
  80. package/lib-amd/utils/index.js.map +1 -0
  81. package/lib-amd/utils/partitionAvatarGroupItems.js +32 -0
  82. package/lib-amd/utils/partitionAvatarGroupItems.js.map +1 -0
  83. package/lib-commonjs/components/Avatar/useAvatarStyles.js +83 -87
  84. package/lib-commonjs/components/Avatar/useAvatarStyles.js.map +1 -1
  85. package/lib-commonjs/index.js +9 -9
  86. package/lib-commonjs/index.js.map +1 -1
  87. package/package.json +14 -13
  88. package/MIGRATION.md +0 -106
  89. package/SPEC-AvatarGroup.md +0 -203
  90. package/SPEC.md +0 -172
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAvatarGroupItemStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-avatar/src/components/AvatarGroupItem/useAvatarGroupItemStyles.ts"],"names":[],"mappings":";;;;;IAQa,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,o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C,CAAC,CAAC;iBACnC;qBAAM;oBACL,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;iBACnC;aACF;iBAAM,IAAI,MAAM,KAAK,QAAQ,EAAE;gBAC9B,IAAI,IAAI,GAAG,EAAE,EAAE;oBACb,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;iBACpC;qBAAM,IAAI,IAAI,GAAG,EAAE,EAAE;oBACpB,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;iBACzC;qBAAM,IAAI,IAAI,GAAG,EAAE,EAAE;oBACpB,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;iBACpC;qBAAM;oBACL,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;iBACrC;aACF;SACF;QAED,OAAO,oBAAY,eAAI,aAAa,EAAE;IACxC,CAAC,CAAC;IAtCW,QAAA,sBAAsB,0BAsCjC","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { useSizeStyles } from '../../Avatar';\nimport type { AvatarGroupItemSlots, AvatarGroupItemState } from './AvatarGroupItem.types';\nimport type { AvatarGroupProps } from '../../AvatarGroup';\nimport type { AvatarSizes } from '../../Avatar';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const avatarGroupItemClassNames: SlotClassNames<AvatarGroupItemSlots> = {\n root: 'fui-AvatarGroupItem',\n avatar: 'fui-AvatarGroupItem__avatar',\n overflowLabel: 'fui-AvatarGroupItem__overflowLabel',\n};\n\nconst avatarGroupItemDividerWidthVar = '--fuiAvatarGroupItem__divider--width';\n\n/**\n * Styles for the root slot\n */\nconst useRootStyles = makeStyles({\n base: {\n alignItems: 'center',\n display: 'inline-flex',\n flexShrink: 0,\n position: 'relative',\n },\n overflowItem: {\n ...shorthands.padding(tokens.spacingVerticalXS, tokens.spacingHorizontalXS),\n },\n nonOverflowItem: {\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n },\n});\n\n/**\n * Styles for the avatar slot\n */\nconst useAvatarStyles = makeStyles({\n nonOverflowItem: {\n position: 'absolute',\n },\n pie: {\n ...shorthands.borderRadius(0),\n },\n});\n\n/**\n * Styles for the label slot\n */\nconst useOverflowLabelStyles = makeStyles({\n base: {\n marginLeft: tokens.spacingHorizontalS,\n color: tokens.colorNeutralForeground1,\n ...typographyStyles.body1,\n },\n});\n\n/**\n * Styles for the stack layout\n */\nconst useStackStyles = makeStyles({\n thick: {\n boxShadow: `0 0 0 ${tokens.strokeWidthThick} ${tokens.colorNeutralBackground2}`,\n },\n thicker: {\n boxShadow: `0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorNeutralBackground2}`,\n },\n thickest: {\n boxShadow: `0 0 0 ${tokens.strokeWidthThickest} ${tokens.colorNeutralBackground2}`,\n },\n xxs: { '&:not(:first-child)': { marginLeft: `calc(-1 * ${tokens.spacingHorizontalXXS})` } },\n xs: { '&:not(:first-child)': { marginLeft: `calc(-1 * ${tokens.spacingHorizontalXS})` } },\n s: { '&:not(:first-child)': { marginLeft: `calc(-1 * ${tokens.spacingHorizontalS})` } },\n l: { '&:not(:first-child)': { marginLeft: `calc(-1 * ${tokens.spacingHorizontalL})` } },\n});\n\n/**\n * Styles for the spread layout\n */\nconst useSpreadStyles = makeStyles({\n s: { '&:not(:first-child)': { marginLeft: tokens.spacingHorizontalS } },\n mNudge: { '&:not(:first-child)': { marginLeft: tokens.spacingHorizontalMNudge } },\n m: { '&:not(:first-child)': { marginLeft: tokens.spacingHorizontalM } },\n l: { '&:not(:first-child)': { marginLeft: tokens.spacingHorizontalL } },\n xl: { '&:not(:first-child)': { marginLeft: tokens.spacingHorizontalXL } },\n});\n\n/**\n * Styles for the pie layout\n */\nconst usePieStyles = makeStyles({\n base: {\n position: 'absolute',\n },\n slices: {\n // Two slices\n // 1st of 2 items\n '&:nth-of-type(1):nth-last-of-type(2)': {\n clipPath: `inset(0 calc(25% + (var(${avatarGroupItemDividerWidthVar}) / 2)) 0 25%)`,\n left: '-25%',\n },\n // 2nd of 2 items\n '&:nth-of-type(2):nth-last-of-type(1)': {\n clipPath: `inset(0 25% 0 calc(25% + (var(${avatarGroupItemDividerWidthVar}) / 2)))`,\n left: '25%',\n },\n\n // Three slices\n // 1st of 3 items\n '&:nth-of-type(1):nth-last-of-type(3)': {\n clipPath: `inset(0 calc(25% + (var(${avatarGroupItemDividerWidthVar}) / 2)) 0 25%)`,\n left: '-25%',\n },\n // 2nd of 3 items\n '&:nth-of-type(2):nth-last-of-type(2)': {\n // Since the two AvatarGroupItems on the right are scaled by 0.5, the divider width should not be halved.\n clipPath: `inset(0 0 var(${avatarGroupItemDividerWidthVar}) var(${avatarGroupItemDividerWidthVar}))`,\n left: '50%',\n transform: 'scale(0.5)',\n transformOrigin: '0 0',\n },\n // 3rd of 3 items\n '&:nth-of-type(3):nth-last-of-type(1)': {\n clipPath: `inset(var(${avatarGroupItemDividerWidthVar}) 0 0 var(${avatarGroupItemDividerWidthVar}))`,\n left: '50%',\n top: '50%',\n transform: 'scale(0.5)',\n transformOrigin: '0 0',\n },\n },\n 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 = (layout: AvatarGroupProps['layout'], size: AvatarSizes): string => {\n const stackStyles = useStackStyles();\n const spreadStyles = useSpreadStyles();\n const layoutClasses = [];\n\n if (size) {\n if (layout === 'stack') {\n if (size < 56) {\n layoutClasses.push(stackStyles.thick);\n } else if (size < 72) {\n layoutClasses.push(stackStyles.thicker);\n } else {\n layoutClasses.push(stackStyles.thickest);\n }\n\n if (size < 24) {\n layoutClasses.push(stackStyles.xxs);\n } else if (size < 48) {\n layoutClasses.push(stackStyles.xs);\n } else if (size < 96) {\n layoutClasses.push(stackStyles.s);\n } else {\n layoutClasses.push(stackStyles.l);\n }\n } else if (layout === 'spread') {\n if (size < 20) {\n layoutClasses.push(spreadStyles.s);\n } else if (size < 32) {\n layoutClasses.push(spreadStyles.mNudge);\n } else if (size < 64) {\n layoutClasses.push(spreadStyles.l);\n } else {\n layoutClasses.push(spreadStyles.xl);\n }\n }\n }\n\n return mergeClasses(...layoutClasses);\n};\n"]}
@@ -0,0 +1,17 @@
1
+ define(["require", "exports", "./renderAvatarGroupPopover", "./useAvatarGroupPopoverContextValues", "./useAvatarGroupPopover", "./useAvatarGroupPopoverStyles"], function (require, exports, renderAvatarGroupPopover_1, useAvatarGroupPopoverContextValues_1, useAvatarGroupPopover_1, useAvatarGroupPopoverStyles_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.AvatarGroupPopover = void 0;
5
+ /**
6
+ * The AvatarGroupPopover component provides a button with a Popover containing the children provided.
7
+ */
8
+ var AvatarGroupPopover = function (props) {
9
+ var state = useAvatarGroupPopover_1.useAvatarGroupPopover_unstable(props);
10
+ var contextValues = useAvatarGroupPopoverContextValues_1.useAvatarGroupPopoverContextValues(state);
11
+ useAvatarGroupPopoverStyles_1.useAvatarGroupPopoverStyles_unstable(state);
12
+ return renderAvatarGroupPopover_1.renderAvatarGroupPopover_unstable(state, contextValues);
13
+ };
14
+ exports.AvatarGroupPopover = AvatarGroupPopover;
15
+ exports.AvatarGroupPopover.displayName = 'AvatarGroupPopover';
16
+ });
17
+ //# sourceMappingURL=AvatarGroupPopover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AvatarGroupPopover.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-avatar/src/components/AvatarGroupPopover/AvatarGroupPopover.tsx"],"names":[],"mappings":";;;;IAOA;;OAEG;IACI,IAAM,kBAAkB,GAAsC,UAAA,KAAK;QACxE,IAAM,KAAK,GAAG,sDAA8B,CAAC,KAAK,CAAC,CAAC;QACpD,IAAM,aAAa,GAAG,uEAAkC,CAAC,KAAK,CAAC,CAAC;QAEhE,kEAAoC,CAAC,KAAK,CAAC,CAAC;QAC5C,OAAO,4DAAiC,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IACjE,CAAC,CAAC;IANW,QAAA,kBAAkB,sBAM7B;IAEF,0BAAkB,CAAC,WAAW,GAAG,oBAAoB,CAAC","sourcesContent":["import * as React from 'react';\nimport { renderAvatarGroupPopover_unstable } from './renderAvatarGroupPopover';\nimport { useAvatarGroupPopoverContextValues } from './useAvatarGroupPopoverContextValues';\nimport { useAvatarGroupPopover_unstable } from './useAvatarGroupPopover';\nimport { useAvatarGroupPopoverStyles_unstable } from './useAvatarGroupPopoverStyles';\nimport type { AvatarGroupPopoverProps } from './AvatarGroupPopover.types';\n\n/**\n * The AvatarGroupPopover component provides a button with a Popover containing the children provided.\n */\nexport const AvatarGroupPopover: React.FC<AvatarGroupPopoverProps> = props => {\n const state = useAvatarGroupPopover_unstable(props);\n const contextValues = useAvatarGroupPopoverContextValues(state);\n\n useAvatarGroupPopoverStyles_unstable(state);\n return renderAvatarGroupPopover_unstable(state, contextValues);\n};\n\nAvatarGroupPopover.displayName = 'AvatarGroupPopover';\n"]}
@@ -0,0 +1,5 @@
1
+ define(["require", "exports"], function (require, exports) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ });
5
+ //# sourceMappingURL=AvatarGroupPopover.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AvatarGroupPopover.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-avatar/src/components/AvatarGroupPopover/AvatarGroupPopover.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { AvatarSizes } from '../Avatar/Avatar.types';\nimport type { AvatarGroupProps } from '../AvatarGroup/AvatarGroup.types';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { PopoverProps, PopoverSurface } from '@fluentui/react-popover';\nimport type { TooltipProps } from '@fluentui/react-tooltip';\n\nexport type AvatarGroupPopoverSlots = {\n root: NonNullable<Slot<PopoverProps>>;\n\n /**\n * Button that triggers the Popover.\n */\n triggerButton: NonNullable<Slot<'button'>>;\n\n /**\n * List that contains the overflowed AvatarGroupItems.\n */\n content: NonNullable<Slot<'ul'>>;\n\n /**\n * PopoverSurface that contains the content.\n */\n popoverSurface: NonNullable<Slot<typeof PopoverSurface>>;\n\n /**\n * Tooltip shown when triggerButton is hovered.\n */\n tooltip: NonNullable<Slot<TooltipProps>>;\n};\n\n/**\n * AvatarGroupPopover Props\n */\nexport type AvatarGroupPopoverProps = Omit<ComponentProps<Partial<AvatarGroupPopoverSlots>>, 'children'> & {\n /**\n * Whether the triggerButton should render an icon instead of the number of overflowed AvatarGroupItems.\n * Note: The indicator will default to `icon` when the size is less than 24.\n * @default count\n */\n indicator?: 'count' | 'icon';\n\n /**\n * Number of AvatarGroupItems that will be rendered.\n *\n * Note: AvatarGroupPopover handles counting the number of children, but when using a react fragment to wrap the\n * children, this is not possible and therefore it has do be added manually.\n */\n count?: number;\n\n children: React.ReactNode;\n};\n\n/**\n * State used in rendering AvatarGroupPopover\n */\nexport type AvatarGroupPopoverState = ComponentState<AvatarGroupPopoverSlots> &\n Required<Pick<AvatarGroupPopoverProps, 'count' | 'indicator'>> & {\n popoverOpen: boolean;\n layout: AvatarGroupProps['layout'];\n size: AvatarSizes;\n };\n"]}
@@ -0,0 +1,10 @@
1
+ define(["require", "exports", "tslib", "./AvatarGroupPopover", "./AvatarGroupPopover.types", "./renderAvatarGroupPopover", "./useAvatarGroupPopover", "./useAvatarGroupPopoverStyles"], function (require, exports, tslib_1, AvatarGroupPopover_1, AvatarGroupPopover_types_1, renderAvatarGroupPopover_1, useAvatarGroupPopover_1, useAvatarGroupPopoverStyles_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ tslib_1.__exportStar(AvatarGroupPopover_1, exports);
5
+ tslib_1.__exportStar(AvatarGroupPopover_types_1, exports);
6
+ tslib_1.__exportStar(renderAvatarGroupPopover_1, exports);
7
+ tslib_1.__exportStar(useAvatarGroupPopover_1, exports);
8
+ tslib_1.__exportStar(useAvatarGroupPopoverStyles_1, exports);
9
+ });
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-avatar/src/components/AvatarGroupPopover/index.ts"],"names":[],"mappings":";;;IAAA,oDAAqC;IACrC,0DAA2C;IAC3C,0DAA2C;IAC3C,uDAAwC;IACxC,6DAA8C","sourcesContent":["export * from './AvatarGroupPopover';\nexport * from './AvatarGroupPopover.types';\nexport * from './renderAvatarGroupPopover';\nexport * from './useAvatarGroupPopover';\nexport * from './useAvatarGroupPopoverStyles';\n"]}
@@ -0,0 +1,20 @@
1
+ define(["require", "exports", "tslib", "react", "../../contexts/AvatarGroupContext", "@fluentui/react-utilities", "@fluentui/react-popover"], function (require, exports, tslib_1, React, AvatarGroupContext_1, react_utilities_1, react_popover_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.renderAvatarGroupPopover_unstable = void 0;
5
+ /**
6
+ * Render the final JSX of AvatarGroupPopover
7
+ */
8
+ var renderAvatarGroupPopover_unstable = function (state, contextValues) {
9
+ var _a = react_utilities_1.getSlots(state), slots = _a.slots, slotProps = _a.slotProps;
10
+ return (React.createElement(slots.root, tslib_1.__assign({}, slotProps.root),
11
+ React.createElement(react_popover_1.PopoverTrigger, { disableButtonEnhancement: true },
12
+ React.createElement(slots.tooltip, tslib_1.__assign({}, slotProps.tooltip),
13
+ React.createElement(slots.triggerButton, tslib_1.__assign({}, slotProps.triggerButton)))),
14
+ React.createElement(slots.popoverSurface, tslib_1.__assign({}, slotProps.popoverSurface),
15
+ React.createElement(AvatarGroupContext_1.AvatarGroupProvider, { value: contextValues.avatarGroup },
16
+ React.createElement(slots.content, tslib_1.__assign({}, slotProps.content))))));
17
+ };
18
+ exports.renderAvatarGroupPopover_unstable = renderAvatarGroupPopover_unstable;
19
+ });
20
+ //# sourceMappingURL=renderAvatarGroupPopover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderAvatarGroupPopover.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-avatar/src/components/AvatarGroupPopover/renderAvatarGroupPopover.tsx"],"names":[],"mappings":";;;;IAQA;;OAEG;IACI,IAAM,iCAAiC,GAAG,UAC/C,KAA8B,EAC9B,aAAuC;QAEjC,IAAA,KAAuB,0BAAQ,CAA0B,KAAK,CAAC,EAA7D,KAAK,WAAA,EAAE,SAAS,eAA6C,CAAC;QAEtE,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAM,SAAS,CAAC,IAAqB;YAC9C,oBAAC,8BAAc,IAAC,wBAAwB;gBACtC,oBAAC,KAAK,CAAC,OAAO,uBAAM,SAAS,CAAC,OAAwB;oBACpD,oBAAC,KAAK,CAAC,aAAa,uBAAK,SAAS,CAAC,aAAa,EAAI,CACtC,CACD;YACjB,oBAAC,KAAK,CAAC,cAAc,uBAAK,SAAS,CAAC,cAAc;gBAChD,oBAAC,wCAAmB,IAAC,KAAK,EAAE,aAAa,CAAC,WAAW;oBACnD,oBAAC,KAAK,CAAC,OAAO,uBAAK,SAAS,CAAC,OAAO,EAAI,CACpB,CACD,CACZ,CACd,CAAC;IACJ,CAAC,CAAC;IApBW,QAAA,iCAAiC,qCAoB5C","sourcesContent":["import * as React from 'react';\nimport { AvatarGroupProvider } from '../../contexts/AvatarGroupContext';\nimport { AvatarGroupContextValues } from '../AvatarGroup/AvatarGroup.types';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { PopoverProps, PopoverTrigger } from '@fluentui/react-popover';\nimport { TooltipProps } from '@fluentui/react-tooltip';\nimport type { AvatarGroupPopoverState, AvatarGroupPopoverSlots } from './AvatarGroupPopover.types';\n\n/**\n * Render the final JSX of AvatarGroupPopover\n */\nexport const renderAvatarGroupPopover_unstable = (\n state: AvatarGroupPopoverState,\n contextValues: AvatarGroupContextValues,\n) => {\n const { slots, slotProps } = getSlots<AvatarGroupPopoverSlots>(state);\n\n return (\n <slots.root {...(slotProps.root as PopoverProps)}>\n <PopoverTrigger disableButtonEnhancement>\n <slots.tooltip {...(slotProps.tooltip as TooltipProps)}>\n <slots.triggerButton {...slotProps.triggerButton} />\n </slots.tooltip>\n </PopoverTrigger>\n <slots.popoverSurface {...slotProps.popoverSurface}>\n <AvatarGroupProvider value={contextValues.avatarGroup}>\n <slots.content {...slotProps.content} />\n </AvatarGroupProvider>\n </slots.popoverSurface>\n </slots.root>\n );\n};\n"]}
@@ -0,0 +1,86 @@
1
+ define(["require", "exports", "tslib", "react", "../../contexts/AvatarGroupContext", "../AvatarGroup/useAvatarGroup", "@fluentui/react-utilities", "@fluentui/react-icons", "@fluentui/react-popover", "@fluentui/react-tooltip"], function (require, exports, tslib_1, React, AvatarGroupContext_1, useAvatarGroup_1, react_utilities_1, react_icons_1, react_popover_1, react_tooltip_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useAvatarGroupPopover_unstable = void 0;
5
+ /**
6
+ * Create the state required to render AvatarGroupPopover.
7
+ *
8
+ * The returned state can be modified with hooks such as useAvatarGroupPopoverStyles_unstable,
9
+ * before being passed to renderAvatarGroupPopover_unstable.
10
+ *
11
+ * @param props - props from this instance of AvatarGroupPopover
12
+ */
13
+ var useAvatarGroupPopover_unstable = function (props) {
14
+ var _a;
15
+ var size = (_a = AvatarGroupContext_1.useAvatarGroupContext_unstable(function (ctx) { return ctx.size; })) !== null && _a !== void 0 ? _a : useAvatarGroup_1.defaultAvatarGroupSize;
16
+ var layout = AvatarGroupContext_1.useAvatarGroupContext_unstable(function (ctx) { return ctx.layout; });
17
+ var _b = props.indicator, indicator = _b === void 0 ? size < 24 ? 'icon' : 'count' : _b, _c = props.count, count = _c === void 0 ? React.Children.count(props.children) : _c, children = props.children, restOfProps = tslib_1.__rest(props, ["indicator", "count", "children"]);
18
+ var _d = react_utilities_1.useControllableState({
19
+ state: props.open,
20
+ defaultState: props.defaultOpen,
21
+ initialState: false,
22
+ }), popoverOpen = _d[0], setPopoverOpen = _d[1];
23
+ var handleOnPopoverChange = function (e, data) {
24
+ var _a;
25
+ (_a = restOfProps.onOpenChange) === null || _a === void 0 ? void 0 : _a.call(restOfProps, e, data);
26
+ setPopoverOpen(data.open);
27
+ };
28
+ var triggerButtonChildren;
29
+ if (layout === 'pie') {
30
+ triggerButtonChildren = null;
31
+ }
32
+ else if (indicator === 'icon') {
33
+ triggerButtonChildren = React.createElement(react_icons_1.MoreHorizontalRegular, null);
34
+ }
35
+ else {
36
+ triggerButtonChildren = count > 99 ? '99+' : "+" + count;
37
+ }
38
+ return {
39
+ count: count,
40
+ indicator: indicator,
41
+ layout: layout,
42
+ popoverOpen: popoverOpen,
43
+ size: size,
44
+ components: {
45
+ root: react_popover_1.Popover,
46
+ triggerButton: 'button',
47
+ content: 'ul',
48
+ popoverSurface: react_popover_1.PopoverSurface,
49
+ tooltip: react_tooltip_1.Tooltip,
50
+ },
51
+ root: tslib_1.__assign(tslib_1.__assign({
52
+ // Popover expects a child for its children. The children are added in the renderAvatarGroupPopover.
53
+ children: React.createElement(React.Fragment, null), size: 'small', trapFocus: true }, restOfProps), { open: popoverOpen, onOpenChange: handleOnPopoverChange }),
54
+ triggerButton: react_utilities_1.resolveShorthand(props.triggerButton, {
55
+ required: true,
56
+ defaultProps: {
57
+ children: triggerButtonChildren,
58
+ type: 'button',
59
+ },
60
+ }),
61
+ content: react_utilities_1.resolveShorthand(props.content, {
62
+ required: true,
63
+ defaultProps: {
64
+ children: children,
65
+ role: 'list',
66
+ },
67
+ }),
68
+ popoverSurface: react_utilities_1.resolveShorthand(props.popoverSurface, {
69
+ required: true,
70
+ defaultProps: {
71
+ 'aria-label': 'Overflow',
72
+ tabIndex: 0,
73
+ },
74
+ }),
75
+ tooltip: react_utilities_1.resolveShorthand(props.tooltip, {
76
+ required: true,
77
+ defaultProps: {
78
+ content: 'View more people.',
79
+ relationship: 'label',
80
+ },
81
+ }),
82
+ };
83
+ };
84
+ exports.useAvatarGroupPopover_unstable = useAvatarGroupPopover_unstable;
85
+ });
86
+ //# sourceMappingURL=useAvatarGroupPopover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAvatarGroupPopover.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-avatar/src/components/AvatarGroupPopover/useAvatarGroupPopover.tsx"],"names":[],"mappings":";;;;IASA;;;;;;;OAOG;IACI,IAAM,8BAA8B,GAAG,UAAC,KAA8B;;QAC3E,IAAM,IAAI,GAAG,MAAA,mDAA8B,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,IAAI,EAAR,CAAQ,CAAC,mCAAI,uCAAsB,CAAC;QACvF,IAAM,MAAM,GAAG,mDAA8B,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,MAAM,EAAV,CAAU,CAAC,CAAC;QAE/D,IAAA,KAIE,KAAK,UAJiC,EAAxC,SAAS,mBAAG,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,KAAA,EACxC,KAGE,KAAK,MAHqC,EAA5C,KAAK,mBAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAA,EAC5C,QAAQ,GAEN,KAAK,SAFC,EACL,WAAW,kBACZ,KAAK,EALH,kCAKL,CADe,CACN;QAEJ,IAAA,KAAgC,sCAAoB,CAAC;YACzD,KAAK,EAAE,KAAK,CAAC,IAAI;YACjB,YAAY,EAAE,KAAK,CAAC,WAAW;YAC/B,YAAY,EAAE,KAAK;SACpB,CAAC,EAJK,WAAW,QAAA,EAAE,cAAc,QAIhC,CAAC;QAEH,IAAM,qBAAqB,GAAG,UAAC,CAAoB,EAAE,IAAsB;;YACzE,MAAA,WAAW,CAAC,YAAY,+CAAxB,WAAW,EAAgB,CAAC,EAAE,IAAI,CAAC,CAAC;YACpC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC,CAAC;QAEF,IAAI,qBAAqB,CAAC;QAC1B,IAAI,MAAM,KAAK,KAAK,EAAE;YACpB,qBAAqB,GAAG,IAAI,CAAC;SAC9B;aAAM,IAAI,SAAS,KAAK,MAAM,EAAE;YAC/B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;iBACtB;aACF,CAAC;SACH,CAAC;IACJ,CAAC,CAAC;IAlFW,QAAA,8BAA8B,kCAkFzC","sourcesContent":["import * as React from 'react';\nimport { useAvatarGroupContext_unstable } from '../../contexts/AvatarGroupContext';\nimport { defaultAvatarGroupSize } from '../AvatarGroup/useAvatarGroup';\nimport { resolveShorthand, useControllableState } from '@fluentui/react-utilities';\nimport { MoreHorizontalRegular } from '@fluentui/react-icons';\nimport { OnOpenChangeData, OpenPopoverEvents, Popover, PopoverSurface } from '@fluentui/react-popover';\nimport type { AvatarGroupPopoverProps, AvatarGroupPopoverState } from './AvatarGroupPopover.types';\nimport { Tooltip } from '@fluentui/react-tooltip';\n\n/**\n * Create the state required to render AvatarGroupPopover.\n *\n * The returned state can be modified with hooks such as useAvatarGroupPopoverStyles_unstable,\n * before being passed to renderAvatarGroupPopover_unstable.\n *\n * @param props - props from this instance of AvatarGroupPopover\n */\nexport const useAvatarGroupPopover_unstable = (props: AvatarGroupPopoverProps): AvatarGroupPopoverState => {\n const size = useAvatarGroupContext_unstable(ctx => ctx.size) ?? defaultAvatarGroupSize;\n const layout = useAvatarGroupContext_unstable(ctx => ctx.layout);\n const {\n indicator = size < 24 ? 'icon' : 'count',\n count = React.Children.count(props.children),\n children,\n ...restOfProps\n } = props;\n\n const [popoverOpen, setPopoverOpen] = useControllableState({\n state: props.open,\n defaultState: props.defaultOpen,\n initialState: false,\n });\n\n const handleOnPopoverChange = (e: OpenPopoverEvents, data: OnOpenChangeData) => {\n restOfProps.onOpenChange?.(e, data);\n setPopoverOpen(data.open);\n };\n\n let triggerButtonChildren;\n if (layout === 'pie') {\n triggerButtonChildren = null;\n } else if (indicator === 'icon') {\n triggerButtonChildren = <MoreHorizontalRegular />;\n } else {\n triggerButtonChildren = count > 99 ? '99+' : `+${count}`;\n }\n\n return {\n count,\n indicator,\n layout,\n popoverOpen,\n size,\n\n components: {\n root: Popover,\n triggerButton: 'button',\n content: 'ul',\n popoverSurface: PopoverSurface,\n tooltip: Tooltip,\n },\n root: {\n // Popover expects a child for its children. The children are added in the renderAvatarGroupPopover.\n children: <></>,\n size: 'small',\n trapFocus: true,\n ...restOfProps,\n open: popoverOpen,\n onOpenChange: handleOnPopoverChange,\n },\n triggerButton: resolveShorthand(props.triggerButton, {\n required: true,\n defaultProps: {\n children: triggerButtonChildren,\n type: 'button',\n },\n }),\n content: resolveShorthand(props.content, {\n required: true,\n defaultProps: {\n children,\n role: 'list',\n },\n }),\n popoverSurface: resolveShorthand(props.popoverSurface, {\n required: true,\n defaultProps: {\n 'aria-label': 'Overflow',\n tabIndex: 0,\n },\n }),\n tooltip: resolveShorthand(props.tooltip, {\n required: true,\n defaultProps: {\n content: 'View more people.',\n relationship: 'label',\n },\n }),\n };\n};\n"]}
@@ -0,0 +1,14 @@
1
+ define(["require", "exports"], function (require, exports) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useAvatarGroupPopoverContextValues = void 0;
5
+ var useAvatarGroupPopoverContextValues = function (state) {
6
+ var avatarGroup = {
7
+ isOverflow: true,
8
+ size: 24,
9
+ };
10
+ return { avatarGroup: avatarGroup };
11
+ };
12
+ exports.useAvatarGroupPopoverContextValues = useAvatarGroupPopoverContextValues;
13
+ });
14
+ //# sourceMappingURL=useAvatarGroupPopoverContextValues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAvatarGroupPopoverContextValues.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-avatar/src/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.ts"],"names":[],"mappings":";;;;IAGO,IAAM,kCAAkC,GAAG,UAAC,KAA8B;QAC/E,IAAM,WAAW,GAA4B;YAC3C,UAAU,EAAE,IAAI;YAChB,IAAI,EAAE,EAAE;SACT,CAAC;QAEF,OAAO,EAAE,WAAW,aAAA,EAAE,CAAC;IACzB,CAAC,CAAC;IAPW,QAAA,kCAAkC,sCAO7C","sourcesContent":["import { AvatarGroupContextValue, AvatarGroupContextValues } from '../AvatarGroup/AvatarGroup.types';\nimport { AvatarGroupPopoverState } from './AvatarGroupPopover.types';\n\nexport const useAvatarGroupPopoverContextValues = (state: AvatarGroupPopoverState): AvatarGroupContextValues => {\n const avatarGroup: AvatarGroupContextValue = {\n isOverflow: true,\n size: 24,\n };\n\n return { avatarGroup };\n};\n"]}
@@ -0,0 +1,136 @@
1
+ define(["require", "exports", "tslib", "@fluentui/react-tabster", "@griffel/react", "@fluentui/react-theme", "../AvatarGroupItem/useAvatarGroupItemStyles", "../Avatar/useAvatarStyles"], function (require, exports, tslib_1, react_tabster_1, react_1, react_theme_1, useAvatarGroupItemStyles_1, useAvatarStyles_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useAvatarGroupPopoverStyles_unstable = exports.avatarGroupPopoverClassNames = void 0;
5
+ exports.avatarGroupPopoverClassNames = {
6
+ root: 'fui-AvatarGroupPopover',
7
+ content: 'fui-AvatarGroupPopover__content',
8
+ popoverSurface: 'fui-AvatarGroupPopover__popoverSurface',
9
+ tooltip: 'fui-AvatarGroupPopover__tooltip',
10
+ triggerButton: 'fui-AvatarGroupPopover__triggerButton',
11
+ };
12
+ /**
13
+ * Styles for the content slot.
14
+ */
15
+ var useContentStyles = react_1.makeStyles({
16
+ base: tslib_1.__assign(tslib_1.__assign({ listStyleType: 'none' }, react_1.shorthands.margin('0')), react_1.shorthands.padding('0')),
17
+ });
18
+ /**
19
+ * Styles for the popoverSurface slot.
20
+ */
21
+ var usePopoverSurfaceStyles = react_1.makeStyles({
22
+ base: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ maxHeight: '220px', minHeight: '80px' }, react_1.shorthands.overflow('hidden', 'scroll')), react_1.shorthands.padding(react_theme_1.tokens.spacingVerticalS, react_theme_1.tokens.spacingHorizontalS)), { width: '220px' }),
23
+ });
24
+ /**
25
+ * Styles for the triggerButton slot.
26
+ */
27
+ var useTriggerButtonStyles = react_1.makeStyles({
28
+ base: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ display: 'inline-flex', position: 'relative', flexShrink: 0, justifyContent: 'center', alignItems: 'center', color: react_theme_1.tokens.colorNeutralForeground1, backgroundColor: react_theme_1.tokens.colorNeutralBackground1 }, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStroke1)), react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusCircular)), react_1.shorthands.borderStyle('solid')), react_1.shorthands.padding(0)), {
29
+ // Match color to Avatar's outline color.
30
+ '@media (forced-colors: active)': tslib_1.__assign({}, react_1.shorthands.borderColor('CanvasText')) }),
31
+ pie: tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorTransparentBackground }, react_1.shorthands.borderColor(react_theme_1.tokens.colorTransparentStroke)), { color: 'transparent' }),
32
+ focusIndicator: react_tabster_1.createCustomFocusIndicatorStyle(tslib_1.__assign({}, react_1.shorthands.border(react_theme_1.tokens.strokeWidthThick, 'solid', react_theme_1.tokens.colorStrokeFocus2))),
33
+ states: {
34
+ '&:hover': tslib_1.__assign({ color: react_theme_1.tokens.colorNeutralForeground1Hover, backgroundColor: react_theme_1.tokens.colorNeutralBackground1Hover }, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStroke1Hover)),
35
+ '&:active': tslib_1.__assign({ color: react_theme_1.tokens.colorNeutralForeground1Pressed, backgroundColor: react_theme_1.tokens.colorNeutralBackground1Pressed }, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStroke1Pressed)),
36
+ },
37
+ selected: tslib_1.__assign({ color: react_theme_1.tokens.colorNeutralForeground1Selected, backgroundColor: react_theme_1.tokens.colorNeutralBackground1Selected }, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStroke1Selected)),
38
+ icon12: { fontSize: '12px' },
39
+ icon16: { fontSize: '16px' },
40
+ icon20: { fontSize: '20px' },
41
+ icon24: { fontSize: '24px' },
42
+ icon28: { fontSize: '28px' },
43
+ icon32: { fontSize: '32px' },
44
+ icon48: { fontSize: '48px' },
45
+ caption2Strong: tslib_1.__assign({}, react_theme_1.typographyStyles.caption2Strong),
46
+ caption1Strong: tslib_1.__assign({}, react_theme_1.typographyStyles.caption1Strong),
47
+ body1Strong: tslib_1.__assign({}, react_theme_1.typographyStyles.body1Strong),
48
+ subtitle2: tslib_1.__assign({}, react_theme_1.typographyStyles.subtitle2),
49
+ subtitle1: tslib_1.__assign({}, react_theme_1.typographyStyles.subtitle1),
50
+ title3: tslib_1.__assign({}, react_theme_1.typographyStyles.title3),
51
+ borderThin: tslib_1.__assign({}, react_1.shorthands.borderWidth(react_theme_1.tokens.strokeWidthThin)),
52
+ borderThick: tslib_1.__assign({}, react_1.shorthands.borderWidth(react_theme_1.tokens.strokeWidthThick)),
53
+ borderThicker: tslib_1.__assign({}, react_1.shorthands.borderWidth(react_theme_1.tokens.strokeWidthThicker)),
54
+ borderThickest: tslib_1.__assign({}, react_1.shorthands.borderWidth(react_theme_1.tokens.strokeWidthThickest)),
55
+ });
56
+ /**
57
+ * Apply styling to the AvatarGroupPopover slots based on the state
58
+ */
59
+ var useAvatarGroupPopoverStyles_unstable = function (state) {
60
+ var indicator = state.indicator, size = state.size, layout = state.layout, popoverOpen = state.popoverOpen;
61
+ var sizeStyles = useAvatarStyles_1.useSizeStyles();
62
+ var triggerButtonStyles = useTriggerButtonStyles();
63
+ var contentStyles = useContentStyles();
64
+ var popoverSurfaceStyles = usePopoverSurfaceStyles();
65
+ var groupChildClassName = useAvatarGroupItemStyles_1.useGroupChildClassName(layout, size);
66
+ var triggerButtonClasses = [];
67
+ if (size < 36) {
68
+ triggerButtonClasses.push(triggerButtonStyles.borderThin);
69
+ }
70
+ else if (size < 56) {
71
+ triggerButtonClasses.push(triggerButtonStyles.borderThick);
72
+ }
73
+ else if (size < 72) {
74
+ triggerButtonClasses.push(triggerButtonStyles.borderThicker);
75
+ }
76
+ else {
77
+ triggerButtonClasses.push(triggerButtonStyles.borderThickest);
78
+ }
79
+ if (indicator === 'count') {
80
+ if (size <= 24) {
81
+ triggerButtonClasses.push(triggerButtonStyles.caption2Strong);
82
+ }
83
+ else if (size <= 28) {
84
+ triggerButtonClasses.push(triggerButtonStyles.caption1Strong);
85
+ }
86
+ else if (size <= 40) {
87
+ triggerButtonClasses.push(triggerButtonStyles.body1Strong);
88
+ }
89
+ else if (size <= 56) {
90
+ triggerButtonClasses.push(triggerButtonStyles.subtitle2);
91
+ }
92
+ else if (size <= 96) {
93
+ triggerButtonClasses.push(triggerButtonStyles.subtitle1);
94
+ }
95
+ else {
96
+ triggerButtonClasses.push(triggerButtonStyles.title3);
97
+ }
98
+ }
99
+ else {
100
+ if (size <= 16) {
101
+ triggerButtonClasses.push(triggerButtonStyles.icon12);
102
+ }
103
+ else if (size <= 24) {
104
+ triggerButtonClasses.push(triggerButtonStyles.icon16);
105
+ }
106
+ else if (size <= 40) {
107
+ triggerButtonClasses.push(triggerButtonStyles.icon20);
108
+ }
109
+ else if (size <= 48) {
110
+ triggerButtonClasses.push(triggerButtonStyles.icon24);
111
+ }
112
+ else if (size <= 56) {
113
+ triggerButtonClasses.push(triggerButtonStyles.icon28);
114
+ }
115
+ else if (size <= 72) {
116
+ triggerButtonClasses.push(triggerButtonStyles.icon32);
117
+ }
118
+ else {
119
+ triggerButtonClasses.push(triggerButtonStyles.icon48);
120
+ }
121
+ }
122
+ state.triggerButton.className = react_1.mergeClasses.apply(void 0, tslib_1.__spreadArray(tslib_1.__spreadArray([exports.avatarGroupPopoverClassNames.triggerButton,
123
+ groupChildClassName,
124
+ sizeStyles[size],
125
+ triggerButtonStyles.base,
126
+ layout === 'pie' && triggerButtonStyles.pie,
127
+ triggerButtonStyles.focusIndicator,
128
+ layout !== 'pie' && triggerButtonStyles.states,
129
+ layout !== 'pie' && popoverOpen && triggerButtonStyles.selected], triggerButtonClasses), [state.triggerButton.className]));
130
+ state.content.className = react_1.mergeClasses(exports.avatarGroupPopoverClassNames.content, contentStyles.base, state.content.className);
131
+ state.popoverSurface.className = react_1.mergeClasses(exports.avatarGroupPopoverClassNames.popoverSurface, popoverSurfaceStyles.base, state.popoverSurface.className);
132
+ return state;
133
+ };
134
+ exports.useAvatarGroupPopoverStyles_unstable = useAvatarGroupPopoverStyles_unstable;
135
+ });
136
+ //# sourceMappingURL=useAvatarGroupPopoverStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAvatarGroupPopoverStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-avatar/src/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.ts"],"names":[],"mappings":";;;;IAQa,QAAA,4BAA4B,GAA4C;QACnF,IAAI,EAAE,wBAAwB;QAC9B,OAAO,EAAE,iCAAiC;QAC1C,cAAc,EAAE,wCAAwC;QACxD,OAAO,EAAE,iCAAiC;QAC1C,aAAa,EAAE,uCAAuC;KACvD,CAAC;IAEF;;OAEG;IACH,IAAM,gBAAgB,GAAG,kBAAU,CAAC;QAClC,IAAI,sCACF,aAAa,EAAE,MAAM,IAClB,kBAAU,CAAC,MAAM,CAAC,GAAG,CAAC,GACtB,kBAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAC3B;KACF,CAAC,CAAC;IAEH;;OAEG;IACH,IAAM,uBAAuB,GAAG,kBAAU,CAAC;QACzC,IAAI,uDACF,SAAS,EAAE,OAAO,EAClB,SAAS,EAAE,MAAM,IACd,kBAAU,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,GACvC,kBAAU,CAAC,OAAO,CAAC,oBAAM,CAAC,gBAAgB,EAAE,oBAAM,CAAC,kBAAkB,CAAC,KACzE,KAAK,EAAE,OAAO,GACf;KACF,CAAC,CAAC;IAEH;;OAEG;IACH,IAAM,sBAAsB,GAAG,kBAAU,CAAC;QACxC,IAAI,yFACF,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,UAAU,EACpB,UAAU,EAAE,CAAC,EACb,cAAc,EAAE,QAAQ,EACxB,UAAU,EAAE,QAAQ,E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,SAAS,CACxB,CAAC;QAEF,KAAK,CAAC,cAAc,CAAC,SAAS,GAAG,oBAAY,CAC3C,oCAA4B,CAAC,cAAc,EAC3C,oBAAoB,CAAC,IAAI,EACzB,KAAK,CAAC,cAAc,CAAC,SAAS,CAC/B,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IA9EW,QAAA,oCAAoC,wCA8E/C","sourcesContent":["import { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { useGroupChildClassName } from '../AvatarGroupItem/useAvatarGroupItemStyles';\nimport { useSizeStyles } from '../Avatar/useAvatarStyles';\nimport type { AvatarGroupPopoverSlots, AvatarGroupPopoverState } from './AvatarGroupPopover.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const avatarGroupPopoverClassNames: SlotClassNames<AvatarGroupPopoverSlots> = {\n root: 'fui-AvatarGroupPopover',\n content: 'fui-AvatarGroupPopover__content',\n popoverSurface: 'fui-AvatarGroupPopover__popoverSurface',\n tooltip: 'fui-AvatarGroupPopover__tooltip',\n triggerButton: 'fui-AvatarGroupPopover__triggerButton',\n};\n\n/**\n * Styles for the content slot.\n */\nconst useContentStyles = makeStyles({\n base: {\n listStyleType: 'none',\n ...shorthands.margin('0'),\n ...shorthands.padding('0'),\n },\n});\n\n/**\n * Styles for the popoverSurface slot.\n */\nconst usePopoverSurfaceStyles = makeStyles({\n base: {\n maxHeight: '220px',\n minHeight: '80px',\n ...shorthands.overflow('hidden', 'scroll'),\n ...shorthands.padding(tokens.spacingVerticalS, tokens.spacingHorizontalS),\n width: '220px',\n },\n});\n\n/**\n * Styles for the triggerButton slot.\n */\nconst useTriggerButtonStyles = makeStyles({\n base: {\n display: 'inline-flex',\n position: 'relative',\n flexShrink: 0,\n justifyContent: 'center',\n alignItems: 'center',\n color: tokens.colorNeutralForeground1,\n backgroundColor: tokens.colorNeutralBackground1,\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n ...shorthands.borderStyle('solid'),\n ...shorthands.padding(0),\n\n // Match color to Avatar's outline color.\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('CanvasText'),\n },\n },\n\n pie: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n color: 'transparent',\n },\n\n focusIndicator: createCustomFocusIndicatorStyle({\n ...shorthands.border(tokens.strokeWidthThick, 'solid', tokens.colorStrokeFocus2),\n }),\n\n states: {\n '&:hover': {\n color: tokens.colorNeutralForeground1Hover,\n backgroundColor: tokens.colorNeutralBackground1Hover,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n },\n '&:active': {\n color: tokens.colorNeutralForeground1Pressed,\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n },\n },\n\n selected: {\n color: tokens.colorNeutralForeground1Selected,\n backgroundColor: tokens.colorNeutralBackground1Selected,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Selected),\n },\n\n icon12: { fontSize: '12px' },\n icon16: { fontSize: '16px' },\n icon20: { fontSize: '20px' },\n icon24: { fontSize: '24px' },\n icon28: { fontSize: '28px' },\n icon32: { fontSize: '32px' },\n icon48: { fontSize: '48px' },\n caption2Strong: { ...typographyStyles.caption2Strong },\n caption1Strong: { ...typographyStyles.caption1Strong },\n body1Strong: { ...typographyStyles.body1Strong },\n subtitle2: { ...typographyStyles.subtitle2 },\n subtitle1: { ...typographyStyles.subtitle1 },\n title3: { ...typographyStyles.title3 },\n borderThin: { ...shorthands.borderWidth(tokens.strokeWidthThin) },\n borderThick: { ...shorthands.borderWidth(tokens.strokeWidthThick) },\n borderThicker: { ...shorthands.borderWidth(tokens.strokeWidthThicker) },\n borderThickest: { ...shorthands.borderWidth(tokens.strokeWidthThickest) },\n});\n\n/**\n * Apply styling to the AvatarGroupPopover slots based on the state\n */\nexport const useAvatarGroupPopoverStyles_unstable = (state: AvatarGroupPopoverState): AvatarGroupPopoverState => {\n const { indicator, size, layout, popoverOpen } = state;\n const sizeStyles = useSizeStyles();\n const triggerButtonStyles = useTriggerButtonStyles();\n const contentStyles = useContentStyles();\n const popoverSurfaceStyles = usePopoverSurfaceStyles();\n const groupChildClassName = useGroupChildClassName(layout, size);\n\n const triggerButtonClasses = [];\n\n if (size < 36) {\n triggerButtonClasses.push(triggerButtonStyles.borderThin);\n } else if (size < 56) {\n triggerButtonClasses.push(triggerButtonStyles.borderThick);\n } else if (size < 72) {\n triggerButtonClasses.push(triggerButtonStyles.borderThicker);\n } else {\n triggerButtonClasses.push(triggerButtonStyles.borderThickest);\n }\n\n if (indicator === 'count') {\n if (size <= 24) {\n triggerButtonClasses.push(triggerButtonStyles.caption2Strong);\n } else if (size <= 28) {\n triggerButtonClasses.push(triggerButtonStyles.caption1Strong);\n } else if (size <= 40) {\n triggerButtonClasses.push(triggerButtonStyles.body1Strong);\n } else if (size <= 56) {\n triggerButtonClasses.push(triggerButtonStyles.subtitle2);\n } else if (size <= 96) {\n triggerButtonClasses.push(triggerButtonStyles.subtitle1);\n } else {\n triggerButtonClasses.push(triggerButtonStyles.title3);\n }\n } else {\n if (size <= 16) {\n triggerButtonClasses.push(triggerButtonStyles.icon12);\n } else if (size <= 24) {\n triggerButtonClasses.push(triggerButtonStyles.icon16);\n } else if (size <= 40) {\n triggerButtonClasses.push(triggerButtonStyles.icon20);\n } else if (size <= 48) {\n triggerButtonClasses.push(triggerButtonStyles.icon24);\n } else if (size <= 56) {\n triggerButtonClasses.push(triggerButtonStyles.icon28);\n } else if (size <= 72) {\n triggerButtonClasses.push(triggerButtonStyles.icon32);\n } else {\n triggerButtonClasses.push(triggerButtonStyles.icon48);\n }\n }\n\n state.triggerButton.className = mergeClasses(\n avatarGroupPopoverClassNames.triggerButton,\n groupChildClassName,\n sizeStyles[size],\n triggerButtonStyles.base,\n layout === 'pie' && triggerButtonStyles.pie,\n triggerButtonStyles.focusIndicator,\n layout !== 'pie' && triggerButtonStyles.states,\n layout !== 'pie' && popoverOpen && triggerButtonStyles.selected,\n ...triggerButtonClasses,\n state.triggerButton.className,\n );\n\n state.content.className = mergeClasses(\n avatarGroupPopoverClassNames.content,\n contentStyles.base,\n state.content.className,\n );\n\n state.popoverSurface.className = mergeClasses(\n avatarGroupPopoverClassNames.popoverSurface,\n popoverSurfaceStyles.base,\n state.popoverSurface.className,\n );\n\n return state;\n};\n"]}
@@ -0,0 +1,17 @@
1
+ define(["require", "exports", "react"], function (require, exports, React) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useAvatarContext = exports.AvatarContextProvider = void 0;
5
+ var avatarContext = React.createContext(undefined);
6
+ var avatarContextDefaultValue = {};
7
+ /**
8
+ * @internal
9
+ */
10
+ exports.AvatarContextProvider = avatarContext.Provider;
11
+ /**
12
+ * @internal
13
+ */
14
+ var useAvatarContext = function () { var _a; return (_a = React.useContext(avatarContext)) !== null && _a !== void 0 ? _a : avatarContextDefaultValue; };
15
+ exports.useAvatarContext = useAvatarContext;
16
+ });
17
+ //# sourceMappingURL=AvatarContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AvatarContext.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-avatar/src/contexts/AvatarContext.ts"],"names":[],"mappings":";;;;IAGA,IAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAiC,SAAS,CAAC,CAAC;IASrF,IAAM,yBAAyB,GAAuB,EAAE,CAAC;IAEzD;;OAEG;IACU,QAAA,qBAAqB,GAAG,aAAa,CAAC,QAAQ,CAAC;IAE5D;;OAEG;IACI,IAAM,gBAAgB,GAAG,sBAAM,OAAA,MAAA,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,mCAAI,yBAAyB,CAAA,EAAA,CAAC;IAAtF,QAAA,gBAAgB,oBAAsE","sourcesContent":["import * as React from 'react';\nimport { AvatarSizes } from '../components/Avatar/Avatar.types';\n\nconst avatarContext = React.createContext<AvatarContextValue | undefined>(undefined);\n\n/**\n * @internal\n */\nexport interface AvatarContextValue {\n size?: AvatarSizes;\n}\n\nconst avatarContextDefaultValue: AvatarContextValue = {};\n\n/**\n * @internal\n */\nexport const AvatarContextProvider = avatarContext.Provider;\n\n/**\n * @internal\n */\nexport const useAvatarContext = () => React.useContext(avatarContext) ?? avatarContextDefaultValue;\n"]}
@@ -0,0 +1,20 @@
1
+ define(["require", "exports", "@fluentui/react-context-selector"], function (require, exports, react_context_selector_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useAvatarGroupContext_unstable = exports.AvatarGroupProvider = exports.AvatarGroupContext = void 0;
5
+ /**
6
+ * AvatarGroupContext is provided by AvatarGroup and AvatarGroupPopover. It's consumed by AvatarGroupItem to determine
7
+ * default values of some props.
8
+ */
9
+ exports.AvatarGroupContext = react_context_selector_1.createContext(undefined);
10
+ var avatarGroupContextDefaultValue = {};
11
+ exports.AvatarGroupProvider = exports.AvatarGroupContext.Provider;
12
+ var useAvatarGroupContext_unstable = function (selector) {
13
+ return react_context_selector_1.useContextSelector(exports.AvatarGroupContext, function (ctx) {
14
+ if (ctx === void 0) { ctx = avatarGroupContextDefaultValue; }
15
+ return selector(ctx);
16
+ });
17
+ };
18
+ exports.useAvatarGroupContext_unstable = useAvatarGroupContext_unstable;
19
+ });
20
+ //# sourceMappingURL=AvatarGroupContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AvatarGroupContext.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-avatar/src/contexts/AvatarGroupContext.ts"],"names":[],"mappings":";;;;IAIA;;;OAGG;IACU,QAAA,kBAAkB,GAAqC,sCAAa,CAC/E,SAAS,CAC0B,CAAC;IAEtC,IAAM,8BAA8B,GAA4B,EAAE,CAAC;IAEtD,QAAA,mBAAmB,GAAG,0BAAkB,CAAC,QAAQ,CAAC;IAExD,IAAM,8BAA8B,GAAG,UAAI,QAAqD;QACrG,OAAA,2CAAkB,CAAC,0BAAkB,EAAE,UAAC,GAAoC;YAApC,oBAAA,EAAA,oCAAoC;YAAK,OAAA,QAAQ,CAAC,GAAG,CAAC;QAAb,CAAa,CAAC;IAA/F,CAA+F,CAAC;IADrF,QAAA,8BAA8B,kCACuD","sourcesContent":["import { createContext, useContextSelector, ContextSelector } from '@fluentui/react-context-selector';\nimport type { Context } from '@fluentui/react-context-selector';\nimport type { AvatarGroupContextValue } from '../AvatarGroup';\n\n/**\n * AvatarGroupContext is provided by AvatarGroup and AvatarGroupPopover. It's consumed by AvatarGroupItem to determine\n * default values of some props.\n */\nexport const AvatarGroupContext: Context<AvatarGroupContextValue> = createContext<AvatarGroupContextValue | undefined>(\n undefined,\n) as Context<AvatarGroupContextValue>;\n\nconst avatarGroupContextDefaultValue: AvatarGroupContextValue = {};\n\nexport const AvatarGroupProvider = AvatarGroupContext.Provider;\n\nexport const useAvatarGroupContext_unstable = <T>(selector: ContextSelector<AvatarGroupContextValue, T>): T =>\n useContextSelector(AvatarGroupContext, (ctx = avatarGroupContextDefaultValue) => selector(ctx));\n"]}
@@ -0,0 +1,7 @@
1
+ define(["require", "exports", "tslib", "./AvatarGroupContext", "./AvatarContext"], function (require, exports, tslib_1, AvatarGroupContext_1, AvatarContext_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ tslib_1.__exportStar(AvatarGroupContext_1, exports);
5
+ tslib_1.__exportStar(AvatarContext_1, exports);
6
+ });
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-avatar/src/contexts/index.ts"],"names":[],"mappings":";;;IAAA,oDAAqC;IACrC,+CAAgC","sourcesContent":["export * from './AvatarGroupContext';\nexport * from './AvatarContext';\n"]}
@@ -0,0 +1,33 @@
1
+ define(["require", "exports", "./Avatar", "./utils/index", "./AvatarGroup", "./AvatarGroupItem", "./AvatarGroupPopover", "./contexts/index"], function (require, exports, Avatar_1, index_1, AvatarGroup_1, AvatarGroupItem_1, AvatarGroupPopover_1, index_2) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useAvatarGroupContext_unstable = exports.useAvatarContext = exports.AvatarGroupProvider = exports.AvatarContextProvider = exports.useAvatarGroupPopover_unstable = exports.useAvatarGroupPopoverStyles_unstable = exports.renderAvatarGroupPopover_unstable = exports.avatarGroupPopoverClassNames = exports.AvatarGroupPopover = exports.useAvatarGroupItem_unstable = exports.useAvatarGroupItemStyles_unstable = exports.renderAvatarGroupItem_unstable = exports.avatarGroupItemClassNames = exports.AvatarGroupItem = exports.useAvatarGroup_unstable = exports.useAvatarGroupStyles_unstable = exports.useAvatarGroupContextValues = exports.renderAvatarGroup_unstable = exports.avatarGroupClassNames = exports.AvatarGroup = exports.partitionAvatarGroupItems = exports.getInitials = exports.useAvatar_unstable = exports.useAvatarStyles_unstable = exports.renderAvatar_unstable = exports.avatarClassNames = exports.Avatar = void 0;
5
+ Object.defineProperty(exports, "Avatar", { enumerable: true, get: function () { return Avatar_1.Avatar; } });
6
+ Object.defineProperty(exports, "avatarClassNames", { enumerable: true, get: function () { return Avatar_1.avatarClassNames; } });
7
+ Object.defineProperty(exports, "renderAvatar_unstable", { enumerable: true, get: function () { return Avatar_1.renderAvatar_unstable; } });
8
+ Object.defineProperty(exports, "useAvatarStyles_unstable", { enumerable: true, get: function () { return Avatar_1.useAvatarStyles_unstable; } });
9
+ Object.defineProperty(exports, "useAvatar_unstable", { enumerable: true, get: function () { return Avatar_1.useAvatar_unstable; } });
10
+ Object.defineProperty(exports, "getInitials", { enumerable: true, get: function () { return index_1.getInitials; } });
11
+ Object.defineProperty(exports, "partitionAvatarGroupItems", { enumerable: true, get: function () { return index_1.partitionAvatarGroupItems; } });
12
+ Object.defineProperty(exports, "AvatarGroup", { enumerable: true, get: function () { return AvatarGroup_1.AvatarGroup; } });
13
+ Object.defineProperty(exports, "avatarGroupClassNames", { enumerable: true, get: function () { return AvatarGroup_1.avatarGroupClassNames; } });
14
+ Object.defineProperty(exports, "renderAvatarGroup_unstable", { enumerable: true, get: function () { return AvatarGroup_1.renderAvatarGroup_unstable; } });
15
+ Object.defineProperty(exports, "useAvatarGroupContextValues", { enumerable: true, get: function () { return AvatarGroup_1.useAvatarGroupContextValues; } });
16
+ Object.defineProperty(exports, "useAvatarGroupStyles_unstable", { enumerable: true, get: function () { return AvatarGroup_1.useAvatarGroupStyles_unstable; } });
17
+ Object.defineProperty(exports, "useAvatarGroup_unstable", { enumerable: true, get: function () { return AvatarGroup_1.useAvatarGroup_unstable; } });
18
+ Object.defineProperty(exports, "AvatarGroupItem", { enumerable: true, get: function () { return AvatarGroupItem_1.AvatarGroupItem; } });
19
+ Object.defineProperty(exports, "avatarGroupItemClassNames", { enumerable: true, get: function () { return AvatarGroupItem_1.avatarGroupItemClassNames; } });
20
+ Object.defineProperty(exports, "renderAvatarGroupItem_unstable", { enumerable: true, get: function () { return AvatarGroupItem_1.renderAvatarGroupItem_unstable; } });
21
+ Object.defineProperty(exports, "useAvatarGroupItemStyles_unstable", { enumerable: true, get: function () { return AvatarGroupItem_1.useAvatarGroupItemStyles_unstable; } });
22
+ Object.defineProperty(exports, "useAvatarGroupItem_unstable", { enumerable: true, get: function () { return AvatarGroupItem_1.useAvatarGroupItem_unstable; } });
23
+ Object.defineProperty(exports, "AvatarGroupPopover", { enumerable: true, get: function () { return AvatarGroupPopover_1.AvatarGroupPopover; } });
24
+ Object.defineProperty(exports, "avatarGroupPopoverClassNames", { enumerable: true, get: function () { return AvatarGroupPopover_1.avatarGroupPopoverClassNames; } });
25
+ Object.defineProperty(exports, "renderAvatarGroupPopover_unstable", { enumerable: true, get: function () { return AvatarGroupPopover_1.renderAvatarGroupPopover_unstable; } });
26
+ Object.defineProperty(exports, "useAvatarGroupPopoverStyles_unstable", { enumerable: true, get: function () { return AvatarGroupPopover_1.useAvatarGroupPopoverStyles_unstable; } });
27
+ Object.defineProperty(exports, "useAvatarGroupPopover_unstable", { enumerable: true, get: function () { return AvatarGroupPopover_1.useAvatarGroupPopover_unstable; } });
28
+ Object.defineProperty(exports, "AvatarContextProvider", { enumerable: true, get: function () { return index_2.AvatarContextProvider; } });
29
+ Object.defineProperty(exports, "AvatarGroupProvider", { enumerable: true, get: function () { return index_2.AvatarGroupProvider; } });
30
+ Object.defineProperty(exports, "useAvatarContext", { enumerable: true, get: function () { return index_2.useAvatarContext; } });
31
+ Object.defineProperty(exports, "useAvatarGroupContext_unstable", { enumerable: true, get: function () { return index_2.useAvatarGroupContext_unstable; } });
32
+ });
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-avatar/src/index.ts"],"names":[],"mappings":";;;;IACE,gGAAA,MAAM,OAAA;IACN,0GAAA,gBAAgB,OAAA;IAChB,+GAAA,qBAAqB,OAAA;IACrB,kHAAA,wBAAwB,OAAA;IACxB,4GAAA,kBAAkB,OAAA;IAGX,oGAAA,WAAW,OAAA;IAAE,kHAAA,yBAAyB,OAAA;IAG7C,0GAAA,WAAW,OAAA;IACX,oHAAA,qBAAqB,OAAA;IACrB,yHAAA,0BAA0B,OAAA;IAC1B,0HAAA,2BAA2B,OAAA;IAC3B,4HAAA,6BAA6B,OAAA;IAC7B,sHAAA,uBAAuB,OAAA;IAUvB,kHAAA,eAAe,OAAA;IACf,4HAAA,yBAAyB,OAAA;IACzB,iIAAA,8BAA8B,OAAA;IAC9B,oIAAA,iCAAiC,OAAA;IACjC,8HAAA,2BAA2B,OAAA;IAI3B,wHAAA,kBAAkB,OAAA;IAClB,kIAAA,4BAA4B,OAAA;IAC5B,uIAAA,iCAAiC,OAAA;IACjC,0IAAA,oCAAoC,OAAA;IACpC,oIAAA,8BAA8B,OAAA;IAI9B,8GAAA,qBAAqB,OAAA;IACrB,4GAAA,mBAAmB,OAAA;IACnB,yGAAA,gBAAgB,OAAA;IAChB,uHAAA,8BAA8B,OAAA","sourcesContent":["export {\n Avatar,\n avatarClassNames,\n renderAvatar_unstable,\n useAvatarStyles_unstable,\n useAvatar_unstable,\n} from './Avatar';\nexport type { AvatarNamedColor, AvatarProps, AvatarSlots, AvatarState, AvatarSizes } from './Avatar';\nexport { getInitials, partitionAvatarGroupItems } from './utils/index';\nexport type { PartitionAvatarGroupItems, PartitionAvatarGroupItemsOptions } from './utils/index';\nexport {\n AvatarGroup,\n avatarGroupClassNames,\n renderAvatarGroup_unstable,\n useAvatarGroupContextValues,\n useAvatarGroupStyles_unstable,\n useAvatarGroup_unstable,\n} from './AvatarGroup';\nexport type {\n AvatarGroupProps,\n AvatarGroupSlots,\n AvatarGroupState,\n AvatarGroupContextValue,\n AvatarGroupContextValues,\n} from './AvatarGroup';\nexport {\n AvatarGroupItem,\n avatarGroupItemClassNames,\n renderAvatarGroupItem_unstable,\n useAvatarGroupItemStyles_unstable,\n useAvatarGroupItem_unstable,\n} from './AvatarGroupItem';\nexport type { AvatarGroupItemProps, AvatarGroupItemSlots, AvatarGroupItemState } from './AvatarGroupItem';\nexport {\n AvatarGroupPopover,\n avatarGroupPopoverClassNames,\n renderAvatarGroupPopover_unstable,\n useAvatarGroupPopoverStyles_unstable,\n useAvatarGroupPopover_unstable,\n} from './AvatarGroupPopover';\nexport type { AvatarGroupPopoverProps, AvatarGroupPopoverSlots, AvatarGroupPopoverState } from './AvatarGroupPopover';\nexport {\n AvatarContextProvider,\n AvatarGroupProvider,\n useAvatarContext,\n useAvatarGroupContext_unstable,\n} from './contexts/index';\nexport type { AvatarContextValue } from './contexts/index';\n"]}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Regular expressions matching characters to ignore when calculating the initials.
3
+ */
4
+ define(["require", "exports"], function (require, exports) {
5
+ "use strict";
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.getInitials = void 0;
8
+ /**
9
+ * Regular expression matching characters within various types of enclosures, including the enclosures themselves
10
+ * so for example, (xyz) [xyz] {xyz} all would be ignored
11
+ */
12
+ var UNWANTED_ENCLOSURES_REGEX = /[\(\[\{][^\)\]\}]*[\)\]\}]/g;
13
+ /**
14
+ * Regular expression matching special ASCII characters except space, plus some unicode special characters.
15
+ * Applies after unwanted enclosures have been removed
16
+ */
17
+ var UNWANTED_CHARS_REGEX = /[\0-\u001F\!-/:-@\[-`\{-\u00BF\u0250-\u036F\uD800-\uFFFF]/g;
18
+ /**
19
+ * Regular expression matching phone numbers. Applied after chars matching UNWANTED_CHARS_REGEX have been removed
20
+ * and number has been trimmed for whitespaces
21
+ */
22
+ var PHONENUMBER_REGEX = /^\d+[\d\s]*(:?ext|x|)\s*\d+$/i;
23
+ /** Regular expression matching one or more spaces. */
24
+ var MULTIPLE_WHITESPACES_REGEX = /\s+/g;
25
+ /**
26
+ * Regular expression matching languages for which we currently don't support initials.
27
+ * Arabic: Arabic, Arabic Supplement, Arabic Extended-A.
28
+ * Korean: Hangul Jamo, Hangul Compatibility Jamo, Hangul Jamo Extended-A, Hangul Syllables, Hangul Jamo Extended-B.
29
+ * Japanese: Hiragana, Katakana.
30
+ * CJK: CJK Unified Ideographs Extension A, CJK Unified Ideographs, CJK Compatibility Ideographs,
31
+ * CJK Unified Ideographs Extension B
32
+ */
33
+ // eslint-disable-next-line @fluentui/max-len
34
+ var UNSUPPORTED_TEXT_REGEX = /[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\u1100-\u11FF\u3130-\u318F\uA960-\uA97F\uAC00-\uD7AF\uD7B0-\uD7FF\u3040-\u309F\u30A0-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFAFF]|[\uD840-\uD869][\uDC00-\uDED6]/;
35
+ function getInitialsLatin(displayName, isRtl, firstInitialOnly) {
36
+ var initials = '';
37
+ var splits = displayName.split(' ');
38
+ if (splits.length !== 0) {
39
+ initials += splits[0].charAt(0).toUpperCase();
40
+ }
41
+ if (!firstInitialOnly) {
42
+ if (splits.length === 2) {
43
+ initials += splits[1].charAt(0).toUpperCase();
44
+ }
45
+ else if (splits.length === 3) {
46
+ initials += splits[2].charAt(0).toUpperCase();
47
+ }
48
+ }
49
+ if (isRtl && initials.length > 1) {
50
+ return initials.charAt(1) + initials.charAt(0);
51
+ }
52
+ return initials;
53
+ }
54
+ function cleanupDisplayName(displayName) {
55
+ displayName = displayName.replace(UNWANTED_ENCLOSURES_REGEX, '');
56
+ displayName = displayName.replace(UNWANTED_CHARS_REGEX, '');
57
+ displayName = displayName.replace(MULTIPLE_WHITESPACES_REGEX, ' ');
58
+ displayName = displayName.trim();
59
+ return displayName;
60
+ }
61
+ /**
62
+ * Get (up to 2 characters) initials based on display name of the persona.
63
+ *
64
+ * @param displayName - The full name of the person or entity
65
+ * @param isRtl - Whether the display is in RTL
66
+ * @param options - Extra options to control the behavior of getInitials
67
+ *
68
+ * @returns The 1 or 2 character initials based on the name. Or an empty string if no initials
69
+ * could be derived from the name.
70
+ *
71
+ * @internal
72
+ */
73
+ function getInitials(displayName, isRtl, options) {
74
+ if (!displayName) {
75
+ return '';
76
+ }
77
+ displayName = cleanupDisplayName(displayName);
78
+ // For names containing CJK characters, and phone numbers, we don't display initials
79
+ if (UNSUPPORTED_TEXT_REGEX.test(displayName) ||
80
+ (!(options === null || options === void 0 ? void 0 : options.allowPhoneInitials) && PHONENUMBER_REGEX.test(displayName))) {
81
+ return '';
82
+ }
83
+ return getInitialsLatin(displayName, isRtl, options === null || options === void 0 ? void 0 : options.firstInitialOnly);
84
+ }
85
+ exports.getInitials = getInitials;
86
+ });
87
+ //# sourceMappingURL=getInitials.js.map