da-style 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +278 -0
  3. package/dist/da-style.css +2 -0
  4. package/dist/da-style.js +2 -0
  5. package/dist/da-style.mjs +704 -0
  6. package/dist/src/components/Button/DButton.types.d.ts +23 -0
  7. package/dist/src/components/Button/DButton.vue.d.ts +29 -0
  8. package/dist/src/components/Button/index.d.ts +4 -0
  9. package/dist/src/components/Icon/DIcon.types.d.ts +12 -0
  10. package/dist/src/components/Icon/DIcon.vue.d.ts +8 -0
  11. package/dist/src/components/Icon/icons.d.ts +2 -0
  12. package/dist/src/components/Icon/index.d.ts +5 -0
  13. package/dist/src/components/Input/DInput.types.d.ts +17 -0
  14. package/dist/src/components/Input/DInput.vue.d.ts +45 -0
  15. package/dist/src/components/Input/index.d.ts +9 -0
  16. package/dist/src/components/Loading/DLoading.types.d.ts +14 -0
  17. package/dist/src/components/Loading/DLoading.vue.d.ts +10 -0
  18. package/dist/src/components/Loading/index.d.ts +8 -0
  19. package/dist/src/components/Tag/DTag.types.d.ts +22 -0
  20. package/dist/src/components/Tag/DTag.vue.d.ts +25 -0
  21. package/dist/src/components/Tag/index.d.ts +9 -0
  22. package/dist/src/components/index.d.ts +5 -0
  23. package/dist/src/index.d.ts +4 -0
  24. package/dist/src/shared/index.d.ts +3 -0
  25. package/dist/src/shared/props.d.ts +24 -0
  26. package/dist/src/shared/types.d.ts +15 -0
  27. package/dist/src/shared/utils.d.ts +7 -0
  28. package/dist/src/token/borders.d.ts +41 -0
  29. package/dist/src/token/colors.d.ts +84 -0
  30. package/dist/src/token/index.d.ts +20 -0
  31. package/dist/src/token/inject.d.ts +24 -0
  32. package/dist/src/token/shadows.d.ts +43 -0
  33. package/dist/src/token/spacing.d.ts +58 -0
  34. package/dist/src/token/typography.d.ts +86 -0
  35. package/package.json +30 -36
  36. package/skills/da-style/SKILL.md +83 -0
  37. package/skills/da-style/references/components.md +113 -0
  38. package/skills/da-style/references/tokens.md +78 -0
  39. package/lib/da-style.common.js +0 -2011
  40. package/lib/da-style.common.js.map +0 -1
  41. package/lib/da-style.css +0 -1
  42. package/lib/da-style.umd.js +0 -2021
  43. package/lib/da-style.umd.js.map +0 -1
  44. package/lib/da-style.umd.min.js +0 -2
  45. package/lib/da-style.umd.min.js.map +0 -1
  46. package/lib/demo.html +0 -10
@@ -0,0 +1,86 @@
1
+ /**
2
+ * da-style Typography System
3
+ *
4
+ * Cyberpunk-informed type scale: monospace primary for that
5
+ * hacker/terminal feel, system-ui for headings where readability
6
+ * at large sizes matters.
7
+ */
8
+ export declare const fontMono = "'Courier New', 'Consolas', 'Source Code Pro', monospace";
9
+ export declare const fontSans = "system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif";
10
+ export declare const fontHeading = "system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif";
11
+ export declare const fontBody = "'Courier New', Consolas, monospace";
12
+ export declare const textXs = "12px";
13
+ export declare const textSm = "14px";
14
+ export declare const textBase = "16px";
15
+ export declare const textLg = "18px";
16
+ export declare const textXl = "20px";
17
+ export declare const text2xl = "24px";
18
+ export declare const text3xl = "30px";
19
+ export declare const weightRegular = "400";
20
+ export declare const weightMedium = "500";
21
+ export declare const weightSemibold = "600";
22
+ export declare const weightBold = "700";
23
+ export declare const leadingTight = "1.2";
24
+ export declare const leadingNormal = "1.5";
25
+ export declare const leadingRelaxed = "1.75";
26
+ export declare const trackingTight = "-0.02em";
27
+ export declare const trackingNormal = "0";
28
+ export declare const trackingWide = "0.08em";
29
+ export declare const cssVars: {
30
+ readonly font: {
31
+ readonly mono: "--d-font-mono";
32
+ readonly sans: "--d-font-sans";
33
+ readonly heading: "--d-font-heading";
34
+ readonly body: "--d-font-body";
35
+ };
36
+ readonly size: {
37
+ readonly xs: "--d-text-xs";
38
+ readonly sm: "--d-text-sm";
39
+ readonly base: "--d-text-base";
40
+ readonly lg: "--d-text-lg";
41
+ readonly xl: "--d-text-xl";
42
+ readonly '2xl': "--d-text-2xl";
43
+ readonly '3xl': "--d-text-3xl";
44
+ };
45
+ readonly weight: {
46
+ readonly regular: "--d-weight-regular";
47
+ readonly medium: "--d-weight-medium";
48
+ readonly semibold: "--d-weight-semibold";
49
+ readonly bold: "--d-weight-bold";
50
+ };
51
+ readonly leading: {
52
+ readonly tight: "--d-leading-tight";
53
+ readonly normal: "--d-leading-normal";
54
+ readonly relaxed: "--d-leading-relaxed";
55
+ };
56
+ readonly tracking: {
57
+ readonly tight: "--d-tracking-tight";
58
+ readonly normal: "--d-tracking-normal";
59
+ readonly wide: "--d-tracking-wide";
60
+ };
61
+ };
62
+ export interface TypographyTokens {
63
+ fontMono: string;
64
+ fontSans: string;
65
+ fontHeading: string;
66
+ fontBody: string;
67
+ textXs: string;
68
+ textSm: string;
69
+ textBase: string;
70
+ textLg: string;
71
+ textXl: string;
72
+ text2xl: string;
73
+ text3xl: string;
74
+ weightRegular: string;
75
+ weightMedium: string;
76
+ weightSemibold: string;
77
+ weightBold: string;
78
+ leadingTight: string;
79
+ leadingNormal: string;
80
+ leadingRelaxed: string;
81
+ trackingTight: string;
82
+ trackingNormal: string;
83
+ trackingWide: string;
84
+ }
85
+ /** All typography tokens as a flat object */
86
+ export declare const typography: TypographyTokens;
package/package.json CHANGED
@@ -1,45 +1,39 @@
1
1
  {
2
2
  "name": "da-style",
3
- "version": "0.1.1",
4
- "main": "lib/da-style.common.js",
5
- "author": "da9527",
3
+ "version": "0.1.3",
4
+ "description": "赛博朋克风格 Vue3 组件库",
5
+ "type": "module",
6
6
  "private": false,
7
+ "license": "MIT",
8
+ "author": "da",
7
9
  "scripts": {
8
- "serve": "vue-cli-service serve",
9
- "build": "vue-cli-service build",
10
- "lib": "vue-cli-service build --target lib --name da-style --dest lib packages/index.js",
11
- "lint": "vue-cli-service lint"
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"
12
19
  },
20
+ "files": [
21
+ "dist",
22
+ "skills",
23
+ "README.md"
24
+ ],
13
25
  "dependencies": {
14
- "core-js": "^3.6.5",
15
- "vue": "^3.0.0"
26
+ "vue": "^3.5.38"
16
27
  },
17
28
  "devDependencies": {
18
- "@vue/cli-plugin-babel": "~4.5.0",
19
- "@vue/cli-plugin-eslint": "~4.5.0",
20
- "@vue/cli-service": "~4.5.0",
21
- "@vue/compiler-sfc": "^3.0.0",
22
- "babel-eslint": "^10.1.0",
23
- "eslint": "^6.7.2",
24
- "eslint-plugin-vue": "^7.0.0"
25
- },
26
- "eslintConfig": {
27
- "root": true,
28
- "env": {
29
- "node": true
30
- },
31
- "extends": [
32
- "plugin:vue/vue3-essential",
33
- "eslint:recommended"
34
- ],
35
- "parserOptions": {
36
- "parser": "babel-eslint"
37
- },
38
- "rules": {}
39
- },
40
- "browserslist": [
41
- "> 1%",
42
- "last 2 versions",
43
- "not dead"
44
- ]
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
+ }
45
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);`