import React from 'react'; type Override = Omit & U; type Override2 = Override, V>; type BoxDefault< Default extends React.ElementType = 'div', ExtraProps = {}, > = Override2< React.ComponentPropsWithRef, { as?: never; href?: never; }, ExtraProps >; type BoxAnchorDefault = Override2< React.ComponentPropsWithRef<'a'>, { as?: never; href: string; }, ExtraProps >; type BoxIntrinsic< TElement extends keyof JSX.IntrinsicElements = keyof JSX.IntrinsicElements, ExtraProps = {}, > = Override2< React.ComponentPropsWithRef, { /** * The component or HTML Element that the button is rendered as. * * @type HTML Element | React.Component */ as: TElement; }, ExtraProps >; type BoxComponent = Override2< React.PropsWithRef, { /** * The component or HTML Element that the button is rendered as. */ as: React.ComponentType>; }, ExtraProps >; /** * A flexible polymorphic type for the Box component, which allows various implementations: * - Default anchor element * - Any intrinsic JSX element * - Custom React component * - Default element type * * @deprecated Prefer using Polymorphic types from `@leafygreen-ui/polymorphic` package. * @typeParam Default - The default React element type to render, defaults to 'div' * @typeParam ExtraProps - Additional props to extend the component with */ export type BoxProps< Default extends React.ElementType = 'div', ExtraProps = {}, > = | BoxAnchorDefault | BoxIntrinsic | BoxComponent<{}, ExtraProps> | BoxDefault; function InlineBox(props: BoxDefault, ref: React.Ref): JSX.Element; function InlineBox(props: BoxAnchorDefault, ref: React.Ref): JSX.Element; function InlineBox( props: BoxIntrinsic, ref: React.Ref, ): JSX.Element; function InlineBox( props: BoxComponent, ref: React.Ref, ): JSX.Element; function InlineBox(props: BoxProps, ref: React.Ref) { if (props.as != null) { const { as: Component, ...rest } = props; // @ts-expect-error return ; } if (props.href != null) { return ; //eslint-disable-line jsx-a11y/anchor-has-content } return