@trading-game/design-intelligence-layer 0.16.0 → 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.
- package/README.md +54 -8
- package/dist/index.cjs +10 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +10 -23
- package/dist/index.js.map +1 -1
- package/guides/design-system-guide/trading-game-ds-guide.md +6 -4
- package/package.json +1 -1
- package/src/styles.css +11 -3
package/dist/index.d.cts
CHANGED
|
@@ -22,7 +22,7 @@ declare function AccordionItem({ className, ...props }: React$1.ComponentProps<t
|
|
|
22
22
|
declare function AccordionTrigger({ className, children, ...props }: React$1.ComponentProps<typeof Accordion$1.Trigger>): react_jsx_runtime.JSX.Element;
|
|
23
23
|
declare function AccordionContent({ className, children, ...props }: React$1.ComponentProps<typeof Accordion$1.Content>): react_jsx_runtime.JSX.Element;
|
|
24
24
|
|
|
25
|
-
type AlertVariant = "
|
|
25
|
+
type AlertVariant = "info" | "warning" | "danger" | "success";
|
|
26
26
|
type AlertLayout = "inline" | "card";
|
|
27
27
|
/**
|
|
28
28
|
* Per-variant surface, title, and accent classes. Description and close X are
|
|
@@ -30,7 +30,7 @@ type AlertLayout = "inline" | "card";
|
|
|
30
30
|
* because they target descendant elements.
|
|
31
31
|
*/
|
|
32
32
|
declare const alertVariants: (props?: ({
|
|
33
|
-
variant?: "
|
|
33
|
+
variant?: "info" | "warning" | "danger" | "success" | null | undefined;
|
|
34
34
|
layout?: "inline" | "card" | null | undefined;
|
|
35
35
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
36
36
|
interface AlertProps extends Omit<React$1.ComponentProps<"div">, "title">, VariantProps<typeof alertVariants> {
|
|
@@ -97,7 +97,7 @@ declare function AvatarGroup({ className, ...props }: React$1.ComponentProps<"di
|
|
|
97
97
|
declare function AvatarGroupCount({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
98
98
|
|
|
99
99
|
declare const badgeVariants: (props?: ({
|
|
100
|
-
variant?: "fill" | "default" | "standard" | "default-success" | "default-fail" | "default-warning" | "fill-success" | "fill-fail" | "fill-warning" | "fill-credit" | "ghost" | "ghost-success" | "ghost-fail" | "ghost-warning" | null | undefined;
|
|
100
|
+
variant?: "fill" | "default" | "standard" | "default-success" | "default-fail" | "default-warning" | "fill-success" | "fill-fail" | "fill-warning" | "fill-credit" | "fill-demo" | "ghost" | "ghost-success" | "ghost-fail" | "ghost-warning" | null | undefined;
|
|
101
101
|
size?: "lg" | "md" | "sm" | null | undefined;
|
|
102
102
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
103
103
|
declare function Badge({ className, variant, size, asChild, ...props }: React$1.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
|
package/dist/index.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ declare function AccordionItem({ className, ...props }: React$1.ComponentProps<t
|
|
|
22
22
|
declare function AccordionTrigger({ className, children, ...props }: React$1.ComponentProps<typeof Accordion$1.Trigger>): react_jsx_runtime.JSX.Element;
|
|
23
23
|
declare function AccordionContent({ className, children, ...props }: React$1.ComponentProps<typeof Accordion$1.Content>): react_jsx_runtime.JSX.Element;
|
|
24
24
|
|
|
25
|
-
type AlertVariant = "
|
|
25
|
+
type AlertVariant = "info" | "warning" | "danger" | "success";
|
|
26
26
|
type AlertLayout = "inline" | "card";
|
|
27
27
|
/**
|
|
28
28
|
* Per-variant surface, title, and accent classes. Description and close X are
|
|
@@ -30,7 +30,7 @@ type AlertLayout = "inline" | "card";
|
|
|
30
30
|
* because they target descendant elements.
|
|
31
31
|
*/
|
|
32
32
|
declare const alertVariants: (props?: ({
|
|
33
|
-
variant?: "
|
|
33
|
+
variant?: "info" | "warning" | "danger" | "success" | null | undefined;
|
|
34
34
|
layout?: "inline" | "card" | null | undefined;
|
|
35
35
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
36
36
|
interface AlertProps extends Omit<React$1.ComponentProps<"div">, "title">, VariantProps<typeof alertVariants> {
|
|
@@ -97,7 +97,7 @@ declare function AvatarGroup({ className, ...props }: React$1.ComponentProps<"di
|
|
|
97
97
|
declare function AvatarGroupCount({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
98
98
|
|
|
99
99
|
declare const badgeVariants: (props?: ({
|
|
100
|
-
variant?: "fill" | "default" | "standard" | "default-success" | "default-fail" | "default-warning" | "fill-success" | "fill-fail" | "fill-warning" | "fill-credit" | "ghost" | "ghost-success" | "ghost-fail" | "ghost-warning" | null | undefined;
|
|
100
|
+
variant?: "fill" | "default" | "standard" | "default-success" | "default-fail" | "default-warning" | "fill-success" | "fill-fail" | "fill-warning" | "fill-credit" | "fill-demo" | "ghost" | "ghost-success" | "ghost-fail" | "ghost-warning" | null | undefined;
|
|
101
101
|
size?: "lg" | "md" | "sm" | null | undefined;
|
|
102
102
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
103
103
|
declare function Badge({ className, variant, size, asChild, ...props }: React$1.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
|
package/dist/index.js
CHANGED
|
@@ -112,7 +112,6 @@ import {
|
|
|
112
112
|
AlertTriangle,
|
|
113
113
|
CheckCircle2,
|
|
114
114
|
Info,
|
|
115
|
-
Sparkles,
|
|
116
115
|
X,
|
|
117
116
|
XCircle
|
|
118
117
|
} from "lucide-react";
|
|
@@ -253,8 +252,6 @@ var alertVariants = cva2(
|
|
|
253
252
|
{
|
|
254
253
|
variants: {
|
|
255
254
|
variant: {
|
|
256
|
-
default: "bg-prominent border border-border-subtle",
|
|
257
|
-
brand: "bg-primary",
|
|
258
255
|
info: "bg-semantic-info/10",
|
|
259
256
|
warning: "bg-semantic-warning/10",
|
|
260
257
|
danger: "bg-semantic-error/10",
|
|
@@ -276,32 +273,24 @@ var alertVariants = cva2(
|
|
|
276
273
|
);
|
|
277
274
|
var SINGLE_LINE_CLASSES = "items-center min-h-12 py-2 gap-y-0";
|
|
278
275
|
var TITLE_CLASSES = {
|
|
279
|
-
default: "text-on-prominent",
|
|
280
|
-
brand: "text-on-primary",
|
|
281
276
|
info: "text-on-prominent",
|
|
282
277
|
warning: "text-on-prominent",
|
|
283
278
|
danger: "text-on-prominent",
|
|
284
279
|
success: "text-on-prominent"
|
|
285
280
|
};
|
|
286
281
|
var ICON_CLASSES = {
|
|
287
|
-
default: "text-on-prominent",
|
|
288
|
-
brand: "text-on-primary",
|
|
289
282
|
info: "text-semantic-info",
|
|
290
283
|
warning: "text-semantic-warning",
|
|
291
284
|
danger: "text-semantic-error",
|
|
292
285
|
success: "text-semantic-win"
|
|
293
286
|
};
|
|
294
287
|
var DESC_CLASSES = {
|
|
295
|
-
default: "text-on-subtle",
|
|
296
|
-
brand: "text-on-primary opacity-80",
|
|
297
288
|
info: "text-on-subtle",
|
|
298
289
|
warning: "text-on-subtle",
|
|
299
290
|
danger: "text-on-subtle",
|
|
300
291
|
success: "text-on-subtle"
|
|
301
292
|
};
|
|
302
293
|
var CLOSE_CLASSES = {
|
|
303
|
-
default: "text-on-subtle opacity-70",
|
|
304
|
-
brand: "text-on-primary opacity-70",
|
|
305
294
|
info: "text-on-subtle opacity-70",
|
|
306
295
|
warning: "text-on-subtle opacity-70",
|
|
307
296
|
danger: "text-on-subtle opacity-70",
|
|
@@ -309,10 +298,6 @@ var CLOSE_CLASSES = {
|
|
|
309
298
|
};
|
|
310
299
|
function defaultIconForVariant(variant) {
|
|
311
300
|
switch (variant) {
|
|
312
|
-
case "default":
|
|
313
|
-
return /* @__PURE__ */ jsx4(Info, {});
|
|
314
|
-
case "brand":
|
|
315
|
-
return /* @__PURE__ */ jsx4(Sparkles, {});
|
|
316
301
|
case "info":
|
|
317
302
|
return /* @__PURE__ */ jsx4(Info, {});
|
|
318
303
|
case "warning":
|
|
@@ -323,9 +308,6 @@ function defaultIconForVariant(variant) {
|
|
|
323
308
|
return /* @__PURE__ */ jsx4(CheckCircle2, {});
|
|
324
309
|
}
|
|
325
310
|
}
|
|
326
|
-
function actionButtonVariantFor(variant) {
|
|
327
|
-
return variant === "brand" ? "primary-inverse" : "secondary";
|
|
328
|
-
}
|
|
329
311
|
function Alert(_a) {
|
|
330
312
|
var _b = _a, {
|
|
331
313
|
variant = "info",
|
|
@@ -363,7 +345,7 @@ function Alert(_a) {
|
|
|
363
345
|
const showIcon = icon !== null;
|
|
364
346
|
const resolvedIcon = icon === void 0 ? defaultIconForVariant(variant) : icon;
|
|
365
347
|
const showCloseButton = typeof onDismiss === "function";
|
|
366
|
-
const buttonVariant =
|
|
348
|
+
const buttonVariant = "secondary";
|
|
367
349
|
const isAssertive = variant === "danger" || variant === "warning";
|
|
368
350
|
const role = isAssertive ? "alert" : "status";
|
|
369
351
|
const ariaLive = isAssertive ? "assertive" : "polite";
|
|
@@ -425,9 +407,10 @@ function Alert(_a) {
|
|
|
425
407
|
"aria-hidden": true,
|
|
426
408
|
className: cn(
|
|
427
409
|
"inline-flex shrink-0 size-4 [&_svg]:size-full",
|
|
428
|
-
//
|
|
429
|
-
//
|
|
430
|
-
//
|
|
410
|
+
// Single-line: grid is items-center so the icon centers automatically.
|
|
411
|
+
// Multi-line / card: top-aligned with the title cap-height via a 2px
|
|
412
|
+
// (mt-0.5) optical nudge so the icon reads as introducing the message
|
|
413
|
+
// header, not floating between title and description.
|
|
431
414
|
isSingleLine ? "" : "mt-0.5",
|
|
432
415
|
ICON_CLASSES[variant]
|
|
433
416
|
),
|
|
@@ -789,6 +772,10 @@ var badgeVariants = cva3(
|
|
|
789
772
|
"fill-fail": "bg-semantic-loss/10 border-transparent text-semantic-loss",
|
|
790
773
|
"fill-warning": "bg-semantic-warning/10 border-transparent text-semantic-warning",
|
|
791
774
|
"fill-credit": "bg-semantic-boost-surface border-transparent text-on-semantic-boost !text-xs !font-semibold",
|
|
775
|
+
// Demo / test-mode flag — opaque light-peach surface + red-orange text.
|
|
776
|
+
// Uses --semantic-demo-surface (a solid color-mix of demo @ 10% with white)
|
|
777
|
+
// so the badge looks identical on any background.
|
|
778
|
+
"fill-demo": "bg-semantic-demo-surface border-transparent text-semantic-demo",
|
|
792
779
|
// Ghost (transparent)
|
|
793
780
|
ghost: "bg-transparent border-transparent text-primary [a&]:hover:bg-secondary-hover [a&]:hover:text-primary",
|
|
794
781
|
"ghost-success": "bg-transparent border-transparent text-semantic-win [a&]:hover:bg-semantic-win/10 [a&]:hover:text-semantic-win",
|
|
@@ -6924,7 +6911,7 @@ function HeaderNavigationBlock({
|
|
|
6924
6911
|
actions
|
|
6925
6912
|
}) {
|
|
6926
6913
|
var _a;
|
|
6927
|
-
return /* @__PURE__ */ jsx61("div", { className: "w-full min-w-80 max-w-layout-diagram-small
|
|
6914
|
+
return /* @__PURE__ */ jsx61("div", { className: "w-full min-w-80 max-w-layout-diagram-small rounded-md overflow-hidden bg-prominent", children: /* @__PURE__ */ jsxs30("header", { className: "flex items-center gap-2 border-b border-border-subtle bg-prominent px-layout-margin-inline py-3", children: [
|
|
6928
6915
|
onBack && /* @__PURE__ */ jsx61(NavigationButton, { type: "button", size: "md", "aria-label": "Back", onClick: onBack, children: /* @__PURE__ */ jsx61(ArrowLeft2, { className: "size-5" }) }),
|
|
6929
6916
|
/* @__PURE__ */ jsxs30("div", { className: "flex min-w-0 flex-1 items-center justify-center gap-2", children: [
|
|
6930
6917
|
badge && /* @__PURE__ */ jsx61(Badge, { variant: (_a = badge.variant) != null ? _a : "fill-warning", size: "sm", children: badge.label }),
|