@atlaskit/avatar-group 9.1.0 → 9.1.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/CHANGELOG.md +12 -0
- package/dist/cjs/components/grid.js +12 -6
- package/dist/cjs/components/stack.js +6 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/grid.js +12 -6
- package/dist/es2019/components/stack.js +6 -3
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/grid.js +12 -6
- package/dist/esm/components/stack.js +6 -3
- package/dist/esm/version.json +1 -1
- package/package.json +7 -12
- package/report.api.md +40 -102
- package/dist/types-ts4.0/components/avatar-group-item.d.ts +0 -12
- package/dist/types-ts4.0/components/avatar-group.d.ts +0 -103
- package/dist/types-ts4.0/components/grid.d.ts +0 -8
- package/dist/types-ts4.0/components/more-indicator.d.ts +0 -13
- package/dist/types-ts4.0/components/stack.d.ts +0 -8
- package/dist/types-ts4.0/components/types.d.ts +0 -21
- package/dist/types-ts4.0/components/utils.d.ts +0 -2
- package/dist/types-ts4.0/index.d.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/avatar-group
|
|
2
2
|
|
|
3
|
+
## 9.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 9.1.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`bc989043572`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bc989043572) - Internal changes to apply spacing tokens. This should be a no-op change.
|
|
14
|
+
|
|
3
15
|
## 9.1.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -17,20 +17,26 @@ var gutter = gridSize / 2;
|
|
|
17
17
|
var listStyles = (0, _react2.css)({
|
|
18
18
|
// removes default ul styles. Needs !important to override contextual styles in product.
|
|
19
19
|
display: 'flex',
|
|
20
|
-
|
|
20
|
+
// TODO Delete this comment after verifying spacing token -> previous value `0`
|
|
21
|
+
margin: "var(--ds-scale-0, 0px)",
|
|
21
22
|
marginRight: -gutter,
|
|
22
23
|
marginLeft: -gutter,
|
|
23
|
-
|
|
24
|
+
// TODO Delete this comment after verifying spacing token -> previous value `0`
|
|
25
|
+
padding: "var(--ds-scale-0, 0px)",
|
|
24
26
|
justifyContent: 'flex-start',
|
|
25
27
|
flexWrap: 'wrap',
|
|
26
28
|
lineHeight: 1,
|
|
27
29
|
listStyleType: 'none !important'
|
|
28
30
|
});
|
|
29
31
|
var listItemStyles = (0, _react2.css)({
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
// TODO Delete this comment after verifying spacing token -> previous value `0`
|
|
33
|
+
margin: "var(--ds-scale-0, 0px)",
|
|
34
|
+
// TODO Delete this comment after verifying spacing token -> previous value `gridSize`
|
|
35
|
+
marginBottom: "var(--ds-scale-100, 8px)",
|
|
36
|
+
// TODO Delete this comment after verifying spacing token -> previous value `gutter`
|
|
37
|
+
paddingRight: "var(--ds-scale-050, 4px)",
|
|
38
|
+
// TODO Delete this comment after verifying spacing token -> previous value `gutter`
|
|
39
|
+
paddingLeft: "var(--ds-scale-050, 4px)"
|
|
34
40
|
});
|
|
35
41
|
|
|
36
42
|
var Grid = function Grid(_ref) {
|
|
@@ -17,14 +17,17 @@ var _constants = require("@atlaskit/theme/constants");
|
|
|
17
17
|
var gutter = _avatar.BORDER_WIDTH * 2 + (0, _constants.gridSize)() / 2;
|
|
18
18
|
var listStyles = (0, _react2.css)({
|
|
19
19
|
display: 'flex',
|
|
20
|
-
|
|
20
|
+
// TODO Delete this comment after verifying spacing token -> previous value `0`
|
|
21
|
+
margin: "var(--ds-scale-0, 0px)",
|
|
21
22
|
marginRight: gutter,
|
|
22
|
-
|
|
23
|
+
// TODO Delete this comment after verifying spacing token -> previous value `0`
|
|
24
|
+
padding: "var(--ds-scale-0, 0px)",
|
|
23
25
|
lineHeight: 1,
|
|
24
26
|
listStyleType: 'none !important'
|
|
25
27
|
});
|
|
26
28
|
var listItemStyles = (0, _react2.css)({
|
|
27
|
-
|
|
29
|
+
// TODO Delete this comment after verifying spacing token -> previous value `0`
|
|
30
|
+
margin: "var(--ds-scale-0, 0px)",
|
|
28
31
|
marginRight: -gutter
|
|
29
32
|
});
|
|
30
33
|
|
package/dist/cjs/version.json
CHANGED
|
@@ -7,20 +7,26 @@ const gutter = gridSize / 2;
|
|
|
7
7
|
const listStyles = css({
|
|
8
8
|
// removes default ul styles. Needs !important to override contextual styles in product.
|
|
9
9
|
display: 'flex',
|
|
10
|
-
|
|
10
|
+
// TODO Delete this comment after verifying spacing token -> previous value `0`
|
|
11
|
+
margin: "var(--ds-scale-0, 0px)",
|
|
11
12
|
marginRight: -gutter,
|
|
12
13
|
marginLeft: -gutter,
|
|
13
|
-
|
|
14
|
+
// TODO Delete this comment after verifying spacing token -> previous value `0`
|
|
15
|
+
padding: "var(--ds-scale-0, 0px)",
|
|
14
16
|
justifyContent: 'flex-start',
|
|
15
17
|
flexWrap: 'wrap',
|
|
16
18
|
lineHeight: 1,
|
|
17
19
|
listStyleType: 'none !important'
|
|
18
20
|
});
|
|
19
21
|
const listItemStyles = css({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
// TODO Delete this comment after verifying spacing token -> previous value `0`
|
|
23
|
+
margin: "var(--ds-scale-0, 0px)",
|
|
24
|
+
// TODO Delete this comment after verifying spacing token -> previous value `gridSize`
|
|
25
|
+
marginBottom: "var(--ds-scale-100, 8px)",
|
|
26
|
+
// TODO Delete this comment after verifying spacing token -> previous value `gutter`
|
|
27
|
+
paddingRight: "var(--ds-scale-050, 4px)",
|
|
28
|
+
// TODO Delete this comment after verifying spacing token -> previous value `gutter`
|
|
29
|
+
paddingLeft: "var(--ds-scale-050, 4px)"
|
|
24
30
|
});
|
|
25
31
|
|
|
26
32
|
const Grid = ({
|
|
@@ -6,14 +6,17 @@ import { gridSize } from '@atlaskit/theme/constants';
|
|
|
6
6
|
const gutter = BORDER_WIDTH * 2 + gridSize() / 2;
|
|
7
7
|
const listStyles = css({
|
|
8
8
|
display: 'flex',
|
|
9
|
-
|
|
9
|
+
// TODO Delete this comment after verifying spacing token -> previous value `0`
|
|
10
|
+
margin: "var(--ds-scale-0, 0px)",
|
|
10
11
|
marginRight: gutter,
|
|
11
|
-
|
|
12
|
+
// TODO Delete this comment after verifying spacing token -> previous value `0`
|
|
13
|
+
padding: "var(--ds-scale-0, 0px)",
|
|
12
14
|
lineHeight: 1,
|
|
13
15
|
listStyleType: 'none !important'
|
|
14
16
|
});
|
|
15
17
|
const listItemStyles = css({
|
|
16
|
-
|
|
18
|
+
// TODO Delete this comment after verifying spacing token -> previous value `0`
|
|
19
|
+
margin: "var(--ds-scale-0, 0px)",
|
|
17
20
|
marginRight: -gutter
|
|
18
21
|
});
|
|
19
22
|
|
package/dist/es2019/version.json
CHANGED
|
@@ -7,20 +7,26 @@ var gutter = gridSize / 2;
|
|
|
7
7
|
var listStyles = css({
|
|
8
8
|
// removes default ul styles. Needs !important to override contextual styles in product.
|
|
9
9
|
display: 'flex',
|
|
10
|
-
|
|
10
|
+
// TODO Delete this comment after verifying spacing token -> previous value `0`
|
|
11
|
+
margin: "var(--ds-scale-0, 0px)",
|
|
11
12
|
marginRight: -gutter,
|
|
12
13
|
marginLeft: -gutter,
|
|
13
|
-
|
|
14
|
+
// TODO Delete this comment after verifying spacing token -> previous value `0`
|
|
15
|
+
padding: "var(--ds-scale-0, 0px)",
|
|
14
16
|
justifyContent: 'flex-start',
|
|
15
17
|
flexWrap: 'wrap',
|
|
16
18
|
lineHeight: 1,
|
|
17
19
|
listStyleType: 'none !important'
|
|
18
20
|
});
|
|
19
21
|
var listItemStyles = css({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
// TODO Delete this comment after verifying spacing token -> previous value `0`
|
|
23
|
+
margin: "var(--ds-scale-0, 0px)",
|
|
24
|
+
// TODO Delete this comment after verifying spacing token -> previous value `gridSize`
|
|
25
|
+
marginBottom: "var(--ds-scale-100, 8px)",
|
|
26
|
+
// TODO Delete this comment after verifying spacing token -> previous value `gutter`
|
|
27
|
+
paddingRight: "var(--ds-scale-050, 4px)",
|
|
28
|
+
// TODO Delete this comment after verifying spacing token -> previous value `gutter`
|
|
29
|
+
paddingLeft: "var(--ds-scale-050, 4px)"
|
|
24
30
|
});
|
|
25
31
|
|
|
26
32
|
var Grid = function Grid(_ref) {
|
|
@@ -6,14 +6,17 @@ import { gridSize } from '@atlaskit/theme/constants';
|
|
|
6
6
|
var gutter = BORDER_WIDTH * 2 + gridSize() / 2;
|
|
7
7
|
var listStyles = css({
|
|
8
8
|
display: 'flex',
|
|
9
|
-
|
|
9
|
+
// TODO Delete this comment after verifying spacing token -> previous value `0`
|
|
10
|
+
margin: "var(--ds-scale-0, 0px)",
|
|
10
11
|
marginRight: gutter,
|
|
11
|
-
|
|
12
|
+
// TODO Delete this comment after verifying spacing token -> previous value `0`
|
|
13
|
+
padding: "var(--ds-scale-0, 0px)",
|
|
12
14
|
lineHeight: 1,
|
|
13
15
|
listStyleType: 'none !important'
|
|
14
16
|
});
|
|
15
17
|
var listItemStyles = css({
|
|
16
|
-
|
|
18
|
+
// TODO Delete this comment after verifying spacing token -> previous value `0`
|
|
19
|
+
margin: "var(--ds-scale-0, 0px)",
|
|
17
20
|
marginRight: -gutter
|
|
18
21
|
});
|
|
19
22
|
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/avatar-group",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.2",
|
|
4
4
|
"description": "An avatar group displays a number of avatars grouped together in a stack or grid.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -12,16 +12,10 @@
|
|
|
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
|
-
},
|
|
22
15
|
"sideEffects": false,
|
|
23
16
|
"atlaskit:src": "src/index.tsx",
|
|
24
17
|
"atlassian": {
|
|
18
|
+
"disableProductCI": true,
|
|
25
19
|
"team": "Design System Team",
|
|
26
20
|
"releaseModel": "scheduled",
|
|
27
21
|
"website": {
|
|
@@ -34,10 +28,10 @@
|
|
|
34
28
|
},
|
|
35
29
|
"dependencies": {
|
|
36
30
|
"@atlaskit/avatar": "^21.1.0",
|
|
37
|
-
"@atlaskit/menu": "^1.
|
|
31
|
+
"@atlaskit/menu": "^1.4.0",
|
|
38
32
|
"@atlaskit/popup": "^1.5.0",
|
|
39
33
|
"@atlaskit/theme": "^12.2.0",
|
|
40
|
-
"@atlaskit/tokens": "^0.
|
|
34
|
+
"@atlaskit/tokens": "^0.11.0",
|
|
41
35
|
"@atlaskit/tooltip": "^17.6.0",
|
|
42
36
|
"@babel/runtime": "^7.0.0",
|
|
43
37
|
"@emotion/react": "^11.7.1"
|
|
@@ -47,11 +41,11 @@
|
|
|
47
41
|
},
|
|
48
42
|
"devDependencies": {
|
|
49
43
|
"@atlaskit/analytics-next": "^8.2.0",
|
|
50
|
-
"@atlaskit/button": "^16.
|
|
44
|
+
"@atlaskit/button": "^16.4.0",
|
|
51
45
|
"@atlaskit/code": "^14.4.0",
|
|
52
46
|
"@atlaskit/docs": "*",
|
|
53
47
|
"@atlaskit/ds-lib": "^2.1.1",
|
|
54
|
-
"@atlaskit/form": "^8.
|
|
48
|
+
"@atlaskit/form": "^8.7.0",
|
|
55
49
|
"@atlaskit/icon": "^21.11.0",
|
|
56
50
|
"@atlaskit/modal-dialog": "^12.4.0",
|
|
57
51
|
"@atlaskit/section-message": "^6.3.0",
|
|
@@ -81,6 +75,7 @@
|
|
|
81
75
|
"design-system": "v1",
|
|
82
76
|
"ui-components": "lite-mode",
|
|
83
77
|
"analytics": "analytics-next",
|
|
78
|
+
"design-tokens": "spacing",
|
|
84
79
|
"theming": "tokens",
|
|
85
80
|
"deprecation": "no-deprecated-imports",
|
|
86
81
|
"styling": [
|
package/report.api.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
## API Report File for "@atlaskit/avatar-group"
|
|
1
|
+
## API Report File for "@atlaskit/avatar-group"
|
|
2
2
|
|
|
3
|
-
> Do not edit this file.
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
<!--
|
|
6
|
+
Generated API Report version: 2.0
|
|
7
|
+
-->
|
|
4
8
|
|
|
5
9
|
[Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
6
10
|
|
|
@@ -13,16 +17,8 @@ import { MouseEventHandler } from 'react';
|
|
|
13
17
|
import type { ReactNode } from 'react';
|
|
14
18
|
import { SizeType } from '@atlaskit/avatar';
|
|
15
19
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*
|
|
19
|
-
* An avatar group displays a number of avatars grouped together in a stack or grid.
|
|
20
|
-
*
|
|
21
|
-
* - [Examples](https://atlassian.design/components/avatar-group/examples)
|
|
22
|
-
* - [Code](https://atlassian.design/components/avatar-group/code)
|
|
23
|
-
* - [Usage](https://atlassian.design/components/avatar-group/usage)
|
|
24
|
-
*/
|
|
25
|
-
declare const AvatarGroup: ({
|
|
20
|
+
// @public
|
|
21
|
+
const AvatarGroup: ({
|
|
26
22
|
appearance,
|
|
27
23
|
avatar,
|
|
28
24
|
borderColor,
|
|
@@ -40,131 +36,73 @@ declare const AvatarGroup: ({
|
|
|
40
36
|
}: AvatarGroupProps) => jsx.JSX.Element;
|
|
41
37
|
export default AvatarGroup;
|
|
42
38
|
|
|
43
|
-
|
|
39
|
+
// @public (undocumented)
|
|
40
|
+
interface AvatarGroupItemProps {
|
|
41
|
+
// (undocumented)
|
|
44
42
|
avatar: AvatarProps;
|
|
43
|
+
// (undocumented)
|
|
44
|
+
index: number;
|
|
45
|
+
// (undocumented)
|
|
45
46
|
isActive?: boolean;
|
|
47
|
+
// (undocumented)
|
|
46
48
|
isHover?: boolean;
|
|
47
|
-
|
|
49
|
+
// (undocumented)
|
|
48
50
|
onAvatarClick?: onAvatarClickHandler;
|
|
51
|
+
// (undocumented)
|
|
49
52
|
testId?: string;
|
|
50
53
|
}
|
|
51
54
|
|
|
52
|
-
|
|
53
|
-
|
|
55
|
+
// @public (undocumented)
|
|
56
|
+
interface AvatarGroupOverrides {
|
|
57
|
+
// (undocumented)
|
|
58
|
+
Avatar?: {
|
|
54
59
|
render?: (
|
|
55
|
-
Component: ElementType<
|
|
56
|
-
props:
|
|
60
|
+
Component: ElementType<AvatarProps>,
|
|
61
|
+
props: AvatarProps,
|
|
57
62
|
index: number,
|
|
58
63
|
) => ReactNode;
|
|
59
64
|
};
|
|
60
|
-
|
|
65
|
+
// (undocumented)
|
|
66
|
+
AvatarGroupItem?: {
|
|
61
67
|
render?: (
|
|
62
|
-
Component: ElementType<
|
|
63
|
-
props:
|
|
68
|
+
Component: ElementType<AvatarGroupItemProps>,
|
|
69
|
+
props: AvatarGroupItemProps,
|
|
64
70
|
index: number,
|
|
65
71
|
) => ReactNode;
|
|
66
72
|
};
|
|
67
73
|
}
|
|
68
74
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
* Indicates the layout of the avatar-group.
|
|
72
|
-
* Avatars will either be overlapped in a stack, or
|
|
73
|
-
* laid out in an even grid formation
|
|
74
|
-
* Defaults to "stack".
|
|
75
|
-
*/
|
|
75
|
+
// @public (undocumented)
|
|
76
|
+
export interface AvatarGroupProps {
|
|
76
77
|
appearance?: 'grid' | 'stack';
|
|
77
|
-
/**
|
|
78
|
-
* Component used to render each avatar
|
|
79
|
-
*/
|
|
80
78
|
avatar?: ElementType<AvatarProps>;
|
|
81
|
-
/**
|
|
82
|
-
* The maximum number of avatars allowed in the list.
|
|
83
|
-
* Defaults to 5 when displayed as a stack,
|
|
84
|
-
* and 11 when displayed as a grid.
|
|
85
|
-
*/
|
|
86
|
-
maxCount?: number;
|
|
87
|
-
/**
|
|
88
|
-
* Defines the size of the avatar.
|
|
89
|
-
* Defaults to "medium".
|
|
90
|
-
*/
|
|
91
|
-
size?: SizeType;
|
|
92
|
-
/**
|
|
93
|
-
* Typically the background color that the avatar is presented on.
|
|
94
|
-
* Accepts any color argument that the CSS border-color property accepts.
|
|
95
|
-
*/
|
|
96
79
|
borderColor?: string;
|
|
97
|
-
|
|
98
|
-
* Array of avatar data passed to each `avatar` component.
|
|
99
|
-
* These props will be spread on to the component passed into avatar.
|
|
100
|
-
*/
|
|
80
|
+
boundariesElement?: 'viewport' | 'window' | 'scrollParent';
|
|
101
81
|
data: Array<AvatarProps>;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
*/
|
|
82
|
+
isTooltipDisabled?: boolean;
|
|
83
|
+
label?: string;
|
|
84
|
+
maxCount?: number;
|
|
106
85
|
onAvatarClick?: onAvatarClickHandler;
|
|
107
|
-
/**
|
|
108
|
-
* Take control of the click event on the more indicator.
|
|
109
|
-
* This will cancel the default dropdown behavior.
|
|
110
|
-
*/
|
|
111
86
|
onMoreClick?: MouseEventHandler;
|
|
112
|
-
|
|
113
|
-
* Provide additional props to the MoreButton.
|
|
114
|
-
* Example use cases: altering tab order by providing tabIndex;
|
|
115
|
-
* adding onClick behaviour without losing the default dropdown
|
|
116
|
-
*/
|
|
87
|
+
overrides?: AvatarGroupOverrides;
|
|
117
88
|
showMoreButtonProps?: Partial<React.HTMLAttributes<HTMLElement>>;
|
|
118
|
-
|
|
119
|
-
* Element the overflow popup should be attached to.
|
|
120
|
-
* Defaults to "viewport".
|
|
121
|
-
*/
|
|
122
|
-
boundariesElement?: 'viewport' | 'window' | 'scrollParent';
|
|
123
|
-
/**
|
|
124
|
-
* A `testId` prop is provided for specified elements,
|
|
125
|
-
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
126
|
-
* serving as a hook for automated tests.
|
|
127
|
-
*/
|
|
128
|
-
/**
|
|
129
|
-
* Will set these elements when defined:
|
|
130
|
-
* - Container element - `{testId}--avatar-group`
|
|
131
|
-
* - Avatar items - `{testId}--avatar-{index}`
|
|
132
|
-
* - Overflow menu button - `{testId}--overflow-menu--trigger`
|
|
133
|
-
* - Overflow menu content - `{testId}--overflow-menu--content`
|
|
134
|
-
*/
|
|
89
|
+
size?: SizeType;
|
|
135
90
|
testId?: string;
|
|
136
|
-
/**
|
|
137
|
-
* Custom overrides for the composed components.
|
|
138
|
-
*/
|
|
139
|
-
overrides?: AvatarGroupOverrides;
|
|
140
|
-
/**
|
|
141
|
-
* Disables tooltips
|
|
142
|
-
*/
|
|
143
|
-
isTooltipDisabled?: boolean;
|
|
144
|
-
/**
|
|
145
|
-
Text to be used as aria-label for the list of avatars.
|
|
146
|
-
Screen reader announcement with default label, which is `avatar group`, is `list, avatar group, X items`.
|
|
147
|
-
|
|
148
|
-
The label should describe the `AvatarGroup`'s entities, for instance:
|
|
149
|
-
- `label="team members"`, screen reader announcement would be `list team members, X items`
|
|
150
|
-
- `label="reviewers"` screen reader announcement would be `list reviewers, X items`
|
|
151
|
-
|
|
152
|
-
When there are several AvatarGroups on the page you should use a unique label to let users distinguish different lists.
|
|
153
|
-
*/
|
|
154
|
-
label?: string;
|
|
155
91
|
}
|
|
156
92
|
|
|
157
|
-
|
|
93
|
+
// @public (undocumented)
|
|
94
|
+
export type AvatarProps = AvatarPropTypes & {
|
|
158
95
|
name: string;
|
|
159
96
|
enableTooltip?: boolean;
|
|
160
97
|
key?: string | number;
|
|
161
98
|
};
|
|
162
99
|
|
|
163
|
-
|
|
100
|
+
// @public (undocumented)
|
|
101
|
+
type onAvatarClickHandler = (
|
|
164
102
|
event: React.MouseEvent,
|
|
165
103
|
analyticsEvent: AnalyticsEvent | undefined,
|
|
166
104
|
index: number,
|
|
167
105
|
) => void;
|
|
168
106
|
|
|
169
|
-
|
|
107
|
+
// (No @packageDocumentation comment for this package)
|
|
170
108
|
```
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { AvatarProps, onAvatarClickHandler } from './types';
|
|
3
|
-
export interface AvatarGroupItemProps {
|
|
4
|
-
avatar: AvatarProps;
|
|
5
|
-
isActive?: boolean;
|
|
6
|
-
isHover?: boolean;
|
|
7
|
-
index: number;
|
|
8
|
-
onAvatarClick?: onAvatarClickHandler;
|
|
9
|
-
testId?: string;
|
|
10
|
-
}
|
|
11
|
-
declare const AvatarGroupItem: FC<AvatarGroupItemProps>;
|
|
12
|
-
export default AvatarGroupItem;
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { ElementType, MouseEventHandler } from 'react';
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
4
|
-
import { SizeType } from '@atlaskit/avatar';
|
|
5
|
-
import { AvatarGroupOverrides, AvatarProps, onAvatarClickHandler } from './types';
|
|
6
|
-
export interface AvatarGroupProps {
|
|
7
|
-
/**
|
|
8
|
-
* Indicates the layout of the avatar-group.
|
|
9
|
-
* Avatars will either be overlapped in a stack, or
|
|
10
|
-
* laid out in an even grid formation
|
|
11
|
-
* Defaults to "stack".
|
|
12
|
-
*/
|
|
13
|
-
appearance?: 'grid' | 'stack';
|
|
14
|
-
/**
|
|
15
|
-
* Component used to render each avatar
|
|
16
|
-
*/
|
|
17
|
-
avatar?: ElementType<AvatarProps>;
|
|
18
|
-
/**
|
|
19
|
-
* The maximum number of avatars allowed in the list.
|
|
20
|
-
* Defaults to 5 when displayed as a stack,
|
|
21
|
-
* and 11 when displayed as a grid.
|
|
22
|
-
*/
|
|
23
|
-
maxCount?: number;
|
|
24
|
-
/**
|
|
25
|
-
* Defines the size of the avatar.
|
|
26
|
-
* Defaults to "medium".
|
|
27
|
-
*/
|
|
28
|
-
size?: SizeType;
|
|
29
|
-
/**
|
|
30
|
-
* Typically the background color that the avatar is presented on.
|
|
31
|
-
* Accepts any color argument that the CSS border-color property accepts.
|
|
32
|
-
*/
|
|
33
|
-
borderColor?: string;
|
|
34
|
-
/**
|
|
35
|
-
* Array of avatar data passed to each `avatar` component.
|
|
36
|
-
* These props will be spread on to the component passed into avatar.
|
|
37
|
-
*/
|
|
38
|
-
data: Array<AvatarProps>;
|
|
39
|
-
/**
|
|
40
|
-
* Handle the click event on the avatar item.
|
|
41
|
-
* Note that if an onClick prop is provided as part of avatar data, it will take precedence over onAvatarClick.
|
|
42
|
-
*/
|
|
43
|
-
onAvatarClick?: onAvatarClickHandler;
|
|
44
|
-
/**
|
|
45
|
-
* Take control of the click event on the more indicator.
|
|
46
|
-
* This will cancel the default dropdown behavior.
|
|
47
|
-
*/
|
|
48
|
-
onMoreClick?: MouseEventHandler;
|
|
49
|
-
/**
|
|
50
|
-
* Provide additional props to the MoreButton.
|
|
51
|
-
* Example use cases: altering tab order by providing tabIndex;
|
|
52
|
-
* adding onClick behaviour without losing the default dropdown
|
|
53
|
-
*/
|
|
54
|
-
showMoreButtonProps?: Partial<React.HTMLAttributes<HTMLElement>>;
|
|
55
|
-
/**
|
|
56
|
-
* Element the overflow popup should be attached to.
|
|
57
|
-
* Defaults to "viewport".
|
|
58
|
-
*/
|
|
59
|
-
boundariesElement?: 'viewport' | 'window' | 'scrollParent';
|
|
60
|
-
/**
|
|
61
|
-
* A `testId` prop is provided for specified elements,
|
|
62
|
-
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
63
|
-
* serving as a hook for automated tests.
|
|
64
|
-
*/
|
|
65
|
-
/**
|
|
66
|
-
* Will set these elements when defined:
|
|
67
|
-
* - Container element - `{testId}--avatar-group`
|
|
68
|
-
* - Avatar items - `{testId}--avatar-{index}`
|
|
69
|
-
* - Overflow menu button - `{testId}--overflow-menu--trigger`
|
|
70
|
-
* - Overflow menu content - `{testId}--overflow-menu--content`
|
|
71
|
-
*/
|
|
72
|
-
testId?: string;
|
|
73
|
-
/**
|
|
74
|
-
* Custom overrides for the composed components.
|
|
75
|
-
*/
|
|
76
|
-
overrides?: AvatarGroupOverrides;
|
|
77
|
-
/**
|
|
78
|
-
* Disables tooltips
|
|
79
|
-
*/
|
|
80
|
-
isTooltipDisabled?: boolean;
|
|
81
|
-
/**
|
|
82
|
-
Text to be used as aria-label for the list of avatars.
|
|
83
|
-
Screen reader announcement with default label, which is `avatar group`, is `list, avatar group, X items`.
|
|
84
|
-
|
|
85
|
-
The label should describe the `AvatarGroup`'s entities, for instance:
|
|
86
|
-
- `label="team members"`, screen reader announcement would be `list team members, X items`
|
|
87
|
-
- `label="reviewers"` screen reader announcement would be `list reviewers, X items`
|
|
88
|
-
|
|
89
|
-
When there are several AvatarGroups on the page you should use a unique label to let users distinguish different lists.
|
|
90
|
-
*/
|
|
91
|
-
label?: string;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* __Avatar group__
|
|
95
|
-
*
|
|
96
|
-
* An avatar group displays a number of avatars grouped together in a stack or grid.
|
|
97
|
-
*
|
|
98
|
-
* - [Examples](https://atlassian.design/components/avatar-group/examples)
|
|
99
|
-
* - [Code](https://atlassian.design/components/avatar-group/code)
|
|
100
|
-
* - [Usage](https://atlassian.design/components/avatar-group/usage)
|
|
101
|
-
*/
|
|
102
|
-
declare const AvatarGroup: ({ appearance, avatar, borderColor, boundariesElement, data, isTooltipDisabled, maxCount, onAvatarClick, onMoreClick, overrides, showMoreButtonProps, size, testId, label, }: AvatarGroupProps) => jsx.JSX.Element;
|
|
103
|
-
export default AvatarGroup;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { AvatarClickEventHandler, AvatarPropTypes } from '@atlaskit/avatar';
|
|
3
|
-
export interface MoreIndicatorProps extends AvatarPropTypes {
|
|
4
|
-
count: number;
|
|
5
|
-
'aria-controls'?: string;
|
|
6
|
-
'aria-expanded'?: boolean;
|
|
7
|
-
'aria-haspopup'?: boolean;
|
|
8
|
-
buttonProps: Partial<React.HTMLAttributes<HTMLElement>>;
|
|
9
|
-
onClick: AvatarClickEventHandler;
|
|
10
|
-
isActive: boolean;
|
|
11
|
-
}
|
|
12
|
-
declare const MoreIndicator: import("react").ForwardRefExoticComponent<MoreIndicatorProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
13
|
-
export default MoreIndicator;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { ElementType, ReactNode } from 'react';
|
|
2
|
-
import type { AnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
-
import type { AvatarPropTypes } from '@atlaskit/avatar';
|
|
4
|
-
import type { AvatarGroupItemProps } from './avatar-group-item';
|
|
5
|
-
export declare type DeepRequired<T> = {
|
|
6
|
-
[P in keyof T]-?: Required<T[P]>;
|
|
7
|
-
};
|
|
8
|
-
export declare type AvatarProps = AvatarPropTypes & {
|
|
9
|
-
name: string;
|
|
10
|
-
enableTooltip?: boolean;
|
|
11
|
-
key?: string | number;
|
|
12
|
-
};
|
|
13
|
-
export interface AvatarGroupOverrides {
|
|
14
|
-
AvatarGroupItem?: {
|
|
15
|
-
render?: (Component: ElementType<AvatarGroupItemProps>, props: AvatarGroupItemProps, index: number) => ReactNode;
|
|
16
|
-
};
|
|
17
|
-
Avatar?: {
|
|
18
|
-
render?: (Component: ElementType<AvatarProps>, props: AvatarProps, index: number) => ReactNode;
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export declare type onAvatarClickHandler = (event: React.MouseEvent, analyticsEvent: AnalyticsEvent | undefined, index: number) => void;
|