@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.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
|
|
@@ -9184,7 +9186,40 @@ var CHAIN_LOGOS = {
|
|
|
9184
9186
|
solana: SOLANA_CHAIN_LOGO,
|
|
9185
9187
|
"solana mainnet": SOLANA_CHAIN_LOGO
|
|
9186
9188
|
};
|
|
9187
|
-
function
|
|
9189
|
+
function PromoTagBadge({ text, background, color }) {
|
|
9190
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { style: badgeStyle2(background, color), children: text });
|
|
9191
|
+
}
|
|
9192
|
+
var badgeStyle2 = (background, color) => ({
|
|
9193
|
+
position: "absolute",
|
|
9194
|
+
left: "50%",
|
|
9195
|
+
bottom: -9,
|
|
9196
|
+
// Paint above the coin marks' isolated stack (zIndex 1) inside the button.
|
|
9197
|
+
zIndex: 2,
|
|
9198
|
+
display: "inline-block",
|
|
9199
|
+
// The config API allows up to 50 chars; keep the sticker inside the button's
|
|
9200
|
+
// edges and ellipsize anything that doesn't fit.
|
|
9201
|
+
maxWidth: "calc(100% - 24px)",
|
|
9202
|
+
overflow: "hidden",
|
|
9203
|
+
textOverflow: "ellipsis",
|
|
9204
|
+
boxSizing: "border-box",
|
|
9205
|
+
background,
|
|
9206
|
+
color,
|
|
9207
|
+
fontSize: 12,
|
|
9208
|
+
fontWeight: 500,
|
|
9209
|
+
lineHeight: 1,
|
|
9210
|
+
padding: "4px 8px",
|
|
9211
|
+
borderRadius: 6,
|
|
9212
|
+
whiteSpace: "nowrap",
|
|
9213
|
+
transform: "translateX(-50%) rotate(-6.75deg)",
|
|
9214
|
+
boxShadow: "0 2px 4px rgba(0, 0, 0, 0.16)",
|
|
9215
|
+
pointerEvents: "none"
|
|
9216
|
+
});
|
|
9217
|
+
function BlinkDepositButton({
|
|
9218
|
+
onClick,
|
|
9219
|
+
disabled,
|
|
9220
|
+
loading,
|
|
9221
|
+
promoTagText
|
|
9222
|
+
}) {
|
|
9188
9223
|
const config = useOptionalBlinkConfig();
|
|
9189
9224
|
const tokens = config?.tokens ?? lightThemeNew;
|
|
9190
9225
|
const [hovered, setHovered] = react.useState(false);
|
|
@@ -9220,12 +9255,15 @@ function BlinkDepositButton({ onClick, disabled, loading }) {
|
|
|
9220
9255
|
}
|
|
9221
9256
|
),
|
|
9222
9257
|
/* @__PURE__ */ jsxRuntime.jsx("img", { src: TETHER_LOGO, alt: "", "aria-hidden": "true", style: coinStyle })
|
|
9223
|
-
] })
|
|
9258
|
+
] }),
|
|
9259
|
+
promoTagText ? /* @__PURE__ */ jsxRuntime.jsx(PromoTagBadge, { text: promoTagText, background: tokens.highlight, color: tokens.text }) : null
|
|
9224
9260
|
]
|
|
9225
9261
|
}
|
|
9226
9262
|
);
|
|
9227
9263
|
}
|
|
9228
9264
|
var pillStyle = (tokens, state) => ({
|
|
9265
|
+
// Anchor for the optional PromoTagBadge, which overflows the bottom edge.
|
|
9266
|
+
position: "relative",
|
|
9229
9267
|
display: "flex",
|
|
9230
9268
|
alignItems: "center",
|
|
9231
9269
|
justifyContent: "space-between",
|
|
@@ -9648,7 +9686,7 @@ function StepList({
|
|
|
9648
9686
|
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
9687
|
"div",
|
|
9650
9688
|
{
|
|
9651
|
-
style:
|
|
9689
|
+
style: badgeStyle3(
|
|
9652
9690
|
isComplete || isActive ? tokens.accent : tokens.border,
|
|
9653
9691
|
isComplete,
|
|
9654
9692
|
dims.badge
|
|
@@ -9737,7 +9775,7 @@ var rowStyle2 = (gap) => ({
|
|
|
9737
9775
|
alignItems: "center",
|
|
9738
9776
|
gap
|
|
9739
9777
|
});
|
|
9740
|
-
var
|
|
9778
|
+
var badgeStyle3 = (color, filled, size) => ({
|
|
9741
9779
|
width: size,
|
|
9742
9780
|
height: size,
|
|
9743
9781
|
borderRadius: "50%",
|
|
@@ -11204,7 +11242,7 @@ function DepositOptionsScreen({
|
|
|
11204
11242
|
onSignInWithBlink,
|
|
11205
11243
|
onClose
|
|
11206
11244
|
}) {
|
|
11207
|
-
const { tokens } = useBlinkConfig();
|
|
11245
|
+
const { tokens, promoTagText } = useBlinkConfig();
|
|
11208
11246
|
const [manualHovered, setManualHovered] = react.useState(false);
|
|
11209
11247
|
const [manualPressed, setManualPressed] = react.useState(false);
|
|
11210
11248
|
return /* @__PURE__ */ jsxRuntime.jsxs(ScreenLayout, { hideScrollbar: true, children: [
|
|
@@ -11227,7 +11265,7 @@ function DepositOptionsScreen({
|
|
|
11227
11265
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: contentStyle2, children: [
|
|
11228
11266
|
/* @__PURE__ */ jsxRuntime.jsx("img", { src: BLINK_PASSKEY_ILLUSTRATION, alt: "", "aria-hidden": "true", style: heroStyle }),
|
|
11229
11267
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: stackStyle, children: [
|
|
11230
|
-
/* @__PURE__ */ jsxRuntime.jsx(BlinkDepositButton, { onClick: onSignInWithBlink }),
|
|
11268
|
+
/* @__PURE__ */ jsxRuntime.jsx(BlinkDepositButton, { onClick: onSignInWithBlink, promoTagText }),
|
|
11231
11269
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: dividerRowStyle, children: [
|
|
11232
11270
|
/* @__PURE__ */ jsxRuntime.jsx("span", { style: dividerRuleStyle(tokens.textTertiary) }),
|
|
11233
11271
|
/* @__PURE__ */ jsxRuntime.jsx("span", { style: dividerLabelStyle(tokens.textTertiary), children: "OR" }),
|
|
@@ -11357,7 +11395,7 @@ function WelcomeBackScreen({
|
|
|
11357
11395
|
onComplete,
|
|
11358
11396
|
onClose
|
|
11359
11397
|
}) {
|
|
11360
|
-
const { tokens } = useBlinkConfig();
|
|
11398
|
+
const { tokens, promoTagText } = useBlinkConfig();
|
|
11361
11399
|
const [depositHovered, setDepositHovered] = react.useState(false);
|
|
11362
11400
|
const [depositPressed, setDepositPressed] = react.useState(false);
|
|
11363
11401
|
const [manualHovered, setManualHovered] = react.useState(false);
|
|
@@ -11414,7 +11452,15 @@ function WelcomeBackScreen({
|
|
|
11414
11452
|
),
|
|
11415
11453
|
/* @__PURE__ */ jsxRuntime.jsx("img", { src: TETHER_LOGO, alt: "", "aria-hidden": "true", style: coinStyle2 })
|
|
11416
11454
|
] })
|
|
11417
|
-
] })
|
|
11455
|
+
] }),
|
|
11456
|
+
promoTagText ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11457
|
+
PromoTagBadge,
|
|
11458
|
+
{
|
|
11459
|
+
text: promoTagText,
|
|
11460
|
+
background: tokens.highlight,
|
|
11461
|
+
color: tokens.text
|
|
11462
|
+
}
|
|
11463
|
+
) : null
|
|
11418
11464
|
]
|
|
11419
11465
|
}
|
|
11420
11466
|
),
|
|
@@ -11499,6 +11545,8 @@ var stackStyle2 = {
|
|
|
11499
11545
|
width: "100%"
|
|
11500
11546
|
};
|
|
11501
11547
|
var depositFrameStyle = (bg, hovered, pressed) => ({
|
|
11548
|
+
// Anchor for the optional PromoTagBadge, which overflows the frame's bottom edge.
|
|
11549
|
+
position: "relative",
|
|
11502
11550
|
display: "flex",
|
|
11503
11551
|
flexDirection: "column",
|
|
11504
11552
|
alignItems: "stretch",
|