@doujins/payments-ui 0.1.11 → 0.1.13
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.cjs +20 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -26
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -542,7 +542,7 @@ var Input = React15__namespace.forwardRef(
|
|
|
542
542
|
{
|
|
543
543
|
type,
|
|
544
544
|
className: cn(
|
|
545
|
-
"flex h-
|
|
545
|
+
"placeholder:text-white/30 flex h-9 w-full rounded-md border border-white/30 bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium font-light file:text-foreground text-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
546
546
|
className
|
|
547
547
|
),
|
|
548
548
|
ref,
|
|
@@ -553,7 +553,7 @@ var Input = React15__namespace.forwardRef(
|
|
|
553
553
|
);
|
|
554
554
|
Input.displayName = "Input";
|
|
555
555
|
var labelVariants = classVarianceAuthority.cva(
|
|
556
|
-
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
556
|
+
"text-sm font-medium leading-none text-foreground peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
557
557
|
);
|
|
558
558
|
var Label = React15__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
559
559
|
LabelPrimitive__namespace.Root,
|
|
@@ -571,7 +571,7 @@ var SelectTrigger = React15__namespace.forwardRef(({ className, children, ...pro
|
|
|
571
571
|
{
|
|
572
572
|
ref,
|
|
573
573
|
className: cn(
|
|
574
|
-
"flex h-
|
|
574
|
+
"flex h-9 w-full cursor-pointer items-center justify-between rounded-md border border-white/30 bg-transparent px-3 py-1 text-sm placeholder:text-white/30 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:text-current",
|
|
575
575
|
className
|
|
576
576
|
),
|
|
577
577
|
...props,
|
|
@@ -608,33 +608,25 @@ var SelectScrollDownButton = React15__namespace.forwardRef(({ className, ...prop
|
|
|
608
608
|
}
|
|
609
609
|
));
|
|
610
610
|
SelectScrollDownButton.displayName = SelectPrimitive__namespace.ScrollDownButton.displayName;
|
|
611
|
-
var SelectContent = React15__namespace.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsxRuntime.
|
|
611
|
+
var SelectContent = React15__namespace.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
612
612
|
SelectPrimitive__namespace.Content,
|
|
613
613
|
{
|
|
614
614
|
ref,
|
|
615
615
|
className: cn(
|
|
616
|
-
"relative z-
|
|
617
|
-
position === "popper" && "
|
|
616
|
+
"relative z-[200] max-h-64 overflow-y-auto overflow-x-hidden rounded-md border border-white/20 bg-background-regular text-foreground shadow-lg backdrop-blur-xl data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
617
|
+
position === "popper" && "w-[var(--radix-select-trigger-width)]",
|
|
618
618
|
className
|
|
619
619
|
),
|
|
620
620
|
position,
|
|
621
|
+
sideOffset: 4,
|
|
621
622
|
...props,
|
|
622
623
|
children: [
|
|
623
624
|
/* @__PURE__ */ jsxRuntime.jsx(SelectScrollUpButton, {}),
|
|
624
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
625
|
-
SelectPrimitive__namespace.Viewport,
|
|
626
|
-
{
|
|
627
|
-
className: cn(
|
|
628
|
-
"p-1",
|
|
629
|
-
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
630
|
-
),
|
|
631
|
-
children
|
|
632
|
-
}
|
|
633
|
-
),
|
|
625
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Viewport, { className: "p-1", children }),
|
|
634
626
|
/* @__PURE__ */ jsxRuntime.jsx(SelectScrollDownButton, {})
|
|
635
627
|
]
|
|
636
628
|
}
|
|
637
|
-
)
|
|
629
|
+
));
|
|
638
630
|
SelectContent.displayName = SelectPrimitive__namespace.Content.displayName;
|
|
639
631
|
var SelectLabel = React15__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
640
632
|
SelectPrimitive__namespace.Label,
|
|
@@ -650,13 +642,13 @@ var SelectItem = React15__namespace.forwardRef(({ className, children, ...props
|
|
|
650
642
|
{
|
|
651
643
|
ref,
|
|
652
644
|
className: cn(
|
|
653
|
-
"relative flex w-full cursor-
|
|
645
|
+
"relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none hover:bg-foreground/10 focus:bg-foreground/10 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
654
646
|
className
|
|
655
647
|
),
|
|
656
648
|
...props,
|
|
657
649
|
children: [
|
|
658
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
659
|
-
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.
|
|
650
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemText, { children }),
|
|
651
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" }) }) })
|
|
660
652
|
]
|
|
661
653
|
}
|
|
662
654
|
));
|
|
@@ -847,7 +839,8 @@ var CardDetailsForm = ({
|
|
|
847
839
|
visible
|
|
848
840
|
]);
|
|
849
841
|
const validate = () => {
|
|
850
|
-
|
|
842
|
+
const emailRequired = !defaultValues?.email && !config.defaultUser?.email;
|
|
843
|
+
if (!firstName.trim() || !lastName.trim() || !address1.trim() || !city.trim() || !postalCode.trim() || !country.trim() || emailRequired && !email.trim()) {
|
|
851
844
|
setLocalError("Please complete all required billing fields.");
|
|
852
845
|
return false;
|
|
853
846
|
}
|
|
@@ -865,7 +858,8 @@ var CardDetailsForm = ({
|
|
|
865
858
|
window.CollectJS.startPaymentRequest();
|
|
866
859
|
};
|
|
867
860
|
const errorMessage = localError ?? externalError;
|
|
868
|
-
const collectFieldClass = "relative flex h-
|
|
861
|
+
const collectFieldClass = "relative flex h-9 w-full items-center overflow-hidden rounded-md border border-white/30 bg-transparent px-3 text-sm text-foreground";
|
|
862
|
+
const showEmailField = !defaultValues?.email && !config.defaultUser?.email;
|
|
869
863
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
870
864
|
"form",
|
|
871
865
|
{
|
|
@@ -900,7 +894,7 @@ var CardDetailsForm = ({
|
|
|
900
894
|
)
|
|
901
895
|
] })
|
|
902
896
|
] }),
|
|
903
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
897
|
+
showEmailField && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
904
898
|
/* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "email", children: "Email" }),
|
|
905
899
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
906
900
|
Input,
|
|
@@ -989,7 +983,7 @@ var CardDetailsForm = ({
|
|
|
989
983
|
Button,
|
|
990
984
|
{
|
|
991
985
|
type: "submit",
|
|
992
|
-
className: "w-full",
|
|
986
|
+
className: "w-full border-0 bg-emerald-600 text-white hover:bg-emerald-500 disabled:opacity-50",
|
|
993
987
|
disabled: submitting || submitDisabled || isTokenizing,
|
|
994
988
|
children: submitting || isTokenizing ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
995
989
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
@@ -2287,7 +2281,7 @@ var SubscriptionCheckoutModal = ({
|
|
|
2287
2281
|
/* @__PURE__ */ jsxRuntime.jsx(Dialog, { open, onOpenChange: handleClose, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2288
2282
|
DialogContent,
|
|
2289
2283
|
{
|
|
2290
|
-
className: "z-[100] max-w-
|
|
2284
|
+
className: "z-[100] max-w-xl max-h-[90vh] overflow-y-auto border border-white/20 p-6 backdrop-blur-xl bg-background-regular rounded-md [&::-webkit-scrollbar]:hidden",
|
|
2291
2285
|
children: [
|
|
2292
2286
|
/* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { className: "flex items-center gap-2 text-foreground", children: "Checkout" }) }),
|
|
2293
2287
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4", children: !priceId ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-center px-3 py-2 text-sm text-destructive", children: [
|
|
@@ -3204,7 +3198,7 @@ var PaymentMethodsSection = ({
|
|
|
3204
3198
|
/* @__PURE__ */ jsxRuntime.jsx(Dialog, { open: isModalOpen, onOpenChange: setIsModalOpen, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3205
3199
|
DialogContent,
|
|
3206
3200
|
{
|
|
3207
|
-
className: "z-[100] max-w-
|
|
3201
|
+
className: "z-[100] max-w-xl max-h-[90vh] overflow-y-auto border border-white/20 p-6 backdrop-blur-xl bg-background-regular rounded-md [&::-webkit-scrollbar]:hidden",
|
|
3208
3202
|
children: [
|
|
3209
3203
|
/* @__PURE__ */ jsxRuntime.jsxs(DialogHeader, { children: [
|
|
3210
3204
|
/* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { className: "flex items-center gap-2 text-foreground", children: t.addNewCard }),
|