@atlaskit/select 17.0.4 → 17.0.5

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,11 @@
1
1
  # @atlaskit/select
2
2
 
3
+ ## 17.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#69863](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69863) [`6c9b587369cf`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6c9b587369cf) - Support to add additional aria-describedby on select when isSearchable is false
8
+
3
9
  ## 17.0.4
4
10
 
5
11
  ### Patch Changes
@@ -9,7 +9,7 @@ var _reactSelect = _interopRequireDefault(require("react-select"));
9
9
  var _analyticsNext = require("@atlaskit/analytics-next");
10
10
  var _createSelect = _interopRequireDefault(require("./createSelect"));
11
11
  var packageName = "@atlaskit/select";
12
- var packageVersion = "17.0.4";
12
+ var packageVersion = "17.0.5";
13
13
  var SelectWithoutAnalytics = exports.SelectWithoutAnalytics = (0, _createSelect.default)(_reactSelect.default);
14
14
  var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
15
15
  var _default = exports.default = (0, _analyticsNext.withAnalyticsContext)({
@@ -76,6 +76,21 @@ function createSelect(WrappedComponent) {
76
76
  this.select.blur();
77
77
  }
78
78
  }
79
+ }, {
80
+ key: "componentDidMount",
81
+ value: function componentDidMount() {
82
+ var descriptionId = this.props['aria-describedby'];
83
+ if (!this.props.isSearchable && descriptionId) {
84
+ var _this$select;
85
+ // when isSearchable is false, react-select will create its own dummy input instead of using ours,
86
+ // so we need to manually add the additional aria-describedby using ref.
87
+ var input = (_this$select = this.select) === null || _this$select === void 0 ? void 0 : _this$select.inputRef;
88
+ var ariaDescribedby = input === null || input === void 0 ? void 0 : input.getAttribute('aria-describedby');
89
+ if (!(ariaDescribedby !== null && ariaDescribedby !== void 0 && ariaDescribedby.includes(descriptionId))) {
90
+ input === null || input === void 0 || input.setAttribute('aria-describedby', "".concat(ariaDescribedby, " ").concat(descriptionId));
91
+ }
92
+ }
93
+ }
79
94
  }, {
80
95
  key: "render",
81
96
  value: function render() {
@@ -2,7 +2,7 @@ import Select from 'react-select';
2
2
  import { withAnalyticsEvents, withAnalyticsContext, createAndFireEvent } from '@atlaskit/analytics-next';
3
3
  import createSelect from './createSelect';
4
4
  const packageName = "@atlaskit/select";
5
- const packageVersion = "17.0.4";
5
+ const packageVersion = "17.0.5";
6
6
  export const SelectWithoutAnalytics = createSelect(Select);
7
7
  const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
8
8
  export default withAnalyticsContext({
@@ -44,6 +44,19 @@ export default function createSelect(WrappedComponent) {
44
44
  this.select.blur();
45
45
  }
46
46
  }
47
+ componentDidMount() {
48
+ const descriptionId = this.props['aria-describedby'];
49
+ if (!this.props.isSearchable && descriptionId) {
50
+ var _this$select;
51
+ // when isSearchable is false, react-select will create its own dummy input instead of using ours,
52
+ // so we need to manually add the additional aria-describedby using ref.
53
+ const input = (_this$select = this.select) === null || _this$select === void 0 ? void 0 : _this$select.inputRef;
54
+ const ariaDescribedby = input === null || input === void 0 ? void 0 : input.getAttribute('aria-describedby');
55
+ if (!(ariaDescribedby !== null && ariaDescribedby !== void 0 && ariaDescribedby.includes(descriptionId))) {
56
+ input === null || input === void 0 ? void 0 : input.setAttribute('aria-describedby', `${ariaDescribedby} ${descriptionId}`);
57
+ }
58
+ }
59
+ }
47
60
  render() {
48
61
  const {
49
62
  styles,
@@ -2,7 +2,7 @@ import Select from 'react-select';
2
2
  import { withAnalyticsEvents, withAnalyticsContext, createAndFireEvent } from '@atlaskit/analytics-next';
3
3
  import createSelect from './createSelect';
4
4
  var packageName = "@atlaskit/select";
5
- var packageVersion = "17.0.4";
5
+ var packageVersion = "17.0.5";
6
6
  export var SelectWithoutAnalytics = createSelect(Select);
7
7
  var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
8
8
  export default withAnalyticsContext({
@@ -66,6 +66,21 @@ export default function createSelect(WrappedComponent) {
66
66
  this.select.blur();
67
67
  }
68
68
  }
69
+ }, {
70
+ key: "componentDidMount",
71
+ value: function componentDidMount() {
72
+ var descriptionId = this.props['aria-describedby'];
73
+ if (!this.props.isSearchable && descriptionId) {
74
+ var _this$select;
75
+ // when isSearchable is false, react-select will create its own dummy input instead of using ours,
76
+ // so we need to manually add the additional aria-describedby using ref.
77
+ var input = (_this$select = this.select) === null || _this$select === void 0 ? void 0 : _this$select.inputRef;
78
+ var ariaDescribedby = input === null || input === void 0 ? void 0 : input.getAttribute('aria-describedby');
79
+ if (!(ariaDescribedby !== null && ariaDescribedby !== void 0 && ariaDescribedby.includes(descriptionId))) {
80
+ input === null || input === void 0 || input.setAttribute('aria-describedby', "".concat(ariaDescribedby, " ").concat(descriptionId));
81
+ }
82
+ }
83
+ }
69
84
  }, {
70
85
  key: "render",
71
86
  value: function render() {
@@ -8,6 +8,7 @@ declare const _default: {
8
8
  focus(): void;
9
9
  blur(): void;
10
10
  onSelectRef: (ref: import("react-select/base").default<unknown, false, import("react-select").GroupBase<unknown>>) => void;
11
+ componentDidMount(): void;
11
12
  render(): JSX.Element;
12
13
  context: any;
13
14
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
@@ -19,7 +20,6 @@ declare const _default: {
19
20
  refs: {
20
21
  [key: string]: import("react").ReactInstance;
21
22
  };
22
- componentDidMount?(): void;
23
23
  shouldComponentUpdate?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): boolean;
24
24
  componentWillUnmount?(): void;
25
25
  componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
@@ -8,6 +8,7 @@ declare const _default: {
8
8
  focus(): void;
9
9
  blur(): void;
10
10
  onSelectRef: (ref: import("react-select/base").default<unknown, false, import("react-select").GroupBase<unknown>>) => void;
11
+ componentDidMount(): void;
11
12
  render(): JSX.Element;
12
13
  context: any;
13
14
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
@@ -19,7 +20,6 @@ declare const _default: {
19
20
  refs: {
20
21
  [key: string]: import("react").ReactInstance;
21
22
  };
22
- componentDidMount?(): void;
23
23
  shouldComponentUpdate?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): boolean;
24
24
  componentWillUnmount?(): void;
25
25
  componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
@@ -8,6 +8,7 @@ declare const _default: {
8
8
  focus(): void;
9
9
  blur(): void;
10
10
  onSelectRef: (ref: import("react-select/base").default<unknown, false, import("react-select").GroupBase<unknown>>) => void;
11
+ componentDidMount(): void;
11
12
  render(): JSX.Element;
12
13
  context: any;
13
14
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
@@ -19,7 +20,6 @@ declare const _default: {
19
20
  refs: {
20
21
  [key: string]: import("react").ReactInstance;
21
22
  };
22
- componentDidMount?(): void;
23
23
  shouldComponentUpdate?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): boolean;
24
24
  componentWillUnmount?(): void;
25
25
  componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
@@ -8,6 +8,7 @@ export declare const SelectWithoutAnalytics: {
8
8
  focus(): void;
9
9
  blur(): void;
10
10
  onSelectRef: (ref: import("react-select/base").default<unknown, false, import("react-select").GroupBase<unknown>>) => void;
11
+ componentDidMount(): void;
11
12
  render(): JSX.Element;
12
13
  context: any;
13
14
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
@@ -19,7 +20,6 @@ export declare const SelectWithoutAnalytics: {
19
20
  refs: {
20
21
  [key: string]: import("react").ReactInstance;
21
22
  };
22
- componentDidMount?(): void;
23
23
  shouldComponentUpdate?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): boolean;
24
24
  componentWillUnmount?(): void;
25
25
  componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
@@ -52,6 +52,7 @@ declare const _default: {
52
52
  focus(): void;
53
53
  blur(): void;
54
54
  onSelectRef: (ref: import("react-select/base").default<unknown, false, import("react-select").GroupBase<unknown>>) => void;
55
+ componentDidMount(): void;
55
56
  render(): JSX.Element;
56
57
  context: any;
57
58
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
@@ -63,7 +64,6 @@ declare const _default: {
63
64
  refs: {
64
65
  [key: string]: import("react").ReactInstance;
65
66
  };
66
- componentDidMount?(): void;
67
67
  shouldComponentUpdate?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): boolean;
68
68
  componentWillUnmount?(): void;
69
69
  componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
@@ -11,6 +11,7 @@ export default function createSelect(WrappedComponent: ComponentType<any>): {
11
11
  focus(): void;
12
12
  blur(): void;
13
13
  onSelectRef: (ref: BaseSelect) => void;
14
+ componentDidMount(): void;
14
15
  render(): JSX.Element;
15
16
  context: any;
16
17
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<SelectProps<Option, IsMulti> | AsyncSelectProps<Option, IsMulti> | CreatableSelectProps<Option, IsMulti>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
@@ -22,7 +23,6 @@ export default function createSelect(WrappedComponent: ComponentType<any>): {
22
23
  refs: {
23
24
  [key: string]: React.ReactInstance;
24
25
  };
25
- componentDidMount?(): void;
26
26
  shouldComponentUpdate?(nextProps: Readonly<SelectProps<Option, IsMulti> | AsyncSelectProps<Option, IsMulti> | CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): boolean;
27
27
  componentWillUnmount?(): void;
28
28
  componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
@@ -8,6 +8,7 @@ declare const _default: {
8
8
  focus(): void;
9
9
  blur(): void;
10
10
  onSelectRef: (ref: import("react-select/base").default<unknown, false, import("react-select").GroupBase<unknown>>) => void;
11
+ componentDidMount(): void;
11
12
  render(): JSX.Element;
12
13
  context: any;
13
14
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
@@ -19,7 +20,6 @@ declare const _default: {
19
20
  refs: {
20
21
  [key: string]: import("react").ReactInstance;
21
22
  };
22
- componentDidMount?(): void;
23
23
  shouldComponentUpdate?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): boolean;
24
24
  componentWillUnmount?(): void;
25
25
  componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
@@ -8,6 +8,7 @@ declare const _default: {
8
8
  focus(): void;
9
9
  blur(): void;
10
10
  onSelectRef: (ref: import("react-select/base").default<unknown, false, import("react-select").GroupBase<unknown>>) => void;
11
+ componentDidMount(): void;
11
12
  render(): JSX.Element;
12
13
  context: any;
13
14
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
@@ -19,7 +20,6 @@ declare const _default: {
19
20
  refs: {
20
21
  [key: string]: import("react").ReactInstance;
21
22
  };
22
- componentDidMount?(): void;
23
23
  shouldComponentUpdate?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): boolean;
24
24
  componentWillUnmount?(): void;
25
25
  componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
@@ -8,6 +8,7 @@ declare const _default: {
8
8
  focus(): void;
9
9
  blur(): void;
10
10
  onSelectRef: (ref: import("react-select/base").default<unknown, false, import("react-select").GroupBase<unknown>>) => void;
11
+ componentDidMount(): void;
11
12
  render(): JSX.Element;
12
13
  context: any;
13
14
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
@@ -19,7 +20,6 @@ declare const _default: {
19
20
  refs: {
20
21
  [key: string]: import("react").ReactInstance;
21
22
  };
22
- componentDidMount?(): void;
23
23
  shouldComponentUpdate?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): boolean;
24
24
  componentWillUnmount?(): void;
25
25
  componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
@@ -8,6 +8,7 @@ export declare const SelectWithoutAnalytics: {
8
8
  focus(): void;
9
9
  blur(): void;
10
10
  onSelectRef: (ref: import("react-select/base").default<unknown, false, import("react-select").GroupBase<unknown>>) => void;
11
+ componentDidMount(): void;
11
12
  render(): JSX.Element;
12
13
  context: any;
13
14
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
@@ -19,7 +20,6 @@ export declare const SelectWithoutAnalytics: {
19
20
  refs: {
20
21
  [key: string]: import("react").ReactInstance;
21
22
  };
22
- componentDidMount?(): void;
23
23
  shouldComponentUpdate?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): boolean;
24
24
  componentWillUnmount?(): void;
25
25
  componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
@@ -52,6 +52,7 @@ declare const _default: {
52
52
  focus(): void;
53
53
  blur(): void;
54
54
  onSelectRef: (ref: import("react-select/base").default<unknown, false, import("react-select").GroupBase<unknown>>) => void;
55
+ componentDidMount(): void;
55
56
  render(): JSX.Element;
56
57
  context: any;
57
58
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
@@ -63,7 +64,6 @@ declare const _default: {
63
64
  refs: {
64
65
  [key: string]: import("react").ReactInstance;
65
66
  };
66
- componentDidMount?(): void;
67
67
  shouldComponentUpdate?(nextProps: Readonly<import("./types").SelectProps<Option, IsMulti> | import("./types").AsyncSelectProps<Option, IsMulti> | import("./types").CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): boolean;
68
68
  componentWillUnmount?(): void;
69
69
  componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
@@ -11,6 +11,7 @@ export default function createSelect(WrappedComponent: ComponentType<any>): {
11
11
  focus(): void;
12
12
  blur(): void;
13
13
  onSelectRef: (ref: BaseSelect) => void;
14
+ componentDidMount(): void;
14
15
  render(): JSX.Element;
15
16
  context: any;
16
17
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<SelectProps<Option, IsMulti> | AsyncSelectProps<Option, IsMulti> | CreatableSelectProps<Option, IsMulti>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
@@ -22,7 +23,6 @@ export default function createSelect(WrappedComponent: ComponentType<any>): {
22
23
  refs: {
23
24
  [key: string]: React.ReactInstance;
24
25
  };
25
- componentDidMount?(): void;
26
26
  shouldComponentUpdate?(nextProps: Readonly<SelectProps<Option, IsMulti> | AsyncSelectProps<Option, IsMulti> | CreatableSelectProps<Option, IsMulti>>, nextState: Readonly<{}>, nextContext: any): boolean;
27
27
  componentWillUnmount?(): void;
28
28
  componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/select",
3
- "version": "17.0.4",
3
+ "version": "17.0.5",
4
4
  "description": "Select allows users to make a single selection or multiple selections from a list of options.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -43,7 +43,7 @@
43
43
  "@atlaskit/platform-feature-flags": "^0.2.0",
44
44
  "@atlaskit/spinner": "^16.0.0",
45
45
  "@atlaskit/theme": "^12.6.0",
46
- "@atlaskit/tokens": "^1.30.0",
46
+ "@atlaskit/tokens": "^1.35.0",
47
47
  "@atlaskit/visually-hidden": "^1.2.0",
48
48
  "@babel/runtime": "^7.0.0",
49
49
  "@emotion/react": "^11.7.1",
@@ -67,7 +67,6 @@
67
67
  "@af/integration-testing": "*",
68
68
  "@atlaskit/ssr": "*",
69
69
  "@atlaskit/visual-regression": "*",
70
- "@atlaskit/webdriver-runner": "*",
71
70
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
72
71
  "@atlassian/feature-flags-test-utils": "*",
73
72
  "@emotion/styled": "^11.0.0",