@fluentui/react-avatar 9.2.5 → 9.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +155 -1
- package/CHANGELOG.md +38 -2
- package/README-AvatarGroup.md +0 -10
- package/dist/index.d.ts +35 -4
- package/lib/components/Avatar/useAvatarStyles.js +83 -87
- package/lib/components/Avatar/useAvatarStyles.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib-amd/Avatar.js +6 -0
- package/lib-amd/Avatar.js.map +1 -0
- package/lib-amd/AvatarGroup.js +6 -0
- package/lib-amd/AvatarGroup.js.map +1 -0
- package/lib-amd/AvatarGroupItem.js +6 -0
- package/lib-amd/AvatarGroupItem.js.map +1 -0
- package/lib-amd/AvatarGroupPopover.js +6 -0
- package/lib-amd/AvatarGroupPopover.js.map +1 -0
- package/lib-amd/components/Avatar/Avatar.js +12 -0
- package/lib-amd/components/Avatar/Avatar.js.map +1 -0
- package/lib-amd/components/Avatar/Avatar.types.js +5 -0
- package/lib-amd/components/Avatar/Avatar.types.js.map +1 -0
- package/lib-amd/components/Avatar/index.js +10 -0
- package/lib-amd/components/Avatar/index.js.map +1 -0
- package/lib-amd/components/Avatar/renderAvatar.js +16 -0
- package/lib-amd/components/Avatar/renderAvatar.js.map +1 -0
- package/lib-amd/components/Avatar/useAvatar.js +175 -0
- package/lib-amd/components/Avatar/useAvatar.js.map +1 -0
- package/lib-amd/components/Avatar/useAvatarStyles.js +390 -0
- package/lib-amd/components/Avatar/useAvatarStyles.js.map +1 -0
- package/lib-amd/components/AvatarGroup/AvatarGroup.js +17 -0
- package/lib-amd/components/AvatarGroup/AvatarGroup.js.map +1 -0
- package/lib-amd/components/AvatarGroup/AvatarGroup.types.js +5 -0
- package/lib-amd/components/AvatarGroup/AvatarGroup.types.js.map +1 -0
- package/lib-amd/components/AvatarGroup/index.js +11 -0
- package/lib-amd/components/AvatarGroup/index.js.map +1 -0
- package/lib-amd/components/AvatarGroup/renderAvatarGroup.js +15 -0
- package/lib-amd/components/AvatarGroup/renderAvatarGroup.js.map +1 -0
- package/lib-amd/components/AvatarGroup/useAvatarGroup.js +29 -0
- package/lib-amd/components/AvatarGroup/useAvatarGroup.js.map +1 -0
- package/lib-amd/components/AvatarGroup/useAvatarGroupContextValues.js +15 -0
- package/lib-amd/components/AvatarGroup/useAvatarGroupContextValues.js.map +1 -0
- package/lib-amd/components/AvatarGroup/useAvatarGroupStyles.js +36 -0
- package/lib-amd/components/AvatarGroup/useAvatarGroupStyles.js.map +1 -0
- package/lib-amd/components/AvatarGroupItem/AvatarGroupItem.js +16 -0
- package/lib-amd/components/AvatarGroupItem/AvatarGroupItem.js.map +1 -0
- package/lib-amd/components/AvatarGroupItem/AvatarGroupItem.types.js +5 -0
- package/lib-amd/components/AvatarGroupItem/AvatarGroupItem.types.js.map +1 -0
- package/lib-amd/components/AvatarGroupItem/index.js +10 -0
- package/lib-amd/components/AvatarGroupItem/index.js.map +1 -0
- package/lib-amd/components/AvatarGroupItem/renderAvatarGroupItem.js +16 -0
- package/lib-amd/components/AvatarGroupItem/renderAvatarGroupItem.js.map +1 -0
- package/lib-amd/components/AvatarGroupItem/useAvatarGroupItem.js +58 -0
- package/lib-amd/components/AvatarGroupItem/useAvatarGroupItem.js.map +1 -0
- package/lib-amd/components/AvatarGroupItem/useAvatarGroupItemStyles.js +206 -0
- package/lib-amd/components/AvatarGroupItem/useAvatarGroupItemStyles.js.map +1 -0
- package/lib-amd/components/AvatarGroupPopover/AvatarGroupPopover.js +17 -0
- package/lib-amd/components/AvatarGroupPopover/AvatarGroupPopover.js.map +1 -0
- package/lib-amd/components/AvatarGroupPopover/AvatarGroupPopover.types.js +5 -0
- package/lib-amd/components/AvatarGroupPopover/AvatarGroupPopover.types.js.map +1 -0
- package/lib-amd/components/AvatarGroupPopover/index.js +10 -0
- package/lib-amd/components/AvatarGroupPopover/index.js.map +1 -0
- package/lib-amd/components/AvatarGroupPopover/renderAvatarGroupPopover.js +20 -0
- package/lib-amd/components/AvatarGroupPopover/renderAvatarGroupPopover.js.map +1 -0
- package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopover.js +86 -0
- package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopover.js.map +1 -0
- package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js +14 -0
- package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js.map +1 -0
- package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.js +136 -0
- package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.js.map +1 -0
- package/lib-amd/contexts/AvatarContext.js +17 -0
- package/lib-amd/contexts/AvatarContext.js.map +1 -0
- package/lib-amd/contexts/AvatarGroupContext.js +20 -0
- package/lib-amd/contexts/AvatarGroupContext.js.map +1 -0
- package/lib-amd/contexts/index.js +7 -0
- package/lib-amd/contexts/index.js.map +1 -0
- package/lib-amd/index.js +33 -0
- package/lib-amd/index.js.map +1 -0
- package/lib-amd/utils/getInitials.js +87 -0
- package/lib-amd/utils/getInitials.js.map +1 -0
- package/lib-amd/utils/index.js +8 -0
- package/lib-amd/utils/index.js.map +1 -0
- package/lib-amd/utils/partitionAvatarGroupItems.js +32 -0
- package/lib-amd/utils/partitionAvatarGroupItems.js.map +1 -0
- package/lib-commonjs/components/Avatar/useAvatarStyles.js +83 -87
- package/lib-commonjs/components/Avatar/useAvatarStyles.js.map +1 -1
- package/lib-commonjs/index.js +9 -9
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +14 -13
- package/MIGRATION.md +0 -106
- package/SPEC-AvatarGroup.md +0 -203
- package/SPEC.md +0 -172
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-avatar/src/index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,QAAA,gBAAA,OAAA,CAAA,UAAA,CAAA;;AACE,MAAA,CAAA,cAAA,CAAA,O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,CAAA,OAAA,EAAA,sCAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,oBAAA,CAAA,oCAAA;EAAoC;AAApC,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,gCAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,oBAAA,CAAA,8BAAA;EAA8B;AAA9B,CAAA;;AAGF,IAAA,OAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACE,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,uBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,OAAA,CAAA,qBAAA;EAAqB;AAArB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,qBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,OAAA,CAAA,mBAAA;EAAmB;AAAnB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,kBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,OAAA,CAAA,gBAAA;EAAgB;AAAhB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,gCAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,OAAA,CAAA,8BAAA;EAA8B;AAA9B,CAAA","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"],"sourceRoot":"../src/"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-avatar",
|
|
3
|
-
"version": "9.2.
|
|
3
|
+
"version": "9.2.7",
|
|
4
4
|
"description": "React components for building Microsoft web experiences.",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
7
|
-
"typings": "dist/index.d.ts",
|
|
7
|
+
"typings": "./dist/index.d.ts",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -29,20 +29,20 @@
|
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@fluentui/eslint-plugin": "*",
|
|
31
31
|
"@fluentui/react-conformance": "*",
|
|
32
|
-
"@fluentui/react-conformance-griffel": "9.0.0-beta.
|
|
32
|
+
"@fluentui/react-conformance-griffel": "9.0.0-beta.18",
|
|
33
33
|
"@fluentui/scripts": "^1.0.0",
|
|
34
34
|
"es6-weak-map": "^2.0.2"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@fluentui/react-badge": "^9.0.
|
|
38
|
-
"@fluentui/react-context-selector": "^9.1.
|
|
37
|
+
"@fluentui/react-badge": "^9.0.13",
|
|
38
|
+
"@fluentui/react-context-selector": "^9.1.2",
|
|
39
39
|
"@fluentui/react-icons": "^2.0.175",
|
|
40
|
-
"@fluentui/react-popover": "^9.3.
|
|
41
|
-
"@fluentui/react-shared-contexts": "^9.1.
|
|
42
|
-
"@fluentui/react-tabster": "^9.
|
|
43
|
-
"@fluentui/react-theme": "^9.1.
|
|
44
|
-
"@fluentui/react-tooltip": "^9.1.
|
|
45
|
-
"@fluentui/react-utilities": "^9.2.
|
|
40
|
+
"@fluentui/react-popover": "^9.3.2",
|
|
41
|
+
"@fluentui/react-shared-contexts": "^9.1.1",
|
|
42
|
+
"@fluentui/react-tabster": "^9.3.1",
|
|
43
|
+
"@fluentui/react-theme": "^9.1.2",
|
|
44
|
+
"@fluentui/react-tooltip": "^9.1.2",
|
|
45
|
+
"@fluentui/react-utilities": "^9.2.2",
|
|
46
46
|
"@griffel/react": "^1.4.2",
|
|
47
47
|
"tslib": "^2.1.0"
|
|
48
48
|
},
|
|
@@ -61,9 +61,10 @@
|
|
|
61
61
|
},
|
|
62
62
|
"exports": {
|
|
63
63
|
".": {
|
|
64
|
-
"types": "./
|
|
64
|
+
"types": "./dist/index.d.ts",
|
|
65
65
|
"import": "./lib/index.js",
|
|
66
66
|
"require": "./lib-commonjs/index.js"
|
|
67
|
-
}
|
|
67
|
+
},
|
|
68
|
+
"./package.json": "./package.json"
|
|
68
69
|
}
|
|
69
70
|
}
|
package/MIGRATION.md
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
# Avatar Migration
|
|
2
|
-
|
|
3
|
-
## Migration from v8
|
|
4
|
-
|
|
5
|
-
The existing `Persona` control supports many more props than the `Avatar` control: notably the extra display text to the side of the image. As such, Avatar is only a direct replacement for `Persona` in cases where it was only being used to display the image (`hidePersonaDetails` is true). To fully replace `Persona`, `Avatar` needs to be used in conjunction with another component that displays additional content.
|
|
6
|
-
|
|
7
|
-
In cases where migration is possible, the following props will need to be renamed:
|
|
8
|
-
|
|
9
|
-
- `text` => `name`
|
|
10
|
-
- `size` converted from an enum to a number, and not all previous sizes are supported:
|
|
11
|
-
- `PersonaSize.size8` => Not Supported. Use the `PresenceBadge` component since this size of Persona only displays the badge.
|
|
12
|
-
- `PersonaSize.size16` => Not Supported. Use `size={20}`, and optionally add `style={{ width: '16px', height: '16px' }}` if the exact size is needed.
|
|
13
|
-
- `PersonaSize.size24` => `size={24}`
|
|
14
|
-
- `PersonaSize.size28` => `size={28}`
|
|
15
|
-
- `PersonaSize.size32` => `size={32}`
|
|
16
|
-
- `PersonaSize.size40` => `size={40}`
|
|
17
|
-
- `PersonaSize.size48` => `size={48}`
|
|
18
|
-
- `PersonaSize.size56` => `size={56}`
|
|
19
|
-
- `PersonaSize.size72` => `size={72}`
|
|
20
|
-
- `PersonaSize.size100` => Not Supported. Use `size={96}`, and optionally add `style={{ width: '100px', height: '100px' }}` if the exact size is needed.
|
|
21
|
-
- `PersonaSize.size120` => `size={120}`
|
|
22
|
-
- `coinSize` => Use `size`
|
|
23
|
-
- `imageUrl` => `image={{ src: '...' }}`
|
|
24
|
-
- `imageAlt` => The Avatar's `aria-label` can be used.
|
|
25
|
-
- `imageInitials` => `initials`
|
|
26
|
-
- `presence` => `badge` (see the `PresenceBadge` component for more details)
|
|
27
|
-
- `PersonaPresence.none` => (Default)
|
|
28
|
-
- `PersonaPresence.away` => `badge={{ status: 'away' }}`
|
|
29
|
-
- `PersonaPresence.blocked` => Not Supported.
|
|
30
|
-
- `PersonaPresence.busy` => `badge={{ status: 'busy' }}`
|
|
31
|
-
- `PersonaPresence.dnd` => `badge={{ status: 'doNotDisturb' }}`
|
|
32
|
-
- `PersonaPresence.offline` => `badge={{ status: 'offline' }}`
|
|
33
|
-
- `PersonaPresence.online` => `badge={{ status: 'available' }}`
|
|
34
|
-
- `presenceColors` => Not Supported. However, the badge can be styled using CSS. E.g. `badge={{ style: { color: '...' } }}`
|
|
35
|
-
- `presenceTitle` => Not Supported.
|
|
36
|
-
- `isOutOfOffice` => `badge={{ status: ..., outOfOffice: true }}`
|
|
37
|
-
- `showUnknownPersonaCoin` => Not Supported. An approximation is: `icon={<QuestionRegular />}`
|
|
38
|
-
- `initialsColor` => `color="colorful"`, or specify a color by name like `color="darkRed"`
|
|
39
|
-
- `showInitialsUntilImageLoad` => Not Supported. This is always true for `Avatar`.
|
|
40
|
-
- `imageShouldFadeIn` => Not Supported. Add a CSS class to the image if desired: `image={{ className: 'myFadeInClass' }}`
|
|
41
|
-
- `imageShouldStartVisible` => Not Supported. This is always true for `Avatar`.
|
|
42
|
-
- `onPhotoLoadingStateChange` => Add event listeners to the image slot for the `<img>` events: `image={{ onLoad: ..., onError: ... }}`
|
|
43
|
-
- `onRender*` => Avatar's slots allow render functions, such as `image={(Component, props) => <Component {...props} />}`
|
|
44
|
-
- To render a square image, use `shape="square"`.
|
|
45
|
-
|
|
46
|
-
## Migration from v0
|
|
47
|
-
|
|
48
|
-
The v0 Avatar maps more closely to the converged Avatar.
|
|
49
|
-
|
|
50
|
-
- `variables` => Replaced by theme
|
|
51
|
-
- `design` => Replaced by theme
|
|
52
|
-
- `accessibility` => Not needed
|
|
53
|
-
- `size` is converted from `SizeValue` to a number:
|
|
54
|
-
- `size="smallest"` => `size={20}`
|
|
55
|
-
- `size="smaller"` => `size={24}`
|
|
56
|
-
- `size="small"` => `size={28}`
|
|
57
|
-
- `size="medium"` => `size={32}`
|
|
58
|
-
- `size="large"` => `size={44}`
|
|
59
|
-
- `size="larger"` => `size={64}`
|
|
60
|
-
- `size="largest"` => `size={96}`
|
|
61
|
-
- `getInitials` => Set the initials directly: `initials={getInitials(name)}`
|
|
62
|
-
- `as` => Only allows `as="span"` (which is the default)
|
|
63
|
-
|
|
64
|
-
## Property mapping
|
|
65
|
-
|
|
66
|
-
| v8 `Persona` | v0 `Avatar` | v9 `Avatar` |
|
|
67
|
-
| ---------------------------- | ------------------ | --------------------------------------- |
|
|
68
|
-
| `text` | `name` | `name` |
|
|
69
|
-
| `size` (PersonaSize enum) | `size` (SizeValue) | `size` (number) |
|
|
70
|
-
| `coinSize` | - | - |
|
|
71
|
-
| `imageUrl` | `image` (slot) | `src` prop of the `image` slot |
|
|
72
|
-
| `imageAlt` | - | `aria-label` |
|
|
73
|
-
| `imageInitials` | `label` (slot) | `initials` (slot) |
|
|
74
|
-
| - | `getInitials` | - |
|
|
75
|
-
| `presence` | `status` (slot) | `badge` (slot) |
|
|
76
|
-
| `presenceColors` | - | - |
|
|
77
|
-
| `presenceTitle` | - | - |
|
|
78
|
-
| `initialsColor` | - | `color` |
|
|
79
|
-
| | - | `idForColor` |
|
|
80
|
-
| - | `icon` (slot) | `icon` (slot) |
|
|
81
|
-
| `showUnknownPersonaCoin` | - | - |
|
|
82
|
-
| `className` | `className` | `className` |
|
|
83
|
-
| - | `square` | `shape` |
|
|
84
|
-
| - | - | `active` |
|
|
85
|
-
| - | - | `activeAppearance` |
|
|
86
|
-
| - | `styles` | (theme) |
|
|
87
|
-
| - | `variables` | (theme) |
|
|
88
|
-
| - | `design` | (theme) |
|
|
89
|
-
| - | `accessibility` | - |
|
|
90
|
-
| - | `as` | - |
|
|
91
|
-
| `secondaryText` | - | - |
|
|
92
|
-
| `showSecondaryText` | - | - |
|
|
93
|
-
| `tertiaryText` | - | - |
|
|
94
|
-
| `optionalText` | - | - |
|
|
95
|
-
| `isOutOfOffice` | - | `outOfOffice` prop of the `badge` slot |
|
|
96
|
-
| `hidePersonaDetails` | - | - |
|
|
97
|
-
| `showInitialsUntilImageLoad` | - | - |
|
|
98
|
-
| `imageShouldFadeIn` | - | - |
|
|
99
|
-
| `imageShouldStartVisible` | - | - |
|
|
100
|
-
| `onPhotoLoadingStateChange` | - | `image={{ onLoad: ..., onError: ... }}` |
|
|
101
|
-
| `onRenderInitials` | - | Render function for the `initials` slot |
|
|
102
|
-
| `onRenderPersonaCoin` | - | Render function for the Avatar |
|
|
103
|
-
| `onRenderPrimaryText` | - | - |
|
|
104
|
-
| `onRenderSecondaryText` | - | - |
|
|
105
|
-
| `onRenderTertiaryText` | - | - |
|
|
106
|
-
| `onRenderOptionalText` | - | - |
|
package/SPEC-AvatarGroup.md
DELETED
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
# AvatarGroup Spec
|
|
2
|
-
|
|
3
|
-
## Background
|
|
4
|
-
|
|
5
|
-
AvatarGroup represents a group of multiple people or entities by taking care of the arrangement of individual Avatars in a spread, stack, or pie layout.
|
|
6
|
-
|
|
7
|
-
## Prior Art
|
|
8
|
-
|
|
9
|
-
### OpenUI
|
|
10
|
-
|
|
11
|
-
There's no current research in OpenUI's website.
|
|
12
|
-
|
|
13
|
-
| Library | Name | Notes |
|
|
14
|
-
| ------------------------------------------------------------------------------------- | ------------ | --------------------------------------------------------------------------------------------- |
|
|
15
|
-
| [Fluent UI v8](https://developer.microsoft.com/en-us/fluentui#/controls/web/facepile) | Facepile | Receives list of `IFacepilePersona` to represent each avatar. |
|
|
16
|
-
| [Attlassian](https://atlassian.design/components/avatar-group/examples) | Avatar group | Component uses data prop, which is a list of "entries" to represent each avatar in the group. |
|
|
17
|
-
| [Ant Design](https://ant.design/components/avatar/) | Avatar.Group | Uses subcomponent `<Avatar.Group>` to group the avatars given as children. |
|
|
18
|
-
| [Primer React](https://primer.style/react/AvatarStack) | AvatarStack | Acts similar to a FlexBox, avatars are given as children and grouped. |
|
|
19
|
-
|
|
20
|
-
### Comparison v8 and v0
|
|
21
|
-
|
|
22
|
-
There's only one existent component similar to AvatarGroup in v8 `Facepile`. v0 doesn't have an equivalent of this component.
|
|
23
|
-
|
|
24
|
-
- v8 [Facepile](https://developer.microsoft.com/en-us/fluentui#/controls/web/facepile): Only offers spread layout and offers three overflow indicator styles.
|
|
25
|
-
|
|
26
|
-
## Epic issue: [#22240](https://github.com/microsoft/fluentui/issues/22240)
|
|
27
|
-
|
|
28
|
-
## Sample Code
|
|
29
|
-
|
|
30
|
-
```jsx
|
|
31
|
-
const names = [
|
|
32
|
-
'Johnie McConnell',
|
|
33
|
-
'Allan Munger',
|
|
34
|
-
'Erik Nason',
|
|
35
|
-
'Kristin Patterson',
|
|
36
|
-
'Daisy Phillips',
|
|
37
|
-
'Carole Poland',
|
|
38
|
-
'Carlos Slattery',
|
|
39
|
-
'Robert Tolbert',
|
|
40
|
-
'Kevin Sturgis',
|
|
41
|
-
'Charlotte Waltson',
|
|
42
|
-
'Elliot Woodward',
|
|
43
|
-
];
|
|
44
|
-
|
|
45
|
-
const AvatarGroup = () => {
|
|
46
|
-
const { inlineItems, overflowItems } = partitionAvatarGroupItems({ items: names });
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<AvatarGroup {...props}>
|
|
50
|
-
{inlineItems.map(name => (
|
|
51
|
-
<AvatarGroupItem name={name} key={name} />
|
|
52
|
-
))}
|
|
53
|
-
<AvatarGroupPopover>
|
|
54
|
-
{overflowItems.map(name => (
|
|
55
|
-
<AvatarGroupItem name={name} key={name} />
|
|
56
|
-
))}
|
|
57
|
-
</AvatarGroupPopover>
|
|
58
|
-
</AvatarGroup>
|
|
59
|
-
);
|
|
60
|
-
};
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## Variants
|
|
64
|
-
|
|
65
|
-
There are three layout variants in AvatarGroup:
|
|
66
|
-
|
|
67
|
-
- Spread layout (Default): Avatars are spaced evenly.
|
|
68
|
-
- Stack layout: Avatars are overlapped evenly.
|
|
69
|
-
- Pie layout: Avatars are "cut" in a pie design. When there are two Avatars inline, the Avatars will be cut in half and placed side by side. When there are three Avatars inline, the first Avatar will be cut in half and other two will be downscaled by 50%.
|
|
70
|
-
- The pie layout must have 3 or less Avatars inline and all Avatars must repeat in the `AvatarGroupPopover`. This is handled by `partitionAvatarGroupItems`.
|
|
71
|
-
- If `partitionAvatarGroupItems` is used, the `spread` and `stack` layouts will have a maximum of 5 avatars before overflowing by default. This can be overridden via the `maxAvatars` option in `partitionAvatarGroupItems`.
|
|
72
|
-
|
|
73
|
-
## API
|
|
74
|
-
|
|
75
|
-
See [AvatarGroup.types.ts](./src/components/AvatarGroup/AvatarGroup.types.ts), [AvatarGroupPopover.types.ts](./src/components/AvatarGroupPopover/AvatarGroupPopover.types.ts) and [AvatarGroupItem.types.ts](./src/components/AvatarGroupItem/AvatarGroupItem.types.ts) for more details.
|
|
76
|
-
|
|
77
|
-
- `size`: Group size will override the children's current size. This is to ensure that the `AvatarGroup`'s spacing is correct because it changes depending on the group size.
|
|
78
|
-
- `AvatarGroupPopover`: All Avatars in `AvatarGroupPopover` will have a size of 24 and have a wrapper to apply stylings.
|
|
79
|
-
- AvatarGroupItem `color`: Can be overridden by providing a specific color on a given avatar.
|
|
80
|
-
|
|
81
|
-
#### Color override example:
|
|
82
|
-
|
|
83
|
-
In this example, the first AvatarGroupItem will have a `darkRed` color, while all the other Avatars have their color assigned by Avatar.
|
|
84
|
-
|
|
85
|
-
```jsx
|
|
86
|
-
<AvatarGroup>
|
|
87
|
-
<AvatarGroupItem color="darkRed" name="Katri Athokas" />
|
|
88
|
-
<AvatarGroupItem name="Elvia Atkins" />
|
|
89
|
-
<AvatarGroupItem name="Cameron Evans" />
|
|
90
|
-
<AvatarGroupItem name="Wanda Howard" />
|
|
91
|
-
<AvatarGroupItem name="Mona Kane" />
|
|
92
|
-
</AvatarGroup>
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
## Structure
|
|
96
|
-
|
|
97
|
-
- _**Public**_
|
|
98
|
-
|
|
99
|
-
```jsx
|
|
100
|
-
<AvatarGroup layout="spread" size={32}>
|
|
101
|
-
<AvatarGroupItem name="Katri Athokas" />
|
|
102
|
-
<AvatarGroupItem name="Elvia Atkins" />
|
|
103
|
-
<AvatarGroupItem name="Cameron Evans" />
|
|
104
|
-
<AvatarGroupItem name="Wanda Howard" />
|
|
105
|
-
<AvatarGroupPopover>
|
|
106
|
-
<AvatarGroupItem name="Mona Kane" />
|
|
107
|
-
<AvatarGroupItem name="Kristin Patterson" />
|
|
108
|
-
<AvatarGroupItem name="Elliot Woodward" />
|
|
109
|
-
<AvatarGroupItem name="Charlotte Waltson" />
|
|
110
|
-
</AvatarGroupPopover>
|
|
111
|
-
</AvatarGroup>
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
- _**Internal**_
|
|
115
|
-
|
|
116
|
-
```jsx
|
|
117
|
-
// AvatarGroup
|
|
118
|
-
<AvatarGroupProvider value={contextValues.avatarGroup}>
|
|
119
|
-
<slots.root {...slotProps.root} />
|
|
120
|
-
</AvatarGroupProvider>
|
|
121
|
-
|
|
122
|
-
// AvatarGroupPopover
|
|
123
|
-
<slots.root {...(slotProps.root as PopoverProps)}>
|
|
124
|
-
<PopoverTrigger>
|
|
125
|
-
<slots.tooltip {...(slotProps.tooltip as TooltipProps)}>
|
|
126
|
-
<slots.triggerButton {...slotProps.triggerButton} />
|
|
127
|
-
</slots.tooltip>
|
|
128
|
-
</PopoverTrigger>
|
|
129
|
-
<slots.popoverSurface {...slotProps.popoverSurface}>
|
|
130
|
-
<AvatarGroupProvider value={contextValues.avatarGroup}>
|
|
131
|
-
<slots.content {...slotProps.content} />
|
|
132
|
-
</AvatarGroupProvider>
|
|
133
|
-
</slots.popoverSurface>
|
|
134
|
-
</slots.root>
|
|
135
|
-
|
|
136
|
-
// AvatarGroupItem
|
|
137
|
-
<slots.root {...slotProps.root}>
|
|
138
|
-
<slots.avatar {...slotProps.avatar} />
|
|
139
|
-
{state.isOverflowItem && <slots.overflowLabel {...slotProps.overflowLabel} />}
|
|
140
|
-
</slots.root>
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
- _**DOM** - how the component will be rendered as HTML elements_
|
|
144
|
-
|
|
145
|
-
```html
|
|
146
|
-
<div className="fui-AvatarGroup" role="group">
|
|
147
|
-
<div class="fui-AvatarGroupItem">
|
|
148
|
-
<Avatar />
|
|
149
|
-
</div>
|
|
150
|
-
<div class="fui-AvatarGroupItem">
|
|
151
|
-
<Avatar />
|
|
152
|
-
</div>
|
|
153
|
-
<button>+1</button>
|
|
154
|
-
</div>
|
|
155
|
-
|
|
156
|
-
// on document.body
|
|
157
|
-
<div class="fui-AvatarGroupPopover" role="dialog" aria-label="Overflow">
|
|
158
|
-
<ul>
|
|
159
|
-
<li class="fui-AvatarGroupItem">
|
|
160
|
-
<Avatar />
|
|
161
|
-
<label />
|
|
162
|
-
</li>
|
|
163
|
-
<li class="fui-AvatarGroupItem">
|
|
164
|
-
<Avatar />
|
|
165
|
-
<label />
|
|
166
|
-
</li>
|
|
167
|
-
</ul>
|
|
168
|
-
</div>
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
## Migration
|
|
172
|
-
|
|
173
|
-
See [v8 to v9 migration guide](https://react.fluentui.dev/?path=/docs/concepts-upgrading-from-v8-components-avatargroup-upgrade--page) for details.
|
|
174
|
-
|
|
175
|
-
## Behaviors
|
|
176
|
-
|
|
177
|
-
_Explain how the component will behave in use, including:_
|
|
178
|
-
|
|
179
|
-
- _AvatarGroupPopover Component States_
|
|
180
|
-
|
|
181
|
-
- _Keyboard_: `triggerButton` can be interacted with the keyboard and when enter is pressed a popover that traps focus on the PopoverSurface will be rendered.
|
|
182
|
-
- _Cursor_ and _Touch_: When overflow indicator is clicked, the popover is displayed with the avatars that overflow. When the overflow indicator is hovered, a tooltip will read `View more people.`.
|
|
183
|
-
- _Screen readers_:
|
|
184
|
-
- When the `triggerButton` is focused, its content will be read.
|
|
185
|
-
|
|
186
|
-
- _AvatarGroupItem Component States_
|
|
187
|
-
- _Screen readers_:
|
|
188
|
-
- When AvatarGroupItem is rendered inline, logic is handled by `Avatar` component.
|
|
189
|
-
- When AvatarGroupItem is rendered inside AvatarGroupPopover, the label is disabled via `aria-label` and `Avatar` will handle the screen reader.
|
|
190
|
-
|
|
191
|
-
## Accessibility
|
|
192
|
-
|
|
193
|
-
Base accessibility information is included in the design document. After the spec is filled and reviewed, outcomes from it need to be communicated to design and incorporated in the design document.
|
|
194
|
-
|
|
195
|
-
- There's no native element for this component.
|
|
196
|
-
|
|
197
|
-
- `AvatarGroup` will have a role of `group`.
|
|
198
|
-
- Only the `popoverTrigger` will be focusable by the keyboard.
|
|
199
|
-
- There are no live-regions in `AvatarGroup`.
|
|
200
|
-
- A Tooltip will appear when the `popoverTrigger` is hovered or focused.
|
|
201
|
-
- Focus will only be trapped when the `popoverTrigger` is triggered.
|
|
202
|
-
- The label rendered along with the Avatar inside AvatarGroupPopover is disabled via `aria-label`.
|
|
203
|
-
- A `<ul>` with role list is rendered inside the PopoverSurface.
|
package/SPEC.md
DELETED
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
# Avatar
|
|
2
|
-
|
|
3
|
-
**GitHub Epic issue** - [Avatar Convergence #16373](https://github.com/microsoft/fluentui/issues/16373)
|
|
4
|
-
|
|
5
|
-
## Background
|
|
6
|
-
|
|
7
|
-
The Avatar component represents a person or entity. It displays the person's image, initials, or an icon, and can be either circular or square.
|
|
8
|
-
|
|
9
|
-
Note: The Avatar control has been mostly implemented already. Visit [Avatar Storybook Examples](https://fluentuipr.z22.web.core.windows.net/heads/master/react-components/storybook/index.html?path=/docs/components-avatar--default) to see the current state of the implementation.
|
|
10
|
-
|
|
11
|
-
## Prior Art
|
|
12
|
-
|
|
13
|
-
### Open UI
|
|
14
|
-
|
|
15
|
-
The Open UI [Avatar Research](https://open-ui.org/components/avatar.research) page (currently in PR: https://github.com/WICG/open-ui/pull/250), shows how the Avatar component is used in UI platforms across the web. There is a good consensus about the basic features such as displaying an image, initials, or an icon; as well as the shape being either a square or circle.
|
|
16
|
-
|
|
17
|
-
### Comparison of v8 and v0
|
|
18
|
-
|
|
19
|
-
The existing components are:
|
|
20
|
-
|
|
21
|
-
- v8 - [Persona](https://developer.microsoft.com/en-us/fluentui#/controls/web/persona)
|
|
22
|
-
- v0 - [Avatar](https://fluentsite.z22.web.core.windows.net/0.51.4/components/avatar/definition)
|
|
23
|
-
|
|
24
|
-
#### Display
|
|
25
|
-
|
|
26
|
-
Both the v8 and v0 components support displaying an image, initials, and an icon.
|
|
27
|
-
|
|
28
|
-
The v8 `Persona` also supports the full name and extra detail text to the right of the image. The extra detail text is specifically out of scope for the `Avatar` control, and may be added to a future component that makes use of Avatar.
|
|
29
|
-
|
|
30
|
-
The v8 `Persona` appears to not support a custom icon, and can only show the default person icon, or a "?" icon
|
|
31
|
-
|
|
32
|
-
#### Status/Presence Badge
|
|
33
|
-
|
|
34
|
-
Both components support showing a badge to indicate status, but they have different APIs. The v8 `Persona` has an enum of preset options for the presence badge. The v0 `Avatar` supports rendering a `Status` component, which is more customizable and can render an icon, and specify different sizes and colors.
|
|
35
|
-
|
|
36
|
-
## Sample Code
|
|
37
|
-
|
|
38
|
-
Display a user's initials:
|
|
39
|
-
|
|
40
|
-
```jsx
|
|
41
|
-
<Avatar name="Miguel Garcia" />
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Display a user's image:
|
|
45
|
-
|
|
46
|
-
```jsx
|
|
47
|
-
<Avatar size={72} name="Mona Kane" image={{ src: './MonaKane.jpg' }} />
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
Display an icon only:
|
|
51
|
-
|
|
52
|
-
```jsx
|
|
53
|
-
<Avatar aria-label="Team" icon={<PeopleTeamRegular />} shape="square" />
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
Display a badge:
|
|
57
|
-
|
|
58
|
-
```jsx
|
|
59
|
-
<Avatar name="Allan Munger" badge={{ status: 'busy' }} />
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
With active state indication:
|
|
63
|
-
|
|
64
|
-
```jsx
|
|
65
|
-
<Avatar name="Daisy Phillips" active={isUserActive ? 'active' : 'inactive'} activeAppearance="ring-shadow" />
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## Variants
|
|
69
|
-
|
|
70
|
-
### Color
|
|
71
|
-
|
|
72
|
-
The Avatar supports color variants when displaying initials or an icon:
|
|
73
|
-
|
|
74
|
-
- **Neutral** - Gray (default)
|
|
75
|
-
- **Brand** - Brand colors from the theme
|
|
76
|
-
- **Colorful** - Pick from a list of pre-defined Avatar colors. The color will be assigned based on a hash of the name
|
|
77
|
-
(to "randomly" assign a person a color). The color name (like `darkRed`) can also be specified explicitly in case the use case
|
|
78
|
-
requires a different algorithm to pick the color.
|
|
79
|
-
|
|
80
|
-
### Shape
|
|
81
|
-
|
|
82
|
-
The Avatar supports a circular and square (with rounded corners) shape.
|
|
83
|
-
|
|
84
|
-
## API
|
|
85
|
-
|
|
86
|
-
From [Avatar.types.tsx](https://github.com/microsoft/fluentui/blob/master/packages/react-avatar/src/components/Avatar/Avatar.types.tsx):
|
|
87
|
-
|
|
88
|
-
### Slots
|
|
89
|
-
|
|
90
|
-
- `root` - The root element of the Avatar.
|
|
91
|
-
- `image` - The Avatar's image, if provided.
|
|
92
|
-
- `initials` - The text shown when there's no image. Defaults to the initials derived from `name`.
|
|
93
|
-
- `icon` - Icon displayed when there's no image or intials available.
|
|
94
|
-
- `badge` - PresenceBadge to show the avatar's status.
|
|
95
|
-
|
|
96
|
-
### Props
|
|
97
|
-
|
|
98
|
-
See API at [Avatar.types.ts](./src/components/Avatar/Avatar.types.ts).
|
|
99
|
-
|
|
100
|
-
## Structure
|
|
101
|
-
|
|
102
|
-
JSX Tree:
|
|
103
|
-
|
|
104
|
-
```jsx
|
|
105
|
-
<slots.root {...slotProps.root}>
|
|
106
|
-
{slots.initials && <slots.initials {...slotProps.initials} />}
|
|
107
|
-
{slots.icon && <slots.icon {...slotProps.icon} />}
|
|
108
|
-
{slots.image && <slots.image {...slotProps.image} />}
|
|
109
|
-
{slots.badge && <slots.badge {...slotProps.badge} />}
|
|
110
|
-
</slots.root>
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
Resulting HTML (in this example, "avatar-42" is an ID generated by `useId`):
|
|
114
|
-
|
|
115
|
-
```html
|
|
116
|
-
<span class="{root}" id="avatar-42" aria-label="Miguel Garcia" aria-labelledby="avatar-42 avatar-42__badge">
|
|
117
|
-
<!-- Only one of initials OR icon will be rendered, never both -->
|
|
118
|
-
<span class="{initials}" aria-hidden="true">MG</span>
|
|
119
|
-
<span class="{icon}" aria-hidden="true"><svg>...</svg></span>
|
|
120
|
-
|
|
121
|
-
<!-- The Image -->
|
|
122
|
-
<img class="{image}" src="..." aria-hidden="true" role="presentation" alt="" />
|
|
123
|
-
|
|
124
|
-
<!-- The PresenceBadge's HTML is rendered here -->
|
|
125
|
-
<span class="{PresenceBadge}" id="avatar-42__badge" aria-hidden="true">...</span>
|
|
126
|
-
</span>
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
## Migration
|
|
130
|
-
|
|
131
|
-
See [MIGRATION.md](./MIGRATION.md).
|
|
132
|
-
|
|
133
|
-
## Behaviors
|
|
134
|
-
|
|
135
|
-
### States
|
|
136
|
-
|
|
137
|
-
- **Display** - The Avatar will use the following priority:
|
|
138
|
-
|
|
139
|
-
- The `image` property, if provided.
|
|
140
|
-
- Initials derived from the `name` property (this is always displayed, so it is visible while the image is loading, and if the image fails to load).
|
|
141
|
-
- The `icon` property, if provided.
|
|
142
|
-
- If no `image`, `icon`, or `name` is provided, the default "person" icon will be used.
|
|
143
|
-
|
|
144
|
-
- **Active** - The `active` property affects the display of the avatar if set. There will be an animation when switching between active and inactive.
|
|
145
|
-
- `unset` - Display at normal size/opacity.
|
|
146
|
-
- `inactive` - Reduce to 80% opacity, and 87.5% size.
|
|
147
|
-
- `active` - Adorn with an extra visual such as a ring and/or shadow, based on the `activeAppearance` property.
|
|
148
|
-
|
|
149
|
-
### Interaction
|
|
150
|
-
|
|
151
|
-
The Avatar is non-interactive.
|
|
152
|
-
|
|
153
|
-
- **Keyboard** - Not keyboard focusable.
|
|
154
|
-
- **Mouse** - Nothing
|
|
155
|
-
- **Touch** - Nothing
|
|
156
|
-
|
|
157
|
-
## Accessibility
|
|
158
|
-
|
|
159
|
-
The Avatar presents as a single img element to accessibility tools, regardless of what it is displaying (image, initials, or icon).
|
|
160
|
-
|
|
161
|
-
- The Avatar's root has `role="img"`
|
|
162
|
-
- All other slots have `aria-hidden="true"`.
|
|
163
|
-
- The `<img>` additionally has `alt="" role="presentation"`
|
|
164
|
-
|
|
165
|
-
The Avatar root's label is determined using the following priority:
|
|
166
|
-
|
|
167
|
-
- If `aria-label` and/or `aria-labelledby` is provided on props, do not add anything else.
|
|
168
|
-
- If `name` is provided, set the root's `aria-label={name}`.
|
|
169
|
-
- If a badge is present, _also_ set the root's `aria-labelledby={root.id + ' ' + badge.id}`.
|
|
170
|
-
- This means the Avatar is labelled by both its root and badge slots, and results in a label like "Miguel Garcia Busy".
|
|
171
|
-
- If there's no `name`, but `initials` are provided, set the root's `aria-labelledby={initials.id}`.
|
|
172
|
-
- If a badge is present, _instead_ set the root's `aria-labelledby={initials.id + ' ' + badge.id}`.
|