mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-12 23:35:38 +08:00
59ad48476b
* chore: add boime lint * fix lint * use files ignore * revert change * ignore clarity.js * fix some errors * fix some errors * fix some errors * fix some errors * add yml file * Update clarity.js Signed-off-by: afc163 <afc163@gmail.com> * add npm run lint:biome * add npm run lint:biome * fix test case * fix ts errors * fix ts errors * fix lint and add .lintstagedrc * shorten prop name * chore: update package.json * update biome.json * chore: remove stylelint * chore: useOptionalChain * fix lint * biome format * prettier all code * prettier all code * fix site test --------- Signed-off-by: afc163 <afc163@gmail.com>
45 lines
1.3 KiB
TypeScript
45 lines
1.3 KiB
TypeScript
import { genComponentStyleHook } from '../../theme/internal';
|
|
import type { FullToken, GenerateStyle } from '../../theme/internal';
|
|
|
|
// biome-ignore lint/suspicious/noEmptyInterface: ComponentToken need to be empty by default
|
|
export interface ComponentToken {}
|
|
|
|
export interface WaveToken extends FullToken<'Wave'> {}
|
|
|
|
const genWaveStyle: GenerateStyle<WaveToken> = (token) => {
|
|
const { componentCls, colorPrimary } = token;
|
|
return {
|
|
[componentCls]: {
|
|
position: 'absolute',
|
|
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': {
|
|
boxShadow: `0 0 0 6px currentcolor`,
|
|
opacity: 0,
|
|
},
|
|
'&.wave-quick': {
|
|
transition: [
|
|
`box-shadow ${token.motionDurationSlow} ${token.motionEaseInOut}`,
|
|
`opacity ${token.motionDurationSlow} ${token.motionEaseInOut}`,
|
|
].join(','),
|
|
},
|
|
},
|
|
},
|
|
};
|
|
};
|
|
|
|
export default genComponentStyleHook('Wave', (token) => [genWaveStyle(token)]);
|