@fluentui/react-avatar 9.0.0-rc.7 → 9.0.0
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 +562 -1
- package/CHANGELOG.md +136 -2
- package/dist/index.d.ts +161 -99
- package/{lib → dist}/tsdoc-metadata.json +0 -0
- package/lib/AvatarGroupItem.js +2 -0
- package/lib/AvatarGroupItem.js.map +1 -0
- package/lib/components/Avatar/Avatar.js.map +1 -1
- package/lib/components/Avatar/Avatar.types.js.map +1 -1
- package/lib/components/Avatar/renderAvatar.js.map +1 -1
- package/lib/components/Avatar/useAvatar.js +7 -10
- package/lib/components/Avatar/useAvatar.js.map +1 -1
- package/lib/components/Avatar/useAvatarStyles.js +74 -70
- package/lib/components/Avatar/useAvatarStyles.js.map +1 -1
- package/lib/components/AvatarGroup/AvatarGroup.js +2 -1
- package/lib/components/AvatarGroup/AvatarGroup.js.map +1 -1
- package/lib/components/AvatarGroup/AvatarGroup.types.js.map +1 -1
- package/lib/components/AvatarGroup/renderAvatarGroup.js +31 -4
- package/lib/components/AvatarGroup/renderAvatarGroup.js.map +1 -1
- package/lib/components/AvatarGroup/useAvatarGroup.js +65 -34
- package/lib/components/AvatarGroup/useAvatarGroup.js.map +1 -1
- package/lib/components/AvatarGroup/useAvatarGroupStyles.js +274 -15
- package/lib/components/AvatarGroup/useAvatarGroupStyles.js.map +1 -1
- package/lib/components/AvatarGroupItem/AvatarGroupItem.js +16 -0
- package/lib/components/AvatarGroupItem/AvatarGroupItem.js.map +1 -0
- package/lib/components/AvatarGroupItem/AvatarGroupItem.types.js +2 -0
- package/lib/components/AvatarGroupItem/AvatarGroupItem.types.js.map +1 -0
- package/lib/components/AvatarGroupItem/index.js +6 -0
- package/lib/components/AvatarGroupItem/index.js.map +1 -0
- package/lib/components/AvatarGroupItem/renderAvatarGroupItem.js +17 -0
- package/lib/components/AvatarGroupItem/renderAvatarGroupItem.js.map +1 -0
- package/lib/components/AvatarGroupItem/useAvatarGroupItem.js +70 -0
- package/lib/components/AvatarGroupItem/useAvatarGroupItem.js.map +1 -0
- package/lib/components/AvatarGroupItem/useAvatarGroupItemStyles.js +356 -0
- package/lib/components/AvatarGroupItem/useAvatarGroupItemStyles.js.map +1 -0
- package/lib/contexts/AvatarGroupContext.js +7 -0
- package/lib/contexts/AvatarGroupContext.js.map +1 -0
- package/lib/contexts/AvatarGroupContext.types.js +2 -0
- package/lib/contexts/AvatarGroupContext.types.js.map +1 -0
- package/lib/contexts/index.js +2 -0
- package/lib/contexts/index.js.map +1 -0
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/utils/getInitials.js +16 -12
- package/lib/utils/getInitials.js.map +1 -1
- package/lib-commonjs/AvatarGroupItem.js +10 -0
- package/lib-commonjs/AvatarGroupItem.js.map +1 -0
- package/lib-commonjs/components/Avatar/Avatar.js.map +1 -1
- package/lib-commonjs/components/Avatar/renderAvatar.js.map +1 -1
- package/lib-commonjs/components/Avatar/useAvatar.js +7 -10
- package/lib-commonjs/components/Avatar/useAvatar.js.map +1 -1
- package/lib-commonjs/components/Avatar/useAvatarStyles.js +76 -72
- package/lib-commonjs/components/Avatar/useAvatarStyles.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.js +2 -1
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/renderAvatarGroup.js +34 -4
- package/lib-commonjs/components/AvatarGroup/renderAvatarGroup.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/useAvatarGroup.js +69 -37
- package/lib-commonjs/components/AvatarGroup/useAvatarGroup.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.js +278 -15
- package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.js.map +1 -1
- package/lib-commonjs/components/AvatarGroupItem/AvatarGroupItem.js +27 -0
- package/lib-commonjs/components/AvatarGroupItem/AvatarGroupItem.js.map +1 -0
- package/lib-commonjs/components/AvatarGroupItem/AvatarGroupItem.types.js +6 -0
- package/lib-commonjs/components/AvatarGroupItem/AvatarGroupItem.types.js.map +1 -0
- package/lib-commonjs/components/AvatarGroupItem/index.js +18 -0
- package/lib-commonjs/components/AvatarGroupItem/index.js.map +1 -0
- package/lib-commonjs/components/AvatarGroupItem/renderAvatarGroupItem.js +28 -0
- package/lib-commonjs/components/AvatarGroupItem/renderAvatarGroupItem.js.map +1 -0
- package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItem.js +84 -0
- package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItem.js.map +1 -0
- package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItemStyles.js +370 -0
- package/lib-commonjs/components/AvatarGroupItem/useAvatarGroupItemStyles.js.map +1 -0
- package/lib-commonjs/contexts/AvatarGroupContext.js +15 -0
- package/lib-commonjs/contexts/AvatarGroupContext.js.map +1 -0
- package/lib-commonjs/contexts/AvatarGroupContext.types.js +6 -0
- package/lib-commonjs/contexts/AvatarGroupContext.types.js.map +1 -0
- package/lib-commonjs/contexts/index.js +10 -0
- package/lib-commonjs/contexts/index.js.map +1 -0
- package/lib-commonjs/index.js +34 -8
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/getInitials.js +16 -12
- package/lib-commonjs/utils/getInitials.js.map +1 -1
- package/lib-commonjs/utils/index.js.map +1 -1
- package/package.json +17 -17
- package/lib/Avatar.d.ts +0 -1
- package/lib/AvatarGroup.d.ts +0 -1
- package/lib/components/Avatar/Avatar.d.ts +0 -3
- package/lib/components/Avatar/Avatar.types.d.ts +0 -111
- package/lib/components/Avatar/index.d.ts +0 -5
- package/lib/components/Avatar/renderAvatar.d.ts +0 -2
- package/lib/components/Avatar/useAvatar.d.ts +0 -3
- package/lib/components/Avatar/useAvatarStyles.d.ts +0 -8
- package/lib/components/AvatarGroup/AvatarGroup.d.ts +0 -6
- package/lib/components/AvatarGroup/AvatarGroup.strings.d.ts +0 -2
- package/lib/components/AvatarGroup/AvatarGroup.strings.js +0 -4
- package/lib/components/AvatarGroup/AvatarGroup.strings.js.map +0 -1
- package/lib/components/AvatarGroup/AvatarGroup.types.d.ts +0 -61
- package/lib/components/AvatarGroup/index.d.ts +0 -5
- package/lib/components/AvatarGroup/renderAvatarGroup.d.ts +0 -5
- package/lib/components/AvatarGroup/useAvatarGroup.d.ts +0 -12
- package/lib/components/AvatarGroup/useAvatarGroupStyles.d.ts +0 -10
- package/lib/index.d.ts +0 -5
- package/lib/utils/getInitials.d.ts +0 -14
- package/lib/utils/index.d.ts +0 -1
- package/lib-commonjs/Avatar.d.ts +0 -1
- package/lib-commonjs/AvatarGroup.d.ts +0 -1
- package/lib-commonjs/components/Avatar/Avatar.d.ts +0 -3
- package/lib-commonjs/components/Avatar/Avatar.types.d.ts +0 -111
- package/lib-commonjs/components/Avatar/index.d.ts +0 -5
- package/lib-commonjs/components/Avatar/renderAvatar.d.ts +0 -2
- package/lib-commonjs/components/Avatar/useAvatar.d.ts +0 -3
- package/lib-commonjs/components/Avatar/useAvatarStyles.d.ts +0 -8
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.d.ts +0 -6
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.strings.d.ts +0 -2
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.strings.js +0 -10
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.strings.js.map +0 -1
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.types.d.ts +0 -61
- package/lib-commonjs/components/AvatarGroup/index.d.ts +0 -5
- package/lib-commonjs/components/AvatarGroup/renderAvatarGroup.d.ts +0 -5
- package/lib-commonjs/components/AvatarGroup/useAvatarGroup.d.ts +0 -12
- package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.d.ts +0 -10
- package/lib-commonjs/index.d.ts +0 -5
- package/lib-commonjs/utils/getInitials.d.ts +0 -14
- package/lib-commonjs/utils/index.d.ts +0 -1
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.avatarGroupDefaultStrings = void 0;
|
|
7
|
-
exports.avatarGroupDefaultStrings = {
|
|
8
|
-
tooltipContent: '{numOverflowedAvatars} more people.'
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=AvatarGroup.strings.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["components/AvatarGroup/AvatarGroup.strings.tsx"],"names":[],"mappings":";;;;;;AAEa,OAAA,CAAA,yBAAA,GAAgD;AAC3D,EAAA,cAAc,EAAE;AAD2C,CAAhD","sourcesContent":["import type { AvatarGroupStrings } from './AvatarGroup.types';\n\nexport const avatarGroupDefaultStrings: AvatarGroupStrings = {\n tooltipContent: '{numOverflowedAvatars} more people.',\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
|
2
|
-
import { PopoverSurface } from '@fluentui/react-popover';
|
|
3
|
-
import { AvatarSizes } from '../Avatar/Avatar.types';
|
|
4
|
-
import { Button } from '@fluentui/react-button';
|
|
5
|
-
import { TooltipProps } from '@fluentui/react-tooltip';
|
|
6
|
-
export declare type AvatarGroupSlots = {
|
|
7
|
-
root: Slot<'div'>;
|
|
8
|
-
/**
|
|
9
|
-
* Popover trigger slot that can be used to change the overflow indicator.
|
|
10
|
-
*/
|
|
11
|
-
popoverTrigger?: Slot<typeof Button>;
|
|
12
|
-
/**
|
|
13
|
-
* Popover surface that will be displayed when the popover is triggered.
|
|
14
|
-
*/
|
|
15
|
-
popoverSurface?: Slot<typeof PopoverSurface>;
|
|
16
|
-
};
|
|
17
|
-
declare type AvatarGroupCommons = {
|
|
18
|
-
/**
|
|
19
|
-
* Layout the Avatars should be displayed as.
|
|
20
|
-
* @default spread
|
|
21
|
-
*/
|
|
22
|
-
layout: 'spread' | 'stack' | 'pie';
|
|
23
|
-
/**
|
|
24
|
-
* Maximum number of Avatars to be displayed before overflowing.
|
|
25
|
-
* NOTE: if pie layout is used, `maxAvatars` will be ignored.
|
|
26
|
-
* @default 5
|
|
27
|
-
*/
|
|
28
|
-
maxAvatars: number;
|
|
29
|
-
/**
|
|
30
|
-
* Size of the avatars.
|
|
31
|
-
* @default 32
|
|
32
|
-
*/
|
|
33
|
-
size: AvatarSizes;
|
|
34
|
-
/**
|
|
35
|
-
* Whether the overflow indicator should render an icon instead of the number of overflowed avatars.
|
|
36
|
-
* @default false
|
|
37
|
-
*/
|
|
38
|
-
overflowIndicator: 'number-overflowed' | 'icon';
|
|
39
|
-
/**
|
|
40
|
-
* Strings for localizing text in the tooltip.
|
|
41
|
-
*/
|
|
42
|
-
strings?: AvatarGroupStrings;
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* AvatarGroup Props
|
|
46
|
-
*/
|
|
47
|
-
export declare type AvatarGroupProps = ComponentProps<AvatarGroupSlots> & Partial<AvatarGroupCommons>;
|
|
48
|
-
/**
|
|
49
|
-
* State used in rendering AvatarGroup
|
|
50
|
-
*/
|
|
51
|
-
export declare type AvatarGroupState = ComponentState<AvatarGroupSlots> & AvatarGroupCommons & {
|
|
52
|
-
tooltipContent: TooltipProps['content'];
|
|
53
|
-
};
|
|
54
|
-
export declare type AvatarGroupStrings = {
|
|
55
|
-
/**
|
|
56
|
-
* Text applied to the overflow indicator's tooltip.
|
|
57
|
-
* Can include the token "\{numOverflowedAvatars\}" which will be replaced with the number of overflowed avatars.
|
|
58
|
-
*/
|
|
59
|
-
tooltipContent: string;
|
|
60
|
-
};
|
|
61
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { AvatarGroupProps, AvatarGroupState } from './AvatarGroup.types';
|
|
3
|
-
/**
|
|
4
|
-
* Create the state required to render AvatarGroup.
|
|
5
|
-
*
|
|
6
|
-
* The returned state can be modified with hooks such as useAvatarGroupStyles_unstable,
|
|
7
|
-
* before being passed to renderAvatarGroup_unstable.
|
|
8
|
-
*
|
|
9
|
-
* @param props - props from this instance of AvatarGroup
|
|
10
|
-
* @param ref - reference to root HTMLElement of AvatarGroup
|
|
11
|
-
*/
|
|
12
|
-
export declare const useAvatarGroup_unstable: (props: AvatarGroupProps, ref: React.Ref<HTMLElement>) => AvatarGroupState;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { AvatarGroupSlots, AvatarGroupState } from './AvatarGroup.types';
|
|
2
|
-
import type { SlotClassNames } from '@fluentui/react-utilities';
|
|
3
|
-
export declare const avatarGroupClassNames: SlotClassNames<AvatarGroupSlots>;
|
|
4
|
-
export declare const extraAvatarGroupClassNames: {
|
|
5
|
-
popoverSurfaceItem: string;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* Apply styling to the AvatarGroup slots based on the state
|
|
9
|
-
*/
|
|
10
|
-
export declare const useAvatarGroupStyles_unstable: (state: AvatarGroupState) => AvatarGroupState;
|
package/lib-commonjs/index.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { Avatar, avatarClassName, avatarClassNames, renderAvatar_unstable, useAvatarStyles_unstable, useAvatar_unstable, } from './Avatar';
|
|
2
|
-
export type { AvatarNamedColor, AvatarProps, AvatarSlots, AvatarState, AvatarSizes } from './Avatar';
|
|
3
|
-
export { getInitials } from './utils/index';
|
|
4
|
-
export { AvatarGroup, avatarGroupClassNames, renderAvatarGroup_unstable, useAvatarGroupStyles_unstable, useAvatarGroup_unstable, } from './AvatarGroup';
|
|
5
|
-
export type { AvatarGroupProps, AvatarGroupSlots, AvatarGroupState } from './AvatarGroup';
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Regular expressions matching characters to ignore when calculating the initials.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Get (up to 2 characters) initials based on display name of the persona.
|
|
6
|
-
*
|
|
7
|
-
* @param displayName - The full name of the person or entity
|
|
8
|
-
* @param isRtl - Whether the display is in RTL
|
|
9
|
-
* @param allowPhoneInitials - Should initials be generated from phone numbers (default false)
|
|
10
|
-
*
|
|
11
|
-
* @returns The 1 or 2 character initials based on the name. Or an empty string if no initials
|
|
12
|
-
* could be derived from the name.
|
|
13
|
-
*/
|
|
14
|
-
export declare function getInitials(displayName: string | undefined | null, isRtl: boolean, allowPhoneInitials?: boolean): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { getInitials } from './getInitials';
|