// @flow
import type { ComponentType, Element } from 'react';
import type { StylableProps } from '../../../mixins/themes';
import type { TestingProps } from '../../../mixins/testing';
import type { AriaProps } from '../../../mixins/aria';
import type { SpaceProps } from '../../../mixins/spacing';
import type { StackeeProps } from '../../../mixins/stackee';
import type { TranslatedContent } from '../../../types';
import { MenuItem } from './menu-item';

export type TriggerProps = {
  label?: TranslatedContent,
  isOpen: boolean,
};

export type MenuProps = {|
  ...StylableProps,
  ...TestingProps,
  ...AriaProps,
  ...SpaceProps,
  ...StackeeProps,
  label?: TranslatedContent,
  children: Element<typeof MenuItem> | Element<typeof MenuItem>[],
  isOpen: boolean,
  onToggle: () => void,
  TriggerComponent?: ComponentType<TriggerProps>,
  flatTopCorners?: boolean,
  dropdownSpacing?: $PropertyType<SpaceProps, 'spacing'>,
  direction?: 'left' | 'right',
|};
