@atlaskit/avatar-group 9.1.4 → 9.2.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 +6 -0
- package/dist/cjs/components/avatar-group.js +5 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/avatar-group.js +4 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/avatar-group.js +5 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/components/avatar-group.d.ts +8 -1
- package/package.json +1 -1
- package/report.api.md +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/avatar-group
|
|
2
2
|
|
|
3
|
+
## 9.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`3f8f08a1888`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3f8f08a1888) - Updating Avatar-group component to position the tooltip either to top or bottom based on configuration.
|
|
8
|
+
|
|
3
9
|
## 9.1.4
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -94,7 +94,9 @@ var AvatarGroup = function AvatarGroup(_ref) {
|
|
|
94
94
|
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
95
95
|
testId = _ref.testId,
|
|
96
96
|
_ref$label = _ref.label,
|
|
97
|
-
label = _ref$label === void 0 ? 'avatar group' : _ref$label
|
|
97
|
+
label = _ref$label === void 0 ? 'avatar group' : _ref$label,
|
|
98
|
+
_ref$tooltipPosition = _ref.tooltipPosition,
|
|
99
|
+
tooltipPosition = _ref$tooltipPosition === void 0 ? 'bottom' : _ref$tooltipPosition;
|
|
98
100
|
|
|
99
101
|
var _useState = (0, _react.useState)(false),
|
|
100
102
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -197,7 +199,8 @@ var AvatarGroup = function AvatarGroup(_ref) {
|
|
|
197
199
|
return !isTooltipDisabled && !avatarData.isDisabled ? (0, _react2.jsx)(_tooltip.default, {
|
|
198
200
|
key: (0, _utils.composeUniqueKey)(avatarData, idx),
|
|
199
201
|
content: avatarData.name,
|
|
200
|
-
testId: testId && "".concat(testId, "--tooltip-").concat(idx)
|
|
202
|
+
testId: testId && "".concat(testId, "--tooltip-").concat(idx),
|
|
203
|
+
position: tooltipPosition
|
|
201
204
|
}, finalAvatar) : finalAvatar;
|
|
202
205
|
}), renderMoreDropdown(+maxAvatar, total));
|
|
203
206
|
};
|
package/dist/cjs/version.json
CHANGED
|
@@ -59,7 +59,8 @@ const AvatarGroup = ({
|
|
|
59
59
|
showMoreButtonProps = {},
|
|
60
60
|
size = 'medium',
|
|
61
61
|
testId,
|
|
62
|
-
label = 'avatar group'
|
|
62
|
+
label = 'avatar group',
|
|
63
|
+
tooltipPosition = 'bottom'
|
|
63
64
|
}) => {
|
|
64
65
|
const [isOpen, setIsOpen] = useState(false);
|
|
65
66
|
const onClose = useCallback(() => setIsOpen(false), []);
|
|
@@ -144,7 +145,8 @@ const AvatarGroup = ({
|
|
|
144
145
|
return !isTooltipDisabled && !avatarData.isDisabled ? jsx(Tooltip, {
|
|
145
146
|
key: composeUniqueKey(avatarData, idx),
|
|
146
147
|
content: avatarData.name,
|
|
147
|
-
testId: testId && `${testId}--tooltip-${idx}
|
|
148
|
+
testId: testId && `${testId}--tooltip-${idx}`,
|
|
149
|
+
position: tooltipPosition
|
|
148
150
|
}, finalAvatar) : finalAvatar;
|
|
149
151
|
}), renderMoreDropdown(+maxAvatar, total));
|
|
150
152
|
};
|
package/dist/es2019/version.json
CHANGED
|
@@ -72,7 +72,9 @@ var AvatarGroup = function AvatarGroup(_ref) {
|
|
|
72
72
|
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
73
73
|
testId = _ref.testId,
|
|
74
74
|
_ref$label = _ref.label,
|
|
75
|
-
label = _ref$label === void 0 ? 'avatar group' : _ref$label
|
|
75
|
+
label = _ref$label === void 0 ? 'avatar group' : _ref$label,
|
|
76
|
+
_ref$tooltipPosition = _ref.tooltipPosition,
|
|
77
|
+
tooltipPosition = _ref$tooltipPosition === void 0 ? 'bottom' : _ref$tooltipPosition;
|
|
76
78
|
|
|
77
79
|
var _useState = useState(false),
|
|
78
80
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -175,7 +177,8 @@ var AvatarGroup = function AvatarGroup(_ref) {
|
|
|
175
177
|
return !isTooltipDisabled && !avatarData.isDisabled ? jsx(Tooltip, {
|
|
176
178
|
key: composeUniqueKey(avatarData, idx),
|
|
177
179
|
content: avatarData.name,
|
|
178
|
-
testId: testId && "".concat(testId, "--tooltip-").concat(idx)
|
|
180
|
+
testId: testId && "".concat(testId, "--tooltip-").concat(idx),
|
|
181
|
+
position: tooltipPosition
|
|
179
182
|
}, finalAvatar) : finalAvatar;
|
|
180
183
|
}), renderMoreDropdown(+maxAvatar, total));
|
|
181
184
|
};
|
package/dist/esm/version.json
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { ElementType, MouseEventHandler } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import { SizeType } from '@atlaskit/avatar';
|
|
5
|
+
import { PositionType } from '@atlaskit/tooltip';
|
|
5
6
|
import { AvatarGroupOverrides, AvatarProps, onAvatarClickHandler } from './types';
|
|
6
7
|
export interface AvatarGroupProps {
|
|
7
8
|
/**
|
|
@@ -74,6 +75,12 @@ export interface AvatarGroupProps {
|
|
|
74
75
|
* Custom overrides for the composed components.
|
|
75
76
|
*/
|
|
76
77
|
overrides?: AvatarGroupOverrides;
|
|
78
|
+
/**
|
|
79
|
+
*
|
|
80
|
+
* Where the tooltip should appear relative to its target.
|
|
81
|
+
* Defaults to tooltip position "bottom".
|
|
82
|
+
*/
|
|
83
|
+
tooltipPosition?: Extract<PositionType, 'bottom' | 'top'>;
|
|
77
84
|
/**
|
|
78
85
|
* Disables tooltips
|
|
79
86
|
*/
|
|
@@ -99,5 +106,5 @@ export interface AvatarGroupProps {
|
|
|
99
106
|
* - [Code](https://atlassian.design/components/avatar-group/code)
|
|
100
107
|
* - [Usage](https://atlassian.design/components/avatar-group/usage)
|
|
101
108
|
*/
|
|
102
|
-
declare const AvatarGroup: ({ appearance, avatar, borderColor, boundariesElement, data, isTooltipDisabled, maxCount, onAvatarClick, onMoreClick, overrides, showMoreButtonProps, size, testId, label, }: AvatarGroupProps) => jsx.JSX.Element;
|
|
109
|
+
declare const AvatarGroup: ({ appearance, avatar, borderColor, boundariesElement, data, isTooltipDisabled, maxCount, onAvatarClick, onMoreClick, overrides, showMoreButtonProps, size, testId, label, tooltipPosition, }: AvatarGroupProps) => jsx.JSX.Element;
|
|
103
110
|
export default AvatarGroup;
|
package/package.json
CHANGED
package/report.api.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- API Report Version: 2.
|
|
1
|
+
<!-- API Report Version: 2.3 -->
|
|
2
2
|
|
|
3
3
|
## API Report File for "@atlaskit/avatar-group"
|
|
4
4
|
|
|
@@ -19,6 +19,7 @@ import type { AvatarPropTypes } from '@atlaskit/avatar';
|
|
|
19
19
|
import { ElementType } from 'react';
|
|
20
20
|
import { jsx } from '@emotion/react';
|
|
21
21
|
import { MouseEventHandler } from 'react';
|
|
22
|
+
import { PositionType } from '@atlaskit/tooltip';
|
|
22
23
|
import type { ReactNode } from 'react';
|
|
23
24
|
import { SizeType } from '@atlaskit/avatar';
|
|
24
25
|
|
|
@@ -38,6 +39,7 @@ const AvatarGroup: ({
|
|
|
38
39
|
size,
|
|
39
40
|
testId,
|
|
40
41
|
label,
|
|
42
|
+
tooltipPosition,
|
|
41
43
|
}: AvatarGroupProps) => jsx.JSX.Element;
|
|
42
44
|
export default AvatarGroup;
|
|
43
45
|
|
|
@@ -93,6 +95,7 @@ export interface AvatarGroupProps {
|
|
|
93
95
|
showMoreButtonProps?: Partial<React.HTMLAttributes<HTMLElement>>;
|
|
94
96
|
size?: SizeType;
|
|
95
97
|
testId?: string;
|
|
98
|
+
tooltipPosition?: Extract<PositionType, 'bottom' | 'top'>;
|
|
96
99
|
}
|
|
97
100
|
|
|
98
101
|
// @public (undocumented)
|