@yyc3/music-design-tokens 1.0.0 → 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 +69 -0
- package/package.json +16 -4
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
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# @yyc3/music-design-tokens
|
|
2
|
+
|
|
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>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yyc3/music-design-tokens",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "YYC³ D-Music 设计 Token — 六主题体系与主题应用引擎",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -12,22 +12,34 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@types/react": "^
|
|
16
|
-
"typescript": "^5.9.
|
|
15
|
+
"@types/react": "^19.3.0",
|
|
16
|
+
"typescript": "^5.9.3"
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
19
|
"dist"
|
|
20
20
|
],
|
|
21
21
|
"keywords": [
|
|
22
22
|
"yyc3",
|
|
23
|
+
"musai",
|
|
23
24
|
"music",
|
|
24
25
|
"design-tokens",
|
|
25
26
|
"theme"
|
|
26
27
|
],
|
|
27
28
|
"author": "YYC³ Team <admin@0379.email>",
|
|
28
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
|
+
},
|
|
29
40
|
"scripts": {
|
|
30
41
|
"build": "vite build && tsc -p tsconfig.build.json",
|
|
31
|
-
"typecheck": "tsc --noEmit"
|
|
42
|
+
"typecheck": "tsc --noEmit",
|
|
43
|
+
"lint": "eslint src"
|
|
32
44
|
}
|
|
33
45
|
}
|