@nexus-cross/design-system 1.0.12 → 1.0.13
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/cursor-rules/CLAUDE.md +80 -0
- package/dist/chunks/{chunk-BQ6GJJB6.mjs → chunk-6ECGMUT6.mjs} +1 -1
- package/dist/chunks/{chunk-2WM23PO6.js → chunk-K574BYHQ.js} +7 -7
- package/dist/chunks/{chunk-WXMMOQXZ.js → chunk-V35IEPRL.js} +1 -1
- package/dist/chunks/{chunk-HI5XZ4PB.mjs → chunk-Z4YM7LU3.mjs} +7 -7
- package/dist/components/ToggleGroup.d.ts +2 -1
- package/dist/components/ToggleGroup.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.mjs +1 -1
- package/dist/schemas/_all.json +8 -2
- package/dist/schemas/toggle-group.d.ts +10 -5
- package/dist/schemas/toggle-group.d.ts.map +1 -1
- package/dist/schemas/toggleGroup.json +8 -2
- package/dist/schemas.js +4 -3
- package/dist/schemas.mjs +4 -3
- package/dist/styles/.generated/built.d.ts +1 -1
- package/dist/styles/.generated/built.d.ts.map +1 -1
- package/dist/styles/layer.js +2 -2
- package/dist/styles/layer.mjs +1 -1
- package/dist/styles.css +24 -12
- package/dist/styles.js +2 -2
- package/dist/styles.layered.css +24 -12
- package/dist/styles.mjs +1 -1
- package/dist/toggle-group.js +3 -3
- package/dist/toggle-group.mjs +1 -1
- package/package.json +2 -2
- package/scripts/setup-cursor-rules.cjs +14 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# NEXUS Design System — Rules for AI Assistants
|
|
2
|
+
|
|
3
|
+
## Tech Stack
|
|
4
|
+
|
|
5
|
+
- **Design Tokens**: `@nexus-cross/tokens` (CSS variable based)
|
|
6
|
+
- **UI Components**: `@nexus-cross/design-system` (React, CVA + Plain CSS)
|
|
7
|
+
- **Styling**: Tailwind CSS v4 + NEXUS semantic tokens
|
|
8
|
+
|
|
9
|
+
## Absolute Rules
|
|
10
|
+
|
|
11
|
+
1. **색상은 반드시 NEXUS 토큰 사용.** hex, rgb, 기본 Tailwind 색상 (`bg-blue-500` 등) 금지.
|
|
12
|
+
- 배경: `bg-bg-*`, `bg-surface-*`
|
|
13
|
+
- 텍스트: `text-text-*`
|
|
14
|
+
- 아이콘: `text-icon-*`
|
|
15
|
+
- 테두리: `border-border-*`
|
|
16
|
+
- 액센트: `bg-accent-*`
|
|
17
|
+
- 상태: `bg-status-*`
|
|
18
|
+
|
|
19
|
+
2. **UI 컴포넌트는 `@nexus-cross/design-system`에서 import.** 직접 구현 금지.
|
|
20
|
+
- `<button>` → `<Button>`, `<input>` → `<TextInput>`, `<select>` → `<Select>` 등
|
|
21
|
+
- Radix UI, Headless UI 등 직접 import 금지 (design-system이 내부적으로 사용)
|
|
22
|
+
|
|
23
|
+
3. **Figma MCP 코드 그대로 사용 금지.** MCP 출력은 "디자인 의도 파악용"으로만 참고.
|
|
24
|
+
- Step 1: MCP로 구조 파악 → Step 2: NEXUS 컴포넌트 매핑 → Step 3: NEXUS 코드 작성
|
|
25
|
+
|
|
26
|
+
4. **`className` 오버라이드 시 `!important` 금지.** `cn()` 유틸이 프리픽스 충돌 자동 해소.
|
|
27
|
+
|
|
28
|
+
## Component Import
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
import { Button, TextInput, TextArea, Select, Switch, Chip, Spinner, Divider } from '@nexus-cross/design-system';
|
|
32
|
+
import { Tooltip, Popover, Drawer, Accordion } from '@nexus-cross/design-system';
|
|
33
|
+
import { toast, Toaster } from '@nexus-cross/design-system';
|
|
34
|
+
import { modal, useModal, ModalTemplate, ModalContainer } from '@nexus-cross/design-system/modal';
|
|
35
|
+
import { NumberInput, numberInputBind } from '@nexus-cross/design-system';
|
|
36
|
+
import { Avatar, Tab, ToggleGroup } from '@nexus-cross/design-system';
|
|
37
|
+
import { cn } from '@nexus-cross/design-system';
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## CSS Setup
|
|
41
|
+
|
|
42
|
+
### Tailwind v4
|
|
43
|
+
```css
|
|
44
|
+
@import 'tailwindcss';
|
|
45
|
+
@import '@nexus-cross/tokens/company.css';
|
|
46
|
+
/* Next.js Turbopack only: */
|
|
47
|
+
@import '@nexus-cross/design-system/styles.css';
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Next.js Turbopack
|
|
51
|
+
```js
|
|
52
|
+
// next.config.mjs
|
|
53
|
+
const nextConfig = {
|
|
54
|
+
transpilePackages: ['@nexus-cross/design-system', '@nexus-cross/tokens'],
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Token Path Convention
|
|
59
|
+
|
|
60
|
+
모든 디자인 토큰은 5-segment 형식: `color.semantic.{namespace}.{slot}.{state}`
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
# CORRECT
|
|
64
|
+
color.semantic.domain-market.bullish.base
|
|
65
|
+
color.semantic.domain-market.bullish-bg.hover
|
|
66
|
+
|
|
67
|
+
# WRONG (6+ segments)
|
|
68
|
+
color.semantic.domain-market.trend.bullish.base
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Detailed References
|
|
72
|
+
|
|
73
|
+
상세 API, 토큰 목록, 컴포넌트 매핑 가이드는 아래 파일 참조:
|
|
74
|
+
|
|
75
|
+
- **토큰 전체 목록**: `.cursor/rules/nexus-tokens.mdc`
|
|
76
|
+
- **도메인 토큰**: `.cursor/rules/nexus-domains.mdc`
|
|
77
|
+
- **컴포넌트 매핑 가이드**: `.cursor/rules/nexus-ui-components.mdc`
|
|
78
|
+
- **컴포넌트 API (props)**: `.cursor/rules/nexus-ui-api.mdc`
|
|
79
|
+
- **프로젝트 셋업 상세**: `.cursor/rules/nexus-project-setup.mdc`
|
|
80
|
+
- **토큰 5-segment 규칙**: `.cursor/rules/token-path-5segment.mdc`
|