import { type CSSProperties, type ElementType } from 'react'; import type { Align, PolymorphicProps, Side } from '@/types'; /** * Context shape required by arrow components. * Both root and content contexts must expose these values. */ export interface ArrowRootContext { arrowRef: React.RefObject; } export interface ArrowContentContext { arrowStyles: CSSProperties; side: Side; align: Align; } /** * Shared polymorphic props type for all floating arrow components. */ export type FloatingArrowProps = PolymorphicProps<'svg', T>; interface CreateArrowComponentOptions { displayName: string; useRootContext: () => ArrowRootContext; useContentContext: () => ArrowContentContext; } /** * Factory that creates a headless, polymorphic arrow component. * * Eliminates duplication across Popover, Select, Tooltip, and DropdownMenu * arrow implementations. Each component only needs to supply its own context * hooks; all rendering logic is shared. * * When the default `svg` element is used, sensible SVG defaults (viewBox, * width, height, polygon) are applied. When rendered as another element via * the `as` prop, SVG-specific attributes are omitted. */ export declare const createArrowComponent: ({ displayName, useRootContext, useContentContext, }: CreateArrowComponentOptions) => { ({ as, ref, style, children, ...props }: FloatingArrowProps): import("react/jsx-runtime").JSX.Element; displayName: string; }; export {};