// @flow
import type { Element, ComponentType } from 'react';
import type { TranslatedContent } from '../../../types';
import type { MarginOnlySpaceProps } from '../../../mixins/spacing';
import type { StackeeProps } from '../../../mixins/stackee';
import type { StylableProps } from '../../../mixins/themes';
import type { TestingProps } from '../../../mixins/testing';
import type { FocusEvents } from '../../../mixins/focus';
import type { AriaProps } from '../../../mixins/aria';
import type { OptionProps } from './option/option.proptypes';

export type SelectProps<T> = {|
  ...TestingProps,
  ...StylableProps,
  ...MarginOnlySpaceProps,
  ...StackeeProps,
  ...FocusEvents,
  ...TestingProps,
  ...AriaProps,
  focusOnMount?: boolean,
  children: Array<Element<ComponentType<OptionProps<T>>>>,
  disabled?: boolean,
  error?: boolean,
  large?: boolean,
  onChange: (T | typeof undefined) => void,
  placeholder?: string,
  /** value is required as undefined, which will show the placeholder for you if it changes from val -> undefined */
  value: T | typeof undefined,
  label: TranslatedContent,
  hideLabel?: boolean,
  name?: string,
|};
