@superlogic/spree-pay 0.4.12 → 0.4.14

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Iframe3ds
3
- } from "./chunk-JXZZJ7NS.js";
3
+ } from "./chunk-VZWGJKM3.js";
4
4
  import {
5
5
  InfoBanner,
6
6
  Legal,
@@ -12,7 +12,7 @@ import {
12
12
  useSpreePayRegister,
13
13
  useSpreePaymentMethod,
14
14
  useStaticConfig
15
- } from "./chunk-WRFG6YIS.js";
15
+ } from "./chunk-XFJYLJZ4.js";
16
16
 
17
17
  // src/components/CryptoComTab/CryptoComTab.tsx
18
18
  import { useCallback, useEffect } from "react";
@@ -2,7 +2,7 @@ import {
2
2
  CheckoutButton,
3
3
  PointsSwitch,
4
4
  cn as cn2
5
- } from "./chunk-RORSHUSF.js";
5
+ } from "./chunk-UT65MGD2.js";
6
6
  import {
7
7
  Dialog,
8
8
  DialogContent,
@@ -16,7 +16,7 @@ import {
16
16
  useSpreePayConfig,
17
17
  useSpreePayRegister,
18
18
  useSpreePaymentMethod
19
- } from "./chunk-WRFG6YIS.js";
19
+ } from "./chunk-XFJYLJZ4.js";
20
20
 
21
21
  // src/components/CryptoTab/Crypto/CryptoWrapper.tsx
22
22
  import { useMemo as useMemo2 } from "react";
@@ -6,7 +6,7 @@ import {
6
6
  useSpreePayEnv,
7
7
  useSpreePaymentMethod,
8
8
  useStaticConfig
9
- } from "./chunk-WRFG6YIS.js";
9
+ } from "./chunk-XFJYLJZ4.js";
10
10
 
11
11
  // src/components/common/PointsSwitch.tsx
12
12
  import { useId } from "react";
@@ -257,15 +257,12 @@ var CheckoutButton = ({ isLoggedIn }) => {
257
257
  const checkoutClass = "text-(--inverse) h-14 leading-14 w-full cursor-pointer rounded-4xl bg-(--s-brand) hover:bg-(--s-brand-hover) px-4 text-center text-xl leading-6 font-medium disabled:cursor-not-allowed disabled:bg-(--s-disabled) disabled:text-(--disabled)";
258
258
  return /* @__PURE__ */ jsxs3("div", { className: "flex w-full flex-col gap-4 p-6 text-xs leading-5 font-medium text-(--secondary) md:px-7", children: [
259
259
  /* @__PURE__ */ jsx5(Legal, {}),
260
- isLoggedIn ? /* @__PURE__ */ jsx5(Fragment, { children: onProcess && /* @__PURE__ */ jsx5("button", { disabled: isDisabled, onClick: onProcess, className: checkoutClass, children: getCheckoutContent() }) }) : /* @__PURE__ */ jsxs3(
260
+ isLoggedIn ? /* @__PURE__ */ jsx5(Fragment, { children: onProcess && /* @__PURE__ */ jsx5("button", { disabled: isDisabled, onClick: onProcess, className: checkoutClass, children: getCheckoutContent() }) }) : /* @__PURE__ */ jsx5(
261
261
  "a",
262
262
  {
263
263
  href: `${staticConfig.keycloakUrl}/realms/${tenantId}/protocol/openid-connect/auth?client_id=${keycloakClientId ?? "oneof-next"}&response_type=code&redirect_uri=${window.location.href}`,
264
264
  className: checkoutClass,
265
- children: [
266
- "Log in / Sign up",
267
- tenantId === "moca" ? " for an AIR account" : ""
268
- ]
265
+ children: spreePayConfig?.loginLabel || "Log in / Sign up"
269
266
  }
270
267
  ),
271
268
  /* @__PURE__ */ jsxs3("a", { href: "https://www.spree.finance/", className: "flex items-center justify-center gap-2 hover:underline", children: [
@@ -3,7 +3,7 @@ import {
3
3
  DialogContent,
4
4
  DialogDescription,
5
5
  DialogTitle
6
- } from "./chunk-WRFG6YIS.js";
6
+ } from "./chunk-XFJYLJZ4.js";
7
7
 
8
8
  // src/modals/Iframe3ds.tsx
9
9
  import { useEffect } from "react";
@@ -10,7 +10,7 @@ var PaymentType = /* @__PURE__ */ ((PaymentType2) => {
10
10
  })(PaymentType || {});
11
11
 
12
12
  // package.json
13
- var version = "0.4.12";
13
+ var version = "0.4.14";
14
14
 
15
15
  // src/utils/logger.ts
16
16
  var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
package/build/index.cjs CHANGED
@@ -69,7 +69,7 @@ var init_payments = __esm({
69
69
  var version;
70
70
  var init_package = __esm({
71
71
  "package.json"() {
72
- version = "0.4.12";
72
+ version = "0.4.14";
73
73
  }
74
74
  });
75
75
 
@@ -1302,15 +1302,12 @@ var init_CheckoutButton = __esm({
1302
1302
  const checkoutClass = "text-(--inverse) h-14 leading-14 w-full cursor-pointer rounded-4xl bg-(--s-brand) hover:bg-(--s-brand-hover) px-4 text-center text-xl leading-6 font-medium disabled:cursor-not-allowed disabled:bg-(--s-disabled) disabled:text-(--disabled)";
1303
1303
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex w-full flex-col gap-4 p-6 text-xs leading-5 font-medium text-(--secondary) md:px-7", children: [
1304
1304
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Legal, {}),
1305
- isLoggedIn ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_jsx_runtime11.Fragment, { children: onProcess && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { disabled: isDisabled, onClick: onProcess, className: checkoutClass, children: getCheckoutContent() }) }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1305
+ isLoggedIn ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_jsx_runtime11.Fragment, { children: onProcess && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { disabled: isDisabled, onClick: onProcess, className: checkoutClass, children: getCheckoutContent() }) }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1306
1306
  "a",
1307
1307
  {
1308
1308
  href: `${staticConfig.keycloakUrl}/realms/${tenantId}/protocol/openid-connect/auth?client_id=${keycloakClientId ?? "oneof-next"}&response_type=code&redirect_uri=${window.location.href}`,
1309
1309
  className: checkoutClass,
1310
- children: [
1311
- "Log in / Sign up",
1312
- tenantId === "moca" ? " for an AIR account" : ""
1313
- ]
1310
+ children: spreePayConfig?.loginLabel || "Log in / Sign up"
1314
1311
  }
1315
1312
  ),
1316
1313
  /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("a", { href: "https://www.spree.finance/", className: "flex items-center justify-center gap-2 hover:underline", children: [
@@ -3496,6 +3493,14 @@ var CreditCard = ({ newCards, setNewCards }) => {
3496
3493
  },
3497
3494
  [setNewCards]
3498
3495
  );
3496
+ const handleAddNewCard = () => {
3497
+ setSelectedPaymentMethod({
3498
+ ...selectedPaymentMethod,
3499
+ type: "CREDIT_CARD" /* CREDIT_CARD */,
3500
+ method: null
3501
+ });
3502
+ setShowForm(true);
3503
+ };
3499
3504
  const handleCancel = () => {
3500
3505
  setShowForm(false);
3501
3506
  };
@@ -3515,7 +3520,7 @@ var CreditCard = ({ newCards, setNewCards }) => {
3515
3520
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3516
3521
  "button",
3517
3522
  {
3518
- onClick: () => setShowForm(true),
3523
+ onClick: handleAddNewCard,
3519
3524
  disabled: !spreePayConfig?.stripePublicKey,
3520
3525
  className: "text-md text-(--brand-primary) hover:underline disabled:cursor-not-allowed disabled:no-underline disabled:opacity-50",
3521
3526
  children: "Add new card"
package/build/index.js CHANGED
@@ -8,10 +8,10 @@ import {
8
8
  getSplitAmount,
9
9
  getTransactionFee,
10
10
  useSlapiBalance
11
- } from "./chunk-RORSHUSF.js";
11
+ } from "./chunk-UT65MGD2.js";
12
12
  import {
13
13
  Iframe3ds
14
- } from "./chunk-JXZZJ7NS.js";
14
+ } from "./chunk-VZWGJKM3.js";
15
15
  import {
16
16
  InfoBanner,
17
17
  LogLevel,
@@ -32,7 +32,7 @@ import {
32
32
  useSpreePayRegister,
33
33
  useSpreePaymentMethod,
34
34
  useStaticConfig
35
- } from "./chunk-WRFG6YIS.js";
35
+ } from "./chunk-XFJYLJZ4.js";
36
36
 
37
37
  // src/SpreePay.tsx
38
38
  import { useCallback as useCallback8, useEffect as useEffect7, useMemo as useMemo9, useState as useState12 } from "react";
@@ -892,6 +892,14 @@ var CreditCard = ({ newCards, setNewCards }) => {
892
892
  },
893
893
  [setNewCards]
894
894
  );
895
+ const handleAddNewCard = () => {
896
+ setSelectedPaymentMethod({
897
+ ...selectedPaymentMethod,
898
+ type: "CREDIT_CARD" /* CREDIT_CARD */,
899
+ method: null
900
+ });
901
+ setShowForm(true);
902
+ };
895
903
  const handleCancel = () => {
896
904
  setShowForm(false);
897
905
  };
@@ -911,7 +919,7 @@ var CreditCard = ({ newCards, setNewCards }) => {
911
919
  /* @__PURE__ */ jsx5(
912
920
  "button",
913
921
  {
914
- onClick: () => setShowForm(true),
922
+ onClick: handleAddNewCard,
915
923
  disabled: !spreePayConfig?.stripePublicKey,
916
924
  className: "text-md text-(--brand-primary) hover:underline disabled:cursor-not-allowed disabled:no-underline disabled:opacity-50",
917
925
  children: "Add new card"
@@ -2260,9 +2268,9 @@ var TabButtons = (props) => {
2260
2268
 
2261
2269
  // src/SpreePayContent.tsx
2262
2270
  import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
2263
- var CryptoTab = lazy(() => import("./CryptoTab-57MMM4AG.js").then((module) => ({ default: module.CryptoTab })));
2271
+ var CryptoTab = lazy(() => import("./CryptoTab-4IC63YD5.js").then((module) => ({ default: module.CryptoTab })));
2264
2272
  var CryptoComTab = lazy(
2265
- () => import("./CryptoComTab-DAKL7IZF.js").then((module) => ({ default: module.CryptoComTab }))
2273
+ () => import("./CryptoComTab-NMS7BP25.js").then((module) => ({ default: module.CryptoComTab }))
2266
2274
  );
2267
2275
  var TabLoadingFallback = () => /* @__PURE__ */ jsx18("div", { className: "flex items-center justify-center px-5 py-8 md:px-7", children: /* @__PURE__ */ jsxs11("div", { className: "flex flex-col items-center gap-3", children: [
2268
2276
  /* @__PURE__ */ jsx18("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-(--border-component-specific-card) border-t-(--brand-primary)" }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superlogic/spree-pay",
3
- "version": "0.4.12",
3
+ "version": "0.4.14",
4
4
  "description": "Spree-pay React component and utilities",
5
5
  "private": false,
6
6
  "type": "module",