refactor(theme): migrate and refactor type TokenWithCommonCls by @ant-design/cssinjs-utils

This commit is contained in:
🏎️ Yumo 2024-07-23 17:49:35 +08:00
parent 965b68cfea
commit 5019af42b5
11 changed files with 11 additions and 21 deletions

View File

@ -9,10 +9,8 @@ import type {
GlobalToken,
FullToken,
GetDefaultToken,
} from '../../theme/internal';
import type {
TokenWithCommonCls,
} from '../../theme/util/genComponentStyleHook';
} from '../../theme/internal';
export interface PanelComponentToken extends MultipleSelectorToken {
/**

View File

@ -9,9 +9,9 @@ import type {
GenerateStyle,
GlobalToken,
GenStyleFn,
TokenWithCommonCls,
} from '../../theme/internal';
import { genStyleHooks, mergeToken } from '../../theme/internal';
import type { TokenWithCommonCls } from '../../theme/util/genComponentStyleHook';
/** Component only token. Which will handle additional calculation of alias token */
export interface ComponentToken {

View File

@ -3,8 +3,7 @@ import { unit } from '@ant-design/cssinjs';
import { resetIcon } from '../../style';
import { mergeToken } from '../../theme/internal';
import type { AliasToken } from '../../theme/internal';
import type { TokenWithCommonCls } from '../../theme/util/genComponentStyleHook';
import type { AliasToken, TokenWithCommonCls } from '../../theme/internal';
import type { SelectToken } from './token';
type SelectItemToken = Pick<

View File

@ -1,5 +1,4 @@
import type { AliasToken, GenerateStyle } from '../../theme/internal';
import type { TokenWithCommonCls } from '../../theme/util/genComponentStyleHook';
import type { AliasToken, GenerateStyle, TokenWithCommonCls } from '../../theme/internal';
const genCollapseMotion: GenerateStyle<TokenWithCommonCls<AliasToken>> = (token) => ({
[token.componentCls]: {

View File

@ -1,8 +1,7 @@
import type { CSSInterpolation } from '@ant-design/cssinjs';
import { Keyframes } from '@ant-design/cssinjs';
import type { AliasToken } from '../../theme/internal';
import type { TokenWithCommonCls } from '../../theme/util/genComponentStyleHook';
import type { AliasToken, TokenWithCommonCls } from '../../theme/internal';
import { initMotion } from './motion';
export const fadeIn = new Keyframes('antFadeIn', {

View File

@ -1,8 +1,7 @@
import type { CSSInterpolation } from '@ant-design/cssinjs';
import { Keyframes } from '@ant-design/cssinjs';
import type { AliasToken } from '../../theme/internal';
import type { TokenWithCommonCls } from '../../theme/util/genComponentStyleHook';
import type { AliasToken, TokenWithCommonCls } from '../../theme/internal';
import { initMotion } from './motion';
export const moveDownIn = new Keyframes('antMoveDownIn', {

View File

@ -1,8 +1,7 @@
import type { CSSInterpolation } from '@ant-design/cssinjs';
import { Keyframes } from '@ant-design/cssinjs';
import type { AliasToken } from '../../theme/internal';
import type { TokenWithCommonCls } from '../../theme/util/genComponentStyleHook';
import type { AliasToken, TokenWithCommonCls } from '../../theme/internal';
import { initMotion } from './motion';
export const slideUpIn = new Keyframes('antSlideUpIn', {

View File

@ -1,8 +1,7 @@
import type { CSSInterpolation } from '@ant-design/cssinjs';
import { Keyframes } from '@ant-design/cssinjs';
import type { AliasToken } from '../../theme/internal';
import type { TokenWithCommonCls } from '../../theme/util/genComponentStyleHook';
import type { AliasToken, TokenWithCommonCls } from '../../theme/internal';
import { initMotion } from './motion';
export const zoomIn = new Keyframes('antZoomIn', {

View File

@ -1,7 +1,6 @@
import type { CSSInterpolation, CSSObject } from '@ant-design/cssinjs';
import type { AliasToken } from '../theme/internal';
import type { TokenWithCommonCls } from '../theme/util/genComponentStyleHook';
import type { AliasToken, TokenWithCommonCls } from '../theme/internal';
import type { ArrowToken } from './roundedArrow';
import { genRoundedArrow } from './roundedArrow';

View File

@ -29,7 +29,7 @@ import genComponentStyleHook, {
import genPresetColor from './util/genPresetColor';
import useResetIconStyle from './util/useResetIconStyle';
export type { CSSUtil } from '@ant-design/cssinjs-utils';
export type { CSSUtil, TokenWithCommonCls } from '@ant-design/cssinjs-utils';
export { DesignTokenContext, defaultConfig } from './context';
export {

View File

@ -2,8 +2,7 @@
import type { CSSObject } from '@ant-design/cssinjs';
import { PresetColors } from '../interface';
import type { AliasToken, PresetColorKey } from '../internal';
import type { TokenWithCommonCls } from './genComponentStyleHook';
import type { AliasToken, PresetColorKey, TokenWithCommonCls } from '../internal';
interface CalcColor {
/** token[`${colorKey}-1`] */