@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.d.cts CHANGED
@@ -432,6 +432,12 @@ interface BlinkConfig {
432
432
  * `useBlinkConfig().enableFullWidget ?? false`.
433
433
  */
434
434
  enableFullWidget?: boolean;
435
+ /**
436
+ * Promotional sticker copy rendered on the deposit CTA buttons (e.g.
437
+ * "2x Your Profits"). Sourced from the merchant's backend config; null or
438
+ * undefined hides the tag.
439
+ */
440
+ promoTagText?: string | null;
435
441
  /**
436
442
  * When true, the SDK is being rendered inside a native mobile app's in-app
437
443
  * browser (e.g. via `deposit-mobile-sdk` opening an SFSafariViewController
@@ -465,6 +471,12 @@ interface BlinkProviderProps {
465
471
  * before login for unauthenticated users. Defaults to `false`.
466
472
  */
467
473
  enableFullWidget?: boolean;
474
+ /**
475
+ * Promotional sticker copy rendered on the deposit CTA buttons (e.g.
476
+ * "2x Your Profits"). Sourced from the merchant's backend config; null or
477
+ * undefined (the default) hides the tag.
478
+ */
479
+ promoTagText?: string | null;
468
480
  /**
469
481
  * When true, the widget is hosted inside a native mobile app's in-app browser.
470
482
  * Hides the in-screen (X) close buttons and removes rounded screen corners so
@@ -487,7 +499,7 @@ interface BlinkProviderProps {
487
499
  * </BlinkProvider>
488
500
  * ```
489
501
  */
490
- declare function BlinkProvider({ apiBaseUrl, theme, privyAppId, minTransferAmountUsd, enableFullWidget, isMobileApp, children, }: BlinkProviderProps): react_jsx_runtime.JSX.Element;
502
+ declare function BlinkProvider({ apiBaseUrl, theme, privyAppId, minTransferAmountUsd, enableFullWidget, promoTagText, isMobileApp, children, }: BlinkProviderProps): react_jsx_runtime.JSX.Element;
491
503
  /** Access the Blink SDK configuration. Throws if used outside BlinkProvider. */
492
504
  declare function useBlinkConfig(): BlinkConfig;
493
505
  /**
@@ -1993,6 +2005,11 @@ interface BlinkDepositButtonProps {
1993
2005
  disabled?: boolean;
1994
2006
  /** Non-interactive waiting state (e.g. while preparing a deposit session). Dims like disabled. */
1995
2007
  loading?: boolean;
2008
+ /**
2009
+ * Promotional sticker copy (e.g. "2x Your Profits") rendered as a tilted
2010
+ * badge straddling the button's bottom edge. Omit/null to hide it.
2011
+ */
2012
+ promoTagText?: string | null;
1996
2013
  }
1997
2014
  /**
1998
2015
  * Blink-branded deposit CTA matching the Figma "Payment method" redesign
@@ -2005,7 +2022,7 @@ interface BlinkDepositButtonProps {
2005
2022
  * the default lightThemeNew palette; inside the widget it follows the
2006
2023
  * configured theme tokens.
2007
2024
  */
2008
- declare function BlinkDepositButton({ onClick, disabled, loading }: BlinkDepositButtonProps): react_jsx_runtime.JSX.Element;
2025
+ declare function BlinkDepositButton({ onClick, disabled, loading, promoTagText, }: BlinkDepositButtonProps): react_jsx_runtime.JSX.Element;
2009
2026
 
2010
2027
  interface OutlineButtonProps {
2011
2028
  children: ReactNode;
package/dist/index.d.ts CHANGED
@@ -432,6 +432,12 @@ interface BlinkConfig {
432
432
  * `useBlinkConfig().enableFullWidget ?? false`.
433
433
  */
434
434
  enableFullWidget?: boolean;
435
+ /**
436
+ * Promotional sticker copy rendered on the deposit CTA buttons (e.g.
437
+ * "2x Your Profits"). Sourced from the merchant's backend config; null or
438
+ * undefined hides the tag.
439
+ */
440
+ promoTagText?: string | null;
435
441
  /**
436
442
  * When true, the SDK is being rendered inside a native mobile app's in-app
437
443
  * browser (e.g. via `deposit-mobile-sdk` opening an SFSafariViewController
@@ -465,6 +471,12 @@ interface BlinkProviderProps {
465
471
  * before login for unauthenticated users. Defaults to `false`.
466
472
  */
467
473
  enableFullWidget?: boolean;
474
+ /**
475
+ * Promotional sticker copy rendered on the deposit CTA buttons (e.g.
476
+ * "2x Your Profits"). Sourced from the merchant's backend config; null or
477
+ * undefined (the default) hides the tag.
478
+ */
479
+ promoTagText?: string | null;
468
480
  /**
469
481
  * When true, the widget is hosted inside a native mobile app's in-app browser.
470
482
  * Hides the in-screen (X) close buttons and removes rounded screen corners so
@@ -487,7 +499,7 @@ interface BlinkProviderProps {
487
499
  * </BlinkProvider>
488
500
  * ```
489
501
  */
490
- declare function BlinkProvider({ apiBaseUrl, theme, privyAppId, minTransferAmountUsd, enableFullWidget, isMobileApp, children, }: BlinkProviderProps): react_jsx_runtime.JSX.Element;
502
+ declare function BlinkProvider({ apiBaseUrl, theme, privyAppId, minTransferAmountUsd, enableFullWidget, promoTagText, isMobileApp, children, }: BlinkProviderProps): react_jsx_runtime.JSX.Element;
491
503
  /** Access the Blink SDK configuration. Throws if used outside BlinkProvider. */
492
504
  declare function useBlinkConfig(): BlinkConfig;
493
505
  /**
@@ -1993,6 +2005,11 @@ interface BlinkDepositButtonProps {
1993
2005
  disabled?: boolean;
1994
2006
  /** Non-interactive waiting state (e.g. while preparing a deposit session). Dims like disabled. */
1995
2007
  loading?: boolean;
2008
+ /**
2009
+ * Promotional sticker copy (e.g. "2x Your Profits") rendered as a tilted
2010
+ * badge straddling the button's bottom edge. Omit/null to hide it.
2011
+ */
2012
+ promoTagText?: string | null;
1996
2013
  }
1997
2014
  /**
1998
2015
  * Blink-branded deposit CTA matching the Figma "Payment method" redesign
@@ -2005,7 +2022,7 @@ interface BlinkDepositButtonProps {
2005
2022
  * the default lightThemeNew palette; inside the widget it follows the
2006
2023
  * configured theme tokens.
2007
2024
  */
2008
- declare function BlinkDepositButton({ onClick, disabled, loading }: BlinkDepositButtonProps): react_jsx_runtime.JSX.Element;
2025
+ declare function BlinkDepositButton({ onClick, disabled, loading, promoTagText, }: BlinkDepositButtonProps): react_jsx_runtime.JSX.Element;
2009
2026
 
2010
2027
  interface OutlineButtonProps {
2011
2028
  children: ReactNode;
package/dist/index.js CHANGED
@@ -1031,6 +1031,7 @@ function BlinkProvider({
1031
1031
  privyAppId,
1032
1032
  minTransferAmountUsd,
1033
1033
  enableFullWidget = false,
1034
+ promoTagText = null,
1034
1035
  isMobileApp = false,
1035
1036
  children
1036
1037
  }) {
@@ -1071,9 +1072,10 @@ function BlinkProvider({
1071
1072
  depositAmount,
1072
1073
  setDepositAmount,
1073
1074
  enableFullWidget,
1075
+ promoTagText,
1074
1076
  isMobileApp
1075
1077
  }),
1076
- [apiBaseUrl, theme, resolvedMinTransferAmountUsd, depositAmount, setDepositAmount, enableFullWidget, isMobileApp]
1078
+ [apiBaseUrl, theme, resolvedMinTransferAmountUsd, depositAmount, setDepositAmount, enableFullWidget, promoTagText, isMobileApp]
1077
1079
  );
1078
1080
  return (
1079
1081
  // Outermost wrapper: loads the Fingerprint browser agent once per
@@ -9142,8 +9144,11 @@ var TOKEN_LOGOS = {
9142
9144
  };
9143
9145
  var CHAIN_LOGOS = {
9144
9146
  base: BASE_CHAIN_LOGO,
9147
+ // Testnets use the parent chain's logo (sandbox/smokebox environments).
9148
+ "base sepolia": BASE_CHAIN_LOGO,
9145
9149
  ethereum: ETHEREUM_CHAIN_LOGO,
9146
9150
  "ethereum mainnet": ETHEREUM_CHAIN_LOGO,
9151
+ sepolia: ETHEREUM_CHAIN_LOGO,
9147
9152
  polygon: POLYGON_CHAIN_LOGO,
9148
9153
  "polygon mainnet": POLYGON_CHAIN_LOGO,
9149
9154
  arbitrum: ARBITRUM_CHAIN_LOGO,
@@ -9160,7 +9165,40 @@ var CHAIN_LOGOS = {
9160
9165
  solana: SOLANA_CHAIN_LOGO,
9161
9166
  "solana mainnet": SOLANA_CHAIN_LOGO
9162
9167
  };
9163
- function BlinkDepositButton({ onClick, disabled, loading }) {
9168
+ function PromoTagBadge({ text, background, color }) {
9169
+ return /* @__PURE__ */ jsx("span", { style: badgeStyle2(background, color), children: text });
9170
+ }
9171
+ var badgeStyle2 = (background, color) => ({
9172
+ position: "absolute",
9173
+ left: "50%",
9174
+ bottom: -9,
9175
+ // Paint above the coin marks' isolated stack (zIndex 1) inside the button.
9176
+ zIndex: 2,
9177
+ display: "inline-block",
9178
+ // The config API allows up to 50 chars; keep the sticker inside the button's
9179
+ // edges and ellipsize anything that doesn't fit.
9180
+ maxWidth: "calc(100% - 24px)",
9181
+ overflow: "hidden",
9182
+ textOverflow: "ellipsis",
9183
+ boxSizing: "border-box",
9184
+ background,
9185
+ color,
9186
+ fontSize: 12,
9187
+ fontWeight: 500,
9188
+ lineHeight: 1,
9189
+ padding: "4px 8px",
9190
+ borderRadius: 6,
9191
+ whiteSpace: "nowrap",
9192
+ transform: "translateX(-50%) rotate(-6.75deg)",
9193
+ boxShadow: "0 2px 4px rgba(0, 0, 0, 0.16)",
9194
+ pointerEvents: "none"
9195
+ });
9196
+ function BlinkDepositButton({
9197
+ onClick,
9198
+ disabled,
9199
+ loading,
9200
+ promoTagText
9201
+ }) {
9164
9202
  const config = useOptionalBlinkConfig();
9165
9203
  const tokens = config?.tokens ?? lightThemeNew;
9166
9204
  const [hovered, setHovered] = useState(false);
@@ -9196,12 +9234,15 @@ function BlinkDepositButton({ onClick, disabled, loading }) {
9196
9234
  }
9197
9235
  ),
9198
9236
  /* @__PURE__ */ jsx("img", { src: TETHER_LOGO, alt: "", "aria-hidden": "true", style: coinStyle })
9199
- ] })
9237
+ ] }),
9238
+ promoTagText ? /* @__PURE__ */ jsx(PromoTagBadge, { text: promoTagText, background: tokens.highlight, color: tokens.text }) : null
9200
9239
  ]
9201
9240
  }
9202
9241
  );
9203
9242
  }
9204
9243
  var pillStyle = (tokens, state) => ({
9244
+ // Anchor for the optional PromoTagBadge, which overflows the bottom edge.
9245
+ position: "relative",
9205
9246
  display: "flex",
9206
9247
  alignItems: "center",
9207
9248
  justifyContent: "space-between",
@@ -9624,7 +9665,7 @@ function StepList({
9624
9665
  showSpinner ? /* @__PURE__ */ jsx(StepSpinner, { size: dims.badge, color: tokens.accent }) : showRecessedPending ? /* @__PURE__ */ jsx("div", { style: pendingDotStyle(tokens.bgRecessed, dims.badge) }) : /* @__PURE__ */ jsx(
9625
9666
  "div",
9626
9667
  {
9627
- style: badgeStyle2(
9668
+ style: badgeStyle3(
9628
9669
  isComplete || isActive ? tokens.accent : tokens.border,
9629
9670
  isComplete,
9630
9671
  dims.badge
@@ -9713,7 +9754,7 @@ var rowStyle2 = (gap) => ({
9713
9754
  alignItems: "center",
9714
9755
  gap
9715
9756
  });
9716
- var badgeStyle2 = (color, filled, size) => ({
9757
+ var badgeStyle3 = (color, filled, size) => ({
9717
9758
  width: size,
9718
9759
  height: size,
9719
9760
  borderRadius: "50%",
@@ -11180,7 +11221,7 @@ function DepositOptionsScreen({
11180
11221
  onSignInWithBlink,
11181
11222
  onClose
11182
11223
  }) {
11183
- const { tokens } = useBlinkConfig();
11224
+ const { tokens, promoTagText } = useBlinkConfig();
11184
11225
  const [manualHovered, setManualHovered] = useState(false);
11185
11226
  const [manualPressed, setManualPressed] = useState(false);
11186
11227
  return /* @__PURE__ */ jsxs(ScreenLayout, { hideScrollbar: true, children: [
@@ -11203,7 +11244,7 @@ function DepositOptionsScreen({
11203
11244
  /* @__PURE__ */ jsxs("div", { style: contentStyle2, children: [
11204
11245
  /* @__PURE__ */ jsx("img", { src: BLINK_PASSKEY_ILLUSTRATION, alt: "", "aria-hidden": "true", style: heroStyle }),
11205
11246
  /* @__PURE__ */ jsxs("div", { style: stackStyle, children: [
11206
- /* @__PURE__ */ jsx(BlinkDepositButton, { onClick: onSignInWithBlink }),
11247
+ /* @__PURE__ */ jsx(BlinkDepositButton, { onClick: onSignInWithBlink, promoTagText }),
11207
11248
  /* @__PURE__ */ jsxs("div", { style: dividerRowStyle, children: [
11208
11249
  /* @__PURE__ */ jsx("span", { style: dividerRuleStyle(tokens.textTertiary) }),
11209
11250
  /* @__PURE__ */ jsx("span", { style: dividerLabelStyle(tokens.textTertiary), children: "OR" }),
@@ -11333,7 +11374,7 @@ function WelcomeBackScreen({
11333
11374
  onComplete,
11334
11375
  onClose
11335
11376
  }) {
11336
- const { tokens } = useBlinkConfig();
11377
+ const { tokens, promoTagText } = useBlinkConfig();
11337
11378
  const [depositHovered, setDepositHovered] = useState(false);
11338
11379
  const [depositPressed, setDepositPressed] = useState(false);
11339
11380
  const [manualHovered, setManualHovered] = useState(false);
@@ -11390,7 +11431,15 @@ function WelcomeBackScreen({
11390
11431
  ),
11391
11432
  /* @__PURE__ */ jsx("img", { src: TETHER_LOGO, alt: "", "aria-hidden": "true", style: coinStyle2 })
11392
11433
  ] })
11393
- ] })
11434
+ ] }),
11435
+ promoTagText ? /* @__PURE__ */ jsx(
11436
+ PromoTagBadge,
11437
+ {
11438
+ text: promoTagText,
11439
+ background: tokens.highlight,
11440
+ color: tokens.text
11441
+ }
11442
+ ) : null
11394
11443
  ]
11395
11444
  }
11396
11445
  ),
@@ -11475,6 +11524,8 @@ var stackStyle2 = {
11475
11524
  width: "100%"
11476
11525
  };
11477
11526
  var depositFrameStyle = (bg, hovered, pressed) => ({
11527
+ // Anchor for the optional PromoTagBadge, which overflows the frame's bottom edge.
11528
+ position: "relative",
11478
11529
  display: "flex",
11479
11530
  flexDirection: "column",
11480
11531
  alignItems: "stretch",