@lobehub/ui 1.12.0 → 1.14.0

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.
@@ -1,42 +1,51 @@
1
- export interface CustomTokenItem {
2
- color1: string;
3
- color2: string;
4
- color3: string;
5
- color4: string;
6
- color5: string;
7
- color6: string;
8
- color7: string;
9
- color8: string;
10
- color9: string;
11
- color10: string;
12
- color11: string;
13
- color12: string;
14
- color13: string;
15
- color1A: string;
16
- color2A: string;
17
- color3A: string;
18
- color4A: string;
19
- color5A: string;
20
- color6A: string;
21
- color7A: string;
22
- color8A: string;
23
- color9A: string;
24
- color10A: string;
25
- color11A: string;
26
- color12A: string;
27
- color13A: string;
28
- colorBg: string;
29
- colorBgHover: string;
30
- colorBorder: string;
31
- colorBorderHover: string;
32
- colorHover: string;
33
- color: string;
34
- colorActive: string;
35
- colorTextHover: string;
36
- colorText: string;
37
- colorTextActive: string;
38
- }
39
- export interface LobeCustomToken {
1
+ const PresetColors = [
2
+ 'red',
3
+ 'volcano',
4
+ 'orange',
5
+ 'gold',
6
+ 'yellow',
7
+ 'lime',
8
+ 'green',
9
+ 'cyan',
10
+ 'blue',
11
+ 'geekblue',
12
+ 'purple',
13
+ 'magenta',
14
+ 'gray',
15
+ ] as const;
16
+
17
+ export type PresetColorKey = (typeof PresetColors)[number];
18
+
19
+ export type PresetColorType = Record<PresetColorKey, string>;
20
+
21
+ type ColorPaletteKeyIndex = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11;
22
+
23
+ type ColorTokenKey =
24
+ | 'Bg'
25
+ | 'BgHover'
26
+ | 'Border'
27
+ | 'BorderSecondary'
28
+ | 'BorderHover'
29
+ | 'Hover'
30
+ | ''
31
+ | 'Active'
32
+ | 'TextHover'
33
+ | 'Text'
34
+ | 'TextActive';
35
+
36
+ export type ColorToken = {
37
+ [key in `${keyof PresetColorType}${ColorTokenKey}`]: string;
38
+ };
39
+
40
+ export type ColorPalettes = {
41
+ [key in `${keyof PresetColorType}${ColorPaletteKeyIndex}`]: string;
42
+ };
43
+
44
+ export type ColorPalettesAlpha = {
45
+ [key in `${keyof PresetColorType}${ColorPaletteKeyIndex}A`]: string;
46
+ };
47
+
48
+ export interface LobeCustomToken extends ColorToken, ColorPalettes, ColorPalettesAlpha {
40
49
  headerHeight: number;
41
50
  footerHeight: number;
42
51
  sidebarWidth: number;
@@ -47,34 +56,4 @@ export interface LobeCustomToken {
47
56
  gradientColor2: string;
48
57
  gradientColor3: string;
49
58
  gradientHeroBgG: string;
50
-
51
- tomato: CustomTokenItem;
52
- red: CustomTokenItem;
53
- crimson: CustomTokenItem;
54
- pink: CustomTokenItem;
55
- plum: CustomTokenItem;
56
- purple: CustomTokenItem;
57
- violet: CustomTokenItem;
58
- indigo: CustomTokenItem;
59
- blue: CustomTokenItem;
60
- cyan: CustomTokenItem;
61
- teal: CustomTokenItem;
62
- green: CustomTokenItem;
63
- grass: CustomTokenItem;
64
- orange: CustomTokenItem;
65
- brown: CustomTokenItem;
66
- sky: CustomTokenItem;
67
- mint: CustomTokenItem;
68
- lime: CustomTokenItem;
69
- yellow: CustomTokenItem;
70
- amber: CustomTokenItem;
71
- bronze: CustomTokenItem;
72
- gold: CustomTokenItem;
73
- gray: CustomTokenItem;
74
- mauve: CustomTokenItem;
75
- slate: CustomTokenItem;
76
- sage: CustomTokenItem;
77
- olive: CustomTokenItem;
78
- sand: CustomTokenItem;
79
- bnw: CustomTokenItem;
80
59
  }
@@ -1,5 +1,6 @@
1
- import { LobeCustomStylish } from '@/types/customStylish';
2
1
  import 'antd-style';
2
+ import { AntdToken } from 'antd-style/lib/types/theme';
3
+ import { LobeCustomStylish } from './customStylish';
3
4
  import { LobeCustomToken } from './customToken';
4
5
 
5
6
  declare module 'antd-style' {
@@ -10,6 +11,5 @@ declare module 'antd-style' {
10
11
  }
11
12
 
12
13
  declare module 'styled-components' {
13
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
14
- export interface DefaultTheme extends LobeCustomToken {}
14
+ export interface DefaultTheme extends AntdToken, LobeCustomToken {}
15
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.12.0",
3
+ "version": "1.14.0",
4
4
  "description": "Lobe UI is an open-source UI component library for building chatbot web apps",
5
5
  "keywords": [
6
6
  "lobehub",
@@ -67,12 +67,12 @@
67
67
  ]
68
68
  },
69
69
  "dependencies": {
70
- "@ant-design/icons": "^5.1.2",
71
- "@babel/runtime": "^7.21.5",
70
+ "@ant-design/icons": "^5.1.3",
71
+ "@babel/runtime": "^7.22.3",
72
72
  "@dqbd/tiktoken": "^1.0.7",
73
- "@floating-ui/react": "^0.24.1",
73
+ "@floating-ui/react": "^0.24.2",
74
74
  "ahooks": "^3.7.7",
75
- "antd-style": "^3.1.1",
75
+ "antd-style": "^3.2.1",
76
76
  "chroma-js": "^2.4.2",
77
77
  "copy-to-clipboard": "^3.3.3",
78
78
  "dayjs": "^1.11.7",
@@ -119,9 +119,9 @@
119
119
  "eslint": "^8.41.0",
120
120
  "eslint-import-resolver-alias": "^1.1.2",
121
121
  "eslint-import-resolver-typescript": "^3.5.5",
122
- "father": "^4.1.9",
122
+ "father": "^4.2.1",
123
123
  "husky": "^8.0.3",
124
- "jsdom": "^22.0.0",
124
+ "jsdom": "^22.1.0",
125
125
  "lint-staged": "^13.2.2",
126
126
  "postcss-styled-syntax": "^0.4.0",
127
127
  "prettier": "^2.8.8",