@superlogic/spree-pay 0.1.29 → 0.1.30

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/build/index.cjs CHANGED
@@ -44,7 +44,7 @@ var import_nice_modal_react7 = __toESM(require("@ebay/nice-modal-react"), 1);
44
44
  var import_swr5 = require("swr");
45
45
 
46
46
  // package.json
47
- var version = "0.1.29";
47
+ var version = "0.1.30";
48
48
 
49
49
  // src/context/SpreePayActionsContext.tsx
50
50
  var import_react = require("react");
@@ -372,9 +372,9 @@ var CheckoutButton = ({ isLoggedIn }) => {
372
372
  ) }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
373
373
  "a",
374
374
  {
375
- href: `${staticConfig.keycloakUrl}/realms/${env.tenantId}/protocol/openid-connect/logout?client_id=${staticConfig.keycloakClientId}&post_logout_redirect_uri=${window.location.origin}${window.location.pathname}`,
375
+ href: `${staticConfig.keycloakUrl}/realms/${env.tenantId}/protocol/openid-connect/auth?client_id=${staticConfig.keycloakClientId}&response_type=code&redirect_uri=${window.location.href}`,
376
376
  className: "bg-primary h-[60px] w-full cursor-pointer text-center text-xl leading-[60px] font-semibold text-white disabled:cursor-not-allowed disabled:opacity-50",
377
- children: "Login"
377
+ children: "Log in / Sign up for an AIR account"
378
378
  }
379
379
  )
380
380
  ] });
@@ -1352,7 +1352,7 @@ var PointsSwitch = (props) => {
1352
1352
  )
1353
1353
  ] })
1354
1354
  ] }),
1355
- message && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center gap-1 rounded-sm border-1 border-[#006FD533] bg-[#006FD50D] p-1.5", children: [
1355
+ message && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex gap-1 rounded-sm border-1 border-[#006FD533] bg-[#006FD50D] p-1.5", children: [
1356
1356
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("svg", { className: "size-5 shrink-0", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 20 20", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1357
1357
  "path",
1358
1358
  {
@@ -2378,6 +2378,8 @@ var PointsSelector = (props) => {
2378
2378
  const handleCommit = (value) => {
2379
2379
  setSelectedPaymentMethod({ ...selectedPaymentMethod, splitAmount: value });
2380
2380
  };
2381
+ const pointsValue = String(Math.round(splitTokens));
2382
+ const usdValue = formatUSD(usdAmount + getTransactionFee(usdAmount, appProps.transactionFeePercentage));
2381
2383
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2382
2384
  "button",
2383
2385
  {
@@ -2401,14 +2403,15 @@ var PointsSelector = (props) => {
2401
2403
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex h-full w-full items-center justify-between gap-2 px-2 sm:gap-3 sm:px-3", children })
2402
2404
  ] }),
2403
2405
  isSelected && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "px-2 pt-6 pb-2 sm:px-3 md:px-4", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex justify-between gap-2 sm:gap-3", children: [
2404
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex max-w-[100px] flex-col gap-1", children: [
2406
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-1", children: [
2405
2407
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2406
2408
  Input,
2407
2409
  {
2408
2410
  readOnly: true,
2409
2411
  name: "points amount",
2410
- value: Math.round(splitTokens),
2411
- className: "sm:text-md min-w-[80px] bg-white px-1 text-center text-xs font-medium sm:px-3",
2412
+ value: pointsValue,
2413
+ className: "sm:text-md min-w-[50px] bg-white px-1 text-center text-xs font-medium sm:min-w-[100px] sm:px-2",
2414
+ style: { width: `${pointsValue.length}ch` },
2412
2415
  onClick: (e) => e.stopPropagation()
2413
2416
  }
2414
2417
  ),
@@ -2426,14 +2429,15 @@ var PointsSelector = (props) => {
2426
2429
  step
2427
2430
  }
2428
2431
  ) }),
2429
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex max-w-[100px] flex-col gap-1", children: [
2432
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-1", children: [
2430
2433
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2431
2434
  Input,
2432
2435
  {
2433
2436
  readOnly: true,
2434
2437
  name: "usd amount",
2435
- value: formatUSD(usdAmount + getTransactionFee(usdAmount, appProps.transactionFeePercentage)),
2436
- className: "sm:text-md min-w-[80px] bg-white px-1 text-center text-xs font-medium sm:px-3",
2438
+ value: usdValue,
2439
+ className: "sm:text-md min-w-[50px] bg-white px-1 text-center text-xs font-medium sm:min-w-[100px] sm:px-2",
2440
+ style: { width: `${usdValue.length}ch` },
2437
2441
  onClick: (e) => e.stopPropagation()
2438
2442
  }
2439
2443
  ),
package/build/index.css CHANGED
@@ -449,9 +449,6 @@
449
449
  .sl-spreepay .w-full {
450
450
  width: 100%;
451
451
  }
452
- .sl-spreepay .max-w-\[100px\] {
453
- max-width: 100px;
454
- }
455
452
  .sl-spreepay .max-w-\[540px\] {
456
453
  max-width: 540px;
457
454
  }
@@ -464,8 +461,8 @@
464
461
  .sl-spreepay .min-w-0 {
465
462
  min-width: calc(var(--spacing) * 0);
466
463
  }
467
- .sl-spreepay .min-w-\[80px\] {
468
- min-width: 80px;
464
+ .sl-spreepay .min-w-\[50px\] {
465
+ min-width: 50px;
469
466
  }
470
467
  .sl-spreepay .flex-1 {
471
468
  flex: 1;
@@ -1466,6 +1463,11 @@
1466
1463
  max-width: var(--container-lg);
1467
1464
  }
1468
1465
  }
1466
+ .sl-spreepay .sm\:min-w-\[100px\] {
1467
+ @media (width >= 40rem) {
1468
+ min-width: 100px;
1469
+ }
1470
+ }
1469
1471
  .sl-spreepay .sm\:flex-row {
1470
1472
  @media (width >= 40rem) {
1471
1473
  flex-direction: row;
@@ -1486,6 +1488,11 @@
1486
1488
  gap: calc(var(--spacing) * 3);
1487
1489
  }
1488
1490
  }
1491
+ .sl-spreepay .sm\:px-2 {
1492
+ @media (width >= 40rem) {
1493
+ padding-inline: calc(var(--spacing) * 2);
1494
+ }
1495
+ }
1489
1496
  .sl-spreepay .sm\:px-3 {
1490
1497
  @media (width >= 40rem) {
1491
1498
  padding-inline: calc(var(--spacing) * 3);
package/build/index.js CHANGED
@@ -4,7 +4,7 @@ import NiceModal7 from "@ebay/nice-modal-react";
4
4
  import { SWRConfig } from "swr";
5
5
 
6
6
  // package.json
7
- var version = "0.1.29";
7
+ var version = "0.1.30";
8
8
 
9
9
  // src/context/SpreePayActionsContext.tsx
10
10
  import { createContext, useCallback, useContext, useRef, useState } from "react";
@@ -332,9 +332,9 @@ var CheckoutButton = ({ isLoggedIn }) => {
332
332
  ) }) : /* @__PURE__ */ jsx4(
333
333
  "a",
334
334
  {
335
- href: `${staticConfig.keycloakUrl}/realms/${env.tenantId}/protocol/openid-connect/logout?client_id=${staticConfig.keycloakClientId}&post_logout_redirect_uri=${window.location.origin}${window.location.pathname}`,
335
+ href: `${staticConfig.keycloakUrl}/realms/${env.tenantId}/protocol/openid-connect/auth?client_id=${staticConfig.keycloakClientId}&response_type=code&redirect_uri=${window.location.href}`,
336
336
  className: "bg-primary h-[60px] w-full cursor-pointer text-center text-xl leading-[60px] font-semibold text-white disabled:cursor-not-allowed disabled:opacity-50",
337
- children: "Login"
337
+ children: "Log in / Sign up for an AIR account"
338
338
  }
339
339
  )
340
340
  ] });
@@ -1312,7 +1312,7 @@ var PointsSwitch = (props) => {
1312
1312
  )
1313
1313
  ] })
1314
1314
  ] }),
1315
- message && /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-1 rounded-sm border-1 border-[#006FD533] bg-[#006FD50D] p-1.5", children: [
1315
+ message && /* @__PURE__ */ jsxs9("div", { className: "flex gap-1 rounded-sm border-1 border-[#006FD533] bg-[#006FD50D] p-1.5", children: [
1316
1316
  /* @__PURE__ */ jsx15("svg", { className: "size-5 shrink-0", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx15(
1317
1317
  "path",
1318
1318
  {
@@ -2338,6 +2338,8 @@ var PointsSelector = (props) => {
2338
2338
  const handleCommit = (value) => {
2339
2339
  setSelectedPaymentMethod({ ...selectedPaymentMethod, splitAmount: value });
2340
2340
  };
2341
+ const pointsValue = String(Math.round(splitTokens));
2342
+ const usdValue = formatUSD(usdAmount + getTransactionFee(usdAmount, appProps.transactionFeePercentage));
2341
2343
  return /* @__PURE__ */ jsxs12(
2342
2344
  "button",
2343
2345
  {
@@ -2361,14 +2363,15 @@ var PointsSelector = (props) => {
2361
2363
  /* @__PURE__ */ jsx24("div", { className: "flex h-full w-full items-center justify-between gap-2 px-2 sm:gap-3 sm:px-3", children })
2362
2364
  ] }),
2363
2365
  isSelected && /* @__PURE__ */ jsx24("div", { className: "px-2 pt-6 pb-2 sm:px-3 md:px-4", children: /* @__PURE__ */ jsxs12("div", { className: "flex justify-between gap-2 sm:gap-3", children: [
2364
- /* @__PURE__ */ jsxs12("div", { className: "flex max-w-[100px] flex-col gap-1", children: [
2366
+ /* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-1", children: [
2365
2367
  /* @__PURE__ */ jsx24(
2366
2368
  Input,
2367
2369
  {
2368
2370
  readOnly: true,
2369
2371
  name: "points amount",
2370
- value: Math.round(splitTokens),
2371
- className: "sm:text-md min-w-[80px] bg-white px-1 text-center text-xs font-medium sm:px-3",
2372
+ value: pointsValue,
2373
+ className: "sm:text-md min-w-[50px] bg-white px-1 text-center text-xs font-medium sm:min-w-[100px] sm:px-2",
2374
+ style: { width: `${pointsValue.length}ch` },
2372
2375
  onClick: (e) => e.stopPropagation()
2373
2376
  }
2374
2377
  ),
@@ -2386,14 +2389,15 @@ var PointsSelector = (props) => {
2386
2389
  step
2387
2390
  }
2388
2391
  ) }),
2389
- /* @__PURE__ */ jsxs12("div", { className: "flex max-w-[100px] flex-col gap-1", children: [
2392
+ /* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-1", children: [
2390
2393
  /* @__PURE__ */ jsx24(
2391
2394
  Input,
2392
2395
  {
2393
2396
  readOnly: true,
2394
2397
  name: "usd amount",
2395
- value: formatUSD(usdAmount + getTransactionFee(usdAmount, appProps.transactionFeePercentage)),
2396
- className: "sm:text-md min-w-[80px] bg-white px-1 text-center text-xs font-medium sm:px-3",
2398
+ value: usdValue,
2399
+ className: "sm:text-md min-w-[50px] bg-white px-1 text-center text-xs font-medium sm:min-w-[100px] sm:px-2",
2400
+ style: { width: `${usdValue.length}ch` },
2397
2401
  onClick: (e) => e.stopPropagation()
2398
2402
  }
2399
2403
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superlogic/spree-pay",
3
- "version": "0.1.29",
3
+ "version": "0.1.30",
4
4
  "description": "Spree-pay React component and utilities",
5
5
  "private": false,
6
6
  "type": "module",