<commit_before>import React from 'react';
import styled, { keyframes, withTheme } from 'styled-components';
import * as _ from 'lodash';

import Loader from '../Loader';
import {
  colors,
  typography,
  boxShadows,
  renderThemeIfPresentOrDefault,
  renderThemeKeyOrDefaultValue,
  ifThemeInPropsIsPresentUse,
} from '../styles';

export const buttonAnimationTimeSeconds = 2;

const fade = keyframes`
  0%   {
    background: ${renderThemeIfPresentOrDefault({ key: 'brand01', defaultValue: colors.green})};
    box-shadow: 0 0 2px 0 rgba(0,0,0,0.12), 0 2px 2px 0 rgba(0,0,0,0.24);
  }
  100% {
    opacity: 0;
    box-shadow: none;
  }
`;

const ButtonBase = styled.button`
  animation: ${(props) => {
    if (props.fade) {
      return fade;
    }

    return 'none';
  }} ${buttonAnimationTimeSeconds}s;

  --background: ${(props) => {
    if (props.danger && props.disabled) {
      return renderThemeKeyOrDefaultValue({ props, key: 'warning03', defaultValue: colors.red10 });
    }

    if (props.disabled || props.fade) {
      return renderThemeKeyOrDefaultValue({ props, key: 'brand03', defaultValue: colors.green10 });
    }

    if (props.danger) {
      return renderThemeKeyOrDefaultValue({ props, key: 'warning01', defaultValue: colors.red });
    }

    if (props.outline || props.flat || props.flatAlt) {
      return 'transparent';
    }

    if (props.neuralytics) {
      return renderThemeKeyOrDefaultValue({ props, key: 'tron01', defaultValue: colors.tron});
    }

    return renderThemeKeyOrDefaultValue({ props, key: 'brand01', defaultValue: colors.green});
  }};
  background: var(--background);

  transition: box-shadow .25s ease-in-out, background-color .25s ease-in-out;
  &:hover {
    background-color: ${(props) => {
      if (props.flat || props.flatAlt || props.outline) {
        return renderThemeKeyOrDefaultValue({ props, key: 'brand04', defaultValue: colors.green10});
      }<commit_msg>fix(ButtonTheming): change flat button hover to white10 (#299)<commit_after>import React from 'react';
import styled, { keyframes, withTheme } from 'styled-components';
import * as _ from 'lodash';

import Loader from '../Loader';
import {
  colors,
  typography,
  boxShadows,
  renderThemeIfPresentOrDefault,
  renderThemeKeyOrDefaultValue,
  ifThemeInPropsIsPresentUse,
} from '../styles';

export const buttonAnimationTimeSeconds = 2;

const fade = keyframes`
  0%   {
    background: ${renderThemeIfPresentOrDefault({ key: 'brand01', defaultValue: colors.green})};
    box-shadow: 0 0 2px 0 rgba(0,0,0,0.12), 0 2px 2px 0 rgba(0,0,0,0.24);
  }
  100% {
    opacity: 0;
    box-shadow: none;
  }
`;

const ButtonBase = styled.button`
  animation: ${(props) => {
    if (props.fade) {
      return fade;
    }

    return 'none';
  }} ${buttonAnimationTimeSeconds}s;

  --background: ${(props) => {
    if (props.danger && props.disabled) {
      return renderThemeKeyOrDefaultValue({ props, key: 'warning03', defaultValue: colors.red10 });
    }

    if (props.disabled || props.fade) {
      return renderThemeKeyOrDefaultValue({ props, key: 'brand03', defaultValue: colors.green10 });
    }

    if (props.danger) {
      return renderThemeKeyOrDefaultValue({ props, key: 'warning01', defaultValue: colors.red });
    }

    if (props.outline || props.flat || props.flatAlt) {
      return 'transparent';
    }

    if (props.neuralytics) {
      return renderThemeKeyOrDefaultValue({ props, key: 'tron01', defaultValue: colors.tron});
    }

    return renderThemeKeyOrDefaultValue({ props, key: 'brand01', defaultValue: colors.green});
  }};
  background: var(--background);

  transition: box-shadow .25s ease-in-out, background-color .25s ease-in-out;
  &:hover {
    background-color: ${(props) => {
      if (props.flat || props.flatAlt || props.outline) {
        return renderThemeKeyOrDefaultValue({ props, key: 'white10', defaultValue: colors.green10});
      }
{'fraction_non_alphanumeric': 0.14347937483986678, 'fraction_numerical': 0.026902382782475018, 'mean_word_length': 3.658711217183771, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '6488996', 'n_tokens_mistral': 1328, 'n_tokens_neox': 1231, 'n_words': 297}