@trading-game/design-intelligence-layer 0.8.8 → 0.9.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/AGENTS.md +2 -1
- package/README.md +15 -4
- package/dist/index.cjs +37 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +37 -37
- package/dist/index.js.map +1 -1
- package/guides/design-system-guide/trading-game-ds-guide.md +44 -5
- package/guides/rules/design-system-consuming-project.mdc +20 -1
- package/package.json +1 -1
- package/src/styles.css +3 -3
|
@@ -35,7 +35,7 @@ NEVER use:
|
|
|
35
35
|
❌ border-border — deprecated alias; use border-border-subtle or border-border-prominent
|
|
36
36
|
|
|
37
37
|
ALWAYS use semantic tokens:
|
|
38
|
-
✅ bg-
|
|
38
|
+
✅ bg-prominent, bg-card, bg-popover, bg-subtle, bg-overlay
|
|
39
39
|
✅ text-on-prominent, text-on-subtle, text-on-muted
|
|
40
40
|
✅ border-border-subtle, border-border-prominent, ring-ring
|
|
41
41
|
✅ bg-primary, bg-primary-hover, bg-secondary-hover
|
|
@@ -118,7 +118,7 @@ import { Button, Card, Badge } from "@trading-game/design-intelligence-layer"
|
|
|
118
118
|
|
|
119
119
|
| CSS Variable | Tailwind Class | Usage |
|
|
120
120
|
| ---------------- | ---------------- | ------------------------- |
|
|
121
|
-
| `--
|
|
121
|
+
| `--prominent` | `bg-prominent` | Main page background |
|
|
122
122
|
| `--card` | `bg-card` | Cards, panels, modals |
|
|
123
123
|
| `--popover` | `bg-popover` | Popovers, elevated cards |
|
|
124
124
|
| `--subtle` | `bg-subtle` | Muted / secondary surfaces|
|
|
@@ -274,8 +274,8 @@ import { Button, Card, Badge } from "@trading-game/design-intelligence-layer"
|
|
|
274
274
|
| Show LOSS / negative | `text-semantic-loss` | Any non-token red |
|
|
275
275
|
| Show WARNING / caution | `text-semantic-warning` | Raw orange hex or primary tint |
|
|
276
276
|
| Color a tab container background | `bg-tabs` | `bg-subtle` for tabs |
|
|
277
|
-
| Color an active/selected tab | `bg-tabs-active` | `bg-
|
|
278
|
-
| Color a page background | `bg-
|
|
277
|
+
| Color an active/selected tab | `bg-tabs-active` | `bg-prominent` for active tab |
|
|
278
|
+
| Color a page background | `bg-prominent` | `bg-white` directly |
|
|
279
279
|
| Color a modal/dialog backdrop | `bg-overlay` | `bg-black/50` or raw black opacity |
|
|
280
280
|
| Color a card or panel | `bg-card` | Arbitrary gray |
|
|
281
281
|
| Color an elevated surface (popover) | `bg-popover` | `bg-card` for popovers |
|
|
@@ -580,12 +580,51 @@ These are styling behaviors you can't discover from TypeScript types alone:
|
|
|
580
580
|
|
|
581
581
|
---
|
|
582
582
|
|
|
583
|
+
## 8.5 — Blocks Catalogue
|
|
584
|
+
|
|
585
|
+
> Blocks are fully composed UI sections built from design system primitives. They appear in the **Blocks** tab of the playground.
|
|
586
|
+
> - Blocks are **NOT exported** from the npm package — they are playground demonstrations only.
|
|
587
|
+
> - To build them in a consuming project, import the underlying components (`Button`, etc.) from `@trading-game/design-intelligence-layer` and compose them manually using design tokens only.
|
|
588
|
+
> - Do NOT mistake a Block for a component — it will not appear in Rule 1's component list.
|
|
589
|
+
|
|
590
|
+
### NavBar
|
|
591
|
+
|
|
592
|
+
A landing page top navigation bar with Desktop and Mobile breakpoint variants.
|
|
593
|
+
|
|
594
|
+
| Variant | Description |
|
|
595
|
+
|---------|-------------|
|
|
596
|
+
| Desktop | Full-width bar: logo left, ghost nav links centre-left, Sign in (ghost) + Sign up (primary) right |
|
|
597
|
+
| Mobile — closed | Logo left, hamburger icon-button right |
|
|
598
|
+
| Mobile — open | Logo + close icon top row; stacked ghost nav links + full-width Sign in / Sign up below a divider |
|
|
599
|
+
|
|
600
|
+
**Components used:** `Button` (variants: `ghost`, `primary`, `secondary`; sizes: `sm`, `icon-sm`)
|
|
601
|
+
|
|
602
|
+
**Tokens used:** `bg-prominent`, `bg-primary`, `border-border-subtle`, `rounded-xs`, `rounded-md`
|
|
603
|
+
|
|
604
|
+
---
|
|
605
|
+
|
|
606
|
+
### Hero
|
|
607
|
+
|
|
608
|
+
Landing page hero sections in multiple layout types.
|
|
609
|
+
|
|
610
|
+
| Variant | Description |
|
|
611
|
+
|---------|-------------|
|
|
612
|
+
| Type 1 — Desktop | Two columns: tagline pill + heading + body + Get started / Learn more CTAs left; square image panel right |
|
|
613
|
+
| Type 1 — Mobile | Single column stacked: text content centred above, image panel full-width below |
|
|
614
|
+
| Type 2 — Desktop | Centred single-column: tagline pill + heading + body + single primary CTA with `ArrowRight` icon; no image |
|
|
615
|
+
|
|
616
|
+
**Components used:** `Button` (default `sm`, `secondary sm`); `ArrowUpRight`, `ArrowRight` icons (lucide)
|
|
617
|
+
|
|
618
|
+
**Tokens used:** `bg-prominent`, `bg-subtle`, `border-border-subtle`, `text-on-prominent`, `text-on-subtle`, `bg-semantic-win`, `rounded-xl`, `rounded-full`, `px-layout-margin-inline`, `gap-layout-gutter`, `py-24`, `text-5xl`, `font-semibold`, `font-display`, `tracking-tight`, `text-lg`, `font-body`, `text-sm`, `shadow-sm`, `max-w-2xl`
|
|
619
|
+
|
|
620
|
+
---
|
|
621
|
+
|
|
583
622
|
## 9 — Common Mistakes
|
|
584
623
|
|
|
585
624
|
| Mistake | Correct Approach |
|
|
586
625
|
| ------- | ---------------- |
|
|
587
626
|
| Using hardcoded hex (`#2323FF`) for primary | Use `bg-primary` or `text-primary` |
|
|
588
|
-
| Using `bg-white` or `bg-black` | Use `bg-
|
|
627
|
+
| Using `bg-white` or `bg-black` | Use `bg-prominent` or `bg-overlay` |
|
|
589
628
|
| Using `border-border` | Use `border-border-subtle` or `border-border-prominent` |
|
|
590
629
|
| Using `bg-hover` | Use `bg-primary/[0.08]` or `bg-secondary-hover` |
|
|
591
630
|
| Using `text-primary-foreground` | Use `text-on-prominent-static-inverse` |
|
|
@@ -53,7 +53,7 @@ import { Button, Card, Badge } from "@trading-game/design-intelligence-layer"
|
|
|
53
53
|
|
|
54
54
|
#### Background tokens
|
|
55
55
|
```
|
|
56
|
-
✅ bg-
|
|
56
|
+
✅ bg-prominent — page background (white #FFFFFF)
|
|
57
57
|
✅ bg-card — card/panel surface (white #FFFFFF)
|
|
58
58
|
✅ bg-popover — popover/dropdown surface (white #FFFFFF)
|
|
59
59
|
✅ bg-subtle — subtle tinted surface (#F5F5F5)
|
|
@@ -183,6 +183,25 @@ Wait for confirmation before proceeding.
|
|
|
183
183
|
|
|
184
184
|
---
|
|
185
185
|
|
|
186
|
+
## Rule 8 — Blocks are playground-only (not package exports)
|
|
187
|
+
|
|
188
|
+
**Blocks** are pre-composed UI sections (e.g. NavBar) demonstrated in the **Blocks** tab of the design system playground. They are **not** exported from `@trading-game/design-intelligence-layer`.
|
|
189
|
+
|
|
190
|
+
```
|
|
191
|
+
❌ Do NOT import blocks from the package — they don't exist there
|
|
192
|
+
❌ Do NOT treat block names (e.g. "NavBar") as component names from Rule 1
|
|
193
|
+
✅ To build a block pattern in your project: compose it manually using package components + tokens
|
|
194
|
+
✅ Reference guides/design-system-guide/trading-game-ds-guide.md Section 8.5 for block structure
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
| Block | Playground tab | Importable? |
|
|
198
|
+
|-------|---------------|-------------|
|
|
199
|
+
| NavBar | Blocks → NavBar | No — build with `Button` + tokens |
|
|
200
|
+
| Hero (Type 1) | Blocks → Hero | No — build with `Button` + tokens; two-column layout with image panel |
|
|
201
|
+
| Hero (Type 2) | Blocks → Hero | No — build with `Button` + `ArrowRight` icon + tokens; centred single-column, no image |
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
186
205
|
## Rule 7 — Package version upgrades (stay aligned with the published design system)
|
|
187
206
|
|
|
188
207
|
When the user asks to **update**, **upgrade**, or **install the latest** `@trading-game/design-intelligence-layer`, or after the dependency version changes in `package.json`:
|
package/package.json
CHANGED
package/src/styles.css
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
/* ── Tailwind theme bridge — maps CSS vars to utility classes ── */
|
|
17
17
|
@theme inline {
|
|
18
|
-
--color-
|
|
18
|
+
--color-prominent: var(--prominent);
|
|
19
19
|
--color-on-prominent: var(--on-prominent);
|
|
20
20
|
--color-on-prominent-static-inverse: var(--on-prominent-static-inverse);
|
|
21
21
|
--font-sans: var(--font-plus-jakarta-sans);
|
|
@@ -234,7 +234,7 @@
|
|
|
234
234
|
UI role and meaning. References primitives only.
|
|
235
235
|
══════════════════════════════════════════════════════════════ */
|
|
236
236
|
:root {
|
|
237
|
-
--
|
|
237
|
+
--prominent: var(--primitive-mono-50);
|
|
238
238
|
--on-prominent: var(--primitive-mono-1000);
|
|
239
239
|
--on-prominent-static-inverse: var(--primitive-mono-50);
|
|
240
240
|
/* #FFFFFF — always white, never changes between themes */
|
|
@@ -351,7 +351,7 @@
|
|
|
351
351
|
}
|
|
352
352
|
|
|
353
353
|
body {
|
|
354
|
-
@apply bg-
|
|
354
|
+
@apply bg-prominent text-on-prominent font-sans antialiased;
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
357
|
|