<commit_before>import React, {Fragment} from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import getAttrs from '../util/getAttrs';

const createSpacer = (props, size, state = false) => (
  <table {...getAttrs(props, 'table', classnames('spacer', state && `${state}-for-large`))}>
    <tbody>
      <tr>
        <td
          height={`${size}px`}
          style={{
            fontSize: `${size}px`,
            lineHeight: `${size}px`
          }}
        >
          &nbsp;
        </td>
      </tr>
    </tbody>
  </table>
);

/**
 * Spacer component to create vertical space between elements.
 *
 * @example
 * <Button href="example.com/signup.html">Sign Up</Button>
 * <Spacer size="10" />
 * <Button href="example.com/learnmore.html">Learn More</Button>
 */
export default function Spacer(props) {
  if (!props.sizeSm && !props.sizeLg) {
    return createSpacer(props, props.size);
  }

  return (
    <Fragment>
      {props.sizeSm && createSpacer(props, props.sizeSm, 'hide')}
      {props.sizeLg && createSpacer(props, props.sizeLg, 'show')}
    </Fragment>
  );
}

/**
 * Prop types for `<Spacer />`.
 * @type Object
 * @prop {String} [size='16'] Height of spacer in pixels.
 * @prop {String} sizeSm - Height of spacer in pixels, and it will only appear on small screens.
 * @prop {String} sizeLg - Height of spacer in pixels, and it will only appear on large screens.
 * @todo Make `size` a numeric prop instead of string.
 */
Spacer.propTypes = {
  size: PropTypes.string,
  sizeSm: PropTypes.string,
  sizeLg: PropTypes.string
};

/**
 * Default props for `<Spacer />`.
 * @type Object
 */
Spacer.defaultProps = {
  size: '16',
  sizeSm: null,
  sizeLg: null
};<commit_msg>Change <Spacer /> props from strings to numbers<commit_after>import React, {Fragment} from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import getAttrs from '../util/getAttrs';

const createSpacer = (props, size, state = false) => (
  <table {...getAttrs(props, 'table', classnames('spacer', state && `${state}-for-large`))}>
    <tbody>
      <tr>
        <td
          height={`${size}px`}
          style={{
            fontSize: `${size}px`,
            lineHeight: `${size}px`
          }}
        >
          &nbsp;
        </td>
      </tr>
    </tbody>
  </table>
);

/**
 * Spacer component to create vertical space between elements.
 *
 * @example
 * <Button href="example.com/signup.html">Sign Up</Button>
 * <Spacer size="10" />
 * <Button href="example.com/learnmore.html">Learn More</Button>
 */
export default function Spacer(props) {
  if (!props.sizeSm && !props.sizeLg) {
    return createSpacer(props, props.size);
  }

  return (
    <Fragment>
      {props.sizeSm && createSpacer(props, props.sizeSm, 'hide')}
      {props.sizeLg && createSpacer(props, props.sizeLg, 'show')}
    </Fragment>
  );
}

/**
 * Prop types for `<Spacer />`.
 * @type Object
 * @prop {Number} size - Height of spacer in pixels. Using this prop _only_ will create a spacer that displays on all screen sizes.
 * @prop {Number} sizeSm - Height of spacer in pixels. Using this prop creates a spacer that appears only on small screens.
 * @prop {Number} sizeLg - Height of spacer in pixels. Using this prop creates a spacer that appears only on small screens.
 */
Spacer.propTypes = {
  size: PropTypes.number,
  sizeSm: PropTypes.number,
  sizeLg: PropTypes.number
};

/**
 * Default props for `<Spacer />`.
 * @type Object
 */
Spacer.defaultProps = {
  size: 16,
  sizeSm: null,
  sizeLg: null
};
{'fraction_non_alphanumeric': 0.1562940016896649, 'fraction_numerical': 0.0028161081385525205, 'mean_word_length': 2.9820627802690582, 'pattern_counts': {'":': 0, '<': 38, '<?xml version=': 0, '>': 40, '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': '2817038', 'n_tokens_mistral': 1159, 'n_tokens_neox': 1146, 'n_words': 331}