@@ -47,24 +47,8 @@ const getOppositePlacement = (placement: Placement): any =>
4747export const getOpacityTransition = ( animationDuration : number ) =>
4848 `opacity ${ animationDuration } ms cubic-bezier(.54, 1.5, .38, 1.11)` ;
4949
50- export interface PopperProps {
51- /**
52- * Trigger reference element to which the popper is relatively placed to.
53- */
54- trigger ?: React . ReactNode ;
55- /**
56- * A reference to the trigger reference element that can be passed instead of or along
57- * with the trigger prop. When passed along with the trigger prop, the div element that
58- * wraps the trigger will be removed.
59- */
60- triggerRef ?: HTMLElement | ( ( ) => HTMLElement ) | React . RefObject < any > ;
61- /** The popper (menu/tooltip/popover) element */
62- popper : React . ReactElement < any > ;
63- /**
64- * Reference to the popper (menu/tooltip/popover) element.
65- * Passing this prop will remove the wrapper div element from the popper.
66- */
67- popperRef ?: HTMLElement | ( ( ) => HTMLElement ) | React . RefObject < any > ;
50+ /** Properties of Popper that can be used to customize its behavior. */
51+ export interface PopperOptions {
6852 /** popper direction */
6953 direction ?: 'up' | 'down' ;
7054 /** popper position */
@@ -81,8 +65,6 @@ export interface PopperProps {
8165 appendTo ?: HTMLElement | ( ( ) => HTMLElement ) | 'inline' ;
8266 /** z-index of the popper element */
8367 zIndex ?: number ;
84- /** True to make the popper visible */
85- isVisible ?: boolean ;
8668 /**
8769 * Map class names to positions, for example:
8870 * {
@@ -179,6 +161,29 @@ export interface PopperProps {
179161 preventOverflow ?: boolean ;
180162}
181163
164+ /** Extends PopperOptions */
165+ export interface PopperProps extends PopperOptions {
166+ /**
167+ * Trigger reference element to which the popper is relatively placed to.
168+ */
169+ trigger ?: React . ReactNode ;
170+ /**
171+ * A reference to the trigger reference element that can be passed instead of or along
172+ * with the trigger prop. When passed along with the trigger prop, the div element that
173+ * wraps the trigger will be removed.
174+ */
175+ triggerRef ?: HTMLElement | ( ( ) => HTMLElement ) | React . RefObject < any > ;
176+ /** The popper (menu/tooltip/popover) element */
177+ popper : React . ReactElement < any > ;
178+ /**
179+ * Reference to the popper (menu/tooltip/popover) element.
180+ * Passing this prop will remove the wrapper div element from the popper.
181+ */
182+ popperRef ?: HTMLElement | ( ( ) => HTMLElement ) | React . RefObject < any > ;
183+ /** True to make the popper visible */
184+ isVisible ?: boolean ;
185+ }
186+
182187export const Popper : React . FunctionComponent < PopperProps > = ( {
183188 trigger,
184189 popper,
0 commit comments