@swype-org/react-sdk 0.1.202 → 0.1.204

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.js CHANGED
@@ -3636,16 +3636,10 @@ function SetupScreen({
3636
3636
  onClick: onAdvanced,
3637
3637
  style: tokenIconButtonStyle(!!onAdvanced),
3638
3638
  children: [
3639
- /* @__PURE__ */ jsxs("div", { style: tokenIconWrapStyle, children: [
3640
- selectedTokenSymbol && TOKEN_LOGOS[selectedTokenSymbol] ? /* @__PURE__ */ jsx("img", { src: TOKEN_LOGOS[selectedTokenSymbol], alt: selectedTokenSymbol, width: 36, height: 36, style: { borderRadius: "50%" } }) : /* @__PURE__ */ jsxs("svg", { width: "36", height: "36", viewBox: "0 0 36 36", fill: "none", children: [
3641
- /* @__PURE__ */ jsx("circle", { cx: "18", cy: "18", r: "18", fill: "#2DB84B" }),
3642
- /* @__PURE__ */ jsx("text", { x: "18", y: "23", textAnchor: "middle", fontSize: "18", fill: "#fff", fontWeight: "700", children: "$" })
3643
- ] }),
3644
- /* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", style: checkBadgeStyle, children: [
3645
- /* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "8", fill: "#2775CA" }),
3646
- /* @__PURE__ */ jsx("path", { d: "M5 8l2 2 4-4", stroke: "#fff", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round" })
3647
- ] })
3648
- ] }),
3639
+ /* @__PURE__ */ jsx("div", { style: tokenIconWrapStyle, children: selectedTokenSymbol && TOKEN_LOGOS[selectedTokenSymbol] ? /* @__PURE__ */ jsx("img", { src: TOKEN_LOGOS[selectedTokenSymbol], alt: selectedTokenSymbol, width: 36, height: 36, style: { borderRadius: "50%" } }) : /* @__PURE__ */ jsxs("svg", { width: "36", height: "36", viewBox: "0 0 36 36", fill: "none", children: [
3640
+ /* @__PURE__ */ jsx("circle", { cx: "18", cy: "18", r: "18", fill: "#2DB84B" }),
3641
+ /* @__PURE__ */ jsx("text", { x: "18", y: "23", textAnchor: "middle", fontSize: "18", fill: "#fff", fontWeight: "700", children: "$" })
3642
+ ] }) }),
3649
3643
  /* @__PURE__ */ jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", style: { opacity: 0.5 }, children: /* @__PURE__ */ jsx("path", { d: "M6 9l6 6 6-6", stroke: tokens.textMuted, strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
3650
3644
  ]
3651
3645
  }
@@ -3744,11 +3738,6 @@ var tokenIconWrapStyle = {
3744
3738
  width: 36,
3745
3739
  height: 36
3746
3740
  };
3747
- var checkBadgeStyle = {
3748
- position: "absolute",
3749
- bottom: -1,
3750
- right: -3
3751
- };
3752
3741
  var presetsRowStyle = {
3753
3742
  display: "flex",
3754
3743
  gap: 10,
@@ -4556,7 +4545,7 @@ function SelectSourceScreen({
4556
4545
  /* @__PURE__ */ jsxs("div", { style: optionContentStyle, children: [
4557
4546
  /* @__PURE__ */ jsxs("span", { style: optionNameStyle(tokens.text), children: [
4558
4547
  chain.chainName,
4559
- isRecommended && /* @__PURE__ */ jsx("span", { style: recommendedBadgeStyle(tokens.accent), children: " recommended" })
4548
+ isRecommended && /* @__PURE__ */ jsx("span", { style: recommendedBadgeStyle(tokens.textMuted), children: " recommended" })
4560
4549
  ] }),
4561
4550
  /* @__PURE__ */ jsxs("span", { style: optionBalanceStyle(tokens.textMuted), children: [
4562
4551
  "$",
@@ -4573,6 +4562,7 @@ function SelectSourceScreen({
4573
4562
  /* @__PURE__ */ jsx("label", { style: labelStyle4(tokens.textSecondary), children: "Token" }),
4574
4563
  /* @__PURE__ */ jsx("div", { style: optionListStyle, children: tokenChoices.map((token) => {
4575
4564
  const isSelected = token.tokenSymbol === selectedTokenSymbol;
4565
+ const tokenLogo = TOKEN_LOGOS[token.tokenSymbol];
4576
4566
  return /* @__PURE__ */ jsxs(
4577
4567
  "button",
4578
4568
  {
@@ -4580,11 +4570,14 @@ function SelectSourceScreen({
4580
4570
  onClick: () => onTokenChange(token.tokenSymbol),
4581
4571
  style: optionButtonStyle(tokens, isSelected),
4582
4572
  children: [
4583
- /* @__PURE__ */ jsxs("div", { style: optionContentStyle, children: [
4584
- /* @__PURE__ */ jsx("span", { style: optionNameStyle(tokens.text), children: token.tokenSymbol }),
4585
- /* @__PURE__ */ jsxs("span", { style: optionBalanceStyle(tokens.textMuted), children: [
4586
- "$",
4587
- token.balance.toFixed(2)
4573
+ /* @__PURE__ */ jsxs("div", { style: optionMainStyle, children: [
4574
+ /* @__PURE__ */ jsx("div", { style: tokenIconCircleStyle(tokens, !!tokenLogo), children: tokenLogo ? /* @__PURE__ */ jsx("img", { src: tokenLogo, alt: token.tokenSymbol, style: tokenLogoImgStyle }) : /* @__PURE__ */ jsx("span", { style: tokenIconTextStyle(tokens.textMuted), children: "$" }) }),
4575
+ /* @__PURE__ */ jsxs("div", { style: optionContentStyle, children: [
4576
+ /* @__PURE__ */ jsx("span", { style: optionNameStyle(tokens.text), children: token.tokenSymbol }),
4577
+ /* @__PURE__ */ jsxs("span", { style: optionBalanceStyle(tokens.textMuted), children: [
4578
+ "$",
4579
+ token.balance.toFixed(2)
4580
+ ] })
4588
4581
  ] })
4589
4582
  ] }),
4590
4583
  /* @__PURE__ */ jsx("div", { style: radioStyle(tokens, isSelected), children: isSelected && /* @__PURE__ */ jsx("div", { style: radioDotStyle(tokens.accent) }) })
@@ -4637,6 +4630,11 @@ var optionContentStyle = {
4637
4630
  flexDirection: "column",
4638
4631
  gap: 2
4639
4632
  };
4633
+ var optionMainStyle = {
4634
+ display: "flex",
4635
+ alignItems: "center",
4636
+ gap: 12
4637
+ };
4640
4638
  var optionNameStyle = (color) => ({
4641
4639
  fontSize: "0.9rem",
4642
4640
  fontWeight: 600,
@@ -4652,6 +4650,28 @@ var optionBalanceStyle = (color) => ({
4652
4650
  fontSize: "0.78rem",
4653
4651
  color
4654
4652
  });
4653
+ var tokenIconCircleStyle = (tokens, hasLogo) => ({
4654
+ width: 36,
4655
+ height: 36,
4656
+ borderRadius: "50%",
4657
+ border: hasLogo ? "none" : `1.5px solid ${tokens.border}`,
4658
+ display: "flex",
4659
+ alignItems: "center",
4660
+ justifyContent: "center",
4661
+ flexShrink: 0,
4662
+ overflow: "hidden"
4663
+ });
4664
+ var tokenLogoImgStyle = {
4665
+ width: 36,
4666
+ height: 36,
4667
+ borderRadius: "50%",
4668
+ objectFit: "cover"
4669
+ };
4670
+ var tokenIconTextStyle = (color) => ({
4671
+ fontSize: "1rem",
4672
+ fontWeight: 700,
4673
+ color
4674
+ });
4655
4675
  var radioStyle = (tokens, selected) => ({
4656
4676
  width: 20,
4657
4677
  height: 20,
@@ -5286,7 +5306,7 @@ function TokenPickerScreen({
5286
5306
  onClick: () => handleSelect(entry),
5287
5307
  style: tokenRowStyle2(t),
5288
5308
  children: [
5289
- /* @__PURE__ */ jsx("div", { style: tokenIconCircleStyle(t, !!TOKEN_LOGOS[entry.tokenSymbol]), children: TOKEN_LOGOS[entry.tokenSymbol] ? /* @__PURE__ */ jsx("img", { src: TOKEN_LOGOS[entry.tokenSymbol], alt: entry.tokenSymbol, style: tokenLogoImgStyle }) : /* @__PURE__ */ jsx("span", { style: tokenIconTextStyle(t.textMuted), children: "$" }) }),
5309
+ /* @__PURE__ */ jsx("div", { style: tokenIconCircleStyle2(t, !!TOKEN_LOGOS[entry.tokenSymbol]), children: TOKEN_LOGOS[entry.tokenSymbol] ? /* @__PURE__ */ jsx("img", { src: TOKEN_LOGOS[entry.tokenSymbol], alt: entry.tokenSymbol, style: tokenLogoImgStyle2 }) : /* @__PURE__ */ jsx("span", { style: tokenIconTextStyle2(t.textMuted), children: "$" }) }),
5290
5310
  /* @__PURE__ */ jsxs("div", { style: tokenInfoStyle2, children: [
5291
5311
  /* @__PURE__ */ jsxs("div", { style: tokenNameRowStyle, children: [
5292
5312
  /* @__PURE__ */ jsx("span", { style: tokenSymbolTextStyle(t.text), children: entry.tokenSymbol }),
@@ -5366,7 +5386,7 @@ var tokenRowStyle2 = (tokens) => ({
5366
5386
  textAlign: "left",
5367
5387
  width: "100%"
5368
5388
  });
5369
- var tokenIconCircleStyle = (tokens, hasLogo) => ({
5389
+ var tokenIconCircleStyle2 = (tokens, hasLogo) => ({
5370
5390
  width: 36,
5371
5391
  height: 36,
5372
5392
  borderRadius: "50%",
@@ -5377,13 +5397,13 @@ var tokenIconCircleStyle = (tokens, hasLogo) => ({
5377
5397
  flexShrink: 0,
5378
5398
  overflow: "hidden"
5379
5399
  });
5380
- var tokenLogoImgStyle = {
5400
+ var tokenLogoImgStyle2 = {
5381
5401
  width: 36,
5382
5402
  height: 36,
5383
5403
  borderRadius: "50%",
5384
5404
  objectFit: "cover"
5385
5405
  };
5386
- var tokenIconTextStyle = (color) => ({
5406
+ var tokenIconTextStyle2 = (color) => ({
5387
5407
  fontSize: "1rem",
5388
5408
  fontWeight: 700,
5389
5409
  color
@@ -5647,7 +5667,7 @@ function StepRendererContent({
5647
5667
  selectedSourceLabel: effectiveSourceLabel,
5648
5668
  loading: savingOneTapLimit,
5649
5669
  error: state.error,
5650
- selectedTokenSymbol: selectedSource?.token.symbol
5670
+ selectedTokenSymbol: selectedSource?.token.symbol ?? selectSourceTokenSymbol
5651
5671
  }
5652
5672
  );
5653
5673
  }
@@ -7280,7 +7300,7 @@ function usePaymentEffects(deps) {
7280
7300
  accounts: accts,
7281
7301
  chains: chn,
7282
7302
  defaults,
7283
- resolvedStep: correctableSteps.includes(state.step) ? resolved.step : void 0,
7303
+ resolvedStep: correctableSteps.includes(state.step) && !state.creatingTransfer ? resolved.step : void 0,
7284
7304
  clearMobileState: resolved.clearPersistedFlow
7285
7305
  });
7286
7306
  if (resolved.clearPersistedFlow) clearMobileFlowState();