@trading-game/design-intelligence-layer 0.17.0 → 0.17.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 CHANGED
@@ -103,7 +103,7 @@ npm install react react-dom tailwindcss
103
103
  | Aspect Ratio | `AspectRatio` |
104
104
  | Avatar | `Avatar, AvatarImage, AvatarFallback, AvatarBadge, AvatarGroup` |
105
105
  | Badge | `Badge, badgeVariants` |
106
- | Banner | `Banner` — dismissible promotional surface on a tinted primary surface. Brand-blue circular `IconBadge` (40 px) with a swappable `glyph` (or pass `icon` to override the badge entirely). Layouts: `inline`, `card`. Slots: `title`, `description`, `icon`/`glyph`, `action`, `actions`, `onDismiss`, `onClick` (whole-banner clickable). |
106
+ | Banner | `Banner` — dismissible promotional surface on a tinted primary surface. Brand-blue square `IconBadge` (40 px, `rounded-xs`) with a swappable `glyph` (or pass `icon` to override the badge entirely). Layouts: `inline`, `card`. Slots: `title`, `description`, `icon`/`glyph`, `action`, `actions`, `onDismiss`, `onClick` (whole-banner clickable). |
107
107
  | Breadcrumb | `Breadcrumb, BreadcrumbList, BreadcrumbItem, ...` |
108
108
  | Button | `Button, buttonVariants` |
109
109
  | Calendar | `Calendar, CalendarDayButton` |
@@ -337,8 +337,9 @@ Dismissible **promotional / marketing** surface — for feature launches, offers
337
337
  ```
338
338
 
339
339
  **Visual:**
340
- - Surface: tinted primary surface — `bg-primary/[0.08]` with `border-primary/[0.16]` edge, `rounded-md`.
341
- - Default icon: 40 px brand-blue **circle** (`rounded-full bg-primary`) with a white `Gift` glyph inside. 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
+ - Surface: tinted primary surface — `bg-primary/[0.08]` with `border-primary/[0.16]` edge, `rounded-sm` (6 px — matches Card and Alert).
341
+ - Default icon: 40 px brand-blue **square** (`rounded-xs bg-primary`, 4 px corners) with a white `Gift` glyph inside. 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.
342
+ - **Multi-line layout** (description set, or `layout="card"`): the leading icon top-aligns with the title (grid uses `items-start`) so it sits beside the headline rather than floating mid-body. Single-line banners stay vertically centred (`items-center`).
342
343
  - 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.
343
344
  - Title supports `<b>` children styled with `text-primary` for in-line brand-blue accent.
344
345
  - Close X (32 px): vertically-centred in the grid for single-line banners; pinned to the **top-right corner** (`absolute top-3 right-3`) when the banner is multi-line (`description` set) or `layout="card"` — so it reads as a true corner dismiss instead of floating mid-body. Hovers to `bg-secondary-hover`.
@@ -722,7 +723,10 @@ Design tokens are managed in Figma and exported as CSS variables. To update:
722
723
  ### v0.16.7
723
724
  - **Credit badge readability pass:** `<Badge variant="fill-credit">` and the credit pill inside `CreditTicketCard` now sit on a deeper peach surface and use a bold deep-amber text for crisper read on the grey `bg-subtle` ticket card and on white / brand-blue surfaces alike. Token chain: `--primitive-amber-100` (#FEEBD9) → `--primitive-amber-300` (#FDCA8A) and `--primitive-amber-800` (#713813) → `--primitive-amber-900` (#521900). `--semantic-boost-surface` and `--on-semantic-boost` are repointed automatically. Variant class also bumps to `!font-bold`.
724
725
  - **CreditTicketCard — responsive compact layout:** Compact variant now keeps the credit badge inline next to the value when there's room and only wraps to a second line when balance + badge would overflow into the deposit stub (`flex-wrap` on the value/badge row, with `whitespace-nowrap` on the value so the number itself never splits). Non-compact keeps the existing inline behavior.
725
- - **Banner — brand `IconBadge` is now a circle:** The 40 px brand-blue icon badge (visible when the consumer passes a `glyph` prop) is now `rounded-full` instead of `rounded-xs`. No API change.
726
+ - **Banner — outer corner radius unified with Card / Alert:** outer surface `rounded-md` (8 px) → `rounded-sm` (6 px). Brand `IconBadge` reverted to `rounded-xs` (4 px square) after a brief detour through `rounded-full` — the square reads better against the surface.
727
+ - **Banner — multi-line icon top-alignment:** when a description is present (or `layout="card"`), the grid switches from `items-center` to `items-start` so the leading icon aligns with the title's top instead of sliding to the middle of the body block as it wraps.
728
+ - **Banner — class-order fix for `pr-12`:** in the card branch, `pr-12` was being merged before `SURFACE_CLASSES`'s `px-4`, so tailwind-merge kept the smaller right padding and long descriptions wrapped under the absolute-positioned close X. Re-ordering the `cn()` arguments puts `pr-12` after `SURFACE_CLASSES` so it wins (48 px right padding).
729
+ - **Alert — card layout body/close cell overlap fixed:** card body changed from `col-span-2 col-start-2` to `col-start-2 min-w-0`. Previously the body spanned cols 2-3 (same cell as the close X), so long descriptions slid under the close. Now the body lives in col 2 only and the close owns col 3.
726
730
  - **Tooltip — `max-w-xs` + `whitespace-normal` built into the primitive:** Desktop tooltips now cap at 320 px by default with natural-word wrapping; consumers no longer need to pass these classes. Mobile drawers (the responsive Tooltip mode) keep the full sheet width — the consumer `className` is no longer applied to the drawer's inner content wrapper, so passing `max-w-xs` on `TooltipContent` for desktop tuning no longer leaks into and shrinks the mobile drawer text.
727
731
  - **Naming note:** the v0.14.0 entry below claimed a `fill-credit` → `fill-boost` and `CreditTicketCard` → `BoostTicketCard` rename. **Those renames were not landed** — the current shipped names are still `fill-credit`, `CreditTicketCard`, and `--semantic-boost-surface` / `--on-semantic-boost` (the boost tokens stayed, the variant/component names didn't get renamed alongside them).
728
732
 
package/dist/index.cjs CHANGED
@@ -813,7 +813,7 @@ function Alert(_a) {
813
813
  }, props), {
814
814
  children: [
815
815
  iconColumn,
816
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "col-span-2 col-start-2 row-start-1", children: body }),
816
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "col-start-2 row-start-1 min-w-0", children: body }),
817
817
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "col-start-3 row-start-1", children: closeButton }),
818
818
  actions && actions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "col-span-3 col-start-2 row-start-2 mt-2 flex flex-wrap items-center justify-start gap-2", children: actions.slice(0, 2).map((node, i) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(React.Fragment, { children: wrapAction(node, buttonVariant) }, i)) }) : null
819
819
  ]
@@ -1178,9 +1178,9 @@ function Badge(_a) {
1178
1178
  var React2 = __toESM(require("react"), 1);
1179
1179
  var import_lucide_react3 = require("lucide-react");
1180
1180
  var import_jsx_runtime9 = require("react/jsx-runtime");
1181
- var SURFACE_CLASSES = "w-full rounded-md border border-primary/[0.16] bg-primary/[0.08] px-4 py-3.5";
1181
+ var SURFACE_CLASSES = "w-full rounded-sm border border-primary/[0.16] bg-primary/[0.08] px-4 py-3.5";
1182
1182
  function IconBadge({ glyph }) {
1183
- 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: glyph });
1183
+ 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 });
1184
1184
  }
1185
1185
  function Banner(_a) {
1186
1186
  var _b = _a, {
@@ -1290,7 +1290,11 @@ function Banner(_a) {
1290
1290
  "data-layout": "inline",
1291
1291
  "data-clickable": isClickable ? "true" : void 0,
1292
1292
  className: cn(
1293
- "grid items-center gap-x-4",
1293
+ "grid gap-x-4",
1294
+ // Single-line banners vertically-centre the row (icon + title);
1295
+ // multi-line banners top-align so the leading icon sits next to
1296
+ // the title instead of floating mid-body.
1297
+ hasDescription ? "items-start" : "items-center",
1294
1298
  gridCols,
1295
1299
  rowTemplate,
1296
1300
  SURFACE_CLASSES,
@@ -1315,8 +1319,10 @@ function Banner(_a) {
1315
1319
  "data-layout": "card",
1316
1320
  "data-clickable": isClickable ? "true" : void 0,
1317
1321
  className: cn(
1318
- "relative grid grid-cols-[auto_1fr] grid-rows-[auto_auto] items-center gap-x-4 gap-y-3 pr-12",
1322
+ // Card layout is always multi-row — top-align the icon with the title.
1323
+ "relative grid grid-cols-[auto_1fr] grid-rows-[auto_auto] items-start gap-x-4 gap-y-3",
1319
1324
  SURFACE_CLASSES,
1325
+ "pr-12",
1320
1326
  clickableClasses,
1321
1327
  className
1322
1328
  )