@chayns-components/core
Version:
A set of beautiful React components for developing your own applications with chayns.
162 lines (158 loc) • 3.34 kB
JavaScript
import { motion } from 'motion/react';
import styled, { css } from 'styled-components';
export const StyledRadioButton = styled.span`
display: flex;
flex-direction: column;
position: relative;
opacity: ${_ref => {
let {
$isDisabled
} = _ref;
return $isDisabled ? 0.5 : 1;
}};
${_ref2 => {
let {
$radioButtonRightElementMargin
} = _ref2;
switch ($radioButtonRightElementMargin) {
case 'BOTH':
return css`
margin: 6px 0;
`;
case 'TOP':
return css`
margin-top: 6px;
`;
case 'BOTTOM':
return css`
margin-bottom: 6px;
`;
case 'NONE':
default:
return css`
margin: 0;
`;
}
}}
`;
export const StyledRadioButtonWrapper = styled.div`
display: flex;
align-items: center;
position: relative;
gap: 5px;
user-select: none;
`;
export const StyledRadioButtonCheckBox = styled.input`
opacity: 0;
height: 15px;
width: 15px;
cursor: ${_ref3 => {
let {
$isDisabled
} = _ref3;
return $isDisabled ? 'default !important' : 'pointer !important';
}};
`;
export const StyledRadioButtonPseudoCheckBox = styled.div`
background-color: ${_ref4 => {
let {
theme,
$isChecked
} = _ref4;
return $isChecked ? theme['secondary-408'] : theme['secondary-403'];
}};
opacity: 1;
border: 1px solid
rgba(${_ref5 => {
let {
theme
} = _ref5;
return theme['409-rgb'];
}}, 0.5);
width: 15px;
height: 15px;
position: absolute;
border-radius: 100%;
top: 50%;
transform: translateY(-50%);
cursor: ${_ref6 => {
let {
$isDisabled
} = _ref6;
return $isDisabled ? 'default !important' : 'pointer !important';
}};
`;
export const StyledRadioButtonCheckBoxMark = styled.span`
background-color: transparent;
position: absolute;
top: 1px;
left: 3.925px;
display: inline-block;
transform: rotate(35deg);
height: 9px;
width: 5px;
border-bottom: 2px solid white;
border-right: 2px solid white;
border-top: transparent;
border-left: transparent;
z-index: 2;
cursor: ${_ref7 => {
let {
$isDisabled
} = _ref7;
return $isDisabled ? 'default !important' : 'pointer !important';
}};
${_ref8 => {
let {
$isHovered,
$isSelected
} = _ref8;
if ($isSelected) {
return css`
opacity: 1;
`;
}
if ($isHovered) {
return css`
opacity: 0.5;
`;
}
return css`
opacity: 0;
`;
}}
`;
export const StyledRadioButtonLabel = styled.p`
color: ${_ref9 => {
let {
theme
} = _ref9;
return theme.text;
}};
margin: 0;
cursor: ${_ref0 => {
let {
$isDisabled
} = _ref0;
return $isDisabled ? 'default !important' : 'pointer !important';
}};
`;
export const StyledLabelWrapper = styled.div`
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
gap: 12px;
`;
export const StyledMotionRadioButtonChildren = styled(motion.div)`
margin-left: 20px;
cursor: text;
overflow: hidden;
color: ${_ref1 => {
let {
theme
} = _ref1;
return theme.text;
}};
`;
//# sourceMappingURL=RadioButton.styles.js.map