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

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,7 +3,7 @@
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-4](https://github.com/instructure/instructure-ui/compare/v11.7.2...v11.7.3-snapshot-4) (2026-04-28)
6
+ ## [11.7.3-snapshot-7](https://github.com/instructure/instructure-ui/compare/v11.7.2...v11.7.3-snapshot-7) (2026-04-29)
7
7
 
8
8
  **Note:** Version bump only for package @instructure/ui-select
9
9
 
@@ -620,7 +620,6 @@ let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle), _d
620
620
  suppressHydrationWarning: true,
621
621
  ...(interaction === 'enabled' && !isEditable && {
622
622
  themeOverride: componentTheme => ({
623
- //@ts-expect-error TODO-theme-types
624
623
  backgroundReadonlyColor: componentTheme.backgroundColor
625
624
  })
626
625
  })
@@ -25,8 +25,7 @@
25
25
  /**
26
26
  * Generates the style object from the theme and provided additional information
27
27
  * @param {Object} componentTheme The theme variable object.
28
- * @param {Object} props the props of the component, the style is applied to
29
- * @param {Object} state the state of the component, the style is applied to
28
+ * @param {Object} _props the props of the component, the style is applied to
30
29
  * @return {Object} The final style object, which will be used in the component
31
30
  */
32
31
  const generateStyle = (componentTheme, _props) => {
@@ -35,7 +34,6 @@ const generateStyle = (componentTheme, _props) => {
35
34
  label: 'select__assistiveText',
36
35
  display: 'none'
37
36
  },
38
- //@ts-expect-error TODO-theme-types
39
37
  popoverBorderWidth: componentTheme.popoverBorderWidth
40
38
  };
41
39
  };
@@ -631,7 +631,6 @@ let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministic
631
631
  suppressHydrationWarning: true,
632
632
  ...(interaction === 'enabled' && !isEditable && {
633
633
  themeOverride: componentTheme => ({
634
- //@ts-expect-error TODO-theme-types
635
634
  backgroundReadonlyColor: componentTheme.backgroundColor
636
635
  })
637
636
  })
@@ -31,8 +31,7 @@ exports.default = void 0;
31
31
  /**
32
32
  * Generates the style object from the theme and provided additional information
33
33
  * @param {Object} componentTheme The theme variable object.
34
- * @param {Object} props the props of the component, the style is applied to
35
- * @param {Object} state the state of the component, the style is applied to
34
+ * @param {Object} _props the props of the component, the style is applied to
36
35
  * @return {Object} The final style object, which will be used in the component
37
36
  */
38
37
  const generateStyle = (componentTheme, _props) => {
@@ -41,7 +40,6 @@ const generateStyle = (componentTheme, _props) => {
41
40
  label: 'select__assistiveText',
42
41
  display: 'none'
43
42
  },
44
- //@ts-expect-error TODO-theme-types
45
43
  popoverBorderWidth: componentTheme.popoverBorderWidth
46
44
  };
47
45
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-select",
3
- "version": "11.7.3-snapshot-4",
3
+ "version": "11.7.3-snapshot-7",
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",
@@ -15,30 +15,30 @@
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
17
  "@babel/runtime": "^7.27.6",
18
- "@instructure/ui-dom-utils": "11.7.3-snapshot-4",
19
- "@instructure/ui-form-field": "11.7.3-snapshot-4",
20
- "@instructure/shared-types": "11.7.3-snapshot-4",
21
- "@instructure/ui-icons": "11.7.3-snapshot-4",
22
- "@instructure/emotion": "11.7.3-snapshot-4",
23
- "@instructure/ui-options": "11.7.3-snapshot-4",
24
- "@instructure/ui-popover": "11.7.3-snapshot-4",
25
- "@instructure/ui-position": "11.7.3-snapshot-4",
26
- "@instructure/ui-react-utils": "11.7.3-snapshot-4",
27
- "@instructure/ui-selectable": "11.7.3-snapshot-4",
28
- "@instructure/ui-text-input": "11.7.3-snapshot-4",
29
- "@instructure/ui-utils": "11.7.3-snapshot-4",
30
- "@instructure/ui-view": "11.7.3-snapshot-4",
31
- "@instructure/uid": "11.7.3-snapshot-4"
18
+ "@instructure/emotion": "11.7.3-snapshot-7",
19
+ "@instructure/shared-types": "11.7.3-snapshot-7",
20
+ "@instructure/ui-dom-utils": "11.7.3-snapshot-7",
21
+ "@instructure/ui-form-field": "11.7.3-snapshot-7",
22
+ "@instructure/ui-icons": "11.7.3-snapshot-7",
23
+ "@instructure/ui-options": "11.7.3-snapshot-7",
24
+ "@instructure/ui-popover": "11.7.3-snapshot-7",
25
+ "@instructure/ui-position": "11.7.3-snapshot-7",
26
+ "@instructure/ui-text-input": "11.7.3-snapshot-7",
27
+ "@instructure/ui-selectable": "11.7.3-snapshot-7",
28
+ "@instructure/ui-themes": "11.7.3-snapshot-7",
29
+ "@instructure/ui-utils": "11.7.3-snapshot-7",
30
+ "@instructure/ui-view": "11.7.3-snapshot-7",
31
+ "@instructure/ui-react-utils": "11.7.3-snapshot-7",
32
+ "@instructure/uid": "11.7.3-snapshot-7"
32
33
  },
33
34
  "devDependencies": {
34
35
  "@testing-library/jest-dom": "^6.6.3",
35
36
  "@testing-library/react": "15.0.7",
36
37
  "@testing-library/user-event": "^14.6.1",
37
38
  "vitest": "^3.2.2",
38
- "@instructure/ui-color-utils": "11.7.3-snapshot-4",
39
- "@instructure/ui-babel-preset": "11.7.3-snapshot-4",
40
- "@instructure/ui-scripts": "11.7.3-snapshot-4",
41
- "@instructure/ui-themes": "11.7.3-snapshot-4"
39
+ "@instructure/ui-babel-preset": "11.7.3-snapshot-7",
40
+ "@instructure/ui-color-utils": "11.7.3-snapshot-7",
41
+ "@instructure/ui-scripts": "11.7.3-snapshot-7"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "react": ">=18 <=19"
@@ -112,18 +112,18 @@ const MemoedOption = memo(
112
112
  (prevProps, nextProps) => {
113
113
  return (
114
114
  prevProps.selectOption.props.isHighlighted ===
115
- nextProps.selectOption.props.isHighlighted &&
115
+ nextProps.selectOption.props.isHighlighted &&
116
116
  prevProps.selectOption.props.isSelected ===
117
- nextProps.selectOption.props.isSelected &&
117
+ nextProps.selectOption.props.isSelected &&
118
118
  prevProps.selectOption.props.isDisabled ===
119
- nextProps.selectOption.props.isDisabled &&
119
+ nextProps.selectOption.props.isDisabled &&
120
120
  prevProps.selectOption.props.children ===
121
- nextProps.selectOption.props.children &&
121
+ nextProps.selectOption.props.children &&
122
122
  prevProps.selectOption.props.id === nextProps.selectOption.props.id &&
123
123
  prevProps.selectOption.props.renderBeforeLabel ===
124
- nextProps.selectOption.props.renderBeforeLabel &&
124
+ nextProps.selectOption.props.renderBeforeLabel &&
125
125
  prevProps.selectOption.props.renderAfterLabel ===
126
- nextProps.selectOption.props.renderAfterLabel &&
126
+ nextProps.selectOption.props.renderAfterLabel &&
127
127
  prevProps.children === nextProps.children
128
128
  )
129
129
  }
@@ -334,59 +334,59 @@ class Select extends Component<SelectProps> {
334
334
 
335
335
  return this.interaction === 'enabled'
336
336
  ? {
337
- onRequestShowOptions: (event) => {
338
- onRequestShowOptions?.(event)
339
- const selectedOptionId = this.selectedOptionId
337
+ onRequestShowOptions: (event) => {
338
+ onRequestShowOptions?.(event)
339
+ const selectedOptionId = this.selectedOptionId
340
340
 
341
- if (selectedOptionId && !Array.isArray(selectedOptionId)) {
342
- // highlight selected option on show
343
- this.highlightOption(event, selectedOptionId)
344
- }
345
- },
346
- onRequestHideOptions: (event) => {
347
- onRequestHideOptions?.(event)
348
- },
349
- onRequestHighlightOption: (
350
- event,
351
- { id, direction }: { id?: string; direction?: number }
352
- ) => {
353
- if (!isShowingOptions) return
354
-
355
- const highlightedOptionId = this.highlightedOptionId
356
- // if id exists, use that
357
- let highlightId = this._optionIds.indexOf(id!) > -1 ? id : undefined
358
- if (!highlightId) {
359
- if (!highlightedOptionId) {
360
- // nothing highlighted yet, highlight first option
361
- highlightId = this._optionIds[0]
362
- } else {
363
- // find next id based on direction
364
- const index = this._optionIds.indexOf(highlightedOptionId)
365
- highlightId =
366
- index > -1 ? this._optionIds[index + direction!] : undefined
341
+ if (selectedOptionId && !Array.isArray(selectedOptionId)) {
342
+ // highlight selected option on show
343
+ this.highlightOption(event, selectedOptionId)
367
344
  }
368
- }
369
- if (highlightId) {
370
- // only highlight if id exists as a valid option
371
- this.highlightOption(event, highlightId)
372
- }
373
- },
374
- onRequestHighlightFirstOption: (event) => {
375
- this.highlightOption(event, this._optionIds[0])
376
- },
377
- onRequestHighlightLastOption: (event) => {
378
- this.highlightOption(
345
+ },
346
+ onRequestHideOptions: (event) => {
347
+ onRequestHideOptions?.(event)
348
+ },
349
+ onRequestHighlightOption: (
379
350
  event,
380
- this._optionIds[this._optionIds.length - 1]
381
- )
382
- },
383
- onRequestSelectOption: (event, { id }) => {
384
- if (id && this._optionIds.indexOf(id) !== -1) {
385
- // only select if id exists as a valid option
386
- onRequestSelectOption?.(event, { id })
351
+ { id, direction }: { id?: string; direction?: number }
352
+ ) => {
353
+ if (!isShowingOptions) return
354
+
355
+ const highlightedOptionId = this.highlightedOptionId
356
+ // if id exists, use that
357
+ let highlightId = this._optionIds.indexOf(id!) > -1 ? id : undefined
358
+ if (!highlightId) {
359
+ if (!highlightedOptionId) {
360
+ // nothing highlighted yet, highlight first option
361
+ highlightId = this._optionIds[0]
362
+ } else {
363
+ // find next id based on direction
364
+ const index = this._optionIds.indexOf(highlightedOptionId)
365
+ highlightId =
366
+ index > -1 ? this._optionIds[index + direction!] : undefined
367
+ }
368
+ }
369
+ if (highlightId) {
370
+ // only highlight if id exists as a valid option
371
+ this.highlightOption(event, highlightId)
372
+ }
373
+ },
374
+ onRequestHighlightFirstOption: (event) => {
375
+ this.highlightOption(event, this._optionIds[0])
376
+ },
377
+ onRequestHighlightLastOption: (event) => {
378
+ this.highlightOption(
379
+ event,
380
+ this._optionIds[this._optionIds.length - 1]
381
+ )
382
+ },
383
+ onRequestSelectOption: (event, { id }) => {
384
+ if (id && this._optionIds.indexOf(id) !== -1) {
385
+ // only select if id exists as a valid option
386
+ onRequestSelectOption?.(event, { id })
387
+ }
387
388
  }
388
389
  }
389
- }
390
390
  : {}
391
391
  }
392
392
 
@@ -413,12 +413,12 @@ class Select extends Component<SelectProps> {
413
413
  return typeof renderOptionLabel === 'function' &&
414
414
  !renderOptionLabel?.prototype?.isReactComponent
415
415
  ? (renderOptionLabel as any).bind(null, {
416
- id,
417
- isDisabled,
418
- isSelected,
419
- isHighlighted,
420
- children
421
- })
416
+ id,
417
+ isDisabled,
418
+ isSelected,
419
+ isHighlighted,
420
+ children
421
+ })
422
422
  : (renderOptionLabel as React.ReactNode)
423
423
  }
424
424
 
@@ -539,18 +539,18 @@ class Select extends Component<SelectProps> {
539
539
 
540
540
  const viewProps: Partial<ViewProps> = isShowingOptions
541
541
  ? {
542
- display: 'block',
543
- overflowY: 'auto',
544
- maxHeight:
545
- optionsMaxHeight ||
546
- this._optionHeight * visibleOptionsCount! -
547
- // in Chrome, we need to prevent scrolling when the bottom area of last item is hovered
548
- (utils.isChromium() ? this.SCROLL_TOLERANCE : 0),
549
- maxWidth: optionsMaxWidth || this.width,
550
- background: 'primary',
551
- elementRef: (node: Element | null) => (this._listView = node),
552
- borderRadius: 'inherit'
553
- }
542
+ display: 'block',
543
+ overflowY: 'auto',
544
+ maxHeight:
545
+ optionsMaxHeight ||
546
+ this._optionHeight * visibleOptionsCount! -
547
+ // in Chrome, we need to prevent scrolling when the bottom area of last item is hovered
548
+ (utils.isChromium() ? this.SCROLL_TOLERANCE : 0),
549
+ maxWidth: optionsMaxWidth || this.width,
550
+ background: 'primary',
551
+ elementRef: (node: Element | null) => (this._listView = node),
552
+ borderRadius: 'inherit'
553
+ }
554
554
  : { maxHeight: 0 }
555
555
 
556
556
  return (
@@ -560,30 +560,30 @@ class Select extends Component<SelectProps> {
560
560
  >
561
561
  {isShowingOptions
562
562
  ? Children.map(children as SelectChildren, (child, index) => {
563
- if (!child || !matchComponentTypes(child, [Group, Option])) {
564
- return // ignore invalid children
565
- }
566
- if (matchComponentTypes<OptionChild>(child, [Option])) {
567
- lastWasGroup = false
568
- return this.renderOption(child, {
569
- getOptionProps,
570
- getDisabledOptionProps
571
- })
572
- }
573
- if (matchComponentTypes<GroupChild>(child, [Group])) {
574
- const afterGroup = lastWasGroup
575
- lastWasGroup = true
576
- return this.renderGroup(child, {
577
- getOptionProps,
578
- getDisabledOptionProps,
579
- // for rendering separators appropriately
580
- isFirstChild: index === 0,
581
- isLastChild: index === Children.count(children) - 1,
582
- afterGroup
583
- })
584
- }
585
- return
586
- })
563
+ if (!child || !matchComponentTypes(child, [Group, Option])) {
564
+ return // ignore invalid children
565
+ }
566
+ if (matchComponentTypes<OptionChild>(child, [Option])) {
567
+ lastWasGroup = false
568
+ return this.renderOption(child, {
569
+ getOptionProps,
570
+ getDisabledOptionProps
571
+ })
572
+ }
573
+ if (matchComponentTypes<GroupChild>(child, [Group])) {
574
+ const afterGroup = lastWasGroup
575
+ lastWasGroup = true
576
+ return this.renderGroup(child, {
577
+ getOptionProps,
578
+ getDisabledOptionProps,
579
+ // for rendering separators appropriately
580
+ isFirstChild: index === 0,
581
+ isLastChild: index === Children.count(children) - 1,
582
+ afterGroup
583
+ })
584
+ }
585
+ return
586
+ })
587
587
  : null}
588
588
  </Options>
589
589
  </View>
@@ -622,8 +622,8 @@ class Select extends Component<SelectProps> {
622
622
  return position === 'before'
623
623
  ? option.props.renderBeforeLabel
624
624
  : option.props.renderAfterLabel
625
- ? option.props.renderAfterLabel
626
- : this.renderIcon()
625
+ ? option.props.renderAfterLabel
626
+ : this.renderIcon()
627
627
  }
628
628
  }
629
629
  } else {
@@ -632,8 +632,8 @@ class Select extends Component<SelectProps> {
632
632
  return position === 'before'
633
633
  ? child.props.renderBeforeLabel
634
634
  : child.props.renderAfterLabel
635
- ? child.props.renderAfterLabel
636
- : this.renderIcon()
635
+ ? child.props.renderAfterLabel
636
+ : this.renderIcon()
637
637
  }
638
638
  }
639
639
  }
@@ -730,26 +730,26 @@ class Select extends Component<SelectProps> {
730
730
  // popup buttons rather than comboboxes.
731
731
  const overrideProps: Partial<TextInputProps> = !isEditable
732
732
  ? {
733
- // We need role="combobox" for the 'open list' button shortcut to work
734
- // with desktop screenreaders.
735
- // But desktop Safari with Voiceover does not support proper combobox
736
- // handling, a 'button' role is set as a workaround.
737
- // See https://bugs.webkit.org/show_bug.cgi?id=236881
738
- // Also on iOS Chrome with role='combobox' it announces unnecessarily
739
- // that its 'read-only' and that this is a 'textfield', see INSTUI-4500
740
- role:
741
- utils.isSafari() ||
733
+ // We need role="combobox" for the 'open list' button shortcut to work
734
+ // with desktop screenreaders.
735
+ // But desktop Safari with Voiceover does not support proper combobox
736
+ // handling, a 'button' role is set as a workaround.
737
+ // See https://bugs.webkit.org/show_bug.cgi?id=236881
738
+ // Also on iOS Chrome with role='combobox' it announces unnecessarily
739
+ // that its 'read-only' and that this is a 'textfield', see INSTUI-4500
740
+ role:
741
+ utils.isSafari() ||
742
742
  utils.isAndroidOrIOS() ||
743
743
  (interaction === 'disabled' && utils.isChromium())
744
- ? 'button'
745
- : 'combobox',
746
- title: inputValue,
747
- 'aria-autocomplete': undefined,
748
- 'aria-readonly': true
749
- }
744
+ ? 'button'
745
+ : 'combobox',
746
+ title: inputValue,
747
+ 'aria-autocomplete': undefined,
748
+ 'aria-readonly': true
749
+ }
750
750
  : interaction === 'disabled' && utils.isChromium()
751
- ? { role: 'button' }
752
- : {}
751
+ ? { role: 'button' }
752
+ : {}
753
753
 
754
754
  // backdoor to autocomplete attr to work around chrome autofill issues
755
755
  if (passthroughProps['autoComplete']) {
@@ -796,8 +796,8 @@ class Select extends Component<SelectProps> {
796
796
  typeof onInputChange === 'function'
797
797
  ? onInputChange
798
798
  : inputValue
799
- ? () => { }
800
- : undefined,
799
+ ? () => {}
800
+ : undefined,
801
801
 
802
802
  onFocus,
803
803
  onBlur: utils.createChainedFunction(onBlur, onRequestHideOptions),
@@ -811,11 +811,10 @@ class Select extends Component<SelectProps> {
811
811
  suppressHydrationWarning
812
812
  {...(interaction === 'enabled' &&
813
813
  !isEditable && {
814
- themeOverride: (componentTheme) => ({
815
- //@ts-expect-error TODO-theme-types
816
- backgroundReadonlyColor: componentTheme.backgroundColor
817
- })
818
- })}
814
+ themeOverride: (componentTheme) => ({
815
+ backgroundReadonlyColor: componentTheme.backgroundColor
816
+ })
817
+ })}
819
818
  />
820
819
  )
821
820
  }
@@ -872,8 +871,8 @@ class Select extends Component<SelectProps> {
872
871
  mountNode !== undefined
873
872
  ? mountNode
874
873
  : utils.isAndroidOrIOS()
875
- ? this.ref
876
- : undefined
874
+ ? this.ref
875
+ : undefined
877
876
  }
878
877
  positionTarget={this._inputContainer}
879
878
  isShowingContent={isShowingOptions}
@@ -282,8 +282,7 @@ type PropKeys = keyof SelectOwnProps
282
282
  type AllowedPropKeys = Readonly<Array<PropKeys>>
283
283
 
284
284
  type SelectProps = SelectOwnProps &
285
- //@ts-expect-error TODO-theme-types
286
- WithStyleProps<NewComponentTypes['Select'], SelectStyle> &
285
+ WithStyleProps<ReturnType<NewComponentTypes['Select']>, SelectStyle> &
287
286
  OtherHTMLAttributes<
288
287
  SelectOwnProps,
289
288
  InputHTMLAttributes<SelectOwnProps & Element>
@@ -28,12 +28,11 @@ import type { SelectProps, SelectStyle } from './props'
28
28
  /**
29
29
  * Generates the style object from the theme and provided additional information
30
30
  * @param {Object} componentTheme The theme variable object.
31
- * @param {Object} props the props of the component, the style is applied to
32
- * @param {Object} state the state of the component, the style is applied to
31
+ * @param {Object} _props the props of the component, the style is applied to
33
32
  * @return {Object} The final style object, which will be used in the component
34
33
  */
35
34
  const generateStyle = (
36
- componentTheme: NewComponentTypes['Select'],
35
+ componentTheme: ReturnType<NewComponentTypes['Select']>,
37
36
  _props: SelectProps
38
37
  ): SelectStyle => {
39
38
  return {
@@ -41,7 +40,6 @@ const generateStyle = (
41
40
  label: 'select__assistiveText',
42
41
  display: 'none'
43
42
  },
44
- //@ts-expect-error TODO-theme-types
45
43
  popoverBorderWidth: componentTheme.popoverBorderWidth
46
44
  }
47
45
  }