@swype-org/react-sdk 0.1.103 → 0.1.104

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
@@ -223,6 +223,9 @@ async function createAccount(apiBaseUrl, token, params) {
223
223
  credentialId: params.credentialId,
224
224
  providerId: params.providerId
225
225
  };
226
+ if (params.nickname) {
227
+ body.nickname = params.nickname;
228
+ }
226
229
  const res = await fetch(`${apiBaseUrl}/v1/accounts`, {
227
230
  method: "POST",
228
231
  headers: {
@@ -2647,6 +2650,8 @@ function SourceCard({
2647
2650
  accounts.map((account) => {
2648
2651
  const active = hasActiveWallet2(account);
2649
2652
  const isSelected = account.id === selectedAccountId;
2653
+ const displayName = account.nickname ?? account.name;
2654
+ const walletAddress = account.wallets[0]?.name;
2650
2655
  return /* @__PURE__ */ jsxRuntime.jsxs(
2651
2656
  "button",
2652
2657
  {
@@ -2670,7 +2675,10 @@ function SourceCard({
2670
2675
  style: dropdownLogoStyle
2671
2676
  }
2672
2677
  ) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: dropdownFallbackIconStyle(active ? tokens.textMuted : tokens.border), children: account.name.charAt(0) }),
2673
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: dropdownNameStyle(active ? tokens.text : tokens.textMuted), children: account.name })
2678
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: dropdownNameColumnStyle, children: [
2679
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: dropdownNameStyle(active ? tokens.text : tokens.textMuted), children: displayName }),
2680
+ walletAddress && /* @__PURE__ */ jsxRuntime.jsx("span", { style: dropdownAddressStyle(active ? tokens.textMuted : tokens.border), children: walletAddress })
2681
+ ] })
2674
2682
  ] }),
2675
2683
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: dropdownRowRightStyle, children: [
2676
2684
  active ? /* @__PURE__ */ jsxRuntime.jsx("span", { style: activeBadgeStyle(tokens), children: "Active" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { style: inactiveBadgeStyle(tokens), children: "Setup incomplete" }),
@@ -2700,7 +2708,7 @@ function SourceCard({
2700
2708
  style: addProviderStyle(tokens),
2701
2709
  children: [
2702
2710
  /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 5v14M5 12h14", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round" }) }),
2703
- "Add Provider"
2711
+ "Add Account"
2704
2712
  ]
2705
2713
  }
2706
2714
  )
@@ -2822,6 +2830,12 @@ var dropdownFallbackIconStyle = (color) => ({
2822
2830
  color,
2823
2831
  flexShrink: 0
2824
2832
  });
2833
+ var dropdownNameColumnStyle = {
2834
+ display: "flex",
2835
+ flexDirection: "column",
2836
+ gap: 2,
2837
+ minWidth: 0
2838
+ };
2825
2839
  var dropdownNameStyle = (color) => ({
2826
2840
  fontWeight: 500,
2827
2841
  color,
@@ -2829,6 +2843,14 @@ var dropdownNameStyle = (color) => ({
2829
2843
  overflow: "hidden",
2830
2844
  textOverflow: "ellipsis"
2831
2845
  });
2846
+ var dropdownAddressStyle = (color) => ({
2847
+ fontSize: "0.72rem",
2848
+ color,
2849
+ fontFamily: '"SF Mono", "Fira Code", monospace',
2850
+ whiteSpace: "nowrap",
2851
+ overflow: "hidden",
2852
+ textOverflow: "ellipsis"
2853
+ });
2832
2854
  var activeBadgeStyle = (tokens) => ({
2833
2855
  fontSize: "0.6rem",
2834
2856
  fontWeight: 600,