fui-fancyui
Version:
FancyUI Libary
57 lines (55 loc) • 1.52 kB
JavaScript
import { styled as i } from "styled-components";
import { getBackgroundColor as n } from "../../../design/designFunctions/colorCalculatorForComponent/colorCalculatorForComponent.js";
const p = i.div`
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 20px;
height: 20px;
flex-shrink: 0;
`, d = i.input.attrs({ type: "radio" })`
margin: 0;
position: absolute;
cursor: pointer;
opacity: 1;
background-color: transparent;
z-index: 1;
appearance: none;
outline: none;
width: 16px;
height: 16px;
`, c = i.span`
width: 16px;
height: 16px;
border: 2px solid;
border-color: ${({ $checked: r, $layer: o, $themeType: e = "primary", theme: t }) => r ? t.color.accent[2] : n({ theme: t, $themeType: e, $layer: o })};
background: ${({ $checked: r, $layer: o, $themeType: e = "primary", theme: t }) => r ? "transparent" : n({ theme: t, $themeType: e, $layer: o })};
border-radius: 50%;
display: inline-block;
position: relative;
flex-shrink: 0;
z-index: 0;
transition:
background 0.2s ease,
border-color 0.2s ease;
&:after {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 10px;
height: 10px;
border-radius: 50%;
background: ${({ $checked: r, theme: o }) => r ? o.color.accent[1] : "transparent"};
transition:
background 0.2s ease,
border-color 0.2s ease;
}
`;
export {
d as HiddenRadio,
p as RadioWrapper,
c as StyledRadio
};