@atlaskit/avatar 25.3.1 → 25.3.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,12 @@
1
1
  # @atlaskit/avatar
2
2
 
3
+ ## 25.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`2e422847ee061`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2e422847ee061) -
8
+ [ux] Revert PR (Add a new prop to set the container element for avatar content)
9
+
3
10
  ## 25.3.1
4
11
 
5
12
  ### Patch Changes
@@ -58,8 +58,6 @@ var Avatar = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
58
58
  testId = _ref.testId,
59
59
  _ref$as = _ref.as,
60
60
  AvatarContainer = _ref$as === void 0 ? 'div' : _ref$as,
61
- contentAs = _ref.contentAs,
62
- containerRole = _ref.containerRole,
63
61
  _ref$isDecorative = _ref.isDecorative,
64
62
  isDecorative = _ref$isDecorative === void 0 ? false : _ref$isDecorative,
65
63
  imgLoading = _ref.imgLoading;
@@ -117,12 +115,11 @@ var Avatar = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
117
115
  var defaultLabel = [name, isStatus && !customStatusNode && "(".concat(status, ")"), isPresence && !customPresenceNode && "(".concat(presence, ")")].filter(Boolean).join(' ');
118
116
  var isInteractive = onClick || href || isDisabled;
119
117
  var containerShouldBeImage = Boolean(!isInteractive && defaultLabel);
120
- var avatarContainerRole = containerRole || (containerShouldBeImage ? 'img' : undefined);
121
118
  return /*#__PURE__*/React.createElement(_context.EnsureIsInsideAvatarContext.Provider, {
122
119
  value: true
123
120
  }, /*#__PURE__*/React.createElement(AvatarContainer, {
124
121
  "data-testid": testId,
125
- role: avatarContainerRole,
122
+ role: containerShouldBeImage ? 'img' : undefined,
126
123
  "aria-labelledby": containerShouldBeImage && !isDecorative ? labelId : undefined,
127
124
  style: {
128
125
  zIndex: stackIndex
@@ -130,7 +127,7 @@ var Avatar = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
130
127
  className: (0, _runtime.ax)(["_12ji1r31 _1qu2glyw _12y3idpf _1e0c1o8l _kqswh2mm"])
131
128
  }, /*#__PURE__*/React.createElement(_context.AvatarContentContext.Provider, {
132
129
  value: {
133
- as: contentAs || (0, _utilities.getCustomElement)(isDisabled, href, onClick),
130
+ as: (0, _utilities.getCustomElement)(isDisabled, href, onClick),
134
131
  appearance: appearance,
135
132
  borderColor: borderColor,
136
133
  href: href,
@@ -44,8 +44,6 @@ const Avatar = /*#__PURE__*/forwardRef(({
44
44
  target,
45
45
  testId,
46
46
  as: AvatarContainer = 'div',
47
- contentAs,
48
- containerRole,
49
47
  isDecorative = false,
50
48
  imgLoading
51
49
  }, ref) => {
@@ -105,12 +103,11 @@ const Avatar = /*#__PURE__*/forwardRef(({
105
103
  const defaultLabel = [name, isStatus && !customStatusNode && `(${status})`, isPresence && !customPresenceNode && `(${presence})`].filter(Boolean).join(' ');
106
104
  const isInteractive = onClick || href || isDisabled;
107
105
  const containerShouldBeImage = Boolean(!isInteractive && defaultLabel);
108
- const avatarContainerRole = containerRole || (containerShouldBeImage ? 'img' : undefined);
109
106
  return /*#__PURE__*/React.createElement(EnsureIsInsideAvatarContext.Provider, {
110
107
  value: true
111
108
  }, /*#__PURE__*/React.createElement(AvatarContainer, {
112
109
  "data-testid": testId,
113
- role: avatarContainerRole,
110
+ role: containerShouldBeImage ? 'img' : undefined,
114
111
  "aria-labelledby": containerShouldBeImage && !isDecorative ? labelId : undefined,
115
112
  style: {
116
113
  zIndex: stackIndex
@@ -118,7 +115,7 @@ const Avatar = /*#__PURE__*/forwardRef(({
118
115
  className: ax(["_12ji1r31 _1qu2glyw _12y3idpf _1e0c1o8l _kqswh2mm"])
119
116
  }, /*#__PURE__*/React.createElement(AvatarContentContext.Provider, {
120
117
  value: {
121
- as: contentAs || getCustomElement(isDisabled, href, onClick),
118
+ as: getCustomElement(isDisabled, href, onClick),
122
119
  appearance,
123
120
  borderColor,
124
121
  href,
@@ -49,8 +49,6 @@ var Avatar = /*#__PURE__*/forwardRef(function (_ref, ref) {
49
49
  testId = _ref.testId,
50
50
  _ref$as = _ref.as,
51
51
  AvatarContainer = _ref$as === void 0 ? 'div' : _ref$as,
52
- contentAs = _ref.contentAs,
53
- containerRole = _ref.containerRole,
54
52
  _ref$isDecorative = _ref.isDecorative,
55
53
  isDecorative = _ref$isDecorative === void 0 ? false : _ref$isDecorative,
56
54
  imgLoading = _ref.imgLoading;
@@ -108,12 +106,11 @@ var Avatar = /*#__PURE__*/forwardRef(function (_ref, ref) {
108
106
  var defaultLabel = [name, isStatus && !customStatusNode && "(".concat(status, ")"), isPresence && !customPresenceNode && "(".concat(presence, ")")].filter(Boolean).join(' ');
109
107
  var isInteractive = onClick || href || isDisabled;
110
108
  var containerShouldBeImage = Boolean(!isInteractive && defaultLabel);
111
- var avatarContainerRole = containerRole || (containerShouldBeImage ? 'img' : undefined);
112
109
  return /*#__PURE__*/React.createElement(EnsureIsInsideAvatarContext.Provider, {
113
110
  value: true
114
111
  }, /*#__PURE__*/React.createElement(AvatarContainer, {
115
112
  "data-testid": testId,
116
- role: avatarContainerRole,
113
+ role: containerShouldBeImage ? 'img' : undefined,
117
114
  "aria-labelledby": containerShouldBeImage && !isDecorative ? labelId : undefined,
118
115
  style: {
119
116
  zIndex: stackIndex
@@ -121,7 +118,7 @@ var Avatar = /*#__PURE__*/forwardRef(function (_ref, ref) {
121
118
  className: ax(["_12ji1r31 _1qu2glyw _12y3idpf _1e0c1o8l _kqswh2mm"])
122
119
  }, /*#__PURE__*/React.createElement(AvatarContentContext.Provider, {
123
120
  value: {
124
- as: contentAs || getCustomElement(isDisabled, href, onClick),
121
+ as: getCustomElement(isDisabled, href, onClick),
125
122
  appearance: appearance,
126
123
  borderColor: borderColor,
127
124
  href: href,
@@ -90,15 +90,6 @@ 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
- * Replace the wrapper of the content element. This accepts the name of a html tag which will
95
- * be used to wrap the content element.
96
- */
97
- contentAs?: 'a' | 'button' | 'span';
98
- /**
99
- * Set the role of the container element
100
- */
101
- containerRole?: 'presentation' | 'img';
102
93
  /**
103
94
  * whether disable aria-labelledby for avatar img
104
95
  */
@@ -90,15 +90,6 @@ 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
- * Replace the wrapper of the content element. This accepts the name of a html tag which will
95
- * be used to wrap the content element.
96
- */
97
- contentAs?: 'a' | 'button' | 'span';
98
- /**
99
- * Set the role of the container element
100
- */
101
- containerRole?: 'presentation' | 'img';
102
93
  /**
103
94
  * whether disable aria-labelledby for avatar img
104
95
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar",
3
- "version": "25.3.1",
3
+ "version": "25.3.2",
4
4
  "description": "An avatar is a visual representation of a user or entity.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"