@swype-org/react-sdk 0.2.359 → 0.2.360
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 +57 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -2
- package/dist/index.d.ts +19 -2
- package/dist/index.js +57 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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
|
|
@@ -9160,7 +9162,40 @@ var CHAIN_LOGOS = {
|
|
|
9160
9162
|
solana: SOLANA_CHAIN_LOGO,
|
|
9161
9163
|
"solana mainnet": SOLANA_CHAIN_LOGO
|
|
9162
9164
|
};
|
|
9163
|
-
function
|
|
9165
|
+
function PromoTagBadge({ text, background, color }) {
|
|
9166
|
+
return /* @__PURE__ */ jsx("span", { style: badgeStyle2(background, color), children: text });
|
|
9167
|
+
}
|
|
9168
|
+
var badgeStyle2 = (background, color) => ({
|
|
9169
|
+
position: "absolute",
|
|
9170
|
+
left: "50%",
|
|
9171
|
+
bottom: -9,
|
|
9172
|
+
// Paint above the coin marks' isolated stack (zIndex 1) inside the button.
|
|
9173
|
+
zIndex: 2,
|
|
9174
|
+
display: "inline-block",
|
|
9175
|
+
// The config API allows up to 50 chars; keep the sticker inside the button's
|
|
9176
|
+
// edges and ellipsize anything that doesn't fit.
|
|
9177
|
+
maxWidth: "calc(100% - 24px)",
|
|
9178
|
+
overflow: "hidden",
|
|
9179
|
+
textOverflow: "ellipsis",
|
|
9180
|
+
boxSizing: "border-box",
|
|
9181
|
+
background,
|
|
9182
|
+
color,
|
|
9183
|
+
fontSize: 12,
|
|
9184
|
+
fontWeight: 500,
|
|
9185
|
+
lineHeight: 1,
|
|
9186
|
+
padding: "4px 8px",
|
|
9187
|
+
borderRadius: 6,
|
|
9188
|
+
whiteSpace: "nowrap",
|
|
9189
|
+
transform: "translateX(-50%) rotate(-6.75deg)",
|
|
9190
|
+
boxShadow: "0 2px 4px rgba(0, 0, 0, 0.16)",
|
|
9191
|
+
pointerEvents: "none"
|
|
9192
|
+
});
|
|
9193
|
+
function BlinkDepositButton({
|
|
9194
|
+
onClick,
|
|
9195
|
+
disabled,
|
|
9196
|
+
loading,
|
|
9197
|
+
promoTagText
|
|
9198
|
+
}) {
|
|
9164
9199
|
const config = useOptionalBlinkConfig();
|
|
9165
9200
|
const tokens = config?.tokens ?? lightThemeNew;
|
|
9166
9201
|
const [hovered, setHovered] = useState(false);
|
|
@@ -9196,12 +9231,15 @@ function BlinkDepositButton({ onClick, disabled, loading }) {
|
|
|
9196
9231
|
}
|
|
9197
9232
|
),
|
|
9198
9233
|
/* @__PURE__ */ jsx("img", { src: TETHER_LOGO, alt: "", "aria-hidden": "true", style: coinStyle })
|
|
9199
|
-
] })
|
|
9234
|
+
] }),
|
|
9235
|
+
promoTagText ? /* @__PURE__ */ jsx(PromoTagBadge, { text: promoTagText, background: tokens.highlight, color: tokens.text }) : null
|
|
9200
9236
|
]
|
|
9201
9237
|
}
|
|
9202
9238
|
);
|
|
9203
9239
|
}
|
|
9204
9240
|
var pillStyle = (tokens, state) => ({
|
|
9241
|
+
// Anchor for the optional PromoTagBadge, which overflows the bottom edge.
|
|
9242
|
+
position: "relative",
|
|
9205
9243
|
display: "flex",
|
|
9206
9244
|
alignItems: "center",
|
|
9207
9245
|
justifyContent: "space-between",
|
|
@@ -9624,7 +9662,7 @@ function StepList({
|
|
|
9624
9662
|
showSpinner ? /* @__PURE__ */ jsx(StepSpinner, { size: dims.badge, color: tokens.accent }) : showRecessedPending ? /* @__PURE__ */ jsx("div", { style: pendingDotStyle(tokens.bgRecessed, dims.badge) }) : /* @__PURE__ */ jsx(
|
|
9625
9663
|
"div",
|
|
9626
9664
|
{
|
|
9627
|
-
style:
|
|
9665
|
+
style: badgeStyle3(
|
|
9628
9666
|
isComplete || isActive ? tokens.accent : tokens.border,
|
|
9629
9667
|
isComplete,
|
|
9630
9668
|
dims.badge
|
|
@@ -9713,7 +9751,7 @@ var rowStyle2 = (gap) => ({
|
|
|
9713
9751
|
alignItems: "center",
|
|
9714
9752
|
gap
|
|
9715
9753
|
});
|
|
9716
|
-
var
|
|
9754
|
+
var badgeStyle3 = (color, filled, size) => ({
|
|
9717
9755
|
width: size,
|
|
9718
9756
|
height: size,
|
|
9719
9757
|
borderRadius: "50%",
|
|
@@ -11180,7 +11218,7 @@ function DepositOptionsScreen({
|
|
|
11180
11218
|
onSignInWithBlink,
|
|
11181
11219
|
onClose
|
|
11182
11220
|
}) {
|
|
11183
|
-
const { tokens } = useBlinkConfig();
|
|
11221
|
+
const { tokens, promoTagText } = useBlinkConfig();
|
|
11184
11222
|
const [manualHovered, setManualHovered] = useState(false);
|
|
11185
11223
|
const [manualPressed, setManualPressed] = useState(false);
|
|
11186
11224
|
return /* @__PURE__ */ jsxs(ScreenLayout, { hideScrollbar: true, children: [
|
|
@@ -11203,7 +11241,7 @@ function DepositOptionsScreen({
|
|
|
11203
11241
|
/* @__PURE__ */ jsxs("div", { style: contentStyle2, children: [
|
|
11204
11242
|
/* @__PURE__ */ jsx("img", { src: BLINK_PASSKEY_ILLUSTRATION, alt: "", "aria-hidden": "true", style: heroStyle }),
|
|
11205
11243
|
/* @__PURE__ */ jsxs("div", { style: stackStyle, children: [
|
|
11206
|
-
/* @__PURE__ */ jsx(BlinkDepositButton, { onClick: onSignInWithBlink }),
|
|
11244
|
+
/* @__PURE__ */ jsx(BlinkDepositButton, { onClick: onSignInWithBlink, promoTagText }),
|
|
11207
11245
|
/* @__PURE__ */ jsxs("div", { style: dividerRowStyle, children: [
|
|
11208
11246
|
/* @__PURE__ */ jsx("span", { style: dividerRuleStyle(tokens.textTertiary) }),
|
|
11209
11247
|
/* @__PURE__ */ jsx("span", { style: dividerLabelStyle(tokens.textTertiary), children: "OR" }),
|
|
@@ -11333,7 +11371,7 @@ function WelcomeBackScreen({
|
|
|
11333
11371
|
onComplete,
|
|
11334
11372
|
onClose
|
|
11335
11373
|
}) {
|
|
11336
|
-
const { tokens } = useBlinkConfig();
|
|
11374
|
+
const { tokens, promoTagText } = useBlinkConfig();
|
|
11337
11375
|
const [depositHovered, setDepositHovered] = useState(false);
|
|
11338
11376
|
const [depositPressed, setDepositPressed] = useState(false);
|
|
11339
11377
|
const [manualHovered, setManualHovered] = useState(false);
|
|
@@ -11390,7 +11428,15 @@ function WelcomeBackScreen({
|
|
|
11390
11428
|
),
|
|
11391
11429
|
/* @__PURE__ */ jsx("img", { src: TETHER_LOGO, alt: "", "aria-hidden": "true", style: coinStyle2 })
|
|
11392
11430
|
] })
|
|
11393
|
-
] })
|
|
11431
|
+
] }),
|
|
11432
|
+
promoTagText ? /* @__PURE__ */ jsx(
|
|
11433
|
+
PromoTagBadge,
|
|
11434
|
+
{
|
|
11435
|
+
text: promoTagText,
|
|
11436
|
+
background: tokens.highlight,
|
|
11437
|
+
color: tokens.text
|
|
11438
|
+
}
|
|
11439
|
+
) : null
|
|
11394
11440
|
]
|
|
11395
11441
|
}
|
|
11396
11442
|
),
|
|
@@ -11475,6 +11521,8 @@ var stackStyle2 = {
|
|
|
11475
11521
|
width: "100%"
|
|
11476
11522
|
};
|
|
11477
11523
|
var depositFrameStyle = (bg, hovered, pressed) => ({
|
|
11524
|
+
// Anchor for the optional PromoTagBadge, which overflows the frame's bottom edge.
|
|
11525
|
+
position: "relative",
|
|
11478
11526
|
display: "flex",
|
|
11479
11527
|
flexDirection: "column",
|
|
11480
11528
|
alignItems: "stretch",
|