@atlaskit/user-picker 13.4.1 → 13.4.3

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,26 @@
1
1
  # @atlaskit/user-picker
2
2
 
3
+ ## 13.4.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`c259ffbd14ffc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c259ffbd14ffc) -
8
+ Migrate deprecated Lozenge appearance values to the new semantic appearances, and migrate
9
+ deprecated `SimpleTag`/`RemovableTag` to the default `Tag` export (SimpleTag with
10
+ `isRemovable={false}`).
11
+ - Updated dependencies
12
+
13
+ ## 13.4.2
14
+
15
+ ### Patch Changes
16
+
17
+ - [`38ef9b4fcf137`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/38ef9b4fcf137) -
18
+ Behind gate `platform_user_picker_fix_redundant_labelledby`, stop promoting `aria-describedby` to
19
+ `aria-labelledby` on the user-picker input when an `aria-label` is present while still preserving
20
+ any explicit `aria-labelledby`, so screen readers announce the field's accessible name instead of
21
+ the description (A11Y-37267).
22
+ - Updated dependencies
23
+
3
24
  ## 13.4.1
4
25
 
5
26
  ### Patch Changes
@@ -15,7 +15,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
15
15
  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; } // eslint-disable-next-line @typescript-eslint/consistent-type-imports
16
16
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
17
17
  var packageName = "@atlaskit/user-picker";
18
- var packageVersion = "13.4.0";
18
+ var packageVersion = "13.4.2";
19
19
  var UUID_REGEXP_TEAMS_GROUPS = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
20
20
  var UUID_REGEXP_OLD_AAID = /^[a-fA-F0-9]{1,8}:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
21
21
  var UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
@@ -16,6 +16,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
16
16
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
17
17
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
18
18
  var _react = _interopRequireDefault(require("react"));
19
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
19
20
  var _select = require("@atlaskit/select");
20
21
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
21
22
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
@@ -55,9 +56,26 @@ var Input = exports.Input = /*#__PURE__*/function (_React$Component) {
55
56
  * Placeholder and Input are linked not via label, aria-label or aria-labeledby, but through aria-describedby.
56
57
  * Basically in the getter we reassign Placeholder ID from aria-describedby to aria-labelledby
57
58
  * {@link https://github.com/JedWatson/react-select/issues/5651#issue-1731353197 GitHub}
59
+ *
60
+ * This reassignment should only apply when the input has no other accessible name.
58
61
  */
59
62
  function get() {
60
63
  var _this$props$ariaLabe;
64
+ if ((0, _platformFeatureFlags.fg)('platform_user_picker_fix_redundant_labelledby')) {
65
+ // A11Y-37267: An explicit aria-labelledby is a deliberate association with a visible label
66
+ // element and is the field's true accessible name (WCAG 2.5.3 Label in Name), so it always
67
+ // wins. Otherwise we promote aria-describedby -> aria-labelledby to work around
68
+ // react-select's placeholder linkage bug, but skip that promotion when the input already
69
+ // has an accessible name via aria-label so the description is announced via
70
+ // aria-describedby instead.
71
+ if (this.props['aria-labelledby']) {
72
+ return this.props['aria-labelledby'];
73
+ }
74
+ if (this.props['aria-label']) {
75
+ return undefined;
76
+ }
77
+ return this.props['aria-describedby'];
78
+ }
61
79
  return (_this$props$ariaLabe = this.props['aria-labelledby']) !== null && _this$props$ariaLabe !== void 0 ? _this$props$ariaLabe : this.props['aria-describedby'];
62
80
  }
63
81
  }, {
@@ -129,7 +129,7 @@ var MultiValue = exports.MultiValue = /*#__PURE__*/function (_React$Component) {
129
129
  return (0, _react2.jsx)(_primitives.Box, {
130
130
  xcss: archivedLozengeWrapper
131
131
  }, (0, _react2.jsx)(_lozenge.default, {
132
- appearance: "default"
132
+ appearance: "neutral"
133
133
  }, (0, _react2.jsx)(_reactIntl.FormattedMessage, _i18n.messages.archivedLozenge)));
134
134
  }
135
135
  return null;
@@ -267,7 +267,7 @@ var MultiValue = exports.MultiValue = /*#__PURE__*/function (_React$Component) {
267
267
  }), canShowArchivedLozenge ? (0, _react2.jsx)(_primitives.Box, {
268
268
  xcss: archivedLozengeWrapper
269
269
  }, (0, _react2.jsx)(_lozenge.default, {
270
- appearance: "default"
270
+ appearance: "neutral"
271
271
  }, (0, _react2.jsx)(_reactIntl.FormattedMessage, _i18n.messages.archivedLozenge))) : null) : (0, _react2.jsx)(_tag.AvatarTag, {
272
272
  type: "user",
273
273
  text: label,
@@ -72,6 +72,6 @@ var SingleValue = exports.SingleValue = function SingleValue(props) {
72
72
  }, label, /*#__PURE__*/React.createElement(ElementAfter, props), canShowArchivedLozenge ? /*#__PURE__*/React.createElement(_compiled.Box, {
73
73
  xcss: styles.archivedLozengeWrapper
74
74
  }, /*#__PURE__*/React.createElement(_lozenge.default, {
75
- appearance: "default"
75
+ appearance: "neutral"
76
76
  }, /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, _i18n.messages.archivedLozenge))) : null)))))) : null;
77
77
  };
@@ -6,7 +6,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
6
6
  import { v4 as uuidv4 } from 'uuid';
7
7
  import { isCustom, isExternalUser } from './components/utils';
8
8
  const packageName = "@atlaskit/user-picker";
9
- const packageVersion = "13.4.0";
9
+ const packageVersion = "13.4.2";
10
10
  const UUID_REGEXP_TEAMS_GROUPS = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
11
11
  const UUID_REGEXP_OLD_AAID = /^[a-fA-F0-9]{1,8}:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
12
12
  const UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
@@ -4,6 +4,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  import "./Input.compiled.css";
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  import React from 'react';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
7
8
  import { components } from '@atlaskit/select';
8
9
  const inputStyles = {
9
10
  root: "_5ce61rpy _1ir3kb7n _h5gq1rpy"
@@ -31,9 +32,26 @@ export class Input extends React.Component {
31
32
  * Placeholder and Input are linked not via label, aria-label or aria-labeledby, but through aria-describedby.
32
33
  * Basically in the getter we reassign Placeholder ID from aria-describedby to aria-labelledby
33
34
  * {@link https://github.com/JedWatson/react-select/issues/5651#issue-1731353197 GitHub}
35
+ *
36
+ * This reassignment should only apply when the input has no other accessible name.
34
37
  */
35
38
  get ariaLabelledBy() {
36
39
  var _this$props$ariaLabe;
40
+ if (fg('platform_user_picker_fix_redundant_labelledby')) {
41
+ // A11Y-37267: An explicit aria-labelledby is a deliberate association with a visible label
42
+ // element and is the field's true accessible name (WCAG 2.5.3 Label in Name), so it always
43
+ // wins. Otherwise we promote aria-describedby -> aria-labelledby to work around
44
+ // react-select's placeholder linkage bug, but skip that promotion when the input already
45
+ // has an accessible name via aria-label so the description is announced via
46
+ // aria-describedby instead.
47
+ if (this.props['aria-labelledby']) {
48
+ return this.props['aria-labelledby'];
49
+ }
50
+ if (this.props['aria-label']) {
51
+ return undefined;
52
+ }
53
+ return this.props['aria-describedby'];
54
+ }
37
55
  return (_this$props$ariaLabe = this.props['aria-labelledby']) !== null && _this$props$ariaLabe !== void 0 ? _this$props$ariaLabe : this.props['aria-describedby'];
38
56
  }
39
57
  get ariaDescribedBy() {
@@ -121,7 +121,7 @@ export class MultiValue extends React.Component {
121
121
  return jsx(Box, {
122
122
  xcss: archivedLozengeWrapper
123
123
  }, jsx(Lozenge, {
124
- appearance: "default"
124
+ appearance: "neutral"
125
125
  }, jsx(FormattedMessage, messages.archivedLozenge)));
126
126
  }
127
127
  return null;
@@ -261,7 +261,7 @@ export class MultiValue extends React.Component {
261
261
  }), canShowArchivedLozenge ? jsx(Box, {
262
262
  xcss: archivedLozengeWrapper
263
263
  }, jsx(Lozenge, {
264
- appearance: "default"
264
+ appearance: "neutral"
265
265
  }, jsx(FormattedMessage, messages.archivedLozenge))) : null) : jsx(AvatarTag, {
266
266
  type: "user",
267
267
  text: label,
@@ -72,6 +72,6 @@ export const SingleValue = props => {
72
72
  }, label, /*#__PURE__*/React.createElement(ElementAfter, props), canShowArchivedLozenge ? /*#__PURE__*/React.createElement(Box, {
73
73
  xcss: styles.archivedLozengeWrapper
74
74
  }, /*#__PURE__*/React.createElement(Lozenge, {
75
- appearance: "default"
75
+ appearance: "neutral"
76
76
  }, /*#__PURE__*/React.createElement(FormattedMessage, messages.archivedLozenge))) : null)))))) : null;
77
77
  };
@@ -9,7 +9,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
9
9
  import { v4 as uuidv4 } from 'uuid';
10
10
  import { isCustom, isExternalUser } from './components/utils';
11
11
  var packageName = "@atlaskit/user-picker";
12
- var packageVersion = "13.4.0";
12
+ var packageVersion = "13.4.2";
13
13
  var UUID_REGEXP_TEAMS_GROUPS = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
14
14
  var UUID_REGEXP_OLD_AAID = /^[a-fA-F0-9]{1,8}:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
15
15
  var UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
@@ -11,6 +11,7 @@ import { ax, ix } from "@compiled/react/runtime";
11
11
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
12
12
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
13
13
  import React from 'react';
14
+ import { fg } from '@atlaskit/platform-feature-flags';
14
15
  import { components } from '@atlaskit/select';
15
16
  var inputStyles = {
16
17
  root: "_5ce61rpy _1ir3kb7n _h5gq1rpy"
@@ -48,9 +49,26 @@ export var Input = /*#__PURE__*/function (_React$Component) {
48
49
  * Placeholder and Input are linked not via label, aria-label or aria-labeledby, but through aria-describedby.
49
50
  * Basically in the getter we reassign Placeholder ID from aria-describedby to aria-labelledby
50
51
  * {@link https://github.com/JedWatson/react-select/issues/5651#issue-1731353197 GitHub}
52
+ *
53
+ * This reassignment should only apply when the input has no other accessible name.
51
54
  */
52
55
  function get() {
53
56
  var _this$props$ariaLabe;
57
+ if (fg('platform_user_picker_fix_redundant_labelledby')) {
58
+ // A11Y-37267: An explicit aria-labelledby is a deliberate association with a visible label
59
+ // element and is the field's true accessible name (WCAG 2.5.3 Label in Name), so it always
60
+ // wins. Otherwise we promote aria-describedby -> aria-labelledby to work around
61
+ // react-select's placeholder linkage bug, but skip that promotion when the input already
62
+ // has an accessible name via aria-label so the description is announced via
63
+ // aria-describedby instead.
64
+ if (this.props['aria-labelledby']) {
65
+ return this.props['aria-labelledby'];
66
+ }
67
+ if (this.props['aria-label']) {
68
+ return undefined;
69
+ }
70
+ return this.props['aria-describedby'];
71
+ }
54
72
  return (_this$props$ariaLabe = this.props['aria-labelledby']) !== null && _this$props$ariaLabe !== void 0 ? _this$props$ariaLabe : this.props['aria-describedby'];
55
73
  }
56
74
  }, {
@@ -122,7 +122,7 @@ export var MultiValue = /*#__PURE__*/function (_React$Component) {
122
122
  return jsx(Box, {
123
123
  xcss: archivedLozengeWrapper
124
124
  }, jsx(Lozenge, {
125
- appearance: "default"
125
+ appearance: "neutral"
126
126
  }, jsx(FormattedMessage, messages.archivedLozenge)));
127
127
  }
128
128
  return null;
@@ -260,7 +260,7 @@ export var MultiValue = /*#__PURE__*/function (_React$Component) {
260
260
  }), canShowArchivedLozenge ? jsx(Box, {
261
261
  xcss: archivedLozengeWrapper
262
262
  }, jsx(Lozenge, {
263
- appearance: "default"
263
+ appearance: "neutral"
264
264
  }, jsx(FormattedMessage, messages.archivedLozenge))) : null) : jsx(AvatarTag, {
265
265
  type: "user",
266
266
  text: label,
@@ -63,6 +63,6 @@ export var SingleValue = function SingleValue(props) {
63
63
  }, label, /*#__PURE__*/React.createElement(ElementAfter, props), canShowArchivedLozenge ? /*#__PURE__*/React.createElement(Box, {
64
64
  xcss: styles.archivedLozengeWrapper
65
65
  }, /*#__PURE__*/React.createElement(Lozenge, {
66
- appearance: "default"
66
+ appearance: "neutral"
67
67
  }, /*#__PURE__*/React.createElement(FormattedMessage, messages.archivedLozenge))) : null)))))) : null;
68
68
  };
@@ -19,6 +19,8 @@ export declare class Input extends React.Component<Props & AriaAttributes> {
19
19
  * Placeholder and Input are linked not via label, aria-label or aria-labeledby, but through aria-describedby.
20
20
  * Basically in the getter we reassign Placeholder ID from aria-describedby to aria-labelledby
21
21
  * {@link https://github.com/JedWatson/react-select/issues/5651#issue-1731353197 GitHub}
22
+ *
23
+ * This reassignment should only apply when the input has no other accessible name.
22
24
  */
23
25
  get ariaLabelledBy(): AriaAttributesType;
24
26
  get ariaDescribedBy(): AriaAttributesType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "13.4.1",
3
+ "version": "13.4.3",
4
4
  "description": "Fabric component for display a dropdown to select a user from",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -64,7 +64,7 @@
64
64
  },
65
65
  "dependencies": {
66
66
  "@atlaskit/afm-i18n-platform-elements-user-picker": "2.168.0",
67
- "@atlaskit/analytics-next": "^12.2.0",
67
+ "@atlaskit/analytics-next": "^12.3.0",
68
68
  "@atlaskit/avatar": "^26.1.0",
69
69
  "@atlaskit/feature-gate-js-client": "^6.0.0",
70
70
  "@atlaskit/icon": "^37.0.0",
@@ -72,14 +72,14 @@
72
72
  "@atlaskit/lozenge": "^14.1.0",
73
73
  "@atlaskit/people-teams-ui-public": "^5.1.0",
74
74
  "@atlaskit/platform-feature-flags": "^2.0.0",
75
- "@atlaskit/popper": "^8.2.0",
76
- "@atlaskit/primitives": "^20.5.0",
75
+ "@atlaskit/popper": "^8.3.0",
76
+ "@atlaskit/primitives": "^20.6.0",
77
77
  "@atlaskit/react-compiler-gating": "^0.2.0",
78
78
  "@atlaskit/select": "^22.5.0",
79
79
  "@atlaskit/spinner": "^20.1.0",
80
- "@atlaskit/tag": "^15.2.0",
80
+ "@atlaskit/tag": "^15.3.0",
81
81
  "@atlaskit/teams-avatar": "^3.1.0",
82
- "@atlaskit/tokens": "^15.5.0",
82
+ "@atlaskit/tokens": "^15.8.0",
83
83
  "@atlaskit/tooltip": "^23.1.0",
84
84
  "@atlaskit/ufo": "^1.0.0",
85
85
  "@babel/runtime": "^7.0.0",
@@ -126,6 +126,9 @@
126
126
  },
127
127
  "jsm-wfo-assignee-recommendation-on-queues": {
128
128
  "type": "boolean"
129
+ },
130
+ "platform_user_picker_fix_redundant_labelledby": {
131
+ "type": "boolean"
129
132
  }
130
133
  }
131
134
  }