@fluentui/react-avatar 9.5.32 → 9.5.34

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.
package/CHANGELOG.json CHANGED
@@ -2,7 +2,151 @@
2
2
  "name": "@fluentui/react-avatar",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 20 Sep 2023 17:40:41 GMT",
5
+ "date": "Tue, 26 Sep 2023 17:44:07 GMT",
6
+ "tag": "@fluentui/react-avatar_v9.5.34",
7
+ "version": "9.5.34",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "yuanboxue@microsoft.com",
12
+ "package": "@fluentui/react-avatar",
13
+ "commit": "05a23f6f5f331841c9ac9fb63764440c543f791d",
14
+ "comment": "chore: trigger manual version bump after broken release"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-avatar",
19
+ "comment": "Bump @fluentui/react-badge to v9.2.3",
20
+ "commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-avatar",
25
+ "comment": "Bump @fluentui/react-context-selector to v9.1.36",
26
+ "commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-avatar",
31
+ "comment": "Bump @fluentui/react-popover to v9.8.9",
32
+ "commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@fluentui/react-avatar",
37
+ "comment": "Bump @fluentui/react-shared-contexts to v9.9.1",
38
+ "commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
39
+ },
40
+ {
41
+ "author": "beachball",
42
+ "package": "@fluentui/react-avatar",
43
+ "comment": "Bump @fluentui/react-tabster to v9.13.1",
44
+ "commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
45
+ },
46
+ {
47
+ "author": "beachball",
48
+ "package": "@fluentui/react-avatar",
49
+ "comment": "Bump @fluentui/react-theme to v9.1.14",
50
+ "commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
51
+ },
52
+ {
53
+ "author": "beachball",
54
+ "package": "@fluentui/react-avatar",
55
+ "comment": "Bump @fluentui/react-tooltip to v9.3.10",
56
+ "commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
57
+ },
58
+ {
59
+ "author": "beachball",
60
+ "package": "@fluentui/react-avatar",
61
+ "comment": "Bump @fluentui/react-utilities to v9.13.5",
62
+ "commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
63
+ },
64
+ {
65
+ "author": "beachball",
66
+ "package": "@fluentui/react-avatar",
67
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.12",
68
+ "commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
69
+ }
70
+ ]
71
+ }
72
+ },
73
+ {
74
+ "date": "Tue, 26 Sep 2023 15:32:06 GMT",
75
+ "tag": "@fluentui/react-avatar_v9.5.33",
76
+ "version": "9.5.33",
77
+ "comments": {
78
+ "patch": [
79
+ {
80
+ "author": "martinhochel@microsoft.com",
81
+ "package": "@fluentui/react-avatar",
82
+ "commit": "e61473fa10195f6ebf2308205c1e72e91b711831",
83
+ "comment": "fix: bump swc core to mitigate transpilation memory leaks"
84
+ },
85
+ {
86
+ "author": "ololubek@microsoft.com",
87
+ "package": "@fluentui/react-avatar",
88
+ "commit": "a31e7394d9f169bc5aa55430a22cdc65425a1b49",
89
+ "comment": "chore: Update react-icons version to pick up IconDirectionContextProvider updated export"
90
+ },
91
+ {
92
+ "author": "beachball",
93
+ "package": "@fluentui/react-avatar",
94
+ "comment": "Bump @fluentui/react-badge to v9.2.2",
95
+ "commit": "e16520437e10cd824ac254dd797e32762b5de72d"
96
+ },
97
+ {
98
+ "author": "beachball",
99
+ "package": "@fluentui/react-avatar",
100
+ "comment": "Bump @fluentui/react-context-selector to v9.1.35",
101
+ "commit": "e16520437e10cd824ac254dd797e32762b5de72d"
102
+ },
103
+ {
104
+ "author": "beachball",
105
+ "package": "@fluentui/react-avatar",
106
+ "comment": "Bump @fluentui/react-popover to v9.8.8",
107
+ "commit": "e16520437e10cd824ac254dd797e32762b5de72d"
108
+ },
109
+ {
110
+ "author": "beachball",
111
+ "package": "@fluentui/react-avatar",
112
+ "comment": "Bump @fluentui/react-shared-contexts to v9.9.0",
113
+ "commit": "e16520437e10cd824ac254dd797e32762b5de72d"
114
+ },
115
+ {
116
+ "author": "beachball",
117
+ "package": "@fluentui/react-avatar",
118
+ "comment": "Bump @fluentui/react-tabster to v9.13.0",
119
+ "commit": "e16520437e10cd824ac254dd797e32762b5de72d"
120
+ },
121
+ {
122
+ "author": "beachball",
123
+ "package": "@fluentui/react-avatar",
124
+ "comment": "Bump @fluentui/react-theme to v9.1.13",
125
+ "commit": "e16520437e10cd824ac254dd797e32762b5de72d"
126
+ },
127
+ {
128
+ "author": "beachball",
129
+ "package": "@fluentui/react-avatar",
130
+ "comment": "Bump @fluentui/react-tooltip to v9.3.9",
131
+ "commit": "e16520437e10cd824ac254dd797e32762b5de72d"
132
+ },
133
+ {
134
+ "author": "beachball",
135
+ "package": "@fluentui/react-avatar",
136
+ "comment": "Bump @fluentui/react-utilities to v9.13.4",
137
+ "commit": "e16520437e10cd824ac254dd797e32762b5de72d"
138
+ },
139
+ {
140
+ "author": "beachball",
141
+ "package": "@fluentui/react-avatar",
142
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.11",
143
+ "commit": "e16520437e10cd824ac254dd797e32762b5de72d"
144
+ }
145
+ ]
146
+ }
147
+ },
148
+ {
149
+ "date": "Wed, 20 Sep 2023 17:47:34 GMT",
6
150
  "tag": "@fluentui/react-avatar_v9.5.32",
7
151
  "version": "9.5.32",
8
152
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,49 @@
1
1
  # Change Log - @fluentui/react-avatar
2
2
 
3
- This log was last generated on Wed, 20 Sep 2023 17:40:41 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 26 Sep 2023 17:44:07 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.5.34](https://github.com/microsoft/fluentui/tree/@fluentui/react-avatar_v9.5.34)
8
+
9
+ Tue, 26 Sep 2023 17:44:07 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-avatar_v9.5.33..@fluentui/react-avatar_v9.5.34)
11
+
12
+ ### Patches
13
+
14
+ - chore: trigger manual version bump after broken release ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by yuanboxue@microsoft.com)
15
+ - Bump @fluentui/react-badge to v9.2.3 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
16
+ - Bump @fluentui/react-context-selector to v9.1.36 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
17
+ - Bump @fluentui/react-popover to v9.8.9 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
18
+ - Bump @fluentui/react-shared-contexts to v9.9.1 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
19
+ - Bump @fluentui/react-tabster to v9.13.1 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
20
+ - Bump @fluentui/react-theme to v9.1.14 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
21
+ - Bump @fluentui/react-tooltip to v9.3.10 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
22
+ - Bump @fluentui/react-utilities to v9.13.5 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
23
+ - Bump @fluentui/react-jsx-runtime to v9.0.12 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
24
+
25
+ ## [9.5.33](https://github.com/microsoft/fluentui/tree/@fluentui/react-avatar_v9.5.33)
26
+
27
+ Tue, 26 Sep 2023 15:32:06 GMT
28
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-avatar_v9.5.32..@fluentui/react-avatar_v9.5.33)
29
+
30
+ ### Patches
31
+
32
+ - fix: bump swc core to mitigate transpilation memory leaks ([PR #29253](https://github.com/microsoft/fluentui/pull/29253) by martinhochel@microsoft.com)
33
+ - chore: Update react-icons version to pick up IconDirectionContextProvider updated export ([PR #29151](https://github.com/microsoft/fluentui/pull/29151) by ololubek@microsoft.com)
34
+ - Bump @fluentui/react-badge to v9.2.2 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
35
+ - Bump @fluentui/react-context-selector to v9.1.35 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
36
+ - Bump @fluentui/react-popover to v9.8.8 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
37
+ - Bump @fluentui/react-shared-contexts to v9.9.0 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
38
+ - Bump @fluentui/react-tabster to v9.13.0 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
39
+ - Bump @fluentui/react-theme to v9.1.13 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
40
+ - Bump @fluentui/react-tooltip to v9.3.9 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
41
+ - Bump @fluentui/react-utilities to v9.13.4 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
42
+ - Bump @fluentui/react-jsx-runtime to v9.0.11 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
43
+
7
44
  ## [9.5.32](https://github.com/microsoft/fluentui/tree/@fluentui/react-avatar_v9.5.32)
8
45
 
9
- Wed, 20 Sep 2023 17:40:41 GMT
46
+ Wed, 20 Sep 2023 17:47:34 GMT
10
47
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-avatar_v9.5.31..@fluentui/react-avatar_v9.5.32)
11
48
 
12
49
  ### Patches
@@ -10,7 +10,6 @@ export const DEFAULT_STRINGS = {
10
10
  inactive: 'inactive'
11
11
  };
12
12
  export const useAvatar_unstable = (props, ref)=>{
13
- var _image, _initials;
14
13
  const { dir } = useFluent();
15
14
  const { shape: contextShape, size: contextSize } = useAvatarContext();
16
15
  const { name, size = contextSize !== null && contextSize !== void 0 ? contextSize : 32, shape = contextShape !== null && contextShape !== void 0 ? contextShape : 'circular', active = 'unset', activeAppearance = 'ring', idForColor } = props;
@@ -42,7 +41,7 @@ export const useAvatar_unstable = (props, ref)=>{
42
41
  },
43
42
  elementType: 'img'
44
43
  }); // Image shouldn't be rendered if its src is not set
45
- if (!((_image = image) === null || _image === void 0 ? void 0 : _image.src)) {
44
+ if (!(image === null || image === void 0 ? void 0 : image.src)) {
46
45
  image = undefined;
47
46
  } // Hide the image if it fails to load and restore it on a successful load
48
47
  if (image) {
@@ -59,7 +58,7 @@ export const useAvatar_unstable = (props, ref)=>{
59
58
  },
60
59
  elementType: 'span'
61
60
  }); // Don't render the initials slot if it's empty
62
- if (!((_initials = initials) === null || _initials === void 0 ? void 0 : _initials.children)) {
61
+ if (!(initials === null || initials === void 0 ? void 0 : initials.children)) {
63
62
  initials = undefined;
64
63
  } // Render the icon slot *only if* there aren't any initials or image to display
65
64
  let icon = undefined;
@@ -1 +1 @@
1
- {"version":3,"sources":["useAvatar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, mergeCallbacks, useId, slot } from '@fluentui/react-utilities';\nimport { getInitials } from '../../utils/index';\nimport type { AvatarNamedColor, AvatarProps, AvatarState } from './Avatar.types';\nimport { PersonRegular } from '@fluentui/react-icons';\nimport { PresenceBadge } from '@fluentui/react-badge';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useAvatarContext } from '../../contexts/AvatarContext';\n\nexport const DEFAULT_STRINGS = {\n active: 'active',\n inactive: 'inactive',\n};\n\nexport const useAvatar_unstable = (props: AvatarProps, ref: React.Ref<HTMLElement>): AvatarState => {\n const { dir } = useFluent();\n const { shape: contextShape, size: contextSize } = useAvatarContext();\n const {\n name,\n size = contextSize ?? (32 as const),\n shape = contextShape ?? 'circular',\n active = 'unset',\n activeAppearance = 'ring',\n idForColor,\n } = props;\n let { color = 'neutral' } = props;\n\n // Resolve 'colorful' to a specific color name\n if (color === 'colorful') {\n color = avatarColors[getHashCode(idForColor ?? name ?? '') % avatarColors.length];\n }\n\n const baseId = useId('avatar-');\n\n const root: AvatarState['root'] = slot.always(\n getNativeElementProps(\n 'span',\n {\n role: 'img',\n id: baseId,\n // aria-label and/or aria-labelledby are resolved below\n ...props,\n ref,\n },\n /* excludedPropNames: */ ['name'],\n ),\n { elementType: 'span' },\n );\n const [imageHidden, setImageHidden] = React.useState<true | undefined>(undefined);\n let image: AvatarState['image'] = slot.optional(props.image, {\n defaultProps: { alt: '', role: 'presentation', 'aria-hidden': true, hidden: imageHidden },\n elementType: 'img',\n }); // Image shouldn't be rendered if its src is not set\n if (!image?.src) {\n image = undefined;\n } // Hide the image if it fails to load and restore it on a successful load\n if (image) {\n image.onError = mergeCallbacks(image.onError, () => setImageHidden(true));\n image.onLoad = mergeCallbacks(image.onLoad, () => setImageHidden(undefined));\n } // Resolve the initials slot, defaulted to getInitials.\n let initials: AvatarState['initials'] = slot.optional(props.initials, {\n renderByDefault: true,\n defaultProps: {\n children: getInitials(name, dir === 'rtl', { firstInitialOnly: size <= 16 }),\n id: baseId + '__initials',\n },\n elementType: 'span',\n }); // Don't render the initials slot if it's empty\n if (!initials?.children) {\n initials = undefined;\n } // Render the icon slot *only if* there aren't any initials or image to display\n let icon: AvatarState['icon'] = undefined;\n if (!initials && (!image || imageHidden)) {\n icon = slot.optional(props.icon, {\n renderByDefault: true,\n defaultProps: { children: <PersonRegular />, 'aria-hidden': true },\n elementType: 'span',\n });\n }\n const badge: AvatarState['badge'] = slot.optional(props.badge, {\n defaultProps: { size: getBadgeSize(size), id: baseId + '__badge' },\n elementType: PresenceBadge,\n });\n let activeAriaLabelElement: AvatarState['activeAriaLabelElement']; // Resolve aria-label and/or aria-labelledby if not provided by the user\n if (!root['aria-label'] && !root['aria-labelledby']) {\n if (name) {\n root['aria-label'] = name; // Include the badge in labelledby if it exists\n if (badge) {\n root['aria-labelledby'] = root.id + ' ' + badge.id;\n }\n } else if (initials) {\n // root's aria-label should be the name, but fall back to being labelledby the initials if name is missing\n root['aria-labelledby'] = initials.id + (badge ? ' ' + badge.id : '');\n } // Add the active state to the aria label\n if (active === 'active' || active === 'inactive') {\n const activeText = DEFAULT_STRINGS[active];\n if (root['aria-labelledby']) {\n // If using aria-labelledby, render a hidden span and append it to the labelledby\n const activeId = baseId + '__active';\n root['aria-labelledby'] += ' ' + activeId;\n activeAriaLabelElement = (\n <span hidden id={activeId}>\n {activeText}\n </span>\n );\n } else if (root['aria-label']) {\n // Otherwise, just append it to the aria-label\n root['aria-label'] += ' ' + activeText;\n }\n }\n }\n return {\n size,\n shape,\n active,\n activeAppearance,\n activeAriaLabelElement,\n color,\n components: { root: 'span', initials: 'span', icon: 'span', image: 'img', badge: PresenceBadge },\n root,\n initials,\n icon,\n image,\n badge,\n };\n};\nconst getBadgeSize = (size: AvatarState['size']) => {\n if (size >= 96) {\n return 'extra-large';\n } else if (size >= 64) {\n return 'large';\n } else if (size >= 56) {\n return 'medium';\n } else if (size >= 40) {\n return 'small';\n } else if (size >= 28) {\n return 'extra-small';\n } else {\n return 'tiny';\n }\n};\n\nconst avatarColors: AvatarNamedColor[] = [\n 'dark-red',\n 'cranberry',\n 'red',\n 'pumpkin',\n 'peach',\n 'marigold',\n 'gold',\n 'brass',\n 'brown',\n 'forest',\n 'seafoam',\n 'dark-green',\n 'light-teal',\n 'teal',\n 'steel',\n 'blue',\n 'royal-blue',\n 'cornflower',\n 'navy',\n 'lavender',\n 'purple',\n 'grape',\n 'lilac',\n 'pink',\n 'magenta',\n 'plum',\n 'beige',\n 'mink',\n 'platinum',\n 'anchor',\n];\n\nconst getHashCode = (str: string): number => {\n let hashCode = 0;\n for (let len: number = str.length - 1; len >= 0; len--) {\n const ch = str.charCodeAt(len);\n const shift = len % 8;\n hashCode ^= (ch << shift) + (ch >> (8 - shift)); // eslint-disable-line no-bitwise\n }\n\n return hashCode;\n};\n"],"names":["React","getNativeElementProps","mergeCallbacks","useId","slot","getInitials","PersonRegular","PresenceBadge","useFluent_unstable","useFluent","useAvatarContext","DEFAULT_STRINGS","active","inactive","useAvatar_unstable","props","ref","image","initials","dir","shape","contextShape","size","contextSize","name","activeAppearance","idForColor","color","avatarColors","getHashCode","length","baseId","root","always","role","id","elementType","imageHidden","setImageHidden","useState","undefined","optional","defaultProps","alt","hidden","src","onError","onLoad","renderByDefault","children","firstInitialOnly","icon","badge","getBadgeSize","activeAriaLabelElement","activeText","activeId","span","components","str","hashCode","len","ch","charCodeAt","shift"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,EAAEC,cAAc,EAAEC,KAAK,EAAEC,IAAI,QAAQ,4BAA4B;AAC/F,SAASC,WAAW,QAAQ,oBAAoB;AAEhD,SAASC,aAAa,QAAQ,wBAAwB;AACtD,SAASC,aAAa,QAAQ,wBAAwB;AACtD,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,gBAAgB,QAAQ,+BAA+B;AAEhE,OAAO,MAAMC,kBAAkB;IAC7BC,QAAQ;IACRC,UAAU;AACZ,EAAE;AAEF,OAAO,MAAMC,qBAAqB,CAACC,OAAoBC;QAuChDC,QAeAC;IArDL,MAAM,EAAEC,GAAG,EAAE,GAAGV;IAChB,MAAM,EAAEW,OAAOC,YAAY,EAAEC,MAAMC,WAAW,EAAE,GAAGb;IACnD,MAAM,EACJc,IAAI,EACJF,OAAOC,wBAAAA,yBAAAA,cAAgB,EAAY,EACnCH,QAAQC,yBAAAA,0BAAAA,eAAgB,UAAU,EAClCT,SAAS,OAAO,EAChBa,mBAAmB,MAAM,EACzBC,UAAU,EACX,GAAGX;IACJ,IAAI,EAAEY,QAAQ,SAAS,EAAE,GAAGZ;IAE5B,8CAA8C;IAC9C,IAAIY,UAAU,YAAY;YACSD;QAAjCC,QAAQC,YAAY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B;QACA+B,YAAY;YAAE1B,MAAM;YAAQd,UAAU;YAAQiC,MAAM;YAAQlC,OAAO;YAAOmC,OAAO7C;QAAc;QAC/FyB;QACAd;QACAiC;QACAlC;QACAmC;IACF;AACF,EAAE;AACF,MAAMC,eAAe,CAAC/B;IACpB,IAAIA,QAAQ,IAAI;QACd,OAAO;IACT,OAAO,IAAIA,QAAQ,IAAI;QACrB,OAAO;IACT,OAAO,IAAIA,QAAQ,IAAI;QACrB,OAAO;IACT,OAAO,IAAIA,QAAQ,IAAI;QACrB,OAAO;IACT,OAAO,IAAIA,QAAQ,IAAI;QACrB,OAAO;IACT,OAAO;QACL,OAAO;IACT;AACF;AAEA,MAAMM,eAAmC;IACvC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,MAAMC,cAAc,CAAC8B;IACnB,IAAIC,WAAW;IACf,IAAK,IAAIC,MAAcF,IAAI7B,MAAM,GAAG,GAAG+B,OAAO,GAAGA,MAAO;QACtD,MAAMC,KAAKH,IAAII,UAAU,CAACF;QAC1B,MAAMG,QAAQH,MAAM;QACpBD,YAAY,AAACE,CAAAA,MAAME,KAAI,IAAMF,CAAAA,MAAO,IAAIE,KAAK,GAAI,iCAAiC;IACpF;IAEA,OAAOJ;AACT"}
1
+ {"version":3,"sources":["useAvatar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, mergeCallbacks, useId, slot } from '@fluentui/react-utilities';\nimport { getInitials } from '../../utils/index';\nimport type { AvatarNamedColor, AvatarProps, AvatarState } from './Avatar.types';\nimport { PersonRegular } from '@fluentui/react-icons';\nimport { PresenceBadge } from '@fluentui/react-badge';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useAvatarContext } from '../../contexts/AvatarContext';\n\nexport const DEFAULT_STRINGS = {\n active: 'active',\n inactive: 'inactive',\n};\n\nexport const useAvatar_unstable = (props: AvatarProps, ref: React.Ref<HTMLElement>): AvatarState => {\n const { dir } = useFluent();\n const { shape: contextShape, size: contextSize } = useAvatarContext();\n const {\n name,\n size = contextSize ?? (32 as const),\n shape = contextShape ?? 'circular',\n active = 'unset',\n activeAppearance = 'ring',\n idForColor,\n } = props;\n let { color = 'neutral' } = props;\n\n // Resolve 'colorful' to a specific color name\n if (color === 'colorful') {\n color = avatarColors[getHashCode(idForColor ?? name ?? '') % avatarColors.length];\n }\n\n const baseId = useId('avatar-');\n\n const root: AvatarState['root'] = slot.always(\n getNativeElementProps(\n 'span',\n {\n role: 'img',\n id: baseId,\n // aria-label and/or aria-labelledby are resolved below\n ...props,\n ref,\n },\n /* excludedPropNames: */ ['name'],\n ),\n { elementType: 'span' },\n );\n const [imageHidden, setImageHidden] = React.useState<true | undefined>(undefined);\n let image: AvatarState['image'] = slot.optional(props.image, {\n defaultProps: { alt: '', role: 'presentation', 'aria-hidden': true, hidden: imageHidden },\n elementType: 'img',\n }); // Image shouldn't be rendered if its src is not set\n if (!image?.src) {\n image = undefined;\n } // Hide the image if it fails to load and restore it on a successful load\n if (image) {\n image.onError = mergeCallbacks(image.onError, () => setImageHidden(true));\n image.onLoad = mergeCallbacks(image.onLoad, () => setImageHidden(undefined));\n } // Resolve the initials slot, defaulted to getInitials.\n let initials: AvatarState['initials'] = slot.optional(props.initials, {\n renderByDefault: true,\n defaultProps: {\n children: getInitials(name, dir === 'rtl', { firstInitialOnly: size <= 16 }),\n id: baseId + '__initials',\n },\n elementType: 'span',\n }); // Don't render the initials slot if it's empty\n if (!initials?.children) {\n initials = undefined;\n } // Render the icon slot *only if* there aren't any initials or image to display\n let icon: AvatarState['icon'] = undefined;\n if (!initials && (!image || imageHidden)) {\n icon = slot.optional(props.icon, {\n renderByDefault: true,\n defaultProps: { children: <PersonRegular />, 'aria-hidden': true },\n elementType: 'span',\n });\n }\n const badge: AvatarState['badge'] = slot.optional(props.badge, {\n defaultProps: { size: getBadgeSize(size), id: baseId + '__badge' },\n elementType: PresenceBadge,\n });\n let activeAriaLabelElement: AvatarState['activeAriaLabelElement']; // Resolve aria-label and/or aria-labelledby if not provided by the user\n if (!root['aria-label'] && !root['aria-labelledby']) {\n if (name) {\n root['aria-label'] = name; // Include the badge in labelledby if it exists\n if (badge) {\n root['aria-labelledby'] = root.id + ' ' + badge.id;\n }\n } else if (initials) {\n // root's aria-label should be the name, but fall back to being labelledby the initials if name is missing\n root['aria-labelledby'] = initials.id + (badge ? ' ' + badge.id : '');\n } // Add the active state to the aria label\n if (active === 'active' || active === 'inactive') {\n const activeText = DEFAULT_STRINGS[active];\n if (root['aria-labelledby']) {\n // If using aria-labelledby, render a hidden span and append it to the labelledby\n const activeId = baseId + '__active';\n root['aria-labelledby'] += ' ' + activeId;\n activeAriaLabelElement = (\n <span hidden id={activeId}>\n {activeText}\n </span>\n );\n } else if (root['aria-label']) {\n // Otherwise, just append it to the aria-label\n root['aria-label'] += ' ' + activeText;\n }\n }\n }\n return {\n size,\n shape,\n active,\n activeAppearance,\n activeAriaLabelElement,\n color,\n components: { root: 'span', initials: 'span', icon: 'span', image: 'img', badge: PresenceBadge },\n root,\n initials,\n icon,\n image,\n badge,\n };\n};\nconst getBadgeSize = (size: AvatarState['size']) => {\n if (size >= 96) {\n return 'extra-large';\n } else if (size >= 64) {\n return 'large';\n } else if (size >= 56) {\n return 'medium';\n } else if (size >= 40) {\n return 'small';\n } else if (size >= 28) {\n return 'extra-small';\n } else {\n return 'tiny';\n }\n};\n\nconst avatarColors: AvatarNamedColor[] = [\n 'dark-red',\n 'cranberry',\n 'red',\n 'pumpkin',\n 'peach',\n 'marigold',\n 'gold',\n 'brass',\n 'brown',\n 'forest',\n 'seafoam',\n 'dark-green',\n 'light-teal',\n 'teal',\n 'steel',\n 'blue',\n 'royal-blue',\n 'cornflower',\n 'navy',\n 'lavender',\n 'purple',\n 'grape',\n 'lilac',\n 'pink',\n 'magenta',\n 'plum',\n 'beige',\n 'mink',\n 'platinum',\n 'anchor',\n];\n\nconst getHashCode = (str: string): number => {\n let hashCode = 0;\n for (let len: number = str.length - 1; len >= 0; len--) {\n const ch = str.charCodeAt(len);\n const shift = len % 8;\n hashCode ^= (ch << shift) + (ch >> (8 - shift)); // eslint-disable-line no-bitwise\n }\n\n return hashCode;\n};\n"],"names":["React","getNativeElementProps","mergeCallbacks","useId","slot","getInitials","PersonRegular","PresenceBadge","useFluent_unstable","useFluent","useAvatarContext","DEFAULT_STRINGS","active","inactive","useAvatar_unstable","props","ref","dir","shape","contextShape","size","contextSize","name","activeAppearance","idForColor","color","avatarColors","getHashCode","length","baseId","root","always","role","id","elementType","imageHidden","setImageHidden","useState","undefined","image","optional","defaultProps","alt","hidden","src","onError","onLoad","initials","renderByDefault","children","firstInitialOnly","icon","badge","getBadgeSize","activeAriaLabelElement","activeText","activeId","span","components","str","hashCode","len","ch","charCodeAt","shift"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,EAAEC,cAAc,EAAEC,KAAK,EAAEC,IAAI,QAAQ,4BAA4B;AAC/F,SAASC,WAAW,QAAQ,oBAAoB;AAEhD,SAASC,aAAa,QAAQ,wBAAwB;AACtD,SAASC,aAAa,QAAQ,wBAAwB;AACtD,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,gBAAgB,QAAQ,+BAA+B;AAEhE,OAAO,MAAMC,kBAAkB;IAC7BC,QAAQ;IACRC,UAAU;AACZ,EAAE;AAEF,OAAO,MAAMC,qBAAqB,CAACC,OAAoBC;IACrD,MAAM,EAAEC,GAAG,EAAE,GAAGR;IAChB,MAAM,EAAES,OAAOC,YAAY,EAAEC,MAAMC,WAAW,EAAE,GAAGX;IACnD,MAAM,EACJY,IAAI,EACJF,OAAOC,wBAAAA,yBAAAA,cAAgB,EAAY,EACnCH,QAAQC,yBAAAA,0BAAAA,eAAgB,UAAU,EAClCP,SAAS,OAAO,EAChBW,m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AC7B,8CAA8C;gBAC9CA,IAAI,CAAC,aAAa,IAAI,MAAMyB;YAC9B;QACF;IACF;IACA,OAAO;QACLnC;QACAF;QACAN;QACAW;QACA+B;QACA7B;QACAiC,YAAY;YAAE5B,MAAM;YAAQiB,UAAU;YAAQI,MAAM;YAAQZ,OAAO;YAAOa,OAAO7C;QAAc;QAC/FuB;QACAiB;QACAI;QACAZ;QACAa;IACF;AACF,EAAE;AACF,MAAMC,eAAe,CAACjC;IACpB,IAAIA,QAAQ,IAAI;QACd,OAAO;IACT,OAAO,IAAIA,QAAQ,IAAI;QACrB,OAAO;IACT,OAAO,IAAIA,QAAQ,IAAI;QACrB,OAAO;IACT,OAAO,IAAIA,QAAQ,IAAI;QACrB,OAAO;IACT,OAAO,IAAIA,QAAQ,IAAI;QACrB,OAAO;IACT,OAAO;QACL,OAAO;IACT;AACF;AAEA,MAAMM,eAAmC;IACvC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,MAAMC,cAAc,CAACgC;IACnB,IAAIC,WAAW;IACf,IAAK,IAAIC,MAAcF,IAAI/B,MAAM,GAAG,GAAGiC,OAAO,GAAGA,MAAO;QACtD,MAAMC,KAAKH,IAAII,UAAU,CAACF;QAC1B,MAAMG,QAAQH,MAAM;QACpBD,YAAY,AAACE,CAAAA,MAAME,KAAI,IAAMF,CAAAA,MAAO,IAAIE,KAAK,GAAI,iCAAiC;IACpF;IAEA,OAAOJ;AACT"}
@@ -23,8 +23,8 @@ import { Tooltip } from '@fluentui/react-tooltip';
23
23
  initialState: false
24
24
  });
25
25
  const handleOnPopoverChange = (e, data)=>{
26
- var _restOfProps_onOpenChange, _restOfProps;
27
- (_restOfProps_onOpenChange = (_restOfProps = restOfProps).onOpenChange) === null || _restOfProps_onOpenChange === void 0 ? void 0 : _restOfProps_onOpenChange.call(_restOfProps, e, data);
26
+ var _restOfProps_onOpenChange;
27
+ (_restOfProps_onOpenChange = restOfProps.onOpenChange) === null || _restOfProps_onOpenChange === void 0 ? void 0 : _restOfProps_onOpenChange.call(restOfProps, e, data);
28
28
  setPopoverOpen(data.open);
29
29
  };
30
30
  let triggerButtonChildren;
@@ -1 +1 @@
1
- {"version":3,"sources":["useAvatarGroupPopover.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useAvatarGroupContext_unstable } from '../../contexts/AvatarGroupContext';\nimport { defaultAvatarGroupSize } from '../AvatarGroup/useAvatarGroup';\nimport { useControllableState, slot } 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: slot.always(\n {\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 { elementType: Popover },\n ),\n triggerButton: slot.always(props.triggerButton, {\n defaultProps: {\n children: triggerButtonChildren,\n type: 'button',\n },\n elementType: 'button',\n }),\n content: slot.always(props.content, {\n defaultProps: {\n children,\n role: 'list',\n },\n elementType: 'ul',\n }),\n popoverSurface: slot.always(props.popoverSurface, {\n defaultProps: {\n 'aria-label': 'Overflow',\n tabIndex: 0,\n },\n elementType: PopoverSurface,\n }),\n tooltip: slot.always(props.tooltip, {\n defaultProps: {\n content: 'View more people.',\n relationship: 'label',\n },\n elementType: Tooltip,\n }),\n };\n};\n"],"names":["React","useAvatarGroupContext_unstable","defaultAvatarGroupSize","useControllableState","slot","MoreHorizontalRegular","Popover","PopoverSurface","Tooltip","useAvatarGroupPopover_unstable","props","size","ctx","layout","indicator","count","Children","children","restOfProps","popoverOpen","setPopoverOpen","state","open","defaultState","defaultOpen","initialState","handleOnPopoverChange","e","data","onOpenChange","triggerButtonChildren","components","root","triggerButton","content","popoverSurface","tooltip","always","trapFocus","elementType","defaultProps","type","role","tabIndex","relationship"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,8BAA8B,QAAQ,oCAAoC;AACnF,SAASC,sBAAsB,QAAQ,gCAAgC;AACvE,SAASC,oBAAoB,EAAEC,IAAI,QAAQ,4BAA4B;AACvE,SAASC,qBAAqB,QAAQ,wBAAwB;AAC9D,SAA8CC,OAAO,EAAEC,cAAc,QAAQ,0BAA0B;AAEvG,SAASC,OAAO,QAAQ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3B,MAAMuB,aAAa,EAAE;YAC9CO,cAAc;gBACZvB,UAAUa;gBACVW,MAAM;YACR;YACAF,aAAa;QACf;QACAL,SAAS9B,KAAKiC,MAAM,CAAC3B,MAAMwB,OAAO,EAAE;YAClCM,cAAc;gBACZvB;gBACAyB,MAAM;YACR;YACAH,aAAa;QACf;QACAJ,gBAAgB/B,KAAKiC,MAAM,CAAC3B,MAAMyB,cAAc,EAAE;YAChDK,cAAc;gBACZ,cAAc;gBACdG,UAAU;YACZ;YACAJ,aAAahC;QACf;QACA6B,SAAShC,KAAKiC,MAAM,CAAC3B,MAAM0B,OAAO,EAAE;YAClCI,cAAc;gBACZN,SAAS;gBACTU,cAAc;YAChB;YACAL,aAAa/B;QACf;IACF;AACF,EAAE"}
1
+ {"version":3,"sources":["useAvatarGroupPopover.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useAvatarGroupContext_unstable } from '../../contexts/AvatarGroupContext';\nimport { defaultAvatarGroupSize } from '../AvatarGroup/useAvatarGroup';\nimport { useControllableState, slot } 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: slot.always(\n {\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 { elementType: Popover },\n ),\n triggerButton: slot.always(props.triggerButton, {\n defaultProps: {\n children: triggerButtonChildren,\n type: 'button',\n },\n elementType: 'button',\n }),\n content: slot.always(props.content, {\n defaultProps: {\n children,\n role: 'list',\n },\n elementType: 'ul',\n }),\n popoverSurface: slot.always(props.popoverSurface, {\n defaultProps: {\n 'aria-label': 'Overflow',\n tabIndex: 0,\n },\n elementType: PopoverSurface,\n }),\n tooltip: slot.always(props.tooltip, {\n defaultProps: {\n content: 'View more people.',\n relationship: 'label',\n },\n elementType: Tooltip,\n }),\n };\n};\n"],"names":["React","useAvatarGroupContext_unstable","defaultAvatarGroupSize","useControllableState","slot","MoreHorizontalRegular","Popover","PopoverSurface","Tooltip","useAvatarGroupPopover_unstable","props","size","ctx","layout","indicator","count","Children","children","restOfProps","popoverOpen","setPopoverOpen","state","open","defaultState","defaultOpen","initialState","handleOnPopoverChange","e","data","onOpenChange","triggerButtonChildren","components","root","triggerButton","content","popoverSurface","tooltip","always","trapFocus","elementType","defaultProps","type","role","tabIndex","relationship"],"mappings":"A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gBAAgB5B;YAChB6B,SAAS5B;QACX;QACAwB,MAAM5B,KAAKiC,MAAM,CACf;YACE,oGAAoG;YACpGpB,wBAAU;YACVN,MAAM;YACN2B,WAAW;YACX,GAAGpB,WAAW;YACdI,MAAMH;YACNU,cAAcH;QAChB,GACA;YAAEa,aAAajC;QAAQ;QAEzB2B,eAAe7B,KAAKiC,MAAM,CAAC3B,MAAMuB,aAAa,EAAE;YAC9CO,cAAc;gBACZvB,UAAUa;gBACVW,MAAM;YACR;YACAF,aAAa;QACf;QACAL,SAAS9B,KAAKiC,MAAM,CAAC3B,MAAMwB,OAAO,EAAE;YAClCM,cAAc;gBACZvB;gBACAyB,MAAM;YACR;YACAH,aAAa;QACf;QACAJ,gBAAgB/B,KAAKiC,MAAM,CAAC3B,MAAMyB,cAAc,EAAE;YAChDK,cAAc;gBACZ,cAAc;gBACdG,UAAU;YACZ;YACAJ,aAAahC;QACf;QACA6B,SAAShC,KAAKiC,MAAM,CAAC3B,MAAM0B,OAAO,EAAE;YAClCI,cAAc;gBACZN,SAAS;gBACTU,cAAc;YAChB;YACAL,aAAa/B;QACf;IACF;AACF,EAAE"}
@@ -4,7 +4,9 @@ const avatarContextDefaultValue = {};
4
4
  /**
5
5
  * @internal
6
6
  */ export const AvatarContextProvider = avatarContext.Provider;
7
- var _React_useContext;
8
7
  /**
9
8
  * @internal
10
- */ export const useAvatarContext = ()=>(_React_useContext = React.useContext(avatarContext)) !== null && _React_useContext !== void 0 ? _React_useContext : avatarContextDefaultValue;
9
+ */ export const useAvatarContext = ()=>{
10
+ var _React_useContext;
11
+ return (_React_useContext = React.useContext(avatarContext)) !== null && _React_useContext !== void 0 ? _React_useContext : avatarContextDefaultValue;
12
+ };
@@ -1 +1 @@
1
- {"version":3,"sources":["AvatarContext.ts"],"sourcesContent":["import * as React from 'react';\nimport type { AvatarShape, AvatarSize } from '../components/Avatar/Avatar.types';\n\nconst avatarContext = React.createContext<AvatarContextValue | undefined>(undefined);\n\n/**\n * @internal\n */\nexport interface AvatarContextValue {\n shape?: AvatarShape;\n size?: AvatarSize;\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"],"names":["React","avatarContext","createContext","undefined","avatarContextDefaultValue","AvatarContextProvider","Provider","useAvatarContext","useContext"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAG/B,MAAMC,gBAAgBD,MAAME,aAAa,CAAiCC;AAU1E,MAAMC,4BAAgD,CAAC;AAEvD;;CAEC,GACD,OAAO,MAAMC,wBAAwBJ,cAAcK,QAAQ,CAAC;IAKtBN;AAHtC;;CAEC,GACD,OAAO,MAAMO,mBAAmB,IAAMP,CAAAA,oBAAAA,MAAMQ,UAAU,CAACP,4BAAjBD,+BAAAA,oBAAmCI,0BAA0B"}
1
+ {"version":3,"sources":["AvatarContext.ts"],"sourcesContent":["import * as React from 'react';\nimport type { AvatarShape, AvatarSize } from '../components/Avatar/Avatar.types';\n\nconst avatarContext = React.createContext<AvatarContextValue | undefined>(undefined);\n\n/**\n * @internal\n */\nexport interface AvatarContextValue {\n shape?: AvatarShape;\n size?: AvatarSize;\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"],"names":["React","avatarContext","createContext","undefined","avatarContextDefaultValue","AvatarContextProvider","Provider","useAvatarContext","useContext"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAG/B,MAAMC,gBAAgBD,MAAME,aAAa,CAAiCC;AAU1E,MAAMC,4BAAgD,CAAC;AAEvD;;CAEC,GACD,OAAO,MAAMC,wBAAwBJ,cAAcK,QAAQ,CAAC;AAE5D;;CAEC,GACD,OAAO,MAAMC,mBAAmB;QAAMP;WAAAA,CAAAA,oBAAAA,MAAMQ,UAAU,CAACP,4BAAjBD,+BAAAA,oBAAmCI;AAAwB,EAAE"}
@@ -58,14 +58,13 @@ function cleanupDisplayName(displayName) {
58
58
  *
59
59
  * @internal
60
60
  */ export function getInitials(displayName, isRtl, options) {
61
- var _options, _options1;
62
61
  if (!displayName) {
63
62
  return '';
64
63
  }
65
64
  displayName = cleanupDisplayName(displayName);
66
65
  // For names containing CJK characters, and phone numbers, we don't display initials
67
- if (UNSUPPORTED_TEXT_REGEX.test(displayName) || !((_options = options) === null || _options === void 0 ? void 0 : _options.allowPhoneInitials) && PHONENUMBER_REGEX.test(displayName)) {
66
+ if (UNSUPPORTED_TEXT_REGEX.test(displayName) || !(options === null || options === void 0 ? void 0 : options.allowPhoneInitials) && PHONENUMBER_REGEX.test(displayName)) {
68
67
  return '';
69
68
  }
70
- return getInitialsLatin(displayName, isRtl, (_options1 = options) === null || _options1 === void 0 ? void 0 : _options1.firstInitialOnly);
69
+ return getInitialsLatin(displayName, isRtl, options === null || options === void 0 ? void 0 : options.firstInitialOnly);
71
70
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["getInitials.ts"],"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 */\nconst UNSUPPORTED_TEXT_REGEX: RegExp =\n /[\\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"],"names":["UNWANTED_ENCLOSURES_REGEX","UNWANTED_CHARS_REGEX","PHONENUMBER_REGEX","MULTIPLE_WHITESPACES_REGEX","UNSUPPORTED_TEXT_REGEX","getInitialsLatin","displayName","isRtl","firstInitialOnly","initials","splits","split","length","charAt","toUpperCase","cleanupDisplayName","replace","trim","getInitials","options","test","allowPhoneInitials"],"mappings":"AAAA;;CAEC,GAED;;;CAGC,GACD,MAAMA,4BAAoC;AAE1C;;;CAGC,GACD,MAAMC,uBAA+B;AAErC;;;CAGC,GACD,MAAMC,oBAA4B;AAElC,oDAAoD,GACpD,MAAMC,6BAAqC;AAE3C;;;;;;;CAOC,GACD,MAAMC,yBACJ;AAEF,SAASC,iBAAiBC,WAAmB,EAAEC,KAAc,EAAEC,gBAA0B;IACvF,IAAIC,WAAW;IAEf,MAAMC,SAAmBJ,YAAYK,KAAK,CAAC;IAC3C,IAAID,OAAOE,MAAM,KAAK,GAAG;QACvBH,YAAYC,MAAM,CAAC,EAAE,CAACG,MAAM,CAAC,GAAGC,WAAW;IAC7C;IAEA,IAAI,CAACN,kBAAkB;QACrB,IAAIE,OAAOE,MAAM,KAAK,GAAG;YACvBH,YAAYC,MAAM,CAAC,EAAE,CAACG,MAAM,CAAC,GAAGC,WAAW;QAC7C,OAAO,IAAIJ,OAAOE,MAAM,KAAK,GAAG;YAC9BH,YAAYC,MAAM,CAAC,EAAE,CAACG,MAAM,CAAC,GAAGC,WAAW;QAC7C;IACF;IAEA,IAAIP,SAASE,SAASG,MAAM,GAAG,GAAG;QAChC,OAAOH,SAASI,MAAM,CAAC,KAAKJ,SAASI,MAAM,CAAC;IAC9C;IAEA,OAAOJ;AACT;AAEA,SAASM,mBAAmBT,WAAmB;IAC7CA,cAAcA,YAAYU,OAAO,CAAChB,2BAA2B;IAC7DM,cAAcA,YAAYU,OAAO,CAACf,sBAAsB;IACxDK,cAAcA,YAAYU,OAAO,CAACb,4BAA4B;IAC9DG,cAAcA,YAAYW,IAAI;IAE9B,OAAOX;AACT;AAEA;;;;;;;;;;;CAWC,GACD,OAAO,SAASY,YACdZ,WAAsC,EACtCC,KAAc,EACdY,OAMC;QAWGA,UAKwCA;IAd5C,IAAI,CAACb,aAAa;QAChB,OAAO;IACT;IAEAA,cAAcS,mBAAmBT;IAEjC,oFAAoF;IACpF,IACEF,uBAAuBgB,IAAI,CAACd,gBAC3B,GAACa,WAAAA,qBAAAA,+BAAAA,SAASE,kBAAkB,KAAInB,kBAAkBkB,IAAI,CAACd,cACxD;QACA,OAAO;IACT;IAEA,OAAOD,iBAAiBC,aAAaC,QAAOY,YAAAA,qBAAAA,gCAAAA,UAASX,gBAAgB;AACvE"}
1
+ {"version":3,"sources":["getInitials.ts"],"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 */\nconst UNSUPPORTED_TEXT_REGEX: RegExp =\n /[\\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"],"names":["UNWANTED_ENCLOSURES_REGEX","UNWANTED_CHARS_REGEX","PHONENUMBER_REGEX","MULTIPLE_WHITESPACES_REGEX","UNSUPPORTED_TEXT_REGEX","getInitialsLatin","displayName","isRtl","firstInitialOnly","initials","splits","split","length","charAt","toUpperCase","cleanupDisplayName","replace","trim","getInitials","options","test","allowPhoneInitials"],"mappings":"AAAA;;CAEC,GAED;;;CAGC,GACD,MAAMA,4BAAoC;AAE1C;;;CAGC,GACD,MAAMC,uBAA+B;AAErC;;;CAGC,GACD,MAAMC,oBAA4B;AAElC,oDAAoD,GACpD,MAAMC,6BAAqC;AAE3C;;;;;;;CAOC,GACD,MAAMC,yBACJ;AAEF,SAASC,iBAAiBC,WAAmB,EAAEC,KAAc,EAAEC,gBAA0B;IACvF,IAAIC,WAAW;IAEf,MAAMC,SAAmBJ,YAAYK,KAAK,CAAC;IAC3C,IAAID,OAAOE,MAAM,KAAK,GAAG;QACvBH,YAAYC,MAAM,CAAC,EAAE,CAACG,MAAM,CAAC,GAAGC,WAAW;IAC7C;IAEA,IAAI,CAACN,kBAAkB;QACrB,IAAIE,OAAOE,MAAM,KAAK,GAAG;YACvBH,YAAYC,MAAM,CAAC,EAAE,CAACG,MAAM,CAAC,GAAGC,WAAW;QAC7C,OAAO,IAAIJ,OAAOE,MAAM,KAAK,GAAG;YAC9BH,YAAYC,MAAM,CAAC,EAAE,CAACG,MAAM,CAAC,GAAGC,WAAW;QAC7C;IACF;IAEA,IAAIP,SAASE,SAASG,MAAM,GAAG,GAAG;QAChC,OAAOH,SAASI,MAAM,CAAC,KAAKJ,SAASI,MAAM,CAAC;IAC9C;IAEA,OAAOJ;AACT;AAEA,SAASM,mBAAmBT,WAAmB;IAC7CA,cAAcA,YAAYU,OAAO,CAAChB,2BAA2B;IAC7DM,cAAcA,YAAYU,OAAO,CAACf,sBAAsB;IACxDK,cAAcA,YAAYU,OAAO,CAACb,4BAA4B;IAC9DG,cAAcA,YAAYW,IAAI;IAE9B,OAAOX;AACT;AAEA;;;;;;;;;;;CAWC,GACD,OAAO,SAASY,YACdZ,WAAsC,EACtCC,KAAc,EACdY,OAMC;IAED,IAAI,CAACb,aAAa;QAChB,OAAO;IACT;IAEAA,cAAcS,mBAAmBT;IAEjC,oFAAoF;IACpF,IACEF,uBAAuBgB,IAAI,CAACd,gBAC3B,EAACa,oBAAAA,8BAAAA,QAASE,kBAAkB,KAAInB,kBAAkBkB,IAAI,CAACd,cACxD;QACA,OAAO;IACT;IAEA,OAAOD,iBAAiBC,aAAaC,OAAOY,oBAAAA,8BAAAA,QAASX,gBAAgB;AACvE"}
@@ -29,7 +29,6 @@ const DEFAULT_STRINGS = {
29
29
  inactive: 'inactive'
30
30
  };
31
31
  const useAvatar_unstable = (props, ref)=>{
32
- var _image, _initials;
33
32
  const { dir } = (0, _reactsharedcontexts.useFluent_unstable)();
34
33
  const { shape: contextShape, size: contextSize } = (0, _AvatarContext.useAvatarContext)();
35
34
  const { name, size = contextSize !== null && contextSize !== void 0 ? contextSize : 32, shape = contextShape !== null && contextShape !== void 0 ? contextShape : 'circular', active = 'unset', activeAppearance = 'ring', idForColor } = props;
@@ -61,7 +60,7 @@ const useAvatar_unstable = (props, ref)=>{
61
60
  },
62
61
  elementType: 'img'
63
62
  }); // Image shouldn't be rendered if its src is not set
64
- if (!((_image = image) === null || _image === void 0 ? void 0 : _image.src)) {
63
+ if (!(image === null || image === void 0 ? void 0 : image.src)) {
65
64
  image = undefined;
66
65
  } // Hide the image if it fails to load and restore it on a successful load
67
66
  if (image) {
@@ -78,7 +77,7 @@ const useAvatar_unstable = (props, ref)=>{
78
77
  },
79
78
  elementType: 'span'
80
79
  }); // Don't render the initials slot if it's empty
81
- if (!((_initials = initials) === null || _initials === void 0 ? void 0 : _initials.children)) {
80
+ if (!(initials === null || initials === void 0 ? void 0 : initials.children)) {
82
81
  initials = undefined;
83
82
  } // Render the icon slot *only if* there aren't any initials or image to display
84
83
  let icon = undefined;
@@ -1 +1 @@
1
- {"version":3,"sources":["useAvatar.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, mergeCallbacks, useId, slot } from '@fluentui/react-utilities';\nimport { getInitials } from '../../utils/index';\nimport { PersonRegular } from '@fluentui/react-icons';\nimport { PresenceBadge } from '@fluentui/react-badge';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useAvatarContext } from '../../contexts/AvatarContext';\nexport const DEFAULT_STRINGS = {\n active: 'active',\n inactive: 'inactive'\n};\nexport const useAvatar_unstable = (props, ref)=>{\n var _image, _initials;\n const { dir } = useFluent();\n const { shape: contextShape, size: contextSize } = useAvatarContext();\n const { name, size = contextSize !== null && contextSize !== void 0 ? contextSize : 32, shape = contextShape !== null && contextShape !== void 0 ? contextShape : 'circular', active = 'unset', activeAppearance = 'ring', idForColor } = props;\n let { color = 'neutral' } = props;\n // Resolve 'colorful' to a specific color name\n if (color === 'colorful') {\n var _ref;\n color = avatarColors[getHashCode((_ref = idForColor !== null && idForColor !== void 0 ? idForColor : name) !== null && _ref !== void 0 ? _ref : '') % avatarColors.length];\n }\n const baseId = useId('avatar-');\n const root = slot.always(getNativeElementProps('span', {\n role: 'img',\n id: baseId,\n // aria-label and/or aria-labelledby are resolved below\n ...props,\n ref\n }, /* excludedPropNames: */ [\n 'name'\n ]), {\n elementType: 'span'\n });\n const [imageHidden, setImageHidden] = React.useState(undefined);\n let image = slot.optional(props.image, {\n defaultProps: {\n alt: '',\n role: 'presentation',\n 'aria-hidden': true,\n hidden: imageHidden\n },\n elementType: 'img'\n }); // Image shouldn't be rendered if its src is not set\n if (!((_image = image) === null || _image === void 0 ? void 0 : _image.src)) {\n image = undefined;\n } // Hide the image if it fails to load and restore it on a successful load\n if (image) {\n image.onError = mergeCallbacks(image.onError, ()=>setImageHidden(true));\n image.onLoad = mergeCallbacks(image.onLoad, ()=>setImageHidden(undefined));\n } // Resolve the initials slot, defaulted to getInitials.\n let initials = slot.optional(props.initials, {\n renderByDefault: true,\n defaultProps: {\n children: getInitials(name, dir === 'rtl', {\n firstInitialOnly: size <= 16\n }),\n id: baseId + '__initials'\n },\n elementType: 'span'\n }); // Don't render the initials slot if it's empty\n if (!((_initials = initials) === null || _initials === void 0 ? void 0 : _initials.children)) {\n initials = undefined;\n } // Render the icon slot *only if* there aren't any initials or image to display\n let icon = undefined;\n if (!initials && (!image || imageHidden)) {\n icon = slot.optional(props.icon, {\n renderByDefault: true,\n defaultProps: {\n children: /*#__PURE__*/ React.createElement(PersonRegular, null),\n 'aria-hidden': true\n },\n elementType: 'span'\n });\n }\n const badge = slot.optional(props.badge, {\n defaultProps: {\n size: getBadgeSize(size),\n id: baseId + '__badge'\n },\n elementType: PresenceBadge\n });\n let activeAriaLabelElement; // Resolve aria-label and/or aria-labelledby if not provided by the user\n if (!root['aria-label'] && !root['aria-labelledby']) {\n if (name) {\n root['aria-label'] = name; // Include the badge in labelledby if it exists\n if (badge) {\n root['aria-labelledby'] = root.id + ' ' + badge.id;\n }\n } else if (initials) {\n // root's aria-label should be the name, but fall back to being labelledby the initials if name is missing\n root['aria-labelledby'] = initials.id + (badge ? ' ' + badge.id : '');\n } // Add the active state to the aria label\n if (active === 'active' || active === 'inactive') {\n const activeText = DEFAULT_STRINGS[active];\n if (root['aria-labelledby']) {\n // If using aria-labelledby, render a hidden span and append it to the labelledby\n const activeId = baseId + '__active';\n root['aria-labelledby'] += ' ' + activeId;\n activeAriaLabelElement = /*#__PURE__*/ React.createElement(\"span\", {\n hidden: true,\n id: activeId\n }, activeText);\n } else if (root['aria-label']) {\n // Otherwise, just append it to the aria-label\n root['aria-label'] += ' ' + activeText;\n }\n }\n }\n return {\n size,\n shape,\n active,\n activeAppearance,\n activeAriaLabelElement,\n color,\n components: {\n root: 'span',\n initials: 'span',\n icon: 'span',\n image: 'img',\n badge: PresenceBadge\n },\n root,\n initials,\n icon,\n image,\n badge\n };\n};\nconst getBadgeSize = (size)=>{\n if (size >= 96) {\n return 'extra-large';\n } else if (size >= 64) {\n return 'large';\n } else if (size >= 56) {\n return 'medium';\n } else if (size >= 40) {\n return 'small';\n } else if (size >= 28) {\n return 'extra-small';\n } else {\n return 'tiny';\n }\n};\nconst avatarColors = [\n 'dark-red',\n 'cranberry',\n 'red',\n 'pumpkin',\n 'peach',\n 'marigold',\n 'gold',\n 'brass',\n 'brown',\n 'forest',\n 'seafoam',\n 'dark-green',\n 'light-teal',\n 'teal',\n 'steel',\n 'blue',\n 'royal-blue',\n 'cornflower',\n 'navy',\n 'lavender',\n 'purple',\n 'grape',\n 'lilac',\n 'pink',\n 'magenta',\n 'plum',\n 'beige',\n 'mink',\n 'platinum',\n 'anchor'\n];\nconst getHashCode = (str)=>{\n let hashCode = 0;\n for(let len = str.length - 1; len >= 0; len--){\n const ch = str.charCodeAt(len);\n const shift = len % 8;\n hashCode ^= (ch << shift) + (ch >> 8 - shift); // eslint-disable-line no-bitwise\n }\n return hashCode;\n};\n"],"names":["DEFAULT_STRINGS","useAvatar_unstable","active","inactive","props","ref","_image","_initials","dir","useFluent","shape","contextShape","size","contextSize","useAvatarContext","name","activeAppearance","idForColor","color","_ref","avatarColors","getHashCode","length","baseId","useId","root","slot","always","getNativeElementProps","role","id","elementType","imageHidden","setImageHidden","React","useState","undefined","image","optional","defaultProps","alt","hidden","src","onError","mergeCallbacks","onLoad","initials","renderByDefault","children","getInitials","firstInitialOnly","icon","createElement","PersonRegular","badge","getBadgeSize","PresenceBadge","activeAriaLabelElement","activeText","activeId","components","str","hashCode","len","ch","charCodeAt","shift"],"mappings":";;;;;;;;;;;IAOaA,eAAe;eAAfA;;IAIAC,kBAAkB;eAAlBA;;;;iEAXU;gCAC4C;uBACvC;4BACE;4BACA;qCACkB;+BACf;AAC1B,MAAMD,kBAAkB;IAC3BE,QAAQ;IACRC,UAAU;AACd;AACO,MAAMF,qBAAqB,CAACG,OAAOC;IACtC,IAAIC,QAAQC;IACZ,MAAM,EAAEC,GAAG,EAAE,GAAGC,IAAAA,uCAAS;IACzB,MAAM,EAAEC,OAAOC,YAAY,EAAEC,MAAMC,WAAW,EAAE,GAAGC,IAAAA,+BAAgB;IACnE,MAAM,EAAEC,IAAI,EAAEH,OAAOC,gBAAgB,QAAQA,gBAAgB,KAAK,IAAIA,cAAc,EAAE,EAAEH,QAAQC,iBAAiB,QAAQA,iBAAiB,KAAK,IAAIA,eAAe,UAAU,EAAET,SAAS,OAAO,EAAEc,mBAAmB,MAAM,EAAEC,UAAU,EAAE,GAAGb;IAC1O,IAAI,EAAEc,QAAQ,SAAS,EAAE,GAAGd;IAC5B,8CAA8C;IAC9C,IAAIc,UAAU,YAAY;QACtB,IAAIC;QACJD,QAAQE,YAAY,CAACC,YAAY,AAACF,CAAAA,OAAOF,eAAe,QAAQA,eAAe,KAAK,IAAIA,aAAaF,IAAG,MAAO,QAAQI,SAAS,KAAK,IAAIA,OAAO,MAAMC,aAAaE,MAAM,CAAC;IAC9K;IACA,MAAMC,SAASC,IA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aAAa,EAAE;gBAC3B,8CAA8C;gBAC9CA,IAAI,CAAC,aAAa,IAAI,MAAMiC;YAChC;QACJ;IACJ;IACA,OAAO;QACH9C;QACAF;QACAR;QACAc;QACAyC;QACAvC;QACA0C,YAAY;YACRnC,MAAM;YACNqB,UAAU;YACVK,MAAM;YACNd,OAAO;YACPiB,OAAOE,yBAAa;QACxB;QACA/B;QACAqB;QACAK;QACAd;QACAiB;IACJ;AACJ;AACA,MAAMC,eAAe,CAAC3C;IAClB,IAAIA,QAAQ,IAAI;QACZ,OAAO;IACX,OAAO,IAAIA,QAAQ,IAAI;QACnB,OAAO;IACX,OAAO,IAAIA,QAAQ,IAAI;QACnB,OAAO;IACX,OAAO,IAAIA,QAAQ,IAAI;QACnB,OAAO;IACX,OAAO,IAAIA,QAAQ,IAAI;QACnB,OAAO;IACX,OAAO;QACH,OAAO;IACX;AACJ;AACA,MAAMQ,eAAe;IACjB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACH;AACD,MAAMC,cAAc,CAACwC;IACjB,IAAIC,WAAW;IACf,IAAI,IAAIC,MAAMF,IAAIvC,MAAM,GAAG,GAAGyC,OAAO,GAAGA,MAAM;QAC1C,MAAMC,KAAKH,IAAII,UAAU,CAACF;QAC1B,MAAMG,QAAQH,MAAM;QACpBD,YAAY,AAACE,CAAAA,MAAME,KAAI,IAAMF,CAAAA,MAAM,IAAIE,KAAI,GAAI,iCAAiC;IACpF;IACA,OAAOJ;AACX"}
1
+ {"version":3,"sources":["useAvatar.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, mergeCallbacks, useId, slot } from '@fluentui/react-utilities';\nimport { getInitials } from '../../utils/index';\nimport { PersonRegular } from '@fluentui/react-icons';\nimport { PresenceBadge } from '@fluentui/react-badge';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useAvatarContext } from '../../contexts/AvatarContext';\nexport const DEFAULT_STRINGS = {\n active: 'active',\n inactive: 'inactive'\n};\nexport const useAvatar_unstable = (props, ref)=>{\n const { dir } = useFluent();\n const { shape: contextShape, size: contextSize } = useAvatarContext();\n const { name, size = contextSize !== null && contextSize !== void 0 ? contextSize : 32, shape = contextShape !== null && contextShape !== void 0 ? contextShape : 'circular', active = 'unset', activeAppearance = 'ring', idForColor } = props;\n let { color = 'neutral' } = props;\n // Resolve 'colorful' to a specific color name\n if (color === 'colorful') {\n var _ref;\n color = avatarColors[getHashCode((_ref = idForColor !== null && idForColor !== void 0 ? idForColor : name) !== null && _ref !== void 0 ? _ref : '') % avatarColors.length];\n }\n const baseId = useId('avatar-');\n const root = slot.always(getNativeElementProps('span', {\n role: 'img',\n id: baseId,\n // aria-label and/or aria-labelledby are resolved below\n ...props,\n ref\n }, /* excludedPropNames: */ [\n 'name'\n ]), {\n elementType: 'span'\n });\n const [imageHidden, setImageHidden] = React.useState(undefined);\n let image = slot.optional(props.image, {\n defaultProps: {\n alt: '',\n role: 'presentation',\n 'aria-hidden': true,\n hidden: imageHidden\n },\n elementType: 'img'\n }); // Image shouldn't be rendered if its src is not set\n if (!(image === null || image === void 0 ? void 0 : image.src)) {\n image = undefined;\n } // Hide the image if it fails to load and restore it on a successful load\n if (image) {\n image.onError = mergeCallbacks(image.onError, ()=>setImageHidden(true));\n image.onLoad = mergeCallbacks(image.onLoad, ()=>setImageHidden(undefined));\n } // Resolve the initials slot, defaulted to getInitials.\n let initials = slot.optional(props.initials, {\n renderByDefault: true,\n defaultProps: {\n children: getInitials(name, dir === 'rtl', {\n firstInitialOnly: size <= 16\n }),\n id: baseId + '__initials'\n },\n elementType: 'span'\n }); // Don't render the initials slot if it's empty\n if (!(initials === null || initials === void 0 ? void 0 : initials.children)) {\n initials = undefined;\n } // Render the icon slot *only if* there aren't any initials or image to display\n let icon = undefined;\n if (!initials && (!image || imageHidden)) {\n icon = slot.optional(props.icon, {\n renderByDefault: true,\n defaultProps: {\n children: /*#__PURE__*/ React.createElement(PersonRegular, null),\n 'aria-hidden': true\n },\n elementType: 'span'\n });\n }\n const badge = slot.optional(props.badge, {\n defaultProps: {\n size: getBadgeSize(size),\n id: baseId + '__badge'\n },\n elementType: PresenceBadge\n });\n let activeAriaLabelElement; // Resolve aria-label and/or aria-labelledby if not provided by the user\n if (!root['aria-label'] && !root['aria-labelledby']) {\n if (name) {\n root['aria-label'] = name; // Include the badge in labelledby if it exists\n if (badge) {\n root['aria-labelledby'] = root.id + ' ' + badge.id;\n }\n } else if (initials) {\n // root's aria-label should be the name, but fall back to being labelledby the initials if name is missing\n root['aria-labelledby'] = initials.id + (badge ? ' ' + badge.id : '');\n } // Add the active state to the aria label\n if (active === 'active' || active === 'inactive') {\n const activeText = DEFAULT_STRINGS[active];\n if (root['aria-labelledby']) {\n // If using aria-labelledby, render a hidden span and append it to the labelledby\n const activeId = baseId + '__active';\n root['aria-labelledby'] += ' ' + activeId;\n activeAriaLabelElement = /*#__PURE__*/ React.createElement(\"span\", {\n hidden: true,\n id: activeId\n }, activeText);\n } else if (root['aria-label']) {\n // Otherwise, just append it to the aria-label\n root['aria-label'] += ' ' + activeText;\n }\n }\n }\n return {\n size,\n shape,\n active,\n activeAppearance,\n activeAriaLabelElement,\n color,\n components: {\n root: 'span',\n initials: 'span',\n icon: 'span',\n image: 'img',\n badge: PresenceBadge\n },\n root,\n initials,\n icon,\n image,\n badge\n };\n};\nconst getBadgeSize = (size)=>{\n if (size >= 96) {\n return 'extra-large';\n } else if (size >= 64) {\n return 'large';\n } else if (size >= 56) {\n return 'medium';\n } else if (size >= 40) {\n return 'small';\n } else if (size >= 28) {\n return 'extra-small';\n } else {\n return 'tiny';\n }\n};\nconst avatarColors = [\n 'dark-red',\n 'cranberry',\n 'red',\n 'pumpkin',\n 'peach',\n 'marigold',\n 'gold',\n 'brass',\n 'brown',\n 'forest',\n 'seafoam',\n 'dark-green',\n 'light-teal',\n 'teal',\n 'steel',\n 'blue',\n 'royal-blue',\n 'cornflower',\n 'navy',\n 'lavender',\n 'purple',\n 'grape',\n 'lilac',\n 'pink',\n 'magenta',\n 'plum',\n 'beige',\n 'mink',\n 'platinum',\n 'anchor'\n];\nconst getHashCode = (str)=>{\n let hashCode = 0;\n for(let len = str.length - 1; len >= 0; len--){\n const ch = str.charCodeAt(len);\n const shift = len % 8;\n hashCode ^= (ch << shift) + (ch >> 8 - shift); // eslint-disable-line no-bitwise\n }\n return hashCode;\n};\n"],"names":["DEFAULT_STRINGS","useAvatar_unstable","active","inactive","props","ref","dir","useFluent","shape","contextShape","size","contextSize","useAvatarContext","name","activeAppearance","idForColor","color","_ref","avatarColors","getHashCode","length","baseId","useId","root","slot","always","getNativeElementProps","role","id","elementType","imageHidden","setImageHidden","React","useState","undefined","image","optional","defaultProps","alt","hidden","src","onError","mergeCallbacks","onLoad","initials","renderByDefault","children","getInitials","firstInitialOnly","icon","createElement","PersonRegular","badge","getBadgeSize","PresenceBadge","activeAriaLabelElement","activeText","activeId","components","str","hashCode","len","ch","charCodeAt","shift"],"mappings":";;;;;;;;;;;IAOaA,eAAe;eAAfA;;IAIAC,kBAAkB;eAAlBA;;;;iEAXU;gCAC4C;uBACvC;4BACE;4BACA;qCACkB;+BACf;AAC1B,MAAMD,kBAAkB;IAC3BE,QAAQ;IACRC,UAAU;AACd;AACO,MAAMF,qBAAqB,CAACG,OAAOC;IACtC,MAAM,EAAEC,GAAG,EAAE,GAAGC,IAAAA,uCAAS;IACzB,MAAM,EAAEC,OAAOC,YAAY,EAAEC,MAAMC,WAAW,EAAE,GAAGC,IAAAA,+BAAgB;IACnE,MAAM,EAAEC,IAAI,EAAEH,OAAOC,gBAAgB,QAAQA,gBAAgB,KAAK,IAAIA,cAAc,EAAE,EAAEH,QAAQC,iBAAiB,QAAQA,iBAAiB,KAAK,IAAIA,eAAe,UAAU,EAAEP,SAAS,OAAO,EAAEY,mBAAmB,MAAM,EAAEC,UAA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CAAiC;IACpF;IACA,OAAOJ;AACX"}
@@ -27,8 +27,8 @@ const useAvatarGroupPopover_unstable = (props)=>{
27
27
  initialState: false
28
28
  });
29
29
  const handleOnPopoverChange = (e, data)=>{
30
- var _restOfProps_onOpenChange, _restOfProps;
31
- (_restOfProps_onOpenChange = (_restOfProps = restOfProps).onOpenChange) === null || _restOfProps_onOpenChange === void 0 ? void 0 : _restOfProps_onOpenChange.call(_restOfProps, e, data);
30
+ var _restOfProps_onOpenChange;
31
+ (_restOfProps_onOpenChange = restOfProps.onOpenChange) === null || _restOfProps_onOpenChange === void 0 ? void 0 : _restOfProps_onOpenChange.call(restOfProps, e, data);
32
32
  setPopoverOpen(data.open);
33
33
  };
34
34
  let triggerButtonChildren;
@@ -1 +1 @@
1
- {"version":3,"sources":["useAvatarGroupPopover.js"],"sourcesContent":["import * as React from 'react';\nimport { useAvatarGroupContext_unstable } from '../../contexts/AvatarGroupContext';\nimport { defaultAvatarGroupSize } from '../AvatarGroup/useAvatarGroup';\nimport { useControllableState, slot } from '@fluentui/react-utilities';\nimport { MoreHorizontalRegular } from '@fluentui/react-icons';\nimport { Popover, PopoverSurface } from '@fluentui/react-popover';\nimport { Tooltip } from '@fluentui/react-tooltip';\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 */ export const useAvatarGroupPopover_unstable = (props)=>{\n var _useAvatarGroupContext_unstable;\n const size = (_useAvatarGroupContext_unstable = useAvatarGroupContext_unstable((ctx)=>ctx.size)) !== null && _useAvatarGroupContext_unstable !== void 0 ? _useAvatarGroupContext_unstable : defaultAvatarGroupSize;\n const layout = useAvatarGroupContext_unstable((ctx)=>ctx.layout);\n const { indicator = size < 24 ? 'icon' : 'count', count = React.Children.count(props.children), children, ...restOfProps } = props;\n const [popoverOpen, setPopoverOpen] = useControllableState({\n state: props.open,\n defaultState: props.defaultOpen,\n initialState: false\n });\n const handleOnPopoverChange = (e, data)=>{\n var _restOfProps_onOpenChange, _restOfProps;\n (_restOfProps_onOpenChange = (_restOfProps = restOfProps).onOpenChange) === null || _restOfProps_onOpenChange === void 0 ? void 0 : _restOfProps_onOpenChange.call(_restOfProps, e, data);\n setPopoverOpen(data.open);\n };\n let triggerButtonChildren;\n if (layout === 'pie') {\n triggerButtonChildren = null;\n } else if (indicator === 'icon') {\n triggerButtonChildren = /*#__PURE__*/ React.createElement(MoreHorizontalRegular, null);\n } else {\n triggerButtonChildren = count > 99 ? '99+' : `+${count}`;\n }\n return {\n count,\n indicator,\n layout,\n popoverOpen,\n size,\n components: {\n root: Popover,\n triggerButton: 'button',\n content: 'ul',\n popoverSurface: PopoverSurface,\n tooltip: Tooltip\n },\n root: slot.always({\n // Popover expects a child for its children. The children are added in the renderAvatarGroupPopover.\n children: /*#__PURE__*/ React.createElement(React.Fragment, null),\n size: 'small',\n trapFocus: true,\n ...restOfProps,\n open: popoverOpen,\n onOpenChange: handleOnPopoverChange\n }, {\n elementType: Popover\n }),\n triggerButton: slot.always(props.triggerButton, {\n defaultProps: {\n children: triggerButtonChildren,\n type: 'button'\n },\n elementType: 'button'\n }),\n content: slot.always(props.content, {\n defaultProps: {\n children,\n role: 'list'\n },\n elementType: 'ul'\n }),\n popoverSurface: slot.always(props.popoverSurface, {\n defaultProps: {\n 'aria-label': 'Overflow',\n tabIndex: 0\n },\n elementType: PopoverSurface\n }),\n tooltip: slot.always(props.tooltip, {\n defaultProps: {\n content: 'View more people.',\n relationship: 'label'\n },\n elementType: Tooltip\n })\n };\n};\n"],"names":["useAvatarGroupPopover_unstable","props","_useAvatarGroupContext_unstable","size","useAvatarGroupContext_unstable","ctx","defaultAvatarGroupSize","layout","indicator","count","React","Children","children","restOfProps","popoverOpen","setPopoverOpen","useControllableState","state","open","defaultState","defaultOpen","initialState","handleOnPopoverChange","e","data","_restOfProps_onOpenChange","_restOfProps","onOpenChange","call","triggerButtonChildren","createElement","MoreHorizontalRegular","components","root","Popover","triggerButton","content","popoverSurface","PopoverSurface","tooltip","Tooltip","slot","always","Fragment","trapFocus","elementType","defaultProps","type","role","tabIndex","relationship"],"mappings":";;;;+BAciBA;;;eAAAA;;;;iEAdM;oCACwB;gCACR;gCACI;4BACL;8BACE;8BAChB;AAQb,MAAMA,iCAAiC,CAACC;IAC/C,IAAIC;IACJ,MAAMC,OAAO,AAACD,CAAAA,kCAAkCE,IAAAA,kDAA8B,EAAC,CAACC,MAAMA,IAAIF,IAAI,CAAA,MAAO,QAAQD,oCAAoC,KAAK,IAAIA,kCAAkCI,sCAAsB;IAClN,MAAMC,SAASH,IAAAA,kDAA8B,EAAC,CAACC,MAAMA,IAAIE,MAAM;IAC/D,MAAM,EAAEC,YAAYL,OAAO,KAAK,SAAS,OAAO,EAAEM,QAAQC,OAAMC,QAAQ,CAACF,KAAK,CAACR,MAAMW,QAAQ,CAAC,EAAEA,QAAQ,EAAE,GAAGC,aAAa,GAAGZ;IAC7H,MAAM,CAACa,aAAaC,eAAe,GAAGC,IAAAA,oCAAoB,EAAC;QACvDC,OAAOhB,MAAMiB,IAAI;QACjBC,cAAclB,MAAMmB,WAAW;QAC/BC,cAAc;IAClB;IACA,MAAMC,wBAAwB,CAACC,GAAGC;QAC9B,IAAIC,2BAA2BC;QAC9BD,CAAAA,4BAA4B,AAACC,CAAAA,eAAeb,WAAU,EAAGc,YAAY,AAAD,MAAO,QAAQF,8BAA8B,KAAK,IAAI,KAAK,IAAIA,0BAA0BG,IAAI,CAACF,cAAcH,GAAGC;QACpLT,eAAeS,KAAKN,IAAI;IAC5B;IACA,IAAIW;IACJ,IAAItB,WAAW,OAAO;QAClBsB,wBAAwB;IAC5B,OAAO,IAAIrB,cAAc,QAAQ;QAC7BqB,wBAAwB,WAAW,GAAGnB,OAAMoB,aAAa,CAACC,iCAAqB,EAAE;IACrF,OAAO;QACHF,wBAAwBpB,QAAQ,KAAK,QAAQ,CAAC,CAAC,EAAEA,MAAM,CAAC;IAC5D;IACA,OAAO;QACHA;QACAD;QACAD;QACAO;QACAX;QACA6B,YAAY;YACRC,MAAMC,qBAAO;YACbC,eAAe;YACfC,SAAS;YACTC,gBAAgBC,4BAAc;YAC9BC,SAASC,qBAAO;QACpB;QACAP,MAAMQ,oBAAI,CAACC,MAAM,CAAC;YACd,oGAAoG;YACpG9B,UAAU,WAAW,GAAGF,OAAMoB,aAAa,CAACpB,OAAMiC,QAAQ,EAAE;YAC5DxC,MAAM;YACNyC,WAAW;YACX,GAAG/B,WAAW;YACdK,MAAMJ;YACNa,cAAcL;QAClB,GAAG;YACCuB,aAAaX,qBAAO;QACxB;QACAC,eAAeM,oBAAI,CAACC,MAAM,CAACzC,MAAMkC,aAAa,EAAE;YAC5CW,cAAc;gBACVlC,UAAUiB;gBACVkB,MAAM;YACV;YACAF,aAAa;QACjB;QACAT,SAASK,oBAAI,CAACC,MAAM,CAACzC,MAAMmC,OAAO,EAAE;YAChCU,cAAc;gBACVlC;gBACAoC,MAAM;YACV;YACAH,aAAa;QACjB;QACAR,gBAAgBI,oBAAI,CAACC,MAAM,CAACzC,MAAMoC,cAAc,EAAE;YAC9CS,cAAc;gBACV,cAAc;gBACdG,UAAU;YACd;YACAJ,aAAaP,4BAAc;QAC/B;QACAC,SAASE,oBAAI,CAACC,MAAM,CAACzC,MAAMsC,OAAO,EAAE;YAChCO,cAAc;gBACVV,SAAS;gBACTc,cAAc;YAClB;YACAL,aAAaL,qBAAO;QACxB;IACJ;AACJ"}
1
+ {"version":3,"sources":["useAvatarGroupPopover.js"],"sourcesContent":["import * as React from 'react';\nimport { useAvatarGroupContext_unstable } from '../../contexts/AvatarGroupContext';\nimport { defaultAvatarGroupSize } from '../AvatarGroup/useAvatarGroup';\nimport { useControllableState, slot } from '@fluentui/react-utilities';\nimport { MoreHorizontalRegular } from '@fluentui/react-icons';\nimport { Popover, PopoverSurface } from '@fluentui/react-popover';\nimport { Tooltip } from '@fluentui/react-tooltip';\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 */ export const useAvatarGroupPopover_unstable = (props)=>{\n var _useAvatarGroupContext_unstable;\n const size = (_useAvatarGroupContext_unstable = useAvatarGroupContext_unstable((ctx)=>ctx.size)) !== null && _useAvatarGroupContext_unstable !== void 0 ? _useAvatarGroupContext_unstable : defaultAvatarGroupSize;\n const layout = useAvatarGroupContext_unstable((ctx)=>ctx.layout);\n const { indicator = size < 24 ? 'icon' : 'count', count = React.Children.count(props.children), children, ...restOfProps } = props;\n const [popoverOpen, setPopoverOpen] = useControllableState({\n state: props.open,\n defaultState: props.defaultOpen,\n initialState: false\n });\n const handleOnPopoverChange = (e, data)=>{\n var _restOfProps_onOpenChange;\n (_restOfProps_onOpenChange = restOfProps.onOpenChange) === null || _restOfProps_onOpenChange === void 0 ? void 0 : _restOfProps_onOpenChange.call(restOfProps, e, data);\n setPopoverOpen(data.open);\n };\n let triggerButtonChildren;\n if (layout === 'pie') {\n triggerButtonChildren = null;\n } else if (indicator === 'icon') {\n triggerButtonChildren = /*#__PURE__*/ React.createElement(MoreHorizontalRegular, null);\n } else {\n triggerButtonChildren = count > 99 ? '99+' : `+${count}`;\n }\n return {\n count,\n indicator,\n layout,\n popoverOpen,\n size,\n components: {\n root: Popover,\n triggerButton: 'button',\n content: 'ul',\n popoverSurface: PopoverSurface,\n tooltip: Tooltip\n },\n root: slot.always({\n // Popover expects a child for its children. The children are added in the renderAvatarGroupPopover.\n children: /*#__PURE__*/ React.createElement(React.Fragment, null),\n size: 'small',\n trapFocus: true,\n ...restOfProps,\n open: popoverOpen,\n onOpenChange: handleOnPopoverChange\n }, {\n elementType: Popover\n }),\n triggerButton: slot.always(props.triggerButton, {\n defaultProps: {\n children: triggerButtonChildren,\n type: 'button'\n },\n elementType: 'button'\n }),\n content: slot.always(props.content, {\n defaultProps: {\n children,\n role: 'list'\n },\n elementType: 'ul'\n }),\n popoverSurface: slot.always(props.popoverSurface, {\n defaultProps: {\n 'aria-label': 'Overflow',\n tabIndex: 0\n },\n elementType: PopoverSurface\n }),\n tooltip: slot.always(props.tooltip, {\n defaultProps: {\n content: 'View more people.',\n relationship: 'label'\n },\n elementType: Tooltip\n })\n };\n};\n"],"names":["useAvatarGroupPopover_unstable","props","_useAvatarGroupContext_unstable","size","useAvatarGroupContext_unstable","ctx","defaultAvatarGroupSize","layout","indicator","count","React","Children","children","restOfProps","popoverOpen","setPopoverOpen","useControllableState","state","open","defaultState","defaultOpen","initialState","handleOnPopoverChange","e","data","_restOfProps_onOpenChange","onOpenChange","call","triggerButtonChildren","createElement","MoreHorizontalRegular","components","root","Popover","triggerButton","content","popoverSurface","PopoverSurface","tooltip","Tooltip","slot","always","Fragment","trapFocus","elementType","defaultProps","type","role","tabIndex","relationship"],"mappings":";;;;+BAciBA;;;eAAAA;;;;iEAdM;oCACwB;gCACR;gCACI;4BACL;8BACE;8BAChB;AAQb,MAAMA,iCAAiC,CAACC;IAC/C,IAAIC;IACJ,MAAMC,OAAO,AAACD,CAAAA,kCAAkCE,IAAAA,kDAA8B,EAAC,CAACC,MAAMA,IAAIF,IAAI,CAAA,MAAO,QAAQD,oCAAoC,KAAK,IAAIA,kCAAkCI,sCAAsB;IAClN,MAAMC,SAASH,IAAAA,kDAA8B,EAAC,CAACC,MAAMA,IAAIE,MAAM;IAC/D,MAAM,EAAEC,YAAYL,OAAO,KAAK,SAAS,OAAO,EAAEM,QAAQC,OAAMC,QAAQ,CAACF,KAAK,CAACR,MAAMW,QAAQ,CAAC,EAAEA,QAAQ,EAAE,GAAGC,aAAa,GAAGZ;IAC7H,MAAM,CAACa,aAAaC,eAAe,GAAGC,IAAAA,oCAAoB,EAAC;QACvDC,OAAOhB,MAAMiB,IAAI;QACjBC,cAAclB,MAAMmB,WAAW;QAC/BC,cAAc;IAClB;IACA,MAAMC,wBAAwB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,MAAM,CAACxC,MAAMqC,OAAO,EAAE;YAChCO,cAAc;gBACVV,SAAS;gBACTc,cAAc;YAClB;YACAL,aAAaL,qBAAO;QACxB;IACJ;AACJ"}
@@ -21,5 +21,7 @@ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
21
21
  const avatarContext = /*#__PURE__*/ _react.createContext(undefined);
22
22
  const avatarContextDefaultValue = {};
23
23
  const AvatarContextProvider = avatarContext.Provider;
24
- var _React_useContext;
25
- const useAvatarContext = ()=>(_React_useContext = _react.useContext(avatarContext)) !== null && _React_useContext !== void 0 ? _React_useContext : avatarContextDefaultValue;
24
+ const useAvatarContext = ()=>{
25
+ var _React_useContext;
26
+ return (_React_useContext = _react.useContext(avatarContext)) !== null && _React_useContext !== void 0 ? _React_useContext : avatarContextDefaultValue;
27
+ };
@@ -1 +1 @@
1
- {"version":3,"sources":["AvatarContext.js"],"sourcesContent":["import * as React from 'react';\nconst avatarContext = React.createContext(undefined);\nconst avatarContextDefaultValue = {};\n/**\n * @internal\n */ export const AvatarContextProvider = avatarContext.Provider;\nvar _React_useContext;\n/**\n * @internal\n */ export const useAvatarContext = ()=>(_React_useContext = React.useContext(avatarContext)) !== null && _React_useContext !== void 0 ? _React_useContext : avatarContextDefaultValue;\n"],"names":["AvatarContextProvider","useAvatarContext","avatarContext","React","createContext","undefined","avatarContextDefaultValue","Provider","_React_useContext","useContext"],"mappings":";;;;;;;;;;;IAKiBA,qBAAqB;eAArBA;;IAIAC,gBAAgB;eAAhBA;;;;iEATM;AACvB,MAAMC,8BAAgBC,OAAMC,aAAa,CAACC;AAC1C,MAAMC,4BAA4B,CAAC;AAGxB,MAAMN,wBAAwBE,cAAcK,QAAQ;AAC/D,IAAIC;AAGO,MAAMP,mBAAmB,IAAI,AAACO,CAAAA,oBAAoBL,OAAMM,UAAU,CAACP,cAAa,MAAO,QAAQM,sBAAsB,KAAK,IAAIA,oBAAoBF"}
1
+ {"version":3,"sources":["AvatarContext.js"],"sourcesContent":["import * as React from 'react';\nconst avatarContext = React.createContext(undefined);\nconst avatarContextDefaultValue = {};\n/**\n * @internal\n */ export const AvatarContextProvider = avatarContext.Provider;\n/**\n * @internal\n */ export const useAvatarContext = ()=>{\n var _React_useContext;\n return (_React_useContext = React.useContext(avatarContext)) !== null && _React_useContext !== void 0 ? _React_useContext : avatarContextDefaultValue;\n};\n"],"names":["AvatarContextProvider","useAvatarContext","avatarContext","React","createContext","undefined","avatarContextDefaultValue","Provider","_React_useContext","useContext"],"mappings":";;;;;;;;;;;IAKiBA,qBAAqB;eAArBA;;IAGAC,gBAAgB;eAAhBA;;;;iEARM;AACvB,MAAMC,8BAAgBC,OAAMC,aAAa,CAACC;AAC1C,MAAMC,4BAA4B,CAAC;AAGxB,MAAMN,wBAAwBE,cAAcK,QAAQ;AAGpD,MAAMN,mBAAmB;IAChC,IAAIO;IACJ,OAAO,AAACA,CAAAA,oBAAoBL,OAAMM,UAAU,CAACP,cAAa,MAAO,QAAQM,sBAAsB,KAAK,IAAIA,oBAAoBF;AAChI"}
@@ -57,14 +57,13 @@ function cleanupDisplayName(displayName) {
57
57
  return displayName;
58
58
  }
59
59
  function getInitials(displayName, isRtl, options) {
60
- var _options, _options1;
61
60
  if (!displayName) {
62
61
  return '';
63
62
  }
64
63
  displayName = cleanupDisplayName(displayName);
65
64
  // For names containing CJK characters, and phone numbers, we don't display initials
66
- if (UNSUPPORTED_TEXT_REGEX.test(displayName) || !((_options = options) === null || _options === void 0 ? void 0 : _options.allowPhoneInitials) && PHONENUMBER_REGEX.test(displayName)) {
65
+ if (UNSUPPORTED_TEXT_REGEX.test(displayName) || !(options === null || options === void 0 ? void 0 : options.allowPhoneInitials) && PHONENUMBER_REGEX.test(displayName)) {
67
66
  return '';
68
67
  }
69
- return getInitialsLatin(displayName, isRtl, (_options1 = options) === null || _options1 === void 0 ? void 0 : _options1.firstInitialOnly);
68
+ return getInitialsLatin(displayName, isRtl, options === null || options === void 0 ? void 0 : options.firstInitialOnly);
70
69
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["getInitials.js"],"sourcesContent":["/**\n * Regular expressions matching characters to ignore when calculating the initials.\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 */ const UNWANTED_ENCLOSURES_REGEX = /[\\(\\[\\{][^\\)\\]\\}]*[\\)\\]\\}]/g;\n/**\n * Regular expression matching special ASCII characters except space, plus some unicode special characters.\n * Applies after unwanted enclosures have been removed\n */ const UNWANTED_CHARS_REGEX = /[\\0-\\u001F\\!-/:-@\\[-`\\{-\\u00BF\\u0250-\\u036F\\uD800-\\uFFFF]/g;\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 */ const PHONENUMBER_REGEX = /^\\d+[\\d\\s]*(:?ext|x|)\\s*\\d+$/i;\n/** Regular expression matching one or more spaces. */ const MULTIPLE_WHITESPACES_REGEX = /\\s+/g;\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 */ const 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]/;\nfunction getInitialsLatin(displayName, isRtl, firstInitialOnly) {\n let initials = '';\n const splits = displayName.split(' ');\n if (splits.length !== 0) {\n initials += splits[0].charAt(0).toUpperCase();\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 if (isRtl && initials.length > 1) {\n return initials.charAt(1) + initials.charAt(0);\n }\n return initials;\n}\nfunction cleanupDisplayName(displayName) {\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 return displayName;\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 */ export function getInitials(displayName, isRtl, options) {\n var _options, _options1;\n if (!displayName) {\n return '';\n }\n displayName = cleanupDisplayName(displayName);\n // For names containing CJK characters, and phone numbers, we don't display initials\n if (UNSUPPORTED_TEXT_REGEX.test(displayName) || !((_options = options) === null || _options === void 0 ? void 0 : _options.allowPhoneInitials) && PHONENUMBER_REGEX.test(displayName)) {\n return '';\n }\n return getInitialsLatin(displayName, isRtl, (_options1 = options) === null || _options1 === void 0 ? void 0 : _options1.firstInitialOnly);\n}\n"],"names":["getInitials","UNWANTED_ENCLOSURES_REGEX","UNWANTED_CHARS_REGEX","PHONENUMBER_REGEX","MULTIPLE_WHITESPACES_REGEX","UNSUPPORTED_TEXT_REGEX","getInitialsLatin","displayName","isRtl","firstInitialOnly","initials","splits","split","length","charAt","toUpperCase","cleanupDisplayName","replace","trim","options","_options","_options1","test","allowPhoneInitials"],"mappings":"AAAA;;CAEC,GAAG;;;CAGH;;;;+BAsDmBA;;;eAAAA;;;AAtDhB,MAAMC,4BAA4B;AACtC;;;CAGC,GAAG,MAAMC,uBAAuB;AACjC;;;CAGC,GAAG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c;QACnL,OAAO;IACX;IACA,OAAOD,iBAAiBC,aAAaC,OAAO,AAACa,CAAAA,YAAYF,OAAM,MAAO,QAAQE,cAAc,KAAK,IAAI,KAAK,IAAIA,UAAUZ,gBAAgB;AAC5I"}
1
+ {"version":3,"sources":["getInitials.js"],"sourcesContent":["/**\n * Regular expressions matching characters to ignore when calculating the initials.\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 */ const UNWANTED_ENCLOSURES_REGEX = /[\\(\\[\\{][^\\)\\]\\}]*[\\)\\]\\}]/g;\n/**\n * Regular expression matching special ASCII characters except space, plus some unicode special characters.\n * Applies after unwanted enclosures have been removed\n */ const UNWANTED_CHARS_REGEX = /[\\0-\\u001F\\!-/:-@\\[-`\\{-\\u00BF\\u0250-\\u036F\\uD800-\\uFFFF]/g;\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 */ const PHONENUMBER_REGEX = /^\\d+[\\d\\s]*(:?ext|x|)\\s*\\d+$/i;\n/** Regular expression matching one or more spaces. */ const MULTIPLE_WHITESPACES_REGEX = /\\s+/g;\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 */ const 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]/;\nfunction getInitialsLatin(displayName, isRtl, firstInitialOnly) {\n let initials = '';\n const splits = displayName.split(' ');\n if (splits.length !== 0) {\n initials += splits[0].charAt(0).toUpperCase();\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 if (isRtl && initials.length > 1) {\n return initials.charAt(1) + initials.charAt(0);\n }\n return initials;\n}\nfunction cleanupDisplayName(displayName) {\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 return displayName;\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 */ export function getInitials(displayName, isRtl, options) {\n if (!displayName) {\n return '';\n }\n displayName = cleanupDisplayName(displayName);\n // For names containing CJK characters, and phone numbers, we don't display initials\n if (UNSUPPORTED_TEXT_REGEX.test(displayName) || !(options === null || options === void 0 ? void 0 : options.allowPhoneInitials) && PHONENUMBER_REGEX.test(displayName)) {\n return '';\n }\n return getInitialsLatin(displayName, isRtl, options === null || options === void 0 ? void 0 : options.firstInitialOnly);\n}\n"],"names":["getInitials","UNWANTED_ENCLOSURES_REGEX","UNWANTED_CHARS_REGEX","PHONENUMBER_REGEX","MULTIPLE_WHITESPACES_REGEX","UNSUPPORTED_TEXT_REGEX","getInitialsLatin","displayName","isRtl","firstInitialOnly","initials","splits","split","length","charAt","toUpperCase","cleanupDisplayName","replace","trim","options","test","allowPhoneInitials"],"mappings":"AAAA;;CAEC,GAAG;;;CAGH;;;;+BAsDm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QE,kBAAkB,AAAD,KAAMlB,kBAAkBiB,IAAI,CAACb,cAAc;QACpK,OAAO;IACX;IACA,OAAOD,iBAAiBC,aAAaC,OAAOW,YAAY,QAAQA,YAAY,KAAK,IAAI,KAAK,IAAIA,QAAQV,gBAAgB;AAC1H"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-avatar",
3
- "version": "9.5.32",
3
+ "version": "9.5.34",
4
4
  "description": "React components for building Microsoft web experiences.",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -37,16 +37,16 @@
37
37
  "@fluentui/scripts-tasks": "*"
38
38
  },
39
39
  "dependencies": {
40
- "@fluentui/react-badge": "^9.2.1",
41
- "@fluentui/react-context-selector": "^9.1.34",
42
- "@fluentui/react-icons": "^2.0.207",
43
- "@fluentui/react-popover": "^9.8.7",
44
- "@fluentui/react-shared-contexts": "^9.8.1",
45
- "@fluentui/react-tabster": "^9.12.11",
46
- "@fluentui/react-theme": "^9.1.12",
47
- "@fluentui/react-tooltip": "^9.3.8",
48
- "@fluentui/react-utilities": "^9.13.3",
49
- "@fluentui/react-jsx-runtime": "^9.0.10",
40
+ "@fluentui/react-badge": "^9.2.3",
41
+ "@fluentui/react-context-selector": "^9.1.36",
42
+ "@fluentui/react-icons": "^2.0.217",
43
+ "@fluentui/react-popover": "^9.8.9",
44
+ "@fluentui/react-shared-contexts": "^9.9.1",
45
+ "@fluentui/react-tabster": "^9.13.1",
46
+ "@fluentui/react-theme": "^9.1.14",
47
+ "@fluentui/react-tooltip": "^9.3.10",
48
+ "@fluentui/react-utilities": "^9.13.5",
49
+ "@fluentui/react-jsx-runtime": "^9.0.12",
50
50
  "@griffel/react": "^1.5.14",
51
51
  "@swc/helpers": "^0.5.1"
52
52
  },