diff --git a/packages/components/src/input-control/input-base.tsx b/packages/components/src/input-control/input-base.tsx index adcc1cbd5be81..9151ae14c78f8 100644 --- a/packages/components/src/input-control/input-base.tsx +++ b/packages/components/src/input-control/input-base.tsx @@ -22,7 +22,6 @@ import { LabelWrapper, } from './styles/input-control-styles'; import type { InputBaseProps, LabelPosition } from './types'; -import type { FlexProps } from '../flex/types'; function useUniqueId( idProp?: string ) { const instanceId = useInstanceId( InputBase ); @@ -66,7 +65,7 @@ export function InputBase( size = 'default', suffix, ...props - }: InputBaseProps & FlexProps, + }: InputBaseProps, ref: ForwardedRef< HTMLDivElement > ) { const id = useUniqueId( idProp ); diff --git a/packages/components/src/input-control/types.ts b/packages/components/src/input-control/types.ts index 0daf9a4cf857e..7067f79453767 100644 --- a/packages/components/src/input-control/types.ts +++ b/packages/components/src/input-control/types.ts @@ -16,6 +16,7 @@ import type { useDrag } from '@use-gesture/react'; */ import type { StateReducer } from './reducer/state'; import type { WordPressComponentProps } from '../ui/context'; +import type { FlexProps } from '../flex/types'; export type LabelPosition = 'top' | 'bottom' | 'side' | 'edge'; @@ -105,7 +106,7 @@ export interface InputFieldProps extends BaseProps { type?: HTMLInputTypeAttribute; } -export interface InputBaseProps extends BaseProps { +export interface InputBaseProps extends BaseProps, FlexProps { children: ReactNode; /** * Renders an element on the left side of the input. @@ -130,7 +131,7 @@ export interface InputBaseProps extends BaseProps { } export interface InputControlProps - extends Omit< InputBaseProps, 'children' | 'isFocused' >, + extends Omit< InputBaseProps, 'children' | 'isFocused' | keyof FlexProps >, /** * The `prefix` prop in `WordPressComponentProps< InputFieldProps, 'input', false >` comes from the * `HTMLInputAttributes` and clashes with the one from `InputBaseProps`. So we have to omit it from