@fluentui/react-avatar 9.5.3 → 9.5.5
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 +115 -1
- package/CHANGELOG.md +34 -2
- package/lib/Avatar.js +0 -1
- package/lib/Avatar.js.map +1 -1
- package/lib/AvatarGroup.js +0 -1
- package/lib/AvatarGroup.js.map +1 -1
- package/lib/AvatarGroupItem.js +0 -1
- package/lib/AvatarGroupItem.js.map +1 -1
- package/lib/AvatarGroupPopover.js +0 -1
- package/lib/AvatarGroupPopover.js.map +1 -1
- package/lib/components/Avatar/Avatar.js +5 -6
- package/lib/components/Avatar/Avatar.js.map +1 -1
- package/lib/components/Avatar/Avatar.types.js +1 -2
- package/lib/components/Avatar/Avatar.types.js.map +1 -1
- package/lib/components/Avatar/index.js +0 -1
- package/lib/components/Avatar/index.js.map +1 -1
- package/lib/components/Avatar/renderAvatar.js +4 -8
- package/lib/components/Avatar/renderAvatar.js.map +1 -1
- package/lib/components/Avatar/useAvatar.js +165 -148
- package/lib/components/Avatar/useAvatar.js.map +1 -1
- package/lib/components/Avatar/useAvatarStyles.styles.js.map +1 -1
- package/lib/components/AvatarGroup/AvatarGroup.js +6 -8
- package/lib/components/AvatarGroup/AvatarGroup.js.map +1 -1
- package/lib/components/AvatarGroup/AvatarGroup.types.js +1 -2
- package/lib/components/AvatarGroup/AvatarGroup.types.js.map +1 -1
- package/lib/components/AvatarGroup/index.js +0 -1
- package/lib/components/AvatarGroup/index.js.map +1 -1
- package/lib/components/AvatarGroup/renderAvatarGroup.js +6 -11
- package/lib/components/AvatarGroup/renderAvatarGroup.js.map +1 -1
- package/lib/components/AvatarGroup/useAvatarGroup.js +17 -20
- package/lib/components/AvatarGroup/useAvatarGroup.js.map +1 -1
- package/lib/components/AvatarGroup/useAvatarGroupContextValues.js +9 -13
- package/lib/components/AvatarGroup/useAvatarGroupContextValues.js.map +1 -1
- package/lib/components/AvatarGroup/useAvatarGroupStyles.styles.js.map +1 -1
- package/lib/components/AvatarGroupItem/AvatarGroupItem.js +5 -7
- package/lib/components/AvatarGroupItem/AvatarGroupItem.js.map +1 -1
- package/lib/components/AvatarGroupItem/AvatarGroupItem.types.js +1 -2
- package/lib/components/AvatarGroupItem/AvatarGroupItem.types.js.map +1 -1
- package/lib/components/AvatarGroupItem/index.js +0 -1
- package/lib/components/AvatarGroupItem/index.js.map +1 -1
- package/lib/components/AvatarGroupItem/renderAvatarGroupItem.js +4 -9
- package/lib/components/AvatarGroupItem/renderAvatarGroupItem.js.map +1 -1
- package/lib/components/AvatarGroupItem/useAvatarGroupItem.js +45 -51
- package/lib/components/AvatarGroupItem/useAvatarGroupItem.js.map +1 -1
- package/lib/components/AvatarGroupItem/useAvatarGroupItemStyles.styles.js.map +1 -1
- package/lib/components/AvatarGroupPopover/AvatarGroupPopover.js +6 -8
- package/lib/components/AvatarGroupPopover/AvatarGroupPopover.js.map +1 -1
- package/lib/components/AvatarGroupPopover/AvatarGroupPopover.types.js +0 -1
- package/lib/components/AvatarGroupPopover/AvatarGroupPopover.types.js.map +1 -1
- package/lib/components/AvatarGroupPopover/index.js +0 -1
- package/lib/components/AvatarGroupPopover/index.js.map +1 -1
- package/lib/components/AvatarGroupPopover/renderAvatarGroupPopover.js +8 -13
- package/lib/components/AvatarGroupPopover/renderAvatarGroupPopover.js.map +1 -1
- package/lib/components/AvatarGroupPopover/useAvatarGroupPopover.js +74 -81
- package/lib/components/AvatarGroupPopover/useAvatarGroupPopover.js.map +1 -1
- package/lib/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js +8 -9
- package/lib/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js.map +1 -1
- package/lib/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.styles.js.map +1 -1
- package/lib/contexts/AvatarContext.js +3 -6
- package/lib/contexts/AvatarContext.js.map +1 -1
- package/lib/contexts/AvatarGroupContext.js +2 -4
- package/lib/contexts/AvatarGroupContext.js.map +1 -1
- package/lib/contexts/index.js +0 -1
- package/lib/contexts/index.js.map +1 -1
- package/lib/index.js +0 -1
- package/lib/index.js.map +1 -1
- package/lib/utils/getInitials.js +37 -43
- package/lib/utils/getInitials.js.map +1 -1
- package/lib/utils/index.js +0 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/partitionAvatarGroupItems.js +15 -18
- package/lib/utils/partitionAvatarGroupItems.js.map +1 -1
- package/lib-commonjs/Avatar.js +0 -3
- package/lib-commonjs/Avatar.js.map +1 -1
- package/lib-commonjs/AvatarGroup.js +0 -3
- package/lib-commonjs/AvatarGroup.js.map +1 -1
- package/lib-commonjs/AvatarGroupItem.js +0 -3
- package/lib-commonjs/AvatarGroupItem.js.map +1 -1
- package/lib-commonjs/AvatarGroupPopover.js +0 -3
- package/lib-commonjs/AvatarGroupPopover.js.map +1 -1
- package/lib-commonjs/components/Avatar/Avatar.js +1 -3
- package/lib-commonjs/components/Avatar/Avatar.js.map +1 -1
- package/lib-commonjs/components/Avatar/Avatar.types.js +0 -3
- package/lib-commonjs/components/Avatar/Avatar.types.js.map +1 -1
- package/lib-commonjs/components/Avatar/index.js +0 -3
- package/lib-commonjs/components/Avatar/index.js.map +1 -1
- package/lib-commonjs/components/Avatar/renderAvatar.js +1 -3
- package/lib-commonjs/components/Avatar/renderAvatar.js.map +1 -1
- package/lib-commonjs/components/Avatar/useAvatar.js +1 -3
- package/lib-commonjs/components/Avatar/useAvatar.js.map +1 -1
- package/lib-commonjs/components/Avatar/useAvatarStyles.styles.js +0 -2
- package/lib-commonjs/components/Avatar/useAvatarStyles.styles.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.js +1 -3
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.types.js +0 -3
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.types.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/index.js +0 -3
- package/lib-commonjs/components/AvatarGroup/index.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/renderAvatarGroup.js +1 -3
- package/lib-commonjs/components/AvatarGroup/renderAvatarGroup.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/useAvatarGroup.js +1 -3
- package/lib-commonjs/components/AvatarGroup/useAvatarGroup.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/useAvatarGroupContextValues.js +1 -3
- package/lib-commonjs/components/AvatarGroup/useAvatarGroupContextValues.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.styles.js +0 -2
- package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.styles.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupItem/AvatarGroupItem.js +1 -3
- package/lib-commonjs/components/AvatarGroupItem/AvatarGroupItem.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupItem/AvatarGroupItem.types.js +0 -3
- package/lib-commonjs/components/AvatarGroupItem/AvatarGroupItem.types.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupItem/index.js +0 -3
- package/lib-commonjs/components/AvatarGroupItem/index.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupItem/renderAvatarGroupItem.js +1 -3
- package/lib-commonjs/components/AvatarGroupItem/renderAvatarGroupItem.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItem.js +1 -3
- package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItem.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItemStyles.styles.js +0 -2
- package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItemStyles.styles.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupPopover/AvatarGroupPopover.js +1 -3
- package/lib-commonjs/components/AvatarGroupPopover/AvatarGroupPopover.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupPopover/AvatarGroupPopover.types.js +0 -3
- package/lib-commonjs/components/AvatarGroupPopover/AvatarGroupPopover.types.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupPopover/index.js +0 -3
- package/lib-commonjs/components/AvatarGroupPopover/index.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupPopover/renderAvatarGroupPopover.js +1 -3
- package/lib-commonjs/components/AvatarGroupPopover/renderAvatarGroupPopover.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopover.js +1 -3
- package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopover.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js +1 -3
- package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.styles.js +0 -2
- package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.styles.js.map +1 -1
- package/lib-commonjs/contexts/AvatarContext.js +1 -3
- package/lib-commonjs/contexts/AvatarContext.js.map +1 -1
- package/lib-commonjs/contexts/AvatarGroupContext.js +2 -4
- package/lib-commonjs/contexts/AvatarGroupContext.js.map +1 -1
- package/lib-commonjs/contexts/index.js +0 -3
- package/lib-commonjs/contexts/index.js.map +1 -1
- package/lib-commonjs/index.js +0 -3
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/getInitials.js +4 -6
- package/lib-commonjs/utils/getInitials.js.map +1 -1
- package/lib-commonjs/utils/index.js +0 -3
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/partitionAvatarGroupItems.js +1 -3
- package/lib-commonjs/utils/partitionAvatarGroupItems.js.map +1 -1
- package/package.json +10 -10
|
@@ -6,161 +6,178 @@ import { PresenceBadge } from '@fluentui/react-badge';
|
|
|
6
6
|
import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';
|
|
7
7
|
import { useAvatarContext } from '../../contexts/AvatarContext';
|
|
8
8
|
export const DEFAULT_STRINGS = {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
active: 'active',
|
|
10
|
+
inactive: 'inactive'
|
|
11
11
|
};
|
|
12
|
-
export const useAvatar_unstable = (props, ref)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
name,
|
|
22
|
-
size = contextSize !== null && contextSize !== void 0 ? contextSize : 32,
|
|
23
|
-
shape = contextShape !== null && contextShape !== void 0 ? contextShape : 'circular',
|
|
24
|
-
active = 'unset',
|
|
25
|
-
activeAppearance = 'ring',
|
|
26
|
-
idForColor
|
|
27
|
-
} = props;
|
|
28
|
-
let {
|
|
29
|
-
color = 'neutral'
|
|
30
|
-
} = props;
|
|
31
|
-
// Resolve 'colorful' to a specific color name
|
|
32
|
-
if (color === 'colorful') {
|
|
33
|
-
var _ref;
|
|
34
|
-
color = avatarColors[getHashCode((_ref = idForColor !== null && idForColor !== void 0 ? idForColor : name) !== null && _ref !== void 0 ? _ref : '') % avatarColors.length];
|
|
35
|
-
}
|
|
36
|
-
const baseId = useId('avatar-');
|
|
37
|
-
const root = getNativeElementProps('span', {
|
|
38
|
-
role: 'img',
|
|
39
|
-
id: baseId,
|
|
40
|
-
// aria-label and/or aria-labelledby are resolved below
|
|
41
|
-
...props,
|
|
42
|
-
ref
|
|
43
|
-
}, /* excludedPropNames: */['name']);
|
|
44
|
-
const [imageHidden, setImageHidden] = React.useState(undefined);
|
|
45
|
-
const image = resolveShorthand(props.image, {
|
|
46
|
-
defaultProps: {
|
|
47
|
-
alt: '',
|
|
48
|
-
role: 'presentation',
|
|
49
|
-
'aria-hidden': true,
|
|
50
|
-
hidden: imageHidden
|
|
12
|
+
export const useAvatar_unstable = (props, ref)=>{
|
|
13
|
+
const { dir } = useFluent();
|
|
14
|
+
const { shape: contextShape , size: contextSize } = useAvatarContext();
|
|
15
|
+
const { name , size =contextSize !== null && contextSize !== void 0 ? contextSize : 32 , shape =contextShape !== null && contextShape !== void 0 ? contextShape : 'circular' , active ='unset' , activeAppearance ='ring' , idForColor } = props;
|
|
16
|
+
let { color ='neutral' } = props;
|
|
17
|
+
// Resolve 'colorful' to a specific color name
|
|
18
|
+
if (color === 'colorful') {
|
|
19
|
+
var _ref;
|
|
20
|
+
color = avatarColors[getHashCode((_ref = idForColor !== null && idForColor !== void 0 ? idForColor : name) !== null && _ref !== void 0 ? _ref : '') % avatarColors.length];
|
|
51
21
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
22
|
+
const baseId = useId('avatar-');
|
|
23
|
+
const root = getNativeElementProps('span', {
|
|
24
|
+
role: 'img',
|
|
25
|
+
id: baseId,
|
|
26
|
+
// aria-label and/or aria-labelledby are resolved below
|
|
27
|
+
...props,
|
|
28
|
+
ref
|
|
29
|
+
}, /* excludedPropNames: */ [
|
|
30
|
+
'name'
|
|
31
|
+
]);
|
|
32
|
+
const [imageHidden, setImageHidden] = React.useState(undefined);
|
|
33
|
+
const image = resolveShorthand(props.image, {
|
|
34
|
+
defaultProps: {
|
|
35
|
+
alt: '',
|
|
36
|
+
role: 'presentation',
|
|
37
|
+
'aria-hidden': true,
|
|
38
|
+
hidden: imageHidden
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
// Hide the image if it fails to load and restore it on a successful load
|
|
42
|
+
if (image) {
|
|
43
|
+
image.onError = mergeCallbacks(image.onError, ()=>setImageHidden(true));
|
|
44
|
+
image.onLoad = mergeCallbacks(image.onLoad, ()=>setImageHidden(undefined));
|
|
66
45
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
required: true,
|
|
77
|
-
defaultProps: {
|
|
78
|
-
children: /*#__PURE__*/React.createElement(PersonRegular, null),
|
|
79
|
-
'aria-hidden': true
|
|
80
|
-
}
|
|
46
|
+
// Resolve the initials slot, defaulted to getInitials.
|
|
47
|
+
let initials = resolveShorthand(props.initials, {
|
|
48
|
+
required: true,
|
|
49
|
+
defaultProps: {
|
|
50
|
+
children: getInitials(name, dir === 'rtl', {
|
|
51
|
+
firstInitialOnly: size <= 16
|
|
52
|
+
}),
|
|
53
|
+
id: baseId + '__initials'
|
|
54
|
+
}
|
|
81
55
|
});
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
size: getBadgeSize(size),
|
|
86
|
-
id: baseId + '__badge'
|
|
56
|
+
// Don't render the initials slot if it's empty
|
|
57
|
+
if (!(initials === null || initials === void 0 ? void 0 : initials.children)) {
|
|
58
|
+
initials = undefined;
|
|
87
59
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
} else if (initials) {
|
|
99
|
-
// root's aria-label should be the name, but fall back to being labelledby the initials if name is missing
|
|
100
|
-
root['aria-labelledby'] = initials.id + (badge ? ' ' + badge.id : '');
|
|
60
|
+
// Render the icon slot *only if* there aren't any initials or image to display
|
|
61
|
+
let icon = undefined;
|
|
62
|
+
if (!initials && (!image || imageHidden)) {
|
|
63
|
+
icon = resolveShorthand(props.icon, {
|
|
64
|
+
required: true,
|
|
65
|
+
defaultProps: {
|
|
66
|
+
children: /*#__PURE__*/ React.createElement(PersonRegular, null),
|
|
67
|
+
'aria-hidden': true
|
|
68
|
+
}
|
|
69
|
+
});
|
|
101
70
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
71
|
+
const badge = resolveShorthand(props.badge, {
|
|
72
|
+
defaultProps: {
|
|
73
|
+
size: getBadgeSize(size),
|
|
74
|
+
id: baseId + '__badge'
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
let activeAriaLabelElement;
|
|
78
|
+
// Resolve aria-label and/or aria-labelledby if not provided by the user
|
|
79
|
+
if (!root['aria-label'] && !root['aria-labelledby']) {
|
|
80
|
+
if (name) {
|
|
81
|
+
root['aria-label'] = name;
|
|
82
|
+
// Include the badge in labelledby if it exists
|
|
83
|
+
if (badge) {
|
|
84
|
+
root['aria-labelledby'] = root.id + ' ' + badge.id;
|
|
85
|
+
}
|
|
86
|
+
} else if (initials) {
|
|
87
|
+
// root's aria-label should be the name, but fall back to being labelledby the initials if name is missing
|
|
88
|
+
root['aria-labelledby'] = initials.id + (badge ? ' ' + badge.id : '');
|
|
89
|
+
}
|
|
90
|
+
// Add the active state to the aria label
|
|
91
|
+
if (active === 'active' || active === 'inactive') {
|
|
92
|
+
const activeText = DEFAULT_STRINGS[active];
|
|
93
|
+
if (root['aria-labelledby']) {
|
|
94
|
+
// If using aria-labelledby, render a hidden span and append it to the labelledby
|
|
95
|
+
const activeId = baseId + '__active';
|
|
96
|
+
root['aria-labelledby'] += ' ' + activeId;
|
|
97
|
+
activeAriaLabelElement = /*#__PURE__*/ React.createElement("span", {
|
|
98
|
+
hidden: true,
|
|
99
|
+
id: activeId
|
|
100
|
+
}, activeText);
|
|
101
|
+
} else if (root['aria-label']) {
|
|
102
|
+
// Otherwise, just append it to the aria-label
|
|
103
|
+
root['aria-label'] += ' ' + activeText;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
117
106
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
};
|
|
107
|
+
return {
|
|
108
|
+
size,
|
|
109
|
+
shape,
|
|
110
|
+
active,
|
|
111
|
+
activeAppearance,
|
|
112
|
+
activeAriaLabelElement,
|
|
113
|
+
color,
|
|
114
|
+
components: {
|
|
115
|
+
root: 'span',
|
|
116
|
+
initials: 'span',
|
|
117
|
+
icon: 'span',
|
|
118
|
+
image: 'img',
|
|
119
|
+
badge: PresenceBadge
|
|
120
|
+
},
|
|
121
|
+
root,
|
|
122
|
+
initials,
|
|
123
|
+
icon,
|
|
124
|
+
image,
|
|
125
|
+
badge
|
|
126
|
+
};
|
|
139
127
|
};
|
|
140
|
-
const getBadgeSize = size
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
128
|
+
const getBadgeSize = (size)=>{
|
|
129
|
+
if (size >= 96) {
|
|
130
|
+
return 'extra-large';
|
|
131
|
+
} else if (size >= 64) {
|
|
132
|
+
return 'large';
|
|
133
|
+
} else if (size >= 56) {
|
|
134
|
+
return 'medium';
|
|
135
|
+
} else if (size >= 40) {
|
|
136
|
+
return 'small';
|
|
137
|
+
} else if (size >= 28) {
|
|
138
|
+
return 'extra-small';
|
|
139
|
+
} else {
|
|
140
|
+
return 'tiny';
|
|
141
|
+
}
|
|
154
142
|
};
|
|
155
|
-
const avatarColors = [
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
143
|
+
const avatarColors = [
|
|
144
|
+
'dark-red',
|
|
145
|
+
'cranberry',
|
|
146
|
+
'red',
|
|
147
|
+
'pumpkin',
|
|
148
|
+
'peach',
|
|
149
|
+
'marigold',
|
|
150
|
+
'gold',
|
|
151
|
+
'brass',
|
|
152
|
+
'brown',
|
|
153
|
+
'forest',
|
|
154
|
+
'seafoam',
|
|
155
|
+
'dark-green',
|
|
156
|
+
'light-teal',
|
|
157
|
+
'teal',
|
|
158
|
+
'steel',
|
|
159
|
+
'blue',
|
|
160
|
+
'royal-blue',
|
|
161
|
+
'cornflower',
|
|
162
|
+
'navy',
|
|
163
|
+
'lavender',
|
|
164
|
+
'purple',
|
|
165
|
+
'grape',
|
|
166
|
+
'lilac',
|
|
167
|
+
'pink',
|
|
168
|
+
'magenta',
|
|
169
|
+
'plum',
|
|
170
|
+
'beige',
|
|
171
|
+
'mink',
|
|
172
|
+
'platinum',
|
|
173
|
+
'anchor'
|
|
174
|
+
];
|
|
175
|
+
const getHashCode = (str)=>{
|
|
176
|
+
let hashCode = 0;
|
|
177
|
+
for(let len = str.length - 1; len >= 0; len--){
|
|
178
|
+
const ch = str.charCodeAt(len);
|
|
179
|
+
const shift = len % 8;
|
|
180
|
+
hashCode ^= (ch << shift) + (ch >> 8 - shift); // eslint-disable-line no-bitwise
|
|
181
|
+
}
|
|
182
|
+
return hashCode;
|
|
165
183
|
};
|
|
166
|
-
//# sourceMappingURL=useAvatar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","getNativeElementProps","mergeCallbacks","resolveShorthand","useId","getInitials","PersonRegular","PresenceBadge","useFluent_unstable","useFluent","useAvatarContext","DEFAULT_STRINGS","active","inactive","useAvatar_unstable","props","ref","dir","shape","contextShape","size","contextSize","name","activeAppearance","idForColor","color","_ref","avatarColors","getHashCode","length","baseId","root","role","id","imageHidden","setImageHidden","useState","undefined","image","defaultProps","alt","hidden","onError","onLoad","initials","required","children","firstInitialOnly","icon","createElement","badge","getBadgeSize","activeAriaLabelElement","activeText","activeId","components","str","hashCode","len","ch","charCodeAt","shift"],"sources":["../../../src/components/Avatar/useAvatar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, mergeCallbacks, 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_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useAvatarContext } from '../../contexts/AvatarContext';\n\nexport const DEFAULT_STRINGS = {\n active: 'active',\n inactive: 'inactive',\n};\n\nexport const useAvatar_unstable = (props: AvatarProps, ref: React.Ref<HTMLElement>): AvatarState => {\n const { dir } = useFluent();\n const { shape: contextShape, size: contextSize } = useAvatarContext();\n const {\n name,\n size = contextSize ?? (32 as const),\n shape = contextShape ?? 'circular',\n active = 'unset',\n activeAppearance = 'ring',\n idForColor,\n } = props;\n let { color = 'neutral' } = props;\n\n // Resolve 'colorful' to a specific color name\n if (color === 'colorful') {\n color = avatarColors[getHashCode(idForColor ?? name ?? '') % avatarColors.length];\n }\n\n const baseId = useId('avatar-');\n\n const root: AvatarState['root'] = 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 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 if (image) {\n image.onError = mergeCallbacks(image.onError, () => setImageHidden(true));\n image.onLoad = mergeCallbacks(image.onLoad, () => setImageHidden(undefined));\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 id: baseId + '__initials',\n },\n });\n\n // Don't render the initials slot if it's empty\n if (!initials?.children) {\n initials = undefined;\n }\n\n // Render the icon slot *only if* there aren't any initials or image to display\n let icon: AvatarState['icon'] = undefined;\n if (!initials && (!image || imageHidden)) {\n icon = resolveShorthand(props.icon, {\n required: true,\n defaultProps: {\n children: <PersonRegular />,\n 'aria-hidden': true,\n },\n });\n }\n\n const badge: AvatarState['badge'] = resolveShorthand(props.badge, {\n defaultProps: {\n size: getBadgeSize(size),\n id: baseId + '__badge',\n },\n });\n\n let activeAriaLabelElement: AvatarState['activeAriaLabelElement'];\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 // Add the active state to the aria label\n if (active === 'active' || active === 'inactive') {\n const activeText = DEFAULT_STRINGS[active];\n if (root['aria-labelledby']) {\n // If using aria-labelledby, render a hidden span and append it to the labelledby\n const activeId = baseId + '__active';\n root['aria-labelledby'] += ' ' + activeId;\n activeAriaLabelElement = (\n <span hidden id={activeId}>\n {activeText}\n </span>\n );\n } else if (root['aria-label']) {\n // Otherwise, just append it to the aria-label\n root['aria-label'] += ' ' + activeText;\n }\n }\n }\n\n return {\n size,\n shape,\n active,\n activeAppearance,\n activeAriaLabelElement,\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 'dark-red',\n 'cranberry',\n 'red',\n 'pumpkin',\n 'peach',\n 'marigold',\n 'gold',\n 'brass',\n 'brown',\n 'forest',\n 'seafoam',\n 'dark-green',\n 'light-teal',\n 'teal',\n 'steel',\n 'blue',\n 'royal-blue',\n 'cornflower',\n 'navy',\n 'lavender',\n 'purple',\n 'grape',\n 'lilac',\n 'pink',\n 'magenta',\n 'plum',\n 'beige',\n 'mink',\n 'platinum',\n 'anchor',\n];\n\nconst getHashCode = (str: string): number => {\n let hashCode = 0;\n for (let len: number = str.length - 1; len >= 0; len--) {\n const ch = str.charCodeAt(len);\n const shift = len % 8;\n hashCode ^= (ch << shift) + (ch >> (8 - shift)); // eslint-disable-line no-bitwise\n }\n\n return hashCode;\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,qBAAqB,EAAEC,cAAc,EAAEC,gBAAgB,EAAEC,KAAK,QAAQ;AAC/E,SAASC,WAAW,QAAQ;AAE5B,SAASC,aAAa,QAAQ;AAC9B,SAASC,aAAa,QAAQ;AAC9B,SAASC,kBAAA,IAAsBC,SAAS,QAAQ;AAChD,SAASC,gBAAgB,QAAQ;AAEjC,OAAO,MAAMC,eAAA,GAAkB;EAC7BC,MAAA,EAAQ;EACRC,QAAA,EAAU;AACZ;AAEA,OAAO,MAAMC,kBAAA,GAAqBA,CAACC,KAAA,EAAoBC,GAAA,KAA6C;EAClG,MAAM;IAAEC;EAAG,CAAE,GAAGR,SAAA;EAChB,MAAM;IAAES,KAAA,EAAOC,YAAA;IAAcC,IAAA,EAAMC;EAAW,CAAE,GAAGX,gBAAA;EACnD,MAAM;IACJY,IAAA;IACAF,IAAA,GAAOC,WAAA,aAAAA,WAAA,cAAAA,WAAA,GAAgB,EAAY;IACnCH,KAAA,GAAQC,YAAA,aAAAA,YAAA,cAAAA,YAAA,GAAgB,UAAU;IAClCP,MAAA,GAAS;IACTW,gBAAA,GAAmB;IACnBC;EAAU,CACX,GAAGT,KAAA;EACJ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EAAA,GAAKH,GAAA,CAAII,UAAU,CAACF,GAAA;IAC1B,MAAMG,KAAA,GAAQH,GAAA,GAAM;IACpBD,QAAA,IAAY,CAACE,EAAA,IAAME,KAAI,KAAMF,EAAA,IAAO,IAAIE,KAAK,GAAI;EACnD;;EAEA,OAAOJ,QAAA;AACT"}
|
|
1
|
+
{"version":3,"sources":["useAvatar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, mergeCallbacks, 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_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useAvatarContext } from '../../contexts/AvatarContext';\n\nexport const DEFAULT_STRINGS = {\n active: 'active',\n inactive: 'inactive',\n};\n\nexport const useAvatar_unstable = (props: AvatarProps, ref: React.Ref<HTMLElement>): AvatarState => {\n const { dir } = useFluent();\n const { shape: contextShape, size: contextSize } = useAvatarContext();\n const {\n name,\n size = contextSize ?? (32 as const),\n shape = contextShape ?? 'circular',\n active = 'unset',\n activeAppearance = 'ring',\n idForColor,\n } = props;\n let { color = 'neutral' } = props;\n\n // Resolve 'colorful' to a specific color name\n if (color === 'colorful') {\n color = avatarColors[getHashCode(idForColor ?? name ?? '') % avatarColors.length];\n }\n\n const baseId = useId('avatar-');\n\n const root: AvatarState['root'] = 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 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 if (image) {\n image.onError = mergeCallbacks(image.onError, () => setImageHidden(true));\n image.onLoad = mergeCallbacks(image.onLoad, () => setImageHidden(undefined));\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 id: baseId + '__initials',\n },\n });\n\n // Don't render the initials slot if it's empty\n if (!initials?.children) {\n initials = undefined;\n }\n\n // Render the icon slot *only if* there aren't any initials or image to display\n let icon: AvatarState['icon'] = undefined;\n if (!initials && (!image || imageHidden)) {\n icon = resolveShorthand(props.icon, {\n required: true,\n defaultProps: {\n children: <PersonRegular />,\n 'aria-hidden': true,\n },\n });\n }\n\n const badge: AvatarState['badge'] = resolveShorthand(props.badge, {\n defaultProps: {\n size: getBadgeSize(size),\n id: baseId + '__badge',\n },\n });\n\n let activeAriaLabelElement: AvatarState['activeAriaLabelElement'];\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 // Add the active state to the aria label\n if (active === 'active' || active === 'inactive') {\n const activeText = DEFAULT_STRINGS[active];\n if (root['aria-labelledby']) {\n // If using aria-labelledby, render a hidden span and append it to the labelledby\n const activeId = baseId + '__active';\n root['aria-labelledby'] += ' ' + activeId;\n activeAriaLabelElement = (\n <span hidden id={activeId}>\n {activeText}\n </span>\n );\n } else if (root['aria-label']) {\n // Otherwise, just append it to the aria-label\n root['aria-label'] += ' ' + activeText;\n }\n }\n }\n\n return {\n size,\n shape,\n active,\n activeAppearance,\n activeAriaLabelElement,\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 'dark-red',\n 'cranberry',\n 'red',\n 'pumpkin',\n 'peach',\n 'marigold',\n 'gold',\n 'brass',\n 'brown',\n 'forest',\n 'seafoam',\n 'dark-green',\n 'light-teal',\n 'teal',\n 'steel',\n 'blue',\n 'royal-blue',\n 'cornflower',\n 'navy',\n 'lavender',\n 'purple',\n 'grape',\n 'lilac',\n 'pink',\n 'magenta',\n 'plum',\n 'beige',\n 'mink',\n 'platinum',\n 'anchor',\n];\n\nconst getHashCode = (str: string): number => {\n let hashCode = 0;\n for (let len: number = str.length - 1; len >= 0; len--) {\n const ch = str.charCodeAt(len);\n const shift = len % 8;\n hashCode ^= (ch << shift) + (ch >> (8 - shift)); // eslint-disable-line no-bitwise\n }\n\n return hashCode;\n};\n"],"names":["React","getNativeElementProps","mergeCallbacks","resolveShorthand","useId","getInitials","PersonRegular","PresenceBadge","useFluent_unstable","useFluent","useAvatarContext","DEFAULT_STRINGS","active","inactive","useAvatar_unstable","props","ref","dir","shape","contextShape","size","contextSize","name","activeAppearance","idForColor","color","avatarColors","getHashCode","length","baseId","root","role","id","imageHidden","setImageHidden","useState","undefined","image","defaultProps","alt","hidden","onError","onLoad","initials","required","children","firstInitialOnly","icon","badge","getBadgeSize","activeAriaLabelElement","activeText","activeId","span","components","str","hashCode","len","ch","charCodeAt","shift"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,EAAEC,cAAc,EAAEC,gBAAgB,EAAEC,KAAK,QAAQ,4BAA4B;AAC3G,SAASC,WAAW,QAAQ,o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KH,IAAII,UAAU,CAACF;QAC1B,MAAMG,QAAQH,MAAM;QACpBD,YAAY,AAACE,CAAAA,MAAME,KAAI,IAAMF,CAAAA,MAAO,IAAIE,KAAK,GAAI,iCAAiC;IACpF;IAEA,OAAOJ;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["tokens","__resetStyles","__styles","mergeClasses","shorthands","avatarClassNames","root","image","initials","icon","badge","vars","badgeRadius","badgeGap","badgeAlign","ringWidth","useRootClassName","useImageClassName","useIconInitialsClassName","badgeMask","margin","centerOffset","innerRadius","outerRadius","useStyles","textCaption2Strong","Be2twd7","textCaption1Strong","textSubtitle2","textSubtitle1","textTitle3","squareSmall","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","squareMedium","squareLarge","squareXLarge","activeOrInactive","Bz10aip","Bmy1vo4","B3o57yi","Bkqvd7p","Hwfdqs","ring","Ftih45","ringBadgeCutout","f4a502","ringThick","of393c","ringThicker","ringThickest","shadow","Bsft5z2","shadow4","Be6vj1x","shadow8","shadow16","shadow28","inactive","abs64n","Bucmhp4","b2tv09","Bfgortx","Bnvr3x9","b6ubon","Bqinb2h","qhf8xq","B5kzvoi","j35jbq","badgeCutout","btxmck","Dnlfbu","tiny","Bdjeniz","niu6jh","small","medium","large","icon12","icon16","icon20","icon24","icon28","icon32","icon48","d","m","useSizeStyles","a9b677","Bqenvij","useColorStyles","neutral","sj55zd","De3pzq","brand","cranberry","red","pumpkin","peach","marigold","gold","brass","brown","forest","seafoam","teal","steel","blue","cornflower","navy","lavender","purple","grape","lilac","pink","magenta","plum","beige","mink","platinum","anchor","useRingColorStyles","Bic5iru","useAvatarStyles_unstable","state","size","shape","active","activeAppearance","color","rootClassName","imageClassName","iconInitialsClassName","styles","sizeStyles","colorStyles","ringColorStyles","rootClasses","push","className","iconSizeClass"],"sources":["../../../src/components/Avatar/useAvatarStyles.styles.ts"],"sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeResetStyles, makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { AvatarSlots, AvatarState } from './Avatar.types';\n\nexport const avatarClassNames: SlotClassNames<AvatarSlots> = {\n root: 'fui-Avatar',\n image: 'fui-Avatar__image',\n initials: 'fui-Avatar__initials',\n icon: 'fui-Avatar__icon',\n badge: 'fui-Avatar__badge',\n};\n\n// CSS variables used internally in Avatar's styles\nconst vars = {\n badgeRadius: '--fui-Avatar-badgeRadius',\n badgeGap: '--fui-Avatar-badgeGap',\n badgeAlign: '--fui-Avatar-badgeAlign',\n ringWidth: '--fui-Avatar-ringWidth',\n};\n\nconst useRootClassName = makeResetStyles({\n display: 'inline-block',\n flexShrink: 0,\n position: 'relative',\n verticalAlign: 'middle',\n borderRadius: tokens.borderRadiusCircular,\n fontFamily: tokens.fontFamilyBase,\n fontWeight: tokens.fontWeightSemibold,\n fontSize: tokens.fontSizeBase300,\n width: '32px',\n height: '32px',\n\n // ::before is the ring, and ::after is the shadow.\n // These are not displayed by default; the ring and shadow clases set content: \"\" to display them when appropriate.\n '::before,::after': {\n position: 'absolute',\n top: 0,\n left: 0,\n bottom: 0,\n right: 0,\n zIndex: -1,\n margin: `calc(-2 * var(${vars.ringWidth}, 0px))`,\n borderRadius: 'inherit',\n transitionProperty: 'margin, opacity',\n transitionTimingFunction: `${tokens.curveEasyEaseMax}, ${tokens.curveLinear}`,\n transitionDuration: `${tokens.durationUltraSlow}, ${tokens.durationSlower}`,\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n },\n },\n '::before': {\n borderStyle: 'solid',\n borderWidth: `var(${vars.ringWidth})`,\n },\n});\n\nconst useImageClassName = makeResetStyles({\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n\n borderRadius: 'inherit',\n objectFit: 'cover',\n verticalAlign: 'top',\n});\n\nconst useIconInitialsClassName = makeResetStyles({\n position: 'absolute',\n boxSizing: 'border-box',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n lineHeight: '1',\n border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`,\n\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n verticalAlign: 'center',\n textAlign: 'center',\n userSelect: 'none',\n borderRadius: 'inherit',\n});\n\n/**\n * Helper to create a maskImage that punches out a circle larger than the badge by `badgeGap`.\n * This creates a transparent gap between the badge and Avatar.\n *\n * Used by the icon, initials, and image slots, as well as the ring ::before pseudo-element.\n */\nconst badgeMask = (margin?: string) => {\n // Center the cutout at the badge's radius away from the edge.\n // The ring (::before) also has a 2 * ringWidth margin that also needs to be offset.\n const centerOffset = margin ? `calc(var(${vars.badgeRadius}) + ${margin})` : `var(${vars.badgeRadius})`;\n // radial-gradient does not have anti-aliasing, so the transparent and opaque gradient stops are offset by +/- 0.25px\n // to \"fade\" from transparent to opaque over a half-pixel and ease the transition.\n const innerRadius = `calc(var(${vars.badgeRadius}) + var(${vars.badgeGap}) - 0.25px)`;\n const outerRadius = `calc(var(${vars.badgeRadius}) + var(${vars.badgeGap}) + 0.25px)`;\n\n return (\n `radial-gradient(circle at bottom ${centerOffset} var(${vars.badgeAlign}) ${centerOffset}, ` +\n `transparent ${innerRadius}, white ${outerRadius})`\n );\n};\n\nconst useStyles = makeStyles({\n textCaption2Strong: { fontSize: tokens.fontSizeBase100 },\n textCaption1Strong: { fontSize: tokens.fontSizeBase200 },\n textSubtitle2: { fontSize: tokens.fontSizeBase400 },\n textSubtitle1: { fontSize: tokens.fontSizeBase500 },\n textTitle3: { fontSize: tokens.fontSizeBase600 },\n\n squareSmall: {\n ...shorthands.borderRadius(tokens.borderRadiusSmall),\n },\n squareMedium: {\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n },\n squareLarge: {\n ...shorthands.borderRadius(tokens.borderRadiusLarge),\n },\n squareXLarge: {\n ...shorthands.borderRadius(tokens.borderRadiusXLarge),\n },\n\n activeOrInactive: {\n transform: 'perspective(1px)', // Work-around for text pixel snapping at the end of the animation\n transitionProperty: 'transform, opacity',\n transitionDuration: `${tokens.durationUltraSlow}, ${tokens.durationFaster}`,\n transitionTimingFunction: `${tokens.curveEasyEaseMax}, ${tokens.curveLinear}`,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n },\n },\n\n ring: {\n // Show the ::before pseudo-element, which is the ring\n '::before': { content: '\"\"' },\n },\n ringBadgeCutout: {\n '::before': { maskImage: badgeMask(/*margin =*/ `2 * var(${vars.ringWidth})`) },\n },\n ringThick: {\n [vars.ringWidth]: tokens.strokeWidthThick,\n },\n ringThicker: {\n [vars.ringWidth]: tokens.strokeWidthThicker,\n },\n ringThickest: {\n [vars.ringWidth]: tokens.strokeWidthThickest,\n },\n\n shadow: {\n // Show the ::after pseudo-element, which is the shadow\n '::after': { content: '\"\"' },\n },\n shadow4: {\n '::after': { boxShadow: tokens.shadow4 },\n },\n shadow8: {\n '::after': { boxShadow: tokens.shadow8 },\n },\n shadow16: {\n '::after': { boxShadow: tokens.shadow16 },\n },\n shadow28: {\n '::after': { boxShadow: tokens.shadow28 },\n },\n\n inactive: {\n opacity: '0.8',\n transform: 'scale(0.875)',\n transitionTimingFunction: `${tokens.curveDecelerateMin}, ${tokens.curveLinear}`,\n\n '::before,::after': {\n ...shorthands.margin(0),\n opacity: 0,\n transitionTimingFunction: `${tokens.curveDecelerateMin}, ${tokens.curveLinear}`,\n },\n },\n\n // Applied to the badge slot\n badge: {\n position: 'absolute',\n bottom: 0,\n right: 0,\n },\n\n // Applied to the image, initials, or icon slot when there is a badge\n badgeCutout: {\n maskImage: badgeMask(),\n },\n\n // Applied to the root when there is a badge\n badgeAlign: {\n // Griffel won't auto-flip the \"right\" alignment to \"left\" in RTL if it is inline in the maskImage,\n // so split it out into a css variable that will auto-flip.\n [vars.badgeAlign]: 'right',\n },\n\n // Badge size: applied to root when there is a badge\n tiny: {\n [vars.badgeRadius]: '3px',\n [vars.badgeGap]: tokens.strokeWidthThin,\n },\n 'extra-small': {\n [vars.badgeRadius]: '5px',\n [vars.badgeGap]: tokens.strokeWidthThin,\n },\n small: {\n [vars.badgeRadius]: '6px',\n [vars.badgeGap]: tokens.strokeWidthThin,\n },\n medium: {\n [vars.badgeRadius]: '8px',\n [vars.badgeGap]: tokens.strokeWidthThin,\n },\n large: {\n [vars.badgeRadius]: '10px',\n [vars.badgeGap]: tokens.strokeWidthThick,\n },\n 'extra-large': {\n [vars.badgeRadius]: '14px',\n [vars.badgeGap]: tokens.strokeWidthThick,\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});\n\nexport const useSizeStyles = makeStyles({\n 16: { width: '16px', height: '16px' },\n 20: { width: '20px', height: '20px' },\n 24: { width: '24px', height: '24px' },\n 28: { width: '28px', height: '28px' },\n 32: { width: '32px', height: '32px' },\n 36: { width: '36px', height: '36px' },\n 40: { width: '40px', height: '40px' },\n 48: { width: '48px', height: '48px' },\n 56: { width: '56px', height: '56px' },\n 64: { width: '64px', height: '64px' },\n 72: { width: '72px', height: '72px' },\n 96: { width: '96px', height: '96px' },\n 120: { width: '120px', height: '120px' },\n 128: { width: '128px', height: '128px' },\n});\n\nconst useColorStyles = makeStyles({\n neutral: {\n color: tokens.colorNeutralForeground3,\n backgroundColor: tokens.colorNeutralBackground6,\n },\n brand: {\n color: tokens.colorNeutralForegroundStaticInverted,\n backgroundColor: tokens.colorBrandBackgroundStatic,\n },\n 'dark-red': {\n color: tokens.colorPaletteDarkRedForeground2,\n backgroundColor: tokens.colorPaletteDarkRedBackground2,\n },\n cranberry: {\n color: tokens.colorPaletteCranberryForeground2,\n backgroundColor: tokens.colorPaletteCranberryBackground2,\n },\n red: {\n color: tokens.colorPaletteRedForeground2,\n backgroundColor: tokens.colorPaletteRedBackground2,\n },\n pumpkin: {\n color: tokens.colorPalettePumpkinForeground2,\n backgroundColor: tokens.colorPalettePumpkinBackground2,\n },\n peach: {\n color: tokens.colorPalettePeachForeground2,\n backgroundColor: tokens.colorPalettePeachBackground2,\n },\n marigold: {\n color: tokens.colorPaletteMarigoldForeground2,\n backgroundColor: tokens.colorPaletteMarigoldBackground2,\n },\n gold: {\n color: tokens.colorPaletteGoldForeground2,\n backgroundColor: tokens.colorPaletteGoldBackground2,\n },\n brass: {\n color: tokens.colorPaletteBrassForeground2,\n backgroundColor: tokens.colorPaletteBrassBackground2,\n },\n brown: {\n color: tokens.colorPaletteBrownForeground2,\n backgroundColor: tokens.colorPaletteBrownBackground2,\n },\n forest: {\n color: tokens.colorPaletteForestForeground2,\n backgroundColor: tokens.colorPaletteForestBackground2,\n },\n seafoam: {\n color: tokens.colorPaletteSeafoamForeground2,\n backgroundColor: tokens.colorPaletteSeafoamBackground2,\n },\n 'dark-green': {\n color: tokens.colorPaletteDarkGreenForeground2,\n backgroundColor: tokens.colorPaletteDarkGreenBackground2,\n },\n 'light-teal': {\n color: tokens.colorPaletteLightTealForeground2,\n backgroundColor: tokens.colorPaletteLightTealBackground2,\n },\n teal: {\n color: tokens.colorPaletteTealForeground2,\n backgroundColor: tokens.colorPaletteTealBackground2,\n },\n steel: {\n color: tokens.colorPaletteSteelForeground2,\n backgroundColor: tokens.colorPaletteSteelBackground2,\n },\n blue: {\n color: tokens.colorPaletteBlueForeground2,\n backgroundColor: tokens.colorPaletteBlueBackground2,\n },\n 'royal-blue': {\n color: tokens.colorPaletteRoyalBlueForeground2,\n backgroundColor: tokens.colorPaletteRoyalBlueBackground2,\n },\n cornflower: {\n color: tokens.colorPaletteCornflowerForeground2,\n backgroundColor: tokens.colorPaletteCornflowerBackground2,\n },\n navy: {\n color: tokens.colorPaletteNavyForeground2,\n backgroundColor: tokens.colorPaletteNavyBackground2,\n },\n lavender: {\n color: tokens.colorPaletteLavenderForeground2,\n backgroundColor: tokens.colorPaletteLavenderBackground2,\n },\n purple: {\n color: tokens.colorPalettePurpleForeground2,\n backgroundColor: tokens.colorPalettePurpleBackground2,\n },\n grape: {\n color: tokens.colorPaletteGrapeForeground2,\n backgroundColor: tokens.colorPaletteGrapeBackground2,\n },\n lilac: {\n color: tokens.colorPaletteLilacForeground2,\n backgroundColor: tokens.colorPaletteLilacBackground2,\n },\n pink: {\n color: tokens.colorPalettePinkForeground2,\n backgroundColor: tokens.colorPalettePinkBackground2,\n },\n magenta: {\n color: tokens.colorPaletteMagentaForeground2,\n backgroundColor: tokens.colorPaletteMagentaBackground2,\n },\n plum: {\n color: tokens.colorPalettePlumForeground2,\n backgroundColor: tokens.colorPalettePlumBackground2,\n },\n beige: {\n color: tokens.colorPaletteBeigeForeground2,\n backgroundColor: tokens.colorPaletteBeigeBackground2,\n },\n mink: {\n color: tokens.colorPaletteMinkForeground2,\n backgroundColor: tokens.colorPaletteMinkBackground2,\n },\n platinum: {\n color: tokens.colorPalettePlatinumForeground2,\n backgroundColor: tokens.colorPalettePlatinumBackground2,\n },\n anchor: {\n color: tokens.colorPaletteAnchorForeground2,\n backgroundColor: tokens.colorPaletteAnchorBackground2,\n },\n});\n\nconst useRingColorStyles = makeStyles({\n neutral: {\n '::before': { color: tokens.colorBrandStroke1 },\n },\n brand: {\n '::before': { color: tokens.colorBrandStroke1 },\n },\n 'dark-red': {\n '::before': { color: tokens.colorPaletteDarkRedBorderActive },\n },\n cranberry: {\n '::before': { color: tokens.colorPaletteCranberryBorderActive },\n },\n red: {\n '::before': { color: tokens.colorPaletteRedBorderActive },\n },\n pumpkin: {\n '::before': { color: tokens.colorPalettePumpkinBorderActive },\n },\n peach: {\n '::before': { color: tokens.colorPalettePeachBorderActive },\n },\n marigold: {\n '::before': { color: tokens.colorPaletteMarigoldBorderActive },\n },\n gold: {\n '::before': { color: tokens.colorPaletteGoldBorderActive },\n },\n brass: {\n '::before': { color: tokens.colorPaletteBrassBorderActive },\n },\n brown: {\n '::before': { color: tokens.colorPaletteBrownBorderActive },\n },\n forest: {\n '::before': { color: tokens.colorPaletteForestBorderActive },\n },\n seafoam: {\n '::before': { color: tokens.colorPaletteSeafoamBorderActive },\n },\n 'dark-green': {\n '::before': { color: tokens.colorPaletteDarkGreenBorderActive },\n },\n 'light-teal': {\n '::before': { color: tokens.colorPaletteLightTealBorderActive },\n },\n teal: {\n '::before': { color: tokens.colorPaletteTealBorderActive },\n },\n steel: {\n '::before': { color: tokens.colorPaletteSteelBorderActive },\n },\n blue: {\n '::before': { color: tokens.colorPaletteBlueBorderActive },\n },\n 'royal-blue': {\n '::before': { color: tokens.colorPaletteRoyalBlueBorderActive },\n },\n cornflower: {\n '::before': { color: tokens.colorPaletteCornflowerBorderActive },\n },\n navy: {\n '::before': { color: tokens.colorPaletteNavyBorderActive },\n },\n lavender: {\n '::before': { color: tokens.colorPaletteLavenderBorderActive },\n },\n purple: {\n '::before': { color: tokens.colorPalettePurpleBorderActive },\n },\n grape: {\n '::before': { color: tokens.colorPaletteGrapeBorderActive },\n },\n lilac: {\n '::before': { color: tokens.colorPaletteLilacBorderActive },\n },\n pink: {\n '::before': { color: tokens.colorPalettePinkBorderActive },\n },\n magenta: {\n '::before': { color: tokens.colorPaletteMagentaBorderActive },\n },\n plum: {\n '::before': { color: tokens.colorPalettePlumBorderActive },\n },\n beige: {\n '::before': { color: tokens.colorPaletteBeigeBorderActive },\n },\n mink: {\n '::before': { color: tokens.colorPaletteMinkBorderActive },\n },\n platinum: {\n '::before': { color: tokens.colorPalettePlatinumBorderActive },\n },\n anchor: {\n '::before': { color: tokens.colorPaletteAnchorBorderActive },\n },\n});\n\nexport const useAvatarStyles_unstable = (state: AvatarState): AvatarState => {\n const { size, shape, active, activeAppearance, color } = state;\n\n const rootClassName = useRootClassName();\n const imageClassName = useImageClassName();\n const iconInitialsClassName = useIconInitialsClassName();\n const styles = useStyles();\n const sizeStyles = useSizeStyles();\n const colorStyles = useColorStyles();\n const ringColorStyles = useRingColorStyles();\n\n const rootClasses = [rootClassName, size !== 32 && sizeStyles[size]];\n\n if (state.badge) {\n rootClasses.push(styles.badgeAlign, styles[state.badge.size || 'medium']);\n }\n\n if (size <= 24) {\n rootClasses.push(styles.textCaption2Strong);\n } else if (size <= 28) {\n rootClasses.push(styles.textCaption1Strong);\n } else if (size <= 40) {\n // Default text size included in useRootClassName\n } else if (size <= 56) {\n rootClasses.push(styles.textSubtitle2);\n } else if (size <= 96) {\n rootClasses.push(styles.textSubtitle1);\n } else {\n rootClasses.push(styles.textTitle3);\n }\n\n if (shape === 'square') {\n if (size <= 24) {\n rootClasses.push(styles.squareSmall);\n } else if (size <= 48) {\n rootClasses.push(styles.squareMedium);\n } else if (size <= 72) {\n rootClasses.push(styles.squareLarge);\n } else {\n rootClasses.push(styles.squareXLarge);\n }\n }\n\n if (active === 'active' || active === 'inactive') {\n rootClasses.push(styles.activeOrInactive);\n\n if (activeAppearance === 'ring' || activeAppearance === 'ring-shadow') {\n rootClasses.push(styles.ring, ringColorStyles[color]);\n if (state.badge) {\n rootClasses.push(styles.ringBadgeCutout);\n }\n\n if (size <= 48) {\n rootClasses.push(styles.ringThick);\n } else if (size <= 64) {\n rootClasses.push(styles.ringThicker);\n } else {\n rootClasses.push(styles.ringThickest);\n }\n }\n\n if (activeAppearance === 'shadow' || activeAppearance === 'ring-shadow') {\n rootClasses.push(styles.shadow);\n if (size <= 28) {\n rootClasses.push(styles.shadow4);\n } else if (size <= 48) {\n rootClasses.push(styles.shadow8);\n } else if (size <= 64) {\n rootClasses.push(styles.shadow16);\n } else {\n rootClasses.push(styles.shadow28);\n }\n }\n\n // Note: The inactive style overrides some of the activeAppearance styles and must be applied after them\n if (active === 'inactive') {\n rootClasses.push(styles.inactive);\n }\n }\n\n state.root.className = mergeClasses(avatarClassNames.root, ...rootClasses, state.root.className);\n\n if (state.badge) {\n state.badge.className = mergeClasses(avatarClassNames.badge, styles.badge, state.badge.className);\n }\n\n if (state.image) {\n state.image.className = mergeClasses(\n avatarClassNames.image,\n imageClassName,\n colorStyles[color],\n state.badge && styles.badgeCutout,\n state.image.className,\n );\n }\n\n if (state.initials) {\n state.initials.className = mergeClasses(\n avatarClassNames.initials,\n iconInitialsClassName,\n colorStyles[color],\n state.badge && styles.badgeCutout,\n state.initials.className,\n );\n }\n\n if (state.icon) {\n let iconSizeClass;\n if (size <= 16) {\n iconSizeClass = styles.icon12;\n } else if (size <= 24) {\n iconSizeClass = styles.icon16;\n } else if (size <= 40) {\n iconSizeClass = styles.icon20;\n } else if (size <= 48) {\n iconSizeClass = styles.icon24;\n } else if (size <= 56) {\n iconSizeClass = styles.icon28;\n } else if (size <= 72) {\n iconSizeClass = styles.icon32;\n } else {\n iconSizeClass = styles.icon48;\n }\n\n state.icon.className = mergeClasses(\n avatarClassNames.icon,\n iconInitialsClassName,\n iconSizeClass,\n colorStyles[color],\n state.badge && styles.badgeCutout,\n state.icon.className,\n );\n }\n\n return state;\n};\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ;AAEvB,SAAAC,aAAA,EAAAC,QAAA,EAAsCC,YAAY,EAAEC,UAAU,QAAQ;AAGtE,OAAO,MAAMC,gBAAA,GAAgD;EAC3DC,IAAA,EAAM;EACNC,KAAA,EAAO;EACPC,QAAA,EAAU;EACVC,IAAA,EAAM;EACNC,KAAA,EAAO;AACT;AAEA;AACA,MAAMC,IAAA,GAAO;EACXC,WAAA,EAAa;EACbC,QAAA,EAAU;EACVC,UAAA,EAAY;EACZC,SAAA,EAAW;AACb;AAEA,MAAMC,gBAAA,gBAAmBf,aAAA,4qDAkCzB;AAEA,MAAMgB,iBAAA,gBAAoBhB,aAAA,uRAU1B;AAEA,MAAMiB,wBAAA,gBAA2BjB,aAAA,qqCAiBjC;AAEA;;;;;;AAMA,MAAMkB,SAAA,GAAaC,MAAA,IAAoB;EACrC;EACA;EACA,MAAMC,YAAA,GAAeD,MAAA,GAAU,YAAWT,IAAA,CAAKC,WAAY,OAAMQ,MAAO,GAAE,GAAI,OAAMT,IAAA,CAAKC,WAAY,GAAE;EACvG;EACA;EACA,M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AAMtH,QAAQ,EAAE;IAClBsH,KAAA,CAAMtH,QAAQ,CAACqI,SAAS,GAAG1I,YAAA,CACzBE,gBAAA,CAAiBG,QAAQ,EACzB8H,qBAAA,EACAG,WAAW,CAACN,KAAA,CAAM,EAClBL,KAAA,CAAMpH,KAAK,IAAI6H,MAAA,CAAOhE,WAAW,EACjCuD,KAAA,CAAMtH,QAAQ,CAACqI,SAAS;EAE5B;EAEA,IAAIf,KAAA,CAAMrH,IAAI,EAAE;IACd,IAAIqI,aAAA;IACJ,IAAIf,IAAA,IAAQ,IAAI;MACde,aAAA,GAAgBP,MAAA,CAAOvD,MAAM;IAC/B,OAAO,IAAI+C,IAAA,IAAQ,IAAI;MACrBe,aAAA,GAAgBP,MAAA,CAAOtD,MAAM;IAC/B,OAAO,IAAI8C,IAAA,IAAQ,IAAI;MACrBe,aAAA,GAAgBP,MAAA,CAAOrD,MAAM;IAC/B,OAAO,IAAI6C,IAAA,IAAQ,IAAI;MACrBe,aAAA,GAAgBP,MAAA,CAAOpD,MAAM;IAC/B,OAAO,IAAI4C,IAAA,IAAQ,IAAI;MACrBe,aAAA,GAAgBP,MAAA,CAAOnD,MAAM;IAC/B,OAAO,IAAI2C,IAAA,IAAQ,IAAI;MACrBe,aAAA,GAAgBP,MAAA,CAAOlD,MAAM;IAC/B,OAAO;MACLyD,aAAA,GAAgBP,MAAA,CAAOjD,MAAM;IAC/B;IAEAwC,KAAA,CAAMrH,IAAI,CAACoI,SAAS,GAAG1I,YAAA,CACrBE,gBAAA,CAAiBI,IAAI,EACrB6H,qBAAA,EACAQ,aAAA,EACAL,WAAW,CAACN,KAAA,CAAM,EAClBL,KAAA,CAAMpH,KAAK,IAAI6H,MAAA,CAAOhE,WAAW,EACjCuD,KAAA,CAAMrH,IAAI,CAACoI,SAAS;EAExB;EAEA,OAAOf,KAAA;AACT"}
|
|
1
|
+
{"version":3,"names":["tokens","__resetStyles","__styles","mergeClasses","shorthands","avatarClassNames","root","image","initials","icon","badge","vars","badgeRadius","badgeGap","badgeAlign","ringWidth","useRootClassName","useImageClassName","useIconInitialsClassName","badgeMask","margin","centerOffset","innerRadius","outerRadius","useStyles","textCaption2Strong","Be2twd7","textCaption1Strong","textSubtitle2","textSubtitle1","textTitle3","squareSmall","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","squareMedium","squareLarge","squareXLarge","activeOrInactive","Bz10aip","Bmy1vo4","B3o57yi","Bkqvd7p","Hwfdqs","ring","Ftih45","ringBadgeCutout","f4a502","ringThick","of393c","ringThicker","ringThickest","shadow","Bsft5z2","shadow4","Be6vj1x","shadow8","shadow16","shadow28","inactive","abs64n","Bucmhp4","b2tv09","Bfgortx","Bnvr3x9","b6ubon","Bqinb2h","qhf8xq","B5kzvoi","j35jbq","badgeCutout","btxmck","Dnlfbu","tiny","Bdjeniz","niu6jh","small","medium","large","icon12","icon16","icon20","icon24","icon28","icon32","icon48","d","m","useSizeStyles","a9b677","Bqenvij","useColorStyles","neutral","sj55zd","De3pzq","brand","cranberry","red","pumpkin","peach","marigold","gold","brass","brown","forest","seafoam","teal","steel","blue","cornflower","navy","lavender","purple","grape","lilac","pink","magenta","plum","beige","mink","platinum","anchor","useRingColorStyles","Bic5iru","useAvatarStyles_unstable","state","size","shape","active","activeAppearance","color","rootClassName","imageClassName","iconInitialsClassName","styles","sizeStyles","colorStyles","ringColorStyles","rootClasses","push","className","iconSizeClass"],"sources":["useAvatarStyles.styles.js"],"sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport { makeResetStyles, makeStyles, mergeClasses, shorthands } from '@griffel/react';\nexport const avatarClassNames = {\n root: 'fui-Avatar',\n image: 'fui-Avatar__image',\n initials: 'fui-Avatar__initials',\n icon: 'fui-Avatar__icon',\n badge: 'fui-Avatar__badge'\n};\n// CSS variables used internally in Avatar's styles\nconst vars = {\n badgeRadius: '--fui-Avatar-badgeRadius',\n badgeGap: '--fui-Avatar-badgeGap',\n badgeAlign: '--fui-Avatar-badgeAlign',\n ringWidth: '--fui-Avatar-ringWidth'\n};\nconst useRootClassName = makeResetStyles({\n display: 'inline-block',\n flexShrink: 0,\n position: 'relative',\n verticalAlign: 'middle',\n borderRadius: tokens.borderRadiusCircular,\n fontFamily: tokens.fontFamilyBase,\n fontWeight: tokens.fontWeightSemibold,\n fontSize: tokens.fontSizeBase300,\n width: '32px',\n height: '32px',\n // ::before is the ring, and ::after is the shadow.\n // These are not displayed by default; the ring and shadow clases set content: \"\" to display them when appropriate.\n '::before,::after': {\n position: 'absolute',\n top: 0,\n left: 0,\n bottom: 0,\n right: 0,\n zIndex: -1,\n margin: `calc(-2 * var(${vars.ringWidth}, 0px))`,\n borderRadius: 'inherit',\n transitionProperty: 'margin, opacity',\n transitionTimingFunction: `${tokens.curveEasyEaseMax}, ${tokens.curveLinear}`,\n transitionDuration: `${tokens.durationUltraSlow}, ${tokens.durationSlower}`,\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms'\n }\n },\n '::before': {\n borderStyle: 'solid',\n borderWidth: `var(${vars.ringWidth})`\n }\n});\nconst useImageClassName = makeResetStyles({\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n borderRadius: 'inherit',\n objectFit: 'cover',\n verticalAlign: 'top'\n});\nconst useIconInitialsClassName = makeResetStyles({\n position: 'absolute',\n boxSizing: 'border-box',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n lineHeight: '1',\n border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n verticalAlign: 'center',\n textAlign: 'center',\n userSelect: 'none',\n borderRadius: 'inherit'\n});\n/**\n * Helper to create a maskImage that punches out a circle larger than the badge by `badgeGap`.\n * This creates a transparent gap between the badge and Avatar.\n *\n * Used by the icon, initials, and image slots, as well as the ring ::before pseudo-element.\n */ const badgeMask = (margin)=>{\n // Center the cutout at the badge's radius away from the edge.\n // The ring (::before) also has a 2 * ringWidth margin that also needs to be offset.\n const centerOffset = margin ? `calc(var(${vars.badgeRadius}) + ${margin})` : `var(${vars.badgeRadius})`;\n // radial-gradient does not have anti-aliasing, so the transparent and opaque gradient stops are offset by +/- 0.25px\n // to \"fade\" from transparent to opaque over a half-pixel and ease the transition.\n const innerRadius = `calc(var(${vars.badgeRadius}) + var(${vars.badgeGap}) - 0.25px)`;\n const outerRadius = `calc(var(${vars.badgeRadius}) + var(${vars.badgeGap}) + 0.25px)`;\n return `radial-gradient(circle at bottom ${centerOffset} var(${vars.badgeAlign}) ${centerOffset}, ` + `transparent ${innerRadius}, white ${outerRadius})`;\n};\nconst useStyles = makeStyles({\n textCaption2Strong: {\n fontSize: tokens.fontSizeBase100\n },\n textCaption1Strong: {\n fontSize: tokens.fontSizeBase200\n },\n textSubtitle2: {\n fontSize: tokens.fontSizeBase400\n },\n textSubtitle1: {\n fontSize: tokens.fontSizeBase500\n },\n textTitle3: {\n fontSize: tokens.fontSizeBase600\n },\n squareSmall: {\n ...shorthands.borderRadius(tokens.borderRadiusSmall)\n },\n squareMedium: {\n ...shorthands.borderRadius(tokens.borderRadiusMedium)\n },\n squareLarge: {\n ...shorthands.borderRadius(tokens.borderRadiusLarge)\n },\n squareXLarge: {\n ...shorthands.borderRadius(tokens.borderRadiusXLarge)\n },\n activeOrInactive: {\n transform: 'perspective(1px)',\n transitionProperty: 'transform, opacity',\n transitionDuration: `${tokens.durationUltraSlow}, ${tokens.durationFaster}`,\n transitionTimingFunction: `${tokens.curveEasyEaseMax}, ${tokens.curveLinear}`,\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms'\n }\n },\n ring: {\n // Show the ::before pseudo-element, which is the ring\n '::before': {\n content: '\"\"'\n }\n },\n ringBadgeCutout: {\n '::before': {\n maskImage: badgeMask(/*margin =*/ `2 * var(${vars.ringWidth})`)\n }\n },\n ringThick: {\n [vars.ringWidth]: tokens.strokeWidthThick\n },\n ringThicker: {\n [vars.ringWidth]: tokens.strokeWidthThicker\n },\n ringThickest: {\n [vars.ringWidth]: tokens.strokeWidthThickest\n },\n shadow: {\n // Show the ::after pseudo-element, which is the shadow\n '::after': {\n content: '\"\"'\n }\n },\n shadow4: {\n '::after': {\n boxShadow: tokens.shadow4\n }\n },\n shadow8: {\n '::after': {\n boxShadow: tokens.shadow8\n }\n },\n shadow16: {\n '::after': {\n boxShadow: tokens.shadow16\n }\n },\n shadow28: {\n '::after': {\n boxShadow: tokens.shadow28\n }\n },\n inactive: {\n opacity: '0.8',\n transform: 'scale(0.875)',\n transitionTimingFunction: `${tokens.curveDecelerateMin}, ${tokens.curveLinear}`,\n '::before,::after': {\n ...shorthands.margin(0),\n opacity: 0,\n transitionTimingFunction: `${tokens.curveDecelerateMin}, ${tokens.curveLinear}`\n }\n },\n // Applied to the badge slot\n badge: {\n position: 'absolute',\n bottom: 0,\n right: 0\n },\n // Applied to the image, initials, or icon slot when there is a badge\n badgeCutout: {\n maskImage: badgeMask()\n },\n // Applied to the root when there is a badge\n badgeAlign: {\n // Griffel won't auto-flip the \"right\" alignment to \"left\" in RTL if it is inline in the maskImage,\n // so split it out into a css variable that will auto-flip.\n [vars.badgeAlign]: 'right'\n },\n // Badge size: applied to root when there is a badge\n tiny: {\n [vars.badgeRadius]: '3px',\n [vars.badgeGap]: tokens.strokeWidthThin\n },\n 'extra-small': {\n [vars.badgeRadius]: '5px',\n [vars.badgeGap]: tokens.strokeWidthThin\n },\n small: {\n [vars.badgeRadius]: '6px',\n [vars.badgeGap]: tokens.strokeWidthThin\n },\n medium: {\n [vars.badgeRadius]: '8px',\n [vars.badgeGap]: tokens.strokeWidthThin\n },\n large: {\n [vars.badgeRadius]: '10px',\n [vars.badgeGap]: tokens.strokeWidthThick\n },\n 'extra-large': {\n [vars.badgeRadius]: '14px',\n [vars.badgeGap]: tokens.strokeWidthThick\n },\n icon12: {\n fontSize: '12px'\n },\n icon16: {\n fontSize: '16px'\n },\n icon20: {\n fontSize: '20px'\n },\n icon24: {\n fontSize: '24px'\n },\n icon28: {\n fontSize: '28px'\n },\n icon32: {\n fontSize: '32px'\n },\n icon48: {\n fontSize: '48px'\n }\n});\nexport const useSizeStyles = makeStyles({\n 16: {\n width: '16px',\n height: '16px'\n },\n 20: {\n width: '20px',\n height: '20px'\n },\n 24: {\n width: '24px',\n height: '24px'\n },\n 28: {\n width: '28px',\n height: '28px'\n },\n 32: {\n width: '32px',\n height: '32px'\n },\n 36: {\n width: '36px',\n height: '36px'\n },\n 40: {\n width: '40px',\n height: '40px'\n },\n 48: {\n width: '48px',\n height: '48px'\n },\n 56: {\n width: '56px',\n height: '56px'\n },\n 64: {\n width: '64px',\n height: '64px'\n },\n 72: {\n width: '72px',\n height: '72px'\n },\n 96: {\n width: '96px',\n height: '96px'\n },\n 120: {\n width: '120px',\n height: '120px'\n },\n 128: {\n width: '128px',\n height: '128px'\n }\n});\nconst useColorStyles = makeStyles({\n neutral: {\n color: tokens.colorNeutralForeground3,\n backgroundColor: tokens.colorNeutralBackground6\n },\n brand: {\n color: tokens.colorNeutralForegroundStaticInverted,\n backgroundColor: tokens.colorBrandBackgroundStatic\n },\n 'dark-red': {\n color: tokens.colorPaletteDarkRedForeground2,\n backgroundColor: tokens.colorPaletteDarkRedBackground2\n },\n cranberry: {\n color: tokens.colorPaletteCranberryForeground2,\n backgroundColor: tokens.colorPaletteCranberryBackground2\n },\n red: {\n color: tokens.colorPaletteRedForeground2,\n backgroundColor: tokens.colorPaletteRedBackground2\n },\n pumpkin: {\n color: tokens.colorPalettePumpkinForeground2,\n backgroundColor: tokens.colorPalettePumpkinBackground2\n },\n peach: {\n color: tokens.colorPalettePeachForeground2,\n backgroundColor: tokens.colorPalettePeachBackground2\n },\n marigold: {\n color: tokens.colorPaletteMarigoldForeground2,\n backgroundColor: tokens.colorPaletteMarigoldBackground2\n },\n gold: {\n color: tokens.colorPaletteGoldForeground2,\n backgroundColor: tokens.colorPaletteGoldBackground2\n },\n brass: {\n color: tokens.colorPaletteBrassForeground2,\n backgroundColor: tokens.colorPaletteBrassBackground2\n },\n brown: {\n color: tokens.colorPaletteBrownForeground2,\n backgroundColor: tokens.colorPaletteBrownBackground2\n },\n forest: {\n color: tokens.colorPaletteForestForeground2,\n backgroundColor: tokens.colorPaletteForestBackground2\n },\n seafoam: {\n color: tokens.colorPaletteSeafoamForeground2,\n backgroundColor: tokens.colorPaletteSeafoamBackground2\n },\n 'dark-green': {\n color: tokens.colorPaletteDarkGreenForeground2,\n backgroundColor: tokens.colorPaletteDarkGreenBackground2\n },\n 'light-teal': {\n color: tokens.colorPaletteLightTealForeground2,\n backgroundColor: tokens.colorPaletteLightTealBackground2\n },\n teal: {\n color: tokens.colorPaletteTealForeground2,\n backgroundColor: tokens.colorPaletteTealBackground2\n },\n steel: {\n color: tokens.colorPaletteSteelForeground2,\n backgroundColor: tokens.colorPaletteSteelBackground2\n },\n blue: {\n color: tokens.colorPaletteBlueForeground2,\n backgroundColor: tokens.colorPaletteBlueBackground2\n },\n 'royal-blue': {\n color: tokens.colorPaletteRoyalBlueForeground2,\n backgroundColor: tokens.colorPaletteRoyalBlueBackground2\n },\n cornflower: {\n color: tokens.colorPaletteCornflowerForeground2,\n backgroundColor: tokens.colorPaletteCornflowerBackground2\n },\n navy: {\n color: tokens.colorPaletteNavyForeground2,\n backgroundColor: tokens.colorPaletteNavyBackground2\n },\n lavender: {\n color: tokens.colorPaletteLavenderForeground2,\n backgroundColor: tokens.colorPaletteLavenderBackground2\n },\n purple: {\n color: tokens.colorPalettePurpleForeground2,\n backgroundColor: tokens.colorPalettePurpleBackground2\n },\n grape: {\n color: tokens.colorPaletteGrapeForeground2,\n backgroundColor: tokens.colorPaletteGrapeBackground2\n },\n lilac: {\n color: tokens.colorPaletteLilacForeground2,\n backgroundColor: tokens.colorPaletteLilacBackground2\n },\n pink: {\n color: tokens.colorPalettePinkForeground2,\n backgroundColor: tokens.colorPalettePinkBackground2\n },\n magenta: {\n color: tokens.colorPaletteMagentaForeground2,\n backgroundColor: tokens.colorPaletteMagentaBackground2\n },\n plum: {\n color: tokens.colorPalettePlumForeground2,\n backgroundColor: tokens.colorPalettePlumBackground2\n },\n beige: {\n color: tokens.colorPaletteBeigeForeground2,\n backgroundColor: tokens.colorPaletteBeigeBackground2\n },\n mink: {\n color: tokens.colorPaletteMinkForeground2,\n backgroundColor: tokens.colorPaletteMinkBackground2\n },\n platinum: {\n color: tokens.colorPalettePlatinumForeground2,\n backgroundColor: tokens.colorPalettePlatinumBackground2\n },\n anchor: {\n color: tokens.colorPaletteAnchorForeground2,\n backgroundColor: tokens.colorPaletteAnchorBackground2\n }\n});\nconst useRingColorStyles = makeStyles({\n neutral: {\n '::before': {\n color: tokens.colorBrandStroke1\n }\n },\n brand: {\n '::before': {\n color: tokens.colorBrandStroke1\n }\n },\n 'dark-red': {\n '::before': {\n color: tokens.colorPaletteDarkRedBorderActive\n }\n },\n cranberry: {\n '::before': {\n color: tokens.colorPaletteCranberryBorderActive\n }\n },\n red: {\n '::before': {\n color: tokens.colorPaletteRedBorderActive\n }\n },\n pumpkin: {\n '::before': {\n color: tokens.colorPalettePumpkinBorderActive\n }\n },\n peach: {\n '::before': {\n color: tokens.colorPalettePeachBorderActive\n }\n },\n marigold: {\n '::before': {\n color: tokens.colorPaletteMarigoldBorderActive\n }\n },\n gold: {\n '::before': {\n color: tokens.colorPaletteGoldBorderActive\n }\n },\n brass: {\n '::before': {\n color: tokens.colorPaletteBrassBorderActive\n }\n },\n brown: {\n '::before': {\n color: tokens.colorPaletteBrownBorderActive\n }\n },\n forest: {\n '::before': {\n color: tokens.colorPaletteForestBorderActive\n }\n },\n seafoam: {\n '::before': {\n color: tokens.colorPaletteSeafoamBorderActive\n }\n },\n 'dark-green': {\n '::before': {\n color: tokens.colorPaletteDarkGreenBorderActive\n }\n },\n 'light-teal': {\n '::before': {\n color: tokens.colorPaletteLightTealBorderActive\n }\n },\n teal: {\n '::before': {\n color: tokens.colorPaletteTealBorderActive\n }\n },\n steel: {\n '::before': {\n color: tokens.colorPaletteSteelBorderActive\n }\n },\n blue: {\n '::before': {\n color: tokens.colorPaletteBlueBorderActive\n }\n },\n 'royal-blue': {\n '::before': {\n color: tokens.colorPaletteRoyalBlueBorderActive\n }\n },\n cornflower: {\n '::before': {\n color: tokens.colorPaletteCornflowerBorderActive\n }\n },\n navy: {\n '::before': {\n color: tokens.colorPaletteNavyBorderActive\n }\n },\n lavender: {\n '::before': {\n color: tokens.colorPaletteLavenderBorderActive\n }\n },\n purple: {\n '::before': {\n color: tokens.colorPalettePurpleBorderActive\n }\n },\n grape: {\n '::before': {\n color: tokens.colorPaletteGrapeBorderActive\n }\n },\n lilac: {\n '::before': {\n color: tokens.colorPaletteLilacBorderActive\n }\n },\n pink: {\n '::before': {\n color: tokens.colorPalettePinkBorderActive\n }\n },\n magenta: {\n '::before': {\n color: tokens.colorPaletteMagentaBorderActive\n }\n },\n plum: {\n '::before': {\n color: tokens.colorPalettePlumBorderActive\n }\n },\n beige: {\n '::before': {\n color: tokens.colorPaletteBeigeBorderActive\n }\n },\n mink: {\n '::before': {\n color: tokens.colorPaletteMinkBorderActive\n }\n },\n platinum: {\n '::before': {\n color: tokens.colorPalettePlatinumBorderActive\n }\n },\n anchor: {\n '::before': {\n color: tokens.colorPaletteAnchorBorderActive\n }\n }\n});\nexport const useAvatarStyles_unstable = (state)=>{\n const { size , shape , active , activeAppearance , color } = state;\n const rootClassName = useRootClassName();\n const imageClassName = useImageClassName();\n const iconInitialsClassName = useIconInitialsClassName();\n const styles = useStyles();\n const sizeStyles = useSizeStyles();\n const colorStyles = useColorStyles();\n const ringColorStyles = useRingColorStyles();\n const rootClasses = [\n rootClassName,\n size !== 32 && sizeStyles[size]\n ];\n if (state.badge) {\n rootClasses.push(styles.badgeAlign, styles[state.badge.size || 'medium']);\n }\n if (size <= 24) {\n rootClasses.push(styles.textCaption2Strong);\n } else if (size <= 28) {\n rootClasses.push(styles.textCaption1Strong);\n } else if (size <= 40) {\n // Default text size included in useRootClassName\n } else if (size <= 56) {\n rootClasses.push(styles.textSubtitle2);\n } else if (size <= 96) {\n rootClasses.push(styles.textSubtitle1);\n } else {\n rootClasses.push(styles.textTitle3);\n }\n if (shape === 'square') {\n if (size <= 24) {\n rootClasses.push(styles.squareSmall);\n } else if (size <= 48) {\n rootClasses.push(styles.squareMedium);\n } else if (size <= 72) {\n rootClasses.push(styles.squareLarge);\n } else {\n rootClasses.push(styles.squareXLarge);\n }\n }\n if (active === 'active' || active === 'inactive') {\n rootClasses.push(styles.activeOrInactive);\n if (activeAppearance === 'ring' || activeAppearance === 'ring-shadow') {\n rootClasses.push(styles.ring, ringColorStyles[color]);\n if (state.badge) {\n rootClasses.push(styles.ringBadgeCutout);\n }\n if (size <= 48) {\n rootClasses.push(styles.ringThick);\n } else if (size <= 64) {\n rootClasses.push(styles.ringThicker);\n } else {\n rootClasses.push(styles.ringThickest);\n }\n }\n if (activeAppearance === 'shadow' || activeAppearance === 'ring-shadow') {\n rootClasses.push(styles.shadow);\n if (size <= 28) {\n rootClasses.push(styles.shadow4);\n } else if (size <= 48) {\n rootClasses.push(styles.shadow8);\n } else if (size <= 64) {\n rootClasses.push(styles.shadow16);\n } else {\n rootClasses.push(styles.shadow28);\n }\n }\n // Note: The inactive style overrides some of the activeAppearance styles and must be applied after them\n if (active === 'inactive') {\n rootClasses.push(styles.inactive);\n }\n }\n state.root.className = mergeClasses(avatarClassNames.root, ...rootClasses, state.root.className);\n if (state.badge) {\n state.badge.className = mergeClasses(avatarClassNames.badge, styles.badge, state.badge.className);\n }\n if (state.image) {\n state.image.className = mergeClasses(avatarClassNames.image, imageClassName, colorStyles[color], state.badge && styles.badgeCutout, state.image.className);\n }\n if (state.initials) {\n state.initials.className = mergeClasses(avatarClassNames.initials, iconInitialsClassName, colorStyles[color], state.badge && styles.badgeCutout, state.initials.className);\n }\n if (state.icon) {\n let iconSizeClass;\n if (size <= 16) {\n iconSizeClass = styles.icon12;\n } else if (size <= 24) {\n iconSizeClass = styles.icon16;\n } else if (size <= 40) {\n iconSizeClass = styles.icon20;\n } else if (size <= 48) {\n iconSizeClass = styles.icon24;\n } else if (size <= 56) {\n iconSizeClass = styles.icon28;\n } else if (size <= 72) {\n iconSizeClass = styles.icon32;\n } else {\n iconSizeClass = styles.icon48;\n }\n state.icon.className = mergeClasses(avatarClassNames.icon, iconInitialsClassName, iconSizeClass, colorStyles[color], state.badge && styles.badgeCutout, state.icon.className);\n }\n return state;\n};\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAAAC,aAAA,EAAAC,QAAA,EAAsCC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACtF,OAAO,MAAMC,gBAAgB,GAAG;EAC5BC,IAAI,EAAE,YAAY;EAClBC,KAAK,EAAE,mBAAmB;EAC1BC,QAAQ,EAAE,sBAAsB;EAChCC,IAAI,EAAE,kBAAkB;EACxBC,KAAK,EAAE;AACX,CAAC;AACD;AACA,MAAMC,IAAI,GAAG;EACTC,WAAW,EAAE,0BAA0B;EACvCC,QAAQ,EAAE,uBAAuB;EACjCC,UAAU,EAAE,yBAAyB;EACrCC,SAAS,EAAE;AACf,CAAC;AACD,MAAMC,gBAAgB,gBAAGf,aAAA,2qDAiCxB,CAAC;AACF,MAAMgB,iBAAiB,gBAAGhB,aAAA,sRASzB,CAAC;AACF,MAAMiB,wBAAwB,gBAAGjB,aAAA,oqCAgBhC,CAAC;AACF;AACA;AACA;AACA;AACA;AACA;AAAI,MAAMkB,SAAS,GAAIC,MAAM,IAAG;EAC5B;EACA;EACA,MAAMC,YAAY,GAAGD,MAAM,GAAI,YAAWT,IAAI,CAACC,WAAY,OAAMQ,MAAO,GAAE,GAAI,OAAMT,IAAI,CAACC,WAAY,GAAE;EACvG;EACA;EACA,MAAMU,WAAW,GAAI,YAAWX,IAAI,CAACC,WAAY,WAAUD,IAAI,CAACE,QAAS,aAAY;EACrF,MAAMU,WAAW,GAAI,YAAWZ,IAAI,CAACC,WAAY,WAAUD,IAAI,CAACE,QAAS,aAAY;EACrF,OAAQ,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Q,aAAa,EAAEL,WAAW,CAACN,KAAK,CAAC,EAAEL,KAAK,CAACpH,KAAK,IAAI6H,MAAM,CAAChE,WAAW,EAAEuD,KAAK,CAACrH,IAAI,CAACoI,SAAS,CAAC;EACjL;EACA,OAAOf,KAAK;AAChB,CAAC"}
|
|
@@ -7,13 +7,11 @@ import { useAvatarGroupStyles_unstable } from './useAvatarGroupStyles.styles';
|
|
|
7
7
|
/**
|
|
8
8
|
* The AvatarGroup component represents a group of multiple people or entities by taking care of the arrangement
|
|
9
9
|
* of individual Avatars in a spread, stack, or pie layout.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return renderAvatarGroup_unstable(state, contextValues);
|
|
10
|
+
*/ export const AvatarGroup = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
11
|
+
const state = useAvatarGroup_unstable(props, ref);
|
|
12
|
+
const contextValues = useAvatarGroupContextValues(state);
|
|
13
|
+
useAvatarGroupStyles_unstable(state);
|
|
14
|
+
useCustomStyleHook_unstable('useAvatarGroupStyles_unstable')(state);
|
|
15
|
+
return renderAvatarGroup_unstable(state, contextValues);
|
|
17
16
|
});
|
|
18
17
|
AvatarGroup.displayName = 'AvatarGroup';
|
|
19
|
-
//# sourceMappingURL=AvatarGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["AvatarGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport { renderAvatarGroup_unstable } from './renderAvatarGroup';\nimport { useAvatarGroup_unstable } from './useAvatarGroup';\nimport { useAvatarGroupContextValues } from './useAvatarGroupContextValues';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport { useAvatarGroupStyles_unstable } from './useAvatarGroupStyles.styles';\nimport type { AvatarGroupProps } from './AvatarGroup.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * The AvatarGroup component represents a group of multiple people or entities by taking care of the arrangement\n * of individual Avatars in a spread, stack, or pie layout.\n */\nexport const AvatarGroup: ForwardRefComponent<AvatarGroupProps> = React.forwardRef((props, ref) => {\n const state = useAvatarGroup_unstable(props, ref);\n const contextValues = useAvatarGroupContextValues(state);\n\n useAvatarGroupStyles_unstable(state);\n\n useCustomStyleHook_unstable('useAvatarGroupStyles_unstable')(state);\n\n return renderAvatarGroup_unstable(state, contextValues);\n});\n\nAvatarGroup.displayName = 'AvatarGroup';\n"],"names":["React","renderAvatarGroup_unstable","useAvatarGroup_unstable","useAvatarGroupContextValues","useCustomStyleHook_unstable","useAvatarGroupStyles_unstable","AvatarGroup","forwardRef","props","ref","state","contextValues","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,2BAA2B,QAAQ,gCAAgC;AAC5E,SAASC,2BAA2B,QAAQ,kCAAkC;AAC9E,SAASC,6BAA6B,QAAQ,gCAAgC;AAI9E;;;CAGC,GACD,OAAO,MAAMC,4BAAqDN,MAAMO,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACjG,MAAMC,QAAQR,wBAAwBM,OAAOC;IAC7C,MAAME,gBAAgBR,4BAA4BO;IAElDL,8BAA8BK;IAE9BN,4BAA4B,iCAAiCM;IAE7D,OAAOT,2BAA2BS,OAAOC;AAC3C,GAAG;AAEHL,YAAYM,WAAW,GAAG"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=AvatarGroup.types.js.map
|
|
1
|
+
export { };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["AvatarGroup.types.ts"],"sourcesContent":["import type { AvatarSize } 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/**\n * AvatarGroup Props\n */\nexport type AvatarGroupProps = ComponentProps<AvatarGroupSlots> & {\n /**\n * Layout the AvatarGroupItems should be displayed as.\n * @default spread\n */\n layout?: 'spread' | 'stack' | 'pie';\n\n /**\n * Size of the AvatarGroupItems.\n * @default 32\n */\n size?: AvatarSize;\n};\n\n/**\n * State used in rendering AvatarGroup\n */\nexport type AvatarGroupState = ComponentState<AvatarGroupSlots> & Required<Pick<AvatarGroupProps, 'layout' | 'size'>>;\n\nexport type AvatarGroupContextValue = Pick<AvatarGroupProps, 'size' | 'layout'> & {\n isOverflow?: boolean;\n};\n\nexport type AvatarGroupContextValues = {\n avatarGroup: AvatarGroupContextValue;\n};\n"],"names":[],"mappings":"AAAA,WAmCE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './AvatarGroup';\nexport * from './AvatarGroup.types';\nexport * from './renderAvatarGroup';\nexport * from './useAvatarGroup';\nexport * from './useAvatarGroupStyles.styles';\nexport * from './useAvatarGroupContextValues';\n"],"names":[],"mappings":"AAAA,cAAc,gBAAgB;AAC9B,cAAc,sBAAsB;AACpC,cAAc,sBAAsB;AACpC,cAAc,mBAAmB;AACjC,cAAc,gCAAgC;AAC9C,cAAc,gCAAgC"}
|