@trading-game/design-intelligence-layer 0.13.2 → 0.14.0

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/dist/index.d.cts CHANGED
@@ -65,7 +65,7 @@ declare function AvatarGroup({ className, ...props }: React$1.ComponentProps<"di
65
65
  declare function AvatarGroupCount({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
66
66
 
67
67
  declare const badgeVariants: (props?: ({
68
- variant?: "fill" | "default" | "default-success" | "default-fail" | "default-warning" | "fill-success" | "fill-fail" | "fill-warning" | "fill-boost" | "ghost" | "ghost-success" | "ghost-fail" | "ghost-warning" | null | undefined;
68
+ variant?: "fill" | "default" | "standard" | "default-success" | "default-fail" | "default-warning" | "fill-success" | "fill-fail" | "fill-warning" | "fill-boost" | "ghost" | "ghost-success" | "ghost-fail" | "ghost-warning" | null | undefined;
69
69
  size?: "lg" | "md" | "sm" | null | undefined;
70
70
  } & class_variance_authority_types.ClassProp) | undefined) => string;
71
71
  declare function Badge({ className, variant, size, asChild, ...props }: React$1.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
@@ -700,10 +700,23 @@ type BoostTicketCardProps = {
700
700
  * Defaults to `"center"`.
701
701
  */
702
702
  boostInfoAlign?: "start" | "center" | "end";
703
+ /**
704
+ * Heading shown at the top of the mobile drawer (forwarded to
705
+ * `TooltipContent.title`). Desktop tooltip ignores this. When omitted, the
706
+ * underlying `TooltipContent` falls back to its own `"Title"` placeholder.
707
+ */
708
+ boostInfoTitle?: string;
709
+ /**
710
+ * Label on the dismiss button at the bottom of the mobile drawer (forwarded
711
+ * to `TooltipContent.closeLabel`). Desktop tooltip ignores this. When
712
+ * omitted, the underlying `TooltipContent` falls back to its own `"Label"`
713
+ * placeholder.
714
+ */
715
+ boostInfoCloseLabel?: string;
703
716
  /** Compact (mobile) layout — reduces horizontal padding from 16px to 8px. */
704
717
  compact?: boolean;
705
718
  };
706
- declare function BoostTicketCard({ className, icon, label, value, currency, stubLabel, onStubClick, stubDisabled, boostAmount, boostCurrency, boostInfo, boostInfoSide, boostInfoAlign, compact, }: BoostTicketCardProps): react_jsx_runtime.JSX.Element;
719
+ declare function BoostTicketCard({ className, icon, label, value, currency, stubLabel, onStubClick, stubDisabled, boostAmount, boostCurrency, boostInfo, boostInfoSide, boostInfoAlign, boostInfoTitle, boostInfoCloseLabel, compact, }: BoostTicketCardProps): react_jsx_runtime.JSX.Element;
707
720
  /** Alias for the Figma-named variant. */
708
721
  declare const TicketCardDesktop: typeof TicketCard;
709
722
 
package/dist/index.d.ts CHANGED
@@ -65,7 +65,7 @@ declare function AvatarGroup({ className, ...props }: React$1.ComponentProps<"di
65
65
  declare function AvatarGroupCount({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
66
66
 
67
67
  declare const badgeVariants: (props?: ({
68
- variant?: "fill" | "default" | "default-success" | "default-fail" | "default-warning" | "fill-success" | "fill-fail" | "fill-warning" | "fill-boost" | "ghost" | "ghost-success" | "ghost-fail" | "ghost-warning" | null | undefined;
68
+ variant?: "fill" | "default" | "standard" | "default-success" | "default-fail" | "default-warning" | "fill-success" | "fill-fail" | "fill-warning" | "fill-boost" | "ghost" | "ghost-success" | "ghost-fail" | "ghost-warning" | null | undefined;
69
69
  size?: "lg" | "md" | "sm" | null | undefined;
70
70
  } & class_variance_authority_types.ClassProp) | undefined) => string;
71
71
  declare function Badge({ className, variant, size, asChild, ...props }: React$1.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
@@ -700,10 +700,23 @@ type BoostTicketCardProps = {
700
700
  * Defaults to `"center"`.
701
701
  */
702
702
  boostInfoAlign?: "start" | "center" | "end";
703
+ /**
704
+ * Heading shown at the top of the mobile drawer (forwarded to
705
+ * `TooltipContent.title`). Desktop tooltip ignores this. When omitted, the
706
+ * underlying `TooltipContent` falls back to its own `"Title"` placeholder.
707
+ */
708
+ boostInfoTitle?: string;
709
+ /**
710
+ * Label on the dismiss button at the bottom of the mobile drawer (forwarded
711
+ * to `TooltipContent.closeLabel`). Desktop tooltip ignores this. When
712
+ * omitted, the underlying `TooltipContent` falls back to its own `"Label"`
713
+ * placeholder.
714
+ */
715
+ boostInfoCloseLabel?: string;
703
716
  /** Compact (mobile) layout — reduces horizontal padding from 16px to 8px. */
704
717
  compact?: boolean;
705
718
  };
706
- declare function BoostTicketCard({ className, icon, label, value, currency, stubLabel, onStubClick, stubDisabled, boostAmount, boostCurrency, boostInfo, boostInfoSide, boostInfoAlign, compact, }: BoostTicketCardProps): react_jsx_runtime.JSX.Element;
719
+ declare function BoostTicketCard({ className, icon, label, value, currency, stubLabel, onStubClick, stubDisabled, boostAmount, boostCurrency, boostInfo, boostInfoSide, boostInfoAlign, boostInfoTitle, boostInfoCloseLabel, compact, }: BoostTicketCardProps): react_jsx_runtime.JSX.Element;
707
720
  /** Alias for the Figma-named variant. */
708
721
  declare const TicketCardDesktop: typeof TicketCard;
709
722
 
package/dist/index.js CHANGED
@@ -594,6 +594,8 @@ var badgeVariants = cva3(
594
594
  variant: {
595
595
  // Default (solid)
596
596
  default: "bg-primary text-on-primary [a&]:hover:bg-primary/90",
597
+ // Standard (neutral chip — for non-status meta like contract type, duration)
598
+ standard: "bg-subtle text-on-prominent [a&]:hover:bg-subtle/80",
597
599
  "default-success": "bg-semantic-win text-on-semantic-win [a&]:hover:bg-semantic-win/90",
598
600
  "default-fail": "bg-semantic-loss text-on-semantic-loss [a&]:hover:bg-semantic-loss/90",
599
601
  "default-warning": "bg-semantic-warning text-on-semantic-warning [a&]:hover:bg-semantic-warning/90",
@@ -6319,6 +6321,18 @@ function TabsContent(_a) {
6319
6321
  // components/ui/ticket-card.tsx
6320
6322
  import { ArrowRight as ArrowRight2, Info, Rocket } from "lucide-react";
6321
6323
  import { Fragment as Fragment3, jsx as jsx57, jsxs as jsxs27 } from "react/jsx-runtime";
6324
+ function formatBalanceValue(raw) {
6325
+ const match = raw.match(/^(\D*)([\d,]+(?:\.\d+)?)(\D*)$/);
6326
+ if (!match) return raw;
6327
+ const [, prefix = "", numericPart, suffix = ""] = match;
6328
+ const parsed = Number.parseFloat(numericPart.replace(/,/g, ""));
6329
+ if (Number.isNaN(parsed)) return raw;
6330
+ const formatted = parsed.toLocaleString("en-US", {
6331
+ minimumFractionDigits: 2,
6332
+ maximumFractionDigits: 2
6333
+ });
6334
+ return `${prefix}${formatted}${suffix}`;
6335
+ }
6322
6336
  function TicketCard({
6323
6337
  className,
6324
6338
  icon,
@@ -6336,7 +6350,7 @@ function TicketCard({
6336
6350
  /* @__PURE__ */ jsxs27("div", { className: "flex h-11 flex-col justify-center gap-1 whitespace-nowrap", children: [
6337
6351
  /* @__PURE__ */ jsx57("p", { className: "text-xs text-on-subtle", children: label }),
6338
6352
  /* @__PURE__ */ jsxs27("p", { className: "leading-none", children: [
6339
- /* @__PURE__ */ jsx57("span", { className: "text-[20px] font-bold text-on-prominent", children: value }),
6353
+ /* @__PURE__ */ jsx57("span", { className: "text-[20px] font-bold text-on-prominent", children: formatBalanceValue(value) }),
6340
6354
  currency && /* @__PURE__ */ jsxs27(Fragment3, { children: [
6341
6355
  " ",
6342
6356
  /* @__PURE__ */ jsx57("span", { className: "text-sm text-on-subtle", children: currency })
@@ -6402,43 +6416,67 @@ function BoostTicketCard({
6402
6416
  boostInfo,
6403
6417
  boostInfoSide = "top",
6404
6418
  boostInfoAlign = "center",
6419
+ boostInfoTitle,
6420
+ boostInfoCloseLabel,
6405
6421
  compact = false
6406
6422
  }) {
6407
6423
  return /* @__PURE__ */ jsx57("div", { className: cn("flex w-full flex-col gap-2", className), children: /* @__PURE__ */ jsxs27("div", { className: "relative flex w-full items-stretch justify-between rounded-sm bg-subtle", children: [
6408
- /* @__PURE__ */ jsxs27("div", { className: cn("flex flex-1 items-center overflow-hidden py-4", compact ? "gap-2 px-2" : "gap-4 px-4"), children: [
6409
- icon && /* @__PURE__ */ jsx57("div", { className: "flex size-10 shrink-0 items-center justify-center rounded-full border-2 border-primary text-primary", children: icon }),
6410
- /* @__PURE__ */ jsxs27("div", { className: "flex flex-col gap-2 whitespace-nowrap", children: [
6411
- /* @__PURE__ */ jsxs27("div", { className: "flex flex-col gap-1", children: [
6412
- /* @__PURE__ */ jsx57("p", { className: "text-xs text-on-subtle", children: label }),
6413
- /* @__PURE__ */ jsxs27("p", { className: "leading-none", children: [
6414
- /* @__PURE__ */ jsx57("span", { className: "text-[20px] font-bold text-on-prominent", children: value }),
6415
- currency && /* @__PURE__ */ jsxs27(Fragment3, { children: [
6416
- " ",
6417
- /* @__PURE__ */ jsx57("span", { className: "text-sm text-on-subtle", children: currency })
6418
- ] })
6424
+ (() => {
6425
+ const boostBadge = /* @__PURE__ */ jsxs27(Badge, { variant: "fill-boost", size: "sm", className: "!gap-1 !font-medium !tracking-normal", children: [
6426
+ /* @__PURE__ */ jsx57(Rocket, { className: "!size-3.5", strokeWidth: 2 }),
6427
+ "Boost: ",
6428
+ boostAmount,
6429
+ " ",
6430
+ boostCurrency,
6431
+ boostInfo && /* @__PURE__ */ jsx57(TooltipProvider, { children: /* @__PURE__ */ jsxs27(Tooltip2, { children: [
6432
+ /* @__PURE__ */ jsx57(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx57(
6433
+ "button",
6434
+ {
6435
+ type: "button",
6436
+ "aria-label": "More info about boost",
6437
+ className: "inline-flex shrink-0 items-center justify-center rounded-full text-on-semantic-boost outline-none transition-opacity hover:opacity-70 focus-visible:opacity-70 focus-visible:ring-2 focus-visible:ring-on-semantic-boost/40 cursor-pointer",
6438
+ children: /* @__PURE__ */ jsx57(Info, { className: "!size-3.5", strokeWidth: 2 })
6439
+ }
6440
+ ) }),
6441
+ /* @__PURE__ */ jsx57(TooltipContent, { side: boostInfoSide, align: boostInfoAlign, title: boostInfoTitle, closeLabel: boostInfoCloseLabel, variant: "inverse", className: "max-w-xs whitespace-normal", children: boostInfo })
6442
+ ] }) })
6443
+ ] });
6444
+ const labelValue = /* @__PURE__ */ jsxs27(Fragment3, { children: [
6445
+ /* @__PURE__ */ jsx57("p", { className: "text-xs text-on-subtle", children: label }),
6446
+ /* @__PURE__ */ jsxs27("p", { className: "leading-none", children: [
6447
+ /* @__PURE__ */ jsx57("span", { className: "text-[20px] font-bold text-on-prominent", children: formatBalanceValue(value) }),
6448
+ currency && /* @__PURE__ */ jsxs27(Fragment3, { children: [
6449
+ " ",
6450
+ /* @__PURE__ */ jsx57("span", { className: "text-sm text-on-subtle", children: currency })
6419
6451
  ] })
6420
- ] }),
6421
- /* @__PURE__ */ jsxs27(Badge, { variant: "fill-boost", size: "sm", className: "!gap-1 !font-medium !tracking-normal", children: [
6422
- /* @__PURE__ */ jsx57(Rocket, { className: "!size-3.5", strokeWidth: 2 }),
6423
- "Boost: ",
6424
- boostAmount,
6425
- " ",
6426
- boostCurrency,
6427
- boostInfo && /* @__PURE__ */ jsx57(TooltipProvider, { children: /* @__PURE__ */ jsxs27(Tooltip2, { children: [
6428
- /* @__PURE__ */ jsx57(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx57(
6429
- "button",
6430
- {
6431
- type: "button",
6432
- "aria-label": "More info about boost",
6433
- className: "inline-flex shrink-0 items-center justify-center rounded-full text-on-semantic-boost outline-none transition-opacity hover:opacity-70 focus-visible:opacity-70 focus-visible:ring-2 focus-visible:ring-on-semantic-boost/40 cursor-pointer",
6434
- children: /* @__PURE__ */ jsx57(Info, { className: "!size-3.5", strokeWidth: 2 })
6435
- }
6436
- ) }),
6437
- /* @__PURE__ */ jsx57(TooltipContent, { side: boostInfoSide, align: boostInfoAlign, variant: "inverse", className: "max-w-xs whitespace-normal", children: boostInfo })
6438
- ] }) })
6439
6452
  ] })
6440
- ] })
6441
- ] }),
6453
+ ] });
6454
+ return /* @__PURE__ */ jsxs27("div", { className: cn("flex flex-1 items-center overflow-hidden py-4", compact ? "gap-2 px-2" : "gap-4 px-4"), children: [
6455
+ icon && /* @__PURE__ */ jsx57("div", { className: "flex size-10 shrink-0 items-center justify-center rounded-full border-2 border-primary text-primary", children: icon }),
6456
+ compact ? (
6457
+ /* Mobile / compact: badge stacked under the value */
6458
+ /* @__PURE__ */ jsxs27("div", { className: "flex flex-col gap-2 whitespace-nowrap", children: [
6459
+ /* @__PURE__ */ jsx57("div", { className: "flex flex-col gap-1", children: labelValue }),
6460
+ boostBadge
6461
+ ] })
6462
+ ) : (
6463
+ /* Desktop: badge inline next to the value (16px gap = gap-4) */
6464
+ /* @__PURE__ */ jsxs27("div", { className: "flex flex-col gap-1 whitespace-nowrap", children: [
6465
+ /* @__PURE__ */ jsx57("p", { className: "text-xs text-on-subtle", children: label }),
6466
+ /* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-4", children: [
6467
+ /* @__PURE__ */ jsxs27("p", { className: "leading-none", children: [
6468
+ /* @__PURE__ */ jsx57("span", { className: "text-[20px] font-bold text-on-prominent", children: formatBalanceValue(value) }),
6469
+ currency && /* @__PURE__ */ jsxs27(Fragment3, { children: [
6470
+ " ",
6471
+ /* @__PURE__ */ jsx57("span", { className: "text-sm text-on-subtle", children: currency })
6472
+ ] })
6473
+ ] }),
6474
+ boostBadge
6475
+ ] })
6476
+ ] })
6477
+ )
6478
+ ] });
6479
+ })(),
6442
6480
  /* @__PURE__ */ jsx57("div", { "aria-hidden": true, className: "pointer-events-none absolute right-[88px] top-[-12px] z-10 size-6 rounded-full bg-prominent" }),
6443
6481
  /* @__PURE__ */ jsx57("div", { "aria-hidden": true, className: "pointer-events-none absolute right-[88px] bottom-[-12px] z-10 size-6 rounded-full bg-prominent" }),
6444
6482
  /* @__PURE__ */ jsx57(