@agentscope-ai/design 1.0.11 → 1.0.12

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.
Files changed (62) hide show
  1. package/README.md +241 -71
  2. package/lib/antd/styles/select.style.js +7 -1
  3. package/lib/antd/themes/bailianDarkTheme.json +7 -0
  4. package/lib/antd/themes/bailianTheme.json +7 -0
  5. package/lib/antd/themes/carbonDarkTheme.json +7 -0
  6. package/lib/antd/themes/carbonTheme.json +3 -0
  7. package/lib/antd/themes/generateTheme.d.ts +132 -0
  8. package/lib/antd/themes/generateTheme.js +328 -0
  9. package/lib/components/commonComponents/AlertDialog/index.d.ts +325 -37
  10. package/lib/components/commonComponents/AlertDialog/index.js +3 -153
  11. package/lib/components/commonComponents/AlertDialog/index.style.js +14 -2
  12. package/lib/components/commonComponents/AlertDialog/mobile.d.ts +38 -0
  13. package/lib/components/commonComponents/AlertDialog/mobile.js +188 -0
  14. package/lib/components/commonComponents/AlertDialog/pc.d.ts +38 -0
  15. package/lib/components/commonComponents/AlertDialog/pc.js +152 -0
  16. package/lib/components/commonComponents/Anchor/index.js +1 -1
  17. package/lib/components/commonComponents/Button/index.js +5 -3
  18. package/lib/components/commonComponents/CodeBlock/index.js +1 -2
  19. package/lib/components/commonComponents/CollapsePanel/index.js +1 -2
  20. package/lib/components/commonComponents/Drawer/index.style.js +42 -2
  21. package/lib/components/commonComponents/EllipsisTip/demo/demo2-1.d.ts +3 -0
  22. package/lib/components/commonComponents/EllipsisTip/demo/demo2-1.js +21 -0
  23. package/lib/components/commonComponents/InputNumber/demo/demo1.js +0 -3
  24. package/lib/components/commonComponents/Modal/index.d.ts +2 -16
  25. package/lib/components/commonComponents/Modal/index.js +3 -71
  26. package/lib/components/commonComponents/Modal/index.style.js +62 -2
  27. package/lib/components/commonComponents/Modal/mobile.d.ts +28 -0
  28. package/lib/components/commonComponents/Modal/mobile.js +97 -0
  29. package/lib/components/commonComponents/Modal/pc.d.ts +28 -0
  30. package/lib/components/commonComponents/Modal/pc.js +72 -0
  31. package/lib/components/commonComponents/Pagination/index.js +4 -2
  32. package/lib/components/commonComponents/Pagination/index.style.js +11 -3
  33. package/lib/components/commonComponents/PromptsEditor/VarRender.js +6 -1
  34. package/lib/components/commonComponents/PromptsEditor/VarSelectInput.js +3 -2
  35. package/lib/components/commonComponents/PromptsEditor/demo/basic.js +2 -0
  36. package/lib/components/commonComponents/PromptsEditor/index.js +1 -1
  37. package/lib/components/commonComponents/RadioButton/index.js +1 -5
  38. package/lib/components/commonComponents/Table/demo/demo1.js +13 -23
  39. package/lib/components/commonComponents/Table/index.js +3 -1
  40. package/lib/components/commonComponents/Table/index.style.js +1 -3
  41. package/lib/components/commonComponents/Tag/index.d.ts +10 -1
  42. package/lib/components/commonComponents/Tag/index.js +13 -1
  43. package/lib/components/commonComponents/Tooltip/index.js +1 -2
  44. package/lib/config.d.ts +2 -0
  45. package/lib/i18n/index.js +3 -0
  46. package/lib/i18n/strings/index.d.ts +2 -0
  47. package/lib/index.d.ts +2 -4
  48. package/lib/index.js +2 -4
  49. package/lib/libs/env/index.d.ts +1 -1
  50. package/lib/libs/staticRenderer/index.js +12 -3
  51. package/lib/libs/utils/index.d.ts +1 -0
  52. package/lib/libs/utils/index.js +4 -0
  53. package/lib/typings.d.ts +2 -0
  54. package/package.json +19 -60
  55. package/lib/antd/styles/_readme.txt +0 -1
  56. package/lib/antd/themes/_readme.txt +0 -1
  57. package/lib/libs/generateCssVars/index.d.ts +0 -19
  58. package/lib/libs/generateCssVars/index.js +0 -39
  59. package/lib/libs/region/constant.d.ts +0 -6
  60. package/lib/libs/region/constant.js +0 -154
  61. package/lib/libs/region/index.d.ts +0 -2
  62. package/lib/libs/region/index.js +0 -18
package/README.md CHANGED
@@ -1,84 +1,254 @@
1
- <div align="center"><a name="readme-top"></a>
1
+ # @ali/agentscope-ai-design
2
2
 
3
- <img height="120" src="https://img.alicdn.com/imgextra/i1/O1CN01ipemFb1EzmZI9LiTe_!!6000000000423-55-tps-28-28.svg">
3
+ [![NPM version](https://img.shields.io/npm/v/@ali/agentscope-ai-design.svg?style=flat)](https://npmjs.org/package/@ali/agentscope-ai-design)
4
+ [![NPM downloads](http://img.shields.io/npm/dm/@ali/agentscope-ai-design.svg?style=flat)](https://npmjs.org/package/@ali/agentscope-ai-design)
4
5
 
5
- <h1>@agentscope-ai/design</h1>
6
- </div>
7
- 🎨 @agentscope-ai/design is a front-end component library for LLM scenarios, used to build excellent LLM product experience, including a series of rich basic components and scenario components with LLM characteristics.
8
- <br />
9
- <br />
6
+ 百炼ui库
7
+ ## 目录结构
8
+ ```md
9
+ .
10
+ ├── README.md # 说明文件
11
+ ├── .dumi
12
+ ├── theme # dumi自定义主题配置,用于组件库站点的功能/样式定制
13
+ ├── .dumirc.ts # The project config
14
+ ├── package.json
15
+ ├── src
16
+ │ ├── antd # antd相关逻辑&主题配置
17
+ │ │ ├── ConfigProvider # 替换antd原有的ConfigProvider
18
+ │ │ ├── styles # less组件的局部样式,暴露给用户
19
+ │ │ ├── token.ts # 设计导出的antd TOKEN
20
+ │ │ ├── bailianCssVariables.ts # 设计导出的css变量
21
+ │ ├── ├── xconsoleCssVariables.ts # XConsole主题的css变量配置
22
+ │ ├── hooks # 对外输出的公共hooks
23
+ │ ├── libs # 工具函数,按需导出
24
+ │ ├── components # 组件目录
25
+ | │ ├── atomComponents # 原子组件
26
+ | | │ ├── BLCompatibleComponents # 兼容antd的组件
27
+ | | │ │ ├── BLButton # 具体的组件
28
+ | | | │ │ ├── index.tsx # 组件入口文件
29
+ | | | │ │ ├── index.md # 文档入口文件
30
+ | | | │ │ ├── demo # demo示例代码
31
+ | | | | │ │ ├── demo1.tsx
32
+ | | | | │ │ ├── demo2.tsx
33
+ | | │ ├── BLInCompatibleComponents # 不兼容antd的组件
34
+ | │ ├── proComponents # 高级组件(原子组件基础上封装程度较高的组件)
35
+ | │ ├── bizComponents # 业务组件
36
+ | | │ ├── bailian # 百炼控制台业务组件(只放有复用场景的)
37
+ | | │ ├── quanmiao # 全妙业务组件(只放有复用场景的)
38
+ │ ├── demos # 【deprecated】临时存放Demo UI层的相关文件,后续会迁移到theme中
39
+ │ ├── i18n # 国际化相关
40
+ │ ├── config.ts # 配置项
41
+ │ ├── index.less # 【deprecated】组件库全局样式(历史包袱,后续考虑删掉)
42
+ │   ├── index.ts # 入口文件,所有组件、hooks、工具函数都从这里用export导出
43
+ │   └── typings.d.ts # 类型文件
44
+ ├── docs
45
+ │   ├── guide # 指南页
46
+ │   ├── index.md # 首页
47
+ └── tsconfig.json
48
+ ```
49
+ ## Usage
50
+
51
+ 映射关系:
52
+ bailian-web:
53
+ NewIconFont -> BLIconFont
54
+ CutButton -> BLButton
55
+ BizAlert -> BLAlert
56
+ BizBreadcrumb -> BLBreadcrumb
57
+ BizDragList -> -
58
+ BizDrawer -> BLDrawer
59
+ BizDropMenu -> BLDropMenu
60
+ BizEmpty -> BLEmpty
61
+ BizForm -> Form
62
+ BizIdIcon -> BLIDIcon
63
+ BizLoadingIcon -> BLLoadingIcon
64
+ BizModal -> Modal
65
+ BizPopConfirm -> Popconfirm
66
+ BizPopover -> BLPopover
67
+ BizSearch -> Search
68
+ BizSelect -> Select
69
+ BizSliderSelector -> SliderSelector
70
+ BizTabs -> Tabs
71
+ BizTag -> Tag
72
+ BizTourGuide -> TourGuide
73
+ BizTriggerModal -> TriggerModal
74
+ BizUpload -> Upload
10
75
 
11
- 💬 @agentscope-ai/chat: A free AI Chat framework for building an excellent LLM Chat experience similar to ChatGPT
76
+ 为了让所有 antd 组件使用 Spark Design 的自定义图标,需要在项目的 `package.json` 中添加 overrides 配置:
12
77
 
13
- ## ✨ Features
14
- - <img height="15" src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg"> Based on Ant Design, compatible with the Ant Design ecosystem.
15
- - 🛡 Written in TypeScript with predictable static types.
16
- - 🎨 Multiple preset themes.
17
- - ⚙️ Lightweight configuration, ready to use out of the box.
18
- - ☀️ Supports light and dark modes.
78
+ ```json
79
+ {
80
+ "name": "your-project",
81
+ "dependencies": {
82
+ "@ali/agentscope-ai-design": "^4.4.0",
83
+ "antd": "^5.21.0"
84
+ },
85
+ "pnpm": {
86
+ "overrides": {
87
+ "@ant-design/icons": "@agentscope-ai/icons-override-antd"
88
+ }
89
+ }
90
+ }
91
+ ```
19
92
 
20
- ## 📦 Install
93
+ 配置完成后,**删除现有依赖并重新安装**:
21
94
 
22
95
  ```bash
23
- npm install antd @ant-design/icons @agentscope-ai/design
96
+ # 清理现有依赖
97
+ rm -rf node_modules
98
+ rm -f package-lock.json pnpm-lock.yaml yarn.lock
99
+
100
+ # 重新安装
101
+ npm install # 或 pnpm install
24
102
  ```
25
103
 
26
- ## 🔨 Usage
27
- ```tsx
28
- import {
29
- Button,
30
- ConfigProvider,
31
- purpleDarkTheme,
32
- purpleTheme,
33
- } from '@agentscope-ai/design';
34
- import { Flex } from 'antd';
35
- import zhCN from 'antd/locale/zh_CN';
36
- import { useState } from 'react';
37
-
38
- const App = () => {
39
- const [colorMode, setColorMode] = useState<'light' | 'dark'>('light');
40
- const theme = colorMode === 'light' ? purpleTheme : purpleDarkTheme;
41
-
42
- const prefix = 'consume';
104
+ ### 3. 使用组件
105
+
106
+ 配置完成后,所有 antd 组件都会自动使用自定义图标:
107
+
108
+ ```jsx
109
+ import { Select, Input, Button } from 'antd';
110
+ import { BLSelect, BLButton, BLModal } from '@ali/agentscope-ai-design';
111
+
112
+ function App() {
43
113
  return (
44
- <ConfigProvider
45
- {...theme} // you can choose from purpleTheme, purpleDarkTheme, carbonTheme and carbonDarkTheme
46
- prefix={prefix} // prefix for Ant Design and @agentscope-ai/design
47
- iconfont="//at.alicdn.com/t/a/font_4807885_ugexdeaoq7.js" // optional parameter, you can get it from https://www.iconfont.cn/
48
- locale={zhCN} // language pack from Ant Design
49
- >
50
- <Flex
51
- style={{
52
- backgroundColor: `var(--${prefix}-ant-color-bg-base)`,
53
- padding: '16px 24px',
54
- }}
55
- vertical
56
- gap={16}
57
- >
58
- <div style={{ color: `var(--${prefix}-ant-color-text-base)` }}>
59
- Hello World!
60
- </div>
61
- <Button
62
- type="primary"
63
- onClick={() => {
64
- setColorMode(colorMode === 'light' ? 'dark' : 'light');
65
- }}
66
- >
67
- {colorMode === 'light' ? 'dark' : 'light'} mode
68
- </Button>
69
- </Flex>
70
- </ConfigProvider>
114
+ <div>
115
+ {/* 原生 antd 组件,使用自定义图标 */}
116
+ <Select
117
+ placeholder="选择器"
118
+ options={[
119
+ { value: 'option1', label: 'Option 1' },
120
+ { value: 'option2', label: 'Option 2' },
121
+ ]}
122
+ />
123
+ <Input.Password placeholder="密码输入" />
124
+
125
+ {/* Spark Design 封装组件,内置更多功能 */}
126
+ <BLSelect placeholder="封装选择器" />
127
+ <BLButton type="primary">封装按钮</BLButton>
128
+ </div>
71
129
  );
72
- };
130
+ }
131
+ ```
132
+
133
+ ## 📦 组件分类
134
+
135
+ ### 🎨 原生 antd 组件
136
+ 从 antd 直接导出,通过 overrides 配置使用自定义图标:
137
+ - `Alert`, `Badge`, `Button`, `Checkbox`, `Input`, `Modal`, `Select` 等
138
+
139
+ ### 🔧 Spark 封装组件
140
+ 基于 antd 封装,提供额外功能和样式:
141
+ - `BLSelect`, `BLButton`, `BLModal`, `BLForm`, `BLTable` 等
73
142
 
74
- export default App;
143
+ ### 🎯 工具函数和 Hooks
144
+ - `message`, `notification`
145
+ - `useGlobalStyle`, `generateCssVars`
146
+ - 各种工具函数
147
+
148
+ ## 🛠 配置说明
149
+
150
+ ### 为什么需要配置 overrides?
151
+
152
+ Spark Design 使用自定义的图标包 `@agentscope-ai/icons-override-antd` 来替换 antd 默认的图标。通过 overrides 配置,可以让整个项目(包括 antd 内部)都使用我们的自定义图标。
153
+
154
+ ### 包管理器兼容性
155
+
156
+ - ✅ **npm**: 使用 `overrides` 字段
157
+ ```json
158
+ {
159
+ "overrides": {
160
+ "@ant-design/icons": "@agentscope-ai/icons-override-antd"
161
+ }
162
+ }
75
163
  ```
76
- ## Built-in Themes
77
- We provide four built-in themes:
78
- <span style="display: inline-block; width: 12px; height: 12px; background-color: #615CED;"></span> purpleTheme
79
- <span style="display: inline-block; width: 12px; height: 12px; background-color: #5551CC;"></span> purpleDarkTheme (for dark mode)
80
- <span style="display: inline-block; width: 12px; height: 12px; background-color: rgba(26, 26, 29, 1);"></span> carbonTheme
81
- <span style="display: inline-block; width: 12px; height: 12px; background-color: #676767;"></span> carbonDarkTheme (for dark mode)
82
-
83
- ## 🏗️ Coming Soon
84
- Our website featuring design language, component documentation, theme switching, icon library and more is coming soon. Stay tuned!
164
+
165
+ - **pnpm**: 使用 `pnpm.overrides` 字段
166
+ ```json
167
+ {
168
+ "pnpm": {
169
+ "overrides": {
170
+ "@ant-design/icons": "@agentscope-ai/icons-override-antd"
171
+ }
172
+ }
173
+ }
174
+ ```
175
+
176
+ - ✅ **yarn**: 使用 `overrides` 字段
177
+
178
+ 建议同时配置 `overrides` 和 `pnpm.overrides`,确保在不同包管理器下都能正常工作。
179
+
180
+ ### TypeScript 支持
181
+
182
+ 如果使用 TypeScript 且遇到类型错误,可以在 `tsconfig.json` 中添加路径映射:
183
+
184
+ ```json
185
+ {
186
+ "compilerOptions": {
187
+ "paths": {
188
+ "@ant-design/icons": ["node_modules/@agentscope-ai/icons-override-antd"]
189
+ }
190
+ }
191
+ }
192
+ ```
193
+
194
+ ### Lightning 支持
195
+
196
+ 使用 Lightning 工具时,需要在 lightning.config.mts 文件中配置:
197
+
198
+ ```javascript
199
+ {
200
+ "build": {
201
+ "resolve": {
202
+ "alias": {
203
+ '@ant-design/icons': path.resolve(
204
+ __dirname,
205
+ './node_modules/@agentscope-ai/icons-override-antd',
206
+ )
207
+ }
208
+ }
209
+ }
210
+ }
211
+ ```
212
+
213
+ ### Vite 项目额外配置
214
+
215
+ 某些 Vite 版本可能需要额外的 alias 配置:
216
+
217
+ ```javascript
218
+ // vite.config.js
219
+ export default {
220
+ resolve: {
221
+ alias: {
222
+ '@ant-design/icons': '@agentscope-ai/icons-override-antd'
223
+ }
224
+ }
225
+ }
226
+ ```
227
+
228
+ ## 🔧 故障排除
229
+
230
+ ### 图标未正确显示?
231
+
232
+ 1. **确认配置**:检查 `package.json` 中的 overrides 配置是否正确
233
+ 2. **清理依赖**:删除 `node_modules` 和锁文件后重新安装
234
+ 3. **检查版本**:确保使用兼容的 antd 版本 (^5.18.0)
235
+ 4. **构建工具**:检查是否需要额外的 alias 配置
236
+
237
+ ### 开发环境和生产环境表现不一致?
238
+
239
+ 这通常是缓存问题,尝试:
240
+ - 清理构建缓存
241
+ - 添加构建工具的 alias 配置
242
+ - 确保 overrides 配置在所有环境中都生效
243
+
244
+ ## 📖 更新日志
245
+
246
+ 查看 [CHANGELOG.md](./CHANGELOG.md) 了解版本更新信息。
247
+
248
+ ## 🤝 贡献
249
+
250
+ 欢迎提交 Issue 和 Pull Request!
251
+
252
+ ## 📄 License
253
+
254
+ MIT
@@ -1,7 +1,13 @@
1
1
  var _templateObject;
2
2
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
3
  import createGlobalStyle from "../../libs/createStyle";
4
- export var useSelectStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.", "-select-dropdown {\n border: 1px solid var(--", "-color-border-secondary);\n box-shadow: 0px 4px 6px 0px rgba(0, 0, 0, 0.08);\n border-radius: var(--", "-border-radius);\n}\n\n.", "-select-outlined:not(.", "-select-customize-input) .", "-select-selector {\n border-color: var(--", "-color-border-secondary);\n}\n\n.", "-select .", "-select-arrow {\n color: var(--", "-color-text-secondary);\n}\n\n.", "-select-outlined.", "-select-multiple {\n .", "-select-selection-item {\n border-radius: 4px;\n background-color: var(--", "-color-mauve-bg);\n }\n}\n\n.", "-select-selection-overflow {\n color: var(--", "-color-mauve);\n \n .", "-select-selection-item-remove {\n .anticon-close {\n font-size: 14px;\n color: var(--", "-color-mauve);\n }\n }\n}\n\n.", "-select-disabled.", "-select-multiple .", "-select-selection-overflow .", "-select-selection-item {\n color: var(--", "-color-mauve);\n}\n"])), function (p) {
4
+ export var useSelectStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.", "-select-dropdown {\n border: 1px solid var(--", "-color-border-secondary);\n box-shadow: 0px 4px 6px 0px rgba(0, 0, 0, 0.08);\n border-radius: var(--", "-border-radius);\n}\n\n.", "-select-outlined:not(.", "-select-customize-input) .", "-select-selector {\n border-color: var(--", "-color-border-secondary);\n}\n\n.", "-select .", "-select-arrow {\n color: var(--", "-color-text-secondary);\n}\n\n.", "-select-outlined.", "-select-multiple {\n .", "-select-selection-item {\n border-radius: 4px;\n background-color: var(--", "-color-mauve-bg);\n }\n}\n\n.", "-select-selection-overflow {\n color: var(--", "-color-mauve);\n \n .", "-select-selection-item-remove {\n .anticon-close {\n font-size: 14px;\n color: var(--", "-color-mauve);\n }\n }\n}\n\n.", "-select-disabled.", "-select-multiple .", "-select-selection-overflow .", "-select-selection-item {\n color: var(--", "-color-mauve);\n}\n\n.", "-select .", "-select-selection-placeholder {\n color: var(--", "-color-text-tertiary);\n}\n"])), function (p) {
5
+ return p.antPrefix;
6
+ }, function (p) {
7
+ return p.antPrefix;
8
+ }, function (p) {
9
+ return p.antPrefix;
10
+ }, function (p) {
5
11
  return p.antPrefix;
6
12
  }, function (p) {
7
13
  return p.antPrefix;
@@ -84,6 +84,13 @@
84
84
  "colorMauve": "#8E8C99",
85
85
  "colorMauveHover": "#BBB8CA",
86
86
  "colorMauveBg": "rgba(239, 240, 243, 0.2)",
87
+ "colorSlate": "#2C3A50",
88
+ "colorSlateHover": "#354252",
89
+ "colorSlateBg": "#232B36",
90
+ "colorLavender": "#A77BFF",
91
+ "colorLavenderHover": "#BFA5F3",
92
+ "colorLavenderBg": "rgba(150, 143, 167, 0.48)",
93
+
87
94
  "boxShadowTertiary": "0px 12px 32px -16px rgba(255, 255, 255, 0.16),0px 12px 60px 0px rgba(255, 255, 255, 0.08),0px 0px 1px 0px rgba(255, 255, 255, 0.02)",
88
95
  "boxShadowTertiaryLeft": "-12px 0px 32px -16px rgba(255, 255, 255, 0.16),-12px 0px 60px 0px rgba(255, 255, 255, 0.08),0px 0px 1px 0px rgba(255, 255, 255, 0.02);",
89
96
  "boxShadowInput": "0px 12px 24px -16px rgba(255, 255, 255, 0.08),0px 12px 40px 0px rgba(255, 255, 255, 0.16),0px 0px 1px 0px rgba(255, 255, 255, 0.04)"
@@ -84,6 +84,13 @@
84
84
  "colorMauve": "#8E8C99",
85
85
  "colorMauveHover": "#C0BFC8",
86
86
  "colorMauveBg": "rgba(239, 240, 243, 0.8)",
87
+ "colorSlate": "#1E293B",
88
+ "colorSlateHover": "#475569",
89
+ "colorSlateBg": "#E2E8F0",
90
+ "colorLavender": "#A77BFF",
91
+ "colorLavenderHover": "#BB99FF",
92
+ "colorLavenderBg": "rgba(226, 212, 255, 0.8)",
93
+
87
94
  "boxShadowTertiary": "0px 12px 32px -16px rgba(0, 0, 0, 0.24),0px 12px 60px 0px rgba(0, 0, 0, 0.12),0px 0px 1px 0px rgba(0, 0, 0, 0.04)",
88
95
  "boxShadowTertiaryLeft": "-12px 0px 32px -16px rgba(0, 0, 0, 0.24),-12px 0px 60px 0px rgba(0, 0, 0, 0.12),0px 0px 1px 0px rgba(0, 0, 0, 0.04)",
89
96
  "boxShadowInput": "0px 12px 24px -16px rgba(54, 54, 73, 0.04),0px 12px 40px 0px rgba(51, 51, 71, 0.08),0px 0px 1px 0px rgba(44, 44, 54, 0.02)"
@@ -84,6 +84,13 @@
84
84
  "colorMauve": "#8E8C99",
85
85
  "colorMauveHover": "#BBB8CA",
86
86
  "colorMauveBg": "#5859647A",
87
+ "colorSlate": "#2C3A50",
88
+ "colorSlateHover": "#354252",
89
+ "colorSlateBg": "#232B36",
90
+ "colorLavender": "#A77BFF",
91
+ "colorLavenderHover": "#BFA5F3",
92
+ "colorLavenderBg": "rgba(150, 143, 167, 0.48)",
93
+
87
94
  "boxShadowTertiary": "0px 12px 32px -16px rgba(255, 255, 255, 0.24),0px 12px 60px 0px rgba(255, 255, 255, 0.12),0px 0px 1px 0px rgba(255, 255, 255, 0.04)",
88
95
  "boxShadowTertiaryLeft": "-12px 0px 32px -16px rgba(255, 255, 255, 0.24),-12px 0px 60px 0px rgba(255, 255, 255, 0.12),0px 0px 1px 0px rgba(255, 255, 255, 0.04)",
89
96
  "boxShadowInput": "0px 12px 24px -16px rgba(255, 255, 255, 0.08),0px 12px 40px 0px rgba(255, 255, 255, 0.16),0px 0px 1px 0px rgba(255, 255, 255, 0.04)",
@@ -84,6 +84,9 @@
84
84
  "colorMauve": "rgba(142, 140, 153, 1)",
85
85
  "colorMauveHover": "#C0BFC8",
86
86
  "colorMauveBg": "rgba(239, 240, 243, 0.8)",
87
+ "colorSlate": "#2C3A50",
88
+ "colorSlateHover": "#354252",
89
+ "colorSlateBg": "#232B36",
87
90
  "boxShadowTertiary": "0px 12px 32px -16px rgba(0, 0, 0, 0.24),0px 12px 60px 0px rgba(0, 0, 0, 0.12),0px 0px 1px 0px rgba(0, 0, 0, 0.04)",
88
91
  "boxShadowTertiaryLeft": "-12px 0px 32px -16px rgba(0, 0, 0, 0.24),-12px 0px 60px 0px rgba(0, 0, 0, 0.12),0px 0px 1px 0px rgba(0, 0, 0, 0.04)",
89
92
  "boxShadowInput": "0px 12px 24px -16px rgba(54, 54, 73, 0.04),0px 12px 40px 0px rgba(51, 51, 71, 0.08),0px 0px 1px 0px rgba(44, 44, 54, 0.02)"
@@ -0,0 +1,132 @@
1
+ /**
2
+ * 主题生成器 - Theme Generator
3
+
4
+ * 核心功能:
5
+ * 1. 颜色空间转换(HEX/RGB/HSL)
6
+ * 2. 颜色调整和生成
7
+ * 3. 完整主题配置生成(支持浅色/暗色模式)
8
+ *
9
+ * 设计原则(参考 Radix Colors):
10
+ * - 浅色模式:背景 95-99% 亮度,边框 80-90% 亮度,文本 15-25% 亮度
11
+ * - 暗色模式:背景 0-10% 亮度,边框使用透明度,文本 85-95% 亮度
12
+ * - 状态色和装饰色在暗色模式下使用预设优化值
13
+ *
14
+ * 生成规则:
15
+ * - 主色 (Primary):从输入的主色生成,暗色模式自动调整亮度
16
+ * - 背景色系:基于 bgBase 生成,保持色相统一
17
+ * - 文本色系:基于 textBase 生成,保持色相统一
18
+ * - 边框色系:基于 bgBase 生成,饱和度提高以增强可见度
19
+ * - 填充色系:暗色模式基于文本色+透明度,浅色模式基于背景色
20
+ * - 状态色/装饰色/阴影:暗色模式使用预设优化值,浅色模式使用配置文件
21
+ */
22
+ /**
23
+ * 生成完整主题
24
+ * @param {string} primaryHex - 主色调
25
+ * @param {string} bgBaseHex - 背景基础色
26
+ * @param {string} textBaseHex - 文本基础色
27
+ * @param {boolean} darkMode - 是否为暗色模式
28
+ * @returns {Object} 完整的主题配置对象
29
+ */
30
+ interface GenerateThemeProps {
31
+ primaryHex: string;
32
+ bgBaseHex?: string;
33
+ textBaseHex?: string;
34
+ darkMode: boolean;
35
+ }
36
+ declare const generateTheme: ({ primaryHex, bgBaseHex, textBaseHex, darkMode, }: GenerateThemeProps) => {
37
+ borderRadiusXS: number;
38
+ borderRadiusSM: number;
39
+ borderRadius: number;
40
+ borderRadiusLG: number;
41
+ borderRadiusXL: number;
42
+ borderRadiusFull: number;
43
+ wireframe: boolean;
44
+ colorPrimary: any;
45
+ colorPrimaryHover: any;
46
+ colorPrimaryActive: any;
47
+ colorPrimaryBg: any;
48
+ colorPrimaryBgHover: any;
49
+ colorPrimaryBorder: any;
50
+ colorPrimaryBorderHover: any;
51
+ colorPrimaryText: any;
52
+ colorPrimaryTextHover: any;
53
+ colorPrimaryTextActive: any;
54
+ colorTextBase: string;
55
+ colorText: string;
56
+ colorTextSecondary: string;
57
+ colorTextTertiary: string;
58
+ colorTextQuaternary: string;
59
+ colorTextWhite: string;
60
+ colorBgBase: string;
61
+ colorBgContainer: any;
62
+ colorBgElevated: any;
63
+ colorBgLayout: any;
64
+ colorBgSpotlight: string;
65
+ colorBgMask: string;
66
+ colorBorder: any;
67
+ colorBorderSecondary: any;
68
+ colorFill: string;
69
+ colorFillSecondary: string;
70
+ colorFillTertiary: string;
71
+ colorFillQuaternary: string;
72
+ colorFillDisable: any;
73
+ colorLink: any;
74
+ colorInfo: string;
75
+ colorInfoHover: string;
76
+ colorInfoText: string;
77
+ colorInfoBg: string;
78
+ colorInfoBgHover: string;
79
+ colorInfoBorder: string;
80
+ colorInfoBorderHover: string;
81
+ colorSuccess: string;
82
+ colorSuccessHover: string;
83
+ colorSuccessBg: string;
84
+ colorSuccessBgHover: string;
85
+ colorSuccessBorder: string;
86
+ colorSuccessBorderHover: string;
87
+ colorWarning: string;
88
+ colorWarningHover: string;
89
+ colorWarningBg: string;
90
+ colorWarningBgHover: string;
91
+ colorWarningBorder: string;
92
+ colorWarningBorderHover: string;
93
+ colorError: string;
94
+ colorErrorHover: string;
95
+ colorErrorBg: string;
96
+ colorErrorBgHover: string;
97
+ colorErrorBorder: string;
98
+ colorErrorBorderHover: string;
99
+ colorPurple: string;
100
+ colorPurpleHover: string;
101
+ colorPurpleBg: string;
102
+ colorPink: string;
103
+ colorPinkHover: string;
104
+ colorPinkBg: string;
105
+ colorYellow: string;
106
+ colorYellowHover: string;
107
+ colorYellowBg: string;
108
+ colorOrange: string;
109
+ colorOrangeHover: string;
110
+ colorOrangeBg: string;
111
+ colorTeal: string;
112
+ colorTealHover: string;
113
+ colorTealBg: string;
114
+ colorBlue: string;
115
+ colorBlueHover: string;
116
+ colorBlueBg: string;
117
+ colorMauve: string;
118
+ colorMauveHover: string;
119
+ colorMauveBg: string;
120
+ colorSlate: string;
121
+ colorSlateHover: string;
122
+ colorSlateBg: string;
123
+ colorLavender: string;
124
+ colorLavenderHover: string;
125
+ colorLavenderBg: string;
126
+ boxShadow: string;
127
+ boxShadowSecondary: string;
128
+ boxShadowTertiary: string;
129
+ boxShadowTertiaryLeft: string;
130
+ boxShadowInput: string;
131
+ };
132
+ export default generateTheme;