da-style 0.1.2 → 0.1.4
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/README.md +53 -0
- package/package.json +39 -38
- package/skills/da-style/SKILL.md +83 -0
- package/skills/da-style/references/components.md +113 -0
- package/skills/da-style/references/tokens.md +78 -0
package/README.md
CHANGED
|
@@ -202,6 +202,59 @@ import {
|
|
|
202
202
|
}
|
|
203
203
|
```
|
|
204
204
|
|
|
205
|
+
## AI Agent Skill
|
|
206
|
+
|
|
207
|
+
da-style 内置了 AI Agent Skill,随 npm 包一起发布。安装 da-style 后,你的 AI 编程助手(如 Claude Code、Cursor 等)可以直接加载 Skill,获得完整的组件 API、设计令牌和使用示例,从而更准确地生成代码。
|
|
208
|
+
|
|
209
|
+
### Skill 文件位置
|
|
210
|
+
|
|
211
|
+
安装 da-style 后,Skill 文件位于 `node_modules/da-style/skills/da-style/` 目录下:
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
node_modules/da-style/skills/da-style/
|
|
215
|
+
├── SKILL.md # Skill 主文件(触发条件 + 快速参考)
|
|
216
|
+
└── references/
|
|
217
|
+
├── components.md # 完整组件 API 文档
|
|
218
|
+
└── tokens.md # 设计令牌完整列表
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### 方式一:通过 skills add 从 npm 安装(推荐)
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
npx skills add da-style
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
直接从 npm 包安装 Skill(前提是包根目录下存在 `skills/` 目录且包含有效 Skill)。
|
|
228
|
+
|
|
229
|
+
### 方式二:随包扫描安装
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
npx library-skills
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
此命令会自动扫描 `node_modules/*/skills/` 下所有合法的 Skill。注意:pnpm 用户可能需要使用方式一或方式三,因为 pnpm 的目录结构与此扫描路径不兼容。
|
|
236
|
+
|
|
237
|
+
### 方式三:手动复制
|
|
238
|
+
|
|
239
|
+
将 `node_modules/da-style/skills/da-style` 整个文件夹复制到当前项目的 AI 代理配置目录:
|
|
240
|
+
|
|
241
|
+
| AI 代理 | 目标目录 |
|
|
242
|
+
|---------|----------|
|
|
243
|
+
| Cursor | `.cursor/skills/` |
|
|
244
|
+
| Claude Code | `.claude/skills/` |
|
|
245
|
+
| 通用标准 | `.agents/skills/` |
|
|
246
|
+
|
|
247
|
+
安装完成后,在对话框中输入 `@da-style` 或触发词,AI 即可加载该 Skill。
|
|
248
|
+
|
|
249
|
+
### Skill 能力
|
|
250
|
+
|
|
251
|
+
Agent 加载 Skill 后可以:
|
|
252
|
+
|
|
253
|
+
- **准确生成组件代码**:自动使用正确的 props、事件和插槽
|
|
254
|
+
- **遵循设计规范**:使用 cyberpunk 风格的颜色、字体和边框
|
|
255
|
+
- **正确使用 Design Tokens**:引用 `--d-*` CSS 变量或 JS token 导出
|
|
256
|
+
- **避免常见错误**:如错误的 import 路径、缺少 CSS 文件引入等
|
|
257
|
+
|
|
205
258
|
## 文档
|
|
206
259
|
|
|
207
260
|
启动文档开发服务器:
|
package/package.json
CHANGED
|
@@ -1,38 +1,39 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "da-style",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "赛博朋克风格 Vue3 组件库",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"private": false,
|
|
7
|
-
"license": "MIT",
|
|
8
|
-
"author": "da",
|
|
9
|
-
"scripts": {
|
|
10
|
-
"dev": "vite",
|
|
11
|
-
"build": "vue-tsc --noEmit && vite build",
|
|
12
|
-
"preview": "vite preview",
|
|
13
|
-
"docs:dev": "vitepress dev docs",
|
|
14
|
-
"docs:build": "vitepress build docs",
|
|
15
|
-
"test": "vitest",
|
|
16
|
-
"test:run": "vitest run",
|
|
17
|
-
"test:watch": "vitest",
|
|
18
|
-
"typecheck": "vue-tsc --noEmit"
|
|
19
|
-
},
|
|
20
|
-
"files": [
|
|
21
|
-
"dist",
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"@
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"vite
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "da-style",
|
|
3
|
+
"version": "0.1.4",
|
|
4
|
+
"description": "赛博朋克风格 Vue3 组件库",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"private": false,
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"author": "da",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"dev": "vite",
|
|
11
|
+
"build": "vue-tsc --noEmit && vite build",
|
|
12
|
+
"preview": "vite preview",
|
|
13
|
+
"docs:dev": "vitepress dev docs",
|
|
14
|
+
"docs:build": "vitepress build docs",
|
|
15
|
+
"test": "vitest",
|
|
16
|
+
"test:run": "vitest run",
|
|
17
|
+
"test:watch": "vitest",
|
|
18
|
+
"typecheck": "vue-tsc --noEmit"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"skills",
|
|
23
|
+
"README.md"
|
|
24
|
+
],
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"vue": "^3.5.38"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@vitejs/plugin-vue": "^6.0.7",
|
|
30
|
+
"@vue/test-utils": "^2.4.11",
|
|
31
|
+
"jsdom": "^29.1.1",
|
|
32
|
+
"typescript": "^6.0.3",
|
|
33
|
+
"vite": "^8.0.16",
|
|
34
|
+
"vite-plugin-dts": "^5.0.2",
|
|
35
|
+
"vitepress": "^1.6.4",
|
|
36
|
+
"vitest": "^4.1.9",
|
|
37
|
+
"vue-tsc": "^3.3.5"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: da-style
|
|
3
|
+
description: >
|
|
4
|
+
Cyberpunk-styled Vue 3 component library with neon glow effects, geometric clipped borders,
|
|
5
|
+
and deep black backgrounds. Use when user needs to install, configure, or use da-style
|
|
6
|
+
components (DButton, DInput, DTag, DLoading, DIcon) in a Vue 3 project. Triggers on
|
|
7
|
+
"da-style", "cyberpunk components", "赛博朋克组件", or requests for neon/glow UI elements.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# da-style Component Library
|
|
11
|
+
|
|
12
|
+
Cyberpunk Vue 3 component library. Deep black backgrounds (#0a0a0f), neon cyan (#00f0ff) / magenta (#ff00c8) accents, geometric clipped borders, multi-layer glow shadows.
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install da-style
|
|
18
|
+
# or
|
|
19
|
+
pnpm add da-style
|
|
20
|
+
# or
|
|
21
|
+
yarn add da-style
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Setup
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
// main.js
|
|
28
|
+
import { createApp } from 'vue'
|
|
29
|
+
import App from './App.vue'
|
|
30
|
+
import DaStyle from 'da-style'
|
|
31
|
+
import 'da-style/dist/da-style.css'
|
|
32
|
+
|
|
33
|
+
createApp(App).use(DaStyle).mount('#app')
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Or import individual components:
|
|
37
|
+
|
|
38
|
+
```vue
|
|
39
|
+
<script setup>
|
|
40
|
+
import { DButton, DInput } from 'da-style'
|
|
41
|
+
import 'da-style/dist/da-style.css'
|
|
42
|
+
</script>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Components
|
|
46
|
+
|
|
47
|
+
5 components: **DButton**, **DInput**, **DTag**, **DLoading**, **DIcon**.
|
|
48
|
+
|
|
49
|
+
For full API details, read `references/components.md`.
|
|
50
|
+
|
|
51
|
+
Quick usage:
|
|
52
|
+
|
|
53
|
+
```vue
|
|
54
|
+
<DButton status="primary" glow>Click Me</DButton>
|
|
55
|
+
<DInput placeholder="Enter text" clearable glow />
|
|
56
|
+
<DTag status="success" closable>Active</DTag>
|
|
57
|
+
<DLoading type="dots" text="Loading..." />
|
|
58
|
+
<DIcon name="check" spin />
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Design Tokens
|
|
62
|
+
|
|
63
|
+
CSS variables are available globally (on `:root`). Use them directly:
|
|
64
|
+
|
|
65
|
+
```css
|
|
66
|
+
.my-box {
|
|
67
|
+
background: var(--d-bg-secondary);
|
|
68
|
+
border: 1px solid var(--d-cyan);
|
|
69
|
+
box-shadow: var(--d-glow-cyan);
|
|
70
|
+
color: var(--d-text-primary);
|
|
71
|
+
font-family: var(--d-font-mono);
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
For full token list, read `references/tokens.md`.
|
|
76
|
+
|
|
77
|
+
## Key Design Principles
|
|
78
|
+
|
|
79
|
+
- **No rounded corners** — use `clip-path` for geometric cuts
|
|
80
|
+
- **Neon glow** — multi-layer `box-shadow` on interactive elements
|
|
81
|
+
- **Scanline overlay** — `repeating-linear-gradient` pseudo-elements
|
|
82
|
+
- **Monospace typography** — JetBrains Mono / Rajdhani fonts
|
|
83
|
+
- **Status colors**: primary=cyan, success=green, warning=yellow, danger=red, info=purple
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# da-style Components API
|
|
2
|
+
|
|
3
|
+
## DButton
|
|
4
|
+
|
|
5
|
+
Cyberpunk button with neon glow and geometric clipped borders.
|
|
6
|
+
|
|
7
|
+
```vue
|
|
8
|
+
<DButton status="primary" size="medium" glow>Button</DButton>
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
|------|------|---------|-------------|
|
|
13
|
+
| status | `'primary' \| 'success' \| 'warning' \| 'danger' \| 'info'` | `'primary'` | Color variant |
|
|
14
|
+
| size | `'small' \| 'medium' \| 'large'` | `'medium'` | Button size |
|
|
15
|
+
| disabled | `boolean` | `false` | Disabled state |
|
|
16
|
+
| loading | `boolean` | `false` | Loading spinner |
|
|
17
|
+
| glow | `boolean` | `false` | Neon glow effect |
|
|
18
|
+
| ghost | `boolean` | `false` | Transparent background |
|
|
19
|
+
| block | `boolean` | `false` | Full width |
|
|
20
|
+
| round | `boolean` | `false` | Rounded corners |
|
|
21
|
+
| circle | `boolean` | `false` | Circle shape |
|
|
22
|
+
|
|
23
|
+
| Event | Description |
|
|
24
|
+
|-------|-------------|
|
|
25
|
+
| click | Emitted on click (not when disabled/loading) |
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## DInput
|
|
30
|
+
|
|
31
|
+
Input with scanline overlay and focus glow.
|
|
32
|
+
|
|
33
|
+
```vue
|
|
34
|
+
<DInput v-model="text" placeholder="Enter..." clearable glow />
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
| Prop | Type | Default | Description |
|
|
38
|
+
|------|------|---------|-------------|
|
|
39
|
+
| modelValue | `string` | `''` | Bound value (v-model) |
|
|
40
|
+
| type | `'text' \| 'password' \| 'email' \| 'number' \| 'tel' \| 'url' \| 'search'` | `'text'` | Input type |
|
|
41
|
+
| size | `'small' \| 'medium' \| 'large'` | `'medium'` | Input size |
|
|
42
|
+
| disabled | `boolean` | `false` | Disabled state |
|
|
43
|
+
| readonly | `boolean` | `false` | Read-only state |
|
|
44
|
+
| placeholder | `string` | `''` | Placeholder text |
|
|
45
|
+
| clearable | `boolean` | `false` | Show clear button |
|
|
46
|
+
| glow | `boolean` | `false` | Focus glow effect |
|
|
47
|
+
| prefix | `string` | — | Prefix text |
|
|
48
|
+
| suffix | `string` | — | Suffix text |
|
|
49
|
+
|
|
50
|
+
| Slot | Description |
|
|
51
|
+
|------|-------------|
|
|
52
|
+
| prefix | Custom prefix content |
|
|
53
|
+
| suffix | Custom suffix content |
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## DTag
|
|
58
|
+
|
|
59
|
+
Tag with neon border and optional glow.
|
|
60
|
+
|
|
61
|
+
```vue
|
|
62
|
+
<DTag status="success" closable glow>Active</DTag>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
| Prop | Type | Default | Description |
|
|
66
|
+
|------|------|---------|-------------|
|
|
67
|
+
| status | `'primary' \| 'success' \| 'warning' \| 'danger' \| 'info'` | `'primary'` | Color variant |
|
|
68
|
+
| size | `'small' \| 'medium' \| 'large'` | `'medium'` | Tag size |
|
|
69
|
+
| closable | `boolean` | `false` | Show close button |
|
|
70
|
+
| ghost | `boolean` | `false` | Transparent background |
|
|
71
|
+
| glow | `boolean` | `false` | Neon glow effect |
|
|
72
|
+
| round | `boolean` | `false` | Rounded corners |
|
|
73
|
+
|
|
74
|
+
| Event | Description |
|
|
75
|
+
|-------|-------------|
|
|
76
|
+
| close | Emitted when close button clicked |
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## DLoading
|
|
81
|
+
|
|
82
|
+
Loading indicator with spinner, dots, or pulse animations.
|
|
83
|
+
|
|
84
|
+
```vue
|
|
85
|
+
<DLoading type="spinner" text="Loading..." />
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
| Prop | Type | Default | Description |
|
|
89
|
+
|------|------|---------|-------------|
|
|
90
|
+
| type | `'spinner' \| 'dots' \| 'pulse'` | `'spinner'` | Animation type |
|
|
91
|
+
| size | `'small' \| 'medium' \| 'large'` | `'medium'` | Loader size |
|
|
92
|
+
| color | `string` | — | Custom color |
|
|
93
|
+
| text | `string` | — | Loading text |
|
|
94
|
+
| fullscreen | `boolean` | `false` | Fullscreen overlay |
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## DIcon
|
|
99
|
+
|
|
100
|
+
SVG icon with neon glow.
|
|
101
|
+
|
|
102
|
+
```vue
|
|
103
|
+
<DIcon name="check" size="large" color="#00f0ff" spin />
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
| Prop | Type | Default | Description |
|
|
107
|
+
|------|------|---------|-------------|
|
|
108
|
+
| name | `IconName` | — | Icon name (required) |
|
|
109
|
+
| size | `'small' \| 'medium' \| 'large' \| number` | `'medium'` | Icon size |
|
|
110
|
+
| color | `string` | — | Stroke color |
|
|
111
|
+
| spin | `boolean` | `false` | Rotation animation |
|
|
112
|
+
|
|
113
|
+
Available icons: `close`, `check`, `chevron-left`, `chevron-right`, `chevron-down`, `chevron-up`, `loading`, `search`, `info`, `warning`, `error`, `success`, `eye`, `eye-off`
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# da-style Design Tokens
|
|
2
|
+
|
|
3
|
+
All tokens are CSS custom properties defined on `:root`. Use directly in CSS.
|
|
4
|
+
|
|
5
|
+
## Colors
|
|
6
|
+
|
|
7
|
+
| Variable | Value | Usage |
|
|
8
|
+
|----------|-------|-------|
|
|
9
|
+
| `--d-bg-primary` | `#0a0a0f` | Main background |
|
|
10
|
+
| `--d-bg-secondary` | `#12121a` | Card/surface background |
|
|
11
|
+
| `--d-bg-elevated` | `#1a1a2e` | Elevated surface |
|
|
12
|
+
| `--d-bg-overlay` | `rgba(0,0,0,0.85)` | Modal overlay |
|
|
13
|
+
| `--d-text-primary` | `#e0e0ff` | Main text |
|
|
14
|
+
| `--d-text-secondary` | `#8888aa` | Muted text |
|
|
15
|
+
| `--d-text-disabled` | `#444466` | Disabled text |
|
|
16
|
+
| `--d-text-inverse` | `#0a0a0f` | Text on light bg |
|
|
17
|
+
|
|
18
|
+
## Neon Accents
|
|
19
|
+
|
|
20
|
+
| Variable | Value |
|
|
21
|
+
|----------|-------|
|
|
22
|
+
| `--d-cyan` | `#00f0ff` |
|
|
23
|
+
| `--d-magenta` | `#ff00c8` |
|
|
24
|
+
| `--d-purple` | `#7000ff` |
|
|
25
|
+
| `--d-blue` | `#0066ff` |
|
|
26
|
+
| `--d-yellow` | `#ffea00` |
|
|
27
|
+
| `--d-green` | `#00ff41` |
|
|
28
|
+
| `--d-orange` | `#ff6600` |
|
|
29
|
+
| `--d-red` | `#ff003c` |
|
|
30
|
+
|
|
31
|
+
RGB variants available: `--d-cyan-rgb`, `--d-magenta-rgb`, etc. for use with `rgba()`.
|
|
32
|
+
|
|
33
|
+
## Semantic Colors
|
|
34
|
+
|
|
35
|
+
| Variable | Maps to |
|
|
36
|
+
|----------|---------|
|
|
37
|
+
| `--d-color-primary` | `var(--d-cyan)` |
|
|
38
|
+
| `--d-color-success` | `var(--d-green)` |
|
|
39
|
+
| `--d-color-warning` | `var(--d-yellow)` |
|
|
40
|
+
| `--d-color-danger` | `var(--d-red)` |
|
|
41
|
+
| `--d-color-info` | `var(--d-purple)` |
|
|
42
|
+
|
|
43
|
+
## Spacing
|
|
44
|
+
|
|
45
|
+
`--d-spacing-1` (4px) through `--d-spacing-12` (48px), plus `--d-container-sm/md/lg/xl`.
|
|
46
|
+
|
|
47
|
+
## Typography
|
|
48
|
+
|
|
49
|
+
| Variable | Default |
|
|
50
|
+
|----------|---------|
|
|
51
|
+
| `--d-font-mono` | JetBrains Mono, Fira Code, monospace |
|
|
52
|
+
| `--d-font-sans` | Rajdhani, Exo 2, system-ui |
|
|
53
|
+
| `--d-font-heading` | Rajdhani, Exo 2, system-ui |
|
|
54
|
+
| `--d-font-body` | JetBrains Mono, Fira Code, monospace |
|
|
55
|
+
|
|
56
|
+
Sizes: `--d-text-xs` (11px) through `--d-text-3xl` (32px).
|
|
57
|
+
|
|
58
|
+
## Shadows & Glow
|
|
59
|
+
|
|
60
|
+
| Variable | Description |
|
|
61
|
+
|----------|-------------|
|
|
62
|
+
| `--d-glow-cyan` | Multi-layer cyan neon glow |
|
|
63
|
+
| `--d-glow-magenta` | Multi-layer magenta neon glow |
|
|
64
|
+
| `--d-glow-purple` | Multi-layer purple neon glow |
|
|
65
|
+
| `--d-glow-green` | Multi-layer green neon glow |
|
|
66
|
+
| `--d-glow-yellow` | Multi-layer yellow neon glow |
|
|
67
|
+
| `--d-glow-red` | Multi-layer red neon glow |
|
|
68
|
+
| `--d-shadow-sm/md/lg` | Standard elevation shadows |
|
|
69
|
+
|
|
70
|
+
## Clip Paths
|
|
71
|
+
|
|
72
|
+
| Variable | Description |
|
|
73
|
+
|----------|-------------|
|
|
74
|
+
| `--d-clip-cut-sm` | 8px geometric cut |
|
|
75
|
+
| `--d-clip-cut-md` | 12px geometric cut |
|
|
76
|
+
| `--d-clip-cut-lg` | 16px geometric cut |
|
|
77
|
+
|
|
78
|
+
Usage: `clip-path: var(--d-clip-cut-sm);`
|