@nexus-cross/design-system 1.0.11 → 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.
@@ -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`
@@ -171,15 +171,15 @@ var ImageUpload = React.forwardRef(
171
171
  !hasField && className
172
172
  ),
173
173
  children: [
174
- /* @__PURE__ */ jsxs("div", { className: "nexus-image-upload__preview-wrapper", children: [
175
- /* @__PURE__ */ jsx(
174
+ /* @__PURE__ */ jsxs("div", { className: "nexus-image-upload__preview-area", children: [
175
+ /* @__PURE__ */ jsx("div", { className: "nexus-image-upload__preview-wrapper", children: /* @__PURE__ */ jsx(
176
176
  "img",
177
177
  {
178
178
  src: preview,
179
179
  alt: "Uploaded preview",
180
180
  className: "nexus-image-upload__preview"
181
181
  }
182
- ),
182
+ ) }),
183
183
  !disabled && /* @__PURE__ */ jsx(
184
184
  "button",
185
185
  {