@trading-game/design-intelligence-layer 0.16.9 → 0.17.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 +34 -6
- package/dist/index.cjs +40 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +40 -21
- package/dist/index.js.map +1 -1
- package/guides/design-system-guide/trading-game-ds-guide.md +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -165,7 +165,7 @@ function Spinner(_a) {
|
|
|
165
165
|
// components/ui/button.tsx
|
|
166
166
|
import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
167
167
|
var buttonVariants = cva(
|
|
168
|
-
"inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-
|
|
168
|
+
"inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-[color,border-color,opacity,box-shadow,transform] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 active:opacity-60 disabled:pointer-events-none disabled:opacity-24 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 font-display font-bold",
|
|
169
169
|
{
|
|
170
170
|
variants: {
|
|
171
171
|
variant: {
|
|
@@ -456,7 +456,7 @@ function Alert(_a) {
|
|
|
456
456
|
}, props), {
|
|
457
457
|
children: [
|
|
458
458
|
iconColumn,
|
|
459
|
-
/* @__PURE__ */ jsx4("div", { className: "col-
|
|
459
|
+
/* @__PURE__ */ jsx4("div", { className: "col-start-2 row-start-1 min-w-0", children: body }),
|
|
460
460
|
/* @__PURE__ */ jsx4("div", { className: "col-start-3 row-start-1", children: closeButton }),
|
|
461
461
|
actions && actions.length > 0 ? /* @__PURE__ */ jsx4("div", { className: "col-span-3 col-start-2 row-start-2 mt-2 flex flex-wrap items-center justify-start gap-2", children: actions.slice(0, 2).map((node, i) => /* @__PURE__ */ jsx4(React.Fragment, { children: wrapAction(node, buttonVariant) }, i)) }) : null
|
|
462
462
|
]
|
|
@@ -821,9 +821,9 @@ function Badge(_a) {
|
|
|
821
821
|
import * as React2 from "react";
|
|
822
822
|
import { Gift, X as X2 } from "lucide-react";
|
|
823
823
|
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
824
|
-
var SURFACE_CLASSES = "w-full rounded-
|
|
824
|
+
var SURFACE_CLASSES = "w-full rounded-sm border border-primary/[0.16] bg-primary/[0.08] px-4 py-3.5";
|
|
825
825
|
function IconBadge({ glyph }) {
|
|
826
|
-
return /* @__PURE__ */ jsx9("span", { className: "inline-flex size-10 shrink-0 items-center justify-center rounded-
|
|
826
|
+
return /* @__PURE__ */ jsx9("span", { className: "inline-flex size-10 shrink-0 items-center justify-center rounded-xs bg-primary text-on-primary", children: glyph });
|
|
827
827
|
}
|
|
828
828
|
function Banner(_a) {
|
|
829
829
|
var _b = _a, {
|
|
@@ -923,7 +923,9 @@ function Banner(_a) {
|
|
|
923
923
|
const iconColumn = showIcon ? /* @__PURE__ */ jsx9("div", { "aria-hidden": true, className: "inline-flex shrink-0 translate-y-px", children: resolvedIcon }) : null;
|
|
924
924
|
if (isInline) {
|
|
925
925
|
const hasAction = Boolean(effectiveAction);
|
|
926
|
+
const hasDescription = Boolean(description);
|
|
926
927
|
const rowTemplate = hasAction ? "grid-rows-[auto_auto] gap-y-3 sm:grid-rows-1 sm:gap-y-0" : "grid-rows-1 gap-y-0";
|
|
928
|
+
const gridCols = hasDescription ? "grid-cols-[auto_1fr] sm:grid-cols-[auto_1fr_auto]" : "grid-cols-[auto_1fr_auto] sm:grid-cols-[auto_1fr_auto_auto]";
|
|
927
929
|
return /* @__PURE__ */ jsxs6(
|
|
928
930
|
"div",
|
|
929
931
|
__spreadProps(__spreadValues(__spreadValues({
|
|
@@ -931,9 +933,15 @@ function Banner(_a) {
|
|
|
931
933
|
"data-layout": "inline",
|
|
932
934
|
"data-clickable": isClickable ? "true" : void 0,
|
|
933
935
|
className: cn(
|
|
934
|
-
"grid
|
|
936
|
+
"grid gap-x-4",
|
|
937
|
+
// Single-line banners vertically-centre the row (icon + title);
|
|
938
|
+
// multi-line banners top-align so the leading icon sits next to
|
|
939
|
+
// the title instead of floating mid-body.
|
|
940
|
+
hasDescription ? "items-start" : "items-center",
|
|
941
|
+
gridCols,
|
|
935
942
|
rowTemplate,
|
|
936
943
|
SURFACE_CLASSES,
|
|
944
|
+
hasDescription && "relative pr-12",
|
|
937
945
|
clickableClasses,
|
|
938
946
|
className
|
|
939
947
|
)
|
|
@@ -941,7 +949,7 @@ function Banner(_a) {
|
|
|
941
949
|
children: [
|
|
942
950
|
/* @__PURE__ */ jsx9("div", { className: "col-start-1 row-start-1", children: iconColumn }),
|
|
943
951
|
/* @__PURE__ */ jsx9("div", { className: "col-start-2 row-start-1 min-w-0", children: body }),
|
|
944
|
-
/* @__PURE__ */ jsx9("div", { className: "col-start-3 row-start-1 sm:col-start-4", children: closeButton }),
|
|
952
|
+
hasDescription ? /* @__PURE__ */ jsx9("div", { className: "absolute top-3 right-3", children: closeButton }) : /* @__PURE__ */ jsx9("div", { className: "col-start-3 row-start-1 self-center sm:col-start-4", children: closeButton }),
|
|
945
953
|
hasAction ? /* @__PURE__ */ jsx9("div", { className: "col-start-2 row-start-2 justify-self-start sm:col-start-3 sm:row-start-1 sm:self-center sm:justify-self-end", children: wrapAction2(effectiveAction) }) : null
|
|
946
954
|
]
|
|
947
955
|
})
|
|
@@ -954,8 +962,10 @@ function Banner(_a) {
|
|
|
954
962
|
"data-layout": "card",
|
|
955
963
|
"data-clickable": isClickable ? "true" : void 0,
|
|
956
964
|
className: cn(
|
|
957
|
-
|
|
965
|
+
// Card layout is always multi-row — top-align the icon with the title.
|
|
966
|
+
"relative grid grid-cols-[auto_1fr] grid-rows-[auto_auto] items-start gap-x-4 gap-y-3",
|
|
958
967
|
SURFACE_CLASSES,
|
|
968
|
+
"pr-12",
|
|
959
969
|
clickableClasses,
|
|
960
970
|
className
|
|
961
971
|
)
|
|
@@ -963,8 +973,8 @@ function Banner(_a) {
|
|
|
963
973
|
children: [
|
|
964
974
|
/* @__PURE__ */ jsx9("div", { className: "col-start-1 row-start-1", children: iconColumn }),
|
|
965
975
|
/* @__PURE__ */ jsx9("div", { className: "col-start-2 row-start-1 min-w-0", children: body }),
|
|
966
|
-
/* @__PURE__ */ jsx9("div", { className: "
|
|
967
|
-
effectiveActions && effectiveActions.length > 0 ? /* @__PURE__ */ jsx9("div", { className: "col-
|
|
976
|
+
/* @__PURE__ */ jsx9("div", { className: "absolute top-3 right-3", children: closeButton }),
|
|
977
|
+
effectiveActions && effectiveActions.length > 0 ? /* @__PURE__ */ jsx9("div", { className: "col-start-2 row-start-2 flex flex-wrap items-center justify-start gap-2", children: effectiveActions.slice(0, 2).map((node, i) => /* @__PURE__ */ jsx9(React2.Fragment, { children: wrapAction2(node) }, i)) }) : null
|
|
968
978
|
]
|
|
969
979
|
})
|
|
970
980
|
);
|
|
@@ -4166,7 +4176,7 @@ import { cva as cva10 } from "class-variance-authority";
|
|
|
4166
4176
|
import { Slot as Slot6 } from "radix-ui";
|
|
4167
4177
|
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
4168
4178
|
var linkVariants = cva10(
|
|
4169
|
-
"inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 active:opacity-60 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:inline font-display font-bold normal-case text-primary
|
|
4179
|
+
"inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 active:opacity-60 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:inline font-display font-bold normal-case text-primary underline decoration-2 underline-offset-4",
|
|
4170
4180
|
{
|
|
4171
4181
|
variants: {
|
|
4172
4182
|
size: {
|
|
@@ -5506,8 +5516,8 @@ function TooltipContent(_a) {
|
|
|
5506
5516
|
/* @__PURE__ */ jsx51(DrawerFooter, { children: /* @__PURE__ */ jsx51(DrawerClose, { asChild: true, children: /* @__PURE__ */ jsx51(Button, { variant: "primary", size: "md", children: closeLabel }) }) })
|
|
5507
5517
|
] });
|
|
5508
5518
|
}
|
|
5509
|
-
const surfaceClasses = variant === "inverse" ? "bg-prominent text-on-prominent shadow-sm" : "bg-
|
|
5510
|
-
const arrowClasses = variant === "inverse" ? "fill-prominent" : "fill-
|
|
5519
|
+
const surfaceClasses = variant === "inverse" ? "bg-prominent text-on-prominent shadow-sm" : "bg-prominent-inverse text-on-prominent-inverse";
|
|
5520
|
+
const arrowClasses = variant === "inverse" ? "fill-prominent" : "fill-prominent-inverse";
|
|
5511
5521
|
return /* @__PURE__ */ jsx51(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs25(
|
|
5512
5522
|
TooltipPrimitive.Content,
|
|
5513
5523
|
__spreadProps(__spreadValues({
|
|
@@ -5515,7 +5525,7 @@ function TooltipContent(_a) {
|
|
|
5515
5525
|
"data-variant": variant,
|
|
5516
5526
|
sideOffset,
|
|
5517
5527
|
className: cn(
|
|
5518
|
-
"z-50 w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md border-0 px-3 py-1.5 text-sm font-medium text-balance whitespace-normal 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",
|
|
5528
|
+
"z-50 w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md border-0 px-3 py-1.5 has-[[data-slot=kbd]]:px-3.5 has-[[data-slot=kbd]]:py-2 has-[[data-slot=kbd]]:space-y-1.5 text-sm font-medium text-balance whitespace-normal 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",
|
|
5519
5529
|
surfaceClasses,
|
|
5520
5530
|
className
|
|
5521
5531
|
)
|
|
@@ -5808,7 +5818,10 @@ function SidebarHeader(_a) {
|
|
|
5808
5818
|
__spreadValues({
|
|
5809
5819
|
"data-slot": "sidebar-header",
|
|
5810
5820
|
"data-sidebar": "header",
|
|
5811
|
-
className: cn(
|
|
5821
|
+
className: cn(
|
|
5822
|
+
"flex flex-col gap-2 px-layout-margin-inline py-2 group-data-[collapsible=icon]:px-2",
|
|
5823
|
+
className
|
|
5824
|
+
)
|
|
5812
5825
|
}, props)
|
|
5813
5826
|
);
|
|
5814
5827
|
}
|
|
@@ -5819,7 +5832,10 @@ function SidebarFooter(_a) {
|
|
|
5819
5832
|
__spreadValues({
|
|
5820
5833
|
"data-slot": "sidebar-footer",
|
|
5821
5834
|
"data-sidebar": "footer",
|
|
5822
|
-
className: cn(
|
|
5835
|
+
className: cn(
|
|
5836
|
+
"flex flex-col gap-2 px-layout-margin-inline py-2 group-data-[collapsible=icon]:px-2",
|
|
5837
|
+
className
|
|
5838
|
+
)
|
|
5823
5839
|
}, props)
|
|
5824
5840
|
);
|
|
5825
5841
|
}
|
|
@@ -5859,7 +5875,10 @@ function SidebarGroup(_a) {
|
|
|
5859
5875
|
__spreadValues({
|
|
5860
5876
|
"data-slot": "sidebar-group",
|
|
5861
5877
|
"data-sidebar": "group",
|
|
5862
|
-
className: cn(
|
|
5878
|
+
className: cn(
|
|
5879
|
+
"relative flex w-full min-w-0 flex-col px-layout-margin-inline py-2 group-data-[collapsible=icon]:px-2",
|
|
5880
|
+
className
|
|
5881
|
+
)
|
|
5863
5882
|
}, props)
|
|
5864
5883
|
);
|
|
5865
5884
|
}
|
|
@@ -5947,7 +5966,7 @@ function SidebarMenuItem(_a) {
|
|
|
5947
5966
|
);
|
|
5948
5967
|
}
|
|
5949
5968
|
var sidebarMenuButtonVariants = cva13(
|
|
5950
|
-
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-sm p-2 text-left text-sidebar-foreground text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-secondary-hover hover:text-primary focus-visible:ring-2 active:bg-secondary-hover active:text-primary disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-
|
|
5969
|
+
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-sm p-2 text-left text-sidebar-foreground text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-secondary-hover hover:text-primary focus-visible:ring-2 active:bg-secondary-hover active:text-primary disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-primary/10 data-[active=true]:font-semibold data-[active=true]:text-primary data-[active=true]:hover:bg-primary/10 data-[active=true]:hover:text-primary data-[state=open]:hover:bg-secondary-hover data-[state=open]:hover:text-primary [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 data-[active=true]:[&>svg]:text-primary",
|
|
5951
5970
|
{
|
|
5952
5971
|
variants: {
|
|
5953
5972
|
variant: {
|
|
@@ -5957,7 +5976,7 @@ var sidebarMenuButtonVariants = cva13(
|
|
|
5957
5976
|
size: {
|
|
5958
5977
|
default: "h-8 text-sm",
|
|
5959
5978
|
sm: "h-7 text-xs",
|
|
5960
|
-
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
|
|
5979
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0! group-data-[collapsible=icon]:justify-center"
|
|
5961
5980
|
}
|
|
5962
5981
|
},
|
|
5963
5982
|
defaultVariants: {
|
|
@@ -6157,7 +6176,7 @@ function SidebarMenuSubButton(_a) {
|
|
|
6157
6176
|
"data-active": isActive,
|
|
6158
6177
|
className: cn(
|
|
6159
6178
|
"flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-sm px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden hover:bg-secondary-hover hover:text-primary focus-visible:ring-2 active:bg-secondary-hover active:text-primary disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 data-[active=true]:[&>svg]:text-primary",
|
|
6160
|
-
"data-[active=true]:bg-
|
|
6179
|
+
"data-[active=true]:bg-primary/10 data-[active=true]:text-primary",
|
|
6161
6180
|
size === "sm" && "text-xs",
|
|
6162
6181
|
size === "md" && "text-sm",
|
|
6163
6182
|
"group-data-[collapsible=icon]:hidden",
|
|
@@ -6454,7 +6473,7 @@ function Switch(_a) {
|
|
|
6454
6473
|
"data-slot": "switch",
|
|
6455
6474
|
"data-size": size,
|
|
6456
6475
|
className: cn(
|
|
6457
|
-
"peer group/switch inline-flex shrink-0 items-center rounded-
|
|
6476
|
+
"peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent p-[3px] shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-6 data-[size=default]:w-11 data-[size=sm]:h-5 data-[size=sm]:w-9 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
|
|
6458
6477
|
className
|
|
6459
6478
|
)
|
|
6460
6479
|
}, props), {
|
|
@@ -6463,7 +6482,7 @@ function Switch(_a) {
|
|
|
6463
6482
|
{
|
|
6464
6483
|
"data-slot": "switch-thumb",
|
|
6465
6484
|
className: cn(
|
|
6466
|
-
"pointer-events-none block rounded-
|
|
6485
|
+
"pointer-events-none block rounded-full bg-prominent ring-0 transition-transform group-data-[size=default]/switch:size-[18px] group-data-[size=sm]/switch:size-[14px] data-[state=checked]:translate-x-[calc(100%+1px)] data-[state=unchecked]:translate-x-0"
|
|
6467
6486
|
)
|
|
6468
6487
|
}
|
|
6469
6488
|
)
|