2022-03-21 16:48:25 +08:00
|
|
|
import * as React from 'react';
|
|
|
|
|
|
|
|
export const PresetColors = [
|
|
|
|
'blue',
|
|
|
|
'purple',
|
|
|
|
'cyan',
|
|
|
|
'green',
|
|
|
|
'magenta',
|
|
|
|
'pink',
|
|
|
|
'red',
|
|
|
|
'orange',
|
|
|
|
'yellow',
|
|
|
|
'volcano',
|
|
|
|
'geekblue',
|
|
|
|
'lime',
|
|
|
|
'gold',
|
|
|
|
] as const;
|
|
|
|
|
|
|
|
type PresetColorKey = typeof PresetColors[number];
|
|
|
|
|
|
|
|
export type PresetColorType = Record<PresetColorKey, string>;
|
|
|
|
|
|
|
|
type ColorPaletteKeyIndex = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
|
|
|
|
|
|
|
|
export type ColorPalettes = {
|
|
|
|
[key in `${keyof PresetColorType}-${ColorPaletteKeyIndex}`]: string;
|
|
|
|
};
|
|
|
|
|
|
|
|
export interface OverrideToken {
|
|
|
|
derivative: Partial<DerivativeToken & AliasToken>;
|
|
|
|
[componentName: string]: object; // FIXME: tmp of component token
|
|
|
|
}
|
|
|
|
|
|
|
|
// ======================================================================
|
|
|
|
// == Seed Token ==
|
|
|
|
// ======================================================================
|
2022-03-24 14:30:48 +08:00
|
|
|
// 🔥🔥🔥🔥🔥🔥🔥 DO NOT MODIFY THIS. PLEASE CONTACT DESIGNER. 🔥🔥🔥🔥🔥🔥🔥
|
2022-03-21 16:48:25 +08:00
|
|
|
export interface SeedToken extends PresetColorType {
|
|
|
|
// Color
|
|
|
|
colorPrimary: string;
|
|
|
|
colorSuccess: string;
|
|
|
|
colorWarning: string;
|
|
|
|
colorError: string;
|
|
|
|
colorInfo: string;
|
|
|
|
colorText: string;
|
|
|
|
colorTextLightSolid: string;
|
2022-03-22 20:02:04 +08:00
|
|
|
/** Base component background color. Will derivative container background color with this */
|
2022-03-21 16:48:25 +08:00
|
|
|
colorBg: string;
|
|
|
|
|
|
|
|
// Font
|
|
|
|
fontFamily: string;
|
|
|
|
fontSizeBase: number;
|
|
|
|
|
|
|
|
// Grid
|
|
|
|
gridUnit: number;
|
|
|
|
gridBaseStep: number;
|
|
|
|
|
|
|
|
// Line
|
2022-03-24 14:30:48 +08:00
|
|
|
/** Border width of base components */
|
2022-03-21 16:48:25 +08:00
|
|
|
lineWidth: number;
|
|
|
|
|
|
|
|
// Motion
|
|
|
|
motionUnit: number;
|
2022-03-22 20:02:04 +08:00
|
|
|
motionBase: number;
|
2022-03-21 16:48:25 +08:00
|
|
|
motionEaseInOutCirc: string;
|
|
|
|
motionEaseInOut: string;
|
|
|
|
motionEaseOutBack: string;
|
|
|
|
motionEaseInQuint: string;
|
|
|
|
motionEaseOutQuint: string;
|
|
|
|
|
|
|
|
// Radius
|
|
|
|
radiusBase: number;
|
|
|
|
|
|
|
|
// Size
|
|
|
|
sizeUnit: number;
|
|
|
|
sizeBaseStep: number;
|
2022-03-22 09:37:37 +08:00
|
|
|
|
|
|
|
// Control Base
|
|
|
|
controlHeight: number;
|
2022-03-24 14:30:48 +08:00
|
|
|
|
|
|
|
// zIndex
|
|
|
|
/** Base zIndex of component like BackTop, Affix which can be cover by large popup */
|
|
|
|
zIndexBase: number;
|
|
|
|
/** Base popup component zIndex */
|
|
|
|
zIndexPopup: number;
|
2022-03-21 16:48:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// ======================================================================
|
|
|
|
// == Derivative Token ==
|
|
|
|
// ======================================================================
|
2022-03-24 14:30:48 +08:00
|
|
|
// 🔥🔥🔥🔥🔥🔥🔥 DO NOT MODIFY THIS. PLEASE CONTACT DESIGNER. 🔥🔥🔥🔥🔥🔥🔥
|
2022-03-21 16:48:25 +08:00
|
|
|
export interface DerivativeToken extends SeedToken, ColorPalettes {
|
|
|
|
// Color
|
|
|
|
colorPrimaryHover: string;
|
|
|
|
colorPrimaryActive: string;
|
2022-03-22 20:02:04 +08:00
|
|
|
colorPrimaryOutline: string;
|
2022-03-24 14:30:48 +08:00
|
|
|
colorPrimarySecondary: string; // primary[2]
|
|
|
|
|
|
|
|
colorSuccessSecondary: string;
|
|
|
|
colorBgSuccess: string; // success[0]
|
2022-03-22 20:02:04 +08:00
|
|
|
|
2022-03-21 16:48:25 +08:00
|
|
|
colorWarningHover: string;
|
|
|
|
colorWarningActive: string;
|
2022-03-22 20:02:04 +08:00
|
|
|
colorWarningOutline: string;
|
2022-03-24 14:30:48 +08:00
|
|
|
colorWarningSecondary: string;
|
|
|
|
colorBgWarning: string;
|
2022-03-22 20:02:04 +08:00
|
|
|
|
2022-03-21 16:48:25 +08:00
|
|
|
colorErrorHover: string;
|
|
|
|
colorErrorActive: string;
|
2022-03-22 20:02:04 +08:00
|
|
|
colorErrorOutline: string;
|
2022-03-24 14:30:48 +08:00
|
|
|
colorErrorSecondary: string;
|
|
|
|
colorBgError: string;
|
|
|
|
|
|
|
|
colorInfoSecondary: string;
|
|
|
|
colorBgInfo: string;
|
2022-03-21 16:48:25 +08:00
|
|
|
|
|
|
|
colorText2: string;
|
|
|
|
colorTextBelow: string;
|
|
|
|
colorTextBelow2: string;
|
|
|
|
colorTextBelow3: string;
|
|
|
|
|
2022-03-24 14:30:48 +08:00
|
|
|
colorBg2: string;
|
2022-03-21 16:48:25 +08:00
|
|
|
colorBgBelow: string;
|
|
|
|
colorBgBelow2: string;
|
|
|
|
|
2022-03-24 14:30:48 +08:00
|
|
|
colorHighlight: string;
|
|
|
|
|
2022-03-21 16:48:25 +08:00
|
|
|
// Font
|
2022-03-22 09:37:37 +08:00
|
|
|
fontSizes: number[];
|
|
|
|
lineHeights: number[];
|
2022-03-21 16:48:25 +08:00
|
|
|
|
|
|
|
// Size
|
|
|
|
sizeSpace: number;
|
|
|
|
sizeSpaceXS: number;
|
|
|
|
sizeSpaceXXS: number;
|
|
|
|
sizeSpaceSM: number;
|
|
|
|
|
|
|
|
// Grid
|
|
|
|
gridSpaceSM: number;
|
|
|
|
gridSpaceBase: number;
|
|
|
|
gridSpaceLG: number;
|
|
|
|
gridSpaceXL: number;
|
|
|
|
gridSpaceXXL: number;
|
|
|
|
|
|
|
|
// Motion
|
|
|
|
motionDurationFast: string;
|
2022-03-22 20:02:04 +08:00
|
|
|
motionDurationMid: string;
|
2022-03-21 16:48:25 +08:00
|
|
|
motionDurationSlow: string;
|
|
|
|
|
|
|
|
// Radius
|
|
|
|
radiusSM: number;
|
|
|
|
radiusLG: number;
|
|
|
|
radiusXL: number;
|
2022-03-22 13:26:29 +08:00
|
|
|
|
2022-03-24 14:30:48 +08:00
|
|
|
// Control
|
2022-03-22 13:26:29 +08:00
|
|
|
/** @private Only Used for control inside component like Multiple Select inner selection item */
|
|
|
|
controlHeightXS: number;
|
|
|
|
controlHeightSM: number;
|
|
|
|
controlHeightLG: number;
|
2022-03-21 16:48:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// ======================================================================
|
|
|
|
// == Alias Token ==
|
|
|
|
// ======================================================================
|
2022-03-24 14:30:48 +08:00
|
|
|
// 🔥🔥🔥🔥🔥🔥🔥 DO NOT MODIFY THIS. PLEASE CONTACT DESIGNER. 🔥🔥🔥🔥🔥🔥🔥
|
2022-03-21 16:48:25 +08:00
|
|
|
export interface AliasToken extends DerivativeToken {
|
2022-03-22 09:37:37 +08:00
|
|
|
// Font
|
|
|
|
fontSizeSM: number;
|
|
|
|
fontSize: number;
|
|
|
|
fontSizeLG: number;
|
|
|
|
fontSizeXL: number;
|
2022-03-21 16:48:25 +08:00
|
|
|
|
2022-03-22 09:37:37 +08:00
|
|
|
fontSizeHeading1: number;
|
|
|
|
fontSizeHeading2: number;
|
|
|
|
fontSizeHeading3: number;
|
|
|
|
fontSizeHeading4: number;
|
|
|
|
fontSizeHeading5: number;
|
|
|
|
|
|
|
|
// LineHeight
|
2022-03-21 16:48:25 +08:00
|
|
|
lineHeight: number;
|
2022-03-22 09:37:37 +08:00
|
|
|
lineHeightLG: number;
|
|
|
|
|
|
|
|
lineHeightHeading1: number;
|
|
|
|
lineHeightHeading2: number;
|
|
|
|
lineHeightHeading3: number;
|
|
|
|
lineHeightHeading4: number;
|
|
|
|
lineHeightHeading5: number;
|
|
|
|
|
2022-03-22 13:26:29 +08:00
|
|
|
// Control
|
|
|
|
controlLineWidth: number;
|
|
|
|
controlLineType: string;
|
|
|
|
controlRadius: number;
|
|
|
|
controlOutlineWidth: number;
|
2022-03-22 20:02:04 +08:00
|
|
|
controlItemBgHover: string; // Note. It also is a color
|
|
|
|
controlItemBgActive: string; // Note. It also is a color
|
2022-03-21 16:48:25 +08:00
|
|
|
|
2022-03-22 13:26:29 +08:00
|
|
|
// Color
|
|
|
|
colorBorder: string;
|
|
|
|
colorSplit: string;
|
|
|
|
colorTextSecondary: string;
|
|
|
|
colorTextDisabled: string;
|
2022-03-22 20:02:04 +08:00
|
|
|
/** Placeholder text color */
|
|
|
|
colorPlaceholder: string;
|
|
|
|
colorTextHeading: string;
|
2022-03-24 14:30:48 +08:00
|
|
|
|
|
|
|
/** Weak action. Such as `allowClear` or Alert close button */
|
|
|
|
colorAction: string;
|
|
|
|
/** Weak action hover color. Such as `allowClear` or Alert close button */
|
|
|
|
colorActionHover: string;
|
|
|
|
|
|
|
|
colorLink: string;
|
|
|
|
colorLinkHover: string;
|
|
|
|
colorLinkActive: string;
|
|
|
|
|
2022-03-22 20:02:04 +08:00
|
|
|
colorBgContainer: string;
|
|
|
|
colorBgComponent: string;
|
2022-03-24 14:30:48 +08:00
|
|
|
colorBgComponentSecondary: string;
|
2022-03-22 20:02:04 +08:00
|
|
|
colorBgComponentDisabled: string;
|
2022-03-21 16:48:25 +08:00
|
|
|
|
2022-03-22 13:26:29 +08:00
|
|
|
// =============== Legacy: should be remove ===============
|
2022-03-21 16:48:25 +08:00
|
|
|
padding: number;
|
|
|
|
margin: number;
|
|
|
|
|
2022-03-22 20:02:04 +08:00
|
|
|
boxShadow: string;
|
2022-03-21 16:48:25 +08:00
|
|
|
|
|
|
|
linkDecoration: React.CSSProperties['textDecoration'];
|
|
|
|
linkHoverDecoration: React.CSSProperties['textDecoration'];
|
|
|
|
linkFocusDecoration: React.CSSProperties['textDecoration'];
|
|
|
|
|
|
|
|
controlPaddingHorizontal: number;
|
|
|
|
controlPaddingHorizontalSM: number;
|
|
|
|
paddingSM: number;
|
|
|
|
paddingXS: number;
|
|
|
|
paddingXXS: number;
|
|
|
|
paddingLG: number;
|
|
|
|
marginXS: number;
|
|
|
|
marginLG: number;
|
|
|
|
marginXXS: number;
|
|
|
|
}
|