UNPKG

apphouse

Version:

Component library for React that uses observable state management and theme-able components.

48 lines (47 loc) 1.37 kB
import { CSSProperties } from 'react'; import { ButtonStyles } from '../Button'; import { StyleOverwrites } from '../component.interfaces'; import React from 'react'; export interface TogglePopupButtonStyles { button?: ButtonStyles; popupWrapper?: CSSProperties; } export interface TogglePopupButtonProps extends StyleOverwrites<TogglePopupButtonStyles> { /** * Hint for the trigger button */ hint?: string; /** * @default hintLeft */ hintDirection?: CSSProperties; /** * Content to go inside the button that will trigger the popup * usually text or icon, note that this will be put inside a button * so don't pass in a button here */ trigger: React.ReactNode; /** * Popup content */ popup: React.ReactNode; /** * callback for when the toggle button gets click * @param isShowing boolean indicating if the popup is showing or not */ onToggle: (isShowing: boolean) => void; /** * If true, the popup will be removed from the DOM when the user scrolls * 'TODO: implement this' * @default false */ removeOnScroll?: boolean; /** * Force the popup to show and hide * /TODO * @default false * @optional */ showPopup?: boolean; } export declare const ButtonTogglePopup: React.FC<TogglePopupButtonProps>;