@instructure/ui-select 11.7.3-snapshot-25 → 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.
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = exports.Select = void 0;
9
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
9
  var _react = require("react");
11
10
  var utils = _interopRequireWildcard(require("@instructure/ui-utils"));
12
11
  var _combineDataCid = require("@instructure/ui-utils/lib/combineDataCid.js");
@@ -28,10 +27,7 @@ var _Group = require("./Group");
28
27
  var _Option = require("./Option");
29
28
  var _props = require("./props");
30
29
  var _jsxRuntime = require("@emotion/react/jsx-runtime");
31
- const _excluded = ["id", "renderLabel", "children"],
32
- _excluded2 = ["renderLabel", "inputValue", "placeholder", "isRequired", "shouldNotWrap", "size", "isInline", "width", "htmlSize", "messages", "renderBeforeInput", "renderAfterInput", "onFocus", "onBlur", "onInputChange", "onRequestHideOptions", "layout"],
33
- _excluded3 = ["ref"];
34
- var _dec, _dec2, _class, _Select, _Options$Separator, _Options$Separator2;
30
+ var _dec, _dec2, _class;
35
31
  /*
36
32
  * The MIT License (MIT)
37
33
  *
@@ -65,8 +61,10 @@ const selectSizeToIconSize = {
65
61
  // because the Select component is re-rendered on every prop change of the <Select.Option>
66
62
  // and with a large amount of options, this can cause a lot of unnecessary re-renders.
67
63
  const MemoedOption = /*#__PURE__*/(0, _react.memo)(function Opt(props) {
68
- const optionsItemProps = props.optionsItemProps,
69
- children = props.children;
64
+ const {
65
+ optionsItemProps,
66
+ children
67
+ } = props;
70
68
  return (
71
69
  // The main <Options> that renders this is always an "ul"
72
70
  (0, _jsxRuntime.jsx)(_latest4.Options.Item, {
@@ -91,58 +89,50 @@ category: components
91
89
  tags: autocomplete, typeahead, combobox, dropdown, search, form
92
90
  ---
93
91
  **/
94
- let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default), _dec(_class = _dec2(_class = (_Select = class Select extends _react.Component {
95
- constructor(...args) {
96
- super(...args);
97
- this.SCROLL_TOLERANCE = 0.5;
98
- this.state = {
99
- hasInputRef: false
100
- };
101
- this.ref = null;
102
- this._input = null;
103
- this._defaultId = this.props.deterministicId();
104
- this._inputContainer = null;
105
- this._listView = null;
106
- // temporarily stores actionable options
107
- this._optionIds = [];
108
- // best guess for first calculation of list height
109
- this._optionHeight = 36;
110
- this.handleInputRef = node => {
111
- var _this$props$inputRef, _this$props;
112
- // ensures list is positioned with respect to input if list is open on mount
113
- if (!this.state.hasInputRef) {
114
- this.setState({
115
- hasInputRef: true
116
- });
117
- }
118
- this._input = node;
119
- (_this$props$inputRef = (_this$props = this.props).inputRef) === null || _this$props$inputRef === void 0 ? void 0 : _this$props$inputRef.call(_this$props, node);
120
- };
121
- this.handleListRef = node => {
122
- var _this$props$listRef, _this$props2;
123
- (_this$props$listRef = (_this$props2 = this.props).listRef) === null || _this$props$listRef === void 0 ? void 0 : _this$props$listRef.call(_this$props2, node);
124
-
125
- // store option height to calculate list maxHeight
126
- if (node && node.querySelector('[role="option"]')) {
127
- this._optionHeight = node.querySelector('[role="option"]').offsetHeight;
128
- }
129
- };
130
- this.handleInputContainerRef = node => {
131
- this._inputContainer = node;
132
- };
133
- }
92
+ let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default), _dec(_class = _dec2(_class = class Select extends _react.Component {
93
+ static displayName = "Select";
94
+ static componentId = 'Select';
95
+ SCROLL_TOLERANCE = 0.5;
96
+ static allowedProps = _props.allowedProps;
97
+ static defaultProps = {
98
+ inputValue: '',
99
+ isShowingOptions: false,
100
+ size: 'medium',
101
+ // Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
102
+ interaction: undefined,
103
+ isRequired: false,
104
+ isInline: false,
105
+ visibleOptionsCount: 8,
106
+ placement: 'bottom stretch',
107
+ constrain: 'window',
108
+ shouldNotWrap: false,
109
+ scrollToHighlightedOption: true,
110
+ isOptionContentAppliedToInput: false
111
+ };
112
+ static Option = _Option.Option;
113
+ static Group = _Group.Group;
134
114
  componentDidMount() {
135
- var _this$props$makeStyle, _this$props3;
136
- (_this$props$makeStyle = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props3);
115
+ this.props.makeStyles?.();
137
116
  }
138
117
  componentDidUpdate() {
139
- var _this$props$makeStyle2, _this$props4;
140
- (_this$props$makeStyle2 = (_this$props4 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props4);
118
+ this.props.makeStyles?.();
141
119
  if (this.props.scrollToHighlightedOption) {
142
120
  // scroll option into view if needed
143
121
  requestAnimationFrame(() => this.scrollToOption(this.highlightedOptionId));
144
122
  }
145
123
  }
124
+ state = {
125
+ hasInputRef: false
126
+ };
127
+ ref = null;
128
+ _input = null;
129
+ _defaultId = this.props.deterministicId();
130
+ _inputContainer = null;
131
+ _listView = null;
132
+ // temporarily stores actionable options
133
+ _optionIds = [];
134
+ // best guess for first calculation of list height
135
+ _optionHeight = 36;
146
136
  focus() {
147
137
  this._input && this._input.focus();
148
138
  }
@@ -162,7 +152,7 @@ let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministic
162
152
  return this.props.id || this._defaultId;
163
153
  }
164
154
  get width() {
165
- return this._inputContainer ? this._inputContainer.offsetWidth : void 0;
155
+ return this._inputContainer ? this._inputContainer.offsetWidth : undefined;
166
156
  }
167
157
  get interaction() {
168
158
  return (0, _getInteraction.getInteraction)({
@@ -211,10 +201,31 @@ let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministic
211
201
  return selectedOptionId[0];
212
202
  }
213
203
  if (selectedOptionId.length === 0) {
214
- return void 0;
204
+ return undefined;
215
205
  }
216
206
  return selectedOptionId;
217
207
  }
208
+ handleInputRef = node => {
209
+ // ensures list is positioned with respect to input if list is open on mount
210
+ if (!this.state.hasInputRef) {
211
+ this.setState({
212
+ hasInputRef: true
213
+ });
214
+ }
215
+ this._input = node;
216
+ this.props.inputRef?.(node);
217
+ };
218
+ handleListRef = node => {
219
+ this.props.listRef?.(node);
220
+
221
+ // store option height to calculate list maxHeight
222
+ if (node && node.querySelector('[role="option"]')) {
223
+ this._optionHeight = node.querySelector('[role="option"]').offsetHeight;
224
+ }
225
+ };
226
+ handleInputContainerRef = node => {
227
+ this._inputContainer = node;
228
+ };
218
229
  scrollToOption(id) {
219
230
  if (!this._listView || !id) return;
220
231
  const option = this._listView.querySelector(`[id="${CSS.escape(id)}"]`);
@@ -231,22 +242,25 @@ let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministic
231
242
  }
232
243
  }
233
244
  highlightOption(event, id) {
234
- const onRequestHighlightOption = this.props.onRequestHighlightOption;
245
+ const {
246
+ onRequestHighlightOption
247
+ } = this.props;
235
248
  if (id) {
236
- onRequestHighlightOption === null || onRequestHighlightOption === void 0 ? void 0 : onRequestHighlightOption(event, {
249
+ onRequestHighlightOption?.(event, {
237
250
  id
238
251
  });
239
252
  }
240
253
  }
241
254
  getEventHandlers() {
242
- const _this$props5 = this.props,
243
- isShowingOptions = _this$props5.isShowingOptions,
244
- onRequestShowOptions = _this$props5.onRequestShowOptions,
245
- onRequestHideOptions = _this$props5.onRequestHideOptions,
246
- onRequestSelectOption = _this$props5.onRequestSelectOption;
255
+ const {
256
+ isShowingOptions,
257
+ onRequestShowOptions,
258
+ onRequestHideOptions,
259
+ onRequestSelectOption
260
+ } = this.props;
247
261
  return this.interaction === 'enabled' ? {
248
262
  onRequestShowOptions: event => {
249
- onRequestShowOptions === null || onRequestShowOptions === void 0 ? void 0 : onRequestShowOptions(event);
263
+ onRequestShowOptions?.(event);
250
264
  const selectedOptionId = this.selectedOptionId;
251
265
  if (selectedOptionId && !Array.isArray(selectedOptionId)) {
252
266
  // highlight selected option on show
@@ -254,7 +268,7 @@ let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministic
254
268
  }
255
269
  },
256
270
  onRequestHideOptions: event => {
257
- onRequestHideOptions === null || onRequestHideOptions === void 0 ? void 0 : onRequestHideOptions(event);
271
+ onRequestHideOptions?.(event);
258
272
  },
259
273
  onRequestHighlightOption: (event, {
260
274
  id,
@@ -263,7 +277,7 @@ let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministic
263
277
  if (!isShowingOptions) return;
264
278
  const highlightedOptionId = this.highlightedOptionId;
265
279
  // if id exists, use that
266
- let highlightId = this._optionIds.indexOf(id) > -1 ? id : void 0;
280
+ let highlightId = this._optionIds.indexOf(id) > -1 ? id : undefined;
267
281
  if (!highlightId) {
268
282
  if (!highlightedOptionId) {
269
283
  // nothing highlighted yet, highlight first option
@@ -271,7 +285,7 @@ let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministic
271
285
  } else {
272
286
  // find next id based on direction
273
287
  const index = this._optionIds.indexOf(highlightedOptionId);
274
- highlightId = index > -1 ? this._optionIds[index + direction] : void 0;
288
+ highlightId = index > -1 ? this._optionIds[index + direction] : undefined;
275
289
  }
276
290
  }
277
291
  if (highlightId) {
@@ -290,7 +304,7 @@ let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministic
290
304
  }) => {
291
305
  if (id && this._optionIds.indexOf(id) !== -1) {
292
306
  // only select if id exists as a valid option
293
- onRequestSelectOption === null || onRequestSelectOption === void 0 ? void 0 : onRequestSelectOption(event, {
307
+ onRequestSelectOption?.(event, {
294
308
  id
295
309
  });
296
310
  }
@@ -298,19 +312,21 @@ let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministic
298
312
  } : {};
299
313
  }
300
314
  renderOption(option, data) {
301
- const getOptionProps = data.getOptionProps,
302
- getDisabledOptionProps = data.getDisabledOptionProps;
303
- const _option$props = option.props,
304
- id = _option$props.id,
305
- isDisabled = _option$props.isDisabled,
306
- isHighlighted = _option$props.isHighlighted,
307
- isSelected = _option$props.isSelected,
308
- renderBeforeLabel = _option$props.renderBeforeLabel,
309
- renderAfterLabel = _option$props.renderAfterLabel,
310
- children = _option$props.children;
315
+ const {
316
+ getOptionProps,
317
+ getDisabledOptionProps
318
+ } = data;
319
+ const {
320
+ id,
321
+ isDisabled,
322
+ isHighlighted,
323
+ isSelected,
324
+ renderBeforeLabel,
325
+ renderAfterLabel,
326
+ children
327
+ } = option.props;
311
328
  const getRenderOptionLabel = renderOptionLabel => {
312
- var _renderOptionLabel$pr;
313
- return typeof renderOptionLabel === 'function' && !(renderOptionLabel !== null && renderOptionLabel !== void 0 && (_renderOptionLabel$pr = renderOptionLabel.prototype) !== null && _renderOptionLabel$pr !== void 0 && _renderOptionLabel$pr.isReactComponent) ? renderOptionLabel.bind(null, {
329
+ return typeof renderOptionLabel === 'function' && !renderOptionLabel?.prototype?.isReactComponent ? renderOptionLabel.bind(null, {
314
330
  id,
315
331
  isDisabled,
316
332
  isSelected,
@@ -318,10 +334,10 @@ let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministic
318
334
  children
319
335
  }) : renderOptionLabel;
320
336
  };
321
- const _this$props6 = this.props,
322
- isOptionContentAppliedToInput = _this$props6.isOptionContentAppliedToInput,
323
- _this$props6$size = _this$props6.size,
324
- size = _this$props6$size === void 0 ? 'medium' : _this$props6$size;
337
+ const {
338
+ isOptionContentAppliedToInput,
339
+ size = 'medium'
340
+ } = this.props;
325
341
  const iconSize = selectSizeToIconSize[size];
326
342
  const checkIcon = isSelected && !isOptionContentAppliedToInput ? (0, _jsxRuntime.jsx)(_uiIcons.CheckInstUIIcon, {
327
343
  inline: false,
@@ -337,7 +353,7 @@ let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministic
337
353
  }),
338
354
  // Options.Item props
339
355
  renderBeforeLabel: getRenderOptionLabel(renderBeforeLabel),
340
- renderAfterLabel: checkIcon !== null && checkIcon !== void 0 ? checkIcon : getRenderOptionLabel(renderAfterLabel)
356
+ renderAfterLabel: checkIcon ?? getRenderOptionLabel(renderAfterLabel)
341
357
  };
342
358
  // should option be treated as highlighted or selected
343
359
  if (isSelected && isHighlighted) {
@@ -367,20 +383,23 @@ let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministic
367
383
  });
368
384
  }
369
385
  renderGroup(group, data) {
370
- const getOptionProps = data.getOptionProps,
371
- getDisabledOptionProps = data.getDisabledOptionProps,
372
- isFirstChild = data.isFirstChild,
373
- isLastChild = data.isLastChild,
374
- afterGroup = data.afterGroup;
375
- const _group$props = group.props,
376
- id = _group$props.id,
377
- renderLabel = _group$props.renderLabel,
378
- children = _group$props.children,
379
- rest = (0, _objectWithoutProperties2.default)(_group$props, _excluded);
386
+ const {
387
+ getOptionProps,
388
+ getDisabledOptionProps,
389
+ isFirstChild,
390
+ isLastChild,
391
+ afterGroup
392
+ } = data;
393
+ const {
394
+ id,
395
+ renderLabel,
396
+ children,
397
+ ...rest
398
+ } = group.props;
380
399
  const groupChildren = [];
381
400
  // add a separator above
382
401
  if (!isFirstChild && !afterGroup) {
383
- groupChildren.push(_Options$Separator || (_Options$Separator = (0, _jsxRuntime.jsx)(_latest4.Options.Separator, {})));
402
+ groupChildren.push((0, _jsxRuntime.jsx)(_latest4.Options.Separator, {}));
384
403
  }
385
404
  // create a sublist as a group
386
405
  // a wrapping listitem will be created by Options
@@ -399,20 +418,23 @@ let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministic
399
418
  }));
400
419
  // add a separator below
401
420
  if (!isLastChild) {
402
- groupChildren.push(_Options$Separator2 || (_Options$Separator2 = (0, _jsxRuntime.jsx)(_latest4.Options.Separator, {})));
421
+ groupChildren.push((0, _jsxRuntime.jsx)(_latest4.Options.Separator, {}));
403
422
  }
404
423
  return groupChildren;
405
424
  }
406
425
  renderList(data) {
407
- const getListProps = data.getListProps,
408
- getOptionProps = data.getOptionProps,
409
- getDisabledOptionProps = data.getDisabledOptionProps;
410
- const _this$props7 = this.props,
411
- isShowingOptions = _this$props7.isShowingOptions,
412
- optionsMaxWidth = _this$props7.optionsMaxWidth,
413
- optionsMaxHeight = _this$props7.optionsMaxHeight,
414
- visibleOptionsCount = _this$props7.visibleOptionsCount,
415
- children = _this$props7.children;
426
+ const {
427
+ getListProps,
428
+ getOptionProps,
429
+ getDisabledOptionProps
430
+ } = data;
431
+ const {
432
+ isShowingOptions,
433
+ optionsMaxWidth,
434
+ optionsMaxHeight,
435
+ visibleOptionsCount,
436
+ children
437
+ } = this.props;
416
438
  let lastWasGroup = false;
417
439
  const viewProps = isShowingOptions ? {
418
440
  display: 'block',
@@ -463,10 +485,10 @@ let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministic
463
485
  });
464
486
  }
465
487
  renderIcon() {
466
- const _this$props8 = this.props,
467
- isShowingOptions = _this$props8.isShowingOptions,
468
- _this$props8$size = _this$props8.size,
469
- size = _this$props8$size === void 0 ? 'medium' : _this$props8$size;
488
+ const {
489
+ isShowingOptions,
490
+ size = 'medium'
491
+ } = this.props;
470
492
  const iconSize = selectSizeToIconSize[size];
471
493
  return (0, _jsxRuntime.jsx)("span", {
472
494
  children: isShowingOptions ? (0, _jsxRuntime.jsx)(_uiIcons.ChevronUpInstUIIcon, {
@@ -523,50 +545,58 @@ let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministic
523
545
  return defaultReturn;
524
546
  }
525
547
  handleRenderBeforeInput() {
526
- const _this$props9 = this.props,
527
- renderBeforeInput = _this$props9.renderBeforeInput,
528
- inputValue = _this$props9.inputValue,
529
- isOptionContentAppliedToInput = _this$props9.isOptionContentAppliedToInput;
548
+ const {
549
+ renderBeforeInput,
550
+ inputValue,
551
+ isOptionContentAppliedToInput
552
+ } = this.props;
530
553
  return this.handleInputContentRender(renderBeforeInput, inputValue, isOptionContentAppliedToInput, 'before', null // default for before
531
554
  );
532
555
  }
533
556
  handleRenderAfterInput() {
534
- const _this$props0 = this.props,
535
- renderAfterInput = _this$props0.renderAfterInput,
536
- inputValue = _this$props0.inputValue,
537
- isOptionContentAppliedToInput = _this$props0.isOptionContentAppliedToInput;
557
+ const {
558
+ renderAfterInput,
559
+ inputValue,
560
+ isOptionContentAppliedToInput
561
+ } = this.props;
538
562
  return this.handleInputContentRender(renderAfterInput, inputValue, isOptionContentAppliedToInput, 'after', this.renderIcon() // default for after
539
563
  );
540
564
  }
541
565
  renderInput(data) {
542
- const getInputProps = data.getInputProps,
543
- getTriggerProps = data.getTriggerProps;
544
- const _this$props1 = this.props,
545
- renderLabel = _this$props1.renderLabel,
546
- inputValue = _this$props1.inputValue,
547
- placeholder = _this$props1.placeholder,
548
- isRequired = _this$props1.isRequired,
549
- shouldNotWrap = _this$props1.shouldNotWrap,
550
- size = _this$props1.size,
551
- isInline = _this$props1.isInline,
552
- width = _this$props1.width,
553
- htmlSize = _this$props1.htmlSize,
554
- messages = _this$props1.messages,
555
- renderBeforeInput = _this$props1.renderBeforeInput,
556
- renderAfterInput = _this$props1.renderAfterInput,
557
- onFocus = _this$props1.onFocus,
558
- onBlur = _this$props1.onBlur,
559
- onInputChange = _this$props1.onInputChange,
560
- onRequestHideOptions = _this$props1.onRequestHideOptions,
561
- layout = _this$props1.layout,
562
- rest = (0, _objectWithoutProperties2.default)(_this$props1, _excluded2);
563
- const interaction = this.interaction;
566
+ const {
567
+ getInputProps,
568
+ getTriggerProps
569
+ } = data;
570
+ const {
571
+ renderLabel,
572
+ inputValue,
573
+ placeholder,
574
+ isRequired,
575
+ shouldNotWrap,
576
+ size,
577
+ isInline,
578
+ width,
579
+ htmlSize,
580
+ messages,
581
+ renderBeforeInput,
582
+ renderAfterInput,
583
+ onFocus,
584
+ onBlur,
585
+ onInputChange,
586
+ onRequestHideOptions,
587
+ layout,
588
+ ...rest
589
+ } = this.props;
590
+ const {
591
+ interaction
592
+ } = this;
564
593
  const passthroughProps = (0, _omitProps.omitProps)(rest, Select.allowedProps);
565
- const _getTriggerProps = getTriggerProps({
566
- ...passthroughProps
567
- }),
568
- ref = _getTriggerProps.ref,
569
- triggerProps = (0, _objectWithoutProperties2.default)(_getTriggerProps, _excluded3);
594
+ const {
595
+ ref,
596
+ ...triggerProps
597
+ } = getTriggerProps({
598
+ ...passthroughProps
599
+ });
570
600
  const isEditable = typeof onInputChange !== 'undefined';
571
601
 
572
602
  // props to ensure screen readers treat uneditable selects as accessible
@@ -581,7 +611,7 @@ let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministic
581
611
  // that its 'read-only' and that this is a 'textfield', see INSTUI-4500
582
612
  role: utils.isSafari() || utils.isAndroidOrIOS() || interaction === 'disabled' && utils.isChromium() ? 'button' : 'combobox',
583
613
  title: inputValue,
584
- 'aria-autocomplete': void 0,
614
+ 'aria-autocomplete': undefined,
585
615
  'aria-readonly': true
586
616
  } : interaction === 'disabled' && utils.isChromium() ? {
587
617
  role: 'button'
@@ -612,14 +642,14 @@ let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministic
612
642
  // On iOS VoiceOver, if there is a custom element instead of the changing up and down arrow button
613
643
  // the listbox closes on a swipe, so a DOM change is enforced by the key change
614
644
  // that seems to inform VoiceOver to behave the correct way
615
- renderAfterInput: utils.isAndroidOrIOS() && renderAfterInput !== void 0 ? (0, _jsxRuntime.jsx)("span", {
645
+ renderAfterInput: utils.isAndroidOrIOS() && renderAfterInput !== undefined ? (0, _jsxRuntime.jsx)("span", {
616
646
  children: this.handleRenderAfterInput()
617
647
  }, this.props.isShowingOptions ? 'open' : 'closed') : this.handleRenderAfterInput(),
618
648
  // If `inputValue` is provided, we need to pass a default onChange handler,
619
649
  // because TextInput `value` is a controlled prop,
620
650
  // and onChange is not required for Select
621
651
  // (before it was handled by TextInput's defaultProp)
622
- onChange: typeof onInputChange === 'function' ? onInputChange : inputValue ? () => {} : void 0,
652
+ onChange: typeof onInputChange === 'function' ? onInputChange : inputValue ? () => {} : undefined,
623
653
  onFocus,
624
654
  onBlur: utils.createChainedFunction(onBlur, onRequestHideOptions),
625
655
  ...overrideProps
@@ -637,13 +667,14 @@ let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministic
637
667
  });
638
668
  }
639
669
  render() {
640
- const _this$props10 = this.props,
641
- constrain = _this$props10.constrain,
642
- placement = _this$props10.placement,
643
- mountNode = _this$props10.mountNode,
644
- assistiveText = _this$props10.assistiveText,
645
- isShowingOptions = _this$props10.isShowingOptions,
646
- styles = _this$props10.styles;
670
+ const {
671
+ constrain,
672
+ placement,
673
+ mountNode,
674
+ assistiveText,
675
+ isShowingOptions,
676
+ styles
677
+ } = this.props;
647
678
  // clear temporary option store
648
679
  this._optionIds = [];
649
680
  const highlightedOptionId = this.highlightedOptionId;
@@ -672,7 +703,7 @@ let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministic
672
703
  getTriggerProps
673
704
  }), (0, _jsxRuntime.jsx)("span", {
674
705
  ...getDescriptionProps(),
675
- css: styles === null || styles === void 0 ? void 0 : styles.assistiveText,
706
+ css: styles?.assistiveText,
676
707
  children: assistiveText
677
708
  }), (0, _jsxRuntime.jsx)(_latest2.Popover, {
678
709
  constrain: constrain,
@@ -681,12 +712,12 @@ let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministic
681
712
  // in order to be able to navigate through the list items with a swipe.
682
713
  // The swipe would result in closing the listbox if mounted elsewhere.
683
714
  ,
684
- mountNode: mountNode !== void 0 ? mountNode : utils.isAndroidOrIOS() ? this.ref : void 0,
715
+ mountNode: mountNode !== undefined ? mountNode : utils.isAndroidOrIOS() ? this.ref : undefined,
685
716
  positionTarget: this._inputContainer,
686
717
  isShowingContent: isShowingOptions,
687
718
  shouldReturnFocus: false,
688
719
  withArrow: false,
689
- borderWidth: styles === null || styles === void 0 ? void 0 : styles.popoverBorderWidth,
720
+ borderWidth: styles?.popoverBorderWidth,
690
721
  children: this.renderList({
691
722
  getListProps,
692
723
  getOptionProps,
@@ -696,19 +727,5 @@ let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministic
696
727
  })
697
728
  });
698
729
  }
699
- }, _Select.displayName = "Select", _Select.componentId = 'Select', _Select.allowedProps = _props.allowedProps, _Select.defaultProps = {
700
- inputValue: '',
701
- isShowingOptions: false,
702
- size: 'medium',
703
- // Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
704
- interaction: void 0,
705
- isRequired: false,
706
- isInline: false,
707
- visibleOptionsCount: 8,
708
- placement: 'bottom stretch',
709
- constrain: 'window',
710
- shouldNotWrap: false,
711
- scrollToHighlightedOption: true,
712
- isOptionContentAppliedToInput: false
713
- }, _Select.Option = _Option.Option, _Select.Group = _Group.Group, _Select)) || _class) || _class);
730
+ }) || _class) || _class);
714
731
  var _default = exports.default = Select;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-select",
3
- "version": "11.7.3-snapshot-25",
3
+ "version": "11.7.3-snapshot-26",
4
4
  "description": "A component for select and autocomplete behavior.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -14,31 +14,31 @@
14
14
  "bugs": "https://github.com/instructure/instructure-ui/issues",
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
- "@babel/runtime": "^7.27.6",
18
- "@instructure/emotion": "11.7.3-snapshot-25",
19
- "@instructure/shared-types": "11.7.3-snapshot-25",
20
- "@instructure/ui-form-field": "11.7.3-snapshot-25",
21
- "@instructure/ui-icons": "11.7.3-snapshot-25",
22
- "@instructure/ui-dom-utils": "11.7.3-snapshot-25",
23
- "@instructure/ui-options": "11.7.3-snapshot-25",
24
- "@instructure/ui-popover": "11.7.3-snapshot-25",
25
- "@instructure/ui-react-utils": "11.7.3-snapshot-25",
26
- "@instructure/ui-selectable": "11.7.3-snapshot-25",
27
- "@instructure/ui-text-input": "11.7.3-snapshot-25",
28
- "@instructure/ui-themes": "11.7.3-snapshot-25",
29
- "@instructure/ui-position": "11.7.3-snapshot-25",
30
- "@instructure/ui-view": "11.7.3-snapshot-25",
31
- "@instructure/ui-utils": "11.7.3-snapshot-25",
32
- "@instructure/uid": "11.7.3-snapshot-25"
17
+ "@babel/runtime": "^7.29.2",
18
+ "@instructure/shared-types": "11.7.3-snapshot-26",
19
+ "@instructure/ui-dom-utils": "11.7.3-snapshot-26",
20
+ "@instructure/emotion": "11.7.3-snapshot-26",
21
+ "@instructure/ui-form-field": "11.7.3-snapshot-26",
22
+ "@instructure/ui-icons": "11.7.3-snapshot-26",
23
+ "@instructure/ui-popover": "11.7.3-snapshot-26",
24
+ "@instructure/ui-options": "11.7.3-snapshot-26",
25
+ "@instructure/ui-text-input": "11.7.3-snapshot-26",
26
+ "@instructure/ui-themes": "11.7.3-snapshot-26",
27
+ "@instructure/ui-selectable": "11.7.3-snapshot-26",
28
+ "@instructure/ui-utils": "11.7.3-snapshot-26",
29
+ "@instructure/ui-position": "11.7.3-snapshot-26",
30
+ "@instructure/ui-react-utils": "11.7.3-snapshot-26",
31
+ "@instructure/ui-view": "11.7.3-snapshot-26",
32
+ "@instructure/uid": "11.7.3-snapshot-26"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@testing-library/jest-dom": "^6.6.3",
36
36
  "@testing-library/react": "15.0.7",
37
37
  "@testing-library/user-event": "^14.6.1",
38
38
  "vitest": "^3.2.2",
39
- "@instructure/ui-scripts": "11.7.3-snapshot-25",
40
- "@instructure/ui-color-utils": "11.7.3-snapshot-25",
41
- "@instructure/ui-babel-preset": "11.7.3-snapshot-25"
39
+ "@instructure/ui-babel-preset": "11.7.3-snapshot-26",
40
+ "@instructure/ui-color-utils": "11.7.3-snapshot-26",
41
+ "@instructure/ui-scripts": "11.7.3-snapshot-26"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "react": ">=18 <=19"