import { type ComponentPropsWithRef, type ComponentPropsWithoutRef, type ElementType, type PropsWithChildren, type ReactElement } from 'react'; import { type ElementStylesProps } from '../../../styles/elementStyles'; import type { Sprinkles } from '../../../styles/sprinkles.css'; import type { ConsistentComponentProps } from '../../../types'; export type BoxStylesProps = AsPolyProp & Pick & Sprinkles; export type BoxStylesReturn

= [string, P]; /** Extract the ref type for a polymorphic component based on the provided element type */ export type PolymorphicRef = ComponentPropsWithRef['ref']; /** `as` prop for polymorphic components, allowing specification of the rendered element type */ export type AsPolyProp = { as?: C | ReactElement; }; /** `ref` prop for polymorphic components, using the extracted `PolymorphicRef` type */ export type RefPolyProp = { ref?: PolymorphicRef; }; /** Helps to omit base component's props when creating polymorphic props */ export type PropsToOmit = keyof (AsPolyProp & P); /** * Constructs the props type for a polymorphic component. * It combines base props (`Props`), the `as` prop, and the `ref` prop, * while omitting conflicting keys from the base element's intrinsic props. */ export type PolymorphicComponentProps = PropsWithChildren & RefPolyProp> & Omit, PropsToOmit>; /** Polymorphic box props that merge sprinkles style props and the HTML element props */ export type UseBoxProps = PolymorphicComponentProps; /** * Define custom props similar to Box with polymorphic, common and style props. * Component props will take take precedent over style props and can overwrite them */ export type BoxLikeProps = PolymorphicComponentProps & ConsistentComponentProps & P>; /** * The Overdrive component primitive to expose a flexible HTML element as a fully typesafe React component * that provides intrinsic props as well as style props from vanilla-extract sprinkles. * * The return value must be checked for `reactElement` being defined. * * @returns `{ Component, reactElement, componentProps, SemanticChild }` where `reactElement` is only defined * if JSX was passed in the `as` prop and `cloneElement` will need to be used. `SemanticChild` is only defined * depending on the HTML tag. */ export declare const usePolymorphicBox: ({ as: _as, className: _className, odComponent, testId, ...props }: UseBoxProps) => { Component: ElementType; componentProps: ComponentPropsWithRef; reactElement: ReactElement> | undefined; SemanticChild: ElementType | undefined; }; //# sourceMappingURL=usePolymorphicBox.d.ts.map