@atlaskit/avatar 21.0.1 → 21.0.2
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/Avatar/package.json +8 -1
- package/AvatarItem/package.json +8 -1
- package/CHANGELOG.md +6 -0
- package/Presence/package.json +8 -1
- package/Skeleton/package.json +8 -1
- package/Status/package.json +8 -1
- package/dist/cjs/Avatar.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/Avatar.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/Avatar.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types-ts4.0/Avatar.d.ts +106 -0
- package/dist/types-ts4.0/AvatarImage.d.ts +19 -0
- package/dist/types-ts4.0/AvatarItem.d.ts +79 -0
- package/dist/types-ts4.0/IconWrapper.d.ts +13 -0
- package/dist/types-ts4.0/Presence.d.ts +45 -0
- package/dist/types-ts4.0/Skeleton.d.ts +19 -0
- package/dist/types-ts4.0/Status.d.ts +42 -0
- package/dist/types-ts4.0/Text.d.ts +13 -0
- package/dist/types-ts4.0/constants.d.ts +7 -0
- package/dist/types-ts4.0/entry-points/avatar-item.d.ts +2 -0
- package/dist/types-ts4.0/entry-points/avatar.d.ts +1 -0
- package/dist/types-ts4.0/entry-points/presence.d.ts +2 -0
- package/dist/types-ts4.0/entry-points/skeleton.d.ts +2 -0
- package/dist/types-ts4.0/entry-points/status.d.ts +2 -0
- package/dist/types-ts4.0/entry-points/types.d.ts +1 -0
- package/dist/types-ts4.0/index.d.ts +12 -0
- package/dist/types-ts4.0/types.d.ts +7 -0
- package/dist/types-ts4.0/utilities.d.ts +11 -0
- package/package.json +15 -7
- package/types/package.json +8 -1
package/Avatar/package.json
CHANGED
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/avatar.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/avatar.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/avatar.d.ts"
|
|
7
|
+
"types": "../dist/types/entry-points/avatar.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/entry-points/avatar.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
package/AvatarItem/package.json
CHANGED
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/avatar-item.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/avatar-item.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/avatar-item.d.ts"
|
|
7
|
+
"types": "../dist/types/entry-points/avatar-item.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/entry-points/avatar-item.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
package/CHANGELOG.md
CHANGED
package/Presence/package.json
CHANGED
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/presence.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/presence.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/presence.d.ts"
|
|
7
|
+
"types": "../dist/types/entry-points/presence.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/entry-points/presence.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
package/Skeleton/package.json
CHANGED
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/skeleton.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/skeleton.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/skeleton.d.ts"
|
|
7
|
+
"types": "../dist/types/entry-points/skeleton.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/entry-points/skeleton.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
package/Status/package.json
CHANGED
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/status.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/status.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/status.d.ts"
|
|
7
|
+
"types": "../dist/types/entry-points/status.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/entry-points/status.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
package/dist/cjs/Avatar.js
CHANGED
|
@@ -38,7 +38,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
38
38
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
39
39
|
|
|
40
40
|
var packageName = "@atlaskit/avatar";
|
|
41
|
-
var packageVersion = "21.0.
|
|
41
|
+
var packageVersion = "21.0.2";
|
|
42
42
|
|
|
43
43
|
var getStyles = function getStyles(css, _ref) {
|
|
44
44
|
var size = _ref.size,
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/Avatar.js
CHANGED
|
@@ -10,7 +10,7 @@ import { PresenceWrapper } from './Presence';
|
|
|
10
10
|
import { StatusWrapper } from './Status';
|
|
11
11
|
import { getButtonProps, getCustomElement, getLinkProps } from './utilities';
|
|
12
12
|
const packageName = "@atlaskit/avatar";
|
|
13
|
-
const packageVersion = "21.0.
|
|
13
|
+
const packageVersion = "21.0.2";
|
|
14
14
|
|
|
15
15
|
const getStyles = (css, {
|
|
16
16
|
size,
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/Avatar.js
CHANGED
|
@@ -20,7 +20,7 @@ import { PresenceWrapper } from './Presence';
|
|
|
20
20
|
import { StatusWrapper } from './Status';
|
|
21
21
|
import { getButtonProps, getCustomElement, getLinkProps } from './utilities';
|
|
22
22
|
var packageName = "@atlaskit/avatar";
|
|
23
|
-
var packageVersion = "21.0.
|
|
23
|
+
var packageVersion = "21.0.2";
|
|
24
24
|
|
|
25
25
|
var getStyles = function getStyles(css, _ref) {
|
|
26
26
|
var size = _ref.size,
|
package/dist/esm/version.json
CHANGED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { MouseEventHandler, ReactNode, Ref } from 'react';
|
|
3
|
+
import { AppearanceType, AvatarClickEventHandler, SizeType } from './types';
|
|
4
|
+
export interface CustomAvatarProps {
|
|
5
|
+
/**
|
|
6
|
+
* This is used in render props so is okay to be defined.
|
|
7
|
+
* eslint-disable-next-line consistent-props-definitions
|
|
8
|
+
*/
|
|
9
|
+
'aria-label'?: string;
|
|
10
|
+
tabIndex?: number;
|
|
11
|
+
testId?: string;
|
|
12
|
+
onClick?: MouseEventHandler;
|
|
13
|
+
className?: string;
|
|
14
|
+
href?: string;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
ref: Ref<HTMLElement>;
|
|
17
|
+
}
|
|
18
|
+
export interface AvatarPropTypes {
|
|
19
|
+
/**
|
|
20
|
+
* Indicates the shape of the avatar. Most avatars are circular, but square avatars
|
|
21
|
+
* can be used for 'container' objects.
|
|
22
|
+
*/
|
|
23
|
+
appearance?: AppearanceType;
|
|
24
|
+
/**
|
|
25
|
+
* Used to provide better content to screen readers when using presence/status. Rather
|
|
26
|
+
* than a screen reader speaking "online, approved, John Smith", passing in a label
|
|
27
|
+
* allows a custom message like "John Smith (approved and online)".
|
|
28
|
+
*/
|
|
29
|
+
label?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Used to override the default border color around the avatar body.
|
|
32
|
+
* Accepts any color argument that the border-color CSS property accepts.
|
|
33
|
+
*/
|
|
34
|
+
borderColor?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Supply a custom avatar component instead of the default
|
|
37
|
+
*/
|
|
38
|
+
children?: (props: CustomAvatarProps) => ReactNode;
|
|
39
|
+
/**
|
|
40
|
+
* Provides a url for avatars being used as a link.
|
|
41
|
+
*/
|
|
42
|
+
href?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Change the style to indicate the avatar is disabled.
|
|
45
|
+
*/
|
|
46
|
+
isDisabled?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Provides alt text for the avatar image.
|
|
49
|
+
*/
|
|
50
|
+
name?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Indicates a user's online status by showing a small icon on the avatar.
|
|
53
|
+
* Refer to presence values on the Presence component.
|
|
54
|
+
* Alternatively accepts any React element. For best results, it is recommended to
|
|
55
|
+
* use square content with height and width of 100%.
|
|
56
|
+
*/
|
|
57
|
+
presence?: ('online' | 'busy' | 'focus' | 'offline') | ReactNode;
|
|
58
|
+
/**
|
|
59
|
+
* Defines the size of the avatar
|
|
60
|
+
*/
|
|
61
|
+
size?: SizeType;
|
|
62
|
+
/**
|
|
63
|
+
* A url to load an image from (this can also be a base64 encoded image).
|
|
64
|
+
*/
|
|
65
|
+
src?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Indicates contextual information by showing a small icon on the avatar.
|
|
68
|
+
* Refer to status values on the Status component.
|
|
69
|
+
*/
|
|
70
|
+
status?: ('approved' | 'declined' | 'locked') | ReactNode;
|
|
71
|
+
/**
|
|
72
|
+
* The index of where this avatar is in the group `stack`.
|
|
73
|
+
*/
|
|
74
|
+
stackIndex?: number;
|
|
75
|
+
/**
|
|
76
|
+
* Assign specific tabIndex order to the underlying node.
|
|
77
|
+
*/
|
|
78
|
+
tabIndex?: number;
|
|
79
|
+
/**
|
|
80
|
+
* Pass target down to the anchor, if href is provided.
|
|
81
|
+
*/
|
|
82
|
+
target?: '_blank' | '_self' | '_top' | '_parent';
|
|
83
|
+
/**
|
|
84
|
+
* Handler to be called on click.
|
|
85
|
+
*/
|
|
86
|
+
onClick?: AvatarClickEventHandler;
|
|
87
|
+
/**
|
|
88
|
+
* A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests
|
|
89
|
+
*/
|
|
90
|
+
testId?: string;
|
|
91
|
+
/**
|
|
92
|
+
* Analytics context meta data
|
|
93
|
+
*/
|
|
94
|
+
analyticsContext?: Record<string, any>;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* __Avatar__
|
|
98
|
+
*
|
|
99
|
+
* An avatar is a visual representation of a user or entity.
|
|
100
|
+
*
|
|
101
|
+
* - [Examples](https://atlassian.design/components/avatar/examples)
|
|
102
|
+
* - [Code](https://atlassian.design/components/avatar/code)
|
|
103
|
+
* - [Usage](https://atlassian.design/components/avatar/usage)
|
|
104
|
+
*/
|
|
105
|
+
declare const Avatar: import("react").ForwardRefExoticComponent<AvatarPropTypes & import("react").RefAttributes<HTMLElement>>;
|
|
106
|
+
export default Avatar;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
import { AppearanceType, SizeType } from './types';
|
|
4
|
+
interface AvatarImageProps {
|
|
5
|
+
appearance: AppearanceType;
|
|
6
|
+
size: SizeType;
|
|
7
|
+
alt?: string;
|
|
8
|
+
src?: string;
|
|
9
|
+
testId?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const ICON_BACKGROUND: "var(--ds-icon-inverse)";
|
|
12
|
+
export declare const ICON_COLOR: "var(--ds-icon-subtle)";
|
|
13
|
+
/**
|
|
14
|
+
* __Avatar image__
|
|
15
|
+
*
|
|
16
|
+
* An avatar image is an internal component used to control the rendering phases of an image.
|
|
17
|
+
*/
|
|
18
|
+
declare const AvatarImage: FC<AvatarImageProps>;
|
|
19
|
+
export default AvatarImage;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { MouseEventHandler, ReactNode, Ref } from 'react';
|
|
3
|
+
import { AvatarClickEventHandler } from './types';
|
|
4
|
+
export interface CustomAvatarItemProps {
|
|
5
|
+
testId?: string;
|
|
6
|
+
onClick?: MouseEventHandler;
|
|
7
|
+
className?: string;
|
|
8
|
+
href?: string;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
ref: Ref<HTMLElement>;
|
|
11
|
+
/**
|
|
12
|
+
* This is used in render props so is okay to be defined.
|
|
13
|
+
* eslint-disable-next-line consistent-props-definitions
|
|
14
|
+
*/
|
|
15
|
+
'aria-label'?: string;
|
|
16
|
+
'aria-disabled'?: boolean | 'false' | 'true' | undefined;
|
|
17
|
+
}
|
|
18
|
+
export interface AvatarItemProps {
|
|
19
|
+
/**
|
|
20
|
+
* Used to provide better content to screen readers when using presence/status. Rather
|
|
21
|
+
* than a screen reader speaking "online, approved, John Smith", passing in an label
|
|
22
|
+
* allows a custom message like "John Smith (approved and online)".
|
|
23
|
+
*/
|
|
24
|
+
label?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Slot to place an avatar element. Use @atlaskit/avatar.
|
|
27
|
+
*/
|
|
28
|
+
avatar: ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Change background color.
|
|
31
|
+
*/
|
|
32
|
+
backgroundColor?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Use a custom component instead of the default span.
|
|
35
|
+
*/
|
|
36
|
+
children?: (props: CustomAvatarItemProps) => ReactNode;
|
|
37
|
+
/**
|
|
38
|
+
* URL for avatars being used as a link.
|
|
39
|
+
*/
|
|
40
|
+
href?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Disable the item from being interactive
|
|
43
|
+
*/
|
|
44
|
+
isDisabled?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Handler to be called on click.
|
|
47
|
+
*/
|
|
48
|
+
onClick?: AvatarClickEventHandler;
|
|
49
|
+
/**
|
|
50
|
+
* PrimaryText text.
|
|
51
|
+
*/
|
|
52
|
+
primaryText?: ReactNode;
|
|
53
|
+
/**
|
|
54
|
+
* SecondaryText text.
|
|
55
|
+
*/
|
|
56
|
+
secondaryText?: ReactNode;
|
|
57
|
+
/**
|
|
58
|
+
* Pass target down to the anchor, if href is provided.
|
|
59
|
+
*/
|
|
60
|
+
target?: '_blank' | '_self' | '_top' | '_parent';
|
|
61
|
+
/**
|
|
62
|
+
* By default, overflowing text is truncated if it exceeds the container width. Use this prop to disable this.
|
|
63
|
+
*/
|
|
64
|
+
isTruncationDisabled?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests
|
|
67
|
+
*/
|
|
68
|
+
testId?: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* __Avatar item__
|
|
72
|
+
*
|
|
73
|
+
* An avatar item is a wrapper that goes around an avatar when it's displayed alongside text, such as a name or status.
|
|
74
|
+
*
|
|
75
|
+
* - [Examples](https://atlassian.design/components/avatar/avatar-item/examples)
|
|
76
|
+
* - [Code](https://atlassian.design/components/avatar/avatar-item/code)
|
|
77
|
+
*/
|
|
78
|
+
declare const AvatarItem: import("react").ForwardRefExoticComponent<AvatarItemProps & import("react").RefAttributes<HTMLElement>>;
|
|
79
|
+
export default AvatarItem;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { FC, ReactNode } from 'react';
|
|
3
|
+
interface IconWrapperProps {
|
|
4
|
+
bgColor?: string;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* __Icon wrapper__
|
|
9
|
+
*
|
|
10
|
+
* An icon wrapper is used internally only.
|
|
11
|
+
*/
|
|
12
|
+
declare const IconWrapper: FC<IconWrapperProps>;
|
|
13
|
+
export default IconWrapper;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { AppearanceType, IndicatorSizeType } from './types';
|
|
3
|
+
export declare type PresenceType = 'busy' | 'focus' | 'offline' | 'online' | ReactNode;
|
|
4
|
+
export interface PresenceProps {
|
|
5
|
+
/**
|
|
6
|
+
* Used to override the default border color of the presence indicator.
|
|
7
|
+
* Accepts any color argument that the border-color CSS property accepts.
|
|
8
|
+
*/
|
|
9
|
+
borderColor?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Content to use as a custom presence indicator (usually not required if
|
|
12
|
+
* consuming Presence separate to Avatar).
|
|
13
|
+
*/
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* The type of presence indicator to show
|
|
17
|
+
*/
|
|
18
|
+
presence?: PresenceType;
|
|
19
|
+
/**
|
|
20
|
+
* Test Id
|
|
21
|
+
*/
|
|
22
|
+
testId?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* __Avatar presence__
|
|
26
|
+
*
|
|
27
|
+
* A presence shows an avatar’s availability.
|
|
28
|
+
*
|
|
29
|
+
* - [Examples](https://atlassian.design/components/avatar/avatar-presence/examples)
|
|
30
|
+
* - [Code](https://atlassian.design/components/avatar/avatar-presence/code)
|
|
31
|
+
* - [Usage](https://atlassian.design/components/avatar/avatar-presence/usage)
|
|
32
|
+
*/
|
|
33
|
+
declare const AvatarPresence: FC<PresenceProps>;
|
|
34
|
+
export default AvatarPresence;
|
|
35
|
+
export interface PresenceWrapperProps extends PresenceProps {
|
|
36
|
+
appearance: AppearanceType;
|
|
37
|
+
size: IndicatorSizeType;
|
|
38
|
+
testId?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* __Presence wrapper__
|
|
42
|
+
*
|
|
43
|
+
* A presence wrapper is used internally to position presence ontop of the avatar.
|
|
44
|
+
*/
|
|
45
|
+
export declare const PresenceWrapper: FC<PresenceWrapperProps>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
import { AppearanceType, SizeType } from './types';
|
|
4
|
+
export interface SkeletonProps {
|
|
5
|
+
appearance?: AppearanceType;
|
|
6
|
+
color?: string;
|
|
7
|
+
size?: SizeType;
|
|
8
|
+
weight?: 'normal' | 'strong';
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* __Skeleton__
|
|
12
|
+
*
|
|
13
|
+
* A skeleton is the loading state for the avatar component.
|
|
14
|
+
*
|
|
15
|
+
* - [Examples](https://atlassian.design/components/avatar/avatar-skeleton/examples)
|
|
16
|
+
* - [Code](https://atlassian.design/components/avatar/avatar-skeleton/code)
|
|
17
|
+
*/
|
|
18
|
+
declare const Skeleton: FC<SkeletonProps>;
|
|
19
|
+
export default Skeleton;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { AppearanceType, IndicatorSizeType } from './types';
|
|
3
|
+
export declare type StatusType = ('approved' | 'declined' | 'locked') | ReactNode;
|
|
4
|
+
export interface StatusProps {
|
|
5
|
+
/**
|
|
6
|
+
* Override the default border color of the status indicator. This accepts
|
|
7
|
+
* any color argument that the CSS property `border-color` accepts.
|
|
8
|
+
*/
|
|
9
|
+
borderColor?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Content to use as a custom status indicator. Not needed if consuming
|
|
12
|
+
* `Status` separate to `Avatar`.
|
|
13
|
+
*/
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Content to use as a custom status indicator. Not needed if consuming
|
|
17
|
+
* `Status` separate to `Avatar`.
|
|
18
|
+
*/
|
|
19
|
+
status?: StatusType;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* __Avatar status__
|
|
23
|
+
*
|
|
24
|
+
* An avatar status shows contextual information, such as if someone approves or declines something.
|
|
25
|
+
*
|
|
26
|
+
* - [Examples](https://atlassian.design/components/avatar/avatar-status/examples)
|
|
27
|
+
* - [Code](https://atlassian.design/components/avatar/avatar-status/code)
|
|
28
|
+
*/
|
|
29
|
+
declare const AvatarStatus: FC<StatusProps>;
|
|
30
|
+
export default AvatarStatus;
|
|
31
|
+
interface StatusWrapperProps extends StatusProps {
|
|
32
|
+
appearance: AppearanceType;
|
|
33
|
+
size: IndicatorSizeType;
|
|
34
|
+
children: ReactNode;
|
|
35
|
+
testId?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Status wrapper**
|
|
39
|
+
*
|
|
40
|
+
* A status wrapper is used internally to position status ontop of the avatar.
|
|
41
|
+
*/
|
|
42
|
+
export declare const StatusWrapper: FC<StatusWrapperProps>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AvatarSizeMap, IndicatorSizeType } from './types';
|
|
2
|
+
export declare const AVATAR_SIZES: AvatarSizeMap;
|
|
3
|
+
export declare const AVATAR_RADIUS: AvatarSizeMap;
|
|
4
|
+
export declare const BORDER_WIDTH = 2;
|
|
5
|
+
export declare const ACTIVE_SCALE_FACTOR = 0.9;
|
|
6
|
+
export declare const ICON_SIZES: Record<IndicatorSizeType, number>;
|
|
7
|
+
export declare const ICON_OFFSET: Record<IndicatorSizeType, number>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '../Avatar';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { AppearanceType, SizeType, IndicatorSizeType, AvatarClickEventHandler, } from '../types';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { default } from './Avatar';
|
|
2
|
+
export type { AvatarPropTypes, CustomAvatarProps } from './Avatar';
|
|
3
|
+
export { default as AvatarItem } from './AvatarItem';
|
|
4
|
+
export type { AvatarItemProps, CustomAvatarItemProps } from './AvatarItem';
|
|
5
|
+
export { default as Presence } from './Presence';
|
|
6
|
+
export type { PresenceProps, PresenceType } from './Presence';
|
|
7
|
+
export { default as Status } from './Status';
|
|
8
|
+
export type { StatusProps, StatusType } from './Status';
|
|
9
|
+
export { default as Skeleton } from './Skeleton';
|
|
10
|
+
export type { SkeletonProps } from './Skeleton';
|
|
11
|
+
export { AVATAR_SIZES, BORDER_WIDTH, AVATAR_RADIUS, ACTIVE_SCALE_FACTOR, } from './constants';
|
|
12
|
+
export type { AvatarClickEventHandler, AppearanceType, SizeType, IndicatorSizeType, } from './types';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
+
export declare type AvatarSizeMap = Record<SizeType, number>;
|
|
4
|
+
export declare type AppearanceType = 'circle' | 'square';
|
|
5
|
+
export declare type SizeType = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge';
|
|
6
|
+
export declare type IndicatorSizeType = 'small' | 'medium' | 'large' | 'xlarge';
|
|
7
|
+
export declare type AvatarClickEventHandler = (event: React.MouseEvent, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MouseEventHandler } from 'react';
|
|
2
|
+
export declare const getLinkProps: (href: string, target?: string | undefined) => {
|
|
3
|
+
href: string;
|
|
4
|
+
rel: string | null;
|
|
5
|
+
target: string | undefined;
|
|
6
|
+
};
|
|
7
|
+
export declare const getButtonProps: (onClick: MouseEventHandler) => {
|
|
8
|
+
type: string;
|
|
9
|
+
onClick: MouseEventHandler<Element>;
|
|
10
|
+
};
|
|
11
|
+
export declare const getCustomElement: (isDisabled?: boolean | undefined, href?: string | undefined, onClick?: MouseEventHandler<Element> | undefined) => "button" | "a" | "span";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/avatar",
|
|
3
|
-
"version": "21.0.
|
|
3
|
+
"version": "21.0.2",
|
|
4
4
|
"description": "An avatar is a visual representation of a user or entity.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -12,6 +12,13 @@
|
|
|
12
12
|
"module": "dist/esm/index.js",
|
|
13
13
|
"module:es2019": "dist/es2019/index.js",
|
|
14
14
|
"types": "dist/types/index.d.ts",
|
|
15
|
+
"typesVersions": {
|
|
16
|
+
">=4.0 <4.5": {
|
|
17
|
+
"*": [
|
|
18
|
+
"dist/types-ts4.0/*"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
},
|
|
15
22
|
"sideEffects": false,
|
|
16
23
|
"atlaskit:src": "src/index.ts",
|
|
17
24
|
"atlassian": {
|
|
@@ -34,7 +41,7 @@
|
|
|
34
41
|
"dependencies": {
|
|
35
42
|
"@atlaskit/analytics-next": "^8.0.0",
|
|
36
43
|
"@atlaskit/icon": "^21.10.0",
|
|
37
|
-
"@atlaskit/theme": "^12.
|
|
44
|
+
"@atlaskit/theme": "^12.2.0",
|
|
38
45
|
"@atlaskit/tokens": "^0.10.0",
|
|
39
46
|
"@babel/runtime": "^7.0.0",
|
|
40
47
|
"@emotion/core": "^10.0.9"
|
|
@@ -45,22 +52,23 @@
|
|
|
45
52
|
"devDependencies": {
|
|
46
53
|
"@atlaskit/button": "^16.3.0",
|
|
47
54
|
"@atlaskit/docs": "*",
|
|
55
|
+
"@atlaskit/ds-lib": "^2.1.1",
|
|
48
56
|
"@atlaskit/field-base": "^15.0.0",
|
|
49
57
|
"@atlaskit/icon": "^21.10.0",
|
|
50
|
-
"@atlaskit/section-message": "^6.
|
|
58
|
+
"@atlaskit/section-message": "^6.2.0",
|
|
51
59
|
"@atlaskit/ssr": "*",
|
|
52
|
-
"@atlaskit/toggle": "^12.
|
|
60
|
+
"@atlaskit/toggle": "^12.5.0",
|
|
53
61
|
"@atlaskit/tooltip": "^17.5.0",
|
|
54
62
|
"@atlaskit/visual-regression": "*",
|
|
55
63
|
"@atlaskit/webdriver-runner": "*",
|
|
56
64
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
57
|
-
"@emotion/styled": "^
|
|
58
|
-
"@testing-library/react": "^
|
|
65
|
+
"@emotion/styled": "^11.0.0",
|
|
66
|
+
"@testing-library/react": "^12.1.5",
|
|
59
67
|
"@types/jscodeshift": "^0.11.0",
|
|
60
68
|
"color-contrast-checker": "^1.5.0",
|
|
61
69
|
"jscodeshift": "^0.13.0",
|
|
62
70
|
"react-dom": "^16.8.0",
|
|
63
|
-
"typescript": "4.
|
|
71
|
+
"typescript": "4.5.5",
|
|
64
72
|
"wait-for-expect": "^1.2.0"
|
|
65
73
|
},
|
|
66
74
|
"keywords": [
|
package/types/package.json
CHANGED
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/types.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/types.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/types.d.ts"
|
|
7
|
+
"types": "../dist/types/entry-points/types.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/entry-points/types.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|