<commit_before>import React from 'react'

import Label from '../Label'
import fabricComponent from '../fabricComponent'
import isDefined from '../util/isDefined.js'

import style from './ChoiceField.scss'

const ChoiceField = ({
  className, disabled, groupId, id, label, name, required, type, checked, ...props
}) => {
  const groupIdSuffix = isDefined(groupId) ? `[${groupId}]` : ''
  const inputId = `ChoiceField_${id || name || Date.now()}${groupIdSuffix}_input`

  return (
    <div data-fabric="ChoiceField"
      id={id}
      className={className}
      styleName="ms-ChoiceField">
      <input {...props}
        children={null}
        id={inputId}
        name={name}
        type={type}
        disabled={disabled}
        checked={isDefined(checked) ? checked : false}
        styleName="ms-ChoiceField-input" />
      <label styleName="ms-ChoiceField-field"
        htmlFor={inputId}>
        <Label componentClass="span" styleName="ms-Label" required={required}>{label}</Label>
      </label>
    </div>
  )
}
ChoiceField.propTypes = {
  checked: React.PropTypes.bool,
  className: React.PropTypes.string,
  disabled: React.PropTypes.bool,
  groupId: React.PropTypes.oneOfType([
    React.PropTypes.string,
    React.PropTypes.number
  ]),
  id: React.PropTypes.string,
  label: React.PropTypes.node,
  name: React.PropTypes.string.isRequired,
  required: React.PropTypes.bool,
  type: React.PropTypes.oneOf(['radio', 'checkbox']).isRequired
}
ChoiceField.defaultProps = {
  disabled: false,
  require: false,
  type: 'checkbox'
}

export default fabricComponent(ChoiceField, style)
<commit_msg>fix(ChoiceField): add displayName<commit_after>import React from 'react'

import Label from '../Label'
import fabricComponent from '../fabricComponent'
import isDefined from '../util/isDefined.js'

import style from './ChoiceField.scss'

const ChoiceField = ({
  className, disabled, groupId, id, label, name, required, type, checked, ...props
}) => {
  const groupIdSuffix = isDefined(groupId) ? `[${groupId}]` : ''
  const inputId = `ChoiceField_${id || name || Date.now()}${groupIdSuffix}_input`

  return (
    <div data-fabric="ChoiceField"
      id={id}
      className={className}
      styleName="ms-ChoiceField">
      <input {...props}
        children={null}
        id={inputId}
        name={name}
        type={type}
        disabled={disabled}
        checked={isDefined(checked) ? checked : false}
        styleName="ms-ChoiceField-input" />
      <label styleName="ms-ChoiceField-field"
        htmlFor={inputId}>
        <Label componentClass="span" styleName="ms-Label" required={required}>{label}</Label>
      </label>
    </div>
  )
}
ChoiceField.displayName = 'ChoiceField'
ChoiceField.propTypes = {
  checked: React.PropTypes.bool,
  className: React.PropTypes.string,
  disabled: React.PropTypes.bool,
  groupId: React.PropTypes.oneOfType([
    React.PropTypes.string,
    React.PropTypes.number
  ]),
  id: React.PropTypes.string,
  label: React.PropTypes.node,
  name: React.PropTypes.string.isRequired,
  required: React.PropTypes.bool,
  type: React.PropTypes.oneOf(['radio', 'checkbox']).isRequired
}
ChoiceField.defaultProps = {
  disabled: false,
  require: false,
  type: 'checkbox'
}

export default fabricComponent(ChoiceField, style)

{'fraction_non_alphanumeric': 0.14664634146341463, 'fraction_numerical': 0.0, 'mean_word_length': 3.667140825035562, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1857650', 'n_tokens_mistral': 1021, 'n_tokens_neox': 1008, 'n_words': 204}