@trading-game/design-intelligence-layer 1.0.0 → 1.0.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/AGENTS.md +8 -5
- package/README.md +13 -9
- package/dist/index.cjs +938 -371
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +84 -14
- package/dist/index.d.ts +84 -14
- package/dist/index.js +952 -388
- package/dist/index.js.map +1 -1
- package/docs/components/badge.md +2 -2
- package/docs/components/bottom-navigation.md +1 -1
- package/docs/components/breadcrumb.md +1 -1
- package/docs/components/calendar.md +7 -7
- package/docs/components/card.md +2 -2
- package/docs/components/dialog.md +3 -3
- package/docs/components/empty.md +1 -1
- package/docs/components/input-otp.md +3 -3
- package/docs/components/item.md +1 -1
- package/docs/components/link.md +1 -1
- package/docs/components/navigation-button.md +2 -2
- package/docs/components/progress.md +42 -25
- package/docs/components/radio-group.md +1 -1
- package/docs/components/select.md +1 -1
- package/docs/components/sheet.md +2 -2
- package/docs/components/slide-to-confirm.md +68 -0
- package/docs/components/stepper.md +29 -37
- package/docs/components/steps.md +77 -0
- package/docs/components/switch.md +1 -1
- package/docs/components/tabs.md +1 -1
- package/docs/components/toggle.md +46 -13
- package/docs/foundations/colors.md +2 -1
- package/docs/foundations/shape-layout.md +1 -1
- package/docs/patterns/forms.md +1 -1
- package/package.json +3 -2
- package/src/styles.css +172 -10
- package/docs/components/toggle-group.md +0 -77
package/AGENTS.md
CHANGED
|
@@ -7,7 +7,7 @@ Rules of engagement for AI agents building with `@trading-game/design-intelligen
|
|
|
7
7
|
1. **Semantic colour tokens only.** Classes like `bg-background-brand-default`, `text-text-subtle-default`, `border-border-default-default`. Never hex, never `bg-blue-500`, never primitives — except alpha primitives for glazes/glass (`bg-(--primitive-white-alpha-24)`).
|
|
8
8
|
2. **Never use deprecated aliases** (`bg-prominent`, `text-on-subtle`, `border-subtle`, `bg-primary`, `text-primary`, `ring-ring`, `bg-subtle`, `secondary-hover`, `destructive`, mono-alpha). They exist only for un-migrated external consumers and die at v1.0.
|
|
9
9
|
3. **No bold.** Semibold (600) is the maximum weight in any component or component-adjacent UI. 700/800 belong to the foundation heading scale only.
|
|
10
|
-
4. **No shadows** on inline components — elevation = hairline borders + surface steps.
|
|
10
|
+
4. **No shadows** on inline components — elevation = hairline borders + surface steps. Exactly **two** sanctioned exceptions, both named tokens: **floating mobile chrome** (Bottom Navigation) carries the soft ambient `shadow-chrome-default` lift, and the **Slide to Confirm handle** carries `shadow-brand-glow` so a committed money action reads as liftable off its track. Both come from the Refined spec. Never add any other shadow, and never reuse these two tokens elsewhere.
|
|
11
11
|
5. **Surfaces are solid.** Alpha is only for state layers on top of a solid base: hover/pressed glazes, glass, scrims, selection washes (light theme only).
|
|
12
12
|
6. **Selection states use the selected family**: `bg-background-brand-selected` + `text-text-brand-selected` + `border-border-brand-selected`. Never `brand-default/10` washes, never `text-brand-default` as selected ink — those fail in dark.
|
|
13
13
|
7. **Dark is not a mirror.** Never build a light-theme construction and assume it inverts. If a token pair doesn't exist for what you need, stop and ask — don't improvise per-theme values in a component.
|
|
@@ -23,6 +23,7 @@ Rules of engagement for AI agents building with `@trading-game/design-intelligen
|
|
|
23
23
|
- **Menus**: Command, Context Menu, Dropdown Menu, Menubar, and Select rows share one look (`--menu-*` family): `rounded-lg` surface panel + hairline, `type-menu-item` rows with the hover glaze, `type-menu-heading` group labels. See [docs/patterns/menus.md](./docs/patterns/menus.md).
|
|
24
24
|
- **On brand/art surfaces**: use the `on-brand` variants (Button `primary/secondary/tertiary-on-brand`, Input/InputGroup `variant="on-brand"`, Link `tone="on-brand"`) and the frost recipe (`variant="frosted-on-brand"` on Button, NavigationButton, and Card); on page surfaces the tinted counterpart is Button `variant="frosted"`. See [docs/patterns/on-brand.md](./docs/patterns/on-brand.md).
|
|
25
25
|
- **State layers**: hover = `bg-background-hover-default` glaze; pressed = `bg-background-pressed-default`; brand fills derive hover/press via the built-in `brand-hover`/`brand-pressed` recipes.
|
|
26
|
+
- **Page canvas**: the app shell paints the page background once — plain `bg-background-primary-canvas`, or the tinted screen background via `background: var(--background-tinted-canvas)` (a layered gradient token; not a `bg-*` utility). Components never set the page background. See the demo's Canvas foundation page.
|
|
26
27
|
|
|
27
28
|
## Anti-patterns (seen in the wild — don't repeat)
|
|
28
29
|
|
|
@@ -48,7 +49,7 @@ Docs: `docs/components/<kebab-name>.md` for every entry.
|
|
|
48
49
|
| Breadcrumb | Hierarchical location trail |
|
|
49
50
|
| Button | All actions; variants primary / secondary / tertiary / on-brand family / frosted + frosted-on-brand; `shimmer` modifier for headline CTAs |
|
|
50
51
|
| Calendar | Date and range picking with themed dropdown month/year navigation |
|
|
51
|
-
| Card | Content shells (`default`, `frosted-on-brand
|
|
52
|
+
| Card | Content shells (`default`, `frosted` tint for page surfaces, `frosted-on-brand` for art/brand, `interactive` hover-lift); blank by design, slots supply content |
|
|
52
53
|
| Carousel | Horizontally scrolling content (mobile catalogue) |
|
|
53
54
|
| Chip | Compact choice pills: quick amounts, single-select filters, outline error-recovery |
|
|
54
55
|
| Checkbox | Boolean form input |
|
|
@@ -68,7 +69,7 @@ Docs: `docs/components/<kebab-name>.md` for every entry.
|
|
|
68
69
|
| Link | Inline/standalone links — quiet at rest, underline + darker ink on hover; `tone="on-brand"` |
|
|
69
70
|
| Menubar | Horizontal app menu bar (menu family) |
|
|
70
71
|
| Native Select | Styled native `<select>` for OS-native picking; same rail as Input |
|
|
71
|
-
| Navigation Button | Circular icon-only nav control; `frosted-on-brand` variant for art surfaces |
|
|
72
|
+
| Navigation Button | Circular icon-only nav control — tinted at rest, one step darker on hover; `frosted-on-brand` variant for art surfaces. Dialog and Sheet close buttons compose it rather than hand-rolling a circle |
|
|
72
73
|
| Navigation Menu | Marketing-style nav with dropdown panels (menu family type) |
|
|
73
74
|
| Numpad | Mobile amount-entry tray: bare 3×4 grid, emits keys, long-press backspace clears |
|
|
74
75
|
| Pagination | Page navigation; circular cells, brand-selected active page |
|
|
@@ -86,13 +87,15 @@ Docs: `docs/components/<kebab-name>.md` for every entry.
|
|
|
86
87
|
| Skeleton | Loading placeholders (solid secondary surface, pulse) |
|
|
87
88
|
| Slider | Value selection on a track; circular brand thumb |
|
|
88
89
|
| Spinner | Loading indicator (currentColor, 8-blade fade) |
|
|
89
|
-
|
|
|
90
|
+
| Slide to Confirm | Swipe-to-commit for irreversible money actions (withdraw, transfer) |
|
|
91
|
+
| Stepper | The mobile amount tray — frosted −/+ circles around a centred editable amount |
|
|
92
|
+
| Steps | Progress rail: numbered / onboarding / status timelines; circle or square, horizontal or vertical |
|
|
90
93
|
| Switch | On/off toggle; brand track when checked, static white thumb |
|
|
91
94
|
| Table | Data tables; 14px cells, medium heads, hover glaze rows |
|
|
92
95
|
| Tabs | Segmented control (`default` pill-on-track) or underline (`line`) |
|
|
93
96
|
| Textarea | Multi-line text (mirrors Input md) |
|
|
94
97
|
| Toast | Transient notifications (sonner, inverse surface) |
|
|
95
|
-
| Toggle / Toggle Group |
|
|
98
|
+
| Toggle / Toggle Group | Chip-treatment pressed buttons; the group joins them into segmented sets — one docs page (`toggle.md`) |
|
|
96
99
|
| Tooltip | Hover hints; inverse surface default, bordered-white `inverse` variant; renders as a Drawer on mobile |
|
|
97
100
|
|
|
98
101
|
**Blocks** (`components/blocks/`: NavBar, Hero, Auth, FAQ, Header Navigation, Open Positions, Result, Game Loading) are pre-composed sections — currently awaiting their token-migration pass; prefer components until then.
|
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Champion Trade Design System
|
|
2
2
|
|
|
3
|
-
The component library and token architecture for **Champion Trade** (formerly Trading Game) — a Tailwind CSS v4 + React design system with a strict semantic token layer, per-component typography tokens, light and dark themes, and
|
|
3
|
+
The component library and token architecture for **Champion Trade** (formerly Trading Game) — a Tailwind CSS v4 + React design system with a strict semantic token layer, per-component typography tokens, light and dark themes, and 59 production components.
|
|
4
4
|
|
|
5
|
-
> **Package name:**
|
|
5
|
+
> **Package name:** published as `@trading-game/design-intelligence-layer`. The Champion Trade npm scope rename is parked for a future major — install and import under the current name below.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -74,11 +74,15 @@ React 18+, ReactDOM, Tailwind CSS v4+.
|
|
|
74
74
|
|
|
75
75
|
## What's inside
|
|
76
76
|
|
|
77
|
-
- **
|
|
78
|
-
- **Three-layer token architecture** — primitives → semantics → component type tokens; components consume semantic colour tokens only
|
|
79
|
-
- **
|
|
80
|
-
- **
|
|
81
|
-
- **
|
|
77
|
+
- **59 components** — forms, overlays, menus, navigation, data display, plus trading-specific pieces (Numpad, the Stepper amount tray, Slide to Confirm, Steps timelines, Bottom Navigation with its liquid selection bubble + AI circle, Profile Photo)
|
|
78
|
+
- **Three-layer token architecture** — primitives → semantics → component type tokens; components consume semantic colour tokens only, and `npm run check:tokens` fails the build on any drift (undocumented tokens, primitives in components, alpha-modified colour constructions)
|
|
79
|
+
- **Three-layer motion system** — duration/easing primitives → semantic roles (hover, press, surface, overlay) → named signature moves (the liquid travel spring, the arrival pop); overlay animations ship with the package
|
|
80
|
+
- **Light + dark themes** — dark is designed, not mirrored: its own surface mixes, selection fills, and ink steps; every selected/current-state marker (calendar today, breadcrumb page, links, radio, nav bubble) speaks the brand-selected ink family in dark
|
|
81
|
+
- **Tinted canvas** — the signature screen background (`--background-tinted-canvas`): a blue aurora melting into the canvas, pure token math, applied once on the page root
|
|
82
|
+
- **The frosted family** — `variant="frosted"` (brand-tinted glass on page surfaces) and `variant="frosted-on-brand"` (white frost on art) across Button, NavigationButton, and Card
|
|
83
|
+
- **No shadows** — elevation is hairlines and surface steps, with two sanctioned exceptions: the Bottom Navigation's floating-chrome lift and the Slide to Confirm handle's brand glow
|
|
84
|
+
- **Pill shape system** — buttons and chips are pills, icon buttons are circles, cards 18px, menus 10px, form fields 4px; every control on the 32/40/48 rail
|
|
85
|
+
- **AI-readable in `node_modules`** — AGENTS.md, all 58 component pages (Toggle and Toggle Group share one), foundations, and patterns ship inside the npm tarball
|
|
82
86
|
- **TypeScript, ESM + CJS**
|
|
83
87
|
|
|
84
88
|
## Documentation
|
|
@@ -91,7 +95,7 @@ React 18+, ReactDOM, Tailwind CSS v4+.
|
|
|
91
95
|
| [docs/foundations/shape-layout.md](./docs/foundations/shape-layout.md) | The 32/40/48 size rail, radius system, spacing, grid |
|
|
92
96
|
| [docs/foundations/motion.md](./docs/foundations/motion.md) | The three-layer motion system: primitives → semantic roles → signature moves |
|
|
93
97
|
| [docs/components/](./docs/components/) | One page per component: API, variants, tokens consumed, behaviour, do/don't |
|
|
94
|
-
| [docs/patterns/](./docs/patterns/) | Forms (Field cascade), menus (shared family), on-brand surfaces &
|
|
98
|
+
| [docs/patterns/](./docs/patterns/) | Forms (Field cascade), menus (shared family), on-brand surfaces & the frosted recipe |
|
|
95
99
|
|
|
96
100
|
## Demo app
|
|
97
101
|
|
|
@@ -105,4 +109,4 @@ npm run dev # Next.js demo at http://localhost:4000 — every component, light
|
|
|
105
109
|
npm install @trading-game/design-intelligence-layer@latest --safe-chain-skip-minimum-package-age
|
|
106
110
|
```
|
|
107
111
|
|
|
108
|
-
Deprecated token aliases and component aliases (e.g. Input `variant="inverse"`, NativeSelect `size="default"`) keep working
|
|
112
|
+
Deprecated token aliases and component aliases (e.g. Button `variant="glass"` → `frosted-on-brand`, Input `variant="inverse"`, NativeSelect `size="default"`) keep working throughout 1.x; they are removed in one breaking sweep at the **next major**, alongside the Champion Trade package rename.
|