@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carlonicora/nextjs-jsonapi",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
4
4
  "description": "Next.js JSON:API client with server/client support and caching",
5
5
  "author": "Carlo Nicora",
6
6
  "license": "GPL-3.0-or-later",
@@ -246,9 +246,9 @@ export function PriceEditor({ productId, price, open, onOpenChange, onSuccess }:
246
246
  </DialogHeader>
247
247
 
248
248
  {isEditMode && (
249
- <div className="bg-blue-50 border border-blue-200 rounded-lg p-4 flex gap-x-3">
250
- <AlertCircle className="h-5 w-5 text-blue-600 flex-shrink-0 mt-0.5" />
251
- <div className="text-sm text-blue-800">
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 p-3 bg-green-50 border border-green-200 rounded-lg">
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-green-100 hover:text-success"
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-yellow-50 border border-yellow-200 rounded-lg p-3">
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)}.
@@ -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-blue-50 border border-blue-200 rounded-lg p-3 text-sm text-blue-800">
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-blue-50 border border-blue-200 rounded-lg p-4">
13
- <h4 className="font-semibold text-blue-900 mb-3">Proration Breakdown</h4>
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-blue-800">{item.description}</span>
19
- <span className={`font-medium ${item.amount < 0 ? "text-success" : "text-blue-900"}`}>
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-t border-blue-200 pt-2 mt-2">
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-blue-900">Net Due Today</span>
28
- <span className="text-blue-900">{formatCurrency(preview.immediateCharge, preview.currency)}</span>
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-xs text-blue-700 mt-2">
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-amber-50 border-amber-200" : "bg-blue-50 border-blue-200"} border rounded-lg p-4 space-y-2`}
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-blue-800"}`}>
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-blue-700"}`}>
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-blue-600"}`}>
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-blue-800"}`}>
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">