import type * as React from 'react'; import type { BaseDefaultProps, Substitute, NoInfer } from './base'; import type { SxProp } from './sx'; export type PolymorphicComponentProps< BaseProps extends object, AsTarget extends React.ElementType | undefined, AsTargetProps extends object = AsTarget extends React.ElementType ? React.ComponentPropsWithRef : React.HTMLAttributes, > = NoInfer, 'as' | 'component'>> & { /** * The component used for the root node. * Either a string to use a HTML element or a component. * Replacement for the emotion's `as` prop. */ as?: AsTarget; /** * The component used for the root node. * Either a string to use a HTML element or a component. */ component?: AsTarget; /** * The style extension prop that allows defining system overrides as well as additional CSS styles. */ sx?: SxProp; /** * The content of the component. */ children?: React.ReactNode; }; export interface PolymorphicComponent extends React.ForwardRefExoticComponent { ( props: PolymorphicComponentProps, ): React.JSX.Element; } declare const Box: PolymorphicComponent>; export default Box;