@superlogic/spree-pay 0.5.1 → 0.5.3
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/{CryptoComTab-ZAWBJUCM.js → CryptoComTab-GL5DOJ2P.js} +3 -3
- package/build/{CryptoTab-632DRL2D.js → CryptoTab-ODXWUOMD.js} +3 -3
- package/build/{chunk-4BM6VTMT.js → chunk-HZDR76ZV.js} +2 -2
- package/build/{chunk-PTEQVWLJ.js → chunk-NOTIAH6W.js} +2 -2
- package/build/{chunk-AXNTOSBU.js → chunk-PMTKUR3L.js} +1 -1
- package/build/index.cjs +23 -23
- package/build/index.css +141 -0
- package/build/index.js +23 -23
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Iframe3ds
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PMTKUR3L.js";
|
|
4
4
|
import {
|
|
5
5
|
InfoBanner,
|
|
6
6
|
Legal,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
useSpreePayRegister,
|
|
15
15
|
useSpreePaymentMethod,
|
|
16
16
|
useStaticConfig
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-NOTIAH6W.js";
|
|
18
18
|
|
|
19
19
|
// src/components/CryptoComTab/CryptoComTab.tsx
|
|
20
20
|
import { useCallback, useEffect } from "react";
|
|
@@ -150,7 +150,7 @@ var CryptoComTab = () => {
|
|
|
150
150
|
const res = await cryptoComPayment(data);
|
|
151
151
|
return settlePaymentResult(res, "Crypto payment failed");
|
|
152
152
|
} catch (e) {
|
|
153
|
-
|
|
153
|
+
throw toPaymentError(e, "Crypto payment failed");
|
|
154
154
|
}
|
|
155
155
|
},
|
|
156
156
|
[cryptoComPayment]
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
CheckoutButton,
|
|
3
3
|
PointsSwitch,
|
|
4
4
|
cn as cn2
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HZDR76ZV.js";
|
|
6
6
|
import {
|
|
7
7
|
Dialog,
|
|
8
8
|
DialogContent,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
useSpreePayConfig,
|
|
19
19
|
useSpreePayRegister,
|
|
20
20
|
useSpreePaymentMethod
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-NOTIAH6W.js";
|
|
22
22
|
|
|
23
23
|
// src/components/CryptoTab/Crypto/CryptoWrapper.tsx
|
|
24
24
|
import { useMemo as useMemo2 } from "react";
|
|
@@ -766,7 +766,7 @@ var Crypto = () => {
|
|
|
766
766
|
const res = await cryptoPayment(data);
|
|
767
767
|
return settlePaymentResult(res, "Crypto payment failed");
|
|
768
768
|
} catch (e) {
|
|
769
|
-
|
|
769
|
+
throw toPaymentError(e, "Crypto payment failed");
|
|
770
770
|
}
|
|
771
771
|
},
|
|
772
772
|
[cryptoPayment]
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
useSpreePayEnv,
|
|
8
8
|
useSpreePaymentMethod,
|
|
9
9
|
useStaticConfig
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-NOTIAH6W.js";
|
|
11
11
|
|
|
12
12
|
// src/components/common/PointsSwitch.tsx
|
|
13
13
|
import { useId } from "react";
|
|
@@ -45,7 +45,7 @@ function Switch({ className, ...props }) {
|
|
|
45
45
|
{
|
|
46
46
|
"data-slot": "switch",
|
|
47
47
|
className: cn(
|
|
48
|
-
"peer
|
|
48
|
+
"peer inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-(--b-tertiary) focus-visible:ring-[3px] focus-visible:ring-(--b-tertiary)/50 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-(--s-brand) data-[state=unchecked]:bg-(--s-tertiary)",
|
|
49
49
|
className
|
|
50
50
|
),
|
|
51
51
|
...props,
|
|
@@ -86,7 +86,7 @@ var settlePaymentResult = (res, fallbackMessage, failureCode = "PAYMENT_ERROR" /
|
|
|
86
86
|
};
|
|
87
87
|
|
|
88
88
|
// package.json
|
|
89
|
-
var version = "0.5.
|
|
89
|
+
var version = "0.5.3";
|
|
90
90
|
|
|
91
91
|
// src/utils/logger.ts
|
|
92
92
|
var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
|
|
@@ -833,7 +833,7 @@ function DialogContent({
|
|
|
833
833
|
DialogPrimitive.Close,
|
|
834
834
|
{
|
|
835
835
|
"data-slot": "dialog-close",
|
|
836
|
-
className: "
|
|
836
|
+
className: "absolute top-4 right-4 rounded-xs opacity-70 ring-offset-(--s-default) transition-opacity hover:opacity-100 focus:ring-2 focus:ring-(--b-tertiary) focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-(--accent) data-[state=open]:text-(--secondary) [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
837
837
|
children: [
|
|
838
838
|
/* @__PURE__ */ jsx6(XIcon, {}),
|
|
839
839
|
/* @__PURE__ */ jsx6("span", { className: "sr-only", children: "Close" })
|
package/build/index.cjs
CHANGED
|
@@ -133,7 +133,7 @@ var init_errors = __esm({
|
|
|
133
133
|
var version;
|
|
134
134
|
var init_package = __esm({
|
|
135
135
|
"package.json"() {
|
|
136
|
-
version = "0.5.
|
|
136
|
+
version = "0.5.3";
|
|
137
137
|
}
|
|
138
138
|
});
|
|
139
139
|
|
|
@@ -590,7 +590,7 @@ function DialogContent({
|
|
|
590
590
|
DialogPrimitive.Close,
|
|
591
591
|
{
|
|
592
592
|
"data-slot": "dialog-close",
|
|
593
|
-
className: "
|
|
593
|
+
className: "absolute top-4 right-4 rounded-xs opacity-70 ring-offset-(--s-default) transition-opacity hover:opacity-100 focus:ring-2 focus:ring-(--b-tertiary) focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-(--accent) data-[state=open]:text-(--secondary) [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
594
594
|
children: [
|
|
595
595
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.XIcon, {}),
|
|
596
596
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "sr-only", children: "Close" })
|
|
@@ -1143,7 +1143,7 @@ function Switch({ className, ...props }) {
|
|
|
1143
1143
|
{
|
|
1144
1144
|
"data-slot": "switch",
|
|
1145
1145
|
className: cn(
|
|
1146
|
-
"peer
|
|
1146
|
+
"peer inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-(--b-tertiary) focus-visible:ring-[3px] focus-visible:ring-(--b-tertiary)/50 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-(--s-brand) data-[state=unchecked]:bg-(--s-tertiary)",
|
|
1147
1147
|
className
|
|
1148
1148
|
),
|
|
1149
1149
|
...props,
|
|
@@ -2367,7 +2367,7 @@ var init_Crypto = __esm({
|
|
|
2367
2367
|
const res = await cryptoPayment(data);
|
|
2368
2368
|
return settlePaymentResult(res, "Crypto payment failed");
|
|
2369
2369
|
} catch (e) {
|
|
2370
|
-
|
|
2370
|
+
throw toPaymentError(e, "Crypto payment failed");
|
|
2371
2371
|
}
|
|
2372
2372
|
},
|
|
2373
2373
|
[cryptoPayment]
|
|
@@ -2641,7 +2641,7 @@ var init_CryptoComTab = __esm({
|
|
|
2641
2641
|
const res = await cryptoComPayment(data);
|
|
2642
2642
|
return settlePaymentResult(res, "Crypto payment failed");
|
|
2643
2643
|
} catch (e) {
|
|
2644
|
-
|
|
2644
|
+
throw toPaymentError(e, "Crypto payment failed");
|
|
2645
2645
|
}
|
|
2646
2646
|
},
|
|
2647
2647
|
[cryptoComPayment]
|
|
@@ -3367,15 +3367,15 @@ var import_class_variance_authority = require("class-variance-authority");
|
|
|
3367
3367
|
init_utils();
|
|
3368
3368
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
3369
3369
|
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
3370
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-full text-sm transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-
|
|
3370
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-full text-sm transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-(--b-tertiary) focus-visible:ring-(--b-tertiary)/50 focus-visible:ring-[3px] aria-invalid:ring-(--negative)/20 dark:aria-invalid:ring-(--negative)/40 aria-invalid:border-(--negative)",
|
|
3371
3371
|
{
|
|
3372
3372
|
variants: {
|
|
3373
3373
|
variant: {
|
|
3374
3374
|
default: "bg-(--primary) text-(--inverse) shadow-xs hover:bg-(--primary)/90 ",
|
|
3375
|
-
destructive: "bg-
|
|
3376
|
-
outline: "border bg-
|
|
3377
|
-
secondary: "bg-(--secondary) text-
|
|
3378
|
-
ghost: "hover:bg-(--accent) hover:text-
|
|
3375
|
+
destructive: "bg-(--negative) text-(--inverse) shadow-xs hover:bg-(--negative)/90 focus-visible:ring-(--negative)/20 dark:focus-visible:ring-(--negative)/40 dark:bg-(--negative)/60",
|
|
3376
|
+
outline: "border bg-(--s-default) shadow-xs hover:bg-(--accent) hover:text-(--brand-primary) dark:bg-(--s-primary)/30 dark:border-(--b-tertiary) dark:hover:bg-(--s-primary)/50",
|
|
3377
|
+
secondary: "bg-(--secondary) text-(--inverse) shadow-xs hover:bg-(--secondary)/80",
|
|
3378
|
+
ghost: "hover:bg-(--accent) hover:text-(--brand-primary) dark:hover:bg-(--accent)/50",
|
|
3379
3379
|
link: "text-(--brand-primary) underline-offset-4 hover:underline"
|
|
3380
3380
|
},
|
|
3381
3381
|
size: {
|
|
@@ -3414,7 +3414,7 @@ function Checkbox({ className, ...props }) {
|
|
|
3414
3414
|
{
|
|
3415
3415
|
"data-slot": "checkbox",
|
|
3416
3416
|
className: cn(
|
|
3417
|
-
"peer
|
|
3417
|
+
"peer size-4 shrink-0 rounded-sm border border-(--b-tertiary) shadow-xs transition-shadow outline-none focus-visible:border-(--b-tertiary) focus-visible:ring-[3px] focus-visible:ring-(--b-tertiary)/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-(--negative) aria-invalid:ring-(--negative)/20 data-[state=checked]:border-(--s-brand) data-[state=checked]:bg-(--s-brand) data-[state=checked]:text-(--inverse) dark:bg-(--s-primary)/30 dark:aria-invalid:ring-(--negative)/40",
|
|
3418
3418
|
className
|
|
3419
3419
|
),
|
|
3420
3420
|
...props,
|
|
@@ -3436,9 +3436,9 @@ init_logger();
|
|
|
3436
3436
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
3437
3437
|
var cardFormLogger = logger.child("card-form");
|
|
3438
3438
|
var stripeElementClasses = {
|
|
3439
|
-
base: "w-full rounded-[12px] bg-(--s-primary) px-5 py-4 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-
|
|
3440
|
-
invalid: "focus-visible:ring-
|
|
3441
|
-
focus: "border-
|
|
3439
|
+
base: "w-full rounded-[12px] bg-(--s-primary) px-5 py-4 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-(--b-tertiary) focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-50",
|
|
3440
|
+
invalid: "focus-visible:ring-(--negative)",
|
|
3441
|
+
focus: "border-(--b-tertiary) ring-(--b-tertiary)/50 ring-2"
|
|
3442
3442
|
};
|
|
3443
3443
|
var CreditCardForm = ({ cancel, saveCard }) => {
|
|
3444
3444
|
const [cardError, setCardError] = (0, import_react9.useState)(void 0);
|
|
@@ -3540,7 +3540,7 @@ var CreditCardForm = ({ cancel, saveCard }) => {
|
|
|
3540
3540
|
}
|
|
3541
3541
|
)
|
|
3542
3542
|
] }),
|
|
3543
|
-
cardError && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "
|
|
3543
|
+
cardError && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "mt-1 text-sm text-(--negative)", children: cardError })
|
|
3544
3544
|
] }),
|
|
3545
3545
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3546
3546
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Checkbox, { checked: shouldSaveCard, onCheckedChange: (v) => setShouldSaveCard(v === true), id: "saveCard" }),
|
|
@@ -3674,9 +3674,9 @@ function Input({ className, type, ...props }) {
|
|
|
3674
3674
|
type,
|
|
3675
3675
|
"data-slot": "input",
|
|
3676
3676
|
className: cn(
|
|
3677
|
-
"
|
|
3678
|
-
"focus-visible:border-
|
|
3679
|
-
"aria-invalid:ring-
|
|
3677
|
+
"flex h-9 w-full min-w-0 rounded-md border border-(--b-tertiary) bg-transparent px-3 py-1 text-base text-(--brand-primary) shadow-xs transition-[color,box-shadow] outline-none selection:bg-(--primary) selection:text-(--inverse) file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-(--primary) placeholder:text-(--tertiary) disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-(--s-primary)/30",
|
|
3678
|
+
"focus-visible:border-(--b-tertiary) focus-visible:ring-[3px] focus-visible:ring-(--b-tertiary)/50",
|
|
3679
|
+
"aria-invalid:border-(--negative) aria-invalid:ring-(--negative)/20 dark:aria-invalid:ring-(--negative)/40",
|
|
3680
3680
|
className
|
|
3681
3681
|
),
|
|
3682
3682
|
...props
|
|
@@ -4633,7 +4633,7 @@ function Slider2(props) {
|
|
|
4633
4633
|
Thumb2,
|
|
4634
4634
|
{
|
|
4635
4635
|
"data-slot": "slider-thumb",
|
|
4636
|
-
className: "
|
|
4636
|
+
className: "block size-5 shrink-0 rounded-full border border-(--b-inverse) bg-(--primary) shadow-(--primary)/20 shadow-sm ring-(--b-tertiary)/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
|
|
4637
4637
|
},
|
|
4638
4638
|
index
|
|
4639
4639
|
))
|
|
@@ -4885,12 +4885,12 @@ var CreditCardTab = () => {
|
|
|
4885
4885
|
}
|
|
4886
4886
|
return settlePaymentResult(res, failureMessage, failureCode);
|
|
4887
4887
|
} catch (e) {
|
|
4888
|
-
|
|
4888
|
+
throw toPaymentError(e, failureMessage, failureCode);
|
|
4889
4889
|
} finally {
|
|
4890
|
-
mutateBalance();
|
|
4890
|
+
mutateBalance().catch(() => void 0);
|
|
4891
4891
|
if (selectedPaymentMethod.type === "CREDIT_CARD" /* CREDIT_CARD */ && selectedPaymentMethod.method && isNewCard(selectedPaymentMethod.method)) {
|
|
4892
4892
|
const knownIds = new Set(cards.map((c) => c.id));
|
|
4893
|
-
const updated = await mutateCards();
|
|
4893
|
+
const updated = await mutateCards().catch(() => void 0);
|
|
4894
4894
|
const newSavedCard = (updated?.data ?? []).find((c) => c.active && !knownIds.has(c.id));
|
|
4895
4895
|
setSelectedPaymentMethod({
|
|
4896
4896
|
...selectedPaymentMethod,
|
|
@@ -4899,7 +4899,7 @@ var CreditCardTab = () => {
|
|
|
4899
4899
|
});
|
|
4900
4900
|
setNewCards([]);
|
|
4901
4901
|
} else {
|
|
4902
|
-
mutateCards();
|
|
4902
|
+
mutateCards().catch(() => void 0);
|
|
4903
4903
|
}
|
|
4904
4904
|
}
|
|
4905
4905
|
},
|
package/build/index.css
CHANGED
|
@@ -243,6 +243,9 @@
|
|
|
243
243
|
.sl-spreepay .pointer-events-none {
|
|
244
244
|
pointer-events: none;
|
|
245
245
|
}
|
|
246
|
+
.sl-spreepay .invisible {
|
|
247
|
+
visibility: hidden;
|
|
248
|
+
}
|
|
246
249
|
.sl-spreepay .sr-only {
|
|
247
250
|
position: absolute;
|
|
248
251
|
width: 1px;
|
|
@@ -667,6 +670,9 @@
|
|
|
667
670
|
.sl-spreepay .bg-\(--crypto-pay-bg\) {
|
|
668
671
|
background-color: var(--crypto-pay-bg);
|
|
669
672
|
}
|
|
673
|
+
.sl-spreepay .bg-\(--negative\) {
|
|
674
|
+
background-color: var(--negative);
|
|
675
|
+
}
|
|
670
676
|
.sl-spreepay .bg-\(--overlay\) {
|
|
671
677
|
background-color: var(--overlay);
|
|
672
678
|
}
|
|
@@ -930,6 +936,15 @@
|
|
|
930
936
|
var(--tw-ring-shadow),
|
|
931
937
|
var(--tw-shadow);
|
|
932
938
|
}
|
|
939
|
+
.sl-spreepay .shadow {
|
|
940
|
+
--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
|
|
941
|
+
box-shadow:
|
|
942
|
+
var(--tw-inset-shadow),
|
|
943
|
+
var(--tw-inset-ring-shadow),
|
|
944
|
+
var(--tw-ring-offset-shadow),
|
|
945
|
+
var(--tw-ring-shadow),
|
|
946
|
+
var(--tw-shadow);
|
|
947
|
+
}
|
|
933
948
|
.sl-spreepay .shadow-\[0_6\.25px_25px_0_rgba\(0\,0\,0\,0\.05\)\] {
|
|
934
949
|
--tw-shadow: 0 6.25px 25px 0 var(--tw-shadow-color, rgba(0,0,0,0.05));
|
|
935
950
|
box-shadow:
|
|
@@ -1005,6 +1020,15 @@
|
|
|
1005
1020
|
.sl-spreepay .ring-\(--b-brand\) {
|
|
1006
1021
|
--tw-ring-color: var(--b-brand);
|
|
1007
1022
|
}
|
|
1023
|
+
.sl-spreepay .ring-\(--b-tertiary\)\/50 {
|
|
1024
|
+
--tw-ring-color: var(--b-tertiary);
|
|
1025
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1026
|
+
--tw-ring-color: color-mix(in oklab, var(--b-tertiary) 50%, transparent);
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
.sl-spreepay .ring-offset-\(--s-default\) {
|
|
1030
|
+
--tw-ring-offset-color: var(--s-default);
|
|
1031
|
+
}
|
|
1008
1032
|
.sl-spreepay .outline {
|
|
1009
1033
|
outline-style: var(--tw-outline-style);
|
|
1010
1034
|
outline-width: 1px;
|
|
@@ -1122,6 +1146,11 @@
|
|
|
1122
1146
|
font-weight: var(--font-weight-medium);
|
|
1123
1147
|
}
|
|
1124
1148
|
}
|
|
1149
|
+
.sl-spreepay .file\:text-\(--primary\) {
|
|
1150
|
+
&::file-selector-button {
|
|
1151
|
+
color: var(--primary);
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1125
1154
|
.sl-spreepay .placeholder\:text-\(--tertiary\) {
|
|
1126
1155
|
&::placeholder {
|
|
1127
1156
|
color: var(--tertiary);
|
|
@@ -1141,6 +1170,16 @@
|
|
|
1141
1170
|
}
|
|
1142
1171
|
}
|
|
1143
1172
|
}
|
|
1173
|
+
.sl-spreepay .hover\:bg-\(--negative\)\/90 {
|
|
1174
|
+
&:hover {
|
|
1175
|
+
@media (hover: hover) {
|
|
1176
|
+
background-color: var(--negative);
|
|
1177
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1178
|
+
background-color: color-mix(in oklab, var(--negative) 90%, transparent);
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1144
1183
|
.sl-spreepay .hover\:bg-\(--primary\)\/90 {
|
|
1145
1184
|
&:hover {
|
|
1146
1185
|
@media (hover: hover) {
|
|
@@ -1234,6 +1273,11 @@
|
|
|
1234
1273
|
var(--tw-shadow);
|
|
1235
1274
|
}
|
|
1236
1275
|
}
|
|
1276
|
+
.sl-spreepay .focus\:ring-\(--b-tertiary\) {
|
|
1277
|
+
&:focus {
|
|
1278
|
+
--tw-ring-color: var(--b-tertiary);
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1237
1281
|
.sl-spreepay .focus\:ring-offset-2 {
|
|
1238
1282
|
&:focus {
|
|
1239
1283
|
--tw-ring-offset-width: 2px;
|
|
@@ -1250,6 +1294,11 @@
|
|
|
1250
1294
|
}
|
|
1251
1295
|
}
|
|
1252
1296
|
}
|
|
1297
|
+
.sl-spreepay .focus-visible\:border-\(--b-tertiary\) {
|
|
1298
|
+
&:focus-visible {
|
|
1299
|
+
border-color: var(--b-tertiary);
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1253
1302
|
.sl-spreepay .focus-visible\:ring-1 {
|
|
1254
1303
|
&:focus-visible {
|
|
1255
1304
|
--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
|
|
@@ -1283,6 +1332,32 @@
|
|
|
1283
1332
|
var(--tw-shadow);
|
|
1284
1333
|
}
|
|
1285
1334
|
}
|
|
1335
|
+
.sl-spreepay .focus-visible\:ring-\(--b-tertiary\) {
|
|
1336
|
+
&:focus-visible {
|
|
1337
|
+
--tw-ring-color: var(--b-tertiary);
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
.sl-spreepay .focus-visible\:ring-\(--b-tertiary\)\/50 {
|
|
1341
|
+
&:focus-visible {
|
|
1342
|
+
--tw-ring-color: var(--b-tertiary);
|
|
1343
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1344
|
+
--tw-ring-color: color-mix(in oklab, var(--b-tertiary) 50%, transparent);
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
.sl-spreepay .focus-visible\:ring-\(--negative\) {
|
|
1349
|
+
&:focus-visible {
|
|
1350
|
+
--tw-ring-color: var(--negative);
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
.sl-spreepay .focus-visible\:ring-\(--negative\)\/20 {
|
|
1354
|
+
&:focus-visible {
|
|
1355
|
+
--tw-ring-color: var(--negative);
|
|
1356
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1357
|
+
--tw-ring-color: color-mix(in oklab, var(--negative) 20%, transparent);
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1286
1361
|
.sl-spreepay .focus-visible\:ring-offset-1 {
|
|
1287
1362
|
&:focus-visible {
|
|
1288
1363
|
--tw-ring-offset-width: 1px;
|
|
@@ -1360,6 +1435,19 @@
|
|
|
1360
1435
|
padding-inline: calc(var(--spacing) * 6);
|
|
1361
1436
|
}
|
|
1362
1437
|
}
|
|
1438
|
+
.sl-spreepay .aria-invalid\:border-\(--negative\) {
|
|
1439
|
+
&[aria-invalid=true] {
|
|
1440
|
+
border-color: var(--negative);
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
.sl-spreepay .aria-invalid\:ring-\(--negative\)\/20 {
|
|
1444
|
+
&[aria-invalid=true] {
|
|
1445
|
+
--tw-ring-color: var(--negative);
|
|
1446
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1447
|
+
--tw-ring-color: color-mix(in oklab, var(--negative) 20%, transparent);
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1363
1451
|
.sl-spreepay .data-disabled\:opacity-50 {
|
|
1364
1452
|
&[data-disabled] {
|
|
1365
1453
|
opacity: 50%;
|
|
@@ -1583,6 +1671,27 @@
|
|
|
1583
1671
|
font-size: 22px;
|
|
1584
1672
|
}
|
|
1585
1673
|
}
|
|
1674
|
+
.sl-spreepay .dark\:border-\(--b-tertiary\) {
|
|
1675
|
+
&:is(.dark *) {
|
|
1676
|
+
border-color: var(--b-tertiary);
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
.sl-spreepay .dark\:bg-\(--negative\)\/60 {
|
|
1680
|
+
&:is(.dark *) {
|
|
1681
|
+
background-color: var(--negative);
|
|
1682
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1683
|
+
background-color: color-mix(in oklab, var(--negative) 60%, transparent);
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
.sl-spreepay .dark\:bg-\(--s-primary\)\/30 {
|
|
1688
|
+
&:is(.dark *) {
|
|
1689
|
+
background-color: var(--s-primary);
|
|
1690
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1691
|
+
background-color: color-mix(in oklab, var(--s-primary) 30%, transparent);
|
|
1692
|
+
}
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1586
1695
|
.sl-spreepay .dark\:hover\:bg-\(--accent\)\/50 {
|
|
1587
1696
|
&:is(.dark *) {
|
|
1588
1697
|
&:hover {
|
|
@@ -1595,6 +1704,38 @@
|
|
|
1595
1704
|
}
|
|
1596
1705
|
}
|
|
1597
1706
|
}
|
|
1707
|
+
.sl-spreepay .dark\:hover\:bg-\(--s-primary\)\/50 {
|
|
1708
|
+
&:is(.dark *) {
|
|
1709
|
+
&:hover {
|
|
1710
|
+
@media (hover: hover) {
|
|
1711
|
+
background-color: var(--s-primary);
|
|
1712
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1713
|
+
background-color: color-mix(in oklab, var(--s-primary) 50%, transparent);
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
}
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
.sl-spreepay .dark\:focus-visible\:ring-\(--negative\)\/40 {
|
|
1720
|
+
&:is(.dark *) {
|
|
1721
|
+
&:focus-visible {
|
|
1722
|
+
--tw-ring-color: var(--negative);
|
|
1723
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1724
|
+
--tw-ring-color: color-mix(in oklab, var(--negative) 40%, transparent);
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
.sl-spreepay .dark\:aria-invalid\:ring-\(--negative\)\/40 {
|
|
1730
|
+
&:is(.dark *) {
|
|
1731
|
+
&[aria-invalid=true] {
|
|
1732
|
+
--tw-ring-color: var(--negative);
|
|
1733
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1734
|
+
--tw-ring-color: color-mix(in oklab, var(--negative) 40%, transparent);
|
|
1735
|
+
}
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
}
|
|
1598
1739
|
.sl-spreepay .\[\&_a\]\:underline {
|
|
1599
1740
|
& a {
|
|
1600
1741
|
text-decoration-line: underline;
|
package/build/index.js
CHANGED
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
getSplitAmount,
|
|
9
9
|
getTransactionFee,
|
|
10
10
|
useSlapiBalance
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-HZDR76ZV.js";
|
|
12
12
|
import {
|
|
13
13
|
Iframe3ds
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-PMTKUR3L.js";
|
|
15
15
|
import {
|
|
16
16
|
InfoBanner,
|
|
17
17
|
LogLevel,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
useSpreePayRegister,
|
|
43
43
|
useSpreePaymentMethod,
|
|
44
44
|
useStaticConfig
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-NOTIAH6W.js";
|
|
46
46
|
|
|
47
47
|
// src/SpreePay.tsx
|
|
48
48
|
import { useCallback as useCallback8, useEffect as useEffect8, useMemo as useMemo9, useState as useState12 } from "react";
|
|
@@ -677,15 +677,15 @@ import { Slot } from "@radix-ui/react-slot";
|
|
|
677
677
|
import { cva } from "class-variance-authority";
|
|
678
678
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
679
679
|
var buttonVariants = cva(
|
|
680
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-full text-sm transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-
|
|
680
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-full text-sm transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-(--b-tertiary) focus-visible:ring-(--b-tertiary)/50 focus-visible:ring-[3px] aria-invalid:ring-(--negative)/20 dark:aria-invalid:ring-(--negative)/40 aria-invalid:border-(--negative)",
|
|
681
681
|
{
|
|
682
682
|
variants: {
|
|
683
683
|
variant: {
|
|
684
684
|
default: "bg-(--primary) text-(--inverse) shadow-xs hover:bg-(--primary)/90 ",
|
|
685
|
-
destructive: "bg-
|
|
686
|
-
outline: "border bg-
|
|
687
|
-
secondary: "bg-(--secondary) text-
|
|
688
|
-
ghost: "hover:bg-(--accent) hover:text-
|
|
685
|
+
destructive: "bg-(--negative) text-(--inverse) shadow-xs hover:bg-(--negative)/90 focus-visible:ring-(--negative)/20 dark:focus-visible:ring-(--negative)/40 dark:bg-(--negative)/60",
|
|
686
|
+
outline: "border bg-(--s-default) shadow-xs hover:bg-(--accent) hover:text-(--brand-primary) dark:bg-(--s-primary)/30 dark:border-(--b-tertiary) dark:hover:bg-(--s-primary)/50",
|
|
687
|
+
secondary: "bg-(--secondary) text-(--inverse) shadow-xs hover:bg-(--secondary)/80",
|
|
688
|
+
ghost: "hover:bg-(--accent) hover:text-(--brand-primary) dark:hover:bg-(--accent)/50",
|
|
689
689
|
link: "text-(--brand-primary) underline-offset-4 hover:underline"
|
|
690
690
|
},
|
|
691
691
|
size: {
|
|
@@ -723,7 +723,7 @@ function Checkbox({ className, ...props }) {
|
|
|
723
723
|
{
|
|
724
724
|
"data-slot": "checkbox",
|
|
725
725
|
className: cn(
|
|
726
|
-
"peer
|
|
726
|
+
"peer size-4 shrink-0 rounded-sm border border-(--b-tertiary) shadow-xs transition-shadow outline-none focus-visible:border-(--b-tertiary) focus-visible:ring-[3px] focus-visible:ring-(--b-tertiary)/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-(--negative) aria-invalid:ring-(--negative)/20 data-[state=checked]:border-(--s-brand) data-[state=checked]:bg-(--s-brand) data-[state=checked]:text-(--inverse) dark:bg-(--s-primary)/30 dark:aria-invalid:ring-(--negative)/40",
|
|
727
727
|
className
|
|
728
728
|
),
|
|
729
729
|
...props,
|
|
@@ -743,9 +743,9 @@ function Checkbox({ className, ...props }) {
|
|
|
743
743
|
import { Fragment, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
744
744
|
var cardFormLogger = logger.child("card-form");
|
|
745
745
|
var stripeElementClasses = {
|
|
746
|
-
base: "w-full rounded-[12px] bg-(--s-primary) px-5 py-4 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-
|
|
747
|
-
invalid: "focus-visible:ring-
|
|
748
|
-
focus: "border-
|
|
746
|
+
base: "w-full rounded-[12px] bg-(--s-primary) px-5 py-4 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-(--b-tertiary) focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-50",
|
|
747
|
+
invalid: "focus-visible:ring-(--negative)",
|
|
748
|
+
focus: "border-(--b-tertiary) ring-(--b-tertiary)/50 ring-2"
|
|
749
749
|
};
|
|
750
750
|
var CreditCardForm = ({ cancel, saveCard }) => {
|
|
751
751
|
const [cardError, setCardError] = useState2(void 0);
|
|
@@ -847,7 +847,7 @@ var CreditCardForm = ({ cancel, saveCard }) => {
|
|
|
847
847
|
}
|
|
848
848
|
)
|
|
849
849
|
] }),
|
|
850
|
-
cardError && /* @__PURE__ */ jsx4("p", { className: "
|
|
850
|
+
cardError && /* @__PURE__ */ jsx4("p", { className: "mt-1 text-sm text-(--negative)", children: cardError })
|
|
851
851
|
] }),
|
|
852
852
|
/* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2", children: [
|
|
853
853
|
/* @__PURE__ */ jsx4(Checkbox, { checked: shouldSaveCard, onCheckedChange: (v) => setShouldSaveCard(v === true), id: "saveCard" }),
|
|
@@ -964,9 +964,9 @@ function Input({ className, type, ...props }) {
|
|
|
964
964
|
type,
|
|
965
965
|
"data-slot": "input",
|
|
966
966
|
className: cn(
|
|
967
|
-
"
|
|
968
|
-
"focus-visible:border-
|
|
969
|
-
"aria-invalid:ring-
|
|
967
|
+
"flex h-9 w-full min-w-0 rounded-md border border-(--b-tertiary) bg-transparent px-3 py-1 text-base text-(--brand-primary) shadow-xs transition-[color,box-shadow] outline-none selection:bg-(--primary) selection:text-(--inverse) file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-(--primary) placeholder:text-(--tertiary) disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-(--s-primary)/30",
|
|
968
|
+
"focus-visible:border-(--b-tertiary) focus-visible:ring-[3px] focus-visible:ring-(--b-tertiary)/50",
|
|
969
|
+
"aria-invalid:border-(--negative) aria-invalid:ring-(--negative)/20 dark:aria-invalid:ring-(--negative)/40",
|
|
970
970
|
className
|
|
971
971
|
),
|
|
972
972
|
...props
|
|
@@ -1922,7 +1922,7 @@ function Slider2(props) {
|
|
|
1922
1922
|
Thumb,
|
|
1923
1923
|
{
|
|
1924
1924
|
"data-slot": "slider-thumb",
|
|
1925
|
-
className: "
|
|
1925
|
+
className: "block size-5 shrink-0 rounded-full border border-(--b-inverse) bg-(--primary) shadow-(--primary)/20 shadow-sm ring-(--b-tertiary)/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
|
|
1926
1926
|
},
|
|
1927
1927
|
index
|
|
1928
1928
|
))
|
|
@@ -2171,12 +2171,12 @@ var CreditCardTab = () => {
|
|
|
2171
2171
|
}
|
|
2172
2172
|
return settlePaymentResult(res, failureMessage, failureCode);
|
|
2173
2173
|
} catch (e) {
|
|
2174
|
-
|
|
2174
|
+
throw toPaymentError(e, failureMessage, failureCode);
|
|
2175
2175
|
} finally {
|
|
2176
|
-
mutateBalance();
|
|
2176
|
+
mutateBalance().catch(() => void 0);
|
|
2177
2177
|
if (selectedPaymentMethod.type === "CREDIT_CARD" /* CREDIT_CARD */ && selectedPaymentMethod.method && isNewCard(selectedPaymentMethod.method)) {
|
|
2178
2178
|
const knownIds = new Set(cards.map((c) => c.id));
|
|
2179
|
-
const updated = await mutateCards();
|
|
2179
|
+
const updated = await mutateCards().catch(() => void 0);
|
|
2180
2180
|
const newSavedCard = (updated?.data ?? []).find((c) => c.active && !knownIds.has(c.id));
|
|
2181
2181
|
setSelectedPaymentMethod({
|
|
2182
2182
|
...selectedPaymentMethod,
|
|
@@ -2185,7 +2185,7 @@ var CreditCardTab = () => {
|
|
|
2185
2185
|
});
|
|
2186
2186
|
setNewCards([]);
|
|
2187
2187
|
} else {
|
|
2188
|
-
mutateCards();
|
|
2188
|
+
mutateCards().catch(() => void 0);
|
|
2189
2189
|
}
|
|
2190
2190
|
}
|
|
2191
2191
|
},
|
|
@@ -2284,9 +2284,9 @@ var TabButtons = (props) => {
|
|
|
2284
2284
|
|
|
2285
2285
|
// src/SpreePayContent.tsx
|
|
2286
2286
|
import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2287
|
-
var CryptoTab = lazy(() => import("./CryptoTab-
|
|
2287
|
+
var CryptoTab = lazy(() => import("./CryptoTab-ODXWUOMD.js").then((module) => ({ default: module.CryptoTab })));
|
|
2288
2288
|
var CryptoComTab = lazy(
|
|
2289
|
-
() => import("./CryptoComTab-
|
|
2289
|
+
() => import("./CryptoComTab-GL5DOJ2P.js").then((module) => ({ default: module.CryptoComTab }))
|
|
2290
2290
|
);
|
|
2291
2291
|
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: [
|
|
2292
2292
|
/* @__PURE__ */ jsx18("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-(--border-component-specific-card) border-t-(--brand-primary)" }),
|