@fluentui/react-avatar 9.0.0-nightly.d730088d7f.0 → 9.0.0-rc.10
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 +843 -24
- package/CHANGELOG.md +323 -132
- package/MIGRATION.md +71 -66
- package/SPEC-AvatarGroup.md +185 -0
- package/SPEC.md +160 -135
- package/dist/index.d.ts +242 -0
- package/{lib → dist}/tsdoc-metadata.json +0 -0
- package/lib/Avatar.js.map +1 -1
- package/lib/AvatarGroup.js +2 -0
- package/lib/AvatarGroup.js.map +1 -0
- package/lib/components/Avatar/Avatar.js +7 -7
- 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 +11 -7
- package/lib/components/Avatar/renderAvatar.js.map +1 -1
- package/lib/components/Avatar/useAvatar.js +116 -87
- package/lib/components/Avatar/useAvatar.js.map +1 -1
- package/lib/components/Avatar/useAvatarStyles.js +185 -112
- package/lib/components/Avatar/useAvatarStyles.js.map +1 -1
- package/lib/components/AvatarGroup/AvatarGroup.js +15 -0
- package/lib/components/AvatarGroup/AvatarGroup.js.map +1 -0
- package/lib/components/AvatarGroup/AvatarGroup.strings.js +4 -0
- package/lib/components/AvatarGroup/AvatarGroup.strings.js.map +1 -0
- package/lib/components/AvatarGroup/AvatarGroup.types.js +2 -0
- package/lib/components/AvatarGroup/AvatarGroup.types.js.map +1 -0
- package/lib/components/AvatarGroup/index.js +6 -0
- package/lib/components/AvatarGroup/index.js.map +1 -0
- package/lib/components/AvatarGroup/renderAvatarGroup.js +16 -0
- package/lib/components/AvatarGroup/renderAvatarGroup.js.map +1 -0
- package/lib/components/AvatarGroup/useAvatarGroup.js +51 -0
- package/lib/components/AvatarGroup/useAvatarGroup.js.map +1 -0
- package/lib/components/AvatarGroup/useAvatarGroupStyles.js +37 -0
- package/lib/components/AvatarGroup/useAvatarGroupStyles.js.map +1 -0
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/utils/getInitials.js +26 -19
- package/lib/utils/getInitials.js.map +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib-commonjs/Avatar.js +1 -1
- package/lib-commonjs/Avatar.js.map +1 -1
- package/lib-commonjs/AvatarGroup.js +10 -0
- package/lib-commonjs/AvatarGroup.js.map +1 -0
- package/lib-commonjs/components/Avatar/Avatar.js +8 -8
- package/lib-commonjs/components/Avatar/Avatar.js.map +1 -1
- package/lib-commonjs/components/Avatar/Avatar.types.js.map +1 -1
- package/lib-commonjs/components/Avatar/index.js +1 -1
- package/lib-commonjs/components/Avatar/index.js.map +1 -1
- package/lib-commonjs/components/Avatar/renderAvatar.js +15 -12
- package/lib-commonjs/components/Avatar/renderAvatar.js.map +1 -1
- package/lib-commonjs/components/Avatar/useAvatar.js +121 -92
- package/lib-commonjs/components/Avatar/useAvatar.js.map +1 -1
- package/lib-commonjs/components/Avatar/useAvatarStyles.js +188 -115
- package/lib-commonjs/components/Avatar/useAvatarStyles.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.js +26 -0
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.js.map +1 -0
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.strings.js +10 -0
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.strings.js.map +1 -0
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.types.js +6 -0
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.types.js.map +1 -0
- package/lib-commonjs/components/AvatarGroup/index.js +18 -0
- package/lib-commonjs/components/AvatarGroup/index.js.map +1 -0
- package/lib-commonjs/components/AvatarGroup/renderAvatarGroup.js +27 -0
- package/lib-commonjs/components/AvatarGroup/renderAvatarGroup.js.map +1 -0
- package/lib-commonjs/components/AvatarGroup/useAvatarGroup.js +64 -0
- package/lib-commonjs/components/AvatarGroup/useAvatarGroup.js.map +1 -0
- package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.js +47 -0
- package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.js.map +1 -0
- package/lib-commonjs/index.js +74 -2
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/getInitials.js +26 -19
- package/lib-commonjs/utils/getInitials.js.map +1 -1
- package/lib-commonjs/utils/index.js.map +1 -1
- package/package.json +24 -25
- package/dist/react-avatar.d.ts +0 -132
- package/lib/Avatar.d.ts +0 -1
- package/lib/common/isConformant.d.ts +0 -4
- package/lib/common/isConformant.js +0 -12
- package/lib/common/isConformant.js.map +0 -1
- package/lib/components/Avatar/Avatar.d.ts +0 -3
- package/lib/components/Avatar/Avatar.types.d.ts +0 -112
- 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 -2
- package/lib/index.d.ts +0 -1
- package/lib/utils/getInitials.d.ts +0 -9
- package/lib/utils/index.d.ts +0 -1
- package/lib-commonjs/Avatar.d.ts +0 -1
- package/lib-commonjs/common/isConformant.d.ts +0 -4
- package/lib-commonjs/common/isConformant.js +0 -23
- package/lib-commonjs/common/isConformant.js.map +0 -1
- package/lib-commonjs/components/Avatar/Avatar.d.ts +0 -3
- package/lib-commonjs/components/Avatar/Avatar.types.d.ts +0 -112
- 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 -2
- package/lib-commonjs/index.d.ts +0 -1
- package/lib-commonjs/utils/getInitials.d.ts +0 -9
- package/lib-commonjs/utils/index.d.ts +0 -1
package/dist/react-avatar.d.ts
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps } from '@fluentui/react-utilities';
|
|
2
|
-
import type { ComponentState } from '@fluentui/react-utilities';
|
|
3
|
-
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
|
4
|
-
import type { IntrinsicShorthandProps } from '@fluentui/react-utilities';
|
|
5
|
-
import type { ObjectShorthandProps } from '@fluentui/react-utilities';
|
|
6
|
-
import type { PresenceBadgeProps } from '@fluentui/react-badge';
|
|
7
|
-
import * as React_2 from 'react';
|
|
8
|
-
import type { ShorthandRenderFunction } from '@fluentui/react-utilities';
|
|
9
|
-
|
|
10
|
-
export declare const Avatar: ForwardRefComponent<AvatarProps>;
|
|
11
|
-
|
|
12
|
-
export declare type AvatarCommons = Omit<React_2.HTMLAttributes<HTMLElement>, 'children'> & {
|
|
13
|
-
/**
|
|
14
|
-
* The name used for displaying the initials of the avatar if the image is not provided
|
|
15
|
-
*/
|
|
16
|
-
name: string;
|
|
17
|
-
/**
|
|
18
|
-
* Custom method for generating the initials from the name property, which is shown if no image is provided.
|
|
19
|
-
*/
|
|
20
|
-
getInitials: (name: string, isRtl: boolean) => string;
|
|
21
|
-
/**
|
|
22
|
-
* Size of the avatar in pixels.
|
|
23
|
-
*
|
|
24
|
-
* Size is restricted to a limited set of supported values recommended for most uses (see `AvatarSizeValue`) and
|
|
25
|
-
* based on design guidelines for the Avatar control.
|
|
26
|
-
*
|
|
27
|
-
* If a non-supported size is neeeded, set `size` to the next-smaller supported size, and set `width` and `height`
|
|
28
|
-
* to override the rendered size.
|
|
29
|
-
*
|
|
30
|
-
* For example, to set the avatar to 45px in size:
|
|
31
|
-
* `<Avatar size={40} style={{ width: '45px', height: '45px' }} />`
|
|
32
|
-
*
|
|
33
|
-
* @defaultvalue 32
|
|
34
|
-
*/
|
|
35
|
-
size: 20 | 24 | 28 | 32 | 36 | 40 | 48 | 56 | 64 | 72 | 96 | 120 | 128;
|
|
36
|
-
/**
|
|
37
|
-
* The avatar can have a circular or square shape.
|
|
38
|
-
* @defaultvalue circular
|
|
39
|
-
*/
|
|
40
|
-
shape: 'circular' | 'square';
|
|
41
|
-
/**
|
|
42
|
-
* Optional activity indicator
|
|
43
|
-
* * active: the avatar will be decorated according to activeAppearance
|
|
44
|
-
* * inactive: the avatar will be reduced in size and partially transparent
|
|
45
|
-
* * unset: normal display
|
|
46
|
-
*
|
|
47
|
-
* @defaultvalue unset
|
|
48
|
-
*/
|
|
49
|
-
active: 'active' | 'inactive' | 'unset';
|
|
50
|
-
/**
|
|
51
|
-
* The appearance when `active="active"`
|
|
52
|
-
*
|
|
53
|
-
* @defaultvalue ring
|
|
54
|
-
*/
|
|
55
|
-
activeAppearance: 'ring' | 'shadow' | 'glow' | 'ring-shadow' | 'ring-glow';
|
|
56
|
-
/**
|
|
57
|
-
* The color when displaying either an icon or initials.
|
|
58
|
-
* * neutral (default): gray
|
|
59
|
-
* * brand: color from the brand palette
|
|
60
|
-
* * colorful: picks a color from a set of pre-defined colors, based on a hash of the name (or idForColor if provided)
|
|
61
|
-
* * [AvatarNamedColor]: a specific color from the theme
|
|
62
|
-
*
|
|
63
|
-
* @defaultvalue neutral
|
|
64
|
-
*/
|
|
65
|
-
color: 'neutral' | 'brand' | 'colorful' | AvatarNamedColor;
|
|
66
|
-
/**
|
|
67
|
-
* Specify a string to be used instead of the name, to determine which color to use when color="colorful".
|
|
68
|
-
* Use this when a name is not available, but there is another unique identifier that can be used instead.
|
|
69
|
-
*/
|
|
70
|
-
idForColor: string | undefined;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* A specific named color for the Avatar
|
|
75
|
-
*/
|
|
76
|
-
export declare type AvatarNamedColor = 'darkRed' | 'cranberry' | 'red' | 'pumpkin' | 'peach' | 'marigold' | 'gold' | 'brass' | 'brown' | 'forest' | 'seafoam' | 'darkGreen' | 'lightTeal' | 'teal' | 'steel' | 'blue' | 'royalBlue' | 'cornflower' | 'navy' | 'lavender' | 'purple' | 'grape' | 'lilac' | 'pink' | 'magenta' | 'plum' | 'beige' | 'mink' | 'platinum' | 'anchor';
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Properties for Avatar
|
|
80
|
-
*/
|
|
81
|
-
export declare type AvatarProps = Omit<ComponentProps<AvatarSlots>, 'image'> & Partial<AvatarCommons> & {
|
|
82
|
-
/**
|
|
83
|
-
* The Avatar's image. Cannot be typed as a normal slot since it should not accept any children
|
|
84
|
-
* but can accept a children render function.
|
|
85
|
-
*/
|
|
86
|
-
image?: Omit<IntrinsicShorthandProps<'img'>, 'children'> & {
|
|
87
|
-
children?: ShorthandRenderFunction<React_2.HTMLAttributes<HTMLImageElement>>;
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
export declare type AvatarSlots = {
|
|
92
|
-
root: Omit<IntrinsicShorthandProps<'span'>, 'color'> & {
|
|
93
|
-
children?: never;
|
|
94
|
-
};
|
|
95
|
-
/**
|
|
96
|
-
* This overidden in the component's props, it's only here to make `getSlots` work
|
|
97
|
-
* `img` is an exception since it should never accept children, but can accept a children render function
|
|
98
|
-
*/
|
|
99
|
-
image?: IntrinsicShorthandProps<'img'>;
|
|
100
|
-
/**
|
|
101
|
-
* The label shown when there's no image. Defaults to the initials derived from `name` using `getInitials`.
|
|
102
|
-
*/
|
|
103
|
-
label?: IntrinsicShorthandProps<'span'>;
|
|
104
|
-
/**
|
|
105
|
-
* Icon to be displayed when the avatar doesn't have an image or name (or if getInitials returns an empty string).
|
|
106
|
-
*
|
|
107
|
-
* @defaultvalue `Person20Regular` (the default icon's size depends on the Avatar's size)
|
|
108
|
-
*/
|
|
109
|
-
icon?: IntrinsicShorthandProps<'span'>;
|
|
110
|
-
/**
|
|
111
|
-
* Badge to show the avatar's presence status.
|
|
112
|
-
*/
|
|
113
|
-
badge?: ObjectShorthandProps<PresenceBadgeProps>;
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* State used in rendering Avatar
|
|
118
|
-
*/
|
|
119
|
-
export declare type AvatarState = ComponentState<AvatarSlots> & AvatarCommons & {
|
|
120
|
-
/**
|
|
121
|
-
* The Avatar's color, with `'colorful'` resolved to a named color
|
|
122
|
-
*/
|
|
123
|
-
color: Exclude<AvatarCommons['color'], 'colorful'>;
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
export declare const renderAvatar: (state: AvatarState) => JSX.Element;
|
|
127
|
-
|
|
128
|
-
export declare const useAvatar: (props: AvatarProps, ref: React_2.Ref<HTMLElement>) => AvatarState;
|
|
129
|
-
|
|
130
|
-
export declare const useAvatarStyles: (state: AvatarState) => AvatarState;
|
|
131
|
-
|
|
132
|
-
export { }
|
package/lib/Avatar.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './components/Avatar/index';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { isConformant as baseIsConformant } from '@fluentui/react-conformance';
|
|
2
|
-
import makeStylesTests from '@fluentui/react-conformance-make-styles';
|
|
3
|
-
export function isConformant(testInfo) {
|
|
4
|
-
var defaultOptions = {
|
|
5
|
-
asPropHandlesRef: true,
|
|
6
|
-
componentPath: module.parent.filename.replace('.test', ''),
|
|
7
|
-
disabledTests: ['has-docblock'],
|
|
8
|
-
extraTests: makeStylesTests
|
|
9
|
-
};
|
|
10
|
-
baseIsConformant(defaultOptions, testInfo);
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=isConformant.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/common/isConformant.ts"],"names":[],"mappings":"AAAA,SAAS,YAAY,IAAI,gBAAzB,QAAiD,6BAAjD;AACA,OAAO,eAAP,MAA4B,yCAA5B;AAGA,OAAM,SAAU,YAAV,CACJ,QADI,EACqF;AAEzF,MAAM,cAAc,GAAyC;AAC3D,IAAA,gBAAgB,EAAE,IADyC;AAE3D,IAAA,aAAa,EAAE,MAAO,CAAC,MAAR,CAAgB,QAAhB,CAAyB,OAAzB,CAAiC,OAAjC,EAA0C,EAA1C,CAF4C;AAG3D,IAAA,aAAa,EAAE,CAAC,cAAD,CAH4C;AAI3D,IAAA,UAAU,EAAE;AAJ+C,GAA7D;AAOA,EAAA,gBAAgB,CAAC,cAAD,EAAiB,QAAjB,CAAhB;AACD","sourceRoot":""}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { ComponentProps, ComponentState, IntrinsicShorthandProps, ObjectShorthandProps, ShorthandRenderFunction } from '@fluentui/react-utilities';
|
|
3
|
-
import type { PresenceBadgeProps } from '@fluentui/react-badge';
|
|
4
|
-
export declare type AvatarSlots = {
|
|
5
|
-
root: Omit<IntrinsicShorthandProps<'span'>, 'color'> & {
|
|
6
|
-
children?: never;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* This overidden in the component's props, it's only here to make `getSlots` work
|
|
10
|
-
* `img` is an exception since it should never accept children, but can accept a children render function
|
|
11
|
-
*/
|
|
12
|
-
image?: IntrinsicShorthandProps<'img'>;
|
|
13
|
-
/**
|
|
14
|
-
* The label shown when there's no image. Defaults to the initials derived from `name` using `getInitials`.
|
|
15
|
-
*/
|
|
16
|
-
label?: IntrinsicShorthandProps<'span'>;
|
|
17
|
-
/**
|
|
18
|
-
* Icon to be displayed when the avatar doesn't have an image or name (or if getInitials returns an empty string).
|
|
19
|
-
*
|
|
20
|
-
* @defaultvalue `Person20Regular` (the default icon's size depends on the Avatar's size)
|
|
21
|
-
*/
|
|
22
|
-
icon?: IntrinsicShorthandProps<'span'>;
|
|
23
|
-
/**
|
|
24
|
-
* Badge to show the avatar's presence status.
|
|
25
|
-
*/
|
|
26
|
-
badge?: ObjectShorthandProps<PresenceBadgeProps>;
|
|
27
|
-
};
|
|
28
|
-
export declare type AvatarCommons = Omit<React.HTMLAttributes<HTMLElement>, 'children'> & {
|
|
29
|
-
/**
|
|
30
|
-
* The name used for displaying the initials of the avatar if the image is not provided
|
|
31
|
-
*/
|
|
32
|
-
name: string;
|
|
33
|
-
/**
|
|
34
|
-
* Custom method for generating the initials from the name property, which is shown if no image is provided.
|
|
35
|
-
*/
|
|
36
|
-
getInitials: (name: string, isRtl: boolean) => string;
|
|
37
|
-
/**
|
|
38
|
-
* Size of the avatar in pixels.
|
|
39
|
-
*
|
|
40
|
-
* Size is restricted to a limited set of supported values recommended for most uses (see `AvatarSizeValue`) and
|
|
41
|
-
* based on design guidelines for the Avatar control.
|
|
42
|
-
*
|
|
43
|
-
* If a non-supported size is neeeded, set `size` to the next-smaller supported size, and set `width` and `height`
|
|
44
|
-
* to override the rendered size.
|
|
45
|
-
*
|
|
46
|
-
* For example, to set the avatar to 45px in size:
|
|
47
|
-
* `<Avatar size={40} style={{ width: '45px', height: '45px' }} />`
|
|
48
|
-
*
|
|
49
|
-
* @defaultvalue 32
|
|
50
|
-
*/
|
|
51
|
-
size: 20 | 24 | 28 | 32 | 36 | 40 | 48 | 56 | 64 | 72 | 96 | 120 | 128;
|
|
52
|
-
/**
|
|
53
|
-
* The avatar can have a circular or square shape.
|
|
54
|
-
* @defaultvalue circular
|
|
55
|
-
*/
|
|
56
|
-
shape: 'circular' | 'square';
|
|
57
|
-
/**
|
|
58
|
-
* Optional activity indicator
|
|
59
|
-
* * active: the avatar will be decorated according to activeAppearance
|
|
60
|
-
* * inactive: the avatar will be reduced in size and partially transparent
|
|
61
|
-
* * unset: normal display
|
|
62
|
-
*
|
|
63
|
-
* @defaultvalue unset
|
|
64
|
-
*/
|
|
65
|
-
active: 'active' | 'inactive' | 'unset';
|
|
66
|
-
/**
|
|
67
|
-
* The appearance when `active="active"`
|
|
68
|
-
*
|
|
69
|
-
* @defaultvalue ring
|
|
70
|
-
*/
|
|
71
|
-
activeAppearance: 'ring' | 'shadow' | 'glow' | 'ring-shadow' | 'ring-glow';
|
|
72
|
-
/**
|
|
73
|
-
* The color when displaying either an icon or initials.
|
|
74
|
-
* * neutral (default): gray
|
|
75
|
-
* * brand: color from the brand palette
|
|
76
|
-
* * colorful: picks a color from a set of pre-defined colors, based on a hash of the name (or idForColor if provided)
|
|
77
|
-
* * [AvatarNamedColor]: a specific color from the theme
|
|
78
|
-
*
|
|
79
|
-
* @defaultvalue neutral
|
|
80
|
-
*/
|
|
81
|
-
color: 'neutral' | 'brand' | 'colorful' | AvatarNamedColor;
|
|
82
|
-
/**
|
|
83
|
-
* Specify a string to be used instead of the name, to determine which color to use when color="colorful".
|
|
84
|
-
* Use this when a name is not available, but there is another unique identifier that can be used instead.
|
|
85
|
-
*/
|
|
86
|
-
idForColor: string | undefined;
|
|
87
|
-
};
|
|
88
|
-
/**
|
|
89
|
-
* A specific named color for the Avatar
|
|
90
|
-
*/
|
|
91
|
-
export declare type AvatarNamedColor = 'darkRed' | 'cranberry' | 'red' | 'pumpkin' | 'peach' | 'marigold' | 'gold' | 'brass' | 'brown' | 'forest' | 'seafoam' | 'darkGreen' | 'lightTeal' | 'teal' | 'steel' | 'blue' | 'royalBlue' | 'cornflower' | 'navy' | 'lavender' | 'purple' | 'grape' | 'lilac' | 'pink' | 'magenta' | 'plum' | 'beige' | 'mink' | 'platinum' | 'anchor';
|
|
92
|
-
/**
|
|
93
|
-
* Properties for Avatar
|
|
94
|
-
*/
|
|
95
|
-
export declare type AvatarProps = Omit<ComponentProps<AvatarSlots>, 'image'> & Partial<AvatarCommons> & {
|
|
96
|
-
/**
|
|
97
|
-
* The Avatar's image. Cannot be typed as a normal slot since it should not accept any children
|
|
98
|
-
* but can accept a children render function.
|
|
99
|
-
*/
|
|
100
|
-
image?: Omit<IntrinsicShorthandProps<'img'>, 'children'> & {
|
|
101
|
-
children?: ShorthandRenderFunction<React.HTMLAttributes<HTMLImageElement>>;
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
/**
|
|
105
|
-
* State used in rendering Avatar
|
|
106
|
-
*/
|
|
107
|
-
export declare type AvatarState = ComponentState<AvatarSlots> & AvatarCommons & {
|
|
108
|
-
/**
|
|
109
|
-
* The Avatar's color, with `'colorful'` resolved to a named color
|
|
110
|
-
*/
|
|
111
|
-
color: Exclude<AvatarCommons['color'], 'colorful'>;
|
|
112
|
-
};
|
package/lib/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Avatar';
|
|
@@ -1,9 +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
|
-
* @public
|
|
8
|
-
*/
|
|
9
|
-
export declare function getInitials(displayName: string | undefined | null, isRtl: boolean, allowPhoneInitials?: boolean): string;
|
package/lib/utils/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { getInitials } from './getInitials';
|
package/lib-commonjs/Avatar.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './components/Avatar/index';
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.isConformant = void 0;
|
|
7
|
-
|
|
8
|
-
var react_conformance_1 = /*#__PURE__*/require("@fluentui/react-conformance");
|
|
9
|
-
|
|
10
|
-
var react_conformance_make_styles_1 = /*#__PURE__*/require("@fluentui/react-conformance-make-styles");
|
|
11
|
-
|
|
12
|
-
function isConformant(testInfo) {
|
|
13
|
-
var defaultOptions = {
|
|
14
|
-
asPropHandlesRef: true,
|
|
15
|
-
componentPath: module.parent.filename.replace('.test', ''),
|
|
16
|
-
disabledTests: ['has-docblock'],
|
|
17
|
-
extraTests: react_conformance_make_styles_1.default
|
|
18
|
-
};
|
|
19
|
-
react_conformance_1.isConformant(defaultOptions, testInfo);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
exports.isConformant = isConformant;
|
|
23
|
-
//# sourceMappingURL=isConformant.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/common/isConformant.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AACA,IAAA,+BAAA,gBAAA,OAAA,CAAA,yCAAA,CAAA;;AAGA,SAAgB,YAAhB,CACE,QADF,EAC2F;AAEzF,MAAM,cAAc,GAAyC;AAC3D,IAAA,gBAAgB,EAAE,IADyC;AAE3D,IAAA,aAAa,EAAE,MAAO,CAAC,MAAR,CAAgB,QAAhB,CAAyB,OAAzB,CAAiC,OAAjC,EAA0C,EAA1C,CAF4C;AAG3D,IAAA,aAAa,EAAE,CAAC,cAAD,CAH4C;AAI3D,IAAA,UAAU,EAAE,+BAAA,CAAA;AAJ+C,GAA7D;AAOA,EAAA,mBAAA,CAAA,YAAA,CAAiB,cAAjB,EAAiC,QAAjC;AACD;;AAXD,OAAA,CAAA,YAAA,GAAA,YAAA","sourceRoot":""}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { ComponentProps, ComponentState, IntrinsicShorthandProps, ObjectShorthandProps, ShorthandRenderFunction } from '@fluentui/react-utilities';
|
|
3
|
-
import type { PresenceBadgeProps } from '@fluentui/react-badge';
|
|
4
|
-
export declare type AvatarSlots = {
|
|
5
|
-
root: Omit<IntrinsicShorthandProps<'span'>, 'color'> & {
|
|
6
|
-
children?: never;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* This overidden in the component's props, it's only here to make `getSlots` work
|
|
10
|
-
* `img` is an exception since it should never accept children, but can accept a children render function
|
|
11
|
-
*/
|
|
12
|
-
image?: IntrinsicShorthandProps<'img'>;
|
|
13
|
-
/**
|
|
14
|
-
* The label shown when there's no image. Defaults to the initials derived from `name` using `getInitials`.
|
|
15
|
-
*/
|
|
16
|
-
label?: IntrinsicShorthandProps<'span'>;
|
|
17
|
-
/**
|
|
18
|
-
* Icon to be displayed when the avatar doesn't have an image or name (or if getInitials returns an empty string).
|
|
19
|
-
*
|
|
20
|
-
* @defaultvalue `Person20Regular` (the default icon's size depends on the Avatar's size)
|
|
21
|
-
*/
|
|
22
|
-
icon?: IntrinsicShorthandProps<'span'>;
|
|
23
|
-
/**
|
|
24
|
-
* Badge to show the avatar's presence status.
|
|
25
|
-
*/
|
|
26
|
-
badge?: ObjectShorthandProps<PresenceBadgeProps>;
|
|
27
|
-
};
|
|
28
|
-
export declare type AvatarCommons = Omit<React.HTMLAttributes<HTMLElement>, 'children'> & {
|
|
29
|
-
/**
|
|
30
|
-
* The name used for displaying the initials of the avatar if the image is not provided
|
|
31
|
-
*/
|
|
32
|
-
name: string;
|
|
33
|
-
/**
|
|
34
|
-
* Custom method for generating the initials from the name property, which is shown if no image is provided.
|
|
35
|
-
*/
|
|
36
|
-
getInitials: (name: string, isRtl: boolean) => string;
|
|
37
|
-
/**
|
|
38
|
-
* Size of the avatar in pixels.
|
|
39
|
-
*
|
|
40
|
-
* Size is restricted to a limited set of supported values recommended for most uses (see `AvatarSizeValue`) and
|
|
41
|
-
* based on design guidelines for the Avatar control.
|
|
42
|
-
*
|
|
43
|
-
* If a non-supported size is neeeded, set `size` to the next-smaller supported size, and set `width` and `height`
|
|
44
|
-
* to override the rendered size.
|
|
45
|
-
*
|
|
46
|
-
* For example, to set the avatar to 45px in size:
|
|
47
|
-
* `<Avatar size={40} style={{ width: '45px', height: '45px' }} />`
|
|
48
|
-
*
|
|
49
|
-
* @defaultvalue 32
|
|
50
|
-
*/
|
|
51
|
-
size: 20 | 24 | 28 | 32 | 36 | 40 | 48 | 56 | 64 | 72 | 96 | 120 | 128;
|
|
52
|
-
/**
|
|
53
|
-
* The avatar can have a circular or square shape.
|
|
54
|
-
* @defaultvalue circular
|
|
55
|
-
*/
|
|
56
|
-
shape: 'circular' | 'square';
|
|
57
|
-
/**
|
|
58
|
-
* Optional activity indicator
|
|
59
|
-
* * active: the avatar will be decorated according to activeAppearance
|
|
60
|
-
* * inactive: the avatar will be reduced in size and partially transparent
|
|
61
|
-
* * unset: normal display
|
|
62
|
-
*
|
|
63
|
-
* @defaultvalue unset
|
|
64
|
-
*/
|
|
65
|
-
active: 'active' | 'inactive' | 'unset';
|
|
66
|
-
/**
|
|
67
|
-
* The appearance when `active="active"`
|
|
68
|
-
*
|
|
69
|
-
* @defaultvalue ring
|
|
70
|
-
*/
|
|
71
|
-
activeAppearance: 'ring' | 'shadow' | 'glow' | 'ring-shadow' | 'ring-glow';
|
|
72
|
-
/**
|
|
73
|
-
* The color when displaying either an icon or initials.
|
|
74
|
-
* * neutral (default): gray
|
|
75
|
-
* * brand: color from the brand palette
|
|
76
|
-
* * colorful: picks a color from a set of pre-defined colors, based on a hash of the name (or idForColor if provided)
|
|
77
|
-
* * [AvatarNamedColor]: a specific color from the theme
|
|
78
|
-
*
|
|
79
|
-
* @defaultvalue neutral
|
|
80
|
-
*/
|
|
81
|
-
color: 'neutral' | 'brand' | 'colorful' | AvatarNamedColor;
|
|
82
|
-
/**
|
|
83
|
-
* Specify a string to be used instead of the name, to determine which color to use when color="colorful".
|
|
84
|
-
* Use this when a name is not available, but there is another unique identifier that can be used instead.
|
|
85
|
-
*/
|
|
86
|
-
idForColor: string | undefined;
|
|
87
|
-
};
|
|
88
|
-
/**
|
|
89
|
-
* A specific named color for the Avatar
|
|
90
|
-
*/
|
|
91
|
-
export declare type AvatarNamedColor = 'darkRed' | 'cranberry' | 'red' | 'pumpkin' | 'peach' | 'marigold' | 'gold' | 'brass' | 'brown' | 'forest' | 'seafoam' | 'darkGreen' | 'lightTeal' | 'teal' | 'steel' | 'blue' | 'royalBlue' | 'cornflower' | 'navy' | 'lavender' | 'purple' | 'grape' | 'lilac' | 'pink' | 'magenta' | 'plum' | 'beige' | 'mink' | 'platinum' | 'anchor';
|
|
92
|
-
/**
|
|
93
|
-
* Properties for Avatar
|
|
94
|
-
*/
|
|
95
|
-
export declare type AvatarProps = Omit<ComponentProps<AvatarSlots>, 'image'> & Partial<AvatarCommons> & {
|
|
96
|
-
/**
|
|
97
|
-
* The Avatar's image. Cannot be typed as a normal slot since it should not accept any children
|
|
98
|
-
* but can accept a children render function.
|
|
99
|
-
*/
|
|
100
|
-
image?: Omit<IntrinsicShorthandProps<'img'>, 'children'> & {
|
|
101
|
-
children?: ShorthandRenderFunction<React.HTMLAttributes<HTMLImageElement>>;
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
/**
|
|
105
|
-
* State used in rendering Avatar
|
|
106
|
-
*/
|
|
107
|
-
export declare type AvatarState = ComponentState<AvatarSlots> & AvatarCommons & {
|
|
108
|
-
/**
|
|
109
|
-
* The Avatar's color, with `'colorful'` resolved to a named color
|
|
110
|
-
*/
|
|
111
|
-
color: Exclude<AvatarCommons['color'], 'colorful'>;
|
|
112
|
-
};
|
package/lib-commonjs/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Avatar';
|
|
@@ -1,9 +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
|
-
* @public
|
|
8
|
-
*/
|
|
9
|
-
export declare function getInitials(displayName: string | undefined | null, isRtl: boolean, allowPhoneInitials?: boolean): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { getInitials } from './getInitials';
|