// @flow
import type { Node } from 'react';
import type { StylableProps } from '../../mixins/themes';
import type { SpaceProps } from '../../mixins/spacing/spacing.proptypes';
import type { TestingProps } from '../../mixins/testing';
import type { AriaProps } from '../../mixins/aria';
import type { StackeeProps } from '../../mixins/stackee';
import type { LabelStyle } from '../../core/forms/text-input/text-input.proptypes';
import type { FormFieldError } from '../../core/forms/internals/forms.proptypes';

type ReactDayPickerDisableDatesConfig = {|
  before?: Date,
  after?: Date,
|};

export type DatepickerProps = {|
  ...StylableProps,
  ...TestingProps,
  ...AriaProps,
  ...SpaceProps,
  ...StackeeProps,
  label: string,
  labelStyle?: LabelStyle,
  name?: string,
  onChange: (date: Date | void) => void,
  value?: Date,
  disabledDates?: Array<Date | ReactDayPickerDisableDatesConfig>,
  disableWeekends?: boolean,
  disablePastDates?: boolean,

  /* Optional extra information about the control */
  error?: FormFieldError,
  success?: Node,
  description?: Node,
|};
