@fluentui/react-avatar 9.4.3 → 9.4.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/.swcrc +30 -0
- package/CHANGELOG.json +127 -1
- package/CHANGELOG.md +36 -2
- package/lib/Avatar.js.map +1 -1
- package/lib/AvatarGroup.js.map +1 -1
- package/lib/AvatarGroupItem.js.map +1 -1
- package/lib/AvatarGroupPopover.js.map +1 -1
- package/lib/components/Avatar/Avatar.js.map +1 -1
- package/lib/components/Avatar/Avatar.types.js.map +1 -1
- package/lib/components/Avatar/index.js.map +1 -1
- package/lib/components/Avatar/renderAvatar.js +1 -11
- package/lib/components/Avatar/renderAvatar.js.map +1 -1
- package/lib/components/Avatar/useAvatar.js +2 -2
- package/lib/components/Avatar/useAvatar.js.map +1 -1
- package/lib/components/Avatar/useAvatarStyles.js.map +1 -1
- package/lib/components/AvatarGroup/AvatarGroup.js.map +1 -1
- package/lib/components/AvatarGroup/AvatarGroup.types.js.map +1 -1
- package/lib/components/AvatarGroup/index.js.map +1 -1
- package/lib/components/AvatarGroup/renderAvatarGroup.js +1 -3
- package/lib/components/AvatarGroup/renderAvatarGroup.js.map +1 -1
- package/lib/components/AvatarGroup/useAvatarGroup.js +1 -0
- package/lib/components/AvatarGroup/useAvatarGroup.js.map +1 -1
- package/lib/components/AvatarGroup/useAvatarGroupContextValues.js.map +1 -1
- package/lib/components/AvatarGroup/useAvatarGroupStyles.js.map +1 -1
- package/lib/components/AvatarGroupItem/AvatarGroupItem.js.map +1 -1
- package/lib/components/AvatarGroupItem/AvatarGroupItem.types.js.map +1 -1
- package/lib/components/AvatarGroupItem/index.js.map +1 -1
- package/lib/components/AvatarGroupItem/renderAvatarGroupItem.js +1 -7
- package/lib/components/AvatarGroupItem/renderAvatarGroupItem.js.map +1 -1
- package/lib/components/AvatarGroupItem/useAvatarGroupItem.js +1 -0
- package/lib/components/AvatarGroupItem/useAvatarGroupItem.js.map +1 -1
- package/lib/components/AvatarGroupItem/useAvatarGroupItemStyles.js.map +1 -1
- package/lib/components/AvatarGroupPopover/AvatarGroupPopover.js +1 -0
- package/lib/components/AvatarGroupPopover/AvatarGroupPopover.js.map +1 -1
- package/lib/components/AvatarGroupPopover/AvatarGroupPopover.types.js +1 -1
- package/lib/components/AvatarGroupPopover/AvatarGroupPopover.types.js.map +1 -1
- package/lib/components/AvatarGroupPopover/index.js.map +1 -1
- package/lib/components/AvatarGroupPopover/renderAvatarGroupPopover.js +3 -13
- package/lib/components/AvatarGroupPopover/renderAvatarGroupPopover.js.map +1 -1
- package/lib/components/AvatarGroupPopover/useAvatarGroupPopover.js +4 -4
- package/lib/components/AvatarGroupPopover/useAvatarGroupPopover.js.map +1 -1
- package/lib/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js.map +1 -1
- package/lib/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.js.map +1 -1
- package/lib/contexts/AvatarContext.js +2 -4
- package/lib/contexts/AvatarContext.js.map +1 -1
- package/lib/contexts/AvatarGroupContext.js.map +1 -1
- package/lib/contexts/index.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/utils/getInitials.js +5 -8
- package/lib/utils/getInitials.js.map +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/partitionAvatarGroupItems.js +3 -4
- package/lib/utils/partitionAvatarGroupItems.js.map +1 -1
- package/lib-commonjs/Avatar.js +5 -4
- package/lib-commonjs/Avatar.js.map +1 -1
- package/lib-commonjs/AvatarGroup.js +5 -4
- package/lib-commonjs/AvatarGroup.js.map +1 -1
- package/lib-commonjs/AvatarGroupItem.js +5 -4
- package/lib-commonjs/AvatarGroupItem.js.map +1 -1
- package/lib-commonjs/AvatarGroupPopover.js +5 -4
- package/lib-commonjs/AvatarGroupPopover.js.map +1 -1
- package/lib-commonjs/components/Avatar/Avatar.js +19 -17
- package/lib-commonjs/components/Avatar/Avatar.js.map +1 -1
- package/lib-commonjs/components/Avatar/Avatar.types.js +3 -2
- package/lib-commonjs/components/Avatar/Avatar.types.js.map +1 -1
- package/lib-commonjs/components/Avatar/index.js +9 -8
- package/lib-commonjs/components/Avatar/index.js.map +1 -1
- package/lib-commonjs/components/Avatar/renderAvatar.js +13 -23
- package/lib-commonjs/components/Avatar/renderAvatar.js.map +1 -1
- package/lib-commonjs/components/Avatar/useAvatar.js +186 -158
- package/lib-commonjs/components/Avatar/useAvatar.js.map +1 -1
- package/lib-commonjs/components/Avatar/useAvatarStyles.js +889 -510
- package/lib-commonjs/components/Avatar/useAvatarStyles.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.js +21 -23
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.types.js +3 -2
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.types.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/index.js +10 -9
- package/lib-commonjs/components/AvatarGroup/index.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/renderAvatarGroup.js +16 -21
- package/lib-commonjs/components/AvatarGroup/renderAvatarGroup.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/useAvatarGroup.js +33 -33
- package/lib-commonjs/components/AvatarGroup/useAvatarGroup.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/useAvatarGroupContextValues.js +16 -17
- package/lib-commonjs/components/AvatarGroup/useAvatarGroupContextValues.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.js +47 -37
- package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupItem/AvatarGroupItem.js +19 -21
- package/lib-commonjs/components/AvatarGroupItem/AvatarGroupItem.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupItem/AvatarGroupItem.types.js +3 -2
- package/lib-commonjs/components/AvatarGroupItem/AvatarGroupItem.types.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupItem/index.js +9 -8
- package/lib-commonjs/components/AvatarGroupItem/index.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupItem/renderAvatarGroupItem.js +13 -22
- package/lib-commonjs/components/AvatarGroupItem/renderAvatarGroupItem.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItem.js +59 -68
- package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItem.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItemStyles.js +379 -224
- package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItemStyles.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupPopover/AvatarGroupPopover.js +21 -22
- package/lib-commonjs/components/AvatarGroupPopover/AvatarGroupPopover.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupPopover/AvatarGroupPopover.types.js +5 -2
- package/lib-commonjs/components/AvatarGroupPopover/AvatarGroupPopover.types.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupPopover/index.js +9 -8
- package/lib-commonjs/components/AvatarGroupPopover/index.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupPopover/renderAvatarGroupPopover.js +19 -32
- package/lib-commonjs/components/AvatarGroupPopover/renderAvatarGroupPopover.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopover.js +89 -99
- package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopover.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js +15 -13
- package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.js +527 -272
- package/lib-commonjs/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.js.map +1 -1
- package/lib-commonjs/contexts/AvatarContext.js +18 -17
- package/lib-commonjs/contexts/AvatarContext.js.map +1 -1
- package/lib-commonjs/contexts/AvatarGroupContext.js +17 -12
- package/lib-commonjs/contexts/AvatarGroupContext.js.map +1 -1
- package/lib-commonjs/contexts/index.js +6 -5
- package/lib-commonjs/contexts/index.js.map +1 -1
- package/lib-commonjs/index.js +45 -172
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/getInitials.js +44 -60
- package/lib-commonjs/utils/getInitials.js.map +1 -1
- package/lib-commonjs/utils/index.js +14 -16
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/partitionAvatarGroupItems.js +25 -26
- package/lib-commonjs/utils/partitionAvatarGroupItems.js.map +1 -1
- package/package.json +14 -13
- package/lib-amd/Avatar.js +0 -6
- package/lib-amd/Avatar.js.map +0 -1
- package/lib-amd/AvatarGroup.js +0 -6
- package/lib-amd/AvatarGroup.js.map +0 -1
- package/lib-amd/AvatarGroupItem.js +0 -6
- package/lib-amd/AvatarGroupItem.js.map +0 -1
- package/lib-amd/AvatarGroupPopover.js +0 -6
- package/lib-amd/AvatarGroupPopover.js.map +0 -1
- package/lib-amd/components/Avatar/Avatar.js +0 -14
- package/lib-amd/components/Avatar/Avatar.js.map +0 -1
- package/lib-amd/components/Avatar/Avatar.types.js +0 -5
- package/lib-amd/components/Avatar/Avatar.types.js.map +0 -1
- package/lib-amd/components/Avatar/index.js +0 -10
- package/lib-amd/components/Avatar/index.js.map +0 -1
- package/lib-amd/components/Avatar/renderAvatar.js +0 -16
- package/lib-amd/components/Avatar/renderAvatar.js.map +0 -1
- package/lib-amd/components/Avatar/useAvatar.js +0 -178
- package/lib-amd/components/Avatar/useAvatar.js.map +0 -1
- package/lib-amd/components/Avatar/useAvatarStyles.js +0 -425
- package/lib-amd/components/Avatar/useAvatarStyles.js.map +0 -1
- package/lib-amd/components/AvatarGroup/AvatarGroup.js +0 -19
- package/lib-amd/components/AvatarGroup/AvatarGroup.js.map +0 -1
- package/lib-amd/components/AvatarGroup/AvatarGroup.types.js +0 -5
- package/lib-amd/components/AvatarGroup/AvatarGroup.types.js.map +0 -1
- package/lib-amd/components/AvatarGroup/index.js +0 -11
- package/lib-amd/components/AvatarGroup/index.js.map +0 -1
- package/lib-amd/components/AvatarGroup/renderAvatarGroup.js +0 -15
- package/lib-amd/components/AvatarGroup/renderAvatarGroup.js.map +0 -1
- package/lib-amd/components/AvatarGroup/useAvatarGroup.js +0 -29
- package/lib-amd/components/AvatarGroup/useAvatarGroup.js.map +0 -1
- package/lib-amd/components/AvatarGroup/useAvatarGroupContextValues.js +0 -15
- package/lib-amd/components/AvatarGroup/useAvatarGroupContextValues.js.map +0 -1
- package/lib-amd/components/AvatarGroup/useAvatarGroupStyles.js +0 -36
- package/lib-amd/components/AvatarGroup/useAvatarGroupStyles.js.map +0 -1
- package/lib-amd/components/AvatarGroupItem/AvatarGroupItem.js +0 -18
- package/lib-amd/components/AvatarGroupItem/AvatarGroupItem.js.map +0 -1
- package/lib-amd/components/AvatarGroupItem/AvatarGroupItem.types.js +0 -5
- package/lib-amd/components/AvatarGroupItem/AvatarGroupItem.types.js.map +0 -1
- package/lib-amd/components/AvatarGroupItem/index.js +0 -10
- package/lib-amd/components/AvatarGroupItem/index.js.map +0 -1
- package/lib-amd/components/AvatarGroupItem/renderAvatarGroupItem.js +0 -16
- package/lib-amd/components/AvatarGroupItem/renderAvatarGroupItem.js.map +0 -1
- package/lib-amd/components/AvatarGroupItem/useAvatarGroupItem.js +0 -58
- package/lib-amd/components/AvatarGroupItem/useAvatarGroupItem.js.map +0 -1
- package/lib-amd/components/AvatarGroupItem/useAvatarGroupItemStyles.js +0 -236
- package/lib-amd/components/AvatarGroupItem/useAvatarGroupItemStyles.js.map +0 -1
- package/lib-amd/components/AvatarGroupPopover/AvatarGroupPopover.js +0 -19
- package/lib-amd/components/AvatarGroupPopover/AvatarGroupPopover.js.map +0 -1
- package/lib-amd/components/AvatarGroupPopover/AvatarGroupPopover.types.js +0 -5
- package/lib-amd/components/AvatarGroupPopover/AvatarGroupPopover.types.js.map +0 -1
- package/lib-amd/components/AvatarGroupPopover/index.js +0 -10
- package/lib-amd/components/AvatarGroupPopover/index.js.map +0 -1
- package/lib-amd/components/AvatarGroupPopover/renderAvatarGroupPopover.js +0 -20
- package/lib-amd/components/AvatarGroupPopover/renderAvatarGroupPopover.js.map +0 -1
- package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopover.js +0 -86
- package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopover.js.map +0 -1
- package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js +0 -14
- package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.js.map +0 -1
- package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.js +0 -136
- package/lib-amd/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.js.map +0 -1
- package/lib-amd/contexts/AvatarContext.js +0 -17
- package/lib-amd/contexts/AvatarContext.js.map +0 -1
- package/lib-amd/contexts/AvatarGroupContext.js +0 -20
- package/lib-amd/contexts/AvatarGroupContext.js.map +0 -1
- package/lib-amd/contexts/index.js +0 -7
- package/lib-amd/contexts/index.js.map +0 -1
- package/lib-amd/index.js +0 -33
- package/lib-amd/index.js.map +0 -1
- package/lib-amd/utils/getInitials.js +0 -87
- package/lib-amd/utils/getInitials.js.map +0 -1
- package/lib-amd/utils/index.js +0 -8
- package/lib-amd/utils/index.js.map +0 -1
- package/lib-amd/utils/partitionAvatarGroupItems.js +0 -32
- package/lib-amd/utils/partitionAvatarGroupItems.js.map +0 -1
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "react", "../../contexts/AvatarGroupContext", "../AvatarGroup/useAvatarGroup", "@fluentui/react-utilities", "@fluentui/react-icons", "@fluentui/react-popover", "@fluentui/react-tooltip"], function (require, exports, tslib_1, React, AvatarGroupContext_1, useAvatarGroup_1, react_utilities_1, react_icons_1, react_popover_1, react_tooltip_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.useAvatarGroupPopover_unstable = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* Create the state required to render AvatarGroupPopover.
|
|
7
|
-
*
|
|
8
|
-
* The returned state can be modified with hooks such as useAvatarGroupPopoverStyles_unstable,
|
|
9
|
-
* before being passed to renderAvatarGroupPopover_unstable.
|
|
10
|
-
*
|
|
11
|
-
* @param props - props from this instance of AvatarGroupPopover
|
|
12
|
-
*/
|
|
13
|
-
var useAvatarGroupPopover_unstable = function (props) {
|
|
14
|
-
var _a;
|
|
15
|
-
var size = (_a = AvatarGroupContext_1.useAvatarGroupContext_unstable(function (ctx) { return ctx.size; })) !== null && _a !== void 0 ? _a : useAvatarGroup_1.defaultAvatarGroupSize;
|
|
16
|
-
var layout = AvatarGroupContext_1.useAvatarGroupContext_unstable(function (ctx) { return ctx.layout; });
|
|
17
|
-
var _b = props.indicator, indicator = _b === void 0 ? size < 24 ? 'icon' : 'count' : _b, _c = props.count, count = _c === void 0 ? React.Children.count(props.children) : _c, children = props.children, restOfProps = tslib_1.__rest(props, ["indicator", "count", "children"]);
|
|
18
|
-
var _d = react_utilities_1.useControllableState({
|
|
19
|
-
state: props.open,
|
|
20
|
-
defaultState: props.defaultOpen,
|
|
21
|
-
initialState: false,
|
|
22
|
-
}), popoverOpen = _d[0], setPopoverOpen = _d[1];
|
|
23
|
-
var handleOnPopoverChange = function (e, data) {
|
|
24
|
-
var _a;
|
|
25
|
-
(_a = restOfProps.onOpenChange) === null || _a === void 0 ? void 0 : _a.call(restOfProps, e, data);
|
|
26
|
-
setPopoverOpen(data.open);
|
|
27
|
-
};
|
|
28
|
-
var triggerButtonChildren;
|
|
29
|
-
if (layout === 'pie') {
|
|
30
|
-
triggerButtonChildren = null;
|
|
31
|
-
}
|
|
32
|
-
else if (indicator === 'icon') {
|
|
33
|
-
triggerButtonChildren = React.createElement(react_icons_1.MoreHorizontalRegular, null);
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
triggerButtonChildren = count > 99 ? '99+' : "+" + count;
|
|
37
|
-
}
|
|
38
|
-
return {
|
|
39
|
-
count: count,
|
|
40
|
-
indicator: indicator,
|
|
41
|
-
layout: layout,
|
|
42
|
-
popoverOpen: popoverOpen,
|
|
43
|
-
size: size,
|
|
44
|
-
components: {
|
|
45
|
-
root: react_popover_1.Popover,
|
|
46
|
-
triggerButton: 'button',
|
|
47
|
-
content: 'ul',
|
|
48
|
-
popoverSurface: react_popover_1.PopoverSurface,
|
|
49
|
-
tooltip: react_tooltip_1.Tooltip,
|
|
50
|
-
},
|
|
51
|
-
root: tslib_1.__assign(tslib_1.__assign({
|
|
52
|
-
// Popover expects a child for its children. The children are added in the renderAvatarGroupPopover.
|
|
53
|
-
children: React.createElement(React.Fragment, null), size: 'small', trapFocus: true }, restOfProps), { open: popoverOpen, onOpenChange: handleOnPopoverChange }),
|
|
54
|
-
triggerButton: react_utilities_1.resolveShorthand(props.triggerButton, {
|
|
55
|
-
required: true,
|
|
56
|
-
defaultProps: {
|
|
57
|
-
children: triggerButtonChildren,
|
|
58
|
-
type: 'button',
|
|
59
|
-
},
|
|
60
|
-
}),
|
|
61
|
-
content: react_utilities_1.resolveShorthand(props.content, {
|
|
62
|
-
required: true,
|
|
63
|
-
defaultProps: {
|
|
64
|
-
children: children,
|
|
65
|
-
role: 'list',
|
|
66
|
-
},
|
|
67
|
-
}),
|
|
68
|
-
popoverSurface: react_utilities_1.resolveShorthand(props.popoverSurface, {
|
|
69
|
-
required: true,
|
|
70
|
-
defaultProps: {
|
|
71
|
-
'aria-label': 'Overflow',
|
|
72
|
-
tabIndex: 0,
|
|
73
|
-
},
|
|
74
|
-
}),
|
|
75
|
-
tooltip: react_utilities_1.resolveShorthand(props.tooltip, {
|
|
76
|
-
required: true,
|
|
77
|
-
defaultProps: {
|
|
78
|
-
content: 'View more people.',
|
|
79
|
-
relationship: 'label',
|
|
80
|
-
},
|
|
81
|
-
}),
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
exports.useAvatarGroupPopover_unstable = useAvatarGroupPopover_unstable;
|
|
85
|
-
});
|
|
86
|
-
//# sourceMappingURL=useAvatarGroupPopover.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAvatarGroupPopover.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-avatar/src/components/AvatarGroupPopover/useAvatarGroupPopover.tsx"],"names":[],"mappings":";;;;IASA;;;;;;;OAOG;IACI,IAAM,8BAA8B,GAAG,UAAC,KAA8B;;QAC3E,IAAM,IAAI,GAAG,MAAA,mDAA8B,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,IAAI,EAAR,CAAQ,CAAC,mCAAI,uCAAsB,CAAC;QACvF,IAAM,MAAM,GAAG,mDAA8B,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,MAAM,EAAV,CAAU,CAAC,CAAC;QAE/D,IAAA,KAIE,KAAK,UAJiC,EAAxC,SAAS,mBAAG,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,KAAA,EACxC,KAGE,KAAK,MAHqC,EAA5C,KAAK,mBAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAA,EAC5C,QAAQ,GAEN,KAAK,SAFC,EACL,WAAW,kBACZ,KAAK,EALH,kCAKL,CADe,CACN;QAEJ,IAAA,KAAgC,sCAAoB,CAAC;YACzD,KAAK,EAAE,KAAK,CAAC,IAAI;YACjB,YAAY,EAAE,KAAK,CAAC,WAAW;YAC/B,YAAY,EAAE,KAAK;SACpB,CAAC,EAJK,WAAW,QAAA,EAAE,cAAc,QAIhC,CAAC;QAEH,IAAM,qBAAqB,GAAG,UAAC,CAAoB,EAAE,IAAsB;;YACzE,MAAA,WAAW,CAAC,YAAY,+CAAxB,WAAW,EAAgB,CAAC,EAAE,IAAI,CAAC,CAAC;YACpC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC,CAAC;QAEF,IAAI,qBA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B,CAAC,KAAK,CAAC,OAAO,EAAE;gBACvC,QAAQ,EAAE,IAAI;gBACd,YAAY,EAAE;oBACZ,OAAO,EAAE,mBAAmB;oBAC5B,YAAY,EAAE,OAAO;iBACtB;aACF,CAAC;SACH,CAAC;IACJ,CAAC,CAAC;IAlFW,QAAA,8BAA8B,kCAkFzC","sourcesContent":["import * as React from 'react';\nimport { useAvatarGroupContext_unstable } from '../../contexts/AvatarGroupContext';\nimport { defaultAvatarGroupSize } from '../AvatarGroup/useAvatarGroup';\nimport { resolveShorthand, useControllableState } from '@fluentui/react-utilities';\nimport { MoreHorizontalRegular } from '@fluentui/react-icons';\nimport { OnOpenChangeData, OpenPopoverEvents, Popover, PopoverSurface } from '@fluentui/react-popover';\nimport type { AvatarGroupPopoverProps, AvatarGroupPopoverState } from './AvatarGroupPopover.types';\nimport { Tooltip } from '@fluentui/react-tooltip';\n\n/**\n * Create the state required to render AvatarGroupPopover.\n *\n * The returned state can be modified with hooks such as useAvatarGroupPopoverStyles_unstable,\n * before being passed to renderAvatarGroupPopover_unstable.\n *\n * @param props - props from this instance of AvatarGroupPopover\n */\nexport const useAvatarGroupPopover_unstable = (props: AvatarGroupPopoverProps): AvatarGroupPopoverState => {\n const size = useAvatarGroupContext_unstable(ctx => ctx.size) ?? defaultAvatarGroupSize;\n const layout = useAvatarGroupContext_unstable(ctx => ctx.layout);\n const {\n indicator = size < 24 ? 'icon' : 'count',\n count = React.Children.count(props.children),\n children,\n ...restOfProps\n } = props;\n\n const [popoverOpen, setPopoverOpen] = useControllableState({\n state: props.open,\n defaultState: props.defaultOpen,\n initialState: false,\n });\n\n const handleOnPopoverChange = (e: OpenPopoverEvents, data: OnOpenChangeData) => {\n restOfProps.onOpenChange?.(e, data);\n setPopoverOpen(data.open);\n };\n\n let triggerButtonChildren;\n if (layout === 'pie') {\n triggerButtonChildren = null;\n } else if (indicator === 'icon') {\n triggerButtonChildren = <MoreHorizontalRegular />;\n } else {\n triggerButtonChildren = count > 99 ? '99+' : `+${count}`;\n }\n\n return {\n count,\n indicator,\n layout,\n popoverOpen,\n size,\n\n components: {\n root: Popover,\n triggerButton: 'button',\n content: 'ul',\n popoverSurface: PopoverSurface,\n tooltip: Tooltip,\n },\n root: {\n // Popover expects a child for its children. The children are added in the renderAvatarGroupPopover.\n children: <></>,\n size: 'small',\n trapFocus: true,\n ...restOfProps,\n open: popoverOpen,\n onOpenChange: handleOnPopoverChange,\n },\n triggerButton: resolveShorthand(props.triggerButton, {\n required: true,\n defaultProps: {\n children: triggerButtonChildren,\n type: 'button',\n },\n }),\n content: resolveShorthand(props.content, {\n required: true,\n defaultProps: {\n children,\n role: 'list',\n },\n }),\n popoverSurface: resolveShorthand(props.popoverSurface, {\n required: true,\n defaultProps: {\n 'aria-label': 'Overflow',\n tabIndex: 0,\n },\n }),\n tooltip: resolveShorthand(props.tooltip, {\n required: true,\n defaultProps: {\n content: 'View more people.',\n relationship: 'label',\n },\n }),\n };\n};\n"]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
define(["require", "exports"], function (require, exports) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.useAvatarGroupPopoverContextValues = void 0;
|
|
5
|
-
var useAvatarGroupPopoverContextValues = function (state) {
|
|
6
|
-
var avatarGroup = {
|
|
7
|
-
isOverflow: true,
|
|
8
|
-
size: 24,
|
|
9
|
-
};
|
|
10
|
-
return { avatarGroup: avatarGroup };
|
|
11
|
-
};
|
|
12
|
-
exports.useAvatarGroupPopoverContextValues = useAvatarGroupPopoverContextValues;
|
|
13
|
-
});
|
|
14
|
-
//# sourceMappingURL=useAvatarGroupPopoverContextValues.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAvatarGroupPopoverContextValues.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-avatar/src/components/AvatarGroupPopover/useAvatarGroupPopoverContextValues.ts"],"names":[],"mappings":";;;;IAGO,IAAM,kCAAkC,GAAG,UAAC,KAA8B;QAC/E,IAAM,WAAW,GAA4B;YAC3C,UAAU,EAAE,IAAI;YAChB,IAAI,EAAE,EAAE;SACT,CAAC;QAEF,OAAO,EAAE,WAAW,aAAA,EAAE,CAAC;IACzB,CAAC,CAAC;IAPW,QAAA,kCAAkC,sCAO7C","sourcesContent":["import { AvatarGroupContextValue, AvatarGroupContextValues } from '../AvatarGroup/AvatarGroup.types';\nimport { AvatarGroupPopoverState } from './AvatarGroupPopover.types';\n\nexport const useAvatarGroupPopoverContextValues = (state: AvatarGroupPopoverState): AvatarGroupContextValues => {\n const avatarGroup: AvatarGroupContextValue = {\n isOverflow: true,\n size: 24,\n };\n\n return { avatarGroup };\n};\n"]}
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "@fluentui/react-tabster", "@griffel/react", "@fluentui/react-theme", "../AvatarGroupItem/useAvatarGroupItemStyles", "../Avatar/useAvatarStyles"], function (require, exports, tslib_1, react_tabster_1, react_1, react_theme_1, useAvatarGroupItemStyles_1, useAvatarStyles_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.useAvatarGroupPopoverStyles_unstable = exports.avatarGroupPopoverClassNames = void 0;
|
|
5
|
-
exports.avatarGroupPopoverClassNames = {
|
|
6
|
-
root: 'fui-AvatarGroupPopover',
|
|
7
|
-
content: 'fui-AvatarGroupPopover__content',
|
|
8
|
-
popoverSurface: 'fui-AvatarGroupPopover__popoverSurface',
|
|
9
|
-
tooltip: 'fui-AvatarGroupPopover__tooltip',
|
|
10
|
-
triggerButton: 'fui-AvatarGroupPopover__triggerButton',
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Styles for the content slot.
|
|
14
|
-
*/
|
|
15
|
-
var useContentStyles = react_1.makeStyles({
|
|
16
|
-
base: tslib_1.__assign(tslib_1.__assign({ listStyleType: 'none' }, react_1.shorthands.margin('0')), react_1.shorthands.padding('0')),
|
|
17
|
-
});
|
|
18
|
-
/**
|
|
19
|
-
* Styles for the popoverSurface slot.
|
|
20
|
-
*/
|
|
21
|
-
var usePopoverSurfaceStyles = react_1.makeStyles({
|
|
22
|
-
base: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ maxHeight: '220px', minHeight: '80px' }, react_1.shorthands.overflow('hidden', 'scroll')), react_1.shorthands.padding(react_theme_1.tokens.spacingVerticalS, react_theme_1.tokens.spacingHorizontalS)), { width: '220px' }),
|
|
23
|
-
});
|
|
24
|
-
/**
|
|
25
|
-
* Styles for the triggerButton slot.
|
|
26
|
-
*/
|
|
27
|
-
var useTriggerButtonStyles = react_1.makeStyles({
|
|
28
|
-
base: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ display: 'inline-flex', position: 'relative', flexShrink: 0, justifyContent: 'center', alignItems: 'center', color: react_theme_1.tokens.colorNeutralForeground1, backgroundColor: react_theme_1.tokens.colorNeutralBackground1 }, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStroke1)), react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusCircular)), react_1.shorthands.borderStyle('solid')), react_1.shorthands.padding(0)), {
|
|
29
|
-
// Match color to Avatar's outline color.
|
|
30
|
-
'@media (forced-colors: active)': tslib_1.__assign({}, react_1.shorthands.borderColor('CanvasText')) }),
|
|
31
|
-
pie: tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorTransparentBackground }, react_1.shorthands.borderColor(react_theme_1.tokens.colorTransparentStroke)), { color: 'transparent' }),
|
|
32
|
-
focusIndicator: react_tabster_1.createCustomFocusIndicatorStyle(tslib_1.__assign({}, react_1.shorthands.border(react_theme_1.tokens.strokeWidthThick, 'solid', react_theme_1.tokens.colorStrokeFocus2))),
|
|
33
|
-
states: {
|
|
34
|
-
'&:hover': tslib_1.__assign({ color: react_theme_1.tokens.colorNeutralForeground1Hover, backgroundColor: react_theme_1.tokens.colorNeutralBackground1Hover }, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStroke1Hover)),
|
|
35
|
-
'&:active': tslib_1.__assign({ color: react_theme_1.tokens.colorNeutralForeground1Pressed, backgroundColor: react_theme_1.tokens.colorNeutralBackground1Pressed }, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStroke1Pressed)),
|
|
36
|
-
},
|
|
37
|
-
selected: tslib_1.__assign({ color: react_theme_1.tokens.colorNeutralForeground1Selected, backgroundColor: react_theme_1.tokens.colorNeutralBackground1Selected }, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStroke1Selected)),
|
|
38
|
-
icon12: { fontSize: '12px' },
|
|
39
|
-
icon16: { fontSize: '16px' },
|
|
40
|
-
icon20: { fontSize: '20px' },
|
|
41
|
-
icon24: { fontSize: '24px' },
|
|
42
|
-
icon28: { fontSize: '28px' },
|
|
43
|
-
icon32: { fontSize: '32px' },
|
|
44
|
-
icon48: { fontSize: '48px' },
|
|
45
|
-
caption2Strong: tslib_1.__assign({}, react_theme_1.typographyStyles.caption2Strong),
|
|
46
|
-
caption1Strong: tslib_1.__assign({}, react_theme_1.typographyStyles.caption1Strong),
|
|
47
|
-
body1Strong: tslib_1.__assign({}, react_theme_1.typographyStyles.body1Strong),
|
|
48
|
-
subtitle2: tslib_1.__assign({}, react_theme_1.typographyStyles.subtitle2),
|
|
49
|
-
subtitle1: tslib_1.__assign({}, react_theme_1.typographyStyles.subtitle1),
|
|
50
|
-
title3: tslib_1.__assign({}, react_theme_1.typographyStyles.title3),
|
|
51
|
-
borderThin: tslib_1.__assign({}, react_1.shorthands.borderWidth(react_theme_1.tokens.strokeWidthThin)),
|
|
52
|
-
borderThick: tslib_1.__assign({}, react_1.shorthands.borderWidth(react_theme_1.tokens.strokeWidthThick)),
|
|
53
|
-
borderThicker: tslib_1.__assign({}, react_1.shorthands.borderWidth(react_theme_1.tokens.strokeWidthThicker)),
|
|
54
|
-
borderThickest: tslib_1.__assign({}, react_1.shorthands.borderWidth(react_theme_1.tokens.strokeWidthThickest)),
|
|
55
|
-
});
|
|
56
|
-
/**
|
|
57
|
-
* Apply styling to the AvatarGroupPopover slots based on the state
|
|
58
|
-
*/
|
|
59
|
-
var useAvatarGroupPopoverStyles_unstable = function (state) {
|
|
60
|
-
var indicator = state.indicator, size = state.size, layout = state.layout, popoverOpen = state.popoverOpen;
|
|
61
|
-
var sizeStyles = useAvatarStyles_1.useSizeStyles();
|
|
62
|
-
var triggerButtonStyles = useTriggerButtonStyles();
|
|
63
|
-
var contentStyles = useContentStyles();
|
|
64
|
-
var popoverSurfaceStyles = usePopoverSurfaceStyles();
|
|
65
|
-
var groupChildClassName = useAvatarGroupItemStyles_1.useGroupChildClassName(layout, size);
|
|
66
|
-
var triggerButtonClasses = [];
|
|
67
|
-
if (size < 36) {
|
|
68
|
-
triggerButtonClasses.push(triggerButtonStyles.borderThin);
|
|
69
|
-
}
|
|
70
|
-
else if (size < 56) {
|
|
71
|
-
triggerButtonClasses.push(triggerButtonStyles.borderThick);
|
|
72
|
-
}
|
|
73
|
-
else if (size < 72) {
|
|
74
|
-
triggerButtonClasses.push(triggerButtonStyles.borderThicker);
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
triggerButtonClasses.push(triggerButtonStyles.borderThickest);
|
|
78
|
-
}
|
|
79
|
-
if (indicator === 'count') {
|
|
80
|
-
if (size <= 24) {
|
|
81
|
-
triggerButtonClasses.push(triggerButtonStyles.caption2Strong);
|
|
82
|
-
}
|
|
83
|
-
else if (size <= 28) {
|
|
84
|
-
triggerButtonClasses.push(triggerButtonStyles.caption1Strong);
|
|
85
|
-
}
|
|
86
|
-
else if (size <= 40) {
|
|
87
|
-
triggerButtonClasses.push(triggerButtonStyles.body1Strong);
|
|
88
|
-
}
|
|
89
|
-
else if (size <= 56) {
|
|
90
|
-
triggerButtonClasses.push(triggerButtonStyles.subtitle2);
|
|
91
|
-
}
|
|
92
|
-
else if (size <= 96) {
|
|
93
|
-
triggerButtonClasses.push(triggerButtonStyles.subtitle1);
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
triggerButtonClasses.push(triggerButtonStyles.title3);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
if (size <= 16) {
|
|
101
|
-
triggerButtonClasses.push(triggerButtonStyles.icon12);
|
|
102
|
-
}
|
|
103
|
-
else if (size <= 24) {
|
|
104
|
-
triggerButtonClasses.push(triggerButtonStyles.icon16);
|
|
105
|
-
}
|
|
106
|
-
else if (size <= 40) {
|
|
107
|
-
triggerButtonClasses.push(triggerButtonStyles.icon20);
|
|
108
|
-
}
|
|
109
|
-
else if (size <= 48) {
|
|
110
|
-
triggerButtonClasses.push(triggerButtonStyles.icon24);
|
|
111
|
-
}
|
|
112
|
-
else if (size <= 56) {
|
|
113
|
-
triggerButtonClasses.push(triggerButtonStyles.icon28);
|
|
114
|
-
}
|
|
115
|
-
else if (size <= 72) {
|
|
116
|
-
triggerButtonClasses.push(triggerButtonStyles.icon32);
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
triggerButtonClasses.push(triggerButtonStyles.icon48);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
state.triggerButton.className = react_1.mergeClasses.apply(void 0, tslib_1.__spreadArray(tslib_1.__spreadArray([exports.avatarGroupPopoverClassNames.triggerButton,
|
|
123
|
-
groupChildClassName,
|
|
124
|
-
sizeStyles[size],
|
|
125
|
-
triggerButtonStyles.base,
|
|
126
|
-
layout === 'pie' && triggerButtonStyles.pie,
|
|
127
|
-
triggerButtonStyles.focusIndicator,
|
|
128
|
-
layout !== 'pie' && triggerButtonStyles.states,
|
|
129
|
-
layout !== 'pie' && popoverOpen && triggerButtonStyles.selected], triggerButtonClasses), [state.triggerButton.className]));
|
|
130
|
-
state.content.className = react_1.mergeClasses(exports.avatarGroupPopoverClassNames.content, contentStyles.base, state.content.className);
|
|
131
|
-
state.popoverSurface.className = react_1.mergeClasses(exports.avatarGroupPopoverClassNames.popoverSurface, popoverSurfaceStyles.base, state.popoverSurface.className);
|
|
132
|
-
return state;
|
|
133
|
-
};
|
|
134
|
-
exports.useAvatarGroupPopoverStyles_unstable = useAvatarGroupPopoverStyles_unstable;
|
|
135
|
-
});
|
|
136
|
-
//# sourceMappingURL=useAvatarGroupPopoverStyles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAvatarGroupPopoverStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-avatar/src/components/AvatarGroupPopover/useAvatarGroupPopoverStyles.ts"],"names":[],"mappings":";;;;IAQa,QAAA,4BAA4B,GAA4C;QACnF,IAAI,EAAE,wBAAwB;QAC9B,OAAO,EAAE,iCAAiC;QAC1C,cAAc,EAAE,wCAAwC;QACxD,OAAO,EAAE,iCAAiC;QAC1C,aAAa,EAAE,uCAAuC;KACvD,CAAC;IAEF;;OAEG;IACH,IAAM,gBAAgB,GAAG,kBAAU,CAAC;QAClC,IAAI,sCACF,aAAa,EAAE,MAAM,IAClB,kBAAU,CAAC,MAAM,CAAC,GAAG,CAAC,GACtB,kBAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAC3B;KACF,CAAC,CAAC;IAEH;;OAEG;IACH,IAAM,uBAAuB,GAAG,kBAAU,CAAC;QACzC,IAAI,uDACF,SAAS,EAAE,OAAO,EAClB,SAAS,EAAE,MAAM,IACd,kBAAU,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,GACvC,kBAAU,CAAC,OAAO,CAAC,oBAAM,CAAC,gBAAgB,EAAE,oBAAM,CAAC,kBAAkB,CAAC,KACzE,KAAK,EAAE,OAAO,GACf;KACF,CAAC,CAAC;IAEH;;OAEG;IACH,IAAM,sBAAsB,GAAG,kBAAU,CAAC;QACxC,IAAI,yFACF,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,UAAU,EACpB,UAAU,EAAE,CAAC,EACb,cAAc,EAAE,QAAQ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EAClB,KAAK,CAAC,OAAO,CAAC,SAAS,CACxB,CAAC;QAEF,KAAK,CAAC,cAAc,CAAC,SAAS,GAAG,oBAAY,CAC3C,oCAA4B,CAAC,cAAc,EAC3C,oBAAoB,CAAC,IAAI,EACzB,KAAK,CAAC,cAAc,CAAC,SAAS,CAC/B,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IA9EW,QAAA,oCAAoC,wCA8E/C","sourcesContent":["import { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { useGroupChildClassName } from '../AvatarGroupItem/useAvatarGroupItemStyles';\nimport { useSizeStyles } from '../Avatar/useAvatarStyles';\nimport type { AvatarGroupPopoverSlots, AvatarGroupPopoverState } from './AvatarGroupPopover.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const avatarGroupPopoverClassNames: SlotClassNames<AvatarGroupPopoverSlots> = {\n root: 'fui-AvatarGroupPopover',\n content: 'fui-AvatarGroupPopover__content',\n popoverSurface: 'fui-AvatarGroupPopover__popoverSurface',\n tooltip: 'fui-AvatarGroupPopover__tooltip',\n triggerButton: 'fui-AvatarGroupPopover__triggerButton',\n};\n\n/**\n * Styles for the content slot.\n */\nconst useContentStyles = makeStyles({\n base: {\n listStyleType: 'none',\n ...shorthands.margin('0'),\n ...shorthands.padding('0'),\n },\n});\n\n/**\n * Styles for the popoverSurface slot.\n */\nconst usePopoverSurfaceStyles = makeStyles({\n base: {\n maxHeight: '220px',\n minHeight: '80px',\n ...shorthands.overflow('hidden', 'scroll'),\n ...shorthands.padding(tokens.spacingVerticalS, tokens.spacingHorizontalS),\n width: '220px',\n },\n});\n\n/**\n * Styles for the triggerButton slot.\n */\nconst useTriggerButtonStyles = makeStyles({\n base: {\n display: 'inline-flex',\n position: 'relative',\n flexShrink: 0,\n justifyContent: 'center',\n alignItems: 'center',\n color: tokens.colorNeutralForeground1,\n backgroundColor: tokens.colorNeutralBackground1,\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n ...shorthands.borderStyle('solid'),\n ...shorthands.padding(0),\n\n // Match color to Avatar's outline color.\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('CanvasText'),\n },\n },\n\n pie: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n color: 'transparent',\n },\n\n focusIndicator: createCustomFocusIndicatorStyle({\n ...shorthands.border(tokens.strokeWidthThick, 'solid', tokens.colorStrokeFocus2),\n }),\n\n states: {\n '&:hover': {\n color: tokens.colorNeutralForeground1Hover,\n backgroundColor: tokens.colorNeutralBackground1Hover,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n },\n '&:active': {\n color: tokens.colorNeutralForeground1Pressed,\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n },\n },\n\n selected: {\n color: tokens.colorNeutralForeground1Selected,\n backgroundColor: tokens.colorNeutralBackground1Selected,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Selected),\n },\n\n icon12: { fontSize: '12px' },\n icon16: { fontSize: '16px' },\n icon20: { fontSize: '20px' },\n icon24: { fontSize: '24px' },\n icon28: { fontSize: '28px' },\n icon32: { fontSize: '32px' },\n icon48: { fontSize: '48px' },\n caption2Strong: { ...typographyStyles.caption2Strong },\n caption1Strong: { ...typographyStyles.caption1Strong },\n body1Strong: { ...typographyStyles.body1Strong },\n subtitle2: { ...typographyStyles.subtitle2 },\n subtitle1: { ...typographyStyles.subtitle1 },\n title3: { ...typographyStyles.title3 },\n borderThin: { ...shorthands.borderWidth(tokens.strokeWidthThin) },\n borderThick: { ...shorthands.borderWidth(tokens.strokeWidthThick) },\n borderThicker: { ...shorthands.borderWidth(tokens.strokeWidthThicker) },\n borderThickest: { ...shorthands.borderWidth(tokens.strokeWidthThickest) },\n});\n\n/**\n * Apply styling to the AvatarGroupPopover slots based on the state\n */\nexport const useAvatarGroupPopoverStyles_unstable = (state: AvatarGroupPopoverState): AvatarGroupPopoverState => {\n const { indicator, size, layout, popoverOpen } = state;\n const sizeStyles = useSizeStyles();\n const triggerButtonStyles = useTriggerButtonStyles();\n const contentStyles = useContentStyles();\n const popoverSurfaceStyles = usePopoverSurfaceStyles();\n const groupChildClassName = useGroupChildClassName(layout, size);\n\n const triggerButtonClasses = [];\n\n if (size < 36) {\n triggerButtonClasses.push(triggerButtonStyles.borderThin);\n } else if (size < 56) {\n triggerButtonClasses.push(triggerButtonStyles.borderThick);\n } else if (size < 72) {\n triggerButtonClasses.push(triggerButtonStyles.borderThicker);\n } else {\n triggerButtonClasses.push(triggerButtonStyles.borderThickest);\n }\n\n if (indicator === 'count') {\n if (size <= 24) {\n triggerButtonClasses.push(triggerButtonStyles.caption2Strong);\n } else if (size <= 28) {\n triggerButtonClasses.push(triggerButtonStyles.caption1Strong);\n } else if (size <= 40) {\n triggerButtonClasses.push(triggerButtonStyles.body1Strong);\n } else if (size <= 56) {\n triggerButtonClasses.push(triggerButtonStyles.subtitle2);\n } else if (size <= 96) {\n triggerButtonClasses.push(triggerButtonStyles.subtitle1);\n } else {\n triggerButtonClasses.push(triggerButtonStyles.title3);\n }\n } else {\n if (size <= 16) {\n triggerButtonClasses.push(triggerButtonStyles.icon12);\n } else if (size <= 24) {\n triggerButtonClasses.push(triggerButtonStyles.icon16);\n } else if (size <= 40) {\n triggerButtonClasses.push(triggerButtonStyles.icon20);\n } else if (size <= 48) {\n triggerButtonClasses.push(triggerButtonStyles.icon24);\n } else if (size <= 56) {\n triggerButtonClasses.push(triggerButtonStyles.icon28);\n } else if (size <= 72) {\n triggerButtonClasses.push(triggerButtonStyles.icon32);\n } else {\n triggerButtonClasses.push(triggerButtonStyles.icon48);\n }\n }\n\n state.triggerButton.className = mergeClasses(\n avatarGroupPopoverClassNames.triggerButton,\n groupChildClassName,\n sizeStyles[size],\n triggerButtonStyles.base,\n layout === 'pie' && triggerButtonStyles.pie,\n triggerButtonStyles.focusIndicator,\n layout !== 'pie' && triggerButtonStyles.states,\n layout !== 'pie' && popoverOpen && triggerButtonStyles.selected,\n ...triggerButtonClasses,\n state.triggerButton.className,\n );\n\n state.content.className = mergeClasses(\n avatarGroupPopoverClassNames.content,\n contentStyles.base,\n state.content.className,\n );\n\n state.popoverSurface.className = mergeClasses(\n avatarGroupPopoverClassNames.popoverSurface,\n popoverSurfaceStyles.base,\n state.popoverSurface.className,\n );\n\n return state;\n};\n"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "react"], function (require, exports, React) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.useAvatarContext = exports.AvatarContextProvider = void 0;
|
|
5
|
-
var avatarContext = React.createContext(undefined);
|
|
6
|
-
var avatarContextDefaultValue = {};
|
|
7
|
-
/**
|
|
8
|
-
* @internal
|
|
9
|
-
*/
|
|
10
|
-
exports.AvatarContextProvider = avatarContext.Provider;
|
|
11
|
-
/**
|
|
12
|
-
* @internal
|
|
13
|
-
*/
|
|
14
|
-
var useAvatarContext = function () { var _a; return (_a = React.useContext(avatarContext)) !== null && _a !== void 0 ? _a : avatarContextDefaultValue; };
|
|
15
|
-
exports.useAvatarContext = useAvatarContext;
|
|
16
|
-
});
|
|
17
|
-
//# sourceMappingURL=AvatarContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarContext.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-avatar/src/contexts/AvatarContext.ts"],"names":[],"mappings":";;;;IAGA,IAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAiC,SAAS,CAAC,CAAC;IASrF,IAAM,yBAAyB,GAAuB,EAAE,CAAC;IAEzD;;OAEG;IACU,QAAA,qBAAqB,GAAG,aAAa,CAAC,QAAQ,CAAC;IAE5D;;OAEG;IACI,IAAM,gBAAgB,GAAG,sBAAM,OAAA,MAAA,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,mCAAI,yBAAyB,CAAA,EAAA,CAAC;IAAtF,QAAA,gBAAgB,oBAAsE","sourcesContent":["import * as React from 'react';\nimport { AvatarSize } from '../components/Avatar/Avatar.types';\n\nconst avatarContext = React.createContext<AvatarContextValue | undefined>(undefined);\n\n/**\n * @internal\n */\nexport interface AvatarContextValue {\n size?: AvatarSize;\n}\n\nconst avatarContextDefaultValue: AvatarContextValue = {};\n\n/**\n * @internal\n */\nexport const AvatarContextProvider = avatarContext.Provider;\n\n/**\n * @internal\n */\nexport const useAvatarContext = () => React.useContext(avatarContext) ?? avatarContextDefaultValue;\n"]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "@fluentui/react-context-selector"], function (require, exports, react_context_selector_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.useAvatarGroupContext_unstable = exports.AvatarGroupProvider = exports.AvatarGroupContext = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* AvatarGroupContext is provided by AvatarGroup and AvatarGroupPopover. It's consumed by AvatarGroupItem to determine
|
|
7
|
-
* default values of some props.
|
|
8
|
-
*/
|
|
9
|
-
exports.AvatarGroupContext = react_context_selector_1.createContext(undefined);
|
|
10
|
-
var avatarGroupContextDefaultValue = {};
|
|
11
|
-
exports.AvatarGroupProvider = exports.AvatarGroupContext.Provider;
|
|
12
|
-
var useAvatarGroupContext_unstable = function (selector) {
|
|
13
|
-
return react_context_selector_1.useContextSelector(exports.AvatarGroupContext, function (ctx) {
|
|
14
|
-
if (ctx === void 0) { ctx = avatarGroupContextDefaultValue; }
|
|
15
|
-
return selector(ctx);
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
exports.useAvatarGroupContext_unstable = useAvatarGroupContext_unstable;
|
|
19
|
-
});
|
|
20
|
-
//# sourceMappingURL=AvatarGroupContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarGroupContext.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-avatar/src/contexts/AvatarGroupContext.ts"],"names":[],"mappings":";;;;IAIA;;;OAGG;IACU,QAAA,kBAAkB,GAAqC,sCAAa,CAC/E,SAAS,CAC0B,CAAC;IAEtC,IAAM,8BAA8B,GAA4B,EAAE,CAAC;IAEtD,QAAA,mBAAmB,GAAG,0BAAkB,CAAC,QAAQ,CAAC;IAExD,IAAM,8BAA8B,GAAG,UAAI,QAAqD;QACrG,OAAA,2CAAkB,CAAC,0BAAkB,EAAE,UAAC,GAAoC;YAApC,oBAAA,EAAA,oCAAoC;YAAK,OAAA,QAAQ,CAAC,GAAG,CAAC;QAAb,CAAa,CAAC;IAA/F,CAA+F,CAAC;IADrF,QAAA,8BAA8B,kCACuD","sourcesContent":["import { createContext, useContextSelector, ContextSelector } from '@fluentui/react-context-selector';\nimport type { Context } from '@fluentui/react-context-selector';\nimport type { AvatarGroupContextValue } from '../AvatarGroup';\n\n/**\n * AvatarGroupContext is provided by AvatarGroup and AvatarGroupPopover. It's consumed by AvatarGroupItem to determine\n * default values of some props.\n */\nexport const AvatarGroupContext: Context<AvatarGroupContextValue> = createContext<AvatarGroupContextValue | undefined>(\n undefined,\n) as Context<AvatarGroupContextValue>;\n\nconst avatarGroupContextDefaultValue: AvatarGroupContextValue = {};\n\nexport const AvatarGroupProvider = AvatarGroupContext.Provider;\n\nexport const useAvatarGroupContext_unstable = <T>(selector: ContextSelector<AvatarGroupContextValue, T>): T =>\n useContextSelector(AvatarGroupContext, (ctx = avatarGroupContextDefaultValue) => selector(ctx));\n"]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "./AvatarGroupContext", "./AvatarContext"], function (require, exports, tslib_1, AvatarGroupContext_1, AvatarContext_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
tslib_1.__exportStar(AvatarGroupContext_1, exports);
|
|
5
|
-
tslib_1.__exportStar(AvatarContext_1, exports);
|
|
6
|
-
});
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-avatar/src/contexts/index.ts"],"names":[],"mappings":";;;IAAA,oDAAqC;IACrC,+CAAgC","sourcesContent":["export * from './AvatarGroupContext';\nexport * from './AvatarContext';\n"]}
|
package/lib-amd/index.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "./Avatar", "./utils/index", "./AvatarGroup", "./AvatarGroupItem", "./AvatarGroupPopover", "./contexts/index"], function (require, exports, Avatar_1, index_1, AvatarGroup_1, AvatarGroupItem_1, AvatarGroupPopover_1, index_2) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.useAvatarGroupContext_unstable = exports.useAvatarContext = exports.AvatarGroupProvider = exports.AvatarContextProvider = exports.useAvatarGroupPopover_unstable = exports.useAvatarGroupPopoverStyles_unstable = exports.renderAvatarGroupPopover_unstable = exports.avatarGroupPopoverClassNames = exports.AvatarGroupPopover = exports.useAvatarGroupItem_unstable = exports.useAvatarGroupItemStyles_unstable = exports.renderAvatarGroupItem_unstable = exports.avatarGroupItemClassNames = exports.AvatarGroupItem = exports.useAvatarGroup_unstable = exports.useAvatarGroupStyles_unstable = exports.useAvatarGroupContextValues = exports.renderAvatarGroup_unstable = exports.avatarGroupClassNames = exports.AvatarGroup = exports.partitionAvatarGroupItems = exports.getInitials = exports.useAvatar_unstable = exports.useAvatarStyles_unstable = exports.renderAvatar_unstable = exports.avatarClassNames = exports.Avatar = void 0;
|
|
5
|
-
Object.defineProperty(exports, "Avatar", { enumerable: true, get: function () { return Avatar_1.Avatar; } });
|
|
6
|
-
Object.defineProperty(exports, "avatarClassNames", { enumerable: true, get: function () { return Avatar_1.avatarClassNames; } });
|
|
7
|
-
Object.defineProperty(exports, "renderAvatar_unstable", { enumerable: true, get: function () { return Avatar_1.renderAvatar_unstable; } });
|
|
8
|
-
Object.defineProperty(exports, "useAvatarStyles_unstable", { enumerable: true, get: function () { return Avatar_1.useAvatarStyles_unstable; } });
|
|
9
|
-
Object.defineProperty(exports, "useAvatar_unstable", { enumerable: true, get: function () { return Avatar_1.useAvatar_unstable; } });
|
|
10
|
-
Object.defineProperty(exports, "getInitials", { enumerable: true, get: function () { return index_1.getInitials; } });
|
|
11
|
-
Object.defineProperty(exports, "partitionAvatarGroupItems", { enumerable: true, get: function () { return index_1.partitionAvatarGroupItems; } });
|
|
12
|
-
Object.defineProperty(exports, "AvatarGroup", { enumerable: true, get: function () { return AvatarGroup_1.AvatarGroup; } });
|
|
13
|
-
Object.defineProperty(exports, "avatarGroupClassNames", { enumerable: true, get: function () { return AvatarGroup_1.avatarGroupClassNames; } });
|
|
14
|
-
Object.defineProperty(exports, "renderAvatarGroup_unstable", { enumerable: true, get: function () { return AvatarGroup_1.renderAvatarGroup_unstable; } });
|
|
15
|
-
Object.defineProperty(exports, "useAvatarGroupContextValues", { enumerable: true, get: function () { return AvatarGroup_1.useAvatarGroupContextValues; } });
|
|
16
|
-
Object.defineProperty(exports, "useAvatarGroupStyles_unstable", { enumerable: true, get: function () { return AvatarGroup_1.useAvatarGroupStyles_unstable; } });
|
|
17
|
-
Object.defineProperty(exports, "useAvatarGroup_unstable", { enumerable: true, get: function () { return AvatarGroup_1.useAvatarGroup_unstable; } });
|
|
18
|
-
Object.defineProperty(exports, "AvatarGroupItem", { enumerable: true, get: function () { return AvatarGroupItem_1.AvatarGroupItem; } });
|
|
19
|
-
Object.defineProperty(exports, "avatarGroupItemClassNames", { enumerable: true, get: function () { return AvatarGroupItem_1.avatarGroupItemClassNames; } });
|
|
20
|
-
Object.defineProperty(exports, "renderAvatarGroupItem_unstable", { enumerable: true, get: function () { return AvatarGroupItem_1.renderAvatarGroupItem_unstable; } });
|
|
21
|
-
Object.defineProperty(exports, "useAvatarGroupItemStyles_unstable", { enumerable: true, get: function () { return AvatarGroupItem_1.useAvatarGroupItemStyles_unstable; } });
|
|
22
|
-
Object.defineProperty(exports, "useAvatarGroupItem_unstable", { enumerable: true, get: function () { return AvatarGroupItem_1.useAvatarGroupItem_unstable; } });
|
|
23
|
-
Object.defineProperty(exports, "AvatarGroupPopover", { enumerable: true, get: function () { return AvatarGroupPopover_1.AvatarGroupPopover; } });
|
|
24
|
-
Object.defineProperty(exports, "avatarGroupPopoverClassNames", { enumerable: true, get: function () { return AvatarGroupPopover_1.avatarGroupPopoverClassNames; } });
|
|
25
|
-
Object.defineProperty(exports, "renderAvatarGroupPopover_unstable", { enumerable: true, get: function () { return AvatarGroupPopover_1.renderAvatarGroupPopover_unstable; } });
|
|
26
|
-
Object.defineProperty(exports, "useAvatarGroupPopoverStyles_unstable", { enumerable: true, get: function () { return AvatarGroupPopover_1.useAvatarGroupPopoverStyles_unstable; } });
|
|
27
|
-
Object.defineProperty(exports, "useAvatarGroupPopover_unstable", { enumerable: true, get: function () { return AvatarGroupPopover_1.useAvatarGroupPopover_unstable; } });
|
|
28
|
-
Object.defineProperty(exports, "AvatarContextProvider", { enumerable: true, get: function () { return index_2.AvatarContextProvider; } });
|
|
29
|
-
Object.defineProperty(exports, "AvatarGroupProvider", { enumerable: true, get: function () { return index_2.AvatarGroupProvider; } });
|
|
30
|
-
Object.defineProperty(exports, "useAvatarContext", { enumerable: true, get: function () { return index_2.useAvatarContext; } });
|
|
31
|
-
Object.defineProperty(exports, "useAvatarGroupContext_unstable", { enumerable: true, get: function () { return index_2.useAvatarGroupContext_unstable; } });
|
|
32
|
-
});
|
|
33
|
-
//# sourceMappingURL=index.js.map
|
package/lib-amd/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-avatar/src/index.ts"],"names":[],"mappings":";;;;IACE,gGAAA,MAAM,OAAA;IACN,0GAAA,gBAAgB,OAAA;IAChB,+GAAA,qBAAqB,OAAA;IACrB,kHAAA,wBAAwB,OAAA;IACxB,4GAAA,kBAAkB,OAAA;IAIX,oGAAA,WAAW,OAAA;IAAE,kHAAA,yBAAyB,OAAA;IAG7C,0GAAA,WAAW,OAAA;IACX,oHAAA,qBAAqB,OAAA;IACrB,yHAAA,0BAA0B,OAAA;IAC1B,0HAAA,2BAA2B,OAAA;IAC3B,4HAAA,6BAA6B,OAAA;IAC7B,sHAAA,uBAAuB,OAAA;IAUvB,kHAAA,eAAe,OAAA;IACf,4HAAA,yBAAyB,OAAA;IACzB,iIAAA,8BAA8B,OAAA;IAC9B,oIAAA,iCAAiC,OAAA;IACjC,8HAAA,2BAA2B,OAAA;IAI3B,wHAAA,kBAAkB,OAAA;IAClB,kIAAA,4BAA4B,OAAA;IAC5B,uIAAA,iCAAiC,OAAA;IACjC,0IAAA,oCAAoC,OAAA;IACpC,oIAAA,8BAA8B,OAAA;IAI9B,8GAAA,qBAAqB,OAAA;IACrB,4GAAA,mBAAmB,OAAA;IACnB,yGAAA,gBAAgB,OAAA;IAChB,uHAAA,8BAA8B,OAAA","sourcesContent":["export {\n Avatar,\n avatarClassNames,\n renderAvatar_unstable,\n useAvatarStyles_unstable,\n useAvatar_unstable,\n} from './Avatar';\n// eslint-disable-next-line deprecation/deprecation\nexport type { AvatarNamedColor, AvatarProps, AvatarSlots, AvatarState, AvatarSizes, AvatarSize } from './Avatar';\nexport { getInitials, partitionAvatarGroupItems } from './utils/index';\nexport type { PartitionAvatarGroupItems, PartitionAvatarGroupItemsOptions } from './utils/index';\nexport {\n AvatarGroup,\n avatarGroupClassNames,\n renderAvatarGroup_unstable,\n useAvatarGroupContextValues,\n useAvatarGroupStyles_unstable,\n useAvatarGroup_unstable,\n} from './AvatarGroup';\nexport type {\n AvatarGroupProps,\n AvatarGroupSlots,\n AvatarGroupState,\n AvatarGroupContextValue,\n AvatarGroupContextValues,\n} from './AvatarGroup';\nexport {\n AvatarGroupItem,\n avatarGroupItemClassNames,\n renderAvatarGroupItem_unstable,\n useAvatarGroupItemStyles_unstable,\n useAvatarGroupItem_unstable,\n} from './AvatarGroupItem';\nexport type { AvatarGroupItemProps, AvatarGroupItemSlots, AvatarGroupItemState } from './AvatarGroupItem';\nexport {\n AvatarGroupPopover,\n avatarGroupPopoverClassNames,\n renderAvatarGroupPopover_unstable,\n useAvatarGroupPopoverStyles_unstable,\n useAvatarGroupPopover_unstable,\n} from './AvatarGroupPopover';\nexport type { AvatarGroupPopoverProps, AvatarGroupPopoverSlots, AvatarGroupPopoverState } from './AvatarGroupPopover';\nexport {\n AvatarContextProvider,\n AvatarGroupProvider,\n useAvatarContext,\n useAvatarGroupContext_unstable,\n} from './contexts/index';\nexport type { AvatarContextValue } from './contexts/index';\n"]}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Regular expressions matching characters to ignore when calculating the initials.
|
|
3
|
-
*/
|
|
4
|
-
define(["require", "exports"], function (require, exports) {
|
|
5
|
-
"use strict";
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.getInitials = void 0;
|
|
8
|
-
/**
|
|
9
|
-
* Regular expression matching characters within various types of enclosures, including the enclosures themselves
|
|
10
|
-
* so for example, (xyz) [xyz] {xyz} all would be ignored
|
|
11
|
-
*/
|
|
12
|
-
var UNWANTED_ENCLOSURES_REGEX = /[\(\[\{][^\)\]\}]*[\)\]\}]/g;
|
|
13
|
-
/**
|
|
14
|
-
* Regular expression matching special ASCII characters except space, plus some unicode special characters.
|
|
15
|
-
* Applies after unwanted enclosures have been removed
|
|
16
|
-
*/
|
|
17
|
-
var UNWANTED_CHARS_REGEX = /[\0-\u001F\!-/:-@\[-`\{-\u00BF\u0250-\u036F\uD800-\uFFFF]/g;
|
|
18
|
-
/**
|
|
19
|
-
* Regular expression matching phone numbers. Applied after chars matching UNWANTED_CHARS_REGEX have been removed
|
|
20
|
-
* and number has been trimmed for whitespaces
|
|
21
|
-
*/
|
|
22
|
-
var PHONENUMBER_REGEX = /^\d+[\d\s]*(:?ext|x|)\s*\d+$/i;
|
|
23
|
-
/** Regular expression matching one or more spaces. */
|
|
24
|
-
var MULTIPLE_WHITESPACES_REGEX = /\s+/g;
|
|
25
|
-
/**
|
|
26
|
-
* Regular expression matching languages for which we currently don't support initials.
|
|
27
|
-
* Arabic: Arabic, Arabic Supplement, Arabic Extended-A.
|
|
28
|
-
* Korean: Hangul Jamo, Hangul Compatibility Jamo, Hangul Jamo Extended-A, Hangul Syllables, Hangul Jamo Extended-B.
|
|
29
|
-
* Japanese: Hiragana, Katakana.
|
|
30
|
-
* CJK: CJK Unified Ideographs Extension A, CJK Unified Ideographs, CJK Compatibility Ideographs,
|
|
31
|
-
* CJK Unified Ideographs Extension B
|
|
32
|
-
*/
|
|
33
|
-
// eslint-disable-next-line @fluentui/max-len
|
|
34
|
-
var UNSUPPORTED_TEXT_REGEX = /[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\u1100-\u11FF\u3130-\u318F\uA960-\uA97F\uAC00-\uD7AF\uD7B0-\uD7FF\u3040-\u309F\u30A0-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFAFF]|[\uD840-\uD869][\uDC00-\uDED6]/;
|
|
35
|
-
function getInitialsLatin(displayName, isRtl, firstInitialOnly) {
|
|
36
|
-
var initials = '';
|
|
37
|
-
var splits = displayName.split(' ');
|
|
38
|
-
if (splits.length !== 0) {
|
|
39
|
-
initials += splits[0].charAt(0).toUpperCase();
|
|
40
|
-
}
|
|
41
|
-
if (!firstInitialOnly) {
|
|
42
|
-
if (splits.length === 2) {
|
|
43
|
-
initials += splits[1].charAt(0).toUpperCase();
|
|
44
|
-
}
|
|
45
|
-
else if (splits.length === 3) {
|
|
46
|
-
initials += splits[2].charAt(0).toUpperCase();
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
if (isRtl && initials.length > 1) {
|
|
50
|
-
return initials.charAt(1) + initials.charAt(0);
|
|
51
|
-
}
|
|
52
|
-
return initials;
|
|
53
|
-
}
|
|
54
|
-
function cleanupDisplayName(displayName) {
|
|
55
|
-
displayName = displayName.replace(UNWANTED_ENCLOSURES_REGEX, '');
|
|
56
|
-
displayName = displayName.replace(UNWANTED_CHARS_REGEX, '');
|
|
57
|
-
displayName = displayName.replace(MULTIPLE_WHITESPACES_REGEX, ' ');
|
|
58
|
-
displayName = displayName.trim();
|
|
59
|
-
return displayName;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Get (up to 2 characters) initials based on display name of the persona.
|
|
63
|
-
*
|
|
64
|
-
* @param displayName - The full name of the person or entity
|
|
65
|
-
* @param isRtl - Whether the display is in RTL
|
|
66
|
-
* @param options - Extra options to control the behavior of getInitials
|
|
67
|
-
*
|
|
68
|
-
* @returns The 1 or 2 character initials based on the name. Or an empty string if no initials
|
|
69
|
-
* could be derived from the name.
|
|
70
|
-
*
|
|
71
|
-
* @internal
|
|
72
|
-
*/
|
|
73
|
-
function getInitials(displayName, isRtl, options) {
|
|
74
|
-
if (!displayName) {
|
|
75
|
-
return '';
|
|
76
|
-
}
|
|
77
|
-
displayName = cleanupDisplayName(displayName);
|
|
78
|
-
// For names containing CJK characters, and phone numbers, we don't display initials
|
|
79
|
-
if (UNSUPPORTED_TEXT_REGEX.test(displayName) ||
|
|
80
|
-
(!(options === null || options === void 0 ? void 0 : options.allowPhoneInitials) && PHONENUMBER_REGEX.test(displayName))) {
|
|
81
|
-
return '';
|
|
82
|
-
}
|
|
83
|
-
return getInitialsLatin(displayName, isRtl, options === null || options === void 0 ? void 0 : options.firstInitialOnly);
|
|
84
|
-
}
|
|
85
|
-
exports.getInitials = getInitials;
|
|
86
|
-
});
|
|
87
|
-
//# sourceMappingURL=getInitials.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getInitials.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-avatar/src/utils/getInitials.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;IAEH;;;OAGG;IACH,IAAM,yBAAyB,GAAW,6BAA6B,CAAC;IAExE;;;OAGG;IACH,IAAM,oBAAoB,GAAW,4DAA4D,CAAC;IAElG;;;OAGG;IACH,IAAM,iBAAiB,GAAW,+BAA+B,CAAC;IAElE,sDAAsD;IACtD,IAAM,0BAA0B,GAAW,MAAM,CAAC;IAElD;;;;;;;OAOG;IACH,6CAA6C;IAC7C,IAAM,sBAAsB,GAC1B,4MAA4M,CAAC;IAE/M,SAAS,gBAAgB,CAAC,WAAmB,EAAE,KAAc,EAAE,gBAA0B;QACvF,IAAI,QAAQ,GAAG,EAAE,CAAC;QAElB,IAAM,MAAM,GAAa,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAChD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;YACvB,QAAQ,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;SAC/C;QAED,IAAI,CAAC,gBAAgB,EAAE;YACrB,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;gBACvB,QAAQ,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;aAC/C;iBAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC9B,QAAQ,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;aAC/C;SACF;QAED,IAAI,KAAK,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;YAChC,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;SAChD;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,SAAS,kBAAkB,CAAC,WAAmB;QAC7C,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,yBAAyB,EAAE,EAAE,CAAC,CAAC;QACjE,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;QAC5D,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,0BAA0B,EAAE,GAAG,CAAC,CAAC;QACnE,WAAW,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC;QAEjC,OAAO,WAAW,CAAC;IACrB,CAAC;IAED;;;;;;;;;;;OAWG;IACH,SAAgB,WAAW,CACzB,WAAsC,EACtC,KAAc,EACd,OAMC;QAED,IAAI,CAAC,WAAW,EAAE;YAChB,OAAO,EAAE,CAAC;SACX;QAED,WAAW,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC;QAE9C,oFAAoF;QACpF,IACE,sBAAsB,CAAC,IAAI,CAAC,WAAW,CAAC;YACxC,CAAC,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,kBAAkB,CAAA,IAAI,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,EACrE;YACA,OAAO,EAAE,CAAC;SACX;QAED,OAAO,gBAAgB,CAAC,WAAW,EAAE,KAAK,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,gBAAgB,CAAC,CAAC;IACzE,CAAC;IA1BD,kCA0BC","sourcesContent":["/**\n * Regular expressions matching characters to ignore when calculating the initials.\n */\n\n/**\n * Regular expression matching characters within various types of enclosures, including the enclosures themselves\n * so for example, (xyz) [xyz] {xyz} all would be ignored\n */\nconst UNWANTED_ENCLOSURES_REGEX: RegExp = /[\\(\\[\\{][^\\)\\]\\}]*[\\)\\]\\}]/g;\n\n/**\n * Regular expression matching special ASCII characters except space, plus some unicode special characters.\n * Applies after unwanted enclosures have been removed\n */\nconst UNWANTED_CHARS_REGEX: RegExp = /[\\0-\\u001F\\!-/:-@\\[-`\\{-\\u00BF\\u0250-\\u036F\\uD800-\\uFFFF]/g;\n\n/**\n * Regular expression matching phone numbers. Applied after chars matching UNWANTED_CHARS_REGEX have been removed\n * and number has been trimmed for whitespaces\n */\nconst PHONENUMBER_REGEX: RegExp = /^\\d+[\\d\\s]*(:?ext|x|)\\s*\\d+$/i;\n\n/** Regular expression matching one or more spaces. */\nconst MULTIPLE_WHITESPACES_REGEX: RegExp = /\\s+/g;\n\n/**\n * Regular expression matching languages for which we currently don't support initials.\n * Arabic: Arabic, Arabic Supplement, Arabic Extended-A.\n * Korean: Hangul Jamo, Hangul Compatibility Jamo, Hangul Jamo Extended-A, Hangul Syllables, Hangul Jamo Extended-B.\n * Japanese: Hiragana, Katakana.\n * CJK: CJK Unified Ideographs Extension A, CJK Unified Ideographs, CJK Compatibility Ideographs,\n * CJK Unified Ideographs Extension B\n */\n// eslint-disable-next-line @fluentui/max-len\nconst UNSUPPORTED_TEXT_REGEX: RegExp =\n /[\\u0600-\\u06FF\\u0750-\\u077F\\u08A0-\\u08FF\\u1100-\\u11FF\\u3130-\\u318F\\uA960-\\uA97F\\uAC00-\\uD7AF\\uD7B0-\\uD7FF\\u3040-\\u309F\\u30A0-\\u30FF\\u3400-\\u4DBF\\u4E00-\\u9FFF\\uF900-\\uFAFF]|[\\uD840-\\uD869][\\uDC00-\\uDED6]/;\n\nfunction getInitialsLatin(displayName: string, isRtl: boolean, firstInitialOnly?: boolean): string {\n let initials = '';\n\n const splits: string[] = displayName.split(' ');\n if (splits.length !== 0) {\n initials += splits[0].charAt(0).toUpperCase();\n }\n\n if (!firstInitialOnly) {\n if (splits.length === 2) {\n initials += splits[1].charAt(0).toUpperCase();\n } else if (splits.length === 3) {\n initials += splits[2].charAt(0).toUpperCase();\n }\n }\n\n if (isRtl && initials.length > 1) {\n return initials.charAt(1) + initials.charAt(0);\n }\n\n return initials;\n}\n\nfunction cleanupDisplayName(displayName: string): string {\n displayName = displayName.replace(UNWANTED_ENCLOSURES_REGEX, '');\n displayName = displayName.replace(UNWANTED_CHARS_REGEX, '');\n displayName = displayName.replace(MULTIPLE_WHITESPACES_REGEX, ' ');\n displayName = displayName.trim();\n\n return displayName;\n}\n\n/**\n * Get (up to 2 characters) initials based on display name of the persona.\n *\n * @param displayName - The full name of the person or entity\n * @param isRtl - Whether the display is in RTL\n * @param options - Extra options to control the behavior of getInitials\n *\n * @returns The 1 or 2 character initials based on the name. Or an empty string if no initials\n * could be derived from the name.\n *\n * @internal\n */\nexport function getInitials(\n displayName: string | undefined | null,\n isRtl: boolean,\n options?: {\n /** Should initials be generated from phone numbers (default false) */\n allowPhoneInitials?: boolean;\n\n /** Returns only the first initial */\n firstInitialOnly?: boolean;\n },\n): string {\n if (!displayName) {\n return '';\n }\n\n displayName = cleanupDisplayName(displayName);\n\n // For names containing CJK characters, and phone numbers, we don't display initials\n if (\n UNSUPPORTED_TEXT_REGEX.test(displayName) ||\n (!options?.allowPhoneInitials && PHONENUMBER_REGEX.test(displayName))\n ) {\n return '';\n }\n\n return getInitialsLatin(displayName, isRtl, options?.firstInitialOnly);\n}\n"]}
|
package/lib-amd/utils/index.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "./getInitials", "./partitionAvatarGroupItems"], function (require, exports, getInitials_1, partitionAvatarGroupItems_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.partitionAvatarGroupItems = exports.getInitials = void 0;
|
|
5
|
-
Object.defineProperty(exports, "getInitials", { enumerable: true, get: function () { return getInitials_1.getInitials; } });
|
|
6
|
-
Object.defineProperty(exports, "partitionAvatarGroupItems", { enumerable: true, get: function () { return partitionAvatarGroupItems_1.partitionAvatarGroupItems; } });
|
|
7
|
-
});
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-avatar/src/utils/index.ts"],"names":[],"mappings":";;;;IAAS,0GAAA,WAAW,OAAA;IACX,sIAAA,yBAAyB,OAAA","sourcesContent":["export { getInitials } from './getInitials';\nexport { partitionAvatarGroupItems } from './partitionAvatarGroupItems';\nexport type { PartitionAvatarGroupItems, PartitionAvatarGroupItemsOptions } from './partitionAvatarGroupItems';\n"]}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
define(["require", "exports"], function (require, exports) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.partitionAvatarGroupItems = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* Get the inline items and overflowing items based on the array of AvatarGroupItems needed for AvatarGroup.
|
|
7
|
-
*
|
|
8
|
-
* @param options - Configure the partition options
|
|
9
|
-
*
|
|
10
|
-
* @returns Two arrays split into inline items and overflow items based on maxInlineItems.
|
|
11
|
-
*/
|
|
12
|
-
var partitionAvatarGroupItems = function (options) {
|
|
13
|
-
var _a;
|
|
14
|
-
var items = options.items;
|
|
15
|
-
var isPie = options.layout === 'pie';
|
|
16
|
-
if (isPie) {
|
|
17
|
-
return {
|
|
18
|
-
inlineItems: items.slice(0, 3),
|
|
19
|
-
overflowItems: items.length > 0 ? items : undefined,
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
var maxInlineItems = (_a = options.maxInlineItems) !== null && _a !== void 0 ? _a : 5;
|
|
23
|
-
var inlineCount = -(maxInlineItems - (items.length > maxInlineItems ? 1 : 0));
|
|
24
|
-
var overflowItems = items.slice(0, inlineCount);
|
|
25
|
-
return {
|
|
26
|
-
inlineItems: items.slice(inlineCount),
|
|
27
|
-
overflowItems: overflowItems.length > 0 ? overflowItems : undefined,
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
exports.partitionAvatarGroupItems = partitionAvatarGroupItems;
|
|
31
|
-
});
|
|
32
|
-
//# sourceMappingURL=partitionAvatarGroupItems.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"partitionAvatarGroupItems.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-avatar/src/utils/partitionAvatarGroupItems.ts"],"names":[],"mappings":";;;;IAWA;;;;;;OAMG;IACI,IAAM,yBAAyB,GAAG,UACvC,OAA4C;;QAEpC,IAAA,KAAK,GAAK,OAAO,MAAZ,CAAa;QAC1B,IAAM,KAAK,GAAG,OAAO,CAAC,MAAM,KAAK,KAAK,CAAC;QAEvC,IAAI,KAAK,EAAE;YACT,OAAO;gBACL,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;gBAC9B,aAAa,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;aACpD,CAAC;SACH;QAED,IAAM,cAAc,GAAG,MAAA,OAAO,CAAC,cAAc,mCAAI,CAAC,CAAC;QACnD,IAAM,WAAW,GAAG,CAAC,CAAC,cAAc,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAChF,IAAM,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;QAElD,OAAO;YACL,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC;YACrC,aAAa,EAAE,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS;SACpE,CAAC;IACJ,CAAC,CAAC;IArBW,QAAA,yBAAyB,6BAqBpC","sourcesContent":["export type PartitionAvatarGroupItemsOptions<T> = {\n items: readonly T[];\n layout?: 'spread' | 'stack' | 'pie';\n maxInlineItems?: number;\n};\n\nexport type PartitionAvatarGroupItems<T> = {\n inlineItems: readonly T[];\n overflowItems?: readonly T[];\n};\n\n/**\n * Get the inline items and overflowing items based on the array of AvatarGroupItems needed for AvatarGroup.\n *\n * @param options - Configure the partition options\n *\n * @returns Two arrays split into inline items and overflow items based on maxInlineItems.\n */\nexport const partitionAvatarGroupItems = <T>(\n options: PartitionAvatarGroupItemsOptions<T>,\n): PartitionAvatarGroupItems<T> => {\n const { items } = options;\n const isPie = options.layout === 'pie';\n\n if (isPie) {\n return {\n inlineItems: items.slice(0, 3),\n overflowItems: items.length > 0 ? items : undefined,\n };\n }\n\n const maxInlineItems = options.maxInlineItems ?? 5;\n const inlineCount = -(maxInlineItems - (items.length > maxInlineItems ? 1 : 0));\n const overflowItems = items.slice(0, inlineCount);\n\n return {\n inlineItems: items.slice(inlineCount),\n overflowItems: overflowItems.length > 0 ? overflowItems : undefined,\n };\n};\n"]}
|