UNPKG

@atlaskit/editor-plugin-mentions

Version:

Mentions plugin for @atlaskit/editor-core

43 lines (42 loc) 1.5 kB
import React from 'react'; import type { PropsWithChildren } from 'react'; import type { PopperChildrenProps, Placement } from '@atlaskit/popper/main'; interface Props { /** * Returns the element to be positioned. */ children: React.ReactNode; /** * When true, the popup does not trap focus. */ disableFocusTrap?: boolean; /** * Popper offset. Defaults to `[0, 8]`. */ offset?: [number, number]; /** * Where to place the popup relative to the reference element. * Defaults to `bottom-end`. */ placement?: Placement; /** * Replacement reference element to position popper relative to. */ referenceElement: HTMLElement; } export declare const RepositionOnUpdate: ({ children, update, }: PropsWithChildren<{ update: PopperChildrenProps['update']; }>) => React.ReactNode; /** * A popup wrapper to match the behaviour of `@atlaskit/popup` * * Why not `@atlaskit/popup` directly? It requires a trigger element. * We can use this when we have a direct reference to the element * and it is more convenient to work directly with the lower level API. * * @param referenceElement HTMLElement - Replacement reference element to position popper relative to. * @param children React.ReactNode - Returns the element to be positioned. * @returns React popper component */ export declare function Popup({ referenceElement, children, placement, offset, disableFocusTrap, }: Props): React.JSX.Element; export {};