@atlaskit/react-select 2.2.0 → 2.3.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 +23 -0
- package/dist/cjs/compiled/components/containers.compiled.css +26 -0
- package/dist/cjs/compiled/components/containers.js +119 -0
- package/dist/cjs/compiled/components/control.compiled.css +51 -0
- package/dist/cjs/compiled/components/control.js +66 -0
- package/dist/cjs/compiled/components/group.compiled.css +12 -0
- package/dist/cjs/compiled/components/group.js +81 -0
- package/dist/cjs/compiled/components/indicators.compiled.css +24 -0
- package/dist/cjs/compiled/components/indicators.js +157 -0
- package/dist/cjs/compiled/components/input.compiled.css +49 -0
- package/dist/cjs/compiled/components/input.js +69 -0
- package/dist/cjs/compiled/components/internal/a11y-text.compiled.css +15 -0
- package/dist/cjs/compiled/components/internal/a11y-text.js +23 -0
- package/dist/cjs/compiled/components/internal/dummy-input.compiled.css +17 -0
- package/dist/cjs/compiled/components/internal/dummy-input.js +30 -0
- package/dist/cjs/compiled/components/internal/required-input.compiled.css +8 -0
- package/dist/cjs/compiled/components/internal/required-input.js +34 -0
- package/dist/cjs/compiled/components/live-region.js +177 -0
- package/dist/cjs/compiled/components/menu.compiled.css +19 -0
- package/dist/cjs/compiled/components/menu.js +491 -0
- package/dist/cjs/compiled/components/multi-value.compiled.css +56 -0
- package/dist/cjs/compiled/components/multi-value.js +199 -0
- package/dist/cjs/compiled/components/option.compiled.css +22 -0
- package/dist/cjs/compiled/components/option.js +57 -0
- package/dist/cjs/compiled/components/placeholder.compiled.css +7 -0
- package/dist/cjs/compiled/components/placeholder.js +45 -0
- package/dist/cjs/compiled/components/single-value.compiled.css +13 -0
- package/dist/cjs/compiled/components/single-value.js +46 -0
- package/dist/cjs/components/containers.js +12 -72
- package/dist/cjs/components/control.js +11 -96
- package/dist/cjs/components/group.js +15 -53
- package/dist/cjs/components/indicators.js +15 -107
- package/dist/cjs/components/input.js +12 -81
- package/dist/cjs/components/internal/a11y-text.js +6 -25
- package/dist/cjs/components/internal/dummy-input.js +8 -36
- package/dist/cjs/components/internal/notify-open-layer-observer.js +1 -0
- package/dist/cjs/components/internal/required-input.js +7 -31
- package/dist/cjs/components/internal/scroll-manager.js +19 -17
- package/dist/cjs/components/live-region.js +6 -164
- package/dist/cjs/components/menu.js +26 -181
- package/dist/cjs/components/multi-value.js +21 -197
- package/dist/cjs/components/option.js +11 -68
- package/dist/cjs/components/placeholder.js +11 -20
- package/dist/cjs/components/single-value.js +11 -26
- package/dist/cjs/emotion/components/containers.js +113 -0
- package/dist/cjs/emotion/components/control.js +112 -0
- package/dist/cjs/emotion/components/group.js +72 -0
- package/dist/cjs/emotion/components/indicators.js +138 -0
- package/dist/cjs/emotion/components/input.js +94 -0
- package/dist/cjs/emotion/components/internal/a11y-text.js +37 -0
- package/dist/cjs/emotion/components/internal/dummy-input.js +45 -0
- package/dist/cjs/emotion/components/internal/required-input.js +45 -0
- package/dist/cjs/emotion/components/live-region.js +182 -0
- package/dist/cjs/emotion/components/menu.js +456 -0
- package/dist/cjs/emotion/components/multi-value.js +224 -0
- package/dist/cjs/emotion/components/option.js +84 -0
- package/dist/cjs/emotion/components/placeholder.js +36 -0
- package/dist/cjs/emotion/components/single-value.js +42 -0
- package/dist/cjs/utils.js +2 -1
- package/dist/es2019/compiled/components/containers.compiled.css +26 -0
- package/dist/es2019/compiled/components/containers.js +115 -0
- package/dist/es2019/compiled/components/control.compiled.css +51 -0
- package/dist/es2019/compiled/components/control.js +58 -0
- package/dist/es2019/compiled/components/group.compiled.css +12 -0
- package/dist/es2019/compiled/components/group.js +72 -0
- package/dist/es2019/compiled/components/indicators.compiled.css +24 -0
- package/dist/es2019/compiled/components/indicators.js +144 -0
- package/dist/es2019/compiled/components/input.compiled.css +49 -0
- package/dist/es2019/compiled/components/input.js +59 -0
- package/dist/es2019/compiled/components/internal/a11y-text.compiled.css +15 -0
- package/dist/es2019/compiled/components/internal/a11y-text.js +11 -0
- package/dist/es2019/compiled/components/internal/dummy-input.compiled.css +17 -0
- package/dist/es2019/compiled/components/internal/dummy-input.js +19 -0
- package/dist/es2019/compiled/components/internal/required-input.compiled.css +8 -0
- package/dist/es2019/compiled/components/internal/required-input.js +23 -0
- package/dist/es2019/compiled/components/live-region.js +171 -0
- package/dist/es2019/compiled/components/menu.compiled.css +19 -0
- package/dist/es2019/compiled/components/menu.js +478 -0
- package/dist/es2019/compiled/components/multi-value.compiled.css +56 -0
- package/dist/es2019/compiled/components/multi-value.js +190 -0
- package/dist/es2019/compiled/components/option.compiled.css +22 -0
- package/dist/es2019/compiled/components/option.js +48 -0
- package/dist/es2019/compiled/components/placeholder.compiled.css +7 -0
- package/dist/es2019/compiled/components/placeholder.js +36 -0
- package/dist/es2019/compiled/components/single-value.compiled.css +13 -0
- package/dist/es2019/compiled/components/single-value.js +37 -0
- package/dist/es2019/components/containers.js +10 -87
- package/dist/es2019/components/control.js +8 -103
- package/dist/es2019/components/group.js +9 -54
- package/dist/es2019/components/indicators.js +11 -113
- package/dist/es2019/components/input.js +7 -83
- package/dist/es2019/components/internal/a11y-text.js +6 -26
- package/dist/es2019/components/internal/dummy-input.js +7 -36
- package/dist/es2019/components/internal/notify-open-layer-observer.js +1 -0
- package/dist/es2019/components/internal/required-input.js +6 -32
- package/dist/es2019/components/internal/scroll-manager.js +16 -16
- package/dist/es2019/components/live-region.js +5 -168
- package/dist/es2019/components/menu.js +14 -192
- package/dist/es2019/components/multi-value.js +12 -216
- package/dist/es2019/components/option.js +7 -75
- package/dist/es2019/components/placeholder.js +7 -25
- package/dist/es2019/components/single-value.js +7 -31
- package/dist/es2019/emotion/components/containers.js +110 -0
- package/dist/es2019/emotion/components/control.js +108 -0
- package/dist/es2019/emotion/components/group.js +60 -0
- package/dist/es2019/emotion/components/indicators.js +129 -0
- package/dist/es2019/emotion/components/input.js +87 -0
- package/dist/es2019/emotion/components/internal/a11y-text.js +28 -0
- package/dist/es2019/emotion/components/internal/dummy-input.js +38 -0
- package/dist/es2019/emotion/components/internal/required-input.js +36 -0
- package/dist/es2019/emotion/components/live-region.js +180 -0
- package/dist/es2019/emotion/components/menu.js +452 -0
- package/dist/es2019/emotion/components/multi-value.js +228 -0
- package/dist/es2019/emotion/components/option.js +79 -0
- package/dist/es2019/emotion/components/placeholder.js +29 -0
- package/dist/es2019/emotion/components/single-value.js +35 -0
- package/dist/es2019/utils.js +1 -0
- package/dist/esm/compiled/components/containers.compiled.css +26 -0
- package/dist/esm/compiled/components/containers.js +110 -0
- package/dist/esm/compiled/components/control.compiled.css +51 -0
- package/dist/esm/compiled/components/control.js +57 -0
- package/dist/esm/compiled/components/group.compiled.css +12 -0
- package/dist/esm/compiled/components/group.js +71 -0
- package/dist/esm/compiled/components/indicators.compiled.css +24 -0
- package/dist/esm/compiled/components/indicators.js +148 -0
- package/dist/esm/compiled/components/input.compiled.css +49 -0
- package/dist/esm/compiled/components/input.js +59 -0
- package/dist/esm/compiled/components/internal/a11y-text.compiled.css +15 -0
- package/dist/esm/compiled/components/internal/a11y-text.js +13 -0
- package/dist/esm/compiled/components/internal/dummy-input.compiled.css +17 -0
- package/dist/esm/compiled/components/internal/dummy-input.js +20 -0
- package/dist/esm/compiled/components/internal/required-input.compiled.css +8 -0
- package/dist/esm/compiled/components/internal/required-input.js +24 -0
- package/dist/esm/compiled/components/live-region.js +168 -0
- package/dist/esm/compiled/components/menu.compiled.css +19 -0
- package/dist/esm/compiled/components/menu.js +485 -0
- package/dist/esm/compiled/components/multi-value.compiled.css +56 -0
- package/dist/esm/compiled/components/multi-value.js +187 -0
- package/dist/esm/compiled/components/option.compiled.css +22 -0
- package/dist/esm/compiled/components/option.js +47 -0
- package/dist/esm/compiled/components/placeholder.compiled.css +7 -0
- package/dist/esm/compiled/components/placeholder.js +35 -0
- package/dist/esm/compiled/components/single-value.compiled.css +13 -0
- package/dist/esm/compiled/components/single-value.js +36 -0
- package/dist/esm/components/containers.js +12 -73
- package/dist/esm/components/control.js +8 -97
- package/dist/esm/components/group.js +11 -54
- package/dist/esm/components/indicators.js +15 -109
- package/dist/esm/components/input.js +8 -83
- package/dist/esm/components/internal/a11y-text.js +6 -26
- package/dist/esm/components/internal/dummy-input.js +7 -37
- package/dist/esm/components/internal/notify-open-layer-observer.js +1 -0
- package/dist/esm/components/internal/required-input.js +7 -32
- package/dist/esm/components/internal/scroll-manager.js +16 -16
- package/dist/esm/components/live-region.js +5 -163
- package/dist/esm/components/menu.js +24 -182
- package/dist/esm/components/multi-value.js +17 -199
- package/dist/esm/components/option.js +8 -69
- package/dist/esm/components/placeholder.js +8 -21
- package/dist/esm/components/single-value.js +8 -27
- package/dist/esm/emotion/components/containers.js +106 -0
- package/dist/esm/emotion/components/control.js +104 -0
- package/dist/esm/emotion/components/group.js +66 -0
- package/dist/esm/emotion/components/indicators.js +133 -0
- package/dist/esm/emotion/components/input.js +90 -0
- package/dist/esm/emotion/components/internal/a11y-text.js +30 -0
- package/dist/esm/emotion/components/internal/dummy-input.js +39 -0
- package/dist/esm/emotion/components/internal/required-input.js +37 -0
- package/dist/esm/emotion/components/live-region.js +177 -0
- package/dist/esm/emotion/components/menu.js +456 -0
- package/dist/esm/emotion/components/multi-value.js +218 -0
- package/dist/esm/emotion/components/option.js +76 -0
- package/dist/esm/emotion/components/placeholder.js +28 -0
- package/dist/esm/emotion/components/single-value.js +34 -0
- package/dist/esm/utils.js +2 -1
- package/dist/types/compiled/components/containers.d.ts +53 -0
- package/dist/types/compiled/components/control.d.ts +41 -0
- package/dist/types/compiled/components/group.d.ts +54 -0
- package/dist/types/compiled/components/indicators.d.ts +72 -0
- package/dist/types/compiled/components/input.d.ts +36 -0
- package/dist/types/compiled/components/internal/a11y-text.d.ts +3 -0
- package/dist/types/compiled/components/internal/dummy-input.d.ts +8 -0
- package/dist/types/compiled/components/internal/required-input.d.ts +10 -0
- package/dist/types/compiled/components/live-region.d.ts +19 -0
- package/dist/types/compiled/components/menu.d.ts +115 -0
- package/dist/types/compiled/components/multi-value.d.ts +57 -0
- package/dist/types/compiled/components/option.d.ts +48 -0
- package/dist/types/compiled/components/placeholder.d.ts +21 -0
- package/dist/types/compiled/components/single-value.d.ts +27 -0
- package/dist/types/components/containers.d.ts +6 -11
- package/dist/types/components/control.d.ts +4 -9
- package/dist/types/components/group.d.ts +8 -10
- package/dist/types/components/index.d.ts +21 -21
- package/dist/types/components/indicators.d.ts +7 -12
- package/dist/types/components/input.d.ts +3 -8
- package/dist/types/components/internal/a11y-text.d.ts +2 -7
- package/dist/types/components/internal/dummy-input.d.ts +3 -8
- package/dist/types/components/internal/required-input.d.ts +0 -4
- package/dist/types/components/internal/scroll-manager.d.ts +2 -7
- package/dist/types/components/live-region.d.ts +2 -8
- package/dist/types/components/menu.d.ts +10 -15
- package/dist/types/components/multi-value.d.ts +19 -13
- package/dist/types/components/option.d.ts +3 -8
- package/dist/types/components/placeholder.d.ts +3 -8
- package/dist/types/components/single-value.d.ts +3 -8
- package/dist/types/emotion/components/containers.d.ts +54 -0
- package/dist/types/emotion/components/control.d.ts +42 -0
- package/dist/types/emotion/components/group.d.ts +52 -0
- package/dist/types/emotion/components/indicators.d.ts +73 -0
- package/dist/types/emotion/components/input.d.ts +37 -0
- package/dist/types/emotion/components/internal/a11y-text.d.ts +8 -0
- package/dist/types/emotion/components/internal/dummy-input.d.ts +9 -0
- package/dist/types/emotion/components/internal/required-input.d.ts +10 -0
- package/dist/types/emotion/components/live-region.d.ts +25 -0
- package/dist/types/emotion/components/menu.d.ts +116 -0
- package/dist/types/emotion/components/multi-value.d.ts +47 -0
- package/dist/types/emotion/components/option.d.ts +49 -0
- package/dist/types/emotion/components/placeholder.d.ts +22 -0
- package/dist/types/emotion/components/single-value.d.ts +28 -0
- package/dist/types/select.d.ts +21 -21
- package/dist/types/types.d.ts +3 -0
- package/dist/types-ts4.5/compiled/components/containers.d.ts +53 -0
- package/dist/types-ts4.5/compiled/components/control.d.ts +41 -0
- package/dist/types-ts4.5/compiled/components/group.d.ts +54 -0
- package/dist/types-ts4.5/compiled/components/indicators.d.ts +72 -0
- package/dist/types-ts4.5/compiled/components/input.d.ts +36 -0
- package/dist/types-ts4.5/compiled/components/internal/a11y-text.d.ts +3 -0
- package/dist/types-ts4.5/compiled/components/internal/dummy-input.d.ts +8 -0
- package/dist/types-ts4.5/compiled/components/internal/required-input.d.ts +10 -0
- package/dist/types-ts4.5/compiled/components/live-region.d.ts +19 -0
- package/dist/types-ts4.5/compiled/components/menu.d.ts +115 -0
- package/dist/types-ts4.5/compiled/components/multi-value.d.ts +57 -0
- package/dist/types-ts4.5/compiled/components/option.d.ts +48 -0
- package/dist/types-ts4.5/compiled/components/placeholder.d.ts +21 -0
- package/dist/types-ts4.5/compiled/components/single-value.d.ts +27 -0
- package/dist/types-ts4.5/components/containers.d.ts +6 -11
- package/dist/types-ts4.5/components/control.d.ts +4 -9
- package/dist/types-ts4.5/components/group.d.ts +8 -10
- package/dist/types-ts4.5/components/index.d.ts +21 -21
- package/dist/types-ts4.5/components/indicators.d.ts +7 -12
- package/dist/types-ts4.5/components/input.d.ts +3 -8
- package/dist/types-ts4.5/components/internal/a11y-text.d.ts +2 -7
- package/dist/types-ts4.5/components/internal/dummy-input.d.ts +3 -8
- package/dist/types-ts4.5/components/internal/required-input.d.ts +0 -4
- package/dist/types-ts4.5/components/internal/scroll-manager.d.ts +2 -7
- package/dist/types-ts4.5/components/live-region.d.ts +2 -8
- package/dist/types-ts4.5/components/menu.d.ts +10 -15
- package/dist/types-ts4.5/components/multi-value.d.ts +19 -13
- package/dist/types-ts4.5/components/option.d.ts +3 -8
- package/dist/types-ts4.5/components/placeholder.d.ts +3 -8
- package/dist/types-ts4.5/components/single-value.d.ts +3 -8
- package/dist/types-ts4.5/emotion/components/containers.d.ts +54 -0
- package/dist/types-ts4.5/emotion/components/control.d.ts +42 -0
- package/dist/types-ts4.5/emotion/components/group.d.ts +52 -0
- package/dist/types-ts4.5/emotion/components/indicators.d.ts +73 -0
- package/dist/types-ts4.5/emotion/components/input.d.ts +37 -0
- package/dist/types-ts4.5/emotion/components/internal/a11y-text.d.ts +8 -0
- package/dist/types-ts4.5/emotion/components/internal/dummy-input.d.ts +9 -0
- package/dist/types-ts4.5/emotion/components/internal/required-input.d.ts +10 -0
- package/dist/types-ts4.5/emotion/components/live-region.d.ts +25 -0
- package/dist/types-ts4.5/emotion/components/menu.d.ts +116 -0
- package/dist/types-ts4.5/emotion/components/multi-value.d.ts +47 -0
- package/dist/types-ts4.5/emotion/components/option.d.ts +49 -0
- package/dist/types-ts4.5/emotion/components/placeholder.d.ts +22 -0
- package/dist/types-ts4.5/emotion/components/single-value.d.ts +28 -0
- package/dist/types-ts4.5/select.d.ts +21 -21
- package/dist/types-ts4.5/types.d.ts +3 -0
- package/package.json +10 -2
|
@@ -1,132 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
/**
|
|
8
|
-
* @jsxRuntime classic
|
|
9
|
-
* @jsx jsx
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { jsx } from '@emotion/react';
|
|
13
|
-
import DownIcon from '@atlaskit/icon/utility/migration/chevron-down';
|
|
14
|
-
import CrossIcon from '@atlaskit/icon/utility/migration/cross-circle--select-clear';
|
|
15
|
-
import { Inline, Pressable, xcss } from '@atlaskit/primitives';
|
|
16
|
-
import Spinner from '@atlaskit/spinner';
|
|
17
|
-
import { getStyleProps } from '../utils';
|
|
18
|
-
|
|
19
|
-
// ==============================
|
|
20
|
-
// Dropdown & Clear Icons
|
|
21
|
-
// ==============================
|
|
22
|
-
|
|
23
|
-
var iconContainerStyles = xcss({
|
|
24
|
-
all: 'unset',
|
|
25
|
-
outline: 'revert',
|
|
26
|
-
display: 'flex',
|
|
27
|
-
alignItems: 'center',
|
|
28
|
-
justifyContent: 'center',
|
|
29
|
-
padding: 'space.025'
|
|
30
|
-
});
|
|
31
|
-
var dropdownWrapperStyles = xcss({
|
|
32
|
-
padding: 'space.075'
|
|
33
|
-
});
|
|
1
|
+
/* eslint-disable @repo/internal/react/no-unsafe-spread-props */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
import { ClearIndicator as CompiledClearIndicator, clearIndicatorCSS as compiledClearIndicatorCSS, DropdownIndicator as CompiledDropdownIndicator, dropdownIndicatorCSS as compiledDropdownIndicatorCSS, LoadingIndicator as CompiledLoadingIndicator, loadingIndicatorCSS as compiledLoadingIndicatorCSS } from '../compiled/components/indicators';
|
|
5
|
+
import { ClearIndicator as EmotionClearIndicator, clearIndicatorCSS as emotionClearIndicatorCSS, DropdownIndicator as EmotionDropdownIndicator, dropdownIndicatorCSS as emotionDropdownIndicatorCSS, LoadingIndicator as EmotionLoadingIndicator, loadingIndicatorCSS as emotionLoadingIndicatorCSS } from '../emotion/components/indicators';
|
|
34
6
|
|
|
35
7
|
// ==============================
|
|
36
8
|
// Dropdown & Clear Buttons
|
|
37
9
|
// ==============================
|
|
38
10
|
|
|
39
|
-
export var dropdownIndicatorCSS = function dropdownIndicatorCSS(
|
|
40
|
-
|
|
41
|
-
isDisabled = _ref.isDisabled;
|
|
42
|
-
return {
|
|
43
|
-
label: 'indicatorContainer',
|
|
44
|
-
display: 'flex',
|
|
45
|
-
transition: 'color 150ms',
|
|
46
|
-
color: isDisabled ? "var(--ds-text-disabled, #091E424F)" : "var(--ds-text-subtle, #44546F)",
|
|
47
|
-
padding: "".concat(isCompact ? 0 : "var(--ds-space-075, 6px)", " ", "var(--ds-space-025, 2px)"),
|
|
48
|
-
':hover': {
|
|
49
|
-
color: "var(--ds-text-subtle, #44546F)"
|
|
50
|
-
}
|
|
51
|
-
};
|
|
11
|
+
export var dropdownIndicatorCSS = function dropdownIndicatorCSS(props) {
|
|
12
|
+
return fg('compiled-react-select') ? compiledDropdownIndicatorCSS() : emotionDropdownIndicatorCSS(props);
|
|
52
13
|
};
|
|
53
14
|
|
|
54
15
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
55
16
|
export var DropdownIndicator = function DropdownIndicator(props) {
|
|
56
|
-
|
|
57
|
-
children = props.children;
|
|
58
|
-
return jsx("div", _extends({}, getStyleProps(props, 'dropdownIndicator', {
|
|
59
|
-
indicator: true,
|
|
60
|
-
'dropdown-indicator': true
|
|
61
|
-
}), innerProps), children ? children : jsx(Inline, {
|
|
62
|
-
as: "span",
|
|
63
|
-
xcss: dropdownWrapperStyles
|
|
64
|
-
}, jsx(DownIcon, {
|
|
65
|
-
color: "currentColor",
|
|
66
|
-
label: "open",
|
|
67
|
-
LEGACY_margin: "var(--ds-space-negative-075, -0.375rem)"
|
|
68
|
-
})));
|
|
17
|
+
return fg('compiled-react-select') ? /*#__PURE__*/React.createElement(CompiledDropdownIndicator, props) : /*#__PURE__*/React.createElement(EmotionDropdownIndicator, props);
|
|
69
18
|
};
|
|
70
|
-
export var clearIndicatorCSS = function clearIndicatorCSS(
|
|
71
|
-
|
|
72
|
-
return {
|
|
73
|
-
label: 'indicatorContainer',
|
|
74
|
-
display: 'flex',
|
|
75
|
-
transition: 'color 150ms',
|
|
76
|
-
color: "var(--ds-text-subtlest, #626F86)",
|
|
77
|
-
padding: "".concat(isCompact ? 0 : "var(--ds-space-075, 6px)", " ", "var(--ds-space-025, 2px)"),
|
|
78
|
-
':hover': {
|
|
79
|
-
color: "var(--ds-text-subtle, #44546F)"
|
|
80
|
-
}
|
|
81
|
-
};
|
|
19
|
+
export var clearIndicatorCSS = function clearIndicatorCSS(props) {
|
|
20
|
+
return fg('compiled-react-select') ? compiledClearIndicatorCSS() : emotionClearIndicatorCSS(props);
|
|
82
21
|
};
|
|
83
22
|
|
|
84
23
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
85
24
|
export var ClearIndicator = function ClearIndicator(props) {
|
|
86
|
-
|
|
87
|
-
_props$clearControlLa = props.clearControlLabel,
|
|
88
|
-
clearControlLabel = _props$clearControlLa === void 0 ? 'clear' : _props$clearControlLa;
|
|
89
|
-
return jsx("div", _extends({}, getStyleProps(props, 'clearIndicator', {
|
|
90
|
-
indicator: true,
|
|
91
|
-
'clear-indicator': true
|
|
92
|
-
}), innerProps), jsx(Pressable, {
|
|
93
|
-
xcss: iconContainerStyles,
|
|
94
|
-
tabIndex: -1,
|
|
95
|
-
"aria-label": clearControlLabel
|
|
96
|
-
}, jsx(CrossIcon, {
|
|
97
|
-
label: "",
|
|
98
|
-
color: "currentColor",
|
|
99
|
-
LEGACY_size: "small",
|
|
100
|
-
LEGACY_margin: "var(--ds-space-negative-025, -0.125rem)"
|
|
101
|
-
})));
|
|
25
|
+
return fg('compiled-react-select') ? /*#__PURE__*/React.createElement(CompiledClearIndicator, props) : /*#__PURE__*/React.createElement(EmotionClearIndicator, props);
|
|
102
26
|
};
|
|
103
27
|
|
|
104
28
|
// ==============================
|
|
105
29
|
// Loading
|
|
106
30
|
// ==============================
|
|
107
31
|
|
|
108
|
-
export var loadingIndicatorCSS = function loadingIndicatorCSS(
|
|
109
|
-
|
|
110
|
-
return {
|
|
111
|
-
label: 'loadingIndicator',
|
|
112
|
-
padding: "".concat(isCompact ? 0 : "var(--ds-space-075, 6px)", " ", "var(--ds-space-100, 8px)")
|
|
113
|
-
};
|
|
32
|
+
export var loadingIndicatorCSS = function loadingIndicatorCSS(props) {
|
|
33
|
+
return fg('compiled-react-select') ? compiledLoadingIndicatorCSS() : emotionLoadingIndicatorCSS(props);
|
|
114
34
|
};
|
|
115
35
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
116
|
-
export var LoadingIndicator = function LoadingIndicator(
|
|
117
|
-
|
|
118
|
-
isRtl = _ref4.isRtl,
|
|
119
|
-
_ref4$size = _ref4.size,
|
|
120
|
-
size = _ref4$size === void 0 ? 4 : _ref4$size,
|
|
121
|
-
restProps = _objectWithoutProperties(_ref4, _excluded);
|
|
122
|
-
return jsx("div", _extends({}, getStyleProps(_objectSpread(_objectSpread({}, restProps), {}, {
|
|
123
|
-
innerProps: innerProps,
|
|
124
|
-
isRtl: isRtl,
|
|
125
|
-
size: size
|
|
126
|
-
}), 'loadingIndicator', {
|
|
127
|
-
indicator: true,
|
|
128
|
-
'loading-indicator': true
|
|
129
|
-
}), innerProps), jsx(Spinner, {
|
|
130
|
-
size: "small"
|
|
131
|
-
}));
|
|
36
|
+
export var LoadingIndicator = function LoadingIndicator(props) {
|
|
37
|
+
return fg('compiled-react-select') ? /*#__PURE__*/React.createElement(CompiledLoadingIndicator, props) : /*#__PURE__*/React.createElement(EmotionLoadingIndicator, props);
|
|
132
38
|
};
|
|
@@ -1,88 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* @jsxRuntime classic
|
|
9
|
-
* @jsx jsx
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { jsx } from '@emotion/react';
|
|
13
|
-
import { cleanCommonProps, getStyleProps } from '../utils';
|
|
14
|
-
export var inputCSS = function inputCSS(_ref) {
|
|
15
|
-
var isDisabled = _ref.isDisabled,
|
|
16
|
-
value = _ref.value;
|
|
17
|
-
return _objectSpread(_objectSpread({
|
|
18
|
-
visibility: isDisabled ? 'hidden' : 'visible',
|
|
19
|
-
// force css to recompute when value change due to @emotion bug.
|
|
20
|
-
// We can remove it whenever the bug is fixed.
|
|
21
|
-
transform: value ? 'translateZ(0)' : ''
|
|
22
|
-
}, containerStyle), {}, {
|
|
23
|
-
margin: "var(--ds-space-025, 2px)",
|
|
24
|
-
paddingBottom: "var(--ds-space-025, 2px)",
|
|
25
|
-
paddingTop: "var(--ds-space-025, 2px)",
|
|
26
|
-
color: "var(--ds-text, #172B4D)"
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
var spacingStyle = {
|
|
30
|
-
gridArea: '1 / 2',
|
|
31
|
-
font: 'inherit',
|
|
32
|
-
minWidth: '2px',
|
|
33
|
-
border: 0,
|
|
34
|
-
margin: 0,
|
|
35
|
-
outline: 0,
|
|
36
|
-
padding: 0
|
|
37
|
-
};
|
|
38
|
-
var containerStyle = {
|
|
39
|
-
flex: '1 1 auto',
|
|
40
|
-
display: 'inline-grid',
|
|
41
|
-
gridArea: '1 / 1 / 2 / 3',
|
|
42
|
-
gridTemplateColumns: '0 min-content',
|
|
43
|
-
'&:after': _objectSpread({
|
|
44
|
-
content: 'attr(data-value) " "',
|
|
45
|
-
visibility: 'hidden',
|
|
46
|
-
whiteSpace: 'pre'
|
|
47
|
-
}, spacingStyle)
|
|
48
|
-
};
|
|
49
|
-
var inputStyle = function inputStyle(isHidden) {
|
|
50
|
-
return _objectSpread({
|
|
51
|
-
label: 'input',
|
|
52
|
-
color: 'inherit',
|
|
53
|
-
background: 0,
|
|
54
|
-
opacity: isHidden ? 0 : 1,
|
|
55
|
-
width: '100%'
|
|
56
|
-
}, spacingStyle);
|
|
1
|
+
/* eslint-disable @repo/internal/react/no-unsafe-spread-props */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
import Compiled, { inputCSS as compiledInputCSS } from '../compiled/components/input';
|
|
5
|
+
import Emotion, { inputCSS as emotionInputCSS } from '../emotion/components/input';
|
|
6
|
+
export var inputCSS = function inputCSS(props) {
|
|
7
|
+
return fg('compiled-react-select') ? compiledInputCSS() : emotionInputCSS(props);
|
|
57
8
|
};
|
|
58
9
|
var Input = function Input(props) {
|
|
59
|
-
|
|
60
|
-
value = props.value;
|
|
61
|
-
var _cleanCommonProps = cleanCommonProps(props),
|
|
62
|
-
innerRef = _cleanCommonProps.innerRef,
|
|
63
|
-
isDisabled = _cleanCommonProps.isDisabled,
|
|
64
|
-
isHidden = _cleanCommonProps.isHidden,
|
|
65
|
-
inputClassName = _cleanCommonProps.inputClassName,
|
|
66
|
-
testId = _cleanCommonProps.testId,
|
|
67
|
-
innerProps = _objectWithoutProperties(_cleanCommonProps, _excluded);
|
|
68
|
-
var dataId = testId ? "".concat(testId, "-select--input") : null;
|
|
69
|
-
return jsx("div", _extends({}, getStyleProps(props, 'input', {
|
|
70
|
-
'input-container': true
|
|
71
|
-
}), {
|
|
72
|
-
"data-value": value || '',
|
|
73
|
-
"data-testid": dataId && "".concat(dataId, "-container")
|
|
74
|
-
}), jsx("input", _extends({
|
|
75
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
76
|
-
className: cx({
|
|
77
|
-
input: true
|
|
78
|
-
}, inputClassName),
|
|
79
|
-
ref: innerRef
|
|
80
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
81
|
-
,
|
|
82
|
-
style: inputStyle(isHidden),
|
|
83
|
-
disabled: isDisabled,
|
|
84
|
-
"data-testid": dataId
|
|
85
|
-
}, innerProps)));
|
|
10
|
+
return fg('compiled-react-select') ? /*#__PURE__*/React.createElement(Compiled, props) : /*#__PURE__*/React.createElement(Emotion, props);
|
|
86
11
|
};
|
|
87
12
|
|
|
88
13
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
@@ -1,29 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { css, jsx } from '@emotion/react';
|
|
7
|
-
|
|
8
|
-
// Assistive text to describe visual elements. Hidden for sighted users.
|
|
9
|
-
var styles = css({
|
|
10
|
-
width: 1,
|
|
11
|
-
height: 1,
|
|
12
|
-
padding: 0,
|
|
13
|
-
position: 'absolute',
|
|
14
|
-
zIndex: 9999,
|
|
15
|
-
border: 0,
|
|
16
|
-
clip: 'rect(1px, 1px, 1px, 1px)',
|
|
17
|
-
label: 'a11yText',
|
|
18
|
-
overflow: 'hidden',
|
|
19
|
-
userSelect: 'none',
|
|
20
|
-
// while hidden text is sitting in the DOM, it should not be selectable
|
|
21
|
-
whiteSpace: 'nowrap'
|
|
22
|
-
});
|
|
1
|
+
/* eslint-disable @repo/internal/react/no-unsafe-spread-props */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
import Compiled from '../../compiled/components/internal/a11y-text';
|
|
5
|
+
import Emotion from '../../emotion/components/internal/a11y-text';
|
|
23
6
|
var A11yText = function A11yText(props) {
|
|
24
|
-
return
|
|
25
|
-
css: styles
|
|
26
|
-
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
27
|
-
}, props));
|
|
7
|
+
return fg('compiled-react-select') ? /*#__PURE__*/React.createElement(Compiled, props) : /*#__PURE__*/React.createElement(Emotion, props);
|
|
28
8
|
};
|
|
29
9
|
export default A11yText;
|
|
@@ -1,38 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { css, jsx } from '@emotion/react';
|
|
10
|
-
import { removeProps } from '../../utils';
|
|
11
|
-
var dummyInputStyles = css({
|
|
12
|
-
width: 1,
|
|
13
|
-
padding: 0,
|
|
14
|
-
position: 'relative',
|
|
15
|
-
background: 0,
|
|
16
|
-
border: 0,
|
|
17
|
-
caretColor: 'transparent',
|
|
18
|
-
color: 'transparent',
|
|
19
|
-
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
20
|
-
fontSize: 'inherit',
|
|
21
|
-
gridArea: '1 / 1 / 2 / 3',
|
|
22
|
-
insetInlineStart: -100,
|
|
23
|
-
label: 'dummyInput',
|
|
24
|
-
opacity: 0,
|
|
25
|
-
outline: 0,
|
|
26
|
-
transform: 'scale(.01)'
|
|
27
|
-
});
|
|
28
|
-
export default function DummyInput(_ref) {
|
|
29
|
-
var innerRef = _ref.innerRef,
|
|
30
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
31
|
-
// Remove animation props not meant for HTML elements
|
|
32
|
-
var filteredProps = removeProps(props, 'onExited', 'in', 'enter', 'exit', 'appear');
|
|
33
|
-
return jsx("input", _extends({
|
|
34
|
-
ref: innerRef
|
|
35
|
-
}, filteredProps, {
|
|
36
|
-
css: dummyInputStyles
|
|
37
|
-
}));
|
|
1
|
+
/* eslint-disable @repo/internal/react/no-unsafe-spread-props */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
import Compiled from '../../compiled/components/internal/dummy-input';
|
|
5
|
+
import Emotion from '../../emotion/components/internal/dummy-input';
|
|
6
|
+
export default function DummyInput(props) {
|
|
7
|
+
return fg('compiled-react-select') ? /*#__PURE__*/React.createElement(Compiled, props) : /*#__PURE__*/React.createElement(Emotion, props);
|
|
38
8
|
}
|
|
@@ -7,6 +7,7 @@ import { useNotifyOpenLayerObserver } from '@atlaskit/layering/experimental/open
|
|
|
7
7
|
export function NotifyOpenLayerObserver(_ref) {
|
|
8
8
|
var isOpen = _ref.isOpen,
|
|
9
9
|
onClose = _ref.onClose;
|
|
10
|
+
// @ts-ignore - hot-116676
|
|
10
11
|
useNotifyOpenLayerObserver({
|
|
11
12
|
isOpen: isOpen,
|
|
12
13
|
onClose: onClose
|
|
@@ -1,35 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var styles = css({
|
|
9
|
-
width: '100%',
|
|
10
|
-
position: 'absolute',
|
|
11
|
-
insetBlockEnd: 0,
|
|
12
|
-
insetInlineEnd: 0,
|
|
13
|
-
insetInlineStart: 0,
|
|
14
|
-
label: 'requiredInput',
|
|
15
|
-
opacity: 0,
|
|
16
|
-
pointerEvents: 'none'
|
|
17
|
-
});
|
|
18
|
-
var RequiredInput = function RequiredInput(_ref) {
|
|
19
|
-
var name = _ref.name,
|
|
20
|
-
onFocus = _ref.onFocus;
|
|
21
|
-
return jsx("input", {
|
|
22
|
-
required: true,
|
|
23
|
-
name: name,
|
|
24
|
-
tabIndex: -1,
|
|
25
|
-
"aria-hidden": "true",
|
|
26
|
-
onFocus: onFocus,
|
|
27
|
-
css: styles
|
|
28
|
-
// Prevent `Switching from uncontrolled to controlled` error
|
|
29
|
-
,
|
|
30
|
-
value: "",
|
|
31
|
-
onChange: __noop
|
|
32
|
-
});
|
|
1
|
+
/* eslint-disable @repo/internal/react/no-unsafe-spread-props */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
import Compiled from '../../compiled/components/internal/required-input';
|
|
5
|
+
import Emotion from '../../emotion/components/internal/required-input';
|
|
6
|
+
var RequiredInput = function RequiredInput(props) {
|
|
7
|
+
return fg('compiled-react-select') ? /*#__PURE__*/React.createElement(Compiled, props) : /*#__PURE__*/React.createElement(Emotion, props);
|
|
33
8
|
};
|
|
34
9
|
|
|
35
10
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
@@ -1,18 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import { Fragment } from 'react';
|
|
6
|
-
import { css, jsx } from '@emotion/react';
|
|
1
|
+
import React, { Fragment } from 'react';
|
|
7
2
|
import useScrollCapture from './use-scroll-capture';
|
|
8
3
|
import useScrollLock from './use-scroll-lock';
|
|
9
|
-
var styles = css({
|
|
10
|
-
position: 'fixed',
|
|
11
|
-
insetBlockEnd: 0,
|
|
12
|
-
insetBlockStart: 0,
|
|
13
|
-
insetInlineEnd: 0,
|
|
14
|
-
insetInlineStart: 0
|
|
15
|
-
});
|
|
16
4
|
var blurSelectInput = function blurSelectInput(event) {
|
|
17
5
|
var element = event.target;
|
|
18
6
|
return element.ownerDocument.activeElement && element.ownerDocument.activeElement.blur();
|
|
@@ -40,10 +28,22 @@ export default function ScrollManager(_ref) {
|
|
|
40
28
|
setScrollCaptureTarget(element);
|
|
41
29
|
setScrollLockTarget(element);
|
|
42
30
|
};
|
|
43
|
-
return
|
|
31
|
+
return /*#__PURE__*/React.createElement(Fragment, null, lockEnabled &&
|
|
32
|
+
/*#__PURE__*/
|
|
44
33
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
45
|
-
|
|
34
|
+
React.createElement("div", {
|
|
46
35
|
onClick: blurSelectInput,
|
|
47
|
-
|
|
36
|
+
style: {
|
|
37
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
38
|
+
position: 'fixed',
|
|
39
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
40
|
+
insetBlockEnd: 0,
|
|
41
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
42
|
+
insetBlockStart: 0,
|
|
43
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
44
|
+
insetInlineEnd: 0,
|
|
45
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
46
|
+
insetInlineStart: 0
|
|
47
|
+
}
|
|
48
48
|
}), children(targetRef));
|
|
49
49
|
}
|
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
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; }
|
|
4
|
-
/* eslint-disable @atlaskit/platform/ensure-feature-flag-prefix */
|
|
5
|
-
/**
|
|
6
|
-
* @jsxRuntime classic
|
|
7
|
-
* @jsx jsx
|
|
8
|
-
* @jsxFrag React.Fragment
|
|
9
|
-
*/
|
|
10
|
-
import React, { Fragment, useMemo, useRef } from 'react';
|
|
11
|
-
import { jsx } from '@emotion/react';
|
|
1
|
+
/* eslint-disable @repo/internal/react/no-unsafe-spread-props */
|
|
2
|
+
import React from 'react';
|
|
12
3
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
|
-
import
|
|
14
|
-
import
|
|
4
|
+
import Compiled from '../compiled/components/live-region';
|
|
5
|
+
import Emotion from '../emotion/components/live-region';
|
|
15
6
|
|
|
16
7
|
// ==============================
|
|
17
8
|
// Root Container
|
|
@@ -19,156 +10,7 @@ import A11yText from './internal/a11y-text';
|
|
|
19
10
|
|
|
20
11
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
21
12
|
var LiveRegion = function LiveRegion(props) {
|
|
22
|
-
|
|
23
|
-
focusedOption = props.focusedOption,
|
|
24
|
-
focusedValue = props.focusedValue,
|
|
25
|
-
focusableOptions = props.focusableOptions,
|
|
26
|
-
isFocused = props.isFocused,
|
|
27
|
-
selectValue = props.selectValue,
|
|
28
|
-
selectProps = props.selectProps,
|
|
29
|
-
id = props.id,
|
|
30
|
-
isAppleDevice = props.isAppleDevice;
|
|
31
|
-
var ariaLiveMessages = selectProps.ariaLiveMessages,
|
|
32
|
-
getOptionLabel = selectProps.getOptionLabel,
|
|
33
|
-
inputValue = selectProps.inputValue,
|
|
34
|
-
isMulti = selectProps.isMulti,
|
|
35
|
-
isOptionDisabled = selectProps.isOptionDisabled,
|
|
36
|
-
isSearchable = selectProps.isSearchable,
|
|
37
|
-
label = selectProps.label,
|
|
38
|
-
menuIsOpen = selectProps.menuIsOpen,
|
|
39
|
-
options = selectProps.options,
|
|
40
|
-
screenReaderStatus = selectProps.screenReaderStatus,
|
|
41
|
-
tabSelectsValue = selectProps.tabSelectsValue,
|
|
42
|
-
isLoading = selectProps.isLoading;
|
|
43
|
-
var ariaLabel = selectProps['aria-label'] || label;
|
|
44
|
-
var ariaLive = selectProps['aria-live'];
|
|
45
|
-
|
|
46
|
-
// for safari, we will use minimum support from aria-live region
|
|
47
|
-
var isA11yImprovementEnabled = fg('design_system_select-a11y-improvement') && !isAppleDevice;
|
|
48
|
-
|
|
49
|
-
// Update aria live message configuration when prop changes
|
|
50
|
-
var messages = useMemo(function () {
|
|
51
|
-
return _objectSpread(_objectSpread({}, defaultAriaLiveMessages), ariaLiveMessages || {});
|
|
52
|
-
}, [ariaLiveMessages]);
|
|
53
|
-
|
|
54
|
-
// Update aria live selected option when prop changes
|
|
55
|
-
var ariaSelected = useMemo(function () {
|
|
56
|
-
var message = '';
|
|
57
|
-
if (isA11yImprovementEnabled && menuIsOpen) {
|
|
58
|
-
// we don't need to have selected message when the menu is open
|
|
59
|
-
return '';
|
|
60
|
-
}
|
|
61
|
-
if (ariaSelection && messages.onChange) {
|
|
62
|
-
var option = ariaSelection.option,
|
|
63
|
-
selectedOptions = ariaSelection.options,
|
|
64
|
-
removedValue = ariaSelection.removedValue,
|
|
65
|
-
removedValues = ariaSelection.removedValues,
|
|
66
|
-
value = ariaSelection.value;
|
|
67
|
-
// select-option when !isMulti does not return option so we assume selected option is value
|
|
68
|
-
var asOption = function asOption(val) {
|
|
69
|
-
return !Array.isArray(val) ? val : null;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
// If there is just one item from the action then get its label
|
|
73
|
-
var selected = removedValue || option || asOption(value);
|
|
74
|
-
var _label = selected ? getOptionLabel(selected) : '';
|
|
75
|
-
|
|
76
|
-
// If there are multiple items from the action then return an array of labels
|
|
77
|
-
var multiSelected = selectedOptions || removedValues || undefined;
|
|
78
|
-
var labels = multiSelected ? multiSelected.map(getOptionLabel) : [];
|
|
79
|
-
if (isA11yImprovementEnabled && !_label && !labels.length) {
|
|
80
|
-
// return empty string if no labels provided
|
|
81
|
-
return '';
|
|
82
|
-
}
|
|
83
|
-
var onChangeProps = _objectSpread({
|
|
84
|
-
// multiSelected items are usually items that have already been selected
|
|
85
|
-
// or set by the user as a default value so we assume they are not disabled
|
|
86
|
-
isDisabled: selected && isOptionDisabled(selected, selectValue),
|
|
87
|
-
label: _label,
|
|
88
|
-
labels: labels
|
|
89
|
-
}, ariaSelection);
|
|
90
|
-
message = messages.onChange(onChangeProps);
|
|
91
|
-
}
|
|
92
|
-
return message;
|
|
93
|
-
}, [ariaSelection, messages, isOptionDisabled, selectValue, getOptionLabel, isA11yImprovementEnabled, menuIsOpen]);
|
|
94
|
-
var prevInputValue = useRef('');
|
|
95
|
-
var ariaFocused = useMemo(function () {
|
|
96
|
-
var focusMsg = '';
|
|
97
|
-
var focused = focusedOption || focusedValue;
|
|
98
|
-
var isSelected = !!(focusedOption && selectValue && selectValue.includes(focusedOption));
|
|
99
|
-
if (inputValue === prevInputValue.current && isA11yImprovementEnabled) {
|
|
100
|
-
// only announce focus option when searching when ff is on and the input value changed
|
|
101
|
-
// for safari, we will announce for all
|
|
102
|
-
return '';
|
|
103
|
-
}
|
|
104
|
-
if (focused && messages.onFocus) {
|
|
105
|
-
var onFocusProps = {
|
|
106
|
-
focused: focused,
|
|
107
|
-
label: getOptionLabel(focused),
|
|
108
|
-
isDisabled: isOptionDisabled(focused, selectValue),
|
|
109
|
-
isSelected: isSelected,
|
|
110
|
-
options: focusableOptions,
|
|
111
|
-
context: focused === focusedOption ? 'menu' : 'value',
|
|
112
|
-
selectValue: selectValue,
|
|
113
|
-
isMulti: isMulti
|
|
114
|
-
};
|
|
115
|
-
focusMsg = messages.onFocus(onFocusProps);
|
|
116
|
-
}
|
|
117
|
-
prevInputValue.current = inputValue;
|
|
118
|
-
return focusMsg;
|
|
119
|
-
}, [inputValue, focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue, isA11yImprovementEnabled, isMulti]);
|
|
120
|
-
var ariaResults = useMemo(function () {
|
|
121
|
-
var resultsMsg = '';
|
|
122
|
-
if (menuIsOpen && options.length && !isLoading && messages.onFilter) {
|
|
123
|
-
var resultsMessage = screenReaderStatus({
|
|
124
|
-
count: focusableOptions.length
|
|
125
|
-
});
|
|
126
|
-
resultsMsg = messages.onFilter({
|
|
127
|
-
inputValue: inputValue,
|
|
128
|
-
resultsMessage: resultsMessage
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
return resultsMsg;
|
|
132
|
-
}, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus, isLoading]);
|
|
133
|
-
var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
|
|
134
|
-
var ariaGuidance = useMemo(function () {
|
|
135
|
-
if (fg('design_system_select-a11y-improvement')) {
|
|
136
|
-
// don't announce guidance at all when ff is on
|
|
137
|
-
return '';
|
|
138
|
-
}
|
|
139
|
-
var guidanceMsg = '';
|
|
140
|
-
if (messages.guidance) {
|
|
141
|
-
var context = focusedValue ? 'value' : menuIsOpen ? 'menu' : 'input';
|
|
142
|
-
guidanceMsg = messages.guidance({
|
|
143
|
-
'aria-label': ariaLabel,
|
|
144
|
-
context: context,
|
|
145
|
-
isDisabled: focusedOption && isOptionDisabled(focusedOption, selectValue),
|
|
146
|
-
isMulti: isMulti,
|
|
147
|
-
isSearchable: isSearchable,
|
|
148
|
-
tabSelectsValue: tabSelectsValue,
|
|
149
|
-
isInitialFocus: isInitialFocus
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
return guidanceMsg;
|
|
153
|
-
}, [ariaLabel, focusedOption, focusedValue, isMulti, isOptionDisabled, isSearchable, menuIsOpen, messages, selectValue, tabSelectsValue, isInitialFocus]);
|
|
154
|
-
var ScreenReaderText = jsx(Fragment, null, jsx("span", {
|
|
155
|
-
id: "aria-selection"
|
|
156
|
-
}, ariaSelected), jsx("span", {
|
|
157
|
-
id: "aria-results"
|
|
158
|
-
}, ariaResults), !fg('design_system_select-a11y-improvement') && jsx(React.Fragment, null, jsx("span", {
|
|
159
|
-
id: "aria-focused"
|
|
160
|
-
}, ariaFocused), jsx("span", {
|
|
161
|
-
id: "aria-guidance"
|
|
162
|
-
}, ariaGuidance)));
|
|
163
|
-
return jsx(Fragment, null, jsx(A11yText, {
|
|
164
|
-
id: id
|
|
165
|
-
}, isInitialFocus && ScreenReaderText), jsx(A11yText, {
|
|
166
|
-
"aria-live": ariaLive // Should be undefined by default unless a specific use case requires it
|
|
167
|
-
,
|
|
168
|
-
"aria-atomic": fg('design_system_select-a11y-improvement') ? undefined : 'false',
|
|
169
|
-
"aria-relevant": fg('design_system_select-a11y-improvement') ? undefined : 'additions text',
|
|
170
|
-
role: fg('design_system_select-a11y-improvement') ? 'status' : 'log'
|
|
171
|
-
}, isFocused && !isInitialFocus && ScreenReaderText));
|
|
13
|
+
return fg('compiled-react-select') ? /*#__PURE__*/React.createElement(Compiled, props) : /*#__PURE__*/React.createElement(Emotion, props);
|
|
172
14
|
};
|
|
173
15
|
|
|
174
16
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|