@trading-game/design-intelligence-layer 0.16.7 → 0.16.9
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/README.md +31 -10
- package/dist/index.cjs +757 -670
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -3
- package/dist/index.d.ts +11 -3
- package/dist/index.js +636 -551
- package/dist/index.js.map +1 -1
- package/guides/design-system-guide/trading-game-ds-guide.md +6 -5
- package/guides/rules/design-system-consuming-project.mdc +7 -1
- package/package.json +1 -1
- package/src/styles.css +0 -2
|
@@ -289,7 +289,7 @@ The system follows a Material-style `<surface>` / `on-<surface>` pair convention
|
|
|
289
289
|
| Show WIN / profit / positive | `text-semantic-win` | Primary blue for profit |
|
|
290
290
|
| Show LOSS / negative | `text-semantic-loss` | Any non-token red |
|
|
291
291
|
| Show WARNING / caution | `text-semantic-warning` | Raw orange hex or primary tint |
|
|
292
|
-
| Show a boost / bonus badge
|
|
292
|
+
| Show a credit / boost / bonus badge | `<Badge variant="fill-credit">` (uses `bg-semantic-boost-surface` `#FDCA8A` + `text-on-semantic-boost` `#521900`, bold) | Hardcoded amber hex values |
|
|
293
293
|
| Color a tab container background | `bg-tabs` | `bg-subtle` for tabs |
|
|
294
294
|
| Color an active/selected tab | `bg-tabs-active` | `bg-prominent` for active tab |
|
|
295
295
|
| Color a page background | `bg-prominent` | `bg-white` directly |
|
|
@@ -533,6 +533,7 @@ import { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, Dialog
|
|
|
533
533
|
| Carousel | [complex] | CarouselContent, CarouselItem, CarouselPrevious, CarouselNext |
|
|
534
534
|
| Chart | [complex] | ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle |
|
|
535
535
|
| Checkbox | [simple] | — |
|
|
536
|
+
| Chip | [simple] | — (`selected`, `disabled`, `onClick`, standard button props) — pill-shaped toggle-able selection chip. Selected: `bg-primary/[0.08]` + `text-primary`. Unselected: outline + `text-on-prominent`. |
|
|
536
537
|
| Collapsible | [composed] | CollapsibleTrigger, CollapsibleContent |
|
|
537
538
|
| Combobox | [complex] | ComboboxInput, ComboboxContent, ComboboxList, ComboboxItem, ComboboxEmpty, ComboboxGroup, ComboboxLabel |
|
|
538
539
|
| Command | [complex] | CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandSeparator, CommandShortcut |
|
|
@@ -576,7 +577,7 @@ import { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, Dialog
|
|
|
576
577
|
| Tabs | [composed] | TabsList (`variant`: default/line, `size`: sm/md/lg), TabsTrigger (`iconPosition`: inline/top), TabsContent. Root accepts `orientation`: horizontal/vertical. |
|
|
577
578
|
| Textarea | [simple] | — |
|
|
578
579
|
| TicketCard | [composed] | — (`icon`, `label`, `value`, `currency`, `stubLabel`, `onStubClick`, `stubDisabled`, `compact`) |
|
|
579
|
-
|
|
|
580
|
+
| CreditTicketCard | [composed] | — (`icon`, `label`, `value`, `currency`, `stubLabel`, `onStubClick`, `stubDisabled`, `badgeIcon`, `badgeLabel`, `badgeValue`, `badgeCurrency`, `badgeInfo`, `badgeInfoSide`, `badgeInfoAlign`, `badgeInfoTitle`, `badgeInfoCloseLabel`, `compact`) — use when a Welcome credit / bonus badge must sit next to (or, on narrow widths in compact mode, below) the value |
|
|
580
581
|
| Toggle | [simple] | — |
|
|
581
582
|
| ToggleGroup | [composed] | ToggleGroupItem |
|
|
582
583
|
| Tooltip | [composed] | TooltipTrigger, TooltipContent, TooltipProvider |
|
|
@@ -606,10 +607,10 @@ These are styling behaviors you can't discover from TypeScript types alone:
|
|
|
606
607
|
| Dialog/Sheet | Footer buttons should use `size="md"`. Overlay: `bg-overlay` |
|
|
607
608
|
| Menubar | Hover: `bg-primary/[0.08]`. Open state: `bg-primary/10` |
|
|
608
609
|
| 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:**
|
|
610
|
+
| 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`/`glyph`, `action`, `actions`, `onDismiss`, `dismissLabel`, `onClick`. **Surface:** tinted primary surface (`bg-primary/[0.08]`) with `border-primary/[0.16]` 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 in `Button variant="secondary" size="sm"` across every slot (inline `action` and card `actions`). React elements pass through unchanged. **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** (`rounded-full bg-primary`) with a white `Gift` glyph inside. Two ways to customise: `glyph` swaps just the inner icon while keeping the brand-circle shell intact (use this for "different symbol, same brand badge"); `icon` replaces the entire wrapper (use for fully custom artwork). `icon={null}` omits the column. `icon` wins if both are set — a dev warning fires. **`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
611
|
| 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. |
|
|
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
|
|
612
|
-
|
|
|
612
|
+
| 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 Welcome credit / bonus use cases:** use `CreditTicketCard` instead — it renders a `<Badge variant="fill-credit">` next to (or below, on narrow compact widths) the value. |
|
|
613
|
+
| CreditTicketCard | 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 credit is displayed as an inline `<Badge variant="fill-credit" size="sm">` formatted as *"{badgeValue} {badgeCurrency}"* (e.g. `10.00 USDT`). The badge composes optional `badgeIcon` (e.g. `<Gift />`) on the left and an info trigger on the right that opens `badgeInfo` (desktop: `Tooltip variant="inverse"`; mobile: `Drawer`). Tokens used: `bg-subtle`, `bg-primary`, `bg-primary-hover`, `text-on-primary`, `bg-semantic-boost-surface` (`#FDCA8A`), `text-on-semantic-boost` (`#521900`, bold). `compact` shrinks padding and lets the badge wrap to a second line under the value only when balance + badge would otherwise overflow into the deposit stub (responsive `flex-wrap`). |
|
|
613
614
|
| Toggle | Pressed: `bg-primary/10` + `border-primary` + `text-primary` |
|
|
614
615
|
| Calendar | Selected: `bg-secondary-hover` + `text-primary font-bold`. Today: primary dot below date |
|
|
615
616
|
|
|
@@ -12,7 +12,7 @@ alwaysApply: true
|
|
|
12
12
|
|
|
13
13
|
### Available components (check this list first)
|
|
14
14
|
|
|
15
|
-
Accordion, Alert, AlertDialog, Avatar, AvatarGroup, Badge, Breadcrumb, Button, Calendar, Card, Carousel, Chart, Checkbox, Collapsible, Combobox, Command, ContextMenu, Dialog, Drawer, DropdownMenu,
|
|
15
|
+
Accordion, Alert, AlertDialog, AspectRatio, Avatar, AvatarGroup, Badge, **Banner**, Breadcrumb, Button, Calendar, Card, Carousel, Chart, Checkbox, **Chip**, Collapsible, Combobox, Command, ContextMenu, Dialog, Direction, Drawer, DropdownMenu, Empty, Field, Form, HoverCard, Input, InputGroup, InputOTP, Item, Kbd, Label, **Link**, Menubar, NativeSelect, NavigationButton, NavigationMenu, Pagination, Popover, Progress, RadioGroup, Resizable, ScrollArea, Select, Separator, Sheet, Sidebar, Skeleton, Slider, Spinner, **Stepper**, Switch, Table, Tabs, Textarea, **TicketCard / CreditTicketCard**, Toast/Toaster, Toggle, ToggleGroup, Tooltip
|
|
16
16
|
|
|
17
17
|
### Decision flow
|
|
18
18
|
|
|
@@ -177,13 +177,18 @@ All variants support icon sizes — use `size="icon-lg|icon-md|icon-sm|icon-xs"`
|
|
|
177
177
|
```tsx
|
|
178
178
|
// Solid
|
|
179
179
|
<Badge variant="default" /> // Blue solid
|
|
180
|
+
<Badge variant="standard" /> // Subtle grey solid
|
|
180
181
|
<Badge variant="default-success" /> // Green solid
|
|
181
182
|
<Badge variant="default-fail" /> // Red solid
|
|
183
|
+
<Badge variant="default-warning" /> // Orange solid
|
|
182
184
|
|
|
183
185
|
// Tint
|
|
184
186
|
<Badge variant="fill" /> // Blue tint bg
|
|
185
187
|
<Badge variant="fill-success" /> // Green tint bg
|
|
186
188
|
<Badge variant="fill-fail" /> // Red tint bg
|
|
189
|
+
<Badge variant="fill-warning" /> // Orange tint bg
|
|
190
|
+
<Badge variant="fill-credit" /> // Deep peach (#FDCA8A) + bold amber text — credit/boost (Welcome credit, bonus)
|
|
191
|
+
<Badge variant="fill-demo" /> // Peach + red-orange text — demo / test-mode indicator
|
|
187
192
|
|
|
188
193
|
// Outline (black border, hover grey)
|
|
189
194
|
<Badge variant="outline" />
|
|
@@ -192,6 +197,7 @@ All variants support icon sizes — use `size="icon-lg|icon-md|icon-sm|icon-xs"`
|
|
|
192
197
|
<Badge variant="ghost" />
|
|
193
198
|
<Badge variant="ghost-success" />
|
|
194
199
|
<Badge variant="ghost-fail" />
|
|
200
|
+
<Badge variant="ghost-warning" />
|
|
195
201
|
```
|
|
196
202
|
|
|
197
203
|
---
|
package/package.json
CHANGED
package/src/styles.css
CHANGED
|
@@ -181,8 +181,6 @@
|
|
|
181
181
|
/* ── Amber ── */
|
|
182
182
|
--primitive-amber-300: #FDCA8A;
|
|
183
183
|
/* #FDCA8A — credit/boost badge surface (peach, contrast on grey card) */
|
|
184
|
-
--primitive-amber-500: oklch(0.74 0.18 72);
|
|
185
|
-
/* #ef9f00 — golden amber; ticket boost progress fill */
|
|
186
184
|
--primitive-amber-600: #F9840F;
|
|
187
185
|
/* #F9840F — warm orange-amber; boost badge background base */
|
|
188
186
|
--primitive-amber-900: oklch(0.30 0.10 52);
|