@trading-game/design-intelligence-layer 0.12.4 → 0.13.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 +41 -15
- package/dist/index.cjs +110 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +42 -11
- package/dist/index.d.ts +42 -11
- package/dist/index.js +110 -59
- package/dist/index.js.map +1 -1
- package/guides/design-system-guide/trading-game-ds-guide.md +45 -28
- package/guides/rules/design-system-consuming-project.mdc +23 -8
- package/package.json +1 -1
- package/src/styles.css +39 -11
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`, `BoostTicketCard` |
|
|
153
153
|
| Toast | `Toaster` |
|
|
154
154
|
| Toggle | `Toggle, toggleVariants` |
|
|
155
155
|
| Toggle Group | `ToggleGroup, ToggleGroupItem` |
|
|
@@ -220,7 +220,7 @@ States: hover (`bg-secondary-hover`), focus (3px `ring-ring/50`), active (`opaci
|
|
|
220
220
|
<Badge variant="fill-success" /> // Green tint
|
|
221
221
|
<Badge variant="fill-fail" /> // Red tint
|
|
222
222
|
<Badge variant="fill-warning" /> // Orange tint
|
|
223
|
-
<Badge variant="fill-
|
|
223
|
+
<Badge variant="fill-boost" /> // Amber-orange tint — boost/bonus labels (pair with a Rocket icon)
|
|
224
224
|
|
|
225
225
|
// Outline (black border, secondary-hover on hover)
|
|
226
226
|
<Badge variant="outline" />
|
|
@@ -288,6 +288,7 @@ All tokens are CSS custom properties, loaded automatically via `@trading-game/de
|
|
|
288
288
|
| Tailwind class | CSS variable | Value | Usage |
|
|
289
289
|
|---|---|---|---|
|
|
290
290
|
| `bg-prominent` | `--prominent` | `#FFFFFF` | Page background |
|
|
291
|
+
| `bg-prominent-inverse` | `--prominent-inverse` | `#000000` | Dark surface for use on light pages (e.g. toasts) |
|
|
291
292
|
| `bg-card` | `--card` | `#FFFFFF` | Card/panel surface |
|
|
292
293
|
| `bg-popover` | `--popover` | `#FFFFFF` | Popover/dropdown surface |
|
|
293
294
|
| `bg-subtle` | `--subtle` | `#F5F5F5` | Subtle tinted surface |
|
|
@@ -296,24 +297,33 @@ All tokens are CSS custom properties, loaded automatically via `@trading-game/de
|
|
|
296
297
|
| `bg-tabs-active` | `--tabs-active` | `#FFFFFF` | Active / selected tab pill |
|
|
297
298
|
| `bg-primary` | `--primary` | `#2323FF` | Brand blue — CTAs |
|
|
298
299
|
| `bg-primary-hover` | `--primary-hover` | `#0B0BD2` | Primary button hover (darker blue) |
|
|
300
|
+
| `bg-primary-inverse` | `--primary-inverse` | `#FFFFFF` | Inverted primary surface — white bg for use on dark/coloured areas |
|
|
299
301
|
| `bg-secondary-hover` | `--secondary-hover` | `#EEEEEE` | Outline/secondary hover (light grey) |
|
|
300
302
|
| `bg-semantic-win` | `--semantic-win` | green | Profit / positive state |
|
|
301
303
|
| `bg-semantic-loss` | `--semantic-loss` | red | Loss / negative state |
|
|
302
|
-
| `bg-semantic-
|
|
304
|
+
| `bg-semantic-boost` | `--semantic-boost` | `#F9840F` amber-orange | Boost / bonus badge background |
|
|
303
305
|
|
|
304
306
|
### Text tokens
|
|
305
307
|
|
|
308
|
+
> **Naming convention:** every surface (bg) token has a paired `text-on-<surface>` foreground (text/icon) token. Always use the pair together — `bg-primary` + `text-on-primary`, `bg-semantic-win` + `text-on-semantic-win`, etc. — for guaranteed legibility regardless of theme.
|
|
309
|
+
|
|
306
310
|
| Tailwind class | Value | Usage |
|
|
307
311
|
|---|---|---|
|
|
308
|
-
| `text-on-prominent` | `#000000` |
|
|
309
|
-
| `text-on-prominent-
|
|
310
|
-
| `text-on-subtle` | mid grey |
|
|
312
|
+
| `text-on-prominent` | `#000000` | Text on `bg-prominent` (default body text on light surfaces) |
|
|
313
|
+
| `text-on-prominent-inverse` | `#FFFFFF` | Text on `bg-prominent-inverse` (e.g. toast title/description) |
|
|
314
|
+
| `text-on-subtle` | mid grey | Text on `bg-subtle` (secondary / supporting text) |
|
|
311
315
|
| `text-on-disabled` | `#BBBBBB` | Disabled / inactive text |
|
|
312
|
-
|
|
313
|
-
| `text-primary` | `#2323FF` |
|
|
314
|
-
| `text-semantic-win` |
|
|
315
|
-
| `text-semantic-loss` |
|
|
316
|
-
| `text-semantic-
|
|
316
|
+
| `text-on-primary` | `#FFFFFF` | Text on `bg-primary` (e.g. primary button label, tooltip text) |
|
|
317
|
+
| `text-on-primary-inverse` | `#2323FF` | Text on `bg-primary-inverse` (e.g. primary-inverse button label) |
|
|
318
|
+
| `text-on-semantic-win` | `#FFFFFF` | Text on `bg-semantic-win` (e.g. success badge label) |
|
|
319
|
+
| `text-on-semantic-loss` | `#FFFFFF` | Text on `bg-semantic-loss` (e.g. fail badge label) |
|
|
320
|
+
| `text-on-semantic-warning` | `#FFFFFF` | Text on `bg-semantic-warning` (e.g. warning badge label) |
|
|
321
|
+
| `text-on-semantic-boost` | `#713813` dark amber | Text on `bg-semantic-boost` (e.g. boost badge label) |
|
|
322
|
+
| `text-primary` | `#2323FF` | Brand blue inline text (use as a foreground over neutral surfaces) |
|
|
323
|
+
| `text-semantic-win` | green | Profit / positive inline text |
|
|
324
|
+
| `text-semantic-loss` | red | Loss / negative inline text |
|
|
325
|
+
|
|
326
|
+
> **Deprecated:** `text-on-prominent-static-inverse` and the matching `--on-prominent-static-inverse` CSS variable are still defined for backwards-compat with external code that references them via raw `var()`. Internal components no longer use them. For new code, pick the explicit `text-on-<surface>` paired with the actual background.
|
|
317
327
|
|
|
318
328
|
### Border & focus tokens
|
|
319
329
|
|
|
@@ -514,7 +524,7 @@ See node_modules/@trading-game/design-intelligence-layer/README.md for complete
|
|
|
514
524
|
|---|---|---|
|
|
515
525
|
| `bg-gray-100` | `bg-subtle` | Raw Tailwind palette — use tokens |
|
|
516
526
|
| `bg-white` | `bg-prominent` or `bg-card` | Not a semantic token |
|
|
517
|
-
| `text-white` | `text-on-prominent-
|
|
527
|
+
| `text-white` | `text-on-<surface>` (e.g. `text-on-primary`, `text-on-prominent-inverse`, `text-on-semantic-win`) | Pick the paired foreground for the actual background |
|
|
518
528
|
| `text-black` | `text-on-prominent` | Not a semantic token |
|
|
519
529
|
| `text-gray-400` | `text-on-disabled` | Use the disabled text token |
|
|
520
530
|
| `bg-black/50` | `bg-overlay` | Overlay has its own token |
|
|
@@ -585,10 +595,26 @@ Design tokens are managed in Figma and exported as CSS variables. To update:
|
|
|
585
595
|
|
|
586
596
|
## Changelog
|
|
587
597
|
|
|
598
|
+
### Unreleased
|
|
599
|
+
- **Token convention — `on-<surface>` foreground pairs:** Added a Material-style paired foreground for every semantic surface so colour roles are self-documenting and resolve robustly across consumer setups (incl. Module Federation, where raw `var()` fallbacks were previously needed). New CSS variables and Tailwind utilities:
|
|
600
|
+
- `--on-primary` (white) / `text-on-primary` — paired with `bg-primary`
|
|
601
|
+
- `--primary-inverse` (white) / `bg-primary-inverse` — inverted primary surface for use on dark/coloured areas
|
|
602
|
+
- `--on-primary-inverse` (blue) / `text-on-primary-inverse` — paired with `bg-primary-inverse`
|
|
603
|
+
- `--prominent-inverse` (black) / `bg-prominent-inverse` — dark surface for use on light pages (e.g. toasts)
|
|
604
|
+
- `--on-prominent-inverse` (white) / `text-on-prominent-inverse` — paired with `bg-prominent-inverse`
|
|
605
|
+
- `--on-semantic-win` / `--on-semantic-loss` / `--on-semantic-warning` (all white) and `--on-semantic-boost` (dark amber) — paired with the matching `bg-semantic-*` surfaces.
|
|
606
|
+
- **Internal sweep:** all internal components (Button, Badge, Tooltip, Toast, Checkbox, Avatar, Input, NativeSelect, TicketCard, BoostTicketCard, sidebar mini-avatar) now use the explicit `on-<surface>` foregrounds — no more catch-all `text-on-prominent-static-inverse`.
|
|
607
|
+
- **Backwards-compat aliases preserved:** `--on-prominent-static-inverse` (→ `var(--on-prominent-inverse)`) and `--surface-inverse-static` (→ `var(--primary-inverse)`) remain defined in CSS so existing consumer code referencing them via raw `var()` (e.g. `var(--on-prominent-static-inverse, #fff)`) keeps working. The Tailwind utility `text-on-prominent-static-inverse` is also still emitted, but new code should pick the explicit paired token.
|
|
608
|
+
- **Sonner → Toast rename:** The toast wrapper file moved from `components/ui/sonner.tsx` to `components/ui/toast.tsx`. The wrapper component is still `Toaster`, and `toast` is now re-exported from this module so consumers no longer need `import { toast } from "sonner"` directly. Import path: `@trading-game/design-intelligence-layer` (was `... from "sonner"`).
|
|
609
|
+
- **`fill-credit` → `fill-boost` Badge variant rename:** The amber-orange badge variant for bonus labels is now `fill-boost` (uses `bg-semantic-boost/16` + `text-on-semantic-boost`). The CSS tokens were correspondingly renamed: `--semantic-credit` → `--semantic-boost`, `--semantic-credit-text` → `--on-semantic-boost`. **Breaking change** for consumers that referenced these by name.
|
|
610
|
+
- **`CreditTicketCard` → `BoostTicketCard` rename:** Component, props (`creditAmount` → `boostAmount`, `creditCurrency` → `boostCurrency`), and badge text (`"Credit: …"` → `"Boost: …"`) all renamed for consistency. The boost badge now uses a leading `Rocket` icon and a trailing `Info` icon (replacing the prior `TicketPlus`). **Breaking change.**
|
|
611
|
+
- **Button `primary-inverse` / `secondary-inverse`:** Now built from the new `bg-primary-inverse` / `text-on-primary-inverse` / `border-primary-inverse` / `text-on-prominent-inverse` tokens. Visually identical to before, but the underlying class names are different.
|
|
612
|
+
- **Toast — action button visual fix:** The toast action button (the inverse-coloured "Undo" pill) now uses `primary-inverse` colouring (white bg + blue text) to match the dark toast surface, instead of the previous `bg-primary` (blue on dark — low hierarchy / wrong surface-context).
|
|
613
|
+
|
|
588
614
|
### v0.12.0
|
|
589
|
-
- **New semantic tokens — credit:** `--semantic-credit` (`#F9840F` amber-orange) and `--semantic-credit-text` (`#713813` dark amber) added to both `src/styles.css` and `app/globals.css`. Tailwind utilities: `bg-semantic-credit`, `text-semantic-credit-text`.
|
|
590
|
-
- **Badge — `fill-credit` variant:**
|
|
591
|
-
- **New `CreditTicketCard` component:** Exported alongside `TicketCard`. Renders the same ticket shell (notches, tear-line, shimmer stub) but with a variable-height card body and an inline `<Badge variant="fill-credit">` below the value for credit/bonus display. Props: `icon`, `label`, `value`, `currency`, `stubLabel`, `onStubClick`, `stubDisabled`, `creditAmount` (default `"0.00"`), `creditCurrency` (default `"USDT"`), `compact`.
|
|
615
|
+
- **New semantic tokens — credit:** _(superseded — see Unreleased above for the `boost` rename)_ `--semantic-credit` (`#F9840F` amber-orange) and `--semantic-credit-text` (`#713813` dark amber) added to both `src/styles.css` and `app/globals.css`. Tailwind utilities: `bg-semantic-credit`, `text-semantic-credit-text`.
|
|
616
|
+
- **Badge — `fill-credit` variant:** _(superseded — now `fill-boost`)_ Variant for credit/bonus labels — `bg-semantic-credit/16` background with `text-semantic-credit-text` foreground. Pair with a `TicketPlus` icon. Badge base class no longer applies `tracking-wide`; letter spacing is default on all badge variants.
|
|
617
|
+
- **New `CreditTicketCard` component:** _(superseded — now `BoostTicketCard`)_ Exported alongside `TicketCard`. Renders the same ticket shell (notches, tear-line, shimmer stub) but with a variable-height card body and an inline `<Badge variant="fill-credit">` below the value for credit/bonus display. Props: `icon`, `label`, `value`, `currency`, `stubLabel`, `onStubClick`, `stubDisabled`, `creditAmount` (default `"0.00"`), `creditCurrency` (default `"USDT"`), `compact`.
|
|
592
618
|
- **`TicketCard` — `compact` prop:** New boolean prop (default `false`). When `true`, reduces left-content padding from `px-4 gap-4` to `px-2 gap-2` for mobile layouts.
|
|
593
619
|
- **`TicketCard` — welcome-credit props removed:** `welcomeCredit`, `freeCredit` (deprecated alias), `creditUsed`, `creditTotal`, `creditCurrency`, `creditLabel`, `creditFullWidth`, and the `Progress`-based credit bar have been removed. Use `CreditTicketCard` for the credit use case.
|
|
594
620
|
- **`tracking-wide` / `tracking-widest` removed from several components:** Badge base class, `Link` base class, `PaginationLink`, `CommandShortcut`, `ContextMenuShortcut`, `DropdownMenuShortcut`, and `MenubarShortcut` no longer apply letter-spacing overrides. All render with default tracking.
|
package/dist/index.cjs
CHANGED
|
@@ -87,6 +87,7 @@ __export(index_exports, {
|
|
|
87
87
|
AvatarGroupCount: () => AvatarGroupCount,
|
|
88
88
|
AvatarImage: () => AvatarImage,
|
|
89
89
|
Badge: () => Badge,
|
|
90
|
+
BoostTicketCard: () => BoostTicketCard,
|
|
90
91
|
Breadcrumb: () => Breadcrumb,
|
|
91
92
|
BreadcrumbEllipsis: () => BreadcrumbEllipsis,
|
|
92
93
|
BreadcrumbItem: () => BreadcrumbItem,
|
|
@@ -158,7 +159,6 @@ __export(index_exports, {
|
|
|
158
159
|
ContextMenuSubContent: () => ContextMenuSubContent,
|
|
159
160
|
ContextMenuSubTrigger: () => ContextMenuSubTrigger,
|
|
160
161
|
ContextMenuTrigger: () => ContextMenuTrigger,
|
|
161
|
-
CreditTicketCard: () => CreditTicketCard,
|
|
162
162
|
Dialog: () => Dialog,
|
|
163
163
|
DialogClose: () => DialogClose,
|
|
164
164
|
DialogContent: () => DialogContent,
|
|
@@ -374,6 +374,7 @@ __export(index_exports, {
|
|
|
374
374
|
navigationButtonVariants: () => navigationButtonVariants,
|
|
375
375
|
navigationMenuTriggerStyle: () => navigationMenuTriggerStyle,
|
|
376
376
|
tabsListVariants: () => tabsListVariants,
|
|
377
|
+
toast: () => import_sonner.toast,
|
|
377
378
|
toggleVariants: () => toggleVariants,
|
|
378
379
|
useComboboxAnchor: () => useComboboxAnchor,
|
|
379
380
|
useDirection: () => useDirection,
|
|
@@ -579,12 +580,12 @@ var buttonVariants = (0, import_class_variance_authority2.cva)(
|
|
|
579
580
|
variants: {
|
|
580
581
|
variant: {
|
|
581
582
|
// Primary brand blue (#2323FF)
|
|
582
|
-
primary: "bg-primary text-on-
|
|
583
|
+
primary: "bg-primary text-on-primary hover:bg-primary-hover",
|
|
583
584
|
// Primary Inverse — white bg + blue text; for use on dark/coloured surfaces
|
|
584
|
-
"primary-inverse": "bg-
|
|
585
|
+
"primary-inverse": "bg-primary-inverse text-on-primary-inverse hover:bg-primary-inverse/80",
|
|
585
586
|
secondary: "bg-transparent border-[1.5px] border-border-prominent text-on-prominent hover:bg-secondary-hover",
|
|
586
587
|
// Secondary Inverse — white border + white text; for use on dark/coloured surfaces
|
|
587
|
-
"secondary-inverse": "bg-transparent border-[1.5px] border-
|
|
588
|
+
"secondary-inverse": "bg-transparent border-[1.5px] border-primary-inverse text-on-prominent-inverse hover:bg-primary-inverse/10",
|
|
588
589
|
tertiary: "bg-transparent text-primary hover:bg-primary/[0.08]"
|
|
589
590
|
},
|
|
590
591
|
size: {
|
|
@@ -894,7 +895,7 @@ function AvatarBadge(_a) {
|
|
|
894
895
|
__spreadValues({
|
|
895
896
|
"data-slot": "avatar-badge",
|
|
896
897
|
className: cn(
|
|
897
|
-
"absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-on-
|
|
898
|
+
"absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-on-primary ring-2 ring-prominent select-none",
|
|
898
899
|
"group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden",
|
|
899
900
|
"group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2",
|
|
900
901
|
"group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2",
|
|
@@ -945,16 +946,16 @@ var badgeVariants = (0, import_class_variance_authority3.cva)(
|
|
|
945
946
|
variants: {
|
|
946
947
|
variant: {
|
|
947
948
|
// Default (solid)
|
|
948
|
-
default: "bg-primary text-on-
|
|
949
|
-
"default-success": "bg-semantic-win text-on-
|
|
950
|
-
"default-fail": "bg-semantic-loss text-on-
|
|
951
|
-
"default-warning": "bg-semantic-warning text-on-
|
|
949
|
+
default: "bg-primary text-on-primary [a&]:hover:bg-primary/90",
|
|
950
|
+
"default-success": "bg-semantic-win text-on-semantic-win [a&]:hover:bg-semantic-win/90",
|
|
951
|
+
"default-fail": "bg-semantic-loss text-on-semantic-loss [a&]:hover:bg-semantic-loss/90",
|
|
952
|
+
"default-warning": "bg-semantic-warning text-on-semantic-warning [a&]:hover:bg-semantic-warning/90",
|
|
952
953
|
// Fill (tint)
|
|
953
954
|
fill: "bg-primary/10 border-transparent text-primary",
|
|
954
955
|
"fill-success": "bg-semantic-win/10 border-transparent text-semantic-win",
|
|
955
956
|
"fill-fail": "bg-semantic-loss/10 border-transparent text-semantic-loss",
|
|
956
957
|
"fill-warning": "bg-semantic-warning/10 border-transparent text-semantic-warning",
|
|
957
|
-
"fill-
|
|
958
|
+
"fill-boost": "bg-semantic-boost/16 border-transparent text-on-semantic-boost !text-xs !font-semibold",
|
|
958
959
|
// Ghost (transparent)
|
|
959
960
|
ghost: "bg-transparent border-transparent text-primary [a&]:hover:bg-secondary-hover [a&]:hover:text-primary",
|
|
960
961
|
"ghost-success": "bg-transparent border-transparent text-semantic-win [a&]:hover:bg-semantic-win/10 [a&]:hover:text-semantic-win",
|
|
@@ -1836,7 +1837,7 @@ function Checkbox(_a) {
|
|
|
1836
1837
|
__spreadProps(__spreadValues({
|
|
1837
1838
|
"data-slot": "checkbox",
|
|
1838
1839
|
className: cn(
|
|
1839
|
-
"peer size-4 shrink-0 rounded-[2px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-on-
|
|
1840
|
+
"peer size-4 shrink-0 rounded-[2px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-on-primary",
|
|
1840
1841
|
className
|
|
1841
1842
|
)
|
|
1842
1843
|
}, props), {
|
|
@@ -1894,7 +1895,7 @@ var inputVariants = (0, import_class_variance_authority4.cva)(
|
|
|
1894
1895
|
[
|
|
1895
1896
|
"w-full min-w-0 rounded-sm border border-border-subtle bg-white/5",
|
|
1896
1897
|
"text-on-prominent font-body shadow-xs transition-[color,box-shadow] outline-none",
|
|
1897
|
-
"selection:bg-primary selection:text-on-
|
|
1898
|
+
"selection:bg-primary selection:text-on-primary",
|
|
1898
1899
|
"file:inline-flex file:border-0 file:bg-transparent file:font-medium file:text-on-prominent",
|
|
1899
1900
|
"placeholder:text-on-subtle",
|
|
1900
1901
|
"disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
@@ -4449,7 +4450,7 @@ function NativeSelect(_a) {
|
|
|
4449
4450
|
"data-slot": "native-select",
|
|
4450
4451
|
"data-size": size,
|
|
4451
4452
|
className: cn(
|
|
4452
|
-
"h-9 w-full min-w-0 appearance-none rounded-md border border-input bg-transparent px-3 py-2 pr-9 text-sm shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-on-
|
|
4453
|
+
"h-9 w-full min-w-0 appearance-none rounded-md border border-input bg-transparent px-3 py-2 pr-9 text-sm shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-on-primary placeholder:text-on-subtle disabled:pointer-events-none disabled:cursor-not-allowed data-[size=sm]:h-8 data-[size=sm]:py-1",
|
|
4453
4454
|
"focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
4454
4455
|
className
|
|
4455
4456
|
)
|
|
@@ -5370,7 +5371,7 @@ function SheetDescription(_a) {
|
|
|
5370
5371
|
}
|
|
5371
5372
|
|
|
5372
5373
|
// components/ui/sidebar.tsx
|
|
5373
|
-
var
|
|
5374
|
+
var React10 = __toESM(require("react"), 1);
|
|
5374
5375
|
var import_class_variance_authority12 = require("class-variance-authority");
|
|
5375
5376
|
var import_lucide_react20 = require("lucide-react");
|
|
5376
5377
|
var import_radix_ui30 = require("radix-ui");
|
|
@@ -5406,8 +5407,10 @@ function Skeleton(_a) {
|
|
|
5406
5407
|
}
|
|
5407
5408
|
|
|
5408
5409
|
// components/ui/tooltip.tsx
|
|
5410
|
+
var React9 = __toESM(require("react"), 1);
|
|
5409
5411
|
var import_radix_ui29 = require("radix-ui");
|
|
5410
5412
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
5413
|
+
var TooltipModeContext = React9.createContext("tooltip");
|
|
5411
5414
|
function TooltipProvider(_a) {
|
|
5412
5415
|
var _b = _a, {
|
|
5413
5416
|
delayDuration = 0
|
|
@@ -5423,36 +5426,71 @@ function TooltipProvider(_a) {
|
|
|
5423
5426
|
);
|
|
5424
5427
|
}
|
|
5425
5428
|
function Tooltip2(_a) {
|
|
5426
|
-
var
|
|
5427
|
-
|
|
5429
|
+
var _b = _a, {
|
|
5430
|
+
children
|
|
5431
|
+
} = _b, props = __objRest(_b, [
|
|
5432
|
+
"children"
|
|
5433
|
+
]);
|
|
5434
|
+
const isMobile = useIsMobile();
|
|
5435
|
+
const mode = isMobile ? "drawer" : "tooltip";
|
|
5436
|
+
if (mode === "drawer") {
|
|
5437
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TooltipModeContext.Provider, { value: "drawer", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Drawer, { children }) });
|
|
5438
|
+
}
|
|
5439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TooltipModeContext.Provider, { value: "tooltip", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_radix_ui29.Tooltip.Root, __spreadProps(__spreadValues({ "data-slot": "tooltip" }, props), { children })) });
|
|
5428
5440
|
}
|
|
5429
5441
|
function TooltipTrigger(_a) {
|
|
5430
|
-
var
|
|
5431
|
-
|
|
5442
|
+
var _b = _a, {
|
|
5443
|
+
children
|
|
5444
|
+
} = _b, props = __objRest(_b, [
|
|
5445
|
+
"children"
|
|
5446
|
+
]);
|
|
5447
|
+
const mode = React9.useContext(TooltipModeContext);
|
|
5448
|
+
if (mode === "drawer") {
|
|
5449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(DrawerTrigger, __spreadProps(__spreadValues({ "data-slot": "tooltip-trigger" }, props), { children }));
|
|
5450
|
+
}
|
|
5451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_radix_ui29.Tooltip.Trigger, __spreadProps(__spreadValues({ "data-slot": "tooltip-trigger" }, props), { children }));
|
|
5432
5452
|
}
|
|
5433
5453
|
function TooltipContent(_a) {
|
|
5434
5454
|
var _b = _a, {
|
|
5435
5455
|
className,
|
|
5436
5456
|
sideOffset = 6,
|
|
5457
|
+
variant = "default",
|
|
5458
|
+
title = "Title",
|
|
5459
|
+
closeLabel = "Label",
|
|
5437
5460
|
children
|
|
5438
5461
|
} = _b, props = __objRest(_b, [
|
|
5439
5462
|
"className",
|
|
5440
5463
|
"sideOffset",
|
|
5464
|
+
"variant",
|
|
5465
|
+
"title",
|
|
5466
|
+
"closeLabel",
|
|
5441
5467
|
"children"
|
|
5442
5468
|
]);
|
|
5469
|
+
const mode = React9.useContext(TooltipModeContext);
|
|
5470
|
+
if (mode === "drawer") {
|
|
5471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(DrawerContent, { "data-slot": "tooltip-content", "data-variant": variant, children: [
|
|
5472
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(DrawerTitle, { className: "px-5 pt-2 text-left text-base font-bold text-on-prominent", children: title }),
|
|
5473
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: cn("px-5 pt-2 pb-2 text-sm font-medium text-on-prominent", className), children }),
|
|
5474
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(DrawerFooter, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(DrawerClose, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Button, { variant: "primary", size: "md", children: closeLabel }) }) })
|
|
5475
|
+
] });
|
|
5476
|
+
}
|
|
5477
|
+
const surfaceClasses = variant === "inverse" ? "bg-prominent text-on-prominent shadow-sm" : "bg-primary text-on-primary";
|
|
5478
|
+
const arrowClasses = variant === "inverse" ? "fill-prominent" : "fill-primary";
|
|
5443
5479
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_radix_ui29.Tooltip.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
5444
5480
|
import_radix_ui29.Tooltip.Content,
|
|
5445
5481
|
__spreadProps(__spreadValues({
|
|
5446
5482
|
"data-slot": "tooltip-content",
|
|
5483
|
+
"data-variant": variant,
|
|
5447
5484
|
sideOffset,
|
|
5448
5485
|
className: cn(
|
|
5449
|
-
"z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md
|
|
5486
|
+
"z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md border-0 px-3 py-1.5 text-sm font-medium text-balance fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
5487
|
+
surfaceClasses,
|
|
5450
5488
|
className
|
|
5451
5489
|
)
|
|
5452
5490
|
}, props), {
|
|
5453
5491
|
children: [
|
|
5454
5492
|
children,
|
|
5455
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_radix_ui29.Tooltip.Arrow, { className:
|
|
5493
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_radix_ui29.Tooltip.Arrow, { className: arrowClasses })
|
|
5456
5494
|
]
|
|
5457
5495
|
})
|
|
5458
5496
|
) });
|
|
@@ -5466,9 +5504,9 @@ var SIDEBAR_WIDTH = "16rem";
|
|
|
5466
5504
|
var SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
5467
5505
|
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
5468
5506
|
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
5469
|
-
var SidebarContext =
|
|
5507
|
+
var SidebarContext = React10.createContext(null);
|
|
5470
5508
|
function useSidebar() {
|
|
5471
|
-
const context =
|
|
5509
|
+
const context = React10.useContext(SidebarContext);
|
|
5472
5510
|
if (!context) {
|
|
5473
5511
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
5474
5512
|
}
|
|
@@ -5491,10 +5529,10 @@ function SidebarProvider(_a) {
|
|
|
5491
5529
|
"children"
|
|
5492
5530
|
]);
|
|
5493
5531
|
const isMobile = useIsMobile();
|
|
5494
|
-
const [openMobile, setOpenMobile] =
|
|
5495
|
-
const [_open, _setOpen] =
|
|
5532
|
+
const [openMobile, setOpenMobile] = React10.useState(false);
|
|
5533
|
+
const [_open, _setOpen] = React10.useState(defaultOpen);
|
|
5496
5534
|
const open = openProp != null ? openProp : _open;
|
|
5497
|
-
const setOpen =
|
|
5535
|
+
const setOpen = React10.useCallback(
|
|
5498
5536
|
(value) => {
|
|
5499
5537
|
const openState = typeof value === "function" ? value(open) : value;
|
|
5500
5538
|
if (setOpenProp) {
|
|
@@ -5506,10 +5544,10 @@ function SidebarProvider(_a) {
|
|
|
5506
5544
|
},
|
|
5507
5545
|
[setOpenProp, open]
|
|
5508
5546
|
);
|
|
5509
|
-
const toggleSidebar =
|
|
5547
|
+
const toggleSidebar = React10.useCallback(() => {
|
|
5510
5548
|
return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
|
|
5511
5549
|
}, [isMobile, setOpen, setOpenMobile]);
|
|
5512
|
-
|
|
5550
|
+
React10.useEffect(() => {
|
|
5513
5551
|
const handleKeyDown = (event) => {
|
|
5514
5552
|
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
5515
5553
|
event.preventDefault();
|
|
@@ -5520,7 +5558,7 @@ function SidebarProvider(_a) {
|
|
|
5520
5558
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
5521
5559
|
}, [toggleSidebar]);
|
|
5522
5560
|
const state = open ? "expanded" : "collapsed";
|
|
5523
|
-
const contextValue =
|
|
5561
|
+
const contextValue = React10.useMemo(
|
|
5524
5562
|
() => ({
|
|
5525
5563
|
state,
|
|
5526
5564
|
open,
|
|
@@ -6098,7 +6136,7 @@ function SidebarMenuSubButton(_a) {
|
|
|
6098
6136
|
}
|
|
6099
6137
|
|
|
6100
6138
|
// components/ui/slider.tsx
|
|
6101
|
-
var
|
|
6139
|
+
var React11 = __toESM(require("react"), 1);
|
|
6102
6140
|
var import_radix_ui31 = require("radix-ui");
|
|
6103
6141
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
6104
6142
|
function Slider(_a) {
|
|
@@ -6115,7 +6153,7 @@ function Slider(_a) {
|
|
|
6115
6153
|
"min",
|
|
6116
6154
|
"max"
|
|
6117
6155
|
]);
|
|
6118
|
-
const _values =
|
|
6156
|
+
const _values = React11.useMemo(
|
|
6119
6157
|
() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
|
|
6120
6158
|
[value, defaultValue, min, max]
|
|
6121
6159
|
);
|
|
@@ -6164,7 +6202,7 @@ function Slider(_a) {
|
|
|
6164
6202
|
);
|
|
6165
6203
|
}
|
|
6166
6204
|
|
|
6167
|
-
// components/ui/
|
|
6205
|
+
// components/ui/toast.tsx
|
|
6168
6206
|
var import_lucide_react21 = require("lucide-react");
|
|
6169
6207
|
var import_next_themes = require("next-themes");
|
|
6170
6208
|
var import_sonner = require("sonner");
|
|
@@ -6190,15 +6228,15 @@ var Toaster = (_a) => {
|
|
|
6190
6228
|
},
|
|
6191
6229
|
toastOptions: {
|
|
6192
6230
|
classNames: {
|
|
6193
|
-
toast: "!bg-[var(--
|
|
6194
|
-
title: "!text-[var(--on-prominent-
|
|
6195
|
-
description: "!text-[var(--on-prominent-
|
|
6196
|
-
actionButton: "!bg-[var(--primary)] !text-[var(--on-
|
|
6231
|
+
toast: "!bg-[var(--prominent-inverse)] !border-none",
|
|
6232
|
+
title: "!text-[var(--on-prominent-inverse)] !font-display !font-bold",
|
|
6233
|
+
description: "!text-[var(--on-prominent-inverse)] !opacity-60 !font-body",
|
|
6234
|
+
actionButton: "!bg-[var(--primary-inverse)] !text-[var(--on-primary-inverse)]"
|
|
6197
6235
|
}
|
|
6198
6236
|
},
|
|
6199
6237
|
style: {
|
|
6200
|
-
"--normal-bg": "var(--
|
|
6201
|
-
"--normal-text": "var(--on-prominent-
|
|
6238
|
+
"--normal-bg": "var(--prominent-inverse)",
|
|
6239
|
+
"--normal-text": "var(--on-prominent-inverse)",
|
|
6202
6240
|
"--normal-border": "transparent",
|
|
6203
6241
|
"--border-radius": "var(--radius)"
|
|
6204
6242
|
}
|
|
@@ -6207,7 +6245,7 @@ var Toaster = (_a) => {
|
|
|
6207
6245
|
};
|
|
6208
6246
|
|
|
6209
6247
|
// components/ui/stepper.tsx
|
|
6210
|
-
var
|
|
6248
|
+
var React12 = __toESM(require("react"), 1);
|
|
6211
6249
|
var import_lucide_react22 = require("lucide-react");
|
|
6212
6250
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
6213
6251
|
function clamp(value, min, max) {
|
|
@@ -6243,16 +6281,16 @@ function Stepper({
|
|
|
6243
6281
|
}) {
|
|
6244
6282
|
const { container, buttonSize, iconClass } = stepperSizeConfig[size];
|
|
6245
6283
|
const isControlled = controlledValue !== void 0;
|
|
6246
|
-
const [internalValue, setInternalValue] =
|
|
6284
|
+
const [internalValue, setInternalValue] = React12.useState(
|
|
6247
6285
|
clamp(defaultValue, min, max)
|
|
6248
6286
|
);
|
|
6249
6287
|
const currentValue = isControlled ? controlledValue : internalValue;
|
|
6250
6288
|
const decimalPlaces = getDecimalPlaces(step);
|
|
6251
|
-
const [displayString, setDisplayString] =
|
|
6289
|
+
const [displayString, setDisplayString] = React12.useState(
|
|
6252
6290
|
formatValue(currentValue, decimalPlaces)
|
|
6253
6291
|
);
|
|
6254
|
-
const [isFocused, setIsFocused] =
|
|
6255
|
-
|
|
6292
|
+
const [isFocused, setIsFocused] = React12.useState(false);
|
|
6293
|
+
React12.useEffect(() => {
|
|
6256
6294
|
if (!isFocused) {
|
|
6257
6295
|
setDisplayString(formatValue(currentValue, decimalPlaces));
|
|
6258
6296
|
}
|
|
@@ -6674,14 +6712,14 @@ function TicketCard({
|
|
|
6674
6712
|
}
|
|
6675
6713
|
}
|
|
6676
6714
|
),
|
|
6677
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react23.ArrowRight, { className: "size-4 text-on-
|
|
6678
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-sm font-semibold text-on-
|
|
6715
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react23.ArrowRight, { className: "size-4 text-on-primary" }),
|
|
6716
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-sm font-semibold text-on-primary", children: stubLabel })
|
|
6679
6717
|
]
|
|
6680
6718
|
}
|
|
6681
6719
|
)
|
|
6682
6720
|
] }) });
|
|
6683
6721
|
}
|
|
6684
|
-
function
|
|
6722
|
+
function BoostTicketCard({
|
|
6685
6723
|
className,
|
|
6686
6724
|
icon,
|
|
6687
6725
|
label,
|
|
@@ -6690,8 +6728,9 @@ function CreditTicketCard({
|
|
|
6690
6728
|
stubLabel,
|
|
6691
6729
|
onStubClick,
|
|
6692
6730
|
stubDisabled = false,
|
|
6693
|
-
|
|
6694
|
-
|
|
6731
|
+
boostAmount = "0.00",
|
|
6732
|
+
boostCurrency = "USDT",
|
|
6733
|
+
boostInfo,
|
|
6695
6734
|
compact = false
|
|
6696
6735
|
}) {
|
|
6697
6736
|
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: [
|
|
@@ -6708,12 +6747,24 @@ function CreditTicketCard({
|
|
|
6708
6747
|
] })
|
|
6709
6748
|
] })
|
|
6710
6749
|
] }),
|
|
6711
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Badge, { variant: "fill-
|
|
6712
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react23.
|
|
6713
|
-
"
|
|
6714
|
-
|
|
6750
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Badge, { variant: "fill-boost", size: "sm", className: "!gap-1 !font-medium !tracking-normal", children: [
|
|
6751
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react23.Rocket, { className: "!size-3.5", strokeWidth: 2 }),
|
|
6752
|
+
"Boost: ",
|
|
6753
|
+
boostAmount,
|
|
6715
6754
|
" ",
|
|
6716
|
-
|
|
6755
|
+
boostCurrency,
|
|
6756
|
+
boostInfo && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Tooltip2, { children: [
|
|
6757
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
6758
|
+
"button",
|
|
6759
|
+
{
|
|
6760
|
+
type: "button",
|
|
6761
|
+
"aria-label": "More info about boost",
|
|
6762
|
+
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",
|
|
6763
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react23.Info, { className: "!size-3.5", strokeWidth: 2 })
|
|
6764
|
+
}
|
|
6765
|
+
) }),
|
|
6766
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(TooltipContent, { side: "top", variant: "inverse", className: "max-w-xs whitespace-normal", children: boostInfo })
|
|
6767
|
+
] }) })
|
|
6717
6768
|
] })
|
|
6718
6769
|
] })
|
|
6719
6770
|
] }),
|
|
@@ -6754,8 +6805,8 @@ function CreditTicketCard({
|
|
|
6754
6805
|
}
|
|
6755
6806
|
}
|
|
6756
6807
|
),
|
|
6757
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react23.ArrowRight, { className: "size-4 text-on-
|
|
6758
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-sm font-semibold text-on-
|
|
6808
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react23.ArrowRight, { className: "size-4 text-on-primary" }),
|
|
6809
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-sm font-semibold text-on-primary", children: stubLabel })
|
|
6759
6810
|
]
|
|
6760
6811
|
}
|
|
6761
6812
|
)
|
|
@@ -6807,10 +6858,10 @@ function Toggle(_a) {
|
|
|
6807
6858
|
}
|
|
6808
6859
|
|
|
6809
6860
|
// components/ui/toggle-group.tsx
|
|
6810
|
-
var
|
|
6861
|
+
var React13 = __toESM(require("react"), 1);
|
|
6811
6862
|
var import_radix_ui35 = require("radix-ui");
|
|
6812
6863
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
6813
|
-
var ToggleGroupContext =
|
|
6864
|
+
var ToggleGroupContext = React13.createContext({
|
|
6814
6865
|
size: "default",
|
|
6815
6866
|
variant: "default",
|
|
6816
6867
|
spacing: 0
|
|
@@ -6858,7 +6909,7 @@ function ToggleGroupItem(_a) {
|
|
|
6858
6909
|
"variant",
|
|
6859
6910
|
"size"
|
|
6860
6911
|
]);
|
|
6861
|
-
const context =
|
|
6912
|
+
const context = React13.useContext(ToggleGroupContext);
|
|
6862
6913
|
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
6863
6914
|
import_radix_ui35.ToggleGroup.Item,
|
|
6864
6915
|
__spreadProps(__spreadValues({
|
|
@@ -6909,6 +6960,7 @@ function ToggleGroupItem(_a) {
|
|
|
6909
6960
|
AvatarGroupCount,
|
|
6910
6961
|
AvatarImage,
|
|
6911
6962
|
Badge,
|
|
6963
|
+
BoostTicketCard,
|
|
6912
6964
|
Breadcrumb,
|
|
6913
6965
|
BreadcrumbEllipsis,
|
|
6914
6966
|
BreadcrumbItem,
|
|
@@ -6980,7 +7032,6 @@ function ToggleGroupItem(_a) {
|
|
|
6980
7032
|
ContextMenuSubContent,
|
|
6981
7033
|
ContextMenuSubTrigger,
|
|
6982
7034
|
ContextMenuTrigger,
|
|
6983
|
-
CreditTicketCard,
|
|
6984
7035
|
Dialog,
|
|
6985
7036
|
DialogClose,
|
|
6986
7037
|
DialogContent,
|
|
@@ -7196,6 +7247,7 @@ function ToggleGroupItem(_a) {
|
|
|
7196
7247
|
navigationButtonVariants,
|
|
7197
7248
|
navigationMenuTriggerStyle,
|
|
7198
7249
|
tabsListVariants,
|
|
7250
|
+
toast,
|
|
7199
7251
|
toggleVariants,
|
|
7200
7252
|
useComboboxAnchor,
|
|
7201
7253
|
useDirection,
|