@carlonicora/nextjs-jsonapi 2.2.2 → 2.2.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/dist/billing/index.js +20 -20
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +20 -20
- package/dist/billing/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/features/billing/stripe-price/components/forms/PriceEditor.tsx +3 -3
- package/src/features/billing/stripe-promotion-code/components/PromoCodeInput.tsx +2 -2
- package/src/features/billing/stripe-subscription/components/details/SubscriptionDetails.tsx +1 -1
- package/src/features/billing/stripe-subscription/components/forms/CancelSubscriptionDialog.tsx +1 -1
- package/src/features/billing/stripe-subscription/components/widgets/ProrationPreview.tsx +8 -8
- package/src/features/billing/stripe-subscription/components/wizards/WizardStepReview.tsx +5 -5
package/package.json
CHANGED
|
@@ -246,9 +246,9 @@ export function PriceEditor({ productId, price, open, onOpenChange, onSuccess }:
|
|
|
246
246
|
</DialogHeader>
|
|
247
247
|
|
|
248
248
|
{isEditMode && (
|
|
249
|
-
<div className="bg-
|
|
250
|
-
<AlertCircle className="h-5 w-5
|
|
251
|
-
<div className="text-
|
|
249
|
+
<div className="bg-primary/10 border-primary/30 flex gap-x-3 rounded-lg border p-4">
|
|
250
|
+
<AlertCircle className="text-primary mt-0.5 h-5 w-5 flex-shrink-0" />
|
|
251
|
+
<div className="text-foreground text-sm">
|
|
252
252
|
<p className="font-semibold mb-1">Stripe Price Immutability</p>
|
|
253
253
|
<p>
|
|
254
254
|
Due to Stripe's architecture, only the nickname and active status can be modified after creation. To
|
|
@@ -66,7 +66,7 @@ export function PromoCodeInput({
|
|
|
66
66
|
if (appliedCode?.valid) {
|
|
67
67
|
return (
|
|
68
68
|
<div className="space-y-2">
|
|
69
|
-
<div className="flex items-center justify-between
|
|
69
|
+
<div className="bg-success/15 border-success/30 flex items-center justify-between rounded-lg border p-3">
|
|
70
70
|
<div className="flex items-center gap-2">
|
|
71
71
|
<Check className="text-success h-4 w-4" />
|
|
72
72
|
<span className="text-success font-medium">{appliedCode.code}</span>
|
|
@@ -77,7 +77,7 @@ export function PromoCodeInput({
|
|
|
77
77
|
size="sm"
|
|
78
78
|
onClick={onRemove}
|
|
79
79
|
disabled={disabled}
|
|
80
|
-
className="text-success hover:bg-
|
|
80
|
+
className="text-success hover:bg-success/25 hover:text-success"
|
|
81
81
|
>
|
|
82
82
|
<X className="h-4 w-4" />
|
|
83
83
|
</Button>
|
|
@@ -156,7 +156,7 @@ export function SubscriptionDetails({
|
|
|
156
156
|
|
|
157
157
|
{/* Cancellation Warning */}
|
|
158
158
|
{subscription.cancelAtPeriodEnd && (
|
|
159
|
-
<div className="bg-
|
|
159
|
+
<div className="bg-warning/15 border-warning/30 rounded-lg border p-3">
|
|
160
160
|
<p className="text-warning text-xs/relaxed">
|
|
161
161
|
This subscription will be canceled at the end of the current period on{" "}
|
|
162
162
|
{formatDate(subscription.currentPeriodEnd)}.
|
package/src/features/billing/stripe-subscription/components/forms/CancelSubscriptionDialog.tsx
CHANGED
|
@@ -75,7 +75,7 @@ export function CancelSubscriptionDialog({
|
|
|
75
75
|
|
|
76
76
|
<Form {...form}>
|
|
77
77
|
<form onSubmit={form.handleSubmit(onSubmit)} className="flex flex-col gap-y-4">
|
|
78
|
-
<div className="bg-
|
|
78
|
+
<div className="bg-primary/10 border-primary/30 text-foreground rounded-lg border p-3 text-sm">
|
|
79
79
|
Your subscription will remain active until {periodEndDate}. You can continue using the service until then.
|
|
80
80
|
</div>
|
|
81
81
|
|
|
@@ -9,28 +9,28 @@ type ProrationPreviewProps = {
|
|
|
9
9
|
|
|
10
10
|
export function ProrationPreview({ preview }: ProrationPreviewProps) {
|
|
11
11
|
return (
|
|
12
|
-
<div className="bg-
|
|
13
|
-
<h4 className="
|
|
12
|
+
<div className="bg-primary/10 border-primary/30 rounded-lg border p-4">
|
|
13
|
+
<h4 className="text-primary mb-3 font-semibold">Proration Breakdown</h4>
|
|
14
14
|
|
|
15
15
|
<div className="space-y-2">
|
|
16
16
|
{preview.lineItems.map((item, index) => (
|
|
17
17
|
<div key={index} className="flex justify-between text-sm">
|
|
18
|
-
<span className="text-
|
|
19
|
-
<span className={`font-medium ${item.amount < 0 ? "text-success" : "text-
|
|
18
|
+
<span className="text-muted-foreground">{item.description}</span>
|
|
19
|
+
<span className={`font-medium ${item.amount < 0 ? "text-success" : "text-foreground"}`}>
|
|
20
20
|
{formatCurrency(item.amount, preview.currency)}
|
|
21
21
|
</span>
|
|
22
22
|
</div>
|
|
23
23
|
))}
|
|
24
24
|
|
|
25
|
-
<div className="border-
|
|
25
|
+
<div className="border-primary/30 mt-2 border-t pt-2">
|
|
26
26
|
<div className="flex justify-between font-semibold">
|
|
27
|
-
<span className="text-
|
|
28
|
-
<span className="text-
|
|
27
|
+
<span className="text-foreground">Net Due Today</span>
|
|
28
|
+
<span className="text-foreground">{formatCurrency(preview.immediateCharge, preview.currency)}</span>
|
|
29
29
|
</div>
|
|
30
30
|
</div>
|
|
31
31
|
|
|
32
32
|
{preview.lineItems.length > 0 && preview.lineItems[0].period && (
|
|
33
|
-
<div className="text-
|
|
33
|
+
<div className="text-muted-foreground mt-2 text-xs">
|
|
34
34
|
Next invoice on {formatDate(preview.lineItems[0].period.end)} for{" "}
|
|
35
35
|
{formatCurrency(preview.amountDue, preview.currency)}
|
|
36
36
|
</div>
|
|
@@ -151,21 +151,21 @@ export function WizardStepReview({
|
|
|
151
151
|
{/* Proration Preview (for plan changes) */}
|
|
152
152
|
{isChangingPlan && prorationPreview && (
|
|
153
153
|
<div
|
|
154
|
-
className={`${isTrialUpgrade ? "bg-
|
|
154
|
+
className={`${isTrialUpgrade ? "bg-warning/15 border-warning/30" : "bg-primary/10 border-primary/30"} space-y-2 rounded-lg border p-4`}
|
|
155
155
|
>
|
|
156
|
-
<h4 className={`font-medium ${isTrialUpgrade ? "text-warning" : "text-
|
|
156
|
+
<h4 className={`font-medium ${isTrialUpgrade ? "text-warning" : "text-primary"}`}>
|
|
157
157
|
{isTrialUpgrade ? "Trial Upgrade" : "Proration Summary"}
|
|
158
158
|
</h4>
|
|
159
|
-
<p className={`text-sm ${isTrialUpgrade ? "text-warning" : "text-
|
|
159
|
+
<p className={`text-sm ${isTrialUpgrade ? "text-warning" : "text-foreground"}`}>
|
|
160
160
|
{isTrialUpgrade
|
|
161
161
|
? "Your trial will end immediately and you will be charged the full price."
|
|
162
162
|
: "Your next charge will be adjusted to account for the plan change."}
|
|
163
163
|
</p>
|
|
164
164
|
<div className="flex justify-between text-sm">
|
|
165
|
-
<span className={`${isTrialUpgrade ? "text-warning" : "text-
|
|
165
|
+
<span className={`${isTrialUpgrade ? "text-warning" : "text-muted-foreground"}`}>
|
|
166
166
|
{isTrialUpgrade ? "Amount to charge now:" : "Amount due now:"}
|
|
167
167
|
</span>
|
|
168
|
-
<span className={`font-medium ${isTrialUpgrade ? "text-warning" : "text-
|
|
168
|
+
<span className={`font-medium ${isTrialUpgrade ? "text-warning" : "text-foreground"}`}>
|
|
169
169
|
{discountedImmediateCharge !== null ? (
|
|
170
170
|
<>
|
|
171
171
|
<span className="line-through text-muted-foreground mr-2">
|