index.d.ts 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import * as React from "react";
  2. import * as PopperPrimitive from "@radix-ui/react-popper";
  3. import { Portal as _Portal1 } from "@radix-ui/react-portal";
  4. import * as Radix from "@radix-ui/react-primitive";
  5. import { Primitive } from "@radix-ui/react-primitive";
  6. import { DismissableLayer } from "@radix-ui/react-dismissable-layer";
  7. export const createHoverCardScope: import("@radix-ui/react-context").CreateScope;
  8. export interface HoverCardProps {
  9. children?: React.ReactNode;
  10. open?: boolean;
  11. defaultOpen?: boolean;
  12. onOpenChange?: (open: boolean) => void;
  13. openDelay?: number;
  14. closeDelay?: number;
  15. }
  16. export const HoverCard: React.FC<HoverCardProps>;
  17. type PrimitiveLinkProps = Radix.ComponentPropsWithoutRef<typeof Primitive.a>;
  18. export interface HoverCardTriggerProps extends PrimitiveLinkProps {
  19. }
  20. export const HoverCardTrigger: React.ForwardRefExoticComponent<HoverCardTriggerProps & React.RefAttributes<HTMLAnchorElement>>;
  21. type PortalProps = React.ComponentPropsWithoutRef<typeof _Portal1>;
  22. export interface HoverCardPortalProps {
  23. children?: React.ReactNode;
  24. /**
  25. * Specify a container element to portal the content into.
  26. */
  27. container?: PortalProps['container'];
  28. /**
  29. * Used to force mounting when more control is needed. Useful when
  30. * controlling animation with React animation libraries.
  31. */
  32. forceMount?: true;
  33. }
  34. export const HoverCardPortal: React.FC<HoverCardPortalProps>;
  35. export interface HoverCardContentProps extends HoverCardContentImplProps {
  36. /**
  37. * Used to force mounting when more control is needed. Useful when
  38. * controlling animation with React animation libraries.
  39. */
  40. forceMount?: true;
  41. }
  42. export const HoverCardContent: React.ForwardRefExoticComponent<HoverCardContentProps & React.RefAttributes<HTMLDivElement>>;
  43. type DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;
  44. type PopperContentProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;
  45. interface HoverCardContentImplProps extends Omit<PopperContentProps, 'onPlaced'> {
  46. /**
  47. * Event handler called when the escape key is down.
  48. * Can be prevented.
  49. */
  50. onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown'];
  51. /**
  52. * Event handler called when the a `pointerdown` event happens outside of the `HoverCard`.
  53. * Can be prevented.
  54. */
  55. onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside'];
  56. /**
  57. * Event handler called when the focus moves outside of the `HoverCard`.
  58. * Can be prevented.
  59. */
  60. onFocusOutside?: DismissableLayerProps['onFocusOutside'];
  61. /**
  62. * Event handler called when an interaction happens outside the `HoverCard`.
  63. * Specifically, when a `pointerdown` event happens outside or focus moves outside of it.
  64. * Can be prevented.
  65. */
  66. onInteractOutside?: DismissableLayerProps['onInteractOutside'];
  67. }
  68. type PopperArrowProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;
  69. export interface HoverCardArrowProps extends PopperArrowProps {
  70. }
  71. export const HoverCardArrow: React.ForwardRefExoticComponent<HoverCardArrowProps & React.RefAttributes<SVGSVGElement>>;
  72. export const Root: React.FC<HoverCardProps>;
  73. export const Trigger: React.ForwardRefExoticComponent<HoverCardTriggerProps & React.RefAttributes<HTMLAnchorElement>>;
  74. export const Portal: React.FC<HoverCardPortalProps>;
  75. export const Content: React.ForwardRefExoticComponent<HoverCardContentProps & React.RefAttributes<HTMLDivElement>>;
  76. export const Arrow: React.ForwardRefExoticComponent<HoverCardArrowProps & React.RefAttributes<SVGSVGElement>>;
  77. //# sourceMappingURL=index.d.ts.map