@trading-game/design-intelligence-layer 0.17.2 → 0.17.4
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 +18 -2
- package/dist/index.cjs +84 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -4
- package/dist/index.d.ts +8 -4
- package/dist/index.js +84 -35
- package/dist/index.js.map +1 -1
- package/guides/design-system-guide/trading-game-ds-guide.md +22 -5
- package/package.json +2 -2
- package/src/styles.css +6 -0
|
@@ -415,7 +415,8 @@ The design system uses a custom radius scale (base = 10px). Use these named toke
|
|
|
415
415
|
| `primary-inverse` | `bg-primary-inverse` | `text-on-primary-inverse` | none | `bg-primary-inverse/80` | Dark/coloured surfaces |
|
|
416
416
|
| `secondary` | transparent | `text-on-prominent` | `border-[1.5px] border-border-prominent` | `bg-secondary-hover` | Light surfaces |
|
|
417
417
|
| `secondary-inverse` | transparent | `text-on-prominent-inverse` | `border-[1.5px] border-primary-inverse` | `bg-primary-inverse/10` | Dark/coloured surfaces |
|
|
418
|
-
| `tertiary` | transparent | `text-
|
|
418
|
+
| `tertiary` | transparent | `text-on-prominent` | none | `bg-secondary-hover` | Light surfaces |
|
|
419
|
+
| `tertiary-inverse` | transparent | `text-on-primary` | none | `bg-on-primary/[0.10]` | Dark/coloured surfaces |
|
|
419
420
|
|
|
420
421
|
### 6.2 — Sizes
|
|
421
422
|
|
|
@@ -546,8 +547,8 @@ import { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, Dialog
|
|
|
546
547
|
| Field | [complex] | FieldLabel, FieldDescription, FieldError, FieldGroup, FieldLegend, FieldSet, FieldContent, FieldTitle, FieldSeparator |
|
|
547
548
|
| Form | [complex] | FormField, FormItem, FormLabel, FormControl, FormDescription, FormMessage |
|
|
548
549
|
| HoverCard | [composed] | HoverCardTrigger, HoverCardContent |
|
|
549
|
-
| Input | [simple] | — |
|
|
550
|
-
| InputGroup | [composed] | InputGroupAddon, InputGroupInput, InputGroupButton, InputGroupText, InputGroupTextarea |
|
|
550
|
+
| Input | [simple] | — variants: `default`, `inverse` (dark sunken fill + white text, for use on `bg-primary` and other brand-coloured surfaces). |
|
|
551
|
+
| InputGroup | [composed] | InputGroupAddon, InputGroupInput, InputGroupButton, InputGroupText, InputGroupTextarea. Variants: `default`, `inverse` (propagates to nested controls via context — addon / text / input all swap to the inverse recipe automatically). |
|
|
551
552
|
| InputOTP | [composed] | InputOTPGroup, InputOTPSlot, InputOTPSeparator. Variants: OTP 4 digits, OTP 6 digits, OTP 6 split, OTP 8 digits, OTP 6 separated |
|
|
552
553
|
| Item | [composed] | ItemGroup, ItemContent, ItemTitle, ItemDescription, ItemMedia, ItemActions, ItemHeader, ItemFooter, ItemSeparator |
|
|
553
554
|
| Kbd | [simple] | KbdGroup |
|
|
@@ -588,9 +589,9 @@ These are styling behaviors you can't discover from TypeScript types alone:
|
|
|
588
589
|
|
|
589
590
|
| Component | Note |
|
|
590
591
|
|-----------|------|
|
|
591
|
-
| Button | `font-display font-bold`, sentence case (no `uppercase`). **Variants:** `primary` (blue fill, light surfaces), `primary-inverse` (white fill + blue text, dark/coloured surfaces), `secondary` (black outline, light surfaces), `secondary-inverse` (white outline + white text, dark/coloured surfaces), `tertiary` (text-only, light surfaces). **Loading state:** pass `loading` prop — button automatically renders a centred `Spinner`, hides children with `invisible` to preserve width. Do NOT manually place `<Spinner>` or "Loading" text inside the button. |
|
|
592
|
+
| Button | `font-display font-bold`, sentence case (no `uppercase`). **Variants:** `primary` (blue fill, light surfaces), `primary-inverse` (white fill + blue text, dark/coloured surfaces), `secondary` (black outline, light surfaces), `secondary-inverse` (white outline + white text, dark/coloured surfaces), `tertiary` (text-only, black text, light surfaces — `text-on-prominent` hover `bg-secondary-hover`). **Loading state:** pass `loading` prop — button automatically renders a centred `Spinner`, hides children with `invisible` to preserve width. Do NOT manually place `<Spinner>` or "Loading" text inside the button. |
|
|
592
593
|
| Card | Flat by default (no shadow). Add elevation manually: `className="shadow-sm"` |
|
|
593
|
-
| Input | Resting: `border-input`. Focus: `border-ring` + `ring-[3px] ring-ring/50`. Radius: `rounded-sm` (6px) |
|
|
594
|
+
| Input | Resting: `border-input`. Focus: `border-ring` + `ring-[3px] ring-ring/50`. Radius: `rounded-sm` (6px). **Read-only:** pass the native `readOnly` prop — renders with `border-transparent bg-subtle/60`, `pointer-events-none` (non-interactive, non-focusable). Use to display a value that the user should not be able to edit. |
|
|
594
595
|
| InputGroup | Wraps `Input` with inline addons (icons, buttons, text). **Sizes:** `sm` (h-8) / `md` (h-10, default) / `lg` (h-12) — pass `size` to `InputGroup`, it flows to `InputGroupInput` via context. **Padding:** when any `inline-start` or `inline-end` addon is present, input text gets equal `pl-2 pr-2` (8px) on both sides for visual symmetry. Without addons, Input's default `px-3`/`px-4` applies. |
|
|
595
596
|
| InputOTP | **Variants:** OTP 4 digits (single group, 4 slots), OTP 6 digits (single group, 6 slots), OTP 6 split (two groups of 3 with `InputOTPSeparator`), OTP 8 digits (single group, 8 slots), OTP 6 separated (each slot in its own `InputOTPGroup` for individually spaced boxes). Slot: `h-9 w-9`, `border-border-subtle`, `rounded-sm` on first/last. Focus: `border-primary` + `ring-primary/[0.08]`. |
|
|
596
597
|
| NavigationButton | Icon-only tertiary button for navigation. `text-on-prominent` (black icons), `hover:bg-secondary-hover`. **Sizes (8-point grid):** `lg` 48px / 24px icon, `md` 40px / 20px icon, `sm` 32px / 20px icon, `xs` 24px / 16px icon. States: focus `ring-ring/50`, active `opacity-60`, disabled `opacity-24`. Supports `asChild`. |
|
|
@@ -914,3 +915,19 @@ import { ResultDialog } from "@trading-game/design-intelligence-layer"
|
|
|
914
915
|
```tsx
|
|
915
916
|
<Input type="email" placeholder="Enter your email" />
|
|
916
917
|
```
|
|
918
|
+
|
|
919
|
+
**Read-only input:**
|
|
920
|
+
```tsx
|
|
921
|
+
<Input value="Read-only value" readOnly />
|
|
922
|
+
```
|
|
923
|
+
|
|
924
|
+
---
|
|
925
|
+
|
|
926
|
+
## 11 — Release Notes
|
|
927
|
+
|
|
928
|
+
### v0.17.4
|
|
929
|
+
|
|
930
|
+
- **Button `tertiary` variant** — text color changed from `text-primary` (blue) to `text-on-prominent` (black). Hover changed from `bg-primary/[0.08]` to `bg-secondary-hover`. Use `tertiary-inverse` for white text on dark/coloured surfaces (unchanged).
|
|
931
|
+
- **Input `readOnly` state** — native `readOnly` prop now has a distinct visual treatment: `border-transparent`, `bg-subtle/60`, `pointer-events-none`. Renders as a non-interactive display field. Clearly distinguishable from both the default (bordered) and `disabled` (faded/greyed) states.
|
|
932
|
+
- **Demo page sidebar** — replaced custom `<aside>` + plain buttons with the design system `Sidebar` component (`SidebarProvider`, `SidebarMenu`, `SidebarMenuButton` with `isActive`).
|
|
933
|
+
- **Demo page layout** — removed `max-w-5xl` content cap; content now uses the full available width.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trading-game/design-intelligence-layer",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.4",
|
|
4
4
|
"description": "Trading Game Design System — shadcn/ui components with Tailwind CSS v4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"**/*.css"
|
|
24
24
|
],
|
|
25
25
|
"scripts": {
|
|
26
|
-
"dev": "next dev -H 127.0.0.1 -p
|
|
26
|
+
"dev": "next dev -H 127.0.0.1 -p 4000",
|
|
27
27
|
"generate:registry": "node scripts/generate-component-registry.mjs",
|
|
28
28
|
"build": "tsup",
|
|
29
29
|
"build:next": "next build",
|
package/src/styles.css
CHANGED
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
--color-sidebar: var(--sidebar);
|
|
41
41
|
--color-ring: var(--ring);
|
|
42
42
|
--color-input: var(--input);
|
|
43
|
+
--color-input-inverse-surface: var(--input-inverse-surface);
|
|
43
44
|
--color-border: var(--border);
|
|
44
45
|
/* @deprecated — use border-border-subtle or border-border-prominent */
|
|
45
46
|
--color-border-subtle: var(--border-subtle);
|
|
@@ -393,6 +394,11 @@
|
|
|
393
394
|
--popover: var(--primitive-mono-50);
|
|
394
395
|
--popover-foreground: oklch(0.07 0.012 165);
|
|
395
396
|
--input: var(--border-subtle);
|
|
397
|
+
/* Sunken dark fill for Input/InputGroup variant="inverse" — sits on
|
|
398
|
+
coloured surfaces (brand-blue, etc.) where a frosted-white fill would
|
|
399
|
+
blend into the surrounding chrome. 35 % black overlay deepens the
|
|
400
|
+
surface enough for white text to read cleanly. */
|
|
401
|
+
--input-inverse-surface: oklch(0 0 0 / 0.35);
|
|
396
402
|
--alert-info-text: var(--semantic-info);
|
|
397
403
|
--alert-info-border: var(--semantic-info);
|
|
398
404
|
--alert-error-text: var(--semantic-error);
|