UNPKG

1.67 kBTypeScriptView Raw
1/// <reference types="react" />
2import type { DefaultPopover2TargetHTMLProps, Popover2, Popover2Props } from "@blueprintjs/popover2";
3/**
4 * Reusable collection of props for components in this package which render a `Popover2`
5 * and need to provide some degree of customization for that popover.
6 */
7export interface SelectPopoverProps {
8 /**
9 * HTML attributes to spread to the popover content container element.
10 */
11 popoverContentProps?: React.HTMLAttributes<HTMLDivElement>;
12 /**
13 * Props to spread to Popover2.
14 *
15 * Note that `content` cannot be changed, but you may apply some props to the content wrapper element
16 * with `popoverContentProps`. Likewise, `targetProps` is no longer supported as it was in Blueprint v4, but you
17 * may use `popoverTargetProps` instead.
18 *
19 * N.B. `disabled` is supported here, as this can be distinct from disabling the entire select button / input
20 * control element. There are some cases where we only want to disable the popover interaction.
21 */
22 popoverProps?: Partial<Omit<Popover2Props, "content" | "defaultIsOpen" | "fill" | "renderTarget">>;
23 /**
24 * Optional ref for the Popover2 component instance.
25 * This is sometimes useful to reposition the popover.
26 *
27 * Note that this is defined as a specific kind of Popover2 which should be compatible with
28 * most use cases, since it uses the default target props interface.
29 */
30 popoverRef?: React.RefObject<Popover2<DefaultPopover2TargetHTMLProps>>;
31 /**
32 * HTML attributes to add to the popover target element.
33 */
34 popoverTargetProps?: React.HTMLAttributes<HTMLElement>;
35}