@atlaskit/avatar 25.0.3 → 25.0.4

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,13 @@
1
1
  # @atlaskit/avatar
2
2
 
3
+ ## 25.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#146865](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/146865)
8
+ [`944d9adf63995`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/944d9adf63995) -
9
+ add isDecorative attribute in the Avatar
10
+
3
11
  ## 25.0.3
4
12
 
5
13
  ### Patch Changes
@@ -25,7 +25,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
25
25
  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; }
26
26
  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; }
27
27
  var packageName = "@atlaskit/avatar";
28
- var packageVersion = "25.0.3";
28
+ var packageVersion = "25.0.4";
29
29
  var containerStyles = null;
30
30
 
31
31
  // eslint-disable-next-line @repo/internal/react/consistent-types-definitions
@@ -58,7 +58,9 @@ var Avatar = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
58
58
  target = _ref.target,
59
59
  testId = _ref.testId,
60
60
  _ref$as = _ref.as,
61
- AvatarContainer = _ref$as === void 0 ? 'div' : _ref$as;
61
+ AvatarContainer = _ref$as === void 0 ? 'div' : _ref$as,
62
+ _ref$isDecorative = _ref.isDecorative,
63
+ isDecorative = _ref$isDecorative === void 0 ? false : _ref$isDecorative;
62
64
  var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
63
65
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
64
66
  var context = (0, _context.useAvatarContext)();
@@ -118,7 +120,7 @@ var Avatar = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
118
120
  }, /*#__PURE__*/React.createElement(AvatarContainer, {
119
121
  "data-testid": testId,
120
122
  role: containerShouldBeImage ? 'img' : undefined,
121
- "aria-labelledby": containerShouldBeImage ? labelId : undefined,
123
+ "aria-labelledby": containerShouldBeImage && !isDecorative ? labelId : undefined,
122
124
  style: {
123
125
  zIndex: stackIndex
124
126
  },
@@ -12,7 +12,7 @@ import { PresenceWrapper } from './presence';
12
12
  import { StatusWrapper } from './status';
13
13
  import { getCustomElement } from './utilities';
14
14
  const packageName = "@atlaskit/avatar";
15
- const packageVersion = "25.0.3";
15
+ const packageVersion = "25.0.4";
16
16
  const containerStyles = null;
17
17
 
18
18
  // eslint-disable-next-line @repo/internal/react/consistent-types-definitions
@@ -43,7 +43,8 @@ const Avatar = /*#__PURE__*/forwardRef(({
43
43
  status,
44
44
  target,
45
45
  testId,
46
- as: AvatarContainer = 'div'
46
+ as: AvatarContainer = 'div',
47
+ isDecorative = false
47
48
  }, ref) => {
48
49
  const {
49
50
  createAnalyticsEvent
@@ -106,7 +107,7 @@ const Avatar = /*#__PURE__*/forwardRef(({
106
107
  }, /*#__PURE__*/React.createElement(AvatarContainer, {
107
108
  "data-testid": testId,
108
109
  role: containerShouldBeImage ? 'img' : undefined,
109
- "aria-labelledby": containerShouldBeImage ? labelId : undefined,
110
+ "aria-labelledby": containerShouldBeImage && !isDecorative ? labelId : undefined,
110
111
  style: {
111
112
  zIndex: stackIndex
112
113
  },
@@ -15,7 +15,7 @@ import { PresenceWrapper } from './presence';
15
15
  import { StatusWrapper } from './status';
16
16
  import { getCustomElement } from './utilities';
17
17
  var packageName = "@atlaskit/avatar";
18
- var packageVersion = "25.0.3";
18
+ var packageVersion = "25.0.4";
19
19
  var containerStyles = null;
20
20
 
21
21
  // eslint-disable-next-line @repo/internal/react/consistent-types-definitions
@@ -48,7 +48,9 @@ var Avatar = /*#__PURE__*/forwardRef(function (_ref, ref) {
48
48
  target = _ref.target,
49
49
  testId = _ref.testId,
50
50
  _ref$as = _ref.as,
51
- AvatarContainer = _ref$as === void 0 ? 'div' : _ref$as;
51
+ AvatarContainer = _ref$as === void 0 ? 'div' : _ref$as,
52
+ _ref$isDecorative = _ref.isDecorative,
53
+ isDecorative = _ref$isDecorative === void 0 ? false : _ref$isDecorative;
52
54
  var _useAnalyticsEvents = useAnalyticsEvents(),
53
55
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
54
56
  var context = useAvatarContext();
@@ -108,7 +110,7 @@ var Avatar = /*#__PURE__*/forwardRef(function (_ref, ref) {
108
110
  }, /*#__PURE__*/React.createElement(AvatarContainer, {
109
111
  "data-testid": testId,
110
112
  role: containerShouldBeImage ? 'img' : undefined,
111
- "aria-labelledby": containerShouldBeImage ? labelId : undefined,
113
+ "aria-labelledby": containerShouldBeImage && !isDecorative ? labelId : undefined,
112
114
  style: {
113
115
  zIndex: stackIndex
114
116
  },
@@ -90,6 +90,10 @@ export interface AvatarPropTypes {
90
90
  * be used to wrap the element.
91
91
  */
92
92
  as?: keyof JSX.IntrinsicElements | React.ComponentType<React.AllHTMLAttributes<HTMLElement>>;
93
+ /**
94
+ * whether disable aria-labelledby for avatar img
95
+ */
96
+ isDecorative?: boolean;
93
97
  }
94
98
  /**
95
99
  * __Avatar__
@@ -90,6 +90,10 @@ export interface AvatarPropTypes {
90
90
  * be used to wrap the element.
91
91
  */
92
92
  as?: keyof JSX.IntrinsicElements | React.ComponentType<React.AllHTMLAttributes<HTMLElement>>;
93
+ /**
94
+ * whether disable aria-labelledby for avatar img
95
+ */
96
+ isDecorative?: boolean;
93
97
  }
94
98
  /**
95
99
  * __Avatar__
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar",
3
- "version": "25.0.3",
3
+ "version": "25.0.4",
4
4
  "description": "An avatar is a visual representation of a user or entity.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -62,7 +62,7 @@
62
62
  "@af/integration-testing": "workspace:^",
63
63
  "@af/visual-regression": "workspace:^",
64
64
  "@atlaskit/button": "^23.0.0",
65
- "@atlaskit/code": "^17.0.0",
65
+ "@atlaskit/code": "^17.1.0",
66
66
  "@atlaskit/docs": "^10.0.0",
67
67
  "@atlaskit/form": "^12.0.0",
68
68
  "@atlaskit/heading": "^5.2.0",