asharyu-design-token 2.0.5 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,135 +1,224 @@
1
- # Asharyu-design-token
2
-
3
- > 디자인 토큰
4
-
5
- ## Install
6
-
7
- 1.npm
8
-
9
- ```
10
- npm i asharyu-design-token
11
- ```
12
-
13
- 2.yarn
14
-
15
- ```
16
- yarn add asharyu-design-token
17
- ```
18
-
19
- ## Usage
20
-
21
- 1. css
22
-
23
- ```js
24
- import 'normalize.css';
25
- import 'asharyu-design-token/index.css';
26
- ```
27
-
28
- 2.js(ts)
29
-
30
- ```js
31
- import Token from 'asharyu-design-token';
32
- ```
33
-
34
- ## Concept
35
-
36
- **asharyu**는 동양 철학인 음양오행설을 현대적인 인터페이스 가이드라인에 투영한 디자인 시스템입니다. 디자인 감각에만 의존하지 않고, 요소 간의 상생(相生)과 상극(相剋) 관계를 통해 논리적이고 의미론적인(Semantic) UI 구성을 지향합니다.
37
-
38
- - **음양 (Yin-Yang):** 명암의 대비를 통해 라이트/다크 테마의 질서와 반전을 정의합니다.
39
- - **오행 (Five Elements):** 목(Action), 화(Danger), 토(Surface), 금(Border), 수(Info)의 기운으로 기능적 위계를 구분합니다.
40
- - **필치와 검의 예리함:** 수묵의 번짐(Bleed)과 날카로운 필압(Stroke Weight)을 인터랙션과 스타일의 핵심 요소로 삼습니다.
41
-
42
- ### 오행의 기능적 역할 (Functional Roles)
43
-
44
- | 오행 (Element) | 시맨틱 역할 | 주요 용도 | 기운의 성질 |
45
- | :--- | :--- | :--- | :--- |
46
- | **목 (Wood)** | `Action` | 주 버튼(Primary), 시작, 긍정 상태 | 솟구치는 시작 |
47
- | **화 (Fire)** | `Danger` | 경고, 오류, 삭제, 중요 알림 | 확산되는 경고 |
48
- | **토 (Earth)** | `Surface` | 카드, 컨테이너 배경, 머무르는 공간 | 머무르는 안정 |
49
- | **금 (Metal)** | `Border` | 보조 버튼(Confirm), 경계선, 결단 | 응축된 결단 |
50
- | **수 (Water)** | `Info` | 정보 전달, 네비게이션, 탐색 | 흐르는 정보 |
51
-
52
- 이러한 시맨틱 정의를 통해 개발자와 디자이너는 색상 선택 시 주관적인 감각 대신 시스템의 논리(상생/상극)에 따라 의사결정을 내릴 수 있습니다.
53
-
54
- ### 상생과 상극의 인터랙션 (Interaction Guide)
55
-
56
- 디자인 시스템의 동적인 기운(Motion)은 오행의 순환 논리인 상생과 상극에 기반합니다.
57
-
58
- | 분류 (Category) | 기운 (Ki-Un) | 인터랙션 성격 | 권장 사용 사례 |
59
- | :--- | :--- | :--- | :--- |
60
- | **상생 (Sangsaeng)** | `Gentle` | 부드럽고 유연한 연결 | 긍정적인 여정, 일반적인 상태 변화, 페이지 전환 |
61
- | **상극 (Sanggeuk)** | `Sharp / Spread` | 예리한 대비와 제어 | 경고, 오류, 중요 알림, 삭제 시의 긴장감 표현 |
62
-
63
- - **상생 Flow (`flow.sangSaeng`):** 물이 나무를 자라게 하듯 자연스러운 흐름을 표현할 때 사용하며, 사용자 경험의 연속성을 확보합니다.
64
- - **상극 Feedback (`feedback.sangGeuk...`):** 화기가 금속을 녹이듯 강한 시각적 제어가 필요할 때 사용합니다. 예리한 필압의 결단(`decisive`) 혹은 충돌하여 널리 퍼지는 경고(`spread`)로 구분됩니다.
65
-
66
- 이러한 인터랙션 원칙은 단순한 애니메이션을 넘어, 인터페이스 내의 기운의 흐름과 긴장을 조절하는 핵심 장치입니다.
67
-
68
- ### 인터랙션 토큰 사용 예제 (Usage Examples)
69
-
70
- **1. 순수 CSS에서 사용**
71
-
72
- ```css
73
- /* 예: 버튼 호버 시 상생 흐름 애니메이션 적용 */
74
- .my-button {
75
- transition: var(--asharyu-interaction-flow-sang-saeng);
76
- /* 다른 스타일 */
77
- }
78
-
79
- /* 예: 경고 메시지 등장 시 상극 확산 애니메이션 적용 */
80
- .alert-message {
81
- animation: fade-in-spread 0.8s var(--asharyu-interaction-feedback-sang-geuk-spread);
82
- /* 다른 스타일 */
83
- }
84
-
85
- @keyframes fade-in-spread {
86
- from { opacity: 0; transform: scale(0.9); }
87
- to { opacity: 1; transform: scale(1); }
88
- }
89
- ```
90
-
91
- **2. Emotion (React)에서 사용**
92
-
93
- ```tsx
94
- import styled from '@emotion/styled';
95
- import { tokens } from 'asharyu-design-token'; // JS 브릿지 토큰 임포트
96
-
97
- const AnimatedButton = styled.button`
98
- transition: ${tokens.interaction.flow.sangSaeng};
99
- background-color: ${tokens.color.semantic.action.primary};
100
- color: ${tokens.color.semantic.background};
101
- /* 다른 스타일 */
102
- `;
103
- ```
104
- ## Token Structure
105
-
106
- 모든 토큰은 `--asharyu-` 접두사를 가지며, **Raw(원형)**와 **Semantic(의미)** 계층으로 나뉩니다.
107
-
108
- ### 1. Naming Convention (Sword's Edge)
109
- 모든 키값은 CamelCase에서 Kebab-case로 자동 변환되어 생성됩니다.
110
- 예: `yinText` (JS) -> `--asharyu-color-semantic-yin-text` (CSS)
111
-
112
- ### 2. Semantic Layers
113
- 테마 전환 시 시맨틱 토큰의 값은 자동으로 상응하는 음/양의 값으로 교체됩니다.
114
-
115
- ```css
116
- :root {
117
- /* 🎨 Color: Raw & Semantic */
118
- --asharyu-color-raw-wood-2: #7BA2BE;
119
- --asharyu-color-semantic-action-primary: var(--asharyu-color-raw-wood-2);
120
- --asharyu-color-semantic-background: #fdfaf4;
121
- --asharyu-color-semantic-text: #0c0c0c;
122
-
123
- /* ✍️ Typography */
124
- --asharyu-font-semantic-h1: 4.25rem;
125
- --asharyu-font-semantic-body1: 1rem;
126
-
127
- /* 🌬️ Motion & Stroke */
128
- --asharyu-motion-duration-bleed: 0.8s;
129
- --asharyu-stroke-weight-heavy: 3px;
130
- }
131
- ```
132
-
133
- ## License
134
-
135
- This project is licensed under the [Apache 2.0 License](/LICENSE).
1
+ # asharyu-design-token
2
+
3
+ <div align="center">
4
+
5
+ **A Design Token System Inspired by Yin-Yang, Wu Xing, and Korean Traditional Ink & Wash Aesthetics.**
6
+ *음양오행(陰陽五行)과 수묵·담채화의 미학을 담은 디자인 토큰 시스템*
7
+
8
+ [English](README.md) | [한국어](README.ko.md) | [繁體中文](README.zh-TW.md) | [日本語](README.ja.md)
9
+
10
+ [![npm version](https://img.shields.io/npm/v/asharyu-design-token.svg?style=flat-square&color=7BA2BE)](https://www.npmjs.com/package/asharyu-design-token)
11
+ [![license](https://img.shields.io/npm/l/asharyu-design-token.svg?style=flat-square&color=3E6586)](https://github.com/yoonjonglyu/asharyu-design/blob/main/LICENSE)
12
+ [![WCAG 2.1 AAA](https://img.shields.io/badge/WCAG%202.1-AAA%20(18.5:1)-success?style=flat-square&color=ACC4A6)](https://www.w3.org/WAI/WCAG21/quickref/)
13
+ [![Figma DTCG](https://img.shields.io/badge/Figma-W3C%20DTCG%20%2F%20Tokens%20Studio-blue?style=flat-square&color=8AA1B2)](https://tokens.studio/)
14
+
15
+ </div>
16
+
17
+ ---
18
+
19
+ ## 📖 Table of Contents
20
+ 1. [Installation](#1-installation)
21
+ 2. [Quick Start](#2-quick-start)
22
+ 3. [Design Philosophy](#3-design-philosophy)
23
+ 4. [Token Specifications & CSS Variables](#4-token-specifications--css-variables)
24
+ 5. [🎨 Figma Integration](#5--figma-integration)
25
+ 6. [🤖 AI Agent Integration](#6--ai-agent-integration)
26
+ 7. [Accessibility & Testing](#7-accessibility--testing)
27
+ 8. [License](#8-license)
28
+
29
+ ---
30
+
31
+ ## 1. Installation
32
+
33
+ ```bash
34
+ # npm
35
+ npm install asharyu-design-token
36
+
37
+ # pnpm
38
+ pnpm add asharyu-design-token
39
+
40
+ # yarn
41
+ yarn add asharyu-design-token
42
+ ```
43
+
44
+ ---
45
+
46
+ ## 2. Quick Start
47
+
48
+ ### 1) Load Global CSS Variables
49
+ Import the compiled stylesheet at your application's entry point (`index.tsx`, `App.tsx`, or main CSS):
50
+
51
+ ```tsx
52
+ import 'asharyu-design-token/index.css';
53
+ ```
54
+
55
+ ### 2) Use with CSS-in-JS (Emotion / Styled-Components)
56
+ Import the typed `tokens` bridge object for full TypeScript autocompletion and CSS variable references:
57
+
58
+ ```tsx
59
+ import styled from '@emotion/styled';
60
+ import { tokens } from 'asharyu-design-token';
61
+
62
+ const AsharyuCard = styled.div`
63
+ background-color: ${tokens.color.semantic.surface.primary};
64
+ border: ${tokens.stroke.weight.sharp} solid ${tokens.color.semantic.stroke};
65
+ border-radius: ${tokens.radius.gentle};
66
+ padding: ${tokens.spacing.void};
67
+ box-shadow: ${tokens.elevation.damMuk};
68
+ transition: ${tokens.interaction.flow.sangSaeng};
69
+
70
+ &:hover {
71
+ border-width: ${tokens.stroke.weight.fine};
72
+ box-shadow: ${tokens.elevation.jungMuk};
73
+ transform: translateY(-2px);
74
+ }
75
+ `;
76
+ ```
77
+
78
+ ### 3) Yin-Yang (Light / Dark) Theme Switching
79
+ Switch themes instantaneously via the `data-theme` attribute:
80
+
81
+ ```html
82
+ <!-- Light Mode (Yang 陽) : Default -->
83
+ <html data-theme="light"> ... </html>
84
+
85
+ <!-- Dark Mode (Yin 陰) -->
86
+ <html data-theme="dark"> ... </html>
87
+ ```
88
+
89
+ ---
90
+
91
+ ## 3. Design Philosophy
92
+
93
+ **asharyu** translates Eastern cosmological principles—**Yin-Yang (陰陽)**, **Wu Xing (五行, Five Elements)**, and the ink gradation of **Sumuk-damchae (수묵·담채화)**—into a rigorous, logic-driven digital design system.
94
+
95
+ 1. **Sharpness (예리함 / 묵선)**: Precise, razor-sharp 0.5px ink strokes (`--asharyu-stroke-weight-sharp`) define clear information boundaries.
96
+ 2. **Void (여백 / 한지의 숨구멍)**: Breathing room (`--asharyu-spacing-void`) reflects the aesthetic of Hanji paper, avoiding cramped layouts.
97
+ 3. **Nong-dam Elevation (농담의 깊이)**: Replaces artificial shadows with the natural depth of ink diffusion (Dam-muk, Jung-muk, Nong-muk).
98
+ 4. **Ki-un Motion (기운생동)**: Animations are choreographed according to Sang-saeng (相生, harmonic flow) and Sang-geuk (相剋, decisive feedback).
99
+
100
+ ---
101
+
102
+ ## 4. Token Specifications & CSS Variables
103
+
104
+ ### ① Color Tokens
105
+
106
+ #### Wu Xing (五行) — Primary Action & Surface
107
+ | Element | Semantic Role | Usage | CSS Variable |
108
+ |---|---|---|---|
109
+ | **Yang / Yin (Theme)** | Background & Text | Hanji white / Deep abyssal ink | `--asharyu-color-semantic-background`, `-text` |
110
+ | **Wood (木, 목)** | `Action` | Primary action, buttons, links | `--asharyu-color-semantic-action-primary` |
111
+ | **Fire (火, 화)** | `Danger` | Danger, alert, destructive actions | `--asharyu-color-semantic-danger-primary` |
112
+ | **Earth (土, 토)** | `Surface` | Cards, container surfaces, resting areas | `--asharyu-color-semantic-surface-primary` |
113
+ | **Metal (金, 금)** | `Border` | Borders, dividers, structured edges | `--asharyu-color-semantic-border-primary` |
114
+ | **Water (水, 수)** | `Info` | Navigation, auxiliary information, flow | `--asharyu-color-semantic-info-primary` |
115
+
116
+ #### Five Intermediate Colors (五間色, 오간색) — Secondary Status & Feedback
117
+ | Color | Semantic Role | Formulation | CSS Variable |
118
+ |---|---|---|---|
119
+ | **Nok (綠, 녹)** | `Success` | Wood + Earth | `--asharyu-color-semantic-status-success-primary` |
120
+ | **Hong (紅, 홍)** | `Alert-Hover` | Fire + Metal | `--asharyu-color-semantic-status-alert-hover-primary` |
121
+ | **Byeok (碧, 벽)** | `Focus` | Wood + Metal | `--asharyu-color-semantic-status-action-focus-primary` |
122
+ | **Yu (硫黃, 유황)** | `Warning / Sub-Surface` | Earth + Water | `--asharyu-color-semantic-status-sub-surface-primary` |
123
+ | **Ja (紫, 자)** | `Special / Active` | Fire + Water | `--asharyu-color-semantic-status-info-active-primary` |
124
+
125
+ ---
126
+
127
+ ### ② Spacing & Void
128
+
129
+ | Key | CSS Variable | Rem | Px | Concept & Usage |
130
+ |---|---|---|---|---|
131
+ | `compact` | `--asharyu-spacing-compact` | `0.25rem` | 4px | Instant: icon spacing, tag padding |
132
+ | `fine` | `--asharyu-spacing-fine` | `0.5rem` | 8px | Fine: inline element spacing |
133
+ | `moderate` | `--asharyu-spacing-moderate` | `0.75rem` | 12px | Near: form controls & list items |
134
+ | `base` | `--asharyu-spacing-base` | `1rem` | 16px | Regular: standard card padding |
135
+ | `void` | `--asharyu-spacing-void` | `1.5rem` | 24px | **Void: breathing space (standard component margin)** |
136
+ | `wide` | `--asharyu-spacing-wide` | `2rem` | 32px | Distant: section inner grouping |
137
+ | `spacious` | `--asharyu-spacing-spacious` | `3rem` | 48px | Spacious: inter-section gap |
138
+ | `vast` | `--asharyu-spacing-vast` | `4rem` | 64px | Vast: page-level margins |
139
+
140
+ ---
141
+
142
+ ### ③ Radius (Curvature)
143
+
144
+ - `--asharyu-radius-sharp`: `0px` (Sword's edge, crisp orthogonal corners)
145
+ - `--asharyu-radius-delicate`: `0.25rem` (4px, understated curves for tags)
146
+ - `--asharyu-radius-gentle`: `0.5rem` (8px, warm organic curvature for cards)
147
+ - `--asharyu-radius-smooth`: `0.75rem` (12px, flowing curves for dialogs)
148
+ - `--asharyu-radius-prominent`: `1rem` (16px, large surface rounding)
149
+ - `--asharyu-radius-full`: `9999px` (Taegeuk, circular avatars & pills)
150
+
151
+ ---
152
+
153
+ ### ④ Nong-dam Elevation & Shadows
154
+
155
+ Depth tokens that dynamically respond to Yin-Yang (Light/Dark) themes via ink diffusion:
156
+ - `--asharyu-elevation-none`: Flat surface
157
+ - `--asharyu-elevation-dam-muk`: **Dam-muk (淡墨, Light Ink)** — card hover, dropdowns
158
+ - `--asharyu-elevation-jung-muk`: **Jung-muk (中墨, Medium Ink)** — popovers, floating boards
159
+ - `--asharyu-elevation-nong-muk`: **Nong-muk (濃墨, Dark Ink)** — modal dialogs
160
+ - `--asharyu-elevation-guk-muk`: **Guk-muk (極墨, Deepest Ink)** — floating toasts & critical alerts
161
+
162
+ ---
163
+
164
+ ### ⑤ Typography
165
+
166
+ - **Families**:
167
+ - `--asharyu-font-family-serif`: Lyrical Hanji 바탕/명조 (`Gowun Batang`, `Noto Serif KR`)
168
+ - `--asharyu-font-family-sans`: Modern readable sans-serif (`Pretendard`, system-ui)
169
+ - `--asharyu-font-family-mono`: Monospace for code & numbers (`JetBrains Mono`, monospace)
170
+ - **Weights**:
171
+ - `--asharyu-font-weight-light` (300 / Dam), `--asharyu-font-weight-regular` (400 / Sang), `--asharyu-font-weight-semibold` (600 / Nong), `--asharyu-font-weight-bold` (700 / Pil)
172
+ - **Line Heights**:
173
+ - `--asharyu-font-line-height-tight` (1.25), `--asharyu-font-line-height-normal` (1.5), `--asharyu-font-line-height-relaxed` (1.75)
174
+
175
+ ---
176
+
177
+ ## 5. 🎨 Figma Integration
178
+
179
+ `asharyu-design-token` automatically generates and exports design token files ready for Figma:
180
+
181
+ ### Method A: Tokens Studio for Figma (Recommended)
182
+ 1. Open the **Tokens Studio for Figma** plugin in Figma.
183
+ 2. Under `Settings` > `Sync Providers`, select **GitHub** or choose **Load from local file**.
184
+ 3. Select **`node_modules/asharyu-design-token/dist/tokens.json`**.
185
+ 4. The `global`, `light`, and `dark` token sets will be loaded with colors, spacing, radius, typography, and shadows fully synchronized.
186
+
187
+ ### Method B: Native Figma Variables
188
+ 1. Use **`node_modules/asharyu-design-token/dist/figma-variables.json`**.
189
+ 2. Import via Figma Variables REST API or a variable import plugin to create `Color (Raw)`, `Color (Semantic)` (with Light/Dark modes), and `Spacing & Radius` collections.
190
+
191
+ ---
192
+
193
+ ## 6. 🤖 AI Agent Integration
194
+
195
+ When pair-programming with AI agents (**Google Antigravity**, **Cursor**, **Claude Code**, **GitHub Copilot**), you can guide the model to follow the Asharyu design system:
196
+
197
+ ### 1) Antigravity Skill & Rule Integration
198
+ You can copy the included agent skill and rule files to your project's `.agents/` folder or reference them directly:
199
+ - **Portable Skill Bundle**: `node_modules/asharyu-design-token/asharyu-design-system.skill` (IDE skill import)
200
+ - **Agent Skill Directory**: `node_modules/asharyu-design-token/skills/asharyu-design-system/`
201
+ - **Agent Rule**: `node_modules/asharyu-design-token/rules/asharyu-design-system.md`
202
+
203
+ ### 2) Direct Prompt Guide & References
204
+ - Main Skill: `node_modules/asharyu-design-token/SKILL.md`
205
+ - Token Reference: `node_modules/asharyu-design-token/references/tokens.md`
206
+ - Component Templates: `node_modules/asharyu-design-token/references/components.md`
207
+
208
+ ---
209
+
210
+ ## 7. Accessibility & Testing
211
+
212
+ - **WCAG 2.1 AAA Compliant**:
213
+ - Light mode text-on-background contrast: **18.52 : 1** (far exceeds the 7.0:1 AAA standard)
214
+ - Dark mode text-on-background contrast: **18.52 : 1** (far exceeds the 7.0:1 AAA standard)
215
+ - **Interactive Boundaries & Focus**:
216
+ - State lines (`action.sharp`, `danger.sharp`) meet WCAG 2.1 AA (≥ 4.5:1).
217
+ - **Automated Validation Suite**:
218
+ - `pnpm test` verifies token integrity, CSS variable parity, and WCAG contrast ratios with 100% test coverage.
219
+
220
+ ---
221
+
222
+ ## 8. License
223
+
224
+ This project is licensed under the [Apache 2.0 License](https://github.com/yoonjonglyu/asharyu-design/blob/main/LICENSE).
@@ -0,0 +1,222 @@
1
+ # asharyu-design-token
2
+
3
+ <div align="center">
4
+
5
+ **融合陰陽五行與水墨·淡彩畫美學的設計權杖(Design Token)系統**
6
+ *A Design Token System Inspired by Yin-Yang, Wu Xing, and Korean Traditional Ink & Wash Aesthetics.*
7
+
8
+ [English](README.md) | [한국어](README.ko.md) | [繁體中文](README.zh-TW.md) | [日本語](README.ja.md)
9
+
10
+ [![npm version](https://img.shields.io/npm/v/asharyu-design-token.svg?style=flat-square&color=7BA2BE)](https://www.npmjs.com/package/asharyu-design-token)
11
+ [![license](https://img.shields.io/npm/l/asharyu-design-token.svg?style=flat-square&color=3E6586)](https://github.com/yoonjonglyu/asharyu-design/blob/main/LICENSE)
12
+ [![WCAG 2.1 AAA](https://img.shields.io/badge/WCAG%202.1-AAA%20(18.5:1)-success?style=flat-square&color=ACC4A6)](https://www.w3.org/WAI/WCAG21/quickref/)
13
+ [![Figma DTCG](https://img.shields.io/badge/Figma-W3C%20DTCG%20%2F%20Tokens%20Studio-blue?style=flat-square&color=8AA1B2)](https://tokens.studio/)
14
+
15
+ </div>
16
+
17
+ ---
18
+
19
+ ## 📖 目錄
20
+ 1. [安裝 (Installation)](#1-安裝-installation)
21
+ 2. [快速入門 (Quick Start)](#2-快速入門-quick-start)
22
+ 3. [核心美學與設計哲學 (Design Philosophy)](#3-核心美學與設計哲學-design-philosophy)
23
+ 4. [Token 規範與 CSS 變數 (Token Specifications)](#4-token-規範與-css-變數-token-specifications)
24
+ 5. [🎨 Figma 設計權杖整合 (Figma Integration)](#5--figma-設計權杖整合-figma-integration)
25
+ 6. [🤖 AI Agent 整合 (Agent & Skill Integration)](#6--ai-agent-整合-agent--skill-integration)
26
+ 7. [無障礙與品質驗證 (Accessibility)](#7-無障礙與品質驗證-accessibility)
27
+ 8. [授權條款 (License)](#8-授權條款-license)
28
+
29
+ ---
30
+
31
+ ## 1. 安裝 (Installation)
32
+
33
+ ```bash
34
+ # npm
35
+ npm install asharyu-design-token
36
+
37
+ # pnpm
38
+ pnpm add asharyu-design-token
39
+
40
+ # yarn
41
+ yarn add asharyu-design-token
42
+ ```
43
+
44
+ ---
45
+
46
+ ## 2. 快速入門 (Quick Start)
47
+
48
+ ### 1) 載入全域 CSS 變數
49
+ 在專案的入口檔案(如 `index.tsx`, `App.tsx` 或全域 CSS)中引入樣式表:
50
+
51
+ ```tsx
52
+ import 'asharyu-design-token/index.css';
53
+ ```
54
+
55
+ ### 2) 在 CSS-in-JS (Emotion / Styled-Components) 中使用
56
+ 匯入具備完整 TypeScript 型別提示的 `tokens` 物件,安全引用 CSS 變數:
57
+
58
+ ```tsx
59
+ import styled from '@emotion/styled';
60
+ import { tokens } from 'asharyu-design-token';
61
+
62
+ const AsharyuCard = styled.div`
63
+ background-color: ${tokens.color.semantic.surface.primary};
64
+ border: ${tokens.stroke.weight.sharp} solid ${tokens.color.semantic.stroke};
65
+ border-radius: ${tokens.radius.gentle};
66
+ padding: ${tokens.spacing.void};
67
+ box-shadow: ${tokens.elevation.damMuk};
68
+ transition: ${tokens.interaction.flow.sangSaeng};
69
+
70
+ &:hover {
71
+ border-width: ${tokens.stroke.weight.fine};
72
+ box-shadow: ${tokens.elevation.jungMuk};
73
+ transform: translateY(-2px);
74
+ }
75
+ `;
76
+ ```
77
+
78
+ ### 3) 陰陽(深色 / 淺色)主題切換
79
+ 透過 `data-theme` 屬性即可瞬間切換全域主題:
80
+
81
+ ```html
82
+ <!-- 陽(淺色模式): 預設值 -->
83
+ <html data-theme="light"> ... </html>
84
+
85
+ <!-- 陰(深色模式) -->
86
+ <html data-theme="dark"> ... </html>
87
+ ```
88
+
89
+ ---
90
+
91
+ ## 3. 核心美學與設計哲學 (Design Philosophy)
92
+
93
+ **asharyu** 並非單憑主觀感官,而是將東方傳統的**陰陽(Yin-Yang)**、**五行(Wu Xing)**以及水墨淡彩畫的**筆觸與濃淡(Nong-dam)**轉化為嚴謹、邏輯化的數位介面規範。
94
+
95
+ 1. **銳利之墨線 (Sharpness)**:以如刀裁般鮮明的 0.5px 墨線(`--asharyu-stroke-weight-sharp`)定義清晰的資訊界線。
96
+ 2. **宣紙之留白 (Void)**:注重呼吸空間(`--asharyu-spacing-void`),展現傳統紙張的留白意境,避免擁擠堆砌。
97
+ 3. **濃淡層次 (Nong-dam Elevation)**:捨棄生硬的人工投影,以水墨暈染的濃淡(淡墨、中墨、濃墨、極墨)呈現溫潤而深邃的空間感。
98
+ 4. **氣韻生動動效 (Ki-un Motion)**:動畫遵循五行之相生(順暢柔和之流動)與相剋(銳利決斷之回饋)邏輯。
99
+
100
+ ---
101
+
102
+ ## 4. Token 規範與 CSS 變數 (Token Specifications)
103
+
104
+ ### ① 色彩 (Color Tokens)
105
+
106
+ #### 五行 (五行) — 主要操作與容器表面 (Primary Semantic)
107
+ | 元素 | 語意功能 | 主要用途 | 代表 CSS 變數 |
108
+ |---|---|---|---|
109
+ | **陽 / 陰 (Theme)** | 背景與正文文字 | 宣紙米白、深淵墨黑 | `--asharyu-color-semantic-background`, `-text` |
110
+ | **木 (Wood)** | `Action` | 主要操作、按鈕、重要連結 | `--asharyu-color-semantic-action-primary` |
111
+ | **火 (Fire)** | `Danger` | 警告、錯誤、破壞性操作 | `--asharyu-color-semantic-danger-primary` |
112
+ | **土 (Earth)** | `Surface` | 卡片底色、面板容器、休憩空間 | `--asharyu-color-semantic-surface-primary` |
113
+ | **金 (Metal)** | `Border` | 邊界線、分隔線、堅固輪廓 | `--asharyu-color-semantic-border-primary` |
114
+ | **水 (Water)** | `Info` | 導覽、輔助資訊、流動指引 | `--asharyu-color-semantic-info-primary` |
115
+
116
+ #### 五間色 (五間色) — 次要狀態與互動回饋 (Secondary Status)
117
+ | 間色 | 語意功能 | 配方關係 | 代表 CSS 變數 |
118
+ |---|---|---|---|
119
+ | **綠 (Nok)** | `Success` | 木 + 土 | `--asharyu-color-semantic-status-success-primary` |
120
+ | **紅 (Hong)** | `Alert-Hover` | 火 + 金 | `--asharyu-color-semantic-status-alert-hover-primary` |
121
+ | **碧 (Byeok)** | `Focus` | 木 + 金 | `--asharyu-color-semantic-status-action-focus-primary` |
122
+ | **硫黃 (Yu)** | `Warning / Sub-Surface` | 土 + 水 | `--asharyu-color-semantic-status-sub-surface-primary` |
123
+ | **紫 (Ja)** | `Special / Active` | 火 + 水 | `--asharyu-color-semantic-status-info-active-primary` |
124
+
125
+ ---
126
+
127
+ ### ② 留白與間距 (Spacing & Void)
128
+
129
+ | 鍵名 | CSS 變數 | 單位 (rem) | 單位 (px) | 用途與意境 |
130
+ |---|---|---|---|---|
131
+ | `compact` | `--asharyu-spacing-compact` | `0.25rem` | 4px | 剎那:圖示間隔、標籤內距 |
132
+ | `fine` | `--asharyu-spacing-fine` | `0.5rem` | 8px | 細目:行內元件間距 |
133
+ | `moderate` | `--asharyu-spacing-moderate` | `0.75rem` | 12px | 近距:表單控制項與清單 |
134
+ | `base` | `--asharyu-spacing-base` | `1rem` | 16px | 平常:標準卡片內距 |
135
+ | `void` | `--asharyu-spacing-void` | `1.5rem` | 24px | **留白:宣紙之呼吸(標準元件留白)** |
136
+ | `wide` | `--asharyu-spacing-wide` | `2rem` | 32px | 深遠:區塊群組間距 |
137
+ | `spacious` | `--asharyu-spacing-spacious` | `3rem` | 48px | 大留白:大區塊間隔 |
138
+ | `vast` | `--asharyu-spacing-vast` | `4rem` | 64px | 廣漠:頁面層級留白 |
139
+
140
+ ---
141
+
142
+ ### ③ 圓角曲率 (Radius)
143
+
144
+ - `--asharyu-radius-sharp`: `0px`(劍鋒銳角,俐落直角)
145
+ - `--asharyu-radius-delicate`: `0.25rem`(4px,微斂圓角)
146
+ - `--asharyu-radius-gentle`: `0.5rem`(8px,溫和自然曲率)
147
+ - `--asharyu-radius-smooth`: `0.75rem`(12px,流暢圓弧)
148
+ - `--asharyu-radius-prominent`: `1rem`(16px,大容器圓角)
149
+ - `--asharyu-radius-full`: `9999px`(太極,圓形頭像與膠囊按鈕)
150
+
151
+ ---
152
+
153
+ ### ④ 濃淡陰影 (Elevation & Depth)
154
+
155
+ 依據水墨暈染濃淡,在深淺模式中自動感應的立體深淺 Token:
156
+ - `--asharyu-elevation-none`: 平面無陰影
157
+ - `--asharyu-elevation-dam-muk`: **淡墨 (Dam-muk)** — 卡片懸停、下拉選單
158
+ - `--asharyu-elevation-jung-muk`: **中墨 (Jung-muk)** — 浮動面板、氣泡提示
159
+ - `--asharyu-elevation-nong-muk`: **濃墨 (Nong-muk)** — 對話方塊(Modal)
160
+ - `--asharyu-elevation-guk-muk`: **極墨 (Guk-muk)** — 最上層浮動通知(Toast)
161
+
162
+ ---
163
+
164
+ ### ⑤ 字體排印 (Typography)
165
+
166
+ - **字系 (Font Family)**:
167
+ - `--asharyu-font-family-serif`: 展現宣紙纖維感的明體 / 楷體 (`Gowun Batang`, `Noto Serif KR`)
168
+ - `--asharyu-font-family-sans`: 現代清晰之無襯線黑體 (`Pretendard`, system-ui)
169
+ - `--asharyu-font-family-mono`: 程式碼等寬字型 (`JetBrains Mono`, monospace)
170
+ - **筆壓字重 (Font Weight)**:
171
+ - `--asharyu-font-weight-light`(300/淡)、`regular`(400/常)、`semibold`(600/濃)、`bold`(700/筆)
172
+ - **行高 (Line Height)**:
173
+ - `--asharyu-font-line-height-tight`(1.25)、`normal`(1.5)、`relaxed`(1.75)
174
+
175
+ ---
176
+
177
+ ## 5. 🎨 Figma 設計權杖整合 (Figma Integration)
178
+
179
+ `asharyu-design-token` 在建置時會自動生成可直接匯入 Figma 的權杖檔案:
180
+
181
+ ### 方法 A:使用 Tokens Studio for Figma 外掛(推薦)
182
+ 1. 在 Figma 中開啟 **Tokens Studio for Figma** 外掛。
183
+ 2. 於 `Settings` > `Sync Providers` 選擇 **GitHub** 或選擇 **Load from local file**。
184
+ 3. 選取 **`node_modules/asharyu-design-token/dist/tokens.json`**。
185
+ 4. 即可載入 `global`, `light`, `dark` 權杖集,將色彩、留白、圓角、陰影完整套用至 Figma 設計稿。
186
+
187
+ ### 方法 B:原生 Figma Variables
188
+ 1. 使用 **`node_modules/asharyu-design-token/dist/figma-variables.json`**。
189
+ 2. 透過 Figma Variables REST API 或匯入外掛,一鍵生成 `Color (Raw)`, `Color (Semantic)`(含 Light/Dark 模式)及 `Spacing & Radius` 變數集合。
190
+
191
+ ---
192
+
193
+ ## 6. 🤖 AI Agent 整合 (Agent & Skill Integration)
194
+
195
+ 與 **Antigravity**, **Cursor**, **Claude Code**, **GitHub Copilot** 等 AI 助手結伴程式設計時,可自動載入 Asharyu 設計系統規範:
196
+
197
+ ### 1) Antigravity 工作區支援
198
+ 本套件內建 `.agents/skills/asharyu-design-system/` 技能與 `.agents/rules/asharyu-design-system.md` 規則,確保 AI 生成程式碼時不發生樣式偏移。
199
+
200
+ ### 2) 直接引用提示詞指南
201
+ 可直接將隨附的提示指南注入 AI 系統提示中:
202
+ ```
203
+ node_modules/asharyu-design-token/SKILL.md
204
+ ```
205
+
206
+ ---
207
+
208
+ ## 7. 無障礙與品質驗證 (Accessibility)
209
+
210
+ - **符合 WCAG 2.1 AAA 級規範**:
211
+ - 淺色模式文字對比度:**18.52 : 1**(遠高於 7.0:1 之 AAA 標準)
212
+ - 深色模式文字對比度:**18.52 : 1**(遠高於 7.0:1 之 AAA 標準)
213
+ - **UI 邊界線與焦點圈**:
214
+ - 狀態線條均達到 WCAG 2.1 AA 規範(≥ 4.5:1)。
215
+ - **自動化測試覆蓋**:
216
+ - 每次建置皆執行自動化測試,確保 Token 結構、CSS 變數一致性與對比度達成率達 100%。
217
+
218
+ ---
219
+
220
+ ## 8. 授權條款 (License)
221
+
222
+ 本專案採用 [Apache 2.0 授權條款](https://github.com/yoonjonglyu/asharyu-design/blob/main/LICENSE)。