@trading-game/design-intelligence-layer 0.15.4 → 0.16.1

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.
@@ -520,11 +520,12 @@ import { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, Dialog
520
520
  | Component | Tag | Sub-components |
521
521
  |-----------|-----|----------------|
522
522
  | Accordion | [composed] | AccordionItem, AccordionTrigger, AccordionContent |
523
- | Alert | [composed] | AlertTitle, AlertDescription |
523
+ | Alert | [simple] | — (flat-prop API: `variant`, `layout`, `title`, `description`, `icon`, `action`, `actions`, `onDismiss`, `dismissLabel`) — **status** notifications only; for promo use `Banner` |
524
524
  | AlertDialog | [complex] | AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, AlertDialogMedia |
525
525
  | AspectRatio | [simple] | — |
526
526
  | Avatar | [composed] | AvatarImage, AvatarFallback, AvatarBadge, AvatarGroup, AvatarGroupCount |
527
527
  | Badge | [simple] | — |
528
+ | Banner | [simple] | — (flat-prop API: `layout`, `title`, `description`, `icon`, `action`, `actions`, `onDismiss`, `dismissLabel`, `onClick`) |
528
529
  | Breadcrumb | [composed] | BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis |
529
530
  | Button | [simple] | — |
530
531
  | Calendar | [complex] | — |
@@ -604,7 +605,9 @@ These are styling behaviors you can't discover from TypeScript types alone:
604
605
  | Slider | Thumb: square `rounded-[4px]`, `bg-primary`. Track range: `bg-slider-range` |
605
606
  | Dialog/Sheet | Footer buttons should use `size="md"`. Overlay: `bg-overlay` |
606
607
  | Menubar | Hover: `bg-primary/[0.08]`. Open state: `bg-primary/10` |
607
- | Badge | Variants: `default` (solid blue), `default-success`, `default-fail`, `default-warning` (all use `bg-semantic-*` + matching `text-on-semantic-*` foreground); `fill` (blue tint), `fill-success`, `fill-fail`, `fill-warning`; `fill-boost` (amber-orange tint — `bg-semantic-boost/16` bg + `text-on-semantic-boost` foreground — use for boost/bonus labels, always pair with a `Rocket` icon); `outline`; `ghost`, `ghost-success`, `ghost-fail`. Base class no longer applies `tracking-wide` — letter spacing is default. |
608
+ | Alert | Dismissible **status** notification. Flat-prop API — pass `title` / `description` / `icon` / `action` / `actions` / `onDismiss` directly; no sub-components. (Promotional / marketing surfaces belong on `Banner`.) **Variants:** `info` (`bg-semantic-info/10`), `warning` (`bg-semantic-warning/10`), `danger` (`bg-semantic-error/10`), `success` (`bg-semantic-win/10`). **Layouts:** `inline` (single row: icon · body · optional action · close X) and `card` (icon · body · close X top-right; up to 2 buttons at bottom-left). **Buttons:** `action` (inline, max 1) and `actions` (card, max 2). Strings get wrapped as `Button variant="secondary" size="sm"`; React elements pass through. **Title colour:** `text-on-prominent` across all variants. **Icon colour:** the variant accent (`text-semantic-info` etc.) carries the severity signal; pass `icon={null}` to omit, or any `ReactNode` to override the per-variant default (`Info`, `AlertTriangle`, `XCircle`, `CheckCircle2`). **Single-line height:** `min-h-12` (48px floor) when only `title` or only `description` is provided in inline layout; grows when content wraps on narrow viewports. **Dismiss:** controlled — `onDismiss` callback; parent owns visibility. **A11y:** `role="alert"` + `aria-live="assertive"` for `danger`/`warning`; `role="status"` + `aria-live="polite"` for `info`/`success`. |
609
+ | Banner | Dismissible **promotional / marketing** surface — feature launches, offers, onboarding nudges, cross-promo. Single visual treatment (no severity variants); for status messages use `Alert`. Flat-prop API: `layout`, `title`, `description`, `icon`, `action`, `actions`, `onDismiss`, `dismissLabel`, `onClick`. **Surface:** 135° diagonal gradient `#EBEBFF → #FFFFFF` with `border-primary/20` light-blue edge, `rounded-md`, `px-4 py-3.5`. **Layouts:** `inline` (icon · body · optional action · close X, single row) and `card` (body row + actions row beneath, bottom-left, max 2 buttons). **Buttons:** strings get wrapped — single `action` → `Button variant="primary"`; `actions` array → first is `secondary`, second is `primary` (visually dominant CTA on the right). React elements pass through. **Title:** `text-sm font-bold text-on-prominent`; wrap emphasis in `<b>` for an in-line brand-blue accent (`[&>b]:text-primary`). **Description:** `text-xs font-medium text-on-subtle`, `mt-0.5` from title. **Default icon:** built-in 40px brand-blue circle with a white `Gift` glyph; pass any `ReactNode` to override, or `icon={null}` to omit. **`onClick`:** when set, the whole surface becomes the CTA (cursor-pointer, hover/focus states, keyboard activation). Mutually exclusive with `action`/`actions` — buttons are silently dropped and a dev warning fires. Close X stops propagation so dismissing never triggers the surface click. **A11y:** no `role`/`aria-live` (Banner is not a status surface). |
610
+ | Badge | Variants: `default` (solid blue), `default-success`, `default-fail`, `default-warning` (all use `bg-semantic-*` + matching `text-on-semantic-*` foreground); `fill` (blue tint), `fill-success`, `fill-fail`, `fill-warning`; `fill-credit` (light-peach solid `bg-semantic-boost-surface` + `text-on-semantic-boost` foreground — use for credit/bonus labels); `fill-demo` (red-orange tint — `bg-semantic-demo/10` + `text-semantic-demo` — dedicated to "demo account" / "test mode" flags, **not** a severity signal); `outline`; `ghost`, `ghost-success`, `ghost-fail`. Base class no longer applies `tracking-wide` — letter spacing is default. |
608
611
  | TicketCard | **Icon:** pass any `ReactNode` via `icon`. Icon container: `size-10` rounded-full, `border-2 border-primary`, `text-primary`. **Labels:** `label` (above value) and `stubLabel` (stub button) render in sentence case — do NOT apply `uppercase` or `tracking-widest`. Stub: `w-[100px]` `bg-primary` button, `text-on-primary`, shimmer sweep animation. Disabled stub: `opacity-50`, `cursor-not-allowed`. Perforation notches sit outside the card box — do NOT put `overflow-hidden` on the card wrapper. **`compact`** (default `false`): `true` = mobile layout — reduces left-content horizontal padding from `px-4 gap-4` to `px-2 gap-2`. **For boost use cases:** use `BoostTicketCard` instead — it renders a `<Badge variant="fill-boost">` inline below the value. |
609
612
  | BoostTicketCard | Same visual shell as `TicketCard` (perforation notches, tear-line, shimmer stub). The card height is **variable** (grows with content via `py-4`) rather than fixed at `h-20`. The boost is displayed as an inline `<Badge variant="fill-boost" size="sm">` with a leading `Rocket` icon and a trailing `Info` icon: *"Boost: {boostAmount} {boostCurrency}"*. Tokens used: `bg-subtle`, `bg-primary`, `bg-primary-hover`, `text-on-primary`, `bg-semantic-boost/16`, `text-on-semantic-boost`. Supports `compact` prop for mobile layout (same padding reduction as `TicketCard`). |
610
613
  | Toggle | Pressed: `bg-primary/10` + `border-primary` + `text-primary` |
@@ -740,7 +743,7 @@ import { HeaderNavigationBlock } from "@trading-game/design-intelligence-layer"
740
743
 
741
744
  <HeaderNavigationBlock
742
745
  onBack={() => router.back()}
743
- badge={{ label: "Demo", variant: "fill-warning" }}
746
+ badge={{ label: "Demo", variant: "fill-demo" }}
744
747
  balance={{ amount: "1000.00", currency: "USDT" }}
745
748
  history={{ count: 5, onClick: openHistorySheet }} // count 0 hides badge; >99 shows "99+"
746
749
  actions={<SoundToggleButton />}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trading-game/design-intelligence-layer",
3
- "version": "0.15.4",
3
+ "version": "0.16.1",
4
4
  "description": "Trading Game Design System — shadcn/ui components with Tailwind CSS v4",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
package/src/styles.css CHANGED
@@ -57,6 +57,9 @@
57
57
  --color-semantic-win: var(--semantic-win);
58
58
  --color-semantic-loss: var(--semantic-loss);
59
59
  --color-semantic-warning: var(--semantic-warning);
60
+ --color-semantic-error: var(--semantic-error);
61
+ --color-semantic-demo: var(--semantic-demo);
62
+ --color-semantic-demo-surface: var(--semantic-demo-surface);
60
63
  --color-semantic-boost: var(--semantic-boost);
61
64
  --color-semantic-boost-surface: var(--semantic-boost-surface);
62
65
  --color-alert-info-text: var(--alert-info-text);
@@ -158,7 +161,7 @@
158
161
  /* #008832 */
159
162
 
160
163
  /* ── Sky ── */
161
- --primitive-sky-600: #3DAAFF;
164
+ --primitive-sky-600: oklch(0.6 0.18 245);
162
165
  /* #3DAAFF */
163
166
 
164
167
  /* ── Red ── */
@@ -185,6 +188,10 @@
185
188
  --primitive-amber-800: oklch(0.40 0.10 52);
186
189
  /* #713813 — dark amber/brown; ticket boost label text */
187
190
 
191
+ /* ── Yellow ── */
192
+ --primitive-yellow-500: oklch(0.65 0.16 82);
193
+ /* #E0AE00 — golden warning yellow; clearly distinct from orange/red */
194
+
188
195
  /* ── Violet ── */
189
196
  --primitive-violet-500: oklch(0.601 0.263 301.6);
190
197
  /* #A040FF */
@@ -245,7 +252,7 @@
245
252
  --primitive-layout-gutter-md: 36px;
246
253
  --primitive-layout-margin-sm: 16px;
247
254
  --primitive-layout-margin-md: 36px;
248
- --primitive-layout-margin-lg: 64px;
255
+ --primitive-layout-margin-lg: 36px;
249
256
  --primitive-layout-diagram-max-default: 319px;
250
257
  --primitive-layout-diagram-max-small: 599px;
251
258
  --primitive-layout-diagram-max-medium: 1135px;
@@ -297,9 +304,15 @@
297
304
  /* #FFFFFF — text/icon color for use on semantic-loss surfaces */
298
305
  --semantic-info: var(--primitive-sky-600);
299
306
  --semantic-error: var(--primitive-red-600);
300
- --semantic-warning: var(--primitive-orange-500);
307
+ --semantic-warning: var(--primitive-yellow-500);
301
308
  --on-semantic-warning: var(--primitive-mono-50);
302
309
  /* #FFFFFF — text/icon color for use on semantic-warning surfaces */
310
+ --semantic-demo: var(--primitive-orange-500);
311
+ /* #FF6600 — red-orange for "demo account" / "test mode" badges; independent
312
+ of severity (warning/danger), reserved for marking non-real-money flows */
313
+ --semantic-demo-surface: color-mix(in oklch, var(--semantic-demo) 10%, var(--prominent));
314
+ /* Opaque light-peach version of the demo tint — solid color so the badge
315
+ looks the same on any background (mirrors --semantic-boost-surface for credit) */
303
316
  --semantic-boost: var(--primitive-amber-600);
304
317
  /* #F9840F — boost badge surface */
305
318
  --semantic-boost-surface: var(--primitive-amber-100);
@@ -357,7 +370,7 @@
357
370
  :root {
358
371
  --semantic-layout-grid-columns: 8;
359
372
  --semantic-layout-gutter: var(--primitive-layout-gutter-md);
360
- --semantic-layout-margin-inline: var(--primitive-layout-margin-md);
373
+ --semantic-layout-margin-inline: var(--primitive-layout-margin-sm);
361
374
  }
362
375
  }
363
376
 
@@ -365,7 +378,7 @@
365
378
  :root {
366
379
  --semantic-layout-grid-columns: 12;
367
380
  --semantic-layout-gutter: var(--primitive-layout-gutter-md);
368
- --semantic-layout-margin-inline: var(--primitive-layout-margin-lg);
381
+ --semantic-layout-margin-inline: var(--primitive-layout-margin-sm);
369
382
  }
370
383
  }
371
384