@atlaskit/select 18.7.0 → 18.8.0
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 +28 -0
- package/dist/cjs/CountrySelect.js +5 -1
- package/dist/cjs/PopupSelect/PopupSelect.js +11 -1
- package/dist/cjs/Select.js +1 -1
- package/dist/cjs/components/input-options.js +9 -1
- package/dist/cjs/createSelect.js +9 -4
- package/dist/es2019/CountrySelect.js +5 -1
- package/dist/es2019/PopupSelect/PopupSelect.js +11 -1
- package/dist/es2019/Select.js +1 -1
- package/dist/es2019/components/input-options.js +10 -1
- package/dist/es2019/createSelect.js +7 -3
- package/dist/esm/CountrySelect.js +5 -1
- package/dist/esm/PopupSelect/PopupSelect.js +11 -1
- package/dist/esm/Select.js +1 -1
- package/dist/esm/components/input-options.js +9 -1
- package/dist/esm/createSelect.js +7 -3
- package/dist/types/PopupSelect/PopupSelect.d.ts +2 -1
- package/dist/types-ts4.5/PopupSelect/PopupSelect.d.ts +2 -1
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @atlaskit/select
|
|
2
2
|
|
|
3
|
+
## 18.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#173737](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/173737)
|
|
8
|
+
[`667640085e5c7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/667640085e5c7) -
|
|
9
|
+
Update the font size for the textarea and select components at the `xs` breakpoint. The font size
|
|
10
|
+
will be increased to 16px to prevent IOS Safari from zooming in on the text field when it is
|
|
11
|
+
focused. Styles for larger breakpoints will remain unchanged.
|
|
12
|
+
|
|
13
|
+
Apply a fix to the textfield component to ensure monospace is correctly applied to the input at
|
|
14
|
+
the `media.above.xs` breakpoint.
|
|
15
|
+
|
|
16
|
+
These changes are currently behind a feature gate and will be evaluated for effectiveness. If
|
|
17
|
+
successful, they will be included in a future release.
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
23
|
+
## 18.7.1
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- [#172260](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/172260)
|
|
28
|
+
[`9934fe89f1e6a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9934fe89f1e6a) -
|
|
29
|
+
Improving assisstive technology support by adding better semantics and reducing live region usage
|
|
30
|
+
|
|
3
31
|
## 18.7.0
|
|
4
32
|
|
|
5
33
|
### Minor Changes
|
|
@@ -8,6 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _react = require("@emotion/react");
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var _countries = require("./data/countries");
|
|
12
13
|
var _Select = _interopRequireDefault(require("./Select"));
|
|
13
14
|
var _countryGroupsAnnouncement = require("./utils/country-groups-announcement");
|
|
@@ -90,11 +91,14 @@ var CountrySelect = function CountrySelect(props) {
|
|
|
90
91
|
getOptionValue: getOptionValue,
|
|
91
92
|
isMulti: false,
|
|
92
93
|
options: countryOptions,
|
|
93
|
-
ariaLiveMessages:
|
|
94
|
+
ariaLiveMessages:
|
|
95
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
96
|
+
(0, _platformFeatureFlags.fg)('design_system_select-a11y-improvement') ? undefined : (0, _countryGroupsAnnouncement.isCountryOptionsGrouped)(countryOptions) ? _objectSpread({
|
|
94
97
|
onFocus: function onFocus(data) {
|
|
95
98
|
return (0, _countryGroupsAnnouncement.onCountryOptionFocus)(data, countryOptions);
|
|
96
99
|
}
|
|
97
100
|
}, ariaLiveMessages) : _objectSpread({}, ariaLiveMessages)
|
|
101
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
98
102
|
}, props));
|
|
99
103
|
};
|
|
100
104
|
|
|
@@ -22,6 +22,7 @@ var _reactFocusLock = _interopRequireDefault(require("react-focus-lock"));
|
|
|
22
22
|
var _reactPopper = require("react-popper");
|
|
23
23
|
var _shallowEqual = require("shallow-equal");
|
|
24
24
|
var _useId = require("@atlaskit/ds-lib/use-id");
|
|
25
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
25
26
|
var _reactSelect = require("@atlaskit/react-select");
|
|
26
27
|
var _colors = require("@atlaskit/theme/colors");
|
|
27
28
|
var _Select = _interopRequireDefault(require("../Select"));
|
|
@@ -124,6 +125,8 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
|
124
125
|
case 'Escape':
|
|
125
126
|
case 'Esc':
|
|
126
127
|
_this.close();
|
|
128
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
129
|
+
(0, _platformFeatureFlags.fg)('design_system_select-a11y-improvement') && event.stopPropagation(); // keep ESC on select from dismissing parent layers
|
|
127
130
|
break;
|
|
128
131
|
default:
|
|
129
132
|
}
|
|
@@ -419,7 +422,14 @@ var PopupSelect = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
|
419
422
|
disabled: !focusLockEnabled,
|
|
420
423
|
returnFocus: true
|
|
421
424
|
}, /*#__PURE__*/_react.default.createElement(_Select.default, (0, _extends2.default)({
|
|
422
|
-
"aria-label": providedAriaLabel
|
|
425
|
+
"aria-label": providedAriaLabel
|
|
426
|
+
// TODO: Popup Select does not work well with active-descendant
|
|
427
|
+
,
|
|
428
|
+
"aria-live": (/iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === 'MacIntel') &&
|
|
429
|
+
// temporary check for now
|
|
430
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
431
|
+
(0, _platformFeatureFlags.fg)('design_system_select-a11y-improvement') ? 'assertive' // only needed on Apple products
|
|
432
|
+
: undefined,
|
|
423
433
|
backspaceRemovesValue: false,
|
|
424
434
|
controlShouldRenderValue: false,
|
|
425
435
|
isClearable: false,
|
package/dist/cjs/Select.js
CHANGED
|
@@ -11,7 +11,7 @@ var _createSelect = _interopRequireDefault(require("./createSelect"));
|
|
|
11
11
|
/* eslint-disable @repo/internal/react/require-jsdoc */
|
|
12
12
|
|
|
13
13
|
var packageName = "@atlaskit/select";
|
|
14
|
-
var packageVersion = "18.
|
|
14
|
+
var packageVersion = "18.8.0";
|
|
15
15
|
var SelectWithoutAnalytics = exports.SelectWithoutAnalytics = (0, _createSelect.default)(_async.default);
|
|
16
16
|
var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
|
|
17
17
|
var Select = (0, _analyticsNext.withAnalyticsContext)({
|
|
@@ -22,6 +22,7 @@ var _radio = _interopRequireDefault(require("@atlaskit/icon/glyph/radio"));
|
|
|
22
22
|
var _svg = _interopRequireDefault(require("@atlaskit/icon/svg"));
|
|
23
23
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
24
24
|
var _colors = require("@atlaskit/theme/colors");
|
|
25
|
+
var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
|
|
25
26
|
var _excluded = ["getStyles", "Icon", "children", "innerProps", "innerRef"];
|
|
26
27
|
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
|
|
27
28
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
@@ -189,6 +190,9 @@ var ControlOption = /*#__PURE__*/function (_Component) {
|
|
|
189
190
|
innerProps = _this$props.innerProps,
|
|
190
191
|
innerRef = _this$props.innerRef,
|
|
191
192
|
rest = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
|
|
193
|
+
var _this$props2 = this.props,
|
|
194
|
+
isDisabled = _this$props2.isDisabled,
|
|
195
|
+
isSelected = _this$props2.isSelected;
|
|
192
196
|
|
|
193
197
|
// prop assignment
|
|
194
198
|
var props = _objectSpread(_objectSpread({}, innerProps), {}, {
|
|
@@ -202,6 +206,10 @@ var ControlOption = /*#__PURE__*/function (_Component) {
|
|
|
202
206
|
_getPrimitiveStyles2 = (0, _slicedToArray2.default)(_getPrimitiveStyles, 2),
|
|
203
207
|
styles = _getPrimitiveStyles2[0],
|
|
204
208
|
classes = _getPrimitiveStyles2[1];
|
|
209
|
+
var isVoiceOver = (/iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === 'MacIntel') &&
|
|
210
|
+
// temporary check for now
|
|
211
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
212
|
+
(0, _platformFeatureFlags.fg)('design_system_select-a11y-improvement');
|
|
205
213
|
return (
|
|
206
214
|
// These need to remain this way because `react-select` passes props with
|
|
207
215
|
// styles inside, and that must be done dynamically.
|
|
@@ -234,7 +242,7 @@ var ControlOption = /*#__PURE__*/function (_Component) {
|
|
|
234
242
|
isFacadeDisabled: true
|
|
235
243
|
}) : null), (0, _react2.jsx)("div", {
|
|
236
244
|
css: baseOptionStyles
|
|
237
|
-
}, children))
|
|
245
|
+
}, children, isVoiceOver && (isSelected || isDisabled) && (0, _react2.jsx)(_visuallyHidden.default, null, "".concat(isSelected ? ',selected' : '').concat(isDisabled ? ',dimmed' : ''))))
|
|
238
246
|
);
|
|
239
247
|
}
|
|
240
248
|
}]);
|
package/dist/cjs/createSelect.js
CHANGED
|
@@ -10,11 +10,14 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
14
|
var _components = require("./components");
|
|
14
15
|
var _inputAriaDescribedby = require("./components/input-aria-describedby");
|
|
15
16
|
var _noOptions = require("./components/no-options");
|
|
16
17
|
var _groupedOptionsAnnouncement = require("./utils/grouped-options-announcement");
|
|
17
|
-
var _excluded = ["ariaLiveMessages", "components", "isInvalid", "onClickPreventDefault", "tabSelectsValue", "validationState"];
|
|
18
|
+
var _excluded = ["ariaLiveMessages", "components", "isInvalid", "onClickPreventDefault", "tabSelectsValue", "validationState"];
|
|
19
|
+
/* eslint-disable @atlaskit/platform/ensure-feature-flag-prefix */
|
|
20
|
+
// eslint-disable-next-line @repo/internal/fs/filename-pattern-match
|
|
18
21
|
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); }
|
|
19
22
|
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; }
|
|
20
23
|
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; }
|
|
@@ -43,7 +46,7 @@ function createSelect(WrappedComponent) {
|
|
|
43
46
|
NoOptionsMessage: _noOptions.NoOptionsMessage
|
|
44
47
|
}, componentsProp);
|
|
45
48
|
}, [componentsProp]);
|
|
46
|
-
var descriptionId = props['aria-describedby'];
|
|
49
|
+
var descriptionId = props['aria-describedby'] || props['descriptionId'];
|
|
47
50
|
var isSearchable = props.isSearchable;
|
|
48
51
|
(0, _react.useEffect)(function () {
|
|
49
52
|
if (!isSearchable && descriptionId) {
|
|
@@ -80,8 +83,10 @@ function createSelect(WrappedComponent) {
|
|
|
80
83
|
}, []);
|
|
81
84
|
return /*#__PURE__*/_react.default.createElement(WrappedComponent, (0, _extends2.default)({
|
|
82
85
|
ref: internalSelectRef,
|
|
83
|
-
"aria-live":
|
|
84
|
-
ariaLiveMessages:
|
|
86
|
+
"aria-live": (0, _platformFeatureFlags.fg)('design_system_select-a11y-improvement') ? undefined : 'assertive',
|
|
87
|
+
ariaLiveMessages:
|
|
88
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
89
|
+
(0, _platformFeatureFlags.fg)('design_system_select-a11y-improvement') ? undefined : (0, _groupedOptionsAnnouncement.isOptionsGrouped)(props.options) ? _objectSpread({
|
|
85
90
|
onFocus: function onFocus(data) {
|
|
86
91
|
return (0, _groupedOptionsAnnouncement.onFocus)(data, props.options);
|
|
87
92
|
}
|
|
@@ -5,6 +5,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
5
5
|
* @jsx jsx
|
|
6
6
|
*/
|
|
7
7
|
import { css, jsx } from '@emotion/react';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
10
|
|
|
10
11
|
import { groupedCountries } from './data/countries';
|
|
@@ -78,12 +79,15 @@ const CountrySelect = props => {
|
|
|
78
79
|
getOptionValue: getOptionValue,
|
|
79
80
|
isMulti: false,
|
|
80
81
|
options: countryOptions,
|
|
81
|
-
ariaLiveMessages:
|
|
82
|
+
ariaLiveMessages:
|
|
83
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
84
|
+
fg('design_system_select-a11y-improvement') ? undefined : isCountryOptionsGrouped(countryOptions) ? {
|
|
82
85
|
onFocus: data => onCountryOptionFocus(data, countryOptions),
|
|
83
86
|
...ariaLiveMessages
|
|
84
87
|
} : {
|
|
85
88
|
...ariaLiveMessages
|
|
86
89
|
}
|
|
90
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
87
91
|
}, props));
|
|
88
92
|
};
|
|
89
93
|
|
|
@@ -8,6 +8,7 @@ import FocusLock from 'react-focus-lock';
|
|
|
8
8
|
import { Manager, Popper, Reference } from 'react-popper';
|
|
9
9
|
import { shallowEqualObjects } from 'shallow-equal';
|
|
10
10
|
import { IdProvider } from '@atlaskit/ds-lib/use-id';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
12
|
import { mergeStyles } from '@atlaskit/react-select';
|
|
12
13
|
import { N80 } from '@atlaskit/theme/colors';
|
|
13
14
|
import Select from '../Select';
|
|
@@ -91,6 +92,8 @@ export default class PopupSelect extends PureComponent {
|
|
|
91
92
|
case 'Escape':
|
|
92
93
|
case 'Esc':
|
|
93
94
|
this.close();
|
|
95
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
96
|
+
fg('design_system_select-a11y-improvement') && event.stopPropagation(); // keep ESC on select from dismissing parent layers
|
|
94
97
|
break;
|
|
95
98
|
default:
|
|
96
99
|
}
|
|
@@ -397,7 +400,14 @@ export default class PopupSelect extends PureComponent {
|
|
|
397
400
|
disabled: !focusLockEnabled,
|
|
398
401
|
returnFocus: true
|
|
399
402
|
}, /*#__PURE__*/React.createElement(Select, _extends({
|
|
400
|
-
"aria-label": providedAriaLabel
|
|
403
|
+
"aria-label": providedAriaLabel
|
|
404
|
+
// TODO: Popup Select does not work well with active-descendant
|
|
405
|
+
,
|
|
406
|
+
"aria-live": (/iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === 'MacIntel') &&
|
|
407
|
+
// temporary check for now
|
|
408
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
409
|
+
fg('design_system_select-a11y-improvement') ? 'assertive' // only needed on Apple products
|
|
410
|
+
: undefined,
|
|
401
411
|
backspaceRemovesValue: false,
|
|
402
412
|
controlShouldRenderValue: false,
|
|
403
413
|
isClearable: false,
|
package/dist/es2019/Select.js
CHANGED
|
@@ -3,7 +3,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
3
3
|
import AsyncSelect from '@atlaskit/react-select/async';
|
|
4
4
|
import createSelect from './createSelect';
|
|
5
5
|
const packageName = "@atlaskit/select";
|
|
6
|
-
const packageVersion = "18.
|
|
6
|
+
const packageVersion = "18.8.0";
|
|
7
7
|
export const SelectWithoutAnalytics = createSelect(AsyncSelect);
|
|
8
8
|
const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
9
9
|
const Select = withAnalyticsContext({
|
|
@@ -12,6 +12,7 @@ import RadioIcon from '@atlaskit/icon/glyph/radio';
|
|
|
12
12
|
import PrimitiveSVGIcon from '@atlaskit/icon/svg';
|
|
13
13
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
14
|
import { B300, B400, B75, N0, N100, N20, N20A, N30, N70 } from '@atlaskit/theme/colors';
|
|
15
|
+
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
15
16
|
const getPrimitiveStyles = props => {
|
|
16
17
|
const {
|
|
17
18
|
cx,
|
|
@@ -166,6 +167,10 @@ class ControlOption extends Component {
|
|
|
166
167
|
innerRef,
|
|
167
168
|
...rest
|
|
168
169
|
} = this.props;
|
|
170
|
+
const {
|
|
171
|
+
isDisabled,
|
|
172
|
+
isSelected
|
|
173
|
+
} = this.props;
|
|
169
174
|
|
|
170
175
|
// prop assignment
|
|
171
176
|
const props = {
|
|
@@ -178,6 +183,10 @@ class ControlOption extends Component {
|
|
|
178
183
|
getStyles,
|
|
179
184
|
...rest
|
|
180
185
|
});
|
|
186
|
+
const isVoiceOver = (/iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === 'MacIntel') &&
|
|
187
|
+
// temporary check for now
|
|
188
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
189
|
+
fg('design_system_select-a11y-improvement');
|
|
181
190
|
return (
|
|
182
191
|
// These need to remain this way because `react-select` passes props with
|
|
183
192
|
// styles inside, and that must be done dynamically.
|
|
@@ -219,7 +228,7 @@ class ControlOption extends Component {
|
|
|
219
228
|
isFacadeDisabled: true
|
|
220
229
|
}) : null), jsx("div", {
|
|
221
230
|
css: baseOptionStyles
|
|
222
|
-
}, children))
|
|
231
|
+
}, children, isVoiceOver && (isSelected || isDisabled) && jsx(VisuallyHidden, null, `${isSelected ? ',selected' : ''}${isDisabled ? ',dimmed' : ''}`)))
|
|
223
232
|
);
|
|
224
233
|
}
|
|
225
234
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
/* eslint-disable @atlaskit/platform/ensure-feature-flag-prefix */
|
|
2
3
|
// eslint-disable-next-line @repo/internal/fs/filename-pattern-match
|
|
3
4
|
import React, { forwardRef, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
6
|
import { ClearIndicator, DropdownIndicator, IndicatorSeparator, LoadingIndicator, MultiValueRemove } from './components';
|
|
5
7
|
import { Input } from './components/input-aria-describedby';
|
|
6
8
|
import { NoOptionsMessage } from './components/no-options';
|
|
@@ -28,7 +30,7 @@ export default function createSelect(WrappedComponent) {
|
|
|
28
30
|
NoOptionsMessage,
|
|
29
31
|
...componentsProp
|
|
30
32
|
}), [componentsProp]);
|
|
31
|
-
const descriptionId = props['aria-describedby'];
|
|
33
|
+
const descriptionId = props['aria-describedby'] || props['descriptionId'];
|
|
32
34
|
const isSearchable = props.isSearchable;
|
|
33
35
|
useEffect(() => {
|
|
34
36
|
if (!isSearchable && descriptionId) {
|
|
@@ -63,8 +65,10 @@ export default function createSelect(WrappedComponent) {
|
|
|
63
65
|
}), []);
|
|
64
66
|
return /*#__PURE__*/React.createElement(WrappedComponent, _extends({
|
|
65
67
|
ref: internalSelectRef,
|
|
66
|
-
"aria-live":
|
|
67
|
-
ariaLiveMessages:
|
|
68
|
+
"aria-live": fg('design_system_select-a11y-improvement') ? undefined : 'assertive',
|
|
69
|
+
ariaLiveMessages:
|
|
70
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
71
|
+
fg('design_system_select-a11y-improvement') ? undefined : isOptionsGrouped(props.options) ? {
|
|
68
72
|
onFocus: data => onFocus(data, props.options),
|
|
69
73
|
...ariaLiveMessages
|
|
70
74
|
} : {
|
|
@@ -8,6 +8,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
8
8
|
* @jsx jsx
|
|
9
9
|
*/
|
|
10
10
|
import { css, jsx } from '@emotion/react';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
12
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
12
13
|
|
|
13
14
|
import { groupedCountries } from './data/countries';
|
|
@@ -87,11 +88,14 @@ var CountrySelect = function CountrySelect(props) {
|
|
|
87
88
|
getOptionValue: getOptionValue,
|
|
88
89
|
isMulti: false,
|
|
89
90
|
options: countryOptions,
|
|
90
|
-
ariaLiveMessages:
|
|
91
|
+
ariaLiveMessages:
|
|
92
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
93
|
+
fg('design_system_select-a11y-improvement') ? undefined : isCountryOptionsGrouped(countryOptions) ? _objectSpread({
|
|
91
94
|
onFocus: function onFocus(data) {
|
|
92
95
|
return onCountryOptionFocus(data, countryOptions);
|
|
93
96
|
}
|
|
94
97
|
}, ariaLiveMessages) : _objectSpread({}, ariaLiveMessages)
|
|
98
|
+
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
95
99
|
}, props));
|
|
96
100
|
};
|
|
97
101
|
|
|
@@ -20,6 +20,7 @@ import FocusLock from 'react-focus-lock';
|
|
|
20
20
|
import { Manager, Popper, Reference } from 'react-popper';
|
|
21
21
|
import { shallowEqualObjects } from 'shallow-equal';
|
|
22
22
|
import { IdProvider } from '@atlaskit/ds-lib/use-id';
|
|
23
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
23
24
|
import { mergeStyles } from '@atlaskit/react-select';
|
|
24
25
|
import { N80 } from '@atlaskit/theme/colors';
|
|
25
26
|
import Select from '../Select';
|
|
@@ -115,6 +116,8 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
115
116
|
case 'Escape':
|
|
116
117
|
case 'Esc':
|
|
117
118
|
_this.close();
|
|
119
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
120
|
+
fg('design_system_select-a11y-improvement') && event.stopPropagation(); // keep ESC on select from dismissing parent layers
|
|
118
121
|
break;
|
|
119
122
|
default:
|
|
120
123
|
}
|
|
@@ -410,7 +413,14 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
410
413
|
disabled: !focusLockEnabled,
|
|
411
414
|
returnFocus: true
|
|
412
415
|
}, /*#__PURE__*/React.createElement(Select, _extends({
|
|
413
|
-
"aria-label": providedAriaLabel
|
|
416
|
+
"aria-label": providedAriaLabel
|
|
417
|
+
// TODO: Popup Select does not work well with active-descendant
|
|
418
|
+
,
|
|
419
|
+
"aria-live": (/iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === 'MacIntel') &&
|
|
420
|
+
// temporary check for now
|
|
421
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
422
|
+
fg('design_system_select-a11y-improvement') ? 'assertive' // only needed on Apple products
|
|
423
|
+
: undefined,
|
|
414
424
|
backspaceRemovesValue: false,
|
|
415
425
|
controlShouldRenderValue: false,
|
|
416
426
|
isClearable: false,
|
package/dist/esm/Select.js
CHANGED
|
@@ -3,7 +3,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
3
3
|
import AsyncSelect from '@atlaskit/react-select/async';
|
|
4
4
|
import createSelect from './createSelect';
|
|
5
5
|
var packageName = "@atlaskit/select";
|
|
6
|
-
var packageVersion = "18.
|
|
6
|
+
var packageVersion = "18.8.0";
|
|
7
7
|
export var SelectWithoutAnalytics = createSelect(AsyncSelect);
|
|
8
8
|
var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
9
9
|
var Select = withAnalyticsContext({
|
|
@@ -25,6 +25,7 @@ import RadioIcon from '@atlaskit/icon/glyph/radio';
|
|
|
25
25
|
import PrimitiveSVGIcon from '@atlaskit/icon/svg';
|
|
26
26
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
27
27
|
import { B300, B400, B75, N0, N100, N20, N20A, N30, N70 } from '@atlaskit/theme/colors';
|
|
28
|
+
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
28
29
|
var getPrimitiveStyles = function getPrimitiveStyles(props) {
|
|
29
30
|
var cx = props.cx,
|
|
30
31
|
className = props.className,
|
|
@@ -184,6 +185,9 @@ var ControlOption = /*#__PURE__*/function (_Component) {
|
|
|
184
185
|
innerProps = _this$props.innerProps,
|
|
185
186
|
innerRef = _this$props.innerRef,
|
|
186
187
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
188
|
+
var _this$props2 = this.props,
|
|
189
|
+
isDisabled = _this$props2.isDisabled,
|
|
190
|
+
isSelected = _this$props2.isSelected;
|
|
187
191
|
|
|
188
192
|
// prop assignment
|
|
189
193
|
var props = _objectSpread(_objectSpread({}, innerProps), {}, {
|
|
@@ -197,6 +201,10 @@ var ControlOption = /*#__PURE__*/function (_Component) {
|
|
|
197
201
|
_getPrimitiveStyles2 = _slicedToArray(_getPrimitiveStyles, 2),
|
|
198
202
|
styles = _getPrimitiveStyles2[0],
|
|
199
203
|
classes = _getPrimitiveStyles2[1];
|
|
204
|
+
var isVoiceOver = (/iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === 'MacIntel') &&
|
|
205
|
+
// temporary check for now
|
|
206
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
207
|
+
fg('design_system_select-a11y-improvement');
|
|
200
208
|
return (
|
|
201
209
|
// These need to remain this way because `react-select` passes props with
|
|
202
210
|
// styles inside, and that must be done dynamically.
|
|
@@ -229,7 +237,7 @@ var ControlOption = /*#__PURE__*/function (_Component) {
|
|
|
229
237
|
isFacadeDisabled: true
|
|
230
238
|
}) : null), jsx("div", {
|
|
231
239
|
css: baseOptionStyles
|
|
232
|
-
}, children))
|
|
240
|
+
}, children, isVoiceOver && (isSelected || isDisabled) && jsx(VisuallyHidden, null, "".concat(isSelected ? ',selected' : '').concat(isDisabled ? ',dimmed' : ''))))
|
|
233
241
|
);
|
|
234
242
|
}
|
|
235
243
|
}]);
|
package/dist/esm/createSelect.js
CHANGED
|
@@ -4,8 +4,10 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
4
4
|
var _excluded = ["ariaLiveMessages", "components", "isInvalid", "onClickPreventDefault", "tabSelectsValue", "validationState"];
|
|
5
5
|
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; }
|
|
6
6
|
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) { _defineProperty(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; }
|
|
7
|
+
/* eslint-disable @atlaskit/platform/ensure-feature-flag-prefix */
|
|
7
8
|
// eslint-disable-next-line @repo/internal/fs/filename-pattern-match
|
|
8
9
|
import React, { forwardRef, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
|
|
10
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
11
|
import { ClearIndicator, DropdownIndicator, IndicatorSeparator, LoadingIndicator, MultiValueRemove } from './components';
|
|
10
12
|
import { Input } from './components/input-aria-describedby';
|
|
11
13
|
import { NoOptionsMessage } from './components/no-options';
|
|
@@ -34,7 +36,7 @@ export default function createSelect(WrappedComponent) {
|
|
|
34
36
|
NoOptionsMessage: NoOptionsMessage
|
|
35
37
|
}, componentsProp);
|
|
36
38
|
}, [componentsProp]);
|
|
37
|
-
var descriptionId = props['aria-describedby'];
|
|
39
|
+
var descriptionId = props['aria-describedby'] || props['descriptionId'];
|
|
38
40
|
var isSearchable = props.isSearchable;
|
|
39
41
|
useEffect(function () {
|
|
40
42
|
if (!isSearchable && descriptionId) {
|
|
@@ -71,8 +73,10 @@ export default function createSelect(WrappedComponent) {
|
|
|
71
73
|
}, []);
|
|
72
74
|
return /*#__PURE__*/React.createElement(WrappedComponent, _extends({
|
|
73
75
|
ref: internalSelectRef,
|
|
74
|
-
"aria-live":
|
|
75
|
-
ariaLiveMessages:
|
|
76
|
+
"aria-live": fg('design_system_select-a11y-improvement') ? undefined : 'assertive',
|
|
77
|
+
ariaLiveMessages:
|
|
78
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
79
|
+
fg('design_system_select-a11y-improvement') ? undefined : isOptionsGrouped(props.options) ? _objectSpread({
|
|
76
80
|
onFocus: function onFocus(data) {
|
|
77
81
|
return _onFocus(data, props.options);
|
|
78
82
|
}
|
|
@@ -75,7 +75,8 @@ export interface PopupSelectProps<Option = OptionType, IsMulti extends boolean =
|
|
|
75
75
|
*/
|
|
76
76
|
spacing?: 'default' | 'compact';
|
|
77
77
|
/**
|
|
78
|
-
*
|
|
78
|
+
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-14529 Internal documentation for deprecation (no external access)}
|
|
79
|
+
* Use isInvalid instead. The state of validation if used in a form
|
|
79
80
|
*/
|
|
80
81
|
validationState?: ValidationState;
|
|
81
82
|
/**
|
|
@@ -75,7 +75,8 @@ export interface PopupSelectProps<Option = OptionType, IsMulti extends boolean =
|
|
|
75
75
|
*/
|
|
76
76
|
spacing?: 'default' | 'compact';
|
|
77
77
|
/**
|
|
78
|
-
*
|
|
78
|
+
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-14529 Internal documentation for deprecation (no external access)}
|
|
79
|
+
* Use isInvalid instead. The state of validation if used in a form
|
|
79
80
|
*/
|
|
80
81
|
validationState?: ValidationState;
|
|
81
82
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/select",
|
|
3
|
-
"version": "18.
|
|
3
|
+
"version": "18.8.0",
|
|
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/"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@atlaskit/icon": "^23.0.0",
|
|
46
46
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
47
47
|
"@atlaskit/primitives": "^13.3.0",
|
|
48
|
-
"@atlaskit/react-select": "^1.
|
|
48
|
+
"@atlaskit/react-select": "^1.5.0",
|
|
49
49
|
"@atlaskit/spinner": "^16.3.0",
|
|
50
50
|
"@atlaskit/theme": "^14.0.0",
|
|
51
51
|
"@atlaskit/tokens": "^2.4.0",
|
|
@@ -114,6 +114,9 @@
|
|
|
114
114
|
},
|
|
115
115
|
"platform-icon-control-migration": {
|
|
116
116
|
"type": "boolean"
|
|
117
|
+
},
|
|
118
|
+
"platform_design_system_team_safari_input_fix": {
|
|
119
|
+
"type": "boolean"
|
|
117
120
|
}
|
|
118
121
|
},
|
|
119
122
|
"homepage": "https://atlassian.design/components/select/"
|