constructor(properties) {
    super(properties);

    let selectedValue;
    let focusedOptionValue;

    if (properties.children) {
      this.children = flattenReactChildren(properties.children);
      this.options = filter(this.children, isOption);
    }

    if (has(properties, 'valueLink')) {
      selectedValue = properties.valueLink.value;
      focusedOptionValue = selectedValue;
    } else if (has(properties, 'value')) {
      selectedValue = properties.value;
      focusedOptionValue = selectedValue;
    } else if (has(properties, 'defaultValue')) {
      selectedValue = properties.defaultValue;
      focusedOptionValue = selectedValue;
    } else if (!isEmpty(this.children) && !some(this.children, isPlaceholder)) {
      const firstOption = first(this.options);
      selectedValue = firstOption ? firstOption.props.value : void 0;
      focusedOptionValue = selectedValue;
    } else if (!isEmpty(this.children)) {
      const firstOption = first(this.options);
      focusedOptionValue = firstOption ? firstOption.props.value : void 0;
    }

    this.state = {
      isOpen: false,
      isFocused: false,
      selectedValue,
      focusedOptionValue,
      selectedOptionWrapperProps: sanitizeSelectedOptionWrapperProps(properties),
      wrapperProps: sanitizeWrapperProps(properties.wrapperProps),
      menuProps: sanitizeMenuProps(properties.menuProps),
      caretProps: sanitizeCaretProps(properties.caretProps),
      isTouchedToToggle: false,
    };
  }
Select component.

In its simplest form the select component behaves almost identical to the
native HTML select which the exception that it comes with beautiful styles.

Example:

    <Select defaultValue="rome">
      <Option value="vienna">Vienna</Option>
      <Option value="rome">Rome</Option>
    </Select>

For more advanced examples please see:
nikgraf.github.io/belle/#/component/select

This component was inpired by:
- Jet Watson: https://github.com/JedWatson/react-select
- Instructure React Team: https://github.com/instructure-react/react-select-box