// @flow
import type { TranslatedContent } from '../../../types';

type WithInternalLabel = {|
  /** Used to give context to what the slider is changing */
  label: TranslatedContent,
  /** Show or hide the field label. Defaults to false */
  hideLabel?: boolean,
|};

type WithExternalLabel = {|
  /** Use when the label is external to the component */
  ariaLabelledBy: string,
|};

type LabelStyle = WithExternalLabel | WithInternalLabel;

export type RangeProps = {|
  value: number,
  /** Minimum value allowed to slide to */
  min: number,
  /** Maximum value allowed to slide to */
  max: number,
  /** Label underneath the min value */
  minLabel?: TranslatedContent,
  /** Label underneath the max value */
  maxLabel?: TranslatedContent,
  onRangeChange: (number) => void,
  /** Current value label. Use this when sliders are represented by text  */
  ariaValuetext?: string,
  ...LabelStyle,
|};
