mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 17:44:35 +08:00
refactor(theme): migrate and refactor type TokenWithCommonCls
by @ant-design/cssinjs-utils
This commit is contained in:
parent
965b68cfea
commit
5019af42b5
@ -9,10 +9,8 @@ import type {
|
|||||||
GlobalToken,
|
GlobalToken,
|
||||||
FullToken,
|
FullToken,
|
||||||
GetDefaultToken,
|
GetDefaultToken,
|
||||||
} from '../../theme/internal';
|
|
||||||
import type {
|
|
||||||
TokenWithCommonCls,
|
TokenWithCommonCls,
|
||||||
} from '../../theme/util/genComponentStyleHook';
|
} from '../../theme/internal';
|
||||||
|
|
||||||
export interface PanelComponentToken extends MultipleSelectorToken {
|
export interface PanelComponentToken extends MultipleSelectorToken {
|
||||||
/**
|
/**
|
||||||
|
@ -9,9 +9,9 @@ import type {
|
|||||||
GenerateStyle,
|
GenerateStyle,
|
||||||
GlobalToken,
|
GlobalToken,
|
||||||
GenStyleFn,
|
GenStyleFn,
|
||||||
|
TokenWithCommonCls,
|
||||||
} from '../../theme/internal';
|
} from '../../theme/internal';
|
||||||
import { genStyleHooks, mergeToken } 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 */
|
/** Component only token. Which will handle additional calculation of alias token */
|
||||||
export interface ComponentToken {
|
export interface ComponentToken {
|
||||||
|
@ -3,8 +3,7 @@ import { unit } from '@ant-design/cssinjs';
|
|||||||
|
|
||||||
import { resetIcon } from '../../style';
|
import { resetIcon } from '../../style';
|
||||||
import { mergeToken } from '../../theme/internal';
|
import { mergeToken } from '../../theme/internal';
|
||||||
import type { AliasToken } from '../../theme/internal';
|
import type { AliasToken, TokenWithCommonCls } from '../../theme/internal';
|
||||||
import type { TokenWithCommonCls } from '../../theme/util/genComponentStyleHook';
|
|
||||||
import type { SelectToken } from './token';
|
import type { SelectToken } from './token';
|
||||||
|
|
||||||
type SelectItemToken = Pick<
|
type SelectItemToken = Pick<
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import type { AliasToken, GenerateStyle } from '../../theme/internal';
|
import type { AliasToken, GenerateStyle, TokenWithCommonCls } from '../../theme/internal';
|
||||||
import type { TokenWithCommonCls } from '../../theme/util/genComponentStyleHook';
|
|
||||||
|
|
||||||
const genCollapseMotion: GenerateStyle<TokenWithCommonCls<AliasToken>> = (token) => ({
|
const genCollapseMotion: GenerateStyle<TokenWithCommonCls<AliasToken>> = (token) => ({
|
||||||
[token.componentCls]: {
|
[token.componentCls]: {
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
import type { CSSInterpolation } from '@ant-design/cssinjs';
|
import type { CSSInterpolation } from '@ant-design/cssinjs';
|
||||||
import { Keyframes } from '@ant-design/cssinjs';
|
import { Keyframes } from '@ant-design/cssinjs';
|
||||||
|
|
||||||
import type { AliasToken } from '../../theme/internal';
|
import type { AliasToken, TokenWithCommonCls } from '../../theme/internal';
|
||||||
import type { TokenWithCommonCls } from '../../theme/util/genComponentStyleHook';
|
|
||||||
import { initMotion } from './motion';
|
import { initMotion } from './motion';
|
||||||
|
|
||||||
export const fadeIn = new Keyframes('antFadeIn', {
|
export const fadeIn = new Keyframes('antFadeIn', {
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
import type { CSSInterpolation } from '@ant-design/cssinjs';
|
import type { CSSInterpolation } from '@ant-design/cssinjs';
|
||||||
import { Keyframes } from '@ant-design/cssinjs';
|
import { Keyframes } from '@ant-design/cssinjs';
|
||||||
|
|
||||||
import type { AliasToken } from '../../theme/internal';
|
import type { AliasToken, TokenWithCommonCls } from '../../theme/internal';
|
||||||
import type { TokenWithCommonCls } from '../../theme/util/genComponentStyleHook';
|
|
||||||
import { initMotion } from './motion';
|
import { initMotion } from './motion';
|
||||||
|
|
||||||
export const moveDownIn = new Keyframes('antMoveDownIn', {
|
export const moveDownIn = new Keyframes('antMoveDownIn', {
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
import type { CSSInterpolation } from '@ant-design/cssinjs';
|
import type { CSSInterpolation } from '@ant-design/cssinjs';
|
||||||
import { Keyframes } from '@ant-design/cssinjs';
|
import { Keyframes } from '@ant-design/cssinjs';
|
||||||
|
|
||||||
import type { AliasToken } from '../../theme/internal';
|
import type { AliasToken, TokenWithCommonCls } from '../../theme/internal';
|
||||||
import type { TokenWithCommonCls } from '../../theme/util/genComponentStyleHook';
|
|
||||||
import { initMotion } from './motion';
|
import { initMotion } from './motion';
|
||||||
|
|
||||||
export const slideUpIn = new Keyframes('antSlideUpIn', {
|
export const slideUpIn = new Keyframes('antSlideUpIn', {
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
import type { CSSInterpolation } from '@ant-design/cssinjs';
|
import type { CSSInterpolation } from '@ant-design/cssinjs';
|
||||||
import { Keyframes } from '@ant-design/cssinjs';
|
import { Keyframes } from '@ant-design/cssinjs';
|
||||||
|
|
||||||
import type { AliasToken } from '../../theme/internal';
|
import type { AliasToken, TokenWithCommonCls } from '../../theme/internal';
|
||||||
import type { TokenWithCommonCls } from '../../theme/util/genComponentStyleHook';
|
|
||||||
import { initMotion } from './motion';
|
import { initMotion } from './motion';
|
||||||
|
|
||||||
export const zoomIn = new Keyframes('antZoomIn', {
|
export const zoomIn = new Keyframes('antZoomIn', {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import type { CSSInterpolation, CSSObject } from '@ant-design/cssinjs';
|
import type { CSSInterpolation, CSSObject } from '@ant-design/cssinjs';
|
||||||
|
|
||||||
import type { AliasToken } from '../theme/internal';
|
import type { AliasToken, TokenWithCommonCls } from '../theme/internal';
|
||||||
import type { TokenWithCommonCls } from '../theme/util/genComponentStyleHook';
|
|
||||||
import type { ArrowToken } from './roundedArrow';
|
import type { ArrowToken } from './roundedArrow';
|
||||||
import { genRoundedArrow } from './roundedArrow';
|
import { genRoundedArrow } from './roundedArrow';
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ import genComponentStyleHook, {
|
|||||||
import genPresetColor from './util/genPresetColor';
|
import genPresetColor from './util/genPresetColor';
|
||||||
import useResetIconStyle from './util/useResetIconStyle';
|
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 { DesignTokenContext, defaultConfig } from './context';
|
||||||
export {
|
export {
|
||||||
|
@ -2,8 +2,7 @@
|
|||||||
import type { CSSObject } from '@ant-design/cssinjs';
|
import type { CSSObject } from '@ant-design/cssinjs';
|
||||||
|
|
||||||
import { PresetColors } from '../interface';
|
import { PresetColors } from '../interface';
|
||||||
import type { AliasToken, PresetColorKey } from '../internal';
|
import type { AliasToken, PresetColorKey, TokenWithCommonCls } from '../internal';
|
||||||
import type { TokenWithCommonCls } from './genComponentStyleHook';
|
|
||||||
|
|
||||||
interface CalcColor {
|
interface CalcColor {
|
||||||
/** token[`${colorKey}-1`] */
|
/** token[`${colorKey}-1`] */
|
||||||
|
Loading…
Reference in New Issue
Block a user