@instructure/ui-select 11.7.3-snapshot-33 → 11.7.3-snapshot-38

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-33](https://github.com/instructure/instructure-ui/compare/v11.7.2...v11.7.3-snapshot-33) (2026-05-07)
6
+ ## [11.7.3-snapshot-38](https://github.com/instructure/instructure-ui/compare/v11.7.2...v11.7.3-snapshot-38) (2026-05-07)
7
7
 
8
8
 
9
9
  ### Bug Fixes
@@ -34,7 +34,7 @@ import { Popover } from '@instructure/ui-popover/v11_6';
34
34
  import { TextInput } from '@instructure/ui-text-input/v11_6';
35
35
  import { Options } from '@instructure/ui-options/v11_6';
36
36
  import { IconArrowOpenDownLine, IconArrowOpenUpLine } from '@instructure/ui-icons';
37
- import { withStyleLegacy as withStyle } from '@instructure/emotion';
37
+ import { withStyle } from '@instructure/emotion';
38
38
  import generateStyle from "./styles.js";
39
39
  import generateComponentTheme from "./theme.js";
40
40
  import { Group } from "./Group/index.js";
@@ -34,7 +34,7 @@ import { Popover } from '@instructure/ui-popover/latest';
34
34
  import { TextInput } from '@instructure/ui-text-input/latest';
35
35
  import { Options } from '@instructure/ui-options/latest';
36
36
  import { ChevronDownInstUIIcon, ChevronUpInstUIIcon } from '@instructure/ui-icons';
37
- import { withStyle } from '@instructure/emotion';
37
+ import { withStyleNew } from '@instructure/emotion';
38
38
  import generateStyle from "./styles.js";
39
39
  import { Group } from "./Group/index.js";
40
40
  import { Option } from "./Option/index.js";
@@ -78,7 +78,7 @@ category: components
78
78
  tags: autocomplete, typeahead, combobox, dropdown, search, form
79
79
  ---
80
80
  **/
81
- let Select = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle), _dec(_class = _dec2(_class = class Select extends Component {
81
+ let Select = (_dec = withDeterministicId(), _dec2 = withStyleNew(generateStyle), _dec(_class = _dec2(_class = class Select extends Component {
82
82
  static displayName = "Select";
83
83
  static componentId = 'Select';
84
84
  SCROLL_TOLERANCE = 0.5;
@@ -86,7 +86,7 @@ category: components
86
86
  tags: autocomplete, typeahead, combobox, dropdown, search, form
87
87
  ---
88
88
  **/
89
- let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = _dec2(_class = class Select extends _react.Component {
89
+ let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = _dec2(_class = class Select extends _react.Component {
90
90
  static displayName = "Select";
91
91
  static componentId = 'Select';
92
92
  SCROLL_TOLERANCE = 0.5;
@@ -89,7 +89,7 @@ category: components
89
89
  tags: autocomplete, typeahead, combobox, dropdown, search, form
90
90
  ---
91
91
  **/
92
- let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default), _dec(_class = _dec2(_class = class Select extends _react.Component {
92
+ let Select = exports.Select = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyleNew)(_styles.default), _dec(_class = _dec2(_class = class Select extends _react.Component {
93
93
  static displayName = "Select";
94
94
  static componentId = 'Select';
95
95
  SCROLL_TOLERANCE = 0.5;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-select",
3
- "version": "11.7.3-snapshot-33",
3
+ "version": "11.7.3-snapshot-38",
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.29.2",
18
- "@instructure/emotion": "11.7.3-snapshot-33",
19
- "@instructure/shared-types": "11.7.3-snapshot-33",
20
- "@instructure/ui-dom-utils": "11.7.3-snapshot-33",
21
- "@instructure/ui-form-field": "11.7.3-snapshot-33",
22
- "@instructure/ui-icons": "11.7.3-snapshot-33",
23
- "@instructure/ui-options": "11.7.3-snapshot-33",
24
- "@instructure/ui-position": "11.7.3-snapshot-33",
25
- "@instructure/ui-popover": "11.7.3-snapshot-33",
26
- "@instructure/ui-react-utils": "11.7.3-snapshot-33",
27
- "@instructure/ui-selectable": "11.7.3-snapshot-33",
28
- "@instructure/ui-text-input": "11.7.3-snapshot-33",
29
- "@instructure/ui-utils": "11.7.3-snapshot-33",
30
- "@instructure/ui-themes": "11.7.3-snapshot-33",
31
- "@instructure/ui-view": "11.7.3-snapshot-33",
32
- "@instructure/uid": "11.7.3-snapshot-33"
18
+ "@instructure/emotion": "11.7.3-snapshot-38",
19
+ "@instructure/shared-types": "11.7.3-snapshot-38",
20
+ "@instructure/ui-dom-utils": "11.7.3-snapshot-38",
21
+ "@instructure/ui-form-field": "11.7.3-snapshot-38",
22
+ "@instructure/ui-icons": "11.7.3-snapshot-38",
23
+ "@instructure/ui-options": "11.7.3-snapshot-38",
24
+ "@instructure/ui-popover": "11.7.3-snapshot-38",
25
+ "@instructure/ui-position": "11.7.3-snapshot-38",
26
+ "@instructure/ui-react-utils": "11.7.3-snapshot-38",
27
+ "@instructure/ui-text-input": "11.7.3-snapshot-38",
28
+ "@instructure/ui-selectable": "11.7.3-snapshot-38",
29
+ "@instructure/ui-themes": "11.7.3-snapshot-38",
30
+ "@instructure/ui-utils": "11.7.3-snapshot-38",
31
+ "@instructure/ui-view": "11.7.3-snapshot-38",
32
+ "@instructure/uid": "11.7.3-snapshot-38"
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-babel-preset": "11.7.3-snapshot-33",
40
- "@instructure/ui-color-utils": "11.7.3-snapshot-33",
41
- "@instructure/ui-scripts": "11.7.3-snapshot-33"
39
+ "@instructure/ui-babel-preset": "11.7.3-snapshot-38",
40
+ "@instructure/ui-color-utils": "11.7.3-snapshot-38",
41
+ "@instructure/ui-scripts": "11.7.3-snapshot-38"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "react": ">=18 <=19"
@@ -59,7 +59,7 @@ import type {
59
59
  SelectableRender
60
60
  } from '@instructure/ui-selectable'
61
61
 
62
- import { withStyleLegacy as withStyle, BorderWidth } from '@instructure/emotion'
62
+ import { withStyle, BorderWidth } from '@instructure/emotion'
63
63
 
64
64
  import generateStyle from './styles'
65
65
  import generateComponentTheme from './theme'
@@ -59,7 +59,7 @@ import type {
59
59
  SelectableRender
60
60
  } from '@instructure/ui-selectable'
61
61
 
62
- import { withStyle, BorderWidth } from '@instructure/emotion'
62
+ import { withStyleNew, BorderWidth } from '@instructure/emotion'
63
63
 
64
64
  import generateStyle from './styles'
65
65
 
@@ -111,18 +111,18 @@ const MemoedOption = memo(
111
111
  (prevProps, nextProps) => {
112
112
  return (
113
113
  prevProps.selectOption.props.isHighlighted ===
114
- nextProps.selectOption.props.isHighlighted &&
114
+ nextProps.selectOption.props.isHighlighted &&
115
115
  prevProps.selectOption.props.isSelected ===
116
- nextProps.selectOption.props.isSelected &&
116
+ nextProps.selectOption.props.isSelected &&
117
117
  prevProps.selectOption.props.isDisabled ===
118
- nextProps.selectOption.props.isDisabled &&
118
+ nextProps.selectOption.props.isDisabled &&
119
119
  prevProps.selectOption.props.children ===
120
- nextProps.selectOption.props.children &&
120
+ nextProps.selectOption.props.children &&
121
121
  prevProps.selectOption.props.id === nextProps.selectOption.props.id &&
122
122
  prevProps.selectOption.props.renderBeforeLabel ===
123
- nextProps.selectOption.props.renderBeforeLabel &&
123
+ nextProps.selectOption.props.renderBeforeLabel &&
124
124
  prevProps.selectOption.props.renderAfterLabel ===
125
- nextProps.selectOption.props.renderAfterLabel &&
125
+ nextProps.selectOption.props.renderAfterLabel &&
126
126
  prevProps.children === nextProps.children
127
127
  )
128
128
  }
@@ -137,7 +137,7 @@ tags: autocomplete, typeahead, combobox, dropdown, search, form
137
137
  ---
138
138
  **/
139
139
  @withDeterministicId()
140
- @withStyle(generateStyle)
140
+ @withStyleNew(generateStyle)
141
141
  class Select extends Component<SelectProps> {
142
142
  static readonly componentId = 'Select'
143
143
  private readonly SCROLL_TOLERANCE = 0.5
@@ -333,59 +333,59 @@ class Select extends Component<SelectProps> {
333
333
 
334
334
  return this.interaction === 'enabled'
335
335
  ? {
336
- onRequestShowOptions: (event) => {
337
- onRequestShowOptions?.(event)
338
- const selectedOptionId = this.selectedOptionId
336
+ onRequestShowOptions: (event) => {
337
+ onRequestShowOptions?.(event)
338
+ const selectedOptionId = this.selectedOptionId
339
339
 
340
- if (selectedOptionId && !Array.isArray(selectedOptionId)) {
341
- // highlight selected option on show
342
- this.highlightOption(event, selectedOptionId)
340
+ if (selectedOptionId && !Array.isArray(selectedOptionId)) {
341
+ // highlight selected option on show
342
+ this.highlightOption(event, selectedOptionId)
343
+ }
344
+ },
345
+ onRequestHideOptions: (event) => {
346
+ onRequestHideOptions?.(event)
347
+ },
348
+ onRequestHighlightOption: (
349
+ event,
350
+ { id, direction }: { id?: string; direction?: number }
351
+ ) => {
352
+ if (!isShowingOptions) return
353
+
354
+ const highlightedOptionId = this.highlightedOptionId
355
+ // if id exists, use that
356
+ let highlightId = this._optionIds.indexOf(id!) > -1 ? id : undefined
357
+ if (!highlightId) {
358
+ if (!highlightedOptionId) {
359
+ // nothing highlighted yet, highlight first option
360
+ highlightId = this._optionIds[0]
361
+ } else {
362
+ // find next id based on direction
363
+ const index = this._optionIds.indexOf(highlightedOptionId)
364
+ highlightId =
365
+ index > -1 ? this._optionIds[index + direction!] : undefined
343
366
  }
344
- },
345
- onRequestHideOptions: (event) => {
346
- onRequestHideOptions?.(event)
347
- },
348
- onRequestHighlightOption: (
367
+ }
368
+ if (highlightId) {
369
+ // only highlight if id exists as a valid option
370
+ this.highlightOption(event, highlightId)
371
+ }
372
+ },
373
+ onRequestHighlightFirstOption: (event) => {
374
+ this.highlightOption(event, this._optionIds[0])
375
+ },
376
+ onRequestHighlightLastOption: (event) => {
377
+ this.highlightOption(
349
378
  event,
350
- { id, direction }: { id?: string; direction?: number }
351
- ) => {
352
- if (!isShowingOptions) return
353
-
354
- const highlightedOptionId = this.highlightedOptionId
355
- // if id exists, use that
356
- let highlightId = this._optionIds.indexOf(id!) > -1 ? id : undefined
357
- if (!highlightId) {
358
- if (!highlightedOptionId) {
359
- // nothing highlighted yet, highlight first option
360
- highlightId = this._optionIds[0]
361
- } else {
362
- // find next id based on direction
363
- const index = this._optionIds.indexOf(highlightedOptionId)
364
- highlightId =
365
- index > -1 ? this._optionIds[index + direction!] : undefined
366
- }
367
- }
368
- if (highlightId) {
369
- // only highlight if id exists as a valid option
370
- this.highlightOption(event, highlightId)
371
- }
372
- },
373
- onRequestHighlightFirstOption: (event) => {
374
- this.highlightOption(event, this._optionIds[0])
375
- },
376
- onRequestHighlightLastOption: (event) => {
377
- this.highlightOption(
378
- event,
379
- this._optionIds[this._optionIds.length - 1]
380
- )
381
- },
382
- onRequestSelectOption: (event, { id }) => {
383
- if (id && this._optionIds.indexOf(id) !== -1) {
384
- // only select if id exists as a valid option
385
- onRequestSelectOption?.(event, { id })
386
- }
379
+ this._optionIds[this._optionIds.length - 1]
380
+ )
381
+ },
382
+ onRequestSelectOption: (event, { id }) => {
383
+ if (id && this._optionIds.indexOf(id) !== -1) {
384
+ // only select if id exists as a valid option
385
+ onRequestSelectOption?.(event, { id })
387
386
  }
388
387
  }
388
+ }
389
389
  : {}
390
390
  }
391
391
 
@@ -412,12 +412,12 @@ class Select extends Component<SelectProps> {
412
412
  return typeof renderOptionLabel === 'function' &&
413
413
  !renderOptionLabel?.prototype?.isReactComponent
414
414
  ? (renderOptionLabel as any).bind(null, {
415
- id,
416
- isDisabled,
417
- isSelected,
418
- isHighlighted,
419
- children
420
- })
415
+ id,
416
+ isDisabled,
417
+ isSelected,
418
+ isHighlighted,
419
+ children
420
+ })
421
421
  : (renderOptionLabel as React.ReactNode)
422
422
  }
423
423
 
@@ -531,18 +531,18 @@ class Select extends Component<SelectProps> {
531
531
 
532
532
  const viewProps: Partial<ViewProps> = isShowingOptions
533
533
  ? {
534
- display: 'block',
535
- overflowY: 'auto',
536
- maxHeight:
537
- optionsMaxHeight ||
538
- this._optionHeight * visibleOptionsCount! -
539
- // in Chrome, we need to prevent scrolling when the bottom area of last item is hovered
540
- (utils.isChromium() ? this.SCROLL_TOLERANCE : 0),
541
- maxWidth: optionsMaxWidth || this.width,
542
- background: 'primary',
543
- elementRef: (node: Element | null) => (this._listView = node),
544
- borderRadius: 'inherit'
545
- }
534
+ display: 'block',
535
+ overflowY: 'auto',
536
+ maxHeight:
537
+ optionsMaxHeight ||
538
+ this._optionHeight * visibleOptionsCount! -
539
+ // in Chrome, we need to prevent scrolling when the bottom area of last item is hovered
540
+ (utils.isChromium() ? this.SCROLL_TOLERANCE : 0),
541
+ maxWidth: optionsMaxWidth || this.width,
542
+ background: 'primary',
543
+ elementRef: (node: Element | null) => (this._listView = node),
544
+ borderRadius: 'inherit'
545
+ }
546
546
  : { maxHeight: 0 }
547
547
 
548
548
  return (
@@ -552,30 +552,30 @@ class Select extends Component<SelectProps> {
552
552
  >
553
553
  {isShowingOptions
554
554
  ? Children.map(children as SelectChildren, (child, index) => {
555
- if (!child || !matchComponentTypes(child, [Group, Option])) {
556
- return // ignore invalid children
557
- }
558
- if (matchComponentTypes<OptionChild>(child, [Option])) {
559
- lastWasGroup = false
560
- return this.renderOption(child, {
561
- getOptionProps,
562
- getDisabledOptionProps
563
- })
564
- }
565
- if (matchComponentTypes<GroupChild>(child, [Group])) {
566
- const afterGroup = lastWasGroup
567
- lastWasGroup = true
568
- return this.renderGroup(child, {
569
- getOptionProps,
570
- getDisabledOptionProps,
571
- // for rendering separators appropriately
572
- isFirstChild: index === 0,
573
- isLastChild: index === Children.count(children) - 1,
574
- afterGroup
575
- })
576
- }
577
- return
578
- })
555
+ if (!child || !matchComponentTypes(child, [Group, Option])) {
556
+ return // ignore invalid children
557
+ }
558
+ if (matchComponentTypes<OptionChild>(child, [Option])) {
559
+ lastWasGroup = false
560
+ return this.renderOption(child, {
561
+ getOptionProps,
562
+ getDisabledOptionProps
563
+ })
564
+ }
565
+ if (matchComponentTypes<GroupChild>(child, [Group])) {
566
+ const afterGroup = lastWasGroup
567
+ lastWasGroup = true
568
+ return this.renderGroup(child, {
569
+ getOptionProps,
570
+ getDisabledOptionProps,
571
+ // for rendering separators appropriately
572
+ isFirstChild: index === 0,
573
+ isLastChild: index === Children.count(children) - 1,
574
+ afterGroup
575
+ })
576
+ }
577
+ return
578
+ })
579
579
  : null}
580
580
  </Options>
581
581
  </View>
@@ -614,8 +614,8 @@ class Select extends Component<SelectProps> {
614
614
  return position === 'before'
615
615
  ? option.props.renderBeforeLabel
616
616
  : option.props.renderAfterLabel
617
- ? option.props.renderAfterLabel
618
- : this.renderIcon()
617
+ ? option.props.renderAfterLabel
618
+ : this.renderIcon()
619
619
  }
620
620
  }
621
621
  } else {
@@ -624,8 +624,8 @@ class Select extends Component<SelectProps> {
624
624
  return position === 'before'
625
625
  ? child.props.renderBeforeLabel
626
626
  : child.props.renderAfterLabel
627
- ? child.props.renderAfterLabel
628
- : this.renderIcon()
627
+ ? child.props.renderAfterLabel
628
+ : this.renderIcon()
629
629
  }
630
630
  }
631
631
  }
@@ -722,26 +722,26 @@ class Select extends Component<SelectProps> {
722
722
  // popup buttons rather than comboboxes.
723
723
  const overrideProps: Partial<TextInputProps> = !isEditable
724
724
  ? {
725
- // We need role="combobox" for the 'open list' button shortcut to work
726
- // with desktop screenreaders.
727
- // But desktop Safari with Voiceover does not support proper combobox
728
- // handling, a 'button' role is set as a workaround.
729
- // See https://bugs.webkit.org/show_bug.cgi?id=236881
730
- // Also on iOS Chrome with role='combobox' it announces unnecessarily
731
- // that its 'read-only' and that this is a 'textfield', see INSTUI-4500
732
- role:
733
- utils.isSafari() ||
725
+ // We need role="combobox" for the 'open list' button shortcut to work
726
+ // with desktop screenreaders.
727
+ // But desktop Safari with Voiceover does not support proper combobox
728
+ // handling, a 'button' role is set as a workaround.
729
+ // See https://bugs.webkit.org/show_bug.cgi?id=236881
730
+ // Also on iOS Chrome with role='combobox' it announces unnecessarily
731
+ // that its 'read-only' and that this is a 'textfield', see INSTUI-4500
732
+ role:
733
+ utils.isSafari() ||
734
734
  utils.isAndroidOrIOS() ||
735
735
  (interaction === 'disabled' && utils.isChromium())
736
- ? 'button'
737
- : 'combobox',
738
- title: inputValue,
739
- 'aria-autocomplete': undefined,
740
- 'aria-readonly': true
741
- }
736
+ ? 'button'
737
+ : 'combobox',
738
+ title: inputValue,
739
+ 'aria-autocomplete': undefined,
740
+ 'aria-readonly': true
741
+ }
742
742
  : interaction === 'disabled' && utils.isChromium()
743
- ? { role: 'button' }
744
- : {}
743
+ ? { role: 'button' }
744
+ : {}
745
745
 
746
746
  // backdoor to autocomplete attr to work around chrome autofill issues
747
747
  if (passthroughProps['autoComplete']) {
@@ -788,8 +788,8 @@ class Select extends Component<SelectProps> {
788
788
  typeof onInputChange === 'function'
789
789
  ? onInputChange
790
790
  : inputValue
791
- ? () => {}
792
- : undefined,
791
+ ? () => { }
792
+ : undefined,
793
793
 
794
794
  onFocus,
795
795
  onBlur: utils.createChainedFunction(onBlur, onRequestHideOptions),
@@ -803,10 +803,10 @@ class Select extends Component<SelectProps> {
803
803
  suppressHydrationWarning
804
804
  {...(interaction === 'enabled' &&
805
805
  !isEditable && {
806
- themeOverride: (componentTheme) => ({
807
- backgroundReadonlyColor: componentTheme.backgroundColor
808
- })
809
- })}
806
+ themeOverride: (componentTheme) => ({
807
+ backgroundReadonlyColor: componentTheme.backgroundColor
808
+ })
809
+ })}
810
810
  />
811
811
  )
812
812
  }
@@ -863,8 +863,8 @@ class Select extends Component<SelectProps> {
863
863
  mountNode !== undefined
864
864
  ? mountNode
865
865
  : utils.isAndroidOrIOS()
866
- ? this.ref
867
- : undefined
866
+ ? this.ref
867
+ : undefined
868
868
  }
869
869
  positionTarget={this._inputContainer}
870
870
  isShowingContent={isShowingOptions}