/** @jsx jsx */ import { ReactElement, ReactNode, Ref } from 'react'; import { jsx } from '@emotion/react'; import { MenuPlacement, MenuPosition, CommonProps, GroupBase, CommonPropsAndClassName, CoercedMenuPlacement, CSSObjectWithLabel } from '../types'; interface CalculatedMenuPlacementAndHeight { placement: CoercedMenuPlacement; maxHeight: number; } interface PlacementArgs { maxHeight: number; menuEl: HTMLDivElement | null; minHeight: number; placement: MenuPlacement; shouldScroll: boolean; isFixedPosition: boolean; controlHeight: number; } export declare function getMenuPlacement({ maxHeight: preferredMaxHeight, menuEl, minHeight, placement: preferredPlacement, shouldScroll, isFixedPosition, controlHeight, }: PlacementArgs): CalculatedMenuPlacementAndHeight; export interface MenuPlacementProps { /** Set the minimum height of the menu. */ minMenuHeight: number; /** Set the maximum height of the menu. */ maxMenuHeight: number; /** Set whether the menu should be at the top, at the bottom. The auto options sets it to bottom. */ menuPlacement: MenuPlacement; /** The CSS position value of the menu, when "fixed" extra layout management is required */ menuPosition: MenuPosition; /** Set whether the page should scroll to show the menu. */ menuShouldScrollIntoView: boolean; } export interface MenuProps = GroupBase> extends CommonPropsAndClassName, MenuPlacementProps { /** Reference to the internal element, consumed by the MenuPlacer component */ innerRef: Ref; innerProps: JSX.IntrinsicElements['div']; isLoading: boolean; placement: CoercedMenuPlacement; /** The children to be rendered. */ children: ReactNode; } interface PlacerProps { placement: CoercedMenuPlacement; maxHeight: number; } interface ChildrenProps { ref: Ref; placerProps: PlacerProps; } export interface MenuPlacerProps> extends CommonProps, MenuPlacementProps { /** The children to be rendered. */ children: (childrenProps: ChildrenProps) => ReactElement; } export declare const menuCSS: >({ placement, theme: { borderRadius, spacing, colors }, }: MenuProps, unstyled: boolean) => CSSObjectWithLabel; export declare const MenuPlacer: >(props: MenuPlacerProps) => ReactElement>; declare const Menu: >(props: MenuProps) => jsx.JSX.Element; export default Menu; export interface MenuListProps = GroupBase> extends CommonPropsAndClassName { /** Set the max height of the Menu component */ maxHeight: number; /** The children to be rendered. */ children: ReactNode; /** Inner ref to DOM ReactNode */ innerRef: Ref; /** The currently focused option */ focusedOption: Option; /** Props to be passed to the menu-list wrapper. */ innerProps: JSX.IntrinsicElements['div']; } export declare const menuListCSS: >({ maxHeight, theme: { spacing: { baseUnit }, }, }: MenuListProps, unstyled: boolean) => CSSObjectWithLabel; export declare const MenuList: >(props: MenuListProps) => jsx.JSX.Element; export declare const noOptionsMessageCSS: >({ theme: { spacing: { baseUnit }, colors, }, }: NoticeProps, unstyled: boolean) => CSSObjectWithLabel; export declare const loadingMessageCSS: >({ theme: { spacing: { baseUnit }, colors, }, }: NoticeProps, unstyled: boolean) => CSSObjectWithLabel; export interface NoticeProps = GroupBase> extends CommonPropsAndClassName { /** The children to be rendered. */ children: ReactNode; /** Props to be passed on to the wrapper. */ innerProps: JSX.IntrinsicElements['div']; } export declare const NoOptionsMessage: { >(props: NoticeProps): jsx.JSX.Element; defaultProps: { children: string; }; }; export declare const LoadingMessage: { >(props: NoticeProps): jsx.JSX.Element; defaultProps: { children: string; }; }; export interface MenuPortalProps> extends CommonPropsAndClassName { appendTo: HTMLElement | undefined; children: ReactNode; controlElement: HTMLDivElement | null; innerProps: JSX.IntrinsicElements['div']; menuPlacement: MenuPlacement; menuPosition: MenuPosition; } export interface PortalStyleArgs { offset: number; position: MenuPosition; rect: { left: number; width: number; }; } export declare const menuPortalCSS: ({ rect, offset, position, }: PortalStyleArgs) => CSSObjectWithLabel; export declare const MenuPortal: >(props: MenuPortalProps) => jsx.JSX.Element | null;