@commercetools-uikit/selectable-search-input 15.15.0 → 16.0.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.
@@ -54,8 +54,8 @@ function ownKeys$2(object, enumerableOnly) { var keys = _Object$keys__default["d
54
54
 
55
55
  function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$2(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$2(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
56
56
 
57
- var getInputContainerBorderColor = function getInputContainerBorderColor(props) {
58
- var defaultColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : designSystem.designTokens.borderColorForInput;
57
+ const getInputContainerBorderColor = function (props) {
58
+ let defaultColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : designSystem.designTokens.borderColorForInput;
59
59
 
60
60
  if (props.isDisabled) {
61
61
  return designSystem.designTokens.borderColorForInputWhenDisabled;
@@ -76,7 +76,7 @@ var getInputContainerBorderColor = function getInputContainerBorderColor(props)
76
76
  return defaultColor;
77
77
  };
78
78
 
79
- var getInputFontColor = function getInputFontColor(props) {
79
+ const getInputFontColor = props => {
80
80
  if (props.isDisabled) {
81
81
  return designSystem.designTokens.fontColorForInputWhenDisabled;
82
82
  }
@@ -96,7 +96,7 @@ var getInputFontColor = function getInputFontColor(props) {
96
96
  return designSystem.designTokens.fontColorForInput;
97
97
  };
98
98
 
99
- var getInputBoxShadow = function getInputBoxShadow(props) {
99
+ const getInputBoxShadow = props => {
100
100
  if (props.hasError) {
101
101
  return designSystem.designTokens.shadowForInputWhenError;
102
102
  }
@@ -108,15 +108,11 @@ var getInputBoxShadow = function getInputBoxShadow(props) {
108
108
  return designSystem.designTokens.shadowForInput;
109
109
  };
110
110
 
111
- var getSelectableSearchInputStyles = function getSelectableSearchInputStyles(props) {
112
- return [inputUtils.getInputStyles(props), /*#__PURE__*/react.css("border:none;box-shadow:none;background:none;&,&:focus,&:focus:not(:read-only){box-shadow:none;}&:focus,&:hover{background-color:transparent!important;}width:100%;color:", getInputFontColor(props), ";" + ("" ), "" )];
113
- };
111
+ const getSelectableSearchInputStyles = props => [inputUtils.getInputStyles(props), /*#__PURE__*/react.css("border:none;box-shadow:none;background:none;&,&:focus,&:focus:not(:read-only){box-shadow:none;}&:focus,&:hover{background-color:transparent!important;}width:100%;color:", getInputFontColor(props), ";" + ("" ), "" )];
114
112
 
115
- var getButtonStyles = function getButtonStyles() {
116
- return /*#__PURE__*/react.css("border:none;background:none;height:100%;border-top-right-radius:", designSystem.designTokens.borderRadiusForInput, ";border-bottom-right-radius:", designSystem.designTokens.borderRadiusForInput, ";border-left:none;align-items:center;transition:border-color ", designSystem.designTokens.transitionStandard, ",background-color ", designSystem.designTokens.transitionStandard, ";transition:border-color ", designSystem.designTokens.transitionStandard, ",box-shadow ", designSystem.designTokens.transitionStandard, ";margin-right:", designSystem.designTokens.marginRightForClearInputIcon, ";" + ("" ), "" );
117
- };
113
+ const getButtonStyles = () => /*#__PURE__*/react.css("border:none;background:none;height:100%;border-top-right-radius:", designSystem.designTokens.borderRadiusForInput, ";border-bottom-right-radius:", designSystem.designTokens.borderRadiusForInput, ";border-left:none;align-items:center;transition:border-color ", designSystem.designTokens.transitionStandard, ",background-color ", designSystem.designTokens.transitionStandard, ";transition:border-color ", designSystem.designTokens.transitionStandard, ",box-shadow ", designSystem.designTokens.transitionStandard, ";margin-right:", designSystem.designTokens.marginRightForClearInputIcon, ";" + ("" ), "" );
118
114
 
119
- var getIconColor = function getIconColor(props, defaultColor) {
115
+ const getIconColor = (props, defaultColor) => {
120
116
  if (props.isDisabled) {
121
117
  return designSystem.designTokens.fontColorForInputWhenDisabled;
122
118
  }
@@ -128,15 +124,11 @@ var getIconColor = function getIconColor(props, defaultColor) {
128
124
  return defaultColor;
129
125
  };
130
126
 
131
- var getClearIconButtonStyles = function getClearIconButtonStyles(props) {
132
- return [getButtonStyles(), /*#__PURE__*/react.css("fill:", getIconColor(props, designSystem.designTokens.fontColorForClearInputIcon), ";&:hover{fill:", getIconColor(props, designSystem.designTokens.fontColorForClearInputIconWhenHovered), ";}" + ("" ), "" )];
133
- };
127
+ const getClearIconButtonStyles = props => [getButtonStyles(), /*#__PURE__*/react.css("fill:", getIconColor(props, designSystem.designTokens.fontColorForClearInputIcon), ";&:hover{fill:", getIconColor(props, designSystem.designTokens.fontColorForClearInputIconWhenHovered), ";}" + ("" ), "" )];
134
128
 
135
- var getSearchIconButtonStyles = function getSearchIconButtonStyles(props) {
136
- return [getButtonStyles(), /*#__PURE__*/react.css("margin-right:", designSystem.designTokens.marginRightForSearchInputIcon, ";fill:", getIconColor(props, designSystem.designTokens.fontColorForSearchInputIcon), ";cursor:", props.isReadOnly ? 'default' : 'pointer', ";&:hover{fill:", getIconColor(props, designSystem.designTokens.fontColorForSearchInputIconWhenHovered), ";}" + ("" ), "" )];
137
- };
129
+ const getSearchIconButtonStyles = props => [getButtonStyles(), /*#__PURE__*/react.css("margin-right:", designSystem.designTokens.marginRightForSearchInputIcon, ";fill:", getIconColor(props, designSystem.designTokens.fontColorForSearchInputIcon), ";cursor:", props.isReadOnly ? 'default' : 'pointer', ";&:hover{fill:", getIconColor(props, designSystem.designTokens.fontColorForSearchInputIconWhenHovered), ";}" + ("" ), "" )];
138
130
 
139
- var getBackgroundColor = function getBackgroundColor(props, defaultColor) {
131
+ const getBackgroundColor = (props, defaultColor) => {
140
132
  if (props.isDisabled) {
141
133
  return designSystem.designTokens.backgroundColorForInputWhenDisabled;
142
134
  }
@@ -148,12 +140,10 @@ var getBackgroundColor = function getBackgroundColor(props, defaultColor) {
148
140
  return defaultColor;
149
141
  };
150
142
 
151
- var getSelectableSearchInputContainerStyles = function getSelectableSearchInputContainerStyles(props) {
152
- return [/*#__PURE__*/react.css("display:flex;align-items:center;background-color:", getBackgroundColor(props, designSystem.designTokens.backgroundColorForInput), ";border:1px solid ", getInputContainerBorderColor(props), ";border-radius:", designSystem.designTokens.borderRadiusForInput, ";box-shadow:", getInputBoxShadow(props), ";height:", designSystem.designTokens.heightForInput, ";box-sizing:border-box;border-top-left-radius:0;border-bottom-left-radius:0;margin-left:0;width:100%;transition:border-color ", designSystem.designTokens.transitionStandard, ",background-color ", designSystem.designTokens.transitionStandard, ";&::placeholder{color:", designSystem.designTokens.placeholderFontColorForInput, ";}&:hover{border-color:", getInputContainerBorderColor(props, designSystem.designTokens.borderColorForInputWhenHovered), ";background-color:", getBackgroundColor(props, designSystem.designTokens.backgroundColorForInputWhenHovered), ";}&:focus{border-color:", designSystem.designTokens.borderColorForInputWhenFocused, ";}" + ("" ), "" ), !props.isDisabled && !props.isReadOnly && /*#__PURE__*/react.css("&:focus-within{border-color:", designSystem.designTokens.borderColorForInputWhenFocused, ";box-shadow:", designSystem.designTokens.boxShadowForDatetimeInputWhenHovered, " ", designSystem.designTokens.borderColorForInputWhenFocused, ";}" + ("" ), "" )];
153
- };
143
+ const getSelectableSearchInputContainerStyles = props => [/*#__PURE__*/react.css("display:flex;align-items:center;background-color:", getBackgroundColor(props, designSystem.designTokens.backgroundColorForInput), ";border:1px solid ", getInputContainerBorderColor(props), ";border-radius:", designSystem.designTokens.borderRadiusForInput, ";box-shadow:", getInputBoxShadow(props), ";height:", designSystem.designTokens.heightForInput, ";box-sizing:border-box;border-top-left-radius:0;border-bottom-left-radius:0;margin-left:0;width:100%;transition:border-color ", designSystem.designTokens.transitionStandard, ",background-color ", designSystem.designTokens.transitionStandard, ";&::placeholder{color:", designSystem.designTokens.placeholderFontColorForInput, ";}&:hover{border-color:", getInputContainerBorderColor(props, designSystem.designTokens.borderColorForInputWhenHovered), ";background-color:", getBackgroundColor(props, designSystem.designTokens.backgroundColorForInputWhenHovered), ";}&:focus{border-color:", designSystem.designTokens.borderColorForInputWhenFocused, ";}" + ("" ), "" ), !props.isDisabled && !props.isReadOnly && /*#__PURE__*/react.css("&:focus-within{border-color:", designSystem.designTokens.borderColorForInputWhenFocused, ";box-shadow:", designSystem.designTokens.boxShadowForDatetimeInputWhenHovered, " ", designSystem.designTokens.borderColorForInputWhenFocused, ";}" + ("" ), "" )];
154
144
 
155
- var createSelectableSelectStyles = function createSelectableSelectStyles(_ref) {
156
- var hasWarning = _ref.hasWarning,
145
+ const createSelectableSelectStyles = _ref => {
146
+ let hasWarning = _ref.hasWarning,
157
147
  hasError = _ref.hasError,
158
148
  isDisabled = _ref.isDisabled,
159
149
  isReadOnly = _ref.isReadOnly,
@@ -161,83 +151,77 @@ var createSelectableSelectStyles = function createSelectableSelectStyles(_ref) {
161
151
  isNewTheme = _ref.isNewTheme,
162
152
  dropdownHasFocus = _ref.dropdownHasFocus,
163
153
  textInputHasFocus = _ref.textInputHasFocus;
164
- var selectStyles = selectUtils.createSelectStyles({
165
- hasWarning: hasWarning,
166
- hasError: hasError,
167
- menuPortalZIndex: menuPortalZIndex,
168
- isNewTheme: isNewTheme,
169
- isDisabled: isDisabled,
170
- isReadOnly: isReadOnly
154
+ const selectStyles = selectUtils.createSelectStyles({
155
+ hasWarning,
156
+ hasError,
157
+ menuPortalZIndex,
158
+ isNewTheme,
159
+ isDisabled,
160
+ isReadOnly
171
161
  });
172
162
  return _objectSpread$2(_objectSpread$2({}, selectStyles), {}, {
173
- control: function control(base, state) {
174
- return _objectSpread$2(_objectSpread$2({}, selectStyles.control(base, state)), {}, {
175
- padding: designSystem.designTokens.paddingForSelectableSearchInputDropdown,
176
- borderTopRightRadius: '0',
177
- borderBottomRightRadius: '0',
178
- borderRight: '0',
179
- height: '100%',
180
- borderColor: function () {
181
- if (isDisabled) return "".concat(designSystem.designTokens.borderColorForInputWhenDisabled, " !important");
182
- if (isReadOnly) return "".concat(designSystem.designTokens.borderColorForInputWhenReadonly, " !important");
183
- if (hasError) return designSystem.designTokens.borderColorForInputWhenError;
184
- if (hasWarning) return designSystem.designTokens.borderColorForInputWhenWarning;
185
-
186
- if (textInputHasFocus && !isNewTheme) {
187
- return designSystem.designTokens.borderColorForInputWhenFocused;
188
- }
163
+ control: (base, state) => _objectSpread$2(_objectSpread$2({}, selectStyles.control(base, state)), {}, {
164
+ padding: designSystem.designTokens.paddingForSelectableSearchInputDropdown,
165
+ borderTopRightRadius: '0',
166
+ borderBottomRightRadius: '0',
167
+ borderRight: '0',
168
+ height: '100%',
169
+ borderColor: (() => {
170
+ if (isDisabled) return "".concat(designSystem.designTokens.borderColorForInputWhenDisabled, " !important");
171
+ if (isReadOnly) return "".concat(designSystem.designTokens.borderColorForInputWhenReadonly, " !important");
172
+ if (hasError) return designSystem.designTokens.borderColorForInputWhenError;
173
+ if (hasWarning) return designSystem.designTokens.borderColorForInputWhenWarning;
174
+
175
+ if (textInputHasFocus && !isNewTheme) {
176
+ return designSystem.designTokens.borderColorForInputWhenFocused;
177
+ }
189
178
 
190
- if (dropdownHasFocus) {
191
- return designSystem.designTokens.borderColorForInputWhenFocused;
192
- }
179
+ if (dropdownHasFocus) {
180
+ return designSystem.designTokens.borderColorForInputWhenFocused;
181
+ }
193
182
 
194
- return designSystem.designTokens.borderColorForInput;
195
- }(),
196
- cursor: function () {
197
- if (isDisabled) return 'not-allowed';
198
- if (isReadOnly) return "default";
199
- return 'pointer';
200
- }(),
183
+ return designSystem.designTokens.borderColorForInput;
184
+ })(),
185
+ cursor: (() => {
186
+ if (isDisabled) return 'not-allowed';
187
+ if (isReadOnly) return "default";
188
+ return 'pointer';
189
+ })(),
190
+ backgroundColor: getBackgroundColor({
191
+ isDisabled,
192
+ isReadOnly
193
+ }, base.backgroundColor || ''),
194
+ '&:hover': {
201
195
  backgroundColor: getBackgroundColor({
202
- isDisabled: isDisabled,
203
- isReadOnly: isReadOnly
204
- }, base.backgroundColor || ''),
205
- '&:hover': {
206
- backgroundColor: getBackgroundColor({
207
- isDisabled: isDisabled,
208
- isReadOnly: isReadOnly
209
- }, designSystem.designTokens.backgroundColorForInputWhenHovered)
210
- }
211
- });
212
- },
213
- singleValue: function singleValue(base) {
214
- return _objectSpread$2(_objectSpread$2({}, base), {}, {
215
- marginLeft: 0,
216
- maxWidth: 'initial',
217
- color: getInputFontColor({
218
- hasWarning: hasWarning,
219
- hasError: hasError,
220
- isDisabled: isDisabled,
221
- isReadOnly: isReadOnly
222
- })
223
- });
224
- },
225
- dropdownIndicator: function dropdownIndicator() {
226
- return {
227
- fill: isReadOnly ? designSystem.designTokens.fontColorForInputWhenDisabled : designSystem.designTokens.fontColorForSelectInputIcon
228
- };
229
- }
196
+ isDisabled,
197
+ isReadOnly
198
+ }, designSystem.designTokens.backgroundColorForInputWhenHovered)
199
+ }
200
+ }),
201
+ singleValue: base => _objectSpread$2(_objectSpread$2({}, base), {}, {
202
+ marginLeft: 0,
203
+ maxWidth: 'initial',
204
+ color: getInputFontColor({
205
+ hasWarning,
206
+ hasError,
207
+ isDisabled,
208
+ isReadOnly
209
+ })
210
+ }),
211
+ dropdownIndicator: () => ({
212
+ fill: isReadOnly ? designSystem.designTokens.fontColorForInputWhenDisabled : designSystem.designTokens.fontColorForSelectInputIcon
213
+ })
230
214
  });
231
215
  };
232
216
 
233
- var _excluded = ["id"];
217
+ const _excluded = ["id"];
234
218
 
235
219
  function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
236
220
 
237
221
  function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$1(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$1(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
238
222
 
239
- var _SingleValue = function SingleValue(_ref) {
240
- var id = _ref.id,
223
+ const SingleValue = _ref => {
224
+ let id = _ref.id,
241
225
  props = _objectWithoutProperties(_ref, _excluded);
242
226
 
243
227
  return jsxRuntime.jsx(Select.components.SingleValue, _objectSpread$1(_objectSpread$1({}, props), {}, {
@@ -248,29 +232,29 @@ var _SingleValue = function SingleValue(_ref) {
248
232
  }));
249
233
  };
250
234
 
251
- _SingleValue.propTypes = {};
235
+ SingleValue.propTypes = {};
252
236
 
253
- var SelectableSelect = function SelectableSelect(props) {
254
- var intl = reactIntl.useIntl();
237
+ const SelectableSelect = props => {
238
+ const intl = reactIntl.useIntl();
255
239
 
256
- var _useTheme = designSystem.useTheme(),
257
- isNewTheme = _useTheme.isNewTheme;
240
+ const _useTheme = designSystem.useTheme(),
241
+ isNewTheme = _useTheme.isNewTheme;
258
242
 
259
- var dropdownStyles = createSelectableSelectStyles({
243
+ const dropdownStyles = createSelectableSelectStyles({
260
244
  hasWarning: props.hasWarning,
261
245
  hasError: props.hasError,
262
246
  isDisabled: props.isDisabled,
263
247
  isReadOnly: props.isReadOnly,
264
248
  menuPortalZIndex: props.menuPortalZIndex,
265
- isNewTheme: isNewTheme,
249
+ isNewTheme,
266
250
  dropdownHasFocus: props.dropdownHasFocus,
267
251
  textInputHasFocus: props.textInputHasFocus
268
252
  });
269
- var onChange = props.onChange,
270
- name = props.name,
271
- id = props.id,
272
- textInputRef = props.textInputRef;
273
- var handleDropdownChange = react$1.useCallback(function (nextSelectedOptions) {
253
+ const onChange = props.onChange,
254
+ name = props.name,
255
+ id = props.id,
256
+ textInputRef = props.textInputRef;
257
+ const handleDropdownChange = react$1.useCallback(nextSelectedOptions => {
274
258
  var _textInputRef$current;
275
259
 
276
260
  if (onChange) {
@@ -294,11 +278,9 @@ var SelectableSelect = function SelectableSelect(props) {
294
278
  maxMenuHeight: props.maxMenuHeight,
295
279
  closeMenuOnSelect: props.closeMenuOnSelect,
296
280
  components: {
297
- SingleValue: function SingleValue(innerProps) {
298
- return jsxRuntime.jsx(_SingleValue, _objectSpread$1(_objectSpread$1({}, innerProps), {}, {
299
- id: props.id
300
- }));
301
- },
281
+ SingleValue: innerProps => jsxRuntime.jsx(SingleValue, _objectSpread$1(_objectSpread$1({}, innerProps), {}, {
282
+ id: props.id
283
+ })),
302
284
  DropdownIndicator: selectUtils.DropdownIndicator
303
285
  },
304
286
  options: props.options,
@@ -311,12 +293,12 @@ var SelectableSelect = function SelectableSelect(props) {
311
293
  onBlur: props.handleDropdownBlur,
312
294
  onChange: handleDropdownChange,
313
295
  onInputChange: props.onMenuInputChange,
314
- noOptionsMessage: props.noMenuOptionsMessage || function (_ref2) {
315
- var inputValue = _ref2.inputValue;
296
+ noOptionsMessage: props.noMenuOptionsMessage || (_ref2 => {
297
+ let inputValue = _ref2.inputValue;
316
298
  return !inputValue || inputValue === '' ? intl.formatMessage(selectUtils.messages.noOptionsMessageWithoutInputValue) : intl.formatMessage(selectUtils.messages.noOptionsMessageWithInputValue, {
317
- inputValue: inputValue
299
+ inputValue
318
300
  });
319
- }
301
+ })
320
302
  });
321
303
  };
322
304
 
@@ -327,22 +309,18 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["def
327
309
 
328
310
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context3, _context4; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys(Object(source), !0)).call(_context3, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys(Object(source))).call(_context4, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
329
311
 
330
- var Container = /*#__PURE__*/_styled__default["default"]("div", {
312
+ const Container = /*#__PURE__*/_styled__default["default"]("div", {
331
313
  target: "encv1cf0"
332
314
  } )({
333
315
  name: "zjik7",
334
316
  styles: "display:flex"
335
317
  } );
336
318
 
337
- var getTextInputName = function getTextInputName(name) {
338
- return name ? "".concat(name, ".textInput") : undefined;
339
- };
319
+ const getTextInputName = name => name ? "".concat(name, ".textInput") : undefined;
340
320
 
341
- var getDropdownName = function getDropdownName(name) {
342
- return name ? "".concat(name, ".dropdown") : undefined;
343
- };
321
+ const getDropdownName = name => name ? "".concat(name, ".dropdown") : undefined;
344
322
 
345
- var defaultProps = {
323
+ const defaultProps = {
346
324
  horizontalConstraint: 'scale',
347
325
  isClearable: true,
348
326
  menuHorizontalConstraint: 3,
@@ -350,37 +328,35 @@ var defaultProps = {
350
328
  menuPortalZIndex: 1,
351
329
  options: []
352
330
  };
353
- var selectableSearchInputSequentialId = utils.createSequentialId('selectable-search-input-');
331
+ const selectableSearchInputSequentialId = utils.createSequentialId('selectable-search-input-');
354
332
 
355
- var isOptionObject = function isOptionObject(option) {
356
- return option.options !== undefined;
357
- };
333
+ const isOptionObject = option => option.options !== undefined;
358
334
 
359
- var SelectableSearchInput = function SelectableSearchInput(props) {
335
+ const SelectableSearchInput = props => {
360
336
  var _context;
361
337
 
362
- var _useToggleState = hooks.useToggleState(false),
363
- _useToggleState2 = _slicedToArray(_useToggleState, 2),
364
- textInputHasFocus = _useToggleState2[0],
365
- toggleTextInputHasFocus = _useToggleState2[1];
338
+ const _useToggleState = hooks.useToggleState(false),
339
+ _useToggleState2 = _slicedToArray(_useToggleState, 2),
340
+ textInputHasFocus = _useToggleState2[0],
341
+ toggleTextInputHasFocus = _useToggleState2[1];
366
342
 
367
- var _useToggleState3 = hooks.useToggleState(false),
368
- _useToggleState4 = _slicedToArray(_useToggleState3, 2),
369
- dropdownHasFocus = _useToggleState4[0],
370
- toggleDropdownHasFocus = _useToggleState4[1];
343
+ const _useToggleState3 = hooks.useToggleState(false),
344
+ _useToggleState4 = _slicedToArray(_useToggleState3, 2),
345
+ dropdownHasFocus = _useToggleState4[0],
346
+ toggleDropdownHasFocus = _useToggleState4[1];
371
347
 
372
- var _useState = react$1.useState(props.value.text || ''),
373
- _useState2 = _slicedToArray(_useState, 2),
374
- searchValue = _useState2[0],
375
- setSearchValue = _useState2[1];
348
+ const _useState = react$1.useState(props.value.text || ''),
349
+ _useState2 = _slicedToArray(_useState, 2),
350
+ searchValue = _useState2[0],
351
+ setSearchValue = _useState2[1];
376
352
 
377
- var containerRef = react$1.useRef(null);
378
- var textInputRef = react$1.useRef(null);
353
+ const containerRef = react$1.useRef(null);
354
+ const textInputRef = react$1.useRef(null);
379
355
 
380
- var _useTheme = designSystem.useTheme(),
381
- isNewTheme = _useTheme.isNewTheme;
356
+ const _useTheme = designSystem.useTheme(),
357
+ isNewTheme = _useTheme.isNewTheme;
382
358
 
383
- var optionsWithoutGroups = _flatMapInstanceProperty__default["default"](_context = props.options).call(_context, function (option) {
359
+ const optionsWithoutGroups = _flatMapInstanceProperty__default["default"](_context = props.options).call(_context, option => {
384
360
  if (isOptionObject(option)) {
385
361
  return option.options;
386
362
  }
@@ -388,11 +364,9 @@ var SelectableSearchInput = function SelectableSearchInput(props) {
388
364
  return option;
389
365
  });
390
366
 
391
- var selectedOption = _findInstanceProperty__default["default"](optionsWithoutGroups).call(optionsWithoutGroups, function (option) {
392
- return option.value === props.value.option;
393
- });
367
+ const selectedOption = _findInstanceProperty__default["default"](optionsWithoutGroups).call(optionsWithoutGroups, option => option.value === props.value.option);
394
368
 
395
- var selectablSearchInputId = hooks.useFieldId(props.id, selectableSearchInputSequentialId);
369
+ const selectablSearchInputId = hooks.useFieldId(props.id, selectableSearchInputSequentialId);
396
370
 
397
371
  if (!props.isReadOnly) ;
398
372
 
@@ -401,10 +375,10 @@ var SelectableSearchInput = function SelectableSearchInput(props) {
401
375
  menuPortalTarget: props.menuPortalTarget,
402
376
  componentName: 'SelectableSearchInput'
403
377
  });
404
- var onFocus = props.onFocus,
405
- onBlur = props.onBlur,
406
- name = props.name;
407
- var handleTextInputFocus = react$1.useCallback(function () {
378
+ const onFocus = props.onFocus,
379
+ onBlur = props.onBlur,
380
+ name = props.name;
381
+ const handleTextInputFocus = react$1.useCallback(() => {
408
382
  if (onFocus) {
409
383
  onFocus({
410
384
  target: {
@@ -416,7 +390,7 @@ var SelectableSearchInput = function SelectableSearchInput(props) {
416
390
 
417
391
  toggleTextInputHasFocus(true);
418
392
  }, [toggleTextInputHasFocus, onFocus, selectablSearchInputId, name]);
419
- var handleTextInputBlur = react$1.useCallback(function () {
393
+ const handleTextInputBlur = react$1.useCallback(() => {
420
394
  if (onBlur) {
421
395
  onBlur({
422
396
  target: {
@@ -429,7 +403,7 @@ var SelectableSearchInput = function SelectableSearchInput(props) {
429
403
  toggleTextInputHasFocus(false);
430
404
  }, [toggleTextInputHasFocus, onBlur, selectablSearchInputId, name]);
431
405
 
432
- var handleClear = function handleClear() {
406
+ const handleClear = () => {
433
407
  setSearchValue('');
434
408
 
435
409
  if (props.onReset) {
@@ -437,7 +411,7 @@ var SelectableSearchInput = function SelectableSearchInput(props) {
437
411
  }
438
412
  };
439
413
 
440
- var handleChange = function handleChange(event) {
414
+ const handleChange = event => {
441
415
  setSearchValue(event.target.value);
442
416
 
443
417
  if (props.onChange) {
@@ -451,7 +425,7 @@ var SelectableSearchInput = function SelectableSearchInput(props) {
451
425
  }
452
426
  };
453
427
 
454
- var handleSubmit = function handleSubmit(event) {
428
+ const handleSubmit = event => {
455
429
  event.preventDefault();
456
430
 
457
431
  if (props.onSubmit) {
@@ -464,9 +438,9 @@ var SelectableSearchInput = function SelectableSearchInput(props) {
464
438
  }
465
439
  };
466
440
 
467
- var dropdownName = getDropdownName(props.name);
468
- var dropdownId = SelectableSearchInput.getDropdownId(selectablSearchInputId);
469
- var handleDropdownFocus = react$1.useCallback(function () {
441
+ const dropdownName = getDropdownName(props.name);
442
+ const dropdownId = SelectableSearchInput.getDropdownId(selectablSearchInputId);
443
+ const handleDropdownFocus = react$1.useCallback(() => {
470
444
  if (onFocus) {
471
445
  onFocus({
472
446
  target: {
@@ -478,7 +452,7 @@ var SelectableSearchInput = function SelectableSearchInput(props) {
478
452
 
479
453
  toggleDropdownHasFocus(true);
480
454
  }, [onFocus, toggleDropdownHasFocus, dropdownName, dropdownId]);
481
- var handleDropdownBlur = react$1.useCallback(function () {
455
+ const handleDropdownBlur = react$1.useCallback(() => {
482
456
  if (onBlur) {
483
457
  onBlur({
484
458
  target: {
@@ -490,7 +464,7 @@ var SelectableSearchInput = function SelectableSearchInput(props) {
490
464
 
491
465
  toggleDropdownHasFocus(false);
492
466
  }, [toggleDropdownHasFocus, onBlur, dropdownName, dropdownId]);
493
- var handleContainerBlur = react$1.useCallback(function (event) {
467
+ const handleContainerBlur = react$1.useCallback(event => {
494
468
  var _containerRef$current;
495
469
 
496
470
  // ensures that both fields are marked as touched when one of them
@@ -553,7 +527,7 @@ var SelectableSearchInput = function SelectableSearchInput(props) {
553
527
  "aria-invalid": props['aria-invalid'],
554
528
  "aria-errormessage": props['aria-errormessage'],
555
529
  "data-testid": "selectable-input",
556
- onKeyDown: function onKeyDown(event) {
530
+ onKeyDown: event => {
557
531
  if (!props.isReadOnly && event.key === 'Enter') {
558
532
  handleSubmit(event);
559
533
  }
@@ -580,7 +554,7 @@ SelectableSearchInput.propTypes = {};
580
554
  SelectableSearchInput.displayName = 'SelectableSearchInput';
581
555
  SelectableSearchInput.defaultProps = defaultProps;
582
556
 
583
- SelectableSearchInput.isEmpty = function (formValue) {
557
+ SelectableSearchInput.isEmpty = formValue => {
584
558
  var _context2;
585
559
 
586
560
  return !formValue || _trimInstanceProperty__default["default"](_context2 = formValue.text).call(_context2) === '';
@@ -591,7 +565,7 @@ SelectableSearchInput.getDropdownId = getDropdownName;
591
565
  var SelectableSearchInput$1 = SelectableSearchInput;
592
566
 
593
567
  // NOTE: This string will be replaced on build time with the package version.
594
- var version = "15.15.0";
568
+ var version = "16.0.0";
595
569
 
596
570
  exports["default"] = SelectableSearchInput$1;
597
571
  exports.version = version;