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

This commit is contained in:
🏎️ Yumo 2024-07-23 16:45:02 +08:00
parent 6840adb3c6
commit 64f26bd970
9 changed files with 19 additions and 10 deletions

View File

@ -1,6 +1,6 @@
import React from 'react';
import type { GlobalToken } from '../theme/interface';
import type { GlobalToken } from '../theme/internal';
import { useToken } from '../theme/internal';
export type Breakpoint = 'xxl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs';

View File

@ -1,5 +1,5 @@
import { defaultPrefixCls } from '../../config-provider';
import type { GlobalToken } from '../../theme';
import type { GlobalToken } from '../../theme/internal';
export const TARGET_CLS = `${defaultPrefixCls}-wave-target`;

View File

@ -1,8 +1,7 @@
import type { CSSProperties } from 'react';
import { genCompactItemStyle } from '../../style/compact-item';
import type { GlobalToken } from '../../theme';
import type { FullToken, GenerateStyle } from '../../theme/internal';
import type { FullToken, GenerateStyle, GlobalToken } from '../../theme/internal';
import { genStyleHooks } from '../../theme/internal';
import getColumnsStyle from './columns';

View File

@ -7,7 +7,7 @@ import { Button, InputNumber, Select } from '../..';
import { resetWarned } from '../../_util/warning';
import { render } from '../../../tests/utils';
import theme from '../../theme';
import type { GlobalToken } from '../../theme';
import type { GlobalToken } from '../../theme/internal';
import { useToken } from '../../theme/internal';
const { defaultAlgorithm, darkAlgorithm, compactAlgorithm } = theme;

View File

@ -5,7 +5,7 @@ import { initComponentToken } from '../../input/style/token';
import type { MultipleSelectorToken, SelectorToken } from '../../select/style/token';
import type { ArrowToken } from '../../style/roundedArrow';
import { getArrowToken } from '../../style/roundedArrow';
import type { GlobalToken } from '../../theme/interface';
import type { GlobalToken } from '../../theme/internal';
import type {
FullToken,
GetDefaultToken,

View File

@ -3,8 +3,7 @@ import { unit } from '@ant-design/cssinjs';
import { genFocusStyle, resetComponent } from '../../style';
import { initFadeMotion, initZoomMotion } from '../../style/motion';
import type { GlobalToken } from '../../theme';
import type { AliasToken, FullToken, GenerateStyle } from '../../theme/internal';
import type { AliasToken, FullToken, GenerateStyle, GlobalToken } from '../../theme/internal';
import { genStyleHooks, mergeToken } from '../../theme/internal';
import type { GenStyleFn, TokenWithCommonCls } from '../../theme/util/genComponentStyleHook';

View File

@ -0,0 +1,10 @@
import type {
GlobalToken as GlobalTokenTypeUtil,
} from '@ant-design/cssinjs-utils';
import type { AliasToken } from './alias';
import type { ComponentTokenMap } from './components';
/** Final token which contains the components level override */
export type GlobalToken = GlobalTokenTypeUtil<ComponentTokenMap, AliasToken>;

View File

@ -12,8 +12,7 @@ export type OverrideToken = {
[key in keyof ComponentTokenMap]: Partial<ComponentTokenMap[key]> & Partial<AliasToken>;
};
/** Final token which contains the components level override */
export type GlobalToken = AliasToken & ComponentTokenMap;
export type { GlobalToken } from './cssinjs-utils';
export type { AliasToken } from './alias';
export type { ComponentTokenMap } from './components';

View File

@ -6,6 +6,7 @@ import type {
PresetColorKey,
PresetColorType,
SeedToken,
GlobalToken,
UseComponentStyleResult,
} from './interface';
import { PresetColors } from './interface';
@ -47,4 +48,5 @@ export type {
SeedToken,
UseComponentStyleResult,
GetDefaultToken,
GlobalToken,
};