@atlaskit/avatar-group 9.1.4 → 9.2.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/avatar-group
2
2
 
3
+ ## 9.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b0f6dd0bc35`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b0f6dd0bc35) - Updated to use typography tokens. There is no expected behaviour or visual change.
8
+
9
+ ## 9.2.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`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.
14
+
3
15
  ## 9.1.4
4
16
 
5
17
  ### 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
  };
@@ -57,8 +57,9 @@ var buttonStyles = (0, _react2.css)({
57
57
  '&&': {
58
58
  backgroundColor: "var(--ds-background-neutral, ".concat(_colors.N20, ")"),
59
59
  color: "var(--ds-text, ".concat(_colors.N500, ")"),
60
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
60
61
  fontFamily: 'inherit',
61
- fontWeight: 500,
62
+ fontWeight: "var(--ds-font-weight-medium, 500)",
62
63
  '&:hover': {
63
64
  backgroundColor: "var(--ds-background-neutral-hovered, ".concat(_colors.N30, ")"),
64
65
  color: "var(--ds-text, ".concat(_colors.N500, ")")
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar-group",
3
- "version": "9.1.4",
3
+ "version": "9.2.1",
4
4
  "sideEffects": false
5
5
  }
@@ -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
  };
@@ -35,8 +35,9 @@ const buttonStyles = css({
35
35
  '&&': {
36
36
  backgroundColor: `var(--ds-background-neutral, ${N20})`,
37
37
  color: `var(--ds-text, ${N500})`,
38
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
38
39
  fontFamily: 'inherit',
39
- fontWeight: 500,
40
+ fontWeight: "var(--ds-font-weight-medium, 500)",
40
41
  '&:hover': {
41
42
  backgroundColor: `var(--ds-background-neutral-hovered, ${N30})`,
42
43
  color: `var(--ds-text, ${N500})`
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar-group",
3
- "version": "9.1.4",
3
+ "version": "9.2.1",
4
4
  "sideEffects": false
5
5
  }
@@ -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
  };
@@ -37,8 +37,9 @@ var buttonStyles = css({
37
37
  '&&': {
38
38
  backgroundColor: "var(--ds-background-neutral, ".concat(N20, ")"),
39
39
  color: "var(--ds-text, ".concat(N500, ")"),
40
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage-spacing
40
41
  fontFamily: 'inherit',
41
- fontWeight: 500,
42
+ fontWeight: "var(--ds-font-weight-medium, 500)",
42
43
  '&:hover': {
43
44
  backgroundColor: "var(--ds-background-neutral-hovered, ".concat(N30, ")"),
44
45
  color: "var(--ds-text, ".concat(N500, ")")
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar-group",
3
- "version": "9.1.4",
3
+ "version": "9.2.1",
4
4
  "sideEffects": false
5
5
  }
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar-group",
3
- "version": "9.1.4",
3
+ "version": "9.2.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/"
package/report.api.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- API Report Version: 2.2 -->
1
+ <!-- API Report Version: 2.3 -->
2
2
 
3
3
  ## API Report File for "@atlaskit/avatar-group"
4
4
 
@@ -8,6 +8,7 @@
8
8
  ### Table of contents
9
9
 
10
10
  - [Main Entry Types](#main-entry-types)
11
+ - [Peer Dependencies](#peer-dependencies)
11
12
 
12
13
  ### Main Entry Types
13
14
 
@@ -19,6 +20,7 @@ import type { AvatarPropTypes } from '@atlaskit/avatar';
19
20
  import { ElementType } from 'react';
20
21
  import { jsx } from '@emotion/react';
21
22
  import { MouseEventHandler } from 'react';
23
+ import { PositionType } from '@atlaskit/tooltip';
22
24
  import type { ReactNode } from 'react';
23
25
  import { SizeType } from '@atlaskit/avatar';
24
26
 
@@ -38,6 +40,7 @@ const AvatarGroup: ({
38
40
  size,
39
41
  testId,
40
42
  label,
43
+ tooltipPosition,
41
44
  }: AvatarGroupProps) => jsx.JSX.Element;
42
45
  export default AvatarGroup;
43
46
 
@@ -93,6 +96,7 @@ export interface AvatarGroupProps {
93
96
  showMoreButtonProps?: Partial<React.HTMLAttributes<HTMLElement>>;
94
97
  size?: SizeType;
95
98
  testId?: string;
99
+ tooltipPosition?: Extract<PositionType, 'bottom' | 'top'>;
96
100
  }
97
101
 
98
102
  // @public (undocumented)
@@ -113,3 +117,15 @@ type onAvatarClickHandler = (
113
117
  ```
114
118
 
115
119
  <!--SECTION END: Main Entry Types-->
120
+
121
+ ### Peer Dependencies
122
+
123
+ <!--SECTION START: Peer Dependencies-->
124
+
125
+ ```json
126
+ {
127
+ "react": "^16.8.0"
128
+ }
129
+ ```
130
+
131
+ <!--SECTION END: Peer Dependencies-->