@atlaskit/avatar-group 9.0.3 → 9.1.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.md +16 -0
- package/dist/cjs/components/avatar-group.js +9 -9
- package/dist/cjs/components/grid.js +5 -5
- package/dist/cjs/components/more-indicator.js +5 -5
- package/dist/cjs/components/stack.js +5 -5
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/avatar-group.js +1 -1
- package/dist/es2019/components/grid.js +1 -1
- package/dist/es2019/components/more-indicator.js +1 -1
- package/dist/es2019/components/stack.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/avatar-group.js +1 -1
- package/dist/esm/components/grid.js +1 -1
- package/dist/esm/components/more-indicator.js +1 -1
- package/dist/esm/components/stack.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/components/avatar-group.d.ts +2 -1
- package/dist/types/components/types.d.ts +0 -2
- package/dist/types-ts4.0/components/avatar-group-item.d.ts +12 -0
- package/dist/types-ts4.0/components/avatar-group.d.ts +103 -0
- package/dist/types-ts4.0/components/grid.d.ts +8 -0
- package/dist/types-ts4.0/components/more-indicator.d.ts +13 -0
- package/dist/types-ts4.0/components/stack.d.ts +8 -0
- package/dist/types-ts4.0/components/types.d.ts +21 -0
- package/dist/types-ts4.0/components/utils.d.ts +2 -0
- package/dist/types-ts4.0/index.d.ts +3 -0
- package/package.json +20 -12
- package/report.api.md +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/avatar-group
|
|
2
2
|
|
|
3
|
+
## 9.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`110fb3a5f19`](https://bitbucket.org/atlassian/atlassian-frontend/commits/110fb3a5f19) - Updates `@emotion/core` to `@emotion/react`; v10 to v11. There is no expected behaviour change.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 9.0.4
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
|
|
18
|
+
|
|
3
19
|
## 9.0.3
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -15,7 +15,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
15
15
|
|
|
16
16
|
var _react = require("react");
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _react2 = require("@emotion/react");
|
|
19
19
|
|
|
20
20
|
var _avatar = _interopRequireDefault(require("@atlaskit/avatar"));
|
|
21
21
|
|
|
@@ -50,14 +50,14 @@ function getOverrides(overrides) {
|
|
|
50
50
|
return {
|
|
51
51
|
AvatarGroupItem: _objectSpread({
|
|
52
52
|
render: function render(Component, props, index) {
|
|
53
|
-
return (0,
|
|
53
|
+
return (0, _react2.jsx)(Component, (0, _extends2.default)({}, props, {
|
|
54
54
|
key: (0, _utils.composeUniqueKey)(props.avatar, index)
|
|
55
55
|
}));
|
|
56
56
|
}
|
|
57
57
|
}, overrides && overrides.AvatarGroupItem),
|
|
58
58
|
Avatar: _objectSpread({
|
|
59
59
|
render: function render(Component, props, index) {
|
|
60
|
-
return (0,
|
|
60
|
+
return (0, _react2.jsx)(Component, (0, _extends2.default)({}, props, {
|
|
61
61
|
key: (0, _utils.composeUniqueKey)(props, index)
|
|
62
62
|
}));
|
|
63
63
|
}
|
|
@@ -111,7 +111,7 @@ var AvatarGroup = function AvatarGroup(_ref) {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
var renderMoreButton = function renderMoreButton(props) {
|
|
114
|
-
return (0,
|
|
114
|
+
return (0, _react2.jsx)(_moreIndicator.default, (0, _extends2.default)({
|
|
115
115
|
buttonProps: showMoreButtonProps,
|
|
116
116
|
borderColor: borderColor,
|
|
117
117
|
count: total - max,
|
|
@@ -139,7 +139,7 @@ var AvatarGroup = function AvatarGroup(_ref) {
|
|
|
139
139
|
return boundariesElement === 'window' ? 'document' : 'viewport';
|
|
140
140
|
}();
|
|
141
141
|
|
|
142
|
-
return (0,
|
|
142
|
+
return (0, _react2.jsx)(_popup.default, {
|
|
143
143
|
isOpen: isOpen,
|
|
144
144
|
onClose: onClose,
|
|
145
145
|
placement: "bottom-end",
|
|
@@ -148,13 +148,13 @@ var AvatarGroup = function AvatarGroup(_ref) {
|
|
|
148
148
|
shouldFlip: true,
|
|
149
149
|
zIndex: _constants.layers.modal(),
|
|
150
150
|
content: function content() {
|
|
151
|
-
return (0,
|
|
151
|
+
return (0, _react2.jsx)(_menu.PopupMenuGroup, {
|
|
152
152
|
onClick: function onClick(e) {
|
|
153
153
|
return e.stopPropagation();
|
|
154
154
|
},
|
|
155
155
|
minWidth: 250,
|
|
156
156
|
maxHeight: 300
|
|
157
|
-
}, (0,
|
|
157
|
+
}, (0, _react2.jsx)(_menu.Section, null, data.slice(max).map(function (avatar, index) {
|
|
158
158
|
return getOverrides(overrides).AvatarGroupItem.render(_avatarGroupItem.default, {
|
|
159
159
|
avatar: avatar,
|
|
160
160
|
onAvatarClick: onAvatarClick,
|
|
@@ -180,7 +180,7 @@ var AvatarGroup = function AvatarGroup(_ref) {
|
|
|
180
180
|
var total = data.length;
|
|
181
181
|
var maxAvatar = total > max ? max - 1 : max;
|
|
182
182
|
var Group = appearance === 'stack' ? _stack.default : _grid.default;
|
|
183
|
-
return (0,
|
|
183
|
+
return (0, _react2.jsx)(Group, {
|
|
184
184
|
testId: testId && "".concat(testId, "--avatar-group"),
|
|
185
185
|
"aria-label": label
|
|
186
186
|
}, data.slice(0, maxAvatar).map(function (avatarData, idx) {
|
|
@@ -194,7 +194,7 @@ var AvatarGroup = function AvatarGroup(_ref) {
|
|
|
194
194
|
} : undefined,
|
|
195
195
|
stackIndex: max - idx
|
|
196
196
|
}), idx);
|
|
197
|
-
return !isTooltipDisabled && !avatarData.isDisabled ? (0,
|
|
197
|
+
return !isTooltipDisabled && !avatarData.isDisabled ? (0, _react2.jsx)(_tooltip.default, {
|
|
198
198
|
key: (0, _utils.composeUniqueKey)(avatarData, idx),
|
|
199
199
|
content: avatarData.name,
|
|
200
200
|
testId: testId && "".concat(testId, "--tooltip-").concat(idx)
|
|
@@ -7,14 +7,14 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _react2 = require("@emotion/react");
|
|
11
11
|
|
|
12
12
|
var _constants = require("@atlaskit/theme/constants");
|
|
13
13
|
|
|
14
14
|
/** @jsx jsx */
|
|
15
15
|
var gridSize = (0, _constants.gridSize)();
|
|
16
16
|
var gutter = gridSize / 2;
|
|
17
|
-
var listStyles = (0,
|
|
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
|
margin: 0,
|
|
@@ -26,7 +26,7 @@ var listStyles = (0, _core.css)({
|
|
|
26
26
|
lineHeight: 1,
|
|
27
27
|
listStyleType: 'none !important'
|
|
28
28
|
});
|
|
29
|
-
var listItemStyles = (0,
|
|
29
|
+
var listItemStyles = (0, _react2.css)({
|
|
30
30
|
margin: 0,
|
|
31
31
|
marginBottom: gridSize,
|
|
32
32
|
paddingRight: gutter,
|
|
@@ -37,12 +37,12 @@ var Grid = function Grid(_ref) {
|
|
|
37
37
|
var children = _ref.children,
|
|
38
38
|
testId = _ref.testId,
|
|
39
39
|
label = _ref['aria-label'];
|
|
40
|
-
return (0,
|
|
40
|
+
return (0, _react2.jsx)("ul", {
|
|
41
41
|
"data-testid": testId,
|
|
42
42
|
"aria-label": label,
|
|
43
43
|
css: listStyles
|
|
44
44
|
}, _react.Children.map(children, function (child) {
|
|
45
|
-
return child && (0,
|
|
45
|
+
return child && (0, _react2.jsx)("li", {
|
|
46
46
|
css: listItemStyles
|
|
47
47
|
}, child);
|
|
48
48
|
}));
|
|
@@ -15,7 +15,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
15
15
|
|
|
16
16
|
var _react = require("react");
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _react2 = require("@emotion/react");
|
|
19
19
|
|
|
20
20
|
var _avatar = _interopRequireWildcard(require("@atlaskit/avatar"));
|
|
21
21
|
|
|
@@ -35,7 +35,7 @@ var FONT_SIZE = {
|
|
|
35
35
|
xlarge: '16px',
|
|
36
36
|
xxlarge: '16px'
|
|
37
37
|
};
|
|
38
|
-
var buttonActiveStyles = (0,
|
|
38
|
+
var buttonActiveStyles = (0, _react2.css)({
|
|
39
39
|
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
40
40
|
'&&': {
|
|
41
41
|
backgroundColor: "var(--ds-background-selected, ".concat(_colors.B50, ")"),
|
|
@@ -52,7 +52,7 @@ var buttonActiveStyles = (0, _core.css)({
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
|
-
var buttonStyles = (0,
|
|
55
|
+
var buttonStyles = (0, _react2.css)({
|
|
56
56
|
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
57
57
|
'&&': {
|
|
58
58
|
backgroundColor: "var(--ds-background-neutral, ".concat(_colors.N20, ")"),
|
|
@@ -98,7 +98,7 @@ var MoreIndicator = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
98
98
|
onClick(event, analyticsEvent);
|
|
99
99
|
}, // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
100
100
|
[buttonProps.onClick, onClick]);
|
|
101
|
-
return (0,
|
|
101
|
+
return (0, _react2.jsx)(_avatar.default, {
|
|
102
102
|
appearance: appearance,
|
|
103
103
|
size: size,
|
|
104
104
|
borderColor: borderColor,
|
|
@@ -109,7 +109,7 @@ var MoreIndicator = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
109
109
|
className = _ref2.className,
|
|
110
110
|
ref = _ref2.ref,
|
|
111
111
|
props = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
|
|
112
|
-
return (0,
|
|
112
|
+
return (0, _react2.jsx)("button", (0, _extends2.default)({
|
|
113
113
|
type: "submit"
|
|
114
114
|
}, buttonProps, props, {
|
|
115
115
|
ref: ref,
|
|
@@ -7,7 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _react2 = require("@emotion/react");
|
|
11
11
|
|
|
12
12
|
var _avatar = require("@atlaskit/avatar");
|
|
13
13
|
|
|
@@ -15,7 +15,7 @@ var _constants = require("@atlaskit/theme/constants");
|
|
|
15
15
|
|
|
16
16
|
/** @jsx jsx */
|
|
17
17
|
var gutter = _avatar.BORDER_WIDTH * 2 + (0, _constants.gridSize)() / 2;
|
|
18
|
-
var listStyles = (0,
|
|
18
|
+
var listStyles = (0, _react2.css)({
|
|
19
19
|
display: 'flex',
|
|
20
20
|
margin: 0,
|
|
21
21
|
marginRight: gutter,
|
|
@@ -23,7 +23,7 @@ var listStyles = (0, _core.css)({
|
|
|
23
23
|
lineHeight: 1,
|
|
24
24
|
listStyleType: 'none !important'
|
|
25
25
|
});
|
|
26
|
-
var listItemStyles = (0,
|
|
26
|
+
var listItemStyles = (0, _react2.css)({
|
|
27
27
|
margin: 0,
|
|
28
28
|
marginRight: -gutter
|
|
29
29
|
});
|
|
@@ -32,12 +32,12 @@ var Stack = function Stack(_ref) {
|
|
|
32
32
|
var children = _ref.children,
|
|
33
33
|
testId = _ref.testId,
|
|
34
34
|
label = _ref['aria-label'];
|
|
35
|
-
return (0,
|
|
35
|
+
return (0, _react2.jsx)("ul", {
|
|
36
36
|
"data-testid": testId,
|
|
37
37
|
"aria-label": label,
|
|
38
38
|
css: listStyles
|
|
39
39
|
}, _react.Children.map(children, function (child) {
|
|
40
|
-
return child && (0,
|
|
40
|
+
return child && (0, _react2.jsx)("li", {
|
|
41
41
|
css: listItemStyles
|
|
42
42
|
}, child);
|
|
43
43
|
}));
|
package/dist/cjs/version.json
CHANGED
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
4
|
import { useCallback, useState } from 'react';
|
|
5
|
-
import { jsx } from '@emotion/
|
|
5
|
+
import { jsx } from '@emotion/react';
|
|
6
6
|
import Avatar from '@atlaskit/avatar';
|
|
7
7
|
import { PopupMenuGroup, Section } from '@atlaskit/menu';
|
|
8
8
|
import Popup from '@atlaskit/popup';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { Children } from 'react';
|
|
3
|
-
import { css, jsx } from '@emotion/
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import { gridSize as getGridSize } from '@atlaskit/theme/constants';
|
|
5
5
|
const gridSize = getGridSize();
|
|
6
6
|
const gutter = gridSize / 2;
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
4
|
import { forwardRef, useCallback } from 'react';
|
|
5
|
-
import { css, jsx } from '@emotion/
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
6
6
|
import Avatar, { ACTIVE_SCALE_FACTOR, BORDER_WIDTH } from '@atlaskit/avatar';
|
|
7
7
|
import { B300, B400, B50, N0, N20, N30, N500 } from '@atlaskit/theme/colors';
|
|
8
8
|
const FONT_SIZE = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { Children } from 'react';
|
|
3
|
-
import { css, jsx } from '@emotion/
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import { BORDER_WIDTH } from '@atlaskit/avatar';
|
|
5
5
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
6
6
|
const gutter = BORDER_WIDTH * 2 + gridSize() / 2;
|
package/dist/es2019/version.json
CHANGED
|
@@ -8,7 +8,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
8
8
|
|
|
9
9
|
/** @jsx jsx */
|
|
10
10
|
import { useCallback, useState } from 'react';
|
|
11
|
-
import { jsx } from '@emotion/
|
|
11
|
+
import { jsx } from '@emotion/react';
|
|
12
12
|
import Avatar from '@atlaskit/avatar';
|
|
13
13
|
import { PopupMenuGroup, Section } from '@atlaskit/menu';
|
|
14
14
|
import Popup from '@atlaskit/popup';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { Children } from 'react';
|
|
3
|
-
import { css, jsx } from '@emotion/
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import { gridSize as getGridSize } from '@atlaskit/theme/constants';
|
|
5
5
|
var gridSize = getGridSize();
|
|
6
6
|
var gutter = gridSize / 2;
|
|
@@ -4,7 +4,7 @@ var _excluded = ["testId", "className", "ref"];
|
|
|
4
4
|
|
|
5
5
|
/** @jsx jsx */
|
|
6
6
|
import { forwardRef, useCallback } from 'react';
|
|
7
|
-
import { css, jsx } from '@emotion/
|
|
7
|
+
import { css, jsx } from '@emotion/react';
|
|
8
8
|
import Avatar, { ACTIVE_SCALE_FACTOR, BORDER_WIDTH } from '@atlaskit/avatar';
|
|
9
9
|
import { B300, B400, B50, N0, N20, N30, N500 } from '@atlaskit/theme/colors';
|
|
10
10
|
var FONT_SIZE = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { Children } from 'react';
|
|
3
|
-
import { css, jsx } from '@emotion/
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import { BORDER_WIDTH } from '@atlaskit/avatar';
|
|
5
5
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
6
6
|
var gutter = BORDER_WIDTH * 2 + gridSize() / 2;
|
package/dist/esm/version.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { ElementType, MouseEventHandler } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
3
4
|
import { SizeType } from '@atlaskit/avatar';
|
|
4
5
|
import { AvatarGroupOverrides, AvatarProps, onAvatarClickHandler } from './types';
|
|
5
6
|
export interface AvatarGroupProps {
|
|
@@ -98,5 +99,5 @@ export interface AvatarGroupProps {
|
|
|
98
99
|
* - [Code](https://atlassian.design/components/avatar-group/code)
|
|
99
100
|
* - [Usage](https://atlassian.design/components/avatar-group/usage)
|
|
100
101
|
*/
|
|
101
|
-
declare const AvatarGroup: ({ appearance, avatar, borderColor, boundariesElement, data, isTooltipDisabled, maxCount, onAvatarClick, onMoreClick, overrides, showMoreButtonProps, size, testId, label, }: AvatarGroupProps) => JSX.Element;
|
|
102
|
+
declare const AvatarGroup: ({ appearance, avatar, borderColor, boundariesElement, data, isTooltipDisabled, maxCount, onAvatarClick, onMoreClick, overrides, showMoreButtonProps, size, testId, label, }: AvatarGroupProps) => jsx.JSX.Element;
|
|
102
103
|
export default AvatarGroup;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ElementType, ReactNode } from 'react';
|
|
2
|
-
import type { Interpolation } from '@emotion/core';
|
|
3
2
|
import type { AnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
3
|
import type { AvatarPropTypes } from '@atlaskit/avatar';
|
|
5
4
|
import type { AvatarGroupItemProps } from './avatar-group-item';
|
|
@@ -20,4 +19,3 @@ export interface AvatarGroupOverrides {
|
|
|
20
19
|
};
|
|
21
20
|
}
|
|
22
21
|
export declare type onAvatarClickHandler = (event: React.MouseEvent, analyticsEvent: AnalyticsEvent | undefined, index: number) => void;
|
|
23
|
-
export declare type CssCallback = (template: TemplateStringsArray, ...args: Array<Interpolation>) => string;
|
|
@@ -0,0 +1,12 @@
|
|
|
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;
|
|
@@ -0,0 +1,103 @@
|
|
|
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;
|
|
@@ -0,0 +1,13 @@
|
|
|
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;
|
|
@@ -0,0 +1,21 @@
|
|
|
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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/avatar-group",
|
|
3
|
-
"version": "9.0
|
|
3
|
+
"version": "9.1.0",
|
|
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,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.tsx",
|
|
17
24
|
"atlassian": {
|
|
@@ -26,14 +33,14 @@
|
|
|
26
33
|
".": "./src/index.tsx"
|
|
27
34
|
},
|
|
28
35
|
"dependencies": {
|
|
29
|
-
"@atlaskit/avatar": "^21.
|
|
36
|
+
"@atlaskit/avatar": "^21.1.0",
|
|
30
37
|
"@atlaskit/menu": "^1.3.0",
|
|
31
|
-
"@atlaskit/popup": "^1.
|
|
38
|
+
"@atlaskit/popup": "^1.5.0",
|
|
32
39
|
"@atlaskit/theme": "^12.2.0",
|
|
33
40
|
"@atlaskit/tokens": "^0.10.0",
|
|
34
|
-
"@atlaskit/tooltip": "^17.
|
|
41
|
+
"@atlaskit/tooltip": "^17.6.0",
|
|
35
42
|
"@babel/runtime": "^7.0.0",
|
|
36
|
-
"@emotion/
|
|
43
|
+
"@emotion/react": "^11.7.1"
|
|
37
44
|
},
|
|
38
45
|
"peerDependencies": {
|
|
39
46
|
"react": "^16.8.0"
|
|
@@ -41,22 +48,23 @@
|
|
|
41
48
|
"devDependencies": {
|
|
42
49
|
"@atlaskit/analytics-next": "^8.2.0",
|
|
43
50
|
"@atlaskit/button": "^16.3.0",
|
|
44
|
-
"@atlaskit/code": "^14.
|
|
51
|
+
"@atlaskit/code": "^14.4.0",
|
|
45
52
|
"@atlaskit/docs": "*",
|
|
46
|
-
"@atlaskit/
|
|
47
|
-
"@atlaskit/
|
|
48
|
-
"@atlaskit/
|
|
49
|
-
"@atlaskit/
|
|
53
|
+
"@atlaskit/ds-lib": "^2.1.1",
|
|
54
|
+
"@atlaskit/form": "^8.6.0",
|
|
55
|
+
"@atlaskit/icon": "^21.11.0",
|
|
56
|
+
"@atlaskit/modal-dialog": "^12.4.0",
|
|
57
|
+
"@atlaskit/section-message": "^6.3.0",
|
|
50
58
|
"@atlaskit/ssr": "*",
|
|
51
59
|
"@atlaskit/toggle": "^12.5.0",
|
|
52
60
|
"@atlaskit/visual-regression": "*",
|
|
53
61
|
"@atlaskit/webdriver-runner": "*",
|
|
54
62
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
55
63
|
"@emotion/styled": "^11.0.0",
|
|
56
|
-
"@testing-library/react": "^
|
|
64
|
+
"@testing-library/react": "^12.1.5",
|
|
57
65
|
"lodash": "^4.17.21",
|
|
58
66
|
"react-dom": "^16.8.0",
|
|
59
|
-
"typescript": "4.
|
|
67
|
+
"typescript": "4.5.5",
|
|
60
68
|
"wait-for-expect": "^1.2.0"
|
|
61
69
|
},
|
|
62
70
|
"keywords": [
|
package/report.api.md
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
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. This report is auto-generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
[Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
4
6
|
|
|
5
7
|
```ts
|
|
6
8
|
import type { AnalyticsEvent } from '@atlaskit/analytics-next';
|
|
7
9
|
import type { AvatarPropTypes } from '@atlaskit/avatar';
|
|
8
10
|
import { ElementType } from 'react';
|
|
11
|
+
import { jsx } from '@emotion/react';
|
|
9
12
|
import { MouseEventHandler } from 'react';
|
|
10
13
|
import type { ReactNode } from 'react';
|
|
11
14
|
import { SizeType } from '@atlaskit/avatar';
|
|
@@ -34,7 +37,7 @@ declare const AvatarGroup: ({
|
|
|
34
37
|
size,
|
|
35
38
|
testId,
|
|
36
39
|
label,
|
|
37
|
-
}: AvatarGroupProps) => JSX.Element;
|
|
40
|
+
}: AvatarGroupProps) => jsx.JSX.Element;
|
|
38
41
|
export default AvatarGroup;
|
|
39
42
|
|
|
40
43
|
declare interface AvatarGroupItemProps {
|