sparkdesign 0.3.0 → 0.3.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.
Files changed (104) hide show
  1. package/README.md +7 -5
  2. package/cli/dist/index.js +0 -0
  3. package/cli/dist/utils/tokens.js +103 -17
  4. package/cli/registry/basic/button.test.tsx +333 -0
  5. package/cli/registry/chat/{question-part.tsx → ask-user-part.tsx} +4 -4
  6. package/cli/registry/chat/{browser-use-part.tsx → browser-action-part.tsx} +6 -6
  7. package/cli/registry/chat/{suggestion-part.tsx → hint-banner.tsx} +4 -4
  8. package/cli/registry/chat/markdown.test.tsx +387 -0
  9. package/cli/registry/chat/{reasoning-step.tsx → reasoning-step/compound.tsx} +163 -185
  10. package/cli/registry/chat/reasoning-step/context.tsx +114 -0
  11. package/cli/registry/chat/reasoning-step/index.tsx +45 -0
  12. package/cli/registry/chat/reasoning-step/types.ts +109 -0
  13. package/cli/registry/chat/response/compound.tsx +210 -0
  14. package/cli/registry/chat/{response.tsx → response/context.tsx} +65 -136
  15. package/cli/registry/chat/response/index.tsx +87 -0
  16. package/cli/registry/chat/response/types.ts +123 -0
  17. package/cli/registry/chat/thinking-indicator.test.tsx +244 -0
  18. package/cli/registry/chat/tool-invocation-card.test.tsx +346 -0
  19. package/cli/registry/chat/{request.tsx → user-message.tsx} +3 -3
  20. package/cli/registry/chat/user-question/compound.tsx +324 -0
  21. package/cli/registry/chat/user-question/context.tsx +456 -0
  22. package/cli/registry/chat/user-question/index.tsx +71 -316
  23. package/cli/registry/chat/user-question/useUserQuestionKeyboard.ts +5 -6
  24. package/cli/registry/tokens/index.css +31 -0
  25. package/cli/registry/tokens/scale/computed.css +103 -0
  26. package/cli/registry/tokens/scale/config.css +110 -0
  27. package/cli/registry/tokens/scale/index.css +30 -0
  28. package/cli/registry/tokens/scale/presets/compact.css +30 -0
  29. package/cli/registry/tokens/scale/presets/dense.css +64 -0
  30. package/cli/registry/tokens/scale/presets/sharp.css +40 -0
  31. package/cli/registry/tokens/scale/presets/soft.css +16 -0
  32. package/cli/registry/tokens/scale.css +12 -298
  33. package/cli/registry/tokens/scrollbar-utility.css +35 -0
  34. package/cli/registry/tokens/themes/dark-parchment.css +132 -0
  35. package/cli/registry/tokens/themes/dark-qoder.css +132 -0
  36. package/cli/registry/tokens/themes/light-parchment.css +123 -0
  37. package/cli/registry/tokens/themes/light-qoder.css +131 -0
  38. package/dist/qoder-design.css +1 -1
  39. package/dist/registry/chat/ask-user-part.d.ts +24 -0
  40. package/dist/registry/chat/browser-action-part.d.ts +28 -0
  41. package/dist/registry/chat/{suggestion-part.d.ts → hint-banner.d.ts} +4 -4
  42. package/dist/registry/chat/reasoning-step/compound.d.ts +17 -0
  43. package/dist/registry/chat/reasoning-step/context.d.ts +10 -0
  44. package/dist/registry/chat/reasoning-step/index.d.ts +14 -0
  45. package/dist/registry/chat/reasoning-step/types.d.ts +95 -0
  46. package/dist/registry/chat/response/compound.d.ts +25 -0
  47. package/dist/registry/chat/response/context.d.ts +9 -0
  48. package/dist/registry/chat/response/index.d.ts +15 -0
  49. package/dist/registry/chat/response/types.d.ts +99 -0
  50. package/dist/registry/chat/user-message.d.ts +6 -0
  51. package/dist/registry/chat/user-question/compound.d.ts +37 -0
  52. package/dist/registry/chat/user-question/context.d.ts +55 -0
  53. package/dist/registry/chat/user-question/index.d.ts +13 -5
  54. package/dist/registry/chat/user-question/useUserQuestionKeyboard.d.ts +2 -3
  55. package/dist/scale.css +9 -303
  56. package/dist/spark-design.cjs.js +62 -62
  57. package/dist/spark-design.es.js +3992 -3826
  58. package/dist/src/components/chat/AskUserPart/index.d.ts +6 -0
  59. package/dist/src/components/chat/BrowserActionPart/index.d.ts +7 -0
  60. package/dist/src/components/chat/HintBanner/index.d.ts +6 -0
  61. package/dist/src/components/chat/ReasoningStep/index.d.ts +11 -5
  62. package/dist/src/components/chat/Response/index.d.ts +16 -6
  63. package/dist/src/components/chat/UserMessage/index.d.ts +7 -0
  64. package/dist/src/components/chat/UserQuestion/index.d.ts +18 -4
  65. package/dist/src/components/index.d.ts +63 -63
  66. package/dist/theme.css +13 -800
  67. package/package.json +27 -3
  68. package/dist/registry/chat/browser-use-part.d.ts +0 -28
  69. package/dist/registry/chat/question-part.d.ts +0 -24
  70. package/dist/registry/chat/reasoning-step.d.ts +0 -35
  71. package/dist/registry/chat/request.d.ts +0 -6
  72. package/dist/registry/chat/response.d.ts +0 -28
  73. package/dist/src/components/chat/BrowserUsePart/index.d.ts +0 -7
  74. package/dist/src/components/chat/QuestionPart/index.d.ts +0 -6
  75. package/dist/src/components/chat/Request/index.d.ts +0 -7
  76. package/dist/src/components/chat/SuggestionPart/index.d.ts +0 -6
  77. /package/dist/src/components/{foundation → basic}/AlertDialog/index.d.ts +0 -0
  78. /package/dist/src/components/{foundation → basic}/Avatar/index.d.ts +0 -0
  79. /package/dist/src/components/{foundation → basic}/Button/index.d.ts +0 -0
  80. /package/dist/src/components/{foundation → basic}/Collapse/index.d.ts +0 -0
  81. /package/dist/src/components/{foundation → basic}/Collapsible/index.d.ts +0 -0
  82. /package/dist/src/components/{foundation → basic}/CollapsibleSection/index.d.ts +0 -0
  83. /package/dist/src/components/{foundation → basic}/DropdownMenu/index.d.ts +0 -0
  84. /package/dist/src/components/{foundation → basic}/EllipsisText/index.d.ts +0 -0
  85. /package/dist/src/components/{foundation → basic}/IconButton/index.d.ts +0 -0
  86. /package/dist/src/components/{foundation → basic}/Kbd/index.d.ts +0 -0
  87. /package/dist/src/components/{foundation → basic}/OptionList/index.d.ts +0 -0
  88. /package/dist/src/components/{foundation → basic}/Pagination/index.d.ts +0 -0
  89. /package/dist/src/components/{foundation → basic}/Progress/index.d.ts +0 -0
  90. /package/dist/src/components/{foundation → basic}/RadioGroup/index.d.ts +0 -0
  91. /package/dist/src/components/{foundation → basic}/Resizable/index.d.ts +0 -0
  92. /package/dist/src/components/{foundation → basic}/Scrollbar/index.d.ts +0 -0
  93. /package/dist/src/components/{foundation → basic}/Select/index.d.ts +0 -0
  94. /package/dist/src/components/{foundation → basic}/Skeleton/index.d.ts +0 -0
  95. /package/dist/src/components/{foundation → basic}/Slider/index.d.ts +0 -0
  96. /package/dist/src/components/{foundation → basic}/Spinner/index.d.ts +0 -0
  97. /package/dist/src/components/{foundation → basic}/Switch/index.d.ts +0 -0
  98. /package/dist/src/components/{foundation → basic}/Table/index.d.ts +0 -0
  99. /package/dist/src/components/{foundation → basic}/Tabs/index.d.ts +0 -0
  100. /package/dist/src/components/{foundation → basic}/Tag/index.d.ts +0 -0
  101. /package/dist/src/components/{foundation → basic}/Toast/index.d.ts +0 -0
  102. /package/dist/src/components/{foundation → basic}/Toggle/index.d.ts +0 -0
  103. /package/dist/src/components/{foundation → basic}/Tooltip/index.d.ts +0 -0
  104. /package/dist/src/components/{foundation → basic}/Typography/index.d.ts +0 -0
package/dist/theme.css CHANGED
@@ -1,804 +1,17 @@
1
1
  /* ============================================
2
- * [POS]: src/tokens/theme.css - 颜色主题令牌 (data-theme),内置亮色/暗色 + 可扩展
3
- * [OUTPUT]: CSS 变量 --color-* 系列 + @theme Tailwind 映射
2
+ * [DEPRECATED] 此文件已被拆分,保留以向后兼容。
3
+ * 请使用新的引入方式:@import "./tokens/index.css";
4
4
  *
5
- * Color Scheme System:
6
- * - data-theme: 控制色板 (light / dark / 自定义主题名)
7
- * - data-style: 控制布局间距与圆角 (neutral | compact | soft | sharp | dense)
8
- * - 组合: 5 种布局风格 × N 种颜色主题 = 5N 种组合
9
- *
10
- * [PROTOCOL]:
11
- * 1. 扩展主题时必须覆盖完整颜色类别
12
- * 2. 修改颜色值需确保对比度符合无障碍标准
13
- * 3. 更新后必须上浮检查 L2 tokens/CLAUDE.md
14
- *
15
- * 使用方式: <body data-style="soft" data-theme="dark">
16
- * 扩展新主题: 在此文件添加 [data-theme="your-theme"] 块,只定义 --token-color-*
5
+ * 新的文件结构:
6
+ * - theme-base.css: @theme 映射 + 动画 + 公共样式
7
+ * - themes/light.css: 亮色主题
8
+ * - themes/dark.css: 暗色主题
9
+ * - themes/light-parchment.css: 羊皮纸亮色
10
+ * - themes/dark-parchment.css: 羊皮纸暗色
17
11
  * ============================================ */
18
12
 
19
- /* ============================================
20
- Theme: Light (亮色模式)
21
- ============================================ */
22
- :root,
23
- [data-theme="light"] {
24
- color-scheme: light;
25
- /* --- Primary --- */
26
- --token-color-primary: #8EE5A1;
27
- --token-color-primary-hover: #73CD94;
28
- --token-color-primary-active: #5CB870;
29
- --token-color-primary-bg: #F1FAF3;
30
- --token-color-primary-bg-hover: #E6F7EC;
31
- --token-color-primary-border: #CDEFD9;
32
- --token-color-primary-border-hover: #B3E6C7;
33
- --token-color-primary-text: #141414;
34
- --token-color-primary-text-hover: #73CD94;
35
- --token-color-primary-text-active: #5CB870;
36
- --token-color-text-on-primary: #FDFDFD;
37
-
38
- /* --- Text --- */
39
- --token-color-text: #141414;
40
- --token-color-text-secondary: #636261;
41
- --token-color-text-tertiary: #838280;
42
- --token-color-text-quaternary: #8E8C8B;
43
- --token-color-text-base: #0F0D0C;
44
-
45
- /* --- Border --- */
46
- --token-color-border: #BCBBBA;
47
- --token-color-border-secondary: #DDDDDD;
48
- --token-color-border-tertiary: #E6E6E6;
49
-
50
- /* --- Fill --- */
51
- --token-color-fill: #DFDFDF;
52
- --token-color-fill-secondary: #EFEFEF;
53
- --token-color-fill-tertiary: #F9F9F9;
54
- --token-color-fill-quaternary: #FCFCFC;
55
- --token-color-fill-disable: #DAD9D8;
56
-
57
- /* --- Background --- */
58
- --token-color-bg-container: #FFFFFF;
59
- --token-color-bg-elevated: #F9F9F9;
60
- --token-color-bg-layout: #FDFDFD;
61
- --token-color-bg-spotlight: #FAFAFA;
62
- --token-color-bg-mask: rgba(0, 0, 0, 0.5);
63
- /* PlanPart 点阵高亮遮罩渐变(随主题) */
64
- --token-color-mask-shimmer-weak: rgba(0, 0, 0, 0.3);
65
- --token-color-mask-shimmer-strong: rgba(0, 0, 0, 0.8);
66
- --token-color-mask-shimmer-full: rgba(0, 0, 0, 1);
67
- --token-color-bg-base: #FFFFFF;
68
- --token-color-bg-highlight: #080807;
69
- --token-color-bg-highlight-hover: #1a1a1a;
70
-
71
- /* --- Shadow (输入框等浮层,1~4 级与 primary/secondary/tertiary/quaternary 一致,与 data-theme 无关) --- */
72
- --token-color-shadow-primary: rgba(0, 0, 0, 0.02);
73
- --token-color-shadow-secondary: rgba(0, 0, 0, 0.035);
74
- --token-color-shadow-tertiary: rgba(0, 0, 0, 0.055);
75
- --token-color-shadow-quaternary: rgba(0, 0, 0, 0.075);
76
-
77
- /* --- Semantic Colors --- */
78
- --token-color-link: #5CB870;
79
- --token-color-error: #FF4D4F;
80
- --token-color-error-hover: #FF7875;
81
- --token-color-error-bg: #FFF2F0;
82
- --token-color-error-bg-hover: #FFE4E0;
83
- --token-color-error-border: #FFCCC7;
84
- --token-color-info: #0B83F1;
85
- --token-color-info-hover: #5EBCFF;
86
- --token-color-info-bg: #E6F7FF;
87
- --token-color-info-bg-hover: #D0EFFF;
88
- --token-color-info-border: #B0E3FF;
89
- --token-color-success: #73CD94;
90
- --token-color-success-hover: #8EE5A1;
91
- --token-color-success-bg: #F1FAF3;
92
- --token-color-success-bg-hover: #E6F7EC;
93
- --token-color-success-border: #CDEFD9;
94
- --token-color-warning: #FAAD14;
95
- --token-color-warning-hover: #FFD666;
96
- --token-color-warning-bg: #FFFBE6;
97
- --token-color-warning-bg-hover: #FFF3CF;
98
- --token-color-warning-border: #FFE5BF;
99
-
100
- /* --- Accent Colors --- */
101
- --token-color-pink: #EC4899;
102
- --token-color-pink-bg: #F9E3F3;
103
- --token-color-pink-bg-hover: #F5D4EB;
104
- --token-color-purple: #615CED;
105
- --token-color-purple-bg: #EBE9FF;
106
- --token-color-purple-bg-hover: #DDDAFF;
107
- --token-color-yellow: #FAC414;
108
- --token-color-yellow-bg: #FFF3CF;
109
- --token-color-yellow-bg-hover: #FFE9A8;
110
- --token-color-orange: #FA8125;
111
- --token-color-orange-bg: #FFEFDE;
112
- --token-color-orange-bg-hover: #FFE3C7;
113
- --token-color-teal: #14B8A6;
114
- --token-color-teal-bg: #DEF7F1;
115
- --token-color-teal-bg-hover: #CAF0E8;
116
- --token-color-blue: #0090FF;
117
- --token-color-blue-bg: #DEEDFF;
118
- --token-color-blue-bg-hover: #C8E3FF;
119
- --token-color-mauve: #8E8C99;
120
- --token-color-mauve-bg: #F1F2F3;
121
- --token-color-mauve-bg-hover: #E4E5E7;
122
- --token-color-slate: #404040;
123
- --token-color-slate-bg: #FAFAFA;
124
- --token-color-slate-bg-hover: #EFEFEF;
125
- --token-color-lavender: #B99DFF;
126
- --token-color-lavender-bg: #ECE4FF;
127
- --token-color-lavender-bg-hover: #E0D4FF;
128
- --token-color-sage: #6BB394;
129
- --token-color-sage-bg: #EFF3F2;
130
- --token-color-sage-bg-hover: #E2EAE8;
131
-
132
- /* --- Select 等组件 (input/ring/popover 等) --- */
133
- --token-color-input: var(--token-color-border-tertiary);
134
- --token-color-ring: var(--token-color-primary-border);
135
- --token-color-popover: var(--token-color-bg-container);
136
- --token-color-popover-foreground: var(--token-color-text);
137
- --token-color-accent: var(--token-color-fill-secondary);
138
- --token-color-accent-foreground: var(--token-color-text);
139
- --token-color-muted: var(--token-color-fill-tertiary);
140
- --token-color-muted-foreground: var(--token-color-text-secondary);
141
- --token-color-background: var(--token-color-bg-base);
142
-
143
- /* --- Diff --- */
144
- --token-color-diff-insert: #A6DCBA;
145
- --token-color-diff-insert-bg: #D9EBE0;
146
- --token-color-diff-remove: #FC6B83;
147
- --token-color-diff-remove-bg: #E3D1D5;
148
- }
149
-
150
- /* ============================================
151
- Theme: Dark (暗色模式)
152
- ============================================ */
153
- [data-theme="dark"] {
154
- color-scheme: dark;
155
- /* --- Primary --- */
156
- --token-color-primary: #8EE5A1;
157
- --token-color-primary-hover: #9BE6B3;
158
- --token-color-primary-active: #73CD94;
159
- --token-color-primary-bg: #14261C;
160
- --token-color-primary-bg-hover: #1A2E21;
161
- --token-color-primary-border: #335942;
162
- --token-color-primary-border-hover: #407354;
163
- --token-color-primary-text: #8EE5A1;
164
- --token-color-primary-text-hover: #9BE6B3;
165
- --token-color-primary-text-active: #73CD94;
166
- --token-color-text-on-primary: #0D0D0D;
167
-
168
- /* --- Text --- */
169
- --token-color-text: #FAF9F5;
170
- --token-color-text-secondary: #9C9D9E;
171
- --token-color-text-tertiary: #7C7D7F;
172
- --token-color-text-quaternary: #717374;
173
- --token-color-text-base: #F0F2F3;
174
-
175
- /* --- Border --- */
176
- --token-color-border: #404040;
177
- --token-color-border-secondary: #2A2A2A;
178
- --token-color-border-tertiary: #262626;
179
-
180
- /* --- Fill --- */
181
- --token-color-fill: #454545;
182
- --token-color-fill-secondary: #363636;
183
- --token-color-fill-tertiary: #1A1A1A;
184
- --token-color-fill-quaternary: #1A1A1A;
185
- --token-color-fill-disable: #525252;
186
-
187
- /* --- Background --- */
188
- --token-color-bg-container: #0D0D0D;
189
- --token-color-bg-elevated: #080808;
190
- --token-color-bg-layout: #050505;
191
- --token-color-bg-spotlight: #080808;
192
- --token-color-bg-mask: rgba(0, 0, 0, 0.7);
193
- /* PlanPart 点阵高亮遮罩渐变(随主题) */
194
- --token-color-mask-shimmer-weak: rgba(0, 0, 0, 0.3);
195
- --token-color-mask-shimmer-strong: rgba(0, 0, 0, 0.8);
196
- --token-color-mask-shimmer-full: rgba(0, 0, 0, 1);
197
- --token-color-bg-base: #000000;
198
- --token-color-bg-highlight: #d0d0d0;
199
- --token-color-bg-highlight-hover: #e0e0e0;
200
-
201
- /* --- Semantic Colors --- */
202
- --token-color-link: #8EE5A1;
203
- --token-color-error: #FF4D4F;
204
- --token-color-error-hover: #FF7875;
205
- --token-color-error-bg: #4A1A1B;
206
- --token-color-error-bg-hover: #5C2224;
207
- --token-color-error-border: #663338;
208
- --token-color-info: #0B83F1;
209
- --token-color-info-hover: #5EBCFF;
210
- --token-color-info-bg: #19080E;
211
- --token-color-info-bg-hover: #220A12;
212
- --token-color-info-border: #4F1C0E;
213
- --token-color-success: #73CD94;
214
- --token-color-success-hover: #8EE5A1;
215
- --token-color-success-bg: #14261C;
216
- --token-color-success-bg-hover: #1A2E21;
217
- --token-color-success-border: #335942;
218
- --token-color-warning: #FAAD14;
219
- --token-color-warning-hover: #FFD666;
220
- --token-color-warning-bg: #4A4019;
221
- --token-color-warning-bg-hover: #5C4E1F;
222
- --token-color-warning-border: #664D19;
223
-
224
- /* --- Accent Colors --- */
225
- --token-color-pink: #EC4899;
226
- --token-color-pink-bg: #4A1C31;
227
- --token-color-pink-bg-hover: #5C2440;
228
- --token-color-purple: #615CED;
229
- --token-color-purple-bg: #14160E;
230
- --token-color-purple-bg-hover: #1C1E14;
231
- --token-color-yellow: #FAC414;
232
- --token-color-yellow-bg: #4A4030;
233
- --token-color-yellow-bg-hover: #5C5040;
234
- --token-color-orange: #FA8125;
235
- --token-color-orange-bg: #4A1021;
236
- --token-color-orange-bg-hover: #5C1429;
237
- --token-color-teal: #14B8A6;
238
- --token-color-teal-bg: #21080E;
239
- --token-color-teal-bg-hover: #2E0E14;
240
- --token-color-blue: #0090FF;
241
- --token-color-blue-bg: #21120E;
242
- --token-color-blue-bg-hover: #2E1A14;
243
- --token-color-mauve: #8E8C99;
244
- --token-color-mauve-bg: #0E0D0C;
245
- --token-color-mauve-bg-hover: #1A1818;
246
- --token-color-slate: #363636;
247
- --token-color-slate-bg: #1a1a1a;
248
- --token-color-slate-bg-hover: #262626;
249
- --token-color-lavender: #B99DFF;
250
- --token-color-lavender-bg: #131B0E;
251
- --token-color-lavender-bg-hover: #1C2614;
252
- --token-color-sage: #6BB394;
253
- --token-color-sage-bg: #100C0D;
254
- --token-color-sage-bg-hover: #1A1418;
255
-
256
- /* --- Select 等组件 (input/ring/popover 等) --- */
257
- --token-color-input: var(--token-color-border-tertiary);
258
- --token-color-ring: var(--token-color-primary-border);
259
- --token-color-popover: var(--token-color-bg-container);
260
- --token-color-popover-foreground: var(--token-color-text);
261
- --token-color-accent: var(--token-color-fill-secondary);
262
- --token-color-accent-foreground: var(--token-color-text);
263
- --token-color-muted: var(--token-color-fill-tertiary);
264
- --token-color-muted-foreground: var(--token-color-text-secondary);
265
- --token-color-background: var(--token-color-bg-base);
266
-
267
- /* --- Diff --- */
268
- --token-color-diff-insert: #73CD94;
269
- --token-color-diff-insert-bg: #14261C;
270
- --token-color-diff-remove: #FC6B83;
271
- --token-color-diff-remove-bg: #1C2E2A;
272
- }
273
-
274
- /* SendButton: dark / dark-parchment 下 normal 状态使用 success 色(与 light 下 bg-bg-highlight 区分) */
275
- [data-theme="dark"] .SendButton-send,
276
- [data-theme="dark-parchment"] .SendButton-send,
277
- [data-theme="classic-dark"] .SendButton-send {
278
- background-color: var(--token-color-success);
279
- }
280
- [data-theme="dark"] .SendButton-send:hover:not(:disabled),
281
- [data-theme="dark-parchment"] .SendButton-send:hover:not(:disabled),
282
- [data-theme="classic-dark"] .SendButton-send:hover:not(:disabled) {
283
- background-color: var(--token-color-success-hover);
284
- }
285
-
286
- /* ============================================
287
- Theme: Light Parchment (羊皮纸亮色 - Figma 导入)
288
- ============================================ */
289
- [data-theme="light-parchment"] {
290
- /* --- Primary --- */
291
- --token-color-primary: #202116;
292
- --token-color-primary-hover: #3D3930;
293
- --token-color-primary-active: #3D3930;
294
- --token-color-primary-bg: #F0EDE7;
295
- --token-color-primary-bg-hover: #E8E4DC;
296
- --token-color-primary-border: #D4CFC6;
297
- --token-color-primary-border-hover: #C4BEB4;
298
- --token-color-primary-text: #202116;
299
- --token-color-primary-text-hover: #3D3930;
300
- --token-color-primary-text-active: #3D3930;
301
- --token-color-text-on-primary: #FAF9F6;
302
-
303
- /* --- Text --- */
304
- --token-color-text: #202116;
305
- --token-color-text-secondary: #4A463C;
306
- --token-color-text-tertiary: #6B665C;
307
- --token-color-text-quaternary: #8A857A;
308
- --token-color-text-base: #202116;
309
-
310
- /* --- Border --- */
311
- --token-color-border: #D4CFC6;
312
- --token-color-border-secondary: #E5E1D9;
313
- --token-color-border-tertiary: #EDE9E2;
314
-
315
- /* --- Fill --- */
316
- --token-color-fill: #F5F0E7;
317
- --token-color-fill-secondary: #EDE8E0;
318
- --token-color-fill-tertiary: #F7F4EF;
319
- --token-color-fill-quaternary: #FAF9F6;
320
- --token-color-fill-disable: #E0DCD4;
321
-
322
- /* --- Background --- */
323
- --token-color-bg-container: #FAF9F6;
324
- --token-color-bg-elevated: #F7F4EF;
325
- --token-color-bg-layout: #FDFCFA;
326
- --token-color-bg-spotlight: #FAF9F6;
327
- --token-color-bg-mask: rgba(0, 0, 0, 0.5);
328
- /* PlanPart 点阵高亮遮罩渐变(随主题) */
329
- --token-color-mask-shimmer-weak: rgba(0, 0, 0, 0.3);
330
- --token-color-mask-shimmer-strong: rgba(0, 0, 0, 0.8);
331
- --token-color-mask-shimmer-full: rgba(0, 0, 0, 1);
332
- --token-color-bg-base: #FFFFFF;
333
- --token-color-bg-highlight: #202116;
334
- --token-color-bg-highlight-hover: #2D2A22;
335
-
336
- /* --- Semantic Colors --- */
337
- --token-color-link: #5B4A3A;
338
- --token-color-error: #FF4D4F;
339
- --token-color-error-hover: #FF7875;
340
- --token-color-error-bg: #FFF2F0;
341
- --token-color-error-bg-hover: #FFF1F0;
342
- --token-color-error-border: #FFCCC7;
343
- --token-color-info: #0B83F1;
344
- --token-color-info-hover: #5EBCFF;
345
- --token-color-info-bg: #E6F7FF;
346
- --token-color-info-bg-hover: #D0EFFF;
347
- --token-color-info-border: #B0E3FF;
348
- --token-color-success: #5A7A5E;
349
- --token-color-success-hover: #6B8F71;
350
- --token-color-success-bg: #EEF2ED;
351
- --token-color-success-bg-hover: #E4EBE2;
352
- --token-color-success-border: #C5D4C4;
353
- --token-color-warning: #FAAD14;
354
- --token-color-warning-hover: #FFD666;
355
- --token-color-warning-bg: #FFFBE6;
356
- --token-color-warning-bg-hover: #FFF3CF;
357
- --token-color-warning-border: #FFE5BF;
358
-
359
- /* --- Accent Colors --- */
360
- --token-color-pink: #EC4899;
361
- --token-color-pink-bg: #F9E3F3;
362
- --token-color-pink-bg-hover: #F5D4EB;
363
- --token-color-purple: #615CED;
364
- --token-color-purple-bg: #EBE9FF;
365
- --token-color-purple-bg-hover: #DDDAFF;
366
- --token-color-yellow: #FAC414;
367
- --token-color-yellow-bg: #FFF3CF;
368
- --token-color-yellow-bg-hover: #FFE9A8;
369
- --token-color-orange: #FA8125;
370
- --token-color-orange-bg: #FFEFDE;
371
- --token-color-orange-bg-hover: #FFE3C7;
372
- --token-color-teal: #14B8A6;
373
- --token-color-teal-bg: #DEF7F1;
374
- --token-color-teal-bg-hover: #CAF0E8;
375
- --token-color-blue: #0090FF;
376
- --token-color-blue-bg: #DEEDFF;
377
- --token-color-blue-bg-hover: #C8E3FF;
378
- --token-color-mauve: #8E8C99;
379
- --token-color-mauve-bg: #F1F2F3;
380
- --token-color-mauve-bg-hover: #E4E5E7;
381
- --token-color-slate: #1E293B;
382
- --token-color-slate-bg: #E2E8F0;
383
- --token-color-slate-bg-hover: #EFEFEF;
384
- --token-color-lavender: #B99DFF;
385
- --token-color-lavender-bg: #ECE4FF;
386
- --token-color-lavender-bg-hover: #E0D4FF;
387
- --token-color-sage: #6BB394;
388
- --token-color-sage-bg: #EFF3F2;
389
- --token-color-sage-bg-hover: #E2EAE8;
390
-
391
- /* --- Select 等组件 (input/ring/popover 等) --- */
392
- --token-color-input: var(--token-color-border-tertiary);
393
- --token-color-ring: var(--token-color-primary-border);
394
- --token-color-popover: var(--token-color-bg-container);
395
- --token-color-popover-foreground: var(--token-color-text);
396
- --token-color-accent: var(--token-color-fill-secondary);
397
- --token-color-accent-foreground: var(--token-color-text);
398
- --token-color-muted: var(--token-color-fill-tertiary);
399
- --token-color-muted-foreground: var(--token-color-text-secondary);
400
- --token-color-background: var(--token-color-bg-base);
401
-
402
- /* --- Diff --- */
403
- --token-color-diff-insert: #A6DCBA;
404
- --token-color-diff-insert-bg: #D9EBE0;
405
- --token-color-diff-remove: #FC6B83;
406
- --token-color-diff-remove-bg: #E3D1D5;
407
- }
408
-
409
- /* ============================================
410
- Theme: Dark Parchment (羊皮纸暗色)
411
- ============================================ */
412
- [data-theme="dark-parchment"] {
413
- color-scheme: dark;
414
- /* --- Primary --- */
415
- --token-color-primary: #C4B8A8;
416
- --token-color-primary-hover: #D4C9BC;
417
- --token-color-primary-active: #A89888;
418
- --token-color-primary-bg: #2D2A22;
419
- --token-color-primary-bg-hover: #363228;
420
- --token-color-primary-border: #4A463C;
421
- --token-color-primary-border-hover: #5B564C;
422
- --token-color-primary-text: #FAF9F6;
423
- --token-color-primary-text-hover: #D4C9BC;
424
- --token-color-primary-text-active: #C4B8A8;
425
- --token-color-text-on-primary: #1A1814;
426
-
427
- /* --- Text --- */
428
- --token-color-text: #FAF9F6;
429
- --token-color-text-secondary: #C9C4B8;
430
- --token-color-text-tertiary: #A8A296;
431
- --token-color-text-quaternary: #8A857A;
432
- --token-color-text-base: #F0EDE7;
433
-
434
- /* --- Border --- */
435
- --token-color-border: #4A463C;
436
- --token-color-border-secondary: #3D3930;
437
- --token-color-border-tertiary: #2D2A22;
438
-
439
- /* --- Fill --- */
440
- --token-color-fill: #3D3930;
441
- --token-color-fill-secondary: #363228;
442
- --token-color-fill-tertiary: #252220;
443
- --token-color-fill-quaternary: #1E1C18;
444
- --token-color-fill-disable: #4A463C;
445
-
446
- /* --- Background --- */
447
- --token-color-bg-container: #1E1C18;
448
- --token-color-bg-elevated: #252220;
449
- --token-color-bg-layout: #1A1814;
450
- --token-color-bg-spotlight: #252220;
451
- --token-color-bg-mask: rgba(0, 0, 0, 0.6);
452
- /* PlanPart 点阵高亮遮罩渐变(随主题) */
453
- --token-color-mask-shimmer-weak: rgba(0, 0, 0, 0.3);
454
- --token-color-mask-shimmer-strong: rgba(0, 0, 0, 0.8);
455
- --token-color-mask-shimmer-full: rgba(0, 0, 0, 1);
456
- --token-color-bg-base: #1A1814;
457
- --token-color-bg-highlight: #C9C4B8;
458
- --token-color-bg-highlight-hover: #D4C9BC;
459
-
460
- /* --- Semantic Colors --- */
461
- --token-color-link: #C4B8A8;
462
- --token-color-error: #FF6B6B;
463
- --token-color-error-hover: #FF8787;
464
- --token-color-error-bg: #4A2A2A;
465
- --token-color-error-bg-hover: #5C3535;
466
- --token-color-error-border: #663338;
467
- --token-color-info: #5EBCFF;
468
- --token-color-info-hover: #7EC9FF;
469
- --token-color-info-bg: #1A2838;
470
- --token-color-info-bg-hover: #223244;
471
- --token-color-info-border: #2A4050;
472
- --token-color-success: #6B8F71;
473
- --token-color-success-hover: #7FA385;
474
- --token-color-success-bg: #1C2A1E;
475
- --token-color-success-bg-hover: #243224;
476
- --token-color-success-border: #3D4A3C;
477
- --token-color-warning: #E5A814;
478
- --token-color-warning-hover: #F5C024;
479
- --token-color-warning-bg: #4A4019;
480
- --token-color-warning-bg-hover: #5C4E1F;
481
- --token-color-warning-border: #664D19;
482
-
483
- /* --- Accent Colors --- */
484
- --token-color-pink: #EC4899;
485
- --token-color-pink-bg: #4A2A38;
486
- --token-color-pink-bg-hover: #5C3540;
487
- --token-color-purple: #8B7BED;
488
- --token-color-purple-bg: #2A2238;
489
- --token-color-purple-bg-hover: #362E44;
490
- --token-color-yellow: #E5C04A;
491
- --token-color-yellow-bg: #4A4030;
492
- --token-color-yellow-bg-hover: #5C5040;
493
- --token-color-orange: #E07830;
494
- --token-color-orange-bg: #4A3020;
495
- --token-color-orange-bg-hover: #5C3A28;
496
- --token-color-teal: #14B8A6;
497
- --token-color-teal-bg: #1A3230;
498
- --token-color-teal-bg-hover: #243A38;
499
- --token-color-blue: #0090FF;
500
- --token-color-blue-bg: #1A2838;
501
- --token-color-blue-bg-hover: #223244;
502
- --token-color-mauve: #9C9AA8;
503
- --token-color-mauve-bg: #2A2830;
504
- --token-color-mauve-bg-hover: #363438;
505
- --token-color-slate: #5C5A52;
506
- --token-color-slate-bg: #2D2A22;
507
- --token-color-slate-bg-hover: #363228;
508
- --token-color-lavender: #B99DFF;
509
- --token-color-lavender-bg: #2A2238;
510
- --token-color-lavender-bg-hover: #362E44;
511
- --token-color-sage: #6BB394;
512
- --token-color-sage-bg: #1C2A24;
513
- --token-color-sage-bg-hover: #243228;
514
-
515
- /* --- Select 等组件 (input/ring/popover 等) --- */
516
- --token-color-input: var(--token-color-border-tertiary);
517
- --token-color-ring: var(--token-color-primary-border);
518
- --token-color-popover: var(--token-color-bg-container);
519
- --token-color-popover-foreground: var(--token-color-text);
520
- --token-color-accent: var(--token-color-fill-secondary);
521
- --token-color-accent-foreground: var(--token-color-text);
522
- --token-color-muted: var(--token-color-fill-tertiary);
523
- --token-color-muted-foreground: var(--token-color-text-secondary);
524
- --token-color-background: var(--token-color-bg-base);
525
-
526
- /* --- Diff --- */
527
- --token-color-diff-insert: #6B8F71;
528
- --token-color-diff-insert-bg: #1C2A1E;
529
- --token-color-diff-remove: #FC6B83;
530
- --token-color-diff-remove-bg: #2A1C1E;
531
- }
532
-
533
- /* ============================================
534
- 扩展主题模板
535
- ============================================
536
-
537
- 复制以下模板创建新主题:
538
-
539
- [data-theme="your-theme-name"] {
540
- --token-color-primary: #...;
541
- --token-color-primary-hover: #...;
542
- ... (覆盖需要的变量,使用 --token-color-* 命名)
543
- }
544
-
545
- ============================================ */
546
-
547
- /* ============================================
548
- Tailwind v4 @theme 映射
549
- ============================================ */
550
- @custom-variant dark (&:where([data-theme="dark"], [data-theme="dark"] *, [data-theme="dark-parchment"], [data-theme="dark-parchment"] *));
551
-
552
- /* font-size / radius / spacing 随 data-style 变化,需用 @theme inline 让工具类直接引用运行时变量 */
553
- @theme inline {
554
- --text-xs: var(--font-size-xs);
555
- --text-xs--line-height: var(--font-size-xs--line-height);
556
- --text-sm: var(--font-size-sm);
557
- --text-sm--line-height: var(--font-size-sm--line-height);
558
- --text-base: var(--font-size-base);
559
- --text-base--line-height: var(--font-size-base--line-height);
560
- --text-lg: var(--font-size-lg);
561
- --text-lg--line-height: var(--font-size-lg--line-height);
562
- --text-xl: var(--font-size-xl);
563
- --text-xl--line-height: var(--font-size-xl--line-height);
564
- --text-2xl: var(--font-size-2xl);
565
- --text-2xl--line-height: var(--font-size-2xl--line-height);
566
- --text-3xl: var(--font-size-3xl);
567
- --text-3xl--line-height: var(--font-size-3xl--line-height);
568
- --text-4xl: var(--font-size-4xl);
569
- --text-4xl--line-height: var(--font-size-4xl--line-height);
570
- --text-5xl: var(--font-size-5xl);
571
- --text-5xl--line-height: var(--font-size-5xl--line-height);
572
- --text-6xl: var(--font-size-6xl);
573
- --text-6xl--line-height: var(--font-size-6xl--line-height);
574
- --radius: var(--radius-DEFAULT);
575
- --radius-none: var(--radius-none);
576
- --radius-sm: var(--radius-sm);
577
- --radius-md: var(--radius-md);
578
- --radius-lg: var(--radius-lg);
579
- --radius-xl: var(--radius-xl);
580
- --radius-2xl: var(--radius-2xl);
581
- --radius-3xl: var(--radius-3xl);
582
- --radius-full: var(--radius-full);
583
- --spacing-0: var(--spacing-0);
584
- --spacing-px: var(--spacing-px);
585
- --spacing-0\.5: var(--spacing-0\.5);
586
- --spacing-1: var(--spacing-1);
587
- --spacing-1\.5: var(--spacing-1\.5);
588
- --spacing-2: var(--spacing-2);
589
- --spacing-2\.5: var(--spacing-2\.5);
590
- --spacing-3: var(--spacing-3);
591
- --spacing-3\.5: var(--spacing-3\.5);
592
- --spacing-4: var(--spacing-4);
593
- --spacing-5: var(--spacing-5);
594
- --spacing-6: var(--spacing-6);
595
- --spacing-7: var(--spacing-7);
596
- --spacing-8: var(--spacing-8);
597
- --spacing-9: var(--spacing-9);
598
- --spacing-10: var(--spacing-10);
599
- --spacing-11: var(--spacing-11);
600
- --spacing-12: var(--spacing-12);
601
- --spacing-14: var(--spacing-14);
602
- --spacing-16: var(--spacing-16);
603
- --spacing-20: var(--spacing-20);
604
- --spacing-24: var(--spacing-24);
605
- --spacing-28: var(--spacing-28);
606
- --spacing-32: var(--spacing-32);
607
- --spacing-36: var(--spacing-36);
608
- --spacing-40: var(--spacing-40);
609
- --spacing-44: var(--spacing-44);
610
- --spacing-48: var(--spacing-48);
611
- --spacing-52: var(--spacing-52);
612
- --spacing-56: var(--spacing-56);
613
- --spacing-60: var(--spacing-60);
614
- --spacing-64: var(--spacing-64);
615
- --spacing-72: var(--spacing-72);
616
- --spacing-80: var(--spacing-80);
617
- --spacing-96: var(--spacing-96);
618
- }
619
-
620
- @theme {
621
- /* Font */
622
- --font-display: 'Inter var', system-ui, sans-serif;
623
- /* Primary */
624
- --color-primary: var(--token-color-primary);
625
- --color-primary-hover: var(--token-color-primary-hover);
626
- --color-primary-active: var(--token-color-primary-active);
627
- --color-primary-bg: var(--token-color-primary-bg);
628
- --color-primary-bg-hover: var(--token-color-primary-bg-hover);
629
- --color-primary-border: var(--token-color-primary-border);
630
- --color-primary-border-hover: var(--token-color-primary-border-hover);
631
- --color-primary-text: var(--token-color-primary-text);
632
- --color-primary-text-hover: var(--token-color-primary-text-hover);
633
- --color-primary-text-active: var(--token-color-primary-text-active);
634
- --color-text-on-primary: var(--token-color-text-on-primary);
635
-
636
- /* Text */
637
- --color-text: var(--token-color-text);
638
- --color-text-secondary: var(--token-color-text-secondary);
639
- --color-text-tertiary: var(--token-color-text-tertiary);
640
- --color-text-quaternary: var(--token-color-text-quaternary);
641
- --color-text-base: var(--token-color-text-base);
642
-
643
- /* Border */
644
- --color-border: var(--token-color-border);
645
- /* Select 等 - 映射到现有 token */
646
- --color-input: var(--token-color-border-tertiary);
647
- --color-ring: var(--token-color-primary-border);
648
- --color-popover: var(--token-color-bg-container);
649
- --color-popover-foreground: var(--token-color-text);
650
- --color-accent: var(--token-color-fill-secondary);
651
- --color-accent-foreground: var(--token-color-text);
652
- --color-muted: var(--token-color-fill-tertiary);
653
- --color-muted-foreground: var(--token-color-text-secondary);
654
- --color-background: var(--token-color-bg-base);
655
- --color-border-secondary: var(--token-color-border-secondary);
656
- --color-border-tertiary: var(--token-color-border-tertiary);
657
-
658
- /* Fill */
659
- --color-fill: var(--token-color-fill);
660
- --color-fill-secondary: var(--token-color-fill-secondary);
661
- --color-fill-tertiary: var(--token-color-fill-tertiary);
662
- --color-fill-quaternary: var(--token-color-fill-quaternary);
663
- --color-fill-disable: var(--token-color-fill-disable);
664
-
665
- /* Background */
666
- --color-bg-container: var(--token-color-bg-container);
667
- --color-bg-elevated: var(--token-color-bg-elevated);
668
- --color-bg-layout: var(--token-color-bg-layout);
669
- --color-bg-spotlight: var(--token-color-bg-spotlight);
670
- --color-bg-mask: var(--token-color-bg-mask);
671
- --color-mask-shimmer-weak: var(--token-color-mask-shimmer-weak);
672
- --color-mask-shimmer-strong: var(--token-color-mask-shimmer-strong);
673
- --color-mask-shimmer-full: var(--token-color-mask-shimmer-full);
674
- --color-bg-base: var(--token-color-bg-base);
675
- --color-bg-highlight: var(--token-color-bg-highlight);
676
- --color-bg-highlight-hover: var(--token-color-bg-highlight-hover);
677
-
678
- /* Shadow(1~4 级,与 primary/secondary/tertiary/quaternary 一致) */
679
- --color-shadow-primary: var(--token-color-shadow-primary);
680
- --color-shadow-secondary: var(--token-color-shadow-secondary);
681
- --color-shadow-tertiary: var(--token-color-shadow-tertiary);
682
- --color-shadow-quaternary: var(--token-color-shadow-quaternary);
683
-
684
- /* Semantic */
685
- --color-link: var(--token-color-link);
686
- --color-error: var(--token-color-error);
687
- --color-error-hover: var(--token-color-error-hover);
688
- --color-error-bg: var(--token-color-error-bg);
689
- --color-error-bg-hover: var(--token-color-error-bg-hover);
690
- --color-error-border: var(--token-color-error-border);
691
- --color-info: var(--token-color-info);
692
- --color-info-hover: var(--token-color-info-hover);
693
- --color-info-bg: var(--token-color-info-bg);
694
- --color-info-bg-hover: var(--token-color-info-bg-hover);
695
- --color-info-border: var(--token-color-info-border);
696
- --color-success: var(--token-color-success);
697
- --color-success-hover: var(--token-color-success-hover);
698
- --color-success-bg: var(--token-color-success-bg);
699
- --color-success-bg-hover: var(--token-color-success-bg-hover);
700
- --color-success-border: var(--token-color-success-border);
701
- --color-warning: var(--token-color-warning);
702
- --color-warning-hover: var(--token-color-warning-hover);
703
- --color-warning-bg: var(--token-color-warning-bg);
704
- --color-warning-bg-hover: var(--token-color-warning-bg-hover);
705
- --color-warning-border: var(--token-color-warning-border);
706
-
707
- /* Accent */
708
- --color-pink: var(--token-color-pink);
709
- --color-pink-bg: var(--token-color-pink-bg);
710
- --color-pink-bg-hover: var(--token-color-pink-bg-hover);
711
- --color-purple: var(--token-color-purple);
712
- --color-purple-bg: var(--token-color-purple-bg);
713
- --color-purple-bg-hover: var(--token-color-purple-bg-hover);
714
- --color-yellow: var(--token-color-yellow);
715
- --color-yellow-bg: var(--token-color-yellow-bg);
716
- --color-yellow-bg-hover: var(--token-color-yellow-bg-hover);
717
- --color-orange: var(--token-color-orange);
718
- --color-orange-bg: var(--token-color-orange-bg);
719
- --color-orange-bg-hover: var(--token-color-orange-bg-hover);
720
- --color-teal: var(--token-color-teal);
721
- --color-teal-bg: var(--token-color-teal-bg);
722
- --color-teal-bg-hover: var(--token-color-teal-bg-hover);
723
- --color-blue: var(--token-color-blue);
724
- --color-blue-bg: var(--token-color-blue-bg);
725
- --color-blue-bg-hover: var(--token-color-blue-bg-hover);
726
- --color-mauve: var(--token-color-mauve);
727
- --color-mauve-bg: var(--token-color-mauve-bg);
728
- --color-mauve-bg-hover: var(--token-color-mauve-bg-hover);
729
- --color-slate: var(--token-color-slate);
730
- --color-slate-bg: var(--token-color-slate-bg);
731
- --color-slate-bg-hover: var(--token-color-slate-bg-hover);
732
- --color-lavender: var(--token-color-lavender);
733
- --color-lavender-bg: var(--token-color-lavender-bg);
734
- --color-lavender-bg-hover: var(--token-color-lavender-bg-hover);
735
- --color-sage: var(--token-color-sage);
736
- --color-sage-bg: var(--token-color-sage-bg);
737
- --color-sage-bg-hover: var(--token-color-sage-bg-hover);
738
-
739
- /* Diff */
740
- --color-diff-insert: var(--token-color-diff-insert);
741
- --color-diff-insert-bg: var(--token-color-diff-insert-bg);
742
- --color-diff-remove: var(--token-color-diff-remove);
743
- --color-diff-remove-bg: var(--token-color-diff-remove-bg);
744
-
745
- /* Accordion 展开/收起动画(Radix 提供 --radix-accordion-content-height) */
746
- --animate-accordion-down: accordion-down 0.2s ease-out;
747
- --animate-accordion-up: accordion-up 0.2s ease-out;
748
- --animate-accordion-right: accordion-right 0.2s ease-out;
749
- --animate-accordion-left: accordion-left 0.2s ease-out;
750
- }
751
-
752
- /* 行高随 data-style 变化,与 text-xs/text-sm/text-base 等配套使用,避免固定 leading-6 等 */
753
- .leading-xs { line-height: var(--font-size-xs--line-height); }
754
- .leading-sm { line-height: var(--font-size-sm--line-height); }
755
- .leading-base { line-height: var(--font-size-base--line-height); }
756
- .leading-lg { line-height: var(--font-size-lg--line-height); }
757
- .leading-xl { line-height: var(--font-size-xl--line-height); }
758
-
759
- @keyframes accordion-down {
760
- from {
761
- height: 0;
762
- }
763
- to {
764
- height: var(--radix-accordion-content-height);
765
- }
766
- }
767
- @keyframes accordion-up {
768
- from {
769
- height: var(--radix-accordion-content-height);
770
- }
771
- to {
772
- height: 0;
773
- }
774
- }
775
- @keyframes accordion-right {
776
- from {
777
- width: 0;
778
- }
779
- to {
780
- width: var(--radix-accordion-content-width);
781
- }
782
- }
783
- @keyframes accordion-left {
784
- from {
785
- width: var(--radix-accordion-content-width);
786
- }
787
- to {
788
- width: 0;
789
- }
790
- }
791
-
792
- /* ============================================
793
- Seti 文件图标字体(与 QodeChatPanel 一致;需将 qoder-seti.woff 置于 public/ 或根路径)
794
- ============================================ */
795
- @font-face {
796
- font-family: 'Seti';
797
- src: url('/qoder-seti.woff') format('woff');
798
- font-weight: normal;
799
- font-style: normal;
800
- font-display: swap;
801
- }
802
- .font-seti {
803
- font-family: 'Seti', sans-serif;
804
- }
13
+ @import "./theme-base.css";
14
+ @import "./themes/light-qoder.css";
15
+ @import "./themes/dark-qoder.css";
16
+ @import "./themes/light-parchment.css";
17
+ @import "./themes/dark-parchment.css";