@swype-org/react-sdk 0.2.359 → 0.2.361

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
@@ -1055,6 +1055,7 @@ function BlinkProvider({
1055
1055
  privyAppId,
1056
1056
  minTransferAmountUsd,
1057
1057
  enableFullWidget = false,
1058
+ promoTagText = null,
1058
1059
  isMobileApp = false,
1059
1060
  children
1060
1061
  }) {
@@ -1095,9 +1096,10 @@ function BlinkProvider({
1095
1096
  depositAmount,
1096
1097
  setDepositAmount,
1097
1098
  enableFullWidget,
1099
+ promoTagText,
1098
1100
  isMobileApp
1099
1101
  }),
1100
- [apiBaseUrl, theme, resolvedMinTransferAmountUsd, depositAmount, setDepositAmount, enableFullWidget, isMobileApp]
1102
+ [apiBaseUrl, theme, resolvedMinTransferAmountUsd, depositAmount, setDepositAmount, enableFullWidget, promoTagText, isMobileApp]
1101
1103
  );
1102
1104
  return (
1103
1105
  // Outermost wrapper: loads the Fingerprint browser agent once per
@@ -9166,8 +9168,11 @@ var TOKEN_LOGOS = {
9166
9168
  };
9167
9169
  var CHAIN_LOGOS = {
9168
9170
  base: BASE_CHAIN_LOGO,
9171
+ // Testnets use the parent chain's logo (sandbox/smokebox environments).
9172
+ "base sepolia": BASE_CHAIN_LOGO,
9169
9173
  ethereum: ETHEREUM_CHAIN_LOGO,
9170
9174
  "ethereum mainnet": ETHEREUM_CHAIN_LOGO,
9175
+ sepolia: ETHEREUM_CHAIN_LOGO,
9171
9176
  polygon: POLYGON_CHAIN_LOGO,
9172
9177
  "polygon mainnet": POLYGON_CHAIN_LOGO,
9173
9178
  arbitrum: ARBITRUM_CHAIN_LOGO,
@@ -9184,7 +9189,40 @@ var CHAIN_LOGOS = {
9184
9189
  solana: SOLANA_CHAIN_LOGO,
9185
9190
  "solana mainnet": SOLANA_CHAIN_LOGO
9186
9191
  };
9187
- function BlinkDepositButton({ onClick, disabled, loading }) {
9192
+ function PromoTagBadge({ text, background, color }) {
9193
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { style: badgeStyle2(background, color), children: text });
9194
+ }
9195
+ var badgeStyle2 = (background, color) => ({
9196
+ position: "absolute",
9197
+ left: "50%",
9198
+ bottom: -9,
9199
+ // Paint above the coin marks' isolated stack (zIndex 1) inside the button.
9200
+ zIndex: 2,
9201
+ display: "inline-block",
9202
+ // The config API allows up to 50 chars; keep the sticker inside the button's
9203
+ // edges and ellipsize anything that doesn't fit.
9204
+ maxWidth: "calc(100% - 24px)",
9205
+ overflow: "hidden",
9206
+ textOverflow: "ellipsis",
9207
+ boxSizing: "border-box",
9208
+ background,
9209
+ color,
9210
+ fontSize: 12,
9211
+ fontWeight: 500,
9212
+ lineHeight: 1,
9213
+ padding: "4px 8px",
9214
+ borderRadius: 6,
9215
+ whiteSpace: "nowrap",
9216
+ transform: "translateX(-50%) rotate(-6.75deg)",
9217
+ boxShadow: "0 2px 4px rgba(0, 0, 0, 0.16)",
9218
+ pointerEvents: "none"
9219
+ });
9220
+ function BlinkDepositButton({
9221
+ onClick,
9222
+ disabled,
9223
+ loading,
9224
+ promoTagText
9225
+ }) {
9188
9226
  const config = useOptionalBlinkConfig();
9189
9227
  const tokens = config?.tokens ?? lightThemeNew;
9190
9228
  const [hovered, setHovered] = react.useState(false);
@@ -9220,12 +9258,15 @@ function BlinkDepositButton({ onClick, disabled, loading }) {
9220
9258
  }
9221
9259
  ),
9222
9260
  /* @__PURE__ */ jsxRuntime.jsx("img", { src: TETHER_LOGO, alt: "", "aria-hidden": "true", style: coinStyle })
9223
- ] })
9261
+ ] }),
9262
+ promoTagText ? /* @__PURE__ */ jsxRuntime.jsx(PromoTagBadge, { text: promoTagText, background: tokens.highlight, color: tokens.text }) : null
9224
9263
  ]
9225
9264
  }
9226
9265
  );
9227
9266
  }
9228
9267
  var pillStyle = (tokens, state) => ({
9268
+ // Anchor for the optional PromoTagBadge, which overflows the bottom edge.
9269
+ position: "relative",
9229
9270
  display: "flex",
9230
9271
  alignItems: "center",
9231
9272
  justifyContent: "space-between",
@@ -9648,7 +9689,7 @@ function StepList({
9648
9689
  showSpinner ? /* @__PURE__ */ jsxRuntime.jsx(StepSpinner, { size: dims.badge, color: tokens.accent }) : showRecessedPending ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: pendingDotStyle(tokens.bgRecessed, dims.badge) }) : /* @__PURE__ */ jsxRuntime.jsx(
9649
9690
  "div",
9650
9691
  {
9651
- style: badgeStyle2(
9692
+ style: badgeStyle3(
9652
9693
  isComplete || isActive ? tokens.accent : tokens.border,
9653
9694
  isComplete,
9654
9695
  dims.badge
@@ -9737,7 +9778,7 @@ var rowStyle2 = (gap) => ({
9737
9778
  alignItems: "center",
9738
9779
  gap
9739
9780
  });
9740
- var badgeStyle2 = (color, filled, size) => ({
9781
+ var badgeStyle3 = (color, filled, size) => ({
9741
9782
  width: size,
9742
9783
  height: size,
9743
9784
  borderRadius: "50%",
@@ -11204,7 +11245,7 @@ function DepositOptionsScreen({
11204
11245
  onSignInWithBlink,
11205
11246
  onClose
11206
11247
  }) {
11207
- const { tokens } = useBlinkConfig();
11248
+ const { tokens, promoTagText } = useBlinkConfig();
11208
11249
  const [manualHovered, setManualHovered] = react.useState(false);
11209
11250
  const [manualPressed, setManualPressed] = react.useState(false);
11210
11251
  return /* @__PURE__ */ jsxRuntime.jsxs(ScreenLayout, { hideScrollbar: true, children: [
@@ -11227,7 +11268,7 @@ function DepositOptionsScreen({
11227
11268
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle2, children: [
11228
11269
  /* @__PURE__ */ jsxRuntime.jsx("img", { src: BLINK_PASSKEY_ILLUSTRATION, alt: "", "aria-hidden": "true", style: heroStyle }),
11229
11270
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: stackStyle, children: [
11230
- /* @__PURE__ */ jsxRuntime.jsx(BlinkDepositButton, { onClick: onSignInWithBlink }),
11271
+ /* @__PURE__ */ jsxRuntime.jsx(BlinkDepositButton, { onClick: onSignInWithBlink, promoTagText }),
11231
11272
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: dividerRowStyle, children: [
11232
11273
  /* @__PURE__ */ jsxRuntime.jsx("span", { style: dividerRuleStyle(tokens.textTertiary) }),
11233
11274
  /* @__PURE__ */ jsxRuntime.jsx("span", { style: dividerLabelStyle(tokens.textTertiary), children: "OR" }),
@@ -11357,7 +11398,7 @@ function WelcomeBackScreen({
11357
11398
  onComplete,
11358
11399
  onClose
11359
11400
  }) {
11360
- const { tokens } = useBlinkConfig();
11401
+ const { tokens, promoTagText } = useBlinkConfig();
11361
11402
  const [depositHovered, setDepositHovered] = react.useState(false);
11362
11403
  const [depositPressed, setDepositPressed] = react.useState(false);
11363
11404
  const [manualHovered, setManualHovered] = react.useState(false);
@@ -11414,7 +11455,15 @@ function WelcomeBackScreen({
11414
11455
  ),
11415
11456
  /* @__PURE__ */ jsxRuntime.jsx("img", { src: TETHER_LOGO, alt: "", "aria-hidden": "true", style: coinStyle2 })
11416
11457
  ] })
11417
- ] })
11458
+ ] }),
11459
+ promoTagText ? /* @__PURE__ */ jsxRuntime.jsx(
11460
+ PromoTagBadge,
11461
+ {
11462
+ text: promoTagText,
11463
+ background: tokens.highlight,
11464
+ color: tokens.text
11465
+ }
11466
+ ) : null
11418
11467
  ]
11419
11468
  }
11420
11469
  ),
@@ -11499,6 +11548,8 @@ var stackStyle2 = {
11499
11548
  width: "100%"
11500
11549
  };
11501
11550
  var depositFrameStyle = (bg, hovered, pressed) => ({
11551
+ // Anchor for the optional PromoTagBadge, which overflows the frame's bottom edge.
11552
+ position: "relative",
11502
11553
  display: "flex",
11503
11554
  flexDirection: "column",
11504
11555
  alignItems: "stretch",