<commit_before>import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import RadioButtonUncheckedIcon from '../internal/svg-icons/RadioButtonUnchecked';
import RadioButtonCheckedIcon from '../internal/svg-icons/RadioButtonChecked';
import withStyles from '../styles/withStyles';

export const styles = (theme) => ({
  root: {
    position: 'relative',
    display: 'flex',
    '&$checked $dot': {
      transform: 'scale(1)',
      transition: theme.transitions.create('transform', {
        easing: theme.transitions.easing.easeOut,
        duration: theme.transitions.duration.shortest,
      }),
    },
  },
  checked: {},
  background: {
    // Scale applied to prevent dot misalignment in Safari
    transform: 'scale(1)',
  },
  dot: {
    left: 0,
    position: 'absolute',
    transform: 'scale(0)',
    transition: theme.transitions.create('transform', {
      easing: theme.transitions.easing.easeIn,
      duration: theme.transitions.duration.shortest,
    }),
  },
});

/**
 * @ignore - internal component.
 */
function RadioButtonIcon(props) {
  const { checked, classes, fontSize } = props;

  return (
    <span className={clsx(classes.root, { [classes.checked]: checked })}>
      <RadioButtonUncheckedIcon fontSize={fontSize} className={classes.background} />
      <RadioButtonCheckedIcon fontSize={fontSize} className={classes.dot} />
    </span>
  );
}

RadioButtonIcon.propTypes = {
  /**
   * If `true`, the component is checked.
   */
  checked: PropTypes.bool,
  /**
   * Override or extend the styles applied to the component.
   * See [CSS API](#css) below for more details.
   */
  classes: PropTypes.object.isRequired,
  /**
   * The size of the component.
   * `small` is equivalent to the dense radio styling.
   */
  fontSize: PropTypes.oneOf(['small', 'medium']),
};

export default withStyles(styles, { name: 'PrivateRadioButtonIcon' })(RadioButtonIcon);<commit_msg>[Radio] Migrate RadioButtonIcon to emotion (#26068)<commit_after>import * as React from 'react';
import PropTypes from 'prop-types';
import RadioButtonUncheckedIcon from '../internal/svg-icons/RadioButtonUnchecked';
import RadioButtonCheckedIcon from '../internal/svg-icons/RadioButtonChecked';
import experimentalStyled from '../styles/experimentalStyled';

const RadioButtonIconRoot = experimentalStyled('span')({
  position: 'relative',
  display: 'flex',
});

const RadioButtonIconBackground = experimentalStyled(RadioButtonUncheckedIcon)({
  // Scale applied to prevent dot misalignment in Safari
  transform: 'scale(1)',
});

const RadioButtonIconDot = experimentalStyled(RadioButtonCheckedIcon)(({ theme, styleProps }) => ({
  left: 0,
  position: 'absolute',
  transform: 'scale(0)',
  transition: theme.transitions.create('transform', {
    easing: theme.transitions.easing.easeIn,
    duration: theme.transitions.duration.shortest,
  }),
  ...(styleProps.checked && {
    transform: 'scale(1)',
    transition: theme.transitions.create('transform', {
      easing: theme.transitions.easing.easeOut,
      duration: theme.transitions.duration.shortest,
    }),
  }),
}));

/**
 * @ignore - internal component.
 */
function RadioButtonIcon(props) {
  const { checked = false, classes = {}, fontSize } = props;

  const styleProps = { ...props, checked };

  return (
    <RadioButtonIconRoot className={classes.root} styleProps={styleProps}>
      <RadioButtonIconBackground
        fontSize={fontSize}
        className={classes.background}
        styleProps={styleProps}
      />
      <RadioButtonIconDot fontSize={fontSize} className={classes.dot} styleProps={styleProps} />
    </RadioButtonIconRoot>
  );
}

RadioButtonIcon.propTypes = {
  /**
   * If `true`, the component is checked.
   */
  checked: PropTypes.bool,
  /**
   * Override or extend the styles applied to the component.
   * See [CSS API](#css) below for more details.
   */
  classes: PropTypes.object,
  /**
   * The size of the component.
   * `small` is equivalent to the dense radio styling.
   */
  fontSize: PropTypes.oneOf(['small', 'medium']),
};

export default RadioButtonIcon;
{'fraction_non_alphanumeric': 0.13979542133463224, 'fraction_numerical': 0.0031660983925962008, 'mean_word_length': 3.860355029585799, 'pattern_counts': {'":': 0, '<': 11, '<?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': '2267922', 'n_tokens_mistral': 1205, 'n_tokens_neox': 1187, 'n_words': 285}