import { Offset, Placement, UsePopperOptions, UsePopperState } from "./usePopper"; import { RootCloseOptions } from "./useRootClose"; import { JSX } from "solid-js"; import { TransitionCallbacks, TransitionComponent } from "solid-react-transition"; import { DOMContainer } from "./useWaitForDOMRef"; export interface OverlayArrowProps extends Record { ref: (e: HTMLElement) => void; style: JSX.CSSProperties; } export interface OverlayMetadata { show: boolean; placement: Placement | undefined; popper: UsePopperState | null; } export interface OverlayInjectedProps extends Record { ref: (e: HTMLElement) => void; style: JSX.CSSProperties; "aria-labelledby"?: string; } export interface OverlayProps extends TransitionCallbacks { /** * Enables the Popper.js `flip` modifier, allowing the Overlay to * automatically adjust it's placement in case of overlap with the viewport or toggle. * Refer to the [flip docs](https://popper.js.org/popper-documentation.html#modifiers..flip.enabled) for more info */ flip?: boolean; /** Specify where the overlay element is positioned in relation to the target element */ placement?: Placement; /** * Control offset of the overlay to the reference element. * A convenience shortcut to setting `popperConfig.modfiers.offset` */ offset?: Offset; /** * Control how much space there is between the edge of the boundary element and overlay. * A convenience shortcut to setting `popperConfig.modfiers.preventOverflow.padding` */ containerPadding?: number; /** * A set of popper options and props passed directly to react-popper's Popper component. */ popperConfig?: Omit; /** * A DOM Element, Ref to an element, or function that returns either. The `container` will have the Portal children * appended to it. */ container?: DOMContainer; /** * A DOM Element, Ref to an element, or function that returns either. The `target` element is where * the overlay is positioned relative to. */ target: () => Element | undefined; /** * Set the visibility of the Overlay */ show?: boolean; /** * A `` component * used to animate the overlay as it changes visibility. */ transition?: TransitionComponent; /** * A Callback fired by the Overlay when it wishes to be hidden. * * __required__ when `rootClose` is `true`. * * @type func */ onHide?: (e: Event) => void; /** * Specify whether the overlay should trigger `onHide` when the user clicks outside the overlay */ rootClose?: boolean; /** * Specify disabled for disable RootCloseWrapper */ rootCloseDisabled?: boolean; /** * Specify event for toggling overlay */ rootCloseEvent?: RootCloseOptions["clickTrigger"]; /** * A render prop that returns an overlay element. */ children: (wrapperProps: () => OverlayInjectedProps, arrowProps: () => Partial, meta: () => OverlayMetadata) => JSX.Element; } /** * Built on top of `Popper.js`, the overlay component is * great for custom tooltip overlays. */ export declare const Overlay: (props: OverlayProps) => JSX.Element; export default Overlay;