@atlaskit/avatar-group 9.0.0 → 9.0.3

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 CHANGED
@@ -1,5 +1,24 @@
1
1
  # @atlaskit/avatar-group
2
2
 
3
+ ## 9.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`4bc286406f2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4bc286406f2) - [ux] Update more indicator icon to use new design tokens and remove the unnecessary use of the :after element with regards to the consumption of the Avatar component.
8
+ - Updated dependencies
9
+
10
+ ## 9.0.2
11
+
12
+ ### Patch Changes
13
+
14
+ - [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
15
+
16
+ ## 9.0.1
17
+
18
+ ### Patch Changes
19
+
20
+ - [`45ebe7af434`](https://bitbucket.org/atlassian/atlassian-frontend/commits/45ebe7af434) - Moved to using declarative entrypoints internally. Public API is unchanged.
21
+
3
22
  ## 9.0.0
4
23
 
5
24
  ### Major Changes
@@ -39,9 +39,17 @@ 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 ").concat("var(--ds-border-selected, ".concat(_colors.B300, ")")),
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
- transform: "scale(".concat(_avatar.ACTIVE_SCALE_FACTOR, ")")
44
+ transform: "scale(".concat(_avatar.ACTIVE_SCALE_FACTOR, ")"),
45
+ '&:hover': {
46
+ backgroundColor: "var(--ds-background-selected-hovered, ".concat(_colors.N30, ")"),
47
+ color: "var(--ds-text-selected, ".concat(_colors.N500, ")")
48
+ },
49
+ '&:active': {
50
+ backgroundColor: "var(--ds-background-selected-pressed, ".concat(_colors.B50, ")"),
51
+ color: "var(--ds-text-selected, ".concat(_colors.B400, ")")
52
+ }
45
53
  }
46
54
  });
47
55
  var buttonStyles = (0, _core.css)({
@@ -53,18 +61,14 @@ var buttonStyles = (0, _core.css)({
53
61
  fontWeight: 500,
54
62
  '&:hover': {
55
63
  backgroundColor: "var(--ds-background-neutral-hovered, ".concat(_colors.N30, ")"),
56
- color: "var(--ds-text, ".concat(_colors.N500, ")"),
57
- '&:after': {
58
- backgroundColor: "var(--ds-background-neutral-hovered, ".concat(_colors.N30A, ")"),
59
- opacity: 1
60
- }
64
+ color: "var(--ds-text, ".concat(_colors.N500, ")")
61
65
  },
62
66
  '&:active': {
63
67
  backgroundColor: "var(--ds-background-neutral-pressed, ".concat(_colors.B50, ")"),
64
- color: "var(--ds-text, ".concat(_colors.B400, ")"),
65
- '&:after': {
66
- backgroundColor: 'transparent'
67
- }
68
+ color: "var(--ds-text, ".concat(_colors.B400, ")")
69
+ },
70
+ '&:after': {
71
+ display: 'none'
68
72
  }
69
73
  }
70
74
  });
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar-group",
3
- "version": "9.0.0",
3
+ "version": "9.0.3",
4
4
  "sideEffects": false
5
5
  }
@@ -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, N0, N20, N30, N30A, N500 } from '@atlaskit/theme/colors';
7
+ import { B300, B400, B50, N0, N20, N30, N500 } from '@atlaskit/theme/colors';
8
8
  const FONT_SIZE = {
9
9
  xsmall: '10px',
10
10
  small: '10px',
@@ -19,7 +19,15 @@ const buttonActiveStyles = css({
19
19
  backgroundColor: `var(--ds-background-selected, ${B50})`,
20
20
  boxShadow: `0 0 0 ${BORDER_WIDTH}px ${`var(--ds-border-selected, ${B300})`}`,
21
21
  color: `var(--ds-text-selected, ${B400})`,
22
- transform: `scale(${ACTIVE_SCALE_FACTOR})`
22
+ transform: `scale(${ACTIVE_SCALE_FACTOR})`,
23
+ '&:hover': {
24
+ backgroundColor: `var(--ds-background-selected-hovered, ${N30})`,
25
+ color: `var(--ds-text-selected, ${N500})`
26
+ },
27
+ '&:active': {
28
+ backgroundColor: `var(--ds-background-selected-pressed, ${B50})`,
29
+ color: `var(--ds-text-selected, ${B400})`
30
+ }
23
31
  }
24
32
  });
25
33
  const buttonStyles = css({
@@ -31,18 +39,14 @@ const buttonStyles = css({
31
39
  fontWeight: 500,
32
40
  '&:hover': {
33
41
  backgroundColor: `var(--ds-background-neutral-hovered, ${N30})`,
34
- color: `var(--ds-text, ${N500})`,
35
- '&:after': {
36
- backgroundColor: `var(--ds-background-neutral-hovered, ${N30A})`,
37
- opacity: 1
38
- }
42
+ color: `var(--ds-text, ${N500})`
39
43
  },
40
44
  '&:active': {
41
45
  backgroundColor: `var(--ds-background-neutral-pressed, ${B50})`,
42
- color: `var(--ds-text, ${B400})`,
43
- '&:after': {
44
- backgroundColor: 'transparent'
45
- }
46
+ color: `var(--ds-text, ${B400})`
47
+ },
48
+ '&:after': {
49
+ display: 'none'
46
50
  }
47
51
  }
48
52
  });
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar-group",
3
- "version": "9.0.0",
3
+ "version": "9.0.3",
4
4
  "sideEffects": false
5
5
  }
@@ -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, N0, N20, N30, N30A, N500 } from '@atlaskit/theme/colors';
9
+ import { B300, B400, B50, N0, N20, N30, N500 } from '@atlaskit/theme/colors';
10
10
  var FONT_SIZE = {
11
11
  xsmall: '10px',
12
12
  small: '10px',
@@ -19,9 +19,17 @@ 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 ").concat("var(--ds-border-selected, ".concat(B300, ")")),
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
- transform: "scale(".concat(ACTIVE_SCALE_FACTOR, ")")
24
+ transform: "scale(".concat(ACTIVE_SCALE_FACTOR, ")"),
25
+ '&:hover': {
26
+ backgroundColor: "var(--ds-background-selected-hovered, ".concat(N30, ")"),
27
+ color: "var(--ds-text-selected, ".concat(N500, ")")
28
+ },
29
+ '&:active': {
30
+ backgroundColor: "var(--ds-background-selected-pressed, ".concat(B50, ")"),
31
+ color: "var(--ds-text-selected, ".concat(B400, ")")
32
+ }
25
33
  }
26
34
  });
27
35
  var buttonStyles = css({
@@ -33,18 +41,14 @@ var buttonStyles = css({
33
41
  fontWeight: 500,
34
42
  '&:hover': {
35
43
  backgroundColor: "var(--ds-background-neutral-hovered, ".concat(N30, ")"),
36
- color: "var(--ds-text, ".concat(N500, ")"),
37
- '&:after': {
38
- backgroundColor: "var(--ds-background-neutral-hovered, ".concat(N30A, ")"),
39
- opacity: 1
40
- }
44
+ color: "var(--ds-text, ".concat(N500, ")")
41
45
  },
42
46
  '&:active': {
43
47
  backgroundColor: "var(--ds-background-neutral-pressed, ".concat(B50, ")"),
44
- color: "var(--ds-text, ".concat(B400, ")"),
45
- '&:after': {
46
- backgroundColor: 'transparent'
47
- }
48
+ color: "var(--ds-text, ".concat(B400, ")")
49
+ },
50
+ '&:after': {
51
+ display: 'none'
48
52
  }
49
53
  }
50
54
  });
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar-group",
3
- "version": "9.0.0",
3
+ "version": "9.0.3",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar-group",
3
- "version": "9.0.0",
3
+ "version": "9.0.3",
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/"
@@ -16,17 +16,20 @@
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
29
  "@atlaskit/avatar": "^21.0.0",
27
30
  "@atlaskit/menu": "^1.3.0",
28
- "@atlaskit/popup": "^1.3.0",
29
- "@atlaskit/theme": "^12.1.0",
31
+ "@atlaskit/popup": "^1.4.0",
32
+ "@atlaskit/theme": "^12.2.0",
30
33
  "@atlaskit/tokens": "^0.10.0",
31
34
  "@atlaskit/tooltip": "^17.5.0",
32
35
  "@babel/runtime": "^7.0.0",
@@ -42,18 +45,18 @@
42
45
  "@atlaskit/docs": "*",
43
46
  "@atlaskit/form": "^8.4.5",
44
47
  "@atlaskit/icon": "^21.10.0",
45
- "@atlaskit/modal-dialog": "^12.2.0",
46
- "@atlaskit/section-message": "^6.1.0",
48
+ "@atlaskit/modal-dialog": "^12.3.0",
49
+ "@atlaskit/section-message": "^6.2.0",
47
50
  "@atlaskit/ssr": "*",
48
- "@atlaskit/toggle": "^12.4.0",
51
+ "@atlaskit/toggle": "^12.5.0",
49
52
  "@atlaskit/visual-regression": "*",
50
53
  "@atlaskit/webdriver-runner": "*",
51
54
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
52
- "@emotion/styled": "^10.0.7",
55
+ "@emotion/styled": "^11.0.0",
53
56
  "@testing-library/react": "^8.0.1",
54
57
  "lodash": "^4.17.21",
55
58
  "react-dom": "^16.8.0",
56
- "typescript": "4.2.4",
59
+ "typescript": "4.3.5",
57
60
  "wait-for-expect": "^1.2.0"
58
61
  },
59
62
  "keywords": [
@@ -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
+ ```