@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/dist/billing/index.js
CHANGED
|
@@ -1203,7 +1203,7 @@ function CancelSubscriptionDialog({
|
|
|
1203
1203
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkF3BPNQDBjs.DialogDescription, { children: "Are you sure you want to cancel this subscription? This action cannot be undone." })
|
|
1204
1204
|
] }),
|
|
1205
1205
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkF3BPNQDBjs.Form, { ...form, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: form.handleSubmit(onSubmit), className: "flex flex-col gap-y-4", children: [
|
|
1206
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-
|
|
1206
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-primary/10 border-primary/30 text-foreground rounded-lg border p-3 text-sm", children: [
|
|
1207
1207
|
"Your subscription will remain active until ",
|
|
1208
1208
|
periodEndDate,
|
|
1209
1209
|
". You can continue using the service until then."
|
|
@@ -1380,7 +1380,7 @@ function SubscriptionDetails({
|
|
|
1380
1380
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground text-xs", children: "Trial Ends:" }),
|
|
1381
1381
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm", children: formatDate3(subscription.trialEnd) })
|
|
1382
1382
|
] }),
|
|
1383
|
-
subscription.cancelAtPeriodEnd && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bg-
|
|
1383
|
+
subscription.cancelAtPeriodEnd && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bg-warning/15 border-warning/30 rounded-lg border p-3", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-warning text-xs/relaxed", children: [
|
|
1384
1384
|
"This subscription will be canceled at the end of the current period on",
|
|
1385
1385
|
" ",
|
|
1386
1386
|
formatDate3(subscription.currentPeriodEnd),
|
|
@@ -1774,18 +1774,18 @@ _chunk7QVYU63Ejs.__name.call(void 0, ProductPricingListSkeleton, "ProductPricing
|
|
|
1774
1774
|
// src/features/billing/stripe-subscription/components/widgets/ProrationPreview.tsx
|
|
1775
1775
|
|
|
1776
1776
|
function ProrationPreview({ preview }) {
|
|
1777
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-
|
|
1778
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h4", { className: "
|
|
1777
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-primary/10 border-primary/30 rounded-lg border p-4", children: [
|
|
1778
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h4", { className: "text-primary mb-3 font-semibold", children: "Proration Breakdown" }),
|
|
1779
1779
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
1780
1780
|
preview.lineItems.map((item, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between text-sm", children: [
|
|
1781
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-
|
|
1782
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `font-medium ${item.amount < 0 ? "text-success" : "text-
|
|
1781
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-muted-foreground", children: item.description }),
|
|
1782
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `font-medium ${item.amount < 0 ? "text-success" : "text-foreground"}`, children: formatCurrency(item.amount, preview.currency) })
|
|
1783
1783
|
] }, index)),
|
|
1784
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border-
|
|
1785
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-
|
|
1786
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-
|
|
1784
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "border-primary/30 mt-2 border-t pt-2", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between font-semibold", children: [
|
|
1785
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-foreground", children: "Net Due Today" }),
|
|
1786
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-foreground", children: formatCurrency(preview.immediateCharge, preview.currency) })
|
|
1787
1787
|
] }) }),
|
|
1788
|
-
preview.lineItems.length > 0 && preview.lineItems[0].period && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-
|
|
1788
|
+
preview.lineItems.length > 0 && preview.lineItems[0].period && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-muted-foreground mt-2 text-xs", children: [
|
|
1789
1789
|
"Next invoice on ",
|
|
1790
1790
|
formatDate3(preview.lineItems[0].period.end),
|
|
1791
1791
|
" for",
|
|
@@ -2205,7 +2205,7 @@ function PromoCodeInput({
|
|
|
2205
2205
|
}, "formatDuration");
|
|
2206
2206
|
if (_optionalChain([appliedCode, 'optionalAccess', _83 => _83.valid])) {
|
|
2207
2207
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-2", children: [
|
|
2208
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center justify-between
|
|
2208
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-success/15 border-success/30 flex items-center justify-between rounded-lg border p-3", children: [
|
|
2209
2209
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
2210
2210
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Check, { className: "text-success h-4 w-4" }),
|
|
2211
2211
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-success font-medium", children: appliedCode.code }),
|
|
@@ -2218,7 +2218,7 @@ function PromoCodeInput({
|
|
|
2218
2218
|
size: "sm",
|
|
2219
2219
|
onClick: onRemove,
|
|
2220
2220
|
disabled,
|
|
2221
|
-
className: "text-success hover:bg-
|
|
2221
|
+
className: "text-success hover:bg-success/25 hover:text-success",
|
|
2222
2222
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.X, { className: "h-4 w-4" })
|
|
2223
2223
|
}
|
|
2224
2224
|
)
|
|
@@ -2330,13 +2330,13 @@ function WizardStepReview({
|
|
|
2330
2330
|
isChangingPlan && prorationPreview && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2331
2331
|
"div",
|
|
2332
2332
|
{
|
|
2333
|
-
className: `${isTrialUpgrade ? "bg-
|
|
2333
|
+
className: `${isTrialUpgrade ? "bg-warning/15 border-warning/30" : "bg-primary/10 border-primary/30"} space-y-2 rounded-lg border p-4`,
|
|
2334
2334
|
children: [
|
|
2335
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h4", { className: `font-medium ${isTrialUpgrade ? "text-warning" : "text-
|
|
2336
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: `text-sm ${isTrialUpgrade ? "text-warning" : "text-
|
|
2335
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h4", { className: `font-medium ${isTrialUpgrade ? "text-warning" : "text-primary"}`, children: isTrialUpgrade ? "Trial Upgrade" : "Proration Summary" }),
|
|
2336
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: `text-sm ${isTrialUpgrade ? "text-warning" : "text-foreground"}`, children: isTrialUpgrade ? "Your trial will end immediately and you will be charged the full price." : "Your next charge will be adjusted to account for the plan change." }),
|
|
2337
2337
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex justify-between text-sm", children: [
|
|
2338
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `${isTrialUpgrade ? "text-warning" : "text-
|
|
2339
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `font-medium ${isTrialUpgrade ? "text-warning" : "text-
|
|
2338
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `${isTrialUpgrade ? "text-warning" : "text-muted-foreground"}`, children: isTrialUpgrade ? "Amount to charge now:" : "Amount due now:" }),
|
|
2339
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `font-medium ${isTrialUpgrade ? "text-warning" : "text-foreground"}`, children: discountedImmediateCharge !== null ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2340
2340
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "line-through text-muted-foreground mr-2", children: formatCurrency(prorationPreview.immediateCharge, prorationPreview.currency) }),
|
|
2341
2341
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-success", children: formatCurrency(discountedImmediateCharge, prorationPreview.currency) })
|
|
2342
2342
|
] }) : formatCurrency(prorationPreview.immediateCharge, prorationPreview.currency) })
|
|
@@ -3265,9 +3265,9 @@ function PriceEditor({ productId, price, open, onOpenChange, onSuccess }) {
|
|
|
3265
3265
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkF3BPNQDBjs.DialogTitle, { children: isEditMode ? "Edit Price" : "Create Price" }),
|
|
3266
3266
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkF3BPNQDBjs.DialogDescription, { children: isEditMode ? "Update the price details. Note: Only nickname and active status can be changed." : "Create a new price for this product" })
|
|
3267
3267
|
] }),
|
|
3268
|
-
isEditMode && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-
|
|
3269
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.AlertCircle, { className: "h-5 w-5
|
|
3270
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-
|
|
3268
|
+
isEditMode && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bg-primary/10 border-primary/30 flex gap-x-3 rounded-lg border p-4", children: [
|
|
3269
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.AlertCircle, { className: "text-primary mt-0.5 h-5 w-5 flex-shrink-0" }),
|
|
3270
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-foreground text-sm", children: [
|
|
3271
3271
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "font-semibold mb-1", children: "Stripe Price Immutability" }),
|
|
3272
3272
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { children: "Due to Stripe's architecture, only the nickname and active status can be modified after creation. To change amount, currency, or billing interval, create a new price." })
|
|
3273
3273
|
] })
|