@instructure/ui-select 11.7.3-snapshot-7 → 11.7.3-snapshot-26

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
@@ -3,9 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [11.7.3-snapshot-7](https://github.com/instructure/instructure-ui/compare/v11.7.2...v11.7.3-snapshot-7) (2026-04-29)
6
+ ## [11.7.3-snapshot-26](https://github.com/instructure/instructure-ui/compare/v11.7.2...v11.7.3-snapshot-26) (2026-05-05)
7
7
 
8
- **Note:** Version bump only for package @instructure/ui-select
8
+
9
+ ### Bug Fixes
10
+
11
+ * **many:** update dependencies, remove lots of Babel plugins, remove Webpack 4 support ([f916fca](https://github.com/instructure/instructure-ui/commit/f916fcafdddcb2d7de401f93e8ff92cfdfa47bba))
9
12
 
10
13
 
11
14
 
@@ -32,6 +32,11 @@ id: Select.Group
32
32
  @module Group
33
33
  **/
34
34
  class Group extends Component {
35
+ static displayName = "Group";
36
+ static componentId = 'Select.Group';
37
+ static allowedProps = allowedProps;
38
+ static defaultProps = {};
39
+
35
40
  /* istanbul ignore next */
36
41
  render() {
37
42
  // this component is only used for prop validation. Select.Group children
@@ -39,9 +44,5 @@ class Group extends Component {
39
44
  return null;
40
45
  }
41
46
  }
42
- Group.displayName = "Group";
43
- Group.componentId = 'Select.Group';
44
- Group.allowedProps = allowedProps;
45
- Group.defaultProps = {};
46
47
  export default Group;
47
48
  export { Group };
@@ -32,6 +32,15 @@ id: Select.Option
32
32
  @module Option
33
33
  **/
34
34
  class Option extends Component {
35
+ static displayName = "Option";
36
+ static componentId = 'Select.Option';
37
+ static allowedProps = allowedProps;
38
+ static defaultProps = {
39
+ isHighlighted: false,
40
+ isSelected: false,
41
+ isDisabled: false
42
+ };
43
+
35
44
  /* istanbul ignore next */
36
45
  render() {
37
46
  // this component is only used for prop validation. Select.Option children
@@ -39,13 +48,5 @@ class Option extends Component {
39
48
  return null;
40
49
  }
41
50
  }
42
- Option.displayName = "Option";
43
- Option.componentId = 'Select.Option';
44
- Option.allowedProps = allowedProps;
45
- Option.defaultProps = {
46
- isHighlighted: false,
47
- isSelected: false,
48
- isDisabled: false
49
- };
50
51
  export default Option;
51
52
  export { Option };
@@ -1,8 +1,4 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
- const _excluded = ["id", "renderLabel", "children"],
3
- _excluded2 = ["renderLabel", "inputValue", "placeholder", "isRequired", "shouldNotWrap", "size", "isInline", "width", "htmlSize", "messages", "renderBeforeInput", "renderAfterInput", "onFocus", "onBlur", "onInputChange", "onRequestHideOptions", "layout"],
4
- _excluded3 = ["ref"];
5
- var _dec, _dec2, _class, _Select, _Options$Separator, _Options$Separator2, _IconArrowOpenUpLine, _IconArrowOpenDownLin;
1
+ var _dec, _dec2, _class;
6
2
  /*
7
3
  * The MIT License (MIT)
8
4
  *
@@ -50,8 +46,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
50
46
  // because the Select component is re-rendered on every prop change of the <Select.Option>
51
47
  // and with a large amount of options, this can cause a lot of unnecessary re-renders.
52
48
  const MemoedOption = /*#__PURE__*/memo(function Opt(props) {
53
- const optionsItemProps = props.optionsItemProps,
54
- children = props.children;
49
+ const {
50
+ optionsItemProps,
51
+ children
52
+ } = props;
55
53
  return (
56
54
  // The main <Options> that renders this is always an "ul"
57
55
  _jsx(Options.Item, {
@@ -76,58 +74,50 @@ category: components
76
74
  tags: autocomplete, typeahead, combobox, dropdown, search, form
77
75
  ---
78
76
  **/
79
- let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec(_class = _dec2(_class = (_Select = class Select extends Component {
80
- constructor(...args) {
81
- super(...args);
82
- this.SCROLL_TOLERANCE = 0.5;
83
- this.state = {
84
- hasInputRef: false
85
- };
86
- this.ref = null;
87
- this._input = null;
88
- this._defaultId = this.props.deterministicId();
89
- this._inputContainer = null;
90
- this._listView = null;
91
- // temporarily stores actionable options
92
- this._optionIds = [];
93
- // best guess for first calculation of list height
94
- this._optionHeight = 36;
95
- this.handleInputRef = node => {
96
- var _this$props$inputRef, _this$props;
97
- // ensures list is positioned with respect to input if list is open on mount
98
- if (!this.state.hasInputRef) {
99
- this.setState({
100
- hasInputRef: true
101
- });
102
- }
103
- this._input = node;
104
- (_this$props$inputRef = (_this$props = this.props).inputRef) === null || _this$props$inputRef === void 0 ? void 0 : _this$props$inputRef.call(_this$props, node);
105
- };
106
- this.handleListRef = node => {
107
- var _this$props$listRef, _this$props2;
108
- (_this$props$listRef = (_this$props2 = this.props).listRef) === null || _this$props$listRef === void 0 ? void 0 : _this$props$listRef.call(_this$props2, node);
109
-
110
- // store option height to calculate list maxHeight
111
- if (node && node.querySelector('[role="option"]')) {
112
- this._optionHeight = node.querySelector('[role="option"]').offsetHeight;
113
- }
114
- };
115
- this.handleInputContainerRef = node => {
116
- this._inputContainer = node;
117
- };
118
- }
77
+ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec(_class = _dec2(_class = class Select extends Component {
78
+ static displayName = "Select";
79
+ static componentId = 'Select';
80
+ SCROLL_TOLERANCE = 0.5;
81
+ static allowedProps = allowedProps;
82
+ static defaultProps = {
83
+ inputValue: '',
84
+ isShowingOptions: false,
85
+ size: 'medium',
86
+ // Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
87
+ interaction: undefined,
88
+ isRequired: false,
89
+ isInline: false,
90
+ visibleOptionsCount: 8,
91
+ placement: 'bottom stretch',
92
+ constrain: 'window',
93
+ shouldNotWrap: false,
94
+ scrollToHighlightedOption: true,
95
+ isOptionContentAppliedToInput: false
96
+ };
97
+ static Option = Option;
98
+ static Group = Group;
119
99
  componentDidMount() {
120
- var _this$props$makeStyle, _this$props3;
121
- (_this$props$makeStyle = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props3);
100
+ this.props.makeStyles?.();
122
101
  }
123
102
  componentDidUpdate() {
124
- var _this$props$makeStyle2, _this$props4;
125
- (_this$props$makeStyle2 = (_this$props4 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props4);
103
+ this.props.makeStyles?.();
126
104
  if (this.props.scrollToHighlightedOption) {
127
105
  // scroll option into view if needed
128
106
  requestAnimationFrame(() => this.scrollToOption(this.highlightedOptionId));
129
107
  }
130
108
  }
109
+ state = {
110
+ hasInputRef: false
111
+ };
112
+ ref = null;
113
+ _input = null;
114
+ _defaultId = this.props.deterministicId();
115
+ _inputContainer = null;
116
+ _listView = null;
117
+ // temporarily stores actionable options
118
+ _optionIds = [];
119
+ // best guess for first calculation of list height
120
+ _optionHeight = 36;
131
121
  focus() {
132
122
  this._input && this._input.focus();
133
123
  }
@@ -147,7 +137,7 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gen
147
137
  return this.props.id || this._defaultId;
148
138
  }
149
139
  get width() {
150
- return this._inputContainer ? this._inputContainer.offsetWidth : void 0;
140
+ return this._inputContainer ? this._inputContainer.offsetWidth : undefined;
151
141
  }
152
142
  get interaction() {
153
143
  return getInteraction({
@@ -196,10 +186,31 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gen
196
186
  return selectedOptionId[0];
197
187
  }
198
188
  if (selectedOptionId.length === 0) {
199
- return void 0;
189
+ return undefined;
200
190
  }
201
191
  return selectedOptionId;
202
192
  }
193
+ handleInputRef = node => {
194
+ // ensures list is positioned with respect to input if list is open on mount
195
+ if (!this.state.hasInputRef) {
196
+ this.setState({
197
+ hasInputRef: true
198
+ });
199
+ }
200
+ this._input = node;
201
+ this.props.inputRef?.(node);
202
+ };
203
+ handleListRef = node => {
204
+ this.props.listRef?.(node);
205
+
206
+ // store option height to calculate list maxHeight
207
+ if (node && node.querySelector('[role="option"]')) {
208
+ this._optionHeight = node.querySelector('[role="option"]').offsetHeight;
209
+ }
210
+ };
211
+ handleInputContainerRef = node => {
212
+ this._inputContainer = node;
213
+ };
203
214
  scrollToOption(id) {
204
215
  if (!this._listView || !id) return;
205
216
  const option = this._listView.querySelector(`[id="${CSS.escape(id)}"]`);
@@ -216,22 +227,25 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gen
216
227
  }
217
228
  }
218
229
  highlightOption(event, id) {
219
- const onRequestHighlightOption = this.props.onRequestHighlightOption;
230
+ const {
231
+ onRequestHighlightOption
232
+ } = this.props;
220
233
  if (id) {
221
- onRequestHighlightOption === null || onRequestHighlightOption === void 0 ? void 0 : onRequestHighlightOption(event, {
234
+ onRequestHighlightOption?.(event, {
222
235
  id
223
236
  });
224
237
  }
225
238
  }
226
239
  getEventHandlers() {
227
- const _this$props5 = this.props,
228
- isShowingOptions = _this$props5.isShowingOptions,
229
- onRequestShowOptions = _this$props5.onRequestShowOptions,
230
- onRequestHideOptions = _this$props5.onRequestHideOptions,
231
- onRequestSelectOption = _this$props5.onRequestSelectOption;
240
+ const {
241
+ isShowingOptions,
242
+ onRequestShowOptions,
243
+ onRequestHideOptions,
244
+ onRequestSelectOption
245
+ } = this.props;
232
246
  return this.interaction === 'enabled' ? {
233
247
  onRequestShowOptions: event => {
234
- onRequestShowOptions === null || onRequestShowOptions === void 0 ? void 0 : onRequestShowOptions(event);
248
+ onRequestShowOptions?.(event);
235
249
  const selectedOptionId = this.selectedOptionId;
236
250
  if (selectedOptionId && !Array.isArray(selectedOptionId)) {
237
251
  // highlight selected option on show
@@ -239,7 +253,7 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gen
239
253
  }
240
254
  },
241
255
  onRequestHideOptions: event => {
242
- onRequestHideOptions === null || onRequestHideOptions === void 0 ? void 0 : onRequestHideOptions(event);
256
+ onRequestHideOptions?.(event);
243
257
  },
244
258
  onRequestHighlightOption: (event, {
245
259
  id,
@@ -248,7 +262,7 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gen
248
262
  if (!isShowingOptions) return;
249
263
  const highlightedOptionId = this.highlightedOptionId;
250
264
  // if id exists, use that
251
- let highlightId = this._optionIds.indexOf(id) > -1 ? id : void 0;
265
+ let highlightId = this._optionIds.indexOf(id) > -1 ? id : undefined;
252
266
  if (!highlightId) {
253
267
  if (!highlightedOptionId) {
254
268
  // nothing highlighted yet, highlight first option
@@ -256,7 +270,7 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gen
256
270
  } else {
257
271
  // find next id based on direction
258
272
  const index = this._optionIds.indexOf(highlightedOptionId);
259
- highlightId = index > -1 ? this._optionIds[index + direction] : void 0;
273
+ highlightId = index > -1 ? this._optionIds[index + direction] : undefined;
260
274
  }
261
275
  }
262
276
  if (highlightId) {
@@ -275,7 +289,7 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gen
275
289
  }) => {
276
290
  if (id && this._optionIds.indexOf(id) !== -1) {
277
291
  // only select if id exists as a valid option
278
- onRequestSelectOption === null || onRequestSelectOption === void 0 ? void 0 : onRequestSelectOption(event, {
292
+ onRequestSelectOption?.(event, {
279
293
  id
280
294
  });
281
295
  }
@@ -283,19 +297,21 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gen
283
297
  } : {};
284
298
  }
285
299
  renderOption(option, data) {
286
- const getOptionProps = data.getOptionProps,
287
- getDisabledOptionProps = data.getDisabledOptionProps;
288
- const _option$props = option.props,
289
- id = _option$props.id,
290
- isDisabled = _option$props.isDisabled,
291
- isHighlighted = _option$props.isHighlighted,
292
- isSelected = _option$props.isSelected,
293
- renderBeforeLabel = _option$props.renderBeforeLabel,
294
- renderAfterLabel = _option$props.renderAfterLabel,
295
- children = _option$props.children;
300
+ const {
301
+ getOptionProps,
302
+ getDisabledOptionProps
303
+ } = data;
304
+ const {
305
+ id,
306
+ isDisabled,
307
+ isHighlighted,
308
+ isSelected,
309
+ renderBeforeLabel,
310
+ renderAfterLabel,
311
+ children
312
+ } = option.props;
296
313
  const getRenderOptionLabel = renderOptionLabel => {
297
- var _renderOptionLabel$pr;
298
- return typeof renderOptionLabel === 'function' && !(renderOptionLabel !== null && renderOptionLabel !== void 0 && (_renderOptionLabel$pr = renderOptionLabel.prototype) !== null && _renderOptionLabel$pr !== void 0 && _renderOptionLabel$pr.isReactComponent) ? renderOptionLabel.bind(null, {
314
+ return typeof renderOptionLabel === 'function' && !renderOptionLabel?.prototype?.isReactComponent ? renderOptionLabel.bind(null, {
299
315
  id,
300
316
  isDisabled,
301
317
  isSelected,
@@ -342,20 +358,23 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gen
342
358
  });
343
359
  }
344
360
  renderGroup(group, data) {
345
- const getOptionProps = data.getOptionProps,
346
- getDisabledOptionProps = data.getDisabledOptionProps,
347
- isFirstChild = data.isFirstChild,
348
- isLastChild = data.isLastChild,
349
- afterGroup = data.afterGroup;
350
- const _group$props = group.props,
351
- id = _group$props.id,
352
- renderLabel = _group$props.renderLabel,
353
- children = _group$props.children,
354
- rest = _objectWithoutProperties(_group$props, _excluded);
361
+ const {
362
+ getOptionProps,
363
+ getDisabledOptionProps,
364
+ isFirstChild,
365
+ isLastChild,
366
+ afterGroup
367
+ } = data;
368
+ const {
369
+ id,
370
+ renderLabel,
371
+ children,
372
+ ...rest
373
+ } = group.props;
355
374
  const groupChildren = [];
356
375
  // add a separator above
357
376
  if (!isFirstChild && !afterGroup) {
358
- groupChildren.push(_Options$Separator || (_Options$Separator = _jsx(Options.Separator, {})));
377
+ groupChildren.push(_jsx(Options.Separator, {}));
359
378
  }
360
379
  // create a sublist as a group
361
380
  // a wrapping listitem will be created by Options
@@ -374,20 +393,23 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gen
374
393
  }));
375
394
  // add a separator below
376
395
  if (!isLastChild) {
377
- groupChildren.push(_Options$Separator2 || (_Options$Separator2 = _jsx(Options.Separator, {})));
396
+ groupChildren.push(_jsx(Options.Separator, {}));
378
397
  }
379
398
  return groupChildren;
380
399
  }
381
400
  renderList(data) {
382
- const getListProps = data.getListProps,
383
- getOptionProps = data.getOptionProps,
384
- getDisabledOptionProps = data.getDisabledOptionProps;
385
- const _this$props6 = this.props,
386
- isShowingOptions = _this$props6.isShowingOptions,
387
- optionsMaxWidth = _this$props6.optionsMaxWidth,
388
- optionsMaxHeight = _this$props6.optionsMaxHeight,
389
- visibleOptionsCount = _this$props6.visibleOptionsCount,
390
- children = _this$props6.children;
401
+ const {
402
+ getListProps,
403
+ getOptionProps,
404
+ getDisabledOptionProps
405
+ } = data;
406
+ const {
407
+ isShowingOptions,
408
+ optionsMaxWidth,
409
+ optionsMaxHeight,
410
+ visibleOptionsCount,
411
+ children
412
+ } = this.props;
391
413
  let lastWasGroup = false;
392
414
  const viewProps = isShowingOptions ? {
393
415
  display: 'block',
@@ -438,16 +460,17 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gen
438
460
  });
439
461
  }
440
462
  renderIcon() {
441
- const _this$props7 = this.props,
442
- styles = _this$props7.styles,
443
- isShowingOptions = _this$props7.isShowingOptions;
463
+ const {
464
+ styles,
465
+ isShowingOptions
466
+ } = this.props;
444
467
  return _jsx("span", {
445
- css: styles === null || styles === void 0 ? void 0 : styles.icon,
446
- children: isShowingOptions ? _IconArrowOpenUpLine || (_IconArrowOpenUpLine = _jsx(IconArrowOpenUpLine, {
468
+ css: styles?.icon,
469
+ children: isShowingOptions ? _jsx(IconArrowOpenUpLine, {
447
470
  inline: false
448
- })) : _IconArrowOpenDownLin || (_IconArrowOpenDownLin = _jsx(IconArrowOpenDownLine, {
471
+ }) : _jsx(IconArrowOpenDownLine, {
449
472
  inline: false
450
- }))
473
+ })
451
474
  });
452
475
  }
453
476
  renderContentBeforeOrAfterInput(position) {
@@ -493,50 +516,58 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gen
493
516
  return defaultReturn;
494
517
  }
495
518
  handleRenderBeforeInput() {
496
- const _this$props8 = this.props,
497
- renderBeforeInput = _this$props8.renderBeforeInput,
498
- inputValue = _this$props8.inputValue,
499
- isOptionContentAppliedToInput = _this$props8.isOptionContentAppliedToInput;
519
+ const {
520
+ renderBeforeInput,
521
+ inputValue,
522
+ isOptionContentAppliedToInput
523
+ } = this.props;
500
524
  return this.handleInputContentRender(renderBeforeInput, inputValue, isOptionContentAppliedToInput, 'before', null // default for before
501
525
  );
502
526
  }
503
527
  handleRenderAfterInput() {
504
- const _this$props9 = this.props,
505
- renderAfterInput = _this$props9.renderAfterInput,
506
- inputValue = _this$props9.inputValue,
507
- isOptionContentAppliedToInput = _this$props9.isOptionContentAppliedToInput;
528
+ const {
529
+ renderAfterInput,
530
+ inputValue,
531
+ isOptionContentAppliedToInput
532
+ } = this.props;
508
533
  return this.handleInputContentRender(renderAfterInput, inputValue, isOptionContentAppliedToInput, 'after', this.renderIcon() // default for after
509
534
  );
510
535
  }
511
536
  renderInput(data) {
512
- const getInputProps = data.getInputProps,
513
- getTriggerProps = data.getTriggerProps;
514
- const _this$props0 = this.props,
515
- renderLabel = _this$props0.renderLabel,
516
- inputValue = _this$props0.inputValue,
517
- placeholder = _this$props0.placeholder,
518
- isRequired = _this$props0.isRequired,
519
- shouldNotWrap = _this$props0.shouldNotWrap,
520
- size = _this$props0.size,
521
- isInline = _this$props0.isInline,
522
- width = _this$props0.width,
523
- htmlSize = _this$props0.htmlSize,
524
- messages = _this$props0.messages,
525
- renderBeforeInput = _this$props0.renderBeforeInput,
526
- renderAfterInput = _this$props0.renderAfterInput,
527
- onFocus = _this$props0.onFocus,
528
- onBlur = _this$props0.onBlur,
529
- onInputChange = _this$props0.onInputChange,
530
- onRequestHideOptions = _this$props0.onRequestHideOptions,
531
- layout = _this$props0.layout,
532
- rest = _objectWithoutProperties(_this$props0, _excluded2);
533
- const interaction = this.interaction;
537
+ const {
538
+ getInputProps,
539
+ getTriggerProps
540
+ } = data;
541
+ const {
542
+ renderLabel,
543
+ inputValue,
544
+ placeholder,
545
+ isRequired,
546
+ shouldNotWrap,
547
+ size,
548
+ isInline,
549
+ width,
550
+ htmlSize,
551
+ messages,
552
+ renderBeforeInput,
553
+ renderAfterInput,
554
+ onFocus,
555
+ onBlur,
556
+ onInputChange,
557
+ onRequestHideOptions,
558
+ layout,
559
+ ...rest
560
+ } = this.props;
561
+ const {
562
+ interaction
563
+ } = this;
534
564
  const passthroughProps = omitProps(rest, Select.allowedProps);
535
- const _getTriggerProps = getTriggerProps({
536
- ...passthroughProps
537
- }),
538
- ref = _getTriggerProps.ref,
539
- triggerProps = _objectWithoutProperties(_getTriggerProps, _excluded3);
565
+ const {
566
+ ref,
567
+ ...triggerProps
568
+ } = getTriggerProps({
569
+ ...passthroughProps
570
+ });
540
571
  const isEditable = typeof onInputChange !== 'undefined';
541
572
 
542
573
  // props to ensure screen readers treat uneditable selects as accessible
@@ -551,7 +582,7 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gen
551
582
  // that its 'read-only' and that this is a 'textfield', see INSTUI-4500
552
583
  role: utils.isSafari() || utils.isAndroidOrIOS() || interaction === 'disabled' && utils.isChromium() ? 'button' : 'combobox',
553
584
  title: inputValue,
554
- 'aria-autocomplete': void 0,
585
+ 'aria-autocomplete': undefined,
555
586
  'aria-readonly': true
556
587
  } : interaction === 'disabled' && utils.isChromium() ? {
557
588
  role: 'button'
@@ -582,14 +613,14 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gen
582
613
  // On iOS VoiceOver, if there is a custom element instead of the changing up and down arrow button
583
614
  // the listbox closes on a swipe, so a DOM change is enforced by the key change
584
615
  // that seems to inform VoiceOver to behave the correct way
585
- renderAfterInput: utils.isAndroidOrIOS() && renderAfterInput !== void 0 ? _jsx("span", {
616
+ renderAfterInput: utils.isAndroidOrIOS() && renderAfterInput !== undefined ? _jsx("span", {
586
617
  children: this.handleRenderAfterInput()
587
618
  }, this.props.isShowingOptions ? 'open' : 'closed') : this.handleRenderAfterInput(),
588
619
  // If `inputValue` is provided, we need to pass a default onChange handler,
589
620
  // because TextInput `value` is a controlled prop,
590
621
  // and onChange is not required for Select
591
622
  // (before it was handled by TextInput's defaultProp)
592
- onChange: typeof onInputChange === 'function' ? onInputChange : inputValue ? () => {} : void 0,
623
+ onChange: typeof onInputChange === 'function' ? onInputChange : inputValue ? () => {} : undefined,
593
624
  onFocus,
594
625
  onBlur: utils.createChainedFunction(onBlur, onRequestHideOptions),
595
626
  ...overrideProps
@@ -602,13 +633,14 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gen
602
633
  });
603
634
  }
604
635
  render() {
605
- const _this$props1 = this.props,
606
- constrain = _this$props1.constrain,
607
- placement = _this$props1.placement,
608
- mountNode = _this$props1.mountNode,
609
- assistiveText = _this$props1.assistiveText,
610
- isShowingOptions = _this$props1.isShowingOptions,
611
- styles = _this$props1.styles;
636
+ const {
637
+ constrain,
638
+ placement,
639
+ mountNode,
640
+ assistiveText,
641
+ isShowingOptions,
642
+ styles
643
+ } = this.props;
612
644
  // clear temporary option store
613
645
  this._optionIds = [];
614
646
  const highlightedOptionId = this.highlightedOptionId;
@@ -628,7 +660,7 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gen
628
660
  getDescriptionProps
629
661
  }) => _jsxs("span", {
630
662
  ...getRootProps({
631
- css: styles === null || styles === void 0 ? void 0 : styles.select
663
+ css: styles?.select
632
664
  }),
633
665
  ref: el => {
634
666
  this.ref = el;
@@ -639,7 +671,7 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gen
639
671
  getTriggerProps
640
672
  }), _jsx("span", {
641
673
  ...getDescriptionProps(),
642
- css: styles === null || styles === void 0 ? void 0 : styles.assistiveText,
674
+ css: styles?.assistiveText,
643
675
  children: assistiveText
644
676
  }), _jsx(Popover, {
645
677
  constrain: constrain,
@@ -648,12 +680,12 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gen
648
680
  // in order to be able to navigate through the list items with a swipe.
649
681
  // The swipe would result in closing the listbox if mounted elsewhere.
650
682
  ,
651
- mountNode: mountNode !== void 0 ? mountNode : utils.isAndroidOrIOS() ? this.ref : void 0,
683
+ mountNode: mountNode !== undefined ? mountNode : utils.isAndroidOrIOS() ? this.ref : undefined,
652
684
  positionTarget: this._inputContainer,
653
685
  isShowingContent: isShowingOptions,
654
686
  shouldReturnFocus: false,
655
687
  withArrow: false,
656
- borderWidth: styles === null || styles === void 0 ? void 0 : styles.popoverBorderWidth,
688
+ borderWidth: styles?.popoverBorderWidth,
657
689
  children: this.renderList({
658
690
  getListProps,
659
691
  getOptionProps,
@@ -663,20 +695,6 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gen
663
695
  })
664
696
  });
665
697
  }
666
- }, _Select.displayName = "Select", _Select.componentId = 'Select', _Select.allowedProps = allowedProps, _Select.defaultProps = {
667
- inputValue: '',
668
- isShowingOptions: false,
669
- size: 'medium',
670
- // Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
671
- interaction: void 0,
672
- isRequired: false,
673
- isInline: false,
674
- visibleOptionsCount: 8,
675
- placement: 'bottom stretch',
676
- constrain: 'window',
677
- shouldNotWrap: false,
678
- scrollToHighlightedOption: true,
679
- isOptionContentAppliedToInput: false
680
- }, _Select.Option = Option, _Select.Group = Group, _Select)) || _class) || _class);
698
+ }) || _class) || _class);
681
699
  export default Select;
682
700
  export { Select };
@@ -30,7 +30,9 @@
30
30
  * @return {Object} The final style object, which will be used in the component
31
31
  */
32
32
  const generateStyle = (componentTheme, props) => {
33
- const size = props.size;
33
+ const {
34
+ size
35
+ } = props;
34
36
  const iconSizeVariants = {
35
37
  small: {
36
38
  fontSize: componentTheme.smallIconSize
@@ -28,18 +28,19 @@
28
28
  * @return {Object} The final theme object with the overrides and component variables
29
29
  */
30
30
  const generateComponentTheme = theme => {
31
- var _colors$contrasts, _colors$contrasts2;
32
- const colors = theme.colors,
33
- typography = theme.typography;
31
+ const {
32
+ colors,
33
+ typography
34
+ } = theme;
34
35
  const componentVariables = {
35
- fontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
36
- fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
37
- fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
38
- smallIconSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeXSmall,
39
- mediumIconSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeSmall,
40
- largeIconSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
41
- color: colors === null || colors === void 0 ? void 0 : (_colors$contrasts = colors.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.grey125125,
42
- background: colors === null || colors === void 0 ? void 0 : (_colors$contrasts2 = colors.contrasts) === null || _colors$contrasts2 === void 0 ? void 0 : _colors$contrasts2.white1010,
36
+ fontSize: typography?.fontSizeMedium,
37
+ fontFamily: typography?.fontFamily,
38
+ fontWeight: typography?.fontWeightNormal,
39
+ smallIconSize: typography?.fontSizeXSmall,
40
+ mediumIconSize: typography?.fontSizeSmall,
41
+ largeIconSize: typography?.fontSizeMedium,
42
+ color: colors?.contrasts?.grey125125,
43
+ background: colors?.contrasts?.white1010,
43
44
  popoverBorderWidth: 'small'
44
45
  };
45
46
  return {