diff --git a/components/style/index.ts b/components/style/index.ts index 633abf3310..04ae8ba623 100644 --- a/components/style/index.ts +++ b/components/style/index.ts @@ -2,7 +2,7 @@ import { unit } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs'; -import type { AliasToken, DerivativeToken } from '../theme/internal'; +import type { AliasToken } from '../theme/internal'; export { operationUnit } from './operationUnit'; @@ -13,7 +13,7 @@ export const textEllipsis: CSSObject = { }; export const resetComponent = ( - token: DerivativeToken, + token: AliasToken, needInheritFontFamily = false, ): CSSObject => ({ boxSizing: 'border-box', @@ -66,7 +66,7 @@ export const clearFix = (): CSSObject => ({ }, }); -export const genLinkStyle = (token: DerivativeToken): CSSObject => ({ +export const genLinkStyle = (token: AliasToken): CSSObject => ({ a: { color: token.colorLink, textDecoration: token.linkDecoration, @@ -103,7 +103,7 @@ export const genLinkStyle = (token: DerivativeToken): CSSObject => ({ }); export const genCommonStyle = ( - token: DerivativeToken, + token: AliasToken, componentPrefixCls: string, rootCls?: string, resetFont?: boolean, @@ -144,7 +144,7 @@ export const genFocusOutline = (token: AliasToken): CSSObject => ({ transition: 'outline-offset 0s, outline 0s', }); -export const genFocusStyle = (token: DerivativeToken): CSSObject => ({ +export const genFocusStyle = (token: AliasToken): CSSObject => ({ '&:focus-visible': { ...genFocusOutline(token), }, diff --git a/components/style/operationUnit.ts b/components/style/operationUnit.ts index 1ba44e897a..055b43c7fa 100644 --- a/components/style/operationUnit.ts +++ b/components/style/operationUnit.ts @@ -1,9 +1,9 @@ import type { CSSObject } from '@ant-design/cssinjs'; -import type { DerivativeToken } from '../theme/internal'; +import type { AliasToken } from '../theme/internal'; // eslint-disable-next-line import/prefer-default-export -export const operationUnit = (token: DerivativeToken): CSSObject => ({ +export const operationUnit = (token: AliasToken): CSSObject => ({ // FIXME: This use link but is a operation unit. Seems should be a colorPrimary. // And Typography use this to generate link style which should not do this. color: token.colorLink, diff --git a/components/theme/internal.ts b/components/theme/internal.ts index 46ee5bba10..5dd0665b39 100644 --- a/components/theme/internal.ts +++ b/components/theme/internal.ts @@ -51,8 +51,6 @@ export { }; export type { AliasToken, - // FIXME: Remove this type - AliasToken as DerivativeToken, FullToken, OverrideComponent, GenerateStyle, diff --git a/components/theme/useToken.ts b/components/theme/useToken.ts index ef2fa912eb..de4a4405a9 100644 --- a/components/theme/useToken.ts +++ b/components/theme/useToken.ts @@ -5,7 +5,7 @@ import { useCacheToken } from '@ant-design/cssinjs'; import version from '../version'; import type { DesignTokenProviderProps } from './context'; import { defaultTheme, DesignTokenContext } from './context'; -import type { AliasToken, GlobalToken, MapToken, SeedToken } from './interface'; +import type { AliasToken, GlobalToken, SeedToken } from './interface'; import defaultSeedToken from './themes/seed'; import formatToken from './util/alias'; @@ -111,7 +111,7 @@ export const getComputedToken = ( // ================================== Hook ================================== export default function useToken(): [ - theme: Theme, + theme: Theme, token: GlobalToken, hashId: string, realToken: GlobalToken, diff --git a/components/tree/style/index.ts b/components/tree/style/index.ts index de229cf97d..5602394b92 100644 --- a/components/tree/style/index.ts +++ b/components/tree/style/index.ts @@ -6,7 +6,6 @@ import { genFocusOutline, resetComponent } from '../../style'; import { genCollapseMotion } from '../../style/motion'; import type { AliasToken, - DerivativeToken, FullToken, GetDefaultToken, CSSUtil, @@ -55,7 +54,7 @@ const treeNodeFX = new Keyframes('ant-tree-node-fx-do-not-use', { }); // ============================== Switch ============================== -const getSwitchStyle = (prefixCls: string, token: DerivativeToken): CSSObject => ({ +const getSwitchStyle = (prefixCls: string, token: AliasToken): CSSObject => ({ [`.${prefixCls}-switcher-icon`]: { display: 'inline-block', fontSize: 10, @@ -68,7 +67,7 @@ const getSwitchStyle = (prefixCls: string, token: DerivativeToken): CSSObject => }); // =============================== Drop =============================== -const getDropIndicatorStyle = (prefixCls: string, token: DerivativeToken) => ({ +const getDropIndicatorStyle = (prefixCls: string, token: AliasToken) => ({ [`.${prefixCls}-drop-indicator`]: { position: 'absolute', // it should displayed over the following node