@fluentui/react-avatar 9.0.1 → 9.0.2
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 +90 -1
- package/CHANGELOG.md +20 -2
- package/MIGRATION-AvatarGroup.md +35 -0
- package/README-AvatarGroup.md +39 -0
- package/README.md +16 -11
- package/SPEC.md +1 -135
- package/dist/index.d.ts +5 -1
- package/lib/components/AvatarGroup/AvatarGroup.types.js.map +1 -1
- package/lib/components/AvatarGroup/renderAvatarGroup.js +4 -3
- package/lib/components/AvatarGroup/renderAvatarGroup.js.map +1 -1
- package/lib/components/AvatarGroup/useAvatarGroup.js +10 -11
- package/lib/components/AvatarGroup/useAvatarGroup.js.map +1 -1
- package/lib/components/AvatarGroup/useAvatarGroupStyles.js +44 -38
- package/lib/components/AvatarGroup/useAvatarGroupStyles.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/renderAvatarGroup.js +4 -3
- package/lib-commonjs/components/AvatarGroup/renderAvatarGroup.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/useAvatarGroup.js +10 -12
- package/lib-commonjs/components/AvatarGroup/useAvatarGroup.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.js +44 -38
- package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.js.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,96 @@
|
|
|
2
2
|
"name": "@fluentui/react-avatar",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Thu, 14 Jul 2022 17:03:22 GMT",
|
|
6
|
+
"tag": "@fluentui/react-avatar_v9.0.2",
|
|
7
|
+
"version": "9.0.2",
|
|
8
|
+
"comments": {
|
|
9
|
+
"none": [
|
|
10
|
+
{
|
|
11
|
+
"author": "esteban.230@hotmail.com",
|
|
12
|
+
"package": "@fluentui/react-avatar",
|
|
13
|
+
"commit": "157355880d28bb1d72726c96a6395be0a99950f3",
|
|
14
|
+
"comment": "chore: Adding unit tests for AvatarGroup. "
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "esteban.230@hotmail.com",
|
|
18
|
+
"package": "@fluentui/react-avatar",
|
|
19
|
+
"commit": "dad21ca4232d5ef93e166e6f5c6f786d131abe3b",
|
|
20
|
+
"comment": "docs: Adding readme and migration guide for AvatarGroup."
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "Humberto.Morimoto@microsoft.com",
|
|
24
|
+
"package": "@fluentui/react-avatar",
|
|
25
|
+
"commit": "422636fffd66758c1a6dd617063582d902b61927",
|
|
26
|
+
"comment": "docs: README and Avatar spec cleanup."
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"patch": [
|
|
30
|
+
{
|
|
31
|
+
"author": "ololubek@microsoft.com",
|
|
32
|
+
"package": "@fluentui/react-avatar",
|
|
33
|
+
"commit": "63ab03fa7a9b3d02204147ea5356b8f78751df42",
|
|
34
|
+
"comment": "chore: Update @fluentui/react-icons dependency to v2.0.175"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"author": "esteban.230@hotmail.com",
|
|
38
|
+
"package": "@fluentui/react-avatar",
|
|
39
|
+
"commit": "7a1737f0db893a5c623c30d81745f8e41c9ef79b",
|
|
40
|
+
"comment": "fix: Remove override of role=list in AvatarGroup's PopoverSurface and fix trapFocus when Popover is triggered."
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"author": "esteban.230@hotmail.com",
|
|
44
|
+
"package": "@fluentui/react-avatar",
|
|
45
|
+
"commit": "e1b98936707f64ff4088ceba4577f76085001687",
|
|
46
|
+
"comment": "fix: Fixing focus indicator for pie layouts."
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"author": "beachball",
|
|
50
|
+
"package": "@fluentui/react-avatar",
|
|
51
|
+
"comment": "Bump @fluentui/react-badge to v9.0.2",
|
|
52
|
+
"commit": "fd9308f35ec9b2c7f7fdbfce62f9a94ca00d6536"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"author": "beachball",
|
|
56
|
+
"package": "@fluentui/react-avatar",
|
|
57
|
+
"comment": "Bump @fluentui/react-context-selector to v9.0.1",
|
|
58
|
+
"commit": "fd9308f35ec9b2c7f7fdbfce62f9a94ca00d6536"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"author": "beachball",
|
|
62
|
+
"package": "@fluentui/react-avatar",
|
|
63
|
+
"comment": "Bump @fluentui/react-popover to v9.0.2",
|
|
64
|
+
"commit": "fd9308f35ec9b2c7f7fdbfce62f9a94ca00d6536"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"author": "beachball",
|
|
68
|
+
"package": "@fluentui/react-avatar",
|
|
69
|
+
"comment": "Bump @fluentui/react-tabster to v9.0.2",
|
|
70
|
+
"commit": "fd9308f35ec9b2c7f7fdbfce62f9a94ca00d6536"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"author": "beachball",
|
|
74
|
+
"package": "@fluentui/react-avatar",
|
|
75
|
+
"comment": "Bump @fluentui/react-tooltip to v9.0.2",
|
|
76
|
+
"commit": "fd9308f35ec9b2c7f7fdbfce62f9a94ca00d6536"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"author": "beachball",
|
|
80
|
+
"package": "@fluentui/react-avatar",
|
|
81
|
+
"comment": "Bump @fluentui/react-utilities to v9.0.1-0",
|
|
82
|
+
"commit": "fd9308f35ec9b2c7f7fdbfce62f9a94ca00d6536"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"author": "beachball",
|
|
86
|
+
"package": "@fluentui/react-avatar",
|
|
87
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.11",
|
|
88
|
+
"commit": "fd9308f35ec9b2c7f7fdbfce62f9a94ca00d6536"
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"date": "Tue, 28 Jun 2022 17:39:46 GMT",
|
|
6
95
|
"tag": "@fluentui/react-avatar_v9.0.1",
|
|
7
96
|
"version": "9.0.1",
|
|
8
97
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-avatar
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 14 Jul 2022 17:03:22 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.0.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-avatar_v9.0.2)
|
|
8
|
+
|
|
9
|
+
Thu, 14 Jul 2022 17:03:22 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-avatar_v9.0.1..@fluentui/react-avatar_v9.0.2)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- chore: Update @fluentui/react-icons dependency to v2.0.175 ([PR #23812](https://github.com/microsoft/fluentui/pull/23812) by ololubek@microsoft.com)
|
|
15
|
+
- fix: Remove override of role=list in AvatarGroup's PopoverSurface and fix trapFocus when Popover is triggered. ([PR #23823](https://github.com/microsoft/fluentui/pull/23823) by esteban.230@hotmail.com)
|
|
16
|
+
- fix: Fixing focus indicator for pie layouts. ([PR #23860](https://github.com/microsoft/fluentui/pull/23860) by esteban.230@hotmail.com)
|
|
17
|
+
- Bump @fluentui/react-badge to v9.0.2 ([PR #23909](https://github.com/microsoft/fluentui/pull/23909) by beachball)
|
|
18
|
+
- Bump @fluentui/react-context-selector to v9.0.1 ([PR #23909](https://github.com/microsoft/fluentui/pull/23909) by beachball)
|
|
19
|
+
- Bump @fluentui/react-popover to v9.0.2 ([PR #23909](https://github.com/microsoft/fluentui/pull/23909) by beachball)
|
|
20
|
+
- Bump @fluentui/react-tabster to v9.0.2 ([PR #23909](https://github.com/microsoft/fluentui/pull/23909) by beachball)
|
|
21
|
+
- Bump @fluentui/react-tooltip to v9.0.2 ([PR #23909](https://github.com/microsoft/fluentui/pull/23909) by beachball)
|
|
22
|
+
- Bump @fluentui/react-utilities to v9.0.1-0 ([PR #23909](https://github.com/microsoft/fluentui/pull/23909) by beachball)
|
|
23
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.11 ([PR #23909](https://github.com/microsoft/fluentui/pull/23909) by beachball)
|
|
24
|
+
|
|
7
25
|
## [9.0.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-avatar_v9.0.1)
|
|
8
26
|
|
|
9
|
-
Tue, 28 Jun 2022 17:
|
|
27
|
+
Tue, 28 Jun 2022 17:39:46 GMT
|
|
10
28
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-avatar_v9.0.0..@fluentui/react-avatar_v9.0.1)
|
|
11
29
|
|
|
12
30
|
### Patches
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# AvatarGroup Migration
|
|
2
|
+
|
|
3
|
+
## Migration from v0
|
|
4
|
+
|
|
5
|
+
`v0` does not have a component similar to `AvatarGroup`.
|
|
6
|
+
|
|
7
|
+
## Migration from v8
|
|
8
|
+
|
|
9
|
+
AvatarGroup and Facepile have similar APIs, but the main difference is how they interact with AvatarGroupItem/Persona. AvatarGroup receives AvatarGroupItems as children and places them in their respective place, this means AvatarGroup has no control over AvatarGroupItem. `size` is the only property of AvatarGroupItem that is modified by AvatarGroup to make all AvatarGroupItems the same size. Face adding functionality is not supported.
|
|
10
|
+
|
|
11
|
+
Avatars must not be used inside an AvatarGroup, instead AvatarGroupItems are used since it has extra functionality used only in AvatarGroups. This includes adding a label when the AvatarGroupItem is rendered in the overflow Popover and specific styling for each layout.
|
|
12
|
+
|
|
13
|
+
AvatarGroup has extra functionality that Facepile does not have, this includes:
|
|
14
|
+
- When the AvatarGroupItems are overflowing, a Popover is rendered that contains all the overflowed AvatarGroupItems. The Popover is triggered when the overflow button is clicked.
|
|
15
|
+
- AvatarGroup supports three layouts: `spread` (default), `stack`, and `pie`.
|
|
16
|
+
|
|
17
|
+
## Property mapping
|
|
18
|
+
|
|
19
|
+
| v8 `Facepile` | v9 `AvatarGroup` |
|
|
20
|
+
| ------------------------ | -------------------------------------------------------- |
|
|
21
|
+
| `personas` | `children` |
|
|
22
|
+
| `addButtonProps` | - |
|
|
23
|
+
| `className` | `className` |
|
|
24
|
+
| `getPersonaProps` | `AvatarGroupItem`'s props |
|
|
25
|
+
| `maxDisplayablePersonas` | `maxAvatars` |
|
|
26
|
+
| `onRenderPersona` | Render function for the AvatarGroupItem |
|
|
27
|
+
| `onRenderPersonaCoin` | Render function for the `avatar` slot in AvatarGroupItem |
|
|
28
|
+
| `onRenderPersonaWrapper` | - |
|
|
29
|
+
| `overflowButtonProps` | `overflowButton` slot props |
|
|
30
|
+
| `overflowButtonType` | `overflowIndicator` |
|
|
31
|
+
| `overflowPersonas` | - |
|
|
32
|
+
| `personaSize` | `size` |
|
|
33
|
+
| `showAddButton` | - |
|
|
34
|
+
| `showTooltip` | - |
|
|
35
|
+
| `styles` | (theme) |
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# @fluentui/react-avatar
|
|
2
|
+
|
|
3
|
+
**React AvatarGroup component for [Fluent UI](https://dev.microsoft.com/fluentui)**
|
|
4
|
+
|
|
5
|
+
The AvatarGroup component 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
|
+
## STATUS: WIP 🚧
|
|
8
|
+
|
|
9
|
+
These are not production-ready components and **should never be used in product**. This space is useful for testing new components whose APIs might change before final release.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
To import AvatarGroup and AvatarGroupItem:
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
import { AvatarGroup, AvatarGroupItem } from '@fluentui/react-avatar';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Once the AvatarGroup component graduates to a production release, the component will be available at:
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
import { AvatarGroup, AvatarGroupItem } from '@fluentui/react-components';
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Examples
|
|
26
|
+
|
|
27
|
+
```jsx
|
|
28
|
+
<AvatarGroup>
|
|
29
|
+
<AvatarGroupItem name="Katri Athokas" />
|
|
30
|
+
<AvatarGroupItem name="Elvia Atkins" />
|
|
31
|
+
<AvatarGroupItem name="Cameron Evans" />
|
|
32
|
+
<AvatarGroupItem name="Wanda Howard" />
|
|
33
|
+
<AvatarGroupItem name="Mona Kane" />
|
|
34
|
+
<AvatarGroupItem name="Allan Munger" />
|
|
35
|
+
<AvatarGroupItem name="Daisy Phillips" />
|
|
36
|
+
<AvatarGroupItem name="Robert Tolbert" />
|
|
37
|
+
<AvatarGroupItem name="Kevin Sturgis" />
|
|
38
|
+
</AvatarGroup>
|
|
39
|
+
```
|
package/README.md
CHANGED
|
@@ -1,23 +1,13 @@
|
|
|
1
1
|
# @fluentui/react-avatar
|
|
2
2
|
|
|
3
|
-
**React Avatar components for [Fluent UI](https://
|
|
3
|
+
**React Avatar components for [Fluent UI](https://react.fluentui.dev/)**
|
|
4
4
|
|
|
5
5
|
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.
|
|
6
6
|
|
|
7
|
-
## STATUS: WIP 🚧
|
|
8
|
-
|
|
9
|
-
These are not production-ready components and **should never be used in product**. This space is useful for testing new components whose APIs might change before final release.
|
|
10
|
-
|
|
11
7
|
## Usage
|
|
12
8
|
|
|
13
9
|
To import Avatar:
|
|
14
10
|
|
|
15
|
-
```js
|
|
16
|
-
import { Avatar } from '@fluentui/react-avatar';
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Once the Avatar component graduates to a production release, the component will be available at:
|
|
20
|
-
|
|
21
11
|
```js
|
|
22
12
|
import { Avatar } from '@fluentui/react-components';
|
|
23
13
|
```
|
|
@@ -42,3 +32,18 @@ With active state indication:
|
|
|
42
32
|
<Avatar name="Daisy Phillips" active={true} activeAppearance="ring-shadow" />
|
|
43
33
|
<Avatar name="Robin Counts" active={false} activeAppearance="ring-shadow" />
|
|
44
34
|
```
|
|
35
|
+
|
|
36
|
+
See [Fluent UI Storybook](https://react.fluentui.dev/) for more detailed usage examples.
|
|
37
|
+
|
|
38
|
+
Alternatively, run Storybook locally with:
|
|
39
|
+
|
|
40
|
+
1. `yarn start`
|
|
41
|
+
2. Select `react-avatar` from the list.
|
|
42
|
+
|
|
43
|
+
### Specification
|
|
44
|
+
|
|
45
|
+
See [SPEC.md](./SPEC.md).
|
|
46
|
+
|
|
47
|
+
### Migration Guide
|
|
48
|
+
|
|
49
|
+
If you're upgrading to Fluent UI v9 see [MIGRATION.md](./MIGRATION.md) for guidance on updating to the latest Avatar implementation.
|
package/SPEC.md
CHANGED
|
@@ -95,141 +95,7 @@ From [Avatar.types.tsx](https://github.com/microsoft/fluentui/blob/master/packag
|
|
|
95
95
|
|
|
96
96
|
### Props
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
export type AvatarSlots = {
|
|
100
|
-
root: Slot<'span'>;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* The Avatar's image.
|
|
104
|
-
*
|
|
105
|
-
* Usage e.g.: `image={{ src: '...' }}`
|
|
106
|
-
*/
|
|
107
|
-
image?: Slot<'img'>;
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* (optional) Custom initials.
|
|
111
|
-
*
|
|
112
|
-
* It is usually not necessary to specify custom initials; by default they will be derived from the `name` prop,
|
|
113
|
-
* using the `getInitials` function.
|
|
114
|
-
*
|
|
115
|
-
* The initials are displayed when there is no image (including while the image is loading).
|
|
116
|
-
*/
|
|
117
|
-
initials?: Slot<'span'>;
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Icon to be displayed when the avatar doesn't have an image or initials.
|
|
121
|
-
*
|
|
122
|
-
* @defaultvalue `PersonRegular` (the default icon's size depends on the Avatar's size)
|
|
123
|
-
*/
|
|
124
|
-
icon?: Slot<'span'>;
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Badge to show the avatar's presence status.
|
|
128
|
-
*/
|
|
129
|
-
badge?: Slot<typeof PresenceBadge>;
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
export type AvatarProps = Omit<ComponentProps<AvatarSlots>, 'color'> & {
|
|
133
|
-
/**
|
|
134
|
-
* The name of the person or entity represented by this Avatar. This should always be provided if it is available.
|
|
135
|
-
*
|
|
136
|
-
* The name will be used to determine the initials displayed when there is no icon, as well as provided to
|
|
137
|
-
* accessibility tools.
|
|
138
|
-
*/
|
|
139
|
-
name?: string;
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Size of the avatar in pixels.
|
|
143
|
-
*
|
|
144
|
-
* Size is restricted to a limited set of supported values recommended for most uses (see `AvatarSizeValue`) and
|
|
145
|
-
* based on design guidelines for the Avatar control.
|
|
146
|
-
*
|
|
147
|
-
* If a non-supported size is neeeded, set `size` to the next-smaller supported size, and set `width` and `height`
|
|
148
|
-
* to override the rendered size.
|
|
149
|
-
*
|
|
150
|
-
* For example, to set the avatar to 45px in size:
|
|
151
|
-
* `<Avatar size={40} style={{ width: '45px', height: '45px' }} />`
|
|
152
|
-
*
|
|
153
|
-
* @defaultvalue 32
|
|
154
|
-
*/
|
|
155
|
-
size?: 20 | 24 | 28 | 32 | 36 | 40 | 48 | 56 | 64 | 72 | 96 | 120 | 128;
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* The avatar can have a circular or square shape.
|
|
159
|
-
* @defaultvalue circular
|
|
160
|
-
*/
|
|
161
|
-
shape?: 'circular' | 'square';
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Optional activity indicator
|
|
165
|
-
* * active: the avatar will be decorated according to activeAppearance
|
|
166
|
-
* * inactive: the avatar will be reduced in size and partially transparent
|
|
167
|
-
* * unset: normal display
|
|
168
|
-
*
|
|
169
|
-
* @defaultvalue unset
|
|
170
|
-
*/
|
|
171
|
-
active?: 'active' | 'inactive' | 'unset';
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* The appearance when `active="active"`
|
|
175
|
-
*
|
|
176
|
-
* @defaultvalue ring
|
|
177
|
-
*/
|
|
178
|
-
activeAppearance?: 'ring' | 'shadow' | 'ring-shadow';
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* The color when displaying either an icon or initials.
|
|
182
|
-
* * neutral (default): gray
|
|
183
|
-
* * brand: color from the brand palette
|
|
184
|
-
* * colorful: picks a color from a set of pre-defined colors, based on a hash of the name (or idForColor if provided)
|
|
185
|
-
* * [AvatarNamedColor]: a specific color from the theme
|
|
186
|
-
*
|
|
187
|
-
* @defaultvalue neutral
|
|
188
|
-
*/
|
|
189
|
-
color?: 'neutral' | 'brand' | 'colorful' | AvatarNamedColor;
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* Specify a string to be used instead of the name, to determine which color to use when color="colorful".
|
|
193
|
-
* Use this when a name is not available, but there is another unique identifier that can be used instead.
|
|
194
|
-
*/
|
|
195
|
-
idForColor?: string | undefined;
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
/**
|
|
199
|
-
* A specific named color for the Avatar
|
|
200
|
-
*/
|
|
201
|
-
export type AvatarNamedColor =
|
|
202
|
-
| 'darkRed'
|
|
203
|
-
| 'cranberry'
|
|
204
|
-
| 'red'
|
|
205
|
-
| 'pumpkin'
|
|
206
|
-
| 'peach'
|
|
207
|
-
| 'marigold'
|
|
208
|
-
| 'gold'
|
|
209
|
-
| 'brass'
|
|
210
|
-
| 'brown'
|
|
211
|
-
| 'forest'
|
|
212
|
-
| 'seafoam'
|
|
213
|
-
| 'darkGreen'
|
|
214
|
-
| 'lightTeal'
|
|
215
|
-
| 'teal'
|
|
216
|
-
| 'steel'
|
|
217
|
-
| 'blue'
|
|
218
|
-
| 'royalBlue'
|
|
219
|
-
| 'cornflower'
|
|
220
|
-
| 'navy'
|
|
221
|
-
| 'lavender'
|
|
222
|
-
| 'purple'
|
|
223
|
-
| 'grape'
|
|
224
|
-
| 'lilac'
|
|
225
|
-
| 'pink'
|
|
226
|
-
| 'magenta'
|
|
227
|
-
| 'plum'
|
|
228
|
-
| 'beige'
|
|
229
|
-
| 'mink'
|
|
230
|
-
| 'platinum'
|
|
231
|
-
| 'anchor';
|
|
232
|
-
```
|
|
98
|
+
See API at [Avatar.types.ts](./src/components/Avatar/Avatar.types.ts).
|
|
233
99
|
|
|
234
100
|
## Structure
|
|
235
101
|
|
package/dist/index.d.ts
CHANGED
|
@@ -100,7 +100,11 @@ export declare type AvatarGroupSlots = {
|
|
|
100
100
|
/**
|
|
101
101
|
* List that contains the overflow AvatarGroupItems.
|
|
102
102
|
*/
|
|
103
|
-
overflowContent?: NonNullable<Slot<
|
|
103
|
+
overflowContent?: NonNullable<Slot<'div'>>;
|
|
104
|
+
/**
|
|
105
|
+
* PopoverSurface that contains the overflow content.
|
|
106
|
+
*/
|
|
107
|
+
overflowSurface?: NonNullable<Slot<typeof PopoverSurface>>;
|
|
104
108
|
};
|
|
105
109
|
|
|
106
110
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarGroup.types.js","sourceRoot":"../src/","sources":["components/AvatarGroup/AvatarGroup.types.ts"],"names":[],"mappings":"","sourcesContent":["import { PopoverSurface } from '@fluentui/react-popover';\nimport { TooltipProps } from '@fluentui/react-tooltip';\nimport type { AvatarSizes } from '../Avatar/Avatar.types';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type AvatarGroupSlots = {\n root: NonNullable<Slot<'div'>>;\n\n /**\n * Popover trigger slot that can be used to change the overflow indicator.\n */\n overflowButton?: NonNullable<Slot<'button'>>;\n\n /**\n * List that contains the overflow AvatarGroupItems.\n */\n overflowContent?: NonNullable<Slot<typeof PopoverSurface>>;\n};\n\n/**\n * AvatarGroup Props\n */\nexport type AvatarGroupProps = ComponentProps<AvatarGroupSlots> & {\n /**\n * Layout the Avatars should be displayed as.\n * @default spread\n */\n layout?: 'spread' | 'stack' | 'pie';\n\n /**\n * Maximum number of Avatars to be displayed before overflowing.\n * Note: if pie layout is used, `maxAvatars` will be ignored.\n * @default 5\n */\n maxAvatars?: number;\n\n /**\n * Whether the overflow indicator should render an icon instead of the number of overflowed avatars.\n * Note: The overflowIndicator will default to `icon` when the size is less than 24.\n * @default count\n */\n overflowIndicator?: 'count' | 'icon';\n\n /**\n * Size of the avatars.\n * @default 32\n */\n size?: AvatarSizes;\n};\n\n/**\n * State used in rendering AvatarGroup\n */\nexport type AvatarGroupState = ComponentState<AvatarGroupSlots> &\n Required<Pick<AvatarGroupProps, 'layout' | 'size' | 'overflowIndicator'>> & {\n /**\n * Whether there are more Avatars than `maxAvatars`.\n * @default false\n */\n hasOverflow: boolean;\n\n /**\n * Tooltip content for the overflow indicator.\n */\n tooltipContent: TooltipProps['content'];\n\n nonOverflowAvatarsCount: number;\n };\n"]}
|
|
1
|
+
{"version":3,"file":"AvatarGroup.types.js","sourceRoot":"../src/","sources":["components/AvatarGroup/AvatarGroup.types.ts"],"names":[],"mappings":"","sourcesContent":["import { PopoverSurface } from '@fluentui/react-popover';\nimport { TooltipProps } from '@fluentui/react-tooltip';\nimport type { AvatarSizes } from '../Avatar/Avatar.types';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type AvatarGroupSlots = {\n root: NonNullable<Slot<'div'>>;\n\n /**\n * Popover trigger slot that can be used to change the overflow indicator.\n */\n overflowButton?: NonNullable<Slot<'button'>>;\n\n /**\n * List that contains the overflow AvatarGroupItems.\n */\n overflowContent?: NonNullable<Slot<'div'>>;\n\n /**\n * PopoverSurface that contains the overflow content.\n */\n overflowSurface?: NonNullable<Slot<typeof PopoverSurface>>;\n};\n\n/**\n * AvatarGroup Props\n */\nexport type AvatarGroupProps = ComponentProps<AvatarGroupSlots> & {\n /**\n * Layout the Avatars should be displayed as.\n * @default spread\n */\n layout?: 'spread' | 'stack' | 'pie';\n\n /**\n * Maximum number of Avatars to be displayed before overflowing.\n * Note: if pie layout is used, `maxAvatars` will be ignored.\n * @default 5\n */\n maxAvatars?: number;\n\n /**\n * Whether the overflow indicator should render an icon instead of the number of overflowed avatars.\n * Note: The overflowIndicator will default to `icon` when the size is less than 24.\n * @default count\n */\n overflowIndicator?: 'count' | 'icon';\n\n /**\n * Size of the avatars.\n * @default 32\n */\n size?: AvatarSizes;\n};\n\n/**\n * State used in rendering AvatarGroup\n */\nexport type AvatarGroupState = ComponentState<AvatarGroupSlots> &\n Required<Pick<AvatarGroupProps, 'layout' | 'size' | 'overflowIndicator'>> & {\n /**\n * Whether there are more Avatars than `maxAvatars`.\n * @default false\n */\n hasOverflow: boolean;\n\n /**\n * Tooltip content for the overflow indicator.\n */\n tooltipContent: TooltipProps['content'];\n\n nonOverflowAvatarsCount: number;\n };\n"]}
|
|
@@ -24,20 +24,21 @@ export const renderAvatarGroup_unstable = state => {
|
|
|
24
24
|
nonOverflowAvatarsCount
|
|
25
25
|
}
|
|
26
26
|
}, /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
|
|
27
|
-
}, state.root.children, state.hasOverflow && slots.overflowButton && slots.overflowContent && /*#__PURE__*/React.createElement(Popover, {
|
|
27
|
+
}, state.root.children, state.hasOverflow && slots.overflowButton && slots.overflowContent && slots.overflowSurface && /*#__PURE__*/React.createElement(Popover, {
|
|
28
28
|
trapFocus: true,
|
|
29
29
|
size: "small"
|
|
30
30
|
}, /*#__PURE__*/React.createElement(PopoverTrigger, null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
31
31
|
content: state.tooltipContent,
|
|
32
32
|
relationship: "label"
|
|
33
33
|
}, /*#__PURE__*/React.createElement(slots.overflowButton, { ...slotProps.overflowButton
|
|
34
|
-
}))), /*#__PURE__*/React.createElement(
|
|
34
|
+
}))), /*#__PURE__*/React.createElement(slots.overflowSurface, { ...slotProps.overflowSurface
|
|
35
|
+
}, /*#__PURE__*/React.createElement(AvatarGroupContext.Provider, {
|
|
35
36
|
value: {
|
|
36
37
|
isOverflow: true,
|
|
37
38
|
layout,
|
|
38
39
|
size: 24
|
|
39
40
|
}
|
|
40
41
|
}, /*#__PURE__*/React.createElement(slots.overflowContent, { ...slotProps.overflowContent
|
|
41
|
-
})))));
|
|
42
|
+
}))))));
|
|
42
43
|
};
|
|
43
44
|
//# sourceMappingURL=renderAvatarGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/AvatarGroup/renderAvatarGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,OAAT,EAAkB,cAAlB,QAAwC,yBAAxC;AACA,SAAS,OAAT,QAAwB,yBAAxB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AACA,SAAS,kBAAT,QAAmC,mCAAnC;AAGA;;AAEG;;AACH,OAAO,MAAM,0BAA0B,GAAI,KAAD,IAA4B;EACpE,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAmB,KAAnB,CAArC;EACA,MAAM;IAAE,MAAF;IAAU,IAAV;IAAgB;EAAhB,IAA4C,KAAlD;EAEA,oBACE,KAAA,CAAA,aAAA,CAAC,kBAAkB,CAAC,QAApB,EAA4B;IAAC,KAAK,EAAE;MAAE,MAAF;MAAU,IAAV;MAAgB;IAAhB;EAAR,CAA5B,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,EACG,KAAK,CAAC,IAAN,CAAW,QADd,EAEG,KAAK,CAAC,WAAN,IAAqB,KAAK,CAAC,cAA3B,IAA6C,KAAK,CAAC,eAAnD,iBACC,KAAA,CAAA,aAAA,CAAC,OAAD,EAAQ;IAAC,SAAS,EAAA,IAAV;IAAW,IAAI,EAAC;EAAhB,CAAR,eACE,KAAA,CAAA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K,CAAC,WAAN,IAAqB,KAAK,CAAC,cAA3B,IAA6C,KAAK,CAAC,eAAnD,IAAsE,KAAK,CAAC,eAA5E,iBACC,KAAA,CAAA,aAAA,CAAC,OAAD,EAAQ;IAAC,SAAS,EAAA,IAAV;IAAW,IAAI,EAAC;EAAhB,CAAR,eACE,KAAA,CAAA,aAAA,CAAC,cAAD,EAAe,IAAf,eACE,KAAA,CAAA,aAAA,CAAC,OAAD,EAAQ;IAAC,OAAO,EAAE,KAAK,CAAC,cAAhB;IAAgC,YAAY,EAAC;EAA7C,CAAR,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,cAAP,EAAqB,EAAA,GAAK,SAAS,CAAC;EAAf,CAArB,CADF,CADF,CADF,eAME,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,eAAP,EAAsB,EAAA,GAAK,SAAS,CAAC;EAAf,CAAtB,eACE,KAAA,CAAA,aAAA,CAAC,kBAAkB,CAAC,QAApB,EAA4B;IAAC,KAAK,EAAE;MAAE,UAAU,EAAE,IAAd;MAAoB,MAApB;MAA4B,IAAI,EAAE;IAAlC;EAAR,CAA5B,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,eAAP,EAAsB,EAAA,GAAK,SAAS,CAAC;EAAf,CAAtB,CADF,CADF,CANF,CAHJ,CADF,CADF;AAqBD,CAzBM","sourcesContent":["import * as React from 'react';\nimport { Popover, PopoverTrigger } from '@fluentui/react-popover';\nimport { Tooltip } from '@fluentui/react-tooltip';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { AvatarGroupContext } from '../../contexts/AvatarGroupContext';\nimport type { AvatarGroupState, AvatarGroupSlots } from './AvatarGroup.types';\n\n/**\n * Render the final JSX of AvatarGroup\n */\nexport const renderAvatarGroup_unstable = (state: AvatarGroupState) => {\n const { slots, slotProps } = getSlots<AvatarGroupSlots>(state);\n const { layout, size, nonOverflowAvatarsCount } = state;\n\n return (\n <AvatarGroupContext.Provider value={{ layout, size, nonOverflowAvatarsCount }}>\n <slots.root {...slotProps.root}>\n {state.root.children}\n {state.hasOverflow && slots.overflowButton && slots.overflowContent && slots.overflowSurface && (\n <Popover trapFocus size=\"small\">\n <PopoverTrigger>\n <Tooltip content={state.tooltipContent} relationship=\"label\">\n <slots.overflowButton {...slotProps.overflowButton} />\n </Tooltip>\n </PopoverTrigger>\n <slots.overflowSurface {...slotProps.overflowSurface}>\n <AvatarGroupContext.Provider value={{ isOverflow: true, layout, size: 24 }}>\n <slots.overflowContent {...slotProps.overflowContent} />\n </AvatarGroupContext.Provider>\n </slots.overflowSurface>\n </Popover>\n )}\n </slots.root>\n </AvatarGroupContext.Provider>\n );\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { AvatarGroupItem } from '../AvatarGroupItem/AvatarGroupItem';
|
|
3
2
|
import { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';
|
|
4
3
|
import { MoreHorizontalRegular } from '@fluentui/react-icons';
|
|
5
4
|
import { PopoverSurface } from '@fluentui/react-popover';
|
|
@@ -24,12 +23,6 @@ export const useAvatarGroup_unstable = (props, ref) => {
|
|
|
24
23
|
overflowIndicator = size < 24 ? 'icon' : 'count'
|
|
25
24
|
} = props;
|
|
26
25
|
const childrenArray = React.Children.toArray(children);
|
|
27
|
-
|
|
28
|
-
if (process.env.NODE_ENV !== 'production' && childrenArray.find(child => /*#__PURE__*/React.isValidElement(child) && child.type !== AvatarGroupItem)) {
|
|
29
|
-
// eslint-disable-next-line no-console
|
|
30
|
-
console.warn("AvatarGroup's children must be of type AvatarGroupItems.");
|
|
31
|
-
}
|
|
32
|
-
|
|
33
26
|
let rootChildren = childrenArray;
|
|
34
27
|
let overflowChildren;
|
|
35
28
|
let overflowButtonChildren;
|
|
@@ -58,7 +51,8 @@ export const useAvatarGroup_unstable = (props, ref) => {
|
|
|
58
51
|
const overflowButton = resolveShorthand(props.overflowButton, {
|
|
59
52
|
required: true,
|
|
60
53
|
defaultProps: {
|
|
61
|
-
children: overflowButtonChildren
|
|
54
|
+
children: overflowButtonChildren,
|
|
55
|
+
type: 'button'
|
|
62
56
|
}
|
|
63
57
|
});
|
|
64
58
|
const overflowContent = resolveShorthand(props.overflowContent, {
|
|
@@ -70,6 +64,9 @@ export const useAvatarGroup_unstable = (props, ref) => {
|
|
|
70
64
|
tabIndex: 0
|
|
71
65
|
}
|
|
72
66
|
});
|
|
67
|
+
const overflowSurface = resolveShorthand(props.overflowSurface, {
|
|
68
|
+
required: true
|
|
69
|
+
});
|
|
73
70
|
return {
|
|
74
71
|
nonOverflowAvatarsCount: rootChildren.length,
|
|
75
72
|
hasOverflow: !!overflowChildren,
|
|
@@ -79,12 +76,14 @@ export const useAvatarGroup_unstable = (props, ref) => {
|
|
|
79
76
|
tooltipContent: 'View more people.',
|
|
80
77
|
components: {
|
|
81
78
|
root: 'div',
|
|
82
|
-
overflowContent:
|
|
83
|
-
overflowButton: 'button'
|
|
79
|
+
overflowContent: 'div',
|
|
80
|
+
overflowButton: 'button',
|
|
81
|
+
overflowSurface: PopoverSurface
|
|
84
82
|
},
|
|
85
83
|
root,
|
|
86
84
|
overflowButton,
|
|
87
|
-
overflowContent
|
|
85
|
+
overflowContent,
|
|
86
|
+
overflowSurface
|
|
88
87
|
};
|
|
89
88
|
};
|
|
90
89
|
export const defaultAvatarGroupSize = 32;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/AvatarGroup/useAvatarGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,
|
|
1
|
+
{"version":3,"sources":["components/AvatarGroup/useAvatarGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,qBAAT,EAAgC,gBAAhC,QAAwD,2BAAxD;AACA,SAAS,qBAAT,QAAsC,uBAAtC;AACA,SAAS,cAAT,QAA+B,yBAA/B;AAGA;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WA,MAAM,cAAc,GAAG,gBAAgB,CAAC,KAAK,CAAC,cAAP,EAAuB;IAC5D,QAAQ,EAAE,IADkD;IAE5D,YAAY,EAAE;MACZ,QAAQ,EAAE,sBADE;MAEZ,IAAI,EAAE;IAFM;EAF8C,CAAvB,CAAvC;EAQA,MAAM,eAAe,GAAG,gBAAgB,CAAC,KAAK,CAAC,eAAP,EAAwB;IAC9D,QAAQ,EAAE,IADoD;IAE9D,YAAY,EAAE;MACZ,cAAc,UADF;MAEZ,QAAQ,EAAE,gBAFE;MAGZ,IAAI,EAAE,MAHM;MAIZ,QAAQ,EAAE;IAJE;EAFgD,CAAxB,CAAxC;EAUA,MAAM,eAAe,GAAG,gBAAgB,CAAC,KAAK,CAAC,eAAP,EAAwB;IAC9D,QAAQ,EAAE;EADoD,CAAxB,CAAxC;EAIA,OAAO;IACL,uBAAuB,EAAE,YAAY,CAAC,MADjC;IAEL,WAAW,EAAE,CAAC,CAAC,gBAFV;IAGL,MAHK;IAIL,iBAJK;IAKL,IALK;IAML,cAAc,EAAE,mBANX;IAQL,UAAU,EAAE;MACV,IAAI,EAAE,KADI;MAEV,eAAe,EAAE,KAFP;MAGV,cAAc,EAAE,QAHN;MAIV,eAAe,EAAE;IAJP,CARP;IAeL,IAfK;IAgBL,cAhBK;IAiBL,eAjBK;IAkBL;EAlBK,CAAP;AAoBD,CA9EM;AAgFP,OAAO,MAAM,sBAAsB,GAAG,EAA/B","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport { MoreHorizontalRegular } from '@fluentui/react-icons';\nimport { PopoverSurface } from '@fluentui/react-popover';\nimport type { AvatarGroupProps, AvatarGroupState } from './AvatarGroup.types';\n\n/**\n * Create the state required to render AvatarGroup.\n *\n * The returned state can be modified with hooks such as useAvatarGroupStyles_unstable,\n * before being passed to renderAvatarGroup_unstable.\n *\n * @param props - props from this instance of AvatarGroup\n * @param ref - reference to root HTMLElement of AvatarGroup\n */\nexport const useAvatarGroup_unstable = (props: AvatarGroupProps, ref: React.Ref<HTMLElement>): AvatarGroupState => {\n const { children, layout = 'spread', maxAvatars = 5, size = defaultAvatarGroupSize } = props;\n const { overflowIndicator = size < 24 ? 'icon' : 'count' } = props;\n const childrenArray = React.Children.toArray(children);\n\n let rootChildren = childrenArray;\n let overflowChildren;\n let overflowButtonChildren;\n\n if (layout === 'pie') {\n rootChildren = childrenArray.slice(0, 3);\n overflowChildren = childrenArray;\n } else if (childrenArray.length > maxAvatars) {\n const numOfAvatarsToHide = childrenArray.length - maxAvatars + 1;\n\n rootChildren = childrenArray.slice(numOfAvatarsToHide);\n overflowChildren = childrenArray.slice(0, numOfAvatarsToHide);\n\n if (overflowIndicator === 'icon') {\n overflowButtonChildren = <MoreHorizontalRegular />;\n } else {\n overflowButtonChildren = numOfAvatarsToHide > 99 ? '99+' : `+${numOfAvatarsToHide}`;\n }\n }\n\n const root = getNativeElementProps(\n 'div',\n {\n role: 'group',\n ...props,\n ref,\n children: rootChildren,\n },\n ['size'],\n );\n\n const overflowButton = resolveShorthand(props.overflowButton, {\n required: true,\n defaultProps: {\n children: overflowButtonChildren,\n type: 'button',\n },\n });\n\n const overflowContent = resolveShorthand(props.overflowContent, {\n required: true,\n defaultProps: {\n 'aria-label': 'Overflow',\n children: overflowChildren,\n role: 'list',\n tabIndex: 0,\n },\n });\n\n const overflowSurface = resolveShorthand(props.overflowSurface, {\n required: true,\n });\n\n return {\n nonOverflowAvatarsCount: rootChildren.length,\n hasOverflow: !!overflowChildren,\n layout,\n overflowIndicator,\n size,\n tooltipContent: 'View more people.',\n\n components: {\n root: 'div',\n overflowContent: 'div',\n overflowButton: 'button',\n overflowSurface: PopoverSurface,\n },\n\n root,\n overflowButton,\n overflowContent,\n overflowSurface,\n };\n};\n\nexport const defaultAvatarGroupSize = 32;\n"],"sourceRoot":"../src/"}
|
|
@@ -6,7 +6,8 @@ import { useGroupChildClassName } from '../../AvatarGroupItem';
|
|
|
6
6
|
export const avatarGroupClassNames = {
|
|
7
7
|
root: 'fui-AvatarGroup',
|
|
8
8
|
overflowContent: 'fui-AvatarGroup__overflowContent',
|
|
9
|
-
overflowButton: 'fui-AvatarGroup__overflowButton'
|
|
9
|
+
overflowButton: 'fui-AvatarGroup__overflowButton',
|
|
10
|
+
overflowSurface: 'fui-AvatarGroup__overflowSurface'
|
|
10
11
|
};
|
|
11
12
|
/**
|
|
12
13
|
* Styles for the root slot.
|
|
@@ -19,24 +20,31 @@ const useStyles = /*#__PURE__*/__styles({
|
|
|
19
20
|
},
|
|
20
21
|
"pie": {
|
|
21
22
|
"Bgl5zvf": "f1uz6ud1",
|
|
23
|
+
"De3pzq": "f1ganh6p",
|
|
22
24
|
"Bsw6fvg": "fe2ae1k"
|
|
23
25
|
},
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
"
|
|
26
|
+
"overflowSurface": {
|
|
27
|
+
"z8tnut": "f1g0x7ka",
|
|
28
|
+
"z189sj": ["fhxju0i", "f1cnd47f"],
|
|
29
|
+
"Byoj8tv": "f1qch9an",
|
|
30
|
+
"uwmqm3": ["f1cnd47f", "fhxju0i"]
|
|
31
|
+
},
|
|
32
|
+
"overflowContent": {
|
|
33
|
+
"Bxyxcbc": "fopcw2o",
|
|
34
|
+
"sshi5w": "f1n5o1gx",
|
|
35
|
+
"B68tc82": "f1p9o1ba",
|
|
36
|
+
"Bmxbyg5": "fqkkaap",
|
|
37
|
+
"z8tnut": "f17mpqex",
|
|
38
|
+
"z189sj": ["f1vdfbxk", "f1f5gg8d"],
|
|
39
|
+
"Byoj8tv": "fdvome7",
|
|
40
|
+
"uwmqm3": ["f1f5gg8d", "f1vdfbxk"],
|
|
41
|
+
"a9b677": "f13dwy2t"
|
|
33
42
|
}
|
|
34
43
|
}, {
|
|
35
|
-
"d": [".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f10pi13n{position:relative;}", ".f1uz6ud1{-webkit-clip-path:circle(50%);clip-path:circle(50%);}", "
|
|
44
|
+
"d": [".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f10pi13n{position:relative;}", ".f1uz6ud1{-webkit-clip-path:circle(50%);clip-path:circle(50%);}", ".f1ganh6p{background-color:var(--colorTransparentStroke);}", ".f1g0x7ka{padding-top:0;}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f1qch9an{padding-bottom:0;}", ".fopcw2o{max-height:220px;}", ".f1n5o1gx{min-height:80px;}", ".f1p9o1ba{overflow-x:hidden;}", ".fqkkaap{overflow-y:scroll;}", ".f17mpqex{padding-top:var(--spacingHorizontalS);}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".fdvome7{padding-bottom:var(--spacingHorizontalS);}", ".f13dwy2t{width:220px;}"],
|
|
36
45
|
"m": [["@media (forced-colors: active){.fe2ae1k{background-color:CanvasText;}}", {
|
|
37
46
|
"m": "(forced-colors: active)"
|
|
38
|
-
}]]
|
|
39
|
-
"f": [".ftqa4ok:focus{outline-style:none;}"]
|
|
47
|
+
}]]
|
|
40
48
|
});
|
|
41
49
|
/**
|
|
42
50
|
* Styles for overflow button slot.
|
|
@@ -83,6 +91,21 @@ const useOverflowButtonStyles = /*#__PURE__*/__styles({
|
|
|
83
91
|
"B32s92o": "fgeg2qa",
|
|
84
92
|
"B5hngm5": "fhcq1yo"
|
|
85
93
|
},
|
|
94
|
+
"pieFocusIndicator": {
|
|
95
|
+
"Brovlpu": "ftqa4ok",
|
|
96
|
+
"rkqiyj": "f1gx8lax",
|
|
97
|
+
"Bs3nqqt": ["f1as8ps8", "f17o1ya2"],
|
|
98
|
+
"B4mky7d": "f1amggu6",
|
|
99
|
+
"Bviepcv": ["f17o1ya2", "f1as8ps8"],
|
|
100
|
+
"Bc28wk5": "flnfwa4",
|
|
101
|
+
"w1edd7": ["fuav46a", "fcnogh1"],
|
|
102
|
+
"Ba8awiv": "f19zilzp",
|
|
103
|
+
"I50xcx": ["fcnogh1", "fuav46a"],
|
|
104
|
+
"Bnmjwt4": "f119w1j1",
|
|
105
|
+
"Jopkrh": ["f1wlf18u", "fcqg1ja"],
|
|
106
|
+
"hhrs2v": "ft77uen",
|
|
107
|
+
"B7jbng7": ["fcqg1ja", "f1wlf18u"]
|
|
108
|
+
},
|
|
86
109
|
"states": {
|
|
87
110
|
"Bi91k9c": "feu1g3u",
|
|
88
111
|
"Jwef8y": "f1knas48",
|
|
@@ -187,7 +210,7 @@ const useOverflowButtonStyles = /*#__PURE__*/__styles({
|
|
|
187
210
|
"ibv6hh": ["f1g0iy8l", "figl7jc"]
|
|
188
211
|
}
|
|
189
212
|
}, {
|
|
190
|
-
"d": [".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f10pi13n{position:relative;}", ".fi64zpg{-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".fj3muxo{border-top-color:var(--colorNeutralStroke1);}", ".f1akhkt{border-right-color:var(--colorNeutralStroke1);}", ".f1lxtadh{border-left-color:var(--colorNeutralStroke1);}", ".f1aperda{border-bottom-color:var(--colorNeutralStroke1);}", ".f8fbkgy{border-bottom-right-radius:var(--borderRadiusCircular);}", ".f1nfllo7{border-bottom-left-radius:var(--borderRadiusCircular);}", ".f1djnp8u{border-top-right-radius:var(--borderRadiusCircular);}", ".f1s8kh49{border-top-left-radius:var(--borderRadiusCircular);}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".f1g0x7ka{padding-top:0;}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f1qch9an{padding-bottom:0;}", "[data-keyboard-nav] .flfsvnh:focus{border-top-color:transparent;}", "[data-keyboard-nav] .f1781m5e:focus{border-right-color:transparent;}", "[data-keyboard-nav] .flvaaa9:focus{border-left-color:transparent;}", "[data-keyboard-nav] .f50u1b5:focus{border-bottom-color:transparent;}", "[data-keyboard-nav] .foqs3zz:focus{outline-color:var(--colorStrokeFocus2);}", "[data-keyboard-nav] .fgeg2qa:focus{outline-width:var(--strokeWidthThick);}", "[data-keyboard-nav] .fhcq1yo:focus{outline-style:solid;}", ".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".fghlq4f{border-top-color:var(--colorTransparentStroke);}", ".f1gn591s{border-right-color:var(--colorTransparentStroke);}", ".fjscplz{border-left-color:var(--colorTransparentStroke);}", ".fb073pr{border-bottom-color:var(--colorTransparentStroke);}", ".f44pa96{color:transparent;}", ".f1ugzwwg{font-size:12px;}", ".f4ybsrx{font-size:16px;}", ".fe5j1ua{font-size:20px;}", ".f1rt2boy{font-size:24px;}", ".f24l1pt{font-size:28px;}", ".ffl51b{font-size:32px;}", ".f18m8u13{font-size:48px;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".f13mqy1h{font-size:var(--fontSizeBase100);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".fcpl73t{line-height:var(--lineHeightBase100);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".faaz57k{line-height:var(--lineHeightBase400);}", ".f1pp30po{font-size:var(--fontSizeBase500);}", ".f106mvju{line-height:var(--lineHeightBase500);}", ".f1x0m3f5{font-size:var(--fontSizeBase600);}", ".fb86gi6{line-height:var(--lineHeightBase600);}", ".f192inf7{border-top-width:var(--strokeWidthThin);}", ".f5tn483{border-right-width:var(--strokeWidthThin);}", ".f1ojsxk5{border-left-width:var(--strokeWidthThin);}", ".f1vxd6vx{border-bottom-width:var(--strokeWidthThin);}", ".f18zi460{border-top-width:var(--strokeWidthThick);}", ".f1wpluaz{border-right-width:var(--strokeWidthThick);}", ".fsfsuhs{border-left-width:var(--strokeWidthThick);}", ".fmklw6v{border-bottom-width:var(--strokeWidthThick);}", ".fgx37oo{border-top-width:var(--strokeWidthThicker);}", ".f130t4y6{border-right-width:var(--strokeWidthThicker);}", ".f1efpmoh{border-left-width:var(--strokeWidthThicker);}", ".fv51ejd{border-bottom-width:var(--strokeWidthThicker);}", ".fwn6jck{border-top-width:var(--strokeWidthThickest);}", ".figl7jc{border-right-width:var(--strokeWidthThickest);}", ".f1g0iy8l{border-left-width:var(--strokeWidthThickest);}", ".f1b8shu7{border-bottom-width:var(--strokeWidthThickest);}"],
|
|
213
|
+
"d": [".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f10pi13n{position:relative;}", ".fi64zpg{-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".fj3muxo{border-top-color:var(--colorNeutralStroke1);}", ".f1akhkt{border-right-color:var(--colorNeutralStroke1);}", ".f1lxtadh{border-left-color:var(--colorNeutralStroke1);}", ".f1aperda{border-bottom-color:var(--colorNeutralStroke1);}", ".f8fbkgy{border-bottom-right-radius:var(--borderRadiusCircular);}", ".f1nfllo7{border-bottom-left-radius:var(--borderRadiusCircular);}", ".f1djnp8u{border-top-right-radius:var(--borderRadiusCircular);}", ".f1s8kh49{border-top-left-radius:var(--borderRadiusCircular);}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".f1g0x7ka{padding-top:0;}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f1qch9an{padding-bottom:0;}", "[data-keyboard-nav] .flfsvnh:focus{border-top-color:transparent;}", "[data-keyboard-nav] .f1781m5e:focus{border-right-color:transparent;}", "[data-keyboard-nav] .flvaaa9:focus{border-left-color:transparent;}", "[data-keyboard-nav] .f50u1b5:focus{border-bottom-color:transparent;}", "[data-keyboard-nav] .foqs3zz:focus{outline-color:var(--colorStrokeFocus2);}", "[data-keyboard-nav] .fgeg2qa:focus{outline-width:var(--strokeWidthThick);}", "[data-keyboard-nav] .fhcq1yo:focus{outline-style:solid;}", "[data-keyboard-nav] .f1gx8lax:focus{border-top-width:var(--strokeWidthThick);}", "[data-keyboard-nav] .f1as8ps8:focus{border-right-width:var(--strokeWidthThick);}", "[data-keyboard-nav] .f17o1ya2:focus{border-left-width:var(--strokeWidthThick);}", "[data-keyboard-nav] .f1amggu6:focus{border-bottom-width:var(--strokeWidthThick);}", "[data-keyboard-nav] .flnfwa4:focus{border-top-style:solid;}", "[data-keyboard-nav] .fuav46a:focus{border-right-style:solid;}", "[data-keyboard-nav] .fcnogh1:focus{border-left-style:solid;}", "[data-keyboard-nav] .f19zilzp:focus{border-bottom-style:solid;}", "[data-keyboard-nav] .f119w1j1:focus{border-top-color:var(--colorStrokeFocus2);}", "[data-keyboard-nav] .f1wlf18u:focus{border-right-color:var(--colorStrokeFocus2);}", "[data-keyboard-nav] .fcqg1ja:focus{border-left-color:var(--colorStrokeFocus2);}", "[data-keyboard-nav] .ft77uen:focus{border-bottom-color:var(--colorStrokeFocus2);}", ".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".fghlq4f{border-top-color:var(--colorTransparentStroke);}", ".f1gn591s{border-right-color:var(--colorTransparentStroke);}", ".fjscplz{border-left-color:var(--colorTransparentStroke);}", ".fb073pr{border-bottom-color:var(--colorTransparentStroke);}", ".f44pa96{color:transparent;}", ".f1ugzwwg{font-size:12px;}", ".f4ybsrx{font-size:16px;}", ".fe5j1ua{font-size:20px;}", ".f1rt2boy{font-size:24px;}", ".f24l1pt{font-size:28px;}", ".ffl51b{font-size:32px;}", ".f18m8u13{font-size:48px;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".f13mqy1h{font-size:var(--fontSizeBase100);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".fcpl73t{line-height:var(--lineHeightBase100);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".faaz57k{line-height:var(--lineHeightBase400);}", ".f1pp30po{font-size:var(--fontSizeBase500);}", ".f106mvju{line-height:var(--lineHeightBase500);}", ".f1x0m3f5{font-size:var(--fontSizeBase600);}", ".fb86gi6{line-height:var(--lineHeightBase600);}", ".f192inf7{border-top-width:var(--strokeWidthThin);}", ".f5tn483{border-right-width:var(--strokeWidthThin);}", ".f1ojsxk5{border-left-width:var(--strokeWidthThin);}", ".f1vxd6vx{border-bottom-width:var(--strokeWidthThin);}", ".f18zi460{border-top-width:var(--strokeWidthThick);}", ".f1wpluaz{border-right-width:var(--strokeWidthThick);}", ".fsfsuhs{border-left-width:var(--strokeWidthThick);}", ".fmklw6v{border-bottom-width:var(--strokeWidthThick);}", ".fgx37oo{border-top-width:var(--strokeWidthThicker);}", ".f130t4y6{border-right-width:var(--strokeWidthThicker);}", ".f1efpmoh{border-left-width:var(--strokeWidthThicker);}", ".fv51ejd{border-bottom-width:var(--strokeWidthThicker);}", ".fwn6jck{border-top-width:var(--strokeWidthThickest);}", ".figl7jc{border-right-width:var(--strokeWidthThickest);}", ".f1g0iy8l{border-left-width:var(--strokeWidthThickest);}", ".f1b8shu7{border-bottom-width:var(--strokeWidthThickest);}"],
|
|
191
214
|
"m": [["@media (forced-colors: active){.fw33nwi{border-top-color:CanvasText;}}", {
|
|
192
215
|
"m": "(forced-colors: active)"
|
|
193
216
|
}], ["@media (forced-colors: active){.f1ptkjjm{border-right-color:CanvasText;}.fmzzjfk{border-left-color:CanvasText;}}", {
|
|
@@ -201,26 +224,6 @@ const useOverflowButtonStyles = /*#__PURE__*/__styles({
|
|
|
201
224
|
"h": [".feu1g3u:hover{color:var(--colorNeutralForeground1Hover);}", ".f1knas48:hover{background-color:var(--colorNeutralBackground1Hover);}", ".fvcxoqz:hover{border-top-color:var(--colorNeutralStroke1Hover);}", ".f1ub3y4t:hover{border-right-color:var(--colorNeutralStroke1Hover);}", ".f1m52nbi:hover{border-left-color:var(--colorNeutralStroke1Hover);}", ".f1xlaoq0:hover{border-bottom-color:var(--colorNeutralStroke1Hover);}"],
|
|
202
225
|
"a": [".f1g4hkjv:active{color:var(--colorNeutralForeground1Pressed);}", ".fb40n2d:active{background-color:var(--colorNeutralBackground1Pressed);}", ".fvs00aa:active{border-top-color:var(--colorNeutralStroke1Pressed);}", ".f1assf6x:active{border-right-color:var(--colorNeutralStroke1Pressed);}", ".f4ruux4:active{border-left-color:var(--colorNeutralStroke1Pressed);}", ".fumykes:active{border-bottom-color:var(--colorNeutralStroke1Pressed);}"]
|
|
203
226
|
});
|
|
204
|
-
/**
|
|
205
|
-
* Styles for overflow list slot.
|
|
206
|
-
*/
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
const useOverflowContentStyles = /*#__PURE__*/__styles({
|
|
210
|
-
"base": {
|
|
211
|
-
"Bxyxcbc": "fopcw2o",
|
|
212
|
-
"sshi5w": "f1n5o1gx",
|
|
213
|
-
"B68tc82": "f1p9o1ba",
|
|
214
|
-
"Bmxbyg5": "fqkkaap",
|
|
215
|
-
"z8tnut": "f17mpqex",
|
|
216
|
-
"z189sj": ["f1vdfbxk", "f1f5gg8d"],
|
|
217
|
-
"Byoj8tv": "fdvome7",
|
|
218
|
-
"uwmqm3": ["f1f5gg8d", "f1vdfbxk"],
|
|
219
|
-
"a9b677": "f13dwy2t"
|
|
220
|
-
}
|
|
221
|
-
}, {
|
|
222
|
-
"d": [".fopcw2o{max-height:220px;}", ".f1n5o1gx{min-height:80px;}", ".f1p9o1ba{overflow-x:hidden;}", ".fqkkaap{overflow-y:scroll;}", ".f17mpqex{padding-top:var(--spacingHorizontalS);}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".fdvome7{padding-bottom:var(--spacingHorizontalS);}", ".f13dwy2t{width:220px;}"]
|
|
223
|
-
});
|
|
224
227
|
/**
|
|
225
228
|
* Apply styling to the AvatarGroup slots based on the state
|
|
226
229
|
*/
|
|
@@ -234,13 +237,16 @@ export const useAvatarGroupStyles_unstable = state => {
|
|
|
234
237
|
} = state;
|
|
235
238
|
const styles = useStyles();
|
|
236
239
|
const sizeStyles = useSizeStyles();
|
|
237
|
-
const overflowContentStyles = useOverflowContentStyles();
|
|
238
240
|
const overflowButtonStyles = useOverflowButtonStyles();
|
|
239
241
|
const groupChildClassName = useGroupChildClassName(layout, size, true);
|
|
240
|
-
state.root.className = mergeClasses(avatarGroupClassNames.root, styles.base, layout === 'pie' && styles.pie, layout === 'pie' && sizeStyles[size],
|
|
242
|
+
state.root.className = mergeClasses(avatarGroupClassNames.root, styles.base, layout === 'pie' && styles.pie, layout === 'pie' && sizeStyles[size], state.root.className);
|
|
241
243
|
|
|
242
244
|
if (state.overflowContent) {
|
|
243
|
-
state.overflowContent.className = mergeClasses(avatarGroupClassNames.overflowContent,
|
|
245
|
+
state.overflowContent.className = mergeClasses(avatarGroupClassNames.overflowContent, styles.overflowContent, state.overflowContent.className);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
if (state.overflowSurface) {
|
|
249
|
+
state.overflowSurface.className = mergeClasses(avatarGroupClassNames.overflowSurface, styles.overflowSurface, state.overflowSurface.className);
|
|
244
250
|
}
|
|
245
251
|
|
|
246
252
|
const overflowButtonClasses = [];
|
|
@@ -288,7 +294,7 @@ export const useAvatarGroupStyles_unstable = state => {
|
|
|
288
294
|
}
|
|
289
295
|
|
|
290
296
|
if (state.overflowButton) {
|
|
291
|
-
state.overflowButton.className = mergeClasses(avatarGroupClassNames.overflowButton, sizeStyles[size], overflowButtonStyles.base, ...overflowButtonClasses, layout !== 'pie' && overflowButtonStyles.states, layout !== 'pie' && overflowButtonStyles.focusIndicator, layout === 'pie' && overflowButtonStyles.pie, groupChildClassName, state.overflowButton.className);
|
|
297
|
+
state.overflowButton.className = mergeClasses(avatarGroupClassNames.overflowButton, sizeStyles[size], overflowButtonStyles.base, ...overflowButtonClasses, layout !== 'pie' && overflowButtonStyles.states, layout !== 'pie' && overflowButtonStyles.focusIndicator, layout === 'pie' && overflowButtonStyles.pieFocusIndicator, layout === 'pie' && overflowButtonStyles.pie, groupChildClassName, state.overflowButton.className);
|
|
292
298
|
}
|
|
293
299
|
|
|
294
300
|
return state;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/AvatarGroup/useAvatarGroupStyles.ts"],"names":[],"mappings":"AAAA,SAAS,+BAAT,QAAgD,yBAAhD;AACA,mBAAqB,YAArB,EAAmC,UAAnC,QAAqD,gBAArD;AACA,SAAS,MAAT,EAAiB,gBAAjB,QAAyC,uBAAzC;AACA,SAAS,aAAT,QAA8B,2BAA9B;AAGA,SAAS,sBAAT,QAAuC,uBAAvC;AAEA,OAAO,MAAM,qBAAqB,GAAqC;EACrE,IAAI,EAAE,iBAD+D;EAErE,eAAe,EAAE,kCAFoD;EAGrE,cAAc,EAAE;AAHqD,CAAhE;AAMP;;AAEG;;AACH,MAAM,SAAS,gBAAG;EAAA;IAAA;IAAA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AC,MAAhD;IACD,CAFM,MAEA,IAAI,IAAI,IAAI,EAAZ,EAAgB;MACrB,qBAAqB,CAAC,IAAtB,CAA2B,oBAAoB,CAAC,MAAhD;IACD,CAFM,MAEA;MACL,qBAAqB,CAAC,IAAtB,CAA2B,oBAAoB,CAAC,MAAhD;IACD;EACF;;EAED,IAAI,KAAK,CAAC,cAAV,EAA0B;IACxB,KAAK,CAAC,cAAN,CAAqB,SAArB,GAAiC,YAAY,CAC3C,qBAAqB,CAAC,cADqB,EAE3C,UAAU,CAAC,IAAD,CAFiC,EAG3C,oBAAoB,CAAC,IAHsB,EAI3C,GAAG,qBAJwC,EAK3C,MAAM,KAAK,KAAX,IAAoB,oBAAoB,CAAC,MALE,EAM3C,MAAM,KAAK,KAAX,IAAoB,oBAAoB,CAAC,cANE,EAO3C,MAAM,KAAK,KAAX,IAAoB,oBAAoB,CAAC,GAPE,EAQ3C,mBAR2C,EAS3C,KAAK,CAAC,cAAN,CAAqB,SATsB,CAA7C;EAWD;;EAED,OAAO,KAAP;AACD,CArFM","sourcesContent":["import { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { useSizeStyles } from '../Avatar/useAvatarStyles';\nimport type { AvatarGroupSlots, AvatarGroupState } from './AvatarGroup.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { useGroupChildClassName } from '../../AvatarGroupItem';\n\nexport const avatarGroupClassNames: SlotClassNames<AvatarGroupSlots> = {\n root: 'fui-AvatarGroup',\n overflowContent: 'fui-AvatarGroup__overflowContent',\n overflowButton: 'fui-AvatarGroup__overflowButton',\n};\n\n/**\n * Styles for the root slot.\n */\nconst useStyles = makeStyles({\n base: {\n display: 'inline-flex',\n position: 'relative',\n },\n pie: {\n clipPath: 'circle(50%)',\n '@media (forced-colors: active)': {\n backgroundColor: 'CanvasText',\n },\n },\n focusIndicator: createCustomFocusIndicatorStyle(\n {\n ...shorthands.borderColor('transparent'),\n outlineColor: tokens.colorStrokeFocus2,\n outlineWidth: tokens.strokeWidthThick,\n outlineStyle: 'solid',\n },\n { selector: 'focus-within' },\n ),\n});\n\n/**\n * Styles for overflow button slot.\n */\nconst useOverflowButtonStyles = makeStyles({\n base: {\n display: 'inline-flex',\n position: 'relative',\n flexShrink: 0,\n justifyContent: 'center',\n alignItems: 'center',\n color: tokens.colorNeutralForeground1,\n backgroundColor: tokens.colorNeutralBackground1,\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n ...shorthands.borderStyle('solid'),\n ...shorthands.padding(0),\n\n // match color to Avatar's outline color\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('CanvasText'),\n },\n },\n\n // These styles match the default button styles\n focusIndicator: createCustomFocusIndicatorStyle({\n ...shorthands.borderColor('transparent'),\n outlineColor: tokens.colorStrokeFocus2,\n outlineWidth: tokens.strokeWidthThick,\n outlineStyle: 'solid',\n }),\n\n states: {\n ':hover': {\n color: tokens.colorNeutralForeground1Hover,\n backgroundColor: tokens.colorNeutralBackground1Hover,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n },\n ':active': {\n color: tokens.colorNeutralForeground1Pressed,\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n },\n },\n\n pie: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n color: 'transparent',\n },\n\n icon12: { fontSize: '12px' },\n icon16: { fontSize: '16px' },\n icon20: { fontSize: '20px' },\n icon24: { fontSize: '24px' },\n icon28: { fontSize: '28px' },\n icon32: { fontSize: '32px' },\n icon48: { fontSize: '48px' },\n caption2Strong: { ...typographyStyles.caption2Strong },\n caption1Strong: { ...typographyStyles.caption1Strong },\n body1Strong: { ...typographyStyles.body1Strong },\n subtitle2: { ...typographyStyles.subtitle2 },\n subtitle1: { ...typographyStyles.subtitle1 },\n title3: { ...typographyStyles.title3 },\n borderThin: { ...shorthands.borderWidth(tokens.strokeWidthThin) },\n borderThick: { ...shorthands.borderWidth(tokens.strokeWidthThick) },\n borderThicker: { ...shorthands.borderWidth(tokens.strokeWidthThicker) },\n borderThickest: { ...shorthands.borderWidth(tokens.strokeWidthThickest) },\n});\n\n/**\n * Styles for overflow list slot.\n */\nconst useOverflowContentStyles = makeStyles({\n base: {\n maxHeight: '220px',\n minHeight: '80px',\n ...shorthands.overflow('hidden', 'scroll'),\n ...shorthands.padding(tokens.spacingHorizontalS),\n width: '220px',\n },\n});\n\n/**\n * Apply styling to the AvatarGroup slots based on the state\n */\nexport const useAvatarGroupStyles_unstable = (state: AvatarGroupState): AvatarGroupState => {\n const { layout, overflowIndicator, size } = state;\n const styles = useStyles();\n const sizeStyles = useSizeStyles();\n const overflowContentStyles = useOverflowContentStyles();\n const overflowButtonStyles = useOverflowButtonStyles();\n\n const groupChildClassName = useGroupChildClassName(layout, size, true);\n\n state.root.className = mergeClasses(\n avatarGroupClassNames.root,\n styles.base,\n layout === 'pie' && styles.pie,\n layout === 'pie' && sizeStyles[size],\n layout === 'pie' && styles.focusIndicator,\n state.root.className,\n );\n\n if (state.overflowContent) {\n state.overflowContent.className = mergeClasses(\n avatarGroupClassNames.overflowContent,\n overflowContentStyles.base,\n state.overflowContent.className,\n );\n }\n\n const overflowButtonClasses = [];\n\n if (size < 36) {\n overflowButtonClasses.push(overflowButtonStyles.borderThin);\n } else if (size < 56) {\n overflowButtonClasses.push(overflowButtonStyles.borderThick);\n } else if (size < 72) {\n overflowButtonClasses.push(overflowButtonStyles.borderThicker);\n } else {\n overflowButtonClasses.push(overflowButtonStyles.borderThickest);\n }\n\n if (overflowIndicator === 'count') {\n if (size <= 24) {\n overflowButtonClasses.push(overflowButtonStyles.caption2Strong);\n } else if (size <= 28) {\n overflowButtonClasses.push(overflowButtonStyles.caption1Strong);\n } else if (size <= 40) {\n overflowButtonClasses.push(overflowButtonStyles.body1Strong);\n } else if (size <= 56) {\n overflowButtonClasses.push(overflowButtonStyles.subtitle2);\n } else if (size <= 96) {\n overflowButtonClasses.push(overflowButtonStyles.subtitle1);\n } else {\n overflowButtonClasses.push(overflowButtonStyles.title3);\n }\n } else {\n if (size <= 16) {\n overflowButtonClasses.push(overflowButtonStyles.icon12);\n } else if (size <= 24) {\n overflowButtonClasses.push(overflowButtonStyles.icon16);\n } else if (size <= 40) {\n overflowButtonClasses.push(overflowButtonStyles.icon20);\n } else if (size <= 48) {\n overflowButtonClasses.push(overflowButtonStyles.icon24);\n } else if (size <= 56) {\n overflowButtonClasses.push(overflowButtonStyles.icon28);\n } else if (size <= 72) {\n overflowButtonClasses.push(overflowButtonStyles.icon32);\n } else {\n overflowButtonClasses.push(overflowButtonStyles.icon48);\n }\n }\n\n if (state.overflowButton) {\n state.overflowButton.className = mergeClasses(\n avatarGroupClassNames.overflowButton,\n sizeStyles[size],\n overflowButtonStyles.base,\n ...overflowButtonClasses,\n layout !== 'pie' && overflowButtonStyles.states,\n layout !== 'pie' && overflowButtonStyles.focusIndicator,\n layout === 'pie' && overflowButtonStyles.pie,\n groupChildClassName,\n state.overflowButton.className,\n );\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
|
1
|
+
{"version":3,"sources":["components/AvatarGroup/useAvatarGroupStyles.ts"],"names":[],"mappings":"AAAA,SAAS,+BAAT,QAAgD,yBAAhD;AACA,mBAAqB,YAArB,EAAmC,UAAnC,QAAqD,gBAArD;AACA,SAAS,MAAT,EAAiB,gBAAjB,QAAyC,uBAAzC;AACA,SAAS,aAAT,QAA8B,2BAA9B;AAGA,SAAS,sBAAT,QAAuC,uBAAvC;AAEA,OAAO,MAAM,qBAAqB,GAAqC;EACrE,IAAI,EAAE,iBAD+D;EAErE,eAAe,EAAE,kCAFoD;EAGrE,cAAc,EAAE,iCAHqD;EAIrE,eAAe,EAAE;AAJoD,CAAhE;AAOP;;AAEG;;AACH,MAAM,S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,IAAtB,CAA2B,oBAAoB,CAAC,MAAhD;IACD,CAFM,MAEA,IAAI,IAAI,IAAI,EAAZ,EAAgB;MACrB,qBAAqB,CAAC,IAAtB,CAA2B,oBAAoB,CAAC,MAAhD;IACD,CAFM,MAEA,IAAI,IAAI,IAAI,EAAZ,EAAgB;MACrB,qBAAqB,CAAC,IAAtB,CAA2B,oBAAoB,CAAC,MAAhD;IACD,CAFM,MAEA;MACL,qBAAqB,CAAC,IAAtB,CAA2B,oBAAoB,CAAC,MAAhD;IACD;EACF;;EAED,IAAI,KAAK,CAAC,cAAV,EAA0B;IACxB,KAAK,CAAC,cAAN,CAAqB,SAArB,GAAiC,YAAY,CAC3C,qBAAqB,CAAC,cADqB,EAE3C,UAAU,CAAC,IAAD,CAFiC,EAG3C,oBAAoB,CAAC,IAHsB,EAI3C,GAAG,qBAJwC,EAK3C,MAAM,KAAK,KAAX,IAAoB,oBAAoB,CAAC,MALE,EAM3C,MAAM,KAAK,KAAX,IAAoB,oBAAoB,CAAC,cANE,EAO3C,MAAM,KAAK,KAAX,IAAoB,oBAAoB,CAAC,iBAPE,EAQ3C,MAAM,KAAK,KAAX,IAAoB,oBAAoB,CAAC,GARE,EAS3C,mBAT2C,EAU3C,KAAK,CAAC,cAAN,CAAqB,SAVsB,CAA7C;EAYD;;EAED,OAAO,KAAP;AACD,CA5FM","sourcesContent":["import { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { useSizeStyles } from '../Avatar/useAvatarStyles';\nimport type { AvatarGroupSlots, AvatarGroupState } from './AvatarGroup.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { useGroupChildClassName } from '../../AvatarGroupItem';\n\nexport const avatarGroupClassNames: SlotClassNames<AvatarGroupSlots> = {\n root: 'fui-AvatarGroup',\n overflowContent: 'fui-AvatarGroup__overflowContent',\n overflowButton: 'fui-AvatarGroup__overflowButton',\n overflowSurface: 'fui-AvatarGroup__overflowSurface',\n};\n\n/**\n * Styles for the root slot.\n */\nconst useStyles = makeStyles({\n base: {\n display: 'inline-flex',\n position: 'relative',\n },\n pie: {\n clipPath: 'circle(50%)',\n backgroundColor: tokens.colorTransparentStroke,\n '@media (forced-colors: active)': {\n backgroundColor: 'CanvasText',\n },\n },\n overflowSurface: {\n ...shorthands.padding(0),\n },\n overflowContent: {\n maxHeight: '220px',\n minHeight: '80px',\n ...shorthands.overflow('hidden', 'scroll'),\n ...shorthands.padding(tokens.spacingHorizontalS),\n width: '220px',\n },\n});\n\n/**\n * Styles for overflow button slot.\n */\nconst useOverflowButtonStyles = makeStyles({\n base: {\n display: 'inline-flex',\n position: 'relative',\n flexShrink: 0,\n justifyContent: 'center',\n alignItems: 'center',\n color: tokens.colorNeutralForeground1,\n backgroundColor: tokens.colorNeutralBackground1,\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n ...shorthands.borderStyle('solid'),\n ...shorthands.padding(0),\n\n // match color to Avatar's outline color\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('CanvasText'),\n },\n },\n\n // These styles match the default button styles\n focusIndicator: createCustomFocusIndicatorStyle({\n ...shorthands.borderColor('transparent'),\n outlineColor: tokens.colorStrokeFocus2,\n outlineWidth: tokens.strokeWidthThick,\n outlineStyle: 'solid',\n }),\n\n // This custom focus indicator is required for the pie layout due to the clip-path applied to the root\n pieFocusIndicator: createCustomFocusIndicatorStyle({\n ...shorthands.border(tokens.strokeWidthThick, 'solid', tokens.colorStrokeFocus2),\n }),\n\n states: {\n ':hover': {\n color: tokens.colorNeutralForeground1Hover,\n backgroundColor: tokens.colorNeutralBackground1Hover,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n },\n ':active': {\n color: tokens.colorNeutralForeground1Pressed,\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n },\n },\n\n pie: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n color: 'transparent',\n },\n\n icon12: { fontSize: '12px' },\n icon16: { fontSize: '16px' },\n icon20: { fontSize: '20px' },\n icon24: { fontSize: '24px' },\n icon28: { fontSize: '28px' },\n icon32: { fontSize: '32px' },\n icon48: { fontSize: '48px' },\n caption2Strong: { ...typographyStyles.caption2Strong },\n caption1Strong: { ...typographyStyles.caption1Strong },\n body1Strong: { ...typographyStyles.body1Strong },\n subtitle2: { ...typographyStyles.subtitle2 },\n subtitle1: { ...typographyStyles.subtitle1 },\n title3: { ...typographyStyles.title3 },\n borderThin: { ...shorthands.borderWidth(tokens.strokeWidthThin) },\n borderThick: { ...shorthands.borderWidth(tokens.strokeWidthThick) },\n borderThicker: { ...shorthands.borderWidth(tokens.strokeWidthThicker) },\n borderThickest: { ...shorthands.borderWidth(tokens.strokeWidthThickest) },\n});\n\n/**\n * Apply styling to the AvatarGroup slots based on the state\n */\nexport const useAvatarGroupStyles_unstable = (state: AvatarGroupState): AvatarGroupState => {\n const { layout, overflowIndicator, size } = state;\n const styles = useStyles();\n const sizeStyles = useSizeStyles();\n const overflowButtonStyles = useOverflowButtonStyles();\n\n const groupChildClassName = useGroupChildClassName(layout, size, true);\n\n state.root.className = mergeClasses(\n avatarGroupClassNames.root,\n styles.base,\n layout === 'pie' && styles.pie,\n layout === 'pie' && sizeStyles[size],\n state.root.className,\n );\n\n if (state.overflowContent) {\n state.overflowContent.className = mergeClasses(\n avatarGroupClassNames.overflowContent,\n styles.overflowContent,\n state.overflowContent.className,\n );\n }\n\n if (state.overflowSurface) {\n state.overflowSurface.className = mergeClasses(\n avatarGroupClassNames.overflowSurface,\n styles.overflowSurface,\n state.overflowSurface.className,\n );\n }\n\n const overflowButtonClasses = [];\n\n if (size < 36) {\n overflowButtonClasses.push(overflowButtonStyles.borderThin);\n } else if (size < 56) {\n overflowButtonClasses.push(overflowButtonStyles.borderThick);\n } else if (size < 72) {\n overflowButtonClasses.push(overflowButtonStyles.borderThicker);\n } else {\n overflowButtonClasses.push(overflowButtonStyles.borderThickest);\n }\n\n if (overflowIndicator === 'count') {\n if (size <= 24) {\n overflowButtonClasses.push(overflowButtonStyles.caption2Strong);\n } else if (size <= 28) {\n overflowButtonClasses.push(overflowButtonStyles.caption1Strong);\n } else if (size <= 40) {\n overflowButtonClasses.push(overflowButtonStyles.body1Strong);\n } else if (size <= 56) {\n overflowButtonClasses.push(overflowButtonStyles.subtitle2);\n } else if (size <= 96) {\n overflowButtonClasses.push(overflowButtonStyles.subtitle1);\n } else {\n overflowButtonClasses.push(overflowButtonStyles.title3);\n }\n } else {\n if (size <= 16) {\n overflowButtonClasses.push(overflowButtonStyles.icon12);\n } else if (size <= 24) {\n overflowButtonClasses.push(overflowButtonStyles.icon16);\n } else if (size <= 40) {\n overflowButtonClasses.push(overflowButtonStyles.icon20);\n } else if (size <= 48) {\n overflowButtonClasses.push(overflowButtonStyles.icon24);\n } else if (size <= 56) {\n overflowButtonClasses.push(overflowButtonStyles.icon28);\n } else if (size <= 72) {\n overflowButtonClasses.push(overflowButtonStyles.icon32);\n } else {\n overflowButtonClasses.push(overflowButtonStyles.icon48);\n }\n }\n\n if (state.overflowButton) {\n state.overflowButton.className = mergeClasses(\n avatarGroupClassNames.overflowButton,\n sizeStyles[size],\n overflowButtonStyles.base,\n ...overflowButtonClasses,\n layout !== 'pie' && overflowButtonStyles.states,\n layout !== 'pie' && overflowButtonStyles.focusIndicator,\n layout === 'pie' && overflowButtonStyles.pieFocusIndicator,\n layout === 'pie' && overflowButtonStyles.pie,\n groupChildClassName,\n state.overflowButton.className,\n );\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -36,21 +36,22 @@ const renderAvatarGroup_unstable = state => {
|
|
|
36
36
|
nonOverflowAvatarsCount
|
|
37
37
|
}
|
|
38
38
|
}, React.createElement(slots.root, { ...slotProps.root
|
|
39
|
-
}, state.root.children, state.hasOverflow && slots.overflowButton && slots.overflowContent && React.createElement(react_popover_1.Popover, {
|
|
39
|
+
}, state.root.children, state.hasOverflow && slots.overflowButton && slots.overflowContent && slots.overflowSurface && React.createElement(react_popover_1.Popover, {
|
|
40
40
|
trapFocus: true,
|
|
41
41
|
size: "small"
|
|
42
42
|
}, React.createElement(react_popover_1.PopoverTrigger, null, React.createElement(react_tooltip_1.Tooltip, {
|
|
43
43
|
content: state.tooltipContent,
|
|
44
44
|
relationship: "label"
|
|
45
45
|
}, React.createElement(slots.overflowButton, { ...slotProps.overflowButton
|
|
46
|
-
}))), React.createElement(
|
|
46
|
+
}))), React.createElement(slots.overflowSurface, { ...slotProps.overflowSurface
|
|
47
|
+
}, React.createElement(AvatarGroupContext_1.AvatarGroupContext.Provider, {
|
|
47
48
|
value: {
|
|
48
49
|
isOverflow: true,
|
|
49
50
|
layout,
|
|
50
51
|
size: 24
|
|
51
52
|
}
|
|
52
53
|
}, React.createElement(slots.overflowContent, { ...slotProps.overflowContent
|
|
53
|
-
})))));
|
|
54
|
+
}))))));
|
|
54
55
|
};
|
|
55
56
|
|
|
56
57
|
exports.renderAvatarGroup_unstable = renderAvatarGroup_unstable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/AvatarGroup/renderAvatarGroup.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,oBAAA,gBAAA,OAAA,CAAA,mCAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,0BAA0B,GAAI,KAAD,IAA4B;EACpE,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,iBAAA,CAAA,QAAA,CAA2B,KAA3B,CAA7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,CAAC;EAAf,CAAtB,EACE,KAAA,CAAA,aAAA,CAAC,oBAAA,CAAA,kBAAA,CAAmB,QAApB,EAA4B;IAAC,KAAK,EAAE;MAAE,UAAU,EAAE,IAAd;MAAoB,MAApB;MAA4B,IAAI,EAAE;IAAlC;EAAR,CAA5B,EACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,eAAP,EAAsB,EAAA,GAAK,SAAS,CAAC;EAAf,CAAtB,CADF,CADF,CANF,CAHJ,CADF,CADF;AAqBD,CAzBM;;AAAM,OAAA,CAAA,0BAAA,GAA0B,0BAA1B","sourcesContent":["import * as React from 'react';\nimport { Popover, PopoverTrigger } from '@fluentui/react-popover';\nimport { Tooltip } from '@fluentui/react-tooltip';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { AvatarGroupContext } from '../../contexts/AvatarGroupContext';\nimport type { AvatarGroupState, AvatarGroupSlots } from './AvatarGroup.types';\n\n/**\n * Render the final JSX of AvatarGroup\n */\nexport const renderAvatarGroup_unstable = (state: AvatarGroupState) => {\n const { slots, slotProps } = getSlots<AvatarGroupSlots>(state);\n const { layout, size, nonOverflowAvatarsCount } = state;\n\n return (\n <AvatarGroupContext.Provider value={{ layout, size, nonOverflowAvatarsCount }}>\n <slots.root {...slotProps.root}>\n {state.root.children}\n {state.hasOverflow && slots.overflowButton && slots.overflowContent && slots.overflowSurface && (\n <Popover trapFocus size=\"small\">\n <PopoverTrigger>\n <Tooltip content={state.tooltipContent} relationship=\"label\">\n <slots.overflowButton {...slotProps.overflowButton} />\n </Tooltip>\n </PopoverTrigger>\n <slots.overflowSurface {...slotProps.overflowSurface}>\n <AvatarGroupContext.Provider value={{ isOverflow: true, layout, size: 24 }}>\n <slots.overflowContent {...slotProps.overflowContent} />\n </AvatarGroupContext.Provider>\n </slots.overflowSurface>\n </Popover>\n )}\n </slots.root>\n </AvatarGroupContext.Provider>\n );\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -7,8 +7,6 @@ exports.defaultAvatarGroupSize = exports.useAvatarGroup_unstable = void 0;
|
|
|
7
7
|
|
|
8
8
|
const React = /*#__PURE__*/require("react");
|
|
9
9
|
|
|
10
|
-
const AvatarGroupItem_1 = /*#__PURE__*/require("../AvatarGroupItem/AvatarGroupItem");
|
|
11
|
-
|
|
12
10
|
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
13
11
|
|
|
14
12
|
const react_icons_1 = /*#__PURE__*/require("@fluentui/react-icons");
|
|
@@ -36,12 +34,6 @@ const useAvatarGroup_unstable = (props, ref) => {
|
|
|
36
34
|
overflowIndicator = size < 24 ? 'icon' : 'count'
|
|
37
35
|
} = props;
|
|
38
36
|
const childrenArray = React.Children.toArray(children);
|
|
39
|
-
|
|
40
|
-
if (process.env.NODE_ENV !== 'production' && childrenArray.find(child => React.isValidElement(child) && child.type !== AvatarGroupItem_1.AvatarGroupItem)) {
|
|
41
|
-
// eslint-disable-next-line no-console
|
|
42
|
-
console.warn("AvatarGroup's children must be of type AvatarGroupItems.");
|
|
43
|
-
}
|
|
44
|
-
|
|
45
37
|
let rootChildren = childrenArray;
|
|
46
38
|
let overflowChildren;
|
|
47
39
|
let overflowButtonChildren;
|
|
@@ -70,7 +62,8 @@ const useAvatarGroup_unstable = (props, ref) => {
|
|
|
70
62
|
const overflowButton = react_utilities_1.resolveShorthand(props.overflowButton, {
|
|
71
63
|
required: true,
|
|
72
64
|
defaultProps: {
|
|
73
|
-
children: overflowButtonChildren
|
|
65
|
+
children: overflowButtonChildren,
|
|
66
|
+
type: 'button'
|
|
74
67
|
}
|
|
75
68
|
});
|
|
76
69
|
const overflowContent = react_utilities_1.resolveShorthand(props.overflowContent, {
|
|
@@ -82,6 +75,9 @@ const useAvatarGroup_unstable = (props, ref) => {
|
|
|
82
75
|
tabIndex: 0
|
|
83
76
|
}
|
|
84
77
|
});
|
|
78
|
+
const overflowSurface = react_utilities_1.resolveShorthand(props.overflowSurface, {
|
|
79
|
+
required: true
|
|
80
|
+
});
|
|
85
81
|
return {
|
|
86
82
|
nonOverflowAvatarsCount: rootChildren.length,
|
|
87
83
|
hasOverflow: !!overflowChildren,
|
|
@@ -91,12 +87,14 @@ const useAvatarGroup_unstable = (props, ref) => {
|
|
|
91
87
|
tooltipContent: 'View more people.',
|
|
92
88
|
components: {
|
|
93
89
|
root: 'div',
|
|
94
|
-
overflowContent:
|
|
95
|
-
overflowButton: 'button'
|
|
90
|
+
overflowContent: 'div',
|
|
91
|
+
overflowButton: 'button',
|
|
92
|
+
overflowSurface: react_popover_1.PopoverSurface
|
|
96
93
|
},
|
|
97
94
|
root,
|
|
98
95
|
overflowButton,
|
|
99
|
-
overflowContent
|
|
96
|
+
overflowContent,
|
|
97
|
+
overflowSurface
|
|
100
98
|
};
|
|
101
99
|
};
|
|
102
100
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/AvatarGroup/useAvatarGroup.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,
|
|
1
|
+
{"version":3,"sources":["components/AvatarGroup/useAvatarGroup.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;AAGA;;;;;;;;AAQG;;;AACI,MAAM,uBAAuB,GAAG,CAAC,KAAD,EAA0B,GAA1B,KAA2E;EAChH,MAAM;IAAE,QAAF;IAAY,MAAM,GAAG,QAArB;IAA+B,UAAU,GAAG,CAA5C;IAA+C,IAAI,GAAG,OAAA,CAAA;EAAtD,IAAiF,KAAvF;EACA,MAAM;IAAE,iBAAiB,GAAG,IAAI,GAAG,EAAP,GAAY,MAAZ,GAAqB;EAA3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,eAAvB,EAAwC;IAC9D,QAAQ,EAAE,IADoD;IAE9D,YAAY,EAAE;MACZ,cAAc,UADF;MAEZ,QAAQ,EAAE,gBAFE;MAGZ,IAAI,EAAE,MAHM;MAIZ,QAAQ,EAAE;IAJE;EAFgD,CAAxC,CAAxB;EAUA,MAAM,eAAe,GAAG,iBAAA,CAAA,gBAAA,CAAiB,KAAK,CAAC,eAAvB,EAAwC;IAC9D,QAAQ,EAAE;EADoD,CAAxC,CAAxB;EAIA,OAAO;IACL,uBAAuB,EAAE,YAAY,CAAC,MADjC;IAEL,WAAW,EAAE,CAAC,CAAC,gBAFV;IAGL,MAHK;IAIL,iBAJK;IAKL,IALK;IAML,cAAc,EAAE,mBANX;IAQL,UAAU,EAAE;MACV,IAAI,EAAE,KADI;MAEV,eAAe,EAAE,KAFP;MAGV,cAAc,EAAE,QAHN;MAIV,eAAe,EAAE,eAAA,CAAA;IAJP,CARP;IAeL,IAfK;IAgBL,cAhBK;IAiBL,eAjBK;IAkBL;EAlBK,CAAP;AAoBD,CA9EM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB;AAgFA,OAAA,CAAA,sBAAA,GAAyB,EAAzB","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport { MoreHorizontalRegular } from '@fluentui/react-icons';\nimport { PopoverSurface } from '@fluentui/react-popover';\nimport type { AvatarGroupProps, AvatarGroupState } from './AvatarGroup.types';\n\n/**\n * Create the state required to render AvatarGroup.\n *\n * The returned state can be modified with hooks such as useAvatarGroupStyles_unstable,\n * before being passed to renderAvatarGroup_unstable.\n *\n * @param props - props from this instance of AvatarGroup\n * @param ref - reference to root HTMLElement of AvatarGroup\n */\nexport const useAvatarGroup_unstable = (props: AvatarGroupProps, ref: React.Ref<HTMLElement>): AvatarGroupState => {\n const { children, layout = 'spread', maxAvatars = 5, size = defaultAvatarGroupSize } = props;\n const { overflowIndicator = size < 24 ? 'icon' : 'count' } = props;\n const childrenArray = React.Children.toArray(children);\n\n let rootChildren = childrenArray;\n let overflowChildren;\n let overflowButtonChildren;\n\n if (layout === 'pie') {\n rootChildren = childrenArray.slice(0, 3);\n overflowChildren = childrenArray;\n } else if (childrenArray.length > maxAvatars) {\n const numOfAvatarsToHide = childrenArray.length - maxAvatars + 1;\n\n rootChildren = childrenArray.slice(numOfAvatarsToHide);\n overflowChildren = childrenArray.slice(0, numOfAvatarsToHide);\n\n if (overflowIndicator === 'icon') {\n overflowButtonChildren = <MoreHorizontalRegular />;\n } else {\n overflowButtonChildren = numOfAvatarsToHide > 99 ? '99+' : `+${numOfAvatarsToHide}`;\n }\n }\n\n const root = getNativeElementProps(\n 'div',\n {\n role: 'group',\n ...props,\n ref,\n children: rootChildren,\n },\n ['size'],\n );\n\n const overflowButton = resolveShorthand(props.overflowButton, {\n required: true,\n defaultProps: {\n children: overflowButtonChildren,\n type: 'button',\n },\n });\n\n const overflowContent = resolveShorthand(props.overflowContent, {\n required: true,\n defaultProps: {\n 'aria-label': 'Overflow',\n children: overflowChildren,\n role: 'list',\n tabIndex: 0,\n },\n });\n\n const overflowSurface = resolveShorthand(props.overflowSurface, {\n required: true,\n });\n\n return {\n nonOverflowAvatarsCount: rootChildren.length,\n hasOverflow: !!overflowChildren,\n layout,\n overflowIndicator,\n size,\n tooltipContent: 'View more people.',\n\n components: {\n root: 'div',\n overflowContent: 'div',\n overflowButton: 'button',\n overflowSurface: PopoverSurface,\n },\n\n root,\n overflowButton,\n overflowContent,\n overflowSurface,\n };\n};\n\nexport const defaultAvatarGroupSize = 32;\n"],"sourceRoot":"../src/"}
|
|
@@ -18,7 +18,8 @@ const AvatarGroupItem_1 = /*#__PURE__*/require("../../AvatarGroupItem");
|
|
|
18
18
|
exports.avatarGroupClassNames = {
|
|
19
19
|
root: 'fui-AvatarGroup',
|
|
20
20
|
overflowContent: 'fui-AvatarGroup__overflowContent',
|
|
21
|
-
overflowButton: 'fui-AvatarGroup__overflowButton'
|
|
21
|
+
overflowButton: 'fui-AvatarGroup__overflowButton',
|
|
22
|
+
overflowSurface: 'fui-AvatarGroup__overflowSurface'
|
|
22
23
|
};
|
|
23
24
|
/**
|
|
24
25
|
* Styles for the root slot.
|
|
@@ -31,24 +32,31 @@ const useStyles = /*#__PURE__*/react_1.__styles({
|
|
|
31
32
|
},
|
|
32
33
|
"pie": {
|
|
33
34
|
"Bgl5zvf": "f1uz6ud1",
|
|
35
|
+
"De3pzq": "f1ganh6p",
|
|
34
36
|
"Bsw6fvg": "fe2ae1k"
|
|
35
37
|
},
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
"
|
|
38
|
+
"overflowSurface": {
|
|
39
|
+
"z8tnut": "f1g0x7ka",
|
|
40
|
+
"z189sj": ["fhxju0i", "f1cnd47f"],
|
|
41
|
+
"Byoj8tv": "f1qch9an",
|
|
42
|
+
"uwmqm3": ["f1cnd47f", "fhxju0i"]
|
|
43
|
+
},
|
|
44
|
+
"overflowContent": {
|
|
45
|
+
"Bxyxcbc": "fopcw2o",
|
|
46
|
+
"sshi5w": "f1n5o1gx",
|
|
47
|
+
"B68tc82": "f1p9o1ba",
|
|
48
|
+
"Bmxbyg5": "fqkkaap",
|
|
49
|
+
"z8tnut": "f17mpqex",
|
|
50
|
+
"z189sj": ["f1vdfbxk", "f1f5gg8d"],
|
|
51
|
+
"Byoj8tv": "fdvome7",
|
|
52
|
+
"uwmqm3": ["f1f5gg8d", "f1vdfbxk"],
|
|
53
|
+
"a9b677": "f13dwy2t"
|
|
45
54
|
}
|
|
46
55
|
}, {
|
|
47
|
-
"d": [".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f10pi13n{position:relative;}", ".f1uz6ud1{-webkit-clip-path:circle(50%);clip-path:circle(50%);}", "
|
|
56
|
+
"d": [".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f10pi13n{position:relative;}", ".f1uz6ud1{-webkit-clip-path:circle(50%);clip-path:circle(50%);}", ".f1ganh6p{background-color:var(--colorTransparentStroke);}", ".f1g0x7ka{padding-top:0;}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f1qch9an{padding-bottom:0;}", ".fopcw2o{max-height:220px;}", ".f1n5o1gx{min-height:80px;}", ".f1p9o1ba{overflow-x:hidden;}", ".fqkkaap{overflow-y:scroll;}", ".f17mpqex{padding-top:var(--spacingHorizontalS);}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".fdvome7{padding-bottom:var(--spacingHorizontalS);}", ".f13dwy2t{width:220px;}"],
|
|
48
57
|
"m": [["@media (forced-colors: active){.fe2ae1k{background-color:CanvasText;}}", {
|
|
49
58
|
"m": "(forced-colors: active)"
|
|
50
|
-
}]]
|
|
51
|
-
"f": [".ftqa4ok:focus{outline-style:none;}"]
|
|
59
|
+
}]]
|
|
52
60
|
});
|
|
53
61
|
/**
|
|
54
62
|
* Styles for overflow button slot.
|
|
@@ -95,6 +103,21 @@ const useOverflowButtonStyles = /*#__PURE__*/react_1.__styles({
|
|
|
95
103
|
"B32s92o": "fgeg2qa",
|
|
96
104
|
"B5hngm5": "fhcq1yo"
|
|
97
105
|
},
|
|
106
|
+
"pieFocusIndicator": {
|
|
107
|
+
"Brovlpu": "ftqa4ok",
|
|
108
|
+
"rkqiyj": "f1gx8lax",
|
|
109
|
+
"Bs3nqqt": ["f1as8ps8", "f17o1ya2"],
|
|
110
|
+
"B4mky7d": "f1amggu6",
|
|
111
|
+
"Bviepcv": ["f17o1ya2", "f1as8ps8"],
|
|
112
|
+
"Bc28wk5": "flnfwa4",
|
|
113
|
+
"w1edd7": ["fuav46a", "fcnogh1"],
|
|
114
|
+
"Ba8awiv": "f19zilzp",
|
|
115
|
+
"I50xcx": ["fcnogh1", "fuav46a"],
|
|
116
|
+
"Bnmjwt4": "f119w1j1",
|
|
117
|
+
"Jopkrh": ["f1wlf18u", "fcqg1ja"],
|
|
118
|
+
"hhrs2v": "ft77uen",
|
|
119
|
+
"B7jbng7": ["fcqg1ja", "f1wlf18u"]
|
|
120
|
+
},
|
|
98
121
|
"states": {
|
|
99
122
|
"Bi91k9c": "feu1g3u",
|
|
100
123
|
"Jwef8y": "f1knas48",
|
|
@@ -199,7 +222,7 @@ const useOverflowButtonStyles = /*#__PURE__*/react_1.__styles({
|
|
|
199
222
|
"ibv6hh": ["f1g0iy8l", "figl7jc"]
|
|
200
223
|
}
|
|
201
224
|
}, {
|
|
202
|
-
"d": [".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f10pi13n{position:relative;}", ".fi64zpg{-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".fj3muxo{border-top-color:var(--colorNeutralStroke1);}", ".f1akhkt{border-right-color:var(--colorNeutralStroke1);}", ".f1lxtadh{border-left-color:var(--colorNeutralStroke1);}", ".f1aperda{border-bottom-color:var(--colorNeutralStroke1);}", ".f8fbkgy{border-bottom-right-radius:var(--borderRadiusCircular);}", ".f1nfllo7{border-bottom-left-radius:var(--borderRadiusCircular);}", ".f1djnp8u{border-top-right-radius:var(--borderRadiusCircular);}", ".f1s8kh49{border-top-left-radius:var(--borderRadiusCircular);}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".f1g0x7ka{padding-top:0;}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f1qch9an{padding-bottom:0;}", "[data-keyboard-nav] .flfsvnh:focus{border-top-color:transparent;}", "[data-keyboard-nav] .f1781m5e:focus{border-right-color:transparent;}", "[data-keyboard-nav] .flvaaa9:focus{border-left-color:transparent;}", "[data-keyboard-nav] .f50u1b5:focus{border-bottom-color:transparent;}", "[data-keyboard-nav] .foqs3zz:focus{outline-color:var(--colorStrokeFocus2);}", "[data-keyboard-nav] .fgeg2qa:focus{outline-width:var(--strokeWidthThick);}", "[data-keyboard-nav] .fhcq1yo:focus{outline-style:solid;}", ".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".fghlq4f{border-top-color:var(--colorTransparentStroke);}", ".f1gn591s{border-right-color:var(--colorTransparentStroke);}", ".fjscplz{border-left-color:var(--colorTransparentStroke);}", ".fb073pr{border-bottom-color:var(--colorTransparentStroke);}", ".f44pa96{color:transparent;}", ".f1ugzwwg{font-size:12px;}", ".f4ybsrx{font-size:16px;}", ".fe5j1ua{font-size:20px;}", ".f1rt2boy{font-size:24px;}", ".f24l1pt{font-size:28px;}", ".ffl51b{font-size:32px;}", ".f18m8u13{font-size:48px;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".f13mqy1h{font-size:var(--fontSizeBase100);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".fcpl73t{line-height:var(--lineHeightBase100);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".faaz57k{line-height:var(--lineHeightBase400);}", ".f1pp30po{font-size:var(--fontSizeBase500);}", ".f106mvju{line-height:var(--lineHeightBase500);}", ".f1x0m3f5{font-size:var(--fontSizeBase600);}", ".fb86gi6{line-height:var(--lineHeightBase600);}", ".f192inf7{border-top-width:var(--strokeWidthThin);}", ".f5tn483{border-right-width:var(--strokeWidthThin);}", ".f1ojsxk5{border-left-width:var(--strokeWidthThin);}", ".f1vxd6vx{border-bottom-width:var(--strokeWidthThin);}", ".f18zi460{border-top-width:var(--strokeWidthThick);}", ".f1wpluaz{border-right-width:var(--strokeWidthThick);}", ".fsfsuhs{border-left-width:var(--strokeWidthThick);}", ".fmklw6v{border-bottom-width:var(--strokeWidthThick);}", ".fgx37oo{border-top-width:var(--strokeWidthThicker);}", ".f130t4y6{border-right-width:var(--strokeWidthThicker);}", ".f1efpmoh{border-left-width:var(--strokeWidthThicker);}", ".fv51ejd{border-bottom-width:var(--strokeWidthThicker);}", ".fwn6jck{border-top-width:var(--strokeWidthThickest);}", ".figl7jc{border-right-width:var(--strokeWidthThickest);}", ".f1g0iy8l{border-left-width:var(--strokeWidthThickest);}", ".f1b8shu7{border-bottom-width:var(--strokeWidthThickest);}"],
|
|
225
|
+
"d": [".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f10pi13n{position:relative;}", ".fi64zpg{-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".fj3muxo{border-top-color:var(--colorNeutralStroke1);}", ".f1akhkt{border-right-color:var(--colorNeutralStroke1);}", ".f1lxtadh{border-left-color:var(--colorNeutralStroke1);}", ".f1aperda{border-bottom-color:var(--colorNeutralStroke1);}", ".f8fbkgy{border-bottom-right-radius:var(--borderRadiusCircular);}", ".f1nfllo7{border-bottom-left-radius:var(--borderRadiusCircular);}", ".f1djnp8u{border-top-right-radius:var(--borderRadiusCircular);}", ".f1s8kh49{border-top-left-radius:var(--borderRadiusCircular);}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".f1g0x7ka{padding-top:0;}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f1qch9an{padding-bottom:0;}", "[data-keyboard-nav] .flfsvnh:focus{border-top-color:transparent;}", "[data-keyboard-nav] .f1781m5e:focus{border-right-color:transparent;}", "[data-keyboard-nav] .flvaaa9:focus{border-left-color:transparent;}", "[data-keyboard-nav] .f50u1b5:focus{border-bottom-color:transparent;}", "[data-keyboard-nav] .foqs3zz:focus{outline-color:var(--colorStrokeFocus2);}", "[data-keyboard-nav] .fgeg2qa:focus{outline-width:var(--strokeWidthThick);}", "[data-keyboard-nav] .fhcq1yo:focus{outline-style:solid;}", "[data-keyboard-nav] .f1gx8lax:focus{border-top-width:var(--strokeWidthThick);}", "[data-keyboard-nav] .f1as8ps8:focus{border-right-width:var(--strokeWidthThick);}", "[data-keyboard-nav] .f17o1ya2:focus{border-left-width:var(--strokeWidthThick);}", "[data-keyboard-nav] .f1amggu6:focus{border-bottom-width:var(--strokeWidthThick);}", "[data-keyboard-nav] .flnfwa4:focus{border-top-style:solid;}", "[data-keyboard-nav] .fuav46a:focus{border-right-style:solid;}", "[data-keyboard-nav] .fcnogh1:focus{border-left-style:solid;}", "[data-keyboard-nav] .f19zilzp:focus{border-bottom-style:solid;}", "[data-keyboard-nav] .f119w1j1:focus{border-top-color:var(--colorStrokeFocus2);}", "[data-keyboard-nav] .f1wlf18u:focus{border-right-color:var(--colorStrokeFocus2);}", "[data-keyboard-nav] .fcqg1ja:focus{border-left-color:var(--colorStrokeFocus2);}", "[data-keyboard-nav] .ft77uen:focus{border-bottom-color:var(--colorStrokeFocus2);}", ".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".fghlq4f{border-top-color:var(--colorTransparentStroke);}", ".f1gn591s{border-right-color:var(--colorTransparentStroke);}", ".fjscplz{border-left-color:var(--colorTransparentStroke);}", ".fb073pr{border-bottom-color:var(--colorTransparentStroke);}", ".f44pa96{color:transparent;}", ".f1ugzwwg{font-size:12px;}", ".f4ybsrx{font-size:16px;}", ".fe5j1ua{font-size:20px;}", ".f1rt2boy{font-size:24px;}", ".f24l1pt{font-size:28px;}", ".ffl51b{font-size:32px;}", ".f18m8u13{font-size:48px;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".f13mqy1h{font-size:var(--fontSizeBase100);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".fcpl73t{line-height:var(--lineHeightBase100);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".faaz57k{line-height:var(--lineHeightBase400);}", ".f1pp30po{font-size:var(--fontSizeBase500);}", ".f106mvju{line-height:var(--lineHeightBase500);}", ".f1x0m3f5{font-size:var(--fontSizeBase600);}", ".fb86gi6{line-height:var(--lineHeightBase600);}", ".f192inf7{border-top-width:var(--strokeWidthThin);}", ".f5tn483{border-right-width:var(--strokeWidthThin);}", ".f1ojsxk5{border-left-width:var(--strokeWidthThin);}", ".f1vxd6vx{border-bottom-width:var(--strokeWidthThin);}", ".f18zi460{border-top-width:var(--strokeWidthThick);}", ".f1wpluaz{border-right-width:var(--strokeWidthThick);}", ".fsfsuhs{border-left-width:var(--strokeWidthThick);}", ".fmklw6v{border-bottom-width:var(--strokeWidthThick);}", ".fgx37oo{border-top-width:var(--strokeWidthThicker);}", ".f130t4y6{border-right-width:var(--strokeWidthThicker);}", ".f1efpmoh{border-left-width:var(--strokeWidthThicker);}", ".fv51ejd{border-bottom-width:var(--strokeWidthThicker);}", ".fwn6jck{border-top-width:var(--strokeWidthThickest);}", ".figl7jc{border-right-width:var(--strokeWidthThickest);}", ".f1g0iy8l{border-left-width:var(--strokeWidthThickest);}", ".f1b8shu7{border-bottom-width:var(--strokeWidthThickest);}"],
|
|
203
226
|
"m": [["@media (forced-colors: active){.fw33nwi{border-top-color:CanvasText;}}", {
|
|
204
227
|
"m": "(forced-colors: active)"
|
|
205
228
|
}], ["@media (forced-colors: active){.f1ptkjjm{border-right-color:CanvasText;}.fmzzjfk{border-left-color:CanvasText;}}", {
|
|
@@ -213,26 +236,6 @@ const useOverflowButtonStyles = /*#__PURE__*/react_1.__styles({
|
|
|
213
236
|
"h": [".feu1g3u:hover{color:var(--colorNeutralForeground1Hover);}", ".f1knas48:hover{background-color:var(--colorNeutralBackground1Hover);}", ".fvcxoqz:hover{border-top-color:var(--colorNeutralStroke1Hover);}", ".f1ub3y4t:hover{border-right-color:var(--colorNeutralStroke1Hover);}", ".f1m52nbi:hover{border-left-color:var(--colorNeutralStroke1Hover);}", ".f1xlaoq0:hover{border-bottom-color:var(--colorNeutralStroke1Hover);}"],
|
|
214
237
|
"a": [".f1g4hkjv:active{color:var(--colorNeutralForeground1Pressed);}", ".fb40n2d:active{background-color:var(--colorNeutralBackground1Pressed);}", ".fvs00aa:active{border-top-color:var(--colorNeutralStroke1Pressed);}", ".f1assf6x:active{border-right-color:var(--colorNeutralStroke1Pressed);}", ".f4ruux4:active{border-left-color:var(--colorNeutralStroke1Pressed);}", ".fumykes:active{border-bottom-color:var(--colorNeutralStroke1Pressed);}"]
|
|
215
238
|
});
|
|
216
|
-
/**
|
|
217
|
-
* Styles for overflow list slot.
|
|
218
|
-
*/
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
const useOverflowContentStyles = /*#__PURE__*/react_1.__styles({
|
|
222
|
-
"base": {
|
|
223
|
-
"Bxyxcbc": "fopcw2o",
|
|
224
|
-
"sshi5w": "f1n5o1gx",
|
|
225
|
-
"B68tc82": "f1p9o1ba",
|
|
226
|
-
"Bmxbyg5": "fqkkaap",
|
|
227
|
-
"z8tnut": "f17mpqex",
|
|
228
|
-
"z189sj": ["f1vdfbxk", "f1f5gg8d"],
|
|
229
|
-
"Byoj8tv": "fdvome7",
|
|
230
|
-
"uwmqm3": ["f1f5gg8d", "f1vdfbxk"],
|
|
231
|
-
"a9b677": "f13dwy2t"
|
|
232
|
-
}
|
|
233
|
-
}, {
|
|
234
|
-
"d": [".fopcw2o{max-height:220px;}", ".f1n5o1gx{min-height:80px;}", ".f1p9o1ba{overflow-x:hidden;}", ".fqkkaap{overflow-y:scroll;}", ".f17mpqex{padding-top:var(--spacingHorizontalS);}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".fdvome7{padding-bottom:var(--spacingHorizontalS);}", ".f13dwy2t{width:220px;}"]
|
|
235
|
-
});
|
|
236
239
|
/**
|
|
237
240
|
* Apply styling to the AvatarGroup slots based on the state
|
|
238
241
|
*/
|
|
@@ -246,13 +249,16 @@ const useAvatarGroupStyles_unstable = state => {
|
|
|
246
249
|
} = state;
|
|
247
250
|
const styles = useStyles();
|
|
248
251
|
const sizeStyles = useAvatarStyles_1.useSizeStyles();
|
|
249
|
-
const overflowContentStyles = useOverflowContentStyles();
|
|
250
252
|
const overflowButtonStyles = useOverflowButtonStyles();
|
|
251
253
|
const groupChildClassName = AvatarGroupItem_1.useGroupChildClassName(layout, size, true);
|
|
252
|
-
state.root.className = react_1.mergeClasses(exports.avatarGroupClassNames.root, styles.base, layout === 'pie' && styles.pie, layout === 'pie' && sizeStyles[size],
|
|
254
|
+
state.root.className = react_1.mergeClasses(exports.avatarGroupClassNames.root, styles.base, layout === 'pie' && styles.pie, layout === 'pie' && sizeStyles[size], state.root.className);
|
|
253
255
|
|
|
254
256
|
if (state.overflowContent) {
|
|
255
|
-
state.overflowContent.className = react_1.mergeClasses(exports.avatarGroupClassNames.overflowContent,
|
|
257
|
+
state.overflowContent.className = react_1.mergeClasses(exports.avatarGroupClassNames.overflowContent, styles.overflowContent, state.overflowContent.className);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
if (state.overflowSurface) {
|
|
261
|
+
state.overflowSurface.className = react_1.mergeClasses(exports.avatarGroupClassNames.overflowSurface, styles.overflowSurface, state.overflowSurface.className);
|
|
256
262
|
}
|
|
257
263
|
|
|
258
264
|
const overflowButtonClasses = [];
|
|
@@ -300,7 +306,7 @@ const useAvatarGroupStyles_unstable = state => {
|
|
|
300
306
|
}
|
|
301
307
|
|
|
302
308
|
if (state.overflowButton) {
|
|
303
|
-
state.overflowButton.className = react_1.mergeClasses(exports.avatarGroupClassNames.overflowButton, sizeStyles[size], overflowButtonStyles.base, ...overflowButtonClasses, layout !== 'pie' && overflowButtonStyles.states, layout !== 'pie' && overflowButtonStyles.focusIndicator, layout === 'pie' && overflowButtonStyles.pie, groupChildClassName, state.overflowButton.className);
|
|
309
|
+
state.overflowButton.className = react_1.mergeClasses(exports.avatarGroupClassNames.overflowButton, sizeStyles[size], overflowButtonStyles.base, ...overflowButtonClasses, layout !== 'pie' && overflowButtonStyles.states, layout !== 'pie' && overflowButtonStyles.focusIndicator, layout === 'pie' && overflowButtonStyles.pieFocusIndicator, layout === 'pie' && overflowButtonStyles.pie, groupChildClassName, state.overflowButton.className);
|
|
304
310
|
}
|
|
305
311
|
|
|
306
312
|
return state;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/AvatarGroup/useAvatarGroupStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAGA,MAAA,iBAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAEa,OAAA,CAAA,qBAAA,GAA0D;EACrE,IAAI,EAAE,iBAD+D;EAErE,eAAe,EAAE,kCAFoD;EAGrE,cAAc,EAAE;AAHqD,CAA1D;AAMb;;AAEG;;AACH,MAAM,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IAAtB,CAA2B,oBAAoB,CAAC,MAAhD;IACD,CAFM,MAEA,IAAI,IAAI,IAAI,EAAZ,EAAgB;MACrB,qBAAqB,CAAC,IAAtB,CAA2B,oBAAoB,CAAC,MAAhD;IACD,CAFM,MAEA,IAAI,IAAI,IAAI,EAAZ,EAAgB;MACrB,qBAAqB,CAAC,IAAtB,CAA2B,oBAAoB,CAAC,MAAhD;IACD,CAFM,MAEA;MACL,qBAAqB,CAAC,IAAtB,CAA2B,oBAAoB,CAAC,MAAhD;IACD;EACF;;EAED,IAAI,KAAK,CAAC,cAAV,EAA0B;IACxB,KAAK,CAAC,cAAN,CAAqB,SAArB,GAAiC,OAAA,CAAA,YAAA,CAC/B,OAAA,CAAA,qBAAA,CAAsB,cADS,EAE/B,UAAU,CAAC,IAAD,CAFqB,EAG/B,oBAAoB,CAAC,IAHU,EAI/B,GAAG,qBAJ4B,EAK/B,MAAM,KAAK,KAAX,IAAoB,oBAAoB,CAAC,MALV,EAM/B,MAAM,KAAK,KAAX,IAAoB,oBAAoB,CAAC,cANV,EAO/B,MAAM,KAAK,KAAX,IAAoB,oBAAoB,CAAC,GAPV,EAQ/B,mBAR+B,EAS/B,KAAK,CAAC,cAAN,CAAqB,SATU,CAAjC;EAWD;;EAED,OAAO,KAAP;AACD,CArFM;;AAAM,OAAA,CAAA,6BAAA,GAA6B,6BAA7B","sourcesContent":["import { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { useSizeStyles } from '../Avatar/useAvatarStyles';\nimport type { AvatarGroupSlots, AvatarGroupState } from './AvatarGroup.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { useGroupChildClassName } from '../../AvatarGroupItem';\n\nexport const avatarGroupClassNames: SlotClassNames<AvatarGroupSlots> = {\n root: 'fui-AvatarGroup',\n overflowContent: 'fui-AvatarGroup__overflowContent',\n overflowButton: 'fui-AvatarGroup__overflowButton',\n};\n\n/**\n * Styles for the root slot.\n */\nconst useStyles = makeStyles({\n base: {\n display: 'inline-flex',\n position: 'relative',\n },\n pie: {\n clipPath: 'circle(50%)',\n '@media (forced-colors: active)': {\n backgroundColor: 'CanvasText',\n },\n },\n focusIndicator: createCustomFocusIndicatorStyle(\n {\n ...shorthands.borderColor('transparent'),\n outlineColor: tokens.colorStrokeFocus2,\n outlineWidth: tokens.strokeWidthThick,\n outlineStyle: 'solid',\n },\n { selector: 'focus-within' },\n ),\n});\n\n/**\n * Styles for overflow button slot.\n */\nconst useOverflowButtonStyles = makeStyles({\n base: {\n display: 'inline-flex',\n position: 'relative',\n flexShrink: 0,\n justifyContent: 'center',\n alignItems: 'center',\n color: tokens.colorNeutralForeground1,\n backgroundColor: tokens.colorNeutralBackground1,\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n ...shorthands.borderStyle('solid'),\n ...shorthands.padding(0),\n\n // match color to Avatar's outline color\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('CanvasText'),\n },\n },\n\n // These styles match the default button styles\n focusIndicator: createCustomFocusIndicatorStyle({\n ...shorthands.borderColor('transparent'),\n outlineColor: tokens.colorStrokeFocus2,\n outlineWidth: tokens.strokeWidthThick,\n outlineStyle: 'solid',\n }),\n\n states: {\n ':hover': {\n color: tokens.colorNeutralForeground1Hover,\n backgroundColor: tokens.colorNeutralBackground1Hover,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n },\n ':active': {\n color: tokens.colorNeutralForeground1Pressed,\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n },\n },\n\n pie: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n color: 'transparent',\n },\n\n icon12: { fontSize: '12px' },\n icon16: { fontSize: '16px' },\n icon20: { fontSize: '20px' },\n icon24: { fontSize: '24px' },\n icon28: { fontSize: '28px' },\n icon32: { fontSize: '32px' },\n icon48: { fontSize: '48px' },\n caption2Strong: { ...typographyStyles.caption2Strong },\n caption1Strong: { ...typographyStyles.caption1Strong },\n body1Strong: { ...typographyStyles.body1Strong },\n subtitle2: { ...typographyStyles.subtitle2 },\n subtitle1: { ...typographyStyles.subtitle1 },\n title3: { ...typographyStyles.title3 },\n borderThin: { ...shorthands.borderWidth(tokens.strokeWidthThin) },\n borderThick: { ...shorthands.borderWidth(tokens.strokeWidthThick) },\n borderThicker: { ...shorthands.borderWidth(tokens.strokeWidthThicker) },\n borderThickest: { ...shorthands.borderWidth(tokens.strokeWidthThickest) },\n});\n\n/**\n * Styles for overflow list slot.\n */\nconst useOverflowContentStyles = makeStyles({\n base: {\n maxHeight: '220px',\n minHeight: '80px',\n ...shorthands.overflow('hidden', 'scroll'),\n ...shorthands.padding(tokens.spacingHorizontalS),\n width: '220px',\n },\n});\n\n/**\n * Apply styling to the AvatarGroup slots based on the state\n */\nexport const useAvatarGroupStyles_unstable = (state: AvatarGroupState): AvatarGroupState => {\n const { layout, overflowIndicator, size } = state;\n const styles = useStyles();\n const sizeStyles = useSizeStyles();\n const overflowContentStyles = useOverflowContentStyles();\n const overflowButtonStyles = useOverflowButtonStyles();\n\n const groupChildClassName = useGroupChildClassName(layout, size, true);\n\n state.root.className = mergeClasses(\n avatarGroupClassNames.root,\n styles.base,\n layout === 'pie' && styles.pie,\n layout === 'pie' && sizeStyles[size],\n layout === 'pie' && styles.focusIndicator,\n state.root.className,\n );\n\n if (state.overflowContent) {\n state.overflowContent.className = mergeClasses(\n avatarGroupClassNames.overflowContent,\n overflowContentStyles.base,\n state.overflowContent.className,\n );\n }\n\n const overflowButtonClasses = [];\n\n if (size < 36) {\n overflowButtonClasses.push(overflowButtonStyles.borderThin);\n } else if (size < 56) {\n overflowButtonClasses.push(overflowButtonStyles.borderThick);\n } else if (size < 72) {\n overflowButtonClasses.push(overflowButtonStyles.borderThicker);\n } else {\n overflowButtonClasses.push(overflowButtonStyles.borderThickest);\n }\n\n if (overflowIndicator === 'count') {\n if (size <= 24) {\n overflowButtonClasses.push(overflowButtonStyles.caption2Strong);\n } else if (size <= 28) {\n overflowButtonClasses.push(overflowButtonStyles.caption1Strong);\n } else if (size <= 40) {\n overflowButtonClasses.push(overflowButtonStyles.body1Strong);\n } else if (size <= 56) {\n overflowButtonClasses.push(overflowButtonStyles.subtitle2);\n } else if (size <= 96) {\n overflowButtonClasses.push(overflowButtonStyles.subtitle1);\n } else {\n overflowButtonClasses.push(overflowButtonStyles.title3);\n }\n } else {\n if (size <= 16) {\n overflowButtonClasses.push(overflowButtonStyles.icon12);\n } else if (size <= 24) {\n overflowButtonClasses.push(overflowButtonStyles.icon16);\n } else if (size <= 40) {\n overflowButtonClasses.push(overflowButtonStyles.icon20);\n } else if (size <= 48) {\n overflowButtonClasses.push(overflowButtonStyles.icon24);\n } else if (size <= 56) {\n overflowButtonClasses.push(overflowButtonStyles.icon28);\n } else if (size <= 72) {\n overflowButtonClasses.push(overflowButtonStyles.icon32);\n } else {\n overflowButtonClasses.push(overflowButtonStyles.icon48);\n }\n }\n\n if (state.overflowButton) {\n state.overflowButton.className = mergeClasses(\n avatarGroupClassNames.overflowButton,\n sizeStyles[size],\n overflowButtonStyles.base,\n ...overflowButtonClasses,\n layout !== 'pie' && overflowButtonStyles.states,\n layout !== 'pie' && overflowButtonStyles.focusIndicator,\n layout === 'pie' && overflowButtonStyles.pie,\n groupChildClassName,\n state.overflowButton.className,\n );\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
|
1
|
+
{"version":3,"sources":["components/AvatarGroup/useAvatarGroupStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,iBAAA,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AAAM,OAAA,CAAA,6BAAA,GAA6B,6BAA7B","sourcesContent":["import { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { useSizeStyles } from '../Avatar/useAvatarStyles';\nimport type { AvatarGroupSlots, AvatarGroupState } from './AvatarGroup.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { useGroupChildClassName } from '../../AvatarGroupItem';\n\nexport const avatarGroupClassNames: SlotClassNames<AvatarGroupSlots> = {\n root: 'fui-AvatarGroup',\n overflowContent: 'fui-AvatarGroup__overflowContent',\n overflowButton: 'fui-AvatarGroup__overflowButton',\n overflowSurface: 'fui-AvatarGroup__overflowSurface',\n};\n\n/**\n * Styles for the root slot.\n */\nconst useStyles = makeStyles({\n base: {\n display: 'inline-flex',\n position: 'relative',\n },\n pie: {\n clipPath: 'circle(50%)',\n backgroundColor: tokens.colorTransparentStroke,\n '@media (forced-colors: active)': {\n backgroundColor: 'CanvasText',\n },\n },\n overflowSurface: {\n ...shorthands.padding(0),\n },\n overflowContent: {\n maxHeight: '220px',\n minHeight: '80px',\n ...shorthands.overflow('hidden', 'scroll'),\n ...shorthands.padding(tokens.spacingHorizontalS),\n width: '220px',\n },\n});\n\n/**\n * Styles for overflow button slot.\n */\nconst useOverflowButtonStyles = makeStyles({\n base: {\n display: 'inline-flex',\n position: 'relative',\n flexShrink: 0,\n justifyContent: 'center',\n alignItems: 'center',\n color: tokens.colorNeutralForeground1,\n backgroundColor: tokens.colorNeutralBackground1,\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n ...shorthands.borderStyle('solid'),\n ...shorthands.padding(0),\n\n // match color to Avatar's outline color\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('CanvasText'),\n },\n },\n\n // These styles match the default button styles\n focusIndicator: createCustomFocusIndicatorStyle({\n ...shorthands.borderColor('transparent'),\n outlineColor: tokens.colorStrokeFocus2,\n outlineWidth: tokens.strokeWidthThick,\n outlineStyle: 'solid',\n }),\n\n // This custom focus indicator is required for the pie layout due to the clip-path applied to the root\n pieFocusIndicator: createCustomFocusIndicatorStyle({\n ...shorthands.border(tokens.strokeWidthThick, 'solid', tokens.colorStrokeFocus2),\n }),\n\n states: {\n ':hover': {\n color: tokens.colorNeutralForeground1Hover,\n backgroundColor: tokens.colorNeutralBackground1Hover,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n },\n ':active': {\n color: tokens.colorNeutralForeground1Pressed,\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n },\n },\n\n pie: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n color: 'transparent',\n },\n\n icon12: { fontSize: '12px' },\n icon16: { fontSize: '16px' },\n icon20: { fontSize: '20px' },\n icon24: { fontSize: '24px' },\n icon28: { fontSize: '28px' },\n icon32: { fontSize: '32px' },\n icon48: { fontSize: '48px' },\n caption2Strong: { ...typographyStyles.caption2Strong },\n caption1Strong: { ...typographyStyles.caption1Strong },\n body1Strong: { ...typographyStyles.body1Strong },\n subtitle2: { ...typographyStyles.subtitle2 },\n subtitle1: { ...typographyStyles.subtitle1 },\n title3: { ...typographyStyles.title3 },\n borderThin: { ...shorthands.borderWidth(tokens.strokeWidthThin) },\n borderThick: { ...shorthands.borderWidth(tokens.strokeWidthThick) },\n borderThicker: { ...shorthands.borderWidth(tokens.strokeWidthThicker) },\n borderThickest: { ...shorthands.borderWidth(tokens.strokeWidthThickest) },\n});\n\n/**\n * Apply styling to the AvatarGroup slots based on the state\n */\nexport const useAvatarGroupStyles_unstable = (state: AvatarGroupState): AvatarGroupState => {\n const { layout, overflowIndicator, size } = state;\n const styles = useStyles();\n const sizeStyles = useSizeStyles();\n const overflowButtonStyles = useOverflowButtonStyles();\n\n const groupChildClassName = useGroupChildClassName(layout, size, true);\n\n state.root.className = mergeClasses(\n avatarGroupClassNames.root,\n styles.base,\n layout === 'pie' && styles.pie,\n layout === 'pie' && sizeStyles[size],\n state.root.className,\n );\n\n if (state.overflowContent) {\n state.overflowContent.className = mergeClasses(\n avatarGroupClassNames.overflowContent,\n styles.overflowContent,\n state.overflowContent.className,\n );\n }\n\n if (state.overflowSurface) {\n state.overflowSurface.className = mergeClasses(\n avatarGroupClassNames.overflowSurface,\n styles.overflowSurface,\n state.overflowSurface.className,\n );\n }\n\n const overflowButtonClasses = [];\n\n if (size < 36) {\n overflowButtonClasses.push(overflowButtonStyles.borderThin);\n } else if (size < 56) {\n overflowButtonClasses.push(overflowButtonStyles.borderThick);\n } else if (size < 72) {\n overflowButtonClasses.push(overflowButtonStyles.borderThicker);\n } else {\n overflowButtonClasses.push(overflowButtonStyles.borderThickest);\n }\n\n if (overflowIndicator === 'count') {\n if (size <= 24) {\n overflowButtonClasses.push(overflowButtonStyles.caption2Strong);\n } else if (size <= 28) {\n overflowButtonClasses.push(overflowButtonStyles.caption1Strong);\n } else if (size <= 40) {\n overflowButtonClasses.push(overflowButtonStyles.body1Strong);\n } else if (size <= 56) {\n overflowButtonClasses.push(overflowButtonStyles.subtitle2);\n } else if (size <= 96) {\n overflowButtonClasses.push(overflowButtonStyles.subtitle1);\n } else {\n overflowButtonClasses.push(overflowButtonStyles.title3);\n }\n } else {\n if (size <= 16) {\n overflowButtonClasses.push(overflowButtonStyles.icon12);\n } else if (size <= 24) {\n overflowButtonClasses.push(overflowButtonStyles.icon16);\n } else if (size <= 40) {\n overflowButtonClasses.push(overflowButtonStyles.icon20);\n } else if (size <= 48) {\n overflowButtonClasses.push(overflowButtonStyles.icon24);\n } else if (size <= 56) {\n overflowButtonClasses.push(overflowButtonStyles.icon28);\n } else if (size <= 72) {\n overflowButtonClasses.push(overflowButtonStyles.icon32);\n } else {\n overflowButtonClasses.push(overflowButtonStyles.icon48);\n }\n }\n\n if (state.overflowButton) {\n state.overflowButton.className = mergeClasses(\n avatarGroupClassNames.overflowButton,\n sizeStyles[size],\n overflowButtonStyles.base,\n ...overflowButtonClasses,\n layout !== 'pie' && overflowButtonStyles.states,\n layout !== 'pie' && overflowButtonStyles.focusIndicator,\n layout === 'pie' && overflowButtonStyles.pieFocusIndicator,\n layout === 'pie' && overflowButtonStyles.pie,\n groupChildClassName,\n state.overflowButton.className,\n );\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-avatar",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.2",
|
|
4
4
|
"description": "React components for building Microsoft web experiences.",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -28,20 +28,20 @@
|
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@fluentui/eslint-plugin": "*",
|
|
30
30
|
"@fluentui/react-conformance": "*",
|
|
31
|
-
"@fluentui/react-conformance-griffel": "9.0.0-beta.
|
|
31
|
+
"@fluentui/react-conformance-griffel": "9.0.0-beta.11",
|
|
32
32
|
"@fluentui/scripts": "^1.0.0",
|
|
33
33
|
"es6-weak-map": "^2.0.2"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@fluentui/react-badge": "^9.0.
|
|
37
|
-
"@fluentui/react-context-selector": "^9.0.
|
|
38
|
-
"@fluentui/react-icons": "^2.0.
|
|
39
|
-
"@fluentui/react-popover": "^9.0.
|
|
36
|
+
"@fluentui/react-badge": "^9.0.2",
|
|
37
|
+
"@fluentui/react-context-selector": "^9.0.1",
|
|
38
|
+
"@fluentui/react-icons": "^2.0.175",
|
|
39
|
+
"@fluentui/react-popover": "^9.0.2",
|
|
40
40
|
"@fluentui/react-shared-contexts": "^9.0.0",
|
|
41
|
-
"@fluentui/react-tabster": "^9.0.
|
|
41
|
+
"@fluentui/react-tabster": "^9.0.2",
|
|
42
42
|
"@fluentui/react-theme": "^9.0.0",
|
|
43
|
-
"@fluentui/react-tooltip": "^9.0.
|
|
44
|
-
"@fluentui/react-utilities": "^9.0.0",
|
|
43
|
+
"@fluentui/react-tooltip": "^9.0.2",
|
|
44
|
+
"@fluentui/react-utilities": "^9.0.1-0",
|
|
45
45
|
"@griffel/react": "^1.2.0",
|
|
46
46
|
"tslib": "^2.1.0"
|
|
47
47
|
},
|