@atlaskit/react-select 1.7.0 → 1.7.1
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 +8 -0
- package/dist/cjs/components/option.js +2 -2
- package/dist/cjs/select.js +7 -6
- package/dist/es2019/components/option.js +1 -1
- package/dist/es2019/select.js +1 -1
- package/dist/esm/components/option.js +1 -1
- package/dist/esm/select.js +2 -1
- package/package.json +1 -1
- package/dist/cjs/accessibility/helpers.js +0 -43
- package/dist/es2019/accessibility/helpers.js +0 -32
- package/dist/esm/accessibility/helpers.js +0 -32
- package/dist/types/accessibility/helpers.d.ts +0 -6
- package/dist/types-ts4.5/accessibility/helpers.d.ts +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/react-select
|
|
2
2
|
|
|
3
|
+
## 1.7.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#108838](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/108838)
|
|
8
|
+
[`6afd2ca314368`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6afd2ca314368) -
|
|
9
|
+
Replace the helper to verify devices with ds-lib util
|
|
10
|
+
|
|
3
11
|
## 1.7.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -7,8 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.optionCSS = exports.default = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
|
+
var _deviceCheck = require("@atlaskit/ds-lib/device-check");
|
|
10
11
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
|
-
var _helpers = require("../accessibility/helpers");
|
|
12
12
|
var _utils = require("../utils");
|
|
13
13
|
var _a11yText = _interopRequireDefault(require("./internal/a11y-text"));
|
|
14
14
|
/**
|
|
@@ -70,7 +70,7 @@ var Option = function Option(props) {
|
|
|
70
70
|
innerRef = props.innerRef,
|
|
71
71
|
innerProps = props.innerProps;
|
|
72
72
|
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
73
|
-
var isVoiceOver = (0,
|
|
73
|
+
var isVoiceOver = (0, _deviceCheck.isAppleDevice)() && (0, _platformFeatureFlags.fg)('design_system_select-a11y-improvement');
|
|
74
74
|
return (0, _react.jsx)("div", (0, _extends2.default)({}, (0, _utils.getStyleProps)(props, 'option', {
|
|
75
75
|
option: true,
|
|
76
76
|
'option--is-disabled': isDisabled,
|
package/dist/cjs/select.js
CHANGED
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.defaultProps = exports.default = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _readOnlyError2 = _interopRequireDefault(require("@babel/runtime/helpers/readOnlyError"));
|
|
10
11
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
13
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
@@ -15,8 +16,8 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
15
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
17
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
17
18
|
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
+
var _deviceCheck = require("@atlaskit/ds-lib/device-check");
|
|
18
20
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
|
-
var _helpers = require("./accessibility/helpers");
|
|
20
21
|
var _builtins = require("./builtins");
|
|
21
22
|
var _components = require("./components");
|
|
22
23
|
var _internal = require("./components/internal");
|
|
@@ -256,7 +257,7 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
256
257
|
(0, _defineProperty2.default)(_this, "initialTouchY", 0);
|
|
257
258
|
(0, _defineProperty2.default)(_this, "openAfterFocus", false);
|
|
258
259
|
(0, _defineProperty2.default)(_this, "scrollToFocusedOptionOnUpdate", false);
|
|
259
|
-
(0, _defineProperty2.default)(_this, "isVoiceOver", (0, _platformFeatureFlags.fg)('design_system_select-a11y-improvement') && (0,
|
|
260
|
+
(0, _defineProperty2.default)(_this, "isVoiceOver", (0, _platformFeatureFlags.fg)('design_system_select-a11y-improvement') && (0, _deviceCheck.isAppleDevice)());
|
|
260
261
|
// Refs
|
|
261
262
|
// ------------------------------
|
|
262
263
|
(0, _defineProperty2.default)(_this, "controlRef", null);
|
|
@@ -1151,7 +1152,7 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1151
1152
|
if (selectValue.length && action !== 'initial-input-focus') {
|
|
1152
1153
|
return;
|
|
1153
1154
|
}
|
|
1154
|
-
if (isMulti && (0,
|
|
1155
|
+
if (isMulti && (0, _deviceCheck.isAppleDevice)() && !(0, _deviceCheck.isSafari)()) {
|
|
1155
1156
|
// chrome only friends
|
|
1156
1157
|
return {
|
|
1157
1158
|
'aria-describedby': descriptionProp ? [descriptionProp, defaultDescription, this.getElementId('multi-message')].join(' ') : [defaultDescription, this.getElementId('multi-message')].join(' ')
|
|
@@ -1261,7 +1262,7 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1261
1262
|
role: 'combobox',
|
|
1262
1263
|
'aria-activedescendant': this.state.focusedOptionId || undefined,
|
|
1263
1264
|
// Safari needs aria-owns in order for aria-activedescendant to work properly
|
|
1264
|
-
'aria-owns': (0,
|
|
1265
|
+
'aria-owns': (0, _deviceCheck.isSafari)() && (0, _platformFeatureFlags.fg)('design_system_select-a11y-improvement') ? this.getElementId('listbox') : undefined
|
|
1265
1266
|
}, menuIsOpen && {
|
|
1266
1267
|
'aria-controls': this.getElementId('listbox')
|
|
1267
1268
|
}), !isSearchable && {
|
|
@@ -1511,7 +1512,7 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1511
1512
|
// We don't want aria-selected on Apple devices or if it's false. It does nasty things.
|
|
1512
1513
|
'aria-selected': (!commonProps.isMulti || _this4.isVoiceOver || !isSelected) && (0, _platformFeatureFlags.fg)('design_system_select-a11y-improvement') ? undefined : isSelected,
|
|
1513
1514
|
// We don't want aria-disabled on Apple devices or if it's false. It's just noisy.
|
|
1514
|
-
'aria-disabled': ((0,
|
|
1515
|
+
'aria-disabled': ((0, _deviceCheck.isAppleDevice)() || !isDisabled) && (0, _platformFeatureFlags.fg)('design_system_select-a11y-improvement') ? undefined : isDisabled,
|
|
1515
1516
|
'aria-describedby': (0, _platformFeatureFlags.fg)('design_system_select-a11y-improvement') ? headingId : undefined
|
|
1516
1517
|
};
|
|
1517
1518
|
return /*#__PURE__*/_react.default.createElement(Option, (0, _extends2.default)({}, commonProps, {
|
|
@@ -1610,7 +1611,7 @@ var Select = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
1610
1611
|
id: _this4.getElementId('listbox')
|
|
1611
1612
|
}, (0, _platformFeatureFlags.fg)('design_system_select-a11y-improvement') && {
|
|
1612
1613
|
'aria-label': label,
|
|
1613
|
-
'aria-labelledby': "".concat(labelId || ((_this4$inputRef = _this4.inputRef) === null || _this4$inputRef === void 0 ? void 0 : _this4$inputRef.id) || _this4.getElementId('input'), " ").concat(commonProps.isMulti && (0,
|
|
1614
|
+
'aria-labelledby': "".concat(labelId || ((_this4$inputRef = _this4.inputRef) === null || _this4$inputRef === void 0 ? void 0 : _this4$inputRef.id) || _this4.getElementId('input'), " ").concat(commonProps.isMulti && (0, _deviceCheck.isSafari)() ? _this4.getElementId('multi-message') : '')
|
|
1614
1615
|
}),
|
|
1615
1616
|
isLoading: isLoading,
|
|
1616
1617
|
maxHeight: maxHeight,
|
|
@@ -5,8 +5,8 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { jsx } from '@emotion/react';
|
|
8
|
+
import { isAppleDevice } from '@atlaskit/ds-lib/device-check';
|
|
8
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
-
import { isAppleDevice } from '../accessibility/helpers';
|
|
10
10
|
import { getStyleProps } from '../utils';
|
|
11
11
|
import A11yText from './internal/a11y-text';
|
|
12
12
|
export const optionCSS = ({
|
package/dist/es2019/select.js
CHANGED
|
@@ -2,8 +2,8 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
/* eslint-disable @atlaskit/platform/ensure-feature-flag-prefix */
|
|
4
4
|
import React, { Component } from 'react';
|
|
5
|
+
import { isAppleDevice, isSafari } from '@atlaskit/ds-lib/device-check';
|
|
5
6
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
|
-
import { isAppleDevice, isSafari } from './accessibility/helpers';
|
|
7
7
|
import { formatGroupLabel as formatGroupLabelBuiltin, getOptionLabel as getOptionLabelBuiltin, getOptionValue as getOptionValueBuiltin, isOptionDisabled as isOptionDisabledBuiltin } from './builtins';
|
|
8
8
|
import { defaultComponents } from './components';
|
|
9
9
|
import { DummyInput, RequiredInput, ScrollManager } from './components/internal';
|
|
@@ -5,8 +5,8 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { jsx } from '@emotion/react';
|
|
8
|
+
import { isAppleDevice } from '@atlaskit/ds-lib/device-check';
|
|
8
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
-
import { isAppleDevice } from '../accessibility/helpers';
|
|
10
10
|
import { getStyleProps } from '../utils';
|
|
11
11
|
import A11yText from './internal/a11y-text';
|
|
12
12
|
export var optionCSS = function optionCSS(_ref) {
|
package/dist/esm/select.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _readOnlyError from "@babel/runtime/helpers/readOnlyError";
|
|
2
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
@@ -12,8 +13,8 @@ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstruct
|
|
|
12
13
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
14
|
/* eslint-disable @atlaskit/platform/ensure-feature-flag-prefix */
|
|
14
15
|
import React, { Component } from 'react';
|
|
16
|
+
import { isAppleDevice, isSafari } from '@atlaskit/ds-lib/device-check';
|
|
15
17
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
|
-
import { isAppleDevice, isSafari } from './accessibility/helpers';
|
|
17
18
|
import { formatGroupLabel as formatGroupLabelBuiltin, getOptionLabel as getOptionLabelBuiltin, getOptionValue as getOptionValueBuiltin, isOptionDisabled as isOptionDisabledBuiltin } from './builtins';
|
|
18
19
|
import { defaultComponents } from './components';
|
|
19
20
|
import { DummyInput, RequiredInput, ScrollManager } from './components/internal';
|
package/package.json
CHANGED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.isAppleDevice = isAppleDevice;
|
|
7
|
-
exports.isIOS = isIOS;
|
|
8
|
-
exports.isIPad = isIPad;
|
|
9
|
-
exports.isIPhone = isIPhone;
|
|
10
|
-
exports.isMac = isMac;
|
|
11
|
-
exports.isSafari = isSafari;
|
|
12
|
-
function testPlatform(re) {
|
|
13
|
-
var _window$navigator$use;
|
|
14
|
-
return typeof window !== 'undefined' && window.navigator != null ?
|
|
15
|
-
//@ts-expect-error ignore userAgentData type issue
|
|
16
|
-
re.test(((_window$navigator$use = window.navigator['userAgentData']) === null || _window$navigator$use === void 0 ? void 0 : _window$navigator$use.platform) || window.navigator.platform) : false;
|
|
17
|
-
}
|
|
18
|
-
function isIPhone() {
|
|
19
|
-
return testPlatform(/^iPhone/i);
|
|
20
|
-
}
|
|
21
|
-
function isSafari() {
|
|
22
|
-
if (typeof window !== 'undefined' && window.navigator != null) {
|
|
23
|
-
var _window$navigator$use2;
|
|
24
|
-
var ua = (_window$navigator$use2 = window.navigator.userAgent) === null || _window$navigator$use2 === void 0 ? void 0 : _window$navigator$use2.toLowerCase();
|
|
25
|
-
return ua ? ua.includes('safari') && !ua.includes('chrome') : false;
|
|
26
|
-
}
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
function isMac() {
|
|
30
|
-
return testPlatform(/^Mac/i);
|
|
31
|
-
}
|
|
32
|
-
function isIPad() {
|
|
33
|
-
return testPlatform(/^iPad/i) ||
|
|
34
|
-
// iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
|
35
|
-
// eslint-disable-next-line compat/compat
|
|
36
|
-
isMac() && navigator.maxTouchPoints > 1;
|
|
37
|
-
}
|
|
38
|
-
function isIOS() {
|
|
39
|
-
return isIPhone() || isIPad();
|
|
40
|
-
}
|
|
41
|
-
function isAppleDevice() {
|
|
42
|
-
return isMac() || isIOS();
|
|
43
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
function testPlatform(re) {
|
|
2
|
-
var _window$navigator$use;
|
|
3
|
-
return typeof window !== 'undefined' && window.navigator != null ?
|
|
4
|
-
//@ts-expect-error ignore userAgentData type issue
|
|
5
|
-
re.test(((_window$navigator$use = window.navigator['userAgentData']) === null || _window$navigator$use === void 0 ? void 0 : _window$navigator$use.platform) || window.navigator.platform) : false;
|
|
6
|
-
}
|
|
7
|
-
export function isIPhone() {
|
|
8
|
-
return testPlatform(/^iPhone/i);
|
|
9
|
-
}
|
|
10
|
-
export function isSafari() {
|
|
11
|
-
if (typeof window !== 'undefined' && window.navigator != null) {
|
|
12
|
-
var _window$navigator$use2;
|
|
13
|
-
const ua = (_window$navigator$use2 = window.navigator.userAgent) === null || _window$navigator$use2 === void 0 ? void 0 : _window$navigator$use2.toLowerCase();
|
|
14
|
-
return ua ? ua.includes('safari') && !ua.includes('chrome') : false;
|
|
15
|
-
}
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
export function isMac() {
|
|
19
|
-
return testPlatform(/^Mac/i);
|
|
20
|
-
}
|
|
21
|
-
export function isIPad() {
|
|
22
|
-
return testPlatform(/^iPad/i) ||
|
|
23
|
-
// iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
|
24
|
-
// eslint-disable-next-line compat/compat
|
|
25
|
-
isMac() && navigator.maxTouchPoints > 1;
|
|
26
|
-
}
|
|
27
|
-
export function isIOS() {
|
|
28
|
-
return isIPhone() || isIPad();
|
|
29
|
-
}
|
|
30
|
-
export function isAppleDevice() {
|
|
31
|
-
return isMac() || isIOS();
|
|
32
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
function testPlatform(re) {
|
|
2
|
-
var _window$navigator$use;
|
|
3
|
-
return typeof window !== 'undefined' && window.navigator != null ?
|
|
4
|
-
//@ts-expect-error ignore userAgentData type issue
|
|
5
|
-
re.test(((_window$navigator$use = window.navigator['userAgentData']) === null || _window$navigator$use === void 0 ? void 0 : _window$navigator$use.platform) || window.navigator.platform) : false;
|
|
6
|
-
}
|
|
7
|
-
export function isIPhone() {
|
|
8
|
-
return testPlatform(/^iPhone/i);
|
|
9
|
-
}
|
|
10
|
-
export function isSafari() {
|
|
11
|
-
if (typeof window !== 'undefined' && window.navigator != null) {
|
|
12
|
-
var _window$navigator$use2;
|
|
13
|
-
var ua = (_window$navigator$use2 = window.navigator.userAgent) === null || _window$navigator$use2 === void 0 ? void 0 : _window$navigator$use2.toLowerCase();
|
|
14
|
-
return ua ? ua.includes('safari') && !ua.includes('chrome') : false;
|
|
15
|
-
}
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
export function isMac() {
|
|
19
|
-
return testPlatform(/^Mac/i);
|
|
20
|
-
}
|
|
21
|
-
export function isIPad() {
|
|
22
|
-
return testPlatform(/^iPad/i) ||
|
|
23
|
-
// iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
|
24
|
-
// eslint-disable-next-line compat/compat
|
|
25
|
-
isMac() && navigator.maxTouchPoints > 1;
|
|
26
|
-
}
|
|
27
|
-
export function isIOS() {
|
|
28
|
-
return isIPhone() || isIPad();
|
|
29
|
-
}
|
|
30
|
-
export function isAppleDevice() {
|
|
31
|
-
return isMac() || isIOS();
|
|
32
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare function isIPhone(): boolean;
|
|
2
|
-
export declare function isSafari(): boolean;
|
|
3
|
-
export declare function isMac(): boolean;
|
|
4
|
-
export declare function isIPad(): boolean;
|
|
5
|
-
export declare function isIOS(): boolean;
|
|
6
|
-
export declare function isAppleDevice(): boolean;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare function isIPhone(): boolean;
|
|
2
|
-
export declare function isSafari(): boolean;
|
|
3
|
-
export declare function isMac(): boolean;
|
|
4
|
-
export declare function isIPad(): boolean;
|
|
5
|
-
export declare function isIOS(): boolean;
|
|
6
|
-
export declare function isAppleDevice(): boolean;
|