@nexus-cross/design-system 1.0.6-beta.1 → 1.0.6-beta.2
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/nexus-project-setup.mdc +167 -145
- package/cursor-rules/nexus-ui-api.mdc +683 -312
- package/cursor-rules/nexus-ui-components.mdc +179 -91
- package/dist/accordion.js +7 -7
- package/dist/accordion.mjs +2 -2
- package/dist/avatar.js +4 -4
- package/dist/avatar.mjs +2 -2
- package/dist/button.js +4 -4
- package/dist/button.mjs +2 -2
- package/dist/carousel.js +8 -8
- package/dist/carousel.mjs +2 -2
- package/dist/checkbox.js +5 -5
- package/dist/checkbox.mjs +2 -2
- package/dist/chip.d.mts +1 -1
- package/dist/chip.d.ts +1 -1
- package/dist/chip.js +4 -4
- package/dist/chip.mjs +2 -2
- package/dist/chunks/{chunk-UR6JOKVB.mjs → chunk-26BUGBOY.mjs} +13 -21
- package/dist/chunks/{chunk-5TBXVD56.js → chunk-2MC7XJSE.js} +16 -6
- package/dist/chunks/{chunk-BEA727LO.mjs → chunk-2RPRCWKV.mjs} +57 -26
- package/dist/chunks/{chunk-5I2VRWWU.js → chunk-2ZXDXO4I.js} +32 -38
- package/dist/chunks/{chunk-RLP3U52D.mjs → chunk-33UFQJIO.mjs} +22 -40
- package/dist/chunks/{chunk-AOVU67NI.mjs → chunk-3HHJORN7.mjs} +23 -25
- package/dist/chunks/{chunk-TWHDXCKR.js → chunk-3PCNRCTB.js} +8 -8
- package/dist/chunks/{chunk-SXLMI7CZ.mjs → chunk-3VFBPFZF.mjs} +160 -232
- package/dist/chunks/chunk-4ENXP7WH.js +224 -0
- package/dist/chunks/{chunk-YEGPB7A7.js → chunk-5JHJNN2K.js} +4 -4
- package/dist/chunks/{chunk-C3E7CSKG.mjs → chunk-6FMDO6TT.mjs} +7 -8
- package/dist/chunks/{chunk-76CY4STF.js → chunk-7G65JBTN.js} +34 -66
- package/dist/chunks/{chunk-GMIGQ5VP.mjs → chunk-ADO7PDLY.mjs} +15 -35
- package/dist/chunks/{chunk-ZINDMFOI.js → chunk-AFSEYJZT.js} +24 -32
- package/dist/chunks/{chunk-6FHK6CBR.js → chunk-B6G5TJRO.js} +7 -8
- package/dist/chunks/chunk-BBLBTOP4.js +205 -0
- package/dist/chunks/{chunk-5XVEYVYA.js → chunk-BLGQHR3M.js} +5 -8
- package/dist/chunks/{chunk-LVTD2UQN.mjs → chunk-BPUQ2CO2.mjs} +2 -2
- package/dist/chunks/{chunk-AWBGWBFS.js → chunk-BSZ2LN6E.js} +21 -27
- package/dist/chunks/{chunk-KWPIEHD2.mjs → chunk-CA3SOLI3.mjs} +1 -1
- package/dist/chunks/chunk-CLGH2RTS.js +7 -0
- package/dist/chunks/{chunk-MPKRXMCJ.js → chunk-CSJDDREF.js} +7 -10
- package/dist/chunks/chunk-CZC76ZD5.js +10 -0
- package/dist/chunks/{chunk-TLTEUIBY.js → chunk-DLFV7ZZV.js} +4 -4
- package/dist/chunks/chunk-DO6VK2QQ.mjs +108 -0
- package/dist/chunks/{chunk-GQP7IXH2.mjs → chunk-ECVAVQUY.mjs} +23 -31
- package/dist/chunks/{chunk-3CHRUKSJ.mjs → chunk-EHAUUUWB.mjs} +3 -3
- package/dist/chunks/{chunk-G4XJG7XI.js → chunk-EVOOTSY5.js} +3 -10
- package/dist/chunks/{chunk-VH5FF6DZ.mjs → chunk-GX6GSWX3.mjs} +7 -7
- package/dist/chunks/{chunk-OGUTGD4J.mjs → chunk-HNLI646G.mjs} +71 -39
- package/dist/chunks/{chunk-C6H2UNOX.js → chunk-IE4DGLMH.js} +13 -21
- package/dist/chunks/{chunk-U76LT5GE.js → chunk-IOSIQLZL.js} +2 -2
- package/dist/chunks/{chunk-ZCMKIB5U.js → chunk-J5ZKGPBY.js} +33 -41
- package/dist/chunks/{chunk-JUZHWKGS.mjs → chunk-K2TBLM3F.mjs} +6 -12
- package/dist/chunks/{chunk-FHPHDK3O.mjs → chunk-LI7SFBUQ.mjs} +4 -4
- package/dist/chunks/{chunk-7OEK2KX3.mjs → chunk-LMMON5AU.mjs} +4 -4
- package/dist/chunks/{chunk-6DZVNFVY.js → chunk-LOQXCHKL.js} +4 -12
- package/dist/chunks/{chunk-377KBJQG.js → chunk-MA2VCCIY.js} +19 -22
- package/dist/chunks/chunk-MCKOWMLS.mjs +8 -0
- package/dist/chunks/{chunk-TR5JBBEA.mjs → chunk-MRRKW5QN.mjs} +31 -39
- package/dist/chunks/{chunk-76K6KXCT.js → chunk-NFIPQZ4O.js} +1 -1
- package/dist/chunks/{chunk-I7YJB2F5.js → chunk-OMN5YQCE.js} +3 -3
- package/dist/chunks/{chunk-B7UU3FSS.mjs → chunk-P2T72N62.mjs} +4 -7
- package/dist/chunks/chunk-P3DZKXG4.js +116 -0
- package/dist/chunks/{chunk-RXVYL4AU.js → chunk-PEIEVKD5.js} +7 -13
- package/dist/chunks/{chunk-IJG7J2VU.mjs → chunk-QZ4QR3XV.mjs} +30 -36
- package/dist/chunks/{chunk-6NTASYZO.js → chunk-RS3SBY3I.js} +61 -30
- package/dist/chunks/{chunk-AKIBUO5A.mjs → chunk-RX5UKRYK.mjs} +19 -26
- package/dist/chunks/{chunk-WJ2OVQD3.mjs → chunk-SGNRVYYQ.mjs} +19 -25
- package/dist/chunks/{chunk-IB5UCYQY.mjs → chunk-SJMCPSVH.mjs} +15 -5
- package/dist/chunks/{chunk-DDMZSNTG.js → chunk-U53UA76K.js} +166 -238
- package/dist/chunks/chunk-UKRU46PH.mjs +182 -0
- package/dist/chunks/{chunk-WNFJ4NJN.mjs → chunk-ULGYTBCT.mjs} +3 -11
- package/dist/chunks/chunk-UPCWJWXR.mjs +5 -0
- package/dist/chunks/{chunk-TXYYBJBQ.js → chunk-VGO4Z2WH.js} +73 -41
- package/dist/chunks/{chunk-LBKBCI2K.mjs → chunk-VIGRCJAE.mjs} +3 -10
- package/dist/chunks/chunk-VVXQZ4XH.mjs +93 -0
- package/dist/chunks/{chunk-Z7OKV6NW.mjs → chunk-W4GG5A7K.mjs} +12 -20
- package/dist/chunks/chunk-WGGBE4ZD.mjs +201 -0
- package/dist/chunks/{chunk-WSWD5ZUJ.js → chunk-WKCXACMZ.js} +20 -27
- package/dist/chunks/{chunk-Q7GQVAYY.js → chunk-WR55D4ZS.js} +14 -22
- package/dist/chunks/{chunk-GSLIY6WW.js → chunk-X2SHTVZQ.js} +17 -37
- package/dist/chunks/{chunk-U6KOUYWX.mjs → chunk-XG6QG65W.mjs} +7 -10
- package/dist/chunks/chunk-YB5ZKHVB.js +64 -0
- package/dist/chunks/{chunk-Q7H6LCNN.js → chunk-YCG4FZC3.js} +23 -25
- package/dist/chunks/{chunk-JZ3PWHKS.mjs → chunk-YLO4UKSC.mjs} +18 -21
- package/dist/chunks/{chunk-Q2TMXHPK.js → chunk-YZV6FWE7.js} +25 -43
- package/dist/chunks/chunk-ZWSIIGA3.mjs +58 -0
- package/dist/countdown.js +4 -4
- package/dist/countdown.mjs +2 -2
- package/dist/counter.js +2 -2
- package/dist/counter.mjs +1 -1
- package/dist/data-list.js +5 -5
- package/dist/data-list.mjs +4 -4
- package/dist/divider.js +4 -4
- package/dist/divider.mjs +2 -2
- package/dist/drawer.d.mts +1 -1
- package/dist/drawer.d.ts +1 -1
- package/dist/drawer.js +11 -11
- package/dist/drawer.mjs +2 -2
- package/dist/ellipsis.js +3 -3
- package/dist/ellipsis.mjs +2 -2
- package/dist/error-boundary.d.mts +1 -1
- package/dist/error-boundary.d.ts +1 -1
- package/dist/error-boundary.js +2 -2
- package/dist/error-boundary.mjs +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +152 -143
- package/dist/index.mjs +34 -33
- package/dist/infinite-scroll.js +3 -3
- package/dist/infinite-scroll.mjs +2 -2
- package/dist/marquee.js +3 -3
- package/dist/marquee.mjs +2 -2
- package/dist/modal/index.js +11 -11
- package/dist/modal/index.mjs +2 -2
- package/dist/number-input.d.mts +1 -1
- package/dist/number-input.d.ts +1 -1
- package/dist/number-input.js +5 -5
- package/dist/number-input.mjs +2 -2
- package/dist/pagination.d.mts +1 -0
- package/dist/pagination.d.ts +1 -0
- package/dist/pagination.js +5 -5
- package/dist/pagination.mjs +2 -2
- package/dist/popover.d.mts +1 -1
- package/dist/popover.d.ts +1 -1
- package/dist/popover.js +8 -8
- package/dist/popover.mjs +2 -2
- package/dist/price-input.d.mts +36 -0
- package/dist/price-input.d.ts +36 -0
- package/dist/price-input.js +16 -0
- package/dist/price-input.mjs +3 -0
- package/dist/radio-group.js +6 -6
- package/dist/radio-group.mjs +2 -2
- package/dist/schemas/_all.json +1520 -376
- package/dist/schemas/accordion.json +14 -11
- package/dist/schemas/avatar.json +13 -7
- package/dist/schemas/button.json +27 -9
- package/dist/schemas/carousel.json +10 -4
- package/dist/schemas/carouselButton.json +20 -0
- package/dist/schemas/carouselDots.json +17 -0
- package/dist/schemas/carouselSlide.json +20 -0
- package/dist/schemas/checkBox.json +33 -8
- package/dist/schemas/chip.json +15 -6
- package/dist/schemas/clientOnly.json +19 -0
- package/dist/schemas/countdown.json +10 -7
- package/dist/schemas/counter.json +15 -9
- package/dist/schemas/dataList.json +10 -10
- package/dist/schemas/divider.json +8 -5
- package/dist/schemas/drawer.json +24 -2
- package/dist/schemas/drawerClose.json +24 -0
- package/dist/schemas/drawerContent.json +9 -6
- package/dist/schemas/drawerDescription.json +20 -0
- package/dist/schemas/drawerTitle.json +20 -0
- package/dist/schemas/drawerTrigger.json +24 -0
- package/dist/schemas/ellipsis.json +17 -7
- package/dist/schemas/errorBoundary.json +22 -0
- package/dist/schemas/infiniteScroll.json +18 -9
- package/dist/schemas/marquee.json +12 -6
- package/dist/schemas/modalCall.json +81 -3
- package/dist/schemas/modalTemplate.json +67 -14
- package/dist/schemas/numberInput.json +42 -12
- package/dist/schemas/pagination.json +13 -6
- package/dist/schemas/popover.json +18 -9
- package/dist/schemas/priceInput.json +104 -0
- package/dist/schemas/radioGroup.json +19 -9
- package/dist/schemas/radioItem.json +12 -5
- package/dist/schemas/select.json +15 -9
- package/dist/schemas/selectItem.json +7 -4
- package/dist/schemas/skeleton.json +12 -6
- package/dist/schemas/spinner.json +11 -4
- package/dist/schemas/switch.json +23 -5
- package/dist/schemas/tab.json +17 -14
- package/dist/schemas/table.json +75 -0
- package/dist/schemas/tableRow.json +32 -0
- package/dist/schemas/tdColumn.json +107 -0
- package/dist/schemas/textArea.json +47 -7
- package/dist/schemas/textInput.json +72 -10
- package/dist/schemas/themeProvider.json +65 -0
- package/dist/schemas/toastOptions.json +81 -0
- package/dist/schemas/toaster.json +76 -0
- package/dist/schemas/tooltip.json +12 -9
- package/dist/schemas/virtualGrid.json +22 -11
- package/dist/schemas/virtualList.json +14 -8
- package/dist/schemas.d.mts +839 -32
- package/dist/schemas.d.ts +839 -32
- package/dist/schemas.js +561 -273
- package/dist/schemas.mjs +546 -273
- package/dist/select.js +6 -6
- package/dist/select.mjs +2 -2
- package/dist/skeleton.js +3 -3
- package/dist/skeleton.mjs +2 -2
- package/dist/spinner.js +3 -3
- package/dist/spinner.mjs +2 -2
- package/dist/styles/layer.d.mts +3 -0
- package/dist/styles/layer.d.ts +3 -0
- package/dist/styles/layer.js +18 -0
- package/dist/styles/layer.mjs +16 -0
- package/dist/styles.css +2569 -2
- package/dist/styles.js +2 -5
- package/dist/styles.layered.css +2572 -0
- package/dist/styles.mjs +1 -4
- package/dist/switch.js +4 -4
- package/dist/switch.mjs +2 -2
- package/dist/tab.js +5 -5
- package/dist/tab.mjs +2 -2
- package/dist/table.d.mts +2 -2
- package/dist/table.d.ts +2 -2
- package/dist/table.js +9 -9
- package/dist/table.mjs +3 -3
- package/dist/text-area.js +4 -4
- package/dist/text-area.mjs +2 -2
- package/dist/text-input.d.mts +5 -1
- package/dist/text-input.d.ts +5 -1
- package/dist/text-input.js +4 -4
- package/dist/text-input.mjs +2 -2
- package/dist/toast.js +5 -5
- package/dist/toast.mjs +2 -2
- package/dist/tooltip.js +5 -5
- package/dist/tooltip.mjs +2 -2
- package/dist/utils/cn.d.mts +0 -10
- package/dist/utils/cn.d.ts +0 -10
- package/dist/utils/cn.js +2 -2
- package/dist/utils/cn.mjs +1 -1
- package/dist/virtual-scroll.js +4 -4
- package/dist/virtual-scroll.mjs +2 -2
- package/package.json +23 -18
- package/scripts/setup-cursor-rules.cjs +6 -6
- package/dist/chunks/chunk-7MT3QYE6.js +0 -92
- package/dist/chunks/chunk-FA2OPP3U.mjs +0 -140
- package/dist/chunks/chunk-FKZI2HTI.js +0 -104
- package/dist/chunks/chunk-NCQDOPBR.mjs +0 -86
- package/dist/chunks/chunk-NTN55ZIX.mjs +0 -113
- package/dist/chunks/chunk-QJNQCLMV.js +0 -25
- package/dist/chunks/chunk-UDQXLI5Y.mjs +0 -81
- package/dist/chunks/chunk-WVIEIRK2.js +0 -136
- package/dist/chunks/chunk-XALPBGSC.mjs +0 -23
- package/dist/schemas/typography.json +0 -70
- package/dist/typography.d.mts +0 -19
- package/dist/typography.d.ts +0 -19
- package/dist/typography.js +0 -102
- package/dist/typography.mjs +0 -79
|
@@ -1,108 +1,130 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "NEXUS Design System
|
|
2
|
+
description: "NEXUS Design System project setup — tech stack and mandatory rules for this project"
|
|
3
3
|
alwaysApply: true
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# NEXUS Design System
|
|
6
|
+
# NEXUS Design System Project Setup
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
This project uses NEXUS Design System. All generated code MUST follow the rules below.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Tech Stack
|
|
11
11
|
|
|
12
|
-
-
|
|
13
|
-
- **UI
|
|
14
|
-
-
|
|
12
|
+
- **Design Tokens**: `@nexus-cross/tokens` (CSS variable based)
|
|
13
|
+
- **UI Components**: `@nexus-cross/design-system` (React, CVA + Plain CSS)
|
|
14
|
+
- **Styling**: Tailwind CSS v4 + NEXUS semantic tokens
|
|
15
15
|
|
|
16
|
-
##
|
|
16
|
+
## Design System CSS Setup
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
- `bg-bg-default`, `text-text-primary`, `border-border-default` 등
|
|
20
|
-
- `#ffffff`, `#000000`, `rgb()` 등 직접 색상값 사용 금지
|
|
21
|
-
- 참고: `.cursor/rules/nexus-tokens.mdc`
|
|
18
|
+
Choose one of two CSS entry points depending on the project environment:
|
|
22
19
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
| Environment | import | Description |
|
|
21
|
+
|---|---|---|
|
|
22
|
+
| Tailwind v3 / Plain CSS / CSS Modules | `@nexus-cross/design-system/styles` | unlayered CSS |
|
|
23
|
+
| Tailwind v4 | `@nexus-cross/design-system/styles/layer` | wrapped in `@layer nexus` |
|
|
27
24
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
```tsx
|
|
26
|
+
// Tailwind v3, Plain CSS, CSS Modules
|
|
27
|
+
import '@nexus-cross/design-system/styles'
|
|
28
|
+
|
|
29
|
+
// Tailwind v4
|
|
30
|
+
import '@nexus-cross/design-system/styles/layer'
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
For Tailwind v4 projects, also declare layer order in `globals.css`:
|
|
34
|
+
```css
|
|
35
|
+
@layer base, nexus, components, utilities;
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Absolute Rules
|
|
39
|
+
|
|
40
|
+
1. **Always use NEXUS tokens for colors.** Hardcoding is prohibited.
|
|
41
|
+
- `bg-bg-default`, `text-text-primary`, `border-border-default`, etc.
|
|
42
|
+
- Direct color values like `#ffffff`, `#000000`, `rgb()` are prohibited
|
|
43
|
+
- Reference: `.cursor/rules/nexus-tokens.mdc`
|
|
44
|
+
|
|
45
|
+
2. **Always import UI components from `@nexus-cross/design-system`.** Direct implementation is prohibited.
|
|
46
|
+
- `<Button>`, `<TextInput>`, `<Modal>`, `<Toast>`, etc.
|
|
47
|
+
- Do NOT import Radix UI, Headless UI, etc. to build equivalent components
|
|
48
|
+
- Reference: `.cursor/rules/nexus-ui-components.mdc`, `.cursor/rules/nexus-ui-api.mdc`
|
|
49
|
+
|
|
50
|
+
3. **When implementing Figma designs:**
|
|
51
|
+
- Actively use NEXUS tokens and shared UI, while **faithfully** implementing the Figma design
|
|
52
|
+
- Map Figma color values to the closest NEXUS token
|
|
53
|
+
- Implement Figma UI elements (buttons, inputs, etc.) using `@nexus-cross/design-system` components
|
|
54
|
+
- If shared UI style differs from Figma, override with `className` to match Figma
|
|
55
|
+
- Only use Tailwind utilities for custom styles not present in Figma
|
|
34
56
|
|
|
35
|
-
## Figma MCP → NEXUS
|
|
57
|
+
## Figma MCP → NEXUS Conversion Workflow
|
|
36
58
|
|
|
37
|
-
**Figma MCP
|
|
38
|
-
Figma MCP
|
|
39
|
-
**MCP
|
|
59
|
+
**NEVER use Figma MCP tool output (get_design_context, get_code, etc.) as-is.**
|
|
60
|
+
Figma MCP outputs vanilla HTML + Tailwind, but this project uses `@nexus-cross/design-system`.
|
|
61
|
+
**MCP output is only a "reference for understanding design intent", not final code.**
|
|
40
62
|
|
|
41
|
-
###
|
|
63
|
+
### Mandatory 3-Step Workflow
|
|
42
64
|
|
|
43
|
-
**1
|
|
44
|
-
- `get_design_context
|
|
45
|
-
- `get_screenshot
|
|
46
|
-
-
|
|
65
|
+
**Step 1: Design Analysis (MCP call)**
|
|
66
|
+
- Use `get_design_context` to understand structure and layout
|
|
67
|
+
- Use `get_screenshot` for visual reference
|
|
68
|
+
- Code output from MCP at this stage is **read-only — do not use it**
|
|
47
69
|
|
|
48
|
-
**2
|
|
49
|
-
MCP
|
|
70
|
+
**Step 2: Component Mapping (MUST be done before writing code)**
|
|
71
|
+
Map each element from MCP output to a NEXUS component. **Complete this mapping before writing a single line of code.**
|
|
50
72
|
|
|
51
73
|
```
|
|
52
|
-
MCP
|
|
53
|
-
- <button>
|
|
54
|
-
- <input type="text">
|
|
55
|
-
- <select>
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
74
|
+
MCP Output Analysis:
|
|
75
|
+
- 2 <button> found → Button (primary, ghost)
|
|
76
|
+
- 1 <input type="text"> → TextInput
|
|
77
|
+
- 1 <select> → Select + SelectItem
|
|
78
|
+
- Color #09B498 → bg-accent-primary (NEXUS token)
|
|
79
|
+
- Color #1E232E → text-text-primary (NEXUS token)
|
|
80
|
+
- Spacing 16px → var(--spacing-padding-md)
|
|
59
81
|
```
|
|
60
82
|
|
|
61
|
-
**3
|
|
62
|
-
|
|
83
|
+
**Step 3: NEXUS Code Generation**
|
|
84
|
+
Write code based on the mapping. Do NOT reference MCP output code at this stage.
|
|
63
85
|
|
|
64
|
-
###
|
|
86
|
+
### Component Conversion Table
|
|
65
87
|
|
|
66
|
-
| MCP
|
|
88
|
+
| MCP Output (Native HTML) | → NEXUS Component |
|
|
67
89
|
|---|---|
|
|
68
|
-
| `<button>`, `<a>`
|
|
69
|
-
| `<input type="text">` | `<TextInput>` (prefixIcon, suffixIcon
|
|
70
|
-
| `<textarea>` | `<TextArea>` (showCount, maxLength
|
|
90
|
+
| `<button>`, `<a>` button style | `<Button>` (specify variant, size) |
|
|
91
|
+
| `<input type="text">` | `<TextInput>` (prefixIcon, suffixIcon supported) |
|
|
92
|
+
| `<textarea>` | `<TextArea>` (showCount, maxLength supported) |
|
|
71
93
|
| `<input type="number">` | `<NumberInput>` |
|
|
72
94
|
| `<select>` | `<Select>` + `<SelectItem>` |
|
|
73
95
|
| `<input type="checkbox">` | `<CheckBox>` |
|
|
74
96
|
| `<input type="radio">` | `<RadioGroup>` + `<RadioItem>` |
|
|
75
|
-
|
|
|
76
|
-
|
|
|
77
|
-
|
|
|
78
|
-
|
|
|
79
|
-
|
|
|
80
|
-
|
|
|
81
|
-
|
|
|
82
|
-
|
|
|
83
|
-
|
|
|
84
|
-
|
|
|
85
|
-
|
|
|
86
|
-
|
|
|
87
|
-
|
|
|
88
|
-
|
|
|
89
|
-
|
|
|
90
|
-
|
|
|
91
|
-
|
|
|
92
|
-
|
|
|
93
|
-
|
|
|
94
|
-
|
|
|
95
|
-
|
|
|
96
|
-
|
|
|
97
|
-
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
###
|
|
102
|
-
|
|
103
|
-
MCP
|
|
104
|
-
|
|
105
|
-
| MCP
|
|
97
|
+
| Toggle/Switch UI | `<Switch>` |
|
|
98
|
+
| Tab UI | `<Tab>` (configured via items array) |
|
|
99
|
+
| Chip/Tag/Filter/Badge | `<Chip>` (variant, onClose supported) |
|
|
100
|
+
| Avatar/Profile image | `<Avatar>` (fallback, shape supported) |
|
|
101
|
+
| Divider/`<hr>` | `<Divider>` (specify orientation, variant) |
|
|
102
|
+
| Dropdown menu | `<Select>` or `<Popover>` |
|
|
103
|
+
| Tooltip | `<Tooltip>` |
|
|
104
|
+
| Accordion/Collapsible | `<Accordion>` |
|
|
105
|
+
| Carousel/Slider | `<Carousel>` + `<CarouselSlide>` |
|
|
106
|
+
| Pagination | `<Pagination>` |
|
|
107
|
+
| Modal/Dialog | `modal()` + `<ModalTemplate>` |
|
|
108
|
+
| Toast/Notification | `toast()` |
|
|
109
|
+
| Drawer/Bottom sheet | `<Drawer>` |
|
|
110
|
+
| Loading spinner | `<Spinner>` |
|
|
111
|
+
| Skeleton loader | `<Skeleton>` |
|
|
112
|
+
| Data list | `<DataList>` |
|
|
113
|
+
| Table | `<Table>` + `<TableRow>` + `<TdColumn>` |
|
|
114
|
+
| Number count animation | `<Counter>` |
|
|
115
|
+
| Countdown timer | `<Countdown>` |
|
|
116
|
+
| Text ellipsis | `<Ellipsis>` |
|
|
117
|
+
| Scrolling text | `<Marquee>` |
|
|
118
|
+
| Infinite scroll list | `<InfiniteScroll>` |
|
|
119
|
+
| Large list (virtual scroll) | `<VirtualList>` / `<VirtualGrid>` |
|
|
120
|
+
|
|
121
|
+
**Using native HTML instead of the replacements above is a rule violation.**
|
|
122
|
+
|
|
123
|
+
### Color Conversion Table
|
|
124
|
+
|
|
125
|
+
Convert MCP output colors to NEXUS tokens:
|
|
126
|
+
|
|
127
|
+
| MCP Output Color | → NEXUS Token |
|
|
106
128
|
|---|---|
|
|
107
129
|
| `#FFFFFF`, `bg-white` | `bg-bg-default` |
|
|
108
130
|
| `#F3F6F8`, `bg-gray-50` | `bg-bg-subtle` |
|
|
@@ -117,59 +139,59 @@ MCP가 출력하는 색상값을 NEXUS 토큰으로 변환한다:
|
|
|
117
139
|
| `#FF9D00`, `bg-amber-*` | `bg-status-warning` |
|
|
118
140
|
| `#0095FF`, `bg-blue-*` | `bg-status-info` |
|
|
119
141
|
|
|
120
|
-
|
|
121
|
-
|
|
142
|
+
For colors not exactly matching above, choose the closest NEXUS token.
|
|
143
|
+
**Under no circumstances use hex values or default Tailwind colors (bg-blue-500, etc.).**
|
|
122
144
|
|
|
123
|
-
### Button
|
|
145
|
+
### Button Variant Decision Criteria
|
|
124
146
|
|
|
125
|
-
|
|
147
|
+
Determine the variant based on visual style in Figma:
|
|
126
148
|
|
|
127
|
-
| Figma
|
|
149
|
+
| Figma Visual Characteristic | → variant |
|
|
128
150
|
|---|---|
|
|
129
|
-
|
|
|
130
|
-
|
|
|
131
|
-
|
|
|
132
|
-
|
|
|
133
|
-
|
|
|
151
|
+
| Filled accent color background (green/teal) | `variant="primary"` |
|
|
152
|
+
| Filled gray/neutral background | `variant="secondary"` |
|
|
153
|
+
| Border only, transparent background | `variant="outline"` |
|
|
154
|
+
| No background/border, text only | `variant="ghost"` |
|
|
155
|
+
| Red/danger indicator | `variant="danger"` |
|
|
134
156
|
|
|
135
|
-
###
|
|
157
|
+
### Self-Verification Checklist
|
|
136
158
|
|
|
137
|
-
|
|
159
|
+
Verify the following before outputting code:
|
|
138
160
|
|
|
139
|
-
- [ ] `<button>`, `<input>`, `<select>`, `<textarea
|
|
140
|
-
- [ ] hex
|
|
141
|
-
- [ ] Tailwind
|
|
142
|
-
- [ ]
|
|
143
|
-
- [ ]
|
|
144
|
-
- [ ]
|
|
161
|
+
- [ ] No native HTML form elements (`<button>`, `<input>`, `<select>`, `<textarea>`, etc.)?
|
|
162
|
+
- [ ] No hex color values (`#...`)?
|
|
163
|
+
- [ ] No default Tailwind colors (`bg-blue-500`, `text-gray-900`, etc.)?
|
|
164
|
+
- [ ] All imports from `@nexus-cross/design-system`?
|
|
165
|
+
- [ ] Modals wrapped with `ModalTemplate`?
|
|
166
|
+
- [ ] No hardcoded px values for spacing/sizing?
|
|
145
167
|
|
|
146
|
-
|
|
168
|
+
**If any check fails, fix the code before outputting.**
|
|
147
169
|
|
|
148
170
|
```tsx
|
|
149
|
-
//
|
|
150
|
-
<button className="bg-[#09B498] text-white px-4 py-2 rounded-lg"
|
|
151
|
-
<input className="border border-[#C6D0DA] px-3 py-2 rounded" placeholder="
|
|
152
|
-
<div className="w-8 h-8 rounded-full bg-gray-200" /> {/*
|
|
153
|
-
<hr className="border-[#ECF0F2]" /> {/*
|
|
154
|
-
|
|
155
|
-
//
|
|
156
|
-
<Button variant="primary"
|
|
157
|
-
<TextInput placeholder="
|
|
171
|
+
// WRONG — Using Figma MCP code as-is (prohibited)
|
|
172
|
+
<button className="bg-[#09B498] text-white px-4 py-2 rounded-lg">Confirm</button>
|
|
173
|
+
<input className="border border-[#C6D0DA] px-3 py-2 rounded" placeholder="Search" />
|
|
174
|
+
<div className="w-8 h-8 rounded-full bg-gray-200" /> {/* avatar */}
|
|
175
|
+
<hr className="border-[#ECF0F2]" /> {/* divider */}
|
|
176
|
+
|
|
177
|
+
// CORRECT — Replace with NEXUS components (required)
|
|
178
|
+
<Button variant="primary">Confirm</Button>
|
|
179
|
+
<TextInput placeholder="Search" prefixIcon={<SearchIcon />} />
|
|
158
180
|
<Avatar fallback="JD" size="sm" />
|
|
159
181
|
<Divider />
|
|
160
182
|
```
|
|
161
183
|
|
|
162
|
-
##
|
|
184
|
+
## Global Setup (Required at App Root)
|
|
163
185
|
|
|
164
|
-
|
|
186
|
+
The following components MUST be placed at the app root (layout.tsx or App.tsx).
|
|
165
187
|
|
|
166
|
-
|
|
|
167
|
-
|
|
168
|
-
| `<ModalContainer />` | `@nexus-cross/design-system/modal` | `modal()`
|
|
169
|
-
| `<Toaster />` | `@nexus-cross/design-system` | `toast()`
|
|
188
|
+
| Component | import | Required When | Description |
|
|
189
|
+
|---|---|---|---|
|
|
190
|
+
| `<ModalContainer />` | `@nexus-cross/design-system/modal` | Using `modal()` or `useModal()` | Modal rendering container |
|
|
191
|
+
| `<Toaster />` | `@nexus-cross/design-system` | Using `toast()` | Toast notification renderer |
|
|
170
192
|
|
|
171
193
|
```tsx
|
|
172
|
-
// layout.tsx
|
|
194
|
+
// layout.tsx or App.tsx
|
|
173
195
|
import { ModalContainer } from '@nexus-cross/design-system/modal';
|
|
174
196
|
import { Toaster } from '@nexus-cross/design-system';
|
|
175
197
|
|
|
@@ -184,87 +206,87 @@ export default function RootLayout({ children }) {
|
|
|
184
206
|
}
|
|
185
207
|
```
|
|
186
208
|
|
|
187
|
-
|
|
188
|
-
- Tooltip (
|
|
189
|
-
- Popover, Drawer, Select, Accordion
|
|
209
|
+
**Components that do NOT need global setup** (usable directly without Provider):
|
|
210
|
+
- Tooltip (Provider built-in)
|
|
211
|
+
- Popover, Drawer, Select, Accordion, and all other components
|
|
190
212
|
|
|
191
|
-
## Import
|
|
213
|
+
## Import Patterns
|
|
192
214
|
|
|
193
215
|
```tsx
|
|
194
|
-
//
|
|
216
|
+
// General components
|
|
195
217
|
import { Button, TextInput, TextArea, Select, Switch, Chip, Spinner, Divider } from '@nexus-cross/design-system';
|
|
196
218
|
|
|
197
|
-
//
|
|
219
|
+
// Overlay components
|
|
198
220
|
import { Tooltip, Popover, Drawer, Accordion } from '@nexus-cross/design-system';
|
|
199
221
|
|
|
200
|
-
//
|
|
222
|
+
// Toast
|
|
201
223
|
import { toast, Toaster } from '@nexus-cross/design-system';
|
|
202
224
|
|
|
203
|
-
//
|
|
225
|
+
// Modal system (separate subpath)
|
|
204
226
|
import { modal, useModal, ModalTemplate, ModalContainer } from '@nexus-cross/design-system/modal';
|
|
205
227
|
|
|
206
|
-
//
|
|
228
|
+
// Tokens (only when JS API is needed)
|
|
207
229
|
import { getTheme } from '@nexus-cross/tokens';
|
|
208
230
|
```
|
|
209
231
|
|
|
210
|
-
##
|
|
232
|
+
## Modal Writing Rules
|
|
211
233
|
|
|
212
|
-
|
|
234
|
+
Modal components **MUST be wrapped with `ModalTemplate`.** Do NOT create modals with plain `<div>`.
|
|
213
235
|
|
|
214
236
|
```tsx
|
|
215
|
-
//
|
|
237
|
+
// CORRECT modal
|
|
216
238
|
import { ModalTemplate } from '@nexus-cross/design-system/modal';
|
|
217
239
|
|
|
218
240
|
function MyModal({ close, resolve }: { close: () => void; resolve: (value: any) => void }) {
|
|
219
241
|
return (
|
|
220
|
-
<ModalTemplate title="
|
|
221
|
-
<p className="text-text-secondary"
|
|
222
|
-
<Button onClick={() => resolve({ confirmed: true })}
|
|
242
|
+
<ModalTemplate title="Title" close={close}>
|
|
243
|
+
<p className="text-text-secondary">Content</p>
|
|
244
|
+
<Button onClick={() => resolve({ confirmed: true })}>Confirm</Button>
|
|
223
245
|
</ModalTemplate>
|
|
224
246
|
);
|
|
225
247
|
}
|
|
226
248
|
|
|
227
|
-
//
|
|
249
|
+
// Call
|
|
228
250
|
const result = await modal({ component: MyModal });
|
|
229
251
|
```
|
|
230
252
|
|
|
231
253
|
```tsx
|
|
232
|
-
//
|
|
254
|
+
// WRONG modal — using div without ModalTemplate
|
|
233
255
|
function MyModal({ close }: { close: () => void }) {
|
|
234
256
|
return (
|
|
235
257
|
<div className="p-6 bg-white rounded-lg">
|
|
236
|
-
<h2
|
|
237
|
-
<p
|
|
258
|
+
<h2>Title</h2>
|
|
259
|
+
<p>Content</p>
|
|
238
260
|
</div>
|
|
239
261
|
);
|
|
240
262
|
}
|
|
241
263
|
```
|
|
242
264
|
|
|
243
|
-
##
|
|
265
|
+
## Toast Usage Rules
|
|
244
266
|
|
|
245
267
|
```tsx
|
|
246
268
|
import { toast } from '@nexus-cross/design-system';
|
|
247
269
|
|
|
248
|
-
toast('
|
|
249
|
-
toast.success('
|
|
250
|
-
toast.error('
|
|
251
|
-
toast.loading('
|
|
270
|
+
toast('Default message');
|
|
271
|
+
toast.success('Success!');
|
|
272
|
+
toast.error('An error occurred');
|
|
273
|
+
toast.loading('Processing...');
|
|
252
274
|
```
|
|
253
275
|
|
|
254
|
-
|
|
276
|
+
Calling `toast()` without `<Toaster />` at the root will display nothing.
|
|
255
277
|
|
|
256
|
-
##
|
|
278
|
+
## Token Usage Examples
|
|
257
279
|
|
|
258
280
|
```tsx
|
|
259
|
-
//
|
|
281
|
+
// CORRECT usage
|
|
260
282
|
<div className="bg-bg-default text-text-primary border border-border-default">
|
|
261
|
-
<Button variant="primary"
|
|
262
|
-
<TextInput placeholder="
|
|
283
|
+
<Button variant="primary">Confirm</Button>
|
|
284
|
+
<TextInput placeholder="Search..." />
|
|
263
285
|
</div>
|
|
264
286
|
|
|
265
|
-
//
|
|
287
|
+
// WRONG usage
|
|
266
288
|
<div className="bg-white text-gray-900 border border-gray-200">
|
|
267
|
-
<button className="bg-green-500 text-white px-4 py-2 rounded"
|
|
268
|
-
<input className="border border-gray-300 px-3 py-2" placeholder="
|
|
289
|
+
<button className="bg-green-500 text-white px-4 py-2 rounded">Confirm</button>
|
|
290
|
+
<input className="border border-gray-300 px-3 py-2" placeholder="Search..." />
|
|
269
291
|
</div>
|
|
270
292
|
```
|