All files / components/inputs/Radio styled.tsx

100% Statements 9/9
100% Branches 4/4
100% Functions 4/4
100% Lines 9/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48      2x   2x               2x 3x     3x                 3x                     2x         2x 3x        
/* eslint-disable no-ternary */
 
import type { Theme } from "styles/theme"
import styled from "styled-components"
 
export const Wrapper = styled.div`
  align-items: center;
  column-gap: 8px;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr;
`
 
export const Circle = styled.div<{ checked: boolean }>`
  border-color: ${({ theme }: { theme: Theme }) => theme.palette.primary.main};
  border-style: solid;
  border-width: ${({ checked }: { checked: boolean }) =>
    checked ? "2px" : "1px"};
  border-radius: 50%;
  cursor: pointer;
  height: 20px;
  position: relative;
  width: 20px;
 
  &::after {
    background: ${({ checked, theme }: { checked: boolean; theme: Theme }) =>
      checked ? theme.palette.primary.main : "transparent"};
    border-radius: 50%;
    content: "";
    height: 12px;
    left: 2px;
    position: absolute;
    top: 2px;
    width: 12px;
  }
`
 
export const Input = styled.input.attrs({ type: "radio" })`
  opacity: 0;
  position: absolute;
`
 
export const Label = styled.label`
  color: ${({ theme }: { theme: Theme }) => theme.palette.text.main};
  cursor: pointer;
  font-size: 16px;
`