@atlaskit/avatar 21.15.0 → 21.15.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,19 @@
1
1
  # @atlaskit/avatar
2
2
 
3
+ ## 21.15.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 21.15.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#135555](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/135555)
14
+ [`6325e9c5617d5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6325e9c5617d5) -
15
+ Use a ID generator that is compatible with React16 and React 18
16
+
3
17
  ## 21.15.0
4
18
 
5
19
  ### Minor Changes
@@ -9,8 +9,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
9
9
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
10
10
  var _react = require("react");
11
11
  var _react2 = require("@emotion/react");
12
- var _reactUid = require("react-uid");
13
12
  var _analyticsNext = require("@atlaskit/analytics-next");
13
+ var _reactUid = require("@atlaskit/ds-lib/react-uid");
14
14
  var _focusRing = _interopRequireDefault(require("@atlaskit/focus-ring"));
15
15
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
16
  var _colors = require("@atlaskit/theme/colors");
@@ -30,7 +30,7 @@ var _templateObject;
30
30
  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; }
31
31
  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; }
32
32
  var packageName = "@atlaskit/avatar";
33
- var packageVersion = "21.15.0";
33
+ var packageVersion = "21.15.2";
34
34
  var getTestId = function getTestId(testId, children) {
35
35
  return !children ? {
36
36
  'data-testid': "".concat(testId, "--inner")
@@ -93,7 +93,7 @@ var Avatar = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
93
93
  var customStatusNode = /*#__PURE__*/(0, _react.isValidElement)(status) ? status : null;
94
94
  var isValidIconSize = size !== 'xxlarge' && size !== 'xsmall';
95
95
  var lastAnalytics = (0, _react.useRef)(analyticsContext);
96
- var uuid = (0, _reactUid.useUIDSeed)()('avatar');
96
+ var labelId = (0, _reactUid.useId)();
97
97
  (0, _react.useEffect)(function () {
98
98
  lastAnalytics.current = analyticsContext;
99
99
  }, [analyticsContext]);
@@ -154,7 +154,7 @@ var Avatar = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
154
154
  return (0, _react2.jsx)(AvatarContainer, {
155
155
  "data-testid": testId,
156
156
  role: containerShouldBeImage ? 'img' : undefined,
157
- "aria-labelledby": containerShouldBeImage ? "".concat(uuid, "-label") : undefined,
157
+ "aria-labelledby": containerShouldBeImage ? labelId : undefined,
158
158
  style: {
159
159
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
160
160
  display: 'inline-block',
@@ -180,7 +180,7 @@ var Avatar = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
180
180
  'aria-label': label || defaultLabel
181
181
  }), {}, {
182
182
  children: (0, _react2.jsx)(_AvatarImage.default
183
- // Only pass in the name if an image is provded and the
183
+ // Only pass in the name if an image is provided and the
184
184
  // container is not being used as an `img` role
185
185
  , {
186
186
  alt: !containerShouldBeImage && src ? name : undefined,
@@ -209,7 +209,7 @@ var Avatar = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
209
209
  testId: testId
210
210
  }, customStatusNode), containerShouldBeImage ? (0, _react2.jsx)("span", {
211
211
  "data-testid": testId && "".concat(testId, "--label"),
212
- id: "".concat(uuid, "-label"),
212
+ id: labelId,
213
213
  hidden: true
214
214
  }, defaultLabel) : undefined);
215
215
  });
@@ -11,7 +11,7 @@ var _colors = require("@atlaskit/theme/colors");
11
11
  var _constants = require("./constants");
12
12
  var _IconWrapper = _interopRequireDefault(require("./IconWrapper"));
13
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
14
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
15
  // eslint-disable-next-line @repo/internal/fs/filename-pattern-match
16
16
 
17
17
  var BusyIndicator = /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("circle", {
@@ -11,7 +11,7 @@ var _colors = require("@atlaskit/theme/colors");
11
11
  var _constants = require("./constants");
12
12
  var _IconWrapper = _interopRequireDefault(require("./IconWrapper"));
13
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
14
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
15
  // eslint-disable-next-line @repo/internal/fs/filename-pattern-match
16
16
 
17
17
  var ApprovedIndicator = /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("circle", {
@@ -7,8 +7,8 @@ import { createElement, forwardRef, isValidElement, useCallback, useEffect, useR
7
7
 
8
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
9
  import { ClassNames, jsx } from '@emotion/react';
10
- import { useUIDSeed } from 'react-uid';
11
10
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
11
+ import { useId } from '@atlaskit/ds-lib/react-uid';
12
12
  import FocusRing from '@atlaskit/focus-ring';
13
13
  import { fg } from '@atlaskit/platform-feature-flags';
14
14
  import { N0, N70A } from '@atlaskit/theme/colors';
@@ -19,7 +19,7 @@ import { PresenceWrapper } from './Presence';
19
19
  import { StatusWrapper } from './Status';
20
20
  import { getButtonProps, getCustomElement, getLinkProps } from './utilities';
21
21
  const packageName = "@atlaskit/avatar";
22
- const packageVersion = "21.15.0";
22
+ const packageVersion = "21.15.2";
23
23
  const getTestId = (testId, children) => !children ? {
24
24
  'data-testid': `${testId}--inner`
25
25
  } : {
@@ -164,7 +164,7 @@ const Avatar = /*#__PURE__*/forwardRef(({
164
164
  const customStatusNode = /*#__PURE__*/isValidElement(status) ? status : null;
165
165
  const isValidIconSize = size !== 'xxlarge' && size !== 'xsmall';
166
166
  const lastAnalytics = useRef(analyticsContext);
167
- const uuid = useUIDSeed()('avatar');
167
+ const labelId = useId();
168
168
  useEffect(() => {
169
169
  lastAnalytics.current = analyticsContext;
170
170
  }, [analyticsContext]);
@@ -229,7 +229,7 @@ const Avatar = /*#__PURE__*/forwardRef(({
229
229
  return jsx(AvatarContainer, {
230
230
  "data-testid": testId,
231
231
  role: containerShouldBeImage ? 'img' : undefined,
232
- "aria-labelledby": containerShouldBeImage ? `${uuid}-label` : undefined,
232
+ "aria-labelledby": containerShouldBeImage ? labelId : undefined,
233
233
  style: {
234
234
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
235
235
  display: 'inline-block',
@@ -258,7 +258,7 @@ const Avatar = /*#__PURE__*/forwardRef(({
258
258
  'aria-label': label || defaultLabel
259
259
  }),
260
260
  children: jsx(AvatarImage
261
- // Only pass in the name if an image is provded and the
261
+ // Only pass in the name if an image is provided and the
262
262
  // container is not being used as an `img` role
263
263
  , {
264
264
  alt: !containerShouldBeImage && src ? name : undefined,
@@ -287,7 +287,7 @@ const Avatar = /*#__PURE__*/forwardRef(({
287
287
  testId: testId
288
288
  }, customStatusNode), containerShouldBeImage ? jsx("span", {
289
289
  "data-testid": testId && `${testId}--label`,
290
- id: `${uuid}-label`,
290
+ id: labelId,
291
291
  hidden: true
292
292
  }, defaultLabel) : undefined);
293
293
  });
@@ -12,8 +12,8 @@ import { createElement, forwardRef, isValidElement, useCallback, useEffect, useR
12
12
 
13
13
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
14
14
  import { ClassNames, jsx } from '@emotion/react';
15
- import { useUIDSeed } from 'react-uid';
16
15
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
16
+ import { useId } from '@atlaskit/ds-lib/react-uid';
17
17
  import FocusRing from '@atlaskit/focus-ring';
18
18
  import { fg } from '@atlaskit/platform-feature-flags';
19
19
  import { N0, N70A } from '@atlaskit/theme/colors';
@@ -24,7 +24,7 @@ import { PresenceWrapper } from './Presence';
24
24
  import { StatusWrapper } from './Status';
25
25
  import { getButtonProps, getCustomElement, getLinkProps } from './utilities';
26
26
  var packageName = "@atlaskit/avatar";
27
- var packageVersion = "21.15.0";
27
+ var packageVersion = "21.15.2";
28
28
  var getTestId = function getTestId(testId, children) {
29
29
  return !children ? {
30
30
  'data-testid': "".concat(testId, "--inner")
@@ -87,7 +87,7 @@ var Avatar = /*#__PURE__*/forwardRef(function (_ref2, ref) {
87
87
  var customStatusNode = /*#__PURE__*/isValidElement(status) ? status : null;
88
88
  var isValidIconSize = size !== 'xxlarge' && size !== 'xsmall';
89
89
  var lastAnalytics = useRef(analyticsContext);
90
- var uuid = useUIDSeed()('avatar');
90
+ var labelId = useId();
91
91
  useEffect(function () {
92
92
  lastAnalytics.current = analyticsContext;
93
93
  }, [analyticsContext]);
@@ -148,7 +148,7 @@ var Avatar = /*#__PURE__*/forwardRef(function (_ref2, ref) {
148
148
  return jsx(AvatarContainer, {
149
149
  "data-testid": testId,
150
150
  role: containerShouldBeImage ? 'img' : undefined,
151
- "aria-labelledby": containerShouldBeImage ? "".concat(uuid, "-label") : undefined,
151
+ "aria-labelledby": containerShouldBeImage ? labelId : undefined,
152
152
  style: {
153
153
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
154
154
  display: 'inline-block',
@@ -174,7 +174,7 @@ var Avatar = /*#__PURE__*/forwardRef(function (_ref2, ref) {
174
174
  'aria-label': label || defaultLabel
175
175
  }), {}, {
176
176
  children: jsx(AvatarImage
177
- // Only pass in the name if an image is provded and the
177
+ // Only pass in the name if an image is provided and the
178
178
  // container is not being used as an `img` role
179
179
  , {
180
180
  alt: !containerShouldBeImage && src ? name : undefined,
@@ -203,7 +203,7 @@ var Avatar = /*#__PURE__*/forwardRef(function (_ref2, ref) {
203
203
  testId: testId
204
204
  }, customStatusNode), containerShouldBeImage ? jsx("span", {
205
205
  "data-testid": testId && "".concat(testId, "--label"),
206
- id: "".concat(uuid, "-label"),
206
+ id: labelId,
207
207
  hidden: true
208
208
  }, defaultLabel) : undefined);
209
209
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar",
3
- "version": "21.15.0",
3
+ "version": "21.15.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/"
@@ -24,10 +24,6 @@
24
24
  "atlaskit:src": "src/index.ts",
25
25
  "atlassian": {
26
26
  "team": "Design System Team",
27
- "releaseModel": "continuous",
28
- "productPushConsumption": [
29
- "jira"
30
- ],
31
27
  "website": {
32
28
  "name": "Avatar",
33
29
  "category": "Components"
@@ -45,16 +41,16 @@
45
41
  },
46
42
  "dependencies": {
47
43
  "@atlaskit/analytics-next": "^10.1.0",
44
+ "@atlaskit/ds-lib": "^2.6.0",
48
45
  "@atlaskit/focus-ring": "^1.6.0",
49
- "@atlaskit/icon": "^22.12.0",
46
+ "@atlaskit/icon": "^22.18.0",
50
47
  "@atlaskit/platform-feature-flags": "^0.3.0",
51
- "@atlaskit/primitives": "^12.0.0",
48
+ "@atlaskit/primitives": "^12.2.0",
52
49
  "@atlaskit/theme": "^13.0.0",
53
- "@atlaskit/tokens": "^1.58.0",
50
+ "@atlaskit/tokens": "^2.0.0",
54
51
  "@babel/runtime": "^7.0.0",
55
52
  "@emotion/react": "^11.7.1",
56
- "@emotion/serialize": "^1.1.0",
57
- "react-uid": "^2.2.0"
53
+ "@emotion/serialize": "^1.1.0"
58
54
  },
59
55
  "peerDependencies": {
60
56
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
@@ -62,7 +58,6 @@
62
58
  "devDependencies": {
63
59
  "@af/accessibility-testing": "*",
64
60
  "@af/visual-regression": "*",
65
- "@atlaskit/ds-lib": "^2.4.0",
66
61
  "@atlaskit/ssr": "*",
67
62
  "@atlaskit/textfield": "^6.5.0",
68
63
  "@atlaskit/tooltip": "^18.7.0",