mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 20:49:53 +08:00
refactor(theme): migrate and refactor type GlobalToken
by @ant-design/cssinjs-utils
This commit is contained in:
parent
6840adb3c6
commit
64f26bd970
@ -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';
|
||||
|
@ -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`;
|
||||
|
||||
|
@ -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';
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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';
|
||||
|
||||
|
10
components/theme/interface/cssinjs-utils.ts
Normal file
10
components/theme/interface/cssinjs-utils.ts
Normal 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>;
|
@ -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';
|
||||
|
@ -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,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user