import { isUndefined, noop } from "lodash"; import React from "react"; import classNames from "classnames"; type DropdownContentsProps = { /** Label for the dropdown contents for screen readers */ ariaLabel?: string; /** Whether contents can scroll */ canScroll?: boolean; /** Children of the element. */ children?: any; /** CSS class names. */ className?: string; /** Direction of contents */ direction?: "left" | "right" | "up"; /* Defines Maximum container height */ maxHeight?: string | number; /** Whether or not the dropdown is in a loading state. */ isLoading?: boolean; /** Whether to wrap contents or not */ isNoWrap?: boolean; /** Minimum width of contents */ minWidth?: string | number; /** Optional render function to display a header before the list. */ renderHeader?: (...args: any[]) => any; /** Test section for element */ testSection?: string; }; export const DropdownContents: React.SFC = React.forwardRef( ({ ariaLabel, canScroll, children, className, direction, maxHeight, isLoading, isNoWrap, minWidth, renderHeader = noop, testSection, ...props }: DropdownContentsProps, ref?: React.Ref) => { const styleProps: React.CSSProperties = {}; if (!isUndefined(isLoading)) { // Supports loading spinner over