|
|
@ -1,4 +1,3 @@ |
|
|
|
import { Keyframes } from '@ant-design/cssinjs'; |
|
|
|
import type { FullToken, GenerateStyle } from '../../theme/internal'; |
|
|
|
import { genComponentStyleHook, mergeToken } from '../../theme/internal'; |
|
|
|
import { genFocusOutline, resetComponent } from '../../style'; |
|
|
@ -30,11 +29,6 @@ interface RadioToken extends FullToken<'Radio'> { |
|
|
|
} |
|
|
|
|
|
|
|
// ============================== Styles ==============================
|
|
|
|
const antRadioEffect = new Keyframes('antRadioEffect', { |
|
|
|
'0%': { transform: 'scale(1)', opacity: 0.5 }, |
|
|
|
'100%': { transform: 'scale(1.6)', opacity: 0 }, |
|
|
|
}); |
|
|
|
|
|
|
|
// styles from RadioGroup only
|
|
|
|
const getGroupRadioStyle: GenerateStyle<RadioToken> = (token) => { |
|
|
|
const { componentCls, antCls } = token; |
|
|
@ -71,7 +65,6 @@ const getRadioBasicStyle: GenerateStyle<RadioToken> = (token) => { |
|
|
|
radioSize, |
|
|
|
motionDurationSlow, |
|
|
|
motionDurationMid, |
|
|
|
motionEaseInOut, |
|
|
|
motionEaseInOutCirc, |
|
|
|
radioButtonBg, |
|
|
|
colorBorder, |
|
|
@ -91,7 +84,6 @@ const getRadioBasicStyle: GenerateStyle<RadioToken> = (token) => { |
|
|
|
return { |
|
|
|
[`${componentCls}-wrapper`]: { |
|
|
|
...resetComponent(token), |
|
|
|
position: 'relative', |
|
|
|
display: 'inline-flex', |
|
|
|
alignItems: 'baseline', |
|
|
|
marginInlineStart: 0, |
|
|
@ -124,10 +116,6 @@ const getRadioBasicStyle: GenerateStyle<RadioToken> = (token) => { |
|
|
|
border: `${lineWidth}px ${lineType} ${radioCheckedColor}`, |
|
|
|
borderRadius: '50%', |
|
|
|
visibility: 'hidden', |
|
|
|
animationName: antRadioEffect, |
|
|
|
animationDuration: motionDurationSlow, |
|
|
|
animationTimingFunction: motionEaseInOut, |
|
|
|
animationFillMode: 'both', |
|
|
|
content: '""', |
|
|
|
}, |
|
|
|
|
|
|
@ -138,6 +126,7 @@ const getRadioBasicStyle: GenerateStyle<RadioToken> = (token) => { |
|
|
|
outline: 'none', |
|
|
|
cursor: 'pointer', |
|
|
|
alignSelf: 'center', |
|
|
|
borderRadius: '50%', |
|
|
|
}, |
|
|
|
|
|
|
|
[`${componentCls}-wrapper:hover &,
|
|
|
@ -192,9 +181,11 @@ const getRadioBasicStyle: GenerateStyle<RadioToken> = (token) => { |
|
|
|
[`${componentCls}-input`]: { |
|
|
|
position: 'absolute', |
|
|
|
insetBlockStart: 0, |
|
|
|
insetInlineEnd: 0, |
|
|
|
insetBlockEnd: 0, |
|
|
|
insetInlineStart: 0, |
|
|
|
width: 0, |
|
|
|
height: 0, |
|
|
|
padding: 0, |
|
|
|
margin: 0, |
|
|
|
zIndex: 1, |
|
|
|
cursor: 'pointer', |
|
|
|
opacity: 0, |
|
|
|