packages/react-components/react-popover/library/etc/react-popover.api.md
Do not edit this file. It is a report generated by API Extractor.
import { ARIAButtonResultProps } from '@fluentui/react-aria';
import { ARIAButtonType } from '@fluentui/react-aria';
import type { ComponentProps } from '@fluentui/react-utilities';
import type { ComponentState } from '@fluentui/react-utilities';
import type { ContextSelector } from '@fluentui/react-context-selector';
import { FC } from 'react';
import type { ForwardRefComponent } from '@fluentui/react-utilities';
import { JSXElement } from '@fluentui/react-utilities';
import type { PortalProps } from '@fluentui/react-portal';
import type { PositioningShorthand } from '@fluentui/react-positioning';
import type { PositioningVirtualElement } from '@fluentui/react-positioning';
import type { PresenceMotionSlotProps } from '@fluentui/react-motion';
import { Provider } from 'react';
import { ProviderProps } from 'react';
import * as React_2 from 'react';
import type { SetVirtualMouseTarget } from '@fluentui/react-positioning';
import type { Slot } from '@fluentui/react-utilities';
import type { SlotClassNames } from '@fluentui/react-utilities';
import type { TriggerProps } from '@fluentui/react-utilities';
// @public (undocumented)
export const arrowHeights: Record<PopoverSize, number>;
// @public
export type OnOpenChangeData = {
open: boolean;
};
// @public
export type OpenPopoverEvents = MouseEvent | TouchEvent | React_2.FocusEvent<HTMLElement> | React_2.KeyboardEvent<HTMLElement> | React_2.MouseEvent<HTMLElement>;
// @public
export const Popover: React_2.FC<PopoverProps>;
// @public
export type PopoverContextValue = Pick<PopoverState, 'open' | 'toggleOpen' | 'setOpen' | 'triggerRef' | 'contentRef' | 'openOnHover' | 'openOnContext' | 'mountNode' | 'withArrow' | 'arrowRef' | 'size' | 'appearance' | 'trapFocus' | 'inertTrapFocus' | 'inline'>;
// @public
export type PopoverProps = ComponentProps<Partial<PopoverSlots>> & Pick<PortalProps, 'mountNode'> & {
appearance?: 'brand' | 'inverted';
children: [JSXElement, JSXElement] | JSXElement;
closeOnScroll?: boolean;
defaultOpen?: boolean;
inline?: boolean;
mouseLeaveDelay?: number;
withArrow?: boolean;
onOpenChange?: (e: OpenPopoverEvents, data: OnOpenChangeData) => void;
open?: boolean;
openOnContext?: boolean;
openOnHover?: boolean;
closeOnIframeFocus?: boolean;
positioning?: PositioningShorthand;
size?: PopoverSize;
trapFocus?: boolean;
legacyTrapFocus?: boolean;
inertTrapFocus?: boolean;
unstable_disableAutoFocus?: boolean;
};
// @public (undocumented)
export const PopoverProvider: Provider<PopoverContextValue> & FC<ProviderProps<PopoverContextValue>>;
// @public
export type PopoverSize = 'small' | 'medium' | 'large';
// @public
export type PopoverState = ComponentState<InternalPopoverSlots> & Pick<PopoverProps, 'appearance' | 'mountNode' | 'onOpenChange' | 'openOnContext' | 'openOnHover' | 'trapFocus' | 'withArrow' | 'inertTrapFocus'> & Required<Pick<PopoverProps, 'inline' | 'open'>> & Pick<PopoverProps, 'children'> & {
arrowRef: React_2.MutableRefObject<HTMLDivElement | null>;
contentRef: React_2.MutableRefObject<HTMLElement | null>;
contextTarget: PositioningVirtualElement | undefined;
popoverSurface: React_2.ReactElement | undefined;
popoverTrigger: React_2.ReactElement | undefined;
setContextTarget: SetVirtualMouseTarget;
setOpen: (e: OpenPopoverEvents, open: boolean) => void;
size: NonNullable<PopoverProps['size']>;
toggleOpen: (e: OpenPopoverEvents) => void;
triggerRef: React_2.MutableRefObject<HTMLElement | null>;
};
// @public
export const PopoverSurface: ForwardRefComponent<PopoverSurfaceProps>;
// @public (undocumented)
export const popoverSurfaceClassNames: SlotClassNames<PopoverSurfaceSlots>;
// @public
export type PopoverSurfaceProps = ComponentProps<PopoverSurfaceSlots>;
// @public
export type PopoverSurfaceSlots = {
root: Slot<'div'>;
};
// @public
export type PopoverSurfaceState = ComponentState<PopoverSurfaceSlots> & Pick<PopoverContextValue, 'appearance' | 'arrowRef' | 'inline' | 'mountNode' | 'size' | 'withArrow'> & {
arrowClassName?: string;
};
// @public
export const PopoverTrigger: React_2.FC<PopoverTriggerProps>;
// @public
export type PopoverTriggerChildProps<Type extends ARIAButtonType = ARIAButtonType, Props = {}> = ARIAButtonResultProps<Type, Props & {
'aria-expanded'?: 'true' | 'false';
ref: React_2.Ref<unknown>;
onMouseEnter: React_2.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>;
onMouseLeave: React_2.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>;
onContextMenu: React_2.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>;
}>;
// @public
export type PopoverTriggerProps = TriggerProps<PopoverTriggerChildProps> & {
disableButtonEnhancement?: boolean;
};
// @public
export type PopoverTriggerState = {
children: React_2.ReactElement | null;
};
// @public
export const renderPopover_unstable: (state: PopoverState) => JSXElement;
// @public
export const renderPopoverSurface_unstable: (state: PopoverSurfaceState) => JSXElement;
// @public
export const renderPopoverTrigger_unstable: (state: PopoverTriggerState) => JSXElement | null;
// @public
export const usePopover_unstable: (props: PopoverProps) => PopoverState;
// @public (undocumented)
export const usePopoverContext_unstable: <T>(selector: ContextSelector<PopoverContextValue, T>) => T;
// @public
export const usePopoverSurface_unstable: (props: PopoverSurfaceProps, ref: React_2.Ref<HTMLDivElement>) => PopoverSurfaceState;
// @public
export const usePopoverSurfaceStyles_unstable: (state: PopoverSurfaceState) => PopoverSurfaceState;
// @public
export const usePopoverTrigger_unstable: (props: PopoverTriggerProps) => PopoverTriggerState;
// (No @packageDocumentation comment for this package)