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

This commit is contained in:
🏎️ Yumo 2024-07-23 17:23:43 +08:00
parent 3ec77d32b0
commit 9e8a550218
7 changed files with 35 additions and 12 deletions

View File

@ -1,9 +1,13 @@
import type { CSSObject } from '@ant-design/cssinjs';
import { Keyframes, unit } from '@ant-design/cssinjs';
import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal';
import type {
FullToken,
GenerateStyle,
GetDefaultToken,
CSSUtil,
} from '../../theme/internal';
import { genStyleHooks, mergeToken } from '../../theme/internal';
import type { CSSUtil } from '../../theme/util/genComponentStyleHook';
export type ComponentToken = {
/** @deprecated use gradientFromColor instead. */

View File

@ -1,8 +1,12 @@
/* eslint-disable import/prefer-default-export */
import type { CSSInterpolation, CSSObject } from '@ant-design/cssinjs';
import type { AliasToken, FullToken, OverrideComponent } from '../theme/internal';
import type { CSSUtil } from '../theme/util/genComponentStyleHook';
import type {
AliasToken,
FullToken,
OverrideComponent,
CSSUtil,
} from '../theme/internal';
function compactItemVerticalBorder(token: AliasToken & CSSUtil, parentCls: string): CSSObject {
return {

View File

@ -1,8 +1,12 @@
/* eslint-disable import/prefer-default-export */
import type { CSSInterpolation, CSSObject } from '@ant-design/cssinjs';
import type { AliasToken, FullToken, OverrideComponent } from '../theme/internal';
import type { CSSUtil } from '../theme/util/genComponentStyleHook';
import type {
AliasToken,
FullToken,
OverrideComponent,
CSSUtil,
} from '../theme/internal';
interface CompactItemOptions {
focus?: boolean;

View File

@ -1,8 +1,7 @@
/* eslint-disable import/prefer-default-export */
import type { CSSObject } from '@ant-design/cssinjs';
import { unit } from '@ant-design/cssinjs';
import type { CSSUtil } from 'antd/es/theme/util/genComponentStyleHook';
import type { CSSUtil } from '../theme/internal';
import type { AliasToken } from '../theme/interface';
export interface ArrowToken {

View File

@ -24,6 +24,8 @@ import genPresetColor from './util/genPresetColor';
import statisticToken, { merge as mergeToken } from './util/statistic';
import useResetIconStyle from './util/useResetIconStyle';
export type { CSSUtil } from '@ant-design/cssinjs-utils';
export { DesignTokenContext, defaultConfig } from './context';
export {
PresetColors,

View File

@ -1,9 +1,14 @@
import { unit } from '@ant-design/cssinjs';
import { getStyle as getCheckboxStyle } from '../../checkbox/style';
import type { AliasToken, FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal';
import type {
AliasToken,
FullToken,
GenerateStyle,
GetDefaultToken,
CSSUtil,
} from '../../theme/internal';
import { genStyleHooks, mergeToken } from '../../theme/internal';
import type { CSSUtil } from '../../theme/util/genComponentStyleHook';
import type { TreeSharedToken } from '../../tree/style';
import { genTreeStyle, initComponentToken } from '../../tree/style';

View File

@ -4,9 +4,14 @@ import { Keyframes, unit } from '@ant-design/cssinjs';
import { getStyle as getCheckboxStyle } from '../../checkbox/style';
import { genFocusOutline, resetComponent } from '../../style';
import { genCollapseMotion } from '../../style/motion';
import type { AliasToken, DerivativeToken, FullToken, GetDefaultToken } from '../../theme/internal';
import type {
AliasToken,
DerivativeToken,
FullToken,
GetDefaultToken,
CSSUtil,
} from '../../theme/internal';
import { genStyleHooks, mergeToken } from '../../theme/internal';
import type { CSSUtil } from '../../theme/util/genComponentStyleHook';
export interface TreeSharedToken {
/**