1
1
import type { ChangeEventHandler , InputHTMLAttributes , ReactElement } from 'react'
2
2
import React , { useContext } from 'react'
3
3
import type { SxProp } from '../sx'
4
- import type { FormValidationStatus } from '../utils/types/FormValidationStatus'
5
4
import { RadioGroupContext } from '../RadioGroup/RadioGroup'
6
5
import { clsx } from 'clsx'
7
6
import classes from './Radio.module.css'
@@ -35,10 +34,6 @@ export type RadioProps = {
35
34
* Indicates whether the radio button must be checked before the form can be submitted
36
35
*/
37
36
required ?: boolean
38
- /**
39
- * Only used to inform ARIA attributes. Individual radio inputs do not have validation styles.
40
- */
41
- validationStatus ?: FormValidationStatus
42
37
} & InputHTMLAttributes < HTMLInputElement > &
43
38
SxProp
44
39
@@ -54,7 +49,6 @@ const Radio = React.forwardRef<HTMLInputElement, RadioProps>(
54
49
onChange,
55
50
sx : sxProp = defaultSxProp ,
56
51
required,
57
- validationStatus,
58
52
value,
59
53
className,
60
54
...rest
@@ -77,7 +71,6 @@ const Radio = React.forwardRef<HTMLInputElement, RadioProps>(
77
71
78
72
if ( sxProp !== defaultSxProp ) {
79
73
return (
80
- // eslint-disable-next-line github/a11y-role-supports-aria-props
81
74
< Box
82
75
as = "input"
83
76
sx = { sxProp }
@@ -89,8 +82,6 @@ const Radio = React.forwardRef<HTMLInputElement, RadioProps>(
89
82
checked = { checked }
90
83
aria-checked = { checked ? 'true' : 'false' }
91
84
required = { required }
92
- aria-required = { required ? 'true' : 'false' }
93
- aria-invalid = { validationStatus === 'error' ? 'true' : 'false' }
94
85
onChange = { handleOnChange }
95
86
className = { clsx ( className , sharedClasses . Input , classes . Radio ) }
96
87
{ ...rest }
@@ -99,7 +90,6 @@ const Radio = React.forwardRef<HTMLInputElement, RadioProps>(
99
90
}
100
91
101
92
return (
102
- // eslint-disable-next-line github/a11y-role-supports-aria-props
103
93
< input
104
94
type = "radio"
105
95
value = { value }
@@ -109,8 +99,6 @@ const Radio = React.forwardRef<HTMLInputElement, RadioProps>(
109
99
checked = { checked }
110
100
aria-checked = { checked ? 'true' : 'false' }
111
101
required = { required }
112
- aria-required = { required ? 'true' : 'false' }
113
- aria-invalid = { validationStatus === 'error' ? 'true' : 'false' }
114
102
onChange = { handleOnChange }
115
103
className = { clsx ( className , sharedClasses . Input , classes . Radio ) }
116
104
{ ...rest }
0 commit comments