@trading-game/design-intelligence-layer 0.11.0 → 0.11.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/dist/index.cjs CHANGED
@@ -356,6 +356,7 @@ __export(index_exports, {
356
356
  TabsTrigger: () => TabsTrigger,
357
357
  Textarea: () => Textarea,
358
358
  TicketCard: () => TicketCard,
359
+ TicketCardDesktop: () => TicketCardDesktop,
359
360
  Toaster: () => Toaster,
360
361
  Toggle: () => Toggle,
361
362
  ToggleGroup: () => ToggleGroup,
@@ -6606,92 +6607,111 @@ function TabsContent(_a) {
6606
6607
  var import_lucide_react23 = require("lucide-react");
6607
6608
  var import_jsx_runtime57 = require("react/jsx-runtime");
6608
6609
  function TicketCard({
6610
+ className,
6609
6611
  icon,
6610
6612
  label,
6611
6613
  value,
6612
- stubIcon,
6614
+ currency,
6613
6615
  stubLabel,
6614
6616
  onStubClick,
6615
6617
  stubDisabled = false,
6616
- className
6618
+ welcomeCredit,
6619
+ freeCredit,
6620
+ creditUsed = "10.00",
6621
+ creditTotal = "10.00",
6622
+ creditCurrency = "USDT",
6623
+ creditLabel = "Welcome credit",
6624
+ creditFullWidth = false
6617
6625
  }) {
6618
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
6619
- "div",
6620
- {
6621
- "data-slot": "ticket-card",
6622
- className: cn(
6623
- "relative flex w-full items-stretch rounded-sm",
6624
- "bg-subtle",
6625
- className
6626
+ var _a;
6627
+ const showCredit = (_a = welcomeCredit != null ? welcomeCredit : freeCredit) != null ? _a : false;
6628
+ const creditPct = Math.min(
6629
+ 100,
6630
+ Math.max(0, parseFloat(creditUsed) / parseFloat(creditTotal) * 100)
6631
+ );
6632
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: cn("flex w-full flex-col gap-2", className), children: [
6633
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "relative flex h-20 w-full items-stretch justify-between rounded-sm bg-subtle", children: [
6634
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex flex-1 items-center gap-4 overflow-hidden px-4", children: [
6635
+ 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 }),
6636
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex h-11 flex-col justify-center gap-1 whitespace-nowrap", children: [
6637
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "text-xs text-on-subtle", children: label }),
6638
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("p", { className: "leading-none", children: [
6639
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-[20px] font-bold text-on-prominent", children: value }),
6640
+ currency && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
6641
+ " ",
6642
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-sm text-on-subtle", children: currency })
6643
+ ] })
6644
+ ] })
6645
+ ] })
6646
+ ] }),
6647
+ /* @__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" }),
6648
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { "aria-hidden": true, className: "pointer-events-none absolute right-[88px] top-[68px] z-10 size-6 rounded-full bg-prominent" }),
6649
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
6650
+ "div",
6651
+ {
6652
+ "aria-hidden": true,
6653
+ className: "pointer-events-none absolute bottom-[12px] top-[12px] z-10 w-1 -translate-x-1/2",
6654
+ style: {
6655
+ right: 96,
6656
+ backgroundImage: "repeating-linear-gradient(to bottom, color-mix(in oklch, var(--border-subtle) 80%, black) 0px, color-mix(in oklch, var(--border-subtle) 80%, black) 3px, transparent 3px, transparent 6px)"
6657
+ }
6658
+ }
6626
6659
  ),
6627
- children: [
6628
- /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "relative flex min-w-0 flex-1 items-center gap-3 px-4 py-4 sm:gap-4 sm:px-5", children: [
6629
- icon && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex shrink-0 size-11 rounded-full border-2 border-primary items-center justify-center text-primary sm:size-12", children: icon }),
6630
- /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5 overflow-hidden", children: [
6631
- label && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-on-subtle text-xs font-semibold", children: label }),
6632
- value && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "truncate text-lg font-bold text-on-prominent sm:text-xl", children: value })
6633
- ] }),
6634
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
6635
- "div",
6636
- {
6637
- "aria-hidden": true,
6638
- className: "pointer-events-none absolute right-0 top-0 z-10 size-5 -translate-y-1/2 translate-x-1/2 rounded-full bg-prominent"
6639
- }
6640
- ),
6641
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
6642
- "div",
6643
- {
6644
- "aria-hidden": true,
6645
- className: "pointer-events-none absolute bottom-0 right-0 z-10 size-5 translate-x-1/2 translate-y-1/2 rounded-full bg-prominent"
6646
- }
6660
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
6661
+ "button",
6662
+ {
6663
+ type: "button",
6664
+ onClick: onStubClick,
6665
+ disabled: stubDisabled,
6666
+ "aria-label": stubLabel,
6667
+ className: cn(
6668
+ "relative flex h-20 w-[100px] shrink-0 flex-col items-center justify-center gap-1 overflow-hidden rounded-r-sm bg-primary",
6669
+ "transition-colors duration-fast ease-standard",
6670
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
6671
+ stubDisabled ? "cursor-not-allowed opacity-50" : "hover:bg-primary-hover"
6647
6672
  ),
6648
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
6649
- "div",
6650
- {
6651
- "aria-hidden": true,
6652
- className: "pointer-events-none absolute bottom-4 right-0 top-4 -translate-x-1/2 border-l-2 border-dashed border-primary/30"
6653
- }
6654
- )
6673
+ children: [
6674
+ !stubDisabled && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
6675
+ "span",
6676
+ {
6677
+ "aria-hidden": true,
6678
+ className: "pointer-events-none absolute inset-0 [animation:stub-shimmer_1.5s_linear_infinite]",
6679
+ style: {
6680
+ background: "linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.30) 50%, transparent 100%)"
6681
+ }
6682
+ }
6683
+ ),
6684
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react23.ArrowRight, { className: "size-4 text-on-prominent-static-inverse" }),
6685
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-sm font-semibold text-on-prominent-static-inverse", children: stubLabel })
6686
+ ]
6687
+ }
6688
+ )
6689
+ ] }),
6690
+ showCredit && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: cn(
6691
+ "flex items-center gap-2 rounded-sm bg-subtle p-2",
6692
+ creditFullWidth ? "w-full" : "w-[calc(100%-112px)]"
6693
+ ), children: [
6694
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react23.TicketPlus, { className: "size-6 shrink-0", style: { color: "#713813" } }),
6695
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
6696
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex items-center justify-between whitespace-nowrap text-[10px] font-semibold", style: { color: "#713813" }, children: [
6697
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { children: creditLabel }),
6698
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { children: [
6699
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-on-prominent", children: creditUsed }),
6700
+ ` / ${creditTotal} ${creditCurrency}`
6701
+ ] })
6655
6702
  ] }),
6656
6703
  /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
6657
- "div",
6704
+ Progress,
6658
6705
  {
6659
- className: cn(
6660
- "relative z-[1] inline-flex max-w-[72%] shrink-0 self-stretch sm:max-w-[44%]"
6661
- ),
6662
- children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
6663
- "button",
6664
- {
6665
- type: "button",
6666
- onClick: stubDisabled ? void 0 : onStubClick,
6667
- disabled: stubDisabled,
6668
- className: cn(
6669
- "relative box-border inline-flex h-full min-h-[3.25rem] min-w-[5.75rem] flex-col items-center justify-center gap-1.5 rounded-r-sm px-4 py-3 transition-colors sm:min-h-0 sm:gap-1.5 sm:px-5",
6670
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
6671
- stubDisabled ? "bg-primary/30 cursor-not-allowed opacity-50 pointer-events-none" : "bg-primary cursor-pointer hover:bg-primary-hover"
6672
- ),
6673
- children: [
6674
- !stubDisabled && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
6675
- "span",
6676
- {
6677
- "aria-hidden": true,
6678
- className: "absolute inset-0 pointer-events-none [animation:stub-shimmer_1.5s_linear_infinite]",
6679
- style: {
6680
- background: "linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.30) 50%, transparent 100%)"
6681
- }
6682
- }
6683
- ),
6684
- stubIcon != null ? stubIcon : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react23.ArrowRight, { className: "relative size-5 shrink-0 text-on-prominent-static-inverse" }),
6685
- stubLabel && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "max-w-full text-balance text-center text-xs font-bold leading-tight tracking-wide text-on-prominent-static-inverse sm:tracking-widest", children: stubLabel })
6686
- ]
6687
- }
6688
- )
6706
+ value: creditPct,
6707
+ className: "h-1 bg-black/8 [&>[data-slot=progress-indicator]]:bg-[#ef9f00]"
6689
6708
  }
6690
6709
  )
6691
- ]
6692
- }
6693
- );
6710
+ ] })
6711
+ ] })
6712
+ ] });
6694
6713
  }
6714
+ var TicketCardDesktop = TicketCard;
6695
6715
 
6696
6716
  // components/ui/toggle.tsx
6697
6717
  var import_class_variance_authority14 = require("class-variance-authority");
@@ -7108,6 +7128,7 @@ function ToggleGroupItem(_a) {
7108
7128
  TabsTrigger,
7109
7129
  Textarea,
7110
7130
  TicketCard,
7131
+ TicketCardDesktop,
7111
7132
  Toaster,
7112
7133
  Toggle,
7113
7134
  ToggleGroup,