@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.cjs CHANGED
@@ -3639,16 +3639,10 @@ function SetupScreen({
3639
3639
  onClick: onAdvanced,
3640
3640
  style: tokenIconButtonStyle(!!onAdvanced),
3641
3641
  children: [
3642
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: tokenIconWrapStyle, children: [
3643
- selectedTokenSymbol && TOKEN_LOGOS[selectedTokenSymbol] ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: TOKEN_LOGOS[selectedTokenSymbol], alt: selectedTokenSymbol, width: 36, height: 36, style: { borderRadius: "50%" } }) : /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "36", height: "36", viewBox: "0 0 36 36", fill: "none", children: [
3644
- /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "18", cy: "18", r: "18", fill: "#2DB84B" }),
3645
- /* @__PURE__ */ jsxRuntime.jsx("text", { x: "18", y: "23", textAnchor: "middle", fontSize: "18", fill: "#fff", fontWeight: "700", children: "$" })
3646
- ] }),
3647
- /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", style: checkBadgeStyle, children: [
3648
- /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8", cy: "8", r: "8", fill: "#2775CA" }),
3649
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 8l2 2 4-4", stroke: "#fff", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round" })
3650
- ] })
3651
- ] }),
3642
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: tokenIconWrapStyle, children: selectedTokenSymbol && TOKEN_LOGOS[selectedTokenSymbol] ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: TOKEN_LOGOS[selectedTokenSymbol], alt: selectedTokenSymbol, width: 36, height: 36, style: { borderRadius: "50%" } }) : /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "36", height: "36", viewBox: "0 0 36 36", fill: "none", children: [
3643
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "18", cy: "18", r: "18", fill: "#2DB84B" }),
3644
+ /* @__PURE__ */ jsxRuntime.jsx("text", { x: "18", y: "23", textAnchor: "middle", fontSize: "18", fill: "#fff", fontWeight: "700", children: "$" })
3645
+ ] }) }),
3652
3646
  /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", style: { opacity: 0.5 }, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6 9l6 6 6-6", stroke: tokens.textMuted, strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
3653
3647
  ]
3654
3648
  }
@@ -3747,11 +3741,6 @@ var tokenIconWrapStyle = {
3747
3741
  width: 36,
3748
3742
  height: 36
3749
3743
  };
3750
- var checkBadgeStyle = {
3751
- position: "absolute",
3752
- bottom: -1,
3753
- right: -3
3754
- };
3755
3744
  var presetsRowStyle = {
3756
3745
  display: "flex",
3757
3746
  gap: 10,
@@ -4559,7 +4548,7 @@ function SelectSourceScreen({
4559
4548
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: optionContentStyle, children: [
4560
4549
  /* @__PURE__ */ jsxRuntime.jsxs("span", { style: optionNameStyle(tokens.text), children: [
4561
4550
  chain.chainName,
4562
- isRecommended && /* @__PURE__ */ jsxRuntime.jsx("span", { style: recommendedBadgeStyle(tokens.accent), children: " recommended" })
4551
+ isRecommended && /* @__PURE__ */ jsxRuntime.jsx("span", { style: recommendedBadgeStyle(tokens.textMuted), children: " recommended" })
4563
4552
  ] }),
4564
4553
  /* @__PURE__ */ jsxRuntime.jsxs("span", { style: optionBalanceStyle(tokens.textMuted), children: [
4565
4554
  "$",
@@ -4576,6 +4565,7 @@ function SelectSourceScreen({
4576
4565
  /* @__PURE__ */ jsxRuntime.jsx("label", { style: labelStyle4(tokens.textSecondary), children: "Token" }),
4577
4566
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: optionListStyle, children: tokenChoices.map((token) => {
4578
4567
  const isSelected = token.tokenSymbol === selectedTokenSymbol;
4568
+ const tokenLogo = TOKEN_LOGOS[token.tokenSymbol];
4579
4569
  return /* @__PURE__ */ jsxRuntime.jsxs(
4580
4570
  "button",
4581
4571
  {
@@ -4583,11 +4573,14 @@ function SelectSourceScreen({
4583
4573
  onClick: () => onTokenChange(token.tokenSymbol),
4584
4574
  style: optionButtonStyle(tokens, isSelected),
4585
4575
  children: [
4586
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: optionContentStyle, children: [
4587
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: optionNameStyle(tokens.text), children: token.tokenSymbol }),
4588
- /* @__PURE__ */ jsxRuntime.jsxs("span", { style: optionBalanceStyle(tokens.textMuted), children: [
4589
- "$",
4590
- token.balance.toFixed(2)
4576
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: optionMainStyle, children: [
4577
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: tokenIconCircleStyle(tokens, !!tokenLogo), children: tokenLogo ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: tokenLogo, alt: token.tokenSymbol, style: tokenLogoImgStyle }) : /* @__PURE__ */ jsxRuntime.jsx("span", { style: tokenIconTextStyle(tokens.textMuted), children: "$" }) }),
4578
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: optionContentStyle, children: [
4579
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: optionNameStyle(tokens.text), children: token.tokenSymbol }),
4580
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { style: optionBalanceStyle(tokens.textMuted), children: [
4581
+ "$",
4582
+ token.balance.toFixed(2)
4583
+ ] })
4591
4584
  ] })
4592
4585
  ] }),
4593
4586
  /* @__PURE__ */ jsxRuntime.jsx("div", { style: radioStyle(tokens, isSelected), children: isSelected && /* @__PURE__ */ jsxRuntime.jsx("div", { style: radioDotStyle(tokens.accent) }) })
@@ -4640,6 +4633,11 @@ var optionContentStyle = {
4640
4633
  flexDirection: "column",
4641
4634
  gap: 2
4642
4635
  };
4636
+ var optionMainStyle = {
4637
+ display: "flex",
4638
+ alignItems: "center",
4639
+ gap: 12
4640
+ };
4643
4641
  var optionNameStyle = (color) => ({
4644
4642
  fontSize: "0.9rem",
4645
4643
  fontWeight: 600,
@@ -4655,6 +4653,28 @@ var optionBalanceStyle = (color) => ({
4655
4653
  fontSize: "0.78rem",
4656
4654
  color
4657
4655
  });
4656
+ var tokenIconCircleStyle = (tokens, hasLogo) => ({
4657
+ width: 36,
4658
+ height: 36,
4659
+ borderRadius: "50%",
4660
+ border: hasLogo ? "none" : `1.5px solid ${tokens.border}`,
4661
+ display: "flex",
4662
+ alignItems: "center",
4663
+ justifyContent: "center",
4664
+ flexShrink: 0,
4665
+ overflow: "hidden"
4666
+ });
4667
+ var tokenLogoImgStyle = {
4668
+ width: 36,
4669
+ height: 36,
4670
+ borderRadius: "50%",
4671
+ objectFit: "cover"
4672
+ };
4673
+ var tokenIconTextStyle = (color) => ({
4674
+ fontSize: "1rem",
4675
+ fontWeight: 700,
4676
+ color
4677
+ });
4658
4678
  var radioStyle = (tokens, selected) => ({
4659
4679
  width: 20,
4660
4680
  height: 20,
@@ -5289,7 +5309,7 @@ function TokenPickerScreen({
5289
5309
  onClick: () => handleSelect(entry),
5290
5310
  style: tokenRowStyle2(t),
5291
5311
  children: [
5292
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: tokenIconCircleStyle(t, !!TOKEN_LOGOS[entry.tokenSymbol]), children: TOKEN_LOGOS[entry.tokenSymbol] ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: TOKEN_LOGOS[entry.tokenSymbol], alt: entry.tokenSymbol, style: tokenLogoImgStyle }) : /* @__PURE__ */ jsxRuntime.jsx("span", { style: tokenIconTextStyle(t.textMuted), children: "$" }) }),
5312
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: tokenIconCircleStyle2(t, !!TOKEN_LOGOS[entry.tokenSymbol]), children: TOKEN_LOGOS[entry.tokenSymbol] ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: TOKEN_LOGOS[entry.tokenSymbol], alt: entry.tokenSymbol, style: tokenLogoImgStyle2 }) : /* @__PURE__ */ jsxRuntime.jsx("span", { style: tokenIconTextStyle2(t.textMuted), children: "$" }) }),
5293
5313
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: tokenInfoStyle2, children: [
5294
5314
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: tokenNameRowStyle, children: [
5295
5315
  /* @__PURE__ */ jsxRuntime.jsx("span", { style: tokenSymbolTextStyle(t.text), children: entry.tokenSymbol }),
@@ -5369,7 +5389,7 @@ var tokenRowStyle2 = (tokens) => ({
5369
5389
  textAlign: "left",
5370
5390
  width: "100%"
5371
5391
  });
5372
- var tokenIconCircleStyle = (tokens, hasLogo) => ({
5392
+ var tokenIconCircleStyle2 = (tokens, hasLogo) => ({
5373
5393
  width: 36,
5374
5394
  height: 36,
5375
5395
  borderRadius: "50%",
@@ -5380,13 +5400,13 @@ var tokenIconCircleStyle = (tokens, hasLogo) => ({
5380
5400
  flexShrink: 0,
5381
5401
  overflow: "hidden"
5382
5402
  });
5383
- var tokenLogoImgStyle = {
5403
+ var tokenLogoImgStyle2 = {
5384
5404
  width: 36,
5385
5405
  height: 36,
5386
5406
  borderRadius: "50%",
5387
5407
  objectFit: "cover"
5388
5408
  };
5389
- var tokenIconTextStyle = (color) => ({
5409
+ var tokenIconTextStyle2 = (color) => ({
5390
5410
  fontSize: "1rem",
5391
5411
  fontWeight: 700,
5392
5412
  color
@@ -5650,7 +5670,7 @@ function StepRendererContent({
5650
5670
  selectedSourceLabel: effectiveSourceLabel,
5651
5671
  loading: savingOneTapLimit,
5652
5672
  error: state.error,
5653
- selectedTokenSymbol: selectedSource?.token.symbol
5673
+ selectedTokenSymbol: selectedSource?.token.symbol ?? selectSourceTokenSymbol
5654
5674
  }
5655
5675
  );
5656
5676
  }
@@ -7283,7 +7303,7 @@ function usePaymentEffects(deps) {
7283
7303
  accounts: accts,
7284
7304
  chains: chn,
7285
7305
  defaults,
7286
- resolvedStep: correctableSteps.includes(state.step) ? resolved.step : void 0,
7306
+ resolvedStep: correctableSteps.includes(state.step) && !state.creatingTransfer ? resolved.step : void 0,
7287
7307
  clearMobileState: resolved.clearPersistedFlow
7288
7308
  });
7289
7309
  if (resolved.clearPersistedFlow) clearMobileFlowState();