@trading-game/design-intelligence-layer 0.13.3 → 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/README.md +14 -2
- package/dist/index.cjs +69 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +69 -33
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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> & {
|
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> & {
|
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 })
|
|
@@ -6407,40 +6421,62 @@ function BoostTicketCard({
|
|
|
6407
6421
|
compact = false
|
|
6408
6422
|
}) {
|
|
6409
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: [
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
|
|
6420
|
-
|
|
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 })
|
|
6421
6451
|
] })
|
|
6422
|
-
] }),
|
|
6423
|
-
/* @__PURE__ */ jsxs27(Badge, { variant: "fill-boost", size: "sm", className: "!gap-1 !font-medium !tracking-normal", children: [
|
|
6424
|
-
/* @__PURE__ */ jsx57(Rocket, { className: "!size-3.5", strokeWidth: 2 }),
|
|
6425
|
-
"Boost: ",
|
|
6426
|
-
boostAmount,
|
|
6427
|
-
" ",
|
|
6428
|
-
boostCurrency,
|
|
6429
|
-
boostInfo && /* @__PURE__ */ jsx57(TooltipProvider, { children: /* @__PURE__ */ jsxs27(Tooltip2, { children: [
|
|
6430
|
-
/* @__PURE__ */ jsx57(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx57(
|
|
6431
|
-
"button",
|
|
6432
|
-
{
|
|
6433
|
-
type: "button",
|
|
6434
|
-
"aria-label": "More info about boost",
|
|
6435
|
-
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",
|
|
6436
|
-
children: /* @__PURE__ */ jsx57(Info, { className: "!size-3.5", strokeWidth: 2 })
|
|
6437
|
-
}
|
|
6438
|
-
) }),
|
|
6439
|
-
/* @__PURE__ */ jsx57(TooltipContent, { side: boostInfoSide, align: boostInfoAlign, title: boostInfoTitle, closeLabel: boostInfoCloseLabel, variant: "inverse", className: "max-w-xs whitespace-normal", children: boostInfo })
|
|
6440
|
-
] }) })
|
|
6441
6452
|
] })
|
|
6442
|
-
] })
|
|
6443
|
-
|
|
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
|
+
})(),
|
|
6444
6480
|
/* @__PURE__ */ jsx57("div", { "aria-hidden": true, className: "pointer-events-none absolute right-[88px] top-[-12px] z-10 size-6 rounded-full bg-prominent" }),
|
|
6445
6481
|
/* @__PURE__ */ jsx57("div", { "aria-hidden": true, className: "pointer-events-none absolute right-[88px] bottom-[-12px] z-10 size-6 rounded-full bg-prominent" }),
|
|
6446
6482
|
/* @__PURE__ */ jsx57(
|