kaleido-ui 0.1.12 → 0.1.13

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.
@@ -4137,28 +4137,34 @@ function RouteChoiceCard({
4137
4137
  recommended,
4138
4138
  onClick
4139
4139
  }) {
4140
+ const { disabled = false, disabledReason } = route;
4140
4141
  return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
4141
4142
  "button",
4142
4143
  {
4143
4144
  type: "button",
4144
4145
  "data-testid": `withdraw-route-${route.account.toLowerCase()}`,
4145
4146
  onClick,
4147
+ disabled,
4148
+ "aria-disabled": disabled,
4149
+ title: disabled ? disabledReason : void 0,
4146
4150
  className: cn(
4147
4151
  "w-full rounded-2xl border p-4 text-left transition-all",
4148
- selected ? "border-primary/30 bg-primary/10" : "border-border bg-white/4 hover:border-white/20 hover:bg-white/6"
4152
+ disabled ? "cursor-not-allowed border-danger/15 bg-danger/5 opacity-60" : selected ? "border-primary/30 bg-primary/10" : "border-border bg-white/4 hover:border-white/20 hover:bg-white/6"
4149
4153
  ),
4150
4154
  children: [
4151
4155
  /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
4152
4156
  /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { children: [
4153
4157
  /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "flex items-center gap-2", children: [
4154
4158
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "text-sm font-bold text-white", children: route.accountTitle }),
4155
- recommended && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "rounded-full border border-primary/20 bg-primary/10 px-2 py-0.5 text-xxs font-bold uppercase tracking-wider text-primary", children: "Recommended" })
4159
+ recommended && !disabled && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "rounded-full border border-primary/20 bg-primary/10 px-2 py-0.5 text-xxs font-bold uppercase tracking-wider text-primary", children: "Recommended" }),
4160
+ disabled && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "rounded-full border border-danger/20 bg-danger/10 px-2 py-0.5 text-xxs font-bold uppercase tracking-wider text-danger", children: "Insufficient" })
4156
4161
  ] }),
4157
4162
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "mt-1 text-xs text-white/45", children: route.methodLabel })
4158
4163
  ] }),
4159
4164
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "text-xxs font-bold uppercase tracking-wider text-white/35", children: route.feeHint })
4160
4165
  ] }),
4161
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "mt-3 text-xs leading-relaxed text-muted-foreground", children: route.summary })
4166
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "mt-3 text-xs leading-relaxed text-muted-foreground", children: route.summary }),
4167
+ disabled && disabledReason && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "mt-2 text-xxs leading-relaxed text-danger/80", children: disabledReason })
4162
4168
  ]
4163
4169
  }
4164
4170
  );
@@ -804,6 +804,10 @@ interface WithdrawRouteOption<TAccount extends string = string> {
804
804
  accountTitle: string;
805
805
  methodLabel: string;
806
806
  feeHint: string;
807
+ /** When true, the route is unavailable (e.g. insufficient liquidity) and not clickable. */
808
+ disabled?: boolean;
809
+ /** Short reason shown under the disabled card. Pair with `disabled`. */
810
+ disabledReason?: string;
807
811
  }
808
812
  interface WithdrawRouteSummary {
809
813
  method: string;
@@ -804,6 +804,10 @@ interface WithdrawRouteOption<TAccount extends string = string> {
804
804
  accountTitle: string;
805
805
  methodLabel: string;
806
806
  feeHint: string;
807
+ /** When true, the route is unavailable (e.g. insufficient liquidity) and not clickable. */
808
+ disabled?: boolean;
809
+ /** Short reason shown under the disabled card. Pair with `disabled`. */
810
+ disabledReason?: string;
807
811
  }
808
812
  interface WithdrawRouteSummary {
809
813
  method: string;
package/dist/web/index.js CHANGED
@@ -3982,28 +3982,34 @@ function RouteChoiceCard({
3982
3982
  recommended,
3983
3983
  onClick
3984
3984
  }) {
3985
+ const { disabled = false, disabledReason } = route;
3985
3986
  return /* @__PURE__ */ jsxs33(
3986
3987
  "button",
3987
3988
  {
3988
3989
  type: "button",
3989
3990
  "data-testid": `withdraw-route-${route.account.toLowerCase()}`,
3990
3991
  onClick,
3992
+ disabled,
3993
+ "aria-disabled": disabled,
3994
+ title: disabled ? disabledReason : void 0,
3991
3995
  className: cn(
3992
3996
  "w-full rounded-2xl border p-4 text-left transition-all",
3993
- selected ? "border-primary/30 bg-primary/10" : "border-border bg-white/4 hover:border-white/20 hover:bg-white/6"
3997
+ disabled ? "cursor-not-allowed border-danger/15 bg-danger/5 opacity-60" : selected ? "border-primary/30 bg-primary/10" : "border-border bg-white/4 hover:border-white/20 hover:bg-white/6"
3994
3998
  ),
3995
3999
  children: [
3996
4000
  /* @__PURE__ */ jsxs33("div", { className: "flex items-start justify-between gap-3", children: [
3997
4001
  /* @__PURE__ */ jsxs33("div", { children: [
3998
4002
  /* @__PURE__ */ jsxs33("div", { className: "flex items-center gap-2", children: [
3999
4003
  /* @__PURE__ */ jsx45("span", { className: "text-sm font-bold text-white", children: route.accountTitle }),
4000
- recommended && /* @__PURE__ */ jsx45("span", { className: "rounded-full border border-primary/20 bg-primary/10 px-2 py-0.5 text-xxs font-bold uppercase tracking-wider text-primary", children: "Recommended" })
4004
+ recommended && !disabled && /* @__PURE__ */ jsx45("span", { className: "rounded-full border border-primary/20 bg-primary/10 px-2 py-0.5 text-xxs font-bold uppercase tracking-wider text-primary", children: "Recommended" }),
4005
+ disabled && /* @__PURE__ */ jsx45("span", { className: "rounded-full border border-danger/20 bg-danger/10 px-2 py-0.5 text-xxs font-bold uppercase tracking-wider text-danger", children: "Insufficient" })
4001
4006
  ] }),
4002
4007
  /* @__PURE__ */ jsx45("p", { className: "mt-1 text-xs text-white/45", children: route.methodLabel })
4003
4008
  ] }),
4004
4009
  /* @__PURE__ */ jsx45("span", { className: "text-xxs font-bold uppercase tracking-wider text-white/35", children: route.feeHint })
4005
4010
  ] }),
4006
- /* @__PURE__ */ jsx45("p", { className: "mt-3 text-xs leading-relaxed text-muted-foreground", children: route.summary })
4011
+ /* @__PURE__ */ jsx45("p", { className: "mt-3 text-xs leading-relaxed text-muted-foreground", children: route.summary }),
4012
+ disabled && disabledReason && /* @__PURE__ */ jsx45("p", { className: "mt-2 text-xxs leading-relaxed text-danger/80", children: disabledReason })
4007
4013
  ]
4008
4014
  }
4009
4015
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kaleido-ui",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "KaleidoSwap shared UI library — design tokens, web components (Tailwind + Radix), and React Native components extending WDK UI Kit",
5
5
  "license": "MIT",
6
6
  "type": "module",