mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-23 18:50:06 +08:00
📚 docs: add token meta info to token system model (#39101)
* ♻️ refactor token system interface * 📝 docs: add more token meta info to seeds and map token * 🔨 chore: update token meta generator scripts * 🚨 chore: fix lint * 📝 docs: 补充 token 的 meta 信息 * chore: add json in pkg * chore: update script * chore: update flag Co-authored-by: MadCcc <1075746765@qq.com>
This commit is contained in:
parent
ffbb19e090
commit
479e4e8884
@ -2,14 +2,20 @@ const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const restCssPath = path.join(process.cwd(), 'components', 'style', 'reset.css');
|
||||
const tokenStatisticPath = path.join(process.cwd(), 'components', 'version', 'token.json');
|
||||
const tokenMetaPath = path.join(process.cwd(), 'components', 'version', 'token-meta.json');
|
||||
|
||||
function finalizeCompile() {
|
||||
if (fs.existsSync(path.join(__dirname, './es'))) {
|
||||
fs.copyFileSync(restCssPath, path.join(process.cwd(), 'es', 'style', 'reset.css'));
|
||||
fs.copyFileSync(tokenStatisticPath, path.join(process.cwd(), 'es', 'version', 'token.json'));
|
||||
fs.copyFileSync(tokenMetaPath, path.join(process.cwd(), 'es', 'version', 'token-meta.json'));
|
||||
}
|
||||
|
||||
if (fs.existsSync(path.join(__dirname, './lib'))) {
|
||||
fs.copyFileSync(restCssPath, path.join(process.cwd(), 'lib', 'style', 'reset.css'));
|
||||
fs.copyFileSync(tokenStatisticPath, path.join(process.cwd(), 'lib', 'version', 'token.json'));
|
||||
fs.copyFileSync(tokenMetaPath, path.join(process.cwd(), 'lib', 'version', 'token-meta.json'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,8 +4,8 @@ import React, { useMemo } from 'react';
|
||||
// @ts-ignore
|
||||
import tokenMeta from 'antd/es/version/token-meta.json';
|
||||
import { getDesignToken } from 'antd-token-previewer';
|
||||
import type { TableProps } from 'antd';
|
||||
import { Table } from 'antd';
|
||||
import type { TableProps } from 'antd';
|
||||
import { css } from '@emotion/react';
|
||||
import useLocale from '../../../hooks/useLocale';
|
||||
import useSiteToken from '../../../hooks/useSiteToken';
|
||||
@ -68,7 +68,6 @@ const TokenTable: FC<TokenTableProps> = ({ type }) => {
|
||||
title: locale.description,
|
||||
key: 'desc',
|
||||
dataIndex: 'desc',
|
||||
width: 300,
|
||||
},
|
||||
{
|
||||
title: locale.type,
|
||||
@ -104,7 +103,7 @@ const TokenTable: FC<TokenTableProps> = ({ type }) => {
|
||||
const data = useMemo<TokenData[]>(
|
||||
() =>
|
||||
tokenMeta[type].map((token) => ({
|
||||
name: token.name,
|
||||
name: token.token,
|
||||
desc: lang === 'cn' ? token.desc : token.descEn,
|
||||
type: token.type,
|
||||
value: (defaultToken as any)[token.name],
|
||||
|
@ -1,875 +0,0 @@
|
||||
import type * as React from 'react';
|
||||
import type { ComponentToken as AlertComponentToken } from '../alert/style';
|
||||
import type { ComponentToken as AnchorComponentToken } from '../anchor/style';
|
||||
import type { ComponentToken as AvatarComponentToken } from '../avatar/style';
|
||||
import type { ComponentToken as BackTopComponentToken } from '../back-top/style';
|
||||
import type { ComponentToken as ButtonComponentToken } from '../button/style';
|
||||
import type { ComponentToken as FloatButtonComponentToken } from '../float-button/style';
|
||||
import type { ComponentToken as CalendarComponentToken } from '../calendar/style';
|
||||
import type { ComponentToken as CardComponentToken } from '../card/style';
|
||||
import type { ComponentToken as CarouselComponentToken } from '../carousel/style';
|
||||
import type { ComponentToken as CascaderComponentToken } from '../cascader/style';
|
||||
import type { ComponentToken as CheckboxComponentToken } from '../checkbox/style';
|
||||
import type { ComponentToken as CollapseComponentToken } from '../collapse/style';
|
||||
import type { ComponentToken as DatePickerComponentToken } from '../date-picker/style';
|
||||
import type { ComponentToken as DividerComponentToken } from '../divider/style';
|
||||
import type { ComponentToken as DropdownComponentToken } from '../dropdown/style';
|
||||
import type { ComponentToken as DrawerComponentToken } from '../drawer/style';
|
||||
import type { ComponentToken as EmptyComponentToken } from '../empty/style';
|
||||
import type { ComponentToken as ImageComponentToken } from '../image/style';
|
||||
import type { ComponentToken as InputNumberComponentToken } from '../input-number/style';
|
||||
import type { ComponentToken as LayoutComponentToken } from '../layout/style';
|
||||
import type { ComponentToken as ListComponentToken } from '../list/style';
|
||||
import type { ComponentToken as MentionsComponentToken } from '../mentions/style';
|
||||
import type { ComponentToken as MenuComponentToken } from '../menu/style';
|
||||
import type { ComponentToken as MessageComponentToken } from '../message/style';
|
||||
import type { ComponentToken as ModalComponentToken } from '../modal/style';
|
||||
import type { ComponentToken as NotificationComponentToken } from '../notification/style';
|
||||
import type { ComponentToken as PopconfirmComponentToken } from '../popconfirm/style';
|
||||
import type { ComponentToken as PopoverComponentToken } from '../popover/style';
|
||||
import type { ComponentToken as ProgressComponentToken } from '../progress/style';
|
||||
import type { ComponentToken as RadioComponentToken } from '../radio/style';
|
||||
import type { ComponentToken as RateComponentToken } from '../rate/style';
|
||||
import type { ComponentToken as ResultComponentToken } from '../result/style';
|
||||
import type { ComponentToken as SegmentedComponentToken } from '../segmented/style';
|
||||
import type { ComponentToken as SelectComponentToken } from '../select/style';
|
||||
import type { ComponentToken as SkeletonComponentToken } from '../skeleton/style';
|
||||
import type { ComponentToken as SliderComponentToken } from '../slider/style';
|
||||
import type { ComponentToken as SpaceComponentToken } from '../space/style';
|
||||
import type { ComponentToken as SpinComponentToken } from '../spin/style';
|
||||
import type { ComponentToken as StepsComponentToken } from '../steps/style';
|
||||
import type { ComponentToken as TableComponentToken } from '../table/style';
|
||||
import type { ComponentToken as TabsComponentToken } from '../tabs/style';
|
||||
import type { ComponentToken as TagComponentToken } from '../tag/style';
|
||||
import type { ComponentToken as TimelineComponentToken } from '../timeline/style';
|
||||
import type { ComponentToken as TooltipComponentToken } from '../tooltip/style';
|
||||
import type { ComponentToken as TransferComponentToken } from '../transfer/style';
|
||||
import type { ComponentToken as TypographyComponentToken } from '../typography/style';
|
||||
import type { ComponentToken as UploadComponentToken } from '../upload/style';
|
||||
import type { ComponentToken as TourComponentToken } from '../tour/style';
|
||||
|
||||
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 ComponentTokenMap {
|
||||
Affix?: {};
|
||||
Alert?: AlertComponentToken;
|
||||
Anchor?: AnchorComponentToken;
|
||||
Avatar?: AvatarComponentToken;
|
||||
BackTop?: BackTopComponentToken;
|
||||
Badge?: {};
|
||||
Button?: ButtonComponentToken;
|
||||
Breadcrumb?: {};
|
||||
Card?: CardComponentToken;
|
||||
Carousel?: CarouselComponentToken;
|
||||
Cascader?: CascaderComponentToken;
|
||||
Checkbox?: CheckboxComponentToken;
|
||||
Collapse?: CollapseComponentToken;
|
||||
DatePicker?: DatePickerComponentToken;
|
||||
Descriptions?: {};
|
||||
Divider?: DividerComponentToken;
|
||||
Drawer?: DrawerComponentToken;
|
||||
Dropdown?: DropdownComponentToken;
|
||||
Empty?: EmptyComponentToken;
|
||||
FloatButton?: FloatButtonComponentToken;
|
||||
Form?: {};
|
||||
Grid?: {};
|
||||
Image?: ImageComponentToken;
|
||||
Input?: {};
|
||||
InputNumber?: InputNumberComponentToken;
|
||||
Layout?: LayoutComponentToken;
|
||||
List?: ListComponentToken;
|
||||
Mentions?: MentionsComponentToken;
|
||||
Notification?: NotificationComponentToken;
|
||||
Pagination?: {};
|
||||
Popover?: PopoverComponentToken;
|
||||
Popconfirm?: PopconfirmComponentToken;
|
||||
Rate?: RateComponentToken;
|
||||
Radio?: RadioComponentToken;
|
||||
Result?: ResultComponentToken;
|
||||
Segmented?: SegmentedComponentToken;
|
||||
Select?: SelectComponentToken;
|
||||
Skeleton?: SkeletonComponentToken;
|
||||
Slider?: SliderComponentToken;
|
||||
Spin?: SpinComponentToken;
|
||||
Statistic?: {};
|
||||
Switch?: {};
|
||||
Tag?: TagComponentToken;
|
||||
Tree?: {};
|
||||
TreeSelect?: {};
|
||||
Typography?: TypographyComponentToken;
|
||||
Timeline?: TimelineComponentToken;
|
||||
Transfer?: TransferComponentToken;
|
||||
Tabs?: TabsComponentToken;
|
||||
Calendar?: CalendarComponentToken;
|
||||
Steps?: StepsComponentToken;
|
||||
Menu?: MenuComponentToken;
|
||||
Modal?: ModalComponentToken;
|
||||
Message?: MessageComponentToken;
|
||||
Upload?: UploadComponentToken;
|
||||
Tooltip?: TooltipComponentToken;
|
||||
Table?: TableComponentToken;
|
||||
Space?: SpaceComponentToken;
|
||||
Progress?: ProgressComponentToken;
|
||||
Tour?: TourComponentToken;
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
// ======================================================================
|
||||
// == Seed Token ==
|
||||
// ======================================================================
|
||||
// 🔥🔥🔥🔥🔥🔥🔥 DO NOT MODIFY THIS. PLEASE CONTACT DESIGNER. 🔥🔥🔥🔥🔥🔥🔥
|
||||
export interface SeedToken extends PresetColorType {
|
||||
/**
|
||||
* @desc 品牌主色
|
||||
*/
|
||||
colorPrimary: string;
|
||||
|
||||
/**
|
||||
* @desc 成功色
|
||||
*/
|
||||
colorSuccess: string;
|
||||
|
||||
/**
|
||||
* @desc 警戒色
|
||||
*/
|
||||
colorWarning: string;
|
||||
|
||||
/**
|
||||
* @desc 错误色
|
||||
*/
|
||||
colorError: string;
|
||||
|
||||
/**
|
||||
* @desc 信息色
|
||||
*/
|
||||
colorInfo: string;
|
||||
|
||||
/**
|
||||
* @desc 基础文本色
|
||||
*/
|
||||
colorTextBase: string;
|
||||
|
||||
/**
|
||||
* Base component background color. Will derivative container background color with this
|
||||
* @desc 基础背景色
|
||||
*/
|
||||
colorBgBase: string;
|
||||
|
||||
// Font
|
||||
/**
|
||||
* @desc 字体
|
||||
*/
|
||||
fontFamily: string;
|
||||
|
||||
/**
|
||||
* @desc 基础字号
|
||||
*/
|
||||
fontSize: number;
|
||||
|
||||
/**
|
||||
* Border width of base components
|
||||
* @desc 基础线宽
|
||||
*/
|
||||
lineWidth: number;
|
||||
|
||||
/**
|
||||
* @desc 线条样式
|
||||
*/
|
||||
lineType: string;
|
||||
|
||||
/**
|
||||
* @desc 动画时长变化单位
|
||||
*/
|
||||
motionUnit: number;
|
||||
|
||||
/**
|
||||
* @desc 动画基础时长
|
||||
*/
|
||||
motionBase: number;
|
||||
|
||||
/**
|
||||
* @desc
|
||||
*/
|
||||
motionEaseOutCirc: string;
|
||||
|
||||
/**
|
||||
* @desc
|
||||
*/
|
||||
motionEaseInOutCirc: string;
|
||||
|
||||
/**
|
||||
* @desc
|
||||
*/
|
||||
motionEaseInOut: string;
|
||||
|
||||
/**
|
||||
* @desc
|
||||
*/
|
||||
motionEaseOutBack: string;
|
||||
|
||||
/**
|
||||
* @desc
|
||||
*/
|
||||
motionEaseInBack: string;
|
||||
|
||||
/**
|
||||
* @desc
|
||||
*/
|
||||
motionEaseInQuint: string;
|
||||
|
||||
/**
|
||||
* @desc
|
||||
*/
|
||||
motionEaseOutQuint: string;
|
||||
|
||||
/**
|
||||
* @desc
|
||||
*/
|
||||
motionEaseOut: string;
|
||||
|
||||
// Radius
|
||||
/**
|
||||
* @desc 基础圆角
|
||||
* @descEn Base border radius
|
||||
*/
|
||||
borderRadius: number;
|
||||
|
||||
/**
|
||||
* @desc 尺寸变化单位
|
||||
*/
|
||||
sizeUnit: number;
|
||||
|
||||
/**
|
||||
* @desc 尺寸基础大小
|
||||
*/
|
||||
sizeStep: number;
|
||||
|
||||
/**
|
||||
* @desc 组件箭头尺寸
|
||||
*/
|
||||
sizePopupArrow: number;
|
||||
|
||||
// Control Base
|
||||
|
||||
/**
|
||||
* @desc
|
||||
*/
|
||||
controlHeight: number;
|
||||
|
||||
/**
|
||||
* @desc 基础 zIndex
|
||||
* @descEn Base popup component zIndex
|
||||
*/
|
||||
zIndexBase: number;
|
||||
/** */
|
||||
|
||||
/**
|
||||
* @desc 浮层基础 zIndex
|
||||
* @descEn Base zIndex of component like FloatButton, Affix which can be cover by large popup
|
||||
*/
|
||||
zIndexPopupBase: number;
|
||||
|
||||
/**
|
||||
* @desc 成功色
|
||||
* @descEn Define default Image opacity. Useful when in dark-like theme
|
||||
*/
|
||||
opacityImage: number;
|
||||
|
||||
/**
|
||||
* @desc 线框化
|
||||
*/
|
||||
wireframe: boolean;
|
||||
}
|
||||
|
||||
export interface NeutralColorMapToken {
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
colorTextBase: string;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
colorBgBase: string;
|
||||
|
||||
/**
|
||||
* @desc 一级文本色
|
||||
*/
|
||||
colorText: string;
|
||||
|
||||
/**
|
||||
* @desc 二级文本色
|
||||
*/
|
||||
colorTextSecondary: string;
|
||||
|
||||
/**
|
||||
* @desc 三级文本色
|
||||
*/
|
||||
colorTextTertiary: string;
|
||||
|
||||
/**
|
||||
* @desc 四级文本色
|
||||
*/
|
||||
colorTextQuaternary: string;
|
||||
|
||||
/**
|
||||
* @desc 一级填充色
|
||||
*/
|
||||
colorFill: string;
|
||||
|
||||
/**
|
||||
* @desc 二级填充色
|
||||
*/
|
||||
colorFillSecondary: string;
|
||||
|
||||
/**
|
||||
* @desc 三级填充色
|
||||
*/
|
||||
colorFillTertiary: string;
|
||||
|
||||
/**
|
||||
* @desc 四级填充色
|
||||
*/
|
||||
colorFillQuaternary: string;
|
||||
|
||||
/**
|
||||
* @desc 组件容器背景色
|
||||
*/
|
||||
colorBgContainer: string;
|
||||
|
||||
/**
|
||||
* @desc 浮层容器背景色
|
||||
*/
|
||||
colorBgElevated: string;
|
||||
|
||||
/**
|
||||
* @desc 布局背景色
|
||||
*/
|
||||
colorBgLayout: string;
|
||||
|
||||
/**
|
||||
* @desc
|
||||
*/
|
||||
colorBgSpotlight: string;
|
||||
|
||||
/**
|
||||
* @desc 一级边框色
|
||||
*/
|
||||
colorBorder: string;
|
||||
|
||||
/**
|
||||
* @desc 二级边框色
|
||||
*/
|
||||
colorBorderSecondary: string;
|
||||
}
|
||||
|
||||
export interface ColorMapToken extends NeutralColorMapToken {
|
||||
// Primary
|
||||
/**
|
||||
* @desc 主色的浅色背景颜色
|
||||
*/
|
||||
colorPrimaryBg: string; // 1
|
||||
|
||||
/**
|
||||
* @desc 主色的浅色背景色悬浮态
|
||||
*/
|
||||
colorPrimaryBgHover: string; // 2
|
||||
|
||||
/**
|
||||
* @desc 主色的描边色
|
||||
*/
|
||||
colorPrimaryBorder: string; // 3
|
||||
|
||||
/**
|
||||
* @desc 主色的描边色悬浮态
|
||||
*/
|
||||
colorPrimaryBorderHover: string; // 4
|
||||
|
||||
/**
|
||||
* @desc 主色的深色悬浮态
|
||||
*/
|
||||
colorPrimaryHover: string; // 5
|
||||
|
||||
/**
|
||||
* @desc 品牌主色
|
||||
*/
|
||||
colorPrimary: string; // 6
|
||||
|
||||
/**
|
||||
* @desc 主色的深色激活态
|
||||
*/
|
||||
colorPrimaryActive: string; // 7
|
||||
|
||||
/**
|
||||
* @desc 主色的文本悬浮态
|
||||
*/
|
||||
colorPrimaryTextHover: string; // 8
|
||||
|
||||
/**
|
||||
* @desc 主色的文本默认态
|
||||
*/
|
||||
colorPrimaryText: string; // 9
|
||||
|
||||
/**
|
||||
* @desc 主色的文本激活态
|
||||
*/
|
||||
colorPrimaryTextActive: string; // 10
|
||||
|
||||
/**
|
||||
* @desc 成功色的浅色背景颜色
|
||||
*/
|
||||
colorSuccessBg: string; // 1
|
||||
|
||||
/**
|
||||
* @desc 成功色的浅色背景色悬浮态
|
||||
*/
|
||||
colorSuccessBgHover: string; // 2
|
||||
|
||||
/**
|
||||
* @desc 成功色的描边色
|
||||
*/
|
||||
colorSuccessBorder: string; // 3
|
||||
|
||||
/**
|
||||
* @desc 成功色的描边色悬浮态
|
||||
*/
|
||||
colorSuccessBorderHover: string; // 4
|
||||
|
||||
/**
|
||||
* @desc 成功色的深色悬浮态
|
||||
*/
|
||||
colorSuccessHover: string; // 5
|
||||
|
||||
/**
|
||||
* @desc 成功色
|
||||
*/
|
||||
colorSuccess: string; // 6
|
||||
|
||||
/**
|
||||
* @desc 成功色的深色激活态
|
||||
*/
|
||||
colorSuccessActive: string; // 7
|
||||
|
||||
/**
|
||||
* @desc 成功色的文本悬浮态
|
||||
*/
|
||||
colorSuccessTextHover: string; // 8
|
||||
|
||||
/**
|
||||
* @desc 成功色的文本默认态
|
||||
*/
|
||||
colorSuccessText: string; // 9
|
||||
|
||||
/**
|
||||
* @desc 成功色的文本激活态
|
||||
*/
|
||||
colorSuccessTextActive: string; // 10
|
||||
|
||||
/**
|
||||
* @desc 警戒色的浅色背景颜色
|
||||
*/
|
||||
colorWarningBg: string; // 1
|
||||
|
||||
/**
|
||||
* @desc 警戒色的浅色背景色悬浮态
|
||||
*/
|
||||
colorWarningBgHover: string; // 2
|
||||
|
||||
/**
|
||||
* @desc 警戒色的描边色
|
||||
*/
|
||||
colorWarningBorder: string; // 3
|
||||
|
||||
/**
|
||||
* @desc 警戒色的描边色悬浮态
|
||||
*/
|
||||
colorWarningBorderHover: string; // 4
|
||||
|
||||
/**
|
||||
* @desc 警戒色的深色悬浮态
|
||||
*/
|
||||
colorWarningHover: string; // 5
|
||||
|
||||
/**
|
||||
* @desc 警戒色
|
||||
*/
|
||||
colorWarning: string; // 6
|
||||
|
||||
/**
|
||||
* @desc 警戒色的深色激活态
|
||||
*/
|
||||
colorWarningActive: string; // 7
|
||||
|
||||
/**
|
||||
* @desc 警戒色的文本悬浮态
|
||||
*/
|
||||
colorWarningTextHover: string; // 8
|
||||
|
||||
/**
|
||||
* @desc 警戒色的文本默认态
|
||||
*/
|
||||
colorWarningText: string; // 9
|
||||
|
||||
/**
|
||||
* @desc 警戒色的文本激活态
|
||||
*/
|
||||
colorWarningTextActive: string; // 10
|
||||
|
||||
/**
|
||||
* @desc 错误色的浅色背景颜色
|
||||
*/
|
||||
colorErrorBg: string; // 1
|
||||
|
||||
/**
|
||||
* @desc 错误色的浅色背景色悬浮态
|
||||
*/
|
||||
colorErrorBgHover: string; // 2
|
||||
|
||||
/**
|
||||
* @desc 错误色的描边色
|
||||
*/
|
||||
colorErrorBorder: string; // 3
|
||||
|
||||
/**
|
||||
* @desc 错误色的描边色悬浮态
|
||||
*/
|
||||
colorErrorBorderHover: string; // 4
|
||||
|
||||
/**
|
||||
* @desc 错误色的深色悬浮态
|
||||
*/
|
||||
colorErrorHover: string; // 5
|
||||
|
||||
/**
|
||||
* @desc 错误色
|
||||
*/
|
||||
colorError: string; // 6
|
||||
|
||||
/**
|
||||
* @desc 错误色的深色激活态
|
||||
*/
|
||||
colorErrorActive: string; // 7
|
||||
|
||||
/**
|
||||
* @desc 错误色的文本悬浮态
|
||||
*/
|
||||
colorErrorTextHover: string; // 8
|
||||
|
||||
/**
|
||||
* @desc 错误色的文本默认态
|
||||
*/
|
||||
colorErrorText: string; // 9
|
||||
|
||||
/**
|
||||
* @desc 错误色的文本激活态
|
||||
*/
|
||||
colorErrorTextActive: string; // 10
|
||||
|
||||
/**
|
||||
* @desc 信息色的浅色背景颜色
|
||||
*/
|
||||
colorInfoBg: string; // 1
|
||||
|
||||
/**
|
||||
* @desc 信息色的浅色背景色悬浮态
|
||||
*/
|
||||
colorInfoBgHover: string; // 2
|
||||
|
||||
/**
|
||||
* @desc 信息色的描边色
|
||||
*/
|
||||
colorInfoBorder: string; // 3
|
||||
|
||||
/**
|
||||
* @desc 信息色的描边色悬浮态
|
||||
*/
|
||||
colorInfoBorderHover: string; // 4
|
||||
|
||||
/**
|
||||
* @desc 信息色的深色悬浮态
|
||||
*/
|
||||
colorInfoHover: string; // 5
|
||||
|
||||
/**
|
||||
* @desc 信息色
|
||||
*/
|
||||
colorInfo: string; // 6
|
||||
|
||||
/**
|
||||
* @desc 信息色的深色激活态
|
||||
*/
|
||||
colorInfoActive: string; // 7
|
||||
|
||||
/**
|
||||
* @desc 信息色的文本悬浮态
|
||||
*/
|
||||
colorInfoTextHover: string; // 8
|
||||
|
||||
/**
|
||||
* @desc 信息色的文本默认态
|
||||
*/
|
||||
colorInfoText: string; // 9
|
||||
|
||||
/**
|
||||
* @desc 信息色的文本激活态
|
||||
*/
|
||||
colorInfoTextActive: string; // 10
|
||||
|
||||
/**
|
||||
* @desc 浮层的背景蒙层颜色
|
||||
*/
|
||||
colorBgMask: string;
|
||||
colorWhite: string;
|
||||
}
|
||||
|
||||
export interface SizeMapToken {
|
||||
// Size
|
||||
sizeXXL: number;
|
||||
sizeXL: number;
|
||||
sizeLG: number;
|
||||
sizeMD: number;
|
||||
/** Same as size by default, but could be larger in compact mode */
|
||||
sizeMS: number;
|
||||
size: number;
|
||||
sizeSM: number;
|
||||
sizeXS: number;
|
||||
sizeXXS: number;
|
||||
}
|
||||
|
||||
export interface HeightMapToken {
|
||||
// Control
|
||||
/** @private Only Used for control inside component like Multiple Select inner selection item */
|
||||
controlHeightXS: number;
|
||||
controlHeightSM: number;
|
||||
controlHeightLG: number;
|
||||
}
|
||||
|
||||
export interface CommonMapToken {
|
||||
// Font
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
fontSizes: number[];
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
lineHeights: number[];
|
||||
|
||||
// Line
|
||||
lineWidthBold: number;
|
||||
|
||||
// Motion
|
||||
motionDurationFast: string;
|
||||
motionDurationMid: string;
|
||||
motionDurationSlow: string;
|
||||
|
||||
// Radius
|
||||
borderRadiusXS: number;
|
||||
borderRadiusSM: number;
|
||||
borderRadiusLG: number;
|
||||
borderRadiusOuter: number;
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
// == Map Token ==
|
||||
// ======================================================================
|
||||
// 🔥🔥🔥🔥🔥🔥🔥 DO NOT MODIFY THIS. PLEASE CONTACT DESIGNER. 🔥🔥🔥🔥🔥🔥🔥
|
||||
export interface MapToken
|
||||
extends SeedToken,
|
||||
ColorPalettes,
|
||||
ColorMapToken,
|
||||
SizeMapToken,
|
||||
HeightMapToken,
|
||||
CommonMapToken {}
|
||||
|
||||
// ======================================================================
|
||||
// == Alias Token ==
|
||||
// ======================================================================
|
||||
// 🔥🔥🔥🔥🔥🔥🔥 DO NOT MODIFY THIS. PLEASE CONTACT DESIGNER. 🔥🔥🔥🔥🔥🔥🔥
|
||||
export interface AliasToken extends MapToken {
|
||||
// Background
|
||||
colorFillContentHover: string;
|
||||
colorFillAlter: string;
|
||||
colorBgContainerDisabled: string;
|
||||
colorFillContent: string;
|
||||
|
||||
// Border
|
||||
colorBorderBg: string;
|
||||
colorSplit: string;
|
||||
|
||||
// Text
|
||||
colorTextPlaceholder: string;
|
||||
colorTextDisabled: string;
|
||||
colorTextHeading: string;
|
||||
colorTextLabel: string;
|
||||
colorTextDescription: string;
|
||||
colorTextLightSolid: string;
|
||||
colorBgTextHover: string;
|
||||
colorBgTextActive: string;
|
||||
|
||||
/** Weak action. Such as `allowClear` or Alert close button */
|
||||
colorIcon: string;
|
||||
/** Weak action hover color. Such as `allowClear` or Alert close button */
|
||||
colorIconHover: string;
|
||||
|
||||
colorLink: string;
|
||||
colorLinkHover: string;
|
||||
colorLinkActive: string;
|
||||
|
||||
colorHighlight: string;
|
||||
|
||||
controlOutline: string;
|
||||
colorWarningOutline: string;
|
||||
colorErrorOutline: string;
|
||||
|
||||
// Font
|
||||
fontSizeSM: number;
|
||||
fontSize: number;
|
||||
fontSizeLG: number;
|
||||
fontSizeXL: number;
|
||||
/** Operation icon in Select, Cascader, etc. icon fontSize. Normal is same as fontSizeSM */
|
||||
fontSizeIcon: number;
|
||||
|
||||
fontSizeHeading1: number;
|
||||
fontSizeHeading2: number;
|
||||
fontSizeHeading3: number;
|
||||
fontSizeHeading4: number;
|
||||
fontSizeHeading5: number;
|
||||
|
||||
/** For heading like h1, h2, h3 or option selected item */
|
||||
fontWeightStrong: number;
|
||||
|
||||
// LineHeight
|
||||
lineHeight: number;
|
||||
lineHeightLG: number;
|
||||
lineHeightSM: number;
|
||||
|
||||
lineHeightHeading1: number;
|
||||
lineHeightHeading2: number;
|
||||
lineHeightHeading3: number;
|
||||
lineHeightHeading4: number;
|
||||
lineHeightHeading5: number;
|
||||
|
||||
// Control
|
||||
controlOutlineWidth: number;
|
||||
controlItemBgHover: string; // Note. It also is a color
|
||||
controlItemBgActive: string; // Note. It also is a color
|
||||
controlItemBgActiveHover: string; // Note. It also is a color
|
||||
controlInteractiveSize: number;
|
||||
controlItemBgActiveDisabled: string; // Note. It also is a color
|
||||
|
||||
// Padding
|
||||
paddingXXS: number;
|
||||
paddingXS: number;
|
||||
paddingSM: number;
|
||||
padding: number;
|
||||
paddingMD: number;
|
||||
paddingLG: number;
|
||||
paddingXL: number;
|
||||
|
||||
// Padding Content
|
||||
paddingContentHorizontalLG: number;
|
||||
paddingContentHorizontal: number;
|
||||
paddingContentHorizontalSM: number;
|
||||
paddingContentVerticalLG: number;
|
||||
paddingContentVertical: number;
|
||||
paddingContentVerticalSM: number;
|
||||
|
||||
// Margin
|
||||
marginXXS: number;
|
||||
marginXS: number;
|
||||
marginSM: number;
|
||||
margin: number;
|
||||
marginMD: number;
|
||||
marginLG: number;
|
||||
marginXL: number;
|
||||
marginXXL: number;
|
||||
|
||||
// =============== Legacy: should be remove ===============
|
||||
opacityLoading: number;
|
||||
|
||||
boxShadow: string;
|
||||
boxShadowSecondary: string;
|
||||
|
||||
linkDecoration: React.CSSProperties['textDecoration'];
|
||||
linkHoverDecoration: React.CSSProperties['textDecoration'];
|
||||
linkFocusDecoration: React.CSSProperties['textDecoration'];
|
||||
|
||||
controlPaddingHorizontal: number;
|
||||
controlPaddingHorizontalSM: number;
|
||||
|
||||
// Media queries breakpoints
|
||||
screenXS: number;
|
||||
screenXSMin: number;
|
||||
screenXSMax: number;
|
||||
screenSM: number;
|
||||
screenSMMin: number;
|
||||
screenSMMax: number;
|
||||
screenMD: number;
|
||||
screenMDMin: number;
|
||||
screenMDMax: number;
|
||||
screenLG: number;
|
||||
screenLGMin: number;
|
||||
screenLGMax: number;
|
||||
screenXL: number;
|
||||
screenXLMin: number;
|
||||
screenXLMax: number;
|
||||
screenXXL: number;
|
||||
screenXXLMin: number;
|
||||
screenXXLMax: number;
|
||||
|
||||
/** Used for DefaultButton, Switch which has default outline */
|
||||
controlTmpOutline: string;
|
||||
|
||||
// FIXME: component box-shadow, should be removed
|
||||
/** @internal */
|
||||
boxShadowPopoverArrow: string;
|
||||
/** @internal */
|
||||
boxShadowCard: string;
|
||||
/** @internal */
|
||||
boxShadowDrawerRight: string;
|
||||
/** @internal */
|
||||
boxShadowDrawerLeft: string;
|
||||
/** @internal */
|
||||
boxShadowDrawerUp: string;
|
||||
/** @internal */
|
||||
boxShadowDrawerDown: string;
|
||||
/** @internal */
|
||||
boxShadowTabsOverflowLeft: string;
|
||||
/** @internal */
|
||||
boxShadowTabsOverflowRight: string;
|
||||
/** @internal */
|
||||
boxShadowTabsOverflowTop: string;
|
||||
/** @internal */
|
||||
boxShadowTabsOverflowBottom: string;
|
||||
}
|
195
components/theme/interface/alias.ts
Normal file
195
components/theme/interface/alias.ts
Normal file
@ -0,0 +1,195 @@
|
||||
import type * as React from 'react';
|
||||
import type { MapToken } from './maps';
|
||||
|
||||
// ======================================================================
|
||||
// == Alias Token ==
|
||||
// ======================================================================
|
||||
// 🔥🔥🔥🔥🔥🔥🔥 DO NOT MODIFY THIS. PLEASE CONTACT DESIGNER. 🔥🔥🔥🔥🔥🔥🔥
|
||||
|
||||
export interface AliasToken extends MapToken {
|
||||
// Background
|
||||
colorFillContentHover: string;
|
||||
colorFillAlter: string;
|
||||
colorFillContent: string;
|
||||
|
||||
colorBgContainerDisabled: string;
|
||||
colorBgTextHover: string;
|
||||
colorBgTextActive: string;
|
||||
|
||||
// Border
|
||||
colorBorderBg: string;
|
||||
/**
|
||||
* @nameZH 分割线颜色
|
||||
* @desc 用于作为分割线的颜色,此颜色和 colorBorderSecondary 的颜色一致,但是用的是透明色。
|
||||
*/
|
||||
colorSplit: string;
|
||||
|
||||
// Text
|
||||
colorTextPlaceholder: string;
|
||||
colorTextDisabled: string;
|
||||
colorTextHeading: string;
|
||||
colorTextLabel: string;
|
||||
colorTextDescription: string;
|
||||
colorTextLightSolid: string;
|
||||
|
||||
/** Weak action. Such as `allowClear` or Alert close button */
|
||||
colorIcon: string;
|
||||
/** Weak action hover color. Such as `allowClear` or Alert close button */
|
||||
colorIconHover: string;
|
||||
|
||||
colorLink: string;
|
||||
colorLinkHover: string;
|
||||
colorLinkActive: string;
|
||||
|
||||
colorHighlight: string;
|
||||
|
||||
controlOutline: string;
|
||||
colorWarningOutline: string;
|
||||
colorErrorOutline: string;
|
||||
|
||||
// Font
|
||||
fontSizeSM: number;
|
||||
fontSize: number;
|
||||
fontSizeLG: number;
|
||||
fontSizeXL: number;
|
||||
/** Operation icon in Select, Cascader, etc. icon fontSize. Normal is same as fontSizeSM */
|
||||
fontSizeIcon: number;
|
||||
|
||||
/**
|
||||
* @nameZH 一级标题字号
|
||||
* @desc H1 标签所使用的字号
|
||||
* @default 38
|
||||
*/
|
||||
fontSizeHeading1: number;
|
||||
/**
|
||||
* @nameZH 二级标题字号
|
||||
* @desc h2 标签所使用的字号
|
||||
* @default 30
|
||||
*/
|
||||
fontSizeHeading2: number;
|
||||
/**
|
||||
* @nameZH 三级标题字号
|
||||
* @desc h3 标签使用的字号
|
||||
* @default 24
|
||||
*/
|
||||
fontSizeHeading3: number;
|
||||
/**
|
||||
* @nameZH 四级标题字号
|
||||
* @desc h4 标签使用的字号
|
||||
* @default 20
|
||||
*/
|
||||
fontSizeHeading4: number;
|
||||
/**
|
||||
* @nameZH 五级标题字号
|
||||
* @desc h5 标签使用的字号
|
||||
* @default 16
|
||||
*/
|
||||
fontSizeHeading5: number;
|
||||
|
||||
/** For heading like h1, h2, h3 or option selected item */
|
||||
fontWeightStrong: number;
|
||||
|
||||
// LineHeight
|
||||
lineHeight: number;
|
||||
lineHeightLG: number;
|
||||
lineHeightSM: number;
|
||||
|
||||
lineHeightHeading1: number;
|
||||
lineHeightHeading2: number;
|
||||
lineHeightHeading3: number;
|
||||
lineHeightHeading4: number;
|
||||
lineHeightHeading5: number;
|
||||
|
||||
// Control
|
||||
controlOutlineWidth: number;
|
||||
controlItemBgHover: string; // Note. It also is a color
|
||||
controlItemBgActive: string; // Note. It also is a color
|
||||
controlItemBgActiveHover: string; // Note. It also is a color
|
||||
controlInteractiveSize: number;
|
||||
controlItemBgActiveDisabled: string; // Note. It also is a color
|
||||
|
||||
// Padding
|
||||
paddingXXS: number;
|
||||
paddingXS: number;
|
||||
paddingSM: number;
|
||||
padding: number;
|
||||
paddingMD: number;
|
||||
paddingLG: number;
|
||||
paddingXL: number;
|
||||
|
||||
// Padding Content
|
||||
paddingContentHorizontalLG: number;
|
||||
paddingContentHorizontal: number;
|
||||
paddingContentHorizontalSM: number;
|
||||
paddingContentVerticalLG: number;
|
||||
paddingContentVertical: number;
|
||||
paddingContentVerticalSM: number;
|
||||
|
||||
// Margin
|
||||
marginXXS: number;
|
||||
marginXS: number;
|
||||
marginSM: number;
|
||||
margin: number;
|
||||
marginMD: number;
|
||||
marginLG: number;
|
||||
marginXL: number;
|
||||
marginXXL: number;
|
||||
|
||||
// =============== Legacy: should be remove ===============
|
||||
opacityLoading: number;
|
||||
|
||||
boxShadow: string;
|
||||
boxShadowSecondary: string;
|
||||
|
||||
linkDecoration: React.CSSProperties['textDecoration'];
|
||||
linkHoverDecoration: React.CSSProperties['textDecoration'];
|
||||
linkFocusDecoration: React.CSSProperties['textDecoration'];
|
||||
|
||||
controlPaddingHorizontal: number;
|
||||
controlPaddingHorizontalSM: number;
|
||||
|
||||
// Media queries breakpoints
|
||||
screenXS: number;
|
||||
screenXSMin: number;
|
||||
screenXSMax: number;
|
||||
screenSM: number;
|
||||
screenSMMin: number;
|
||||
screenSMMax: number;
|
||||
screenMD: number;
|
||||
screenMDMin: number;
|
||||
screenMDMax: number;
|
||||
screenLG: number;
|
||||
screenLGMin: number;
|
||||
screenLGMax: number;
|
||||
screenXL: number;
|
||||
screenXLMin: number;
|
||||
screenXLMax: number;
|
||||
screenXXL: number;
|
||||
screenXXLMin: number;
|
||||
screenXXLMax: number;
|
||||
|
||||
/** Used for DefaultButton, Switch which has default outline */
|
||||
controlTmpOutline: string;
|
||||
|
||||
// FIXME: component box-shadow, should be removed
|
||||
/** @internal */
|
||||
boxShadowPopoverArrow: string;
|
||||
/** @internal */
|
||||
boxShadowCard: string;
|
||||
/** @internal */
|
||||
boxShadowDrawerRight: string;
|
||||
/** @internal */
|
||||
boxShadowDrawerLeft: string;
|
||||
/** @internal */
|
||||
boxShadowDrawerUp: string;
|
||||
/** @internal */
|
||||
boxShadowDrawerDown: string;
|
||||
/** @internal */
|
||||
boxShadowTabsOverflowLeft: string;
|
||||
/** @internal */
|
||||
boxShadowTabsOverflowRight: string;
|
||||
/** @internal */
|
||||
boxShadowTabsOverflowTop: string;
|
||||
/** @internal */
|
||||
boxShadowTabsOverflowBottom: string;
|
||||
}
|
111
components/theme/interface/components.ts
Normal file
111
components/theme/interface/components.ts
Normal file
@ -0,0 +1,111 @@
|
||||
import type { ComponentToken as AlertComponentToken } from '../../alert/style';
|
||||
import type { ComponentToken as AnchorComponentToken } from '../../anchor/style';
|
||||
import type { ComponentToken as AvatarComponentToken } from '../../avatar/style';
|
||||
import type { ComponentToken as BackTopComponentToken } from '../../back-top/style';
|
||||
import type { ComponentToken as ButtonComponentToken } from '../../button/style';
|
||||
import type { ComponentToken as FloatButtonComponentToken } from '../../float-button/style';
|
||||
import type { ComponentToken as CalendarComponentToken } from '../../calendar/style';
|
||||
import type { ComponentToken as CardComponentToken } from '../../card/style';
|
||||
import type { ComponentToken as CarouselComponentToken } from '../../carousel/style';
|
||||
import type { ComponentToken as CascaderComponentToken } from '../../cascader/style';
|
||||
import type { ComponentToken as CheckboxComponentToken } from '../../checkbox/style';
|
||||
import type { ComponentToken as CollapseComponentToken } from '../../collapse/style';
|
||||
import type { ComponentToken as DatePickerComponentToken } from '../../date-picker/style';
|
||||
import type { ComponentToken as DividerComponentToken } from '../../divider/style';
|
||||
import type { ComponentToken as DropdownComponentToken } from '../../dropdown/style';
|
||||
import type { ComponentToken as DrawerComponentToken } from '../../drawer/style';
|
||||
import type { ComponentToken as EmptyComponentToken } from '../../empty/style';
|
||||
import type { ComponentToken as ImageComponentToken } from '../../image/style';
|
||||
import type { ComponentToken as InputNumberComponentToken } from '../../input-number/style';
|
||||
import type { ComponentToken as LayoutComponentToken } from '../../layout/style';
|
||||
import type { ComponentToken as ListComponentToken } from '../../list/style';
|
||||
import type { ComponentToken as MentionsComponentToken } from '../../mentions/style';
|
||||
import type { ComponentToken as MenuComponentToken } from '../../menu/style';
|
||||
import type { ComponentToken as MessageComponentToken } from '../../message/style';
|
||||
import type { ComponentToken as ModalComponentToken } from '../../modal/style';
|
||||
import type { ComponentToken as NotificationComponentToken } from '../../notification/style';
|
||||
import type { ComponentToken as PopconfirmComponentToken } from '../../popconfirm/style';
|
||||
import type { ComponentToken as PopoverComponentToken } from '../../popover/style';
|
||||
import type { ComponentToken as ProgressComponentToken } from '../../progress/style';
|
||||
import type { ComponentToken as RadioComponentToken } from '../../radio/style';
|
||||
import type { ComponentToken as RateComponentToken } from '../../rate/style';
|
||||
import type { ComponentToken as ResultComponentToken } from '../../result/style';
|
||||
import type { ComponentToken as SegmentedComponentToken } from '../../segmented/style';
|
||||
import type { ComponentToken as SelectComponentToken } from '../../select/style';
|
||||
import type { ComponentToken as SkeletonComponentToken } from '../../skeleton/style';
|
||||
import type { ComponentToken as SliderComponentToken } from '../../slider/style';
|
||||
import type { ComponentToken as SpaceComponentToken } from '../../space/style';
|
||||
import type { ComponentToken as SpinComponentToken } from '../../spin/style';
|
||||
import type { ComponentToken as StepsComponentToken } from '../../steps/style';
|
||||
import type { ComponentToken as TableComponentToken } from '../../table/style';
|
||||
import type { ComponentToken as TabsComponentToken } from '../../tabs/style';
|
||||
import type { ComponentToken as TagComponentToken } from '../../tag/style';
|
||||
import type { ComponentToken as TimelineComponentToken } from '../../timeline/style';
|
||||
import type { ComponentToken as TooltipComponentToken } from '../../tooltip/style';
|
||||
import type { ComponentToken as TransferComponentToken } from '../../transfer/style';
|
||||
import type { ComponentToken as TypographyComponentToken } from '../../typography/style';
|
||||
import type { ComponentToken as UploadComponentToken } from '../../upload/style';
|
||||
import type { ComponentToken as TourComponentToken } from '../../tour/style';
|
||||
|
||||
export interface ComponentTokenMap {
|
||||
Affix?: {};
|
||||
Alert?: AlertComponentToken;
|
||||
Anchor?: AnchorComponentToken;
|
||||
Avatar?: AvatarComponentToken;
|
||||
BackTop?: BackTopComponentToken;
|
||||
Badge?: {};
|
||||
Button?: ButtonComponentToken;
|
||||
Breadcrumb?: {};
|
||||
Card?: CardComponentToken;
|
||||
Carousel?: CarouselComponentToken;
|
||||
Cascader?: CascaderComponentToken;
|
||||
Checkbox?: CheckboxComponentToken;
|
||||
Collapse?: CollapseComponentToken;
|
||||
DatePicker?: DatePickerComponentToken;
|
||||
Descriptions?: {};
|
||||
Divider?: DividerComponentToken;
|
||||
Drawer?: DrawerComponentToken;
|
||||
Dropdown?: DropdownComponentToken;
|
||||
Empty?: EmptyComponentToken;
|
||||
FloatButton?: FloatButtonComponentToken;
|
||||
Form?: {};
|
||||
Grid?: {};
|
||||
Image?: ImageComponentToken;
|
||||
Input?: {};
|
||||
InputNumber?: InputNumberComponentToken;
|
||||
Layout?: LayoutComponentToken;
|
||||
List?: ListComponentToken;
|
||||
Mentions?: MentionsComponentToken;
|
||||
Notification?: NotificationComponentToken;
|
||||
Pagination?: {};
|
||||
Popover?: PopoverComponentToken;
|
||||
Popconfirm?: PopconfirmComponentToken;
|
||||
Rate?: RateComponentToken;
|
||||
Radio?: RadioComponentToken;
|
||||
Result?: ResultComponentToken;
|
||||
Segmented?: SegmentedComponentToken;
|
||||
Select?: SelectComponentToken;
|
||||
Skeleton?: SkeletonComponentToken;
|
||||
Slider?: SliderComponentToken;
|
||||
Spin?: SpinComponentToken;
|
||||
Statistic?: {};
|
||||
Switch?: {};
|
||||
Tag?: TagComponentToken;
|
||||
Tree?: {};
|
||||
TreeSelect?: {};
|
||||
Typography?: TypographyComponentToken;
|
||||
Timeline?: TimelineComponentToken;
|
||||
Transfer?: TransferComponentToken;
|
||||
Tabs?: TabsComponentToken;
|
||||
Calendar?: CalendarComponentToken;
|
||||
Steps?: StepsComponentToken;
|
||||
Menu?: MenuComponentToken;
|
||||
Modal?: ModalComponentToken;
|
||||
Message?: MessageComponentToken;
|
||||
Upload?: UploadComponentToken;
|
||||
Tooltip?: TooltipComponentToken;
|
||||
Table?: TableComponentToken;
|
||||
Space?: SpaceComponentToken;
|
||||
Progress?: ProgressComponentToken;
|
||||
Tour?: TourComponentToken;
|
||||
}
|
25
components/theme/interface/index.ts
Normal file
25
components/theme/interface/index.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import type { ComponentTokenMap } from './components';
|
||||
import type { AliasToken } from './alias';
|
||||
|
||||
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 { PresetColors } from './presetColors';
|
||||
export type { PresetColorType, ColorPalettes } from './presetColors';
|
||||
export type { SeedToken } from './seeds';
|
||||
export type {
|
||||
MapToken,
|
||||
ColorMapToken,
|
||||
ColorNeutralMapToken,
|
||||
CommonMapToken,
|
||||
HeightMapToken,
|
||||
SizeMapToken,
|
||||
FontSizeMapToken,
|
||||
StyleMapToken,
|
||||
} from './maps';
|
||||
export type { AliasToken } from './alias';
|
||||
export type { ComponentTokenMap } from './components';
|
437
components/theme/interface/maps/colors.ts
Normal file
437
components/theme/interface/maps/colors.ts
Normal file
@ -0,0 +1,437 @@
|
||||
export interface ColorNeutralMapToken {
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
colorTextBase: string;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
colorBgBase: string;
|
||||
|
||||
// ---------- Text ---------- //
|
||||
|
||||
/**
|
||||
* @nameZH 一级文本色
|
||||
* @desc 最深的文本色。为了符合W3C标准,默认的文本颜色使用了该色,同时这个颜色也是最深的中性色。
|
||||
*/
|
||||
colorText: string;
|
||||
|
||||
/**
|
||||
* @nameZH 二级文本色
|
||||
* @desc 作为第二梯度的文本色,一般用在不那么需要强化文本颜色的场景,例如 Label 文本、Menu 的文本选中态等场景。
|
||||
*/
|
||||
colorTextSecondary: string;
|
||||
|
||||
/**
|
||||
* @nameZH 三级文本色
|
||||
* @desc 第三级文本色一般用于描述性文本,例如表单的中的补充说明文本、列表的描述性文本等场景。
|
||||
*/
|
||||
colorTextTertiary: string;
|
||||
|
||||
/**
|
||||
* @nameZH 四级文本色
|
||||
* @desc 第四级文本色是最浅的文本色,例如表单的输入提示文本、禁用色文本等。
|
||||
*/
|
||||
colorTextQuaternary: string;
|
||||
|
||||
// ---------- Border ---------- //
|
||||
|
||||
/**
|
||||
* @nameZH 一级边框色
|
||||
* @nameEN Default Border Color
|
||||
* @desc 默认使用的边框颜色, 用于分割不同的元素,例如:表单的分割线、卡片的分割线等。
|
||||
* @descEN Default border color, used to separate different elements, such as: form separator, card separator, etc.
|
||||
*/
|
||||
colorBorder: string;
|
||||
|
||||
/**
|
||||
* @nameZH 二级边框色
|
||||
* @nameEN Secondary Border Color
|
||||
* @desc 比默认使用的边框色要浅一级,此颜色和 colorSplit 的颜色一致。使用的是实色。
|
||||
* @descEN Slightly lighter than the default border color, this color is the same as `colorSplit`. Solid color is used.
|
||||
*/
|
||||
colorBorderSecondary: string;
|
||||
|
||||
// ---------- Fill ---------- //
|
||||
|
||||
/**
|
||||
* @nameZH 一级填充色
|
||||
* @desc 最深的填充色,用于拉开与二、三级填充色的区分度,目前只用在 Slider 的 hover 效果。
|
||||
*/
|
||||
colorFill: string;
|
||||
|
||||
/**
|
||||
* @nameZH 二级填充色
|
||||
* @desc 二级填充色可以较为明显地勾勒出元素形体,如 Rate、Skeleton 等。也可以作为三级填充色的 Hover 状态,如 Table 等。
|
||||
*/
|
||||
colorFillSecondary: string;
|
||||
|
||||
/**
|
||||
* @nameZH 三级填充色
|
||||
* @desc 三级填充色用于勾勒出元素形体的场景,如 Slider、Segmented 等。如无强调需求的情况下,建议使用三级填色作为默认填色。
|
||||
*/
|
||||
colorFillTertiary: string;
|
||||
|
||||
/**
|
||||
* @nameZH 四级填充色
|
||||
* @desc 最弱一级的填充色,适用于不易引起注意的色块,例如斑马纹、区分边界的色块等。
|
||||
*/
|
||||
colorFillQuaternary: string;
|
||||
|
||||
// ---------- Surface ---------- //
|
||||
|
||||
/**
|
||||
* @nameZH 布局背景色
|
||||
* @desc 该色用于页面整体布局的背景色,只有需要在页面中处于 B1 的视觉层级时才会使用该 token,其他用法都是错误的
|
||||
*/
|
||||
colorBgLayout: string;
|
||||
|
||||
/**
|
||||
* @nameZH 组件容器背景色
|
||||
* @desc 组件的容器背景色,例如:默认按钮、输入框等。务必不要将其与 `colorBgElevated` 混淆。
|
||||
*/
|
||||
colorBgContainer: string;
|
||||
|
||||
/**
|
||||
* @nameZH 浮层容器背景色
|
||||
* @desc 浮层容器背景色,在暗色模式下该 token 的色值会比 `colorBgContainer` 要亮一些。例如:模态框、弹出框、菜单等。
|
||||
*/
|
||||
colorBgElevated: string;
|
||||
|
||||
/**
|
||||
* @nameZH 引起注意的背景色
|
||||
* @desc 该色用于引起用户强烈关注注意的背景色,目前只用在 Tooltip 的背景色上。
|
||||
*/
|
||||
colorBgSpotlight: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 品牌色梯度变量
|
||||
*/
|
||||
interface ColorPrimaryMapToken {
|
||||
/**
|
||||
* @nameZH 品牌主色
|
||||
* @desc 品牌色是体现产品特性和传播理念最直观的视觉元素之一,用于产品的主色调、主按钮、主图标、主文本等 */
|
||||
colorPrimary: string; // 6
|
||||
|
||||
/**
|
||||
* @nameZH 主色浅色背景色
|
||||
* @nameEN Light Background Color of Primary Color
|
||||
* @desc 主色浅色背景颜色,一般用于视觉层级较弱的选中状态。
|
||||
* @descEN Light background color of primary color, usually used for weak visual level selection state.
|
||||
*/
|
||||
colorPrimaryBg: string; // 1
|
||||
|
||||
/**
|
||||
* @nameZH 主色浅色背景悬浮态
|
||||
* @desc 与主色浅色背景颜色相对应的悬浮态颜色。
|
||||
*/
|
||||
colorPrimaryBgHover: string; // 2
|
||||
|
||||
/**
|
||||
* @nameZH 主色描边色
|
||||
* @desc 主色梯度下的描边用色,用在 Slider 组件的描边上
|
||||
*/
|
||||
colorPrimaryBorder: string; // 3
|
||||
|
||||
/**
|
||||
* @nameZH 主色描边色悬浮态
|
||||
* @desc 主色梯度下的描边用色的悬浮态,Slider 、Button 等组件的描边 Hover 时会使用
|
||||
*/
|
||||
colorPrimaryBorderHover: string; // 4
|
||||
|
||||
/**
|
||||
* @nameZH 主色悬浮态
|
||||
* @desc 主色梯度下的悬浮态,使用频率很高
|
||||
*/
|
||||
colorPrimaryHover: string; // 5
|
||||
|
||||
/**
|
||||
* @nameZH 主色激活态
|
||||
* @desc 主色梯度下的深色激活态
|
||||
*/
|
||||
colorPrimaryActive: string; // 7
|
||||
|
||||
/**
|
||||
* @nameZH 主色文本悬浮态
|
||||
* @desc 主色梯度下的文本悬浮态
|
||||
*/
|
||||
colorPrimaryTextHover: string; // 8
|
||||
|
||||
/**
|
||||
* @nameZH 主色文本
|
||||
* @desc 主色梯度下的文本颜色
|
||||
*/
|
||||
colorPrimaryText: string; // 9
|
||||
|
||||
/**
|
||||
* @nameZH 主色文本
|
||||
* @desc 主色梯度下的文本激活态
|
||||
*/
|
||||
colorPrimaryTextActive: string; // 10
|
||||
}
|
||||
|
||||
interface ColorSuccessMapToken {
|
||||
/**
|
||||
* @nameZH 成功色的浅色背景颜色
|
||||
* @nameEN Light Background Color of Success Color
|
||||
* @desc 成功色的浅色背景颜色,用于 Tag 和 Alert 的成功态背景色
|
||||
* @descEN Light background color of success color, used for Tag and Alert success state background color
|
||||
*/
|
||||
colorSuccessBg: string; // 1
|
||||
|
||||
/**
|
||||
* @nameZH 成功色的浅色背景色悬浮态
|
||||
* @nameEN Hover State Color of Light Success Background
|
||||
* @desc 成功色浅色背景颜色,一般用于视觉层级较弱的选中状态,不过 antd 目前没有使用到该 token
|
||||
* @descEN Light background color of success color, but antd does not use this token currently
|
||||
*/
|
||||
colorSuccessBgHover: string; // 2
|
||||
|
||||
/**
|
||||
* @nameZH 成功色的描边色
|
||||
* @desc 成功色的描边色,用于 Tag 和 Alert 的成功态描边色
|
||||
*/
|
||||
colorSuccessBorder: string; // 3
|
||||
|
||||
/**
|
||||
* @nameZH 成功色的描边色悬浮态
|
||||
* @desc 成功色的描边色悬浮态
|
||||
*/
|
||||
colorSuccessBorderHover: string; // 4
|
||||
|
||||
/**
|
||||
* @nameZH 成功色的深色悬浮态
|
||||
* @desc 成功色的深色悬浮态
|
||||
*/
|
||||
colorSuccessHover: string; // 5
|
||||
|
||||
/**
|
||||
* @nameZH 成功色
|
||||
* @desc 默认的成功色,如 Result、Progress 等组件中都有使用该颜色
|
||||
*/
|
||||
colorSuccess: string; // 6
|
||||
|
||||
/**
|
||||
* @nameZH 成功色的深色激活态
|
||||
* @desc 成功色的深色激活态
|
||||
*/
|
||||
colorSuccessActive: string; // 7
|
||||
|
||||
/**
|
||||
* @nameZH 成功色的文本悬浮态
|
||||
* @desc 成功色的文本悬浮态
|
||||
*/
|
||||
colorSuccessTextHover: string; // 8
|
||||
|
||||
/**
|
||||
* @nameZH 成功色的文本默认态
|
||||
* @desc 成功色的文本默认态
|
||||
*/
|
||||
colorSuccessText: string; // 9
|
||||
|
||||
/**
|
||||
* @nameZH 成功色的文本激活态
|
||||
* @desc 成功色的文本激活态
|
||||
*/
|
||||
colorSuccessTextActive: string; // 10
|
||||
}
|
||||
|
||||
interface ColorWarningMapToken {
|
||||
/**
|
||||
* @nameZH 警戒色的浅色背景颜色
|
||||
*/
|
||||
colorWarningBg: string; // 1
|
||||
|
||||
/**
|
||||
* @nameZH 警戒色的浅色背景色悬浮态
|
||||
* @desc 警戒色的浅色背景色悬浮态
|
||||
*/
|
||||
colorWarningBgHover: string; // 2
|
||||
|
||||
/**
|
||||
* @nameZH 警戒色的描边色
|
||||
* @desc 警戒色的描边色
|
||||
*/
|
||||
colorWarningBorder: string; // 3
|
||||
|
||||
/**
|
||||
* @nameZH 警戒色的描边色悬浮态
|
||||
* @desc 警戒色的描边色悬浮态
|
||||
*/
|
||||
colorWarningBorderHover: string; // 4
|
||||
|
||||
/**
|
||||
* @nameZH 警戒色的深色悬浮态
|
||||
* @desc 警戒色的深色悬浮态
|
||||
*/
|
||||
colorWarningHover: string; // 5
|
||||
|
||||
/**
|
||||
* @nameZH 警戒色
|
||||
* @desc 最常用的警戒色,例如 Notification、 Alert等警告类组件或 Input 输入类等组件会使用该颜色
|
||||
*/
|
||||
colorWarning: string; // 6
|
||||
|
||||
/**
|
||||
* @nameZH 警戒色的深色激活态
|
||||
* @desc 警戒色的深色激活态
|
||||
*/
|
||||
colorWarningActive: string; // 7
|
||||
|
||||
/**
|
||||
* @nameZH 警戒色的文本悬浮态
|
||||
* @desc 警戒色的文本悬浮态
|
||||
*/
|
||||
colorWarningTextHover: string; // 8
|
||||
|
||||
/**
|
||||
* @nameZH 警戒色的文本默认态
|
||||
* @desc 警戒色的文本默认态
|
||||
*/
|
||||
colorWarningText: string; // 9
|
||||
|
||||
/**
|
||||
* @nameZH 警戒色的文本激活态
|
||||
* @desc 警戒色的文本激活态
|
||||
*/
|
||||
colorWarningTextActive: string; // 10
|
||||
}
|
||||
|
||||
interface ColorInfoMapToken {
|
||||
/**
|
||||
* @nameZH 信息色的浅色背景颜色
|
||||
* @desc 信息色的浅色背景颜色
|
||||
*/
|
||||
colorInfoBg: string; // 1
|
||||
|
||||
/**
|
||||
* @nameZH 信息色的浅色背景色悬浮态
|
||||
* @desc 信息色的浅色背景色悬浮态
|
||||
*/
|
||||
colorInfoBgHover: string; // 2
|
||||
|
||||
/**
|
||||
* @nameZH 信息色的描边色
|
||||
*/
|
||||
colorInfoBorder: string; // 3
|
||||
|
||||
/**
|
||||
* @nameZH 信息色的描边色悬浮态
|
||||
*/
|
||||
colorInfoBorderHover: string; // 4
|
||||
|
||||
/**
|
||||
* @nameZH 信息色的深色悬浮态
|
||||
*/
|
||||
colorInfoHover: string; // 5
|
||||
|
||||
/**
|
||||
* @nameZH 信息色
|
||||
*/
|
||||
colorInfo: string; // 6
|
||||
|
||||
/**
|
||||
* @nameZH 信息色的深色激活态
|
||||
*/
|
||||
colorInfoActive: string; // 7
|
||||
|
||||
/**
|
||||
* @nameZH 信息色的文本悬浮态
|
||||
*/
|
||||
colorInfoTextHover: string; // 8
|
||||
|
||||
/**
|
||||
* @nameZH 信息色的文本默认态
|
||||
*/
|
||||
colorInfoText: string; // 9
|
||||
|
||||
/**
|
||||
* @nameZH 信息色的文本激活态
|
||||
*/
|
||||
colorInfoTextActive: string; // 10
|
||||
}
|
||||
|
||||
interface ColorErrorMapToken {
|
||||
/**
|
||||
* @nameZH 错误色的浅色背景颜色
|
||||
*/
|
||||
colorErrorBg: string; // 1
|
||||
|
||||
/**
|
||||
* @nameZH 错误色的浅色背景色悬浮态
|
||||
*/
|
||||
colorErrorBgHover: string; // 2
|
||||
|
||||
/**
|
||||
* @nameZH 错误色的描边色
|
||||
*/
|
||||
colorErrorBorder: string; // 3
|
||||
|
||||
/**
|
||||
* @nameZH 错误色的描边色悬浮态
|
||||
*/
|
||||
colorErrorBorderHover: string; // 4
|
||||
|
||||
/**
|
||||
* @nameZH 错误色的深色悬浮态
|
||||
*/
|
||||
colorErrorHover: string; // 5
|
||||
|
||||
/**
|
||||
* @nameZH 错误色
|
||||
*/
|
||||
colorError: string; // 6
|
||||
|
||||
/**
|
||||
* @nameZH 错误色的深色激活态
|
||||
*/
|
||||
colorErrorActive: string; // 7
|
||||
|
||||
/**
|
||||
* @nameZH 错误色的文本悬浮态
|
||||
*/
|
||||
colorErrorTextHover: string; // 8
|
||||
|
||||
/**
|
||||
* @nameZH 错误色的文本默认态
|
||||
*/
|
||||
colorErrorText: string; // 9
|
||||
|
||||
/**
|
||||
* @nameZH 错误色的文本激活态
|
||||
*/
|
||||
colorErrorTextActive: string; // 10
|
||||
}
|
||||
|
||||
export interface ColorMapToken
|
||||
extends ColorNeutralMapToken,
|
||||
ColorPrimaryMapToken,
|
||||
ColorSuccessMapToken,
|
||||
ColorWarningMapToken,
|
||||
ColorErrorMapToken,
|
||||
ColorInfoMapToken {
|
||||
/**
|
||||
* @nameZH 纯白色
|
||||
* @desc 不随主题变化的纯白色
|
||||
* @descEN Pure white color don't changed by theme
|
||||
* @default #FFFFFF
|
||||
*/
|
||||
colorWhite: string;
|
||||
|
||||
/**
|
||||
* @nameZH 浮层的背景蒙层颜色
|
||||
* @nameEN Background color of the mask
|
||||
* @desc 浮层的背景蒙层颜色,用于遮罩浮层下面的内容,Modal、Drawer 等组件的蒙层使用的是该 token
|
||||
* @descEN The background color of the mask, used to cover the content below the mask, Modal, Drawer and other components use this token
|
||||
*/
|
||||
colorBgMask: string;
|
||||
|
||||
/**
|
||||
* @nameZH 纯黑色
|
||||
* @desc 不随主题变化的纯黑色
|
||||
* @default #0000
|
||||
*/
|
||||
// colorBlack: string;
|
||||
}
|
30
components/theme/interface/maps/index.ts
Normal file
30
components/theme/interface/maps/index.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import type { ColorPalettes } from '../presetColors';
|
||||
import type { SeedToken } from '../seeds';
|
||||
import type { SizeMapToken, HeightMapToken, FontSizeMapToken } from './size';
|
||||
import type { ColorMapToken } from './colors';
|
||||
import type { StyleMapToken } from './style';
|
||||
|
||||
export * from './colors';
|
||||
export * from './style';
|
||||
export * from './size';
|
||||
|
||||
export interface CommonMapToken extends FontSizeMapToken, StyleMapToken {
|
||||
// Motion
|
||||
motionDurationFast: string;
|
||||
motionDurationMid: string;
|
||||
motionDurationSlow: string;
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
// == Map Token ==
|
||||
// ======================================================================
|
||||
// 🔥🔥🔥🔥🔥🔥🔥 DO NOT MODIFY THIS. PLEASE CONTACT DESIGNER. 🔥🔥🔥🔥🔥🔥🔥
|
||||
|
||||
export interface MapToken
|
||||
extends SeedToken,
|
||||
ColorPalettes,
|
||||
ColorMapToken,
|
||||
SizeMapToken,
|
||||
HeightMapToken,
|
||||
StyleMapToken,
|
||||
CommonMapToken {}
|
67
components/theme/interface/maps/size.ts
Normal file
67
components/theme/interface/maps/size.ts
Normal file
@ -0,0 +1,67 @@
|
||||
export interface SizeMapToken {
|
||||
/**
|
||||
* @nameZH XXL
|
||||
* @default 48
|
||||
*/
|
||||
sizeXXL: number;
|
||||
/**
|
||||
* @nameZH XL
|
||||
* @default 32
|
||||
*/
|
||||
sizeXL: number;
|
||||
/**
|
||||
* @nameZH LG
|
||||
* @default 24
|
||||
*/
|
||||
sizeLG: number;
|
||||
/**
|
||||
* @nameZH MD
|
||||
* @default 20
|
||||
*/
|
||||
sizeMD: number;
|
||||
/** Same as size by default, but could be larger in compact mode */
|
||||
sizeMS: number;
|
||||
/**
|
||||
* @nameZH 默认
|
||||
* @desc 默认尺寸
|
||||
* @default 16
|
||||
*/
|
||||
size: number;
|
||||
/**
|
||||
* @nameZH SM
|
||||
* @default 12
|
||||
*/
|
||||
sizeSM: number;
|
||||
/**
|
||||
* @nameZH XS
|
||||
* @default 8
|
||||
*/
|
||||
sizeXS: number;
|
||||
/**
|
||||
* @nameZH XXS
|
||||
* @default 4
|
||||
*/
|
||||
sizeXXS: number;
|
||||
}
|
||||
|
||||
export interface HeightMapToken {
|
||||
// Control
|
||||
/** @internal Only Used for control inside component like Multiple Select inner selection item */
|
||||
controlHeightXS: number;
|
||||
/** @internal */
|
||||
controlHeightSM: number;
|
||||
/** @internal */
|
||||
controlHeightLG: number;
|
||||
}
|
||||
|
||||
// Font
|
||||
export interface FontSizeMapToken {
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
fontSizes: number[];
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
lineHeights: number[];
|
||||
}
|
39
components/theme/interface/maps/style.ts
Normal file
39
components/theme/interface/maps/style.ts
Normal file
@ -0,0 +1,39 @@
|
||||
export interface StyleMapToken {
|
||||
/**
|
||||
* @nameZH 线宽
|
||||
* @nameEN Line Width
|
||||
* @desc 描边类组件的默认线宽,如 Button、Input、Select 等输入类控件。
|
||||
* @descEN The default line width of the outline class components, such as Button, Input, Select, etc.
|
||||
* @default 1
|
||||
*/
|
||||
lineWidthBold: number;
|
||||
|
||||
/**
|
||||
* @nameZH XS号圆角
|
||||
* @desc XS号圆角,用于组件中的一些小圆角,如 Segmented 、Arrow 等一些内部圆角的组件样式中。
|
||||
* @descEN XS size border radius, used in some small border radius components, such as Segmented, Arrow and other components.
|
||||
* @default 2
|
||||
*/
|
||||
borderRadiusXS: number;
|
||||
/**
|
||||
* @nameZH SM号圆角
|
||||
* @nameEN SM Border Radius
|
||||
* @desc SM号圆角,用于组件小尺寸下的圆角,如 Button、Input、Select 等输入类控件在 small size 下的圆角
|
||||
* @descEN SM size border radius, used in small size components, such as Button, Input, Select and other input components in small size
|
||||
* @default 4
|
||||
*/
|
||||
borderRadiusSM: number;
|
||||
/**
|
||||
* @nameZH LG号圆角
|
||||
* @nameEN LG Border Radius
|
||||
* @desc LG号圆角,用于组件中的一些大圆角,如 Card、Modal 等一些组件样式。
|
||||
* @descEN LG size border radius, used in some large border radius components, such as Card, Modal and other components.
|
||||
* @default 8
|
||||
*/
|
||||
borderRadiusLG: number;
|
||||
/**
|
||||
* @default 4
|
||||
* @internal
|
||||
*/
|
||||
borderRadiusOuter: number;
|
||||
}
|
25
components/theme/interface/presetColors.ts
Normal file
25
components/theme/interface/presetColors.ts
Normal file
@ -0,0 +1,25 @@
|
||||
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;
|
||||
};
|
240
components/theme/interface/seeds.ts
Normal file
240
components/theme/interface/seeds.ts
Normal file
@ -0,0 +1,240 @@
|
||||
import type { PresetColorType } from './presetColors';
|
||||
// ======================================================================
|
||||
// == Seed Token ==
|
||||
// ======================================================================
|
||||
// 🔥🔥🔥🔥🔥🔥🔥 DO NOT MODIFY THIS. PLEASE CONTACT DESIGNER. 🔥🔥🔥🔥🔥🔥🔥
|
||||
|
||||
export interface SeedToken extends PresetColorType {
|
||||
// ---------- Color ---------- //
|
||||
|
||||
/**
|
||||
* @nameZH 品牌主色
|
||||
* @nameEN Brand Color
|
||||
* @desc 品牌色是体现产品特性和传播理念最直观的视觉元素之一。在你完成品牌主色的选取之后,我们会自动帮你生成一套完整的色板,并赋予它们有效的设计语义
|
||||
* @descEN Brand color is one of the most direct visual elements to reflect the characteristics and communication of the product. After you have selected the brand color, we will automatically generate a complete color palette and assign it effective design semantics.
|
||||
*/
|
||||
colorPrimary: string;
|
||||
|
||||
/**
|
||||
* @nameZH 成功色
|
||||
* @nameEN Success Color
|
||||
* @desc 用于表示操作成功的 Token 序列,如 Result、Progress 等组件会使用该组梯度变量。
|
||||
* @descEN Used to represent the token sequence of operation success, such as Result, Progress and other components will use these map tokens.
|
||||
*/
|
||||
colorSuccess: string;
|
||||
|
||||
/**
|
||||
* @nameZH 警戒色
|
||||
* @nameEN Warning Color
|
||||
* @desc 用于表示操作警告的 Token 序列,如 Notification、 Alert等警告类组件或 Input 输入类等组件会使用该组梯度变量。
|
||||
* @descEN Used to represent the warning map token, such as Notification, Alert, etc. Alert or Control component(like Input) will use these map tokens.
|
||||
*/
|
||||
colorWarning: string;
|
||||
|
||||
/**
|
||||
* @nameZH 错误色
|
||||
* @nameEN Error Color
|
||||
* @desc 用于表示操作失败的 Token 序列,如失败按钮、错误状态提示(Result)组件等。
|
||||
* @descEN Used to represent the visual elements of the operation failure, such as the error Button, error Result component, etc.
|
||||
*/
|
||||
colorError: string;
|
||||
|
||||
/**
|
||||
* @nameZH 信息色
|
||||
* @desc 用于表示操作信息的 Token 序列,如 Alert 、Tag、 Progress 等组件都有用到该组梯度变量。
|
||||
* @descEN Used to represent the operation information of the Token sequence, such as Alert, Tag, Progress, and other components use these map tokens.
|
||||
*/
|
||||
colorInfo: string;
|
||||
|
||||
/**
|
||||
* @nameZH 基础文本色
|
||||
* @nameEN Seed Text Color
|
||||
* @desc 用于派生文本色梯度的基础变量,v5 中我们添加了一层文本色的派生算法可以产出梯度明确的文本色的梯度变量。但**请不要在代码中直接使用该 Seed Token**!
|
||||
* @descEN Used to derive the base variable of the text color gradient. In v5, we added a layer of text color derivation algorithm to produce gradient variables of text color gradient. But please do not use this Seed Token directly in the code!
|
||||
*/
|
||||
colorTextBase: string;
|
||||
|
||||
/**
|
||||
* @nameZH 基础背景色
|
||||
* @nameEN Seed Background Color
|
||||
* @desc 用于派生背景色梯度的基础变量,v5 中我们添加了一层背景色的派生算法可以产出梯度明确的背景色的梯度变量。但 **请不要在代码中直接使用该 Seed Token** !
|
||||
* @descEN Used to derive the base variable of the background color gradient. In v5, we added a layer of background color derivation algorithm to produce map token of background color. But PLEASE DO NOT USE this Seed Token directly in the code!
|
||||
*/
|
||||
colorBgBase: string;
|
||||
|
||||
// ---------- Font ---------- //
|
||||
|
||||
/**
|
||||
* @nameZH 字体
|
||||
* @nameEN FontFamily
|
||||
* @desc Ant Design 的字体家族中优先使用系统默认的界面字体,同时提供了一套利于屏显的备用字体库,来维护在不同平台以及浏览器的显示下,字体始终保持良好的易读性和可读性,体现了友好、稳定和专业的特性。
|
||||
*/
|
||||
fontFamily: string;
|
||||
|
||||
/**
|
||||
* @nameZH 默认字号
|
||||
* @desc 设计系统中使用最广泛的字体大小,文本梯度也将基于该字号进行派生。
|
||||
* @default 14
|
||||
*/
|
||||
fontSize: number;
|
||||
|
||||
// ---------- Line ---------- //
|
||||
|
||||
/**
|
||||
* @nameZH 基础线宽
|
||||
* @nameEN Base Line Width
|
||||
* @desc 用于控制组件边框、分割线等的宽度
|
||||
* @descEN Border width of base components
|
||||
*/
|
||||
lineWidth: number;
|
||||
|
||||
/**
|
||||
* @nameZH 线条样式
|
||||
* @nameEN Line Style
|
||||
* @desc 用于控制组件边框、分割线等的样式,默认是实线
|
||||
* @descEN Border style of base components
|
||||
*/
|
||||
lineType: string;
|
||||
|
||||
// ---------- BorderRadius ---------- //
|
||||
|
||||
/**
|
||||
* @nameZH 基础圆角
|
||||
* @nameEN Base Border Radius
|
||||
* @descEN Border radius of base components
|
||||
* @desc 基础组件的圆角大小,例如按钮、输入框、卡片等
|
||||
*/
|
||||
borderRadius: number;
|
||||
|
||||
// ---------- Size ---------- //
|
||||
|
||||
/**
|
||||
* @nameZH 尺寸变化单位
|
||||
* @nameEN Size Change Unit
|
||||
* @desc 用于控制组件尺寸的变化单位,在 Ant Design 中我们的基础单位为 4 ,便于更加细致地控制尺寸梯度
|
||||
* @descEN The unit of size change, in Ant Design, our base unit is 4, which is more fine-grained control of the size step
|
||||
* @default 4
|
||||
*/
|
||||
sizeUnit: number;
|
||||
|
||||
/**
|
||||
* @nameZH 尺寸步长
|
||||
* @nameEN Size Base Step
|
||||
* @desc 用于控制组件尺寸的基础步长,尺寸步长结合尺寸变化单位,就可以派生各种尺寸梯度。通过调整步长即可得到不同的布局模式,例如 V5 紧凑模式下的尺寸步长为 2
|
||||
* @descEN The base step of size change, the size step combined with the size change unit, can derive various size steps. By adjusting the step, you can get different layout modes, such as the size step of the compact mode of V5 is 2
|
||||
* @default 4
|
||||
*/
|
||||
sizeStep: number;
|
||||
|
||||
/**
|
||||
* @nameZH 组件箭头尺寸
|
||||
* @internal
|
||||
*/
|
||||
sizePopupArrow: number;
|
||||
|
||||
/**
|
||||
* @nameZH 基础高度
|
||||
* @nameEN Base Control Height
|
||||
* @desc Ant Design 中按钮和输入框等基础控件的高度
|
||||
* @descEN The height of the basic controls such as buttons and input boxes in Ant Design
|
||||
* @default 32
|
||||
*/
|
||||
controlHeight: number;
|
||||
|
||||
// ---------- zIndex ---------- //
|
||||
|
||||
/**
|
||||
* @nameZH 基础 zIndex
|
||||
* @nameEN Base zIndex
|
||||
* @desc 所有组件的基础 Z 轴值,用于一些悬浮类的组件的可以基于该值 Z 轴控制层级,例如 BackTop、 Affix 等
|
||||
* @descEN The base Z axis value of all components, which can be used to control the level of some floating components based on the Z axis value, such as BackTop, Affix, etc.
|
||||
*
|
||||
* @default 0
|
||||
*/
|
||||
zIndexBase: number;
|
||||
|
||||
/**
|
||||
* @nameZH 浮层基础 zIndex
|
||||
* @nameEN popup base zIndex
|
||||
* @desc 浮层类组件的基础 Z 轴值,用于一些悬浮类的组件的可以基于该值 Z 轴控制层级,例如 FloatButton、 Affix、Modal 等
|
||||
* @descEN Base zIndex of component like FloatButton, Affix which can be cover by large popup
|
||||
* @default 1000
|
||||
*/
|
||||
zIndexPopupBase: number;
|
||||
|
||||
// ---------- Opacity ---------- //
|
||||
|
||||
/**
|
||||
* @nameZH 图片不透明度
|
||||
* @nameEN Define default Image opacity. Useful when in dark-like theme
|
||||
* @internal
|
||||
*/
|
||||
opacityImage: number;
|
||||
|
||||
// ---------- motion ---------- //
|
||||
// TODO: 缺一个懂 motion 的人来收敛 Motion 相关的 Token
|
||||
|
||||
/**
|
||||
* @nameZH 动画时长变化单位
|
||||
* @nameEN Animation Duration Unit
|
||||
* @desc 用于控制动画时长的变化单位
|
||||
* @descEN The unit of animation duration change
|
||||
* @default 100ms
|
||||
*/
|
||||
motionUnit: number;
|
||||
|
||||
/**
|
||||
* @nameZH 动画基础时长
|
||||
* @internal
|
||||
*/
|
||||
motionBase: number;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
motionEaseOutCirc: string;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
motionEaseInOutCirc: string;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
motionEaseInOut: string;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
motionEaseOutBack: string;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
motionEaseInBack: string;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
motionEaseInQuint: string;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
motionEaseOutQuint: string;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
motionEaseOut: string;
|
||||
|
||||
// ---------- Style ---------- //
|
||||
|
||||
/**
|
||||
* @nameZH 线框化
|
||||
* @desc 用于将组件的视觉效果变为线框化,如果需要使用 V4 的效果,需要开启配置项
|
||||
* @default false
|
||||
*/
|
||||
wireframe: boolean;
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
import type { NeutralColorMapToken } from '../interface';
|
||||
import type { ColorNeutralMapToken } from '../interface';
|
||||
|
||||
export interface ColorMap {
|
||||
1: string;
|
||||
@ -17,4 +17,4 @@ export type GenerateColorMap = (baseColor: string) => ColorMap;
|
||||
export type GenerateNeutralColorMap = (
|
||||
bgBaseColor: string,
|
||||
textBaseColor: string,
|
||||
) => NeutralColorMapToken;
|
||||
) => ColorNeutralMapToken;
|
||||
|
@ -6,11 +6,14 @@ const getTokenList = (list, source) =>
|
||||
.filter((item) => !item.comment?.blockTags.some((tag) => tag.tag === '@internal'))
|
||||
.map((item) => ({
|
||||
source,
|
||||
name: item.name,
|
||||
token: item.name,
|
||||
type: item.type.toString(),
|
||||
desc: item.comment?.blockTags?.find((tag) => tag.tag === '@desc')?.content[0]?.text || '-',
|
||||
descEn:
|
||||
item.comment?.blockTags?.find((tag) => tag.tag === '@descEn')?.content[0]?.text || '-',
|
||||
item.comment?.blockTags?.find((tag) => tag.tag === '@descEN')?.content[0]?.text || '-',
|
||||
name: item.comment?.blockTags?.find((tag) => tag.tag === '@nameZH')?.content[0]?.text || '-',
|
||||
nameEn:
|
||||
item.comment?.blockTags?.find((tag) => tag.tag === '@nameEN')?.content[0]?.text || '-',
|
||||
}));
|
||||
|
||||
function main() {
|
||||
@ -22,7 +25,7 @@ function main() {
|
||||
|
||||
app.bootstrap({
|
||||
// typedoc options here
|
||||
entryPoints: ['components/theme/interface.ts'],
|
||||
entryPoints: ['components/theme/interface/index.ts'],
|
||||
});
|
||||
|
||||
const project = app.convert();
|
||||
@ -46,20 +49,20 @@ function main() {
|
||||
|
||||
// Exclude preset colors
|
||||
tokenMeta.seed = tokenMeta.seed.filter(
|
||||
(item) => !presetColors.some((color) => item.name.startsWith(color)),
|
||||
(item) => !presetColors.some((color) => item.token.startsWith(color)),
|
||||
);
|
||||
tokenMeta.map = tokenMeta.map.filter(
|
||||
(item) => !presetColors.some((color) => item.name.startsWith(color)),
|
||||
(item) => !presetColors.some((color) => item.token.startsWith(color)),
|
||||
);
|
||||
tokenMeta.alias = tokenMeta.alias.filter(
|
||||
(item) => !presetColors.some((color) => item.name.startsWith(color)),
|
||||
(item) => !presetColors.some((color) => item.token.startsWith(color)),
|
||||
);
|
||||
|
||||
tokenMeta.alias = tokenMeta.alias.filter(
|
||||
(item) => !tokenMeta.map.some((mapItem) => mapItem.name === item.name),
|
||||
(item) => !tokenMeta.map.some((mapItem) => mapItem.token === item.token),
|
||||
);
|
||||
tokenMeta.map = tokenMeta.map.filter(
|
||||
(item) => !tokenMeta.seed.some((seedItem) => seedItem.name === item.name),
|
||||
(item) => !tokenMeta.seed.some((seedItem) => seedItem.token === item.token),
|
||||
);
|
||||
|
||||
fs.writeJsonSync(output, tokenMeta, 'utf8');
|
||||
|
Loading…
Reference in New Issue
Block a user