@fluentui/react-avatar 9.2.6 → 9.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/CHANGELOG.json +105 -1
  2. package/CHANGELOG.md +31 -2
  3. package/dist/index.d.ts +35 -4
  4. package/lib/components/AvatarGroupItem/useAvatarGroupItemStyles.js +18 -1
  5. package/lib/components/AvatarGroupItem/useAvatarGroupItemStyles.js.map +1 -1
  6. package/lib-amd/Avatar.js +6 -0
  7. package/lib-amd/Avatar.js.map +1 -0
  8. package/lib-amd/AvatarGroup.js +6 -0
  9. package/lib-amd/AvatarGroup.js.map +1 -0
  10. package/lib-amd/AvatarGroupItem.js +6 -0
  11. package/lib-amd/AvatarGroupItem.js.map +1 -0
  12. package/lib-amd/AvatarGroupPopover.js +6 -0
  13. package/lib-amd/AvatarGroupPopover.js.map +1 -0
  14. package/lib-amd/components/Avatar/Avatar.js +12 -0
  15. package/lib-amd/components/Avatar/Avatar.js.map +1 -0
  16. package/lib-amd/components/Avatar/Avatar.types.js +5 -0
  17. package/lib-amd/components/Avatar/Avatar.types.js.map +1 -0
  18. package/lib-amd/components/Avatar/index.js +10 -0
  19. package/lib-amd/components/Avatar/index.js.map +1 -0
  20. package/lib-amd/components/Avatar/renderAvatar.js +16 -0
  21. package/lib-amd/components/Avatar/renderAvatar.js.map +1 -0
  22. package/lib-amd/components/Avatar/useAvatar.js +175 -0
  23. package/lib-amd/components/Avatar/useAvatar.js.map +1 -0
  24. package/lib-amd/components/Avatar/useAvatarStyles.js +390 -0
  25. package/lib-amd/components/Avatar/useAvatarStyles.js.map +1 -0
  26. package/lib-amd/components/AvatarGroup/AvatarGroup.js +17 -0
  27. package/lib-amd/components/AvatarGroup/AvatarGroup.js.map +1 -0
  28. package/lib-amd/components/AvatarGroup/AvatarGroup.types.js +5 -0
  29. package/lib-amd/components/AvatarGroup/AvatarGroup.types.js.map +1 -0
  30. package/lib-amd/components/AvatarGroup/index.js +11 -0
  31. package/lib-amd/components/AvatarGroup/index.js.map +1 -0
  32. package/lib-amd/components/AvatarGroup/renderAvatarGroup.js +15 -0
  33. package/lib-amd/components/AvatarGroup/renderAvatarGroup.js.map +1 -0
  34. package/lib-amd/components/AvatarGroup/useAvatarGroup.js +29 -0
  35. package/lib-amd/components/AvatarGroup/useAvatarGroup.js.map +1 -0
  36. package/lib-amd/components/AvatarGroup/useAvatarGroupContextValues.js +15 -0
  37. package/lib-amd/components/AvatarGroup/useAvatarGroupContextValues.js.map +1 -0
  38. package/lib-amd/components/AvatarGroup/useAvatarGroupStyles.js +36 -0
  39. package/lib-amd/components/AvatarGroup/useAvatarGroupStyles.js.map +1 -0
  40. package/lib-amd/components/AvatarGroupItem/AvatarGroupItem.js +16 -0
  41. package/lib-amd/components/AvatarGroupItem/AvatarGroupItem.js.map +1 -0
  42. package/lib-amd/components/AvatarGroupItem/AvatarGroupItem.types.js +5 -0
  43. package/lib-amd/components/AvatarGroupItem/AvatarGroupItem.types.js.map +1 -0
  44. package/lib-amd/components/AvatarGroupItem/index.js +10 -0
  45. package/lib-amd/components/AvatarGroupItem/index.js.map +1 -0
  46. package/lib-amd/components/AvatarGroupItem/renderAvatarGroupItem.js +16 -0
  47. package/lib-amd/components/AvatarGroupItem/renderAvatarGroupItem.js.map +1 -0
  48. package/lib-amd/components/AvatarGroupItem/useAvatarGroupItem.js +58 -0
  49. package/lib-amd/components/AvatarGroupItem/useAvatarGroupItem.js.map +1 -0
  50. package/lib-amd/components/AvatarGroupItem/useAvatarGroupItemStyles.js +236 -0
  51. package/lib-amd/components/AvatarGroupItem/useAvatarGroupItemStyles.js.map +1 -0
  52. package/lib-amd/components/AvatarGroupPopover/AvatarGroupPopover.js +17 -0
  53. package/lib-amd/components/AvatarGroupPopover/AvatarGroupPopover.js.map +1 -0
  54. package/lib-amd/components/AvatarGroupPopover/AvatarGroupPopover.types.js +5 -0
  55. package/lib-amd/components/AvatarGroupPopover/AvatarGroupPopover.types.js.map +1 -0
  56. package/lib-amd/components/AvatarGroupPopover/index.js +10 -0
  57. package/lib-amd/components/AvatarGroupPopover/index.js.map +1 -0
  58. package/lib-amd/components/AvatarGroupPopover/renderAvatarGroupPopover.js +20 -0
  59. package/lib-amd/components/AvatarGroupPopover/renderAvatarGroupPopover.js.map +1 -0
  60. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopover.js +86 -0
  61. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopover.js.map +1 -0
  62. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js +14 -0
  63. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js.map +1 -0
  64. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.js +136 -0
  65. package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.js.map +1 -0
  66. package/lib-amd/contexts/AvatarContext.js +17 -0
  67. package/lib-amd/contexts/AvatarContext.js.map +1 -0
  68. package/lib-amd/contexts/AvatarGroupContext.js +20 -0
  69. package/lib-amd/contexts/AvatarGroupContext.js.map +1 -0
  70. package/lib-amd/contexts/index.js +7 -0
  71. package/lib-amd/contexts/index.js.map +1 -0
  72. package/lib-amd/index.js +33 -0
  73. package/lib-amd/index.js.map +1 -0
  74. package/lib-amd/utils/getInitials.js +87 -0
  75. package/lib-amd/utils/getInitials.js.map +1 -0
  76. package/lib-amd/utils/index.js +8 -0
  77. package/lib-amd/utils/index.js.map +1 -0
  78. package/lib-amd/utils/partitionAvatarGroupItems.js +32 -0
  79. package/lib-amd/utils/partitionAvatarGroupItems.js.map +1 -0
  80. package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItemStyles.js +19 -1
  81. package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItemStyles.js.map +1 -1
  82. package/package.json +9 -9
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAvatarGroupPopoverStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react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yles, 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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getInitials.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-avatar/src/utils/getInitials.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;IAEH;;;OAGG;IACH,IAAM,yBAAyB,GAAW,6BAA6B,CAAC;IAExE;;;OAGG;IACH,IAAM,oBAAoB,GAAW,4DAA4D,CAAC;IAElG;;;OAGG;IACH,IAAM,iBAAiB,GAAW,+BAA+B,CAAC;IAElE,sDAAsD;IACtD,IAAM,0BAA0B,GAAW,MAAM,CAAC;IAElD;;;;;;;OAOG;IACH,6CAA6C;IAC7C,IAAM,sBAAsB,GAAW,4MAA4M,CAAC;IAEpP,SAAS,gBAAgB,CAAC,WAAmB,EAAE,KAAc,EAAE,gBAA0B;QACvF,IAAI,QAAQ,GA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YAChB,OAAO,EAAE,CAAC;SACX;QAED,WAAW,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC;QAE9C,oFAAoF;QACpF,IACE,sBAAsB,CAAC,IAAI,CAAC,WAAW,CAAC;YACxC,CAAC,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,kBAAkB,CAAA,IAAI,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,EACrE;YACA,OAAO,EAAE,CAAC;SACX;QAED,OAAO,gBAAgB,CAAC,WAAW,EAAE,KAAK,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,gBAAgB,CAAC,CAAC;IACzE,CAAC;IA1BD,kCA0BC","sourcesContent":["/**\n * Regular expressions matching characters to ignore when calculating the initials.\n */\n\n/**\n * Regular expression matching characters within various types of enclosures, including the enclosures themselves\n * so for example, (xyz) [xyz] {xyz} all would be ignored\n */\nconst UNWANTED_ENCLOSURES_REGEX: RegExp = /[\\(\\[\\{][^\\)\\]\\}]*[\\)\\]\\}]/g;\n\n/**\n * Regular expression matching special ASCII characters except space, plus some unicode special characters.\n * Applies after unwanted enclosures have been removed\n */\nconst UNWANTED_CHARS_REGEX: RegExp = /[\\0-\\u001F\\!-/:-@\\[-`\\{-\\u00BF\\u0250-\\u036F\\uD800-\\uFFFF]/g;\n\n/**\n * Regular expression matching phone numbers. Applied after chars matching UNWANTED_CHARS_REGEX have been removed\n * and number has been trimmed for whitespaces\n */\nconst PHONENUMBER_REGEX: RegExp = /^\\d+[\\d\\s]*(:?ext|x|)\\s*\\d+$/i;\n\n/** Regular expression matching one or more spaces. */\nconst MULTIPLE_WHITESPACES_REGEX: RegExp = /\\s+/g;\n\n/**\n * Regular expression matching languages for which we currently don't support initials.\n * Arabic: Arabic, Arabic Supplement, Arabic Extended-A.\n * Korean: Hangul Jamo, Hangul Compatibility Jamo, Hangul Jamo Extended-A, Hangul Syllables, Hangul Jamo Extended-B.\n * Japanese: Hiragana, Katakana.\n * CJK: CJK Unified Ideographs Extension A, CJK Unified Ideographs, CJK Compatibility Ideographs,\n * CJK Unified Ideographs Extension B\n */\n// eslint-disable-next-line @fluentui/max-len\nconst UNSUPPORTED_TEXT_REGEX: RegExp = /[\\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]/;\n\nfunction getInitialsLatin(displayName: string, isRtl: boolean, firstInitialOnly?: boolean): string {\n let initials = '';\n\n const splits: string[] = displayName.split(' ');\n if (splits.length !== 0) {\n initials += splits[0].charAt(0).toUpperCase();\n }\n\n if (!firstInitialOnly) {\n if (splits.length === 2) {\n initials += splits[1].charAt(0).toUpperCase();\n } else if (splits.length === 3) {\n initials += splits[2].charAt(0).toUpperCase();\n }\n }\n\n if (isRtl && initials.length > 1) {\n return initials.charAt(1) + initials.charAt(0);\n }\n\n return initials;\n}\n\nfunction cleanupDisplayName(displayName: string): string {\n displayName = displayName.replace(UNWANTED_ENCLOSURES_REGEX, '');\n displayName = displayName.replace(UNWANTED_CHARS_REGEX, '');\n displayName = displayName.replace(MULTIPLE_WHITESPACES_REGEX, ' ');\n displayName = displayName.trim();\n\n return displayName;\n}\n\n/**\n * Get (up to 2 characters) initials based on display name of the persona.\n *\n * @param displayName - The full name of the person or entity\n * @param isRtl - Whether the display is in RTL\n * @param options - Extra options to control the behavior of getInitials\n *\n * @returns The 1 or 2 character initials based on the name. Or an empty string if no initials\n * could be derived from the name.\n *\n * @internal\n */\nexport function getInitials(\n displayName: string | undefined | null,\n isRtl: boolean,\n options?: {\n /** Should initials be generated from phone numbers (default false) */\n allowPhoneInitials?: boolean;\n\n /** Returns only the first initial */\n firstInitialOnly?: boolean;\n },\n): string {\n if (!displayName) {\n return '';\n }\n\n displayName = cleanupDisplayName(displayName);\n\n // For names containing CJK characters, and phone numbers, we don't display initials\n if (\n UNSUPPORTED_TEXT_REGEX.test(displayName) ||\n (!options?.allowPhoneInitials && PHONENUMBER_REGEX.test(displayName))\n ) {\n return '';\n }\n\n return getInitialsLatin(displayName, isRtl, options?.firstInitialOnly);\n}\n"]}
@@ -0,0 +1,8 @@
1
+ define(["require", "exports", "./getInitials", "./partitionAvatarGroupItems"], function (require, exports, getInitials_1, partitionAvatarGroupItems_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.partitionAvatarGroupItems = exports.getInitials = void 0;
5
+ Object.defineProperty(exports, "getInitials", { enumerable: true, get: function () { return getInitials_1.getInitials; } });
6
+ Object.defineProperty(exports, "partitionAvatarGroupItems", { enumerable: true, get: function () { return partitionAvatarGroupItems_1.partitionAvatarGroupItems; } });
7
+ });
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-avatar/src/utils/index.ts"],"names":[],"mappings":";;;;IAAS,0GAAA,WAAW,OAAA;IACX,sIAAA,yBAAyB,OAAA","sourcesContent":["export { getInitials } from './getInitials';\nexport { partitionAvatarGroupItems } from './partitionAvatarGroupItems';\nexport type { PartitionAvatarGroupItems, PartitionAvatarGroupItemsOptions } from './partitionAvatarGroupItems';\n"]}
@@ -0,0 +1,32 @@
1
+ define(["require", "exports"], function (require, exports) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.partitionAvatarGroupItems = void 0;
5
+ /**
6
+ * Get the inline items and overflowing items based on the array of AvatarGroupItems needed for AvatarGroup.
7
+ *
8
+ * @param options - Configure the partition options
9
+ *
10
+ * @returns Two arrays split into inline items and overflow items based on maxInlineItems.
11
+ */
12
+ var partitionAvatarGroupItems = function (options) {
13
+ var _a;
14
+ var items = options.items;
15
+ var isPie = options.layout === 'pie';
16
+ if (isPie) {
17
+ return {
18
+ inlineItems: items.slice(0, 3),
19
+ overflowItems: items.length > 0 ? items : undefined,
20
+ };
21
+ }
22
+ var maxInlineItems = (_a = options.maxInlineItems) !== null && _a !== void 0 ? _a : 5;
23
+ var inlineCount = -(maxInlineItems - (items.length > maxInlineItems ? 1 : 0));
24
+ var overflowItems = items.slice(0, inlineCount);
25
+ return {
26
+ inlineItems: items.slice(inlineCount),
27
+ overflowItems: overflowItems.length > 0 ? overflowItems : undefined,
28
+ };
29
+ };
30
+ exports.partitionAvatarGroupItems = partitionAvatarGroupItems;
31
+ });
32
+ //# sourceMappingURL=partitionAvatarGroupItems.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"partitionAvatarGroupItems.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-avatar/src/utils/partitionAvatarGroupItems.ts"],"names":[],"mappings":";;;;IAWA;;;;;;OAMG;IACI,IAAM,yBAAyB,GAAG,UACvC,OAA4C;;QAEpC,IAAA,KAAK,GAAK,OAAO,MAAZ,CAAa;QAC1B,IAAM,KAAK,GAAG,OAAO,CAAC,MAAM,KAAK,KAAK,CAAC;QAEvC,IAAI,KAAK,EAAE;YACT,OAAO;gBACL,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;gBAC9B,aAAa,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;aACpD,CAAC;SACH;QAED,IAAM,cAAc,GAAG,MAAA,OAAO,CAAC,cAAc,mCAAI,CAAC,CAAC;QACnD,IAAM,WAAW,GAAG,CAAC,CAAC,cAAc,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAChF,IAAM,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;QAElD,OAAO;YACL,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC;YACrC,aAAa,EAAE,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS;SACpE,CAAC;IACJ,CAAC,CAAC;IArBW,QAAA,yBAAyB,6BAqBpC","sourcesContent":["export type PartitionAvatarGroupItemsOptions<T> = {\n items: readonly T[];\n layout?: 'spread' | 'stack' | 'pie';\n maxInlineItems?: number;\n};\n\nexport type PartitionAvatarGroupItems<T> = {\n inlineItems: readonly T[];\n overflowItems?: readonly T[];\n};\n\n/**\n * Get the inline items and overflowing items based on the array of AvatarGroupItems needed for AvatarGroup.\n *\n * @param options - Configure the partition options\n *\n * @returns Two arrays split into inline items and overflow items based on maxInlineItems.\n */\nexport const partitionAvatarGroupItems = <T>(\n options: PartitionAvatarGroupItemsOptions<T>,\n): PartitionAvatarGroupItems<T> => {\n const { items } = options;\n const isPie = options.layout === 'pie';\n\n if (isPie) {\n return {\n inlineItems: items.slice(0, 3),\n overflowItems: items.length > 0 ? items : undefined,\n };\n }\n\n const maxInlineItems = options.maxInlineItems ?? 5;\n const inlineCount = -(maxInlineItems - (items.length > maxInlineItems ? 1 : 0));\n const overflowItems = items.slice(0, inlineCount);\n\n return {\n inlineItems: items.slice(inlineCount),\n overflowItems: overflowItems.length > 0 ? overflowItems : undefined,\n };\n};\n"]}
@@ -11,6 +11,8 @@ const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
11
11
 
12
12
  const Avatar_1 = /*#__PURE__*/require("../../Avatar");
13
13
 
14
+ const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
15
+
14
16
  exports.avatarGroupItemClassNames = {
15
17
  root: 'fui-AvatarGroupItem',
16
18
  avatar: 'fui-AvatarGroupItem__avatar',
@@ -158,6 +160,15 @@ const usePieStyles = /*#__PURE__*/react_1.__styles({
158
160
  "Bhe5x6o": "fchq2fj",
159
161
  "B3kv7bh": "ff5binh"
160
162
  },
163
+ "rtlSlices": {
164
+ "B3gf25r": "f5vdl61",
165
+ "Bvaow4n": "f1bnra92",
166
+ "bhabj1": "f4ibo7t",
167
+ "Bwrfys5": "f17heuis",
168
+ "Bwuzm9m": ["f64f2ud", "f1yjglu3"],
169
+ "Be8zqhl": "fa6l61x",
170
+ "Bij0kh0": ["f1w2396a", "f14ab3yo"]
171
+ },
161
172
  "thick": {
162
173
  "uiicq7": "fnyfzln"
163
174
  },
@@ -168,7 +179,7 @@ const usePieStyles = /*#__PURE__*/react_1.__styles({
168
179
  "uiicq7": "f1auhru5"
169
180
  }
170
181
  }, {
171
- "d": [".f1euv43f{position:absolute;}", ".f16m7w7k:nth-of-type(1):nth-last-of-type(2){-webkit-clip-path:inset(0 calc(25% + (var(--fuiAvatarGroupItem__divider--width) / 2)) 0 25%);clip-path:inset(0 calc(25% + (var(--fuiAvatarGroupItem__divider--width) / 2)) 0 25%);}", ".f1o4hhgz:nth-of-type(1):nth-last-of-type(2){left:-25%;}", ".fb4gjrz:nth-of-type(1):nth-last-of-type(2){right:-25%;}", ".f1pgb5nx:nth-of-type(2):nth-last-of-type(1){-webkit-clip-path:inset(0 25% 0 calc(25% + (var(--fuiAvatarGroupItem__divider--width) / 2)));clip-path:inset(0 25% 0 calc(25% + (var(--fuiAvatarGroupItem__divider--width) / 2)));}", ".fugirid:nth-of-type(2):nth-last-of-type(1){left:25%;}", ".f4sk99m:nth-of-type(2):nth-last-of-type(1){right:25%;}", ".fjreaf3:nth-of-type(1):nth-last-of-type(3){-webkit-clip-path:inset(0 calc(25% + (var(--fuiAvatarGroupItem__divider--width) / 2)) 0 25%);clip-path:inset(0 calc(25% + (var(--fuiAvatarGroupItem__divider--width) / 2)) 0 25%);}", ".f1k4vw81:nth-of-type(1):nth-last-of-type(3){left:-25%;}", ".f1w1xcy7:nth-of-type(1):nth-last-of-type(3){right:-25%;}", ".f1ef8vxk:nth-of-type(2):nth-last-of-type(2){-webkit-clip-path:inset(0 0 var(--fuiAvatarGroupItem__divider--width) var(--fuiAvatarGroupItem__divider--width));clip-path:inset(0 0 var(--fuiAvatarGroupItem__divider--width) var(--fuiAvatarGroupItem__divider--width));}", ".f1x2qbfv:nth-of-type(2):nth-last-of-type(2){left:50%;}", ".f1xwf4nz:nth-of-type(2):nth-last-of-type(2){right:50%;}", ".ff6xuso:nth-of-type(2):nth-last-of-type(2){-webkit-transform:scale(0.5);-moz-transform:scale(0.5);-ms-transform:scale(0.5);transform:scale(0.5);}", ".fzpvk6c:nth-of-type(2):nth-last-of-type(2){transform-origin:0 0;}", ".f4onu7f:nth-of-type(3):nth-last-of-type(1){-webkit-clip-path:inset(var(--fuiAvatarGroupItem__divider--width) 0 0 var(--fuiAvatarGroupItem__divider--width));clip-path:inset(var(--fuiAvatarGroupItem__divider--width) 0 0 var(--fuiAvatarGroupItem__divider--width));}", ".f1ydfez1:nth-of-type(3):nth-last-of-type(1){left:50%;}", ".fjensob:nth-of-type(3):nth-last-of-type(1){right:50%;}", ".f1yv732j:nth-of-type(3):nth-last-of-type(1){top:50%;}", ".fchq2fj:nth-of-type(3):nth-last-of-type(1){-webkit-transform:scale(0.5);-moz-transform:scale(0.5);-ms-transform:scale(0.5);transform:scale(0.5);}", ".ff5binh:nth-of-type(3):nth-last-of-type(1){transform-origin:0 0;}", ".fnyfzln{--fuiAvatarGroupItem__divider--width:var(--strokeWidthThick);}", ".f1xdzzot{--fuiAvatarGroupItem__divider--width:var(--strokeWidthThicker);}", ".f1auhru5{--fuiAvatarGroupItem__divider--width:var(--strokeWidthThickest);}"]
182
+ "d": [".f1euv43f{position:absolute;}", ".f16m7w7k:nth-of-type(1):nth-last-of-type(2){-webkit-clip-path:inset(0 calc(25% + (var(--fuiAvatarGroupItem__divider--width) / 2)) 0 25%);clip-path:inset(0 calc(25% + (var(--fuiAvatarGroupItem__divider--width) / 2)) 0 25%);}", ".f1o4hhgz:nth-of-type(1):nth-last-of-type(2){left:-25%;}", ".fb4gjrz:nth-of-type(1):nth-last-of-type(2){right:-25%;}", ".f1pgb5nx:nth-of-type(2):nth-last-of-type(1){-webkit-clip-path:inset(0 25% 0 calc(25% + (var(--fuiAvatarGroupItem__divider--width) / 2)));clip-path:inset(0 25% 0 calc(25% + (var(--fuiAvatarGroupItem__divider--width) / 2)));}", ".fugirid:nth-of-type(2):nth-last-of-type(1){left:25%;}", ".f4sk99m:nth-of-type(2):nth-last-of-type(1){right:25%;}", ".fjreaf3:nth-of-type(1):nth-last-of-type(3){-webkit-clip-path:inset(0 calc(25% + (var(--fuiAvatarGroupItem__divider--width) / 2)) 0 25%);clip-path:inset(0 calc(25% + (var(--fuiAvatarGroupItem__divider--width) / 2)) 0 25%);}", ".f1k4vw81:nth-of-type(1):nth-last-of-type(3){left:-25%;}", ".f1w1xcy7:nth-of-type(1):nth-last-of-type(3){right:-25%;}", ".f1ef8vxk:nth-of-type(2):nth-last-of-type(2){-webkit-clip-path:inset(0 0 var(--fuiAvatarGroupItem__divider--width) var(--fuiAvatarGroupItem__divider--width));clip-path:inset(0 0 var(--fuiAvatarGroupItem__divider--width) var(--fuiAvatarGroupItem__divider--width));}", ".f1x2qbfv:nth-of-type(2):nth-last-of-type(2){left:50%;}", ".f1xwf4nz:nth-of-type(2):nth-last-of-type(2){right:50%;}", ".ff6xuso:nth-of-type(2):nth-last-of-type(2){-webkit-transform:scale(0.5);-moz-transform:scale(0.5);-ms-transform:scale(0.5);transform:scale(0.5);}", ".fzpvk6c:nth-of-type(2):nth-last-of-type(2){transform-origin:0 0;}", ".f4onu7f:nth-of-type(3):nth-last-of-type(1){-webkit-clip-path:inset(var(--fuiAvatarGroupItem__divider--width) 0 0 var(--fuiAvatarGroupItem__divider--width));clip-path:inset(var(--fuiAvatarGroupItem__divider--width) 0 0 var(--fuiAvatarGroupItem__divider--width));}", ".f1ydfez1:nth-of-type(3):nth-last-of-type(1){left:50%;}", ".fjensob:nth-of-type(3):nth-last-of-type(1){right:50%;}", ".f1yv732j:nth-of-type(3):nth-last-of-type(1){top:50%;}", ".fchq2fj:nth-of-type(3):nth-last-of-type(1){-webkit-transform:scale(0.5);-moz-transform:scale(0.5);-ms-transform:scale(0.5);transform:scale(0.5);}", ".ff5binh:nth-of-type(3):nth-last-of-type(1){transform-origin:0 0;}", ".f5vdl61:nth-of-type(1):nth-last-of-type(2){-webkit-clip-path:inset(0 25% 0 calc(25% + (var(--fuiAvatarGroupItem__divider--width) / 2)));clip-path:inset(0 25% 0 calc(25% + (var(--fuiAvatarGroupItem__divider--width) / 2)));}", ".f1bnra92:nth-of-type(2):nth-last-of-type(1){-webkit-clip-path:inset(0 calc(25% + (var(--fuiAvatarGroupItem__divider--width) / 2)) 0 25%);clip-path:inset(0 calc(25% + (var(--fuiAvatarGroupItem__divider--width) / 2)) 0 25%);}", ".f4ibo7t:nth-of-type(1):nth-last-of-type(3){-webkit-clip-path:inset(0 25% 0 calc(25% + (var(--fuiAvatarGroupItem__divider--width) / 2)));clip-path:inset(0 25% 0 calc(25% + (var(--fuiAvatarGroupItem__divider--width) / 2)));}", ".f17heuis:nth-of-type(2):nth-last-of-type(2){-webkit-clip-path:inset(0 var(--fuiAvatarGroupItem__divider--width) var(--fuiAvatarGroupItem__divider--width) 0);clip-path:inset(0 var(--fuiAvatarGroupItem__divider--width) var(--fuiAvatarGroupItem__divider--width) 0);}", ".f64f2ud:nth-of-type(2):nth-last-of-type(2){left:0;}", ".f1yjglu3:nth-of-type(2):nth-last-of-type(2){right:0;}", ".fa6l61x:nth-of-type(3):nth-last-of-type(1){-webkit-clip-path:inset(var(--fuiAvatarGroupItem__divider--width) var(--fuiAvatarGroupItem__divider--width) 0 0);clip-path:inset(var(--fuiAvatarGroupItem__divider--width) var(--fuiAvatarGroupItem__divider--width) 0 0);}", ".f1w2396a:nth-of-type(3):nth-last-of-type(1){left:0;}", ".f14ab3yo:nth-of-type(3):nth-last-of-type(1){right:0;}", ".fnyfzln{--fuiAvatarGroupItem__divider--width:var(--strokeWidthThick);}", ".f1xdzzot{--fuiAvatarGroupItem__divider--width:var(--strokeWidthThicker);}", ".f1auhru5{--fuiAvatarGroupItem__divider--width:var(--strokeWidthThickest);}"]
172
183
  });
173
184
  /**
174
185
  * Apply styling to the AvatarGroupItem slots based on the state
@@ -181,6 +192,9 @@ const useAvatarGroupItemStyles_unstable = state => {
181
192
  layout,
182
193
  size
183
194
  } = state;
195
+ const {
196
+ dir
197
+ } = react_shared_contexts_1.useFluent_unstable();
184
198
  const avatarStyles = useAvatarStyles();
185
199
  const overflowLabelStyles = useOverflowLabelStyles();
186
200
  const pieStyles = usePieStyles();
@@ -206,6 +220,10 @@ const useAvatarGroupItemStyles_unstable = state => {
206
220
  }
207
221
 
208
222
  rootClasses.push(pieStyles.slices);
223
+
224
+ if (dir === 'rtl') {
225
+ rootClasses.push(pieStyles.rtlSlices);
226
+ }
209
227
  }
210
228
  } else {
211
229
  rootClasses.push(rootStyles.overflowItem);
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-avatar/src/components/AvatarGroupItem/useAvatarGroupItemStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,QAAA,gBAAA,OAAA,CAAA,cAAA,CAAA;;AAMa,OAAA,CAAA,yBAAA,GAAkE;EAC7E,IAAI,EAAE,qBADuE;EAE7E,MAAM,EAAE,6BAFqE;EAG7E,aAAa,EAAE;AAH8D,CAAlE;AAMb,MAAM,8BAA8B,GAAG,sCAAvC;AAEA;;AAEG;;AACH,MAAM,aAAa,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAtB;AAeA;;AAEG;;;AACH,MAAM,eAAe,gBAAG,OAAA,SAAA;EAAA;IAAA;EAAA;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AAhC;MACD,CAFM,MAEA,IAAI,IAAI,GAAG,EAAX,EAAe;QACpB,aAAa,CAAC,IAAd,CAAmB,YAAY,CAAC,CAAhC;MACD,CAFM,MAEA;QACL,aAAa,CAAC,IAAd,CAAmB,YAAY,CAAC,EAAhC;MACD;IACF;EACF;;EAED,OAAO,OAAA,CAAA,YAAA,CAAa,GAAG,aAAhB,CAAP;AACD,CAtCM;;AAAM,OAAA,CAAA,sBAAA,GAAsB,sBAAtB","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"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-avatar/src/components/AvatarGroupItem/useAvatarGroupItemStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,QAAA,gBAAA,OAAA,CAAA,cAAA,CAAA;;AACA,MAAA,uBAAA,gBAAA,OAAA,CAAA,iCAAA,CAAA;;AAMa,OAAA,CA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AAW,CAAC,QAA/B;MACD;;MAED,IAAI,IAAI,GAAG,EAAX,EAAe;QACb,aAAa,CAAC,IAAd,CAAmB,WAAW,CAAC,GAA/B;MACD,CAFD,MAEO,IAAI,IAAI,GAAG,EAAX,EAAe;QACpB,aAAa,CAAC,IAAd,CAAmB,WAAW,CAAC,EAA/B;MACD,CAFM,MAEA,IAAI,IAAI,GAAG,EAAX,EAAe;QACpB,aAAa,CAAC,IAAd,CAAmB,WAAW,CAAC,CAA/B;MACD,CAFM,MAEA;QACL,aAAa,CAAC,IAAd,CAAmB,WAAW,CAAC,CAA/B;MACD;IACF,CAlBD,MAkBO,IAAI,MAAM,KAAK,QAAf,EAAyB;MAC9B,IAAI,IAAI,GAAG,EAAX,EAAe;QACb,aAAa,CAAC,IAAd,CAAmB,YAAY,CAAC,CAAhC;MACD,CAFD,MAEO,IAAI,IAAI,GAAG,EAAX,EAAe;QACpB,aAAa,CAAC,IAAd,CAAmB,YAAY,CAAC,MAAhC;MACD,CAFM,MAEA,IAAI,IAAI,GAAG,EAAX,EAAe;QACpB,aAAa,CAAC,IAAd,CAAmB,YAAY,CAAC,CAAhC;MACD,CAFM,MAEA;QACL,aAAa,CAAC,IAAd,CAAmB,YAAY,CAAC,EAAhC;MACD;IACF;EACF;;EAED,OAAO,OAAA,CAAA,YAAA,CAAa,GAAG,aAAhB,CAAP;AACD,CAtCM;;AAAM,OAAA,CAAA,sBAAA,GAAsB,sBAAtB","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { useSizeStyles } from '../../Avatar';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport type { AvatarGroupItemSlots, AvatarGroupItemState } from './AvatarGroupItem.types';\nimport type { AvatarGroupProps } from '../../AvatarGroup';\nimport type { AvatarSizes } from '../../Avatar';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const avatarGroupItemClassNames: SlotClassNames<AvatarGroupItemSlots> = {\n root: 'fui-AvatarGroupItem',\n avatar: 'fui-AvatarGroupItem__avatar',\n overflowLabel: 'fui-AvatarGroupItem__overflowLabel',\n};\n\nconst avatarGroupItemDividerWidthVar = '--fuiAvatarGroupItem__divider--width';\n\n/**\n * Styles for the root slot\n */\nconst useRootStyles = makeStyles({\n base: {\n alignItems: 'center',\n display: 'inline-flex',\n flexShrink: 0,\n position: 'relative',\n },\n overflowItem: {\n ...shorthands.padding(tokens.spacingVerticalXS, tokens.spacingHorizontalXS),\n },\n nonOverflowItem: {\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n },\n});\n\n/**\n * Styles for the avatar slot\n */\nconst useAvatarStyles = makeStyles({\n nonOverflowItem: {\n position: 'absolute',\n },\n pie: {\n ...shorthands.borderRadius(0),\n },\n});\n\n/**\n * Styles for the label slot\n */\nconst useOverflowLabelStyles = makeStyles({\n base: {\n marginLeft: tokens.spacingHorizontalS,\n color: tokens.colorNeutralForeground1,\n ...typographyStyles.body1,\n },\n});\n\n/**\n * Styles for the stack layout\n */\nconst useStackStyles = makeStyles({\n thick: {\n boxShadow: `0 0 0 ${tokens.strokeWidthThick} ${tokens.colorNeutralBackground2}`,\n },\n thicker: {\n boxShadow: `0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorNeutralBackground2}`,\n },\n thickest: {\n boxShadow: `0 0 0 ${tokens.strokeWidthThickest} ${tokens.colorNeutralBackground2}`,\n },\n xxs: { '&:not(:first-child)': { marginLeft: `calc(-1 * ${tokens.spacingHorizontalXXS})` } },\n xs: { '&:not(:first-child)': { marginLeft: `calc(-1 * ${tokens.spacingHorizontalXS})` } },\n s: { '&:not(:first-child)': { marginLeft: `calc(-1 * ${tokens.spacingHorizontalS})` } },\n l: { '&:not(:first-child)': { marginLeft: `calc(-1 * ${tokens.spacingHorizontalL})` } },\n});\n\n/**\n * Styles for the spread layout\n */\nconst useSpreadStyles = makeStyles({\n s: { '&:not(:first-child)': { marginLeft: tokens.spacingHorizontalS } },\n mNudge: { '&:not(:first-child)': { marginLeft: tokens.spacingHorizontalMNudge } },\n m: { '&:not(:first-child)': { marginLeft: tokens.spacingHorizontalM } },\n l: { '&:not(:first-child)': { marginLeft: tokens.spacingHorizontalL } },\n xl: { '&:not(:first-child)': { marginLeft: tokens.spacingHorizontalXL } },\n});\n\n/**\n * Styles for the pie layout\n */\nconst usePieStyles = makeStyles({\n base: {\n position: 'absolute',\n },\n slices: {\n // Two slices\n // 1st of 2 items\n '&:nth-of-type(1):nth-last-of-type(2)': {\n clipPath: `inset(0 calc(25% + (var(${avatarGroupItemDividerWidthVar}) / 2)) 0 25%)`,\n left: '-25%',\n },\n // 2nd of 2 items\n '&:nth-of-type(2):nth-last-of-type(1)': {\n clipPath: `inset(0 25% 0 calc(25% + (var(${avatarGroupItemDividerWidthVar}) / 2)))`,\n left: '25%',\n },\n\n // Three slices\n // 1st of 3 items\n '&:nth-of-type(1):nth-last-of-type(3)': {\n clipPath: `inset(0 calc(25% + (var(${avatarGroupItemDividerWidthVar}) / 2)) 0 25%)`,\n left: '-25%',\n },\n // 2nd of 3 items\n '&:nth-of-type(2):nth-last-of-type(2)': {\n // Since the two AvatarGroupItems on the right are scaled by 0.5, the divider width should not be halved.\n clipPath: `inset(0 0 var(${avatarGroupItemDividerWidthVar}) var(${avatarGroupItemDividerWidthVar}))`,\n left: '50%',\n transform: 'scale(0.5)',\n transformOrigin: '0 0',\n },\n // 3rd of 3 items\n '&:nth-of-type(3):nth-last-of-type(1)': {\n clipPath: `inset(var(${avatarGroupItemDividerWidthVar}) 0 0 var(${avatarGroupItemDividerWidthVar}))`,\n left: '50%',\n top: '50%',\n transform: 'scale(0.5)',\n transformOrigin: '0 0',\n },\n },\n rtlSlices: {\n // Two slices\n // 1st of 2 items\n '&:nth-of-type(1):nth-last-of-type(2)': {\n clipPath: `inset(0 25% 0 calc(25% + (var(${avatarGroupItemDividerWidthVar}) / 2)))`,\n },\n // 2nd of 2 items\n '&:nth-of-type(2):nth-last-of-type(1)': {\n clipPath: `inset(0 calc(25% + (var(${avatarGroupItemDividerWidthVar}) / 2)) 0 25%)`,\n },\n\n // Three slices\n // 1st of 3 items\n '&:nth-of-type(1):nth-last-of-type(3)': {\n clipPath: `inset(0 25% 0 calc(25% + (var(${avatarGroupItemDividerWidthVar}) / 2)))`,\n },\n // 2nd of 3 items\n '&:nth-of-type(2):nth-last-of-type(2)': {\n clipPath: `inset(0 var(${avatarGroupItemDividerWidthVar}) var(${avatarGroupItemDividerWidthVar}) 0)`,\n left: '0',\n },\n // 3rd of 3 items\n '&:nth-of-type(3):nth-last-of-type(1)': {\n clipPath: `inset(var(${avatarGroupItemDividerWidthVar}) var(${avatarGroupItemDividerWidthVar}) 0 0)`,\n left: '0',\n },\n },\n thick: { [avatarGroupItemDividerWidthVar]: tokens.strokeWidthThick },\n thicker: { [avatarGroupItemDividerWidthVar]: tokens.strokeWidthThicker },\n thickest: { [avatarGroupItemDividerWidthVar]: tokens.strokeWidthThickest },\n});\n\n/**\n * Apply styling to the AvatarGroupItem slots based on the state\n */\nexport const useAvatarGroupItemStyles_unstable = (state: AvatarGroupItemState): AvatarGroupItemState => {\n const { isOverflowItem, layout, size } = state;\n const { dir } = useFluent();\n\n const avatarStyles = useAvatarStyles();\n const overflowLabelStyles = useOverflowLabelStyles();\n const pieStyles = usePieStyles();\n const rootStyles = useRootStyles();\n const sizeStyles = useSizeStyles();\n\n const groupChildClassName = useGroupChildClassName(layout, size);\n\n const rootClasses = [rootStyles.base];\n\n if (!isOverflowItem) {\n rootClasses.push(rootStyles.nonOverflowItem);\n rootClasses.push(groupChildClassName);\n rootClasses.push(sizeStyles[size]);\n\n if (layout === 'pie') {\n rootClasses.push(pieStyles.base);\n\n if (size < 56) {\n rootClasses.push(pieStyles.thick);\n } else if (size < 72) {\n rootClasses.push(pieStyles.thicker);\n } else {\n rootClasses.push(pieStyles.thickest);\n }\n\n rootClasses.push(pieStyles.slices);\n\n if (dir === 'rtl') {\n rootClasses.push(pieStyles.rtlSlices);\n }\n }\n } else {\n rootClasses.push(rootStyles.overflowItem);\n }\n\n state.root.className = mergeClasses(avatarGroupItemClassNames.root, ...rootClasses, state.root.className);\n\n state.avatar.className = mergeClasses(\n avatarGroupItemClassNames.avatar,\n !isOverflowItem && avatarStyles.nonOverflowItem,\n layout === 'pie' && avatarStyles.pie,\n state.avatar.className,\n );\n\n if (state.overflowLabel) {\n state.overflowLabel.className = mergeClasses(\n avatarGroupItemClassNames.overflowLabel,\n overflowLabelStyles.base,\n state.overflowLabel.className,\n );\n }\n\n return state;\n};\n\n/**\n * Hook for getting the className for the children of AvatarGroup. This hook will provide the spacing and outlines\n * needed for each layout.\n */\nexport const useGroupChildClassName = (layout: AvatarGroupProps['layout'], size: AvatarSizes): string => {\n const stackStyles = useStackStyles();\n const spreadStyles = useSpreadStyles();\n const layoutClasses = [];\n\n if (size) {\n if (layout === 'stack') {\n if (size < 56) {\n layoutClasses.push(stackStyles.thick);\n } else if (size < 72) {\n layoutClasses.push(stackStyles.thicker);\n } else {\n layoutClasses.push(stackStyles.thickest);\n }\n\n if (size < 24) {\n layoutClasses.push(stackStyles.xxs);\n } else if (size < 48) {\n layoutClasses.push(stackStyles.xs);\n } else if (size < 96) {\n layoutClasses.push(stackStyles.s);\n } else {\n layoutClasses.push(stackStyles.l);\n }\n } else if (layout === 'spread') {\n if (size < 20) {\n layoutClasses.push(spreadStyles.s);\n } else if (size < 32) {\n layoutClasses.push(spreadStyles.mNudge);\n } else if (size < 64) {\n layoutClasses.push(spreadStyles.l);\n } else {\n layoutClasses.push(spreadStyles.xl);\n }\n }\n }\n\n return mergeClasses(...layoutClasses);\n};\n"],"sourceRoot":"../src/"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-avatar",
3
- "version": "9.2.6",
3
+ "version": "9.2.8",
4
4
  "description": "React components for building Microsoft web experiences.",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -34,15 +34,15 @@
34
34
  "es6-weak-map": "^2.0.2"
35
35
  },
36
36
  "dependencies": {
37
- "@fluentui/react-badge": "^9.0.12",
38
- "@fluentui/react-context-selector": "^9.1.1",
37
+ "@fluentui/react-badge": "^9.0.14",
38
+ "@fluentui/react-context-selector": "^9.1.2",
39
39
  "@fluentui/react-icons": "^2.0.175",
40
- "@fluentui/react-popover": "^9.3.1",
41
- "@fluentui/react-shared-contexts": "^9.1.1",
42
- "@fluentui/react-tabster": "^9.3.0",
43
- "@fluentui/react-theme": "^9.1.2",
44
- "@fluentui/react-tooltip": "^9.1.1",
45
- "@fluentui/react-utilities": "^9.2.1",
40
+ "@fluentui/react-popover": "^9.3.3",
41
+ "@fluentui/react-shared-contexts": "^9.1.2",
42
+ "@fluentui/react-tabster": "^9.3.2",
43
+ "@fluentui/react-theme": "^9.1.3",
44
+ "@fluentui/react-tooltip": "^9.1.3",
45
+ "@fluentui/react-utilities": "^9.2.2",
46
46
  "@griffel/react": "^1.4.2",
47
47
  "tslib": "^2.1.0"
48
48
  },