kaleido-ui 0.1.14 → 0.1.16

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.
@@ -5207,7 +5207,9 @@ function DepositGeneratedView({
5207
5207
  setAddress,
5208
5208
  setRecipientId,
5209
5209
  setAmount,
5210
- setInvoiceStatus
5210
+ setInvoiceStatus,
5211
+ showQrNetworkBadge = true,
5212
+ onRegenerate
5211
5213
  }) {
5212
5214
  return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-3 animate-in fade-in zoom-in-95 duration-300", children: [
5213
5215
  (network === "lightning" || network === "arkade" && arkSubMode === "ark") && isBtc && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex flex-col gap-1.5 rounded-xl border border-white/8 bg-white/3 p-2.5", children: [
@@ -5264,7 +5266,7 @@ function DepositGeneratedView({
5264
5266
  ),
5265
5267
  style: net.qrGlow,
5266
5268
  children: [
5267
- network !== "spark" && network !== "arkade" && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
5269
+ showQrNetworkBadge && network !== "spark" && network !== "arkade" && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
5268
5270
  "div",
5269
5271
  {
5270
5272
  className: cn(
@@ -5279,7 +5281,10 @@ function DepositGeneratedView({
5279
5281
  }
5280
5282
  ),
5281
5283
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(QrCode, { value: address, size: 188 }),
5282
- isInvoicePaid && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PaidOverlay, {})
5284
+ isInvoicePaid && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PaidOverlay, {}),
5285
+ loading && !isInvoicePaid && // Loading scrim — sits over the QR while a fresh address/invoice
5286
+ // is being fetched (e.g. after the New Address button).
5287
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "absolute inset-0 flex items-center justify-center rounded-2xl bg-white/80 backdrop-blur-sm", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "material-symbols-outlined animate-spin text-icon-3xl text-network-bitcoin", children: "progress_activity" }) })
5283
5288
  ]
5284
5289
  }
5285
5290
  ),
@@ -5352,22 +5357,31 @@ function DepositGeneratedView({
5352
5357
  ]
5353
5358
  }
5354
5359
  ),
5355
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "flex justify-center pt-1", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
5360
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "flex justify-center pt-1", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
5356
5361
  "button",
5357
5362
  {
5358
5363
  type: "button",
5364
+ "aria-label": `New ${network === "lightning" ? "invoice" : "address"}`,
5365
+ title: `New ${network === "lightning" ? "invoice" : "address"}`,
5366
+ disabled: loading,
5359
5367
  onClick: () => {
5368
+ if (onRegenerate) {
5369
+ void onRegenerate();
5370
+ return;
5371
+ }
5360
5372
  setAddress("");
5361
5373
  setRecipientId("");
5362
5374
  setAmount("");
5363
5375
  setInvoiceStatus(null);
5364
5376
  },
5365
- className: "flex items-center justify-center gap-1.5 rounded-xl bg-primary/15 px-5 py-3 text-xs font-bold text-primary transition-all hover:bg-primary/25 active:scale-[0.98]",
5366
- children: [
5367
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "material-symbols-outlined text-icon-sm", children: "refresh" }),
5368
- "New ",
5369
- network === "lightning" ? "Invoice" : "Address"
5370
- ]
5377
+ className: "flex size-10 items-center justify-center rounded-full bg-primary/15 text-primary transition-all hover:bg-primary/25 active:scale-[0.98] disabled:opacity-50",
5378
+ children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
5379
+ "span",
5380
+ {
5381
+ className: cn("material-symbols-outlined text-icon-md", loading && "animate-spin"),
5382
+ children: "refresh"
5383
+ }
5384
+ )
5371
5385
  }
5372
5386
  ) })
5373
5387
  ] });
@@ -5410,11 +5424,12 @@ function DepositPreGeneration({
5410
5424
  getUnitLabel,
5411
5425
  generateInvoice,
5412
5426
  needsColorableUtxos = false,
5413
- onOpenCreateUtxos
5427
+ onOpenCreateUtxos,
5428
+ showReceiveSummary = true
5414
5429
  }) {
5415
5430
  const method = METHOD_META2[currentMethod];
5416
5431
  return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "space-y-3", children: [
5417
- /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "rounded-2xl border border-white/8 bg-white/4 p-3", children: [
5432
+ showReceiveSummary && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "rounded-2xl border border-white/8 bg-white/4 p-3", children: [
5418
5433
  /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "text-xxs font-bold uppercase tracking-widest text-white/35", children: "Receive Summary" }),
5419
5434
  /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "mt-2 grid grid-cols-1 gap-2 text-xs", children: [
5420
5435
  /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex items-center justify-between gap-3", children: [
@@ -6008,6 +6023,7 @@ function DepositInvoiceGeneration({
6008
6023
  const addressLabel = network === "spark" ? "Spark Address" : network === "arkade" ? arkSubMode === "boarding" ? "Boarding Address" : "Arkade Address" : network === "lightning" ? "Lightning Invoice" : "Deposit Address";
6009
6024
  const showChannelWarning = selectedAccount === "RGB" && network === "lightning" && !channelsLoading && channels.length === 0 && !isSparkConnected;
6010
6025
  const showLiquidityWarning = !isSparkLightning && network === "lightning" && maxDepositAmount === 0 && !channelsLoading && !isBtc;
6026
+ const isNewRgbAsset = isNewAsset && assetFamily === "RGB";
6011
6027
  return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "flex h-screen flex-col overflow-hidden bg-background font-display text-foreground", children: [
6012
6028
  /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
6013
6029
  PageHeader,
@@ -6137,7 +6153,8 @@ function DepositInvoiceGeneration({
6137
6153
  getUnitLabel,
6138
6154
  generateInvoice,
6139
6155
  needsColorableUtxos,
6140
- onOpenCreateUtxos
6156
+ onOpenCreateUtxos,
6157
+ showReceiveSummary: !isNewRgbAsset
6141
6158
  }
6142
6159
  ) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
6143
6160
  DepositGeneratedView,
@@ -6165,7 +6182,8 @@ function DepositInvoiceGeneration({
6165
6182
  setRecipientId,
6166
6183
  setAmount,
6167
6184
  setInvoiceStatus,
6168
- handleDone
6185
+ handleDone,
6186
+ showQrNetworkBadge: false
6169
6187
  }
6170
6188
  ) })
6171
6189
  ] });
@@ -1136,14 +1136,22 @@ interface DepositGeneratedViewProps {
1136
1136
  setRecipientId: (value: string) => void;
1137
1137
  setAmount: (value: string) => void;
1138
1138
  setInvoiceStatus: (value: string | null) => void;
1139
+ showQrNetworkBadge?: boolean;
1139
1140
  /**
1140
1141
  * @deprecated Done button removed in v0.1.8 per the v1.0.0 wallet redesign;
1141
1142
  * users navigate away via the standard back button. Prop kept for source
1142
1143
  * compatibility — it is no longer invoked.
1143
1144
  */
1144
1145
  handleDone?: () => void;
1146
+ /**
1147
+ * Optional regenerate callback. When provided, the "New Address" button
1148
+ * calls it directly (instead of just clearing local state via the
1149
+ * setters above). Required for flows whose auto-generation effect does
1150
+ * not refire on cleared state — e.g. RGB on-chain.
1151
+ */
1152
+ onRegenerate?: () => Promise<void> | void;
1145
1153
  }
1146
- declare function DepositGeneratedView({ network, net, isBtc, address, addressLabel, recipientId, arkSubMode, invoiceStatus, isInvoicePending, isInvoicePaid, isInvoiceFailedOrExpired, amount, handleAmountChange, loading, copied, copyToClipboard, getUnitLabel, selectedAsset, maxDepositAmount, setAddress, setRecipientId, setAmount, setInvoiceStatus, }: DepositGeneratedViewProps): react_jsx_runtime.JSX.Element;
1154
+ declare function DepositGeneratedView({ network, net, isBtc, address, addressLabel, recipientId, arkSubMode, invoiceStatus, isInvoicePending, isInvoicePaid, isInvoiceFailedOrExpired, amount, handleAmountChange, loading, copied, copyToClipboard, getUnitLabel, selectedAsset, maxDepositAmount, setAddress, setRecipientId, setAmount, setInvoiceStatus, showQrNetworkBadge, onRegenerate, }: DepositGeneratedViewProps): react_jsx_runtime.JSX.Element;
1147
1155
 
1148
1156
  interface DepositPreGenerationAsset {
1149
1157
  ticker?: string;
@@ -1174,8 +1182,9 @@ interface DepositPreGenerationProps {
1174
1182
  needsColorableUtxos?: boolean;
1175
1183
  /** Invoked by the inline "Create Colorable UTXOs" CTA. */
1176
1184
  onOpenCreateUtxos?: () => void;
1185
+ showReceiveSummary?: boolean;
1177
1186
  }
1178
- declare function DepositPreGeneration({ selectedAsset, isBtc, network, net, selectedAccount, currentMethod, channelsLoading, showChannelWarning, showLiquidityWarning, isAutoGenerate, loading, usePrivacy, setUsePrivacy, amount, handleAmountChange, getUnitLabel, generateInvoice, needsColorableUtxos, onOpenCreateUtxos, }: DepositPreGenerationProps): react_jsx_runtime.JSX.Element;
1187
+ declare function DepositPreGeneration({ selectedAsset, isBtc, network, net, selectedAccount, currentMethod, channelsLoading, showChannelWarning, showLiquidityWarning, isAutoGenerate, loading, usePrivacy, setUsePrivacy, amount, handleAmountChange, getUnitLabel, generateInvoice, needsColorableUtxos, onOpenCreateUtxos, showReceiveSummary, }: DepositPreGenerationProps): react_jsx_runtime.JSX.Element;
1179
1188
 
1180
1189
  interface DepositSelectionAsset {
1181
1190
  asset_id: string;
@@ -1136,14 +1136,22 @@ interface DepositGeneratedViewProps {
1136
1136
  setRecipientId: (value: string) => void;
1137
1137
  setAmount: (value: string) => void;
1138
1138
  setInvoiceStatus: (value: string | null) => void;
1139
+ showQrNetworkBadge?: boolean;
1139
1140
  /**
1140
1141
  * @deprecated Done button removed in v0.1.8 per the v1.0.0 wallet redesign;
1141
1142
  * users navigate away via the standard back button. Prop kept for source
1142
1143
  * compatibility — it is no longer invoked.
1143
1144
  */
1144
1145
  handleDone?: () => void;
1146
+ /**
1147
+ * Optional regenerate callback. When provided, the "New Address" button
1148
+ * calls it directly (instead of just clearing local state via the
1149
+ * setters above). Required for flows whose auto-generation effect does
1150
+ * not refire on cleared state — e.g. RGB on-chain.
1151
+ */
1152
+ onRegenerate?: () => Promise<void> | void;
1145
1153
  }
1146
- declare function DepositGeneratedView({ network, net, isBtc, address, addressLabel, recipientId, arkSubMode, invoiceStatus, isInvoicePending, isInvoicePaid, isInvoiceFailedOrExpired, amount, handleAmountChange, loading, copied, copyToClipboard, getUnitLabel, selectedAsset, maxDepositAmount, setAddress, setRecipientId, setAmount, setInvoiceStatus, }: DepositGeneratedViewProps): react_jsx_runtime.JSX.Element;
1154
+ declare function DepositGeneratedView({ network, net, isBtc, address, addressLabel, recipientId, arkSubMode, invoiceStatus, isInvoicePending, isInvoicePaid, isInvoiceFailedOrExpired, amount, handleAmountChange, loading, copied, copyToClipboard, getUnitLabel, selectedAsset, maxDepositAmount, setAddress, setRecipientId, setAmount, setInvoiceStatus, showQrNetworkBadge, onRegenerate, }: DepositGeneratedViewProps): react_jsx_runtime.JSX.Element;
1147
1155
 
1148
1156
  interface DepositPreGenerationAsset {
1149
1157
  ticker?: string;
@@ -1174,8 +1182,9 @@ interface DepositPreGenerationProps {
1174
1182
  needsColorableUtxos?: boolean;
1175
1183
  /** Invoked by the inline "Create Colorable UTXOs" CTA. */
1176
1184
  onOpenCreateUtxos?: () => void;
1185
+ showReceiveSummary?: boolean;
1177
1186
  }
1178
- declare function DepositPreGeneration({ selectedAsset, isBtc, network, net, selectedAccount, currentMethod, channelsLoading, showChannelWarning, showLiquidityWarning, isAutoGenerate, loading, usePrivacy, setUsePrivacy, amount, handleAmountChange, getUnitLabel, generateInvoice, needsColorableUtxos, onOpenCreateUtxos, }: DepositPreGenerationProps): react_jsx_runtime.JSX.Element;
1187
+ declare function DepositPreGeneration({ selectedAsset, isBtc, network, net, selectedAccount, currentMethod, channelsLoading, showChannelWarning, showLiquidityWarning, isAutoGenerate, loading, usePrivacy, setUsePrivacy, amount, handleAmountChange, getUnitLabel, generateInvoice, needsColorableUtxos, onOpenCreateUtxos, showReceiveSummary, }: DepositPreGenerationProps): react_jsx_runtime.JSX.Element;
1179
1188
 
1180
1189
  interface DepositSelectionAsset {
1181
1190
  asset_id: string;
package/dist/web/index.js CHANGED
@@ -5052,7 +5052,9 @@ function DepositGeneratedView({
5052
5052
  setAddress,
5053
5053
  setRecipientId,
5054
5054
  setAmount,
5055
- setInvoiceStatus
5055
+ setInvoiceStatus,
5056
+ showQrNetworkBadge = true,
5057
+ onRegenerate
5056
5058
  }) {
5057
5059
  return /* @__PURE__ */ jsxs43("div", { className: "space-y-3 animate-in fade-in zoom-in-95 duration-300", children: [
5058
5060
  (network === "lightning" || network === "arkade" && arkSubMode === "ark") && isBtc && /* @__PURE__ */ jsxs43("div", { className: "flex flex-col gap-1.5 rounded-xl border border-white/8 bg-white/3 p-2.5", children: [
@@ -5109,7 +5111,7 @@ function DepositGeneratedView({
5109
5111
  ),
5110
5112
  style: net.qrGlow,
5111
5113
  children: [
5112
- network !== "spark" && network !== "arkade" && /* @__PURE__ */ jsxs43(
5114
+ showQrNetworkBadge && network !== "spark" && network !== "arkade" && /* @__PURE__ */ jsxs43(
5113
5115
  "div",
5114
5116
  {
5115
5117
  className: cn(
@@ -5124,7 +5126,10 @@ function DepositGeneratedView({
5124
5126
  }
5125
5127
  ),
5126
5128
  /* @__PURE__ */ jsx56(QrCode, { value: address, size: 188 }),
5127
- isInvoicePaid && /* @__PURE__ */ jsx56(PaidOverlay, {})
5129
+ isInvoicePaid && /* @__PURE__ */ jsx56(PaidOverlay, {}),
5130
+ loading && !isInvoicePaid && // Loading scrim — sits over the QR while a fresh address/invoice
5131
+ // is being fetched (e.g. after the New Address button).
5132
+ /* @__PURE__ */ jsx56("div", { className: "absolute inset-0 flex items-center justify-center rounded-2xl bg-white/80 backdrop-blur-sm", children: /* @__PURE__ */ jsx56("span", { className: "material-symbols-outlined animate-spin text-icon-3xl text-network-bitcoin", children: "progress_activity" }) })
5128
5133
  ]
5129
5134
  }
5130
5135
  ),
@@ -5197,22 +5202,31 @@ function DepositGeneratedView({
5197
5202
  ]
5198
5203
  }
5199
5204
  ),
5200
- /* @__PURE__ */ jsx56("div", { className: "flex justify-center pt-1", children: /* @__PURE__ */ jsxs43(
5205
+ /* @__PURE__ */ jsx56("div", { className: "flex justify-center pt-1", children: /* @__PURE__ */ jsx56(
5201
5206
  "button",
5202
5207
  {
5203
5208
  type: "button",
5209
+ "aria-label": `New ${network === "lightning" ? "invoice" : "address"}`,
5210
+ title: `New ${network === "lightning" ? "invoice" : "address"}`,
5211
+ disabled: loading,
5204
5212
  onClick: () => {
5213
+ if (onRegenerate) {
5214
+ void onRegenerate();
5215
+ return;
5216
+ }
5205
5217
  setAddress("");
5206
5218
  setRecipientId("");
5207
5219
  setAmount("");
5208
5220
  setInvoiceStatus(null);
5209
5221
  },
5210
- className: "flex items-center justify-center gap-1.5 rounded-xl bg-primary/15 px-5 py-3 text-xs font-bold text-primary transition-all hover:bg-primary/25 active:scale-[0.98]",
5211
- children: [
5212
- /* @__PURE__ */ jsx56("span", { className: "material-symbols-outlined text-icon-sm", children: "refresh" }),
5213
- "New ",
5214
- network === "lightning" ? "Invoice" : "Address"
5215
- ]
5222
+ className: "flex size-10 items-center justify-center rounded-full bg-primary/15 text-primary transition-all hover:bg-primary/25 active:scale-[0.98] disabled:opacity-50",
5223
+ children: /* @__PURE__ */ jsx56(
5224
+ "span",
5225
+ {
5226
+ className: cn("material-symbols-outlined text-icon-md", loading && "animate-spin"),
5227
+ children: "refresh"
5228
+ }
5229
+ )
5216
5230
  }
5217
5231
  ) })
5218
5232
  ] });
@@ -5255,11 +5269,12 @@ function DepositPreGeneration({
5255
5269
  getUnitLabel,
5256
5270
  generateInvoice,
5257
5271
  needsColorableUtxos = false,
5258
- onOpenCreateUtxos
5272
+ onOpenCreateUtxos,
5273
+ showReceiveSummary = true
5259
5274
  }) {
5260
5275
  const method = METHOD_META2[currentMethod];
5261
5276
  return /* @__PURE__ */ jsxs44("div", { className: "space-y-3", children: [
5262
- /* @__PURE__ */ jsxs44("div", { className: "rounded-2xl border border-white/8 bg-white/4 p-3", children: [
5277
+ showReceiveSummary && /* @__PURE__ */ jsxs44("div", { className: "rounded-2xl border border-white/8 bg-white/4 p-3", children: [
5263
5278
  /* @__PURE__ */ jsx57("p", { className: "text-xxs font-bold uppercase tracking-widest text-white/35", children: "Receive Summary" }),
5264
5279
  /* @__PURE__ */ jsxs44("div", { className: "mt-2 grid grid-cols-1 gap-2 text-xs", children: [
5265
5280
  /* @__PURE__ */ jsxs44("div", { className: "flex items-center justify-between gap-3", children: [
@@ -5853,6 +5868,7 @@ function DepositInvoiceGeneration({
5853
5868
  const addressLabel = network === "spark" ? "Spark Address" : network === "arkade" ? arkSubMode === "boarding" ? "Boarding Address" : "Arkade Address" : network === "lightning" ? "Lightning Invoice" : "Deposit Address";
5854
5869
  const showChannelWarning = selectedAccount === "RGB" && network === "lightning" && !channelsLoading && channels.length === 0 && !isSparkConnected;
5855
5870
  const showLiquidityWarning = !isSparkLightning && network === "lightning" && maxDepositAmount === 0 && !channelsLoading && !isBtc;
5871
+ const isNewRgbAsset = isNewAsset && assetFamily === "RGB";
5856
5872
  return /* @__PURE__ */ jsxs46("div", { className: "flex h-screen flex-col overflow-hidden bg-background font-display text-foreground", children: [
5857
5873
  /* @__PURE__ */ jsx59(
5858
5874
  PageHeader,
@@ -5982,7 +5998,8 @@ function DepositInvoiceGeneration({
5982
5998
  getUnitLabel,
5983
5999
  generateInvoice,
5984
6000
  needsColorableUtxos,
5985
- onOpenCreateUtxos
6001
+ onOpenCreateUtxos,
6002
+ showReceiveSummary: !isNewRgbAsset
5986
6003
  }
5987
6004
  ) : /* @__PURE__ */ jsx59(
5988
6005
  DepositGeneratedView,
@@ -6010,7 +6027,8 @@ function DepositInvoiceGeneration({
6010
6027
  setRecipientId,
6011
6028
  setAmount,
6012
6029
  setInvoiceStatus,
6013
- handleDone
6030
+ handleDone,
6031
+ showQrNetworkBadge: false
6014
6032
  }
6015
6033
  ) })
6016
6034
  ] });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kaleido-ui",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
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",