@fluentui/react-avatar 9.0.0-rc.8 → 9.0.0-rc.9
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 +22 -2
- package/dist/index.d.ts +86 -83
- package/lib/components/Avatar/Avatar.types.js.map +1 -1
- package/lib/components/Avatar/useAvatar.js +3 -3
- package/lib/components/Avatar/useAvatar.js.map +1 -1
- package/lib/components/Avatar/useAvatarStyles.js +12 -3
- package/lib/components/Avatar/useAvatarStyles.js.map +1 -1
- package/lib/components/AvatarGroup/AvatarGroup.types.js.map +1 -1
- package/lib/components/AvatarGroup/useAvatarGroup.js +0 -9
- package/lib/components/AvatarGroup/useAvatarGroup.js.map +1 -1
- package/lib/utils/getInitials.js +14 -12
- package/lib/utils/getInitials.js.map +1 -1
- package/lib-commonjs/components/Avatar/useAvatar.js +3 -3
- package/lib-commonjs/components/Avatar/useAvatar.js.map +1 -1
- package/lib-commonjs/components/Avatar/useAvatarStyles.js +12 -3
- package/lib-commonjs/components/Avatar/useAvatarStyles.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/useAvatarGroup.js +0 -9
- package/lib-commonjs/components/AvatarGroup/useAvatarGroup.js.map +1 -1
- package/lib-commonjs/utils/getInitials.js +14 -12
- package/lib-commonjs/utils/getInitials.js.map +1 -1
- package/package.json +10 -10
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,96 @@
|
|
|
2
2
|
"name": "@fluentui/react-avatar",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Mon, 23 May 2022 12:10:26 GMT",
|
|
6
|
+
"tag": "@fluentui/react-avatar_v9.0.0-rc.9",
|
|
7
|
+
"version": "9.0.0-rc.9",
|
|
8
|
+
"comments": {
|
|
9
|
+
"prerelease": [
|
|
10
|
+
{
|
|
11
|
+
"author": "behowell@microsoft.com",
|
|
12
|
+
"package": "@fluentui/react-avatar",
|
|
13
|
+
"commit": "f57165a466c9d62226af2d49928f6eb797c20432",
|
|
14
|
+
"comment": "Add support for size={16} to Avatar"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "olfedias@microsoft.com",
|
|
18
|
+
"package": "@fluentui/react-avatar",
|
|
19
|
+
"commit": "60804cec07a495b8a5d1fc66338bf0443b212144",
|
|
20
|
+
"comment": "chore: Update Griffel to latest version"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "olfedias@microsoft.com",
|
|
24
|
+
"package": "@fluentui/react-avatar",
|
|
25
|
+
"commit": "f120fe9160ad7311a87af0cfacd8d2fb26275e34",
|
|
26
|
+
"comment": "chore: Update Griffel to latest version"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "esteban.230@hotmail.com",
|
|
30
|
+
"package": "@fluentui/react-avatar",
|
|
31
|
+
"commit": "72684d3d57ee3cb0d7012a31559b8a2b7ad36849",
|
|
32
|
+
"comment": "Moving Avatar stories to stories folder."
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"author": "beachball",
|
|
36
|
+
"package": "@fluentui/react-avatar",
|
|
37
|
+
"comment": "Bump @fluentui/react-badge to v9.0.0-rc.9",
|
|
38
|
+
"commit": "8d58f08997acf595e3eb7f628123e7fa7830c394"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"author": "beachball",
|
|
42
|
+
"package": "@fluentui/react-avatar",
|
|
43
|
+
"comment": "Bump @fluentui/react-button to v9.0.0-rc.10",
|
|
44
|
+
"commit": "8d58f08997acf595e3eb7f628123e7fa7830c394"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"author": "beachball",
|
|
48
|
+
"package": "@fluentui/react-avatar",
|
|
49
|
+
"comment": "Bump @fluentui/react-popover to v9.0.0-rc.10",
|
|
50
|
+
"commit": "8d58f08997acf595e3eb7f628123e7fa7830c394"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"author": "beachball",
|
|
54
|
+
"package": "@fluentui/react-avatar",
|
|
55
|
+
"comment": "Bump @fluentui/react-tooltip to v9.0.0-rc.10",
|
|
56
|
+
"commit": "8d58f08997acf595e3eb7f628123e7fa7830c394"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"author": "beachball",
|
|
60
|
+
"package": "@fluentui/react-avatar",
|
|
61
|
+
"comment": "Bump @fluentui/react-theme to v9.0.0-rc.8",
|
|
62
|
+
"commit": "8d58f08997acf595e3eb7f628123e7fa7830c394"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"author": "beachball",
|
|
66
|
+
"package": "@fluentui/react-avatar",
|
|
67
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.0.0-rc.8",
|
|
68
|
+
"commit": "8d58f08997acf595e3eb7f628123e7fa7830c394"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"author": "beachball",
|
|
72
|
+
"package": "@fluentui/react-avatar",
|
|
73
|
+
"comment": "Bump @fluentui/react-utilities to v9.0.0-rc.9",
|
|
74
|
+
"commit": "8d58f08997acf595e3eb7f628123e7fa7830c394"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"author": "beachball",
|
|
78
|
+
"package": "@fluentui/react-avatar",
|
|
79
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.6",
|
|
80
|
+
"commit": "8d58f08997acf595e3eb7f628123e7fa7830c394"
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"none": [
|
|
84
|
+
{
|
|
85
|
+
"author": "sarah.higley@microsoft.com",
|
|
86
|
+
"package": "@fluentui/react-avatar",
|
|
87
|
+
"commit": "59ea4de9c55cfaca51bac4a07e1e03fb60939a15",
|
|
88
|
+
"comment": "remove commons type from avatar and avatargroup"
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"date": "Thu, 05 May 2022 18:26:29 GMT",
|
|
6
95
|
"tag": "@fluentui/react-avatar_v9.0.0-rc.8",
|
|
7
96
|
"version": "9.0.0-rc.8",
|
|
8
97
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,32 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-avatar
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Mon, 23 May 2022 12:10:26 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.0.0-rc.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-avatar_v9.0.0-rc.9)
|
|
8
|
+
|
|
9
|
+
Mon, 23 May 2022 12:10:26 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-avatar_v9.0.0-rc.8..@fluentui/react-avatar_v9.0.0-rc.9)
|
|
11
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
|
|
14
|
+
- Add support for size={16} to Avatar ([PR #23003](https://github.com/microsoft/fluentui/pull/23003) by behowell@microsoft.com)
|
|
15
|
+
- chore: Update Griffel to latest version ([PR #23029](https://github.com/microsoft/fluentui/pull/23029) by olfedias@microsoft.com)
|
|
16
|
+
- chore: Update Griffel to latest version ([PR #22894](https://github.com/microsoft/fluentui/pull/22894) by olfedias@microsoft.com)
|
|
17
|
+
- Moving Avatar stories to stories folder. ([PR #23047](https://github.com/microsoft/fluentui/pull/23047) by esteban.230@hotmail.com)
|
|
18
|
+
- Bump @fluentui/react-badge to v9.0.0-rc.9 ([PR #23030](https://github.com/microsoft/fluentui/pull/23030) by beachball)
|
|
19
|
+
- Bump @fluentui/react-button to v9.0.0-rc.10 ([PR #23030](https://github.com/microsoft/fluentui/pull/23030) by beachball)
|
|
20
|
+
- Bump @fluentui/react-popover to v9.0.0-rc.10 ([PR #23030](https://github.com/microsoft/fluentui/pull/23030) by beachball)
|
|
21
|
+
- Bump @fluentui/react-tooltip to v9.0.0-rc.10 ([PR #23030](https://github.com/microsoft/fluentui/pull/23030) by beachball)
|
|
22
|
+
- Bump @fluentui/react-theme to v9.0.0-rc.8 ([PR #23030](https://github.com/microsoft/fluentui/pull/23030) by beachball)
|
|
23
|
+
- Bump @fluentui/react-shared-contexts to v9.0.0-rc.8 ([PR #23030](https://github.com/microsoft/fluentui/pull/23030) by beachball)
|
|
24
|
+
- Bump @fluentui/react-utilities to v9.0.0-rc.9 ([PR #23030](https://github.com/microsoft/fluentui/pull/23030) by beachball)
|
|
25
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.6 ([PR #23030](https://github.com/microsoft/fluentui/pull/23030) by beachball)
|
|
26
|
+
|
|
7
27
|
## [9.0.0-rc.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-avatar_v9.0.0-rc.8)
|
|
8
28
|
|
|
9
|
-
Thu, 05 May 2022 18:
|
|
29
|
+
Thu, 05 May 2022 18:26:29 GMT
|
|
10
30
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-avatar_v9.0.0-rc.7..@fluentui/react-avatar_v9.0.0-rc.8)
|
|
11
31
|
|
|
12
32
|
### Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -18,66 +18,6 @@ export declare const avatarClassName = "fui-Avatar";
|
|
|
18
18
|
|
|
19
19
|
export declare const avatarClassNames: SlotClassNames<AvatarSlots>;
|
|
20
20
|
|
|
21
|
-
declare type AvatarCommons = {
|
|
22
|
-
/**
|
|
23
|
-
* The name of the person or entity represented by this Avatar. This should always be provided if it is available.
|
|
24
|
-
*
|
|
25
|
-
* The name will be used to determine the initials displayed when there is no icon, as well as provided to
|
|
26
|
-
* accessibility tools.
|
|
27
|
-
*/
|
|
28
|
-
name?: string;
|
|
29
|
-
/**
|
|
30
|
-
* Size of the avatar in pixels.
|
|
31
|
-
*
|
|
32
|
-
* Size is restricted to a limited set of supported values recommended for most uses (see `AvatarSizeValue`) and
|
|
33
|
-
* based on design guidelines for the Avatar control.
|
|
34
|
-
*
|
|
35
|
-
* If a non-supported size is neeeded, set `size` to the next-smaller supported size, and set `width` and `height`
|
|
36
|
-
* to override the rendered size.
|
|
37
|
-
*
|
|
38
|
-
* For example, to set the avatar to 45px in size:
|
|
39
|
-
* `<Avatar size={40} style={{ width: '45px', height: '45px' }} />`
|
|
40
|
-
*
|
|
41
|
-
* @defaultvalue 32
|
|
42
|
-
*/
|
|
43
|
-
size: AvatarSizes;
|
|
44
|
-
/**
|
|
45
|
-
* The avatar can have a circular or square shape.
|
|
46
|
-
* @defaultvalue circular
|
|
47
|
-
*/
|
|
48
|
-
shape: 'circular' | 'square';
|
|
49
|
-
/**
|
|
50
|
-
* Optional activity indicator
|
|
51
|
-
* * active: the avatar will be decorated according to activeAppearance
|
|
52
|
-
* * inactive: the avatar will be reduced in size and partially transparent
|
|
53
|
-
* * unset: normal display
|
|
54
|
-
*
|
|
55
|
-
* @defaultvalue unset
|
|
56
|
-
*/
|
|
57
|
-
active: 'active' | 'inactive' | 'unset';
|
|
58
|
-
/**
|
|
59
|
-
* The appearance when `active="active"`
|
|
60
|
-
*
|
|
61
|
-
* @defaultvalue ring
|
|
62
|
-
*/
|
|
63
|
-
activeAppearance: 'ring' | 'shadow' | 'ring-shadow';
|
|
64
|
-
/**
|
|
65
|
-
* The color when displaying either an icon or initials.
|
|
66
|
-
* * neutral (default): gray
|
|
67
|
-
* * brand: color from the brand palette
|
|
68
|
-
* * colorful: picks a color from a set of pre-defined colors, based on a hash of the name (or idForColor if provided)
|
|
69
|
-
* * [AvatarNamedColor]: a specific color from the theme
|
|
70
|
-
*
|
|
71
|
-
* @defaultvalue neutral
|
|
72
|
-
*/
|
|
73
|
-
color: 'neutral' | 'brand' | 'colorful' | AvatarNamedColor;
|
|
74
|
-
/**
|
|
75
|
-
* Specify a string to be used instead of the name, to determine which color to use when color="colorful".
|
|
76
|
-
* Use this when a name is not available, but there is another unique identifier that can be used instead.
|
|
77
|
-
*/
|
|
78
|
-
idForColor: string | undefined;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
21
|
/**
|
|
82
22
|
* AvatarGroup component - TODO: add more docs
|
|
83
23
|
*/
|
|
@@ -85,39 +25,37 @@ export declare const AvatarGroup: ForwardRefComponent<AvatarGroupProps>;
|
|
|
85
25
|
|
|
86
26
|
export declare const avatarGroupClassNames: SlotClassNames<AvatarGroupSlots>;
|
|
87
27
|
|
|
88
|
-
|
|
28
|
+
/**
|
|
29
|
+
* AvatarGroup Props
|
|
30
|
+
*/
|
|
31
|
+
export declare type AvatarGroupProps = ComponentProps<AvatarGroupSlots> & {
|
|
89
32
|
/**
|
|
90
33
|
* Layout the Avatars should be displayed as.
|
|
91
34
|
* @default spread
|
|
92
35
|
*/
|
|
93
|
-
layout
|
|
36
|
+
layout?: 'spread' | 'stack' | 'pie';
|
|
94
37
|
/**
|
|
95
38
|
* Maximum number of Avatars to be displayed before overflowing.
|
|
96
39
|
* NOTE: if pie layout is used, `maxAvatars` will be ignored.
|
|
97
40
|
* @default 5
|
|
98
41
|
*/
|
|
99
|
-
maxAvatars
|
|
100
|
-
/**
|
|
101
|
-
* Size of the avatars.
|
|
102
|
-
* @default 32
|
|
103
|
-
*/
|
|
104
|
-
size: AvatarSizes;
|
|
42
|
+
maxAvatars?: number;
|
|
105
43
|
/**
|
|
106
44
|
* Whether the overflow indicator should render an icon instead of the number of overflowed avatars.
|
|
107
45
|
* @default false
|
|
108
46
|
*/
|
|
109
|
-
overflowIndicator
|
|
47
|
+
overflowIndicator?: 'number-overflowed' | 'icon';
|
|
48
|
+
/**
|
|
49
|
+
* Size of the avatars.
|
|
50
|
+
* @default 32
|
|
51
|
+
*/
|
|
52
|
+
size?: AvatarSizes;
|
|
110
53
|
/**
|
|
111
54
|
* Strings for localizing text in the tooltip.
|
|
112
55
|
*/
|
|
113
56
|
strings?: AvatarGroupStrings;
|
|
114
57
|
};
|
|
115
58
|
|
|
116
|
-
/**
|
|
117
|
-
* AvatarGroup Props
|
|
118
|
-
*/
|
|
119
|
-
export declare type AvatarGroupProps = ComponentProps<AvatarGroupSlots> & Partial<AvatarGroupCommons>;
|
|
120
|
-
|
|
121
59
|
export declare type AvatarGroupSlots = {
|
|
122
60
|
root: Slot<'div'>;
|
|
123
61
|
/**
|
|
@@ -133,7 +71,7 @@ export declare type AvatarGroupSlots = {
|
|
|
133
71
|
/**
|
|
134
72
|
* State used in rendering AvatarGroup
|
|
135
73
|
*/
|
|
136
|
-
export declare type AvatarGroupState = ComponentState<AvatarGroupSlots> &
|
|
74
|
+
export declare type AvatarGroupState = ComponentState<AvatarGroupSlots> & {
|
|
137
75
|
tooltipContent: TooltipProps['content'];
|
|
138
76
|
};
|
|
139
77
|
|
|
@@ -153,12 +91,72 @@ export declare type AvatarNamedColor = 'darkRed' | 'cranberry' | 'red' | 'pumpki
|
|
|
153
91
|
/**
|
|
154
92
|
* Properties for Avatar
|
|
155
93
|
*/
|
|
156
|
-
export declare type AvatarProps = Omit<ComponentProps<AvatarSlots>, 'color'> &
|
|
94
|
+
export declare type AvatarProps = Omit<ComponentProps<AvatarSlots>, 'color'> & {
|
|
95
|
+
/**
|
|
96
|
+
* Optional activity indicator
|
|
97
|
+
* * active: the avatar will be decorated according to activeAppearance
|
|
98
|
+
* * inactive: the avatar will be reduced in size and partially transparent
|
|
99
|
+
* * unset: normal display
|
|
100
|
+
*
|
|
101
|
+
* @default unset
|
|
102
|
+
*/
|
|
103
|
+
active?: 'active' | 'inactive' | 'unset';
|
|
104
|
+
/**
|
|
105
|
+
* The appearance when `active="active"`
|
|
106
|
+
*
|
|
107
|
+
* @default ring
|
|
108
|
+
*/
|
|
109
|
+
activeAppearance?: 'ring' | 'shadow' | 'ring-shadow';
|
|
110
|
+
/**
|
|
111
|
+
* The color when displaying either an icon or initials.
|
|
112
|
+
* * neutral (default): gray
|
|
113
|
+
* * brand: color from the brand palette
|
|
114
|
+
* * colorful: picks a color from a set of pre-defined colors, based on a hash of the name (or idForColor if provided)
|
|
115
|
+
* * [AvatarNamedColor]: a specific color from the theme
|
|
116
|
+
*
|
|
117
|
+
* @default neutral
|
|
118
|
+
*/
|
|
119
|
+
color?: 'neutral' | 'brand' | 'colorful' | AvatarNamedColor;
|
|
120
|
+
/**
|
|
121
|
+
* Specify a string to be used instead of the name, to determine which color to use when color="colorful".
|
|
122
|
+
* Use this when a name is not available, but there is another unique identifier that can be used instead.
|
|
123
|
+
*/
|
|
124
|
+
idForColor?: string | undefined;
|
|
125
|
+
/**
|
|
126
|
+
* The name of the person or entity represented by this Avatar. This should always be provided if it is available.
|
|
127
|
+
*
|
|
128
|
+
* The name will be used to determine the initials displayed when there is no icon, as well as provided to
|
|
129
|
+
* accessibility tools.
|
|
130
|
+
*/
|
|
131
|
+
name?: string;
|
|
132
|
+
/**
|
|
133
|
+
* The avatar can have a circular or square shape.
|
|
134
|
+
* @default circular
|
|
135
|
+
*/
|
|
136
|
+
shape?: 'circular' | 'square';
|
|
137
|
+
/**
|
|
138
|
+
* Size of the avatar in pixels.
|
|
139
|
+
*
|
|
140
|
+
* Size is restricted to a limited set of supported values recommended for most uses (see `AvatarSizeValue`) and
|
|
141
|
+
* based on design guidelines for the Avatar control.
|
|
142
|
+
*
|
|
143
|
+
* Note: At size 16, if initials are displayed, only the first initial will be rendered.
|
|
144
|
+
*
|
|
145
|
+
* If a non-supported size is neeeded, set `size` to the next-smaller supported size, and set `width` and `height`
|
|
146
|
+
* to override the rendered size.
|
|
147
|
+
*
|
|
148
|
+
* For example, to set the avatar to 45px in size:
|
|
149
|
+
* `<Avatar size={40} style={{ width: '45px', height: '45px' }} />`
|
|
150
|
+
*
|
|
151
|
+
* @default 32
|
|
152
|
+
*/
|
|
153
|
+
size?: AvatarSizes;
|
|
154
|
+
};
|
|
157
155
|
|
|
158
156
|
/**
|
|
159
157
|
* Sizes that can be used for the Avatar
|
|
160
158
|
*/
|
|
161
|
-
export declare type AvatarSizes = 20 | 24 | 28 | 32 | 36 | 40 | 48 | 56 | 64 | 72 | 96 | 120 | 128;
|
|
159
|
+
export declare type AvatarSizes = 16 | 20 | 24 | 28 | 32 | 36 | 40 | 48 | 56 | 64 | 72 | 96 | 120 | 128;
|
|
162
160
|
|
|
163
161
|
export declare type AvatarSlots = {
|
|
164
162
|
root: Slot<'span'>;
|
|
@@ -180,7 +178,7 @@ export declare type AvatarSlots = {
|
|
|
180
178
|
/**
|
|
181
179
|
* Icon to be displayed when the avatar doesn't have an image or initials.
|
|
182
180
|
*
|
|
183
|
-
* @
|
|
181
|
+
* @default `PersonRegular` (the default icon's size depends on the Avatar's size)
|
|
184
182
|
*/
|
|
185
183
|
icon?: Slot<'span'>;
|
|
186
184
|
/**
|
|
@@ -192,11 +190,11 @@ export declare type AvatarSlots = {
|
|
|
192
190
|
/**
|
|
193
191
|
* State used in rendering Avatar
|
|
194
192
|
*/
|
|
195
|
-
export declare type AvatarState = ComponentState<AvatarSlots> &
|
|
193
|
+
export declare type AvatarState = ComponentState<AvatarSlots> & Required<Pick<AvatarProps, 'active' | 'activeAppearance' | 'shape' | 'size'>> & {
|
|
196
194
|
/**
|
|
197
|
-
* The Avatar's color, with `'colorful'` resolved to a named color
|
|
195
|
+
* The Avatar's color, it matches props.color but with `'colorful'` resolved to a named color
|
|
198
196
|
*/
|
|
199
|
-
color: Exclude<
|
|
197
|
+
color: NonNullable<Exclude<AvatarProps['color'], 'colorful'>>;
|
|
200
198
|
};
|
|
201
199
|
|
|
202
200
|
/**
|
|
@@ -207,12 +205,17 @@ export declare type AvatarState = ComponentState<AvatarSlots> & AvatarCommons &
|
|
|
207
205
|
*
|
|
208
206
|
* @param displayName - The full name of the person or entity
|
|
209
207
|
* @param isRtl - Whether the display is in RTL
|
|
210
|
-
* @param
|
|
208
|
+
* @param options - Extra options to control the behavior of getInitials
|
|
211
209
|
*
|
|
212
210
|
* @returns The 1 or 2 character initials based on the name. Or an empty string if no initials
|
|
213
211
|
* could be derived from the name.
|
|
214
212
|
*/
|
|
215
|
-
export declare function getInitials(displayName: string | undefined | null, isRtl: boolean,
|
|
213
|
+
export declare function getInitials(displayName: string | undefined | null, isRtl: boolean, options?: {
|
|
214
|
+
/** Should initials be generated from phone numbers (default false) */
|
|
215
|
+
allowPhoneInitials?: boolean;
|
|
216
|
+
/** Returns only the first initial */
|
|
217
|
+
firstInitialOnly?: boolean;
|
|
218
|
+
}): string;
|
|
216
219
|
|
|
217
220
|
export declare const renderAvatar_unstable: (state: AvatarState) => JSX.Element;
|
|
218
221
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.types.js","sourceRoot":"../src/","sources":["components/Avatar/Avatar.types.ts"],"names":[],"mappings":"","sourcesContent":["import { PresenceBadge } from '@fluentui/react-badge';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type AvatarSlots = {\n root: Slot<'span'>;\n\n /**\n * The Avatar's image.\n *\n * Usage e.g.: `image={{ src: '...' }}`\n */\n image?: Slot<'img'>;\n\n /**\n * (optional) Custom initials.\n *\n * It is usually not necessary to specify custom initials; by default they will be derived from the `name` prop,\n * using the `getInitials` function.\n *\n * The initials are displayed when there is no image (including while the image is loading).\n */\n initials?: Slot<'span'>;\n\n /**\n * Icon to be displayed when the avatar doesn't have an image or initials.\n *\n * @
|
|
1
|
+
{"version":3,"file":"Avatar.types.js","sourceRoot":"../src/","sources":["components/Avatar/Avatar.types.ts"],"names":[],"mappings":"","sourcesContent":["import { PresenceBadge } from '@fluentui/react-badge';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type AvatarSlots = {\n root: Slot<'span'>;\n\n /**\n * The Avatar's image.\n *\n * Usage e.g.: `image={{ src: '...' }}`\n */\n image?: Slot<'img'>;\n\n /**\n * (optional) Custom initials.\n *\n * It is usually not necessary to specify custom initials; by default they will be derived from the `name` prop,\n * using the `getInitials` function.\n *\n * The initials are displayed when there is no image (including while the image is loading).\n */\n initials?: Slot<'span'>;\n\n /**\n * Icon to be displayed when the avatar doesn't have an image or initials.\n *\n * @default `PersonRegular` (the default icon's size depends on the Avatar's size)\n */\n icon?: Slot<'span'>;\n\n /**\n * Badge to show the avatar's presence status.\n */\n badge?: Slot<typeof PresenceBadge>;\n};\n\n/**\n * A specific named color for the Avatar\n */\nexport type AvatarNamedColor =\n | 'darkRed'\n | 'cranberry'\n | 'red'\n | 'pumpkin'\n | 'peach'\n | 'marigold'\n | 'gold'\n | 'brass'\n | 'brown'\n | 'forest'\n | 'seafoam'\n | 'darkGreen'\n | 'lightTeal'\n | 'teal'\n | 'steel'\n | 'blue'\n | 'royalBlue'\n | 'cornflower'\n | 'navy'\n | 'lavender'\n | 'purple'\n | 'grape'\n | 'lilac'\n | 'pink'\n | 'magenta'\n | 'plum'\n | 'beige'\n | 'mink'\n | 'platinum'\n | 'anchor';\n\n/**\n * Sizes that can be used for the Avatar\n */\nexport type AvatarSizes = 16 | 20 | 24 | 28 | 32 | 36 | 40 | 48 | 56 | 64 | 72 | 96 | 120 | 128;\n\n/**\n * Properties for Avatar\n */\nexport type AvatarProps = Omit<ComponentProps<AvatarSlots>, 'color'> & {\n /**\n * Optional activity indicator\n * * active: the avatar will be decorated according to activeAppearance\n * * inactive: the avatar will be reduced in size and partially transparent\n * * unset: normal display\n *\n * @default unset\n */\n active?: 'active' | 'inactive' | 'unset';\n\n /**\n * The appearance when `active=\"active\"`\n *\n * @default ring\n */\n activeAppearance?: 'ring' | 'shadow' | 'ring-shadow';\n\n /**\n * The color when displaying either an icon or initials.\n * * neutral (default): gray\n * * brand: color from the brand palette\n * * colorful: picks a color from a set of pre-defined colors, based on a hash of the name (or idForColor if provided)\n * * [AvatarNamedColor]: a specific color from the theme\n *\n * @default neutral\n */\n color?: 'neutral' | 'brand' | 'colorful' | AvatarNamedColor;\n\n /**\n * Specify a string to be used instead of the name, to determine which color to use when color=\"colorful\".\n * Use this when a name is not available, but there is another unique identifier that can be used instead.\n */\n idForColor?: string | undefined;\n\n /**\n * The name of the person or entity represented by this Avatar. This should always be provided if it is available.\n *\n * The name will be used to determine the initials displayed when there is no icon, as well as provided to\n * accessibility tools.\n */\n name?: string;\n\n /**\n * The avatar can have a circular or square shape.\n * @default circular\n */\n shape?: 'circular' | 'square';\n\n /**\n * Size of the avatar in pixels.\n *\n * Size is restricted to a limited set of supported values recommended for most uses (see `AvatarSizeValue`) and\n * based on design guidelines for the Avatar control.\n *\n * Note: At size 16, if initials are displayed, only the first initial will be rendered.\n *\n * If a non-supported size is neeeded, set `size` to the next-smaller supported size, and set `width` and `height`\n * to override the rendered size.\n *\n * For example, to set the avatar to 45px in size:\n * `<Avatar size={40} style={{ width: '45px', height: '45px' }} />`\n *\n * @default 32\n */\n size?: AvatarSizes;\n};\n\n/**\n * State used in rendering Avatar\n */\nexport type AvatarState = ComponentState<AvatarSlots> &\n Required<Pick<AvatarProps, 'active' | 'activeAppearance' | 'shape' | 'size'>> & {\n /**\n * The Avatar's color, it matches props.color but with `'colorful'` resolved to a named color\n */\n color: NonNullable<Exclude<AvatarProps['color'], 'colorful'>>;\n };\n"]}
|
|
@@ -41,7 +41,9 @@ export const useAvatar_unstable = (props, ref) => {
|
|
|
41
41
|
let initials = resolveShorthand(props.initials, {
|
|
42
42
|
required: true,
|
|
43
43
|
defaultProps: {
|
|
44
|
-
children: getInitials(name, dir === 'rtl'
|
|
44
|
+
children: getInitials(name, dir === 'rtl', {
|
|
45
|
+
firstInitialOnly: size <= 16
|
|
46
|
+
}),
|
|
45
47
|
'aria-hidden': true
|
|
46
48
|
}
|
|
47
49
|
}); // Render the icon slot *only if* there aren't any initials to display.
|
|
@@ -102,12 +104,10 @@ export const useAvatar_unstable = (props, ref) => {
|
|
|
102
104
|
|
|
103
105
|
return {
|
|
104
106
|
size,
|
|
105
|
-
name,
|
|
106
107
|
shape,
|
|
107
108
|
active,
|
|
108
109
|
activeAppearance,
|
|
109
110
|
color,
|
|
110
|
-
idForColor,
|
|
111
111
|
components: {
|
|
112
112
|
root: 'span',
|
|
113
113
|
initials: 'span',
|
|
@@ -1 +1 @@
|
|
|
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AM,EAAE,GAAG,GAAG,CAAC,UAAJ,CAAe,GAAf,CAAX;AACA,UAAM,KAAK,GAAG,GAAG,GAAG,CAApB;AACA,IAAA,QAAQ,IAAI,CAAC,EAAE,IAAI,KAAP,KAAiB,EAAE,IAAK,IAAI,KAA5B,CAAZ,CAHsD,CAGL;AAClD;;AAED,SAAO,QAAP;AACD,CATD","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand, useId } from '@fluentui/react-utilities';\nimport { getInitials } from '../../utils/index';\nimport type { AvatarNamedColor, AvatarProps, AvatarState } from './Avatar.types';\nimport { PersonRegular } from '@fluentui/react-icons';\nimport { PresenceBadge } from '@fluentui/react-badge';\nimport { useFluent } from '@fluentui/react-shared-contexts';\nimport { useMergedEventCallbacks } from '@fluentui/react-utilities';\n\nexport const useAvatar_unstable = (props: AvatarProps, ref: React.Ref<HTMLElement>): AvatarState => {\n const { dir } = useFluent();\n const { name, size = 32, shape = 'circular', active = 'unset', activeAppearance = 'ring', idForColor } = props;\n let { color = 'neutral' } = props;\n\n // Resolve 'colorful' to a specific color name\n if (color === 'colorful') {\n color = avatarColors[getHashCode(idForColor ?? name ?? '') % avatarColors.length];\n }\n\n const baseId = useId('avatar-');\n\n const root: AvatarState['root'] = getNativeElementProps(\n 'span',\n {\n role: 'img',\n id: baseId,\n // aria-label and/or aria-labelledby are resolved below\n ...props,\n ref,\n },\n /* excludedPropNames: */ ['name'],\n );\n\n // Resolve the initials slot, defaulted to getInitials.\n let initials: AvatarState['initials'] = resolveShorthand(props.initials, {\n required: true,\n defaultProps: {\n children: getInitials(name, dir === 'rtl', { firstInitialOnly: size <= 16 }),\n 'aria-hidden': true,\n },\n });\n\n // Render the icon slot *only if* there aren't any initials to display.\n let icon: AvatarState['icon'] = undefined;\n if (!initials?.children) {\n initials = undefined;\n icon = resolveShorthand(props.icon, {\n required: true,\n defaultProps: {\n children: <PersonRegular />,\n 'aria-hidden': true,\n id: baseId + '__initials',\n },\n });\n }\n\n const [imageHidden, setImageHidden] = React.useState<true | undefined>(undefined);\n const image: AvatarState['image'] = resolveShorthand(props.image, {\n defaultProps: {\n alt: '',\n role: 'presentation',\n 'aria-hidden': true,\n hidden: imageHidden,\n },\n });\n\n // Hide the image if it fails to load and restore it on a successful load\n const imageOnError = useMergedEventCallbacks(image?.onError, () => setImageHidden(true));\n const imageOnLoad = useMergedEventCallbacks(image?.onLoad, () => setImageHidden(undefined));\n if (image) {\n image.onError = imageOnError;\n image.onLoad = imageOnLoad;\n }\n\n const badge: AvatarState['badge'] = resolveShorthand(props.badge, {\n defaultProps: {\n size: getBadgeSize(size),\n role: 'presentation',\n 'aria-hidden': true,\n id: baseId + '__badge',\n },\n });\n\n // Resolve aria-label and/or aria-labelledby if not provided by the user\n if (!root['aria-label'] && !root['aria-labelledby']) {\n if (name) {\n root['aria-label'] = name;\n\n // Include the badge in labelledby if it exists\n if (badge) {\n root['aria-labelledby'] = root.id + ' ' + badge.id;\n }\n } else if (initials) {\n // root's aria-label should be the name, but fall back to being labelledby the initials if name is missing\n root['aria-labelledby'] = initials.id + (badge ? ' ' + badge.id : '');\n }\n }\n\n return {\n size,\n shape,\n active,\n activeAppearance,\n color,\n\n components: {\n root: 'span',\n initials: 'span',\n icon: 'span',\n image: 'img',\n badge: PresenceBadge,\n },\n\n root,\n initials,\n icon,\n image,\n badge,\n };\n};\n\nconst getBadgeSize = (size: AvatarState['size']) => {\n if (size >= 96) {\n return 'extra-large';\n } else if (size >= 64) {\n return 'large';\n } else if (size >= 56) {\n return 'medium';\n } else if (size >= 40) {\n return 'small';\n } else if (size >= 28) {\n return 'extra-small';\n } else {\n return 'tiny';\n }\n};\n\nconst avatarColors: AvatarNamedColor[] = [\n 'darkRed',\n 'cranberry',\n 'red',\n 'pumpkin',\n 'peach',\n 'marigold',\n 'gold',\n 'brass',\n 'brown',\n 'forest',\n 'seafoam',\n 'darkGreen',\n 'lightTeal',\n 'teal',\n 'steel',\n 'blue',\n 'royalBlue',\n 'cornflower',\n 'navy',\n 'lavender',\n 'purple',\n 'grape',\n 'lilac',\n 'pink',\n 'magenta',\n 'plum',\n 'beige',\n 'mink',\n 'platinum',\n 'anchor',\n];\n\nconst getHashCode = (str: string): number => {\n let hashCode = 0;\n for (let len: number = str.length - 1; len >= 0; len--) {\n const ch = str.charCodeAt(len);\n const shift = len % 8;\n hashCode ^= (ch << shift) + (ch >> (8 - shift)); // eslint-disable-line no-bitwise\n }\n\n return hashCode;\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -251,6 +251,9 @@ const useStyles = /*#__PURE__*/__styles({
|
|
|
251
251
|
"B7oj6ja": ["fuoumxm", "f1vtqnvc"],
|
|
252
252
|
"Btl43ni": ["f1vtqnvc", "fuoumxm"]
|
|
253
253
|
},
|
|
254
|
+
"icon12": {
|
|
255
|
+
"Be2twd7": "f1ugzwwg"
|
|
256
|
+
},
|
|
254
257
|
"icon16": {
|
|
255
258
|
"Be2twd7": "f4ybsrx"
|
|
256
259
|
},
|
|
@@ -270,10 +273,14 @@ const useStyles = /*#__PURE__*/__styles({
|
|
|
270
273
|
"Be2twd7": "f18m8u13"
|
|
271
274
|
}
|
|
272
275
|
}, {
|
|
273
|
-
"d": [".f14t3ns0{display:inline-block;}", ".fi64zpg{-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;}", ".f10pi13n{position:relative;}", ".fmrv4ls{vertical-align:middle;}", ".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);}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".f13mqy1h{font-size:var(--fontSizeBase100);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".f1pp30po{font-size:var(--fontSizeBase500);}", ".f1x0m3f5{font-size:var(--fontSizeBase600);}", ".f1g3puop{border-bottom-right-radius:var(--borderRadiusSmall);}", ".fi2rrw2{border-bottom-left-radius:var(--borderRadiusSmall);}", ".f1rstyi9{border-top-right-radius:var(--borderRadiusSmall);}", ".f1s4nn1u{border-top-left-radius:var(--borderRadiusSmall);}", ".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}", ".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}", ".f1ldthgs{border-bottom-right-radius:var(--borderRadiusLarge);}", ".frrelxk{border-bottom-left-radius:var(--borderRadiusLarge);}", ".fobrfso{border-top-right-radius:var(--borderRadiusLarge);}", ".ffisxpw{border-top-left-radius:var(--borderRadiusLarge);}", ".fnivh3a{border-bottom-right-radius:var(--borderRadiusXLarge);}", ".fc7yr5o{border-bottom-left-radius:var(--borderRadiusXLarge);}", ".f1el4m67{border-top-right-radius:var(--borderRadiusXLarge);}", ".f8yange{border-top-left-radius:var(--borderRadiusXLarge);}", ".ftfx35i{-webkit-transform:perspective(1px);-moz-transform:perspective(1px);-ms-transform:perspective(1px);transform:perspective(1px);}", ".fv0atk9{transition-property:transform,opacity;}", ".f19s7mzo{transition-duration:500ms,100ms;}", ".f1iounmt{transition-delay:cubic-bezier(0.80,0.00,0.20,1.00),linear;}", ".fuzzvh5:before{content:\"\";}", ".fxf9f1y:before{position:absolute;}", ".f14oqhab:before{top:0;}", ".f1t0u0az:before{left:0;}", ".fmlx6bj:before{right:0;}", ".flqennz:before{bottom:0;}", ".f7gntx7:before{border-bottom-right-radius:inherit;}", ".f1mc89cj:before{border-bottom-left-radius:inherit;}", ".f1vj2lhw:before{border-top-right-radius:inherit;}", ".f1trbl44:before{border-top-left-radius:inherit;}", ".f1psx457:before{transition-property:margin,opacity;}", ".feqeuj:before{transition-duration:500ms,400ms;}", ".f1o6ticg:before{transition-delay:cubic-bezier(0.80,0.00,0.20,1.00),linear;}", ".f17s8eb2:before{border-top-color:var(--colorBrandBackgroundStatic);}", ".fv9ryek:before{border-right-color:var(--colorBrandBackgroundStatic);}", ".f2ueew:before{border-left-color:var(--colorBrandBackgroundStatic);}", ".f1jwrqhc:before{border-bottom-color:var(--colorBrandBackgroundStatic);}", ".f1bwkb58:before{border-top-style:solid;}", ".fiio4mc:before{border-right-style:solid;}", ".fc8z0qo:before{border-left-style:solid;}", ".f1m5ya7j:before{border-bottom-style:solid;}", ".fh80ci2:before{margin-top:calc(-2 * var(--strokeWidthThick));}", ".f2bwiux:before{margin-right:calc(-2 * var(--strokeWidthThick));}", ".fsprf8b:before{margin-left:calc(-2 * var(--strokeWidthThick));}", ".f3h6zru:before{margin-bottom:calc(-2 * var(--strokeWidthThick));}", ".f1q8k45v:before{border-top-width:var(--strokeWidthThick);}", ".fsu5318:before{border-right-width:var(--strokeWidthThick);}", ".f17ooz8x:before{border-left-width:var(--strokeWidthThick);}", ".f1tf78pn:before{border-bottom-width:var(--strokeWidthThick);}", ".f19fdhy9:before{margin-top:calc(-2 * var(--strokeWidthThicker));}", ".fylzcb7:before{margin-right:calc(-2 * var(--strokeWidthThicker));}", ".fsjc8ey:before{margin-left:calc(-2 * var(--strokeWidthThicker));}", ".fw4k5ov:before{margin-bottom:calc(-2 * var(--strokeWidthThicker));}", ".fcdg7pk:before{border-top-width:var(--strokeWidthThicker);}", ".fqkplwy:before{border-right-width:var(--strokeWidthThicker);}", ".f14dmnnh:before{border-left-width:var(--strokeWidthThicker);}", ".fccqzkf:before{border-bottom-width:var(--strokeWidthThicker);}", ".flif9b5:before{margin-top:calc(-2 * var(--strokeWidthThickest));}", ".fo923rx:before{margin-right:calc(-2 * var(--strokeWidthThickest));}", ".f7jyntm:before{margin-left:calc(-2 * var(--strokeWidthThickest));}", ".f18p1wo9:before{margin-bottom:calc(-2 * var(--strokeWidthThickest));}", ".fjoz5ua:before{border-top-width:var(--strokeWidthThickest);}", ".f1lg5lk7:before{border-right-width:var(--strokeWidthThickest);}", ".fthel6x:before{border-left-width:var(--strokeWidthThickest);}", ".f4i03fv:before{border-bottom-width:var(--strokeWidthThickest);}", ".f15gzsq7:before{box-shadow:var(--shadow4);}", ".f1eebxl:before{box-shadow:var(--shadow8);}", ".fsnqaoy:before{box-shadow:var(--shadow16);}", ".f1sh7vtk:before{box-shadow:var(--shadow28);}", ".fp25eh{opacity:0.8;}", ".f1clczzi{-webkit-transform:scale(0.875);-moz-transform:scale(0.875);-ms-transform:scale(0.875);transform:scale(0.875);}", ".ftf4am9{transition-delay:cubic-bezier(0.33,0.00,0.10,1.00),linear;}", ".fede8dz:before{margin-top:0;}", ".fhlqc5k:before{margin-right:0;}", ".flnsm0g:before{margin-left:0;}", ".fc3uzr1:before{margin-bottom:0;}", ".f1429bq1:before{opacity:0;}", ".fuorts1:before{transition-delay:cubic-bezier(0.33,0.00,0.10,1.00),linear;}", ".f1euv43f{position:absolute;}", ".f1yab3r1{bottom:0;}", ".f1e31b4d{right:0;}", ".f1vgc2s3{left:0;}", ".ffo9j2l{box-shadow:0 0 0 var(--strokeWidthThin) var(--colorNeutralBackground1);}", ".f1nayfl2{box-shadow:0 0 0 var(--strokeWidthThick) var(--colorNeutralBackground1);}", ".f15twtuk{top:0;}", ".fly5x3f{width:100%;}", ".f1l02sjl{height:100%;}", ".f1d9uwra{border-bottom-right-radius:inherit;}", ".fzibvwi{border-bottom-left-radius:inherit;}", ".fuoumxm{border-top-right-radius:inherit;}", ".f1vtqnvc{border-top-left-radius:inherit;}", ".f1ps3kmd{object-fit:cover;}", ".f12kltsn{vertical-align:top;}", ".f1ewtqcl{box-sizing:border-box;}", ".fp6vxd{line-height:1;}", ".f192inf7{border-top-width:var(--strokeWidthThin);}", ".f5tn483{border-right-width:var(--strokeWidthThin);}", ".f1ojsxk5{border-left-width:var(--strokeWidthThin);}", ".f1vxd6vx{border-bottom-width:var(--strokeWidthThin);}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".fghlq4f{border-top-color:var(--colorTransparentStroke);}", ".f1gn591s{border-right-color:var(--colorTransparentStroke);}", ".fjscplz{border-left-color:var(--colorTransparentStroke);}", ".fb073pr{border-bottom-color:var(--colorTransparentStroke);}", ".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}", ".fa4t5tb{vertical-align:center;}", ".f17mccla{text-align:center;}", ".f1xqy1su{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}", ".f4ybsrx{font-size:16px;}", ".fe5j1ua{font-size:20px;}", ".f1rt2boy{font-size:24px;}", ".f24l1pt{font-size:28px;}", ".ffl51b{font-size:32px;}", ".f18m8u13{font-size:48px;}"]
|
|
276
|
+
"d": [".f14t3ns0{display:inline-block;}", ".fi64zpg{-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;}", ".f10pi13n{position:relative;}", ".fmrv4ls{vertical-align:middle;}", ".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);}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".f13mqy1h{font-size:var(--fontSizeBase100);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".f1pp30po{font-size:var(--fontSizeBase500);}", ".f1x0m3f5{font-size:var(--fontSizeBase600);}", ".f1g3puop{border-bottom-right-radius:var(--borderRadiusSmall);}", ".fi2rrw2{border-bottom-left-radius:var(--borderRadiusSmall);}", ".f1rstyi9{border-top-right-radius:var(--borderRadiusSmall);}", ".f1s4nn1u{border-top-left-radius:var(--borderRadiusSmall);}", ".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}", ".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}", ".f1ldthgs{border-bottom-right-radius:var(--borderRadiusLarge);}", ".frrelxk{border-bottom-left-radius:var(--borderRadiusLarge);}", ".fobrfso{border-top-right-radius:var(--borderRadiusLarge);}", ".ffisxpw{border-top-left-radius:var(--borderRadiusLarge);}", ".fnivh3a{border-bottom-right-radius:var(--borderRadiusXLarge);}", ".fc7yr5o{border-bottom-left-radius:var(--borderRadiusXLarge);}", ".f1el4m67{border-top-right-radius:var(--borderRadiusXLarge);}", ".f8yange{border-top-left-radius:var(--borderRadiusXLarge);}", ".ftfx35i{-webkit-transform:perspective(1px);-moz-transform:perspective(1px);-ms-transform:perspective(1px);transform:perspective(1px);}", ".fv0atk9{transition-property:transform,opacity;}", ".f19s7mzo{transition-duration:500ms,100ms;}", ".f1iounmt{transition-delay:cubic-bezier(0.80,0.00,0.20,1.00),linear;}", ".fuzzvh5:before{content:\"\";}", ".fxf9f1y:before{position:absolute;}", ".f14oqhab:before{top:0;}", ".f1t0u0az:before{left:0;}", ".fmlx6bj:before{right:0;}", ".flqennz:before{bottom:0;}", ".f7gntx7:before{border-bottom-right-radius:inherit;}", ".f1mc89cj:before{border-bottom-left-radius:inherit;}", ".f1vj2lhw:before{border-top-right-radius:inherit;}", ".f1trbl44:before{border-top-left-radius:inherit;}", ".f1psx457:before{transition-property:margin,opacity;}", ".feqeuj:before{transition-duration:500ms,400ms;}", ".f1o6ticg:before{transition-delay:cubic-bezier(0.80,0.00,0.20,1.00),linear;}", ".f17s8eb2:before{border-top-color:var(--colorBrandBackgroundStatic);}", ".fv9ryek:before{border-right-color:var(--colorBrandBackgroundStatic);}", ".f2ueew:before{border-left-color:var(--colorBrandBackgroundStatic);}", ".f1jwrqhc:before{border-bottom-color:var(--colorBrandBackgroundStatic);}", ".f1bwkb58:before{border-top-style:solid;}", ".fiio4mc:before{border-right-style:solid;}", ".fc8z0qo:before{border-left-style:solid;}", ".f1m5ya7j:before{border-bottom-style:solid;}", ".fh80ci2:before{margin-top:calc(-2 * var(--strokeWidthThick));}", ".f2bwiux:before{margin-right:calc(-2 * var(--strokeWidthThick));}", ".fsprf8b:before{margin-left:calc(-2 * var(--strokeWidthThick));}", ".f3h6zru:before{margin-bottom:calc(-2 * var(--strokeWidthThick));}", ".f1q8k45v:before{border-top-width:var(--strokeWidthThick);}", ".fsu5318:before{border-right-width:var(--strokeWidthThick);}", ".f17ooz8x:before{border-left-width:var(--strokeWidthThick);}", ".f1tf78pn:before{border-bottom-width:var(--strokeWidthThick);}", ".f19fdhy9:before{margin-top:calc(-2 * var(--strokeWidthThicker));}", ".fylzcb7:before{margin-right:calc(-2 * var(--strokeWidthThicker));}", ".fsjc8ey:before{margin-left:calc(-2 * var(--strokeWidthThicker));}", ".fw4k5ov:before{margin-bottom:calc(-2 * var(--strokeWidthThicker));}", ".fcdg7pk:before{border-top-width:var(--strokeWidthThicker);}", ".fqkplwy:before{border-right-width:var(--strokeWidthThicker);}", ".f14dmnnh:before{border-left-width:var(--strokeWidthThicker);}", ".fccqzkf:before{border-bottom-width:var(--strokeWidthThicker);}", ".flif9b5:before{margin-top:calc(-2 * var(--strokeWidthThickest));}", ".fo923rx:before{margin-right:calc(-2 * var(--strokeWidthThickest));}", ".f7jyntm:before{margin-left:calc(-2 * var(--strokeWidthThickest));}", ".f18p1wo9:before{margin-bottom:calc(-2 * var(--strokeWidthThickest));}", ".fjoz5ua:before{border-top-width:var(--strokeWidthThickest);}", ".f1lg5lk7:before{border-right-width:var(--strokeWidthThickest);}", ".fthel6x:before{border-left-width:var(--strokeWidthThickest);}", ".f4i03fv:before{border-bottom-width:var(--strokeWidthThickest);}", ".f15gzsq7:before{box-shadow:var(--shadow4);}", ".f1eebxl:before{box-shadow:var(--shadow8);}", ".fsnqaoy:before{box-shadow:var(--shadow16);}", ".f1sh7vtk:before{box-shadow:var(--shadow28);}", ".fp25eh{opacity:0.8;}", ".f1clczzi{-webkit-transform:scale(0.875);-moz-transform:scale(0.875);-ms-transform:scale(0.875);transform:scale(0.875);}", ".ftf4am9{transition-delay:cubic-bezier(0.33,0.00,0.10,1.00),linear;}", ".fede8dz:before{margin-top:0;}", ".fhlqc5k:before{margin-right:0;}", ".flnsm0g:before{margin-left:0;}", ".fc3uzr1:before{margin-bottom:0;}", ".f1429bq1:before{opacity:0;}", ".fuorts1:before{transition-delay:cubic-bezier(0.33,0.00,0.10,1.00),linear;}", ".f1euv43f{position:absolute;}", ".f1yab3r1{bottom:0;}", ".f1e31b4d{right:0;}", ".f1vgc2s3{left:0;}", ".ffo9j2l{box-shadow:0 0 0 var(--strokeWidthThin) var(--colorNeutralBackground1);}", ".f1nayfl2{box-shadow:0 0 0 var(--strokeWidthThick) var(--colorNeutralBackground1);}", ".f15twtuk{top:0;}", ".fly5x3f{width:100%;}", ".f1l02sjl{height:100%;}", ".f1d9uwra{border-bottom-right-radius:inherit;}", ".fzibvwi{border-bottom-left-radius:inherit;}", ".fuoumxm{border-top-right-radius:inherit;}", ".f1vtqnvc{border-top-left-radius:inherit;}", ".f1ps3kmd{object-fit:cover;}", ".f12kltsn{vertical-align:top;}", ".f1ewtqcl{box-sizing:border-box;}", ".fp6vxd{line-height:1;}", ".f192inf7{border-top-width:var(--strokeWidthThin);}", ".f5tn483{border-right-width:var(--strokeWidthThin);}", ".f1ojsxk5{border-left-width:var(--strokeWidthThin);}", ".f1vxd6vx{border-bottom-width:var(--strokeWidthThin);}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".fghlq4f{border-top-color:var(--colorTransparentStroke);}", ".f1gn591s{border-right-color:var(--colorTransparentStroke);}", ".fjscplz{border-left-color:var(--colorTransparentStroke);}", ".fb073pr{border-bottom-color:var(--colorTransparentStroke);}", ".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}", ".fa4t5tb{vertical-align:center;}", ".f17mccla{text-align:center;}", ".f1xqy1su{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}", ".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;}"]
|
|
274
277
|
});
|
|
275
278
|
|
|
276
279
|
const useSizeStyles = /*#__PURE__*/__styles({
|
|
280
|
+
"16": {
|
|
281
|
+
"a9b677": "fjw5fx7",
|
|
282
|
+
"Bqenvij": "fd461yt"
|
|
283
|
+
},
|
|
277
284
|
"20": {
|
|
278
285
|
"a9b677": "f64fuq3",
|
|
279
286
|
"Bqenvij": "fjamq6b"
|
|
@@ -327,7 +334,7 @@ const useSizeStyles = /*#__PURE__*/__styles({
|
|
|
327
334
|
"Bqenvij": "fele2au"
|
|
328
335
|
}
|
|
329
336
|
}, {
|
|
330
|
-
"d": [".f64fuq3{width:20px;}", ".fjamq6b{height:20px;}", ".fq4mcun{width:24px;}", ".frvgh55{height:24px;}", ".f1w9dchk{width:28px;}", ".fxldao9{height:28px;}", ".f1szoe96{width:32px;}", ".f1d2rq10{height:32px;}", ".fpdz1er{width:36px;}", ".f8ljn23{height:36px;}", ".feqmc2u{width:40px;}", ".fbhnoac{height:40px;}", ".f124akge{width:48px;}", ".ff2sm71{height:48px;}", ".f1u66zr1{width:56px;}", ".fzki0ko{height:56px;}", ".fa9ln6p{width:64px;}", ".f16k9i2m{height:64px;}", ".fhcae8x{width:72px;}", ".f1shusfg{height:72px;}", ".f1kyr2gn{width:96px;}", ".fypu0ge{height:96px;}", ".fwfqyga{width:120px;}", ".fjr5b71{height:120px;}", ".f1iksgmy{width:128px;}", ".fele2au{height:128px;}"]
|
|
337
|
+
"d": [".fjw5fx7{width:16px;}", ".fd461yt{height:16px;}", ".f64fuq3{width:20px;}", ".fjamq6b{height:20px;}", ".fq4mcun{width:24px;}", ".frvgh55{height:24px;}", ".f1w9dchk{width:28px;}", ".fxldao9{height:28px;}", ".f1szoe96{width:32px;}", ".f1d2rq10{height:32px;}", ".fpdz1er{width:36px;}", ".f8ljn23{height:36px;}", ".feqmc2u{width:40px;}", ".fbhnoac{height:40px;}", ".f124akge{width:48px;}", ".ff2sm71{height:48px;}", ".f1u66zr1{width:56px;}", ".fzki0ko{height:56px;}", ".fa9ln6p{width:64px;}", ".f16k9i2m{height:64px;}", ".fhcae8x{width:72px;}", ".f1shusfg{height:72px;}", ".f1kyr2gn{width:96px;}", ".fypu0ge{height:96px;}", ".fwfqyga{width:120px;}", ".fjr5b71{height:120px;}", ".f1iksgmy{width:128px;}", ".fele2au{height:128px;}"]
|
|
331
338
|
});
|
|
332
339
|
|
|
333
340
|
const useColorStyles = /*#__PURE__*/__styles({
|
|
@@ -552,7 +559,9 @@ export const useAvatarStyles_unstable = state => {
|
|
|
552
559
|
if (state.icon) {
|
|
553
560
|
let iconSizeClass;
|
|
554
561
|
|
|
555
|
-
if (size <=
|
|
562
|
+
if (size <= 16) {
|
|
563
|
+
iconSizeClass = styles.icon12;
|
|
564
|
+
} else if (size <= 24) {
|
|
556
565
|
iconSizeClass = styles.icon16;
|
|
557
566
|
} else if (size <= 40) {
|
|
558
567
|
iconSizeClass = styles.icon20;
|