@atlaskit/select 16.1.7 → 16.1.9

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/select
2
2
 
3
+ ## 16.1.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [`79ddcb13067`](https://bitbucket.org/atlassian/atlassian-frontend/commits/79ddcb13067) - [ux] style(select): update fallback of select placeholder to N200'
8
+
9
+ ## 16.1.8
10
+
11
+ ### Patch Changes
12
+
13
+ - [`8a8aac2b848`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8a8aac2b848) - [ux] Adds proper disabled styling to the isMulti component.
14
+
3
15
  ## 16.1.7
4
16
 
5
17
  ### Patch Changes
@@ -42,11 +42,9 @@ var canUseDOM = function canUseDOM() {
42
42
  // ==============================
43
43
  // Types
44
44
  // ==============================
45
-
46
45
  // ==============================
47
46
  // Class
48
47
  // ==============================
49
-
50
48
  var modifiers = [{
51
49
  name: 'offset',
52
50
  options: {
@@ -103,6 +101,8 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
103
101
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "popperWrapperId", "".concat((0, _reactUid.uid)({
104
102
  options: _this.props.options
105
103
  }), "-popup-select"));
104
+ // Event Handlers
105
+ // ==============================
106
106
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleKeyDown", function (event) {
107
107
  switch (event.key) {
108
108
  case 'Escape':
@@ -156,6 +156,13 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
156
156
  focusLockEnabled: true
157
157
  });
158
158
  });
159
+ // Internal Lifecycle
160
+ // ==============================
161
+ /**
162
+ * Opens the popup
163
+ *
164
+ * @param options.controlOverride - Force the popup to open when it's open state is being controlled
165
+ */
159
166
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "open", function (options) {
160
167
  var onOpen = _this.props.onOpen;
161
168
  if (!(options !== null && options !== void 0 && options.controlOverride) && _this.isOpenControlled) {
@@ -182,6 +189,11 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
182
189
  }
183
190
  });
184
191
  });
192
+ /**
193
+ * Closes the popup
194
+ *
195
+ * @param options.controlOverride - Force the popup to close when it's open state is being controlled
196
+ */
185
197
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "close", function (options) {
186
198
  var _this$unbindWindowKey, _this2;
187
199
  var onClose = _this.props.onClose;
@@ -207,6 +219,8 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
207
219
  (_this$unbindWindowKey = (_this2 = _this).unbindWindowKeydown) === null || _this$unbindWindowKey === void 0 ? void 0 : _this$unbindWindowKey.call(_this2);
208
220
  _this.unbindWindowKeydown = null;
209
221
  });
222
+ // Refs
223
+ // ==============================
210
224
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "resolveTargetRef", function (popperRef) {
211
225
  return function (ref) {
212
226
  // avoid thrashing fn calls
@@ -233,6 +247,10 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
233
247
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getSelectRef", function (ref) {
234
248
  _this.selectRef = ref;
235
249
  });
250
+ // Utils
251
+ // ==============================
252
+ // account for groups when counting options
253
+ // this may need to be recursive, right now it just counts one level
236
254
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getItemCount", function () {
237
255
  var options = _this.props.options;
238
256
  var count = 0;
@@ -260,12 +278,15 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
260
278
  var maxHeight = maxMenuHeight - offsetHeight;
261
279
  return maxHeight;
262
280
  });
281
+ // if the threshold is exceeded, AND isSearchable is true, then display the search control
263
282
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "showSearchControl", function () {
264
283
  var _this$props2 = _this.props,
265
284
  searchThreshold = _this$props2.searchThreshold,
266
285
  isSearchable = _this$props2.isSearchable;
267
286
  return isSearchable && _this.getItemCount() > searchThreshold;
268
287
  });
288
+ // Renderers
289
+ // ==============================
269
290
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderSelect", function () {
270
291
  var _this$props3 = _this.props,
271
292
  footer = _this$props3.footer,
@@ -368,9 +389,6 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
368
389
  }
369
390
  }
370
391
  }
371
-
372
- // Event Handlers
373
- // ==============================
374
392
  }, {
375
393
  key: "render",
376
394
  value: function render() {
@@ -15,6 +15,11 @@ var _constants = require("@atlaskit/theme/constants");
15
15
  var _colors = require("@atlaskit/theme/colors");
16
16
  var _excluded = ["innerRef", "innerProps"],
17
17
  _excluded2 = ["children", "innerProps"];
18
+ /** @jsx jsx */
19
+ // ==============================
20
+ // Styled Components
21
+ // ==============================
22
+
18
23
  var MenuDialog = function MenuDialog(_ref) {
19
24
  var maxWidth = _ref.maxWidth,
20
25
  minWidth = _ref.minWidth,
@@ -9,7 +9,7 @@ var _reactSelect = _interopRequireDefault(require("react-select"));
9
9
  var _analyticsNext = require("@atlaskit/analytics-next");
10
10
  var _createSelect = _interopRequireDefault(require("./createSelect"));
11
11
  var packageName = "@atlaskit/select";
12
- var packageVersion = "16.1.7";
12
+ var packageVersion = "16.1.9";
13
13
  var SelectWithoutAnalytics = (0, _createSelect.default)(_reactSelect.default);
14
14
  exports.SelectWithoutAnalytics = SelectWithoutAnalytics;
15
15
  var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
@@ -30,6 +30,7 @@ var _selectClear = _interopRequireDefault(require("@atlaskit/icon/glyph/select-c
30
30
  var _reactSelect = require("react-select");
31
31
  var _indicators = require("./indicators");
32
32
  var _templateObject, _templateObject2;
33
+ /** @jsx jsx */
33
34
  var disabledProps = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: none;\n"])));
34
35
  var enabledProps = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: inherit;\n"])));
35
36
  var MultiValueRemove = function MultiValueRemove(props) {
@@ -28,7 +28,7 @@ var _excluded = ["isActive", "isDisabled", "isFocused", "isSelected"],
28
28
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
29
29
  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; } }
30
30
  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; }
31
- 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) { (0, _defineProperty2.default)(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; }
31
+ 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) { (0, _defineProperty2.default)(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; } /** @jsx jsx */
32
32
  var getPrimitiveStyles = function getPrimitiveStyles(props) {
33
33
  var cx = props.cx,
34
34
  className = props.className,
@@ -9,7 +9,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
9
9
  var _constants = require("@atlaskit/theme/constants");
10
10
  var _colors = require("@atlaskit/theme/colors");
11
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; }
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) { (0, _defineProperty2.default)(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; }
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) { (0, _defineProperty2.default)(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; } // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
13
13
  var BORDER_WIDTH = 2;
14
14
  var ICON_PADDING = 2;
15
15
  var paddingExcludingBorder = (0, _constants.gridSize)() - BORDER_WIDTH;
@@ -192,7 +192,7 @@ function baseStyles(validationState) {
192
192
  placeholder: function placeholder(css, _ref5) {
193
193
  var isDisabled = _ref5.isDisabled;
194
194
  return _objectSpread(_objectSpread({}, css), {}, {
195
- color: isDisabled ? "var(--ds-text-disabled, ".concat(_colors.N300, ")") : "var(--ds-text-subtlest, ".concat(_colors.N300, ")")
195
+ color: isDisabled ? "var(--ds-text-disabled, ".concat(_colors.N300, ")") : "var(--ds-text-subtlest, ".concat(_colors.N200, ")")
196
196
  });
197
197
  },
198
198
  singleValue: function singleValue(css, _ref6) {
@@ -216,27 +216,43 @@ function baseStyles(validationState) {
216
216
  });
217
217
  },
218
218
  multiValue: function multiValue(css, _ref7) {
219
- var isFocused = _ref7.isFocused;
219
+ var isDisabled = _ref7.isDisabled,
220
+ isFocused = _ref7.isFocused;
221
+ var backgroundColor;
222
+ var color;
223
+ if (isDisabled) {
224
+ // Use the basic neutral background so it is slightly separate from the
225
+ // field's background
226
+ backgroundColor = "var(--ds-background-neutral, ".concat(_colors.N40, ")");
227
+ color = "var(--ds-text-disabled, ".concat(_colors.N70, ")");
228
+ } else if (isFocused) {
229
+ backgroundColor = "var(--ds-background-selected, ".concat(_colors.N40, ")");
230
+ color = "var(--ds-text-selected, hsl(0, 0%, 20%))";
231
+ } else {
232
+ backgroundColor = "var(--ds-background-neutral, ".concat(_colors.N40, ")");
233
+ color = "var(--ds-text, hsl(0, 0%, 20%))";
234
+ }
220
235
  return _objectSpread(_objectSpread({}, css), {}, {
221
236
  borderRadius: "var(--ds-radius-050, 2px)",
222
- backgroundColor: isFocused ? "var(--ds-background-selected, ".concat(_colors.N40, ")") : "var(--ds-background-neutral, ".concat(_colors.N40, ")"),
237
+ backgroundColor: backgroundColor,
223
238
  boxShadow: isFocused ? "0 0 0 2px ".concat("var(--ds-surface, transparent)", ", 0 0 0 4px ", "var(--ds-border-focused, transparent)") : 'none',
224
239
  maxWidth: '100%',
225
240
  '@media screen and (-ms-high-contrast: active)': {
226
241
  border: isFocused ? '1px solid transparent' : 'none'
227
242
  },
228
- color: isFocused ? "var(--ds-text-selected, hsl(0, 0%, 20%))" : "var(--ds-text, hsl(0, 0%, 20%))"
243
+ color: color
229
244
  });
230
245
  },
231
- multiValueLabel: function multiValueLabel(css) {
246
+ multiValueLabel: function multiValueLabel(css, _ref8) {
247
+ var isDisabled = _ref8.isDisabled;
232
248
  return _objectSpread(_objectSpread({}, css), {}, {
233
249
  padding: "var(--ds-space-025, 2px)",
234
- color: 'inherit',
250
+ color: isDisabled ? "var(--ds-text-disabled, ".concat(_colors.N70, ")") : 'inherit',
235
251
  paddingRight: "var(--ds-space-025, 2px)"
236
252
  });
237
253
  },
238
- multiValueRemove: function multiValueRemove(css, _ref8) {
239
- var isFocused = _ref8.isFocused;
254
+ multiValueRemove: function multiValueRemove(css, _ref9) {
255
+ var isFocused = _ref9.isFocused;
240
256
  return _objectSpread(_objectSpread({}, css), {}, {
241
257
  backgroundColor: isFocused ? "var(--ds-UNSAFE-transparent, ".concat(_colors.R75, ")") : undefined,
242
258
  fill: isFocused ? "var(--ds-text-selected, #000)" : "var(--ds-text, #000)",
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/select",
3
- "version": "16.1.7",
3
+ "version": "16.1.9",
4
4
  "sideEffects": false
5
5
  }
@@ -18,11 +18,9 @@ const canUseDOM = () => Boolean(typeof window !== 'undefined' && window.document
18
18
  // ==============================
19
19
  // Types
20
20
  // ==============================
21
-
22
21
  // ==============================
23
22
  // Class
24
23
  // ==============================
25
-
26
24
  const modifiers = [{
27
25
  name: 'offset',
28
26
  options: {
@@ -69,6 +67,8 @@ export default class PopupSelect extends PureComponent {
69
67
  _defineProperty(this, "popperWrapperId", `${uid({
70
68
  options: this.props.options
71
69
  })}-popup-select`);
70
+ // Event Handlers
71
+ // ==============================
72
72
  _defineProperty(this, "handleKeyDown", event => {
73
73
  switch (event.key) {
74
74
  case 'Escape':
@@ -126,6 +126,13 @@ export default class PopupSelect extends PureComponent {
126
126
  focusLockEnabled: true
127
127
  });
128
128
  });
129
+ // Internal Lifecycle
130
+ // ==============================
131
+ /**
132
+ * Opens the popup
133
+ *
134
+ * @param options.controlOverride - Force the popup to open when it's open state is being controlled
135
+ */
129
136
  _defineProperty(this, "open", options => {
130
137
  const {
131
138
  onOpen
@@ -154,6 +161,11 @@ export default class PopupSelect extends PureComponent {
154
161
  }
155
162
  });
156
163
  });
164
+ /**
165
+ * Closes the popup
166
+ *
167
+ * @param options.controlOverride - Force the popup to close when it's open state is being controlled
168
+ */
157
169
  _defineProperty(this, "close", options => {
158
170
  var _this$unbindWindowKey;
159
171
  const {
@@ -181,6 +193,8 @@ export default class PopupSelect extends PureComponent {
181
193
  (_this$unbindWindowKey = this.unbindWindowKeydown) === null || _this$unbindWindowKey === void 0 ? void 0 : _this$unbindWindowKey.call(this);
182
194
  this.unbindWindowKeydown = null;
183
195
  });
196
+ // Refs
197
+ // ==============================
184
198
  _defineProperty(this, "resolveTargetRef", popperRef => ref => {
185
199
  // avoid thrashing fn calls
186
200
  if (!this.targetRef && popperRef && ref) {
@@ -203,6 +217,10 @@ export default class PopupSelect extends PureComponent {
203
217
  _defineProperty(this, "getSelectRef", ref => {
204
218
  this.selectRef = ref;
205
219
  });
220
+ // Utils
221
+ // ==============================
222
+ // account for groups when counting options
223
+ // this may need to be recursive, right now it just counts one level
206
224
  _defineProperty(this, "getItemCount", () => {
207
225
  const {
208
226
  options
@@ -234,6 +252,7 @@ export default class PopupSelect extends PureComponent {
234
252
  const maxHeight = maxMenuHeight - offsetHeight;
235
253
  return maxHeight;
236
254
  });
255
+ // if the threshold is exceeded, AND isSearchable is true, then display the search control
237
256
  _defineProperty(this, "showSearchControl", () => {
238
257
  const {
239
258
  searchThreshold,
@@ -241,6 +260,8 @@ export default class PopupSelect extends PureComponent {
241
260
  } = this.props;
242
261
  return isSearchable && this.getItemCount() > searchThreshold;
243
262
  });
263
+ // Renderers
264
+ // ==============================
244
265
  _defineProperty(this, "renderSelect", () => {
245
266
  const {
246
267
  footer,
@@ -367,10 +388,6 @@ export default class PopupSelect extends PureComponent {
367
388
  }
368
389
  }
369
390
  }
370
-
371
- // Event Handlers
372
- // ==============================
373
-
374
391
  render() {
375
392
  const {
376
393
  target
@@ -7,6 +7,10 @@ import VisuallyHidden from '@atlaskit/visually-hidden';
7
7
  import SearchIcon from '@atlaskit/icon/glyph/editor/search';
8
8
  import { layers } from '@atlaskit/theme/constants';
9
9
  import { N40A } from '@atlaskit/theme/colors';
10
+
11
+ // ==============================
12
+ // Styled Components
13
+ // ==============================
10
14
  export const MenuDialog = ({
11
15
  maxWidth,
12
16
  minWidth,
@@ -2,7 +2,7 @@ import Select from 'react-select';
2
2
  import { withAnalyticsEvents, withAnalyticsContext, createAndFireEvent } from '@atlaskit/analytics-next';
3
3
  import createSelect from './createSelect';
4
4
  const packageName = "@atlaskit/select";
5
- const packageVersion = "16.1.7";
5
+ const packageVersion = "16.1.9";
6
6
  export const SelectWithoutAnalytics = createSelect(Select);
7
7
  const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
8
8
  export default withAnalyticsContext({
@@ -184,7 +184,7 @@ export default function baseStyles(validationState, isCompact = false, appearanc
184
184
  isDisabled
185
185
  }) => ({
186
186
  ...css,
187
- color: isDisabled ? `var(--ds-text-disabled, ${N300})` : `var(--ds-text-subtlest, ${N300})`
187
+ color: isDisabled ? `var(--ds-text-disabled, ${N300})` : `var(--ds-text-subtlest, ${N200})`
188
188
  }),
189
189
  singleValue: (css, {
190
190
  isDisabled
@@ -205,22 +205,41 @@ export default function baseStyles(validationState, isCompact = false, appearanc
205
205
  paddingBottom: "var(--ds-space-100, 8px)"
206
206
  }),
207
207
  multiValue: (css, {
208
+ isDisabled,
208
209
  isFocused
210
+ }) => {
211
+ let backgroundColor;
212
+ let color;
213
+ if (isDisabled) {
214
+ // Use the basic neutral background so it is slightly separate from the
215
+ // field's background
216
+ backgroundColor = `var(--ds-background-neutral, ${N40})`;
217
+ color = `var(--ds-text-disabled, ${N70})`;
218
+ } else if (isFocused) {
219
+ backgroundColor = `var(--ds-background-selected, ${N40})`;
220
+ color = "var(--ds-text-selected, hsl(0, 0%, 20%))";
221
+ } else {
222
+ backgroundColor = `var(--ds-background-neutral, ${N40})`;
223
+ color = "var(--ds-text, hsl(0, 0%, 20%))";
224
+ }
225
+ return {
226
+ ...css,
227
+ borderRadius: "var(--ds-radius-050, 2px)",
228
+ backgroundColor,
229
+ boxShadow: isFocused ? `0 0 0 2px ${"var(--ds-surface, transparent)"}, 0 0 0 4px ${"var(--ds-border-focused, transparent)"}` : 'none',
230
+ maxWidth: '100%',
231
+ '@media screen and (-ms-high-contrast: active)': {
232
+ border: isFocused ? '1px solid transparent' : 'none'
233
+ },
234
+ color
235
+ };
236
+ },
237
+ multiValueLabel: (css, {
238
+ isDisabled
209
239
  }) => ({
210
- ...css,
211
- borderRadius: "var(--ds-radius-050, 2px)",
212
- backgroundColor: isFocused ? `var(--ds-background-selected, ${N40})` : `var(--ds-background-neutral, ${N40})`,
213
- boxShadow: isFocused ? `0 0 0 2px ${"var(--ds-surface, transparent)"}, 0 0 0 4px ${"var(--ds-border-focused, transparent)"}` : 'none',
214
- maxWidth: '100%',
215
- '@media screen and (-ms-high-contrast: active)': {
216
- border: isFocused ? '1px solid transparent' : 'none'
217
- },
218
- color: isFocused ? "var(--ds-text-selected, hsl(0, 0%, 20%))" : "var(--ds-text, hsl(0, 0%, 20%))"
219
- }),
220
- multiValueLabel: css => ({
221
240
  ...css,
222
241
  padding: "var(--ds-space-025, 2px)",
223
- color: 'inherit',
242
+ color: isDisabled ? `var(--ds-text-disabled, ${N70})` : 'inherit',
224
243
  paddingRight: "var(--ds-space-025, 2px)"
225
244
  }),
226
245
  multiValueRemove: (css, {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/select",
3
- "version": "16.1.7",
3
+ "version": "16.1.9",
4
4
  "sideEffects": false
5
5
  }
@@ -32,11 +32,9 @@ var canUseDOM = function canUseDOM() {
32
32
  // ==============================
33
33
  // Types
34
34
  // ==============================
35
-
36
35
  // ==============================
37
36
  // Class
38
37
  // ==============================
39
-
40
38
  var modifiers = [{
41
39
  name: 'offset',
42
40
  options: {
@@ -93,6 +91,8 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
93
91
  _defineProperty(_assertThisInitialized(_this), "popperWrapperId", "".concat(uid({
94
92
  options: _this.props.options
95
93
  }), "-popup-select"));
94
+ // Event Handlers
95
+ // ==============================
96
96
  _defineProperty(_assertThisInitialized(_this), "handleKeyDown", function (event) {
97
97
  switch (event.key) {
98
98
  case 'Escape':
@@ -146,6 +146,13 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
146
146
  focusLockEnabled: true
147
147
  });
148
148
  });
149
+ // Internal Lifecycle
150
+ // ==============================
151
+ /**
152
+ * Opens the popup
153
+ *
154
+ * @param options.controlOverride - Force the popup to open when it's open state is being controlled
155
+ */
149
156
  _defineProperty(_assertThisInitialized(_this), "open", function (options) {
150
157
  var onOpen = _this.props.onOpen;
151
158
  if (!(options !== null && options !== void 0 && options.controlOverride) && _this.isOpenControlled) {
@@ -172,6 +179,11 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
172
179
  }
173
180
  });
174
181
  });
182
+ /**
183
+ * Closes the popup
184
+ *
185
+ * @param options.controlOverride - Force the popup to close when it's open state is being controlled
186
+ */
175
187
  _defineProperty(_assertThisInitialized(_this), "close", function (options) {
176
188
  var _this$unbindWindowKey, _this2;
177
189
  var onClose = _this.props.onClose;
@@ -197,6 +209,8 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
197
209
  (_this$unbindWindowKey = (_this2 = _this).unbindWindowKeydown) === null || _this$unbindWindowKey === void 0 ? void 0 : _this$unbindWindowKey.call(_this2);
198
210
  _this.unbindWindowKeydown = null;
199
211
  });
212
+ // Refs
213
+ // ==============================
200
214
  _defineProperty(_assertThisInitialized(_this), "resolveTargetRef", function (popperRef) {
201
215
  return function (ref) {
202
216
  // avoid thrashing fn calls
@@ -223,6 +237,10 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
223
237
  _defineProperty(_assertThisInitialized(_this), "getSelectRef", function (ref) {
224
238
  _this.selectRef = ref;
225
239
  });
240
+ // Utils
241
+ // ==============================
242
+ // account for groups when counting options
243
+ // this may need to be recursive, right now it just counts one level
226
244
  _defineProperty(_assertThisInitialized(_this), "getItemCount", function () {
227
245
  var options = _this.props.options;
228
246
  var count = 0;
@@ -250,12 +268,15 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
250
268
  var maxHeight = maxMenuHeight - offsetHeight;
251
269
  return maxHeight;
252
270
  });
271
+ // if the threshold is exceeded, AND isSearchable is true, then display the search control
253
272
  _defineProperty(_assertThisInitialized(_this), "showSearchControl", function () {
254
273
  var _this$props2 = _this.props,
255
274
  searchThreshold = _this$props2.searchThreshold,
256
275
  isSearchable = _this$props2.isSearchable;
257
276
  return isSearchable && _this.getItemCount() > searchThreshold;
258
277
  });
278
+ // Renderers
279
+ // ==============================
259
280
  _defineProperty(_assertThisInitialized(_this), "renderSelect", function () {
260
281
  var _this$props3 = _this.props,
261
282
  footer = _this$props3.footer,
@@ -358,9 +379,6 @@ var PopupSelect = /*#__PURE__*/function (_PureComponent) {
358
379
  }
359
380
  }
360
381
  }
361
-
362
- // Event Handlers
363
- // ==============================
364
382
  }, {
365
383
  key: "render",
366
384
  value: function render() {
@@ -10,6 +10,10 @@ import VisuallyHidden from '@atlaskit/visually-hidden';
10
10
  import SearchIcon from '@atlaskit/icon/glyph/editor/search';
11
11
  import { layers } from '@atlaskit/theme/constants';
12
12
  import { N40A } from '@atlaskit/theme/colors';
13
+
14
+ // ==============================
15
+ // Styled Components
16
+ // ==============================
13
17
  export var MenuDialog = function MenuDialog(_ref) {
14
18
  var maxWidth = _ref.maxWidth,
15
19
  minWidth = _ref.minWidth,
@@ -2,7 +2,7 @@ import Select from 'react-select';
2
2
  import { withAnalyticsEvents, withAnalyticsContext, createAndFireEvent } from '@atlaskit/analytics-next';
3
3
  import createSelect from './createSelect';
4
4
  var packageName = "@atlaskit/select";
5
- var packageVersion = "16.1.7";
5
+ var packageVersion = "16.1.9";
6
6
  export var SelectWithoutAnalytics = createSelect(Select);
7
7
  var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
8
8
  export default withAnalyticsContext({
@@ -186,7 +186,7 @@ export default function baseStyles(validationState) {
186
186
  placeholder: function placeholder(css, _ref5) {
187
187
  var isDisabled = _ref5.isDisabled;
188
188
  return _objectSpread(_objectSpread({}, css), {}, {
189
- color: isDisabled ? "var(--ds-text-disabled, ".concat(N300, ")") : "var(--ds-text-subtlest, ".concat(N300, ")")
189
+ color: isDisabled ? "var(--ds-text-disabled, ".concat(N300, ")") : "var(--ds-text-subtlest, ".concat(N200, ")")
190
190
  });
191
191
  },
192
192
  singleValue: function singleValue(css, _ref6) {
@@ -210,27 +210,43 @@ export default function baseStyles(validationState) {
210
210
  });
211
211
  },
212
212
  multiValue: function multiValue(css, _ref7) {
213
- var isFocused = _ref7.isFocused;
213
+ var isDisabled = _ref7.isDisabled,
214
+ isFocused = _ref7.isFocused;
215
+ var backgroundColor;
216
+ var color;
217
+ if (isDisabled) {
218
+ // Use the basic neutral background so it is slightly separate from the
219
+ // field's background
220
+ backgroundColor = "var(--ds-background-neutral, ".concat(N40, ")");
221
+ color = "var(--ds-text-disabled, ".concat(N70, ")");
222
+ } else if (isFocused) {
223
+ backgroundColor = "var(--ds-background-selected, ".concat(N40, ")");
224
+ color = "var(--ds-text-selected, hsl(0, 0%, 20%))";
225
+ } else {
226
+ backgroundColor = "var(--ds-background-neutral, ".concat(N40, ")");
227
+ color = "var(--ds-text, hsl(0, 0%, 20%))";
228
+ }
214
229
  return _objectSpread(_objectSpread({}, css), {}, {
215
230
  borderRadius: "var(--ds-radius-050, 2px)",
216
- backgroundColor: isFocused ? "var(--ds-background-selected, ".concat(N40, ")") : "var(--ds-background-neutral, ".concat(N40, ")"),
231
+ backgroundColor: backgroundColor,
217
232
  boxShadow: isFocused ? "0 0 0 2px ".concat("var(--ds-surface, transparent)", ", 0 0 0 4px ", "var(--ds-border-focused, transparent)") : 'none',
218
233
  maxWidth: '100%',
219
234
  '@media screen and (-ms-high-contrast: active)': {
220
235
  border: isFocused ? '1px solid transparent' : 'none'
221
236
  },
222
- color: isFocused ? "var(--ds-text-selected, hsl(0, 0%, 20%))" : "var(--ds-text, hsl(0, 0%, 20%))"
237
+ color: color
223
238
  });
224
239
  },
225
- multiValueLabel: function multiValueLabel(css) {
240
+ multiValueLabel: function multiValueLabel(css, _ref8) {
241
+ var isDisabled = _ref8.isDisabled;
226
242
  return _objectSpread(_objectSpread({}, css), {}, {
227
243
  padding: "var(--ds-space-025, 2px)",
228
- color: 'inherit',
244
+ color: isDisabled ? "var(--ds-text-disabled, ".concat(N70, ")") : 'inherit',
229
245
  paddingRight: "var(--ds-space-025, 2px)"
230
246
  });
231
247
  },
232
- multiValueRemove: function multiValueRemove(css, _ref8) {
233
- var isFocused = _ref8.isFocused;
248
+ multiValueRemove: function multiValueRemove(css, _ref9) {
249
+ var isFocused = _ref9.isFocused;
234
250
  return _objectSpread(_objectSpread({}, css), {}, {
235
251
  backgroundColor: isFocused ? "var(--ds-UNSAFE-transparent, ".concat(R75, ")") : undefined,
236
252
  fill: isFocused ? "var(--ds-text-selected, #000)" : "var(--ds-text, #000)",
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/select",
3
- "version": "16.1.7",
3
+ "version": "16.1.9",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/select",
3
- "version": "16.1.7",
3
+ "version": "16.1.9",
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/"
@@ -33,7 +33,7 @@
33
33
  "@atlaskit/analytics-next": "^9.0.0",
34
34
  "@atlaskit/icon": "^21.11.0",
35
35
  "@atlaskit/spinner": "^15.4.0",
36
- "@atlaskit/theme": "^12.3.0",
36
+ "@atlaskit/theme": "^12.4.0",
37
37
  "@atlaskit/tokens": "^1.2.0",
38
38
  "@atlaskit/visually-hidden": "^1.1.0",
39
39
  "@babel/runtime": "^7.0.0",
@@ -54,12 +54,12 @@
54
54
  "react-dom": "^16.8.0"
55
55
  },
56
56
  "devDependencies": {
57
- "@atlaskit/button": "^16.5.0",
57
+ "@atlaskit/button": "^16.6.0",
58
58
  "@atlaskit/checkbox": "^12.4.0",
59
59
  "@atlaskit/docs": "*",
60
60
  "@atlaskit/drawer": "^7.4.0",
61
- "@atlaskit/form": "^8.8.0",
62
- "@atlaskit/logo": "^13.11.0",
61
+ "@atlaskit/form": "^8.10.0",
62
+ "@atlaskit/logo": "^13.13.0",
63
63
  "@atlaskit/modal-dialog": "^12.4.0",
64
64
  "@atlaskit/radio": "^5.4.0",
65
65
  "@atlaskit/section-message": "^6.3.0",
package/report.api.md CHANGED
@@ -47,6 +47,7 @@ import { NoticeProps } from 'react-select';
47
47
  import { OnChangeValue } from 'react-select';
48
48
  import { OptionProps as OptionProps_2 } from 'react-select';
49
49
  import { Options } from 'react-select';
50
+ import { PlaceholderProps as PlaceholderProps_2 } from 'react-select';
50
51
  import { PopperProps } from 'react-popper';
51
52
  import { PureComponent } from 'react';
52
53
  import { default as React_2 } from 'react';
@@ -696,6 +697,12 @@ export interface OptionType {
696
697
  value: number | string;
697
698
  }
698
699
 
700
+ // @public (undocumented)
701
+ export type PlaceholderProps<
702
+ Option,
703
+ IsMulti extends boolean = false,
704
+ > = PlaceholderProps_2<Option, IsMulti>;
705
+
699
706
  // @public (undocumented)
700
707
  type PopperPropsNoChildren<Modifiers> = Omit<
701
708
  PopperProps<Modifiers>,