@atlaskit/avatar-group 12.1.3 → 12.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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/avatar-group
2
2
 
3
+ ## 12.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#198565](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/198565)
8
+ [`d3eacf36afe32`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d3eacf36afe32) -
9
+ Adjusted stack spacing at 'small' size to ensure visibility of "more" menu. Fix bug where grid
10
+ spacing was 4px too wide across all sizes
11
+
12
+ ## 12.1.4
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
3
18
  ## 12.1.3
4
19
 
5
20
  ### Patch Changes
@@ -246,7 +246,8 @@ var AvatarGroup = function AvatarGroup(_ref) {
246
246
  var Group = appearance === 'stack' ? _stack.default : _grid.default;
247
247
  return /*#__PURE__*/_react.default.createElement(Group, {
248
248
  testId: testId && "".concat(testId, "--avatar-group"),
249
- "aria-label": label
249
+ "aria-label": label,
250
+ size: size
250
251
  }, data.slice(0, maxAvatar).map(function (avatarData, idx) {
251
252
  var callback = avatarData.onClick || onAvatarClick;
252
253
  var finalAvatar = getOverrides(overrides).Avatar.render(avatar, _objectSpread(_objectSpread({}, avatarData), {}, {
@@ -7,13 +7,16 @@
7
7
  ._1pfhze3t{margin-block-start:var(--ds-space-0,0)}
8
8
  ._1q51ze3t{padding-block-start:var(--ds-space-0,0)}
9
9
  ._2mzuagmp{list-style-type:none!important}
10
+ ._6rth1b66{margin-block-end:var(--ds-space-050,4px)}
10
11
  ._6rthu2gc{margin-block-end:var(--ds-space-100,8px)}
11
12
  ._6rthze3t{margin-block-end:var(--ds-space-0,0)}
12
13
  ._85i5ze3t{padding-block-end:var(--ds-space-0,0)}
13
14
  ._ahbqr5cr{margin-inline-start:var(--ds-space-negative-050,-4px)}
14
15
  ._ahbqze3t{margin-inline-start:var(--ds-space-0,0)}
15
16
  ._bozg1b66{padding-inline-start:var(--ds-space-050,4px)}
17
+ ._bozgv77o{padding-inline-start:var(--ds-space-025,2px)}
16
18
  ._bozgze3t{padding-inline-start:var(--ds-space-0,0)}
17
19
  ._vwz4kb7n{line-height:1}
18
20
  ._y4ti1b66{padding-inline-end:var(--ds-space-050,4px)}
21
+ ._y4tiv77o{padding-inline-end:var(--ds-space-025,2px)}
19
22
  ._y4tize3t{padding-inline-end:var(--ds-space-0,0)}
@@ -10,9 +10,11 @@ require("./grid.compiled.css");
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
  var React = _react;
12
12
  var _runtime = require("@compiled/react/runtime");
13
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
14
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
14
15
  var gutter = "var(--ds-space-negative-050, -4px)";
15
16
  var listStyles = null;
17
+ var listStylesFlagged = null;
16
18
  var listItemStyles = null;
17
19
  var Grid = function Grid(_ref) {
18
20
  var children = _ref.children,
@@ -21,7 +23,7 @@ var Grid = function Grid(_ref) {
21
23
  return /*#__PURE__*/React.createElement("ul", {
22
24
  "data-testid": testId,
23
25
  "aria-label": label,
24
- className: (0, _runtime.ax)(["_1e0c1txw _1bah1y6m _1n261g80 _19121cl4 _vwz4kb7n _2mzuagmp _6rthze3t _1pfhze3t _12l2r5cr _ahbqr5cr _85i5ze3t _1q51ze3t _y4tize3t _bozgze3t"])
26
+ className: (0, _runtime.ax)(["_1e0c1txw _1bah1y6m _1n261g80 _19121cl4 _vwz4kb7n _2mzuagmp _6rthze3t _1pfhze3t _12l2r5cr _ahbqr5cr _85i5ze3t _1q51ze3t _y4tize3t _bozgze3t", (0, _platformFeatureFlags.fg)('platform-avatar-group-spacing-fix') && "_6rth1b66 _y4tiv77o _bozgv77o"])
25
27
  }, _react.Children.map(children, function (child) {
26
28
  return child && /*#__PURE__*/React.createElement("li", {
27
29
  className: (0, _runtime.ax)(["_6rthu2gc _1pfhze3t _12l2ze3t _ahbqze3t _y4ti1b66 _bozg1b66"])
@@ -1,3 +1,5 @@
1
+ ._12l21b66{margin-inline-end:var(--ds-space-050,4px)}
2
+ ._12l2r5cr{margin-inline-end:var(--ds-space-negative-050,-4px)}
1
3
  ._12l2u2gc{margin-inline-end:var(--ds-space-100,8px)}
2
4
  ._12l2x0bf{margin-inline-end:var(--ds-space-negative-100,-8px)}
3
5
  ._19121cl4{isolation:isolate}
@@ -10,20 +10,24 @@ require("./stack.compiled.css");
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
  var React = _react;
12
12
  var _runtime = require("@compiled/react/runtime");
13
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
14
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
14
15
  var listStyles = null;
16
+ var listSmallStyles = null;
15
17
  var listItemStyles = null;
18
+ var listItemSmallStyles = null;
16
19
  var Stack = function Stack(_ref) {
17
20
  var children = _ref.children,
18
21
  testId = _ref.testId,
19
- label = _ref['aria-label'];
22
+ label = _ref['aria-label'],
23
+ size = _ref.size;
20
24
  return /*#__PURE__*/React.createElement("ul", {
21
25
  "data-testid": testId,
22
26
  "aria-label": label,
23
- className: (0, _runtime.ax)(["_1e0c1txw _19121cl4 _vwz4kb7n _2mzuagmp _6rthze3t _1pfhze3t _12l2u2gc _ahbqze3t _85i5ze3t _1q51ze3t _y4tize3t _bozgze3t"])
27
+ className: (0, _runtime.ax)(["_1e0c1txw _19121cl4 _vwz4kb7n _2mzuagmp _6rthze3t _1pfhze3t _12l2u2gc _ahbqze3t _85i5ze3t _1q51ze3t _y4tize3t _bozgze3t", size === 'small' && (0, _platformFeatureFlags.fg)('platform-avatar-group-spacing-fix') && "_12l21b66"])
24
28
  }, _react.Children.map(children, function (child) {
25
29
  return child && /*#__PURE__*/React.createElement("li", {
26
- className: (0, _runtime.ax)(["_6rthze3t _1pfhze3t _12l2x0bf _ahbqze3t"])
30
+ className: (0, _runtime.ax)(["_6rthze3t _1pfhze3t _12l2x0bf _ahbqze3t", size === 'small' && (0, _platformFeatureFlags.fg)('platform-avatar-group-spacing-fix') && "_12l2r5cr"])
27
31
  }, child);
28
32
  }));
29
33
  };
@@ -209,7 +209,8 @@ const AvatarGroup = ({
209
209
  const Group = appearance === 'stack' ? Stack : Grid;
210
210
  return /*#__PURE__*/React.createElement(Group, {
211
211
  testId: testId && `${testId}--avatar-group`,
212
- "aria-label": label
212
+ "aria-label": label,
213
+ size: size
213
214
  }, data.slice(0, maxAvatar).map((avatarData, idx) => {
214
215
  const callback = avatarData.onClick || onAvatarClick;
215
216
  const finalAvatar = getOverrides(overrides).Avatar.render(avatar, {
@@ -7,13 +7,16 @@
7
7
  ._1pfhze3t{margin-block-start:var(--ds-space-0,0)}
8
8
  ._1q51ze3t{padding-block-start:var(--ds-space-0,0)}
9
9
  ._2mzuagmp{list-style-type:none!important}
10
+ ._6rth1b66{margin-block-end:var(--ds-space-050,4px)}
10
11
  ._6rthu2gc{margin-block-end:var(--ds-space-100,8px)}
11
12
  ._6rthze3t{margin-block-end:var(--ds-space-0,0)}
12
13
  ._85i5ze3t{padding-block-end:var(--ds-space-0,0)}
13
14
  ._ahbqr5cr{margin-inline-start:var(--ds-space-negative-050,-4px)}
14
15
  ._ahbqze3t{margin-inline-start:var(--ds-space-0,0)}
15
16
  ._bozg1b66{padding-inline-start:var(--ds-space-050,4px)}
17
+ ._bozgv77o{padding-inline-start:var(--ds-space-025,2px)}
16
18
  ._bozgze3t{padding-inline-start:var(--ds-space-0,0)}
17
19
  ._vwz4kb7n{line-height:1}
18
20
  ._y4ti1b66{padding-inline-end:var(--ds-space-050,4px)}
21
+ ._y4tiv77o{padding-inline-end:var(--ds-space-025,2px)}
19
22
  ._y4tize3t{padding-inline-end:var(--ds-space-0,0)}
@@ -3,8 +3,10 @@ import "./grid.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import { Children } from 'react';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
6
7
  const gutter = "var(--ds-space-negative-050, -4px)";
7
8
  const listStyles = null;
9
+ const listStylesFlagged = null;
8
10
  const listItemStyles = null;
9
11
  const Grid = ({
10
12
  children,
@@ -13,7 +15,7 @@ const Grid = ({
13
15
  }) => /*#__PURE__*/React.createElement("ul", {
14
16
  "data-testid": testId,
15
17
  "aria-label": label,
16
- className: ax(["_1e0c1txw _1bah1y6m _1n261g80 _19121cl4 _vwz4kb7n _2mzuagmp _6rthze3t _1pfhze3t _12l2r5cr _ahbqr5cr _85i5ze3t _1q51ze3t _y4tize3t _bozgze3t"])
18
+ className: ax(["_1e0c1txw _1bah1y6m _1n261g80 _19121cl4 _vwz4kb7n _2mzuagmp _6rthze3t _1pfhze3t _12l2r5cr _ahbqr5cr _85i5ze3t _1q51ze3t _y4tize3t _bozgze3t", fg('platform-avatar-group-spacing-fix') && "_6rth1b66 _y4tiv77o _bozgv77o"])
17
19
  }, Children.map(children, child => child && /*#__PURE__*/React.createElement("li", {
18
20
  className: ax(["_6rthu2gc _1pfhze3t _12l2ze3t _ahbqze3t _y4ti1b66 _bozg1b66"])
19
21
  }, child)));
@@ -1,3 +1,5 @@
1
+ ._12l21b66{margin-inline-end:var(--ds-space-050,4px)}
2
+ ._12l2r5cr{margin-inline-end:var(--ds-space-negative-050,-4px)}
1
3
  ._12l2u2gc{margin-inline-end:var(--ds-space-100,8px)}
2
4
  ._12l2x0bf{margin-inline-end:var(--ds-space-negative-100,-8px)}
3
5
  ._19121cl4{isolation:isolate}
@@ -3,18 +3,22 @@ import "./stack.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import { Children } from 'react';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
6
7
  const listStyles = null;
8
+ const listSmallStyles = null;
7
9
  const listItemStyles = null;
10
+ const listItemSmallStyles = null;
8
11
  const Stack = ({
9
12
  children,
10
13
  testId,
11
- 'aria-label': label
14
+ 'aria-label': label,
15
+ size
12
16
  }) => /*#__PURE__*/React.createElement("ul", {
13
17
  "data-testid": testId,
14
18
  "aria-label": label,
15
- className: ax(["_1e0c1txw _19121cl4 _vwz4kb7n _2mzuagmp _6rthze3t _1pfhze3t _12l2u2gc _ahbqze3t _85i5ze3t _1q51ze3t _y4tize3t _bozgze3t"])
19
+ className: ax(["_1e0c1txw _19121cl4 _vwz4kb7n _2mzuagmp _6rthze3t _1pfhze3t _12l2u2gc _ahbqze3t _85i5ze3t _1q51ze3t _y4tize3t _bozgze3t", size === 'small' && fg('platform-avatar-group-spacing-fix') && "_12l21b66"])
16
20
  }, Children.map(children, child => child && /*#__PURE__*/React.createElement("li", {
17
- className: ax(["_6rthze3t _1pfhze3t _12l2x0bf _ahbqze3t"])
21
+ className: ax(["_6rthze3t _1pfhze3t _12l2x0bf _ahbqze3t", size === 'small' && fg('platform-avatar-group-spacing-fix') && "_12l2r5cr"])
18
22
  }, child)));
19
23
 
20
24
  // eslint-disable-next-line @repo/internal/react/require-jsdoc
@@ -237,7 +237,8 @@ var AvatarGroup = function AvatarGroup(_ref) {
237
237
  var Group = appearance === 'stack' ? Stack : Grid;
238
238
  return /*#__PURE__*/React.createElement(Group, {
239
239
  testId: testId && "".concat(testId, "--avatar-group"),
240
- "aria-label": label
240
+ "aria-label": label,
241
+ size: size
241
242
  }, data.slice(0, maxAvatar).map(function (avatarData, idx) {
242
243
  var callback = avatarData.onClick || onAvatarClick;
243
244
  var finalAvatar = getOverrides(overrides).Avatar.render(avatar, _objectSpread(_objectSpread({}, avatarData), {}, {
@@ -7,13 +7,16 @@
7
7
  ._1pfhze3t{margin-block-start:var(--ds-space-0,0)}
8
8
  ._1q51ze3t{padding-block-start:var(--ds-space-0,0)}
9
9
  ._2mzuagmp{list-style-type:none!important}
10
+ ._6rth1b66{margin-block-end:var(--ds-space-050,4px)}
10
11
  ._6rthu2gc{margin-block-end:var(--ds-space-100,8px)}
11
12
  ._6rthze3t{margin-block-end:var(--ds-space-0,0)}
12
13
  ._85i5ze3t{padding-block-end:var(--ds-space-0,0)}
13
14
  ._ahbqr5cr{margin-inline-start:var(--ds-space-negative-050,-4px)}
14
15
  ._ahbqze3t{margin-inline-start:var(--ds-space-0,0)}
15
16
  ._bozg1b66{padding-inline-start:var(--ds-space-050,4px)}
17
+ ._bozgv77o{padding-inline-start:var(--ds-space-025,2px)}
16
18
  ._bozgze3t{padding-inline-start:var(--ds-space-0,0)}
17
19
  ._vwz4kb7n{line-height:1}
18
20
  ._y4ti1b66{padding-inline-end:var(--ds-space-050,4px)}
21
+ ._y4tiv77o{padding-inline-end:var(--ds-space-025,2px)}
19
22
  ._y4tize3t{padding-inline-end:var(--ds-space-0,0)}
@@ -3,8 +3,10 @@ import "./grid.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import { Children } from 'react';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
6
7
  var gutter = "var(--ds-space-negative-050, -4px)";
7
8
  var listStyles = null;
9
+ var listStylesFlagged = null;
8
10
  var listItemStyles = null;
9
11
  var Grid = function Grid(_ref) {
10
12
  var children = _ref.children,
@@ -13,7 +15,7 @@ var Grid = function Grid(_ref) {
13
15
  return /*#__PURE__*/React.createElement("ul", {
14
16
  "data-testid": testId,
15
17
  "aria-label": label,
16
- className: ax(["_1e0c1txw _1bah1y6m _1n261g80 _19121cl4 _vwz4kb7n _2mzuagmp _6rthze3t _1pfhze3t _12l2r5cr _ahbqr5cr _85i5ze3t _1q51ze3t _y4tize3t _bozgze3t"])
18
+ className: ax(["_1e0c1txw _1bah1y6m _1n261g80 _19121cl4 _vwz4kb7n _2mzuagmp _6rthze3t _1pfhze3t _12l2r5cr _ahbqr5cr _85i5ze3t _1q51ze3t _y4tize3t _bozgze3t", fg('platform-avatar-group-spacing-fix') && "_6rth1b66 _y4tiv77o _bozgv77o"])
17
19
  }, Children.map(children, function (child) {
18
20
  return child && /*#__PURE__*/React.createElement("li", {
19
21
  className: ax(["_6rthu2gc _1pfhze3t _12l2ze3t _ahbqze3t _y4ti1b66 _bozg1b66"])
@@ -1,3 +1,5 @@
1
+ ._12l21b66{margin-inline-end:var(--ds-space-050,4px)}
2
+ ._12l2r5cr{margin-inline-end:var(--ds-space-negative-050,-4px)}
1
3
  ._12l2u2gc{margin-inline-end:var(--ds-space-100,8px)}
2
4
  ._12l2x0bf{margin-inline-end:var(--ds-space-negative-100,-8px)}
3
5
  ._19121cl4{isolation:isolate}
@@ -3,19 +3,23 @@ import "./stack.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import { Children } from 'react';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
6
7
  var listStyles = null;
8
+ var listSmallStyles = null;
7
9
  var listItemStyles = null;
10
+ var listItemSmallStyles = null;
8
11
  var Stack = function Stack(_ref) {
9
12
  var children = _ref.children,
10
13
  testId = _ref.testId,
11
- label = _ref['aria-label'];
14
+ label = _ref['aria-label'],
15
+ size = _ref.size;
12
16
  return /*#__PURE__*/React.createElement("ul", {
13
17
  "data-testid": testId,
14
18
  "aria-label": label,
15
- className: ax(["_1e0c1txw _19121cl4 _vwz4kb7n _2mzuagmp _6rthze3t _1pfhze3t _12l2u2gc _ahbqze3t _85i5ze3t _1q51ze3t _y4tize3t _bozgze3t"])
19
+ className: ax(["_1e0c1txw _19121cl4 _vwz4kb7n _2mzuagmp _6rthze3t _1pfhze3t _12l2u2gc _ahbqze3t _85i5ze3t _1q51ze3t _y4tize3t _bozgze3t", size === 'small' && fg('platform-avatar-group-spacing-fix') && "_12l21b66"])
16
20
  }, Children.map(children, function (child) {
17
21
  return child && /*#__PURE__*/React.createElement("li", {
18
- className: ax(["_6rthze3t _1pfhze3t _12l2x0bf _ahbqze3t"])
22
+ className: ax(["_6rthze3t _1pfhze3t _12l2x0bf _ahbqze3t", size === 'small' && fg('platform-avatar-group-spacing-fix') && "_12l2r5cr"])
19
23
  }, child);
20
24
  }));
21
25
  };
@@ -3,9 +3,11 @@
3
3
  * @jsx jsx
4
4
  */
5
5
  import { type FC, type ReactNode } from 'react';
6
+ import { type AvatarGroupSize } from './types';
6
7
  declare const Stack: FC<{
7
8
  children: ReactNode;
8
9
  testId?: string;
9
10
  'aria-label': string;
11
+ size: AvatarGroupSize;
10
12
  }>;
11
13
  export default Stack;
@@ -3,9 +3,11 @@
3
3
  * @jsx jsx
4
4
  */
5
5
  import { type FC, type ReactNode } from 'react';
6
+ import { type AvatarGroupSize } from './types';
6
7
  declare const Stack: FC<{
7
8
  children: ReactNode;
8
9
  testId?: string;
9
10
  'aria-label': string;
11
+ size: AvatarGroupSize;
10
12
  }>;
11
13
  export default Stack;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar-group",
3
- "version": "12.1.3",
3
+ "version": "12.2.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/"
@@ -31,7 +31,7 @@
31
31
  "@atlaskit/platform-feature-flags": "^1.1.0",
32
32
  "@atlaskit/popup": "^4.3.0",
33
33
  "@atlaskit/theme": "^19.0.0",
34
- "@atlaskit/tokens": "^5.6.0",
34
+ "@atlaskit/tokens": "^6.0.0",
35
35
  "@atlaskit/tooltip": "^20.4.0",
36
36
  "@babel/runtime": "^7.0.0",
37
37
  "@compiled/react": "^0.18.3",
@@ -48,7 +48,7 @@
48
48
  "@atlaskit/button": "^23.3.0",
49
49
  "@atlaskit/docs": "^11.0.0",
50
50
  "@atlaskit/form": "^12.0.0",
51
- "@atlaskit/icon": "^27.8.0",
51
+ "@atlaskit/icon": "^27.10.0",
52
52
  "@atlaskit/link": "^3.2.0",
53
53
  "@atlaskit/modal-dialog": "^14.3.0",
54
54
  "@atlaskit/primitives": "^14.11.0",
@@ -60,8 +60,7 @@
60
60
  "@testing-library/react": "^13.4.0",
61
61
  "@testing-library/user-event": "^14.4.3",
62
62
  "lodash": "^4.17.21",
63
- "react-dom": "^18.2.0",
64
- "typescript": "~5.4.2"
63
+ "react-dom": "^18.2.0"
65
64
  },
66
65
  "keywords": [
67
66
  "atlaskit",
@@ -103,6 +102,9 @@
103
102
  "platform-feature-flags": {
104
103
  "platform-component-visual-refresh": {
105
104
  "type": "boolean"
105
+ },
106
+ "platform-avatar-group-spacing-fix": {
107
+ "type": "boolean"
106
108
  }
107
109
  }
108
110
  }