@atlaskit/select 16.1.0 → 16.1.2

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.
Files changed (66) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/AsyncCreatableSelect.js +0 -5
  3. package/dist/cjs/AsyncSelect.js +0 -5
  4. package/dist/cjs/CheckboxSelect.js +1 -15
  5. package/dist/cjs/CountrySelect.js +20 -29
  6. package/dist/cjs/CreatableSelect.js +0 -5
  7. package/dist/cjs/PopupSelect/PopupSelect.js +36 -113
  8. package/dist/cjs/PopupSelect/components.js +15 -31
  9. package/dist/cjs/PopupSelect/index.js +0 -2
  10. package/dist/cjs/RadioSelect.js +1 -13
  11. package/dist/cjs/Select.js +1 -8
  12. package/dist/cjs/components/index.js +0 -10
  13. package/dist/cjs/components/indicators.js +1 -13
  14. package/dist/cjs/components/input-options.js +43 -84
  15. package/dist/cjs/createSelect.js +12 -42
  16. package/dist/cjs/data/countries.js +3 -2
  17. package/dist/cjs/entry-points/async-creatable-select.js +0 -2
  18. package/dist/cjs/entry-points/async-select.js +0 -2
  19. package/dist/cjs/entry-points/creatable-select.js +0 -2
  20. package/dist/cjs/entry-points/select.js +0 -4
  21. package/dist/cjs/extract-react-types/ert.js +0 -1
  22. package/dist/cjs/extract-react-types/react-popper-props.js +1 -1
  23. package/dist/cjs/extract-react-types/react-select-async.js +1 -1
  24. package/dist/cjs/extract-react-types/react-select-creatable.js +1 -1
  25. package/dist/cjs/extract-react-types/react-select-props.js +1 -1
  26. package/dist/cjs/index.js +0 -16
  27. package/dist/cjs/styles.js +4 -29
  28. package/dist/cjs/version.json +1 -1
  29. package/dist/es2019/CheckboxSelect.js +2 -3
  30. package/dist/es2019/CountrySelect.js +14 -18
  31. package/dist/es2019/PopupSelect/PopupSelect.js +29 -85
  32. package/dist/es2019/PopupSelect/components.js +6 -6
  33. package/dist/es2019/RadioSelect.js +2 -3
  34. package/dist/es2019/Select.js +1 -1
  35. package/dist/es2019/components/indicators.js +0 -1
  36. package/dist/es2019/components/input-options.js +23 -29
  37. package/dist/es2019/createSelect.js +6 -14
  38. package/dist/es2019/data/countries.js +3 -1
  39. package/dist/es2019/extract-react-types/react-popper-props.js +1 -0
  40. package/dist/es2019/extract-react-types/react-select-async.js +1 -0
  41. package/dist/es2019/extract-react-types/react-select-creatable.js +1 -0
  42. package/dist/es2019/extract-react-types/react-select-props.js +1 -0
  43. package/dist/es2019/index.js +1 -0
  44. package/dist/es2019/styles.js +33 -34
  45. package/dist/es2019/version.json +1 -1
  46. package/dist/esm/CheckboxSelect.js +1 -8
  47. package/dist/esm/CountrySelect.js +20 -24
  48. package/dist/esm/PopupSelect/PopupSelect.js +36 -114
  49. package/dist/esm/PopupSelect/components.js +16 -18
  50. package/dist/esm/RadioSelect.js +1 -7
  51. package/dist/esm/Select.js +1 -1
  52. package/dist/esm/components/index.js +0 -2
  53. package/dist/esm/components/indicators.js +0 -1
  54. package/dist/esm/components/input-options.js +43 -72
  55. package/dist/esm/createSelect.js +12 -30
  56. package/dist/esm/data/countries.js +3 -1
  57. package/dist/esm/extract-react-types/react-popper-props.js +1 -0
  58. package/dist/esm/extract-react-types/react-select-async.js +1 -0
  59. package/dist/esm/extract-react-types/react-select-creatable.js +1 -0
  60. package/dist/esm/extract-react-types/react-select-props.js +1 -0
  61. package/dist/esm/index.js +1 -0
  62. package/dist/esm/styles.js +4 -24
  63. package/dist/esm/version.json +1 -1
  64. package/dist/types/index.d.ts +1 -1
  65. package/package.json +1 -1
  66. package/report.api.md +14 -0
@@ -9,18 +9,13 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
9
9
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
10
10
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
11
11
  var _excluded = ["isActive", "isDisabled", "isFocused", "isSelected"],
12
- _excluded2 = ["isActive", "isDisabled", "isSelected"],
13
- _excluded3 = ["isActive", "isDisabled", "isFocused", "isSelected"],
14
- _excluded4 = ["getStyles", "Icon", "children", "innerProps", "innerRef"];
15
-
12
+ _excluded2 = ["isActive", "isDisabled", "isSelected"],
13
+ _excluded3 = ["isActive", "isDisabled", "isFocused", "isSelected"],
14
+ _excluded4 = ["getStyles", "Icon", "children", "innerProps", "innerRef"];
16
15
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
17
-
18
16
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
19
-
20
17
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
21
-
22
18
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
23
-
24
19
  /** @jsx jsx */
25
20
  import { jsx } from '@emotion/react';
26
21
  import { Component } from 'react';
@@ -29,14 +24,13 @@ import CheckboxIcon from '@atlaskit/icon/glyph/checkbox';
29
24
  import { themed } from '@atlaskit/theme/components';
30
25
  import { gridSize } from '@atlaskit/theme/constants';
31
26
  import { B100, B200, B300, B400, B75, DN200, DN10, DN30, N20A, N0, N100, N20, N30, N70 } from '@atlaskit/theme/colors';
32
-
33
27
  var getPrimitiveStyles = function getPrimitiveStyles(props) {
34
28
  var cx = props.cx,
35
- className = props.className,
36
- getStyles = props.getStyles,
37
- isDisabled = props.isDisabled,
38
- isFocused = props.isFocused,
39
- isSelected = props.isSelected;
29
+ className = props.className,
30
+ getStyles = props.getStyles,
31
+ isDisabled = props.isDisabled,
32
+ isFocused = props.isFocused,
33
+ isSelected = props.isSelected;
40
34
  var styles = {
41
35
  alignItems: 'center',
42
36
  backgroundColor: isFocused ? "var(--ds-background-neutral-subtle-hovered, ".concat(N20, ")") : 'transparent',
@@ -53,20 +47,19 @@ var getPrimitiveStyles = function getPrimitiveStyles(props) {
53
47
  borderLeft: isFocused ? '2px solid transparent' : ''
54
48
  }
55
49
  };
56
-
57
50
  var augmentedStyles = _objectSpread(_objectSpread({}, getStyles('option', props)), styles);
58
-
59
51
  var bemClasses = {
60
52
  option: true,
61
53
  'option--is-disabled': isDisabled,
62
54
  'option--is-focused': isFocused,
63
55
  'option--is-selected': isSelected
64
- }; // maintain react-select API
56
+ };
65
57
 
58
+ // maintain react-select API
66
59
  return [augmentedStyles, cx(bemClasses, className)];
67
- }; // maintains function shape
68
-
60
+ };
69
61
 
62
+ // maintains function shape
70
63
  var backgroundColor = themed({
71
64
  light: "var(--ds-background-neutral, ".concat(N0, ")"),
72
65
  dark: "var(--ds-background-neutral, ".concat(DN10, ")")
@@ -74,18 +67,18 @@ var backgroundColor = themed({
74
67
  var transparent = themed({
75
68
  light: 'transparent',
76
69
  dark: 'transparent'
77
- }); // state of the parent option
70
+ });
71
+
72
+ // state of the parent option
78
73
 
79
74
  // the primary color represents the outer or background element
80
75
  var getPrimaryColor = function getPrimaryColor(_ref) {
81
76
  var isActive = _ref.isActive,
82
- isDisabled = _ref.isDisabled,
83
- isFocused = _ref.isFocused,
84
- isSelected = _ref.isSelected,
85
- rest = _objectWithoutProperties(_ref, _excluded);
86
-
77
+ isDisabled = _ref.isDisabled,
78
+ isFocused = _ref.isFocused,
79
+ isSelected = _ref.isSelected,
80
+ rest = _objectWithoutProperties(_ref, _excluded);
87
81
  var color = backgroundColor;
88
-
89
82
  if (isDisabled && isSelected) {
90
83
  color = themed({
91
84
  light: "var(--ds-background-disabled, ".concat(B75, ")"),
@@ -122,22 +115,19 @@ var getPrimaryColor = function getPrimaryColor(_ref) {
122
115
  dark: "var(--ds-background-selected-bold, ".concat(B100, ")")
123
116
  });
124
117
  }
125
-
126
118
  return color(rest);
127
- }; // the secondary color represents the radio dot or checkmark
128
-
119
+ };
129
120
 
121
+ // the secondary color represents the radio dot or checkmark
130
122
  var getSecondaryColor = function getSecondaryColor(_ref2) {
131
123
  var isActive = _ref2.isActive,
132
- isDisabled = _ref2.isDisabled,
133
- isSelected = _ref2.isSelected,
134
- rest = _objectWithoutProperties(_ref2, _excluded2);
135
-
124
+ isDisabled = _ref2.isDisabled,
125
+ isSelected = _ref2.isSelected,
126
+ rest = _objectWithoutProperties(_ref2, _excluded2);
136
127
  var color = themed({
137
128
  light: "var(--ds-surface, ".concat(N0, ")"),
138
129
  dark: "var(--ds-surface, ".concat(DN10, ")")
139
130
  });
140
-
141
131
  if (isDisabled && isSelected) {
142
132
  color = themed({
143
133
  light: "var(--ds-text-disabled, ".concat(N70, ")"),
@@ -151,18 +141,16 @@ var getSecondaryColor = function getSecondaryColor(_ref2) {
151
141
  } else if (!isSelected) {
152
142
  color = transparent;
153
143
  }
154
-
155
144
  return color(rest);
156
- }; // the border color surrounds the checkbox/radio
157
-
145
+ };
158
146
 
147
+ // the border color surrounds the checkbox/radio
159
148
  var getBorderColor = function getBorderColor(_ref3) {
160
149
  var isActive = _ref3.isActive,
161
- isDisabled = _ref3.isDisabled,
162
- isFocused = _ref3.isFocused,
163
- isSelected = _ref3.isSelected,
164
- rest = _objectWithoutProperties(_ref3, _excluded3);
165
-
150
+ isDisabled = _ref3.isDisabled,
151
+ isFocused = _ref3.isFocused,
152
+ isSelected = _ref3.isSelected,
153
+ rest = _objectWithoutProperties(_ref3, _excluded3);
166
154
  if (isDisabled && isSelected) {
167
155
  return "var(--ds-background-disabled, ".concat(B400, ")");
168
156
  } else if (isDisabled) {
@@ -178,76 +166,61 @@ var getBorderColor = function getBorderColor(_ref3) {
178
166
  } else if (isSelected) {
179
167
  return "var(--ds-background-selected-bold, ".concat(B400, ")");
180
168
  }
181
-
182
169
  return "var(--ds-border-input, ".concat(N100, ")");
183
170
  };
184
-
185
171
  var ControlOption = /*#__PURE__*/function (_Component) {
186
172
  _inherits(ControlOption, _Component);
187
-
188
173
  var _super = _createSuper(ControlOption);
189
-
190
174
  function ControlOption() {
191
175
  var _this;
192
-
193
176
  _classCallCheck(this, ControlOption);
194
-
195
177
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
196
178
  args[_key] = arguments[_key];
197
179
  }
198
-
199
180
  _this = _super.call.apply(_super, [this].concat(args));
200
-
201
181
  _defineProperty(_assertThisInitialized(_this), "state", {
202
182
  isActive: false
203
183
  });
204
-
205
184
  _defineProperty(_assertThisInitialized(_this), "onMouseDown", function () {
206
185
  return _this.setState({
207
186
  isActive: true
208
187
  });
209
188
  });
210
-
211
189
  _defineProperty(_assertThisInitialized(_this), "onMouseUp", function () {
212
190
  return _this.setState({
213
191
  isActive: false
214
192
  });
215
193
  });
216
-
217
194
  _defineProperty(_assertThisInitialized(_this), "onMouseLeave", function () {
218
195
  return _this.setState({
219
196
  isActive: false
220
197
  });
221
198
  });
222
-
223
199
  return _this;
224
200
  }
225
-
226
201
  _createClass(ControlOption, [{
227
202
  key: "render",
228
203
  value: function render() {
229
204
  var _this$props = this.props,
230
- getStyles = _this$props.getStyles,
231
- Icon = _this$props.Icon,
232
- children = _this$props.children,
233
- innerProps = _this$props.innerProps,
234
- innerRef = _this$props.innerRef,
235
- rest = _objectWithoutProperties(_this$props, _excluded4); // prop assignment
236
-
237
-
205
+ getStyles = _this$props.getStyles,
206
+ Icon = _this$props.Icon,
207
+ children = _this$props.children,
208
+ innerProps = _this$props.innerProps,
209
+ innerRef = _this$props.innerRef,
210
+ rest = _objectWithoutProperties(_this$props, _excluded4);
211
+
212
+ // prop assignment
238
213
  var props = _objectSpread(_objectSpread({}, innerProps), {}, {
239
214
  onMouseDown: this.onMouseDown,
240
215
  onMouseUp: this.onMouseUp,
241
216
  onMouseLeave: this.onMouseLeave
242
217
  });
243
-
244
218
  var _getPrimitiveStyles = getPrimitiveStyles(_objectSpread({
245
- getStyles: getStyles
246
- }, rest)),
247
- _getPrimitiveStyles2 = _slicedToArray(_getPrimitiveStyles, 2),
248
- styles = _getPrimitiveStyles2[0],
249
- classes = _getPrimitiveStyles2[1];
250
-
219
+ getStyles: getStyles
220
+ }, rest)),
221
+ _getPrimitiveStyles2 = _slicedToArray(_getPrimitiveStyles, 2),
222
+ styles = _getPrimitiveStyles2[0],
223
+ classes = _getPrimitiveStyles2[1];
251
224
  return (
252
225
  /**
253
226
  * TODO Fix this type error
@@ -288,10 +261,8 @@ var ControlOption = /*#__PURE__*/function (_Component) {
288
261
  );
289
262
  }
290
263
  }]);
291
-
292
264
  return ControlOption;
293
265
  }(Component);
294
-
295
266
  export var CheckboxOption = function CheckboxOption(props) {
296
267
  return jsx(ControlOption, _extends({
297
268
  Icon: CheckboxIcon
@@ -8,15 +8,10 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
8
8
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
9
9
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
10
10
  var _excluded = ["styles", "validationState", "isInvalid", "spacing", "isMulti", "appearance"];
11
-
12
11
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
13
-
14
12
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
15
-
16
13
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
17
-
18
14
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
19
-
20
15
  import React, { Component } from 'react';
21
16
  import { mergeStyles } from 'react-select';
22
17
  import memoizeOne from 'memoize-one';
@@ -25,38 +20,25 @@ import * as defaultComponents from './components';
25
20
  import baseStyles from './styles';
26
21
  export default function createSelect(WrappedComponent) {
27
22
  var _class;
28
-
29
23
  return _class = /*#__PURE__*/function (_Component) {
30
24
  _inherits(AtlaskitSelect, _Component);
31
-
32
25
  var _super = _createSuper(AtlaskitSelect);
33
-
34
26
  function AtlaskitSelect(props) {
35
27
  var _this;
36
-
37
28
  _classCallCheck(this, AtlaskitSelect);
38
-
39
29
  _this = _super.call(this, props);
40
-
41
30
  _defineProperty(_assertThisInitialized(_this), "components", {});
42
-
43
31
  _defineProperty(_assertThisInitialized(_this), "select", null);
44
-
45
32
  _defineProperty(_assertThisInitialized(_this), "cacheComponents", function (components) {
46
33
  _this.components = _objectSpread(_objectSpread({}, defaultComponents), components);
47
34
  });
48
-
49
35
  _defineProperty(_assertThisInitialized(_this), "onSelectRef", function (ref) {
50
36
  _this.select = ref;
51
37
  });
52
-
53
38
  _this.cacheComponents = memoizeOne(_this.cacheComponents, isEqual).bind(_assertThisInitialized(_this));
54
-
55
39
  _this.cacheComponents(props.components || {});
56
-
57
40
  return _this;
58
41
  }
59
-
60
42
  _createClass(AtlaskitSelect, [{
61
43
  key: "UNSAFE_componentWillReceiveProps",
62
44
  value: function UNSAFE_componentWillReceiveProps(nextProps) {
@@ -80,28 +62,28 @@ export default function createSelect(WrappedComponent) {
80
62
  key: "render",
81
63
  value: function render() {
82
64
  var _this$props = this.props,
83
- styles = _this$props.styles,
84
- validationState = _this$props.validationState,
85
- isInvalid = _this$props.isInvalid,
86
- spacing = _this$props.spacing,
87
- isMulti = _this$props.isMulti,
88
- appearance = _this$props.appearance,
89
- props = _objectWithoutProperties(_this$props, _excluded);
90
-
91
- var isCompact = spacing === 'compact'; // props must be spread first to stop `components` being overridden
92
-
65
+ styles = _this$props.styles,
66
+ validationState = _this$props.validationState,
67
+ isInvalid = _this$props.isInvalid,
68
+ spacing = _this$props.spacing,
69
+ isMulti = _this$props.isMulti,
70
+ appearance = _this$props.appearance,
71
+ props = _objectWithoutProperties(_this$props, _excluded);
72
+ var isCompact = spacing === 'compact';
73
+
74
+ // props must be spread first to stop `components` being overridden
93
75
  return /*#__PURE__*/React.createElement(WrappedComponent, _extends({
94
76
  ref: this.onSelectRef,
95
77
  isMulti: isMulti,
96
78
  "aria-live": "assertive"
97
79
  }, props, {
98
80
  components: this.components,
99
- styles: mergeStyles(baseStyles( // This will cover both props for invalid state while giving priority to isInvalid. When cleaning up validationState, we can just keep the inner condition.
81
+ styles: mergeStyles(baseStyles(
82
+ // This will cover both props for invalid state while giving priority to isInvalid. When cleaning up validationState, we can just keep the inner condition.
100
83
  typeof isInvalid !== 'undefined' ? isInvalid ? 'error' : 'default' : validationState, isCompact, this.props.appearance || 'default'), styles)
101
84
  }));
102
85
  }
103
86
  }]);
104
-
105
87
  return AtlaskitSelect;
106
88
  }(Component), _defineProperty(_class, "defaultProps", {
107
89
  validationState: 'default',
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
2
+
2
3
  export var allCountries = [{
3
4
  icon: '🇦🇫',
4
5
  name: 'Afghanistan',
@@ -1245,8 +1246,9 @@ export var allCountries = [{
1245
1246
  name: 'Zimbabwe',
1246
1247
  abbr: 'ZW',
1247
1248
  code: '263'
1248
- }]; // separate countries into groups
1249
+ }];
1249
1250
 
1251
+ // separate countries into groups
1250
1252
  export var groupedCountries = [{
1251
1253
  label: 'Suggested',
1252
1254
  options: allCountries.filter(function (c) {
@@ -1,2 +1,3 @@
1
1
  // this is to DOCUMENT/display the underlying react popper props, for our atlaskit/select documentation
2
+
2
3
  export default function ertHackForPopper(_) {}
@@ -1,2 +1,3 @@
1
1
  // for documentation ONLY
2
+
2
3
  export default function ertHackForPopper(_) {}
@@ -1,2 +1,3 @@
1
1
  // for documentation purposes ONLY
2
+
2
3
  export default function ertHackForSelect(_) {}
@@ -1,2 +1,3 @@
1
1
  // this is to DOCUMENT/display the underlying react select props, for our atlaskit/select documentation
2
+
2
3
  export default function ertHackForSelect(_) {}
package/dist/esm/index.js CHANGED
@@ -10,6 +10,7 @@ export { default as CheckboxSelect } from './CheckboxSelect';
10
10
  export { default as CountrySelect } from './CountrySelect';
11
11
  export { default as RadioSelect } from './RadioSelect';
12
12
  export { default as PopupSelect } from './PopupSelect';
13
+
13
14
  /**
14
15
  * Types not exported on the public API, didn't find usages in sourcegraph
15
16
  *
@@ -1,9 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
-
3
2
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
-
5
3
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
-
7
4
  import { gridSize, fontFamily } from '@atlaskit/theme/constants';
8
5
  import { B100, B400, B50, G400, N0, N20, N200, N30, N300, N40, N500, N70, N800, R400, R75 } from '@atlaskit/theme/colors';
9
6
  var BORDER_WIDTH = 2;
@@ -30,49 +27,39 @@ export default function baseStyles(validationState) {
30
27
  },
31
28
  control: function control(css, _ref2) {
32
29
  var isFocused = _ref2.isFocused,
33
- isDisabled = _ref2.isDisabled;
30
+ isDisabled = _ref2.isDisabled;
34
31
  var borderColor = isFocused ? "var(--ds-border-focused, ".concat(B100, ")") : "var(--ds-border-input, ".concat(N20, ")");
35
32
  var backgroundColor = isFocused ? "var(--ds-background-input-pressed, ".concat(N0, ")") : "var(--ds-background-input, ".concat(N20, ")");
36
33
  var backgroundColorHover = isFocused ? "var(--ds-background-input-pressed, ".concat(N0, ")") : "var(--ds-background-input-hovered, ".concat(N30, ")");
37
-
38
34
  if (isDisabled) {
39
35
  backgroundColor = "var(--ds-background-disabled, ".concat(N20, ")");
40
36
  borderColor = "var(--ds-background-disabled, ".concat(N20, ")");
41
37
  }
42
-
43
38
  if (validationState === 'error') {
44
39
  borderColor = "var(--ds-border-danger, ".concat(R400, ")");
45
40
  }
46
-
47
41
  if (validationState === 'success') {
48
42
  borderColor = "var(--ds-border-success, ".concat(G400, ")");
49
43
  }
50
-
51
44
  var borderColorHover = isFocused ? "var(--ds-border-focused, ".concat(B100, ")") : "var(--ds-border-input, ".concat(N30, ")");
52
-
53
45
  if (validationState === 'error') {
54
46
  borderColorHover = "var(--ds-border-danger, ".concat(R400, ")");
55
47
  }
56
-
57
48
  if (validationState === 'success') {
58
49
  borderColorHover = "var(--ds-border-success, ".concat(G400, ")");
59
50
  }
60
-
61
51
  var transitionDuration = '200ms';
62
-
63
52
  if (appearance === 'subtle') {
64
53
  borderColor = isFocused ? "var(--ds-border-focused, ".concat(B100, ")") : 'transparent';
65
54
  backgroundColor = isFocused ? "var(--ds-surface, ".concat(N0, ")") : 'transparent';
66
55
  backgroundColorHover = isFocused ? "var(--ds-background-input-pressed, ".concat(N0, ")") : "var(--ds-background-input-hovered, ".concat(N30, ")");
67
56
  }
68
-
69
57
  if (appearance === 'none') {
70
58
  borderColor = 'transparent';
71
59
  backgroundColor = 'transparent';
72
60
  backgroundColorHover = 'transparent';
73
61
  borderColorHover = 'transparent';
74
62
  }
75
-
76
63
  return _objectSpread(_objectSpread({}, css), {}, {
77
64
  // Turn pointer events off when disabled - this makes it so hover etc don't work.
78
65
  pointerEvents: isDisabled ? 'none' : undefined,
@@ -137,11 +124,9 @@ export default function baseStyles(validationState) {
137
124
  dropdownIndicator: function dropdownIndicator(css, _ref3) {
138
125
  var isDisabled = _ref3.isDisabled;
139
126
  var color = "var(--ds-text-subtle, ".concat(N500, ")");
140
-
141
127
  if (isDisabled) {
142
128
  color = "var(--ds-text-disabled, ".concat(N70, ")");
143
129
  }
144
-
145
130
  return _objectSpread(_objectSpread({}, css), {}, {
146
131
  color: color,
147
132
  paddingLeft: ICON_PADDING,
@@ -160,19 +145,16 @@ export default function baseStyles(validationState) {
160
145
  },
161
146
  option: function option(css, _ref4) {
162
147
  var isFocused = _ref4.isFocused,
163
- isSelected = _ref4.isSelected,
164
- isDisabled = _ref4.isDisabled;
148
+ isSelected = _ref4.isSelected,
149
+ isDisabled = _ref4.isDisabled;
165
150
  var color = "var(--ds-text, ".concat(N800, ")");
166
-
167
151
  if (isDisabled) {
168
152
  color = "var(--ds-text-disabled, ".concat(N70, ")");
169
153
  } else if (isSelected) {
170
154
  color = "var(--ds-text-selected, ".concat(B400, ")");
171
155
  }
172
-
173
156
  var boxShadow;
174
157
  var backgroundColor;
175
-
176
158
  if (isDisabled) {
177
159
  backgroundColor = undefined;
178
160
  } else if (isSelected && isFocused) {
@@ -182,11 +164,9 @@ export default function baseStyles(validationState) {
182
164
  } else if (isFocused) {
183
165
  backgroundColor = "var(--ds-background-neutral-subtle-hovered, ".concat(N20, ")");
184
166
  }
185
-
186
167
  if (!isDisabled && (isFocused || isSelected)) {
187
168
  boxShadow = "inset 2px 0px 0px ".concat("var(--ds-border-selected, ".concat(B400, ")"));
188
169
  }
189
-
190
170
  var cursor = isDisabled ? 'not-allowed' : css.cursor;
191
171
  return _objectSpread(_objectSpread({}, css), {}, {
192
172
  padding: '6px 12px',
@@ -213,9 +193,9 @@ export default function baseStyles(validationState) {
213
193
  return _objectSpread(_objectSpread({}, css), {}, {
214
194
  color: isDisabled ? "var(--ds-text-disabled, ".concat(N70, ")") : "var(--ds-text, ".concat(N800, ")"),
215
195
  lineHeight: "".concat(gridSize() * 2, "px") // 16px
216
-
217
196
  });
218
197
  },
198
+
219
199
  menu: function menu(css) {
220
200
  return _objectSpread(_objectSpread({}, css), {}, {
221
201
  backgroundColor: "var(--ds-surface-overlay, white)",
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/select",
3
- "version": "16.1.0",
3
+ "version": "16.1.2",
4
4
  "sideEffects": false
5
5
  }
@@ -11,7 +11,7 @@ export { default as CountrySelect } from './CountrySelect';
11
11
  export { default as RadioSelect } from './RadioSelect';
12
12
  export { default as PopupSelect } from './PopupSelect';
13
13
  export type { PopupSelectProps, ModifierList } from './PopupSelect';
14
- export type { SelectInstance, ActionMeta, ControlProps, FormatOptionLabelMeta, InputActionMeta, InputProps, MenuProps, MenuListComponentProps, OptionProps, OptionsType, OptionType, SelectComponentsConfig, SelectProps, StylesConfig, ValueContainerProps, ValueType, GroupedOptionsType, GroupType, ClearIndicatorProps, DropdownIndicatorProps, IndicatorSeparatorProps, LoadingIndicatorProps, MultiValueProps, ReactSelectProps, SingleValueProps, NoticeProps, ValidationState, GroupProps, AsyncSelectProps, } from './types';
14
+ export type { SelectInstance, ActionMeta, ControlProps, FormatOptionLabelMeta, InputActionMeta, InputProps, MenuProps, MenuListComponentProps, OptionProps, OptionsType, OptionType, SelectComponentsConfig, SelectProps, StylesConfig, ValueContainerProps, ValueType, GroupedOptionsType, GroupType, ClearIndicatorProps, DropdownIndicatorProps, IndicatorSeparatorProps, LoadingIndicatorProps, MultiValueProps, MultiValueRemoveProps, ReactSelectProps, SingleValueProps, NoticeProps, ValidationState, GroupProps, AsyncSelectProps, } from './types';
15
15
  /**
16
16
  * Types not exported on the public API, didn't find usages in sourcegraph
17
17
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/select",
3
- "version": "16.1.0",
3
+ "version": "16.1.2",
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/"
package/report.api.md CHANGED
@@ -8,6 +8,7 @@
8
8
  ### Table of contents
9
9
 
10
10
  - [Main Entry Types](#main-entry-types)
11
+ - [Peer Dependencies](#peer-dependencies)
11
12
 
12
13
  ### Main Entry Types
13
14
 
@@ -1034,3 +1035,16 @@ export type ValueType<Option, IsMulti extends boolean = false> = OnChangeValue<
1034
1035
  ```
1035
1036
 
1036
1037
  <!--SECTION END: Main Entry Types-->
1038
+
1039
+ ### Peer Dependencies
1040
+
1041
+ <!--SECTION START: Peer Dependencies-->
1042
+
1043
+ ```json
1044
+ {
1045
+ "react": "^16.8.0",
1046
+ "react-dom": "^16.8.0"
1047
+ }
1048
+ ```
1049
+
1050
+ <!--SECTION END: Peer Dependencies-->