import Form from './components/form.js'
import Input from './components/input.js'
import UnboundInput from './components/unbound_input.js'
import Submit from './components/submit.js'
import FormErrorList from './components/form_error_list.js'
import Fieldset from './components/fieldset.js'
import FieldsetText from './components/fieldset_text.js'
import ValueLinkedSelect from './components/value_linked_select.js'
import util from './util.js'
import typeMapping from './type_mapping.js'
import * as factories from './factories.js'

const HigherOrderComponents = {
  Boolean: require('./higher_order_components/boolean.js'),
  Focusable: require('./higher_order_components/focusable.js'),
}

// Setter and getter for the Frig default theme
function defaultTheme(theme) {
  if (theme === null) return Form.defaultProps.theme
  if (typeof theme !== 'object') {
    throw new Error('Invalid Frig theme. Expected an object')
  }
  Form.originalClass.defaultProps.theme = theme
  UnboundInput.originalClass.defaultProps.theme = theme
  return true
}

export default {
  defaultTheme,
  Form,
  Input,
  UnboundInput,
  Submit,
  FormErrorList,
  Fieldset,
  FieldsetText,
  ValueLinkedSelect,
  HigherOrderComponents,
  util,
  typeMapping,
  factories,
}

import Form from './components/form.js'
import Input from './components/input.js'
import UnboundInput from './components/unbound_input.js'
import Submit from './components/submit.js'
import FormErrorList from './components/form_error_list.js'
import Fieldset from './components/fieldset.js'
import FieldsetText from './components/fieldset_text.js'
import ValueLinkedSelect from './components/value_linked_select.js'
import util from './util.js'
import typeMapping from './type_mapping.js'
import * as factories from './factories.js'

const HigherOrderComponents = {
  Boolean: require('./higher_order_components/boolean.js'),
  Focusable: require('./higher_order_components/focusable.js'),
}

// Setter and getter for the Frig default theme
function defaultTheme(theme) {
  if (theme === null) return Form.defaultProps.theme
  if (typeof theme !== 'object') {
    throw new Error('Invalid Frig theme. Expected an object')
  }
  Form.originalClass.defaultProps.theme = theme
  UnboundInput.originalClass.defaultProps.theme = theme
  return true
}

export {
  defaultTheme,
  Form,
  Input,
  UnboundInput,
  Submit,
  FormErrorList,
  Fieldset,
  FieldsetText,
  ValueLinkedSelect,
  HigherOrderComponents,
  util,
  typeMapping,
  factories,
}

Use named exports instead of default object export...
Use named exports instead of default object export...

See http://www.2ality.com/2014/09/es6-modules-final.html, the sentence above section 4:

"You may be wondering – why do we need named exports if we could simply default-export objects (like CommonJS)? The answer is that you can’t enforce a static structure via objects and lose all of the associated advantages (described in the next section)."
