@swype-org/react-sdk 0.1.31 → 0.1.32

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.js CHANGED
@@ -1798,7 +1798,7 @@ function LimitSlider({
1798
1798
  (e) => onChange(Number(e.target.value)),
1799
1799
  [onChange]
1800
1800
  );
1801
- return /* @__PURE__ */ jsxs("div", { style: wrapperStyle, children: [
1801
+ return /* @__PURE__ */ jsxs("div", { className: "swype-slider-wrap", style: wrapperStyle, children: [
1802
1802
  /* @__PURE__ */ jsxs("div", { style: trackContainerStyle, children: [
1803
1803
  /* @__PURE__ */ jsx("div", { style: trackBgStyle(tokens.border) }),
1804
1804
  /* @__PURE__ */ jsx("div", { style: trackFillStyle(tokens.accent, pct) }),
@@ -1812,7 +1812,7 @@ function LimitSlider({
1812
1812
  value,
1813
1813
  onChange: handleChange,
1814
1814
  disabled,
1815
- style: rangeInputStyle(tokens.accent)
1815
+ style: rangeInputStyle
1816
1816
  }
1817
1817
  )
1818
1818
  ] }),
@@ -1846,17 +1846,19 @@ var trackFillStyle = (color, pct) => ({
1846
1846
  borderRadius: 2,
1847
1847
  background: color
1848
1848
  });
1849
- var rangeInputStyle = (_accent) => ({
1849
+ var rangeInputStyle = {
1850
1850
  position: "absolute",
1851
1851
  left: 0,
1852
1852
  right: 0,
1853
1853
  width: "100%",
1854
1854
  height: 28,
1855
1855
  margin: 0,
1856
- opacity: 0,
1857
1856
  cursor: "pointer",
1858
- zIndex: 2
1859
- });
1857
+ zIndex: 2,
1858
+ WebkitAppearance: "none",
1859
+ appearance: "none",
1860
+ background: "transparent"
1861
+ };
1860
1862
  var ticksStyle = {
1861
1863
  display: "flex",
1862
1864
  justifyContent: "space-between",
@@ -1868,10 +1870,8 @@ var tickLabelStyle = (color) => ({
1868
1870
  color
1869
1871
  });
1870
1872
  var sliderThumbCss = (accent) => `
1871
- .swype-slider-wrap input[type="range"] {
1872
- -webkit-appearance: none;
1873
- appearance: none;
1874
- opacity: 1 !important;
1873
+ .swype-slider-wrap input[type="range"]::-webkit-slider-runnable-track {
1874
+ height: 4px;
1875
1875
  background: transparent;
1876
1876
  }
1877
1877
  .swype-slider-wrap input[type="range"]::-webkit-slider-thumb {
@@ -1883,6 +1883,21 @@ var sliderThumbCss = (accent) => `
1883
1883
  border: 3px solid #fff;
1884
1884
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
1885
1885
  cursor: pointer;
1886
+ margin-top: -8px;
1887
+ }
1888
+ .swype-slider-wrap input[type="range"]::-moz-range-track {
1889
+ height: 4px;
1890
+ background: transparent;
1891
+ border: none;
1892
+ }
1893
+ .swype-slider-wrap input[type="range"]::-moz-range-thumb {
1894
+ width: 14px;
1895
+ height: 14px;
1896
+ border-radius: 50%;
1897
+ background: ${accent};
1898
+ border: 3px solid #fff;
1899
+ box-shadow: 0 2px 6px rgba(0,0,0,0.15);
1900
+ cursor: pointer;
1886
1901
  }
1887
1902
  `;
1888
1903
  function SourceCard({ name, address, verified, onChangeSource }) {
@@ -2013,6 +2028,87 @@ var detailStyle = (color) => ({
2013
2028
  fontSize: "0.75rem",
2014
2029
  color
2015
2030
  });
2031
+ function SettingsMenu({ onLogout }) {
2032
+ const { tokens } = useSwypeConfig();
2033
+ const [open, setOpen] = useState(false);
2034
+ const menuRef = useRef(null);
2035
+ const toggle = useCallback(() => setOpen((prev) => !prev), []);
2036
+ useEffect(() => {
2037
+ if (!open) return;
2038
+ const handleClickOutside = (e) => {
2039
+ if (menuRef.current && !menuRef.current.contains(e.target)) {
2040
+ setOpen(false);
2041
+ }
2042
+ };
2043
+ document.addEventListener("mousedown", handleClickOutside);
2044
+ return () => document.removeEventListener("mousedown", handleClickOutside);
2045
+ }, [open]);
2046
+ return /* @__PURE__ */ jsxs("div", { ref: menuRef, style: containerStyle7, children: [
2047
+ /* @__PURE__ */ jsx("button", { type: "button", onClick: toggle, style: triggerStyle(tokens.text), "aria-label": "Settings", children: /* @__PURE__ */ jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", children: [
2048
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "5", r: "2", fill: "currentColor" }),
2049
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "2", fill: "currentColor" }),
2050
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "19", r: "2", fill: "currentColor" })
2051
+ ] }) }),
2052
+ open && /* @__PURE__ */ jsx("div", { style: dropdownStyle(tokens), children: /* @__PURE__ */ jsxs(
2053
+ "button",
2054
+ {
2055
+ type: "button",
2056
+ onClick: () => {
2057
+ setOpen(false);
2058
+ onLogout();
2059
+ },
2060
+ style: menuItemStyle(tokens),
2061
+ children: [
2062
+ /* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", style: { marginRight: 8, flexShrink: 0 }, children: [
2063
+ /* @__PURE__ */ jsx("path", { d: "M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4", stroke: tokens.error, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
2064
+ /* @__PURE__ */ jsx("polyline", { points: "16 17 21 12 16 7", stroke: tokens.error, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
2065
+ /* @__PURE__ */ jsx("line", { x1: "21", y1: "12", x2: "9", y2: "12", stroke: tokens.error, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
2066
+ ] }),
2067
+ "Log out"
2068
+ ]
2069
+ }
2070
+ ) })
2071
+ ] });
2072
+ }
2073
+ var containerStyle7 = {
2074
+ position: "relative"
2075
+ };
2076
+ var triggerStyle = (color) => ({
2077
+ background: "transparent",
2078
+ border: "none",
2079
+ cursor: "pointer",
2080
+ padding: 4,
2081
+ color,
2082
+ display: "flex",
2083
+ alignItems: "center",
2084
+ justifyContent: "center"
2085
+ });
2086
+ var dropdownStyle = (tokens) => ({
2087
+ position: "absolute",
2088
+ right: 0,
2089
+ top: "100%",
2090
+ marginTop: 4,
2091
+ minWidth: 140,
2092
+ background: tokens.bgCard,
2093
+ border: `1px solid ${tokens.border}`,
2094
+ borderRadius: 12,
2095
+ boxShadow: tokens.shadow,
2096
+ zIndex: 100,
2097
+ overflow: "hidden"
2098
+ });
2099
+ var menuItemStyle = (tokens) => ({
2100
+ width: "100%",
2101
+ display: "flex",
2102
+ alignItems: "center",
2103
+ padding: "12px 16px",
2104
+ background: "transparent",
2105
+ border: "none",
2106
+ cursor: "pointer",
2107
+ fontFamily: "inherit",
2108
+ fontSize: "0.85rem",
2109
+ fontWeight: 500,
2110
+ color: tokens.error
2111
+ });
2016
2112
  function LoginScreen({
2017
2113
  authInput,
2018
2114
  onAuthInputChange,
@@ -2500,21 +2596,36 @@ var hintStyle2 = (color) => ({
2500
2596
  color,
2501
2597
  margin: "0 0 4px"
2502
2598
  });
2503
- var DEFAULT_TICKS = [25, 100, 250, 500];
2504
- var DEFAULT_MIN = 25;
2505
2599
  var DEFAULT_MAX = 500;
2600
+ var ABSOLUTE_MIN = 1;
2601
+ function buildTicks(min, max) {
2602
+ if (max <= min) return [min];
2603
+ const range = max - min;
2604
+ const candidates = [1, 2, 5, 10, 25, 50, 100, 250];
2605
+ const step = candidates.find((s) => range / s <= 5) ?? Math.ceil(range / 4);
2606
+ const ticks = [];
2607
+ for (let v = min; v <= max; v += step) {
2608
+ ticks.push(Math.round(v * 100) / 100);
2609
+ }
2610
+ if (ticks[ticks.length - 1] !== max) ticks.push(max);
2611
+ return ticks;
2612
+ }
2506
2613
  function SetupScreen({
2507
2614
  availableBalance,
2508
2615
  tokenCount,
2509
2616
  sourceName,
2510
2617
  onSetupOneTap,
2511
2618
  onBack,
2619
+ onLogout,
2512
2620
  loading,
2513
2621
  error
2514
2622
  }) {
2515
2623
  const { tokens } = useSwypeConfig();
2516
- const [limit, setLimit] = useState(100);
2517
2624
  const effectiveMax = Math.min(DEFAULT_MAX, availableBalance > 0 ? availableBalance : DEFAULT_MAX);
2625
+ const effectiveMin = Math.min(ABSOLUTE_MIN, effectiveMax);
2626
+ const sliderStep = effectiveMax <= 10 ? 0.5 : effectiveMax <= 50 ? 1 : 5;
2627
+ const ticks = buildTicks(effectiveMin, effectiveMax);
2628
+ const [limit, setLimit] = useState(() => Math.min(100, effectiveMax));
2518
2629
  return /* @__PURE__ */ jsxs(
2519
2630
  ScreenLayout,
2520
2631
  {
@@ -2531,7 +2642,7 @@ function SetupScreen({
2531
2642
  /* @__PURE__ */ jsx(PoweredByFooter, {})
2532
2643
  ] }),
2533
2644
  children: [
2534
- /* @__PURE__ */ jsx(ScreenHeader, { title: "Swype Setup", badge: "Simple", onBack }),
2645
+ /* @__PURE__ */ jsx(ScreenHeader, { title: "Swype Setup", badge: "Simple", onBack, right: /* @__PURE__ */ jsx(SettingsMenu, { onLogout }) }),
2535
2646
  /* @__PURE__ */ jsx("h2", { style: headingStyle5(tokens.text), children: "Set up One-Tap deposits" }),
2536
2647
  /* @__PURE__ */ jsx("p", { style: subtitleStyle5(tokens.textSecondary), children: "Set your limit for instant deposits. Like a contactless card \u2014 you choose the max." }),
2537
2648
  error && /* @__PURE__ */ jsx("div", { style: errorBannerStyle3(tokens), children: error }),
@@ -2566,10 +2677,10 @@ function SetupScreen({
2566
2677
  LimitSlider,
2567
2678
  {
2568
2679
  value: limit,
2569
- min: DEFAULT_MIN,
2680
+ min: effectiveMin,
2570
2681
  max: effectiveMax,
2571
- step: 5,
2572
- ticks: DEFAULT_TICKS.filter((t) => t <= effectiveMax),
2682
+ step: sliderStep,
2683
+ ticks,
2573
2684
  onChange: setLimit
2574
2685
  }
2575
2686
  )
@@ -2689,6 +2800,7 @@ function SetupStatusScreen({
2689
2800
  currentStepLabel,
2690
2801
  merchantName,
2691
2802
  onContinue,
2803
+ onLogout,
2692
2804
  error
2693
2805
  }) {
2694
2806
  const { tokens } = useSwypeConfig();
@@ -2706,26 +2818,29 @@ function SetupStatusScreen({
2706
2818
  },
2707
2819
  { label: "Done", status: "pending" }
2708
2820
  ];
2709
- return /* @__PURE__ */ jsx(
2821
+ return /* @__PURE__ */ jsxs(
2710
2822
  ScreenLayout,
2711
2823
  {
2712
2824
  footer: complete ? /* @__PURE__ */ jsxs(Fragment, { children: [
2713
2825
  /* @__PURE__ */ jsx(PrimaryButton, { onClick: onContinue, children: merchantName ? `Return to ${merchantName}` : "Continue" }),
2714
2826
  /* @__PURE__ */ jsx("p", { style: swipeHintStyle(tokens.textMuted), children: "Swipe to deposit \u2014 no approvals needed." })
2715
2827
  ] }) : void 0,
2716
- children: /* @__PURE__ */ jsxs("div", { style: contentStyle4, children: [
2717
- complete ? /* @__PURE__ */ jsxs(Fragment, { children: [
2718
- /* @__PURE__ */ jsx(IconCircle, { variant: "success", size: 64, children: /* @__PURE__ */ jsx("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z", fill: tokens.success }) }) }),
2719
- /* @__PURE__ */ jsx("h2", { style: headingStyle6(tokens.text), children: "You're all set!" })
2720
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
2721
- /* @__PURE__ */ jsx(Spinner, { size: 48 }),
2722
- /* @__PURE__ */ jsx("h2", { style: headingStyle6(tokens.text), children: "Setting up One-Tap..." })
2723
- ] }),
2724
- error && /* @__PURE__ */ jsx("div", { style: errorBannerStyle4(tokens), children: error }),
2725
- /* @__PURE__ */ jsx("div", { style: stepsWrapStyle, children: /* @__PURE__ */ jsx(StepList, { steps }) }),
2726
- !complete && /* @__PURE__ */ jsx("p", { style: waitHintStyle(tokens.textMuted), children: "Usually takes a few seconds" }),
2727
- complete && /* @__PURE__ */ jsx("p", { style: readyHintStyle(tokens.textSecondary), children: "You can now deposit instantly from any partner app." })
2728
- ] })
2828
+ children: [
2829
+ /* @__PURE__ */ jsx(ScreenHeader, { right: /* @__PURE__ */ jsx(SettingsMenu, { onLogout }) }),
2830
+ /* @__PURE__ */ jsxs("div", { style: contentStyle4, children: [
2831
+ complete ? /* @__PURE__ */ jsxs(Fragment, { children: [
2832
+ /* @__PURE__ */ jsx(IconCircle, { variant: "success", size: 64, children: /* @__PURE__ */ jsx("svg", { width: "32", height: "32", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z", fill: tokens.success }) }) }),
2833
+ /* @__PURE__ */ jsx("h2", { style: headingStyle6(tokens.text), children: "You're all set!" })
2834
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
2835
+ /* @__PURE__ */ jsx(Spinner, { size: 48 }),
2836
+ /* @__PURE__ */ jsx("h2", { style: headingStyle6(tokens.text), children: "Setting up One-Tap..." })
2837
+ ] }),
2838
+ error && /* @__PURE__ */ jsx("div", { style: errorBannerStyle4(tokens), children: error }),
2839
+ /* @__PURE__ */ jsx("div", { style: stepsWrapStyle, children: /* @__PURE__ */ jsx(StepList, { steps }) }),
2840
+ !complete && /* @__PURE__ */ jsx("p", { style: waitHintStyle(tokens.textMuted), children: "Usually takes a few seconds" }),
2841
+ complete && /* @__PURE__ */ jsx("p", { style: readyHintStyle(tokens.textSecondary), children: "You can now deposit instantly from any partner app." })
2842
+ ] })
2843
+ ]
2729
2844
  }
2730
2845
  );
2731
2846
  }
@@ -2798,7 +2913,8 @@ function DepositScreen({
2798
2913
  onDeposit,
2799
2914
  onChangeSource,
2800
2915
  onSwitchWallet,
2801
- onBack
2916
+ onBack,
2917
+ onLogout
2802
2918
  }) {
2803
2919
  const { tokens } = useSwypeConfig();
2804
2920
  const [amount, setAmount] = useState(initialAmount);
@@ -2806,30 +2922,6 @@ function DepositScreen({
2806
2922
  const isLowBalance = availableBalance < MIN_DEPOSIT;
2807
2923
  const canDeposit = amount >= MIN_DEPOSIT && amount <= remainingLimit && !isLowBalance && !processing;
2808
2924
  const headerTitle = merchantName ? `Deposit to ${merchantName}` : "Deposit";
2809
- const trackRef = useRef(null);
2810
- const [swipeX, setSwipeX] = useState(0);
2811
- const [swiping, setSwiping] = useState(false);
2812
- const startXRef = useRef(0);
2813
- const handleTouchStart = useCallback((e) => {
2814
- if (!canDeposit) return;
2815
- startXRef.current = e.touches[0].clientX - swipeX;
2816
- setSwiping(true);
2817
- }, [canDeposit, swipeX]);
2818
- const handleTouchMove = useCallback((e) => {
2819
- if (!swiping || !trackRef.current) return;
2820
- const trackWidth = trackRef.current.offsetWidth - 52;
2821
- const x = Math.max(0, Math.min(e.touches[0].clientX - startXRef.current, trackWidth));
2822
- setSwipeX(x);
2823
- }, [swiping]);
2824
- const handleTouchEnd = useCallback(() => {
2825
- if (!trackRef.current) return;
2826
- const trackWidth = trackRef.current.offsetWidth - 52;
2827
- if (swipeX > trackWidth * 0.75) {
2828
- onDeposit(amount);
2829
- }
2830
- setSwipeX(0);
2831
- setSwiping(false);
2832
- }, [swipeX, amount, onDeposit]);
2833
2925
  if (isLowBalance) {
2834
2926
  return /* @__PURE__ */ jsxs(
2835
2927
  ScreenLayout,
@@ -2841,7 +2933,7 @@ function DepositScreen({
2841
2933
  /* @__PURE__ */ jsx(PoweredByFooter, {})
2842
2934
  ] }),
2843
2935
  children: [
2844
- /* @__PURE__ */ jsx(ScreenHeader, { title: headerTitle, onBack }),
2936
+ /* @__PURE__ */ jsx(ScreenHeader, { title: headerTitle, onBack, right: /* @__PURE__ */ jsx(SettingsMenu, { onLogout }) }),
2845
2937
  /* @__PURE__ */ jsx(
2846
2938
  SourceCard,
2847
2939
  {
@@ -2886,30 +2978,10 @@ function DepositScreen({
2886
2978
  ScreenLayout,
2887
2979
  {
2888
2980
  footer: /* @__PURE__ */ jsxs(Fragment, { children: [
2889
- /* @__PURE__ */ jsxs(
2890
- "div",
2891
- {
2892
- ref: trackRef,
2893
- style: swipeTrackStyle(tokens),
2894
- onTouchStart: handleTouchStart,
2895
- onTouchMove: handleTouchMove,
2896
- onTouchEnd: handleTouchEnd,
2897
- children: [
2898
- /* @__PURE__ */ jsx(
2899
- "div",
2900
- {
2901
- style: swipeThumbStyle(tokens, swipeX),
2902
- children: /* @__PURE__ */ jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M8 5l8 7-8 7", stroke: "#fff", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
2903
- }
2904
- ),
2905
- /* @__PURE__ */ jsx("span", { style: swipeLabelStyle, children: processing ? "Processing..." : `Deposit $${amount.toFixed(2)}` })
2906
- ]
2907
- }
2908
- ),
2909
- /* @__PURE__ */ jsx("div", { style: desktopFallbackStyle, children: /* @__PURE__ */ jsxs(PrimaryButton, { onClick: () => onDeposit(amount), disabled: !canDeposit, loading: processing, children: [
2981
+ /* @__PURE__ */ jsxs(PrimaryButton, { onClick: () => onDeposit(amount), disabled: !canDeposit, loading: processing, children: [
2910
2982
  "Deposit $",
2911
2983
  amount.toFixed(2)
2912
- ] }) }),
2984
+ ] }),
2913
2985
  /* @__PURE__ */ jsx("p", { style: noApprovalStyle(tokens.textMuted), children: "No approval needed \xB7 within your One-Tap limit" }),
2914
2986
  /* @__PURE__ */ jsxs("p", { style: routeStyle(tokens.textMuted), children: [
2915
2987
  "From ",
@@ -2920,7 +2992,7 @@ function DepositScreen({
2920
2992
  /* @__PURE__ */ jsx(PoweredByFooter, {})
2921
2993
  ] }),
2922
2994
  children: [
2923
- /* @__PURE__ */ jsx(ScreenHeader, { title: headerTitle, badge: "Simple", onBack }),
2995
+ /* @__PURE__ */ jsx(ScreenHeader, { title: headerTitle, badge: "Simple", onBack, right: /* @__PURE__ */ jsx(SettingsMenu, { onLogout }) }),
2924
2996
  /* @__PURE__ */ jsx(
2925
2997
  SourceCard,
2926
2998
  {
@@ -3063,45 +3135,6 @@ var errorBannerStyle5 = (tokens) => ({
3063
3135
  marginTop: 8,
3064
3136
  lineHeight: 1.5
3065
3137
  });
3066
- var swipeTrackStyle = (tokens) => ({
3067
- position: "relative",
3068
- height: 56,
3069
- borderRadius: 999,
3070
- background: `linear-gradient(180deg, ${tokens.accent}, ${tokens.accent}dd)`,
3071
- overflow: "hidden",
3072
- display: "flex",
3073
- alignItems: "center",
3074
- touchAction: "none",
3075
- userSelect: "none"
3076
- });
3077
- var swipeThumbStyle = (tokens, x) => ({
3078
- position: "absolute",
3079
- left: 4 + x,
3080
- top: 4,
3081
- width: 48,
3082
- height: 48,
3083
- borderRadius: "50%",
3084
- background: `${tokens.accent}`,
3085
- border: "2px solid rgba(255,255,255,0.4)",
3086
- display: "flex",
3087
- alignItems: "center",
3088
- justifyContent: "center",
3089
- zIndex: 2,
3090
- transition: x === 0 ? "left 0.25s ease" : "none",
3091
- cursor: "grab"
3092
- });
3093
- var swipeLabelStyle = {
3094
- flex: 1,
3095
- textAlign: "center",
3096
- color: "#fff",
3097
- fontWeight: 700,
3098
- fontSize: "0.95rem",
3099
- zIndex: 1,
3100
- pointerEvents: "none"
3101
- };
3102
- var desktopFallbackStyle = {
3103
- marginTop: 8
3104
- };
3105
3138
  var noApprovalStyle = (color) => ({
3106
3139
  textAlign: "center",
3107
3140
  fontSize: "0.78rem",
@@ -3130,6 +3163,7 @@ function SuccessScreen({
3130
3163
  sourceName,
3131
3164
  remainingLimit,
3132
3165
  onDone,
3166
+ onLogout,
3133
3167
  onIncreaseLimits,
3134
3168
  onManageAccount
3135
3169
  }) {
@@ -3146,7 +3180,7 @@ function SuccessScreen({
3146
3180
  /* @__PURE__ */ jsx(
3147
3181
  ScreenHeader,
3148
3182
  {
3149
- right: /* @__PURE__ */ jsx("button", { type: "button", onClick: onDone, style: closeButtonStyle(tokens.textMuted), "aria-label": "Close", children: /* @__PURE__ */ jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M18 6L6 18M6 6l12 12", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }) })
3183
+ right: /* @__PURE__ */ jsx(SettingsMenu, { onLogout })
3150
3184
  }
3151
3185
  ),
3152
3186
  /* @__PURE__ */ jsxs("div", { style: contentStyle5, children: [
@@ -3262,15 +3296,6 @@ var upsellLinkStyle = (color) => ({
3262
3296
  fontFamily: "inherit",
3263
3297
  padding: 0
3264
3298
  });
3265
- var closeButtonStyle = (color) => ({
3266
- background: "transparent",
3267
- border: "none",
3268
- cursor: "pointer",
3269
- color,
3270
- padding: 4,
3271
- display: "flex",
3272
- alignItems: "center"
3273
- });
3274
3299
  var manageStyle = (color) => ({
3275
3300
  background: "transparent",
3276
3301
  border: "none",
@@ -3849,13 +3874,14 @@ function SwypePayment({
3849
3874
  if (!sourceId) {
3850
3875
  throw new Error("No wallet selected for setup.");
3851
3876
  }
3877
+ const setupAmount = depositAmount ?? MIN_SEND_AMOUNT_USD;
3852
3878
  const t = await createTransfer(apiBaseUrl, token, {
3853
3879
  credentialId: activeCredentialId ?? "",
3854
3880
  merchantAuthorization,
3855
3881
  sourceType,
3856
3882
  sourceId,
3857
3883
  destination,
3858
- amount: 0
3884
+ amount: setupAmount
3859
3885
  });
3860
3886
  if (t.authorizationSessions && t.authorizationSessions.length > 0) {
3861
3887
  const shouldUseConnector = shouldUseWalletConnector({
@@ -3886,7 +3912,8 @@ function SwypePayment({
3886
3912
  merchantAuthorization,
3887
3913
  useWalletConnector,
3888
3914
  authExecutor,
3889
- onError
3915
+ onError,
3916
+ depositAmount
3890
3917
  ]);
3891
3918
  const handleSelectProvider = useCallback((providerId) => {
3892
3919
  setSelectedProviderId(providerId);
@@ -4005,6 +4032,7 @@ function SwypePayment({
4005
4032
  sourceName,
4006
4033
  onSetupOneTap: handleSetupOneTap,
4007
4034
  onBack: () => setStep("wallet-picker"),
4035
+ onLogout: handleLogout,
4008
4036
  loading: loadingData,
4009
4037
  error
4010
4038
  }
@@ -4020,6 +4048,7 @@ function SwypePayment({
4020
4048
  currentStepLabel: setupStepLabel,
4021
4049
  merchantName,
4022
4050
  onContinue: () => setStep("deposit"),
4051
+ onLogout: handleLogout,
4023
4052
  error
4024
4053
  }
4025
4054
  );
@@ -4047,7 +4076,8 @@ function SwypePayment({
4047
4076
  onDeposit: handlePay,
4048
4077
  onChangeSource: () => setStep("wallet-picker"),
4049
4078
  onSwitchWallet: () => setStep("wallet-picker"),
4050
- onBack: onBack ?? (() => handleLogout())
4079
+ onBack: onBack ?? (() => handleLogout()),
4080
+ onLogout: handleLogout
4051
4081
  }
4052
4082
  );
4053
4083
  }
@@ -4083,7 +4113,8 @@ function SwypePayment({
4083
4113
  merchantName,
4084
4114
  sourceName,
4085
4115
  remainingLimit: oneTapLimit > displayAmount ? oneTapLimit - displayAmount : 0,
4086
- onDone: handleNewPayment
4116
+ onDone: handleNewPayment,
4117
+ onLogout: handleLogout
4087
4118
  }
4088
4119
  );
4089
4120
  }
@@ -4104,7 +4135,8 @@ function SwypePayment({
4104
4135
  onDeposit: handlePay,
4105
4136
  onChangeSource: () => setStep("wallet-picker"),
4106
4137
  onSwitchWallet: () => setStep("wallet-picker"),
4107
- onBack: onBack ?? (() => handleLogout())
4138
+ onBack: onBack ?? (() => handleLogout()),
4139
+ onLogout: handleLogout
4108
4140
  }
4109
4141
  );
4110
4142
  }