<commit_before>import SimpleWrapper from './SimpleWrapper.jsx';
import React from 'react';

/**
 * @original ons-page
 * @category page
 * @description
 * [en] Displays an icon. [/en]
 * [jp] どうしよう[/jp]
 * @example
  <Icon
    size={{default: 32, material: 40}}
    icon={{default: 'ion-navicon', material: 'md-menu'}}
  />
/> */
class Icon extends SimpleWrapper {
  _getDomNodeName() {
    return 'ons-icon';
  }

  render() {
    var {icon, size, spin, fixedWidth, ...others} = this.props;

    if (fixedWidth) {
      others['fixed-width'] = true;
    }

    others['spin'] = spin ? true : null;

    if (icon) {
      if ((typeof icon) === 'string') {
        others.icon = icon;
      } else {
        let keys = Object.keys(icon).filter((a) => a !== 'default');
        let innerString = keys.map((key) => key + ':' + icon[key] + '');
        others.icon = icon.default + ', ' + innerString.join(',');
      }
    }

    if (size) {
      if ((typeof size) === 'number') {
        others.size = `${size}px`;
      } else {
        let keys = Object.keys(size).filter((a) => a !== 'default');
        let innerString = keys.map((key) => key + ':' + size[key] + 'px');
        others.size = size.default + 'px, ' + innerString.join(',');
      }
    }
    return React.createElement(this._getDomNodeName(), others, this.props.children);
  }

};

Icon.propTypes = {
  modifier: React.PropTypes.string,
  icon: React.PropTypes.oneOfType([
    React.PropTypes.string,
    React.PropTypes.objectOf(React.PropTypes.string)
  ]),
  size: React.PropTypes.oneOfType([
    React.PropTypes.number,
    React.PropTypes.objectOf(React.PropTypes.number)
  ]),
  rotate: React.PropTypes.oneOf([0, 90, 180, 270]),
  fixedWidth: React.PropTypes.bool,
  spin: React.PropTypes.bool

};

export default Icon;<commit_msg>Add documentation for icon<commit_after>import SimpleWrapper from './SimpleWrapper.jsx';
import React from 'react';

/**
 * @original ons-icon
 * @category icon
 * @description
 * [en]
 * Displays an icon. The following icon suites are available:
 *   *  [Font Awesome](https://fortawesome.github.io/Font-Awesome/)
 *   *  [Ionicons](http://ionicons.com/)
 *   *  [Material Design Iconic Font](http://zavoloklom.github.io/material-design-iconic-font/)
 * [/en]
 * [jp][/jp]
 * @example
  <Icon
    size={{default: 32, material: 40}}
    icon={{default: 'ion-navicon', material: 'md-menu'}}
  />
/> */
class Icon extends SimpleWrapper {
  _getDomNodeName() {
    return 'ons-icon';
  }

  render() {
    var {icon, size, spin, fixedWidth, ...others} = this.props;

    if (fixedWidth) {
      others['fixed-width'] = true;
    }

    others['spin'] = spin ? true : null;

    if (icon) {
      if ((typeof icon) === 'string') {
        others.icon = icon;
      } else {
        let keys = Object.keys(icon).filter((a) => a !== 'default');
        let innerString = keys.map((key) => key + ':' + icon[key] + '');
        others.icon = icon.default + ', ' + innerString.join(',');
      }
    }

    if (size) {
      if ((typeof size) === 'number') {
        others.size = `${size}px`;
      } else {
        let keys = Object.keys(size).filter((a) => a !== 'default');
        let innerString = keys.map((key) => key + ':' + size[key] + 'px');
        others.size = size.default + 'px, ' + innerString.join(',');
      }
    }
    return React.createElement(this._getDomNodeName(), others, this.props.children);
  }

};

Icon.propTypes = {
  /**
   * @name modifier
   * @type string
   * @required false
   * @description
   *  [en]The appearance of the icon.[/en]
   *  [jp] [/jp]
   */
  modifier: React.PropTypes.string,

  /**
   * @name icon
   * @type object or string
   * @description
   *  [en] can be either a string or an object. If it is an string, it is set to an specific icon like 'ions-navicon'. If it is an object, it represents a dictionary of the icons depending on the modifier e.g.   `{{default: 'ion-navicon', material: 'md-menu'}}` [/en]
   *  [jp] [/jp]
   */
  icon: React.PropTypes.oneOfType([
    React.PropTypes.string,
    React.PropTypes.objectOf(React.PropTypes.string)
  ]),

  /**
   * @name size
   * @type object or number
   * @description
   *  [en] can be either a number or an object. If it is an number, it  specifies the icon size with a number in pixels. If it is an object, it represents a dictionary of the icon sizes depending on the modifier e.g.   `{{default: 20, material: 18}}` [/en]
   *  [jp] [/jp]
   */
  size: React.PropTypes.oneOfType([
    React.PropTypes.number,
    React.PropTypes.objectOf(React.PropTypes.number)
  ]),

  /**
   * @name rotate
   * @type number
   * @description
   *  [en] Number of degrees to rotate the icon. Valid values are 90, 180 and 270. [/en]
   *  [jp] [/jp]
   */
  rotate: React.PropTypes.oneOf([0, 90, 180, 270]),

  /**
   * @name fixedWidth
   * @type bool
   * @description
   * [en] When used in a list, you want the icons to have the same width so that they align vertically by defining this attribute. [/en]
   *  [jp] [/jp]
   */
  fixedWidth: React.PropTypes.bool,

  /**
   * @name spin
   * @type bool
   * @description
   * [en] Specify whether the icon should be spinning. [/en]
   *  [jp] [/jp]
   */
  spin: React.PropTypes.bool

};

export default Icon;
{'fraction_non_alphanumeric': 0.16983282674772038, 'fraction_numerical': 0.007218844984802432, 'mean_word_length': 2.694736842105263, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 1, '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': '2191633', 'n_tokens_mistral': 1850, 'n_tokens_neox': 1776, 'n_words': 461}