2022-12-28 23:20:22 +08:00
|
|
|
import { genComponentStyleHook } from '../../theme/internal';
|
|
|
|
import type { FullToken, GenerateStyle } from '../../theme/internal';
|
2022-06-28 01:49:37 +08:00
|
|
|
|
2022-12-28 23:20:22 +08:00
|
|
|
export interface ComponentToken {}
|
2022-06-28 01:49:37 +08:00
|
|
|
|
2022-12-28 23:20:22 +08:00
|
|
|
export interface WaveToken extends FullToken<'Wave'> {}
|
2022-06-28 01:49:37 +08:00
|
|
|
|
2022-12-28 23:20:22 +08:00
|
|
|
const genWaveStyle: GenerateStyle<WaveToken> = (token) => {
|
|
|
|
const { componentCls, colorPrimary } = token;
|
|
|
|
return {
|
|
|
|
[componentCls]: {
|
2023-01-02 16:34:35 +08:00
|
|
|
position: 'absolute',
|
2022-12-28 23:20:22 +08:00
|
|
|
background: 'transparent',
|
|
|
|
pointerEvents: 'none',
|
|
|
|
boxSizing: 'border-box',
|
|
|
|
color: `var(--wave-color, ${colorPrimary})`,
|
|
|
|
|
|
|
|
boxShadow: `0 0 0 0 currentcolor`,
|
|
|
|
opacity: 0.2,
|
|
|
|
|
|
|
|
// =================== Motion ===================
|
|
|
|
'&.wave-motion-appear': {
|
|
|
|
transition: [
|
|
|
|
`box-shadow 0.4s ${token.motionEaseOutCirc}`,
|
|
|
|
`opacity 2s ${token.motionEaseOutCirc}`,
|
|
|
|
].join(','),
|
|
|
|
|
|
|
|
'&-active': {
|
2023-01-02 16:34:35 +08:00
|
|
|
boxShadow: `0 0 0 6px currentcolor`,
|
2022-12-28 23:20:22 +08:00
|
|
|
opacity: 0,
|
2022-06-28 15:20:09 +08:00
|
|
|
},
|
2023-08-04 11:22:33 +08:00
|
|
|
|
|
|
|
'&.wave-quick': {
|
|
|
|
transition: [
|
|
|
|
`box-shadow 0.3s ${token.motionEaseInOut}`,
|
|
|
|
`opacity 0.35s ${token.motionEaseInOut}`,
|
|
|
|
].join(','),
|
|
|
|
},
|
2022-06-28 01:49:37 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
2022-12-28 23:20:22 +08:00
|
|
|
|
|
|
|
export default genComponentStyleHook('Wave', (token) => [genWaveStyle(token)]);
|