11import type { ChangeEventHandler , InputHTMLAttributes , ReactElement } from 'react'
22import React , { useContext } from 'react'
33import type { SxProp } from '../sx'
4- import type { FormValidationStatus } from '../utils/types/FormValidationStatus'
54import { RadioGroupContext } from '../RadioGroup/RadioGroup'
65import { clsx } from 'clsx'
76import classes from './Radio.module.css'
@@ -35,10 +34,6 @@ export type RadioProps = {
3534 * Indicates whether the radio button must be checked before the form can be submitted
3635 */
3736 required ?: boolean
38- /**
39- * Only used to inform ARIA attributes. Individual radio inputs do not have validation styles.
40- */
41- validationStatus ?: FormValidationStatus
4237} & InputHTMLAttributes < HTMLInputElement > &
4338 SxProp
4439
@@ -54,7 +49,6 @@ const Radio = React.forwardRef<HTMLInputElement, RadioProps>(
5449 onChange,
5550 sx : sxProp = defaultSxProp ,
5651 required,
57- validationStatus,
5852 value,
5953 className,
6054 ...rest
@@ -77,7 +71,6 @@ const Radio = React.forwardRef<HTMLInputElement, RadioProps>(
7771
7872 if ( sxProp !== defaultSxProp ) {
7973 return (
80- // eslint-disable-next-line github/a11y-role-supports-aria-props
8174 < Box
8275 as = "input"
8376 sx = { sxProp }
@@ -89,8 +82,6 @@ const Radio = React.forwardRef<HTMLInputElement, RadioProps>(
8982 checked = { checked }
9083 aria-checked = { checked ? 'true' : 'false' }
9184 required = { required }
92- aria-required = { required ? 'true' : 'false' }
93- aria-invalid = { validationStatus === 'error' ? 'true' : 'false' }
9485 onChange = { handleOnChange }
9586 className = { clsx ( className , sharedClasses . Input , classes . Radio ) }
9687 { ...rest }
@@ -99,7 +90,6 @@ const Radio = React.forwardRef<HTMLInputElement, RadioProps>(
9990 }
10091
10192 return (
102- // eslint-disable-next-line github/a11y-role-supports-aria-props
10393 < input
10494 type = "radio"
10595 value = { value }
@@ -109,8 +99,6 @@ const Radio = React.forwardRef<HTMLInputElement, RadioProps>(
10999 checked = { checked }
110100 aria-checked = { checked ? 'true' : 'false' }
111101 required = { required }
112- aria-required = { required ? 'true' : 'false' }
113- aria-invalid = { validationStatus === 'error' ? 'true' : 'false' }
114102 onChange = { handleOnChange }
115103 className = { clsx ( className , sharedClasses . Input , classes . Radio ) }
116104 { ...rest }
0 commit comments