@4399ywkf/theme-system 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +33 -33
- package/dist/index.js +1248 -135
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MappingAlgorithm, AliasToken } from 'antd/es/theme/interface';
|
|
2
2
|
import { ThemeConfig } from 'antd';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Lobe-UI 风格自定义 antd 主题算法
|
|
6
|
+
*
|
|
7
|
+
* 不使用 antd 默认的 defaultAlgorithm / darkAlgorithm,
|
|
8
|
+
* 而是基于预设的 13 阶色阶生成完整的 token 覆盖。
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
declare const lightAlgorithm: MappingAlgorithm;
|
|
12
|
+
declare const darkAlgorithm: MappingAlgorithm;
|
|
13
|
+
|
|
4
14
|
type ColorStep = [
|
|
5
15
|
string,
|
|
6
16
|
string,
|
|
@@ -26,14 +36,20 @@ type PrimaryColors = "blue" | "cyan" | "geekblue" | "gold" | "green" | "lime" |
|
|
|
26
36
|
type NeutralColors = "mauve" | "olive" | "sage" | "sand" | "slate";
|
|
27
37
|
|
|
28
38
|
/**
|
|
29
|
-
* Lobe-UI
|
|
30
|
-
*
|
|
39
|
+
* 创建 Lobe-UI 风格的 antd ThemeConfig
|
|
40
|
+
*
|
|
41
|
+
* 对标 lobe-ui 的 createLobeAntdTheme:
|
|
42
|
+
* - 根据 appearance 选择 lightAlgorithm / darkAlgorithm
|
|
43
|
+
* - 通过 seedToken 传递 primaryColor / neutralColor 名称
|
|
44
|
+
* - 算法内部根据名称查找色阶并生成完整 token
|
|
31
45
|
*/
|
|
32
46
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
47
|
+
interface CreateThemeConfigParams {
|
|
48
|
+
appearance: "light" | "dark";
|
|
49
|
+
primaryColor?: PrimaryColors;
|
|
50
|
+
neutralColor?: NeutralColors;
|
|
51
|
+
}
|
|
52
|
+
declare const createThemeConfig: ({ appearance, primaryColor, neutralColor, }: CreateThemeConfigParams) => ThemeConfig;
|
|
37
53
|
|
|
38
54
|
/**
|
|
39
55
|
* 从色阶生成 antd token 的调色板生成器
|
|
@@ -51,37 +67,21 @@ declare const generateColorNeutralPalette: ({ scale, appearance, }: {
|
|
|
51
67
|
}) => Partial<AliasToken>;
|
|
52
68
|
|
|
53
69
|
/**
|
|
54
|
-
* Lobe-UI
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
declare const baseToken: Partial<AliasToken>;
|
|
58
|
-
declare const lightBaseToken: Partial<AliasToken>;
|
|
59
|
-
declare const darkBaseToken: Partial<AliasToken>;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Lobe-UI 风格自定义 antd 主题算法
|
|
63
|
-
*
|
|
64
|
-
* 不使用 antd 默认的 defaultAlgorithm / darkAlgorithm,
|
|
65
|
-
* 而是基于预设的 13 阶色阶生成完整的 token 覆盖。
|
|
70
|
+
* Lobe-UI 色阶数据
|
|
71
|
+
* 每个颜色包含 13 级色阶(0-12),分为 light / lightA / dark / darkA 四组
|
|
66
72
|
*/
|
|
67
73
|
|
|
68
|
-
declare const
|
|
69
|
-
declare const
|
|
74
|
+
declare const primary: ColorScaleItem;
|
|
75
|
+
declare const gray: ColorScaleItem;
|
|
76
|
+
declare const colorScales: Record<string, ColorScaleItem> & Record<PrimaryColors, ColorScaleItem>;
|
|
77
|
+
declare const neutralColorScales: Record<NeutralColors, ColorScaleItem>;
|
|
70
78
|
|
|
71
79
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* 对标 lobe-ui 的 createLobeAntdTheme:
|
|
75
|
-
* - 根据 appearance 选择 lightAlgorithm / darkAlgorithm
|
|
76
|
-
* - 通过 seedToken 传递 primaryColor / neutralColor 名称
|
|
77
|
-
* - 算法内部根据名称查找色阶并生成完整 token
|
|
80
|
+
* Lobe-UI 风格 antd token 预设
|
|
78
81
|
*/
|
|
79
82
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
neutralColor?: NeutralColors;
|
|
84
|
-
}
|
|
85
|
-
declare const createThemeConfig: ({ appearance, primaryColor, neutralColor, }: CreateThemeConfigParams) => ThemeConfig;
|
|
83
|
+
declare const baseToken: Partial<AliasToken>;
|
|
84
|
+
declare const lightBaseToken: Partial<AliasToken>;
|
|
85
|
+
declare const darkBaseToken: Partial<AliasToken>;
|
|
86
86
|
|
|
87
87
|
export { type ColorScaleItem, type CreateThemeConfigParams, type NeutralColors, type PrimaryColors, baseToken, colorScales, createThemeConfig, darkAlgorithm, darkBaseToken, generateColorNeutralPalette, generateColorPalette, gray, lightAlgorithm, lightBaseToken, neutralColorScales, primary };
|