@doujins/payments-ui 0.1.11 → 0.1.12

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.js CHANGED
@@ -509,7 +509,7 @@ var Input = React15.forwardRef(
509
509
  {
510
510
  type,
511
511
  className: cn(
512
- "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
512
+ "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",
513
513
  className
514
514
  ),
515
515
  ref,
@@ -520,7 +520,7 @@ var Input = React15.forwardRef(
520
520
  );
521
521
  Input.displayName = "Input";
522
522
  var labelVariants = cva(
523
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
523
+ "text-sm font-medium leading-none text-foreground peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
524
524
  );
525
525
  var Label = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
526
526
  LabelPrimitive.Root,
@@ -538,7 +538,7 @@ var SelectTrigger = React15.forwardRef(({ className, children, ...props }, ref)
538
538
  {
539
539
  ref,
540
540
  className: cn(
541
- "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
541
+ "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",
542
542
  className
543
543
  ),
544
544
  ...props,
@@ -580,7 +580,7 @@ var SelectContent = React15.forwardRef(({ className, children, position = "poppe
580
580
  {
581
581
  ref,
582
582
  className: cn(
583
- "relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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 origin-[--radix-select-content-transform-origin]",
583
+ "relative z-[200] max-h-64 min-w-[8rem] 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 origin-[--radix-select-content-transform-origin]",
584
584
  position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
585
585
  className
586
586
  ),
@@ -617,13 +617,13 @@ var SelectItem = React15.forwardRef(({ className, children, ...props }, ref) =>
617
617
  {
618
618
  ref,
619
619
  className: cn(
620
- "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
620
+ "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",
621
621
  className
622
622
  ),
623
623
  ...props,
624
624
  children: [
625
- /* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) }) }),
626
- /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
625
+ /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children }),
626
+ /* @__PURE__ */ jsx("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) }) })
627
627
  ]
628
628
  }
629
629
  ));
@@ -814,7 +814,8 @@ var CardDetailsForm = ({
814
814
  visible
815
815
  ]);
816
816
  const validate = () => {
817
- if (!firstName.trim() || !lastName.trim() || !address1.trim() || !city.trim() || !postalCode.trim() || !country.trim() || !email.trim()) {
817
+ const emailRequired = !defaultValues?.email && !config.defaultUser?.email;
818
+ if (!firstName.trim() || !lastName.trim() || !address1.trim() || !city.trim() || !postalCode.trim() || !country.trim() || emailRequired && !email.trim()) {
818
819
  setLocalError("Please complete all required billing fields.");
819
820
  return false;
820
821
  }
@@ -832,7 +833,8 @@ var CardDetailsForm = ({
832
833
  window.CollectJS.startPaymentRequest();
833
834
  };
834
835
  const errorMessage = localError ?? externalError;
835
- const collectFieldClass = "relative flex h-11 w-full items-center overflow-hidden rounded-md border border-border/60 bg-background/40 px-3 text-sm text-foreground";
836
+ 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";
837
+ const showEmailField = !defaultValues?.email && !config.defaultUser?.email;
836
838
  return /* @__PURE__ */ jsxs(
837
839
  "form",
838
840
  {
@@ -867,7 +869,7 @@ var CardDetailsForm = ({
867
869
  )
868
870
  ] })
869
871
  ] }),
870
- /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
872
+ showEmailField && /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
871
873
  /* @__PURE__ */ jsx(Label, { htmlFor: "email", children: "Email" }),
872
874
  /* @__PURE__ */ jsx(
873
875
  Input,
@@ -956,7 +958,7 @@ var CardDetailsForm = ({
956
958
  Button,
957
959
  {
958
960
  type: "submit",
959
- className: "w-full",
961
+ className: "w-full border-0 bg-emerald-600 text-white hover:bg-emerald-500 disabled:opacity-50",
960
962
  disabled: submitting || submitDisabled || isTokenizing,
961
963
  children: submitting || isTokenizing ? /* @__PURE__ */ jsxs(Fragment, { children: [
962
964
  /* @__PURE__ */ jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }),
@@ -2254,7 +2256,7 @@ var SubscriptionCheckoutModal = ({
2254
2256
  /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: handleClose, children: /* @__PURE__ */ jsxs(
2255
2257
  DialogContent,
2256
2258
  {
2257
- className: "z-[100] max-w-3xl max-h-[90vh] overflow-y-auto border border-white/20 p-6 backdrop-blur-xl bg-background-regular rounded-md [&::-webkit-scrollbar]:hidden",
2259
+ 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",
2258
2260
  children: [
2259
2261
  /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { className: "flex items-center gap-2 text-foreground", children: "Checkout" }) }),
2260
2262
  /* @__PURE__ */ jsx("div", { className: "space-y-4", children: !priceId ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-center px-3 py-2 text-sm text-destructive", children: [
@@ -3171,7 +3173,7 @@ var PaymentMethodsSection = ({
3171
3173
  /* @__PURE__ */ jsx(Dialog, { open: isModalOpen, onOpenChange: setIsModalOpen, children: /* @__PURE__ */ jsxs(
3172
3174
  DialogContent,
3173
3175
  {
3174
- className: "z-[100] max-w-3xl max-h-[90vh] overflow-y-auto border border-white/20 p-6 backdrop-blur-xl bg-background-regular rounded-md [&::-webkit-scrollbar]:hidden",
3176
+ 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",
3175
3177
  children: [
3176
3178
  /* @__PURE__ */ jsxs(DialogHeader, { children: [
3177
3179
  /* @__PURE__ */ jsx(DialogTitle, { className: "flex items-center gap-2 text-foreground", children: t.addNewCard }),