File tree 6 files changed +9
-9
lines changed
6 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ type SelectProps = {
37
37
inline ?: boolean ;
38
38
onChange ?: ( value : string ) => void ;
39
39
className ?: string ;
40
+ ariaLabel ?: string ;
40
41
} ;
41
42
42
43
const Select : FC < SelectProps > = ( {
@@ -47,6 +48,7 @@ const Select: FC<SelectProps> = ({
47
48
inline,
48
49
onChange,
49
50
className,
51
+ ariaLabel,
50
52
} ) => {
51
53
const id = useId ( ) ;
52
54
@@ -72,7 +74,7 @@ const Select: FC<SelectProps> = ({
72
74
className
73
75
) }
74
76
>
75
- { label && ! inline && (
77
+ { label && (
76
78
< label className = { styles . label } htmlFor = { id } >
77
79
{ label }
78
80
</ label >
@@ -81,7 +83,7 @@ const Select: FC<SelectProps> = ({
81
83
< SelectPrimitive . Root value = { defaultValue } onValueChange = { onChange } >
82
84
< SelectPrimitive . Trigger
83
85
className = { styles . trigger }
84
- aria-label = { label }
86
+ aria-label = { ariaLabel }
85
87
id = { id }
86
88
>
87
89
< SelectPrimitive . Value placeholder = { placeholder } />
Original file line number Diff line number Diff line change 1
1
'use client' ;
2
-
3
2
import { useTranslations } from 'next-intl' ;
4
3
import type { FC } from 'react' ;
5
4
import { useEffect , useContext , useMemo } from 'react' ;
@@ -86,11 +85,11 @@ const BitnessDropdown: FC = () => {
86
85
87
86
return (
88
87
< Select
89
- label = { t ( 'layouts.download.dropdown.bitness' ) }
90
88
values = { formatDropdownItems ( {
91
89
items : bitnessItems [ os ] ,
92
90
disabledItems,
93
91
} ) }
92
+ ariaLabel = { t ( 'layouts.download.dropdown.bitness' ) }
94
93
defaultValue = { String ( bitness ) }
95
94
onChange = { bitness => setBitness ( parseNumericBitness ( bitness ) ) }
96
95
className = "w-28"
Original file line number Diff line number Diff line change 1
1
'use client' ;
2
-
3
2
import { useTranslations } from 'next-intl' ;
4
3
import { useContext , useEffect , useMemo } from 'react' ;
5
4
import type { FC } from 'react' ;
@@ -68,7 +67,6 @@ const OperatingSystemDropdown: FC<OperatingSystemDropdownProps> = ({
68
67
69
68
return (
70
69
< Select
71
- label = { t ( 'layouts.download.dropdown.os' ) }
72
70
values = { formatDropdownItems ( {
73
71
items : operatingSystemItems ,
74
72
disabledItems,
@@ -79,6 +77,7 @@ const OperatingSystemDropdown: FC<OperatingSystemDropdownProps> = ({
79
77
AIX : < Aix width = { 16 } height = { 16 } /> ,
80
78
} ,
81
79
} ) }
80
+ ariaLabel = { t ( 'layouts.download.dropdown.os' ) }
82
81
defaultValue = { os }
83
82
onChange = { value => setOS ( value as UserOS ) }
84
83
className = "w-[8.5rem]"
Original file line number Diff line number Diff line change 1
1
'use client' ;
2
-
3
2
import { useTranslations } from 'next-intl' ;
4
3
import { useContext , useEffect , useMemo } from 'react' ;
5
4
import type { FC } from 'react' ;
@@ -69,7 +68,6 @@ const PlatformDropdown: FC = () => {
69
68
70
69
return (
71
70
< Select
72
- label = { t ( 'layouts.download.dropdown.platform' ) }
73
71
values = { formatDropdownItems ( {
74
72
items : platformItems ,
75
73
icons : {
@@ -80,6 +78,7 @@ const PlatformDropdown: FC = () => {
80
78
} ,
81
79
disabledItems,
82
80
} ) }
81
+ ariaLabel = { t ( 'layouts.download.dropdown.platform' ) }
83
82
defaultValue = { platform }
84
83
onChange = { platform => setPlatform ( platform as PackageManager ) }
85
84
className = "w-28"
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ const VersionDropdown: FC = () => {
25
25
26
26
return (
27
27
< Select
28
- label = { t ( 'layouts.download.dropdown.version' ) }
28
+ ariaLabel = { t ( 'layouts.download.dropdown.version' ) }
29
29
values = { releases . map ( ( { status, versionWithPrefix } ) => ( {
30
30
value : versionWithPrefix ,
31
31
label : getDropDownStatus ( versionWithPrefix , status ) ,
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ const WithRouterSelect: FC<WithSidebarSelectProps> = ({
19
19
20
20
return (
21
21
< Select
22
+ inline = { true }
22
23
label = { label }
23
24
values = { values }
24
25
defaultValue = { defaultValue }
You can’t perform that action at this time.
0 commit comments