@trading-game/design-intelligence-layer 0.15.0 → 0.15.2
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 +2 -2
- package/dist/index.cjs +50 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -17
- package/dist/index.d.ts +21 -17
- package/dist/index.js +50 -44
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -149,7 +149,7 @@ npm install react react-dom tailwindcss
|
|
|
149
149
|
| Table | `Table, TableHeader, TableBody, TableRow, TableHead, TableCell` |
|
|
150
150
|
| Tabs | `Tabs, TabsList, TabsTrigger, TabsContent` |
|
|
151
151
|
| Textarea | `Textarea` |
|
|
152
|
-
| Ticket Card | `TicketCard`, `
|
|
152
|
+
| Ticket Card | `TicketCard`, `CreditTicketCard` |
|
|
153
153
|
| Toast | `Toaster` |
|
|
154
154
|
| Toggle | `Toggle, toggleVariants` |
|
|
155
155
|
| Toggle Group | `ToggleGroup, ToggleGroupItem` |
|
|
@@ -233,7 +233,7 @@ States: hover (`bg-secondary-hover`), focus (3px `ring-ring/50`), active (`opaci
|
|
|
233
233
|
<Badge variant="fill-success" /> // Green tint
|
|
234
234
|
<Badge variant="fill-fail" /> // Red tint
|
|
235
235
|
<Badge variant="fill-warning" /> // Orange tint
|
|
236
|
-
<Badge variant="fill-
|
|
236
|
+
<Badge variant="fill-credit" /> // Amber-orange tint — credit/bonus labels
|
|
237
237
|
|
|
238
238
|
// Outline (black border, secondary-hover on hover)
|
|
239
239
|
<Badge variant="outline" />
|
package/dist/index.cjs
CHANGED
|
@@ -88,7 +88,6 @@ __export(index_exports, {
|
|
|
88
88
|
AvatarGroupCount: () => AvatarGroupCount,
|
|
89
89
|
AvatarImage: () => AvatarImage,
|
|
90
90
|
Badge: () => Badge,
|
|
91
|
-
BoostTicketCard: () => BoostTicketCard,
|
|
92
91
|
Breadcrumb: () => Breadcrumb,
|
|
93
92
|
BreadcrumbEllipsis: () => BreadcrumbEllipsis,
|
|
94
93
|
BreadcrumbItem: () => BreadcrumbItem,
|
|
@@ -160,6 +159,7 @@ __export(index_exports, {
|
|
|
160
159
|
ContextMenuSubContent: () => ContextMenuSubContent,
|
|
161
160
|
ContextMenuSubTrigger: () => ContextMenuSubTrigger,
|
|
162
161
|
ContextMenuTrigger: () => ContextMenuTrigger,
|
|
162
|
+
CreditTicketCard: () => CreditTicketCard,
|
|
163
163
|
Dialog: () => Dialog,
|
|
164
164
|
DialogClose: () => DialogClose,
|
|
165
165
|
DialogContent: () => DialogContent,
|
|
@@ -965,7 +965,7 @@ var badgeVariants = (0, import_class_variance_authority3.cva)(
|
|
|
965
965
|
"fill-success": "bg-semantic-win/10 border-transparent text-semantic-win",
|
|
966
966
|
"fill-fail": "bg-semantic-loss/10 border-transparent text-semantic-loss",
|
|
967
967
|
"fill-warning": "bg-semantic-warning/10 border-transparent text-semantic-warning",
|
|
968
|
-
"fill-
|
|
968
|
+
"fill-credit": "bg-semantic-boost/16 border-transparent text-on-semantic-boost !text-xs !font-semibold",
|
|
969
969
|
// Ghost (transparent)
|
|
970
970
|
ghost: "bg-transparent border-transparent text-primary [a&]:hover:bg-secondary-hover [a&]:hover:text-primary",
|
|
971
971
|
"ghost-success": "bg-transparent border-transparent text-semantic-win [a&]:hover:bg-semantic-win/10 [a&]:hover:text-semantic-win",
|
|
@@ -6741,7 +6741,7 @@ function TicketCard({
|
|
|
6741
6741
|
)
|
|
6742
6742
|
] }) });
|
|
6743
6743
|
}
|
|
6744
|
-
function
|
|
6744
|
+
function CreditTicketCard({
|
|
6745
6745
|
className,
|
|
6746
6746
|
icon,
|
|
6747
6747
|
label,
|
|
@@ -6750,37 +6750,37 @@ function BoostTicketCard({
|
|
|
6750
6750
|
stubLabel,
|
|
6751
6751
|
onStubClick,
|
|
6752
6752
|
stubDisabled = false,
|
|
6753
|
-
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6753
|
+
badgeIcon,
|
|
6754
|
+
badgeLabel = "Label",
|
|
6755
|
+
badgeValue = "0.00",
|
|
6756
|
+
badgeCurrency = "USDT",
|
|
6757
|
+
badgeInfo,
|
|
6758
|
+
badgeInfoSide = "top",
|
|
6759
|
+
badgeInfoAlign = "center",
|
|
6760
|
+
badgeInfoTitle,
|
|
6761
|
+
badgeInfoCloseLabel,
|
|
6760
6762
|
compact = false
|
|
6761
6763
|
}) {
|
|
6762
6764
|
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: cn("flex w-full flex-col gap-2", className), children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "relative flex w-full items-stretch justify-between rounded-sm bg-subtle", children: [
|
|
6763
6765
|
(() => {
|
|
6764
|
-
const
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
boostCurrency,
|
|
6770
|
-
boostInfo && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Tooltip2, { children: [
|
|
6766
|
+
const badgeText = badgeValue || badgeCurrency ? `${badgeLabel}: ${badgeValue}${badgeCurrency ? ` ${badgeCurrency}` : ""}` : badgeLabel;
|
|
6767
|
+
const creditBadge = /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Badge, { variant: "fill-credit", size: "sm", className: "!gap-1 !font-medium !tracking-normal", children: [
|
|
6768
|
+
badgeIcon,
|
|
6769
|
+
badgeText,
|
|
6770
|
+
badgeInfo && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Tooltip2, { children: [
|
|
6771
6771
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
6772
6772
|
"button",
|
|
6773
6773
|
{
|
|
6774
6774
|
type: "button",
|
|
6775
|
-
"aria-label":
|
|
6775
|
+
"aria-label": `More info about ${badgeLabel.toLowerCase()}`,
|
|
6776
6776
|
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",
|
|
6777
6777
|
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react23.Info, { className: "!size-3.5", strokeWidth: 2 })
|
|
6778
6778
|
}
|
|
6779
6779
|
) }),
|
|
6780
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(TooltipContent, { side:
|
|
6780
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(TooltipContent, { side: badgeInfoSide, align: badgeInfoAlign, title: badgeInfoTitle, closeLabel: badgeInfoCloseLabel, variant: "inverse", className: "max-w-xs whitespace-normal", children: badgeInfo })
|
|
6781
6781
|
] }) })
|
|
6782
6782
|
] });
|
|
6783
|
-
const labelValue = /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
6783
|
+
const labelValue = /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex h-11 flex-col justify-center gap-1 whitespace-nowrap", children: [
|
|
6784
6784
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "text-xs text-on-subtle", children: label }),
|
|
6785
6785
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("p", { className: "leading-none", children: [
|
|
6786
6786
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-[20px] font-bold text-on-prominent", children: formatBalanceValue(value) }),
|
|
@@ -6790,31 +6790,37 @@ function BoostTicketCard({
|
|
|
6790
6790
|
] })
|
|
6791
6791
|
] })
|
|
6792
6792
|
] });
|
|
6793
|
-
return /* @__PURE__ */ (0, import_jsx_runtime57.
|
|
6794
|
-
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
|
|
6798
|
-
|
|
6799
|
-
|
|
6800
|
-
|
|
6801
|
-
|
|
6802
|
-
|
|
6803
|
-
|
|
6804
|
-
|
|
6805
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.
|
|
6806
|
-
|
|
6807
|
-
|
|
6808
|
-
|
|
6809
|
-
|
|
6810
|
-
|
|
6811
|
-
|
|
6812
|
-
|
|
6813
|
-
|
|
6793
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
6794
|
+
"div",
|
|
6795
|
+
{
|
|
6796
|
+
className: cn(
|
|
6797
|
+
"flex flex-1 overflow-hidden",
|
|
6798
|
+
compact ? "flex-col gap-2 px-2 py-4" : "items-center gap-4 px-4 py-4"
|
|
6799
|
+
),
|
|
6800
|
+
children: compact ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex flex-1 flex-col gap-2", children: [
|
|
6801
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
6802
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex size-10 shrink-0 items-center justify-center rounded-full border-2 border-primary text-primary", children: icon }),
|
|
6803
|
+
labelValue
|
|
6804
|
+
] }),
|
|
6805
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex", children: icon ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex w-10 shrink-0 justify-start", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "w-max", children: creditBadge }) }) : creditBadge })
|
|
6806
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
6807
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex size-10 shrink-0 items-center justify-center rounded-full border-2 border-primary text-primary", children: icon }),
|
|
6808
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex flex-col gap-1 whitespace-nowrap", children: [
|
|
6809
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "text-xs text-on-subtle", children: label }),
|
|
6810
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
6811
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("p", { className: "leading-none", children: [
|
|
6812
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-[20px] font-bold text-on-prominent", children: formatBalanceValue(value) }),
|
|
6813
|
+
currency && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
|
|
6814
|
+
" ",
|
|
6815
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-sm text-on-subtle", children: currency })
|
|
6816
|
+
] })
|
|
6817
|
+
] }),
|
|
6818
|
+
creditBadge
|
|
6819
|
+
] })
|
|
6814
6820
|
] })
|
|
6815
6821
|
] })
|
|
6816
|
-
|
|
6817
|
-
|
|
6822
|
+
}
|
|
6823
|
+
);
|
|
6818
6824
|
})(),
|
|
6819
6825
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { "aria-hidden": true, className: "pointer-events-none absolute right-[88px] top-[-12px] z-10 size-6 rounded-full bg-prominent" }),
|
|
6820
6826
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { "aria-hidden": true, className: "pointer-events-none absolute right-[88px] bottom-[-12px] z-10 size-6 rounded-full bg-prominent" }),
|
|
@@ -7499,7 +7505,6 @@ function DefaultEmptyState({ onViewHistory }) {
|
|
|
7499
7505
|
AvatarGroupCount,
|
|
7500
7506
|
AvatarImage,
|
|
7501
7507
|
Badge,
|
|
7502
|
-
BoostTicketCard,
|
|
7503
7508
|
Breadcrumb,
|
|
7504
7509
|
BreadcrumbEllipsis,
|
|
7505
7510
|
BreadcrumbItem,
|
|
@@ -7571,6 +7576,7 @@ function DefaultEmptyState({ onViewHistory }) {
|
|
|
7571
7576
|
ContextMenuSubContent,
|
|
7572
7577
|
ContextMenuSubTrigger,
|
|
7573
7578
|
ContextMenuTrigger,
|
|
7579
|
+
CreditTicketCard,
|
|
7574
7580
|
Dialog,
|
|
7575
7581
|
DialogClose,
|
|
7576
7582
|
DialogContent,
|