@atlaskit/select 15.6.2 → 15.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/AsyncCreatableSelect/package.json +8 -1
- package/AsyncSelect/package.json +8 -1
- package/CHANGELOG.md +24 -0
- package/CheckboxSelect/package.json +8 -1
- package/CountrySelect/package.json +8 -1
- package/CreatableSelect/package.json +8 -1
- package/RadioSelect/package.json +8 -1
- package/Select/package.json +8 -1
- package/createSelect/package.json +8 -1
- package/dist/cjs/CountrySelect.js +8 -8
- package/dist/cjs/PopupSelect/PopupSelect.js +28 -24
- package/dist/cjs/PopupSelect/components.js +8 -8
- package/dist/cjs/Select.js +1 -1
- package/dist/cjs/components/index.js +14 -3
- package/dist/cjs/components/indicators.js +5 -5
- package/dist/cjs/components/input-options.js +44 -37
- package/dist/cjs/createSelect.js +4 -2
- package/dist/cjs/styles.js +4 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/CountrySelect.js +1 -1
- package/dist/es2019/PopupSelect/PopupSelect.js +21 -18
- package/dist/es2019/PopupSelect/components.js +1 -1
- package/dist/es2019/Select.js +1 -1
- package/dist/es2019/components/index.js +22 -7
- package/dist/es2019/components/indicators.js +1 -1
- package/dist/es2019/components/input-options.js +46 -39
- package/dist/es2019/createSelect.js +3 -1
- package/dist/es2019/styles.js +2 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/CountrySelect.js +1 -1
- package/dist/esm/PopupSelect/PopupSelect.js +28 -24
- package/dist/esm/PopupSelect/components.js +1 -1
- package/dist/esm/Select.js +1 -1
- package/dist/esm/components/index.js +14 -3
- package/dist/esm/components/indicators.js +1 -1
- package/dist/esm/components/input-options.js +40 -33
- package/dist/esm/createSelect.js +4 -2
- package/dist/esm/styles.js +4 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/AsyncCreatableSelect.d.ts +1 -0
- package/dist/types/AsyncSelect.d.ts +1 -0
- package/dist/types/CountrySelect.d.ts +3 -2
- package/dist/types/CreatableSelect.d.ts +1 -0
- package/dist/types/PopupSelect/PopupSelect.d.ts +16 -6
- package/dist/types/PopupSelect/components.d.ts +3 -2
- package/dist/types/Select.d.ts +2 -0
- package/dist/types/components/index.d.ts +3 -2
- package/dist/types/createSelect.d.ts +1 -0
- package/dist/types/styles.d.ts +1 -1
- package/dist/types/types.d.ts +1 -0
- package/dist/types-ts4.0/AsyncCreatableSelect.d.ts +45 -0
- package/dist/types-ts4.0/AsyncSelect.d.ts +45 -0
- package/dist/types-ts4.0/CheckboxSelect.d.ts +4 -0
- package/dist/types-ts4.0/CountrySelect.d.ts +7 -0
- package/dist/types-ts4.0/CreatableSelect.d.ts +45 -0
- package/dist/types-ts4.0/PopupSelect/PopupSelect.d.ts +140 -0
- package/dist/types-ts4.0/PopupSelect/components.d.ts +19 -0
- package/dist/types-ts4.0/PopupSelect/index.d.ts +2 -0
- package/dist/types-ts4.0/RadioSelect.d.ts +4 -0
- package/dist/types-ts4.0/Select.d.ts +89 -0
- package/dist/types-ts4.0/components/index.d.ts +5 -0
- package/dist/types-ts4.0/components/indicators.d.ts +5 -0
- package/dist/types-ts4.0/components/input-options.d.ts +4 -0
- package/dist/types-ts4.0/createSelect.d.ts +46 -0
- package/dist/types-ts4.0/data/countries.d.ts +19 -0
- package/dist/types-ts4.0/ert.d.ts +2 -0
- package/dist/types-ts4.0/index.d.ts +14 -0
- package/dist/types-ts4.0/styles.d.ts +2 -0
- package/dist/types-ts4.0/types.d.ts +45 -0
- package/ert/package.json +8 -1
- package/package.json +20 -13
- package/styles/package.json +8 -1
- package/types/package.json +8 -1
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/AsyncCreatableSelect.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/AsyncCreatableSelect.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/AsyncCreatableSelect.d.ts"
|
|
7
|
+
"types": "../dist/types/AsyncCreatableSelect.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/AsyncCreatableSelect.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
package/AsyncSelect/package.json
CHANGED
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/AsyncSelect.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/AsyncSelect.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/AsyncSelect.d.ts"
|
|
7
|
+
"types": "../dist/types/AsyncSelect.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/AsyncSelect.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @atlaskit/select
|
|
2
2
|
|
|
3
|
+
## 15.7.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
|
|
8
|
+
|
|
9
|
+
## 15.7.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`0fbb2840aba`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0fbb2840aba) - Add isInvalid prop to `@atlastkit/Select`. The prop indicates whether if the component is in the error state. If true, it visually shows a red border around the input.
|
|
14
|
+
|
|
15
|
+
This replaces validationState to make Select more consistent like other components that uses isInvalid prop.
|
|
16
|
+
|
|
17
|
+
- [`8cf1c311f38`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cf1c311f38) - Add additional type check for the modifier generic in PopupSelect.
|
|
18
|
+
- [`41ce212cfe2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41ce212cfe2) - Updates `@emotion/core` to `@emotion/react`; v10 to v11. There is no expected behavior change.
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- [`2d61e38e5d3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2d61e38e5d3) - [ux] Adds isSearchable option to Popup Select
|
|
23
|
+
- [`908a0f65b91`](https://bitbucket.org/atlassian/atlassian-frontend/commits/908a0f65b91) - [ux] Hides clear icon on selections in disabled multi-select
|
|
24
|
+
- [`de1b2769486`](https://bitbucket.org/atlassian/atlassian-frontend/commits/de1b2769486) - Update design tokens used for Select's borders, to new border.input tokens
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
|
|
3
27
|
## 15.6.2
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/CheckboxSelect.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/CheckboxSelect.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/CheckboxSelect.d.ts"
|
|
7
|
+
"types": "../dist/types/CheckboxSelect.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/CheckboxSelect.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/CountrySelect.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/CountrySelect.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/CountrySelect.d.ts"
|
|
7
|
+
"types": "../dist/types/CountrySelect.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/CountrySelect.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/CreatableSelect.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/CreatableSelect.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/CreatableSelect.d.ts"
|
|
7
|
+
"types": "../dist/types/CreatableSelect.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/CreatableSelect.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
package/RadioSelect/package.json
CHANGED
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/RadioSelect.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/RadioSelect.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/RadioSelect.d.ts"
|
|
7
|
+
"types": "../dist/types/RadioSelect.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/RadioSelect.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
package/Select/package.json
CHANGED
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/Select.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/Select.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/Select.d.ts"
|
|
7
|
+
"types": "../dist/types/Select.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/Select.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/createSelect.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/createSelect.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/createSelect.d.ts"
|
|
7
|
+
"types": "../dist/types/createSelect.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/createSelect.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
|
@@ -9,7 +9,7 @@ exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _react = require("@emotion/react");
|
|
13
13
|
|
|
14
14
|
var _countries = require("./data/countries");
|
|
15
15
|
|
|
@@ -17,12 +17,12 @@ var _Select = _interopRequireDefault(require("./Select"));
|
|
|
17
17
|
|
|
18
18
|
/** @jsx jsx */
|
|
19
19
|
// custom option renderer
|
|
20
|
-
var labelStyles = (0,
|
|
20
|
+
var labelStyles = (0, _react.css)({
|
|
21
21
|
alignItems: 'center',
|
|
22
22
|
display: 'flex',
|
|
23
23
|
lineHeight: 1.2
|
|
24
24
|
});
|
|
25
|
-
var flagStyles = (0,
|
|
25
|
+
var flagStyles = (0, _react.css)({
|
|
26
26
|
fontSize: '18px',
|
|
27
27
|
marginRight: '8px'
|
|
28
28
|
});
|
|
@@ -30,9 +30,9 @@ var flagStyles = (0, _core.css)({
|
|
|
30
30
|
var Opt = function Opt(_ref) {
|
|
31
31
|
var children = _ref.children,
|
|
32
32
|
icon = _ref.icon;
|
|
33
|
-
return (0,
|
|
33
|
+
return (0, _react.jsx)("div", {
|
|
34
34
|
css: labelStyles
|
|
35
|
-
}, (0,
|
|
35
|
+
}, (0, _react.jsx)("span", {
|
|
36
36
|
css: flagStyles
|
|
37
37
|
}, icon), children);
|
|
38
38
|
}; // return the country name; used for searching
|
|
@@ -52,7 +52,7 @@ var getOptionValue = function getOptionValue(opt) {
|
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
var controlLabel = function controlLabel(opt) {
|
|
55
|
-
return (0,
|
|
55
|
+
return (0, _react.jsx)(Opt, {
|
|
56
56
|
icon: opt.icon
|
|
57
57
|
}, opt.abbr.toUpperCase());
|
|
58
58
|
}; // the text node for an option
|
|
@@ -63,7 +63,7 @@ var optionLabel = function optionLabel(_ref3) {
|
|
|
63
63
|
code = _ref3.code,
|
|
64
64
|
icon = _ref3.icon,
|
|
65
65
|
name = _ref3.name;
|
|
66
|
-
return (0,
|
|
66
|
+
return (0, _react.jsx)(Opt, {
|
|
67
67
|
icon: icon
|
|
68
68
|
}, getOptionLabel({
|
|
69
69
|
abbr: abbr,
|
|
@@ -80,7 +80,7 @@ var formatOptionLabel = function formatOptionLabel(opt, _ref4) {
|
|
|
80
80
|
|
|
81
81
|
|
|
82
82
|
var CountrySelect = function CountrySelect(props) {
|
|
83
|
-
return (0,
|
|
83
|
+
return (0, _react.jsx)(_Select.default, (0, _extends2.default)({
|
|
84
84
|
isClearable: false,
|
|
85
85
|
formatOptionLabel: formatOptionLabel,
|
|
86
86
|
getOptionLabel: getOptionLabel,
|
|
@@ -76,22 +76,23 @@ var canUseDOM = function canUseDOM() {
|
|
|
76
76
|
// ==============================
|
|
77
77
|
// Class
|
|
78
78
|
// ==============================
|
|
79
|
+
var modifiers = [{
|
|
80
|
+
name: 'offset',
|
|
81
|
+
options: {
|
|
82
|
+
offset: [0, 8]
|
|
83
|
+
}
|
|
84
|
+
}, {
|
|
85
|
+
name: 'preventOverflow',
|
|
86
|
+
enabled: true,
|
|
87
|
+
options: {
|
|
88
|
+
padding: 5,
|
|
89
|
+
boundary: 'clippingParents',
|
|
90
|
+
altAxis: true,
|
|
91
|
+
altBoundary: true
|
|
92
|
+
}
|
|
93
|
+
}];
|
|
79
94
|
var defaultPopperProps = {
|
|
80
|
-
modifiers:
|
|
81
|
-
name: 'offset',
|
|
82
|
-
options: {
|
|
83
|
-
offset: [0, 8]
|
|
84
|
-
}
|
|
85
|
-
}, {
|
|
86
|
-
name: 'preventOverflow',
|
|
87
|
-
enabled: true,
|
|
88
|
-
options: {
|
|
89
|
-
padding: 5,
|
|
90
|
-
boundary: 'clippingParents',
|
|
91
|
-
altAxis: true,
|
|
92
|
-
altBoundary: true
|
|
93
|
-
}
|
|
94
|
-
}],
|
|
95
|
+
modifiers: modifiers,
|
|
95
96
|
placement: 'bottom-start'
|
|
96
97
|
};
|
|
97
98
|
|
|
@@ -121,7 +122,7 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
121
122
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "targetRef", null);
|
|
122
123
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "unbindWindowClick", null);
|
|
123
124
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "unbindWindowKeydown", null);
|
|
124
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "defaultStyles", (0, _reactSelect.mergeStyles)((0, _styles.default)(_this.props.validationState, _this.props.spacing === 'compact', 'default'), {
|
|
125
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "defaultStyles", (0, _reactSelect.mergeStyles)((0, _styles.default)(_this.props.validationState || (_this.props.isInvalid ? 'error' : 'default'), _this.props.spacing === 'compact', 'default'), {
|
|
125
126
|
groupHeading: function groupHeading(provided) {
|
|
126
127
|
return _objectSpread(_objectSpread({}, provided), {}, {
|
|
127
128
|
color: "var(--ds-text-subtlest, ".concat(_colors.N80, ")")
|
|
@@ -314,16 +315,18 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
|
|
|
314
315
|
return maxHeight;
|
|
315
316
|
});
|
|
316
317
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "showSearchControl", function () {
|
|
317
|
-
var
|
|
318
|
-
|
|
318
|
+
var _this$props3 = _this.props,
|
|
319
|
+
searchThreshold = _this$props3.searchThreshold,
|
|
320
|
+
isSearchable = _this$props3.isSearchable;
|
|
321
|
+
return isSearchable && _this.getItemCount() > searchThreshold;
|
|
319
322
|
});
|
|
320
323
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderSelect", function () {
|
|
321
|
-
var _this$
|
|
322
|
-
footer = _this$
|
|
323
|
-
maxMenuWidth = _this$
|
|
324
|
-
minMenuWidth = _this$
|
|
325
|
-
target = _this$
|
|
326
|
-
props = (0, _objectWithoutProperties2.default)(_this$
|
|
324
|
+
var _this$props4 = _this.props,
|
|
325
|
+
footer = _this$props4.footer,
|
|
326
|
+
maxMenuWidth = _this$props4.maxMenuWidth,
|
|
327
|
+
minMenuWidth = _this$props4.minMenuWidth,
|
|
328
|
+
target = _this$props4.target,
|
|
329
|
+
props = (0, _objectWithoutProperties2.default)(_this$props4, _excluded);
|
|
327
330
|
var _this$state = _this.state,
|
|
328
331
|
isOpen = _this$state.isOpen,
|
|
329
332
|
mergedComponents = _this$state.mergedComponents,
|
|
@@ -478,6 +481,7 @@ exports.default = PopupSelect;
|
|
|
478
481
|
maxMenuWidth: 440,
|
|
479
482
|
minMenuWidth: 220,
|
|
480
483
|
popperProps: {},
|
|
484
|
+
isSearchable: true,
|
|
481
485
|
searchThreshold: 5,
|
|
482
486
|
styles: {},
|
|
483
487
|
options: []
|
|
@@ -13,7 +13,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
13
13
|
|
|
14
14
|
var _reactSelect = require("react-select");
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _react = require("@emotion/react");
|
|
17
17
|
|
|
18
18
|
var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
|
|
19
19
|
|
|
@@ -32,7 +32,7 @@ var MenuDialog = function MenuDialog(_ref) {
|
|
|
32
32
|
children = _ref.children,
|
|
33
33
|
id = _ref.id,
|
|
34
34
|
style = _ref.style;
|
|
35
|
-
return (0,
|
|
35
|
+
return (0, _react.jsx)("div", {
|
|
36
36
|
css: {
|
|
37
37
|
backgroundColor: "var(--ds-surface-overlay, white)",
|
|
38
38
|
borderRadius: 4,
|
|
@@ -52,13 +52,13 @@ var MenuDialog = function MenuDialog(_ref) {
|
|
|
52
52
|
exports.MenuDialog = MenuDialog;
|
|
53
53
|
|
|
54
54
|
var DropdownIndicator = function DropdownIndicator() {
|
|
55
|
-
return (0,
|
|
55
|
+
return (0, _react.jsx)("div", {
|
|
56
56
|
css: {
|
|
57
57
|
marginRight: 2,
|
|
58
58
|
textAlign: 'center',
|
|
59
59
|
width: 32
|
|
60
60
|
}
|
|
61
|
-
}, (0,
|
|
61
|
+
}, (0, _react.jsx)(_search.default, {
|
|
62
62
|
label: "open"
|
|
63
63
|
}));
|
|
64
64
|
};
|
|
@@ -67,18 +67,18 @@ var Control = function Control(_ref2) {
|
|
|
67
67
|
var innerRef = _ref2.innerRef,
|
|
68
68
|
innerProps = _ref2.innerProps,
|
|
69
69
|
props = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
|
|
70
|
-
return (0,
|
|
70
|
+
return (0, _react.jsx)("div", {
|
|
71
71
|
ref: innerRef,
|
|
72
72
|
css: {
|
|
73
73
|
padding: '8px 8px 4px'
|
|
74
74
|
}
|
|
75
|
-
}, (0,
|
|
75
|
+
}, (0, _react.jsx)(_reactSelect.components.Control, (0, _extends2.default)({}, props, {
|
|
76
76
|
innerProps: innerProps
|
|
77
77
|
})));
|
|
78
78
|
};
|
|
79
79
|
|
|
80
80
|
var DummyControl = function DummyControl(props) {
|
|
81
|
-
return (0,
|
|
81
|
+
return (0, _react.jsx)(_visuallyHidden.default, null, (0, _react.jsx)(_reactSelect.components.Control, props));
|
|
82
82
|
}; // NOTE `props` intentionally omitted from `Fragment`
|
|
83
83
|
// eslint-disable-next-line
|
|
84
84
|
|
|
@@ -89,7 +89,7 @@ var Menu = function Menu(_ref3) {
|
|
|
89
89
|
var children = _ref3.children,
|
|
90
90
|
innerProps = _ref3.innerProps,
|
|
91
91
|
props = (0, _objectWithoutProperties2.default)(_ref3, _excluded2);
|
|
92
|
-
return (0,
|
|
92
|
+
return (0, _react.jsx)("div", innerProps, children);
|
|
93
93
|
};
|
|
94
94
|
|
|
95
95
|
var defaultComponents = {
|
package/dist/cjs/Select.js
CHANGED
|
@@ -14,7 +14,7 @@ var _analyticsNext = require("@atlaskit/analytics-next");
|
|
|
14
14
|
var _createSelect = _interopRequireDefault(require("./createSelect"));
|
|
15
15
|
|
|
16
16
|
var packageName = "@atlaskit/select";
|
|
17
|
-
var packageVersion = "15.
|
|
17
|
+
var packageVersion = "15.7.1";
|
|
18
18
|
var SelectWithoutAnalytics = (0, _createSelect.default)(_reactSelect.default);
|
|
19
19
|
exports.SelectWithoutAnalytics = SelectWithoutAnalytics;
|
|
20
20
|
var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
|
|
@@ -26,7 +26,9 @@ Object.defineProperty(exports, "LoadingIndicator", {
|
|
|
26
26
|
});
|
|
27
27
|
exports.MultiValueRemove = void 0;
|
|
28
28
|
|
|
29
|
-
var
|
|
29
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
30
|
+
|
|
31
|
+
var _react = require("@emotion/react");
|
|
30
32
|
|
|
31
33
|
var _reactSelect = require("react-select");
|
|
32
34
|
|
|
@@ -34,13 +36,22 @@ var _selectClear = _interopRequireDefault(require("@atlaskit/icon/glyph/select-c
|
|
|
34
36
|
|
|
35
37
|
var _indicators = require("./indicators");
|
|
36
38
|
|
|
39
|
+
var _templateObject, _templateObject2;
|
|
40
|
+
|
|
41
|
+
var disabledProps = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: none;\n"])));
|
|
42
|
+
var enabledProps = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: inherit;\n"])));
|
|
43
|
+
|
|
37
44
|
var MultiValueRemove = function MultiValueRemove(props) {
|
|
38
|
-
|
|
45
|
+
var isDisabled = props.selectProps.isDisabled;
|
|
46
|
+
return (0, _react.jsx)(_reactSelect.components.MultiValueRemove, props, (0, _react.jsx)("div", {
|
|
47
|
+
css: isDisabled ? disabledProps : enabledProps,
|
|
48
|
+
"data-testid": isDisabled ? 'hide-clear-icon' : 'show-clear-icon'
|
|
49
|
+
}, (0, _react.jsx)(_selectClear.default, {
|
|
39
50
|
label: "Clear",
|
|
40
51
|
size: "small",
|
|
41
52
|
primaryColor: "transparent",
|
|
42
53
|
secondaryColor: "inherit"
|
|
43
|
-
}));
|
|
54
|
+
})));
|
|
44
55
|
};
|
|
45
56
|
|
|
46
57
|
exports.MultiValueRemove = MultiValueRemove;
|
|
@@ -9,7 +9,7 @@ exports.LoadingIndicator = exports.DropdownIndicator = exports.ClearIndicator =
|
|
|
9
9
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _react = require("@emotion/react");
|
|
13
13
|
|
|
14
14
|
var _reactSelect = require("react-select");
|
|
15
15
|
|
|
@@ -21,7 +21,7 @@ var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-
|
|
|
21
21
|
|
|
22
22
|
/** @jsx jsx */
|
|
23
23
|
var ClearIndicator = function ClearIndicator(props) {
|
|
24
|
-
return (0,
|
|
24
|
+
return (0, _react.jsx)(_reactSelect.components.ClearIndicator, props, (0, _react.jsx)(_selectClear.default, {
|
|
25
25
|
size: "small",
|
|
26
26
|
label: "clear"
|
|
27
27
|
}));
|
|
@@ -30,7 +30,7 @@ var ClearIndicator = function ClearIndicator(props) {
|
|
|
30
30
|
exports.ClearIndicator = ClearIndicator;
|
|
31
31
|
|
|
32
32
|
var DropdownIndicator = function DropdownIndicator(props) {
|
|
33
|
-
return (0,
|
|
33
|
+
return (0, _react.jsx)(_reactSelect.components.DropdownIndicator, props, (0, _react.jsx)(_chevronDown.default, {
|
|
34
34
|
label: "open"
|
|
35
35
|
}));
|
|
36
36
|
};
|
|
@@ -38,9 +38,9 @@ var DropdownIndicator = function DropdownIndicator(props) {
|
|
|
38
38
|
exports.DropdownIndicator = DropdownIndicator;
|
|
39
39
|
|
|
40
40
|
var LoadingIndicator = function LoadingIndicator(props) {
|
|
41
|
-
return (0,
|
|
41
|
+
return (0, _react.jsx)("div", (0, _extends2.default)({
|
|
42
42
|
css: props.getStyles('loadingIndicator', props)
|
|
43
|
-
}, props.innerProps), (0,
|
|
43
|
+
}, props.innerProps), (0, _react.jsx)(_spinner.default, {
|
|
44
44
|
size: "small"
|
|
45
45
|
}));
|
|
46
46
|
};
|
|
@@ -27,9 +27,9 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
27
27
|
|
|
28
28
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _react = require("@emotion/react");
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _react2 = require("react");
|
|
33
33
|
|
|
34
34
|
var _radio = _interopRequireDefault(require("@atlaskit/icon/glyph/radio"));
|
|
35
35
|
|
|
@@ -196,12 +196,12 @@ var getBorderColor = function getBorderColor(_ref3) {
|
|
|
196
196
|
} else if (isFocused && isSelected) {
|
|
197
197
|
return "var(--ds-background-selected-bold-hovered, ".concat(_colors.B400, ")");
|
|
198
198
|
} else if (isFocused) {
|
|
199
|
-
return "var(--ds-border, ".concat(_colors.N100, ")");
|
|
199
|
+
return "var(--ds-border-input, ".concat(_colors.N100, ")");
|
|
200
200
|
} else if (isSelected) {
|
|
201
201
|
return "var(--ds-background-selected-bold, ".concat(_colors.B400, ")");
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
return "var(--ds-border, ".concat(_colors.N100, ")");
|
|
204
|
+
return "var(--ds-border-input, ".concat(_colors.N100, ")");
|
|
205
205
|
};
|
|
206
206
|
|
|
207
207
|
var ControlOption = /*#__PURE__*/function (_Component) {
|
|
@@ -264,44 +264,51 @@ var ControlOption = /*#__PURE__*/function (_Component) {
|
|
|
264
264
|
styles = _getPrimitiveStyles2[0],
|
|
265
265
|
classes = _getPrimitiveStyles2[1];
|
|
266
266
|
|
|
267
|
-
return (
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
267
|
+
return (
|
|
268
|
+
/**
|
|
269
|
+
* TODO Fix this type error
|
|
270
|
+
* @see https://product-fabric.atlassian.net/browse/DSP-6063
|
|
271
|
+
*/
|
|
272
|
+
// @ts-ignore
|
|
273
|
+
(0, _react.jsx)("div", (0, _extends2.default)({
|
|
274
|
+
css: styles,
|
|
275
|
+
className: classes,
|
|
276
|
+
ref: innerRef
|
|
277
|
+
}, props), (0, _react.jsx)("div", {
|
|
278
|
+
css: {
|
|
279
|
+
alignItems: 'center',
|
|
280
|
+
display: 'flex ',
|
|
281
|
+
flexShrink: 0,
|
|
282
|
+
paddingRight: '4px',
|
|
283
|
+
// Here we are adding a border to the Checkbox and Radio SVG icons
|
|
284
|
+
// This is an a11y fix for Select only for now but it may be rolled
|
|
285
|
+
// into the `@atlaskit/icon` package's Checkbox and Radio SVGs later
|
|
286
|
+
'& svg rect, & svg circle:first-of-type': {
|
|
287
|
+
stroke: getBorderColor(_objectSpread(_objectSpread({}, this.props), this.state)),
|
|
288
|
+
strokeWidth: '2px',
|
|
289
|
+
strokeLinejoin: 'round'
|
|
290
|
+
}
|
|
284
291
|
}
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
}
|
|
297
|
-
|
|
292
|
+
}, !!Icon ? (0, _react.jsx)(Icon, {
|
|
293
|
+
label: "",
|
|
294
|
+
primaryColor: getPrimaryColor(_objectSpread(_objectSpread({}, this.props), this.state)),
|
|
295
|
+
secondaryColor: getSecondaryColor(_objectSpread(_objectSpread({}, this.props), this.state))
|
|
296
|
+
}) : null), (0, _react.jsx)("div", {
|
|
297
|
+
css: {
|
|
298
|
+
textOverflow: 'ellipsis',
|
|
299
|
+
overflowX: 'hidden',
|
|
300
|
+
flexGrow: 1,
|
|
301
|
+
whiteSpace: 'nowrap'
|
|
302
|
+
}
|
|
303
|
+
}, children))
|
|
304
|
+
);
|
|
298
305
|
}
|
|
299
306
|
}]);
|
|
300
307
|
return ControlOption;
|
|
301
|
-
}(
|
|
308
|
+
}(_react2.Component);
|
|
302
309
|
|
|
303
310
|
var CheckboxOption = function CheckboxOption(props) {
|
|
304
|
-
return (0,
|
|
311
|
+
return (0, _react.jsx)(ControlOption, (0, _extends2.default)({
|
|
305
312
|
Icon: _checkbox.default
|
|
306
313
|
}, props));
|
|
307
314
|
};
|
|
@@ -309,7 +316,7 @@ var CheckboxOption = function CheckboxOption(props) {
|
|
|
309
316
|
exports.CheckboxOption = CheckboxOption;
|
|
310
317
|
|
|
311
318
|
var RadioOption = function RadioOption(props) {
|
|
312
|
-
return (0,
|
|
319
|
+
return (0, _react.jsx)(ControlOption, (0, _extends2.default)({
|
|
313
320
|
Icon: _radio.default
|
|
314
321
|
}, props));
|
|
315
322
|
};
|
package/dist/cjs/createSelect.js
CHANGED
|
@@ -41,7 +41,7 @@ var defaultComponents = _interopRequireWildcard(require("./components"));
|
|
|
41
41
|
|
|
42
42
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
43
43
|
|
|
44
|
-
var _excluded = ["styles", "validationState", "spacing", "isMulti", "appearance"];
|
|
44
|
+
var _excluded = ["styles", "validationState", "isInvalid", "spacing", "isMulti", "appearance"];
|
|
45
45
|
|
|
46
46
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
47
47
|
|
|
@@ -117,6 +117,7 @@ function createSelect(WrappedComponent) {
|
|
|
117
117
|
var _this$props = this.props,
|
|
118
118
|
styles = _this$props.styles,
|
|
119
119
|
validationState = _this$props.validationState,
|
|
120
|
+
isInvalid = _this$props.isInvalid,
|
|
120
121
|
spacing = _this$props.spacing,
|
|
121
122
|
isMulti = _this$props.isMulti,
|
|
122
123
|
appearance = _this$props.appearance,
|
|
@@ -129,13 +130,14 @@ function createSelect(WrappedComponent) {
|
|
|
129
130
|
"aria-live": "assertive"
|
|
130
131
|
}, props, {
|
|
131
132
|
components: this.components,
|
|
132
|
-
styles: (0, _reactSelect.mergeStyles)((0, _styles.default)(validationState, isCompact, this.props.appearance || 'default'), styles)
|
|
133
|
+
styles: (0, _reactSelect.mergeStyles)((0, _styles.default)(validationState || (isInvalid ? 'error' : 'default'), isCompact, this.props.appearance || 'default'), styles)
|
|
133
134
|
}));
|
|
134
135
|
}
|
|
135
136
|
}]);
|
|
136
137
|
return AtlaskitSelect;
|
|
137
138
|
}(_react.Component), (0, _defineProperty2.default)(_class, "defaultProps", {
|
|
138
139
|
validationState: 'default',
|
|
140
|
+
isInvalid: false,
|
|
139
141
|
spacing: 'default',
|
|
140
142
|
onClickPreventDefault: true,
|
|
141
143
|
tabSelectsValue: false,
|
package/dist/cjs/styles.js
CHANGED
|
@@ -21,7 +21,9 @@ var BORDER_WIDTH = 2;
|
|
|
21
21
|
var ICON_PADDING = 2;
|
|
22
22
|
var paddingExcludingBorder = (0, _constants.gridSize)() - BORDER_WIDTH;
|
|
23
23
|
|
|
24
|
-
function baseStyles(validationState
|
|
24
|
+
function baseStyles(validationState) {
|
|
25
|
+
var isCompact = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
26
|
+
var appearance = arguments.length > 2 ? arguments[2] : undefined;
|
|
25
27
|
return {
|
|
26
28
|
container: function container(css, _ref) {
|
|
27
29
|
var isDisabled = _ref.isDisabled;
|
|
@@ -58,7 +60,7 @@ function baseStyles(validationState, isCompact, appearance) {
|
|
|
58
60
|
borderColor = "var(--ds-border-success, ".concat(_colors.G400, ")");
|
|
59
61
|
}
|
|
60
62
|
|
|
61
|
-
var borderColorHover = isFocused ? "var(--ds-border-focused, ".concat(_colors.B100, ")") : "var(--ds-border, ".concat(_colors.N30, ")");
|
|
63
|
+
var borderColorHover = isFocused ? "var(--ds-border-focused, ".concat(_colors.B100, ")") : "var(--ds-border-input, ".concat(_colors.N30, ")");
|
|
62
64
|
|
|
63
65
|
if (validationState === 'error') {
|
|
64
66
|
borderColorHover = "var(--ds-border-danger, ".concat(_colors.R400, ")");
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
-
import { jsx, css } from '@emotion/
|
|
4
|
+
import { jsx, css } from '@emotion/react';
|
|
5
5
|
import { groupedCountries } from './data/countries';
|
|
6
6
|
import Select from './Select';
|
|
7
7
|
// custom option renderer
|