File tree Expand file tree Collapse file tree 3 files changed +37
-66
lines changed Expand file tree Collapse file tree 3 files changed +37
-66
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ const Wrapper = styled.div`
2626 }
2727` ;
2828export default {
29- title : 'Radio' ,
29+ title : 'Controls/ Radio' ,
3030 component : Radio ,
3131 decorators : [ story => < Wrapper > { story ( ) } </ Wrapper > ]
3232} as ComponentMeta < typeof Radio > ;
Original file line number Diff line number Diff line change @@ -136,38 +136,42 @@ const CheckboxComponents = {
136136 menu : StyledMenuCheckbox
137137} ;
138138
139- const Radio = forwardRef < HTMLInputElement , RadioProps > ( function Radio (
140- {
141- checked,
142- className = '' ,
143- disabled = false ,
144- label = '' ,
145- onChange,
146- style = { } ,
147- variant = 'default' ,
148- ...otherProps
149- } ,
150- ref
151- ) {
152- const CheckboxComponent = CheckboxComponents [ variant ] ;
139+ const Radio = forwardRef < HTMLInputElement , RadioProps > (
140+ (
141+ {
142+ checked,
143+ className = '' ,
144+ disabled = false ,
145+ label = '' ,
146+ onChange,
147+ style = { } ,
148+ variant = 'default' ,
149+ ...otherProps
150+ } ,
151+ ref
152+ ) => {
153+ const CheckboxComponent = CheckboxComponents [ variant ] ;
153154
154- return (
155- < StyledLabel $disabled = { disabled } className = { className } style = { style } >
156- < CheckboxComponent $disabled = { disabled } role = 'presentation' >
157- { checked && < Icon $disabled = { disabled } variant = { variant } /> }
158- </ CheckboxComponent >
159- < StyledInput
160- disabled = { disabled }
161- onChange = { disabled ? undefined : onChange }
162- readOnly = { disabled }
163- type = 'radio'
164- checked = { checked }
165- ref = { ref }
166- { ...otherProps }
167- />
168- { label && < LabelText > { label } </ LabelText > }
169- </ StyledLabel >
170- ) ;
171- } ) ;
155+ return (
156+ < StyledLabel $disabled = { disabled } className = { className } style = { style } >
157+ < CheckboxComponent $disabled = { disabled } role = 'presentation' >
158+ { checked && < Icon $disabled = { disabled } variant = { variant } /> }
159+ </ CheckboxComponent >
160+ < StyledInput
161+ disabled = { disabled }
162+ onChange = { disabled ? undefined : onChange }
163+ readOnly = { disabled }
164+ type = 'radio'
165+ checked = { checked }
166+ ref = { ref }
167+ { ...otherProps }
168+ />
169+ { label && < LabelText > { label } </ LabelText > }
170+ </ StyledLabel >
171+ ) ;
172+ }
173+ ) ;
174+
175+ Radio . displayName = 'Radio' ;
172176
173177export { Radio , RadioProps } ;
You can’t perform that action at this time.
0 commit comments