UNPKG

@veracity/vui

Version:

Veracity UI is a React component library crafted for use within Veracity applications and pages. Based on Styled Components and @xstyled.

33 lines (32 loc) 1.46 kB
import { AnyString } from "../utils/types.js"; import "../utils/index.js"; import { Placement as Placement$1 } from "@floating-ui/react"; //#region src/popover/usePopover.types.d.ts type PopoverTrigger = 'click' | 'focus' | 'focusin' | 'manual' | 'mouseenter'; type UsePopoverProps = { /** Content closes when clicking the trigger or anywhere outside. @default true */ closeOnBlur?: boolean; /** Content closes when pressing 'Escape'. @default true */ closeOnEsc?: boolean; /** Content is opened on first render. Uncontrolled mode. */ defaultIsOpen?: boolean; /** Content placement could be changed to the opposite depending on available space. */ flip?: boolean; /** Content is opened/closed by the consumer. Controlled mode. */ isOpen?: boolean; /** Sets the content element width to be the same as trigger element. */ matchWidth?: boolean; /** Displaces content from the trigger in pixels. [skidding, distance] */ offset?: [number, number]; /** Invoked once content is fully hidden. */ onClose?: () => void; /** Invoked once content begins to show. */ onOpen?: () => void; /** Preferred placement of the content. Might be flipped if needs more space. */ placement?: Placement$1; /** Determines the events that cause the content to show. */ trigger?: PopoverTrigger | AnyString; }; //#endregion export { type Placement$1 as Placement, PopoverTrigger, UsePopoverProps }; //# sourceMappingURL=usePopover.types.d.ts.map