@deriv-ds/design-intelligence-layer 0.1.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.
package/src/styles.css ADDED
@@ -0,0 +1,442 @@
1
+ /*
2
+ * Trading Game Design System — Design Tokens
3
+ *
4
+ * Usage in consumer apps:
5
+ * import "@trading-game/design-intelligence-layer/styles"
6
+ *
7
+ * Requires Tailwind CSS v4 in your project.
8
+ * Add `@import "@trading-game/design-intelligence-layer/styles"` in your CSS
9
+ * or import it in your JS entry point.
10
+ */
11
+
12
+ /* Fonts — Plus Jakarta Sans (all) */
13
+ @import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap");
14
+
15
+
16
+ /* ── Tailwind theme bridge — maps CSS vars to utility classes ── */
17
+ @theme inline {
18
+ --color-prominent: var(--prominent);
19
+ --color-on-prominent: var(--on-prominent);
20
+ --color-on-prominent-static-inverse: var(--on-prominent-static-inverse);
21
+ --font-sans: var(--font-plus-jakarta-sans);
22
+ --font-body: var(--font-plus-jakarta-sans);
23
+ --font-display: var(--font-plus-jakarta-sans);
24
+ --color-sidebar-ring: var(--sidebar-ring);
25
+ --color-sidebar-border: var(--sidebar-border);
26
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
27
+ --color-sidebar-accent: var(--sidebar-accent);
28
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
29
+ --color-sidebar-primary: var(--sidebar-primary);
30
+ --color-sidebar-foreground: var(--sidebar-foreground);
31
+ --color-sidebar: var(--sidebar);
32
+ --color-ring: var(--ring);
33
+ --color-input: var(--input);
34
+ --color-border: var(--border);
35
+ /* @deprecated — use border-border-subtle or border-border-prominent */
36
+ --color-border-subtle: var(--border-subtle);
37
+ --color-border-prominent: var(--border-prominent);
38
+ --color-secondary-hover: var(--secondary-hover);
39
+ --color-on-subtle: var(--on-subtle);
40
+ --color-subtle: var(--subtle);
41
+ --color-primary: var(--primary);
42
+ --color-primary-hover: var(--primary-hover);
43
+ --color-popover-foreground: var(--popover-foreground);
44
+ --color-popover: var(--popover);
45
+ --color-card-foreground: var(--card-foreground);
46
+ --color-card: var(--card);
47
+ --color-semantic-win: var(--semantic-win);
48
+ --color-semantic-loss: var(--semantic-loss);
49
+ --color-semantic-warning: var(--semantic-warning);
50
+ --color-alert-info-text: var(--alert-info-text);
51
+ --color-alert-info-border: var(--alert-info-border);
52
+ --color-alert-error-text: var(--alert-error-text);
53
+ --color-alert-error-border: var(--alert-error-border);
54
+
55
+ --color-overlay: var(--overlay);
56
+ --color-slider-range: var(--slider-range);
57
+ --color-semantic-info: var(--semantic-info);
58
+ --color-tabs: var(--tabs);
59
+ --color-tabs-active: var(--tabs-active);
60
+ --spacing-layout-gutter: var(--semantic-layout-gutter);
61
+ --spacing-layout-margin-inline: var(--semantic-layout-margin-inline);
62
+ --max-width-layout-diagram-default: var(--semantic-layout-diagram-max-default);
63
+ --max-width-layout-diagram-small: var(--semantic-layout-diagram-max-small);
64
+ --max-width-layout-diagram-medium: var(--semantic-layout-diagram-max-medium);
65
+ --radius-2xs: calc(var(--radius) - 8px);
66
+ --radius-xs: calc(var(--radius) - 6px);
67
+ --radius-sm: calc(var(--radius) - 4px);
68
+ --radius-md: calc(var(--radius) - 2px);
69
+ --radius-lg: var(--radius);
70
+ --radius-xl: calc(var(--radius) + 4px);
71
+ --radius-2xl: calc(var(--radius) + 8px);
72
+ --radius-3xl: calc(var(--radius) + 12px);
73
+ --radius-4xl: calc(var(--radius) + 16px);
74
+ /* ── Transitions — duration ── */
75
+ --duration-instant: var(--primitive-duration-instant);
76
+ --duration-fast: var(--primitive-duration-fast);
77
+ --duration-base: var(--primitive-duration-base);
78
+ --duration-slow: var(--primitive-duration-slow);
79
+ --duration-open: var(--primitive-duration-open);
80
+ --duration-blink: var(--primitive-duration-blink);
81
+ /* ── Transitions — easing ── */
82
+ --ease-standard: var(--primitive-ease-standard);
83
+ --ease-enter: var(--primitive-ease-enter);
84
+ --ease-exit: var(--primitive-ease-exit);
85
+ --ease-linear: var(--primitive-ease-linear);
86
+ }
87
+
88
+ /* ══════════════════════════════════════════════════════════════
89
+ LAYER 1 — PRIMITIVES
90
+ Raw palette values only. Never reference directly in components.
91
+ ══════════════════════════════════════════════════════════════ */
92
+ :root {
93
+ --font-plus-jakarta-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
94
+ --radius: 0.625rem;
95
+
96
+ /* ── Blue scale ── */
97
+ --primitive-blue-50: oklch(0.93 0.05 267);
98
+ /* #E6E6FF */
99
+ --primitive-blue-100: oklch(0.77 0.14 267);
100
+ /* #B8B8FF */
101
+ --primitive-blue-200: oklch(0.66 0.21 267);
102
+ /* #8A8AFF */
103
+ --primitive-blue-300: oklch(0.57 0.26 267);
104
+ /* #5C5CFF */
105
+ --primitive-blue-400: oklch(0.51 0.285 267);
106
+ /* #3939FF */
107
+ --primitive-blue-500: oklch(0.476 0.297 267.4);
108
+ /* #2323FF — brand blue */
109
+ --primitive-blue-600: oklch(0.40 0.27 265);
110
+ /* #0B0BD2 */
111
+ --primitive-blue-700: oklch(0.31 0.21 264);
112
+ /* #0000A5 */
113
+ --primitive-blue-800: oklch(0.23 0.16 264);
114
+ /* #000078 */
115
+ --primitive-blue-900: oklch(0.15 0.10 264);
116
+ /* #00004C */
117
+ --primitive-blue-1000: oklch(0.07 0.05 264);
118
+ /* #00001F */
119
+
120
+ /* ── Monochrome scale ── */
121
+ --primitive-mono-50: oklch(1 0 0);
122
+ /* #FFFFFF */
123
+ --primitive-mono-100: oklch(0.95 0 0);
124
+ /* #EEEEEE */
125
+ --primitive-mono-200: oklch(0.90 0 0);
126
+ /* #EEEEEE */
127
+ --primitive-mono-300: oklch(0.84 0 0);
128
+ /* #CCCCCC */
129
+ --primitive-mono-400: oklch(0.79 0 0);
130
+ /* #BBBBBB */
131
+ --primitive-mono-500: oklch(0.74 0 0);
132
+ /* #AAAAAA */
133
+ --primitive-mono-600: oklch(0.63 0 0);
134
+ /* #888888 */
135
+ --primitive-mono-700: oklch(0.51 0 0);
136
+ /* #666666 */
137
+ --primitive-mono-800: oklch(0.39 0 0);
138
+ /* #444444 */
139
+ --primitive-mono-900: oklch(0.25 0 0);
140
+ /* #222222 */
141
+ --primitive-mono-1000: oklch(0 0 0);
142
+ /* #000000 */
143
+
144
+ /* ── Green ── */
145
+ --primitive-green-400: oklch(0.492 0.162 144);
146
+ /* #008832 */
147
+
148
+ /* ── Sky ── */
149
+ --primitive-sky-600: #3DAAFF;
150
+ /* #3DAAFF */
151
+
152
+ /* ── Red ── */
153
+ --primitive-red-600: #F92E26;
154
+ /* #F92E26 */
155
+ --primitive-red-500: oklch(0.653 0.234 18.5);
156
+ /* #FF3355 */
157
+
158
+ /* ── Orange ── */
159
+ --primitive-orange-600: oklch(0.52 0.168 38);
160
+ /* #D45200 */
161
+ --primitive-orange-500: oklch(0.62 0.185 38);
162
+ /* #FF6600 */
163
+ --primitive-orange-400: oklch(0.751 0.179 58.3);
164
+ /* #FF8C00 */
165
+
166
+ /* ── Violet ── */
167
+ --primitive-violet-500: oklch(0.601 0.263 301.6);
168
+ /* #A040FF */
169
+
170
+ /* ── Mono alpha scale ── */
171
+ --primitive-mono-alpha-4: oklch(0 0 0 / 4%);
172
+ --primitive-mono-alpha-8: oklch(0 0 0 / 8%);
173
+ --primitive-mono-alpha-16: oklch(0 0 0 / 16%);
174
+ --primitive-mono-alpha-24: oklch(0 0 0 / 24%);
175
+ --primitive-mono-alpha-32: oklch(0 0 0 / 32%);
176
+ --primitive-mono-alpha-40: oklch(0 0 0 / 40%);
177
+ --primitive-mono-alpha-50: oklch(0 0 0 / 50%);
178
+ --primitive-mono-alpha-64: oklch(0 0 0 / 64%);
179
+ --primitive-mono-alpha-80: oklch(0 0 0 / 80%);
180
+
181
+ /* ── Blue alpha scale ── */
182
+ --primitive-blue-alpha-4: oklch(0.476 0.297 267.4 / 4%);
183
+ --primitive-blue-alpha-8: oklch(0.476 0.297 267.4 / 8%);
184
+ --primitive-blue-alpha-16: oklch(0.476 0.297 267.4 / 16%);
185
+ --primitive-blue-alpha-24: oklch(0.476 0.297 267.4 / 24%);
186
+ --primitive-blue-alpha-32: oklch(0.476 0.297 267.4 / 32%);
187
+ --primitive-blue-alpha-40: oklch(0.476 0.297 267.4 / 40%);
188
+ --primitive-blue-alpha-50: oklch(0.476 0.297 267.4 / 50%);
189
+ --primitive-blue-alpha-64: oklch(0.476 0.297 267.4 / 64%);
190
+ --primitive-blue-alpha-80: oklch(0.476 0.297 267.4 / 80%);
191
+
192
+ /* ── Overlay ── */
193
+ --primitive-black-50: var(--primitive-mono-alpha-50);
194
+ /* @deprecated — use --primitive-mono-alpha-50 */
195
+
196
+ /* ── Transitions — Duration scale ── */
197
+ --primitive-duration-instant: 50ms;
198
+ /* snap: focus rings, hover colour tints */
199
+ --primitive-duration-fast: 100ms;
200
+ /* micro: buttons, badges, inputs, checkboxes */
201
+ --primitive-duration-base: 200ms;
202
+ /* surface: dropdowns, tooltips, popovers, accordions */
203
+ --primitive-duration-slow: 300ms;
204
+ /* overlay close: sheets, drawers, dialogs closing */
205
+ --primitive-duration-open: 500ms;
206
+ /* overlay open: sheets, drawers entering */
207
+ --primitive-duration-blink: 1000ms;
208
+ /* special: OTP caret blink animation */
209
+
210
+ /* ── Transitions — Easing scale ── */
211
+ --primitive-ease-standard: cubic-bezier(0.2, 0, 0, 1);
212
+ /* general UI — most interactive elements */
213
+ --primitive-ease-enter: cubic-bezier(0, 0, 0.2, 1);
214
+ /* decelerates — elements entering the screen */
215
+ --primitive-ease-exit: cubic-bezier(0.4, 0, 1, 1);
216
+ /* accelerates — elements leaving the screen */
217
+ --primitive-ease-linear: linear;
218
+ /* constant speed — sidebar width, progress bar */
219
+
220
+ /* ── Layout — Standard responsive grid (gutter / margin) ── */
221
+ --primitive-layout-gutter-none: 0px;
222
+ --primitive-layout-gutter-sm: 16px;
223
+ --primitive-layout-gutter-md: 36px;
224
+ --primitive-layout-margin-sm: 16px;
225
+ --primitive-layout-margin-md: 36px;
226
+ --primitive-layout-margin-lg: 64px;
227
+ --primitive-layout-diagram-max-default: 319px;
228
+ --primitive-layout-diagram-max-small: 599px;
229
+ --primitive-layout-diagram-max-medium: 1135px;
230
+ }
231
+
232
+ /* ══════════════════════════════════════════════════════════════
233
+ LAYER 2 — SEMANTICS
234
+ UI role and meaning. References primitives only.
235
+ ══════════════════════════════════════════════════════════════ */
236
+ :root {
237
+ --prominent: var(--primitive-mono-50);
238
+ --on-prominent: var(--primitive-mono-1000);
239
+ --on-prominent-static-inverse: var(--primitive-mono-50);
240
+ /* #FFFFFF — always white, never changes between themes */
241
+ --primary: var(--primitive-blue-500);
242
+ --primary-hover: oklch(0.403 0.251 267.5);
243
+ --subtle: oklch(0.96 0 0);
244
+ --on-subtle: oklch(0.52 0 0);
245
+
246
+ --border-subtle: oklch(0.92 0 0);
247
+ --border: var(--border-subtle);
248
+ /* @deprecated alias — use --border-subtle or --border-prominent */
249
+ --border-prominent: var(--primitive-mono-1000);
250
+ /* #000000 */
251
+ --secondary-hover: var(--primitive-mono-100);
252
+ /* #EEEEEE */
253
+ --ring: var(--primitive-blue-500);
254
+ --overlay: var(--primitive-black-50);
255
+ --semantic-win: var(--primitive-green-400);
256
+ --semantic-loss: var(--primitive-red-500);
257
+ --semantic-info: var(--primitive-sky-600);
258
+ --semantic-error: var(--primitive-red-600);
259
+ --semantic-warning: var(--primitive-orange-500);
260
+ --tabs: var(--primitive-mono-alpha-4);
261
+ --tabs-active: var(--primitive-mono-50);
262
+ --semantic-layout-diagram-max-default: var(--primitive-layout-diagram-max-default);
263
+ --semantic-layout-diagram-max-small: var(--primitive-layout-diagram-max-small);
264
+ --semantic-layout-diagram-max-medium: var(--primitive-layout-diagram-max-medium);
265
+
266
+ /* ── Transitions — Semantic duration ── */
267
+ --transition-duration-interactive: var(--primitive-duration-fast);
268
+ /* buttons, inputs, badges, checkboxes, toggles, tabs hover */
269
+ --transition-duration-surface: var(--primitive-duration-base);
270
+ /* dropdowns, popovers, tooltips, accordions, navigation menus */
271
+ --transition-duration-overlay-close: var(--primitive-duration-slow);
272
+ /* dialogs, sheets, drawers, alert-dialogs closing */
273
+ --transition-duration-overlay-open: var(--primitive-duration-open);
274
+ /* sheets, drawers entering */
275
+ --transition-duration-structural: var(--primitive-duration-base);
276
+ /* sidebar collapse, progress fill, layout changes */
277
+
278
+ /* ── Transitions — Semantic easing ── */
279
+ --transition-ease-interactive: var(--primitive-ease-standard);
280
+ /* buttons, inputs — bidirectional state changes */
281
+ --transition-ease-enter: var(--primitive-ease-enter);
282
+ /* overlays / surfaces entering */
283
+ --transition-ease-exit: var(--primitive-ease-exit);
284
+ /* overlays / surfaces leaving */
285
+ --transition-ease-structural: var(--primitive-ease-linear);
286
+ /* sidebar, progress — constant-speed structural changes */
287
+ }
288
+
289
+ /* ══════════════════════════════════════════════════════════════
290
+ RESPONSIVE LAYOUT — Standard grid (columns / gutter / margin)
291
+ ══════════════════════════════════════════════════════════════ */
292
+ :root {
293
+ --semantic-layout-grid-columns: 1;
294
+ --semantic-layout-gutter: var(--primitive-layout-gutter-none);
295
+ --semantic-layout-margin-inline: var(--primitive-layout-margin-sm);
296
+ }
297
+
298
+ @media (min-width: 320px) {
299
+ :root {
300
+ --semantic-layout-grid-columns: 4;
301
+ --semantic-layout-gutter: var(--primitive-layout-gutter-sm);
302
+ --semantic-layout-margin-inline: var(--primitive-layout-margin-sm);
303
+ }
304
+ }
305
+
306
+ @media (min-width: 600px) {
307
+ :root {
308
+ --semantic-layout-grid-columns: 8;
309
+ --semantic-layout-gutter: var(--primitive-layout-gutter-md);
310
+ --semantic-layout-margin-inline: var(--primitive-layout-margin-md);
311
+ }
312
+ }
313
+
314
+ @media (min-width: 1136px) {
315
+ :root {
316
+ --semantic-layout-grid-columns: 12;
317
+ --semantic-layout-gutter: var(--primitive-layout-gutter-md);
318
+ --semantic-layout-margin-inline: var(--primitive-layout-margin-lg);
319
+ }
320
+ }
321
+
322
+ /* ══════════════════════════════════════════════════════════════
323
+ LAYER 3 — COMPONENTS
324
+ Component-specific tokens. References semantics or primitives.
325
+ ══════════════════════════════════════════════════════════════ */
326
+ :root {
327
+ --card: var(--primitive-mono-50);
328
+ --card-foreground: oklch(0.07 0.012 165);
329
+ --popover: var(--primitive-mono-50);
330
+ --popover-foreground: oklch(0.07 0.012 165);
331
+ --input: var(--border-subtle);
332
+ --alert-info-text: var(--semantic-info);
333
+ --alert-info-border: var(--semantic-info);
334
+ --alert-error-text: var(--semantic-error);
335
+ --alert-error-border: var(--semantic-error);
336
+ --slider-range: oklch(0.476 0.297 267.4 / 40%);
337
+ --sidebar: var(--primitive-mono-50);
338
+ --sidebar-foreground: oklch(0.07 0.012 165);
339
+ --sidebar-primary: var(--primary);
340
+ --sidebar-primary-foreground: var(--primitive-mono-50);
341
+ --sidebar-accent: oklch(0.96 0 0);
342
+ --sidebar-accent-foreground: oklch(0.12 0.015 160);
343
+ --sidebar-border: oklch(0.92 0 0);
344
+ --sidebar-ring: var(--ring);
345
+ }
346
+
347
+ @layer base {
348
+ * {
349
+ border-color: var(--color-border-subtle);
350
+ outline-color: color-mix(in oklch, var(--color-ring) 50%, transparent);
351
+ }
352
+
353
+ body {
354
+ @apply bg-prominent text-on-prominent font-sans antialiased;
355
+ }
356
+ }
357
+
358
+ /* Spinner — pill-style activity indicator */
359
+ @keyframes spinner-fade {
360
+ 0% {
361
+ opacity: 1;
362
+ }
363
+
364
+ 100% {
365
+ opacity: 0.2;
366
+ }
367
+ }
368
+
369
+ /* Typography — Heading scale (Plus Jakarta Sans · Semibold 600 · LS 1.5px) */
370
+ .heading-h1 {
371
+ font-family: var(--font-plus-jakarta-sans);
372
+ font-weight: 600;
373
+ font-size: 72px;
374
+ line-height: 72px;
375
+ letter-spacing: 1.5px;
376
+ text-transform: uppercase;
377
+ }
378
+
379
+ .heading-h2 {
380
+ font-family: var(--font-plus-jakarta-sans);
381
+ font-weight: 600;
382
+ font-size: 64px;
383
+ line-height: 64px;
384
+ letter-spacing: 1.5px;
385
+ text-transform: uppercase;
386
+ }
387
+
388
+ .heading-h3 {
389
+ font-family: var(--font-plus-jakarta-sans);
390
+ font-weight: 600;
391
+ font-size: 48px;
392
+ line-height: 48px;
393
+ letter-spacing: 1.5px;
394
+ text-transform: uppercase;
395
+ }
396
+
397
+ .heading-h4 {
398
+ font-family: var(--font-plus-jakarta-sans);
399
+ font-weight: 600;
400
+ font-size: 40px;
401
+ line-height: 40px;
402
+ letter-spacing: 1.5px;
403
+ text-transform: uppercase;
404
+ }
405
+
406
+ .heading-xs {
407
+ font-family: var(--font-plus-jakarta-sans);
408
+ font-weight: 600;
409
+ font-size: 24px;
410
+ line-height: 24px;
411
+ letter-spacing: 1.5px;
412
+ text-transform: uppercase;
413
+ }
414
+
415
+ /* Typography — Body scale (Plus Jakarta Sans · Semibold 600) */
416
+ .body-lg {
417
+ font-family: var(--font-plus-jakarta-sans);
418
+ font-weight: 600;
419
+ font-size: 18px;
420
+ line-height: 28px;
421
+ }
422
+
423
+ .body-md {
424
+ font-family: var(--font-plus-jakarta-sans);
425
+ font-weight: 600;
426
+ font-size: 16px;
427
+ line-height: 24px;
428
+ }
429
+
430
+ .body-sm {
431
+ font-family: var(--font-plus-jakarta-sans);
432
+ font-weight: 600;
433
+ font-size: 12px;
434
+ line-height: 16px;
435
+ }
436
+
437
+ .body-xs {
438
+ font-family: var(--font-plus-jakarta-sans);
439
+ font-weight: 600;
440
+ font-size: 8px;
441
+ line-height: 12px;
442
+ }