@trading-game/design-intelligence-layer 1.0.6 → 1.1.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/dist/index.d.cts CHANGED
@@ -123,7 +123,7 @@ declare function AvatarGroupCount({ className, ...props }: React$1.ComponentProp
123
123
 
124
124
  declare const badgeVariants: (props?: ({
125
125
  variant?: "solid" | "solid-demo" | "solid-neutral" | "solid-success" | "solid-fail" | "solid-warning" | "tint" | "tint-demo" | "tint-neutral" | "tint-success" | "tint-fail" | "tint-warning" | null | undefined;
126
- size?: "lg" | "md" | "sm" | "xs" | null | undefined;
126
+ size?: "lg" | "md" | "sm" | "xs" | "count" | null | undefined;
127
127
  } & class_variance_authority_types.ClassProp) | undefined) => string;
128
128
  declare function Badge({ className, variant, size, asChild, ...props }: React$1.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
129
129
  asChild?: boolean;
@@ -465,7 +465,7 @@ declare function ItemGroup({ className, divider, ...props }: React$1.ComponentPr
465
465
  /**
466
466
  * Auto-divide consecutive default-variant `Item`s with a bottom border
467
467
  * (`border-default-default`). The last item's bottom border is suppressed,
468
- * and non-default variants (`outline`, `muted`) are left untouched so
468
+ * and non-default variants (`outline`, `fill`, `muted`) are left untouched so
469
469
  * they don't double up with their own borders. Defaults to `true`; pass
470
470
  * `false` to opt out when the design wants flush items or uses
471
471
  * `<ItemSeparator />` manually.
@@ -474,7 +474,7 @@ declare function ItemGroup({ className, divider, ...props }: React$1.ComponentPr
474
474
  }): react_jsx_runtime.JSX.Element;
475
475
  declare function ItemSeparator({ className, ...props }: React$1.ComponentProps<typeof Separator>): react_jsx_runtime.JSX.Element;
476
476
  declare const itemVariants: (props?: ({
477
- variant?: "default" | "outline" | "muted" | null | undefined;
477
+ variant?: "fill" | "default" | "outline" | "muted" | null | undefined;
478
478
  size?: "sm" | "default" | null | undefined;
479
479
  } & class_variance_authority_types.ClassProp) | undefined) => string;
480
480
  declare function Item({ className, variant, size, asChild, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof itemVariants> & {
@@ -825,7 +825,7 @@ interface SlideToConfirmProps extends Omit<React$1.ComponentProps<"div">, "onDra
825
825
  declare function SlideToConfirm({ onConfirm, label, confirmedLabel, disabled, confirmed: controlledConfirmed, className, ...props }: SlideToConfirmProps): react_jsx_runtime.JSX.Element;
826
826
 
827
827
  interface StepperProps {
828
- /** Uppercase label above the amount, e.g. "Stake (USDT)". */
828
+ /** Sentence-case caption above the amount, e.g. "Stake (USDT)". */
829
829
  label?: React$1.ReactNode;
830
830
  value?: number;
831
831
  defaultValue?: number;
package/dist/index.d.ts CHANGED
@@ -123,7 +123,7 @@ declare function AvatarGroupCount({ className, ...props }: React$1.ComponentProp
123
123
 
124
124
  declare const badgeVariants: (props?: ({
125
125
  variant?: "solid" | "solid-demo" | "solid-neutral" | "solid-success" | "solid-fail" | "solid-warning" | "tint" | "tint-demo" | "tint-neutral" | "tint-success" | "tint-fail" | "tint-warning" | null | undefined;
126
- size?: "lg" | "md" | "sm" | "xs" | null | undefined;
126
+ size?: "lg" | "md" | "sm" | "xs" | "count" | null | undefined;
127
127
  } & class_variance_authority_types.ClassProp) | undefined) => string;
128
128
  declare function Badge({ className, variant, size, asChild, ...props }: React$1.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
129
129
  asChild?: boolean;
@@ -465,7 +465,7 @@ declare function ItemGroup({ className, divider, ...props }: React$1.ComponentPr
465
465
  /**
466
466
  * Auto-divide consecutive default-variant `Item`s with a bottom border
467
467
  * (`border-default-default`). The last item's bottom border is suppressed,
468
- * and non-default variants (`outline`, `muted`) are left untouched so
468
+ * and non-default variants (`outline`, `fill`, `muted`) are left untouched so
469
469
  * they don't double up with their own borders. Defaults to `true`; pass
470
470
  * `false` to opt out when the design wants flush items or uses
471
471
  * `<ItemSeparator />` manually.
@@ -474,7 +474,7 @@ declare function ItemGroup({ className, divider, ...props }: React$1.ComponentPr
474
474
  }): react_jsx_runtime.JSX.Element;
475
475
  declare function ItemSeparator({ className, ...props }: React$1.ComponentProps<typeof Separator>): react_jsx_runtime.JSX.Element;
476
476
  declare const itemVariants: (props?: ({
477
- variant?: "default" | "outline" | "muted" | null | undefined;
477
+ variant?: "fill" | "default" | "outline" | "muted" | null | undefined;
478
478
  size?: "sm" | "default" | null | undefined;
479
479
  } & class_variance_authority_types.ClassProp) | undefined) => string;
480
480
  declare function Item({ className, variant, size, asChild, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof itemVariants> & {
@@ -825,7 +825,7 @@ interface SlideToConfirmProps extends Omit<React$1.ComponentProps<"div">, "onDra
825
825
  declare function SlideToConfirm({ onConfirm, label, confirmedLabel, disabled, confirmed: controlledConfirmed, className, ...props }: SlideToConfirmProps): react_jsx_runtime.JSX.Element;
826
826
 
827
827
  interface StepperProps {
828
- /** Uppercase label above the amount, e.g. "Stake (USDT)". */
828
+ /** Sentence-case caption above the amount, e.g. "Stake (USDT)". */
829
829
  label?: React$1.ReactNode;
830
830
  value?: number;
831
831
  defaultValue?: number;
package/dist/index.js CHANGED
@@ -935,9 +935,11 @@ var badgeVariants = cva4(
935
935
  "solid-fail": "bg-background-error-solid text-text-on-status-static",
936
936
  "solid-warning": "bg-background-warning-solid text-text-on-status-static",
937
937
  // Tint — the Section Message surface tokens, coloured foreground.
938
- // Brand tint = the static brand-container recipe (layered value,
939
- // so it paints via `background`, not a bg-* utility).
940
- tint: "[background:var(--background-brand-container)] border-transparent text-text-brand-container-static",
938
+ // Brand tint rides `brand-selected`, the theme-aware selection
939
+ // family, for the same reason Calendar's range band does: the
940
+ // static `brand-container` is one value in both themes and sits
941
+ // near-white on a dark surface.
942
+ tint: "bg-background-brand-selected border-transparent text-text-brand-selected",
941
943
  "tint-demo": "bg-background-demo-default border-transparent text-text-demo-default",
942
944
  "tint-neutral": "bg-background-secondary-surface border-transparent text-text-prominent-default",
943
945
  "tint-success": "bg-background-success-default border-transparent text-text-success-default",
@@ -948,7 +950,18 @@ var badgeVariants = cva4(
948
950
  xs: "type-badge-xs h-5 px-2 py-0.5",
949
951
  sm: "type-badge-sm h-6 px-2.5 py-0.5",
950
952
  md: "type-badge-md h-8 px-3 py-1",
951
- lg: "type-badge-lg h-10 px-4 py-1.5"
953
+ lg: "type-badge-lg h-10 px-4 py-1.5",
954
+ /* `count` is a shape, not a step on the xs/sm/md/lg rail: an
955
+ 18px disc that grows into a pill as digits are added. The
956
+ padding is deliberately tight (`px-1`): one digit then
957
+ measures under the 18px min-width, so min-width wins and the
958
+ disc is a true circle. Widen the padding and a single digit
959
+ overshoots 18px, turning it back into an oval. `tabular-nums` keeps every digit
960
+ the same width, so a ticking count only resizes when the
961
+ digit count changes, not on every update. Callers that pin
962
+ it over other chrome add their own knockout ring — Badge
963
+ cannot know what sits behind it. */
964
+ count: "type-badge-xs min-w-[1.125rem] h-[1.125rem] px-1 tabular-nums"
952
965
  }
953
966
  },
954
967
  defaultVariants: {
@@ -4281,12 +4294,21 @@ function ItemSeparator(_a) {
4281
4294
  );
4282
4295
  }
4283
4296
  var itemVariants = cva10(
4284
- "group/item type-item-description flex flex-wrap items-center rounded-md border border-transparent transition-colors duration-instant outline-none focus-visible:border-ring-focus-default focus-visible:ring-[3px] focus-visible:ring-ring-focus-strong [a]:transition-colors [a]:hover:bg-background-hover-default",
4297
+ "group/item type-item-description flex flex-wrap items-center rounded-2xl border border-transparent transition-colors duration-instant outline-none focus-visible:border-ring-focus-default focus-visible:ring-[3px] focus-visible:ring-ring-focus-strong [a]:transition-colors [a]:hover:bg-background-hover-default",
4285
4298
  {
4286
4299
  variants: {
4287
4300
  variant: {
4288
4301
  default: "bg-transparent",
4289
4302
  outline: "border-border-default-default text-text-prominent-default hover:bg-background-hover-default",
4303
+ /* `fill` is `outline` plus a solid surface: a bordered card that reads
4304
+ as its own plane on the page canvas, the wallet-ledger pattern.
4305
+ Its hover steps primary -> secondary surface like the default Chip,
4306
+ because the shared `background-hover-default` glaze is translucent —
4307
+ laid over a filled row it would let the canvas show through instead
4308
+ of darkening the fill. The `[a]:` rule repeats for the same reason:
4309
+ the base link hover is that same glaze and outranks a plain
4310
+ `hover:` on an anchor. */
4311
+ fill: "bg-background-primary-surface border-border-default-default text-text-prominent-default hover:bg-background-secondary-surface [a]:hover:bg-background-secondary-surface",
4290
4312
  muted: "bg-background-secondary-surface"
4291
4313
  },
4292
4314
  size: {
@@ -7033,11 +7055,18 @@ function Stepper({
7033
7055
  }
7034
7056
  }, [currentValue, decimalPlaces, isFocused]);
7035
7057
  function commit(next) {
7036
- const clamped = clamp(next, min, max);
7037
- const rounded = decimalPlaces > 0 ? parseFloat(clamped.toFixed(decimalPlaces)) : Math.round(clamped);
7038
- if (!isControlled) setInternalValue(rounded);
7039
- setDisplayString(formatValue(rounded, decimalPlaces));
7040
- onValueChange == null ? void 0 : onValueChange(rounded);
7058
+ let committed;
7059
+ if (next <= min) {
7060
+ committed = min;
7061
+ } else if (next >= max) {
7062
+ committed = max;
7063
+ } else {
7064
+ const rounded = decimalPlaces > 0 ? parseFloat(next.toFixed(decimalPlaces)) : Math.round(next);
7065
+ committed = clamp(rounded, min, max);
7066
+ }
7067
+ if (!isControlled) setInternalValue(committed);
7068
+ setDisplayString(formatValue(committed, decimalPlaces));
7069
+ onValueChange == null ? void 0 : onValueChange(committed);
7041
7070
  }
7042
7071
  function handleDecrement() {
7043
7072
  commit(currentValue - step);
@@ -7844,10 +7873,11 @@ function HistoryButton({
7844
7873
  return /* @__PURE__ */ jsxs34("div", { className: "relative inline-flex", children: [
7845
7874
  /* @__PURE__ */ jsx61(NavigationButton, { type: "button", size: "md", "aria-label": ariaLabel, onClick, children: /* @__PURE__ */ jsx61(History, { className: "size-5" }) }),
7846
7875
  show && /* @__PURE__ */ jsx61(
7847
- "span",
7876
+ Badge,
7848
7877
  {
7849
7878
  "aria-hidden": true,
7850
- className: "pointer-events-none absolute -top-0.5 -right-0.5 min-w-[1.125rem] h-[1.125rem] px-1 rounded-full bg-primary text-on-primary text-[10px] leading-none font-semibold tabular-nums inline-flex items-center justify-center ring-2 ring-prominent",
7879
+ size: "count",
7880
+ className: "pointer-events-none absolute -top-0.5 -right-0.5 ring-2 ring-background-primary-canvas",
7851
7881
  children: label
7852
7882
  }
7853
7883
  )