@atlaskit/user-picker 10.2.3 → 10.2.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 +6 -0
- package/dist/cjs/components/Input.js +23 -0
- package/dist/cjs/i18n/en_ZZ.js +2 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/Input.js +18 -0
- package/dist/es2019/i18n/en_ZZ.js +2 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/Input.js +23 -0
- package/dist/esm/i18n/en_ZZ.js +2 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/components/Input.d.ts +16 -5
- package/dist/types/components/PopupInput.d.ts +1 -6
- package/dist/types/i18n/en_ZZ.d.ts +1 -0
- package/dist/types/types.d.ts +2 -1
- package/dist/types-ts4.5/components/Input.d.ts +16 -5
- package/dist/types-ts4.5/components/PopupInput.d.ts +1 -6
- package/dist/types-ts4.5/i18n/en_ZZ.d.ts +1 -0
- package/dist/types-ts4.5/types.d.ts +2 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/user-picker
|
|
2
2
|
|
|
3
|
+
## 10.2.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`17aec239f54`](https://bitbucket.org/atlassian/atlassian-frontend/commits/17aec239f54) - [ux] aria-describedby and aria-labelledby proper association in between input and placeholder
|
|
8
|
+
|
|
3
9
|
## 10.2.3
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -41,9 +41,32 @@ var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
41
41
|
return _this;
|
|
42
42
|
}
|
|
43
43
|
(0, _createClass2.default)(Input, [{
|
|
44
|
+
key: "ariaLabelledBy",
|
|
45
|
+
get:
|
|
46
|
+
/**
|
|
47
|
+
* Overrides the default behaviour of react-select lib
|
|
48
|
+
*
|
|
49
|
+
* The getter is a workaround for original behaviour of the react-select lib.
|
|
50
|
+
* Placeholder and Input are linked not via label, aria-label or aria-labeledby, but through aria-describedby.
|
|
51
|
+
* Basically in the getter we reassign Placeholder ID from aria-describedby to aria-labelledby
|
|
52
|
+
* {@link https://github.com/JedWatson/react-select/issues/5651#issue-1731353197 GitHub}
|
|
53
|
+
*/
|
|
54
|
+
function get() {
|
|
55
|
+
var _this$props$ariaDesc;
|
|
56
|
+
return (_this$props$ariaDesc = this.props['aria-describedby']) !== null && _this$props$ariaDesc !== void 0 ? _this$props$ariaDesc : this.props['aria-labelledby'];
|
|
57
|
+
}
|
|
58
|
+
}, {
|
|
59
|
+
key: "ariaDescribedBy",
|
|
60
|
+
get: function get() {
|
|
61
|
+
var _this$props$selectPro2, _this$props$selectPro3;
|
|
62
|
+
return (_this$props$selectPro2 = (_this$props$selectPro3 = this.props.selectProps) === null || _this$props$selectPro3 === void 0 ? void 0 : _this$props$selectPro3['aria-describedby']) !== null && _this$props$selectPro2 !== void 0 ? _this$props$selectPro2 : this.props['aria-describedby'];
|
|
63
|
+
}
|
|
64
|
+
}, {
|
|
44
65
|
key: "render",
|
|
45
66
|
value: function render() {
|
|
46
67
|
return /*#__PURE__*/_react.default.createElement(_select.components.Input, (0, _extends2.default)({}, this.props, {
|
|
68
|
+
"aria-labelledby": this.ariaLabelledBy,
|
|
69
|
+
"aria-describedby": this.ariaDescribedBy,
|
|
47
70
|
innerRef: this.props.innerRef,
|
|
48
71
|
onKeyPress: this.handleKeyPress
|
|
49
72
|
}));
|
package/dist/cjs/i18n/en_ZZ.js
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
/* prettier-ignore */
|
|
7
8
|
/**
|
|
8
9
|
* NOTE:
|
|
9
10
|
*
|
|
@@ -15,6 +16,7 @@ var _default = {
|
|
|
15
16
|
'fabric.elements.user-picker.email.add': 'Add user',
|
|
16
17
|
'fabric.elements.user-picker.email.add.potential': 'Enter an email address',
|
|
17
18
|
'fabric.elements.user-picker.email.select.to.add': 'Select an email address',
|
|
19
|
+
'fabric.elements.user-picker.error.message': 'Something went wrong',
|
|
18
20
|
'fabric.elements.user-picker.external.sourced.error': "We can't connect you right now.",
|
|
19
21
|
'fabric.elements.user-picker.external.sourced.from': 'Found in:',
|
|
20
22
|
'fabric.elements.user-picker.github.provider': 'GitHub',
|
package/dist/cjs/version.json
CHANGED
|
@@ -17,8 +17,26 @@ export class Input extends React.Component {
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Overrides the default behaviour of react-select lib
|
|
22
|
+
*
|
|
23
|
+
* The getter is a workaround for original behaviour of the react-select lib.
|
|
24
|
+
* Placeholder and Input are linked not via label, aria-label or aria-labeledby, but through aria-describedby.
|
|
25
|
+
* Basically in the getter we reassign Placeholder ID from aria-describedby to aria-labelledby
|
|
26
|
+
* {@link https://github.com/JedWatson/react-select/issues/5651#issue-1731353197 GitHub}
|
|
27
|
+
*/
|
|
28
|
+
get ariaLabelledBy() {
|
|
29
|
+
var _this$props$ariaDesc;
|
|
30
|
+
return (_this$props$ariaDesc = this.props['aria-describedby']) !== null && _this$props$ariaDesc !== void 0 ? _this$props$ariaDesc : this.props['aria-labelledby'];
|
|
31
|
+
}
|
|
32
|
+
get ariaDescribedBy() {
|
|
33
|
+
var _this$props$selectPro2, _this$props$selectPro3;
|
|
34
|
+
return (_this$props$selectPro2 = (_this$props$selectPro3 = this.props.selectProps) === null || _this$props$selectPro3 === void 0 ? void 0 : _this$props$selectPro3['aria-describedby']) !== null && _this$props$selectPro2 !== void 0 ? _this$props$selectPro2 : this.props['aria-describedby'];
|
|
35
|
+
}
|
|
20
36
|
render() {
|
|
21
37
|
return /*#__PURE__*/React.createElement(components.Input, _extends({}, this.props, {
|
|
38
|
+
"aria-labelledby": this.ariaLabelledBy,
|
|
39
|
+
"aria-describedby": this.ariaDescribedBy,
|
|
22
40
|
innerRef: this.props.innerRef,
|
|
23
41
|
onKeyPress: this.handleKeyPress
|
|
24
42
|
}));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* prettier-ignore */
|
|
1
2
|
/**
|
|
2
3
|
* NOTE:
|
|
3
4
|
*
|
|
@@ -9,6 +10,7 @@ export default {
|
|
|
9
10
|
'fabric.elements.user-picker.email.add': 'Add user',
|
|
10
11
|
'fabric.elements.user-picker.email.add.potential': 'Enter an email address',
|
|
11
12
|
'fabric.elements.user-picker.email.select.to.add': 'Select an email address',
|
|
13
|
+
'fabric.elements.user-picker.error.message': 'Something went wrong',
|
|
12
14
|
'fabric.elements.user-picker.external.sourced.error': "We can't connect you right now.",
|
|
13
15
|
'fabric.elements.user-picker.external.sourced.from': 'Found in:',
|
|
14
16
|
'fabric.elements.user-picker.github.provider': 'GitHub',
|
package/dist/es2019/version.json
CHANGED
|
@@ -34,9 +34,32 @@ export var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
34
34
|
return _this;
|
|
35
35
|
}
|
|
36
36
|
_createClass(Input, [{
|
|
37
|
+
key: "ariaLabelledBy",
|
|
38
|
+
get:
|
|
39
|
+
/**
|
|
40
|
+
* Overrides the default behaviour of react-select lib
|
|
41
|
+
*
|
|
42
|
+
* The getter is a workaround for original behaviour of the react-select lib.
|
|
43
|
+
* Placeholder and Input are linked not via label, aria-label or aria-labeledby, but through aria-describedby.
|
|
44
|
+
* Basically in the getter we reassign Placeholder ID from aria-describedby to aria-labelledby
|
|
45
|
+
* {@link https://github.com/JedWatson/react-select/issues/5651#issue-1731353197 GitHub}
|
|
46
|
+
*/
|
|
47
|
+
function get() {
|
|
48
|
+
var _this$props$ariaDesc;
|
|
49
|
+
return (_this$props$ariaDesc = this.props['aria-describedby']) !== null && _this$props$ariaDesc !== void 0 ? _this$props$ariaDesc : this.props['aria-labelledby'];
|
|
50
|
+
}
|
|
51
|
+
}, {
|
|
52
|
+
key: "ariaDescribedBy",
|
|
53
|
+
get: function get() {
|
|
54
|
+
var _this$props$selectPro2, _this$props$selectPro3;
|
|
55
|
+
return (_this$props$selectPro2 = (_this$props$selectPro3 = this.props.selectProps) === null || _this$props$selectPro3 === void 0 ? void 0 : _this$props$selectPro3['aria-describedby']) !== null && _this$props$selectPro2 !== void 0 ? _this$props$selectPro2 : this.props['aria-describedby'];
|
|
56
|
+
}
|
|
57
|
+
}, {
|
|
37
58
|
key: "render",
|
|
38
59
|
value: function render() {
|
|
39
60
|
return /*#__PURE__*/React.createElement(components.Input, _extends({}, this.props, {
|
|
61
|
+
"aria-labelledby": this.ariaLabelledBy,
|
|
62
|
+
"aria-describedby": this.ariaDescribedBy,
|
|
40
63
|
innerRef: this.props.innerRef,
|
|
41
64
|
onKeyPress: this.handleKeyPress
|
|
42
65
|
}));
|
package/dist/esm/i18n/en_ZZ.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* prettier-ignore */
|
|
1
2
|
/**
|
|
2
3
|
* NOTE:
|
|
3
4
|
*
|
|
@@ -9,6 +10,7 @@ export default {
|
|
|
9
10
|
'fabric.elements.user-picker.email.add': 'Add user',
|
|
10
11
|
'fabric.elements.user-picker.email.add.potential': 'Enter an email address',
|
|
11
12
|
'fabric.elements.user-picker.email.select.to.add': 'Select an email address',
|
|
13
|
+
'fabric.elements.user-picker.error.message': 'Something went wrong',
|
|
12
14
|
'fabric.elements.user-picker.external.sourced.error': "We can't connect you right now.",
|
|
13
15
|
'fabric.elements.user-picker.external.sourced.from': 'Found in:',
|
|
14
16
|
'fabric.elements.user-picker.github.provider': 'GitHub',
|
package/dist/esm/version.json
CHANGED
|
@@ -1,11 +1,22 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { type AriaAttributes } from 'react';
|
|
2
|
+
import { type OptionType, type SelectProps } from '@atlaskit/select';
|
|
3
|
+
import { AriaAttributesType } from '../types';
|
|
2
4
|
export type Props = {
|
|
3
|
-
selectProps?:
|
|
4
|
-
disableInput?: boolean;
|
|
5
|
-
};
|
|
5
|
+
selectProps?: SelectProps<OptionType, boolean>;
|
|
6
6
|
innerRef: (ref: React.Ref<HTMLInputElement>) => void;
|
|
7
|
+
ariaDescribedBy?: AriaAttributesType;
|
|
7
8
|
};
|
|
8
|
-
export declare class Input extends React.Component<Props> {
|
|
9
|
+
export declare class Input extends React.Component<Props & AriaAttributes> {
|
|
9
10
|
handleKeyPress: (e: KeyboardEvent) => void;
|
|
11
|
+
/**
|
|
12
|
+
* Overrides the default behaviour of react-select lib
|
|
13
|
+
*
|
|
14
|
+
* The getter is a workaround for original behaviour of the react-select lib.
|
|
15
|
+
* Placeholder and Input are linked not via label, aria-label or aria-labeledby, but through aria-describedby.
|
|
16
|
+
* Basically in the getter we reassign Placeholder ID from aria-describedby to aria-labelledby
|
|
17
|
+
* {@link https://github.com/JedWatson/react-select/issues/5651#issue-1731353197 GitHub}
|
|
18
|
+
*/
|
|
19
|
+
get ariaLabelledBy(): AriaAttributesType;
|
|
20
|
+
get ariaDescribedBy(): AriaAttributesType;
|
|
10
21
|
render(): JSX.Element;
|
|
11
22
|
}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
selectProps: {
|
|
4
|
-
disableInput?: boolean;
|
|
5
|
-
};
|
|
6
|
-
innerRef: (ref: React.Ref<HTMLInputElement>) => void;
|
|
7
|
-
};
|
|
2
|
+
import { type Props } from './Input';
|
|
8
3
|
export declare class PopupInput extends React.Component<Props> {
|
|
9
4
|
private ref;
|
|
10
5
|
componentDidMount(): void;
|
|
@@ -8,6 +8,7 @@ declare const _default: {
|
|
|
8
8
|
'fabric.elements.user-picker.email.add': string;
|
|
9
9
|
'fabric.elements.user-picker.email.add.potential': string;
|
|
10
10
|
'fabric.elements.user-picker.email.select.to.add': string;
|
|
11
|
+
'fabric.elements.user-picker.error.message': string;
|
|
11
12
|
'fabric.elements.user-picker.external.sourced.error': string;
|
|
12
13
|
'fabric.elements.user-picker.external.sourced.from': string;
|
|
13
14
|
'fabric.elements.user-picker.github.provider': string;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
1
|
+
import React, { type AriaAttributes, ReactNode } from 'react';
|
|
2
2
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
3
|
import { Placement } from '@atlaskit/popper';
|
|
4
4
|
import { EmailValidator } from './components/emailValidation';
|
|
@@ -176,6 +176,7 @@ export type PopupUserPickerProps = UserPickerProps & {
|
|
|
176
176
|
*/
|
|
177
177
|
shouldFlip?: boolean;
|
|
178
178
|
};
|
|
179
|
+
export type AriaAttributesType = AriaAttributes['aria-labelledby'] | AriaAttributes['aria-describedby'];
|
|
179
180
|
export type BoundariesElement = 'scrollParent' | 'window' | 'viewport' | HTMLElement;
|
|
180
181
|
export type RootBoundary = 'viewport' | 'document';
|
|
181
182
|
export type UserPickerState = {
|
|
@@ -1,11 +1,22 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { type AriaAttributes } from 'react';
|
|
2
|
+
import { type OptionType, type SelectProps } from '@atlaskit/select';
|
|
3
|
+
import { AriaAttributesType } from '../types';
|
|
2
4
|
export type Props = {
|
|
3
|
-
selectProps?:
|
|
4
|
-
disableInput?: boolean;
|
|
5
|
-
};
|
|
5
|
+
selectProps?: SelectProps<OptionType, boolean>;
|
|
6
6
|
innerRef: (ref: React.Ref<HTMLInputElement>) => void;
|
|
7
|
+
ariaDescribedBy?: AriaAttributesType;
|
|
7
8
|
};
|
|
8
|
-
export declare class Input extends React.Component<Props> {
|
|
9
|
+
export declare class Input extends React.Component<Props & AriaAttributes> {
|
|
9
10
|
handleKeyPress: (e: KeyboardEvent) => void;
|
|
11
|
+
/**
|
|
12
|
+
* Overrides the default behaviour of react-select lib
|
|
13
|
+
*
|
|
14
|
+
* The getter is a workaround for original behaviour of the react-select lib.
|
|
15
|
+
* Placeholder and Input are linked not via label, aria-label or aria-labeledby, but through aria-describedby.
|
|
16
|
+
* Basically in the getter we reassign Placeholder ID from aria-describedby to aria-labelledby
|
|
17
|
+
* {@link https://github.com/JedWatson/react-select/issues/5651#issue-1731353197 GitHub}
|
|
18
|
+
*/
|
|
19
|
+
get ariaLabelledBy(): AriaAttributesType;
|
|
20
|
+
get ariaDescribedBy(): AriaAttributesType;
|
|
10
21
|
render(): JSX.Element;
|
|
11
22
|
}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
selectProps: {
|
|
4
|
-
disableInput?: boolean;
|
|
5
|
-
};
|
|
6
|
-
innerRef: (ref: React.Ref<HTMLInputElement>) => void;
|
|
7
|
-
};
|
|
2
|
+
import { type Props } from './Input';
|
|
8
3
|
export declare class PopupInput extends React.Component<Props> {
|
|
9
4
|
private ref;
|
|
10
5
|
componentDidMount(): void;
|
|
@@ -8,6 +8,7 @@ declare const _default: {
|
|
|
8
8
|
'fabric.elements.user-picker.email.add': string;
|
|
9
9
|
'fabric.elements.user-picker.email.add.potential': string;
|
|
10
10
|
'fabric.elements.user-picker.email.select.to.add': string;
|
|
11
|
+
'fabric.elements.user-picker.error.message': string;
|
|
11
12
|
'fabric.elements.user-picker.external.sourced.error': string;
|
|
12
13
|
'fabric.elements.user-picker.external.sourced.from': string;
|
|
13
14
|
'fabric.elements.user-picker.github.provider': string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
1
|
+
import React, { type AriaAttributes, ReactNode } from 'react';
|
|
2
2
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
3
|
import { Placement } from '@atlaskit/popper';
|
|
4
4
|
import { EmailValidator } from './components/emailValidation';
|
|
@@ -179,6 +179,7 @@ export type PopupUserPickerProps = UserPickerProps & {
|
|
|
179
179
|
*/
|
|
180
180
|
shouldFlip?: boolean;
|
|
181
181
|
};
|
|
182
|
+
export type AriaAttributesType = AriaAttributes['aria-labelledby'] | AriaAttributes['aria-describedby'];
|
|
182
183
|
export type BoundariesElement = 'scrollParent' | 'window' | 'viewport' | HTMLElement;
|
|
183
184
|
export type RootBoundary = 'viewport' | 'document';
|
|
184
185
|
export type UserPickerState = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/user-picker",
|
|
3
|
-
"version": "10.2.
|
|
3
|
+
"version": "10.2.4",
|
|
4
4
|
"description": "Fabric component for display a dropdown to select a user from",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"@atlaskit/logo": "^13.14.0",
|
|
41
41
|
"@atlaskit/lozenge": "^11.4.0",
|
|
42
42
|
"@atlaskit/popper": "^5.5.0",
|
|
43
|
-
"@atlaskit/select": "^16.
|
|
43
|
+
"@atlaskit/select": "^16.5.0",
|
|
44
44
|
"@atlaskit/spinner": "^15.5.0",
|
|
45
45
|
"@atlaskit/theme": "^12.5.0",
|
|
46
|
-
"@atlaskit/tokens": "^1.
|
|
46
|
+
"@atlaskit/tokens": "^1.5.0",
|
|
47
47
|
"@atlaskit/tooltip": "^17.8.0",
|
|
48
48
|
"@atlaskit/ufo": "^0.2.0",
|
|
49
49
|
"@babel/runtime": "^7.0.0",
|
|
@@ -63,10 +63,10 @@
|
|
|
63
63
|
"@atlaskit/docs": "*",
|
|
64
64
|
"@atlaskit/elements-test-helpers": "^0.7.0",
|
|
65
65
|
"@atlaskit/modal-dialog": "^12.5.0",
|
|
66
|
-
"@atlaskit/radio": "^5.
|
|
66
|
+
"@atlaskit/radio": "^5.6.0",
|
|
67
67
|
"@atlaskit/range": "^7.1.0",
|
|
68
68
|
"@atlaskit/section-message": "^6.4.0",
|
|
69
|
-
"@atlaskit/textfield": "^5.
|
|
69
|
+
"@atlaskit/textfield": "^5.5.0",
|
|
70
70
|
"@atlaskit/util-data-test": "^17.8.0",
|
|
71
71
|
"@atlaskit/visual-regression": "*",
|
|
72
72
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|