@atlaskit/avatar-group 8.5.14 → 9.0.1
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 +27 -0
- package/dist/cjs/components/more-indicator.js +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/more-indicator.js +3 -3
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/more-indicator.js +3 -3
- package/dist/esm/version.json +1 -1
- package/dist/types/components/avatar-group.d.ts +8 -10
- package/package.json +9 -5
- package/report.api.md +167 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @atlaskit/avatar-group
|
|
2
2
|
|
|
3
|
+
## 9.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`45ebe7af434`](https://bitbucket.org/atlassian/atlassian-frontend/commits/45ebe7af434) - Moved to using declarative entrypoints internally. Public API is unchanged.
|
|
8
|
+
|
|
9
|
+
## 9.0.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- [`92bb02bc46b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/92bb02bc46b) - [ux] There are **no code changes required** to consume this major, but you should be aware that internal changes have been made to how `@atlaskit/avatar` loads images.
|
|
14
|
+
|
|
15
|
+
Before, the image loading behaviour was written in JS. Now, it leans on a standard HTML `img` tag if you provide a `src` prop, allowing it to rely on the browser to optimise the loading. These changes should result in faster image loading and an improved server-side rendering story.
|
|
16
|
+
|
|
17
|
+
In this version, the **breaking change is that you will no longer see a fallback icon while the image is loading**. We have intentionally removed this loading behaviour as it is no longer consistent with our native `img` behaviour-first approach, and was a source of SSR bugs. Avatar images will load either instantly from the cache, or very fast from a CDN. In the edge cases where there is an error with the image src provided, we will still fall back to a default icon.
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- [`1276a8179ad`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1276a8179ad) - [ux] DSP-4535: Fix wrongly used token.
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
24
|
+
## 8.5.15
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- [`efa50ac72ba`](https://bitbucket.org/atlassian/atlassian-frontend/commits/efa50ac72ba) - Adjusts jsdoc strings to improve prop documentation
|
|
29
|
+
|
|
3
30
|
## 8.5.14
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
|
@@ -39,7 +39,7 @@ var buttonActiveStyles = (0, _core.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, ")"),
|
|
42
|
-
boxShadow: "0 0 0 ".concat(_avatar.BORDER_WIDTH, "px "
|
|
42
|
+
boxShadow: "0 0 0 ".concat(_avatar.BORDER_WIDTH, "px ", "var(--ds-border-selected, ".concat(_colors.B300, ")")),
|
|
43
43
|
color: "var(--ds-text-selected, ".concat(_colors.B400, ")"),
|
|
44
44
|
transform: "scale(".concat(_avatar.ACTIVE_SCALE_FACTOR, ")")
|
|
45
45
|
}
|
|
@@ -73,7 +73,7 @@ var MoreIndicator = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
73
73
|
var _ref$appearance = _ref.appearance,
|
|
74
74
|
appearance = _ref$appearance === void 0 ? 'circle' : _ref$appearance,
|
|
75
75
|
_ref$borderColor = _ref.borderColor,
|
|
76
|
-
borderColor = _ref$borderColor === void 0 ? "var(--ds-
|
|
76
|
+
borderColor = _ref$borderColor === void 0 ? "var(--ds-border-inverse, ".concat(_colors.N0, ")") : _ref$borderColor,
|
|
77
77
|
_ref$size = _ref.size,
|
|
78
78
|
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
79
79
|
_ref$count = _ref.count,
|
package/dist/cjs/version.json
CHANGED
|
@@ -4,7 +4,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
4
4
|
import { forwardRef, useCallback } from 'react';
|
|
5
5
|
import { css, jsx } from '@emotion/core';
|
|
6
6
|
import Avatar, { ACTIVE_SCALE_FACTOR, BORDER_WIDTH } from '@atlaskit/avatar';
|
|
7
|
-
import { B300, B400, B50,
|
|
7
|
+
import { B300, B400, B50, N0, N20, N30, N30A, N500 } from '@atlaskit/theme/colors';
|
|
8
8
|
const FONT_SIZE = {
|
|
9
9
|
xsmall: '10px',
|
|
10
10
|
small: '10px',
|
|
@@ -17,7 +17,7 @@ const buttonActiveStyles = css({
|
|
|
17
17
|
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
18
18
|
'&&': {
|
|
19
19
|
backgroundColor: `var(--ds-background-selected, ${B50})`,
|
|
20
|
-
boxShadow: `0 0 0 ${BORDER_WIDTH}px ${`var(--ds-
|
|
20
|
+
boxShadow: `0 0 0 ${BORDER_WIDTH}px ${`var(--ds-border-selected, ${B300})`}`,
|
|
21
21
|
color: `var(--ds-text-selected, ${B400})`,
|
|
22
22
|
transform: `scale(${ACTIVE_SCALE_FACTOR})`
|
|
23
23
|
}
|
|
@@ -49,7 +49,7 @@ const buttonStyles = css({
|
|
|
49
49
|
const MAX_DISPLAY_COUNT = 99;
|
|
50
50
|
const MoreIndicator = /*#__PURE__*/forwardRef(({
|
|
51
51
|
appearance = 'circle',
|
|
52
|
-
borderColor = `var(--ds-
|
|
52
|
+
borderColor = `var(--ds-border-inverse, ${N0})`,
|
|
53
53
|
size = 'medium',
|
|
54
54
|
count = 0,
|
|
55
55
|
testId,
|
package/dist/es2019/version.json
CHANGED
|
@@ -6,7 +6,7 @@ var _excluded = ["testId", "className", "ref"];
|
|
|
6
6
|
import { forwardRef, useCallback } from 'react';
|
|
7
7
|
import { css, jsx } from '@emotion/core';
|
|
8
8
|
import Avatar, { ACTIVE_SCALE_FACTOR, BORDER_WIDTH } from '@atlaskit/avatar';
|
|
9
|
-
import { B300, B400, B50,
|
|
9
|
+
import { B300, B400, B50, N0, N20, N30, N30A, N500 } from '@atlaskit/theme/colors';
|
|
10
10
|
var FONT_SIZE = {
|
|
11
11
|
xsmall: '10px',
|
|
12
12
|
small: '10px',
|
|
@@ -19,7 +19,7 @@ var buttonActiveStyles = css({
|
|
|
19
19
|
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
20
20
|
'&&': {
|
|
21
21
|
backgroundColor: "var(--ds-background-selected, ".concat(B50, ")"),
|
|
22
|
-
boxShadow: "0 0 0 ".concat(BORDER_WIDTH, "px "
|
|
22
|
+
boxShadow: "0 0 0 ".concat(BORDER_WIDTH, "px ", "var(--ds-border-selected, ".concat(B300, ")")),
|
|
23
23
|
color: "var(--ds-text-selected, ".concat(B400, ")"),
|
|
24
24
|
transform: "scale(".concat(ACTIVE_SCALE_FACTOR, ")")
|
|
25
25
|
}
|
|
@@ -53,7 +53,7 @@ var MoreIndicator = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
53
53
|
var _ref$appearance = _ref.appearance,
|
|
54
54
|
appearance = _ref$appearance === void 0 ? 'circle' : _ref$appearance,
|
|
55
55
|
_ref$borderColor = _ref.borderColor,
|
|
56
|
-
borderColor = _ref$borderColor === void 0 ? "var(--ds-
|
|
56
|
+
borderColor = _ref$borderColor === void 0 ? "var(--ds-border-inverse, ".concat(N0, ")") : _ref$borderColor,
|
|
57
57
|
_ref$size = _ref.size,
|
|
58
58
|
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
59
59
|
_ref$count = _ref.count,
|
package/dist/esm/version.json
CHANGED
|
@@ -78,16 +78,14 @@ export interface AvatarGroupProps {
|
|
|
78
78
|
*/
|
|
79
79
|
isTooltipDisabled?: boolean;
|
|
80
80
|
/**
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
*
|
|
90
|
-
* When there are several AvatarGroups on the page you should use a unique label to let users distinguish different lists.
|
|
81
|
+
Text to be used as aria-label for the list of avatars.
|
|
82
|
+
Screen reader announcement with default label, which is `avatar group`, is `list, avatar group, X items`.
|
|
83
|
+
|
|
84
|
+
The label should describe the `AvatarGroup`'s entities, for instance:
|
|
85
|
+
- `label="team members"`, screen reader announcement would be `list team members, X items`
|
|
86
|
+
- `label="reviewers"` screen reader announcement would be `list reviewers, X items`
|
|
87
|
+
|
|
88
|
+
When there are several AvatarGroups on the page you should use a unique label to let users distinguish different lists.
|
|
91
89
|
*/
|
|
92
90
|
label?: string;
|
|
93
91
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/avatar-group",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.1",
|
|
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/"
|
|
7
7
|
},
|
|
8
|
-
"repository": "https://bitbucket.org/atlassian/atlassian-frontend",
|
|
8
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
9
9
|
"author": "Atlassian Pty Ltd",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"main": "dist/cjs/index.js",
|
|
@@ -16,14 +16,17 @@
|
|
|
16
16
|
"atlaskit:src": "src/index.tsx",
|
|
17
17
|
"atlassian": {
|
|
18
18
|
"team": "Design System Team",
|
|
19
|
-
"deprecatedAutoEntryPoints": true,
|
|
20
19
|
"releaseModel": "scheduled",
|
|
21
20
|
"website": {
|
|
22
|
-
"name": "Avatar group"
|
|
21
|
+
"name": "Avatar group",
|
|
22
|
+
"category": "Components"
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
|
+
"af:exports": {
|
|
26
|
+
".": "./src/index.tsx"
|
|
27
|
+
},
|
|
25
28
|
"dependencies": {
|
|
26
|
-
"@atlaskit/avatar": "^
|
|
29
|
+
"@atlaskit/avatar": "^21.0.0",
|
|
27
30
|
"@atlaskit/menu": "^1.3.0",
|
|
28
31
|
"@atlaskit/popup": "^1.3.0",
|
|
29
32
|
"@atlaskit/theme": "^12.1.0",
|
|
@@ -66,6 +69,7 @@
|
|
|
66
69
|
"import-structure": "atlassian-conventions"
|
|
67
70
|
},
|
|
68
71
|
"@repo/internal": {
|
|
72
|
+
"dom-events": "use-bind-event-listener",
|
|
69
73
|
"design-system": "v1",
|
|
70
74
|
"ui-components": "lite-mode",
|
|
71
75
|
"analytics": "analytics-next",
|
package/report.api.md
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/avatar-group"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import type { AnalyticsEvent } from '@atlaskit/analytics-next';
|
|
7
|
+
import type { AvatarPropTypes } from '@atlaskit/avatar';
|
|
8
|
+
import { ElementType } from 'react';
|
|
9
|
+
import { MouseEventHandler } from 'react';
|
|
10
|
+
import type { ReactNode } from 'react';
|
|
11
|
+
import { SizeType } from '@atlaskit/avatar';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* __Avatar group__
|
|
15
|
+
*
|
|
16
|
+
* An avatar group displays a number of avatars grouped together in a stack or grid.
|
|
17
|
+
*
|
|
18
|
+
* - [Examples](https://atlassian.design/components/avatar-group/examples)
|
|
19
|
+
* - [Code](https://atlassian.design/components/avatar-group/code)
|
|
20
|
+
* - [Usage](https://atlassian.design/components/avatar-group/usage)
|
|
21
|
+
*/
|
|
22
|
+
declare const AvatarGroup: ({
|
|
23
|
+
appearance,
|
|
24
|
+
avatar,
|
|
25
|
+
borderColor,
|
|
26
|
+
boundariesElement,
|
|
27
|
+
data,
|
|
28
|
+
isTooltipDisabled,
|
|
29
|
+
maxCount,
|
|
30
|
+
onAvatarClick,
|
|
31
|
+
onMoreClick,
|
|
32
|
+
overrides,
|
|
33
|
+
showMoreButtonProps,
|
|
34
|
+
size,
|
|
35
|
+
testId,
|
|
36
|
+
label,
|
|
37
|
+
}: AvatarGroupProps) => JSX.Element;
|
|
38
|
+
export default AvatarGroup;
|
|
39
|
+
|
|
40
|
+
declare interface AvatarGroupItemProps {
|
|
41
|
+
avatar: AvatarProps;
|
|
42
|
+
isActive?: boolean;
|
|
43
|
+
isHover?: boolean;
|
|
44
|
+
index: number;
|
|
45
|
+
onAvatarClick?: onAvatarClickHandler;
|
|
46
|
+
testId?: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
declare interface AvatarGroupOverrides {
|
|
50
|
+
AvatarGroupItem?: {
|
|
51
|
+
render?: (
|
|
52
|
+
Component: ElementType<AvatarGroupItemProps>,
|
|
53
|
+
props: AvatarGroupItemProps,
|
|
54
|
+
index: number,
|
|
55
|
+
) => ReactNode;
|
|
56
|
+
};
|
|
57
|
+
Avatar?: {
|
|
58
|
+
render?: (
|
|
59
|
+
Component: ElementType<AvatarProps>,
|
|
60
|
+
props: AvatarProps,
|
|
61
|
+
index: number,
|
|
62
|
+
) => ReactNode;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export declare interface AvatarGroupProps {
|
|
67
|
+
/**
|
|
68
|
+
* Indicates the layout of the avatar-group.
|
|
69
|
+
* Avatars will either be overlapped in a stack, or
|
|
70
|
+
* laid out in an even grid formation
|
|
71
|
+
* Defaults to "stack".
|
|
72
|
+
*/
|
|
73
|
+
appearance?: 'grid' | 'stack';
|
|
74
|
+
/**
|
|
75
|
+
* Component used to render each avatar
|
|
76
|
+
*/
|
|
77
|
+
avatar?: ElementType<AvatarProps>;
|
|
78
|
+
/**
|
|
79
|
+
* The maximum number of avatars allowed in the list.
|
|
80
|
+
* Defaults to 5 when displayed as a stack,
|
|
81
|
+
* and 11 when displayed as a grid.
|
|
82
|
+
*/
|
|
83
|
+
maxCount?: number;
|
|
84
|
+
/**
|
|
85
|
+
* Defines the size of the avatar.
|
|
86
|
+
* Defaults to "medium".
|
|
87
|
+
*/
|
|
88
|
+
size?: SizeType;
|
|
89
|
+
/**
|
|
90
|
+
* Typically the background color that the avatar is presented on.
|
|
91
|
+
* Accepts any color argument that the CSS border-color property accepts.
|
|
92
|
+
*/
|
|
93
|
+
borderColor?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Array of avatar data passed to each `avatar` component.
|
|
96
|
+
* These props will be spread on to the component passed into avatar.
|
|
97
|
+
*/
|
|
98
|
+
data: Array<AvatarProps>;
|
|
99
|
+
/**
|
|
100
|
+
* Handle the click event on the avatar item.
|
|
101
|
+
* Note that if an onClick prop is provided as part of avatar data, it will take precedence over onAvatarClick.
|
|
102
|
+
*/
|
|
103
|
+
onAvatarClick?: onAvatarClickHandler;
|
|
104
|
+
/**
|
|
105
|
+
* Take control of the click event on the more indicator.
|
|
106
|
+
* This will cancel the default dropdown behavior.
|
|
107
|
+
*/
|
|
108
|
+
onMoreClick?: MouseEventHandler;
|
|
109
|
+
/**
|
|
110
|
+
* Provide additional props to the MoreButton.
|
|
111
|
+
* Example use cases: altering tab order by providing tabIndex;
|
|
112
|
+
* adding onClick behaviour without losing the default dropdown
|
|
113
|
+
*/
|
|
114
|
+
showMoreButtonProps?: Partial<React.HTMLAttributes<HTMLElement>>;
|
|
115
|
+
/**
|
|
116
|
+
* Element the overflow popup should be attached to.
|
|
117
|
+
* Defaults to "viewport".
|
|
118
|
+
*/
|
|
119
|
+
boundariesElement?: 'viewport' | 'window' | 'scrollParent';
|
|
120
|
+
/**
|
|
121
|
+
* A `testId` prop is provided for specified elements,
|
|
122
|
+
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
123
|
+
* serving as a hook for automated tests.
|
|
124
|
+
*/
|
|
125
|
+
/**
|
|
126
|
+
* Will set these elements when defined:
|
|
127
|
+
* - Container element - `{testId}--avatar-group`
|
|
128
|
+
* - Avatar items - `{testId}--avatar-{index}`
|
|
129
|
+
* - Overflow menu button - `{testId}--overflow-menu--trigger`
|
|
130
|
+
* - Overflow menu content - `{testId}--overflow-menu--content`
|
|
131
|
+
*/
|
|
132
|
+
testId?: string;
|
|
133
|
+
/**
|
|
134
|
+
* Custom overrides for the composed components.
|
|
135
|
+
*/
|
|
136
|
+
overrides?: AvatarGroupOverrides;
|
|
137
|
+
/**
|
|
138
|
+
* Disables tooltips
|
|
139
|
+
*/
|
|
140
|
+
isTooltipDisabled?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
Text to be used as aria-label for the list of avatars.
|
|
143
|
+
Screen reader announcement with default label, which is `avatar group`, is `list, avatar group, X items`.
|
|
144
|
+
|
|
145
|
+
The label should describe the `AvatarGroup`'s entities, for instance:
|
|
146
|
+
- `label="team members"`, screen reader announcement would be `list team members, X items`
|
|
147
|
+
- `label="reviewers"` screen reader announcement would be `list reviewers, X items`
|
|
148
|
+
|
|
149
|
+
When there are several AvatarGroups on the page you should use a unique label to let users distinguish different lists.
|
|
150
|
+
*/
|
|
151
|
+
label?: string;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export declare type AvatarProps = AvatarPropTypes & {
|
|
155
|
+
name: string;
|
|
156
|
+
enableTooltip?: boolean;
|
|
157
|
+
key?: string | number;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
declare type onAvatarClickHandler = (
|
|
161
|
+
event: React.MouseEvent,
|
|
162
|
+
analyticsEvent: AnalyticsEvent | undefined,
|
|
163
|
+
index: number,
|
|
164
|
+
) => void;
|
|
165
|
+
|
|
166
|
+
export {};
|
|
167
|
+
```
|