@atlaskit/teams-avatar 2.0.0 → 2.0.2

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,22 @@
1
1
  # @atlaskit/teams-avatar
2
2
 
3
+ ## 2.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#118053](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/118053)
8
+ [`536325e780241`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/536325e780241) -
9
+ Fix to align with the regular avatar styles
10
+
11
+ ## 2.0.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [#117222](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/117222)
16
+ [`acb92790d7b4b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/acb92790d7b4b) -
17
+ Update the usage of `@atlaskit/avatar` to ensure compatibility with the latest version.
18
+ - Updated dependencies
19
+
3
20
  ## 2.0.0
4
21
 
5
22
  ### Major Changes
@@ -28,11 +28,9 @@ function TeamAvatar(_ref) {
28
28
  size: size,
29
29
  src: src,
30
30
  testId: "".concat(testId, "-team-avatar")
31
- }), function (innerProps) {
32
- return /*#__PURE__*/_react.default.createElement(_teamsAvatarImage.TeamAvatarImage, (0, _extends2.default)({
33
- src: src,
34
- size: size,
35
- testId: testId
36
- }, innerProps));
37
- });
31
+ }), /*#__PURE__*/_react.default.createElement(_teamsAvatarImage.TeamAvatarImage, {
32
+ src: src,
33
+ size: size,
34
+ testId: testId
35
+ }));
38
36
  }
@@ -0,0 +1,5 @@
1
+ ._18u0v77o{margin-left:var(--ds-space-025,2px)}
2
+ ._19pkv77o{margin-top:var(--ds-space-025,2px)}
3
+ ._1e0c1txw{display:flex}
4
+ ._2hwxv77o{margin-right:var(--ds-space-025,2px)}
5
+ ._otyrv77o{margin-bottom:var(--ds-space-025,2px)}
@@ -1,3 +1,4 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -5,10 +6,18 @@ Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.FallbackAvatar = FallbackAvatar;
9
+ require("./index.compiled.css");
10
+ var _runtime = require("@compiled/react/runtime");
8
11
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
12
  var _react = _interopRequireDefault(require("react"));
13
+ var _compiled = require("@atlaskit/primitives/compiled");
14
+ var styles = {
15
+ wrapper: "_1e0c1txw _19pkv77o _2hwxv77o _otyrv77o _18u0v77o"
16
+ };
10
17
  function FallbackAvatar(props) {
11
- return /*#__PURE__*/_react.default.createElement("svg", (0, _extends2.default)({
18
+ return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
19
+ xcss: styles.wrapper
20
+ }, /*#__PURE__*/_react.default.createElement("svg", (0, _extends2.default)({
12
21
  width: "32",
13
22
  height: "32",
14
23
  viewBox: "0 0 32 32",
@@ -44,5 +53,5 @@ function FallbackAvatar(props) {
44
53
  height: "32",
45
54
  rx: "4",
46
55
  fill: "white"
47
- }))));
56
+ })))));
48
57
  }
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.TeamAvatarImage = void 0;
8
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
10
  var _react = require("react");
@@ -15,7 +14,6 @@ var _people = _interopRequireDefault(require("@atlaskit/icon/glyph/people"));
15
14
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
15
  var _colors = require("@atlaskit/theme/colors");
17
16
  var _fallback = require("./fallback");
18
- var _excluded = ["alt", "src", "size", "testId"];
19
17
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
20
18
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /**
21
19
  * @jsxRuntime classic
@@ -77,8 +75,7 @@ var TeamAvatarImage = exports.TeamAvatarImage = function TeamAvatarImage(_ref3)
77
75
  alt = _ref3$alt === void 0 ? '' : _ref3$alt,
78
76
  src = _ref3.src,
79
77
  size = _ref3.size,
80
- testId = _ref3.testId,
81
- rest = (0, _objectWithoutProperties2.default)(_ref3, _excluded);
78
+ testId = _ref3.testId;
82
79
  var _useState = (0, _react.useState)(false),
83
80
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
84
81
  hasImageErrored = _useState2[0],
@@ -106,7 +103,7 @@ var TeamAvatarImage = exports.TeamAvatarImage = function TeamAvatarImage(_ref3)
106
103
  testId: testId && "".concat(testId, "--team")
107
104
  }));
108
105
  }
109
- return (0, _react2.jsx)("span", rest, (0, _react2.jsx)("img", {
106
+ return (0, _react2.jsx)(_avatar.AvatarContent, null, (0, _react2.jsx)("img", {
110
107
  src: src,
111
108
  alt: alt,
112
109
  "data-testid": testId && "".concat(testId, "--image"),
@@ -18,9 +18,9 @@ export default function TeamAvatar({
18
18
  size: size,
19
19
  src: src,
20
20
  testId: `${testId}-team-avatar`
21
- }), innerProps => /*#__PURE__*/React.createElement(TeamAvatarImage, _extends({
21
+ }), /*#__PURE__*/React.createElement(TeamAvatarImage, {
22
22
  src: src,
23
23
  size: size,
24
24
  testId: testId
25
- }, innerProps)));
25
+ }));
26
26
  }
@@ -0,0 +1,5 @@
1
+ ._18u0v77o{margin-left:var(--ds-space-025,2px)}
2
+ ._19pkv77o{margin-top:var(--ds-space-025,2px)}
3
+ ._1e0c1txw{display:flex}
4
+ ._2hwxv77o{margin-right:var(--ds-space-025,2px)}
5
+ ._otyrv77o{margin-bottom:var(--ds-space-025,2px)}
@@ -1,7 +1,16 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  import _extends from "@babel/runtime/helpers/extends";
3
+ import "./index.compiled.css";
4
+ import { ax, ix } from "@compiled/react/runtime";
2
5
  import React from 'react';
6
+ import { Box } from '@atlaskit/primitives/compiled';
7
+ const styles = {
8
+ wrapper: "_1e0c1txw _19pkv77o _2hwxv77o _otyrv77o _18u0v77o"
9
+ };
3
10
  export function FallbackAvatar(props) {
4
- return /*#__PURE__*/React.createElement("svg", _extends({
11
+ return /*#__PURE__*/React.createElement(Box, {
12
+ xcss: styles.wrapper
13
+ }, /*#__PURE__*/React.createElement("svg", _extends({
5
14
  width: "32",
6
15
  height: "32",
7
16
  viewBox: "0 0 32 32",
@@ -37,5 +46,5 @@ export function FallbackAvatar(props) {
37
46
  height: "32",
38
47
  rx: "4",
39
48
  fill: "white"
40
- }))));
49
+ })))));
41
50
  }
@@ -6,7 +6,7 @@ import { useEffect, useState } from 'react';
6
6
 
7
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
8
  import { css, jsx } from '@emotion/react';
9
- import { AVATAR_SIZES } from '@atlaskit/avatar';
9
+ import { AVATAR_SIZES, AvatarContent } from '@atlaskit/avatar';
10
10
  import TeamIcon from '@atlaskit/icon/glyph/people';
11
11
  import { fg } from '@atlaskit/platform-feature-flags';
12
12
  import { N0, N90 } from '@atlaskit/theme/colors';
@@ -66,8 +66,7 @@ export const TeamAvatarImage = ({
66
66
  alt = '',
67
67
  src,
68
68
  size,
69
- testId,
70
- ...rest
69
+ testId
71
70
  }) => {
72
71
  const [hasImageErrored, setHasImageErrored] = useState(false);
73
72
 
@@ -93,7 +92,7 @@ export const TeamAvatarImage = ({
93
92
  testId: testId && `${testId}--team`
94
93
  }));
95
94
  }
96
- return jsx("span", rest, jsx("img", {
95
+ return jsx(AvatarContent, null, jsx("img", {
97
96
  src: src,
98
97
  alt: alt,
99
98
  "data-testid": testId && `${testId}--image`,
@@ -20,11 +20,9 @@ export default function TeamAvatar(_ref) {
20
20
  size: size,
21
21
  src: src,
22
22
  testId: "".concat(testId, "-team-avatar")
23
- }), function (innerProps) {
24
- return /*#__PURE__*/React.createElement(TeamAvatarImage, _extends({
25
- src: src,
26
- size: size,
27
- testId: testId
28
- }, innerProps));
29
- });
23
+ }), /*#__PURE__*/React.createElement(TeamAvatarImage, {
24
+ src: src,
25
+ size: size,
26
+ testId: testId
27
+ }));
30
28
  }
@@ -0,0 +1,5 @@
1
+ ._18u0v77o{margin-left:var(--ds-space-025,2px)}
2
+ ._19pkv77o{margin-top:var(--ds-space-025,2px)}
3
+ ._1e0c1txw{display:flex}
4
+ ._2hwxv77o{margin-right:var(--ds-space-025,2px)}
5
+ ._otyrv77o{margin-bottom:var(--ds-space-025,2px)}
@@ -1,7 +1,16 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
1
2
  import _extends from "@babel/runtime/helpers/extends";
3
+ import "./index.compiled.css";
4
+ import { ax, ix } from "@compiled/react/runtime";
2
5
  import React from 'react';
6
+ import { Box } from '@atlaskit/primitives/compiled';
7
+ var styles = {
8
+ wrapper: "_1e0c1txw _19pkv77o _2hwxv77o _otyrv77o _18u0v77o"
9
+ };
3
10
  export function FallbackAvatar(props) {
4
- return /*#__PURE__*/React.createElement("svg", _extends({
11
+ return /*#__PURE__*/React.createElement(Box, {
12
+ xcss: styles.wrapper
13
+ }, /*#__PURE__*/React.createElement("svg", _extends({
5
14
  width: "32",
6
15
  height: "32",
7
16
  viewBox: "0 0 32 32",
@@ -37,5 +46,5 @@ export function FallbackAvatar(props) {
37
46
  height: "32",
38
47
  rx: "4",
39
48
  fill: "white"
40
- }))));
49
+ })))));
41
50
  }
@@ -1,7 +1,5 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
- var _excluded = ["alt", "src", "size", "testId"];
5
3
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
4
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
5
  /**
@@ -12,7 +10,7 @@ import { useEffect, useState } from 'react';
12
10
 
13
11
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
14
12
  import { css, jsx } from '@emotion/react';
15
- import { AVATAR_SIZES } from '@atlaskit/avatar';
13
+ import { AVATAR_SIZES, AvatarContent } from '@atlaskit/avatar';
16
14
  import TeamIcon from '@atlaskit/icon/glyph/people';
17
15
  import { fg } from '@atlaskit/platform-feature-flags';
18
16
  import { N0, N90 } from '@atlaskit/theme/colors';
@@ -73,8 +71,7 @@ export var TeamAvatarImage = function TeamAvatarImage(_ref3) {
73
71
  alt = _ref3$alt === void 0 ? '' : _ref3$alt,
74
72
  src = _ref3.src,
75
73
  size = _ref3.size,
76
- testId = _ref3.testId,
77
- rest = _objectWithoutProperties(_ref3, _excluded);
74
+ testId = _ref3.testId;
78
75
  var _useState = useState(false),
79
76
  _useState2 = _slicedToArray(_useState, 2),
80
77
  hasImageErrored = _useState2[0],
@@ -102,7 +99,7 @@ export var TeamAvatarImage = function TeamAvatarImage(_ref3) {
102
99
  testId: testId && "".concat(testId, "--team")
103
100
  }));
104
101
  }
105
- return jsx("span", rest, jsx("img", {
102
+ return jsx(AvatarContent, null, jsx("img", {
106
103
  src: src,
107
104
  alt: alt,
108
105
  "data-testid": testId && "".concat(testId, "--image"),
@@ -1,15 +1,15 @@
1
1
  import { jsx } from '@emotion/react';
2
- import { type CustomAvatarProps, type SizeType } from '@atlaskit/avatar';
2
+ import { type SizeType } from '@atlaskit/avatar';
3
3
  type AvatarImageProps = {
4
4
  size: SizeType;
5
5
  alt?: string;
6
6
  src?: string;
7
7
  testId?: string;
8
- } & CustomAvatarProps;
8
+ };
9
9
  /**
10
10
  * __Avatar image__
11
11
  *
12
12
  * An avatar image is an internal component used to control the rendering phases of an image.
13
13
  */
14
- export declare const TeamAvatarImage: ({ alt, src, size, testId, ...rest }: AvatarImageProps) => jsx.JSX.Element;
14
+ export declare const TeamAvatarImage: ({ alt, src, size, testId }: AvatarImageProps) => jsx.JSX.Element;
15
15
  export {};
@@ -1,15 +1,15 @@
1
1
  import { jsx } from '@emotion/react';
2
- import { type CustomAvatarProps, type SizeType } from '@atlaskit/avatar';
2
+ import { type SizeType } from '@atlaskit/avatar';
3
3
  type AvatarImageProps = {
4
4
  size: SizeType;
5
5
  alt?: string;
6
6
  src?: string;
7
7
  testId?: string;
8
- } & CustomAvatarProps;
8
+ };
9
9
  /**
10
10
  * __Avatar image__
11
11
  *
12
12
  * An avatar image is an internal component used to control the rendering phases of an image.
13
13
  */
14
- export declare const TeamAvatarImage: ({ alt, src, size, testId, ...rest }: AvatarImageProps) => jsx.JSX.Element;
14
+ export declare const TeamAvatarImage: ({ alt, src, size, testId }: AvatarImageProps) => jsx.JSX.Element;
15
15
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/teams-avatar",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "A team avatar is a visual representation of a team.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -35,11 +35,13 @@
35
35
  ".": "./src/index.ts"
36
36
  },
37
37
  "dependencies": {
38
- "@atlaskit/avatar": "^22.0.0",
39
- "@atlaskit/icon": "^24.0.0",
38
+ "@atlaskit/avatar": "^23.0.0",
39
+ "@atlaskit/css": "^0.10.0",
40
+ "@atlaskit/icon": "^24.1.0",
40
41
  "@atlaskit/platform-feature-flags": "^1.1.0",
42
+ "@atlaskit/primitives": "^14.1.0",
41
43
  "@atlaskit/theme": "^17.0.0",
42
- "@atlaskit/tokens": "^4.0.0",
44
+ "@atlaskit/tokens": "^4.2.0",
43
45
  "@babel/runtime": "^7.0.0",
44
46
  "@emotion/react": "^11.7.1"
45
47
  },