@instructure/ui-select 11.7.3-snapshot-4 → 11.7.3-snapshot-6
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 +1 -1
- package/es/Select/v2/index.js +0 -1
- package/es/Select/v2/styles.js +1 -3
- package/lib/Select/v2/index.js +0 -1
- package/lib/Select/v2/styles.js +1 -3
- package/package.json +19 -19
- package/src/Select/v2/index.tsx +125 -126
- package/src/Select/v2/props.ts +1 -2
- package/src/Select/v2/styles.ts +2 -4
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Select/v2/index.d.ts.map +1 -1
- package/types/Select/v2/props.d.ts +1 -1
- package/types/Select/v2/props.d.ts.map +1 -1
- package/types/Select/v2/styles.d.ts +2 -3
- package/types/Select/v2/styles.d.ts.map +1 -1
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-
|
|
6
|
+
## [11.7.3-snapshot-6](https://github.com/instructure/instructure-ui/compare/v11.7.2...v11.7.3-snapshot-6) (2026-04-29)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-select
|
|
9
9
|
|
package/es/Select/v2/index.js
CHANGED
|
@@ -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
|
})
|
package/es/Select/v2/styles.js
CHANGED
|
@@ -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}
|
|
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
|
};
|
package/lib/Select/v2/index.js
CHANGED
|
@@ -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
|
})
|
package/lib/Select/v2/styles.js
CHANGED
|
@@ -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}
|
|
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-
|
|
3
|
+
"version": "11.7.3-snapshot-6",
|
|
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/
|
|
19
|
-
"@instructure/ui-
|
|
20
|
-
"@instructure/
|
|
21
|
-
"@instructure/
|
|
22
|
-
"@instructure/
|
|
23
|
-
"@instructure/ui-options": "11.7.3-snapshot-
|
|
24
|
-
"@instructure/ui-popover": "11.7.3-snapshot-
|
|
25
|
-
"@instructure/ui-position": "11.7.3-snapshot-
|
|
26
|
-
"@instructure/ui-react-utils": "11.7.3-snapshot-
|
|
27
|
-
"@instructure/ui-selectable": "11.7.3-snapshot-
|
|
28
|
-
"@instructure/ui-text-input": "11.7.3-snapshot-
|
|
29
|
-
"@instructure/
|
|
30
|
-
"@instructure/ui-
|
|
31
|
-
"@instructure/
|
|
18
|
+
"@instructure/emotion": "11.7.3-snapshot-6",
|
|
19
|
+
"@instructure/ui-dom-utils": "11.7.3-snapshot-6",
|
|
20
|
+
"@instructure/ui-form-field": "11.7.3-snapshot-6",
|
|
21
|
+
"@instructure/shared-types": "11.7.3-snapshot-6",
|
|
22
|
+
"@instructure/ui-icons": "11.7.3-snapshot-6",
|
|
23
|
+
"@instructure/ui-options": "11.7.3-snapshot-6",
|
|
24
|
+
"@instructure/ui-popover": "11.7.3-snapshot-6",
|
|
25
|
+
"@instructure/ui-position": "11.7.3-snapshot-6",
|
|
26
|
+
"@instructure/ui-react-utils": "11.7.3-snapshot-6",
|
|
27
|
+
"@instructure/ui-selectable": "11.7.3-snapshot-6",
|
|
28
|
+
"@instructure/ui-text-input": "11.7.3-snapshot-6",
|
|
29
|
+
"@instructure/uid": "11.7.3-snapshot-6",
|
|
30
|
+
"@instructure/ui-utils": "11.7.3-snapshot-6",
|
|
31
|
+
"@instructure/ui-themes": "11.7.3-snapshot-6",
|
|
32
|
+
"@instructure/ui-view": "11.7.3-snapshot-6"
|
|
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-
|
|
39
|
-
"@instructure/ui-
|
|
40
|
-
"@instructure/ui-scripts": "11.7.3-snapshot-
|
|
41
|
-
"@instructure/ui-themes": "11.7.3-snapshot-4"
|
|
39
|
+
"@instructure/ui-babel-preset": "11.7.3-snapshot-6",
|
|
40
|
+
"@instructure/ui-color-utils": "11.7.3-snapshot-6",
|
|
41
|
+
"@instructure/ui-scripts": "11.7.3-snapshot-6"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"react": ">=18 <=19"
|
package/src/Select/v2/index.tsx
CHANGED
|
@@ -112,18 +112,18 @@ const MemoedOption = memo(
|
|
|
112
112
|
(prevProps, nextProps) => {
|
|
113
113
|
return (
|
|
114
114
|
prevProps.selectOption.props.isHighlighted ===
|
|
115
|
-
|
|
115
|
+
nextProps.selectOption.props.isHighlighted &&
|
|
116
116
|
prevProps.selectOption.props.isSelected ===
|
|
117
|
-
|
|
117
|
+
nextProps.selectOption.props.isSelected &&
|
|
118
118
|
prevProps.selectOption.props.isDisabled ===
|
|
119
|
-
|
|
119
|
+
nextProps.selectOption.props.isDisabled &&
|
|
120
120
|
prevProps.selectOption.props.children ===
|
|
121
|
-
|
|
121
|
+
nextProps.selectOption.props.children &&
|
|
122
122
|
prevProps.selectOption.props.id === nextProps.selectOption.props.id &&
|
|
123
123
|
prevProps.selectOption.props.renderBeforeLabel ===
|
|
124
|
-
|
|
124
|
+
nextProps.selectOption.props.renderBeforeLabel &&
|
|
125
125
|
prevProps.selectOption.props.renderAfterLabel ===
|
|
126
|
-
|
|
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
|
-
|
|
338
|
-
|
|
339
|
-
|
|
337
|
+
onRequestShowOptions: (event) => {
|
|
338
|
+
onRequestShowOptions?.(event)
|
|
339
|
+
const selectedOptionId = this.selectedOptionId
|
|
340
340
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
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
|
-
|
|
370
|
-
|
|
371
|
-
|
|
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
|
-
|
|
381
|
-
)
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
//
|
|
386
|
-
|
|
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
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
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
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
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
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
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
|
-
|
|
626
|
-
|
|
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
|
-
|
|
636
|
-
|
|
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
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
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
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
744
|
+
? 'button'
|
|
745
|
+
: 'combobox',
|
|
746
|
+
title: inputValue,
|
|
747
|
+
'aria-autocomplete': undefined,
|
|
748
|
+
'aria-readonly': true
|
|
749
|
+
}
|
|
750
750
|
: interaction === 'disabled' && utils.isChromium()
|
|
751
|
-
|
|
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
|
-
|
|
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
|
-
|
|
815
|
-
|
|
816
|
-
|
|
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
|
-
|
|
876
|
-
|
|
874
|
+
? this.ref
|
|
875
|
+
: undefined
|
|
877
876
|
}
|
|
878
877
|
positionTarget={this._inputContainer}
|
|
879
878
|
isShowingContent={isShowingOptions}
|
package/src/Select/v2/props.ts
CHANGED
|
@@ -282,8 +282,7 @@ type PropKeys = keyof SelectOwnProps
|
|
|
282
282
|
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
283
283
|
|
|
284
284
|
type SelectProps = SelectOwnProps &
|
|
285
|
-
|
|
286
|
-
WithStyleProps<NewComponentTypes['Select'], SelectStyle> &
|
|
285
|
+
WithStyleProps<ReturnType<NewComponentTypes['Select']>, SelectStyle> &
|
|
287
286
|
OtherHTMLAttributes<
|
|
288
287
|
SelectOwnProps,
|
|
289
288
|
InputHTMLAttributes<SelectOwnProps & Element>
|
package/src/Select/v2/styles.ts
CHANGED
|
@@ -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}
|
|
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
|
}
|