@@ -11,7 +11,6 @@ import Textarea from '../Textarea'
1111import { CheckboxOrRadioGroupContext } from '../internal/components/CheckboxOrRadioGroup'
1212import ValidationAnimationContainer from '../internal/components/ValidationAnimationContainer'
1313import { useSlots } from '../hooks/useSlots'
14- import type { SxProp } from '../sx'
1514import { useId } from '../hooks/useId'
1615import { FormControlCaption } from './FormControlCaption'
1716import FormControlLabel from './FormControlLabel'
@@ -20,7 +19,6 @@ import FormControlValidation from './_FormControlValidation'
2019import { FormControlContextProvider } from './_FormControlContext'
2120import { warning } from '../utils/warning'
2221import classes from './FormControl.module.css'
23- import { BoxWithFallback } from '../internal/components/BoxWithFallback'
2422import { isSlot } from '../utils/is-slot'
2523
2624export type FormControlProps = {
@@ -44,10 +42,10 @@ export type FormControlProps = {
4442 layout ?: 'horizontal' | 'vertical'
4543 className ?: string
4644 style ?: React . CSSProperties
47- } & SxProp
45+ }
4846
4947const FormControl = React . forwardRef < HTMLDivElement , FormControlProps > (
50- ( { children, disabled : disabledProp , layout = 'vertical' , id : idProp , required, sx , className, style} , ref ) => {
48+ ( { children, disabled : disabledProp , layout = 'vertical' , id : idProp , required, className, style} , ref ) => {
5149 const [ slots , childrenWithoutSlots ] = useSlots ( children , {
5250 caption : FormControlCaption ,
5351 label : FormControlLabel ,
@@ -179,20 +177,18 @@ const FormControl = React.forwardRef<HTMLDivElement, FormControlProps>(
179177 } }
180178 >
181179 { isChoiceInput || layout === 'horizontal' ? (
182- < BoxWithFallback
180+ < div
183181 ref = { ref }
184182 data-has-leading-visual = { slots . leadingVisual ? '' : undefined }
185- sx = { sx }
186183 className = { clsx ( className , classes . ControlHorizontalLayout ) }
187184 style = { style }
188185 >
189186 { InputChildren }
190- </ BoxWithFallback >
187+ </ div >
191188 ) : (
192- < BoxWithFallback
189+ < div
193190 ref = { ref }
194191 data-has-label = { ! isLabelHidden ? '' : undefined }
195- sx = { sx }
196192 className = { clsx ( className , classes . ControlVerticalLayout ) }
197193 style = { style }
198194 >
@@ -222,7 +218,7 @@ const FormControl = React.forwardRef<HTMLDivElement, FormControlProps>(
222218 < ValidationAnimationContainer show > { slots . validation } </ ValidationAnimationContainer >
223219 ) : null }
224220 { slots . caption }
225- </ BoxWithFallback >
221+ </ div >
226222 ) }
227223 </ FormControlContextProvider >
228224 )
0 commit comments