@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 CHANGED
@@ -308,7 +308,8 @@ Dismissible **promotional / marketing** surface — for feature launches, offers
308
308
  layout="inline"
309
309
  title={<>Spring release <b>is here.</b></>} // wrap emphasis in <b> for brand-blue accent
310
310
  description="New features just landed — take a look at what's changed."
311
- icon={<MyIcon />} // omit to use the default 40px brand-blue gift badge
311
+ glyph={<Sparkles className="size-5" />} // swaps the icon *inside* the default brand badge (default <Gift />)
312
+ icon={<MyIcon />} // full override — replaces the brand badge entirely; null to omit
312
313
  action="Get started" // string wrapped in Button variant="primary"
313
314
  onDismiss={() => setOpen(false)} // when provided, close X is rendered
314
315
  dismissLabel="Dismiss" // aria-label for the close X
@@ -335,8 +336,8 @@ Dismissible **promotional / marketing** surface — for feature launches, offers
335
336
 
336
337
  **Visual:**
337
338
  - Surface: 135° diagonal gradient `#EBEBFF → #FFFFFF` with `border-primary/20` light-blue edge.
338
- - Default icon: 40px brand-blue circle with a white `Gift` glyph. Override via `icon` (pass any `ReactNode`) or `icon={null}` to omit.
339
- - Default action button: `Button variant="primary"` (single inline action) or `[Secondary, Primary]` pair (card actions). Pass `<Button>` elements explicitly to override variant/size.
339
+ - Default icon: 40px brand-blue square (4px corners, matches the trading.game logo) with a white `Gift` glyph. Swap just the glyph via the `glyph` prop (e.g. `<Sparkles className="size-5" />`); replace the entire badge via the `icon` prop; or `icon={null}` to omit the column entirely.
340
+ - Default action button: `Button variant="secondary"` size `sm` for every slot (inline `action` and both `actions[]` in card). Pass `<Button>` elements explicitly to override variant/size.
340
341
  - Title supports `<b>` children styled with `text-primary` for in-line brand-blue accent.
341
342
  - Close X (32px) hovers to `bg-secondary-hover`.
342
343
 
package/dist/index.cjs CHANGED
@@ -1176,15 +1176,16 @@ function Badge(_a) {
1176
1176
  var React2 = __toESM(require("react"), 1);
1177
1177
  var import_lucide_react3 = require("lucide-react");
1178
1178
  var import_jsx_runtime9 = require("react/jsx-runtime");
1179
- var SURFACE_CLASSES = "w-full rounded-md border border-primary/20 bg-[linear-gradient(135deg,#EBEBFF_0%,#FFFFFF_100%)] px-4 py-3.5";
1180
- function DefaultIconBadge() {
1181
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "inline-flex size-10 shrink-0 items-center justify-center rounded-full bg-primary text-on-primary", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Gift, { className: "size-5" }) });
1179
+ var SURFACE_CLASSES = "w-full rounded-md border border-primary/[0.16] bg-primary/[0.08] px-4 py-3.5";
1180
+ function IconBadge({ glyph }) {
1181
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "inline-flex size-10 shrink-0 items-center justify-center rounded-xs bg-primary text-on-primary", children: glyph });
1182
1182
  }
1183
1183
  function Banner(_a) {
1184
1184
  var _b = _a, {
1185
1185
  layout = "inline",
1186
1186
  title,
1187
1187
  description,
1188
+ glyph,
1188
1189
  icon,
1189
1190
  action,
1190
1191
  actions,
@@ -1196,6 +1197,7 @@ function Banner(_a) {
1196
1197
  "layout",
1197
1198
  "title",
1198
1199
  "description",
1200
+ "glyph",
1199
1201
  "icon",
1200
1202
  "action",
1201
1203
  "actions",
@@ -1215,7 +1217,12 @@ function Banner(_a) {
1215
1217
  }
1216
1218
  const isInline = layout === "inline";
1217
1219
  const showIcon = icon !== null;
1218
- const resolvedIcon = icon === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DefaultIconBadge, {}) : icon;
1220
+ const resolvedIcon = icon === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconBadge, { glyph: glyph != null ? glyph : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Gift, { className: "size-5" }) }) : icon;
1221
+ if (process.env.NODE_ENV !== "production" && icon !== void 0 && glyph !== void 0) {
1222
+ console.warn(
1223
+ "Banner: `glyph` is ignored when `icon` is also set. `icon` overrides the entire badge; `glyph` only swaps the inner icon of the default badge."
1224
+ );
1225
+ }
1219
1226
  const showCloseButton = typeof onDismiss === "function";
1220
1227
  const isClickable = typeof onClick === "function";
1221
1228
  const buttonsSuppressed = isClickable && (Boolean(action) || ((_a2 = actions == null ? void 0 : actions.length) != null ? _a2 : 0) > 0);
@@ -1290,7 +1297,7 @@ function Banner(_a) {
1290
1297
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "col-start-1 row-start-1", children: iconColumn }),
1291
1298
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "col-start-2 row-start-1 min-w-0", children: body }),
1292
1299
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "col-start-3 row-start-1 sm:col-start-4", children: closeButton }),
1293
- hasAction ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("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, "primary") }) : null
1300
+ hasAction ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("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
1294
1301
  ]
1295
1302
  })
1296
1303
  );
@@ -1312,17 +1319,14 @@ function Banner(_a) {
1312
1319
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "col-start-1 row-start-1", children: iconColumn }),
1313
1320
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "col-start-2 row-start-1 min-w-0", children: body }),
1314
1321
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "col-start-3 row-start-1", children: closeButton }),
1315
- effectiveActions && effectiveActions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("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) => {
1316
- const fallbackVariant = i === 0 ? "secondary" : "primary";
1317
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(React2.Fragment, { children: wrapAction2(node, fallbackVariant) }, i);
1318
- }) }) : null
1322
+ effectiveActions && effectiveActions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("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__ */ (0, import_jsx_runtime9.jsx)(React2.Fragment, { children: wrapAction2(node) }, i)) }) : null
1319
1323
  ]
1320
1324
  })
1321
1325
  );
1322
1326
  }
1323
- function wrapAction2(node, defaultVariant = "primary") {
1327
+ function wrapAction2(node) {
1324
1328
  if (React2.isValidElement(node)) return node;
1325
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Button, { variant: defaultVariant, size: "sm", children: node });
1329
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Button, { variant: "secondary", size: "sm", children: node });
1326
1330
  }
1327
1331
 
1328
1332
  // components/ui/breadcrumb.tsx
@@ -7735,7 +7739,7 @@ function PositionsList({
7735
7739
  i < positions.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "h-px mx-4 bg-border-subtle" })
7736
7740
  ] }, i)) }),
7737
7741
  /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Separator, {}),
7738
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "shrink-0 flex justify-center py-4", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Button, { variant: "tertiary", size: "md", onClick: onViewHistory, children: "View transaction history" }) })
7742
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "shrink-0 flex justify-center py-4", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Button, { variant: "tertiary", size: "md", onClick: onViewHistory, children: "View trade history" }) })
7739
7743
  ] });
7740
7744
  }
7741
7745
  function PositionRow({ position }) {
@@ -7790,7 +7794,7 @@ function DefaultEmptyState({ onViewHistory }) {
7790
7794
  return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Empty, { className: "flex min-h-0 flex-1 flex-col justify-center border-none rounded-none p-6 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(EmptyHeader, { className: "gap-4", children: [
7791
7795
  /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(EmptyMedia, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react29.History, { className: "size-8 text-on-subtle" }) }),
7792
7796
  /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(EmptyTitle, { className: "text-base leading-6 font-semibold tracking-normal body-md text-on-subtle", children: "No trades yet." }),
7793
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Button, { variant: "tertiary", size: "md", onClick: onViewHistory, children: "View transaction history" })
7797
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Button, { variant: "tertiary", size: "md", onClick: onViewHistory, children: "View trade history" })
7794
7798
  ] }) });
7795
7799
  }
7796
7800
  // Annotate the CommonJS export names for ESM import in node: