@trading-game/design-intelligence-layer 0.17.1 → 0.17.3
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 +26 -8
- package/dist/index.cjs +140 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -5
- package/dist/index.d.ts +19 -5
- package/dist/index.js +140 -43
- package/dist/index.js.map +1 -1
- package/guides/design-system-guide/trading-game-ds-guide.md +5 -4
- package/package.json +1 -1
- package/src/styles.css +26 -2
package/dist/index.d.cts
CHANGED
|
@@ -62,7 +62,7 @@ interface AlertProps extends Omit<React$1.ComponentProps<"div">, "title">, Varia
|
|
|
62
62
|
declare function Alert({ variant, layout, title, description, icon, action, actions, onDismiss, dismissLabel, className, ...props }: AlertProps): react_jsx_runtime.JSX.Element | null;
|
|
63
63
|
|
|
64
64
|
declare const buttonVariants: (props?: ({
|
|
65
|
-
variant?: "primary" | "primary-inverse" | "secondary" | "secondary-inverse" | "tertiary" | null | undefined;
|
|
65
|
+
variant?: "primary" | "primary-inverse" | "primary-shimmer" | "primary-inverse-shimmer" | "secondary" | "secondary-inverse" | "tertiary" | "tertiary-inverse" | null | undefined;
|
|
66
66
|
size?: "lg" | "md" | "sm" | "xs" | "icon" | "icon-lg" | "icon-md" | "icon-sm" | "icon-xs" | null | undefined;
|
|
67
67
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
68
68
|
declare function Button({ className, variant, size, asChild, loading, children, ...props }: React$1.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
@@ -420,15 +420,18 @@ declare function HoverCardTrigger({ ...props }: React$1.ComponentProps<typeof Ho
|
|
|
420
420
|
declare function HoverCardContent({ className, align, sideOffset, ...props }: React$1.ComponentProps<typeof HoverCard$1.Content>): react_jsx_runtime.JSX.Element;
|
|
421
421
|
|
|
422
422
|
declare const inputVariants: (props?: ({
|
|
423
|
+
variant?: "default" | "inverse" | null | undefined;
|
|
423
424
|
size?: "lg" | "md" | "sm" | null | undefined;
|
|
424
425
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
425
|
-
declare function Input({ className, type, size, ...props }: Omit<React$1.ComponentProps<"input">, "size"> & VariantProps<typeof inputVariants>): react_jsx_runtime.JSX.Element;
|
|
426
|
+
declare function Input({ className, type, variant, size, ...props }: Omit<React$1.ComponentProps<"input">, "size"> & VariantProps<typeof inputVariants>): react_jsx_runtime.JSX.Element;
|
|
426
427
|
|
|
427
428
|
type InputGroupSize = "sm" | "md" | "lg";
|
|
429
|
+
type InputGroupVariant = "default" | "inverse";
|
|
428
430
|
declare const inputGroupVariants: (props?: ({
|
|
431
|
+
variant?: "default" | "inverse" | null | undefined;
|
|
429
432
|
size?: "lg" | "md" | "sm" | null | undefined;
|
|
430
433
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
431
|
-
declare function InputGroup({ className, size, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof inputGroupVariants>): react_jsx_runtime.JSX.Element;
|
|
434
|
+
declare function InputGroup({ className, variant, size, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof inputGroupVariants>): react_jsx_runtime.JSX.Element;
|
|
432
435
|
declare const inputGroupAddonVariants: (props?: ({
|
|
433
436
|
align?: "inline-start" | "inline-end" | "block-start" | "block-end" | null | undefined;
|
|
434
437
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
@@ -438,8 +441,9 @@ declare const inputGroupButtonVariants: (props?: ({
|
|
|
438
441
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
439
442
|
declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React$1.ComponentProps<typeof Button>, "size"> & VariantProps<typeof inputGroupButtonVariants>): react_jsx_runtime.JSX.Element;
|
|
440
443
|
declare function InputGroupText({ className, ...props }: React$1.ComponentProps<"span">): react_jsx_runtime.JSX.Element;
|
|
441
|
-
declare function InputGroupInput({ className, size: sizeProp, ...props }: Omit<React$1.ComponentProps<"input">, "size"> & {
|
|
444
|
+
declare function InputGroupInput({ className, size: sizeProp, variant: variantProp, ...props }: Omit<React$1.ComponentProps<"input">, "size"> & {
|
|
442
445
|
size?: InputGroupSize;
|
|
446
|
+
variant?: InputGroupVariant;
|
|
443
447
|
}): react_jsx_runtime.JSX.Element;
|
|
444
448
|
declare function InputGroupTextarea({ className, ...props }: React$1.ComponentProps<"textarea">): react_jsx_runtime.JSX.Element;
|
|
445
449
|
|
|
@@ -454,7 +458,17 @@ declare function InputOTPSeparator({ ...props }: React$1.ComponentProps<"div">):
|
|
|
454
458
|
|
|
455
459
|
declare function Separator({ className, orientation, decorative, ...props }: React$1.ComponentProps<typeof Separator$1.Root>): react_jsx_runtime.JSX.Element;
|
|
456
460
|
|
|
457
|
-
declare function ItemGroup({ className, ...props }: React$1.ComponentProps<"div">
|
|
461
|
+
declare function ItemGroup({ className, divider, ...props }: React$1.ComponentProps<"div"> & {
|
|
462
|
+
/**
|
|
463
|
+
* Auto-divide consecutive default-variant `Item`s with a bottom border
|
|
464
|
+
* (`border-border-subtle`). The last item's bottom border is suppressed,
|
|
465
|
+
* and non-default variants (`outline`, `muted`) are left untouched so
|
|
466
|
+
* they don't double up with their own borders. Defaults to `true`; pass
|
|
467
|
+
* `false` to opt out when the design wants flush items or uses
|
|
468
|
+
* `<ItemSeparator />` manually.
|
|
469
|
+
*/
|
|
470
|
+
divider?: boolean;
|
|
471
|
+
}): react_jsx_runtime.JSX.Element;
|
|
458
472
|
declare function ItemSeparator({ className, ...props }: React$1.ComponentProps<typeof Separator>): react_jsx_runtime.JSX.Element;
|
|
459
473
|
declare const itemVariants: (props?: ({
|
|
460
474
|
variant?: "default" | "outline" | "muted" | null | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -62,7 +62,7 @@ interface AlertProps extends Omit<React$1.ComponentProps<"div">, "title">, Varia
|
|
|
62
62
|
declare function Alert({ variant, layout, title, description, icon, action, actions, onDismiss, dismissLabel, className, ...props }: AlertProps): react_jsx_runtime.JSX.Element | null;
|
|
63
63
|
|
|
64
64
|
declare const buttonVariants: (props?: ({
|
|
65
|
-
variant?: "primary" | "primary-inverse" | "secondary" | "secondary-inverse" | "tertiary" | null | undefined;
|
|
65
|
+
variant?: "primary" | "primary-inverse" | "primary-shimmer" | "primary-inverse-shimmer" | "secondary" | "secondary-inverse" | "tertiary" | "tertiary-inverse" | null | undefined;
|
|
66
66
|
size?: "lg" | "md" | "sm" | "xs" | "icon" | "icon-lg" | "icon-md" | "icon-sm" | "icon-xs" | null | undefined;
|
|
67
67
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
68
68
|
declare function Button({ className, variant, size, asChild, loading, children, ...props }: React$1.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
@@ -420,15 +420,18 @@ declare function HoverCardTrigger({ ...props }: React$1.ComponentProps<typeof Ho
|
|
|
420
420
|
declare function HoverCardContent({ className, align, sideOffset, ...props }: React$1.ComponentProps<typeof HoverCard$1.Content>): react_jsx_runtime.JSX.Element;
|
|
421
421
|
|
|
422
422
|
declare const inputVariants: (props?: ({
|
|
423
|
+
variant?: "default" | "inverse" | null | undefined;
|
|
423
424
|
size?: "lg" | "md" | "sm" | null | undefined;
|
|
424
425
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
425
|
-
declare function Input({ className, type, size, ...props }: Omit<React$1.ComponentProps<"input">, "size"> & VariantProps<typeof inputVariants>): react_jsx_runtime.JSX.Element;
|
|
426
|
+
declare function Input({ className, type, variant, size, ...props }: Omit<React$1.ComponentProps<"input">, "size"> & VariantProps<typeof inputVariants>): react_jsx_runtime.JSX.Element;
|
|
426
427
|
|
|
427
428
|
type InputGroupSize = "sm" | "md" | "lg";
|
|
429
|
+
type InputGroupVariant = "default" | "inverse";
|
|
428
430
|
declare const inputGroupVariants: (props?: ({
|
|
431
|
+
variant?: "default" | "inverse" | null | undefined;
|
|
429
432
|
size?: "lg" | "md" | "sm" | null | undefined;
|
|
430
433
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
431
|
-
declare function InputGroup({ className, size, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof inputGroupVariants>): react_jsx_runtime.JSX.Element;
|
|
434
|
+
declare function InputGroup({ className, variant, size, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof inputGroupVariants>): react_jsx_runtime.JSX.Element;
|
|
432
435
|
declare const inputGroupAddonVariants: (props?: ({
|
|
433
436
|
align?: "inline-start" | "inline-end" | "block-start" | "block-end" | null | undefined;
|
|
434
437
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
@@ -438,8 +441,9 @@ declare const inputGroupButtonVariants: (props?: ({
|
|
|
438
441
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
439
442
|
declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React$1.ComponentProps<typeof Button>, "size"> & VariantProps<typeof inputGroupButtonVariants>): react_jsx_runtime.JSX.Element;
|
|
440
443
|
declare function InputGroupText({ className, ...props }: React$1.ComponentProps<"span">): react_jsx_runtime.JSX.Element;
|
|
441
|
-
declare function InputGroupInput({ className, size: sizeProp, ...props }: Omit<React$1.ComponentProps<"input">, "size"> & {
|
|
444
|
+
declare function InputGroupInput({ className, size: sizeProp, variant: variantProp, ...props }: Omit<React$1.ComponentProps<"input">, "size"> & {
|
|
442
445
|
size?: InputGroupSize;
|
|
446
|
+
variant?: InputGroupVariant;
|
|
443
447
|
}): react_jsx_runtime.JSX.Element;
|
|
444
448
|
declare function InputGroupTextarea({ className, ...props }: React$1.ComponentProps<"textarea">): react_jsx_runtime.JSX.Element;
|
|
445
449
|
|
|
@@ -454,7 +458,17 @@ declare function InputOTPSeparator({ ...props }: React$1.ComponentProps<"div">):
|
|
|
454
458
|
|
|
455
459
|
declare function Separator({ className, orientation, decorative, ...props }: React$1.ComponentProps<typeof Separator$1.Root>): react_jsx_runtime.JSX.Element;
|
|
456
460
|
|
|
457
|
-
declare function ItemGroup({ className, ...props }: React$1.ComponentProps<"div">
|
|
461
|
+
declare function ItemGroup({ className, divider, ...props }: React$1.ComponentProps<"div"> & {
|
|
462
|
+
/**
|
|
463
|
+
* Auto-divide consecutive default-variant `Item`s with a bottom border
|
|
464
|
+
* (`border-border-subtle`). The last item's bottom border is suppressed,
|
|
465
|
+
* and non-default variants (`outline`, `muted`) are left untouched so
|
|
466
|
+
* they don't double up with their own borders. Defaults to `true`; pass
|
|
467
|
+
* `false` to opt out when the design wants flush items or uses
|
|
468
|
+
* `<ItemSeparator />` manually.
|
|
469
|
+
*/
|
|
470
|
+
divider?: boolean;
|
|
471
|
+
}): react_jsx_runtime.JSX.Element;
|
|
458
472
|
declare function ItemSeparator({ className, ...props }: React$1.ComponentProps<typeof Separator>): react_jsx_runtime.JSX.Element;
|
|
459
473
|
declare const itemVariants: (props?: ({
|
|
460
474
|
variant?: "default" | "outline" | "muted" | null | undefined;
|
package/dist/index.js
CHANGED
|
@@ -173,10 +173,20 @@ var buttonVariants = cva(
|
|
|
173
173
|
primary: "bg-primary text-on-primary hover:bg-primary-hover",
|
|
174
174
|
// Primary Inverse — white bg + blue text; for use on dark/coloured surfaces
|
|
175
175
|
"primary-inverse": "bg-primary-inverse text-on-primary-inverse hover:bg-primary-inverse/80",
|
|
176
|
+
// Primary Shimmer — same surface as `primary` plus a sweeping
|
|
177
|
+
// white shimmer overlay (same animation as the TicketCard deposit
|
|
178
|
+
// stub). Use for headline CTAs that need to draw the eye.
|
|
179
|
+
"primary-shimmer": "relative overflow-hidden bg-primary text-on-primary hover:bg-primary-hover",
|
|
180
|
+
// Primary Inverse Shimmer — same surface as `primary-inverse` plus
|
|
181
|
+
// a sweeping brand-blue shimmer (white shimmer would be invisible
|
|
182
|
+
// on the white surface). For headline CTAs on dark/coloured pages.
|
|
183
|
+
"primary-inverse-shimmer": "relative overflow-hidden bg-primary-inverse text-on-primary-inverse hover:bg-primary-inverse/80",
|
|
176
184
|
secondary: "bg-transparent border-[1.5px] border-border-prominent text-on-prominent hover:bg-secondary-hover",
|
|
177
185
|
// Secondary Inverse — white border + white text; for use on dark/coloured surfaces
|
|
178
186
|
"secondary-inverse": "bg-transparent border-[1.5px] border-primary-inverse text-on-prominent-inverse hover:bg-primary-inverse/10",
|
|
179
|
-
tertiary: "bg-transparent text-primary hover:bg-primary/[0.08]"
|
|
187
|
+
tertiary: "bg-transparent text-primary hover:bg-primary/[0.08]",
|
|
188
|
+
// Tertiary Inverse — transparent + white text/icon; for use on dark/coloured surfaces
|
|
189
|
+
"tertiary-inverse": "bg-transparent text-on-primary hover:bg-on-primary/[0.10]"
|
|
180
190
|
},
|
|
181
191
|
size: {
|
|
182
192
|
lg: "h-12 w-fit gap-3 rounded-xs px-6 py-[14px] text-base [&_svg:not([class*='size-'])]:size-4",
|
|
@@ -207,6 +217,13 @@ var spinnerSizeMap = {
|
|
|
207
217
|
"icon-sm": "size-3.5",
|
|
208
218
|
"icon-xs": "size-3"
|
|
209
219
|
};
|
|
220
|
+
var shimmerGradients = {
|
|
221
|
+
// 110° tilts the bright band forward so the sweep reads as a diagonal
|
|
222
|
+
// shine. Three stops around 50% (soft → mid → soft) shape the highlight
|
|
223
|
+
// like a polished-metal gleam without going too bright at the peak.
|
|
224
|
+
"primary-shimmer": "linear-gradient(110deg, transparent 20%, rgba(255,255,255,0.10) 40%, rgba(255,255,255,0.20) 50%, rgba(255,255,255,0.10) 60%, transparent 80%)",
|
|
225
|
+
"primary-inverse-shimmer": "linear-gradient(110deg, transparent 20%, rgba(35,35,255,0.07) 40%, rgba(35,35,255,0.14) 50%, rgba(35,35,255,0.07) 60%, transparent 80%)"
|
|
226
|
+
};
|
|
210
227
|
function Button(_a) {
|
|
211
228
|
var _b = _a, {
|
|
212
229
|
className,
|
|
@@ -224,7 +241,7 @@ function Button(_a) {
|
|
|
224
241
|
"children"
|
|
225
242
|
]);
|
|
226
243
|
const Comp = asChild ? Slot.Root : "button";
|
|
227
|
-
return /* @__PURE__ */
|
|
244
|
+
return /* @__PURE__ */ jsxs3(
|
|
228
245
|
Comp,
|
|
229
246
|
__spreadProps(__spreadValues({
|
|
230
247
|
"data-slot": "button",
|
|
@@ -237,10 +254,20 @@ function Button(_a) {
|
|
|
237
254
|
),
|
|
238
255
|
"aria-busy": loading || void 0
|
|
239
256
|
}, props), {
|
|
240
|
-
children:
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
257
|
+
children: [
|
|
258
|
+
variant && shimmerGradients[variant] && !loading && !props.disabled ? /* @__PURE__ */ jsx3(
|
|
259
|
+
"span",
|
|
260
|
+
{
|
|
261
|
+
"aria-hidden": true,
|
|
262
|
+
className: "pointer-events-none absolute inset-0 [animation:button-shimmer_4s_linear_infinite]",
|
|
263
|
+
style: { background: shimmerGradients[variant] }
|
|
264
|
+
}
|
|
265
|
+
) : null,
|
|
266
|
+
loading ? /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
267
|
+
/* @__PURE__ */ jsx3("span", { className: "invisible inline-flex items-center gap-[inherit]", "aria-hidden": true, children }),
|
|
268
|
+
/* @__PURE__ */ jsx3("span", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx3(Spinner, { className: spinnerSizeMap[size != null ? size : "lg"] }) })
|
|
269
|
+
] }) : children
|
|
270
|
+
]
|
|
244
271
|
})
|
|
245
272
|
);
|
|
246
273
|
}
|
|
@@ -771,7 +798,7 @@ var badgeVariants = cva3(
|
|
|
771
798
|
"fill-success": "bg-semantic-win/10 border-transparent text-semantic-win",
|
|
772
799
|
"fill-fail": "bg-semantic-loss/10 border-transparent text-semantic-loss",
|
|
773
800
|
"fill-warning": "bg-semantic-warning/10 border-transparent text-semantic-warning",
|
|
774
|
-
"fill-credit": "bg-semantic-boost-surface
|
|
801
|
+
"fill-credit": "bg-semantic-boost-surface backdrop-blur-md text-on-primary",
|
|
775
802
|
// Demo / test-mode flag — opaque light-peach surface + red-orange text.
|
|
776
803
|
// Uses --semantic-demo-surface (a solid color-mix of demo @ 10% with white)
|
|
777
804
|
// so the badge looks identical on any background.
|
|
@@ -823,7 +850,7 @@ import { Gift, X as X2 } from "lucide-react";
|
|
|
823
850
|
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
824
851
|
var SURFACE_CLASSES = "w-full rounded-sm border border-primary/[0.16] bg-primary/[0.08] px-4 py-3.5";
|
|
825
852
|
function IconBadge({ glyph }) {
|
|
826
|
-
return /* @__PURE__ */ jsx9("span", { className: "inline-flex size-10 shrink-0 items-center justify-center rounded-
|
|
853
|
+
return /* @__PURE__ */ jsx9("span", { className: "inline-flex size-10 shrink-0 items-center justify-center rounded-full bg-primary text-on-primary", children: glyph });
|
|
827
854
|
}
|
|
828
855
|
function Banner(_a) {
|
|
829
856
|
var _b = _a, {
|
|
@@ -1926,16 +1953,31 @@ import { cva as cva5 } from "class-variance-authority";
|
|
|
1926
1953
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1927
1954
|
var inputVariants = cva5(
|
|
1928
1955
|
[
|
|
1929
|
-
"w-full min-w-0 rounded-
|
|
1930
|
-
"
|
|
1931
|
-
"selection:bg-primary selection:text-on-primary",
|
|
1932
|
-
"file:inline-flex file:border-0 file:bg-transparent file:font-medium file:text-on-prominent",
|
|
1933
|
-
"placeholder:text-on-subtle",
|
|
1956
|
+
"w-full min-w-0 rounded-xs border font-body transition-[color,box-shadow] outline-none",
|
|
1957
|
+
"file:inline-flex file:border-0 file:bg-transparent file:font-medium",
|
|
1934
1958
|
"disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
1935
|
-
"focus-visible:
|
|
1959
|
+
"focus-visible:ring-[3px]"
|
|
1936
1960
|
].join(" "),
|
|
1937
1961
|
{
|
|
1938
1962
|
variants: {
|
|
1963
|
+
// `default` is the light-surface treatment; `inverse` is the sunken
|
|
1964
|
+
// dark-fill treatment for coloured surfaces (e.g. bg-primary).
|
|
1965
|
+
variant: {
|
|
1966
|
+
default: [
|
|
1967
|
+
"border-border-subtle bg-white/5 text-on-prominent",
|
|
1968
|
+
"file:text-on-prominent",
|
|
1969
|
+
"placeholder:text-on-subtle",
|
|
1970
|
+
"selection:bg-primary selection:text-on-primary",
|
|
1971
|
+
"focus-visible:border-primary focus-visible:ring-primary/[0.08]"
|
|
1972
|
+
].join(" "),
|
|
1973
|
+
inverse: [
|
|
1974
|
+
"border-on-primary/25 bg-input-inverse-surface text-on-primary",
|
|
1975
|
+
"file:text-on-primary",
|
|
1976
|
+
"placeholder:text-on-primary/45",
|
|
1977
|
+
"selection:bg-on-primary selection:text-primary",
|
|
1978
|
+
"focus-visible:border-on-primary focus-visible:ring-on-primary/40"
|
|
1979
|
+
].join(" ")
|
|
1980
|
+
},
|
|
1939
1981
|
size: {
|
|
1940
1982
|
sm: "h-8 px-3 py-1 text-xs file:h-6 file:text-xs",
|
|
1941
1983
|
md: "h-10 px-3 py-1 text-sm file:h-7 file:text-sm",
|
|
@@ -1943,6 +1985,7 @@ var inputVariants = cva5(
|
|
|
1943
1985
|
}
|
|
1944
1986
|
},
|
|
1945
1987
|
defaultVariants: {
|
|
1988
|
+
variant: "default",
|
|
1946
1989
|
size: "md"
|
|
1947
1990
|
}
|
|
1948
1991
|
}
|
|
@@ -1951,10 +1994,12 @@ function Input(_a) {
|
|
|
1951
1994
|
var _b = _a, {
|
|
1952
1995
|
className,
|
|
1953
1996
|
type,
|
|
1997
|
+
variant = "default",
|
|
1954
1998
|
size = "md"
|
|
1955
1999
|
} = _b, props = __objRest(_b, [
|
|
1956
2000
|
"className",
|
|
1957
2001
|
"type",
|
|
2002
|
+
"variant",
|
|
1958
2003
|
"size"
|
|
1959
2004
|
]);
|
|
1960
2005
|
return /* @__PURE__ */ jsx18(
|
|
@@ -1962,8 +2007,9 @@ function Input(_a) {
|
|
|
1962
2007
|
__spreadValues({
|
|
1963
2008
|
type,
|
|
1964
2009
|
"data-slot": "input",
|
|
2010
|
+
"data-variant": variant,
|
|
1965
2011
|
"data-size": size,
|
|
1966
|
-
className: cn(inputVariants({ size }), className)
|
|
2012
|
+
className: cn(inputVariants({ variant, size }), className)
|
|
1967
2013
|
}, props)
|
|
1968
2014
|
);
|
|
1969
2015
|
}
|
|
@@ -1987,24 +2033,36 @@ function Textarea(_a) {
|
|
|
1987
2033
|
// components/ui/input-group.tsx
|
|
1988
2034
|
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1989
2035
|
var InputGroupSizeContext = React6.createContext("md");
|
|
2036
|
+
var InputGroupVariantContext = React6.createContext("default");
|
|
1990
2037
|
var inputGroupVariants = cva6(
|
|
1991
2038
|
[
|
|
1992
|
-
"group/input-group relative flex w-full items-center rounded-
|
|
1993
|
-
"
|
|
1994
|
-
// Reduce input padding on the
|
|
2039
|
+
"group/input-group relative flex w-full items-center rounded-xs border",
|
|
2040
|
+
"transition-[color,box-shadow] outline-none min-w-0 has-[>textarea]:h-auto",
|
|
2041
|
+
// Reduce input padding only on the side an addon is attached to; the
|
|
2042
|
+
// opposite side keeps the natural Input padding (pl-3 / pr-3 = 12 px).
|
|
1995
2043
|
"has-[>[data-align=inline-start]]:[&>input]:pl-2",
|
|
1996
|
-
"has-[>[data-align=inline-start]]:[&>input]:pr-2",
|
|
1997
2044
|
"has-[>[data-align=inline-end]]:[&>input]:pr-2",
|
|
1998
|
-
"has-[>[data-align=inline-end]]:[&>input]:pl-2",
|
|
1999
2045
|
"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3",
|
|
2000
2046
|
"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3",
|
|
2001
|
-
// Focus
|
|
2002
|
-
"has-[[data-slot=input-group-control]:focus-visible]:
|
|
2047
|
+
// Focus ring (size; colour comes from the variant).
|
|
2048
|
+
"has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]",
|
|
2003
2049
|
// Error state.
|
|
2004
2050
|
"has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20"
|
|
2005
2051
|
].join(" "),
|
|
2006
2052
|
{
|
|
2007
2053
|
variants: {
|
|
2054
|
+
// `default` is the light-surface treatment; `inverse` is the sunken
|
|
2055
|
+
// dark-fill treatment for coloured surfaces (mirrors `Input`).
|
|
2056
|
+
variant: {
|
|
2057
|
+
default: [
|
|
2058
|
+
"border-border-subtle bg-white/5",
|
|
2059
|
+
"has-[[data-slot=input-group-control]:focus-visible]:border-primary has-[[data-slot=input-group-control]:focus-visible]:ring-primary/[0.08]"
|
|
2060
|
+
].join(" "),
|
|
2061
|
+
inverse: [
|
|
2062
|
+
"border-on-primary/25 bg-input-inverse-surface",
|
|
2063
|
+
"has-[[data-slot=input-group-control]:focus-visible]:border-on-primary has-[[data-slot=input-group-control]:focus-visible]:ring-on-primary/40"
|
|
2064
|
+
].join(" ")
|
|
2065
|
+
},
|
|
2008
2066
|
size: {
|
|
2009
2067
|
sm: "h-8",
|
|
2010
2068
|
md: "h-10",
|
|
@@ -2012,6 +2070,7 @@ var inputGroupVariants = cva6(
|
|
|
2012
2070
|
}
|
|
2013
2071
|
},
|
|
2014
2072
|
defaultVariants: {
|
|
2073
|
+
variant: "default",
|
|
2015
2074
|
size: "md"
|
|
2016
2075
|
}
|
|
2017
2076
|
}
|
|
@@ -2019,24 +2078,35 @@ var inputGroupVariants = cva6(
|
|
|
2019
2078
|
function InputGroup(_a) {
|
|
2020
2079
|
var _b = _a, {
|
|
2021
2080
|
className,
|
|
2081
|
+
variant = "default",
|
|
2022
2082
|
size = "md"
|
|
2023
2083
|
} = _b, props = __objRest(_b, [
|
|
2024
2084
|
"className",
|
|
2085
|
+
"variant",
|
|
2025
2086
|
"size"
|
|
2026
2087
|
]);
|
|
2027
|
-
return /* @__PURE__ */ jsx20(
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2088
|
+
return /* @__PURE__ */ jsx20(
|
|
2089
|
+
InputGroupVariantContext.Provider,
|
|
2090
|
+
{
|
|
2091
|
+
value: variant,
|
|
2092
|
+
children: /* @__PURE__ */ jsx20(InputGroupSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsx20(
|
|
2093
|
+
"div",
|
|
2094
|
+
__spreadValues({
|
|
2095
|
+
"data-slot": "input-group",
|
|
2096
|
+
"data-variant": variant,
|
|
2097
|
+
"data-size": size,
|
|
2098
|
+
role: "group",
|
|
2099
|
+
className: cn(inputGroupVariants({ variant, size }), className)
|
|
2100
|
+
}, props)
|
|
2101
|
+
) })
|
|
2102
|
+
}
|
|
2103
|
+
);
|
|
2036
2104
|
}
|
|
2037
2105
|
var inputGroupAddonVariants = cva6(
|
|
2038
2106
|
[
|
|
2039
2107
|
"flex h-auto cursor-text items-center justify-center gap-2 py-1.5 font-medium text-on-subtle select-none",
|
|
2108
|
+
// Swap addon text/icon colour when inside an inverse group.
|
|
2109
|
+
"group-data-[variant=inverse]/input-group:text-on-primary/70",
|
|
2040
2110
|
"group-data-[disabled=true]/input-group:opacity-50",
|
|
2041
2111
|
"[&>kbd]:rounded-[calc(var(--radius)-5px)]",
|
|
2042
2112
|
// Size-responsive text and icon sizing.
|
|
@@ -2131,6 +2201,8 @@ function InputGroupText(_a) {
|
|
|
2131
2201
|
__spreadValues({
|
|
2132
2202
|
className: cn(
|
|
2133
2203
|
"flex items-center gap-2 text-on-subtle",
|
|
2204
|
+
// Swap text/icon colour when inside an inverse group.
|
|
2205
|
+
"group-data-[variant=inverse]/input-group:text-on-primary/70",
|
|
2134
2206
|
"group-data-[size=sm]/input-group:text-xs group-data-[size=sm]/input-group:[&_svg:not([class*='size-'])]:size-3.5",
|
|
2135
2207
|
"group-data-[size=md]/input-group:text-sm group-data-[size=md]/input-group:[&_svg:not([class*='size-'])]:size-4",
|
|
2136
2208
|
"group-data-[size=lg]/input-group:text-sm group-data-[size=lg]/input-group:[&_svg:not([class*='size-'])]:size-4",
|
|
@@ -2143,18 +2215,23 @@ function InputGroupText(_a) {
|
|
|
2143
2215
|
function InputGroupInput(_a) {
|
|
2144
2216
|
var _b = _a, {
|
|
2145
2217
|
className,
|
|
2146
|
-
size: sizeProp
|
|
2218
|
+
size: sizeProp,
|
|
2219
|
+
variant: variantProp
|
|
2147
2220
|
} = _b, props = __objRest(_b, [
|
|
2148
2221
|
"className",
|
|
2149
|
-
"size"
|
|
2222
|
+
"size",
|
|
2223
|
+
"variant"
|
|
2150
2224
|
]);
|
|
2151
2225
|
const groupSize = React6.useContext(InputGroupSizeContext);
|
|
2226
|
+
const groupVariant = React6.useContext(InputGroupVariantContext);
|
|
2152
2227
|
const size = sizeProp != null ? sizeProp : groupSize;
|
|
2228
|
+
const variant = variantProp != null ? variantProp : groupVariant;
|
|
2153
2229
|
return /* @__PURE__ */ jsx20(
|
|
2154
2230
|
Input,
|
|
2155
2231
|
__spreadValues({
|
|
2156
2232
|
"data-slot": "input-group-control",
|
|
2157
2233
|
size,
|
|
2234
|
+
variant,
|
|
2158
2235
|
className: cn(
|
|
2159
2236
|
"h-full flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0",
|
|
2160
2237
|
className
|
|
@@ -3966,13 +4043,37 @@ import { cva as cva9 } from "class-variance-authority";
|
|
|
3966
4043
|
import { Slot as Slot5 } from "radix-ui";
|
|
3967
4044
|
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
3968
4045
|
function ItemGroup(_a) {
|
|
3969
|
-
var _b = _a, {
|
|
4046
|
+
var _b = _a, {
|
|
4047
|
+
className,
|
|
4048
|
+
divider = true
|
|
4049
|
+
} = _b, props = __objRest(_b, [
|
|
4050
|
+
"className",
|
|
4051
|
+
"divider"
|
|
4052
|
+
]);
|
|
3970
4053
|
return /* @__PURE__ */ jsx35(
|
|
3971
4054
|
"div",
|
|
3972
4055
|
__spreadValues({
|
|
3973
4056
|
role: "list",
|
|
3974
4057
|
"data-slot": "item-group",
|
|
3975
|
-
|
|
4058
|
+
"data-divider": divider ? "true" : void 0,
|
|
4059
|
+
className: cn(
|
|
4060
|
+
"group/item-group flex flex-col",
|
|
4061
|
+
// Divider mode: 4 px gap between items + a 1 px line drawn via
|
|
4062
|
+
// ::after on each non-last default item, sitting in that gap.
|
|
4063
|
+
// Item itself stays border-free — the line is a separate visual
|
|
4064
|
+
// element rather than an outline on the item.
|
|
4065
|
+
divider && [
|
|
4066
|
+
"gap-1",
|
|
4067
|
+
"[&>[data-slot=item][data-variant=default]:not(:last-child)]:relative",
|
|
4068
|
+
"[&>[data-slot=item][data-variant=default]:not(:last-child)]:after:content-['']",
|
|
4069
|
+
"[&>[data-slot=item][data-variant=default]:not(:last-child)]:after:absolute",
|
|
4070
|
+
"[&>[data-slot=item][data-variant=default]:not(:last-child)]:after:-bottom-0.5",
|
|
4071
|
+
"[&>[data-slot=item][data-variant=default]:not(:last-child)]:after:inset-x-4",
|
|
4072
|
+
"[&>[data-slot=item][data-variant=default]:not(:last-child)]:after:h-px",
|
|
4073
|
+
"[&>[data-slot=item][data-variant=default]:not(:last-child)]:after:bg-border-subtle"
|
|
4074
|
+
],
|
|
4075
|
+
className
|
|
4076
|
+
)
|
|
3976
4077
|
}, props)
|
|
3977
4078
|
);
|
|
3978
4079
|
}
|
|
@@ -4040,8 +4141,8 @@ var itemMediaVariants = cva9(
|
|
|
4040
4141
|
variants: {
|
|
4041
4142
|
variant: {
|
|
4042
4143
|
default: "bg-transparent",
|
|
4043
|
-
icon: "size-8 rounded-
|
|
4044
|
-
image: "size-10 overflow-hidden rounded-
|
|
4144
|
+
icon: "size-8 rounded-full border bg-subtle [&_svg:not([class*='size-'])]:size-4",
|
|
4145
|
+
image: "size-10 overflow-hidden rounded-full [&_img]:size-full [&_img]:object-cover"
|
|
4045
4146
|
}
|
|
4046
4147
|
},
|
|
4047
4148
|
defaultVariants: {
|
|
@@ -5138,7 +5239,7 @@ function SelectTrigger(_a) {
|
|
|
5138
5239
|
"data-readonly": readOnly ? "" : void 0,
|
|
5139
5240
|
disabled: readOnly || props.disabled,
|
|
5140
5241
|
className: cn(
|
|
5141
|
-
"flex w-fit items-center justify-between gap-2 rounded-
|
|
5242
|
+
"flex w-fit items-center justify-between gap-2 rounded-xs border border-input bg-prominent appearance-none whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-on-subtle data-[size=sm]:h-8 data-[size=sm]:px-3 data-[size=sm]:py-1 data-[size=sm]:text-xs data-[size=md]:h-10 data-[size=md]:px-3 data-[size=md]:py-1 data-[size=md]:text-sm data-[size=lg]:h-12 data-[size=lg]:px-4 data-[size=lg]:py-2 data-[size=lg]:text-base *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-on-subtle data-[readonly]:cursor-default data-[readonly]:opacity-100",
|
|
5142
5243
|
className
|
|
5143
5244
|
)
|
|
5144
5245
|
}, props), {
|
|
@@ -7455,7 +7556,6 @@ function NavBarBlock({ brand, links, signIn, signUp }) {
|
|
|
7455
7556
|
}
|
|
7456
7557
|
|
|
7457
7558
|
// components/blocks/open-positions-block.tsx
|
|
7458
|
-
import * as React18 from "react";
|
|
7459
7559
|
import { History as History2, X as X4 } from "lucide-react";
|
|
7460
7560
|
import { jsx as jsx68, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
7461
7561
|
function OpenPositionsBlock({
|
|
@@ -7497,10 +7597,7 @@ function PositionsList({
|
|
|
7497
7597
|
onViewHistory
|
|
7498
7598
|
}) {
|
|
7499
7599
|
return /* @__PURE__ */ jsxs36("div", { className: "flex flex-col flex-1 min-h-0", children: [
|
|
7500
|
-
/* @__PURE__ */ jsx68(ItemGroup, { className: "min-h-0 overflow-y-auto", children: positions.map((pos, i) => /* @__PURE__ */
|
|
7501
|
-
/* @__PURE__ */ jsx68(PositionRow, { position: pos }),
|
|
7502
|
-
i < positions.length - 1 && /* @__PURE__ */ jsx68("div", { className: "h-px mx-4 bg-border-subtle" })
|
|
7503
|
-
] }, i)) }),
|
|
7600
|
+
/* @__PURE__ */ jsx68(ItemGroup, { className: "min-h-0 overflow-y-auto", children: positions.map((pos, i) => /* @__PURE__ */ jsx68(PositionRow, { position: pos }, i)) }),
|
|
7504
7601
|
/* @__PURE__ */ jsx68(Separator, {}),
|
|
7505
7602
|
/* @__PURE__ */ jsx68("div", { className: "shrink-0 flex justify-center py-4", children: /* @__PURE__ */ jsx68(Button, { variant: "tertiary", size: "md", onClick: onViewHistory, children: "View trade history" }) })
|
|
7506
7603
|
] });
|