<commit_before>import styled, { css, keyframes } from 'styled-components'
import { trans } from '@ui/common'
import { spacing } from '@ui/common/constants'
import { shake } from 'react-animations'
import { Form as FormikForm } from 'formik'
const shakeAnimation = keyframes`${shake}`

const Input = styled.input`
  padding: 5px 0 15px;
  margin-top: 5px;
  border: none;
  outline: none;
  width: 100%;
  color: rgba(39, 16, 51, 0.7);
  ${({ lowercase }) =>
    lowercase &&
    css`
      text-transform: lowercase !important;
    `};
`

const Textarea = styled.textarea`
  padding: 10px;
  outline: none;
  width: 100%;
  max-width: 100%;
  display: block;
  border: 1px solid rgba(39, 15, 52, 0.1);
  border-top-right-radius: 4px;
  border-top-left-radius: 4px;
  box-sizing: border-box;
  resize: vertical;
  min-height: ${({ mh }) => (mh ? `${mh}px` : '48px')};
  margin-top: 5px;
  color: rgba(39, 16, 51, 0.7);
`

const InputWrapper = styled.div`
  position: relative;
`
const Bar = styled.div`
  height: 2px;
  width: 100%;
  position: absolute;
  bottom: 1px;
  background: rgba(39, 15, 52, 0.6);
  border-radius: 3px;
  ${trans};
  pointer-events: none;

  ${Input}:focus ~ &,
  ${Textarea}:focus ~ & {
    background: rgba(75, 190, 190, 1);
  }
`

const InputOverlay = styled.div`
  position: absolute;
  top: 10px;
  color: rgba(39, 15, 52, 0.4);
  right: 0;
  pointer-events: none;
  user-select: none;
`

const Label = styled.label`
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  padding-right: 10px;
  line-height: 1.4;
  transform: translate3d(0, 0, 0);
  transform-origin: center left;
  color: rgba(39, 15, 52);
  ${trans};

  /* default state */
  ${Input}:not(:focus) ~ &,
  ${Textarea}:not(:focus) ~ & {
    transform: translateY(10px);
    opacity: 0.4;
  }

  /* focus / content state */
  ${Input}:focus ~ &,
  ${Input}:not(:placeholder-shown) ~ &,
  ${Textarea}:focus ~ &,
  ${Textarea}:not(:placeholder-shown) ~ & {
    transform: translateY(-17px) scale(0.85);
    font-weight: 500;
    opacity: 1;
  }

  ${Textarea}:not(:focus) ~ & {
    left: 10px;
  }
  ${Textarea}:focus ~ &,
  ${Textarea}:not(:placeholder-shown) ~ & {
    transform: translateY(-22px) scale(0.85);
  }
`

const HelperMessage = styled.div`
  font-style: normal;
  font-weight: 500;
  line-height: 23px;
  font-size: 14px;
  padding-top: 8px;
  color: rgba(39, 15, 52, 0.7);
`
const Group = styled.div`
  position: relative;
  padding-top: 14px;

  ${({ error }) =>
    error &&
    css`
      ${InputWrapper} {
        animation: 0.75s ${shakeAnimation} ease-in-out;
      }
      ${Bar} {
        background: #f67b7b !important;
      }
    `};

  ${({ positive }) =>
    positive &&<commit_msg>Original spacing, move labels and overlay down instead. Fix wiggling textarea label.<commit_after>import styled, { css, keyframes } from 'styled-components'
import { trans } from '@ui/common'
import { spacing } from '@ui/common/constants'
import { shake } from 'react-animations'
import { Form as FormikForm } from 'formik'
const shakeAnimation = keyframes`${shake}`

const Input = styled.input`
  padding: 10px 0;
  margin-top: 5px;
  border: none;
  outline: none;
  width: 100%;
  color: rgba(39, 16, 51, 0.7);
  ${({ lowercase }) =>
    lowercase &&
    css`
      text-transform: lowercase !important;
    `};
`

const Textarea = styled.textarea`
  padding: 10px;
  outline: none;
  width: 100%;
  max-width: 100%;
  display: block;
  border: 1px solid rgba(39, 15, 52, 0.1);
  border-top-right-radius: 4px;
  border-top-left-radius: 4px;
  box-sizing: border-box;
  resize: vertical;
  min-height: ${({ mh }) => (mh ? `${mh}px` : '48px')};
  margin-top: 5px;
  color: rgba(39, 16, 51, 0.7);
`

const InputWrapper = styled.div`
  position: relative;
`
const Bar = styled.div`
  height: 2px;
  width: 100%;
  position: absolute;
  bottom: 1px;
  background: rgba(39, 15, 52, 0.6);
  border-radius: 3px;
  ${trans};
  pointer-events: none;

  ${Input}:focus ~ &,
  ${Textarea}:focus ~ & {
    background: rgba(75, 190, 190, 1);
  }
`

const InputOverlay = styled.div`
  position: absolute;
  top: 15px;
  color: rgba(39, 15, 52, 0.4);
  right: 0;
  pointer-events: none;
  user-select: none;
`

const Label = styled.label`
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  padding-right: 10px;
  line-height: 1.4;
  transform: translate3d(0, 0, 0);
  transform-origin: center left;
  color: rgba(39, 15, 52);
  ${trans};

  /* default state */
  ${Input}:not(:focus) ~ &,
  ${Textarea}:not(:focus) ~ & {
    transform: translateY(15px);
    opacity: 0.4;
  }

  /* focus / content state */
  ${Input}:focus ~ &,
  ${Input}:not(:placeholder-shown) ~ &,
  ${Textarea}:focus ~ &,
  ${Textarea}:not(:placeholder-shown) ~ & {
    transform: translateY(-17px) scale(0.85);
    font-weight: 500;
    opacity: 1;
  }

  ${Textarea}:not(:focus) ~ & {
    transform: translateY(10px) translateX(10px);
  }
  ${Textarea}:focus ~ &,
  ${Textarea}:not(:placeholder-shown) ~ & {
    transform: translateY(-24px) scale(0.85) translateX(0);
  }
`

const HelperMessage = styled.div`
  font-style: normal;
  font-weight: 500;
  line-height: 23px;
  font-size: 14px;
  padding-top: 8px;
  color: rgba(39, 15, 52, 0.7);
`
const Group = styled.div`
  position: relative;
  padding-top: 14px;

  ${({ error }) =>
    error &&
    css`
      ${InputWrapper} {
        animation: 0.75s ${shakeAnimation} ease-in-out;
      }
      ${Bar} {
        background: #f67b7b !important;
      }
    `};

  ${({ positive }) =>
    positive &&
{'fraction_non_alphanumeric': 0.17569728193284775, 'fraction_numerical': 0.05009770829632262, 'mean_word_length': 3.2046303211351757, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '6977616', 'n_tokens_mistral': 2358, 'n_tokens_neox': 2088, 'n_words': 500}