@trading-game/design-intelligence-layer 0.16.8 → 0.17.0
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 -2
- package/dist/index.cjs +32 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +32 -19
- package/dist/index.js.map +1 -1
- package/guides/design-system-guide/trading-game-ds-guide.md +3 -3
- 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: {
|
|
@@ -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,11 @@ function Banner(_a) {
|
|
|
931
933
|
"data-layout": "inline",
|
|
932
934
|
"data-clickable": isClickable ? "true" : void 0,
|
|
933
935
|
className: cn(
|
|
934
|
-
"grid
|
|
936
|
+
"grid items-center gap-x-4",
|
|
937
|
+
gridCols,
|
|
935
938
|
rowTemplate,
|
|
936
939
|
SURFACE_CLASSES,
|
|
940
|
+
hasDescription && "relative pr-12",
|
|
937
941
|
clickableClasses,
|
|
938
942
|
className
|
|
939
943
|
)
|
|
@@ -941,7 +945,7 @@ function Banner(_a) {
|
|
|
941
945
|
children: [
|
|
942
946
|
/* @__PURE__ */ jsx9("div", { className: "col-start-1 row-start-1", children: iconColumn }),
|
|
943
947
|
/* @__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 }),
|
|
948
|
+
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
949
|
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
950
|
]
|
|
947
951
|
})
|
|
@@ -954,7 +958,7 @@ function Banner(_a) {
|
|
|
954
958
|
"data-layout": "card",
|
|
955
959
|
"data-clickable": isClickable ? "true" : void 0,
|
|
956
960
|
className: cn(
|
|
957
|
-
"grid grid-cols-[
|
|
961
|
+
"relative grid grid-cols-[auto_1fr] grid-rows-[auto_auto] items-center gap-x-4 gap-y-3 pr-12",
|
|
958
962
|
SURFACE_CLASSES,
|
|
959
963
|
clickableClasses,
|
|
960
964
|
className
|
|
@@ -963,8 +967,8 @@ function Banner(_a) {
|
|
|
963
967
|
children: [
|
|
964
968
|
/* @__PURE__ */ jsx9("div", { className: "col-start-1 row-start-1", children: iconColumn }),
|
|
965
969
|
/* @__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-
|
|
970
|
+
/* @__PURE__ */ jsx9("div", { className: "absolute top-3 right-3", children: closeButton }),
|
|
971
|
+
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
972
|
]
|
|
969
973
|
})
|
|
970
974
|
);
|
|
@@ -1594,7 +1598,7 @@ function Chip(_a) {
|
|
|
1594
1598
|
disabled,
|
|
1595
1599
|
className: cn(
|
|
1596
1600
|
chipVariants({ size }),
|
|
1597
|
-
selected ? "border-[1.5px] border-primary bg-primary/10 text-primary font-semibold pointer-events-none cursor-default" : "border border-border-subtle bg-transparent text-on-prominent hover:bg-secondary-hover active:bg-secondary-hover/80",
|
|
1601
|
+
selected ? "border-[1.5px] border-primary bg-primary/10 text-primary font-semibold pointer-events-none cursor-default" : "border border-border-subtle bg-transparent text-on-prominent transition-colors hover:bg-secondary-hover active:bg-secondary-hover/80",
|
|
1598
1602
|
className
|
|
1599
1603
|
)
|
|
1600
1604
|
}, props), {
|
|
@@ -4166,7 +4170,7 @@ import { cva as cva10 } from "class-variance-authority";
|
|
|
4166
4170
|
import { Slot as Slot6 } from "radix-ui";
|
|
4167
4171
|
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
4168
4172
|
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
|
|
4173
|
+
"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
4174
|
{
|
|
4171
4175
|
variants: {
|
|
4172
4176
|
size: {
|
|
@@ -5506,8 +5510,8 @@ function TooltipContent(_a) {
|
|
|
5506
5510
|
/* @__PURE__ */ jsx51(DrawerFooter, { children: /* @__PURE__ */ jsx51(DrawerClose, { asChild: true, children: /* @__PURE__ */ jsx51(Button, { variant: "primary", size: "md", children: closeLabel }) }) })
|
|
5507
5511
|
] });
|
|
5508
5512
|
}
|
|
5509
|
-
const surfaceClasses = variant === "inverse" ? "bg-prominent text-on-prominent shadow-sm" : "bg-
|
|
5510
|
-
const arrowClasses = variant === "inverse" ? "fill-prominent" : "fill-
|
|
5513
|
+
const surfaceClasses = variant === "inverse" ? "bg-prominent text-on-prominent shadow-sm" : "bg-prominent-inverse text-on-prominent-inverse";
|
|
5514
|
+
const arrowClasses = variant === "inverse" ? "fill-prominent" : "fill-prominent-inverse";
|
|
5511
5515
|
return /* @__PURE__ */ jsx51(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs25(
|
|
5512
5516
|
TooltipPrimitive.Content,
|
|
5513
5517
|
__spreadProps(__spreadValues({
|
|
@@ -5515,7 +5519,7 @@ function TooltipContent(_a) {
|
|
|
5515
5519
|
"data-variant": variant,
|
|
5516
5520
|
sideOffset,
|
|
5517
5521
|
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",
|
|
5522
|
+
"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
5523
|
surfaceClasses,
|
|
5520
5524
|
className
|
|
5521
5525
|
)
|
|
@@ -5808,7 +5812,10 @@ function SidebarHeader(_a) {
|
|
|
5808
5812
|
__spreadValues({
|
|
5809
5813
|
"data-slot": "sidebar-header",
|
|
5810
5814
|
"data-sidebar": "header",
|
|
5811
|
-
className: cn(
|
|
5815
|
+
className: cn(
|
|
5816
|
+
"flex flex-col gap-2 px-layout-margin-inline py-2 group-data-[collapsible=icon]:px-2",
|
|
5817
|
+
className
|
|
5818
|
+
)
|
|
5812
5819
|
}, props)
|
|
5813
5820
|
);
|
|
5814
5821
|
}
|
|
@@ -5819,7 +5826,10 @@ function SidebarFooter(_a) {
|
|
|
5819
5826
|
__spreadValues({
|
|
5820
5827
|
"data-slot": "sidebar-footer",
|
|
5821
5828
|
"data-sidebar": "footer",
|
|
5822
|
-
className: cn(
|
|
5829
|
+
className: cn(
|
|
5830
|
+
"flex flex-col gap-2 px-layout-margin-inline py-2 group-data-[collapsible=icon]:px-2",
|
|
5831
|
+
className
|
|
5832
|
+
)
|
|
5823
5833
|
}, props)
|
|
5824
5834
|
);
|
|
5825
5835
|
}
|
|
@@ -5859,7 +5869,10 @@ function SidebarGroup(_a) {
|
|
|
5859
5869
|
__spreadValues({
|
|
5860
5870
|
"data-slot": "sidebar-group",
|
|
5861
5871
|
"data-sidebar": "group",
|
|
5862
|
-
className: cn(
|
|
5872
|
+
className: cn(
|
|
5873
|
+
"relative flex w-full min-w-0 flex-col px-layout-margin-inline py-2 group-data-[collapsible=icon]:px-2",
|
|
5874
|
+
className
|
|
5875
|
+
)
|
|
5863
5876
|
}, props)
|
|
5864
5877
|
);
|
|
5865
5878
|
}
|
|
@@ -5947,7 +5960,7 @@ function SidebarMenuItem(_a) {
|
|
|
5947
5960
|
);
|
|
5948
5961
|
}
|
|
5949
5962
|
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-
|
|
5963
|
+
"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
5964
|
{
|
|
5952
5965
|
variants: {
|
|
5953
5966
|
variant: {
|
|
@@ -5957,7 +5970,7 @@ var sidebarMenuButtonVariants = cva13(
|
|
|
5957
5970
|
size: {
|
|
5958
5971
|
default: "h-8 text-sm",
|
|
5959
5972
|
sm: "h-7 text-xs",
|
|
5960
|
-
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
|
|
5973
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0! group-data-[collapsible=icon]:justify-center"
|
|
5961
5974
|
}
|
|
5962
5975
|
},
|
|
5963
5976
|
defaultVariants: {
|
|
@@ -6157,7 +6170,7 @@ function SidebarMenuSubButton(_a) {
|
|
|
6157
6170
|
"data-active": isActive,
|
|
6158
6171
|
className: cn(
|
|
6159
6172
|
"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-
|
|
6173
|
+
"data-[active=true]:bg-primary/10 data-[active=true]:text-primary",
|
|
6161
6174
|
size === "sm" && "text-xs",
|
|
6162
6175
|
size === "md" && "text-sm",
|
|
6163
6176
|
"group-data-[collapsible=icon]:hidden",
|
|
@@ -6454,7 +6467,7 @@ function Switch(_a) {
|
|
|
6454
6467
|
"data-slot": "switch",
|
|
6455
6468
|
"data-size": size,
|
|
6456
6469
|
className: cn(
|
|
6457
|
-
"peer group/switch inline-flex shrink-0 items-center rounded-
|
|
6470
|
+
"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
6471
|
className
|
|
6459
6472
|
)
|
|
6460
6473
|
}, props), {
|
|
@@ -6463,7 +6476,7 @@ function Switch(_a) {
|
|
|
6463
6476
|
{
|
|
6464
6477
|
"data-slot": "switch-thumb",
|
|
6465
6478
|
className: cn(
|
|
6466
|
-
"pointer-events-none block rounded-
|
|
6479
|
+
"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
6480
|
)
|
|
6468
6481
|
}
|
|
6469
6482
|
)
|