@4399ywkf/theme-system 1.0.1 → 1.0.3

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 CHANGED
@@ -1,6 +1,16 @@
1
- import { AliasToken, MappingAlgorithm } from 'antd/es/theme/interface';
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
- * 每个颜色包含 13 级色阶(0-12),分为 light / lightA / dark / darkA 四组
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
- declare const primary: ColorScaleItem;
34
- declare const gray: ColorScaleItem;
35
- declare const colorScales: Record<string, ColorScaleItem> & Record<PrimaryColors, ColorScaleItem>;
36
- declare const neutralColorScales: Record<NeutralColors, ColorScaleItem>;
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 风格 antd token 预设
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 lightAlgorithm: MappingAlgorithm;
69
- declare const darkAlgorithm: MappingAlgorithm;
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
- * 创建 Lobe-UI 风格的 antd ThemeConfig
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
- interface CreateThemeConfigParams {
81
- appearance: "light" | "dark";
82
- primaryColor?: PrimaryColors;
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 };