@atlaskit/avatar 21.4.5 → 21.5.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,18 @@
1
1
  # @atlaskit/avatar
2
2
 
3
+ ## 21.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#69996](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69996) [`1b320a82df61`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1b320a82df61) - Add Team fallback avatar
8
+ - [#73763](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/73763) [`20bb01a34fcd`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/20bb01a34fcd) - test id selector added to Avatar label
9
+
10
+ ## 21.4.6
11
+
12
+ ### Patch Changes
13
+
14
+ - [#70213](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70213) [`31068e587071`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/31068e587071) - [ux] Removes decorative images of presence and status from view of assistive technologies. The presence and status are announced as part of the labeling of the parent component and therefore no longer necessary.
15
+
3
16
  ## 21.4.5
4
17
 
5
18
  ### Patch Changes
@@ -23,7 +23,7 @@ var _templateObject;
23
23
  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; }
24
24
  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; }
25
25
  var packageName = "@atlaskit/avatar";
26
- var packageVersion = "21.4.5";
26
+ var packageVersion = "21.5.0";
27
27
 
28
28
  // eslint-disable-next-line @repo/internal/react/consistent-types-definitions
29
29
 
@@ -107,7 +107,7 @@ var Avatar = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
107
107
  analyticsEvent.context.push(context);
108
108
 
109
109
  /**
110
- * Replicating the logic in the `withAnalyticsEvents` HOC
110
+ * Replicating the logic in the `withAnalyticsEvents` HOC.
111
111
  */
112
112
  var clone = analyticsEvent.clone();
113
113
  if (clone) {
@@ -192,6 +192,7 @@ var Avatar = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
192
192
  status: typeof status === 'string' ? status : undefined,
193
193
  testId: testId
194
194
  }, customStatusNode), containerShouldBeImage ? (0, _react2.jsx)("span", {
195
+ "data-testid": testId && "".concat(testId, "--label"),
195
196
  id: "".concat(uuid, "-label"),
196
197
  hidden: true
197
198
  }, defaultLabel) : undefined);
@@ -91,6 +91,7 @@ var PresenceWrapper = exports.PresenceWrapper = function PresenceWrapper(_ref2)
91
91
  testId = _ref2.testId;
92
92
  var position = appearance === 'square' ? -4 : _constants.ICON_OFFSET[size];
93
93
  return /*#__PURE__*/_react.default.createElement("span", {
94
+ "aria-hidden": "true",
94
95
  "data-testid": testId && "".concat(testId, "--presence"),
95
96
  style: {
96
97
  pointerEvents: 'none',
@@ -76,9 +76,9 @@ var AvatarStatus = function AvatarStatus(_ref) {
76
76
  };
77
77
  var _default = exports.default = AvatarStatus;
78
78
  /**
79
- * Status wrapper**
79
+ * __Status wrapper__
80
80
  *
81
- * A status wrapper is used internally to position status ontop of the avatar.
81
+ * A status wrapper is used internally to position status on top of the avatar.
82
82
  */
83
83
  var StatusWrapper = exports.StatusWrapper = function StatusWrapper(_ref2) {
84
84
  var size = _ref2.size,
@@ -89,6 +89,7 @@ var StatusWrapper = exports.StatusWrapper = function StatusWrapper(_ref2) {
89
89
  testId = _ref2.testId;
90
90
  var position = appearance === 'square' ? 0 : _constants.ICON_OFFSET[size];
91
91
  return /*#__PURE__*/_react.default.createElement("span", {
92
+ "aria-hidden": "true",
92
93
  "data-testid": testId && "".concat(testId, "--status"),
93
94
  style: {
94
95
  position: 'absolute',
@@ -11,7 +11,7 @@ import { PresenceWrapper } from './Presence';
11
11
  import { StatusWrapper } from './Status';
12
12
  import { getButtonProps, getCustomElement, getLinkProps } from './utilities';
13
13
  const packageName = "@atlaskit/avatar";
14
- const packageVersion = "21.4.5";
14
+ const packageVersion = "21.5.0";
15
15
 
16
16
  // eslint-disable-next-line @repo/internal/react/consistent-types-definitions
17
17
 
@@ -182,7 +182,7 @@ const Avatar = /*#__PURE__*/forwardRef(({
182
182
  analyticsEvent.context.push(context);
183
183
 
184
184
  /**
185
- * Replicating the logic in the `withAnalyticsEvents` HOC
185
+ * Replicating the logic in the `withAnalyticsEvents` HOC.
186
186
  */
187
187
  const clone = analyticsEvent.clone();
188
188
  if (clone) {
@@ -271,6 +271,7 @@ const Avatar = /*#__PURE__*/forwardRef(({
271
271
  status: typeof status === 'string' ? status : undefined,
272
272
  testId: testId
273
273
  }, customStatusNode), containerShouldBeImage ? jsx("span", {
274
+ "data-testid": testId && `${testId}--label`,
274
275
  id: `${uuid}-label`,
275
276
  hidden: true
276
277
  }, defaultLabel) : undefined);
@@ -80,6 +80,7 @@ export const PresenceWrapper = ({
80
80
  }) => {
81
81
  const position = appearance === 'square' ? -4 : ICON_OFFSET[size];
82
82
  return /*#__PURE__*/React.createElement("span", {
83
+ "aria-hidden": "true",
83
84
  "data-testid": testId && `${testId}--presence`,
84
85
  style: {
85
86
  pointerEvents: 'none',
@@ -64,9 +64,9 @@ const AvatarStatus = ({
64
64
  }, getStatus(status)) : children);
65
65
  export default AvatarStatus;
66
66
  /**
67
- * Status wrapper**
67
+ * __Status wrapper__
68
68
  *
69
- * A status wrapper is used internally to position status ontop of the avatar.
69
+ * A status wrapper is used internally to position status on top of the avatar.
70
70
  */
71
71
  export const StatusWrapper = ({
72
72
  size,
@@ -78,6 +78,7 @@ export const StatusWrapper = ({
78
78
  }) => {
79
79
  const position = appearance === 'square' ? 0 : ICON_OFFSET[size];
80
80
  return /*#__PURE__*/React.createElement("span", {
81
+ "aria-hidden": "true",
81
82
  "data-testid": testId && `${testId}--status`,
82
83
  style: {
83
84
  position: 'absolute',
@@ -16,7 +16,7 @@ import { PresenceWrapper } from './Presence';
16
16
  import { StatusWrapper } from './Status';
17
17
  import { getButtonProps, getCustomElement, getLinkProps } from './utilities';
18
18
  var packageName = "@atlaskit/avatar";
19
- var packageVersion = "21.4.5";
19
+ var packageVersion = "21.5.0";
20
20
 
21
21
  // eslint-disable-next-line @repo/internal/react/consistent-types-definitions
22
22
 
@@ -100,7 +100,7 @@ var Avatar = /*#__PURE__*/forwardRef(function (_ref2, ref) {
100
100
  analyticsEvent.context.push(context);
101
101
 
102
102
  /**
103
- * Replicating the logic in the `withAnalyticsEvents` HOC
103
+ * Replicating the logic in the `withAnalyticsEvents` HOC.
104
104
  */
105
105
  var clone = analyticsEvent.clone();
106
106
  if (clone) {
@@ -185,6 +185,7 @@ var Avatar = /*#__PURE__*/forwardRef(function (_ref2, ref) {
185
185
  status: typeof status === 'string' ? status : undefined,
186
186
  testId: testId
187
187
  }, customStatusNode), containerShouldBeImage ? jsx("span", {
188
+ "data-testid": testId && "".concat(testId, "--label"),
188
189
  id: "".concat(uuid, "-label"),
189
190
  hidden: true
190
191
  }, defaultLabel) : undefined);
@@ -80,6 +80,7 @@ export var PresenceWrapper = function PresenceWrapper(_ref2) {
80
80
  testId = _ref2.testId;
81
81
  var position = appearance === 'square' ? -4 : ICON_OFFSET[size];
82
82
  return /*#__PURE__*/React.createElement("span", {
83
+ "aria-hidden": "true",
83
84
  "data-testid": testId && "".concat(testId, "--presence"),
84
85
  style: {
85
86
  pointerEvents: 'none',
@@ -65,9 +65,9 @@ var AvatarStatus = function AvatarStatus(_ref) {
65
65
  };
66
66
  export default AvatarStatus;
67
67
  /**
68
- * Status wrapper**
68
+ * __Status wrapper__
69
69
  *
70
- * A status wrapper is used internally to position status ontop of the avatar.
70
+ * A status wrapper is used internally to position status on top of the avatar.
71
71
  */
72
72
  export var StatusWrapper = function StatusWrapper(_ref2) {
73
73
  var size = _ref2.size,
@@ -78,6 +78,7 @@ export var StatusWrapper = function StatusWrapper(_ref2) {
78
78
  testId = _ref2.testId;
79
79
  var position = appearance === 'square' ? 0 : ICON_OFFSET[size];
80
80
  return /*#__PURE__*/React.createElement("span", {
81
+ "aria-hidden": "true",
81
82
  "data-testid": testId && "".concat(testId, "--status"),
82
83
  style: {
83
84
  position: 'absolute',
@@ -4,7 +4,6 @@ import { AppearanceType, AvatarClickEventHandler, Presence, SizeType, Status } f
4
4
  export interface CustomAvatarProps {
5
5
  /**
6
6
  * This is used in render props so is okay to be defined.
7
- * eslint-disable-next-line consistent-props-definitions
8
7
  */
9
8
  'aria-label'?: string;
10
9
  tabIndex?: number;
@@ -12,13 +12,9 @@ export interface PresenceProps {
12
12
  */
13
13
  children?: ReactNode;
14
14
  /**
15
- * The type of presence indicator to show
15
+ * The type of presence indicator to show.
16
16
  */
17
17
  presence?: Presence;
18
- /**
19
- * Test Id
20
- */
21
- testId?: string;
22
18
  }
23
19
  /**
24
20
  * __Avatar presence__
@@ -12,8 +12,7 @@ export interface StatusProps {
12
12
  */
13
13
  children?: ReactNode;
14
14
  /**
15
- * Content to use as a custom status indicator. Not needed if consuming
16
- * `Status` separate to `Avatar`.
15
+ * The type of status indicator to show.
17
16
  */
18
17
  status?: Status;
19
18
  }
@@ -30,12 +29,11 @@ export default AvatarStatus;
30
29
  interface StatusWrapperProps extends StatusProps {
31
30
  appearance: AppearanceType;
32
31
  size: IndicatorSizeType;
33
- children: ReactNode;
34
32
  testId?: string;
35
33
  }
36
34
  /**
37
- * Status wrapper**
35
+ * __Status wrapper__
38
36
  *
39
- * A status wrapper is used internally to position status ontop of the avatar.
37
+ * A status wrapper is used internally to position status on top of the avatar.
40
38
  */
41
39
  export declare const StatusWrapper: FC<StatusWrapperProps>;
@@ -4,7 +4,6 @@ import { AppearanceType, AvatarClickEventHandler, Presence, SizeType, Status } f
4
4
  export interface CustomAvatarProps {
5
5
  /**
6
6
  * This is used in render props so is okay to be defined.
7
- * eslint-disable-next-line consistent-props-definitions
8
7
  */
9
8
  'aria-label'?: string;
10
9
  tabIndex?: number;
@@ -12,13 +12,9 @@ export interface PresenceProps {
12
12
  */
13
13
  children?: ReactNode;
14
14
  /**
15
- * The type of presence indicator to show
15
+ * The type of presence indicator to show.
16
16
  */
17
17
  presence?: Presence;
18
- /**
19
- * Test Id
20
- */
21
- testId?: string;
22
18
  }
23
19
  /**
24
20
  * __Avatar presence__
@@ -12,8 +12,7 @@ export interface StatusProps {
12
12
  */
13
13
  children?: ReactNode;
14
14
  /**
15
- * Content to use as a custom status indicator. Not needed if consuming
16
- * `Status` separate to `Avatar`.
15
+ * The type of status indicator to show.
17
16
  */
18
17
  status?: Status;
19
18
  }
@@ -30,12 +29,11 @@ export default AvatarStatus;
30
29
  interface StatusWrapperProps extends StatusProps {
31
30
  appearance: AppearanceType;
32
31
  size: IndicatorSizeType;
33
- children: ReactNode;
34
32
  testId?: string;
35
33
  }
36
34
  /**
37
- * Status wrapper**
35
+ * __Status wrapper__
38
36
  *
39
- * A status wrapper is used internally to position status ontop of the avatar.
37
+ * A status wrapper is used internally to position status on top of the avatar.
40
38
  */
41
39
  export declare const StatusWrapper: FC<StatusWrapperProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar",
3
- "version": "21.4.5",
3
+ "version": "21.5.0",
4
4
  "description": "An avatar is a visual representation of a user or entity.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -43,10 +43,10 @@
43
43
  ".": "./src/index.ts"
44
44
  },
45
45
  "dependencies": {
46
- "@atlaskit/analytics-next": "^9.1.0",
46
+ "@atlaskit/analytics-next": "^9.2.0",
47
47
  "@atlaskit/icon": "^22.0.0",
48
48
  "@atlaskit/theme": "^12.6.0",
49
- "@atlaskit/tokens": "^1.34.0",
49
+ "@atlaskit/tokens": "^1.38.0",
50
50
  "@babel/runtime": "^7.0.0",
51
51
  "@emotion/react": "^11.7.1",
52
52
  "@emotion/serialize": "^1.1.0",