@trading-game/design-intelligence-layer 0.8.7 → 0.8.8
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 +19 -0
- package/dist/index.cjs +8 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/guides/design-system-guide/trading-game-ds-guide.md +43 -3
- package/package.json +1 -1
- package/src/styles.css +28 -1
package/README.md
CHANGED
|
@@ -247,6 +247,8 @@ All tokens are CSS custom properties, loaded automatically via `@trading-game/de
|
|
|
247
247
|
| `bg-popover` | `--popover` | `#FFFFFF` | Popover/dropdown surface |
|
|
248
248
|
| `bg-subtle` | `--subtle` | `#F5F5F5` | Subtle tinted surface |
|
|
249
249
|
| `bg-overlay` | `--overlay` | black 50% | Modal/dialog backdrop only |
|
|
250
|
+
| `bg-tabs` | `--tabs` | black 4% alpha | Tab container background (`variant="default"`) |
|
|
251
|
+
| `bg-tabs-active` | `--tabs-active` | `#FFFFFF` | Active / selected tab pill |
|
|
250
252
|
| `bg-primary` | `--primary` | `#2323FF` | Brand blue — CTAs |
|
|
251
253
|
| `bg-primary-hover` | `--primary-hover` | `#0B0BD2` | Primary button hover (darker blue) |
|
|
252
254
|
| `bg-secondary-hover` | `--secondary-hover` | `#EEEEEE` | Outline/secondary hover (light grey) |
|
|
@@ -320,6 +322,23 @@ Opacity on tokens is allowed and encouraged:
|
|
|
320
322
|
❌ bg-white → NOT a token, use bg-background or bg-card
|
|
321
323
|
```
|
|
322
324
|
|
|
325
|
+
### Primitive alpha scales
|
|
326
|
+
|
|
327
|
+
For structured alpha surfaces, the design system ships two internal alpha primitive scales. These are **CSS variables only** — not exposed as Tailwind utility classes. Always reference them via a semantic token, never directly in components.
|
|
328
|
+
|
|
329
|
+
```
|
|
330
|
+
--primitive-mono-alpha-4 through --primitive-mono-alpha-80 (black at N%)
|
|
331
|
+
--primitive-blue-alpha-4 through --primitive-blue-alpha-80 (brand blue at N%)
|
|
332
|
+
Stops: 4 · 8 · 16 · 24 · 32 · 40 · 50 · 64 · 80
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
Example — how `--tabs` uses the alpha scale:
|
|
336
|
+
```css
|
|
337
|
+
--tabs: var(--primitive-mono-alpha-4); /* black at 4% — tab container background */
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
> `--primitive-black-50` is deprecated. It now aliases `--primitive-mono-alpha-50`. The `--overlay` semantic token is unaffected.
|
|
341
|
+
|
|
323
342
|
---
|
|
324
343
|
|
|
325
344
|
## Typography
|
package/dist/index.cjs
CHANGED
|
@@ -4884,10 +4884,12 @@ function SelectTrigger(_a) {
|
|
|
4884
4884
|
var _b = _a, {
|
|
4885
4885
|
className,
|
|
4886
4886
|
size = "default",
|
|
4887
|
+
readOnly = false,
|
|
4887
4888
|
children
|
|
4888
4889
|
} = _b, props = __objRest(_b, [
|
|
4889
4890
|
"className",
|
|
4890
4891
|
"size",
|
|
4892
|
+
"readOnly",
|
|
4891
4893
|
"children"
|
|
4892
4894
|
]);
|
|
4893
4895
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
@@ -4895,14 +4897,16 @@ function SelectTrigger(_a) {
|
|
|
4895
4897
|
__spreadProps(__spreadValues({
|
|
4896
4898
|
"data-slot": "select-trigger",
|
|
4897
4899
|
"data-size": size,
|
|
4900
|
+
"data-readonly": readOnly ? "" : void 0,
|
|
4901
|
+
disabled: readOnly || props.disabled,
|
|
4898
4902
|
className: cn(
|
|
4899
|
-
"flex w-fit items-center justify-between gap-2 rounded-sm border border-input bg-
|
|
4903
|
+
"flex w-fit items-center justify-between gap-2 rounded-sm border border-input bg-background appearance-none px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-on-subtle data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-on-subtle data-[readonly]:cursor-default data-[readonly]:opacity-100",
|
|
4900
4904
|
className
|
|
4901
4905
|
)
|
|
4902
4906
|
}, props), {
|
|
4903
4907
|
children: [
|
|
4904
4908
|
children,
|
|
4905
|
-
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_radix_ui26.Select.Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react18.ChevronDownIcon, { className: "size-4 opacity-50" }) })
|
|
4909
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_radix_ui26.Select.Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react18.ChevronDownIcon, { className: cn("size-4", readOnly ? "opacity-30" : "opacity-50") }) })
|
|
4906
4910
|
]
|
|
4907
4911
|
})
|
|
4908
4912
|
);
|
|
@@ -6207,7 +6211,7 @@ var tabsListVariants = (0, import_class_variance_authority11.cva)(
|
|
|
6207
6211
|
{
|
|
6208
6212
|
variants: {
|
|
6209
6213
|
variant: {
|
|
6210
|
-
default: "bg-
|
|
6214
|
+
default: "bg-tabs",
|
|
6211
6215
|
line: "gap-1 bg-transparent"
|
|
6212
6216
|
},
|
|
6213
6217
|
size: {
|
|
@@ -6260,7 +6264,7 @@ function TabsTrigger(_a) {
|
|
|
6260
6264
|
"group-data-[size=sm]/tabs-list:gap-1 group-data-[size=sm]/tabs-list:rounded-sm group-data-[size=sm]/tabs-list:px-2 group-data-[size=sm]/tabs-list:text-xs",
|
|
6261
6265
|
"group-data-[size=lg]/tabs-list:gap-2 group-data-[size=lg]/tabs-list:rounded-lg group-data-[size=lg]/tabs-list:px-4 group-data-[size=lg]/tabs-list:text-base",
|
|
6262
6266
|
"group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:hover:bg-transparent group-data-[variant=line]/tabs-list:hover:text-primary group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent",
|
|
6263
|
-
"data-[state=active]:bg-
|
|
6267
|
+
"data-[state=active]:bg-tabs-active data-[state=active]:border-transparent data-[state=active]:text-primary data-[state=active]:font-semibold",
|
|
6264
6268
|
"after:absolute after:bg-primary after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",
|
|
6265
6269
|
iconPosition === "top" && "h-auto flex-col gap-1 py-2",
|
|
6266
6270
|
iconPosition === "top" && "group-data-[size=sm]/tabs-list:gap-0.5 group-data-[size=sm]/tabs-list:py-1.5",
|