@nexus-cross/design-system 1.1.1 → 2.0.0

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 (47) hide show
  1. package/claude-rules/nexus/CLAUDE.md +102 -6
  2. package/cursor-rules/CLAUDE.md +38 -9
  3. package/cursor-rules/nexus-project-setup.mdc +80 -19
  4. package/cursor-rules/nexus-ui-api.mdc +8 -2
  5. package/dist/chunks/{chunk-NZHK76R3.js → chunk-LYPBQI3Y.js} +31 -6
  6. package/dist/chunks/{chunk-6BWOKTVQ.mjs → chunk-WZFKTTVX.mjs} +31 -6
  7. package/dist/components/NxImage.d.ts.map +1 -1
  8. package/dist/index.js +22 -23
  9. package/dist/index.mjs +4 -5
  10. package/dist/modal/index.js +11 -11
  11. package/dist/modal/index.mjs +2 -2
  12. package/dist/nx-image.js +2 -2
  13. package/dist/nx-image.mjs +1 -1
  14. package/dist/tailwind-v4.css +19 -0
  15. package/dist/tokens/TOKENS.md +426 -0
  16. package/dist/tokens/company.css +410 -0
  17. package/dist/tokens/css.css +405 -0
  18. package/dist/tokens/data/borderWidth.json +38 -0
  19. package/dist/tokens/data/breakpoint.json +23 -0
  20. package/dist/tokens/data/color.json +973 -0
  21. package/dist/tokens/data/index.ts +63 -0
  22. package/dist/tokens/data/motion.json +64 -0
  23. package/dist/tokens/data/opacity.json +65 -0
  24. package/dist/tokens/data/radius.json +25 -0
  25. package/dist/tokens/data/shadow.json +76 -0
  26. package/dist/tokens/data/size.json +46 -0
  27. package/dist/tokens/data/space.json +86 -0
  28. package/dist/tokens/data/typography.json +626 -0
  29. package/dist/tokens/data/zIndex.json +22 -0
  30. package/dist/tokens/index.d.ts +11 -0
  31. package/dist/tokens/index.d.ts.map +1 -0
  32. package/dist/tokens/index.js +12 -0
  33. package/dist/tokens/index.mjs +1 -0
  34. package/dist/tokens/tailwind.js +260 -0
  35. package/dist/tokens-domains/data/index.ts +16 -0
  36. package/dist/tokens-domains/data/prediction/domain.json +324 -0
  37. package/dist/tokens-domains/index.d.ts +12 -0
  38. package/dist/tokens-domains/index.d.ts.map +1 -0
  39. package/dist/tokens-domains/index.js +12 -0
  40. package/dist/tokens-domains/index.mjs +1 -0
  41. package/dist/tokens-domains/prediction-vars.css +154 -0
  42. package/dist/tokens-domains/prediction.css +153 -0
  43. package/dist/tokens-domains/prediction.md +70 -0
  44. package/dist/tokens-domains/tailwind.js +59 -0
  45. package/package.json +27 -6
  46. package/dist/chunks/{chunk-5ZVPTIL3.mjs → chunk-3VFBPFZF.mjs} +1 -1
  47. package/dist/chunks/{chunk-7F4SOLAC.js → chunk-U53UA76K.js} +1 -1
@@ -0,0 +1,260 @@
1
+ /**
2
+ * @nexus-cross/tokens - Tailwind CSS v3 Preset
3
+ *
4
+ * data/*.json 기반으로 Tailwind v3 theme을 자동 생성합니다.
5
+ * 하드코딩 없이 JSON 데이터에서 직접 읽어 매핑합니다.
6
+ *
7
+ * 사용법:
8
+ * module.exports = {
9
+ * presets: [require('@nexus-cross/tokens/tailwind')],
10
+ * content: ['./src/**\/*.{js,jsx,ts,tsx}'],
11
+ * }
12
+ */
13
+
14
+ const colorData = require('./data/color.json');
15
+ const typographyData = require('./data/typography.json');
16
+ const spaceData = require('./data/space.json');
17
+ const shadowData = require('./data/shadow.json');
18
+ const radiusData = require('./data/radius.json');
19
+ const borderWidthData = require('./data/borderWidth.json');
20
+ const opacityData = require('./data/opacity.json');
21
+ const sizeData = require('./data/size.json');
22
+ const breakpointData = require('./data/breakpoint.json');
23
+ const motionData = require('./data/motion.json');
24
+ const zIndexData = require('./data/zIndex.json');
25
+
26
+ /**
27
+ * semantic color 키를 순회해서 { 'bg-default': 'var(--color-bg-default)' } 형태로 변환.
28
+ * 중첩 구조를 Tailwind v3의 flat 또는 nested 형태로 매핑.
29
+ */
30
+ function buildColorMap(semantic) {
31
+ const colors = {};
32
+
33
+ function traverse(obj, prefix) {
34
+ for (const [key, value] of Object.entries(obj)) {
35
+ const newKey = prefix ? `${prefix}-${key}` : key;
36
+
37
+ if (value && typeof value === 'object') {
38
+ if (value.light || value.dark || value.source) {
39
+ const cssVar = newKey.replace(/-base$/, '');
40
+ colors[cssVar] = `var(--color-${cssVar})`;
41
+ } else {
42
+ traverse(value, newKey);
43
+ }
44
+ }
45
+ }
46
+ }
47
+
48
+ traverse(semantic, '');
49
+ return colors;
50
+ }
51
+
52
+ /**
53
+ * spacing primitive를 Tailwind spacing으로 매핑
54
+ */
55
+ function buildSpacing(primitive) {
56
+ const spacing = {};
57
+ for (const [key, value] of Object.entries(primitive)) {
58
+ spacing[key] = value;
59
+ }
60
+ return spacing;
61
+ }
62
+
63
+ /**
64
+ * typography primitive에서 fontSize 매핑
65
+ */
66
+ function buildFontSize(primitive) {
67
+ const fontSize = {};
68
+ if (primitive.fontSize) {
69
+ for (const [key, value] of Object.entries(primitive.fontSize)) {
70
+ fontSize[key] = value;
71
+ }
72
+ }
73
+ return fontSize;
74
+ }
75
+
76
+ /**
77
+ * typography primitive에서 fontFamily 매핑
78
+ */
79
+ function buildFontFamily(primitive) {
80
+ const fontFamily = {};
81
+ if (primitive.fontFamily) {
82
+ for (const [key, value] of Object.entries(primitive.fontFamily)) {
83
+ fontFamily[key] = value;
84
+ }
85
+ }
86
+ return fontFamily;
87
+ }
88
+
89
+ /**
90
+ * shadow semantic에서 boxShadow 매핑 (light 기준 resolve)
91
+ */
92
+ function buildBoxShadow(shadowJson) {
93
+ const boxShadow = {};
94
+ const primitive = shadowJson.primitive || {};
95
+ const semantic = shadowJson.semantic || {};
96
+ const elevation = semantic.elevation || {};
97
+
98
+ for (const [key, def] of Object.entries(elevation)) {
99
+ if (def && def.light && def.light.source) {
100
+ const resolved = primitive[def.light.source];
101
+ if (resolved) {
102
+ boxShadow[key] = resolved;
103
+ }
104
+ }
105
+ }
106
+ return boxShadow;
107
+ }
108
+
109
+ /**
110
+ * radius semantic에서 borderRadius 매핑
111
+ */
112
+ function buildBorderRadius(radiusJson) {
113
+ const borderRadius = {};
114
+ const primitive = radiusJson.primitive || {};
115
+ const semantic = radiusJson.semantic || {};
116
+ const corner = semantic.corner || {};
117
+
118
+ for (const [key, def] of Object.entries(corner)) {
119
+ if (def && def.source !== undefined) {
120
+ const resolved = primitive[def.source];
121
+ if (resolved) {
122
+ borderRadius[key] = resolved;
123
+ }
124
+ }
125
+ }
126
+ return borderRadius;
127
+ }
128
+
129
+ /**
130
+ * borderWidth semantic에서 borderWidth 매핑
131
+ */
132
+ function buildBorderWidth(borderWidthJson) {
133
+ const result = {};
134
+ const primitive = borderWidthJson.primitive || {};
135
+ const semantic = borderWidthJson.semantic || {};
136
+ const stroke = semantic.stroke || {};
137
+
138
+ for (const [key, def] of Object.entries(stroke)) {
139
+ if (def && def.source !== undefined) {
140
+ const resolved = primitive[def.source];
141
+ if (resolved) {
142
+ result[key] = resolved;
143
+ }
144
+ }
145
+ }
146
+ return result;
147
+ }
148
+
149
+ /**
150
+ * semantic 토큰을 범용 resolve (단순 source 구조)
151
+ */
152
+ function buildSimpleSemantic(jsonData) {
153
+ const primitive = jsonData.primitive || {};
154
+ const semantic = jsonData.semantic || {};
155
+ const result = {};
156
+
157
+ function traverse(obj, prefix) {
158
+ for (const [key, value] of Object.entries(obj)) {
159
+ const newKey = prefix ? `${prefix}-${key}` : key;
160
+ if (value && typeof value === 'object') {
161
+ if (value.source !== undefined) {
162
+ const resolved = primitive[value.source];
163
+ if (resolved !== undefined) result[newKey] = String(resolved);
164
+ } else if (!value.description) {
165
+ traverse(value, newKey);
166
+ }
167
+ }
168
+ }
169
+ }
170
+
171
+ traverse(semantic, '');
172
+ return result;
173
+ }
174
+
175
+ /**
176
+ * breakpoint semantic → Tailwind screens 매핑
177
+ */
178
+ function buildScreens(breakpointJson) {
179
+ const primitive = breakpointJson.primitive || {};
180
+ const semantic = breakpointJson.semantic || {};
181
+ const screen = semantic.screen || {};
182
+ const result = {};
183
+
184
+ for (const [key, def] of Object.entries(screen)) {
185
+ if (def && def.source !== undefined) {
186
+ const resolved = primitive[def.source];
187
+ if (resolved) result[key] = resolved;
188
+ }
189
+ }
190
+ return result;
191
+ }
192
+
193
+ /**
194
+ * motion semantic → transitionDuration / transitionTimingFunction
195
+ */
196
+ function buildMotion(motionJson) {
197
+ const primitive = motionJson.primitive || {};
198
+ const semantic = motionJson.semantic || {};
199
+ const duration = {};
200
+ const timingFunction = {};
201
+
202
+ function resolveMotionSource(source) {
203
+ const parts = String(source).split('.');
204
+ let current = primitive;
205
+ for (const part of parts) {
206
+ if (current && typeof current === 'object' && current[part] !== undefined) {
207
+ current = current[part];
208
+ } else {
209
+ return null;
210
+ }
211
+ }
212
+ return typeof current === 'object' ? null : String(current);
213
+ }
214
+
215
+ function traverse(obj, prefix) {
216
+ for (const [key, value] of Object.entries(obj)) {
217
+ const newKey = prefix ? `${prefix}-${key}` : key;
218
+ if (value && typeof value === 'object') {
219
+ if (value.duration && value.duration.source !== undefined) {
220
+ const dur = resolveMotionSource(value.duration.source);
221
+ if (dur) duration[newKey] = dur;
222
+ if (value.easing && value.easing.source !== undefined) {
223
+ const eas = resolveMotionSource(value.easing.source);
224
+ if (eas) timingFunction[newKey] = eas;
225
+ }
226
+ } else if (!value.description && !value.source) {
227
+ traverse(value, newKey);
228
+ }
229
+ }
230
+ }
231
+ }
232
+
233
+ traverse(semantic, '');
234
+ return { duration, timingFunction };
235
+ }
236
+
237
+ const { duration: motionDuration, timingFunction: motionTimingFunction } = buildMotion(motionData);
238
+
239
+ module.exports = {
240
+ darkMode: 'class',
241
+ theme: {
242
+ extend: {
243
+ colors: buildColorMap(colorData.semantic),
244
+ spacing: buildSpacing(spaceData.primitive),
245
+ fontSize: buildFontSize(typographyData.primitive),
246
+ fontFamily: buildFontFamily(typographyData.primitive),
247
+ boxShadow: buildBoxShadow(shadowData),
248
+ borderRadius: buildBorderRadius(radiusData),
249
+ borderWidth: buildBorderWidth(borderWidthData),
250
+ opacity: buildSimpleSemantic(opacityData),
251
+ width: buildSimpleSemantic(sizeData),
252
+ height: buildSimpleSemantic(sizeData),
253
+ screens: buildScreens(breakpointData),
254
+ zIndex: buildSimpleSemantic(zIndexData),
255
+ transitionDuration: motionDuration,
256
+ transitionTimingFunction: motionTimingFunction,
257
+ },
258
+ },
259
+ plugins: [],
260
+ };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Domain Token Data (SSOT)
3
+ *
4
+ * ⚠️ 이 파일은 자동 생성됩니다. 직접 수정하지 마세요.
5
+ * scripts/generate-data-index.js
6
+ */
7
+
8
+ import predictionDomain from './prediction/domain.json';
9
+
10
+ export const domainRegistry: Record<string, Record<string, any>> = {
11
+ prediction: predictionDomain,
12
+ };
13
+
14
+ export { predictionDomain };
15
+
16
+ export type DomainProjectId = keyof typeof domainRegistry;
@@ -0,0 +1,324 @@
1
+ {
2
+ "$schema": "../../../tokens/src/data/schema.json",
3
+ "$comment": "Project Scoped Domain Tokens - Prediction (Semantic Mode-Aware)",
4
+ "$policy": {
5
+ "allowValue": false,
6
+ "allowedFormats": [],
7
+ "requireBothModes": true
8
+ },
9
+ "domain-market": {
10
+ "$policy": {
11
+ "allowValue": false
12
+ },
13
+ "bullish": {
14
+ "base": {
15
+ "light": {
16
+ "source": "green.400"
17
+ },
18
+ "dark": {
19
+ "source": "green.600"
20
+ }
21
+ },
22
+ "intense": {
23
+ "light": {
24
+ "source": "green.300"
25
+ },
26
+ "dark": {
27
+ "source": "green.700"
28
+ }
29
+ },
30
+ "dim": {
31
+ "light": {
32
+ "source": "green.800"
33
+ },
34
+ "dark": {
35
+ "source": "green.300"
36
+ }
37
+ },
38
+ "hover": {
39
+ "light": {
40
+ "source": "green.500"
41
+ },
42
+ "dark": {
43
+ "source": "green.700"
44
+ }
45
+ },
46
+ "pressed": {
47
+ "light": {
48
+ "source": "green.300"
49
+ },
50
+ "dark": {
51
+ "source": "green.500"
52
+ }
53
+ },
54
+ "disabled": {
55
+ "light": {
56
+ "source": "green.900"
57
+ },
58
+ "dark": {
59
+ "source": "green.200"
60
+ }
61
+ }
62
+ },
63
+ "bullish-bg": {
64
+ "base": {
65
+ "light": {
66
+ "source": "green.900"
67
+ },
68
+ "dark": {
69
+ "source": "green.200"
70
+ }
71
+ },
72
+ "hover": {
73
+ "light": {
74
+ "source": "green.800"
75
+ },
76
+ "dark": {
77
+ "source": "green.300"
78
+ }
79
+ },
80
+ "pressed": {
81
+ "light": {
82
+ "source": "green.900"
83
+ },
84
+ "dark": {
85
+ "source": "green.400"
86
+ }
87
+ }
88
+ },
89
+ "bearish": {
90
+ "base": {
91
+ "light": {
92
+ "source": "red.500"
93
+ },
94
+ "dark": {
95
+ "source": "red.500"
96
+ }
97
+ },
98
+ "intense": {
99
+ "light": {
100
+ "source": "red.400"
101
+ },
102
+ "dark": {
103
+ "source": "red.700"
104
+ }
105
+ },
106
+ "dim": {
107
+ "light": {
108
+ "source": "red.800"
109
+ },
110
+ "dark": {
111
+ "source": "red.300"
112
+ }
113
+ },
114
+ "hover": {
115
+ "light": {
116
+ "source": "red.600"
117
+ },
118
+ "dark": {
119
+ "source": "red.600"
120
+ }
121
+ },
122
+ "pressed": {
123
+ "light": {
124
+ "source": "red.300"
125
+ },
126
+ "dark": {
127
+ "source": "red.400"
128
+ }
129
+ },
130
+ "disabled": {
131
+ "light": {
132
+ "source": "red.900"
133
+ },
134
+ "dark": {
135
+ "source": "red.200"
136
+ }
137
+ }
138
+ },
139
+ "bearish-bg": {
140
+ "base": {
141
+ "light": {
142
+ "source": "red.900"
143
+ },
144
+ "dark": {
145
+ "source": "red.200"
146
+ }
147
+ },
148
+ "hover": {
149
+ "light": {
150
+ "source": "red.800"
151
+ },
152
+ "dark": {
153
+ "source": "red.300"
154
+ }
155
+ },
156
+ "pressed": {
157
+ "light": {
158
+ "source": "red.900"
159
+ },
160
+ "dark": {
161
+ "source": "red.200"
162
+ }
163
+ }
164
+ },
165
+ "flat": {
166
+ "base": {
167
+ "light": {
168
+ "source": "neutral.600"
169
+ },
170
+ "dark": {
171
+ "source": "neutral.600"
172
+ }
173
+ }
174
+ },
175
+ "on-bullish": {
176
+ "light": {
177
+ "source": "special.white"
178
+ },
179
+ "dark": {
180
+ "source": "special.black"
181
+ }
182
+ },
183
+ "on-bearish": {
184
+ "light": {
185
+ "source": "special.white"
186
+ },
187
+ "dark": {
188
+ "source": "special.black"
189
+ }
190
+ }
191
+ },
192
+ "domain-accent": {
193
+ "$policy": {
194
+ "allowValue": false
195
+ },
196
+ "primary": {
197
+ "base": {
198
+ "light": {
199
+ "source": "purple.300"
200
+ },
201
+ "dark": {
202
+ "source": "purple.400"
203
+ }
204
+ },
205
+ "intense": {
206
+ "light": {
207
+ "source": "purple.300"
208
+ },
209
+ "dark": {
210
+ "source": "purple.500"
211
+ }
212
+ },
213
+ "dim": {
214
+ "light": {
215
+ "source": "purple.800"
216
+ },
217
+ "dark": {
218
+ "source": "purple.300"
219
+ }
220
+ },
221
+ "hover": {
222
+ "light": {
223
+ "source": "purple.400"
224
+ },
225
+ "dark": {
226
+ "source": "purple.500"
227
+ }
228
+ },
229
+ "pressed": {
230
+ "light": {
231
+ "source": "purple.500"
232
+ },
233
+ "dark": {
234
+ "source": "purple.300"
235
+ }
236
+ },
237
+ "disabled": {
238
+ "light": {
239
+ "source": "purple.900"
240
+ },
241
+ "dark": {
242
+ "source": "purple.200"
243
+ }
244
+ },
245
+ "focus": {
246
+ "light": {
247
+ "source": "purple.400"
248
+ },
249
+ "dark": {
250
+ "source": "purple.500"
251
+ }
252
+ }
253
+ },
254
+ "on-primary": {
255
+ "light": {
256
+ "source": "special.white"
257
+ },
258
+ "dark": {
259
+ "source": "special.black"
260
+ }
261
+ }
262
+ },
263
+ "domain-chart": {
264
+ "$policy": {
265
+ "allowValue": true,
266
+ "allowedFormats": [
267
+ "hex",
268
+ "rgba"
269
+ ]
270
+ },
271
+ "orange": {
272
+ "base": {
273
+ "light": {
274
+ "value": "#FF6324"
275
+ },
276
+ "dark": {
277
+ "value": "#F1713D"
278
+ }
279
+ }
280
+ },
281
+ "purple": {
282
+ "base": {
283
+ "light": {
284
+ "value": "#8154FF"
285
+ },
286
+ "dark": {
287
+ "value": "#8D65FF"
288
+ }
289
+ }
290
+ },
291
+ "blue": {
292
+ "base": {
293
+ "light": {
294
+ "value": "#0F87FF"
295
+ },
296
+ "dark": {
297
+ "value": "#2391FF"
298
+ }
299
+ }
300
+ },
301
+ "yellow": {
302
+ "base": {
303
+ "light": {
304
+ "value": "#EBBE07"
305
+ },
306
+ "dark": {
307
+ "value": "#C49D01"
308
+ }
309
+ }
310
+ }
311
+ },
312
+ "domain-bg": {
313
+ "subtle": {
314
+ "base": {
315
+ "light": {
316
+ "source": "special.white"
317
+ },
318
+ "dark": {
319
+ "source": "neutral.50"
320
+ }
321
+ }
322
+ }
323
+ }
324
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @nexus-cross/design-system/tokens-domains
3
+ *
4
+ * Re-export of @nexus-cross/tokens-domains public API (JS/TS).
5
+ * Allows consumers to install only @nexus-cross/design-system and access
6
+ * domain tokens via sub-path:
7
+ * `import { getPredictionTheme } from '@nexus-cross/design-system/tokens-domains'`.
8
+ *
9
+ * Equivalent to: `import { getPredictionTheme } from '@nexus-cross/tokens-domains'`.
10
+ */
11
+ export * from '@nexus-cross/tokens-domains';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tokens-domains/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,cAAc,6BAA6B,CAAC"}
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ var tokensDomains = require('@nexus-cross/tokens-domains');
4
+
5
+
6
+
7
+ Object.keys(tokensDomains).forEach(function (k) {
8
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
9
+ enumerable: true,
10
+ get: function () { return tokensDomains[k]; }
11
+ });
12
+ });
@@ -0,0 +1 @@
1
+ export * from '@nexus-cross/tokens-domains';