Skip to content
Snippets Groups Projects
FormItems.js 2.08 KiB
Newer Older
import { th } from '@pubsweet/ui'
import styled from 'styled-components'

export const RootContainer = styled.div`
  background-color: ${th('backgroundColorReverse')};
  border: ${({ bordered }) => (bordered ? th('borderDefault') : 'none')};
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  max-width: 550px;
  min-width: 350px;
  padding: calc(${th('subGridUnit')} * 2) calc(${th('subGridUnit')} * 4);
`

export const Title = styled.div`
  color: ${th('colorPrimary')};
  font-family: ${th('fontHeading')};
  font-size: ${th('fontSizeHeading5')};
  font-weight: bold;
  margin: 10px auto;
  text-align: center;
`
export const Subtitle = styled.div`
  font-family: ${th('fontReading')};
  font-size: ${th('fontSizeBase')};
  font-weight: normal;
  margin: 10px auto;
  text-align: center;
`

export const Email = styled.div`
  font-family: ${th('fontReading')};
  font-size: ${th('fontSizeBase')};
  font-weight: normal;
  margin: 10px auto;
  text-align: center;
`

export const FormContainer = styled.form``

export const Row = styled.div`
  align-items: center;
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
  margin: calc(${th('subGridUnit')} * 2) 0;
`

export const RowItem = styled.div`
  display: flex;
  flex: 1;
  flex-direction: ${({ vertical }) => (vertical ? 'column' : 'row')};
  justify-content: ${({ centered }) => (centered ? 'center' : 'initial')};
`

export const Label = styled.div`
  font-family: ${th('fontReading')};
  font-size: ${th('fontSizeBaseSmall')};
  text-transform: uppercase;
`
export const Err = styled.span`
  color: ${th('colorError')};
  font-family: ${th('fontReading')};
  font-size: ${th('fontSizeBase')};
  margin-top: calc(${th('gridUnit')}*-1);
  text-align: center;
`

export const Textarea = styled.textarea`
  width: 100%;
  padding: calc(${th('subGridUnit')}*2);
  font-size: ${th('fontSizeBaseSmall')};
  font-family: ${th('fontWriting')};
  border-color: ${({ hasError }) =>
    hasError ? th('colorError') : th('colorPrimary')};
  transition: all 300ms linear;
  &:read-only {
    background-color: ${th('colorBackgroundHue')};
  }
`