// @flow
import type { Node } from 'react';
import PropTypes from 'prop-types';
import type { SpaceKey } from '../../../../mixins/spacing';

export type SelectorItemProps = {
  id: string,
  value: string | number,
  type?: string,
  label?: string,
  secondaryLabel?: string,
  checked?: boolean,
  disabled?: boolean,
  large?: boolean, // TODO: deprecate large in favour of main <Selector/> size prop
  children?: Node,
  onRef?: (?HTMLElement) => void,
  childElementSpacing?: SpaceKey[],
};

export const selectorItemProptypes = {
  checked: PropTypes.bool,
  disabled: PropTypes.bool,
  large: PropTypes.bool,
  children: PropTypes.any,
  id: PropTypes.string.isRequired,
  label: PropTypes.string,
  secondaryLabel: PropTypes.string,
  value: PropTypes.oneOfType([
    PropTypes.arrayOf(PropTypes.string),
    PropTypes.string,
    PropTypes.number,
  ]).isRequired,
  onRef: PropTypes.func,
};
