@superlogic/spree-pay 0.3.0 → 0.3.2

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/README.md CHANGED
@@ -18,7 +18,7 @@ import { useCapture3DS } from '@superlogic/spree-pay';
18
18
  import '@superlogic/spree-pay/styles.css';
19
19
 
20
20
  const spreeEnv = {
21
- tenantId: 'moca' as const, // Keep moca for crypto payments on BASE network
21
+ tenantId: 'your-tenant-id', // Tenant identifier provided during onboarding
22
22
  environment: 'dev' as const,
23
23
  redirect3dsURI: '/3ds', // Any valid URI in your app that captures 3ds redirect
24
24
  ssoPageURI: '/silent-check-sso.html', // Any valid URI in your app that will handle Keycloak SSO (example below)
@@ -115,7 +115,7 @@ type SpreePayProps = {
115
115
  ```typescript
116
116
  type ENV = {
117
117
  environment: 'dev' | 'stg' | 'prod'; // Environment for API endpoints and logging
118
- tenantId: 'bookit' | 'moca' | 'qiibee' | 'umhp' | 'cdc'; // Tenant identifier
118
+ tenantId: string; // Tenant identifier
119
119
  ssoPageURI: string; // Path to Keycloak SSO page (e.g., '/silent-check-sso.html')
120
120
  redirect3dsURI: string; // Path to 3DS redirect handler (e.g., '/3ds')
121
121
  accessToken?: string; // Optional: provide pre-authenticated token to skip Keycloak SSO
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Iframe3ds
3
- } from "./chunk-5N74UPWG.js";
3
+ } from "./chunk-256NJIJQ.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-72WHAUEF.js";
15
+ } from "./chunk-QNXCPSL7.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-2NS5OFHY.js";
5
+ } from "./chunk-STFEOIP4.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-72WHAUEF.js";
19
+ } from "./chunk-QNXCPSL7.js";
20
20
 
21
21
  // src/components/CryptoTab/Crypto/CryptoWrapper.tsx
22
22
  import { useMemo as useMemo2 } from "react";
@@ -2,7 +2,7 @@ import {
2
2
  Dialog,
3
3
  DialogContent,
4
4
  DialogTitle
5
- } from "./chunk-72WHAUEF.js";
5
+ } from "./chunk-QNXCPSL7.js";
6
6
 
7
7
  // src/modals/Iframe3ds.tsx
8
8
  import { useEffect } from "react";
@@ -9,7 +9,7 @@ var PaymentType = /* @__PURE__ */ ((PaymentType2) => {
9
9
  })(PaymentType || {});
10
10
 
11
11
  // package.json
12
- var version = "0.3.0";
12
+ var version = "0.3.2";
13
13
 
14
14
  // src/utils/logger.ts
15
15
  var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
@@ -6,7 +6,7 @@ import {
6
6
  useSpreePayEnv,
7
7
  useSpreePaymentMethod,
8
8
  useStaticConfig
9
- } from "./chunk-72WHAUEF.js";
9
+ } from "./chunk-QNXCPSL7.js";
10
10
 
11
11
  // src/components/common/PointsSwitch.tsx
12
12
  import { useId } from "react";
@@ -235,12 +235,12 @@ var CheckoutButton = ({ isLoggedIn }) => {
235
235
  return "Checkout";
236
236
  };
237
237
  const checkoutClass = "text-(--inverse) h-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)";
238
- return /* @__PURE__ */ jsxs3("div", { className: "flex w-full flex-col gap-4 bg-(--s-default) p-6 text-xs leading-5 font-medium text-(--secondary) md:px-7", children: [
238
+ 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: [
239
239
  /* @__PURE__ */ jsx5(Legal, {}),
240
240
  isLoggedIn ? /* @__PURE__ */ jsx5(Fragment, { children: onProcess && /* @__PURE__ */ jsx5("button", { disabled: isDisabled, onClick: onProcess, className: checkoutClass, children: getCheckoutContent() }) }) : /* @__PURE__ */ jsx5(
241
241
  "a",
242
242
  {
243
- href: `${staticConfig.keycloakUrl}/realms/${env.tenantId}/protocol/openid-connect/auth?client_id=${staticConfig.keycloakClientId}&response_type=code&redirect_uri=${window.location.href}`,
243
+ href: `${staticConfig.keycloakUrl}/realms/${env.tenantId}/protocol/openid-connect/auth?client_id=${env.keycloakClientId ?? "oneof-next"}&response_type=code&redirect_uri=${window.location.href}`,
244
244
  className: checkoutClass,
245
245
  children: "Log in / Sign up for an AIR account"
246
246
  }
package/build/index.cjs CHANGED
@@ -68,7 +68,7 @@ var init_payments = __esm({
68
68
  var version;
69
69
  var init_package = __esm({
70
70
  "package.json"() {
71
- version = "0.3.0";
71
+ version = "0.3.2";
72
72
  }
73
73
  });
74
74
 
@@ -1262,12 +1262,12 @@ var init_CheckoutButton = __esm({
1262
1262
  return "Checkout";
1263
1263
  };
1264
1264
  const checkoutClass = "text-(--inverse) h-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)";
1265
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex w-full flex-col gap-4 bg-(--s-default) p-6 text-xs leading-5 font-medium text-(--secondary) md:px-7", children: [
1265
+ 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: [
1266
1266
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Legal, {}),
1267
1267
  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)(
1268
1268
  "a",
1269
1269
  {
1270
- href: `${staticConfig.keycloakUrl}/realms/${env.tenantId}/protocol/openid-connect/auth?client_id=${staticConfig.keycloakClientId}&response_type=code&redirect_uri=${window.location.href}`,
1270
+ href: `${staticConfig.keycloakUrl}/realms/${env.tenantId}/protocol/openid-connect/auth?client_id=${env.keycloakClientId ?? "oneof-next"}&response_type=code&redirect_uri=${window.location.href}`,
1271
1271
  className: checkoutClass,
1272
1272
  children: "Log in / Sign up for an AIR account"
1273
1273
  }
@@ -3379,7 +3379,7 @@ var CreditCard = () => {
3379
3379
  {
3380
3380
  onClick: () => setShowForm(true),
3381
3381
  disabled: !spreePayConfig?.stripePublicKey,
3382
- className: "text-md text-(--brand-primary) hover:underline",
3382
+ className: "text-md text-(--brand-primary) hover:underline disabled:cursor-not-allowed disabled:no-underline disabled:opacity-50",
3383
3383
  children: "Add new card"
3384
3384
  }
3385
3385
  )
package/build/index.css CHANGED
@@ -1315,6 +1315,11 @@
1315
1315
  color: var(--disabled);
1316
1316
  }
1317
1317
  }
1318
+ .sl-spreepay .disabled\:no-underline {
1319
+ &:disabled {
1320
+ text-decoration-line: none;
1321
+ }
1322
+ }
1318
1323
  .sl-spreepay .disabled\:opacity-50 {
1319
1324
  &:disabled {
1320
1325
  opacity: 50%;
package/build/index.d.cts CHANGED
@@ -14,13 +14,11 @@ declare const SpreePay: FC<SpreePayProps>;
14
14
 
15
15
  declare const useCapture3DS: (searchParams: Record<string, string | null>) => void;
16
16
 
17
- type TenantId = 'bookit' | 'moca' | 'qiibee' | 'umhp' | 'cdc' | 'tria';
18
-
19
17
  type Environment = 'dev' | 'stg' | 'prod';
20
18
  type ENV = {
21
19
  environment: Environment;
22
20
  ssoPageURI: string;
23
- tenantId: TenantId;
21
+ tenantId: string;
24
22
  redirect3dsURI: string;
25
23
  accessToken?: string;
26
24
  useWeb3Points?: boolean;
package/build/index.d.ts CHANGED
@@ -14,13 +14,11 @@ declare const SpreePay: FC<SpreePayProps>;
14
14
 
15
15
  declare const useCapture3DS: (searchParams: Record<string, string | null>) => void;
16
16
 
17
- type TenantId = 'bookit' | 'moca' | 'qiibee' | 'umhp' | 'cdc' | 'tria';
18
-
19
17
  type Environment = 'dev' | 'stg' | 'prod';
20
18
  type ENV = {
21
19
  environment: Environment;
22
20
  ssoPageURI: string;
23
- tenantId: TenantId;
21
+ tenantId: string;
24
22
  redirect3dsURI: string;
25
23
  accessToken?: string;
26
24
  useWeb3Points?: boolean;
package/build/index.js CHANGED
@@ -8,10 +8,10 @@ import {
8
8
  getSplitAmount,
9
9
  getTransactionFee,
10
10
  useSlapiBalance
11
- } from "./chunk-2NS5OFHY.js";
11
+ } from "./chunk-STFEOIP4.js";
12
12
  import {
13
13
  Iframe3ds
14
- } from "./chunk-5N74UPWG.js";
14
+ } from "./chunk-256NJIJQ.js";
15
15
  import {
16
16
  InfoBanner,
17
17
  LogLevel,
@@ -31,7 +31,7 @@ import {
31
31
  useSpreePayRegister,
32
32
  useSpreePaymentMethod,
33
33
  useStaticConfig
34
- } from "./chunk-72WHAUEF.js";
34
+ } from "./chunk-QNXCPSL7.js";
35
35
 
36
36
  // src/SpreePay.tsx
37
37
  import { useCallback as useCallback7, useEffect as useEffect8, useMemo as useMemo7, useState as useState10 } from "react";
@@ -868,7 +868,7 @@ var CreditCard = () => {
868
868
  {
869
869
  onClick: () => setShowForm(true),
870
870
  disabled: !spreePayConfig?.stripePublicKey,
871
- className: "text-md text-(--brand-primary) hover:underline",
871
+ className: "text-md text-(--brand-primary) hover:underline disabled:cursor-not-allowed disabled:no-underline disabled:opacity-50",
872
872
  children: "Add new card"
873
873
  }
874
874
  )
@@ -2190,9 +2190,9 @@ var TabButtons = (props) => {
2190
2190
 
2191
2191
  // src/SpreePayContent.tsx
2192
2192
  import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
2193
- var CryptoTab = lazy(() => import("./CryptoTab-3T5GBOMU.js").then((module) => ({ default: module.CryptoTab })));
2193
+ var CryptoTab = lazy(() => import("./CryptoTab-VDQLJRGP.js").then((module) => ({ default: module.CryptoTab })));
2194
2194
  var CryptoComTab = lazy(
2195
- () => import("./CryptoComTab-56XWMDNP.js").then((module) => ({ default: module.CryptoComTab }))
2195
+ () => import("./CryptoComTab-XPQRAAD5.js").then((module) => ({ default: module.CryptoComTab }))
2196
2196
  );
2197
2197
  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: [
2198
2198
  /* @__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.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Spree-pay React component and utilities",
5
5
  "private": false,
6
6
  "type": "module",