import React from 'react'; import { ClickOutsideHandler } from '../../hooks/useClickOutside/useClickOutside'; import { PropsWithJsxAttributes } from '../../utils/types/PropsWithJsxAttributes'; import { usePopoverReposition } from './usePopoverReposition'; export { usePopoverReposition }; /** * Стороны упорядочены по приоритету: * Используется первая сторона, в которую смог вписаться поповер. */ export declare const directionsStartCenter: readonly ["downCenter", "upCenter", "downRight", "downLeft", "upRight", "upLeft", "leftUp", "leftCenter", "leftDown", "rightUp", "rightCenter", "rightDown"]; export declare const directionsStartEdge: readonly ["downStartLeft", "upStartLeft", "downStartRight", "upStartRight", "leftStartUp", "leftStartDown", "rightStartUp", "rightStartDown"]; export declare const popoverPropOffset: readonly ["3xs", "2xs", "xs", "s", "m", "l", "xl", "2xl", "3xl", "4xl", "5xl", "6xl"]; export declare type PopoverPropOffset = typeof popoverPropOffset[number] | number; export declare const directions: ("downCenter" | "upCenter" | "downRight" | "downLeft" | "upRight" | "upLeft" | "leftUp" | "leftCenter" | "leftDown" | "rightUp" | "rightCenter" | "rightDown" | "downStartLeft" | "upStartLeft" | "downStartRight" | "upStartRight" | "leftStartUp" | "leftStartDown" | "rightStartUp" | "rightStartDown")[]; export declare type Direction = typeof directions[number]; export declare type DirectionsStartEdge = typeof directionsStartEdge[number]; export declare type Position = { x: number; y: number; } | undefined; export declare type PositioningProps = { anchorRef: React.RefObject; equalAnchorWidth?: boolean; position?: never; } | { anchorRef?: never; equalAnchorWidth?: never; position: Position; }; declare type ChildrenRenderProp = (direction: Direction) => React.ReactNode; export declare type Props = PropsWithJsxAttributes<{ direction?: Direction; spareDirection?: Direction; offset?: PopoverPropOffset; arrowOffset?: number; possibleDirections?: readonly Direction[]; isInteractive?: boolean; children: React.ReactNode | ChildrenRenderProp; onClickOutside?: ClickOutsideHandler; onSetDirection?: (direction: Direction) => void; } & PositioningProps>; export declare const Popover: React.ForwardRefExoticComponent & React.RefAttributes>;