import '../../../preact/compat/dist/compat.module.mjs';
import RadioButtonUncheckedIcon from '../internal/svg-icons/RadioButtonUnchecked.mjs';
import RadioButtonCheckedIcon from '../internal/svg-icons/RadioButtonChecked.mjs';
import rootShouldForwardProp from '../styles/rootShouldForwardProp.mjs';
import memoTheme from '../utils/memoTheme.mjs';
import { jsx as u } from '../../../preact/jsx-runtime/dist/jsxRuntime.module.mjs';
import styled from '../styles/styled.mjs';

const RadioButtonIconRoot = styled('span', {
  shouldForwardProp: rootShouldForwardProp
})({
  position: 'relative',
  display: 'flex'
});
const RadioButtonIconBackground = styled(RadioButtonUncheckedIcon)({
  // Scale applied to prevent dot misalignment in Safari
  transform: 'scale(1)'
});
const RadioButtonIconDot = styled(RadioButtonCheckedIcon)(memoTheme(({
  theme
}) => ({
  left: 0,
  position: 'absolute',
  transform: 'scale(0)',
  transition: theme.transitions.create('transform', {
    easing: theme.transitions.easing.easeIn,
    duration: theme.transitions.duration.shortest
  }),
  variants: [{
    props: {
      checked: true
    },
    style: {
      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 ownerState = {
    ...props,
    checked
  };
  return /*#__PURE__*/u(RadioButtonIconRoot, {
    className: classes.root,
    ownerState: ownerState,
    children: [/*#__PURE__*/u(RadioButtonIconBackground, {
      fontSize: fontSize,
      className: classes.background,
      ownerState: ownerState
    }), /*#__PURE__*/u(RadioButtonIconDot, {
      fontSize: fontSize,
      className: classes.dot,
      ownerState: ownerState
    })]
  });
}

export { RadioButtonIcon as default };
//# sourceMappingURL=RadioButtonIcon.mjs.map
