@trading-game/design-intelligence-layer 0.16.2 → 0.16.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 +4 -3
- package/dist/index.cjs +17 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -5
- package/dist/index.d.ts +13 -5
- package/dist/index.js +17 -13
- package/dist/index.js.map +1 -1
- package/guides/design-system-guide/trading-game-ds-guide.md +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -113,9 +113,17 @@ interface BannerProps extends Omit<React$1.ComponentProps<"div">, "title" | "onC
|
|
|
113
113
|
/** Description / supporting text. At least one of `title` or `description` is required. */
|
|
114
114
|
description?: React$1.ReactNode;
|
|
115
115
|
/**
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
116
|
+
* The glyph that sits **inside** the default brand-blue badge. Defaults to
|
|
117
|
+
* `<Gift className="size-5" />`. Pass any lucide icon (or other ~20-24px
|
|
118
|
+
* element) to swap the glyph while keeping the badge styling consistent.
|
|
119
|
+
* Ignored when `icon` is also set (which overrides the whole badge).
|
|
120
|
+
*/
|
|
121
|
+
glyph?: React$1.ReactNode;
|
|
122
|
+
/**
|
|
123
|
+
* Full leading-icon override. When set, the consumer's JSX replaces the
|
|
124
|
+
* **entire** default badge — no brand-blue wrapper is rendered. Pass
|
|
125
|
+
* `null` to omit the icon column entirely. Leave undefined to use the
|
|
126
|
+
* default brand badge (with `glyph` inside).
|
|
119
127
|
*/
|
|
120
128
|
icon?: React$1.ReactNode | null;
|
|
121
129
|
/**
|
|
@@ -147,7 +155,7 @@ interface BannerProps extends Omit<React$1.ComponentProps<"div">, "title" | "onC
|
|
|
147
155
|
*/
|
|
148
156
|
onClick?: () => void;
|
|
149
157
|
}
|
|
150
|
-
declare function Banner({ layout, title, description, icon, action, actions, onDismiss, dismissLabel, onClick, className, ...props }: BannerProps): react_jsx_runtime.JSX.Element | null;
|
|
158
|
+
declare function Banner({ layout, title, description, glyph, icon, action, actions, onDismiss, dismissLabel, onClick, className, ...props }: BannerProps): react_jsx_runtime.JSX.Element | null;
|
|
151
159
|
|
|
152
160
|
declare function Breadcrumb({ ...props }: React$1.ComponentProps<"nav">): react_jsx_runtime.JSX.Element;
|
|
153
161
|
declare function BreadcrumbList({ className, ...props }: React$1.ComponentProps<"ol">): react_jsx_runtime.JSX.Element;
|
|
@@ -990,7 +998,7 @@ type OpenPositionsBlockProps = {
|
|
|
990
998
|
sheetTitle?: string;
|
|
991
999
|
/** Position items to render in the list. Empty array → emptyState is shown. */
|
|
992
1000
|
positions: Position[];
|
|
993
|
-
/** Footer link handler. The button label is fixed: "View
|
|
1001
|
+
/** Footer link handler. The button label is fixed: "View trade history". */
|
|
994
1002
|
onViewHistory?: () => void;
|
|
995
1003
|
/** Replaces the default empty state when positions.length === 0. */
|
|
996
1004
|
emptyState?: React$1.ReactNode;
|
package/dist/index.d.ts
CHANGED
|
@@ -113,9 +113,17 @@ interface BannerProps extends Omit<React$1.ComponentProps<"div">, "title" | "onC
|
|
|
113
113
|
/** Description / supporting text. At least one of `title` or `description` is required. */
|
|
114
114
|
description?: React$1.ReactNode;
|
|
115
115
|
/**
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
116
|
+
* The glyph that sits **inside** the default brand-blue badge. Defaults to
|
|
117
|
+
* `<Gift className="size-5" />`. Pass any lucide icon (or other ~20-24px
|
|
118
|
+
* element) to swap the glyph while keeping the badge styling consistent.
|
|
119
|
+
* Ignored when `icon` is also set (which overrides the whole badge).
|
|
120
|
+
*/
|
|
121
|
+
glyph?: React$1.ReactNode;
|
|
122
|
+
/**
|
|
123
|
+
* Full leading-icon override. When set, the consumer's JSX replaces the
|
|
124
|
+
* **entire** default badge — no brand-blue wrapper is rendered. Pass
|
|
125
|
+
* `null` to omit the icon column entirely. Leave undefined to use the
|
|
126
|
+
* default brand badge (with `glyph` inside).
|
|
119
127
|
*/
|
|
120
128
|
icon?: React$1.ReactNode | null;
|
|
121
129
|
/**
|
|
@@ -147,7 +155,7 @@ interface BannerProps extends Omit<React$1.ComponentProps<"div">, "title" | "onC
|
|
|
147
155
|
*/
|
|
148
156
|
onClick?: () => void;
|
|
149
157
|
}
|
|
150
|
-
declare function Banner({ layout, title, description, icon, action, actions, onDismiss, dismissLabel, onClick, className, ...props }: BannerProps): react_jsx_runtime.JSX.Element | null;
|
|
158
|
+
declare function Banner({ layout, title, description, glyph, icon, action, actions, onDismiss, dismissLabel, onClick, className, ...props }: BannerProps): react_jsx_runtime.JSX.Element | null;
|
|
151
159
|
|
|
152
160
|
declare function Breadcrumb({ ...props }: React$1.ComponentProps<"nav">): react_jsx_runtime.JSX.Element;
|
|
153
161
|
declare function BreadcrumbList({ className, ...props }: React$1.ComponentProps<"ol">): react_jsx_runtime.JSX.Element;
|
|
@@ -990,7 +998,7 @@ type OpenPositionsBlockProps = {
|
|
|
990
998
|
sheetTitle?: string;
|
|
991
999
|
/** Position items to render in the list. Empty array → emptyState is shown. */
|
|
992
1000
|
positions: Position[];
|
|
993
|
-
/** Footer link handler. The button label is fixed: "View
|
|
1001
|
+
/** Footer link handler. The button label is fixed: "View trade history". */
|
|
994
1002
|
onViewHistory?: () => void;
|
|
995
1003
|
/** Replaces the default empty state when positions.length === 0. */
|
|
996
1004
|
emptyState?: React$1.ReactNode;
|
package/dist/index.js
CHANGED
|
@@ -821,15 +821,16 @@ function Badge(_a) {
|
|
|
821
821
|
import * as React2 from "react";
|
|
822
822
|
import { Gift, X as X2 } from "lucide-react";
|
|
823
823
|
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
824
|
-
var SURFACE_CLASSES = "w-full rounded-md border border-primary/
|
|
825
|
-
function
|
|
826
|
-
return /* @__PURE__ */ jsx9("span", { className: "inline-flex size-10 shrink-0 items-center justify-center rounded-
|
|
824
|
+
var SURFACE_CLASSES = "w-full rounded-md border border-primary/[0.16] bg-primary/[0.08] px-4 py-3.5";
|
|
825
|
+
function IconBadge({ glyph }) {
|
|
826
|
+
return /* @__PURE__ */ jsx9("span", { className: "inline-flex size-10 shrink-0 items-center justify-center rounded-xs bg-primary text-on-primary", children: glyph });
|
|
827
827
|
}
|
|
828
828
|
function Banner(_a) {
|
|
829
829
|
var _b = _a, {
|
|
830
830
|
layout = "inline",
|
|
831
831
|
title,
|
|
832
832
|
description,
|
|
833
|
+
glyph,
|
|
833
834
|
icon,
|
|
834
835
|
action,
|
|
835
836
|
actions,
|
|
@@ -841,6 +842,7 @@ function Banner(_a) {
|
|
|
841
842
|
"layout",
|
|
842
843
|
"title",
|
|
843
844
|
"description",
|
|
845
|
+
"glyph",
|
|
844
846
|
"icon",
|
|
845
847
|
"action",
|
|
846
848
|
"actions",
|
|
@@ -860,7 +862,12 @@ function Banner(_a) {
|
|
|
860
862
|
}
|
|
861
863
|
const isInline = layout === "inline";
|
|
862
864
|
const showIcon = icon !== null;
|
|
863
|
-
const resolvedIcon = icon === void 0 ? /* @__PURE__ */ jsx9(
|
|
865
|
+
const resolvedIcon = icon === void 0 ? /* @__PURE__ */ jsx9(IconBadge, { glyph: glyph != null ? glyph : /* @__PURE__ */ jsx9(Gift, { className: "size-5" }) }) : icon;
|
|
866
|
+
if (process.env.NODE_ENV !== "production" && icon !== void 0 && glyph !== void 0) {
|
|
867
|
+
console.warn(
|
|
868
|
+
"Banner: `glyph` is ignored when `icon` is also set. `icon` overrides the entire badge; `glyph` only swaps the inner icon of the default badge."
|
|
869
|
+
);
|
|
870
|
+
}
|
|
864
871
|
const showCloseButton = typeof onDismiss === "function";
|
|
865
872
|
const isClickable = typeof onClick === "function";
|
|
866
873
|
const buttonsSuppressed = isClickable && (Boolean(action) || ((_a2 = actions == null ? void 0 : actions.length) != null ? _a2 : 0) > 0);
|
|
@@ -935,7 +942,7 @@ function Banner(_a) {
|
|
|
935
942
|
/* @__PURE__ */ jsx9("div", { className: "col-start-1 row-start-1", children: iconColumn }),
|
|
936
943
|
/* @__PURE__ */ jsx9("div", { className: "col-start-2 row-start-1 min-w-0", children: body }),
|
|
937
944
|
/* @__PURE__ */ jsx9("div", { className: "col-start-3 row-start-1 sm:col-start-4", children: closeButton }),
|
|
938
|
-
hasAction ? /* @__PURE__ */ jsx9("div", { className: "col-start-2 row-start-2 justify-self-start sm:col-start-3 sm:row-start-1 sm:self-center sm:justify-self-end", children: wrapAction2(effectiveAction
|
|
945
|
+
hasAction ? /* @__PURE__ */ jsx9("div", { className: "col-start-2 row-start-2 justify-self-start sm:col-start-3 sm:row-start-1 sm:self-center sm:justify-self-end", children: wrapAction2(effectiveAction) }) : null
|
|
939
946
|
]
|
|
940
947
|
})
|
|
941
948
|
);
|
|
@@ -957,17 +964,14 @@ function Banner(_a) {
|
|
|
957
964
|
/* @__PURE__ */ jsx9("div", { className: "col-start-1 row-start-1", children: iconColumn }),
|
|
958
965
|
/* @__PURE__ */ jsx9("div", { className: "col-start-2 row-start-1 min-w-0", children: body }),
|
|
959
966
|
/* @__PURE__ */ jsx9("div", { className: "col-start-3 row-start-1", children: closeButton }),
|
|
960
|
-
effectiveActions && effectiveActions.length > 0 ? /* @__PURE__ */ jsx9("div", { className: "col-span-3 col-start-2 row-start-2 flex flex-wrap items-center justify-start gap-2", children: effectiveActions.slice(0, 2).map((node, i) => {
|
|
961
|
-
const fallbackVariant = i === 0 ? "secondary" : "primary";
|
|
962
|
-
return /* @__PURE__ */ jsx9(React2.Fragment, { children: wrapAction2(node, fallbackVariant) }, i);
|
|
963
|
-
}) }) : null
|
|
967
|
+
effectiveActions && effectiveActions.length > 0 ? /* @__PURE__ */ jsx9("div", { className: "col-span-3 col-start-2 row-start-2 flex flex-wrap items-center justify-start gap-2", children: effectiveActions.slice(0, 2).map((node, i) => /* @__PURE__ */ jsx9(React2.Fragment, { children: wrapAction2(node) }, i)) }) : null
|
|
964
968
|
]
|
|
965
969
|
})
|
|
966
970
|
);
|
|
967
971
|
}
|
|
968
|
-
function wrapAction2(node
|
|
972
|
+
function wrapAction2(node) {
|
|
969
973
|
if (React2.isValidElement(node)) return node;
|
|
970
|
-
return /* @__PURE__ */ jsx9(Button, { variant:
|
|
974
|
+
return /* @__PURE__ */ jsx9(Button, { variant: "secondary", size: "sm", children: node });
|
|
971
975
|
}
|
|
972
976
|
|
|
973
977
|
// components/ui/breadcrumb.tsx
|
|
@@ -7402,7 +7406,7 @@ function PositionsList({
|
|
|
7402
7406
|
i < positions.length - 1 && /* @__PURE__ */ jsx67("div", { className: "h-px mx-4 bg-border-subtle" })
|
|
7403
7407
|
] }, i)) }),
|
|
7404
7408
|
/* @__PURE__ */ jsx67(Separator, {}),
|
|
7405
|
-
/* @__PURE__ */ jsx67("div", { className: "shrink-0 flex justify-center py-4", children: /* @__PURE__ */ jsx67(Button, { variant: "tertiary", size: "md", onClick: onViewHistory, children: "View
|
|
7409
|
+
/* @__PURE__ */ jsx67("div", { className: "shrink-0 flex justify-center py-4", children: /* @__PURE__ */ jsx67(Button, { variant: "tertiary", size: "md", onClick: onViewHistory, children: "View trade history" }) })
|
|
7406
7410
|
] });
|
|
7407
7411
|
}
|
|
7408
7412
|
function PositionRow({ position }) {
|
|
@@ -7457,7 +7461,7 @@ function DefaultEmptyState({ onViewHistory }) {
|
|
|
7457
7461
|
return /* @__PURE__ */ jsx67(Empty, { className: "flex min-h-0 flex-1 flex-col justify-center border-none rounded-none p-6 text-center", children: /* @__PURE__ */ jsxs36(EmptyHeader, { className: "gap-4", children: [
|
|
7458
7462
|
/* @__PURE__ */ jsx67(EmptyMedia, { children: /* @__PURE__ */ jsx67(History2, { className: "size-8 text-on-subtle" }) }),
|
|
7459
7463
|
/* @__PURE__ */ jsx67(EmptyTitle, { className: "text-base leading-6 font-semibold tracking-normal body-md text-on-subtle", children: "No trades yet." }),
|
|
7460
|
-
/* @__PURE__ */ jsx67(Button, { variant: "tertiary", size: "md", onClick: onViewHistory, children: "View
|
|
7464
|
+
/* @__PURE__ */ jsx67(Button, { variant: "tertiary", size: "md", onClick: onViewHistory, children: "View trade history" })
|
|
7461
7465
|
] }) });
|
|
7462
7466
|
}
|
|
7463
7467
|
export {
|