index.d.mts 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import * as React from "react";
  2. import * as ArrowPrimitive from "@radix-ui/react-arrow";
  3. import * as Radix from "@radix-ui/react-primitive";
  4. import { Primitive } from "@radix-ui/react-primitive";
  5. import { Measurable } from "@radix-ui/rect";
  6. export const SIDE_OPTIONS: readonly ["top", "right", "bottom", "left"];
  7. export const ALIGN_OPTIONS: readonly ["start", "center", "end"];
  8. type Side = typeof SIDE_OPTIONS[number];
  9. type Align = typeof ALIGN_OPTIONS[number];
  10. export const createPopperScope: import("@radix-ui/react-context").CreateScope;
  11. export interface PopperProps {
  12. children?: React.ReactNode;
  13. }
  14. export const Popper: React.FC<PopperProps>;
  15. type PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;
  16. export interface PopperAnchorProps extends PrimitiveDivProps {
  17. virtualRef?: React.RefObject<Measurable>;
  18. }
  19. export const PopperAnchor: React.ForwardRefExoticComponent<PopperAnchorProps & React.RefAttributes<HTMLDivElement>>;
  20. type Boundary = Element | null;
  21. export interface PopperContentProps extends PrimitiveDivProps {
  22. side?: Side;
  23. sideOffset?: number;
  24. align?: Align;
  25. alignOffset?: number;
  26. arrowPadding?: number;
  27. avoidCollisions?: boolean;
  28. collisionBoundary?: Boundary | Boundary[];
  29. collisionPadding?: number | Partial<Record<Side, number>>;
  30. sticky?: 'partial' | 'always';
  31. hideWhenDetached?: boolean;
  32. updatePositionStrategy?: 'optimized' | 'always';
  33. onPlaced?: () => void;
  34. }
  35. export const PopperContent: React.ForwardRefExoticComponent<PopperContentProps & React.RefAttributes<HTMLDivElement>>;
  36. type ArrowProps = Radix.ComponentPropsWithoutRef<typeof ArrowPrimitive.Root>;
  37. export interface PopperArrowProps extends ArrowProps {
  38. }
  39. export const PopperArrow: React.ForwardRefExoticComponent<PopperArrowProps & React.RefAttributes<SVGSVGElement>>;
  40. export const Root: React.FC<PopperProps>;
  41. export const Anchor: React.ForwardRefExoticComponent<PopperAnchorProps & React.RefAttributes<HTMLDivElement>>;
  42. export const Content: React.ForwardRefExoticComponent<PopperContentProps & React.RefAttributes<HTMLDivElement>>;
  43. export const Arrow: React.ForwardRefExoticComponent<PopperArrowProps & React.RefAttributes<SVGSVGElement>>;
  44. //# sourceMappingURL=index.d.ts.map