Skip to content

Commit

Permalink
Adding CSS extraction for FormGroup
Browse files Browse the repository at this point in the history
  • Loading branch information
aacevski committed Mar 23, 2024
1 parent 0102a95 commit cb7f534
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions packages/mui-material/src/FormGroup/FormGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import composeClasses from '@mui/utils/composeClasses';
import styled from '../styles/styled';
import useThemeProps from '../styles/useThemeProps';
import { styled, createUseThemeProps } from '../zero-styled';
import { getFormGroupUtilityClass } from './formGroupClasses';
import useFormControl from '../FormControl/useFormControl';
import formControlState from '../FormControl/formControlState';

const useThemeProps = createUseThemeProps('MuiFormGroup');

const useUtilityClasses = (ownerState) => {
const { classes, row, error } = ownerState;

Expand All @@ -27,14 +28,19 @@ const FormGroupRoot = styled('div', {

return [styles.root, ownerState.row && styles.row];
},
})(({ ownerState }) => ({
})({
display: 'flex',
flexDirection: 'column',
flexWrap: 'wrap',
...(ownerState.row && {
flexDirection: 'row',
}),
}));
variants: [
{
props: { row: true },
style: {
flexDirection: 'row',
},
},
],
});

/**
* `FormGroup` wraps controls such as `Checkbox` and `Switch`.
Expand Down

0 comments on commit cb7f534

Please sign in to comment.