sparkdesign 0.3.5 → 0.4.1

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 (30) hide show
  1. package/cli/registry/{basic → __tests__/basic}/button.test.tsx +1 -1
  2. package/cli/registry/{chat → __tests__/chat}/markdown.test.tsx +1 -1
  3. package/cli/registry/{chat → __tests__/chat}/thinking-indicator.test.tsx +1 -1
  4. package/cli/registry/{chat → __tests__/chat}/tool-invocation-card.test.tsx +1 -1
  5. package/cli/registry/basic/shimmering-text.tsx +115 -0
  6. package/cli/registry/{chat → basic}/sidebar-menu.tsx +2 -2
  7. package/cli/registry/meta.json +1 -1
  8. package/dist/registry/basic/shimmering-text.d.ts +27 -0
  9. package/dist/scale/computed.css +103 -0
  10. package/dist/scale/config.css +110 -0
  11. package/dist/scale/index.css +30 -0
  12. package/dist/scale/presets/compact.css +30 -0
  13. package/dist/scale/presets/dense.css +64 -0
  14. package/dist/scale/presets/sharp.css +40 -0
  15. package/dist/scale/presets/soft.css +16 -0
  16. package/dist/spark-design.cjs.js +17 -17
  17. package/dist/spark-design.es.js +2198 -2146
  18. package/dist/src/components/{chat → basic}/CollapsibleCard/index.d.ts +1 -1
  19. package/dist/src/components/basic/ShimmeringText/index.d.ts +7 -0
  20. package/dist/src/components/{chat → basic}/SidebarMenu/index.d.ts +1 -1
  21. package/dist/src/components/index.d.ts +8 -6
  22. package/dist/src/lib/utils.d.ts +5 -5
  23. package/dist/theme-base.css +270 -0
  24. package/dist/themes/dark-parchment.css +133 -0
  25. package/dist/themes/dark-qoder.css +133 -0
  26. package/dist/themes/light-parchment.css +124 -0
  27. package/dist/themes/light-qoder.css +132 -0
  28. package/dist/tokens/index.css +35 -0
  29. package/package.json +6 -2
  30. /package/dist/registry/{chat → basic}/sidebar-menu.d.ts +0 -0
@@ -0,0 +1,124 @@
1
+ /* ============================================
2
+ * Theme: Light Parchment (羊皮纸亮色 - Figma 导入)
3
+ * 用户可复制此文件作为自定义主题模板
4
+ * ============================================ */
5
+
6
+ [data-theme="light-parchment"] {
7
+ /* --- Primary --- */
8
+ --token-color-primary: #202116;
9
+ --token-color-primary-hover: #3D3930;
10
+ --token-color-primary-active: #3D3930;
11
+ --token-color-primary-bg: #F0EDE7;
12
+ --token-color-primary-bg-hover: #E8E4DC;
13
+ --token-color-primary-border: #D4CFC6;
14
+ --token-color-primary-border-hover: #C4BEB4;
15
+ --token-color-primary-text: #202116;
16
+ --token-color-primary-text-hover: #3D3930;
17
+ --token-color-primary-text-active: #3D3930;
18
+ --token-color-text-on-primary: #FAF9F6;
19
+
20
+ /* --- Text --- */
21
+ --token-color-text: #202116;
22
+ --token-color-text-secondary: #4A463C;
23
+ --token-color-text-tertiary: #6B665C;
24
+ --token-color-text-quaternary: #8A857A;
25
+ --token-color-text-base: #202116;
26
+
27
+ /* --- Border --- */
28
+ --token-color-border: #D4CFC6;
29
+ --token-color-border-secondary: #E5E1D9;
30
+ --token-color-border-tertiary: #EDE9E2;
31
+
32
+ /* --- Fill --- */
33
+ --token-color-fill: #F5F0E7;
34
+ --token-color-fill-secondary: #EDE8E0;
35
+ --token-color-fill-tertiary: #F7F4EF;
36
+ --token-color-fill-quaternary: #FAF9F6;
37
+ --token-color-fill-disable: #E0DCD4;
38
+
39
+ /* --- Background --- */
40
+ --token-color-bg-container: #FAF9F6;
41
+ --token-color-bg-elevated: #F7F4EF;
42
+ --token-color-bg-layout: #FDFCFA;
43
+ --token-color-bg-spotlight: #FAF9F6;
44
+ --token-color-bg-mask: rgba(0, 0, 0, 0.5);
45
+ /* PlanPart 点阵高亮遮罩渐变(随主题) */
46
+ --token-color-mask-shimmer-weak: rgba(0, 0, 0, 0.3);
47
+ --token-color-mask-shimmer-strong: rgba(0, 0, 0, 0.8);
48
+ --token-color-mask-shimmer-full: rgba(0, 0, 0, 1);
49
+ --token-color-bg-base: #FFFFFF;
50
+ --token-color-bg-highlight: #202116;
51
+ --token-color-bg-highlight-hover: #2D2A22;
52
+
53
+ /* --- Semantic Colors --- */
54
+ --token-color-link: #5B4A3A;
55
+ --token-color-error: #FF4D4F;
56
+ --token-color-error-hover: #FF7875;
57
+ --token-color-error-bg: #FFF2F0;
58
+ --token-color-error-bg-hover: #FFF1F0;
59
+ --token-color-error-border: #FFCCC7;
60
+ --token-color-info: #0B83F1;
61
+ --token-color-info-hover: #5EBCFF;
62
+ --token-color-info-bg: #E6F7FF;
63
+ --token-color-info-bg-hover: #D0EFFF;
64
+ --token-color-info-border: #B0E3FF;
65
+ --token-color-success: #5A7A5E;
66
+ --token-color-success-hover: #6B8F71;
67
+ --token-color-success-bg: #EEF2ED;
68
+ --token-color-success-bg-hover: #E4EBE2;
69
+ --token-color-success-border: #C5D4C4;
70
+ --token-color-warning: #FAAD14;
71
+ --token-color-warning-hover: #FFD666;
72
+ --token-color-warning-bg: #FFFBE6;
73
+ --token-color-warning-bg-hover: #FFF3CF;
74
+ --token-color-warning-border: #FFE5BF;
75
+
76
+ /* --- Accent Colors --- */
77
+ --token-color-pink: #EC4899;
78
+ --token-color-pink-bg: #F9E3F3;
79
+ --token-color-pink-bg-hover: #F5D4EB;
80
+ --token-color-purple: #615CED;
81
+ --token-color-purple-bg: #EBE9FF;
82
+ --token-color-purple-bg-hover: #DDDAFF;
83
+ --token-color-yellow: #FAC414;
84
+ --token-color-yellow-bg: #FFF3CF;
85
+ --token-color-yellow-bg-hover: #FFE9A8;
86
+ --token-color-orange: #FA8125;
87
+ --token-color-orange-bg: #FFEFDE;
88
+ --token-color-orange-bg-hover: #FFE3C7;
89
+ --token-color-teal: #14B8A6;
90
+ --token-color-teal-bg: #DEF7F1;
91
+ --token-color-teal-bg-hover: #CAF0E8;
92
+ --token-color-blue: #0090FF;
93
+ --token-color-blue-bg: #DEEDFF;
94
+ --token-color-blue-bg-hover: #C8E3FF;
95
+ --token-color-mauve: #8E8C99;
96
+ --token-color-mauve-bg: #F1F2F3;
97
+ --token-color-mauve-bg-hover: #E4E5E7;
98
+ --token-color-slate: #1E293B;
99
+ --token-color-slate-bg: #E2E8F0;
100
+ --token-color-slate-bg-hover: #EFEFEF;
101
+ --token-color-lavender: #B99DFF;
102
+ --token-color-lavender-bg: #ECE4FF;
103
+ --token-color-lavender-bg-hover: #E0D4FF;
104
+ --token-color-sage: #6BB394;
105
+ --token-color-sage-bg: #EFF3F2;
106
+ --token-color-sage-bg-hover: #E2EAE8;
107
+
108
+ /* --- Select 等组件 (input/ring/popover 等) --- */
109
+ --token-color-input: var(--token-color-border-tertiary);
110
+ --token-color-ring: var(--token-color-primary-border);
111
+ --token-color-popover: var(--token-color-bg-container);
112
+ --token-color-popover-foreground: var(--token-color-text);
113
+ --token-color-accent: var(--token-color-fill-secondary);
114
+ --token-color-accent-foreground: var(--token-color-text);
115
+ --token-color-muted: var(--token-color-fill-tertiary);
116
+ --token-color-muted-foreground: var(--token-color-text-secondary);
117
+ --token-color-background: var(--token-color-bg-base);
118
+
119
+ /* --- Diff --- */
120
+ --token-color-diff-insert: #A6DCBA;
121
+ --token-color-diff-insert-bg: #D9EBE0;
122
+ --token-color-diff-remove: #FC6B83;
123
+ --token-color-diff-remove-bg: #E3D1D5;
124
+ }
@@ -0,0 +1,132 @@
1
+ /* ============================================
2
+ * Theme: Light (亮色模式)
3
+ * 用户可复制此文件作为自定义主题模板
4
+ * ============================================ */
5
+
6
+ :root,
7
+ [data-theme="light"] {
8
+ color-scheme: light;
9
+ /* --- Primary --- */
10
+ --token-color-primary: #8EE5A1;
11
+ --token-color-primary-hover: #73CD94;
12
+ --token-color-primary-active: #5CB870;
13
+ --token-color-primary-bg: #F1FAF3;
14
+ --token-color-primary-bg-hover: #E6F7EC;
15
+ --token-color-primary-border: #CDEFD9;
16
+ --token-color-primary-border-hover: #B3E6C7;
17
+ --token-color-primary-text: #141414;
18
+ --token-color-primary-text-hover: #73CD94;
19
+ --token-color-primary-text-active: #5CB870;
20
+ --token-color-text-on-primary: #FDFDFD;
21
+
22
+ /* --- Text --- */
23
+ --token-color-text: #141414;
24
+ --token-color-text-secondary: #636261;
25
+ --token-color-text-tertiary: #838280;
26
+ --token-color-text-quaternary: #8E8C8B;
27
+ --token-color-text-base: #0F0D0C;
28
+
29
+ /* --- Border --- */
30
+ --token-color-border: #BCBBBA;
31
+ --token-color-border-secondary: #DDDDDD;
32
+ --token-color-border-tertiary: #E6E6E6;
33
+
34
+ /* --- Fill --- */
35
+ --token-color-fill: #DFDFDF;
36
+ --token-color-fill-secondary: #EFEFEF;
37
+ --token-color-fill-tertiary: #F9F9F9;
38
+ --token-color-fill-quaternary: #FCFCFC;
39
+ --token-color-fill-disable: #DAD9D8;
40
+
41
+ /* --- Background --- */
42
+ --token-color-bg-container: #FFFFFF;
43
+ --token-color-bg-elevated: #F9F9F9;
44
+ --token-color-bg-layout: #FDFDFD;
45
+ --token-color-bg-spotlight: #FAFAFA;
46
+ --token-color-bg-mask: rgba(0, 0, 0, 0.5);
47
+ /* PlanPart 点阵高亮遮罩渐变(随主题) */
48
+ --token-color-mask-shimmer-weak: rgba(0, 0, 0, 0.3);
49
+ --token-color-mask-shimmer-strong: rgba(0, 0, 0, 0.8);
50
+ --token-color-mask-shimmer-full: rgba(0, 0, 0, 1);
51
+ --token-color-bg-base: #FFFFFF;
52
+ --token-color-bg-highlight: #080807;
53
+ --token-color-bg-highlight-hover: #1a1a1a;
54
+
55
+ /* --- Shadow (输入框等浮层,1~4 级与 primary/secondary/tertiary/quaternary 一致,与 data-theme 无关) --- */
56
+ --token-color-shadow-primary: rgba(0, 0, 0, 0.02);
57
+ --token-color-shadow-secondary: rgba(0, 0, 0, 0.035);
58
+ --token-color-shadow-tertiary: rgba(0, 0, 0, 0.055);
59
+ --token-color-shadow-quaternary: rgba(0, 0, 0, 0.075);
60
+
61
+ /* --- Semantic Colors --- */
62
+ --token-color-link: #5CB870;
63
+ --token-color-error: #FF4D4F;
64
+ --token-color-error-hover: #FF7875;
65
+ --token-color-error-bg: #FFF2F0;
66
+ --token-color-error-bg-hover: #FFE4E0;
67
+ --token-color-error-border: #FFCCC7;
68
+ --token-color-info: #0B83F1;
69
+ --token-color-info-hover: #5EBCFF;
70
+ --token-color-info-bg: #E6F7FF;
71
+ --token-color-info-bg-hover: #D0EFFF;
72
+ --token-color-info-border: #B0E3FF;
73
+ --token-color-success: #73CD94;
74
+ --token-color-success-hover: #8EE5A1;
75
+ --token-color-success-bg: #F1FAF3;
76
+ --token-color-success-bg-hover: #E6F7EC;
77
+ --token-color-success-border: #CDEFD9;
78
+ --token-color-warning: #FAAD14;
79
+ --token-color-warning-hover: #FFD666;
80
+ --token-color-warning-bg: #FFFBE6;
81
+ --token-color-warning-bg-hover: #FFF3CF;
82
+ --token-color-warning-border: #FFE5BF;
83
+
84
+ /* --- Accent Colors --- */
85
+ --token-color-pink: #EC4899;
86
+ --token-color-pink-bg: #F9E3F3;
87
+ --token-color-pink-bg-hover: #F5D4EB;
88
+ --token-color-purple: #615CED;
89
+ --token-color-purple-bg: #EBE9FF;
90
+ --token-color-purple-bg-hover: #DDDAFF;
91
+ --token-color-yellow: #FAC414;
92
+ --token-color-yellow-bg: #FFF3CF;
93
+ --token-color-yellow-bg-hover: #FFE9A8;
94
+ --token-color-orange: #FA8125;
95
+ --token-color-orange-bg: #FFEFDE;
96
+ --token-color-orange-bg-hover: #FFE3C7;
97
+ --token-color-teal: #14B8A6;
98
+ --token-color-teal-bg: #DEF7F1;
99
+ --token-color-teal-bg-hover: #CAF0E8;
100
+ --token-color-blue: #0090FF;
101
+ --token-color-blue-bg: #DEEDFF;
102
+ --token-color-blue-bg-hover: #C8E3FF;
103
+ --token-color-mauve: #8E8C99;
104
+ --token-color-mauve-bg: #F1F2F3;
105
+ --token-color-mauve-bg-hover: #E4E5E7;
106
+ --token-color-slate: #404040;
107
+ --token-color-slate-bg: #FAFAFA;
108
+ --token-color-slate-bg-hover: #EFEFEF;
109
+ --token-color-lavender: #B99DFF;
110
+ --token-color-lavender-bg: #ECE4FF;
111
+ --token-color-lavender-bg-hover: #E0D4FF;
112
+ --token-color-sage: #6BB394;
113
+ --token-color-sage-bg: #EFF3F2;
114
+ --token-color-sage-bg-hover: #E2EAE8;
115
+
116
+ /* --- Select 等组件 (input/ring/popover 等) --- */
117
+ --token-color-input: var(--token-color-border-tertiary);
118
+ --token-color-ring: var(--token-color-primary-border);
119
+ --token-color-popover: var(--token-color-bg-container);
120
+ --token-color-popover-foreground: var(--token-color-text);
121
+ --token-color-accent: var(--token-color-fill-secondary);
122
+ --token-color-accent-foreground: var(--token-color-text);
123
+ --token-color-muted: var(--token-color-fill-tertiary);
124
+ --token-color-muted-foreground: var(--token-color-text-secondary);
125
+ --token-color-background: var(--token-color-bg-base);
126
+
127
+ /* --- Diff --- */
128
+ --token-color-diff-insert: #A6DCBA;
129
+ --token-color-diff-insert-bg: #D9EBE0;
130
+ --token-color-diff-remove: #FC6B83;
131
+ --token-color-diff-remove-bg: #E3D1D5;
132
+ }
@@ -0,0 +1,35 @@
1
+ /* ============================================
2
+ * [POS]: src/tokens/index.css - Token 系统统一入口
3
+ *
4
+ * 引入方式:
5
+ * 1. 全量引入(默认): @import "./tokens/index.css";
6
+ * 2. 按需引入:
7
+ * @import "./tokens/scale/config.css"; // 可配置基础变量
8
+ * @import "./tokens/scale/computed.css"; // 映射到实际变量
9
+ * @import "./tokens/theme-base.css";
10
+ * @import "./tokens/themes/light-qoder.css";
11
+ *
12
+ * 自定义布局配置:
13
+ * @import "./tokens/scale/config.css";
14
+ * @import "./tokens/scale/computed.css";
15
+ * :root { --config-radius-default: 10px; } // 覆盖配置
16
+ *
17
+ * 自定义颜色主题:
18
+ * @import "./tokens/theme-base.css";
19
+ * @import "./my-custom-theme.css"; // 定义 [data-theme="xxx"] { --token-color-*: ... }
20
+ * ============================================ */
21
+
22
+ /* 布局风格 Token (data-style: neutral | compact | soft | sharp | dense) */
23
+ @import "./scale.css";
24
+
25
+ /* Tailwind @theme 映射 + 动画 + 公共样式 */
26
+ @import "./theme-base.css";
27
+
28
+ /* 内置主题 (data-theme) */
29
+ @import "./themes/light-qoder.css";
30
+ @import "./themes/dark-qoder.css";
31
+ @import "./themes/light-parchment.css";
32
+ @import "./themes/dark-parchment.css";
33
+
34
+ /* 滚动条工具样式 */
35
+ @import "./scrollbar-utility.css";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sparkdesign",
3
- "version": "0.3.5",
3
+ "version": "0.4.1",
4
4
  "type": "module",
5
5
  "description": "Modern React Design System with dual-dimension theme system",
6
6
  "keywords": [
@@ -28,7 +28,11 @@
28
28
  "./style": "./dist/qoder-design.css",
29
29
  "./theme.css": "./dist/theme.css",
30
30
  "./scale.css": "./dist/scale.css",
31
- "./katex.css": "./dist/katex.css"
31
+ "./katex.css": "./dist/katex.css",
32
+ "./theme-base.css": "./dist/theme-base.css",
33
+ "./tokens/index.css": "./dist/tokens/index.css",
34
+ "./themes/*": "./dist/themes/*",
35
+ "./scale/*": "./dist/scale/*"
32
36
  },
33
37
  "files": [
34
38
  "dist",
File without changes