import { ExtendComponent, Factory } from '../../core'; import { PopoverProps, PopoverStylesNames } from '../Popover'; import { PopoverCssVariables } from '../Popover/Popover'; import { HoverCardContextValue } from './HoverCard.context'; import { HoverCardDropdown, HoverCardDropdownProps } from './HoverCardDropdown/HoverCardDropdown'; import { HoverCardGroup, HoverCardGroupContextValue, HoverCardGroupProps } from './HoverCardGroup/HoverCardGroup'; import { HoverCardTarget, HoverCardTargetProps } from './HoverCardTarget/HoverCardTarget'; export interface HoverCardEvents { /** Determines whether the dropdown should be opened when the target is hovered @default true */ hover?: boolean; /** Determines whether the dropdown should be opened when the target is focused with the keyboard @default true */ focus?: boolean; /** Determines whether the dropdown should be opened when the target is tapped on touch devices. Requires `hover` to be enabled @default false */ touch?: boolean; } export interface HoverCardProps extends Omit { /** Initial opened state */ initiallyOpened?: boolean; /** Called when the dropdown is opened */ onOpen?: () => void; /** Called when the dropdown is closed */ onClose?: () => void; /** * Delay in ms before the dropdown opens after mouse enters the target. * Overridden by HoverCard.Group delay if used within a group. * @default 0 */ openDelay?: number; /** * Delay in ms before the dropdown closes after mouse leaves the target or dropdown. * Overridden by HoverCard.Group delay if used within a group. * @default 150 */ closeDelay?: number; /** * Determines which events open the dropdown. Fields that are not specified keep their default values. * @default { hover: true, focus: true, touch: false } */ events?: HoverCardEvents; /** * If set, the dropdown stays open while the pointer travels from the target to the dropdown * and remains over it. Set it if the dropdown contains interactive content. * @default false */ interactive?: boolean; /** * Accessible relation between the target and the dropdown. `dialog` sets `aria-haspopup`, * `aria-expanded` and `aria-controls` on the target, `tooltip` sets `aria-describedby` instead * and should be used if the dropdown contains only descriptive content. * @default 'dialog' */ role?: 'dialog' | 'tooltip'; /** Determines whether the dropdown should be closed when the user presses outside of the target and the dropdown @default true */ closeOnClickOutside?: boolean; /** Not supported by `HoverCard`: outside press is always detected with the `pointerdown` event. Use `closeOnClickOutside` to disable it. */ clickOutsideEvents?: string[]; /** * Determines whether focus should be returned to the target when the dropdown closes. * Ignored when focus activation is enabled (`events.focus`, the default), otherwise moving * focus away from the target would return it and reopen the dropdown. * `Escape` pressed inside the dropdown always returns focus to the target. * @default false */ returnFocus?: boolean; /** Called when the dropdown is closed with `Escape` key or with a press outside of the target and the dropdown */ onDismiss?: () => void; } export type HoverCardFactory = Factory<{ props: HoverCardProps; stylesNames: PopoverStylesNames; vars: PopoverCssVariables; }>; export declare function HoverCard(props: HoverCardProps): import("react").JSX.Element; export declare namespace HoverCard { var displayName: string; var Target: typeof HoverCardTarget; var Dropdown: typeof HoverCardDropdown; var Group: typeof HoverCardGroup; var extend: (input: ExtendComponent) => import("../../core/factory/factory").ExtendsRootComponent<{ props: HoverCardProps; stylesNames: PopoverStylesNames; vars: PopoverCssVariables; }>; } export declare namespace HoverCard { type Props = HoverCardProps; type Events = HoverCardEvents; type DropdownProps = HoverCardDropdownProps; type TargetProps = HoverCardTargetProps; type GroupProps = HoverCardGroupProps; type ContextValue = HoverCardContextValue; namespace Group { type Props = HoverCardGroupProps; type ContextValue = HoverCardGroupContextValue; } }