import styled, { css } from 'styled-components'; import theme from 'styles/theme'; export const RadiosContainer = styled.div` display: inline-flex; flex-direction: ${p => (p.direction === 'vertical' ? 'column' : 'row')}; font-size: 14px; color: #101934; `; export const RadioButtonsContainer = styled.div` display: inline-flex; button:not(:first-child) { border-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; &:active { box-shadow: -1px 0 0 0 ${p => p.theme.brandActive}; } } button:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; } button.isActive { border-color: ${p => p.theme.brand}; &:not(:first-child) { box-shadow: -1px 0 0 0 ${p => p.theme.brand}; } background-color: ${p => (p.radioButtonStyle === 'stroke' ? 'white' : p.theme.brand)}; color: ${p => (p.radioButtonStyle === 'stroke' ? p.theme.brand : 'white')}; } `; RadioButtonsContainer.defaultProps = { theme }; export const RadioWrap = styled.div` display: inline-flex; cursor: ${p => (p.disabled ? 'not-allowed' : 'pointer')}; color: ${p => (p.disabled ? '#ced1d7' : '#434c5d')}; &:not(:last-child) { margin-right: 8px; margin-bottom: 6px; } ${p => !p.disabled && css` &:hover > div::before { background-color: #ebf7f9; border: none; box-shadow: none; width: 32px; height: 32px; opacity: 1; transform: scale(1); } &:active > div::before { background-color: #f5f5f5; border: none; box-shadow: none; opacity: 1; transform: scale(1); } `} `; export const CheckHover = styled.div` display: inline-flex; box-sizing: border-box; position: relative; justify-content: center; align-items: center; border-radius: 50%; padding: 6px; width: 32px; height: 32px; ::before { content: ''; display: block; opacity: 0; position: absolute; transition-duration: 0.3s; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); background: none; border-radius: 50%; box-sizing: border-box; transform: scale(0); transition-property: transform, opacity; } ${p => !p.disabled && css` :hover::before { background-color: #ebf7f9; border: none; box-shadow: none; width: 32px; height: 32px; opacity: 1; transform: scale(1); } :active::before { background-color: #f5f5f5; border: none; box-shadow: none; opacity: 1; transform: scale(1); } `} `; export const CheckContainer = styled.div` display: inline-flex; position: relative; justify-content: center; align-items: center; border-radius: 50%; width: 16px; height: 16px; border: 2px solid ${p => (p.checked && !p.disabled ? p.theme.brand : p.disabled ? '#ced1d7' : 'rgba(0,0,0,0.25)')}; `; CheckContainer.defaultProps = { theme }; export const Checked = styled.div` position: absolute; border-radius: 50%; width: 8px; height: 8px; background: ${p => (p.disabled ? '#ced1d7' : p.theme.brand)}; `; Checked.defaultProps = { theme }; export const Label = styled.span` font-size: 14px; user-select: none; letter-spacing: 0.3px; text-align: left; line-height: 32px; `;