@atlaskit/user-picker 13.4.1 → 13.4.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 +11 -0
- package/dist/cjs/analytics.js +1 -1
- package/dist/cjs/components/Input.js +18 -0
- package/dist/es2019/analytics.js +1 -1
- package/dist/es2019/components/Input.js +18 -0
- package/dist/esm/analytics.js +1 -1
- package/dist/esm/components/Input.js +18 -0
- package/dist/types/components/Input.d.ts +2 -0
- package/package.json +8 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @atlaskit/user-picker
|
|
2
2
|
|
|
3
|
+
## 13.4.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`38ef9b4fcf137`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/38ef9b4fcf137) -
|
|
8
|
+
Behind gate `platform_user_picker_fix_redundant_labelledby`, stop promoting `aria-describedby` to
|
|
9
|
+
`aria-labelledby` on the user-picker input when an `aria-label` is present while still preserving
|
|
10
|
+
any explicit `aria-labelledby`, so screen readers announce the field's accessible name instead of
|
|
11
|
+
the description (A11Y-37267).
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
3
14
|
## 13.4.1
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/dist/cjs/analytics.js
CHANGED
|
@@ -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.
|
|
18
|
+
var packageVersion = "13.4.1";
|
|
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
|
}, {
|
package/dist/es2019/analytics.js
CHANGED
|
@@ -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.
|
|
9
|
+
const packageVersion = "13.4.1";
|
|
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() {
|
package/dist/esm/analytics.js
CHANGED
|
@@ -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.
|
|
12
|
+
var packageVersion = "13.4.1";
|
|
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
|
}, {
|
|
@@ -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.
|
|
3
|
+
"version": "13.4.2",
|
|
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.
|
|
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.
|
|
76
|
-
"@atlaskit/primitives": "^20.
|
|
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
80
|
"@atlaskit/tag": "^15.2.0",
|
|
81
81
|
"@atlaskit/teams-avatar": "^3.1.0",
|
|
82
|
-
"@atlaskit/tokens": "^15.
|
|
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
|
}
|