@yyc3/music-design-tokens 0.0.0-stage → 2.0.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.
- package/LICENSE +27 -0
- package/README.md +68 -2
- package/dist/design-tokens.d.ts +377 -0
- package/dist/design-tokens.d.ts.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +568 -0
- package/dist/index.js.map +1 -0
- package/dist/themes.d.ts +104 -0
- package/dist/themes.d.ts.map +1 -0
- package/package.json +42 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 YanYuCloudCube™ (YYC³)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
YYC³(YanYuCloudCube™)· 言启象限 | 语枢未来
|
|
26
|
+
Words Initiate Quadrants, Language Serves as Core for Future
|
|
27
|
+
万象归元于云枢 | 深栈智启新纪元
|
package/README.md
CHANGED
|
@@ -1,3 +1,69 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @yyc3/music-design-tokens
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> 六主题(deep-space / aurora / ocean / light / midnight / custom)与配色、排版、间距、动效、可访问性令牌。
|
|
4
|
+
|
|
5
|
+
| 属性 | 值 |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| 版本 | 2.0.0 |
|
|
8
|
+
| 定位 | 设计令牌与主题引擎 |
|
|
9
|
+
| 许可证 | MIT |
|
|
10
|
+
| 仓库 | https://github.com/YYC-Cube/YYC3-MusAI |
|
|
11
|
+
|
|
12
|
+
## 安装
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pnpm add @yyc3/music-design-tokens
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 快速开始
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
import { applyTheme, getTheme, THEME_IDS } from '@yyc3/music-design-tokens'
|
|
22
|
+
|
|
23
|
+
applyTheme('aurora') // 将 CSS 变量写入 :root
|
|
24
|
+
const t = getTheme('deep-space') // 读取主题定义
|
|
25
|
+
console.log(THEME_IDS, t.colors.primary)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## 导出清单
|
|
29
|
+
|
|
30
|
+
- 令牌:COLOR_ROLES、DATA_VIZ_COLORS、EMOTION_COLORS、TYPOGRAPHY、SPACING、RADIUS、SHADOWS、ANIMATION、BREAKPOINTS、Z_INDEX、COMPONENT_TOKENS、WCAG
|
|
31
|
+
- 主题:THEMES、THEME_IDS、ThemeId、ThemeDefinition、applyTheme、getTheme
|
|
32
|
+
- 自定义:CustomThemeConfig、loadCustomTheme、saveCustomTheme
|
|
33
|
+
|
|
34
|
+
## 关键 API
|
|
35
|
+
|
|
36
|
+
| 名称 | 说明 |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| `applyTheme(id: ThemeId)` | 把主题令牌写入 CSS 变量,组件无需感知主题细节 |
|
|
39
|
+
| `getTheme(id)` | 只读获取主题定义(不产生副作用) |
|
|
40
|
+
| `WCAG` | 对比度与触达尺寸基线常量,供 a11y 用例断言 |
|
|
41
|
+
|
|
42
|
+
## 说明
|
|
43
|
+
|
|
44
|
+
令牌以 CSS 变量为出口,组件只消费变量,便于运行时换肤与视觉回归。
|
|
45
|
+
|
|
46
|
+
## 兼容性
|
|
47
|
+
|
|
48
|
+
- React 19+(组件包 peer 依赖)
|
|
49
|
+
- TypeScript 5.6+ / Node.js 20.19+
|
|
50
|
+
- 现代浏览器(Chrome/Edge/Safari/Firefox 最近两个大版本)
|
|
51
|
+
|
|
52
|
+
## 开发与验证
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pnpm --filter @yyc3/music-design-tokens build
|
|
56
|
+
pnpm --filter @yyc3/music-design-tokens typecheck
|
|
57
|
+
pnpm --filter @yyc3/music-design-tokens lint
|
|
58
|
+
pnpm test:coverage
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## 许可证
|
|
62
|
+
|
|
63
|
+
MIT © 2026 YanYuCloudCube™(YYC³)
|
|
64
|
+
|
|
65
|
+
<p align="center">
|
|
66
|
+
<b>YYC³</b>(YanYuCloudCube™ · 注册商标)<br>
|
|
67
|
+
言启象限 | 语枢未来 — Words Initiate Quadrants, Language Serves as Core for Future<br>
|
|
68
|
+
<sub>© 2026 YanYuCloudCube™(YYC³)· <a href="mailto:admin@0379.email">admin@0379.email</a></sub>
|
|
69
|
+
</p>
|
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* D-Music §1.1 — Design Token System
|
|
3
|
+
*
|
|
4
|
+
* Complete design token documentation following Material Design 3.0 principles,
|
|
5
|
+
* adapted for D-Music's deep-space universe aesthetic.
|
|
6
|
+
*
|
|
7
|
+
* Token Categories:
|
|
8
|
+
* 1. Color System (primary, secondary, semantic, data-viz)
|
|
9
|
+
* 2. Typography System (font families, weights, sizes, line-heights)
|
|
10
|
+
* 3. Spacing System (4px base grid)
|
|
11
|
+
* 4. Border Radius System (4/8/12/16/24/full)
|
|
12
|
+
* 5. Shadow/Elevation System (5 levels)
|
|
13
|
+
* 6. Animation System (durations, easings)
|
|
14
|
+
* 7. Breakpoints (responsive)
|
|
15
|
+
* 8. Z-Index System (layering)
|
|
16
|
+
*
|
|
17
|
+
* WCAG 2.1 AA: All color pairings maintain >=4.5:1 contrast ratio for text.
|
|
18
|
+
* 60fps Target: All animations use GPU-accelerated properties (transform, opacity).
|
|
19
|
+
*/
|
|
20
|
+
/** Semantic color roles mapped to CSS custom properties */
|
|
21
|
+
export declare const COLOR_ROLES: {
|
|
22
|
+
readonly background: "--dm-bg";
|
|
23
|
+
readonly backgroundPanel: "--dm-bg-panel";
|
|
24
|
+
readonly backgroundElevated: "--dm-bg-elevated";
|
|
25
|
+
readonly backgroundOverlay: "--dm-bg-overlay";
|
|
26
|
+
readonly textPrimary: "--dm-text-primary";
|
|
27
|
+
readonly textSecondary: "--dm-text-secondary";
|
|
28
|
+
readonly textTertiary: "--dm-text-tertiary";
|
|
29
|
+
readonly textDisabled: "--dm-text-disabled";
|
|
30
|
+
readonly textInverse: "--dm-text-inverse";
|
|
31
|
+
readonly accentFrom: "--dm-accent-from";
|
|
32
|
+
readonly accentTo: "--dm-accent-to";
|
|
33
|
+
readonly brandFrom: "--dm-brand-from";
|
|
34
|
+
readonly brandVia: "--dm-brand-via";
|
|
35
|
+
readonly brandTo: "--dm-brand-to";
|
|
36
|
+
readonly success: "--dm-success";
|
|
37
|
+
readonly warning: "--dm-warning";
|
|
38
|
+
readonly error: "--dm-error";
|
|
39
|
+
readonly info: "--dm-info";
|
|
40
|
+
readonly hoverBg: "--dm-hover-bg";
|
|
41
|
+
readonly activeBg: "--dm-active-bg";
|
|
42
|
+
readonly focusRing: "--dm-focus-ring";
|
|
43
|
+
readonly selectionBg: "--dm-selection-bg";
|
|
44
|
+
readonly borderDefault: "--dm-border";
|
|
45
|
+
readonly borderSubtle: "--dm-border-subtle";
|
|
46
|
+
readonly borderStrong: "--dm-border-strong";
|
|
47
|
+
};
|
|
48
|
+
/** Data visualization color palette — 8 distinct hues for chart series */
|
|
49
|
+
export declare const DATA_VIZ_COLORS: {
|
|
50
|
+
readonly series1: "#8B5CF6";
|
|
51
|
+
readonly series2: "#EC4899";
|
|
52
|
+
readonly series3: "#06B6D4";
|
|
53
|
+
readonly series4: "#F59E0B";
|
|
54
|
+
readonly series5: "#22C55E";
|
|
55
|
+
readonly series6: "#3B82F6";
|
|
56
|
+
readonly series7: "#EF4444";
|
|
57
|
+
readonly series8: "#A855F7";
|
|
58
|
+
};
|
|
59
|
+
/** Emotion-mapped colors for audio visualization */
|
|
60
|
+
export declare const EMOTION_COLORS: {
|
|
61
|
+
readonly happy: {
|
|
62
|
+
readonly primary: "#FFD700";
|
|
63
|
+
readonly secondary: "#FFA500";
|
|
64
|
+
readonly glow: "rgba(255,215,0,0.3)";
|
|
65
|
+
};
|
|
66
|
+
readonly sad: {
|
|
67
|
+
readonly primary: "#6495ED";
|
|
68
|
+
readonly secondary: "#4169E1";
|
|
69
|
+
readonly glow: "rgba(100,149,237,0.3)";
|
|
70
|
+
};
|
|
71
|
+
readonly energetic: {
|
|
72
|
+
readonly primary: "#FF4500";
|
|
73
|
+
readonly secondary: "#FF1493";
|
|
74
|
+
readonly glow: "rgba(255,69,0,0.3)";
|
|
75
|
+
};
|
|
76
|
+
readonly calm: {
|
|
77
|
+
readonly primary: "#00CED1";
|
|
78
|
+
readonly secondary: "#7B68EE";
|
|
79
|
+
readonly glow: "rgba(0,206,209,0.3)";
|
|
80
|
+
};
|
|
81
|
+
readonly neutral: {
|
|
82
|
+
readonly primary: "#667EEA";
|
|
83
|
+
readonly secondary: "#764BA2";
|
|
84
|
+
readonly glow: "rgba(102,126,234,0.3)";
|
|
85
|
+
};
|
|
86
|
+
readonly love: {
|
|
87
|
+
readonly primary: "#FF6B9D";
|
|
88
|
+
readonly secondary: "#C44569";
|
|
89
|
+
readonly glow: "rgba(255,107,157,0.3)";
|
|
90
|
+
};
|
|
91
|
+
readonly nostalgic: {
|
|
92
|
+
readonly primary: "#DEB887";
|
|
93
|
+
readonly secondary: "#D2691E";
|
|
94
|
+
readonly glow: "rgba(222,184,135,0.3)";
|
|
95
|
+
};
|
|
96
|
+
readonly hopeful: {
|
|
97
|
+
readonly primary: "#98FB98";
|
|
98
|
+
readonly secondary: "#00FA9A";
|
|
99
|
+
readonly glow: "rgba(152,251,152,0.3)";
|
|
100
|
+
};
|
|
101
|
+
readonly angry: {
|
|
102
|
+
readonly primary: "#DC143C";
|
|
103
|
+
readonly secondary: "#8B0000";
|
|
104
|
+
readonly glow: "rgba(220,20,60,0.3)";
|
|
105
|
+
};
|
|
106
|
+
readonly romantic: {
|
|
107
|
+
readonly primary: "#FFB6C1";
|
|
108
|
+
readonly secondary: "#FF69B4";
|
|
109
|
+
readonly glow: "rgba(255,182,193,0.3)";
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
export declare const TYPOGRAPHY: {
|
|
113
|
+
readonly fontFamily: {
|
|
114
|
+
readonly display: "'Space Grotesk', system-ui, -apple-system, sans-serif";
|
|
115
|
+
readonly body: "'Space Grotesk', system-ui, -apple-system, sans-serif";
|
|
116
|
+
readonly mono: "'JetBrains Mono', 'Fira Code', monospace";
|
|
117
|
+
readonly cjk: "'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif";
|
|
118
|
+
};
|
|
119
|
+
readonly fontWeight: {
|
|
120
|
+
readonly light: 300;
|
|
121
|
+
readonly regular: 400;
|
|
122
|
+
readonly medium: 500;
|
|
123
|
+
readonly semibold: 600;
|
|
124
|
+
readonly bold: 700;
|
|
125
|
+
};
|
|
126
|
+
readonly fontSize: {
|
|
127
|
+
readonly '2xs': "0.625rem";
|
|
128
|
+
readonly xs: "0.75rem";
|
|
129
|
+
readonly sm: "0.875rem";
|
|
130
|
+
readonly base: "1rem";
|
|
131
|
+
readonly lg: "1.125rem";
|
|
132
|
+
readonly xl: "1.25rem";
|
|
133
|
+
readonly '2xl': "1.5rem";
|
|
134
|
+
readonly '3xl': "1.875rem";
|
|
135
|
+
readonly '4xl': "2.25rem";
|
|
136
|
+
};
|
|
137
|
+
readonly lineHeight: {
|
|
138
|
+
readonly tight: 1.2;
|
|
139
|
+
readonly snug: 1.375;
|
|
140
|
+
readonly normal: 1.5;
|
|
141
|
+
readonly relaxed: 1.625;
|
|
142
|
+
readonly loose: 2;
|
|
143
|
+
};
|
|
144
|
+
readonly letterSpacing: {
|
|
145
|
+
readonly tighter: "-0.05em";
|
|
146
|
+
readonly tight: "-0.025em";
|
|
147
|
+
readonly normal: "0em";
|
|
148
|
+
readonly wide: "0.025em";
|
|
149
|
+
readonly wider: "0.05em";
|
|
150
|
+
readonly widest: "0.1em";
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
export declare const SPACING: {
|
|
154
|
+
readonly 0: "0px";
|
|
155
|
+
readonly 0.5: "2px";
|
|
156
|
+
readonly 1: "4px";
|
|
157
|
+
readonly 1.5: "6px";
|
|
158
|
+
readonly 2: "8px";
|
|
159
|
+
readonly 2.5: "10px";
|
|
160
|
+
readonly 3: "12px";
|
|
161
|
+
readonly 4: "16px";
|
|
162
|
+
readonly 5: "20px";
|
|
163
|
+
readonly 6: "24px";
|
|
164
|
+
readonly 8: "32px";
|
|
165
|
+
readonly 10: "40px";
|
|
166
|
+
readonly 12: "48px";
|
|
167
|
+
readonly 16: "64px";
|
|
168
|
+
readonly 20: "80px";
|
|
169
|
+
readonly 24: "96px";
|
|
170
|
+
};
|
|
171
|
+
export declare const RADIUS: {
|
|
172
|
+
readonly none: "0px";
|
|
173
|
+
readonly sm: "4px";
|
|
174
|
+
readonly md: "8px";
|
|
175
|
+
readonly lg: "12px";
|
|
176
|
+
readonly xl: "16px";
|
|
177
|
+
readonly '2xl': "24px";
|
|
178
|
+
readonly full: "9999px";
|
|
179
|
+
};
|
|
180
|
+
export declare const SHADOWS: {
|
|
181
|
+
/** Level 0 — flat */
|
|
182
|
+
readonly none: "none";
|
|
183
|
+
/** Level 1 — subtle (cards, buttons) */
|
|
184
|
+
readonly sm: "0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2)";
|
|
185
|
+
/** Level 2 — medium (dropdowns, popovers) */
|
|
186
|
+
readonly md: "0 4px 6px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.2)";
|
|
187
|
+
/** Level 3 — high (modals, dialogs) */
|
|
188
|
+
readonly lg: "0 10px 25px rgba(0,0,0,0.4), 0 4px 10px rgba(0,0,0,0.25)";
|
|
189
|
+
/** Level 4 — highest (overlays, floating panels) */
|
|
190
|
+
readonly xl: "0 20px 50px rgba(0,0,0,0.5), 0 8px 20px rgba(0,0,0,0.3)";
|
|
191
|
+
/** Inner shadow (inset elements) */
|
|
192
|
+
readonly inner: "inset 0 2px 4px rgba(0,0,0,0.25)";
|
|
193
|
+
/** Glow effect (accent-colored) */
|
|
194
|
+
readonly glow: (color: string) => string;
|
|
195
|
+
};
|
|
196
|
+
export declare const ANIMATION: {
|
|
197
|
+
readonly duration: {
|
|
198
|
+
readonly instant: "50ms";
|
|
199
|
+
readonly fast: "150ms";
|
|
200
|
+
readonly normal: "250ms";
|
|
201
|
+
readonly slow: "400ms";
|
|
202
|
+
readonly slower: "600ms";
|
|
203
|
+
readonly slowest: "1000ms";
|
|
204
|
+
};
|
|
205
|
+
readonly easing: {
|
|
206
|
+
/** Standard Material easing */
|
|
207
|
+
readonly standard: "cubic-bezier(0.4, 0, 0.2, 1)";
|
|
208
|
+
/** Decelerate (entering elements) */
|
|
209
|
+
readonly decelerate: "cubic-bezier(0, 0, 0.2, 1)";
|
|
210
|
+
/** Accelerate (exiting elements) */
|
|
211
|
+
readonly accelerate: "cubic-bezier(0.4, 0, 1, 1)";
|
|
212
|
+
/** Spring-like bounce */
|
|
213
|
+
readonly spring: "cubic-bezier(0.34, 1.56, 0.64, 1)";
|
|
214
|
+
/** Linear (progress bars, infinite loops) */
|
|
215
|
+
readonly linear: "linear";
|
|
216
|
+
};
|
|
217
|
+
/** Motion variants for motion/react */
|
|
218
|
+
readonly variants: {
|
|
219
|
+
readonly fadeIn: {
|
|
220
|
+
readonly initial: {
|
|
221
|
+
readonly opacity: 0;
|
|
222
|
+
};
|
|
223
|
+
readonly animate: {
|
|
224
|
+
readonly opacity: 1;
|
|
225
|
+
};
|
|
226
|
+
readonly exit: {
|
|
227
|
+
readonly opacity: 0;
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
readonly slideUp: {
|
|
231
|
+
readonly initial: {
|
|
232
|
+
readonly opacity: 0;
|
|
233
|
+
readonly y: 20;
|
|
234
|
+
};
|
|
235
|
+
readonly animate: {
|
|
236
|
+
readonly opacity: 1;
|
|
237
|
+
readonly y: 0;
|
|
238
|
+
};
|
|
239
|
+
readonly exit: {
|
|
240
|
+
readonly opacity: 0;
|
|
241
|
+
readonly y: 20;
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
readonly slideDown: {
|
|
245
|
+
readonly initial: {
|
|
246
|
+
readonly opacity: 0;
|
|
247
|
+
readonly y: -20;
|
|
248
|
+
};
|
|
249
|
+
readonly animate: {
|
|
250
|
+
readonly opacity: 1;
|
|
251
|
+
readonly y: 0;
|
|
252
|
+
};
|
|
253
|
+
readonly exit: {
|
|
254
|
+
readonly opacity: 0;
|
|
255
|
+
readonly y: -20;
|
|
256
|
+
};
|
|
257
|
+
};
|
|
258
|
+
readonly scaleIn: {
|
|
259
|
+
readonly initial: {
|
|
260
|
+
readonly opacity: 0;
|
|
261
|
+
readonly scale: 0.9;
|
|
262
|
+
};
|
|
263
|
+
readonly animate: {
|
|
264
|
+
readonly opacity: 1;
|
|
265
|
+
readonly scale: 1;
|
|
266
|
+
};
|
|
267
|
+
readonly exit: {
|
|
268
|
+
readonly opacity: 0;
|
|
269
|
+
readonly scale: 0.9;
|
|
270
|
+
};
|
|
271
|
+
};
|
|
272
|
+
readonly panelSlide: {
|
|
273
|
+
readonly initial: {
|
|
274
|
+
readonly opacity: 0;
|
|
275
|
+
readonly x: 300;
|
|
276
|
+
};
|
|
277
|
+
readonly animate: {
|
|
278
|
+
readonly opacity: 1;
|
|
279
|
+
readonly x: 0;
|
|
280
|
+
};
|
|
281
|
+
readonly exit: {
|
|
282
|
+
readonly opacity: 0;
|
|
283
|
+
readonly x: 300;
|
|
284
|
+
};
|
|
285
|
+
readonly transition: {
|
|
286
|
+
readonly type: "spring";
|
|
287
|
+
readonly damping: 30;
|
|
288
|
+
readonly stiffness: 300;
|
|
289
|
+
};
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
export declare const BREAKPOINTS: {
|
|
294
|
+
readonly xs: 320;
|
|
295
|
+
readonly sm: 640;
|
|
296
|
+
readonly md: 768;
|
|
297
|
+
readonly lg: 1024;
|
|
298
|
+
readonly xl: 1280;
|
|
299
|
+
readonly '2xl': 1536;
|
|
300
|
+
};
|
|
301
|
+
export declare const Z_INDEX: {
|
|
302
|
+
readonly base: 0;
|
|
303
|
+
readonly starfield: 1;
|
|
304
|
+
readonly content: 10;
|
|
305
|
+
readonly header: 20;
|
|
306
|
+
readonly mobileNav: 30;
|
|
307
|
+
readonly dropdown: 40;
|
|
308
|
+
readonly panel: 50;
|
|
309
|
+
readonly overlay: 60;
|
|
310
|
+
readonly modal: 70;
|
|
311
|
+
readonly toast: 80;
|
|
312
|
+
readonly tooltip: 90;
|
|
313
|
+
readonly perfMonitor: 95;
|
|
314
|
+
readonly maxOverlay: 100;
|
|
315
|
+
};
|
|
316
|
+
export declare const COMPONENT_TOKENS: {
|
|
317
|
+
readonly button: {
|
|
318
|
+
readonly heightSm: "32px";
|
|
319
|
+
readonly heightMd: "40px";
|
|
320
|
+
readonly heightLg: "48px";
|
|
321
|
+
readonly paddingX: {
|
|
322
|
+
readonly sm: "12px";
|
|
323
|
+
readonly md: "16px";
|
|
324
|
+
readonly lg: "24px";
|
|
325
|
+
};
|
|
326
|
+
readonly fontSize: {
|
|
327
|
+
readonly sm: "0.75rem";
|
|
328
|
+
readonly md: "0.875rem";
|
|
329
|
+
readonly lg: "1rem";
|
|
330
|
+
};
|
|
331
|
+
readonly radius: "12px";
|
|
332
|
+
readonly transition: "all 150ms cubic-bezier(0.4, 0, 0.2, 1)";
|
|
333
|
+
};
|
|
334
|
+
readonly input: {
|
|
335
|
+
readonly height: "40px";
|
|
336
|
+
readonly paddingX: "12px";
|
|
337
|
+
readonly fontSize: "0.875rem";
|
|
338
|
+
readonly radius: "12px";
|
|
339
|
+
readonly borderWidth: "1px";
|
|
340
|
+
};
|
|
341
|
+
readonly card: {
|
|
342
|
+
readonly padding: {
|
|
343
|
+
readonly sm: "12px";
|
|
344
|
+
readonly md: "16px";
|
|
345
|
+
readonly lg: "24px";
|
|
346
|
+
};
|
|
347
|
+
readonly radius: "16px";
|
|
348
|
+
readonly borderWidth: "1px";
|
|
349
|
+
};
|
|
350
|
+
readonly modal: {
|
|
351
|
+
readonly maxWidth: "560px";
|
|
352
|
+
readonly padding: "24px";
|
|
353
|
+
readonly radius: "24px";
|
|
354
|
+
readonly backdropBlur: "12px";
|
|
355
|
+
};
|
|
356
|
+
readonly panel: {
|
|
357
|
+
readonly width: "400px";
|
|
358
|
+
readonly maxWidth: "90vw";
|
|
359
|
+
readonly radius: "16px";
|
|
360
|
+
readonly backdropBlur: "20px";
|
|
361
|
+
};
|
|
362
|
+
};
|
|
363
|
+
/**
|
|
364
|
+
* Minimum contrast ratios for WCAG 2.1 AA compliance:
|
|
365
|
+
* - Normal text (< 18pt): 4.5:1
|
|
366
|
+
* - Large text (>= 18pt or >= 14pt bold): 3:1
|
|
367
|
+
* - UI components / graphical objects: 3:1
|
|
368
|
+
*/
|
|
369
|
+
export declare const WCAG: {
|
|
370
|
+
readonly minContrastNormalText: 4.5;
|
|
371
|
+
readonly minContrastLargeText: 3;
|
|
372
|
+
readonly minContrastUI: 3;
|
|
373
|
+
readonly focusIndicatorWidth: "2px";
|
|
374
|
+
readonly focusIndicatorOffset: "2px";
|
|
375
|
+
readonly minTouchTarget: "44px";
|
|
376
|
+
};
|
|
377
|
+
//# sourceMappingURL=design-tokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"design-tokens.d.ts","sourceRoot":"","sources":["../src/design-tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAMH,2DAA2D;AAC3D,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCd,CAAC;AAEX,0EAA0E;AAC1E,eAAO,MAAM,eAAe;;;;;;;;;CASlB,CAAC;AAEX,oDAAoD;AACpD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWjB,CAAC;AAMX,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCb,CAAC;AAMX,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;CAiBV,CAAC;AAMX,eAAO,MAAM,MAAM;;;;;;;;CAQT,CAAC;AAMX,eAAO,MAAM,OAAO;IAClB,qBAAqB;;IAErB,wCAAwC;;IAExC,6CAA6C;;IAE7C,uCAAuC;;IAEvC,oDAAoD;;IAEpD,oCAAoC;;IAEpC,mCAAmC;2BACrB,MAAM;CACZ,CAAC;AAMX,eAAO,MAAM,SAAS;;;;;;;;;;QAUlB,+BAA+B;;QAE/B,qCAAqC;;QAErC,oCAAoC;;QAEpC,yBAAyB;;QAEzB,6CAA6C;;;IAG/C,uCAAuC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyB/B,CAAC;AAMX,eAAO,MAAM,WAAW;;;;;;;CAOd,CAAC;AAMX,eAAO,MAAM,OAAO;;;;;;;;;;;;;;CAcV,CAAC;AAMX,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCnB,CAAC;AAMX;;;;;GAKG;AACH,eAAO,MAAM,IAAI;;;;;;;CAOP,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,568 @@
|
|
|
1
|
+
const h = {
|
|
2
|
+
// Surface colors
|
|
3
|
+
background: "--dm-bg",
|
|
4
|
+
backgroundPanel: "--dm-bg-panel",
|
|
5
|
+
backgroundElevated: "--dm-bg-elevated",
|
|
6
|
+
backgroundOverlay: "--dm-bg-overlay",
|
|
7
|
+
// Content colors
|
|
8
|
+
textPrimary: "--dm-text-primary",
|
|
9
|
+
textSecondary: "--dm-text-secondary",
|
|
10
|
+
textTertiary: "--dm-text-tertiary",
|
|
11
|
+
textDisabled: "--dm-text-disabled",
|
|
12
|
+
textInverse: "--dm-text-inverse",
|
|
13
|
+
// Accent / Brand
|
|
14
|
+
accentFrom: "--dm-accent-from",
|
|
15
|
+
accentTo: "--dm-accent-to",
|
|
16
|
+
brandFrom: "--dm-brand-from",
|
|
17
|
+
brandVia: "--dm-brand-via",
|
|
18
|
+
brandTo: "--dm-brand-to",
|
|
19
|
+
// Semantic
|
|
20
|
+
success: "--dm-success",
|
|
21
|
+
warning: "--dm-warning",
|
|
22
|
+
error: "--dm-error",
|
|
23
|
+
info: "--dm-info",
|
|
24
|
+
// Interactive
|
|
25
|
+
hoverBg: "--dm-hover-bg",
|
|
26
|
+
activeBg: "--dm-active-bg",
|
|
27
|
+
focusRing: "--dm-focus-ring",
|
|
28
|
+
selectionBg: "--dm-selection-bg",
|
|
29
|
+
// Borders
|
|
30
|
+
borderDefault: "--dm-border",
|
|
31
|
+
borderSubtle: "--dm-border-subtle",
|
|
32
|
+
borderStrong: "--dm-border-strong"
|
|
33
|
+
}, u = {
|
|
34
|
+
series1: "#8B5CF6",
|
|
35
|
+
// Violet
|
|
36
|
+
series2: "#EC4899",
|
|
37
|
+
// Pink
|
|
38
|
+
series3: "#06B6D4",
|
|
39
|
+
// Cyan
|
|
40
|
+
series4: "#F59E0B",
|
|
41
|
+
// Amber
|
|
42
|
+
series5: "#22C55E",
|
|
43
|
+
// Green
|
|
44
|
+
series6: "#3B82F6",
|
|
45
|
+
// Blue
|
|
46
|
+
series7: "#EF4444",
|
|
47
|
+
// Red
|
|
48
|
+
series8: "#A855F7"
|
|
49
|
+
// Purple
|
|
50
|
+
}, E = {
|
|
51
|
+
happy: { primary: "#FFD700", secondary: "#FFA500", glow: "rgba(255,215,0,0.3)" },
|
|
52
|
+
sad: { primary: "#6495ED", secondary: "#4169E1", glow: "rgba(100,149,237,0.3)" },
|
|
53
|
+
energetic: { primary: "#FF4500", secondary: "#FF1493", glow: "rgba(255,69,0,0.3)" },
|
|
54
|
+
calm: { primary: "#00CED1", secondary: "#7B68EE", glow: "rgba(0,206,209,0.3)" },
|
|
55
|
+
neutral: { primary: "#667EEA", secondary: "#764BA2", glow: "rgba(102,126,234,0.3)" },
|
|
56
|
+
love: { primary: "#FF6B9D", secondary: "#C44569", glow: "rgba(255,107,157,0.3)" },
|
|
57
|
+
nostalgic: { primary: "#DEB887", secondary: "#D2691E", glow: "rgba(222,184,135,0.3)" },
|
|
58
|
+
hopeful: { primary: "#98FB98", secondary: "#00FA9A", glow: "rgba(152,251,152,0.3)" },
|
|
59
|
+
angry: { primary: "#DC143C", secondary: "#8B0000", glow: "rgba(220,20,60,0.3)" },
|
|
60
|
+
romantic: { primary: "#FFB6C1", secondary: "#FF69B4", glow: "rgba(255,182,193,0.3)" }
|
|
61
|
+
}, B = {
|
|
62
|
+
fontFamily: {
|
|
63
|
+
display: "'Space Grotesk', system-ui, -apple-system, sans-serif",
|
|
64
|
+
body: "'Space Grotesk', system-ui, -apple-system, sans-serif",
|
|
65
|
+
mono: "'JetBrains Mono', 'Fira Code', monospace",
|
|
66
|
+
cjk: "'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif"
|
|
67
|
+
},
|
|
68
|
+
fontWeight: {
|
|
69
|
+
light: 300,
|
|
70
|
+
regular: 400,
|
|
71
|
+
medium: 500,
|
|
72
|
+
semibold: 600,
|
|
73
|
+
bold: 700
|
|
74
|
+
},
|
|
75
|
+
fontSize: {
|
|
76
|
+
"2xs": "0.625rem",
|
|
77
|
+
// 10px
|
|
78
|
+
xs: "0.75rem",
|
|
79
|
+
// 12px
|
|
80
|
+
sm: "0.875rem",
|
|
81
|
+
// 14px
|
|
82
|
+
base: "1rem",
|
|
83
|
+
// 16px
|
|
84
|
+
lg: "1.125rem",
|
|
85
|
+
// 18px
|
|
86
|
+
xl: "1.25rem",
|
|
87
|
+
// 20px
|
|
88
|
+
"2xl": "1.5rem",
|
|
89
|
+
// 24px
|
|
90
|
+
"3xl": "1.875rem",
|
|
91
|
+
// 30px
|
|
92
|
+
"4xl": "2.25rem"
|
|
93
|
+
// 36px
|
|
94
|
+
},
|
|
95
|
+
lineHeight: {
|
|
96
|
+
tight: 1.2,
|
|
97
|
+
snug: 1.375,
|
|
98
|
+
normal: 1.5,
|
|
99
|
+
relaxed: 1.625,
|
|
100
|
+
loose: 2
|
|
101
|
+
},
|
|
102
|
+
letterSpacing: {
|
|
103
|
+
tighter: "-0.05em",
|
|
104
|
+
tight: "-0.025em",
|
|
105
|
+
normal: "0em",
|
|
106
|
+
wide: "0.025em",
|
|
107
|
+
wider: "0.05em",
|
|
108
|
+
widest: "0.1em"
|
|
109
|
+
}
|
|
110
|
+
}, D = {
|
|
111
|
+
0: "0px",
|
|
112
|
+
0.5: "2px",
|
|
113
|
+
1: "4px",
|
|
114
|
+
1.5: "6px",
|
|
115
|
+
2: "8px",
|
|
116
|
+
2.5: "10px",
|
|
117
|
+
3: "12px",
|
|
118
|
+
4: "16px",
|
|
119
|
+
5: "20px",
|
|
120
|
+
6: "24px",
|
|
121
|
+
8: "32px",
|
|
122
|
+
10: "40px",
|
|
123
|
+
12: "48px",
|
|
124
|
+
16: "64px",
|
|
125
|
+
20: "80px",
|
|
126
|
+
24: "96px"
|
|
127
|
+
}, o = {
|
|
128
|
+
none: "0px",
|
|
129
|
+
sm: "4px",
|
|
130
|
+
md: "8px",
|
|
131
|
+
lg: "12px",
|
|
132
|
+
xl: "16px",
|
|
133
|
+
"2xl": "24px",
|
|
134
|
+
full: "9999px"
|
|
135
|
+
}, C = {
|
|
136
|
+
/** Level 0 — flat */
|
|
137
|
+
none: "none",
|
|
138
|
+
/** Level 1 — subtle (cards, buttons) */
|
|
139
|
+
sm: "0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2)",
|
|
140
|
+
/** Level 2 — medium (dropdowns, popovers) */
|
|
141
|
+
md: "0 4px 6px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.2)",
|
|
142
|
+
/** Level 3 — high (modals, dialogs) */
|
|
143
|
+
lg: "0 10px 25px rgba(0,0,0,0.4), 0 4px 10px rgba(0,0,0,0.25)",
|
|
144
|
+
/** Level 4 — highest (overlays, floating panels) */
|
|
145
|
+
xl: "0 20px 50px rgba(0,0,0,0.5), 0 8px 20px rgba(0,0,0,0.3)",
|
|
146
|
+
/** Inner shadow (inset elements) */
|
|
147
|
+
inner: "inset 0 2px 4px rgba(0,0,0,0.25)",
|
|
148
|
+
/** Glow effect (accent-colored) */
|
|
149
|
+
glow: (a) => `0 0 20px ${a}40, 0 0 60px ${a}20`
|
|
150
|
+
}, b = {
|
|
151
|
+
duration: {
|
|
152
|
+
instant: "50ms",
|
|
153
|
+
fast: "150ms",
|
|
154
|
+
normal: "250ms",
|
|
155
|
+
slow: "400ms",
|
|
156
|
+
slower: "600ms",
|
|
157
|
+
slowest: "1000ms"
|
|
158
|
+
},
|
|
159
|
+
easing: {
|
|
160
|
+
/** Standard Material easing */
|
|
161
|
+
standard: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
162
|
+
/** Decelerate (entering elements) */
|
|
163
|
+
decelerate: "cubic-bezier(0, 0, 0.2, 1)",
|
|
164
|
+
/** Accelerate (exiting elements) */
|
|
165
|
+
accelerate: "cubic-bezier(0.4, 0, 1, 1)",
|
|
166
|
+
/** Spring-like bounce */
|
|
167
|
+
spring: "cubic-bezier(0.34, 1.56, 0.64, 1)",
|
|
168
|
+
/** Linear (progress bars, infinite loops) */
|
|
169
|
+
linear: "linear"
|
|
170
|
+
},
|
|
171
|
+
/** Motion variants for motion/react */
|
|
172
|
+
variants: {
|
|
173
|
+
fadeIn: { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 } },
|
|
174
|
+
slideUp: {
|
|
175
|
+
initial: { opacity: 0, y: 20 },
|
|
176
|
+
animate: { opacity: 1, y: 0 },
|
|
177
|
+
exit: { opacity: 0, y: 20 }
|
|
178
|
+
},
|
|
179
|
+
slideDown: {
|
|
180
|
+
initial: { opacity: 0, y: -20 },
|
|
181
|
+
animate: { opacity: 1, y: 0 },
|
|
182
|
+
exit: { opacity: 0, y: -20 }
|
|
183
|
+
},
|
|
184
|
+
scaleIn: {
|
|
185
|
+
initial: { opacity: 0, scale: 0.9 },
|
|
186
|
+
animate: { opacity: 1, scale: 1 },
|
|
187
|
+
exit: { opacity: 0, scale: 0.9 }
|
|
188
|
+
},
|
|
189
|
+
panelSlide: {
|
|
190
|
+
initial: { opacity: 0, x: 300 },
|
|
191
|
+
animate: { opacity: 1, x: 0 },
|
|
192
|
+
exit: { opacity: 0, x: 300 },
|
|
193
|
+
transition: { type: "spring", damping: 30, stiffness: 300 }
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}, v = {
|
|
197
|
+
xs: 320,
|
|
198
|
+
// Small phones
|
|
199
|
+
sm: 640,
|
|
200
|
+
// Phones
|
|
201
|
+
md: 768,
|
|
202
|
+
// Tablets
|
|
203
|
+
lg: 1024,
|
|
204
|
+
// Laptops
|
|
205
|
+
xl: 1280,
|
|
206
|
+
// Desktops
|
|
207
|
+
"2xl": 1536
|
|
208
|
+
// Large desktops
|
|
209
|
+
}, w = {
|
|
210
|
+
base: 0,
|
|
211
|
+
starfield: 1,
|
|
212
|
+
content: 10,
|
|
213
|
+
header: 20,
|
|
214
|
+
mobileNav: 30,
|
|
215
|
+
dropdown: 40,
|
|
216
|
+
panel: 50,
|
|
217
|
+
overlay: 60,
|
|
218
|
+
modal: 70,
|
|
219
|
+
toast: 80,
|
|
220
|
+
tooltip: 90,
|
|
221
|
+
perfMonitor: 95,
|
|
222
|
+
maxOverlay: 100
|
|
223
|
+
}, P = {
|
|
224
|
+
button: {
|
|
225
|
+
heightSm: "32px",
|
|
226
|
+
heightMd: "40px",
|
|
227
|
+
heightLg: "48px",
|
|
228
|
+
paddingX: { sm: "12px", md: "16px", lg: "24px" },
|
|
229
|
+
fontSize: { sm: "0.75rem", md: "0.875rem", lg: "1rem" },
|
|
230
|
+
radius: o.lg,
|
|
231
|
+
transition: `all ${b.duration.fast} ${b.easing.standard}`
|
|
232
|
+
},
|
|
233
|
+
input: {
|
|
234
|
+
height: "40px",
|
|
235
|
+
paddingX: "12px",
|
|
236
|
+
fontSize: "0.875rem",
|
|
237
|
+
radius: o.lg,
|
|
238
|
+
borderWidth: "1px"
|
|
239
|
+
},
|
|
240
|
+
card: {
|
|
241
|
+
padding: { sm: "12px", md: "16px", lg: "24px" },
|
|
242
|
+
radius: o.xl,
|
|
243
|
+
borderWidth: "1px"
|
|
244
|
+
},
|
|
245
|
+
modal: {
|
|
246
|
+
maxWidth: "560px",
|
|
247
|
+
padding: "24px",
|
|
248
|
+
radius: o["2xl"],
|
|
249
|
+
backdropBlur: "12px"
|
|
250
|
+
},
|
|
251
|
+
panel: {
|
|
252
|
+
width: "400px",
|
|
253
|
+
maxWidth: "90vw",
|
|
254
|
+
radius: o.xl,
|
|
255
|
+
backdropBlur: "20px"
|
|
256
|
+
}
|
|
257
|
+
}, S = {
|
|
258
|
+
minContrastNormalText: 4.5,
|
|
259
|
+
minContrastLargeText: 3,
|
|
260
|
+
minContrastUI: 3,
|
|
261
|
+
focusIndicatorWidth: "2px",
|
|
262
|
+
focusIndicatorOffset: "2px",
|
|
263
|
+
minTouchTarget: "44px"
|
|
264
|
+
// 44x44px minimum touch target
|
|
265
|
+
}, d = {
|
|
266
|
+
id: "deep-space",
|
|
267
|
+
label: { zh: "深空", en: "Deep Space" },
|
|
268
|
+
description: { zh: "星辰大海,宇宙沉浸", en: "Cosmic immersion" },
|
|
269
|
+
icon: "🌌",
|
|
270
|
+
isDark: !0,
|
|
271
|
+
bg: "#0A0E2F",
|
|
272
|
+
bgPanel: "#0D1235",
|
|
273
|
+
bgElevated: "#111640",
|
|
274
|
+
bgOverlay: "rgba(10,14,47,0.85)",
|
|
275
|
+
textPrimary: "rgba(255,255,255,0.95)",
|
|
276
|
+
textSecondary: "rgba(255,255,255,0.60)",
|
|
277
|
+
textTertiary: "rgba(255,255,255,0.35)",
|
|
278
|
+
textDisabled: "rgba(255,255,255,0.20)",
|
|
279
|
+
textInverse: "#0A0E2F",
|
|
280
|
+
glowRgb: "102,126,234",
|
|
281
|
+
accentFrom: "#8B5CF6",
|
|
282
|
+
accentTo: "#EC4899",
|
|
283
|
+
starRgb: "140,140,255",
|
|
284
|
+
selectionBg: "rgba(236,72,153,0.3)",
|
|
285
|
+
headerFrom: "#0A0E2F",
|
|
286
|
+
headerVia: "rgba(10,14,47,0.8)",
|
|
287
|
+
progressFrom: "#8B5CF6",
|
|
288
|
+
progressTo: "#EC4899",
|
|
289
|
+
brandFrom: "#FCD34D",
|
|
290
|
+
brandVia: "#FDE68A",
|
|
291
|
+
brandTo: "#FBBF24",
|
|
292
|
+
success: "#22C55E",
|
|
293
|
+
warning: "#F59E0B",
|
|
294
|
+
error: "#EF4444",
|
|
295
|
+
info: "#3B82F6",
|
|
296
|
+
hoverBg: "rgba(255,255,255,0.06)",
|
|
297
|
+
activeBg: "rgba(255,255,255,0.10)",
|
|
298
|
+
focusRing: "#8B5CF6",
|
|
299
|
+
border: "rgba(255,255,255,0.10)",
|
|
300
|
+
borderSubtle: "rgba(255,255,255,0.06)",
|
|
301
|
+
borderStrong: "rgba(255,255,255,0.20)",
|
|
302
|
+
shadowSm: "0 1px 3px rgba(0,0,0,0.4)",
|
|
303
|
+
shadowMd: "0 4px 12px rgba(0,0,0,0.5)",
|
|
304
|
+
shadowLg: "0 12px 40px rgba(0,0,0,0.6)"
|
|
305
|
+
}, x = {
|
|
306
|
+
id: "aurora",
|
|
307
|
+
label: { zh: "极光", en: "Aurora" },
|
|
308
|
+
description: { zh: "北极光芒,翠绿交织", en: "Northern lights dance" },
|
|
309
|
+
icon: "🌈",
|
|
310
|
+
isDark: !0,
|
|
311
|
+
bg: "#071A1F",
|
|
312
|
+
bgPanel: "#0A2229",
|
|
313
|
+
bgElevated: "#0E2A32",
|
|
314
|
+
bgOverlay: "rgba(7,26,31,0.85)",
|
|
315
|
+
textPrimary: "rgba(255,255,255,0.95)",
|
|
316
|
+
textSecondary: "rgba(255,255,255,0.60)",
|
|
317
|
+
textTertiary: "rgba(255,255,255,0.35)",
|
|
318
|
+
textDisabled: "rgba(255,255,255,0.20)",
|
|
319
|
+
textInverse: "#071A1F",
|
|
320
|
+
glowRgb: "34,197,94",
|
|
321
|
+
accentFrom: "#22C55E",
|
|
322
|
+
accentTo: "#06B6D4",
|
|
323
|
+
starRgb: "34,197,94",
|
|
324
|
+
selectionBg: "rgba(34,197,94,0.3)",
|
|
325
|
+
headerFrom: "#071A1F",
|
|
326
|
+
headerVia: "rgba(7,26,31,0.8)",
|
|
327
|
+
progressFrom: "#22C55E",
|
|
328
|
+
progressTo: "#06B6D4",
|
|
329
|
+
brandFrom: "#A7F3D0",
|
|
330
|
+
brandVia: "#6EE7B7",
|
|
331
|
+
brandTo: "#34D399",
|
|
332
|
+
success: "#22C55E",
|
|
333
|
+
warning: "#F59E0B",
|
|
334
|
+
error: "#EF4444",
|
|
335
|
+
info: "#06B6D4",
|
|
336
|
+
hoverBg: "rgba(255,255,255,0.06)",
|
|
337
|
+
activeBg: "rgba(255,255,255,0.10)",
|
|
338
|
+
focusRing: "#22C55E",
|
|
339
|
+
border: "rgba(255,255,255,0.10)",
|
|
340
|
+
borderSubtle: "rgba(255,255,255,0.06)",
|
|
341
|
+
borderStrong: "rgba(255,255,255,0.20)",
|
|
342
|
+
shadowSm: "0 1px 3px rgba(0,0,0,0.4)",
|
|
343
|
+
shadowMd: "0 4px 12px rgba(0,0,0,0.5)",
|
|
344
|
+
shadowLg: "0 12px 40px rgba(0,0,0,0.6)"
|
|
345
|
+
}, y = {
|
|
346
|
+
id: "ocean",
|
|
347
|
+
label: { zh: "海洋", en: "Ocean" },
|
|
348
|
+
description: { zh: "深海静谧,蔚蓝沉思", en: "Deep sea serenity" },
|
|
349
|
+
icon: "🌊",
|
|
350
|
+
isDark: !0,
|
|
351
|
+
bg: "#07142B",
|
|
352
|
+
bgPanel: "#0B1C38",
|
|
353
|
+
bgElevated: "#0F2444",
|
|
354
|
+
bgOverlay: "rgba(7,20,43,0.85)",
|
|
355
|
+
textPrimary: "rgba(255,255,255,0.95)",
|
|
356
|
+
textSecondary: "rgba(255,255,255,0.60)",
|
|
357
|
+
textTertiary: "rgba(255,255,255,0.35)",
|
|
358
|
+
textDisabled: "rgba(255,255,255,0.20)",
|
|
359
|
+
textInverse: "#07142B",
|
|
360
|
+
glowRgb: "59,130,246",
|
|
361
|
+
accentFrom: "#3B82F6",
|
|
362
|
+
accentTo: "#14B8A6",
|
|
363
|
+
starRgb: "59,130,246",
|
|
364
|
+
selectionBg: "rgba(59,130,246,0.3)",
|
|
365
|
+
headerFrom: "#07142B",
|
|
366
|
+
headerVia: "rgba(7,20,43,0.8)",
|
|
367
|
+
progressFrom: "#3B82F6",
|
|
368
|
+
progressTo: "#14B8A6",
|
|
369
|
+
brandFrom: "#93C5FD",
|
|
370
|
+
brandVia: "#BFDBFE",
|
|
371
|
+
brandTo: "#60A5FA",
|
|
372
|
+
success: "#22C55E",
|
|
373
|
+
warning: "#F59E0B",
|
|
374
|
+
error: "#EF4444",
|
|
375
|
+
info: "#3B82F6",
|
|
376
|
+
hoverBg: "rgba(255,255,255,0.06)",
|
|
377
|
+
activeBg: "rgba(255,255,255,0.10)",
|
|
378
|
+
focusRing: "#3B82F6",
|
|
379
|
+
border: "rgba(255,255,255,0.10)",
|
|
380
|
+
borderSubtle: "rgba(255,255,255,0.06)",
|
|
381
|
+
borderStrong: "rgba(255,255,255,0.20)",
|
|
382
|
+
shadowSm: "0 1px 3px rgba(0,0,0,0.4)",
|
|
383
|
+
shadowMd: "0 4px 12px rgba(0,0,0,0.5)",
|
|
384
|
+
shadowLg: "0 12px 40px rgba(0,0,0,0.6)"
|
|
385
|
+
}, c = {
|
|
386
|
+
id: "light",
|
|
387
|
+
label: { zh: "晨光", en: "Light" },
|
|
388
|
+
description: { zh: "清透明亮,轻盈雅致", en: "Clean and bright" },
|
|
389
|
+
icon: "☀️",
|
|
390
|
+
isDark: !1,
|
|
391
|
+
bg: "#F8F9FC",
|
|
392
|
+
bgPanel: "#FFFFFF",
|
|
393
|
+
bgElevated: "#FFFFFF",
|
|
394
|
+
bgOverlay: "rgba(0,0,0,0.4)",
|
|
395
|
+
textPrimary: "rgba(0,0,0,0.87)",
|
|
396
|
+
textSecondary: "rgba(0,0,0,0.60)",
|
|
397
|
+
textTertiary: "rgba(0,0,0,0.38)",
|
|
398
|
+
textDisabled: "rgba(0,0,0,0.20)",
|
|
399
|
+
textInverse: "#FFFFFF",
|
|
400
|
+
glowRgb: "99,102,241",
|
|
401
|
+
accentFrom: "#6366F1",
|
|
402
|
+
accentTo: "#EC4899",
|
|
403
|
+
starRgb: "99,102,241",
|
|
404
|
+
selectionBg: "rgba(99,102,241,0.15)",
|
|
405
|
+
headerFrom: "#F8F9FC",
|
|
406
|
+
headerVia: "rgba(248,249,252,0.9)",
|
|
407
|
+
progressFrom: "#6366F1",
|
|
408
|
+
progressTo: "#EC4899",
|
|
409
|
+
brandFrom: "#6366F1",
|
|
410
|
+
brandVia: "#8B5CF6",
|
|
411
|
+
brandTo: "#EC4899",
|
|
412
|
+
success: "#16A34A",
|
|
413
|
+
warning: "#D97706",
|
|
414
|
+
error: "#DC2626",
|
|
415
|
+
info: "#2563EB",
|
|
416
|
+
hoverBg: "rgba(0,0,0,0.04)",
|
|
417
|
+
activeBg: "rgba(0,0,0,0.08)",
|
|
418
|
+
focusRing: "#6366F1",
|
|
419
|
+
border: "rgba(0,0,0,0.12)",
|
|
420
|
+
borderSubtle: "rgba(0,0,0,0.06)",
|
|
421
|
+
borderStrong: "rgba(0,0,0,0.20)",
|
|
422
|
+
shadowSm: "0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04)",
|
|
423
|
+
shadowMd: "0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06)",
|
|
424
|
+
shadowLg: "0 12px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.08)"
|
|
425
|
+
}, F = {
|
|
426
|
+
id: "midnight",
|
|
427
|
+
label: { zh: "暗夜", en: "Midnight" },
|
|
428
|
+
description: { zh: "纯黑质感,极简深色", en: "Pure dark elegance" },
|
|
429
|
+
icon: "🌑",
|
|
430
|
+
isDark: !0,
|
|
431
|
+
bg: "#0C0C0E",
|
|
432
|
+
bgPanel: "#141416",
|
|
433
|
+
bgElevated: "#1C1C1F",
|
|
434
|
+
bgOverlay: "rgba(12,12,14,0.85)",
|
|
435
|
+
textPrimary: "rgba(255,255,255,0.92)",
|
|
436
|
+
textSecondary: "rgba(255,255,255,0.55)",
|
|
437
|
+
textTertiary: "rgba(255,255,255,0.30)",
|
|
438
|
+
textDisabled: "rgba(255,255,255,0.18)",
|
|
439
|
+
textInverse: "#0C0C0E",
|
|
440
|
+
glowRgb: "168,85,247",
|
|
441
|
+
accentFrom: "#A855F7",
|
|
442
|
+
accentTo: "#F472B6",
|
|
443
|
+
starRgb: "168,85,247",
|
|
444
|
+
selectionBg: "rgba(168,85,247,0.3)",
|
|
445
|
+
headerFrom: "#0C0C0E",
|
|
446
|
+
headerVia: "rgba(12,12,14,0.8)",
|
|
447
|
+
progressFrom: "#A855F7",
|
|
448
|
+
progressTo: "#F472B6",
|
|
449
|
+
brandFrom: "#E9D5FF",
|
|
450
|
+
brandVia: "#D8B4FE",
|
|
451
|
+
brandTo: "#C084FC",
|
|
452
|
+
success: "#22C55E",
|
|
453
|
+
warning: "#F59E0B",
|
|
454
|
+
error: "#EF4444",
|
|
455
|
+
info: "#818CF8",
|
|
456
|
+
hoverBg: "rgba(255,255,255,0.05)",
|
|
457
|
+
activeBg: "rgba(255,255,255,0.08)",
|
|
458
|
+
focusRing: "#A855F7",
|
|
459
|
+
border: "rgba(255,255,255,0.08)",
|
|
460
|
+
borderSubtle: "rgba(255,255,255,0.04)",
|
|
461
|
+
borderStrong: "rgba(255,255,255,0.15)",
|
|
462
|
+
shadowSm: "0 1px 3px rgba(0,0,0,0.5)",
|
|
463
|
+
shadowMd: "0 4px 12px rgba(0,0,0,0.6)",
|
|
464
|
+
shadowLg: "0 12px 40px rgba(0,0,0,0.7)"
|
|
465
|
+
}, n = {
|
|
466
|
+
...d,
|
|
467
|
+
id: "custom",
|
|
468
|
+
label: { zh: "自定义", en: "Custom" },
|
|
469
|
+
description: { zh: "打造你的专属风格", en: "Your own style" },
|
|
470
|
+
icon: "🎨"
|
|
471
|
+
}, i = {
|
|
472
|
+
"deep-space": d,
|
|
473
|
+
aurora: x,
|
|
474
|
+
ocean: y,
|
|
475
|
+
light: c,
|
|
476
|
+
midnight: F,
|
|
477
|
+
custom: n
|
|
478
|
+
}, T = ["deep-space", "aurora", "ocean", "light", "midnight", "custom"], m = "dmusic-custom-theme";
|
|
479
|
+
function l() {
|
|
480
|
+
try {
|
|
481
|
+
const a = localStorage.getItem(m);
|
|
482
|
+
return a ? JSON.parse(a) : null;
|
|
483
|
+
} catch {
|
|
484
|
+
return null;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
function A(a) {
|
|
488
|
+
try {
|
|
489
|
+
localStorage.setItem(m, JSON.stringify(a));
|
|
490
|
+
} catch {
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
function p(a) {
|
|
494
|
+
const e = a.isDark ? d : c, r = a.accentFrom.replace("#", ""), t = parseInt(r.substring(0, 2), 16), s = parseInt(r.substring(2, 4), 16), g = parseInt(r.substring(4, 6), 16);
|
|
495
|
+
return {
|
|
496
|
+
...e,
|
|
497
|
+
id: "custom",
|
|
498
|
+
label: n.label,
|
|
499
|
+
description: n.description,
|
|
500
|
+
icon: n.icon,
|
|
501
|
+
isDark: a.isDark,
|
|
502
|
+
bg: a.bg,
|
|
503
|
+
bgPanel: a.bgPanel,
|
|
504
|
+
bgElevated: a.bgPanel,
|
|
505
|
+
bgOverlay: a.isDark ? "rgba(0,0,0,0.85)" : "rgba(0,0,0,0.4)",
|
|
506
|
+
glowRgb: `${t},${s},${g}`,
|
|
507
|
+
accentFrom: a.accentFrom,
|
|
508
|
+
accentTo: a.accentTo,
|
|
509
|
+
progressFrom: a.accentFrom,
|
|
510
|
+
progressTo: a.accentTo,
|
|
511
|
+
focusRing: a.accentFrom,
|
|
512
|
+
selectionBg: `rgba(${t},${s},${g},0.3)`,
|
|
513
|
+
starRgb: `${t},${s},${g}`,
|
|
514
|
+
headerFrom: a.bg,
|
|
515
|
+
headerVia: a.isDark ? "rgba(0,0,0,0.8)" : "rgba(255,255,255,0.9)",
|
|
516
|
+
textPrimary: a.isDark ? "rgba(255,255,255,0.95)" : "rgba(0,0,0,0.87)",
|
|
517
|
+
textSecondary: a.isDark ? "rgba(255,255,255,0.60)" : "rgba(0,0,0,0.60)",
|
|
518
|
+
textTertiary: a.isDark ? "rgba(255,255,255,0.35)" : "rgba(0,0,0,0.38)",
|
|
519
|
+
textDisabled: a.isDark ? "rgba(255,255,255,0.20)" : "rgba(0,0,0,0.20)",
|
|
520
|
+
textInverse: a.isDark ? a.bg : "#FFFFFF",
|
|
521
|
+
hoverBg: a.isDark ? "rgba(255,255,255,0.06)" : "rgba(0,0,0,0.04)",
|
|
522
|
+
activeBg: a.isDark ? "rgba(255,255,255,0.10)" : "rgba(0,0,0,0.08)",
|
|
523
|
+
border: a.isDark ? "rgba(255,255,255,0.10)" : "rgba(0,0,0,0.12)",
|
|
524
|
+
borderSubtle: a.isDark ? "rgba(255,255,255,0.06)" : "rgba(0,0,0,0.06)",
|
|
525
|
+
borderStrong: a.isDark ? "rgba(255,255,255,0.20)" : "rgba(0,0,0,0.20)"
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
function f(a) {
|
|
529
|
+
let e = i[a];
|
|
530
|
+
if (e || (e = i["deep-space"]), a === "custom") {
|
|
531
|
+
const s = l();
|
|
532
|
+
s && (e = p(s));
|
|
533
|
+
}
|
|
534
|
+
const r = document.documentElement;
|
|
535
|
+
r.classList.add("theme-transitioning"), requestAnimationFrame(() => {
|
|
536
|
+
setTimeout(() => r.classList.remove("theme-transitioning"), 350);
|
|
537
|
+
}), r.style.setProperty("--dm-bg", e.bg), r.style.setProperty("--dm-bg-panel", e.bgPanel), r.style.setProperty("--dm-bg-elevated", e.bgElevated), r.style.setProperty("--dm-bg-overlay", e.bgOverlay), r.style.setProperty("--dm-text-primary", e.textPrimary), r.style.setProperty("--dm-text-secondary", e.textSecondary), r.style.setProperty("--dm-text-tertiary", e.textTertiary), r.style.setProperty("--dm-text-disabled", e.textDisabled), r.style.setProperty("--dm-text-inverse", e.textInverse), r.style.setProperty("--dm-glow-rgb", e.glowRgb), r.style.setProperty("--dm-accent-from", e.accentFrom), r.style.setProperty("--dm-accent-to", e.accentTo), r.style.setProperty("--dm-star-rgb", e.starRgb), r.style.setProperty("--dm-selection-bg", e.selectionBg), r.style.setProperty("--dm-header-from", e.headerFrom), r.style.setProperty("--dm-header-via", e.headerVia), r.style.setProperty("--dm-progress-from", e.progressFrom), r.style.setProperty("--dm-progress-to", e.progressTo), r.style.setProperty("--dm-brand-from", e.brandFrom), r.style.setProperty("--dm-brand-via", e.brandVia), r.style.setProperty("--dm-brand-to", e.brandTo), r.style.setProperty("--dm-success", e.success), r.style.setProperty("--dm-warning", e.warning), r.style.setProperty("--dm-error", e.error), r.style.setProperty("--dm-info", e.info), r.style.setProperty("--dm-hover-bg", e.hoverBg), r.style.setProperty("--dm-active-bg", e.activeBg), r.style.setProperty("--dm-focus-ring", e.focusRing), r.style.setProperty("--dm-border", e.border), r.style.setProperty("--dm-border-subtle", e.borderSubtle), r.style.setProperty("--dm-border-strong", e.borderStrong), r.style.setProperty("--dm-shadow-sm", e.shadowSm), r.style.setProperty("--dm-shadow-md", e.shadowMd), r.style.setProperty("--dm-shadow-lg", e.shadowLg), e.isDark ? r.classList.add("dark") : r.classList.remove("dark"), r.setAttribute("data-theme", a);
|
|
538
|
+
const t = document.querySelector('meta[name="theme-color"]');
|
|
539
|
+
t && t.setAttribute("content", e.bg);
|
|
540
|
+
}
|
|
541
|
+
function k(a) {
|
|
542
|
+
if (a === "custom") {
|
|
543
|
+
const e = l();
|
|
544
|
+
if (e) return p(e);
|
|
545
|
+
}
|
|
546
|
+
return i[a] || i["deep-space"];
|
|
547
|
+
}
|
|
548
|
+
export {
|
|
549
|
+
b as ANIMATION,
|
|
550
|
+
v as BREAKPOINTS,
|
|
551
|
+
h as COLOR_ROLES,
|
|
552
|
+
P as COMPONENT_TOKENS,
|
|
553
|
+
u as DATA_VIZ_COLORS,
|
|
554
|
+
E as EMOTION_COLORS,
|
|
555
|
+
o as RADIUS,
|
|
556
|
+
C as SHADOWS,
|
|
557
|
+
D as SPACING,
|
|
558
|
+
i as THEMES,
|
|
559
|
+
T as THEME_IDS,
|
|
560
|
+
B as TYPOGRAPHY,
|
|
561
|
+
S as WCAG,
|
|
562
|
+
w as Z_INDEX,
|
|
563
|
+
f as applyTheme,
|
|
564
|
+
k as getTheme,
|
|
565
|
+
l as loadCustomTheme,
|
|
566
|
+
A as saveCustomTheme
|
|
567
|
+
};
|
|
568
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/design-tokens.ts","../src/themes.ts"],"sourcesContent":["/**\n * D-Music §1.1 — Design Token System\n *\n * Complete design token documentation following Material Design 3.0 principles,\n * adapted for D-Music's deep-space universe aesthetic.\n *\n * Token Categories:\n * 1. Color System (primary, secondary, semantic, data-viz)\n * 2. Typography System (font families, weights, sizes, line-heights)\n * 3. Spacing System (4px base grid)\n * 4. Border Radius System (4/8/12/16/24/full)\n * 5. Shadow/Elevation System (5 levels)\n * 6. Animation System (durations, easings)\n * 7. Breakpoints (responsive)\n * 8. Z-Index System (layering)\n *\n * WCAG 2.1 AA: All color pairings maintain >=4.5:1 contrast ratio for text.\n * 60fps Target: All animations use GPU-accelerated properties (transform, opacity).\n */\n\n// ============================================================\n// 1. Color System\n// ============================================================\n\n/** Semantic color roles mapped to CSS custom properties */\nexport const COLOR_ROLES = {\n // Surface colors\n background: '--dm-bg',\n backgroundPanel: '--dm-bg-panel',\n backgroundElevated: '--dm-bg-elevated',\n backgroundOverlay: '--dm-bg-overlay',\n\n // Content colors\n textPrimary: '--dm-text-primary',\n textSecondary: '--dm-text-secondary',\n textTertiary: '--dm-text-tertiary',\n textDisabled: '--dm-text-disabled',\n textInverse: '--dm-text-inverse',\n\n // Accent / Brand\n accentFrom: '--dm-accent-from',\n accentTo: '--dm-accent-to',\n brandFrom: '--dm-brand-from',\n brandVia: '--dm-brand-via',\n brandTo: '--dm-brand-to',\n\n // Semantic\n success: '--dm-success',\n warning: '--dm-warning',\n error: '--dm-error',\n info: '--dm-info',\n\n // Interactive\n hoverBg: '--dm-hover-bg',\n activeBg: '--dm-active-bg',\n focusRing: '--dm-focus-ring',\n selectionBg: '--dm-selection-bg',\n\n // Borders\n borderDefault: '--dm-border',\n borderSubtle: '--dm-border-subtle',\n borderStrong: '--dm-border-strong',\n} as const;\n\n/** Data visualization color palette — 8 distinct hues for chart series */\nexport const DATA_VIZ_COLORS = {\n series1: '#8B5CF6', // Violet\n series2: '#EC4899', // Pink\n series3: '#06B6D4', // Cyan\n series4: '#F59E0B', // Amber\n series5: '#22C55E', // Green\n series6: '#3B82F6', // Blue\n series7: '#EF4444', // Red\n series8: '#A855F7', // Purple\n} as const;\n\n/** Emotion-mapped colors for audio visualization */\nexport const EMOTION_COLORS = {\n happy: { primary: '#FFD700', secondary: '#FFA500', glow: 'rgba(255,215,0,0.3)' },\n sad: { primary: '#6495ED', secondary: '#4169E1', glow: 'rgba(100,149,237,0.3)' },\n energetic: { primary: '#FF4500', secondary: '#FF1493', glow: 'rgba(255,69,0,0.3)' },\n calm: { primary: '#00CED1', secondary: '#7B68EE', glow: 'rgba(0,206,209,0.3)' },\n neutral: { primary: '#667EEA', secondary: '#764BA2', glow: 'rgba(102,126,234,0.3)' },\n love: { primary: '#FF6B9D', secondary: '#C44569', glow: 'rgba(255,107,157,0.3)' },\n nostalgic: { primary: '#DEB887', secondary: '#D2691E', glow: 'rgba(222,184,135,0.3)' },\n hopeful: { primary: '#98FB98', secondary: '#00FA9A', glow: 'rgba(152,251,152,0.3)' },\n angry: { primary: '#DC143C', secondary: '#8B0000', glow: 'rgba(220,20,60,0.3)' },\n romantic: { primary: '#FFB6C1', secondary: '#FF69B4', glow: 'rgba(255,182,193,0.3)' },\n} as const;\n\n// ============================================================\n// 2. Typography System\n// ============================================================\n\nexport const TYPOGRAPHY = {\n fontFamily: {\n display: \"'Space Grotesk', system-ui, -apple-system, sans-serif\",\n body: \"'Space Grotesk', system-ui, -apple-system, sans-serif\",\n mono: \"'JetBrains Mono', 'Fira Code', monospace\",\n cjk: \"'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif\",\n },\n fontWeight: {\n light: 300,\n regular: 400,\n medium: 500,\n semibold: 600,\n bold: 700,\n },\n fontSize: {\n '2xs': '0.625rem', // 10px\n xs: '0.75rem', // 12px\n sm: '0.875rem', // 14px\n base: '1rem', // 16px\n lg: '1.125rem', // 18px\n xl: '1.25rem', // 20px\n '2xl': '1.5rem', // 24px\n '3xl': '1.875rem', // 30px\n '4xl': '2.25rem', // 36px\n },\n lineHeight: {\n tight: 1.2,\n snug: 1.375,\n normal: 1.5,\n relaxed: 1.625,\n loose: 2,\n },\n letterSpacing: {\n tighter: '-0.05em',\n tight: '-0.025em',\n normal: '0em',\n wide: '0.025em',\n wider: '0.05em',\n widest: '0.1em',\n },\n} as const;\n\n// ============================================================\n// 3. Spacing System (4px base grid)\n// ============================================================\n\nexport const SPACING = {\n 0: '0px',\n 0.5: '2px',\n 1: '4px',\n 1.5: '6px',\n 2: '8px',\n 2.5: '10px',\n 3: '12px',\n 4: '16px',\n 5: '20px',\n 6: '24px',\n 8: '32px',\n 10: '40px',\n 12: '48px',\n 16: '64px',\n 20: '80px',\n 24: '96px',\n} as const;\n\n// ============================================================\n// 4. Border Radius System\n// ============================================================\n\nexport const RADIUS = {\n none: '0px',\n sm: '4px',\n md: '8px',\n lg: '12px',\n xl: '16px',\n '2xl': '24px',\n full: '9999px',\n} as const;\n\n// ============================================================\n// 5. Shadow / Elevation System\n// ============================================================\n\nexport const SHADOWS = {\n /** Level 0 — flat */\n none: 'none',\n /** Level 1 — subtle (cards, buttons) */\n sm: '0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2)',\n /** Level 2 — medium (dropdowns, popovers) */\n md: '0 4px 6px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.2)',\n /** Level 3 — high (modals, dialogs) */\n lg: '0 10px 25px rgba(0,0,0,0.4), 0 4px 10px rgba(0,0,0,0.25)',\n /** Level 4 — highest (overlays, floating panels) */\n xl: '0 20px 50px rgba(0,0,0,0.5), 0 8px 20px rgba(0,0,0,0.3)',\n /** Inner shadow (inset elements) */\n inner: 'inset 0 2px 4px rgba(0,0,0,0.25)',\n /** Glow effect (accent-colored) */\n glow: (color: string) => `0 0 20px ${color}40, 0 0 60px ${color}20`,\n} as const;\n\n// ============================================================\n// 6. Animation System\n// ============================================================\n\nexport const ANIMATION = {\n duration: {\n instant: '50ms',\n fast: '150ms',\n normal: '250ms',\n slow: '400ms',\n slower: '600ms',\n slowest: '1000ms',\n },\n easing: {\n /** Standard Material easing */\n standard: 'cubic-bezier(0.4, 0, 0.2, 1)',\n /** Decelerate (entering elements) */\n decelerate: 'cubic-bezier(0, 0, 0.2, 1)',\n /** Accelerate (exiting elements) */\n accelerate: 'cubic-bezier(0.4, 0, 1, 1)',\n /** Spring-like bounce */\n spring: 'cubic-bezier(0.34, 1.56, 0.64, 1)',\n /** Linear (progress bars, infinite loops) */\n linear: 'linear',\n },\n /** Motion variants for motion/react */\n variants: {\n fadeIn: { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 } },\n slideUp: {\n initial: { opacity: 0, y: 20 },\n animate: { opacity: 1, y: 0 },\n exit: { opacity: 0, y: 20 },\n },\n slideDown: {\n initial: { opacity: 0, y: -20 },\n animate: { opacity: 1, y: 0 },\n exit: { opacity: 0, y: -20 },\n },\n scaleIn: {\n initial: { opacity: 0, scale: 0.9 },\n animate: { opacity: 1, scale: 1 },\n exit: { opacity: 0, scale: 0.9 },\n },\n panelSlide: {\n initial: { opacity: 0, x: 300 },\n animate: { opacity: 1, x: 0 },\n exit: { opacity: 0, x: 300 },\n transition: { type: 'spring', damping: 30, stiffness: 300 },\n },\n },\n} as const;\n\n// ============================================================\n// 7. Breakpoints (responsive)\n// ============================================================\n\nexport const BREAKPOINTS = {\n xs: 320, // Small phones\n sm: 640, // Phones\n md: 768, // Tablets\n lg: 1024, // Laptops\n xl: 1280, // Desktops\n '2xl': 1536, // Large desktops\n} as const;\n\n// ============================================================\n// 8. Z-Index System (strict layering)\n// ============================================================\n\nexport const Z_INDEX = {\n base: 0,\n starfield: 1,\n content: 10,\n header: 20,\n mobileNav: 30,\n dropdown: 40,\n panel: 50,\n overlay: 60,\n modal: 70,\n toast: 80,\n tooltip: 90,\n perfMonitor: 95,\n maxOverlay: 100,\n} as const;\n\n// ============================================================\n// 9. Component Token Presets\n// ============================================================\n\nexport const COMPONENT_TOKENS = {\n button: {\n heightSm: '32px',\n heightMd: '40px',\n heightLg: '48px',\n paddingX: { sm: '12px', md: '16px', lg: '24px' },\n fontSize: { sm: '0.75rem', md: '0.875rem', lg: '1rem' },\n radius: RADIUS.lg,\n transition: `all ${ANIMATION.duration.fast} ${ANIMATION.easing.standard}`,\n },\n input: {\n height: '40px',\n paddingX: '12px',\n fontSize: '0.875rem',\n radius: RADIUS.lg,\n borderWidth: '1px',\n },\n card: {\n padding: { sm: '12px', md: '16px', lg: '24px' },\n radius: RADIUS.xl,\n borderWidth: '1px',\n },\n modal: {\n maxWidth: '560px',\n padding: '24px',\n radius: RADIUS['2xl'],\n backdropBlur: '12px',\n },\n panel: {\n width: '400px',\n maxWidth: '90vw',\n radius: RADIUS.xl,\n backdropBlur: '20px',\n },\n} as const;\n\n// ============================================================\n// 10. WCAG 2.1 AA Contrast Helpers\n// ============================================================\n\n/**\n * Minimum contrast ratios for WCAG 2.1 AA compliance:\n * - Normal text (< 18pt): 4.5:1\n * - Large text (>= 18pt or >= 14pt bold): 3:1\n * - UI components / graphical objects: 3:1\n */\nexport const WCAG = {\n minContrastNormalText: 4.5,\n minContrastLargeText: 3.0,\n minContrastUI: 3.0,\n focusIndicatorWidth: '2px',\n focusIndicatorOffset: '2px',\n minTouchTarget: '44px', // 44x44px minimum touch target\n} as const;\n","/**\n * D-Music §1.4 — Theme System (Complete)\n *\n * 6 immersive themes for D-Music:\n * 1. Deep Space (深空) — default, indigo/purple [星空主题]\n * 2. Aurora (极光) — green/cyan borealis\n * 3. Ocean (海洋) — deep blue/teal\n * 4. Light (晨光) — clean light mode [默认浅色]\n * 5. Midnight (暗夜) — neutral dark [深色主题]\n * 6. Custom (自定义) — user-configurable [用户自定义]\n *\n * Design Token Structure (§1.4):\n * - Color system (primary, secondary, semantic)\n * - Font system (via design-tokens.ts)\n * - Spacing system (4px base)\n * - Border radius (4/8/12/16)\n * - Shadow system (levels 0-4)\n * - Animation system (durations, easings)\n *\n * Themes are applied via CSS custom properties on <html>.\n * Theme transitions use 300ms ease for smooth switching.\n * Pure utility module (no React dependency).\n */\n\nexport type ThemeId = 'deep-space' | 'aurora' | 'ocean' | 'light' | 'midnight' | 'custom';\n\nexport interface ThemeDefinition {\n id: ThemeId;\n label: { zh: string; en: string };\n description: { zh: string; en: string };\n icon: string;\n isDark: boolean;\n\n // ── Surface Colors ──\n /** Main background color */\n bg: string;\n /** Secondary / panel background */\n bgPanel: string;\n /** Elevated surface (cards, popovers) */\n bgElevated: string;\n /** Overlay background (modals backdrop) */\n bgOverlay: string;\n\n // ── Text Colors ──\n textPrimary: string;\n textSecondary: string;\n textTertiary: string;\n textDisabled: string;\n textInverse: string;\n\n // ── Accent & Brand ──\n /** Ambient glow RGB (for radial-gradient overlays) */\n glowRgb: string;\n /** Primary accent gradient (from → to) */\n accentFrom: string;\n accentTo: string;\n /** Starfield base color RGB */\n starRgb: string;\n /** Selection highlight */\n selectionBg: string;\n /** Header gradient stops */\n headerFrom: string;\n headerVia: string;\n /** Progress bar gradient */\n progressFrom: string;\n progressTo: string;\n /** Brand text gradient */\n brandFrom: string;\n brandVia: string;\n brandTo: string;\n\n // ── Semantic Colors ──\n success: string;\n warning: string;\n error: string;\n info: string;\n\n // ── Interactive ──\n hoverBg: string;\n activeBg: string;\n focusRing: string;\n\n // ── Borders ──\n border: string;\n borderSubtle: string;\n borderStrong: string;\n\n // ── Shadows ──\n shadowSm: string;\n shadowMd: string;\n shadowLg: string;\n}\n\n// ============================================================\n// Theme Definitions\n// ============================================================\n\nconst DEEP_SPACE: ThemeDefinition = {\n id: 'deep-space',\n label: { zh: '深空', en: 'Deep Space' },\n description: { zh: '星辰大海,宇宙沉浸', en: 'Cosmic immersion' },\n icon: '🌌',\n isDark: true,\n bg: '#0A0E2F',\n bgPanel: '#0D1235',\n bgElevated: '#111640',\n bgOverlay: 'rgba(10,14,47,0.85)',\n textPrimary: 'rgba(255,255,255,0.95)',\n textSecondary: 'rgba(255,255,255,0.60)',\n textTertiary: 'rgba(255,255,255,0.35)',\n textDisabled: 'rgba(255,255,255,0.20)',\n textInverse: '#0A0E2F',\n glowRgb: '102,126,234',\n accentFrom: '#8B5CF6',\n accentTo: '#EC4899',\n starRgb: '140,140,255',\n selectionBg: 'rgba(236,72,153,0.3)',\n headerFrom: '#0A0E2F',\n headerVia: 'rgba(10,14,47,0.8)',\n progressFrom: '#8B5CF6',\n progressTo: '#EC4899',\n brandFrom: '#FCD34D',\n brandVia: '#FDE68A',\n brandTo: '#FBBF24',\n success: '#22C55E',\n warning: '#F59E0B',\n error: '#EF4444',\n info: '#3B82F6',\n hoverBg: 'rgba(255,255,255,0.06)',\n activeBg: 'rgba(255,255,255,0.10)',\n focusRing: '#8B5CF6',\n border: 'rgba(255,255,255,0.10)',\n borderSubtle: 'rgba(255,255,255,0.06)',\n borderStrong: 'rgba(255,255,255,0.20)',\n shadowSm: '0 1px 3px rgba(0,0,0,0.4)',\n shadowMd: '0 4px 12px rgba(0,0,0,0.5)',\n shadowLg: '0 12px 40px rgba(0,0,0,0.6)',\n};\n\nconst AURORA: ThemeDefinition = {\n id: 'aurora',\n label: { zh: '极光', en: 'Aurora' },\n description: { zh: '北极光芒,翠绿交织', en: 'Northern lights dance' },\n icon: '🌈',\n isDark: true,\n bg: '#071A1F',\n bgPanel: '#0A2229',\n bgElevated: '#0E2A32',\n bgOverlay: 'rgba(7,26,31,0.85)',\n textPrimary: 'rgba(255,255,255,0.95)',\n textSecondary: 'rgba(255,255,255,0.60)',\n textTertiary: 'rgba(255,255,255,0.35)',\n textDisabled: 'rgba(255,255,255,0.20)',\n textInverse: '#071A1F',\n glowRgb: '34,197,94',\n accentFrom: '#22C55E',\n accentTo: '#06B6D4',\n starRgb: '34,197,94',\n selectionBg: 'rgba(34,197,94,0.3)',\n headerFrom: '#071A1F',\n headerVia: 'rgba(7,26,31,0.8)',\n progressFrom: '#22C55E',\n progressTo: '#06B6D4',\n brandFrom: '#A7F3D0',\n brandVia: '#6EE7B7',\n brandTo: '#34D399',\n success: '#22C55E',\n warning: '#F59E0B',\n error: '#EF4444',\n info: '#06B6D4',\n hoverBg: 'rgba(255,255,255,0.06)',\n activeBg: 'rgba(255,255,255,0.10)',\n focusRing: '#22C55E',\n border: 'rgba(255,255,255,0.10)',\n borderSubtle: 'rgba(255,255,255,0.06)',\n borderStrong: 'rgba(255,255,255,0.20)',\n shadowSm: '0 1px 3px rgba(0,0,0,0.4)',\n shadowMd: '0 4px 12px rgba(0,0,0,0.5)',\n shadowLg: '0 12px 40px rgba(0,0,0,0.6)',\n};\n\nconst OCEAN: ThemeDefinition = {\n id: 'ocean',\n label: { zh: '海洋', en: 'Ocean' },\n description: { zh: '深海静谧,蔚蓝沉思', en: 'Deep sea serenity' },\n icon: '🌊',\n isDark: true,\n bg: '#07142B',\n bgPanel: '#0B1C38',\n bgElevated: '#0F2444',\n bgOverlay: 'rgba(7,20,43,0.85)',\n textPrimary: 'rgba(255,255,255,0.95)',\n textSecondary: 'rgba(255,255,255,0.60)',\n textTertiary: 'rgba(255,255,255,0.35)',\n textDisabled: 'rgba(255,255,255,0.20)',\n textInverse: '#07142B',\n glowRgb: '59,130,246',\n accentFrom: '#3B82F6',\n accentTo: '#14B8A6',\n starRgb: '59,130,246',\n selectionBg: 'rgba(59,130,246,0.3)',\n headerFrom: '#07142B',\n headerVia: 'rgba(7,20,43,0.8)',\n progressFrom: '#3B82F6',\n progressTo: '#14B8A6',\n brandFrom: '#93C5FD',\n brandVia: '#BFDBFE',\n brandTo: '#60A5FA',\n success: '#22C55E',\n warning: '#F59E0B',\n error: '#EF4444',\n info: '#3B82F6',\n hoverBg: 'rgba(255,255,255,0.06)',\n activeBg: 'rgba(255,255,255,0.10)',\n focusRing: '#3B82F6',\n border: 'rgba(255,255,255,0.10)',\n borderSubtle: 'rgba(255,255,255,0.06)',\n borderStrong: 'rgba(255,255,255,0.20)',\n shadowSm: '0 1px 3px rgba(0,0,0,0.4)',\n shadowMd: '0 4px 12px rgba(0,0,0,0.5)',\n shadowLg: '0 12px 40px rgba(0,0,0,0.6)',\n};\n\nconst LIGHT: ThemeDefinition = {\n id: 'light',\n label: { zh: '晨光', en: 'Light' },\n description: { zh: '清透明亮,轻盈雅致', en: 'Clean and bright' },\n icon: '☀️',\n isDark: false,\n bg: '#F8F9FC',\n bgPanel: '#FFFFFF',\n bgElevated: '#FFFFFF',\n bgOverlay: 'rgba(0,0,0,0.4)',\n textPrimary: 'rgba(0,0,0,0.87)',\n textSecondary: 'rgba(0,0,0,0.60)',\n textTertiary: 'rgba(0,0,0,0.38)',\n textDisabled: 'rgba(0,0,0,0.20)',\n textInverse: '#FFFFFF',\n glowRgb: '99,102,241',\n accentFrom: '#6366F1',\n accentTo: '#EC4899',\n starRgb: '99,102,241',\n selectionBg: 'rgba(99,102,241,0.15)',\n headerFrom: '#F8F9FC',\n headerVia: 'rgba(248,249,252,0.9)',\n progressFrom: '#6366F1',\n progressTo: '#EC4899',\n brandFrom: '#6366F1',\n brandVia: '#8B5CF6',\n brandTo: '#EC4899',\n success: '#16A34A',\n warning: '#D97706',\n error: '#DC2626',\n info: '#2563EB',\n hoverBg: 'rgba(0,0,0,0.04)',\n activeBg: 'rgba(0,0,0,0.08)',\n focusRing: '#6366F1',\n border: 'rgba(0,0,0,0.12)',\n borderSubtle: 'rgba(0,0,0,0.06)',\n borderStrong: 'rgba(0,0,0,0.20)',\n shadowSm: '0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04)',\n shadowMd: '0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06)',\n shadowLg: '0 12px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.08)',\n};\n\nconst MIDNIGHT: ThemeDefinition = {\n id: 'midnight',\n label: { zh: '暗夜', en: 'Midnight' },\n description: { zh: '纯黑质感,极简深色', en: 'Pure dark elegance' },\n icon: '🌑',\n isDark: true,\n bg: '#0C0C0E',\n bgPanel: '#141416',\n bgElevated: '#1C1C1F',\n bgOverlay: 'rgba(12,12,14,0.85)',\n textPrimary: 'rgba(255,255,255,0.92)',\n textSecondary: 'rgba(255,255,255,0.55)',\n textTertiary: 'rgba(255,255,255,0.30)',\n textDisabled: 'rgba(255,255,255,0.18)',\n textInverse: '#0C0C0E',\n glowRgb: '168,85,247',\n accentFrom: '#A855F7',\n accentTo: '#F472B6',\n starRgb: '168,85,247',\n selectionBg: 'rgba(168,85,247,0.3)',\n headerFrom: '#0C0C0E',\n headerVia: 'rgba(12,12,14,0.8)',\n progressFrom: '#A855F7',\n progressTo: '#F472B6',\n brandFrom: '#E9D5FF',\n brandVia: '#D8B4FE',\n brandTo: '#C084FC',\n success: '#22C55E',\n warning: '#F59E0B',\n error: '#EF4444',\n info: '#818CF8',\n hoverBg: 'rgba(255,255,255,0.05)',\n activeBg: 'rgba(255,255,255,0.08)',\n focusRing: '#A855F7',\n border: 'rgba(255,255,255,0.08)',\n borderSubtle: 'rgba(255,255,255,0.04)',\n borderStrong: 'rgba(255,255,255,0.15)',\n shadowSm: '0 1px 3px rgba(0,0,0,0.5)',\n shadowMd: '0 4px 12px rgba(0,0,0,0.6)',\n shadowLg: '0 12px 40px rgba(0,0,0,0.7)',\n};\n\n/** Default custom theme — user can override */\nconst CUSTOM_DEFAULT: ThemeDefinition = {\n ...DEEP_SPACE,\n id: 'custom',\n label: { zh: '自定义', en: 'Custom' },\n description: { zh: '打造你的专属风格', en: 'Your own style' },\n icon: '🎨',\n};\n\n// ============================================================\n// Exports\n// ============================================================\n\nexport const THEMES: Record<ThemeId, ThemeDefinition> = {\n 'deep-space': DEEP_SPACE,\n aurora: AURORA,\n ocean: OCEAN,\n light: LIGHT,\n midnight: MIDNIGHT,\n custom: CUSTOM_DEFAULT,\n};\n\nexport const THEME_IDS: ThemeId[] = ['deep-space', 'aurora', 'ocean', 'light', 'midnight', 'custom'];\n\n// ============================================================\n// Custom Theme Storage\n// ============================================================\n\nconst CUSTOM_THEME_KEY = 'dmusic-custom-theme';\n\n/** Configurable properties for custom theme */\nexport interface CustomThemeConfig {\n bg: string;\n bgPanel: string;\n accentFrom: string;\n accentTo: string;\n isDark: boolean;\n}\n\nexport function loadCustomTheme(): CustomThemeConfig | null {\n try {\n const raw = localStorage.getItem(CUSTOM_THEME_KEY);\n return raw ? JSON.parse(raw) : null;\n } catch {\n return null;\n }\n}\n\nexport function saveCustomTheme(config: CustomThemeConfig): void {\n try {\n localStorage.setItem(CUSTOM_THEME_KEY, JSON.stringify(config));\n } catch {\n // localStorage unavailable\n }\n}\n\nfunction buildCustomTheme(config: CustomThemeConfig): ThemeDefinition {\n const base = config.isDark ? DEEP_SPACE : LIGHT;\n // Extract RGB from hex for glow\n const hex = config.accentFrom.replace('#', '');\n const r = parseInt(hex.substring(0, 2), 16);\n const g = parseInt(hex.substring(2, 4), 16);\n const b = parseInt(hex.substring(4, 6), 16);\n return {\n ...base,\n id: 'custom',\n label: CUSTOM_DEFAULT.label,\n description: CUSTOM_DEFAULT.description,\n icon: CUSTOM_DEFAULT.icon,\n isDark: config.isDark,\n bg: config.bg,\n bgPanel: config.bgPanel,\n bgElevated: config.bgPanel,\n bgOverlay: config.isDark ? `rgba(0,0,0,0.85)` : `rgba(0,0,0,0.4)`,\n glowRgb: `${r},${g},${b}`,\n accentFrom: config.accentFrom,\n accentTo: config.accentTo,\n progressFrom: config.accentFrom,\n progressTo: config.accentTo,\n focusRing: config.accentFrom,\n selectionBg: `rgba(${r},${g},${b},0.3)`,\n starRgb: `${r},${g},${b}`,\n headerFrom: config.bg,\n headerVia: config.isDark ? `rgba(0,0,0,0.8)` : `rgba(255,255,255,0.9)`,\n textPrimary: config.isDark ? 'rgba(255,255,255,0.95)' : 'rgba(0,0,0,0.87)',\n textSecondary: config.isDark ? 'rgba(255,255,255,0.60)' : 'rgba(0,0,0,0.60)',\n textTertiary: config.isDark ? 'rgba(255,255,255,0.35)' : 'rgba(0,0,0,0.38)',\n textDisabled: config.isDark ? 'rgba(255,255,255,0.20)' : 'rgba(0,0,0,0.20)',\n textInverse: config.isDark ? config.bg : '#FFFFFF',\n hoverBg: config.isDark ? 'rgba(255,255,255,0.06)' : 'rgba(0,0,0,0.04)',\n activeBg: config.isDark ? 'rgba(255,255,255,0.10)' : 'rgba(0,0,0,0.08)',\n border: config.isDark ? 'rgba(255,255,255,0.10)' : 'rgba(0,0,0,0.12)',\n borderSubtle: config.isDark ? 'rgba(255,255,255,0.06)' : 'rgba(0,0,0,0.06)',\n borderStrong: config.isDark ? 'rgba(255,255,255,0.20)' : 'rgba(0,0,0,0.20)',\n };\n}\n\n// ============================================================\n// Theme Application\n// ============================================================\n\n/**\n * Apply a theme by setting CSS custom properties on <html>.\n * Includes transition class for smooth switching (300ms).\n */\nexport function applyTheme(id: ThemeId): void {\n let theme = THEMES[id];\n if (!theme) theme = THEMES['deep-space'];\n\n // For custom theme, merge saved config\n if (id === 'custom') {\n const config = loadCustomTheme();\n if (config) {\n theme = buildCustomTheme(config);\n }\n }\n\n const root = document.documentElement;\n\n // Add transition class for smooth switching\n root.classList.add('theme-transitioning');\n requestAnimationFrame(() => {\n setTimeout(() => root.classList.remove('theme-transitioning'), 350);\n });\n\n // ── Surface ──\n root.style.setProperty('--dm-bg', theme.bg);\n root.style.setProperty('--dm-bg-panel', theme.bgPanel);\n root.style.setProperty('--dm-bg-elevated', theme.bgElevated);\n root.style.setProperty('--dm-bg-overlay', theme.bgOverlay);\n\n // ── Text ──\n root.style.setProperty('--dm-text-primary', theme.textPrimary);\n root.style.setProperty('--dm-text-secondary', theme.textSecondary);\n root.style.setProperty('--dm-text-tertiary', theme.textTertiary);\n root.style.setProperty('--dm-text-disabled', theme.textDisabled);\n root.style.setProperty('--dm-text-inverse', theme.textInverse);\n\n // ── Accent & Brand ──\n root.style.setProperty('--dm-glow-rgb', theme.glowRgb);\n root.style.setProperty('--dm-accent-from', theme.accentFrom);\n root.style.setProperty('--dm-accent-to', theme.accentTo);\n root.style.setProperty('--dm-star-rgb', theme.starRgb);\n root.style.setProperty('--dm-selection-bg', theme.selectionBg);\n root.style.setProperty('--dm-header-from', theme.headerFrom);\n root.style.setProperty('--dm-header-via', theme.headerVia);\n root.style.setProperty('--dm-progress-from', theme.progressFrom);\n root.style.setProperty('--dm-progress-to', theme.progressTo);\n root.style.setProperty('--dm-brand-from', theme.brandFrom);\n root.style.setProperty('--dm-brand-via', theme.brandVia);\n root.style.setProperty('--dm-brand-to', theme.brandTo);\n\n // ── Semantic ──\n root.style.setProperty('--dm-success', theme.success);\n root.style.setProperty('--dm-warning', theme.warning);\n root.style.setProperty('--dm-error', theme.error);\n root.style.setProperty('--dm-info', theme.info);\n\n // ── Interactive ──\n root.style.setProperty('--dm-hover-bg', theme.hoverBg);\n root.style.setProperty('--dm-active-bg', theme.activeBg);\n root.style.setProperty('--dm-focus-ring', theme.focusRing);\n\n // ── Borders ──\n root.style.setProperty('--dm-border', theme.border);\n root.style.setProperty('--dm-border-subtle', theme.borderSubtle);\n root.style.setProperty('--dm-border-strong', theme.borderStrong);\n\n // ── Shadows ──\n root.style.setProperty('--dm-shadow-sm', theme.shadowSm);\n root.style.setProperty('--dm-shadow-md', theme.shadowMd);\n root.style.setProperty('--dm-shadow-lg', theme.shadowLg);\n\n // ── Dark mode class ──\n if (theme.isDark) {\n root.classList.add('dark');\n } else {\n root.classList.remove('dark');\n }\n\n // ── Data attribute for CSS selectors ──\n root.setAttribute('data-theme', id);\n\n // ── PWA theme-color meta ──\n const meta = document.querySelector('meta[name=\"theme-color\"]');\n if (meta) meta.setAttribute('content', theme.bg);\n}\n\n/**\n * Get a theme definition (with custom config applied if 'custom').\n */\nexport function getTheme(id: ThemeId): ThemeDefinition {\n if (id === 'custom') {\n const config = loadCustomTheme();\n if (config) return buildCustomTheme(config);\n }\n return THEMES[id] || THEMES['deep-space'];\n}\n"],"names":["COLOR_ROLES","DATA_VIZ_COLORS","EMOTION_COLORS","TYPOGRAPHY","SPACING","RADIUS","SHADOWS","color","ANIMATION","BREAKPOINTS","Z_INDEX","COMPONENT_TOKENS","WCAG","DEEP_SPACE","AURORA","OCEAN","LIGHT","MIDNIGHT","CUSTOM_DEFAULT","THEMES","THEME_IDS","CUSTOM_THEME_KEY","loadCustomTheme","raw","saveCustomTheme","config","buildCustomTheme","base","hex","r","g","b","applyTheme","id","theme","root","meta","getTheme"],"mappings":"AAyBO,MAAMA,IAAc;AAAA;AAAA,EAEzB,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,oBAAoB;AAAA,EACpB,mBAAmB;AAAA;AAAA,EAGnB,aAAa;AAAA,EACb,eAAe;AAAA,EACf,cAAc;AAAA,EACd,cAAc;AAAA,EACd,aAAa;AAAA;AAAA,EAGb,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,WAAW;AAAA,EACX,UAAU;AAAA,EACV,SAAS;AAAA;AAAA,EAGT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AAAA,EACP,MAAM;AAAA;AAAA,EAGN,SAAS;AAAA,EACT,UAAU;AAAA,EACV,WAAW;AAAA,EACX,aAAa;AAAA;AAAA,EAGb,eAAe;AAAA,EACf,cAAc;AAAA,EACd,cAAc;AAChB,GAGaC,IAAkB;AAAA,EAC7B,SAAS;AAAA;AAAA,EACT,SAAS;AAAA;AAAA,EACT,SAAS;AAAA;AAAA,EACT,SAAS;AAAA;AAAA,EACT,SAAS;AAAA;AAAA,EACT,SAAS;AAAA;AAAA,EACT,SAAS;AAAA;AAAA,EACT,SAAS;AAAA;AACX,GAGaC,IAAiB;AAAA,EAC5B,O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AK,UAAU,IAAI,MAAM,IAEzBA,EAAK,UAAU,OAAO,MAAM,GAI9BA,EAAK,aAAa,cAAcF,CAAE;AAGlC,QAAMG,IAAO,SAAS,cAAc,0BAA0B;AAC9D,EAAIA,KAAMA,EAAK,aAAa,WAAWF,EAAM,EAAE;AACjD;AAKO,SAASG,EAASJ,GAA8B;AACrD,MAAIA,MAAO,UAAU;AACnB,UAAMR,IAASH,EAAA;AACf,QAAIG,EAAQ,QAAOC,EAAiBD,CAAM;AAAA,EAC5C;AACA,SAAON,EAAOc,CAAE,KAAKd,EAAO,YAAY;AAC1C;"}
|
package/dist/themes.d.ts
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* D-Music §1.4 — Theme System (Complete)
|
|
3
|
+
*
|
|
4
|
+
* 6 immersive themes for D-Music:
|
|
5
|
+
* 1. Deep Space (深空) — default, indigo/purple [星空主题]
|
|
6
|
+
* 2. Aurora (极光) — green/cyan borealis
|
|
7
|
+
* 3. Ocean (海洋) — deep blue/teal
|
|
8
|
+
* 4. Light (晨光) — clean light mode [默认浅色]
|
|
9
|
+
* 5. Midnight (暗夜) — neutral dark [深色主题]
|
|
10
|
+
* 6. Custom (自定义) — user-configurable [用户自定义]
|
|
11
|
+
*
|
|
12
|
+
* Design Token Structure (§1.4):
|
|
13
|
+
* - Color system (primary, secondary, semantic)
|
|
14
|
+
* - Font system (via design-tokens.ts)
|
|
15
|
+
* - Spacing system (4px base)
|
|
16
|
+
* - Border radius (4/8/12/16)
|
|
17
|
+
* - Shadow system (levels 0-4)
|
|
18
|
+
* - Animation system (durations, easings)
|
|
19
|
+
*
|
|
20
|
+
* Themes are applied via CSS custom properties on <html>.
|
|
21
|
+
* Theme transitions use 300ms ease for smooth switching.
|
|
22
|
+
* Pure utility module (no React dependency).
|
|
23
|
+
*/
|
|
24
|
+
export type ThemeId = 'deep-space' | 'aurora' | 'ocean' | 'light' | 'midnight' | 'custom';
|
|
25
|
+
export interface ThemeDefinition {
|
|
26
|
+
id: ThemeId;
|
|
27
|
+
label: {
|
|
28
|
+
zh: string;
|
|
29
|
+
en: string;
|
|
30
|
+
};
|
|
31
|
+
description: {
|
|
32
|
+
zh: string;
|
|
33
|
+
en: string;
|
|
34
|
+
};
|
|
35
|
+
icon: string;
|
|
36
|
+
isDark: boolean;
|
|
37
|
+
/** Main background color */
|
|
38
|
+
bg: string;
|
|
39
|
+
/** Secondary / panel background */
|
|
40
|
+
bgPanel: string;
|
|
41
|
+
/** Elevated surface (cards, popovers) */
|
|
42
|
+
bgElevated: string;
|
|
43
|
+
/** Overlay background (modals backdrop) */
|
|
44
|
+
bgOverlay: string;
|
|
45
|
+
textPrimary: string;
|
|
46
|
+
textSecondary: string;
|
|
47
|
+
textTertiary: string;
|
|
48
|
+
textDisabled: string;
|
|
49
|
+
textInverse: string;
|
|
50
|
+
/** Ambient glow RGB (for radial-gradient overlays) */
|
|
51
|
+
glowRgb: string;
|
|
52
|
+
/** Primary accent gradient (from → to) */
|
|
53
|
+
accentFrom: string;
|
|
54
|
+
accentTo: string;
|
|
55
|
+
/** Starfield base color RGB */
|
|
56
|
+
starRgb: string;
|
|
57
|
+
/** Selection highlight */
|
|
58
|
+
selectionBg: string;
|
|
59
|
+
/** Header gradient stops */
|
|
60
|
+
headerFrom: string;
|
|
61
|
+
headerVia: string;
|
|
62
|
+
/** Progress bar gradient */
|
|
63
|
+
progressFrom: string;
|
|
64
|
+
progressTo: string;
|
|
65
|
+
/** Brand text gradient */
|
|
66
|
+
brandFrom: string;
|
|
67
|
+
brandVia: string;
|
|
68
|
+
brandTo: string;
|
|
69
|
+
success: string;
|
|
70
|
+
warning: string;
|
|
71
|
+
error: string;
|
|
72
|
+
info: string;
|
|
73
|
+
hoverBg: string;
|
|
74
|
+
activeBg: string;
|
|
75
|
+
focusRing: string;
|
|
76
|
+
border: string;
|
|
77
|
+
borderSubtle: string;
|
|
78
|
+
borderStrong: string;
|
|
79
|
+
shadowSm: string;
|
|
80
|
+
shadowMd: string;
|
|
81
|
+
shadowLg: string;
|
|
82
|
+
}
|
|
83
|
+
export declare const THEMES: Record<ThemeId, ThemeDefinition>;
|
|
84
|
+
export declare const THEME_IDS: ThemeId[];
|
|
85
|
+
/** Configurable properties for custom theme */
|
|
86
|
+
export interface CustomThemeConfig {
|
|
87
|
+
bg: string;
|
|
88
|
+
bgPanel: string;
|
|
89
|
+
accentFrom: string;
|
|
90
|
+
accentTo: string;
|
|
91
|
+
isDark: boolean;
|
|
92
|
+
}
|
|
93
|
+
export declare function loadCustomTheme(): CustomThemeConfig | null;
|
|
94
|
+
export declare function saveCustomTheme(config: CustomThemeConfig): void;
|
|
95
|
+
/**
|
|
96
|
+
* Apply a theme by setting CSS custom properties on <html>.
|
|
97
|
+
* Includes transition class for smooth switching (300ms).
|
|
98
|
+
*/
|
|
99
|
+
export declare function applyTheme(id: ThemeId): void;
|
|
100
|
+
/**
|
|
101
|
+
* Get a theme definition (with custom config applied if 'custom').
|
|
102
|
+
*/
|
|
103
|
+
export declare function getTheme(id: ThemeId): ThemeDefinition;
|
|
104
|
+
//# sourceMappingURL=themes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../src/themes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,MAAM,MAAM,OAAO,GAAG,YAAY,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,CAAC;AAE1F,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,OAAO,CAAC;IACZ,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IAClC,WAAW,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,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,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE,eAAe,CAOnD,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,OAAO,EAAqE,CAAC;AAQrG,+CAA+C;AAC/C,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,wBAAgB,eAAe,IAAI,iBAAiB,GAAG,IAAI,CAO1D;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAM/D;AA+CD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,OAAO,GAAG,IAAI,CAiF5C;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,EAAE,EAAE,OAAO,GAAG,eAAe,CAMrD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yyc3/music-design-tokens",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "YYC³ D-Music 设计 Token — 六主题体系与主题应用引擎",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@types/react": "^19.3.0",
|
|
16
|
+
"typescript": "^5.9.3"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
21
|
+
"keywords": [
|
|
22
|
+
"yyc3",
|
|
23
|
+
"musai",
|
|
24
|
+
"music",
|
|
25
|
+
"design-tokens",
|
|
26
|
+
"theme"
|
|
27
|
+
],
|
|
28
|
+
"author": "YYC³ Team <admin@0379.email>",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"sideEffects": false,
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "git+https://github.com/YYC-Cube/YYC3-MusAI.git",
|
|
34
|
+
"directory": "packages/music-design-tokens"
|
|
35
|
+
},
|
|
36
|
+
"homepage": "https://musai.yyc3.vip",
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/YYC-Cube/YYC3-MusAI/issues"
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "vite build && tsc -p tsconfig.build.json",
|
|
42
|
+
"typecheck": "tsc --noEmit",
|
|
43
|
+
"lint": "eslint src"
|
|
44
|
+
}
|
|
6
45
|
}
|