@@ -2,12 +2,20 @@ import React from 'react';
22import PropTypes from 'prop-types' ;
33import { Radio as MUIRadio , FormControlLabel , FormControl , FormLabel , FormHelperText } from '@material-ui/core' ;
44import { wrapperProps } from '@data-driven-forms/common/src/multiple-choice-list' ;
5+ import { makeStyles } from '@material-ui/core/styles' ;
56
67import FormFieldGrid from '../common/form-field-grid' ;
78import { validationError } from '../common/helpers' ;
8- import './radio.scss' ;
99import { useFieldApi } from '@data-driven-forms/react-form-renderer' ;
1010
11+ const useStyles = makeStyles ( ( ) => ( {
12+ grid : {
13+ '&:first-child' : {
14+ marginTop : 8
15+ }
16+ }
17+ } ) ) ;
18+
1119const RadioOption = ( { name, option, isDisabled, isReadOnly } ) => {
1220 const { input } = useFieldApi ( { name, type : 'radio' , value : option . value } ) ;
1321 return (
@@ -42,10 +50,11 @@ const Radio = ({ name, ...props }) => {
4250 name,
4351 type : 'radio'
4452 } ) ;
53+ const classes = useStyles ( ) ;
4554 const invalid = validationError ( meta , validateOnMount ) ;
4655 const text = invalid || helperText || description ;
4756 return (
48- < FormFieldGrid className = "mui-ddform-radio-group" >
57+ < FormFieldGrid className = { classes . grid } >
4958 < FormControl required = { isRequired } error = { ! ! invalid } component = "fieldset" >
5059 < FormLabel component = "legend" > { label } </ FormLabel >
5160 { options . map ( ( option ) => (
0 commit comments