@@ -11,7 +11,6 @@ import Textarea from '../Textarea'
11
11
import { CheckboxOrRadioGroupContext } from '../internal/components/CheckboxOrRadioGroup'
12
12
import ValidationAnimationContainer from '../internal/components/ValidationAnimationContainer'
13
13
import { useSlots } from '../hooks/useSlots'
14
- import type { SxProp } from '../sx'
15
14
import { useId } from '../hooks/useId'
16
15
import { FormControlCaption } from './FormControlCaption'
17
16
import FormControlLabel from './FormControlLabel'
@@ -20,7 +19,6 @@ import FormControlValidation from './_FormControlValidation'
20
19
import { FormControlContextProvider } from './_FormControlContext'
21
20
import { warning } from '../utils/warning'
22
21
import classes from './FormControl.module.css'
23
- import { BoxWithFallback } from '../internal/components/BoxWithFallback'
24
22
25
23
export type FormControlProps = {
26
24
children ?: React . ReactNode
@@ -42,10 +40,10 @@ export type FormControlProps = {
42
40
*/
43
41
layout ?: 'horizontal' | 'vertical'
44
42
className ?: string
45
- } & SxProp
43
+ }
46
44
47
45
const FormControl = React . forwardRef < HTMLDivElement , FormControlProps > (
48
- ( { children, disabled : disabledProp , layout = 'vertical' , id : idProp , required, sx , className} , ref ) => {
46
+ ( { children, disabled : disabledProp , layout = 'vertical' , id : idProp , required, className} , ref ) => {
49
47
const [ slots , childrenWithoutSlots ] = useSlots ( children , {
50
48
caption : FormControlCaption ,
51
49
label : FormControlLabel ,
@@ -168,19 +166,17 @@ const FormControl = React.forwardRef<HTMLDivElement, FormControlProps>(
168
166
} }
169
167
>
170
168
{ isChoiceInput || layout === 'horizontal' ? (
171
- < BoxWithFallback
169
+ < div
172
170
ref = { ref }
173
171
data-has-leading-visual = { slots . leadingVisual ? '' : undefined }
174
- sx = { sx }
175
172
className = { clsx ( className , classes . ControlHorizontalLayout ) }
176
173
>
177
174
{ InputChildren }
178
- </ BoxWithFallback >
175
+ </ div >
179
176
) : (
180
- < BoxWithFallback
177
+ < div
181
178
ref = { ref }
182
179
data-has-label = { ! isLabelHidden ? '' : undefined }
183
- sx = { sx }
184
180
className = { clsx ( className , classes . ControlVerticalLayout ) }
185
181
>
186
182
{ slots . label }
@@ -207,7 +203,7 @@ const FormControl = React.forwardRef<HTMLDivElement, FormControlProps>(
207
203
< ValidationAnimationContainer show > { slots . validation } </ ValidationAnimationContainer >
208
204
) : null }
209
205
{ slots . caption }
210
- </ BoxWithFallback >
206
+ </ div >
211
207
) }
212
208
</ FormControlContextProvider >
213
209
)
0 commit comments