Skip to content

Commit 5ad1e93

Browse files
feat(Radio): remove support for sx (#6833)
Co-authored-by: Marie Lucca <40550942+francinelucca@users.noreply.github.com>
1 parent 00261c9 commit 5ad1e93

File tree

4 files changed

+7
-33
lines changed

4 files changed

+7
-33
lines changed

.changeset/fair-views-laugh.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@primer/react': major
3+
---
4+
5+
Remove sx support from Radio

packages/react/src/Radio/Radio.dev.stories.tsx

Lines changed: 0 additions & 17 deletions
This file was deleted.

packages/react/src/Radio/Radio.docs.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,6 @@
5959
{
6060
"name": "ref",
6161
"type": "React.RefObject<HTMLInputElement>"
62-
},
63-
{
64-
"name": "as",
65-
"type": "React.ElementType",
66-
"defaultValue": "\"input\""
67-
},
68-
{
69-
"name": "sx",
70-
"type": "SystemStyleObject",
71-
"deprecated": true
7262
}
7363
],
7464
"subcomponents": []

packages/react/src/Radio/Radio.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import type {ChangeEventHandler, InputHTMLAttributes, ReactElement} from 'react'
22
import React, {useContext} from 'react'
3-
import type {SxProp} from '../sx'
43
import {RadioGroupContext} from '../RadioGroup/RadioGroup'
54
import {clsx} from 'clsx'
65
import sharedClasses from '../Checkbox/shared.module.css'
76
import classes from './Radio.module.css'
8-
import {BoxWithFallback} from '../internal/components/BoxWithFallback'
97

108
export type RadioProps = {
119
/**
@@ -33,8 +31,7 @@ export type RadioProps = {
3331
* Indicates whether the radio button must be checked before the form can be submitted
3432
*/
3533
required?: boolean
36-
} & InputHTMLAttributes<HTMLInputElement> &
37-
SxProp
34+
} & InputHTMLAttributes<HTMLInputElement>
3835

3936
/**
4037
* An accessible, native radio component for selecting one option from a list.
@@ -69,8 +66,7 @@ const Radio = React.forwardRef<HTMLInputElement, RadioProps>(
6966
}
7067

7168
return (
72-
<BoxWithFallback
73-
as="input"
69+
<input
7470
type="radio"
7571
value={value}
7672
name={name}

0 commit comments

Comments
 (0)