<commit_before>/**
 * @jsx React.DOM
 */

var React = require('react'),
    Classable = require('./mixins/classable.js');

var Checkbox = React.createClass({

  propTypes: {
    name: React.PropTypes.string.isRequired,
    value: React.PropTypes.string.isRequired,
    onCheck: React.PropTypes.func
  },

  mixins: [Classable],

  getInitialState: function() {
    return {
      checked: false
    }
  },

  getDefaultProps: function() {
    return {
    };
  },

  check: function() {
    this.setState({ checked: !this.state.checked });
    this.refs.checkbox.getDOMNode().checked = !this.refs.checkbox.getDOMNode().checked;

  },

  render: function() {
    var classes = this.getClasses('mui-checkbox', {
      'mui-checked': this.state.checked === true
    })

    return (
      <div className={classes} onClick={this._onCheck}>
        <input ref="checkbox" type="checkbox" name={this.props.name} value={this.props.value} />  
        <span className="mui-checkbox-box" />
        <span className="mui-checkbox-check" />
      </div><commit_msg>Updated to latest mui components<commit_after>/**
 * @jsx React.DOM
 */

var React = require('react'),
    Classable = require('./mixins/classable.js');

var Checkbox = React.createClass({

  propTypes: {
    name: React.PropTypes.string.isRequired,
    value: React.PropTypes.string.isRequired,
    onCheck: React.PropTypes.func,
    checked: React.PropTypes.bool
  },

  mixins: [Classable],

  getInitialState: function() {
    return {
      checked: this.props.checked || false
    }
  },

  getDefaultProps: function() {
    return {
    };
  },

  componentWillReceiveProps: function(nextProps) {
    this.setState({checked: nextProps.checked || false});
  },

  check: function() {
    this.setState({ checked: !this.state.checked });
    this.refs.checkbox.getDOMNode().checked = !this.refs.checkbox.getDOMNode().checked;

  },

  render: function() {
    var classes = this.getClasses('mui-checkbox', {
      'mui-checked': this.state.checked === true
    })

    return (
      <div className={classes} onClick={this._onCheck}>
        <input ref="checkbox" type="checkbox" name={this.props.name} value={this.props.value} />  
        <span className="mui-checkbox-box" />
        <span className="mui-checkbox-check" />
      </div>
{'fraction_non_alphanumeric': 0.16020896821941663, 'fraction_numerical': 0.0, 'mean_word_length': 3.088967971530249, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '5407346', 'n_tokens_mistral': 733, 'n_tokens_neox': 711, 'n_words': 125}